From: Andrea Amorese Date: Fri, 10 Sep 2021 08:19:54 +0000 (+0200) Subject: Built motion from commit e513bdb2.|2.5.345 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:;/%22?a=commitdiff_plain;h=e2527f87e39f383cc611d646da891aecbd9bbac1;p=motion2.git Built motion from commit e513bdb2.|2.5.345 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 7849bd6..1d991f1 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T07:44:51.578Z", + "time": "2021-09-10T08:04:40.836Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8262da8..1f5a7f6 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T07:44:51.578Z", + "time": "2021-09-10T08:04:40.836Z", "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 f2638cf..961b474 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 _0xdfa0=['urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','action','STRING','contactManager','motionbar','urlForward','browser','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]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x1b42c5,_0x319cd1){var _0x3a1d83=function(_0x1e0353){while(--_0x1e0353){_0x1b42c5['push'](_0x1b42c5['shift']());}};_0x3a1d83(++_0x319cd1);}(_0xdfa0,0x69));var _0x0dfa=function(_0x95d4c6,_0x131c4e){_0x95d4c6=_0x95d4c6-0x0;var _0x586165=_0xdfa0[_0x95d4c6];return _0x586165;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'get':function(_0x37ab88){return this['getDataValue'](_0x0dfa('0x2'));}},'action':{'type':Sequelize[_0x0dfa('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0dfa('0x4'),'integration',_0x0dfa('0x5'),'jscripty',_0x0dfa('0x6'),_0x0dfa('0x7'),'bot',_0x0dfa('0x8')]],'msg':_0x0dfa('0x9')}},'comment':_0x0dfa('0x9')},'data1':{'type':Sequelize[_0x0dfa('0x3')](0x1000),'comment':_0x0dfa('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0dfa('0xb')},'data3':{'type':Sequelize[_0x0dfa('0x3')](0x1000),'comment':_0x0dfa('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0dfa('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0dfa('0xe')},'data6':{'type':Sequelize[_0x0dfa('0x3')],'comments':_0x0dfa('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x0dfa('0x10')}}; \ No newline at end of file +var _0x7c09=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','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)]'];(function(_0x2a8ead,_0x595e7d){var _0x14ea81=function(_0x41c3ba){while(--_0x41c3ba){_0x2a8ead['push'](_0x2a8ead['shift']());}};_0x14ea81(++_0x595e7d);}(_0x7c09,0x102));var _0x97c0=function(_0x31ab85,_0x1a8001){_0x31ab85=_0x31ab85-0x0;var _0x5e7f39=_0x7c09[_0x31ab85];return _0x5e7f39;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'get':function(_0x53ad71){return this[_0x97c0('0x2')](_0x97c0('0x3'));}},'action':{'type':Sequelize[_0x97c0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x97c0('0x5'),_0x97c0('0x6'),_0x97c0('0x7'),_0x97c0('0x8'),'urlForward','browser','bot',_0x97c0('0x9')]],'msg':_0x97c0('0xa')}},'comment':_0x97c0('0xa')},'data1':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':_0x97c0('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xd')},'data4':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x97c0('0xe')},'data6':{'type':Sequelize[_0x97c0('0x4')],'comments':_0x97c0('0xf')},'data7':{'type':Sequelize[_0x97c0('0x10')],'comments':_0x97c0('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2c8d120..b8b21ac 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 _0x9921=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Action','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x19c106,_0x238007){var _0x3341d6=function(_0xf6f459){while(--_0xf6f459){_0x19c106['push'](_0x19c106['shift']());}};_0x3341d6(++_0x238007);}(_0x9921,0xb4));var _0x1992=function(_0x3d3e79,_0x5ef7ee){_0x3d3e79=_0x3d3e79-0x0;var _0x41499d=_0x9921[_0x3d3e79];return _0x41499d;};'use strict';var emlformat=require(_0x1992('0x0'));var rimraf=require(_0x1992('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1992('0x2'));var rp=require(_0x1992('0x3'));var moment=require('moment');var BPromise=require(_0x1992('0x4'));var Mustache=require(_0x1992('0x5'));var util=require(_0x1992('0x6'));var path=require('path');var sox=require(_0x1992('0x7'));var csv=require('to-csv');var ejs=require(_0x1992('0x8'));var fs=require('fs');var fs_extra=require(_0x1992('0x9'));var _=require('lodash');var squel=require(_0x1992('0xa'));var crypto=require(_0x1992('0xb'));var jsforce=require(_0x1992('0xc'));var deskjs=require(_0x1992('0xd'));var toCsv=require(_0x1992('0xe'));var querystring=require(_0x1992('0xf'));var Papa=require(_0x1992('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1992('0x11'));var as=require(_0x1992('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1992('0x13'))(_0x1992('0x14'));var utils=require(_0x1992('0x15'));var config=require(_0x1992('0x16'));var licenseUtil=require(_0x1992('0x17'));var db=require(_0x1992('0x18'))['db'];function respondWithStatusCode(_0x4eb520,_0x8b876f){_0x8b876f=_0x8b876f||0xcc;return function(_0x50bd6e){if(_0x50bd6e){return _0x4eb520[_0x1992('0x19')](_0x8b876f);}return _0x4eb520[_0x1992('0x1a')](_0x8b876f)[_0x1992('0x1b')]();};}function respondWithResult(_0x259043,_0x880409){_0x880409=_0x880409||0xc8;return function(_0x90441e){if(_0x90441e){return _0x259043[_0x1992('0x1a')](_0x880409)[_0x1992('0x1c')](_0x90441e);}};}function respondWithFilteredResult(_0x278953,_0x5122a1){return function(_0x36f48d){if(_0x36f48d){var _0x4491da=typeof _0x5122a1[_0x1992('0x1d')]==='undefined'&&typeof _0x5122a1[_0x1992('0x1e')]===_0x1992('0x1f');var _0x128e67=_0x36f48d['count'];var _0x9e92d7=_0x4491da?0x0:_0x5122a1['offset'];var _0x3a155c=_0x4491da?_0x36f48d[_0x1992('0x20')]:_0x5122a1['offset']+_0x5122a1[_0x1992('0x1e')];var _0x80a1f5;if(_0x3a155c>=_0x128e67){_0x3a155c=_0x128e67;_0x80a1f5=0xc8;}else{_0x80a1f5=0xce;}_0x278953['status'](_0x80a1f5);return _0x278953[_0x1992('0x21')](_0x1992('0x22'),_0x9e92d7+'-'+_0x3a155c+'/'+_0x128e67)['json'](_0x36f48d);}return null;};}function patchUpdates(_0xdb49ad){return function(_0xd94258){try{jsonpatch[_0x1992('0x23')](_0xd94258,_0xdb49ad,!![]);}catch(_0x23eb3f){return BPromise[_0x1992('0x24')](_0x23eb3f);}return _0xd94258[_0x1992('0x25')]();};}function saveUpdates(_0x530088,_0x5893be){return function(_0x2dd295){if(_0x2dd295){return _0x2dd295[_0x1992('0x26')](_0x530088)[_0x1992('0x27')](function(_0x14c8cf){return _0x14c8cf;});}return null;};}function removeEntity(_0x70c7bf,_0x450567){return function(_0x1c0b17){if(_0x1c0b17){return _0x1c0b17['destroy']()['then'](function(){_0x70c7bf[_0x1992('0x1a')](0xcc)[_0x1992('0x1b')]();});}};}function handleEntityNotFound(_0x1d2c1d,_0x57d96d){return function(_0xbc093a){if(!_0xbc093a){_0x1d2c1d[_0x1992('0x19')](0x194);}return _0xbc093a;};}function handleError(_0x32d4ab,_0x50049a){_0x50049a=_0x50049a||0x1f4;return function(_0x2ca622){logger[_0x1992('0x28')](_0x2ca622[_0x1992('0x29')]);if(_0x2ca622[_0x1992('0x2a')]){delete _0x2ca622[_0x1992('0x2a')];}_0x32d4ab['status'](_0x50049a)[_0x1992('0x2b')](_0x2ca622);};}exports['update']=function(_0x3d0441,_0x4fd027){if(_0x3d0441[_0x1992('0x2c')]['id']){delete _0x3d0441[_0x1992('0x2c')]['id'];}return db[_0x1992('0x2d')][_0x1992('0x2e')]({'where':{'id':_0x3d0441[_0x1992('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4fd027,null))[_0x1992('0x27')](saveUpdates(_0x3d0441[_0x1992('0x2c')],null))['then'](respondWithResult(_0x4fd027,null))[_0x1992('0x30')](handleError(_0x4fd027,null));};exports[_0x1992('0x31')]=function(_0x593a8b,_0x59e0d7){return db[_0x1992('0x2d')][_0x1992('0x2e')]({'where':{'id':_0x593a8b[_0x1992('0x2f')]['id']}})[_0x1992('0x27')](handleEntityNotFound(_0x59e0d7,null))[_0x1992('0x27')](removeEntity(_0x59e0d7,null))['catch'](handleError(_0x59e0d7,null));}; \ No newline at end of file +var _0xaf5e=['rimraf','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','body','Action','find','params','catch'];(function(_0x1f339f,_0x33c107){var _0x278e86=function(_0x3f8f16){while(--_0x3f8f16){_0x1f339f['push'](_0x1f339f['shift']());}};_0x278e86(++_0x33c107);}(_0xaf5e,0x142));var _0xeaf5=function(_0x3b8a62,_0x19c90c){_0x3b8a62=_0x3b8a62-0x0;var _0x22dce3=_0xaf5e[_0x3b8a62];return _0x22dce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaf5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeaf5('0x1'));var moment=require(_0xeaf5('0x2'));var BPromise=require(_0xeaf5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeaf5('0x4'));var sox=require(_0xeaf5('0x5'));var csv=require('to-csv');var ejs=require(_0xeaf5('0x6'));var fs=require('fs');var fs_extra=require(_0xeaf5('0x7'));var _=require('lodash');var squel=require(_0xeaf5('0x8'));var crypto=require(_0xeaf5('0x9'));var jsforce=require(_0xeaf5('0xa'));var deskjs=require(_0xeaf5('0xb'));var toCsv=require(_0xeaf5('0xc'));var querystring=require(_0xeaf5('0xd'));var Papa=require(_0xeaf5('0xe'));var Redis=require(_0xeaf5('0xf'));var authService=require(_0xeaf5('0x10'));var qs=require(_0xeaf5('0x11'));var as=require(_0xeaf5('0x12'));var hardwareService=require(_0xeaf5('0x13'));var logger=require(_0xeaf5('0x14'))('api');var utils=require(_0xeaf5('0x15'));var config=require(_0xeaf5('0x16'));var licenseUtil=require(_0xeaf5('0x17'));var db=require(_0xeaf5('0x18'))['db'];function respondWithStatusCode(_0x1d6bb5,_0x2f78fe){_0x2f78fe=_0x2f78fe||0xcc;return function(_0x4f802f){if(_0x4f802f){return _0x1d6bb5[_0xeaf5('0x19')](_0x2f78fe);}return _0x1d6bb5['status'](_0x2f78fe)['end']();};}function respondWithResult(_0x353e7a,_0x213b09){_0x213b09=_0x213b09||0xc8;return function(_0x430901){if(_0x430901){return _0x353e7a[_0xeaf5('0x1a')](_0x213b09)['json'](_0x430901);}};}function respondWithFilteredResult(_0x5354d2,_0x5d2ea9){return function(_0x472238){if(_0x472238){var _0xe4e4c7=typeof _0x5d2ea9[_0xeaf5('0x1b')]==='undefined'&&typeof _0x5d2ea9[_0xeaf5('0x1c')]===_0xeaf5('0x1d');var _0x4c985a=_0x472238[_0xeaf5('0x1e')];var _0xb7419b=_0xe4e4c7?0x0:_0x5d2ea9[_0xeaf5('0x1b')];var _0x3ae9b0=_0xe4e4c7?_0x472238[_0xeaf5('0x1e')]:_0x5d2ea9['offset']+_0x5d2ea9[_0xeaf5('0x1c')];var _0x4a8bf0;if(_0x3ae9b0>=_0x4c985a){_0x3ae9b0=_0x4c985a;_0x4a8bf0=0xc8;}else{_0x4a8bf0=0xce;}_0x5354d2['status'](_0x4a8bf0);return _0x5354d2['set'](_0xeaf5('0x1f'),_0xb7419b+'-'+_0x3ae9b0+'/'+_0x4c985a)['json'](_0x472238);}return null;};}function patchUpdates(_0x587131){return function(_0x17a4cc){try{jsonpatch[_0xeaf5('0x20')](_0x17a4cc,_0x587131,!![]);}catch(_0x2f09e0){return BPromise[_0xeaf5('0x21')](_0x2f09e0);}return _0x17a4cc['save']();};}function saveUpdates(_0x5d700f,_0x2ae0fc){return function(_0x5dcba4){if(_0x5dcba4){return _0x5dcba4[_0xeaf5('0x22')](_0x5d700f)[_0xeaf5('0x23')](function(_0x3d0afa){return _0x3d0afa;});}return null;};}function removeEntity(_0x25940a,_0x416b90){return function(_0x36155a){if(_0x36155a){return _0x36155a[_0xeaf5('0x24')]()[_0xeaf5('0x23')](function(){_0x25940a[_0xeaf5('0x1a')](0xcc)[_0xeaf5('0x25')]();});}};}function handleEntityNotFound(_0x1d8162,_0x3f594e){return function(_0x280b3a){if(!_0x280b3a){_0x1d8162[_0xeaf5('0x19')](0x194);}return _0x280b3a;};}function handleError(_0x749abd,_0x53facc){_0x53facc=_0x53facc||0x1f4;return function(_0xa57ad7){logger['error'](_0xa57ad7[_0xeaf5('0x26')]);if(_0xa57ad7[_0xeaf5('0x27')]){delete _0xa57ad7['name'];}_0x749abd['status'](_0x53facc)[_0xeaf5('0x28')](_0xa57ad7);};}exports[_0xeaf5('0x22')]=function(_0x5159be,_0x366ed1){if(_0x5159be[_0xeaf5('0x29')]['id']){delete _0x5159be[_0xeaf5('0x29')]['id'];}return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x5159be['params']['id']}})['then'](handleEntityNotFound(_0x366ed1,null))[_0xeaf5('0x23')](saveUpdates(_0x5159be['body'],null))['then'](respondWithResult(_0x366ed1,null))['catch'](handleError(_0x366ed1,null));};exports[_0xeaf5('0x24')]=function(_0x46819b,_0x14a9a2){return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x46819b[_0xeaf5('0x2c')]['id']}})[_0xeaf5('0x23')](handleEntityNotFound(_0x14a9a2,null))['then'](removeEntity(_0x14a9a2,null))[_0xeaf5('0x2d')](handleError(_0x14a9a2,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ea97594..4e3f328 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 _0x3eeb=['path','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x358854,_0x3eb2a2){var _0x467ade=function(_0x1999c0){while(--_0x1999c0){_0x358854['push'](_0x358854['shift']());}};_0x467ade(++_0x3eb2a2);}(_0x3eeb,0xf6));var _0xb3ee=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3eeb[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xb3ee('0x0'));var util=require(_0xb3ee('0x1'));var logger=require(_0xb3ee('0x2'))('api');var moment=require(_0xb3ee('0x3'));var BPromise=require(_0xb3ee('0x4'));var rp=require(_0xb3ee('0x5'));var fs=require('fs');var path=require(_0xb3ee('0x6'));var rimraf=require('rimraf');var config=require(_0xb3ee('0x7'));var attributes=require('./action.attributes');module[_0xb3ee('0x8')]=function(_0x432ebb,_0x16b148){return _0x432ebb[_0xb3ee('0x9')](_0xb3ee('0xa'),attributes,{'tableName':_0xb3ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1872=['rimraf','../../config/environment','Action','tools_actions','lodash','util','../../config/logger','request-promise','path'];(function(_0x151002,_0x1c9af6){var _0x1a7a58=function(_0x282ec3){while(--_0x282ec3){_0x151002['push'](_0x151002['shift']());}};_0x1a7a58(++_0x1c9af6);}(_0x1872,0xa6));var _0x2187=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x1872[_0xed01eb];return _0x25b9de;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var logger=require(_0x2187('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2187('0x3'));var fs=require('fs');var path=require(_0x2187('0x4'));var rimraf=require(_0x2187('0x5'));var config=require(_0x2187('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x111d4f,_0x4135be){return _0x111d4f['define'](_0x2187('0x7'),attributes,{'tableName':_0x2187('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 b8645f6..c9d115c 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x53ec,0x192));var _0xc53e=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x53ec[_0x4d08b8];return _0x70214a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3829e7,_0x21ea4e){var _0x30dc68=function(_0x37ca4a){while(--_0x37ca4a){_0x3829e7['push'](_0x3829e7['shift']());}};_0x30dc68(++_0x21ea4e);}(_0x326f,0xd1));var _0xf326=function(_0x4b4623,_0xb74b4d){_0x4b4623=_0x4b4623-0x0;var _0x10a138=_0x326f[_0x4b4623];return _0x10a138;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index fcf7cdb..d2e496a 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 _0x05fd=['path','connect-timeout','express','../../components/interaction/service','./action.controller','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1a44b0,_0x38d998){var _0x50bfab=function(_0x16248f){while(--_0x16248f){_0x1a44b0['push'](_0x1a44b0['shift']());}};_0x50bfab(++_0x38d998);}(_0x05fd,0x1ec));var _0xd05f=function(_0x251557,_0xbecf03){_0x251557=_0x251557-0x0;var _0x222fdc=_0x05fd[_0x251557];return _0x222fdc;};'use strict';var multer=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var path=require(_0xd05f('0x2'));var timeout=require(_0xd05f('0x3'));var express=require(_0xd05f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd05f('0x5'));var config=require('../../config/environment');var controller=require(_0xd05f('0x6'));router[_0xd05f('0x7')](_0xd05f('0x8'),auth['isAuthenticated'](),controller[_0xd05f('0x9')]);router[_0xd05f('0xa')](_0xd05f('0x8'),auth['isAuthenticated'](),controller[_0xd05f('0xb')]);module[_0xd05f('0xc')]=router; \ No newline at end of file +var _0x1cb5=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ee68a,_0x22c32e){var _0x16e095=function(_0x40df1e){while(--_0x40df1e){_0x5ee68a['push'](_0x5ee68a['shift']());}};_0x16e095(++_0x22c32e);}(_0x1cb5,0x79));var _0x51cb=function(_0x38ac54,_0x5cd5d6){_0x38ac54=_0x38ac54-0x0;var _0xa03d8a=_0x1cb5[_0x38ac54];return _0xa03d8a;};'use strict';var multer=require(_0x51cb('0x0'));var util=require(_0x51cb('0x1'));var path=require('path');var timeout=require(_0x51cb('0x2'));var express=require(_0x51cb('0x3'));var router=express[_0x51cb('0x4')]();var fs_extra=require(_0x51cb('0x5'));var auth=require(_0x51cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51cb('0x7'));var controller=require(_0x51cb('0x8'));router[_0x51cb('0x9')](_0x51cb('0xa'),auth['isAuthenticated'](),controller[_0x51cb('0xb')]);router[_0x51cb('0xc')](_0x51cb('0xa'),auth[_0x51cb('0xd')](),controller[_0x51cb('0xe')]);module[_0x51cb('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 100bd4d..14c64c5 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 _0xda19=['exports','STRING','TEXT'];(function(_0x2ec172,_0x3bc99c){var _0x26f45c=function(_0x18a448){while(--_0x18a448){_0x2ec172['push'](_0x2ec172['shift']());}};_0x26f45c(++_0x3bc99c);}(_0xda19,0xd5));var _0x9da1=function(_0x2c34d1,_0x1e141b){_0x2c34d1=_0x2c34d1-0x0;var _0x3eacb2=_0xda19[_0x2c34d1];return _0x3eacb2;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xee14=['STRING','TEXT'];(function(_0x15bd49,_0x5a6b04){var _0x5e5421=function(_0x1ee53d){while(--_0x1ee53d){_0x15bd49['push'](_0x15bd49['shift']());}};_0x5e5421(++_0x5a6b04);}(_0xee14,0x13a));var _0x4ee1=function(_0x25ea38,_0x3397c8){_0x25ea38=_0x25ea38-0x0;var _0x2cc556=_0xee14[_0x25ea38];return _0x2cc556;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index db6ee06..e4073b5 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 _0x9edd=['undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','type','key','model','keys','filters','attributes','query','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','options','count','include','findAll','show','params','rawAttributes','intersection','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','IS\x20NOT\x20NULL','value','Please\x20insert\x20at\x20least\x20one\x20field','order','parse','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','DATE(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9edd,0x137));var _0xd9ed=function(_0x49dd3e,_0x11005a){_0x49dd3e=_0x49dd3e-0x0;var _0x3705a6=_0x9edd[_0x49dd3e];return _0x3705a6;};'use strict';var emlformat=require(_0xd9ed('0x0'));var rimraf=require(_0xd9ed('0x1'));var zipdir=require(_0xd9ed('0x2'));var jsonpatch=require(_0xd9ed('0x3'));var rp=require(_0xd9ed('0x4'));var moment=require('moment');var BPromise=require(_0xd9ed('0x5'));var Mustache=require(_0xd9ed('0x6'));var util=require(_0xd9ed('0x7'));var path=require('path');var sox=require(_0xd9ed('0x8'));var csv=require(_0xd9ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9ed('0xa'));var _=require(_0xd9ed('0xb'));var squel=require('squel');var crypto=require(_0xd9ed('0xc'));var jsforce=require(_0xd9ed('0xd'));var deskjs=require(_0xd9ed('0xe'));var toCsv=require(_0xd9ed('0x9'));var querystring=require('querystring');var Papa=require(_0xd9ed('0xf'));var Redis=require(_0xd9ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd9ed('0x11'));var as=require(_0xd9ed('0x12'));var hardwareService=require(_0xd9ed('0x13'));var logger=require(_0xd9ed('0x14'))(_0xd9ed('0x15'));var utils=require(_0xd9ed('0x16'));var config=require(_0xd9ed('0x17'));var licenseUtil=require(_0xd9ed('0x18'));var db=require(_0xd9ed('0x19'))['db'];var dbH=require(_0xd9ed('0x19'))[_0xd9ed('0x1a')];function respondWithStatusCode(_0xe13534,_0x330160){_0x330160=_0x330160||0xcc;return function(_0x34b22a){if(_0x34b22a){return _0xe13534['sendStatus'](_0x330160);}return _0xe13534[_0xd9ed('0x1b')](_0x330160)[_0xd9ed('0x1c')]();};}function respondWithResult(_0xc40a00,_0x19ac9d){_0x19ac9d=_0x19ac9d||0xc8;return function(_0xfd93f9){if(_0xfd93f9){return _0xc40a00[_0xd9ed('0x1b')](_0x19ac9d)['json'](_0xfd93f9);}};}function respondWithFilteredResult(_0x187efb,_0x52693a){return function(_0x1d2078){if(_0x1d2078){var _0x47194f=typeof _0x52693a['offset']===_0xd9ed('0x1d')&&typeof _0x52693a['limit']===_0xd9ed('0x1d');var _0x332401=_0x1d2078['count'];var _0x3a66d5=_0x47194f?0x0:_0x52693a['offset'];var _0x267adc=_0x47194f?_0x1d2078['count']:_0x52693a['offset']+_0x52693a[_0xd9ed('0x1e')];var _0x5a17fb;if(_0x267adc>=_0x332401){_0x267adc=_0x332401;_0x5a17fb=0xc8;}else{_0x5a17fb=0xce;}_0x187efb[_0xd9ed('0x1b')](_0x5a17fb);return _0x187efb[_0xd9ed('0x1f')](_0xd9ed('0x20'),_0x3a66d5+'-'+_0x267adc+'/'+_0x332401)[_0xd9ed('0x21')](_0x1d2078);}return null;};}function patchUpdates(_0x505c53){return function(_0x39cd49){try{jsonpatch[_0xd9ed('0x22')](_0x39cd49,_0x505c53,!![]);}catch(_0x80becc){return BPromise['reject'](_0x80becc);}return _0x39cd49[_0xd9ed('0x23')]();};}function saveUpdates(_0x31d58d,_0x1562fb){return function(_0x59e687){if(_0x59e687){return _0x59e687[_0xd9ed('0x24')](_0x31d58d)[_0xd9ed('0x25')](function(_0x9c5239){return _0x9c5239;});}return null;};}function removeEntity(_0x53dae9,_0x4a4034){return function(_0x1d0306){if(_0x1d0306){return _0x1d0306[_0xd9ed('0x26')]()[_0xd9ed('0x25')](function(){var _0xc9287=_0x1d0306['get']({'plain':!![]});var _0x3ed28d=_0xd9ed('0x27');return db[_0xd9ed('0x28')][_0xd9ed('0x26')]({'where':{'type':_0x3ed28d,'resourceId':_0xc9287['id']}})[_0xd9ed('0x25')](function(){return _0x1d0306;});})[_0xd9ed('0x25')](function(){_0x53dae9[_0xd9ed('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x479318,_0xde63c0){return function(_0x2a843d){if(!_0x2a843d){_0x479318[_0xd9ed('0x29')](0x194);}return _0x2a843d;};}function handleError(_0x338e7a,_0x131e75){_0x131e75=_0x131e75||0x1f4;return function(_0xa5f13){logger[_0xd9ed('0x2a')](_0xa5f13[_0xd9ed('0x2b')]);if(_0xa5f13[_0xd9ed('0x2c')]){delete _0xa5f13[_0xd9ed('0x2c')];}_0x338e7a['status'](_0x131e75)['send'](_0xa5f13);};}exports[_0xd9ed('0x2d')]=function(_0x40f0da,_0x13be50){var _0x4c5e2d={},_0x33981={},_0x26dd49={'count':0x0,'rows':[]};var _0x476427=_[_0xd9ed('0x2e')](db[_0xd9ed('0x2f')]['rawAttributes'],function(_0x3f2534){return{'name':_0x3f2534['fieldName'],'type':_0x3f2534[_0xd9ed('0x30')][_0xd9ed('0x31')]};});_0x33981[_0xd9ed('0x32')]=_[_0xd9ed('0x2e')](_0x476427,_0xd9ed('0x2c'));_0x33981['query']=_[_0xd9ed('0x33')](_0x40f0da['query']);_0x33981[_0xd9ed('0x34')]=_['intersection'](_0x33981[_0xd9ed('0x32')],_0x33981['query']);_0x4c5e2d[_0xd9ed('0x35')]=_['intersection'](_0x33981[_0xd9ed('0x32')],qs['fields'](_0x40f0da[_0xd9ed('0x36')][_0xd9ed('0x37')]));_0x4c5e2d['attributes']=_0x4c5e2d[_0xd9ed('0x35')][_0xd9ed('0x38')]?_0x4c5e2d['attributes']:_0x33981['model'];if(!_0x40f0da[_0xd9ed('0x36')][_0xd9ed('0x39')](_0xd9ed('0x3a'))){_0x4c5e2d[_0xd9ed('0x1e')]=qs['limit'](_0x40f0da[_0xd9ed('0x36')][_0xd9ed('0x1e')]);_0x4c5e2d[_0xd9ed('0x3b')]=qs['offset'](_0x40f0da['query'][_0xd9ed('0x3b')]);}_0x4c5e2d['order']=qs['sort'](_0x40f0da[_0xd9ed('0x36')][_0xd9ed('0x3c')]);_0x4c5e2d[_0xd9ed('0x3d')]=qs[_0xd9ed('0x34')](_[_0xd9ed('0x3e')](_0x40f0da[_0xd9ed('0x36')],_0x33981[_0xd9ed('0x34')]),_0x476427);if(_0x40f0da['query'][_0xd9ed('0x3f')]){_0x4c5e2d[_0xd9ed('0x3d')]=_[_0xd9ed('0x40')](_0x4c5e2d['where'],{'$or':_['map'](_0x476427,function(_0x48b7c9){if(_0x48b7c9[_0xd9ed('0x30')]!=='VIRTUAL'){var _0xb34d4f={};_0xb34d4f[_0x48b7c9[_0xd9ed('0x2c')]]={'$like':'%'+_0x40f0da[_0xd9ed('0x36')][_0xd9ed('0x3f')]+'%'};return _0xb34d4f;}})});}_0x4c5e2d=_['merge']({},_0x4c5e2d,_0x40f0da[_0xd9ed('0x41')]);var _0x181af7={'where':_0x4c5e2d[_0xd9ed('0x3d')]};return db[_0xd9ed('0x2f')]['count'](_0x181af7)[_0xd9ed('0x25')](function(_0x2414fb){_0x26dd49[_0xd9ed('0x42')]=_0x2414fb;if(_0x40f0da[_0xd9ed('0x36')]['includeAll']){_0x4c5e2d[_0xd9ed('0x43')]=[{'all':!![]}];}return db[_0xd9ed('0x2f')][_0xd9ed('0x44')](_0x4c5e2d);})[_0xd9ed('0x25')](function(_0x53ef98){_0x26dd49['rows']=_0x53ef98;return _0x26dd49;})['then'](respondWithFilteredResult(_0x13be50,_0x4c5e2d))['catch'](handleError(_0x13be50,null));};exports[_0xd9ed('0x45')]=function(_0x400988,_0x302bc3){var _0x58adf8={'raw':![],'where':{'id':_0x400988[_0xd9ed('0x46')]['id']}},_0x456674={};_0x456674['model']=_[_0xd9ed('0x33')](db[_0xd9ed('0x2f')][_0xd9ed('0x47')]);_0x456674[_0xd9ed('0x36')]=_[_0xd9ed('0x33')](_0x400988['query']);_0x456674['filters']=_['intersection'](_0x456674[_0xd9ed('0x32')],_0x456674['query']);_0x58adf8[_0xd9ed('0x35')]=_[_0xd9ed('0x48')](_0x456674['model'],qs['fields'](_0x400988[_0xd9ed('0x36')][_0xd9ed('0x37')]));_0x58adf8[_0xd9ed('0x35')]=_0x58adf8['attributes'][_0xd9ed('0x38')]?_0x58adf8['attributes']:_0x456674['model'];if(_0x400988[_0xd9ed('0x36')][_0xd9ed('0x49')]){_0x58adf8[_0xd9ed('0x43')]=[{'all':!![]}];}_0x58adf8=_[_0xd9ed('0x40')]({},_0x58adf8,_0x400988[_0xd9ed('0x41')]);return db[_0xd9ed('0x2f')][_0xd9ed('0x4a')](_0x58adf8)[_0xd9ed('0x25')](handleEntityNotFound(_0x302bc3,null))['then'](respondWithResult(_0x302bc3,null))['catch'](handleError(_0x302bc3,null));};exports[_0xd9ed('0x4b')]=function(_0x38e82a,_0x35df7b){return db['AnalyticCustomReport'][_0xd9ed('0x4b')](_0x38e82a['body'],{})[_0xd9ed('0x25')](function(_0x2598c6){var _0x1abcff=_0x38e82a[_0xd9ed('0x4c')][_0xd9ed('0x4d')]({'plain':!![]});if(!_0x1abcff)throw new Error(_0xd9ed('0x4e'));if(_0x1abcff[_0xd9ed('0x4f')]===_0xd9ed('0x4c')){var _0xbb0c87=_0x2598c6[_0xd9ed('0x4d')]({'plain':!![]});var _0x424b2e=_0xd9ed('0x50');return db['UserProfileSection'][_0xd9ed('0x4a')]({'where':{'name':_0x424b2e,'userProfileId':_0x1abcff[_0xd9ed('0x51')]},'raw':!![]})[_0xd9ed('0x25')](function(_0x45df13){if(_0x45df13&&_0x45df13[_0xd9ed('0x52')]===0x0){return db[_0xd9ed('0x28')][_0xd9ed('0x4b')]({'name':_0xbb0c87[_0xd9ed('0x2c')],'resourceId':_0xbb0c87['id'],'type':'CustomReports','sectionId':_0x45df13['id']},{})[_0xd9ed('0x25')](function(){return _0x2598c6;});}else{return _0x2598c6;}})['catch'](function(_0x353eee){logger[_0xd9ed('0x2a')](_0xd9ed('0x53'),_0x353eee);throw _0x353eee;});}return _0x2598c6;})[_0xd9ed('0x25')](respondWithResult(_0x35df7b,0xc9))[_0xd9ed('0x54')](handleError(_0x35df7b,null));};exports[_0xd9ed('0x24')]=function(_0x4d489b,_0x57bd68){if(_0x4d489b[_0xd9ed('0x55')]['id']){delete _0x4d489b[_0xd9ed('0x55')]['id'];}return db['AnalyticCustomReport'][_0xd9ed('0x4a')]({'where':{'id':_0x4d489b[_0xd9ed('0x46')]['id']}})['then'](handleEntityNotFound(_0x57bd68,null))[_0xd9ed('0x25')](saveUpdates(_0x4d489b[_0xd9ed('0x55')],null))[_0xd9ed('0x25')](respondWithResult(_0x57bd68,null))['catch'](handleError(_0x57bd68,null));};exports['destroy']=function(_0x4ed7fa,_0x52725d){return db[_0xd9ed('0x2f')][_0xd9ed('0x4a')]({'where':{'id':_0x4ed7fa['params']['id']}})[_0xd9ed('0x25')](handleEntityNotFound(_0x52725d,null))[_0xd9ed('0x25')](removeEntity(_0x52725d,null))[_0xd9ed('0x54')](handleError(_0x52725d,null));};exports[_0xd9ed('0x56')]=function(_0x43816a,_0xe57981){var _0x53931f=0xa;var _0x581161=[_0xd9ed('0x57'),_0xd9ed('0x58'),_0xd9ed('0x59'),_0xd9ed('0x5a')];var _0x4dfe53={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd9ed('0x5b'),'MAX':'MAX(%s)','MIN':_0xd9ed('0x5c'),'AVG':_0xd9ed('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd9ed('0x5e'),'GROUP_CONCAT DESC':_0xd9ed('0x5f')};var _0xaaf864={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd9ed('0x60'),'ROUND':_0xd9ed('0x61'),'UNIX_TIMESTAMP':_0xd9ed('0x62')};var _0x3ca1c5=function(_0x4a924d){return!_[_0xd9ed('0x63')]([_0xd9ed('0x64'),'IS\x20NOT\x20NULL',_0xd9ed('0x65'),_0xd9ed('0x66')],_0x4a924d);};var _0x2762cc=function(_0x1d593b){if(!_0x1d593b||!_0x1d593b[_0xd9ed('0x67')][_0xd9ed('0x38')]){return'';}for(var _0x285213='(',_0x23679e=0x0;_0x23679e<_0x1d593b[_0xd9ed('0x67')][_0xd9ed('0x38')];_0x23679e+=0x1){_0x23679e>0x0&&(_0x285213+='\x20'+_0x1d593b[_0xd9ed('0x68')]+'\x20');_0x285213+=_0x1d593b[_0xd9ed('0x67')][_0x23679e][_0xd9ed('0x69')]?_0x2762cc(_0x1d593b[_0xd9ed('0x67')][_0x23679e][_0xd9ed('0x69')]):_0x1d593b[_0xd9ed('0x67')][_0x23679e][_0xd9ed('0x6a')]+'\x20'+_0x1d593b[_0xd9ed('0x67')][_0x23679e][_0xd9ed('0x6b')]+(_0x3ca1c5(_0x1d593b[_0xd9ed('0x67')][_0x23679e]['condition'])?'\x20'+_0x1d593b[_0xd9ed('0x67')][_0x23679e]['value']:'');}return _0x285213+')';};var _0x3ca159={'where':{'id':_0x43816a[_0xd9ed('0x46')]['id']}},_0x28ee8c,_0x45be3e,_0x322fe5,_0x243593,_0x352844;_0x3ca159=_[_0xd9ed('0x40')]({},_0x3ca159,_0x43816a[_0xd9ed('0x41')]);return db['AnalyticCustomReport'][_0xd9ed('0x4a')](_0x3ca159)[_0xd9ed('0x25')](function(_0x3ce3ab){if(_0x3ce3ab){_0x28ee8c=_0x3ce3ab;return _0x3ce3ab[_0xd9ed('0x6c')]();}return null;})['then'](function(_0x5d819e){if(_0x5d819e){if(!_0x5d819e['length']){throw new db[(_0xd9ed('0x6d'))][(_0xd9ed('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x45be3e=_0x5d819e;return db[_0xd9ed('0x6f')][_0xd9ed('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1301ba){if(_0x1301ba){_0x322fe5=_[_0xd9ed('0x70')](_0x1301ba,'id');var _0x260835;var _0x46919c=squel[_0xd9ed('0x71')]();_0x46919c[_0xd9ed('0x72')](_0x28ee8c[_0xd9ed('0x73')]);for(var _0xc32ad8=0x0;_0xc32ad8<_0x45be3e['length'];_0xc32ad8+=0x1){_0x260835=_0x45be3e[_0xc32ad8][_0xd9ed('0x74')]?_0x322fe5[_0x45be3e[_0xc32ad8][_0xd9ed('0x74')]][_0xd9ed('0x75')]:_0x45be3e[_0xc32ad8][_0xd9ed('0x6a')];_0x260835=_0x45be3e[_0xc32ad8]['function']?_[_0xd9ed('0x76')](_0x4dfe53[_0x45be3e[_0xc32ad8][_0xd9ed('0x77')]],'%s',_0x260835):_0x260835;_0x260835=_0x45be3e[_0xc32ad8][_0xd9ed('0x78')]?_['replace'](_0xaaf864[_0x45be3e[_0xc32ad8][_0xd9ed('0x78')]],'%s',_0x260835):_0x260835;if(_0x45be3e[_0xc32ad8][_0xd9ed('0x79')]){_0x46919c['group'](_0x260835);}_0x45be3e[_0xc32ad8][_0xd9ed('0x7a')]&&_0x46919c['order'](_0x260835,_0x45be3e[_0xc32ad8][_0xd9ed('0x7a')]===_0xd9ed('0x7b')?![]:!![]);_0x46919c[_0xd9ed('0x6a')](_0x260835,_0x45be3e[_0xc32ad8][_0xd9ed('0x7c')]||_0x260835);}if(_0x28ee8c[_0xd9ed('0x7d')]){_0x28ee8c[_0xd9ed('0x7d')]=JSON['parse'](_0x28ee8c[_0xd9ed('0x7d')]);for(var _0x4e4abf=0x0;_0x4e4abf<_0x28ee8c[_0xd9ed('0x7d')][_0xd9ed('0x38')];_0x4e4abf+=0x1){if(_0x28ee8c['joins'][_0x4e4abf][_0xd9ed('0x30')]&&_['includes'](_0x581161,_0x28ee8c['joins'][_0x4e4abf][_0xd9ed('0x30')])&&_0x28ee8c['joins'][_0x4e4abf][_0xd9ed('0x7e')]&&_0x28ee8c[_0xd9ed('0x7d')][_0x4e4abf][_0xd9ed('0x7f')]&&_0x28ee8c[_0xd9ed('0x7d')][_0x4e4abf][_0xd9ed('0x80')]){_0x46919c[_0x28ee8c['joins'][_0x4e4abf]['type']](_0x28ee8c[_0xd9ed('0x7d')][_0x4e4abf]['foreignTable'],null,util[_0xd9ed('0x78')]('%s.%s\x20=\x20%s.%s',_0x28ee8c[_0xd9ed('0x73')],_0x28ee8c['joins'][_0x4e4abf][_0xd9ed('0x7e')],_0x28ee8c[_0xd9ed('0x7d')][_0x4e4abf][_0xd9ed('0x7f')],_0x28ee8c[_0xd9ed('0x7d')][_0x4e4abf]['foreignKey']));}}}if(_0x28ee8c[_0xd9ed('0x81')]){_0x28ee8c[_0xd9ed('0x81')]=JSON['parse'](_0x28ee8c[_0xd9ed('0x81')]);_0x46919c['where'](_0x2762cc(_0x28ee8c[_0xd9ed('0x81')][_0xd9ed('0x69')]));}_0x352844=_0x46919c[_0xd9ed('0x82')]();_0x46919c[_0xd9ed('0x1e')](_0x53931f);_0x46919c[_0xd9ed('0x3b')](0x0);logger[_0xd9ed('0x83')](_0xd9ed('0x84'),_0x46919c[_0xd9ed('0x85')]());return dbH[_0xd9ed('0x86')]['query'](_0x46919c[_0xd9ed('0x85')](),{'type':dbH[_0xd9ed('0x86')][_0xd9ed('0x87')][_0xd9ed('0x88')]});}})[_0xd9ed('0x25')](respondWithResult(_0xe57981,null))[_0xd9ed('0x54')](handleError(_0xe57981,null));};function runReport(_0x45a7ec,_0x5001e7,_0xae81f9){var _0x197943=_0x5001e7[_0xd9ed('0x2c')];var _0x58ea7f=0xa;var _0x3a06fe=[_0xd9ed('0x57'),'left_join',_0xd9ed('0x59'),_0xd9ed('0x5a')];var _0x322f1d={'SUM':_0xd9ed('0x89'),'COUNT':_0xd9ed('0x8a'),'COUNT DISTINCT':_0xd9ed('0x5b'),'MAX':_0xd9ed('0x8b'),'MIN':_0xd9ed('0x5c'),'AVG':_0xd9ed('0x5d'),'GROUP_CONCAT':_0xd9ed('0x8c'),'GROUP_CONCAT ASC':_0xd9ed('0x5e'),'GROUP_CONCAT DESC':_0xd9ed('0x5f')};var _0x5a0445={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd9ed('0x61'),'UNIX_TIMESTAMP':_0xd9ed('0x62')};var _0x5b5a0a=function(_0x26f794){return!_['includes']([_0xd9ed('0x64'),_0xd9ed('0x8d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x26f794);};var _0x2cc041=function(_0x402ae6){if(!_0x402ae6||!_0x402ae6[_0xd9ed('0x67')][_0xd9ed('0x38')]){return'';}for(var _0x58222b='(',_0x1773c9=0x0;_0x1773c9<_0x402ae6[_0xd9ed('0x67')][_0xd9ed('0x38')];_0x1773c9+=0x1){_0x1773c9>0x0&&(_0x58222b+='\x20'+_0x402ae6[_0xd9ed('0x68')]+'\x20');_0x58222b+=_0x402ae6[_0xd9ed('0x67')][_0x1773c9][_0xd9ed('0x69')]?_0x2cc041(_0x402ae6[_0xd9ed('0x67')][_0x1773c9]['group']):_0x402ae6[_0xd9ed('0x67')][_0x1773c9][_0xd9ed('0x6a')]+'\x20'+_0x402ae6['rules'][_0x1773c9][_0xd9ed('0x6b')]+(_0x5b5a0a(_0x402ae6[_0xd9ed('0x67')][_0x1773c9][_0xd9ed('0x6b')])?'\x20'+_0x402ae6['rules'][_0x1773c9][_0xd9ed('0x8e')]:'');}return _0x58222b+')';};var _0x3248a8={'where':{'id':_0x45a7ec['id']}},_0x21cb27,_0x212a4c,_0x27b349,_0x3235a2,_0x3f2e52;_0x3248a8=_[_0xd9ed('0x40')]({},_0x3248a8,_0xae81f9);return db[_0xd9ed('0x2f')][_0xd9ed('0x4a')](_0x3248a8)[_0xd9ed('0x25')](function(_0x1bb224){if(_0x1bb224){_0x21cb27=_0x1bb224;return _0x1bb224[_0xd9ed('0x6c')]();}return null;})[_0xd9ed('0x25')](function(_0x4a0aef){if(_0x4a0aef){if(!_0x4a0aef[_0xd9ed('0x38')]){throw new db['Sequelize'][(_0xd9ed('0x6e'))](_0xd9ed('0x8f'),0x193);}_0x212a4c=_0x4a0aef;return db[_0xd9ed('0x6f')][_0xd9ed('0x44')]({'raw':!![]});}return null;})[_0xd9ed('0x25')](function(_0x40e891){if(_0x40e891){_0x27b349=_[_0xd9ed('0x70')](_0x40e891,'id');var _0x5d276d;var _0x3689ef=squel[_0xd9ed('0x71')]();_0x3689ef[_0xd9ed('0x72')](_0x21cb27[_0xd9ed('0x73')]);for(var _0x2ecec4=0x0;_0x2ecec4<_0x212a4c[_0xd9ed('0x38')];_0x2ecec4+=0x1){_0x5d276d=_0x212a4c[_0x2ecec4][_0xd9ed('0x74')]?_0x27b349[_0x212a4c[_0x2ecec4]['MetricId']][_0xd9ed('0x75')]:_0x212a4c[_0x2ecec4][_0xd9ed('0x6a')];_0x5d276d=_0x212a4c[_0x2ecec4][_0xd9ed('0x77')]?_['replace'](_0x322f1d[_0x212a4c[_0x2ecec4][_0xd9ed('0x77')]],'%s',_0x5d276d):_0x5d276d;_0x5d276d=_0x212a4c[_0x2ecec4][_0xd9ed('0x78')]?_[_0xd9ed('0x76')](_0x5a0445[_0x212a4c[_0x2ecec4][_0xd9ed('0x78')]],'%s',_0x5d276d):_0x5d276d;if(_0x212a4c[_0x2ecec4][_0xd9ed('0x79')]){_0x3689ef[_0xd9ed('0x69')](_0x5d276d);}_0x212a4c[_0x2ecec4][_0xd9ed('0x7a')]&&_0x3689ef[_0xd9ed('0x90')](_0x5d276d,_0x212a4c[_0x2ecec4][_0xd9ed('0x7a')]===_0xd9ed('0x7b')?![]:!![]);_0x3689ef['field'](_0x5d276d,_0x212a4c[_0x2ecec4]['alias']||_0x5d276d);}if(_0x21cb27[_0xd9ed('0x7d')]){_0x21cb27[_0xd9ed('0x7d')]=JSON[_0xd9ed('0x91')](_0x21cb27['joins']);for(var _0x4e1a07=0x0;_0x4e1a07<_0x21cb27[_0xd9ed('0x7d')][_0xd9ed('0x38')];_0x4e1a07+=0x1){if(_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x30')]&&_[_0xd9ed('0x63')](_0x3a06fe,_0x21cb27['joins'][_0x4e1a07]['type'])&&_0x21cb27['joins'][_0x4e1a07][_0xd9ed('0x7e')]&&_0x21cb27['joins'][_0x4e1a07][_0xd9ed('0x7f')]&&_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x80')]){_0x3689ef[_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x30')]](_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x7f')],null,util[_0xd9ed('0x78')](_0xd9ed('0x92'),_0x21cb27['table'],_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07]['parentKey'],_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x7f')],_0x21cb27[_0xd9ed('0x7d')][_0x4e1a07][_0xd9ed('0x80')]));}}}if(_0x21cb27[_0xd9ed('0x81')]){_0x21cb27['conditions']=JSON['parse'](_0x21cb27[_0xd9ed('0x81')]);_0x3689ef[_0xd9ed('0x3d')](_0x2cc041(_0x21cb27[_0xd9ed('0x81')][_0xd9ed('0x69')]));}_0x3f2e52=_0x3689ef['clone']();_0x3689ef[_0xd9ed('0x1e')](_0x58ea7f);_0x3689ef[_0xd9ed('0x3b')](0x0);return;}})[_0xd9ed('0x25')](function(){if(_0x5001e7[_0xd9ed('0x93')]===_0xd9ed('0x94')){return null;}var _0x1a390c=_[_0xd9ed('0x40')](_0x5001e7,{'name':_0x5001e7['fullPath']||_0x5001e7[_0xd9ed('0x2c')]||_0x21cb27[_0xd9ed('0x2c')],'basename':_0x197943,'savename':util['format'](_0xd9ed('0x95'),_0x5001e7[_0xd9ed('0x2c')]||_0x21cb27[_0xd9ed('0x2c')],require(_0xd9ed('0x96'))['generate'](0x4),_0x5001e7[_0xd9ed('0x93')]||_0xd9ed('0x97')),'reportId':_0x21cb27['id'],'reportType':_0xd9ed('0x98')});return db[_0xd9ed('0x99')]['create'](_0x1a390c,{'raw':!![]});})[_0xd9ed('0x25')](function(_0xb22b0d){if(_0x21cb27[_0xd9ed('0x73')]===_0xd9ed('0x9a')){_0x3f2e52['where'](_0x21cb27[_0xd9ed('0x73')]+_0xd9ed('0x9b'),_0x5001e7['startDate'],_0x5001e7[_0xd9ed('0x9c')]);}else{_0x3f2e52[_0xd9ed('0x3d')](_0x21cb27[_0xd9ed('0x73')]+_0xd9ed('0x9d'),_0x5001e7[_0xd9ed('0x9e')],_0x5001e7[_0xd9ed('0x9c')]);}if(_0xb22b0d){logger['info']('Run\x20Query:',_0x3f2e52[_0xd9ed('0x85')]());require(_0xd9ed('0x9f'))[_0xd9ed('0xa0')](path[_0xd9ed('0x57')](__dirname,_0xd9ed('0xa1'),_0xb22b0d[_0xd9ed('0x93')]),[_0xb22b0d['id'],_0x3f2e52[_0xd9ed('0x85')](),path[_0xd9ed('0x57')](__dirname,_0xd9ed('0xa2'),_0xb22b0d[_0xd9ed('0xa3')]),_0x197943]);return _0xb22b0d;}else{var _0x150050=squel[_0xd9ed('0x71')]();_0x150050[_0xd9ed('0x72')]('('+_0x3f2e52[_0xd9ed('0x85')]()+')',_0xd9ed('0xa4'));_0x150050[_0xd9ed('0x6a')](_0xd9ed('0xa5'),_0xd9ed('0x42'));_0x3f2e52[_0xd9ed('0x1e')](_0x5001e7[_0xd9ed('0x1e')]||_0x58ea7f);_0x3f2e52[_0xd9ed('0x3b')](_0x5001e7['offset']||0x0);return dbH[_0xd9ed('0x86')][_0xd9ed('0x36')](_0x150050['toString'](),{'type':dbH[_0xd9ed('0x86')][_0xd9ed('0x87')]['SELECT']})[_0xd9ed('0x25')](function(_0x4840e){if(!_0x4840e['length']){_0x3235a2=0x0;}else{_0x3235a2=_0x4840e[0x0]['count']||0x0;}return dbH['sequelize'][_0xd9ed('0x36')](_0x3f2e52['toString'](),{'type':dbH[_0xd9ed('0x86')][_0xd9ed('0x87')][_0xd9ed('0x88')]});})[_0xd9ed('0x25')](function(_0x50615e){return{'rows':_0x50615e||[],'count':_0x3235a2};});}});}exports[_0xd9ed('0xa6')]=function(_0x2ae319,_0x2ac150){return runReport(_0x2ae319[_0xd9ed('0x46')],_0x2ae319[_0xd9ed('0x36')],_0x2ae319[_0xd9ed('0x41')])['then'](respondWithResult(_0x2ac150,null))['catch'](handleError(_0x2ac150,null));};exports[_0xd9ed('0xa7')]=runReport;exports['query']=function(_0x2219af,_0x510b26){var _0xc8e86d=0xa;var _0x35a4d8=['join',_0xd9ed('0x58'),'right_join',_0xd9ed('0x5a')];var _0x246384={'SUM':_0xd9ed('0x89'),'COUNT':_0xd9ed('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd9ed('0x8b'),'MIN':_0xd9ed('0x5c'),'AVG':_0xd9ed('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x57bb3d={'SEC_TO_TIME':_0xd9ed('0xa8'),'DATE':_0xd9ed('0xa9'),'HOUR':_0xd9ed('0x60'),'ROUND':_0xd9ed('0x61'),'UNIX_TIMESTAMP':_0xd9ed('0x62')};var _0x53a8f4=function(_0x76bd7d){return!_[_0xd9ed('0x63')]([_0xd9ed('0x64'),_0xd9ed('0x8d'),_0xd9ed('0x65'),'IS\x20NOT\x20EMPTY'],_0x76bd7d);};var _0x18741d=function(_0x2e0bf2){if(!_0x2e0bf2||!_0x2e0bf2[_0xd9ed('0x67')][_0xd9ed('0x38')]){return'';}for(var _0x1332a3='(',_0x37a75c=0x0;_0x37a75c<_0x2e0bf2[_0xd9ed('0x67')]['length'];_0x37a75c+=0x1){_0x37a75c>0x0&&(_0x1332a3+='\x20'+_0x2e0bf2['operator']+'\x20');_0x1332a3+=_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c][_0xd9ed('0x69')]?_0x18741d(_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c]['group']):_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c][_0xd9ed('0x6a')]+'\x20'+_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c][_0xd9ed('0x6b')]+(_0x53a8f4(_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c][_0xd9ed('0x6b')])?'\x20'+_0x2e0bf2[_0xd9ed('0x67')][_0x37a75c][_0xd9ed('0x8e')]:'');}return _0x1332a3+')';};var _0x160a37={'where':{'id':_0x2219af['params']['id']}},_0x5264a7,_0x1aa3ce,_0x4fd245,_0x30a264,_0x96064c;_0x160a37=_[_0xd9ed('0x40')]({},_0x160a37,_0x2219af['options']);return db[_0xd9ed('0x2f')][_0xd9ed('0x4a')](_0x160a37)[_0xd9ed('0x25')](function(_0x93581b){if(_0x93581b){_0x5264a7=_0x93581b;return _0x93581b[_0xd9ed('0x6c')]();}return null;})['then'](function(_0xd3cfac){if(_0xd3cfac){if(!_0xd3cfac['length']){throw new db[(_0xd9ed('0x6d'))][(_0xd9ed('0x6e'))](_0xd9ed('0x8f'),0x193);}_0x1aa3ce=_0xd3cfac;return db[_0xd9ed('0x6f')][_0xd9ed('0x44')]({'raw':!![]});}return null;})[_0xd9ed('0x25')](function(_0x42670d){if(_0x42670d){_0x4fd245=_[_0xd9ed('0x70')](_0x42670d,'id');var _0x2098d0;var _0x121f56=squel[_0xd9ed('0x71')]();_0x121f56['from'](_0x5264a7[_0xd9ed('0x73')]);for(var _0x1bbc14=0x0;_0x1bbc14<_0x1aa3ce[_0xd9ed('0x38')];_0x1bbc14+=0x1){_0x2098d0=_0x1aa3ce[_0x1bbc14][_0xd9ed('0x74')]?_0x4fd245[_0x1aa3ce[_0x1bbc14][_0xd9ed('0x74')]]['metric']:_0x1aa3ce[_0x1bbc14][_0xd9ed('0x6a')];_0x2098d0=_0x1aa3ce[_0x1bbc14][_0xd9ed('0x77')]?_[_0xd9ed('0x76')](_0x246384[_0x1aa3ce[_0x1bbc14][_0xd9ed('0x77')]],'%s',_0x2098d0):_0x2098d0;_0x2098d0=_0x1aa3ce[_0x1bbc14][_0xd9ed('0x78')]?_[_0xd9ed('0x76')](_0x57bb3d[_0x1aa3ce[_0x1bbc14]['format']],'%s',_0x2098d0):_0x2098d0;if(_0x1aa3ce[_0x1bbc14]['groupBy']){_0x121f56['group'](_0x2098d0);}_0x1aa3ce[_0x1bbc14]['orderBy']&&_0x121f56[_0xd9ed('0x90')](_0x2098d0,_0x1aa3ce[_0x1bbc14][_0xd9ed('0x7a')]==='DESC'?![]:!![]);_0x121f56[_0xd9ed('0x6a')](_0x2098d0,_0x1aa3ce[_0x1bbc14][_0xd9ed('0x7c')]||_0x2098d0);}if(_0x5264a7[_0xd9ed('0x7d')]){_0x5264a7[_0xd9ed('0x7d')]=JSON['parse'](_0x5264a7['joins']);for(var _0x3c9456=0x0;_0x3c9456<_0x5264a7[_0xd9ed('0x7d')][_0xd9ed('0x38')];_0x3c9456+=0x1){if(_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x30')]&&_[_0xd9ed('0x63')](_0x35a4d8,_0x5264a7[_0xd9ed('0x7d')][_0x3c9456]['type'])&&_0x5264a7[_0xd9ed('0x7d')][_0x3c9456]['parentKey']&&_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x7f')]&&_0x5264a7[_0xd9ed('0x7d')][_0x3c9456]['foreignKey']){_0x121f56[_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x30')]](_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x7f')],null,util[_0xd9ed('0x78')]('%s.%s\x20=\x20%s.%s',_0x5264a7[_0xd9ed('0x73')],_0x5264a7['joins'][_0x3c9456][_0xd9ed('0x7e')],_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x7f')],_0x5264a7[_0xd9ed('0x7d')][_0x3c9456][_0xd9ed('0x80')]));}}}if(_0x5264a7['conditions']){_0x5264a7['conditions']=JSON[_0xd9ed('0x91')](_0x5264a7[_0xd9ed('0x81')]);_0x121f56[_0xd9ed('0x3d')](_0x18741d(_0x5264a7[_0xd9ed('0x81')][_0xd9ed('0x69')]));}_0x96064c=_0x121f56[_0xd9ed('0x82')]();_0x121f56['limit'](_0xc8e86d);_0x121f56[_0xd9ed('0x3b')](0x0);logger[_0xd9ed('0x83')](_0xd9ed('0x84'),_0x121f56[_0xd9ed('0x85')]());return dbH[_0xd9ed('0x86')][_0xd9ed('0x36')](_0x121f56[_0xd9ed('0x85')](),{'type':dbH[_0xd9ed('0x86')][_0xd9ed('0x87')][_0xd9ed('0x88')]});}})[_0xd9ed('0x25')](function(){return{'sql':_0x96064c[_0xd9ed('0x85')]()};})[_0xd9ed('0x25')](respondWithResult(_0x510b26,null))['catch'](handleError(_0x510b26,null));}; \ No newline at end of file +var _0xdb2f=['rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20NULL','AnalyticMetric','select','from','alias','includes','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../files/reports','countTable','run','runReport','%s.%s\x20=\x20%s.%s','debug','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','CustomReports','UserProfileResource','destroy','end','stack','name','send','rawAttributes','type','key','model','map','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','error','find','preview','join','left_join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'];(function(_0x395b11,_0x311cdf){var _0x4380e7=function(_0x1ab6d9){while(--_0x1ab6d9){_0x395b11['push'](_0x395b11['shift']());}};_0x4380e7(++_0x311cdf);}(_0xdb2f,0x17f));var _0xfdb2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xdb2f[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdb2('0x0'));var zipdir=require(_0xfdb2('0x1'));var jsonpatch=require(_0xfdb2('0x2'));var rp=require('request-promise');var moment=require(_0xfdb2('0x3'));var BPromise=require(_0xfdb2('0x4'));var Mustache=require('mustache');var util=require(_0xfdb2('0x5'));var path=require(_0xfdb2('0x6'));var sox=require(_0xfdb2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdb2('0x8'));var _=require('lodash');var squel=require(_0xfdb2('0x9'));var crypto=require('crypto');var jsforce=require(_0xfdb2('0xa'));var deskjs=require(_0xfdb2('0xb'));var toCsv=require(_0xfdb2('0xc'));var querystring=require(_0xfdb2('0xd'));var Papa=require(_0xfdb2('0xe'));var Redis=require(_0xfdb2('0xf'));var authService=require(_0xfdb2('0x10'));var qs=require(_0xfdb2('0x11'));var as=require(_0xfdb2('0x12'));var hardwareService=require(_0xfdb2('0x13'));var logger=require(_0xfdb2('0x14'))(_0xfdb2('0x15'));var utils=require(_0xfdb2('0x16'));var config=require(_0xfdb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdb2('0x18'))['db'];var dbH=require(_0xfdb2('0x18'))['dbH'];function respondWithStatusCode(_0x171d22,_0x2a0a7e){_0x2a0a7e=_0x2a0a7e||0xcc;return function(_0x30dbff){if(_0x30dbff){return _0x171d22[_0xfdb2('0x19')](_0x2a0a7e);}return _0x171d22['status'](_0x2a0a7e)['end']();};}function respondWithResult(_0x86bc9a,_0x294ea8){_0x294ea8=_0x294ea8||0xc8;return function(_0x3a2ace){if(_0x3a2ace){return _0x86bc9a[_0xfdb2('0x1a')](_0x294ea8)[_0xfdb2('0x1b')](_0x3a2ace);}};}function respondWithFilteredResult(_0x2fd523,_0x9af4fa){return function(_0x2c0c33){if(_0x2c0c33){var _0x111d39=typeof _0x9af4fa[_0xfdb2('0x1c')]===_0xfdb2('0x1d')&&typeof _0x9af4fa['limit']==='undefined';var _0x1591f2=_0x2c0c33[_0xfdb2('0x1e')];var _0x2d2e1d=_0x111d39?0x0:_0x9af4fa[_0xfdb2('0x1c')];var _0x29d568=_0x111d39?_0x2c0c33['count']:_0x9af4fa[_0xfdb2('0x1c')]+_0x9af4fa[_0xfdb2('0x1f')];var _0x2ea965;if(_0x29d568>=_0x1591f2){_0x29d568=_0x1591f2;_0x2ea965=0xc8;}else{_0x2ea965=0xce;}_0x2fd523['status'](_0x2ea965);return _0x2fd523[_0xfdb2('0x20')](_0xfdb2('0x21'),_0x2d2e1d+'-'+_0x29d568+'/'+_0x1591f2)[_0xfdb2('0x1b')](_0x2c0c33);}return null;};}function patchUpdates(_0x173d0d){return function(_0x4a5809){try{jsonpatch['apply'](_0x4a5809,_0x173d0d,!![]);}catch(_0xefacf4){return BPromise['reject'](_0xefacf4);}return _0x4a5809['save']();};}function saveUpdates(_0x439108,_0xc70277){return function(_0x3d5601){if(_0x3d5601){return _0x3d5601[_0xfdb2('0x22')](_0x439108)[_0xfdb2('0x23')](function(_0xaf664c){return _0xaf664c;});}return null;};}function removeEntity(_0x115d60,_0x5bad11){return function(_0x222843){if(_0x222843){return _0x222843['destroy']()['then'](function(){var _0x5d77ad=_0x222843[_0xfdb2('0x24')]({'plain':!![]});var _0x22ee4c=_0xfdb2('0x25');return db[_0xfdb2('0x26')][_0xfdb2('0x27')]({'where':{'type':_0x22ee4c,'resourceId':_0x5d77ad['id']}})[_0xfdb2('0x23')](function(){return _0x222843;});})[_0xfdb2('0x23')](function(){_0x115d60[_0xfdb2('0x1a')](0xcc)[_0xfdb2('0x28')]();});}};}function handleEntityNotFound(_0xd92203,_0xaa7959){return function(_0x2d4065){if(!_0x2d4065){_0xd92203['sendStatus'](0x194);}return _0x2d4065;};}function handleError(_0x567a7c,_0x3dd2d9){_0x3dd2d9=_0x3dd2d9||0x1f4;return function(_0x1cd4e4){logger['error'](_0x1cd4e4[_0xfdb2('0x29')]);if(_0x1cd4e4[_0xfdb2('0x2a')]){delete _0x1cd4e4[_0xfdb2('0x2a')];}_0x567a7c[_0xfdb2('0x1a')](_0x3dd2d9)[_0xfdb2('0x2b')](_0x1cd4e4);};}exports['index']=function(_0x37fe6f,_0x67373f){var _0x4df906={},_0x1241ef={},_0xc97f03={'count':0x0,'rows':[]};var _0x1035a4=_['map'](db['AnalyticCustomReport'][_0xfdb2('0x2c')],function(_0xdbbec0){return{'name':_0xdbbec0['fieldName'],'type':_0xdbbec0[_0xfdb2('0x2d')][_0xfdb2('0x2e')]};});_0x1241ef[_0xfdb2('0x2f')]=_[_0xfdb2('0x30')](_0x1035a4,_0xfdb2('0x2a'));_0x1241ef[_0xfdb2('0x31')]=_[_0xfdb2('0x32')](_0x37fe6f[_0xfdb2('0x31')]);_0x1241ef['filters']=_['intersection'](_0x1241ef[_0xfdb2('0x2f')],_0x1241ef['query']);_0x4df906[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1241ef[_0xfdb2('0x2f')],qs['fields'](_0x37fe6f[_0xfdb2('0x31')]['fields']));_0x4df906[_0xfdb2('0x33')]=_0x4df906[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x4df906['attributes']:_0x1241ef[_0xfdb2('0x2f')];if(!_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x36')](_0xfdb2('0x37'))){_0x4df906[_0xfdb2('0x1f')]=qs[_0xfdb2('0x1f')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1f')]);_0x4df906[_0xfdb2('0x1c')]=qs[_0xfdb2('0x1c')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1c')]);}_0x4df906[_0xfdb2('0x38')]=qs['sort'](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x39')]);_0x4df906[_0xfdb2('0x3a')]=qs[_0xfdb2('0x3b')](_[_0xfdb2('0x3c')](_0x37fe6f[_0xfdb2('0x31')],_0x1241ef[_0xfdb2('0x3b')]),_0x1035a4);if(_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x3d')]){_0x4df906[_0xfdb2('0x3a')]=_[_0xfdb2('0x3e')](_0x4df906[_0xfdb2('0x3a')],{'$or':_[_0xfdb2('0x30')](_0x1035a4,function(_0x3d17db){if(_0x3d17db[_0xfdb2('0x2d')]!==_0xfdb2('0x3f')){var _0x1fe7ce={};_0x1fe7ce[_0x3d17db['name']]={'$like':'%'+_0x37fe6f[_0xfdb2('0x31')]['filter']+'%'};return _0x1fe7ce;}})});}_0x4df906=_['merge']({},_0x4df906,_0x37fe6f[_0xfdb2('0x40')]);var _0x2c2613={'where':_0x4df906[_0xfdb2('0x3a')]};return db[_0xfdb2('0x41')][_0xfdb2('0x1e')](_0x2c2613)['then'](function(_0x33528b){_0xc97f03[_0xfdb2('0x1e')]=_0x33528b;if(_0x37fe6f['query'][_0xfdb2('0x42')]){_0x4df906[_0xfdb2('0x43')]=[{'all':!![]}];}return db[_0xfdb2('0x41')][_0xfdb2('0x44')](_0x4df906);})[_0xfdb2('0x23')](function(_0x1ae2ae){_0xc97f03[_0xfdb2('0x45')]=_0x1ae2ae;return _0xc97f03;})[_0xfdb2('0x23')](respondWithFilteredResult(_0x67373f,_0x4df906))['catch'](handleError(_0x67373f,null));};exports[_0xfdb2('0x46')]=function(_0xd8cac3,_0x193529){var _0x3bb043={'raw':![],'where':{'id':_0xd8cac3[_0xfdb2('0x47')]['id']}},_0x1fd5f2={};_0x1fd5f2[_0xfdb2('0x2f')]=_['keys'](db['AnalyticCustomReport'][_0xfdb2('0x2c')]);_0x1fd5f2['query']=_['keys'](_0xd8cac3[_0xfdb2('0x31')]);_0x1fd5f2['filters']=_[_0xfdb2('0x34')](_0x1fd5f2[_0xfdb2('0x2f')],_0x1fd5f2[_0xfdb2('0x31')]);_0x3bb043[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1fd5f2['model'],qs[_0xfdb2('0x48')](_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x48')]));_0x3bb043[_0xfdb2('0x33')]=_0x3bb043[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x3bb043[_0xfdb2('0x33')]:_0x1fd5f2[_0xfdb2('0x2f')];if(_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x42')]){_0x3bb043[_0xfdb2('0x43')]=[{'all':!![]}];}_0x3bb043=_[_0xfdb2('0x3e')]({},_0x3bb043,_0xd8cac3['options']);return db[_0xfdb2('0x41')]['find'](_0x3bb043)[_0xfdb2('0x23')](handleEntityNotFound(_0x193529,null))['then'](respondWithResult(_0x193529,null))[_0xfdb2('0x49')](handleError(_0x193529,null));};exports['create']=function(_0x1bfca3,_0x18f991){return db[_0xfdb2('0x41')][_0xfdb2('0x4a')](_0x1bfca3[_0xfdb2('0x4b')],{})[_0xfdb2('0x23')](function(_0x2750c7){var _0x326935=_0x1bfca3['user'][_0xfdb2('0x24')]({'plain':!![]});if(!_0x326935)throw new Error(_0xfdb2('0x4c'));if(_0x326935[_0xfdb2('0x4d')]===_0xfdb2('0x4e')){var _0x70e6f0=_0x2750c7['get']({'plain':!![]});var _0x5b31c2='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x5b31c2,'userProfileId':_0x326935['userProfileId']},'raw':!![]})[_0xfdb2('0x23')](function(_0x324331){if(_0x324331&&_0x324331[_0xfdb2('0x4f')]===0x0){return db[_0xfdb2('0x26')]['create']({'name':_0x70e6f0[_0xfdb2('0x2a')],'resourceId':_0x70e6f0['id'],'type':_0xfdb2('0x25'),'sectionId':_0x324331['id']},{})['then'](function(){return _0x2750c7;});}else{return _0x2750c7;}})[_0xfdb2('0x49')](function(_0x29e3e8){logger[_0xfdb2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e3e8);throw _0x29e3e8;});}return _0x2750c7;})[_0xfdb2('0x23')](respondWithResult(_0x18f991,0xc9))[_0xfdb2('0x49')](handleError(_0x18f991,null));};exports['update']=function(_0x263fa2,_0x5abc06){if(_0x263fa2[_0xfdb2('0x4b')]['id']){delete _0x263fa2[_0xfdb2('0x4b')]['id'];}return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x263fa2[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x5abc06,null))[_0xfdb2('0x23')](saveUpdates(_0x263fa2['body'],null))[_0xfdb2('0x23')](respondWithResult(_0x5abc06,null))['catch'](handleError(_0x5abc06,null));};exports['destroy']=function(_0x2cd4a4,_0x526b4f){return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x2cd4a4[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x526b4f,null))[_0xfdb2('0x23')](removeEntity(_0x526b4f,null))[_0xfdb2('0x49')](handleError(_0x526b4f,null));};exports[_0xfdb2('0x52')]=function(_0x5236d9,_0x5f0205){var _0x573307=0xa;var _0xcc9cff=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),'cross_join'];var _0x486d9b={'SUM':'SUM(%s)','COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':_0xfdb2('0x5c')};var _0x16284e={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':'DATE(%s)','HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x46f5ad=function(_0x3981c1){return!_['includes']([_0xfdb2('0x61'),'IS\x20NOT\x20NULL',_0xfdb2('0x62'),_0xfdb2('0x63')],_0x3981c1);};var _0x1ad9b9=function(_0x25c0a5){if(!_0x25c0a5||!_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x5bc7da='(',_0xe67cca=0x0;_0xe67cca<_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')];_0xe67cca+=0x1){_0xe67cca>0x0&&(_0x5bc7da+='\x20'+_0x25c0a5[_0xfdb2('0x65')]+'\x20');_0x5bc7da+=_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]?_0x1ad9b9(_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]):_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x67')]+'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x68')]+(_0x46f5ad(_0x25c0a5['rules'][_0xe67cca]['condition'])?'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x69')]:'');}return _0x5bc7da+')';};var _0x4e7b4f={'where':{'id':_0x5236d9[_0xfdb2('0x47')]['id']}},_0x1af3ea,_0x1c9fe5,_0x3f1262,_0x31bbe6,_0x5f40b7;_0x4e7b4f=_[_0xfdb2('0x3e')]({},_0x4e7b4f,_0x5236d9[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x4e7b4f)[_0xfdb2('0x23')](function(_0x432a14){if(_0x432a14){_0x1af3ea=_0x432a14;return _0x432a14[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x412fa2){if(_0x412fa2){if(!_0x412fa2['length']){throw new db[(_0xfdb2('0x6b'))][(_0xfdb2('0x6c'))](_0xfdb2('0x6d'),0x193);}_0x1c9fe5=_0x412fa2;return db['AnalyticMetric'][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0x1d613a){if(_0x1d613a){_0x3f1262=_['keyBy'](_0x1d613a,'id');var _0x15bd96;var _0x35344b=squel['select']();_0x35344b['from'](_0x1af3ea[_0xfdb2('0x6e')]);for(var _0x103de3=0x0;_0x103de3<_0x1c9fe5[_0xfdb2('0x35')];_0x103de3+=0x1){_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x6f')]?_0x3f1262[_0x1c9fe5[_0x103de3]['MetricId']][_0xfdb2('0x70')]:_0x1c9fe5[_0x103de3][_0xfdb2('0x67')];_0x15bd96=_0x1c9fe5[_0x103de3]['function']?_[_0xfdb2('0x71')](_0x486d9b[_0x1c9fe5[_0x103de3][_0xfdb2('0x72')]],'%s',_0x15bd96):_0x15bd96;_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x16284e[_0x1c9fe5[_0x103de3]['format']],'%s',_0x15bd96):_0x15bd96;if(_0x1c9fe5[_0x103de3][_0xfdb2('0x74')]){_0x35344b[_0xfdb2('0x66')](_0x15bd96);}_0x1c9fe5[_0x103de3][_0xfdb2('0x75')]&&_0x35344b[_0xfdb2('0x38')](_0x15bd96,_0x1c9fe5[_0x103de3]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x35344b[_0xfdb2('0x67')](_0x15bd96,_0x1c9fe5[_0x103de3]['alias']||_0x15bd96);}if(_0x1af3ea[_0xfdb2('0x77')]){_0x1af3ea['joins']=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x77')]);for(var _0x1ed34d=0x0;_0x1ed34d<_0x1af3ea['joins'][_0xfdb2('0x35')];_0x1ed34d+=0x1){if(_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')]&&_['includes'](_0xcc9cff,_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')])&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['parentKey']&&_0x1af3ea['joins'][_0x1ed34d][_0xfdb2('0x79')]&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7a')]){_0x35344b[_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['type']](_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1af3ea[_0xfdb2('0x6e')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7b')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x79')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignKey']));}}}if(_0x1af3ea[_0xfdb2('0x7c')]){_0x1af3ea[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x7c')]);_0x35344b[_0xfdb2('0x3a')](_0x1ad9b9(_0x1af3ea[_0xfdb2('0x7c')][_0xfdb2('0x66')]));}_0x5f40b7=_0x35344b[_0xfdb2('0x7d')]();_0x35344b[_0xfdb2('0x1f')](_0x573307);_0x35344b[_0xfdb2('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x35344b[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x35344b[_0xfdb2('0x7e')](),{'type':dbH['sequelize'][_0xfdb2('0x80')][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](respondWithResult(_0x5f0205,null))[_0xfdb2('0x49')](handleError(_0x5f0205,null));};function runReport(_0x5d75db,_0x11b6ee,_0x4b160d){var _0x8ff979=_0x11b6ee[_0xfdb2('0x2a')];var _0x7e5529=0xa;var _0x4da2d2=[_0xfdb2('0x53'),'left_join','right_join',_0xfdb2('0x82')];var _0x300462={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':_0xfdb2('0x84'),'MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9bdc97={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':_0xfdb2('0x85'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x2cd54a=function(_0x8341b8){return!_['includes']([_0xfdb2('0x61'),_0xfdb2('0x86'),'IS\x20EMPTY',_0xfdb2('0x63')],_0x8341b8);};var _0x4731b3=function(_0x57b052){if(!_0x57b052||!_0x57b052['rules'][_0xfdb2('0x35')]){return'';}for(var _0x5ba8c8='(',_0x173806=0x0;_0x173806<_0x57b052[_0xfdb2('0x64')]['length'];_0x173806+=0x1){_0x173806>0x0&&(_0x5ba8c8+='\x20'+_0x57b052[_0xfdb2('0x65')]+'\x20');_0x5ba8c8+=_0x57b052['rules'][_0x173806][_0xfdb2('0x66')]?_0x4731b3(_0x57b052[_0xfdb2('0x64')][_0x173806]['group']):_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x67')]+'\x20'+_0x57b052[_0xfdb2('0x64')][_0x173806]['condition']+(_0x2cd54a(_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x68')])?'\x20'+_0x57b052['rules'][_0x173806][_0xfdb2('0x69')]:'');}return _0x5ba8c8+')';};var _0x28a4df={'where':{'id':_0x5d75db['id']}},_0x649259,_0x3d48bb,_0x15c938,_0x5921fd,_0x1651f9;_0x28a4df=_[_0xfdb2('0x3e')]({},_0x28a4df,_0x4b160d);return db[_0xfdb2('0x41')][_0xfdb2('0x51')](_0x28a4df)[_0xfdb2('0x23')](function(_0x1b7d7b){if(_0x1b7d7b){_0x649259=_0x1b7d7b;return _0x1b7d7b[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x73febf){if(_0x73febf){if(!_0x73febf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d48bb=_0x73febf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3cde0f){if(_0x3cde0f){_0x15c938=_['keyBy'](_0x3cde0f,'id');var _0x50ea7f;var _0x2c0551=squel[_0xfdb2('0x88')]();_0x2c0551[_0xfdb2('0x89')](_0x649259[_0xfdb2('0x6e')]);for(var _0x82d192=0x0;_0x82d192<_0x3d48bb[_0xfdb2('0x35')];_0x82d192+=0x1){_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]?_0x15c938[_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x3d48bb[_0x82d192]['field'];_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x300462[_0x3d48bb[_0x82d192][_0xfdb2('0x72')]],'%s',_0x50ea7f):_0x50ea7f;_0x50ea7f=_0x3d48bb[_0x82d192]['format']?_[_0xfdb2('0x71')](_0x9bdc97[_0x3d48bb[_0x82d192][_0xfdb2('0x73')]],'%s',_0x50ea7f):_0x50ea7f;if(_0x3d48bb[_0x82d192][_0xfdb2('0x74')]){_0x2c0551[_0xfdb2('0x66')](_0x50ea7f);}_0x3d48bb[_0x82d192][_0xfdb2('0x75')]&&_0x2c0551[_0xfdb2('0x38')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x75')]===_0xfdb2('0x76')?![]:!![]);_0x2c0551[_0xfdb2('0x67')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x8a')]||_0x50ea7f);}if(_0x649259[_0xfdb2('0x77')]){_0x649259[_0xfdb2('0x77')]=JSON['parse'](_0x649259[_0xfdb2('0x77')]);for(var _0x4b1adc=0x0;_0x4b1adc<_0x649259[_0xfdb2('0x77')][_0xfdb2('0x35')];_0x4b1adc+=0x1){if(_0x649259['joins'][_0x4b1adc]['type']&&_[_0xfdb2('0x8b')](_0x4da2d2,_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')])&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7b')]&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x79')]&&_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7a')]){_0x2c0551[_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')]](_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],null,util[_0xfdb2('0x73')]('%s.%s\x20=\x20%s.%s',_0x649259[_0xfdb2('0x6e')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7b')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7a')]));}}}if(_0x649259[_0xfdb2('0x7c')]){_0x649259[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x649259[_0xfdb2('0x7c')]);_0x2c0551[_0xfdb2('0x3a')](_0x4731b3(_0x649259[_0xfdb2('0x7c')]['group']));}_0x1651f9=_0x2c0551['clone']();_0x2c0551[_0xfdb2('0x1f')](_0x7e5529);_0x2c0551[_0xfdb2('0x1c')](0x0);return;}})[_0xfdb2('0x23')](function(){if(_0x11b6ee[_0xfdb2('0x8c')]===_0xfdb2('0x8d')){return null;}var _0x118876=_['merge'](_0x11b6ee,{'name':_0x11b6ee[_0xfdb2('0x8e')]||_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],'basename':_0x8ff979,'savename':util[_0xfdb2('0x73')](_0xfdb2('0x8f'),_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],require(_0xfdb2('0x90'))[_0xfdb2('0x91')](0x4),_0x11b6ee[_0xfdb2('0x8c')]||'csv'),'reportId':_0x649259['id'],'reportType':'custom'});return db[_0xfdb2('0x92')][_0xfdb2('0x4a')](_0x118876,{'raw':!![]});})[_0xfdb2('0x23')](function(_0xce6959){if(_0x649259['table']===_0xfdb2('0x93')){_0x1651f9['where'](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x94'),_0x11b6ee['startDate'],_0x11b6ee[_0xfdb2('0x95')]);}else{_0x1651f9[_0xfdb2('0x3a')](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x96'),_0x11b6ee[_0xfdb2('0x97')],_0x11b6ee[_0xfdb2('0x95')]);}if(_0xce6959){logger[_0xfdb2('0x98')](_0xfdb2('0x99'),_0x1651f9[_0xfdb2('0x7e')]());require('child_process')[_0xfdb2('0x9a')](path['join'](__dirname,'../../components/export/',_0xce6959[_0xfdb2('0x8c')]),[_0xce6959['id'],_0x1651f9[_0xfdb2('0x7e')](),path[_0xfdb2('0x53')](__dirname,_0xfdb2('0x9b'),_0xce6959['savename']),_0x8ff979]);return _0xce6959;}else{var _0x905afd=squel[_0xfdb2('0x88')]();_0x905afd[_0xfdb2('0x89')]('('+_0x1651f9['toString']()+')',_0xfdb2('0x9c'));_0x905afd[_0xfdb2('0x67')]('COUNT(*)',_0xfdb2('0x1e'));_0x1651f9['limit'](_0x11b6ee['limit']||_0x7e5529);_0x1651f9[_0xfdb2('0x1c')](_0x11b6ee['offset']||0x0);return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x905afd['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfdb2('0x81')]})[_0xfdb2('0x23')](function(_0x4d9e12){if(!_0x4d9e12[_0xfdb2('0x35')]){_0x5921fd=0x0;}else{_0x5921fd=_0x4d9e12[0x0][_0xfdb2('0x1e')]||0x0;}return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x1651f9[_0xfdb2('0x7e')](),{'type':dbH[_0xfdb2('0x7f')][_0xfdb2('0x80')]['SELECT']});})['then'](function(_0x485aff){return{'rows':_0x485aff||[],'count':_0x5921fd};});}});}exports[_0xfdb2('0x9d')]=function(_0x478fc8,_0x116558){return runReport(_0x478fc8[_0xfdb2('0x47')],_0x478fc8[_0xfdb2('0x31')],_0x478fc8[_0xfdb2('0x40')])[_0xfdb2('0x23')](respondWithResult(_0x116558,null))[_0xfdb2('0x49')](handleError(_0x116558,null));};exports[_0xfdb2('0x9e')]=runReport;exports['query']=function(_0x58971e,_0x2f68e8){var _0x2fc1c7=0xa;var _0x8abb2e=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),_0xfdb2('0x82')];var _0x360d4d={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2a9893={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfdb2('0x85'),'HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x99a945=function(_0x59a8cf){return!_[_0xfdb2('0x8b')](['IS\x20NULL',_0xfdb2('0x86'),_0xfdb2('0x62'),'IS\x20NOT\x20EMPTY'],_0x59a8cf);};var _0x42ce3e=function(_0x2d54c8){if(!_0x2d54c8||!_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x4400b2='(',_0x13385c=0x0;_0x13385c<_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')];_0x13385c+=0x1){_0x13385c>0x0&&(_0x4400b2+='\x20'+_0x2d54c8[_0xfdb2('0x65')]+'\x20');_0x4400b2+=_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x66')]?_0x42ce3e(_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x66')]):_0x2d54c8[_0xfdb2('0x64')][_0x13385c]['field']+'\x20'+_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x68')]+(_0x99a945(_0x2d54c8['rules'][_0x13385c]['condition'])?'\x20'+_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x69')]:'');}return _0x4400b2+')';};var _0x2dddd4={'where':{'id':_0x58971e[_0xfdb2('0x47')]['id']}},_0xb810fe,_0x57beec,_0x915636,_0x516793,_0x2b4335;_0x2dddd4=_[_0xfdb2('0x3e')]({},_0x2dddd4,_0x58971e[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x2dddd4)[_0xfdb2('0x23')](function(_0x40ed7c){if(_0x40ed7c){_0xb810fe=_0x40ed7c;return _0x40ed7c['getFields']();}return null;})['then'](function(_0x21acdf){if(_0x21acdf){if(!_0x21acdf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfdb2('0x6d'),0x193);}_0x57beec=_0x21acdf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0xf0727f){if(_0xf0727f){_0x915636=_['keyBy'](_0xf0727f,'id');var _0x552694;var _0x522695=squel['select']();_0x522695['from'](_0xb810fe['table']);for(var _0x5228fb=0x0;_0x5228fb<_0x57beec[_0xfdb2('0x35')];_0x5228fb+=0x1){_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x6f')]?_0x915636[_0x57beec[_0x5228fb][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x57beec[_0x5228fb][_0xfdb2('0x67')];_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x360d4d[_0x57beec[_0x5228fb][_0xfdb2('0x72')]],'%s',_0x552694):_0x552694;_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x2a9893[_0x57beec[_0x5228fb][_0xfdb2('0x73')]],'%s',_0x552694):_0x552694;if(_0x57beec[_0x5228fb]['groupBy']){_0x522695['group'](_0x552694);}_0x57beec[_0x5228fb][_0xfdb2('0x75')]&&_0x522695['order'](_0x552694,_0x57beec[_0x5228fb]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x522695[_0xfdb2('0x67')](_0x552694,_0x57beec[_0x5228fb][_0xfdb2('0x8a')]||_0x552694);}if(_0xb810fe[_0xfdb2('0x77')]){_0xb810fe[_0xfdb2('0x77')]=JSON['parse'](_0xb810fe['joins']);for(var _0x12438e=0x0;_0x12438e<_0xb810fe['joins'][_0xfdb2('0x35')];_0x12438e+=0x1){if(_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')]&&_[_0xfdb2('0x8b')](_0x8abb2e,_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')])&&_0xb810fe['joins'][_0x12438e]['parentKey']&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x79')]&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]){_0x522695[_0xb810fe[_0xfdb2('0x77')][_0x12438e]['type']](_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],null,util['format'](_0xfdb2('0x9f'),_0xb810fe[_0xfdb2('0x6e')],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7b')],_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]));}}}if(_0xb810fe[_0xfdb2('0x7c')]){_0xb810fe[_0xfdb2('0x7c')]=JSON['parse'](_0xb810fe['conditions']);_0x522695[_0xfdb2('0x3a')](_0x42ce3e(_0xb810fe['conditions'][_0xfdb2('0x66')]));}_0x2b4335=_0x522695[_0xfdb2('0x7d')]();_0x522695['limit'](_0x2fc1c7);_0x522695[_0xfdb2('0x1c')](0x0);logger[_0xfdb2('0xa0')]('Limited\x20Query:',_0x522695[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x522695['toString'](),{'type':dbH[_0xfdb2('0x7f')]['QueryTypes'][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](function(){return{'sql':_0x2b4335['toString']()};})['then'](respondWithResult(_0x2f68e8,null))[_0xfdb2('0x49')](handleError(_0x2f68e8,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4fd74a5..59d5de5 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 _0x176d=['rimraf','define','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x589c33,_0x13ec38){var _0x37c3e7=function(_0xc7856f){while(--_0xc7856f){_0x589c33['push'](_0x589c33['shift']());}};_0x37c3e7(++_0x13ec38);}(_0x176d,0x71));var _0xd176=function(_0xb1d8a0,_0x3eb375){_0xb1d8a0=_0xb1d8a0-0x0;var _0x5168e5=_0x176d[_0xb1d8a0];return _0x5168e5;};'use strict';var _=require(_0xd176('0x0'));var util=require(_0xd176('0x1'));var logger=require(_0xd176('0x2'))('api');var moment=require(_0xd176('0x3'));var BPromise=require(_0xd176('0x4'));var rp=require(_0xd176('0x5'));var fs=require('fs');var path=require(_0xd176('0x6'));var rimraf=require(_0xd176('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x12c8f7,_0x4dbdd9){return _0x12c8f7[_0xd176('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xd176('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc629=['util','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash'];(function(_0x475bf1,_0x5235b6){var _0x4095d1=function(_0x30fe72){while(--_0x30fe72){_0x475bf1['push'](_0x475bf1['shift']());}};_0x4095d1(++_0x5235b6);}(_0xc629,0x153));var _0x9c62=function(_0x201309,_0x536c9d){_0x201309=_0x201309-0x0;var _0x4be513=_0xc629[_0x201309];return _0x4be513;};'use strict';var _=require(_0x9c62('0x0'));var util=require(_0x9c62('0x1'));var logger=require('../../config/logger')(_0x9c62('0x2'));var moment=require(_0x9c62('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c62('0x4'));var rimraf=require(_0x9c62('0x5'));var config=require(_0x9c62('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x9c62('0x7')]=function(_0x4490b6,_0x2cc272){return _0x4490b6[_0x9c62('0x8')](_0x9c62('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 5459d9b..15b0f9e 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 _0xbf4b=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbf4b,0x14a));var _0xbbf4=function(_0x22ee53,_0x551665){_0x22ee53=_0x22ee53-0x0;var _0x2aae96=_0xbf4b[_0x22ee53];return _0x2aae96;};'use strict';var _=require(_0xbbf4('0x0'));var util=require(_0xbbf4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbf4('0x2'));var fs=require('fs');var Redis=require(_0xbbf4('0x3'));var db=require(_0xbbf4('0x4'))['db'];var utils=require(_0xbbf4('0x5'));var logger=require(_0xbbf4('0x6'))(_0xbbf4('0x7'));var config=require(_0xbbf4('0x8'));var jayson=require(_0xbbf4('0x9'));var client=jayson[_0xbbf4('0xa')][_0xbbf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fae0b,_0x4b8092,_0x4d9f66){return new BPromise(function(_0x1c5434,_0x429ad0){return client['request'](_0x4fae0b,_0x4d9f66)[_0xbbf4('0xc')](function(_0x795ebb){logger[_0xbbf4('0xd')](_0xbbf4('0xe'),_0x4b8092,'request\x20sent');logger['debug'](_0xbbf4('0xf'),_0x4b8092,_0xbbf4('0x10'),JSON[_0xbbf4('0x11')](_0x795ebb));if(_0x795ebb[_0xbbf4('0x12')]){if(_0x795ebb[_0xbbf4('0x12')][_0xbbf4('0x13')]===0x1f4){logger[_0xbbf4('0x12')](_0xbbf4('0xe'),_0x4b8092,_0x795ebb[_0xbbf4('0x12')][_0xbbf4('0x14')]);return _0x429ad0(_0x795ebb[_0xbbf4('0x12')][_0xbbf4('0x14')]);}logger[_0xbbf4('0x12')](_0xbbf4('0xe'),_0x4b8092,_0x795ebb['error'][_0xbbf4('0x14')]);return _0x1c5434(_0x795ebb[_0xbbf4('0x12')]['message']);}else{logger[_0xbbf4('0xd')](_0xbbf4('0xe'),_0x4b8092,'request\x20sent');_0x1c5434(_0x795ebb[_0xbbf4('0x15')][_0xbbf4('0x14')]);}})[_0xbbf4('0x16')](function(_0x166d3c){logger[_0xbbf4('0x12')](_0xbbf4('0xe'),_0x4b8092,_0x166d3c);_0x429ad0(_0x166d3c);});});} \ No newline at end of file +var _0xe4a6=['../../config/environment','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25a0f0,_0x54f2d8){var _0x25846c=function(_0x443b0b){while(--_0x443b0b){_0x25a0f0['push'](_0x25a0f0['shift']());}};_0x25846c(++_0x54f2d8);}(_0xe4a6,0x141));var _0x6e4a=function(_0xdabd59,_0x55e984){_0xdabd59=_0xdabd59-0x0;var _0x4af920=_0xe4a6[_0xdabd59];return _0x4af920;};'use strict';var _=require(_0x6e4a('0x0'));var util=require(_0x6e4a('0x1'));var moment=require(_0x6e4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e4a('0x3'));var fs=require('fs');var Redis=require(_0x6e4a('0x4'));var db=require(_0x6e4a('0x5'))['db'];var utils=require(_0x6e4a('0x6'));var logger=require(_0x6e4a('0x7'))(_0x6e4a('0x8'));var config=require(_0x6e4a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6e4a('0xa')][_0x6e4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d12d8,_0x58425d,_0x360375){return new BPromise(function(_0x5b1ec0,_0x3ec504){return client['request'](_0x4d12d8,_0x360375)[_0x6e4a('0xc')](function(_0x5b010f){logger['info'](_0x6e4a('0xd'),_0x58425d,'request\x20sent');logger['debug'](_0x6e4a('0xe'),_0x58425d,_0x6e4a('0xf'),JSON[_0x6e4a('0x10')](_0x5b010f));if(_0x5b010f[_0x6e4a('0x11')]){if(_0x5b010f['error']['code']===0x1f4){logger['error'](_0x6e4a('0xd'),_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x3ec504(_0x5b010f[_0x6e4a('0x11')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x5b1ec0(_0x5b010f['error'][_0x6e4a('0x12')]);}else{logger[_0x6e4a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x6e4a('0xf'));_0x5b1ec0(_0x5b010f[_0x6e4a('0x14')][_0x6e4a('0x12')]);}})[_0x6e4a('0x15')](function(_0x5d0c1d){logger[_0x6e4a('0x11')](_0x6e4a('0xd'),_0x58425d,_0x5d0c1d);_0x3ec504(_0x5d0c1d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e08ff7f..06eba59 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 _0x085b=['/:id','/:id/preview','preview','/:id/run','run','query','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x10efcf,_0x40b4a6){var _0x203fde=function(_0x2cd9e5){while(--_0x2cd9e5){_0x10efcf['push'](_0x10efcf['shift']());}};_0x203fde(++_0x40b4a6);}(_0x085b,0xe7));var _0xb085=function(_0x736006,_0x425623){_0x736006=_0x736006-0x0;var _0x3ba0a4=_0x085b[_0x736006];return _0x3ba0a4;};'use strict';var multer=require(_0xb085('0x0'));var util=require('util');var path=require(_0xb085('0x1'));var timeout=require(_0xb085('0x2'));var express=require(_0xb085('0x3'));var router=express[_0xb085('0x4')]();var fs_extra=require(_0xb085('0x5'));var auth=require(_0xb085('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb085('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xb085('0x8')]('/',auth[_0xb085('0x9')](),controller[_0xb085('0xa')]);router['get'](_0xb085('0xb'),auth[_0xb085('0x9')](),controller['show']);router[_0xb085('0x8')](_0xb085('0xc'),auth['isAuthenticated'](),controller[_0xb085('0xd')]);router['get'](_0xb085('0xe'),auth[_0xb085('0x9')](),controller[_0xb085('0xf')]);router[_0xb085('0x8')]('/:id/query',auth[_0xb085('0x9')](),controller[_0xb085('0x10')]);router['post']('/',auth[_0xb085('0x9')](),controller[_0xb085('0x11')]);router[_0xb085('0x12')]('/:id',auth[_0xb085('0x9')](),controller[_0xb085('0x13')]);router['delete'](_0xb085('0xb'),auth[_0xb085('0x9')](),controller[_0xb085('0x14')]);module[_0xb085('0x15')]=router; \ No newline at end of file +var _0xda74=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','util'];(function(_0x28e5dd,_0x46f8b9){var _0x48dda8=function(_0x420781){while(--_0x420781){_0x28e5dd['push'](_0x28e5dd['shift']());}};_0x48dda8(++_0x46f8b9);}(_0xda74,0x1f3));var _0x4da7=function(_0x26aebd,_0x156290){_0x26aebd=_0x26aebd-0x0;var _0x7fa406=_0xda74[_0x26aebd];return _0x7fa406;};'use strict';var multer=require('multer');var util=require(_0x4da7('0x0'));var path=require(_0x4da7('0x1'));var timeout=require(_0x4da7('0x2'));var express=require(_0x4da7('0x3'));var router=express[_0x4da7('0x4')]();var fs_extra=require(_0x4da7('0x5'));var auth=require(_0x4da7('0x6'));var interaction=require(_0x4da7('0x7'));var config=require(_0x4da7('0x8'));var controller=require(_0x4da7('0x9'));router['get']('/',auth[_0x4da7('0xa')](),controller['index']);router['get'](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller['show']);router[_0x4da7('0xc')](_0x4da7('0xd'),auth['isAuthenticated'](),controller[_0x4da7('0xe')]);router[_0x4da7('0xc')](_0x4da7('0xf'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x10')]);router['get'](_0x4da7('0x11'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x12')]);router[_0x4da7('0x13')]('/',auth[_0x4da7('0xa')](),controller[_0x4da7('0x14')]);router[_0x4da7('0x15')](_0x4da7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4da7('0x16')](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x17')]);module[_0x4da7('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 47d9caf..4bc4a2c 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 _0xee14=['STRING','TEXT'];(function(_0x59b58d,_0x8e5618){var _0x11b3ba=function(_0x6e3b2e){while(--_0x6e3b2e){_0x59b58d['push'](_0x59b58d['shift']());}};_0x11b3ba(++_0x8e5618);}(_0xee14,0x13a));var _0x4ee1=function(_0x2c7de0,_0x11cd5c){_0x2c7de0=_0x2c7de0-0x0;var _0x4e4327=_0xee14[_0x2c7de0];return _0x4e4327;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0x24ca,0x1bc));var _0xa24c=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x24ca[_0x562f3b];return _0x1edd55;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5a0776d..b215286 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x184c3c,_0x4b5e79){var _0x21251b=function(_0xaa2ad6){while(--_0xaa2ad6){_0x184c3c['push'](_0x184c3c['shift']());}};_0x21251b(++_0x4b5e79);}(_0x31f0,0xb7));var _0x031f=function(_0x259ef2,_0x120831){_0x259ef2=_0x259ef2-0x0;var _0x42de29=_0x31f0[_0x259ef2];return _0x42de29;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x4a6efd,_0x14bb86){var _0x5c915e=function(_0x463b3e){while(--_0x463b3e){_0x4a6efd['push'](_0x4a6efd['shift']());}};_0x5c915e(++_0x14bb86);}(_0x187d,0x93));var _0xd187=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x187d[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 48d19a6..552bfb1 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 _0x9502=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x1b3f6d,_0x394ac4){var _0x3093a9=function(_0x3571ca){while(--_0x3571ca){_0x1b3f6d['push'](_0x1b3f6d['shift']());}};_0x3093a9(++_0x394ac4);}(_0x9502,0x7f));var _0x2950=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x9502[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x2950('0x0'));var util=require(_0x2950('0x1'));var logger=require(_0x2950('0x2'))(_0x2950('0x3'));var moment=require(_0x2950('0x4'));var BPromise=require(_0x2950('0x5'));var rp=require(_0x2950('0x6'));var fs=require('fs');var path=require(_0x2950('0x7'));var rimraf=require(_0x2950('0x8'));var config=require(_0x2950('0x9'));var attributes=require(_0x2950('0xa'));module['exports']=function(_0x3aee22,_0x4c76a0){return _0x3aee22[_0x2950('0xb')](_0x2950('0xc'),attributes,{'tableName':_0x2950('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc327=['./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x324eb1,_0x5c4bb3){var _0x51fc21=function(_0x438ca4){while(--_0x438ca4){_0x324eb1['push'](_0x324eb1['shift']());}};_0x51fc21(++_0x5c4bb3);}(_0xc327,0x88));var _0x7c32=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc327[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x7c32('0x0'));var logger=require(_0x7c32('0x1'))('api');var moment=require(_0x7c32('0x2'));var BPromise=require(_0x7c32('0x3'));var rp=require(_0x7c32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c32('0x5'));var config=require(_0x7c32('0x6'));var attributes=require(_0x7c32('0x7'));module[_0x7c32('0x8')]=function(_0xd391f5,_0xeb3fdd){return _0xd391f5[_0x7c32('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x7c32('0xa'),'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 3ab3303..84999a8 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 _0x79c4=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x79c4,0x10e));var _0x479c=function(_0x54f374,_0x27a442){_0x54f374=_0x54f374-0x0;var _0x32175b=_0x79c4[_0x54f374];return _0x32175b;};'use strict';var _=require(_0x479c('0x0'));var util=require(_0x479c('0x1'));var moment=require(_0x479c('0x2'));var BPromise=require(_0x479c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x479c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x479c('0x5'));var logger=require(_0x479c('0x6'))(_0x479c('0x7'));var config=require('../../config/environment');var jayson=require(_0x479c('0x8'));var client=jayson[_0x479c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d92e0,_0x11e1c0,_0x432807){return new BPromise(function(_0x21ab70,_0x42784c){return client['request'](_0x2d92e0,_0x432807)[_0x479c('0xa')](function(_0x4c36d5){logger[_0x479c('0xb')](_0x479c('0xc'),_0x11e1c0,_0x479c('0xd'));logger[_0x479c('0xe')](_0x479c('0xf'),_0x11e1c0,_0x479c('0xd'),JSON[_0x479c('0x10')](_0x4c36d5));if(_0x4c36d5[_0x479c('0x11')]){if(_0x4c36d5[_0x479c('0x11')][_0x479c('0x12')]===0x1f4){logger[_0x479c('0x11')](_0x479c('0xc'),_0x11e1c0,_0x4c36d5['error'][_0x479c('0x13')]);return _0x42784c(_0x4c36d5[_0x479c('0x11')][_0x479c('0x13')]);}logger[_0x479c('0x11')](_0x479c('0xc'),_0x11e1c0,_0x4c36d5['error'][_0x479c('0x13')]);return _0x21ab70(_0x4c36d5[_0x479c('0x11')]['message']);}else{logger[_0x479c('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x11e1c0,'request\x20sent');_0x21ab70(_0x4c36d5[_0x479c('0x14')][_0x479c('0x13')]);}})[_0x479c('0x15')](function(_0x121172){logger[_0x479c('0x11')](_0x479c('0xc'),_0x11e1c0,_0x121172);_0x42784c(_0x121172);});});} \ No newline at end of file +var _0x7c6a=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ed25d,_0x6c37b2){var _0x5e0998=function(_0x3e53a4){while(--_0x3e53a4){_0x3ed25d['push'](_0x3ed25d['shift']());}};_0x5e0998(++_0x6c37b2);}(_0x7c6a,0x1c7));var _0xa7c6=function(_0x55987d,_0x49120d){_0x55987d=_0x55987d-0x0;var _0x238807=_0x7c6a[_0x55987d];return _0x238807;};'use strict';var _=require('lodash');var util=require(_0xa7c6('0x0'));var moment=require(_0xa7c6('0x1'));var BPromise=require(_0xa7c6('0x2'));var rs=require(_0xa7c6('0x3'));var fs=require('fs');var Redis=require(_0xa7c6('0x4'));var db=require(_0xa7c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7c6('0x6'))(_0xa7c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7c6('0x8'));var client=jayson[_0xa7c6('0x9')][_0xa7c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54620d,_0x24b7c7,_0x2aa958){return new BPromise(function(_0x332b38,_0x1b246e){return client[_0xa7c6('0xb')](_0x54620d,_0x2aa958)[_0xa7c6('0xc')](function(_0x37eb7f){logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,_0xa7c6('0xf'));logger[_0xa7c6('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x24b7c7,'request\x20sent',JSON[_0xa7c6('0x11')](_0x37eb7f));if(_0x37eb7f[_0xa7c6('0x12')]){if(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x13')]===0x1f4){logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f['error'][_0xa7c6('0x14')]);return _0x1b246e(_0x37eb7f['error'][_0xa7c6('0x14')]);}logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);return _0x332b38(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);}else{logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,'request\x20sent');_0x332b38(_0x37eb7f[_0xa7c6('0x15')]['message']);}})[_0xa7c6('0x16')](function(_0x271500){logger[_0xa7c6('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x24b7c7,_0x271500);_0x1b246e(_0x271500);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 62a879d..0bde5d1 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 _0xa99c=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/run','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x17114d,_0x338418){var _0x89b1a0=function(_0x20c1b0){while(--_0x20c1b0){_0x17114d['push'](_0x17114d['shift']());}};_0x89b1a0(++_0x338418);}(_0xa99c,0x15a));var _0xca99=function(_0xc76644,_0x2c0f9a){_0xc76644=_0xc76644-0x0;var _0x366481=_0xa99c[_0xc76644];return _0x366481;};'use strict';var multer=require(_0xca99('0x0'));var util=require(_0xca99('0x1'));var path=require('path');var timeout=require(_0xca99('0x2'));var express=require(_0xca99('0x3'));var router=express[_0xca99('0x4')]();var fs_extra=require(_0xca99('0x5'));var auth=require(_0xca99('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca99('0x7'));var controller=require(_0xca99('0x8'));router[_0xca99('0x9')]('/',auth['isAuthenticated'](),controller[_0xca99('0xa')]);router[_0xca99('0x9')](_0xca99('0xb'),auth[_0xca99('0xc')](),controller[_0xca99('0xd')]);router[_0xca99('0x9')]('/:id/preview',auth[_0xca99('0xc')](),controller['preview']);router[_0xca99('0x9')](_0xca99('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xca99('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xca99('0xf')]);router[_0xca99('0x10')]('/',auth[_0xca99('0xc')](),controller[_0xca99('0x11')]);router[_0xca99('0x12')](_0xca99('0xb'),auth[_0xca99('0xc')](),controller[_0xca99('0x13')]);router[_0xca99('0x14')](_0xca99('0xb'),auth['isAuthenticated'](),controller[_0xca99('0x15')]);module['exports']=router; \ No newline at end of file +var _0xef78=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','multer'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0xef78,0x18b));var _0x8ef7=function(_0x167945,_0x32eb98){_0x167945=_0x167945-0x0;var _0x2ece10=_0xef78[_0x167945];return _0x2ece10;};'use strict';var multer=require(_0x8ef7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ef7('0x1'));var express=require(_0x8ef7('0x2'));var router=express[_0x8ef7('0x3')]();var fs_extra=require(_0x8ef7('0x4'));var auth=require(_0x8ef7('0x5'));var interaction=require(_0x8ef7('0x6'));var config=require(_0x8ef7('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x8ef7('0x8')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x9')]);router['get'](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['show']);router[_0x8ef7('0x8')](_0x8ef7('0xc'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0xd')]);router[_0x8ef7('0x8')](_0x8ef7('0xe'),auth[_0x8ef7('0xb')](),controller['run']);router[_0x8ef7('0x8')](_0x8ef7('0xf'),auth['isAuthenticated'](),controller[_0x8ef7('0x10')]);router[_0x8ef7('0x11')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x12')]);router[_0x8ef7('0x13')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['update']);router[_0x8ef7('0x14')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0x15')]);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 dea7b8b..ecfe146 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 _0x0823=['scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','pdf','csv','DATE','Loading','ENUM','manual'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0823,0xf3));var _0x3082=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0x0823[_0x36436d];return _0x34615d;};'use strict';var Sequelize=require(_0x3082('0x0'));var moment=require(_0x3082('0x1'));module['exports']={'name':{'type':Sequelize[_0x3082('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x3082('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x3082('0x4')},'savename':{'type':Sequelize[_0x3082('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3082('0x5')]},'endDate':{'type':Sequelize[_0x3082('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x3082('0x6')},'type':{'type':Sequelize[_0x3082('0x7')](_0x3082('0x8'),_0x3082('0x9')),'allowNull':![],'defaultValue':_0x3082('0x8')},'reportId':{'type':Sequelize[_0x3082('0xa')](0xb)[_0x3082('0xb')]},'reportType':{'type':Sequelize[_0x3082('0x2')]}}; \ No newline at end of file +var _0x366c=['scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x366c,0x189));var _0xc366=function(_0x23cbed,_0x3f2205){_0x23cbed=_0x23cbed-0x0;var _0xfd017=_0x366c[_0x23cbed];return _0xfd017;};'use strict';var Sequelize=require(_0xc366('0x0'));var moment=require(_0xc366('0x1'));module['exports']={'name':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x4'),_0xc366('0x5'),_0xc366('0x6')),'allowNull':![],'defaultValue':_0xc366('0x4')},'savename':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc366('0x7')]},'endDate':{'type':Sequelize[_0xc366('0x7')]},'status':{'type':Sequelize[_0xc366('0x2')],'defaultValue':_0xc366('0x8')},'type':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x9'),_0xc366('0xa')),'allowNull':![],'defaultValue':_0xc366('0x9')},'reportId':{'type':Sequelize[_0xc366('0xb')](0xb)[_0xc366('0xc')]},'reportType':{'type':Sequelize[_0xc366('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 112d8b7..29a947a 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 _0x202d=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','params','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','papaparse','../../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','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','ExtractedReports','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','AnalyticExtractedReport','include','options','find','create','body'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x202d,0x1ea));var _0xd202=function(_0x2aeffd,_0x5e0ce5){_0x2aeffd=_0x2aeffd-0x0;var _0x5ae8bb=_0x202d[_0x2aeffd];return _0x5ae8bb;};'use strict';var emlformat=require(_0xd202('0x0'));var rimraf=require(_0xd202('0x1'));var zipdir=require(_0xd202('0x2'));var jsonpatch=require(_0xd202('0x3'));var rp=require(_0xd202('0x4'));var moment=require(_0xd202('0x5'));var BPromise=require(_0xd202('0x6'));var Mustache=require(_0xd202('0x7'));var util=require(_0xd202('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd202('0x9'));var ejs=require(_0xd202('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd202('0xb'));var squel=require('squel');var crypto=require(_0xd202('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd202('0x9'));var querystring=require('querystring');var Papa=require(_0xd202('0xd'));var Redis=require('ioredis');var authService=require(_0xd202('0xe'));var qs=require(_0xd202('0xf'));var as=require(_0xd202('0x10'));var hardwareService=require(_0xd202('0x11'));var logger=require(_0xd202('0x12'))('api');var utils=require(_0xd202('0x13'));var config=require(_0xd202('0x14'));var licenseUtil=require(_0xd202('0x15'));var db=require(_0xd202('0x16'))['db'];function respondWithStatusCode(_0x372f6e,_0x409266){_0x409266=_0x409266||0xcc;return function(_0x318c13){if(_0x318c13){return _0x372f6e[_0xd202('0x17')](_0x409266);}return _0x372f6e['status'](_0x409266)[_0xd202('0x18')]();};}function respondWithResult(_0x242ebb,_0x35debb){_0x35debb=_0x35debb||0xc8;return function(_0x28e09d){if(_0x28e09d){return _0x242ebb[_0xd202('0x19')](_0x35debb)[_0xd202('0x1a')](_0x28e09d);}};}function respondWithFilteredResult(_0x374d58,_0x465693){return function(_0x3d16d0){if(_0x3d16d0){var _0x315146=typeof _0x465693['offset']===_0xd202('0x1b')&&typeof _0x465693[_0xd202('0x1c')]===_0xd202('0x1b');var _0x4aab7d=_0x3d16d0['count'];var _0x2cc9c4=_0x315146?0x0:_0x465693[_0xd202('0x1d')];var _0x4a326f=_0x315146?_0x3d16d0[_0xd202('0x1e')]:_0x465693['offset']+_0x465693['limit'];var _0x62427d;if(_0x4a326f>=_0x4aab7d){_0x4a326f=_0x4aab7d;_0x62427d=0xc8;}else{_0x62427d=0xce;}_0x374d58[_0xd202('0x19')](_0x62427d);return _0x374d58[_0xd202('0x1f')](_0xd202('0x20'),_0x2cc9c4+'-'+_0x4a326f+'/'+_0x4aab7d)[_0xd202('0x1a')](_0x3d16d0);}return null;};}function patchUpdates(_0x36cd99){return function(_0x1b2bfb){try{jsonpatch['apply'](_0x1b2bfb,_0x36cd99,!![]);}catch(_0x509816){return BPromise[_0xd202('0x21')](_0x509816);}return _0x1b2bfb['save']();};}function saveUpdates(_0x655737,_0x2734f5){return function(_0x2a8454){if(_0x2a8454){return _0x2a8454[_0xd202('0x22')](_0x655737)[_0xd202('0x23')](function(_0x481aed){return _0x481aed;});}return null;};}function removeEntity(_0x52809a,_0x5c2af3){return function(_0x1f5bef){if(_0x1f5bef){return _0x1f5bef[_0xd202('0x24')]()[_0xd202('0x23')](function(){var _0x15c173=_0x1f5bef['get']({'plain':!![]});var _0xf8d64d=_0xd202('0x25');return db['UserProfileResource'][_0xd202('0x24')]({'where':{'type':_0xf8d64d,'resourceId':_0x15c173['id']}})['then'](function(){return _0x1f5bef;});})['then'](function(){_0x52809a[_0xd202('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f3af,_0x2a8eb5){return function(_0x21e5e7){if(!_0x21e5e7){_0x53f3af[_0xd202('0x17')](0x194);}return _0x21e5e7;};}function handleError(_0xfed2ef,_0x433c5d){_0x433c5d=_0x433c5d||0x1f4;return function(_0x535499){logger[_0xd202('0x26')](_0x535499[_0xd202('0x27')]);if(_0x535499[_0xd202('0x28')]){delete _0x535499[_0xd202('0x28')];}_0xfed2ef[_0xd202('0x19')](_0x433c5d)[_0xd202('0x29')](_0x535499);};}exports[_0xd202('0x2a')]=function(_0x5f5f22,_0x5c9579){var _0x2ce87e={},_0x22042c={},_0x299e74={'count':0x0,'rows':[]};var _0x33bc1b=_['map'](db['AnalyticExtractedReport'][_0xd202('0x2b')],function(_0x164e8a){return{'name':_0x164e8a[_0xd202('0x2c')],'type':_0x164e8a[_0xd202('0x2d')]['key']};});_0x22042c[_0xd202('0x2e')]=_[_0xd202('0x2f')](_0x33bc1b,_0xd202('0x28'));_0x22042c[_0xd202('0x30')]=_[_0xd202('0x31')](_0x5f5f22[_0xd202('0x30')]);_0x22042c[_0xd202('0x32')]=_[_0xd202('0x33')](_0x22042c[_0xd202('0x2e')],_0x22042c[_0xd202('0x30')]);_0x2ce87e['attributes']=_[_0xd202('0x33')](_0x22042c['model'],qs[_0xd202('0x34')](_0x5f5f22[_0xd202('0x30')][_0xd202('0x34')]));_0x2ce87e[_0xd202('0x35')]=_0x2ce87e['attributes'][_0xd202('0x36')]?_0x2ce87e[_0xd202('0x35')]:_0x22042c['model'];if(!_0x5f5f22[_0xd202('0x30')][_0xd202('0x37')](_0xd202('0x38'))){_0x2ce87e[_0xd202('0x1c')]=qs[_0xd202('0x1c')](_0x5f5f22[_0xd202('0x30')]['limit']);_0x2ce87e[_0xd202('0x1d')]=qs[_0xd202('0x1d')](_0x5f5f22[_0xd202('0x30')][_0xd202('0x1d')]);}_0x2ce87e[_0xd202('0x39')]=qs[_0xd202('0x3a')](_0x5f5f22[_0xd202('0x30')][_0xd202('0x3a')]);_0x2ce87e[_0xd202('0x3b')]=qs[_0xd202('0x32')](_[_0xd202('0x3c')](_0x5f5f22[_0xd202('0x30')],_0x22042c[_0xd202('0x32')]),_0x33bc1b);if(_0x5f5f22['query'][_0xd202('0x3d')]){_0x2ce87e['where']=_['merge'](_0x2ce87e['where'],{'$or':_['map'](_0x33bc1b,function(_0x25e10f){if(_0x25e10f[_0xd202('0x2d')]!=='VIRTUAL'){var _0x3a483b={};_0x3a483b[_0x25e10f[_0xd202('0x28')]]={'$like':'%'+_0x5f5f22[_0xd202('0x30')][_0xd202('0x3d')]+'%'};return _0x3a483b;}})});}_0x2ce87e=_[_0xd202('0x3e')]({},_0x2ce87e,_0x5f5f22['options']);var _0x5c15ee={'where':_0x2ce87e[_0xd202('0x3b')]};return db['AnalyticExtractedReport'][_0xd202('0x1e')](_0x5c15ee)[_0xd202('0x23')](function(_0x2fa313){_0x299e74[_0xd202('0x1e')]=_0x2fa313;if(_0x5f5f22[_0xd202('0x30')][_0xd202('0x3f')]){_0x2ce87e['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xd202('0x40')](_0x2ce87e);})[_0xd202('0x23')](function(_0x32c337){_0x299e74[_0xd202('0x41')]=_0x32c337;return _0x299e74;})[_0xd202('0x23')](respondWithFilteredResult(_0x5c9579,_0x2ce87e))[_0xd202('0x42')](handleError(_0x5c9579,null));};exports[_0xd202('0x43')]=function(_0x3c18d6,_0x4fe108){var _0x3d5afb={'raw':!![],'where':{'id':_0x3c18d6['params']['id']}},_0xce8eac={};_0xce8eac['model']=_[_0xd202('0x31')](db[_0xd202('0x44')]['rawAttributes']);_0xce8eac[_0xd202('0x30')]=_[_0xd202('0x31')](_0x3c18d6[_0xd202('0x30')]);_0xce8eac[_0xd202('0x32')]=_[_0xd202('0x33')](_0xce8eac[_0xd202('0x2e')],_0xce8eac[_0xd202('0x30')]);_0x3d5afb[_0xd202('0x35')]=_[_0xd202('0x33')](_0xce8eac['model'],qs[_0xd202('0x34')](_0x3c18d6[_0xd202('0x30')][_0xd202('0x34')]));_0x3d5afb['attributes']=_0x3d5afb[_0xd202('0x35')][_0xd202('0x36')]?_0x3d5afb[_0xd202('0x35')]:_0xce8eac[_0xd202('0x2e')];if(_0x3c18d6['query'][_0xd202('0x3f')]){_0x3d5afb[_0xd202('0x45')]=[{'all':!![]}];}_0x3d5afb=_[_0xd202('0x3e')]({},_0x3d5afb,_0x3c18d6[_0xd202('0x46')]);return db['AnalyticExtractedReport'][_0xd202('0x47')](_0x3d5afb)['then'](handleEntityNotFound(_0x4fe108,null))[_0xd202('0x23')](respondWithResult(_0x4fe108,null))[_0xd202('0x42')](handleError(_0x4fe108,null));};exports[_0xd202('0x48')]=function(_0x121960,_0x3c95a5){return db[_0xd202('0x44')][_0xd202('0x48')](_0x121960[_0xd202('0x49')],{})[_0xd202('0x23')](function(_0x49ca0b){var _0x2c738c=_0x121960['user'][_0xd202('0x4a')]({'plain':!![]});if(!_0x2c738c)throw new Error(_0xd202('0x4b'));if(_0x2c738c['role']==='user'){var _0x4f2c6f=_0x49ca0b[_0xd202('0x4a')]({'plain':!![]});var _0xf128d7=_0xd202('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xf128d7,'userProfileId':_0x2c738c[_0xd202('0x4c')]},'raw':!![]})[_0xd202('0x23')](function(_0x5ae30c){if(_0x5ae30c&&_0x5ae30c[_0xd202('0x4d')]===0x0){return db[_0xd202('0x4e')]['create']({'name':_0x4f2c6f[_0xd202('0x28')],'resourceId':_0x4f2c6f['id'],'type':_0x5ae30c[_0xd202('0x28')],'sectionId':_0x5ae30c['id']},{})[_0xd202('0x23')](function(){return _0x49ca0b;});}else{return _0x49ca0b;}})[_0xd202('0x42')](function(_0x32f887){logger[_0xd202('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32f887);throw _0x32f887;});}return _0x49ca0b;})['then'](respondWithResult(_0x3c95a5,0xc9))[_0xd202('0x42')](handleError(_0x3c95a5,null));};exports[_0xd202('0x22')]=function(_0x156a86,_0x1453cf){if(_0x156a86['body']['id']){delete _0x156a86[_0xd202('0x49')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x156a86[_0xd202('0x4f')]['id']}})[_0xd202('0x23')](handleEntityNotFound(_0x1453cf,null))['then'](saveUpdates(_0x156a86[_0xd202('0x49')],null))[_0xd202('0x23')](respondWithResult(_0x1453cf,null))['catch'](handleError(_0x1453cf,null));};exports['destroy']=function(_0x40b9bd,_0x2c2b40){return db[_0xd202('0x44')][_0xd202('0x47')]({'where':{'id':_0x40b9bd[_0xd202('0x4f')]['id']}})[_0xd202('0x23')](handleEntityNotFound(_0x2c2b40,null))['then'](removeEntity(_0x2c2b40,null))[_0xd202('0x42')](handleError(_0x2c2b40,null));};exports['download']=function(_0xacf9bc,_0x2f5c78,_0xe5e073){return db['AnalyticExtractedReport'][_0xd202('0x47')]({'where':{'id':_0xacf9bc[_0xd202('0x4f')]['id']},'attributes':['name','basename',_0xd202('0x50'),_0xd202('0x51')],'raw':!![]})[_0xd202('0x23')](handleEntityNotFound(_0x2f5c78,null))[_0xd202('0x23')](function(_0x29ae29){if(_0x29ae29){if(!fs[_0xd202('0x52')](path[_0xd202('0x53')](config[_0xd202('0x54')],_0xd202('0x55'),_0x29ae29[_0xd202('0x50')]))){throw new db[(_0xd202('0x56'))]['ValidationError'](_0xd202('0x57'));}if(_0xacf9bc['query'][_0xd202('0x58')]){return _0x2f5c78[_0xd202('0x17')](0xc8);}return _0x2f5c78[_0xd202('0x59')](path[_0xd202('0x53')](config['root'],_0xd202('0x55'),_0x29ae29['savename']),util[_0xd202('0x5a')](_0xd202('0x5b'),_0x29ae29[_0xd202('0x5c')]||_0x29ae29['name'],_0x29ae29['output'][_0xd202('0x5d')]()));}})[_0xd202('0x42')](handleError(_0x2f5c78,null));}; \ No newline at end of file +var _0xc052=['fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','params','length','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','root','server/files/reports','savename','ValidationError','exists','join','format','basename','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x48ecd2,_0x481ad3){var _0x5a4457=function(_0xdd9abd){while(--_0xdd9abd){_0x48ecd2['push'](_0x48ecd2['shift']());}};_0x5a4457(++_0x481ad3);}(_0xc052,0xc5));var _0x2c05=function(_0x11f0ef,_0x4ea920){_0x11f0ef=_0x11f0ef-0x0;var _0x166391=_0xc052[_0x11f0ef];return _0x166391;};'use strict';var emlformat=require(_0x2c05('0x0'));var rimraf=require(_0x2c05('0x1'));var zipdir=require(_0x2c05('0x2'));var jsonpatch=require(_0x2c05('0x3'));var rp=require(_0x2c05('0x4'));var moment=require(_0x2c05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c05('0x6'));var util=require(_0x2c05('0x7'));var path=require(_0x2c05('0x8'));var sox=require(_0x2c05('0x9'));var csv=require('to-csv');var ejs=require(_0x2c05('0xa'));var fs=require('fs');var fs_extra=require(_0x2c05('0xb'));var _=require(_0x2c05('0xc'));var squel=require(_0x2c05('0xd'));var crypto=require(_0x2c05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2c05('0xf'));var toCsv=require(_0x2c05('0x10'));var querystring=require(_0x2c05('0x11'));var Papa=require(_0x2c05('0x12'));var Redis=require(_0x2c05('0x13'));var authService=require(_0x2c05('0x14'));var qs=require(_0x2c05('0x15'));var as=require(_0x2c05('0x16'));var hardwareService=require(_0x2c05('0x17'));var logger=require(_0x2c05('0x18'))(_0x2c05('0x19'));var utils=require(_0x2c05('0x1a'));var config=require(_0x2c05('0x1b'));var licenseUtil=require(_0x2c05('0x1c'));var db=require(_0x2c05('0x1d'))['db'];function respondWithStatusCode(_0x3ebd5a,_0x2102c4){_0x2102c4=_0x2102c4||0xcc;return function(_0x4dc6b2){if(_0x4dc6b2){return _0x3ebd5a[_0x2c05('0x1e')](_0x2102c4);}return _0x3ebd5a['status'](_0x2102c4)[_0x2c05('0x1f')]();};}function respondWithResult(_0x5a4c17,_0x410fcc){_0x410fcc=_0x410fcc||0xc8;return function(_0x927007){if(_0x927007){return _0x5a4c17[_0x2c05('0x20')](_0x410fcc)[_0x2c05('0x21')](_0x927007);}};}function respondWithFilteredResult(_0x2eb4da,_0x3ced6c){return function(_0x2a2e36){if(_0x2a2e36){var _0x1371b4=typeof _0x3ced6c[_0x2c05('0x22')]==='undefined'&&typeof _0x3ced6c[_0x2c05('0x23')]===_0x2c05('0x24');var _0x25fe6a=_0x2a2e36[_0x2c05('0x25')];var _0x52408a=_0x1371b4?0x0:_0x3ced6c[_0x2c05('0x22')];var _0x18bfba=_0x1371b4?_0x2a2e36[_0x2c05('0x25')]:_0x3ced6c['offset']+_0x3ced6c[_0x2c05('0x23')];var _0x300d60;if(_0x18bfba>=_0x25fe6a){_0x18bfba=_0x25fe6a;_0x300d60=0xc8;}else{_0x300d60=0xce;}_0x2eb4da[_0x2c05('0x20')](_0x300d60);return _0x2eb4da[_0x2c05('0x26')](_0x2c05('0x27'),_0x52408a+'-'+_0x18bfba+'/'+_0x25fe6a)[_0x2c05('0x21')](_0x2a2e36);}return null;};}function patchUpdates(_0x3134b){return function(_0x191a4c){try{jsonpatch[_0x2c05('0x28')](_0x191a4c,_0x3134b,!![]);}catch(_0x4d2326){return BPromise[_0x2c05('0x29')](_0x4d2326);}return _0x191a4c[_0x2c05('0x2a')]();};}function saveUpdates(_0x23af34,_0x3896da){return function(_0x37eab7){if(_0x37eab7){return _0x37eab7[_0x2c05('0x2b')](_0x23af34)[_0x2c05('0x2c')](function(_0x28d232){return _0x28d232;});}return null;};}function removeEntity(_0x39217a,_0x55e45f){return function(_0x19bfc7){if(_0x19bfc7){return _0x19bfc7['destroy']()['then'](function(){var _0x3a50f3=_0x19bfc7[_0x2c05('0x2d')]({'plain':!![]});var _0x1bff4d='ExtractedReports';return db[_0x2c05('0x2e')][_0x2c05('0x2f')]({'where':{'type':_0x1bff4d,'resourceId':_0x3a50f3['id']}})['then'](function(){return _0x19bfc7;});})['then'](function(){_0x39217a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2afbee,_0x36bc2d){return function(_0xa48c5f){if(!_0xa48c5f){_0x2afbee['sendStatus'](0x194);}return _0xa48c5f;};}function handleError(_0x2e6f6f,_0x5a1b61){_0x5a1b61=_0x5a1b61||0x1f4;return function(_0x111ec5){logger[_0x2c05('0x30')](_0x111ec5[_0x2c05('0x31')]);if(_0x111ec5['name']){delete _0x111ec5['name'];}_0x2e6f6f['status'](_0x5a1b61)['send'](_0x111ec5);};}exports[_0x2c05('0x32')]=function(_0x502a0a,_0x341a07){var _0x19137b={},_0x46d8b6={},_0x572284={'count':0x0,'rows':[]};var _0x1151b3=_[_0x2c05('0x33')](db['AnalyticExtractedReport'][_0x2c05('0x34')],function(_0x340eea){return{'name':_0x340eea[_0x2c05('0x35')],'type':_0x340eea[_0x2c05('0x36')][_0x2c05('0x37')]};});_0x46d8b6[_0x2c05('0x38')]=_[_0x2c05('0x33')](_0x1151b3,_0x2c05('0x39'));_0x46d8b6['query']=_[_0x2c05('0x3a')](_0x502a0a[_0x2c05('0x3b')]);_0x46d8b6[_0x2c05('0x3c')]=_[_0x2c05('0x3d')](_0x46d8b6['model'],_0x46d8b6[_0x2c05('0x3b')]);_0x19137b[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x46d8b6[_0x2c05('0x38')],qs['fields'](_0x502a0a['query'][_0x2c05('0x3f')]));_0x19137b[_0x2c05('0x3e')]=_0x19137b[_0x2c05('0x3e')]['length']?_0x19137b[_0x2c05('0x3e')]:_0x46d8b6['model'];if(!_0x502a0a['query'][_0x2c05('0x40')](_0x2c05('0x41'))){_0x19137b[_0x2c05('0x23')]=qs['limit'](_0x502a0a[_0x2c05('0x3b')]['limit']);_0x19137b[_0x2c05('0x22')]=qs[_0x2c05('0x22')](_0x502a0a[_0x2c05('0x3b')][_0x2c05('0x22')]);}_0x19137b['order']=qs[_0x2c05('0x42')](_0x502a0a[_0x2c05('0x3b')]['sort']);_0x19137b[_0x2c05('0x43')]=qs[_0x2c05('0x3c')](_['pick'](_0x502a0a[_0x2c05('0x3b')],_0x46d8b6[_0x2c05('0x3c')]),_0x1151b3);if(_0x502a0a['query'][_0x2c05('0x44')]){_0x19137b[_0x2c05('0x43')]=_[_0x2c05('0x45')](_0x19137b[_0x2c05('0x43')],{'$or':_[_0x2c05('0x33')](_0x1151b3,function(_0x500fb3){if(_0x500fb3['type']!==_0x2c05('0x46')){var _0xd210c1={};_0xd210c1[_0x500fb3[_0x2c05('0x39')]]={'$like':'%'+_0x502a0a[_0x2c05('0x3b')]['filter']+'%'};return _0xd210c1;}})});}_0x19137b=_[_0x2c05('0x45')]({},_0x19137b,_0x502a0a[_0x2c05('0x47')]);var _0xa73181={'where':_0x19137b[_0x2c05('0x43')]};return db[_0x2c05('0x48')][_0x2c05('0x25')](_0xa73181)[_0x2c05('0x2c')](function(_0x7fc80f){_0x572284['count']=_0x7fc80f;if(_0x502a0a['query'][_0x2c05('0x49')]){_0x19137b[_0x2c05('0x4a')]=[{'all':!![]}];}return db[_0x2c05('0x48')][_0x2c05('0x4b')](_0x19137b);})[_0x2c05('0x2c')](function(_0x1d787d){_0x572284['rows']=_0x1d787d;return _0x572284;})['then'](respondWithFilteredResult(_0x341a07,_0x19137b))['catch'](handleError(_0x341a07,null));};exports['show']=function(_0x2c5c5d,_0x27071c){var _0x2dff36={'raw':!![],'where':{'id':_0x2c5c5d[_0x2c05('0x4c')]['id']}},_0x4e6513={};_0x4e6513['model']=_[_0x2c05('0x3a')](db[_0x2c05('0x48')]['rawAttributes']);_0x4e6513[_0x2c05('0x3b')]=_['keys'](_0x2c5c5d[_0x2c05('0x3b')]);_0x4e6513['filters']=_[_0x2c05('0x3d')](_0x4e6513['model'],_0x4e6513['query']);_0x2dff36[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x4e6513[_0x2c05('0x38')],qs[_0x2c05('0x3f')](_0x2c5c5d['query'][_0x2c05('0x3f')]));_0x2dff36[_0x2c05('0x3e')]=_0x2dff36['attributes'][_0x2c05('0x4d')]?_0x2dff36[_0x2c05('0x3e')]:_0x4e6513[_0x2c05('0x38')];if(_0x2c5c5d[_0x2c05('0x3b')][_0x2c05('0x49')]){_0x2dff36[_0x2c05('0x4a')]=[{'all':!![]}];}_0x2dff36=_[_0x2c05('0x45')]({},_0x2dff36,_0x2c5c5d[_0x2c05('0x47')]);return db[_0x2c05('0x48')][_0x2c05('0x4e')](_0x2dff36)[_0x2c05('0x2c')](handleEntityNotFound(_0x27071c,null))[_0x2c05('0x2c')](respondWithResult(_0x27071c,null))[_0x2c05('0x4f')](handleError(_0x27071c,null));};exports[_0x2c05('0x50')]=function(_0x378526,_0x2e530a){return db[_0x2c05('0x48')]['create'](_0x378526[_0x2c05('0x51')],{})[_0x2c05('0x2c')](function(_0x562c6c){var _0x274c74=_0x378526[_0x2c05('0x52')][_0x2c05('0x2d')]({'plain':!![]});if(!_0x274c74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c74[_0x2c05('0x53')]===_0x2c05('0x52')){var _0x38b528=_0x562c6c[_0x2c05('0x2d')]({'plain':!![]});var _0xe590c3=_0x2c05('0x54');return db[_0x2c05('0x55')][_0x2c05('0x4e')]({'where':{'name':_0xe590c3,'userProfileId':_0x274c74[_0x2c05('0x56')]},'raw':!![]})[_0x2c05('0x2c')](function(_0x2a38c0){if(_0x2a38c0&&_0x2a38c0[_0x2c05('0x57')]===0x0){return db[_0x2c05('0x2e')][_0x2c05('0x50')]({'name':_0x38b528[_0x2c05('0x39')],'resourceId':_0x38b528['id'],'type':_0x2a38c0[_0x2c05('0x39')],'sectionId':_0x2a38c0['id']},{})[_0x2c05('0x2c')](function(){return _0x562c6c;});}else{return _0x562c6c;}})[_0x2c05('0x4f')](function(_0x4cc23b){logger['error'](_0x2c05('0x58'),_0x4cc23b);throw _0x4cc23b;});}return _0x562c6c;})[_0x2c05('0x2c')](respondWithResult(_0x2e530a,0xc9))['catch'](handleError(_0x2e530a,null));};exports[_0x2c05('0x2b')]=function(_0xaceb6e,_0x3b7dc8){if(_0xaceb6e[_0x2c05('0x51')]['id']){delete _0xaceb6e[_0x2c05('0x51')]['id'];}return db[_0x2c05('0x48')][_0x2c05('0x4e')]({'where':{'id':_0xaceb6e[_0x2c05('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b7dc8,null))[_0x2c05('0x2c')](saveUpdates(_0xaceb6e[_0x2c05('0x51')],null))['then'](respondWithResult(_0x3b7dc8,null))[_0x2c05('0x4f')](handleError(_0x3b7dc8,null));};exports[_0x2c05('0x2f')]=function(_0x1a3181,_0x31fd4b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x1a3181['params']['id']}})[_0x2c05('0x2c')](handleEntityNotFound(_0x31fd4b,null))[_0x2c05('0x2c')](removeEntity(_0x31fd4b,null))[_0x2c05('0x4f')](handleError(_0x31fd4b,null));};exports[_0x2c05('0x59')]=function(_0x463a25,_0x57ce27,_0x5bc87b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x463a25[_0x2c05('0x4c')]['id']},'attributes':[_0x2c05('0x39'),'basename','savename',_0x2c05('0x5a')],'raw':!![]})[_0x2c05('0x2c')](handleEntityNotFound(_0x57ce27,null))[_0x2c05('0x2c')](function(_0x58ac1c){if(_0x58ac1c){if(!fs['existsSync'](path['join'](config[_0x2c05('0x5b')],_0x2c05('0x5c'),_0x58ac1c[_0x2c05('0x5d')]))){throw new db['Sequelize'][(_0x2c05('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x463a25[_0x2c05('0x3b')][_0x2c05('0x5f')]){return _0x57ce27[_0x2c05('0x1e')](0xc8);}return _0x57ce27[_0x2c05('0x59')](path[_0x2c05('0x60')](config['root'],'server/files/reports',_0x58ac1c[_0x2c05('0x5d')]),util[_0x2c05('0x61')]('%s.%s',_0x58ac1c[_0x2c05('0x62')]||_0x58ac1c[_0x2c05('0x39')],_0x58ac1c['output'][_0x2c05('0x63')]()));}})['catch'](handleError(_0x57ce27,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 31778b2..7bbaf61 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 _0xc34f=['path','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x296588,_0x49f98d){var _0x2f6d92=function(_0x3f424c){while(--_0x3f424c){_0x296588['push'](_0x296588['shift']());}};_0x2f6d92(++_0x49f98d);}(_0xc34f,0x1c1));var _0xfc34=function(_0x3a1ac6,_0x421eeb){_0x3a1ac6=_0x3a1ac6-0x0;var _0x283822=_0xc34f[_0x3a1ac6];return _0x283822;};'use strict';var _=require(_0xfc34('0x0'));var util=require(_0xfc34('0x1'));var logger=require(_0xfc34('0x2'))(_0xfc34('0x3'));var moment=require(_0xfc34('0x4'));var BPromise=require(_0xfc34('0x5'));var rp=require(_0xfc34('0x6'));var fs=require('fs');var path=require(_0xfc34('0x7'));var rimraf=require('rimraf');var config=require(_0xfc34('0x8'));var attributes=require(_0xfc34('0x9'));module[_0xfc34('0xa')]=function(_0x44a4e8,_0x1d2fbe){return _0x44a4e8['define']('AnalyticExtractedReport',attributes,{'tableName':_0xfc34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3883=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x284863,_0x57e83e){var _0x4562d7=function(_0xbd103f){while(--_0xbd103f){_0x284863['push'](_0x284863['shift']());}};_0x4562d7(++_0x57e83e);}(_0x3883,0x108));var _0x3388=function(_0x4ffd7a,_0x57ae41){_0x4ffd7a=_0x4ffd7a-0x0;var _0x336ecc=_0x3883[_0x4ffd7a];return _0x336ecc;};'use strict';var _=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var logger=require(_0x3388('0x2'))(_0x3388('0x3'));var moment=require(_0x3388('0x4'));var BPromise=require(_0x3388('0x5'));var rp=require(_0x3388('0x6'));var fs=require('fs');var path=require(_0x3388('0x7'));var rimraf=require(_0x3388('0x8'));var config=require(_0x3388('0x9'));var attributes=require(_0x3388('0xa'));module[_0x3388('0xb')]=function(_0x4118b8,_0x15d917){return _0x4118b8[_0x3388('0xc')](_0x3388('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 176a905..6563014 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 _0x8512=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8512,0x70));var _0x2851=function(_0xedeceb,_0x570998){_0xedeceb=_0xedeceb-0x0;var _0xb7127b=_0x8512[_0xedeceb];return _0xb7127b;};'use strict';var _=require(_0x2851('0x0'));var util=require(_0x2851('0x1'));var moment=require(_0x2851('0x2'));var BPromise=require(_0x2851('0x3'));var rs=require(_0x2851('0x4'));var fs=require('fs');var Redis=require(_0x2851('0x5'));var db=require(_0x2851('0x6'))['db'];var utils=require(_0x2851('0x7'));var logger=require(_0x2851('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2851('0x9'));var client=jayson['client'][_0x2851('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a5d1,_0x170ba5,_0x2cda5a){return new BPromise(function(_0x389a5a,_0x828ac8){return client[_0x2851('0xb')](_0x13a5d1,_0x2cda5a)['then'](function(_0x1995b8){logger[_0x2851('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x170ba5,'request\x20sent');logger[_0x2851('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x170ba5,'request\x20sent',JSON[_0x2851('0xe')](_0x1995b8));if(_0x1995b8[_0x2851('0xf')]){if(_0x1995b8[_0x2851('0xf')][_0x2851('0x10')]===0x1f4){logger[_0x2851('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x170ba5,_0x1995b8[_0x2851('0xf')]['message']);return _0x828ac8(_0x1995b8[_0x2851('0xf')]['message']);}logger[_0x2851('0xf')](_0x2851('0x11'),_0x170ba5,_0x1995b8[_0x2851('0xf')]['message']);return _0x389a5a(_0x1995b8[_0x2851('0xf')][_0x2851('0x12')]);}else{logger[_0x2851('0xc')](_0x2851('0x11'),_0x170ba5,_0x2851('0x13'));_0x389a5a(_0x1995b8[_0x2851('0x14')][_0x2851('0x12')]);}})[_0x2851('0x15')](function(_0x417c22){logger[_0x2851('0xf')](_0x2851('0x11'),_0x170ba5,_0x417c22);_0x828ac8(_0x417c22);});});} \ No newline at end of file +var _0x7f65=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ef951,_0x29f086){var _0x124295=function(_0x41abd4){while(--_0x41abd4){_0x2ef951['push'](_0x2ef951['shift']());}};_0x124295(++_0x29f086);}(_0x7f65,0x91));var _0x57f6=function(_0x193634,_0xb42415){_0x193634=_0x193634-0x0;var _0x3b5955=_0x7f65[_0x193634];return _0x3b5955;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var moment=require(_0x57f6('0x2'));var BPromise=require(_0x57f6('0x3'));var rs=require(_0x57f6('0x4'));var fs=require('fs');var Redis=require(_0x57f6('0x5'));var db=require(_0x57f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x57f6('0x7'))('rpc');var config=require(_0x57f6('0x8'));var jayson=require(_0x57f6('0x9'));var client=jayson['client'][_0x57f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa34d28,_0x2d6d12,_0xedaa76){return new BPromise(function(_0x3dcd2a,_0x3cfd38){return client[_0x57f6('0xb')](_0xa34d28,_0xedaa76)[_0x57f6('0xc')](function(_0x128fda){logger['info'](_0x57f6('0xd'),_0x2d6d12,_0x57f6('0xe'));logger[_0x57f6('0xf')](_0x57f6('0x10'),_0x2d6d12,_0x57f6('0xe'),JSON[_0x57f6('0x11')](_0x128fda));if(_0x128fda[_0x57f6('0x12')]){if(_0x128fda['error'][_0x57f6('0x13')]===0x1f4){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);return _0x3cfd38(_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);}logger['error'](_0x57f6('0xd'),_0x2d6d12,_0x128fda['error'][_0x57f6('0x14')]);return _0x3dcd2a(_0x128fda['error'][_0x57f6('0x14')]);}else{logger[_0x57f6('0x15')](_0x57f6('0xd'),_0x2d6d12,'request\x20sent');_0x3dcd2a(_0x128fda['result'][_0x57f6('0x14')]);}})[_0x57f6('0x16')](function(_0x1e3290){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x1e3290);_0x3cfd38(_0x1e3290);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index feeae85..91c3cb8 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 _0xd66f=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/download'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd66f,0x1d2));var _0xfd66=function(_0x3b092f,_0x5d70c1){_0x3b092f=_0x3b092f-0x0;var _0x1b2b46=_0xd66f[_0x3b092f];return _0x1b2b46;};'use strict';var multer=require(_0xfd66('0x0'));var util=require(_0xfd66('0x1'));var path=require(_0xfd66('0x2'));var timeout=require(_0xfd66('0x3'));var express=require(_0xfd66('0x4'));var router=express['Router']();var fs_extra=require(_0xfd66('0x5'));var auth=require(_0xfd66('0x6'));var interaction=require(_0xfd66('0x7'));var config=require(_0xfd66('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xfd66('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd66('0xa')]);router['get']('/:id',auth[_0xfd66('0xb')](),controller[_0xfd66('0xc')]);router[_0xfd66('0x9')](_0xfd66('0xd'),auth[_0xfd66('0xb')](),controller['download']);router['post']('/',auth[_0xfd66('0xb')](),controller[_0xfd66('0xe')]);router[_0xfd66('0xf')](_0xfd66('0x10'),auth['isAuthenticated'](),controller[_0xfd66('0x11')]);router[_0xfd66('0x12')](_0xfd66('0x10'),auth[_0xfd66('0xb')](),controller['destroy']);module[_0xfd66('0x13')]=router; \ No newline at end of file +var _0x3f8c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1edbe7,_0x140075){var _0x46f827=function(_0x4a0a95){while(--_0x4a0a95){_0x1edbe7['push'](_0x1edbe7['shift']());}};_0x46f827(++_0x140075);}(_0x3f8c,0x7a));var _0xc3f8=function(_0x404341,_0x1d23d8){_0x404341=_0x404341-0x0;var _0x578bdd=_0x3f8c[_0x404341];return _0x578bdd;};'use strict';var multer=require(_0xc3f8('0x0'));var util=require(_0xc3f8('0x1'));var path=require(_0xc3f8('0x2'));var timeout=require(_0xc3f8('0x3'));var express=require(_0xc3f8('0x4'));var router=express[_0xc3f8('0x5')]();var fs_extra=require(_0xc3f8('0x6'));var auth=require(_0xc3f8('0x7'));var interaction=require(_0xc3f8('0x8'));var config=require(_0xc3f8('0x9'));var controller=require(_0xc3f8('0xa'));router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0xd')]);router['get'](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0xf')]);router[_0xc3f8('0xb')](_0xc3f8('0x10'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x11')]);router[_0xc3f8('0x12')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x13')]);router[_0xc3f8('0x14')](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0x15')]);router[_0xc3f8('0x16')](_0xc3f8('0xe'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x17')]);module[_0xc3f8('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6d2591e..4290d70 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 _0x4205=['STRING','BOOLEAN','exports'];(function(_0x10eb0d,_0x128e82){var _0x466900=function(_0x307d72){while(--_0x307d72){_0x10eb0d['push'](_0x10eb0d['shift']());}};_0x466900(++_0x128e82);}(_0x4205,0x185));var _0x5420=function(_0x39be9b,_0x5e2b1f){_0x39be9b=_0x39be9b-0x0;var _0x3de73b=_0x4205[_0x39be9b];return _0x3de73b;};'use strict';var Sequelize=require('sequelize');module[_0x5420('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x5420('0x1')]},'function':{'type':Sequelize[_0x5420('0x1')]},'format':{'type':Sequelize[_0x5420('0x1')]},'groupBy':{'type':Sequelize[_0x5420('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5420('0x1')]},'custom':{'type':Sequelize[_0x5420('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0da5=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x564b82,_0x4c0db0){var _0x4111d9=function(_0x3d0b66){while(--_0x3d0b66){_0x564b82['push'](_0x564b82['shift']());}};_0x4111d9(++_0x4c0db0);}(_0x0da5,0x18f));var _0x50da=function(_0x9c9ec2,_0x1f7eb1){_0x9c9ec2=_0x9c9ec2-0x0;var _0x1d6877=_0x0da5[_0x9c9ec2];return _0x1d6877;};'use strict';var Sequelize=require(_0x50da('0x0'));module[_0x50da('0x1')]={'field':{'type':Sequelize[_0x50da('0x2')]},'alias':{'type':Sequelize[_0x50da('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50da('0x3')]},'custom':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e4dd41b..6bf2c16 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 _0x6e1c=['rows','catch','show','options','create','body','bulkCreate','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0x6e1c,0x145));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc6e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e1('0x1'));var rp=require('request-promise');var moment=require(_0xc6e1('0x2'));var BPromise=require(_0xc6e1('0x3'));var Mustache=require(_0xc6e1('0x4'));var util=require(_0xc6e1('0x5'));var path=require(_0xc6e1('0x6'));var sox=require('sox');var csv=require(_0xc6e1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6e1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc6e1('0x9'));var jsforce=require(_0xc6e1('0xa'));var deskjs=require(_0xc6e1('0xb'));var toCsv=require(_0xc6e1('0x7'));var querystring=require(_0xc6e1('0xc'));var Papa=require(_0xc6e1('0xd'));var Redis=require(_0xc6e1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc6e1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc6e1('0x10'));var utils=require(_0xc6e1('0x11'));var config=require(_0xc6e1('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b9254,_0x1b0965){_0x1b0965=_0x1b0965||0xcc;return function(_0x548777){if(_0x548777){return _0x1b9254[_0xc6e1('0x13')](_0x1b0965);}return _0x1b9254[_0xc6e1('0x14')](_0x1b0965)[_0xc6e1('0x15')]();};}function respondWithResult(_0x1b0f59,_0x7b7083){_0x7b7083=_0x7b7083||0xc8;return function(_0x5edab7){if(_0x5edab7){return _0x1b0f59['status'](_0x7b7083)[_0xc6e1('0x16')](_0x5edab7);}};}function respondWithFilteredResult(_0xa16e16,_0x123cb1){return function(_0x51c023){if(_0x51c023){var _0x18b562=typeof _0x123cb1[_0xc6e1('0x17')]==='undefined'&&typeof _0x123cb1[_0xc6e1('0x18')]==='undefined';var _0x133472=_0x51c023[_0xc6e1('0x19')];var _0x292a30=_0x18b562?0x0:_0x123cb1[_0xc6e1('0x17')];var _0x4e2218=_0x18b562?_0x51c023['count']:_0x123cb1[_0xc6e1('0x17')]+_0x123cb1[_0xc6e1('0x18')];var _0x2bbd30;if(_0x4e2218>=_0x133472){_0x4e2218=_0x133472;_0x2bbd30=0xc8;}else{_0x2bbd30=0xce;}_0xa16e16[_0xc6e1('0x14')](_0x2bbd30);return _0xa16e16['set'](_0xc6e1('0x1a'),_0x292a30+'-'+_0x4e2218+'/'+_0x133472)[_0xc6e1('0x16')](_0x51c023);}return null;};}function patchUpdates(_0x1186ce){return function(_0x4d44ae){try{jsonpatch['apply'](_0x4d44ae,_0x1186ce,!![]);}catch(_0x1f8df2){return BPromise[_0xc6e1('0x1b')](_0x1f8df2);}return _0x4d44ae['save']();};}function saveUpdates(_0xc86fae,_0x598f4b){return function(_0x41faf8){if(_0x41faf8){return _0x41faf8[_0xc6e1('0x1c')](_0xc86fae)[_0xc6e1('0x1d')](function(_0x5d13dd){return _0x5d13dd;});}return null;};}function removeEntity(_0x45172c,_0x82380b){return function(_0x3cd116){if(_0x3cd116){return _0x3cd116[_0xc6e1('0x1e')]()[_0xc6e1('0x1d')](function(){_0x45172c[_0xc6e1('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195d57,_0x567906){return function(_0x353ef5){if(!_0x353ef5){_0x195d57[_0xc6e1('0x13')](0x194);}return _0x353ef5;};}function handleError(_0x7d09cb,_0x5a72d5){_0x5a72d5=_0x5a72d5||0x1f4;return function(_0x38133a){logger[_0xc6e1('0x1f')](_0x38133a[_0xc6e1('0x20')]);if(_0x38133a[_0xc6e1('0x21')]){delete _0x38133a[_0xc6e1('0x21')];}_0x7d09cb[_0xc6e1('0x14')](_0x5a72d5)[_0xc6e1('0x22')](_0x38133a);};}exports[_0xc6e1('0x23')]=function(_0x32cd80,_0x23d506){var _0xaaaef7={},_0x459b65={},_0x10673c={'count':0x0,'rows':[]};var _0x33af4c=_[_0xc6e1('0x24')](db[_0xc6e1('0x25')]['rawAttributes'],function(_0x421f57){return{'name':_0x421f57['fieldName'],'type':_0x421f57[_0xc6e1('0x26')][_0xc6e1('0x27')]};});_0x459b65[_0xc6e1('0x28')]=_[_0xc6e1('0x24')](_0x33af4c,_0xc6e1('0x21'));_0x459b65[_0xc6e1('0x29')]=_[_0xc6e1('0x2a')](_0x32cd80[_0xc6e1('0x29')]);_0x459b65[_0xc6e1('0x2b')]=_['intersection'](_0x459b65['model'],_0x459b65[_0xc6e1('0x29')]);_0xaaaef7[_0xc6e1('0x2c')]=_[_0xc6e1('0x2d')](_0x459b65[_0xc6e1('0x28')],qs['fields'](_0x32cd80[_0xc6e1('0x29')][_0xc6e1('0x2e')]));_0xaaaef7[_0xc6e1('0x2c')]=_0xaaaef7[_0xc6e1('0x2c')][_0xc6e1('0x2f')]?_0xaaaef7['attributes']:_0x459b65[_0xc6e1('0x28')];if(!_0x32cd80[_0xc6e1('0x29')][_0xc6e1('0x30')](_0xc6e1('0x31'))){_0xaaaef7[_0xc6e1('0x18')]=qs[_0xc6e1('0x18')](_0x32cd80[_0xc6e1('0x29')]['limit']);_0xaaaef7[_0xc6e1('0x17')]=qs[_0xc6e1('0x17')](_0x32cd80['query'][_0xc6e1('0x17')]);}_0xaaaef7[_0xc6e1('0x32')]=qs['sort'](_0x32cd80[_0xc6e1('0x29')][_0xc6e1('0x33')]);_0xaaaef7[_0xc6e1('0x34')]=qs[_0xc6e1('0x2b')](_[_0xc6e1('0x35')](_0x32cd80['query'],_0x459b65[_0xc6e1('0x2b')]),_0x33af4c);if(_0x32cd80[_0xc6e1('0x29')][_0xc6e1('0x36')]){_0xaaaef7[_0xc6e1('0x34')]=_[_0xc6e1('0x37')](_0xaaaef7[_0xc6e1('0x34')],{'$or':_[_0xc6e1('0x24')](_0x33af4c,function(_0x25e76a){if(_0x25e76a[_0xc6e1('0x26')]!==_0xc6e1('0x38')){var _0x384b0d={};_0x384b0d[_0x25e76a[_0xc6e1('0x21')]]={'$like':'%'+_0x32cd80[_0xc6e1('0x29')][_0xc6e1('0x36')]+'%'};return _0x384b0d;}})});}_0xaaaef7=_[_0xc6e1('0x37')]({},_0xaaaef7,_0x32cd80['options']);var _0x4c3979={'where':_0xaaaef7[_0xc6e1('0x34')]};return db[_0xc6e1('0x25')]['count'](_0x4c3979)[_0xc6e1('0x1d')](function(_0x5a7fe3){_0x10673c[_0xc6e1('0x19')]=_0x5a7fe3;if(_0x32cd80['query'][_0xc6e1('0x39')]){_0xaaaef7[_0xc6e1('0x3a')]=[{'all':!![]}];}return db[_0xc6e1('0x25')][_0xc6e1('0x3b')](_0xaaaef7);})[_0xc6e1('0x1d')](function(_0x17b955){_0x10673c[_0xc6e1('0x3c')]=_0x17b955;return _0x10673c;})['then'](respondWithFilteredResult(_0x23d506,_0xaaaef7))[_0xc6e1('0x3d')](handleError(_0x23d506,null));};exports[_0xc6e1('0x3e')]=function(_0x10c97d,_0x2f9e21){var _0x284a2d={'raw':![],'where':{'id':_0x10c97d['params']['id']}},_0x25e1a9={};_0x25e1a9[_0xc6e1('0x28')]=_[_0xc6e1('0x2a')](db[_0xc6e1('0x25')]['rawAttributes']);_0x25e1a9[_0xc6e1('0x29')]=_['keys'](_0x10c97d[_0xc6e1('0x29')]);_0x25e1a9[_0xc6e1('0x2b')]=_[_0xc6e1('0x2d')](_0x25e1a9[_0xc6e1('0x28')],_0x25e1a9['query']);_0x284a2d[_0xc6e1('0x2c')]=_[_0xc6e1('0x2d')](_0x25e1a9[_0xc6e1('0x28')],qs['fields'](_0x10c97d['query'][_0xc6e1('0x2e')]));_0x284a2d[_0xc6e1('0x2c')]=_0x284a2d[_0xc6e1('0x2c')][_0xc6e1('0x2f')]?_0x284a2d[_0xc6e1('0x2c')]:_0x25e1a9[_0xc6e1('0x28')];if(_0x10c97d[_0xc6e1('0x29')]['includeAll']){_0x284a2d[_0xc6e1('0x3a')]=[{'all':!![]}];}_0x284a2d=_[_0xc6e1('0x37')]({},_0x284a2d,_0x10c97d[_0xc6e1('0x3f')]);return db[_0xc6e1('0x25')]['find'](_0x284a2d)[_0xc6e1('0x1d')](handleEntityNotFound(_0x2f9e21,null))['then'](respondWithResult(_0x2f9e21,null))[_0xc6e1('0x3d')](handleError(_0x2f9e21,null));};exports[_0xc6e1('0x40')]=function(_0x1b914c,_0x3a622b){return db[_0xc6e1('0x25')][_0xc6e1('0x40')](_0x1b914c[_0xc6e1('0x41')],{})['then'](respondWithResult(_0x3a622b,0xc9))[_0xc6e1('0x3d')](handleError(_0x3a622b,null));};exports[_0xc6e1('0x42')]=function(_0x33ec64,_0x4f5e54){return db[_0xc6e1('0x25')][_0xc6e1('0x42')](_0x33ec64[_0xc6e1('0x41')],{'raw':![],'individualHooks':!![]})[_0xc6e1('0x1d')](respondWithResult(_0x4f5e54,0xc9))['catch'](handleError(_0x4f5e54,null));};exports[_0xc6e1('0x1c')]=function(_0x15b35e,_0x5ed64a){if(_0x15b35e[_0xc6e1('0x41')]['id']){delete _0x15b35e[_0xc6e1('0x41')]['id'];}return db[_0xc6e1('0x25')][_0xc6e1('0x43')]({'where':{'id':_0x15b35e[_0xc6e1('0x44')]['id']}})[_0xc6e1('0x1d')](handleEntityNotFound(_0x5ed64a,null))['then'](saveUpdates(_0x15b35e['body'],null))[_0xc6e1('0x1d')](respondWithResult(_0x5ed64a,null))[_0xc6e1('0x3d')](handleError(_0x5ed64a,null));};exports[_0xc6e1('0x1e')]=function(_0x5de5d4,_0x4672fa){return db[_0xc6e1('0x25')][_0xc6e1('0x43')]({'where':{'id':_0x5de5d4['params']['id']}})[_0xc6e1('0x1d')](handleEntityNotFound(_0x4672fa,null))[_0xc6e1('0x1d')](removeEntity(_0x4672fa,null))[_0xc6e1('0x3d')](handleError(_0x4672fa,null));};exports[_0xc6e1('0x45')]=function(_0x3e4c8f,_0x177921){return db['AnalyticFieldReport'][_0xc6e1('0x1e')]({'where':{'id':_0x3e4c8f[_0xc6e1('0x29')][_0xc6e1('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0xc6e1('0x1d')](respondWithResult(_0x177921,0xcc))[_0xc6e1('0x3d')](handleError(_0x177921,null));};exports[_0xc6e1('0x47')]=function(_0x44cc60,_0x21ff7b,_0x30c910){return db[_0xc6e1('0x48')][_0xc6e1('0x49')]({'where':{'id':_0x44cc60[_0xc6e1('0x44')]['id']}})['then'](handleEntityNotFound(_0x21ff7b,null))[_0xc6e1('0x1d')](function(_0x2e13f7){if(_0x2e13f7){return db[_0xc6e1('0x4a')][_0xc6e1('0x4b')](function(_0xf42824){return db[_0xc6e1('0x25')][_0xc6e1('0x1e')]({'where':{'CustomReportId':_0x44cc60[_0xc6e1('0x44')]['id']},'transaction':_0xf42824})[_0xc6e1('0x1d')](function(_0x38a390){var _0x48f6ee=_['map'](_0x44cc60[_0xc6e1('0x41')],function(_0x5a3b8e){delete _0x5a3b8e['id'];_0x5a3b8e[_0xc6e1('0x4c')]=_0x44cc60[_0xc6e1('0x44')]['id'];return _0x5a3b8e;});return db[_0xc6e1('0x25')][_0xc6e1('0x42')](_0x48f6ee,{'transaction':_0xf42824});});})[_0xc6e1('0x1d')](function(){return db['AnalyticFieldReport'][_0xc6e1('0x3b')]({'where':{'CustomReportId':_0x44cc60[_0xc6e1('0x44')]['id']}});});}})['then'](respondWithResult(_0x21ff7b,null))[_0xc6e1('0x3d')](handleError(_0x21ff7b,null));}; \ No newline at end of file +var _0xd9e4=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','find','catch','create','body','bulkCreate','update','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','model','keys','query','filters','intersection','attributes','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xd9e4,0x1f4));var _0x4d9e=function(_0x2bbdc4,_0x2cb88e){_0x2bbdc4=_0x2bbdc4-0x0;var _0x482d0c=_0xd9e4[_0x2bbdc4];return _0x482d0c;};'use strict';var emlformat=require(_0x4d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d9e('0x1'));var jsonpatch=require(_0x4d9e('0x2'));var rp=require(_0x4d9e('0x3'));var moment=require(_0x4d9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d9e('0x5'));var util=require(_0x4d9e('0x6'));var path=require(_0x4d9e('0x7'));var sox=require(_0x4d9e('0x8'));var csv=require(_0x4d9e('0x9'));var ejs=require(_0x4d9e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d9e('0xb'));var squel=require(_0x4d9e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d9e('0xd'));var deskjs=require(_0x4d9e('0xe'));var toCsv=require(_0x4d9e('0x9'));var querystring=require('querystring');var Papa=require(_0x4d9e('0xf'));var Redis=require('ioredis');var authService=require(_0x4d9e('0x10'));var qs=require(_0x4d9e('0x11'));var as=require(_0x4d9e('0x12'));var hardwareService=require(_0x4d9e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4d9e('0x14'));var config=require(_0x4d9e('0x15'));var licenseUtil=require(_0x4d9e('0x16'));var db=require(_0x4d9e('0x17'))['db'];function respondWithStatusCode(_0x19a6e9,_0x3324d2){_0x3324d2=_0x3324d2||0xcc;return function(_0x26eb9b){if(_0x26eb9b){return _0x19a6e9[_0x4d9e('0x18')](_0x3324d2);}return _0x19a6e9['status'](_0x3324d2)[_0x4d9e('0x19')]();};}function respondWithResult(_0xeae0a1,_0x40fe85){_0x40fe85=_0x40fe85||0xc8;return function(_0x553155){if(_0x553155){return _0xeae0a1[_0x4d9e('0x1a')](_0x40fe85)[_0x4d9e('0x1b')](_0x553155);}};}function respondWithFilteredResult(_0x1fc925,_0xb0b1b0){return function(_0x2ee7f5){if(_0x2ee7f5){var _0x152057=typeof _0xb0b1b0[_0x4d9e('0x1c')]===_0x4d9e('0x1d')&&typeof _0xb0b1b0[_0x4d9e('0x1e')]==='undefined';var _0x369fe0=_0x2ee7f5['count'];var _0x583d50=_0x152057?0x0:_0xb0b1b0['offset'];var _0x4dcb99=_0x152057?_0x2ee7f5[_0x4d9e('0x1f')]:_0xb0b1b0[_0x4d9e('0x1c')]+_0xb0b1b0[_0x4d9e('0x1e')];var _0x2fbbe0;if(_0x4dcb99>=_0x369fe0){_0x4dcb99=_0x369fe0;_0x2fbbe0=0xc8;}else{_0x2fbbe0=0xce;}_0x1fc925['status'](_0x2fbbe0);return _0x1fc925[_0x4d9e('0x20')]('Content-Range',_0x583d50+'-'+_0x4dcb99+'/'+_0x369fe0)[_0x4d9e('0x1b')](_0x2ee7f5);}return null;};}function patchUpdates(_0x258f71){return function(_0x282d7e){try{jsonpatch[_0x4d9e('0x21')](_0x282d7e,_0x258f71,!![]);}catch(_0x3a40b8){return BPromise[_0x4d9e('0x22')](_0x3a40b8);}return _0x282d7e[_0x4d9e('0x23')]();};}function saveUpdates(_0x1b3d01,_0x34cf6a){return function(_0x35aa55){if(_0x35aa55){return _0x35aa55['update'](_0x1b3d01)[_0x4d9e('0x24')](function(_0x26b921){return _0x26b921;});}return null;};}function removeEntity(_0x564679,_0x2b1731){return function(_0x154a6e){if(_0x154a6e){return _0x154a6e[_0x4d9e('0x25')]()[_0x4d9e('0x24')](function(){_0x564679['status'](0xcc)[_0x4d9e('0x19')]();});}};}function handleEntityNotFound(_0x52acfe,_0x4984fb){return function(_0x3003e2){if(!_0x3003e2){_0x52acfe['sendStatus'](0x194);}return _0x3003e2;};}function handleError(_0x25cd21,_0x15878b){_0x15878b=_0x15878b||0x1f4;return function(_0x3aaa43){logger[_0x4d9e('0x26')](_0x3aaa43[_0x4d9e('0x27')]);if(_0x3aaa43['name']){delete _0x3aaa43[_0x4d9e('0x28')];}_0x25cd21[_0x4d9e('0x1a')](_0x15878b)[_0x4d9e('0x29')](_0x3aaa43);};}exports['index']=function(_0x5360c5,_0x3a09c0){var _0x8cd97={},_0x14c022={},_0x5d210d={'count':0x0,'rows':[]};var _0xf18497=_[_0x4d9e('0x2a')](db[_0x4d9e('0x2b')]['rawAttributes'],function(_0x1cccb0){return{'name':_0x1cccb0[_0x4d9e('0x2c')],'type':_0x1cccb0[_0x4d9e('0x2d')]['key']};});_0x14c022[_0x4d9e('0x2e')]=_[_0x4d9e('0x2a')](_0xf18497,_0x4d9e('0x28'));_0x14c022['query']=_[_0x4d9e('0x2f')](_0x5360c5[_0x4d9e('0x30')]);_0x14c022[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],_0x14c022['query']);_0x8cd97[_0x4d9e('0x33')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],qs['fields'](_0x5360c5['query']['fields']));_0x8cd97['attributes']=_0x8cd97[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x8cd97[_0x4d9e('0x33')]:_0x14c022['model'];if(!_0x5360c5[_0x4d9e('0x30')]['hasOwnProperty']('nolimit')){_0x8cd97[_0x4d9e('0x1e')]=qs['limit'](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1e')]);_0x8cd97[_0x4d9e('0x1c')]=qs[_0x4d9e('0x1c')](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1c')]);}_0x8cd97[_0x4d9e('0x35')]=qs['sort'](_0x5360c5['query'][_0x4d9e('0x36')]);_0x8cd97[_0x4d9e('0x37')]=qs[_0x4d9e('0x31')](_[_0x4d9e('0x38')](_0x5360c5['query'],_0x14c022[_0x4d9e('0x31')]),_0xf18497);if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]){_0x8cd97[_0x4d9e('0x37')]=_[_0x4d9e('0x3a')](_0x8cd97[_0x4d9e('0x37')],{'$or':_[_0x4d9e('0x2a')](_0xf18497,function(_0x362e75){if(_0x362e75[_0x4d9e('0x2d')]!==_0x4d9e('0x3b')){var _0x1acd1c={};_0x1acd1c[_0x362e75['name']]={'$like':'%'+_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]+'%'};return _0x1acd1c;}})});}_0x8cd97=_[_0x4d9e('0x3a')]({},_0x8cd97,_0x5360c5[_0x4d9e('0x3c')]);var _0x5cf4ab={'where':_0x8cd97[_0x4d9e('0x37')]};return db[_0x4d9e('0x2b')]['count'](_0x5cf4ab)[_0x4d9e('0x24')](function(_0x414b2b){_0x5d210d[_0x4d9e('0x1f')]=_0x414b2b;if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x8cd97[_0x4d9e('0x3e')]=[{'all':!![]}];}return db[_0x4d9e('0x2b')][_0x4d9e('0x3f')](_0x8cd97);})['then'](function(_0x418495){_0x5d210d[_0x4d9e('0x40')]=_0x418495;return _0x5d210d;})[_0x4d9e('0x24')](respondWithFilteredResult(_0x3a09c0,_0x8cd97))['catch'](handleError(_0x3a09c0,null));};exports['show']=function(_0x160bc9,_0x7dc052){var _0x232293={'raw':![],'where':{'id':_0x160bc9[_0x4d9e('0x41')]['id']}},_0x5912a0={};_0x5912a0[_0x4d9e('0x2e')]=_[_0x4d9e('0x2f')](db['AnalyticFieldReport'][_0x4d9e('0x42')]);_0x5912a0[_0x4d9e('0x30')]=_[_0x4d9e('0x2f')](_0x160bc9[_0x4d9e('0x30')]);_0x5912a0[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x5912a0[_0x4d9e('0x2e')],_0x5912a0[_0x4d9e('0x30')]);_0x232293['attributes']=_['intersection'](_0x5912a0[_0x4d9e('0x2e')],qs[_0x4d9e('0x43')](_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x43')]));_0x232293[_0x4d9e('0x33')]=_0x232293[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x232293[_0x4d9e('0x33')]:_0x5912a0[_0x4d9e('0x2e')];if(_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x232293['include']=[{'all':!![]}];}_0x232293=_[_0x4d9e('0x3a')]({},_0x232293,_0x160bc9[_0x4d9e('0x3c')]);return db[_0x4d9e('0x2b')][_0x4d9e('0x44')](_0x232293)[_0x4d9e('0x24')](handleEntityNotFound(_0x7dc052,null))[_0x4d9e('0x24')](respondWithResult(_0x7dc052,null))[_0x4d9e('0x45')](handleError(_0x7dc052,null));};exports[_0x4d9e('0x46')]=function(_0xb73e6a,_0x4d98fc){return db[_0x4d9e('0x2b')][_0x4d9e('0x46')](_0xb73e6a[_0x4d9e('0x47')],{})[_0x4d9e('0x24')](respondWithResult(_0x4d98fc,0xc9))[_0x4d9e('0x45')](handleError(_0x4d98fc,null));};exports[_0x4d9e('0x48')]=function(_0x5e5562,_0x162f2c){return db['AnalyticFieldReport']['bulkCreate'](_0x5e5562['body'],{'raw':![],'individualHooks':!![]})[_0x4d9e('0x24')](respondWithResult(_0x162f2c,0xc9))[_0x4d9e('0x45')](handleError(_0x162f2c,null));};exports[_0x4d9e('0x49')]=function(_0xa61d11,_0x57b3b1){if(_0xa61d11[_0x4d9e('0x47')]['id']){delete _0xa61d11['body']['id'];}return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0xa61d11['params']['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x57b3b1,null))['then'](saveUpdates(_0xa61d11[_0x4d9e('0x47')],null))[_0x4d9e('0x24')](respondWithResult(_0x57b3b1,null))[_0x4d9e('0x45')](handleError(_0x57b3b1,null));};exports[_0x4d9e('0x25')]=function(_0x2bfc02,_0x44fbc9){return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0x2bfc02[_0x4d9e('0x41')]['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x44fbc9,null))['then'](removeEntity(_0x44fbc9,null))[_0x4d9e('0x45')](handleError(_0x44fbc9,null));};exports['bulkDestroy']=function(_0x1865ab,_0x426e20){return db[_0x4d9e('0x2b')][_0x4d9e('0x25')]({'where':{'id':_0x1865ab[_0x4d9e('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x426e20,0xcc))[_0x4d9e('0x45')](handleError(_0x426e20,null));};exports[_0x4d9e('0x4a')]=function(_0x3e7675,_0x3a53a2,_0x5919e5){return db[_0x4d9e('0x4b')]['findOne']({'where':{'id':_0x3e7675[_0x4d9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a53a2,null))[_0x4d9e('0x24')](function(_0x20ecc1){if(_0x20ecc1){return db[_0x4d9e('0x4c')][_0x4d9e('0x4d')](function(_0x371644){return db['AnalyticFieldReport'][_0x4d9e('0x25')]({'where':{'CustomReportId':_0x3e7675[_0x4d9e('0x41')]['id']},'transaction':_0x371644})[_0x4d9e('0x24')](function(_0x27fb11){var _0xf6cc07=_[_0x4d9e('0x2a')](_0x3e7675[_0x4d9e('0x47')],function(_0x44b3df){delete _0x44b3df['id'];_0x44b3df[_0x4d9e('0x4e')]=_0x3e7675[_0x4d9e('0x41')]['id'];return _0x44b3df;});return db[_0x4d9e('0x2b')][_0x4d9e('0x48')](_0xf6cc07,{'transaction':_0x371644});});})[_0x4d9e('0x24')](function(){return db['AnalyticFieldReport'][_0x4d9e('0x3f')]({'where':{'CustomReportId':_0x3e7675['params']['id']}});});}})[_0x4d9e('0x24')](respondWithResult(_0x3a53a2,null))[_0x4d9e('0x45')](handleError(_0x3a53a2,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index a50d52a..1679b6f 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 _0xde49=['bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x2e0ae0,_0x3bba42){var _0x40d0b9=function(_0x32544a){while(--_0x32544a){_0x2e0ae0['push'](_0x2e0ae0['shift']());}};_0x40d0b9(++_0x3bba42);}(_0xde49,0xd7));var _0x9de4=function(_0x3cdd57,_0x279253){_0x3cdd57=_0x3cdd57-0x0;var _0x3f529d=_0xde49[_0x3cdd57];return _0x3f529d;};'use strict';var _=require(_0x9de4('0x0'));var util=require(_0x9de4('0x1'));var logger=require(_0x9de4('0x2'))(_0x9de4('0x3'));var moment=require(_0x9de4('0x4'));var BPromise=require(_0x9de4('0x5'));var rp=require(_0x9de4('0x6'));var fs=require('fs');var path=require(_0x9de4('0x7'));var rimraf=require(_0x9de4('0x8'));var config=require('../../config/environment');var attributes=require(_0x9de4('0x9'));module['exports']=function(_0x1a4690,_0x4517f0){return _0x1a4690['define']('AnalyticFieldReport',attributes,{'tableName':_0x9de4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73f9=['analytics_report_fields','lodash','util','api','bluebird','request-promise','path','rimraf','define','AnalyticFieldReport'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x73f9,0xf1));var _0x973f=function(_0x351579,_0x30565e){_0x351579=_0x351579-0x0;var _0x49f081=_0x73f9[_0x351579];return _0x49f081;};'use strict';var _=require(_0x973f('0x0'));var util=require(_0x973f('0x1'));var logger=require('../../config/logger')(_0x973f('0x2'));var moment=require('moment');var BPromise=require(_0x973f('0x3'));var rp=require(_0x973f('0x4'));var fs=require('fs');var path=require(_0x973f('0x5'));var rimraf=require(_0x973f('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x1bd2ac,_0x48e3b5){return _0x1bd2ac[_0x973f('0x7')](_0x973f('0x8'),attributes,{'tableName':_0x973f('0x9'),'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 59adcd4..ffba23d 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 _0x0adc=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x3a970e,_0x623d62){var _0x1b4f56=function(_0x9fc246){while(--_0x9fc246){_0x3a970e['push'](_0x3a970e['shift']());}};_0x1b4f56(++_0x623d62);}(_0x0adc,0x1e0));var _0xc0ad=function(_0x26b9c1,_0x16722e){_0x26b9c1=_0x26b9c1-0x0;var _0x46cb46=_0x0adc[_0x26b9c1];return _0x46cb46;};'use strict';var _=require(_0xc0ad('0x0'));var util=require(_0xc0ad('0x1'));var moment=require('moment');var BPromise=require(_0xc0ad('0x2'));var rs=require(_0xc0ad('0x3'));var fs=require('fs');var Redis=require(_0xc0ad('0x4'));var db=require(_0xc0ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0ad('0x6'))('rpc');var config=require(_0xc0ad('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0ad('0x8')][_0xc0ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x296a0e,_0x1760d7,_0x21b7d1){return new BPromise(function(_0x1d3e41,_0x5ec913){return client[_0xc0ad('0xa')](_0x296a0e,_0x21b7d1)[_0xc0ad('0xb')](function(_0x20e123){logger[_0xc0ad('0xc')](_0xc0ad('0xd'),_0x1760d7,_0xc0ad('0xe'));logger[_0xc0ad('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1760d7,'request\x20sent',JSON[_0xc0ad('0x10')](_0x20e123));if(_0x20e123[_0xc0ad('0x11')]){if(_0x20e123[_0xc0ad('0x11')][_0xc0ad('0x12')]===0x1f4){logger[_0xc0ad('0x11')](_0xc0ad('0xd'),_0x1760d7,_0x20e123[_0xc0ad('0x11')]['message']);return _0x5ec913(_0x20e123['error'][_0xc0ad('0x13')]);}logger[_0xc0ad('0x11')](_0xc0ad('0xd'),_0x1760d7,_0x20e123['error'][_0xc0ad('0x13')]);return _0x1d3e41(_0x20e123['error'][_0xc0ad('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1760d7,_0xc0ad('0xe'));_0x1d3e41(_0x20e123[_0xc0ad('0x14')][_0xc0ad('0x13')]);}})['catch'](function(_0x24d15b){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1760d7,_0x24d15b);_0x5ec913(_0x24d15b);});});} \ No newline at end of file +var _0x79f2=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17d3b9,_0x168ca1){var _0x2697e4=function(_0x5ff832){while(--_0x5ff832){_0x17d3b9['push'](_0x17d3b9['shift']());}};_0x2697e4(++_0x168ca1);}(_0x79f2,0xfb));var _0x279f=function(_0x317c7a,_0x31641c){_0x317c7a=_0x317c7a-0x0;var _0x49d02f=_0x79f2[_0x317c7a];return _0x49d02f;};'use strict';var _=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var moment=require('moment');var BPromise=require(_0x279f('0x2'));var rs=require(_0x279f('0x3'));var fs=require('fs');var Redis=require(_0x279f('0x4'));var db=require(_0x279f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x279f('0x6'));var config=require(_0x279f('0x7'));var jayson=require(_0x279f('0x8'));var client=jayson[_0x279f('0x9')][_0x279f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456d81,_0x253a59,_0x3683d6){return new BPromise(function(_0x2d9ef0,_0x180253){return client[_0x279f('0xb')](_0x456d81,_0x3683d6)[_0x279f('0xc')](function(_0x281967){logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));logger['debug'](_0x279f('0x10'),_0x253a59,_0x279f('0xf'),JSON['stringify'](_0x281967));if(_0x281967[_0x279f('0x11')]){if(_0x281967[_0x279f('0x11')][_0x279f('0x12')]===0x1f4){logger[_0x279f('0x11')](_0x279f('0xe'),_0x253a59,_0x281967['error']['message']);return _0x180253(_0x281967[_0x279f('0x11')][_0x279f('0x13')]);}logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x281967[_0x279f('0x11')][_0x279f('0x13')]);return _0x2d9ef0(_0x281967['error'][_0x279f('0x13')]);}else{logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));_0x2d9ef0(_0x281967[_0x279f('0x14')][_0x279f('0x13')]);}})[_0x279f('0x15')](function(_0x57175b){logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x57175b);_0x180253(_0x57175b);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c5f41c9..eb73fad 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(_0x22a8ae,_0x451845){var _0x3cd8b8=function(_0x3c756c){while(--_0x3c756c){_0x22a8ae['push'](_0x22a8ae['shift']());}};_0x3cd8b8(++_0x451845);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x491784,_0x4527e8){var _0x2d6ecb=function(_0x2881e3){while(--_0x2881e3){_0x491784['push'](_0x491784['shift']());}};_0x2d6ecb(++_0x4527e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 140844a..0687b09 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 _0x81d5=['STRING','TEXT','sequelize','exports','name'];(function(_0x5b374e,_0x244e02){var _0x5da9a4=function(_0x39a98b){while(--_0x39a98b){_0x5b374e['push'](_0x5b374e['shift']());}};_0x5da9a4(++_0x244e02);}(_0x81d5,0x1ab));var _0x581d=function(_0x3229f4,_0x151ceb){_0x3229f4=_0x3229f4-0x0;var _0x5ad6fe=_0x81d5[_0x3229f4];return _0x5ad6fe;};'use strict';var Sequelize=require(_0x581d('0x0'));module[_0x581d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x581d('0x2')},'table':{'type':Sequelize[_0x581d('0x3')]},'metric':{'type':Sequelize[_0x581d('0x4')]},'description':{'type':Sequelize[_0x581d('0x3')]}}; \ No newline at end of file +var _0xc901=['STRING','sequelize','TEXT'];(function(_0x318995,_0x3c241d){var _0x512a01=function(_0x47964f){while(--_0x47964f){_0x318995['push'](_0x318995['shift']());}};_0x512a01(++_0x3c241d);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c90('0x1')]},'description':{'type':Sequelize[_0x1c90('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7ae2336..12ca2e0 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x94ff15,_0x1450f7){var _0x1bd715=function(_0x36400d){while(--_0x36400d){_0x94ff15['push'](_0x94ff15['shift']());}};_0x1bd715(++_0x1450f7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x24ca[_0x2d2ca2];return _0x48489d;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x20882a,_0xaf0f58){var _0x555dc8=function(_0x458a71){while(--_0x458a71){_0x20882a['push'](_0x20882a['shift']());}};_0x555dc8(++_0xaf0f58);}(_0xe14b,0x93));var _0xbe14=function(_0x5eedd2,_0x2da0a5){_0x5eedd2=_0x5eedd2-0x0;var _0x1719e1=_0xe14b[_0x5eedd2];return _0x1719e1;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 958dbc4..bf1eee9 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 _0xf95f=['api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x231fed,_0x5c5926){var _0x406388=function(_0x1e1a79){while(--_0x1e1a79){_0x231fed['push'](_0x231fed['shift']());}};_0x406388(++_0x5c5926);}(_0xf95f,0x142));var _0xff95=function(_0x48051b,_0x368d0b){_0x48051b=_0x48051b-0x0;var _0x5669e1=_0xf95f[_0x48051b];return _0x5669e1;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var logger=require(_0xff95('0x2'))(_0xff95('0x3'));var moment=require(_0xff95('0x4'));var BPromise=require(_0xff95('0x5'));var rp=require(_0xff95('0x6'));var fs=require('fs');var path=require(_0xff95('0x7'));var rimraf=require(_0xff95('0x8'));var config=require('../../config/environment');var attributes=require(_0xff95('0x9'));module['exports']=function(_0x3f72b4,_0x4fb1ed){return _0x3f72b4[_0xff95('0xa')](_0xff95('0xb'),attributes,{'tableName':_0xff95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c1a=['rimraf','./analyticMetric.attributes','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x7c1a,0x159));var _0xa7c1=function(_0x11af43,_0x26badb){_0x11af43=_0x11af43-0x0;var _0xc26d1=_0x7c1a[_0x11af43];return _0xc26d1;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var logger=require(_0xa7c1('0x2'))(_0xa7c1('0x3'));var moment=require(_0xa7c1('0x4'));var BPromise=require(_0xa7c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7c1('0x6'));var rimraf=require(_0xa7c1('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7c1('0x8'));module['exports']=function(_0x3c8e8d,_0xa10122){return _0x3c8e8d[_0xa7c1('0x9')](_0xa7c1('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index bebb613..25ccc89 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 _0x7f23=['jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3ec817,_0x34d942){var _0x4ac5a7=function(_0x10cc47){while(--_0x10cc47){_0x3ec817['push'](_0x3ec817['shift']());}};_0x4ac5a7(++_0x34d942);}(_0x7f23,0xd7));var _0x37f2=function(_0x3c99a7,_0x5b5f52){_0x3c99a7=_0x3c99a7-0x0;var _0x3955fc=_0x7f23[_0x3c99a7];return _0x3955fc;};'use strict';var _=require('lodash');var util=require(_0x37f2('0x0'));var moment=require(_0x37f2('0x1'));var BPromise=require(_0x37f2('0x2'));var rs=require(_0x37f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x37f2('0x5'));var client=jayson[_0x37f2('0x6')][_0x37f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ce6c6,_0x3d9939,_0x3a52e8){return new BPromise(function(_0x5a1cd9,_0x19fbce){return client[_0x37f2('0x8')](_0x1ce6c6,_0x3a52e8)[_0x37f2('0x9')](function(_0x5adfe4){logger[_0x37f2('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3d9939,'request\x20sent');logger[_0x37f2('0xb')](_0x37f2('0xc'),_0x3d9939,_0x37f2('0xd'),JSON['stringify'](_0x5adfe4));if(_0x5adfe4[_0x37f2('0xe')]){if(_0x5adfe4[_0x37f2('0xe')][_0x37f2('0xf')]===0x1f4){logger[_0x37f2('0xe')](_0x37f2('0x10'),_0x3d9939,_0x5adfe4['error'][_0x37f2('0x11')]);return _0x19fbce(_0x5adfe4[_0x37f2('0xe')][_0x37f2('0x11')]);}logger[_0x37f2('0xe')](_0x37f2('0x10'),_0x3d9939,_0x5adfe4[_0x37f2('0xe')][_0x37f2('0x11')]);return _0x5a1cd9(_0x5adfe4['error'][_0x37f2('0x11')]);}else{logger[_0x37f2('0xa')](_0x37f2('0x10'),_0x3d9939,_0x37f2('0xd'));_0x5a1cd9(_0x5adfe4[_0x37f2('0x12')][_0x37f2('0x11')]);}})[_0x37f2('0x13')](function(_0x4d139c){logger[_0x37f2('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x3d9939,_0x4d139c);_0x19fbce(_0x4d139c);});});} \ No newline at end of file +var _0xfbf5=['../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57bafc,_0x5b6f89){var _0x3e1d7c=function(_0x210b09){while(--_0x210b09){_0x57bafc['push'](_0x57bafc['shift']());}};_0x3e1d7c(++_0x5b6f89);}(_0xfbf5,0xe7));var _0x5fbf=function(_0x293045,_0x27074d){_0x293045=_0x293045-0x0;var _0x3e2788=_0xfbf5[_0x293045];return _0x3e2788;};'use strict';var _=require(_0x5fbf('0x0'));var util=require(_0x5fbf('0x1'));var moment=require(_0x5fbf('0x2'));var BPromise=require(_0x5fbf('0x3'));var rs=require(_0x5fbf('0x4'));var fs=require('fs');var Redis=require(_0x5fbf('0x5'));var db=require(_0x5fbf('0x6'))['db'];var utils=require(_0x5fbf('0x7'));var logger=require(_0x5fbf('0x8'))('rpc');var config=require(_0x5fbf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fbf('0xa')][_0x5fbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387772,_0x520095,_0x1efc61){return new BPromise(function(_0x14acef,_0xc06237){return client[_0x5fbf('0xc')](_0x387772,_0x1efc61)[_0x5fbf('0xd')](function(_0x2fadb6){logger['info'](_0x5fbf('0xe'),_0x520095,'request\x20sent');logger[_0x5fbf('0xf')](_0x5fbf('0x10'),_0x520095,_0x5fbf('0x11'),JSON[_0x5fbf('0x12')](_0x2fadb6));if(_0x2fadb6[_0x5fbf('0x13')]){if(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x14')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6[_0x5fbf('0x13')]['message']);return _0xc06237(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}logger[_0x5fbf('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6['error'][_0x5fbf('0x15')]);return _0x14acef(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}else{logger[_0x5fbf('0x16')](_0x5fbf('0xe'),_0x520095,'request\x20sent');_0x14acef(_0x2fadb6['result'][_0x5fbf('0x15')]);}})[_0x5fbf('0x17')](function(_0x24af29){logger[_0x5fbf('0x13')](_0x5fbf('0xe'),_0x520095,_0x24af29);_0xc06237(_0x24af29);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8bb6fcc..32d4fc7 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 _0x55d2=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x55d2,0x9f));var _0x255d=function(_0x6fd8ad,_0x597818){_0x6fd8ad=_0x6fd8ad-0x0;var _0x257d21=_0x55d2[_0x6fd8ad];return _0x257d21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x255d('0x0'));var timeout=require(_0x255d('0x1'));var express=require(_0x255d('0x2'));var router=express[_0x255d('0x3')]();var fs_extra=require(_0x255d('0x4'));var auth=require(_0x255d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x255d('0x6'));var controller=require(_0x255d('0x7'));router[_0x255d('0x8')]('/',auth[_0x255d('0x9')](),controller['index']);router['get'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xb')]);router[_0x255d('0xc')]('/',auth[_0x255d('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x255d('0xd')]);router['delete'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xe')]);module['exports']=router; \ No newline at end of file +var _0x51f2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51f2,0xeb));var _0x251f=function(_0x3bd53a,_0x134fbb){_0x3bd53a=_0x3bd53a-0x0;var _0x363152=_0x51f2[_0x3bd53a];return _0x363152;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require(_0x251f('0x4'));var router=express[_0x251f('0x5')]();var fs_extra=require(_0x251f('0x6'));var auth=require(_0x251f('0x7'));var interaction=require(_0x251f('0x8'));var config=require('../../config/environment');var controller=require(_0x251f('0x9'));router[_0x251f('0xa')]('/',auth[_0x251f('0xb')](),controller[_0x251f('0xc')]);router[_0x251f('0xa')]('/:id',auth[_0x251f('0xb')](),controller[_0x251f('0xd')]);router[_0x251f('0xe')]('/',auth[_0x251f('0xb')](),controller['create']);router[_0x251f('0xf')](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x11')]);router['delete'](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x12')]);module[_0x251f('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index af4f600..07ae6eb 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 _0x9c21=['sequelize','exports','TEXT'];(function(_0xa29cb0,_0x3a808e){var _0x1df627=function(_0x136abe){while(--_0x136abe){_0xa29cb0['push'](_0xa29cb0['shift']());}};_0x1df627(++_0x3a808e);}(_0x9c21,0xe1));var _0x19c2=function(_0x36f157,_0x31d0a9){_0x36f157=_0x36f157-0x0;var _0x4ae113=_0x9c21[_0x36f157];return _0x4ae113;};'use strict';var Sequelize=require(_0x19c2('0x0'));module[_0x19c2('0x1')]={'tree':{'type':Sequelize[_0x19c2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb7a9=['sequelize','exports','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb7a9,0x9c));var _0x9b7a=function(_0x22c14b,_0x1bfd98){_0x22c14b=_0x22c14b-0x0;var _0x198e98=_0xb7a9[_0x22c14b];return _0x198e98;};'use strict';var Sequelize=require(_0x9b7a('0x0'));module[_0x9b7a('0x1')]={'tree':{'type':Sequelize[_0x9b7a('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 3c65224..2789122 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 _0xffa8=['AnalyticTreeReport','rawAttributes','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','filters','intersection','include','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xffa8,0x104));var _0x8ffa=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xffa8[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x8ffa('0x0'));var rimraf=require(_0x8ffa('0x1'));var zipdir=require(_0x8ffa('0x2'));var jsonpatch=require(_0x8ffa('0x3'));var rp=require(_0x8ffa('0x4'));var moment=require('moment');var BPromise=require(_0x8ffa('0x5'));var Mustache=require(_0x8ffa('0x6'));var util=require(_0x8ffa('0x7'));var path=require(_0x8ffa('0x8'));var sox=require(_0x8ffa('0x9'));var csv=require(_0x8ffa('0xa'));var ejs=require(_0x8ffa('0xb'));var fs=require('fs');var fs_extra=require(_0x8ffa('0xc'));var _=require(_0x8ffa('0xd'));var squel=require(_0x8ffa('0xe'));var crypto=require(_0x8ffa('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8ffa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8ffa('0x11'));var Papa=require(_0x8ffa('0x12'));var Redis=require(_0x8ffa('0x13'));var authService=require(_0x8ffa('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8ffa('0x15'));var hardwareService=require(_0x8ffa('0x16'));var logger=require('../../config/logger')(_0x8ffa('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ffa('0x18'))['db'];function respondWithStatusCode(_0x479ab3,_0x47b8ec){_0x47b8ec=_0x47b8ec||0xcc;return function(_0x4a784f){if(_0x4a784f){return _0x479ab3['sendStatus'](_0x47b8ec);}return _0x479ab3['status'](_0x47b8ec)[_0x8ffa('0x19')]();};}function respondWithResult(_0x3815ef,_0x5c71c0){_0x5c71c0=_0x5c71c0||0xc8;return function(_0x21e449){if(_0x21e449){return _0x3815ef[_0x8ffa('0x1a')](_0x5c71c0)[_0x8ffa('0x1b')](_0x21e449);}};}function respondWithFilteredResult(_0x31b36c,_0x5286c0){return function(_0xcfcbfc){if(_0xcfcbfc){var _0x41d7fd=typeof _0x5286c0[_0x8ffa('0x1c')]==='undefined'&&typeof _0x5286c0[_0x8ffa('0x1d')]==='undefined';var _0x390e3a=_0xcfcbfc[_0x8ffa('0x1e')];var _0x5ce87f=_0x41d7fd?0x0:_0x5286c0[_0x8ffa('0x1c')];var _0x5492f6=_0x41d7fd?_0xcfcbfc[_0x8ffa('0x1e')]:_0x5286c0[_0x8ffa('0x1c')]+_0x5286c0['limit'];var _0xd4f2cc;if(_0x5492f6>=_0x390e3a){_0x5492f6=_0x390e3a;_0xd4f2cc=0xc8;}else{_0xd4f2cc=0xce;}_0x31b36c[_0x8ffa('0x1a')](_0xd4f2cc);return _0x31b36c[_0x8ffa('0x1f')](_0x8ffa('0x20'),_0x5ce87f+'-'+_0x5492f6+'/'+_0x390e3a)[_0x8ffa('0x1b')](_0xcfcbfc);}return null;};}function patchUpdates(_0x1f997d){return function(_0xa25fc3){try{jsonpatch[_0x8ffa('0x21')](_0xa25fc3,_0x1f997d,!![]);}catch(_0x24a385){return BPromise[_0x8ffa('0x22')](_0x24a385);}return _0xa25fc3[_0x8ffa('0x23')]();};}function saveUpdates(_0x103ffa,_0x463bdc){return function(_0x260929){if(_0x260929){return _0x260929[_0x8ffa('0x24')](_0x103ffa)[_0x8ffa('0x25')](function(_0x2de3fe){return _0x2de3fe;});}return null;};}function removeEntity(_0xa04ced,_0x5d9e6d){return function(_0x208a83){if(_0x208a83){return _0x208a83['destroy']()[_0x8ffa('0x25')](function(){_0xa04ced[_0x8ffa('0x1a')](0xcc)[_0x8ffa('0x19')]();});}};}function handleEntityNotFound(_0x33ff0c,_0x54d2fa){return function(_0x38694f){if(!_0x38694f){_0x33ff0c[_0x8ffa('0x26')](0x194);}return _0x38694f;};}function handleError(_0x29ca4d,_0xadcbb1){_0xadcbb1=_0xadcbb1||0x1f4;return function(_0x478878){logger[_0x8ffa('0x27')](_0x478878[_0x8ffa('0x28')]);if(_0x478878[_0x8ffa('0x29')]){delete _0x478878['name'];}_0x29ca4d[_0x8ffa('0x1a')](_0xadcbb1)['send'](_0x478878);};}exports[_0x8ffa('0x2a')]=function(_0x24fa03,_0x12fcf){var _0x113580={},_0xcd073e={},_0x183ea8={'count':0x0,'rows':[]};var _0x2e1ce3=_[_0x8ffa('0x2b')](db[_0x8ffa('0x2c')][_0x8ffa('0x2d')],function(_0x33cb45){return{'name':_0x33cb45['fieldName'],'type':_0x33cb45['type'][_0x8ffa('0x2e')]};});_0xcd073e[_0x8ffa('0x2f')]=_['map'](_0x2e1ce3,'name');_0xcd073e[_0x8ffa('0x30')]=_[_0x8ffa('0x31')](_0x24fa03[_0x8ffa('0x30')]);_0xcd073e['filters']=_['intersection'](_0xcd073e[_0x8ffa('0x2f')],_0xcd073e[_0x8ffa('0x30')]);_0x113580[_0x8ffa('0x32')]=_['intersection'](_0xcd073e['model'],qs[_0x8ffa('0x33')](_0x24fa03['query'][_0x8ffa('0x33')]));_0x113580[_0x8ffa('0x32')]=_0x113580['attributes'][_0x8ffa('0x34')]?_0x113580[_0x8ffa('0x32')]:_0xcd073e['model'];if(!_0x24fa03[_0x8ffa('0x30')][_0x8ffa('0x35')]('nolimit')){_0x113580[_0x8ffa('0x1d')]=qs[_0x8ffa('0x1d')](_0x24fa03[_0x8ffa('0x30')]['limit']);_0x113580['offset']=qs['offset'](_0x24fa03[_0x8ffa('0x30')]['offset']);}_0x113580[_0x8ffa('0x36')]=qs[_0x8ffa('0x37')](_0x24fa03[_0x8ffa('0x30')][_0x8ffa('0x37')]);_0x113580[_0x8ffa('0x38')]=qs['filters'](_[_0x8ffa('0x39')](_0x24fa03['query'],_0xcd073e['filters']),_0x2e1ce3);if(_0x24fa03[_0x8ffa('0x30')][_0x8ffa('0x3a')]){_0x113580[_0x8ffa('0x38')]=_[_0x8ffa('0x3b')](_0x113580[_0x8ffa('0x38')],{'$or':_[_0x8ffa('0x2b')](_0x2e1ce3,function(_0x28ac48){if(_0x28ac48[_0x8ffa('0x3c')]!==_0x8ffa('0x3d')){var _0x2df914={};_0x2df914[_0x28ac48['name']]={'$like':'%'+_0x24fa03[_0x8ffa('0x30')][_0x8ffa('0x3a')]+'%'};return _0x2df914;}})});}_0x113580=_['merge']({},_0x113580,_0x24fa03[_0x8ffa('0x3e')]);var _0xbb656c={'where':_0x113580[_0x8ffa('0x38')]};return db[_0x8ffa('0x2c')][_0x8ffa('0x1e')](_0xbb656c)[_0x8ffa('0x25')](function(_0x5f3488){_0x183ea8[_0x8ffa('0x1e')]=_0x5f3488;if(_0x24fa03[_0x8ffa('0x30')][_0x8ffa('0x3f')]){_0x113580['include']=[{'all':!![]}];}return db[_0x8ffa('0x2c')][_0x8ffa('0x40')](_0x113580);})['then'](function(_0x32bfca){_0x183ea8[_0x8ffa('0x41')]=_0x32bfca;return _0x183ea8;})['then'](respondWithFilteredResult(_0x12fcf,_0x113580))[_0x8ffa('0x42')](handleError(_0x12fcf,null));};exports[_0x8ffa('0x43')]=function(_0x308c51,_0x10baa0){var _0x187643={'raw':!![],'where':{'id':_0x308c51[_0x8ffa('0x44')]['id']}},_0x38b61e={};_0x38b61e['model']=_[_0x8ffa('0x31')](db['AnalyticTreeReport'][_0x8ffa('0x2d')]);_0x38b61e['query']=_[_0x8ffa('0x31')](_0x308c51[_0x8ffa('0x30')]);_0x38b61e[_0x8ffa('0x45')]=_[_0x8ffa('0x46')](_0x38b61e['model'],_0x38b61e[_0x8ffa('0x30')]);_0x187643[_0x8ffa('0x32')]=_[_0x8ffa('0x46')](_0x38b61e[_0x8ffa('0x2f')],qs[_0x8ffa('0x33')](_0x308c51[_0x8ffa('0x30')]['fields']));_0x187643[_0x8ffa('0x32')]=_0x187643['attributes'][_0x8ffa('0x34')]?_0x187643[_0x8ffa('0x32')]:_0x38b61e[_0x8ffa('0x2f')];if(_0x308c51['query']['includeAll']){_0x187643[_0x8ffa('0x47')]=[{'all':!![]}];}_0x187643=_['merge']({},_0x187643,_0x308c51[_0x8ffa('0x3e')]);return db[_0x8ffa('0x2c')]['find'](_0x187643)[_0x8ffa('0x25')](handleEntityNotFound(_0x10baa0,null))[_0x8ffa('0x25')](respondWithResult(_0x10baa0,null))[_0x8ffa('0x42')](handleError(_0x10baa0,null));};exports['create']=function(_0x3cc250,_0x3a516d){return db[_0x8ffa('0x2c')][_0x8ffa('0x48')](_0x3cc250[_0x8ffa('0x49')],{})[_0x8ffa('0x25')](respondWithResult(_0x3a516d,0xc9))[_0x8ffa('0x42')](handleError(_0x3a516d,null));};exports[_0x8ffa('0x24')]=function(_0x300fc5,_0x334f37){if(_0x300fc5[_0x8ffa('0x49')]['id']){delete _0x300fc5['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x300fc5[_0x8ffa('0x44')]['id']}})[_0x8ffa('0x25')](handleEntityNotFound(_0x334f37,null))['then'](saveUpdates(_0x300fc5['body'],null))[_0x8ffa('0x25')](respondWithResult(_0x334f37,null))[_0x8ffa('0x42')](handleError(_0x334f37,null));};exports[_0x8ffa('0x4a')]=function(_0x292c6a,_0x55c298){return db[_0x8ffa('0x2c')][_0x8ffa('0x4b')]({'where':{'id':_0x292c6a[_0x8ffa('0x44')]['id']}})['then'](handleEntityNotFound(_0x55c298,null))[_0x8ffa('0x25')](removeEntity(_0x55c298,null))[_0x8ffa('0x42')](handleError(_0x55c298,null));}; \ No newline at end of file +var _0x1100=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','rows','catch','params','options','find','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x20b082,_0x1d2498){var _0x3ce60f=function(_0x93c5df){while(--_0x93c5df){_0x20b082['push'](_0x20b082['shift']());}};_0x3ce60f(++_0x1d2498);}(_0x1100,0x1c0));var _0x0110=function(_0x526a80,_0x25fd97){_0x526a80=_0x526a80-0x0;var _0x4d5e2a=_0x1100[_0x526a80];return _0x4d5e2a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0110('0x0'));var jsonpatch=require(_0x0110('0x1'));var rp=require(_0x0110('0x2'));var moment=require(_0x0110('0x3'));var BPromise=require(_0x0110('0x4'));var Mustache=require(_0x0110('0x5'));var util=require(_0x0110('0x6'));var path=require(_0x0110('0x7'));var sox=require(_0x0110('0x8'));var csv=require(_0x0110('0x9'));var ejs=require(_0x0110('0xa'));var fs=require('fs');var fs_extra=require(_0x0110('0xb'));var _=require(_0x0110('0xc'));var squel=require(_0x0110('0xd'));var crypto=require(_0x0110('0xe'));var jsforce=require(_0x0110('0xf'));var deskjs=require(_0x0110('0x10'));var toCsv=require(_0x0110('0x9'));var querystring=require(_0x0110('0x11'));var Papa=require(_0x0110('0x12'));var Redis=require(_0x0110('0x13'));var authService=require(_0x0110('0x14'));var qs=require(_0x0110('0x15'));var as=require(_0x0110('0x16'));var hardwareService=require(_0x0110('0x17'));var logger=require(_0x0110('0x18'))(_0x0110('0x19'));var utils=require(_0x0110('0x1a'));var config=require(_0x0110('0x1b'));var licenseUtil=require(_0x0110('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1240c2,_0x45609f){_0x45609f=_0x45609f||0xcc;return function(_0x3e534b){if(_0x3e534b){return _0x1240c2[_0x0110('0x1d')](_0x45609f);}return _0x1240c2[_0x0110('0x1e')](_0x45609f)[_0x0110('0x1f')]();};}function respondWithResult(_0x175e4f,_0x5f5941){_0x5f5941=_0x5f5941||0xc8;return function(_0x231c6f){if(_0x231c6f){return _0x175e4f['status'](_0x5f5941)[_0x0110('0x20')](_0x231c6f);}};}function respondWithFilteredResult(_0x290a12,_0x17e7b3){return function(_0x2e5eaf){if(_0x2e5eaf){var _0x218a19=typeof _0x17e7b3[_0x0110('0x21')]===_0x0110('0x22')&&typeof _0x17e7b3[_0x0110('0x23')]==='undefined';var _0x97075d=_0x2e5eaf['count'];var _0x2bb1de=_0x218a19?0x0:_0x17e7b3[_0x0110('0x21')];var _0x39e034=_0x218a19?_0x2e5eaf[_0x0110('0x24')]:_0x17e7b3['offset']+_0x17e7b3['limit'];var _0x2e5f96;if(_0x39e034>=_0x97075d){_0x39e034=_0x97075d;_0x2e5f96=0xc8;}else{_0x2e5f96=0xce;}_0x290a12['status'](_0x2e5f96);return _0x290a12[_0x0110('0x25')](_0x0110('0x26'),_0x2bb1de+'-'+_0x39e034+'/'+_0x97075d)[_0x0110('0x20')](_0x2e5eaf);}return null;};}function patchUpdates(_0x5390fa){return function(_0x55d425){try{jsonpatch['apply'](_0x55d425,_0x5390fa,!![]);}catch(_0x599427){return BPromise[_0x0110('0x27')](_0x599427);}return _0x55d425['save']();};}function saveUpdates(_0x3af265,_0x3f285e){return function(_0x27677){if(_0x27677){return _0x27677[_0x0110('0x28')](_0x3af265)[_0x0110('0x29')](function(_0x290c46){return _0x290c46;});}return null;};}function removeEntity(_0x4b8609,_0x54cd91){return function(_0x4f6cfa){if(_0x4f6cfa){return _0x4f6cfa[_0x0110('0x2a')]()['then'](function(){_0x4b8609[_0x0110('0x1e')](0xcc)[_0x0110('0x1f')]();});}};}function handleEntityNotFound(_0x3cc04a,_0x4d0a1d){return function(_0x2a7031){if(!_0x2a7031){_0x3cc04a[_0x0110('0x1d')](0x194);}return _0x2a7031;};}function handleError(_0x1fa22c,_0x55c47f){_0x55c47f=_0x55c47f||0x1f4;return function(_0x4f1f73){logger[_0x0110('0x2b')](_0x4f1f73[_0x0110('0x2c')]);if(_0x4f1f73[_0x0110('0x2d')]){delete _0x4f1f73[_0x0110('0x2d')];}_0x1fa22c[_0x0110('0x1e')](_0x55c47f)[_0x0110('0x2e')](_0x4f1f73);};}exports['index']=function(_0x56b918,_0x10bd8a){var _0x52e95a={},_0x3f1b67={},_0x64a9f3={'count':0x0,'rows':[]};var _0x367391=_[_0x0110('0x2f')](db['AnalyticTreeReport'][_0x0110('0x30')],function(_0x3f1b0b){return{'name':_0x3f1b0b[_0x0110('0x31')],'type':_0x3f1b0b[_0x0110('0x32')][_0x0110('0x33')]};});_0x3f1b67['model']=_[_0x0110('0x2f')](_0x367391,_0x0110('0x2d'));_0x3f1b67[_0x0110('0x34')]=_[_0x0110('0x35')](_0x56b918[_0x0110('0x34')]);_0x3f1b67[_0x0110('0x36')]=_[_0x0110('0x37')](_0x3f1b67['model'],_0x3f1b67[_0x0110('0x34')]);_0x52e95a[_0x0110('0x38')]=_['intersection'](_0x3f1b67[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x56b918[_0x0110('0x34')][_0x0110('0x3a')]));_0x52e95a[_0x0110('0x38')]=_0x52e95a[_0x0110('0x38')][_0x0110('0x3b')]?_0x52e95a[_0x0110('0x38')]:_0x3f1b67[_0x0110('0x39')];if(!_0x56b918[_0x0110('0x34')][_0x0110('0x3c')](_0x0110('0x3d'))){_0x52e95a[_0x0110('0x23')]=qs[_0x0110('0x23')](_0x56b918[_0x0110('0x34')][_0x0110('0x23')]);_0x52e95a[_0x0110('0x21')]=qs['offset'](_0x56b918[_0x0110('0x34')][_0x0110('0x21')]);}_0x52e95a[_0x0110('0x3e')]=qs[_0x0110('0x3f')](_0x56b918[_0x0110('0x34')]['sort']);_0x52e95a['where']=qs[_0x0110('0x36')](_[_0x0110('0x40')](_0x56b918['query'],_0x3f1b67[_0x0110('0x36')]),_0x367391);if(_0x56b918[_0x0110('0x34')][_0x0110('0x41')]){_0x52e95a[_0x0110('0x42')]=_[_0x0110('0x43')](_0x52e95a[_0x0110('0x42')],{'$or':_[_0x0110('0x2f')](_0x367391,function(_0x59c7f6){if(_0x59c7f6[_0x0110('0x32')]!==_0x0110('0x44')){var _0x1c1f9c={};_0x1c1f9c[_0x59c7f6[_0x0110('0x2d')]]={'$like':'%'+_0x56b918['query'][_0x0110('0x41')]+'%'};return _0x1c1f9c;}})});}_0x52e95a=_[_0x0110('0x43')]({},_0x52e95a,_0x56b918['options']);var _0x316497={'where':_0x52e95a['where']};return db['AnalyticTreeReport'][_0x0110('0x24')](_0x316497)[_0x0110('0x29')](function(_0x428d2f){_0x64a9f3[_0x0110('0x24')]=_0x428d2f;if(_0x56b918['query'][_0x0110('0x45')]){_0x52e95a[_0x0110('0x46')]=[{'all':!![]}];}return db[_0x0110('0x47')]['findAll'](_0x52e95a);})[_0x0110('0x29')](function(_0x4a9289){_0x64a9f3[_0x0110('0x48')]=_0x4a9289;return _0x64a9f3;})[_0x0110('0x29')](respondWithFilteredResult(_0x10bd8a,_0x52e95a))[_0x0110('0x49')](handleError(_0x10bd8a,null));};exports['show']=function(_0x532b95,_0x287435){var _0x5f5758={'raw':!![],'where':{'id':_0x532b95[_0x0110('0x4a')]['id']}},_0xf47389={};_0xf47389['model']=_[_0x0110('0x35')](db[_0x0110('0x47')][_0x0110('0x30')]);_0xf47389[_0x0110('0x34')]=_['keys'](_0x532b95['query']);_0xf47389[_0x0110('0x36')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],_0xf47389[_0x0110('0x34')]);_0x5f5758[_0x0110('0x38')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x532b95[_0x0110('0x34')][_0x0110('0x3a')]));_0x5f5758[_0x0110('0x38')]=_0x5f5758['attributes'][_0x0110('0x3b')]?_0x5f5758[_0x0110('0x38')]:_0xf47389[_0x0110('0x39')];if(_0x532b95[_0x0110('0x34')]['includeAll']){_0x5f5758[_0x0110('0x46')]=[{'all':!![]}];}_0x5f5758=_[_0x0110('0x43')]({},_0x5f5758,_0x532b95[_0x0110('0x4b')]);return db[_0x0110('0x47')][_0x0110('0x4c')](_0x5f5758)[_0x0110('0x29')](handleEntityNotFound(_0x287435,null))[_0x0110('0x29')](respondWithResult(_0x287435,null))[_0x0110('0x49')](handleError(_0x287435,null));};exports['create']=function(_0x2c33b5,_0x14836c){return db[_0x0110('0x47')]['create'](_0x2c33b5[_0x0110('0x4d')],{})[_0x0110('0x29')](respondWithResult(_0x14836c,0xc9))[_0x0110('0x49')](handleError(_0x14836c,null));};exports[_0x0110('0x28')]=function(_0x3bdda7,_0x42fa4d){if(_0x3bdda7[_0x0110('0x4d')]['id']){delete _0x3bdda7['body']['id'];}return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x3bdda7[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x42fa4d,null))[_0x0110('0x29')](saveUpdates(_0x3bdda7[_0x0110('0x4d')],null))[_0x0110('0x29')](respondWithResult(_0x42fa4d,null))[_0x0110('0x49')](handleError(_0x42fa4d,null));};exports[_0x0110('0x2a')]=function(_0x2be901,_0x8364ec){return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x2be901[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x8364ec,null))[_0x0110('0x29')](removeEntity(_0x8364ec,null))[_0x0110('0x49')](handleError(_0x8364ec,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 63794f7..d073c75 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 _0xf701=['analytics_report_trees','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x3d48f2,_0x5bef7a){var _0x5efe48=function(_0x20de3f){while(--_0x20de3f){_0x3d48f2['push'](_0x3d48f2['shift']());}};_0x5efe48(++_0x5bef7a);}(_0xf701,0x109));var _0x1f70=function(_0x215acf,_0x45670b){_0x215acf=_0x215acf-0x0;var _0x1f756d=_0xf701[_0x215acf];return _0x1f756d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f70('0x0'))(_0x1f70('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f70('0x2'));var fs=require('fs');var path=require(_0x1f70('0x3'));var rimraf=require(_0x1f70('0x4'));var config=require(_0x1f70('0x5'));var attributes=require(_0x1f70('0x6'));module[_0x1f70('0x7')]=function(_0x348564,_0x39be16){return _0x348564[_0x1f70('0x8')](_0x1f70('0x9'),attributes,{'tableName':_0x1f70('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x294a=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x294a,0x1d5));var _0xa294=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x294a[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0xa294('0x0'));var util=require('util');var logger=require(_0xa294('0x1'))(_0xa294('0x2'));var moment=require(_0xa294('0x3'));var BPromise=require('bluebird');var rp=require(_0xa294('0x4'));var fs=require('fs');var path=require(_0xa294('0x5'));var rimraf=require(_0xa294('0x6'));var config=require(_0xa294('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa294('0x8')]=function(_0x518a5f,_0x2dbecb){return _0x518a5f[_0xa294('0x9')](_0xa294('0xa'),attributes,{'tableName':'analytics_report_trees','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 27cf85b..22bbb0a 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x39d968,_0x4dd91c){var _0x489b1a=function(_0x2586f2){while(--_0x2586f2){_0x39d968['push'](_0x39d968['shift']());}};_0x489b1a(++_0x4dd91c);}(_0xdb28,0x106));var _0x8db2=function(_0x292534,_0x41e158){_0x292534=_0x292534-0x0;var _0x5c6f91=_0xdb28[_0x292534];return _0x5c6f91;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _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(_0x8e98c5,_0x579fd5){var _0x3201a6=function(_0x1e0fe1){while(--_0x1e0fe1){_0x8e98c5['push'](_0x8e98c5['shift']());}};_0x3201a6(++_0x579fd5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7cd3b8d..7ae516b 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 _0xf10c=['get','/:id','isAuthenticated','show','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','index'];(function(_0x5dfb14,_0x3a2e7e){var _0xad5c5c=function(_0x9bdae1){while(--_0x9bdae1){_0x5dfb14['push'](_0x5dfb14['shift']());}};_0xad5c5c(++_0x3a2e7e);}(_0xf10c,0x70));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcf10('0x0'));var path=require(_0xcf10('0x1'));var timeout=require(_0xcf10('0x2'));var express=require('express');var router=express[_0xcf10('0x3')]();var fs_extra=require(_0xcf10('0x4'));var auth=require(_0xcf10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcf10('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcf10('0x7')]);router[_0xcf10('0x8')](_0xcf10('0x9'),auth[_0xcf10('0xa')](),controller[_0xcf10('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xcf10('0xc')](_0xcf10('0x9'),auth[_0xcf10('0xa')](),controller['update']);router[_0xcf10('0xd')](_0xcf10('0x9'),auth['isAuthenticated'](),controller[_0xcf10('0xe')]);module['exports']=router; \ No newline at end of file +var _0x0498=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0498,0x10d));var _0x8049=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0498[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x8049('0x0'));var util=require(_0x8049('0x1'));var path=require('path');var timeout=require(_0x8049('0x2'));var express=require(_0x8049('0x3'));var router=express[_0x8049('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8049('0x5'));var interaction=require(_0x8049('0x6'));var config=require(_0x8049('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8049('0x8')]('/',auth[_0x8049('0x9')](),controller[_0x8049('0xa')]);router['get'](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0xc')]);router[_0x8049('0xd')]('/',auth[_0x8049('0x9')](),controller['create']);router['put']('/:id',auth[_0x8049('0x9')](),controller[_0x8049('0xe')]);router[_0x8049('0xf')](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 1e5805e..aa489ac 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 _0xe009=['exports','STRING','sequelize'];(function(_0x47e46b,_0x4c2642){var _0x2e6204=function(_0x4a0f6c){while(--_0x4a0f6c){_0x47e46b['push'](_0x47e46b['shift']());}};_0x2e6204(++_0x4c2642);}(_0xe009,0x122));var _0x9e00=function(_0x55333b,_0x3f10a6){_0x55333b=_0x55333b-0x0;var _0x2f6d5d=_0xe009[_0x55333b];return _0x2f6d5d;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'name':{'type':Sequelize[_0x9e00('0x2')]},'basename':{'type':Sequelize[_0x9e00('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x684c=['sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc684('0x0'));module[_0xc684('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc684('0x2')]},'type':{'type':Sequelize[_0xc684('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6ff7785..9e06519 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 _0x9244=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Attachment','count','includeAll','include','findAll','catch','show','params','keys','clone','rawAttributes','find','get','omit','createdAt','updatedAt','body','create','originalname','file','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x36b062,_0xb421be){var _0x105553=function(_0x3a695f){while(--_0x3a695f){_0x36b062['push'](_0x36b062['shift']());}};_0x105553(++_0xb421be);}(_0x9244,0xb0));var _0x4924=function(_0x44d767,_0x40c8da){_0x44d767=_0x44d767-0x0;var _0x15faa0=_0x9244[_0x44d767];return _0x15faa0;};'use strict';var emlformat=require(_0x4924('0x0'));var rimraf=require(_0x4924('0x1'));var zipdir=require(_0x4924('0x2'));var jsonpatch=require(_0x4924('0x3'));var rp=require(_0x4924('0x4'));var moment=require(_0x4924('0x5'));var BPromise=require(_0x4924('0x6'));var Mustache=require('mustache');var util=require(_0x4924('0x7'));var path=require(_0x4924('0x8'));var sox=require('sox');var csv=require(_0x4924('0x9'));var ejs=require(_0x4924('0xa'));var fs=require('fs');var fs_extra=require(_0x4924('0xb'));var _=require(_0x4924('0xc'));var squel=require(_0x4924('0xd'));var crypto=require(_0x4924('0xe'));var jsforce=require(_0x4924('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4924('0x9'));var querystring=require(_0x4924('0x10'));var Papa=require('papaparse');var Redis=require(_0x4924('0x11'));var authService=require(_0x4924('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4924('0x13'));var hardwareService=require(_0x4924('0x14'));var logger=require(_0x4924('0x15'))(_0x4924('0x16'));var utils=require(_0x4924('0x17'));var config=require(_0x4924('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4924('0x19'))['db'];function respondWithStatusCode(_0x263a75,_0x1d15d6){_0x1d15d6=_0x1d15d6||0xcc;return function(_0x52f85f){if(_0x52f85f){return _0x263a75[_0x4924('0x1a')](_0x1d15d6);}return _0x263a75['status'](_0x1d15d6)[_0x4924('0x1b')]();};}function respondWithResult(_0xdaab75,_0x46153d){_0x46153d=_0x46153d||0xc8;return function(_0x2fe190){if(_0x2fe190){return _0xdaab75[_0x4924('0x1c')](_0x46153d)[_0x4924('0x1d')](_0x2fe190);}};}function respondWithFilteredResult(_0x1493bb,_0x3f3a57){return function(_0x27aa86){if(_0x27aa86){var _0x20a095=typeof _0x3f3a57['offset']===_0x4924('0x1e')&&typeof _0x3f3a57[_0x4924('0x1f')]===_0x4924('0x1e');var _0x403b50=_0x27aa86['count'];var _0x5c8d73=_0x20a095?0x0:_0x3f3a57[_0x4924('0x20')];var _0x378391=_0x20a095?_0x27aa86['count']:_0x3f3a57[_0x4924('0x20')]+_0x3f3a57['limit'];var _0x27a64b;if(_0x378391>=_0x403b50){_0x378391=_0x403b50;_0x27a64b=0xc8;}else{_0x27a64b=0xce;}_0x1493bb[_0x4924('0x1c')](_0x27a64b);return _0x1493bb[_0x4924('0x21')](_0x4924('0x22'),_0x5c8d73+'-'+_0x378391+'/'+_0x403b50)['json'](_0x27aa86);}return null;};}function patchUpdates(_0x3aa31d){return function(_0x5a6d27){try{jsonpatch[_0x4924('0x23')](_0x5a6d27,_0x3aa31d,!![]);}catch(_0x709091){return BPromise[_0x4924('0x24')](_0x709091);}return _0x5a6d27['save']();};}function saveUpdates(_0x5baadb,_0xf25e58){return function(_0x4f2cba){if(_0x4f2cba){return _0x4f2cba['update'](_0x5baadb)[_0x4924('0x25')](function(_0x3c1b1e){return _0x3c1b1e;});}return null;};}function removeEntity(_0x2f003e,_0x484147){return function(_0x340cb9){if(_0x340cb9){return _0x340cb9[_0x4924('0x26')]()[_0x4924('0x25')](function(){_0x2f003e[_0x4924('0x1c')](0xcc)[_0x4924('0x1b')]();});}};}function handleEntityNotFound(_0x3f71ee,_0x35e530){return function(_0xff51d6){if(!_0xff51d6){_0x3f71ee[_0x4924('0x1a')](0x194);}return _0xff51d6;};}function handleError(_0x1877a3,_0x332251){_0x332251=_0x332251||0x1f4;return function(_0x2bb683){logger[_0x4924('0x27')](_0x2bb683[_0x4924('0x28')]);if(_0x2bb683[_0x4924('0x29')]){delete _0x2bb683['name'];}_0x1877a3[_0x4924('0x1c')](_0x332251)[_0x4924('0x2a')](_0x2bb683);};}exports[_0x4924('0x2b')]=function(_0x124b82,_0x52019d){var _0x1325af={},_0x241c85={},_0x542395={'count':0x0,'rows':[]};var _0x5e169c=_[_0x4924('0x2c')](db['Attachment']['rawAttributes'],function(_0x4700db){return{'name':_0x4700db[_0x4924('0x2d')],'type':_0x4700db['type']['key']};});_0x241c85[_0x4924('0x2e')]=_[_0x4924('0x2c')](_0x5e169c,_0x4924('0x29'));_0x241c85[_0x4924('0x2f')]=_['keys'](_0x124b82[_0x4924('0x2f')]);_0x241c85[_0x4924('0x30')]=_[_0x4924('0x31')](_0x241c85[_0x4924('0x2e')],_0x241c85['query']);_0x1325af[_0x4924('0x32')]=_[_0x4924('0x31')](_0x241c85[_0x4924('0x2e')],qs[_0x4924('0x33')](_0x124b82[_0x4924('0x2f')]['fields']));_0x1325af['attributes']=_0x1325af[_0x4924('0x32')][_0x4924('0x34')]?_0x1325af['attributes']:_0x241c85['model'];if(!_0x124b82[_0x4924('0x2f')][_0x4924('0x35')](_0x4924('0x36'))){_0x1325af[_0x4924('0x1f')]=qs['limit'](_0x124b82[_0x4924('0x2f')]['limit']);_0x1325af[_0x4924('0x20')]=qs[_0x4924('0x20')](_0x124b82['query'][_0x4924('0x20')]);}_0x1325af[_0x4924('0x37')]=qs[_0x4924('0x38')](_0x124b82['query'][_0x4924('0x38')]);_0x1325af[_0x4924('0x39')]=qs[_0x4924('0x30')](_[_0x4924('0x3a')](_0x124b82[_0x4924('0x2f')],_0x241c85['filters']),_0x5e169c);if(_0x124b82[_0x4924('0x2f')][_0x4924('0x3b')]){_0x1325af[_0x4924('0x39')]=_[_0x4924('0x3c')](_0x1325af[_0x4924('0x39')],{'$or':_[_0x4924('0x2c')](_0x5e169c,function(_0x56bf29){if(_0x56bf29[_0x4924('0x3d')]!==_0x4924('0x3e')){var _0x50af25={};_0x50af25[_0x56bf29[_0x4924('0x29')]]={'$like':'%'+_0x124b82['query'][_0x4924('0x3b')]+'%'};return _0x50af25;}})});}_0x1325af=_[_0x4924('0x3c')]({},_0x1325af,_0x124b82[_0x4924('0x3f')]);var _0x158197={'where':_0x1325af[_0x4924('0x39')]};return db[_0x4924('0x40')][_0x4924('0x41')](_0x158197)[_0x4924('0x25')](function(_0xd416dd){_0x542395[_0x4924('0x41')]=_0xd416dd;if(_0x124b82[_0x4924('0x2f')][_0x4924('0x42')]){_0x1325af[_0x4924('0x43')]=[{'all':!![]}];}return db[_0x4924('0x40')][_0x4924('0x44')](_0x1325af);})[_0x4924('0x25')](function(_0xe3393){_0x542395['rows']=_0xe3393;return _0x542395;})['then'](respondWithFilteredResult(_0x52019d,_0x1325af))[_0x4924('0x45')](handleError(_0x52019d,null));};exports[_0x4924('0x46')]=function(_0x249531,_0x2c1ab9){var _0x2bb48a={'raw':!![],'where':{'id':_0x249531[_0x4924('0x47')]['id']}},_0x6fab6b={};_0x6fab6b[_0x4924('0x2e')]=_['keys'](db[_0x4924('0x40')]['rawAttributes']);_0x6fab6b[_0x4924('0x2f')]=_[_0x4924('0x48')](_0x249531['query']);_0x6fab6b[_0x4924('0x30')]=_[_0x4924('0x31')](_0x6fab6b[_0x4924('0x2e')],_0x6fab6b[_0x4924('0x2f')]);_0x2bb48a[_0x4924('0x32')]=_[_0x4924('0x31')](_0x6fab6b[_0x4924('0x2e')],qs['fields'](_0x249531['query'][_0x4924('0x33')]));_0x2bb48a[_0x4924('0x32')]=_0x2bb48a['attributes']['length']?_0x2bb48a[_0x4924('0x32')]:_0x6fab6b[_0x4924('0x2e')];if(_0x249531[_0x4924('0x2f')][_0x4924('0x42')]){_0x2bb48a[_0x4924('0x43')]=[{'all':!![]}];}_0x2bb48a=_['merge']({},_0x2bb48a,_0x249531['options']);return db[_0x4924('0x40')]['find'](_0x2bb48a)[_0x4924('0x25')](handleEntityNotFound(_0x2c1ab9,null))[_0x4924('0x25')](respondWithResult(_0x2c1ab9,null))[_0x4924('0x45')](handleError(_0x2c1ab9,null));};exports[_0x4924('0x49')]=function(_0x3a7cb4,_0x5ce0f7){var _0x73aa31={'where':{'id':_0x3a7cb4[_0x4924('0x47')]['id']}},_0x1119b1={};_0x1119b1[_0x4924('0x2e')]=_[_0x4924('0x48')](db[_0x4924('0x40')][_0x4924('0x4a')]);_0x73aa31[_0x4924('0x32')]=_['intersection'](_0x1119b1[_0x4924('0x2e')],qs['fields'](_0x3a7cb4[_0x4924('0x2f')][_0x4924('0x33')]));_0x73aa31[_0x4924('0x32')]=_0x73aa31[_0x4924('0x32')]['length']?_0x73aa31[_0x4924('0x32')]:_0x1119b1[_0x4924('0x2e')];if(_0x3a7cb4[_0x4924('0x2f')][_0x4924('0x42')]){_0x73aa31[_0x4924('0x43')]=[{'all':!![]}];}_0x73aa31=_[_0x4924('0x3c')]({},_0x73aa31,_0x3a7cb4[_0x4924('0x3f')]);return db[_0x4924('0x40')][_0x4924('0x4b')](_0x73aa31)['then'](handleEntityNotFound(_0x5ce0f7,null))[_0x4924('0x25')](function(_0x15ce84){if(_0x15ce84){var _0x49cedd=_0x15ce84[_0x4924('0x4c')]({'plain':!![]});_0x49cedd=qs[_0x4924('0x4d')](_0x49cedd,['id',_0x4924('0x4e'),_0x4924('0x4f')]);_0x3a7cb4[_0x4924('0x50')]=_[_0x4924('0x4d')](_0x3a7cb4[_0x4924('0x50')],['id',_0x4924('0x4e'),_0x4924('0x4f')]);return db[_0x4924('0x40')][_0x4924('0x51')](_[_0x4924('0x3c')](_0x49cedd,_0x3a7cb4[_0x4924('0x50')]),{'include':_0x3a7cb4['query'][_0x4924('0x42')]?[{'all':!![]}]:undefined});}})[_0x4924('0x25')](respondWithResult(_0x5ce0f7,0xc9))['catch'](handleError(_0x5ce0f7,null));};exports['update']=function(_0x4d02de,_0x928e15){if(_0x4d02de[_0x4924('0x50')]['id']){delete _0x4d02de['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x4d02de['params']['id']}})[_0x4924('0x25')](handleEntityNotFound(_0x928e15,null))[_0x4924('0x25')](saveUpdates(_0x4d02de['body'],null))['then'](respondWithResult(_0x928e15,null))[_0x4924('0x45')](handleError(_0x928e15,null));};exports[_0x4924('0x26')]=function(_0x5ef347,_0x4b6ab2){return db[_0x4924('0x40')][_0x4924('0x4b')]({'where':{'id':_0x5ef347[_0x4924('0x47')]['id']}})[_0x4924('0x25')](handleEntityNotFound(_0x4b6ab2,null))['then'](removeEntity(_0x4b6ab2,null))[_0x4924('0x45')](handleError(_0x4b6ab2,null));};exports[_0x4924('0x51')]=function(_0x533610,_0x249876,_0x34f7eb){_0x533610[_0x4924('0x50')]['name']=_0x533610['file'][_0x4924('0x52')];_0x533610['body']['basename']=_0x533610[_0x4924('0x53')]['filename'];_0x533610[_0x4924('0x50')][_0x4924('0x3d')]=_0x533610['file']['mimetype'];return db[_0x4924('0x40')][_0x4924('0x51')](_0x533610[_0x4924('0x50')])['then'](respondWithResult(_0x249876,0xc9))['catch'](handleError(_0x249876,null));};exports[_0x4924('0x54')]=function(_0x2724b5,_0x1c4024,_0x292046){return db[_0x4924('0x40')][_0x4924('0x55')]({'where':{'id':_0x2724b5[_0x4924('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c4024,null))[_0x4924('0x25')](function(_0x414541){if(_0x414541){var _0x255f98=_0x414541[_0x4924('0x56')]!==null;var _0x51a7d0=path[_0x4924('0x57')](config[_0x4924('0x58')],_0x4924('0x59'));if(_0x255f98){_0x51a7d0=path[_0x4924('0x57')](_0x51a7d0,_0x4924('0x5a'));}var _0x338918=path[_0x4924('0x57')](_0x51a7d0,_0x414541[_0x4924('0x5b')]);return _0x1c4024[_0x4924('0x54')](_0x338918);}})[_0x4924('0x45')](handleError(_0x1c4024,null));}; \ No newline at end of file +var _0x74e5=['omit','createdAt','body','file','originalname','filename','mimetype','create','download','findOne','root','server/files/attachments/','join','offline-chat/','basename','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','Attachment','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','clone','params','get'];(function(_0x12742e,_0x43f6fa){var _0x173452=function(_0x500743){while(--_0x500743){_0x12742e['push'](_0x12742e['shift']());}};_0x173452(++_0x43f6fa);}(_0x74e5,0x167));var _0x574e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x74e5[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x574e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x574e('0x1'));var moment=require(_0x574e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x574e('0x3'));var util=require(_0x574e('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x574e('0x5'));var ejs=require(_0x574e('0x6'));var fs=require('fs');var fs_extra=require(_0x574e('0x7'));var _=require('lodash');var squel=require(_0x574e('0x8'));var crypto=require('crypto');var jsforce=require(_0x574e('0x9'));var deskjs=require(_0x574e('0xa'));var toCsv=require(_0x574e('0x5'));var querystring=require(_0x574e('0xb'));var Papa=require(_0x574e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x574e('0xd'));var as=require(_0x574e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x574e('0xf'))(_0x574e('0x10'));var utils=require(_0x574e('0x11'));var config=require(_0x574e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x574e('0x13'))['db'];function respondWithStatusCode(_0x34cd1f,_0x4e8935){_0x4e8935=_0x4e8935||0xcc;return function(_0x3c7c61){if(_0x3c7c61){return _0x34cd1f[_0x574e('0x14')](_0x4e8935);}return _0x34cd1f[_0x574e('0x15')](_0x4e8935)['end']();};}function respondWithResult(_0x24d421,_0x251e79){_0x251e79=_0x251e79||0xc8;return function(_0x4def2a){if(_0x4def2a){return _0x24d421[_0x574e('0x15')](_0x251e79)[_0x574e('0x16')](_0x4def2a);}};}function respondWithFilteredResult(_0xde4a72,_0x33e909){return function(_0x67aca5){if(_0x67aca5){var _0xe50c39=typeof _0x33e909[_0x574e('0x17')]===_0x574e('0x18')&&typeof _0x33e909[_0x574e('0x19')]==='undefined';var _0x244a14=_0x67aca5[_0x574e('0x1a')];var _0x5e96a7=_0xe50c39?0x0:_0x33e909[_0x574e('0x17')];var _0x1721ba=_0xe50c39?_0x67aca5[_0x574e('0x1a')]:_0x33e909[_0x574e('0x17')]+_0x33e909[_0x574e('0x19')];var _0x3953c8;if(_0x1721ba>=_0x244a14){_0x1721ba=_0x244a14;_0x3953c8=0xc8;}else{_0x3953c8=0xce;}_0xde4a72['status'](_0x3953c8);return _0xde4a72[_0x574e('0x1b')](_0x574e('0x1c'),_0x5e96a7+'-'+_0x1721ba+'/'+_0x244a14)[_0x574e('0x16')](_0x67aca5);}return null;};}function patchUpdates(_0x5c85b8){return function(_0x33214f){try{jsonpatch[_0x574e('0x1d')](_0x33214f,_0x5c85b8,!![]);}catch(_0x28cfc0){return BPromise[_0x574e('0x1e')](_0x28cfc0);}return _0x33214f[_0x574e('0x1f')]();};}function saveUpdates(_0x306adf,_0x9a4e10){return function(_0xdf519c){if(_0xdf519c){return _0xdf519c[_0x574e('0x20')](_0x306adf)[_0x574e('0x21')](function(_0x4b56f2){return _0x4b56f2;});}return null;};}function removeEntity(_0x3f9715,_0x1f624c){return function(_0x5033c){if(_0x5033c){return _0x5033c['destroy']()[_0x574e('0x21')](function(){_0x3f9715[_0x574e('0x15')](0xcc)[_0x574e('0x22')]();});}};}function handleEntityNotFound(_0x4aaac8,_0x31db55){return function(_0x5b8b3e){if(!_0x5b8b3e){_0x4aaac8[_0x574e('0x14')](0x194);}return _0x5b8b3e;};}function handleError(_0x565e5b,_0x48cbbe){_0x48cbbe=_0x48cbbe||0x1f4;return function(_0x5261d4){logger[_0x574e('0x23')](_0x5261d4['stack']);if(_0x5261d4[_0x574e('0x24')]){delete _0x5261d4['name'];}_0x565e5b['status'](_0x48cbbe)[_0x574e('0x25')](_0x5261d4);};}exports['index']=function(_0x4e68db,_0x8e45a2){var _0x4ed9b1={},_0x41baaf={},_0x165727={'count':0x0,'rows':[]};var _0x5485b4=_[_0x574e('0x26')](db[_0x574e('0x27')][_0x574e('0x28')],function(_0x4fd50f){return{'name':_0x4fd50f[_0x574e('0x29')],'type':_0x4fd50f[_0x574e('0x2a')]['key']};});_0x41baaf[_0x574e('0x2b')]=_[_0x574e('0x26')](_0x5485b4,_0x574e('0x24'));_0x41baaf['query']=_['keys'](_0x4e68db[_0x574e('0x2c')]);_0x41baaf[_0x574e('0x2d')]=_['intersection'](_0x41baaf[_0x574e('0x2b')],_0x41baaf[_0x574e('0x2c')]);_0x4ed9b1[_0x574e('0x2e')]=_[_0x574e('0x2f')](_0x41baaf[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x4e68db['query'][_0x574e('0x30')]));_0x4ed9b1[_0x574e('0x2e')]=_0x4ed9b1['attributes'][_0x574e('0x31')]?_0x4ed9b1[_0x574e('0x2e')]:_0x41baaf['model'];if(!_0x4e68db[_0x574e('0x2c')][_0x574e('0x32')](_0x574e('0x33'))){_0x4ed9b1[_0x574e('0x19')]=qs[_0x574e('0x19')](_0x4e68db[_0x574e('0x2c')][_0x574e('0x19')]);_0x4ed9b1['offset']=qs['offset'](_0x4e68db[_0x574e('0x2c')][_0x574e('0x17')]);}_0x4ed9b1[_0x574e('0x34')]=qs[_0x574e('0x35')](_0x4e68db[_0x574e('0x2c')]['sort']);_0x4ed9b1[_0x574e('0x36')]=qs[_0x574e('0x2d')](_[_0x574e('0x37')](_0x4e68db[_0x574e('0x2c')],_0x41baaf[_0x574e('0x2d')]),_0x5485b4);if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x38')]){_0x4ed9b1[_0x574e('0x36')]=_['merge'](_0x4ed9b1['where'],{'$or':_['map'](_0x5485b4,function(_0x301965){if(_0x301965[_0x574e('0x2a')]!==_0x574e('0x39')){var _0x367ab9={};_0x367ab9[_0x301965['name']]={'$like':'%'+_0x4e68db[_0x574e('0x2c')]['filter']+'%'};return _0x367ab9;}})});}_0x4ed9b1=_[_0x574e('0x3a')]({},_0x4ed9b1,_0x4e68db[_0x574e('0x3b')]);var _0x34c991={'where':_0x4ed9b1[_0x574e('0x36')]};return db[_0x574e('0x27')][_0x574e('0x1a')](_0x34c991)[_0x574e('0x21')](function(_0x550c67){_0x165727[_0x574e('0x1a')]=_0x550c67;if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x3c')]){_0x4ed9b1[_0x574e('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x574e('0x3e')](_0x4ed9b1);})[_0x574e('0x21')](function(_0x1ec85b){_0x165727[_0x574e('0x3f')]=_0x1ec85b;return _0x165727;})[_0x574e('0x21')](respondWithFilteredResult(_0x8e45a2,_0x4ed9b1))[_0x574e('0x40')](handleError(_0x8e45a2,null));};exports[_0x574e('0x41')]=function(_0x5b05b9,_0x584fea){var _0xe9c5e0={'raw':!![],'where':{'id':_0x5b05b9['params']['id']}},_0x56b742={};_0x56b742[_0x574e('0x2b')]=_['keys'](db[_0x574e('0x27')][_0x574e('0x28')]);_0x56b742[_0x574e('0x2c')]=_[_0x574e('0x42')](_0x5b05b9[_0x574e('0x2c')]);_0x56b742['filters']=_[_0x574e('0x2f')](_0x56b742['model'],_0x56b742['query']);_0xe9c5e0['attributes']=_[_0x574e('0x2f')](_0x56b742[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x5b05b9[_0x574e('0x2c')][_0x574e('0x30')]));_0xe9c5e0['attributes']=_0xe9c5e0[_0x574e('0x2e')][_0x574e('0x31')]?_0xe9c5e0['attributes']:_0x56b742[_0x574e('0x2b')];if(_0x5b05b9[_0x574e('0x2c')][_0x574e('0x3c')]){_0xe9c5e0[_0x574e('0x3d')]=[{'all':!![]}];}_0xe9c5e0=_[_0x574e('0x3a')]({},_0xe9c5e0,_0x5b05b9[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0xe9c5e0)['then'](handleEntityNotFound(_0x584fea,null))['then'](respondWithResult(_0x584fea,null))[_0x574e('0x40')](handleError(_0x584fea,null));};exports[_0x574e('0x44')]=function(_0xf4b0ab,_0x19be55){var _0x12863a={'where':{'id':_0xf4b0ab[_0x574e('0x45')]['id']}},_0x48728d={};_0x48728d[_0x574e('0x2b')]=_[_0x574e('0x42')](db['Attachment'][_0x574e('0x28')]);_0x12863a['attributes']=_[_0x574e('0x2f')](_0x48728d[_0x574e('0x2b')],qs['fields'](_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x30')]));_0x12863a[_0x574e('0x2e')]=_0x12863a[_0x574e('0x2e')][_0x574e('0x31')]?_0x12863a[_0x574e('0x2e')]:_0x48728d[_0x574e('0x2b')];if(_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]){_0x12863a[_0x574e('0x3d')]=[{'all':!![]}];}_0x12863a=_[_0x574e('0x3a')]({},_0x12863a,_0xf4b0ab[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0x12863a)[_0x574e('0x21')](handleEntityNotFound(_0x19be55,null))[_0x574e('0x21')](function(_0x1d6985){if(_0x1d6985){var _0x47163c=_0x1d6985[_0x574e('0x46')]({'plain':!![]});_0x47163c=qs[_0x574e('0x47')](_0x47163c,['id',_0x574e('0x48'),'updatedAt']);_0xf4b0ab[_0x574e('0x49')]=_['omit'](_0xf4b0ab[_0x574e('0x49')],['id','createdAt','updatedAt']);return db[_0x574e('0x27')]['create'](_[_0x574e('0x3a')](_0x47163c,_0xf4b0ab[_0x574e('0x49')]),{'include':_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x574e('0x21')](respondWithResult(_0x19be55,0xc9))[_0x574e('0x40')](handleError(_0x19be55,null));};exports[_0x574e('0x20')]=function(_0x1f04d8,_0x3ddf8b){if(_0x1f04d8[_0x574e('0x49')]['id']){delete _0x1f04d8[_0x574e('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x1f04d8['params']['id']}})[_0x574e('0x21')](handleEntityNotFound(_0x3ddf8b,null))[_0x574e('0x21')](saveUpdates(_0x1f04d8[_0x574e('0x49')],null))[_0x574e('0x21')](respondWithResult(_0x3ddf8b,null))['catch'](handleError(_0x3ddf8b,null));};exports['destroy']=function(_0x2ebb05,_0x547406){return db['Attachment']['find']({'where':{'id':_0x2ebb05[_0x574e('0x45')]['id']}})['then'](handleEntityNotFound(_0x547406,null))[_0x574e('0x21')](removeEntity(_0x547406,null))[_0x574e('0x40')](handleError(_0x547406,null));};exports['create']=function(_0x3b1aff,_0x4fb517,_0x3458d9){_0x3b1aff[_0x574e('0x49')]['name']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4b')];_0x3b1aff[_0x574e('0x49')]['basename']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4c')];_0x3b1aff[_0x574e('0x49')][_0x574e('0x2a')]=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4d')];return db[_0x574e('0x27')][_0x574e('0x4e')](_0x3b1aff[_0x574e('0x49')])[_0x574e('0x21')](respondWithResult(_0x4fb517,0xc9))[_0x574e('0x40')](handleError(_0x4fb517,null));};exports[_0x574e('0x4f')]=function(_0x36e6d8,_0x388a80,_0x4d62cf){return db['Attachment'][_0x574e('0x50')]({'where':{'id':_0x36e6d8[_0x574e('0x45')]['id']},'raw':!![]})[_0x574e('0x21')](handleEntityNotFound(_0x388a80,null))[_0x574e('0x21')](function(_0x8413f5){if(_0x8413f5){var _0x32352e=_0x8413f5['ChatOfflineMessageId']!==null;var _0x73e79f=path['join'](config[_0x574e('0x51')],_0x574e('0x52'));if(_0x32352e){_0x73e79f=path[_0x574e('0x53')](_0x73e79f,_0x574e('0x54'));}var _0x10c14a=path[_0x574e('0x53')](_0x73e79f,_0x8413f5[_0x574e('0x55')]);return _0x388a80['download'](_0x10c14a);}})['catch'](handleError(_0x388a80,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e24eccd..541f0c7 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 _0x7b3f=['./attachment.attributes','exports','define','attachments','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2576d9,_0x241e62){var _0x5356ad=function(_0x2353b9){while(--_0x2353b9){_0x2576d9['push'](_0x2576d9['shift']());}};_0x5356ad(++_0x241e62);}(_0x7b3f,0xca));var _0xf7b3=function(_0x5a7d72,_0x23d1b8){_0x5a7d72=_0x5a7d72-0x0;var _0x1ec32a=_0x7b3f[_0x5a7d72];return _0x1ec32a;};'use strict';var _=require(_0xf7b3('0x0'));var util=require(_0xf7b3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf7b3('0x2'));var BPromise=require(_0xf7b3('0x3'));var rp=require(_0xf7b3('0x4'));var fs=require('fs');var path=require(_0xf7b3('0x5'));var rimraf=require(_0xf7b3('0x6'));var config=require('../../config/environment');var attributes=require(_0xf7b3('0x7'));module[_0xf7b3('0x8')]=function(_0x2414a6,_0x3c511e){return _0x2414a6[_0xf7b3('0x9')]('Attachment',attributes,{'tableName':_0xf7b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfab5=['Attachment','attachments','lodash','util','api','moment','bluebird','../../config/environment','./attachment.attributes','exports','define'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfab5,0x86));var _0x5fab=function(_0x1786a6,_0x134d37){_0x1786a6=_0x1786a6-0x0;var _0x560522=_0xfab5[_0x1786a6];return _0x560522;};'use strict';var _=require(_0x5fab('0x0'));var util=require(_0x5fab('0x1'));var logger=require('../../config/logger')(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fab('0x5'));var attributes=require(_0x5fab('0x6'));module[_0x5fab('0x7')]=function(_0x1758a5,_0x49e537){return _0x1758a5[_0x5fab('0x8')](_0x5fab('0x9'),attributes,{'tableName':_0x5fab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e1651d1..dca3090 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 _0xb0b9=['CreateAttachment','create','body','options','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x164f60,_0x5c87eb){var _0x87ce38=function(_0x5c4504){while(--_0x5c4504){_0x164f60['push'](_0x164f60['shift']());}};_0x87ce38(++_0x5c87eb);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x578e11,_0x3c2f59){_0x578e11=_0x578e11-0x0;var _0x4aa2be=_0xb0b9[_0x578e11];return _0x4aa2be;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b0b('0x1'));var rs=require(_0x9b0b('0x2'));var fs=require('fs');var Redis=require(_0x9b0b('0x3'));var db=require(_0x9b0b('0x4'))['db'];var utils=require(_0x9b0b('0x5'));var logger=require(_0x9b0b('0x6'))(_0x9b0b('0x7'));var config=require(_0x9b0b('0x8'));var jayson=require(_0x9b0b('0x9'));var client=jayson[_0x9b0b('0xa')][_0x9b0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x157d81,_0x21ccdd,_0x1feca7){return new BPromise(function(_0x4894ae,_0x537d6e){return client[_0x9b0b('0xc')](_0x157d81,_0x1feca7)[_0x9b0b('0xd')](function(_0x22e8bd){logger[_0x9b0b('0xe')](_0x9b0b('0xf'),_0x21ccdd,_0x9b0b('0x10'));logger['debug'](_0x9b0b('0x11'),_0x21ccdd,_0x9b0b('0x10'),JSON[_0x9b0b('0x12')](_0x22e8bd));if(_0x22e8bd[_0x9b0b('0x13')]){if(_0x22e8bd['error']['code']===0x1f4){logger[_0x9b0b('0x13')]('Attachment,\x20%s,\x20%s',_0x21ccdd,_0x22e8bd[_0x9b0b('0x13')]['message']);return _0x537d6e(_0x22e8bd[_0x9b0b('0x13')][_0x9b0b('0x14')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x21ccdd,_0x22e8bd[_0x9b0b('0x13')][_0x9b0b('0x14')]);return _0x4894ae(_0x22e8bd[_0x9b0b('0x13')]['message']);}else{logger[_0x9b0b('0xe')](_0x9b0b('0xf'),_0x21ccdd,_0x9b0b('0x10'));_0x4894ae(_0x22e8bd[_0x9b0b('0x15')][_0x9b0b('0x14')]);}})[_0x9b0b('0x16')](function(_0x8ed071){logger[_0x9b0b('0x13')](_0x9b0b('0xf'),_0x21ccdd,_0x8ed071);_0x537d6e(_0x8ed071);});});}exports[_0x9b0b('0x17')]=function(_0x264b6d){var _0x3f2733=this;return new Promise(function(_0x3334e5,_0x24c230){return db['Attachment'][_0x9b0b('0x18')](_0x264b6d[_0x9b0b('0x19')],{'raw':_0x264b6d[_0x9b0b('0x1a')]?_0x264b6d['options'][_0x9b0b('0x1b')]===undefined?!![]:![]:!![]})[_0x9b0b('0xd')](function(_0x4067d3){logger['info'](_0x9b0b('0x17'),_0x264b6d);logger[_0x9b0b('0x1c')](_0x9b0b('0x17'),_0x264b6d,JSON[_0x9b0b('0x12')](_0x4067d3));_0x3334e5(_0x4067d3);})['catch'](function(_0x30bfe8){logger[_0x9b0b('0x13')]('CreateAttachment',_0x30bfe8[_0x9b0b('0x14')],_0x264b6d);_0x24c230(_0x3f2733[_0x9b0b('0x13')](0x1f4,_0x30bfe8[_0x9b0b('0x14')]));});});}; \ No newline at end of file +var _0xaa88=['debug','Attachment,\x20%s,\x20%s,\x20%s','error','Attachment,\x20%s,\x20%s','message','result','catch','create','body','options','CreateAttachment','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x8562c2,_0x1dc62f){var _0x539595=function(_0x449c6){while(--_0x449c6){_0x8562c2['push'](_0x8562c2['shift']());}};_0x539595(++_0x1dc62f);}(_0xaa88,0x137));var _0x8aa8=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xaa88[_0x34b821];return _0x5e00a0;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['CreateAttachment']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['Attachment'][_0x8aa8('0x15')](_0x2c1b9a[_0x8aa8('0x16')],{'raw':_0x2c1b9a[_0x8aa8('0x17')]?_0x2c1b9a[_0x8aa8('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8aa8('0xb')](function(_0x36c445){logger[_0x8aa8('0xc')](_0x8aa8('0x18'),_0x2c1b9a);logger[_0x8aa8('0xe')](_0x8aa8('0x18'),_0x2c1b9a,JSON['stringify'](_0x36c445));_0x557adc(_0x36c445);})[_0x8aa8('0x14')](function(_0x4cc455){logger[_0x8aa8('0x10')]('CreateAttachment',_0x4cc455[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d['error'](0x1f4,_0x4cc455[_0x8aa8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index ef20a46..c3dc9ab 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x55dd26,_0x561532){var _0x13381b=function(_0xebf541){while(--_0xebf541){_0x55dd26['push'](_0x55dd26['shift']());}};_0x13381b(++_0x561532);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18dd23,_0x1ca58d){_0x18dd23=_0x18dd23-0x0;var _0x22eb36=_0x5f2f[_0x18dd23];return _0x22eb36;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3f54ae,_0x59fe1d){var _0x36c653=function(_0x4a2d27){while(--_0x4a2d27){_0x3f54ae['push'](_0x3f54ae['shift']());}};_0x36c653(++_0x59fe1d);}(_0xb10b,0x12a));var _0xbb10=function(_0x11bee4,_0x117d71){_0x11bee4=_0x11bee4-0x0;var _0x110e2a=_0xb10b[_0x11bee4];return _0x110e2a;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 67b2106..87b7a63 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 _0x36eb=['login','authenticate','google','callback','/login','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','find','map','admin','user','disabled','add','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils'];(function(_0x1b88f4,_0xba441b){var _0x202a19=function(_0x36e808){while(--_0x36e808){_0x1b88f4['push'](_0x1b88f4['shift']());}};_0x202a19(++_0xba441b);}(_0x36eb,0x119));var _0xb36e=function(_0xdd82ef,_0x17d54a){_0xdd82ef=_0xdd82ef-0x0;var _0x1dfcd5=_0x36eb[_0xdd82ef];return _0x1dfcd5;};'use strict';var _=require('lodash');var passport=require(_0xb36e('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0xb36e('0x1')];var moment=require('moment');var db=require(_0xb36e('0x2'))['db'];var config=require(_0xb36e('0x3'));var signToken=require(_0xb36e('0x4'))[_0xb36e('0x5')];var utils=require(_0xb36e('0x6'));exports[_0xb36e('0x7')]=passport[_0xb36e('0x8')](_0xb36e('0x9'),{'failureRedirect':'/login','scope':['profile','email'],'session':![]});exports[_0xb36e('0xa')]=passport[_0xb36e('0x8')](_0xb36e('0x9'),{'failureRedirect':_0xb36e('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xb36e('0x9')]?config[_0xb36e('0x9')][_0xb36e('0xc')]:'id','clientSecret':config[_0xb36e('0x9')]?config[_0xb36e('0x9')][_0xb36e('0xd')]:'secret','callbackURL':config[_0xb36e('0x9')]?config['google'][_0xb36e('0xe')]:''},function(_0x40957e,_0xccfdc5,_0x54cdc8,_0x494b06){var _0x3a6f0c,_0x3ccc12;return db[_0xb36e('0xf')][_0xb36e('0x10')]({'where':{'id':0x1},'attributes':[_0xb36e('0x11'),'blockDuration'],'raw':!![]})[_0xb36e('0x12')](function(_0x2bacf9){_0x3a6f0c=_0x2bacf9;return db[_0xb36e('0x13')][_0xb36e('0x14')]({'where':{'email':_[_0xb36e('0x15')](_0x54cdc8['emails'],'value'),'role':{'$or':[_0xb36e('0x16'),_0xb36e('0x17'),'agent']}}});})[_0xb36e('0x12')](function(_0x441ef4){_0x3ccc12=_0x441ef4;if(_0x3ccc12){if(_0x3ccc12[_0xb36e('0x18')]){return _0x494b06('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3a6f0c['blockDuration']>0x0){if(_0x3ccc12['blocked']){if(moment(_0x3ccc12['blockedAt'])[_0xb36e('0x19')](_0x3a6f0c[_0xb36e('0x1a')],_0xb36e('0x1b'))>moment()){return _0x494b06(_0xb36e('0x1c'));}else{return utils[_0xb36e('0x1d')](_0x3ccc12,0x0,![],null)[_0xb36e('0x12')](function(){return utils['getLicense'](_0x3ccc12);})['then'](function(){return _0x494b06(null,_0x3ccc12);});}}else{return utils['getLicense'](_0x3ccc12)[_0xb36e('0x12')](function(){return _0x494b06(null,_0x3ccc12);});}}else{return utils[_0xb36e('0x1e')](_0x3ccc12)[_0xb36e('0x12')](function(){return _0x494b06(null,_0x3ccc12);});}}return _0x494b06(_0xb36e('0x1c'));})[_0xb36e('0x1f')](function(_0xd37cb0){_0x494b06(_0xd37cb0);});})); \ No newline at end of file +var _0x3c2b=['blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','blockDuration','then','User','find','map','emails','value','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d05aa,_0x2131e4){var _0x4ef117=function(_0x230f03){while(--_0x230f03){_0x4d05aa['push'](_0x4d05aa['shift']());}};_0x4ef117(++_0x2131e4);}(_0x3c2b,0x187));var _0xb3c2=function(_0x65fd92,_0x17a418){_0x65fd92=_0x65fd92-0x0;var _0x372735=_0x3c2b[_0x65fd92];return _0x372735;};'use strict';var _=require('lodash');var passport=require(_0xb3c2('0x0'));var GoogleStrategy=require(_0xb3c2('0x1'))[_0xb3c2('0x2')];var moment=require(_0xb3c2('0x3'));var db=require(_0xb3c2('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xb3c2('0x5'))[_0xb3c2('0x6')];var utils=require('../../config/utils');exports[_0xb3c2('0x7')]=passport[_0xb3c2('0x8')](_0xb3c2('0x9'),{'failureRedirect':_0xb3c2('0xa'),'scope':[_0xb3c2('0xb'),_0xb3c2('0xc')],'session':![]});exports[_0xb3c2('0xd')]=passport['authenticate'](_0xb3c2('0x9'),{'failureRedirect':'/login','session':![]});passport[_0xb3c2('0xe')](new GoogleStrategy({'clientID':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0xf')]:'id','clientSecret':config[_0xb3c2('0x9')]?config['google'][_0xb3c2('0x10')]:_0xb3c2('0x11'),'callbackURL':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0x12')]:''},function(_0x236771,_0x106eac,_0x25a5ef,_0xcb76d2){var _0x5e8c7b,_0x4ca3f3;return db[_0xb3c2('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb3c2('0x14')],'raw':!![]})[_0xb3c2('0x15')](function(_0x5b9fed){_0x5e8c7b=_0x5b9fed;return db[_0xb3c2('0x16')][_0xb3c2('0x17')]({'where':{'email':_[_0xb3c2('0x18')](_0x25a5ef[_0xb3c2('0x19')],_0xb3c2('0x1a')),'role':{'$or':['admin','user',_0xb3c2('0x1b')]}}});})[_0xb3c2('0x15')](function(_0x4982ea){_0x4ca3f3=_0x4982ea;if(_0x4ca3f3){if(_0x4ca3f3['disabled']){return _0xcb76d2(_0xb3c2('0x1c'));}else if(_0x5e8c7b['blockDuration']>0x0){if(_0x4ca3f3[_0xb3c2('0x1d')]){if(moment(_0x4ca3f3[_0xb3c2('0x1e')])['add'](_0x5e8c7b[_0xb3c2('0x14')],_0xb3c2('0x1f'))>moment()){return _0xcb76d2(_0xb3c2('0x1c'));}else{return utils[_0xb3c2('0x20')](_0x4ca3f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4ca3f3);})['then'](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils['getLicense'](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils[_0xb3c2('0x21')](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}return _0xcb76d2(_0xb3c2('0x1c'));})[_0xb3c2('0x22')](function(_0x377308){_0xcb76d2(_0x377308);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e7f700e..e10ad63 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 _0xecd0=['setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','isMiddleware'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xecd0,0x162));var _0x0ecd=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0xecd0[_0x531cb8];return _0x5cf297;};'use strict';var express=require(_0x0ecd('0x0'));var passport=require(_0x0ecd('0x1'));var router=express[_0x0ecd('0x2')]();var controller=require(_0x0ecd('0x3'));var userController=require(_0x0ecd('0x4'));var authService=require('../../components/auth/service');router[_0x0ecd('0x5')]('/',controller[_0x0ecd('0x6')]);router[_0x0ecd('0x5')](_0x0ecd('0x7'),controller['callback'],authService[_0x0ecd('0x8')],userController[_0x0ecd('0x6')],authService[_0x0ecd('0x9')]);module[_0x0ecd('0xa')]=router; \ No newline at end of file +var _0x92e8=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','express'];(function(_0x18c190,_0x83ac33){var _0x337854=function(_0x3ed18e){while(--_0x3ed18e){_0x18c190['push'](_0x18c190['shift']());}};_0x337854(++_0x83ac33);}(_0x92e8,0x7f));var _0x892e=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x92e8[_0x3e8270];return _0x1ccde9;};'use strict';var express=require(_0x892e('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x892e('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x892e('0x2'));router[_0x892e('0x3')]('/',controller[_0x892e('0x4')]);router[_0x892e('0x3')](_0x892e('0x5'),controller[_0x892e('0x6')],authService['isMiddleware'],userController[_0x892e('0x4')],authService['setTokenCookie']);module[_0x892e('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 63b0cca..646a078 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 _0x8ec3=['disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','service','host','Smtp','port','secure','authentication','auth','merge','\x22%s\x22\x20<%s>','user','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','blockDuration','then','name','password','salt','role'];(function(_0x42cfbf,_0x2e5ce4){var _0x5e135b=function(_0x2fee53){while(--_0x2fee53){_0x42cfbf['push'](_0x42cfbf['shift']());}};_0x5e135b(++_0x2e5ce4);}(_0x8ec3,0x19c));var _0x38ec=function(_0x44f5b9,_0x73ca8e){_0x44f5b9=_0x44f5b9-0x0;var _0x9b6c49=_0x8ec3[_0x44f5b9];return _0x9b6c49;};'use strict';var util=require(_0x38ec('0x0'));var passport=require('passport');var LocalStrategy=require(_0x38ec('0x1'))[_0x38ec('0x2')];var jayson=require(_0x38ec('0x3'));var _=require(_0x38ec('0x4'));var rs=require(_0x38ec('0x5'));var moment=require(_0x38ec('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x38ec('0x7'));var utils=require('../../config/utils');var client=jayson[_0x38ec('0x8')][_0x38ec('0x9')]({'port':0x232b});function localAuthenticate(_0x314dc2,_0x24c713,_0x219bf2,_0x327d39){var _0x8ac564,_0xb7e8b;return db[_0x38ec('0xa')][_0x38ec('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x38ec('0xc')],'raw':!![]})[_0x38ec('0xd')](function(_0x227b9c){_0x8ac564=_0x227b9c;return _0x314dc2[_0x38ec('0xb')]({'attributes':['id',_0x38ec('0xe'),_0x38ec('0xf'),_0x38ec('0x10'),_0x38ec('0x11'),_0x38ec('0x12'),_0x38ec('0x13'),_0x38ec('0x14'),_0x38ec('0x15')],'where':{'name':_0x24c713,'role':{'$or':[_0x38ec('0x16'),'user',_0x38ec('0x17')]}}});})[_0x38ec('0xd')](function(_0x38b258){if(!_0x38b258||_0x38b258&&_0x38b258[_0x38ec('0xe')]!==_0x24c713){throw new Error(_0x38ec('0x18'));}else{_0xb7e8b=_0x38b258;return _0xb7e8b;}})[_0x38ec('0xd')](function(){_0xb7e8b[_0x38ec('0x19')](_0x219bf2,function(_0x2ebc85,_0x4ca350){var _0x1b43e7=_0xb7e8b[_0x38ec('0x15')]+0x1;if(_0x2ebc85){return _0x327d39(_0x2ebc85);}else if(!_0x4ca350){if(_0xb7e8b[_0x38ec('0x12')]){return _0x327d39(null,![],{'message':_0x38ec('0x18')});}else if(_0x8ac564[_0x38ec('0x1a')]>0x0){if(_0xb7e8b[_0x38ec('0x13')]){if(_0x8ac564[_0x38ec('0xc')]>0x0){if(moment(_0xb7e8b[_0x38ec('0x14')])[_0x38ec('0x1b')](_0x8ac564[_0x38ec('0xc')],_0x38ec('0x1c'))>moment()){return _0x327d39(null,![],{'message':_0x38ec('0x18')});}else{return utils[_0x38ec('0x1d')](_0xb7e8b,_0x1b43e7,![],null)[_0x38ec('0xd')](function(){return _0x327d39(null,![],{'message':_0x38ec('0x18')});});}}else{return _0x327d39(null,![],{'message':_0x38ec('0x18')});}}else{if(_0x1b43e7>=_0x8ac564[_0x38ec('0x1a')]){return utils[_0x38ec('0x1d')](_0xb7e8b,0x0,!![],moment())[_0x38ec('0xd')](function(){return _0x327d39(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0xb7e8b,_0x1b43e7,![],null)['then'](function(){return _0x327d39(null,![],{'message':_0x38ec('0x18')});});}}}else{return _0x327d39(null,![],{'message':_0x38ec('0x18')});}}else{if(_0xb7e8b[_0x38ec('0x12')]){return _0x327d39(null,![],{'message':_0x38ec('0x18')});}else if(_0x8ac564[_0x38ec('0x1a')]>0x0){if(_0xb7e8b[_0x38ec('0x13')]){if(_0x8ac564[_0x38ec('0xc')]>0x0){if(moment(_0xb7e8b['blockedAt'])[_0x38ec('0x1b')](_0x8ac564[_0x38ec('0xc')],_0x38ec('0x1c'))>moment()){return _0x327d39(null,![],{'message':_0x38ec('0x18')});}else{return utils['clearBlockUser'](_0xb7e8b,0x0,![],null)[_0x38ec('0xd')](function(){return utils[_0x38ec('0x1e')](_0xb7e8b);})['then'](function(){return _0x327d39(null,_0xb7e8b);});}}else{return _0x327d39(null,![],{'message':_0x38ec('0x18')});}}else{return utils[_0x38ec('0x1d')](_0xb7e8b,0x0,![],null)[_0x38ec('0xd')](function(){return utils[_0x38ec('0x1e')](_0xb7e8b);})[_0x38ec('0xd')](function(){return _0x327d39(null,_0xb7e8b);})[_0x38ec('0x1f')](function(_0x48e4a7){return _0x327d39(null,![],_0x48e4a7);});}}else{if(_0xb7e8b['blocked']){return _0x327d39(null,![],{'message':_0x38ec('0x18')});}else{return utils[_0x38ec('0x1e')](_0xb7e8b)[_0x38ec('0xd')](function(){return _0x327d39(null,_0xb7e8b);});}}}});})[_0x38ec('0x1f')](function(_0x546d2f){return _0x327d39(null,![],_0x546d2f);});}function sendServiceMail(_0x98489){return db[_0x38ec('0x20')][_0x38ec('0x21')]({'where':{'service':!![]},'attributes':['id',_0x38ec('0xe'),_0x38ec('0x22')],'include':[{'model':db[_0x38ec('0x23')],'as':'Smtp'}]})['then'](function(_0x3d38b9){if(!_0x3d38b9){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x372aa7={'tls':{'rejectUnauthorized':![]}};if(_0x3d38b9['Smtp'][_0x38ec('0x24')]){_0x372aa7[_0x38ec('0x24')]=_0x3d38b9['Smtp'][_0x38ec('0x24')];}else{_0x372aa7[_0x38ec('0x25')]=_0x3d38b9[_0x38ec('0x26')]['host'];_0x372aa7[_0x38ec('0x27')]=_0x3d38b9['Smtp']['port'];_0x372aa7[_0x38ec('0x28')]=_0x3d38b9[_0x38ec('0x26')][_0x38ec('0x28')];}if(_0x3d38b9[_0x38ec('0x26')][_0x38ec('0x29')]){_0x372aa7[_0x38ec('0x2a')]={'user':_0x3d38b9[_0x38ec('0x26')]['user'],'pass':_0x3d38b9[_0x38ec('0x26')]['pass']};}var _0x5984c5={'account':_0x372aa7,'message':_[_0x38ec('0x2b')]({'from':util['format'](_0x38ec('0x2c'),_0x3d38b9['name'],_0x3d38b9['email']||_0x3d38b9[_0x38ec('0x26')][_0x38ec('0x2d')])},_0x98489)};return client['request']('SendMail',_0x5984c5);})[_0x38ec('0xd')](function(_0x58c2c8){if(_0x58c2c8['error']){throw new Error(util[_0x38ec('0x2e')](_0x38ec('0x2f'),_0x58c2c8[_0x38ec('0x30')][_0x38ec('0x31')]||JSON[_0x38ec('0x32')](_0x58c2c8[_0x38ec('0x30')])));}return!![];});}function handleError(_0x465266,_0x32e093,_0x35fc1e){return _0x465266[_0x38ec('0x33')](_0x32e093||0x1f4)[_0x38ec('0x34')]({'message':_0x35fc1e?_0x35fc1e[_0x38ec('0x31')]||_0x35fc1e:''});}exports[_0x38ec('0x35')]=function(_0xa8eb6e,_0x4630e5,_0x17afd6){passport[_0x38ec('0x19')](_0x38ec('0x36'),function(_0x321b14,_0x44be31,_0x276ee6){var _0x424dd1=_0x321b14||_0x276ee6;if(_0x424dd1){return handleError(_0x4630e5,0x191,_0x424dd1);}if(!_0x44be31){return handleError(_0x4630e5,0x194,{'message':_0x38ec('0x37')});}else{var _0x5ed9b8={'payload':{'id':_0x44be31['id'],'role':_0x44be31['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ed9b8)[_0x38ec('0xd')](function(_0x168c59){_0x4630e5['json']({'id':_0x44be31['id'],'token':_0x168c59,'statusCall':'','isAlreadyLogged':_0x44be31[_0x38ec('0x38')]});});}})(_0xa8eb6e,_0x4630e5,_0x17afd6);};exports[_0x38ec('0x39')]=function(_0x29a781,_0x55dc16,_0x2a3de8){if(!_0x29a781['body'][_0x38ec('0x22')]){return handleError(_0x55dc16,0x1f4,{'message':_0x38ec('0x3a')});}var _0x561110=rs[_0x38ec('0x3b')]();_0x29a781[_0x38ec('0x3c')][_0x38ec('0x22')]=_0x29a781['body'][_0x38ec('0x22')][_0x38ec('0x3d')]()[_0x38ec('0x3e')]();var _0x228c8f;return db[_0x38ec('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x38ec('0x1a'),'blockDuration'],'raw':!![]})[_0x38ec('0xd')](function(_0x13e4da){_0x228c8f=_0x13e4da;return db[_0x38ec('0x3f')][_0x38ec('0x21')]({'where':{'email':_0x29a781[_0x38ec('0x3c')]['email']}});})['then'](function(_0x145c5f){if(!_0x145c5f){throw new Error(_0x38ec('0x40'));}if(_0x145c5f[_0x38ec('0x12')]){throw new Error(_0x38ec('0x41'));}if(_0x145c5f[_0x38ec('0x13')]){if(moment(_0x145c5f[_0x38ec('0x14')])[_0x38ec('0x1b')](_0x228c8f[_0x38ec('0xc')],_0x38ec('0x1c'))>moment()){throw new Error(_0x38ec('0x42'));}else{_0x145c5f[_0x38ec('0x13')]=![];_0x145c5f[_0x38ec('0x14')]=null;}}_0x145c5f[_0x38ec('0x43')]=_0x561110;_0x145c5f[_0x38ec('0x44')]=Date[_0x38ec('0x45')]()+0x36ee80;return _0x145c5f[_0x38ec('0x46')]();})['then'](function(){return sendServiceMail({'to':_0x29a781[_0x38ec('0x3c')][_0x38ec('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x38ec('0x47')+_0x29a781[_0x38ec('0x48')][_0x38ec('0x25')]+_0x38ec('0x49')+_0x561110+'\x0a\x0a'+_0x38ec('0x4a')});})['then'](function(){_0x55dc16[_0x38ec('0x33')](0xc8)[_0x38ec('0x34')]({'message':_0x38ec('0x4b')});})[_0x38ec('0x1f')](function(_0x8d4b5e){return handleError(_0x55dc16,0x1f4,_0x8d4b5e);});};exports[_0x38ec('0x4c')]=function(_0x5028d2,_0x5a953a,_0x2081a6){return db[_0x38ec('0x3f')][_0x38ec('0x21')]({'where':{'resetPasswordToken':_0x5028d2[_0x38ec('0x4d')][_0x38ec('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x38ec('0x45')]()}}})[_0x38ec('0xd')](function(_0x53317d){if(!_0x53317d){throw new Error(_0x38ec('0x4f'));}return db[_0x38ec('0xa')]['findOne']({'attributes':['id',_0x38ec('0x50'),'enforcePasswordHistory',_0x38ec('0x51')]})[_0x38ec('0xd')](function(_0xa76632){if(_0xa76632[_0x38ec('0x50')])authService[_0x38ec('0x52')](_0x5028d2[_0x38ec('0x3c')][_0x38ec('0xf')]);if(!_0xa76632['enforcePasswordHistory']||!_0x53317d[_0x38ec('0x53')])return _0x53317d;authService['validatePasswordHistory'](_0x5028d2[_0x38ec('0x3c')][_0x38ec('0xf')],_0x53317d[_0x38ec('0x53')],_0xa76632[_0x38ec('0x51')]);return _0x53317d;})[_0x38ec('0xd')](function(){_0x53317d[_0x38ec('0xf')]=_0x5028d2[_0x38ec('0x3c')]['password'];_0x53317d[_0x38ec('0x43')]=null;_0x53317d[_0x38ec('0x44')]=null;return _0x53317d[_0x38ec('0x46')]();});})[_0x38ec('0xd')](function(){_0x5a953a[_0x38ec('0x33')](0xc8)[_0x38ec('0x34')]({'message':_0x38ec('0x54')});})[_0x38ec('0x1f')](function(_0x3684de){return handleError(_0x5a953a,0x1f4,_0x3684de);});};passport[_0x38ec('0x55')](new LocalStrategy({'usernameField':_0x38ec('0xe'),'passwordField':_0x38ec('0xf')},function(_0x2b76b8,_0x5e5ee8,_0x397254){return localAuthenticate(db[_0x38ec('0x3f')],_0x2b76b8,_0x5e5ee8,_0x397254);})); \ No newline at end of file +var _0x8f12=['MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','forgot','Email\x20parameter\x20is\x20missing','body','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','save','Password\x20reset!','use','User','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email'];(function(_0x4720ae,_0x9938da){var _0x361af7=function(_0x1e24b8){while(--_0x1e24b8){_0x4720ae['push'](_0x4720ae['shift']());}};_0x361af7(++_0x9938da);}(_0x8f12,0x122));var _0x28f1=function(_0x578e76,_0x2047bb){_0x578e76=_0x578e76-0x0;var _0x26e58b=_0x8f12[_0x578e76];return _0x26e58b;};'use strict';var util=require('util');var passport=require(_0x28f1('0x0'));var LocalStrategy=require(_0x28f1('0x1'))[_0x28f1('0x2')];var jayson=require(_0x28f1('0x3'));var _=require(_0x28f1('0x4'));var rs=require(_0x28f1('0x5'));var moment=require(_0x28f1('0x6'));var db=require(_0x28f1('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x28f1('0x8'));var client=jayson[_0x28f1('0x9')][_0x28f1('0xa')]({'port':0x232b});function localAuthenticate(_0x447fdf,_0x105fb0,_0x3d1e33,_0x1304ea){var _0x305ca8,_0x536891;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),_0x28f1('0xe')],'raw':!![]})['then'](function(_0x26bbef){_0x305ca8=_0x26bbef;return _0x447fdf[_0x28f1('0xc')]({'attributes':['id','name',_0x28f1('0xf'),_0x28f1('0x10'),_0x28f1('0x11'),_0x28f1('0x12'),_0x28f1('0x13'),_0x28f1('0x14'),'loginAttempts'],'where':{'name':_0x105fb0,'role':{'$or':[_0x28f1('0x15'),'user',_0x28f1('0x16')]}}});})[_0x28f1('0x17')](function(_0x5875d0){if(!_0x5875d0||_0x5875d0&&_0x5875d0[_0x28f1('0x18')]!==_0x105fb0){throw new Error(_0x28f1('0x19'));}else{_0x536891=_0x5875d0;return _0x536891;}})[_0x28f1('0x17')](function(){_0x536891[_0x28f1('0x1a')](_0x3d1e33,function(_0x94bbe0,_0x259031){var _0x4c8432=_0x536891['loginAttempts']+0x1;if(_0x94bbe0){return _0x1304ea(_0x94bbe0);}else if(!_0x259031){if(_0x536891[_0x28f1('0x12')]){return _0x1304ea(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8[_0x28f1('0xe')]>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],'minutes')>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x4c8432>=_0x305ca8[_0x28f1('0xd')]){return utils[_0x28f1('0x1c')](_0x536891,0x0,!![],moment())[_0x28f1('0x17')](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x536891['disabled']){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8['blockDuration']>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],_0x28f1('0x1d'))>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)[_0x28f1('0x17')](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)['then'](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);})[_0x28f1('0x1f')](function(_0x2b260a){return _0x1304ea(null,![],_0x2b260a);});}}else{if(_0x536891[_0x28f1('0x13')]){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils['getLicense'](_0x536891)[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}}});})[_0x28f1('0x1f')](function(_0x3aa1a1){return _0x1304ea(null,![],_0x3aa1a1);});}function sendServiceMail(_0xdd00e0){return db[_0x28f1('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x28f1('0x18'),_0x28f1('0x21')],'include':[{'model':db[_0x28f1('0x22')],'as':'Smtp'}]})[_0x28f1('0x17')](function(_0x2453ff){if(!_0x2453ff){throw new Error(_0x28f1('0x23'));}var _0x72d83a={'tls':{'rejectUnauthorized':![]}};if(_0x2453ff['Smtp'][_0x28f1('0x24')]){_0x72d83a[_0x28f1('0x24')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x24')];}else{_0x72d83a[_0x28f1('0x26')]=_0x2453ff[_0x28f1('0x25')]['host'];_0x72d83a[_0x28f1('0x27')]=_0x2453ff['Smtp'][_0x28f1('0x27')];_0x72d83a[_0x28f1('0x28')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x28')];}if(_0x2453ff[_0x28f1('0x25')][_0x28f1('0x29')]){_0x72d83a[_0x28f1('0x2a')]={'user':_0x2453ff['Smtp']['user'],'pass':_0x2453ff['Smtp'][_0x28f1('0x2b')]};}var _0x3af1da={'account':_0x72d83a,'message':_[_0x28f1('0x2c')]({'from':util[_0x28f1('0x2d')]('\x22%s\x22\x20<%s>',_0x2453ff[_0x28f1('0x18')],_0x2453ff[_0x28f1('0x21')]||_0x2453ff[_0x28f1('0x25')][_0x28f1('0x2e')])},_0xdd00e0)};return client[_0x28f1('0x2f')]('SendMail',_0x3af1da);})[_0x28f1('0x17')](function(_0x18713d){if(_0x18713d[_0x28f1('0x30')]){throw new Error(util['format'](_0x28f1('0x31'),_0x18713d[_0x28f1('0x30')][_0x28f1('0x32')]||JSON[_0x28f1('0x33')](_0x18713d[_0x28f1('0x30')])));}return!![];});}function handleError(_0x521967,_0xdb49e,_0x160efb){return _0x521967[_0x28f1('0x34')](_0xdb49e||0x1f4)[_0x28f1('0x35')]({'message':_0x160efb?_0x160efb[_0x28f1('0x32')]||_0x160efb:''});}exports[_0x28f1('0x36')]=function(_0x9d4b88,_0x34ae41,_0x1ac46c){passport[_0x28f1('0x1a')]('local',function(_0x1a52c8,_0xbc9d9c,_0x189ac6){var _0x3774be=_0x1a52c8||_0x189ac6;if(_0x3774be){return handleError(_0x34ae41,0x191,_0x3774be);}if(!_0xbc9d9c){return handleError(_0x34ae41,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4e87ef={'payload':{'id':_0xbc9d9c['id'],'role':_0xbc9d9c[_0x28f1('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4e87ef)[_0x28f1('0x17')](function(_0x30a4b4){_0x34ae41['json']({'id':_0xbc9d9c['id'],'token':_0x30a4b4,'statusCall':'','isAlreadyLogged':_0xbc9d9c['online']});});}})(_0x9d4b88,_0x34ae41,_0x1ac46c);};exports[_0x28f1('0x37')]=function(_0x260d5c,_0x23eee6,_0x2e3ee0){if(!_0x260d5c['body'][_0x28f1('0x21')]){return handleError(_0x23eee6,0x1f4,{'message':_0x28f1('0x38')});}var _0x202bc1=rs['generate']();_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]=_0x260d5c['body'][_0x28f1('0x21')]['trim']()['toLowerCase']();var _0x1dd18b;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),'blockDuration'],'raw':!![]})[_0x28f1('0x17')](function(_0x3e6aaf){_0x1dd18b=_0x3e6aaf;return db['User']['find']({'where':{'email':_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]}});})[_0x28f1('0x17')](function(_0x4df28d){if(!_0x4df28d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4df28d[_0x28f1('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4df28d[_0x28f1('0x13')]){if(moment(_0x4df28d[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x1dd18b['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4df28d[_0x28f1('0x13')]=![];_0x4df28d[_0x28f1('0x14')]=null;}}_0x4df28d[_0x28f1('0x3a')]=_0x202bc1;_0x4df28d[_0x28f1('0x3b')]=Date['now']()+0x36ee80;return _0x4df28d['save']();})[_0x28f1('0x17')](function(){return sendServiceMail({'to':_0x260d5c[_0x28f1('0x39')]['email'],'subject':_0x28f1('0x3c'),'text':_0x28f1('0x3d')+_0x28f1('0x3e')+_0x28f1('0x3f')+_0x260d5c[_0x28f1('0x40')]['host']+'/reset/'+_0x202bc1+'\x0a\x0a'+_0x28f1('0x41')});})[_0x28f1('0x17')](function(){_0x23eee6[_0x28f1('0x34')](0xc8)['send']({'message':_0x28f1('0x42')});})['catch'](function(_0x58064a){return handleError(_0x23eee6,0x1f4,_0x58064a);});};exports[_0x28f1('0x43')]=function(_0x47dfb4,_0x1a8b40,_0x19eee8){return db['User'][_0x28f1('0x44')]({'where':{'resetPasswordToken':_0x47dfb4['params'][_0x28f1('0x45')],'resetPasswordExpires':{'$gt':Date[_0x28f1('0x46')]()}}})[_0x28f1('0x17')](function(_0x5ce06e){if(!_0x5ce06e){throw new Error(_0x28f1('0x47'));}return db[_0x28f1('0xb')]['findOne']({'attributes':['id',_0x28f1('0x48'),'enforcePasswordHistory',_0x28f1('0x49')]})[_0x28f1('0x17')](function(_0x360579){if(_0x360579[_0x28f1('0x48')])authService[_0x28f1('0x4a')](_0x47dfb4['body'][_0x28f1('0xf')]);if(!_0x360579[_0x28f1('0x4b')]||!_0x5ce06e[_0x28f1('0x4c')])return _0x5ce06e;authService['validatePasswordHistory'](_0x47dfb4[_0x28f1('0x39')]['password'],_0x5ce06e[_0x28f1('0x4c')],_0x360579['passwordHistoryLimit']);return _0x5ce06e;})[_0x28f1('0x17')](function(){_0x5ce06e[_0x28f1('0xf')]=_0x47dfb4[_0x28f1('0x39')]['password'];_0x5ce06e[_0x28f1('0x3a')]=null;_0x5ce06e[_0x28f1('0x3b')]=null;return _0x5ce06e[_0x28f1('0x4d')]();});})[_0x28f1('0x17')](function(){_0x1a8b40[_0x28f1('0x34')](0xc8)[_0x28f1('0x35')]({'message':_0x28f1('0x4e')});})[_0x28f1('0x1f')](function(_0x336c87){return handleError(_0x1a8b40,0x1f4,_0x336c87);});};passport[_0x28f1('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x34a66a,_0x1dda57,_0x35473d){return localAuthenticate(db[_0x28f1('0x50')],_0x34a66a,_0x1dda57,_0x35473d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 2526023..178c0ed 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 _0xde73=['./authLocal.controller','post','forgot','/reset/:token','reset','express'];(function(_0xaab2f5,_0x58463f){var _0x3b28ea=function(_0xcbc73c){while(--_0xcbc73c){_0xaab2f5['push'](_0xaab2f5['shift']());}};_0x3b28ea(++_0x58463f);}(_0xde73,0xd7));var _0x3de7=function(_0x270fbd,_0x3b7f49){_0x270fbd=_0x270fbd-0x0;var _0x7a6805=_0xde73[_0x270fbd];return _0x7a6805;};'use strict';var express=require(_0x3de7('0x0'));var router=express['Router']();var controller=require(_0x3de7('0x1'));router['post']('/',controller['login']);router[_0x3de7('0x2')]('/forgot',controller[_0x3de7('0x3')]);router[_0x3de7('0x2')](_0x3de7('0x4'),controller[_0x3de7('0x5')]);module['exports']=router; \ No newline at end of file +var _0x68b9=['login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x68b9,0x11c));var _0x968b=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x68b9[_0x38854e];return _0x3f8415;};'use strict';var express=require(_0x968b('0x0'));var router=express[_0x968b('0x1')]();var controller=require(_0x968b('0x2'));router[_0x968b('0x3')]('/',controller[_0x968b('0x4')]);router[_0x968b('0x3')](_0x968b('0x5'),controller['forgot']);router[_0x968b('0x3')](_0x968b('0x6'),controller[_0x968b('0x7')]);module[_0x968b('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f512b63..1030d9b 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 _0xa7ce=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2c77e7,_0x425ebb){var _0x51f485=function(_0x553eca){while(--_0x553eca){_0x2c77e7['push'](_0x2c77e7['shift']());}};_0x51f485(++_0x425ebb);}(_0xa7ce,0xd6));var _0xea7c=function(_0x4d3e27,_0x1bf288){_0x4d3e27=_0x4d3e27-0x0;var _0x20bab0=_0xa7ce[_0x4d3e27];return _0x20bab0;};'use strict';var Sequelize=require(_0xea7c('0x0'));module[_0xea7c('0x1')]={'name':{'type':Sequelize[_0xea7c('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xea7c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xea7c('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x4db5=['INTEGER','sequelize','exports','STRING'];(function(_0x141f75,_0x1711bb){var _0xcf3bd5=function(_0x6f9b95){while(--_0x6f9b95){_0x141f75['push'](_0x141f75['shift']());}};_0xcf3bd5(++_0x1711bb);}(_0x4db5,0x185));var _0x54db=function(_0x119d2b,_0x45f45e){_0x119d2b=_0x119d2b-0x0;var _0x3d94b8=_0x4db5[_0x119d2b];return _0x3d94b8;};'use strict';var Sequelize=require(_0x54db('0x0'));module[_0x54db('0x1')]={'name':{'type':Sequelize[_0x54db('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x54db('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x54db('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 037efba..9474ac6 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 _0xa6a5=['model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','params','keys','length','catch','body','find','destroy','addConditions','ids','findOne','Condition','getConditions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','name','send','index','map','Automation','rawAttributes','fieldName','type','key'];(function(_0x272ed6,_0x5893e6){var _0x303b0d=function(_0x3d4982){while(--_0x3d4982){_0x272ed6['push'](_0x272ed6['shift']());}};_0x303b0d(++_0x5893e6);}(_0xa6a5,0x78));var _0x5a6a=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xa6a5[_0x5466ab];return _0x40751a;};'use strict';var emlformat=require(_0x5a6a('0x0'));var rimraf=require(_0x5a6a('0x1'));var zipdir=require(_0x5a6a('0x2'));var jsonpatch=require(_0x5a6a('0x3'));var rp=require(_0x5a6a('0x4'));var moment=require(_0x5a6a('0x5'));var BPromise=require(_0x5a6a('0x6'));var Mustache=require(_0x5a6a('0x7'));var util=require(_0x5a6a('0x8'));var path=require('path');var sox=require(_0x5a6a('0x9'));var csv=require('to-csv');var ejs=require(_0x5a6a('0xa'));var fs=require('fs');var fs_extra=require(_0x5a6a('0xb'));var _=require(_0x5a6a('0xc'));var squel=require(_0x5a6a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a6a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5a6a('0xf'));var Papa=require(_0x5a6a('0x10'));var Redis=require(_0x5a6a('0x11'));var authService=require(_0x5a6a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a6a('0x13'));var hardwareService=require(_0x5a6a('0x14'));var logger=require(_0x5a6a('0x15'))(_0x5a6a('0x16'));var utils=require(_0x5a6a('0x17'));var config=require(_0x5a6a('0x18'));var licenseUtil=require(_0x5a6a('0x19'));var db=require(_0x5a6a('0x1a'))['db'];function respondWithStatusCode(_0x197f72,_0x5811f0){_0x5811f0=_0x5811f0||0xcc;return function(_0x1d1176){if(_0x1d1176){return _0x197f72['sendStatus'](_0x5811f0);}return _0x197f72[_0x5a6a('0x1b')](_0x5811f0)[_0x5a6a('0x1c')]();};}function respondWithResult(_0x4aabf5,_0x36f086){_0x36f086=_0x36f086||0xc8;return function(_0xf6bd16){if(_0xf6bd16){return _0x4aabf5[_0x5a6a('0x1b')](_0x36f086)['json'](_0xf6bd16);}};}function respondWithFilteredResult(_0x41ca3e,_0x14b3a8){return function(_0x27833a){if(_0x27833a){var _0x9c9326=typeof _0x14b3a8[_0x5a6a('0x1d')]===_0x5a6a('0x1e')&&typeof _0x14b3a8[_0x5a6a('0x1f')]===_0x5a6a('0x1e');var _0x217cb4=_0x27833a['count'];var _0x1fcdbf=_0x9c9326?0x0:_0x14b3a8['offset'];var _0x5e860b=_0x9c9326?_0x27833a['count']:_0x14b3a8[_0x5a6a('0x1d')]+_0x14b3a8[_0x5a6a('0x1f')];var _0x1556fe;if(_0x5e860b>=_0x217cb4){_0x5e860b=_0x217cb4;_0x1556fe=0xc8;}else{_0x1556fe=0xce;}_0x41ca3e['status'](_0x1556fe);return _0x41ca3e[_0x5a6a('0x20')](_0x5a6a('0x21'),_0x1fcdbf+'-'+_0x5e860b+'/'+_0x217cb4)[_0x5a6a('0x22')](_0x27833a);}return null;};}function patchUpdates(_0x4aaf43){return function(_0x5b290a){try{jsonpatch[_0x5a6a('0x23')](_0x5b290a,_0x4aaf43,!![]);}catch(_0x22d9cb){return BPromise[_0x5a6a('0x24')](_0x22d9cb);}return _0x5b290a[_0x5a6a('0x25')]();};}function saveUpdates(_0x28bb10,_0x48066e){return function(_0x3ba438){if(_0x3ba438){return _0x3ba438[_0x5a6a('0x26')](_0x28bb10)[_0x5a6a('0x27')](function(_0x5025fd){return _0x5025fd;});}return null;};}function removeEntity(_0x52d528,_0x25d1ff){return function(_0xa33241){if(_0xa33241){return _0xa33241['destroy']()[_0x5a6a('0x27')](function(){_0x52d528['status'](0xcc)[_0x5a6a('0x1c')]();});}};}function handleEntityNotFound(_0x8310a,_0x2aafb2){return function(_0x39ac95){if(!_0x39ac95){_0x8310a[_0x5a6a('0x28')](0x194);}return _0x39ac95;};}function handleError(_0x541e56,_0x3174ee){_0x3174ee=_0x3174ee||0x1f4;return function(_0xbae8f0){logger['error'](_0xbae8f0['stack']);if(_0xbae8f0['name']){delete _0xbae8f0[_0x5a6a('0x29')];}_0x541e56[_0x5a6a('0x1b')](_0x3174ee)[_0x5a6a('0x2a')](_0xbae8f0);};}exports[_0x5a6a('0x2b')]=function(_0x1d75c3,_0x261c9d){var _0x391455={},_0x4c3d52={},_0x45ff0c={'count':0x0,'rows':[]};var _0x1fda25=_[_0x5a6a('0x2c')](db[_0x5a6a('0x2d')][_0x5a6a('0x2e')],function(_0xd283f6){return{'name':_0xd283f6[_0x5a6a('0x2f')],'type':_0xd283f6[_0x5a6a('0x30')][_0x5a6a('0x31')]};});_0x4c3d52[_0x5a6a('0x32')]=_['map'](_0x1fda25,_0x5a6a('0x29'));_0x4c3d52[_0x5a6a('0x33')]=_['keys'](_0x1d75c3['query']);_0x4c3d52[_0x5a6a('0x34')]=_[_0x5a6a('0x35')](_0x4c3d52[_0x5a6a('0x32')],_0x4c3d52[_0x5a6a('0x33')]);_0x391455['attributes']=_[_0x5a6a('0x35')](_0x4c3d52[_0x5a6a('0x32')],qs[_0x5a6a('0x36')](_0x1d75c3[_0x5a6a('0x33')][_0x5a6a('0x36')]));_0x391455[_0x5a6a('0x37')]=_0x391455[_0x5a6a('0x37')]['length']?_0x391455[_0x5a6a('0x37')]:_0x4c3d52[_0x5a6a('0x32')];if(!_0x1d75c3['query'][_0x5a6a('0x38')](_0x5a6a('0x39'))){_0x391455[_0x5a6a('0x1f')]=qs[_0x5a6a('0x1f')](_0x1d75c3[_0x5a6a('0x33')][_0x5a6a('0x1f')]);_0x391455[_0x5a6a('0x1d')]=qs['offset'](_0x1d75c3['query'][_0x5a6a('0x1d')]);}_0x391455[_0x5a6a('0x3a')]=qs[_0x5a6a('0x3b')](_0x1d75c3[_0x5a6a('0x33')][_0x5a6a('0x3b')]);_0x391455['where']=qs[_0x5a6a('0x34')](_[_0x5a6a('0x3c')](_0x1d75c3['query'],_0x4c3d52[_0x5a6a('0x34')]),_0x1fda25);if(_0x1d75c3[_0x5a6a('0x33')][_0x5a6a('0x3d')]){_0x391455[_0x5a6a('0x3e')]=_[_0x5a6a('0x3f')](_0x391455['where'],{'$or':_[_0x5a6a('0x2c')](_0x1fda25,function(_0x39a19c){if(_0x39a19c[_0x5a6a('0x30')]!=='VIRTUAL'){var _0x53ce1d={};_0x53ce1d[_0x39a19c['name']]={'$like':'%'+_0x1d75c3['query'][_0x5a6a('0x3d')]+'%'};return _0x53ce1d;}})});}_0x391455=_[_0x5a6a('0x3f')]({},_0x391455,_0x1d75c3[_0x5a6a('0x40')]);var _0x150810={'where':_0x391455[_0x5a6a('0x3e')]};return db[_0x5a6a('0x2d')][_0x5a6a('0x41')](_0x150810)[_0x5a6a('0x27')](function(_0x5adae7){_0x45ff0c['count']=_0x5adae7;if(_0x1d75c3[_0x5a6a('0x33')][_0x5a6a('0x42')]){_0x391455[_0x5a6a('0x43')]=[{'all':!![]}];}return db[_0x5a6a('0x2d')][_0x5a6a('0x44')](_0x391455);})[_0x5a6a('0x27')](function(_0x37c586){_0x45ff0c[_0x5a6a('0x45')]=_0x37c586;return _0x45ff0c;})[_0x5a6a('0x27')](respondWithFilteredResult(_0x261c9d,_0x391455))['catch'](handleError(_0x261c9d,null));};exports['show']=function(_0x48410b,_0x23789a){var _0x5a4960={'raw':![],'where':{'id':_0x48410b[_0x5a6a('0x46')]['id']}},_0x33b8f1={};_0x33b8f1[_0x5a6a('0x32')]=_['keys'](db[_0x5a6a('0x2d')][_0x5a6a('0x2e')]);_0x33b8f1[_0x5a6a('0x33')]=_[_0x5a6a('0x47')](_0x48410b[_0x5a6a('0x33')]);_0x33b8f1['filters']=_[_0x5a6a('0x35')](_0x33b8f1[_0x5a6a('0x32')],_0x33b8f1[_0x5a6a('0x33')]);_0x5a4960[_0x5a6a('0x37')]=_[_0x5a6a('0x35')](_0x33b8f1[_0x5a6a('0x32')],qs['fields'](_0x48410b[_0x5a6a('0x33')][_0x5a6a('0x36')]));_0x5a4960[_0x5a6a('0x37')]=_0x5a4960[_0x5a6a('0x37')][_0x5a6a('0x48')]?_0x5a4960[_0x5a6a('0x37')]:_0x33b8f1['model'];if(_0x48410b['query'][_0x5a6a('0x42')]){_0x5a4960[_0x5a6a('0x43')]=[{'all':!![]}];}_0x5a4960=_[_0x5a6a('0x3f')]({},_0x5a4960,_0x48410b[_0x5a6a('0x40')]);return db['Automation']['find'](_0x5a4960)[_0x5a6a('0x27')](handleEntityNotFound(_0x23789a,null))[_0x5a6a('0x27')](respondWithResult(_0x23789a,null))[_0x5a6a('0x49')](handleError(_0x23789a,null));};exports['create']=function(_0x45d0cc,_0x52eb1a){return db[_0x5a6a('0x2d')]['create'](_0x45d0cc[_0x5a6a('0x4a')],{})['then'](respondWithResult(_0x52eb1a,0xc9))[_0x5a6a('0x49')](handleError(_0x52eb1a,null));};exports[_0x5a6a('0x26')]=function(_0x984be7,_0x3073c4){if(_0x984be7[_0x5a6a('0x4a')]['id']){delete _0x984be7['body']['id'];}return db[_0x5a6a('0x2d')][_0x5a6a('0x4b')]({'where':{'id':_0x984be7[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x3073c4,null))[_0x5a6a('0x27')](saveUpdates(_0x984be7['body'],null))['then'](respondWithResult(_0x3073c4,null))[_0x5a6a('0x49')](handleError(_0x3073c4,null));};exports[_0x5a6a('0x4c')]=function(_0x510c32,_0x52f562){return db[_0x5a6a('0x2d')][_0x5a6a('0x4b')]({'where':{'id':_0x510c32[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x52f562,null))[_0x5a6a('0x27')](removeEntity(_0x52f562,null))['catch'](handleError(_0x52f562,null));};exports['addConditions']=function(_0xe48822,_0x182e8b,_0x236965){return db['Condition'][_0x5a6a('0x4b')]({'where':{'id':_0xe48822[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x182e8b,null))['then'](function(_0xda233e){if(_0xda233e){return _0xda233e[_0x5a6a('0x4d')](_0xe48822[_0x5a6a('0x4a')][_0x5a6a('0x4e')],_['omit'](_0xe48822[_0x5a6a('0x4a')],[_0x5a6a('0x4e'),'id'])||{});}})[_0x5a6a('0x27')](respondWithResult(_0x182e8b,null))[_0x5a6a('0x49')](handleError(_0x182e8b,null));};exports['getConditions']=function(_0x598bc9,_0x37b2f8,_0x1c7bb4){var _0x1b3026={};var _0x1941b5={};var _0x552469;var _0x50d137;return db[_0x5a6a('0x2d')][_0x5a6a('0x4f')]({'where':{'id':_0x598bc9[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x37b2f8,null))['then'](function(_0x593012){if(_0x593012){_0x552469=_0x593012;_0x1941b5[_0x5a6a('0x32')]=_[_0x5a6a('0x47')](db[_0x5a6a('0x50')]['rawAttributes']);_0x1941b5[_0x5a6a('0x33')]=_[_0x5a6a('0x47')](_0x598bc9[_0x5a6a('0x33')]);_0x1941b5[_0x5a6a('0x34')]=_[_0x5a6a('0x35')](_0x1941b5[_0x5a6a('0x32')],_0x1941b5['query']);_0x1b3026[_0x5a6a('0x37')]=_[_0x5a6a('0x35')](_0x1941b5[_0x5a6a('0x32')],qs[_0x5a6a('0x36')](_0x598bc9[_0x5a6a('0x33')][_0x5a6a('0x36')]));_0x1b3026[_0x5a6a('0x37')]=_0x1b3026[_0x5a6a('0x37')][_0x5a6a('0x48')]?_0x1b3026['attributes']:_0x1941b5[_0x5a6a('0x32')];_0x1b3026[_0x5a6a('0x3a')]=qs['sort'](_0x598bc9['query'][_0x5a6a('0x3b')]);_0x1b3026[_0x5a6a('0x3e')]=qs[_0x5a6a('0x34')](_['pick'](_0x598bc9[_0x5a6a('0x33')],_0x1941b5[_0x5a6a('0x34')]));if(_0x598bc9[_0x5a6a('0x33')][_0x5a6a('0x3d')]){_0x1b3026['where']=_[_0x5a6a('0x3f')](_0x1b3026[_0x5a6a('0x3e')],{'$or':_[_0x5a6a('0x2c')](_0x1b3026[_0x5a6a('0x37')],function(_0x1f8ab9){var _0x432c90={};_0x432c90[_0x1f8ab9]={'$like':'%'+_0x598bc9[_0x5a6a('0x33')][_0x5a6a('0x3d')]+'%'};return _0x432c90;})});}_0x1b3026=_['merge']({},_0x1b3026,_0x598bc9[_0x5a6a('0x40')]);return _0x552469[_0x5a6a('0x51')](_0x1b3026);}})[_0x5a6a('0x27')](function(_0x1b19d2){if(_0x1b19d2){_0x50d137=_0x1b19d2[_0x5a6a('0x48')];if(!_0x598bc9[_0x5a6a('0x33')][_0x5a6a('0x38')](_0x5a6a('0x39'))){_0x1b3026['limit']=qs[_0x5a6a('0x1f')](_0x598bc9[_0x5a6a('0x33')][_0x5a6a('0x1f')]);_0x1b3026[_0x5a6a('0x1d')]=qs[_0x5a6a('0x1d')](_0x598bc9['query'][_0x5a6a('0x1d')]);}return _0x552469[_0x5a6a('0x51')](_0x1b3026);}})[_0x5a6a('0x27')](function(_0x5a278d){if(_0x5a278d){return _0x5a278d?{'count':_0x50d137,'rows':_0x5a278d}:null;}})[_0x5a6a('0x27')](respondWithResult(_0x37b2f8,null))[_0x5a6a('0x49')](handleError(_0x37b2f8,null));};exports['addActions']=function(_0x46647f,_0x53b5a5,_0x52df4a){return db[_0x5a6a('0x52')]['find']({'where':{'id':_0x46647f[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x53b5a5,null))['then'](function(_0x4d0301){if(_0x4d0301){return _0x4d0301['addActions'](_0x46647f['body'][_0x5a6a('0x4e')],_[_0x5a6a('0x53')](_0x46647f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x53b5a5,null))[_0x5a6a('0x49')](handleError(_0x53b5a5,null));};exports['getActions']=function(_0x3e8b99,_0x3abca5,_0x4b29ff){var _0x114ef1={};var _0x1b8f23={};var _0xc4564e;var _0x211f24;return db['Automation'][_0x5a6a('0x4f')]({'where':{'id':_0x3e8b99[_0x5a6a('0x46')]['id']}})[_0x5a6a('0x27')](handleEntityNotFound(_0x3abca5,null))[_0x5a6a('0x27')](function(_0x405875){if(_0x405875){_0xc4564e=_0x405875;_0x1b8f23[_0x5a6a('0x32')]=_[_0x5a6a('0x47')](db['Action'][_0x5a6a('0x2e')]);_0x1b8f23[_0x5a6a('0x33')]=_[_0x5a6a('0x47')](_0x3e8b99[_0x5a6a('0x33')]);_0x1b8f23[_0x5a6a('0x34')]=_['intersection'](_0x1b8f23[_0x5a6a('0x32')],_0x1b8f23['query']);_0x114ef1[_0x5a6a('0x37')]=_[_0x5a6a('0x35')](_0x1b8f23[_0x5a6a('0x32')],qs[_0x5a6a('0x36')](_0x3e8b99['query'][_0x5a6a('0x36')]));_0x114ef1[_0x5a6a('0x37')]=_0x114ef1['attributes'][_0x5a6a('0x48')]?_0x114ef1[_0x5a6a('0x37')]:_0x1b8f23['model'];_0x114ef1[_0x5a6a('0x3a')]=qs[_0x5a6a('0x3b')](_0x3e8b99[_0x5a6a('0x33')]['sort']);_0x114ef1['where']=qs[_0x5a6a('0x34')](_['pick'](_0x3e8b99['query'],_0x1b8f23[_0x5a6a('0x34')]));if(_0x3e8b99[_0x5a6a('0x33')]['filter']){_0x114ef1[_0x5a6a('0x3e')]=_['merge'](_0x114ef1[_0x5a6a('0x3e')],{'$or':_[_0x5a6a('0x2c')](_0x114ef1[_0x5a6a('0x37')],function(_0x5e0aee){var _0x4ef80b={};_0x4ef80b[_0x5e0aee]={'$like':'%'+_0x3e8b99[_0x5a6a('0x33')][_0x5a6a('0x3d')]+'%'};return _0x4ef80b;})});}_0x114ef1=_[_0x5a6a('0x3f')]({},_0x114ef1,_0x3e8b99[_0x5a6a('0x40')]);return _0xc4564e[_0x5a6a('0x54')](_0x114ef1);}})[_0x5a6a('0x27')](function(_0x3fddac){if(_0x3fddac){_0x211f24=_0x3fddac[_0x5a6a('0x48')];if(!_0x3e8b99[_0x5a6a('0x33')][_0x5a6a('0x38')](_0x5a6a('0x39'))){_0x114ef1[_0x5a6a('0x1f')]=qs[_0x5a6a('0x1f')](_0x3e8b99[_0x5a6a('0x33')][_0x5a6a('0x1f')]);_0x114ef1[_0x5a6a('0x1d')]=qs['offset'](_0x3e8b99[_0x5a6a('0x33')][_0x5a6a('0x1d')]);}return _0xc4564e['getActions'](_0x114ef1);}})[_0x5a6a('0x27')](function(_0x25ec6d){if(_0x25ec6d){return _0x25ec6d?{'count':_0x211f24,'rows':_0x25ec6d}:null;}})[_0x5a6a('0x27')](respondWithResult(_0x3abca5,null))[_0x5a6a('0x49')](handleError(_0x3abca5,null));}; \ No newline at end of file +var _0x2594=['sort','where','filter','merge','type','VIRTUAL','options','Automation','include','findAll','catch','show','rawAttributes','includeAll','create','body','update','find','params','destroy','addConditions','Condition','ids','getConditions','findOne','pick','nolimit','Action','addActions','omit','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','fieldName','key','query','keys','filters','intersection','fields','attributes','length','model','order'];(function(_0x41e039,_0x1c2b1f){var _0x13757b=function(_0x147ae3){while(--_0x147ae3){_0x41e039['push'](_0x41e039['shift']());}};_0x13757b(++_0x1c2b1f);}(_0x2594,0x119));var _0x4259=function(_0x51e8da,_0x540e25){_0x51e8da=_0x51e8da-0x0;var _0x12c3f2=_0x2594[_0x51e8da];return _0x12c3f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4259('0x0'));var zipdir=require(_0x4259('0x1'));var jsonpatch=require(_0x4259('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4259('0x3'));var util=require(_0x4259('0x4'));var path=require('path');var sox=require(_0x4259('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4259('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4259('0x7'));var deskjs=require(_0x4259('0x8'));var toCsv=require(_0x4259('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4259('0xa'));var authService=require(_0x4259('0xb'));var qs=require(_0x4259('0xc'));var as=require(_0x4259('0xd'));var hardwareService=require(_0x4259('0xe'));var logger=require(_0x4259('0xf'))(_0x4259('0x10'));var utils=require(_0x4259('0x11'));var config=require(_0x4259('0x12'));var licenseUtil=require(_0x4259('0x13'));var db=require(_0x4259('0x14'))['db'];function respondWithStatusCode(_0x244268,_0x5530b7){_0x5530b7=_0x5530b7||0xcc;return function(_0x5d496){if(_0x5d496){return _0x244268[_0x4259('0x15')](_0x5530b7);}return _0x244268[_0x4259('0x16')](_0x5530b7)['end']();};}function respondWithResult(_0x83ecf,_0x28fb2b){_0x28fb2b=_0x28fb2b||0xc8;return function(_0x2f8f1e){if(_0x2f8f1e){return _0x83ecf[_0x4259('0x16')](_0x28fb2b)['json'](_0x2f8f1e);}};}function respondWithFilteredResult(_0x2947db,_0x1a08ca){return function(_0x5ce302){if(_0x5ce302){var _0x4166ab=typeof _0x1a08ca[_0x4259('0x17')]==='undefined'&&typeof _0x1a08ca[_0x4259('0x18')]===_0x4259('0x19');var _0x255e02=_0x5ce302[_0x4259('0x1a')];var _0x4a131e=_0x4166ab?0x0:_0x1a08ca[_0x4259('0x17')];var _0x22c04c=_0x4166ab?_0x5ce302['count']:_0x1a08ca[_0x4259('0x17')]+_0x1a08ca[_0x4259('0x18')];var _0x33edee;if(_0x22c04c>=_0x255e02){_0x22c04c=_0x255e02;_0x33edee=0xc8;}else{_0x33edee=0xce;}_0x2947db[_0x4259('0x16')](_0x33edee);return _0x2947db[_0x4259('0x1b')](_0x4259('0x1c'),_0x4a131e+'-'+_0x22c04c+'/'+_0x255e02)[_0x4259('0x1d')](_0x5ce302);}return null;};}function patchUpdates(_0x3dd6f8){return function(_0x419b51){try{jsonpatch[_0x4259('0x1e')](_0x419b51,_0x3dd6f8,!![]);}catch(_0x391ff5){return BPromise[_0x4259('0x1f')](_0x391ff5);}return _0x419b51[_0x4259('0x20')]();};}function saveUpdates(_0x466c58,_0x22a182){return function(_0x3e0727){if(_0x3e0727){return _0x3e0727['update'](_0x466c58)['then'](function(_0x2867d1){return _0x2867d1;});}return null;};}function removeEntity(_0x2dba49,_0x37ee4b){return function(_0x42825a){if(_0x42825a){return _0x42825a['destroy']()[_0x4259('0x21')](function(){_0x2dba49[_0x4259('0x16')](0xcc)[_0x4259('0x22')]();});}};}function handleEntityNotFound(_0x20f236,_0x10be66){return function(_0x50b4ee){if(!_0x50b4ee){_0x20f236[_0x4259('0x15')](0x194);}return _0x50b4ee;};}function handleError(_0x46083b,_0x92d306){_0x92d306=_0x92d306||0x1f4;return function(_0x481323){logger[_0x4259('0x23')](_0x481323[_0x4259('0x24')]);if(_0x481323[_0x4259('0x25')]){delete _0x481323['name'];}_0x46083b[_0x4259('0x16')](_0x92d306)[_0x4259('0x26')](_0x481323);};}exports[_0x4259('0x27')]=function(_0x46ea4b,_0x435f0a){var _0x2f93ff={},_0x56843a={},_0x2971c0={'count':0x0,'rows':[]};var _0x1f80f8=_['map'](db['Automation']['rawAttributes'],function(_0x507f51){return{'name':_0x507f51[_0x4259('0x28')],'type':_0x507f51['type'][_0x4259('0x29')]};});_0x56843a['model']=_['map'](_0x1f80f8,_0x4259('0x25'));_0x56843a[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x46ea4b[_0x4259('0x2a')]);_0x56843a[_0x4259('0x2c')]=_['intersection'](_0x56843a['model'],_0x56843a['query']);_0x2f93ff['attributes']=_[_0x4259('0x2d')](_0x56843a['model'],qs[_0x4259('0x2e')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x2e')]));_0x2f93ff['attributes']=_0x2f93ff[_0x4259('0x2f')][_0x4259('0x30')]?_0x2f93ff[_0x4259('0x2f')]:_0x56843a[_0x4259('0x31')];if(!_0x46ea4b[_0x4259('0x2a')]['hasOwnProperty']('nolimit')){_0x2f93ff[_0x4259('0x18')]=qs['limit'](_0x46ea4b['query']['limit']);_0x2f93ff[_0x4259('0x17')]=qs[_0x4259('0x17')](_0x46ea4b[_0x4259('0x2a')]['offset']);}_0x2f93ff[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x33')]);_0x2f93ff[_0x4259('0x34')]=qs[_0x4259('0x2c')](_['pick'](_0x46ea4b[_0x4259('0x2a')],_0x56843a[_0x4259('0x2c')]),_0x1f80f8);if(_0x46ea4b[_0x4259('0x2a')][_0x4259('0x35')]){_0x2f93ff[_0x4259('0x34')]=_[_0x4259('0x36')](_0x2f93ff[_0x4259('0x34')],{'$or':_['map'](_0x1f80f8,function(_0x865b3a){if(_0x865b3a[_0x4259('0x37')]!==_0x4259('0x38')){var _0xdf39a4={};_0xdf39a4[_0x865b3a[_0x4259('0x25')]]={'$like':'%'+_0x46ea4b[_0x4259('0x2a')]['filter']+'%'};return _0xdf39a4;}})});}_0x2f93ff=_['merge']({},_0x2f93ff,_0x46ea4b[_0x4259('0x39')]);var _0x5a9ef0={'where':_0x2f93ff[_0x4259('0x34')]};return db[_0x4259('0x3a')][_0x4259('0x1a')](_0x5a9ef0)[_0x4259('0x21')](function(_0x326d0f){_0x2971c0['count']=_0x326d0f;if(_0x46ea4b[_0x4259('0x2a')]['includeAll']){_0x2f93ff[_0x4259('0x3b')]=[{'all':!![]}];}return db[_0x4259('0x3a')][_0x4259('0x3c')](_0x2f93ff);})['then'](function(_0x6f22d9){_0x2971c0['rows']=_0x6f22d9;return _0x2971c0;})[_0x4259('0x21')](respondWithFilteredResult(_0x435f0a,_0x2f93ff))[_0x4259('0x3d')](handleError(_0x435f0a,null));};exports[_0x4259('0x3e')]=function(_0x597e8c,_0x2c8deb){var _0x179489={'raw':![],'where':{'id':_0x597e8c['params']['id']}},_0x43aceb={};_0x43aceb[_0x4259('0x31')]=_[_0x4259('0x2b')](db[_0x4259('0x3a')][_0x4259('0x3f')]);_0x43aceb[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x597e8c[_0x4259('0x2a')]);_0x43aceb[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],_0x43aceb[_0x4259('0x2a')]);_0x179489[_0x4259('0x2f')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x597e8c[_0x4259('0x2a')]['fields']));_0x179489[_0x4259('0x2f')]=_0x179489['attributes'][_0x4259('0x30')]?_0x179489[_0x4259('0x2f')]:_0x43aceb['model'];if(_0x597e8c[_0x4259('0x2a')][_0x4259('0x40')]){_0x179489[_0x4259('0x3b')]=[{'all':!![]}];}_0x179489=_[_0x4259('0x36')]({},_0x179489,_0x597e8c[_0x4259('0x39')]);return db[_0x4259('0x3a')]['find'](_0x179489)['then'](handleEntityNotFound(_0x2c8deb,null))[_0x4259('0x21')](respondWithResult(_0x2c8deb,null))[_0x4259('0x3d')](handleError(_0x2c8deb,null));};exports[_0x4259('0x41')]=function(_0x141f2c,_0x37a134){return db[_0x4259('0x3a')][_0x4259('0x41')](_0x141f2c[_0x4259('0x42')],{})[_0x4259('0x21')](respondWithResult(_0x37a134,0xc9))[_0x4259('0x3d')](handleError(_0x37a134,null));};exports[_0x4259('0x43')]=function(_0x28376a,_0x39c0f2){if(_0x28376a[_0x4259('0x42')]['id']){delete _0x28376a['body']['id'];}return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x28376a[_0x4259('0x45')]['id']}})['then'](handleEntityNotFound(_0x39c0f2,null))[_0x4259('0x21')](saveUpdates(_0x28376a[_0x4259('0x42')],null))['then'](respondWithResult(_0x39c0f2,null))[_0x4259('0x3d')](handleError(_0x39c0f2,null));};exports[_0x4259('0x46')]=function(_0x5bad6e,_0x1b15e2){return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x5bad6e[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1b15e2,null))[_0x4259('0x21')](removeEntity(_0x1b15e2,null))[_0x4259('0x3d')](handleError(_0x1b15e2,null));};exports[_0x4259('0x47')]=function(_0x46b386,_0x4a8cf2,_0x832fe4){return db[_0x4259('0x48')][_0x4259('0x44')]({'where':{'id':_0x46b386['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x4a8cf2,null))[_0x4259('0x21')](function(_0x43717d){if(_0x43717d){return _0x43717d[_0x4259('0x47')](_0x46b386['body'][_0x4259('0x49')],_['omit'](_0x46b386[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})[_0x4259('0x21')](respondWithResult(_0x4a8cf2,null))[_0x4259('0x3d')](handleError(_0x4a8cf2,null));};exports[_0x4259('0x4a')]=function(_0x3ac55d,_0x3970d3,_0x2252ac){var _0x38dbbe={};var _0x5576b1={};var _0x3a91b8;var _0x91af58;return db['Automation'][_0x4259('0x4b')]({'where':{'id':_0x3ac55d[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x3970d3,null))['then'](function(_0x588509){if(_0x588509){_0x3a91b8=_0x588509;_0x5576b1[_0x4259('0x31')]=_['keys'](db[_0x4259('0x48')][_0x4259('0x3f')]);_0x5576b1[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x3ac55d[_0x4259('0x2a')]);_0x5576b1[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x5576b1[_0x4259('0x31')],_0x5576b1[_0x4259('0x2a')]);_0x38dbbe[_0x4259('0x2f')]=_['intersection'](_0x5576b1[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x2e')]));_0x38dbbe[_0x4259('0x2f')]=_0x38dbbe[_0x4259('0x2f')]['length']?_0x38dbbe[_0x4259('0x2f')]:_0x5576b1[_0x4259('0x31')];_0x38dbbe[_0x4259('0x32')]=qs['sort'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x33')]);_0x38dbbe[_0x4259('0x34')]=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x3ac55d[_0x4259('0x2a')],_0x5576b1[_0x4259('0x2c')]));if(_0x3ac55d['query']['filter']){_0x38dbbe[_0x4259('0x34')]=_[_0x4259('0x36')](_0x38dbbe[_0x4259('0x34')],{'$or':_['map'](_0x38dbbe['attributes'],function(_0x3cefc3){var _0x416c67={};_0x416c67[_0x3cefc3]={'$like':'%'+_0x3ac55d[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x416c67;})});}_0x38dbbe=_[_0x4259('0x36')]({},_0x38dbbe,_0x3ac55d['options']);return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x573860){if(_0x573860){_0x91af58=_0x573860[_0x4259('0x30')];if(!_0x3ac55d[_0x4259('0x2a')]['hasOwnProperty'](_0x4259('0x4d'))){_0x38dbbe['limit']=qs['limit'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x18')]);_0x38dbbe[_0x4259('0x17')]=qs['offset'](_0x3ac55d['query'][_0x4259('0x17')]);}return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x51d118){if(_0x51d118){return _0x51d118?{'count':_0x91af58,'rows':_0x51d118}:null;}})[_0x4259('0x21')](respondWithResult(_0x3970d3,null))[_0x4259('0x3d')](handleError(_0x3970d3,null));};exports['addActions']=function(_0x9accce,_0x1ef384,_0x218649){return db[_0x4259('0x4e')][_0x4259('0x44')]({'where':{'id':_0x9accce['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1ef384,null))[_0x4259('0x21')](function(_0x1f49dd){if(_0x1f49dd){return _0x1f49dd[_0x4259('0x4f')](_0x9accce['body'][_0x4259('0x49')],_[_0x4259('0x50')](_0x9accce[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})['then'](respondWithResult(_0x1ef384,null))[_0x4259('0x3d')](handleError(_0x1ef384,null));};exports[_0x4259('0x51')]=function(_0x37cf94,_0x59a99c,_0x38e9ea){var _0xff5986={};var _0x2054b9={};var _0xd4656;var _0x2d5ecf;return db[_0x4259('0x3a')][_0x4259('0x4b')]({'where':{'id':_0x37cf94['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x59a99c,null))[_0x4259('0x21')](function(_0x346882){if(_0x346882){_0xd4656=_0x346882;_0x2054b9['model']=_[_0x4259('0x2b')](db[_0x4259('0x4e')][_0x4259('0x3f')]);_0x2054b9[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x37cf94['query']);_0x2054b9['filters']=_[_0x4259('0x2d')](_0x2054b9[_0x4259('0x31')],_0x2054b9[_0x4259('0x2a')]);_0xff5986[_0x4259('0x2f')]=_['intersection'](_0x2054b9[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x37cf94['query']['fields']));_0xff5986['attributes']=_0xff5986[_0x4259('0x2f')]['length']?_0xff5986[_0x4259('0x2f')]:_0x2054b9[_0x4259('0x31')];_0xff5986[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x37cf94['query']['sort']);_0xff5986['where']=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x37cf94[_0x4259('0x2a')],_0x2054b9['filters']));if(_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]){_0xff5986[_0x4259('0x34')]=_[_0x4259('0x36')](_0xff5986[_0x4259('0x34')],{'$or':_['map'](_0xff5986[_0x4259('0x2f')],function(_0x3cda2a){var _0x3c836e={};_0x3c836e[_0x3cda2a]={'$like':'%'+_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x3c836e;})});}_0xff5986=_[_0x4259('0x36')]({},_0xff5986,_0x37cf94[_0x4259('0x39')]);return _0xd4656['getActions'](_0xff5986);}})[_0x4259('0x21')](function(_0x5885dd){if(_0x5885dd){_0x2d5ecf=_0x5885dd[_0x4259('0x30')];if(!_0x37cf94[_0x4259('0x2a')][_0x4259('0x52')](_0x4259('0x4d'))){_0xff5986[_0x4259('0x18')]=qs['limit'](_0x37cf94[_0x4259('0x2a')][_0x4259('0x18')]);_0xff5986['offset']=qs['offset'](_0x37cf94[_0x4259('0x2a')]['offset']);}return _0xd4656[_0x4259('0x51')](_0xff5986);}})[_0x4259('0x21')](function(_0x11bb8a){if(_0x11bb8a){return _0x11bb8a?{'count':_0x2d5ecf,'rows':_0x11bb8a}:null;}})['then'](respondWithResult(_0x59a99c,null))['catch'](handleError(_0x59a99c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b18deeb..e83d51c 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 _0x3c05=['moment','bluebird','request-promise','path','exports','define','Automation','util','../../config/logger'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x3c05,0x127));var _0x53c0=function(_0x3a89bb,_0x46da0e){_0x3a89bb=_0x3a89bb-0x0;var _0x228363=_0x3c05[_0x3a89bb];return _0x228363;};'use strict';var _=require('lodash');var util=require(_0x53c0('0x0'));var logger=require(_0x53c0('0x1'))('api');var moment=require(_0x53c0('0x2'));var BPromise=require(_0x53c0('0x3'));var rp=require(_0x53c0('0x4'));var fs=require('fs');var path=require(_0x53c0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x53c0('0x6')]=function(_0x5d6a93,_0x502f86){return _0x5d6a93[_0x53c0('0x7')](_0x53c0('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f6c=['path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x528023,_0x150351){var _0x20ed46=function(_0x4323fd){while(--_0x4323fd){_0x528023['push'](_0x528023['shift']());}};_0x20ed46(++_0x150351);}(_0x9f6c,0x1cf));var _0xc9f6=function(_0x501427,_0x3f9bc0){_0x501427=_0x501427-0x0;var _0x492f1d=_0x9f6c[_0x501427];return _0x492f1d;};'use strict';var _=require(_0xc9f6('0x0'));var util=require(_0xc9f6('0x1'));var logger=require(_0xc9f6('0x2'))(_0xc9f6('0x3'));var moment=require('moment');var BPromise=require(_0xc9f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9f6('0x5'));var rimraf=require(_0xc9f6('0x6'));var config=require(_0xc9f6('0x7'));var attributes=require(_0xc9f6('0x8'));module[_0xc9f6('0x9')]=function(_0x1f5fb8,_0x1e115d){return _0x1f5fb8['define'](_0xc9f6('0xa'),attributes,{'tableName':_0xc9f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d5ca4f8..5575eee 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 _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s'];(function(_0x95f602,_0xf70ef2){var _0x15cdd5=function(_0x5287f2){while(--_0x5287f2){_0x95f602['push'](_0x95f602['shift']());}};_0x15cdd5(++_0xf70ef2);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('Automation,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('Automation,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});} \ No newline at end of file +var _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x21b0d8,_0x1334ee){var _0x2e6f6a=function(_0x3dff3d){while(--_0x3dff3d){_0x21b0d8['push'](_0x21b0d8['shift']());}};_0x2e6f6a(++_0x1334ee);}(_0x3014,0x1d7));var _0x4301=function(_0x43a2fc,_0x589e0e){_0x43a2fc=_0x43a2fc-0x0;var _0x487ba1=_0x3014[_0x43a2fc];return _0x487ba1;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 89a9dab..3ee0cfe 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 _0xc5ba=['get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x2d0d68,_0x11e7ab){var _0xb8b405=function(_0x505fe6){while(--_0x505fe6){_0x2d0d68['push'](_0x2d0d68['shift']());}};_0xb8b405(++_0x11e7ab);}(_0xc5ba,0xb9));var _0xac5b=function(_0xbc550a,_0x2bb605){_0xbc550a=_0xbc550a-0x0;var _0xd16ba4=_0xc5ba[_0xbc550a];return _0xd16ba4;};'use strict';var multer=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var path=require(_0xac5b('0x2'));var timeout=require(_0xac5b('0x3'));var express=require(_0xac5b('0x4'));var router=express[_0xac5b('0x5')]();var fs_extra=require(_0xac5b('0x6'));var auth=require(_0xac5b('0x7'));var interaction=require(_0xac5b('0x8'));var config=require(_0xac5b('0x9'));var controller=require(_0xac5b('0xa'));router[_0xac5b('0xb')]('/',auth[_0xac5b('0xc')](),controller[_0xac5b('0xd')]);router[_0xac5b('0xb')](_0xac5b('0xe'),auth[_0xac5b('0xc')](),controller['show']);router['get'](_0xac5b('0xf'),auth['isAuthenticated'](),controller[_0xac5b('0x10')]);router[_0xac5b('0xb')](_0xac5b('0x11'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x12')]);router[_0xac5b('0x13')]('/',auth[_0xac5b('0xc')](),controller[_0xac5b('0x14')]);router[_0xac5b('0x13')]('/:id/conditions',auth[_0xac5b('0xc')](),controller[_0xac5b('0x15')]);router[_0xac5b('0x13')](_0xac5b('0x11'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x16')]);router[_0xac5b('0x17')](_0xac5b('0xe'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x18')]);router[_0xac5b('0x19')](_0xac5b('0xe'),auth['isAuthenticated'](),controller[_0xac5b('0x1a')]);module[_0xac5b('0x1b')]=router; \ No newline at end of file +var _0xdcd0=['create','addConditions','post','addActions','update','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0xb935b1,_0x54ed60){var _0x2bd5ce=function(_0x18f61a){while(--_0x18f61a){_0xb935b1['push'](_0xb935b1['shift']());}};_0x2bd5ce(++_0x54ed60);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x2f2bac,_0x24a1da){_0x2f2bac=_0x2f2bac-0x0;var _0x3a4c06=_0xdcd0[_0x2f2bac];return _0x3a4c06;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require('util');var path=require(_0x0dcd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0dcd('0x2')]();var fs_extra=require(_0x0dcd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0dcd('0x4'));var config=require(_0x0dcd('0x5'));var controller=require(_0x0dcd('0x6'));router['get']('/',auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x8')]);router[_0x0dcd('0x9')](_0x0dcd('0xa'),auth['isAuthenticated'](),controller[_0x0dcd('0xb')]);router[_0x0dcd('0x9')](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0xd')]);router['get'](_0x0dcd('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0dcd('0xf')]);router['post'](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x10')]);router[_0x0dcd('0x11')](_0x0dcd('0xe'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0dcd('0x13')]);router['delete']('/:id',auth[_0x0dcd('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8361513..67c9a69 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 _0x9b10=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','INTEGER','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','UNSIGNED','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)'];(function(_0x48c950,_0x49c22d){var _0x45d54=function(_0x376368){while(--_0x376368){_0x48c950['push'](_0x48c950['shift']());}};_0x45d54(++_0x49c22d);}(_0x9b10,0x18e));var _0x09b1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9b10[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x09b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x09b1('0x1')],'unique':_0x09b1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x09b1('0x3')](_0x09b1('0x4')),'allowNull':![],'defaultValue':_0x09b1('0x4')},'description':{'type':Sequelize[_0x09b1('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x09b1('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x09b1('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x09b1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x09b1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x09b1('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09b1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09b1('0x8')],'defaultValue':0x3,'comment':_0x09b1('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x09b1('0xe')},'dialTimezone':{'type':Sequelize[_0x09b1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x09b1('0x1')],'defaultValue':_0x09b1('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x09b1('0x3')]('always',_0x09b1('0x10'),_0x09b1('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x09b1('0x12')],'defaultValue':0x0,'comment':_0x09b1('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x09b1('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x09b1('0x5')](0x9)[_0x09b1('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x09b1('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x09b1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x09b1('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x09b1('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x09b1('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x09b1('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x09b1('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x09b1('0x5')](0x9)[_0x09b1('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x09b1('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x09b1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x09b1('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x09b1('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x09b1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x09b1('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x09b1('0x1d'),_0x09b1('0x1e')),'defaultValue':_0x09b1('0x1d')},'dialPrefix':{'type':Sequelize[_0x09b1('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09b1('0x1f')},'dialCutDigit':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09b1('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x09b1('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x09b1('0x5')](0x3)[_0x09b1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b1('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x09b1('0x5')](0x5)[_0x09b1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b1('0x28')}}; \ No newline at end of file +var _0x2ddd=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x1a379b,_0x507552){var _0x385502=function(_0x32491b){while(--_0x32491b){_0x1a379b['push'](_0x1a379b['shift']());}};_0x385502(++_0x507552);}(_0x2ddd,0x197));var _0xd2dd=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x2ddd[_0x5a7d5f];return _0x5dcded;};'use strict';var Sequelize=require(_0xd2dd('0x0'));module[_0xd2dd('0x1')]={'name':{'type':Sequelize[_0xd2dd('0x2')],'unique':_0xd2dd('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd2dd('0x4')),'allowNull':![],'defaultValue':_0xd2dd('0x4')},'description':{'type':Sequelize[_0xd2dd('0x2')]},'active':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':_0xd2dd('0x6')},'limitCalls':{'type':Sequelize[_0xd2dd('0x7')](0x4)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd2dd('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd2dd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd2dd('0xe')},'dialTimezone':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':_0xd2dd('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x11'),_0xd2dd('0x12'),_0xd2dd('0x13')),'defaultValue':_0xd2dd('0x11')},'dialAMDActive':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd2dd('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd2dd('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd2dd('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd2dd('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd2dd('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd2dd('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd2dd('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x1b'),_0xd2dd('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd2dd('0x1d')},'dialCutDigit':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index f030b28..850c1c9 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 _0x52d1=['omit','createdAt','updatedAt','user','userProfileId','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','ContactId','ListId','field','phone','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','includeAll'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x52d1,0xbd));var _0x152d=function(_0x130baa,_0x590547){_0x130baa=_0x130baa-0x0;var _0x480d32=_0x52d1[_0x130baa];return _0x480d32;};'use strict';var emlformat=require(_0x152d('0x0'));var rimraf=require(_0x152d('0x1'));var zipdir=require(_0x152d('0x2'));var jsonpatch=require(_0x152d('0x3'));var rp=require(_0x152d('0x4'));var moment=require(_0x152d('0x5'));var BPromise=require(_0x152d('0x6'));var Mustache=require(_0x152d('0x7'));var util=require(_0x152d('0x8'));var path=require('path');var sox=require(_0x152d('0x9'));var csv=require(_0x152d('0xa'));var ejs=require(_0x152d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x152d('0xc'));var crypto=require('crypto');var jsforce=require(_0x152d('0xd'));var deskjs=require(_0x152d('0xe'));var toCsv=require(_0x152d('0xa'));var querystring=require(_0x152d('0xf'));var Papa=require(_0x152d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x152d('0x11'));var as=require(_0x152d('0x12'));var hardwareService=require(_0x152d('0x13'));var logger=require(_0x152d('0x14'))(_0x152d('0x15'));var utils=require(_0x152d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x152d('0x17'));var db=require(_0x152d('0x18'))['db'];function respondWithStatusCode(_0x42664f,_0x48daa4){_0x48daa4=_0x48daa4||0xcc;return function(_0x33fcca){if(_0x33fcca){return _0x42664f[_0x152d('0x19')](_0x48daa4);}return _0x42664f[_0x152d('0x1a')](_0x48daa4)['end']();};}function respondWithResult(_0x24e8b9,_0x20656a){_0x20656a=_0x20656a||0xc8;return function(_0x4f5c6d){if(_0x4f5c6d){return _0x24e8b9[_0x152d('0x1a')](_0x20656a)[_0x152d('0x1b')](_0x4f5c6d);}};}function respondWithFilteredResult(_0x1f7cf8,_0x3c7997){return function(_0x27e995){if(_0x27e995){var _0x36f7fb=typeof _0x3c7997[_0x152d('0x1c')]==='undefined'&&typeof _0x3c7997[_0x152d('0x1d')]===_0x152d('0x1e');var _0x10ad78=_0x27e995[_0x152d('0x1f')];var _0x5210db=_0x36f7fb?0x0:_0x3c7997['offset'];var _0x836054=_0x36f7fb?_0x27e995[_0x152d('0x1f')]:_0x3c7997[_0x152d('0x1c')]+_0x3c7997[_0x152d('0x1d')];var _0x46d73c;if(_0x836054>=_0x10ad78){_0x836054=_0x10ad78;_0x46d73c=0xc8;}else{_0x46d73c=0xce;}_0x1f7cf8[_0x152d('0x1a')](_0x46d73c);return _0x1f7cf8['set']('Content-Range',_0x5210db+'-'+_0x836054+'/'+_0x10ad78)[_0x152d('0x1b')](_0x27e995);}return null;};}function patchUpdates(_0x21a54c){return function(_0x497ba2){try{jsonpatch[_0x152d('0x20')](_0x497ba2,_0x21a54c,!![]);}catch(_0x36225b){return BPromise[_0x152d('0x21')](_0x36225b);}return _0x497ba2[_0x152d('0x22')]();};}function saveUpdates(_0x4cf800,_0x9df752){return function(_0x278087){if(_0x278087){return _0x278087['update'](_0x4cf800)[_0x152d('0x23')](function(_0x354749){return _0x354749;});}return null;};}function removeEntity(_0x129775,_0x561c84){return function(_0x376672){if(_0x376672){return _0x376672[_0x152d('0x24')]()[_0x152d('0x23')](function(){var _0x204237=_0x376672[_0x152d('0x25')]({'plain':!![]});var _0xa6651c=_0x152d('0x26');return db[_0x152d('0x27')][_0x152d('0x24')]({'where':{'type':_0xa6651c,'resourceId':_0x204237['id']}})[_0x152d('0x23')](function(){return _0x376672;});})['then'](function(){_0x129775[_0x152d('0x1a')](0xcc)[_0x152d('0x28')]();});}};}function handleEntityNotFound(_0x433218,_0xdf248e){return function(_0x452770){if(!_0x452770){_0x433218[_0x152d('0x19')](0x194);}return _0x452770;};}function handleError(_0x8fcd9d,_0x2896fc){_0x2896fc=_0x2896fc||0x1f4;return function(_0x59304e){logger[_0x152d('0x29')](_0x59304e[_0x152d('0x2a')]);if(_0x59304e[_0x152d('0x2b')]){delete _0x59304e[_0x152d('0x2b')];}_0x8fcd9d[_0x152d('0x1a')](_0x2896fc)[_0x152d('0x2c')](_0x59304e);};}exports[_0x152d('0x2d')]=function(_0x1e522c,_0x5990ac){var _0x152a47={},_0x404d91={},_0x3494c9={'count':0x0,'rows':[]};var _0x3d5099=_[_0x152d('0x2e')](db[_0x152d('0x2f')][_0x152d('0x30')],function(_0x13f3cb){return{'name':_0x13f3cb[_0x152d('0x31')],'type':_0x13f3cb[_0x152d('0x32')]['key']};});_0x404d91[_0x152d('0x33')]=_[_0x152d('0x2e')](_0x3d5099,_0x152d('0x2b'));_0x404d91[_0x152d('0x34')]=_[_0x152d('0x35')](_0x1e522c[_0x152d('0x34')]);_0x404d91['filters']=_[_0x152d('0x36')](_0x404d91['model'],_0x404d91['query']);_0x152a47[_0x152d('0x37')]=_[_0x152d('0x36')](_0x404d91[_0x152d('0x33')],qs[_0x152d('0x38')](_0x1e522c[_0x152d('0x34')][_0x152d('0x38')]));_0x152a47[_0x152d('0x37')]=_0x152a47[_0x152d('0x37')][_0x152d('0x39')]?_0x152a47[_0x152d('0x37')]:_0x404d91[_0x152d('0x33')];if(!_0x1e522c[_0x152d('0x34')][_0x152d('0x3a')](_0x152d('0x3b'))){_0x152a47[_0x152d('0x1d')]=qs[_0x152d('0x1d')](_0x1e522c[_0x152d('0x34')][_0x152d('0x1d')]);_0x152a47[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x1e522c[_0x152d('0x34')][_0x152d('0x1c')]);}_0x152a47[_0x152d('0x3c')]=qs['sort'](_0x1e522c[_0x152d('0x34')][_0x152d('0x3d')]);_0x152a47[_0x152d('0x3e')]=qs[_0x152d('0x3f')](_['pick'](_0x1e522c['query'],_0x404d91[_0x152d('0x3f')]),_0x3d5099);if(_0x1e522c[_0x152d('0x34')]['filter']){_0x152a47[_0x152d('0x3e')]=_[_0x152d('0x40')](_0x152a47['where'],{'$or':_[_0x152d('0x2e')](_0x3d5099,function(_0x5816d9){if(_0x5816d9[_0x152d('0x32')]!==_0x152d('0x41')){var _0x53e6e5={};_0x53e6e5[_0x5816d9[_0x152d('0x2b')]]={'$like':'%'+_0x1e522c['query'][_0x152d('0x42')]+'%'};return _0x53e6e5;}})});}_0x152a47=_['merge']({},_0x152a47,_0x1e522c[_0x152d('0x43')]);var _0x342195={'where':_0x152a47['where']};return db[_0x152d('0x2f')][_0x152d('0x1f')](_0x342195)[_0x152d('0x23')](function(_0x48ebd8){_0x3494c9['count']=_0x48ebd8;if(_0x1e522c[_0x152d('0x34')]['includeAll']){_0x152a47[_0x152d('0x44')]=[{'all':!![]}];}return db[_0x152d('0x2f')][_0x152d('0x45')](_0x152a47);})[_0x152d('0x23')](function(_0x3ae8a6){_0x3494c9[_0x152d('0x46')]=_0x3ae8a6;return _0x3494c9;})['then'](respondWithFilteredResult(_0x5990ac,_0x152a47))[_0x152d('0x47')](handleError(_0x5990ac,null));};exports[_0x152d('0x48')]=function(_0x580bc0,_0x408494){var _0x2e2a44={'raw':![],'where':{'id':_0x580bc0[_0x152d('0x49')]['id']}},_0x5679c6={};_0x5679c6[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x2f')][_0x152d('0x30')]);_0x5679c6['query']=_['keys'](_0x580bc0[_0x152d('0x34')]);_0x5679c6[_0x152d('0x3f')]=_[_0x152d('0x36')](_0x5679c6[_0x152d('0x33')],_0x5679c6[_0x152d('0x34')]);_0x2e2a44[_0x152d('0x37')]=_[_0x152d('0x36')](_0x5679c6[_0x152d('0x33')],qs[_0x152d('0x38')](_0x580bc0['query']['fields']));_0x2e2a44[_0x152d('0x37')]=_0x2e2a44[_0x152d('0x37')][_0x152d('0x39')]?_0x2e2a44[_0x152d('0x37')]:_0x5679c6[_0x152d('0x33')];if(_0x580bc0[_0x152d('0x34')]['includeAll']){_0x2e2a44[_0x152d('0x44')]=[{'all':!![]}];}_0x2e2a44=_[_0x152d('0x40')]({},_0x2e2a44,_0x580bc0[_0x152d('0x43')]);return db[_0x152d('0x2f')][_0x152d('0x4a')](_0x2e2a44)[_0x152d('0x23')](handleEntityNotFound(_0x408494,null))['then'](respondWithResult(_0x408494,null))[_0x152d('0x47')](handleError(_0x408494,null));};exports[_0x152d('0x4b')]=function(_0x3c670d,_0x427cfe){return db[_0x152d('0x2f')]['create'](_0x3c670d[_0x152d('0x4c')],{})[_0x152d('0x23')](function(_0x2bbead){var _0x230726=_0x3c670d['user']['get']({'plain':!![]});if(!_0x230726)throw new Error(_0x152d('0x4d'));if(_0x230726[_0x152d('0x4e')]==='user'){var _0x2d7ced=_0x2bbead['get']({'plain':!![]});var _0x20c618='IvrCampaigns';return db[_0x152d('0x4f')][_0x152d('0x4a')]({'where':{'name':_0x20c618,'userProfileId':_0x230726['userProfileId']},'raw':!![]})['then'](function(_0x23f6af){if(_0x23f6af&&_0x23f6af[_0x152d('0x50')]===0x0){return db[_0x152d('0x27')][_0x152d('0x4b')]({'name':_0x2d7ced[_0x152d('0x2b')],'resourceId':_0x2d7ced['id'],'type':_0x23f6af[_0x152d('0x2b')],'sectionId':_0x23f6af['id']},{})[_0x152d('0x23')](function(){return _0x2bbead;});}else{return _0x2bbead;}})[_0x152d('0x47')](function(_0x9b6664){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9b6664);throw _0x9b6664;});}return _0x2bbead;})[_0x152d('0x23')](respondWithResult(_0x427cfe,0xc9))[_0x152d('0x47')](handleError(_0x427cfe,null));};exports[_0x152d('0x51')]=function(_0x715d79,_0x1d1871){var _0x14fbde={'where':{'id':_0x715d79[_0x152d('0x49')]['id']}},_0x349188={};_0x349188[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x2f')]['rawAttributes']);_0x14fbde[_0x152d('0x37')]=_[_0x152d('0x36')](_0x349188[_0x152d('0x33')],qs[_0x152d('0x38')](_0x715d79[_0x152d('0x34')]['fields']));_0x14fbde['attributes']=_0x14fbde['attributes'][_0x152d('0x39')]?_0x14fbde['attributes']:_0x349188[_0x152d('0x33')];if(_0x715d79[_0x152d('0x34')][_0x152d('0x52')]){_0x14fbde[_0x152d('0x44')]=[{'all':!![]}];}_0x14fbde=_['merge']({},_0x14fbde,_0x715d79[_0x152d('0x43')]);return db[_0x152d('0x2f')][_0x152d('0x4a')](_0x14fbde)[_0x152d('0x23')](handleEntityNotFound(_0x1d1871,null))[_0x152d('0x23')](function(_0xd0430e){if(_0xd0430e){var _0x34477b=_0xd0430e[_0x152d('0x25')]({'plain':!![]});_0x34477b=qs[_0x152d('0x53')](_0x34477b,['id',_0x152d('0x54'),'updatedAt']);_0x715d79[_0x152d('0x4c')]=_[_0x152d('0x53')](_0x715d79[_0x152d('0x4c')],['id',_0x152d('0x54'),_0x152d('0x55')]);return db[_0x152d('0x2f')][_0x152d('0x4b')](_['merge'](_0x34477b,_0x715d79[_0x152d('0x4c')]),{'include':_0x715d79[_0x152d('0x34')][_0x152d('0x52')]?[{'all':!![]}]:undefined})[_0x152d('0x23')](function(_0x1bbd1d){var _0x16fff1=_0x715d79['user'][_0x152d('0x25')]({'plain':!![]});if(!_0x16fff1)throw new Error(_0x152d('0x4d'));if(_0x16fff1['role']===_0x152d('0x56')){var _0x53f853=_0x1bbd1d[_0x152d('0x25')]({'plain':!![]});var _0x13af67=_0x152d('0x26');return db[_0x152d('0x4f')][_0x152d('0x4a')]({'where':{'name':_0x13af67,'userProfileId':_0x16fff1[_0x152d('0x57')]},'raw':!![]})[_0x152d('0x23')](function(_0x32d91a){if(_0x32d91a&&_0x32d91a[_0x152d('0x50')]===0x0){return db[_0x152d('0x27')]['create']({'name':_0x53f853[_0x152d('0x2b')],'resourceId':_0x53f853['id'],'type':_0x32d91a[_0x152d('0x2b')],'sectionId':_0x32d91a['id']},{})['then'](function(){return _0x1bbd1d;});}else{return _0x1bbd1d;}})[_0x152d('0x47')](function(_0x578d4a){logger[_0x152d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x578d4a);throw _0x578d4a;});}return _0x1bbd1d;});}})[_0x152d('0x23')](respondWithResult(_0x1d1871,0xc9))['catch'](handleError(_0x1d1871,null));};exports['update']=function(_0x44c18d,_0x39cfb8){if(_0x44c18d[_0x152d('0x4c')]['id']){delete _0x44c18d[_0x152d('0x4c')]['id'];}return db[_0x152d('0x2f')][_0x152d('0x4a')]({'where':{'id':_0x44c18d[_0x152d('0x49')]['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x39cfb8,null))[_0x152d('0x23')](saveUpdates(_0x44c18d[_0x152d('0x4c')],null))[_0x152d('0x23')](respondWithResult(_0x39cfb8,null))[_0x152d('0x47')](handleError(_0x39cfb8,null));};exports[_0x152d('0x24')]=function(_0x43d59e,_0x13de62){return db['Campaign'][_0x152d('0x4a')]({'where':{'id':_0x43d59e[_0x152d('0x49')]['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x13de62,null))[_0x152d('0x23')](removeEntity(_0x13de62,null))['catch'](handleError(_0x13de62,null));};exports[_0x152d('0x58')]=function(_0x1d1348,_0x180a68,_0x3aa9ed){var _0x5e5ae2={'raw':!![],'where':{}};var _0x460995={};var _0x38732d={'count':0x0,'rows':[]};return db[_0x152d('0x2f')][_0x152d('0x59')]({'where':{'id':_0x1d1348[_0x152d('0x49')]['id']}})['then'](handleEntityNotFound(_0x180a68,null))[_0x152d('0x23')](function(_0x4f565c){if(_0x4f565c){_0x460995['model']=_[_0x152d('0x35')](db['CmHopper'][_0x152d('0x30')]);_0x460995[_0x152d('0x34')]=_[_0x152d('0x35')](_0x1d1348[_0x152d('0x34')]);_0x460995['filters']=_[_0x152d('0x36')](_0x460995['model'],_0x460995[_0x152d('0x34')]);_0x5e5ae2[_0x152d('0x37')]=_['intersection'](_0x460995[_0x152d('0x33')],qs[_0x152d('0x38')](_0x1d1348[_0x152d('0x34')][_0x152d('0x38')]));_0x5e5ae2[_0x152d('0x37')]=_0x5e5ae2[_0x152d('0x37')]['length']?_0x5e5ae2['attributes']:_0x460995[_0x152d('0x33')];if(!_0x1d1348['query'][_0x152d('0x3a')](_0x152d('0x3b'))){_0x5e5ae2[_0x152d('0x1d')]=qs['limit'](_0x1d1348[_0x152d('0x34')][_0x152d('0x1d')]);_0x5e5ae2[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x1d1348[_0x152d('0x34')][_0x152d('0x1c')]);}_0x5e5ae2[_0x152d('0x3c')]=qs[_0x152d('0x3d')](_0x1d1348['query'][_0x152d('0x3d')]);_0x5e5ae2[_0x152d('0x3e')]=qs[_0x152d('0x3f')](_[_0x152d('0x5a')](_0x1d1348[_0x152d('0x34')],_0x460995[_0x152d('0x3f')]));_0x5e5ae2[_0x152d('0x3e')][_0x152d('0x5b')]=_0x4f565c['id'];if(_0x1d1348[_0x152d('0x34')][_0x152d('0x42')]){_0x5e5ae2[_0x152d('0x3e')]=_[_0x152d('0x40')](_0x5e5ae2['where'],{'$or':_['map'](_0x5e5ae2[_0x152d('0x37')],function(_0x26b63d){var _0x92283f={};_0x92283f[_0x26b63d]={'$like':'%'+_0x1d1348[_0x152d('0x34')][_0x152d('0x42')]+'%'};return _0x92283f;})});}_0x5e5ae2=_[_0x152d('0x40')]({},_0x5e5ae2,_0x1d1348['options']);return db[_0x152d('0x5c')][_0x152d('0x1f')]({'where':_0x5e5ae2[_0x152d('0x3e')]})[_0x152d('0x23')](function(_0x5600d9){_0x38732d[_0x152d('0x1f')]=_0x5600d9;if(_0x1d1348[_0x152d('0x34')][_0x152d('0x52')]){_0x5e5ae2['include']=[{'all':!![]}];}return db[_0x152d('0x5c')][_0x152d('0x45')](_0x5e5ae2);})['then'](function(_0x4a3831){_0x38732d[_0x152d('0x46')]=_0x4a3831;return _0x38732d;});}})[_0x152d('0x23')](respondWithFilteredResult(_0x180a68,_0x5e5ae2))[_0x152d('0x47')](handleError(_0x180a68,null));};exports[_0x152d('0x5d')]=function(_0x3ac090,_0x9434fb,_0x36d8c6){var _0x35f399={'raw':!![],'where':{}};var _0x478881={};var _0x17f39b={'count':0x0,'rows':[]};return db[_0x152d('0x2f')][_0x152d('0x59')]({'where':{'id':_0x3ac090[_0x152d('0x49')]['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x9434fb,null))[_0x152d('0x23')](function(_0x54c1a0){if(_0x54c1a0){_0x478881[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x5e')][_0x152d('0x30')]);_0x478881[_0x152d('0x34')]=_[_0x152d('0x35')](_0x3ac090['query']);_0x478881['filters']=_['intersection'](_0x478881['model'],_0x478881[_0x152d('0x34')]);_0x35f399[_0x152d('0x37')]=_[_0x152d('0x36')](_0x478881[_0x152d('0x33')],qs['fields'](_0x3ac090['query'][_0x152d('0x38')]));_0x35f399['attributes']=_0x35f399[_0x152d('0x37')][_0x152d('0x39')]?_0x35f399[_0x152d('0x37')]:_0x478881[_0x152d('0x33')];if(!_0x3ac090[_0x152d('0x34')][_0x152d('0x3a')](_0x152d('0x3b'))){_0x35f399['limit']=qs[_0x152d('0x1d')](_0x3ac090[_0x152d('0x34')]['limit']);_0x35f399[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x3ac090[_0x152d('0x34')][_0x152d('0x1c')]);}_0x35f399[_0x152d('0x3c')]=qs[_0x152d('0x3d')](_0x3ac090[_0x152d('0x34')]['sort']);_0x35f399[_0x152d('0x3e')]=qs[_0x152d('0x3f')](_['pick'](_0x3ac090[_0x152d('0x34')],_0x478881[_0x152d('0x3f')]));_0x35f399['where'][_0x152d('0x5b')]=_0x54c1a0['id'];if(_0x3ac090[_0x152d('0x34')]['filter']){_0x35f399['where']=_[_0x152d('0x40')](_0x35f399[_0x152d('0x3e')],{'$or':_[_0x152d('0x2e')](_0x35f399['attributes'],function(_0x12e5fb){var _0x2dabfd={};_0x2dabfd[_0x12e5fb]={'$like':'%'+_0x3ac090['query'][_0x152d('0x42')]+'%'};return _0x2dabfd;})});}_0x35f399=_[_0x152d('0x40')]({},_0x35f399,_0x3ac090[_0x152d('0x43')]);return db['CmHopperHistory'][_0x152d('0x1f')]({'where':_0x35f399['where']})['then'](function(_0xeec275){_0x17f39b[_0x152d('0x1f')]=_0xeec275;if(_0x3ac090[_0x152d('0x34')][_0x152d('0x52')]){_0x35f399['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x35f399);})[_0x152d('0x23')](function(_0x87cfb5){_0x17f39b[_0x152d('0x46')]=_0x87cfb5;return _0x17f39b;});}})[_0x152d('0x23')](respondWithFilteredResult(_0x9434fb,_0x35f399))[_0x152d('0x47')](handleError(_0x9434fb,null));};exports[_0x152d('0x5f')]=function(_0x5c0ec3,_0x144317,_0x1f137d){var _0xf9f0e7={'raw':!![],'where':{}};var _0xc8abd9={};var _0x3cd89c={'count':0x0,'rows':[]};return db['Campaign'][_0x152d('0x59')]({'where':{'id':_0x5c0ec3['params']['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x144317,null))[_0x152d('0x23')](function(_0x371392){if(_0x371392){_0xc8abd9[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x60')][_0x152d('0x30')]);_0xc8abd9[_0x152d('0x34')]=_['keys'](_0x5c0ec3['query']);_0xc8abd9['filters']=_[_0x152d('0x36')](_0xc8abd9[_0x152d('0x33')],_0xc8abd9[_0x152d('0x34')]);_0xf9f0e7[_0x152d('0x37')]=_[_0x152d('0x36')](_0xc8abd9[_0x152d('0x33')],qs[_0x152d('0x38')](_0x5c0ec3[_0x152d('0x34')][_0x152d('0x38')]));_0xf9f0e7[_0x152d('0x37')]=_0xf9f0e7['attributes']['length']?_0xf9f0e7['attributes']:_0xc8abd9[_0x152d('0x33')];if(!_0x5c0ec3[_0x152d('0x34')][_0x152d('0x3a')](_0x152d('0x3b'))){_0xf9f0e7[_0x152d('0x1d')]=qs['limit'](_0x5c0ec3[_0x152d('0x34')][_0x152d('0x1d')]);_0xf9f0e7[_0x152d('0x1c')]=qs['offset'](_0x5c0ec3[_0x152d('0x34')]['offset']);}_0xf9f0e7[_0x152d('0x3c')]=qs[_0x152d('0x3d')](_0x5c0ec3['query'][_0x152d('0x3d')]);_0xf9f0e7[_0x152d('0x3e')]=qs['filters'](_['pick'](_0x5c0ec3['query'],_0xc8abd9[_0x152d('0x3f')]));_0xf9f0e7['where'][_0x152d('0x5b')]=_0x371392['id'];if(_0x5c0ec3['query'][_0x152d('0x42')]){_0xf9f0e7[_0x152d('0x3e')]=_[_0x152d('0x40')](_0xf9f0e7[_0x152d('0x3e')],{'$or':_[_0x152d('0x2e')](_0xf9f0e7[_0x152d('0x37')],function(_0x471f2d){var _0x1fef63={};_0x1fef63[_0x471f2d]={'$like':'%'+_0x5c0ec3[_0x152d('0x34')][_0x152d('0x42')]+'%'};return _0x1fef63;})});}_0xf9f0e7=_[_0x152d('0x40')]({},_0xf9f0e7,_0x5c0ec3[_0x152d('0x43')]);return db['CmHopperFinal'][_0x152d('0x1f')]({'where':_0xf9f0e7[_0x152d('0x3e')]})['then'](function(_0x5f217f){_0x3cd89c[_0x152d('0x1f')]=_0x5f217f;if(_0x5c0ec3[_0x152d('0x34')][_0x152d('0x52')]){_0xf9f0e7[_0x152d('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0xf9f0e7);})[_0x152d('0x23')](function(_0x2e45b9){_0x3cd89c[_0x152d('0x46')]=_0x2e45b9;return _0x3cd89c;});}})[_0x152d('0x23')](respondWithFilteredResult(_0x144317,_0xf9f0e7))['catch'](handleError(_0x144317,null));};exports[_0x152d('0x61')]=function(_0x43435d,_0x4c16d6,_0xaa06db){var _0x8d1503={'raw':!![],'where':{}};var _0xab04c0={};var _0x4d3d07={'count':0x0,'rows':[]};return db[_0x152d('0x2f')][_0x152d('0x59')]({'where':{'id':_0x43435d[_0x152d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c16d6,null))[_0x152d('0x23')](function(_0x5c7aa0){if(_0x5c7aa0){_0xab04c0[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x62')][_0x152d('0x30')]);_0xab04c0[_0x152d('0x34')]=_[_0x152d('0x35')](_0x43435d['query']);_0xab04c0[_0x152d('0x3f')]=_[_0x152d('0x36')](_0xab04c0[_0x152d('0x33')],_0xab04c0[_0x152d('0x34')]);_0x8d1503[_0x152d('0x37')]=_[_0x152d('0x36')](_0xab04c0[_0x152d('0x33')],qs['fields'](_0x43435d[_0x152d('0x34')][_0x152d('0x38')]));_0x8d1503[_0x152d('0x37')]=_0x8d1503[_0x152d('0x37')][_0x152d('0x39')]?_0x8d1503[_0x152d('0x37')]:_0xab04c0['model'];if(!_0x43435d[_0x152d('0x34')]['hasOwnProperty'](_0x152d('0x3b'))){_0x8d1503[_0x152d('0x1d')]=qs['limit'](_0x43435d['query'][_0x152d('0x1d')]);_0x8d1503[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x43435d[_0x152d('0x34')][_0x152d('0x1c')]);}_0x8d1503[_0x152d('0x3c')]=qs[_0x152d('0x3d')](_0x43435d[_0x152d('0x34')][_0x152d('0x3d')]);_0x8d1503['where']=qs[_0x152d('0x3f')](_[_0x152d('0x5a')](_0x43435d[_0x152d('0x34')],_0xab04c0[_0x152d('0x3f')]));_0x8d1503[_0x152d('0x3e')][_0x152d('0x5b')]=_0x5c7aa0['id'];if(_0x43435d[_0x152d('0x34')][_0x152d('0x42')]){_0x8d1503[_0x152d('0x3e')]=_[_0x152d('0x40')](_0x8d1503[_0x152d('0x3e')],{'$or':_[_0x152d('0x2e')](_0x8d1503['attributes'],function(_0x306197){var _0x30c7a5={};_0x30c7a5[_0x306197]={'$like':'%'+_0x43435d[_0x152d('0x34')]['filter']+'%'};return _0x30c7a5;})});}_0x8d1503=_[_0x152d('0x40')]({},_0x8d1503,_0x43435d['options']);return db[_0x152d('0x62')][_0x152d('0x1f')]({'where':_0x8d1503[_0x152d('0x3e')]})['then'](function(_0x41542b){_0x4d3d07[_0x152d('0x1f')]=_0x41542b;if(_0x43435d[_0x152d('0x34')]['includeAll']){_0x8d1503['include']=[{'all':!![]}];}return db[_0x152d('0x62')][_0x152d('0x45')](_0x8d1503);})[_0x152d('0x23')](function(_0x3fc782){_0x4d3d07[_0x152d('0x46')]=_0x3fc782;return _0x4d3d07;});}})[_0x152d('0x23')](respondWithFilteredResult(_0x4c16d6,_0x8d1503))[_0x152d('0x47')](handleError(_0x4c16d6,null));};exports[_0x152d('0x63')]=function(_0xdf9f43,_0x30bd2d,_0x4d7d57){var _0x362175={};var _0x32c266={};var _0x174dd0;var _0x1307de;return db[_0x152d('0x2f')][_0x152d('0x59')]({'where':{'id':_0xdf9f43['params']['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x30bd2d,null))[_0x152d('0x23')](function(_0x55118d){if(_0x55118d){_0x174dd0=_0x55118d;_0x32c266['model']=_[_0x152d('0x35')](db[_0x152d('0x64')][_0x152d('0x30')]);_0x32c266['query']=_['keys'](_0xdf9f43[_0x152d('0x34')]);_0x32c266['filters']=_[_0x152d('0x36')](_0x32c266[_0x152d('0x33')],_0x32c266['query']);_0x362175[_0x152d('0x37')]=_[_0x152d('0x36')](_0x32c266[_0x152d('0x33')],qs[_0x152d('0x38')](_0xdf9f43[_0x152d('0x34')]['fields']));_0x362175[_0x152d('0x37')]=_0x362175[_0x152d('0x37')][_0x152d('0x39')]?_0x362175[_0x152d('0x37')]:_0x32c266[_0x152d('0x33')];_0x362175[_0x152d('0x3c')]=qs['sort'](_0xdf9f43[_0x152d('0x34')][_0x152d('0x3d')]);_0x362175['where']=qs[_0x152d('0x3f')](_[_0x152d('0x5a')](_0xdf9f43[_0x152d('0x34')],_0x32c266[_0x152d('0x3f')]));if(_0xdf9f43[_0x152d('0x34')]['filter']){_0x362175[_0x152d('0x3e')]=_['merge'](_0x362175['where'],{'$or':_[_0x152d('0x2e')](_0x362175[_0x152d('0x37')],function(_0x4516c5){var _0x4b591a={};_0x4b591a[_0x4516c5]={'$like':'%'+_0xdf9f43['query'][_0x152d('0x42')]+'%'};return _0x4b591a;})});}_0x362175=_[_0x152d('0x40')]({},_0x362175,_0xdf9f43[_0x152d('0x43')]);return _0x174dd0['getLists'](_0x362175);}})[_0x152d('0x23')](function(_0x1c27e9){if(_0x1c27e9){_0x1307de=_0x1c27e9[_0x152d('0x39')];if(!_0xdf9f43[_0x152d('0x34')][_0x152d('0x3a')](_0x152d('0x3b'))){_0x362175['limit']=qs[_0x152d('0x1d')](_0xdf9f43[_0x152d('0x34')][_0x152d('0x1d')]);_0x362175[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0xdf9f43[_0x152d('0x34')][_0x152d('0x1c')]);}return _0x174dd0[_0x152d('0x63')](_0x362175);}})[_0x152d('0x23')](function(_0x255e2c){if(_0x255e2c){return _0x255e2c?{'count':_0x1307de,'rows':_0x255e2c}:null;}})[_0x152d('0x23')](respondWithResult(_0x30bd2d,null))['catch'](handleError(_0x30bd2d,null));};exports[_0x152d('0x65')]=function(_0x5eddae,_0x59277c,_0x5e1c73){var _0x26517e,_0x4aaf61;return db[_0x152d('0x2f')][_0x152d('0x4a')]({'where':{'id':_0x5eddae['params']['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x59277c,null))[_0x152d('0x23')](function(_0x2057c4){if(_0x2057c4){_0x4aaf61=_0x2057c4;return _0x2057c4['addLists'](_0x5eddae[_0x152d('0x4c')][_0x152d('0x66')],_[_0x152d('0x53')](_0x5eddae[_0x152d('0x4c')],[_0x152d('0x66'),'id'])||{});}return null;})['spread'](function(_0x36f741){var _0x3b5495;_0x26517e=_0x36f741||[];var _0x3ac3b2=[];if(_0x36f741){for(var _0x200284=0x0;_0x200284<_0x36f741[_0x152d('0x39')];_0x200284+=0x1){var _0x39cce7=_0x36f741[_0x200284][_0x152d('0x25')]({'plain':!![]});_0x4aaf61[_0x152d('0x67')]=_0x5eddae['body'][_0x152d('0x67')]?_0x5eddae[_0x152d('0x4c')][_0x152d('0x67')]:_0x4aaf61[_0x152d('0x67')];switch(_0x4aaf61['dialCheckDuplicateType']){case _0x152d('0x68'):_0x3b5495=squel[_0x152d('0x69')]()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x152d('0x6a'),_0x152d('0x6b'),_0x152d('0x5b'),'createdAt',_0x152d('0x55')],squel['select']()[_0x152d('0x6c')](_0x152d('0x6d'),_0x152d('0x6d'))[_0x152d('0x6c')](_0x152d('0x6e'),_0x152d('0x6f'))[_0x152d('0x6c')]('id',_0x152d('0x6a'))[_0x152d('0x6c')](_0x39cce7[_0x152d('0x70')]['toString'](),'ListId')[_0x152d('0x6c')](_0x5eddae['params']['id'][_0x152d('0x71')](),'CampaignId')['field'](_0x152d('0x6e'),_0x152d('0x54'))['field'](_0x152d('0x6e'),_0x152d('0x55'))[_0x152d('0x72')](_0x152d('0x73'))['where'](_0x152d('0x74'))[_0x152d('0x3e')]('ListId\x20=\x20?',_0x39cce7['CmListId']['toString']())[_0x152d('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x152d('0x3e')](_0x152d('0x75'),squel['select']()['field'](_0x152d('0x76'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x5eddae['params']['id']['toString']()))[_0x152d('0x3e')](_0x152d('0x75'),squel[_0x152d('0x77')]()[_0x152d('0x6c')](_0x152d('0x78'))[_0x152d('0x72')](_0x152d('0x79'))['where'](_0x152d('0x7a'),_0x5eddae[_0x152d('0x49')]['id'][_0x152d('0x71')]())))[_0x152d('0x71')]();break;case _0x152d('0x7b'):_0x3b5495=squel[_0x152d('0x69')]()[_0x152d('0x7c')](_0x152d('0x79'))[_0x152d('0x7d')]([_0x152d('0x6d'),'scheduledAt',_0x152d('0x6a'),_0x152d('0x6b'),'CampaignId',_0x152d('0x54'),'updatedAt'],squel['select']()['field'](_0x152d('0x6d'),_0x152d('0x6d'))['field'](_0x152d('0x6e'),_0x152d('0x6f'))[_0x152d('0x6c')]('id',_0x152d('0x6a'))[_0x152d('0x6c')](_0x39cce7['CmListId']['toString'](),'ListId')['field'](_0x5eddae[_0x152d('0x49')]['id'][_0x152d('0x71')](),'CampaignId')[_0x152d('0x6c')]('NOW()',_0x152d('0x54'))[_0x152d('0x6c')](_0x152d('0x6e'),_0x152d('0x55'))['from'](_0x152d('0x73'))[_0x152d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x152d('0x3e')](_0x152d('0x7e'),_0x39cce7[_0x152d('0x70')]['toString']())[_0x152d('0x3e')](_0x152d('0x7f'))[_0x152d('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x152d('0x77')]()[_0x152d('0x6c')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x152d('0x7a'),_0x5eddae['params']['id'][_0x152d('0x71')]())))[_0x152d('0x71')]();break;default:_0x3b5495=squel[_0x152d('0x69')]()['into'](_0x152d('0x79'))[_0x152d('0x7d')]([_0x152d('0x6d'),_0x152d('0x6f'),_0x152d('0x6a'),_0x152d('0x6b'),_0x152d('0x5b'),_0x152d('0x54'),_0x152d('0x55')],squel[_0x152d('0x77')]()[_0x152d('0x6c')]('phone',_0x152d('0x6d'))['field'](_0x152d('0x6e'),_0x152d('0x6f'))[_0x152d('0x6c')]('id',_0x152d('0x6a'))[_0x152d('0x6c')](_0x39cce7[_0x152d('0x70')][_0x152d('0x71')](),'ListId')[_0x152d('0x6c')](_0x5eddae[_0x152d('0x49')]['id'][_0x152d('0x71')](),_0x152d('0x5b'))['field'](_0x152d('0x6e'),_0x152d('0x54'))[_0x152d('0x6c')](_0x152d('0x6e'),_0x152d('0x55'))[_0x152d('0x72')](_0x152d('0x73'))[_0x152d('0x3e')](_0x152d('0x74'))[_0x152d('0x3e')](_0x152d('0x7e'),_0x39cce7[_0x152d('0x70')][_0x152d('0x71')]())['where'](_0x152d('0x7f')))['toString']();}_0x3ac3b2['push'](db['sequelize'][_0x152d('0x34')](_0x3b5495));}return BPromise[_0x152d('0x80')](_0x3ac3b2);}})[_0x152d('0x23')](function(){return _0x26517e;})[_0x152d('0x23')](respondWithResult(_0x59277c,null))[_0x152d('0x47')](handleError(_0x59277c,null));};exports[_0x152d('0x81')]=function(_0x4b64a5,_0x5c5c5a,_0x423bdd){return db[_0x152d('0x2f')][_0x152d('0x4a')]({'where':{'id':_0x4b64a5[_0x152d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c5c5a,null))[_0x152d('0x23')](function(_0x5a1aa2){if(_0x5a1aa2){return _0x5a1aa2[_0x152d('0x81')](_0x4b64a5[_0x152d('0x34')][_0x152d('0x66')]);}})[_0x152d('0x23')](function(_0x507f35){if(_0x507f35){return db[_0x152d('0x5c')][_0x152d('0x24')]({'where':{'ListId':_0x4b64a5[_0x152d('0x34')][_0x152d('0x66')],'CampaignId':_0x4b64a5[_0x152d('0x49')]['id']}})[_0x152d('0x23')](function(){return _0x507f35;});}})['then'](respondWithStatusCode(_0x5c5c5a,null))[_0x152d('0x47')](handleError(_0x5c5c5a,null));};exports[_0x152d('0x82')]=function(_0x3417ac,_0x13bbde,_0x153e04){var _0x3a654d={};var _0x4cf290={};var _0x42c065;var _0x556c01;return db[_0x152d('0x2f')][_0x152d('0x59')]({'where':{'id':_0x3417ac[_0x152d('0x49')]['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x13bbde,null))[_0x152d('0x23')](function(_0xeb52b8){if(_0xeb52b8){_0x42c065=_0xeb52b8;_0x4cf290[_0x152d('0x33')]=_[_0x152d('0x35')](db[_0x152d('0x64')][_0x152d('0x30')]);_0x4cf290[_0x152d('0x34')]=_['keys'](_0x3417ac[_0x152d('0x34')]);_0x4cf290[_0x152d('0x3f')]=_[_0x152d('0x36')](_0x4cf290[_0x152d('0x33')],_0x4cf290[_0x152d('0x34')]);_0x3a654d[_0x152d('0x37')]=_[_0x152d('0x36')](_0x4cf290['model'],qs['fields'](_0x3417ac['query'][_0x152d('0x38')]));_0x3a654d[_0x152d('0x37')]=_0x3a654d['attributes'][_0x152d('0x39')]?_0x3a654d[_0x152d('0x37')]:_0x4cf290[_0x152d('0x33')];_0x3a654d[_0x152d('0x3c')]=qs[_0x152d('0x3d')](_0x3417ac[_0x152d('0x34')]['sort']);_0x3a654d[_0x152d('0x3e')]=qs[_0x152d('0x3f')](_['pick'](_0x3417ac[_0x152d('0x34')],_0x4cf290[_0x152d('0x3f')]));if(_0x3417ac[_0x152d('0x34')][_0x152d('0x42')]){_0x3a654d[_0x152d('0x3e')]=_[_0x152d('0x40')](_0x3a654d['where'],{'$or':_[_0x152d('0x2e')](_0x3a654d['attributes'],function(_0x453a6c){var _0x5cf2c3={};_0x5cf2c3[_0x453a6c]={'$like':'%'+_0x3417ac[_0x152d('0x34')][_0x152d('0x42')]+'%'};return _0x5cf2c3;})});}_0x3a654d=_[_0x152d('0x40')]({},_0x3a654d,_0x3417ac['options']);return _0x42c065[_0x152d('0x82')](_0x3a654d);}})[_0x152d('0x23')](function(_0x4b2ed6){if(_0x4b2ed6){_0x556c01=_0x4b2ed6[_0x152d('0x39')];if(!_0x3417ac[_0x152d('0x34')]['hasOwnProperty']('nolimit')){_0x3a654d[_0x152d('0x1d')]=qs[_0x152d('0x1d')](_0x3417ac['query'][_0x152d('0x1d')]);_0x3a654d['offset']=qs[_0x152d('0x1c')](_0x3417ac[_0x152d('0x34')][_0x152d('0x1c')]);}return _0x42c065[_0x152d('0x82')](_0x3a654d);}})[_0x152d('0x23')](function(_0x36dfb8){if(_0x36dfb8){return _0x36dfb8?{'count':_0x556c01,'rows':_0x36dfb8}:null;}})[_0x152d('0x23')](respondWithResult(_0x13bbde,null))[_0x152d('0x47')](handleError(_0x13bbde,null));};exports[_0x152d('0x83')]=function(_0x14840d,_0x47973e,_0x42e150){var _0x41935b,_0x13a63c;return db[_0x152d('0x2f')][_0x152d('0x4a')]({'where':{'id':_0x14840d[_0x152d('0x49')]['id']}})[_0x152d('0x23')](handleEntityNotFound(_0x47973e,null))[_0x152d('0x23')](function(_0x298fe6){if(_0x298fe6){_0x13a63c=_0x298fe6;return _0x298fe6[_0x152d('0x83')](_0x14840d[_0x152d('0x4c')][_0x152d('0x66')],_[_0x152d('0x53')](_0x14840d[_0x152d('0x4c')],[_0x152d('0x66'),'id'])||{});}return null;})[_0x152d('0x84')](function(_0x190b78){var _0x5e9bcc;_0x41935b=_0x190b78||[];var _0x4e2193=[];if(_0x190b78){for(var _0x2c3701=0x0;_0x2c3701<_0x190b78[_0x152d('0x39')];_0x2c3701+=0x1){var _0x129a9c=_0x190b78[_0x2c3701][_0x152d('0x25')]({'plain':!![]});_0x5e9bcc=squel[_0x152d('0x69')]()['into'](_0x152d('0x85'))[_0x152d('0x7d')]([_0x152d('0x6d'),_0x152d('0x6a'),_0x152d('0x6b'),_0x152d('0x5b'),_0x152d('0x54'),'updatedAt'],squel[_0x152d('0x77')]()[_0x152d('0x6c')](_0x152d('0x6d'),_0x152d('0x6d'))['field']('id',_0x152d('0x6a'))[_0x152d('0x6c')](_0x129a9c[_0x152d('0x70')][_0x152d('0x71')](),_0x152d('0x6b'))[_0x152d('0x6c')](_0x14840d[_0x152d('0x49')]['id'][_0x152d('0x71')](),_0x152d('0x5b'))[_0x152d('0x6c')](_0x152d('0x6e'),'createdAt')['field'](_0x152d('0x6e'),_0x152d('0x55'))[_0x152d('0x72')](_0x152d('0x73'))[_0x152d('0x3e')](_0x152d('0x74'))[_0x152d('0x3e')](_0x152d('0x7e'),_0x129a9c['CmListId'][_0x152d('0x71')]())[_0x152d('0x3e')](_0x152d('0x7f')))[_0x152d('0x71')]();_0x4e2193[_0x152d('0x86')](db[_0x152d('0x87')][_0x152d('0x34')](_0x5e9bcc));}return BPromise[_0x152d('0x80')](_0x4e2193);}})[_0x152d('0x23')](function(){return _0x41935b;})[_0x152d('0x23')](respondWithResult(_0x47973e,null))[_0x152d('0x47')](handleError(_0x47973e,null));};exports['removeBlackLists']=function(_0x1c8158,_0x12764c,_0x55c56a){return db[_0x152d('0x2f')]['find']({'where':{'id':_0x1c8158['params']['id']}})['then'](handleEntityNotFound(_0x12764c,null))[_0x152d('0x23')](function(_0x46fc15){if(_0x46fc15){return _0x46fc15['removeBlackLists'](_0x1c8158[_0x152d('0x34')]['ids']);}})[_0x152d('0x23')](function(_0x1d0344){if(_0x1d0344){return db[_0x152d('0x62')][_0x152d('0x24')]({'where':{'ListId':_0x1c8158[_0x152d('0x34')][_0x152d('0x66')],'CampaignId':_0x1c8158[_0x152d('0x49')]['id']}})[_0x152d('0x23')](function(){return _0x1d0344;});}})[_0x152d('0x23')](respondWithStatusCode(_0x12764c,null))[_0x152d('0x47')](handleError(_0x12764c,null));}; \ No newline at end of file +var _0x0d7b=['onlyIfOpen','fromQuery','cm_hopper','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ids','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','clone','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x2e4587,_0x7bf8bd){var _0x422eb7=function(_0x16a22b){while(--_0x16a22b){_0x2e4587['push'](_0x2e4587['shift']());}};_0x422eb7(++_0x7bf8bd);}(_0x0d7b,0x92));var _0xb0d7=function(_0x21615e,_0x1fd2bb){_0x21615e=_0x21615e-0x0;var _0x2b91bc=_0x0d7b[_0x21615e];return _0x2b91bc;};'use strict';var emlformat=require(_0xb0d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0d7('0x2'));var moment=require(_0xb0d7('0x3'));var BPromise=require(_0xb0d7('0x4'));var Mustache=require('mustache');var util=require(_0xb0d7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb0d7('0x6'));var ejs=require(_0xb0d7('0x7'));var fs=require('fs');var fs_extra=require(_0xb0d7('0x8'));var _=require('lodash');var squel=require(_0xb0d7('0x9'));var crypto=require(_0xb0d7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0d7('0x6'));var querystring=require('querystring');var Papa=require(_0xb0d7('0xb'));var Redis=require(_0xb0d7('0xc'));var authService=require(_0xb0d7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb0d7('0xe'));var hardwareService=require(_0xb0d7('0xf'));var logger=require(_0xb0d7('0x10'))('api');var utils=require(_0xb0d7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xb0d7('0x12'));var db=require(_0xb0d7('0x13'))['db'];function respondWithStatusCode(_0x54c376,_0x5979d8){_0x5979d8=_0x5979d8||0xcc;return function(_0xb4104){if(_0xb4104){return _0x54c376['sendStatus'](_0x5979d8);}return _0x54c376[_0xb0d7('0x14')](_0x5979d8)[_0xb0d7('0x15')]();};}function respondWithResult(_0x4a42da,_0x197ebc){_0x197ebc=_0x197ebc||0xc8;return function(_0x7cde45){if(_0x7cde45){return _0x4a42da[_0xb0d7('0x14')](_0x197ebc)[_0xb0d7('0x16')](_0x7cde45);}};}function respondWithFilteredResult(_0x46fbb8,_0x315dbb){return function(_0x2c99b4){if(_0x2c99b4){var _0x2e22d1=typeof _0x315dbb[_0xb0d7('0x17')]===_0xb0d7('0x18')&&typeof _0x315dbb[_0xb0d7('0x19')]===_0xb0d7('0x18');var _0x340cf0=_0x2c99b4[_0xb0d7('0x1a')];var _0x1a72df=_0x2e22d1?0x0:_0x315dbb[_0xb0d7('0x17')];var _0x2b83b6=_0x2e22d1?_0x2c99b4['count']:_0x315dbb[_0xb0d7('0x17')]+_0x315dbb[_0xb0d7('0x19')];var _0x240784;if(_0x2b83b6>=_0x340cf0){_0x2b83b6=_0x340cf0;_0x240784=0xc8;}else{_0x240784=0xce;}_0x46fbb8[_0xb0d7('0x14')](_0x240784);return _0x46fbb8['set'](_0xb0d7('0x1b'),_0x1a72df+'-'+_0x2b83b6+'/'+_0x340cf0)[_0xb0d7('0x16')](_0x2c99b4);}return null;};}function patchUpdates(_0x462653){return function(_0x4db315){try{jsonpatch[_0xb0d7('0x1c')](_0x4db315,_0x462653,!![]);}catch(_0x1d696c){return BPromise[_0xb0d7('0x1d')](_0x1d696c);}return _0x4db315[_0xb0d7('0x1e')]();};}function saveUpdates(_0x3ce333,_0x55e3bf){return function(_0x293581){if(_0x293581){return _0x293581[_0xb0d7('0x1f')](_0x3ce333)[_0xb0d7('0x20')](function(_0x5f2caf){return _0x5f2caf;});}return null;};}function removeEntity(_0x1cc003,_0x30610f){return function(_0x337780){if(_0x337780){return _0x337780[_0xb0d7('0x21')]()[_0xb0d7('0x20')](function(){var _0x343e48=_0x337780[_0xb0d7('0x22')]({'plain':!![]});var _0x551f83=_0xb0d7('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x551f83,'resourceId':_0x343e48['id']}})[_0xb0d7('0x20')](function(){return _0x337780;});})[_0xb0d7('0x20')](function(){_0x1cc003[_0xb0d7('0x14')](0xcc)[_0xb0d7('0x15')]();});}};}function handleEntityNotFound(_0x1b749c,_0x25cdd6){return function(_0x5cdd14){if(!_0x5cdd14){_0x1b749c[_0xb0d7('0x24')](0x194);}return _0x5cdd14;};}function handleError(_0x28b6f5,_0x46dcb9){_0x46dcb9=_0x46dcb9||0x1f4;return function(_0x2aecd9){logger[_0xb0d7('0x25')](_0x2aecd9[_0xb0d7('0x26')]);if(_0x2aecd9[_0xb0d7('0x27')]){delete _0x2aecd9[_0xb0d7('0x27')];}_0x28b6f5['status'](_0x46dcb9)['send'](_0x2aecd9);};}exports[_0xb0d7('0x28')]=function(_0x473e8a,_0x268c9d){var _0x1a8fc0={},_0x3f436e={},_0x16274d={'count':0x0,'rows':[]};var _0x9347a5=_[_0xb0d7('0x29')](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')],function(_0xe8fbb7){return{'name':_0xe8fbb7[_0xb0d7('0x2c')],'type':_0xe8fbb7[_0xb0d7('0x2d')][_0xb0d7('0x2e')]};});_0x3f436e['model']=_[_0xb0d7('0x29')](_0x9347a5,_0xb0d7('0x27'));_0x3f436e[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x473e8a[_0xb0d7('0x2f')]);_0x3f436e[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x3f436e[_0xb0d7('0x33')],_0x3f436e[_0xb0d7('0x2f')]);_0x1a8fc0[_0xb0d7('0x34')]=_['intersection'](_0x3f436e[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x1a8fc0[_0xb0d7('0x34')]=_0x1a8fc0[_0xb0d7('0x34')]['length']?_0x1a8fc0[_0xb0d7('0x34')]:_0x3f436e['model'];if(!_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1a8fc0[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1a8fc0[_0xb0d7('0x17')]=qs['offset'](_0x473e8a['query'][_0xb0d7('0x17')]);}_0x1a8fc0['order']=qs[_0xb0d7('0x38')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1a8fc0[_0xb0d7('0x39')]=qs['filters'](_['pick'](_0x473e8a[_0xb0d7('0x2f')],_0x3f436e['filters']),_0x9347a5);if(_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1a8fc0['where']=_[_0xb0d7('0x3b')](_0x1a8fc0[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x9347a5,function(_0x33374a){if(_0x33374a[_0xb0d7('0x2d')]!==_0xb0d7('0x3c')){var _0x2e8965={};_0x2e8965[_0x33374a[_0xb0d7('0x27')]]={'$like':'%'+_0x473e8a['query'][_0xb0d7('0x3a')]+'%'};return _0x2e8965;}})});}_0x1a8fc0=_[_0xb0d7('0x3b')]({},_0x1a8fc0,_0x473e8a[_0xb0d7('0x3d')]);var _0x210ba8={'where':_0x1a8fc0['where']};return db[_0xb0d7('0x2a')][_0xb0d7('0x1a')](_0x210ba8)[_0xb0d7('0x20')](function(_0x578897){_0x16274d[_0xb0d7('0x1a')]=_0x578897;if(_0x473e8a['query'][_0xb0d7('0x3e')]){_0x1a8fc0[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x2a')][_0xb0d7('0x40')](_0x1a8fc0);})[_0xb0d7('0x20')](function(_0x5bd932){_0x16274d[_0xb0d7('0x41')]=_0x5bd932;return _0x16274d;})[_0xb0d7('0x20')](respondWithFilteredResult(_0x268c9d,_0x1a8fc0))[_0xb0d7('0x42')](handleError(_0x268c9d,null));};exports[_0xb0d7('0x43')]=function(_0x4201f0,_0x5571e0){var _0x3bc74a={'raw':![],'where':{'id':_0x4201f0[_0xb0d7('0x44')]['id']}},_0x10c59c={};_0x10c59c[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['Campaign'][_0xb0d7('0x2b')]);_0x10c59c[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x4201f0['query']);_0x10c59c[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x10c59c[_0xb0d7('0x33')],_0x10c59c[_0xb0d7('0x2f')]);_0x3bc74a[_0xb0d7('0x34')]=_['intersection'](_0x10c59c[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x4201f0[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3bc74a[_0xb0d7('0x34')]=_0x3bc74a[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x3bc74a[_0xb0d7('0x34')]:_0x10c59c[_0xb0d7('0x33')];if(_0x4201f0['query'][_0xb0d7('0x3e')]){_0x3bc74a[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3bc74a=_['merge']({},_0x3bc74a,_0x4201f0[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3bc74a)[_0xb0d7('0x20')](handleEntityNotFound(_0x5571e0,null))[_0xb0d7('0x20')](respondWithResult(_0x5571e0,null))[_0xb0d7('0x42')](handleError(_0x5571e0,null));};exports[_0xb0d7('0x47')]=function(_0x4cd7f5,_0x3fa8b8){return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_0x4cd7f5[_0xb0d7('0x48')],{})[_0xb0d7('0x20')](function(_0x9b43bf){var _0x3ed37c=_0x4cd7f5[_0xb0d7('0x49')]['get']({'plain':!![]});if(!_0x3ed37c)throw new Error(_0xb0d7('0x4a'));if(_0x3ed37c['role']===_0xb0d7('0x49')){var _0x1d0580=_0x9b43bf['get']({'plain':!![]});var _0x5943d6=_0xb0d7('0x23');return db[_0xb0d7('0x4b')][_0xb0d7('0x46')]({'where':{'name':_0x5943d6,'userProfileId':_0x3ed37c[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x68673b){if(_0x68673b&&_0x68673b['autoAssociation']===0x0){return db[_0xb0d7('0x4d')]['create']({'name':_0x1d0580[_0xb0d7('0x27')],'resourceId':_0x1d0580['id'],'type':_0x68673b['name'],'sectionId':_0x68673b['id']},{})[_0xb0d7('0x20')](function(){return _0x9b43bf;});}else{return _0x9b43bf;}})['catch'](function(_0x56ceae){logger[_0xb0d7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56ceae);throw _0x56ceae;});}return _0x9b43bf;})[_0xb0d7('0x20')](respondWithResult(_0x3fa8b8,0xc9))[_0xb0d7('0x42')](handleError(_0x3fa8b8,null));};exports[_0xb0d7('0x4e')]=function(_0x1f21f8,_0x302e97){var _0x3239b9={'where':{'id':_0x1f21f8[_0xb0d7('0x44')]['id']}},_0x761b47={};_0x761b47[_0xb0d7('0x33')]=_['keys'](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')]);_0x3239b9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x761b47[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3239b9[_0xb0d7('0x34')]=_0x3239b9[_0xb0d7('0x34')]['length']?_0x3239b9['attributes']:_0x761b47[_0xb0d7('0x33')];if(_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x3239b9[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3239b9=_[_0xb0d7('0x3b')]({},_0x3239b9,_0x1f21f8[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3239b9)['then'](handleEntityNotFound(_0x302e97,null))[_0xb0d7('0x20')](function(_0x4f270e){if(_0x4f270e){var _0x36c54f=_0x4f270e[_0xb0d7('0x22')]({'plain':!![]});_0x36c54f=qs[_0xb0d7('0x4f')](_0x36c54f,['id',_0xb0d7('0x50'),'updatedAt']);_0x1f21f8['body']=_[_0xb0d7('0x4f')](_0x1f21f8[_0xb0d7('0x48')],['id',_0xb0d7('0x50'),_0xb0d7('0x51')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_[_0xb0d7('0x3b')](_0x36c54f,_0x1f21f8[_0xb0d7('0x48')]),{'include':_0x1f21f8['query'][_0xb0d7('0x3e')]?[{'all':!![]}]:undefined})[_0xb0d7('0x20')](function(_0x41803b){var _0x32fb5e=_0x1f21f8['user']['get']({'plain':!![]});if(!_0x32fb5e)throw new Error(_0xb0d7('0x4a'));if(_0x32fb5e[_0xb0d7('0x52')]===_0xb0d7('0x49')){var _0x2e2d11=_0x41803b[_0xb0d7('0x22')]({'plain':!![]});var _0x98130e=_0xb0d7('0x23');return db['UserProfileSection'][_0xb0d7('0x46')]({'where':{'name':_0x98130e,'userProfileId':_0x32fb5e[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x2e7648){if(_0x2e7648&&_0x2e7648[_0xb0d7('0x53')]===0x0){return db[_0xb0d7('0x4d')][_0xb0d7('0x47')]({'name':_0x2e2d11[_0xb0d7('0x27')],'resourceId':_0x2e2d11['id'],'type':_0x2e7648[_0xb0d7('0x27')],'sectionId':_0x2e7648['id']},{})[_0xb0d7('0x20')](function(){return _0x41803b;});}else{return _0x41803b;}})[_0xb0d7('0x42')](function(_0x3d1a44){logger[_0xb0d7('0x25')](_0xb0d7('0x54'),_0x3d1a44);throw _0x3d1a44;});}return _0x41803b;});}})['then'](respondWithResult(_0x302e97,0xc9))[_0xb0d7('0x42')](handleError(_0x302e97,null));};exports[_0xb0d7('0x1f')]=function(_0x18b48a,_0x345c77){if(_0x18b48a[_0xb0d7('0x48')]['id']){delete _0x18b48a[_0xb0d7('0x48')]['id'];}return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x18b48a[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x345c77,null))[_0xb0d7('0x20')](saveUpdates(_0x18b48a['body'],null))[_0xb0d7('0x20')](respondWithResult(_0x345c77,null))[_0xb0d7('0x42')](handleError(_0x345c77,null));};exports[_0xb0d7('0x21')]=function(_0x35bb0a,_0x34e8e7){return db['Campaign']['find']({'where':{'id':_0x35bb0a[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x34e8e7,null))[_0xb0d7('0x20')](removeEntity(_0x34e8e7,null))['catch'](handleError(_0x34e8e7,null));};exports['getHoppers']=function(_0x46f23d,_0x472a5d,_0xa95c2a){var _0x58c894={'raw':!![],'where':{}};var _0x5f0efd={};var _0x8347b2={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x46f23d['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x472a5d,null))[_0xb0d7('0x20')](function(_0x33bec9){if(_0x33bec9){_0x5f0efd[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x56')][_0xb0d7('0x2b')]);_0x5f0efd['query']=_[_0xb0d7('0x30')](_0x46f23d[_0xb0d7('0x2f')]);_0x5f0efd['filters']=_[_0xb0d7('0x32')](_0x5f0efd[_0xb0d7('0x33')],_0x5f0efd['query']);_0x58c894[_0xb0d7('0x34')]=_['intersection'](_0x5f0efd['model'],qs['fields'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x58c894[_0xb0d7('0x34')]=_0x58c894['attributes']['length']?_0x58c894[_0xb0d7('0x34')]:_0x5f0efd['model'];if(!_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x58c894[_0xb0d7('0x19')]=qs['limit'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x58c894[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x46f23d[_0xb0d7('0x2f')]['offset']);}_0x58c894[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x58c894[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x46f23d[_0xb0d7('0x2f')],_0x5f0efd['filters']));_0x58c894[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x33bec9['id'];if(_0x46f23d['query'][_0xb0d7('0x3a')]){_0x58c894[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x58c894[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x58c894['attributes'],function(_0x204eb2){var _0x127717={};_0x127717[_0x204eb2]={'$like':'%'+_0x46f23d['query'][_0xb0d7('0x3a')]+'%'};return _0x127717;})});}_0x58c894=_[_0xb0d7('0x3b')]({},_0x58c894,_0x46f23d[_0xb0d7('0x3d')]);return db['CmHopper'][_0xb0d7('0x1a')]({'where':_0x58c894['where']})[_0xb0d7('0x20')](function(_0x576300){_0x8347b2[_0xb0d7('0x1a')]=_0x576300;if(_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x58c894[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x56')][_0xb0d7('0x40')](_0x58c894);})[_0xb0d7('0x20')](function(_0x2804e0){_0x8347b2[_0xb0d7('0x41')]=_0x2804e0;return _0x8347b2;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x472a5d,_0x58c894))['catch'](handleError(_0x472a5d,null));};exports[_0xb0d7('0x5a')]=function(_0x3ebc48,_0x222382,_0x6bbe20){var _0x486a34={'raw':!![],'where':{}};var _0x4e76e6={};var _0x2ace15={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x3ebc48[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x222382,null))[_0xb0d7('0x20')](function(_0x207253){if(_0x207253){_0x4e76e6[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5b')][_0xb0d7('0x2b')]);_0x4e76e6['query']=_[_0xb0d7('0x30')](_0x3ebc48[_0xb0d7('0x2f')]);_0x4e76e6['filters']=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],_0x4e76e6[_0xb0d7('0x2f')]);_0x486a34[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x486a34[_0xb0d7('0x34')]=_0x486a34[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x486a34[_0xb0d7('0x34')]:_0x4e76e6['model'];if(!_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x36')]('nolimit')){_0x486a34['limit']=qs[_0xb0d7('0x19')](_0x3ebc48['query'][_0xb0d7('0x19')]);_0x486a34['offset']=qs[_0xb0d7('0x17')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x486a34[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x3ebc48[_0xb0d7('0x2f')]['sort']);_0x486a34[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x3ebc48['query'],_0x4e76e6[_0xb0d7('0x31')]));_0x486a34[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x207253['id'];if(_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x486a34['where']=_['merge'](_0x486a34[_0xb0d7('0x39')],{'$or':_['map'](_0x486a34[_0xb0d7('0x34')],function(_0x2c8fe9){var _0x16fee1={};_0x16fee1[_0x2c8fe9]={'$like':'%'+_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x16fee1;})});}_0x486a34=_[_0xb0d7('0x3b')]({},_0x486a34,_0x3ebc48['options']);return db[_0xb0d7('0x5b')][_0xb0d7('0x1a')]({'where':_0x486a34[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x156293){_0x2ace15['count']=_0x156293;if(_0x3ebc48['query'][_0xb0d7('0x3e')]){_0x486a34[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x5b')][_0xb0d7('0x40')](_0x486a34);})[_0xb0d7('0x20')](function(_0x5f1fe8){_0x2ace15[_0xb0d7('0x41')]=_0x5f1fe8;return _0x2ace15;});}})['then'](respondWithFilteredResult(_0x222382,_0x486a34))['catch'](handleError(_0x222382,null));};exports[_0xb0d7('0x5c')]=function(_0x55f0fd,_0x1c023b,_0x5988b2){var _0x4c0b8b={'raw':!![],'where':{}};var _0x525011={};var _0x488c2a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x55f0fd[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x1c023b,null))[_0xb0d7('0x20')](function(_0x130d98){if(_0x130d98){_0x525011[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5d')][_0xb0d7('0x2b')]);_0x525011['query']=_[_0xb0d7('0x30')](_0x55f0fd['query']);_0x525011['filters']=_[_0xb0d7('0x32')](_0x525011['model'],_0x525011[_0xb0d7('0x2f')]);_0x4c0b8b[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x525011[_0xb0d7('0x33')],qs['fields'](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x4c0b8b['attributes']=_0x4c0b8b[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x4c0b8b['attributes']:_0x525011[_0xb0d7('0x33')];if(!_0x55f0fd[_0xb0d7('0x2f')]['hasOwnProperty'](_0xb0d7('0x37'))){_0x4c0b8b[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x4c0b8b[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x4c0b8b[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x4c0b8b[_0xb0d7('0x39')]=qs['filters'](_[_0xb0d7('0x58')](_0x55f0fd['query'],_0x525011[_0xb0d7('0x31')]));_0x4c0b8b[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x130d98['id'];if(_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x4c0b8b[_0xb0d7('0x39')]=_['merge'](_0x4c0b8b[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x4c0b8b[_0xb0d7('0x34')],function(_0x20dcea){var _0x4e09bf={};_0x4e09bf[_0x20dcea]={'$like':'%'+_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x4e09bf;})});}_0x4c0b8b=_['merge']({},_0x4c0b8b,_0x55f0fd['options']);return db[_0xb0d7('0x5d')][_0xb0d7('0x1a')]({'where':_0x4c0b8b[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x52bea4){_0x488c2a[_0xb0d7('0x1a')]=_0x52bea4;if(_0x55f0fd['query'][_0xb0d7('0x3e')]){_0x4c0b8b['include']=[{'all':!![]}];}return db[_0xb0d7('0x5d')][_0xb0d7('0x40')](_0x4c0b8b);})['then'](function(_0x2a2b38){_0x488c2a['rows']=_0x2a2b38;return _0x488c2a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x1c023b,_0x4c0b8b))[_0xb0d7('0x42')](handleError(_0x1c023b,null));};exports[_0xb0d7('0x5e')]=function(_0x48a98c,_0x216c48,_0x110b20){var _0x1374c3={'raw':!![],'where':{}};var _0x35b1ff={};var _0x18166a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x48a98c[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x216c48,null))[_0xb0d7('0x20')](function(_0x1f502d){if(_0x1f502d){_0x35b1ff['model']=_['keys'](db[_0xb0d7('0x5f')][_0xb0d7('0x2b')]);_0x35b1ff[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x48a98c[_0xb0d7('0x2f')]);_0x35b1ff[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],_0x35b1ff[_0xb0d7('0x2f')]);_0x1374c3[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x48a98c[_0xb0d7('0x2f')]['fields']));_0x1374c3[_0xb0d7('0x34')]=_0x1374c3[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x1374c3['attributes']:_0x35b1ff['model'];if(!_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1374c3[_0xb0d7('0x19')]=qs['limit'](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1374c3['offset']=qs[_0xb0d7('0x17')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x1374c3[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1374c3['where']=qs['filters'](_[_0xb0d7('0x58')](_0x48a98c[_0xb0d7('0x2f')],_0x35b1ff[_0xb0d7('0x31')]));_0x1374c3[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x1f502d['id'];if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1374c3[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x1374c3['where'],{'$or':_['map'](_0x1374c3[_0xb0d7('0x34')],function(_0x2c111e){var _0x29924f={};_0x29924f[_0x2c111e]={'$like':'%'+_0x48a98c[_0xb0d7('0x2f')]['filter']+'%'};return _0x29924f;})});}_0x1374c3=_[_0xb0d7('0x3b')]({},_0x1374c3,_0x48a98c[_0xb0d7('0x3d')]);return db[_0xb0d7('0x5f')][_0xb0d7('0x1a')]({'where':_0x1374c3['where']})['then'](function(_0x4b680c){_0x18166a['count']=_0x4b680c;if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x1374c3['include']=[{'all':!![]}];}return db[_0xb0d7('0x5f')]['findAll'](_0x1374c3);})['then'](function(_0x30f530){_0x18166a[_0xb0d7('0x41')]=_0x30f530;return _0x18166a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x216c48,_0x1374c3))[_0xb0d7('0x42')](handleError(_0x216c48,null));};exports['getLists']=function(_0x106d78,_0x421323,_0x111948){var _0x171ea9={};var _0x4ccab1={};var _0x5093c1;var _0x567c00;return db['Campaign']['findOne']({'where':{'id':_0x106d78[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x421323,null))[_0xb0d7('0x20')](function(_0x5ab7c0){if(_0x5ab7c0){_0x5093c1=_0x5ab7c0;_0x4ccab1['model']=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x4ccab1[_0xb0d7('0x2f')]=_['keys'](_0x106d78['query']);_0x4ccab1[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],_0x4ccab1[_0xb0d7('0x2f')]);_0x171ea9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x106d78['query'][_0xb0d7('0x35')]));_0x171ea9['attributes']=_0x171ea9[_0xb0d7('0x34')]['length']?_0x171ea9[_0xb0d7('0x34')]:_0x4ccab1['model'];_0x171ea9[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x171ea9['where']=qs[_0xb0d7('0x31')](_['pick'](_0x106d78['query'],_0x4ccab1['filters']));if(_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x171ea9[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x171ea9['where'],{'$or':_[_0xb0d7('0x29')](_0x171ea9[_0xb0d7('0x34')],function(_0x477c77){var _0x10d410={};_0x10d410[_0x477c77]={'$like':'%'+_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x10d410;})});}_0x171ea9=_[_0xb0d7('0x3b')]({},_0x171ea9,_0x106d78[_0xb0d7('0x3d')]);return _0x5093c1[_0xb0d7('0x60')](_0x171ea9);}})[_0xb0d7('0x20')](function(_0x2f0c8d){if(_0x2f0c8d){_0x567c00=_0x2f0c8d[_0xb0d7('0x45')];if(!_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x171ea9[_0xb0d7('0x19')]=qs['limit'](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x171ea9[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}return _0x5093c1['getLists'](_0x171ea9);}})['then'](function(_0x31e949){if(_0x31e949){return _0x31e949?{'count':_0x567c00,'rows':_0x31e949}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x421323,null))[_0xb0d7('0x42')](handleError(_0x421323,null));};exports[_0xb0d7('0x61')]=function(_0x533435,_0x4cfd6d,_0x1d20f0){var _0x2ba765,_0x427251;return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x533435[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cfd6d,null))[_0xb0d7('0x20')](function(_0x4cdb8d){if(_0x4cdb8d){_0x427251=_0x4cdb8d;return _0x4cdb8d[_0xb0d7('0x61')](_0x533435[_0xb0d7('0x48')]['ids'],_[_0xb0d7('0x4f')](_0x533435[_0xb0d7('0x48')],['ids','id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x145a6c){var _0x5c07f3;_0x2ba765=_0x145a6c||[];var _0x166686=[];if(_0x145a6c){for(var _0x300bc9=0x0;_0x300bc9<_0x145a6c['length'];_0x300bc9+=0x1){var _0x556016=_0x145a6c[_0x300bc9][_0xb0d7('0x22')]({'plain':!![]});_0x427251['dialCheckDuplicateType']=_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]?_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]:_0x427251[_0xb0d7('0x63')];switch(_0x427251[_0xb0d7('0x63')]){case _0xb0d7('0x64'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')['fromQuery']([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')]('phone','phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'scheduledAt')[_0xb0d7('0x6c')]('id','ContactId')[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),'CampaignId')['field'](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x72'),_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())[_0xb0d7('0x39')](_0xb0d7('0x73'))[_0xb0d7('0x39')](_0xb0d7('0x74'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xb0d7('0x75'))[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]()))[_0xb0d7('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x77'))[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id']['toString']())))[_0xb0d7('0x6f')]();break;case _0xb0d7('0x78'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),'CampaignId',_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x67'),'phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435['params']['id'][_0xb0d7('0x6f')](),'CampaignId')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x74'),squel[_0xb0d7('0x6b')]()['field']('COALESCE(phone,\x27\x27)')[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]())))[_0xb0d7('0x6f')]();break;default:_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x7a'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),'updatedAt'],squel[_0xb0d7('0x6b')]()['field']('phone',_0xb0d7('0x67'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))[_0xb0d7('0x39')]('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')]['toString']())[_0xb0d7('0x39')](_0xb0d7('0x73')))[_0xb0d7('0x6f')]();}_0x166686[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0x5c07f3));}return BPromise[_0xb0d7('0x7e')](_0x166686);}})[_0xb0d7('0x20')](function(){return _0x2ba765;})[_0xb0d7('0x20')](respondWithResult(_0x4cfd6d,null))['catch'](handleError(_0x4cfd6d,null));};exports['removeLists']=function(_0x1c436b,_0x63d46c,_0x43dd51){return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x63d46c,null))[_0xb0d7('0x20')](function(_0x55b3bd){if(_0x55b3bd){return _0x55b3bd[_0xb0d7('0x7f')](_0x1c436b[_0xb0d7('0x2f')]['ids']);}})[_0xb0d7('0x20')](function(_0x1bbf9f){if(_0x1bbf9f){return db['CmHopper'][_0xb0d7('0x21')]({'where':{'ListId':_0x1c436b[_0xb0d7('0x2f')]['ids'],'CampaignId':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](function(){return _0x1bbf9f;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x63d46c,null))[_0xb0d7('0x42')](handleError(_0x63d46c,null));};exports['getBlackLists']=function(_0x513ccc,_0x59d696,_0x1b642e){var _0x2afdba={};var _0x517a19={};var _0x3131e0;var _0x24801d;return db['Campaign'][_0xb0d7('0x55')]({'where':{'id':_0x513ccc[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x59d696,null))[_0xb0d7('0x20')](function(_0x5dbfaf){if(_0x5dbfaf){_0x3131e0=_0x5dbfaf;_0x517a19[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x517a19[_0xb0d7('0x2f')]=_['keys'](_0x513ccc['query']);_0x517a19[_0xb0d7('0x31')]=_['intersection'](_0x517a19[_0xb0d7('0x33')],_0x517a19[_0xb0d7('0x2f')]);_0x2afdba[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x517a19['model'],qs['fields'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x2afdba['attributes']=_0x2afdba[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x2afdba[_0xb0d7('0x34')]:_0x517a19[_0xb0d7('0x33')];_0x2afdba[_0xb0d7('0x57')]=qs['sort'](_0x513ccc['query'][_0xb0d7('0x38')]);_0x2afdba[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x513ccc['query'],_0x517a19['filters']));if(_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x2afdba[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x2afdba[_0xb0d7('0x39')],{'$or':_['map'](_0x2afdba[_0xb0d7('0x34')],function(_0x213f35){var _0x1ef8a2={};_0x1ef8a2[_0x213f35]={'$like':'%'+_0x513ccc['query'][_0xb0d7('0x3a')]+'%'};return _0x1ef8a2;})});}_0x2afdba=_[_0xb0d7('0x3b')]({},_0x2afdba,_0x513ccc['options']);return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x1dc4b5){if(_0x1dc4b5){_0x24801d=_0x1dc4b5[_0xb0d7('0x45')];if(!_0x513ccc['query'][_0xb0d7('0x36')]('nolimit')){_0x2afdba[_0xb0d7('0x19')]=qs['limit'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x2afdba[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x513ccc['query'][_0xb0d7('0x17')]);}return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x5dcfa2){if(_0x5dcfa2){return _0x5dcfa2?{'count':_0x24801d,'rows':_0x5dcfa2}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x59d696,null))[_0xb0d7('0x42')](handleError(_0x59d696,null));};exports[_0xb0d7('0x81')]=function(_0x40efb7,_0x4c0aa1,_0x5cf758){var _0x2f16ae,_0x84916c;return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x40efb7['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x4c0aa1,null))[_0xb0d7('0x20')](function(_0x4d1108){if(_0x4d1108){_0x84916c=_0x4d1108;return _0x4d1108['addBlackLists'](_0x40efb7['body'][_0xb0d7('0x82')],_[_0xb0d7('0x4f')](_0x40efb7[_0xb0d7('0x48')],[_0xb0d7('0x82'),'id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x27a70c){var _0xa5b8e;_0x2f16ae=_0x27a70c||[];var _0x43c7d1=[];if(_0x27a70c){for(var _0x20fd69=0x0;_0x20fd69<_0x27a70c[_0xb0d7('0x45')];_0x20fd69+=0x1){var _0x4bfe50=_0x27a70c[_0x20fd69]['get']({'plain':!![]});_0xa5b8e=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x83'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x69'),'ListId',_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel['select']()[_0xb0d7('0x6c')](_0xb0d7('0x67'),_0xb0d7('0x67'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))['field'](_0x4bfe50[_0xb0d7('0x6e')]['toString'](),_0xb0d7('0x6a'))[_0xb0d7('0x6c')](_0x40efb7['params']['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'createdAt')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))['where']('ListId\x20=\x20?',_0x4bfe50[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where'](_0xb0d7('0x73')))['toString']();_0x43c7d1[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0xa5b8e));}return BPromise[_0xb0d7('0x7e')](_0x43c7d1);}})[_0xb0d7('0x20')](function(){return _0x2f16ae;})[_0xb0d7('0x20')](respondWithResult(_0x4c0aa1,null))[_0xb0d7('0x42')](handleError(_0x4c0aa1,null));};exports[_0xb0d7('0x84')]=function(_0xd6b871,_0x5967c3,_0xac1b5){return db[_0xb0d7('0x2a')]['find']({'where':{'id':_0xd6b871[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x5967c3,null))[_0xb0d7('0x20')](function(_0x275a4f){if(_0x275a4f){return _0x275a4f['removeBlackLists'](_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')]);}})[_0xb0d7('0x20')](function(_0x4cadd5){if(_0x4cadd5){return db[_0xb0d7('0x5f')][_0xb0d7('0x21')]({'where':{'ListId':_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')],'CampaignId':_0xd6b871['params']['id']}})[_0xb0d7('0x20')](function(){return _0x4cadd5;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x5967c3,null))[_0xb0d7('0x42')](handleError(_0x5967c3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5cb9876..61727ab 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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index a5fa43b..abafa7e 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 _0xf53f=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x4b61f0,_0x361989){var _0xfbaba2=function(_0x57206e){while(--_0x57206e){_0x4b61f0['push'](_0x4b61f0['shift']());}};_0xfbaba2(++_0x361989);}(_0xf53f,0x8d));var _0xff53=function(_0x62038e,_0x404437){_0x62038e=_0x62038e-0x0;var _0x35f802=_0xf53f[_0x62038e];return _0x35f802;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Campaign,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});}exports[_0xff53('0x14')]=function(_0x38883f){var _0x319ce5=this;return new Promise(function(_0x14b502,_0x5e9ba6){return db['Campaign'][_0xff53('0x15')]({'raw':_0x38883f['options']?_0x38883f[_0xff53('0x16')][_0xff53('0x17')]===undefined?!![]:![]:!![],'where':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x18')]||null:null,'attributes':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x19')]||null:null,'limit':_0x38883f[_0xff53('0x16')]?_0x38883f['options'][_0xff53('0x1a')]||null:null,'include':_0x38883f['options']?_0x38883f['options']['include']?_['map'](_0x38883f[_0xff53('0x16')][_0xff53('0x1b')],function(_0x58a73c){return{'model':db[_0x58a73c['model']],'as':_0x58a73c['as'],'attributes':_0x58a73c[_0xff53('0x19')],'include':_0x58a73c[_0xff53('0x1b')]?_[_0xff53('0x1c')](_0x58a73c[_0xff53('0x1b')],function(_0x462a03){return{'model':db[_0x462a03[_0xff53('0x1d')]],'as':_0x462a03['as'],'attributes':_0x462a03['attributes'],'include':_0x462a03[_0xff53('0x1b')]?_['map'](_0x462a03[_0xff53('0x1b')],function(_0x292da4){return{'model':db[_0x292da4[_0xff53('0x1d')]],'as':_0x292da4['as'],'attributes':_0x292da4[_0xff53('0x19')]};}):[]};}):[]};}):[]:[]})[_0xff53('0x1e')](function(_0x37e39a){logger[_0xff53('0x12')](_0xff53('0x14'),_0x38883f);logger['debug'](_0xff53('0x14'),_0x38883f,JSON['stringify'](_0x37e39a));_0x14b502(_0x37e39a);})['catch'](function(_0x25c661){logger[_0xff53('0xf')](_0xff53('0x14'),_0x25c661[_0xff53('0x11')],_0x38883f);_0x5e9ba6(_0x319ce5[_0xff53('0xf')](0x1f4,_0x25c661['message']));});});}; \ No newline at end of file +var _0x21a3=['include','model','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','attributes','limit','map'];(function(_0x38d7f9,_0x4562bb){var _0x38d3f2=function(_0x53a0a5){while(--_0x53a0a5){_0x38d7f9['push'](_0x38d7f9['shift']());}};_0x38d3f2(++_0x4562bb);}(_0x21a3,0x66));var _0x321a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x21a3[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Campaign,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['GetCampaign']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')]({'raw':_0x5b1810[_0x321a('0x18')]?_0x5b1810['options'][_0x321a('0x19')]===undefined?!![]:![]:!![],'where':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1a')]||null:null,'attributes':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1b')]||null:null,'limit':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1c')]||null:null,'include':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')]['include']?_[_0x321a('0x1d')](_0x5b1810[_0x321a('0x18')][_0x321a('0x1e')],function(_0x5ae154){return{'model':db[_0x5ae154[_0x321a('0x1f')]],'as':_0x5ae154['as'],'attributes':_0x5ae154[_0x321a('0x1b')],'include':_0x5ae154['include']?_['map'](_0x5ae154[_0x321a('0x1e')],function(_0x5a66c2){return{'model':db[_0x5a66c2[_0x321a('0x1f')]],'as':_0x5a66c2['as'],'attributes':_0x5a66c2[_0x321a('0x1b')],'include':_0x5a66c2[_0x321a('0x1e')]?_[_0x321a('0x1d')](_0x5a66c2[_0x321a('0x1e')],function(_0xdce138){return{'model':db[_0xdce138['model']],'as':_0xdce138['as'],'attributes':_0xdce138['attributes']};}):[]};}):[]};}):[]:[]})[_0x321a('0xc')](function(_0x105216){logger[_0x321a('0xd')]('GetCampaign',_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x20'),_0x5b1810,JSON[_0x321a('0x12')](_0x105216));_0x35fd6f(_0x105216);})['catch'](function(_0x8a09bb){logger[_0x321a('0x13')](_0x321a('0x20'),_0x8a09bb[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x8a09bb[_0x321a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 86f8db0..3f0fb35 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 _0x1e9c=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','getHoppers'];(function(_0xdebfd9,_0x305c87){var _0x166c4a=function(_0x1c7d44){while(--_0x1c7d44){_0xdebfd9['push'](_0xdebfd9['shift']());}};_0x166c4a(++_0x305c87);}(_0x1e9c,0xec));var _0xc1e9=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x1e9c[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0xc1e9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc1e9('0x1'));var express=require(_0xc1e9('0x2'));var router=express['Router']();var fs_extra=require(_0xc1e9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc1e9('0x4'));var config=require(_0xc1e9('0x5'));var controller=require(_0xc1e9('0x6'));router['get']('/',auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x8')]);router[_0xc1e9('0x9')](_0xc1e9('0xa'),auth[_0xc1e9('0x7')](),controller['show']);router[_0xc1e9('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xc1e9('0xb')]);router[_0xc1e9('0x9')]('/:id/hopper_histories',auth[_0xc1e9('0x7')](),controller[_0xc1e9('0xc')]);router[_0xc1e9('0x9')]('/:id/hopper_finals',auth[_0xc1e9('0x7')](),controller[_0xc1e9('0xd')]);router[_0xc1e9('0x9')](_0xc1e9('0xe'),auth[_0xc1e9('0x7')](),controller[_0xc1e9('0xf')]);router['get'](_0xc1e9('0x10'),auth['isAuthenticated'](),controller[_0xc1e9('0x11')]);router[_0xc1e9('0x9')](_0xc1e9('0x12'),auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x13')]);router[_0xc1e9('0x14')]('/',auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x15')]);router[_0xc1e9('0x14')](_0xc1e9('0x16'),auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x17')]);router['post'](_0xc1e9('0x10'),auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x18')]);router[_0xc1e9('0x14')]('/:id/blacklists',auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x19')]);router[_0xc1e9('0x1a')](_0xc1e9('0xa'),auth[_0xc1e9('0x7')](),controller['update']);router[_0xc1e9('0x1b')](_0xc1e9('0xa'),auth['isAuthenticated'](),controller[_0xc1e9('0x1c')]);router['delete'](_0xc1e9('0x10'),auth[_0xc1e9('0x7')](),controller[_0xc1e9('0x1d')]);router[_0xc1e9('0x1b')]('/:id/blacklists',auth[_0xc1e9('0x7')](),controller['removeBlackLists']);module[_0xc1e9('0x1e')]=router; \ No newline at end of file +var _0x94cc=['getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x94cc,0x133));var _0xc94c=function(_0x54d5db,_0x49c239){_0x54d5db=_0x54d5db-0x0;var _0x38956f=_0x94cc[_0x54d5db];return _0x38956f;};'use strict';var multer=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var path=require(_0xc94c('0x2'));var timeout=require(_0xc94c('0x3'));var express=require('express');var router=express[_0xc94c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc94c('0x5'));var config=require(_0xc94c('0x6'));var controller=require(_0xc94c('0x7'));router[_0xc94c('0x8')]('/',auth[_0xc94c('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc94c('0xa')]);router[_0xc94c('0x8')](_0xc94c('0xb'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xc')]);router[_0xc94c('0x8')]('/:id/hopper_histories',auth[_0xc94c('0x9')](),controller[_0xc94c('0xd')]);router[_0xc94c('0x8')](_0xc94c('0xe'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xf')]);router['get']('/:id/hopper_black',auth[_0xc94c('0x9')](),controller[_0xc94c('0x10')]);router[_0xc94c('0x8')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller['getLists']);router['get'](_0xc94c('0x12'),auth['isAuthenticated'](),controller[_0xc94c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc94c('0x14')]);router[_0xc94c('0x15')]('/:id/clone',auth[_0xc94c('0x9')](),controller[_0xc94c('0x16')]);router[_0xc94c('0x15')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x17')]);router[_0xc94c('0x15')](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x18')]);router[_0xc94c('0x19')](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1b')]);router['delete'](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller['destroy']);router[_0xc94c('0x1c')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc94c('0x1d')]);router['delete'](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1e')]);module[_0xc94c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 62f11de..a27e5f8 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 _0xe617=['getDataValue','key','sequelize','exports','STRING','VIRTUAL'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xe617,0x170));var _0x7e61=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe617[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7e61('0x0'));module[_0x7e61('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x7e61('0x2')]},'name':{'type':Sequelize[_0x7e61('0x3')],'get':function(){return this[_0x7e61('0x4')](_0x7e61('0x5'));}}}; \ No newline at end of file +var _0xdf9a=['getDataValue','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xdf9a,0xce));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xadf9('0x0'));module['exports']={'key':{'type':Sequelize[_0xadf9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xadf9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xadf9('0x3')],'get':function(){return this[_0xadf9('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d733ee1..152fd7e 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 _0x5f34=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','fieldName','type','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','find','update','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x396c37,_0x133182){var _0x319fd7=function(_0xa1ea15){while(--_0xa1ea15){_0x396c37['push'](_0x396c37['shift']());}};_0x319fd7(++_0x133182);}(_0x5f34,0x9e));var _0x45f3=function(_0x209348,_0x32766c){_0x209348=_0x209348-0x0;var _0xd62726=_0x5f34[_0x209348];return _0xd62726;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x45f3('0x0'));var jsonpatch=require(_0x45f3('0x1'));var rp=require(_0x45f3('0x2'));var moment=require(_0x45f3('0x3'));var BPromise=require(_0x45f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x45f3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x45f3('0x6'));var fs=require('fs');var fs_extra=require(_0x45f3('0x7'));var _=require(_0x45f3('0x8'));var squel=require(_0x45f3('0x9'));var crypto=require('crypto');var jsforce=require(_0x45f3('0xa'));var deskjs=require(_0x45f3('0xb'));var toCsv=require(_0x45f3('0xc'));var querystring=require(_0x45f3('0xd'));var Papa=require(_0x45f3('0xe'));var Redis=require(_0x45f3('0xf'));var authService=require(_0x45f3('0x10'));var qs=require(_0x45f3('0x11'));var as=require(_0x45f3('0x12'));var hardwareService=require(_0x45f3('0x13'));var logger=require('../../config/logger')(_0x45f3('0x14'));var utils=require(_0x45f3('0x15'));var config=require(_0x45f3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x45f3('0x17'))['db'];function respondWithStatusCode(_0xed2141,_0x4da397){_0x4da397=_0x4da397||0xcc;return function(_0x48370c){if(_0x48370c){return _0xed2141[_0x45f3('0x18')](_0x4da397);}return _0xed2141[_0x45f3('0x19')](_0x4da397)[_0x45f3('0x1a')]();};}function respondWithResult(_0x4ad7fa,_0x268a59){_0x268a59=_0x268a59||0xc8;return function(_0x2ac927){if(_0x2ac927){return _0x4ad7fa[_0x45f3('0x19')](_0x268a59)[_0x45f3('0x1b')](_0x2ac927);}};}function respondWithFilteredResult(_0x1029ec,_0x2805ef){return function(_0x1af1c0){if(_0x1af1c0){var _0x4c82b8=typeof _0x2805ef[_0x45f3('0x1c')]===_0x45f3('0x1d')&&typeof _0x2805ef[_0x45f3('0x1e')]===_0x45f3('0x1d');var _0x495a5b=_0x1af1c0[_0x45f3('0x1f')];var _0x5ac120=_0x4c82b8?0x0:_0x2805ef[_0x45f3('0x1c')];var _0x39b875=_0x4c82b8?_0x1af1c0[_0x45f3('0x1f')]:_0x2805ef[_0x45f3('0x1c')]+_0x2805ef[_0x45f3('0x1e')];var _0x31a9ee;if(_0x39b875>=_0x495a5b){_0x39b875=_0x495a5b;_0x31a9ee=0xc8;}else{_0x31a9ee=0xce;}_0x1029ec[_0x45f3('0x19')](_0x31a9ee);return _0x1029ec[_0x45f3('0x20')](_0x45f3('0x21'),_0x5ac120+'-'+_0x39b875+'/'+_0x495a5b)['json'](_0x1af1c0);}return null;};}function patchUpdates(_0x591161){return function(_0x56482){try{jsonpatch[_0x45f3('0x22')](_0x56482,_0x591161,!![]);}catch(_0x55c628){return BPromise[_0x45f3('0x23')](_0x55c628);}return _0x56482['save']();};}function saveUpdates(_0x194527,_0x2146ad){return function(_0x271459){if(_0x271459){return _0x271459['update'](_0x194527)['then'](function(_0x58c107){return _0x58c107;});}return null;};}function removeEntity(_0x2db929,_0x4c1bd6){return function(_0x4a8465){if(_0x4a8465){return _0x4a8465[_0x45f3('0x24')]()[_0x45f3('0x25')](function(){var _0x4e3df4=_0x4a8465[_0x45f3('0x26')]({'plain':!![]});var _0x31e611=_0x45f3('0x27');return db[_0x45f3('0x28')][_0x45f3('0x24')]({'where':{'type':_0x31e611,'resourceId':_0x4e3df4['id']}})[_0x45f3('0x25')](function(){return _0x4a8465;});})['then'](function(){_0x2db929[_0x45f3('0x19')](0xcc)[_0x45f3('0x1a')]();});}};}function handleEntityNotFound(_0x576ce9,_0x2c876b){return function(_0xcf1d2a){if(!_0xcf1d2a){_0x576ce9[_0x45f3('0x18')](0x194);}return _0xcf1d2a;};}function handleError(_0x3b89f6,_0x209fc2){_0x209fc2=_0x209fc2||0x1f4;return function(_0xb77165){logger[_0x45f3('0x29')](_0xb77165[_0x45f3('0x2a')]);if(_0xb77165[_0x45f3('0x2b')]){delete _0xb77165[_0x45f3('0x2b')];}_0x3b89f6[_0x45f3('0x19')](_0x209fc2)[_0x45f3('0x2c')](_0xb77165);};}exports[_0x45f3('0x2d')]=function(_0x474b12,_0xb253a9){var _0x2fe261={},_0x580f22={},_0x2bc481={'count':0x0,'rows':[]};var _0x57332c=_['map'](db[_0x45f3('0x2e')]['rawAttributes'],function(_0x8e78cd){return{'name':_0x8e78cd[_0x45f3('0x2f')],'type':_0x8e78cd[_0x45f3('0x30')]['key']};});_0x580f22['model']=_[_0x45f3('0x31')](_0x57332c,_0x45f3('0x2b'));_0x580f22[_0x45f3('0x32')]=_[_0x45f3('0x33')](_0x474b12[_0x45f3('0x32')]);_0x580f22['filters']=_[_0x45f3('0x34')](_0x580f22[_0x45f3('0x35')],_0x580f22[_0x45f3('0x32')]);_0x2fe261['attributes']=_['intersection'](_0x580f22[_0x45f3('0x35')],qs[_0x45f3('0x36')](_0x474b12[_0x45f3('0x32')]['fields']));_0x2fe261[_0x45f3('0x37')]=_0x2fe261[_0x45f3('0x37')][_0x45f3('0x38')]?_0x2fe261[_0x45f3('0x37')]:_0x580f22[_0x45f3('0x35')];if(!_0x474b12[_0x45f3('0x32')][_0x45f3('0x39')](_0x45f3('0x3a'))){_0x2fe261[_0x45f3('0x1e')]=qs[_0x45f3('0x1e')](_0x474b12[_0x45f3('0x32')][_0x45f3('0x1e')]);_0x2fe261['offset']=qs['offset'](_0x474b12[_0x45f3('0x32')][_0x45f3('0x1c')]);}_0x2fe261[_0x45f3('0x3b')]=qs[_0x45f3('0x3c')](_0x474b12[_0x45f3('0x32')]['sort']);_0x2fe261[_0x45f3('0x3d')]=qs[_0x45f3('0x3e')](_[_0x45f3('0x3f')](_0x474b12['query'],_0x580f22[_0x45f3('0x3e')]),_0x57332c);if(_0x474b12[_0x45f3('0x32')][_0x45f3('0x40')]){_0x2fe261[_0x45f3('0x3d')]=_['merge'](_0x2fe261[_0x45f3('0x3d')],{'$or':[{'key':{'$like':'%'+_0x474b12['query']['filter']+'%'}},{'value':{'$like':'%'+_0x474b12[_0x45f3('0x32')][_0x45f3('0x40')]+'%'}}]});}_0x2fe261=_[_0x45f3('0x41')]({},_0x2fe261,_0x474b12[_0x45f3('0x42')]);var _0x2dd3af={'where':_0x2fe261[_0x45f3('0x3d')]};return db['CannedAnswer']['count'](_0x2dd3af)[_0x45f3('0x25')](function(_0x27d61c){_0x2bc481[_0x45f3('0x1f')]=_0x27d61c;if(_0x474b12['query']['includeAll']){_0x2fe261[_0x45f3('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0x45f3('0x44')](_0x2fe261);})[_0x45f3('0x25')](function(_0x5cb9d6){_0x2bc481[_0x45f3('0x45')]=_0x5cb9d6;return _0x2bc481;})['then'](respondWithFilteredResult(_0xb253a9,_0x2fe261))[_0x45f3('0x46')](handleError(_0xb253a9,null));};exports[_0x45f3('0x47')]=function(_0x2fc2bf,_0xf1ffba){var _0x5a3812={'raw':!![],'where':{'id':_0x2fc2bf[_0x45f3('0x48')]['id']}},_0x3fb943={};_0x3fb943[_0x45f3('0x35')]=_[_0x45f3('0x33')](db['CannedAnswer'][_0x45f3('0x49')]);_0x3fb943[_0x45f3('0x32')]=_[_0x45f3('0x33')](_0x2fc2bf['query']);_0x3fb943[_0x45f3('0x3e')]=_[_0x45f3('0x34')](_0x3fb943['model'],_0x3fb943[_0x45f3('0x32')]);_0x5a3812['attributes']=_[_0x45f3('0x34')](_0x3fb943[_0x45f3('0x35')],qs['fields'](_0x2fc2bf[_0x45f3('0x32')][_0x45f3('0x36')]));_0x5a3812[_0x45f3('0x37')]=_0x5a3812[_0x45f3('0x37')][_0x45f3('0x38')]?_0x5a3812[_0x45f3('0x37')]:_0x3fb943[_0x45f3('0x35')];if(_0x2fc2bf[_0x45f3('0x32')]['includeAll']){_0x5a3812[_0x45f3('0x43')]=[{'all':!![]}];}_0x5a3812=_[_0x45f3('0x41')]({},_0x5a3812,_0x2fc2bf[_0x45f3('0x42')]);return db[_0x45f3('0x2e')][_0x45f3('0x4a')](_0x5a3812)[_0x45f3('0x25')](handleEntityNotFound(_0xf1ffba,null))[_0x45f3('0x25')](respondWithResult(_0xf1ffba,null))['catch'](handleError(_0xf1ffba,null));};exports[_0x45f3('0x4b')]=function(_0x399d79,_0x3a231e){if(_0x399d79['body']['id']){delete _0x399d79[_0x45f3('0x4c')]['id'];}return db[_0x45f3('0x2e')][_0x45f3('0x4a')]({'where':{'id':_0x399d79[_0x45f3('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a231e,null))[_0x45f3('0x25')](saveUpdates(_0x399d79[_0x45f3('0x4c')],null))[_0x45f3('0x25')](respondWithResult(_0x3a231e,null))['catch'](handleError(_0x3a231e,null));};exports['destroy']=function(_0x3a68d1,_0xf8f68f){return db[_0x45f3('0x2e')]['find']({'where':{'id':_0x3a68d1['params']['id']}})[_0x45f3('0x25')](handleEntityNotFound(_0xf8f68f,null))[_0x45f3('0x25')](removeEntity(_0xf8f68f,null))[_0x45f3('0x46')](handleError(_0xf8f68f,null));};exports['create']=function(_0x56a35b,_0x4ea8d5){var _0x833ee8={'key':_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x4d')]};if(_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x4e')]){_0x833ee8[_0x45f3('0x4e')]=_0x56a35b['body'][_0x45f3('0x4e')];}else if(_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x4f')]){_0x833ee8['SmsAccountId']=_0x56a35b[_0x45f3('0x4c')]['SmsAccountId'];}else if(_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x50')]){_0x833ee8[_0x45f3('0x50')]=_0x56a35b[_0x45f3('0x4c')]['OpenchannelAccountId'];}else if(_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x51')]){_0x833ee8[_0x45f3('0x51')]=_0x56a35b[_0x45f3('0x4c')][_0x45f3('0x51')];}return db[_0x45f3('0x2e')][_0x45f3('0x4a')]({'where':_0x833ee8})[_0x45f3('0x25')](function(_0x3f92af){if(_0x3f92af){throw new db[(_0x45f3('0x52'))][(_0x45f3('0x53'))](_0x45f3('0x54'));}return db['CannedAnswer'][_0x45f3('0x55')](_0x56a35b['body']);})[_0x45f3('0x25')](function(_0x473ba1){var _0x4d8cc2=_0x56a35b[_0x45f3('0x56')]['get']({'plain':!![]});if(!_0x4d8cc2)throw new Error(_0x45f3('0x57'));if(_0x4d8cc2[_0x45f3('0x58')]===_0x45f3('0x56')){var _0x44ae01=_0x473ba1[_0x45f3('0x26')]({'plain':!![]});return db[_0x45f3('0x59')][_0x45f3('0x4a')]({'where':{'name':_0x45f3('0x27'),'userProfileId':_0x4d8cc2[_0x45f3('0x5a')]},'raw':!![]})[_0x45f3('0x25')](function(_0x969cba){if(_0x969cba&&_0x969cba[_0x45f3('0x5b')]===0x0){return db[_0x45f3('0x28')][_0x45f3('0x55')]({'name':_0x44ae01[_0x45f3('0x2b')],'resourceId':_0x44ae01['id'],'type':_0x969cba[_0x45f3('0x2b')],'sectionId':_0x969cba['id']},{})['then'](function(){return _0x473ba1;});}else{return _0x473ba1;}})[_0x45f3('0x46')](function(_0x3468f0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3468f0);throw _0x3468f0;});}return _0x473ba1;})[_0x45f3('0x25')](respondWithResult(_0x4ea8d5,0xc9))[_0x45f3('0x46')](handleError(_0x4ea8d5,null));}; \ No newline at end of file +var _0x3e8e=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','findAll','rows','catch','show','params','length','include','options','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3149c6,_0x54f974){var _0x4f4dc9=function(_0x17a268){while(--_0x17a268){_0x3149c6['push'](_0x3149c6['shift']());}};_0x4f4dc9(++_0x54f974);}(_0x3e8e,0x152));var _0xe3e8=function(_0x54ca2c,_0xcae620){_0x54ca2c=_0x54ca2c-0x0;var _0x60ef93=_0x3e8e[_0x54ca2c];return _0x60ef93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3e8('0x0'));var zipdir=require(_0xe3e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3e8('0x2'));var moment=require(_0xe3e8('0x3'));var BPromise=require(_0xe3e8('0x4'));var Mustache=require(_0xe3e8('0x5'));var util=require(_0xe3e8('0x6'));var path=require(_0xe3e8('0x7'));var sox=require(_0xe3e8('0x8'));var csv=require('to-csv');var ejs=require(_0xe3e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe3e8('0xa'));var crypto=require(_0xe3e8('0xb'));var jsforce=require(_0xe3e8('0xc'));var deskjs=require(_0xe3e8('0xd'));var toCsv=require(_0xe3e8('0xe'));var querystring=require(_0xe3e8('0xf'));var Papa=require('papaparse');var Redis=require(_0xe3e8('0x10'));var authService=require(_0xe3e8('0x11'));var qs=require(_0xe3e8('0x12'));var as=require(_0xe3e8('0x13'));var hardwareService=require(_0xe3e8('0x14'));var logger=require(_0xe3e8('0x15'))('api');var utils=require(_0xe3e8('0x16'));var config=require(_0xe3e8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3e8('0x18'))['db'];function respondWithStatusCode(_0x161edd,_0x4ac162){_0x4ac162=_0x4ac162||0xcc;return function(_0xc07280){if(_0xc07280){return _0x161edd[_0xe3e8('0x19')](_0x4ac162);}return _0x161edd[_0xe3e8('0x1a')](_0x4ac162)[_0xe3e8('0x1b')]();};}function respondWithResult(_0x3253d7,_0xa73cd5){_0xa73cd5=_0xa73cd5||0xc8;return function(_0x26aa3f){if(_0x26aa3f){return _0x3253d7[_0xe3e8('0x1a')](_0xa73cd5)[_0xe3e8('0x1c')](_0x26aa3f);}};}function respondWithFilteredResult(_0x10edb6,_0x2b75f8){return function(_0x446d63){if(_0x446d63){var _0x1aaefd=typeof _0x2b75f8[_0xe3e8('0x1d')]===_0xe3e8('0x1e')&&typeof _0x2b75f8['limit']==='undefined';var _0xb153c3=_0x446d63[_0xe3e8('0x1f')];var _0x514dca=_0x1aaefd?0x0:_0x2b75f8['offset'];var _0x3ed325=_0x1aaefd?_0x446d63[_0xe3e8('0x1f')]:_0x2b75f8[_0xe3e8('0x1d')]+_0x2b75f8[_0xe3e8('0x20')];var _0x52ee86;if(_0x3ed325>=_0xb153c3){_0x3ed325=_0xb153c3;_0x52ee86=0xc8;}else{_0x52ee86=0xce;}_0x10edb6[_0xe3e8('0x1a')](_0x52ee86);return _0x10edb6[_0xe3e8('0x21')](_0xe3e8('0x22'),_0x514dca+'-'+_0x3ed325+'/'+_0xb153c3)[_0xe3e8('0x1c')](_0x446d63);}return null;};}function patchUpdates(_0x1f10e2){return function(_0x11a552){try{jsonpatch['apply'](_0x11a552,_0x1f10e2,!![]);}catch(_0x399da7){return BPromise['reject'](_0x399da7);}return _0x11a552[_0xe3e8('0x23')]();};}function saveUpdates(_0x2c3f2b,_0x3677bf){return function(_0x48d1d1){if(_0x48d1d1){return _0x48d1d1[_0xe3e8('0x24')](_0x2c3f2b)[_0xe3e8('0x25')](function(_0x635db6){return _0x635db6;});}return null;};}function removeEntity(_0x3c318a,_0x4fdedf){return function(_0x550b4b){if(_0x550b4b){return _0x550b4b['destroy']()[_0xe3e8('0x25')](function(){var _0x56372a=_0x550b4b[_0xe3e8('0x26')]({'plain':!![]});var _0xbf8836=_0xe3e8('0x27');return db[_0xe3e8('0x28')]['destroy']({'where':{'type':_0xbf8836,'resourceId':_0x56372a['id']}})[_0xe3e8('0x25')](function(){return _0x550b4b;});})[_0xe3e8('0x25')](function(){_0x3c318a[_0xe3e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1e93,_0x263b9e){return function(_0x4fcfd0){if(!_0x4fcfd0){_0x1f1e93[_0xe3e8('0x19')](0x194);}return _0x4fcfd0;};}function handleError(_0x16b341,_0x2abfb4){_0x2abfb4=_0x2abfb4||0x1f4;return function(_0x1cd936){logger['error'](_0x1cd936[_0xe3e8('0x29')]);if(_0x1cd936['name']){delete _0x1cd936[_0xe3e8('0x2a')];}_0x16b341[_0xe3e8('0x1a')](_0x2abfb4)[_0xe3e8('0x2b')](_0x1cd936);};}exports[_0xe3e8('0x2c')]=function(_0x3a53fc,_0x3ec98){var _0x10c092={},_0x2faa05={},_0x1bd98f={'count':0x0,'rows':[]};var _0x1a7966=_[_0xe3e8('0x2d')](db[_0xe3e8('0x2e')][_0xe3e8('0x2f')],function(_0x396179){return{'name':_0x396179[_0xe3e8('0x30')],'type':_0x396179[_0xe3e8('0x31')][_0xe3e8('0x32')]};});_0x2faa05[_0xe3e8('0x33')]=_[_0xe3e8('0x2d')](_0x1a7966,'name');_0x2faa05[_0xe3e8('0x34')]=_[_0xe3e8('0x35')](_0x3a53fc['query']);_0x2faa05['filters']=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],_0x2faa05[_0xe3e8('0x34')]);_0x10c092[_0xe3e8('0x37')]=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],qs['fields'](_0x3a53fc['query'][_0xe3e8('0x38')]));_0x10c092[_0xe3e8('0x37')]=_0x10c092[_0xe3e8('0x37')]['length']?_0x10c092['attributes']:_0x2faa05[_0xe3e8('0x33')];if(!_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x39')]('nolimit')){_0x10c092[_0xe3e8('0x20')]=qs['limit'](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x20')]);_0x10c092['offset']=qs[_0xe3e8('0x1d')](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x1d')]);}_0x10c092[_0xe3e8('0x3a')]=qs[_0xe3e8('0x3b')](_0x3a53fc['query'][_0xe3e8('0x3b')]);_0x10c092['where']=qs[_0xe3e8('0x3c')](_['pick'](_0x3a53fc['query'],_0x2faa05['filters']),_0x1a7966);if(_0x3a53fc['query'][_0xe3e8('0x3d')]){_0x10c092[_0xe3e8('0x3e')]=_['merge'](_0x10c092[_0xe3e8('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}}]});}_0x10c092=_[_0xe3e8('0x3f')]({},_0x10c092,_0x3a53fc['options']);var _0x33ade0={'where':_0x10c092[_0xe3e8('0x3e')]};return db['CannedAnswer'][_0xe3e8('0x1f')](_0x33ade0)[_0xe3e8('0x25')](function(_0xcaabd4){_0x1bd98f[_0xe3e8('0x1f')]=_0xcaabd4;if(_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x40')]){_0x10c092['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xe3e8('0x41')](_0x10c092);})[_0xe3e8('0x25')](function(_0x640a31){_0x1bd98f[_0xe3e8('0x42')]=_0x640a31;return _0x1bd98f;})[_0xe3e8('0x25')](respondWithFilteredResult(_0x3ec98,_0x10c092))[_0xe3e8('0x43')](handleError(_0x3ec98,null));};exports[_0xe3e8('0x44')]=function(_0x458ed5,_0x7d2b24){var _0x3d2565={'raw':!![],'where':{'id':_0x458ed5[_0xe3e8('0x45')]['id']}},_0x56e101={};_0x56e101['model']=_[_0xe3e8('0x35')](db[_0xe3e8('0x2e')]['rawAttributes']);_0x56e101['query']=_[_0xe3e8('0x35')](_0x458ed5['query']);_0x56e101[_0xe3e8('0x3c')]=_[_0xe3e8('0x36')](_0x56e101['model'],_0x56e101[_0xe3e8('0x34')]);_0x3d2565[_0xe3e8('0x37')]=_['intersection'](_0x56e101[_0xe3e8('0x33')],qs[_0xe3e8('0x38')](_0x458ed5[_0xe3e8('0x34')][_0xe3e8('0x38')]));_0x3d2565[_0xe3e8('0x37')]=_0x3d2565[_0xe3e8('0x37')][_0xe3e8('0x46')]?_0x3d2565['attributes']:_0x56e101['model'];if(_0x458ed5['query'][_0xe3e8('0x40')]){_0x3d2565[_0xe3e8('0x47')]=[{'all':!![]}];}_0x3d2565=_[_0xe3e8('0x3f')]({},_0x3d2565,_0x458ed5[_0xe3e8('0x48')]);return db[_0xe3e8('0x2e')][_0xe3e8('0x49')](_0x3d2565)[_0xe3e8('0x25')](handleEntityNotFound(_0x7d2b24,null))[_0xe3e8('0x25')](respondWithResult(_0x7d2b24,null))[_0xe3e8('0x43')](handleError(_0x7d2b24,null));};exports[_0xe3e8('0x24')]=function(_0x1a41ca,_0x4de655){if(_0x1a41ca['body']['id']){delete _0x1a41ca[_0xe3e8('0x4a')]['id'];}return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x1a41ca[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0x4de655,null))[_0xe3e8('0x25')](saveUpdates(_0x1a41ca[_0xe3e8('0x4a')],null))[_0xe3e8('0x25')](respondWithResult(_0x4de655,null))[_0xe3e8('0x43')](handleError(_0x4de655,null));};exports[_0xe3e8('0x4b')]=function(_0x2c0d1a,_0xfafff){return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x2c0d1a[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0xfafff,null))[_0xe3e8('0x25')](removeEntity(_0xfafff,null))[_0xe3e8('0x43')](handleError(_0xfafff,null));};exports[_0xe3e8('0x4c')]=function(_0x6c0339,_0x3d95a3){var _0x1af860={'key':_0x6c0339[_0xe3e8('0x4a')]['key']};if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')]){_0x1af860[_0xe3e8('0x4d')]=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4e')]){_0x1af860['SmsAccountId']=_0x6c0339['body'][_0xe3e8('0x4e')];}else if(_0x6c0339['body'][_0xe3e8('0x4f')]){_0x1af860[_0xe3e8('0x4f')]=_0x6c0339['body'][_0xe3e8('0x4f')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')]){_0x1af860['ChatWebsiteId']=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')];}return db['CannedAnswer'][_0xe3e8('0x49')]({'where':_0x1af860})[_0xe3e8('0x25')](function(_0x3310b5){if(_0x3310b5){throw new db[(_0xe3e8('0x51'))][(_0xe3e8('0x52'))](_0xe3e8('0x53'));}return db[_0xe3e8('0x2e')]['create'](_0x6c0339[_0xe3e8('0x4a')]);})[_0xe3e8('0x25')](function(_0x5dd140){var _0x40b1de=_0x6c0339[_0xe3e8('0x54')][_0xe3e8('0x26')]({'plain':!![]});if(!_0x40b1de)throw new Error(_0xe3e8('0x55'));if(_0x40b1de[_0xe3e8('0x56')]==='user'){var _0x440371=_0x5dd140[_0xe3e8('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe3e8('0x27'),'userProfileId':_0x40b1de[_0xe3e8('0x57')]},'raw':!![]})[_0xe3e8('0x25')](function(_0x2e8f30){if(_0x2e8f30&&_0x2e8f30['autoAssociation']===0x0){return db[_0xe3e8('0x28')][_0xe3e8('0x4c')]({'name':_0x440371['name'],'resourceId':_0x440371['id'],'type':_0x2e8f30[_0xe3e8('0x2a')],'sectionId':_0x2e8f30['id']},{})[_0xe3e8('0x25')](function(){return _0x5dd140;});}else{return _0x5dd140;}})['catch'](function(_0x5a9155){logger[_0xe3e8('0x58')](_0xe3e8('0x59'),_0x5a9155);throw _0x5a9155;});}return _0x5dd140;})[_0xe3e8('0x25')](respondWithResult(_0x3d95a3,0xc9))[_0xe3e8('0x43')](handleError(_0x3d95a3,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f9d0b9c..46bd1c9 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 _0x5155=['CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x3c52cb,_0x3822cb){var _0xc6f33=function(_0x3cbfbc){while(--_0x3cbfbc){_0x3c52cb['push'](_0x3c52cb['shift']());}};_0xc6f33(++_0x3822cb);}(_0x5155,0x1c9));var _0x5515=function(_0x155bd1,_0x1fce0d){_0x155bd1=_0x155bd1-0x0;var _0x932f67=_0x5155[_0x155bd1];return _0x932f67;};'use strict';var _=require(_0x5515('0x0'));var util=require(_0x5515('0x1'));var logger=require(_0x5515('0x2'))('api');var moment=require(_0x5515('0x3'));var BPromise=require(_0x5515('0x4'));var rp=require(_0x5515('0x5'));var fs=require('fs');var path=require(_0x5515('0x6'));var rimraf=require(_0x5515('0x7'));var config=require(_0x5515('0x8'));var attributes=require(_0x5515('0x9'));module[_0x5515('0xa')]=function(_0x1fdec5,_0x4a5f71){return _0x1fdec5['define'](_0x5515('0xb'),attributes,{'tableName':_0x5515('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x56c8=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x273417,_0x23d212){var _0x3fdfc1=function(_0x5a13f6){while(--_0x5a13f6){_0x273417['push'](_0x273417['shift']());}};_0x3fdfc1(++_0x23d212);}(_0x56c8,0x170));var _0x856c=function(_0x428a54,_0x5f003f){_0x428a54=_0x428a54-0x0;var _0x5d9462=_0x56c8[_0x428a54];return _0x5d9462;};'use strict';var _=require('lodash');var util=require(_0x856c('0x0'));var logger=require(_0x856c('0x1'))(_0x856c('0x2'));var moment=require(_0x856c('0x3'));var BPromise=require(_0x856c('0x4'));var rp=require(_0x856c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x856c('0x6'));var attributes=require(_0x856c('0x7'));module[_0x856c('0x8')]=function(_0x5dce8c,_0x54b3fc){return _0x5dce8c['define'](_0x856c('0x9'),attributes,{'tableName':_0x856c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x856c('0xb'),'collate':_0x856c('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0a886fb..21570e4 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(_0x17556f,_0x189258){var _0x13e7df=function(_0x3e8338){while(--_0x3e8338){_0x17556f['push'](_0x17556f['shift']());}};_0x13e7df(++_0x189258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x576562,_0x2e5c9d){var _0x589e8d=function(_0x5de7e6){while(--_0x5de7e6){_0x576562['push'](_0x576562['shift']());}};_0x589e8d(++_0x2e5c9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 1444400..bf1445b 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 _0xddcc=['../../config/environment','./cannedAnswer.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x37d1dd,_0x328b44){var _0x49539d=function(_0x381aa5){while(--_0x381aa5){_0x37d1dd['push'](_0x37d1dd['shift']());}};_0x49539d(++_0x328b44);}(_0xddcc,0xdf));var _0xcddc=function(_0x347068,_0x588858){_0x347068=_0x347068-0x0;var _0xcedb5e=_0xddcc[_0x347068];return _0xcedb5e;};'use strict';var multer=require(_0xcddc('0x0'));var util=require(_0xcddc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcddc('0x2'));var router=express['Router']();var fs_extra=require(_0xcddc('0x3'));var auth=require(_0xcddc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcddc('0x5'));var controller=require(_0xcddc('0x6'));router[_0xcddc('0x7')]('/',auth['isAuthenticated'](),controller[_0xcddc('0x8')]);router[_0xcddc('0x7')]('/:id',auth[_0xcddc('0x9')](),controller[_0xcddc('0xa')]);router[_0xcddc('0xb')]('/',auth[_0xcddc('0x9')](),controller[_0xcddc('0xc')]);router[_0xcddc('0xd')](_0xcddc('0xe'),auth[_0xcddc('0x9')](),controller[_0xcddc('0xf')]);router[_0xcddc('0x10')](_0xcddc('0xe'),auth[_0xcddc('0x9')](),controller[_0xcddc('0x11')]);module[_0xcddc('0x12')]=router; \ No newline at end of file +var _0x290a=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x3b1440,_0x493da1){var _0x3c56c5=function(_0x5e656c){while(--_0x5e656c){_0x3b1440['push'](_0x3b1440['shift']());}};_0x3c56c5(++_0x493da1);}(_0x290a,0x9a));var _0xa290=function(_0x3f9e11,_0x12005e){_0x3f9e11=_0x3f9e11-0x0;var _0x548e82=_0x290a[_0x3f9e11];return _0x548e82;};'use strict';var multer=require(_0xa290('0x0'));var util=require('util');var path=require(_0xa290('0x1'));var timeout=require('connect-timeout');var express=require(_0xa290('0x2'));var router=express['Router']();var fs_extra=require(_0xa290('0x3'));var auth=require(_0xa290('0x4'));var interaction=require(_0xa290('0x5'));var config=require('../../config/environment');var controller=require(_0xa290('0x6'));router[_0xa290('0x7')]('/',auth[_0xa290('0x8')](),controller['index']);router[_0xa290('0x7')](_0xa290('0x9'),auth['isAuthenticated'](),controller[_0xa290('0xa')]);router[_0xa290('0xb')]('/',auth[_0xa290('0x8')](),controller[_0xa290('0xc')]);router[_0xa290('0xd')]('/:id',auth[_0xa290('0x8')](),controller['update']);router[_0xa290('0xe')]('/:id',auth[_0xa290('0x8')](),controller[_0xa290('0xf')]);module[_0xa290('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 237146b..b6be1c1 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 _0x78f0=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x78f0,0x15d));var _0x078f=function(_0x1650c4,_0x354a24){_0x1650c4=_0x1650c4-0x0;var _0x48948b=_0x78f0[_0x1650c4];return _0x48948b;};'use strict';var Sequelize=require(_0x078f('0x0'));module[_0x078f('0x1')]={'calldate':{'type':Sequelize[_0x078f('0x2')],'allowNull':![],'defaultValue':_0x078f('0x3')},'clid':{'type':Sequelize[_0x078f('0x4')]},'src':{'type':Sequelize[_0x078f('0x4')]},'dst':{'type':Sequelize[_0x078f('0x4')]},'dcontext':{'type':Sequelize[_0x078f('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x078f('0x4')]},'lastapp':{'type':Sequelize[_0x078f('0x4')]},'lastdata':{'type':Sequelize[_0x078f('0x4')]},'duration':{'type':Sequelize[_0x078f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x078f('0x4')]},'amaflags':{'type':Sequelize[_0x078f('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x078f('0x4')]},'uniqueid':{'type':Sequelize[_0x078f('0x4')]},'linkedid':{'type':Sequelize[_0x078f('0x4')]},'sequence':{'type':Sequelize[_0x078f('0x4')]},'peeraccount':{'type':Sequelize[_0x078f('0x4')]},'type':{'type':Sequelize[_0x078f('0x4')]},'tag':{'type':Sequelize[_0x078f('0x4')]}}; \ No newline at end of file +var _0xdeb7=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x597bd0,_0x25db46){var _0x97ae53=function(_0xb33418){while(--_0xb33418){_0x597bd0['push'](_0x597bd0['shift']());}};_0x97ae53(++_0x25db46);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7deb('0x0'));module[_0x7deb('0x1')]={'calldate':{'type':Sequelize[_0x7deb('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7deb('0x3')]},'src':{'type':Sequelize[_0x7deb('0x3')]},'dst':{'type':Sequelize[_0x7deb('0x3')]},'dcontext':{'type':Sequelize[_0x7deb('0x3')]},'channel':{'type':Sequelize[_0x7deb('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7deb('0x3')]},'lastdata':{'type':Sequelize[_0x7deb('0x3')]},'duration':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7deb('0x3')]},'amaflags':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7deb('0x3')]},'uniqueid':{'type':Sequelize[_0x7deb('0x3')]},'linkedid':{'type':Sequelize[_0x7deb('0x3')]},'sequence':{'type':Sequelize[_0x7deb('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7deb('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 270b8d3..874224e 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 _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x15781b,_0x4db9bb){var _0x20f955=function(_0x636ad0){while(--_0x636ad0){_0x15781b['push'](_0x15781b['shift']());}};_0x20f955(++_0x4db9bb);}(_0x106f,0x162));var _0xf106=function(_0x5a96a6,_0xa73e0e){_0x5a96a6=_0x5a96a6-0x0;var _0x33dabc=_0x106f[_0x5a96a6];return _0x33dabc;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x55ca[_0x30c2ae];return _0x1ee1cc;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['Cdr'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e2e37bd..dc42364 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x12f14d,_0x44f551){var _0x16a223=function(_0x3d5803){while(--_0x3d5803){_0x12f14d['push'](_0x12f14d['shift']());}};_0x16a223(++_0x44f551);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xa99ff1,_0x4b2416){var _0x4594ba=function(_0x5e547e){while(--_0x5e547e){_0xa99ff1['push'](_0xa99ff1['shift']());}};_0x4594ba(++_0x4b2416);}(_0x7a54,0x106));var _0x47a5=function(_0x2f8df5,_0x23b09e){_0x2f8df5=_0x2f8df5-0x0;var _0x10c3fb=_0x7a54[_0x2f8df5];return _0x10c3fb;};'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 757e97f..5c9da86 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 _0x5980=['then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x49e372,_0x107bbb){var _0x3e31ca=function(_0x559b0f){while(--_0x559b0f){_0x49e372['push'](_0x49e372['shift']());}};_0x3e31ca(++_0x107bbb);}(_0x5980,0x1da));var _0x0598=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x5980[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x0598('0x0'));var util=require('util');var moment=require(_0x0598('0x1'));var BPromise=require('bluebird');var rs=require(_0x0598('0x2'));var fs=require('fs');var Redis=require(_0x0598('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0598('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0598('0x5'));var jayson=require(_0x0598('0x6'));var client=jayson[_0x0598('0x7')][_0x0598('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11a7b7,_0x3d4e3a,_0x2e6cae){return new BPromise(function(_0x34e2c8,_0x4dff96){return client[_0x0598('0x9')](_0x11a7b7,_0x2e6cae)[_0x0598('0xa')](function(_0x1f836f){logger[_0x0598('0xb')]('Cdr,\x20%s,\x20%s',_0x3d4e3a,_0x0598('0xc'));logger[_0x0598('0xd')](_0x0598('0xe'),_0x3d4e3a,_0x0598('0xc'),JSON[_0x0598('0xf')](_0x1f836f));if(_0x1f836f[_0x0598('0x10')]){if(_0x1f836f[_0x0598('0x10')][_0x0598('0x11')]===0x1f4){logger[_0x0598('0x10')](_0x0598('0x12'),_0x3d4e3a,_0x1f836f['error']['message']);return _0x4dff96(_0x1f836f[_0x0598('0x10')][_0x0598('0x13')]);}logger['error'](_0x0598('0x12'),_0x3d4e3a,_0x1f836f[_0x0598('0x10')][_0x0598('0x13')]);return _0x34e2c8(_0x1f836f[_0x0598('0x10')][_0x0598('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x3d4e3a,'request\x20sent');_0x34e2c8(_0x1f836f[_0x0598('0x14')][_0x0598('0x13')]);}})[_0x0598('0x15')](function(_0x1ff32b){logger[_0x0598('0x10')](_0x0598('0x12'),_0x3d4e3a,_0x1ff32b);_0x4dff96(_0x1ff32b);});});} \ No newline at end of file +var _0x9f99=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19e939,_0x301940){var _0x27567c=function(_0x67d3f4){while(--_0x67d3f4){_0x19e939['push'](_0x19e939['shift']());}};_0x27567c(++_0x301940);}(_0x9f99,0x16c));var _0x99f9=function(_0x562844,_0x96767f){_0x562844=_0x562844-0x0;var _0x3d65ae=_0x9f99[_0x562844];return _0x3d65ae;};'use strict';var _=require(_0x99f9('0x0'));var util=require(_0x99f9('0x1'));var moment=require(_0x99f9('0x2'));var BPromise=require(_0x99f9('0x3'));var rs=require(_0x99f9('0x4'));var fs=require('fs');var Redis=require(_0x99f9('0x5'));var db=require(_0x99f9('0x6'))['db'];var utils=require(_0x99f9('0x7'));var logger=require(_0x99f9('0x8'))(_0x99f9('0x9'));var config=require('../../config/environment');var jayson=require(_0x99f9('0xa'));var client=jayson['client'][_0x99f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f423,_0x53e259,_0x5e710a){return new BPromise(function(_0x393425,_0x3a83b2){return client[_0x99f9('0xc')](_0x13f423,_0x5e710a)[_0x99f9('0xd')](function(_0x1156c8){logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,_0x99f9('0x10'));logger[_0x99f9('0x11')](_0x99f9('0x12'),_0x53e259,_0x99f9('0x10'),JSON[_0x99f9('0x13')](_0x1156c8));if(_0x1156c8[_0x99f9('0x14')]){if(_0x1156c8['error'][_0x99f9('0x15')]===0x1f4){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x1156c8[_0x99f9('0x14')]['message']);return _0x3a83b2(_0x1156c8[_0x99f9('0x14')]['message']);}logger[_0x99f9('0x14')]('Cdr,\x20%s,\x20%s',_0x53e259,_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);return _0x393425(_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);}else{logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,'request\x20sent');_0x393425(_0x1156c8[_0x99f9('0x17')][_0x99f9('0x16')]);}})['catch'](function(_0x422cdd){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x422cdd);_0x3a83b2(_0x422cdd);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 977aaba..b6930d6 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c2e7132..c915b86 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 _0xa169=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x50ca6d,_0x56cbf6){var _0x2de7fd=function(_0x31ebe3){while(--_0x31ebe3){_0x50ca6d['push'](_0x50ca6d['shift']());}};_0x2de7fd(++_0x56cbf6);}(_0xa169,0xaa));var _0x9a16=function(_0x857304,_0x565bc4){_0x857304=_0x857304-0x0;var _0x3af6fa=_0xa169[_0x857304];return _0x3af6fa;};'use strict';var Sequelize=require(_0x9a16('0x0'));module[_0x9a16('0x1')]={'priority':{'type':Sequelize[_0x9a16('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9a16('0x3')]()},'description':{'type':Sequelize[_0x9a16('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9a16('0x5')}}; \ No newline at end of file +var _0x9c85=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x278b5f,_0x451f15){var _0xd1251b=function(_0x1e770c){while(--_0x1e770c){_0x278b5f['push'](_0x278b5f['shift']());}};_0xd1251b(++_0x451f15);}(_0x9c85,0xf5));var _0x59c8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9c85[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x59c8('0x0'));module[_0x59c8('0x1')]={'priority':{'type':Sequelize[_0x59c8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x59c8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x59c8('0x4')]},'interval':{'type':Sequelize[_0x59c8('0x4')],'defaultValue':_0x59c8('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c1e2af7..96e6fad 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 _0x205d=['intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','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','../../mysqldb','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys'];(function(_0x557cd2,_0x3d57dd){var _0x120276=function(_0xc51d6d){while(--_0xc51d6d){_0x557cd2['push'](_0x557cd2['shift']());}};_0x120276(++_0x3d57dd);}(_0x205d,0xf6));var _0xd205=function(_0x56ab74,_0x1effda){_0x56ab74=_0x56ab74-0x0;var _0x17d8d0=_0x205d[_0x56ab74];return _0x17d8d0;};'use strict';var emlformat=require(_0xd205('0x0'));var rimraf=require(_0xd205('0x1'));var zipdir=require(_0xd205('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd205('0x3'));var BPromise=require(_0xd205('0x4'));var Mustache=require(_0xd205('0x5'));var util=require('util');var path=require(_0xd205('0x6'));var sox=require(_0xd205('0x7'));var csv=require(_0xd205('0x8'));var ejs=require(_0xd205('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd205('0xa'));var squel=require(_0xd205('0xb'));var crypto=require(_0xd205('0xc'));var jsforce=require(_0xd205('0xd'));var deskjs=require(_0xd205('0xe'));var toCsv=require(_0xd205('0x8'));var querystring=require(_0xd205('0xf'));var Papa=require(_0xd205('0x10'));var Redis=require(_0xd205('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd205('0x12'));var as=require(_0xd205('0x13'));var hardwareService=require(_0xd205('0x14'));var logger=require(_0xd205('0x15'))('api');var utils=require(_0xd205('0x16'));var config=require(_0xd205('0x17'));var licenseUtil=require(_0xd205('0x18'));var db=require(_0xd205('0x19'))['db'];function respondWithStatusCode(_0x1ba89e,_0x23ec66){_0x23ec66=_0x23ec66||0xcc;return function(_0xd53838){if(_0xd53838){return _0x1ba89e['sendStatus'](_0x23ec66);}return _0x1ba89e[_0xd205('0x1a')](_0x23ec66)[_0xd205('0x1b')]();};}function respondWithResult(_0x2ad6db,_0x4f62d8){_0x4f62d8=_0x4f62d8||0xc8;return function(_0x584b3f){if(_0x584b3f){return _0x2ad6db[_0xd205('0x1a')](_0x4f62d8)['json'](_0x584b3f);}};}function respondWithFilteredResult(_0x177854,_0x4a0805){return function(_0x398fc3){if(_0x398fc3){var _0x3a907a=typeof _0x4a0805[_0xd205('0x1c')]===_0xd205('0x1d')&&typeof _0x4a0805['limit']===_0xd205('0x1d');var _0x3d88e3=_0x398fc3[_0xd205('0x1e')];var _0x135e9d=_0x3a907a?0x0:_0x4a0805[_0xd205('0x1c')];var _0x31eb94=_0x3a907a?_0x398fc3[_0xd205('0x1e')]:_0x4a0805[_0xd205('0x1c')]+_0x4a0805[_0xd205('0x1f')];var _0x5a1429;if(_0x31eb94>=_0x3d88e3){_0x31eb94=_0x3d88e3;_0x5a1429=0xc8;}else{_0x5a1429=0xce;}_0x177854[_0xd205('0x1a')](_0x5a1429);return _0x177854['set']('Content-Range',_0x135e9d+'-'+_0x31eb94+'/'+_0x3d88e3)[_0xd205('0x20')](_0x398fc3);}return null;};}function patchUpdates(_0x5c3c31){return function(_0x53b46e){try{jsonpatch[_0xd205('0x21')](_0x53b46e,_0x5c3c31,!![]);}catch(_0x3b89b4){return BPromise[_0xd205('0x22')](_0x3b89b4);}return _0x53b46e[_0xd205('0x23')]();};}function saveUpdates(_0x162c26,_0x19f710){return function(_0x2ba4cf){if(_0x2ba4cf){return _0x2ba4cf[_0xd205('0x24')](_0x162c26)[_0xd205('0x25')](function(_0x1b0fef){return _0x1b0fef;});}return null;};}function removeEntity(_0x17b032,_0x37cf59){return function(_0x436a3a){if(_0x436a3a){return _0x436a3a[_0xd205('0x26')]()[_0xd205('0x25')](function(){_0x17b032[_0xd205('0x1a')](0xcc)[_0xd205('0x1b')]();});}};}function handleEntityNotFound(_0x2c0369,_0xf798bd){return function(_0x1b5485){if(!_0x1b5485){_0x2c0369['sendStatus'](0x194);}return _0x1b5485;};}function handleError(_0x3dea83,_0x1c3609){_0x1c3609=_0x1c3609||0x1f4;return function(_0xe0f84d){logger[_0xd205('0x27')](_0xe0f84d[_0xd205('0x28')]);if(_0xe0f84d[_0xd205('0x29')]){delete _0xe0f84d['name'];}_0x3dea83['status'](_0x1c3609)['send'](_0xe0f84d);};}exports[_0xd205('0x2a')]=function(_0x12e354,_0x3bfd88){var _0x102094={'raw':!![],'where':{'id':_0x12e354[_0xd205('0x2b')]['id']}},_0x2486a5={};_0x2486a5[_0xd205('0x2c')]=_['keys'](db[_0xd205('0x2d')][_0xd205('0x2e')]);_0x2486a5[_0xd205('0x2f')]=_[_0xd205('0x30')](_0x12e354['query']);_0x2486a5['filters']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],_0x2486a5[_0xd205('0x2f')]);_0x102094['attributes']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],qs[_0xd205('0x32')](_0x12e354['query'][_0xd205('0x32')]));_0x102094[_0xd205('0x33')]=_0x102094[_0xd205('0x33')]['length']?_0x102094['attributes']:_0x2486a5[_0xd205('0x2c')];if(_0x12e354['query'][_0xd205('0x34')]){_0x102094[_0xd205('0x35')]=[{'all':!![]}];}_0x102094=_[_0xd205('0x36')]({},_0x102094,_0x12e354[_0xd205('0x37')]);return db['ChatApplication'][_0xd205('0x38')](_0x102094)['then'](handleEntityNotFound(_0x3bfd88,null))[_0xd205('0x25')](respondWithResult(_0x3bfd88,null))[_0xd205('0x39')](handleError(_0x3bfd88,null));};exports['update']=function(_0x8bbb41,_0x526378){if(_0x8bbb41[_0xd205('0x3a')]['id']){delete _0x8bbb41[_0xd205('0x3a')]['id'];}return db[_0xd205('0x2d')][_0xd205('0x38')]({'where':{'id':_0x8bbb41[_0xd205('0x2b')]['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x526378,null))[_0xd205('0x25')](saveUpdates(_0x8bbb41[_0xd205('0x3a')],null))[_0xd205('0x25')](respondWithResult(_0x526378,null))[_0xd205('0x39')](handleError(_0x526378,null));};exports['destroy']=function(_0x38d565,_0x35b82a){return db['ChatApplication']['find']({'where':{'id':_0x38d565['params']['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x35b82a,null))[_0xd205('0x25')](removeEntity(_0x35b82a,null))[_0xd205('0x39')](handleError(_0x35b82a,null));}; \ No newline at end of file +var _0x44d4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','then','destroy','name','send','model','ChatApplication','query','keys','filters','intersection','attributes','fields','include','merge','options','find','update','body','params','catch','eml-format','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x44d4,0x161));var _0x444d=function(_0x5d2dc8,_0x4088bb){_0x5d2dc8=_0x5d2dc8-0x0;var _0x2e6a66=_0x44d4[_0x5d2dc8];return _0x2e6a66;};'use strict';var emlformat=require(_0x444d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x444d('0x3'));var sox=require(_0x444d('0x4'));var csv=require(_0x444d('0x5'));var ejs=require(_0x444d('0x6'));var fs=require('fs');var fs_extra=require(_0x444d('0x7'));var _=require(_0x444d('0x8'));var squel=require(_0x444d('0x9'));var crypto=require('crypto');var jsforce=require(_0x444d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x444d('0x5'));var querystring=require(_0x444d('0xb'));var Papa=require(_0x444d('0xc'));var Redis=require(_0x444d('0xd'));var authService=require(_0x444d('0xe'));var qs=require(_0x444d('0xf'));var as=require(_0x444d('0x10'));var hardwareService=require(_0x444d('0x11'));var logger=require(_0x444d('0x12'))(_0x444d('0x13'));var utils=require(_0x444d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x444d('0x15'));var db=require(_0x444d('0x16'))['db'];function respondWithStatusCode(_0x4a997f,_0x11db08){_0x11db08=_0x11db08||0xcc;return function(_0x3a2d03){if(_0x3a2d03){return _0x4a997f[_0x444d('0x17')](_0x11db08);}return _0x4a997f['status'](_0x11db08)[_0x444d('0x18')]();};}function respondWithResult(_0x41b794,_0x390231){_0x390231=_0x390231||0xc8;return function(_0x545a4b){if(_0x545a4b){return _0x41b794[_0x444d('0x19')](_0x390231)['json'](_0x545a4b);}};}function respondWithFilteredResult(_0x40bdbb,_0x43210d){return function(_0x21cbb0){if(_0x21cbb0){var _0x1bd5db=typeof _0x43210d['offset']==='undefined'&&typeof _0x43210d['limit']==='undefined';var _0x1a0e21=_0x21cbb0[_0x444d('0x1a')];var _0x171c35=_0x1bd5db?0x0:_0x43210d['offset'];var _0x54e12a=_0x1bd5db?_0x21cbb0[_0x444d('0x1a')]:_0x43210d[_0x444d('0x1b')]+_0x43210d[_0x444d('0x1c')];var _0x42b26d;if(_0x54e12a>=_0x1a0e21){_0x54e12a=_0x1a0e21;_0x42b26d=0xc8;}else{_0x42b26d=0xce;}_0x40bdbb[_0x444d('0x19')](_0x42b26d);return _0x40bdbb['set'](_0x444d('0x1d'),_0x171c35+'-'+_0x54e12a+'/'+_0x1a0e21)[_0x444d('0x1e')](_0x21cbb0);}return null;};}function patchUpdates(_0x2c0e2a){return function(_0x3bac2f){try{jsonpatch[_0x444d('0x1f')](_0x3bac2f,_0x2c0e2a,!![]);}catch(_0x25e6ae){return BPromise[_0x444d('0x20')](_0x25e6ae);}return _0x3bac2f['save']();};}function saveUpdates(_0x5e071f,_0xe2cd4d){return function(_0x4ef57b){if(_0x4ef57b){return _0x4ef57b['update'](_0x5e071f)[_0x444d('0x21')](function(_0x11563d){return _0x11563d;});}return null;};}function removeEntity(_0x546a9f,_0x5bbc84){return function(_0x17cc83){if(_0x17cc83){return _0x17cc83[_0x444d('0x22')]()[_0x444d('0x21')](function(){_0x546a9f[_0x444d('0x19')](0xcc)[_0x444d('0x18')]();});}};}function handleEntityNotFound(_0x2faf9e,_0x4016b8){return function(_0x394d06){if(!_0x394d06){_0x2faf9e[_0x444d('0x17')](0x194);}return _0x394d06;};}function handleError(_0x49c2fd,_0x5b8f14){_0x5b8f14=_0x5b8f14||0x1f4;return function(_0x240c32){logger['error'](_0x240c32['stack']);if(_0x240c32[_0x444d('0x23')]){delete _0x240c32['name'];}_0x49c2fd[_0x444d('0x19')](_0x5b8f14)[_0x444d('0x24')](_0x240c32);};}exports['show']=function(_0x1f6a96,_0x262fd2){var _0x3a4806={'raw':!![],'where':{'id':_0x1f6a96['params']['id']}},_0xea2b0b={};_0xea2b0b[_0x444d('0x25')]=_['keys'](db[_0x444d('0x26')]['rawAttributes']);_0xea2b0b[_0x444d('0x27')]=_[_0x444d('0x28')](_0x1f6a96[_0x444d('0x27')]);_0xea2b0b[_0x444d('0x29')]=_[_0x444d('0x2a')](_0xea2b0b['model'],_0xea2b0b[_0x444d('0x27')]);_0x3a4806[_0x444d('0x2b')]=_[_0x444d('0x2a')](_0xea2b0b[_0x444d('0x25')],qs[_0x444d('0x2c')](_0x1f6a96[_0x444d('0x27')][_0x444d('0x2c')]));_0x3a4806[_0x444d('0x2b')]=_0x3a4806[_0x444d('0x2b')]['length']?_0x3a4806['attributes']:_0xea2b0b[_0x444d('0x25')];if(_0x1f6a96[_0x444d('0x27')]['includeAll']){_0x3a4806[_0x444d('0x2d')]=[{'all':!![]}];}_0x3a4806=_[_0x444d('0x2e')]({},_0x3a4806,_0x1f6a96[_0x444d('0x2f')]);return db[_0x444d('0x26')][_0x444d('0x30')](_0x3a4806)['then'](handleEntityNotFound(_0x262fd2,null))['then'](respondWithResult(_0x262fd2,null))['catch'](handleError(_0x262fd2,null));};exports[_0x444d('0x31')]=function(_0x3e4658,_0x5935d9){if(_0x3e4658[_0x444d('0x32')]['id']){delete _0x3e4658['body']['id'];}return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x3e4658[_0x444d('0x33')]['id']}})[_0x444d('0x21')](handleEntityNotFound(_0x5935d9,null))[_0x444d('0x21')](saveUpdates(_0x3e4658['body'],null))['then'](respondWithResult(_0x5935d9,null))[_0x444d('0x34')](handleError(_0x5935d9,null));};exports[_0x444d('0x22')]=function(_0x42cfff,_0x2297d3){return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x42cfff[_0x444d('0x33')]['id']}})['then'](handleEntityNotFound(_0x2297d3,null))[_0x444d('0x21')](removeEntity(_0x2297d3,null))[_0x444d('0x34')](handleError(_0x2297d3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c2c3aa0..8b9f7ee 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 _0x86d7=['define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x13e758,_0x317d23){var _0x5b53c3=function(_0x103e80){while(--_0x103e80){_0x13e758['push'](_0x13e758['shift']());}};_0x5b53c3(++_0x317d23);}(_0x86d7,0x8b));var _0x786d=function(_0x1bca0,_0x2b7d42){_0x1bca0=_0x1bca0-0x0;var _0x5836f1=_0x86d7[_0x1bca0];return _0x5836f1;};'use strict';var _=require(_0x786d('0x0'));var util=require(_0x786d('0x1'));var logger=require(_0x786d('0x2'))(_0x786d('0x3'));var moment=require(_0x786d('0x4'));var BPromise=require(_0x786d('0x5'));var rp=require(_0x786d('0x6'));var fs=require('fs');var path=require(_0x786d('0x7'));var rimraf=require(_0x786d('0x8'));var config=require(_0x786d('0x9'));var attributes=require('./chatApplication.attributes');module[_0x786d('0xa')]=function(_0x505721,_0x3a3a78){return _0x505721[_0x786d('0xb')](_0x786d('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x786d('0xd'),'collate':_0x786d('0xe')});}; \ No newline at end of file +var _0xbef6=['ChatApplication','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3fd921,_0x4c4b58){var _0x386b5e=function(_0x96ae3b){while(--_0x96ae3b){_0x3fd921['push'](_0x3fd921['shift']());}};_0x386b5e(++_0x4c4b58);}(_0xbef6,0x1b0));var _0x6bef=function(_0x1c7a24,_0xdca25a){_0x1c7a24=_0x1c7a24-0x0;var _0xde3e84=_0xbef6[_0x1c7a24];return _0xde3e84;};'use strict';var _=require(_0x6bef('0x0'));var util=require(_0x6bef('0x1'));var logger=require('../../config/logger')(_0x6bef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6bef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bef('0x4'));var config=require(_0x6bef('0x5'));var attributes=require('./chatApplication.attributes');module[_0x6bef('0x6')]=function(_0x307f07,_0x5f2fcf){return _0x307f07[_0x6bef('0x7')](_0x6bef('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6bef('0x9')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 2009478..5f9f832 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 _0xb361=['client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb361,0x154));var _0x1b36=function(_0x5efc33,_0x5eccb3){_0x5efc33=_0x5efc33-0x0;var _0x5e5470=_0xb361[_0x5efc33];return _0x5e5470;};'use strict';var _=require('lodash');var util=require(_0x1b36('0x0'));var moment=require(_0x1b36('0x1'));var BPromise=require(_0x1b36('0x2'));var rs=require(_0x1b36('0x3'));var fs=require('fs');var Redis=require(_0x1b36('0x4'));var db=require(_0x1b36('0x5'))['db'];var utils=require(_0x1b36('0x6'));var logger=require(_0x1b36('0x7'))(_0x1b36('0x8'));var config=require('../../config/environment');var jayson=require(_0x1b36('0x9'));var client=jayson[_0x1b36('0xa')][_0x1b36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c861e,_0x9e8e5,_0x102681){return new BPromise(function(_0x120c08,_0x18c26e){return client[_0x1b36('0xc')](_0x2c861e,_0x102681)[_0x1b36('0xd')](function(_0x999bab){logger[_0x1b36('0xe')]('ChatApplication,\x20%s,\x20%s',_0x9e8e5,_0x1b36('0xf'));logger[_0x1b36('0x10')](_0x1b36('0x11'),_0x9e8e5,_0x1b36('0xf'),JSON[_0x1b36('0x12')](_0x999bab));if(_0x999bab[_0x1b36('0x13')]){if(_0x999bab[_0x1b36('0x13')][_0x1b36('0x14')]===0x1f4){logger[_0x1b36('0x13')](_0x1b36('0x15'),_0x9e8e5,_0x999bab[_0x1b36('0x13')][_0x1b36('0x16')]);return _0x18c26e(_0x999bab[_0x1b36('0x13')][_0x1b36('0x16')]);}logger[_0x1b36('0x13')]('ChatApplication,\x20%s,\x20%s',_0x9e8e5,_0x999bab[_0x1b36('0x13')]['message']);return _0x120c08(_0x999bab[_0x1b36('0x13')][_0x1b36('0x16')]);}else{logger['info'](_0x1b36('0x15'),_0x9e8e5,_0x1b36('0xf'));_0x120c08(_0x999bab[_0x1b36('0x17')]['message']);}})[_0x1b36('0x18')](function(_0x432279){logger[_0x1b36('0x13')](_0x1b36('0x15'),_0x9e8e5,_0x432279);_0x18c26e(_0x432279);});});} \ No newline at end of file +var _0xabc8=['rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xabc8,0x1c7));var _0x8abc=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xabc8[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0x8abc('0x0'));var util=require(_0x8abc('0x1'));var moment=require(_0x8abc('0x2'));var BPromise=require(_0x8abc('0x3'));var rs=require(_0x8abc('0x4'));var fs=require('fs');var Redis=require(_0x8abc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abc('0x6'));var logger=require('../../config/logger')(_0x8abc('0x7'));var config=require(_0x8abc('0x8'));var jayson=require(_0x8abc('0x9'));var client=jayson[_0x8abc('0xa')][_0x8abc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5188de,_0x339162,_0x46f7ec){return new BPromise(function(_0x5eaadd,_0x2b5abf){return client[_0x8abc('0xc')](_0x5188de,_0x46f7ec)[_0x8abc('0xd')](function(_0x460e9b){logger['info'](_0x8abc('0xe'),_0x339162,_0x8abc('0xf'));logger['debug'](_0x8abc('0x10'),_0x339162,'request\x20sent',JSON['stringify'](_0x460e9b));if(_0x460e9b['error']){if(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x12')]===0x1f4){logger['error'](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);return _0x2b5abf(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);}logger[_0x8abc('0x11')](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')]['message']);return _0x5eaadd(_0x460e9b['error'][_0x8abc('0x13')]);}else{logger[_0x8abc('0x14')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x8abc('0xf'));_0x5eaadd(_0x460e9b['result'][_0x8abc('0x13')]);}})[_0x8abc('0x15')](function(_0x22cd05){logger[_0x8abc('0x11')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x22cd05);_0x2b5abf(_0x22cd05);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 95c3f3a..9ba2755 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 _0xdcb1=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update'];(function(_0xe3d7fd,_0x52cf79){var _0x459361=function(_0x2d319b){while(--_0x2d319b){_0xe3d7fd['push'](_0xe3d7fd['shift']());}};_0x459361(++_0x52cf79);}(_0xdcb1,0x1ac));var _0x1dcb=function(_0x31163e,_0x29a4df){_0x31163e=_0x31163e-0x0;var _0x16d75c=_0xdcb1[_0x31163e];return _0x16d75c;};'use strict';var multer=require(_0x1dcb('0x0'));var util=require(_0x1dcb('0x1'));var path=require('path');var timeout=require(_0x1dcb('0x2'));var express=require(_0x1dcb('0x3'));var router=express[_0x1dcb('0x4')]();var fs_extra=require(_0x1dcb('0x5'));var auth=require(_0x1dcb('0x6'));var interaction=require(_0x1dcb('0x7'));var config=require(_0x1dcb('0x8'));var controller=require(_0x1dcb('0x9'));router[_0x1dcb('0xa')](_0x1dcb('0xb'),auth[_0x1dcb('0xc')](),controller['show']);router['put'](_0x1dcb('0xb'),auth['isAuthenticated'](),controller[_0x1dcb('0xd')]);router[_0x1dcb('0xe')](_0x1dcb('0xb'),auth['isAuthenticated'](),controller[_0x1dcb('0xf')]);module[_0x1dcb('0x10')]=router; \ No newline at end of file +var _0x3080=['get','/:id','isAuthenticated','show','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3080,0x1c8));var _0x0308=function(_0x24a91c,_0x1b3580){_0x24a91c=_0x24a91c-0x0;var _0x209a66=_0x3080[_0x24a91c];return _0x209a66;};'use strict';var multer=require('multer');var util=require(_0x0308('0x0'));var path=require('path');var timeout=require(_0x0308('0x1'));var express=require(_0x0308('0x2'));var router=express['Router']();var fs_extra=require(_0x0308('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0308('0x4'));var config=require(_0x0308('0x5'));var controller=require('./chatApplication.controller');router[_0x0308('0x6')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0x9')]);router['put'](_0x0308('0x7'),auth['isAuthenticated'](),controller[_0x0308('0xa')]);router[_0x0308('0xb')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0xc')]);module[_0x0308('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4aff04e..df1b610 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 _0x52a8=['STRING'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x52a8,0x141));var _0x852a=function(_0x12cec8,_0x4f2bf4){_0x12cec8=_0x12cec8-0x0;var _0x17d112=_0x52a8[_0x12cec8];return _0x17d112;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x852a('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfce5=['STRING','sequelize','exports'];(function(_0x5df3f4,_0xf5a26){var _0x21715b=function(_0x9604fc){while(--_0x9604fc){_0x5df3f4['push'](_0x5df3f4['shift']());}};_0x21715b(++_0xf5a26);}(_0xfce5,0x1d5));var _0x5fce=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0xfce5[_0x5df3ab];return _0x42cce5;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3e7a888..945f825 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 _0x285d=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','ChatGroup','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','rawAttributes','pick','nolimit','getMembers','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x5d15ba,_0x53090a){var _0x491453=function(_0x1c7393){while(--_0x1c7393){_0x5d15ba['push'](_0x5d15ba['shift']());}};_0x491453(++_0x53090a);}(_0x285d,0x179));var _0xd285=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x285d[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xd285('0x0'));var rimraf=require(_0xd285('0x1'));var zipdir=require(_0xd285('0x2'));var jsonpatch=require(_0xd285('0x3'));var rp=require(_0xd285('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd285('0x5'));var util=require('util');var path=require(_0xd285('0x6'));var sox=require(_0xd285('0x7'));var csv=require(_0xd285('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd285('0x9'));var _=require(_0xd285('0xa'));var squel=require('squel');var crypto=require(_0xd285('0xb'));var jsforce=require(_0xd285('0xc'));var deskjs=require(_0xd285('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd285('0xe'));var Redis=require(_0xd285('0xf'));var authService=require(_0xd285('0x10'));var qs=require(_0xd285('0x11'));var as=require(_0xd285('0x12'));var hardwareService=require(_0xd285('0x13'));var logger=require(_0xd285('0x14'))(_0xd285('0x15'));var utils=require(_0xd285('0x16'));var config=require(_0xd285('0x17'));var licenseUtil=require(_0xd285('0x18'));var db=require(_0xd285('0x19'))['db'];config['redis']=_[_0xd285('0x1a')](config['redis'],{'host':_0xd285('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd285('0x1c')]));require(_0xd285('0x1d'))[_0xd285('0x1e')](socket);function respondWithStatusCode(_0x3fa0cb,_0x4d8fea){_0x4d8fea=_0x4d8fea||0xcc;return function(_0x388856){if(_0x388856){return _0x3fa0cb[_0xd285('0x1f')](_0x4d8fea);}return _0x3fa0cb[_0xd285('0x20')](_0x4d8fea)[_0xd285('0x21')]();};}function respondWithResult(_0x33c535,_0x3006dc){_0x3006dc=_0x3006dc||0xc8;return function(_0xc2c0f8){if(_0xc2c0f8){return _0x33c535[_0xd285('0x20')](_0x3006dc)[_0xd285('0x22')](_0xc2c0f8);}};}function respondWithFilteredResult(_0x365036,_0x16ae2c){return function(_0x2ea7a6){if(_0x2ea7a6){var _0x318d61=typeof _0x16ae2c[_0xd285('0x23')]==='undefined'&&typeof _0x16ae2c[_0xd285('0x24')]===_0xd285('0x25');var _0x1b4636=_0x2ea7a6[_0xd285('0x26')];var _0x33514b=_0x318d61?0x0:_0x16ae2c[_0xd285('0x23')];var _0x22c1f0=_0x318d61?_0x2ea7a6['count']:_0x16ae2c[_0xd285('0x23')]+_0x16ae2c['limit'];var _0x10f4b3;if(_0x22c1f0>=_0x1b4636){_0x22c1f0=_0x1b4636;_0x10f4b3=0xc8;}else{_0x10f4b3=0xce;}_0x365036[_0xd285('0x20')](_0x10f4b3);return _0x365036['set'](_0xd285('0x27'),_0x33514b+'-'+_0x22c1f0+'/'+_0x1b4636)[_0xd285('0x22')](_0x2ea7a6);}return null;};}function patchUpdates(_0x27006f){return function(_0x1e51e5){try{jsonpatch[_0xd285('0x28')](_0x1e51e5,_0x27006f,!![]);}catch(_0x1b16eb){return BPromise[_0xd285('0x29')](_0x1b16eb);}return _0x1e51e5[_0xd285('0x2a')]();};}function saveUpdates(_0x392a78,_0x46e4c4){return function(_0x4f4130){if(_0x4f4130){return _0x4f4130[_0xd285('0x2b')](_0x392a78)[_0xd285('0x2c')](function(_0x43f701){return _0x43f701;});}return null;};}function removeEntity(_0x19ceaa,_0x1940dd){return function(_0xac8b81){if(_0xac8b81){return _0xac8b81[_0xd285('0x2d')]()[_0xd285('0x2c')](function(){_0x19ceaa[_0xd285('0x20')](0xcc)[_0xd285('0x21')]();});}};}function handleEntityNotFound(_0x525d88,_0x474d9f){return function(_0x36a0ce){if(!_0x36a0ce){_0x525d88[_0xd285('0x1f')](0x194);}return _0x36a0ce;};}function handleError(_0x53c688,_0x2349c1){_0x2349c1=_0x2349c1||0x1f4;return function(_0x41f329){logger['error'](_0x41f329['stack']);if(_0x41f329[_0xd285('0x2e')]){delete _0x41f329[_0xd285('0x2e')];}_0x53c688[_0xd285('0x20')](_0x2349c1)['send'](_0x41f329);};}exports['index']=function(_0x51acde,_0x244a12){var _0x4e0147={},_0x4d6e93={},_0x56fcbe={'count':0x0,'rows':[]};var _0x4820cb=_[_0xd285('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x301061){return{'name':_0x301061[_0xd285('0x30')],'type':_0x301061[_0xd285('0x31')][_0xd285('0x32')]};});_0x4d6e93['model']=_['map'](_0x4820cb,_0xd285('0x2e'));_0x4d6e93[_0xd285('0x33')]=_[_0xd285('0x34')](_0x51acde['query']);_0x4d6e93[_0xd285('0x35')]=_[_0xd285('0x36')](_0x4d6e93[_0xd285('0x37')],_0x4d6e93['query']);_0x4e0147[_0xd285('0x38')]=_[_0xd285('0x36')](_0x4d6e93['model'],qs[_0xd285('0x39')](_0x51acde[_0xd285('0x33')][_0xd285('0x39')]));_0x4e0147[_0xd285('0x38')]=_0x4e0147[_0xd285('0x38')][_0xd285('0x3a')]?_0x4e0147[_0xd285('0x38')]:_0x4d6e93[_0xd285('0x37')];if(!_0x51acde['query'][_0xd285('0x3b')]('nolimit')){_0x4e0147[_0xd285('0x24')]=qs['limit'](_0x51acde[_0xd285('0x33')][_0xd285('0x24')]);_0x4e0147['offset']=qs[_0xd285('0x23')](_0x51acde['query'][_0xd285('0x23')]);}_0x4e0147[_0xd285('0x3c')]=qs[_0xd285('0x3d')](_0x51acde['query'][_0xd285('0x3d')]);_0x4e0147['where']=qs[_0xd285('0x35')](_['pick'](_0x51acde[_0xd285('0x33')],_0x4d6e93['filters']),_0x4820cb);if(_0x51acde[_0xd285('0x33')][_0xd285('0x3e')]){_0x4e0147[_0xd285('0x3f')]=_['merge'](_0x4e0147[_0xd285('0x3f')],{'$or':_['map'](_0x4820cb,function(_0x52d5ed){if(_0x52d5ed[_0xd285('0x31')]!==_0xd285('0x40')){var _0x500955={};_0x500955[_0x52d5ed['name']]={'$like':'%'+_0x51acde[_0xd285('0x33')]['filter']+'%'};return _0x500955;}})});}_0x4e0147=_[_0xd285('0x41')]({},_0x4e0147,_0x51acde[_0xd285('0x42')]);var _0x30f1df={'where':_0x4e0147[_0xd285('0x3f')]};return db[_0xd285('0x43')][_0xd285('0x26')](_0x30f1df)[_0xd285('0x2c')](function(_0x58cbe4){_0x56fcbe[_0xd285('0x26')]=_0x58cbe4;if(_0x51acde[_0xd285('0x33')][_0xd285('0x44')]){_0x4e0147[_0xd285('0x45')]=[{'all':!![]}];}return db[_0xd285('0x43')][_0xd285('0x46')](_0x4e0147);})[_0xd285('0x2c')](function(_0x32c66e){_0x56fcbe[_0xd285('0x47')]=_0x32c66e;return _0x56fcbe;})[_0xd285('0x2c')](respondWithFilteredResult(_0x244a12,_0x4e0147))[_0xd285('0x48')](handleError(_0x244a12,null));};exports[_0xd285('0x49')]=function(_0x23f7eb,_0x5f57e6){var _0x3f746f={'raw':!![],'where':{'id':_0x23f7eb[_0xd285('0x4a')]['id']}},_0x52bb46={};_0x52bb46[_0xd285('0x37')]=_['keys'](db[_0xd285('0x43')]['rawAttributes']);_0x52bb46[_0xd285('0x33')]=_[_0xd285('0x34')](_0x23f7eb[_0xd285('0x33')]);_0x52bb46[_0xd285('0x35')]=_[_0xd285('0x36')](_0x52bb46['model'],_0x52bb46[_0xd285('0x33')]);_0x3f746f[_0xd285('0x38')]=_[_0xd285('0x36')](_0x52bb46[_0xd285('0x37')],qs[_0xd285('0x39')](_0x23f7eb['query'][_0xd285('0x39')]));_0x3f746f[_0xd285('0x38')]=_0x3f746f['attributes']['length']?_0x3f746f[_0xd285('0x38')]:_0x52bb46[_0xd285('0x37')];if(_0x23f7eb[_0xd285('0x33')][_0xd285('0x44')]){_0x3f746f[_0xd285('0x45')]=[{'all':!![]}];}_0x3f746f=_[_0xd285('0x41')]({},_0x3f746f,_0x23f7eb[_0xd285('0x42')]);return db[_0xd285('0x43')][_0xd285('0x4b')](_0x3f746f)[_0xd285('0x2c')](handleEntityNotFound(_0x5f57e6,null))['then'](respondWithResult(_0x5f57e6,null))[_0xd285('0x48')](handleError(_0x5f57e6,null));};exports[_0xd285('0x4c')]=function(_0x418104,_0x3dbd63){return db['ChatGroup'][_0xd285('0x4c')](_0x418104[_0xd285('0x4d')],{})[_0xd285('0x2c')](respondWithResult(_0x3dbd63,0xc9))[_0xd285('0x48')](handleError(_0x3dbd63,null));};exports[_0xd285('0x2b')]=function(_0x421d43,_0x3456ad){if(_0x421d43[_0xd285('0x4d')]['id']){delete _0x421d43[_0xd285('0x4d')]['id'];}return db['ChatGroup'][_0xd285('0x4b')]({'where':{'id':_0x421d43[_0xd285('0x4a')]['id']}})[_0xd285('0x2c')](handleEntityNotFound(_0x3456ad,null))[_0xd285('0x2c')](saveUpdates(_0x421d43[_0xd285('0x4d')],null))['then'](respondWithResult(_0x3456ad,null))['catch'](handleError(_0x3456ad,null));};exports[_0xd285('0x2d')]=function(_0x306361,_0x346d9d){return db[_0xd285('0x43')][_0xd285('0x4b')]({'where':{'id':_0x306361['params']['id']}})['then'](handleEntityNotFound(_0x346d9d,null))['then'](removeEntity(_0x346d9d,null))[_0xd285('0x48')](handleError(_0x346d9d,null));};exports['describe']=function(_0x1c7e3e,_0x38ec04){return db['ChatGroup'][_0xd285('0x4e')]()['then'](respondWithResult(_0x38ec04,null))['catch'](handleError(_0x38ec04,null));};exports['getUnread']=function(_0x49c6b4,_0x44bf04,_0x3f901b){return db[_0xd285('0x4f')][_0xd285('0x26')]({'where':{'ChatGroupId':_0x49c6b4[_0xd285('0x4a')]['id'],'ToId':_0x49c6b4[_0xd285('0x50')]['id'],'read':![]}})[_0xd285('0x2c')](function(_0x51281b){return{'id':_[_0xd285('0x51')](_0x49c6b4['params']['id']),'count':_0x51281b};})[_0xd285('0x2c')](respondWithResult(_0x44bf04,null))[_0xd285('0x48')](handleError(_0x44bf04,null));};exports[_0xd285('0x52')]=function(_0x29473b,_0x42ca70,_0x255f93){return db[_0xd285('0x43')][_0xd285('0x4b')]({'where':{'id':_0x29473b[_0xd285('0x4a')]['id']}})[_0xd285('0x2c')](handleEntityNotFound(_0x42ca70,null))[_0xd285('0x2c')](function(_0x31f9b3){if(_0x31f9b3){return _0x31f9b3['addMembers'](_0x29473b[_0xd285('0x4d')][_0xd285('0x53')],_['omit'](_0x29473b['body'],[_0xd285('0x53'),'id'])||{});}})['then'](respondWithResult(_0x42ca70,null))[_0xd285('0x48')](handleError(_0x42ca70,null));};exports['getMembers']=function(_0x550421,_0x34a35a,_0x2b555f){var _0x565492={};var _0x540da7={};var _0x5ef91a;var _0x57f239;return db['ChatGroup'][_0xd285('0x54')]({'where':{'id':_0x550421['params']['id']}})[_0xd285('0x2c')](handleEntityNotFound(_0x34a35a,null))[_0xd285('0x2c')](function(_0x278827){if(_0x278827){_0x5ef91a=_0x278827;_0x540da7['model']=_[_0xd285('0x34')](db[_0xd285('0x55')][_0xd285('0x56')]);_0x540da7[_0xd285('0x33')]=_['keys'](_0x550421[_0xd285('0x33')]);_0x540da7[_0xd285('0x35')]=_[_0xd285('0x36')](_0x540da7[_0xd285('0x37')],_0x540da7[_0xd285('0x33')]);_0x565492[_0xd285('0x38')]=_[_0xd285('0x36')](_0x540da7[_0xd285('0x37')],qs[_0xd285('0x39')](_0x550421[_0xd285('0x33')][_0xd285('0x39')]));_0x565492[_0xd285('0x38')]=_0x565492[_0xd285('0x38')][_0xd285('0x3a')]?_0x565492[_0xd285('0x38')]:_0x540da7[_0xd285('0x37')];_0x565492[_0xd285('0x3c')]=qs[_0xd285('0x3d')](_0x550421[_0xd285('0x33')][_0xd285('0x3d')]);_0x565492[_0xd285('0x3f')]=qs[_0xd285('0x35')](_[_0xd285('0x57')](_0x550421['query'],_0x540da7[_0xd285('0x35')]));if(_0x550421[_0xd285('0x33')][_0xd285('0x3e')]){_0x565492[_0xd285('0x3f')]=_[_0xd285('0x41')](_0x565492[_0xd285('0x3f')],{'$or':_[_0xd285('0x2f')](_0x565492['attributes'],function(_0x493e05){var _0x50f7d6={};_0x50f7d6[_0x493e05]={'$like':'%'+_0x550421['query'][_0xd285('0x3e')]+'%'};return _0x50f7d6;})});}_0x565492=_[_0xd285('0x41')]({},_0x565492,_0x550421['options']);return _0x5ef91a['getMembers'](_0x565492);}})[_0xd285('0x2c')](function(_0xf69299){if(_0xf69299){_0x57f239=_0xf69299['length'];if(!_0x550421[_0xd285('0x33')][_0xd285('0x3b')](_0xd285('0x58'))){_0x565492[_0xd285('0x24')]=qs[_0xd285('0x24')](_0x550421[_0xd285('0x33')]['limit']);_0x565492[_0xd285('0x23')]=qs['offset'](_0x550421[_0xd285('0x33')]['offset']);}return _0x5ef91a[_0xd285('0x59')](_0x565492);}})['then'](function(_0x5c819d){if(_0x5c819d){return _0x5c819d?{'count':_0x57f239,'rows':_0x5c819d}:null;}})[_0xd285('0x2c')](respondWithResult(_0x34a35a,null))[_0xd285('0x48')](handleError(_0x34a35a,null));};exports['removeMembers']=function(_0x58a914,_0x186687,_0x2e35f6){return db[_0xd285('0x43')][_0xd285('0x4b')]({'where':{'id':_0x58a914['params']['id']}})[_0xd285('0x2c')](handleEntityNotFound(_0x186687,null))[_0xd285('0x2c')](function(_0xe0f0c3){if(_0xe0f0c3){return _0xe0f0c3[_0xd285('0x5a')](_0x58a914[_0xd285('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x186687,null))[_0xd285('0x48')](handleError(_0x186687,null));};exports['addMessage']=function(_0xc9d0fa,_0x34dd72,_0x4cdccd){if(_0xc9d0fa[_0xd285('0x4d')]['id']){delete _0xc9d0fa[_0xd285('0x4d')]['id'];}return db[_0xd285('0x43')][_0xd285('0x4b')]({'where':{'id':_0xc9d0fa[_0xd285('0x4a')]['id']}})['then'](handleEntityNotFound(_0x34dd72,null))['then'](function(_0x272a0b){if(_0x272a0b){_0xc9d0fa[_0xd285('0x4d')][_0xd285('0x5b')]=_0x272a0b['id'];return db[_0xd285('0x4f')][_0xd285('0x4c')](_0xc9d0fa[_0xd285('0x4d')]);}})['then'](respondWithResult(_0x34dd72,null))[_0xd285('0x48')](handleError(_0x34dd72,null));};exports[_0xd285('0x5c')]=function(_0x374b4e,_0x5b8378,_0x3d9d2a){var _0x5f52f6={};var _0x7e30e7={};var _0x52addd;var _0x2d2045;return db[_0xd285('0x43')]['findOne']({'where':{'id':_0x374b4e[_0xd285('0x4a')]['id']}})[_0xd285('0x2c')](handleEntityNotFound(_0x5b8378,null))[_0xd285('0x2c')](function(_0x34c181){if(_0x34c181){_0x52addd=_0x34c181;_0x7e30e7[_0xd285('0x37')]=_['keys'](db[_0xd285('0x4f')][_0xd285('0x56')]);_0x7e30e7[_0xd285('0x33')]=_['keys'](_0x374b4e['query']);_0x7e30e7['filters']=_[_0xd285('0x36')](_0x7e30e7['model'],_0x7e30e7['query']);_0x5f52f6[_0xd285('0x38')]=_[_0xd285('0x36')](_0x7e30e7[_0xd285('0x37')],qs['fields'](_0x374b4e[_0xd285('0x33')][_0xd285('0x39')]));_0x5f52f6[_0xd285('0x38')]=_0x5f52f6['attributes'][_0xd285('0x3a')]?_0x5f52f6['attributes']:_0x7e30e7[_0xd285('0x37')];_0x5f52f6[_0xd285('0x3c')]=qs['sort'](_0x374b4e[_0xd285('0x33')][_0xd285('0x3d')]);_0x5f52f6['where']=qs[_0xd285('0x35')](_[_0xd285('0x57')](_0x374b4e[_0xd285('0x33')],_0x7e30e7[_0xd285('0x35')]));if(_0x374b4e['query'][_0xd285('0x3e')]){_0x5f52f6[_0xd285('0x3f')]=_[_0xd285('0x41')](_0x5f52f6[_0xd285('0x3f')],{'$or':_[_0xd285('0x2f')](_0x5f52f6[_0xd285('0x38')],function(_0x4c0875){var _0x1a6f36={};_0x1a6f36[_0x4c0875]={'$like':'%'+_0x374b4e['query'][_0xd285('0x3e')]+'%'};return _0x1a6f36;})});}if(_0x374b4e[_0xd285('0x33')][_0xd285('0x5d')]){var _0x61dd61=_0x374b4e[_0xd285('0x33')]['$gte'][_0xd285('0x5e')](',');var _0x1046a1={};_0x1046a1[_0x61dd61[0x0]]={'$gte':moment(_0x61dd61[0x1])[_0xd285('0x5f')](_0xd285('0x60'))};_0x5f52f6[_0xd285('0x3f')]=_['merge'](_0x5f52f6['where'],_0x1046a1);}_0x5f52f6=_[_0xd285('0x41')]({},_0x5f52f6,_0x374b4e[_0xd285('0x42')]);return _0x52addd[_0xd285('0x5c')](_0x5f52f6);}})[_0xd285('0x2c')](function(_0x428895){if(_0x428895){_0x2d2045=_0x428895[_0xd285('0x3a')];if(!_0x374b4e[_0xd285('0x33')][_0xd285('0x3b')]('nolimit')){_0x5f52f6[_0xd285('0x24')]=qs['limit'](_0x374b4e[_0xd285('0x33')]['limit']);_0x5f52f6[_0xd285('0x23')]=qs[_0xd285('0x23')](_0x374b4e['query']['offset']);}return _0x52addd['getMessages'](_0x5f52f6);}})[_0xd285('0x2c')](function(_0x5029fc){if(_0x5029fc){return _0x5029fc?{'count':_0x2d2045,'rows':_0x5029fc}:null;}})[_0xd285('0x2c')](respondWithResult(_0x5b8378,null))['catch'](handleError(_0x5b8378,null));}; \ No newline at end of file +var _0xe150=['util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','destroy','getUnread','user','toInteger','addMembers','getMembers','findOne','User','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','moment','mustache'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xe150,0xb3));var _0x0e15=function(_0x3216f5,_0xe32e8a){_0x3216f5=_0x3216f5-0x0;var _0x17035a=_0xe150[_0x3216f5];return _0x17035a;};'use strict';var emlformat=require(_0x0e15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e15('0x2'));var moment=require(_0x0e15('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e15('0x4'));var util=require(_0x0e15('0x5'));var path=require(_0x0e15('0x6'));var sox=require('sox');var csv=require(_0x0e15('0x7'));var ejs=require(_0x0e15('0x8'));var fs=require('fs');var fs_extra=require(_0x0e15('0x9'));var _=require('lodash');var squel=require(_0x0e15('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e15('0x7'));var querystring=require(_0x0e15('0xc'));var Papa=require(_0x0e15('0xd'));var Redis=require(_0x0e15('0xe'));var authService=require(_0x0e15('0xf'));var qs=require(_0x0e15('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e15('0x11'));var logger=require(_0x0e15('0x12'))(_0x0e15('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e15('0x14'));var db=require(_0x0e15('0x15'))['db'];config[_0x0e15('0x16')]=_[_0x0e15('0x17')](config[_0x0e15('0x16')],{'host':_0x0e15('0x18'),'port':0x18eb});var socket=require(_0x0e15('0x19'))(new Redis(config[_0x0e15('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x2b954a,_0x1581ef){_0x1581ef=_0x1581ef||0xcc;return function(_0x32878a){if(_0x32878a){return _0x2b954a[_0x0e15('0x1a')](_0x1581ef);}return _0x2b954a[_0x0e15('0x1b')](_0x1581ef)[_0x0e15('0x1c')]();};}function respondWithResult(_0x42b753,_0x1546f5){_0x1546f5=_0x1546f5||0xc8;return function(_0x5d0025){if(_0x5d0025){return _0x42b753[_0x0e15('0x1b')](_0x1546f5)[_0x0e15('0x1d')](_0x5d0025);}};}function respondWithFilteredResult(_0x178977,_0x5e4c8b){return function(_0x135981){if(_0x135981){var _0x2e5694=typeof _0x5e4c8b[_0x0e15('0x1e')]==='undefined'&&typeof _0x5e4c8b[_0x0e15('0x1f')]===_0x0e15('0x20');var _0x4b1689=_0x135981['count'];var _0x567235=_0x2e5694?0x0:_0x5e4c8b[_0x0e15('0x1e')];var _0x1dad43=_0x2e5694?_0x135981[_0x0e15('0x21')]:_0x5e4c8b[_0x0e15('0x1e')]+_0x5e4c8b[_0x0e15('0x1f')];var _0x1fd86c;if(_0x1dad43>=_0x4b1689){_0x1dad43=_0x4b1689;_0x1fd86c=0xc8;}else{_0x1fd86c=0xce;}_0x178977['status'](_0x1fd86c);return _0x178977[_0x0e15('0x22')](_0x0e15('0x23'),_0x567235+'-'+_0x1dad43+'/'+_0x4b1689)[_0x0e15('0x1d')](_0x135981);}return null;};}function patchUpdates(_0x4360ae){return function(_0x3f412d){try{jsonpatch['apply'](_0x3f412d,_0x4360ae,!![]);}catch(_0x36c841){return BPromise['reject'](_0x36c841);}return _0x3f412d[_0x0e15('0x24')]();};}function saveUpdates(_0x1a5f6c,_0x2e7222){return function(_0x3f4234){if(_0x3f4234){return _0x3f4234[_0x0e15('0x25')](_0x1a5f6c)[_0x0e15('0x26')](function(_0x26453a){return _0x26453a;});}return null;};}function removeEntity(_0x498731,_0x2f524d){return function(_0x876b2b){if(_0x876b2b){return _0x876b2b['destroy']()[_0x0e15('0x26')](function(){_0x498731[_0x0e15('0x1b')](0xcc)[_0x0e15('0x1c')]();});}};}function handleEntityNotFound(_0x26ac88,_0x5bce4d){return function(_0x27759b){if(!_0x27759b){_0x26ac88['sendStatus'](0x194);}return _0x27759b;};}function handleError(_0x4d81f1,_0x2dbe7a){_0x2dbe7a=_0x2dbe7a||0x1f4;return function(_0x10f372){logger['error'](_0x10f372[_0x0e15('0x27')]);if(_0x10f372[_0x0e15('0x28')]){delete _0x10f372[_0x0e15('0x28')];}_0x4d81f1[_0x0e15('0x1b')](_0x2dbe7a)[_0x0e15('0x29')](_0x10f372);};}exports[_0x0e15('0x2a')]=function(_0x445c18,_0x58db16){var _0x122af0={},_0x1cc483={},_0x1f8d35={'count':0x0,'rows':[]};var _0x5ee5a2=_[_0x0e15('0x2b')](db[_0x0e15('0x2c')][_0x0e15('0x2d')],function(_0x599927){return{'name':_0x599927[_0x0e15('0x2e')],'type':_0x599927['type'][_0x0e15('0x2f')]};});_0x1cc483['model']=_[_0x0e15('0x2b')](_0x5ee5a2,'name');_0x1cc483[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x445c18[_0x0e15('0x30')]);_0x1cc483[_0x0e15('0x32')]=_['intersection'](_0x1cc483[_0x0e15('0x33')],_0x1cc483['query']);_0x122af0[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x1cc483[_0x0e15('0x33')],qs['fields'](_0x445c18[_0x0e15('0x30')][_0x0e15('0x36')]));_0x122af0[_0x0e15('0x34')]=_0x122af0[_0x0e15('0x34')][_0x0e15('0x37')]?_0x122af0['attributes']:_0x1cc483[_0x0e15('0x33')];if(!_0x445c18[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x122af0[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x445c18[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x122af0[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x445c18['query'][_0x0e15('0x1e')]);}_0x122af0[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x445c18['query'][_0x0e15('0x3b')]);_0x122af0['where']=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x445c18[_0x0e15('0x30')],_0x1cc483[_0x0e15('0x32')]),_0x5ee5a2);if(_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x122af0[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x122af0[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x5ee5a2,function(_0x59844d){if(_0x59844d[_0x0e15('0x40')]!==_0x0e15('0x41')){var _0x55c928={};_0x55c928[_0x59844d[_0x0e15('0x28')]]={'$like':'%'+_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]+'%'};return _0x55c928;}})});}_0x122af0=_['merge']({},_0x122af0,_0x445c18[_0x0e15('0x42')]);var _0x364e19={'where':_0x122af0[_0x0e15('0x3e')]};return db[_0x0e15('0x2c')][_0x0e15('0x21')](_0x364e19)[_0x0e15('0x26')](function(_0x5d1500){_0x1f8d35[_0x0e15('0x21')]=_0x5d1500;if(_0x445c18[_0x0e15('0x30')]['includeAll']){_0x122af0['include']=[{'all':!![]}];}return db[_0x0e15('0x2c')][_0x0e15('0x43')](_0x122af0);})[_0x0e15('0x26')](function(_0x2e3348){_0x1f8d35[_0x0e15('0x44')]=_0x2e3348;return _0x1f8d35;})['then'](respondWithFilteredResult(_0x58db16,_0x122af0))[_0x0e15('0x45')](handleError(_0x58db16,null));};exports[_0x0e15('0x46')]=function(_0x274752,_0x576711){var _0x544994={'raw':!![],'where':{'id':_0x274752['params']['id']}},_0x199de1={};_0x199de1['model']=_[_0x0e15('0x31')](db[_0x0e15('0x2c')][_0x0e15('0x2d')]);_0x199de1[_0x0e15('0x30')]=_['keys'](_0x274752[_0x0e15('0x30')]);_0x199de1[_0x0e15('0x32')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],_0x199de1[_0x0e15('0x30')]);_0x544994[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x274752['query'][_0x0e15('0x36')]));_0x544994[_0x0e15('0x34')]=_0x544994['attributes'][_0x0e15('0x37')]?_0x544994['attributes']:_0x199de1[_0x0e15('0x33')];if(_0x274752['query'][_0x0e15('0x47')]){_0x544994[_0x0e15('0x48')]=[{'all':!![]}];}_0x544994=_[_0x0e15('0x3f')]({},_0x544994,_0x274752['options']);return db[_0x0e15('0x2c')][_0x0e15('0x49')](_0x544994)[_0x0e15('0x26')](handleEntityNotFound(_0x576711,null))[_0x0e15('0x26')](respondWithResult(_0x576711,null))['catch'](handleError(_0x576711,null));};exports[_0x0e15('0x4a')]=function(_0x51951f,_0x491428){return db[_0x0e15('0x2c')][_0x0e15('0x4a')](_0x51951f[_0x0e15('0x4b')],{})[_0x0e15('0x26')](respondWithResult(_0x491428,0xc9))[_0x0e15('0x45')](handleError(_0x491428,null));};exports[_0x0e15('0x25')]=function(_0x4b64ea,_0x43ea03){if(_0x4b64ea[_0x0e15('0x4b')]['id']){delete _0x4b64ea[_0x0e15('0x4b')]['id'];}return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x4b64ea[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x43ea03,null))[_0x0e15('0x26')](saveUpdates(_0x4b64ea[_0x0e15('0x4b')],null))[_0x0e15('0x26')](respondWithResult(_0x43ea03,null))['catch'](handleError(_0x43ea03,null));};exports[_0x0e15('0x4d')]=function(_0x349454,_0x2b945c){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x349454[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x2b945c,null))[_0x0e15('0x26')](removeEntity(_0x2b945c,null))[_0x0e15('0x45')](handleError(_0x2b945c,null));};exports['describe']=function(_0x3e4d92,_0x164da4){return db[_0x0e15('0x2c')]['describe']()[_0x0e15('0x26')](respondWithResult(_0x164da4,null))[_0x0e15('0x45')](handleError(_0x164da4,null));};exports[_0x0e15('0x4e')]=function(_0x51d38d,_0x5e9a52,_0x494299){return db['ChatInternalMessage'][_0x0e15('0x21')]({'where':{'ChatGroupId':_0x51d38d['params']['id'],'ToId':_0x51d38d[_0x0e15('0x4f')]['id'],'read':![]}})[_0x0e15('0x26')](function(_0x41df40){return{'id':_[_0x0e15('0x50')](_0x51d38d['params']['id']),'count':_0x41df40};})[_0x0e15('0x26')](respondWithResult(_0x5e9a52,null))['catch'](handleError(_0x5e9a52,null));};exports[_0x0e15('0x51')]=function(_0x13a459,_0x1b1e84,_0x44d177){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x13a459['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1b1e84,null))[_0x0e15('0x26')](function(_0x419492){if(_0x419492){return _0x419492['addMembers'](_0x13a459[_0x0e15('0x4b')]['ids'],_['omit'](_0x13a459['body'],['ids','id'])||{});}})[_0x0e15('0x26')](respondWithResult(_0x1b1e84,null))[_0x0e15('0x45')](handleError(_0x1b1e84,null));};exports[_0x0e15('0x52')]=function(_0x2bc9d8,_0x47cd83,_0x553a75){var _0x28e917={};var _0x2efb3e={};var _0x31f10c;var _0xe828ac;return db[_0x0e15('0x2c')][_0x0e15('0x53')]({'where':{'id':_0x2bc9d8['params']['id']}})['then'](handleEntityNotFound(_0x47cd83,null))[_0x0e15('0x26')](function(_0x1c11e5){if(_0x1c11e5){_0x31f10c=_0x1c11e5;_0x2efb3e['model']=_[_0x0e15('0x31')](db[_0x0e15('0x54')][_0x0e15('0x2d')]);_0x2efb3e[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x2bc9d8['query']);_0x2efb3e['filters']=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],_0x2efb3e[_0x0e15('0x30')]);_0x28e917[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],qs['fields'](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x36')]));_0x28e917[_0x0e15('0x34')]=_0x28e917[_0x0e15('0x34')][_0x0e15('0x37')]?_0x28e917[_0x0e15('0x34')]:_0x2efb3e[_0x0e15('0x33')];_0x28e917['order']=qs[_0x0e15('0x3b')](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x28e917[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x2bc9d8[_0x0e15('0x30')],_0x2efb3e[_0x0e15('0x32')]));if(_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x28e917[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x28e917[_0x0e15('0x3e')],{'$or':_['map'](_0x28e917['attributes'],function(_0x50f21d){var _0x31c5cf={};_0x31c5cf[_0x50f21d]={'$like':'%'+_0x2bc9d8['query'][_0x0e15('0x3d')]+'%'};return _0x31c5cf;})});}_0x28e917=_['merge']({},_0x28e917,_0x2bc9d8[_0x0e15('0x42')]);return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})[_0x0e15('0x26')](function(_0x5acc18){if(_0x5acc18){_0xe828ac=_0x5acc18['length'];if(!_0x2bc9d8['query'][_0x0e15('0x38')](_0x0e15('0x39'))){_0x28e917[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x2bc9d8['query'][_0x0e15('0x1f')]);_0x28e917[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x2bc9d8['query']['offset']);}return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})['then'](function(_0x3d3dae){if(_0x3d3dae){return _0x3d3dae?{'count':_0xe828ac,'rows':_0x3d3dae}:null;}})[_0x0e15('0x26')](respondWithResult(_0x47cd83,null))[_0x0e15('0x45')](handleError(_0x47cd83,null));};exports[_0x0e15('0x55')]=function(_0x54581e,_0x391078,_0x1ffad2){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x54581e['params']['id']}})['then'](handleEntityNotFound(_0x391078,null))['then'](function(_0x3406ea){if(_0x3406ea){return _0x3406ea['removeMembers'](_0x54581e['query']['ids']);}})[_0x0e15('0x26')](respondWithStatusCode(_0x391078,null))[_0x0e15('0x45')](handleError(_0x391078,null));};exports[_0x0e15('0x56')]=function(_0x411f94,_0x50e23e,_0x175768){if(_0x411f94[_0x0e15('0x4b')]['id']){delete _0x411f94['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x411f94[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x50e23e,null))[_0x0e15('0x26')](function(_0xfc4930){if(_0xfc4930){_0x411f94[_0x0e15('0x4b')]['ChatGroupId']=_0xfc4930['id'];return db[_0x0e15('0x57')]['create'](_0x411f94[_0x0e15('0x4b')]);}})[_0x0e15('0x26')](respondWithResult(_0x50e23e,null))['catch'](handleError(_0x50e23e,null));};exports[_0x0e15('0x58')]=function(_0x31c1c0,_0x1f54c3,_0x3e069f){var _0x3cacd3={};var _0x40e03e={};var _0xa9f77a;var _0xfbe72d;return db[_0x0e15('0x2c')]['findOne']({'where':{'id':_0x31c1c0['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1f54c3,null))[_0x0e15('0x26')](function(_0x5b6722){if(_0x5b6722){_0xa9f77a=_0x5b6722;_0x40e03e['model']=_['keys'](db[_0x0e15('0x57')]['rawAttributes']);_0x40e03e['query']=_[_0x0e15('0x31')](_0x31c1c0['query']);_0x40e03e[_0x0e15('0x32')]=_['intersection'](_0x40e03e[_0x0e15('0x33')],_0x40e03e[_0x0e15('0x30')]);_0x3cacd3[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x40e03e[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x31c1c0['query'][_0x0e15('0x36')]));_0x3cacd3['attributes']=_0x3cacd3[_0x0e15('0x34')][_0x0e15('0x37')]?_0x3cacd3[_0x0e15('0x34')]:_0x40e03e[_0x0e15('0x33')];_0x3cacd3[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x3cacd3[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_['pick'](_0x31c1c0[_0x0e15('0x30')],_0x40e03e[_0x0e15('0x32')]));if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x3cacd3['attributes'],function(_0x459b61){var _0xeab4e3={};_0xeab4e3[_0x459b61]={'$like':'%'+_0x31c1c0['query'][_0x0e15('0x3d')]+'%'};return _0xeab4e3;})});}if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]){var _0x234b23=_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]['split'](',');var _0x1ae245={};_0x1ae245[_0x234b23[0x0]]={'$gte':moment(_0x234b23[0x1])[_0x0e15('0x5a')](_0x0e15('0x5b'))};_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],_0x1ae245);}_0x3cacd3=_[_0x0e15('0x3f')]({},_0x3cacd3,_0x31c1c0[_0x0e15('0x42')]);return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x29f4ba){if(_0x29f4ba){_0xfbe72d=_0x29f4ba[_0x0e15('0x37')];if(!_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x3cacd3[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x3cacd3[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x31c1c0['query'][_0x0e15('0x1e')]);}return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x605dcf){if(_0x605dcf){return _0x605dcf?{'count':_0xfbe72d,'rows':_0x605dcf}:null;}})[_0x0e15('0x26')](respondWithResult(_0x1f54c3,null))['catch'](handleError(_0x1f54c3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a678c6d..8f6be04 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 _0xfb6e=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xfb6e,0x177));var _0xefb6=function(_0x17298f,_0x1ec3fc){_0x17298f=_0x17298f-0x0;var _0x192ce1=_0xfb6e[_0x17298f];return _0x192ce1;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xefb6('0x0'))['db'][_0xefb6('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xefb6('0x2')](0x0);var events={'afterCreate':_0xefb6('0x3'),'afterUpdate':_0xefb6('0x4'),'afterDestroy':_0xefb6('0x5')};function emitEvent(_0x239335){return function(_0x468f2,_0x5cf1f9,_0xaefbef){ChatGroupEvents[_0xefb6('0x6')](_0x239335+':'+_0x468f2['id'],_0x468f2);ChatGroupEvents[_0xefb6('0x6')](_0x239335,_0x468f2);_0xaefbef(null);};}for(var e in events){if(events[_0xefb6('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x8512=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8512,0x70));var _0x2851=function(_0x7af2ae,_0x846e8a){_0x7af2ae=_0x7af2ae-0x0;var _0x17a7c5=_0x8512[_0x7af2ae];return _0x17a7c5;};'use strict';var EventEmitter=require(_0x2851('0x0'));var ChatGroup=require(_0x2851('0x1'))['db'][_0x2851('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2851('0x3')](0x0);var events={'afterCreate':_0x2851('0x4'),'afterUpdate':_0x2851('0x5'),'afterDestroy':_0x2851('0x6')};function emitEvent(_0x28fcac){return function(_0x138d42,_0x550320,_0x58bf75){ChatGroupEvents[_0x2851('0x7')](_0x28fcac+':'+_0x138d42['id'],_0x138d42);ChatGroupEvents['emit'](_0x28fcac,_0x138d42);_0x58bf75(null);};}for(var e in events){if(events[_0x2851('0x8')](e)){var event=events[e];ChatGroup[_0x2851('0x9')](e,emitEvent(event));}}module[_0x2851('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2eb471f..aa3f6bc 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 _0xf114=['rimraf','exports','define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x426708,_0x87e4ac){var _0x8c4690=function(_0x534f4c){while(--_0x534f4c){_0x426708['push'](_0x426708['shift']());}};_0x8c4690(++_0x87e4ac);}(_0xf114,0x1e4));var _0x4f11=function(_0x1ceb5c,_0x33ed0b){_0x1ceb5c=_0x1ceb5c-0x0;var _0x6240ed=_0xf114[_0x1ceb5c];return _0x6240ed;};'use strict';var _=require(_0x4f11('0x0'));var util=require(_0x4f11('0x1'));var logger=require(_0x4f11('0x2'))('api');var moment=require(_0x4f11('0x3'));var BPromise=require(_0x4f11('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f11('0x5'));var rimraf=require(_0x4f11('0x6'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x4f11('0x7')]=function(_0x3416a0,_0x1da2f8){return _0x3416a0[_0x4f11('0x8')](_0x4f11('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2381=['define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x569a11,_0x9ec478){var _0xcf15b5=function(_0x5ac163){while(--_0x5ac163){_0x569a11['push'](_0x569a11['shift']());}};_0xcf15b5(++_0x9ec478);}(_0x2381,0xbd));var _0x1238=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x2381[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x1238('0x0'));var util=require(_0x1238('0x1'));var logger=require(_0x1238('0x2'))('api');var moment=require(_0x1238('0x3'));var BPromise=require(_0x1238('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1238('0x5'));var rimraf=require(_0x1238('0x6'));var config=require(_0x1238('0x7'));var attributes=require('./chatGroup.attributes');module[_0x1238('0x8')]=function(_0x413b47,_0x168e41){return _0x413b47[_0x1238('0x9')](_0x1238('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 92578a4..1688793 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 _0xec46=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xec46,0x19c));var _0x6ec4=function(_0x341ced,_0x5774ad){_0x341ced=_0x341ced-0x0;var _0x5726b5=_0xec46[_0x341ced];return _0x5726b5;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});config['redis']=_[_0x6ec4('0xa')](config[_0x6ec4('0xb')],{'host':_0x6ec4('0xc'),'port':0x18eb});var socket=require(_0x6ec4('0xd'))(new Redis(config[_0x6ec4('0xb')]));require(_0x6ec4('0xe'))[_0x6ec4('0xf')](socket);function respondWithRpcPromise(_0x164b81,_0x5e8746,_0x259d07){return new BPromise(function(_0xe51f56,_0x47bfaa){return client['request'](_0x164b81,_0x259d07)[_0x6ec4('0x10')](function(_0x45f738){logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));logger['debug'](_0x6ec4('0x13'),_0x5e8746,'request\x20sent',JSON[_0x6ec4('0x14')](_0x45f738));if(_0x45f738[_0x6ec4('0x15')]){if(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x16')]===0x1f4){logger[_0x6ec4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0x47bfaa(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0xe51f56(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}else{logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));_0xe51f56(_0x45f738['result']['message']);}})[_0x6ec4('0x19')](function(_0x49594b){logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x49594b);_0x47bfaa(_0x49594b);});});} \ No newline at end of file +var _0x8d0e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x25d1a5,_0x507038){var _0x189bc3=function(_0x3c9537){while(--_0x3c9537){_0x25d1a5['push'](_0x25d1a5['shift']());}};_0x189bc3(++_0x507038);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x397b30,_0x553395){_0x397b30=_0x397b30-0x0;var _0x1bcf08=_0x8d0e[_0x397b30];return _0x1bcf08;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1f51370..4abca5d 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 _0xa6af=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0xa6af,0x1d0));var _0xfa6a=function(_0x2d69be,_0x800d90){_0x2d69be=_0x2d69be-0x0;var _0x59fa93=_0xa6af[_0x2d69be];return _0x59fa93;};'use strict';var ChatGroupEvents=require(_0xfa6a('0x0'));var events=[_0xfa6a('0x1'),_0xfa6a('0x2'),_0xfa6a('0x3')];function createListener(_0x530d58,_0x4c3550){return function(_0x57e8b9){_0x4c3550[_0xfa6a('0x4')](_0x530d58,_0x57e8b9);};}function removeListener(_0x3f603c,_0x52c20f){return function(){ChatGroupEvents[_0xfa6a('0x5')](_0x3f603c,_0x52c20f);};}exports[_0xfa6a('0x6')]=function(_0x6163c2){for(var _0x278044=0x0,_0x4de211=events[_0xfa6a('0x7')];_0x278044<_0x4de211;_0x278044++){var _0x11df2c=events[_0x278044];var _0x1e56c5=createListener(_0xfa6a('0x8')+_0x11df2c,_0x6163c2);ChatGroupEvents['on'](_0x11df2c,_0x1e56c5);}}; \ No newline at end of file +var _0x71c5=['removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2d4b98,_0x513897){var _0x109161=function(_0x259674){while(--_0x259674){_0x2d4b98['push'](_0x2d4b98['shift']());}};_0x109161(++_0x513897);}(_0x71c5,0x12f));var _0x571c=function(_0x54b078,_0xde2eba){_0x54b078=_0x54b078-0x0;var _0x46de84=_0x71c5[_0x54b078];return _0x46de84;};'use strict';var ChatGroupEvents=require(_0x571c('0x0'));var events=[_0x571c('0x1'),_0x571c('0x2'),'update'];function createListener(_0x25b7b2,_0x12de22){return function(_0x57e03f){_0x12de22['emit'](_0x25b7b2,_0x57e03f);};}function removeListener(_0x10e5bb,_0x126c00){return function(){ChatGroupEvents[_0x571c('0x3')](_0x10e5bb,_0x126c00);};}exports['register']=function(_0xb4ee84){for(var _0x542e03=0x0,_0x4ea49a=events[_0x571c('0x4')];_0x542e03<_0x4ea49a;_0x542e03++){var _0x142a3c=events[_0x542e03];var _0x437f76=createListener(_0x571c('0x5')+_0x142a3c,_0xb4ee84);ChatGroupEvents['on'](_0x142a3c,_0x437f76);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8b67563..8190067 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 _0xe9ba=['get','isAuthenticated','index','/describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./chatGroup.controller'];(function(_0x1ce52a,_0x368e5e){var _0x42d74e=function(_0xbda091){while(--_0xbda091){_0x1ce52a['push'](_0x1ce52a['shift']());}};_0x42d74e(++_0x368e5e);}(_0xe9ba,0x1d5));var _0xae9b=function(_0x5f225f,_0x5c6b35){_0x5f225f=_0x5f225f-0x0;var _0x5cb055=_0xe9ba[_0x5f225f];return _0x5cb055;};'use strict';var multer=require('multer');var util=require(_0xae9b('0x0'));var path=require(_0xae9b('0x1'));var timeout=require(_0xae9b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xae9b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xae9b('0x4'));var controller=require(_0xae9b('0x5'));router[_0xae9b('0x6')]('/',auth[_0xae9b('0x7')](),controller[_0xae9b('0x8')]);router['get'](_0xae9b('0x9'),auth[_0xae9b('0x7')](),controller['describe']);router[_0xae9b('0x6')](_0xae9b('0xa'),auth[_0xae9b('0x7')](),controller[_0xae9b('0xb')]);router[_0xae9b('0x6')](_0xae9b('0xc'),auth[_0xae9b('0x7')](),controller['getUnread']);router['get'](_0xae9b('0xd'),auth[_0xae9b('0x7')](),controller[_0xae9b('0xe')]);router[_0xae9b('0x6')](_0xae9b('0xf'),auth[_0xae9b('0x7')](),controller[_0xae9b('0x10')]);router[_0xae9b('0x11')]('/',auth[_0xae9b('0x7')](),controller[_0xae9b('0x12')]);router[_0xae9b('0x11')](_0xae9b('0xd'),auth[_0xae9b('0x7')](),controller[_0xae9b('0x13')]);router[_0xae9b('0x11')](_0xae9b('0xf'),auth[_0xae9b('0x7')](),controller[_0xae9b('0x14')]);router['put'](_0xae9b('0xa'),auth[_0xae9b('0x7')](),controller[_0xae9b('0x15')]);router[_0xae9b('0x16')]('/:id',auth[_0xae9b('0x7')](),controller[_0xae9b('0x17')]);router[_0xae9b('0x16')]('/:id/members',auth[_0xae9b('0x7')](),controller['removeMembers']);module[_0xae9b('0x18')]=router; \ No newline at end of file +var _0xabb6=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','removeMembers','exports'];(function(_0x39fabb,_0x2744b1){var _0x48361=function(_0xa60722){while(--_0xa60722){_0x39fabb['push'](_0x39fabb['shift']());}};_0x48361(++_0x2744b1);}(_0xabb6,0x195));var _0x6abb=function(_0x3591dc,_0x2b1429){_0x3591dc=_0x3591dc-0x0;var _0x40cddd=_0xabb6[_0x3591dc];return _0x40cddd;};'use strict';var multer=require(_0x6abb('0x0'));var util=require(_0x6abb('0x1'));var path=require(_0x6abb('0x2'));var timeout=require(_0x6abb('0x3'));var express=require(_0x6abb('0x4'));var router=express['Router']();var fs_extra=require(_0x6abb('0x5'));var auth=require(_0x6abb('0x6'));var interaction=require(_0x6abb('0x7'));var config=require(_0x6abb('0x8'));var controller=require(_0x6abb('0x9'));router[_0x6abb('0xa')]('/',auth[_0x6abb('0xb')](),controller['index']);router[_0x6abb('0xa')]('/describe',auth[_0x6abb('0xb')](),controller[_0x6abb('0xc')]);router['get']('/:id',auth[_0x6abb('0xb')](),controller['show']);router[_0x6abb('0xa')](_0x6abb('0xd'),auth[_0x6abb('0xb')](),controller['getUnread']);router[_0x6abb('0xa')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0xf')]);router[_0x6abb('0xa')](_0x6abb('0x10'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x11')]);router[_0x6abb('0x12')]('/',auth[_0x6abb('0xb')](),controller[_0x6abb('0x13')]);router[_0x6abb('0x12')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x14')]);router[_0x6abb('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6abb('0x15')]);router['put'](_0x6abb('0x16'),auth['isAuthenticated'](),controller[_0x6abb('0x17')]);router['delete'](_0x6abb('0x16'),auth[_0x6abb('0xb')](),controller['destroy']);router[_0x6abb('0x18')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x19')]);module[_0x6abb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 5ae6474..5de2ea9 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 _0x131e=['thumb','TEXT','STRING','DATE','long','out','INTEGER','ENUM','star'];(function(_0x52e154,_0x5b2503){var _0x20b3ae=function(_0x2015ea){while(--_0x2015ea){_0x52e154['push'](_0x52e154['shift']());}};_0x20b3ae(++_0x5b2503);}(_0x131e,0x1ec));var _0xe131=function(_0x21a14a,_0xf4df5c){_0x21a14a=_0x21a14a-0x0;var _0x2696df=_0x131e[_0x21a14a];return _0x2696df;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe131('0x0')]},'ratingType':{'type':Sequelize[_0xe131('0x1')](_0xe131('0x2'),_0xe131('0x3')),'defaultValue':_0xe131('0x2')},'ratingMessage':{'type':Sequelize[_0xe131('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xe131('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe131('0x6')]},'disposition':{'type':Sequelize[_0xe131('0x5')]},'secondDisposition':{'type':Sequelize[_0xe131('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe131('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xe131('0x5')]},'deviceModel':{'type':Sequelize[_0xe131('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xe131('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe131('0x5')]},'formData':{'type':Sequelize[_0xe131('0x4')](_0xe131('0x7'))},'read1stAt':{'type':Sequelize[_0xe131('0x6')]},'lastMsgAt':{'type':Sequelize[_0xe131('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xe131('0x1')]('in',_0xe131('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4024=['long','DATE','sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING'];(function(_0x6b6e9,_0x23f0e3){var _0x16e0ba=function(_0x485e33){while(--_0x485e33){_0x6b6e9['push'](_0x6b6e9['shift']());}};_0x16e0ba(++_0x23f0e3);}(_0x4024,0x89));var _0x4402=function(_0xe00024,_0x4e8cd1){_0xe00024=_0xe00024-0x0;var _0x455ba0=_0x4024[_0xe00024];return _0x455ba0;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4402('0x2')]},'ratingType':{'type':Sequelize[_0x4402('0x3')]('star',_0x4402('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4402('0x5')]},'pathTranscript':{'type':Sequelize[_0x4402('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4402('0x6')]},'secondDisposition':{'type':Sequelize[_0x4402('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4402('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4402('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4402('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x4402('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4402('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x4402('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4402('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x4402('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4402('0x6')]},'customerPort':{'type':Sequelize[_0x4402('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4402('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f2e840d..a3d5a22 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 _0x3423=['Unauthorized','attachId','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','download','root','server/files/chat/upload/','format','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','alias','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','firstName','secret','read','Account','Owner','get','mkdirSync','Chat','closedAt','osName','customerIp','customerPort','existsSync','pipe','out','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','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','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','render','merge','body','interaction','account','Users','fullname','TagIds','forEach','push','catch','index','map','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','field','color','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload'];(function(_0x1fe7e4,_0x5d39a4){var _0x4b3e54=function(_0x39fdf1){while(--_0x39fdf1){_0x1fe7e4['push'](_0x1fe7e4['shift']());}};_0x4b3e54(++_0x5d39a4);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3342('0x13'))(_0x3342('0x14'));var utils=require('../../config/utils');var config=require(_0x3342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3342('0x16'))['db'];config[_0x3342('0x17')]=_['defaults'](config[_0x3342('0x17')],{'host':_0x3342('0x18'),'port':0x18eb});var socket=require(_0x3342('0x19'))(new Redis(config[_0x3342('0x17')]));require(_0x3342('0x1a'))[_0x3342('0x1b')](socket);var jayson=require(_0x3342('0x1c'));var client=jayson['client'][_0x3342('0x1d')]({'port':0x232b});var client9004=jayson[_0x3342('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x40d609,_0x2c9df0,_0x51ef91,_0x554f9c){return new BPromise(function(_0xdbbb6c,_0x143cf1){var _0x6949fc=_0x554f9c||client;return _0x6949fc[_0x3342('0x1f')](_0x40d609,_0x51ef91)[_0x3342('0x20')](function(_0x156c24){logger[_0x3342('0x21')](_0x3342('0x22'),_0x2c9df0,_0x3342('0x23'));logger['debug'](_0x3342('0x24'),_0x2c9df0,_0x3342('0x23'),JSON[_0x3342('0x25')](_0x156c24));if(_0x156c24['error']){if(_0x156c24[_0x3342('0x26')][_0x3342('0x27')]===0x1f4){logger['error'](_0x3342('0x22'),_0x2c9df0,_0x156c24[_0x3342('0x26')]['message']);return _0x143cf1(_0x156c24[_0x3342('0x26')]['message']);}logger[_0x3342('0x26')](_0x3342('0x22'),_0x2c9df0,_0x156c24[_0x3342('0x26')][_0x3342('0x28')]);return _0xdbbb6c(_0x156c24[_0x3342('0x26')][_0x3342('0x28')]);}else{logger[_0x3342('0x21')](_0x3342('0x22'),_0x2c9df0,'request\x20sent');_0xdbbb6c(_0x156c24[_0x3342('0x29')]['message']);}})['catch'](function(_0x986ab0){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2c9df0,_0x986ab0);_0x143cf1(_0x986ab0);});});}function respondWithStatusCode(_0x247ee4,_0x58f0f5){_0x58f0f5=_0x58f0f5||0xcc;return function(_0x37df78){if(_0x37df78){return _0x247ee4['sendStatus'](_0x58f0f5);}return _0x247ee4['status'](_0x58f0f5)['end']();};}function respondWithResult(_0x1497d9,_0x286c42){_0x286c42=_0x286c42||0xc8;return function(_0x1dd607){if(_0x1dd607){return _0x1497d9['status'](_0x286c42)[_0x3342('0x2a')](_0x1dd607);}};}function respondWithFilteredResult(_0x1275e2,_0x1cc542){return function(_0x272a52){if(_0x272a52){var _0x4fbfb7=typeof _0x1cc542[_0x3342('0x2b')]===_0x3342('0x2c')&&typeof _0x1cc542[_0x3342('0x2d')]===_0x3342('0x2c');var _0xf82530=_0x272a52[_0x3342('0x2e')];var _0x135760=_0x4fbfb7?0x0:_0x1cc542['offset'];var _0x2e0bde=_0x4fbfb7?_0x272a52['count']:_0x1cc542[_0x3342('0x2b')]+_0x1cc542[_0x3342('0x2d')];var _0x508f87;if(_0x2e0bde>=_0xf82530){_0x2e0bde=_0xf82530;_0x508f87=0xc8;}else{_0x508f87=0xce;}_0x1275e2[_0x3342('0x2f')](_0x508f87);return _0x1275e2[_0x3342('0x30')](_0x3342('0x31'),_0x135760+'-'+_0x2e0bde+'/'+_0xf82530)[_0x3342('0x2a')](_0x272a52);}return null;};}function patchUpdates(_0x498ded){return function(_0x3301c1){try{jsonpatch[_0x3342('0x32')](_0x3301c1,_0x498ded,!![]);}catch(_0x311cfe){return BPromise[_0x3342('0x33')](_0x311cfe);}return _0x3301c1[_0x3342('0x34')]();};}function saveUpdates(_0x26528f,_0x16fbb0){return function(_0x78c868){if(_0x78c868){return _0x78c868[_0x3342('0x35')](_0x26528f)[_0x3342('0x20')](function(_0x46cdbd){return _0x46cdbd;});}return null;};}function removeEntity(_0x30dcea,_0x5aea96){return function(_0x478c8d){if(_0x478c8d){return _0x478c8d[_0x3342('0x36')]()['then'](function(){_0x30dcea[_0x3342('0x2f')](0xcc)[_0x3342('0x37')]();});}};}function handleEntityNotFound(_0x1a74d3,_0x361d23){return function(_0x2dbc02){if(!_0x2dbc02){_0x1a74d3[_0x3342('0x38')](0x194);}return _0x2dbc02;};}function handleError(_0x956cde,_0x5d460c){_0x5d460c=_0x5d460c||0x1f4;return function(_0x4754d9){logger[_0x3342('0x26')](_0x4754d9[_0x3342('0x39')]);if(_0x4754d9[_0x3342('0x3a')]){delete _0x4754d9[_0x3342('0x3a')];}_0x956cde['status'](_0x5d460c)[_0x3342('0x3b')](_0x4754d9);};}function getMustacheRender(_0x4d1a59,_0x22ca76){return Mustache[_0x3342('0x3c')](_0x4d1a59,_[_0x3342('0x3d')](_0x22ca76[_0x3342('0x3e')],{'contact':_0x22ca76['contact'],'message':_0x22ca76[_0x3342('0x28')],'agent':_0x22ca76['agent'],'interaction':_0x22ca76[_0x3342('0x3f')],'account':_0x22ca76[_0x3342('0x40')]}))||'';}function getInteractionUsers(_0x2e815e,_0x1b58c5){return new BPromise(function(_0x40a5bd,_0xf83613){try{if(_0x1b58c5[_0x2e815e['id']]){_0x2e815e[_0x3342('0x41')]=_['map'](_0x1b58c5[_0x2e815e['id']],function(_0x3e626b){return{'id':_0x3e626b['id'],'fullname':_0x3e626b[_0x3342('0x42')]};});}}catch(_0x57cc44){_0xf83613(_0x57cc44);}_0x40a5bd(_0x2e815e);});}function getInteractionTags(_0x324205,_0x1f336c){return new BPromise(function(_0x494d28,_0x45b956){try{if(_0x324205[_0x3342('0x43')]){_0x324205['Tags']=[];_0x324205['TagIds']['split'](',')[_0x3342('0x44')](function(_0x41e727){_0x324205['Tags'][_0x3342('0x45')](_0x1f336c[_0x41e727]);});}delete _0x324205[_0x3342('0x43')];}catch(_0x2944ab){_0x45b956(_0x2944ab);}_0x494d28(_0x324205);});}function updateChatInteraction(_0x17fd01,_0x126ee4,_0x308363){return new BPromise(function(_0x34de7b,_0x4282ea){return getInteractionUsers(_0x17fd01,_0x308363)['then'](function(_0x5a787b){return getInteractionTags(_0x5a787b,_0x126ee4);})[_0x3342('0x20')](function(_0x7341fa){_0x34de7b(_0x7341fa);})[_0x3342('0x46')](function(_0xee717e){_0x4282ea(_0xee717e);});});}exports[_0x3342('0x47')]=function(_0x414fcb,_0x5e24a1){var _0x15eb49={},_0x196436={},_0x283ce9={'count':0x0,'rows':[]};var _0x309423=_[_0x3342('0x48')](db[_0x3342('0x49')]['rawAttributes'],function(_0x36baa4){return{'name':_0x36baa4['fieldName'],'type':_0x36baa4[_0x3342('0x4a')][_0x3342('0x4b')]};});_0x196436[_0x3342('0x4c')]=_[_0x3342('0x48')](_0x309423,'name');_0x196436[_0x3342('0x4d')]=_[_0x3342('0x4e')](_0x414fcb['query']);_0x196436[_0x3342('0x4f')]=_[_0x3342('0x50')](_0x196436[_0x3342('0x4c')],_0x196436[_0x3342('0x4d')]);_0x15eb49['attributes']=_[_0x3342('0x50')](_0x196436[_0x3342('0x4c')],qs['fields'](_0x414fcb[_0x3342('0x4d')]['fields']));_0x15eb49['attributes']=_0x15eb49[_0x3342('0x51')][_0x3342('0x52')]?_0x15eb49[_0x3342('0x51')]:_0x196436[_0x3342('0x4c')];if(!_0x414fcb[_0x3342('0x4d')][_0x3342('0x53')](_0x3342('0x54'))){_0x15eb49['limit']=qs['limit'](_0x414fcb[_0x3342('0x4d')]['limit']);_0x15eb49[_0x3342('0x2b')]=qs['offset'](_0x414fcb['query']['offset']);}_0x15eb49[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x414fcb[_0x3342('0x4d')][_0x3342('0x56')]);_0x15eb49['where']=qs[_0x3342('0x4f')](_[_0x3342('0x57')](_0x414fcb['query'],_0x196436[_0x3342('0x4f')]),_0x309423);var _0x24d543=[];var _0x43c27a=squel['select']()[_0x3342('0x58')]('id')[_0x3342('0x58')](_0x3342('0x3a'))[_0x3342('0x58')](_0x3342('0x59'))['from'](_0x3342('0x5a'));var _0x1d5001=squel[_0x3342('0x5b')]()[_0x3342('0x58')](_0x3342('0x5c'))[_0x3342('0x58')](_0x3342('0x5d'))[_0x3342('0x58')](_0x3342('0x5e'))['from'](_0x3342('0x5f'),'ui')['left_join'](_0x3342('0x60'),'u','u.id\x20=\x20ui.UserId');var _0x49e3c6=squel['select']()['from'](_0x3342('0x61'),'i')[_0x3342('0x62')](_0x3342('0x63'),'c',_0x3342('0x64'))[_0x3342('0x62')](_0x3342('0x60'),'o',_0x3342('0x65'))[_0x3342('0x62')](_0x3342('0x66'),'a',_0x3342('0x67'))[_0x3342('0x62')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x3342('0x62')]('chat_interaction_has_tags','it',_0x3342('0x68'))['left_join']('tools_tags','t',_0x3342('0x69'));var _0x43d39f=squel[_0x3342('0x6a')]();var _0x5d5e0f=[];var _0x58d37a=squel[_0x3342('0x6a')]();var _0x3cc92a;if(_0x414fcb['query'][_0x3342('0x6b')]){_0x3cc92a=as[_0x3342('0x6c')](_0x414fcb[_0x3342('0x4d')]['search']);var _0x23c186=_0x3cc92a[_0x3342('0x6d')];for(var _0x3dd926=0x0;_0x3dd926<_0x3cc92a[_0x3342('0x6e')][_0x3342('0x52')];_0x3dd926++){var _0x19e27b=_0x3cc92a[_0x3342('0x6e')][_0x3dd926];var _0x57942a='i';var _0x4bc9a9=_[_0x3342('0x6f')](_0x309423,['name',_0x19e27b[_0x3342('0x58')]]);if(!_0x4bc9a9){switch(_0x19e27b[_0x3342('0x58')]){case _0x3342('0x70'):if(_0x19e27b[_0x3342('0x71')]==0x1){_0x49e3c6[_0x3342('0x72')]('`'+_0x19e27b['field']+_0x3342('0x73'));}else{_0x49e3c6[_0x3342('0x72')]('`'+_0x19e27b['field']+_0x3342('0x74'));}break;case _0x3342('0x75'):if(_0x19e27b[_0x3342('0x76')]===_0x3342('0x77')){if(_0x19e27b[_0x3342('0x71')][_0x3342('0x78')]('\x20')[_0x3342('0x52')]>0x1){_0x43d39f[_0x23c186](_0x3342('0x79'),qs[_0x3342('0x7a')](_0x19e27b[_0x3342('0x71')]),null);}else{var _0x42fcd7='%'+_0x19e27b[_0x3342('0x71')]+'%';_0x43d39f[_0x23c186](_0x3342('0x7b'),_0x42fcd7,_0x42fcd7,_0x42fcd7);}}else{_0x4bc9a9=_['find'](_0x309423,['name',_0x3342('0x7c')]);_0x19e27b[_0x3342('0x58')]=_0x3342('0x7c');_0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9['type'],_0x19e27b);_0x43d39f[_0x23c186](_0x570781['text'],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);}break;case _0x3342('0x7f'):var _0x3902b6=_0x19e27b[_0x3342('0x71')][_0x3342('0x78')](',')[_0x3342('0x48')](function(_0x385d9c){return Number(_0x385d9c);});_0x3902b6['forEach'](function(_0x3392a2){_0x58d37a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3392a2+',%');});_0x5d5e0f=_[_0x3342('0x80')](_0x5d5e0f,_0x3902b6);break;case _0x3342('0x81'):if(_0x19e27b['operator']===_0x3342('0x77')){_0x43d39f[_0x23c186](_0x3342('0x82'),'%'+_0x19e27b['value']+'%',null);}else{_0x4bc9a9=_[_0x3342('0x6f')](_0x309423,[_0x3342('0x3a'),_0x3342('0x83')]);_0x19e27b[_0x3342('0x58')]=_0x3342('0x83');_0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9[_0x3342('0x4a')],_0x19e27b);_0x43d39f[_0x23c186](_0x570781['text'],_0x570781[_0x3342('0x71')]['start'],_0x570781['value'][_0x3342('0x37')]);}break;case _0x3342('0x3e'):_0x570781=as[_0x3342('0x7d')]('me',null,_0x19e27b);_0x43d39f[_0x23c186](_0x570781[_0x3342('0x84')],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);break;}}else{var _0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9[_0x3342('0x4a')],_0x19e27b);_0x43d39f[_0x23c186](_0x570781[_0x3342('0x84')],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);}}}else{var _0x58926c=_(_0x414fcb[_0x3342('0x4d')])[_0x3342('0x4e')]()[_0x3342('0x48')](function(_0x20203b){return _[_0x3342('0x85')](_0x309423,[_0x3342('0x3a'),_0x20203b])?_0x20203b:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x58926c)){_0x58926c[_0x3342('0x44')](function(_0x21670a){if(_0x21670a===_0x3342('0x86')){_0x49e3c6[_0x3342('0x87')](_0x3342('0x88'),[][_0x3342('0x89')](_0x414fcb[_0x3342('0x4d')][_0x21670a]));}else if(_0x21670a===_0x3342('0x8a')){var _0x4b47ab=JSON[_0x3342('0x8b')](_0x414fcb[_0x3342('0x4d')][_0x21670a])[_0x3342('0x8c')];var _0x42782f=JSON['parse'](_0x414fcb[_0x3342('0x4d')][_0x21670a])[_0x3342('0x8d')];_0x49e3c6[_0x3342('0x87')](_0x3342('0x8e'),_0x4b47ab,_0x42782f);}else{if(_0x414fcb[_0x3342('0x4d')][_0x21670a]===_0x3342('0x8f')){_0x49e3c6[_0x3342('0x87')]('i.'+_0x21670a+_0x3342('0x90'));}else{_0x49e3c6[_0x3342('0x87')]('i.'+_0x21670a+'\x20=\x20?',_0x414fcb[_0x3342('0x4d')][_0x21670a]);}}});}if(_0x414fcb[_0x3342('0x4d')]['read']){if(_0x414fcb[_0x3342('0x4d')]['read']==0x1){_0x49e3c6[_0x3342('0x72')]('`unreadMessages`\x20=\x200');}else{_0x49e3c6[_0x3342('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')]){_0x5d5e0f=_['isArray'](_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')])?_0x414fcb['query'][_0x3342('0x91')]:new Array(_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')]);_0x5d5e0f[_0x3342('0x44')](function(_0x22a9ec){_0x58d37a['or'](_0x3342('0x92'),'%,'+_0x22a9ec+',%');});}if(_0x414fcb['query'][_0x3342('0x93')]){var _0x5f168b=_0x414fcb[_0x3342('0x4d')][_0x3342('0x93')][_0x3342('0x94')]('\x5c','\x5c\x5c')[_0x3342('0x94')](/'/g,'\x27\x27');if(qs[_0x3342('0x95')](_0x5f168b)){_0x43d39f['or'](_0x3342('0x96'),_0x5f168b+'%');}else{_0x43d39f['or'](_0x3342('0x97'),qs[_0x3342('0x7a')](_0x5f168b))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f168b+'%');}}}_0x49e3c6[_0x3342('0x87')](_0x43d39f);_0x49e3c6[_0x3342('0x98')](_0x3342('0x99'));var _0x592122={'type':db['Sequelize'][_0x3342('0x9a')]['SELECT'],'raw':!![]};var _0x59088e=_0x49e3c6[_0x3342('0x9b')]();_0x59088e[_0x3342('0x58')]('i.id');_0x59088e[_0x3342('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3342('0x70'));if(_0x15eb49['order']){_0x15eb49['order'][_0x3342('0x44')](function(_0x2d3f3e){var _0x3131d9=_0x2d3f3e[0x0]==='contactName'?_0x2d3f3e[0x0]:'i.'+_0x2d3f3e[0x0];_0x49e3c6['order'](_0x3131d9,_0x2d3f3e[0x1]===_0x3342('0x9c')?![]:!![]);});}if(!_['isEmpty'](_0x5d5e0f)){_0x49e3c6[_0x3342('0x72')](_0x58d37a);_0x59088e[_0x3342('0x87')](_0x3342('0x9d'),_0x5d5e0f);}BPromise[_0x3342('0x9e')]()['then'](function(){if(!_0x3cc92a){if(_0x414fcb['query'][_0x3342('0x86')])return;_0x59088e[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x49e3c6[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x414fcb[_0x3342('0x9f')][_0x3342('0xa0')]!==_0x3342('0xa1'))return;return _0x414fcb[_0x3342('0x9f')][_0x3342('0xa2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x502050){if(_['isEmpty'](_0x502050)){_0x59088e[_0x3342('0x87')](_0x3342('0xa3'));_0x49e3c6[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x59088e[_0x3342('0x87')](_0x3342('0x88'),_[_0x3342('0x48')](_0x502050,'id'));_0x49e3c6[_0x3342('0x87')](_0x3342('0x88'),_[_0x3342('0x48')](_0x502050,'id'));}});})['then'](function(){if(_0x414fcb[_0x3342('0x9f')]['role']==='agent'&&!_0x3cc92a&&!_0x414fcb['query'][_0x3342('0x86')])return[];return db[_0x3342('0xa4')]['query'](_0x59088e[_0x3342('0xa5')](),_0x592122);})[_0x3342('0x20')](function(_0x55049d){_0x283ce9[_0x3342('0x2e')]=_0x55049d[_0x3342('0x52')];if(_0x283ce9[_0x3342('0x2e')]===0x0)return[];return db[_0x3342('0xa4')][_0x3342('0x4d')](_0x43c27a[_0x3342('0xa5')](),_0x592122)[_0x3342('0x20')](function(_0x132ef4){_0x24d543=_['keyBy'](_0x132ef4,'id');_0x592122=_[_0x3342('0x3d')](_0x592122,{'model':db[_0x3342('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x414fcb[_0x3342('0x4d')][_0x3342('0xa6')]){_0x15eb49[_0x3342('0x51')][_0x3342('0x44')](function(_0x2d2902){_0x49e3c6['field']('i.'+_0x2d2902);});}else{_0x49e3c6['field'](_0x3342('0xa7'),_0x3342('0x70'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xa8'),_0x3342('0xa9'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xaa'),'Account.mandatoryDisposition');_0x49e3c6[_0x3342('0x58')](_0x3342('0xab'),_0x3342('0xac'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xad'));_0x49e3c6['field'](_0x3342('0xae'),_0x3342('0xaf'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb0'),'Contact.lastName');_0x49e3c6[_0x3342('0x58')](_0x3342('0xb1'),_0x3342('0xb2'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb3'),_0x3342('0xb4'));_0x49e3c6[_0x3342('0x58')]('c.mobile','Contact.mobile');_0x49e3c6[_0x3342('0x58')]('c.fax',_0x3342('0xb5'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb6'),_0x3342('0xb7'));_0x49e3c6[_0x3342('0x58')]('o.internal',_0x3342('0xb8'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb9'),'TagIds');}if(_0x15eb49['limit'])_0x49e3c6[_0x3342('0x2d')](_0x15eb49[_0x3342('0x2d')]);if(_0x15eb49[_0x3342('0x2b')])_0x49e3c6[_0x3342('0x2b')](_0x15eb49[_0x3342('0x2b')]);return db[_0x3342('0xa4')][_0x3342('0x4d')](_0x49e3c6[_0x3342('0xa5')](),_0x592122);})[_0x3342('0x20')](function(_0x304dd0){if(_0x304dd0[_0x3342('0x52')]>0x0)_0x1d5001[_0x3342('0x87')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x304dd0,'id'));return db['sequelize'][_0x3342('0x4d')](_0x1d5001[_0x3342('0xa5')](),_0x592122)[_0x3342('0x20')](function(_0x405995){var _0x31bf5c=_['groupBy'](_0x405995,_0x3342('0xba'));var _0x1f98b5=[];_0x304dd0[_0x3342('0x44')](function(_0x537b31){_0x1f98b5[_0x3342('0x45')](updateChatInteraction(_0x537b31,_0x24d543,_0x31bf5c));});return BPromise[_0x3342('0xbb')](_0x1f98b5);});});})['then'](function(_0x501e72){_0x283ce9[_0x3342('0xbc')]=_0x501e72;return _0x283ce9;})[_0x3342('0x20')](respondWithFilteredResult(_0x5e24a1,_0x15eb49))[_0x3342('0x46')](handleError(_0x5e24a1,null));};exports[_0x3342('0xbd')]=function(_0x475ee4,_0x51b0f9){var _0x48cb53={'raw':![],'where':{'id':_0x475ee4[_0x3342('0xbe')]['id']}},_0x37fdc5={};_0x37fdc5[_0x3342('0x4c')]=_[_0x3342('0x4e')](db[_0x3342('0x49')][_0x3342('0xbf')]);_0x37fdc5[_0x3342('0x4d')]=_['keys'](_0x475ee4['query']);_0x37fdc5['filters']=_[_0x3342('0x50')](_0x37fdc5['model'],_0x37fdc5['query']);_0x48cb53['attributes']=_[_0x3342('0x50')](_0x37fdc5[_0x3342('0x4c')],qs['fields'](_0x475ee4[_0x3342('0x4d')]['fields']));_0x48cb53['attributes']=_0x48cb53[_0x3342('0x51')]['length']?_0x48cb53[_0x3342('0x51')]:_0x37fdc5[_0x3342('0x4c')];if(_0x475ee4[_0x3342('0x4d')][_0x3342('0xc0')]){_0x48cb53[_0x3342('0xc1')]=[{'all':!![]}];}_0x48cb53=_[_0x3342('0x3d')]({},_0x48cb53,_0x475ee4['options']);return db[_0x3342('0x49')][_0x3342('0x6f')](_0x48cb53)[_0x3342('0x20')](handleEntityNotFound(_0x51b0f9,null))['then'](respondWithResult(_0x51b0f9,null))[_0x3342('0x46')](handleError(_0x51b0f9,null));};exports[_0x3342('0xc2')]=function(_0x3b206a,_0x1f7b91){return db[_0x3342('0x49')][_0x3342('0xc2')](_0x3b206a['body'],{})[_0x3342('0x20')](respondWithResult(_0x1f7b91,0xc9))[_0x3342('0x46')](handleError(_0x1f7b91,null));};exports[_0x3342('0x35')]=function(_0x3b875e,_0x441c2a){if(_0x3b875e['body']['id']){delete _0x3b875e[_0x3342('0x3e')]['id'];}return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x3b875e[_0x3342('0xbe')]['id']}})['then'](handleEntityNotFound(_0x441c2a,null))[_0x3342('0x20')](saveUpdates(_0x3b875e['body'],null))[_0x3342('0x20')](respondWithResult(_0x441c2a,null))[_0x3342('0x46')](handleError(_0x441c2a,null));};exports[_0x3342('0x36')]=function(_0x4f4819,_0x1e67a4){return db['ChatInteraction'][_0x3342('0x6f')]({'where':{'id':_0x4f4819['params']['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x1e67a4,null))[_0x3342('0x20')](removeEntity(_0x1e67a4,null))[_0x3342('0x46')](handleError(_0x1e67a4,null));};exports['describe']=function(_0x25b867,_0x3a6d87){return db[_0x3342('0x49')][_0x3342('0xc3')]()[_0x3342('0x20')](respondWithResult(_0x3a6d87,null))[_0x3342('0x46')](handleError(_0x3a6d87,null));};exports[_0x3342('0xc4')]=function(_0x4d86c3,_0x296ae6){var _0x2d7ba8=_0x4d86c3[_0x3342('0xbe')]['id'];var _0x526a1a;var _0x27aa50;var _0x3c0eb8;return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x2d7ba8}})[_0x3342('0x20')](function(_0x157c6d){_0x526a1a=_0x157c6d;return db[_0x3342('0xc6')][_0x3342('0xc5')]({'where':{'id':_0x157c6d['ChatWebsiteId']},'attributes':['id',_0x3342('0xc7'),_0x3342('0xc8'),'vidaooTopic',_0x3342('0xc9'),_0x3342('0xca')],'raw':!![]});})[_0x3342('0x20')](function(_0x1e26f8){if(_0x1e26f8&&_0x1e26f8[_0x3342('0xc7')]&&_0x1e26f8[_0x3342('0xc8')]){_0x27aa50=_0x1e26f8;var _0x3c371b={'interaction':{'id':_0x2d7ba8},'agent':{'id':_0x4d86c3[_0x3342('0x9f')]['id'],'name':_0x4d86c3[_0x3342('0x9f')][_0x3342('0x3a')],'fullname':_0x4d86c3[_0x3342('0x9f')]['fullname'],'email':_0x4d86c3['user'][_0x3342('0xcb')]},'contact':_0x4d86c3[_0x3342('0x3e')][_0x3342('0xcc')],'account':_0x4d86c3[_0x3342('0x3e')][_0x3342('0x40')]};var _0x1bed4c={'rejectUnauthorized':![],'method':_0x3342('0xcd'),'url':_0x3342('0xce'),'headers':{'X-APIKEY':_0x1e26f8[_0x3342('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d86c3[_0x3342('0x9f')][_0x3342('0xcb')]],'buttons':null,'topic':_0x27aa50[_0x3342('0xcf')],'note':_[_0x3342('0xd0')](_0x27aa50[_0x3342('0xc9')])?null:getMustacheRender(_0x27aa50[_0x3342('0xc9')],_0x3c371b),'metadata':null},'redirect':_0x3342('0xd1'),'json':!![]};try{if(!_['isNull'](_0x27aa50['vidaooMetadata'])){var _0x399d30=getMustacheRender(_0x27aa50[_0x3342('0xca')],_0x3c371b);var _0x4fcb8d=JSON[_0x3342('0x8b')](_0x399d30);_0x1bed4c[_0x3342('0x3e')]['metadata']=_0x4fcb8d;}}catch(_0x455b2d){throw new db['Sequelize'][(_0x3342('0xd2'))](_0x3342('0xd3'));}return rp(_0x1bed4c);}else{throw new db[(_0x3342('0xd4'))][(_0x3342('0xd2'))](_0x3342('0xd5'));}})[_0x3342('0x20')](function(_0x8f9e69){_0x3c0eb8=_0x8f9e69;if(_0x3c0eb8['id']){var _0x31014e={'body':_0x3c0eb8[_0x3342('0xd6')],'ChatWebsiteId':_0x27aa50['id'],'ChatInteractionId':_0x526a1a['id'],'direction':'out','UserId':_0x4d86c3['user']['id']};return db['ChatMessage'][_0x3342('0xc2')](_0x31014e,{});}else{throw new db[(_0x3342('0xd4'))]['ValidationError'](_0x3342('0xd7'));}})[_0x3342('0x20')](function(){return _0x526a1a[_0x3342('0xd8')]({'vidaooSessionId':_0x3c0eb8['id']});})[_0x3342('0x20')](respondWithResult(_0x296ae6,null))['catch'](handleError(_0x296ae6,null));};exports[_0x3342('0xd9')]=function(_0x2d38a7,_0x5dbba5){if(_0x2d38a7['body']['id']){delete _0x2d38a7[_0x3342('0x3e')]['id'];}return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x2d38a7[_0x3342('0xbe')]['id']},'include':[{'model':db[_0x3342('0xda')],'as':_0x3342('0x75')}]})['then'](handleEntityNotFound(_0x5dbba5,null))['then'](saveUpdates(_0x2d38a7[_0x3342('0x3e')],null))[_0x3342('0x20')](respondWithResult(_0x5dbba5,null))[_0x3342('0x46')](handleError(_0x5dbba5,null));};exports[_0x3342('0xdb')]=function(_0x1b87a7,_0x50b51b,_0x50470b){if(_0x1b87a7['body']['id']){delete _0x1b87a7[_0x3342('0x3e')]['id'];}return db['ChatInteraction'][_0x3342('0x6f')]({'where':{'id':_0x1b87a7[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](function(_0x24b50f){if(!_0x24b50f){logger[_0x3342('0x26')](_0x3342('0xdc'),_0x3342('0xdb'),0x194,_0x3342('0xdd'));_0x50b51b[_0x3342('0x38')](0x194);}else{if(_0x24b50f[_0x3342('0x83')]){throw new db[(_0x3342('0xd4'))][(_0x3342('0xd2'))]('Interaction\x20already\x20assigned');}}return _0x24b50f;})[_0x3342('0x20')](function(_0x32a488){if(_0x32a488){return _0x32a488[_0x3342('0x35')]({'closed':_0x1b87a7[_0x3342('0x3e')][_0x3342('0xde')],'disposition':_0x1b87a7[_0x3342('0x3e')][_0x3342('0xdf')]})[_0x3342('0x20')](function(_0x28bb21){return _0x28bb21;});}})[_0x3342('0x20')](function(_0x40aa4a){return respondWithRpcPromise(_0x3342('0xe0'),'abandon',_0x1b87a7[_0x3342('0x3e')],client9004);})[_0x3342('0x20')](respondWithResult(_0x50b51b,null))['catch'](handleError(_0x50b51b,null));};exports[_0x3342('0xe1')]=function(_0x78daec,_0x7b7120,_0x512838){_0x78daec[_0x3342('0x3e')][_0x3342('0x3a')]=_0x78daec[_0x3342('0xe2')][_0x3342('0xe3')];_0x78daec[_0x3342('0x3e')][_0x3342('0xe4')]=_0x78daec['file'][_0x3342('0xe5')];_0x78daec[_0x3342('0x3e')][_0x3342('0x4a')]=_0x78daec[_0x3342('0xe2')]['mimetype'];return db[_0x3342('0xe6')]['create'](_0x78daec['body'])[_0x3342('0x20')](respondWithResult(_0x7b7120,0xc9))[_0x3342('0x46')](handleError(_0x7b7120,null));};exports[_0x3342('0xe7')]=function(_0x22ac7c,_0x4726ab,_0x14a236){return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x22ac7c[_0x3342('0xbe')]['id']},'raw':!![]})[_0x3342('0x20')](handleEntityNotFound(_0x4726ab,null))['then'](function(_0x58bcc3){if(_0x58bcc3){if(_0x58bcc3[_0x3342('0xde')]){return _0x4726ab[_0x3342('0x2f')](0x193)['json']({'status':0x193,'message':_0x3342('0xe8')});}return db['Attachment'][_0x3342('0xc5')]({'where':{'id':_0x22ac7c[_0x3342('0x4d')][_0x3342('0xe9')]},'raw':!![]})['then'](handleEntityNotFound(_0x4726ab,null));}})['then'](function(_0x328f06){if(_0x328f06){var _0x2a2c38=_0x328f06[_0x3342('0xea')]!==null;var _0x41146b=path['join'](config['root'],_0x3342('0xeb'));if(_0x2a2c38){_0x41146b=path['join'](_0x41146b,_0x3342('0xec'));}var _0xcd0550=path[_0x3342('0xed')](_0x41146b,_0x328f06[_0x3342('0xe4')]);return _0x4726ab[_0x3342('0xee')](_0xcd0550);}})['catch'](handleError(_0x4726ab,null));};exports['close']=function(_0x214ff3,_0x584c31){var _0x6ea059=null;var _0x521e5a=null;var _0x5cc2ef=null;var _0x59c56a=null;if(_0x214ff3['body']['id']){delete _0x214ff3[_0x3342('0x3e')]['id'];}if(_0x214ff3[_0x3342('0x3e')]['mailTranscript']){_0x59c56a=path['join'](config[_0x3342('0xef')],_0x3342('0xf0'),util[_0x3342('0xf1')]('transcript-%s.txt',Date[_0x3342('0xf2')]()));_0x214ff3[_0x3342('0x3e')][_0x3342('0xf3')]=_0x59c56a;}return db[_0x3342('0x49')]['find']({'where':{'id':_0x214ff3[_0x3342('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x3342('0xf4'),'include':[{'model':db[_0x3342('0x81')],'as':_0x3342('0x81')}]}]})['then'](handleEntityNotFound(_0x584c31,null))[_0x3342('0x20')](saveUpdates(_0x214ff3['body'],null))[_0x3342('0x20')](function(_0xf61be3){if(_0xf61be3){_0x6ea059=_0xf61be3;return db[_0x3342('0xc6')][_0x3342('0x6f')]({'where':{'id':_0x6ea059[_0x3342('0x86')]}});}})[_0x3342('0x20')](function(_0x322dd2){if(_0x322dd2){_0x5cc2ef=_0x322dd2;return db[_0x3342('0xda')][_0x3342('0x6f')]({'where':{'id':_0x6ea059['ContactId']}});}})[_0x3342('0x20')](function(_0x45bd80){if(_0x45bd80){_0x521e5a=_0x45bd80;if(_0x59c56a){var _0x35c575=null;for(var _0x1df1cb=0x1;_0x1df1cb<_0x6ea059[_0x3342('0xf4')]['length'];++_0x1df1cb){_0x35c575=_0x6ea059['Messages'][_0x1df1cb];var _0x4cb2f5=_0x35c575[_0x3342('0x83')]?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef['agentAlias'],_0x35c575[_0x3342('0x83')]):_0x3342('0xf6');var _0x6d520a=_0x214ff3['body'][_0x3342('0xf7')]||util['format'](_0x3342('0xf5'),_0x3342('0xf8'),_0x35c575[_0x3342('0x7c')]);switch(_0x5cc2ef[_0x3342('0xf9')]){case _0x3342('0xfa'):_0x4cb2f5=_0x35c575['UserId']?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef[_0x3342('0xfb')],_0x35c575['UserId']):_0x3342('0xf6');break;case _0x3342('0xfc'):_0x4cb2f5=_0x35c575[_0x3342('0x83')]?_0x35c575[_0x3342('0x81')]['alias']||_0x35c575[_0x3342('0x81')][_0x3342('0x42')]:_0x3342('0xf6');break;case _0x3342('0xfd'):_0x4cb2f5=_0x35c575[_0x3342('0x83')]?_0x35c575['User'][_0x3342('0x42')]:'System';break;default:_0x4cb2f5=_0x35c575[_0x3342('0x83')]?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef[_0x3342('0xfb')],_0x35c575['UserId']):_0x3342('0xf6');}var _0x3b0ae0=util[_0x3342('0xf1')](_0x3342('0xfe'),moment(_0x35c575['createdAt'])[_0x3342('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x35c575[_0x3342('0xff')]==='in'?_0x6d520a:_0x4cb2f5,_0x35c575[_0x3342('0x3e')]);if(!_0x35c575['secret']){fs[_0x3342('0x100')](_0x59c56a,_0x3b0ae0);}}return db['MailAccount'][_0x3342('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x3342('0x101')],'as':_0x3342('0x102'),'raw':!![]}]});}}})[_0x3342('0x20')](function(_0x1f6d84){if(_0x1f6d84&&_0x1f6d84[_0x3342('0x102')]&&_0x214ff3[_0x3342('0x3e')]){var _0x34e824={'tls':{'rejectUnauthorized':![]}};if(_0x1f6d84[_0x3342('0x102')][_0x3342('0x103')]){_0x34e824[_0x3342('0x103')]=_0x1f6d84['Smtp'][_0x3342('0x103')];}else{_0x34e824[_0x3342('0x104')]=_0x1f6d84[_0x3342('0x102')]['host'];_0x34e824['port']=_0x1f6d84[_0x3342('0x102')]['port'];_0x34e824[_0x3342('0x105')]=_0x1f6d84[_0x3342('0x102')][_0x3342('0x105')];}if(_0x1f6d84[_0x3342('0x102')][_0x3342('0x106')]){_0x34e824[_0x3342('0x107')]={'user':_0x1f6d84[_0x3342('0x102')][_0x3342('0x9f')],'pass':_0x1f6d84['Smtp'][_0x3342('0x108')]};}return respondWithRpcPromise(_0x3342('0x109'),'sendMail',{'account':_0x34e824,'message':{'from':util[_0x3342('0xf1')](_0x3342('0x10a'),_0x1f6d84[_0x3342('0x3a')],_0x1f6d84['email']||_0x1f6d84['Smtp'][_0x3342('0x9f')]),'to':_0x214ff3[_0x3342('0x3e')][_0x3342('0x10b')],'subject':'Mail\x20Transcript','text':util[_0x3342('0xf1')](_0x3342('0x10c'),_0x214ff3[_0x3342('0x3e')]['mailTranscript']),'attachments':[{'path':_0x59c56a}]}})[_0x3342('0x20')](function(){return _0x6ea059;})['catch'](function(_0x4ccbbe){console[_0x3342('0x26')](_0x4ccbbe);});}else{return _0x6ea059;}})[_0x3342('0x20')](respondWithStatusCode(_0x584c31,0xc8))[_0x3342('0x46')](handleError(_0x584c31,null));};exports[_0x3342('0x10d')]=function(_0x41e521,_0x1ab46b,_0x592f9b){return db[_0x3342('0x10e')][_0x3342('0x6f')]({'where':{'id':_0x41e521[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x1ab46b,null))[_0x3342('0x20')](function(_0x3bb70b){if(_0x3bb70b){return _0x3bb70b[_0x3342('0x10d')](_0x41e521[_0x3342('0x3e')][_0x3342('0x10f')],_[_0x3342('0x110')](_0x41e521[_0x3342('0x3e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ab46b,null))['catch'](handleError(_0x1ab46b,null));};exports[_0x3342('0x111')]=function(_0x2b46c5,_0x203409,_0x242c31){var _0x87fe8={'raw':![],'where':{}};var _0x3d594c={};var _0x4ea5cf={'count':0x0,'rows':[]};return db[_0x3342('0x49')]['findOne']({'where':{'id':_0x2b46c5[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x203409,null))[_0x3342('0x20')](function(_0x7b2e55){if(_0x7b2e55){_0x3d594c[_0x3342('0x4c')]=_[_0x3342('0x4e')](db[_0x3342('0x10e')][_0x3342('0xbf')]);_0x3d594c['query']=_[_0x3342('0x4e')](_0x2b46c5[_0x3342('0x4d')]);_0x3d594c[_0x3342('0x4f')]=_[_0x3342('0x50')](_0x3d594c['model'],_0x3d594c['query']);_0x87fe8[_0x3342('0x51')]=_['intersection'](_0x3d594c[_0x3342('0x4c')],qs[_0x3342('0xa6')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0xa6')]));_0x87fe8[_0x3342('0x51')]=_0x87fe8[_0x3342('0x51')][_0x3342('0x52')]?_0x87fe8[_0x3342('0x51')]:_0x3d594c['model'];if(!_0x2b46c5[_0x3342('0x4d')][_0x3342('0x53')](_0x3342('0x54'))){_0x87fe8['limit']=qs[_0x3342('0x2d')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0x2d')]);_0x87fe8[_0x3342('0x2b')]=qs[_0x3342('0x2b')](_0x2b46c5[_0x3342('0x4d')]['offset']);}_0x87fe8[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0x56')]);_0x87fe8['where']=qs['filters'](_[_0x3342('0x57')](_0x2b46c5[_0x3342('0x4d')],_0x3d594c[_0x3342('0x4f')]));_0x87fe8['where'][_0x3342('0xba')]=_0x7b2e55['id'];if(_0x2b46c5[_0x3342('0x4d')]['filter']){_0x87fe8[_0x3342('0x87')]=_[_0x3342('0x3d')](_0x87fe8[_0x3342('0x87')],{'$or':_[_0x3342('0x48')](_0x87fe8[_0x3342('0x51')],function(_0x1f9706){var _0x422e17={};_0x422e17[_0x1f9706]={'$like':'%'+_0x2b46c5[_0x3342('0x4d')][_0x3342('0x93')]+'%'};return _0x422e17;})});}if(_0x2b46c5['query'][_0x3342('0x8c')]){var _0x109c2c=_0x2b46c5[_0x3342('0x4d')][_0x3342('0x8c')][_0x3342('0x78')](',');var _0x891df3={};_0x891df3[_0x109c2c[0x0]]={'$gte':moment(_0x109c2c[0x1])[_0x3342('0xf1')](_0x3342('0x112'))};_0x87fe8[_0x3342('0x87')]=_[_0x3342('0x3d')](_0x87fe8[_0x3342('0x87')],_0x891df3);}_0x87fe8=_[_0x3342('0x3d')]({},_0x87fe8,_0x2b46c5[_0x3342('0x113')]);return db[_0x3342('0x10e')][_0x3342('0x2e')]({'where':_0x87fe8[_0x3342('0x87')]})[_0x3342('0x20')](function(_0x2dcc44){_0x4ea5cf[_0x3342('0x2e')]=_0x2dcc44;if(_0x2b46c5[_0x3342('0x4d')][_0x3342('0xc0')]){_0x87fe8['include']=[{'all':!![]}];}return db[_0x3342('0x10e')][_0x3342('0x114')](_0x87fe8);})[_0x3342('0x20')](function(_0x34b9bd){_0x4ea5cf['rows']=_0x34b9bd;return _0x4ea5cf;});}})[_0x3342('0x20')](respondWithFilteredResult(_0x203409,_0x87fe8))['catch'](handleError(_0x203409,null));};exports[_0x3342('0x115')]=function(_0x53e73b,_0x51f592,_0x8fc042){var _0x43bf9a={'where':{}},_0x12693e={},_0x564ecb={'count':0x0,'rows':[]};return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x53e73b[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x51f592,null))[_0x3342('0x20')](function(_0x7b2d65){if(_0x7b2d65){_0x12693e[_0x3342('0x4c')]=_['keys'](db[_0x3342('0x10e')]['rawAttributes']);_0x12693e[_0x3342('0x4d')]=_[_0x3342('0x4e')](_0x53e73b[_0x3342('0x4d')]);_0x12693e['filters']=_[_0x3342('0x50')](_0x12693e[_0x3342('0x4c')],_0x12693e[_0x3342('0x4d')]);_0x43bf9a[_0x3342('0x51')]=_[_0x3342('0x50')](_0x12693e[_0x3342('0x4c')],qs[_0x3342('0xa6')](_0x53e73b['query'][_0x3342('0xa6')]));_0x43bf9a[_0x3342('0x51')]=_0x43bf9a[_0x3342('0x51')][_0x3342('0x52')]?_0x43bf9a[_0x3342('0x51')]:_0x12693e[_0x3342('0x4c')];if(!_0x53e73b['query'][_0x3342('0x53')](_0x3342('0x54'))){_0x43bf9a['limit']=qs['limit'](_0x53e73b[_0x3342('0x4d')][_0x3342('0x2d')]);_0x43bf9a[_0x3342('0x2b')]=qs['offset'](_0x53e73b[_0x3342('0x4d')][_0x3342('0x2b')]);}_0x43bf9a[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x53e73b['query'][_0x3342('0x56')]);_0x43bf9a['where']=qs['filters'](_[_0x3342('0x57')](_0x53e73b[_0x3342('0x4d')],_0x12693e['filters']));_0x43bf9a[_0x3342('0x87')][_0x3342('0xba')]=_0x7b2d65['id'];if(_0x53e73b[_0x3342('0x4d')][_0x3342('0x93')]){_0x43bf9a['where']=_[_0x3342('0x3d')](_0x43bf9a[_0x3342('0x87')],{'$or':_[_0x3342('0x48')](_0x43bf9a[_0x3342('0x51')],function(_0x1af0ab){var _0x2c36b6={};_0x2c36b6[_0x1af0ab]={'$like':'%'+_0x53e73b[_0x3342('0x4d')][_0x3342('0x93')]+'%'};return _0x2c36b6;})});}_0x43bf9a['where']['secret']=![];if(_0x53e73b[_0x3342('0x4d')]['id']){_0x43bf9a[_0x3342('0x87')]['id']={'$gt':_0x53e73b[_0x3342('0x4d')]['id']};}_0x43bf9a=_[_0x3342('0x3d')]({},_0x43bf9a,_0x53e73b['options']);return db['ChatMessage'][_0x3342('0x2e')]({'where':_0x43bf9a['where']})[_0x3342('0x20')](function(_0x408c0b){_0x564ecb[_0x3342('0x2e')]=_0x408c0b;_0x43bf9a[_0x3342('0xc1')]=[];if(_0x53e73b[_0x3342('0x4d')]['includeAgent']){_0x43bf9a[_0x3342('0xc1')][_0x3342('0x45')]({'model':db[_0x3342('0x81')],'as':_0x3342('0x81'),'attributes':['id',_0x3342('0x42'),_0x3342('0x116')]});}if(_0x53e73b[_0x3342('0x4d')][_0x3342('0xc0')]){_0x43bf9a[_0x3342('0xc1')]=[{'all':!![]}];}return db[_0x3342('0x10e')]['findAll'](_0x43bf9a);})[_0x3342('0x20')](function(_0x4ee731){_0x564ecb[_0x3342('0xbc')]=_0x4ee731;return _0x564ecb;});}})[_0x3342('0x20')](respondWithFilteredResult(_0x51f592,_0x43bf9a))[_0x3342('0x46')](handleError(_0x51f592,null));};exports[_0x3342('0x117')]=function(_0x13846a,_0x35ef7e,_0x65063d){return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x13846a[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x35ef7e,null))[_0x3342('0x20')](function(_0xb7cc7){if(_0xb7cc7){return _0xb7cc7[_0x3342('0x118')](_0x13846a[_0x3342('0x3e')]['ids'],_[_0x3342('0x110')](_0x13846a[_0x3342('0x3e')],['ids','id'])||{})[_0x3342('0x119')](function(){return db[_0x3342('0x7f')][_0x3342('0x114')]({'attributes':['id',_0x3342('0x3a'),_0x3342('0x59')],'where':{'id':_0x13846a[_0x3342('0x3e')][_0x3342('0x10f')]}});})[_0x3342('0x20')](function(_0x178c5d){socket[_0x3342('0x11a')](_0x3342('0x11b'),{'id':Number(_0x13846a[_0x3342('0xbe')]['id']),'tags':_0x178c5d||[]});return{'id':Number(_0x13846a[_0x3342('0xbe')]['id']),'tags':_0x178c5d||[]};});}})['then'](respondWithResult(_0x35ef7e,null))[_0x3342('0x46')](handleError(_0x35ef7e,null));};exports[_0x3342('0x11c')]=function(_0x667da3,_0x4a26c4,_0x3d4b1d){return db['ChatInteraction']['find']({'where':{'id':_0x667da3[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x4a26c4,null))[_0x3342('0x20')](function(_0x91b50b){if(_0x91b50b){return _0x91b50b[_0x3342('0x11c')](_0x667da3['query']['ids']);}})[_0x3342('0x20')](respondWithStatusCode(_0x4a26c4,null))[_0x3342('0x46')](handleError(_0x4a26c4,null));};exports[_0x3342('0xee')]=function(_0x4d7c61,_0x13d5ae){var _0x18e629=moment()['unix']()[_0x3342('0xa5')]();var _0x11f4c7=path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'files','tmp');var _0x20f322=path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'files',_0x3342('0x11e'));var _0xd16f=path[_0x3342('0xed')](_0x11f4c7,_0x18e629);var _0x5b2c37=util[_0x3342('0xf1')](_0x3342('0x11f'),_0x4d7c61[_0x3342('0xbe')]['id'],_0x18e629);var _0x212ec9=path[_0x3342('0xed')](_0x11f4c7,_0x5b2c37);var _0x143b82=[];_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0x81')],'as':_0x3342('0x81'),'attributes':['id',_0x3342('0x42')],'raw':!![]});_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0xda')],'as':_0x3342('0x75'),'attributes':['id',_0x3342('0x120'),'lastName'],'raw':!![]});if(_0x4d7c61[_0x3342('0x4d')][_0x3342('0x11e')]){_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0xe6')],'as':_0x3342('0xe6'),'raw':!![]});}var _0x49b963=[{'model':db[_0x3342('0x10e')],'as':_0x3342('0xf4'),'attributes':['id',_0x3342('0x3e'),'createdAt',_0x3342('0xff'),_0x3342('0x121'),_0x3342('0x122')],'include':_0x143b82}];_0x49b963[_0x3342('0x45')]({'model':db[_0x3342('0xc6')],'as':_0x3342('0x123'),'attributes':['id',_0x3342('0x3a')]});_0x49b963['push']({'model':db['User'],'as':_0x3342('0x124'),'attributes':['id','fullname']});return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x4d7c61['params']['id']},'include':_0x49b963})['then'](handleEntityNotFound(_0x13d5ae,null))[_0x3342('0x20')](function(_0x44bc75){if(_0x44bc75){var _0x3c85d2=_0x44bc75[_0x3342('0x125')]({'plain':!![]});fs[_0x3342('0x126')](_0xd16f);var _0x1597da={'channel':_0x3342('0x127'),'account':_0x3c85d2[_0x3342('0x123')][_0x3342('0x3a')],'agent':_0x3c85d2[_0x3342('0x124')]?_0x3c85d2[_0x3342('0x124')]['fullname']:'N.A.','createdAt':moment(_0x3c85d2[_0x3342('0x8a')])[_0x3342('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3342('0xa5')](),'closedAt':_0x3c85d2['closed']?moment(_0x3c85d2[_0x3342('0x128')])[_0x3342('0xf1')](_0x3342('0x112'))[_0x3342('0xa5')]():'','disposition':_0x3c85d2[_0x3342('0xdf')],'chatInfo':{'browser':_0x3c85d2['browserName'],'os':_0x3c85d2[_0x3342('0x129')],'referer':_0x3c85d2['referer'],'customerIp':_0x3c85d2[_0x3342('0x12a')],'customerPort':_0x3c85d2['customerPort']?_0x3c85d2[_0x3342('0x12b')]:'N.A.'},'messages':_(_0x3c85d2[_0x3342('0xf4')])['tail']()[_0x3342('0x93')]({'secret':![]})[_0x3342('0x48')](function(_0xf3c1bb){if(_0xf3c1bb[_0x3342('0xe6')]){var _0x437bb7=path[_0x3342('0xed')](_0x20f322,_0xf3c1bb[_0x3342('0xe6')]['basename']);if(fs[_0x3342('0x12c')](_0x437bb7)){fs['createReadStream'](_0x437bb7)[_0x3342('0x12d')](fs['createWriteStream'](path[_0x3342('0xed')](_0xd16f,_0xf3c1bb['Attachment'][_0x3342('0xe4')])));}}return{'date':moment(_0xf3c1bb[_0x3342('0x8a')])['format'](_0x3342('0x112'))[_0x3342('0xa5')](),'sender':_0xf3c1bb['direction']===_0x3342('0x12e')?_0xf3c1bb[_0x3342('0x81')]?_0xf3c1bb[_0x3342('0x81')][_0x3342('0x42')]:'System':_0xf3c1bb[_0x3342('0x75')][_0x3342('0x120')]+(_0xf3c1bb['Contact'][_0x3342('0x12f')]?'\x20'+_0xf3c1bb[_0x3342('0x75')][_0x3342('0x12f')]:''),'body':_0xf3c1bb['Attachment']?_0xf3c1bb['Attachment'][_0x3342('0xe4')]:_0xf3c1bb[_0x3342('0x3e')],'direction':_0xf3c1bb['direction']===_0x3342('0x12e')?'A':'C','secret':_0xf3c1bb['secret'],'read':_0xf3c1bb[_0x3342('0x122')],'attachment':_0xf3c1bb[_0x3342('0xe6')]};})['value']()};return ejs[_0x3342('0x130')](path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'views',_0x3342('0x131')),{'interaction':_0x1597da})[_0x3342('0x20')](function(_0x267752){var _0x47bdd3=path[_0x3342('0xed')](_0xd16f,_0x3342('0x132')+_0x3c85d2['id']+'-'+_0x18e629+_0x3342('0x133'));var _0x5b9ac8={'path':_0x47bdd3,'channel':'Chat','interactionId':_0x3c85d2['id']};return pdf[_0x3342('0x134')](_0x267752,_0x5b9ac8);})[_0x3342('0x20')](function(){return new BPromise(function(_0x567761,_0x17cb20){zipdir(_0xd16f,{'saveTo':_0x212ec9},function(_0x5fbd3c,_0x33a274){if(_0x5fbd3c)return _0x17cb20(_0x5fbd3c);return _0x567761(_0x33a274);});})[_0x3342('0x20')](function(){return new BPromise(function(_0x90ef48,_0x76b760){rimraf(_0xd16f,function(_0x1ec7ff){if(_0x1ec7ff)_0x76b760(_0x1ec7ff);return _0x90ef48();});});})[_0x3342('0x20')](function(){return _0x13d5ae[_0x3342('0xee')](_0x212ec9,_0x5b2c37,function(_0x4f3f28){if(_0x4f3f28){console[_0x3342('0x135')](_0x3342('0x136'),_0x4f3f28);}else{fs[_0x3342('0x137')](_0x212ec9);}});});});}else{return _0x13d5ae[_0x3342('0x38')](0xc8);}})[_0x3342('0x46')](handleError(_0x13d5ae,null));}; \ No newline at end of file +var _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x391ae4,_0x477af5){var _0x189442=function(_0x108e89){while(--_0x108e89){_0x391ae4['push'](_0x391ae4['shift']());}};_0x189442(++_0x477af5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x10b5d7,_0x49d478){_0x10b5d7=_0x10b5d7-0x0;var _0x3338c6=_0xdd4f[_0x10b5d7];return _0x3338c6;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ad48d02..619f80f 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 _0x5a13=['remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x5c08b2,_0x32d23a){var _0x5260d4=function(_0x18f2bc){while(--_0x18f2bc){_0x5c08b2['push'](_0x5c08b2['shift']());}};_0x5260d4(++_0x32d23a);}(_0x5a13,0x7f));var _0x35a1=function(_0x3e943a,_0xbeb4e0){_0x3e943a=_0x3e943a-0x0;var _0x2ffbb9=_0x5a13[_0x3e943a];return _0x2ffbb9;};'use strict';var EventEmitter=require(_0x35a1('0x0'));var ChatInteraction=require(_0x35a1('0x1'))['db'][_0x35a1('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x35a1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x35a1('0x4')](0x0);var events={'afterCreate':_0x35a1('0x5'),'afterUpdate':'update','afterDestroy':_0x35a1('0x6')};function emitEvent(_0x2c0a91){return function(_0x26049c,_0x54aec3,_0x55dd71){_0x26049c[_0x35a1('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6b86f5){_0x26049c[_0x35a1('0x8')](_0x35a1('0x9'),_0x6b86f5[_0x35a1('0xa')](function(_0x33d308){return{'id':_0x33d308['id']};}));return ChatMessage[_0x35a1('0xb')]({'where':{'ChatInteractionId':_0x26049c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x35a1('0xc')](function(_0x328eff){_0x26049c[_0x35a1('0x8')](_0x35a1('0xd'),_0x328eff[_0x35a1('0xe')]);ChatInteractionEvents[_0x35a1('0xf')](_0x2c0a91+':'+_0x26049c['id'],_0x26049c);ChatInteractionEvents[_0x35a1('0xf')](_0x2c0a91,_0x26049c);_0x55dd71(null);})[_0x35a1('0x10')](_0x55dd71(null));};}for(var e in events){if(events[_0x35a1('0x11')](e)){var event=events[e];ChatInteraction[_0x35a1('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xf1ee=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','unreadMessages'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf1ee,0xa8));var _0xef1e=function(_0x433df9,_0x5808c7){_0x433df9=_0x433df9-0x0;var _0x2574cf=_0xf1ee[_0x433df9];return _0x2574cf;};'use strict';var EventEmitter=require(_0xef1e('0x0'));var ChatInteraction=require(_0xef1e('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xef1e('0x1'))['db'][_0xef1e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xef1e('0x3')](0x0);var events={'afterCreate':_0xef1e('0x4'),'afterUpdate':_0xef1e('0x5'),'afterDestroy':_0xef1e('0x6')};function emitEvent(_0x28fe93){return function(_0x10b998,_0x5a2787,_0x1ca7db){_0x10b998[_0xef1e('0x7')]({'attributes':['id'],'raw':!![]})[_0xef1e('0x8')](function(_0x541401){_0x10b998['setDataValue'](_0xef1e('0x9'),_0x541401['map'](function(_0x19c6c8){return{'id':_0x19c6c8['id']};}));return ChatMessage[_0xef1e('0xa')]({'where':{'ChatInteractionId':_0x10b998['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a25c7){_0x10b998['setDataValue'](_0xef1e('0xb'),_0x2a25c7[_0xef1e('0xc')]);ChatInteractionEvents['emit'](_0x28fe93+':'+_0x10b998['id'],_0x10b998);ChatInteractionEvents[_0xef1e('0xd')](_0x28fe93,_0x10b998);_0x1ca7db(null);})[_0xef1e('0xe')](_0x1ca7db(null));};}for(var e in events){if(events[_0xef1e('0xf')](e)){var event=events[e];ChatInteraction[_0xef1e('0x10')](e,emitEvent(event));}}module[_0xef1e('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 1bd46f2..c7506fc 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 _0x6221=['chat_interactions','changed','closed','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0x6221,0xaf));var _0x1622=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x6221[_0x586fa2];return _0x515be9;};'use strict';var _=require(_0x1622('0x0'));var util=require(_0x1622('0x1'));var logger=require(_0x1622('0x2'))(_0x1622('0x3'));var moment=require(_0x1622('0x4'));var BPromise=require(_0x1622('0x5'));var rp=require(_0x1622('0x6'));var fs=require('fs');var path=require(_0x1622('0x7'));var rimraf=require('rimraf');var config=require(_0x1622('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x1622('0x9')]=function(_0x54c0c4,_0x503ba3){return _0x54c0c4[_0x1622('0xa')](_0x1622('0xb'),attributes,{'tableName':_0x1622('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ccf26,_0x1930d9,_0x32591d){if(_0x5ccf26[_0x1622('0xd')](_0x1622('0xe'))){_0x5ccf26['closedAt']=moment()[_0x1622('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32591d(null,_0x5ccf26);}},'charset':_0x1622('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbe1c=['../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','format','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbe1c,0xec));var _0xcbe1=function(_0x204836,_0x34d172){_0x204836=_0x204836-0x0;var _0x335884=_0xbe1c[_0x204836];return _0x335884;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcbe1('0x0'))(_0xcbe1('0x1'));var moment=require('moment');var BPromise=require(_0xcbe1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbe1('0x3'));var rimraf=require('rimraf');var config=require(_0xcbe1('0x4'));var attributes=require(_0xcbe1('0x5'));module[_0xcbe1('0x6')]=function(_0x164677,_0x259967){return _0x164677[_0xcbe1('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1197b2,_0x21e5c0,_0x3f6c1a){if(_0x1197b2[_0xcbe1('0x8')](_0xcbe1('0x9'))){_0x1197b2['closedAt']=moment()[_0xcbe1('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f6c1a(null,_0x1197b2);}},'charset':'utf8mb4','collate':_0xcbe1('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 4a9b8b1..693c29e 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 _0xc447=['UpdateChatInteraction','ChatInteraction','update','body','raw','options','where','limit','then','stringify','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xeaa619,_0x459ac0){var _0x3e4fb6=function(_0x2239c6){while(--_0x2239c6){_0xeaa619['push'](_0xeaa619['shift']());}};_0x3e4fb6(++_0x459ac0);}(_0xc447,0x118));var _0x7c44=function(_0xabf325,_0x34766b){_0xabf325=_0xabf325-0x0;var _0x4205f5=_0xc447[_0xabf325];return _0x4205f5;};'use strict';var _=require(_0x7c44('0x0'));var util=require(_0x7c44('0x1'));var moment=require(_0x7c44('0x2'));var BPromise=require(_0x7c44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c44('0x4'));var db=require(_0x7c44('0x5'))['db'];var utils=require(_0x7c44('0x6'));var logger=require(_0x7c44('0x7'))(_0x7c44('0x8'));var config=require(_0x7c44('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7c44('0xa')][_0x7c44('0xb')]({'port':0x232a});config[_0x7c44('0xc')]=_['defaults'](config[_0x7c44('0xc')],{'host':_0x7c44('0xd'),'port':0x18eb});var socket=require(_0x7c44('0xe'))(new Redis(config['redis']));require(_0x7c44('0xf'))[_0x7c44('0x10')](socket);function respondWithRpcPromise(_0x52c9f5,_0x4dd003,_0x34504e){return new BPromise(function(_0x241674,_0x571465){return client[_0x7c44('0x11')](_0x52c9f5,_0x34504e)['then'](function(_0x1c28b6){logger[_0x7c44('0x12')](_0x7c44('0x13'),_0x4dd003,_0x7c44('0x14'));logger[_0x7c44('0x15')](_0x7c44('0x16'),_0x4dd003,'request\x20sent',JSON['stringify'](_0x1c28b6));if(_0x1c28b6[_0x7c44('0x17')]){if(_0x1c28b6[_0x7c44('0x17')][_0x7c44('0x18')]===0x1f4){logger[_0x7c44('0x17')](_0x7c44('0x13'),_0x4dd003,_0x1c28b6['error']['message']);return _0x571465(_0x1c28b6[_0x7c44('0x17')][_0x7c44('0x19')]);}logger[_0x7c44('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4dd003,_0x1c28b6[_0x7c44('0x17')][_0x7c44('0x19')]);return _0x241674(_0x1c28b6[_0x7c44('0x17')][_0x7c44('0x19')]);}else{logger[_0x7c44('0x12')](_0x7c44('0x13'),_0x4dd003,_0x7c44('0x14'));_0x241674(_0x1c28b6[_0x7c44('0x1a')][_0x7c44('0x19')]);}})[_0x7c44('0x1b')](function(_0x21848e){logger[_0x7c44('0x17')](_0x7c44('0x13'),_0x4dd003,_0x21848e);_0x571465(_0x21848e);});});}exports[_0x7c44('0x1c')]=function(_0x3b572e){var _0x2f7cf2=this;return new Promise(function(_0x503fd9,_0x120723){return db[_0x7c44('0x1d')][_0x7c44('0x1e')](_0x3b572e[_0x7c44('0x1f')],{'raw':_0x3b572e['options']?_0x3b572e['options'][_0x7c44('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b572e[_0x7c44('0x21')]?_0x3b572e[_0x7c44('0x21')][_0x7c44('0x22')]||null:null,'attributes':_0x3b572e['options']?_0x3b572e[_0x7c44('0x21')]['attributes']||null:null,'limit':_0x3b572e[_0x7c44('0x21')]?_0x3b572e[_0x7c44('0x21')][_0x7c44('0x23')]||null:null})[_0x7c44('0x24')](function(_0x101877){logger[_0x7c44('0x12')](_0x7c44('0x1c'),_0x3b572e);logger[_0x7c44('0x15')](_0x7c44('0x1c'),_0x3b572e,JSON[_0x7c44('0x25')](_0x101877));_0x503fd9(_0x101877);})[_0x7c44('0x1b')](function(_0x1ee488){logger[_0x7c44('0x17')](_0x7c44('0x1c'),_0x1ee488[_0x7c44('0x19')],_0x3b572e);_0x120723(_0x2f7cf2[_0x7c44('0x17')](0x1f4,_0x1ee488[_0x7c44('0x19')]));});});};exports[_0x7c44('0x26')]=function(_0x3bdfe9){return new Promise(function(_0x4a65e6,_0x438e8c){return db[_0x7c44('0x1d')][_0x7c44('0x27')]({'where':_0x3bdfe9[_0x7c44('0x21')]?_0x3bdfe9['options'][_0x7c44('0x22')]||null:null})[_0x7c44('0x24')](function(_0x464f91){if(_0x464f91){return _0x464f91['addTags'](_0x3bdfe9[_0x7c44('0x1f')][_0x7c44('0x28')],_[_0x7c44('0x29')](_0x3bdfe9['body'],[_0x7c44('0x28'),'id'])||{});}})[_0x7c44('0x2a')](function(_0x1a9fb7){logger['info'](_0x7c44('0x2b'),_0x3bdfe9);logger['debug'](_0x7c44('0x2b'),_0x3bdfe9,JSON[_0x7c44('0x25')](_0x1a9fb7));_0x4a65e6(_0x1a9fb7);})['catch'](function(_0x2f3cc7){logger[_0x7c44('0x17')]('AddTags',_0x2f3cc7[_0x7c44('0x19')],_0x3bdfe9);_0x438e8c(_this['error'](0x1f4,_0x2f3cc7[_0x7c44('0x19')]));});});}; \ No newline at end of file +var _0x6254=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ChatInteraction','update','options','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6254,0x128));var _0x4625=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x6254[_0x5ad07c];return _0x204bae;};'use strict';var _=require(_0x4625('0x0'));var util=require(_0x4625('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4625('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4625('0x3'))(_0x4625('0x4'));var config=require(_0x4625('0x5'));var jayson=require(_0x4625('0x6'));var client=jayson[_0x4625('0x7')][_0x4625('0x8')]({'port':0x232a});config[_0x4625('0x9')]=_[_0x4625('0xa')](config[_0x4625('0x9')],{'host':_0x4625('0xb'),'port':0x18eb});var socket=require(_0x4625('0xc'))(new Redis(config[_0x4625('0x9')]));require(_0x4625('0xd'))[_0x4625('0xe')](socket);function respondWithRpcPromise(_0x5287cb,_0x2a5a61,_0x3bdb96){return new BPromise(function(_0x3a4e3f,_0x14db75){return client['request'](_0x5287cb,_0x3bdb96)[_0x4625('0xf')](function(_0x530660){logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));logger[_0x4625('0x13')](_0x4625('0x14'),_0x2a5a61,_0x4625('0x12'),JSON[_0x4625('0x15')](_0x530660));if(_0x530660[_0x4625('0x16')]){if(_0x530660['error']['code']===0x1f4){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x14db75(_0x530660['error'][_0x4625('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x3a4e3f(_0x530660[_0x4625('0x16')]['message']);}else{logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));_0x3a4e3f(_0x530660[_0x4625('0x18')][_0x4625('0x17')]);}})['catch'](function(_0x3415b6){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x3415b6);_0x14db75(_0x3415b6);});});}exports['UpdateChatInteraction']=function(_0x104e2a){var _0x5a5d2f=this;return new Promise(function(_0xa632d5,_0x1c73c2){return db[_0x4625('0x19')][_0x4625('0x1a')](_0x104e2a['body'],{'raw':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['where']||null:null,'attributes':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1c')]||null:null,'limit':_0x104e2a[_0x4625('0x1b')]?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1d')]||null:null})[_0x4625('0xf')](function(_0x401049){logger['info']('UpdateChatInteraction',_0x104e2a);logger['debug'](_0x4625('0x1e'),_0x104e2a,JSON['stringify'](_0x401049));_0xa632d5(_0x401049);})[_0x4625('0x1f')](function(_0x5a3927){logger['error'](_0x4625('0x1e'),_0x5a3927[_0x4625('0x17')],_0x104e2a);_0x1c73c2(_0x5a5d2f[_0x4625('0x16')](0x1f4,_0x5a3927[_0x4625('0x17')]));});});};exports[_0x4625('0x20')]=function(_0x37f0a7){return new Promise(function(_0x2c9d25,_0x15c56b){return db[_0x4625('0x19')][_0x4625('0x21')]({'where':_0x37f0a7[_0x4625('0x1b')]?_0x37f0a7[_0x4625('0x1b')]['where']||null:null})['then'](function(_0x4d78a8){if(_0x4d78a8){return _0x4d78a8['addTags'](_0x37f0a7[_0x4625('0x22')][_0x4625('0x23')],_[_0x4625('0x24')](_0x37f0a7['body'],[_0x4625('0x23'),'id'])||{});}})[_0x4625('0x25')](function(_0x27e8fb){logger['info'](_0x4625('0x26'),_0x37f0a7);logger[_0x4625('0x13')](_0x4625('0x26'),_0x37f0a7,JSON[_0x4625('0x15')](_0x27e8fb));_0x2c9d25(_0x27e8fb);})['catch'](function(_0x3a7173){logger['error'](_0x4625('0x26'),_0x3a7173[_0x4625('0x17')],_0x37f0a7);_0x15c56b(_this[_0x4625('0x16')](0x1f4,_0x3a7173['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 5a8699c..08f41bb 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 _0x8c29=['removeListener','length','./chatInteraction.events','save','remove','update','emit'];(function(_0x431ed2,_0x358b24){var _0x3d050d=function(_0x15585e){while(--_0x15585e){_0x431ed2['push'](_0x431ed2['shift']());}};_0x3d050d(++_0x358b24);}(_0x8c29,0x8e));var _0x98c2=function(_0x2c5cb,_0xaa8970){_0x2c5cb=_0x2c5cb-0x0;var _0x24cf1a=_0x8c29[_0x2c5cb];return _0x24cf1a;};'use strict';var ChatInteractionEvents=require(_0x98c2('0x0'));var events=[_0x98c2('0x1'),_0x98c2('0x2'),_0x98c2('0x3')];function createListener(_0x5ea7a9,_0x22dc65){return function(_0x356e7e){_0x22dc65[_0x98c2('0x4')](_0x5ea7a9,_0x356e7e);};}function removeListener(_0x51d570,_0xbde255){return function(){ChatInteractionEvents[_0x98c2('0x5')](_0x51d570,_0xbde255);};}exports['register']=function(_0xf1b18f){for(var _0x19536c=0x0,_0x30ec8c=events[_0x98c2('0x6')];_0x19536c<_0x30ec8c;_0x19536c++){var _0x1b49ea=events[_0x19536c];var _0x2f2de5=createListener('chatInteraction:'+_0x1b49ea,_0xf1b18f);ChatInteractionEvents['on'](_0x1b49ea,_0x2f2de5);}}; \ No newline at end of file +var _0x5243=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x39f9f2,_0x1d6714){var _0xff574e=function(_0x28728d){while(--_0x28728d){_0x39f9f2['push'](_0x39f9f2['shift']());}};_0xff574e(++_0x1d6714);}(_0x5243,0x71));var _0x3524=function(_0x3a9b20,_0x2e5be1){_0x3a9b20=_0x3a9b20-0x0;var _0x525273=_0x5243[_0x3a9b20];return _0x525273;};'use strict';var ChatInteractionEvents=require(_0x3524('0x0'));var events=['save','remove',_0x3524('0x1')];function createListener(_0x14d26d,_0x496f0f){return function(_0x5449cf){_0x496f0f[_0x3524('0x2')](_0x14d26d,_0x5449cf);};}function removeListener(_0x34bba7,_0x4855ea){return function(){ChatInteractionEvents[_0x3524('0x3')](_0x34bba7,_0x4855ea);};}exports['register']=function(_0x2d8995){for(var _0x564239=0x0,_0x375729=events[_0x3524('0x4')];_0x564239<_0x375729;_0x564239++){var _0x1e9bf9=events[_0x564239];var _0x371171=createListener(_0x3524('0x5')+_0x1e9bf9,_0x2d8995);ChatInteractionEvents['on'](_0x1e9bf9,_0x371171);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f01b3d6..467feef 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 _0xbb4b=['/:id/download','create','post','/:id/vidaoo','diskStorage','root','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','/:id','chatinteraction:update','put','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','Router','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','isAuthenticated','/:id/my_messages'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xbb4b,0xd8));var _0xbbb4=function(_0x438da3,_0x4eb078){_0x438da3=_0x438da3-0x0;var _0x20f8b7=_0xbb4b[_0x438da3];return _0x20f8b7;};'use strict';var multer=require(_0xbbb4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbbb4('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbbb4('0x2'));var config=require('../../config/environment');var controller=require(_0xbbb4('0x3'));router[_0xbbb4('0x4')]('/',auth['isAuthenticated'](),controller[_0xbbb4('0x5')]);router[_0xbbb4('0x4')](_0xbbb4('0x6'),auth['isAuthenticated'](),controller[_0xbbb4('0x7')]);router[_0xbbb4('0x4')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xbbb4('0x8')]);router[_0xbbb4('0x4')](_0xbbb4('0x9'),auth[_0xbbb4('0xa')](),controller['attachmentDownload']);router[_0xbbb4('0x4')](_0xbbb4('0xb'),auth[_0xbbb4('0xc')](),controller['getMessages']);router[_0xbbb4('0x4')](_0xbbb4('0xd'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xbbb4('0x4')](_0xbbb4('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xbbb4('0xc')](),controller[_0xbbb4('0xf')]);router[_0xbbb4('0x10')](_0xbbb4('0x11'),auth[_0xbbb4('0xc')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xbbb4('0x12')]({'destination':function(_0x51dff9,_0x10d089,_0x38a589){_0x38a589(null,path['join'](config[_0xbbb4('0x13')],'server/files/attachments/'));},'filename':function(_0x7aa4f3,_0x693aa7,_0x186efc){_0x186efc(null,util['format'](_0xbbb4('0x14'),Date[_0xbbb4('0x15')](),_0x693aa7[_0xbbb4('0x16')][_0xbbb4('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbbb4('0x10')](_0xbbb4('0x18'),upload[_0xbbb4('0x19')]('file'),controller[_0xbbb4('0x1a')]);router[_0xbbb4('0x10')](_0xbbb4('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xbbb4('0x1b')]);router[_0xbbb4('0x10')](_0xbbb4('0x1c'),auth[_0xbbb4('0xc')](),interaction[_0xbbb4('0x1d')](_0xbbb4('0x1e'),_0xbbb4('0x1f')),controller[_0xbbb4('0x20')]);router['put'](_0xbbb4('0x21'),auth[_0xbbb4('0xc')](),interaction['tracked']('chat',_0xbbb4('0x22')),controller['update']);router[_0xbbb4('0x23')](_0xbbb4('0x24'),controller[_0xbbb4('0x25')]);router[_0xbbb4('0x23')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xbbb4('0x26')]);router['put'](_0xbbb4('0x27'),controller[_0xbbb4('0x28')]);router[_0xbbb4('0x29')](_0xbbb4('0x21'),auth[_0xbbb4('0xc')](),interaction[_0xbbb4('0x1d')](_0xbbb4('0x1e'),_0xbbb4('0x2a')),controller[_0xbbb4('0x2b')]);router[_0xbbb4('0x29')](_0xbbb4('0x1c'),auth['isAuthenticated'](),controller[_0xbbb4('0x2c')]);module[_0xbbb4('0x2d')]=router; \ No newline at end of file +var _0x6494=['/:id/custom_update','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update'];(function(_0x17c5d8,_0x294ae5){var _0x3613ee=function(_0x45d8a8){while(--_0x45d8a8){_0x17c5d8['push'](_0x17c5d8['shift']());}};_0x3613ee(++_0x294ae5);}(_0x6494,0xa8));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4649('0x0'));var util=require(_0x4649('0x1'));var path=require(_0x4649('0x2'));var timeout=require(_0x4649('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4649('0x4'));var auth=require(_0x4649('0x5'));var interaction=require(_0x4649('0x6'));var config=require(_0x4649('0x7'));var controller=require(_0x4649('0x8'));router[_0x4649('0x9')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0xb')]);router[_0x4649('0x9')](_0x4649('0xc'),auth['isAuthenticated'](),controller[_0x4649('0xd')]);router['get']('/:id',auth[_0x4649('0xe')](),controller[_0x4649('0xf')]);router['get'](_0x4649('0x10'),auth[_0x4649('0xe')](),controller['attachmentDownload']);router[_0x4649('0x9')](_0x4649('0x11'),auth[_0x4649('0xa')](),controller[_0x4649('0x12')]);router[_0x4649('0x9')]('/:id/my_messages',auth[_0x4649('0xe')](),controller[_0x4649('0x13')]);router[_0x4649('0x9')]('/:id/download',auth[_0x4649('0xa')](),controller['download']);router[_0x4649('0x14')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0x15')]);router[_0x4649('0x14')]('/:id/vidaoo',auth[_0x4649('0xa')](),controller[_0x4649('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe3b3fa,_0x17fe4f,_0x7c1ca4){_0x7c1ca4(null,path['join'](config[_0x4649('0x17')],_0x4649('0x18')));},'filename':function(_0x29bbcd,_0x577134,_0x1d768e){_0x1d768e(null,util[_0x4649('0x19')](_0x4649('0x1a'),Date[_0x4649('0x1b')](),_0x577134[_0x4649('0x1c')][_0x4649('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4649('0x14')](_0x4649('0x1e'),upload[_0x4649('0x1f')](_0x4649('0x20')),controller[_0x4649('0x21')]);router[_0x4649('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x4649('0x22')]);router[_0x4649('0x14')](_0x4649('0x23'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x26')),controller[_0x4649('0x27')]);router[_0x4649('0x28')](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x2a')),controller[_0x4649('0x2b')]);router['put'](_0x4649('0x2c'),controller['customUpdate']);router[_0x4649('0x28')](_0x4649('0x2d'),auth[_0x4649('0xe')](),controller[_0x4649('0x2e')]);router['put'](_0x4649('0x2f'),controller[_0x4649('0x30')]);router['delete'](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction['tracked']('chat',_0x4649('0x31')),controller['destroy']);router[_0x4649('0x32')](_0x4649('0x23'),auth[_0x4649('0xa')](),controller[_0x4649('0x33')]);module[_0x4649('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 9f50eaf..d189dce 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 _0x60c2=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0xf6f007,_0x5bf2a6){var _0x189c32=function(_0xf40933){while(--_0xf40933){_0xf6f007['push'](_0xf6f007['shift']());}};_0x189c32(++_0x5bf2a6);}(_0x60c2,0x18c));var _0x260c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x60c2[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x260c('0x0'));module['exports']={'body':{'type':Sequelize[_0x260c('0x1')](_0x260c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x260c('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x260c('0x4')]}}; \ No newline at end of file +var _0x8fc2=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x4a1cc1,_0x169f19){var _0x583943=function(_0x363585){while(--_0x363585){_0x4a1cc1['push'](_0x4a1cc1['shift']());}};_0x583943(++_0x169f19);}(_0x8fc2,0xf6));var _0x28fc=function(_0xd29631,_0x4d7de9){_0xd29631=_0xd29631-0x0;var _0x223b4f=_0x8fc2[_0xd29631];return _0x223b4f;};'use strict';var Sequelize=require(_0x28fc('0x0'));module[_0x28fc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x28fc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x28fc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x28fc('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 78e8adb..45e9041 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 _0xbeb8=['query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','fields','include','find','create','body','update','destroy','describe','messages','lastMessageAt','format','lastMessage','User','agent','admin','user','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','error','stack','name','ChatInternalMessage','rawAttributes','type','key','model','map'];(function(_0x284d7b,_0x39b6a0){var _0x14500e=function(_0x4cd792){while(--_0x4cd792){_0x284d7b['push'](_0x284d7b['shift']());}};_0x14500e(++_0x39b6a0);}(_0xbeb8,0x17d));var _0x8beb=function(_0x8cec3a,_0x3faee1){_0x8cec3a=_0x8cec3a-0x0;var _0x4f31fe=_0xbeb8[_0x8cec3a];return _0x4f31fe;};'use strict';var emlformat=require(_0x8beb('0x0'));var rimraf=require(_0x8beb('0x1'));var zipdir=require(_0x8beb('0x2'));var jsonpatch=require(_0x8beb('0x3'));var rp=require(_0x8beb('0x4'));var moment=require(_0x8beb('0x5'));var BPromise=require(_0x8beb('0x6'));var Mustache=require(_0x8beb('0x7'));var util=require(_0x8beb('0x8'));var path=require(_0x8beb('0x9'));var sox=require(_0x8beb('0xa'));var csv=require(_0x8beb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8beb('0xc'));var _=require(_0x8beb('0xd'));var squel=require('squel');var crypto=require(_0x8beb('0xe'));var jsforce=require(_0x8beb('0xf'));var deskjs=require(_0x8beb('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8beb('0x11'));var Redis=require(_0x8beb('0x12'));var authService=require(_0x8beb('0x13'));var qs=require(_0x8beb('0x14'));var as=require(_0x8beb('0x15'));var hardwareService=require(_0x8beb('0x16'));var logger=require(_0x8beb('0x17'))('api');var utils=require(_0x8beb('0x18'));var config=require(_0x8beb('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x8beb('0x1a')],{'host':_0x8beb('0x1b'),'port':0x18eb});var socket=require(_0x8beb('0x1c'))(new Redis(config[_0x8beb('0x1a')]));require(_0x8beb('0x1d'))['register'](socket);function respondWithStatusCode(_0x58157a,_0x55c76b){_0x55c76b=_0x55c76b||0xcc;return function(_0x316737){if(_0x316737){return _0x58157a[_0x8beb('0x1e')](_0x55c76b);}return _0x58157a[_0x8beb('0x1f')](_0x55c76b)[_0x8beb('0x20')]();};}function respondWithResult(_0x18f96b,_0x24b7e8){_0x24b7e8=_0x24b7e8||0xc8;return function(_0x11f0ef){if(_0x11f0ef){return _0x18f96b[_0x8beb('0x1f')](_0x24b7e8)[_0x8beb('0x21')](_0x11f0ef);}};}function respondWithFilteredResult(_0x1994bf,_0x4518bc){return function(_0x4b10d1){if(_0x4b10d1){var _0x4f8188=typeof _0x4518bc[_0x8beb('0x22')]===_0x8beb('0x23')&&typeof _0x4518bc[_0x8beb('0x24')]===_0x8beb('0x23');var _0x485f2c=_0x4b10d1[_0x8beb('0x25')];var _0xe681ed=_0x4f8188?0x0:_0x4518bc[_0x8beb('0x22')];var _0x5a707e=_0x4f8188?_0x4b10d1['count']:_0x4518bc[_0x8beb('0x22')]+_0x4518bc[_0x8beb('0x24')];var _0x2e4413;if(_0x5a707e>=_0x485f2c){_0x5a707e=_0x485f2c;_0x2e4413=0xc8;}else{_0x2e4413=0xce;}_0x1994bf[_0x8beb('0x1f')](_0x2e4413);return _0x1994bf['set'](_0x8beb('0x26'),_0xe681ed+'-'+_0x5a707e+'/'+_0x485f2c)[_0x8beb('0x21')](_0x4b10d1);}return null;};}function patchUpdates(_0x26b377){return function(_0xb5a554){try{jsonpatch['apply'](_0xb5a554,_0x26b377,!![]);}catch(_0x43e4ae){return BPromise[_0x8beb('0x27')](_0x43e4ae);}return _0xb5a554[_0x8beb('0x28')]();};}function saveUpdates(_0x2fe5f3,_0x90414a){return function(_0x53caca){if(_0x53caca){return _0x53caca['update'](_0x2fe5f3)[_0x8beb('0x29')](function(_0x5589f6){return _0x5589f6;});}return null;};}function removeEntity(_0x102b11,_0x528e8c){return function(_0x5a4510){if(_0x5a4510){return _0x5a4510['destroy']()[_0x8beb('0x29')](function(){_0x102b11[_0x8beb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3089d9,_0x148ef7){return function(_0x370030){if(!_0x370030){_0x3089d9[_0x8beb('0x1e')](0x194);}return _0x370030;};}function handleError(_0x338e29,_0x15eead){_0x15eead=_0x15eead||0x1f4;return function(_0x412219){logger[_0x8beb('0x2a')](_0x412219[_0x8beb('0x2b')]);if(_0x412219[_0x8beb('0x2c')]){delete _0x412219[_0x8beb('0x2c')];}_0x338e29[_0x8beb('0x1f')](_0x15eead)['send'](_0x412219);};}exports['index']=function(_0x32ce2e,_0x19e818){var _0x108f7b={},_0x1303f3={},_0x9db8d0={'count':0x0,'rows':[]};var _0xf14c9b=_['map'](db[_0x8beb('0x2d')][_0x8beb('0x2e')],function(_0x346135){return{'name':_0x346135['fieldName'],'type':_0x346135[_0x8beb('0x2f')][_0x8beb('0x30')]};});_0x1303f3[_0x8beb('0x31')]=_[_0x8beb('0x32')](_0xf14c9b,_0x8beb('0x2c'));_0x1303f3[_0x8beb('0x33')]=_[_0x8beb('0x34')](_0x32ce2e[_0x8beb('0x33')]);_0x1303f3[_0x8beb('0x35')]=_[_0x8beb('0x36')](_0x1303f3[_0x8beb('0x31')],_0x1303f3[_0x8beb('0x33')]);_0x108f7b[_0x8beb('0x37')]=_[_0x8beb('0x36')](_0x1303f3['model'],qs['fields'](_0x32ce2e['query']['fields']));_0x108f7b['attributes']=_0x108f7b[_0x8beb('0x37')][_0x8beb('0x38')]?_0x108f7b[_0x8beb('0x37')]:_0x1303f3[_0x8beb('0x31')];if(!_0x32ce2e[_0x8beb('0x33')][_0x8beb('0x39')](_0x8beb('0x3a'))){_0x108f7b[_0x8beb('0x24')]=qs[_0x8beb('0x24')](_0x32ce2e['query'][_0x8beb('0x24')]);_0x108f7b[_0x8beb('0x22')]=qs[_0x8beb('0x22')](_0x32ce2e[_0x8beb('0x33')][_0x8beb('0x22')]);}_0x108f7b[_0x8beb('0x3b')]=qs[_0x8beb('0x3c')](_0x32ce2e[_0x8beb('0x33')][_0x8beb('0x3c')]);_0x108f7b['where']=qs[_0x8beb('0x35')](_[_0x8beb('0x3d')](_0x32ce2e[_0x8beb('0x33')],_0x1303f3[_0x8beb('0x35')]),_0xf14c9b);if(_0x32ce2e['query'][_0x8beb('0x3e')]){_0x108f7b[_0x8beb('0x3f')]=_[_0x8beb('0x40')](_0x108f7b[_0x8beb('0x3f')],{'$or':_[_0x8beb('0x32')](_0xf14c9b,function(_0x27a70d){if(_0x27a70d['type']!==_0x8beb('0x41')){var _0x581824={};_0x581824[_0x27a70d[_0x8beb('0x2c')]]={'$like':'%'+_0x32ce2e[_0x8beb('0x33')][_0x8beb('0x3e')]+'%'};return _0x581824;}})});}_0x108f7b=_[_0x8beb('0x40')]({},_0x108f7b,_0x32ce2e['options']);var _0x194a7e={'where':_0x108f7b[_0x8beb('0x3f')]};return db[_0x8beb('0x2d')]['count'](_0x194a7e)['then'](function(_0x37a295){_0x9db8d0['count']=_0x37a295;if(_0x32ce2e[_0x8beb('0x33')][_0x8beb('0x42')]){_0x108f7b['include']=[{'all':!![]}];}return db[_0x8beb('0x2d')][_0x8beb('0x43')](_0x108f7b);})[_0x8beb('0x29')](function(_0x32e7e9){_0x9db8d0['rows']=_0x32e7e9;return _0x9db8d0;})['then'](respondWithFilteredResult(_0x19e818,_0x108f7b))[_0x8beb('0x44')](handleError(_0x19e818,null));};exports[_0x8beb('0x45')]=function(_0x346cc9,_0x19c738){var _0x580598={'raw':!![],'where':{'id':_0x346cc9[_0x8beb('0x46')]['id']}},_0x3030dc={};_0x3030dc[_0x8beb('0x31')]=_[_0x8beb('0x34')](db['ChatInternalMessage'][_0x8beb('0x2e')]);_0x3030dc[_0x8beb('0x33')]=_[_0x8beb('0x34')](_0x346cc9['query']);_0x3030dc['filters']=_[_0x8beb('0x36')](_0x3030dc[_0x8beb('0x31')],_0x3030dc[_0x8beb('0x33')]);_0x580598['attributes']=_['intersection'](_0x3030dc[_0x8beb('0x31')],qs['fields'](_0x346cc9[_0x8beb('0x33')][_0x8beb('0x47')]));_0x580598[_0x8beb('0x37')]=_0x580598[_0x8beb('0x37')]['length']?_0x580598[_0x8beb('0x37')]:_0x3030dc[_0x8beb('0x31')];if(_0x346cc9['query'][_0x8beb('0x42')]){_0x580598[_0x8beb('0x48')]=[{'all':!![]}];}_0x580598=_['merge']({},_0x580598,_0x346cc9['options']);return db['ChatInternalMessage'][_0x8beb('0x49')](_0x580598)['then'](handleEntityNotFound(_0x19c738,null))[_0x8beb('0x29')](respondWithResult(_0x19c738,null))[_0x8beb('0x44')](handleError(_0x19c738,null));};exports[_0x8beb('0x4a')]=function(_0x1f0a39,_0x28f101){return db[_0x8beb('0x2d')][_0x8beb('0x4a')](_0x1f0a39[_0x8beb('0x4b')],{})['then'](respondWithResult(_0x28f101,0xc9))[_0x8beb('0x44')](handleError(_0x28f101,null));};exports[_0x8beb('0x4c')]=function(_0x583040,_0x1b9869){if(_0x583040[_0x8beb('0x4b')]['id']){delete _0x583040[_0x8beb('0x4b')]['id'];}return db[_0x8beb('0x2d')][_0x8beb('0x49')]({'where':{'id':_0x583040[_0x8beb('0x46')]['id']}})[_0x8beb('0x29')](handleEntityNotFound(_0x1b9869,null))[_0x8beb('0x29')](saveUpdates(_0x583040[_0x8beb('0x4b')],null))[_0x8beb('0x29')](respondWithResult(_0x1b9869,null))['catch'](handleError(_0x1b9869,null));};exports[_0x8beb('0x4d')]=function(_0x2c8283,_0x1e9d31){return db[_0x8beb('0x2d')][_0x8beb('0x49')]({'where':{'id':_0x2c8283['params']['id']}})[_0x8beb('0x29')](handleEntityNotFound(_0x1e9d31,null))[_0x8beb('0x29')](removeEntity(_0x1e9d31,null))[_0x8beb('0x44')](handleError(_0x1e9d31,null));};exports[_0x8beb('0x4e')]=function(_0x1e2ff1,_0x2f96a3){return db['ChatInternalMessage'][_0x8beb('0x4e')]()[_0x8beb('0x29')](respondWithResult(_0x2f96a3,null))[_0x8beb('0x44')](handleError(_0x2f96a3,null));};function wrapUser(_0x4fbf45){return function(_0x46f448){var _0x2dd6c7=_0x4fbf45['get']({'plain':!![]});_0x2dd6c7[_0x8beb('0x4f')]=[];if(_0x46f448){_0x2dd6c7[_0x8beb('0x50')]=_0x46f448['createdAt'];_0x2dd6c7['lastMessage']=_0x46f448;}else{_0x2dd6c7[_0x8beb('0x50')]=moment(0x0)[_0x8beb('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dd6c7[_0x8beb('0x52')]={};}return _0x2dd6c7;};}exports['getUsers']=function(_0x29c855,_0x3a9062,_0x2641c3){var _0x38c5ea=[];return db[_0x8beb('0x53')][_0x8beb('0x43')]({'where':{'role':[_0x8beb('0x54'),_0x8beb('0x55'),_0x8beb('0x56')]},'attributes':['id',_0x8beb('0x57'),_0x8beb('0x2c'),'role','userpic',_0x8beb('0x58'),_0x8beb('0x59'),_0x8beb('0x5a'),_0x8beb('0x5b'),_0x8beb('0x5c')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x8beb('0x5d'),'attributes':['id','name',_0x8beb('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x16a641){if(_0x16a641){var _0x1d2ce0=_0x29c855[_0x8beb('0x56')]['get']({'plain':!![]});if(!_0x1d2ce0)throw new Error(_0x8beb('0x5e'));if(_0x1d2ce0[_0x8beb('0x5f')]===_0x8beb('0x56')){return db[_0x8beb('0x60')][_0x8beb('0x49')]({'where':{'name':_0x8beb('0x61'),'userProfileId':_0x1d2ce0[_0x8beb('0x62')]},'raw':!![]})['then'](function(_0x4bb64e){if(_0x4bb64e){if(_0x4bb64e[_0x8beb('0x63')]===0x0){return db[_0x8beb('0x64')][_0x8beb('0x43')]({'where':{'sectionId':_0x4bb64e['id']},'raw':!![]})[_0x8beb('0x29')](function(_0x4d9be5){var _0x1e33b5=[];if(_[_0x8beb('0x65')](_0x4d9be5)){_0x1e33b5=_[_0x8beb('0x3e')](_0x16a641,function(_0x28e60f){if(_0x28e60f[_0x8beb('0x5f')]!==_0x8beb('0x54')){return _0x28e60f;}});return _0x1e33b5;}else{for(var _0x1287e2=0x0;_0x1287e2<_0x16a641[_0x8beb('0x38')];_0x1287e2++){var _0x1a5882=_0x16a641[_0x1287e2];if(_0x1a5882[_0x8beb('0x5f')]===_0x8beb('0x54')){var _0x149c0d=_[_0x8beb('0x49')](_0x4d9be5,function(_0x533c9a){return _0x533c9a[_0x8beb('0x66')]===_0x1a5882['id'];});if(_0x149c0d)_0x1e33b5['push'](_0x1a5882);}else{_0x1e33b5['push'](_0x1a5882);}}return _0x1e33b5;}});}else{return _0x16a641;}}else{var _0x4bbb64=_[_0x8beb('0x3e')](_0x16a641,function(_0x20d534){if(_0x20d534[_0x8beb('0x5f')]!==_0x8beb('0x54')){return _0x20d534;}});return _0x4bbb64;}});}else{return _0x16a641;}}})[_0x8beb('0x29')](function(_0x52aafb){var _0x5ed9e6=[];if(_0x52aafb){_0x38c5ea=_0x52aafb;for(var _0x2ed0ad=0x0;_0x2ed0ad<_0x52aafb['length'];_0x2ed0ad+=0x1){_0x38c5ea[_0x2ed0ad][_0x8beb('0x4f')]=[];_0x5ed9e6[_0x8beb('0x67')](db[_0x8beb('0x2d')]['find']({'where':{'FromId':[_0x29c855['user']['id'],_0x52aafb[_0x2ed0ad]['id']],'ToId':[_0x29c855['user']['id'],_0x52aafb[_0x2ed0ad]['id']],'ChatGroupId':null},'attributes':['id',_0x8beb('0x68'),'FromId',_0x8beb('0x69'),'read','body'],'order':qs[_0x8beb('0x3c')](_0x8beb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8beb('0x29')](wrapUser(_0x52aafb[_0x2ed0ad])));}return BPromise[_0x8beb('0x6b')](_0x5ed9e6);}return[];})[_0x8beb('0x29')](function(_0x5313b4){return{'rows':_0x5313b4,'count':_0x5313b4[_0x8beb('0x38')]};})[_0x8beb('0x29')](respondWithResult(_0x3a9062,null))[_0x8beb('0x44')](handleError(_0x3a9062,null));}; \ No newline at end of file +var _0x381f=['all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','update','destroy','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','push','messages','createdAt','FromId','ToId','read'];(function(_0x59070e,_0x456189){var _0x597e37=function(_0x5daab7){while(--_0x5daab7){_0x59070e['push'](_0x59070e['shift']());}};_0x597e37(++_0x456189);}(_0x381f,0xeb));var _0xf381=function(_0x2770f2,_0x37e3b5){_0x2770f2=_0x2770f2-0x0;var _0x3ffabd=_0x381f[_0x2770f2];return _0x3ffabd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf381('0x0'));var zipdir=require(_0xf381('0x1'));var jsonpatch=require(_0xf381('0x2'));var rp=require(_0xf381('0x3'));var moment=require(_0xf381('0x4'));var BPromise=require(_0xf381('0x5'));var Mustache=require(_0xf381('0x6'));var util=require(_0xf381('0x7'));var path=require(_0xf381('0x8'));var sox=require(_0xf381('0x9'));var csv=require(_0xf381('0xa'));var ejs=require(_0xf381('0xb'));var fs=require('fs');var fs_extra=require(_0xf381('0xc'));var _=require('lodash');var squel=require(_0xf381('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf381('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf381('0xf'));var Papa=require(_0xf381('0x10'));var Redis=require(_0xf381('0x11'));var authService=require(_0xf381('0x12'));var qs=require(_0xf381('0x13'));var as=require(_0xf381('0x14'));var hardwareService=require(_0xf381('0x15'));var logger=require(_0xf381('0x16'))(_0xf381('0x17'));var utils=require(_0xf381('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf381('0x19'));var db=require(_0xf381('0x1a'))['db'];config[_0xf381('0x1b')]=_[_0xf381('0x1c')](config['redis'],{'host':_0xf381('0x1d'),'port':0x18eb});var socket=require(_0xf381('0x1e'))(new Redis(config[_0xf381('0x1b')]));require(_0xf381('0x1f'))[_0xf381('0x20')](socket);function respondWithStatusCode(_0x5a13dd,_0x4410e9){_0x4410e9=_0x4410e9||0xcc;return function(_0x5d523c){if(_0x5d523c){return _0x5a13dd[_0xf381('0x21')](_0x4410e9);}return _0x5a13dd[_0xf381('0x22')](_0x4410e9)[_0xf381('0x23')]();};}function respondWithResult(_0x31dbca,_0x43fd2a){_0x43fd2a=_0x43fd2a||0xc8;return function(_0x4260dd){if(_0x4260dd){return _0x31dbca['status'](_0x43fd2a)['json'](_0x4260dd);}};}function respondWithFilteredResult(_0x131015,_0x127fa1){return function(_0x40bce3){if(_0x40bce3){var _0x249a41=typeof _0x127fa1['offset']===_0xf381('0x24')&&typeof _0x127fa1[_0xf381('0x25')]===_0xf381('0x24');var _0x56c28b=_0x40bce3[_0xf381('0x26')];var _0x2b4733=_0x249a41?0x0:_0x127fa1['offset'];var _0x1302eb=_0x249a41?_0x40bce3[_0xf381('0x26')]:_0x127fa1[_0xf381('0x27')]+_0x127fa1[_0xf381('0x25')];var _0x18c40c;if(_0x1302eb>=_0x56c28b){_0x1302eb=_0x56c28b;_0x18c40c=0xc8;}else{_0x18c40c=0xce;}_0x131015['status'](_0x18c40c);return _0x131015[_0xf381('0x28')]('Content-Range',_0x2b4733+'-'+_0x1302eb+'/'+_0x56c28b)[_0xf381('0x29')](_0x40bce3);}return null;};}function patchUpdates(_0xadcc7){return function(_0x395f29){try{jsonpatch[_0xf381('0x2a')](_0x395f29,_0xadcc7,!![]);}catch(_0x236d59){return BPromise[_0xf381('0x2b')](_0x236d59);}return _0x395f29[_0xf381('0x2c')]();};}function saveUpdates(_0x1e8fc4,_0x5a32aa){return function(_0x2b6ca1){if(_0x2b6ca1){return _0x2b6ca1['update'](_0x1e8fc4)[_0xf381('0x2d')](function(_0x499a45){return _0x499a45;});}return null;};}function removeEntity(_0x4f5e06,_0xa403dd){return function(_0x2ec09f){if(_0x2ec09f){return _0x2ec09f['destroy']()['then'](function(){_0x4f5e06[_0xf381('0x22')](0xcc)[_0xf381('0x23')]();});}};}function handleEntityNotFound(_0x412850,_0x15595c){return function(_0x4c8d68){if(!_0x4c8d68){_0x412850[_0xf381('0x21')](0x194);}return _0x4c8d68;};}function handleError(_0x2fdf9d,_0x403379){_0x403379=_0x403379||0x1f4;return function(_0x39617b){logger[_0xf381('0x2e')](_0x39617b[_0xf381('0x2f')]);if(_0x39617b[_0xf381('0x30')]){delete _0x39617b[_0xf381('0x30')];}_0x2fdf9d['status'](_0x403379)[_0xf381('0x31')](_0x39617b);};}exports[_0xf381('0x32')]=function(_0x20a5c7,_0x579848){var _0x474c1b={},_0x5313ca={},_0x408e96={'count':0x0,'rows':[]};var _0x1a3364=_['map'](db[_0xf381('0x33')][_0xf381('0x34')],function(_0x3c779b){return{'name':_0x3c779b[_0xf381('0x35')],'type':_0x3c779b[_0xf381('0x36')]['key']};});_0x5313ca[_0xf381('0x37')]=_['map'](_0x1a3364,'name');_0x5313ca['query']=_['keys'](_0x20a5c7['query']);_0x5313ca[_0xf381('0x38')]=_[_0xf381('0x39')](_0x5313ca[_0xf381('0x37')],_0x5313ca[_0xf381('0x3a')]);_0x474c1b[_0xf381('0x3b')]=_['intersection'](_0x5313ca[_0xf381('0x37')],qs['fields'](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3c')]));_0x474c1b['attributes']=_0x474c1b[_0xf381('0x3b')][_0xf381('0x3d')]?_0x474c1b['attributes']:_0x5313ca[_0xf381('0x37')];if(!_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3e')](_0xf381('0x3f'))){_0x474c1b['limit']=qs[_0xf381('0x25')](_0x20a5c7[_0xf381('0x3a')]['limit']);_0x474c1b['offset']=qs[_0xf381('0x27')](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x27')]);}_0x474c1b[_0xf381('0x40')]=qs[_0xf381('0x41')](_0x20a5c7['query'][_0xf381('0x41')]);_0x474c1b[_0xf381('0x42')]=qs['filters'](_[_0xf381('0x43')](_0x20a5c7[_0xf381('0x3a')],_0x5313ca['filters']),_0x1a3364);if(_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]){_0x474c1b[_0xf381('0x42')]=_[_0xf381('0x45')](_0x474c1b[_0xf381('0x42')],{'$or':_[_0xf381('0x46')](_0x1a3364,function(_0x392bbb){if(_0x392bbb[_0xf381('0x36')]!==_0xf381('0x47')){var _0x38cfcc={};_0x38cfcc[_0x392bbb['name']]={'$like':'%'+_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]+'%'};return _0x38cfcc;}})});}_0x474c1b=_[_0xf381('0x45')]({},_0x474c1b,_0x20a5c7[_0xf381('0x48')]);var _0x3dad7d={'where':_0x474c1b['where']};return db[_0xf381('0x33')][_0xf381('0x26')](_0x3dad7d)['then'](function(_0x1116df){_0x408e96['count']=_0x1116df;if(_0x20a5c7[_0xf381('0x3a')]['includeAll']){_0x474c1b[_0xf381('0x49')]=[{'all':!![]}];}return db[_0xf381('0x33')]['findAll'](_0x474c1b);})[_0xf381('0x2d')](function(_0x144b96){_0x408e96[_0xf381('0x4a')]=_0x144b96;return _0x408e96;})[_0xf381('0x2d')](respondWithFilteredResult(_0x579848,_0x474c1b))[_0xf381('0x4b')](handleError(_0x579848,null));};exports[_0xf381('0x4c')]=function(_0xfd2705,_0x19c972){var _0x17b6f8={'raw':!![],'where':{'id':_0xfd2705[_0xf381('0x4d')]['id']}},_0x3dc283={};_0x3dc283[_0xf381('0x37')]=_['keys'](db[_0xf381('0x33')][_0xf381('0x34')]);_0x3dc283['query']=_[_0xf381('0x4e')](_0xfd2705['query']);_0x3dc283[_0xf381('0x38')]=_[_0xf381('0x39')](_0x3dc283['model'],_0x3dc283[_0xf381('0x3a')]);_0x17b6f8[_0xf381('0x3b')]=_['intersection'](_0x3dc283[_0xf381('0x37')],qs['fields'](_0xfd2705[_0xf381('0x3a')][_0xf381('0x3c')]));_0x17b6f8[_0xf381('0x3b')]=_0x17b6f8[_0xf381('0x3b')][_0xf381('0x3d')]?_0x17b6f8['attributes']:_0x3dc283[_0xf381('0x37')];if(_0xfd2705[_0xf381('0x3a')][_0xf381('0x4f')]){_0x17b6f8[_0xf381('0x49')]=[{'all':!![]}];}_0x17b6f8=_[_0xf381('0x45')]({},_0x17b6f8,_0xfd2705[_0xf381('0x48')]);return db[_0xf381('0x33')][_0xf381('0x50')](_0x17b6f8)[_0xf381('0x2d')](handleEntityNotFound(_0x19c972,null))[_0xf381('0x2d')](respondWithResult(_0x19c972,null))[_0xf381('0x4b')](handleError(_0x19c972,null));};exports[_0xf381('0x51')]=function(_0x21d620,_0x3f031e){return db[_0xf381('0x33')][_0xf381('0x51')](_0x21d620[_0xf381('0x52')],{})[_0xf381('0x2d')](respondWithResult(_0x3f031e,0xc9))[_0xf381('0x4b')](handleError(_0x3f031e,null));};exports[_0xf381('0x53')]=function(_0x4626da,_0x486a9d){if(_0x4626da[_0xf381('0x52')]['id']){delete _0x4626da['body']['id'];}return db['ChatInternalMessage'][_0xf381('0x50')]({'where':{'id':_0x4626da['params']['id']}})['then'](handleEntityNotFound(_0x486a9d,null))[_0xf381('0x2d')](saveUpdates(_0x4626da['body'],null))[_0xf381('0x2d')](respondWithResult(_0x486a9d,null))['catch'](handleError(_0x486a9d,null));};exports[_0xf381('0x54')]=function(_0x1eb672,_0xefebc9){return db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'id':_0x1eb672[_0xf381('0x4d')]['id']}})[_0xf381('0x2d')](handleEntityNotFound(_0xefebc9,null))[_0xf381('0x2d')](removeEntity(_0xefebc9,null))['catch'](handleError(_0xefebc9,null));};exports['describe']=function(_0x4efe50,_0x5b9bb7){return db[_0xf381('0x33')]['describe']()[_0xf381('0x2d')](respondWithResult(_0x5b9bb7,null))[_0xf381('0x4b')](handleError(_0x5b9bb7,null));};function wrapUser(_0x439334){return function(_0x2fbcc2){var _0x36dd15=_0x439334['get']({'plain':!![]});_0x36dd15['messages']=[];if(_0x2fbcc2){_0x36dd15[_0xf381('0x55')]=_0x2fbcc2['createdAt'];_0x36dd15['lastMessage']=_0x2fbcc2;}else{_0x36dd15['lastMessageAt']=moment(0x0)[_0xf381('0x56')](_0xf381('0x57'));_0x36dd15[_0xf381('0x58')]={};}return _0x36dd15;};}exports[_0xf381('0x59')]=function(_0x384c17,_0x2df2de,_0x11e31c){var _0x116f50=[];return db[_0xf381('0x5a')]['findAll']({'where':{'role':[_0xf381('0x5b'),_0xf381('0x5c'),'user']},'attributes':['id',_0xf381('0x5d'),_0xf381('0x30'),_0xf381('0x5e'),'userpic',_0xf381('0x5f'),_0xf381('0x60'),_0xf381('0x61'),_0xf381('0x62'),_0xf381('0x63')],'order':qs[_0xf381('0x41')](_0xf381('0x64')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xf381('0x30'),_0xf381('0x36')],'through':{'attributes':[]}}]})[_0xf381('0x2d')](function(_0x53b3f3){if(_0x53b3f3){var _0x3aef1e=_0x384c17['user'][_0xf381('0x65')]({'plain':!![]});if(!_0x3aef1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aef1e[_0xf381('0x5e')]===_0xf381('0x66')){return db[_0xf381('0x67')][_0xf381('0x50')]({'where':{'name':_0xf381('0x68'),'userProfileId':_0x3aef1e[_0xf381('0x69')]},'raw':!![]})['then'](function(_0x4a8d0e){if(_0x4a8d0e){if(_0x4a8d0e[_0xf381('0x6a')]===0x0){return db[_0xf381('0x6b')][_0xf381('0x6c')]({'where':{'sectionId':_0x4a8d0e['id']},'raw':!![]})[_0xf381('0x2d')](function(_0x7de01a){var _0x2ab7ce=[];if(_[_0xf381('0x6d')](_0x7de01a)){_0x2ab7ce=_[_0xf381('0x44')](_0x53b3f3,function(_0xb0197a){if(_0xb0197a[_0xf381('0x5e')]!=='agent'){return _0xb0197a;}});return _0x2ab7ce;}else{for(var _0xb89723=0x0;_0xb89723<_0x53b3f3[_0xf381('0x3d')];_0xb89723++){var _0x752af8=_0x53b3f3[_0xb89723];if(_0x752af8[_0xf381('0x5e')]===_0xf381('0x5b')){var _0x5f0d5d=_[_0xf381('0x50')](_0x7de01a,function(_0x5d78df){return _0x5d78df['resourceId']===_0x752af8['id'];});if(_0x5f0d5d)_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}else{_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}}return _0x2ab7ce;}});}else{return _0x53b3f3;}}else{var _0x4e546f=_['filter'](_0x53b3f3,function(_0x26a965){if(_0x26a965[_0xf381('0x5e')]!==_0xf381('0x5b')){return _0x26a965;}});return _0x4e546f;}});}else{return _0x53b3f3;}}})[_0xf381('0x2d')](function(_0x571ccd){var _0x1c70ae=[];if(_0x571ccd){_0x116f50=_0x571ccd;for(var _0x33b780=0x0;_0x33b780<_0x571ccd[_0xf381('0x3d')];_0x33b780+=0x1){_0x116f50[_0x33b780][_0xf381('0x6f')]=[];_0x1c70ae[_0xf381('0x6e')](db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'FromId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ToId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ChatGroupId':null},'attributes':['id',_0xf381('0x70'),_0xf381('0x71'),_0xf381('0x72'),_0xf381('0x73'),_0xf381('0x52')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf381('0x2d')](wrapUser(_0x571ccd[_0x33b780])));}return BPromise[_0xf381('0x74')](_0x1c70ae);}return[];})[_0xf381('0x2d')](function(_0x1333dc){return{'rows':_0x1333dc,'count':_0x1333dc['length']};})[_0xf381('0x2d')](respondWithResult(_0x2df2de,null))[_0xf381('0x4b')](handleError(_0x2df2de,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2a757d0..cefb6ba 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 _0xb6d8=['hook','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xb6d8,0x1c1));var _0x8b6d=function(_0xd9daad,_0x17d43b){_0xd9daad=_0xd9daad-0x0;var _0x59c345=_0xb6d8[_0xd9daad];return _0x59c345;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x8b6d('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8b6d('0x1')](0x0);var events={'afterCreate':_0x8b6d('0x2'),'afterUpdate':_0x8b6d('0x3'),'afterDestroy':_0x8b6d('0x4')};function emitEvent(_0x58bd21){return function(_0x2c2e78,_0x214024,_0x3cac0f){ChatInternalMessageEvents[_0x8b6d('0x5')](_0x58bd21+':'+_0x2c2e78['id'],_0x2c2e78);ChatInternalMessageEvents['emit'](_0x58bd21,_0x2c2e78);_0x3cac0f(null);};}for(var e in events){if(events[_0x8b6d('0x6')](e)){var event=events[e];ChatInternalMessage[_0x8b6d('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x8a17=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x5c3a5a,_0x2330d8){var _0x58b45b=function(_0x575d94){while(--_0x575d94){_0x5c3a5a['push'](_0x5c3a5a['shift']());}};_0x58b45b(++_0x2330d8);}(_0x8a17,0x135));var _0x78a1=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x8a17[_0x28b0a1];return _0x21470c;};'use strict';var EventEmitter=require(_0x78a1('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x78a1('0x1')](0x0);var events={'afterCreate':_0x78a1('0x2'),'afterUpdate':_0x78a1('0x3'),'afterDestroy':_0x78a1('0x4')};function emitEvent(_0x4a92b9){return function(_0x2dee4d,_0x168b2c,_0x30124e){ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9+':'+_0x2dee4d['id'],_0x2dee4d);ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9,_0x2dee4d);_0x30124e(null);};}for(var e in events){if(events[_0x78a1('0x6')](e)){var event=events[e];ChatInternalMessage[_0x78a1('0x7')](e,emitEvent(event));}}module[_0x78a1('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c774c06..2ed3cab 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 _0x9c93=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x20a065,_0x374117){var _0x58a50c=function(_0x181018){while(--_0x181018){_0x20a065['push'](_0x20a065['shift']());}};_0x58a50c(++_0x374117);}(_0x9c93,0xd7));var _0x39c9=function(_0x26b5cb,_0x15f879){_0x26b5cb=_0x26b5cb-0x0;var _0x3b2277=_0x9c93[_0x26b5cb];return _0x3b2277;};'use strict';var _=require(_0x39c9('0x0'));var util=require(_0x39c9('0x1'));var logger=require(_0x39c9('0x2'))(_0x39c9('0x3'));var moment=require(_0x39c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x39c9('0x5'));var fs=require('fs');var path=require(_0x39c9('0x6'));var rimraf=require('rimraf');var config=require(_0x39c9('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x4dd4c5,_0x5ceac7){return _0x4dd4c5[_0x39c9('0x8')](_0x39c9('0x9'),attributes,{'tableName':_0x39c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x39c9('0xb')});}; \ No newline at end of file +var _0x97cd=['rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','util','../../config/logger','api','request-promise'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x97cd,0x1aa));var _0xd97c=function(_0x16b97e,_0x33bb22){_0x16b97e=_0x16b97e-0x0;var _0x232f4d=_0x97cd[_0x16b97e];return _0x232f4d;};'use strict';var _=require('lodash');var util=require(_0xd97c('0x0'));var logger=require(_0xd97c('0x1'))(_0xd97c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd97c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd97c('0x4'));var config=require('../../config/environment');var attributes=require(_0xd97c('0x5'));module[_0xd97c('0x6')]=function(_0x4f3b78,_0xc6a418){return _0x4f3b78[_0xd97c('0x7')](_0xd97c('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd97c('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 4f9224c..84f5a2c 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 _0x567c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','moment','bluebird'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0x567c,0x8d));var _0xc567=function(_0x4b3120,_0x5c6479){_0x4b3120=_0x4b3120-0x0;var _0x221f00=_0x567c[_0x4b3120];return _0x221f00;};'use strict';var _=require(_0xc567('0x0'));var util=require(_0xc567('0x1'));var moment=require(_0xc567('0x2'));var BPromise=require(_0xc567('0x3'));var rs=require(_0xc567('0x4'));var fs=require('fs');var Redis=require(_0xc567('0x5'));var db=require(_0xc567('0x6'))['db'];var utils=require(_0xc567('0x7'));var logger=require(_0xc567('0x8'))(_0xc567('0x9'));var config=require(_0xc567('0xa'));var jayson=require(_0xc567('0xb'));var client=jayson[_0xc567('0xc')][_0xc567('0xd')]({'port':0x232a});config[_0xc567('0xe')]=_[_0xc567('0xf')](config[_0xc567('0xe')],{'host':_0xc567('0x10'),'port':0x18eb});var socket=require(_0xc567('0x11'))(new Redis(config[_0xc567('0xe')]));require(_0xc567('0x12'))[_0xc567('0x13')](socket);function respondWithRpcPromise(_0x5023f9,_0x2a76c3,_0x51e7c7){return new BPromise(function(_0x34a0ff,_0x376ce6){return client[_0xc567('0x14')](_0x5023f9,_0x51e7c7)['then'](function(_0x2312c0){logger['info'](_0xc567('0x15'),_0x2a76c3,_0xc567('0x16'));logger[_0xc567('0x17')](_0xc567('0x18'),_0x2a76c3,'request\x20sent',JSON[_0xc567('0x19')](_0x2312c0));if(_0x2312c0[_0xc567('0x1a')]){if(_0x2312c0[_0xc567('0x1a')]['code']===0x1f4){logger[_0xc567('0x1a')](_0xc567('0x15'),_0x2a76c3,_0x2312c0[_0xc567('0x1a')]['message']);return _0x376ce6(_0x2312c0[_0xc567('0x1a')][_0xc567('0x1b')]);}logger['error'](_0xc567('0x15'),_0x2a76c3,_0x2312c0[_0xc567('0x1a')][_0xc567('0x1b')]);return _0x34a0ff(_0x2312c0['error'][_0xc567('0x1b')]);}else{logger[_0xc567('0x1c')](_0xc567('0x15'),_0x2a76c3,_0xc567('0x16'));_0x34a0ff(_0x2312c0['result']['message']);}})['catch'](function(_0x349aa2){logger['error'](_0xc567('0x15'),_0x2a76c3,_0x349aa2);_0x376ce6(_0x349aa2);});});} \ No newline at end of file +var _0x98ea=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x428310,_0x16977c){var _0x4eae4f=function(_0x444bb9){while(--_0x444bb9){_0x428310['push'](_0x428310['shift']());}};_0x4eae4f(++_0x16977c);}(_0x98ea,0x164));var _0xa98e=function(_0x5ac4d3,_0x5456e9){_0x5ac4d3=_0x5ac4d3-0x0;var _0x186a90=_0x98ea[_0x5ac4d3];return _0x186a90;};'use strict';var _=require(_0xa98e('0x0'));var util=require(_0xa98e('0x1'));var moment=require(_0xa98e('0x2'));var BPromise=require(_0xa98e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa98e('0x4'));var db=require(_0xa98e('0x5'))['db'];var utils=require(_0xa98e('0x6'));var logger=require(_0xa98e('0x7'))(_0xa98e('0x8'));var config=require(_0xa98e('0x9'));var jayson=require(_0xa98e('0xa'));var client=jayson[_0xa98e('0xb')][_0xa98e('0xc')]({'port':0x232a});config[_0xa98e('0xd')]=_[_0xa98e('0xe')](config[_0xa98e('0xd')],{'host':_0xa98e('0xf'),'port':0x18eb});var socket=require(_0xa98e('0x10'))(new Redis(config['redis']));require(_0xa98e('0x11'))['register'](socket);function respondWithRpcPromise(_0x2cd653,_0x1357bd,_0x2f6c60){return new BPromise(function(_0x15a499,_0x22b4f9){return client[_0xa98e('0x12')](_0x2cd653,_0x2f6c60)[_0xa98e('0x13')](function(_0x1fd92d){logger[_0xa98e('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1357bd,_0xa98e('0x15'));logger['debug'](_0xa98e('0x16'),_0x1357bd,_0xa98e('0x15'),JSON['stringify'](_0x1fd92d));if(_0x1fd92d[_0xa98e('0x17')]){if(_0x1fd92d[_0xa98e('0x17')]['code']===0x1f4){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);return _0x22b4f9(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}logger['error'](_0xa98e('0x18'),_0x1357bd,_0x1fd92d['error'][_0xa98e('0x19')]);return _0x15a499(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}else{logger[_0xa98e('0x14')](_0xa98e('0x18'),_0x1357bd,_0xa98e('0x15'));_0x15a499(_0x1fd92d[_0xa98e('0x1a')][_0xa98e('0x19')]);}})[_0xa98e('0x1b')](function(_0x3ad305){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x3ad305);_0x22b4f9(_0x3ad305);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7359b0c..3c431a4 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 _0x00d0=['removeListener','register','length','chatInternalMessage:','remove','update','emit'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x00d0,0x115));var _0x000d=function(_0x1005fd,_0x210a11){_0x1005fd=_0x1005fd-0x0;var _0x1a4f1e=_0x00d0[_0x1005fd];return _0x1a4f1e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x000d('0x0'),_0x000d('0x1')];function createListener(_0x3184a2,_0x16c22e){return function(_0x33d2d6){_0x16c22e[_0x000d('0x2')](_0x3184a2,_0x33d2d6);};}function removeListener(_0x5cba13,_0xcc9ead){return function(){ChatInternalMessageEvents[_0x000d('0x3')](_0x5cba13,_0xcc9ead);};}exports[_0x000d('0x4')]=function(_0x2db628){for(var _0x35d03c=0x0,_0x3183a8=events[_0x000d('0x5')];_0x35d03c<_0x3183a8;_0x35d03c++){var _0x337a3e=events[_0x35d03c];var _0x76075d=createListener(_0x000d('0x6')+_0x337a3e,_0x2db628);ChatInternalMessageEvents['on'](_0x337a3e,_0x76075d);}}; \ No newline at end of file +var _0xada5=['emit','length','chatInternalMessage:','update'];(function(_0x43e854,_0x3daa61){var _0x52409b=function(_0x46e66c){while(--_0x46e66c){_0x43e854['push'](_0x43e854['shift']());}};_0x52409b(++_0x3daa61);}(_0xada5,0xd7));var _0x5ada=function(_0x23fe4a,_0x5e6044){_0x23fe4a=_0x23fe4a-0x0;var _0x13ff94=_0xada5[_0x23fe4a];return _0x13ff94;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x5ada('0x0')];function createListener(_0x4fe421,_0xf27179){return function(_0x1a7a84){_0xf27179[_0x5ada('0x1')](_0x4fe421,_0x1a7a84);};}function removeListener(_0x193eca,_0x500e2a){return function(){ChatInternalMessageEvents['removeListener'](_0x193eca,_0x500e2a);};}exports['register']=function(_0x18949){for(var _0x48a6bf=0x0,_0x3d725f=events[_0x5ada('0x2')];_0x48a6bf<_0x3d725f;_0x48a6bf++){var _0x159b79=events[_0x48a6bf];var _0x2932af=createListener(_0x5ada('0x3')+_0x159b79,_0x18949);ChatInternalMessageEvents['on'](_0x159b79,_0x2932af);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 11f8f69..8974f07 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 _0xf01b=['get','isAuthenticated','describe','/users','getUsers','/:id','show','post','put','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0xcfe1b0,_0xcb291b){var _0x31d7cf=function(_0x538f19){while(--_0x538f19){_0xcfe1b0['push'](_0xcfe1b0['shift']());}};_0x31d7cf(++_0xcb291b);}(_0xf01b,0xba));var _0xbf01=function(_0x650ef8,_0x2e849a){_0x650ef8=_0x650ef8-0x0;var _0x2c1a6b=_0xf01b[_0x650ef8];return _0x2c1a6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf01('0x0'));var timeout=require('connect-timeout');var express=require(_0xbf01('0x1'));var router=express['Router']();var fs_extra=require(_0xbf01('0x2'));var auth=require(_0xbf01('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbf01('0x4'));var controller=require(_0xbf01('0x5'));router[_0xbf01('0x6')]('/',auth[_0xbf01('0x7')](),controller['index']);router[_0xbf01('0x6')]('/describe',auth[_0xbf01('0x7')](),controller[_0xbf01('0x8')]);router[_0xbf01('0x6')](_0xbf01('0x9'),auth[_0xbf01('0x7')](),controller[_0xbf01('0xa')]);router[_0xbf01('0x6')](_0xbf01('0xb'),auth[_0xbf01('0x7')](),controller[_0xbf01('0xc')]);router[_0xbf01('0xd')]('/',auth[_0xbf01('0x7')](),controller['create']);router[_0xbf01('0xe')](_0xbf01('0xb'),controller['update']);router['delete'](_0xbf01('0xb'),auth[_0xbf01('0x7')](),controller['destroy']);module[_0xbf01('0xf')]=router; \ No newline at end of file +var _0x0e4a=['describe','/users','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated'];(function(_0x1cca49,_0x46800d){var _0x64efae=function(_0x280e75){while(--_0x280e75){_0x1cca49['push'](_0x1cca49['shift']());}};_0x64efae(++_0x46800d);}(_0x0e4a,0xc7));var _0xa0e4=function(_0x383d53,_0x3374dd){_0x383d53=_0x383d53-0x0;var _0x3a6eb9=_0x0e4a[_0x383d53];return _0x3a6eb9;};'use strict';var multer=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var path=require(_0xa0e4('0x2'));var timeout=require(_0xa0e4('0x3'));var express=require(_0xa0e4('0x4'));var router=express[_0xa0e4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0e4('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa0e4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0e4('0x8'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xa')]);router[_0xa0e4('0x7')](_0xa0e4('0xb'),auth[_0xa0e4('0x9')](),controller['getUsers']);router[_0xa0e4('0x7')](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller['show']);router[_0xa0e4('0xd')]('/',auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xe')]);router[_0xa0e4('0xf')](_0xa0e4('0xc'),controller[_0xa0e4('0x10')]);router['delete'](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0x11')]);module[_0xa0e4('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 8e877ef..0916445 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 _0x3306=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x3306,0x107));var _0x6330=function(_0x192fe3,_0x2ff905){_0x192fe3=_0x192fe3-0x0;var _0x220332=_0x3306[_0x192fe3];return _0x220332;};'use strict';var Sequelize=require(_0x6330('0x0'));module[_0x6330('0x1')]={'body':{'type':Sequelize[_0x6330('0x2')](_0x6330('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6330('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6330('0x5')]('in',_0x6330('0x6')),'defaultValue':_0x6330('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6330('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6330('0x2')]}}; \ No newline at end of file +var _0xefe2=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xefe2,0xd9));var _0x2efe=function(_0x4809b9,_0x2b1841){_0x4809b9=_0x4809b9-0x0;var _0x466a1b=_0xefe2[_0x4809b9];return _0x466a1b;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2efe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2efe('0x4')]('in','out'),'defaultValue':_0x2efe('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2efe('0x6')]},'providerName':{'type':Sequelize[_0x2efe('0x7')]},'providerResponse':{'type':Sequelize[_0x2efe('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 778a216..4f31926 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 _0x1a65=['includeAll','findAll','show','params','length','include','options','create','body','find','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','email','SIP/%s','channel','motionChannel','event','acceptmessage','parse','formData','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1a65,0xb6));var _0x51a6=function(_0x570a66,_0x399546){_0x570a66=_0x570a66-0x0;var _0x16a9aa=_0x1a65[_0x570a66];return _0x16a9aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51a6('0x0'));var zipdir=require(_0x51a6('0x1'));var jsonpatch=require(_0x51a6('0x2'));var rp=require(_0x51a6('0x3'));var moment=require(_0x51a6('0x4'));var BPromise=require(_0x51a6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x51a6('0x6'));var sox=require('sox');var csv=require(_0x51a6('0x7'));var ejs=require(_0x51a6('0x8'));var fs=require('fs');var fs_extra=require(_0x51a6('0x9'));var _=require(_0x51a6('0xa'));var squel=require(_0x51a6('0xb'));var crypto=require(_0x51a6('0xc'));var jsforce=require(_0x51a6('0xd'));var deskjs=require(_0x51a6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a6('0xf'));var Redis=require(_0x51a6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x51a6('0x11'));var hardwareService=require(_0x51a6('0x12'));var logger=require(_0x51a6('0x13'))(_0x51a6('0x14'));var utils=require(_0x51a6('0x15'));var config=require(_0x51a6('0x16'));var licenseUtil=require(_0x51a6('0x17'));var db=require(_0x51a6('0x18'))['db'];config['redis']=_['defaults'](config[_0x51a6('0x19')],{'host':_0x51a6('0x1a'),'port':0x18eb});var socket=require(_0x51a6('0x1b'))(new Redis(config[_0x51a6('0x19')]));require(_0x51a6('0x1c'))[_0x51a6('0x1d')](socket);var jayson=require(_0x51a6('0x1e'));var client=jayson['client'][_0x51a6('0x1f')]({'port':0x232c});var client9002=jayson[_0x51a6('0x20')][_0x51a6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x9e044b,_0x54cf2c,_0x5c21f1,_0x4d56e8){return new BPromise(function(_0x4c4870,_0x1bf060){var _0x51ac37=_0x4d56e8||client;return _0x51ac37[_0x51a6('0x21')](_0x9e044b,_0x5c21f1)['then'](function(_0x2f62c4){logger['info'](_0x51a6('0x22'),_0x54cf2c,_0x51a6('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x54cf2c,_0x51a6('0x23'),JSON[_0x51a6('0x24')](_0x2f62c4));if(_0x2f62c4[_0x51a6('0x25')]){if(_0x2f62c4[_0x51a6('0x25')][_0x51a6('0x26')]===0x1f4){logger[_0x51a6('0x25')](_0x51a6('0x22'),_0x54cf2c,_0x2f62c4[_0x51a6('0x25')][_0x51a6('0x27')]);return _0x1bf060(_0x2f62c4[_0x51a6('0x25')][_0x51a6('0x27')]);}logger[_0x51a6('0x25')]('ChatMessage,\x20%s,\x20%s',_0x54cf2c,_0x2f62c4[_0x51a6('0x25')][_0x51a6('0x27')]);return _0x4c4870(_0x2f62c4[_0x51a6('0x25')][_0x51a6('0x27')]);}else{logger[_0x51a6('0x28')](_0x51a6('0x22'),_0x54cf2c,_0x51a6('0x23'));_0x4c4870(_0x2f62c4[_0x51a6('0x29')][_0x51a6('0x27')]);}})[_0x51a6('0x2a')](function(_0x44d99a){logger[_0x51a6('0x25')]('ChatMessage,\x20%s,\x20%s',_0x54cf2c,_0x44d99a);_0x1bf060(_0x44d99a);});});}function respondWithStatusCode(_0x4d8e0b,_0x593275){_0x593275=_0x593275||0xcc;return function(_0x2a5a20){if(_0x2a5a20){return _0x4d8e0b[_0x51a6('0x2b')](_0x593275);}return _0x4d8e0b[_0x51a6('0x2c')](_0x593275)['end']();};}function respondWithResult(_0xf39d24,_0x49c5d2){_0x49c5d2=_0x49c5d2||0xc8;return function(_0x1ef53b){if(_0x1ef53b){return _0xf39d24[_0x51a6('0x2c')](_0x49c5d2)['json'](_0x1ef53b);}};}function respondWithFilteredResult(_0x3eca5c,_0x958c2){return function(_0x49c2a2){if(_0x49c2a2){var _0x34ac67=typeof _0x958c2[_0x51a6('0x2d')]==='undefined'&&typeof _0x958c2[_0x51a6('0x2e')]===_0x51a6('0x2f');var _0x25e8b2=_0x49c2a2['count'];var _0x47dfff=_0x34ac67?0x0:_0x958c2[_0x51a6('0x2d')];var _0x2a4641=_0x34ac67?_0x49c2a2[_0x51a6('0x30')]:_0x958c2[_0x51a6('0x2d')]+_0x958c2[_0x51a6('0x2e')];var _0x135c1e;if(_0x2a4641>=_0x25e8b2){_0x2a4641=_0x25e8b2;_0x135c1e=0xc8;}else{_0x135c1e=0xce;}_0x3eca5c[_0x51a6('0x2c')](_0x135c1e);return _0x3eca5c[_0x51a6('0x31')](_0x51a6('0x32'),_0x47dfff+'-'+_0x2a4641+'/'+_0x25e8b2)[_0x51a6('0x33')](_0x49c2a2);}return null;};}function patchUpdates(_0x574b49){return function(_0x2b3298){try{jsonpatch[_0x51a6('0x34')](_0x2b3298,_0x574b49,!![]);}catch(_0x2f69dd){return BPromise[_0x51a6('0x35')](_0x2f69dd);}return _0x2b3298[_0x51a6('0x36')]();};}function saveUpdates(_0x2710a6,_0x5868eb){return function(_0x5adffb){if(_0x5adffb){return _0x5adffb[_0x51a6('0x37')](_0x2710a6)['then'](function(_0x51ec56){return _0x51ec56;});}return null;};}function removeEntity(_0x4304b9,_0x2a4684){return function(_0x3d229c){if(_0x3d229c){return _0x3d229c[_0x51a6('0x38')]()[_0x51a6('0x39')](function(){_0x4304b9[_0x51a6('0x2c')](0xcc)[_0x51a6('0x3a')]();});}};}function handleEntityNotFound(_0x56d77e,_0x5084c6){return function(_0x452172){if(!_0x452172){_0x56d77e[_0x51a6('0x2b')](0x194);}return _0x452172;};}function handleError(_0x20e421,_0x4894d3){_0x4894d3=_0x4894d3||0x1f4;return function(_0x36e932){logger[_0x51a6('0x25')](_0x36e932[_0x51a6('0x3b')]);if(_0x36e932[_0x51a6('0x3c')]){delete _0x36e932['name'];}_0x20e421['status'](_0x4894d3)[_0x51a6('0x3d')](_0x36e932);};}exports['index']=function(_0x2377e3,_0xa39d00){var _0x3857c4={},_0x5b57b9={},_0x1f8c48={'count':0x0,'rows':[]};var _0xfc9a5=_[_0x51a6('0x3e')](db[_0x51a6('0x3f')][_0x51a6('0x40')],function(_0x363141){return{'name':_0x363141[_0x51a6('0x41')],'type':_0x363141[_0x51a6('0x42')][_0x51a6('0x43')]};});_0x5b57b9['model']=_[_0x51a6('0x3e')](_0xfc9a5,_0x51a6('0x3c'));_0x5b57b9[_0x51a6('0x44')]=_[_0x51a6('0x45')](_0x2377e3[_0x51a6('0x44')]);_0x5b57b9['filters']=_[_0x51a6('0x46')](_0x5b57b9[_0x51a6('0x47')],_0x5b57b9[_0x51a6('0x44')]);_0x3857c4[_0x51a6('0x48')]=_[_0x51a6('0x46')](_0x5b57b9[_0x51a6('0x47')],qs['fields'](_0x2377e3[_0x51a6('0x44')][_0x51a6('0x49')]));_0x3857c4[_0x51a6('0x48')]=_0x3857c4[_0x51a6('0x48')]['length']?_0x3857c4[_0x51a6('0x48')]:_0x5b57b9[_0x51a6('0x47')];if(!_0x2377e3[_0x51a6('0x44')][_0x51a6('0x4a')](_0x51a6('0x4b'))){_0x3857c4['limit']=qs['limit'](_0x2377e3[_0x51a6('0x44')][_0x51a6('0x2e')]);_0x3857c4[_0x51a6('0x2d')]=qs['offset'](_0x2377e3['query'][_0x51a6('0x2d')]);}_0x3857c4[_0x51a6('0x4c')]=qs[_0x51a6('0x4d')](_0x2377e3[_0x51a6('0x44')][_0x51a6('0x4d')]);_0x3857c4[_0x51a6('0x4e')]=qs[_0x51a6('0x4f')](_[_0x51a6('0x50')](_0x2377e3[_0x51a6('0x44')],_0x5b57b9['filters']),_0xfc9a5);if(_0x2377e3[_0x51a6('0x44')][_0x51a6('0x51')]){_0x3857c4[_0x51a6('0x4e')]=_['merge'](_0x3857c4[_0x51a6('0x4e')],{'$or':_[_0x51a6('0x3e')](_0xfc9a5,function(_0x39fc3c){if(_0x39fc3c[_0x51a6('0x42')]!==_0x51a6('0x52')){var _0x414eae={};_0x414eae[_0x39fc3c[_0x51a6('0x3c')]]={'$like':'%'+_0x2377e3[_0x51a6('0x44')]['filter']+'%'};return _0x414eae;}})});}_0x3857c4=_[_0x51a6('0x53')]({},_0x3857c4,_0x2377e3['options']);var _0x59bcdf={'where':_0x3857c4['where']};return db[_0x51a6('0x3f')][_0x51a6('0x30')](_0x59bcdf)['then'](function(_0x45ae58){_0x1f8c48['count']=_0x45ae58;if(_0x2377e3[_0x51a6('0x44')][_0x51a6('0x54')]){_0x3857c4['include']=[{'all':!![]}];}return db[_0x51a6('0x3f')][_0x51a6('0x55')](_0x3857c4);})[_0x51a6('0x39')](function(_0x59589f){_0x1f8c48['rows']=_0x59589f;return _0x1f8c48;})[_0x51a6('0x39')](respondWithFilteredResult(_0xa39d00,_0x3857c4))[_0x51a6('0x2a')](handleError(_0xa39d00,null));};exports[_0x51a6('0x56')]=function(_0x292f47,_0x4e2be6){var _0x3dd81c={'raw':!![],'where':{'id':_0x292f47[_0x51a6('0x57')]['id']}},_0x2e90e7={};_0x2e90e7[_0x51a6('0x47')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x2e90e7['query']=_[_0x51a6('0x45')](_0x292f47[_0x51a6('0x44')]);_0x2e90e7['filters']=_[_0x51a6('0x46')](_0x2e90e7[_0x51a6('0x47')],_0x2e90e7[_0x51a6('0x44')]);_0x3dd81c[_0x51a6('0x48')]=_['intersection'](_0x2e90e7[_0x51a6('0x47')],qs[_0x51a6('0x49')](_0x292f47['query']['fields']));_0x3dd81c[_0x51a6('0x48')]=_0x3dd81c[_0x51a6('0x48')][_0x51a6('0x58')]?_0x3dd81c[_0x51a6('0x48')]:_0x2e90e7[_0x51a6('0x47')];if(_0x292f47[_0x51a6('0x44')]['includeAll']){_0x3dd81c[_0x51a6('0x59')]=[{'all':!![]}];}_0x3dd81c=_[_0x51a6('0x53')]({},_0x3dd81c,_0x292f47[_0x51a6('0x5a')]);return db['ChatMessage']['find'](_0x3dd81c)['then'](handleEntityNotFound(_0x4e2be6,null))[_0x51a6('0x39')](respondWithResult(_0x4e2be6,null))[_0x51a6('0x2a')](handleError(_0x4e2be6,null));};exports['create']=function(_0x3a0b0d,_0x500e61){return db[_0x51a6('0x3f')][_0x51a6('0x5b')](_0x3a0b0d[_0x51a6('0x5c')],{})[_0x51a6('0x39')](respondWithResult(_0x500e61,0xc9))[_0x51a6('0x2a')](handleError(_0x500e61,null));};exports[_0x51a6('0x37')]=function(_0x569d15,_0x3fb94c){if(_0x569d15[_0x51a6('0x5c')]['id']){delete _0x569d15['body']['id'];}return db['ChatMessage'][_0x51a6('0x5d')]({'where':{'id':_0x569d15[_0x51a6('0x57')]['id']}})[_0x51a6('0x39')](handleEntityNotFound(_0x3fb94c,null))[_0x51a6('0x39')](saveUpdates(_0x569d15[_0x51a6('0x5c')],null))[_0x51a6('0x39')](respondWithResult(_0x3fb94c,null))[_0x51a6('0x2a')](handleError(_0x3fb94c,null));};exports['destroy']=function(_0x39c554,_0x53642b){return db[_0x51a6('0x3f')][_0x51a6('0x5d')]({'where':{'id':_0x39c554['params']['id']}})[_0x51a6('0x39')](handleEntityNotFound(_0x53642b,null))[_0x51a6('0x39')](removeEntity(_0x53642b,null))[_0x51a6('0x2a')](handleError(_0x53642b,null));};exports['describe']=function(_0x15b066,_0x354a48){return db[_0x51a6('0x3f')]['describe']()[_0x51a6('0x39')](respondWithResult(_0x354a48,null))[_0x51a6('0x2a')](handleError(_0x354a48,null));};var interaction_log=require(_0x51a6('0x13'))(_0x51a6('0x5e'));exports[_0x51a6('0x5f')]=function(_0x1091de,_0x5b3f15,_0x36d65f){var _0x2a3620={'agent':{},'channel':_0x51a6('0x60')};if(_0x1091de[_0x51a6('0x5c')]['id']){delete _0x1091de[_0x51a6('0x5c')]['id'];}_0x1091de[_0x51a6('0x5c')][_0x51a6('0x61')]=!![];_0x1091de[_0x51a6('0x5c')][_0x51a6('0x62')]=moment()[_0x51a6('0x63')](_0x51a6('0x64'));_0x1091de[_0x51a6('0x5c')][_0x51a6('0x65')]=_0x1091de[_0x51a6('0x5c')][_0x51a6('0x65')]||_0x1091de['user']['id'];_0x2a3620['agent']['id']=_0x1091de[_0x51a6('0x5c')][_0x51a6('0x65')];return db[_0x51a6('0x3f')][_0x51a6('0x5d')]({'where':{'id':_0x1091de['params']['id'],'UserId':null}})[_0x51a6('0x39')](handleEntityNotFound(_0x5b3f15,null))['then'](saveUpdates(_0x1091de['body'],null))[_0x51a6('0x39')](function(_0x442c68){if(_0x442c68){_0x2a3620[_0x51a6('0x27')]=_0x442c68[_0x51a6('0x66')]({'plain':!![]});return db[_0x51a6('0x67')]['find']({'where':{'id':_0x442c68[_0x51a6('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x5b3f15,null))[_0x51a6('0x39')](function(_0x200919){if(_0x200919){return _0x200919[_0x51a6('0x37')]({'UserId':_0x1091de[_0x51a6('0x5c')][_0x51a6('0x65')],'read1stAt':_['isNil'](_0x200919[_0x51a6('0x69')])?moment()[_0x51a6('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5851df){if(_0x5851df){_0x2a3620[_0x51a6('0x6a')]=_0x5851df['get']({'plain':!![]});interaction_log[_0x51a6('0x28')](_0x51a6('0x6b'),_0x1091de[_0x51a6('0x6c')]['id'],_0x1091de['user'][_0x51a6('0x3c')],_0x1091de[_0x51a6('0x6c')][_0x51a6('0x6d')],_0x2a3620['interaction']['id'],_0x1091de[_0x51a6('0x5c')]?JSON[_0x51a6('0x24')](_0x1091de[_0x51a6('0x5c')]):_0x51a6('0x6e'));return respondWithRpcPromise(_0x51a6('0x6f'),_0x51a6('0x70'),_0x2a3620);}return null;})[_0x51a6('0x39')](function(_0x41a553){var _0x4f7694='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x41a553[_0x51a6('0x27')][_0x51a6('0x71')];return db[_0x51a6('0x72')][_0x51a6('0x44')](_0x4f7694,{'type':db[_0x51a6('0x73')]['QueryTypes'][_0x51a6('0x74')],'raw':!![]})[_0x51a6('0x39')](function(_0x1a6844){return _0x1a6844;});})[_0x51a6('0x39')](function(_0x459d7f){if(_0x459d7f){_0x2a3620[_0x51a6('0x27')][_0x51a6('0x75')]=_0x459d7f[0x0];if(!_0x1091de[_0x51a6('0x5c')]['UserId'])return;return db[_0x51a6('0x76')][_0x51a6('0x5d')]({'where':{'id':_0x1091de[_0x51a6('0x5c')][_0x51a6('0x65')],'role':_0x51a6('0x77')},'attributes':['id',_0x51a6('0x3c'),'fullname',_0x51a6('0x78'),'internal'],'raw':!![]});}return null;})[_0x51a6('0x39')](function(_0x18681d){if(!_0x18681d)return null;_0x2a3620[_0x51a6('0x27')][_0x51a6('0x77')]=_0x18681d;return _0x2a3620;})['then'](function(_0x389f92){if(_0x389f92){if(_0x1091de[_0x51a6('0x5c')]['manual']){_0x2a3620[_0x51a6('0x27')]['interface']=util['format'](_0x51a6('0x79'),_0x1091de[_0x51a6('0x6c')][_0x51a6('0x3c')]);_0x2a3620[_0x51a6('0x27')][_0x51a6('0x7a')]=_0x2a3620[_0x51a6('0x7a')];_0x2a3620[_0x51a6('0x27')][_0x51a6('0x7b')]=_0x2a3620[_0x51a6('0x7a')];_0x2a3620[_0x51a6('0x27')][_0x51a6('0x7c')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x51a6('0x7d'),'message':_['merge'](_0x2a3620['message'],JSON[_0x51a6('0x7e')](_0x2a3620[_0x51a6('0x6a')][_0x51a6('0x7f')]))},client9002)['then'](function(){return _0x2a3620;});}return _0x2a3620;}return null;})[_0x51a6('0x39')](respondWithResult(_0x5b3f15,null))['catch'](handleError(_0x5b3f15,null));};var interaction_log=require(_0x51a6('0x13'))(_0x51a6('0x5e'));exports[_0x51a6('0x35')]=function(_0x347b93,_0x58c44d,_0x3f0c66){var _0x49eb83={'agent':{},'channel':_0x51a6('0x60')};if(_0x347b93['body']['id']){delete _0x347b93[_0x51a6('0x5c')]['id'];}_0x347b93[_0x51a6('0x5c')][_0x51a6('0x65')]=_0x347b93[_0x51a6('0x5c')][_0x51a6('0x65')]||_0x347b93['user']['id'];_0x49eb83[_0x51a6('0x77')]['id']=_0x347b93[_0x51a6('0x5c')][_0x51a6('0x65')];return db['ChatMessage'][_0x51a6('0x5d')]({'where':{'id':_0x347b93['params']['id'],'UserId':null}})[_0x51a6('0x39')](handleEntityNotFound(_0x58c44d,null))[_0x51a6('0x39')](function(_0x448289){if(_0x448289){_0x49eb83[_0x51a6('0x27')]=_0x448289[_0x51a6('0x66')]({'plain':!![]});return db[_0x51a6('0x67')][_0x51a6('0x5d')]({'where':{'id':_0x448289[_0x51a6('0x68')]}});}return null;})[_0x51a6('0x39')](handleEntityNotFound(_0x58c44d,null))[_0x51a6('0x39')](function(_0x5ef50c){if(_0x5ef50c){_0x49eb83['interaction']=_0x5ef50c[_0x51a6('0x66')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x347b93[_0x51a6('0x6c')]['id'],_0x347b93[_0x51a6('0x6c')]['name'],_0x347b93['user'][_0x51a6('0x6d')],_0x49eb83[_0x51a6('0x6a')]['id'],_0x347b93[_0x51a6('0x5c')]?JSON[_0x51a6('0x24')](_0x347b93[_0x51a6('0x5c')]):'null');return respondWithRpcPromise(_0x51a6('0x80'),'rejectMessage',_0x49eb83);}return null;})[_0x51a6('0x39')](function(_0x4cc61e){var _0x1db7ed=_0x51a6('0x81')+_0x4cc61e['message'][_0x51a6('0x71')];return db['sequelize'][_0x51a6('0x44')](_0x1db7ed,{'type':db[_0x51a6('0x73')]['QueryTypes'][_0x51a6('0x74')],'raw':!![]})['then'](function(_0xbfa416){return _0xbfa416;});})[_0x51a6('0x39')](function(_0xbc446e){if(_0xbc446e){_0x49eb83['message'][_0x51a6('0x75')]=_0xbc446e[0x0];if(!_0x347b93['body'][_0x51a6('0x65')])return;return db[_0x51a6('0x76')][_0x51a6('0x5d')]({'where':{'id':_0x347b93['body'][_0x51a6('0x65')],'role':_0x51a6('0x77')},'attributes':['id',_0x51a6('0x3c'),'fullname',_0x51a6('0x78'),'internal'],'raw':!![]});}return null;})[_0x51a6('0x39')](function(_0x392a03){if(!_0x392a03)return null;_0x49eb83[_0x51a6('0x27')][_0x51a6('0x77')]=_0x392a03;return _0x49eb83;})[_0x51a6('0x39')](function(_0x74eff8){if(_0x74eff8){_0x74eff8[_0x51a6('0x27')][_0x51a6('0x82')]=util[_0x51a6('0x63')]('SIP/%s',_0x347b93[_0x51a6('0x6c')][_0x51a6('0x3c')]);_0x74eff8['message'][_0x51a6('0x7a')]=_0x49eb83[_0x51a6('0x7a')];_0x74eff8[_0x51a6('0x27')][_0x51a6('0x7b')]=_0x49eb83[_0x51a6('0x7a')];_0x74eff8[_0x51a6('0x27')]['event']='reject';respondWithRpcPromise('EventManager',_0x51a6('0x83'),{'event':_0x51a6('0x84'),'message':_[_0x51a6('0x53')](_0x49eb83[_0x51a6('0x27')],JSON[_0x51a6('0x7e')](_0x49eb83[_0x51a6('0x6a')][_0x51a6('0x7f')]))},client9002);return _0x49eb83;}return null;})[_0x51a6('0x39')](respondWithResult(_0x58c44d,null))[_0x51a6('0x2a')](handleError(_0x58c44d,null));}; \ No newline at end of file +var _0x0a63=['create','body','update','destroy','describe','chat-interactions','accept','chat','read','format','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','QueryTypes','internal','interface','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','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','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','end','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','include','findAll','rows','show','params','keys','find'];(function(_0x2fd5e4,_0x1f80a2){var _0x1d9d38=function(_0x1fe481){while(--_0x1fe481){_0x2fd5e4['push'](_0x2fd5e4['shift']());}};_0x1d9d38(++_0x1f80a2);}(_0x0a63,0xb5));var _0x30a6=function(_0x5c49b4,_0x4d1512){_0x5c49b4=_0x5c49b4-0x0;var _0x54113d=_0x0a63[_0x5c49b4];return _0x54113d;};'use strict';var emlformat=require(_0x30a6('0x0'));var rimraf=require(_0x30a6('0x1'));var zipdir=require(_0x30a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30a6('0x3'));var moment=require('moment');var BPromise=require(_0x30a6('0x4'));var Mustache=require(_0x30a6('0x5'));var util=require(_0x30a6('0x6'));var path=require(_0x30a6('0x7'));var sox=require(_0x30a6('0x8'));var csv=require(_0x30a6('0x9'));var ejs=require(_0x30a6('0xa'));var fs=require('fs');var fs_extra=require(_0x30a6('0xb'));var _=require(_0x30a6('0xc'));var squel=require(_0x30a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x30a6('0xe'));var deskjs=require(_0x30a6('0xf'));var toCsv=require(_0x30a6('0x9'));var querystring=require(_0x30a6('0x10'));var Papa=require('papaparse');var Redis=require(_0x30a6('0x11'));var authService=require(_0x30a6('0x12'));var qs=require(_0x30a6('0x13'));var as=require(_0x30a6('0x14'));var hardwareService=require(_0x30a6('0x15'));var logger=require(_0x30a6('0x16'))(_0x30a6('0x17'));var utils=require(_0x30a6('0x18'));var config=require(_0x30a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x30a6('0x1a'))['db'];config['redis']=_[_0x30a6('0x1b')](config[_0x30a6('0x1c')],{'host':_0x30a6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x30a6('0x1e'))['register'](socket);var jayson=require(_0x30a6('0x1f'));var client=jayson[_0x30a6('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x30a6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53da8c,_0x253daa,_0x341865,_0x2b8e5c){return new BPromise(function(_0x3941b5,_0x4b5df5){var _0x433b27=_0x2b8e5c||client;return _0x433b27['request'](_0x53da8c,_0x341865)[_0x30a6('0x22')](function(_0x471583){logger[_0x30a6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x30a6('0x24'));logger[_0x30a6('0x25')](_0x30a6('0x26'),_0x253daa,'request\x20sent',JSON['stringify'](_0x471583));if(_0x471583[_0x30a6('0x27')]){if(_0x471583[_0x30a6('0x27')][_0x30a6('0x28')]===0x1f4){logger[_0x30a6('0x27')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x471583['error'][_0x30a6('0x29')]);return _0x4b5df5(_0x471583['error'][_0x30a6('0x29')]);}logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x471583[_0x30a6('0x27')]['message']);return _0x3941b5(_0x471583[_0x30a6('0x27')]['message']);}else{logger[_0x30a6('0x23')](_0x30a6('0x2a'),_0x253daa,'request\x20sent');_0x3941b5(_0x471583[_0x30a6('0x2b')][_0x30a6('0x29')]);}})[_0x30a6('0x2c')](function(_0x2d9889){logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x2d9889);_0x4b5df5(_0x2d9889);});});}function respondWithStatusCode(_0x48aee6,_0xf5640b){_0xf5640b=_0xf5640b||0xcc;return function(_0x1beb7e){if(_0x1beb7e){return _0x48aee6[_0x30a6('0x2d')](_0xf5640b);}return _0x48aee6[_0x30a6('0x2e')](_0xf5640b)['end']();};}function respondWithResult(_0x49e7a7,_0x313d92){_0x313d92=_0x313d92||0xc8;return function(_0x113934){if(_0x113934){return _0x49e7a7[_0x30a6('0x2e')](_0x313d92)['json'](_0x113934);}};}function respondWithFilteredResult(_0x4a3053,_0xe08c88){return function(_0x68fd68){if(_0x68fd68){var _0x535ee0=typeof _0xe08c88[_0x30a6('0x2f')]===_0x30a6('0x30')&&typeof _0xe08c88['limit']===_0x30a6('0x30');var _0x2f9092=_0x68fd68[_0x30a6('0x31')];var _0x8599e7=_0x535ee0?0x0:_0xe08c88[_0x30a6('0x2f')];var _0xe04b23=_0x535ee0?_0x68fd68[_0x30a6('0x31')]:_0xe08c88[_0x30a6('0x2f')]+_0xe08c88[_0x30a6('0x32')];var _0x1b82ae;if(_0xe04b23>=_0x2f9092){_0xe04b23=_0x2f9092;_0x1b82ae=0xc8;}else{_0x1b82ae=0xce;}_0x4a3053['status'](_0x1b82ae);return _0x4a3053[_0x30a6('0x33')](_0x30a6('0x34'),_0x8599e7+'-'+_0xe04b23+'/'+_0x2f9092)['json'](_0x68fd68);}return null;};}function patchUpdates(_0x2d8fcd){return function(_0x1000b4){try{jsonpatch[_0x30a6('0x35')](_0x1000b4,_0x2d8fcd,!![]);}catch(_0x149e85){return BPromise[_0x30a6('0x36')](_0x149e85);}return _0x1000b4['save']();};}function saveUpdates(_0x41a4bf,_0x5b331d){return function(_0x2c54a9){if(_0x2c54a9){return _0x2c54a9['update'](_0x41a4bf)[_0x30a6('0x22')](function(_0x59f7fd){return _0x59f7fd;});}return null;};}function removeEntity(_0x1e0526,_0x25c3ee){return function(_0x4c810d){if(_0x4c810d){return _0x4c810d['destroy']()[_0x30a6('0x22')](function(){_0x1e0526[_0x30a6('0x2e')](0xcc)[_0x30a6('0x37')]();});}};}function handleEntityNotFound(_0x1841e1,_0x783e8){return function(_0x5016ca){if(!_0x5016ca){_0x1841e1['sendStatus'](0x194);}return _0x5016ca;};}function handleError(_0x17784e,_0x55fff1){_0x55fff1=_0x55fff1||0x1f4;return function(_0x592693){logger[_0x30a6('0x27')](_0x592693[_0x30a6('0x38')]);if(_0x592693[_0x30a6('0x39')]){delete _0x592693[_0x30a6('0x39')];}_0x17784e['status'](_0x55fff1)[_0x30a6('0x3a')](_0x592693);};}exports[_0x30a6('0x3b')]=function(_0x224e4d,_0x1ef7ac){var _0x9a5167={},_0xc4394f={},_0x49952a={'count':0x0,'rows':[]};var _0x67ccbd=_[_0x30a6('0x3c')](db['ChatMessage'][_0x30a6('0x3d')],function(_0x272acb){return{'name':_0x272acb['fieldName'],'type':_0x272acb['type'][_0x30a6('0x3e')]};});_0xc4394f[_0x30a6('0x3f')]=_[_0x30a6('0x3c')](_0x67ccbd,'name');_0xc4394f[_0x30a6('0x40')]=_['keys'](_0x224e4d['query']);_0xc4394f[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0xc4394f[_0x30a6('0x3f')],_0xc4394f[_0x30a6('0x40')]);_0x9a5167[_0x30a6('0x43')]=_['intersection'](_0xc4394f[_0x30a6('0x3f')],qs[_0x30a6('0x44')](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x44')]));_0x9a5167['attributes']=_0x9a5167[_0x30a6('0x43')][_0x30a6('0x45')]?_0x9a5167[_0x30a6('0x43')]:_0xc4394f[_0x30a6('0x3f')];if(!_0x224e4d['query'][_0x30a6('0x46')](_0x30a6('0x47'))){_0x9a5167[_0x30a6('0x32')]=qs[_0x30a6('0x32')](_0x224e4d['query'][_0x30a6('0x32')]);_0x9a5167['offset']=qs['offset'](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x2f')]);}_0x9a5167[_0x30a6('0x48')]=qs[_0x30a6('0x49')](_0x224e4d[_0x30a6('0x40')]['sort']);_0x9a5167[_0x30a6('0x4a')]=qs[_0x30a6('0x41')](_[_0x30a6('0x4b')](_0x224e4d[_0x30a6('0x40')],_0xc4394f['filters']),_0x67ccbd);if(_0x224e4d[_0x30a6('0x40')]['filter']){_0x9a5167[_0x30a6('0x4a')]=_[_0x30a6('0x4c')](_0x9a5167[_0x30a6('0x4a')],{'$or':_['map'](_0x67ccbd,function(_0x167af4){if(_0x167af4[_0x30a6('0x4d')]!==_0x30a6('0x4e')){var _0x2318e6={};_0x2318e6[_0x167af4['name']]={'$like':'%'+_0x224e4d['query'][_0x30a6('0x4f')]+'%'};return _0x2318e6;}})});}_0x9a5167=_[_0x30a6('0x4c')]({},_0x9a5167,_0x224e4d[_0x30a6('0x50')]);var _0xeacced={'where':_0x9a5167[_0x30a6('0x4a')]};return db[_0x30a6('0x51')][_0x30a6('0x31')](_0xeacced)[_0x30a6('0x22')](function(_0x1332a1){_0x49952a[_0x30a6('0x31')]=_0x1332a1;if(_0x224e4d[_0x30a6('0x40')]['includeAll']){_0x9a5167[_0x30a6('0x52')]=[{'all':!![]}];}return db[_0x30a6('0x51')][_0x30a6('0x53')](_0x9a5167);})[_0x30a6('0x22')](function(_0x2a8bca){_0x49952a[_0x30a6('0x54')]=_0x2a8bca;return _0x49952a;})[_0x30a6('0x22')](respondWithFilteredResult(_0x1ef7ac,_0x9a5167))[_0x30a6('0x2c')](handleError(_0x1ef7ac,null));};exports[_0x30a6('0x55')]=function(_0x13ae56,_0x4aaa67){var _0x19ba56={'raw':!![],'where':{'id':_0x13ae56[_0x30a6('0x56')]['id']}},_0x229ea0={};_0x229ea0[_0x30a6('0x3f')]=_[_0x30a6('0x57')](db[_0x30a6('0x51')][_0x30a6('0x3d')]);_0x229ea0[_0x30a6('0x40')]=_[_0x30a6('0x57')](_0x13ae56['query']);_0x229ea0[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0x229ea0[_0x30a6('0x3f')],_0x229ea0[_0x30a6('0x40')]);_0x19ba56[_0x30a6('0x43')]=_[_0x30a6('0x42')](_0x229ea0['model'],qs[_0x30a6('0x44')](_0x13ae56[_0x30a6('0x40')]['fields']));_0x19ba56[_0x30a6('0x43')]=_0x19ba56[_0x30a6('0x43')][_0x30a6('0x45')]?_0x19ba56[_0x30a6('0x43')]:_0x229ea0[_0x30a6('0x3f')];if(_0x13ae56[_0x30a6('0x40')]['includeAll']){_0x19ba56[_0x30a6('0x52')]=[{'all':!![]}];}_0x19ba56=_['merge']({},_0x19ba56,_0x13ae56[_0x30a6('0x50')]);return db[_0x30a6('0x51')][_0x30a6('0x58')](_0x19ba56)[_0x30a6('0x22')](handleEntityNotFound(_0x4aaa67,null))['then'](respondWithResult(_0x4aaa67,null))[_0x30a6('0x2c')](handleError(_0x4aaa67,null));};exports[_0x30a6('0x59')]=function(_0x258214,_0x2abc17){return db[_0x30a6('0x51')][_0x30a6('0x59')](_0x258214[_0x30a6('0x5a')],{})[_0x30a6('0x22')](respondWithResult(_0x2abc17,0xc9))['catch'](handleError(_0x2abc17,null));};exports[_0x30a6('0x5b')]=function(_0x38caf3,_0x5c5c57){if(_0x38caf3[_0x30a6('0x5a')]['id']){delete _0x38caf3[_0x30a6('0x5a')]['id'];}return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x38caf3[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x5c5c57,null))[_0x30a6('0x22')](saveUpdates(_0x38caf3[_0x30a6('0x5a')],null))[_0x30a6('0x22')](respondWithResult(_0x5c5c57,null))[_0x30a6('0x2c')](handleError(_0x5c5c57,null));};exports[_0x30a6('0x5c')]=function(_0x323008,_0x470c78){return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x323008[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x470c78,null))['then'](removeEntity(_0x470c78,null))['catch'](handleError(_0x470c78,null));};exports[_0x30a6('0x5d')]=function(_0x919297,_0x2d3c2d){return db[_0x30a6('0x51')][_0x30a6('0x5d')]()[_0x30a6('0x22')](respondWithResult(_0x2d3c2d,null))[_0x30a6('0x2c')](handleError(_0x2d3c2d,null));};var interaction_log=require(_0x30a6('0x16'))(_0x30a6('0x5e'));exports[_0x30a6('0x5f')]=function(_0x359074,_0x1c35c6,_0x583527){var _0x1020ed={'agent':{},'channel':_0x30a6('0x60')};if(_0x359074[_0x30a6('0x5a')]['id']){delete _0x359074[_0x30a6('0x5a')]['id'];}_0x359074[_0x30a6('0x5a')][_0x30a6('0x61')]=!![];_0x359074[_0x30a6('0x5a')]['readAt']=moment()[_0x30a6('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')]=_0x359074['body']['UserId']||_0x359074[_0x30a6('0x64')]['id'];_0x1020ed[_0x30a6('0x65')]['id']=_0x359074['body'][_0x30a6('0x63')];return db['ChatMessage']['find']({'where':{'id':_0x359074[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))[_0x30a6('0x22')](saveUpdates(_0x359074[_0x30a6('0x5a')],null))[_0x30a6('0x22')](function(_0x19e6c5){if(_0x19e6c5){_0x1020ed[_0x30a6('0x29')]=_0x19e6c5[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x19e6c5['ChatInteractionId']}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))['then'](function(_0xa7fc91){if(_0xa7fc91){return _0xa7fc91[_0x30a6('0x5b')]({'UserId':_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')],'read1stAt':_[_0x30a6('0x68')](_0xa7fc91[_0x30a6('0x69')])?moment()[_0x30a6('0x62')](_0x30a6('0x6a')):undefined});}return null;})[_0x30a6('0x22')](function(_0x60db73){if(_0x60db73){_0x1020ed[_0x30a6('0x6b')]=_0x60db73[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x6c'),_0x359074[_0x30a6('0x64')]['id'],_0x359074['user'][_0x30a6('0x39')],_0x359074[_0x30a6('0x64')][_0x30a6('0x6d')],_0x1020ed[_0x30a6('0x6b')]['id'],_0x359074[_0x30a6('0x5a')]?JSON['stringify'](_0x359074[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x30a6('0x6f'),_0x1020ed);}return null;})['then'](function(_0xdff0a9){var _0x381150=_0x30a6('0x70')+_0xdff0a9[_0x30a6('0x29')]['ContactId'];return db[_0x30a6('0x71')][_0x30a6('0x40')](_0x381150,{'type':db['Sequelize']['QueryTypes'][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x2868b0){return _0x2868b0;});})[_0x30a6('0x22')](function(_0x24689f){if(_0x24689f){_0x1020ed[_0x30a6('0x29')][_0x30a6('0x73')]=_0x24689f[0x0];if(!_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')])return;return db[_0x30a6('0x74')][_0x30a6('0x58')]({'where':{'id':_0x359074['body'][_0x30a6('0x63')],'role':_0x30a6('0x65')},'attributes':['id',_0x30a6('0x39'),_0x30a6('0x75'),_0x30a6('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x504a81){if(!_0x504a81)return null;_0x1020ed[_0x30a6('0x29')]['agent']=_0x504a81;return _0x1020ed;})['then'](function(_0x4f94cb){if(_0x4f94cb){if(_0x359074['body'][_0x30a6('0x77')]){_0x1020ed['message']['interface']=util[_0x30a6('0x62')](_0x30a6('0x78'),_0x359074[_0x30a6('0x64')][_0x30a6('0x39')]);_0x1020ed[_0x30a6('0x29')][_0x30a6('0x79')]=_0x1020ed['channel'];_0x1020ed[_0x30a6('0x29')][_0x30a6('0x7a')]=_0x1020ed[_0x30a6('0x79')];_0x1020ed[_0x30a6('0x29')]['event']=_0x30a6('0x5f');return respondWithRpcPromise('EventManager',_0x30a6('0x7b'),{'event':'acceptmessage','message':_['merge'](_0x1020ed['message'],JSON[_0x30a6('0x7c')](_0x1020ed[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002)[_0x30a6('0x22')](function(){return _0x1020ed;});}return _0x1020ed;}return null;})[_0x30a6('0x22')](respondWithResult(_0x1c35c6,null))[_0x30a6('0x2c')](handleError(_0x1c35c6,null));};var interaction_log=require('../../config/logger')(_0x30a6('0x5e'));exports['reject']=function(_0x367a03,_0x26888a,_0x124a82){var _0x4599f4={'agent':{},'channel':_0x30a6('0x60')};if(_0x367a03['body']['id']){delete _0x367a03[_0x30a6('0x5a')]['id'];}_0x367a03[_0x30a6('0x5a')]['UserId']=_0x367a03['body'][_0x30a6('0x63')]||_0x367a03[_0x30a6('0x64')]['id'];_0x4599f4[_0x30a6('0x65')]['id']=_0x367a03[_0x30a6('0x5a')]['UserId'];return db[_0x30a6('0x51')]['find']({'where':{'id':_0x367a03[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))['then'](function(_0x48cd4f){if(_0x48cd4f){_0x4599f4[_0x30a6('0x29')]=_0x48cd4f[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x48cd4f[_0x30a6('0x7e')]}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))[_0x30a6('0x22')](function(_0x53aa02){if(_0x53aa02){_0x4599f4[_0x30a6('0x6b')]=_0x53aa02[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x7f'),_0x367a03['user']['id'],_0x367a03[_0x30a6('0x64')][_0x30a6('0x39')],_0x367a03['user'][_0x30a6('0x6d')],_0x4599f4[_0x30a6('0x6b')]['id'],_0x367a03[_0x30a6('0x5a')]?JSON['stringify'](_0x367a03[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise(_0x30a6('0x80'),'rejectMessage',_0x4599f4);}return null;})['then'](function(_0x4be72a){var _0x291b66=_0x30a6('0x70')+_0x4be72a['message'][_0x30a6('0x81')];return db['sequelize'][_0x30a6('0x40')](_0x291b66,{'type':db['Sequelize'][_0x30a6('0x82')][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x197df9){return _0x197df9;});})['then'](function(_0x31753e){if(_0x31753e){_0x4599f4['message'][_0x30a6('0x73')]=_0x31753e[0x0];if(!_0x367a03['body'][_0x30a6('0x63')])return;return db['User'][_0x30a6('0x58')]({'where':{'id':_0x367a03[_0x30a6('0x5a')][_0x30a6('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0x30a6('0x76'),_0x30a6('0x83')],'raw':!![]});}return null;})[_0x30a6('0x22')](function(_0x1b7757){if(!_0x1b7757)return null;_0x4599f4[_0x30a6('0x29')][_0x30a6('0x65')]=_0x1b7757;return _0x4599f4;})[_0x30a6('0x22')](function(_0x2cbad5){if(_0x2cbad5){_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x84')]=util[_0x30a6('0x62')]('SIP/%s',_0x367a03['user'][_0x30a6('0x39')]);_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x79')]=_0x4599f4['channel'];_0x2cbad5['message']['motionChannel']=_0x4599f4['channel'];_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x85')]=_0x30a6('0x36');respondWithRpcPromise(_0x30a6('0x7b'),_0x30a6('0x7b'),{'event':_0x30a6('0x86'),'message':_[_0x30a6('0x4c')](_0x4599f4[_0x30a6('0x29')],JSON['parse'](_0x4599f4[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002);return _0x4599f4;}return null;})[_0x30a6('0x22')](respondWithResult(_0x26888a,null))['catch'](handleError(_0x26888a,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 155411f..b05a034 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 _0x30de=['events','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x30de,0x75));var _0xe30d=function(_0xb0bb25,_0x3ec494){_0xb0bb25=_0xb0bb25-0x0;var _0x19a4d0=_0x30de[_0xb0bb25];return _0x19a4d0;};'use strict';var EventEmitter=require(_0xe30d('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xe30d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe30d('0x2')](0x0);var events={'afterCreate':_0xe30d('0x3'),'afterUpdate':_0xe30d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f3e56){return function(_0x586581,_0x5275fc,_0x175cc0){ChatMessageEvents[_0xe30d('0x5')](_0x2f3e56+':'+_0x586581['id'],_0x586581);ChatMessageEvents[_0xe30d('0x5')](_0x2f3e56,_0x586581);_0x175cc0(null);};}for(var e in events){if(events[_0xe30d('0x6')](e)){var event=events[e];ChatMessage[_0xe30d('0x7')](e,emitEvent(event));}}module[_0xe30d('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xd069=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x593190,_0x4c846c){var _0x1a62ed=function(_0x506d3c){while(--_0x506d3c){_0x593190['push'](_0x593190['shift']());}};_0x1a62ed(++_0x4c846c);}(_0xd069,0x1e8));var _0x9d06=function(_0x2a9951,_0xfd2eb3){_0x2a9951=_0x2a9951-0x0;var _0x31592c=_0xd069[_0x2a9951];return _0x31592c;};'use strict';var EventEmitter=require(_0x9d06('0x0'));var ChatMessage=require(_0x9d06('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9d06('0x2')](0x0);var events={'afterCreate':_0x9d06('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa48a54){return function(_0x754f45,_0x1cc8a8,_0x5836dd){ChatMessageEvents[_0x9d06('0x4')](_0xa48a54+':'+_0x754f45['id'],_0x754f45);ChatMessageEvents[_0x9d06('0x4')](_0xa48a54,_0x754f45);_0x5836dd(null);};}for(var e in events){if(events[_0x9d06('0x5')](e)){var event=events[e];ChatMessage[_0x9d06('0x6')](e,emitEvent(event));}}module[_0x9d06('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 57d9c11..0ef77b8 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 _0xe2a3=['util','moment','bluebird','request-promise','../../config/environment','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret','UserId','findOne','ChatInteractionId','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xe2a3,0x67));var _0x3e2a=function(_0x1b58a9,_0x2df346){_0x1b58a9=_0x1b58a9-0x0;var _0x3daa9f=_0xe2a3[_0x1b58a9];return _0x3daa9f;};'use strict';var _=require(_0x3e2a('0x0'));var util=require(_0x3e2a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3e2a('0x2'));var BPromise=require(_0x3e2a('0x3'));var rp=require(_0x3e2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e2a('0x5'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4fb263,_0x3c26d0){return _0x4fb263['define'](_0x3e2a('0x6'),attributes,{'tableName':_0x3e2a('0x7'),'paranoid':![],'indexes':[{'name':_0x3e2a('0x8'),'fields':[_0x3e2a('0x9')],'type':_0x3e2a('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c26ee,_0x3f4e50,_0x3ad5f6){var _0x19dcaa=_0x4fb263[_0x3e2a('0xb')];var _0x5de13f=_0x4c26ee[_0x3e2a('0xc')]({'plain':!![]});if(_0x5de13f[_0x3e2a('0xd')]['toLowerCase']()==='in'||_0x5de13f['direction']['toLowerCase']()===_0x3e2a('0xe')&&!_0x5de13f[_0x3e2a('0xf')]&&!_['isNil'](_0x5de13f[_0x3e2a('0x10')])){_0x19dcaa['ChatInteraction'][_0x3e2a('0x11')]({'where':{'id':_0x5de13f[_0x3e2a('0x12')]}})['then'](function(_0x2bc395){if(_0x2bc395){_0x2bc395[_0x3e2a('0x13')]({'lastMsgAt':_0x5de13f[_0x3e2a('0x14')],'lastMsgDirection':_0x5de13f['direction'][_0x3e2a('0x15')]()});}})[_0x3e2a('0x16')](function(_0x28683b){console[_0x3e2a('0x17')](_0x28683b);});}_0x3ad5f6();}},'charset':_0x3e2a('0x18'),'collate':_0x3e2a('0x19')});}; \ No newline at end of file +var _0x43f3=['findOne','ChatInteractionId','update','createdAt','utf8mb4','util','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x1c992f,_0x2adab3){var _0x1e9eb6=function(_0x321c15){while(--_0x321c15){_0x1c992f['push'](_0x1c992f['shift']());}};_0x1e9eb6(++_0x2adab3);}(_0x43f3,0x16d));var _0x343f=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x43f3[_0x1d87fc];return _0x492b56;};'use strict';var _=require('lodash');var util=require(_0x343f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x343f('0x1'));var rp=require(_0x343f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x343f('0x3'));var config=require(_0x343f('0x4'));var attributes=require(_0x343f('0x5'));module[_0x343f('0x6')]=function(_0x5e7e30,_0x4bcbf7){return _0x5e7e30['define'](_0x343f('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x343f('0x8'),'fields':[_0x343f('0x9')],'type':_0x343f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bef74,_0x541771,_0x46e2e3){var _0x4e3edd=_0x5e7e30[_0x343f('0xb')];var _0xe6f334=_0x3bef74['get']({'plain':!![]});if(_0xe6f334['direction']['toLowerCase']()==='in'||_0xe6f334[_0x343f('0xc')][_0x343f('0xd')]()===_0x343f('0xe')&&!_0xe6f334[_0x343f('0xf')]&&!_[_0x343f('0x10')](_0xe6f334[_0x343f('0x11')])){_0x4e3edd[_0x343f('0x12')][_0x343f('0x13')]({'where':{'id':_0xe6f334[_0x343f('0x14')]}})['then'](function(_0x160e9e){if(_0x160e9e){_0x160e9e[_0x343f('0x15')]({'lastMsgAt':_0xe6f334[_0x343f('0x16')],'lastMsgDirection':_0xe6f334['direction'][_0x343f('0xd')]()});}})['catch'](function(_0x350504){console['error'](_0x350504);});}_0x46e2e3();}},'charset':_0x343f('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e9cf2f9..10982a3 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 _0xec14=['then','info','debug','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','CreateChatMessage','ChatMessage','create','options','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','request'];(function(_0xee1b80,_0x1b8b42){var _0x2e3409=function(_0xe62e67){while(--_0xe62e67){_0xee1b80['push'](_0xee1b80['shift']());}};_0x2e3409(++_0x1b8b42);}(_0xec14,0x131));var _0x4ec1=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xec14[_0x25bea7];return _0x175952;};'use strict';var _=require('lodash');var util=require(_0x4ec1('0x0'));var moment=require(_0x4ec1('0x1'));var BPromise=require(_0x4ec1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ec1('0x3'));var db=require(_0x4ec1('0x4'))['db'];var utils=require(_0x4ec1('0x5'));var logger=require(_0x4ec1('0x6'))(_0x4ec1('0x7'));var config=require(_0x4ec1('0x8'));var jayson=require(_0x4ec1('0x9'));var client=jayson[_0x4ec1('0xa')]['http']({'port':0x232a});config[_0x4ec1('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ec1('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2effdf,_0x5b1770,_0x205bb5){return new BPromise(function(_0x543efa,_0x261d41){return client[_0x4ec1('0xd')](_0x2effdf,_0x205bb5)[_0x4ec1('0xe')](function(_0x57e63e){logger[_0x4ec1('0xf')]('ChatMessage,\x20%s,\x20%s',_0x5b1770,'request\x20sent');logger[_0x4ec1('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5b1770,_0x4ec1('0x11'),JSON[_0x4ec1('0x12')](_0x57e63e));if(_0x57e63e[_0x4ec1('0x13')]){if(_0x57e63e['error'][_0x4ec1('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5b1770,_0x57e63e['error'][_0x4ec1('0x15')]);return _0x261d41(_0x57e63e[_0x4ec1('0x13')]['message']);}logger[_0x4ec1('0x13')](_0x4ec1('0x16'),_0x5b1770,_0x57e63e[_0x4ec1('0x13')]['message']);return _0x543efa(_0x57e63e['error'][_0x4ec1('0x15')]);}else{logger[_0x4ec1('0xf')](_0x4ec1('0x16'),_0x5b1770,'request\x20sent');_0x543efa(_0x57e63e[_0x4ec1('0x17')]['message']);}})[_0x4ec1('0x18')](function(_0x1c1ffe){logger[_0x4ec1('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5b1770,_0x1c1ffe);_0x261d41(_0x1c1ffe);});});}exports[_0x4ec1('0x19')]=function(_0x2cf15f){var _0x8766cd=this;return new Promise(function(_0x205e58,_0x5cfad0){return db[_0x4ec1('0x1a')][_0x4ec1('0x1b')](_0x2cf15f['body'],{'raw':_0x2cf15f[_0x4ec1('0x1c')]?_0x2cf15f['options']['raw']===undefined?!![]:![]:!![]})[_0x4ec1('0xe')](function(_0xa7d43a){logger[_0x4ec1('0xf')](_0x4ec1('0x19'),_0x2cf15f);logger[_0x4ec1('0x10')](_0x4ec1('0x19'),_0x2cf15f,JSON['stringify'](_0xa7d43a));_0x205e58(_0xa7d43a);})[_0x4ec1('0x18')](function(_0xbf95a7){logger[_0x4ec1('0x13')](_0x4ec1('0x19'),_0xbf95a7[_0x4ec1('0x15')],_0x2cf15f);_0x5cfad0(_0x8766cd[_0x4ec1('0x13')](0x1f4,_0xbf95a7[_0x4ec1('0x15')]));});});}; \ No newline at end of file +var _0x66ab=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x66ab,0x128));var _0xb66a=function(_0x468238,_0x392f32){_0x468238=_0x468238-0x0;var _0x43b942=_0x66ab[_0x468238];return _0x43b942;};'use strict';var _=require(_0xb66a('0x0'));var util=require(_0xb66a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb66a('0x2'));var fs=require('fs');var Redis=require(_0xb66a('0x3'));var db=require(_0xb66a('0x4'))['db'];var utils=require(_0xb66a('0x5'));var logger=require(_0xb66a('0x6'))(_0xb66a('0x7'));var config=require(_0xb66a('0x8'));var jayson=require(_0xb66a('0x9'));var client=jayson['client'][_0xb66a('0xa')]({'port':0x232a});config[_0xb66a('0xb')]=_[_0xb66a('0xc')](config[_0xb66a('0xb')],{'host':_0xb66a('0xd'),'port':0x18eb});var socket=require(_0xb66a('0xe'))(new Redis(config['redis']));require(_0xb66a('0xf'))[_0xb66a('0x10')](socket);function respondWithRpcPromise(_0x5c0e56,_0x4e459a,_0x470f22){return new BPromise(function(_0x4e1fbd,_0x4cd1e8){return client[_0xb66a('0x11')](_0x5c0e56,_0x470f22)[_0xb66a('0x12')](function(_0x3fc43a){logger[_0xb66a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4e459a,'request\x20sent');logger[_0xb66a('0x14')](_0xb66a('0x15'),_0x4e459a,_0xb66a('0x16'),JSON[_0xb66a('0x17')](_0x3fc43a));if(_0x3fc43a[_0xb66a('0x18')]){if(_0x3fc43a['error'][_0xb66a('0x19')]===0x1f4){logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);return _0x4cd1e8(_0x3fc43a['error'][_0xb66a('0x1b')]);}logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a['error'][_0xb66a('0x1b')]);return _0x4e1fbd(_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);}else{logger[_0xb66a('0x13')](_0xb66a('0x1a'),_0x4e459a,_0xb66a('0x16'));_0x4e1fbd(_0x3fc43a[_0xb66a('0x1c')][_0xb66a('0x1b')]);}})[_0xb66a('0x1d')](function(_0x17b962){logger['error'](_0xb66a('0x1a'),_0x4e459a,_0x17b962);_0x4cd1e8(_0x17b962);});});}exports[_0xb66a('0x1e')]=function(_0xd82c99){var _0x11c90f=this;return new Promise(function(_0x541aab,_0x3c8f29){return db[_0xb66a('0x1f')]['create'](_0xd82c99[_0xb66a('0x20')],{'raw':_0xd82c99[_0xb66a('0x21')]?_0xd82c99[_0xb66a('0x21')][_0xb66a('0x22')]===undefined?!![]:![]:!![]})[_0xb66a('0x12')](function(_0x2f5d1a){logger['info'](_0xb66a('0x1e'),_0xd82c99);logger[_0xb66a('0x14')](_0xb66a('0x1e'),_0xd82c99,JSON[_0xb66a('0x17')](_0x2f5d1a));_0x541aab(_0x2f5d1a);})[_0xb66a('0x1d')](function(_0x1090b6){logger[_0xb66a('0x18')](_0xb66a('0x1e'),_0x1090b6[_0xb66a('0x1b')],_0xd82c99);_0x3c8f29(_0x11c90f['error'](0x1f4,_0x1090b6[_0xb66a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index efd9894..5a4df36 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 _0x8a8b=['update','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x5a3a35,_0x4c386d){var _0x772e51=function(_0x42bf15){while(--_0x42bf15){_0x5a3a35['push'](_0x5a3a35['shift']());}};_0x772e51(++_0x4c386d);}(_0x8a8b,0xae));var _0xb8a8=function(_0x2b51eb,_0x26e2c5){_0x2b51eb=_0x2b51eb-0x0;var _0x280920=_0x8a8b[_0x2b51eb];return _0x280920;};'use strict';var ChatMessageEvents=require(_0xb8a8('0x0'));var events=['save','remove',_0xb8a8('0x1')];function createListener(_0x308da3,_0x4f56d4){return function(_0x13bc8b){_0x4f56d4['emit'](_0x308da3,_0x13bc8b);};}function removeListener(_0xca9854,_0x4fe301){return function(){ChatMessageEvents[_0xb8a8('0x2')](_0xca9854,_0x4fe301);};}exports[_0xb8a8('0x3')]=function(_0xcca5ca){for(var _0x578e1b=0x0,_0x37e48d=events['length'];_0x578e1b<_0x37e48d;_0x578e1b++){var _0x32d542=events[_0x578e1b];var _0x4c46e9=createListener(_0xb8a8('0x4')+_0x32d542,_0xcca5ca);ChatMessageEvents['on'](_0x32d542,_0x4c46e9);}}; \ No newline at end of file +var _0x1670=['./chatMessage.events','save','update','emit','register','length','chatMessage:'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x1670,0x9a));var _0x0167=function(_0x9758d1,_0x120d87){_0x9758d1=_0x9758d1-0x0;var _0x479675=_0x1670[_0x9758d1];return _0x479675;};'use strict';var ChatMessageEvents=require(_0x0167('0x0'));var events=[_0x0167('0x1'),'remove',_0x0167('0x2')];function createListener(_0x4dc6f6,_0x1c7a08){return function(_0x45bbfd){_0x1c7a08[_0x0167('0x3')](_0x4dc6f6,_0x45bbfd);};}function removeListener(_0x6f87ae,_0x5786d8){return function(){ChatMessageEvents['removeListener'](_0x6f87ae,_0x5786d8);};}exports[_0x0167('0x4')]=function(_0x1ae650){for(var _0x295e51=0x0,_0x3e1507=events[_0x0167('0x5')];_0x295e51<_0x3e1507;_0x295e51++){var _0x149956=events[_0x295e51];var _0xcdfc5=createListener(_0x0167('0x6')+_0x149956,_0x1ae650);ChatMessageEvents['on'](_0x149956,_0xcdfc5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e24739d..f95c2a3 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 _0x6f49=['../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','chatmessage:create','put','accept','/:id/reject','reject','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x440d29,_0x1291bc){var _0x24b5b3=function(_0x25177e){while(--_0x25177e){_0x440d29['push'](_0x440d29['shift']());}};_0x24b5b3(++_0x1291bc);}(_0x6f49,0x16b));var _0x96f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96f4('0x0'));var timeout=require('connect-timeout');var express=require(_0x96f4('0x1'));var router=express['Router']();var fs_extra=require(_0x96f4('0x2'));var auth=require(_0x96f4('0x3'));var interaction=require(_0x96f4('0x4'));var config=require(_0x96f4('0x5'));var controller=require(_0x96f4('0x6'));router['get']('/',auth[_0x96f4('0x7')](),controller[_0x96f4('0x8')]);router[_0x96f4('0x9')](_0x96f4('0xa'),auth[_0x96f4('0x7')](),controller['describe']);router[_0x96f4('0x9')](_0x96f4('0xb'),auth[_0x96f4('0x7')](),controller[_0x96f4('0xc')]);router[_0x96f4('0xd')]('/',auth[_0x96f4('0x7')](),interaction[_0x96f4('0xe')]('chat',_0x96f4('0xf')),controller['create']);router[_0x96f4('0x10')]('/:id',controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x96f4('0x11')]);router[_0x96f4('0x10')](_0x96f4('0x12'),auth[_0x96f4('0x7')](),controller[_0x96f4('0x13')]);router[_0x96f4('0x14')](_0x96f4('0xb'),auth[_0x96f4('0x7')](),controller[_0x96f4('0x15')]);module[_0x96f4('0x16')]=router; \ No newline at end of file +var _0xb64b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb64b,0x1c3));var _0xbb64=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xb64b[_0xc6b104];return _0x1c6fce;};'use strict';var multer=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var path=require(_0xbb64('0x2'));var timeout=require(_0xbb64('0x3'));var express=require(_0xbb64('0x4'));var router=express[_0xbb64('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb64('0x7'));var controller=require(_0xbb64('0x8'));router[_0xbb64('0x9')]('/',auth[_0xbb64('0xa')](),controller[_0xbb64('0xb')]);router['get'](_0xbb64('0xc'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xd')]);router[_0xbb64('0x9')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xf')]);router['post']('/',auth[_0xbb64('0xa')](),interaction['tracked'](_0xbb64('0x10'),_0xbb64('0x11')),controller[_0xbb64('0x12')]);router['put'](_0xbb64('0xe'),controller[_0xbb64('0x13')]);router[_0xbb64('0x14')](_0xbb64('0x15'),auth['isAuthenticated'](),controller[_0xbb64('0x16')]);router[_0xbb64('0x14')](_0xbb64('0x17'),auth['isAuthenticated'](),controller[_0xbb64('0x18')]);router[_0xbb64('0x19')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0x1a')]);module[_0xbb64('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4b752fb..90dacfe 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 _0x34cb=['medium','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x34cb,0x177));var _0xb34c=function(_0x5688f0,_0x3fce94){_0x5688f0=_0x5688f0-0x0;var _0x15121b=_0x34cb[_0x5688f0];return _0x15121b;};'use strict';var Sequelize=require(_0xb34c('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb34c('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x15fe=['sequelize','exports','TEXT','medium'];(function(_0x2f31f6,_0x3b03f0){var _0x3ed300=function(_0x59f294){while(--_0x59f294){_0x2f31f6['push'](_0x2f31f6['shift']());}};_0x3ed300(++_0x3b03f0);}(_0x15fe,0x158));var _0xe15f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15fe[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xe15f('0x0'));module[_0xe15f('0x1')]={'body':{'type':Sequelize[_0xe15f('0x2')](_0xe15f('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 45be970..4878788 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x23b9be,_0xebb08f){var _0x3f7d28=function(_0x49265e){while(--_0x49265e){_0x23b9be['push'](_0x23b9be['shift']());}};_0x3f7d28(++_0xebb08f);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7a54,0x106));var _0x47a5=function(_0x10495d,_0x531159){_0x10495d=_0x10495d-0x0;var _0x43dc6e=_0x7a54[_0x10495d];return _0x43dc6e;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0f16f28..298ed06 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 _0x66f5=['../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x6306d2,_0x4ae91b){var _0x4d13aa=function(_0x3bfb2a){while(--_0x3bfb2a){_0x6306d2['push'](_0x6306d2['shift']());}};_0x4d13aa(++_0x4ae91b);}(_0x66f5,0x158));var _0x566f=function(_0x1ac74f,_0x56b3b7){_0x1ac74f=_0x1ac74f-0x0;var _0x1d9a1e=_0x66f5[_0x1ac74f];return _0x1d9a1e;};'use strict';var _=require(_0x566f('0x0'));var util=require(_0x566f('0x1'));var logger=require(_0x566f('0x2'))('api');var moment=require(_0x566f('0x3'));var BPromise=require(_0x566f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x566f('0x5'));var rimraf=require('rimraf');var config=require(_0x566f('0x6'));var attributes=require(_0x566f('0x7'));module[_0x566f('0x8')]=function(_0x51f41c,_0x336229){return _0x51f41c[_0x566f('0x9')](_0x566f('0xa'),attributes,{'tableName':_0x566f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x566f('0xc'),'collate':_0x566f('0xd')});}; \ No newline at end of file +var _0x5ed6=['request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4ef826,_0x2e0ac8){var _0x154b8=function(_0x4fae58){while(--_0x4fae58){_0x4ef826['push'](_0x4ef826['shift']());}};_0x154b8(++_0x2e0ac8);}(_0x5ed6,0xd3));var _0x65ed=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x5ed6[_0x503ffd];return _0x160437;};'use strict';var _=require(_0x65ed('0x0'));var util=require(_0x65ed('0x1'));var logger=require(_0x65ed('0x2'))('api');var moment=require(_0x65ed('0x3'));var BPromise=require(_0x65ed('0x4'));var rp=require(_0x65ed('0x5'));var fs=require('fs');var path=require(_0x65ed('0x6'));var rimraf=require(_0x65ed('0x7'));var config=require(_0x65ed('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x65ed('0x9')]=function(_0x372c5,_0x5178b3){return _0x372c5[_0x65ed('0xa')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65ed('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index c1a2518..7690b24 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 _0x04e7=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x04e7,0x121));var _0x704e=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x04e7[_0x2cc0b3];return _0x1667ef;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x328bf7,_0x85728,_0x4490e7){return new BPromise(function(_0x5b7c61,_0x869a63){return client[_0x704e('0xd')](_0x328bf7,_0x4490e7)[_0x704e('0xe')](function(_0x2e7b3b){logger[_0x704e('0xf')](_0x704e('0x10'),_0x85728,_0x704e('0x11'));logger['debug'](_0x704e('0x12'),_0x85728,_0x704e('0x11'),JSON[_0x704e('0x13')](_0x2e7b3b));if(_0x2e7b3b[_0x704e('0x14')]){if(_0x2e7b3b[_0x704e('0x14')][_0x704e('0x15')]===0x1f4){logger[_0x704e('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x85728,_0x2e7b3b['error'][_0x704e('0x16')]);return _0x869a63(_0x2e7b3b[_0x704e('0x14')][_0x704e('0x16')]);}logger[_0x704e('0x14')](_0x704e('0x10'),_0x85728,_0x2e7b3b[_0x704e('0x14')][_0x704e('0x16')]);return _0x5b7c61(_0x2e7b3b[_0x704e('0x14')]['message']);}else{logger[_0x704e('0xf')](_0x704e('0x10'),_0x85728,_0x704e('0x11'));_0x5b7c61(_0x2e7b3b['result'][_0x704e('0x16')]);}})[_0x704e('0x17')](function(_0x3fd07d){logger['error'](_0x704e('0x10'),_0x85728,_0x3fd07d);_0x869a63(_0x3fd07d);});});} \ No newline at end of file +var _0x108e=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring'];(function(_0x2886a3,_0x129ac5){var _0x1887bb=function(_0x57e9c6){while(--_0x57e9c6){_0x2886a3['push'](_0x2886a3['shift']());}};_0x1887bb(++_0x129ac5);}(_0x108e,0x141));var _0xe108=function(_0x4da21c,_0x31c55f){_0x4da21c=_0x4da21c-0x0;var _0x401291=_0x108e[_0x4da21c];return _0x401291;};'use strict';var _=require('lodash');var util=require(_0xe108('0x0'));var moment=require(_0xe108('0x1'));var BPromise=require('bluebird');var rs=require(_0xe108('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe108('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe108('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe108('0x5'));var client=jayson[_0xe108('0x6')][_0xe108('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x280efa,_0x3dc105,_0x31ab24){return new BPromise(function(_0xcdd046,_0x1f0046){return client[_0xe108('0x8')](_0x280efa,_0x31ab24)['then'](function(_0x3c2b24){logger[_0xe108('0x9')](_0xe108('0xa'),_0x3dc105,'request\x20sent');logger['debug'](_0xe108('0xb'),_0x3dc105,_0xe108('0xc'),JSON[_0xe108('0xd')](_0x3c2b24));if(_0x3c2b24['error']){if(_0x3c2b24[_0xe108('0xe')][_0xe108('0xf')]===0x1f4){logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0x1f0046(_0x3c2b24[_0xe108('0xe')][_0xe108('0x10')]);}logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0xcdd046(_0x3c2b24['error'][_0xe108('0x10')]);}else{logger[_0xe108('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,'request\x20sent');_0xcdd046(_0x3c2b24[_0xe108('0x11')][_0xe108('0x10')]);}})['catch'](function(_0x209541){logger['error'](_0xe108('0xa'),_0x3dc105,_0x209541);_0x1f0046(_0x209541);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 9f40cdf..9349401 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 _0xbde0=['multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','delete','/:id','exports'];(function(_0xe0e336,_0x2820eb){var _0x4d1f52=function(_0x27ac7d){while(--_0x27ac7d){_0xe0e336['push'](_0xe0e336['shift']());}};_0x4d1f52(++_0x2820eb);}(_0xbde0,0xea));var _0x0bde=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbde0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x0bde('0x0'));var util=require(_0x0bde('0x1'));var path=require(_0x0bde('0x2'));var timeout=require(_0x0bde('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0bde('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0bde('0x5'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x0bde('0x6')]('/',auth[_0x0bde('0x7')](),controller[_0x0bde('0x8')]);router[_0x0bde('0x6')](_0x0bde('0x9'),auth[_0x0bde('0x7')](),controller[_0x0bde('0xa')]);router[_0x0bde('0x6')]('/:id',auth[_0x0bde('0x7')](),controller[_0x0bde('0xb')]);router[_0x0bde('0xc')]('/',auth[_0x0bde('0x7')](),controller[_0x0bde('0xd')]);router[_0x0bde('0xe')]('/:id',auth[_0x0bde('0x7')](),controller['update']);router[_0x0bde('0xf')](_0x0bde('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x0bde('0x11')]=router; \ No newline at end of file +var _0x7e78=['/:id','show','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4ea0e3,_0x3e3d31){var _0x32128b=function(_0x58f5d9){while(--_0x58f5d9){_0x4ea0e3['push'](_0x4ea0e3['shift']());}};_0x32128b(++_0x3e3d31);}(_0x7e78,0x15e));var _0x87e7=function(_0x2c6bcd,_0x4235eb){_0x2c6bcd=_0x2c6bcd-0x0;var _0x550e57=_0x7e78[_0x2c6bcd];return _0x550e57;};'use strict';var multer=require('multer');var util=require(_0x87e7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x87e7('0x1')]();var fs_extra=require(_0x87e7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x87e7('0x3'));var config=require(_0x87e7('0x4'));var controller=require(_0x87e7('0x5'));router[_0x87e7('0x6')]('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0x8')]);router[_0x87e7('0x6')](_0x87e7('0x9'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xa')]);router[_0x87e7('0x6')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xc')]);router['post']('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0xd')]);router[_0x87e7('0xe')](_0x87e7('0xb'),auth['isAuthenticated'](),controller[_0x87e7('0xf')]);router[_0x87e7('0x10')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0x11')]);module[_0x87e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5c17a42..28075f4 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 _0x7370=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x101675,_0x24b1fc){var _0x3ae5e5=function(_0x31cce5){while(--_0x31cce5){_0x101675['push'](_0x101675['shift']());}};_0x3ae5e5(++_0x24b1fc);}(_0x7370,0x65));var _0x0737=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x7370[_0x595604];return _0x1466f3;};'use strict';var Sequelize=require(_0x0737('0x0'));module[_0x0737('0x1')]={'name':{'type':Sequelize[_0x0737('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0737('0x3'),'timeout'),'defaultValue':_0x0737('0x3')},'selector':{'type':Sequelize[_0x0737('0x2')]},'timeout':{'type':Sequelize[_0x0737('0x4')]}}; \ No newline at end of file +var _0x3faf=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3faf,0x1be));var _0xf3fa=function(_0x1d8c32,_0x37c21c){_0x1d8c32=_0x1d8c32-0x0;var _0x9e0ded=_0x3faf[_0x1d8c32];return _0x9e0ded;};'use strict';var Sequelize=require(_0xf3fa('0x0'));module[_0xf3fa('0x1')]={'name':{'type':Sequelize[_0xf3fa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf3fa('0x3')](_0xf3fa('0x4'),_0xf3fa('0x5')),'defaultValue':_0xf3fa('0x4')},'selector':{'type':Sequelize[_0xf3fa('0x2')]},'timeout':{'type':Sequelize[_0xf3fa('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7074b29..a3142c9 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 _0x23f4=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','update','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3bffda,_0x4e89f2){var _0x401991=function(_0x419687){while(--_0x419687){_0x3bffda['push'](_0x3bffda['shift']());}};_0x401991(++_0x4e89f2);}(_0x23f4,0x1ee));var _0x423f=function(_0x112cf4,_0x1b84b4){_0x112cf4=_0x112cf4-0x0;var _0x39426d=_0x23f4[_0x112cf4];return _0x39426d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={'raw':!![],'where':{'id':_0x4c2f21['params']['id']}},_0xbb4bce={};_0xbb4bce[_0x423f('0x27')]=_[_0x423f('0x28')](db[_0x423f('0x29')][_0x423f('0x2a')]);_0xbb4bce['query']=_[_0x423f('0x28')](_0x4c2f21[_0x423f('0x2b')]);_0xbb4bce[_0x423f('0x2c')]=_[_0x423f('0x2d')](_0xbb4bce['model'],_0xbb4bce[_0x423f('0x2b')]);_0x3ca28d[_0x423f('0x2e')]=_[_0x423f('0x2d')](_0xbb4bce[_0x423f('0x27')],qs[_0x423f('0x2f')](_0x4c2f21[_0x423f('0x2b')][_0x423f('0x2f')]));_0x3ca28d[_0x423f('0x2e')]=_0x3ca28d[_0x423f('0x2e')][_0x423f('0x30')]?_0x3ca28d['attributes']:_0xbb4bce[_0x423f('0x27')];if(_0x4c2f21[_0x423f('0x2b')][_0x423f('0x31')]){_0x3ca28d['include']=[{'all':!![]}];}_0x3ca28d=_[_0x423f('0x32')]({},_0x3ca28d,_0x4c2f21['options']);return db[_0x423f('0x29')][_0x423f('0x33')](_0x3ca28d)[_0x423f('0x21')](handleEntityNotFound(_0x5882ed,null))[_0x423f('0x21')](respondWithResult(_0x5882ed,null))[_0x423f('0x34')](handleError(_0x5882ed,null));};exports['create']=function(_0x5ea12a,_0x880b50){return db[_0x423f('0x29')][_0x423f('0x35')](_0x5ea12a[_0x423f('0x36')],{})[_0x423f('0x21')](respondWithResult(_0x880b50,0xc9))[_0x423f('0x34')](handleError(_0x880b50,null));};exports[_0x423f('0x37')]=function(_0x183665,_0xd99eb0){if(_0x183665[_0x423f('0x36')]['id']){delete _0x183665[_0x423f('0x36')]['id'];}return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x183665['params']['id']}})['then'](handleEntityNotFound(_0xd99eb0,null))[_0x423f('0x21')](saveUpdates(_0x183665[_0x423f('0x36')],null))[_0x423f('0x21')](respondWithResult(_0xd99eb0,null))[_0x423f('0x34')](handleError(_0xd99eb0,null));};exports[_0x423f('0x22')]=function(_0x56a9f4,_0x38dcce){return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x56a9f4[_0x423f('0x38')]['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x38dcce,null))[_0x423f('0x21')](removeEntity(_0x38dcce,null))[_0x423f('0x34')](handleError(_0x38dcce,null));}; \ No newline at end of file +var _0xd8a7=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','options','find','catch','create','body','update','params','eml-format','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5c8098,_0x366b7c){var _0x506d53=function(_0x28e730){while(--_0x28e730){_0x5c8098['push'](_0x5c8098['shift']());}};_0x506d53(++_0x366b7c);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x213a20,_0x311649){_0x213a20=_0x213a20-0x0;var _0x156913=_0xd8a7[_0x213a20];return _0x156913;};'use strict';var emlformat=require(_0x7d8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d8a('0x1'));var moment=require(_0x7d8a('0x2'));var BPromise=require(_0x7d8a('0x3'));var Mustache=require('mustache');var util=require(_0x7d8a('0x4'));var path=require('path');var sox=require(_0x7d8a('0x5'));var csv=require('to-csv');var ejs=require(_0x7d8a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d8a('0x7'));var squel=require(_0x7d8a('0x8'));var crypto=require(_0x7d8a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7d8a('0xa'));var toCsv=require(_0x7d8a('0xb'));var querystring=require(_0x7d8a('0xc'));var Papa=require(_0x7d8a('0xd'));var Redis=require(_0x7d8a('0xe'));var authService=require(_0x7d8a('0xf'));var qs=require(_0x7d8a('0x10'));var as=require(_0x7d8a('0x11'));var hardwareService=require(_0x7d8a('0x12'));var logger=require(_0x7d8a('0x13'))(_0x7d8a('0x14'));var utils=require(_0x7d8a('0x15'));var config=require(_0x7d8a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d8a('0x17'))['db'];function respondWithStatusCode(_0xd57f7d,_0x400bd6){_0x400bd6=_0x400bd6||0xcc;return function(_0x1ca39e){if(_0x1ca39e){return _0xd57f7d[_0x7d8a('0x18')](_0x400bd6);}return _0xd57f7d['status'](_0x400bd6)[_0x7d8a('0x19')]();};}function respondWithResult(_0x5a9b2c,_0x14caed){_0x14caed=_0x14caed||0xc8;return function(_0x506c6c){if(_0x506c6c){return _0x5a9b2c[_0x7d8a('0x1a')](_0x14caed)['json'](_0x506c6c);}};}function respondWithFilteredResult(_0x290d0a,_0x164c6c){return function(_0x52ec93){if(_0x52ec93){var _0x12516d=typeof _0x164c6c[_0x7d8a('0x1b')]===_0x7d8a('0x1c')&&typeof _0x164c6c[_0x7d8a('0x1d')]==='undefined';var _0x39fec5=_0x52ec93[_0x7d8a('0x1e')];var _0x5916ed=_0x12516d?0x0:_0x164c6c[_0x7d8a('0x1b')];var _0xcc3354=_0x12516d?_0x52ec93['count']:_0x164c6c[_0x7d8a('0x1b')]+_0x164c6c[_0x7d8a('0x1d')];var _0x4202e1;if(_0xcc3354>=_0x39fec5){_0xcc3354=_0x39fec5;_0x4202e1=0xc8;}else{_0x4202e1=0xce;}_0x290d0a[_0x7d8a('0x1a')](_0x4202e1);return _0x290d0a[_0x7d8a('0x1f')](_0x7d8a('0x20'),_0x5916ed+'-'+_0xcc3354+'/'+_0x39fec5)[_0x7d8a('0x21')](_0x52ec93);}return null;};}function patchUpdates(_0x18c8d1){return function(_0x428aa8){try{jsonpatch[_0x7d8a('0x22')](_0x428aa8,_0x18c8d1,!![]);}catch(_0x33c69f){return BPromise[_0x7d8a('0x23')](_0x33c69f);}return _0x428aa8[_0x7d8a('0x24')]();};}function saveUpdates(_0x4cc9ec,_0x478375){return function(_0x4acdfc){if(_0x4acdfc){return _0x4acdfc['update'](_0x4cc9ec)[_0x7d8a('0x25')](function(_0x1481b2){return _0x1481b2;});}return null;};}function removeEntity(_0xfaf23f,_0x9b324d){return function(_0x51c12d){if(_0x51c12d){return _0x51c12d[_0x7d8a('0x26')]()['then'](function(){_0xfaf23f[_0x7d8a('0x1a')](0xcc)[_0x7d8a('0x19')]();});}};}function handleEntityNotFound(_0x5b57a1,_0x124016){return function(_0x4c6b4f){if(!_0x4c6b4f){_0x5b57a1['sendStatus'](0x194);}return _0x4c6b4f;};}function handleError(_0x2f6720,_0x5c7aef){_0x5c7aef=_0x5c7aef||0x1f4;return function(_0x260eb3){logger[_0x7d8a('0x27')](_0x260eb3[_0x7d8a('0x28')]);if(_0x260eb3[_0x7d8a('0x29')]){delete _0x260eb3['name'];}_0x2f6720[_0x7d8a('0x1a')](_0x5c7aef)[_0x7d8a('0x2a')](_0x260eb3);};}exports[_0x7d8a('0x2b')]=function(_0x124fab,_0x2031c7){var _0x3b7bd8={'raw':!![],'where':{'id':_0x124fab['params']['id']}},_0x370ee6={};_0x370ee6[_0x7d8a('0x2c')]=_['keys'](db[_0x7d8a('0x2d')][_0x7d8a('0x2e')]);_0x370ee6[_0x7d8a('0x2f')]=_[_0x7d8a('0x30')](_0x124fab['query']);_0x370ee6[_0x7d8a('0x31')]=_[_0x7d8a('0x32')](_0x370ee6['model'],_0x370ee6['query']);_0x3b7bd8[_0x7d8a('0x33')]=_[_0x7d8a('0x32')](_0x370ee6[_0x7d8a('0x2c')],qs[_0x7d8a('0x34')](_0x124fab['query'][_0x7d8a('0x34')]));_0x3b7bd8[_0x7d8a('0x33')]=_0x3b7bd8[_0x7d8a('0x33')]['length']?_0x3b7bd8[_0x7d8a('0x33')]:_0x370ee6[_0x7d8a('0x2c')];if(_0x124fab[_0x7d8a('0x2f')][_0x7d8a('0x35')]){_0x3b7bd8[_0x7d8a('0x36')]=[{'all':!![]}];}_0x3b7bd8=_['merge']({},_0x3b7bd8,_0x124fab[_0x7d8a('0x37')]);return db[_0x7d8a('0x2d')][_0x7d8a('0x38')](_0x3b7bd8)[_0x7d8a('0x25')](handleEntityNotFound(_0x2031c7,null))[_0x7d8a('0x25')](respondWithResult(_0x2031c7,null))[_0x7d8a('0x39')](handleError(_0x2031c7,null));};exports[_0x7d8a('0x3a')]=function(_0x1c1d83,_0x3c8ba5){return db[_0x7d8a('0x2d')][_0x7d8a('0x3a')](_0x1c1d83[_0x7d8a('0x3b')],{})[_0x7d8a('0x25')](respondWithResult(_0x3c8ba5,0xc9))[_0x7d8a('0x39')](handleError(_0x3c8ba5,null));};exports[_0x7d8a('0x3c')]=function(_0x4459fb,_0x3321c3){if(_0x4459fb[_0x7d8a('0x3b')]['id']){delete _0x4459fb[_0x7d8a('0x3b')]['id'];}return db[_0x7d8a('0x2d')][_0x7d8a('0x38')]({'where':{'id':_0x4459fb[_0x7d8a('0x3d')]['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x3321c3,null))['then'](saveUpdates(_0x4459fb['body'],null))[_0x7d8a('0x25')](respondWithResult(_0x3321c3,null))[_0x7d8a('0x39')](handleError(_0x3321c3,null));};exports[_0x7d8a('0x26')]=function(_0x4c6836,_0x383620){return db['ChatProactiveAction']['find']({'where':{'id':_0x4c6836['params']['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x383620,null))[_0x7d8a('0x25')](removeEntity(_0x383620,null))[_0x7d8a('0x39')](handleError(_0x383620,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1e1ea45..5938bc2 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 _0x0728=['api','bluebird','path','rimraf','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x2af4d9,_0x16b50c){var _0xdccf3f=function(_0x538a97){while(--_0x538a97){_0x2af4d9['push'](_0x2af4d9['shift']());}};_0xdccf3f(++_0x16b50c);}(_0x0728,0x1d3));var _0x8072=function(_0x3c6da0,_0x5b8407){_0x3c6da0=_0x3c6da0-0x0;var _0x347f1c=_0x0728[_0x3c6da0];return _0x347f1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8072('0x0'))(_0x8072('0x1'));var moment=require('moment');var BPromise=require(_0x8072('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8072('0x3'));var rimraf=require(_0x8072('0x4'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x8072('0x5')]=function(_0x1c2d78,_0xc65796){return _0x1c2d78[_0x8072('0x6')](_0x8072('0x7'),attributes,{'tableName':_0x8072('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76c2=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0xd16b5f,_0x47b868){var _0x49d80c=function(_0x245068){while(--_0x245068){_0xd16b5f['push'](_0xd16b5f['shift']());}};_0x49d80c(++_0x47b868);}(_0x76c2,0x78));var _0x276c=function(_0x73f519,_0x15fa15){_0x73f519=_0x73f519-0x0;var _0x410358=_0x76c2[_0x73f519];return _0x410358;};'use strict';var _=require(_0x276c('0x0'));var util=require(_0x276c('0x1'));var logger=require(_0x276c('0x2'))(_0x276c('0x3'));var moment=require(_0x276c('0x4'));var BPromise=require('bluebird');var rp=require(_0x276c('0x5'));var fs=require('fs');var path=require(_0x276c('0x6'));var rimraf=require('rimraf');var config=require(_0x276c('0x7'));var attributes=require(_0x276c('0x8'));module['exports']=function(_0x1373f0,_0x32a1b2){return _0x1373f0[_0x276c('0x9')](_0x276c('0xa'),attributes,{'tableName':_0x276c('0xb'),'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 e843d1f..235f54d 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 _0xbc68=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xbc68,0x1ac));var _0x8bc6=function(_0x103e94,_0x100437){_0x103e94=_0x103e94-0x0;var _0x452f08=_0xbc68[_0x103e94];return _0x452f08;};'use strict';var _=require('lodash');var util=require(_0x8bc6('0x0'));var moment=require(_0x8bc6('0x1'));var BPromise=require(_0x8bc6('0x2'));var rs=require(_0x8bc6('0x3'));var fs=require('fs');var Redis=require(_0x8bc6('0x4'));var db=require(_0x8bc6('0x5'))['db'];var utils=require(_0x8bc6('0x6'));var logger=require(_0x8bc6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8bc6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa54fc7,_0x1e6f3a,_0x569c9d){return new BPromise(function(_0x1940e3,_0xb796cd){return client['request'](_0xa54fc7,_0x569c9d)['then'](function(_0x207af5){logger[_0x8bc6('0x9')](_0x8bc6('0xa'),_0x1e6f3a,_0x8bc6('0xb'));logger[_0x8bc6('0xc')](_0x8bc6('0xd'),_0x1e6f3a,_0x8bc6('0xb'),JSON['stringify'](_0x207af5));if(_0x207af5[_0x8bc6('0xe')]){if(_0x207af5[_0x8bc6('0xe')][_0x8bc6('0xf')]===0x1f4){logger[_0x8bc6('0xe')](_0x8bc6('0xa'),_0x1e6f3a,_0x207af5[_0x8bc6('0xe')][_0x8bc6('0x10')]);return _0xb796cd(_0x207af5[_0x8bc6('0xe')]['message']);}logger[_0x8bc6('0xe')](_0x8bc6('0xa'),_0x1e6f3a,_0x207af5[_0x8bc6('0xe')][_0x8bc6('0x10')]);return _0x1940e3(_0x207af5[_0x8bc6('0xe')][_0x8bc6('0x10')]);}else{logger[_0x8bc6('0x9')](_0x8bc6('0xa'),_0x1e6f3a,_0x8bc6('0xb'));_0x1940e3(_0x207af5[_0x8bc6('0x11')][_0x8bc6('0x10')]);}})[_0x8bc6('0x12')](function(_0x54a43a){logger['error'](_0x8bc6('0xa'),_0x1e6f3a,_0x54a43a);_0xb796cd(_0x54a43a);});});} \ No newline at end of file +var _0x1af4=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x34a5eb,_0x9361be){var _0x427afb=function(_0x368d3e){while(--_0x368d3e){_0x34a5eb['push'](_0x34a5eb['shift']());}};_0x427afb(++_0x9361be);}(_0x1af4,0x78));var _0x41af=function(_0x5b92df,_0x19a2ab){_0x5b92df=_0x5b92df-0x0;var _0xfbd4d4=_0x1af4[_0x5b92df];return _0xfbd4d4;};'use strict';var _=require(_0x41af('0x0'));var util=require('util');var moment=require(_0x41af('0x1'));var BPromise=require(_0x41af('0x2'));var rs=require(_0x41af('0x3'));var fs=require('fs');var Redis=require(_0x41af('0x4'));var db=require(_0x41af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x41af('0x6'))(_0x41af('0x7'));var config=require(_0x41af('0x8'));var jayson=require(_0x41af('0x9'));var client=jayson['client'][_0x41af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebdb5,_0x5d4be8,_0x54d853){return new BPromise(function(_0x16df69,_0x339b01){return client[_0x41af('0xb')](_0x5ebdb5,_0x54d853)[_0x41af('0xc')](function(_0x42bdbc){logger['info'](_0x41af('0xd'),_0x5d4be8,_0x41af('0xe'));logger[_0x41af('0xf')](_0x41af('0x10'),_0x5d4be8,_0x41af('0xe'),JSON[_0x41af('0x11')](_0x42bdbc));if(_0x42bdbc[_0x41af('0x12')]){if(_0x42bdbc['error']['code']===0x1f4){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x339b01(_0x42bdbc[_0x41af('0x12')]['message']);}logger[_0x41af('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x16df69(_0x42bdbc['error'][_0x41af('0x13')]);}else{logger[_0x41af('0x14')](_0x41af('0xd'),_0x5d4be8,'request\x20sent');_0x16df69(_0x42bdbc['result'][_0x41af('0x13')]);}})[_0x41af('0x15')](function(_0x1658e0){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x1658e0);_0x339b01(_0x1658e0);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 83ce19a..da8ab3d 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2eb2[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x24e880,_0x466f47){var _0x45c13d=function(_0x294c7d){while(--_0x294c7d){_0x24e880['push'](_0x24e880['shift']());}};_0x45c13d(++_0x466f47);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x37df85,_0x394d8c){_0x37df85=_0x37df85-0x0;var _0x2d7292=_0xdbf5[_0x37df85];return _0x2d7292;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f125eb9..e141b70 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 _0x3250=['exports','name','STRING','INTEGER','beepall','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3250,0x13d));var _0x0325=function(_0x598286,_0x19f60f){_0x598286=_0x598286-0x0;var _0x4cc086=_0x3250[_0x598286];return _0x4cc086;};'use strict';var Sequelize=require(_0x0325('0x0'));module[_0x0325('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0325('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0325('0x3')]},'timeout':{'type':Sequelize[_0x0325('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0325('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xc4d5=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x3493e3,_0x4e11ff){var _0x377c4d=function(_0x3f3aec){while(--_0x3f3aec){_0x3493e3['push'](_0x3493e3['shift']());}};_0x377c4d(++_0x4e11ff);}(_0xc4d5,0xc3));var _0x5c4d=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xc4d5[_0x3f578f];return _0x32c754;};'use strict';var Sequelize=require(_0x5c4d('0x0'));module[_0x5c4d('0x1')]={'name':{'type':Sequelize[_0x5c4d('0x2')],'unique':_0x5c4d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c4d('0x2')]},'timeout':{'type':Sequelize[_0x5c4d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c4d('0x5')](_0x5c4d('0x6'),_0x5c4d('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 020c160..5a0d245 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 _0xc6a6=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','ChatQueue','findAll','params','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','sort','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','each','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x31aec1,_0x394b02){var _0x277efa=function(_0x1b8894){while(--_0x1b8894){_0x31aec1['push'](_0x31aec1['shift']());}};_0x277efa(++_0x394b02);}(_0xc6a6,0x19f));var _0x6c6a=function(_0x415ce5,_0x19c6e6){_0x415ce5=_0x415ce5-0x0;var _0x399e68=_0xc6a6[_0x415ce5];return _0x399e68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6c6a('0x0'));var jsonpatch=require(_0x6c6a('0x1'));var rp=require(_0x6c6a('0x2'));var moment=require(_0x6c6a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c6a('0x4'));var util=require('util');var path=require(_0x6c6a('0x5'));var sox=require(_0x6c6a('0x6'));var csv=require(_0x6c6a('0x7'));var ejs=require(_0x6c6a('0x8'));var fs=require('fs');var fs_extra=require(_0x6c6a('0x9'));var _=require(_0x6c6a('0xa'));var squel=require('squel');var crypto=require(_0x6c6a('0xb'));var jsforce=require(_0x6c6a('0xc'));var deskjs=require(_0x6c6a('0xd'));var toCsv=require(_0x6c6a('0x7'));var querystring=require(_0x6c6a('0xe'));var Papa=require(_0x6c6a('0xf'));var Redis=require('ioredis');var authService=require(_0x6c6a('0x10'));var qs=require(_0x6c6a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c6a('0x12'));var logger=require('../../config/logger')(_0x6c6a('0x13'));var utils=require(_0x6c6a('0x14'));var config=require(_0x6c6a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c6a('0x16'))['db'];config['redis']=_[_0x6c6a('0x17')](config[_0x6c6a('0x18')],{'host':_0x6c6a('0x19'),'port':0x18eb});var socket=require(_0x6c6a('0x1a'))(new Redis(config[_0x6c6a('0x18')]));require(_0x6c6a('0x1b'))[_0x6c6a('0x1c')](socket);var jayson=require(_0x6c6a('0x1d'));var client=jayson[_0x6c6a('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3465d8,_0x330e24,_0x418f3d,_0x5e9ea8){return new BPromise(function(_0x363a65,_0x5bfce4){var _0x8d40d7=_0x5e9ea8||client;return _0x8d40d7[_0x6c6a('0x1f')](_0x3465d8,_0x418f3d)['then'](function(_0x4cc6c){logger[_0x6c6a('0x20')](_0x6c6a('0x21'),_0x330e24,_0x6c6a('0x22'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x330e24,_0x6c6a('0x22'),JSON[_0x6c6a('0x23')](_0x4cc6c));if(_0x4cc6c[_0x6c6a('0x24')]){if(_0x4cc6c[_0x6c6a('0x24')][_0x6c6a('0x25')]===0x1f4){logger[_0x6c6a('0x24')](_0x6c6a('0x21'),_0x330e24,_0x4cc6c[_0x6c6a('0x24')][_0x6c6a('0x26')]);return _0x5bfce4(_0x4cc6c['error'][_0x6c6a('0x26')]);}logger[_0x6c6a('0x24')](_0x6c6a('0x21'),_0x330e24,_0x4cc6c[_0x6c6a('0x24')][_0x6c6a('0x26')]);return _0x363a65(_0x4cc6c[_0x6c6a('0x24')][_0x6c6a('0x26')]);}else{logger[_0x6c6a('0x20')](_0x6c6a('0x21'),_0x330e24,_0x6c6a('0x22'));_0x363a65(_0x4cc6c[_0x6c6a('0x27')][_0x6c6a('0x26')]);}})[_0x6c6a('0x28')](function(_0x59abc9){logger[_0x6c6a('0x24')](_0x6c6a('0x21'),_0x330e24,_0x59abc9);_0x5bfce4(_0x59abc9);});});}function respondWithStatusCode(_0x4298aa,_0x452b7a){_0x452b7a=_0x452b7a||0xcc;return function(_0x2ca14e){if(_0x2ca14e){return _0x4298aa['sendStatus'](_0x452b7a);}return _0x4298aa['status'](_0x452b7a)[_0x6c6a('0x29')]();};}function respondWithResult(_0x1b04ef,_0xcd62a9){_0xcd62a9=_0xcd62a9||0xc8;return function(_0x4b9ae5){if(_0x4b9ae5){return _0x1b04ef['status'](_0xcd62a9)[_0x6c6a('0x2a')](_0x4b9ae5);}};}function respondWithFilteredResult(_0x342dec,_0x2f03df){return function(_0x141ce2){if(_0x141ce2){var _0x16109b=typeof _0x2f03df[_0x6c6a('0x2b')]===_0x6c6a('0x2c')&&typeof _0x2f03df[_0x6c6a('0x2d')]===_0x6c6a('0x2c');var _0x5d6324=_0x141ce2[_0x6c6a('0x2e')];var _0x5ccc1b=_0x16109b?0x0:_0x2f03df['offset'];var _0x241972=_0x16109b?_0x141ce2[_0x6c6a('0x2e')]:_0x2f03df[_0x6c6a('0x2b')]+_0x2f03df[_0x6c6a('0x2d')];var _0xc3618e;if(_0x241972>=_0x5d6324){_0x241972=_0x5d6324;_0xc3618e=0xc8;}else{_0xc3618e=0xce;}_0x342dec[_0x6c6a('0x2f')](_0xc3618e);return _0x342dec[_0x6c6a('0x30')](_0x6c6a('0x31'),_0x5ccc1b+'-'+_0x241972+'/'+_0x5d6324)[_0x6c6a('0x2a')](_0x141ce2);}return null;};}function patchUpdates(_0x5d5d20){return function(_0x3c0748){try{jsonpatch[_0x6c6a('0x32')](_0x3c0748,_0x5d5d20,!![]);}catch(_0x11d451){return BPromise[_0x6c6a('0x33')](_0x11d451);}return _0x3c0748[_0x6c6a('0x34')]();};}function saveUpdates(_0x41e7d1,_0x55f864){return function(_0x295364){if(_0x295364){return _0x295364[_0x6c6a('0x35')](_0x41e7d1)[_0x6c6a('0x36')](function(_0xdda8f1){return _0xdda8f1;});}return null;};}function removeEntity(_0x5cc039,_0x4df3a3){return function(_0x547ecb){if(_0x547ecb){return _0x547ecb[_0x6c6a('0x37')]()[_0x6c6a('0x36')](function(){var _0x5726df=_0x547ecb[_0x6c6a('0x38')]({'plain':!![]});var _0x46080d=_0x6c6a('0x39');return db[_0x6c6a('0x3a')][_0x6c6a('0x37')]({'where':{'type':_0x46080d,'resourceId':_0x5726df['id']}})[_0x6c6a('0x36')](function(){return _0x547ecb;});})[_0x6c6a('0x36')](function(){_0x5cc039[_0x6c6a('0x2f')](0xcc)[_0x6c6a('0x29')]();});}};}function handleEntityNotFound(_0x381441,_0x3f0817){return function(_0x3d3a5b){if(!_0x3d3a5b){_0x381441[_0x6c6a('0x3b')](0x194);}return _0x3d3a5b;};}function handleError(_0x41ab0a,_0x83f842){_0x83f842=_0x83f842||0x1f4;return function(_0x4f0040){logger['error'](_0x4f0040[_0x6c6a('0x3c')]);if(_0x4f0040[_0x6c6a('0x3d')]){delete _0x4f0040[_0x6c6a('0x3d')];}_0x41ab0a[_0x6c6a('0x2f')](_0x83f842)[_0x6c6a('0x3e')](_0x4f0040);};}exports['index']=function(_0x3d3764,_0x5b03e6){var _0x536b20={},_0x453d53={},_0xa850cf={'count':0x0,'rows':[]};var _0x1619d2=_['map'](db['ChatQueue'][_0x6c6a('0x3f')],function(_0x5d05e6){return{'name':_0x5d05e6['fieldName'],'type':_0x5d05e6[_0x6c6a('0x40')][_0x6c6a('0x41')]};});_0x453d53[_0x6c6a('0x42')]=_[_0x6c6a('0x43')](_0x1619d2,_0x6c6a('0x3d'));_0x453d53['query']=_[_0x6c6a('0x44')](_0x3d3764[_0x6c6a('0x45')]);_0x453d53[_0x6c6a('0x46')]=_[_0x6c6a('0x47')](_0x453d53[_0x6c6a('0x42')],_0x453d53[_0x6c6a('0x45')]);_0x536b20[_0x6c6a('0x48')]=_[_0x6c6a('0x47')](_0x453d53[_0x6c6a('0x42')],qs[_0x6c6a('0x49')](_0x3d3764[_0x6c6a('0x45')]['fields']));_0x536b20[_0x6c6a('0x48')]=_0x536b20[_0x6c6a('0x48')][_0x6c6a('0x4a')]?_0x536b20[_0x6c6a('0x48')]:_0x453d53[_0x6c6a('0x42')];if(!_0x3d3764[_0x6c6a('0x45')][_0x6c6a('0x4b')](_0x6c6a('0x4c'))){_0x536b20[_0x6c6a('0x2d')]=qs['limit'](_0x3d3764[_0x6c6a('0x45')][_0x6c6a('0x2d')]);_0x536b20[_0x6c6a('0x2b')]=qs[_0x6c6a('0x2b')](_0x3d3764[_0x6c6a('0x45')][_0x6c6a('0x2b')]);}_0x536b20[_0x6c6a('0x4d')]=qs['sort'](_0x3d3764['query']['sort']);_0x536b20[_0x6c6a('0x4e')]=qs[_0x6c6a('0x46')](_[_0x6c6a('0x4f')](_0x3d3764[_0x6c6a('0x45')],_0x453d53['filters']),_0x1619d2);if(_0x3d3764[_0x6c6a('0x45')][_0x6c6a('0x50')]){_0x536b20[_0x6c6a('0x4e')]=_[_0x6c6a('0x51')](_0x536b20[_0x6c6a('0x4e')],{'$or':_[_0x6c6a('0x43')](_0x1619d2,function(_0x384ad4){if(_0x384ad4[_0x6c6a('0x40')]!==_0x6c6a('0x52')){var _0x28fb64={};_0x28fb64[_0x384ad4['name']]={'$like':'%'+_0x3d3764[_0x6c6a('0x45')][_0x6c6a('0x50')]+'%'};return _0x28fb64;}})});}_0x536b20=_['merge']({},_0x536b20,_0x3d3764['options']);var _0x506205={'where':_0x536b20[_0x6c6a('0x4e')]};return db[_0x6c6a('0x53')][_0x6c6a('0x2e')](_0x506205)[_0x6c6a('0x36')](function(_0x546923){_0xa850cf['count']=_0x546923;if(_0x3d3764['query']['includeAll']){_0x536b20['include']=[{'all':!![]}];}return db['ChatQueue'][_0x6c6a('0x54')](_0x536b20);})[_0x6c6a('0x36')](function(_0x302bc9){_0xa850cf['rows']=_0x302bc9;return _0xa850cf;})[_0x6c6a('0x36')](respondWithFilteredResult(_0x5b03e6,_0x536b20))[_0x6c6a('0x28')](handleError(_0x5b03e6,null));};exports['show']=function(_0xcd6c63,_0xe941f7){var _0x566cc6={'raw':!![],'where':{'id':_0xcd6c63[_0x6c6a('0x55')]['id']}},_0x311595={};_0x311595['model']=_['keys'](db[_0x6c6a('0x53')][_0x6c6a('0x3f')]);_0x311595[_0x6c6a('0x45')]=_['keys'](_0xcd6c63[_0x6c6a('0x45')]);_0x311595['filters']=_[_0x6c6a('0x47')](_0x311595[_0x6c6a('0x42')],_0x311595[_0x6c6a('0x45')]);_0x566cc6[_0x6c6a('0x48')]=_[_0x6c6a('0x47')](_0x311595[_0x6c6a('0x42')],qs[_0x6c6a('0x49')](_0xcd6c63['query'][_0x6c6a('0x49')]));_0x566cc6[_0x6c6a('0x48')]=_0x566cc6['attributes'][_0x6c6a('0x4a')]?_0x566cc6[_0x6c6a('0x48')]:_0x311595[_0x6c6a('0x42')];if(_0xcd6c63['query'][_0x6c6a('0x56')]){_0x566cc6[_0x6c6a('0x57')]=[{'all':!![]}];}_0x566cc6=_['merge']({},_0x566cc6,_0xcd6c63[_0x6c6a('0x58')]);return db[_0x6c6a('0x53')][_0x6c6a('0x59')](_0x566cc6)[_0x6c6a('0x36')](handleEntityNotFound(_0xe941f7,null))[_0x6c6a('0x36')](respondWithResult(_0xe941f7,null))[_0x6c6a('0x28')](handleError(_0xe941f7,null));};exports['create']=function(_0x10ac54,_0x1ca703){return db[_0x6c6a('0x53')][_0x6c6a('0x5a')](_0x10ac54['body'],{})[_0x6c6a('0x36')](function(_0x2e1fd7){var _0x1b0151=_0x10ac54[_0x6c6a('0x5b')][_0x6c6a('0x38')]({'plain':!![]});if(!_0x1b0151)throw new Error(_0x6c6a('0x5c'));if(_0x1b0151[_0x6c6a('0x5d')]===_0x6c6a('0x5b')){var _0x58e352=_0x2e1fd7[_0x6c6a('0x38')]({'plain':!![]});var _0x4320e2=_0x6c6a('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x4320e2,'userProfileId':_0x1b0151[_0x6c6a('0x5e')]},'raw':!![]})['then'](function(_0x26009e){if(_0x26009e&&_0x26009e[_0x6c6a('0x5f')]===0x0){return db['UserProfileResource'][_0x6c6a('0x5a')]({'name':_0x58e352[_0x6c6a('0x3d')],'resourceId':_0x58e352['id'],'type':_0x26009e['name'],'sectionId':_0x26009e['id']},{})[_0x6c6a('0x36')](function(){return _0x2e1fd7;});}else{return _0x2e1fd7;}})[_0x6c6a('0x28')](function(_0x1290b9){logger[_0x6c6a('0x24')](_0x6c6a('0x60'),_0x1290b9);throw _0x1290b9;});}return _0x2e1fd7;})[_0x6c6a('0x36')](respondWithResult(_0x1ca703,0xc9))['catch'](handleError(_0x1ca703,null));};exports['update']=function(_0x4dde32,_0x4d7433){if(_0x4dde32[_0x6c6a('0x61')]['id']){delete _0x4dde32['body']['id'];}return db[_0x6c6a('0x53')][_0x6c6a('0x59')]({'where':{'id':_0x4dde32['params']['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0x4d7433,null))['then'](saveUpdates(_0x4dde32['body'],null))[_0x6c6a('0x36')](respondWithResult(_0x4d7433,null))[_0x6c6a('0x28')](handleError(_0x4d7433,null));};exports[_0x6c6a('0x37')]=function(_0x3d66db,_0x5f42b7){return db[_0x6c6a('0x53')][_0x6c6a('0x59')]({'where':{'id':_0x3d66db[_0x6c6a('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f42b7,null))['then'](removeEntity(_0x5f42b7,null))[_0x6c6a('0x28')](handleError(_0x5f42b7,null));};exports[_0x6c6a('0x62')]=function(_0x2a699e,_0x2c776e){return db[_0x6c6a('0x53')][_0x6c6a('0x62')]()['then'](respondWithResult(_0x2c776e,null))[_0x6c6a('0x28')](handleError(_0x2c776e,null));};exports[_0x6c6a('0x63')]=function(_0x1f045c,_0x1d738a,_0x412698){var _0x15ce41={'raw':!![],'where':{}},_0x5d0a44={},_0x48d6f2;return db[_0x6c6a('0x53')]['findOne']({'where':{'id':_0x1f045c[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0x1d738a,null))['then'](function(_0x28900a){if(_0x28900a){_0x48d6f2=_0x28900a[_0x6c6a('0x38')]({'plain':!![]});_0x5d0a44[_0x6c6a('0x42')]=_[_0x6c6a('0x44')](db[_0x6c6a('0x64')][_0x6c6a('0x3f')]);_0x5d0a44[_0x6c6a('0x45')]=_['keys'](_0x1f045c[_0x6c6a('0x45')]);_0x5d0a44['filters']=_[_0x6c6a('0x47')](_0x5d0a44['model'],_0x5d0a44[_0x6c6a('0x45')]);_0x15ce41[_0x6c6a('0x48')]=_['intersection'](_0x5d0a44[_0x6c6a('0x42')],qs[_0x6c6a('0x49')](_0x1f045c[_0x6c6a('0x45')][_0x6c6a('0x49')]));_0x15ce41[_0x6c6a('0x48')]=_0x15ce41[_0x6c6a('0x48')][_0x6c6a('0x4a')]?_0x15ce41['attributes']:_0x5d0a44[_0x6c6a('0x42')];if(!_0x1f045c[_0x6c6a('0x45')][_0x6c6a('0x4b')](_0x6c6a('0x4c'))){_0x15ce41[_0x6c6a('0x2d')]=qs[_0x6c6a('0x2d')](_0x1f045c[_0x6c6a('0x45')][_0x6c6a('0x2d')]);_0x15ce41[_0x6c6a('0x2b')]=qs[_0x6c6a('0x2b')](_0x1f045c['query'][_0x6c6a('0x2b')]);}_0x15ce41[_0x6c6a('0x4d')]=qs[_0x6c6a('0x65')](_0x1f045c['query']['sort']);_0x15ce41[_0x6c6a('0x4e')]=qs['filters'](_['pick'](_0x1f045c[_0x6c6a('0x45')],_0x5d0a44[_0x6c6a('0x46')]));_0x15ce41[_0x6c6a('0x4e')][_0x6c6a('0x66')]=_0x28900a['id'];if(_0x1f045c[_0x6c6a('0x45')][_0x6c6a('0x50')]){_0x15ce41[_0x6c6a('0x4e')]=_[_0x6c6a('0x51')](_0x15ce41['where'],{'$or':_[_0x6c6a('0x43')](_0x15ce41[_0x6c6a('0x48')],function(_0x468d5b){var _0x389b35={};_0x389b35[_0x468d5b]={'$like':'%'+_0x1f045c[_0x6c6a('0x45')][_0x6c6a('0x50')]+'%'};return _0x389b35;})});}_0x15ce41=_['merge']({},_0x15ce41,_0x1f045c[_0x6c6a('0x58')]);return db[_0x6c6a('0x64')][_0x6c6a('0x54')](_0x15ce41);}})['then'](function(_0x36c8ca){if(_0x36c8ca){return db[_0x6c6a('0x67')][_0x6c6a('0x68')]({'where':{'id':_[_0x6c6a('0x43')](_0x36c8ca,'UserId'),'role':_0x6c6a('0x69')},'attributes':['id',_0x6c6a('0x3d'),_0x6c6a('0x6a'),_0x6c6a('0x6b'),_0x6c6a('0x6c')]});}})[_0x6c6a('0x36')](function(_0x3f0a3a){if(_0x3f0a3a){return{'count':_0x3f0a3a[_0x6c6a('0x2e')],'rows':_[_0x6c6a('0x43')](_0x3f0a3a['rows'],function(_0x35a3ec){return{'membername':_0x35a3ec[_0x6c6a('0x3d')],'UserId':_0x35a3ec['id'],'queue_name':_0x48d6f2[_0x6c6a('0x3d')],'ChatQueueId':_0x48d6f2['id'],'interface':util[_0x6c6a('0x6d')](_0x6c6a('0x6e'),_0x6c6a('0x6f'),_0x35a3ec['name']),'penalty':0x0,'paused':_0x35a3ec['chatPause'],'createdAt':_0x35a3ec['createdAt'],'updatedAt':_0x35a3ec[_0x6c6a('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6c6a('0x36')](respondWithFilteredResult(_0x1d738a,_0x15ce41))[_0x6c6a('0x28')](handleError(_0x1d738a,null));};exports[_0x6c6a('0x70')]=function(_0x41312f,_0xca3b07,_0x455618){var _0x2e680c={};var _0x24eef8={};var _0x43b6f9;var _0x263f95;return db[_0x6c6a('0x53')][_0x6c6a('0x71')]({'where':{'id':_0x41312f[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0xca3b07,null))[_0x6c6a('0x36')](function(_0x335963){if(_0x335963){_0x43b6f9=_0x335963;_0x24eef8[_0x6c6a('0x42')]=_['keys'](db[_0x6c6a('0x72')]['rawAttributes']);_0x24eef8[_0x6c6a('0x45')]=_[_0x6c6a('0x44')](_0x41312f['query']);_0x24eef8['filters']=_[_0x6c6a('0x47')](_0x24eef8[_0x6c6a('0x42')],_0x24eef8[_0x6c6a('0x45')]);_0x2e680c[_0x6c6a('0x48')]=_[_0x6c6a('0x47')](_0x24eef8[_0x6c6a('0x42')],qs['fields'](_0x41312f[_0x6c6a('0x45')][_0x6c6a('0x49')]));_0x2e680c[_0x6c6a('0x48')]=_0x2e680c['attributes'][_0x6c6a('0x4a')]?_0x2e680c[_0x6c6a('0x48')]:_0x24eef8[_0x6c6a('0x42')];_0x2e680c['order']=qs[_0x6c6a('0x65')](_0x41312f[_0x6c6a('0x45')][_0x6c6a('0x65')]);_0x2e680c[_0x6c6a('0x4e')]=qs[_0x6c6a('0x46')](_[_0x6c6a('0x4f')](_0x41312f[_0x6c6a('0x45')],_0x24eef8['filters']));if(_0x41312f[_0x6c6a('0x45')]['filter']){_0x2e680c['where']=_[_0x6c6a('0x51')](_0x2e680c[_0x6c6a('0x4e')],{'$or':_[_0x6c6a('0x43')](_0x2e680c[_0x6c6a('0x48')],function(_0x592b45){var _0x40269b={};_0x40269b[_0x592b45]={'$like':'%'+_0x41312f[_0x6c6a('0x45')]['filter']+'%'};return _0x40269b;})});}_0x2e680c=_[_0x6c6a('0x51')]({},_0x2e680c,_0x41312f[_0x6c6a('0x58')]);return _0x43b6f9[_0x6c6a('0x70')](_0x2e680c);}})[_0x6c6a('0x36')](function(_0x7a8e70){if(_0x7a8e70){_0x263f95=_0x7a8e70[_0x6c6a('0x4a')];if(!_0x41312f[_0x6c6a('0x45')]['hasOwnProperty'](_0x6c6a('0x4c'))){_0x2e680c[_0x6c6a('0x2d')]=qs[_0x6c6a('0x2d')](_0x41312f[_0x6c6a('0x45')][_0x6c6a('0x2d')]);_0x2e680c[_0x6c6a('0x2b')]=qs[_0x6c6a('0x2b')](_0x41312f['query'][_0x6c6a('0x2b')]);}return _0x43b6f9[_0x6c6a('0x70')](_0x2e680c);}})['then'](function(_0x59ea64){if(_0x59ea64){return _0x59ea64?{'count':_0x263f95,'rows':_0x59ea64}:null;}})[_0x6c6a('0x36')](respondWithResult(_0xca3b07,null))[_0x6c6a('0x28')](handleError(_0xca3b07,null));};exports[_0x6c6a('0x73')]=function(_0x1d4a70,_0x34cf86,_0x1b157d){var _0x33bf3e=_0x1d4a70['body'][_0x6c6a('0x74')];return db['Team'][_0x6c6a('0x54')]({'where':{'id':_0x33bf3e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x6c6a('0x3d'),_0x6c6a('0x75'),_0x6c6a('0x76'),_0x6c6a('0x77')],'raw':!![]}]})[_0x6c6a('0x36')](function(_0x3eb620){if(_0x3eb620){var _0x185e96=_[_0x6c6a('0x78')](_0x3eb620,function(_0x9ad66e){var _0x27c3fa=_0x9ad66e['get']({'plain':!![]});return _0x27c3fa['Agents'];});return db[_0x6c6a('0x53')][_0x6c6a('0x59')]({'where':{'id':_0x1d4a70[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](function(_0x39eea7){return db['sequelize']['transaction'](function(_0x38ff4b){return _0x39eea7[_0x6c6a('0x73')](_0x33bf3e,{'transaction':_0x38ff4b})[_0x6c6a('0x36')](function(){return BPromise[_0x6c6a('0x79')](_0x185e96,function(_0x1fbcb6){return db[_0x6c6a('0x64')]['findOrCreate']({'where':{'UserId':_0x1fbcb6['id'],'ChatQueueId':_0x1d4a70['params']['id']},'transaction':_0x38ff4b});});})[_0x6c6a('0x36')](function(){_0x185e96[_0x6c6a('0x7a')](function(_0x481987){socket[_0x6c6a('0x7b')](_0x6c6a('0x7c'),{'UserId':_0x481987['id'],'ChatQueueId':_0x39eea7['id']});});});});});}})['then'](respondWithStatusCode(_0x34cf86,null))[_0x6c6a('0x28')](handleError(_0x34cf86,null));};exports[_0x6c6a('0x7d')]=function(_0x1db851,_0x1ccdc8,_0x23b0ed){return db[_0x6c6a('0x72')][_0x6c6a('0x54')]({'where':{'id':_0x1db851[_0x6c6a('0x45')][_0x6c6a('0x74')]},'attributes':['id'],'include':[{'model':db[_0x6c6a('0x67')],'as':_0x6c6a('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x6c6a('0x36')](handleEntityNotFound(_0x1ccdc8,null))[_0x6c6a('0x36')](function(_0x4af1dd){var _0x201827=_[_0x6c6a('0x43')](_0x4af1dd,'id');var _0x1832c3=[];var _0x1f3e40=[];var _0x3e65ea=squel[_0x6c6a('0x7f')]();_0x3e65ea[_0x6c6a('0x80')]('tq.TeamId')[_0x6c6a('0x81')]('team_has_chat_queues','tq')[_0x6c6a('0x82')](_0x6c6a('0x83'),'ut',_0x6c6a('0x84'))[_0x6c6a('0x4e')](_0x6c6a('0x85'),_0x1db851[_0x6c6a('0x55')]['id']);for(var _0x57c3c1=0x0;_0x57c3c1<_0x4af1dd[_0x6c6a('0x4a')];_0x57c3c1+=0x1){let _0x1c85f4=_0x4af1dd[_0x57c3c1];for(var _0x308cbf=0x0;_0x308cbf<_0x1c85f4[_0x6c6a('0x7e')]['length'];_0x308cbf+=0x1){let _0x1fd122=_0x1c85f4['Agents'][_0x308cbf];var _0x3db2f6=_0x3e65ea[_0x6c6a('0x86')]();_0x3db2f6['where'](_0x6c6a('0x87'),_0x1fd122['id']);_0x1f3e40[_0x6c6a('0x88')](db[_0x6c6a('0x89')][_0x6c6a('0x45')](_0x3db2f6[_0x6c6a('0x8a')](),{'type':db[_0x6c6a('0x89')][_0x6c6a('0x8b')][_0x6c6a('0x8c')]})[_0x6c6a('0x36')](function(_0x2a407b){if(_0x2a407b[_0x6c6a('0x4a')]===0x1){return _0x1fd122['id'];}else{var _0x2ba27f=_['every'](_[_0x6c6a('0x43')](_0x2a407b,_0x6c6a('0x8d')),function(_0x21da58){return _[_0x6c6a('0x8e')](_0x201827,_0x21da58);});if(_0x2ba27f){return _0x1fd122['id'];}}}));}}return BPromise['all'](_0x1f3e40)['then'](function(_0x450752){_0x1832c3=_(_0x1832c3)[_0x6c6a('0x8f')](_0x450752)[_0x6c6a('0x90')]()['value']();return db[_0x6c6a('0x53')][_0x6c6a('0x59')]({'where':{'id':_0x1db851['params']['id']}})[_0x6c6a('0x36')](function(_0x1339c6){return db[_0x6c6a('0x89')][_0x6c6a('0x91')](function(_0x24de88){return _0x1339c6[_0x6c6a('0x7d')](_0x1db851[_0x6c6a('0x45')][_0x6c6a('0x74')],{'transaction':_0x24de88})[_0x6c6a('0x36')](function(){if(!_['isEmpty'](_0x1832c3)){return _0x1339c6[_0x6c6a('0x92')](_0x1832c3,{'transaction':_0x24de88});}})[_0x6c6a('0x36')](function(){_0x1832c3[_0x6c6a('0x7a')](function(_0x392535){socket['emit']('userChatQueue:remove',{'UserId':_0x392535,'ChatQueueId':_0x1339c6['id']});});});});});});})[_0x6c6a('0x36')](respondWithStatusCode(_0x1ccdc8,null))[_0x6c6a('0x28')](handleError(_0x1ccdc8,null));};exports[_0x6c6a('0x93')]=function(_0x35425e,_0x306e04,_0xe6ff2a){return db['ChatQueue']['find']({'where':{'id':_0x35425e[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0x306e04,null))[_0x6c6a('0x36')](function(_0x33144b){if(_0x33144b){return _0x33144b[_0x6c6a('0x93')](_0x35425e[_0x6c6a('0x61')]['ids'],_[_0x6c6a('0x94')](_0x35425e['body'],['ids','id'])||{})['spread'](function(_0x32db8e){for(var _0x359826=0x0;_0x359826<_0x35425e[_0x6c6a('0x61')][_0x6c6a('0x74')]['length'];_0x359826+=0x1){socket[_0x6c6a('0x7b')](_0x6c6a('0x7c'),{'UserId':Number(_0x35425e['body'][_0x6c6a('0x74')][_0x359826]),'ChatQueueId':Number(_0x35425e['params']['id'])});}return _0x32db8e;});}})['then'](respondWithResult(_0x306e04,null))['catch'](handleError(_0x306e04,null));};exports['removeAgents']=function(_0x65d38b,_0x23ce2f,_0x175e98){return db[_0x6c6a('0x53')]['find']({'where':{'id':_0x65d38b[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0x23ce2f,null))[_0x6c6a('0x36')](function(_0x2798cb){if(_0x2798cb){return _0x2798cb[_0x6c6a('0x92')](_0x65d38b[_0x6c6a('0x45')][_0x6c6a('0x74')])[_0x6c6a('0x36')](function(){if(_[_0x6c6a('0x95')](_0x65d38b[_0x6c6a('0x45')][_0x6c6a('0x74')])){for(var _0x47b06b=0x0;_0x47b06b<_0x65d38b['query'][_0x6c6a('0x74')]['length'];_0x47b06b+=0x1){socket[_0x6c6a('0x7b')](_0x6c6a('0x96'),{'UserId':Number(_0x65d38b[_0x6c6a('0x45')]['ids'][_0x47b06b]),'ChatQueueId':Number(_0x65d38b['params']['id'])});}}else{socket[_0x6c6a('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x65d38b['query']['ids']),'ChatQueueId':Number(_0x65d38b['params']['id'])});}});}})[_0x6c6a('0x36')](respondWithStatusCode(_0x23ce2f,null))[_0x6c6a('0x28')](handleError(_0x23ce2f,null));};exports[_0x6c6a('0x97')]=function(_0x27b914,_0x2ecdbd,_0x4bd77c){var _0x2ae2da={};var _0xecac49={};var _0x1fd19b;var _0x21f84f;return db[_0x6c6a('0x53')][_0x6c6a('0x71')]({'where':{'id':_0x27b914[_0x6c6a('0x55')]['id']}})[_0x6c6a('0x36')](handleEntityNotFound(_0x2ecdbd,null))[_0x6c6a('0x36')](function(_0x5061a9){if(_0x5061a9){_0x1fd19b=_0x5061a9;_0xecac49[_0x6c6a('0x42')]=_['keys'](db[_0x6c6a('0x67')][_0x6c6a('0x3f')]);_0xecac49[_0x6c6a('0x45')]=_[_0x6c6a('0x44')](_0x27b914[_0x6c6a('0x45')]);_0xecac49[_0x6c6a('0x46')]=_[_0x6c6a('0x47')](_0xecac49[_0x6c6a('0x42')],_0xecac49['query']);_0x2ae2da[_0x6c6a('0x48')]=_[_0x6c6a('0x47')](_0xecac49[_0x6c6a('0x42')],qs[_0x6c6a('0x49')](_0x27b914[_0x6c6a('0x45')]['fields']));_0x2ae2da[_0x6c6a('0x48')]=_0x2ae2da[_0x6c6a('0x48')][_0x6c6a('0x4a')]?_0x2ae2da[_0x6c6a('0x48')]:_0xecac49[_0x6c6a('0x42')];_0x2ae2da['order']=qs[_0x6c6a('0x65')](_0x27b914[_0x6c6a('0x45')][_0x6c6a('0x65')]);_0x2ae2da[_0x6c6a('0x4e')]=qs[_0x6c6a('0x46')](_[_0x6c6a('0x4f')](_0x27b914['query'],_0xecac49[_0x6c6a('0x46')]));if(_0x27b914[_0x6c6a('0x45')]['filter']){_0x2ae2da[_0x6c6a('0x4e')]=_[_0x6c6a('0x51')](_0x2ae2da['where'],{'$or':_['map'](_0x2ae2da['attributes'],function(_0x41c28f){var _0x56b4e6={};_0x56b4e6[_0x41c28f]={'$like':'%'+_0x27b914['query'][_0x6c6a('0x50')]+'%'};return _0x56b4e6;})});}_0x2ae2da=_[_0x6c6a('0x51')]({},_0x2ae2da,_0x27b914['options']);return _0x1fd19b[_0x6c6a('0x97')](_0x2ae2da);}})[_0x6c6a('0x36')](function(_0x5f014e){if(_0x5f014e){_0x21f84f=_0x5f014e[_0x6c6a('0x4a')];if(!_0x27b914['query'][_0x6c6a('0x4b')]('nolimit')){_0x2ae2da[_0x6c6a('0x2d')]=qs[_0x6c6a('0x2d')](_0x27b914[_0x6c6a('0x45')][_0x6c6a('0x2d')]);_0x2ae2da[_0x6c6a('0x2b')]=qs['offset'](_0x27b914[_0x6c6a('0x45')]['offset']);}return _0x1fd19b[_0x6c6a('0x97')](_0x2ae2da);}})[_0x6c6a('0x36')](function(_0x1e88ae){if(_0x1e88ae){return _0x1e88ae?{'count':_0x21f84f,'rows':_0x1e88ae}:null;}})[_0x6c6a('0x36')](respondWithResult(_0x2ecdbd,null))[_0x6c6a('0x28')](handleError(_0x2ecdbd,null));}; \ No newline at end of file +var _0x5fff=['body','find','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','nolimit','ids','findAll','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x38cd0f,_0x37a639){var _0x4727df=function(_0x133d5d){while(--_0x133d5d){_0x38cd0f['push'](_0x38cd0f['shift']());}};_0x4727df(++_0x37a639);}(_0x5fff,0xd1));var _0xf5ff=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5fff[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xf5ff('0x0'));var rimraf=require(_0xf5ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5ff('0x2'));var moment=require(_0xf5ff('0x3'));var BPromise=require(_0xf5ff('0x4'));var Mustache=require(_0xf5ff('0x5'));var util=require('util');var path=require(_0xf5ff('0x6'));var sox=require('sox');var csv=require(_0xf5ff('0x7'));var ejs=require(_0xf5ff('0x8'));var fs=require('fs');var fs_extra=require(_0xf5ff('0x9'));var _=require(_0xf5ff('0xa'));var squel=require('squel');var crypto=require(_0xf5ff('0xb'));var jsforce=require(_0xf5ff('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5ff('0xd'));var Papa=require(_0xf5ff('0xe'));var Redis=require(_0xf5ff('0xf'));var authService=require(_0xf5ff('0x10'));var qs=require(_0xf5ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5ff('0x12'));var logger=require(_0xf5ff('0x13'))(_0xf5ff('0x14'));var utils=require(_0xf5ff('0x15'));var config=require(_0xf5ff('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5ff('0x17'))['db'];config[_0xf5ff('0x18')]=_[_0xf5ff('0x19')](config[_0xf5ff('0x18')],{'host':_0xf5ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5ff('0x18')]));require(_0xf5ff('0x1b'))[_0xf5ff('0x1c')](socket);var jayson=require(_0xf5ff('0x1d'));var client=jayson[_0xf5ff('0x1e')][_0xf5ff('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b24e7,_0x28add6,_0x4b4cbd,_0x495e53){return new BPromise(function(_0xac4101,_0x467d01){var _0x199309=_0x495e53||client;return _0x199309[_0xf5ff('0x20')](_0x5b24e7,_0x4b4cbd)[_0xf5ff('0x21')](function(_0x2bc39b){logger[_0xf5ff('0x22')]('ChatQueue,\x20%s,\x20%s',_0x28add6,_0xf5ff('0x23'));logger[_0xf5ff('0x24')](_0xf5ff('0x25'),_0x28add6,_0xf5ff('0x23'),JSON['stringify'](_0x2bc39b));if(_0x2bc39b[_0xf5ff('0x26')]){if(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x27')]===0x1f4){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0x467d01(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0xac4101(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}else{logger['info'](_0xf5ff('0x28'),_0x28add6,'request\x20sent');_0xac4101(_0x2bc39b[_0xf5ff('0x2a')]['message']);}})[_0xf5ff('0x2b')](function(_0x12bf00){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x12bf00);_0x467d01(_0x12bf00);});});}function respondWithStatusCode(_0x4a08d4,_0x20e086){_0x20e086=_0x20e086||0xcc;return function(_0x4747f0){if(_0x4747f0){return _0x4a08d4[_0xf5ff('0x2c')](_0x20e086);}return _0x4a08d4[_0xf5ff('0x2d')](_0x20e086)[_0xf5ff('0x2e')]();};}function respondWithResult(_0x1367a6,_0x3eee06){_0x3eee06=_0x3eee06||0xc8;return function(_0xb98881){if(_0xb98881){return _0x1367a6[_0xf5ff('0x2d')](_0x3eee06)[_0xf5ff('0x2f')](_0xb98881);}};}function respondWithFilteredResult(_0x3fe789,_0x1c98af){return function(_0x51a235){if(_0x51a235){var _0x136dde=typeof _0x1c98af[_0xf5ff('0x30')]===_0xf5ff('0x31')&&typeof _0x1c98af[_0xf5ff('0x32')]===_0xf5ff('0x31');var _0x2909a3=_0x51a235[_0xf5ff('0x33')];var _0x20124d=_0x136dde?0x0:_0x1c98af[_0xf5ff('0x30')];var _0x555432=_0x136dde?_0x51a235[_0xf5ff('0x33')]:_0x1c98af[_0xf5ff('0x30')]+_0x1c98af['limit'];var _0x4296e5;if(_0x555432>=_0x2909a3){_0x555432=_0x2909a3;_0x4296e5=0xc8;}else{_0x4296e5=0xce;}_0x3fe789[_0xf5ff('0x2d')](_0x4296e5);return _0x3fe789[_0xf5ff('0x34')](_0xf5ff('0x35'),_0x20124d+'-'+_0x555432+'/'+_0x2909a3)[_0xf5ff('0x2f')](_0x51a235);}return null;};}function patchUpdates(_0x25ffc2){return function(_0x1cb656){try{jsonpatch[_0xf5ff('0x36')](_0x1cb656,_0x25ffc2,!![]);}catch(_0x31dd96){return BPromise[_0xf5ff('0x37')](_0x31dd96);}return _0x1cb656['save']();};}function saveUpdates(_0x39e66b,_0x36eb42){return function(_0x52e705){if(_0x52e705){return _0x52e705[_0xf5ff('0x38')](_0x39e66b)[_0xf5ff('0x21')](function(_0x3e0064){return _0x3e0064;});}return null;};}function removeEntity(_0x55eaab,_0x5c61fe){return function(_0xd23180){if(_0xd23180){return _0xd23180[_0xf5ff('0x39')]()['then'](function(){var _0xd486e=_0xd23180[_0xf5ff('0x3a')]({'plain':!![]});var _0x317418=_0xf5ff('0x3b');return db['UserProfileResource'][_0xf5ff('0x39')]({'where':{'type':_0x317418,'resourceId':_0xd486e['id']}})[_0xf5ff('0x21')](function(){return _0xd23180;});})[_0xf5ff('0x21')](function(){_0x55eaab[_0xf5ff('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120e28,_0x3bca8e){return function(_0x1862f4){if(!_0x1862f4){_0x120e28[_0xf5ff('0x2c')](0x194);}return _0x1862f4;};}function handleError(_0x540d17,_0x5b829a){_0x5b829a=_0x5b829a||0x1f4;return function(_0x1c523b){logger['error'](_0x1c523b[_0xf5ff('0x3c')]);if(_0x1c523b[_0xf5ff('0x3d')]){delete _0x1c523b['name'];}_0x540d17[_0xf5ff('0x2d')](_0x5b829a)[_0xf5ff('0x3e')](_0x1c523b);};}exports[_0xf5ff('0x3f')]=function(_0x4c6863,_0x414c15){var _0xde0a7={},_0x11fead={},_0x2a2b6d={'count':0x0,'rows':[]};var _0x1fb4f1=_[_0xf5ff('0x40')](db[_0xf5ff('0x41')][_0xf5ff('0x42')],function(_0x3e0d77){return{'name':_0x3e0d77['fieldName'],'type':_0x3e0d77['type'][_0xf5ff('0x43')]};});_0x11fead['model']=_[_0xf5ff('0x40')](_0x1fb4f1,_0xf5ff('0x3d'));_0x11fead[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x4c6863['query']);_0x11fead[_0xf5ff('0x46')]=_['intersection'](_0x11fead[_0xf5ff('0x47')],_0x11fead[_0xf5ff('0x44')]);_0xde0a7[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x11fead[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xde0a7[_0xf5ff('0x48')]=_0xde0a7['attributes'][_0xf5ff('0x4b')]?_0xde0a7[_0xf5ff('0x48')]:_0x11fead[_0xf5ff('0x47')];if(!_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4c')]('nolimit')){_0xde0a7['limit']=qs[_0xf5ff('0x32')](_0x4c6863[_0xf5ff('0x44')]['limit']);_0xde0a7[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0xde0a7[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x4c6863['query'][_0xf5ff('0x4e')]);_0xde0a7[_0xf5ff('0x4f')]=qs['filters'](_[_0xf5ff('0x50')](_0x4c6863[_0xf5ff('0x44')],_0x11fead[_0xf5ff('0x46')]),_0x1fb4f1);if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0xde0a7[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0xde0a7[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x1fb4f1,function(_0x47481c){if(_0x47481c[_0xf5ff('0x53')]!==_0xf5ff('0x54')){var _0x5c7729={};_0x5c7729[_0x47481c['name']]={'$like':'%'+_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x5c7729;}})});}_0xde0a7=_[_0xf5ff('0x52')]({},_0xde0a7,_0x4c6863[_0xf5ff('0x55')]);var _0x2e881d={'where':_0xde0a7['where']};return db[_0xf5ff('0x41')]['count'](_0x2e881d)['then'](function(_0x3e7563){_0x2a2b6d[_0xf5ff('0x33')]=_0x3e7563;if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0xde0a7[_0xf5ff('0x57')]=[{'all':!![]}];}return db[_0xf5ff('0x41')]['findAll'](_0xde0a7);})['then'](function(_0x358d5f){_0x2a2b6d['rows']=_0x358d5f;return _0x2a2b6d;})[_0xf5ff('0x21')](respondWithFilteredResult(_0x414c15,_0xde0a7))['catch'](handleError(_0x414c15,null));};exports['show']=function(_0x188b0a,_0x44beb4){var _0x76d700={'raw':!![],'where':{'id':_0x188b0a['params']['id']}},_0x35c8db={};_0x35c8db[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db[_0xf5ff('0x41')][_0xf5ff('0x42')]);_0x35c8db[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x188b0a[_0xf5ff('0x44')]);_0x35c8db[_0xf5ff('0x46')]=_['intersection'](_0x35c8db[_0xf5ff('0x47')],_0x35c8db[_0xf5ff('0x44')]);_0x76d700['attributes']=_[_0xf5ff('0x49')](_0x35c8db['model'],qs[_0xf5ff('0x4a')](_0x188b0a['query'][_0xf5ff('0x4a')]));_0x76d700['attributes']=_0x76d700[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x76d700[_0xf5ff('0x48')]:_0x35c8db[_0xf5ff('0x47')];if(_0x188b0a[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0x76d700[_0xf5ff('0x57')]=[{'all':!![]}];}_0x76d700=_[_0xf5ff('0x52')]({},_0x76d700,_0x188b0a[_0xf5ff('0x55')]);return db[_0xf5ff('0x41')]['find'](_0x76d700)[_0xf5ff('0x21')](handleEntityNotFound(_0x44beb4,null))['then'](respondWithResult(_0x44beb4,null))[_0xf5ff('0x2b')](handleError(_0x44beb4,null));};exports[_0xf5ff('0x58')]=function(_0x5627de,_0x2bd286){return db[_0xf5ff('0x41')][_0xf5ff('0x58')](_0x5627de['body'],{})[_0xf5ff('0x21')](function(_0x112467){var _0x27430c=_0x5627de[_0xf5ff('0x59')][_0xf5ff('0x3a')]({'plain':!![]});if(!_0x27430c)throw new Error(_0xf5ff('0x5a'));if(_0x27430c[_0xf5ff('0x5b')]===_0xf5ff('0x59')){var _0x5ca10a=_0x112467['get']({'plain':!![]});var _0x340554=_0xf5ff('0x3b');return db[_0xf5ff('0x5c')]['find']({'where':{'name':_0x340554,'userProfileId':_0x27430c[_0xf5ff('0x5d')]},'raw':!![]})[_0xf5ff('0x21')](function(_0x2b4972){if(_0x2b4972&&_0x2b4972[_0xf5ff('0x5e')]===0x0){return db[_0xf5ff('0x5f')][_0xf5ff('0x58')]({'name':_0x5ca10a[_0xf5ff('0x3d')],'resourceId':_0x5ca10a['id'],'type':_0x2b4972[_0xf5ff('0x3d')],'sectionId':_0x2b4972['id']},{})[_0xf5ff('0x21')](function(){return _0x112467;});}else{return _0x112467;}})['catch'](function(_0x57a72c){logger[_0xf5ff('0x26')](_0xf5ff('0x60'),_0x57a72c);throw _0x57a72c;});}return _0x112467;})['then'](respondWithResult(_0x2bd286,0xc9))['catch'](handleError(_0x2bd286,null));};exports['update']=function(_0x153656,_0x44303a){if(_0x153656[_0xf5ff('0x61')]['id']){delete _0x153656[_0xf5ff('0x61')]['id'];}return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x153656[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x44303a,null))[_0xf5ff('0x21')](saveUpdates(_0x153656[_0xf5ff('0x61')],null))[_0xf5ff('0x21')](respondWithResult(_0x44303a,null))[_0xf5ff('0x2b')](handleError(_0x44303a,null));};exports[_0xf5ff('0x39')]=function(_0x5bcdfc,_0x584772){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x5bcdfc['params']['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x584772,null))['then'](removeEntity(_0x584772,null))[_0xf5ff('0x2b')](handleError(_0x584772,null));};exports[_0xf5ff('0x64')]=function(_0x4baa75,_0x1cb4e0){return db[_0xf5ff('0x41')][_0xf5ff('0x64')]()['then'](respondWithResult(_0x1cb4e0,null))[_0xf5ff('0x2b')](handleError(_0x1cb4e0,null));};exports[_0xf5ff('0x65')]=function(_0x1755c2,_0x1c4266,_0x26131a){var _0x1cb52e={'raw':!![],'where':{}},_0x4c7a12={},_0x491d20;return db['ChatQueue'][_0xf5ff('0x66')]({'where':{'id':_0x1755c2[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x1c4266,null))[_0xf5ff('0x21')](function(_0x5494a3){if(_0x5494a3){_0x491d20=_0x5494a3[_0xf5ff('0x3a')]({'plain':!![]});_0x4c7a12[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db['UserChatQueue']['rawAttributes']);_0x4c7a12[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x1755c2[_0xf5ff('0x44')]);_0x4c7a12[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],_0x4c7a12['query']);_0x1cb52e[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x1755c2['query'][_0xf5ff('0x4a')]));_0x1cb52e['attributes']=_0x1cb52e[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x1cb52e[_0xf5ff('0x48')]:_0x4c7a12[_0xf5ff('0x47')];if(!_0x1755c2['query'][_0xf5ff('0x4c')]('nolimit')){_0x1cb52e['limit']=qs[_0xf5ff('0x32')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x1cb52e[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0x1cb52e[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x1755c2['query'][_0xf5ff('0x4e')]);_0x1cb52e[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x1755c2[_0xf5ff('0x44')],_0x4c7a12[_0xf5ff('0x46')]));_0x1cb52e['where'][_0xf5ff('0x67')]=_0x5494a3['id'];if(_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x1cb52e[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0x1cb52e[_0xf5ff('0x4f')],{'$or':_['map'](_0x1cb52e[_0xf5ff('0x48')],function(_0x241ea7){var _0xe08e63={};_0xe08e63[_0x241ea7]={'$like':'%'+_0x1755c2[_0xf5ff('0x44')]['filter']+'%'};return _0xe08e63;})});}_0x1cb52e=_[_0xf5ff('0x52')]({},_0x1cb52e,_0x1755c2[_0xf5ff('0x55')]);return db[_0xf5ff('0x68')]['findAll'](_0x1cb52e);}})[_0xf5ff('0x21')](function(_0x40c3d7){if(_0x40c3d7){return db[_0xf5ff('0x69')]['findAndCountAll']({'where':{'id':_[_0xf5ff('0x40')](_0x40c3d7,'UserId'),'role':'agent'},'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x6a'),_0xf5ff('0x6b'),_0xf5ff('0x6c')]});}})[_0xf5ff('0x21')](function(_0x525b87){if(_0x525b87){return{'count':_0x525b87['count'],'rows':_['map'](_0x525b87[_0xf5ff('0x6d')],function(_0x4f1b47){return{'membername':_0x4f1b47[_0xf5ff('0x3d')],'UserId':_0x4f1b47['id'],'queue_name':_0x491d20[_0xf5ff('0x3d')],'ChatQueueId':_0x491d20['id'],'interface':util[_0xf5ff('0x6e')]('%s/%s',_0xf5ff('0x6f'),_0x4f1b47[_0xf5ff('0x3d')]),'penalty':0x0,'paused':_0x4f1b47[_0xf5ff('0x6a')],'createdAt':_0x4f1b47[_0xf5ff('0x6c')],'updatedAt':_0x4f1b47[_0xf5ff('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5ff('0x21')](respondWithFilteredResult(_0x1c4266,_0x1cb52e))[_0xf5ff('0x2b')](handleError(_0x1c4266,null));};exports[_0xf5ff('0x70')]=function(_0x352c0d,_0x246ba2,_0x2c3543){var _0xaca333={};var _0x135533={};var _0x448525;var _0x4c6a1a;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x352c0d[_0xf5ff('0x63')]['id']}})['then'](handleEntityNotFound(_0x246ba2,null))[_0xf5ff('0x21')](function(_0x15351b){if(_0x15351b){_0x448525=_0x15351b;_0x135533[_0xf5ff('0x47')]=_['keys'](db['Team'][_0xf5ff('0x42')]);_0x135533['query']=_['keys'](_0x352c0d[_0xf5ff('0x44')]);_0x135533[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],_0x135533[_0xf5ff('0x44')]);_0xaca333[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],qs['fields'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xaca333[_0xf5ff('0x48')]=_0xaca333[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0xaca333[_0xf5ff('0x48')]:_0x135533['model'];_0xaca333[_0xf5ff('0x4d')]=qs['sort'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4e')]);_0xaca333[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_['pick'](_0x352c0d['query'],_0x135533['filters']));if(_0x352c0d['query'][_0xf5ff('0x51')]){_0xaca333[_0xf5ff('0x4f')]=_['merge'](_0xaca333[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0xaca333[_0xf5ff('0x48')],function(_0x376941){var _0x2a30f1={};_0x2a30f1[_0x376941]={'$like':'%'+_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x2a30f1;})});}_0xaca333=_[_0xf5ff('0x52')]({},_0xaca333,_0x352c0d[_0xf5ff('0x55')]);return _0x448525[_0xf5ff('0x70')](_0xaca333);}})[_0xf5ff('0x21')](function(_0x4e1aca){if(_0x4e1aca){_0x4c6a1a=_0x4e1aca[_0xf5ff('0x4b')];if(!_0x352c0d['query'][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0xaca333[_0xf5ff('0x32')]=qs[_0xf5ff('0x32')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0xaca333[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x30')]);}return _0x448525[_0xf5ff('0x70')](_0xaca333);}})['then'](function(_0x2e2e0a){if(_0x2e2e0a){return _0x2e2e0a?{'count':_0x4c6a1a,'rows':_0x2e2e0a}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x246ba2,null))[_0xf5ff('0x2b')](handleError(_0x246ba2,null));};exports['addTeams']=function(_0x4d173c,_0x3ed8df,_0x30cc76){var _0x4e963f=_0x4d173c[_0xf5ff('0x61')][_0xf5ff('0x72')];return db['Team'][_0xf5ff('0x73')]({'where':{'id':_0x4e963f},'attributes':['id'],'include':[{'model':db[_0xf5ff('0x69')],'as':_0xf5ff('0x74'),'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x75'),'voicePause',_0xf5ff('0x76')],'raw':!![]}]})[_0xf5ff('0x21')](function(_0x19a3a4){if(_0x19a3a4){var _0x15fe6e=_['flatMap'](_0x19a3a4,function(_0x51f096){var _0x3a638e=_0x51f096['get']({'plain':!![]});return _0x3a638e[_0xf5ff('0x74')];});return db['ChatQueue'][_0xf5ff('0x62')]({'where':{'id':_0x4d173c[_0xf5ff('0x63')]['id']}})['then'](function(_0x5341e4){return db[_0xf5ff('0x77')][_0xf5ff('0x78')](function(_0x555c74){return _0x5341e4['addTeams'](_0x4e963f,{'transaction':_0x555c74})[_0xf5ff('0x21')](function(){return BPromise[_0xf5ff('0x79')](_0x15fe6e,function(_0x1d3557){return db['UserChatQueue'][_0xf5ff('0x7a')]({'where':{'UserId':_0x1d3557['id'],'ChatQueueId':_0x4d173c[_0xf5ff('0x63')]['id']},'transaction':_0x555c74});});})['then'](function(){_0x15fe6e[_0xf5ff('0x7b')](function(_0x4121b3){socket['emit'](_0xf5ff('0x7c'),{'UserId':_0x4121b3['id'],'ChatQueueId':_0x5341e4['id']});});});});});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x3ed8df,null))[_0xf5ff('0x2b')](handleError(_0x3ed8df,null));};exports[_0xf5ff('0x7d')]=function(_0x330203,_0x489153,_0x375853){return db[_0xf5ff('0x7e')][_0xf5ff('0x73')]({'where':{'id':_0x330203[_0xf5ff('0x44')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf5ff('0x74'),'attributes':['id'],'raw':!![]}]})[_0xf5ff('0x21')](handleEntityNotFound(_0x489153,null))[_0xf5ff('0x21')](function(_0xf35705){var _0x3293d6=_['map'](_0xf35705,'id');var _0x517e44=[];var _0x2ab075=[];var _0x13113f=squel[_0xf5ff('0x7f')]();_0x13113f[_0xf5ff('0x80')](_0xf5ff('0x81'))[_0xf5ff('0x82')]('team_has_chat_queues','tq')[_0xf5ff('0x83')](_0xf5ff('0x84'),'ut',_0xf5ff('0x85'))[_0xf5ff('0x4f')](_0xf5ff('0x86'),_0x330203['params']['id']);for(var _0x3f504c=0x0;_0x3f504c<_0xf35705[_0xf5ff('0x4b')];_0x3f504c+=0x1){let _0x5cd5b7=_0xf35705[_0x3f504c];for(var _0x45d2a6=0x0;_0x45d2a6<_0x5cd5b7[_0xf5ff('0x74')][_0xf5ff('0x4b')];_0x45d2a6+=0x1){let _0x5b4dfc=_0x5cd5b7[_0xf5ff('0x74')][_0x45d2a6];var _0x11485c=_0x13113f[_0xf5ff('0x87')]();_0x11485c[_0xf5ff('0x4f')](_0xf5ff('0x88'),_0x5b4dfc['id']);_0x2ab075['push'](db[_0xf5ff('0x77')][_0xf5ff('0x44')](_0x11485c[_0xf5ff('0x89')](),{'type':db[_0xf5ff('0x77')][_0xf5ff('0x8a')][_0xf5ff('0x8b')]})[_0xf5ff('0x21')](function(_0x57e552){if(_0x57e552[_0xf5ff('0x4b')]===0x1){return _0x5b4dfc['id'];}else{var _0x4bb31b=_[_0xf5ff('0x8c')](_[_0xf5ff('0x40')](_0x57e552,_0xf5ff('0x8d')),function(_0x4d6874){return _[_0xf5ff('0x8e')](_0x3293d6,_0x4d6874);});if(_0x4bb31b){return _0x5b4dfc['id'];}}}));}}return BPromise['all'](_0x2ab075)[_0xf5ff('0x21')](function(_0x3f91ed){_0x517e44=_(_0x517e44)[_0xf5ff('0x8f')](_0x3f91ed)[_0xf5ff('0x90')]()[_0xf5ff('0x91')]();return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x330203[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](function(_0x3ed309){return db['sequelize']['transaction'](function(_0x3864f6){return _0x3ed309['removeTeams'](_0x330203[_0xf5ff('0x44')][_0xf5ff('0x72')],{'transaction':_0x3864f6})['then'](function(){if(!_[_0xf5ff('0x92')](_0x517e44)){return _0x3ed309[_0xf5ff('0x93')](_0x517e44,{'transaction':_0x3864f6});}})[_0xf5ff('0x21')](function(){_0x517e44['forEach'](function(_0x4cbf53){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':_0x4cbf53,'ChatQueueId':_0x3ed309['id']});});});});});});})[_0xf5ff('0x21')](respondWithStatusCode(_0x489153,null))['catch'](handleError(_0x489153,null));};exports[_0xf5ff('0x96')]=function(_0x293862,_0x4e212d,_0x50d740){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x293862['params']['id']}})['then'](handleEntityNotFound(_0x4e212d,null))['then'](function(_0x66ffc8){if(_0x66ffc8){return _0x66ffc8['addAgents'](_0x293862[_0xf5ff('0x61')]['ids'],_[_0xf5ff('0x97')](_0x293862[_0xf5ff('0x61')],[_0xf5ff('0x72'),'id'])||{})['spread'](function(_0x14ccfc){for(var _0x241707=0x0;_0x241707<_0x293862[_0xf5ff('0x61')]['ids'][_0xf5ff('0x4b')];_0x241707+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x7c'),{'UserId':Number(_0x293862[_0xf5ff('0x61')][_0xf5ff('0x72')][_0x241707]),'ChatQueueId':Number(_0x293862['params']['id'])});}return _0x14ccfc;});}})[_0xf5ff('0x21')](respondWithResult(_0x4e212d,null))[_0xf5ff('0x2b')](handleError(_0x4e212d,null));};exports[_0xf5ff('0x93')]=function(_0x17332e,_0x249625,_0x38d4d0){return db[_0xf5ff('0x41')]['find']({'where':{'id':_0x17332e[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x249625,null))[_0xf5ff('0x21')](function(_0x3f0c3c){if(_0x3f0c3c){return _0x3f0c3c['removeAgents'](_0x17332e[_0xf5ff('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x17332e['query'][_0xf5ff('0x72')])){for(var _0xaafb70=0x0;_0xaafb70<_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')][_0xf5ff('0x4b')];_0xaafb70+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e['query'][_0xf5ff('0x72')][_0xaafb70]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}}else{socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x249625,null))['catch'](handleError(_0x249625,null));};exports[_0xf5ff('0x98')]=function(_0x2e6004,_0x15c155,_0x43227c){var _0x70958f={};var _0x3dac8e={};var _0x3b7f7e;var _0x71a73b;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x2e6004[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x15c155,null))[_0xf5ff('0x21')](function(_0x5cc0f5){if(_0x5cc0f5){_0x3b7f7e=_0x5cc0f5;_0x3dac8e['model']=_['keys'](db[_0xf5ff('0x69')][_0xf5ff('0x42')]);_0x3dac8e[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x2e6004[_0xf5ff('0x44')]);_0x3dac8e[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x3dac8e['model'],_0x3dac8e['query']);_0x70958f[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x3dac8e[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x2e6004[_0xf5ff('0x44')]['fields']));_0x70958f[_0xf5ff('0x48')]=_0x70958f[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x70958f[_0xf5ff('0x48')]:_0x3dac8e[_0xf5ff('0x47')];_0x70958f['order']=qs[_0xf5ff('0x4e')](_0x2e6004['query'][_0xf5ff('0x4e')]);_0x70958f['where']=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x2e6004[_0xf5ff('0x44')],_0x3dac8e[_0xf5ff('0x46')]));if(_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x70958f['where']=_[_0xf5ff('0x52')](_0x70958f[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x70958f['attributes'],function(_0x5ec7bd){var _0x11fb97={};_0x11fb97[_0x5ec7bd]={'$like':'%'+_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x11fb97;})});}_0x70958f=_['merge']({},_0x70958f,_0x2e6004[_0xf5ff('0x55')]);return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})['then'](function(_0x57875e){if(_0x57875e){_0x71a73b=_0x57875e[_0xf5ff('0x4b')];if(!_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0x70958f['limit']=qs['limit'](_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x70958f['offset']=qs[_0xf5ff('0x30')](_0x2e6004[_0xf5ff('0x44')]['offset']);}return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})[_0xf5ff('0x21')](function(_0x4b9c02){if(_0x4b9c02){return _0x4b9c02?{'count':_0x71a73b,'rows':_0x4b9c02}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x15c155,null))[_0xf5ff('0x2b')](handleError(_0x15c155,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 472ba45..13d820e 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 _0xca2f=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0xc1263e,_0x56d738){var _0x471f07=function(_0x2e6c55){while(--_0x2e6c55){_0xc1263e['push'](_0xc1263e['shift']());}};_0x471f07(++_0x56d738);}(_0xca2f,0x11c));var _0xfca2=function(_0x277a79,_0x168448){_0x277a79=_0x277a79-0x0;var _0x37dd21=_0xca2f[_0x277a79];return _0x37dd21;};'use strict';var EventEmitter=require(_0xfca2('0x0'));var ChatQueue=require(_0xfca2('0x1'))['db'][_0xfca2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfca2('0x3')](0x0);var events={'afterCreate':_0xfca2('0x4'),'afterUpdate':_0xfca2('0x5'),'afterDestroy':_0xfca2('0x6')};function emitEvent(_0x590e50){return function(_0x2f5444,_0x4de265,_0x4b7e0e){ChatQueueEvents[_0xfca2('0x7')](_0x590e50+':'+_0x2f5444['id'],_0x2f5444);ChatQueueEvents['emit'](_0x590e50,_0x2f5444);_0x4b7e0e(null);};}for(var e in events){if(events[_0xfca2('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x0b64=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','save'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0b64,0x9d));var _0x40b6=function(_0x2c861b,_0x15b01c){_0x2c861b=_0x2c861b-0x0;var _0x2f57f4=_0x0b64[_0x2c861b];return _0x2f57f4;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x40b6('0x0'))['db'][_0x40b6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40b6('0x2'),'afterUpdate':_0x40b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x950296){return function(_0xc1068a,_0x274cd4,_0xa7098a){ChatQueueEvents[_0x40b6('0x4')](_0x950296+':'+_0xc1068a['id'],_0xc1068a);ChatQueueEvents[_0x40b6('0x4')](_0x950296,_0xc1068a);_0xa7098a(null);};}for(var e in events){if(events[_0x40b6('0x5')](e)){var event=events[e];ChatQueue[_0x40b6('0x6')](e,emitEvent(event));}}module[_0x40b6('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 42848c6..92af8cd 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 _0x538a=['exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatQueue.attributes'];(function(_0x50a83a,_0x14595d){var _0x74b26e=function(_0x351a8e){while(--_0x351a8e){_0x50a83a['push'](_0x50a83a['shift']());}};_0x74b26e(++_0x14595d);}(_0x538a,0x183));var _0xa538=function(_0x5220af,_0x216f8c){_0x5220af=_0x5220af-0x0;var _0x5c0a73=_0x538a[_0x5220af];return _0x5c0a73;};'use strict';var _=require(_0xa538('0x0'));var util=require(_0xa538('0x1'));var logger=require(_0xa538('0x2'))(_0xa538('0x3'));var moment=require('moment');var BPromise=require(_0xa538('0x4'));var rp=require(_0xa538('0x5'));var fs=require('fs');var path=require(_0xa538('0x6'));var rimraf=require(_0xa538('0x7'));var config=require('../../config/environment');var attributes=require(_0xa538('0x8'));module[_0xa538('0x9')]=function(_0x1a2784,_0x4f1f09){return _0x1a2784[_0xa538('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a3d=['bluebird','request-promise','rimraf','../../config/environment','exports','util','api','moment'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7a3d,0x1bd));var _0xd7a3=function(_0x2eb066,_0x2cd4c4){_0x2eb066=_0x2eb066-0x0;var _0x5c87e6=_0x7a3d[_0x2eb066];return _0x5c87e6;};'use strict';var _=require('lodash');var util=require(_0xd7a3('0x0'));var logger=require('../../config/logger')(_0xd7a3('0x1'));var moment=require(_0xd7a3('0x2'));var BPromise=require(_0xd7a3('0x3'));var rp=require(_0xd7a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7a3('0x5'));var config=require(_0xd7a3('0x6'));var attributes=require('./chatQueue.attributes');module[_0xd7a3('0x7')]=function(_0x2e8717,_0x1752fc){return _0x2e8717['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 8604686..2eb3372 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 _0xf269=['stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowChatQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf269,0xd2));var _0x9f26=function(_0x5acc5a,_0x59b23a){_0x5acc5a=_0x5acc5a-0x0;var _0x449ee7=_0xf269[_0x5acc5a];return _0x449ee7;};'use strict';var _=require('lodash');var util=require(_0x9f26('0x0'));var moment=require(_0x9f26('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f26('0x2'));var fs=require('fs');var Redis=require(_0x9f26('0x3'));var db=require(_0x9f26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f26('0x5'))('rpc');var config=require(_0x9f26('0x6'));var jayson=require(_0x9f26('0x7'));var client=jayson[_0x9f26('0x8')][_0x9f26('0x9')]({'port':0x232a});config[_0x9f26('0xa')]=_[_0x9f26('0xb')](config[_0x9f26('0xa')],{'host':_0x9f26('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x9f26('0xd')](socket);function respondWithRpcPromise(_0x5673ff,_0x58e158,_0x4ef282){return new BPromise(function(_0x2c30e2,_0x31ed97){return client[_0x9f26('0xe')](_0x5673ff,_0x4ef282)[_0x9f26('0xf')](function(_0x550c24){logger['info']('ChatQueue,\x20%s,\x20%s',_0x58e158,_0x9f26('0x10'));logger[_0x9f26('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x58e158,_0x9f26('0x10'),JSON[_0x9f26('0x12')](_0x550c24));if(_0x550c24[_0x9f26('0x13')]){if(_0x550c24[_0x9f26('0x13')][_0x9f26('0x14')]===0x1f4){logger['error'](_0x9f26('0x15'),_0x58e158,_0x550c24[_0x9f26('0x13')][_0x9f26('0x16')]);return _0x31ed97(_0x550c24['error'][_0x9f26('0x16')]);}logger[_0x9f26('0x13')](_0x9f26('0x15'),_0x58e158,_0x550c24[_0x9f26('0x13')][_0x9f26('0x16')]);return _0x2c30e2(_0x550c24['error'][_0x9f26('0x16')]);}else{logger[_0x9f26('0x17')](_0x9f26('0x15'),_0x58e158,_0x9f26('0x10'));_0x2c30e2(_0x550c24[_0x9f26('0x18')][_0x9f26('0x16')]);}})['catch'](function(_0x50aa3d){logger[_0x9f26('0x13')]('ChatQueue,\x20%s,\x20%s',_0x58e158,_0x50aa3d);_0x31ed97(_0x50aa3d);});});}exports[_0x9f26('0x19')]=function(_0x2b3d30){var _0x81d0cc=this;return new Promise(function(_0x2b4b98,_0xa2a523){return db[_0x9f26('0x1a')][_0x9f26('0x1b')]({'raw':_0x2b3d30['options']?_0x2b3d30[_0x9f26('0x1c')][_0x9f26('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b3d30[_0x9f26('0x1c')]?_0x2b3d30[_0x9f26('0x1c')][_0x9f26('0x1e')]||null:null,'attributes':_0x2b3d30[_0x9f26('0x1c')]?_0x2b3d30[_0x9f26('0x1c')][_0x9f26('0x1f')]||null:null,'limit':_0x2b3d30[_0x9f26('0x1c')]?_0x2b3d30[_0x9f26('0x1c')][_0x9f26('0x20')]||null:null,'include':_0x2b3d30[_0x9f26('0x1c')]?_0x2b3d30['options'][_0x9f26('0x21')]?_[_0x9f26('0x22')](_0x2b3d30[_0x9f26('0x1c')][_0x9f26('0x21')],function(_0x300797){return{'model':db[_0x300797[_0x9f26('0x23')]],'as':_0x300797['as'],'attributes':_0x300797['attributes'],'include':_0x300797[_0x9f26('0x21')]?_[_0x9f26('0x22')](_0x300797['include'],function(_0x5f1973){return{'model':db[_0x5f1973[_0x9f26('0x23')]],'as':_0x5f1973['as'],'attributes':_0x5f1973['attributes'],'include':_0x5f1973[_0x9f26('0x21')]?_['map'](_0x5f1973[_0x9f26('0x21')],function(_0x25168b){return{'model':db[_0x25168b[_0x9f26('0x23')]],'as':_0x25168b['as'],'attributes':_0x25168b[_0x9f26('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9f26('0xf')](function(_0x2f086f){logger[_0x9f26('0x17')](_0x9f26('0x19'),_0x2b3d30);logger[_0x9f26('0x11')](_0x9f26('0x19'),_0x2b3d30,JSON[_0x9f26('0x12')](_0x2f086f));_0x2b4b98(_0x2f086f);})[_0x9f26('0x24')](function(_0x2dbdf9){logger[_0x9f26('0x13')](_0x9f26('0x19'),_0x2dbdf9[_0x9f26('0x16')],_0x2b3d30);_0xa2a523(_0x81d0cc[_0x9f26('0x13')](0x1f4,_0x2dbdf9[_0x9f26('0x16')]));});});};exports[_0x9f26('0x25')]=function(_0x282344){var _0x720453=this;return new Promise(function(_0x2aab54,_0x42b778){return db[_0x9f26('0x1a')]['find']({'raw':_0x282344[_0x9f26('0x1c')]?_0x282344[_0x9f26('0x1c')][_0x9f26('0x1d')]===undefined?!![]:![]:!![],'where':_0x282344[_0x9f26('0x1c')]?_0x282344[_0x9f26('0x1c')][_0x9f26('0x1e')]||null:null,'attributes':_0x282344['options']?_0x282344['options']['attributes']||null:null,'include':_0x282344[_0x9f26('0x1c')]?_0x282344[_0x9f26('0x1c')]['include']?_[_0x9f26('0x22')](_0x282344[_0x9f26('0x1c')][_0x9f26('0x21')],function(_0x13ea36){return{'model':db[_0x13ea36[_0x9f26('0x23')]],'as':_0x13ea36['as'],'attributes':_0x13ea36[_0x9f26('0x1f')],'include':_0x13ea36['include']?_[_0x9f26('0x22')](_0x13ea36[_0x9f26('0x21')],function(_0x4bd7b0){return{'model':db[_0x4bd7b0[_0x9f26('0x23')]],'as':_0x4bd7b0['as'],'attributes':_0x4bd7b0['attributes'],'include':_0x4bd7b0[_0x9f26('0x21')]?_[_0x9f26('0x22')](_0x4bd7b0[_0x9f26('0x21')],function(_0x463f3e){return{'model':db[_0x463f3e['model']],'as':_0x463f3e['as'],'attributes':_0x463f3e[_0x9f26('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9f26('0xf')](function(_0x299012){logger['info'](_0x9f26('0x25'),_0x282344);logger[_0x9f26('0x11')](_0x9f26('0x25'),_0x282344,JSON[_0x9f26('0x12')](_0x299012));_0x2aab54(_0x299012);})[_0x9f26('0x24')](function(_0x2994b5){logger['error'](_0x9f26('0x25'),_0x2994b5['message'],_0x282344);_0x42b778(_0x720453[_0x9f26('0x13')](0x1f4,_0x2994b5[_0x9f26('0x16')]));});});}; \ No newline at end of file +var _0xdc25=['code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','options','where','include','map','model','attributes','then','debug','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x10c814,_0x2c5349){var _0x3620e8=function(_0x2da52a){while(--_0x2da52a){_0x10c814['push'](_0x10c814['shift']());}};_0x3620e8(++_0x2c5349);}(_0xdc25,0x128));var _0x5dc2=function(_0x3d8005,_0x2a097e){_0x3d8005=_0x3d8005-0x0;var _0x1f3563=_0xdc25[_0x3d8005];return _0x1f3563;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require(_0x5dc2('0x5'))['db'];var utils=require(_0x5dc2('0x6'));var logger=require(_0x5dc2('0x7'))(_0x5dc2('0x8'));var config=require(_0x5dc2('0x9'));var jayson=require(_0x5dc2('0xa'));var client=jayson[_0x5dc2('0xb')][_0x5dc2('0xc')]({'port':0x232a});config[_0x5dc2('0xd')]=_[_0x5dc2('0xe')](config[_0x5dc2('0xd')],{'host':_0x5dc2('0xf'),'port':0x18eb});var socket=require(_0x5dc2('0x10'))(new Redis(config['redis']));require(_0x5dc2('0x11'))['register'](socket);function respondWithRpcPromise(_0x10133e,_0x3ef210,_0x280171){return new BPromise(function(_0x513d9d,_0x3724fd){return client[_0x5dc2('0x12')](_0x10133e,_0x280171)['then'](function(_0x2c7a15){logger[_0x5dc2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x3ef210,'request\x20sent');logger['debug'](_0x5dc2('0x14'),_0x3ef210,_0x5dc2('0x15'),JSON[_0x5dc2('0x16')](_0x2c7a15));if(_0x2c7a15[_0x5dc2('0x17')]){if(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x18')]===0x1f4){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15['error'][_0x5dc2('0x1a')]);return _0x3724fd(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);}logger[_0x5dc2('0x17')](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);return _0x513d9d(_0x2c7a15[_0x5dc2('0x17')]['message']);}else{logger[_0x5dc2('0x13')](_0x5dc2('0x19'),_0x3ef210,_0x5dc2('0x15'));_0x513d9d(_0x2c7a15['result'][_0x5dc2('0x1a')]);}})[_0x5dc2('0x1b')](function(_0x42d9ae){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x42d9ae);_0x3724fd(_0x42d9ae);});});}exports[_0x5dc2('0x1c')]=function(_0x3b2a67){var _0xcea44a=this;return new Promise(function(_0x596a24,_0xa92a14){return db[_0x5dc2('0x1d')][_0x5dc2('0x1e')]({'raw':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')][_0x5dc2('0x20')]||null:null,'attributes':_0x3b2a67['options']?_0x3b2a67[_0x5dc2('0x1f')]['attributes']||null:null,'limit':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['limit']||null:null,'include':_0x3b2a67['options']?_0x3b2a67['options'][_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0x3b2a67[_0x5dc2('0x1f')]['include'],function(_0xa43df2){return{'model':db[_0xa43df2[_0x5dc2('0x23')]],'as':_0xa43df2['as'],'attributes':_0xa43df2['attributes'],'include':_0xa43df2[_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0xa43df2['include'],function(_0x100db4){return{'model':db[_0x100db4[_0x5dc2('0x23')]],'as':_0x100db4['as'],'attributes':_0x100db4[_0x5dc2('0x24')],'include':_0x100db4['include']?_[_0x5dc2('0x22')](_0x100db4[_0x5dc2('0x21')],function(_0x7e8a44){return{'model':db[_0x7e8a44[_0x5dc2('0x23')]],'as':_0x7e8a44['as'],'attributes':_0x7e8a44[_0x5dc2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0x25')](function(_0xd641b3){logger[_0x5dc2('0x13')]('GetChatQueue',_0x3b2a67);logger[_0x5dc2('0x26')](_0x5dc2('0x1c'),_0x3b2a67,JSON[_0x5dc2('0x16')](_0xd641b3));_0x596a24(_0xd641b3);})[_0x5dc2('0x1b')](function(_0x3c7dbc){logger[_0x5dc2('0x17')](_0x5dc2('0x1c'),_0x3c7dbc[_0x5dc2('0x1a')],_0x3b2a67);_0xa92a14(_0xcea44a[_0x5dc2('0x17')](0x1f4,_0x3c7dbc['message']));});});};exports['ShowChatQueue']=function(_0x46de8f){var _0x599171=this;return new Promise(function(_0x22f6c6,_0x1470c8){return db[_0x5dc2('0x1d')]['find']({'raw':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x46de8f['options']?_0x46de8f[_0x5dc2('0x1f')]['where']||null:null,'attributes':_0x46de8f['options']?_0x46de8f['options']['attributes']||null:null,'include':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f['options']['include']?_[_0x5dc2('0x22')](_0x46de8f['options'][_0x5dc2('0x21')],function(_0x2e16ed){return{'model':db[_0x2e16ed[_0x5dc2('0x23')]],'as':_0x2e16ed['as'],'attributes':_0x2e16ed['attributes'],'include':_0x2e16ed['include']?_['map'](_0x2e16ed[_0x5dc2('0x21')],function(_0x4ae354){return{'model':db[_0x4ae354[_0x5dc2('0x23')]],'as':_0x4ae354['as'],'attributes':_0x4ae354['attributes'],'include':_0x4ae354['include']?_[_0x5dc2('0x22')](_0x4ae354['include'],function(_0x1f1f8e){return{'model':db[_0x1f1f8e[_0x5dc2('0x23')]],'as':_0x1f1f8e['as'],'attributes':_0x1f1f8e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x569889){logger[_0x5dc2('0x13')](_0x5dc2('0x27'),_0x46de8f);logger[_0x5dc2('0x26')]('ShowChatQueue',_0x46de8f,JSON[_0x5dc2('0x16')](_0x569889));_0x22f6c6(_0x569889);})['catch'](function(_0x75491c){logger[_0x5dc2('0x17')](_0x5dc2('0x27'),_0x75491c[_0x5dc2('0x1a')],_0x46de8f);_0x1470c8(_0x599171['error'](0x1f4,_0x75491c[_0x5dc2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 54cb5ad..51a9a1d 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 _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x57c380,_0x4cdaae){var _0x201cbf=function(_0x792e4f){while(--_0x792e4f){_0x57c380['push'](_0x57c380['shift']());}};_0x201cbf(++_0x4cdaae);}(_0x0faf,0x132));var _0xf0fa=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x0faf[_0x27604f];return _0x40d189;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file +var _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x114590,_0x592c84){var _0x5d4db5=function(_0x48920d){while(--_0x48920d){_0x114590['push'](_0x114590['shift']());}};_0x5d4db5(++_0x592c84);}(_0xb7c8,0x119));var _0x8b7c=function(_0xb3b23f,_0x4afa3f){_0xb3b23f=_0xb3b23f-0x0;var _0x2404e6=_0xb7c8[_0xb3b23f];return _0x2404e6;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index cdb1c31..2ec4838 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x33851c,_0x25d72f){var _0x66cf2a=function(_0x2d6d79){while(--_0x2d6d79){_0x33851c['push'](_0x33851c['shift']());}};_0x66cf2a(++_0x25d72f);}(_0x008c,0x188));var _0xc008=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0x008c[_0x41886e];return _0x10e7f4;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x58c044,_0x1e781d){var _0xf763ac=function(_0x8c0b97){while(--_0x8c0b97){_0x58c044['push'](_0x58c044['shift']());}};_0xf763ac(++_0x1e781d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2eaaf31..c80de0b 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 _0xc4e5=['DATE','sequelize','STRING'];(function(_0x24846,_0x508214){var _0x354315=function(_0x2c7dfb){while(--_0x2c7dfb){_0x24846['push'](_0x24846['shift']());}};_0x354315(++_0x508214);}(_0xc4e5,0x12a));var _0x5c4e=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xc4e5[_0x1be3b3];return _0x4f8b2d;};'use strict';var moment=require('moment');var Sequelize=require(_0x5c4e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5c4e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5c4e('0x1')]},'joinAt':{'type':Sequelize[_0x5c4e('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5c4e('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27c0=['sequelize','STRING','DATE','moment'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x27c0,0x1bb));var _0x027c=function(_0x22f082,_0x40fee4){_0x22f082=_0x22f082-0x0;var _0x66507b=_0x27c0[_0x22f082];return _0x66507b;};'use strict';var moment=require(_0x027c('0x0'));var Sequelize=require(_0x027c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x027c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x027c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x027c('0x3')]},'exitAt':{'type':Sequelize[_0x027c('0x3')]},'reason':{'type':Sequelize[_0x027c('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 39c8b95..392a32c 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 _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0x5162[_0x2a9f4];return _0x3c39e0;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['ChatQueueReport']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));}; \ No newline at end of file +var _0xac6a=['apply','reject','save','then','sendStatus','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','filter','where','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xac6a,0xc2));var _0xaac6=function(_0x96012a,_0x557faa){_0x96012a=_0x96012a-0x0;var _0x22c728=_0xac6a[_0x96012a];return _0x22c728;};'use strict';var emlformat=require(_0xaac6('0x0'));var rimraf=require(_0xaac6('0x1'));var zipdir=require(_0xaac6('0x2'));var jsonpatch=require(_0xaac6('0x3'));var rp=require(_0xaac6('0x4'));var moment=require('moment');var BPromise=require(_0xaac6('0x5'));var Mustache=require('mustache');var util=require(_0xaac6('0x6'));var path=require(_0xaac6('0x7'));var sox=require(_0xaac6('0x8'));var csv=require(_0xaac6('0x9'));var ejs=require(_0xaac6('0xa'));var fs=require('fs');var fs_extra=require(_0xaac6('0xb'));var _=require(_0xaac6('0xc'));var squel=require(_0xaac6('0xd'));var crypto=require(_0xaac6('0xe'));var jsforce=require(_0xaac6('0xf'));var deskjs=require(_0xaac6('0x10'));var toCsv=require(_0xaac6('0x9'));var querystring=require('querystring');var Papa=require(_0xaac6('0x11'));var Redis=require(_0xaac6('0x12'));var authService=require(_0xaac6('0x13'));var qs=require(_0xaac6('0x14'));var as=require(_0xaac6('0x15'));var hardwareService=require(_0xaac6('0x16'));var logger=require('../../config/logger')(_0xaac6('0x17'));var utils=require(_0xaac6('0x18'));var config=require(_0xaac6('0x19'));var licenseUtil=require(_0xaac6('0x1a'));var db=require(_0xaac6('0x1b'))['db'];function respondWithStatusCode(_0x57869f,_0x551fea){_0x551fea=_0x551fea||0xcc;return function(_0x1efac6){if(_0x1efac6){return _0x57869f['sendStatus'](_0x551fea);}return _0x57869f['status'](_0x551fea)[_0xaac6('0x1c')]();};}function respondWithResult(_0xcdfe7c,_0x2a074a){_0x2a074a=_0x2a074a||0xc8;return function(_0x404d82){if(_0x404d82){return _0xcdfe7c[_0xaac6('0x1d')](_0x2a074a)[_0xaac6('0x1e')](_0x404d82);}};}function respondWithFilteredResult(_0x130152,_0xc873f9){return function(_0x1c42fe){if(_0x1c42fe){var _0x1ceeca=typeof _0xc873f9[_0xaac6('0x1f')]===_0xaac6('0x20')&&typeof _0xc873f9['limit']==='undefined';var _0x8d0c31=_0x1c42fe[_0xaac6('0x21')];var _0x3cce6f=_0x1ceeca?0x0:_0xc873f9[_0xaac6('0x1f')];var _0x3d234a=_0x1ceeca?_0x1c42fe['count']:_0xc873f9[_0xaac6('0x1f')]+_0xc873f9[_0xaac6('0x22')];var _0x26dd96;if(_0x3d234a>=_0x8d0c31){_0x3d234a=_0x8d0c31;_0x26dd96=0xc8;}else{_0x26dd96=0xce;}_0x130152[_0xaac6('0x1d')](_0x26dd96);return _0x130152[_0xaac6('0x23')](_0xaac6('0x24'),_0x3cce6f+'-'+_0x3d234a+'/'+_0x8d0c31)[_0xaac6('0x1e')](_0x1c42fe);}return null;};}function patchUpdates(_0x4a6064){return function(_0x3fcc7b){try{jsonpatch[_0xaac6('0x25')](_0x3fcc7b,_0x4a6064,!![]);}catch(_0x276123){return BPromise[_0xaac6('0x26')](_0x276123);}return _0x3fcc7b[_0xaac6('0x27')]();};}function saveUpdates(_0x12682c,_0x2afe80){return function(_0x4f7089){if(_0x4f7089){return _0x4f7089['update'](_0x12682c)[_0xaac6('0x28')](function(_0x54592c){return _0x54592c;});}return null;};}function removeEntity(_0x18c220,_0x12dfa5){return function(_0x326238){if(_0x326238){return _0x326238['destroy']()[_0xaac6('0x28')](function(){_0x18c220['status'](0xcc)[_0xaac6('0x1c')]();});}};}function handleEntityNotFound(_0x943dc9,_0x21ea41){return function(_0x335300){if(!_0x335300){_0x943dc9[_0xaac6('0x29')](0x194);}return _0x335300;};}function handleError(_0x58dfb3,_0xc4b235){_0xc4b235=_0xc4b235||0x1f4;return function(_0x321cbc){logger['error'](_0x321cbc['stack']);if(_0x321cbc[_0xaac6('0x2a')]){delete _0x321cbc['name'];}_0x58dfb3[_0xaac6('0x1d')](_0xc4b235)[_0xaac6('0x2b')](_0x321cbc);};}exports[_0xaac6('0x2c')]=function(_0x3b63f3,_0x19f0c0){var _0x5d6950={},_0x19ebcf={},_0xb02a9b={'count':0x0,'rows':[]};var _0x32f29b=_['map'](db[_0xaac6('0x2d')][_0xaac6('0x2e')],function(_0x43c46e){return{'name':_0x43c46e[_0xaac6('0x2f')],'type':_0x43c46e[_0xaac6('0x30')]['key']};});_0x19ebcf['model']=_[_0xaac6('0x31')](_0x32f29b,_0xaac6('0x2a'));_0x19ebcf[_0xaac6('0x32')]=_['keys'](_0x3b63f3[_0xaac6('0x32')]);_0x19ebcf[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x19ebcf['model'],_0x19ebcf[_0xaac6('0x32')]);_0x5d6950[_0xaac6('0x35')]=_[_0xaac6('0x34')](_0x19ebcf[_0xaac6('0x36')],qs[_0xaac6('0x37')](_0x3b63f3['query'][_0xaac6('0x37')]));_0x5d6950[_0xaac6('0x35')]=_0x5d6950['attributes'][_0xaac6('0x38')]?_0x5d6950[_0xaac6('0x35')]:_0x19ebcf['model'];if(!_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x39')](_0xaac6('0x3a'))){_0x5d6950[_0xaac6('0x22')]=qs[_0xaac6('0x22')](_0x3b63f3['query'][_0xaac6('0x22')]);_0x5d6950[_0xaac6('0x1f')]=qs[_0xaac6('0x1f')](_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x1f')]);}_0x5d6950['order']=qs['sort'](_0x3b63f3['query']['sort']);_0x5d6950['where']=qs[_0xaac6('0x33')](_['pick'](_0x3b63f3[_0xaac6('0x32')],_0x19ebcf[_0xaac6('0x33')]),_0x32f29b);if(_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]){_0x5d6950[_0xaac6('0x3c')]=_[_0xaac6('0x3d')](_0x5d6950[_0xaac6('0x3c')],{'$or':_[_0xaac6('0x31')](_0x32f29b,function(_0x185659){if(_0x185659[_0xaac6('0x30')]!=='VIRTUAL'){var _0x55da98={};_0x55da98[_0x185659['name']]={'$like':'%'+_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]+'%'};return _0x55da98;}})});}_0x5d6950=_['merge']({},_0x5d6950,_0x3b63f3[_0xaac6('0x3e')]);var _0x3d5807={'where':_0x5d6950[_0xaac6('0x3c')]};return db[_0xaac6('0x2d')][_0xaac6('0x21')](_0x3d5807)['then'](function(_0x296ce6){_0xb02a9b[_0xaac6('0x21')]=_0x296ce6;if(_0x3b63f3[_0xaac6('0x32')]['includeAll']){_0x5d6950['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xaac6('0x3f')](_0x5d6950);})[_0xaac6('0x28')](function(_0x1cdcca){_0xb02a9b[_0xaac6('0x40')]=_0x1cdcca;return _0xb02a9b;})['then'](respondWithFilteredResult(_0x19f0c0,_0x5d6950))['catch'](handleError(_0x19f0c0,null));};exports[_0xaac6('0x41')]=function(_0xfbab0c,_0x217e6e){var _0x365e0e={'raw':!![],'where':{'id':_0xfbab0c[_0xaac6('0x42')]['id']}},_0x40d21a={};_0x40d21a[_0xaac6('0x36')]=_[_0xaac6('0x43')](db['ChatQueueReport'][_0xaac6('0x2e')]);_0x40d21a[_0xaac6('0x32')]=_[_0xaac6('0x43')](_0xfbab0c[_0xaac6('0x32')]);_0x40d21a[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x40d21a[_0xaac6('0x36')],_0x40d21a[_0xaac6('0x32')]);_0x365e0e['attributes']=_[_0xaac6('0x34')](_0x40d21a['model'],qs[_0xaac6('0x37')](_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x37')]));_0x365e0e[_0xaac6('0x35')]=_0x365e0e[_0xaac6('0x35')]['length']?_0x365e0e[_0xaac6('0x35')]:_0x40d21a[_0xaac6('0x36')];if(_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x44')]){_0x365e0e[_0xaac6('0x45')]=[{'all':!![]}];}_0x365e0e=_[_0xaac6('0x3d')]({},_0x365e0e,_0xfbab0c[_0xaac6('0x3e')]);return db[_0xaac6('0x2d')]['find'](_0x365e0e)[_0xaac6('0x28')](handleEntityNotFound(_0x217e6e,null))[_0xaac6('0x28')](respondWithResult(_0x217e6e,null))[_0xaac6('0x46')](handleError(_0x217e6e,null));};exports['create']=function(_0x15d695,_0x1b53f5){return db[_0xaac6('0x2d')][_0xaac6('0x47')](_0x15d695[_0xaac6('0x48')],{})[_0xaac6('0x28')](respondWithResult(_0x1b53f5,0xc9))['catch'](handleError(_0x1b53f5,null));};exports[_0xaac6('0x49')]=function(_0x2af290,_0x644ec3){if(_0x2af290[_0xaac6('0x48')]['id']){delete _0x2af290['body']['id'];}return db['ChatQueueReport'][_0xaac6('0x4a')]({'where':{'id':_0x2af290[_0xaac6('0x42')]['id']}})['then'](handleEntityNotFound(_0x644ec3,null))[_0xaac6('0x28')](saveUpdates(_0x2af290[_0xaac6('0x48')],null))[_0xaac6('0x28')](respondWithResult(_0x644ec3,null))[_0xaac6('0x46')](handleError(_0x644ec3,null));};exports[_0xaac6('0x4b')]=function(_0x265850,_0x593179){return db[_0xaac6('0x2d')][_0xaac6('0x4a')]({'where':{'id':_0x265850['params']['id']}})[_0xaac6('0x28')](handleEntityNotFound(_0x593179,null))[_0xaac6('0x28')](removeEntity(_0x593179,null))['catch'](handleError(_0x593179,null));};exports['describe']=function(_0x101078,_0x16a6f0){return db['ChatQueueReport'][_0xaac6('0x4c')]()[_0xaac6('0x28')](respondWithResult(_0x16a6f0,null))[_0xaac6('0x46')](handleError(_0x16a6f0,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7e691aa..e9cb429 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x294ee4,_0x3773a9){var _0x1a3f59=function(_0x3a9f53){while(--_0x3a9f53){_0x294ee4['push'](_0x294ee4['shift']());}};_0x1a3f59(++_0x3773a9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xcb91[_0x529f1c];return _0x4d57ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x539b22,_0x5541b6){var _0x5adc6e=function(_0x2bfff0){while(--_0x2bfff0){_0x539b22['push'](_0x539b22['shift']());}};_0x5adc6e(++_0x5541b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 30b428d..3e4c2b4 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 _0x4d41=['message','CreateChatQueueReport','create','body','options','update','raw','where','attributes','UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x264cb2,_0x410d89){var _0x387e9a=function(_0x2a3a07){while(--_0x2a3a07){_0x264cb2['push'](_0x264cb2['shift']());}};_0x387e9a(++_0x410d89);}(_0x4d41,0x1a0));var _0x14d4=function(_0x7440e0,_0x42d9b8){_0x7440e0=_0x7440e0-0x0;var _0x33ee99=_0x4d41[_0x7440e0];return _0x33ee99;};'use strict';var _=require(_0x14d4('0x0'));var util=require('util');var moment=require(_0x14d4('0x1'));var BPromise=require('bluebird');var rs=require(_0x14d4('0x2'));var fs=require('fs');var Redis=require(_0x14d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14d4('0x4'));var logger=require(_0x14d4('0x5'))('rpc');var config=require(_0x14d4('0x6'));var jayson=require(_0x14d4('0x7'));var client=jayson[_0x14d4('0x8')][_0x14d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3880ad,_0x10db52,_0x5afc24){return new BPromise(function(_0x211701,_0x1d345d){return client[_0x14d4('0xa')](_0x3880ad,_0x5afc24)[_0x14d4('0xb')](function(_0x57c107){logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,'request\x20sent');logger[_0x14d4('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x10db52,_0x14d4('0xf'),JSON[_0x14d4('0x10')](_0x57c107));if(_0x57c107[_0x14d4('0x11')]){if(_0x57c107['error'][_0x14d4('0x12')]===0x1f4){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x57c107['error'][_0x14d4('0x13')]);return _0x1d345d(_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);}logger['error'](_0x14d4('0xd'),_0x10db52,_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);return _0x211701(_0x57c107[_0x14d4('0x11')]['message']);}else{logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,_0x14d4('0xf'));_0x211701(_0x57c107['result'][_0x14d4('0x13')]);}})['catch'](function(_0x21072b){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x21072b);_0x1d345d(_0x21072b);});});}exports[_0x14d4('0x14')]=function(_0x4be7ed){var _0x3adaa1=this;return new Promise(function(_0x4544bb,_0x4b4be4){return db['ChatQueueReport'][_0x14d4('0x15')](_0x4be7ed[_0x14d4('0x16')],{'raw':_0x4be7ed['options']?_0x4be7ed[_0x14d4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x14d4('0xb')](function(_0x6535e8){logger['info'](_0x14d4('0x14'),_0x4be7ed);logger['debug'](_0x14d4('0x14'),_0x4be7ed,JSON[_0x14d4('0x10')](_0x6535e8));_0x4544bb(_0x6535e8);})['catch'](function(_0x157c1d){logger[_0x14d4('0x11')](_0x14d4('0x14'),_0x157c1d[_0x14d4('0x13')],_0x4be7ed);_0x4b4be4(_0x3adaa1['error'](0x1f4,_0x157c1d[_0x14d4('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x598773){var _0x2f0c0c=this;return new Promise(function(_0xd3d24e,_0x543c58){return db['ChatQueueReport'][_0x14d4('0x18')](_0x598773[_0x14d4('0x16')],{'raw':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')][_0x14d4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598773['options']?_0x598773[_0x14d4('0x17')][_0x14d4('0x1a')]||null:null,'attributes':_0x598773[_0x14d4('0x17')]?_0x598773['options'][_0x14d4('0x1b')]||null:null,'limit':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')]['limit']||null:null})['then'](function(_0x37ebca){logger[_0x14d4('0xc')](_0x14d4('0x1c'),_0x598773);logger[_0x14d4('0xe')]('UpdateChatQueueReport',_0x598773,JSON[_0x14d4('0x10')](_0x37ebca));_0xd3d24e(_0x37ebca);})['catch'](function(_0x5a84a0){logger['error']('UpdateChatQueueReport',_0x5a84a0[_0x14d4('0x13')],_0x598773);_0x543c58(_0x2f0c0c[_0x14d4('0x11')](0x1f4,_0x5a84a0['message']));});});}; \ No newline at end of file +var _0xdc35=['request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x28b018,_0x4fbe0d){var _0x9c8f15=function(_0x1fb613){while(--_0x1fb613){_0x28b018['push'](_0x28b018['shift']());}};_0x9c8f15(++_0x4fbe0d);}(_0xdc35,0xd6));var _0x5dc3=function(_0x57aed8,_0x6fb70b){_0x57aed8=_0x57aed8-0x0;var _0x4a9c3b=_0xdc35[_0x57aed8];return _0x4a9c3b;};'use strict';var _=require(_0x5dc3('0x0'));var util=require('util');var moment=require(_0x5dc3('0x1'));var BPromise=require(_0x5dc3('0x2'));var rs=require(_0x5dc3('0x3'));var fs=require('fs');var Redis=require(_0x5dc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc3('0x5'));var logger=require(_0x5dc3('0x6'))('rpc');var config=require(_0x5dc3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dc3('0x8')][_0x5dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f0f1,_0x452fe4,_0x162980){return new BPromise(function(_0x1146dc,_0x472506){return client[_0x5dc3('0xa')](_0x44f0f1,_0x162980)[_0x5dc3('0xb')](function(_0x24f17e){logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));logger[_0x5dc3('0xf')](_0x5dc3('0x10'),_0x452fe4,_0x5dc3('0xe'),JSON[_0x5dc3('0x11')](_0x24f17e));if(_0x24f17e[_0x5dc3('0x12')]){if(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x13')]===0x1f4){logger[_0x5dc3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x452fe4,_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);return _0x472506(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x24f17e[_0x5dc3('0x12')]['message']);return _0x1146dc(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}else{logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));_0x1146dc(_0x24f17e['result'][_0x5dc3('0x14')]);}})[_0x5dc3('0x15')](function(_0x2aab46){logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x2aab46);_0x472506(_0x2aab46);});});}exports[_0x5dc3('0x16')]=function(_0x1218ad){var _0x4b5107=this;return new Promise(function(_0x3da36e,_0x582442){return db[_0x5dc3('0x17')][_0x5dc3('0x18')](_0x1218ad[_0x5dc3('0x19')],{'raw':_0x1218ad['options']?_0x1218ad[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![]})[_0x5dc3('0xb')](function(_0x3e51b4){logger[_0x5dc3('0xc')](_0x5dc3('0x16'),_0x1218ad);logger['debug'](_0x5dc3('0x16'),_0x1218ad,JSON['stringify'](_0x3e51b4));_0x3da36e(_0x3e51b4);})['catch'](function(_0x5d11bb){logger[_0x5dc3('0x12')](_0x5dc3('0x16'),_0x5d11bb[_0x5dc3('0x14')],_0x1218ad);_0x582442(_0x4b5107[_0x5dc3('0x12')](0x1f4,_0x5d11bb[_0x5dc3('0x14')]));});});};exports[_0x5dc3('0x1c')]=function(_0x3927ee){var _0x47a0c3=this;return new Promise(function(_0xcbe2f2,_0x14dc54){return db[_0x5dc3('0x17')][_0x5dc3('0x1d')](_0x3927ee[_0x5dc3('0x19')],{'raw':_0x3927ee['options']?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1e')]||null:null,'attributes':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')]['attributes']||null:null,'limit':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1f')]||null:null})[_0x5dc3('0xb')](function(_0x15091d){logger['info']('UpdateChatQueueReport',_0x3927ee);logger[_0x5dc3('0xf')](_0x5dc3('0x1c'),_0x3927ee,JSON[_0x5dc3('0x11')](_0x15091d));_0xcbe2f2(_0x15091d);})[_0x5dc3('0x15')](function(_0x1d44f3){logger[_0x5dc3('0x12')](_0x5dc3('0x1c'),_0x1d44f3[_0x5dc3('0x14')],_0x3927ee);_0x14dc54(_0x47a0c3[_0x5dc3('0x12')](0x1f4,_0x1d44f3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5a79364..66ecd58 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 _0x641b=['/:id','show','post','create','put','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0xd75423,_0x432c0e){var _0x27e8ec=function(_0x19a198){while(--_0x19a198){_0xd75423['push'](_0xd75423['shift']());}};_0x27e8ec(++_0x432c0e);}(_0x641b,0x14b));var _0xb641=function(_0x3268a5,_0x3c60f4){_0x3268a5=_0x3268a5-0x0;var _0x4d1e92=_0x641b[_0x3268a5];return _0x4d1e92;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb641('0x0'));var timeout=require(_0xb641('0x1'));var express=require('express');var router=express[_0xb641('0x2')]();var fs_extra=require(_0xb641('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb641('0x4'));var config=require(_0xb641('0x5'));var controller=require(_0xb641('0x6'));router[_0xb641('0x7')]('/',auth['isAuthenticated'](),controller[_0xb641('0x8')]);router[_0xb641('0x7')](_0xb641('0x9'),auth[_0xb641('0xa')](),controller['describe']);router[_0xb641('0x7')](_0xb641('0xb'),auth[_0xb641('0xa')](),controller[_0xb641('0xc')]);router[_0xb641('0xd')]('/',auth[_0xb641('0xa')](),controller[_0xb641('0xe')]);router[_0xb641('0xf')]('/:id',auth[_0xb641('0xa')](),controller['update']);router[_0xb641('0x10')](_0xb641('0xb'),auth[_0xb641('0xa')](),controller[_0xb641('0x11')]);module[_0xb641('0x12')]=router; \ No newline at end of file +var _0xb220=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xb220,0x153));var _0x0b22=function(_0x486d6f,_0x101ab0){_0x486d6f=_0x486d6f-0x0;var _0x413481=_0xb220[_0x486d6f];return _0x413481;};'use strict';var multer=require(_0x0b22('0x0'));var util=require('util');var path=require(_0x0b22('0x1'));var timeout=require(_0x0b22('0x2'));var express=require(_0x0b22('0x3'));var router=express[_0x0b22('0x4')]();var fs_extra=require(_0x0b22('0x5'));var auth=require(_0x0b22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b22('0x7'));var controller=require(_0x0b22('0x8'));router[_0x0b22('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b22('0xa')]);router[_0x0b22('0x9')](_0x0b22('0xb'),auth[_0x0b22('0xc')](),controller['describe']);router['get'](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['show']);router[_0x0b22('0xe')]('/',auth[_0x0b22('0xc')](),controller[_0x0b22('0xf')]);router[_0x0b22('0x10')](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['update']);router['delete']('/:id',auth[_0x0b22('0xc')](),controller[_0x0b22('0x11')]);module[_0x0b22('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f331dc1..653e674 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0x54ef,0x112));var _0xf54e=function(_0x142f9d,_0x5c7e90){_0x142f9d=_0x142f9d-0x0;var _0x1dfa36=_0x54ef[_0x142f9d];return _0x1dfa36;};'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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x41d938,_0x107a5b){var _0x38e26b=function(_0x5b4caf){while(--_0x5b4caf){_0x41d938['push'](_0x41d938['shift']());}};_0x38e26b(++_0x107a5b);}(_0xe706,0xa3));var _0x6e70=function(_0x3645e5,_0x1e9457){_0x3645e5=_0x3645e5-0x0;var _0x25f856=_0xe706[_0x3645e5];return _0x25f856;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 8683810..f8d9638 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 _0xa5c9=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','update','then','destroy','end','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query'];(function(_0x5f2370,_0xb44e5b){var _0x178478=function(_0x170648){while(--_0x170648){_0x5f2370['push'](_0x5f2370['shift']());}};_0x178478(++_0xb44e5b);}(_0xa5c9,0x143));var _0x9a5c=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0xa5c9[_0x425716];return _0x2d39af;};'use strict';var emlformat=require(_0x9a5c('0x0'));var rimraf=require(_0x9a5c('0x1'));var zipdir=require(_0x9a5c('0x2'));var jsonpatch=require(_0x9a5c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a5c('0x4'));var Mustache=require(_0x9a5c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9a5c('0x6'));var ejs=require(_0x9a5c('0x7'));var fs=require('fs');var fs_extra=require(_0x9a5c('0x8'));var _=require(_0x9a5c('0x9'));var squel=require('squel');var crypto=require(_0x9a5c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9a5c('0xb'));var toCsv=require(_0x9a5c('0x6'));var querystring=require('querystring');var Papa=require(_0x9a5c('0xc'));var Redis=require(_0x9a5c('0xd'));var authService=require(_0x9a5c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a5c('0xf'));var logger=require(_0x9a5c('0x10'))(_0x9a5c('0x11'));var utils=require(_0x9a5c('0x12'));var config=require(_0x9a5c('0x13'));var licenseUtil=require(_0x9a5c('0x14'));var db=require(_0x9a5c('0x15'))['db'];function respondWithStatusCode(_0x957b17,_0x1e81b7){_0x1e81b7=_0x1e81b7||0xcc;return function(_0x381229){if(_0x381229){return _0x957b17[_0x9a5c('0x16')](_0x1e81b7);}return _0x957b17[_0x9a5c('0x17')](_0x1e81b7)['end']();};}function respondWithResult(_0x44da1b,_0x3c39d6){_0x3c39d6=_0x3c39d6||0xc8;return function(_0x2b1cef){if(_0x2b1cef){return _0x44da1b['status'](_0x3c39d6)[_0x9a5c('0x18')](_0x2b1cef);}};}function respondWithFilteredResult(_0x1f008e,_0x5d5f74){return function(_0x16422d){if(_0x16422d){var _0x5ef98e=typeof _0x5d5f74[_0x9a5c('0x19')]==='undefined'&&typeof _0x5d5f74[_0x9a5c('0x1a')]===_0x9a5c('0x1b');var _0x59e410=_0x16422d[_0x9a5c('0x1c')];var _0x3f06b6=_0x5ef98e?0x0:_0x5d5f74[_0x9a5c('0x19')];var _0x4bb262=_0x5ef98e?_0x16422d[_0x9a5c('0x1c')]:_0x5d5f74[_0x9a5c('0x19')]+_0x5d5f74[_0x9a5c('0x1a')];var _0x5e2bd3;if(_0x4bb262>=_0x59e410){_0x4bb262=_0x59e410;_0x5e2bd3=0xc8;}else{_0x5e2bd3=0xce;}_0x1f008e[_0x9a5c('0x17')](_0x5e2bd3);return _0x1f008e[_0x9a5c('0x1d')]('Content-Range',_0x3f06b6+'-'+_0x4bb262+'/'+_0x59e410)[_0x9a5c('0x18')](_0x16422d);}return null;};}function patchUpdates(_0x41283c){return function(_0xe42960){try{jsonpatch['apply'](_0xe42960,_0x41283c,!![]);}catch(_0xf121cd){return BPromise[_0x9a5c('0x1e')](_0xf121cd);}return _0xe42960['save']();};}function saveUpdates(_0x2b3d20,_0x191881){return function(_0x5659b4){if(_0x5659b4){return _0x5659b4[_0x9a5c('0x1f')](_0x2b3d20)[_0x9a5c('0x20')](function(_0x214b65){return _0x214b65;});}return null;};}function removeEntity(_0x5719eb,_0x17dc2f){return function(_0x3f7d13){if(_0x3f7d13){return _0x3f7d13[_0x9a5c('0x21')]()[_0x9a5c('0x20')](function(){_0x5719eb[_0x9a5c('0x17')](0xcc)[_0x9a5c('0x22')]();});}};}function handleEntityNotFound(_0x47a13a,_0x538e65){return function(_0x34c636){if(!_0x34c636){_0x47a13a[_0x9a5c('0x16')](0x194);}return _0x34c636;};}function handleError(_0x10db7a,_0x3713fd){_0x3713fd=_0x3713fd||0x1f4;return function(_0x573412){logger[_0x9a5c('0x23')](_0x573412[_0x9a5c('0x24')]);if(_0x573412[_0x9a5c('0x25')]){delete _0x573412[_0x9a5c('0x25')];}_0x10db7a[_0x9a5c('0x17')](_0x3713fd)[_0x9a5c('0x26')](_0x573412);};}exports[_0x9a5c('0x27')]=function(_0x4146c9,_0x3d3356){var _0x4e6cee={},_0x2bdb5b={},_0x5e22ab={'count':0x0,'rows':[]};var _0x4dac2a=_['map'](db[_0x9a5c('0x28')][_0x9a5c('0x29')],function(_0x214953){return{'name':_0x214953[_0x9a5c('0x2a')],'type':_0x214953[_0x9a5c('0x2b')][_0x9a5c('0x2c')]};});_0x2bdb5b['model']=_[_0x9a5c('0x2d')](_0x4dac2a,_0x9a5c('0x25'));_0x2bdb5b[_0x9a5c('0x2e')]=_['keys'](_0x4146c9[_0x9a5c('0x2e')]);_0x2bdb5b[_0x9a5c('0x2f')]=_[_0x9a5c('0x30')](_0x2bdb5b[_0x9a5c('0x31')],_0x2bdb5b['query']);_0x4e6cee[_0x9a5c('0x32')]=_['intersection'](_0x2bdb5b[_0x9a5c('0x31')],qs['fields'](_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x33')]));_0x4e6cee[_0x9a5c('0x32')]=_0x4e6cee[_0x9a5c('0x32')][_0x9a5c('0x34')]?_0x4e6cee[_0x9a5c('0x32')]:_0x2bdb5b['model'];if(!_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x35')](_0x9a5c('0x36'))){_0x4e6cee[_0x9a5c('0x1a')]=qs['limit'](_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x1a')]);_0x4e6cee['offset']=qs[_0x9a5c('0x19')](_0x4146c9[_0x9a5c('0x2e')]['offset']);}_0x4e6cee[_0x9a5c('0x37')]=qs['sort'](_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x38')]);_0x4e6cee[_0x9a5c('0x39')]=qs[_0x9a5c('0x2f')](_[_0x9a5c('0x3a')](_0x4146c9['query'],_0x2bdb5b['filters']),_0x4dac2a);if(_0x4146c9['query']['filter']){_0x4e6cee[_0x9a5c('0x39')]=_[_0x9a5c('0x3b')](_0x4e6cee[_0x9a5c('0x39')],{'$or':_[_0x9a5c('0x2d')](_0x4dac2a,function(_0x27de82){if(_0x27de82[_0x9a5c('0x2b')]!==_0x9a5c('0x3c')){var _0x24879e={};_0x24879e[_0x27de82[_0x9a5c('0x25')]]={'$like':'%'+_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x3d')]+'%'};return _0x24879e;}})});}_0x4e6cee=_['merge']({},_0x4e6cee,_0x4146c9[_0x9a5c('0x3e')]);var _0x158376={'where':_0x4e6cee[_0x9a5c('0x39')]};return db[_0x9a5c('0x28')]['count'](_0x158376)[_0x9a5c('0x20')](function(_0x3394a8){_0x5e22ab['count']=_0x3394a8;if(_0x4146c9[_0x9a5c('0x2e')][_0x9a5c('0x3f')]){_0x4e6cee[_0x9a5c('0x40')]=[{'all':!![]}];}return db[_0x9a5c('0x28')][_0x9a5c('0x41')](_0x4e6cee);})[_0x9a5c('0x20')](function(_0xd61373){_0x5e22ab[_0x9a5c('0x42')]=_0xd61373;return _0x5e22ab;})[_0x9a5c('0x20')](respondWithFilteredResult(_0x3d3356,_0x4e6cee))[_0x9a5c('0x43')](handleError(_0x3d3356,null));};exports['show']=function(_0x5886a1,_0x13e866){var _0x3456a7={'raw':!![],'where':{'id':_0x5886a1[_0x9a5c('0x44')]['id']}},_0x4097a6={};_0x4097a6[_0x9a5c('0x31')]=_[_0x9a5c('0x45')](db[_0x9a5c('0x28')][_0x9a5c('0x29')]);_0x4097a6[_0x9a5c('0x2e')]=_[_0x9a5c('0x45')](_0x5886a1[_0x9a5c('0x2e')]);_0x4097a6[_0x9a5c('0x2f')]=_['intersection'](_0x4097a6['model'],_0x4097a6[_0x9a5c('0x2e')]);_0x3456a7[_0x9a5c('0x32')]=_['intersection'](_0x4097a6[_0x9a5c('0x31')],qs[_0x9a5c('0x33')](_0x5886a1['query']['fields']));_0x3456a7['attributes']=_0x3456a7[_0x9a5c('0x32')]['length']?_0x3456a7[_0x9a5c('0x32')]:_0x4097a6[_0x9a5c('0x31')];if(_0x5886a1['query'][_0x9a5c('0x3f')]){_0x3456a7[_0x9a5c('0x40')]=[{'all':!![]}];}_0x3456a7=_['merge']({},_0x3456a7,_0x5886a1[_0x9a5c('0x3e')]);return db[_0x9a5c('0x28')]['find'](_0x3456a7)['then'](handleEntityNotFound(_0x13e866,null))[_0x9a5c('0x20')](respondWithResult(_0x13e866,null))[_0x9a5c('0x43')](handleError(_0x13e866,null));};exports[_0x9a5c('0x46')]=function(_0x4fb79f,_0x3ffede){return db[_0x9a5c('0x28')][_0x9a5c('0x46')](_0x4fb79f[_0x9a5c('0x47')],{})['then'](respondWithResult(_0x3ffede,0xc9))[_0x9a5c('0x43')](handleError(_0x3ffede,null));};exports[_0x9a5c('0x1f')]=function(_0x5880ab,_0x28a097){if(_0x5880ab[_0x9a5c('0x47')]['id']){delete _0x5880ab[_0x9a5c('0x47')]['id'];}return db[_0x9a5c('0x28')][_0x9a5c('0x48')]({'where':{'id':_0x5880ab[_0x9a5c('0x44')]['id']}})[_0x9a5c('0x20')](handleEntityNotFound(_0x28a097,null))['then'](saveUpdates(_0x5880ab[_0x9a5c('0x47')],null))['then'](respondWithResult(_0x28a097,null))[_0x9a5c('0x43')](handleError(_0x28a097,null));};exports['destroy']=function(_0x45a394,_0x281139){return db['ChatTransferReport'][_0x9a5c('0x48')]({'where':{'id':_0x45a394['params']['id']}})['then'](handleEntityNotFound(_0x281139,null))[_0x9a5c('0x20')](removeEntity(_0x281139,null))[_0x9a5c('0x43')](handleError(_0x281139,null));};exports[_0x9a5c('0x49')]=function(_0x5b9f51,_0x6e058e){return db[_0x9a5c('0x28')][_0x9a5c('0x49')]()[_0x9a5c('0x20')](respondWithResult(_0x6e058e,null))[_0x9a5c('0x43')](handleError(_0x6e058e,null));}; \ No newline at end of file +var _0x3e7a=['apply','reject','save','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','mustache','util','sox','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range'];(function(_0x2f1a92,_0x2eff28){var _0x279dd1=function(_0x254ec8){while(--_0x254ec8){_0x2f1a92['push'](_0x2f1a92['shift']());}};_0x279dd1(++_0x2eff28);}(_0x3e7a,0xb1));var _0xa3e7=function(_0x41c996,_0xa79e16){_0x41c996=_0x41c996-0x0;var _0x10cd4d=_0x3e7a[_0x41c996];return _0x10cd4d;};'use strict';var emlformat=require(_0xa3e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3e7('0x1'));var jsonpatch=require(_0xa3e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3e7('0x3'));var util=require(_0xa3e7('0x4'));var path=require('path');var sox=require(_0xa3e7('0x5'));var csv=require('to-csv');var ejs=require(_0xa3e7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa3e7('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3e7('0x8'));var Papa=require(_0xa3e7('0x9'));var Redis=require(_0xa3e7('0xa'));var authService=require(_0xa3e7('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa3e7('0xc'));var hardwareService=require(_0xa3e7('0xd'));var logger=require(_0xa3e7('0xe'))(_0xa3e7('0xf'));var utils=require(_0xa3e7('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3e7('0x11'))['db'];function respondWithStatusCode(_0x759c77,_0x47b29e){_0x47b29e=_0x47b29e||0xcc;return function(_0x2c8bde){if(_0x2c8bde){return _0x759c77[_0xa3e7('0x12')](_0x47b29e);}return _0x759c77[_0xa3e7('0x13')](_0x47b29e)[_0xa3e7('0x14')]();};}function respondWithResult(_0x3d5783,_0x65b366){_0x65b366=_0x65b366||0xc8;return function(_0x48a0cf){if(_0x48a0cf){return _0x3d5783[_0xa3e7('0x13')](_0x65b366)[_0xa3e7('0x15')](_0x48a0cf);}};}function respondWithFilteredResult(_0x2578bb,_0x58f08c){return function(_0x304719){if(_0x304719){var _0x29ec40=typeof _0x58f08c[_0xa3e7('0x16')]==='undefined'&&typeof _0x58f08c['limit']===_0xa3e7('0x17');var _0x338308=_0x304719[_0xa3e7('0x18')];var _0xa7f81f=_0x29ec40?0x0:_0x58f08c[_0xa3e7('0x16')];var _0x192258=_0x29ec40?_0x304719['count']:_0x58f08c[_0xa3e7('0x16')]+_0x58f08c[_0xa3e7('0x19')];var _0x577a25;if(_0x192258>=_0x338308){_0x192258=_0x338308;_0x577a25=0xc8;}else{_0x577a25=0xce;}_0x2578bb['status'](_0x577a25);return _0x2578bb['set'](_0xa3e7('0x1a'),_0xa7f81f+'-'+_0x192258+'/'+_0x338308)[_0xa3e7('0x15')](_0x304719);}return null;};}function patchUpdates(_0x47fd87){return function(_0x2f1635){try{jsonpatch[_0xa3e7('0x1b')](_0x2f1635,_0x47fd87,!![]);}catch(_0x2a14c5){return BPromise[_0xa3e7('0x1c')](_0x2a14c5);}return _0x2f1635[_0xa3e7('0x1d')]();};}function saveUpdates(_0x5471a0,_0x279077){return function(_0x29e15c){if(_0x29e15c){return _0x29e15c['update'](_0x5471a0)[_0xa3e7('0x1e')](function(_0xd3e144){return _0xd3e144;});}return null;};}function removeEntity(_0x245a47,_0x44a802){return function(_0x801b00){if(_0x801b00){return _0x801b00[_0xa3e7('0x1f')]()[_0xa3e7('0x1e')](function(){_0x245a47[_0xa3e7('0x13')](0xcc)[_0xa3e7('0x14')]();});}};}function handleEntityNotFound(_0xb8a2c2,_0x4d9313){return function(_0x43b115){if(!_0x43b115){_0xb8a2c2[_0xa3e7('0x12')](0x194);}return _0x43b115;};}function handleError(_0x4646b0,_0x15702e){_0x15702e=_0x15702e||0x1f4;return function(_0x17cbd9){logger[_0xa3e7('0x20')](_0x17cbd9['stack']);if(_0x17cbd9[_0xa3e7('0x21')]){delete _0x17cbd9[_0xa3e7('0x21')];}_0x4646b0['status'](_0x15702e)['send'](_0x17cbd9);};}exports[_0xa3e7('0x22')]=function(_0x579c11,_0x414b40){var _0x32e16a={},_0x3e7d91={},_0x4106ef={'count':0x0,'rows':[]};var _0x55303d=_[_0xa3e7('0x23')](db[_0xa3e7('0x24')][_0xa3e7('0x25')],function(_0x2210d5){return{'name':_0x2210d5[_0xa3e7('0x26')],'type':_0x2210d5['type'][_0xa3e7('0x27')]};});_0x3e7d91[_0xa3e7('0x28')]=_['map'](_0x55303d,_0xa3e7('0x21'));_0x3e7d91[_0xa3e7('0x29')]=_['keys'](_0x579c11['query']);_0x3e7d91[_0xa3e7('0x2a')]=_['intersection'](_0x3e7d91['model'],_0x3e7d91['query']);_0x32e16a['attributes']=_[_0xa3e7('0x2b')](_0x3e7d91[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x579c11['query']['fields']));_0x32e16a['attributes']=_0x32e16a[_0xa3e7('0x2d')][_0xa3e7('0x2e')]?_0x32e16a[_0xa3e7('0x2d')]:_0x3e7d91[_0xa3e7('0x28')];if(!_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x2f')]('nolimit')){_0x32e16a[_0xa3e7('0x19')]=qs[_0xa3e7('0x19')](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x19')]);_0x32e16a['offset']=qs['offset'](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x16')]);}_0x32e16a['order']=qs['sort'](_0x579c11[_0xa3e7('0x29')]['sort']);_0x32e16a[_0xa3e7('0x30')]=qs[_0xa3e7('0x2a')](_[_0xa3e7('0x31')](_0x579c11[_0xa3e7('0x29')],_0x3e7d91[_0xa3e7('0x2a')]),_0x55303d);if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]){_0x32e16a[_0xa3e7('0x30')]=_[_0xa3e7('0x33')](_0x32e16a[_0xa3e7('0x30')],{'$or':_['map'](_0x55303d,function(_0x5ac925){if(_0x5ac925[_0xa3e7('0x34')]!==_0xa3e7('0x35')){var _0x25e848={};_0x25e848[_0x5ac925['name']]={'$like':'%'+_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]+'%'};return _0x25e848;}})});}_0x32e16a=_[_0xa3e7('0x33')]({},_0x32e16a,_0x579c11[_0xa3e7('0x36')]);var _0x59e48b={'where':_0x32e16a[_0xa3e7('0x30')]};return db[_0xa3e7('0x24')][_0xa3e7('0x18')](_0x59e48b)[_0xa3e7('0x1e')](function(_0x523c29){_0x4106ef[_0xa3e7('0x18')]=_0x523c29;if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x32e16a['include']=[{'all':!![]}];}return db[_0xa3e7('0x24')][_0xa3e7('0x38')](_0x32e16a);})['then'](function(_0x1d041d){_0x4106ef[_0xa3e7('0x39')]=_0x1d041d;return _0x4106ef;})['then'](respondWithFilteredResult(_0x414b40,_0x32e16a))[_0xa3e7('0x3a')](handleError(_0x414b40,null));};exports[_0xa3e7('0x3b')]=function(_0x59989c,_0x12631e){var _0x3ef93f={'raw':!![],'where':{'id':_0x59989c[_0xa3e7('0x3c')]['id']}},_0x3529ea={};_0x3529ea[_0xa3e7('0x28')]=_[_0xa3e7('0x3d')](db[_0xa3e7('0x24')][_0xa3e7('0x25')]);_0x3529ea['query']=_[_0xa3e7('0x3d')](_0x59989c[_0xa3e7('0x29')]);_0x3529ea[_0xa3e7('0x2a')]=_[_0xa3e7('0x2b')](_0x3529ea[_0xa3e7('0x28')],_0x3529ea[_0xa3e7('0x29')]);_0x3ef93f[_0xa3e7('0x2d')]=_['intersection'](_0x3529ea[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x2c')]));_0x3ef93f[_0xa3e7('0x2d')]=_0x3ef93f['attributes'][_0xa3e7('0x2e')]?_0x3ef93f[_0xa3e7('0x2d')]:_0x3529ea[_0xa3e7('0x28')];if(_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x3ef93f[_0xa3e7('0x3e')]=[{'all':!![]}];}_0x3ef93f=_['merge']({},_0x3ef93f,_0x59989c[_0xa3e7('0x36')]);return db['ChatTransferReport'][_0xa3e7('0x3f')](_0x3ef93f)[_0xa3e7('0x1e')](handleEntityNotFound(_0x12631e,null))[_0xa3e7('0x1e')](respondWithResult(_0x12631e,null))['catch'](handleError(_0x12631e,null));};exports['create']=function(_0x1598da,_0x53cd45){return db[_0xa3e7('0x24')][_0xa3e7('0x40')](_0x1598da[_0xa3e7('0x41')],{})['then'](respondWithResult(_0x53cd45,0xc9))[_0xa3e7('0x3a')](handleError(_0x53cd45,null));};exports[_0xa3e7('0x42')]=function(_0x691281,_0x4a0e71){if(_0x691281[_0xa3e7('0x41')]['id']){delete _0x691281['body']['id'];}return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x691281['params']['id']}})[_0xa3e7('0x1e')](handleEntityNotFound(_0x4a0e71,null))[_0xa3e7('0x1e')](saveUpdates(_0x691281[_0xa3e7('0x41')],null))[_0xa3e7('0x1e')](respondWithResult(_0x4a0e71,null))[_0xa3e7('0x3a')](handleError(_0x4a0e71,null));};exports[_0xa3e7('0x1f')]=function(_0x55589e,_0x325087){return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x55589e['params']['id']}})['then'](handleEntityNotFound(_0x325087,null))[_0xa3e7('0x1e')](removeEntity(_0x325087,null))[_0xa3e7('0x3a')](handleError(_0x325087,null));};exports['describe']=function(_0x762158,_0x371532){return db[_0xa3e7('0x24')][_0xa3e7('0x43')]()[_0xa3e7('0x1e')](respondWithResult(_0x371532,null))['catch'](handleError(_0x371532,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3eeee3f..1186da4 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 _0x7561=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatTransferReport.attributes','exports','define'];(function(_0x1ddfbd,_0xfa4d97){var _0x2469b8=function(_0x300e90){while(--_0x300e90){_0x1ddfbd['push'](_0x1ddfbd['shift']());}};_0x2469b8(++_0xfa4d97);}(_0x7561,0x73));var _0x1756=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7561[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1756('0x0'));var util=require(_0x1756('0x1'));var logger=require(_0x1756('0x2'))(_0x1756('0x3'));var moment=require(_0x1756('0x4'));var BPromise=require(_0x1756('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1756('0x6'));var rimraf=require(_0x1756('0x7'));var config=require('../../config/environment');var attributes=require(_0x1756('0x8'));module[_0x1756('0x9')]=function(_0x22a263,_0x355720){return _0x22a263[_0x1756('0xa')](_0x1756('0xb'),attributes,{'tableName':_0x1756('0xc'),'paranoid':![],'indexes':[{'name':_0x1756('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x10dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x3e2d67,_0x3b781a){var _0x429d2a=function(_0x53879f){while(--_0x53879f){_0x3e2d67['push'](_0x3e2d67['shift']());}};_0x429d2a(++_0x3b781a);}(_0x10dc,0x1cc));var _0xc10d=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0x10dc[_0x15af2f];return _0x359239;};'use strict';var _=require('lodash');var util=require(_0xc10d('0x0'));var logger=require(_0xc10d('0x1'))(_0xc10d('0x2'));var moment=require(_0xc10d('0x3'));var BPromise=require(_0xc10d('0x4'));var rp=require(_0xc10d('0x5'));var fs=require('fs');var path=require(_0xc10d('0x6'));var rimraf=require(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var attributes=require(_0xc10d('0x9'));module[_0xc10d('0xa')]=function(_0x415277,_0x34785d){return _0x415277['define'](_0xc10d('0xb'),attributes,{'tableName':_0xc10d('0xc'),'paranoid':![],'indexes':[{'name':_0xc10d('0xd'),'fields':[_0xc10d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ffbd4c9..b2dd787 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 _0x4e63=['rpc','../../config/environment','client','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dc3a1,_0x40ab64){var _0x4101c9=function(_0x1594ef){while(--_0x1594ef){_0x3dc3a1['push'](_0x3dc3a1['shift']());}};_0x4101c9(++_0x40ab64);}(_0x4e63,0x109));var _0x34e6=function(_0x21d64c,_0x52a58c){_0x21d64c=_0x21d64c-0x0;var _0x9c76b5=_0x4e63[_0x21d64c];return _0x9c76b5;};'use strict';var _=require(_0x34e6('0x0'));var util=require(_0x34e6('0x1'));var moment=require(_0x34e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x34e6('0x3'));var fs=require('fs');var Redis=require(_0x34e6('0x4'));var db=require(_0x34e6('0x5'))['db'];var utils=require(_0x34e6('0x6'));var logger=require(_0x34e6('0x7'))(_0x34e6('0x8'));var config=require(_0x34e6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x34e6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c04b,_0x3e494d,_0x97ce51){return new BPromise(function(_0x321705,_0x223791){return client[_0x34e6('0xb')](_0x44c04b,_0x97ce51)[_0x34e6('0xc')](function(_0x17035c){logger['info'](_0x34e6('0xd'),_0x3e494d,_0x34e6('0xe'));logger[_0x34e6('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3e494d,_0x34e6('0xe'),JSON[_0x34e6('0x10')](_0x17035c));if(_0x17035c[_0x34e6('0x11')]){if(_0x17035c[_0x34e6('0x11')]['code']===0x1f4){logger[_0x34e6('0x11')](_0x34e6('0xd'),_0x3e494d,_0x17035c['error']['message']);return _0x223791(_0x17035c[_0x34e6('0x11')][_0x34e6('0x12')]);}logger['error'](_0x34e6('0xd'),_0x3e494d,_0x17035c[_0x34e6('0x11')][_0x34e6('0x12')]);return _0x321705(_0x17035c[_0x34e6('0x11')][_0x34e6('0x12')]);}else{logger['info'](_0x34e6('0xd'),_0x3e494d,'request\x20sent');_0x321705(_0x17035c[_0x34e6('0x13')][_0x34e6('0x12')]);}})[_0x34e6('0x14')](function(_0x5300c0){logger[_0x34e6('0x11')](_0x34e6('0xd'),_0x3e494d,_0x5300c0);_0x223791(_0x5300c0);});});} \ No newline at end of file +var _0x0f8e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring'];(function(_0x203387,_0x25ee77){var _0x358e6b=function(_0xf5b2ff){while(--_0xf5b2ff){_0x203387['push'](_0x203387['shift']());}};_0x358e6b(++_0x25ee77);}(_0x0f8e,0x1d8));var _0xe0f8=function(_0x121336,_0x3370ea){_0x121336=_0x121336-0x0;var _0x53ff9f=_0x0f8e[_0x121336];return _0x53ff9f;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var moment=require('moment');var BPromise=require(_0xe0f8('0x1'));var rs=require(_0xe0f8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0f8('0x3'));var logger=require(_0xe0f8('0x4'))(_0xe0f8('0x5'));var config=require(_0xe0f8('0x6'));var jayson=require(_0xe0f8('0x7'));var client=jayson[_0xe0f8('0x8')][_0xe0f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6fa2,_0x4e5c06,_0x2d09f4){return new BPromise(function(_0x3bf20,_0x2eab67){return client[_0xe0f8('0xa')](_0x3f6fa2,_0x2d09f4)['then'](function(_0x54642d){logger[_0xe0f8('0xb')](_0xe0f8('0xc'),_0x4e5c06,_0xe0f8('0xd'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'),JSON[_0xe0f8('0xe')](_0x54642d));if(_0x54642d[_0xe0f8('0xf')]){if(_0x54642d['error'][_0xe0f8('0x10')]===0x1f4){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d[_0xe0f8('0xf')]['message']);return _0x2eab67(_0x54642d['error'][_0xe0f8('0x11')]);}logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d['error'][_0xe0f8('0x11')]);return _0x3bf20(_0x54642d['error'][_0xe0f8('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'));_0x3bf20(_0x54642d[_0xe0f8('0x12')][_0xe0f8('0x11')]);}})['catch'](function(_0x1deacb){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x1deacb);_0x2eab67(_0x1deacb);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5d35a67..3c52ca0 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 _0xb3e7=['index','get','/describe','describe','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','isAuthenticated'];(function(_0x5cbb7e,_0x4888a7){var _0x347053=function(_0xb298da){while(--_0xb298da){_0x5cbb7e['push'](_0x5cbb7e['shift']());}};_0x347053(++_0x4888a7);}(_0xb3e7,0xb4));var _0x7b3e=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xb3e7[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require(_0x7b3e('0x0'));var util=require(_0x7b3e('0x1'));var path=require(_0x7b3e('0x2'));var timeout=require(_0x7b3e('0x3'));var express=require(_0x7b3e('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(_0x7b3e('0x5'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x7b3e('0x6')](),controller[_0x7b3e('0x7')]);router[_0x7b3e('0x8')](_0x7b3e('0x9'),auth[_0x7b3e('0x6')](),controller[_0x7b3e('0xa')]);router['get'](_0x7b3e('0xb'),auth[_0x7b3e('0x6')](),controller['show']);router[_0x7b3e('0xc')]('/',auth[_0x7b3e('0x6')](),controller['create']);router['put'](_0x7b3e('0xb'),auth[_0x7b3e('0x6')](),controller[_0x7b3e('0xd')]);router[_0x7b3e('0xe')](_0x7b3e('0xb'),auth[_0x7b3e('0x6')](),controller[_0x7b3e('0xf')]);module[_0x7b3e('0x10')]=router; \ No newline at end of file +var _0x671f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x28422e,_0xc26e22){var _0x40eb0c=function(_0x2e6798){while(--_0x2e6798){_0x28422e['push'](_0x28422e['shift']());}};_0x40eb0c(++_0xc26e22);}(_0x671f,0x139));var _0xf671=function(_0x2f9d5e,_0x32c2c2){_0x2f9d5e=_0x2f9d5e-0x0;var _0x1ed863=_0x671f[_0x2f9d5e];return _0x1ed863;};'use strict';var multer=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var path=require('path');var timeout=require(_0xf671('0x2'));var express=require(_0xf671('0x3'));var router=express[_0xf671('0x4')]();var fs_extra=require(_0xf671('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf671('0x6'));var config=require(_0xf671('0x7'));var controller=require(_0xf671('0x8'));router[_0xf671('0x9')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xb')]);router[_0xf671('0x9')](_0xf671('0xc'),auth['isAuthenticated'](),controller[_0xf671('0xd')]);router[_0xf671('0x9')]('/:id',auth[_0xf671('0xa')](),controller['show']);router[_0xf671('0xe')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xf')]);router[_0xf671('0x10')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x12')]);router[_0xf671('0x13')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 2885639..7e6b880 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 _0x47c6=['INTEGER','bottom_right','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','randomstring','exports','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','TEXT','stringify','input','name','text','onlineForm','getDataValue','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Skip'];(function(_0xd4bffe,_0x43a1fb){var _0x25543a=function(_0x550341){while(--_0x550341){_0xd4bffe['push'](_0xd4bffe['shift']());}};_0x25543a(++_0x43a1fb);}(_0x47c6,0x1b1));var _0x647c=function(_0x50e410,_0x36bb68){_0x50e410=_0x50e410-0x0;var _0x3eb22c=_0x47c6[_0x50e410];return _0x3eb22c;};'use strict';var Sequelize=require(_0x647c('0x0'));var rs=require(_0x647c('0x1'));module[_0x647c('0x2')]={'name':{'type':Sequelize[_0x647c('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x647c('0x3')],'allowNull':![],'unique':_0x647c('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x5')},'mapKeyOffline':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x5')},'key':{'type':Sequelize[_0x647c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x647c('0x3')],'allowNull':![],'defaultValue':_0x647c('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x647c('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x647c('0x3')],'allowNull':![],'defaultValue':_0x647c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x647c('0x9')]('rounded','squared'),'defaultValue':_0x647c('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x647c('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x647c('0xc')},'offline_chat_button':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0xd')},'header_offline':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x10')},'noteTitle':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x647c('0x12')},'closingMessage':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x13')},'closingMessageButton':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x647c('0x9')](_0x647c('0x14'),'thumb'),'defaultValue':_0x647c('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x647c('0x15')],'defaultValue':function(){return JSON[_0x647c('0x16')]({'items':[{'type':_0x647c('0x17'),'variable':null,'config':{'placeholder':_0x647c('0x18'),'type':_0x647c('0x19'),'required':!![]},'props':{'title':_0x647c('0x18'),'helpText':''}},{'type':_0x647c('0x17'),'props':{'title':_0x647c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x647c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x647c('0x1a'))?JSON['parse'](this[_0x647c('0x1b')]('onlineForm')):{};},'set':function(_0x598279){return this[_0x647c('0x1c')](_0x647c('0x1a'),JSON[_0x647c('0x16')](_0x598279));}},'offlineForm':{'type':Sequelize[_0x647c('0x15')],'defaultValue':function(){return JSON[_0x647c('0x16')]({'items':[{'type':'input','props':{'title':_0x647c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x647c('0x5'),'type':_0x647c('0x5')},'variable':null},{'type':_0x647c('0x1d'),'config':{'placeholder':_0x647c('0x1e')},'props':{'title':_0x647c('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x647c('0x1b')](_0x647c('0x1f'))?JSON['parse'](this['getDataValue']('offlineForm')):{};},'set':function(_0x548475){return this[_0x647c('0x1c')](_0x647c('0x1f'),JSON[_0x647c('0x16')](_0x548475));}},'token':{'type':Sequelize[_0x647c('0x3')],'defaultValue':function(){return rs[_0x647c('0x20')]();}},'autoclose':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x647c('0x3')]},'forwardOffline':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x21')},'waitingMessage':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x23')},'skipUnmanaged':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x24')},'sendUnmanaged':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x647c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x647c('0x15')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x647c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x647c('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x647c('0x25')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x647c('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x27')},'defaultTitle':{'type':Sequelize[_0x647c('0x3')]},'customerAvatar':{'type':Sequelize[_0x647c('0x15')]},'showCustomerAvatar':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x647c('0x3')],'allowNull':![],'defaultValue':_0x647c('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x647c('0x25')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x647c('0x25')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x647c('0x3')],'defaultValue':_0x647c('0x29')},'systemAvatar':{'type':Sequelize[_0x647c('0x15')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x647c('0x25')],'comment':_0x647c('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![],'comment':_0x647c('0x2b'),'set':function(_0x1fccec){if(!_0x1fccec)this['setDataValue'](_0x647c('0x2c'),null);this[_0x647c('0x1c')](_0x647c('0x2d'),_0x1fccec);}},'vidaooEscalation':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x647c('0x3')]},'vidaooTopic':{'type':Sequelize[_0x647c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x647c('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x647c('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x647c('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x647c('0x15')]}}; \ No newline at end of file +var _0x86d1=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','input','name','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right'];(function(_0xcdc75,_0x4990c6){var _0x51d75c=function(_0xa56b12){while(--_0xa56b12){_0xcdc75['push'](_0xcdc75['shift']());}};_0x51d75c(++_0x4990c6);}(_0x86d1,0x149));var _0x186d=function(_0x2db265,_0x3ecc75){_0x2db265=_0x2db265-0x0;var _0x4dbb5e=_0x86d1[_0x2db265];return _0x4dbb5e;};'use strict';var Sequelize=require(_0x186d('0x0'));var rs=require('randomstring');module[_0x186d('0x1')]={'name':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x186d('0x3')},'description':{'type':Sequelize[_0x186d('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x4')},'key':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x5')},'customerAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x186d('0x2')]},'animation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x186d('0xa')](_0x186d('0xb'),_0x186d('0xc')),'defaultValue':_0x186d('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0xd')},'start_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xe')},'offline_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x10')},'download_transcript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x186d('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x13')},'noteTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'skipMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'conditionAgreement':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x186d('0xa')](_0x186d('0x15'),_0x186d('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x186d('0x17'),'variable':null,'config':{'placeholder':_0x186d('0x18'),'type':'text','required':!![]},'props':{'title':_0x186d('0x18'),'helpText':''}},{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x186d('0x19'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x19'))):{};},'set':function(_0x422898){return this[_0x186d('0x1c')](_0x186d('0x19'),JSON[_0x186d('0x1d')](_0x422898));}},'offlineForm':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return JSON[_0x186d('0x1d')]({'items':[{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x186d('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x186d('0x1b')](_0x186d('0x1f'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x1f'))):{};},'set':function(_0x11092c){return this[_0x186d('0x1c')](_0x186d('0x1f'),JSON[_0x186d('0x1d')](_0x11092c));}},'token':{'type':Sequelize[_0x186d('0x2')],'defaultValue':function(){return rs[_0x186d('0x20')]();}},'autoclose':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x186d('0x2')]},'forwardOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x23')},'offlineMessageBody':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'sendUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x186d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x186d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x26')},'verticalAlignment':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x27')},'defaultTitle':{'type':Sequelize[_0x186d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x186d('0x8')],'comment':_0x186d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x63327f){if(!_0x63327f)this[_0x186d('0x1c')](_0x186d('0x2b'),null);this[_0x186d('0x1c')](_0x186d('0x2c'),_0x63327f);}},'vidaooEscalation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x186d('0x2')]},'vidaooTopic':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x186d('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index fc5f416..6bfb6e0 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 _0xf375=['update','destroy','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','fieldName','type','key','map','name','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','findAll','rows','show','params','rawAttributes','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','Disposition','nolimit','ChatWebsiteId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','CmContact','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf375,0x104));var _0x5f37=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf375[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x5f37('0x0'));var rimraf=require(_0x5f37('0x1'));var zipdir=require(_0x5f37('0x2'));var jsonpatch=require(_0x5f37('0x3'));var rp=require(_0x5f37('0x4'));var moment=require(_0x5f37('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5f37('0x6'));var util=require(_0x5f37('0x7'));var path=require(_0x5f37('0x8'));var sox=require(_0x5f37('0x9'));var csv=require(_0x5f37('0xa'));var ejs=require(_0x5f37('0xb'));var fs=require('fs');var fs_extra=require(_0x5f37('0xc'));var _=require(_0x5f37('0xd'));var squel=require(_0x5f37('0xe'));var crypto=require('crypto');var jsforce=require(_0x5f37('0xf'));var deskjs=require(_0x5f37('0x10'));var toCsv=require(_0x5f37('0xa'));var querystring=require(_0x5f37('0x11'));var Papa=require(_0x5f37('0x12'));var Redis=require(_0x5f37('0x13'));var authService=require(_0x5f37('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5f37('0x15'));var hardwareService=require(_0x5f37('0x16'));var logger=require(_0x5f37('0x17'))('api');var utils=require(_0x5f37('0x18'));var config=require(_0x5f37('0x19'));var licenseUtil=require(_0x5f37('0x1a'));var db=require(_0x5f37('0x1b'))['db'];config[_0x5f37('0x1c')]=_[_0x5f37('0x1d')](config[_0x5f37('0x1c')],{'host':_0x5f37('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f37('0x1c')]));require(_0x5f37('0x1f'))['register'](socket);var jayson=require(_0x5f37('0x20'));var client=jayson[_0x5f37('0x21')][_0x5f37('0x22')]({'port':0x232c});var client9002=jayson[_0x5f37('0x21')][_0x5f37('0x22')]({'port':0x232a});var client9003=jayson['client'][_0x5f37('0x22')]({'port':0x232b});var client9001=jayson['client'][_0x5f37('0x22')]({'port':0x2329});function respondWithRpcPromise(_0x1b14fc,_0x4ef36e,_0x5b012a,_0x55e99c){return new BPromise(function(_0x59930d,_0x5ba17a){var _0x3aa886=_0x55e99c||client;return _0x3aa886[_0x5f37('0x23')](_0x1b14fc,_0x5b012a)[_0x5f37('0x24')](function(_0x20165a){logger[_0x5f37('0x25')](_0x5f37('0x26'),_0x4ef36e,_0x5f37('0x27'));logger[_0x5f37('0x28')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ef36e,_0x5f37('0x27'),JSON[_0x5f37('0x29')](_0x20165a));if(_0x20165a[_0x5f37('0x2a')]){if(_0x20165a[_0x5f37('0x2a')][_0x5f37('0x2b')]===0x1f4){logger[_0x5f37('0x2a')](_0x5f37('0x26'),_0x4ef36e,_0x20165a['error'][_0x5f37('0x2c')]);return _0x5ba17a(_0x20165a[_0x5f37('0x2a')][_0x5f37('0x2c')]);}logger[_0x5f37('0x2a')](_0x5f37('0x26'),_0x4ef36e,_0x20165a[_0x5f37('0x2a')][_0x5f37('0x2c')]);return _0x59930d(_0x20165a[_0x5f37('0x2a')][_0x5f37('0x2c')]);}else{logger['info'](_0x5f37('0x26'),_0x4ef36e,_0x5f37('0x27'));_0x59930d(_0x20165a[_0x5f37('0x2d')][_0x5f37('0x2c')]);}})[_0x5f37('0x2e')](function(_0x30c2cb){logger[_0x5f37('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x4ef36e,_0x30c2cb);_0x5ba17a(_0x30c2cb);});});}function respondWithStatusCode(_0x214bf6,_0xb750d8){_0xb750d8=_0xb750d8||0xcc;return function(_0x1c9baa){if(_0x1c9baa){return _0x214bf6[_0x5f37('0x2f')](_0xb750d8);}return _0x214bf6['status'](_0xb750d8)[_0x5f37('0x30')]();};}function respondWithResult(_0x1bbecf,_0x5894d6){_0x5894d6=_0x5894d6||0xc8;return function(_0x501d41){if(_0x501d41){return _0x1bbecf[_0x5f37('0x31')](_0x5894d6)['json'](_0x501d41);}};}function respondWithFilteredResult(_0x3442e2,_0x436e7e){return function(_0x201550){if(_0x201550){var _0x11e899=typeof _0x436e7e[_0x5f37('0x32')]===_0x5f37('0x33')&&typeof _0x436e7e[_0x5f37('0x34')]===_0x5f37('0x33');var _0x408212=_0x201550[_0x5f37('0x35')];var _0x4a7334=_0x11e899?0x0:_0x436e7e[_0x5f37('0x32')];var _0x465ace=_0x11e899?_0x201550[_0x5f37('0x35')]:_0x436e7e[_0x5f37('0x32')]+_0x436e7e[_0x5f37('0x34')];var _0x39811e;if(_0x465ace>=_0x408212){_0x465ace=_0x408212;_0x39811e=0xc8;}else{_0x39811e=0xce;}_0x3442e2[_0x5f37('0x31')](_0x39811e);return _0x3442e2[_0x5f37('0x36')]('Content-Range',_0x4a7334+'-'+_0x465ace+'/'+_0x408212)[_0x5f37('0x37')](_0x201550);}return null;};}function patchUpdates(_0x4f7e1f){return function(_0x22ea9b){try{jsonpatch[_0x5f37('0x38')](_0x22ea9b,_0x4f7e1f,!![]);}catch(_0x17f6f1){return BPromise['reject'](_0x17f6f1);}return _0x22ea9b[_0x5f37('0x39')]();};}function saveUpdates(_0x13dc61,_0x4133ac){return function(_0x12e7aa){if(_0x12e7aa){return _0x12e7aa[_0x5f37('0x3a')](_0x13dc61)[_0x5f37('0x24')](function(_0xde1a5a){return _0xde1a5a;});}return null;};}function removeEntity(_0x1ea899,_0x409c20){return function(_0xb93ee4){if(_0xb93ee4){return _0xb93ee4[_0x5f37('0x3b')]()['then'](function(){var _0x56f9ba=_0xb93ee4['get']({'plain':!![]});var _0x1dca5d=_0x5f37('0x3c');return db[_0x5f37('0x3d')][_0x5f37('0x3b')]({'where':{'type':_0x1dca5d,'resourceId':_0x56f9ba['id']}})[_0x5f37('0x24')](function(){return _0xb93ee4;});})[_0x5f37('0x24')](function(){_0x1ea899[_0x5f37('0x31')](0xcc)[_0x5f37('0x30')]();});}};}function handleEntityNotFound(_0x1f5ad7,_0x1ffbba){return function(_0x343977){if(!_0x343977){_0x1f5ad7[_0x5f37('0x2f')](0x194);}return _0x343977;};}function handleError(_0x19b3d8,_0x33468b){_0x33468b=_0x33468b||0x1f4;return function(_0x3be0df){logger[_0x5f37('0x2a')](_0x3be0df[_0x5f37('0x3e')]);if(_0x3be0df['name']){delete _0x3be0df['name'];}_0x19b3d8['status'](_0x33468b)[_0x5f37('0x3f')](_0x3be0df);};}exports[_0x5f37('0x40')]=function(_0x19efcc,_0x45c3a5){var _0x157e6b={'include':[{'model':db[_0x5f37('0x41')],'as':_0x5f37('0x42')}]},_0x4ee073={},_0x232285={'count':0x0,'rows':[]};var _0x6957a6=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x5c8417){return{'name':_0x5c8417[_0x5f37('0x43')],'type':_0x5c8417[_0x5f37('0x44')][_0x5f37('0x45')]};});_0x4ee073['model']=_[_0x5f37('0x46')](_0x6957a6,_0x5f37('0x47'));_0x4ee073['query']=_['keys'](_0x19efcc['query']);_0x4ee073[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0x4ee073[_0x5f37('0x4a')],_0x4ee073[_0x5f37('0x4b')]);_0x157e6b[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0x4ee073[_0x5f37('0x4a')],qs[_0x5f37('0x4d')](_0x19efcc[_0x5f37('0x4b')][_0x5f37('0x4d')]));_0x157e6b['attributes']=_0x157e6b[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x157e6b['attributes']:_0x4ee073[_0x5f37('0x4a')];if(!_0x19efcc['query'][_0x5f37('0x4f')]('nolimit')){_0x157e6b[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x19efcc['query'][_0x5f37('0x34')]);_0x157e6b['offset']=qs[_0x5f37('0x32')](_0x19efcc['query'][_0x5f37('0x32')]);}_0x157e6b[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x19efcc['query']['sort']);_0x157e6b[_0x5f37('0x52')]=qs[_0x5f37('0x48')](_[_0x5f37('0x53')](_0x19efcc[_0x5f37('0x4b')],_0x4ee073['filters']),_0x6957a6);if(_0x19efcc[_0x5f37('0x4b')][_0x5f37('0x54')]){_0x157e6b[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0x157e6b[_0x5f37('0x52')],{'$or':_[_0x5f37('0x46')](_0x6957a6,function(_0x3811ca){if(_0x3811ca['type']!==_0x5f37('0x56')){var _0x118540={};_0x118540[_0x3811ca['name']]={'$like':'%'+_0x19efcc[_0x5f37('0x4b')]['filter']+'%'};return _0x118540;}})});}_0x157e6b=_[_0x5f37('0x55')]({},_0x157e6b,_0x19efcc[_0x5f37('0x57')]);var _0x43575e={'where':_0x157e6b[_0x5f37('0x52')]};return db[_0x5f37('0x58')][_0x5f37('0x35')](_0x43575e)['then'](function(_0x9239ff){_0x232285[_0x5f37('0x35')]=_0x9239ff;if(_0x19efcc[_0x5f37('0x4b')][_0x5f37('0x59')]){_0x157e6b['include']=[{'all':!![]}];}return db[_0x5f37('0x58')][_0x5f37('0x5a')](_0x157e6b);})['then'](function(_0x2928df){_0x232285[_0x5f37('0x5b')]=_0x2928df;return _0x232285;})[_0x5f37('0x24')](respondWithFilteredResult(_0x45c3a5,_0x157e6b))[_0x5f37('0x2e')](handleError(_0x45c3a5,null));};exports[_0x5f37('0x5c')]=function(_0x46b945,_0x336ea1){var _0x191d58={'raw':![],'where':{'id':_0x46b945[_0x5f37('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5568b8={};_0x5568b8[_0x5f37('0x4a')]=_['keys'](db['ChatWebsite'][_0x5f37('0x5e')]);_0x5568b8[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x46b945['query']);_0x5568b8[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0x5568b8[_0x5f37('0x4a')],_0x5568b8[_0x5f37('0x4b')]);_0x191d58[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0x5568b8['model'],qs[_0x5f37('0x4d')](_0x46b945[_0x5f37('0x4b')][_0x5f37('0x4d')]));_0x191d58[_0x5f37('0x4c')]=_0x191d58['attributes'][_0x5f37('0x4e')]?_0x191d58['attributes']:_0x5568b8[_0x5f37('0x4a')];if(_0x46b945['query'][_0x5f37('0x59')]){_0x191d58['include']=[{'all':!![]}];}_0x191d58=_['merge']({},_0x191d58,_0x46b945[_0x5f37('0x57')]);return db['ChatWebsite'][_0x5f37('0x60')](_0x191d58)[_0x5f37('0x24')](handleEntityNotFound(_0x336ea1,null))[_0x5f37('0x24')](respondWithResult(_0x336ea1,null))[_0x5f37('0x2e')](handleError(_0x336ea1,null));};exports[_0x5f37('0x61')]=function(_0x1a4679,_0x2d6204){return db[_0x5f37('0x58')][_0x5f37('0x61')](_0x1a4679[_0x5f37('0x62')],{})[_0x5f37('0x24')](function(_0x32b988){var _0x46d094=_0x1a4679['user'][_0x5f37('0x63')]({'plain':!![]});if(!_0x46d094)throw new Error(_0x5f37('0x64'));if(_0x46d094[_0x5f37('0x65')]===_0x5f37('0x66')){var _0x23a5bc=_0x32b988[_0x5f37('0x63')]({'plain':!![]});var _0x10fb33=_0x5f37('0x3c');return db[_0x5f37('0x67')][_0x5f37('0x60')]({'where':{'name':_0x10fb33,'userProfileId':_0x46d094[_0x5f37('0x68')]},'raw':!![]})[_0x5f37('0x24')](function(_0x1f1b59){if(_0x1f1b59&&_0x1f1b59[_0x5f37('0x69')]===0x0){return db[_0x5f37('0x3d')][_0x5f37('0x61')]({'name':_0x23a5bc[_0x5f37('0x47')],'resourceId':_0x23a5bc['id'],'type':_0x1f1b59[_0x5f37('0x47')],'sectionId':_0x1f1b59['id']},{})[_0x5f37('0x24')](function(){return _0x32b988;});}else{return _0x32b988;}})[_0x5f37('0x2e')](function(_0x282ea9){logger[_0x5f37('0x2a')](_0x5f37('0x6a'),_0x282ea9);throw _0x282ea9;});}return _0x32b988;})[_0x5f37('0x24')](respondWithResult(_0x2d6204,0xc9))[_0x5f37('0x2e')](handleError(_0x2d6204,null));};exports[_0x5f37('0x3a')]=function(_0x2536bf,_0xd1718a){if(_0x2536bf['body']['id']){delete _0x2536bf[_0x5f37('0x62')]['id'];}return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x2536bf[_0x5f37('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x5f37('0x42')}]})[_0x5f37('0x24')](handleEntityNotFound(_0xd1718a,null))['then'](saveUpdates(_0x2536bf[_0x5f37('0x62')],null))['then'](respondWithResult(_0xd1718a,null))['catch'](handleError(_0xd1718a,null));};exports[_0x5f37('0x3b')]=function(_0x5064c9,_0x561e67){return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x5064c9[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x561e67,null))[_0x5f37('0x24')](removeEntity(_0x561e67,null))['catch'](handleError(_0x561e67,null));};exports[_0x5f37('0x6b')]=function(_0x25b315,_0x4240eb){return db[_0x5f37('0x58')][_0x5f37('0x6b')]()[_0x5f37('0x24')](respondWithResult(_0x4240eb,null))[_0x5f37('0x2e')](handleError(_0x4240eb,null));};exports['addDisposition']=function(_0x5b005a,_0x200f19,_0x50fe12){if(_0x5b005a['body']['id']){delete _0x5b005a['body']['id'];}return db['ChatWebsite'][_0x5f37('0x60')]({'where':{'id':_0x5b005a[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x200f19,null))[_0x5f37('0x24')](function(_0x35c193){if(_0x35c193){_0x5b005a[_0x5f37('0x62')]['ChatWebsiteId']=_0x35c193['id'];return db['Disposition'][_0x5f37('0x61')](_0x5b005a[_0x5f37('0x62')]);}})['then'](respondWithResult(_0x200f19,null))[_0x5f37('0x2e')](handleError(_0x200f19,null));};exports['getDispositions']=function(_0x49eec6,_0xa9b7b6,_0x19affe){var _0x48cf44={'raw':![],'where':{}};var _0x1b749c={};var _0x3e4fd2={'count':0x0,'rows':[]};return db[_0x5f37('0x58')][_0x5f37('0x6c')]({'where':{'id':_0x49eec6[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0xa9b7b6,null))['then'](function(_0x5dbfde){if(_0x5dbfde){_0x1b749c[_0x5f37('0x4a')]=_[_0x5f37('0x5f')](db[_0x5f37('0x6d')][_0x5f37('0x5e')]);_0x1b749c[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x49eec6[_0x5f37('0x4b')]);_0x1b749c['filters']=_[_0x5f37('0x49')](_0x1b749c[_0x5f37('0x4a')],_0x1b749c['query']);_0x48cf44['attributes']=_[_0x5f37('0x49')](_0x1b749c[_0x5f37('0x4a')],qs[_0x5f37('0x4d')](_0x49eec6['query'][_0x5f37('0x4d')]));_0x48cf44[_0x5f37('0x4c')]=_0x48cf44[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x48cf44['attributes']:_0x1b749c[_0x5f37('0x4a')];if(!_0x49eec6[_0x5f37('0x4b')][_0x5f37('0x4f')](_0x5f37('0x6e'))){_0x48cf44[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x49eec6[_0x5f37('0x4b')][_0x5f37('0x34')]);_0x48cf44[_0x5f37('0x32')]=qs['offset'](_0x49eec6[_0x5f37('0x4b')]['offset']);}_0x48cf44['order']=qs['sort'](_0x49eec6[_0x5f37('0x4b')]['sort']);_0x48cf44[_0x5f37('0x52')]=qs[_0x5f37('0x48')](_['pick'](_0x49eec6[_0x5f37('0x4b')],_0x1b749c['filters']));_0x48cf44[_0x5f37('0x52')][_0x5f37('0x6f')]=_0x5dbfde['id'];if(_0x49eec6[_0x5f37('0x4b')][_0x5f37('0x54')]){_0x48cf44[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0x48cf44[_0x5f37('0x52')],{'$or':_[_0x5f37('0x46')](_0x48cf44[_0x5f37('0x4c')],function(_0x224054){var _0x1b68b6={};_0x1b68b6[_0x224054]={'$like':'%'+_0x49eec6[_0x5f37('0x4b')]['filter']+'%'};return _0x1b68b6;})});}_0x48cf44=_['merge']({},_0x48cf44,_0x49eec6[_0x5f37('0x57')]);return db['Disposition'][_0x5f37('0x35')]({'where':_0x48cf44[_0x5f37('0x52')]})[_0x5f37('0x24')](function(_0x221838){_0x3e4fd2[_0x5f37('0x35')]=_0x221838;if(_0x49eec6[_0x5f37('0x4b')]['includeAll']){_0x48cf44[_0x5f37('0x70')]=[{'all':!![]}];}return db['Disposition'][_0x5f37('0x5a')](_0x48cf44);})[_0x5f37('0x24')](function(_0x864cbb){_0x3e4fd2['rows']=_0x864cbb;return _0x3e4fd2;});}})[_0x5f37('0x24')](respondWithFilteredResult(_0xa9b7b6,_0x48cf44))[_0x5f37('0x2e')](handleError(_0xa9b7b6,null));};exports[_0x5f37('0x71')]=function(_0xc6f299,_0x2b2ba0,_0x222e15){return db['ChatWebsite'][_0x5f37('0x60')]({'where':{'id':_0xc6f299[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2b2ba0,null))[_0x5f37('0x24')](function(_0x7b7e18){if(_0x7b7e18){return _0x7b7e18[_0x5f37('0x71')](_0xc6f299[_0x5f37('0x4b')][_0x5f37('0x72')]);}})[_0x5f37('0x24')](respondWithStatusCode(_0x2b2ba0,null))[_0x5f37('0x2e')](handleError(_0x2b2ba0,null));};exports[_0x5f37('0x73')]=function(_0xeabdca,_0x177a96,_0x592b8f){if(_0xeabdca[_0x5f37('0x62')]['id']){delete _0xeabdca[_0x5f37('0x62')]['id'];}return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0xeabdca[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x177a96,null))[_0x5f37('0x24')](function(_0x5c5d12){if(_0x5c5d12){_0xeabdca[_0x5f37('0x62')][_0x5f37('0x6f')]=_0x5c5d12['id'];return db[_0x5f37('0x74')][_0x5f37('0x61')](_0xeabdca[_0x5f37('0x62')]);}})[_0x5f37('0x24')](respondWithResult(_0x177a96,null))['catch'](handleError(_0x177a96,null));};exports[_0x5f37('0x75')]=function(_0x3f5eb3,_0x24cc37,_0x210d65){var _0x242e57={'raw':![],'where':{}};var _0x11f8f4={};var _0x19762b={'count':0x0,'rows':[]};return db[_0x5f37('0x58')]['findOne']({'where':{'id':_0x3f5eb3[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x24cc37,null))['then'](function(_0x3accb0){if(_0x3accb0){_0x11f8f4[_0x5f37('0x4a')]=_[_0x5f37('0x5f')](db[_0x5f37('0x74')][_0x5f37('0x5e')]);_0x11f8f4[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x3f5eb3['query']);_0x11f8f4[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0x11f8f4[_0x5f37('0x4a')],_0x11f8f4['query']);_0x242e57[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0x11f8f4[_0x5f37('0x4a')],qs[_0x5f37('0x4d')](_0x3f5eb3['query']['fields']));_0x242e57[_0x5f37('0x4c')]=_0x242e57[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x242e57[_0x5f37('0x4c')]:_0x11f8f4['model'];if(!_0x3f5eb3['query'][_0x5f37('0x4f')](_0x5f37('0x6e'))){_0x242e57[_0x5f37('0x34')]=qs['limit'](_0x3f5eb3[_0x5f37('0x4b')]['limit']);_0x242e57[_0x5f37('0x32')]=qs[_0x5f37('0x32')](_0x3f5eb3[_0x5f37('0x4b')][_0x5f37('0x32')]);}_0x242e57[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x3f5eb3[_0x5f37('0x4b')]['sort']);_0x242e57[_0x5f37('0x52')]=qs['filters'](_['pick'](_0x3f5eb3['query'],_0x11f8f4[_0x5f37('0x48')]));_0x242e57[_0x5f37('0x52')][_0x5f37('0x6f')]=_0x3accb0['id'];if(_0x3f5eb3[_0x5f37('0x4b')][_0x5f37('0x54')]){_0x242e57[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0x242e57['where'],{'$or':_[_0x5f37('0x46')](_0x242e57['attributes'],function(_0x226d10){var _0x118a3a={};_0x118a3a[_0x226d10]={'$like':'%'+_0x3f5eb3[_0x5f37('0x4b')][_0x5f37('0x54')]+'%'};return _0x118a3a;})});}_0x242e57=_[_0x5f37('0x55')]({},_0x242e57,_0x3f5eb3['options']);return db[_0x5f37('0x74')][_0x5f37('0x35')]({'where':_0x242e57[_0x5f37('0x52')]})[_0x5f37('0x24')](function(_0x557b52){_0x19762b[_0x5f37('0x35')]=_0x557b52;if(_0x3f5eb3['query'][_0x5f37('0x59')]){_0x242e57[_0x5f37('0x70')]=[{'all':!![]}];}return db[_0x5f37('0x74')][_0x5f37('0x5a')](_0x242e57);})[_0x5f37('0x24')](function(_0x1077c8){_0x19762b[_0x5f37('0x5b')]=_0x1077c8;return _0x19762b;});}})[_0x5f37('0x24')](respondWithFilteredResult(_0x24cc37,_0x242e57))['catch'](handleError(_0x24cc37,null));};exports['removeAnswers']=function(_0x1c0c1a,_0x2acf3d,_0x492f81){return db[_0x5f37('0x58')]['find']({'where':{'id':_0x1c0c1a['params']['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x2acf3d,null))[_0x5f37('0x24')](function(_0x8f8755){if(_0x8f8755){return _0x8f8755['removeAnswers'](_0x1c0c1a[_0x5f37('0x4b')][_0x5f37('0x72')]);}})[_0x5f37('0x24')](respondWithStatusCode(_0x2acf3d,null))[_0x5f37('0x2e')](handleError(_0x2acf3d,null));};exports[_0x5f37('0x76')]=function(_0x37f4d2,_0x546614,_0x36a89b){_0x37f4d2[_0x5f37('0x62')][_0x5f37('0x77')]=_0x37f4d2[_0x5f37('0x78')][_0x5f37('0x79')];return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x37f4d2[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x546614,null))[_0x5f37('0x24')](saveUpdates(_0x37f4d2[_0x5f37('0x62')],null))[_0x5f37('0x24')](respondWithResult(_0x546614,null))['catch'](handleError(_0x546614,null));};exports[_0x5f37('0x7a')]=function(_0x4bd3c7,_0x15a69d,_0xb8ff07){_0x4bd3c7[_0x5f37('0x62')][_0x5f37('0x7b')]=_0x4bd3c7[_0x5f37('0x78')][_0x5f37('0x79')];return db[_0x5f37('0x58')]['find']({'where':{'id':_0x4bd3c7[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x15a69d,null))[_0x5f37('0x24')](saveUpdates(_0x4bd3c7[_0x5f37('0x62')],null))[_0x5f37('0x24')](respondWithResult(_0x15a69d,null))[_0x5f37('0x2e')](handleError(_0x15a69d,null));};exports[_0x5f37('0x7c')]=function(_0x567288,_0x429602,_0x1dd78c){_0x567288[_0x5f37('0x62')][_0x5f37('0x7d')]=_0x567288['file'][_0x5f37('0x79')];return db[_0x5f37('0x58')]['find']({'where':{'id':_0x567288[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x429602,null))[_0x5f37('0x24')](saveUpdates(_0x567288['body'],null))[_0x5f37('0x24')](respondWithResult(_0x429602,null))['catch'](handleError(_0x429602,null));};exports[_0x5f37('0x7e')]=function(_0x127ea0,_0x5949b7,_0x9d030d){_0x127ea0[_0x5f37('0x62')][_0x5f37('0x7f')]=_0x127ea0[_0x5f37('0x78')][_0x5f37('0x79')];return db[_0x5f37('0x58')]['find']({'where':{'id':_0x127ea0[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x5949b7,null))['then'](saveUpdates(_0x127ea0['body'],null))[_0x5f37('0x24')](respondWithResult(_0x5949b7,null))[_0x5f37('0x2e')](handleError(_0x5949b7,null));};exports['getLogo']=function(_0x77a186,_0x5d3f1d,_0xc9b54f){var _0x3a704c=path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x82'));var _0x2b83ae={'where':{'id':_0x77a186[_0x5f37('0x5d')]['id']},'attributes':['id',_0x5f37('0x77')],'raw':!![]};var _0x1e8f36=![];return require(_0x5f37('0x1a'))[_0x5f37('0x83')]()[_0x5f37('0x24')](function(_0x4fadb2){if(_0x4fadb2){_0x1e8f36=_0x4fadb2[_0x5f37('0x84')];}})[_0x5f37('0x24')](function(){return db[_0x5f37('0x58')][_0x5f37('0x60')](_0x2b83ae);})[_0x5f37('0x24')](handleEntityNotFound(_0x5d3f1d,null))[_0x5f37('0x24')](function(_0x26b212){if(_0x26b212){if(!_[_0x5f37('0x85')](_0x26b212[_0x5f37('0x77')])){if(fs['existsSync'](path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x86'),_0x26b212['sitepic']))&&_0x1e8f36){_0x3a704c=path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x86'),_0x26b212['sitepic']);}}return _0x5d3f1d['download'](_0x3a704c);}})['catch'](handleError(_0x5d3f1d,null));};exports[_0x5f37('0x87')]=function(_0x5f2adb,_0x1974ee,_0x5e13db){var _0xf8624f=path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x88'));var _0xe6f42d={'where':{'id':_0x5f2adb['params']['id']},'attributes':['id',_0x5f37('0x7b')],'raw':!![]};return db[_0x5f37('0x58')][_0x5f37('0x60')](_0xe6f42d)[_0x5f37('0x24')](handleEntityNotFound(_0x1974ee,null))['then'](function(_0x306f1e){if(_0x306f1e){if(!_[_0x5f37('0x85')](_0x306f1e[_0x5f37('0x7b')])){if(fs[_0x5f37('0x89')](path[_0x5f37('0x80')](config['root'],_0x5f37('0x8a'),_0x306f1e[_0x5f37('0x7b')]))){_0xf8624f=path[_0x5f37('0x80')](config['root'],_0x5f37('0x8a'),_0x306f1e[_0x5f37('0x7b')]);}}return _0x1974ee[_0x5f37('0x8b')](_0xf8624f);}})[_0x5f37('0x2e')](handleError(_0x1974ee,null));};exports[_0x5f37('0x8c')]=function(_0x44f7db,_0x3bd90c,_0x11287f){var _0x4b70e4=path['join'](config[_0x5f37('0x81')],'server/files/images/avatars/customer_avatar.png');var _0x58fc6b={'where':{'id':_0x44f7db['params']['id']},'attributes':['id',_0x5f37('0x7d'),_0x5f37('0x8d')],'raw':!![]};return db[_0x5f37('0x58')][_0x5f37('0x60')](_0x58fc6b)['then'](handleEntityNotFound(_0x3bd90c,null))['then'](function(_0x1f286c){if(_0x1f286c){if(!_['isNil'](_0x1f286c[_0x5f37('0x7d')])){if(fs[_0x5f37('0x89')](path[_0x5f37('0x80')](config['root'],_0x5f37('0x8a'),_0x1f286c[_0x5f37('0x7d')]))&&_0x1f286c[_0x5f37('0x8d')]){_0x4b70e4=path[_0x5f37('0x80')](config['root'],_0x5f37('0x8a'),_0x1f286c[_0x5f37('0x7d')]);}}return _0x3bd90c[_0x5f37('0x8b')](_0x4b70e4);}})[_0x5f37('0x2e')](handleError(_0x3bd90c,null));};exports[_0x5f37('0x8e')]=function(_0x1d6d72,_0xea15de,_0xe44ae){var _0x4de34d=path[_0x5f37('0x80')](config[_0x5f37('0x81')],'server/files/images/avatars/system_avatar.png');var _0x4b5f49={'where':{'id':_0x1d6d72[_0x5f37('0x5d')]['id']},'attributes':['id',_0x5f37('0x7f')],'raw':!![]};return db[_0x5f37('0x58')][_0x5f37('0x60')](_0x4b5f49)[_0x5f37('0x24')](handleEntityNotFound(_0xea15de,null))[_0x5f37('0x24')](function(_0x359c62){if(_0x359c62){if(!_[_0x5f37('0x85')](_0x359c62[_0x5f37('0x7f')])){if(fs['existsSync'](path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x8a'),_0x359c62[_0x5f37('0x7f')]))){_0x4de34d=path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0x8a'),_0x359c62[_0x5f37('0x7f')]);}}return _0xea15de[_0x5f37('0x8b')](_0x4de34d);}})['catch'](handleError(_0xea15de,null));};exports[_0x5f37('0x8f')]=function(_0x1e6f5c,_0x216bee,_0x387d11){var _0x5d3f22=require(_0x5f37('0x90'));var _0x13421d=new _0x5d3f22();var _0x1908d7=_0x13421d['setUA'](_0x1e6f5c[_0x5f37('0x91')][_0x5f37('0x92')])[_0x5f37('0x93')]();var _0x4677b4={'body':_0x1e6f5c['body'],'channel':_0x5f37('0x94')};var _0x3933e9=[];var _0x1eb399=[];var _0x1da406={};var _0x30d937=![];return db['CmContact'][_0x5f37('0x6b')]()['then'](function(_0x307e0d){if(!_0x307e0d){throw new db[(_0x5f37('0x95'))]['ValidationError'](_0x5f37('0x96'));}_0x3933e9=_[_0x5f37('0x97')](_[_0x5f37('0x5f')](_0x307e0d),['createdAt',_0x5f37('0x98')]);_0x1eb399=_['difference'](_[_0x5f37('0x5f')](_0x307e0d),[_0x5f37('0x99'),_0x5f37('0x98'),_0x5f37('0x9a'),_0x5f37('0x9b')]);if(_0x1e6f5c[_0x5f37('0x62')]['id']){delete _0x1e6f5c[_0x5f37('0x62')]['id'];}if(_[_0x5f37('0x85')](_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9c')])){throw new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x62')])||_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x62')]===''){throw new db['Sequelize']['ValidationError'](_0x5f37('0x9e'));}if(_[_0x5f37('0x85')](_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9f')])){throw new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))](_0x5f37('0xa0')+_0x1eb399);}if(!_[_0x5f37('0xa1')](_0x1eb399,_0x1e6f5c['body']['mapKey'])){throw new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1eb399);}_0x1da406[_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9f')]]=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9c')];})[_0x5f37('0x24')](function(){return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x1e6f5c[_0x5f37('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x5f37('0xa2'),'include':[{'model':db['CmContact'],'as':_0x5f37('0xa3'),'where':_0x1da406,'limit':0x1,'order':[[_0x5f37('0x98'),'DESC']]}]},{'model':db[_0x5f37('0xa4')],'as':_0x5f37('0xa5')}]});})[_0x5f37('0x24')](handleEntityNotFound(_0x216bee,null))[_0x5f37('0x24')](function(_0xe2cf3f){if(_0xe2cf3f&&_0xe2cf3f[_0x5f37('0xa2')]){_0x4677b4[_0x5f37('0xa6')]=_0xe2cf3f;_0x4677b4[_0x5f37('0xa7')]=_0xe2cf3f[_0x5f37('0xa5')];_0x4677b4[_0x5f37('0xa8')]=_0xe2cf3f[_0x5f37('0xa2')];_0x4677b4[_0x5f37('0xa7')]=_[_0x5f37('0xa9')](_0x4677b4['applications'],[_0x5f37('0xaa')],[_0x5f37('0xab')]);if(_0x4677b4[_0x5f37('0xa6')][_0x5f37('0xa5')]){delete _0x4677b4['account'][_0x5f37('0xa5')];}if(_0x4677b4[_0x5f37('0xa6')][_0x5f37('0xa2')]&&_0x4677b4[_0x5f37('0xa6')][_0x5f37('0xa2')][_0x5f37('0xa3')][_0x5f37('0x4e')]){return _0x4677b4[_0x5f37('0xa6')][_0x5f37('0xa2')][_0x5f37('0xa3')][0x0];}var _0x4db22a=_[_0x5f37('0x1d')](_0x1e6f5c['body'],{'firstName':_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9c')],'ListId':_0xe2cf3f[_0x5f37('0x9b')]});_0x4db22a[_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9f')]]=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x9c')];return db['CmContact']['create'](_0x4db22a,{'fields':_0x3933e9,'raw':!![]});}})[_0x5f37('0x24')](handleEntityNotFound(_0x216bee,null))[_0x5f37('0x24')](function(_0x58bc61){_0x4677b4[_0x5f37('0xac')]=_0x58bc61;var _0x577242=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xad')];if(_0x1e6f5c['headers']['cf-connecting-ip']){_0x577242=_0x1e6f5c[_0x5f37('0x91')][_0x5f37('0xae')];}else if(_0x1e6f5c[_0x5f37('0x91')]['x-forwarded-for']){_0x577242=_[_0x5f37('0xaf')](_0x1e6f5c['headers'][_0x5f37('0xb0')][_0x5f37('0xb1')](','));}if(_0x58bc61){var _0x58360c={'ContactId':_0x58bc61['id'],'ChatWebsiteId':_0x1e6f5c['params']['id'],'from':(_0x58bc61['firstName']||'')+'\x20'+(_0x58bc61[_0x5f37('0xb2')]||''),'customerIp':_0x577242,'customerPort':_0x1e6f5c[_0x5f37('0x91')]['x-real-port']?_0x1e6f5c[_0x5f37('0x91')][_0x5f37('0xb3')]:null,'referer':_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xb4')],'browserName':_0x1908d7[_0x5f37('0xb5')]['name']&&_0x1908d7[_0x5f37('0xb5')][_0x5f37('0xb6')]?util['format'](_0x5f37('0xb7'),_0x1908d7[_0x5f37('0xb5')]['name'],_0x1908d7[_0x5f37('0xb5')][_0x5f37('0xb6')]):'unknown','browserVersion':_0x1908d7[_0x5f37('0xb5')][_0x5f37('0xb6')]||_0x5f37('0xb8'),'osName':util[_0x5f37('0xb9')](_0x5f37('0xb7'),_0x1908d7['os']['name'],_0x1908d7['os'][_0x5f37('0xb6')]),'osVersion':_0x1908d7['os']['version'],'deviceModel':_0x1908d7[_0x5f37('0xba')][_0x5f37('0x4a')]&&_0x1908d7[_0x5f37('0xba')][_0x5f37('0xbb')]?util[_0x5f37('0xb9')](_0x5f37('0xbc'),_0x1908d7['device'][_0x5f37('0x4a')],_0x1908d7[_0x5f37('0xba')][_0x5f37('0xbb')],_0x1908d7['device'][_0x5f37('0x44')]):null,'deviceVendor':_0x1908d7[_0x5f37('0xba')][_0x5f37('0xbb')],'deviceType':_0x1908d7['device'][_0x5f37('0x44')],'formData':JSON['stringify'](_0x1e6f5c[_0x5f37('0x62')])};var _0x177aac={'ChatWebsiteId':_0x1e6f5c[_0x5f37('0x5d')]['id'],'closed':![]};if(_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xbd')]){_0x177aac['threadId']=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xbd')];return db[_0x5f37('0xbe')]['find']({'where':_0x177aac})[_0x5f37('0x24')](function(_0x4f2fc3){if(_0x4f2fc3){return[_0x4f2fc3,![]];}_0x58360c[_0x5f37('0xbd')]=_0x1e6f5c[_0x5f37('0x62')]['threadId'];_0x58360c['externalUrl']=_0x1e6f5c['body'][_0x5f37('0xbf')];return db[_0x5f37('0xbe')][_0x5f37('0x61')](_0x58360c)['then'](function(_0x537d82){return[_0x537d82,!![]];});});}_0x177aac['ContactId']=_0x58bc61['id'];if(_0x1e6f5c['body'][_0x5f37('0xc0')]&&_0x1e6f5c[_0x5f37('0x62')]['interaction']['id']){_0x177aac['id']=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xc0')]['id'];return db[_0x5f37('0xbe')][_0x5f37('0x60')]({'where':_0x177aac})[_0x5f37('0x24')](function(_0x2ba4e8){if(_0x2ba4e8){return[_0x2ba4e8,![]];}return db[_0x5f37('0xbe')]['create'](_0x58360c)[_0x5f37('0x24')](function(_0x283731){return[_0x283731,!![]];});});}return db[_0x5f37('0xbe')][_0x5f37('0x61')](_0x58360c)['then'](function(_0x49782c){return[_0x49782c,!![]];});}})[_0x5f37('0xc1')](function(_0xc7eb23,_0x351f83){if(_0xc7eb23){_0x30d937=_0x351f83;if(!_0x351f83){var _0x2d2cf5={'from':(_0x4677b4[_0x5f37('0xac')][_0x5f37('0xc2')]||'')+'\x20'+(_0x4677b4['contact'][_0x5f37('0xb2')]||'')};if(_0x1e6f5c['body'][_0x5f37('0xbd')]&&_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xc3')]&&_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xbd')]!=_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0xc3')]){_0x2d2cf5[_0x5f37('0xbd')]=_0x1e6f5c['body'][_0x5f37('0xc3')];}return _0xc7eb23[_0x5f37('0x3a')](_0x2d2cf5);}else{return _0xc7eb23;}}})[_0x5f37('0x24')](function(_0x56fb21){_0x4677b4['interaction']=_0x56fb21[_0x5f37('0x63')]({'plain':!![]});_0x4677b4[_0x5f37('0xc0')]['created']=_0x30d937;if(_0x4677b4[_0x5f37('0xc0')][_0x5f37('0xc4')]){if(_0x4677b4[_0x5f37('0xa6')][_0x5f37('0xc5')]){_0x4677b4[_0x5f37('0xa7')][_0x5f37('0xc6')]({'id':0x0,'priority':_0x4677b4[_0x5f37('0xa7')]['length']+0x1,'app':'close','appdata':_0x5f37('0xc7'),'interval':'*,*,*,*'});}}return db[_0x5f37('0xc8')]['create']({'body':_0x1e6f5c[_0x5f37('0x62')][_0x5f37('0x62')],'ChatWebsiteId':_0x1e6f5c['params']['id'],'ChatInteractionId':_0x56fb21['id'],'direction':'in','ContactId':_0x4677b4[_0x5f37('0xac')]['id'],'AttachmentId':_0x1e6f5c[_0x5f37('0x62')]['AttachmentId']});})['then'](function(_0x17a41e){_0x4677b4['message']=_0x17a41e;if(_0x4677b4['interaction'][_0x5f37('0xc9')]){return db[_0x5f37('0xca')][_0x5f37('0x60')]({'attributes':['id','name'],'where':{'id':_0x4677b4['interaction']['UserId']}})[_0x5f37('0x24')](function(_0x45cd58){if(_0x45cd58){_0x4677b4[_0x5f37('0xa7')][_0x5f37('0xcb')]({'id':0x0,'priority':0x0,'app':_0x5f37('0xcc'),'appdata':_0x45cd58[_0x5f37('0x47')]+','+(_0x4677b4[_0x5f37('0xa6')][_0x5f37('0xcd')]||0xa),'interval':_0x5f37('0xce')});_0x4677b4[_0x5f37('0xcf')]=!![];}return respondWithRpcPromise(_0x5f37('0xd0'),'startRouting',_0x4677b4);});}return respondWithRpcPromise(_0x5f37('0xd0'),_0x5f37('0xd1'),_0x4677b4);})['then'](function(_0x3c15cb){respondWithRpcPromise(_0x5f37('0xd2'),_0x5f37('0xd2'),{'event':_0x5f37('0x8f'),'message':_0x3c15cb},client9002);return _0x3c15cb;})['then'](respondWithResult(_0x216bee,null))[_0x5f37('0x2e')](handleError(_0x216bee,null));};exports['offline']=function(_0x116940,_0x114fd2,_0x3ca7bb){var _0xb09e65,_0x1d9960,_0x1c422f;var _0x47d915=[];var _0x193d6a=[];var _0x3dbce6={};var _0x9229=_0x116940[_0x5f37('0xd3')]||[];var _0x14aa08=[];var _0x3ea70e;return db[_0x5f37('0xd4')]['describe']()[_0x5f37('0x24')](function(_0x4cc0e1){if(!_0x4cc0e1){throw new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))](_0x5f37('0x96'));}_0x193d6a=_['difference'](_[_0x5f37('0x5f')](_0x4cc0e1),['createdAt',_0x5f37('0x98')]);_0x47d915=_[_0x5f37('0x97')](_[_0x5f37('0x5f')](_0x4cc0e1),['createdAt',_0x5f37('0x98'),_0x5f37('0x9a'),_0x5f37('0x9b')]);if(_0x116940[_0x5f37('0x62')]['id']){delete _0x116940['body']['id'];}if(_[_0x5f37('0x85')](_0x116940[_0x5f37('0x62')]['from'])){throw _0x114fd2[_0x5f37('0x31')](0x1f4)[_0x5f37('0x3f')](new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))](_0x5f37('0xd5')));}if(_['isNil'](_0x116940[_0x5f37('0x62')][_0x5f37('0x62')])||_0x116940[_0x5f37('0x62')][_0x5f37('0x62')]===''){throw _0x114fd2['status'](0x1f4)['send'](new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))](_0x5f37('0x9e')));}if(_[_0x5f37('0x85')](_0x116940[_0x5f37('0x62')][_0x5f37('0xd6')])){throw _0x114fd2['status'](0x1f4)[_0x5f37('0x3f')](new db[(_0x5f37('0x95'))]['ValidationError'](_0x5f37('0xd7')+_0x47d915));}if(!_[_0x5f37('0xa1')](_0x47d915,_0x116940[_0x5f37('0x62')]['mapKeyOffline'])){throw _0x114fd2[_0x5f37('0x31')](0x1f4)[_0x5f37('0x3f')](new db[(_0x5f37('0x95'))][(_0x5f37('0x9d'))](_0x5f37('0xd8')+_0x47d915));}_0x3dbce6[_0x116940['body'][_0x5f37('0xd6')]]=_0x116940['body']['from'];})[_0x5f37('0x24')](function(){return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x116940[_0x5f37('0x5d')]['id']},'include':[{'model':db[_0x5f37('0xd9')],'as':'List'},{'model':db[_0x5f37('0xda')],'as':_0x5f37('0xda')}]});})[_0x5f37('0x24')](handleEntityNotFound(_0x114fd2,null))[_0x5f37('0x24')](function(_0x53bf45){if(_0x53bf45&&_0x53bf45[_0x5f37('0xa2')]){_0x1d9960=_0x53bf45;var _0x3eeebf=_[_0x5f37('0x1d')](_0x116940[_0x5f37('0x62')],{'firstName':_0x116940[_0x5f37('0x62')][_0x5f37('0x9c')],'phone':_0x116940[_0x5f37('0x62')]['from'],'ListId':_0x53bf45[_0x5f37('0x9b')]});_0x3eeebf[_0x116940['body'][_0x5f37('0xd6')]]=_0x116940[_0x5f37('0x62')]['from'];return db[_0x5f37('0xd4')][_0x5f37('0xdb')]({'where':_0x3dbce6,'defaults':_0x3eeebf});}})[_0x5f37('0xc1')](function(_0x1521a0){if(_0x1521a0){_0x1c422f=_0x1521a0;var _0x52ae8e=fs[_0x5f37('0xdc')](path[_0x5f37('0x80')](config[_0x5f37('0x81')],'server/files/templates/chatOfflineMessage.ejs'),_0x5f37('0xdd'));var _0x2479f0=ejs[_0x5f37('0xde')](_0x52ae8e,{'body':_['toPairs'](_0x116940['body'][_0x5f37('0x62')]),'bodyTitle':_0x1d9960[_0x5f37('0xdf')]});return db[_0x5f37('0xe0')][_0x5f37('0x61')]({'body':_0x2479f0,'ContactId':_0x1521a0['id'],'ChatWebsiteId':_0x1d9960['id']});}})[_0x5f37('0x24')](function(_0xb98180){_0x3ea70e=_0xb98180;if(_0x9229[_0x5f37('0x4e')]){var _0x84b7a4=_0x9229['map'](function(_0x4923e8){return{'name':_0x4923e8['originalname'],'basename':_0x4923e8['filename'],'type':_0x4923e8[_0x5f37('0xe1')],'ChatOfflineMessageId':_0xb98180['id']};});_0x14aa08=_0x84b7a4[_0x5f37('0x46')](_0xb22645=>{var _0x59aaba={'filename':_0xb22645['name'],'path':path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0xe2'),_0x5f37('0xd3'),_0x5f37('0xe3'),_0x5f37('0xe4'),_0xb22645[_0x5f37('0xe5')])};return _0x59aaba;});if(!_0x1d9960[_0x5f37('0xe6')]){return db[_0x5f37('0xe7')][_0x5f37('0xe8')](function(_0x2cc298){return db[_0x5f37('0xe9')][_0x5f37('0xea')](_0x84b7a4,{'transaction':_0x2cc298});});}}})[_0x5f37('0x24')](function(){if(_0x3ea70e){_0xb09e65=_0x3ea70e;return db[_0x5f37('0xda')][_0x5f37('0x6c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5f37('0xeb'),'raw':!![]}]});}})[_0x5f37('0x24')](function(_0x355504){if(_0x355504&&_0x355504[_0x5f37('0xeb')]&&_0x1d9960[_0x5f37('0xec')]&&_0x1d9960[_0x5f37('0xed')]){var _0x4792c8={'tls':{'rejectUnauthorized':![]}};if(_0x355504['Smtp']['service']){_0x4792c8['service']=_0x355504[_0x5f37('0xeb')][_0x5f37('0xee')];}else{_0x4792c8['host']=_0x355504['Smtp'][_0x5f37('0xef')];_0x4792c8[_0x5f37('0xf0')]=_0x355504[_0x5f37('0xeb')][_0x5f37('0xf0')];_0x4792c8['secure']=_0x355504[_0x5f37('0xeb')]['secure'];}if(_0x355504['Smtp'][_0x5f37('0xf1')]){_0x4792c8['auth']={'user':_0x355504['Smtp'][_0x5f37('0x66')],'pass':_0x355504[_0x5f37('0xeb')][_0x5f37('0xf2')]};}return respondWithRpcPromise(_0x5f37('0xf3'),_0x5f37('0xf4'),{'account':_0x4792c8,'message':{'from':util[_0x5f37('0xb9')](_0x5f37('0xf5'),_0x355504[_0x5f37('0x47')],_0x355504[_0x5f37('0xf6')]||_0x355504[_0x5f37('0xeb')][_0x5f37('0x66')]),'to':_0x1d9960[_0x5f37('0xed')],'subject':_0x1d9960[_0x5f37('0xf7')],'html':_0xb09e65[_0x5f37('0x62')],'attachments':_0x14aa08}},client9003)[_0x5f37('0x24')](function(){return _0xb09e65;})[_0x5f37('0x2e')](function(_0x3f0099){console['error'](_0x3f0099);});}})[_0x5f37('0x24')](function(){if(_0x1d9960&&_0x1d9960[_0x5f37('0xe6')]&&_0x1d9960[_0x5f37('0xf8')]){var _0x40dd23=[];if(_0x9229[_0x5f37('0x4e')]){_0x40dd23=_0x9229['map'](function(_0x359f1c){return{'name':_0x359f1c[_0x5f37('0xf9')],'basename':_0x359f1c[_0x5f37('0x79')],'type':_0x359f1c[_0x5f37('0xe1')],'ChatOfflineMessageId':_0x3ea70e['id']};});}var _0x5b557d;if(!_[_0x5f37('0x85')](_0x1d9960[_0x5f37('0xfa')])){var _0xbedd2b=_[_0x5f37('0x46')](_0x116940[_0x5f37('0x62')],function(_0x57b5dc){return _0x57b5dc;});var _0x54b609=_[_0x5f37('0xfb')](_0xbedd2b)[0x0];var _0x52ad05=_[_0x5f37('0xfc')](_0x54b609,function(_0x2409c0){return _0x2409c0;});_0x5b557d=_0x52ad05[0x1][_0x1d9960[_0x5f37('0xfa')]];}var _0x359722={'from':_0x1c422f[_0x5f37('0xf6')],'firstName':_0x1c422f[_0x5f37('0xc2')],'lastName':_0x1c422f['lastName'],'mapKey':_0x5f37('0xf6'),'message':{'from':_0x1c422f[_0x5f37('0xf6')],'to':_0x1d9960[_0x5f37('0xda')][_0x5f37('0xf6')],'cc':'','subject':_['isNil'](_0x5b557d)?_0x1d9960[_0x5f37('0xf7')]:_0x5b557d,'messageId':'','sentAt':new Date(),'attach':_0x40dd23[_0x5f37('0x4e')],'attachments':_0x40dd23,'originChannel':_0x5f37('0xfd'),'ChatWebsiteId':_0x1d9960['id'],'ChatOfflineMessageId':_0xb09e65['id'],'originTo':_0x1d9960[_0x5f37('0xda')][_0x5f37('0xf6')]},'body':_0xb09e65[_0x5f37('0x62')]};var _0x2cc5d1={'account':{'id':_0x1d9960['MailAccountId']},'body':_0x359722,'log':_0x5f37('0xfe')};return respondWithRpcPromise(_0x5f37('0xfe'),_0x5f37('0xff'),_0x2cc5d1,client9001)[_0x5f37('0x24')](function(){return _0xb09e65;})['catch'](function(_0x76655){console[_0x5f37('0x2a')](_0x76655);});}return;})[_0x5f37('0x24')](function(){if(_0xb09e65){return _0xb09e65;}})[_0x5f37('0x24')](respondWithResult(_0x114fd2,null))[_0x5f37('0x2e')](function(_0x42feba){console['error'](_0x5f37('0x2e'),_0x42feba);for(var _0x5c601e of _0x9229){var _0x124f55=path[_0x5f37('0x80')](config[_0x5f37('0x81')],_0x5f37('0xe2'),_0x5f37('0xd3'),'attachments','offline-chat',_0x5c601e[_0x5f37('0x79')]);fs_extra[_0x5f37('0x100')](_0x124f55)[_0x5f37('0x2e')](function(_0x5800da){console[_0x5f37('0x2a')]('Could\x20not\x20remove\x20attachment\x20file',_0x124f55,_0x5800da);});}});};exports[_0x5f37('0x101')]=function(_0x497f6b,_0x170549,_0x35ae7c){return db[_0x5f37('0xbe')][_0x5f37('0x60')]({'where':{'id':_0x497f6b[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x170549,null))['then'](function(_0x9ae25a){if(_0x9ae25a){return _0x9ae25a[_0x5f37('0x101')](_0x497f6b[_0x5f37('0x62')]['ids'],_['omit'](_0x497f6b[_0x5f37('0x62')],[_0x5f37('0x72'),'id'])||{});}})['then'](respondWithResult(_0x170549,null))['catch'](handleError(_0x170549,null));};exports['getInteractions']=function(_0x5ac279,_0x547839,_0x168ae6){var _0x110019={'raw':![],'where':{}};var _0x3cb7b7={};var _0x53657a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5ac279[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x547839,null))[_0x5f37('0x24')](function(_0x58b11a){if(_0x58b11a){_0x3cb7b7['model']=_['keys'](db[_0x5f37('0xbe')][_0x5f37('0x5e')]);_0x3cb7b7[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x5ac279[_0x5f37('0x4b')]);_0x3cb7b7['filters']=_['intersection'](_0x3cb7b7[_0x5f37('0x4a')],_0x3cb7b7[_0x5f37('0x4b')]);_0x110019[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0x3cb7b7[_0x5f37('0x4a')],qs['fields'](_0x5ac279[_0x5f37('0x4b')]['fields']));_0x110019[_0x5f37('0x4c')]=_0x110019[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x110019['attributes']:_0x3cb7b7[_0x5f37('0x4a')];if(!_0x5ac279[_0x5f37('0x4b')]['hasOwnProperty'](_0x5f37('0x6e'))){_0x110019[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x34')]);_0x110019[_0x5f37('0x32')]=qs[_0x5f37('0x32')](_0x5ac279['query'][_0x5f37('0x32')]);}_0x110019[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x5ac279[_0x5f37('0x4b')]['sort']);_0x110019['where']=qs[_0x5f37('0x48')](_[_0x5f37('0x53')](_0x5ac279[_0x5f37('0x4b')],_0x3cb7b7[_0x5f37('0x48')]));_0x110019[_0x5f37('0x52')][_0x5f37('0x6f')]=_0x58b11a['id'];if(_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x54')]){_0x110019[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0x110019[_0x5f37('0x52')],{'$or':_['map'](_0x110019[_0x5f37('0x4c')],function(_0x36f91d){var _0x4b8a31={};_0x4b8a31[_0x36f91d]={'$like':'%'+_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x54')]+'%'};return _0x4b8a31;})});}_0x110019=_[_0x5f37('0x55')]({},_0x110019,_0x5ac279[_0x5f37('0x57')]);return db['ChatInteraction'][_0x5f37('0x35')]({'where':_0x110019[_0x5f37('0x52')]})[_0x5f37('0x24')](function(_0x49e96c){_0x53657a[_0x5f37('0x35')]=_0x49e96c;if(_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x59')]){_0x110019[_0x5f37('0x70')]=[{'model':db[_0x5f37('0xd4')],'as':_0x5f37('0x102'),'required':![]},{'model':db[_0x5f37('0xca')],'as':_0x5f37('0x103'),'attributes':[_0x5f37('0x47'),_0x5f37('0x104'),_0x5f37('0x105')],'required':![]},{'model':db[_0x5f37('0x106')],'as':_0x5f37('0x107'),'attributes':['id','name',_0x5f37('0x108')],'where':_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x109')]?{'id':_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x109')]}:undefined,'required':_0x5ac279[_0x5f37('0x4b')][_0x5f37('0x109')]?!![]:![]}];}return db[_0x5f37('0xbe')][_0x5f37('0x5a')](_0x110019);})['then'](function(_0x375be8){_0x53657a[_0x5f37('0x5b')]=_0x375be8;return _0x53657a;});}})[_0x5f37('0x24')](respondWithFilteredResult(_0x547839,_0x110019))[_0x5f37('0x2e')](handleError(_0x547839,null));};function iftimePromise(_0x2a49d8,_0x3cf8a7){return respondWithRpcPromise(_0x5f37('0x10a'),_0x5f37('0x10b'),{'command':_0x3cf8a7[_0x5f37('0x10c')]?util[_0x5f37('0xb9')](_0x5f37('0x10d'),_0x2a49d8[_0x5f37('0x10e')],_0x3cf8a7[_0x5f37('0x10c')]):util[_0x5f37('0xb9')](_0x5f37('0x10f'),_0x2a49d8['interval'])},client9002)['then'](function(_0x5d777b){var _0xa66ed5=_0x5d777b&&_0x5d777b[_0x5f37('0x110')](_0x5f37('0x111'))>=0x0?!![]:![];logger['info'](_0x5f37('0x112'),_0x3cf8a7['id'],_0x2a49d8['id'],_0x2a49d8[_0x5f37('0x10e')],_0xa66ed5?_0x5f37('0x113'):_0x5f37('0x114'),_0x3cf8a7[_0x5f37('0x10c')]?_0x3cf8a7['timezone']:_0x5f37('0x115'));return _0xa66ed5;})['catch'](function(_0x5673d1){logger[_0x5f37('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3cf8a7['id'],_0x2a49d8['id'],_0x2a49d8[_0x5f37('0x10e')],util[_0x5f37('0x116')](_0x5673d1,{'showHidden':![],'depth':null}),_0x3cf8a7[_0x5f37('0x10c')]?_0x3cf8a7[_0x5f37('0x10c')]:_0x5f37('0x115'));return![];});}exports['getSnippet']=function(_0x1ff0de,_0x13052b,_0x423852){var _0x5942a4=0x0;var _0x14a3d1=0x0;var _0x46001b=![];var _0x421a0b;var _0x4c50c0;return db[_0x5f37('0x58')][_0x5f37('0x60')]({'where':{'id':_0x1ff0de[_0x5f37('0x5d')]['id']},'include':[{'model':db[_0x5f37('0x117')],'as':_0x5f37('0x117'),'include':[{'model':db[_0x5f37('0x117')],'as':'Intervals','attributes':['id',_0x5f37('0x10e')],'raw':!![]}]}]})[_0x5f37('0x24')](handleEntityNotFound(_0x13052b,null))[_0x5f37('0x24')](function(_0x1cf5d3){if(_0x1cf5d3){_0x421a0b=_0x1cf5d3;return _0x1cf5d3[_0x5f37('0x118')]({'raw':!![]});}})[_0x5f37('0x24')](function(_0x4725e9){if(_0x421a0b){if(_0x4725e9){_0x4c50c0=_0x4725e9;}}return require(_0x5f37('0x1a'))[_0x5f37('0x83')]();})[_0x5f37('0x24')](function(_0x2c5538){if(_0x2c5538){_0x14a3d1=_0x2c5538[_0x5f37('0x119')];_0x46001b=_0x2c5538[_0x5f37('0x84')];}})[_0x5f37('0x24')](function(){return db['ChatInteraction'][_0x5f37('0x35')]({'where':{'closed':![]}});})['then'](function(_0x19bba6){_0x5942a4=_0x19bba6;if(_0x14a3d1&&_0x19bba6>_0x14a3d1){return db[_0x5f37('0x11a')][_0x5f37('0x6c')]({'where':{'id':0x1}})[_0x5f37('0x24')](function(_0x138de7){if(_0x138de7){_0x138de7['increment']('chatLicenseExceeded');}});}})[_0x5f37('0x24')](function(){if(_0x421a0b[_0x5f37('0x117')]&&_0x421a0b['Interval']['Intervals']){var _0x3e3c12=[];for(var _0x5d9b4a=0x0;_0x5d9b4a<_0x421a0b[_0x5f37('0x117')][_0x5f37('0x11b')][_0x5f37('0x4e')];_0x5d9b4a++){var _0x1d477a=_0x421a0b[_0x5f37('0x117')][_0x5f37('0x11b')][_0x5d9b4a][_0x5f37('0x63')]({'plain':!![]});_0x3e3c12[_0x5f37('0xc6')](iftimePromise(_0x1d477a,_0x421a0b));}return BPromise[_0x5f37('0x11c')](_0x3e3c12)['then'](function(_0x2b7405){return _[_0x5f37('0x11d')](_0x2b7405);});}else{return!![];}})[_0x5f37('0x24')](function(_0x5dcf61){var _0x3278fe=fs['readFileSync'](path['join'](config[_0x5f37('0x81')],_0x5f37('0x11e')),_0x5f37('0xdd'));var _0x2e4292={'remote':_0x421a0b[_0x5f37('0x11f')],'query':querystring['stringify'](_[_0x5f37('0x55')](_0x421a0b[_0x5f37('0x63')]({'plain':!![]}),{'customerIp':_0x1ff0de['headers'][_0x5f37('0xb0')]||_0x1ff0de[_0x5f37('0x91')][_0x5f37('0x120')]||_0x1ff0de[_0x5f37('0x121')]['remoteAddress']||_0x1ff0de['ip'],'referer':_0x1ff0de['headers']['referer'],'openedInteractions':_0x5942a4,'maxInteractions':_0x14a3d1,'virtual':_0x46001b[_0x5f37('0x119')],'online':_0x5dcf61,'custom':_0x46001b}))[_0x5f37('0x122')](/'/g,'\x5c\x27')};_0x13052b[_0x5f37('0x3f')](ejs['render'](Mustache['render'](_0x3278fe,_0x2e4292),{'proactiveActions':_0x4c50c0,'alignment':_0x421a0b[_0x5f37('0x123')],'verticalAlignment':_0x421a0b[_0x5f37('0x124')],'div_color':_0x421a0b[_0x5f37('0x108')],'text_color':_0x421a0b[_0x5f37('0x125')],'button_color':_0x421a0b[_0x5f37('0x126')],'background_color':_0x421a0b[_0x5f37('0x127')]}));})[_0x5f37('0x2e')](handleError(_0x13052b,null));};exports[_0x5f37('0x128')]=function(_0x32d48d,_0x4a8a33,_0x4648b3){return db[_0x5f37('0x58')][_0x5f37('0x6c')]({'where':{'id':_0x32d48d['params']['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x4a8a33,null))[_0x5f37('0x24')](function(_0x45cf8f){if(_0x45cf8f){return db[_0x5f37('0xe7')]['transaction'](function(_0x1c6ee7){return db[_0x5f37('0xa4')]['destroy']({'where':{'ChatWebsiteId':_0x32d48d[_0x5f37('0x5d')]['id']},'transaction':_0x1c6ee7})[_0x5f37('0x24')](function(_0x2086d4){var _0x30d012=_[_0x5f37('0x46')](_0x32d48d['body'],function(_0x3f002d){_0x3f002d[_0x5f37('0x6f')]=_0x32d48d['params']['id'];return _0x3f002d;});return db[_0x5f37('0xa4')][_0x5f37('0xea')](_0x30d012,{'transaction':_0x1c6ee7});});})[_0x5f37('0x24')](function(){return db[_0x5f37('0xa4')][_0x5f37('0x129')]({'where':{'ChatWebsiteId':_0x32d48d[_0x5f37('0x5d')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4a8a33,null))[_0x5f37('0x2e')](handleError(_0x4a8a33,null));};exports[_0x5f37('0x12a')]=function(_0x57af9f,_0x21e21c,_0x3f7b8b){var _0x262ec8={};var _0xc1e154={};var _0x46cb39;var _0x36cdba;return db[_0x5f37('0x58')][_0x5f37('0x6c')]({'where':{'id':_0x57af9f[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x21e21c,null))[_0x5f37('0x24')](function(_0x13f3fe){if(_0x13f3fe){_0x46cb39=_0x13f3fe;_0xc1e154['model']=_[_0x5f37('0x5f')](db[_0x5f37('0xa4')][_0x5f37('0x5e')]);_0xc1e154[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x57af9f['query']);_0xc1e154[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0xc1e154['model'],_0xc1e154[_0x5f37('0x4b')]);_0x262ec8[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0xc1e154[_0x5f37('0x4a')],qs['fields'](_0x57af9f[_0x5f37('0x4b')]['fields']));_0x262ec8['attributes']=_0x262ec8[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x262ec8[_0x5f37('0x4c')]:_0xc1e154[_0x5f37('0x4a')];_0x262ec8[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x57af9f[_0x5f37('0x4b')][_0x5f37('0x51')]);_0x262ec8[_0x5f37('0x52')]=qs[_0x5f37('0x48')](_['pick'](_0x57af9f[_0x5f37('0x4b')],_0xc1e154['filters']));if(_0x57af9f[_0x5f37('0x4b')]['filter']){_0x262ec8[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0x262ec8['where'],{'$or':_[_0x5f37('0x46')](_0x262ec8[_0x5f37('0x4c')],function(_0x224ee1){var _0x283b59={};_0x283b59[_0x224ee1]={'$like':'%'+_0x57af9f[_0x5f37('0x4b')][_0x5f37('0x54')]+'%'};return _0x283b59;})});}_0x262ec8=_['merge']({},_0x262ec8,_0x57af9f[_0x5f37('0x57')]);return _0x46cb39[_0x5f37('0x12a')](_0x262ec8);}})[_0x5f37('0x24')](function(_0x2a96cb){if(_0x2a96cb){_0x36cdba=_0x2a96cb[_0x5f37('0x4e')];if(!_0x57af9f[_0x5f37('0x4b')][_0x5f37('0x4f')]('nolimit')){_0x262ec8[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x57af9f[_0x5f37('0x4b')][_0x5f37('0x34')]);_0x262ec8[_0x5f37('0x32')]=qs[_0x5f37('0x32')](_0x57af9f[_0x5f37('0x4b')][_0x5f37('0x32')]);}return _0x46cb39[_0x5f37('0x12a')](_0x262ec8);}})[_0x5f37('0x24')](function(_0x246594){if(_0x246594){return _0x246594?{'count':_0x36cdba,'rows':_0x246594}:null;}})[_0x5f37('0x24')](respondWithResult(_0x21e21c,null))[_0x5f37('0x2e')](handleError(_0x21e21c,null));};exports['addProactiveActions']=function(_0x489e79,_0x2e9117,_0x134de3){return db[_0x5f37('0x12b')][_0x5f37('0x60')]({'where':{'id':_0x489e79[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x2e9117,null))[_0x5f37('0x24')](function(_0x4ba287){if(_0x4ba287){return _0x4ba287[_0x5f37('0x12c')](_0x489e79['body'][_0x5f37('0x72')],_[_0x5f37('0x12d')](_0x489e79[_0x5f37('0x62')],[_0x5f37('0x72'),'id'])||{});}})['then'](respondWithResult(_0x2e9117,null))[_0x5f37('0x2e')](handleError(_0x2e9117,null));};exports[_0x5f37('0x118')]=function(_0x52b1dc,_0x366066,_0x1c98a9){var _0x3c96f9={};var _0x5c405a={};var _0x2bf146;var _0x22d27d;return db['ChatWebsite'][_0x5f37('0x6c')]({'where':{'id':_0x52b1dc[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x366066,null))[_0x5f37('0x24')](function(_0x4ce616){if(_0x4ce616){_0x2bf146=_0x4ce616;_0x5c405a[_0x5f37('0x4a')]=_[_0x5f37('0x5f')](db[_0x5f37('0x12e')]['rawAttributes']);_0x5c405a['query']=_[_0x5f37('0x5f')](_0x52b1dc[_0x5f37('0x4b')]);_0x5c405a[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0x5c405a[_0x5f37('0x4a')],_0x5c405a[_0x5f37('0x4b')]);_0x3c96f9['attributes']=_[_0x5f37('0x49')](_0x5c405a[_0x5f37('0x4a')],qs[_0x5f37('0x4d')](_0x52b1dc[_0x5f37('0x4b')][_0x5f37('0x4d')]));_0x3c96f9[_0x5f37('0x4c')]=_0x3c96f9[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x3c96f9['attributes']:_0x5c405a[_0x5f37('0x4a')];_0x3c96f9['order']=qs['sort'](_0x52b1dc[_0x5f37('0x4b')][_0x5f37('0x51')]);_0x3c96f9[_0x5f37('0x52')]=qs[_0x5f37('0x48')](_[_0x5f37('0x53')](_0x52b1dc[_0x5f37('0x4b')],_0x5c405a[_0x5f37('0x48')]));if(_0x52b1dc['query'][_0x5f37('0x54')]){_0x3c96f9['where']=_[_0x5f37('0x55')](_0x3c96f9[_0x5f37('0x52')],{'$or':_[_0x5f37('0x46')](_0x3c96f9[_0x5f37('0x4c')],function(_0x2507c9){var _0x452d4c={};_0x452d4c[_0x2507c9]={'$like':'%'+_0x52b1dc[_0x5f37('0x4b')][_0x5f37('0x54')]+'%'};return _0x452d4c;})});}_0x3c96f9=_[_0x5f37('0x55')]({},_0x3c96f9,_0x52b1dc[_0x5f37('0x57')]);return _0x2bf146[_0x5f37('0x118')](_0x3c96f9);}})[_0x5f37('0x24')](function(_0x3c517f){if(_0x3c517f){_0x22d27d=_0x3c517f[_0x5f37('0x4e')];if(!_0x52b1dc[_0x5f37('0x4b')][_0x5f37('0x4f')]('nolimit')){_0x3c96f9[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x52b1dc[_0x5f37('0x4b')]['limit']);_0x3c96f9[_0x5f37('0x32')]=qs[_0x5f37('0x32')](_0x52b1dc[_0x5f37('0x4b')][_0x5f37('0x32')]);}return _0x2bf146[_0x5f37('0x118')](_0x3c96f9);}})[_0x5f37('0x24')](function(_0x22452d){if(_0x22452d){return _0x22452d?{'count':_0x22d27d,'rows':_0x22452d}:null;}})[_0x5f37('0x24')](respondWithResult(_0x366066,null))[_0x5f37('0x2e')](handleError(_0x366066,null));};exports['getFields']=function(_0x44c905,_0x24e880,_0x275ef1){var _0x1ead2d=_0x44c905[_0x5f37('0x4b')][_0x5f37('0x12f')]===_0x5f37('0x130')?_0x5f37('0x131'):_0x5f37('0x132');return db[_0x5f37('0x58')][_0x5f37('0x60')]({'attributes':['id',_0x1ead2d],'where':{'id':_0x44c905[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x24e880,null))['then'](function(_0x2e2be3){if(_0x2e2be3){var _0x505114=_0x2e2be3[_0x1ead2d];var _0x1b680e=_0x505114&&_0x505114[_0x5f37('0x133')]?_0x505114[_0x5f37('0x133')]:[];_0x24e880[_0x5f37('0x3f')]({'fromKey':_['isNil'](_0x505114[_0x5f37('0x134')])?undefined:_0x505114[_0x5f37('0x134')],'count':_0x1b680e[_0x5f37('0x4e')],'rows':_0x1b680e});}})[_0x5f37('0x2e')](handleError(_0x24e880,null));};exports[_0x5f37('0x135')]=function(_0x1eb2f2,_0x4f05ec,_0x50b131){var _0xc8e045={'raw':![],'where':{}};var _0x588472={};var _0x3d1a29={'count':0x0,'rows':[]};return db[_0x5f37('0x58')][_0x5f37('0x6c')]({'where':{'id':_0x1eb2f2[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x4f05ec,null))['then'](function(_0x31499b){if(_0x31499b){_0x588472[_0x5f37('0x4a')]=_['keys'](db[_0x5f37('0xe0')][_0x5f37('0x5e')]);_0x588472[_0x5f37('0x4b')]=_['keys'](_0x1eb2f2[_0x5f37('0x4b')]);_0x588472[_0x5f37('0x48')]=_[_0x5f37('0x49')](_0x588472[_0x5f37('0x4a')],_0x588472['query']);_0xc8e045[_0x5f37('0x4c')]=_[_0x5f37('0x49')](_0x588472[_0x5f37('0x4a')],qs[_0x5f37('0x4d')](_0x1eb2f2[_0x5f37('0x4b')][_0x5f37('0x4d')]));_0xc8e045[_0x5f37('0x4c')]=_0xc8e045['attributes'][_0x5f37('0x4e')]?_0xc8e045['attributes']:_0x588472[_0x5f37('0x4a')];if(!_0x1eb2f2[_0x5f37('0x4b')]['hasOwnProperty']('nolimit')){_0xc8e045[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x1eb2f2[_0x5f37('0x4b')][_0x5f37('0x34')]);_0xc8e045['offset']=qs[_0x5f37('0x32')](_0x1eb2f2[_0x5f37('0x4b')]['offset']);}_0xc8e045[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x1eb2f2[_0x5f37('0x4b')][_0x5f37('0x51')]);_0xc8e045[_0x5f37('0x52')]=qs[_0x5f37('0x48')](_[_0x5f37('0x53')](_0x1eb2f2['query'],_0x588472[_0x5f37('0x48')]));_0xc8e045[_0x5f37('0x52')][_0x5f37('0x6f')]=_0x31499b['id'];if(_0x1eb2f2['query'][_0x5f37('0x54')]){_0xc8e045[_0x5f37('0x52')]=_[_0x5f37('0x55')](_0xc8e045['where'],{'$or':_['map'](_0xc8e045['attributes'],function(_0x2ba1f9){var _0x266dc2={};_0x266dc2[_0x2ba1f9]={'$like':'%'+_0x1eb2f2['query']['filter']+'%'};return _0x266dc2;})});}_0xc8e045=_[_0x5f37('0x55')]({},_0xc8e045,_0x1eb2f2[_0x5f37('0x57')]);return db[_0x5f37('0xe0')][_0x5f37('0x35')]({'where':_0xc8e045['where']})[_0x5f37('0x24')](function(_0x15bd33){_0x3d1a29[_0x5f37('0x35')]=_0x15bd33;if(_0x1eb2f2[_0x5f37('0x4b')][_0x5f37('0x59')]){_0xc8e045[_0x5f37('0x70')]=[{'all':!![]}];}else{_0xc8e045[_0x5f37('0x70')]=[{'model':db[_0x5f37('0xd4')],'as':_0x5f37('0x102'),'required':![]},{'model':db['Attachment'],'as':_0x5f37('0x136'),'required':![]}];}return db[_0x5f37('0xe0')]['findAll'](_0xc8e045);})['then'](function(_0xf88aa1){_0x3d1a29[_0x5f37('0x5b')]=_0xf88aa1;return _0x3d1a29;});}})[_0x5f37('0x24')](respondWithFilteredResult(_0x4f05ec,_0xc8e045))[_0x5f37('0x2e')](handleError(_0x4f05ec,null));};exports[_0x5f37('0x137')]=function(_0x539c37,_0x2e4fee,_0x4c3415){return db[_0x5f37('0x58')]['find']({'where':{'id':_0x539c37[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0x2e4fee,null))[_0x5f37('0x24')](function(_0x24b104){if(_0x24b104){return _0x24b104['addAgents'](_0x539c37[_0x5f37('0x62')]['ids'],_[_0x5f37('0x12d')](_0x539c37[_0x5f37('0x62')],[_0x5f37('0x72'),'id'])||{})[_0x5f37('0xc1')](function(_0x3e6d6e){for(var _0x283986=0x0;_0x283986<_0x539c37['body']['ids']['length'];_0x283986+=0x1){socket[_0x5f37('0x138')](_0x5f37('0x139'),{'UserId':Number(_0x539c37[_0x5f37('0x62')][_0x5f37('0x72')][_0x283986]),'ChatWebsiteId':Number(_0x539c37[_0x5f37('0x5d')]['id'])});}return _0x3e6d6e;});}})[_0x5f37('0x24')](respondWithResult(_0x2e4fee,null))[_0x5f37('0x2e')](handleError(_0x2e4fee,null));};exports[_0x5f37('0x13a')]=function(_0x40bfba,_0x20e476,_0x24ae44){return db[_0x5f37('0x58')]['find']({'where':{'id':_0x40bfba[_0x5f37('0x5d')]['id']}})['then'](handleEntityNotFound(_0x20e476,null))[_0x5f37('0x24')](function(_0x51e2a7){if(_0x51e2a7){return _0x51e2a7[_0x5f37('0x13a')](_0x40bfba[_0x5f37('0x4b')]['ids'])[_0x5f37('0x24')](function(){if(_[_0x5f37('0x13b')](_0x40bfba[_0x5f37('0x4b')][_0x5f37('0x72')])){for(var _0x2ee4cd=0x0;_0x2ee4cd<_0x40bfba[_0x5f37('0x4b')][_0x5f37('0x72')]['length'];_0x2ee4cd+=0x1){socket[_0x5f37('0x138')](_0x5f37('0x13c'),{'UserId':Number(_0x40bfba[_0x5f37('0x4b')][_0x5f37('0x72')][_0x2ee4cd]),'ChatWebsiteId':Number(_0x40bfba[_0x5f37('0x5d')]['id'])});}}else{socket[_0x5f37('0x138')](_0x5f37('0x13c'),{'UserId':Number(_0x40bfba[_0x5f37('0x4b')][_0x5f37('0x72')]),'ChatWebsiteId':Number(_0x40bfba[_0x5f37('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x20e476,null))[_0x5f37('0x2e')](handleError(_0x20e476,null));};exports['getAgents']=function(_0x780857,_0xff1f36,_0x48bf26){var _0x77b1e0={};var _0x13689b={};var _0x1cb899;var _0xb3684f;return db[_0x5f37('0x58')][_0x5f37('0x6c')]({'where':{'id':_0x780857[_0x5f37('0x5d')]['id']}})[_0x5f37('0x24')](handleEntityNotFound(_0xff1f36,null))['then'](function(_0x28c58e){if(_0x28c58e){_0x1cb899=_0x28c58e;_0x13689b['model']=_[_0x5f37('0x5f')](db[_0x5f37('0xca')][_0x5f37('0x5e')]);_0x13689b[_0x5f37('0x4b')]=_[_0x5f37('0x5f')](_0x780857['query']);_0x13689b[_0x5f37('0x48')]=_['intersection'](_0x13689b[_0x5f37('0x4a')],_0x13689b[_0x5f37('0x4b')]);_0x77b1e0['attributes']=_['intersection'](_0x13689b['model'],qs[_0x5f37('0x4d')](_0x780857['query'][_0x5f37('0x4d')]));_0x77b1e0[_0x5f37('0x4c')]=_0x77b1e0[_0x5f37('0x4c')][_0x5f37('0x4e')]?_0x77b1e0[_0x5f37('0x4c')]:_0x13689b[_0x5f37('0x4a')];_0x77b1e0[_0x5f37('0x50')]=qs[_0x5f37('0x51')](_0x780857[_0x5f37('0x4b')][_0x5f37('0x51')]);_0x77b1e0[_0x5f37('0x52')]=qs['filters'](_['pick'](_0x780857[_0x5f37('0x4b')],_0x13689b[_0x5f37('0x48')]));if(_0x780857['query'][_0x5f37('0x54')]){_0x77b1e0['where']=_['merge'](_0x77b1e0[_0x5f37('0x52')],{'$or':_[_0x5f37('0x46')](_0x77b1e0[_0x5f37('0x4c')],function(_0xf3724b){var _0x4e0ed6={};_0x4e0ed6[_0xf3724b]={'$like':'%'+_0x780857[_0x5f37('0x4b')][_0x5f37('0x54')]+'%'};return _0x4e0ed6;})});}_0x77b1e0=_[_0x5f37('0x55')]({},_0x77b1e0,_0x780857[_0x5f37('0x57')]);return _0x1cb899[_0x5f37('0x13d')](_0x77b1e0);}})[_0x5f37('0x24')](function(_0x1d8b83){if(_0x1d8b83){_0xb3684f=_0x1d8b83['length'];if(!_0x780857['query'][_0x5f37('0x4f')](_0x5f37('0x6e'))){_0x77b1e0[_0x5f37('0x34')]=qs[_0x5f37('0x34')](_0x780857['query'][_0x5f37('0x34')]);_0x77b1e0['offset']=qs[_0x5f37('0x32')](_0x780857[_0x5f37('0x4b')][_0x5f37('0x32')]);}return _0x1cb899[_0x5f37('0x13d')](_0x77b1e0);}})['then'](function(_0x5587ed){if(_0x5587ed){return _0x5587ed?{'count':_0xb3684f,'rows':_0x5587ed}:null;}})[_0x5f37('0x24')](respondWithResult(_0xff1f36,null))[_0x5f37('0x2e')](handleError(_0xff1f36,null));}; \ No newline at end of file +var _0xaa04=['device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','messageId','created','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','basename','sequelize','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','Intervals','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','ChatApplication','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','show','includeAll','merge','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s'];(function(_0x1393cc,_0x3d0294){var _0x4fd93f=function(_0xe8c979){while(--_0xe8c979){_0x1393cc['push'](_0x1393cc['shift']());}};_0x4fd93f(++_0x3d0294);}(_0xaa04,0x81));var _0x4aa0=function(_0x3fbce4,_0xbef8bb){_0x3fbce4=_0x3fbce4-0x0;var _0x9ba40f=_0xaa04[_0x3fbce4];return _0x9ba40f;};'use strict';var emlformat=require(_0x4aa0('0x0'));var rimraf=require(_0x4aa0('0x1'));var zipdir=require(_0x4aa0('0x2'));var jsonpatch=require(_0x4aa0('0x3'));var rp=require(_0x4aa0('0x4'));var moment=require(_0x4aa0('0x5'));var BPromise=require(_0x4aa0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4aa0('0x7'));var sox=require('sox');var csv=require(_0x4aa0('0x8'));var ejs=require(_0x4aa0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4aa0('0xa'));var crypto=require(_0x4aa0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4aa0('0xc'));var toCsv=require(_0x4aa0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4aa0('0xd'));var qs=require(_0x4aa0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aa0('0xf'));var logger=require('../../config/logger')(_0x4aa0('0x10'));var utils=require(_0x4aa0('0x11'));var config=require(_0x4aa0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4aa0('0x13'))['db'];config[_0x4aa0('0x14')]=_[_0x4aa0('0x15')](config[_0x4aa0('0x14')],{'host':_0x4aa0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4aa0('0x17'))[_0x4aa0('0x18')](socket);var jayson=require(_0x4aa0('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232a});var client9003=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232b});var client9001=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x3633e1,_0x37f871,_0x374437,_0x1bb649){return new BPromise(function(_0x44eba1,_0xe2494){var _0x53927a=_0x1bb649||client;return _0x53927a[_0x4aa0('0x1c')](_0x3633e1,_0x374437)[_0x4aa0('0x1d')](function(_0x59888b){logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));logger[_0x4aa0('0x21')](_0x4aa0('0x22'),_0x37f871,_0x4aa0('0x20'),JSON[_0x4aa0('0x23')](_0x59888b));if(_0x59888b[_0x4aa0('0x24')]){if(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x25')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0xe2494(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0x44eba1(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}else{logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));_0x44eba1(_0x59888b[_0x4aa0('0x27')][_0x4aa0('0x26')]);}})[_0x4aa0('0x28')](function(_0x281973){logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x281973);_0xe2494(_0x281973);});});}function respondWithStatusCode(_0x3b1289,_0x26498b){_0x26498b=_0x26498b||0xcc;return function(_0x1ca7f4){if(_0x1ca7f4){return _0x3b1289[_0x4aa0('0x29')](_0x26498b);}return _0x3b1289[_0x4aa0('0x2a')](_0x26498b)[_0x4aa0('0x2b')]();};}function respondWithResult(_0x19e11d,_0x4844cd){_0x4844cd=_0x4844cd||0xc8;return function(_0x3b59a8){if(_0x3b59a8){return _0x19e11d[_0x4aa0('0x2a')](_0x4844cd)['json'](_0x3b59a8);}};}function respondWithFilteredResult(_0x7eece4,_0x33fcd3){return function(_0x164f2c){if(_0x164f2c){var _0x422acc=typeof _0x33fcd3[_0x4aa0('0x2c')]==='undefined'&&typeof _0x33fcd3[_0x4aa0('0x2d')]===_0x4aa0('0x2e');var _0x81c22b=_0x164f2c['count'];var _0x2fee9b=_0x422acc?0x0:_0x33fcd3[_0x4aa0('0x2c')];var _0x2761de=_0x422acc?_0x164f2c[_0x4aa0('0x2f')]:_0x33fcd3[_0x4aa0('0x2c')]+_0x33fcd3[_0x4aa0('0x2d')];var _0x416608;if(_0x2761de>=_0x81c22b){_0x2761de=_0x81c22b;_0x416608=0xc8;}else{_0x416608=0xce;}_0x7eece4[_0x4aa0('0x2a')](_0x416608);return _0x7eece4[_0x4aa0('0x30')](_0x4aa0('0x31'),_0x2fee9b+'-'+_0x2761de+'/'+_0x81c22b)[_0x4aa0('0x32')](_0x164f2c);}return null;};}function patchUpdates(_0x248c09){return function(_0x1b6ce6){try{jsonpatch[_0x4aa0('0x33')](_0x1b6ce6,_0x248c09,!![]);}catch(_0x41b566){return BPromise[_0x4aa0('0x34')](_0x41b566);}return _0x1b6ce6[_0x4aa0('0x35')]();};}function saveUpdates(_0x3e2b45,_0x25dd80){return function(_0x140b6d){if(_0x140b6d){return _0x140b6d[_0x4aa0('0x36')](_0x3e2b45)['then'](function(_0xd871ff){return _0xd871ff;});}return null;};}function removeEntity(_0x1123de,_0x5177e5){return function(_0x1bcc3d){if(_0x1bcc3d){return _0x1bcc3d[_0x4aa0('0x37')]()[_0x4aa0('0x1d')](function(){var _0x210196=_0x1bcc3d[_0x4aa0('0x38')]({'plain':!![]});var _0x1f96a8='ChatWebsites';return db[_0x4aa0('0x39')][_0x4aa0('0x37')]({'where':{'type':_0x1f96a8,'resourceId':_0x210196['id']}})[_0x4aa0('0x1d')](function(){return _0x1bcc3d;});})['then'](function(){_0x1123de['status'](0xcc)[_0x4aa0('0x2b')]();});}};}function handleEntityNotFound(_0x4e738d,_0x3ffb21){return function(_0x48113e){if(!_0x48113e){_0x4e738d['sendStatus'](0x194);}return _0x48113e;};}function handleError(_0x2b095e,_0x1d342d){_0x1d342d=_0x1d342d||0x1f4;return function(_0x219762){logger[_0x4aa0('0x24')](_0x219762[_0x4aa0('0x3a')]);if(_0x219762[_0x4aa0('0x3b')]){delete _0x219762[_0x4aa0('0x3b')];}_0x2b095e[_0x4aa0('0x2a')](_0x1d342d)[_0x4aa0('0x3c')](_0x219762);};}exports[_0x4aa0('0x3d')]=function(_0x5cc43e,_0x566105){var _0x35bdb6={'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x3acfc9={},_0x375a09={'count':0x0,'rows':[]};var _0x2708f8=_['map'](db[_0x4aa0('0x40')][_0x4aa0('0x41')],function(_0x1886c6){return{'name':_0x1886c6[_0x4aa0('0x42')],'type':_0x1886c6[_0x4aa0('0x43')][_0x4aa0('0x44')]};});_0x3acfc9[_0x4aa0('0x45')]=_[_0x4aa0('0x46')](_0x2708f8,_0x4aa0('0x3b'));_0x3acfc9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x5cc43e[_0x4aa0('0x47')]);_0x3acfc9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],_0x3acfc9[_0x4aa0('0x47')]);_0x35bdb6[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x35bdb6[_0x4aa0('0x4b')]=_0x35bdb6[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x35bdb6['attributes']:_0x3acfc9[_0x4aa0('0x45')];if(!_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x35bdb6['limit']=qs['limit'](_0x5cc43e[_0x4aa0('0x47')]['limit']);_0x35bdb6[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x35bdb6[_0x4aa0('0x50')]=qs['sort'](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x35bdb6[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x5cc43e[_0x4aa0('0x47')],_0x3acfc9[_0x4aa0('0x49')]),_0x2708f8);if(_0x5cc43e['query'][_0x4aa0('0x54')]){_0x35bdb6[_0x4aa0('0x52')]=_['merge'](_0x35bdb6['where'],{'$or':_[_0x4aa0('0x46')](_0x2708f8,function(_0x51c71c){if(_0x51c71c[_0x4aa0('0x43')]!==_0x4aa0('0x55')){var _0x3e5d79={};_0x3e5d79[_0x51c71c[_0x4aa0('0x3b')]]={'$like':'%'+_0x5cc43e['query']['filter']+'%'};return _0x3e5d79;}})});}_0x35bdb6=_['merge']({},_0x35bdb6,_0x5cc43e[_0x4aa0('0x56')]);var _0x30ee67={'where':_0x35bdb6[_0x4aa0('0x52')]};return db['ChatWebsite']['count'](_0x30ee67)[_0x4aa0('0x1d')](function(_0x1fc47f){_0x375a09[_0x4aa0('0x2f')]=_0x1fc47f;if(_0x5cc43e['query']['includeAll']){_0x35bdb6[_0x4aa0('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x35bdb6);})['then'](function(_0x7be635){_0x375a09[_0x4aa0('0x58')]=_0x7be635;return _0x375a09;})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x566105,_0x35bdb6))['catch'](handleError(_0x566105,null));};exports[_0x4aa0('0x59')]=function(_0x144af8,_0x752c52){var _0x79d32c={'raw':![],'where':{'id':_0x144af8['params']['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x441cca={};_0x441cca[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x40')][_0x4aa0('0x41')]);_0x441cca[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x144af8[_0x4aa0('0x47')]);_0x441cca['filters']=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],_0x441cca['query']);_0x79d32c[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x79d32c[_0x4aa0('0x4b')]=_0x79d32c[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x79d32c[_0x4aa0('0x4b')]:_0x441cca['model'];if(_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x79d32c[_0x4aa0('0x57')]=[{'all':!![]}];}_0x79d32c=_[_0x4aa0('0x5b')]({},_0x79d32c,_0x144af8[_0x4aa0('0x56')]);return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x79d32c)[_0x4aa0('0x1d')](handleEntityNotFound(_0x752c52,null))[_0x4aa0('0x1d')](respondWithResult(_0x752c52,null))[_0x4aa0('0x28')](handleError(_0x752c52,null));};exports[_0x4aa0('0x5d')]=function(_0x6557e4,_0x884673){return db[_0x4aa0('0x40')][_0x4aa0('0x5d')](_0x6557e4[_0x4aa0('0x5e')],{})[_0x4aa0('0x1d')](function(_0x4dd5cd){var _0x82c3ee=_0x6557e4[_0x4aa0('0x5f')][_0x4aa0('0x38')]({'plain':!![]});if(!_0x82c3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x82c3ee[_0x4aa0('0x60')]==='user'){var _0x1c4620=_0x4dd5cd[_0x4aa0('0x38')]({'plain':!![]});var _0x312025=_0x4aa0('0x61');return db[_0x4aa0('0x62')]['find']({'where':{'name':_0x312025,'userProfileId':_0x82c3ee[_0x4aa0('0x63')]},'raw':!![]})[_0x4aa0('0x1d')](function(_0x4cb7fc){if(_0x4cb7fc&&_0x4cb7fc[_0x4aa0('0x64')]===0x0){return db[_0x4aa0('0x39')]['create']({'name':_0x1c4620['name'],'resourceId':_0x1c4620['id'],'type':_0x4cb7fc[_0x4aa0('0x3b')],'sectionId':_0x4cb7fc['id']},{})[_0x4aa0('0x1d')](function(){return _0x4dd5cd;});}else{return _0x4dd5cd;}})[_0x4aa0('0x28')](function(_0x57cb73){logger[_0x4aa0('0x24')](_0x4aa0('0x65'),_0x57cb73);throw _0x57cb73;});}return _0x4dd5cd;})[_0x4aa0('0x1d')](respondWithResult(_0x884673,0xc9))[_0x4aa0('0x28')](handleError(_0x884673,null));};exports[_0x4aa0('0x36')]=function(_0x5aede6,_0x4dce37){if(_0x5aede6[_0x4aa0('0x5e')]['id']){delete _0x5aede6[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5aede6[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4dce37,null))[_0x4aa0('0x1d')](saveUpdates(_0x5aede6['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4dce37,null))['catch'](handleError(_0x4dce37,null));};exports[_0x4aa0('0x37')]=function(_0x4aa441,_0x557be1){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4aa441['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x557be1,null))[_0x4aa0('0x1d')](removeEntity(_0x557be1,null))[_0x4aa0('0x28')](handleError(_0x557be1,null));};exports[_0x4aa0('0x67')]=function(_0x3c2b3f,_0x313bb3){return db[_0x4aa0('0x40')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](respondWithResult(_0x313bb3,null))[_0x4aa0('0x28')](handleError(_0x313bb3,null));};exports[_0x4aa0('0x68')]=function(_0x5039bd,_0x376d3c,_0xd9b30){if(_0x5039bd[_0x4aa0('0x5e')]['id']){delete _0x5039bd['body']['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5039bd['params']['id']}})['then'](handleEntityNotFound(_0x376d3c,null))['then'](function(_0x4a73c5){if(_0x4a73c5){_0x5039bd['body'][_0x4aa0('0x69')]=_0x4a73c5['id'];return db[_0x4aa0('0x6a')]['create'](_0x5039bd[_0x4aa0('0x5e')]);}})['then'](respondWithResult(_0x376d3c,null))[_0x4aa0('0x28')](handleError(_0x376d3c,null));};exports[_0x4aa0('0x6b')]=function(_0x32b25a,_0x123964,_0xe44d4c){var _0x1b5386={'raw':![],'where':{}};var _0x1ac92c={};var _0x51b86b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x32b25a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x123964,null))[_0x4aa0('0x1d')](function(_0x1758c4){if(_0x1758c4){_0x1ac92c[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x6a')][_0x4aa0('0x41')]);_0x1ac92c['query']=_[_0x4aa0('0x48')](_0x32b25a['query']);_0x1ac92c[_0x4aa0('0x49')]=_['intersection'](_0x1ac92c[_0x4aa0('0x45')],_0x1ac92c['query']);_0x1b5386[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x1ac92c[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x32b25a[_0x4aa0('0x47')]['fields']));_0x1b5386['attributes']=_0x1b5386[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x1b5386[_0x4aa0('0x4b')]:_0x1ac92c[_0x4aa0('0x45')];if(!_0x32b25a[_0x4aa0('0x47')]['hasOwnProperty']('nolimit')){_0x1b5386[_0x4aa0('0x2d')]=qs['limit'](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x1b5386[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x1b5386[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x1b5386[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x32b25a[_0x4aa0('0x47')],_0x1ac92c[_0x4aa0('0x49')]));_0x1b5386[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x1758c4['id'];if(_0x32b25a[_0x4aa0('0x47')]['filter']){_0x1b5386['where']=_[_0x4aa0('0x5b')](_0x1b5386[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x1b5386[_0x4aa0('0x4b')],function(_0x255a9c){var _0x6f6122={};_0x6f6122[_0x255a9c]={'$like':'%'+_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x6f6122;})});}_0x1b5386=_[_0x4aa0('0x5b')]({},_0x1b5386,_0x32b25a[_0x4aa0('0x56')]);return db[_0x4aa0('0x6a')]['count']({'where':_0x1b5386[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x9f9297){_0x51b86b[_0x4aa0('0x2f')]=_0x9f9297;if(_0x32b25a['query'][_0x4aa0('0x5a')]){_0x1b5386[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x6a')][_0x4aa0('0x6c')](_0x1b5386);})[_0x4aa0('0x1d')](function(_0x17ed78){_0x51b86b[_0x4aa0('0x58')]=_0x17ed78;return _0x51b86b;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x123964,_0x1b5386))['catch'](handleError(_0x123964,null));};exports[_0x4aa0('0x6d')]=function(_0x6f864,_0x1d0038,_0x5754ba){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x6f864['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1d0038,null))[_0x4aa0('0x1d')](function(_0x2eaba5){if(_0x2eaba5){return _0x2eaba5['removeDispositions'](_0x6f864[_0x4aa0('0x47')][_0x4aa0('0x6e')]);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0x1d0038,null))['catch'](handleError(_0x1d0038,null));};exports[_0x4aa0('0x6f')]=function(_0x3d60ff,_0x54d4c7,_0x3c4d74){if(_0x3d60ff[_0x4aa0('0x5e')]['id']){delete _0x3d60ff[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3d60ff[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x54d4c7,null))['then'](function(_0x5fb62d){if(_0x5fb62d){_0x3d60ff[_0x4aa0('0x5e')][_0x4aa0('0x69')]=_0x5fb62d['id'];return db[_0x4aa0('0x70')][_0x4aa0('0x5d')](_0x3d60ff['body']);}})[_0x4aa0('0x1d')](respondWithResult(_0x54d4c7,null))['catch'](handleError(_0x54d4c7,null));};exports['getAnswers']=function(_0x209d98,_0x12b55c,_0x29941b){var _0x521540={'raw':![],'where':{}};var _0xcff7d9={};var _0x4a1b3b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x209d98['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x12b55c,null))[_0x4aa0('0x1d')](function(_0x2c516b){if(_0x2c516b){_0xcff7d9[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['CannedAnswer'][_0x4aa0('0x41')]);_0xcff7d9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x209d98['query']);_0xcff7d9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0xcff7d9['model'],_0xcff7d9[_0x4aa0('0x47')]);_0x521540['attributes']=_[_0x4aa0('0x4a')](_0xcff7d9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x521540[_0x4aa0('0x4b')]=_0x521540[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x521540[_0x4aa0('0x4b')]:_0xcff7d9[_0x4aa0('0x45')];if(!_0x209d98['query'][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x521540[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x521540[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x521540[_0x4aa0('0x50')]=qs['sort'](_0x209d98['query'][_0x4aa0('0x51')]);_0x521540[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x209d98['query'],_0xcff7d9['filters']));_0x521540[_0x4aa0('0x52')]['ChatWebsiteId']=_0x2c516b['id'];if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x521540[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x521540[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x521540[_0x4aa0('0x4b')],function(_0x5a614b){var _0x542e90={};_0x542e90[_0x5a614b]={'$like':'%'+_0x209d98['query'][_0x4aa0('0x54')]+'%'};return _0x542e90;})});}_0x521540=_[_0x4aa0('0x5b')]({},_0x521540,_0x209d98['options']);return db[_0x4aa0('0x70')][_0x4aa0('0x2f')]({'where':_0x521540[_0x4aa0('0x52')]})['then'](function(_0x13569b){_0x4a1b3b[_0x4aa0('0x2f')]=_0x13569b;if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x521540[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x70')][_0x4aa0('0x6c')](_0x521540);})[_0x4aa0('0x1d')](function(_0x58cf70){_0x4a1b3b[_0x4aa0('0x58')]=_0x58cf70;return _0x4a1b3b;});}})['then'](respondWithFilteredResult(_0x12b55c,_0x521540))[_0x4aa0('0x28')](handleError(_0x12b55c,null));};exports['removeAnswers']=function(_0x5b8345,_0xe07622,_0xaac065){return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5b8345[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0xe07622,null))[_0x4aa0('0x1d')](function(_0x300b8b){if(_0x300b8b){return _0x300b8b[_0x4aa0('0x72')](_0x5b8345[_0x4aa0('0x47')]['ids']);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0xe07622,null))['catch'](handleError(_0xe07622,null));};exports[_0x4aa0('0x73')]=function(_0xa2f2c,_0x587440,_0x40093a){_0xa2f2c[_0x4aa0('0x5e')][_0x4aa0('0x74')]=_0xa2f2c[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0xa2f2c[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x587440,null))[_0x4aa0('0x1d')](saveUpdates(_0xa2f2c['body'],null))['then'](respondWithResult(_0x587440,null))[_0x4aa0('0x28')](handleError(_0x587440,null));};exports[_0x4aa0('0x77')]=function(_0x5bbedd,_0x4df569,_0x48f041){_0x5bbedd[_0x4aa0('0x5e')]['agentAvatar']=_0x5bbedd[_0x4aa0('0x75')]['filename'];return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x5bbedd['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4df569,null))['then'](saveUpdates(_0x5bbedd['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4df569,null))[_0x4aa0('0x28')](handleError(_0x4df569,null));};exports[_0x4aa0('0x78')]=function(_0x5665ca,_0x26e058,_0x2915b0){_0x5665ca['body'][_0x4aa0('0x79')]=_0x5665ca[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5665ca['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x26e058,null))[_0x4aa0('0x1d')](saveUpdates(_0x5665ca[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x26e058,null))[_0x4aa0('0x28')](handleError(_0x26e058,null));};exports[_0x4aa0('0x7a')]=function(_0x5d83a4,_0x1885c7,_0xc9c45c){_0x5d83a4['body']['systemAvatar']=_0x5d83a4[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5d83a4[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x1885c7,null))[_0x4aa0('0x1d')](saveUpdates(_0x5d83a4[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x1885c7,null))[_0x4aa0('0x28')](handleError(_0x1885c7,null));};exports[_0x4aa0('0x7b')]=function(_0x5b2798,_0x12adc9,_0x4a9ecb){var _0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x7d'));var _0x35027b={'where':{'id':_0x5b2798[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x74')],'raw':!![]};var _0x4496d2=![];return require(_0x4aa0('0x7e'))['getLicense']()[_0x4aa0('0x1d')](function(_0x5e38a1){if(_0x5e38a1){_0x4496d2=_0x5e38a1['custom'];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x35027b);})['then'](handleEntityNotFound(_0x12adc9,null))[_0x4aa0('0x1d')](function(_0x349701){if(_0x349701){if(!_[_0x4aa0('0x7f')](_0x349701[_0x4aa0('0x74')])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]))&&_0x4496d2){_0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]);}}return _0x12adc9[_0x4aa0('0x83')](_0x2e9dc7);}})[_0x4aa0('0x28')](handleError(_0x12adc9,null));};exports[_0x4aa0('0x84')]=function(_0x1d990c,_0x11cac3,_0x1d49db){var _0x5ed8f8=path['join'](config['root'],_0x4aa0('0x85'));var _0x3bb803={'where':{'id':_0x1d990c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x86')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x3bb803)[_0x4aa0('0x1d')](handleEntityNotFound(_0x11cac3,null))['then'](function(_0x8a1b8){if(_0x8a1b8){if(!_[_0x4aa0('0x7f')](_0x8a1b8['agentAvatar'])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]))){_0x5ed8f8=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]);}}return _0x11cac3['download'](_0x5ed8f8);}})[_0x4aa0('0x28')](handleError(_0x11cac3,null));};exports[_0x4aa0('0x88')]=function(_0x6fd01c,_0x395b39,_0x24f88d){var _0x540786=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x89'));var _0x57a379={'where':{'id':_0x6fd01c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x79'),_0x4aa0('0x8a')],'raw':!![]};return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x57a379)['then'](handleEntityNotFound(_0x395b39,null))[_0x4aa0('0x1d')](function(_0x11149b){if(_0x11149b){if(!_[_0x4aa0('0x7f')](_0x11149b[_0x4aa0('0x79')])){if(fs['existsSync'](path['join'](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x11149b[_0x4aa0('0x79')]))&&_0x11149b[_0x4aa0('0x8a')]){_0x540786=path['join'](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x11149b[_0x4aa0('0x79')]);}}return _0x395b39[_0x4aa0('0x83')](_0x540786);}})[_0x4aa0('0x28')](handleError(_0x395b39,null));};exports[_0x4aa0('0x8b')]=function(_0x592a04,_0x420d46,_0x2e4efa){var _0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x8c'));var _0x4472b1={'where':{'id':_0x592a04[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x8d')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x4472b1)[_0x4aa0('0x1d')](handleEntityNotFound(_0x420d46,null))[_0x4aa0('0x1d')](function(_0x5702b9){if(_0x5702b9){if(!_[_0x4aa0('0x7f')](_0x5702b9[_0x4aa0('0x8d')])){if(fs[_0x4aa0('0x80')](path['join'](config['root'],'server/files/images/avatars/',_0x5702b9[_0x4aa0('0x8d')]))){_0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x5702b9['systemAvatar']);}}return _0x420d46[_0x4aa0('0x83')](_0x14b485);}})[_0x4aa0('0x28')](handleError(_0x420d46,null));};exports['notify']=function(_0x3c0573,_0x488336,_0x290a1e){var _0x45709c=require(_0x4aa0('0x8e'));var _0x87eb9d=new _0x45709c();var _0x5235cb=_0x87eb9d[_0x4aa0('0x8f')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0x91')])['getResult']();var _0x19474a={'body':_0x3c0573['body'],'channel':_0x4aa0('0x92')};var _0x582ead=[];var _0x28623c=[];var _0xce6cbe={};var _0x907b4c=![];return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x4010b8){if(!_0x4010b8){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x96'));}_0x582ead=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x4010b8),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x28623c=_['difference'](_[_0x4aa0('0x48')](_0x4010b8),['createdAt','updatedAt','CompanyId','ListId']);if(_0x3c0573[_0x4aa0('0x5e')]['id']){delete _0x3c0573[_0x4aa0('0x5e')]['id'];}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')])){throw new db['Sequelize'][(_0x4aa0('0x95'))](_0x4aa0('0x9b'));}if(_[_0x4aa0('0x7f')](_0x3c0573[_0x4aa0('0x5e')]['body'])||_0x3c0573[_0x4aa0('0x5e')]['body']===''){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c'));}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))]['ValidationError'](_0x4aa0('0x9e')+_0x28623c);}if(!_['includes'](_0x28623c,_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9f')+_0x28623c);}_0xce6cbe[_0x3c0573[_0x4aa0('0x5e')]['mapKey']]=_0x3c0573['body']['from'];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3c0573[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0xa0')],'as':_0x4aa0('0xa1'),'include':[{'model':db['CmContact'],'as':_0x4aa0('0xa2'),'where':_0xce6cbe,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x4aa0('0xa3')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x40a20f){if(_0x40a20f&&_0x40a20f[_0x4aa0('0xa1')]){_0x19474a[_0x4aa0('0xa4')]=_0x40a20f;_0x19474a[_0x4aa0('0xa5')]=_0x40a20f[_0x4aa0('0xa3')];_0x19474a[_0x4aa0('0xa6')]=_0x40a20f['List'];_0x19474a['applications']=_[_0x4aa0('0xa7')](_0x19474a[_0x4aa0('0xa5')],['priority'],['asc']);if(_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')]){delete _0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')];}if(_0x19474a[_0x4aa0('0xa4')]['List']&&_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa1')][_0x4aa0('0xa2')][_0x4aa0('0x4d')]){return _0x19474a[_0x4aa0('0xa4')]['List'][_0x4aa0('0xa2')][0x0];}var _0x15dcdf=_['defaults'](_0x3c0573[_0x4aa0('0x5e')],{'firstName':_0x3c0573[_0x4aa0('0x5e')]['from'],'ListId':_0x40a20f['ListId']});_0x15dcdf[_0x3c0573['body']['mapKey']]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db['CmContact'][_0x4aa0('0x5d')](_0x15dcdf,{'fields':_0x582ead,'raw':!![]});}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x2d2242){_0x19474a[_0x4aa0('0xa8')]=_0x2d2242;var _0x21f76e=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xa9')];if(_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')]){_0x21f76e=_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')];}else if(_0x3c0573[_0x4aa0('0x90')]['x-forwarded-for']){_0x21f76e=_[_0x4aa0('0xab')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xac')][_0x4aa0('0xad')](','));}if(_0x2d2242){var _0x22f3d2={'ContactId':_0x2d2242['id'],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'from':(_0x2d2242[_0x4aa0('0xae')]||'')+'\x20'+(_0x2d2242[_0x4aa0('0xaf')]||''),'customerIp':_0x21f76e,'customerPort':_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]?_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]:null,'referer':_0x3c0573[_0x4aa0('0x5e')]['referer'],'browserName':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0x3b')]&&_0x5235cb[_0x4aa0('0xb1')]['version']?util['format']('%s\x20%s',_0x5235cb[_0x4aa0('0xb1')]['name'],_0x5235cb[_0x4aa0('0xb1')]['version']):'unknown','browserVersion':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0xb2')]||_0x4aa0('0xb3'),'osName':util[_0x4aa0('0xb4')](_0x4aa0('0xb5'),_0x5235cb['os'][_0x4aa0('0x3b')],_0x5235cb['os'][_0x4aa0('0xb2')]),'osVersion':_0x5235cb['os'][_0x4aa0('0xb2')],'deviceModel':_0x5235cb['device'][_0x4aa0('0x45')]&&_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')]?util[_0x4aa0('0xb4')](_0x4aa0('0xb8'),_0x5235cb['device'][_0x4aa0('0x45')],_0x5235cb['device'][_0x4aa0('0xb7')],_0x5235cb['device']['type']):null,'deviceVendor':_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')],'deviceType':_0x5235cb[_0x4aa0('0xb6')]['type'],'formData':JSON[_0x4aa0('0x23')](_0x3c0573[_0x4aa0('0x5e')])};var _0x5ab0d2={'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'closed':![]};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]){_0x5ab0d2[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':_0x5ab0d2})[_0x4aa0('0x1d')](function(_0x1ca1ea){if(_0x1ca1ea){return[_0x1ca1ea,![]];}_0x22f3d2['threadId']=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];_0x22f3d2[_0x4aa0('0xbb')]=_0x3c0573[_0x4aa0('0x5e')]['externalUrl'];return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x211908){return[_0x211908,!![]];});});}_0x5ab0d2['ContactId']=_0x2d2242['id'];if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]['id']){_0x5ab0d2['id']=_0x3c0573['body']['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x5ab0d2})['then'](function(_0x3ab77e){if(_0x3ab77e){return[_0x3ab77e,![]];}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x3f4008){return[_0x3f4008,!![]];});});}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)['then'](function(_0x57bf89){return[_0x57bf89,!![]];});}})['spread'](function(_0xef2882,_0x4083ff){if(_0xef2882){_0x907b4c=_0x4083ff;if(!_0x4083ff){var _0x191a45={'from':(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xae')]||'')+'\x20'+(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xaf')]||'')};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]&&_0x3c0573['body']['threadId']!=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]){_0x191a45[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')];}return _0xef2882[_0x4aa0('0x36')](_0x191a45);}else{return _0xef2882;}}})[_0x4aa0('0x1d')](function(_0x37f876){_0x19474a['interaction']=_0x37f876[_0x4aa0('0x38')]({'plain':!![]});_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xbe')]=_0x907b4c;if(_0x19474a['interaction'][_0x4aa0('0xbe')]){if(_0x19474a[_0x4aa0('0xa4')]['autoclose']){_0x19474a[_0x4aa0('0xa5')]['push']({'id':0x0,'priority':_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0x4d')]+0x1,'app':'close','appdata':_0x4aa0('0xbf'),'interval':_0x4aa0('0xc0')});}}return db[_0x4aa0('0xc1')][_0x4aa0('0x5d')]({'body':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x5e')],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'ChatInteractionId':_0x37f876['id'],'direction':'in','ContactId':_0x19474a[_0x4aa0('0xa8')]['id'],'AttachmentId':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xc2')]});})[_0x4aa0('0x1d')](function(_0x5a2e0b){_0x19474a[_0x4aa0('0x26')]=_0x5a2e0b;if(_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]){return db['User'][_0x4aa0('0x5c')]({'attributes':['id',_0x4aa0('0x3b')],'where':{'id':_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]}})['then'](function(_0x27d7d8){if(_0x27d7d8){_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0xc4')]({'id':0x0,'priority':0x0,'app':_0x4aa0('0xc5'),'appdata':_0x27d7d8[_0x4aa0('0x3b')]+','+(_0x19474a['account'][_0x4aa0('0xc6')]||0xa),'interval':_0x4aa0('0xc0')});_0x19474a[_0x4aa0('0xc7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x19474a);});}return respondWithRpcPromise(_0x4aa0('0xc8'),_0x4aa0('0xc9'),_0x19474a);})['then'](function(_0x3a3546){respondWithRpcPromise(_0x4aa0('0xca'),'EventManager',{'event':_0x4aa0('0xcb'),'message':_0x3a3546},client9002);return _0x3a3546;})['then'](respondWithResult(_0x488336,null))[_0x4aa0('0x28')](handleError(_0x488336,null));};exports[_0x4aa0('0xcc')]=function(_0x4f69c3,_0x452a99,_0x5b8276){var _0xa84bcb,_0x47c316,_0x4ee32e;var _0x4db1ee=[];var _0x1e5b95=[];var _0x3baebe={};var _0x3b2138=_0x4f69c3[_0x4aa0('0xcd')]||[];var _0xa14da7=[];var _0xf705da;return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x1a32c0){if(!_0x1a32c0){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('no\x20available\x20attributes');}_0x1e5b95=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x4db1ee=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99'),'CompanyId','ListId']);if(_0x4f69c3['body']['id']){delete _0x4f69c3['body']['id'];}if(_['isNil'](_0x4f69c3['body'][_0x4aa0('0x9a')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9b')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')])||_0x4f69c3['body'][_0x4aa0('0x5e')]===''){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline'])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4db1ee));}if(!_[_0x4aa0('0xce')](_0x4db1ee,_0x4f69c3['body'][_0x4aa0('0xcf')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0xd0')+_0x4db1ee));}_0x3baebe[_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline']]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4f69c3[_0x4aa0('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0x4aa0('0xa1')},{'model':db[_0x4aa0('0xd1')],'as':_0x4aa0('0xd1')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x452a99,null))[_0x4aa0('0x1d')](function(_0x45bc7a){if(_0x45bc7a&&_0x45bc7a[_0x4aa0('0xa1')]){_0x47c316=_0x45bc7a;var _0x2c4985=_[_0x4aa0('0x15')](_0x4f69c3[_0x4aa0('0x5e')],{'firstName':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'phone':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'ListId':_0x45bc7a[_0x4aa0('0xd2')]});_0x2c4985[_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0xcf')]]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db[_0x4aa0('0x93')][_0x4aa0('0xd3')]({'where':_0x3baebe,'defaults':_0x2c4985});}})['spread'](function(_0xd89ee7){if(_0xd89ee7){_0x4ee32e=_0xd89ee7;var _0x32dbe5=fs[_0x4aa0('0xd4')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xd5')),'utf8');var _0x124d68=ejs[_0x4aa0('0xd6')](_0x32dbe5,{'body':_[_0x4aa0('0xd7')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')]),'bodyTitle':_0x47c316[_0x4aa0('0xd8')]});return db[_0x4aa0('0xd9')][_0x4aa0('0x5d')]({'body':_0x124d68,'ContactId':_0xd89ee7['id'],'ChatWebsiteId':_0x47c316['id']});}})['then'](function(_0x1cf361){_0xf705da=_0x1cf361;if(_0x3b2138['length']){var _0x1f45cc=_0x3b2138[_0x4aa0('0x46')](function(_0x4ed590){return{'name':_0x4ed590[_0x4aa0('0xda')],'basename':_0x4ed590[_0x4aa0('0x76')],'type':_0x4ed590[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0x1cf361['id']};});_0xa14da7=_0x1f45cc[_0x4aa0('0x46')](_0x2bc653=>{var _0x40f291={'filename':_0x2bc653[_0x4aa0('0x3b')],'path':path['join'](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),'files','attachments',_0x4aa0('0xdd'),_0x2bc653[_0x4aa0('0xde')])};return _0x40f291;});if(!_0x47c316['openNewInteraction']){return db[_0x4aa0('0xdf')]['transaction'](function(_0x17075c){return db['Attachment']['bulkCreate'](_0x1f45cc,{'transaction':_0x17075c});});}}})['then'](function(){if(_0xf705da){_0xa84bcb=_0xf705da;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x4aa0('0xe0')],'as':_0x4aa0('0xe1'),'raw':!![]}]});}})[_0x4aa0('0x1d')](function(_0xfd9b56){if(_0xfd9b56&&_0xfd9b56[_0x4aa0('0xe1')]&&_0x47c316[_0x4aa0('0xe2')]&&_0x47c316[_0x4aa0('0xe3')]){var _0x4e946c={'tls':{'rejectUnauthorized':![]}};if(_0xfd9b56['Smtp']['service']){_0x4e946c['service']=_0xfd9b56[_0x4aa0('0xe1')]['service'];}else{_0x4e946c[_0x4aa0('0xe4')]=_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0xe4')];_0x4e946c[_0x4aa0('0xe5')]=_0xfd9b56[_0x4aa0('0xe1')]['port'];_0x4e946c[_0x4aa0('0xe6')]=_0xfd9b56['Smtp'][_0x4aa0('0xe6')];}if(_0xfd9b56[_0x4aa0('0xe1')]['authentication']){_0x4e946c[_0x4aa0('0xe7')]={'user':_0xfd9b56['Smtp'][_0x4aa0('0x5f')],'pass':_0xfd9b56[_0x4aa0('0xe1')]['pass']};}return respondWithRpcPromise(_0x4aa0('0xe8'),_0x4aa0('0xe9'),{'account':_0x4e946c,'message':{'from':util['format'](_0x4aa0('0xea'),_0xfd9b56['name'],_0xfd9b56[_0x4aa0('0xeb')]||_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0x5f')]),'to':_0x47c316['forwardOfflineAddress'],'subject':_0x47c316['offlineMessageSubject'],'html':_0xa84bcb[_0x4aa0('0x5e')],'attachments':_0xa14da7}},client9003)[_0x4aa0('0x1d')](function(){return _0xa84bcb;})['catch'](function(_0x227ce1){console['error'](_0x227ce1);});}})[_0x4aa0('0x1d')](function(){if(_0x47c316&&_0x47c316[_0x4aa0('0xec')]&&_0x47c316[_0x4aa0('0xed')]){var _0x274538=[];if(_0x3b2138[_0x4aa0('0x4d')]){_0x274538=_0x3b2138['map'](function(_0x201256){return{'name':_0x201256[_0x4aa0('0xda')],'basename':_0x201256['filename'],'type':_0x201256[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0xf705da['id']};});}var _0x42d815;if(!_[_0x4aa0('0x7f')](_0x47c316['subjectOffline'])){var _0x47bd70=_[_0x4aa0('0x46')](_0x4f69c3[_0x4aa0('0x5e')],function(_0x467e6f){return _0x467e6f;});var _0x36c419=_['toPairsIn'](_0x47bd70)[0x0];var _0x4f5560=_[_0x4aa0('0xee')](_0x36c419,function(_0x2317bb){return _0x2317bb;});_0x42d815=_0x4f5560[0x1][_0x47c316[_0x4aa0('0xef')]];}var _0x3d9d6a={'from':_0x4ee32e['email'],'firstName':_0x4ee32e[_0x4aa0('0xae')],'lastName':_0x4ee32e[_0x4aa0('0xaf')],'mapKey':_0x4aa0('0xeb'),'message':{'from':_0x4ee32e[_0x4aa0('0xeb')],'to':_0x47c316[_0x4aa0('0xd1')]['email'],'cc':'','subject':_[_0x4aa0('0x7f')](_0x42d815)?_0x47c316[_0x4aa0('0xf0')]:_0x42d815,'messageId':'','sentAt':new Date(),'attach':_0x274538[_0x4aa0('0x4d')],'attachments':_0x274538,'originChannel':_0x4aa0('0xf1'),'ChatWebsiteId':_0x47c316['id'],'ChatOfflineMessageId':_0xa84bcb['id'],'originTo':_0x47c316[_0x4aa0('0xd1')][_0x4aa0('0xeb')]},'body':_0xa84bcb[_0x4aa0('0x5e')]};var _0x16ed1e={'account':{'id':_0x47c316[_0x4aa0('0xed')]},'body':_0x3d9d6a,'log':_0x4aa0('0xf2')};return respondWithRpcPromise('NotifyMailAccount',_0x4aa0('0xf3'),_0x16ed1e,client9001)['then'](function(){return _0xa84bcb;})['catch'](function(_0xb477f0){console['error'](_0xb477f0);});}return;})[_0x4aa0('0x1d')](function(){if(_0xa84bcb){return _0xa84bcb;}})['then'](respondWithResult(_0x452a99,null))['catch'](function(_0x4e3599){console[_0x4aa0('0x24')](_0x4aa0('0x28'),_0x4e3599);for(var _0x216083 of _0x3b2138){var _0x2b5e81=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),_0x4aa0('0xcd'),'attachments',_0x4aa0('0xdd'),_0x216083[_0x4aa0('0x76')]);fs_extra[_0x4aa0('0xf4')](_0x2b5e81)['catch'](function(_0x35d64d){console[_0x4aa0('0x24')](_0x4aa0('0xf5'),_0x2b5e81,_0x35d64d);});}});};exports[_0x4aa0('0xf6')]=function(_0x480814,_0x4cb595,_0x1b05be){return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':{'id':_0x480814[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb595,null))[_0x4aa0('0x1d')](function(_0x2aa96b){if(_0x2aa96b){return _0x2aa96b[_0x4aa0('0xf6')](_0x480814[_0x4aa0('0x5e')]['ids'],_[_0x4aa0('0xf7')](_0x480814[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x4cb595,null))[_0x4aa0('0x28')](handleError(_0x4cb595,null));};exports[_0x4aa0('0xf8')]=function(_0x27e6a1,_0x56f6de,_0x187b35){var _0x4152a1={'raw':![],'where':{}};var _0x25d4f6={};var _0x511468={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x27e6a1[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x56f6de,null))[_0x4aa0('0x1d')](function(_0x116379){if(_0x116379){_0x25d4f6[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0xba')]['rawAttributes']);_0x25d4f6[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x27e6a1[_0x4aa0('0x47')]);_0x25d4f6[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],_0x25d4f6[_0x4aa0('0x47')]);_0x4152a1['attributes']=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],qs['fields'](_0x27e6a1['query'][_0x4aa0('0x4c')]));_0x4152a1[_0x4aa0('0x4b')]=_0x4152a1[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x4152a1[_0x4aa0('0x4b')]:_0x25d4f6['model'];if(!_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x4152a1[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x27e6a1['query']['limit']);_0x4152a1['offset']=qs[_0x4aa0('0x2c')](_0x27e6a1[_0x4aa0('0x47')]['offset']);}_0x4152a1[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x27e6a1[_0x4aa0('0x47')]['sort']);_0x4152a1[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x27e6a1[_0x4aa0('0x47')],_0x25d4f6[_0x4aa0('0x49')]));_0x4152a1[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x116379['id'];if(_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4152a1['where']=_[_0x4aa0('0x5b')](_0x4152a1[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4152a1[_0x4aa0('0x4b')],function(_0x22005e){var _0x2c6a05={};_0x2c6a05[_0x22005e]={'$like':'%'+_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x2c6a05;})});}_0x4152a1=_[_0x4aa0('0x5b')]({},_0x4152a1,_0x27e6a1[_0x4aa0('0x56')]);return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':_0x4152a1[_0x4aa0('0x52')]})['then'](function(_0x1f67b5){_0x511468[_0x4aa0('0x2f')]=_0x1f67b5;if(_0x27e6a1[_0x4aa0('0x47')]['includeAll']){_0x4152a1['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db['User'],'as':_0x4aa0('0xfa'),'attributes':[_0x4aa0('0x3b'),_0x4aa0('0xfb'),'internal'],'required':![]},{'model':db[_0x4aa0('0xfc')],'as':_0x4aa0('0xfd'),'attributes':['id',_0x4aa0('0x3b'),_0x4aa0('0xfe')],'where':_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0xff')]?{'id':_0x27e6a1['query'][_0x4aa0('0xff')]}:undefined,'required':_0x27e6a1[_0x4aa0('0x47')]['tag']?!![]:![]}];}return db[_0x4aa0('0xba')][_0x4aa0('0x6c')](_0x4152a1);})[_0x4aa0('0x1d')](function(_0x56c5db){_0x511468[_0x4aa0('0x58')]=_0x56c5db;return _0x511468;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x56f6de,_0x4152a1))['catch'](handleError(_0x56f6de,null));};function iftimePromise(_0x55b3f5,_0xf7953c){return respondWithRpcPromise(_0x4aa0('0x100'),_0x4aa0('0x101'),{'command':_0xf7953c['timezone']?util['format'](_0x4aa0('0x102'),_0x55b3f5[_0x4aa0('0x103')],_0xf7953c[_0x4aa0('0x104')]):util['format'](_0x4aa0('0x105'),_0x55b3f5[_0x4aa0('0x103')])},client9002)['then'](function(_0x41a576){var _0x83c8e0=_0x41a576&&_0x41a576[_0x4aa0('0x106')](_0x4aa0('0x107'))>=0x0?!![]:![];logger[_0x4aa0('0x1e')](_0x4aa0('0x108'),_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5['interval'],_0x83c8e0?_0x4aa0('0x109'):_0x4aa0('0x10a'),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return _0x83c8e0;})[_0x4aa0('0x28')](function(_0x192a48){logger[_0x4aa0('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5[_0x4aa0('0x103')],util['inspect'](_0x192a48,{'showHidden':![],'depth':null}),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return![];});}exports[_0x4aa0('0x101')]=function(_0x513dff,_0x33b196,_0x89b64d){var _0x27516c=0x0;var _0x4ae21b=0x0;var _0x3a121a=![];var _0x50090a;var _0x4b1a1e;return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x513dff[_0x4aa0('0x66')]['id']},'include':[{'model':db['Interval'],'as':_0x4aa0('0x10c'),'include':[{'model':db[_0x4aa0('0x10c')],'as':'Intervals','attributes':['id',_0x4aa0('0x103')],'raw':!![]}]}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x33b196,null))[_0x4aa0('0x1d')](function(_0x4beab9){if(_0x4beab9){_0x50090a=_0x4beab9;return _0x4beab9[_0x4aa0('0x10d')]({'raw':!![]});}})[_0x4aa0('0x1d')](function(_0x1fef3d){if(_0x50090a){if(_0x1fef3d){_0x4b1a1e=_0x1fef3d;}}return require(_0x4aa0('0x7e'))['getLicense']();})[_0x4aa0('0x1d')](function(_0x303d42){if(_0x303d42){_0x4ae21b=_0x303d42[_0x4aa0('0x10e')];_0x3a121a=_0x303d42[_0x4aa0('0x10f')];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':{'closed':![]}});})['then'](function(_0x4837b2){_0x27516c=_0x4837b2;if(_0x4ae21b&&_0x4837b2>_0x4ae21b){return db['License']['findOne']({'where':{'id':0x1}})[_0x4aa0('0x1d')](function(_0x3c134f){if(_0x3c134f){_0x3c134f[_0x4aa0('0x110')](_0x4aa0('0x111'));}});}})[_0x4aa0('0x1d')](function(){if(_0x50090a[_0x4aa0('0x10c')]&&_0x50090a['Interval'][_0x4aa0('0x112')]){var _0x5173f3=[];for(var _0x59f21e=0x0;_0x59f21e<_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x4aa0('0x4d')];_0x59f21e++){var _0x5e1f71=_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x59f21e]['get']({'plain':!![]});_0x5173f3[_0x4aa0('0x113')](iftimePromise(_0x5e1f71,_0x50090a));}return BPromise[_0x4aa0('0x114')](_0x5173f3)[_0x4aa0('0x1d')](function(_0x68a497){return _[_0x4aa0('0x115')](_0x68a497);});}else{return!![];}})['then'](function(_0x2592a4){var _0x200989=fs['readFileSync'](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x116')),'utf8');var _0x1b2e4f={'remote':_0x50090a[_0x4aa0('0x117')],'query':querystring[_0x4aa0('0x23')](_[_0x4aa0('0x5b')](_0x50090a[_0x4aa0('0x38')]({'plain':!![]}),{'customerIp':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0xac')]||_0x513dff['headers'][_0x4aa0('0x118')]||_0x513dff[_0x4aa0('0x119')][_0x4aa0('0x11a')]||_0x513dff['ip'],'referer':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0x11b')],'openedInteractions':_0x27516c,'maxInteractions':_0x4ae21b,'virtual':_0x3a121a['virtual'],'online':_0x2592a4,'custom':_0x3a121a}))[_0x4aa0('0x11c')](/'/g,'\x5c\x27')};_0x33b196['send'](ejs[_0x4aa0('0xd6')](Mustache['render'](_0x200989,_0x1b2e4f),{'proactiveActions':_0x4b1a1e,'alignment':_0x50090a[_0x4aa0('0x11d')],'verticalAlignment':_0x50090a[_0x4aa0('0x11e')],'div_color':_0x50090a[_0x4aa0('0xfe')],'text_color':_0x50090a[_0x4aa0('0x11f')],'button_color':_0x50090a[_0x4aa0('0x120')],'background_color':_0x50090a[_0x4aa0('0x121')]}));})['catch'](handleError(_0x33b196,null));};exports[_0x4aa0('0x122')]=function(_0x4491e3,_0x4cb784,_0x37b43d){return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x4491e3[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb784,null))[_0x4aa0('0x1d')](function(_0x4effa9){if(_0x4effa9){return db[_0x4aa0('0xdf')][_0x4aa0('0x123')](function(_0x8c292a){return db[_0x4aa0('0x124')][_0x4aa0('0x37')]({'where':{'ChatWebsiteId':_0x4491e3['params']['id']},'transaction':_0x8c292a})[_0x4aa0('0x1d')](function(_0x165199){var _0x2f1166=_[_0x4aa0('0x46')](_0x4491e3['body'],function(_0x2f2ebd){_0x2f2ebd[_0x4aa0('0x69')]=_0x4491e3[_0x4aa0('0x66')]['id'];return _0x2f2ebd;});return db[_0x4aa0('0x124')]['bulkCreate'](_0x2f1166,{'transaction':_0x8c292a});});})['then'](function(){return db[_0x4aa0('0x124')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4491e3[_0x4aa0('0x66')]['id']},'order':'priority'});});}})[_0x4aa0('0x1d')](respondWithResult(_0x4cb784,null))[_0x4aa0('0x28')](handleError(_0x4cb784,null));};exports['getApplications']=function(_0x2eebb8,_0x49ccbd,_0x129ee3){var _0x3acc0a={};var _0x57233a={};var _0x38ee26;var _0x2a773b;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x2eebb8[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x49ccbd,null))['then'](function(_0x5c1ddb){if(_0x5c1ddb){_0x38ee26=_0x5c1ddb;_0x57233a['model']=_[_0x4aa0('0x48')](db['ChatApplication']['rawAttributes']);_0x57233a[_0x4aa0('0x47')]=_['keys'](_0x2eebb8[_0x4aa0('0x47')]);_0x57233a[_0x4aa0('0x49')]=_['intersection'](_0x57233a[_0x4aa0('0x45')],_0x57233a[_0x4aa0('0x47')]);_0x3acc0a[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x57233a[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x3acc0a['attributes']=_0x3acc0a[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x3acc0a[_0x4aa0('0x4b')]:_0x57233a[_0x4aa0('0x45')];_0x3acc0a[_0x4aa0('0x50')]=qs['sort'](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x3acc0a[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x2eebb8['query'],_0x57233a[_0x4aa0('0x49')]));if(_0x2eebb8['query'][_0x4aa0('0x54')]){_0x3acc0a[_0x4aa0('0x52')]=_['merge'](_0x3acc0a[_0x4aa0('0x52')],{'$or':_['map'](_0x3acc0a[_0x4aa0('0x4b')],function(_0x422d39){var _0x58f76c={};_0x58f76c[_0x422d39]={'$like':'%'+_0x2eebb8[_0x4aa0('0x47')]['filter']+'%'};return _0x58f76c;})});}_0x3acc0a=_[_0x4aa0('0x5b')]({},_0x3acc0a,_0x2eebb8['options']);return _0x38ee26[_0x4aa0('0x125')](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x4ace94){if(_0x4ace94){_0x2a773b=_0x4ace94[_0x4aa0('0x4d')];if(!_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x3acc0a[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x3acc0a[_0x4aa0('0x2c')]=qs['offset'](_0x2eebb8['query'][_0x4aa0('0x2c')]);}return _0x38ee26['getApplications'](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x100d03){if(_0x100d03){return _0x100d03?{'count':_0x2a773b,'rows':_0x100d03}:null;}})['then'](respondWithResult(_0x49ccbd,null))[_0x4aa0('0x28')](handleError(_0x49ccbd,null));};exports[_0x4aa0('0x126')]=function(_0x4d34fd,_0x5a618a,_0x3d0444){return db['chatProactiveAction']['find']({'where':{'id':_0x4d34fd[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x5a618a,null))[_0x4aa0('0x1d')](function(_0x968761){if(_0x968761){return _0x968761[_0x4aa0('0x126')](_0x4d34fd['body'][_0x4aa0('0x6e')],_[_0x4aa0('0xf7')](_0x4d34fd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5a618a,null))[_0x4aa0('0x28')](handleError(_0x5a618a,null));};exports[_0x4aa0('0x10d')]=function(_0x371685,_0x29cf9a,_0x161916){var _0x23bead={};var _0x111dcc={};var _0x1e180b;var _0x40f21b;return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x371685[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x29cf9a,null))[_0x4aa0('0x1d')](function(_0x971177){if(_0x971177){_0x1e180b=_0x971177;_0x111dcc[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x127')][_0x4aa0('0x41')]);_0x111dcc[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x371685[_0x4aa0('0x47')]);_0x111dcc['filters']=_[_0x4aa0('0x4a')](_0x111dcc['model'],_0x111dcc[_0x4aa0('0x47')]);_0x23bead[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x111dcc[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x371685['query'][_0x4aa0('0x4c')]));_0x23bead['attributes']=_0x23bead[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x23bead[_0x4aa0('0x4b')]:_0x111dcc[_0x4aa0('0x45')];_0x23bead[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x371685[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x23bead[_0x4aa0('0x52')]=qs['filters'](_[_0x4aa0('0x53')](_0x371685[_0x4aa0('0x47')],_0x111dcc[_0x4aa0('0x49')]));if(_0x371685[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x23bead[_0x4aa0('0x52')]=_['merge'](_0x23bead['where'],{'$or':_[_0x4aa0('0x46')](_0x23bead[_0x4aa0('0x4b')],function(_0x1d0dc1){var _0x144c2e={};_0x144c2e[_0x1d0dc1]={'$like':'%'+_0x371685[_0x4aa0('0x47')]['filter']+'%'};return _0x144c2e;})});}_0x23bead=_[_0x4aa0('0x5b')]({},_0x23bead,_0x371685[_0x4aa0('0x56')]);return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})['then'](function(_0x29c834){if(_0x29c834){_0x40f21b=_0x29c834['length'];if(!_0x371685[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x23bead['limit']=qs[_0x4aa0('0x2d')](_0x371685['query']['limit']);_0x23bead[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x371685[_0x4aa0('0x47')]['offset']);}return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})[_0x4aa0('0x1d')](function(_0x431d4b){if(_0x431d4b){return _0x431d4b?{'count':_0x40f21b,'rows':_0x431d4b}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x29cf9a,null))[_0x4aa0('0x28')](handleError(_0x29cf9a,null));};exports['getFields']=function(_0x4097c6,_0x328744,_0x58b2e2){var _0x12db7b=_0x4097c6[_0x4aa0('0x47')][_0x4aa0('0x128')]===_0x4aa0('0x129')?_0x4aa0('0x12a'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x12db7b],'where':{'id':_0x4097c6[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x328744,null))[_0x4aa0('0x1d')](function(_0x1cbead){if(_0x1cbead){var _0x366d2f=_0x1cbead[_0x12db7b];var _0x3d7cc5=_0x366d2f&&_0x366d2f[_0x4aa0('0x12b')]?_0x366d2f['items']:[];_0x328744[_0x4aa0('0x3c')]({'fromKey':_[_0x4aa0('0x7f')](_0x366d2f[_0x4aa0('0x12c')])?undefined:_0x366d2f[_0x4aa0('0x12c')],'count':_0x3d7cc5[_0x4aa0('0x4d')],'rows':_0x3d7cc5});}})[_0x4aa0('0x28')](handleError(_0x328744,null));};exports['getOfflineMessages']=function(_0x57027a,_0x43a0c7,_0x55bf10){var _0x2497e5={'raw':![],'where':{}};var _0x616ad5={};var _0x2b9cdf={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x57027a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x43a0c7,null))[_0x4aa0('0x1d')](function(_0x44e4ec){if(_0x44e4ec){_0x616ad5[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['ChatOfflineMessage'][_0x4aa0('0x41')]);_0x616ad5['query']=_[_0x4aa0('0x48')](_0x57027a[_0x4aa0('0x47')]);_0x616ad5[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x616ad5[_0x4aa0('0x45')],_0x616ad5[_0x4aa0('0x47')]);_0x2497e5[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x616ad5['model'],qs[_0x4aa0('0x4c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x2497e5[_0x4aa0('0x4b')]=_0x2497e5[_0x4aa0('0x4b')]['length']?_0x2497e5['attributes']:_0x616ad5['model'];if(!_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x2497e5[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x2497e5[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x2497e5[_0x4aa0('0x50')]=qs['sort'](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x2497e5[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x57027a[_0x4aa0('0x47')],_0x616ad5['filters']));_0x2497e5[_0x4aa0('0x52')]['ChatWebsiteId']=_0x44e4ec['id'];if(_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x2497e5[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x2497e5[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x2497e5[_0x4aa0('0x4b')],function(_0x59f3a3){var _0x3bd7ee={};_0x3bd7ee[_0x59f3a3]={'$like':'%'+_0x57027a['query'][_0x4aa0('0x54')]+'%'};return _0x3bd7ee;})});}_0x2497e5=_[_0x4aa0('0x5b')]({},_0x2497e5,_0x57027a[_0x4aa0('0x56')]);return db[_0x4aa0('0xd9')][_0x4aa0('0x2f')]({'where':_0x2497e5[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x31fda9){_0x2b9cdf[_0x4aa0('0x2f')]=_0x31fda9;if(_0x57027a['query'][_0x4aa0('0x5a')]){_0x2497e5['include']=[{'all':!![]}];}else{_0x2497e5['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db[_0x4aa0('0x12d')],'as':_0x4aa0('0x12e'),'required':![]}];}return db[_0x4aa0('0xd9')]['findAll'](_0x2497e5);})[_0x4aa0('0x1d')](function(_0x1d5fd2){_0x2b9cdf[_0x4aa0('0x58')]=_0x1d5fd2;return _0x2b9cdf;});}})['then'](respondWithFilteredResult(_0x43a0c7,_0x2497e5))[_0x4aa0('0x28')](handleError(_0x43a0c7,null));};exports[_0x4aa0('0x12f')]=function(_0x12152c,_0x30bcb2,_0x3443c2){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x12152c[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x30bcb2,null))[_0x4aa0('0x1d')](function(_0x892b51){if(_0x892b51){return _0x892b51[_0x4aa0('0x12f')](_0x12152c['body']['ids'],_['omit'](_0x12152c[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{})['spread'](function(_0x218c4a){for(var _0x16cd20=0x0;_0x16cd20<_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x4aa0('0x4d')];_0x16cd20+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x131'),{'UserId':Number(_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x16cd20]),'ChatWebsiteId':Number(_0x12152c[_0x4aa0('0x66')]['id'])});}return _0x218c4a;});}})['then'](respondWithResult(_0x30bcb2,null))['catch'](handleError(_0x30bcb2,null));};exports[_0x4aa0('0x132')]=function(_0x53a688,_0x1f98b1,_0x44f1a6){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x53a688[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1f98b1,null))['then'](function(_0x19143a){if(_0x19143a){return _0x19143a['removeAgents'](_0x53a688['query'][_0x4aa0('0x6e')])[_0x4aa0('0x1d')](function(){if(_[_0x4aa0('0x133')](_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')])){for(var _0x1b0097=0x0;_0x1b0097<_0x53a688['query']['ids']['length'];_0x1b0097+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x134'),{'UserId':Number(_0x53a688['query'][_0x4aa0('0x6e')][_0x1b0097]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}}else{socket[_0x4aa0('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1f98b1,null))[_0x4aa0('0x28')](handleError(_0x1f98b1,null));};exports[_0x4aa0('0x135')]=function(_0x1017b2,_0x2677a6,_0x2b4d14){var _0x4585a3={};var _0x40565b={};var _0x305844;var _0x21b263;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x1017b2['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x2677a6,null))[_0x4aa0('0x1d')](function(_0xabcac6){if(_0xabcac6){_0x305844=_0xabcac6;_0x40565b[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x136')][_0x4aa0('0x41')]);_0x40565b[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x1017b2['query']);_0x40565b['filters']=_['intersection'](_0x40565b[_0x4aa0('0x45')],_0x40565b['query']);_0x4585a3[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x40565b[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x1017b2[_0x4aa0('0x47')]['fields']));_0x4585a3['attributes']=_0x4585a3['attributes'][_0x4aa0('0x4d')]?_0x4585a3[_0x4aa0('0x4b')]:_0x40565b['model'];_0x4585a3[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x1017b2[_0x4aa0('0x47')]['sort']);_0x4585a3[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x1017b2[_0x4aa0('0x47')],_0x40565b[_0x4aa0('0x49')]));if(_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4585a3['where']=_[_0x4aa0('0x5b')](_0x4585a3[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4585a3[_0x4aa0('0x4b')],function(_0x508e24){var _0x981117={};_0x981117[_0x508e24]={'$like':'%'+_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x981117;})});}_0x4585a3=_[_0x4aa0('0x5b')]({},_0x4585a3,_0x1017b2[_0x4aa0('0x56')]);return _0x305844[_0x4aa0('0x135')](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x749aa0){if(_0x749aa0){_0x21b263=_0x749aa0[_0x4aa0('0x4d')];if(!_0x1017b2['query'][_0x4aa0('0x4e')]('nolimit')){_0x4585a3[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x1017b2['query']['limit']);_0x4585a3[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}return _0x305844['getAgents'](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x586771){if(_0x586771){return _0x586771?{'count':_0x21b263,'rows':_0x586771}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x2677a6,null))['catch'](handleError(_0x2677a6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index aedf63d..85a929c 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 _0xbeea=['emit','exports','events','ChatWebsite','setMaxListeners','save','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbeea,0xb1));var _0xabee=function(_0x1ca7ba,_0x2d33c7){_0x1ca7ba=_0x1ca7ba-0x0;var _0x369488=_0xbeea[_0x1ca7ba];return _0x369488;};'use strict';var EventEmitter=require(_0xabee('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xabee('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xabee('0x2')](0x0);var events={'afterCreate':_0xabee('0x3'),'afterUpdate':'update','afterDestroy':_0xabee('0x4')};function emitEvent(_0x59e264){return function(_0x58afa7,_0x33571e,_0x2fb6d9){ChatWebsiteEvents[_0xabee('0x5')](_0x59e264+':'+_0x58afa7['id'],_0x58afa7);ChatWebsiteEvents[_0xabee('0x5')](_0x59e264,_0x58afa7);_0x2fb6d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xabee('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xaefc=['events','../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','exports'];(function(_0x40bc9c,_0x3f50d7){var _0x3e78c9=function(_0x1372c7){while(--_0x1372c7){_0x40bc9c['push'](_0x40bc9c['shift']());}};_0x3e78c9(++_0x3f50d7);}(_0xaefc,0xc8));var _0xcaef=function(_0x332d7b,_0x12ac04){_0x332d7b=_0x332d7b-0x0;var _0x3fc593=_0xaefc[_0x332d7b];return _0x3fc593;};'use strict';var EventEmitter=require(_0xcaef('0x0'));var ChatWebsite=require(_0xcaef('0x1'))['db'][_0xcaef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcaef('0x3'),'afterUpdate':_0xcaef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x575523){return function(_0x37a134,_0x46a35e,_0x5f160f){ChatWebsiteEvents['emit'](_0x575523+':'+_0x37a134['id'],_0x37a134);ChatWebsiteEvents[_0xcaef('0x5')](_0x575523,_0x37a134);_0x5f160f(null);};}for(var e in events){if(events[_0xcaef('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcaef('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4ea72fe..af66c46 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 _0x01bb=['request-promise','path','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird'];(function(_0xf69067,_0x222ff8){var _0x4b2bd1=function(_0x4e36a1){while(--_0x4e36a1){_0xf69067['push'](_0xf69067['shift']());}};_0x4b2bd1(++_0x222ff8);}(_0x01bb,0x11e));var _0xb01b=function(_0x1d1421,_0x2b1e64){_0x1d1421=_0x1d1421-0x0;var _0xa4bfb9=_0x01bb[_0x1d1421];return _0xa4bfb9;};'use strict';var _=require(_0xb01b('0x0'));var util=require('util');var logger=require(_0xb01b('0x1'))(_0xb01b('0x2'));var moment=require('moment');var BPromise=require(_0xb01b('0x3'));var rp=require(_0xb01b('0x4'));var fs=require('fs');var path=require(_0xb01b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb01b('0x6'));module[_0xb01b('0x7')]=function(_0x36942a,_0x175092){return _0x36942a['define'](_0xb01b('0x8'),attributes,{'tableName':_0xb01b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd676=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x13a08a,_0x52da1c){var _0x152014=function(_0x18d227){while(--_0x18d227){_0x13a08a['push'](_0x13a08a['shift']());}};_0x152014(++_0x52da1c);}(_0xd676,0x151));var _0x6d67=function(_0x585234,_0x3ae470){_0x585234=_0x585234-0x0;var _0x28b8a7=_0xd676[_0x585234];return _0x28b8a7;};'use strict';var _=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var logger=require(_0x6d67('0x2'))(_0x6d67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d67('0x4'));var rimraf=require(_0x6d67('0x5'));var config=require(_0x6d67('0x6'));var attributes=require(_0x6d67('0x7'));module[_0x6d67('0x8')]=function(_0x1b1861,_0x12ae1d){return _0x1b1861['define'](_0x6d67('0x9'),attributes,{'tableName':_0x6d67('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 43fd672..77f701e 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 _0xd16b=['error','code','message','info','request\x20sent','lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x7a9ecb,_0x2cc302){var _0x440b3e=function(_0x232674){while(--_0x232674){_0x7a9ecb['push'](_0x7a9ecb['shift']());}};_0x440b3e(++_0x2cc302);}(_0xd16b,0x73));var _0xbd16=function(_0x3ec7dc,_0x10e64d){_0x3ec7dc=_0x3ec7dc-0x0;var _0x5d1d6b=_0xd16b[_0x3ec7dc];return _0x5d1d6b;};'use strict';var _=require(_0xbd16('0x0'));var util=require(_0xbd16('0x1'));var moment=require(_0xbd16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd16('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd16('0x4'));var logger=require('../../config/logger')(_0xbd16('0x5'));var config=require('../../config/environment');var jayson=require(_0xbd16('0x6'));var client=jayson[_0xbd16('0x7')]['http']({'port':0x232a});config[_0xbd16('0x8')]=_[_0xbd16('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbd16('0xa'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xbd16('0xb')](socket);function respondWithRpcPromise(_0x122fa3,_0x3fd940,_0x461abc){return new BPromise(function(_0x546229,_0x5b21f2){return client[_0xbd16('0xc')](_0x122fa3,_0x461abc)[_0xbd16('0xd')](function(_0x4632f1){logger['info'](_0xbd16('0xe'),_0x3fd940,'request\x20sent');logger[_0xbd16('0xf')](_0xbd16('0x10'),_0x3fd940,'request\x20sent',JSON['stringify'](_0x4632f1));if(_0x4632f1[_0xbd16('0x11')]){if(_0x4632f1[_0xbd16('0x11')][_0xbd16('0x12')]===0x1f4){logger[_0xbd16('0x11')](_0xbd16('0xe'),_0x3fd940,_0x4632f1[_0xbd16('0x11')][_0xbd16('0x13')]);return _0x5b21f2(_0x4632f1[_0xbd16('0x11')][_0xbd16('0x13')]);}logger[_0xbd16('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x3fd940,_0x4632f1[_0xbd16('0x11')][_0xbd16('0x13')]);return _0x546229(_0x4632f1[_0xbd16('0x11')][_0xbd16('0x13')]);}else{logger[_0xbd16('0x14')](_0xbd16('0xe'),_0x3fd940,_0xbd16('0x15'));_0x546229(_0x4632f1['result']['message']);}})['catch'](function(_0x59d7e9){logger[_0xbd16('0x11')](_0xbd16('0xe'),_0x3fd940,_0x59d7e9);_0x5b21f2(_0x59d7e9);});});} \ No newline at end of file +var _0x6b5d=['defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6b5d,0x116));var _0xd6b5=function(_0x19b98c,_0x4cc35d){_0x19b98c=_0x19b98c-0x0;var _0x361c7e=_0x6b5d[_0x19b98c];return _0x361c7e;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var moment=require('moment');var BPromise=require(_0xd6b5('0x2'));var rs=require(_0xd6b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd6b5('0x4'));var logger=require('../../config/logger')(_0xd6b5('0x5'));var config=require(_0xd6b5('0x6'));var jayson=require(_0xd6b5('0x7'));var client=jayson['client'][_0xd6b5('0x8')]({'port':0x232a});config[_0xd6b5('0x9')]=_[_0xd6b5('0xa')](config['redis'],{'host':_0xd6b5('0xb'),'port':0x18eb});var socket=require(_0xd6b5('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd6b5('0xd')](socket);function respondWithRpcPromise(_0x582f63,_0x25245d,_0x4c280e){return new BPromise(function(_0x2e8583,_0x77d9f){return client[_0xd6b5('0xe')](_0x582f63,_0x4c280e)['then'](function(_0x305864){logger[_0xd6b5('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x25245d,_0xd6b5('0x10'));logger[_0xd6b5('0x11')](_0xd6b5('0x12'),_0x25245d,_0xd6b5('0x10'),JSON[_0xd6b5('0x13')](_0x305864));if(_0x305864['error']){if(_0x305864['error']['code']===0x1f4){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x77d9f(_0x305864[_0xd6b5('0x14')][_0xd6b5('0x16')]);}logger['error'](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x2e8583(_0x305864['error']['message']);}else{logger['info'](_0xd6b5('0x15'),_0x25245d,_0xd6b5('0x10'));_0x2e8583(_0x305864['result'][_0xd6b5('0x16')]);}})[_0xd6b5('0x17')](function(_0x1cbfc8){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x1cbfc8);_0x77d9f(_0x1cbfc8);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 0ffe99b..bbd5d8d 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 _0x6f13=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x6f13,0x9a));var _0x36f1=function(_0x204973,_0x771010){_0x204973=_0x204973-0x0;var _0x22da04=_0x6f13[_0x204973];return _0x22da04;};'use strict';var ChatWebsiteEvents=require(_0x36f1('0x0'));var events=[_0x36f1('0x1'),_0x36f1('0x2'),_0x36f1('0x3')];function createListener(_0x5e880a,_0x5bc867){return function(_0x55fc17){_0x5bc867[_0x36f1('0x4')](_0x5e880a,_0x55fc17);};}function removeListener(_0xea8bc9,_0x2f0880){return function(){ChatWebsiteEvents[_0x36f1('0x5')](_0xea8bc9,_0x2f0880);};}exports[_0x36f1('0x6')]=function(_0x38f869){for(var _0x58a571=0x0,_0x45ca95=events[_0x36f1('0x7')];_0x58a571<_0x45ca95;_0x58a571++){var _0x4b4d31=events[_0x58a571];var _0x3e31e5=createListener(_0x36f1('0x8')+_0x4b4d31,_0x38f869);ChatWebsiteEvents['on'](_0x4b4d31,_0x3e31e5);}}; \ No newline at end of file +var _0x1eb5=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x3def3c,_0x1d66d2){var _0x9cc736=function(_0x304f9b){while(--_0x304f9b){_0x3def3c['push'](_0x3def3c['shift']());}};_0x9cc736(++_0x1d66d2);}(_0x1eb5,0xea));var _0x51eb=function(_0x3fe227,_0x52d34f){_0x3fe227=_0x3fe227-0x0;var _0x34e8dc=_0x1eb5[_0x3fe227];return _0x34e8dc;};'use strict';var ChatWebsiteEvents=require(_0x51eb('0x0'));var events=[_0x51eb('0x1'),_0x51eb('0x2'),_0x51eb('0x3')];function createListener(_0x3815ed,_0x3c0af9){return function(_0x1aa631){_0x3c0af9[_0x51eb('0x4')](_0x3815ed,_0x1aa631);};}function removeListener(_0xf077a8,_0x4d6d2f){return function(){ChatWebsiteEvents[_0x51eb('0x5')](_0xf077a8,_0x4d6d2f);};}exports[_0x51eb('0x6')]=function(_0x5ef655){for(var _0x118991=0x0,_0x3db9d6=events[_0x51eb('0x7')];_0x118991<_0x3db9d6;_0x118991++){var _0x36a109=events[_0x118991];var _0x4c6d06=createListener(_0x51eb('0x8')+_0x36a109,_0x5ef655);ChatWebsiteEvents['on'](_0x36a109,_0x4c6d06);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d7b21aa..4a7e2cb 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 _0x4e09=['/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','server/files/images/avatars/','format','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeAnswers','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x4dde94,_0x52b903){var _0x30acf7=function(_0x2d0ead){while(--_0x2d0ead){_0x4dde94['push'](_0x4dde94['shift']());}};_0x30acf7(++_0x52b903);}(_0x4e09,0xb9));var _0x94e0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4e09[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x94e0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x94e0('0x1'));var router=express[_0x94e0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x94e0('0x3'));var interaction=require(_0x94e0('0x4'));var config=require(_0x94e0('0x5'));var controller=require(_0x94e0('0x6'));router[_0x94e0('0x7')]('/',auth[_0x94e0('0x8')](),controller[_0x94e0('0x9')]);router[_0x94e0('0x7')](_0x94e0('0xa'),auth['isAuthenticated'](),controller[_0x94e0('0xb')]);router[_0x94e0('0x7')](_0x94e0('0xc'),auth[_0x94e0('0x8')](),controller['show']);router[_0x94e0('0x7')](_0x94e0('0xd'),auth[_0x94e0('0x8')](),controller[_0x94e0('0xe')]);router[_0x94e0('0x7')](_0x94e0('0xf'),auth[_0x94e0('0x8')](),controller[_0x94e0('0x10')]);router[_0x94e0('0x7')](_0x94e0('0x11'),controller[_0x94e0('0x12')]);router[_0x94e0('0x7')](_0x94e0('0x13'),controller[_0x94e0('0x14')]);router[_0x94e0('0x7')](_0x94e0('0x15'),controller[_0x94e0('0x16')]);router[_0x94e0('0x7')](_0x94e0('0x17'),controller[_0x94e0('0x18')]);router[_0x94e0('0x7')](_0x94e0('0x19'),auth[_0x94e0('0x8')](),controller['getInteractions']);router['get'](_0x94e0('0x1a'),controller[_0x94e0('0x1b')]);router[_0x94e0('0x7')](_0x94e0('0x1c'),auth[_0x94e0('0x8')](),controller['getApplications']);router[_0x94e0('0x7')](_0x94e0('0x1d'),auth[_0x94e0('0x8')](),controller['getProactiveActions']);router[_0x94e0('0x7')](_0x94e0('0x1e'),controller['getFields']);router['get'](_0x94e0('0x1f'),auth[_0x94e0('0x8')](),controller[_0x94e0('0x20')]);router[_0x94e0('0x7')](_0x94e0('0x21'),auth[_0x94e0('0x8')](),controller[_0x94e0('0x22')]);router[_0x94e0('0x23')]('/',auth[_0x94e0('0x8')](),controller[_0x94e0('0x24')]);router['post']('/:id/dispositions',auth[_0x94e0('0x8')](),controller[_0x94e0('0x25')]);router[_0x94e0('0x23')](_0x94e0('0xf'),auth[_0x94e0('0x8')](),controller[_0x94e0('0x26')]);var upload=multer({'storage':multer[_0x94e0('0x27')]({'destination':function(_0x1a4154,_0x278fb4,_0x539a3e){_0x539a3e(null,path[_0x94e0('0x28')](config[_0x94e0('0x29')],_0x94e0('0x2a')));},'filename':function(_0x5d7b1c,_0x1f70cb,_0x4684f7){_0x4684f7(null,util['format'](_0x94e0('0x2b'),Date[_0x94e0('0x2c')](),_0x1f70cb[_0x94e0('0x2d')]));}})});router[_0x94e0('0x23')](_0x94e0('0x11'),upload[_0x94e0('0x2e')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x94e0('0x27')]({'destination':function(_0x16735a,_0x4bf079,_0x3740a0){_0x3740a0(null,path[_0x94e0('0x28')](config['root'],_0x94e0('0x2f')));},'filename':function(_0x5596f6,_0x554243,_0x3dd86d){_0x3dd86d(null,util['format'](_0x94e0('0x2b'),Date[_0x94e0('0x2c')](),_0x554243['originalname']));}})});router[_0x94e0('0x23')](_0x94e0('0x13'),upload[_0x94e0('0x2e')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12c5f3,_0x5f58ec,_0x54b538){_0x54b538(null,path[_0x94e0('0x28')](config[_0x94e0('0x29')],_0x94e0('0x2f')));},'filename':function(_0x262d75,_0xb87e4e,_0x12edbf){_0x12edbf(null,util[_0x94e0('0x30')]('%s-%s',Date[_0x94e0('0x2c')](),_0xb87e4e['originalname']));}})});router[_0x94e0('0x23')]('/:id/customer_avatar',upload['single'](_0x94e0('0x31')),controller[_0x94e0('0x32')]);var upload=multer({'storage':multer[_0x94e0('0x27')]({'destination':function(_0x7b1975,_0x3d0e45,_0x2cd81d){_0x2cd81d(null,path[_0x94e0('0x28')](config[_0x94e0('0x29')],'server/files/images/avatars/'));},'filename':function(_0x395852,_0x149aaf,_0x3a8f0a){_0x3a8f0a(null,util['format']('%s-%s',Date[_0x94e0('0x2c')](),_0x149aaf[_0x94e0('0x2d')]));}})});router[_0x94e0('0x23')]('/:id/system_avatar',upload[_0x94e0('0x2e')](_0x94e0('0x31')),controller[_0x94e0('0x33')]);router['post'](_0x94e0('0x34'),controller[_0x94e0('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x94e0('0x27')]({'destination':function(_0x40d601,_0x1c9aed,_0x3f2b0e){const _0x5012df=path[_0x94e0('0x28')](config[_0x94e0('0x29')],_0x94e0('0x36'),_0x94e0('0x37'),_0x94e0('0x38'));fs_extra[_0x94e0('0x39')](_0x5012df,function(){_0x3f2b0e(null,_0x5012df);});},'filename':function(_0x3c369e,_0x28af65,_0x40cc81){const _0x1aa3d9=_0x28af65[_0x94e0('0x2d')][_0x94e0('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37097d=path[_0x94e0('0x3b')](_0x1aa3d9);const _0x23d058=Date['now']()+'-'+_0x1aa3d9[_0x94e0('0x3a')](_0x37097d,'')+_0x37097d;_0x40cc81(null,_0x23d058);}})});router[_0x94e0('0x23')](_0x94e0('0x3c'),offlineUploadMulter[_0x94e0('0x3d')](),controller[_0x94e0('0x3e')]);router['post'](_0x94e0('0x19'),auth[_0x94e0('0x8')](),controller[_0x94e0('0x3f')]);router['post'](_0x94e0('0x1c'),auth['isAuthenticated'](),controller[_0x94e0('0x40')]);router[_0x94e0('0x23')](_0x94e0('0x1d'),auth['isAuthenticated'](),controller[_0x94e0('0x41')]);router['post'](_0x94e0('0x21'),auth['isAuthenticated'](),controller[_0x94e0('0x42')]);router['put'](_0x94e0('0xc'),auth['isAuthenticated'](),controller[_0x94e0('0x43')]);router[_0x94e0('0x44')](_0x94e0('0xc'),auth[_0x94e0('0x8')](),controller['destroy']);router['delete'](_0x94e0('0xd'),auth[_0x94e0('0x8')](),controller['removeDispositions']);router[_0x94e0('0x44')]('/:id/canned_answers',auth[_0x94e0('0x8')](),controller[_0x94e0('0x45')]);router['delete'](_0x94e0('0x21'),auth[_0x94e0('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6bac=['post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','/:id/users','removeAgents','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','getAgents'];(function(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0x6bac,0xf2));var _0xc6ba=function(_0x1aaed2,_0x559e12){_0x1aaed2=_0x1aaed2-0x0;var _0x346822=_0x6bac[_0x1aaed2];return _0x346822;};'use strict';var multer=require(_0xc6ba('0x0'));var util=require(_0xc6ba('0x1'));var path=require('path');var timeout=require(_0xc6ba('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc6ba('0x3'));var config=require(_0xc6ba('0x4'));var controller=require('./chatWebsite.controller');router[_0xc6ba('0x5')]('/',auth['isAuthenticated'](),controller[_0xc6ba('0x6')]);router['get'](_0xc6ba('0x7'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x9')]);router[_0xc6ba('0x5')](_0xc6ba('0xa'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xb')]);router[_0xc6ba('0x5')](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xd')]);router[_0xc6ba('0x5')](_0xc6ba('0xe'),auth['isAuthenticated'](),controller[_0xc6ba('0xf')]);router[_0xc6ba('0x5')](_0xc6ba('0x10'),controller[_0xc6ba('0x11')]);router[_0xc6ba('0x5')](_0xc6ba('0x12'),controller[_0xc6ba('0x13')]);router[_0xc6ba('0x5')]('/:id/customer_avatar',controller[_0xc6ba('0x14')]);router[_0xc6ba('0x5')]('/:id/system_avatar',controller[_0xc6ba('0x15')]);router['get'](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x17')]);router[_0xc6ba('0x5')]('/:id/snippet',controller[_0xc6ba('0x18')]);router[_0xc6ba('0x5')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1a')]);router[_0xc6ba('0x5')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller['getProactiveActions']);router[_0xc6ba('0x5')]('/:id/fields',controller[_0xc6ba('0x1c')]);router[_0xc6ba('0x5')]('/:id/offline_messages',auth[_0xc6ba('0x8')](),controller['getOfflineMessages']);router[_0xc6ba('0x5')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller['addDisposition']);router[_0xc6ba('0x1e')](_0xc6ba('0xe'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1f')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x429e50,_0x179f5e,_0xf2001d){_0xf2001d(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x23')));},'filename':function(_0x9226c2,_0x13b47b,_0x546082){_0x546082(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x13b47b[_0xc6ba('0x27')]));}})});router[_0xc6ba('0x1e')](_0xc6ba('0x10'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x420410,_0x568fd4,_0x30a9c2){_0x30a9c2(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0xe83e55,_0x2b24ce,_0x2913b5){_0x2913b5(null,util[_0xc6ba('0x24')]('%s-%s',Date[_0xc6ba('0x26')](),_0x2b24ce[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x12'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2b')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x23195c,_0x2cdb14,_0x580e80){_0x580e80(null,path[_0xc6ba('0x21')](config['root'],_0xc6ba('0x2a')));},'filename':function(_0xcf3342,_0x463a16,_0x2deff4){_0x2deff4(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x463a16['originalname']));}})});router['post'](_0xc6ba('0x2c'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d4e66,_0x2be187,_0x1a0d3d){_0x1a0d3d(null,path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0x2ea2da,_0x450696,_0xebfc5){_0xebfc5(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x450696[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x2e'),upload['single'](_0xc6ba('0x29')),controller[_0xc6ba('0x2f')]);router[_0xc6ba('0x1e')](_0xc6ba('0x30'),controller[_0xc6ba('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x3bc5f3,_0x32575f,_0x5c5046){const _0x28bde7=path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x32'),_0xc6ba('0x33'),_0xc6ba('0x34'));fs_extra[_0xc6ba('0x35')](_0x28bde7,function(){_0x5c5046(null,_0x28bde7);});},'filename':function(_0x4c36b1,_0x2cd4b9,_0x3792a9){const _0xf33d66=_0x2cd4b9[_0xc6ba('0x27')][_0xc6ba('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3a91ea=path['extname'](_0xf33d66);const _0x51a865=Date[_0xc6ba('0x26')]()+'-'+_0xf33d66[_0xc6ba('0x36')](_0x3a91ea,'')+_0x3a91ea;_0x3792a9(null,_0x51a865);}})});router['post'](_0xc6ba('0x37'),offlineUploadMulter[_0xc6ba('0x38')](),controller['offline']);router[_0xc6ba('0x1e')](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x39')]);router[_0xc6ba('0x1e')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3a')]);router[_0xc6ba('0x1e')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3b')]);router[_0xc6ba('0x1e')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3c')]);router[_0xc6ba('0x3d')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x3e')]);router[_0xc6ba('0x3f')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x40')]);router['delete'](_0xc6ba('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xc6ba('0x3f')]('/:id/canned_answers',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x41')]);router['delete'](_0xc6ba('0x42'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x43')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index f89e80b..742774f 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 _0x0650=['Google','sequelize','STRING','ENUM'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0650,0xed));var _0x0065=function(_0x458c52,_0x5e3fb4){_0x458c52=_0x458c52-0x0;var _0x43f43b=_0x0650[_0x458c52];return _0x43f43b;};'use strict';var Sequelize=require(_0x0065('0x0'));module['exports']={'name':{'type':Sequelize[_0x0065('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0065('0x2')]('AmazonAWS',_0x0065('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0065('0x1')]}}; \ No newline at end of file +var _0x5db2=['STRING','AmazonAWS','Google','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5db2,0xf3));var _0x25db=function(_0x3adc99,_0x20689e){_0x3adc99=_0x3adc99-0x0;var _0x26fa68=_0x5db2[_0x3adc99];return _0x26fa68;};'use strict';var Sequelize=require(_0x25db('0x0'));module[_0x25db('0x1')]={'name':{'type':Sequelize[_0x25db('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x25db('0x3'),_0x25db('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x25db('0x2')]},'data2':{'type':Sequelize[_0x25db('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index dadb4b4..f144f8a 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x3db4d1,_0x48ff6d){var _0x14aa01=function(_0x2abf94){while(--_0x2abf94){_0x3db4d1['push'](_0x3db4d1['shift']());}};_0x14aa01(++_0x48ff6d);}(_0x2032,0xd9));var _0x2203=function(_0xd81ab0,_0xe3f4af){_0xd81ab0=_0xd81ab0-0x0;var _0x42df02=_0x2032[_0xd81ab0];return _0x42df02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file +var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x2ba5db,_0x4d9a5f){var _0x4cd936=function(_0x33f7e4){while(--_0x33f7e4){_0x2ba5db['push'](_0x2ba5db['shift']());}};_0x4cd936(++_0x4d9a5f);}(_0x2032,0xd9));var _0x2203=function(_0x30e4e8,_0x27dfdb){_0x30e4e8=_0x30e4e8-0x0;var _0x15b632=_0x2032[_0x30e4e8];return _0x15b632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 0ac26bc..7ee3adc 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 _0xd6c2=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x6651c3,_0x13210f){var _0x3d1598=function(_0x53dc1c){while(--_0x53dc1c){_0x6651c3['push'](_0x6651c3['shift']());}};_0x3d1598(++_0x13210f);}(_0xd6c2,0x1b3));var _0x2d6c=function(_0x3bab68,_0x286d89){_0x3bab68=_0x3bab68-0x0;var _0x69434=_0xd6c2[_0x3bab68];return _0x69434;};'use strict';var _=require(_0x2d6c('0x0'));var util=require(_0x2d6c('0x1'));var logger=require(_0x2d6c('0x2'))(_0x2d6c('0x3'));var moment=require(_0x2d6c('0x4'));var BPromise=require(_0x2d6c('0x5'));var rp=require(_0x2d6c('0x6'));var fs=require('fs');var path=require(_0x2d6c('0x7'));var rimraf=require(_0x2d6c('0x8'));var config=require(_0x2d6c('0x9'));var attributes=require(_0x2d6c('0xa'));module[_0x2d6c('0xb')]=function(_0xd59f5b,_0x2c9fe3){return _0xd59f5b['define'](_0x2d6c('0xc'),attributes,{'tableName':_0x2d6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d8a=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','request-promise','path'];(function(_0x2a9202,_0x5e68cb){var _0x316625=function(_0x4ae297){while(--_0x4ae297){_0x2a9202['push'](_0x2a9202['shift']());}};_0x316625(++_0x5e68cb);}(_0x4d8a,0x1e8));var _0xa4d8=function(_0x4ea576,_0x46e67a){_0x4ea576=_0x4ea576-0x0;var _0xc48ceb=_0x4d8a[_0x4ea576];return _0xc48ceb;};'use strict';var _=require(_0xa4d8('0x0'));var util=require(_0xa4d8('0x1'));var logger=require('../../config/logger')(_0xa4d8('0x2'));var moment=require(_0xa4d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4d8('0x4'));var fs=require('fs');var path=require(_0xa4d8('0x5'));var rimraf=require(_0xa4d8('0x6'));var config=require(_0xa4d8('0x7'));var attributes=require(_0xa4d8('0x8'));module[_0xa4d8('0x9')]=function(_0x60cd93,_0x59d88e){return _0x60cd93[_0xa4d8('0xa')](_0xa4d8('0xb'),attributes,{'tableName':_0xa4d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 9997fcb..aa326d1 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 _0x7031=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x7031,0x19a));var _0x1703=function(_0x211201,_0x454beb){_0x211201=_0x211201-0x0;var _0x11fe16=_0x7031[_0x211201];return _0x11fe16;};'use strict';var _=require(_0x1703('0x0'));var util=require(_0x1703('0x1'));var moment=require('moment');var BPromise=require(_0x1703('0x2'));var rs=require(_0x1703('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1703('0x4'))['db'];var utils=require(_0x1703('0x5'));var logger=require('../../config/logger')(_0x1703('0x6'));var config=require(_0x1703('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1703('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229e82,_0x2ba8e2,_0x3117b5){return new BPromise(function(_0x4f46dc,_0x1cba9a){return client[_0x1703('0x9')](_0x229e82,_0x3117b5)[_0x1703('0xa')](function(_0x5ded48){logger[_0x1703('0xb')](_0x1703('0xc'),_0x2ba8e2,_0x1703('0xd'));logger[_0x1703('0xe')](_0x1703('0xf'),_0x2ba8e2,_0x1703('0xd'),JSON[_0x1703('0x10')](_0x5ded48));if(_0x5ded48[_0x1703('0x11')]){if(_0x5ded48[_0x1703('0x11')][_0x1703('0x12')]===0x1f4){logger[_0x1703('0x11')](_0x1703('0xc'),_0x2ba8e2,_0x5ded48[_0x1703('0x11')][_0x1703('0x13')]);return _0x1cba9a(_0x5ded48[_0x1703('0x11')][_0x1703('0x13')]);}logger[_0x1703('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2ba8e2,_0x5ded48['error'][_0x1703('0x13')]);return _0x4f46dc(_0x5ded48[_0x1703('0x11')]['message']);}else{logger[_0x1703('0xb')](_0x1703('0xc'),_0x2ba8e2,_0x1703('0xd'));_0x4f46dc(_0x5ded48['result'][_0x1703('0x13')]);}})[_0x1703('0x14')](function(_0x4d53d1){logger[_0x1703('0x11')](_0x1703('0xc'),_0x2ba8e2,_0x4d53d1);_0x1cba9a(_0x4d53d1);});});} \ No newline at end of file +var _0xa5c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x10e9e7,_0x199cbd){_0x10e9e7=_0x10e9e7-0x0;var _0x4e187a=_0xa5c1[_0x10e9e7];return _0x4e187a;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('CloudProvider,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7a1b4f6..998e6c6 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 _0x5e9c=['Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x339c2c,_0x255e4c){var _0x47a255=function(_0x2995ac){while(--_0x2995ac){_0x339c2c['push'](_0x339c2c['shift']());}};_0x47a255(++_0x255e4c);}(_0x5e9c,0x17c));var _0xc5e9=function(_0x451588,_0x2cb08d){_0x451588=_0x451588-0x0;var _0x47e9b0=_0x5e9c[_0x451588];return _0x47e9b0;};'use strict';var multer=require(_0xc5e9('0x0'));var util=require(_0xc5e9('0x1'));var path=require(_0xc5e9('0x2'));var timeout=require(_0xc5e9('0x3'));var express=require('express');var router=express[_0xc5e9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5e9('0x5'));var interaction=require(_0xc5e9('0x6'));var config=require('../../config/environment');var controller=require('./cloudProvider.controller');router[_0xc5e9('0x7')]('/',auth['isAuthenticated'](),controller[_0xc5e9('0x8')]);router[_0xc5e9('0x7')](_0xc5e9('0x9'),auth[_0xc5e9('0xa')](),controller['show']);router[_0xc5e9('0xb')]('/',auth[_0xc5e9('0xa')](),controller[_0xc5e9('0xc')]);router['put'](_0xc5e9('0x9'),auth[_0xc5e9('0xa')](),controller[_0xc5e9('0xd')]);router[_0xc5e9('0xe')](_0xc5e9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xc5e9('0xf')]=router; \ No newline at end of file +var _0xf811=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xf811,0x6f));var _0x1f81=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf811[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var timeout=require(_0x1f81('0x3'));var express=require(_0x1f81('0x4'));var router=express[_0x1f81('0x5')]();var fs_extra=require(_0x1f81('0x6'));var auth=require(_0x1f81('0x7'));var interaction=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var controller=require(_0x1f81('0xa'));router[_0x1f81('0xb')]('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0xd')]);router['get'](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0xf')]);router['post']('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0x10')]);router['put'](_0x1f81('0xe'),auth['isAuthenticated'](),controller[_0x1f81('0x11')]);router[_0x1f81('0x12')](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0x13')]);module[_0x1f81('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 1d8aa40..fbaf563 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 _0xecc0=['STRING','sequelize','exports'];(function(_0x22995b,_0x424d97){var _0x58248a=function(_0x35b31b){while(--_0x35b31b){_0x22995b['push'](_0x22995b['shift']());}};_0x58248a(++_0x424d97);}(_0xecc0,0x9d));var _0x0ecc=function(_0x539312,_0x3a229a){_0x539312=_0x539312-0x0;var _0x1a551f=_0xecc0[_0x539312];return _0x1a551f;};'use strict';var Sequelize=require(_0x0ecc('0x0'));module[_0x0ecc('0x1')]={'name':{'type':Sequelize[_0x0ecc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0ecc('0x2')]},'companyId':{'type':Sequelize[_0x0ecc('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0ecc('0x2')]},'fax':{'type':Sequelize[_0x0ecc('0x2')]},'type':{'type':Sequelize[_0x0ecc('0x2')]},'street':{'type':Sequelize[_0x0ecc('0x2')]},'postalCode':{'type':Sequelize[_0x0ecc('0x2')]},'city':{'type':Sequelize[_0x0ecc('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0ecc('0x2')]},'sStreet':{'type':Sequelize[_0x0ecc('0x2')]},'sPostalCode':{'type':Sequelize[_0x0ecc('0x2')]},'sCity':{'type':Sequelize[_0x0ecc('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0ecc('0x2')]}}; \ No newline at end of file +var _0x84fe=['exports','STRING','name','sequelize'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x84fe,0xdb));var _0xe84f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84fe[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xe84f('0x0'));module[_0xe84f('0x1')]={'name':{'type':Sequelize[_0xe84f('0x2')],'unique':_0xe84f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe84f('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe84f('0x2')]},'fax':{'type':Sequelize[_0xe84f('0x2')]},'type':{'type':Sequelize[_0xe84f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe84f('0x2')]},'city':{'type':Sequelize[_0xe84f('0x2')]},'country':{'type':Sequelize[_0xe84f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe84f('0x2')]},'sStreet':{'type':Sequelize[_0xe84f('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe84f('0x2')]},'sCountry':{'type':Sequelize['STRING']},'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 40cfe8a..c0cdf3c 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 _0x4bac=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','ids','findOne','rawAttributes','offset','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','status','set','reject','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','find','create','user','role','Companies','UserProfileSection'];(function(_0x3690a6,_0x29eb84){var _0x1cb19a=function(_0x39f070){while(--_0x39f070){_0x3690a6['push'](_0x3690a6['shift']());}};_0x1cb19a(++_0x29eb84);}(_0x4bac,0x11e));var _0xc4ba=function(_0x4964a5,_0xa71dcf){_0x4964a5=_0x4964a5-0x0;var _0x2ac928=_0x4bac[_0x4964a5];return _0x2ac928;};'use strict';var emlformat=require(_0xc4ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4ba('0x1'));var jsonpatch=require(_0xc4ba('0x2'));var rp=require(_0xc4ba('0x3'));var moment=require(_0xc4ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4ba('0x5'));var util=require(_0xc4ba('0x6'));var path=require(_0xc4ba('0x7'));var sox=require(_0xc4ba('0x8'));var csv=require(_0xc4ba('0x9'));var ejs=require(_0xc4ba('0xa'));var fs=require('fs');var fs_extra=require(_0xc4ba('0xb'));var _=require(_0xc4ba('0xc'));var squel=require(_0xc4ba('0xd'));var crypto=require(_0xc4ba('0xe'));var jsforce=require(_0xc4ba('0xf'));var deskjs=require(_0xc4ba('0x10'));var toCsv=require(_0xc4ba('0x9'));var querystring=require(_0xc4ba('0x11'));var Papa=require(_0xc4ba('0x12'));var Redis=require('ioredis');var authService=require(_0xc4ba('0x13'));var qs=require(_0xc4ba('0x14'));var as=require(_0xc4ba('0x15'));var hardwareService=require(_0xc4ba('0x16'));var logger=require('../../config/logger')(_0xc4ba('0x17'));var utils=require(_0xc4ba('0x18'));var config=require(_0xc4ba('0x19'));var licenseUtil=require(_0xc4ba('0x1a'));var db=require(_0xc4ba('0x1b'))['db'];function respondWithStatusCode(_0x7b1857,_0x271933){_0x271933=_0x271933||0xcc;return function(_0x144310){if(_0x144310){return _0x7b1857['sendStatus'](_0x271933);}return _0x7b1857['status'](_0x271933)[_0xc4ba('0x1c')]();};}function respondWithResult(_0x23e0e0,_0x5ec54f){_0x5ec54f=_0x5ec54f||0xc8;return function(_0x2cbea8){if(_0x2cbea8){return _0x23e0e0['status'](_0x5ec54f)[_0xc4ba('0x1d')](_0x2cbea8);}};}function respondWithFilteredResult(_0x28ee35,_0x3bc723){return function(_0x24eaf5){if(_0x24eaf5){var _0x547247=typeof _0x3bc723['offset']===_0xc4ba('0x1e')&&typeof _0x3bc723[_0xc4ba('0x1f')]===_0xc4ba('0x1e');var _0x2243e1=_0x24eaf5[_0xc4ba('0x20')];var _0x783757=_0x547247?0x0:_0x3bc723['offset'];var _0x6361e3=_0x547247?_0x24eaf5['count']:_0x3bc723['offset']+_0x3bc723[_0xc4ba('0x1f')];var _0x35152a;if(_0x6361e3>=_0x2243e1){_0x6361e3=_0x2243e1;_0x35152a=0xc8;}else{_0x35152a=0xce;}_0x28ee35[_0xc4ba('0x21')](_0x35152a);return _0x28ee35[_0xc4ba('0x22')]('Content-Range',_0x783757+'-'+_0x6361e3+'/'+_0x2243e1)[_0xc4ba('0x1d')](_0x24eaf5);}return null;};}function patchUpdates(_0x4b4d62){return function(_0x13c235){try{jsonpatch['apply'](_0x13c235,_0x4b4d62,!![]);}catch(_0x37b967){return BPromise[_0xc4ba('0x23')](_0x37b967);}return _0x13c235['save']();};}function saveUpdates(_0x4fb1ca,_0x5bb88d){return function(_0x1d0f60){if(_0x1d0f60){return _0x1d0f60[_0xc4ba('0x24')](_0x4fb1ca)['then'](function(_0x2c4ca9){return _0x2c4ca9;});}return null;};}function removeEntity(_0xc935ba,_0x2c68dd){return function(_0x405f39){if(_0x405f39){return _0x405f39['destroy']()[_0xc4ba('0x25')](function(){var _0x324811=_0x405f39[_0xc4ba('0x26')]({'plain':!![]});var _0x30b0f2='Companies';return db[_0xc4ba('0x27')][_0xc4ba('0x28')]({'where':{'type':_0x30b0f2,'resourceId':_0x324811['id']}})[_0xc4ba('0x25')](function(){return _0x405f39;});})['then'](function(){_0xc935ba[_0xc4ba('0x21')](0xcc)[_0xc4ba('0x1c')]();});}};}function handleEntityNotFound(_0x3483cd,_0x576084){return function(_0x749f22){if(!_0x749f22){_0x3483cd[_0xc4ba('0x29')](0x194);}return _0x749f22;};}function handleError(_0x3ac158,_0x38e05c){_0x38e05c=_0x38e05c||0x1f4;return function(_0x238b5f){logger[_0xc4ba('0x2a')](_0x238b5f[_0xc4ba('0x2b')]);if(_0x238b5f[_0xc4ba('0x2c')]){delete _0x238b5f[_0xc4ba('0x2c')];}_0x3ac158[_0xc4ba('0x21')](_0x38e05c)[_0xc4ba('0x2d')](_0x238b5f);};}exports['index']=function(_0x584531,_0x49bf70){var _0x577345={},_0x3f34fa={},_0x3e6296={'count':0x0,'rows':[]};return db['CmCompany'][_0xc4ba('0x2e')]()[_0xc4ba('0x25')](function(_0x3d28e3){_0x3f34fa[_0xc4ba('0x2f')]=_[_0xc4ba('0x30')](_0x3d28e3);_0x3f34fa['query']=_[_0xc4ba('0x30')](_0x584531[_0xc4ba('0x31')]);_0x3f34fa[_0xc4ba('0x32')]=_[_0xc4ba('0x33')](_0x3f34fa[_0xc4ba('0x2f')],_0x3f34fa[_0xc4ba('0x31')]);_0x577345[_0xc4ba('0x34')]=_[_0xc4ba('0x33')](_0x3f34fa[_0xc4ba('0x2f')],qs[_0xc4ba('0x35')](_0x584531[_0xc4ba('0x31')][_0xc4ba('0x35')]));_0x577345[_0xc4ba('0x34')]=_0x577345[_0xc4ba('0x34')][_0xc4ba('0x36')]?_0x577345[_0xc4ba('0x34')]:_0x3f34fa[_0xc4ba('0x2f')];if(!_0x584531[_0xc4ba('0x31')][_0xc4ba('0x37')](_0xc4ba('0x38'))){_0x577345['limit']=qs[_0xc4ba('0x1f')](_0x584531[_0xc4ba('0x31')][_0xc4ba('0x1f')]);_0x577345['offset']=qs['offset'](_0x584531[_0xc4ba('0x31')]['offset']);}_0x577345[_0xc4ba('0x39')]=qs[_0xc4ba('0x3a')](_0x584531[_0xc4ba('0x31')][_0xc4ba('0x3a')]);_0x577345[_0xc4ba('0x3b')]=qs[_0xc4ba('0x32')](_[_0xc4ba('0x3c')](_0x584531[_0xc4ba('0x31')],_0x3f34fa[_0xc4ba('0x32')]),_0x3d28e3);if(_0x584531[_0xc4ba('0x31')]['filter']){_0x577345[_0xc4ba('0x3b')]=_[_0xc4ba('0x3d')](_0x577345['where'],{'$or':_[_0xc4ba('0x3e')](_0x577345[_0xc4ba('0x34')],function(_0x2e4d5f){var _0x3fa14f={};_0x3fa14f[_0x2e4d5f]={'$like':'%'+_0x584531['query'][_0xc4ba('0x3f')]+'%'};return _0x3fa14f;})});}_0x577345=_[_0xc4ba('0x3d')]({},_0x577345,_0x584531[_0xc4ba('0x40')]);var _0x5b9872={'where':_0x577345['where']};return db[_0xc4ba('0x41')][_0xc4ba('0x20')](_0x5b9872)[_0xc4ba('0x25')](function(_0x106b21){_0x3e6296[_0xc4ba('0x20')]=_0x106b21;if(_0x584531[_0xc4ba('0x31')][_0xc4ba('0x42')]){_0x577345[_0xc4ba('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0xc4ba('0x44')](_0x577345);})[_0xc4ba('0x25')](function(_0x254fd7){_0x3e6296[_0xc4ba('0x45')]=_0x254fd7;return _0x3e6296;})[_0xc4ba('0x25')](respondWithFilteredResult(_0x49bf70,_0x577345))[_0xc4ba('0x46')](handleError(_0x49bf70,null));})[_0xc4ba('0x46')](handleError(_0x49bf70,null));};exports[_0xc4ba('0x47')]=function(_0x1c9f73,_0x245f9c){var _0x4b008b={'raw':![],'where':{'id':_0x1c9f73['params']['id']}},_0x2ea118={};_0x2ea118['model']=_['keys'](db['CmCompany']['rawAttributes']);_0x2ea118[_0xc4ba('0x31')]=_[_0xc4ba('0x30')](_0x1c9f73['query']);_0x2ea118[_0xc4ba('0x32')]=_[_0xc4ba('0x33')](_0x2ea118[_0xc4ba('0x2f')],_0x2ea118[_0xc4ba('0x31')]);_0x4b008b['attributes']=_[_0xc4ba('0x33')](_0x2ea118[_0xc4ba('0x2f')],qs[_0xc4ba('0x35')](_0x1c9f73[_0xc4ba('0x31')]['fields']));_0x4b008b[_0xc4ba('0x34')]=_0x4b008b[_0xc4ba('0x34')][_0xc4ba('0x36')]?_0x4b008b[_0xc4ba('0x34')]:_0x2ea118['model'];if(_0x1c9f73[_0xc4ba('0x31')][_0xc4ba('0x42')]){_0x4b008b[_0xc4ba('0x43')]=[{'all':!![]}];}_0x4b008b=_[_0xc4ba('0x3d')]({},_0x4b008b,_0x1c9f73[_0xc4ba('0x40')]);return db['CmCompany'][_0xc4ba('0x48')](_0x4b008b)[_0xc4ba('0x25')](handleEntityNotFound(_0x245f9c,null))[_0xc4ba('0x25')](respondWithResult(_0x245f9c,null))[_0xc4ba('0x46')](handleError(_0x245f9c,null));};exports['create']=function(_0x4a1e9e,_0x44fc20){return db[_0xc4ba('0x41')][_0xc4ba('0x49')](_0x4a1e9e['body'],{})[_0xc4ba('0x25')](function(_0x380529){var _0x42c663=_0x4a1e9e[_0xc4ba('0x4a')][_0xc4ba('0x26')]({'plain':!![]});if(!_0x42c663)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42c663[_0xc4ba('0x4b')]===_0xc4ba('0x4a')){var _0x19f241=_0x380529[_0xc4ba('0x26')]({'plain':!![]});var _0x68f449=_0xc4ba('0x4c');return db[_0xc4ba('0x4d')][_0xc4ba('0x48')]({'where':{'name':_0x68f449,'userProfileId':_0x42c663[_0xc4ba('0x4e')]},'raw':!![]})['then'](function(_0x4c83a4){if(_0x4c83a4&&_0x4c83a4[_0xc4ba('0x4f')]===0x0){return db[_0xc4ba('0x27')]['create']({'name':_0x19f241[_0xc4ba('0x2c')],'resourceId':_0x19f241['id'],'type':_0x4c83a4[_0xc4ba('0x2c')],'sectionId':_0x4c83a4['id']},{})[_0xc4ba('0x25')](function(){return _0x380529;});}else{return _0x380529;}})[_0xc4ba('0x46')](function(_0x27c4d4){logger[_0xc4ba('0x2a')](_0xc4ba('0x50'),_0x27c4d4);throw _0x27c4d4;});}return _0x380529;})[_0xc4ba('0x25')](respondWithResult(_0x44fc20,0xc9))['catch'](handleError(_0x44fc20,null));};exports[_0xc4ba('0x24')]=function(_0xe1d628,_0x221e92){if(_0xe1d628[_0xc4ba('0x51')]['id']){delete _0xe1d628[_0xc4ba('0x51')]['id'];}return db[_0xc4ba('0x41')][_0xc4ba('0x48')]({'where':{'id':_0xe1d628[_0xc4ba('0x52')]['id']}})[_0xc4ba('0x25')](handleEntityNotFound(_0x221e92,null))['then'](saveUpdates(_0xe1d628['body'],null))[_0xc4ba('0x25')](respondWithResult(_0x221e92,null))[_0xc4ba('0x46')](handleError(_0x221e92,null));};exports[_0xc4ba('0x28')]=function(_0x51a54c,_0x48bd2f){return db[_0xc4ba('0x41')]['find']({'where':{'id':_0x51a54c[_0xc4ba('0x52')]['id']}})[_0xc4ba('0x25')](handleEntityNotFound(_0x48bd2f,null))[_0xc4ba('0x25')](removeEntity(_0x48bd2f,null))[_0xc4ba('0x46')](handleError(_0x48bd2f,null));};exports[_0xc4ba('0x2e')]=function(_0x3af8c7,_0xbb89da){return db[_0xc4ba('0x41')][_0xc4ba('0x2e')]()[_0xc4ba('0x25')](respondWithResult(_0xbb89da,null))[_0xc4ba('0x46')](handleError(_0xbb89da,null));};exports[_0xc4ba('0x53')]=function(_0xf590b4,_0x1f8eae,_0x47c76b){return db[_0xc4ba('0x54')][_0xc4ba('0x48')]({'where':{'id':_0xf590b4[_0xc4ba('0x52')]['id']}})['then'](handleEntityNotFound(_0x1f8eae,null))[_0xc4ba('0x25')](function(_0x156481){if(_0x156481){return _0x156481[_0xc4ba('0x53')](_0xf590b4[_0xc4ba('0x51')]['ids'],_[_0xc4ba('0x55')](_0xf590b4[_0xc4ba('0x51')],[_0xc4ba('0x56'),'id'])||{});}})[_0xc4ba('0x25')](respondWithResult(_0x1f8eae,null))['catch'](handleError(_0x1f8eae,null));};exports['getContacts']=function(_0x32efbf,_0x4275d9,_0xac7a55){var _0x464d53={};var _0x5790b1={};var _0x3c8c25;var _0x138884;return db['CmCompany'][_0xc4ba('0x57')]({'where':{'id':_0x32efbf[_0xc4ba('0x52')]['id']}})[_0xc4ba('0x25')](handleEntityNotFound(_0x4275d9,null))['then'](function(_0x1abc60){if(_0x1abc60){_0x3c8c25=_0x1abc60;_0x5790b1[_0xc4ba('0x2f')]=_[_0xc4ba('0x30')](db[_0xc4ba('0x54')][_0xc4ba('0x58')]);_0x5790b1['query']=_[_0xc4ba('0x30')](_0x32efbf['query']);_0x5790b1[_0xc4ba('0x32')]=_['intersection'](_0x5790b1['model'],_0x5790b1[_0xc4ba('0x31')]);_0x464d53[_0xc4ba('0x34')]=_[_0xc4ba('0x33')](_0x5790b1[_0xc4ba('0x2f')],qs[_0xc4ba('0x35')](_0x32efbf[_0xc4ba('0x31')][_0xc4ba('0x35')]));_0x464d53[_0xc4ba('0x34')]=_0x464d53['attributes'][_0xc4ba('0x36')]?_0x464d53['attributes']:_0x5790b1[_0xc4ba('0x2f')];_0x464d53[_0xc4ba('0x39')]=qs[_0xc4ba('0x3a')](_0x32efbf[_0xc4ba('0x31')][_0xc4ba('0x3a')]);_0x464d53[_0xc4ba('0x3b')]=qs[_0xc4ba('0x32')](_[_0xc4ba('0x3c')](_0x32efbf[_0xc4ba('0x31')],_0x5790b1[_0xc4ba('0x32')]));if(_0x32efbf['query'][_0xc4ba('0x3f')]){_0x464d53[_0xc4ba('0x3b')]=_[_0xc4ba('0x3d')](_0x464d53[_0xc4ba('0x3b')],{'$or':_[_0xc4ba('0x3e')](_0x464d53[_0xc4ba('0x34')],function(_0x34df76){var _0x4967fc={};_0x4967fc[_0x34df76]={'$like':'%'+_0x32efbf[_0xc4ba('0x31')][_0xc4ba('0x3f')]+'%'};return _0x4967fc;})});}_0x464d53=_[_0xc4ba('0x3d')]({},_0x464d53,_0x32efbf['options']);return _0x3c8c25['getContacts'](_0x464d53);}})[_0xc4ba('0x25')](function(_0x27ce84){if(_0x27ce84){_0x138884=_0x27ce84['length'];if(!_0x32efbf[_0xc4ba('0x31')][_0xc4ba('0x37')](_0xc4ba('0x38'))){_0x464d53['limit']=qs[_0xc4ba('0x1f')](_0x32efbf[_0xc4ba('0x31')]['limit']);_0x464d53['offset']=qs[_0xc4ba('0x59')](_0x32efbf[_0xc4ba('0x31')][_0xc4ba('0x59')]);}return _0x3c8c25[_0xc4ba('0x5a')](_0x464d53);}})[_0xc4ba('0x25')](function(_0x215381){if(_0x215381){return _0x215381?{'count':_0x138884,'rows':_0x215381}:null;}})[_0xc4ba('0x25')](respondWithResult(_0x4275d9,null))[_0xc4ba('0x46')](handleError(_0x4275d9,null));}; \ No newline at end of file +var _0x7bbc=['sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x361dfc,_0x340a4a){var _0x1e1bf2=function(_0x74ba1c){while(--_0x74ba1c){_0x361dfc['push'](_0x361dfc['shift']());}};_0x1e1bf2(++_0x340a4a);}(_0x7bbc,0x148));var _0xc7bb=function(_0x2f0f20,_0xe6bbea){_0x2f0f20=_0x2f0f20-0x0;var _0x2c342e=_0x7bbc[_0x2f0f20];return _0x2c342e;};'use strict';var emlformat=require(_0xc7bb('0x0'));var rimraf=require(_0xc7bb('0x1'));var zipdir=require(_0xc7bb('0x2'));var jsonpatch=require(_0xc7bb('0x3'));var rp=require(_0xc7bb('0x4'));var moment=require(_0xc7bb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7bb('0x6'));var path=require(_0xc7bb('0x7'));var sox=require(_0xc7bb('0x8'));var csv=require(_0xc7bb('0x9'));var ejs=require(_0xc7bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc7bb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7bb('0xc'));var toCsv=require(_0xc7bb('0x9'));var querystring=require(_0xc7bb('0xd'));var Papa=require(_0xc7bb('0xe'));var Redis=require(_0xc7bb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc7bb('0x10'));var as=require(_0xc7bb('0x11'));var hardwareService=require(_0xc7bb('0x12'));var logger=require(_0xc7bb('0x13'))(_0xc7bb('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x301acf,_0x24853c){_0x24853c=_0x24853c||0xcc;return function(_0x15c1a7){if(_0x15c1a7){return _0x301acf['sendStatus'](_0x24853c);}return _0x301acf[_0xc7bb('0x16')](_0x24853c)[_0xc7bb('0x17')]();};}function respondWithResult(_0x2f0c02,_0x125b74){_0x125b74=_0x125b74||0xc8;return function(_0x448e4a){if(_0x448e4a){return _0x2f0c02[_0xc7bb('0x16')](_0x125b74)['json'](_0x448e4a);}};}function respondWithFilteredResult(_0x3dc185,_0x10b5ff){return function(_0x1f85fd){if(_0x1f85fd){var _0x2b7649=typeof _0x10b5ff[_0xc7bb('0x18')]===_0xc7bb('0x19')&&typeof _0x10b5ff[_0xc7bb('0x1a')]===_0xc7bb('0x19');var _0x5d5136=_0x1f85fd[_0xc7bb('0x1b')];var _0x1c7740=_0x2b7649?0x0:_0x10b5ff[_0xc7bb('0x18')];var _0x3f8cb9=_0x2b7649?_0x1f85fd['count']:_0x10b5ff[_0xc7bb('0x18')]+_0x10b5ff['limit'];var _0x3ed0f2;if(_0x3f8cb9>=_0x5d5136){_0x3f8cb9=_0x5d5136;_0x3ed0f2=0xc8;}else{_0x3ed0f2=0xce;}_0x3dc185[_0xc7bb('0x16')](_0x3ed0f2);return _0x3dc185['set'](_0xc7bb('0x1c'),_0x1c7740+'-'+_0x3f8cb9+'/'+_0x5d5136)[_0xc7bb('0x1d')](_0x1f85fd);}return null;};}function patchUpdates(_0x1293f4){return function(_0x1547e5){try{jsonpatch[_0xc7bb('0x1e')](_0x1547e5,_0x1293f4,!![]);}catch(_0x1a9350){return BPromise['reject'](_0x1a9350);}return _0x1547e5[_0xc7bb('0x1f')]();};}function saveUpdates(_0x17228f,_0x41b2e7){return function(_0x2ad6e9){if(_0x2ad6e9){return _0x2ad6e9[_0xc7bb('0x20')](_0x17228f)['then'](function(_0x2c1754){return _0x2c1754;});}return null;};}function removeEntity(_0x2a64ce,_0x25c444){return function(_0x44ec9e){if(_0x44ec9e){return _0x44ec9e[_0xc7bb('0x21')]()[_0xc7bb('0x22')](function(){var _0x30b30d=_0x44ec9e[_0xc7bb('0x23')]({'plain':!![]});var _0x137713='Companies';return db[_0xc7bb('0x24')][_0xc7bb('0x21')]({'where':{'type':_0x137713,'resourceId':_0x30b30d['id']}})['then'](function(){return _0x44ec9e;});})[_0xc7bb('0x22')](function(){_0x2a64ce[_0xc7bb('0x16')](0xcc)[_0xc7bb('0x17')]();});}};}function handleEntityNotFound(_0x431c2d,_0x392330){return function(_0x14108d){if(!_0x14108d){_0x431c2d[_0xc7bb('0x25')](0x194);}return _0x14108d;};}function handleError(_0x4386d4,_0x48cc44){_0x48cc44=_0x48cc44||0x1f4;return function(_0x12b6f3){logger[_0xc7bb('0x26')](_0x12b6f3[_0xc7bb('0x27')]);if(_0x12b6f3[_0xc7bb('0x28')]){delete _0x12b6f3['name'];}_0x4386d4[_0xc7bb('0x16')](_0x48cc44)[_0xc7bb('0x29')](_0x12b6f3);};}exports['index']=function(_0x2588e3,_0x29e6a6){var _0x195ed3={},_0x28f04d={},_0x177d11={'count':0x0,'rows':[]};return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](function(_0x4198c2){_0x28f04d[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](_0x4198c2);_0x28f04d[_0xc7bb('0x2e')]=_['keys'](_0x2588e3[_0xc7bb('0x2e')]);_0x28f04d[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],_0x28f04d[_0xc7bb('0x2e')]);_0x195ed3[_0xc7bb('0x31')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x2588e3[_0xc7bb('0x2e')]['fields']));_0x195ed3['attributes']=_0x195ed3['attributes'][_0xc7bb('0x33')]?_0x195ed3['attributes']:_0x28f04d[_0xc7bb('0x2c')];if(!_0x2588e3['query'][_0xc7bb('0x34')](_0xc7bb('0x35'))){_0x195ed3[_0xc7bb('0x1a')]=qs[_0xc7bb('0x1a')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x195ed3[_0xc7bb('0x18')]=qs[_0xc7bb('0x18')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x18')]);}_0x195ed3['order']=qs[_0xc7bb('0x36')](_0x2588e3['query'][_0xc7bb('0x36')]);_0x195ed3[_0xc7bb('0x37')]=qs[_0xc7bb('0x2f')](_[_0xc7bb('0x38')](_0x2588e3[_0xc7bb('0x2e')],_0x28f04d[_0xc7bb('0x2f')]),_0x4198c2);if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x195ed3['where']=_[_0xc7bb('0x3a')](_0x195ed3[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x195ed3[_0xc7bb('0x31')],function(_0xf3867d){var _0x270f26={};_0x270f26[_0xf3867d]={'$like':'%'+_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x270f26;})});}_0x195ed3=_[_0xc7bb('0x3a')]({},_0x195ed3,_0x2588e3[_0xc7bb('0x3c')]);var _0x3dc31c={'where':_0x195ed3[_0xc7bb('0x37')]};return db['CmCompany'][_0xc7bb('0x1b')](_0x3dc31c)[_0xc7bb('0x22')](function(_0x49afe9){_0x177d11[_0xc7bb('0x1b')]=_0x49afe9;if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x3d')]){_0x195ed3['include']=[{'all':!![]}];}return db['CmCompany'][_0xc7bb('0x3e')](_0x195ed3);})[_0xc7bb('0x22')](function(_0x2dd8e5){_0x177d11[_0xc7bb('0x3f')]=_0x2dd8e5;return _0x177d11;})[_0xc7bb('0x22')](respondWithFilteredResult(_0x29e6a6,_0x195ed3))[_0xc7bb('0x40')](handleError(_0x29e6a6,null));})[_0xc7bb('0x40')](handleError(_0x29e6a6,null));};exports[_0xc7bb('0x41')]=function(_0x17fa39,_0x5f60f5){var _0x42cc07={'raw':![],'where':{'id':_0x17fa39[_0xc7bb('0x42')]['id']}},_0x211655={};_0x211655['model']=_[_0xc7bb('0x2d')](db[_0xc7bb('0x2a')][_0xc7bb('0x43')]);_0x211655[_0xc7bb('0x2e')]=_[_0xc7bb('0x2d')](_0x17fa39[_0xc7bb('0x2e')]);_0x211655[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x211655[_0xc7bb('0x2c')],_0x211655[_0xc7bb('0x2e')]);_0x42cc07['attributes']=_['intersection'](_0x211655[_0xc7bb('0x2c')],qs['fields'](_0x17fa39[_0xc7bb('0x2e')][_0xc7bb('0x32')]));_0x42cc07[_0xc7bb('0x31')]=_0x42cc07['attributes'][_0xc7bb('0x33')]?_0x42cc07[_0xc7bb('0x31')]:_0x211655[_0xc7bb('0x2c')];if(_0x17fa39['query']['includeAll']){_0x42cc07['include']=[{'all':!![]}];}_0x42cc07=_['merge']({},_0x42cc07,_0x17fa39[_0xc7bb('0x3c')]);return db[_0xc7bb('0x2a')]['find'](_0x42cc07)['then'](handleEntityNotFound(_0x5f60f5,null))['then'](respondWithResult(_0x5f60f5,null))['catch'](handleError(_0x5f60f5,null));};exports['create']=function(_0x4c9ff7,_0x364445){return db['CmCompany'][_0xc7bb('0x44')](_0x4c9ff7[_0xc7bb('0x45')],{})['then'](function(_0x2881d3){var _0x20f1ac=_0x4c9ff7['user'][_0xc7bb('0x23')]({'plain':!![]});if(!_0x20f1ac)throw new Error(_0xc7bb('0x46'));if(_0x20f1ac[_0xc7bb('0x47')]===_0xc7bb('0x48')){var _0x1c9e50=_0x2881d3[_0xc7bb('0x23')]({'plain':!![]});var _0x154279=_0xc7bb('0x49');return db[_0xc7bb('0x4a')][_0xc7bb('0x4b')]({'where':{'name':_0x154279,'userProfileId':_0x20f1ac['userProfileId']},'raw':!![]})[_0xc7bb('0x22')](function(_0x54e3da){if(_0x54e3da&&_0x54e3da['autoAssociation']===0x0){return db[_0xc7bb('0x24')][_0xc7bb('0x44')]({'name':_0x1c9e50[_0xc7bb('0x28')],'resourceId':_0x1c9e50['id'],'type':_0x54e3da[_0xc7bb('0x28')],'sectionId':_0x54e3da['id']},{})['then'](function(){return _0x2881d3;});}else{return _0x2881d3;}})['catch'](function(_0xe3ae2b){logger[_0xc7bb('0x26')](_0xc7bb('0x4c'),_0xe3ae2b);throw _0xe3ae2b;});}return _0x2881d3;})[_0xc7bb('0x22')](respondWithResult(_0x364445,0xc9))['catch'](handleError(_0x364445,null));};exports[_0xc7bb('0x20')]=function(_0x31fb60,_0x34f281){if(_0x31fb60[_0xc7bb('0x45')]['id']){delete _0x31fb60[_0xc7bb('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x31fb60[_0xc7bb('0x42')]['id']}})[_0xc7bb('0x22')](handleEntityNotFound(_0x34f281,null))[_0xc7bb('0x22')](saveUpdates(_0x31fb60['body'],null))[_0xc7bb('0x22')](respondWithResult(_0x34f281,null))['catch'](handleError(_0x34f281,null));};exports['destroy']=function(_0x3c225c,_0x3fe6bf){return db[_0xc7bb('0x2a')][_0xc7bb('0x4b')]({'where':{'id':_0x3c225c[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fe6bf,null))[_0xc7bb('0x22')](removeEntity(_0x3fe6bf,null))[_0xc7bb('0x40')](handleError(_0x3fe6bf,null));};exports['describe']=function(_0x320e76,_0x20319d){return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](respondWithResult(_0x20319d,null))[_0xc7bb('0x40')](handleError(_0x20319d,null));};exports[_0xc7bb('0x4d')]=function(_0x41689e,_0x306a81,_0x3a7918){return db['CmContact'][_0xc7bb('0x4b')]({'where':{'id':_0x41689e['params']['id']}})['then'](handleEntityNotFound(_0x306a81,null))['then'](function(_0x54b3b4){if(_0x54b3b4){return _0x54b3b4[_0xc7bb('0x4d')](_0x41689e['body'][_0xc7bb('0x4e')],_[_0xc7bb('0x4f')](_0x41689e[_0xc7bb('0x45')],[_0xc7bb('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x306a81,null))[_0xc7bb('0x40')](handleError(_0x306a81,null));};exports[_0xc7bb('0x50')]=function(_0x534652,_0x45eafb,_0x1decb1){var _0x58c189={};var _0x485aa8={};var _0x583eb8;var _0x73da9b;return db[_0xc7bb('0x2a')][_0xc7bb('0x51')]({'where':{'id':_0x534652[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x45eafb,null))['then'](function(_0x5b0bcc){if(_0x5b0bcc){_0x583eb8=_0x5b0bcc;_0x485aa8[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](db[_0xc7bb('0x52')][_0xc7bb('0x43')]);_0x485aa8['query']=_[_0xc7bb('0x2d')](_0x534652[_0xc7bb('0x2e')]);_0x485aa8[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x485aa8[_0xc7bb('0x2c')],_0x485aa8[_0xc7bb('0x2e')]);_0x58c189[_0xc7bb('0x31')]=_['intersection'](_0x485aa8[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x534652[_0xc7bb('0x2e')]['fields']));_0x58c189['attributes']=_0x58c189['attributes']['length']?_0x58c189[_0xc7bb('0x31')]:_0x485aa8['model'];_0x58c189[_0xc7bb('0x53')]=qs[_0xc7bb('0x36')](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x36')]);_0x58c189[_0xc7bb('0x37')]=qs['filters'](_[_0xc7bb('0x38')](_0x534652[_0xc7bb('0x2e')],_0x485aa8[_0xc7bb('0x2f')]));if(_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x58c189['where']=_[_0xc7bb('0x3a')](_0x58c189[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x58c189[_0xc7bb('0x31')],function(_0x3801b3){var _0x5a5826={};_0x5a5826[_0x3801b3]={'$like':'%'+_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x5a5826;})});}_0x58c189=_[_0xc7bb('0x3a')]({},_0x58c189,_0x534652[_0xc7bb('0x3c')]);return _0x583eb8['getContacts'](_0x58c189);}})['then'](function(_0x126326){if(_0x126326){_0x73da9b=_0x126326[_0xc7bb('0x33')];if(!_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x34')]('nolimit')){_0x58c189[_0xc7bb('0x1a')]=qs['limit'](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x58c189['offset']=qs[_0xc7bb('0x18')](_0x534652[_0xc7bb('0x2e')]['offset']);}return _0x583eb8[_0xc7bb('0x50')](_0x58c189);}})[_0xc7bb('0x22')](function(_0x221cd7){if(_0x221cd7){return _0x221cd7?{'count':_0x73da9b,'rows':_0x221cd7}:null;}})[_0xc7bb('0x22')](respondWithResult(_0x45eafb,null))['catch'](handleError(_0x45eafb,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 76995df..ae1d1bb 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 _0x17da=['path','rimraf','./cmCompany.attributes','exports','CmCompany','lodash','util','api','moment','request-promise'];(function(_0x136a0a,_0x5a05d1){var _0x8c8877=function(_0x57ee8e){while(--_0x57ee8e){_0x136a0a['push'](_0x136a0a['shift']());}};_0x8c8877(++_0x5a05d1);}(_0x17da,0xeb));var _0xa17d=function(_0x152de3,_0x1d6138){_0x152de3=_0x152de3-0x0;var _0x8c588f=_0x17da[_0x152de3];return _0x8c588f;};'use strict';var _=require(_0xa17d('0x0'));var util=require(_0xa17d('0x1'));var logger=require('../../config/logger')(_0xa17d('0x2'));var moment=require(_0xa17d('0x3'));var BPromise=require('bluebird');var rp=require(_0xa17d('0x4'));var fs=require('fs');var path=require(_0xa17d('0x5'));var rimraf=require(_0xa17d('0x6'));var config=require('../../config/environment');var attributes=require(_0xa17d('0x7'));module[_0xa17d('0x8')]=function(_0xd9d13,_0x58e997){return _0xd9d13['define'](_0xa17d('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8740=['CmCompany','lodash','../../config/logger','moment','path','../../config/environment','./cmCompany.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8740,0x1f2));var _0x0874=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8740[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x0874('0x0'));var util=require('util');var logger=require(_0x0874('0x1'))('api');var moment=require(_0x0874('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0874('0x3'));var rimraf=require('rimraf');var config=require(_0x0874('0x4'));var attributes=require(_0x0874('0x5'));module['exports']=function(_0x3acc4d,_0x180c8e){return _0x3acc4d['define'](_0x0874('0x6'),attributes,{'tableName':'cm_companies','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 4f44b02..00637f7 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 _0xaf77=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5355e0,_0x4795d5){var _0x47be4f=function(_0x1b54e6){while(--_0x1b54e6){_0x5355e0['push'](_0x5355e0['shift']());}};_0x47be4f(++_0x4795d5);}(_0xaf77,0xf9));var _0x7af7=function(_0x2e6cb7,_0x11596c){_0x2e6cb7=_0x2e6cb7-0x0;var _0x433ba0=_0xaf77[_0x2e6cb7];return _0x433ba0;};'use strict';var _=require(_0x7af7('0x0'));var util=require(_0x7af7('0x1'));var moment=require(_0x7af7('0x2'));var BPromise=require(_0x7af7('0x3'));var rs=require(_0x7af7('0x4'));var fs=require('fs');var Redis=require(_0x7af7('0x5'));var db=require(_0x7af7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7af7('0x7'))('rpc');var config=require(_0x7af7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7af7('0x9')][_0x7af7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x411d8c,_0x750918,_0x3de9ff){return new BPromise(function(_0x2f9004,_0x50d009){return client[_0x7af7('0xb')](_0x411d8c,_0x3de9ff)['then'](function(_0x29fa3e){logger[_0x7af7('0xc')](_0x7af7('0xd'),_0x750918,_0x7af7('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x750918,'request\x20sent',JSON[_0x7af7('0xf')](_0x29fa3e));if(_0x29fa3e[_0x7af7('0x10')]){if(_0x29fa3e[_0x7af7('0x10')][_0x7af7('0x11')]===0x1f4){logger[_0x7af7('0x10')]('CmCompany,\x20%s,\x20%s',_0x750918,_0x29fa3e[_0x7af7('0x10')]['message']);return _0x50d009(_0x29fa3e['error'][_0x7af7('0x12')]);}logger[_0x7af7('0x10')]('CmCompany,\x20%s,\x20%s',_0x750918,_0x29fa3e[_0x7af7('0x10')]['message']);return _0x2f9004(_0x29fa3e[_0x7af7('0x10')][_0x7af7('0x12')]);}else{logger[_0x7af7('0xc')](_0x7af7('0xd'),_0x750918,'request\x20sent');_0x2f9004(_0x29fa3e[_0x7af7('0x13')][_0x7af7('0x12')]);}})[_0x7af7('0x14')](function(_0x433d4a){logger[_0x7af7('0x10')](_0x7af7('0xd'),_0x750918,_0x433d4a);_0x50d009(_0x433d4a);});});} \ No newline at end of file +var _0x3c7d=['result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5f2073,_0x2199e7){var _0x5034ec=function(_0xeab6cb){while(--_0xeab6cb){_0x5f2073['push'](_0x5f2073['shift']());}};_0x5034ec(++_0x2199e7);}(_0x3c7d,0x6b));var _0xd3c7=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3c7d[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0xd3c7('0x0'));var moment=require('moment');var BPromise=require(_0xd3c7('0x1'));var rs=require(_0xd3c7('0x2'));var fs=require('fs');var Redis=require(_0xd3c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3c7('0x4'))(_0xd3c7('0x5'));var config=require(_0xd3c7('0x6'));var jayson=require(_0xd3c7('0x7'));var client=jayson[_0xd3c7('0x8')][_0xd3c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c093,_0x6c4bb5,_0x12b727){return new BPromise(function(_0x4c5f4b,_0x141f94){return client[_0xd3c7('0xa')](_0x19c093,_0x12b727)[_0xd3c7('0xb')](function(_0x591f6c){logger[_0xd3c7('0xc')](_0xd3c7('0xd'),_0x6c4bb5,_0xd3c7('0xe'));logger['debug'](_0xd3c7('0xf'),_0x6c4bb5,_0xd3c7('0xe'),JSON['stringify'](_0x591f6c));if(_0x591f6c[_0xd3c7('0x10')]){if(_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x11')]===0x1f4){logger['error'](_0xd3c7('0xd'),_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x12')]);return _0x141f94(_0x591f6c[_0xd3c7('0x10')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')]['message']);return _0x4c5f4b(_0x591f6c[_0xd3c7('0x10')]['message']);}else{logger[_0xd3c7('0xc')]('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0xd3c7('0xe'));_0x4c5f4b(_0x591f6c[_0xd3c7('0x13')][_0xd3c7('0x12')]);}})[_0xd3c7('0x14')](function(_0x36f5f1){logger[_0xd3c7('0x10')](_0xd3c7('0xd'),_0x6c4bb5,_0x36f5f1);_0x141f94(_0x36f5f1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 909117e..16e0e68 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 _0x1e77=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','getContacts','post','create','/:id/contacts','put','update','delete','exports','multer','util','path'];(function(_0x93f2f3,_0x4167cb){var _0x1a9983=function(_0x3f3f53){while(--_0x3f3f53){_0x93f2f3['push'](_0x93f2f3['shift']());}};_0x1a9983(++_0x4167cb);}(_0x1e77,0x1cb));var _0x71e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1e77[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x71e7('0x0'));var util=require(_0x71e7('0x1'));var path=require(_0x71e7('0x2'));var timeout=require(_0x71e7('0x3'));var express=require(_0x71e7('0x4'));var router=express[_0x71e7('0x5')]();var fs_extra=require(_0x71e7('0x6'));var auth=require(_0x71e7('0x7'));var interaction=require(_0x71e7('0x8'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x71e7('0x9')]('/',auth['isAuthenticated'](),controller[_0x71e7('0xa')]);router[_0x71e7('0x9')](_0x71e7('0xb'),auth[_0x71e7('0xc')](),controller['describe']);router[_0x71e7('0x9')](_0x71e7('0xd'),auth[_0x71e7('0xc')](),controller['show']);router[_0x71e7('0x9')]('/:id/contacts',auth[_0x71e7('0xc')](),controller[_0x71e7('0xe')]);router[_0x71e7('0xf')]('/',auth[_0x71e7('0xc')](),controller[_0x71e7('0x10')]);router[_0x71e7('0xf')](_0x71e7('0x11'),auth['isAuthenticated'](),controller['addContacts']);router[_0x71e7('0x12')](_0x71e7('0xd'),auth['isAuthenticated'](),controller[_0x71e7('0x13')]);router[_0x71e7('0x14')](_0x71e7('0xd'),auth[_0x71e7('0xc')](),controller['destroy']);module[_0x71e7('0x15')]=router; \ No newline at end of file +var _0xc8a8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util'];(function(_0x4b224f,_0x31706d){var _0x40043f=function(_0x2c8a4e){while(--_0x2c8a4e){_0x4b224f['push'](_0x4b224f['shift']());}};_0x40043f(++_0x31706d);}(_0xc8a8,0x1d2));var _0x8c8a=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xc8a8[_0x1757f2];return _0x5e7212;};'use strict';var multer=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var path=require(_0x8c8a('0x2'));var timeout=require(_0x8c8a('0x3'));var express=require(_0x8c8a('0x4'));var router=express[_0x8c8a('0x5')]();var fs_extra=require(_0x8c8a('0x6'));var auth=require(_0x8c8a('0x7'));var interaction=require(_0x8c8a('0x8'));var config=require(_0x8c8a('0x9'));var controller=require(_0x8c8a('0xa'));router[_0x8c8a('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c8a('0xb')](_0x8c8a('0xc'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0xe')]);router[_0x8c8a('0xb')](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x10')]);router['get'](_0x8c8a('0x11'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x12')]);router[_0x8c8a('0x13')]('/',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x14')]);router[_0x8c8a('0x13')](_0x8c8a('0x11'),auth['isAuthenticated'](),controller[_0x8c8a('0x15')]);router[_0x8c8a('0x16')]('/:id',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x17')]);router['delete'](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x18')]);module[_0x8c8a('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index dad10d8..eafa269 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 _0x3851=['TEXT','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x3b4835,_0x369b93){var _0x5652f2=function(_0x407bc3){while(--_0x407bc3){_0x3b4835['push'](_0x3b4835['shift']());}};_0x5652f2(++_0x369b93);}(_0x3851,0x1e7));var _0x1385=function(_0x301e73,_0x57164d){_0x301e73=_0x301e73-0x0;var _0x222a0a=_0x3851[_0x301e73];return _0x222a0a;};'use strict';var _=require('lodash');var Sequelize=require(_0x1385('0x0'));module[_0x1385('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x1385('0x2')]},'street':{'type':Sequelize[_0x1385('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1385('0x2')]},'country':{'type':Sequelize[_0x1385('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1385('0x3')]},'phone':{'type':Sequelize[_0x1385('0x2')]},'mobile':{'type':Sequelize[_0x1385('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1385('0x2')]},'facebook':{'type':Sequelize[_0x1385('0x2')]},'fb_data':{'type':Sequelize[_0x1385('0x2')]},'twitter':{'type':Sequelize[_0x1385('0x2')]},'skype':{'type':Sequelize[_0x1385('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1385('0x2')]},'line':{'type':Sequelize[_0x1385('0x2')]},'wechat':{'type':Sequelize[_0x1385('0x2')]},'telegram':{'type':Sequelize[_0x1385('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x1385('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1385('0x5')],'defaultValue':Sequelize[_0x1385('0x6')]}}; \ No newline at end of file +var _0xcb1f=['sequelize','STRING','INTEGER','NOW','lodash'];(function(_0xd07878,_0x5c6aa9){var _0x317960=function(_0x3746d0){while(--_0x3746d0){_0xd07878['push'](_0xd07878['shift']());}};_0x317960(++_0x5c6aa9);}(_0xcb1f,0x1e9));var _0xfcb1=function(_0x6abbf3,_0x37eef1){_0x6abbf3=_0x6abbf3-0x0;var _0x36738e=_0xcb1f[_0x6abbf3];return _0x36738e;};'use strict';var _=require(_0xfcb1('0x0'));var Sequelize=require(_0xfcb1('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xfcb1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfcb1('0x2')]},'postalCode':{'type':Sequelize[_0xfcb1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfcb1('0x2')]},'dateOfBirth':{'type':Sequelize[_0xfcb1('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfcb1('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfcb1('0x2')]},'email':{'type':Sequelize[_0xfcb1('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xfcb1('0x2')]},'teams':{'type':Sequelize[_0xfcb1('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xfcb1('0x2')]},'wechat':{'type':Sequelize[_0xfcb1('0x2')]},'telegram':{'type':Sequelize[_0xfcb1('0x2')]},'UserId':{'type':Sequelize[_0xfcb1('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfcb1('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 53b984f..f2d4eb5 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 _0x0381=['CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','join','create','bulkCreate','duplicates','$or','spread','show','color','$and','omit','format','pickBy','cf_%d','table','setFields','id\x20=\x20?','phone','getTags','findOne','rawAttributes','options','setTags','ids','ContactId','getHopperFinals','includeAll','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','child_process','fork','CompanyId','pid','upload','file','path','meta','import','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','sms','openchannel','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','range','startCase','Website','Account','closed','closedAt','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingType','referer','subject','substatus','externalUrl','Interaction','findAndCountAll','flatten','reverse','slice','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','trimStart','all','fieldType','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','buildExpression','start','end','filter','isNil','push','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','clone','having','role','agent','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','params','tags','displayName','findAll','columnName','alias','custom','values','merge','body','get','mergeWith','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s'];(function(_0x691345,_0x41a9f7){var _0x2192f1=function(_0x412624){while(--_0x412624){_0x691345['push'](_0x691345['shift']());}};_0x2192f1(++_0x41a9f7);}(_0x0381,0x1a4));var _0x1038=function(_0x23d309,_0x14d6fc){_0x23d309=_0x23d309-0x0;var _0x18f608=_0x0381[_0x23d309];return _0x18f608;};'use strict';var emlformat=require(_0x1038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1038('0x1'));var jsonpatch=require(_0x1038('0x2'));var rp=require(_0x1038('0x3'));var moment=require(_0x1038('0x4'));var BPromise=require(_0x1038('0x5'));var Mustache=require(_0x1038('0x6'));var util=require(_0x1038('0x7'));var path=require('path');var sox=require(_0x1038('0x8'));var csv=require(_0x1038('0x9'));var ejs=require(_0x1038('0xa'));var fs=require('fs');var fs_extra=require(_0x1038('0xb'));var _=require(_0x1038('0xc'));var squel=require(_0x1038('0xd'));var crypto=require(_0x1038('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1038('0xf'));var toCsv=require(_0x1038('0x9'));var querystring=require(_0x1038('0x10'));var Papa=require(_0x1038('0x11'));var Redis=require(_0x1038('0x12'));var authService=require(_0x1038('0x13'));var qs=require(_0x1038('0x14'));var as=require(_0x1038('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1038('0x16'))('api');var utils=require(_0x1038('0x17'));var config=require(_0x1038('0x18'));var licenseUtil=require(_0x1038('0x19'));var db=require(_0x1038('0x1a'))['db'];config[_0x1038('0x1b')]=_[_0x1038('0x1c')](config[_0x1038('0x1b')],{'host':_0x1038('0x1d'),'port':0x18eb});var socket=require(_0x1038('0x1e'))(new Redis(config['redis']));require(_0x1038('0x1f'))[_0x1038('0x20')](socket);function respondWithStatusCode(_0xe92b,_0x531352){_0x531352=_0x531352||0xcc;return function(_0x3c272d){if(_0x3c272d){return _0xe92b['sendStatus'](_0x531352);}return _0xe92b[_0x1038('0x21')](_0x531352)['end']();};}function respondWithResult(_0x40ec10,_0x358929){_0x358929=_0x358929||0xc8;return function(_0x4e357c){if(_0x4e357c){return _0x40ec10[_0x1038('0x21')](_0x358929)[_0x1038('0x22')](_0x4e357c);}};}function respondWithFilteredResult(_0xc21b4a,_0x2bc815){return function(_0xdbd0bf){if(_0xdbd0bf){var _0x3f8d1f=typeof _0x2bc815[_0x1038('0x23')]===_0x1038('0x24')&&typeof _0x2bc815['limit']==='undefined';var _0x5d9e92=_0xdbd0bf[_0x1038('0x25')];var _0x435e2a=_0x3f8d1f?0x0:_0x2bc815[_0x1038('0x23')];var _0xe1b8b6=_0x3f8d1f?_0xdbd0bf[_0x1038('0x25')]:_0x2bc815[_0x1038('0x23')]+_0x2bc815[_0x1038('0x26')];var _0x586386;if(_0xe1b8b6>=_0x5d9e92){_0xe1b8b6=_0x5d9e92;_0x586386=0xc8;}else{_0x586386=0xce;}_0xc21b4a[_0x1038('0x21')](_0x586386);return _0xc21b4a[_0x1038('0x27')](_0x1038('0x28'),_0x435e2a+'-'+_0xe1b8b6+'/'+_0x5d9e92)[_0x1038('0x22')](_0xdbd0bf);}return null;};}function patchUpdates(_0x108a85){return function(_0x9feb9e){try{jsonpatch[_0x1038('0x29')](_0x9feb9e,_0x108a85,!![]);}catch(_0x5ec755){return BPromise[_0x1038('0x2a')](_0x5ec755);}return _0x9feb9e[_0x1038('0x2b')]();};}function saveUpdates(_0x336e07,_0x2a85fc){return function(_0x1fd76c){if(_0x1fd76c){return _0x1fd76c[_0x1038('0x2c')](_0x336e07)[_0x1038('0x2d')](function(_0x583024){return _0x583024;});}return null;};}function removeEntity(_0x3dc80b,_0x1d35a9){return function(_0x1d460e){if(_0x1d460e){return _0x1d460e[_0x1038('0x2e')]()[_0x1038('0x2d')](function(){_0x3dc80b[_0x1038('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x154ca2,_0x1c73d2){return function(_0x37f9e2){if(!_0x37f9e2){_0x154ca2['sendStatus'](0x194);}return _0x37f9e2;};}function handleError(_0x131af6,_0x68985b){_0x68985b=_0x68985b||0x1f4;return function(_0x2bec56){logger[_0x1038('0x2f')](_0x2bec56[_0x1038('0x30')]);if(_0x2bec56[_0x1038('0x31')]){delete _0x2bec56['name'];}_0x131af6[_0x1038('0x21')](_0x68985b)[_0x1038('0x32')](_0x2bec56);};}exports[_0x1038('0x33')]=function(_0x80c3e3,_0x88705d){var _0x3e8e4b={},_0x42067c={},_0x416a8c={'count':0x0,'rows':[]};return db[_0x1038('0x34')][_0x1038('0x35')]()[_0x1038('0x2d')](function(_0x3b7cca){var _0x937eb7=[];for(var _0x412d50=0x0;_0x412d500x1){_0x4cc702['or'](_0x1038('0x75'),qs[_0x1038('0x76')](_0x27e5a2),null);}else{if(qs['isNumeric'](_0x27e5a2)){_0x4cc702['or'](_0x1038('0x77'),_0x27e5a2+'%');_0x4cc702['or']('c.phone\x20LIKE\x20?',_0x27e5a2+'%');_0x4cc702['or']('c.mobile\x20LIKE\x20?',_0x27e5a2+'%');_0x4cc702['or'](_0x1038('0x78'),_0x27e5a2+'%');}else if(qs[_0x1038('0x79')](_0x27e5a2)){_0x4cc702['or'](_0x1038('0x7a'),_0x27e5a2+'%');}else{_0x4cc702['or'](_0x1038('0x7b'),'%'+_0x27e5a2+'%');_0x4cc702['or'](_0x1038('0x7c'),'%'+_0x27e5a2+'%');_0x4cc702['or'](_0x1038('0x7a'),'%'+_0x27e5a2+'%');}}}}_0x5b9678['where'](_0x4cc702);_0x5b9678['group'](_0x1038('0x7d'));var _0x3d181a={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x399717=_0x5b9678[_0x1038('0x7e')]()['field'](_0x1038('0x7d'));if(_0x3e8e4b[_0x1038('0x47')]){_0x3e8e4b['order'][_0x1038('0x5d')](function(_0x43b02e){_0x5b9678['order']('c.'+_0x43b02e[0x0],_0x43b02e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1038('0x6d')](_0x199222)){_0x5b9678[_0x1038('0x7f')](_0x1c7b35);_0x399717['where']('t.id\x20IN\x20?',_0x199222);}BPromise['resolve']()[_0x1038('0x2d')](function(){if(!_0x486798)return;if(_0x80c3e3['user'][_0x1038('0x80')]!==_0x1038('0x81'))return;if(!_['some'](_0x486798[_0x1038('0x58')],['field',_0x1038('0x60')])){return _0x80c3e3[_0x1038('0x82')][_0x1038('0x83')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d3c2e){if(_[_0x1038('0x6d')](_0x5d3c2e)){_0x399717['where'](_0x1038('0x84'));_0x5b9678[_0x1038('0x49')](_0x1038('0x84'));}else{_0x399717[_0x1038('0x49')](_0x1038('0x6f'),_[_0x1038('0x5c')](_0x5d3c2e,'id'));_0x5b9678[_0x1038('0x49')](_0x1038('0x6f'),_[_0x1038('0x5c')](_0x5d3c2e,'id'));}});}})[_0x1038('0x2d')](function(){if(_0x80c3e3[_0x1038('0x82')]['role']===_0x1038('0x81')&&!_0x486798&&!_0x80c3e3[_0x1038('0x3e')]['ListId'])return[];return db[_0x1038('0x85')][_0x1038('0x3e')](_0x399717[_0x1038('0x86')](),_0x3d181a);})[_0x1038('0x2d')](function(_0x48571d){_0x416a8c[_0x1038('0x25')]=_0x48571d[_0x1038('0x44')];if(_0x416a8c['count']===0x0)return[];return db[_0x1038('0x85')][_0x1038('0x3e')](_0x115179[_0x1038('0x86')](),_0x3d181a)[_0x1038('0x2d')](function(_0x2c0cbc){_0x59ea55=_[_0x1038('0x87')](_0x2c0cbc,'id');_0x3d181a=_['merge'](_0x3d181a,{'model':db[_0x1038('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x80c3e3[_0x1038('0x3e')]['fields']){_0x3e8e4b[_0x1038('0x42')][_0x1038('0x5d')](function(_0x256fbe){_0x5b9678[_0x1038('0x4c')]('c.'+_0x256fbe);});}else{_0x5b9678[_0x1038('0x4c')](_0x1038('0x7d'));_0x5b9678['field'](_0x1038('0x88'));_0x5b9678['field'](_0x1038('0x89'));_0x5b9678[_0x1038('0x4c')](_0x1038('0x8a'));_0x5b9678[_0x1038('0x4c')](_0x1038('0x8b'));_0x5b9678[_0x1038('0x4c')]('c.fax');_0x5b9678[_0x1038('0x4c')]('c.email');_0x5b9678[_0x1038('0x4c')]('c.ListId');_0x5b9678[_0x1038('0x4c')](_0x1038('0x8c'));_0x5b9678[_0x1038('0x4c')](_0x1038('0x8d'));_0x5b9678[_0x1038('0x4c')](_0x1038('0x8e'));_0x5b9678[_0x1038('0x4c')](_0x1038('0x8f'),_0x1038('0x90'));}if(_0x3e8e4b['limit'])_0x5b9678['limit'](_0x3e8e4b['limit']);if(_0x3e8e4b[_0x1038('0x23')])_0x5b9678[_0x1038('0x23')](_0x3e8e4b[_0x1038('0x23')]);return db[_0x1038('0x85')]['query'](_0x5b9678[_0x1038('0x86')](),_0x3d181a);});})[_0x1038('0x2d')](function(_0x2b13c4){_0x2b13c4[_0x1038('0x5d')](function(_0x152a39){if(_0x152a39[_0x1038('0x90')]){_0x152a39[_0x1038('0x91')]=[];_0x152a39[_0x1038('0x90')]['split'](',')['forEach'](function(_0x2d5e){_0x152a39[_0x1038('0x91')][_0x1038('0x6b')](_0x59ea55[_0x2d5e]);});}delete _0x152a39[_0x1038('0x90')];});_0x416a8c[_0x1038('0x92')]=_0x2b13c4;return _0x416a8c;})[_0x1038('0x2d')](respondWithFilteredResult(_0x88705d,_0x3e8e4b));})[_0x1038('0x93')](handleError(_0x88705d,null));};exports[_0x1038('0x2e')]=function(_0x36a909,_0x6f792f){return db[_0x1038('0x34')][_0x1038('0x94')]({'where':{'id':_0x36a909[_0x1038('0x95')]['id']}})['then'](handleEntityNotFound(_0x6f792f,null))['then'](removeEntity(_0x6f792f,null))['catch'](handleError(_0x6f792f,null));};exports[_0x1038('0x35')]=function(_0x5db604,_0x2dc8d7){return db['CmContact'][_0x1038('0x35')]()[_0x1038('0x2d')](function(_0x3cadd5){delete _0x3cadd5[_0x1038('0x96')];for(var _0x184610=0x0;_0x184610=_0x17280c){_0x32e2da=_0x17280c;_0x2505a8=0xc8;}else{_0x2505a8=0xce;}_0x277afd[_0xcb37('0x1c')](_0x2505a8);return _0x277afd[_0xcb37('0x23')](_0xcb37('0x24'),_0x27cfd4+'-'+_0x32e2da+'/'+_0x17280c)[_0xcb37('0x1e')](_0x846e03);}return null;};}function patchUpdates(_0x1a4b7d){return function(_0x280a78){try{jsonpatch[_0xcb37('0x25')](_0x280a78,_0x1a4b7d,!![]);}catch(_0x49be21){return BPromise['reject'](_0x49be21);}return _0x280a78[_0xcb37('0x26')]();};}function saveUpdates(_0x9a4b04,_0x143aed){return function(_0x42b933){if(_0x42b933){return _0x42b933[_0xcb37('0x27')](_0x9a4b04)[_0xcb37('0x28')](function(_0x13411e){return _0x13411e;});}return null;};}function removeEntity(_0x261b4c,_0x3274c6){return function(_0x38eec0){if(_0x38eec0){return _0x38eec0['destroy']()[_0xcb37('0x28')](function(){_0x261b4c[_0xcb37('0x1c')](0xcc)[_0xcb37('0x1d')]();});}};}function handleEntityNotFound(_0x304b28,_0x3fc045){return function(_0x9f5e18){if(!_0x9f5e18){_0x304b28['sendStatus'](0x194);}return _0x9f5e18;};}function handleError(_0x267b14,_0x35f533){_0x35f533=_0x35f533||0x1f4;return function(_0x3a48e4){logger[_0xcb37('0x29')](_0x3a48e4[_0xcb37('0x2a')]);if(_0x3a48e4[_0xcb37('0x2b')]){delete _0x3a48e4[_0xcb37('0x2b')];}_0x267b14['status'](_0x35f533)[_0xcb37('0x2c')](_0x3a48e4);};}exports[_0xcb37('0x2d')]=function(_0x394863,_0x3823ef){var _0xeacf82={},_0x3f6cca={},_0x57417b={'count':0x0,'rows':[]};return db[_0xcb37('0x2e')][_0xcb37('0x2f')]()[_0xcb37('0x28')](function(_0x59dc52){var _0xa4e5ab=[];for(var _0x2f749a=0x0;_0x2f749a0x1){_0x2c5084['or'](_0xcb37('0x6c'),qs[_0xcb37('0x6d')](_0x484d30),null);}else{if(qs[_0xcb37('0x6e')](_0x484d30)){_0x2c5084['or']('c.id\x20LIKE\x20?',_0x484d30+'%');_0x2c5084['or'](_0xcb37('0x6f'),_0x484d30+'%');_0x2c5084['or']('c.mobile\x20LIKE\x20?',_0x484d30+'%');_0x2c5084['or']('c.fax\x20LIKE\x20?',_0x484d30+'%');}else if(qs[_0xcb37('0x70')](_0x484d30)){_0x2c5084['or'](_0xcb37('0x71'),_0x484d30+'%');}else{_0x2c5084['or'](_0xcb37('0x72'),'%'+_0x484d30+'%');_0x2c5084['or'](_0xcb37('0x73'),'%'+_0x484d30+'%');_0x2c5084['or']('c.email\x20LIKE\x20?','%'+_0x484d30+'%');}}}}_0x2904d1['where'](_0x2c5084);_0x2904d1['group'](_0xcb37('0x74'));var _0x4b0322={'type':db[_0xcb37('0x75')][_0xcb37('0x76')][_0xcb37('0x77')],'raw':!![]};var _0x4dd777=_0x2904d1[_0xcb37('0x78')]()[_0xcb37('0x41')](_0xcb37('0x74'));if(_0xeacf82[_0xcb37('0x79')]){_0xeacf82[_0xcb37('0x79')][_0xcb37('0x55')](function(_0x22891b){_0x2904d1['order']('c.'+_0x22891b[0x0],_0x22891b[0x1]===_0xcb37('0x7a')?![]:!![]);});}if(!_[_0xcb37('0x63')](_0x23f164)){_0x2904d1[_0xcb37('0x7b')](_0x48ef58);_0x4dd777[_0xcb37('0x3e')](_0xcb37('0x7c'),_0x23f164);}BPromise[_0xcb37('0x7d')]()[_0xcb37('0x28')](function(){if(!_0x49c24f)return;if(_0x394863[_0xcb37('0x7e')][_0xcb37('0x7f')]!=='agent')return;if(!_[_0xcb37('0x80')](_0x49c24f[_0xcb37('0x50')],[_0xcb37('0x41'),_0xcb37('0x57')])){return _0x394863[_0xcb37('0x7e')][_0xcb37('0x81')]({'attributes':['id'],'raw':!![]})[_0xcb37('0x28')](function(_0x5837f){if(_[_0xcb37('0x63')](_0x5837f)){_0x4dd777[_0xcb37('0x3e')](_0xcb37('0x82'));_0x2904d1[_0xcb37('0x3e')](_0xcb37('0x82'));}else{_0x4dd777['where']('c.ListId\x20IN\x20?',_[_0xcb37('0x54')](_0x5837f,'id'));_0x2904d1[_0xcb37('0x3e')](_0xcb37('0x65'),_[_0xcb37('0x54')](_0x5837f,'id'));}});}})['then'](function(){if(_0x394863[_0xcb37('0x7e')][_0xcb37('0x7f')]===_0xcb37('0x83')&&!_0x49c24f&&!_0x394863[_0xcb37('0x37')][_0xcb37('0x64')])return[];return db[_0xcb37('0x84')][_0xcb37('0x37')](_0x4dd777[_0xcb37('0x85')](),_0x4b0322);})[_0xcb37('0x28')](function(_0x5daf7a){_0x57417b['count']=_0x5daf7a[_0xcb37('0x31')];if(_0x57417b[_0xcb37('0x21')]===0x0)return[];return db[_0xcb37('0x84')][_0xcb37('0x37')](_0x3ddfb7[_0xcb37('0x85')](),_0x4b0322)[_0xcb37('0x28')](function(_0x499908){_0x1e6ffb=_[_0xcb37('0x86')](_0x499908,'id');_0x4b0322=_[_0xcb37('0x87')](_0x4b0322,{'model':db[_0xcb37('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394863['query'][_0xcb37('0x3b')]){_0xeacf82[_0xcb37('0x3a')]['forEach'](function(_0x27323a){_0x2904d1['field']('c.'+_0x27323a);});}else{_0x2904d1[_0xcb37('0x41')](_0xcb37('0x74'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x88'));_0x2904d1['field']('c.lastName');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x89'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8a'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8b'));_0x2904d1['field']('c.email');_0x2904d1[_0xcb37('0x41')]('c.ListId');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8c'));_0x2904d1['field']('c.deletedAt');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8d'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8e'),'TagIds');}if(_0xeacf82[_0xcb37('0x22')])_0x2904d1['limit'](_0xeacf82['limit']);if(_0xeacf82[_0xcb37('0x1f')])_0x2904d1[_0xcb37('0x1f')](_0xeacf82[_0xcb37('0x1f')]);return db['sequelize'][_0xcb37('0x37')](_0x2904d1['toString'](),_0x4b0322);});})[_0xcb37('0x28')](function(_0x306fc0){_0x306fc0[_0xcb37('0x55')](function(_0xbfa934){if(_0xbfa934['TagIds']){_0xbfa934['Tags']=[];_0xbfa934[_0xcb37('0x8f')]['split'](',')[_0xcb37('0x55')](function(_0x4f2819){_0xbfa934[_0xcb37('0x90')][_0xcb37('0x32')](_0x1e6ffb[_0x4f2819]);});}delete _0xbfa934[_0xcb37('0x8f')];});_0x57417b[_0xcb37('0x91')]=_0x306fc0;return _0x57417b;})['then'](respondWithFilteredResult(_0x3823ef,_0xeacf82));})[_0xcb37('0x92')](handleError(_0x3823ef,null));};exports['destroy']=function(_0x3ec46e,_0x4d5d2a){return db[_0xcb37('0x2e')][_0xcb37('0x51')]({'where':{'id':_0x3ec46e[_0xcb37('0x93')]['id']}})[_0xcb37('0x28')](handleEntityNotFound(_0x4d5d2a,null))[_0xcb37('0x28')](removeEntity(_0x4d5d2a,null))['catch'](handleError(_0x4d5d2a,null));};exports[_0xcb37('0x2f')]=function(_0x2f4f4b,_0x3b9bb8){return db[_0xcb37('0x2e')][_0xcb37('0x2f')]()[_0xcb37('0x28')](function(_0x1b9f12){delete _0x1b9f12[_0xcb37('0x94')];for(var _0x3dbff4=0x0;_0x3dbff4{}\s\\|]/g,'-');_0x8acc04(null,util[_0xfa16('0x23')](_0xfa16('0x24'),path['basename'](_0x546fe3[_0xfa16('0x21')],path['extname'](_0x546fe3[_0xfa16('0x21')])),Date[_0xfa16('0x25')](),path[_0xfa16('0x26')](_0x546fe3[_0xfa16('0x21')])));}})});router['post'](_0xfa16('0x27'),upload['single'](_0xfa16('0x28')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xfa16('0x1e')]({'destination':function(_0x27a5eb,_0x58abcd,_0x218e90){_0x218e90(null,path[_0xfa16('0x1f')](config['root'],_0xfa16('0x29')));},'filename':function(_0x146014,_0x1935a5,_0x4dc738){_0x1935a5[_0xfa16('0x21')]=_0x1935a5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4dc738(null,util[_0xfa16('0x23')](_0xfa16('0x24'),path['basename'](_0x1935a5[_0xfa16('0x21')],path['extname'](_0x1935a5[_0xfa16('0x21')])),Date[_0xfa16('0x25')](),path[_0xfa16('0x26')](_0x1935a5[_0xfa16('0x21')])));}})});router[_0xfa16('0x18')](_0xfa16('0x2a'),upload[_0xfa16('0x2b')](_0xfa16('0x28')),controller['upload']);router[_0xfa16('0x18')](_0xfa16('0x2c'),auth['isAuthenticated'](),controller[_0xfa16('0x2d')]);router[_0xfa16('0x2e')]('/:id',auth[_0xfa16('0x9')](),controller[_0xfa16('0x2f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfa16('0x30')]);module[_0xfa16('0x31')]=router; \ No newline at end of file +var _0xf12e=['/:id/jscripty_sessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s','extname','now','single','file','uploadCsv','format','basename','upload','/upload/:id','import','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xf12e,0xbe));var _0xef12=function(_0x5eaefe,_0xc72159){_0x5eaefe=_0x5eaefe-0x0;var _0xe64929=_0xf12e[_0x5eaefe];return _0xe64929;};'use strict';var multer=require('multer');var util=require(_0xef12('0x0'));var path=require(_0xef12('0x1'));var timeout=require(_0xef12('0x2'));var express=require(_0xef12('0x3'));var router=express[_0xef12('0x4')]();var fs_extra=require(_0xef12('0x5'));var auth=require(_0xef12('0x6'));var interaction=require(_0xef12('0x7'));var config=require(_0xef12('0x8'));var controller=require(_0xef12('0x9'));router[_0xef12('0xa')]('/',auth[_0xef12('0xb')](),controller[_0xef12('0xc')]);router[_0xef12('0xa')](_0xef12('0xd'),auth[_0xef12('0xb')](),controller['describe']);router[_0xef12('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xef12('0xe')]);router[_0xef12('0xa')](_0xef12('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0xef12('0xa')](_0xef12('0x10'),auth[_0xef12('0xb')](),controller[_0xef12('0x11')]);router[_0xef12('0xa')](_0xef12('0x12'),auth['isAuthenticated'](),controller[_0xef12('0x13')]);router[_0xef12('0xa')](_0xef12('0x14'),auth[_0xef12('0xb')](),controller[_0xef12('0x15')]);router[_0xef12('0xa')](_0xef12('0x16'),auth[_0xef12('0xb')](),controller['getJscriptySessions']);router['get']('/:id/journey',auth[_0xef12('0xb')](),controller[_0xef12('0x17')]);router[_0xef12('0x18')](_0xef12('0x19'),auth[_0xef12('0xb')](),controller[_0xef12('0x1a')]);router['post']('/',auth[_0xef12('0xb')](),controller[_0xef12('0x1b')]);router[_0xef12('0x18')](_0xef12('0x1c'),auth[_0xef12('0xb')](),controller[_0xef12('0x1d')]);router[_0xef12('0x18')](_0xef12('0xf'),auth[_0xef12('0xb')](),controller[_0xef12('0x1e')]);var upload=multer({'storage':multer[_0xef12('0x1f')]({'destination':function(_0x4414b6,_0x209bc1,_0x14e226){_0x14e226(null,path[_0xef12('0x20')](config[_0xef12('0x21')],_0xef12('0x22')));},'filename':function(_0xfa5bc8,_0x520505,_0x281bce){_0x520505[_0xef12('0x23')]=_0x520505[_0xef12('0x23')][_0xef12('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x281bce(null,util['format'](_0xef12('0x25'),path['basename'](_0x520505[_0xef12('0x23')],path[_0xef12('0x26')](_0x520505['originalname'])),Date[_0xef12('0x27')](),path[_0xef12('0x26')](_0x520505['originalname'])));}})});router['post']('/csv',upload[_0xef12('0x28')](_0xef12('0x29')),controller[_0xef12('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17eaf5,_0x4566fa,_0x3c22ee){_0x3c22ee(null,path[_0xef12('0x20')](config[_0xef12('0x21')],_0xef12('0x22')));},'filename':function(_0x367dbd,_0xbb98b7,_0x2d3434){_0xbb98b7[_0xef12('0x23')]=_0xbb98b7['originalname'][_0xef12('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d3434(null,util[_0xef12('0x2b')]('%s-%s%s',path[_0xef12('0x2c')](_0xbb98b7[_0xef12('0x23')],path[_0xef12('0x26')](_0xbb98b7[_0xef12('0x23')])),Date[_0xef12('0x27')](),path[_0xef12('0x26')](_0xbb98b7[_0xef12('0x23')])));}})});router['post']('/upload',upload[_0xef12('0x28')](_0xef12('0x29')),controller[_0xef12('0x2d')]);router['post'](_0xef12('0x2e'),auth[_0xef12('0xb')](),controller[_0xef12('0x2f')]);router['put'](_0xef12('0x30'),auth[_0xef12('0xb')](),controller[_0xef12('0x31')]);router[_0xef12('0x32')](_0xef12('0x30'),auth[_0xef12('0xb')](),controller[_0xef12('0x33')]);module[_0xef12('0x34')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 74092ee..377b8f4 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 _0x3d9a=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','TEXT','long','parse','values','isArray'];(function(_0x4bbcc1,_0x594e19){var _0x34435b=function(_0x124582){while(--_0x124582){_0x4bbcc1['push'](_0x4bbcc1['shift']());}};_0x34435b(++_0x594e19);}(_0x3d9a,0x1f3));var _0xa3d9=function(_0x55c809,_0x22a72e){_0x55c809=_0x55c809-0x0;var _0x6e795=_0x3d9a[_0x55c809];return _0x6e795;};'use strict';var Sequelize=require(_0xa3d9('0x0'));var _=require(_0xa3d9('0x1'));module[_0xa3d9('0x2')]={'name':{'type':Sequelize[_0xa3d9('0x3')],'get':function(_0x3681a1){return this['getDataValue'](_0xa3d9('0x4'));}},'alias':{'type':Sequelize[_0xa3d9('0x5')],'allowNull':![],'set':function(_0x1aad60){this[_0xa3d9('0x6')](_0xa3d9('0x4'),_0x1aad60?_0x1aad60:this[_0xa3d9('0x7')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xa3d9('0x8')](_0xa3d9('0x9')),'get':function(){if(this[_0xa3d9('0x7')]('type')==='select'){return JSON[_0xa3d9('0xa')](this[_0xa3d9('0x7')](_0xa3d9('0xb')));}else{return this[_0xa3d9('0x7')]('values');}},'set':function(_0x12f56d){if(Array[_0xa3d9('0xc')](_0x12f56d)){this[_0xa3d9('0x6')]('values',JSON['stringify'](_0x12f56d));}else{this[_0xa3d9('0x6')](_0xa3d9('0xb'),_0x12f56d);}}},'required':{'type':Sequelize[_0xa3d9('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa3d9('0xe')](_0xa3d9('0xf'))}}; \ No newline at end of file +var _0x3382=['lodash','exports','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','values','isArray','stringify','BOOLEAN','ENUM','voice'];(function(_0x148028,_0x8f4e9){var _0xb0ec6=function(_0x502efd){while(--_0x502efd){_0x148028['push'](_0x148028['shift']());}};_0xb0ec6(++_0x8f4e9);}(_0x3382,0x77));var _0x2338=function(_0x5c0314,_0x2ff39c){_0x5c0314=_0x5c0314-0x0;var _0x3ffa8f=_0x3382[_0x5c0314];return _0x3ffa8f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2338('0x0'));module[_0x2338('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x67388b){return this[_0x2338('0x2')](_0x2338('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x24a058){this[_0x2338('0x4')](_0x2338('0x3'),_0x24a058?_0x24a058:this[_0x2338('0x2')](_0x2338('0x5')));}},'type':{'type':Sequelize[_0x2338('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x2338('0x7')](_0x2338('0x8')),'get':function(){if(this[_0x2338('0x2')](_0x2338('0x9'))===_0x2338('0xa')){return JSON['parse'](this[_0x2338('0x2')](_0x2338('0xb')));}else{return this[_0x2338('0x2')](_0x2338('0xb'));}},'set':function(_0x420a60){if(Array[_0x2338('0xc')](_0x420a60)){this[_0x2338('0x4')](_0x2338('0xb'),JSON[_0x2338('0xd')](_0x420a60));}else{this[_0x2338('0x4')](_0x2338('0xb'),_0x420a60);}}},'required':{'type':Sequelize[_0x2338('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2338('0xf')](_0x2338('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 3aab0de..d6c67ad 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 _0x0466=['../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','CmCustomField','fieldName','key','model','differenceBy','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','params','find','body','destroy','create','sequelize','transaction','TEXT','type','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x321558,_0x4685e7){var _0x306d83=function(_0x30b23e){while(--_0x30b23e){_0x321558['push'](_0x321558['shift']());}};_0x306d83(++_0x4685e7);}(_0x0466,0x1af));var _0x6046=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0466[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x6046('0x0'));var rimraf=require(_0x6046('0x1'));var zipdir=require(_0x6046('0x2'));var jsonpatch=require(_0x6046('0x3'));var rp=require(_0x6046('0x4'));var moment=require(_0x6046('0x5'));var BPromise=require(_0x6046('0x6'));var Mustache=require(_0x6046('0x7'));var util=require(_0x6046('0x8'));var path=require(_0x6046('0x9'));var sox=require('sox');var csv=require(_0x6046('0xa'));var ejs=require(_0x6046('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6046('0xc'));var squel=require(_0x6046('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6046('0xe'));var Papa=require(_0x6046('0xf'));var Redis=require(_0x6046('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6046('0x11'));var as=require(_0x6046('0x12'));var hardwareService=require(_0x6046('0x13'));var logger=require(_0x6046('0x14'))(_0x6046('0x15'));var utils=require(_0x6046('0x16'));var config=require(_0x6046('0x17'));var licenseUtil=require(_0x6046('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x164873,_0x585098){_0x585098=_0x585098||0xcc;return function(_0x44e6d1){if(_0x44e6d1){return _0x164873[_0x6046('0x19')](_0x585098);}return _0x164873[_0x6046('0x1a')](_0x585098)['end']();};}function respondWithResult(_0x1f94cc,_0x1d3ab4){_0x1d3ab4=_0x1d3ab4||0xc8;return function(_0x44157f){if(_0x44157f){return _0x1f94cc['status'](_0x1d3ab4)[_0x6046('0x1b')](_0x44157f);}};}function respondWithFilteredResult(_0x2e21c7,_0x1973ff){return function(_0x2db6fe){if(_0x2db6fe){var _0x30e4bf=typeof _0x1973ff[_0x6046('0x1c')]==='undefined'&&typeof _0x1973ff['limit']===_0x6046('0x1d');var _0x4249b2=_0x2db6fe[_0x6046('0x1e')];var _0x2398f9=_0x30e4bf?0x0:_0x1973ff[_0x6046('0x1c')];var _0x4d7ab4=_0x30e4bf?_0x2db6fe[_0x6046('0x1e')]:_0x1973ff[_0x6046('0x1c')]+_0x1973ff['limit'];var _0x2daef4;if(_0x4d7ab4>=_0x4249b2){_0x4d7ab4=_0x4249b2;_0x2daef4=0xc8;}else{_0x2daef4=0xce;}_0x2e21c7[_0x6046('0x1a')](_0x2daef4);return _0x2e21c7[_0x6046('0x1f')](_0x6046('0x20'),_0x2398f9+'-'+_0x4d7ab4+'/'+_0x4249b2)[_0x6046('0x1b')](_0x2db6fe);}return null;};}function patchUpdates(_0x4fec65){return function(_0x1c0dbc){try{jsonpatch[_0x6046('0x21')](_0x1c0dbc,_0x4fec65,!![]);}catch(_0x28e42c){return BPromise[_0x6046('0x22')](_0x28e42c);}return _0x1c0dbc[_0x6046('0x23')]();};}function saveUpdates(_0x20344e,_0x4c21eb){return function(_0x533562){if(_0x533562){return _0x533562[_0x6046('0x24')](_0x20344e)['then'](function(_0x355daf){return _0x355daf;});}return null;};}function removeEntity(_0x23ad3b,_0x38817f){return function(_0x38590a){if(_0x38590a){return _0x38590a['destroy']()[_0x6046('0x25')](function(){_0x23ad3b['status'](0xcc)[_0x6046('0x26')]();});}};}function handleEntityNotFound(_0x1f5837,_0x1ea61d){return function(_0x252420){if(!_0x252420){_0x1f5837[_0x6046('0x19')](0x194);}return _0x252420;};}function handleError(_0x1240be,_0x219beb){_0x219beb=_0x219beb||0x1f4;return function(_0xc88812){logger[_0x6046('0x27')](_0xc88812[_0x6046('0x28')]);if(_0xc88812[_0x6046('0x29')]){delete _0xc88812[_0x6046('0x29')];}_0x1240be['status'](_0x219beb)[_0x6046('0x2a')](_0xc88812);};}exports[_0x6046('0x2b')]=function(_0x1eab3d,_0x12726a){var _0x13d8aa={},_0x2aa4fe={},_0x26b342={'count':0x0,'rows':[]};var _0x5c007d=_['map'](db[_0x6046('0x2c')]['rawAttributes'],function(_0x2e1315){return{'name':_0x2e1315[_0x6046('0x2d')],'type':_0x2e1315['type'][_0x6046('0x2e')]};});_0x2aa4fe[_0x6046('0x2f')]=_[_0x6046('0x30')](_[_0x6046('0x31')](_0x5c007d,_0x6046('0x29')),[_0x6046('0x29')]);_0x2aa4fe[_0x6046('0x32')]=_[_0x6046('0x33')](_0x1eab3d[_0x6046('0x32')]);_0x2aa4fe[_0x6046('0x34')]=_['intersection'](_0x2aa4fe[_0x6046('0x2f')],_0x2aa4fe[_0x6046('0x32')]);_0x13d8aa[_0x6046('0x35')]=_[_0x6046('0x36')](_0x2aa4fe[_0x6046('0x2f')],qs[_0x6046('0x37')](_0x1eab3d[_0x6046('0x32')][_0x6046('0x37')]));_0x13d8aa['attributes']=_0x13d8aa['attributes']['length']?_0x13d8aa[_0x6046('0x35')]:_0x2aa4fe[_0x6046('0x2f')];if(!_0x1eab3d[_0x6046('0x32')][_0x6046('0x38')](_0x6046('0x39'))){_0x13d8aa[_0x6046('0x3a')]=qs['limit'](_0x1eab3d[_0x6046('0x32')]['limit']);_0x13d8aa[_0x6046('0x1c')]=qs[_0x6046('0x1c')](_0x1eab3d[_0x6046('0x32')][_0x6046('0x1c')]);}_0x13d8aa[_0x6046('0x3b')]=qs[_0x6046('0x3c')](_0x1eab3d['query'][_0x6046('0x3c')]);_0x13d8aa['where']=qs[_0x6046('0x34')](_[_0x6046('0x3d')](_0x1eab3d['query'],_0x2aa4fe[_0x6046('0x34')]),_0x5c007d);if(_0x1eab3d[_0x6046('0x32')][_0x6046('0x3e')]){_0x13d8aa['where']=_[_0x6046('0x3f')](_0x13d8aa[_0x6046('0x40')],{'$or':_[_0x6046('0x31')](_0x5c007d,function(_0x32139b){if(_0x32139b['type']!=='VIRTUAL'){var _0x3bff07={};_0x3bff07[_0x32139b[_0x6046('0x29')]]={'$like':'%'+_0x1eab3d['query'][_0x6046('0x3e')]+'%'};return _0x3bff07;}})});}_0x13d8aa=_['merge']({},_0x13d8aa,_0x1eab3d[_0x6046('0x41')]);var _0x1fa87f={'where':_0x13d8aa[_0x6046('0x40')]};return db['CmCustomField'][_0x6046('0x1e')](_0x1fa87f)[_0x6046('0x25')](function(_0x1a997a){_0x26b342[_0x6046('0x1e')]=_0x1a997a;if(_0x1eab3d[_0x6046('0x32')][_0x6046('0x42')]){_0x13d8aa[_0x6046('0x43')]=[{'all':!![]}];}return db['CmCustomField'][_0x6046('0x44')](_0x13d8aa);})[_0x6046('0x25')](function(_0x93a81d){_0x26b342['rows']=_0x93a81d;return _0x26b342;})[_0x6046('0x25')](respondWithFilteredResult(_0x12726a,_0x13d8aa))[_0x6046('0x45')](handleError(_0x12726a,null));};exports[_0x6046('0x46')]=function(_0x599ed0,_0x5adc1c){var _0x16c09b={'raw':!![],'where':{'id':_0x599ed0[_0x6046('0x47')]['id']}},_0x5f947={};_0x5f947['model']=_['keys'](db['CmCustomField']['rawAttributes']);_0x5f947[_0x6046('0x32')]=_[_0x6046('0x33')](_0x599ed0[_0x6046('0x32')]);_0x5f947[_0x6046('0x34')]=_[_0x6046('0x36')](_0x5f947[_0x6046('0x2f')],_0x5f947[_0x6046('0x32')]);_0x16c09b[_0x6046('0x35')]=_[_0x6046('0x36')](_0x5f947[_0x6046('0x2f')],qs[_0x6046('0x37')](_0x599ed0[_0x6046('0x32')]['fields']));_0x16c09b[_0x6046('0x35')]=_0x16c09b[_0x6046('0x35')]['length']?_0x16c09b[_0x6046('0x35')]:_0x5f947[_0x6046('0x2f')];if(_0x599ed0[_0x6046('0x32')][_0x6046('0x42')]){_0x16c09b[_0x6046('0x43')]=[{'all':!![]}];}_0x16c09b=_[_0x6046('0x3f')]({},_0x16c09b,_0x599ed0['options']);return db[_0x6046('0x2c')][_0x6046('0x48')](_0x16c09b)[_0x6046('0x25')](handleEntityNotFound(_0x5adc1c,null))[_0x6046('0x25')](respondWithResult(_0x5adc1c,null))[_0x6046('0x45')](handleError(_0x5adc1c,null));};exports['update']=function(_0x4db3c2,_0x356d16){if(_0x4db3c2[_0x6046('0x49')]['id']){delete _0x4db3c2['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x4db3c2['params']['id']}})['then'](handleEntityNotFound(_0x356d16,null))[_0x6046('0x25')](saveUpdates(_0x4db3c2[_0x6046('0x49')],null))[_0x6046('0x25')](respondWithResult(_0x356d16,null))[_0x6046('0x45')](handleError(_0x356d16,null));};exports[_0x6046('0x4a')]=function(_0x33ee47,_0x4df024){return db[_0x6046('0x2c')][_0x6046('0x48')]({'where':{'id':_0x33ee47[_0x6046('0x47')]['id']}})[_0x6046('0x25')](handleEntityNotFound(_0x4df024,null))[_0x6046('0x25')](removeEntity(_0x4df024,null))['catch'](handleError(_0x4df024,null));};exports[_0x6046('0x4b')]=function(_0x18edd0,_0x2a5b28){var _0x5df5ad;return db[_0x6046('0x4c')][_0x6046('0x4d')](function(_0x35f506){return db[_0x6046('0x2c')]['create'](_0x18edd0[_0x6046('0x49')],{'transaction':_0x35f506})[_0x6046('0x25')](function(_0x12db5e){_0x5df5ad=_0x12db5e;var _0x235bec={'type':db['Sequelize'][_0x6046('0x4e')],'transaction':_0x35f506};switch(_0x18edd0[_0x6046('0x49')][_0x6046('0x4f')]){case _0x6046('0x50'):_0x235bec[_0x6046('0x4f')]=db[_0x6046('0x51')][_0x6046('0x4e')];break;case _0x6046('0x52'):_0x235bec['type']=db[_0x6046('0x51')][_0x6046('0x53')];break;case _0x6046('0x54'):_0x235bec[_0x6046('0x4f')]=db['Sequelize'][_0x6046('0x55')];_0x235bec[_0x6046('0x56')]=![];break;default:}return db[_0x6046('0x4c')][_0x6046('0x57')][_0x6046('0x58')]('cm_contacts',util[_0x6046('0x59')](_0x6046('0x5a'),_0x5df5ad['id']),_0x235bec);})[_0x6046('0x25')](function(){return _0x5df5ad;});})['then'](respondWithResult(_0x2a5b28,0xc9))[_0x6046('0x45')](handleError(_0x2a5b28,null));}; \ No newline at end of file +var _0x076c=['BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','params','length','includeAll','find','body','sequelize','transaction','create','TEXT','text','Sequelize','switch'];(function(_0x2809e9,_0x464119){var _0x4204ba=function(_0x3f27ac){while(--_0x3f27ac){_0x2809e9['push'](_0x2809e9['shift']());}};_0x4204ba(++_0x464119);}(_0x076c,0x1be));var _0xc076=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x076c[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xc076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc076('0x1'));var jsonpatch=require(_0xc076('0x2'));var rp=require(_0xc076('0x3'));var moment=require(_0xc076('0x4'));var BPromise=require(_0xc076('0x5'));var Mustache=require(_0xc076('0x6'));var util=require('util');var path=require(_0xc076('0x7'));var sox=require(_0xc076('0x8'));var csv=require(_0xc076('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc076('0xa'));var _=require('lodash');var squel=require(_0xc076('0xb'));var crypto=require(_0xc076('0xc'));var jsforce=require(_0xc076('0xd'));var deskjs=require(_0xc076('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc076('0xf'));var Papa=require(_0xc076('0x10'));var Redis=require(_0xc076('0x11'));var authService=require(_0xc076('0x12'));var qs=require(_0xc076('0x13'));var as=require(_0xc076('0x14'));var hardwareService=require(_0xc076('0x15'));var logger=require(_0xc076('0x16'))('api');var utils=require(_0xc076('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc076('0x18'));var db=require(_0xc076('0x19'))['db'];function respondWithStatusCode(_0x40d069,_0xa7366e){_0xa7366e=_0xa7366e||0xcc;return function(_0x33cad5){if(_0x33cad5){return _0x40d069['sendStatus'](_0xa7366e);}return _0x40d069[_0xc076('0x1a')](_0xa7366e)[_0xc076('0x1b')]();};}function respondWithResult(_0x1ba038,_0x15e206){_0x15e206=_0x15e206||0xc8;return function(_0x1d5b0f){if(_0x1d5b0f){return _0x1ba038[_0xc076('0x1a')](_0x15e206)[_0xc076('0x1c')](_0x1d5b0f);}};}function respondWithFilteredResult(_0x233940,_0x4f3b47){return function(_0xccc6f4){if(_0xccc6f4){var _0x289c54=typeof _0x4f3b47[_0xc076('0x1d')]===_0xc076('0x1e')&&typeof _0x4f3b47[_0xc076('0x1f')]==='undefined';var _0x5adb75=_0xccc6f4[_0xc076('0x20')];var _0x52f0f8=_0x289c54?0x0:_0x4f3b47['offset'];var _0xc8c41=_0x289c54?_0xccc6f4[_0xc076('0x20')]:_0x4f3b47[_0xc076('0x1d')]+_0x4f3b47['limit'];var _0x4b006c;if(_0xc8c41>=_0x5adb75){_0xc8c41=_0x5adb75;_0x4b006c=0xc8;}else{_0x4b006c=0xce;}_0x233940['status'](_0x4b006c);return _0x233940[_0xc076('0x21')](_0xc076('0x22'),_0x52f0f8+'-'+_0xc8c41+'/'+_0x5adb75)[_0xc076('0x1c')](_0xccc6f4);}return null;};}function patchUpdates(_0xa3e024){return function(_0x47472c){try{jsonpatch[_0xc076('0x23')](_0x47472c,_0xa3e024,!![]);}catch(_0x200644){return BPromise[_0xc076('0x24')](_0x200644);}return _0x47472c[_0xc076('0x25')]();};}function saveUpdates(_0x489173,_0x53ae35){return function(_0x58ae02){if(_0x58ae02){return _0x58ae02[_0xc076('0x26')](_0x489173)[_0xc076('0x27')](function(_0xf0cf20){return _0xf0cf20;});}return null;};}function removeEntity(_0x63db3,_0x2d21f5){return function(_0x88c2f6){if(_0x88c2f6){return _0x88c2f6[_0xc076('0x28')]()[_0xc076('0x27')](function(){_0x63db3[_0xc076('0x1a')](0xcc)[_0xc076('0x1b')]();});}};}function handleEntityNotFound(_0x128af6,_0x317792){return function(_0x58c263){if(!_0x58c263){_0x128af6[_0xc076('0x29')](0x194);}return _0x58c263;};}function handleError(_0x290c4f,_0x222e3d){_0x222e3d=_0x222e3d||0x1f4;return function(_0x31d757){logger['error'](_0x31d757['stack']);if(_0x31d757['name']){delete _0x31d757['name'];}_0x290c4f[_0xc076('0x1a')](_0x222e3d)[_0xc076('0x2a')](_0x31d757);};}exports[_0xc076('0x2b')]=function(_0x4194be,_0x23430e){var _0x53d4e0={},_0x4478e7={},_0x391eb3={'count':0x0,'rows':[]};var _0xaa5491=_['map'](db[_0xc076('0x2c')][_0xc076('0x2d')],function(_0x1092a2){return{'name':_0x1092a2[_0xc076('0x2e')],'type':_0x1092a2[_0xc076('0x2f')][_0xc076('0x30')]};});_0x4478e7[_0xc076('0x31')]=_['differenceBy'](_[_0xc076('0x32')](_0xaa5491,_0xc076('0x33')),[_0xc076('0x33')]);_0x4478e7['query']=_[_0xc076('0x34')](_0x4194be[_0xc076('0x35')]);_0x4478e7[_0xc076('0x36')]=_['intersection'](_0x4478e7[_0xc076('0x31')],_0x4478e7[_0xc076('0x35')]);_0x53d4e0[_0xc076('0x37')]=_[_0xc076('0x38')](_0x4478e7[_0xc076('0x31')],qs['fields'](_0x4194be[_0xc076('0x35')][_0xc076('0x39')]));_0x53d4e0[_0xc076('0x37')]=_0x53d4e0['attributes']['length']?_0x53d4e0[_0xc076('0x37')]:_0x4478e7['model'];if(!_0x4194be[_0xc076('0x35')][_0xc076('0x3a')](_0xc076('0x3b'))){_0x53d4e0['limit']=qs[_0xc076('0x1f')](_0x4194be[_0xc076('0x35')][_0xc076('0x1f')]);_0x53d4e0[_0xc076('0x1d')]=qs[_0xc076('0x1d')](_0x4194be[_0xc076('0x35')][_0xc076('0x1d')]);}_0x53d4e0[_0xc076('0x3c')]=qs['sort'](_0x4194be[_0xc076('0x35')][_0xc076('0x3d')]);_0x53d4e0[_0xc076('0x3e')]=qs[_0xc076('0x36')](_['pick'](_0x4194be[_0xc076('0x35')],_0x4478e7['filters']),_0xaa5491);if(_0x4194be['query'][_0xc076('0x3f')]){_0x53d4e0['where']=_['merge'](_0x53d4e0['where'],{'$or':_[_0xc076('0x32')](_0xaa5491,function(_0x44f148){if(_0x44f148[_0xc076('0x2f')]!==_0xc076('0x40')){var _0x4c5b6a={};_0x4c5b6a[_0x44f148[_0xc076('0x33')]]={'$like':'%'+_0x4194be[_0xc076('0x35')][_0xc076('0x3f')]+'%'};return _0x4c5b6a;}})});}_0x53d4e0=_[_0xc076('0x41')]({},_0x53d4e0,_0x4194be[_0xc076('0x42')]);var _0x6d2122={'where':_0x53d4e0[_0xc076('0x3e')]};return db[_0xc076('0x2c')]['count'](_0x6d2122)[_0xc076('0x27')](function(_0x236033){_0x391eb3['count']=_0x236033;if(_0x4194be[_0xc076('0x35')]['includeAll']){_0x53d4e0[_0xc076('0x43')]=[{'all':!![]}];}return db[_0xc076('0x2c')]['findAll'](_0x53d4e0);})[_0xc076('0x27')](function(_0x9c9e4c){_0x391eb3[_0xc076('0x44')]=_0x9c9e4c;return _0x391eb3;})[_0xc076('0x27')](respondWithFilteredResult(_0x23430e,_0x53d4e0))[_0xc076('0x45')](handleError(_0x23430e,null));};exports['show']=function(_0x302568,_0x20e6bb){var _0x4afb5b={'raw':!![],'where':{'id':_0x302568[_0xc076('0x46')]['id']}},_0x1e2e33={};_0x1e2e33['model']=_[_0xc076('0x34')](db[_0xc076('0x2c')][_0xc076('0x2d')]);_0x1e2e33[_0xc076('0x35')]=_[_0xc076('0x34')](_0x302568[_0xc076('0x35')]);_0x1e2e33[_0xc076('0x36')]=_[_0xc076('0x38')](_0x1e2e33[_0xc076('0x31')],_0x1e2e33[_0xc076('0x35')]);_0x4afb5b[_0xc076('0x37')]=_['intersection'](_0x1e2e33[_0xc076('0x31')],qs[_0xc076('0x39')](_0x302568[_0xc076('0x35')][_0xc076('0x39')]));_0x4afb5b[_0xc076('0x37')]=_0x4afb5b[_0xc076('0x37')][_0xc076('0x47')]?_0x4afb5b['attributes']:_0x1e2e33[_0xc076('0x31')];if(_0x302568['query'][_0xc076('0x48')]){_0x4afb5b[_0xc076('0x43')]=[{'all':!![]}];}_0x4afb5b=_[_0xc076('0x41')]({},_0x4afb5b,_0x302568[_0xc076('0x42')]);return db['CmCustomField'][_0xc076('0x49')](_0x4afb5b)[_0xc076('0x27')](handleEntityNotFound(_0x20e6bb,null))[_0xc076('0x27')](respondWithResult(_0x20e6bb,null))[_0xc076('0x45')](handleError(_0x20e6bb,null));};exports['update']=function(_0x45042e,_0xe77e5c){if(_0x45042e[_0xc076('0x4a')]['id']){delete _0x45042e['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x45042e['params']['id']}})[_0xc076('0x27')](handleEntityNotFound(_0xe77e5c,null))[_0xc076('0x27')](saveUpdates(_0x45042e[_0xc076('0x4a')],null))[_0xc076('0x27')](respondWithResult(_0xe77e5c,null))[_0xc076('0x45')](handleError(_0xe77e5c,null));};exports[_0xc076('0x28')]=function(_0x29ee42,_0x5a417c){return db[_0xc076('0x2c')][_0xc076('0x49')]({'where':{'id':_0x29ee42[_0xc076('0x46')]['id']}})[_0xc076('0x27')](handleEntityNotFound(_0x5a417c,null))[_0xc076('0x27')](removeEntity(_0x5a417c,null))[_0xc076('0x45')](handleError(_0x5a417c,null));};exports['create']=function(_0x3b79ef,_0x2960bc){var _0x50666e;return db[_0xc076('0x4b')][_0xc076('0x4c')](function(_0x3e9858){return db['CmCustomField'][_0xc076('0x4d')](_0x3b79ef['body'],{'transaction':_0x3e9858})[_0xc076('0x27')](function(_0x5c099b){_0x50666e=_0x5c099b;var _0x30c4f3={'type':db['Sequelize'][_0xc076('0x4e')],'transaction':_0x3e9858};switch(_0x3b79ef['body'][_0xc076('0x2f')]){case _0xc076('0x4f'):_0x30c4f3[_0xc076('0x2f')]=db[_0xc076('0x50')]['TEXT'];break;case'number':_0x30c4f3['type']=db[_0xc076('0x50')]['INTEGER'];break;case _0xc076('0x51'):_0x30c4f3[_0xc076('0x2f')]=db[_0xc076('0x50')][_0xc076('0x52')];_0x30c4f3[_0xc076('0x53')]=![];break;default:}return db['sequelize'][_0xc076('0x54')]['addColumn'](_0xc076('0x55'),util[_0xc076('0x56')](_0xc076('0x57'),_0x50666e['id']),_0x30c4f3);})[_0xc076('0x27')](function(){return _0x50666e;});})[_0xc076('0x27')](respondWithResult(_0x2960bc,0xc9))[_0xc076('0x45')](handleError(_0x2960bc,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f9c17c6..3a29fcd 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 _0x9495=['exports','define','CmCustomField','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x9495,0x1e9));var _0x5949=function(_0x45154c,_0x1eca31){_0x45154c=_0x45154c-0x0;var _0x2513bc=_0x9495[_0x45154c];return _0x2513bc;};'use strict';var _=require(_0x5949('0x0'));var util=require('util');var logger=require(_0x5949('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5949('0x2'));var rp=require(_0x5949('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5949('0x4'));var config=require(_0x5949('0x5'));var attributes=require('./cmCustomField.attributes');module[_0x5949('0x6')]=function(_0x4c19d6,_0x31fffa){return _0x4c19d6[_0x5949('0x7')](_0x5949('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6114=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x403caf,_0x5b31e4){var _0x4d6784=function(_0x21db98){while(--_0x21db98){_0x403caf['push'](_0x403caf['shift']());}};_0x4d6784(++_0x5b31e4);}(_0x6114,0x74));var _0x4611=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0x6114[_0x22afd5];return _0x336ebc;};'use strict';var _=require(_0x4611('0x0'));var util=require(_0x4611('0x1'));var logger=require(_0x4611('0x2'))(_0x4611('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4611('0x4'));var fs=require('fs');var path=require(_0x4611('0x5'));var rimraf=require(_0x4611('0x6'));var config=require(_0x4611('0x7'));var attributes=require(_0x4611('0x8'));module[_0x4611('0x9')]=function(_0x418464,_0x4b4c71){return _0x418464[_0x4611('0xa')](_0x4611('0xb'),attributes,{'tableName':_0x4611('0xc'),'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 0c8a3c7..2d6226f 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 _0xbf20=['error','code','CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xbf20,0xaf));var _0x0bf2=function(_0xdbf46,_0x412695){_0xdbf46=_0xdbf46-0x0;var _0x1d2a39=_0xbf20[_0xdbf46];return _0x1d2a39;};'use strict';var _=require(_0x0bf2('0x0'));var util=require(_0x0bf2('0x1'));var moment=require(_0x0bf2('0x2'));var BPromise=require(_0x0bf2('0x3'));var rs=require(_0x0bf2('0x4'));var fs=require('fs');var Redis=require(_0x0bf2('0x5'));var db=require(_0x0bf2('0x6'))['db'];var utils=require(_0x0bf2('0x7'));var logger=require('../../config/logger')(_0x0bf2('0x8'));var config=require(_0x0bf2('0x9'));var jayson=require(_0x0bf2('0xa'));var client=jayson[_0x0bf2('0xb')][_0x0bf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf372aa,_0x470019,_0x2f6db6){return new BPromise(function(_0x1bbe0b,_0x19b2fb){return client['request'](_0xf372aa,_0x2f6db6)[_0x0bf2('0xd')](function(_0x52d400){logger['info']('CmCustomField,\x20%s,\x20%s',_0x470019,_0x0bf2('0xe'));logger['debug'](_0x0bf2('0xf'),_0x470019,_0x0bf2('0xe'),JSON[_0x0bf2('0x10')](_0x52d400));if(_0x52d400[_0x0bf2('0x11')]){if(_0x52d400[_0x0bf2('0x11')][_0x0bf2('0x12')]===0x1f4){logger['error'](_0x0bf2('0x13'),_0x470019,_0x52d400[_0x0bf2('0x11')]['message']);return _0x19b2fb(_0x52d400[_0x0bf2('0x11')]['message']);}logger[_0x0bf2('0x11')](_0x0bf2('0x13'),_0x470019,_0x52d400['error'][_0x0bf2('0x14')]);return _0x1bbe0b(_0x52d400[_0x0bf2('0x11')]['message']);}else{logger[_0x0bf2('0x15')](_0x0bf2('0x13'),_0x470019,_0x0bf2('0xe'));_0x1bbe0b(_0x52d400[_0x0bf2('0x16')][_0x0bf2('0x14')]);}})[_0x0bf2('0x17')](function(_0x247e7f){logger[_0x0bf2('0x11')]('CmCustomField,\x20%s,\x20%s',_0x470019,_0x247e7f);_0x19b2fb(_0x247e7f);});});} \ No newline at end of file +var _0x7cd1=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s'];(function(_0x10d4e5,_0x44f80c){var _0x62a513=function(_0x5f94a7){while(--_0x5f94a7){_0x10d4e5['push'](_0x10d4e5['shift']());}};_0x62a513(++_0x44f80c);}(_0x7cd1,0xf9));var _0x17cd=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x7cd1[_0x1fa381];return _0x47eefe;};'use strict';var _=require(_0x17cd('0x0'));var util=require(_0x17cd('0x1'));var moment=require('moment');var BPromise=require(_0x17cd('0x2'));var rs=require(_0x17cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17cd('0x5'))(_0x17cd('0x6'));var config=require(_0x17cd('0x7'));var jayson=require(_0x17cd('0x8'));var client=jayson[_0x17cd('0x9')][_0x17cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26ce38,_0x4836ba,_0x1d7a62){return new BPromise(function(_0x37efd1,_0xb4748c){return client[_0x17cd('0xb')](_0x26ce38,_0x1d7a62)[_0x17cd('0xc')](function(_0x598d2e){logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x4836ba,'request\x20sent');logger[_0x17cd('0xf')](_0x17cd('0x10'),_0x4836ba,'request\x20sent',JSON[_0x17cd('0x11')](_0x598d2e));if(_0x598d2e[_0x17cd('0x12')]){if(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x13')]===0x1f4){logger[_0x17cd('0x12')](_0x17cd('0xe'),_0x4836ba,_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);return _0xb4748c(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x4836ba,_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);return _0x37efd1(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);}else{logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x4836ba,_0x17cd('0x15'));_0x37efd1(_0x598d2e[_0x17cd('0x16')]['message']);}})[_0x17cd('0x17')](function(_0x494086){logger['error']('CmCustomField,\x20%s,\x20%s',_0x4836ba,_0x494086);_0xb4748c(_0x494086);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0775307..f795326 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 _0x8c39=['../../config/environment','./cmCustomField.controller','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1b6285,_0x2f6f46){var _0x3b38a6=function(_0x34b779){while(--_0x34b779){_0x1b6285['push'](_0x1b6285['shift']());}};_0x3b38a6(++_0x2f6f46);}(_0x8c39,0x1df));var _0x98c3=function(_0x3b0869,_0x7df19d){_0x3b0869=_0x3b0869-0x0;var _0x4772d2=_0x8c39[_0x3b0869];return _0x4772d2;};'use strict';var multer=require(_0x98c3('0x0'));var util=require('util');var path=require(_0x98c3('0x1'));var timeout=require(_0x98c3('0x2'));var express=require(_0x98c3('0x3'));var router=express[_0x98c3('0x4')]();var fs_extra=require(_0x98c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98c3('0x6'));var config=require(_0x98c3('0x7'));var controller=require(_0x98c3('0x8'));router['get']('/',auth[_0x98c3('0x9')](),controller[_0x98c3('0xa')]);router['get'](_0x98c3('0xb'),auth['isAuthenticated'](),controller[_0x98c3('0xc')]);router[_0x98c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x98c3('0xe')]);router['put']('/:id',auth[_0x98c3('0x9')](),controller[_0x98c3('0xf')]);router['delete'](_0x98c3('0xb'),auth[_0x98c3('0x9')](),controller[_0x98c3('0x10')]);module[_0x98c3('0x11')]=router; \ No newline at end of file +var _0xf0db=['get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xca3d2d,_0x1314e2){var _0x405435=function(_0x34ba7c){while(--_0x34ba7c){_0xca3d2d['push'](_0xca3d2d['shift']());}};_0x405435(++_0x1314e2);}(_0xf0db,0x12b));var _0xbf0d=function(_0x14c9c4,_0x437b92){_0x14c9c4=_0x14c9c4-0x0;var _0x1fffb9=_0xf0db[_0x14c9c4];return _0x1fffb9;};'use strict';var multer=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var path=require('path');var timeout=require(_0xbf0d('0x2'));var express=require(_0xbf0d('0x3'));var router=express[_0xbf0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf0d('0x5'));var interaction=require(_0xbf0d('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xa')]);router[_0xbf0d('0xb')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xc')]);router[_0xbf0d('0xd')](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller['update']);router['delete'](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);module[_0xbf0d('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b3ff8f0..40f7043 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 _0x692a=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','STRING','BOOLEAN'];(function(_0xbe227f,_0x3af2d8){var _0x4838cb=function(_0x44c330){while(--_0x44c330){_0xbe227f['push'](_0xbe227f['shift']());}};_0x4838cb(++_0x3af2d8);}(_0x692a,0x9e));var _0xa692=function(_0x11b838,_0x45c778){_0x11b838=_0x11b838-0x0;var _0x305313=_0x692a[_0x11b838];return _0x305313;};'use strict';var moment=require(_0xa692('0x0'));var Sequelize=require(_0xa692('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa692('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa692('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa692('0x4')],'defaultValue':moment()[_0xa692('0x5')](_0xa692('0x6'))},'countbusyretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa692('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa692('0x4')]},'priority':{'type':Sequelize[_0xa692('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa692('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa692('0x7')],'unique':_0xa692('0x8')},'ListId':{'type':Sequelize[_0xa692('0x7')],'unique':_0xa692('0x8')},'UserId':{'type':Sequelize[_0xa692('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa692('0x8')},'CampaignId':{'type':Sequelize[_0xa692('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa692('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x880f=['sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment'];(function(_0x12708a,_0x3c542a){var _0x6033f7=function(_0x5d3f0e){while(--_0x5d3f0e){_0x12708a['push'](_0x12708a['shift']());}};_0x6033f7(++_0x3c542a);}(_0x880f,0x7d));var _0xf880=function(_0x1f473b,_0x19d9a2){_0x1f473b=_0x1f473b-0x0;var _0x1cedc2=_0x880f[_0x1f473b];return _0x1cedc2;};'use strict';var moment=require(_0xf880('0x0'));var Sequelize=require(_0xf880('0x1'));module[_0xf880('0x2')]={'phone':{'type':Sequelize[_0xf880('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf880('0x5')],'defaultValue':moment()['format'](_0xf880('0x6'))},'countbusyretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf880('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf880('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf880('0x7')],'unique':_0xf880('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf880('0x8')},'UserId':{'type':Sequelize[_0xf880('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xf880('0x7')],'unique':_0xf880('0x8')},'CampaignId':{'type':Sequelize[_0xf880('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0a1796b..e6d033e 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 _0xe984=['ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','getVoiceQueues','eml-format','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','map','query','filters','concat','$and','$or','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$like','$notILike','$overlap','$contains','$contained','$any','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmContact','outbound','preview','dialOrderByScheduledAt','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority'];(function(_0x38ac7b,_0x2dc75f){var _0x2c3cd5=function(_0x10ddc9){while(--_0x10ddc9){_0x38ac7b['push'](_0x38ac7b['shift']());}};_0x2c3cd5(++_0x2dc75f);}(_0xe984,0x1d4));var _0x4e98=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xe984[_0x5e4563];return _0x8d1bf5;};'use strict';var emlformat=require(_0x4e98('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4e98('0x1'));var moment=require(_0x4e98('0x2'));var BPromise=require(_0x4e98('0x3'));var Mustache=require(_0x4e98('0x4'));var util=require('util');var path=require(_0x4e98('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e98('0x6'));var fs=require('fs');var fs_extra=require(_0x4e98('0x7'));var _=require(_0x4e98('0x8'));var squel=require(_0x4e98('0x9'));var crypto=require(_0x4e98('0xa'));var jsforce=require(_0x4e98('0xb'));var deskjs=require(_0x4e98('0xc'));var toCsv=require(_0x4e98('0xd'));var querystring=require(_0x4e98('0xe'));var Papa=require(_0x4e98('0xf'));var Redis=require(_0x4e98('0x10'));var authService=require(_0x4e98('0x11'));var qs=require(_0x4e98('0x12'));var as=require(_0x4e98('0x13'));var hardwareService=require(_0x4e98('0x14'));var logger=require(_0x4e98('0x15'))(_0x4e98('0x16'));var utils=require(_0x4e98('0x17'));var config=require(_0x4e98('0x18'));var licenseUtil=require(_0x4e98('0x19'));var db=require(_0x4e98('0x1a'))['db'];function respondWithStatusCode(_0x33760f,_0x3ff833){_0x3ff833=_0x3ff833||0xcc;return function(_0x5516af){if(_0x5516af){return _0x33760f['sendStatus'](_0x3ff833);}return _0x33760f[_0x4e98('0x1b')](_0x3ff833)[_0x4e98('0x1c')]();};}function respondWithResult(_0x1301dd,_0x51d02a){_0x51d02a=_0x51d02a||0xc8;return function(_0x40b780){if(_0x40b780){return _0x1301dd[_0x4e98('0x1b')](_0x51d02a)[_0x4e98('0x1d')](_0x40b780);}};}function respondWithFilteredResult(_0x1eade0,_0x31b367){return function(_0x3a12d9){if(_0x3a12d9){var _0x59f636=typeof _0x31b367[_0x4e98('0x1e')]==='undefined'&&typeof _0x31b367[_0x4e98('0x1f')]===_0x4e98('0x20');var _0x429f9f=_0x3a12d9[_0x4e98('0x21')];var _0x5d9b49=_0x59f636?0x0:_0x31b367[_0x4e98('0x1e')];var _0x1482d0=_0x59f636?_0x3a12d9['count']:_0x31b367[_0x4e98('0x1e')]+_0x31b367['limit'];var _0x245012;if(_0x1482d0>=_0x429f9f){_0x1482d0=_0x429f9f;_0x245012=0xc8;}else{_0x245012=0xce;}_0x1eade0[_0x4e98('0x1b')](_0x245012);return _0x1eade0[_0x4e98('0x22')]('Content-Range',_0x5d9b49+'-'+_0x1482d0+'/'+_0x429f9f)[_0x4e98('0x1d')](_0x3a12d9);}return null;};}function patchUpdates(_0x4114c3){return function(_0x28510e){try{jsonpatch[_0x4e98('0x23')](_0x28510e,_0x4114c3,!![]);}catch(_0x4fd768){return BPromise[_0x4e98('0x24')](_0x4fd768);}return _0x28510e[_0x4e98('0x25')]();};}function saveUpdates(_0x5ebf2e,_0x1eeca6){return function(_0x38a65b){if(_0x38a65b){return _0x38a65b[_0x4e98('0x26')](_0x5ebf2e)[_0x4e98('0x27')](function(_0x3ed223){return _0x3ed223;});}return null;};}function removeEntity(_0x252fe6,_0x3a895e){return function(_0x171f9c){if(_0x171f9c){return _0x171f9c[_0x4e98('0x28')]()[_0x4e98('0x27')](function(){_0x252fe6['status'](0xcc)[_0x4e98('0x1c')]();});}};}function handleEntityNotFound(_0x351378,_0x39c722){return function(_0x289f6e){if(!_0x289f6e){_0x351378[_0x4e98('0x29')](0x194);}return _0x289f6e;};}function handleError(_0xc5f802,_0x4be8de){_0x4be8de=_0x4be8de||0x1f4;return function(_0x31476d){logger[_0x4e98('0x2a')](_0x31476d[_0x4e98('0x2b')]);if(_0x31476d[_0x4e98('0x2c')]){delete _0x31476d[_0x4e98('0x2c')];}_0xc5f802[_0x4e98('0x1b')](_0x4be8de)[_0x4e98('0x2d')](_0x31476d);};}exports[_0x4e98('0x2e')]=function(_0x4df014,_0x1fdcbd){var _0x357c80={},_0x8bc39e={},_0x197716={'count':0x0,'rows':[]};var _0x3c6680=_['map'](db[_0x4e98('0x2f')][_0x4e98('0x30')],function(_0xbc3c1a){return{'name':_0xbc3c1a[_0x4e98('0x31')],'type':_0xbc3c1a[_0x4e98('0x32')][_0x4e98('0x33')]};});_0x8bc39e['model']=_[_0x4e98('0x34')](_0x3c6680,_0x4e98('0x2c'));_0x8bc39e[_0x4e98('0x35')]=_['keys'](_0x4df014[_0x4e98('0x35')]);_0x8bc39e['filters']=_['intersection'](_0x8bc39e['model'],_0x8bc39e['query']);_0x8bc39e[_0x4e98('0x36')]=_[_0x4e98('0x37')](_0x8bc39e[_0x4e98('0x36')],[_0x4e98('0x38'),_0x4e98('0x39'),'$gt',_0x4e98('0x3a'),_0x4e98('0x3b'),_0x4e98('0x3c'),'$ne',_0x4e98('0x3d'),_0x4e98('0x3e'),_0x4e98('0x3f'),_0x4e98('0x40'),_0x4e98('0x41'),'$notIn',_0x4e98('0x42'),'$notLike','$iLike',_0x4e98('0x43'),_0x4e98('0x42'),_0x4e98('0x44'),_0x4e98('0x45'),_0x4e98('0x46'),_0x4e98('0x47')]);_0x357c80[_0x4e98('0x48')]=_['intersection'](_0x8bc39e[_0x4e98('0x49')],qs[_0x4e98('0x4a')](_0x4df014['query'][_0x4e98('0x4a')]));_0x357c80[_0x4e98('0x48')]=_0x357c80[_0x4e98('0x48')]['length']?_0x357c80[_0x4e98('0x48')]:_0x8bc39e[_0x4e98('0x49')];if(!_0x4df014[_0x4e98('0x35')][_0x4e98('0x4b')](_0x4e98('0x4c'))){_0x357c80['limit']=qs['limit'](_0x4df014[_0x4e98('0x35')]['limit']);_0x357c80[_0x4e98('0x1e')]=qs[_0x4e98('0x1e')](_0x4df014['query'][_0x4e98('0x1e')]);}_0x357c80[_0x4e98('0x4d')]=qs[_0x4e98('0x4e')](_0x4df014[_0x4e98('0x35')][_0x4e98('0x4e')]);_0x357c80[_0x4e98('0x4f')]=qs[_0x4e98('0x36')](_[_0x4e98('0x50')](_0x4df014[_0x4e98('0x35')],_0x8bc39e[_0x4e98('0x36')]),_0x3c6680);if(_0x4df014[_0x4e98('0x35')]['filter']){_0x357c80['where']=_[_0x4e98('0x51')](_0x357c80[_0x4e98('0x4f')],{'$or':_[_0x4e98('0x34')](_0x3c6680,function(_0x341582){if(_0x341582[_0x4e98('0x32')]!=='VIRTUAL'){var _0x444531={};_0x444531[_0x341582[_0x4e98('0x2c')]]={'$like':'%'+_0x4df014[_0x4e98('0x35')][_0x4e98('0x52')]+'%'};return _0x444531;}})});}_0x357c80=_['merge']({},_0x357c80,_0x4df014[_0x4e98('0x53')]);var _0x4a489d={'where':_0x357c80['where']};return db['CmHopper'][_0x4e98('0x21')](_0x4a489d)[_0x4e98('0x27')](function(_0x17ddcb){_0x197716['count']=_0x17ddcb;if(_0x4df014[_0x4e98('0x35')][_0x4e98('0x54')]){_0x357c80[_0x4e98('0x55')]=[{'all':!![]}];}return db['CmHopper'][_0x4e98('0x56')](_0x357c80);})[_0x4e98('0x27')](function(_0x55dd4e){_0x197716[_0x4e98('0x57')]=_0x55dd4e;return _0x197716;})[_0x4e98('0x27')](respondWithFilteredResult(_0x1fdcbd,_0x357c80))[_0x4e98('0x58')](handleError(_0x1fdcbd,null));};exports[_0x4e98('0x59')]=function(_0x57493a,_0x37d45d){var _0x57cbe0={'raw':!![],'where':{'id':_0x57493a[_0x4e98('0x5a')]['id']}},_0x1630b5={};_0x1630b5[_0x4e98('0x49')]=_[_0x4e98('0x5b')](db[_0x4e98('0x2f')][_0x4e98('0x30')]);_0x1630b5[_0x4e98('0x35')]=_[_0x4e98('0x5b')](_0x57493a[_0x4e98('0x35')]);_0x1630b5[_0x4e98('0x36')]=_[_0x4e98('0x5c')](_0x1630b5['model'],_0x1630b5[_0x4e98('0x35')]);_0x57cbe0['attributes']=_['intersection'](_0x1630b5[_0x4e98('0x49')],qs[_0x4e98('0x4a')](_0x57493a[_0x4e98('0x35')][_0x4e98('0x4a')]));_0x57cbe0['attributes']=_0x57cbe0[_0x4e98('0x48')][_0x4e98('0x5d')]?_0x57cbe0[_0x4e98('0x48')]:_0x1630b5['model'];if(_0x57493a[_0x4e98('0x35')][_0x4e98('0x54')]){_0x57cbe0[_0x4e98('0x55')]=[{'all':!![]}];}_0x57cbe0=_[_0x4e98('0x51')]({},_0x57cbe0,_0x57493a[_0x4e98('0x53')]);return db[_0x4e98('0x2f')][_0x4e98('0x5e')](_0x57cbe0)[_0x4e98('0x27')](handleEntityNotFound(_0x37d45d,null))['then'](respondWithResult(_0x37d45d,null))[_0x4e98('0x58')](handleError(_0x37d45d,null));};exports[_0x4e98('0x5f')]=function(_0x548fe3,_0xbb4265){return db['CmHopper'][_0x4e98('0x5f')](_0x548fe3[_0x4e98('0x60')],{})[_0x4e98('0x27')](respondWithResult(_0xbb4265,0xc9))[_0x4e98('0x58')](handleError(_0xbb4265,null));};exports[_0x4e98('0x26')]=function(_0x61014e,_0x33472f){if(_0x61014e['body']['id']){delete _0x61014e[_0x4e98('0x60')]['id'];}return db['CmHopper'][_0x4e98('0x5e')]({'where':{'id':_0x61014e['params']['id']}})[_0x4e98('0x27')](handleEntityNotFound(_0x33472f,null))['then'](saveUpdates(_0x61014e[_0x4e98('0x60')],null))['then'](respondWithResult(_0x33472f,null))[_0x4e98('0x58')](handleError(_0x33472f,null));};exports[_0x4e98('0x61')]=function(_0x3cf437,_0x1925d2){return db[_0x4e98('0x2f')][_0x4e98('0x61')]()[_0x4e98('0x27')](respondWithResult(_0x1925d2,null))[_0x4e98('0x58')](handleError(_0x1925d2,null));};exports['destroy']=function(_0x240251,_0x35505b){var _0x447faf;return db[_0x4e98('0x2f')][_0x4e98('0x5e')]({'where':{'id':_0x240251[_0x4e98('0x5a')]['id']}})[_0x4e98('0x27')](handleEntityNotFound(_0x35505b,null))[_0x4e98('0x27')](function(_0x5a29b7){if(_0x5a29b7){return _0x5a29b7[_0x4e98('0x28')]()['then'](function(_0x296cd4){return _0x296cd4;});}})[_0x4e98('0x27')](function(_0x3a7dee){_0x447faf=_0x3a7dee;if(_0x3a7dee){if(_0x3a7dee[_0x4e98('0x62')]||_0x3a7dee[_0x4e98('0x63')]){return db[_0x3a7dee[_0x4e98('0x62')]?_0x4e98('0x64'):'Campaign'][_0x4e98('0x5e')]({'where':{'id':_0x3a7dee[_0x4e98('0x62')]?_0x3a7dee[_0x4e98('0x62')]:_0x3a7dee[_0x4e98('0x63')]},'attributes':['id',_0x4e98('0x2c')],'raw':!![]});}}})[_0x4e98('0x27')](function(_0xfec346){var _0x32fc2b={};if(_0xfec346){_[_0x4e98('0x51')](_0x32fc2b,_[_0x4e98('0x65')](_0x447faf[_0x4e98('0x66')],[_0x4e98('0x67'),_0x4e98('0x68'),'id']));_0x32fc2b[_0x4e98('0x69')]=0x15;_0x32fc2b[_0x4e98('0x6a')]=_0x4e98('0x6b');_0x32fc2b[_0x4e98('0x6c')]=_0xfec346[_0x4e98('0x2c')];_0x32fc2b['membername']=_0x240251['user']['name'];_0x32fc2b[_0x4e98('0x6d')]=_0x240251[_0x4e98('0x6e')]['id'];_0x32fc2b[_0x4e98('0x6b')]=!![];_0x32fc2b[_0x4e98('0x6f')]=moment()[_0x4e98('0x70')]('YYYY-MM-DD\x20HH:mm:ss');_0x32fc2b['calleridnum']=_0x447faf['phone'];_0x32fc2b[_0x4e98('0x71')]=_0x447faf['VoiceQueueId']?_0x4e98('0x72'):_0x4e98('0x73');return db['CmContact'][_0x4e98('0x5e')]({'where':{'id':_0x32fc2b[_0x4e98('0x74')]},'attributes':[_0x4e98('0x75'),_0x4e98('0x76')]})[_0x4e98('0x27')](function(_0x248fdf){if(!_['isNil'](_0x35505b)&&!_[_0x4e98('0x77')](_0x248fdf[_0x4e98('0x75')])){_0x32fc2b[_0x4e98('0x78')]=_0x248fdf[_0x4e98('0x75')];if(!_[_0x4e98('0x77')](_0x248fdf[_0x4e98('0x76')])){_0x32fc2b[_0x4e98('0x78')]+='\x20'+_0x248fdf[_0x4e98('0x76')];}}})[_0x4e98('0x79')](function(){return db[_0x4e98('0x7a')][_0x4e98('0x5f')](_0x32fc2b);});}})[_0x4e98('0x27')](function(){return _0x35505b[_0x4e98('0x1b')](0xcc)[_0x4e98('0x1c')]();})[_0x4e98('0x58')](handleError(_0x35505b,null));};exports['getPreview']=function(_0x1df7a0,_0x5130f0,_0x2dc60e){var _0x351d70=[];return db[_0x4e98('0x7b')][_0x4e98('0x61')]()[_0x4e98('0x27')](function(_0xa3bbdc){_0x351d70=_[_0x4e98('0x5b')](_0xa3bbdc);return _0x1df7a0[_0x4e98('0x6e')]['getVoiceQueues']({'where':{'type':_0x4e98('0x7c'),'dialActive':!![],'dialMethod':_0x4e98('0x7d')},'attributes':['id',_0x4e98('0x7e')],'raw':!![]});})[_0x4e98('0x27')](function(_0x4bd5a8){if(_0x4bd5a8&&_0x4bd5a8['length']){return db['sequelize']['transaction'](function(_0x8b2282){var _0x43061f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4e98('0x70')](_0x4e98('0x7f'))},'VoiceQueueId':{'$in':_[_0x4e98('0x34')](_0x4bd5a8,'id')},'$or':[{'UserId':null},{'UserId':_0x1df7a0[_0x4e98('0x6e')]['id']}]};var _0x3f91dc=[];if(_0x1df7a0[_0x4e98('0x60')]['direction']&&_0x1df7a0[_0x4e98('0x60')][_0x4e98('0x80')]==='prev'){if(!_[_0x4e98('0x81')](_0x1df7a0[_0x4e98('0x60')]['hopperIds'])){_0x43061f['id']={'$in':_0x1df7a0[_0x4e98('0x60')][_0x4e98('0x82')]};}_0x3f91dc=[[_0x4e98('0x83'),_0x4e98('0x84')],[_0x4e98('0x85'),_0x4bd5a8[0x0][_0x4e98('0x7e')]==='ASC'?_0x4e98('0x86'):_0x4e98('0x84')],db[_0x4e98('0x87')][_0x4e98('0x88')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x4e98('0x81')](_0x1df7a0[_0x4e98('0x60')][_0x4e98('0x82')])){_0x43061f['id']={'$notIn':_0x1df7a0[_0x4e98('0x60')][_0x4e98('0x82')]};}_0x3f91dc=[['priority',_0x4e98('0x86')],[_0x4e98('0x85'),_0x4bd5a8[0x0][_0x4e98('0x7e')]],db[_0x4e98('0x87')][_0x4e98('0x88')](_0x4e98('0x89')),['id',_0x4e98('0x84')]];}return db['CmHopper'][_0x4e98('0x8a')]({'attributes':['id','scheduledat'],'where':_0x43061f,'order':_0x3f91dc,'transaction':_0x8b2282,'lock':_0x8b2282[_0x4e98('0x8b')][_0x4e98('0x8c')],'include':[{'model':db['CmContact'],'as':_0x4e98('0x8d'),'attributes':_0x351d70,'include':[{'model':db[_0x4e98('0x8e')],'as':_0x4e98('0x8f'),'attributes':['id',_0x4e98('0x2c')]}]},{'model':db[_0x4e98('0x90')],'as':_0x4e98('0x91'),'attributes':['id',_0x4e98('0x2c')]},{'model':db[_0x4e98('0x64')],'as':_0x4e98('0x92'),'attributes':['id','name',_0x4e98('0x93')]}]})[_0x4e98('0x27')](function(_0x1c7c91){if(_0x1c7c91){return _0x1c7c91[_0x4e98('0x26')]({'UserId':_0x1df7a0[_0x4e98('0x6e')]['id']},{'transaction':_0x8b2282});}});});}})[_0x4e98('0x27')](handleEntityNotFound(_0x5130f0,null))[_0x4e98('0x27')](respondWithResult(_0x5130f0,null))['catch'](handleError(_0x5130f0,null));};exports[_0x4e98('0x94')]=function(_0x1984af,_0x382b42,_0x3f6737){return _0x1984af['user'][_0x4e98('0x95')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x4e98('0x7d')},'attributes':['id'],'raw':!![]})[_0x4e98('0x27')](function(_0xdb3f18){if(_0xdb3f18&&_0xdb3f18[_0x4e98('0x5d')]){return db[_0x4e98('0x2f')][_0x4e98('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4e98('0x70')](_0x4e98('0x7f'))},'VoiceQueueId':{'$in':_[_0x4e98('0x34')](_0xdb3f18,'id')},'$or':[{'UserId':null},{'UserId':_0x1984af[_0x4e98('0x6e')]['id']}]}});}return 0x0;})[_0x4e98('0x27')](function(_0x3c6df0){if(!_[_0x4e98('0x77')](_0x3c6df0)&&_['isNumber'](_0x3c6df0)){return _0x382b42[_0x4e98('0x1b')](0xc8)[_0x4e98('0x1d')]({'contacts':_0x3c6df0});}else{logger[_0x4e98('0x2a')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,'entity\x20not\x20found');_0x382b42['sendStatus'](0x194);}})[_0x4e98('0x58')](handleError(_0x382b42,null));}; \ No newline at end of file +var _0x2947=['CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','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','Content-Range','reject','save','update','then','error','stack','name','send','index','CmHopper','fieldName','type','model','map','query','keys','filters','intersection','concat','$and','$gt','$gte','$eq','$not','$notBetween','$notIn','$notLike','$iLike','$like','$contains','$contained','$any','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','params','include','find','create','body','catch','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','isNil','lastName','calleridname','getPreview','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','outbound'];(function(_0x277a87,_0x47a708){var _0xf75fd=function(_0x5e4b7e){while(--_0x5e4b7e){_0x277a87['push'](_0x277a87['shift']());}};_0xf75fd(++_0x47a708);}(_0x2947,0x1a9));var _0x7294=function(_0x47cefd,_0x31e500){_0x47cefd=_0x47cefd-0x0;var _0xe6bd21=_0x2947[_0x47cefd];return _0xe6bd21;};'use strict';var emlformat=require(_0x7294('0x0'));var rimraf=require(_0x7294('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7294('0x2'));var rp=require(_0x7294('0x3'));var moment=require(_0x7294('0x4'));var BPromise=require(_0x7294('0x5'));var Mustache=require(_0x7294('0x6'));var util=require(_0x7294('0x7'));var path=require(_0x7294('0x8'));var sox=require(_0x7294('0x9'));var csv=require(_0x7294('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7294('0xb'));var _=require(_0x7294('0xc'));var squel=require(_0x7294('0xd'));var crypto=require(_0x7294('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7294('0xf'));var toCsv=require(_0x7294('0xa'));var querystring=require(_0x7294('0x10'));var Papa=require('papaparse');var Redis=require(_0x7294('0x11'));var authService=require(_0x7294('0x12'));var qs=require(_0x7294('0x13'));var as=require(_0x7294('0x14'));var hardwareService=require(_0x7294('0x15'));var logger=require(_0x7294('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7294('0x17'));var licenseUtil=require(_0x7294('0x18'));var db=require(_0x7294('0x19'))['db'];function respondWithStatusCode(_0x3f31d2,_0x21d0dc){_0x21d0dc=_0x21d0dc||0xcc;return function(_0x25d865){if(_0x25d865){return _0x3f31d2[_0x7294('0x1a')](_0x21d0dc);}return _0x3f31d2[_0x7294('0x1b')](_0x21d0dc)[_0x7294('0x1c')]();};}function respondWithResult(_0x1a260a,_0x19fc54){_0x19fc54=_0x19fc54||0xc8;return function(_0x3efe31){if(_0x3efe31){return _0x1a260a[_0x7294('0x1b')](_0x19fc54)[_0x7294('0x1d')](_0x3efe31);}};}function respondWithFilteredResult(_0x1ab6ed,_0x3a21dd){return function(_0x5ed41d){if(_0x5ed41d){var _0x42ac67=typeof _0x3a21dd[_0x7294('0x1e')]===_0x7294('0x1f')&&typeof _0x3a21dd[_0x7294('0x20')]===_0x7294('0x1f');var _0x2bf8c1=_0x5ed41d['count'];var _0x2b3c36=_0x42ac67?0x0:_0x3a21dd['offset'];var _0x444e94=_0x42ac67?_0x5ed41d[_0x7294('0x21')]:_0x3a21dd[_0x7294('0x1e')]+_0x3a21dd[_0x7294('0x20')];var _0x102ecf;if(_0x444e94>=_0x2bf8c1){_0x444e94=_0x2bf8c1;_0x102ecf=0xc8;}else{_0x102ecf=0xce;}_0x1ab6ed[_0x7294('0x1b')](_0x102ecf);return _0x1ab6ed['set'](_0x7294('0x22'),_0x2b3c36+'-'+_0x444e94+'/'+_0x2bf8c1)[_0x7294('0x1d')](_0x5ed41d);}return null;};}function patchUpdates(_0x59d45c){return function(_0xc7634c){try{jsonpatch['apply'](_0xc7634c,_0x59d45c,!![]);}catch(_0x562304){return BPromise[_0x7294('0x23')](_0x562304);}return _0xc7634c[_0x7294('0x24')]();};}function saveUpdates(_0x100c09,_0x546eb7){return function(_0x3786aa){if(_0x3786aa){return _0x3786aa[_0x7294('0x25')](_0x100c09)[_0x7294('0x26')](function(_0x5b8d52){return _0x5b8d52;});}return null;};}function removeEntity(_0x315747,_0x58690f){return function(_0x44aceb){if(_0x44aceb){return _0x44aceb['destroy']()[_0x7294('0x26')](function(){_0x315747[_0x7294('0x1b')](0xcc)[_0x7294('0x1c')]();});}};}function handleEntityNotFound(_0x5551d0,_0x379ed3){return function(_0x1a5fdd){if(!_0x1a5fdd){_0x5551d0['sendStatus'](0x194);}return _0x1a5fdd;};}function handleError(_0xc6a63c,_0x4fcfa8){_0x4fcfa8=_0x4fcfa8||0x1f4;return function(_0x2d9065){logger[_0x7294('0x27')](_0x2d9065[_0x7294('0x28')]);if(_0x2d9065[_0x7294('0x29')]){delete _0x2d9065[_0x7294('0x29')];}_0xc6a63c[_0x7294('0x1b')](_0x4fcfa8)[_0x7294('0x2a')](_0x2d9065);};}exports[_0x7294('0x2b')]=function(_0x11e210,_0xe19b7b){var _0x1fe0e0={},_0x485b0d={},_0x30ee28={'count':0x0,'rows':[]};var _0x44a209=_['map'](db[_0x7294('0x2c')]['rawAttributes'],function(_0x4dd28e){return{'name':_0x4dd28e[_0x7294('0x2d')],'type':_0x4dd28e[_0x7294('0x2e')]['key']};});_0x485b0d[_0x7294('0x2f')]=_[_0x7294('0x30')](_0x44a209,_0x7294('0x29'));_0x485b0d[_0x7294('0x31')]=_[_0x7294('0x32')](_0x11e210['query']);_0x485b0d[_0x7294('0x33')]=_[_0x7294('0x34')](_0x485b0d[_0x7294('0x2f')],_0x485b0d['query']);_0x485b0d[_0x7294('0x33')]=_[_0x7294('0x35')](_0x485b0d[_0x7294('0x33')],[_0x7294('0x36'),'$or',_0x7294('0x37'),_0x7294('0x38'),'$lt','$lte','$ne',_0x7294('0x39'),_0x7294('0x3a'),'$between',_0x7294('0x3b'),'$in',_0x7294('0x3c'),'$like',_0x7294('0x3d'),_0x7294('0x3e'),'$notILike',_0x7294('0x3f'),'$overlap',_0x7294('0x40'),_0x7294('0x41'),_0x7294('0x42')]);_0x1fe0e0[_0x7294('0x43')]=_[_0x7294('0x34')](_0x485b0d[_0x7294('0x2f')],qs[_0x7294('0x44')](_0x11e210[_0x7294('0x31')][_0x7294('0x44')]));_0x1fe0e0[_0x7294('0x43')]=_0x1fe0e0[_0x7294('0x43')][_0x7294('0x45')]?_0x1fe0e0[_0x7294('0x43')]:_0x485b0d[_0x7294('0x2f')];if(!_0x11e210['query']['hasOwnProperty'](_0x7294('0x46'))){_0x1fe0e0['limit']=qs[_0x7294('0x20')](_0x11e210[_0x7294('0x31')][_0x7294('0x20')]);_0x1fe0e0['offset']=qs[_0x7294('0x1e')](_0x11e210[_0x7294('0x31')]['offset']);}_0x1fe0e0['order']=qs[_0x7294('0x47')](_0x11e210[_0x7294('0x31')][_0x7294('0x47')]);_0x1fe0e0[_0x7294('0x48')]=qs[_0x7294('0x33')](_[_0x7294('0x49')](_0x11e210[_0x7294('0x31')],_0x485b0d[_0x7294('0x33')]),_0x44a209);if(_0x11e210[_0x7294('0x31')][_0x7294('0x4a')]){_0x1fe0e0[_0x7294('0x48')]=_[_0x7294('0x4b')](_0x1fe0e0[_0x7294('0x48')],{'$or':_[_0x7294('0x30')](_0x44a209,function(_0x15e650){if(_0x15e650[_0x7294('0x2e')]!=='VIRTUAL'){var _0x24cff2={};_0x24cff2[_0x15e650[_0x7294('0x29')]]={'$like':'%'+_0x11e210['query'][_0x7294('0x4a')]+'%'};return _0x24cff2;}})});}_0x1fe0e0=_['merge']({},_0x1fe0e0,_0x11e210[_0x7294('0x4c')]);var _0x127b95={'where':_0x1fe0e0['where']};return db[_0x7294('0x2c')][_0x7294('0x21')](_0x127b95)['then'](function(_0x4db24d){_0x30ee28[_0x7294('0x21')]=_0x4db24d;if(_0x11e210[_0x7294('0x31')][_0x7294('0x4d')]){_0x1fe0e0['include']=[{'all':!![]}];}return db[_0x7294('0x2c')][_0x7294('0x4e')](_0x1fe0e0);})[_0x7294('0x26')](function(_0x86f311){_0x30ee28['rows']=_0x86f311;return _0x30ee28;})[_0x7294('0x26')](respondWithFilteredResult(_0xe19b7b,_0x1fe0e0))['catch'](handleError(_0xe19b7b,null));};exports['show']=function(_0x41d443,_0x41c061){var _0x4384ba={'raw':!![],'where':{'id':_0x41d443[_0x7294('0x4f')]['id']}},_0x157c65={};_0x157c65[_0x7294('0x2f')]=_[_0x7294('0x32')](db[_0x7294('0x2c')]['rawAttributes']);_0x157c65[_0x7294('0x31')]=_['keys'](_0x41d443[_0x7294('0x31')]);_0x157c65[_0x7294('0x33')]=_[_0x7294('0x34')](_0x157c65[_0x7294('0x2f')],_0x157c65['query']);_0x4384ba['attributes']=_['intersection'](_0x157c65[_0x7294('0x2f')],qs['fields'](_0x41d443['query'][_0x7294('0x44')]));_0x4384ba[_0x7294('0x43')]=_0x4384ba[_0x7294('0x43')][_0x7294('0x45')]?_0x4384ba[_0x7294('0x43')]:_0x157c65['model'];if(_0x41d443[_0x7294('0x31')]['includeAll']){_0x4384ba[_0x7294('0x50')]=[{'all':!![]}];}_0x4384ba=_[_0x7294('0x4b')]({},_0x4384ba,_0x41d443['options']);return db[_0x7294('0x2c')][_0x7294('0x51')](_0x4384ba)[_0x7294('0x26')](handleEntityNotFound(_0x41c061,null))[_0x7294('0x26')](respondWithResult(_0x41c061,null))['catch'](handleError(_0x41c061,null));};exports[_0x7294('0x52')]=function(_0x4883ca,_0x4b80fb){return db[_0x7294('0x2c')]['create'](_0x4883ca[_0x7294('0x53')],{})[_0x7294('0x26')](respondWithResult(_0x4b80fb,0xc9))[_0x7294('0x54')](handleError(_0x4b80fb,null));};exports['update']=function(_0x53b543,_0x218056){if(_0x53b543[_0x7294('0x53')]['id']){delete _0x53b543[_0x7294('0x53')]['id'];}return db['CmHopper'][_0x7294('0x51')]({'where':{'id':_0x53b543[_0x7294('0x4f')]['id']}})[_0x7294('0x26')](handleEntityNotFound(_0x218056,null))[_0x7294('0x26')](saveUpdates(_0x53b543['body'],null))[_0x7294('0x26')](respondWithResult(_0x218056,null))[_0x7294('0x54')](handleError(_0x218056,null));};exports[_0x7294('0x55')]=function(_0x3b1edb,_0x5987a6){return db[_0x7294('0x2c')][_0x7294('0x55')]()[_0x7294('0x26')](respondWithResult(_0x5987a6,null))[_0x7294('0x54')](handleError(_0x5987a6,null));};exports['destroy']=function(_0x2a31d7,_0x481f0f){var _0x6e59fe;return db[_0x7294('0x2c')][_0x7294('0x51')]({'where':{'id':_0x2a31d7[_0x7294('0x4f')]['id']}})[_0x7294('0x26')](handleEntityNotFound(_0x481f0f,null))[_0x7294('0x26')](function(_0x59db74){if(_0x59db74){return _0x59db74['destroy']()[_0x7294('0x26')](function(_0x5b2cbb){return _0x5b2cbb;});}})[_0x7294('0x26')](function(_0x2a5243){_0x6e59fe=_0x2a5243;if(_0x2a5243){if(_0x2a5243['VoiceQueueId']||_0x2a5243[_0x7294('0x56')]){return db[_0x2a5243[_0x7294('0x57')]?'VoiceQueue':_0x7294('0x58')][_0x7294('0x51')]({'where':{'id':_0x2a5243['VoiceQueueId']?_0x2a5243[_0x7294('0x57')]:_0x2a5243[_0x7294('0x56')]},'attributes':['id',_0x7294('0x29')],'raw':!![]});}}})[_0x7294('0x26')](function(_0x3647aa){var _0x54c8d7={};if(_0x3647aa){_[_0x7294('0x4b')](_0x54c8d7,_[_0x7294('0x59')](_0x6e59fe[_0x7294('0x5a')],[_0x7294('0x5b'),_0x7294('0x5c'),'id']));_0x54c8d7[_0x7294('0x5d')]=0x15;_0x54c8d7[_0x7294('0x5e')]='deleted';_0x54c8d7[_0x7294('0x5f')]=_0x3647aa[_0x7294('0x29')];_0x54c8d7[_0x7294('0x60')]=_0x2a31d7[_0x7294('0x61')]['name'];_0x54c8d7[_0x7294('0x62')]=_0x2a31d7[_0x7294('0x61')]['id'];_0x54c8d7['deleted']=!![];_0x54c8d7[_0x7294('0x63')]=moment()[_0x7294('0x64')](_0x7294('0x65'));_0x54c8d7[_0x7294('0x66')]=_0x6e59fe[_0x7294('0x67')];_0x54c8d7[_0x7294('0x68')]=_0x6e59fe[_0x7294('0x57')]?_0x7294('0x69'):'ivr';return db[_0x7294('0x6a')][_0x7294('0x51')]({'where':{'id':_0x54c8d7[_0x7294('0x6b')]},'attributes':[_0x7294('0x6c'),'lastName']})['then'](function(_0x32044f){if(!_[_0x7294('0x6d')](_0x481f0f)&&!_['isNil'](_0x32044f[_0x7294('0x6c')])){_0x54c8d7['calleridname']=_0x32044f[_0x7294('0x6c')];if(!_['isNil'](_0x32044f[_0x7294('0x6e')])){_0x54c8d7[_0x7294('0x6f')]+='\x20'+_0x32044f[_0x7294('0x6e')];}}})['finally'](function(){return db['CmHopperFinal'][_0x7294('0x52')](_0x54c8d7);});}})[_0x7294('0x26')](function(){return _0x481f0f['status'](0xcc)[_0x7294('0x1c')]();})[_0x7294('0x54')](handleError(_0x481f0f,null));};exports[_0x7294('0x70')]=function(_0x4c931d,_0x30b81f,_0x28e391){var _0x3ad3da=[];return db[_0x7294('0x6a')][_0x7294('0x55')]()[_0x7294('0x26')](function(_0x553793){_0x3ad3da=_[_0x7294('0x32')](_0x553793);return _0x4c931d['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7294('0x71')},'attributes':['id',_0x7294('0x72')],'raw':!![]});})[_0x7294('0x26')](function(_0x22ba0e){if(_0x22ba0e&&_0x22ba0e[_0x7294('0x45')]){return db['sequelize'][_0x7294('0x73')](function(_0x7861a6){var _0x2de801={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7294('0x64')](_0x7294('0x65'))},'VoiceQueueId':{'$in':_[_0x7294('0x30')](_0x22ba0e,'id')},'$or':[{'UserId':null},{'UserId':_0x4c931d[_0x7294('0x61')]['id']}]};var _0x3f83b8=[];if(_0x4c931d['body'][_0x7294('0x74')]&&_0x4c931d[_0x7294('0x53')]['direction']===_0x7294('0x75')){if(!_[_0x7294('0x76')](_0x4c931d[_0x7294('0x53')][_0x7294('0x77')])){_0x2de801['id']={'$in':_0x4c931d[_0x7294('0x53')]['hopperIds']};}_0x3f83b8=[[_0x7294('0x78'),_0x7294('0x79')],['scheduledAt',_0x22ba0e[0x0][_0x7294('0x72')]===_0x7294('0x79')?_0x7294('0x7a'):_0x7294('0x79')],db['sequelize'][_0x7294('0x7b')](_0x7294('0x7c')),['id','DESC']];}else{if(!_[_0x7294('0x76')](_0x4c931d[_0x7294('0x53')][_0x7294('0x77')])){_0x2de801['id']={'$notIn':_0x4c931d[_0x7294('0x53')][_0x7294('0x77')]};}_0x3f83b8=[[_0x7294('0x78'),_0x7294('0x7a')],['scheduledAt',_0x22ba0e[0x0]['dialOrderByScheduledAt']],db[_0x7294('0x7d')]['literal'](_0x7294('0x7e')),['id',_0x7294('0x79')]];}return db[_0x7294('0x2c')][_0x7294('0x7f')]({'attributes':['id',_0x7294('0x80')],'where':_0x2de801,'order':_0x3f83b8,'transaction':_0x7861a6,'lock':_0x7861a6[_0x7294('0x81')]['UPDATE'],'include':[{'model':db[_0x7294('0x6a')],'as':'Contact','attributes':_0x3ad3da,'include':[{'model':db[_0x7294('0x82')],'as':_0x7294('0x83'),'attributes':['id',_0x7294('0x29')]}]},{'model':db[_0x7294('0x84')],'as':_0x7294('0x85'),'attributes':['id',_0x7294('0x29')]},{'model':db[_0x7294('0x86')],'as':_0x7294('0x87'),'attributes':['id','name',_0x7294('0x88')]}]})[_0x7294('0x26')](function(_0x399f3b){if(_0x399f3b){return _0x399f3b['update']({'UserId':_0x4c931d['user']['id']},{'transaction':_0x7861a6});}});});}})[_0x7294('0x26')](handleEntityNotFound(_0x30b81f,null))[_0x7294('0x26')](respondWithResult(_0x30b81f,null))[_0x7294('0x54')](handleError(_0x30b81f,null));};exports[_0x7294('0x89')]=function(_0x226f61,_0x5c1fd3,_0x33a0db){return _0x226f61[_0x7294('0x61')]['getVoiceQueues']({'where':{'type':_0x7294('0x8a'),'dialActive':!![],'dialMethod':_0x7294('0x71')},'attributes':['id'],'raw':!![]})[_0x7294('0x26')](function(_0xcc4a09){if(_0xcc4a09&&_0xcc4a09['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7294('0x65'))},'VoiceQueueId':{'$in':_['map'](_0xcc4a09,'id')},'$or':[{'UserId':null},{'UserId':_0x226f61[_0x7294('0x61')]['id']}]}});}return 0x0;})[_0x7294('0x26')](function(_0x3a3135){if(!_['isNil'](_0x3a3135)&&_['isNumber'](_0x3a3135)){return _0x5c1fd3[_0x7294('0x1b')](0xc8)[_0x7294('0x1d')]({'contacts':_0x3a3135});}else{logger['error'](_0x7294('0x8b'),_0x7294('0x89'),0x194,_0x7294('0x8c'));_0x5c1fd3['sendStatus'](0x194);}})[_0x7294('0x54')](handleError(_0x5c1fd3,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 24d40ea..93c214e 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 _0x2bd8=['CmHopper','cm_hopper','scheduledat','phone','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define'];(function(_0x4fd2d6,_0x21533e){var _0x168d4e=function(_0x245905){while(--_0x245905){_0x4fd2d6['push'](_0x4fd2d6['shift']());}};_0x168d4e(++_0x21533e);}(_0x2bd8,0x130));var _0x82bd=function(_0x59e68d,_0x3e1e7e){_0x59e68d=_0x59e68d-0x0;var _0x50b268=_0x2bd8[_0x59e68d];return _0x50b268;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'name':_0x82bd('0xd'),'fields':['scheduledat']},{'name':_0x82bd('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0xe1dc2a,_0x4946fe){var _0x361050=function(_0x4e16ba){while(--_0x4e16ba){_0xe1dc2a['push'](_0xe1dc2a['shift']());}};_0x361050(++_0x4946fe);}(_0x2eb2,0x19f));var _0x22eb=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2eb2[_0x24237f];return _0x48298e;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index dc35f8d..b63eb13 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 _0x9f99=['MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','UPDATE','all','GetContactRecallMe','GetCmHopperPreview','keys','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','attributes','limit','include','map','model','ShowCmHopper','raw','where','then','CreateCmHopper','body','UpdateCmHopper','update','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK','CmContact','Contact','User','Agent','voicePause','length','UserId','push','includes','GetContactDialer'];(function(_0x777095,_0x51495e){var _0x29016b=function(_0x178a0e){while(--_0x178a0e){_0x777095['push'](_0x777095['shift']());}};_0x29016b(++_0x51495e);}(_0x9f99,0x163));var _0x99f9=function(_0x1d316b,_0x46bea9){_0x1d316b=_0x1d316b-0x0;var _0x18be10=_0x9f99[_0x1d316b];return _0x18be10;};'use strict';var _=require('lodash');var util=require(_0x99f9('0x0'));var moment=require(_0x99f9('0x1'));var BPromise=require('bluebird');var rs=require(_0x99f9('0x2'));var fs=require('fs');var Redis=require(_0x99f9('0x3'));var db=require(_0x99f9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99f9('0x5'))(_0x99f9('0x6'));var config=require(_0x99f9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x99f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34dbab,_0x1a6a86,_0x206ff9){return new BPromise(function(_0x16bc45,_0xc2a628){return client[_0x99f9('0x9')](_0x34dbab,_0x206ff9)['then'](function(_0x4b617f){logger[_0x99f9('0xa')](_0x99f9('0xb'),_0x1a6a86,_0x99f9('0xc'));logger[_0x99f9('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1a6a86,_0x99f9('0xc'),JSON[_0x99f9('0xe')](_0x4b617f));if(_0x4b617f[_0x99f9('0xf')]){if(_0x4b617f[_0x99f9('0xf')][_0x99f9('0x10')]===0x1f4){logger[_0x99f9('0xf')](_0x99f9('0xb'),_0x1a6a86,_0x4b617f[_0x99f9('0xf')][_0x99f9('0x11')]);return _0xc2a628(_0x4b617f['error'][_0x99f9('0x11')]);}logger[_0x99f9('0xf')](_0x99f9('0xb'),_0x1a6a86,_0x4b617f['error']['message']);return _0x16bc45(_0x4b617f['error'][_0x99f9('0x11')]);}else{logger[_0x99f9('0xa')](_0x99f9('0xb'),_0x1a6a86,_0x99f9('0xc'));_0x16bc45(_0x4b617f['result']['message']);}})[_0x99f9('0x12')](function(_0x5684eb){logger[_0x99f9('0xf')](_0x99f9('0xb'),_0x1a6a86,_0x5684eb);_0xc2a628(_0x5684eb);});});}exports[_0x99f9('0x13')]=function(_0x108068){var _0x3a67e7=this;return new Promise(function(_0x15e479,_0x5cf310){return db[_0x99f9('0x14')][_0x99f9('0x15')]({'raw':_0x108068['options']?_0x108068[_0x99f9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x108068[_0x99f9('0x16')]?_0x108068['options']['where']||null:null,'attributes':_0x108068[_0x99f9('0x16')]?_0x108068['options'][_0x99f9('0x17')]||null:null,'limit':_0x108068[_0x99f9('0x16')]?_0x108068[_0x99f9('0x16')][_0x99f9('0x18')]||null:null,'include':_0x108068[_0x99f9('0x16')]?_0x108068[_0x99f9('0x16')][_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x108068['options']['include'],function(_0x49a3ba){return{'model':db[_0x49a3ba[_0x99f9('0x1b')]],'as':_0x49a3ba['as'],'attributes':_0x49a3ba[_0x99f9('0x17')],'include':_0x49a3ba[_0x99f9('0x19')]?_['map'](_0x49a3ba['include'],function(_0x3e711a){return{'model':db[_0x3e711a[_0x99f9('0x1b')]],'as':_0x3e711a['as'],'attributes':_0x3e711a['attributes'],'include':_0x3e711a[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x3e711a[_0x99f9('0x19')],function(_0x5836a2){return{'model':db[_0x5836a2['model']],'as':_0x5836a2['as'],'attributes':_0x5836a2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a800f){logger[_0x99f9('0xa')](_0x99f9('0x13'),_0x108068);logger[_0x99f9('0xd')](_0x99f9('0x13'),_0x108068,JSON[_0x99f9('0xe')](_0x3a800f));_0x15e479(_0x3a800f);})[_0x99f9('0x12')](function(_0x4b8f9c){logger[_0x99f9('0xf')]('GetCmHopper',_0x4b8f9c[_0x99f9('0x11')],_0x108068);_0x5cf310(_0x3a67e7[_0x99f9('0xf')](0x1f4,_0x4b8f9c[_0x99f9('0x11')]));});});};exports[_0x99f9('0x1c')]=function(_0x5bf3a3){var _0x26387a=this;return new Promise(function(_0x1830d3,_0xaa24a){return db['CmHopper']['find']({'raw':_0x5bf3a3['options']?_0x5bf3a3[_0x99f9('0x16')][_0x99f9('0x1d')]===undefined?!![]:![]:!![],'where':_0x5bf3a3[_0x99f9('0x16')]?_0x5bf3a3[_0x99f9('0x16')][_0x99f9('0x1e')]||null:null,'attributes':_0x5bf3a3[_0x99f9('0x16')]?_0x5bf3a3['options'][_0x99f9('0x17')]||null:null,'include':_0x5bf3a3[_0x99f9('0x16')]?_0x5bf3a3['options']['include']?_['map'](_0x5bf3a3['options'][_0x99f9('0x19')],function(_0x217a8d){return{'model':db[_0x217a8d['model']],'as':_0x217a8d['as'],'attributes':_0x217a8d['attributes'],'include':_0x217a8d[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x217a8d[_0x99f9('0x19')],function(_0x40a669){return{'model':db[_0x40a669['model']],'as':_0x40a669['as'],'attributes':_0x40a669[_0x99f9('0x17')],'include':_0x40a669[_0x99f9('0x19')]?_['map'](_0x40a669[_0x99f9('0x19')],function(_0x4bfc3e){return{'model':db[_0x4bfc3e[_0x99f9('0x1b')]],'as':_0x4bfc3e['as'],'attributes':_0x4bfc3e['attributes']};}):[]};}):[]};}):[]:[]})[_0x99f9('0x1f')](function(_0x1bf268){logger['info'](_0x99f9('0x1c'),_0x5bf3a3);logger[_0x99f9('0xd')](_0x99f9('0x1c'),_0x5bf3a3,JSON[_0x99f9('0xe')](_0x1bf268));_0x1830d3(_0x1bf268);})[_0x99f9('0x12')](function(_0x522d85){logger[_0x99f9('0xf')](_0x99f9('0x1c'),_0x522d85[_0x99f9('0x11')],_0x5bf3a3);_0xaa24a(_0x26387a[_0x99f9('0xf')](0x1f4,_0x522d85[_0x99f9('0x11')]));});});};exports[_0x99f9('0x20')]=function(_0x185828){var _0x309887=this;return new Promise(function(_0x476a14,_0x1c4b27){return db[_0x99f9('0x14')]['create'](_0x185828[_0x99f9('0x21')],{'raw':_0x185828[_0x99f9('0x16')]?_0x185828[_0x99f9('0x16')][_0x99f9('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x363787){logger[_0x99f9('0xa')]('CreateCmHopper',_0x185828);logger[_0x99f9('0xd')]('CreateCmHopper',_0x185828,JSON[_0x99f9('0xe')](_0x363787));_0x476a14(_0x363787);})['catch'](function(_0x205ee7){logger[_0x99f9('0xf')]('CreateCmHopper',_0x205ee7[_0x99f9('0x11')],_0x185828);_0x1c4b27(_0x309887[_0x99f9('0xf')](0x1f4,_0x205ee7[_0x99f9('0x11')]));});});};exports[_0x99f9('0x22')]=function(_0x555fbd){var _0x555807=this;return new Promise(function(_0x7be1f2,_0x31595d){return db['CmHopper'][_0x99f9('0x23')](_0x555fbd[_0x99f9('0x21')],{'raw':_0x555fbd[_0x99f9('0x16')]?_0x555fbd[_0x99f9('0x16')][_0x99f9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555fbd[_0x99f9('0x16')]?_0x555fbd[_0x99f9('0x16')][_0x99f9('0x1e')]||null:null,'attributes':_0x555fbd[_0x99f9('0x16')]?_0x555fbd[_0x99f9('0x16')][_0x99f9('0x17')]||null:null,'limit':_0x555fbd[_0x99f9('0x16')]?_0x555fbd[_0x99f9('0x16')][_0x99f9('0x18')]||null:null})['then'](function(_0x21842f){logger[_0x99f9('0xa')](_0x99f9('0x22'),_0x555fbd);logger[_0x99f9('0xd')](_0x99f9('0x22'),_0x555fbd,JSON[_0x99f9('0xe')](_0x21842f));_0x7be1f2(_0x21842f);})[_0x99f9('0x12')](function(_0x5cee14){logger[_0x99f9('0xf')](_0x99f9('0x22'),_0x5cee14['message'],_0x555fbd);_0x31595d(_0x555807[_0x99f9('0xf')](0x1f4,_0x5cee14[_0x99f9('0x11')]));});});};exports[_0x99f9('0x24')]=function(_0x4fd050){var _0x364b0d=this;return new Promise(function(_0x404203,_0x34f19d){return db[_0x99f9('0x14')][_0x99f9('0x25')]({'where':_0x4fd050[_0x99f9('0x16')]?_0x4fd050[_0x99f9('0x16')][_0x99f9('0x1e')]||null:null})[_0x99f9('0x1f')](function(_0xecf95d){logger[_0x99f9('0xa')](_0x99f9('0x24'),_0x4fd050);logger[_0x99f9('0xd')](_0x99f9('0x24'),_0x4fd050,JSON['stringify'](_0xecf95d));_0x404203(_0xecf95d);})[_0x99f9('0x12')](function(_0x40aead){logger[_0x99f9('0xf')](_0x99f9('0x24'),_0x40aead[_0x99f9('0x11')],_0x4fd050);_0x34f19d(_0x364b0d[_0x99f9('0xf')](0x1f4,_0x40aead['message']));});});};exports['GetContactDialer']=function(_0x2e49b9){var _0x1fa777=this;return new Promise(function(_0x39ff4d,_0x2018a7){return db['CmContact'][_0x99f9('0x26')]()[_0x99f9('0x1f')](function(_0x25e4b6){return db[_0x99f9('0x27')][_0x99f9('0x28')](function(_0x14289d){return db[_0x99f9('0x14')][_0x99f9('0x15')]({'where':_0x2e49b9[_0x99f9('0x16')]?_0x2e49b9[_0x99f9('0x16')][_0x99f9('0x1e')]||null:null,'attributes':_0x2e49b9[_0x99f9('0x16')]?_0x2e49b9[_0x99f9('0x16')]['attributes']||null:null,'limit':_0x2e49b9[_0x99f9('0x16')]?_0x2e49b9[_0x99f9('0x16')][_0x99f9('0x18')]||null:null,'order':_0x2e49b9['options']?_0x2e49b9[_0x99f9('0x16')][_0x99f9('0x29')]||null:null,'transaction':_0x14289d,'lock':_0x14289d[_0x99f9('0x2a')]['UPDATE'],'include':[{'model':db[_0x99f9('0x2b')],'as':_0x99f9('0x2c'),'attributes':_['keys'](_0x25e4b6)},{'model':db[_0x99f9('0x2d')],'as':_0x99f9('0x2e'),'attributes':['id','name',_0x99f9('0x2f')]}]})[_0x99f9('0x1f')](function(_0x55edcb){var _0x197e91=[];var _0x52b4f4=[];for(var _0x30d7ed=0x0;_0x30d7ed<_0x55edcb[_0x99f9('0x30')];_0x30d7ed+=0x1){var _0x53256e=_0x55edcb[_0x30d7ed][_0x99f9('0x31')];if(_0x53256e===null){_0x197e91[_0x99f9('0x32')](_0x55edcb[_0x30d7ed]['update'](_0x2e49b9[_0x99f9('0x21')],{'transaction':_0x14289d}));}else if(!_0x52b4f4[_0x99f9('0x33')](_0x53256e)){_0x52b4f4[_0x99f9('0x32')](_0x53256e);_0x197e91[_0x99f9('0x32')](_0x55edcb[_0x30d7ed][_0x99f9('0x23')](_0x2e49b9[_0x99f9('0x21')],{'transaction':_0x14289d}));}}return BPromise['all'](_0x197e91);});})['then'](function(_0x1eee90){logger[_0x99f9('0xa')](_0x99f9('0x34'),_0x2e49b9);logger[_0x99f9('0xd')](_0x99f9('0x34'),_0x2e49b9,JSON['stringify'](_0x1eee90));_0x39ff4d(_0x1eee90);})[_0x99f9('0x12')](function(_0x1bd385){logger[_0x99f9('0xf')]('GetContactDialer',_0x1bd385[_0x99f9('0x11')],_0x2e49b9);_0x2018a7(_0x1fa777['error'](0x1f4,_0x1bd385[_0x99f9('0x11')]));});});});};exports[_0x99f9('0x35')]=function(_0x56e437){var _0x29d166=this;return new Promise(function(_0x4b3f5b,_0x5841e9){return db[_0x99f9('0x27')][_0x99f9('0x28')](function(_0x10a315){return db[_0x99f9('0x36')][_0x99f9('0x37')](_0x56e437[_0x99f9('0x21')],{'raw':_0x56e437['options']?_0x56e437[_0x99f9('0x16')][_0x99f9('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x10a315})['then'](function(){return db[_0x99f9('0x14')][_0x99f9('0x25')]({'where':_0x56e437['options']?_0x56e437[_0x99f9('0x16')][_0x99f9('0x1e')]||null:null,'transaction':_0x10a315});});})[_0x99f9('0x1f')](function(_0x2a0eb7){logger[_0x99f9('0xa')](_0x99f9('0x35'),_0x56e437);logger[_0x99f9('0xd')](_0x99f9('0x35'),_0x56e437,JSON[_0x99f9('0xe')](_0x2a0eb7));_0x4b3f5b(_0x2a0eb7);})[_0x99f9('0x12')](function(_0x578fbb){logger[_0x99f9('0xf')]('MoveContactManagedDialer',_0x578fbb['message'],_0x56e437);_0x5841e9(_0x29d166[_0x99f9('0xf')](0x1f4,_0x578fbb[_0x99f9('0x11')]));});});};exports[_0x99f9('0x38')]=function(_0x1249b1){var _0x3fa0a5=this;return new Promise(function(_0x3a81cc,_0x26fb60){return db[_0x99f9('0x14')][_0x99f9('0x15')]({'raw':_0x1249b1[_0x99f9('0x16')]?_0x1249b1['options'][_0x99f9('0x1d')]===undefined?!![]:![]:!![],'where':_0x1249b1[_0x99f9('0x16')]?_0x1249b1['options'][_0x99f9('0x1e')]||null:null,'attributes':[[db[_0x99f9('0x27')]['fn']('COUNT',db[_0x99f9('0x27')]['fn']('IF',db[_0x99f9('0x27')][_0x99f9('0x39')]('`scheduledat`\x20>=\x20'+util[_0x99f9('0x3a')](_0x99f9('0x3b'),moment()[_0x99f9('0x3a')](_0x99f9('0x3c')))+_0x99f9('0x3d')))),_0x99f9('0x3e')]]})[_0x99f9('0x1f')](function(_0x2838f2){logger[_0x99f9('0xa')](_0x99f9('0x38'),_0x1249b1);logger['debug'](_0x99f9('0x38'),_0x1249b1,JSON[_0x99f9('0xe')](_0x2838f2));_0x3a81cc(_0x2838f2);})[_0x99f9('0x12')](function(_0x4409e3){logger[_0x99f9('0xf')](_0x99f9('0x38'),_0x4409e3[_0x99f9('0x11')],_0x1249b1);_0x26fb60(_0x3fa0a5['error'](0x1f4,_0x4409e3[_0x99f9('0x11')]));});});};exports['GetContactRecallMe']=function(_0x317806){var _0xcc13ba=this;return new Promise(function(_0x517144,_0x2686f9){return db[_0x99f9('0x2b')][_0x99f9('0x26')]()[_0x99f9('0x1f')](function(_0x2c547c){return db[_0x99f9('0x27')][_0x99f9('0x28')](function(_0x1e7340){return db[_0x99f9('0x14')]['findAll']({'where':_0x317806['options']?_0x317806[_0x99f9('0x16')]['where']||null:null,'attributes':_0x317806[_0x99f9('0x16')]?_0x317806['options'][_0x99f9('0x17')]||null:null,'limit':0x1,'order':_0x317806[_0x99f9('0x16')]?_0x317806['options'][_0x99f9('0x29')]||null:null,'group':db[_0x99f9('0x14')]['UserId'],'transaction':_0x1e7340,'lock':_0x1e7340[_0x99f9('0x2a')][_0x99f9('0x3f')],'include':_0x317806[_0x99f9('0x16')]?_0x317806[_0x99f9('0x16')][_0x99f9('0x19')]?_['map'](_0x317806[_0x99f9('0x16')][_0x99f9('0x19')],function(_0x49629e){return{'model':db[_0x49629e['model']],'as':_0x49629e['as'],'attributes':_0x49629e[_0x99f9('0x17')],'include':_0x49629e[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x49629e['include'],function(_0x11e9ec){return{'model':db[_0x11e9ec[_0x99f9('0x1b')]],'as':_0x11e9ec['as'],'attributes':_0x11e9ec[_0x99f9('0x17')],'include':_0x11e9ec[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x11e9ec[_0x99f9('0x19')],function(_0x38994c){return{'model':db[_0x38994c[_0x99f9('0x1b')]],'as':_0x38994c['as'],'attributes':_0x38994c[_0x99f9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x99f9('0x1f')](function(_0x2d362a){var _0x208766=[];for(var _0x22594b=0x0;_0x22594b<_0x2d362a['length'];_0x22594b+=0x1){_0x208766[_0x99f9('0x32')](_0x2d362a[_0x22594b][_0x99f9('0x23')](_0x317806[_0x99f9('0x21')],{'transaction':_0x1e7340}));}return BPromise[_0x99f9('0x40')](_0x208766);});})[_0x99f9('0x1f')](function(_0x5b9cd7){logger[_0x99f9('0xa')](_0x99f9('0x41'),_0x317806);logger['debug'](_0x99f9('0x41'),_0x317806,JSON[_0x99f9('0xe')](_0x5b9cd7));_0x517144(_0x5b9cd7);})[_0x99f9('0x12')](function(_0x3db509){logger[_0x99f9('0xf')](_0x99f9('0x41'),_0x3db509[_0x99f9('0x11')],_0x317806);_0x2686f9(_0xcc13ba[_0x99f9('0xf')](0x1f4,_0x3db509[_0x99f9('0x11')]));});});});};exports[_0x99f9('0x42')]=function(_0x4f6680){var _0x443d07=this;return new Promise(function(_0x4744eb,_0x5164eb){db['CmContact'][_0x99f9('0x26')]()['then'](function(_0x7ae4b7){return db[_0x99f9('0x14')][_0x99f9('0x15')]({'raw':_0x4f6680[_0x99f9('0x16')]?_0x4f6680['options'][_0x99f9('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f6680[_0x99f9('0x16')]?_0x4f6680['options'][_0x99f9('0x1e')]||null:null,'attributes':_0x4f6680[_0x99f9('0x16')]?_0x4f6680['options'][_0x99f9('0x17')]||null:null,'limit':_0x4f6680[_0x99f9('0x16')]?_0x4f6680['options'][_0x99f9('0x18')]||null:null,'include':_0x4f6680[_0x99f9('0x16')]?_0x4f6680[_0x99f9('0x16')][_0x99f9('0x19')]?_['map'](_0x4f6680[_0x99f9('0x16')][_0x99f9('0x19')],function(_0x5ebdce){return{'model':db[_0x5ebdce['model']],'as':_0x5ebdce['as'],'attributes':_0x5ebdce['as']===_0x99f9('0x2c')?_[_0x99f9('0x43')](_0x7ae4b7):_0x5ebdce[_0x99f9('0x17')],'include':_0x5ebdce[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x5ebdce[_0x99f9('0x19')],function(_0x38a755){return{'model':db[_0x38a755[_0x99f9('0x1b')]],'as':_0x38a755['as'],'attributes':_0x38a755[_0x99f9('0x17')],'include':_0x38a755[_0x99f9('0x19')]?_[_0x99f9('0x1a')](_0x38a755[_0x99f9('0x19')],function(_0x5e1e70){return{'model':db[_0x5e1e70[_0x99f9('0x1b')]],'as':_0x5e1e70['as'],'attributes':_0x5e1e70['attributes']};}):[]};}):[]};}):[]:[]})[_0x99f9('0x1f')](function(_0x4e4d6c){logger['info'](_0x99f9('0x13'),_0x4f6680);logger[_0x99f9('0xd')](_0x99f9('0x13'),_0x4f6680,JSON['stringify'](_0x4e4d6c));_0x4744eb(_0x4e4d6c);})[_0x99f9('0x12')](function(_0x3b936b){logger[_0x99f9('0xf')](_0x99f9('0x13'),_0x3b936b['message'],_0x4f6680);_0x5164eb(_0x443d07['error'](0x1f4,_0x3b936b['message']));});});});}; \ No newline at end of file +var _0x28ec=['message','info','catch','GetCmHopper','CmHopper','findAll','options','raw','where','map','model','attributes','include','stringify','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','sequelize','transaction','LOCK','UPDATE','Contact','User','Agent','name','UserId','push','update','includes','all','GetContactDialer','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','describe','order','GetCmHopperPreview','limit','keys','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xbd0d43,_0x8492c3){var _0x2c45e6=function(_0x4a42c1){while(--_0x4a42c1){_0xbd0d43['push'](_0xbd0d43['shift']());}};_0x2c45e6(++_0x8492c3);}(_0x28ec,0x73));var _0xc28e=function(_0x257c85,_0x5bb1cd){_0x257c85=_0x257c85-0x0;var _0xac1ef3=_0x28ec[_0x257c85];return _0xac1ef3;};'use strict';var _=require('lodash');var util=require(_0xc28e('0x0'));var moment=require(_0xc28e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc28e('0x2'));var fs=require('fs');var Redis=require(_0xc28e('0x3'));var db=require(_0xc28e('0x4'))['db'];var utils=require(_0xc28e('0x5'));var logger=require('../../config/logger')(_0xc28e('0x6'));var config=require(_0xc28e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc28e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18cd02,_0x3e4393,_0x4552e3){return new BPromise(function(_0x243b3f,_0x115c79){return client[_0xc28e('0x9')](_0x18cd02,_0x4552e3)[_0xc28e('0xa')](function(_0x5d8c25){logger['info'](_0xc28e('0xb'),_0x3e4393,_0xc28e('0xc'));logger[_0xc28e('0xd')](_0xc28e('0xe'),_0x3e4393,_0xc28e('0xc'),JSON['stringify'](_0x5d8c25));if(_0x5d8c25[_0xc28e('0xf')]){if(_0x5d8c25[_0xc28e('0xf')][_0xc28e('0x10')]===0x1f4){logger[_0xc28e('0xf')](_0xc28e('0xb'),_0x3e4393,_0x5d8c25[_0xc28e('0xf')]['message']);return _0x115c79(_0x5d8c25[_0xc28e('0xf')]['message']);}logger['error'](_0xc28e('0xb'),_0x3e4393,_0x5d8c25['error']['message']);return _0x243b3f(_0x5d8c25[_0xc28e('0xf')][_0xc28e('0x11')]);}else{logger[_0xc28e('0x12')](_0xc28e('0xb'),_0x3e4393,'request\x20sent');_0x243b3f(_0x5d8c25['result'][_0xc28e('0x11')]);}})[_0xc28e('0x13')](function(_0x33f44a){logger['error'](_0xc28e('0xb'),_0x3e4393,_0x33f44a);_0x115c79(_0x33f44a);});});}exports[_0xc28e('0x14')]=function(_0x4fb487){var _0x3d9ffa=this;return new Promise(function(_0x1680d5,_0x3fbedc){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'raw':_0x4fb487[_0xc28e('0x17')]?_0x4fb487['options'][_0xc28e('0x18')]===undefined?!![]:![]:!![],'where':_0x4fb487[_0xc28e('0x17')]?_0x4fb487[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x4fb487[_0xc28e('0x17')]?_0x4fb487['options']['attributes']||null:null,'limit':_0x4fb487[_0xc28e('0x17')]?_0x4fb487[_0xc28e('0x17')]['limit']||null:null,'include':_0x4fb487['options']?_0x4fb487[_0xc28e('0x17')]['include']?_[_0xc28e('0x1a')](_0x4fb487['options']['include'],function(_0x17fa0a){return{'model':db[_0x17fa0a[_0xc28e('0x1b')]],'as':_0x17fa0a['as'],'attributes':_0x17fa0a[_0xc28e('0x1c')],'include':_0x17fa0a[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x17fa0a['include'],function(_0x49a35b){return{'model':db[_0x49a35b['model']],'as':_0x49a35b['as'],'attributes':_0x49a35b[_0xc28e('0x1c')],'include':_0x49a35b[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x49a35b[_0xc28e('0x1d')],function(_0x8a2ee8){return{'model':db[_0x8a2ee8[_0xc28e('0x1b')]],'as':_0x8a2ee8['as'],'attributes':_0x8a2ee8[_0xc28e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1531a8){logger[_0xc28e('0x12')](_0xc28e('0x14'),_0x4fb487);logger[_0xc28e('0xd')](_0xc28e('0x14'),_0x4fb487,JSON[_0xc28e('0x1e')](_0x1531a8));_0x1680d5(_0x1531a8);})[_0xc28e('0x13')](function(_0x27230c){logger[_0xc28e('0xf')](_0xc28e('0x14'),_0x27230c[_0xc28e('0x11')],_0x4fb487);_0x3fbedc(_0x3d9ffa[_0xc28e('0xf')](0x1f4,_0x27230c['message']));});});};exports[_0xc28e('0x1f')]=function(_0x584942){var _0x93ac89=this;return new Promise(function(_0x366547,_0x536773){return db['CmHopper'][_0xc28e('0x20')]({'raw':_0x584942[_0xc28e('0x17')]?_0x584942[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'where':_0x584942['options']?_0x584942[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x584942['options']?_0x584942[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'include':_0x584942[_0xc28e('0x17')]?_0x584942[_0xc28e('0x17')][_0xc28e('0x1d')]?_['map'](_0x584942[_0xc28e('0x17')]['include'],function(_0x34c28a){return{'model':db[_0x34c28a['model']],'as':_0x34c28a['as'],'attributes':_0x34c28a[_0xc28e('0x1c')],'include':_0x34c28a[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x34c28a[_0xc28e('0x1d')],function(_0x33d314){return{'model':db[_0x33d314['model']],'as':_0x33d314['as'],'attributes':_0x33d314['attributes'],'include':_0x33d314[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x33d314['include'],function(_0x289d38){return{'model':db[_0x289d38['model']],'as':_0x289d38['as'],'attributes':_0x289d38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fe05c){logger[_0xc28e('0x12')](_0xc28e('0x1f'),_0x584942);logger[_0xc28e('0xd')]('ShowCmHopper',_0x584942,JSON['stringify'](_0x3fe05c));_0x366547(_0x3fe05c);})[_0xc28e('0x13')](function(_0x2f3e2a){logger[_0xc28e('0xf')](_0xc28e('0x1f'),_0x2f3e2a[_0xc28e('0x11')],_0x584942);_0x536773(_0x93ac89[_0xc28e('0xf')](0x1f4,_0x2f3e2a[_0xc28e('0x11')]));});});};exports[_0xc28e('0x21')]=function(_0x31f5fd){var _0x55c8e8=this;return new Promise(function(_0xfc1ba4,_0x5ca88a){return db[_0xc28e('0x15')][_0xc28e('0x22')](_0x31f5fd[_0xc28e('0x23')],{'raw':_0x31f5fd[_0xc28e('0x17')]?_0x31f5fd['options'][_0xc28e('0x18')]===undefined?!![]:![]:!![]})[_0xc28e('0xa')](function(_0x4bd579){logger[_0xc28e('0x12')](_0xc28e('0x21'),_0x31f5fd);logger[_0xc28e('0xd')]('CreateCmHopper',_0x31f5fd,JSON[_0xc28e('0x1e')](_0x4bd579));_0xfc1ba4(_0x4bd579);})[_0xc28e('0x13')](function(_0x387547){logger[_0xc28e('0xf')](_0xc28e('0x21'),_0x387547[_0xc28e('0x11')],_0x31f5fd);_0x5ca88a(_0x55c8e8['error'](0x1f4,_0x387547['message']));});});};exports[_0xc28e('0x24')]=function(_0x5e1e09){var _0x347c2b=this;return new Promise(function(_0x229f19,_0x51f9f6){return db['CmHopper']['update'](_0x5e1e09[_0xc28e('0x23')],{'raw':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09['options'][_0xc28e('0x19')]||null:null,'attributes':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09[_0xc28e('0x17')]['attributes']||null:null,'limit':_0x5e1e09['options']?_0x5e1e09[_0xc28e('0x17')]['limit']||null:null})['then'](function(_0x32d82a){logger[_0xc28e('0x12')](_0xc28e('0x24'),_0x5e1e09);logger[_0xc28e('0xd')](_0xc28e('0x24'),_0x5e1e09,JSON[_0xc28e('0x1e')](_0x32d82a));_0x229f19(_0x32d82a);})[_0xc28e('0x13')](function(_0x268946){logger[_0xc28e('0xf')]('UpdateCmHopper',_0x268946[_0xc28e('0x11')],_0x5e1e09);_0x51f9f6(_0x347c2b['error'](0x1f4,_0x268946[_0xc28e('0x11')]));});});};exports[_0xc28e('0x25')]=function(_0x2fb4fb){var _0x5d8d51=this;return new Promise(function(_0x3ad073,_0x3b0e64){return db['CmHopper'][_0xc28e('0x26')]({'where':_0x2fb4fb[_0xc28e('0x17')]?_0x2fb4fb[_0xc28e('0x17')][_0xc28e('0x19')]||null:null})[_0xc28e('0xa')](function(_0x46a46d){logger['info']('DestroyCmHopper',_0x2fb4fb);logger[_0xc28e('0xd')]('DestroyCmHopper',_0x2fb4fb,JSON[_0xc28e('0x1e')](_0x46a46d));_0x3ad073(_0x46a46d);})[_0xc28e('0x13')](function(_0x1a1b46){logger['error'](_0xc28e('0x25'),_0x1a1b46[_0xc28e('0x11')],_0x2fb4fb);_0x3b0e64(_0x5d8d51['error'](0x1f4,_0x1a1b46[_0xc28e('0x11')]));});});};exports['GetContactDialer']=function(_0x1ea59d){var _0x3d3895=this;return new Promise(function(_0x1e36d5,_0x2c1f69){return db[_0xc28e('0x27')]['describe']()[_0xc28e('0xa')](function(_0x3a57c8){return db[_0xc28e('0x28')][_0xc28e('0x29')](function(_0x47e991){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'where':_0x1ea59d['options']?_0x1ea59d[_0xc28e('0x17')]['where']||null:null,'attributes':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')]['limit']||null:null,'order':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')]['order']||null:null,'transaction':_0x47e991,'lock':_0x47e991[_0xc28e('0x2a')][_0xc28e('0x2b')],'include':[{'model':db[_0xc28e('0x27')],'as':_0xc28e('0x2c'),'attributes':_['keys'](_0x3a57c8)},{'model':db[_0xc28e('0x2d')],'as':_0xc28e('0x2e'),'attributes':['id',_0xc28e('0x2f'),'voicePause']}]})[_0xc28e('0xa')](function(_0x27a52c){var _0xd77f9b=[];var _0x245645=[];for(var _0x2e358d=0x0;_0x2e358d<_0x27a52c['length'];_0x2e358d+=0x1){var _0x29ac7e=_0x27a52c[_0x2e358d][_0xc28e('0x30')];if(_0x29ac7e===null){_0xd77f9b[_0xc28e('0x31')](_0x27a52c[_0x2e358d][_0xc28e('0x32')](_0x1ea59d[_0xc28e('0x23')],{'transaction':_0x47e991}));}else if(!_0x245645[_0xc28e('0x33')](_0x29ac7e)){_0x245645[_0xc28e('0x31')](_0x29ac7e);_0xd77f9b[_0xc28e('0x31')](_0x27a52c[_0x2e358d][_0xc28e('0x32')](_0x1ea59d[_0xc28e('0x23')],{'transaction':_0x47e991}));}}return BPromise[_0xc28e('0x34')](_0xd77f9b);});})[_0xc28e('0xa')](function(_0x295e49){logger['info'](_0xc28e('0x35'),_0x1ea59d);logger[_0xc28e('0xd')](_0xc28e('0x35'),_0x1ea59d,JSON[_0xc28e('0x1e')](_0x295e49));_0x1e36d5(_0x295e49);})['catch'](function(_0x40ccce){logger[_0xc28e('0xf')](_0xc28e('0x35'),_0x40ccce[_0xc28e('0x11')],_0x1ea59d);_0x2c1f69(_0x3d3895[_0xc28e('0xf')](0x1f4,_0x40ccce[_0xc28e('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x3f07df){var _0x3d84f7=this;return new Promise(function(_0x3bac48,_0x2a28b1){return db[_0xc28e('0x28')][_0xc28e('0x29')](function(_0x1b6dcb){return db['CmHopperFinal'][_0xc28e('0x22')](_0x3f07df[_0xc28e('0x23')],{'raw':_0x3f07df['options']?_0x3f07df[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'transaction':_0x1b6dcb})[_0xc28e('0xa')](function(){return db[_0xc28e('0x15')][_0xc28e('0x26')]({'where':_0x3f07df['options']?_0x3f07df[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'transaction':_0x1b6dcb});});})[_0xc28e('0xa')](function(_0x46b5d2){logger[_0xc28e('0x12')](_0xc28e('0x36'),_0x3f07df);logger[_0xc28e('0xd')]('MoveContactManagedDialer',_0x3f07df,JSON['stringify'](_0x46b5d2));_0x3bac48(_0x46b5d2);})[_0xc28e('0x13')](function(_0x3fbc45){logger[_0xc28e('0xf')](_0xc28e('0x36'),_0x3fbc45['message'],_0x3f07df);_0x2a28b1(_0x3d84f7[_0xc28e('0xf')](0x1f4,_0x3fbc45[_0xc28e('0x11')]));});});};exports[_0xc28e('0x37')]=function(_0x480fbd){var _0x3faa67=this;return new Promise(function(_0x1ebc95,_0x13ecfa){return db[_0xc28e('0x15')]['findAll']({'raw':_0x480fbd['options']?_0x480fbd[_0xc28e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x480fbd['options']?_0x480fbd[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xc28e('0x38'),db[_0xc28e('0x28')]['fn']('IF',db[_0xc28e('0x28')][_0xc28e('0x39')]('`scheduledat`\x20>=\x20'+util['format'](_0xc28e('0x3a'),moment()['format'](_0xc28e('0x3b')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xc28e('0xa')](function(_0x3a919a){logger['info']('CountReScheduled',_0x480fbd);logger[_0xc28e('0xd')](_0xc28e('0x37'),_0x480fbd,JSON[_0xc28e('0x1e')](_0x3a919a));_0x1ebc95(_0x3a919a);})[_0xc28e('0x13')](function(_0x1fbe10){logger[_0xc28e('0xf')]('CountReScheduled',_0x1fbe10[_0xc28e('0x11')],_0x480fbd);_0x13ecfa(_0x3faa67['error'](0x1f4,_0x1fbe10[_0xc28e('0x11')]));});});};exports[_0xc28e('0x3c')]=function(_0x2204af){var _0x719ca2=this;return new Promise(function(_0x330191,_0x26aada){return db['CmContact'][_0xc28e('0x3d')]()['then'](function(_0x227fcd){return db[_0xc28e('0x28')]['transaction'](function(_0xc70d0c){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'where':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':0x1,'order':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x3e')]||null:null,'group':db[_0xc28e('0x15')][_0xc28e('0x30')],'transaction':_0xc70d0c,'lock':_0xc70d0c['LOCK']['UPDATE'],'include':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x1d')]?_['map'](_0x2204af[_0xc28e('0x17')][_0xc28e('0x1d')],function(_0x905ee6){return{'model':db[_0x905ee6['model']],'as':_0x905ee6['as'],'attributes':_0x905ee6[_0xc28e('0x1c')],'include':_0x905ee6[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x905ee6[_0xc28e('0x1d')],function(_0xb909b0){return{'model':db[_0xb909b0[_0xc28e('0x1b')]],'as':_0xb909b0['as'],'attributes':_0xb909b0['attributes'],'include':_0xb909b0[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0xb909b0[_0xc28e('0x1d')],function(_0x4c9029){return{'model':db[_0x4c9029[_0xc28e('0x1b')]],'as':_0x4c9029['as'],'attributes':_0x4c9029['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a8f7){var _0x48f233=[];for(var _0x1f80bf=0x0;_0x1f80bf<_0x25a8f7['length'];_0x1f80bf+=0x1){_0x48f233[_0xc28e('0x31')](_0x25a8f7[_0x1f80bf][_0xc28e('0x32')](_0x2204af['body'],{'transaction':_0xc70d0c}));}return BPromise[_0xc28e('0x34')](_0x48f233);});})[_0xc28e('0xa')](function(_0x503be5){logger[_0xc28e('0x12')](_0xc28e('0x3c'),_0x2204af);logger[_0xc28e('0xd')](_0xc28e('0x3c'),_0x2204af,JSON[_0xc28e('0x1e')](_0x503be5));_0x330191(_0x503be5);})[_0xc28e('0x13')](function(_0x58aefc){logger[_0xc28e('0xf')](_0xc28e('0x3c'),_0x58aefc['message'],_0x2204af);_0x26aada(_0x719ca2[_0xc28e('0xf')](0x1f4,_0x58aefc[_0xc28e('0x11')]));});});});};exports[_0xc28e('0x3f')]=function(_0xccea64){var _0x400382=this;return new Promise(function(_0x5da545,_0x375cc7){db[_0xc28e('0x27')][_0xc28e('0x3d')]()[_0xc28e('0xa')](function(_0x546810){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'raw':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x40')]||null:null,'include':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')]['include']?_[_0xc28e('0x1a')](_0xccea64['options'][_0xc28e('0x1d')],function(_0x4cd5f5){return{'model':db[_0x4cd5f5[_0xc28e('0x1b')]],'as':_0x4cd5f5['as'],'attributes':_0x4cd5f5['as']===_0xc28e('0x2c')?_[_0xc28e('0x41')](_0x546810):_0x4cd5f5[_0xc28e('0x1c')],'include':_0x4cd5f5[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x4cd5f5[_0xc28e('0x1d')],function(_0x5942f9){return{'model':db[_0x5942f9[_0xc28e('0x1b')]],'as':_0x5942f9['as'],'attributes':_0x5942f9[_0xc28e('0x1c')],'include':_0x5942f9[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x5942f9[_0xc28e('0x1d')],function(_0x444f5b){return{'model':db[_0x444f5b[_0xc28e('0x1b')]],'as':_0x444f5b['as'],'attributes':_0x444f5b[_0xc28e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12a07b){logger[_0xc28e('0x12')](_0xc28e('0x14'),_0xccea64);logger[_0xc28e('0xd')](_0xc28e('0x14'),_0xccea64,JSON[_0xc28e('0x1e')](_0x12a07b));_0x5da545(_0x12a07b);})['catch'](function(_0x274e2a){logger[_0xc28e('0xf')](_0xc28e('0x14'),_0x274e2a[_0xc28e('0x11')],_0xccea64);_0x375cc7(_0x400382['error'](0x1f4,_0x274e2a[_0xc28e('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4124afc..cc5c272 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 _0xe3b2=['getPreview','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview'];(function(_0x4eaf56,_0xd27dc9){var _0x3a3cb7=function(_0x2b5cab){while(--_0x2b5cab){_0x4eaf56['push'](_0x4eaf56['shift']());}};_0x3a3cb7(++_0xd27dc9);}(_0xe3b2,0x9b));var _0x2e3b=function(_0xc80b2b,_0x5a12e9){_0xc80b2b=_0xc80b2b-0x0;var _0x22af6f=_0xe3b2[_0xc80b2b];return _0x22af6f;};'use strict';var multer=require(_0x2e3b('0x0'));var util=require(_0x2e3b('0x1'));var path=require(_0x2e3b('0x2'));var timeout=require(_0x2e3b('0x3'));var express=require(_0x2e3b('0x4'));var router=express[_0x2e3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2e3b('0x6'));var interaction=require(_0x2e3b('0x7'));var config=require(_0x2e3b('0x8'));var controller=require(_0x2e3b('0x9'));router[_0x2e3b('0xa')]('/',auth[_0x2e3b('0xb')](),controller['index']);router[_0x2e3b('0xa')]('/describe',auth[_0x2e3b('0xb')](),controller[_0x2e3b('0xc')]);router['get'](_0x2e3b('0xd'),auth[_0x2e3b('0xb')](),controller[_0x2e3b('0xe')]);router[_0x2e3b('0xa')](_0x2e3b('0xf'),auth['isAuthenticated'](),controller[_0x2e3b('0x10')]);router[_0x2e3b('0x11')]('/',auth['isAuthenticated'](),controller[_0x2e3b('0x12')]);router[_0x2e3b('0x11')](_0x2e3b('0x13'),auth[_0x2e3b('0xb')](),controller[_0x2e3b('0x14')]);router[_0x2e3b('0x15')](_0x2e3b('0xf'),auth[_0x2e3b('0xb')](),controller[_0x2e3b('0x16')]);router['delete'](_0x2e3b('0xf'),auth[_0x2e3b('0xb')](),controller[_0x2e3b('0x17')]);module[_0x2e3b('0x18')]=router; \ No newline at end of file +var _0xa5c1=['../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x4b2cf1,_0x5b81f5){_0x4b2cf1=_0x4b2cf1-0x0;var _0x388345=_0xa5c1[_0x4b2cf1];return _0x388345;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require(_0x1a5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5c('0x4'));var interaction=require(_0x1a5c('0x5'));var config=require(_0x1a5c('0x6'));var controller=require(_0x1a5c('0x7'));router[_0x1a5c('0x8')]('/',auth[_0x1a5c('0x9')](),controller['index']);router[_0x1a5c('0x8')]('/describe',auth[_0x1a5c('0x9')](),controller[_0x1a5c('0xa')]);router[_0x1a5c('0x8')]('/opencontacts',auth[_0x1a5c('0x9')](),controller['getOpenContacts']);router[_0x1a5c('0x8')](_0x1a5c('0xb'),auth['isAuthenticated'](),controller[_0x1a5c('0xc')]);router[_0x1a5c('0xd')]('/',auth['isAuthenticated'](),controller[_0x1a5c('0xe')]);router[_0x1a5c('0xd')](_0x1a5c('0xf'),auth[_0x1a5c('0x9')](),controller[_0x1a5c('0x10')]);router[_0x1a5c('0x11')](_0x1a5c('0xb'),auth['isAuthenticated'](),controller[_0x1a5c('0x12')]);router[_0x1a5c('0x13')]('/:id',auth[_0x1a5c('0x9')](),controller[_0x1a5c('0x14')]);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 266bce0..fd6d696 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 _0xe944=['moment','STRING','INTEGER','contactListQueue'];(function(_0x1fa19c,_0x5c740b){var _0x5b332d=function(_0x289cb8){while(--_0x289cb8){_0x1fa19c['push'](_0x1fa19c['shift']());}};_0x5b332d(++_0x5c740b);}(_0xe944,0x174));var _0x4e94=function(_0xbc56ec,_0x3bc252){_0xbc56ec=_0xbc56ec-0x0;var _0x5943f7=_0xe944[_0xbc56ec];return _0x5943f7;};'use strict';var moment=require(_0x4e94('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x4e94('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4e94('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4e94('0x3')}}; \ No newline at end of file +var _0x2dc3=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x288b3e,_0x3b1599){var _0x18d8f4=function(_0x496882){while(--_0x496882){_0x288b3e['push'](_0x288b3e['shift']());}};_0x18d8f4(++_0x3b1599);}(_0x2dc3,0x127));var _0x32dc=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2dc3[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require('moment');var Sequelize=require(_0x32dc('0x0'));module[_0x32dc('0x1')]={'phone':{'type':Sequelize[_0x32dc('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x32dc('0x3')],'unique':_0x32dc('0x4')},'ListId':{'type':Sequelize[_0x32dc('0x3')],'unique':_0x32dc('0x4')},'VoiceQueueId':{'type':Sequelize[_0x32dc('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e0711c8..9313413 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 _0xbf10=['moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','update','destroy','then','error','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x387a80,_0x551dbd){var _0x391b5c=function(_0x2fc32f){while(--_0x2fc32f){_0x387a80['push'](_0x387a80['shift']());}};_0x391b5c(++_0x551dbd);}(_0xbf10,0x114));var _0x0bf1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbf10[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x0bf1('0x0'));var rimraf=require(_0x0bf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bf1('0x2'));var rp=require(_0x0bf1('0x3'));var moment=require(_0x0bf1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0bf1('0x5'));var util=require(_0x0bf1('0x6'));var path=require(_0x0bf1('0x7'));var sox=require('sox');var csv=require(_0x0bf1('0x8'));var ejs=require(_0x0bf1('0x9'));var fs=require('fs');var fs_extra=require(_0x0bf1('0xa'));var _=require('lodash');var squel=require(_0x0bf1('0xb'));var crypto=require(_0x0bf1('0xc'));var jsforce=require(_0x0bf1('0xd'));var deskjs=require(_0x0bf1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0bf1('0xf'));var Papa=require(_0x0bf1('0x10'));var Redis=require('ioredis');var authService=require(_0x0bf1('0x11'));var qs=require(_0x0bf1('0x12'));var as=require(_0x0bf1('0x13'));var hardwareService=require(_0x0bf1('0x14'));var logger=require(_0x0bf1('0x15'))('api');var utils=require(_0x0bf1('0x16'));var config=require(_0x0bf1('0x17'));var licenseUtil=require(_0x0bf1('0x18'));var db=require(_0x0bf1('0x19'))['db'];function respondWithStatusCode(_0x3c9fc0,_0x20996b){_0x20996b=_0x20996b||0xcc;return function(_0x46bbc0){if(_0x46bbc0){return _0x3c9fc0['sendStatus'](_0x20996b);}return _0x3c9fc0[_0x0bf1('0x1a')](_0x20996b)[_0x0bf1('0x1b')]();};}function respondWithResult(_0x574a0e,_0x21d366){_0x21d366=_0x21d366||0xc8;return function(_0x5eef49){if(_0x5eef49){return _0x574a0e[_0x0bf1('0x1a')](_0x21d366)[_0x0bf1('0x1c')](_0x5eef49);}};}function respondWithFilteredResult(_0xcbcdf3,_0x2d2ac4){return function(_0x36fa3c){if(_0x36fa3c){var _0x3d5678=typeof _0x2d2ac4[_0x0bf1('0x1d')]===_0x0bf1('0x1e')&&typeof _0x2d2ac4[_0x0bf1('0x1f')]===_0x0bf1('0x1e');var _0x9097d6=_0x36fa3c['count'];var _0x2d0295=_0x3d5678?0x0:_0x2d2ac4[_0x0bf1('0x1d')];var _0x2cff62=_0x3d5678?_0x36fa3c[_0x0bf1('0x20')]:_0x2d2ac4[_0x0bf1('0x1d')]+_0x2d2ac4[_0x0bf1('0x1f')];var _0x347df0;if(_0x2cff62>=_0x9097d6){_0x2cff62=_0x9097d6;_0x347df0=0xc8;}else{_0x347df0=0xce;}_0xcbcdf3[_0x0bf1('0x1a')](_0x347df0);return _0xcbcdf3['set']('Content-Range',_0x2d0295+'-'+_0x2cff62+'/'+_0x9097d6)['json'](_0x36fa3c);}return null;};}function patchUpdates(_0x195301){return function(_0x3e0ad9){try{jsonpatch[_0x0bf1('0x21')](_0x3e0ad9,_0x195301,!![]);}catch(_0x509858){return BPromise['reject'](_0x509858);}return _0x3e0ad9['save']();};}function saveUpdates(_0x14724f,_0x121f04){return function(_0x339d74){if(_0x339d74){return _0x339d74[_0x0bf1('0x22')](_0x14724f)['then'](function(_0x21c7c1){return _0x21c7c1;});}return null;};}function removeEntity(_0x16324c,_0x35bb82){return function(_0x2d1159){if(_0x2d1159){return _0x2d1159[_0x0bf1('0x23')]()[_0x0bf1('0x24')](function(){_0x16324c['status'](0xcc)[_0x0bf1('0x1b')]();});}};}function handleEntityNotFound(_0x16d1ec,_0x13d074){return function(_0x1c1a07){if(!_0x1c1a07){_0x16d1ec['sendStatus'](0x194);}return _0x1c1a07;};}function handleError(_0x29b1e4,_0x4f5b4f){_0x4f5b4f=_0x4f5b4f||0x1f4;return function(_0x1aa393){logger[_0x0bf1('0x25')](_0x1aa393['stack']);if(_0x1aa393[_0x0bf1('0x26')]){delete _0x1aa393[_0x0bf1('0x26')];}_0x29b1e4[_0x0bf1('0x1a')](_0x4f5b4f)[_0x0bf1('0x27')](_0x1aa393);};}exports[_0x0bf1('0x28')]=function(_0x4c41ed,_0x281d77){var _0x2f1e74={},_0x1d7b03={},_0x4a7730={'count':0x0,'rows':[]};var _0x3e3d8c=_[_0x0bf1('0x29')](db[_0x0bf1('0x2a')][_0x0bf1('0x2b')],function(_0x455686){return{'name':_0x455686['fieldName'],'type':_0x455686[_0x0bf1('0x2c')][_0x0bf1('0x2d')]};});_0x1d7b03[_0x0bf1('0x2e')]=_[_0x0bf1('0x29')](_0x3e3d8c,_0x0bf1('0x26'));_0x1d7b03[_0x0bf1('0x2f')]=_[_0x0bf1('0x30')](_0x4c41ed[_0x0bf1('0x2f')]);_0x1d7b03[_0x0bf1('0x31')]=_[_0x0bf1('0x32')](_0x1d7b03[_0x0bf1('0x2e')],_0x1d7b03[_0x0bf1('0x2f')]);_0x2f1e74[_0x0bf1('0x33')]=_[_0x0bf1('0x32')](_0x1d7b03[_0x0bf1('0x2e')],qs['fields'](_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x34')]));_0x2f1e74[_0x0bf1('0x33')]=_0x2f1e74['attributes']['length']?_0x2f1e74[_0x0bf1('0x33')]:_0x1d7b03['model'];if(!_0x4c41ed[_0x0bf1('0x2f')]['hasOwnProperty'](_0x0bf1('0x35'))){_0x2f1e74['limit']=qs[_0x0bf1('0x1f')](_0x4c41ed[_0x0bf1('0x2f')]['limit']);_0x2f1e74['offset']=qs[_0x0bf1('0x1d')](_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x1d')]);}_0x2f1e74[_0x0bf1('0x36')]=qs[_0x0bf1('0x37')](_0x4c41ed[_0x0bf1('0x2f')]['sort']);_0x2f1e74[_0x0bf1('0x38')]=qs[_0x0bf1('0x31')](_['pick'](_0x4c41ed['query'],_0x1d7b03[_0x0bf1('0x31')]),_0x3e3d8c);if(_0x4c41ed[_0x0bf1('0x2f')]['filter']){_0x2f1e74['where']=_[_0x0bf1('0x39')](_0x2f1e74[_0x0bf1('0x38')],{'$or':_[_0x0bf1('0x29')](_0x3e3d8c,function(_0x52f262){if(_0x52f262[_0x0bf1('0x2c')]!=='VIRTUAL'){var _0x2982f3={};_0x2982f3[_0x52f262['name']]={'$like':'%'+_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x3a')]+'%'};return _0x2982f3;}})});}_0x2f1e74=_['merge']({},_0x2f1e74,_0x4c41ed[_0x0bf1('0x3b')]);var _0x210e3e={'where':_0x2f1e74['where']};return db[_0x0bf1('0x2a')]['count'](_0x210e3e)[_0x0bf1('0x24')](function(_0x24263a){_0x4a7730[_0x0bf1('0x20')]=_0x24263a;if(_0x4c41ed['query'][_0x0bf1('0x3c')]){_0x2f1e74[_0x0bf1('0x3d')]=[{'all':!![]}];}return db[_0x0bf1('0x2a')][_0x0bf1('0x3e')](_0x2f1e74);})[_0x0bf1('0x24')](function(_0x38636b){_0x4a7730[_0x0bf1('0x3f')]=_0x38636b;return _0x4a7730;})[_0x0bf1('0x24')](respondWithFilteredResult(_0x281d77,_0x2f1e74))[_0x0bf1('0x40')](handleError(_0x281d77,null));};exports[_0x0bf1('0x41')]=function(_0x1b3046,_0x2899f6){var _0x13d3b2={'raw':!![],'where':{'id':_0x1b3046[_0x0bf1('0x42')]['id']}},_0x253b2a={};_0x253b2a['model']=_[_0x0bf1('0x30')](db['CmHopperBlack']['rawAttributes']);_0x253b2a['query']=_['keys'](_0x1b3046[_0x0bf1('0x2f')]);_0x253b2a[_0x0bf1('0x31')]=_['intersection'](_0x253b2a[_0x0bf1('0x2e')],_0x253b2a[_0x0bf1('0x2f')]);_0x13d3b2[_0x0bf1('0x33')]=_[_0x0bf1('0x32')](_0x253b2a['model'],qs[_0x0bf1('0x34')](_0x1b3046[_0x0bf1('0x2f')][_0x0bf1('0x34')]));_0x13d3b2[_0x0bf1('0x33')]=_0x13d3b2['attributes']['length']?_0x13d3b2[_0x0bf1('0x33')]:_0x253b2a[_0x0bf1('0x2e')];if(_0x1b3046[_0x0bf1('0x2f')][_0x0bf1('0x3c')]){_0x13d3b2[_0x0bf1('0x3d')]=[{'all':!![]}];}_0x13d3b2=_[_0x0bf1('0x39')]({},_0x13d3b2,_0x1b3046[_0x0bf1('0x3b')]);return db[_0x0bf1('0x2a')][_0x0bf1('0x43')](_0x13d3b2)[_0x0bf1('0x24')](handleEntityNotFound(_0x2899f6,null))[_0x0bf1('0x24')](respondWithResult(_0x2899f6,null))[_0x0bf1('0x40')](handleError(_0x2899f6,null));};exports[_0x0bf1('0x22')]=function(_0x4ff898,_0x4831e2){if(_0x4ff898[_0x0bf1('0x44')]['id']){delete _0x4ff898[_0x0bf1('0x44')]['id'];}return db[_0x0bf1('0x2a')][_0x0bf1('0x43')]({'where':{'id':_0x4ff898['params']['id']}})[_0x0bf1('0x24')](handleEntityNotFound(_0x4831e2,null))[_0x0bf1('0x24')](saveUpdates(_0x4ff898['body'],null))[_0x0bf1('0x24')](respondWithResult(_0x4831e2,null))[_0x0bf1('0x40')](handleError(_0x4831e2,null));};exports[_0x0bf1('0x23')]=function(_0x2160fe,_0x36fb30){return db[_0x0bf1('0x2a')][_0x0bf1('0x43')]({'where':{'id':_0x2160fe[_0x0bf1('0x42')]['id']}})['then'](handleEntityNotFound(_0x36fb30,null))[_0x0bf1('0x24')](removeEntity(_0x36fb30,null))['catch'](handleError(_0x36fb30,null));};exports[_0x0bf1('0x45')]=function(_0x574c13,_0x58fbd2){return db[_0x0bf1('0x2a')]['describe']()[_0x0bf1('0x24')](respondWithResult(_0x58fbd2,null))[_0x0bf1('0x40')](handleError(_0x58fbd2,null));}; \ No newline at end of file +var _0x30f9=['lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','apply','save','update','destroy','then','name','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','CmHopperBlack','findAll','rows','catch','includeAll','include','body','params','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x30f9,0xc5));var _0x930f=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x30f9[_0x3e3221];return _0x190da4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x930f('0x0'));var jsonpatch=require(_0x930f('0x1'));var rp=require(_0x930f('0x2'));var moment=require(_0x930f('0x3'));var BPromise=require(_0x930f('0x4'));var Mustache=require(_0x930f('0x5'));var util=require(_0x930f('0x6'));var path=require(_0x930f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x930f('0x8'));var fs=require('fs');var fs_extra=require(_0x930f('0x9'));var _=require(_0x930f('0xa'));var squel=require('squel');var crypto=require(_0x930f('0xb'));var jsforce=require(_0x930f('0xc'));var deskjs=require(_0x930f('0xd'));var toCsv=require(_0x930f('0xe'));var querystring=require(_0x930f('0xf'));var Papa=require(_0x930f('0x10'));var Redis=require(_0x930f('0x11'));var authService=require(_0x930f('0x12'));var qs=require(_0x930f('0x13'));var as=require(_0x930f('0x14'));var hardwareService=require(_0x930f('0x15'));var logger=require(_0x930f('0x16'))(_0x930f('0x17'));var utils=require('../../config/utils');var config=require(_0x930f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aae22,_0x509ad1){_0x509ad1=_0x509ad1||0xcc;return function(_0x726ed6){if(_0x726ed6){return _0x2aae22[_0x930f('0x19')](_0x509ad1);}return _0x2aae22[_0x930f('0x1a')](_0x509ad1)[_0x930f('0x1b')]();};}function respondWithResult(_0x3760a9,_0x41c747){_0x41c747=_0x41c747||0xc8;return function(_0x3ae186){if(_0x3ae186){return _0x3760a9['status'](_0x41c747)['json'](_0x3ae186);}};}function respondWithFilteredResult(_0x35f2a9,_0x137134){return function(_0x348bcb){if(_0x348bcb){var _0x1c22ac=typeof _0x137134['offset']===_0x930f('0x1c')&&typeof _0x137134['limit']===_0x930f('0x1c');var _0x525d4b=_0x348bcb[_0x930f('0x1d')];var _0x5aac0c=_0x1c22ac?0x0:_0x137134[_0x930f('0x1e')];var _0x175ad5=_0x1c22ac?_0x348bcb[_0x930f('0x1d')]:_0x137134['offset']+_0x137134[_0x930f('0x1f')];var _0x4a4cac;if(_0x175ad5>=_0x525d4b){_0x175ad5=_0x525d4b;_0x4a4cac=0xc8;}else{_0x4a4cac=0xce;}_0x35f2a9[_0x930f('0x1a')](_0x4a4cac);return _0x35f2a9['set']('Content-Range',_0x5aac0c+'-'+_0x175ad5+'/'+_0x525d4b)['json'](_0x348bcb);}return null;};}function patchUpdates(_0x5ee21e){return function(_0x3944a6){try{jsonpatch[_0x930f('0x20')](_0x3944a6,_0x5ee21e,!![]);}catch(_0x3f8567){return BPromise['reject'](_0x3f8567);}return _0x3944a6[_0x930f('0x21')]();};}function saveUpdates(_0x376ee7,_0x9a181f){return function(_0x1b57ab){if(_0x1b57ab){return _0x1b57ab[_0x930f('0x22')](_0x376ee7)['then'](function(_0x33f507){return _0x33f507;});}return null;};}function removeEntity(_0x591f6b,_0x3eeb63){return function(_0x1759cd){if(_0x1759cd){return _0x1759cd[_0x930f('0x23')]()[_0x930f('0x24')](function(){_0x591f6b[_0x930f('0x1a')](0xcc)[_0x930f('0x1b')]();});}};}function handleEntityNotFound(_0x4a6058,_0x245d35){return function(_0x54f127){if(!_0x54f127){_0x4a6058['sendStatus'](0x194);}return _0x54f127;};}function handleError(_0x12a7d9,_0x860a2d){_0x860a2d=_0x860a2d||0x1f4;return function(_0x47029f){logger['error'](_0x47029f['stack']);if(_0x47029f[_0x930f('0x25')]){delete _0x47029f[_0x930f('0x25')];}_0x12a7d9[_0x930f('0x1a')](_0x860a2d)['send'](_0x47029f);};}exports['index']=function(_0x569885,_0x2af6ad){var _0x58583f={},_0x5a7f8a={},_0x33c8ac={'count':0x0,'rows':[]};var _0x323731=_[_0x930f('0x26')](db['CmHopperBlack'][_0x930f('0x27')],function(_0x7e9e01){return{'name':_0x7e9e01['fieldName'],'type':_0x7e9e01[_0x930f('0x28')][_0x930f('0x29')]};});_0x5a7f8a[_0x930f('0x2a')]=_['map'](_0x323731,'name');_0x5a7f8a['query']=_[_0x930f('0x2b')](_0x569885[_0x930f('0x2c')]);_0x5a7f8a['filters']=_[_0x930f('0x2d')](_0x5a7f8a[_0x930f('0x2a')],_0x5a7f8a[_0x930f('0x2c')]);_0x58583f[_0x930f('0x2e')]=_['intersection'](_0x5a7f8a['model'],qs[_0x930f('0x2f')](_0x569885[_0x930f('0x2c')][_0x930f('0x2f')]));_0x58583f['attributes']=_0x58583f[_0x930f('0x2e')][_0x930f('0x30')]?_0x58583f[_0x930f('0x2e')]:_0x5a7f8a[_0x930f('0x2a')];if(!_0x569885[_0x930f('0x2c')][_0x930f('0x31')](_0x930f('0x32'))){_0x58583f[_0x930f('0x1f')]=qs[_0x930f('0x1f')](_0x569885[_0x930f('0x2c')][_0x930f('0x1f')]);_0x58583f[_0x930f('0x1e')]=qs['offset'](_0x569885[_0x930f('0x2c')][_0x930f('0x1e')]);}_0x58583f[_0x930f('0x33')]=qs[_0x930f('0x34')](_0x569885[_0x930f('0x2c')][_0x930f('0x34')]);_0x58583f[_0x930f('0x35')]=qs[_0x930f('0x36')](_[_0x930f('0x37')](_0x569885[_0x930f('0x2c')],_0x5a7f8a[_0x930f('0x36')]),_0x323731);if(_0x569885[_0x930f('0x2c')]['filter']){_0x58583f[_0x930f('0x35')]=_['merge'](_0x58583f['where'],{'$or':_['map'](_0x323731,function(_0x2078e5){if(_0x2078e5[_0x930f('0x28')]!==_0x930f('0x38')){var _0x397b93={};_0x397b93[_0x2078e5[_0x930f('0x25')]]={'$like':'%'+_0x569885[_0x930f('0x2c')]['filter']+'%'};return _0x397b93;}})});}_0x58583f=_[_0x930f('0x39')]({},_0x58583f,_0x569885[_0x930f('0x3a')]);var _0x1be782={'where':_0x58583f['where']};return db[_0x930f('0x3b')][_0x930f('0x1d')](_0x1be782)[_0x930f('0x24')](function(_0x5cf811){_0x33c8ac['count']=_0x5cf811;if(_0x569885[_0x930f('0x2c')]['includeAll']){_0x58583f['include']=[{'all':!![]}];}return db[_0x930f('0x3b')][_0x930f('0x3c')](_0x58583f);})[_0x930f('0x24')](function(_0x1c34d0){_0x33c8ac[_0x930f('0x3d')]=_0x1c34d0;return _0x33c8ac;})['then'](respondWithFilteredResult(_0x2af6ad,_0x58583f))[_0x930f('0x3e')](handleError(_0x2af6ad,null));};exports['show']=function(_0x5dd338,_0x352089){var _0x3ae0d3={'raw':!![],'where':{'id':_0x5dd338['params']['id']}},_0x5233f6={};_0x5233f6[_0x930f('0x2a')]=_[_0x930f('0x2b')](db[_0x930f('0x3b')]['rawAttributes']);_0x5233f6['query']=_[_0x930f('0x2b')](_0x5dd338[_0x930f('0x2c')]);_0x5233f6['filters']=_[_0x930f('0x2d')](_0x5233f6['model'],_0x5233f6['query']);_0x3ae0d3['attributes']=_[_0x930f('0x2d')](_0x5233f6[_0x930f('0x2a')],qs[_0x930f('0x2f')](_0x5dd338[_0x930f('0x2c')][_0x930f('0x2f')]));_0x3ae0d3[_0x930f('0x2e')]=_0x3ae0d3[_0x930f('0x2e')][_0x930f('0x30')]?_0x3ae0d3['attributes']:_0x5233f6[_0x930f('0x2a')];if(_0x5dd338[_0x930f('0x2c')][_0x930f('0x3f')]){_0x3ae0d3[_0x930f('0x40')]=[{'all':!![]}];}_0x3ae0d3=_[_0x930f('0x39')]({},_0x3ae0d3,_0x5dd338[_0x930f('0x3a')]);return db[_0x930f('0x3b')]['find'](_0x3ae0d3)['then'](handleEntityNotFound(_0x352089,null))[_0x930f('0x24')](respondWithResult(_0x352089,null))['catch'](handleError(_0x352089,null));};exports['update']=function(_0x3b3d83,_0x2a3642){if(_0x3b3d83[_0x930f('0x41')]['id']){delete _0x3b3d83['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3b3d83[_0x930f('0x42')]['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x2a3642,null))['then'](saveUpdates(_0x3b3d83[_0x930f('0x41')],null))['then'](respondWithResult(_0x2a3642,null))['catch'](handleError(_0x2a3642,null));};exports[_0x930f('0x23')]=function(_0x3a0fbb,_0x3420c4){return db[_0x930f('0x3b')][_0x930f('0x43')]({'where':{'id':_0x3a0fbb[_0x930f('0x42')]['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x3420c4,null))[_0x930f('0x24')](removeEntity(_0x3420c4,null))[_0x930f('0x3e')](handleError(_0x3420c4,null));};exports[_0x930f('0x44')]=function(_0x289738,_0x1d5c23){return db['CmHopperBlack'][_0x930f('0x44')]()[_0x930f('0x24')](respondWithResult(_0x1d5c23,null))[_0x930f('0x3e')](handleError(_0x1d5c23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 047fd64..dea4d2c 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 _0x2cad=['moment','bluebird','request-promise','../../config/environment','exports','define','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x4a92ea,_0xefc15b){var _0x8eb7d1=function(_0x541c8b){while(--_0x541c8b){_0x4a92ea['push'](_0x4a92ea['shift']());}};_0x8eb7d1(++_0xefc15b);}(_0x2cad,0xd8));var _0xd2ca=function(_0x145241,_0x56bf84){_0x145241=_0x145241-0x0;var _0x43d7d5=_0x2cad[_0x145241];return _0x43d7d5;};'use strict';var _=require(_0xd2ca('0x0'));var util=require(_0xd2ca('0x1'));var logger=require(_0xd2ca('0x2'))(_0xd2ca('0x3'));var moment=require(_0xd2ca('0x4'));var BPromise=require(_0xd2ca('0x5'));var rp=require(_0xd2ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2ca('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xd2ca('0x8')]=function(_0x4b7489,_0x3f2c32){return _0x4b7489[_0xd2ca('0x9')]('CmHopperBlack',attributes,{'tableName':_0xd2ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e3a=['../../config/environment','./cmHopperBlack.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e3a,0x1f2));var _0xa1e3=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x1e3a[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0xa1e3('0x0'));var util=require(_0xa1e3('0x1'));var logger=require(_0xa1e3('0x2'))(_0xa1e3('0x3'));var moment=require('moment');var BPromise=require(_0xa1e3('0x4'));var rp=require(_0xa1e3('0x5'));var fs=require('fs');var path=require(_0xa1e3('0x6'));var rimraf=require(_0xa1e3('0x7'));var config=require(_0xa1e3('0x8'));var attributes=require(_0xa1e3('0x9'));module[_0xa1e3('0xa')]=function(_0x565bea,_0x281b81){return _0x565bea['define']('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 5091630..304513a 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 _0x7c0f=['attributes','include','map','model','stringify','UpdateCmHopperBlack','body','where','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw'];(function(_0x486f0b,_0x19a9b7){var _0x12ccaf=function(_0x4ba198){while(--_0x4ba198){_0x486f0b['push'](_0x486f0b['shift']());}};_0x12ccaf(++_0x19a9b7);}(_0x7c0f,0x13b));var _0xf7c0=function(_0x137f41,_0xac8039){_0x137f41=_0x137f41-0x0;var _0x153e2c=_0x7c0f[_0x137f41];return _0x153e2c;};'use strict';var _=require(_0xf7c0('0x0'));var util=require(_0xf7c0('0x1'));var moment=require(_0xf7c0('0x2'));var BPromise=require(_0xf7c0('0x3'));var rs=require(_0xf7c0('0x4'));var fs=require('fs');var Redis=require(_0xf7c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7c0('0x6'));var logger=require(_0xf7c0('0x7'))(_0xf7c0('0x8'));var config=require(_0xf7c0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbebb6f,_0xd5004,_0x5e54e4){return new BPromise(function(_0x4ed8c0,_0x3f1f80){return client['request'](_0xbebb6f,_0x5e54e4)[_0xf7c0('0xb')](function(_0x821207){logger[_0xf7c0('0xc')](_0xf7c0('0xd'),_0xd5004,_0xf7c0('0xe'));logger[_0xf7c0('0xf')](_0xf7c0('0x10'),_0xd5004,_0xf7c0('0xe'),JSON['stringify'](_0x821207));if(_0x821207[_0xf7c0('0x11')]){if(_0x821207[_0xf7c0('0x11')][_0xf7c0('0x12')]===0x1f4){logger[_0xf7c0('0x11')](_0xf7c0('0xd'),_0xd5004,_0x821207[_0xf7c0('0x11')][_0xf7c0('0x13')]);return _0x3f1f80(_0x821207['error']['message']);}logger[_0xf7c0('0x11')](_0xf7c0('0xd'),_0xd5004,_0x821207[_0xf7c0('0x11')][_0xf7c0('0x13')]);return _0x4ed8c0(_0x821207[_0xf7c0('0x11')][_0xf7c0('0x13')]);}else{logger['info'](_0xf7c0('0xd'),_0xd5004,_0xf7c0('0xe'));_0x4ed8c0(_0x821207[_0xf7c0('0x14')][_0xf7c0('0x13')]);}})[_0xf7c0('0x15')](function(_0x551499){logger[_0xf7c0('0x11')](_0xf7c0('0xd'),_0xd5004,_0x551499);_0x3f1f80(_0x551499);});});}exports[_0xf7c0('0x16')]=function(_0x23b21b){var _0x466736=this;return new Promise(function(_0x2b4cc2,_0x828898){return db[_0xf7c0('0x17')][_0xf7c0('0x18')]({'raw':_0x23b21b[_0xf7c0('0x19')]?_0x23b21b[_0xf7c0('0x19')][_0xf7c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x23b21b[_0xf7c0('0x19')]?_0x23b21b[_0xf7c0('0x19')]['where']||null:null,'attributes':_0x23b21b[_0xf7c0('0x19')]?_0x23b21b[_0xf7c0('0x19')][_0xf7c0('0x1b')]||null:null,'limit':_0x23b21b[_0xf7c0('0x19')]?_0x23b21b[_0xf7c0('0x19')]['limit']||null:null,'include':_0x23b21b[_0xf7c0('0x19')]?_0x23b21b[_0xf7c0('0x19')][_0xf7c0('0x1c')]?_[_0xf7c0('0x1d')](_0x23b21b[_0xf7c0('0x19')][_0xf7c0('0x1c')],function(_0x50864a){return{'model':db[_0x50864a[_0xf7c0('0x1e')]],'as':_0x50864a['as'],'attributes':_0x50864a[_0xf7c0('0x1b')],'include':_0x50864a[_0xf7c0('0x1c')]?_[_0xf7c0('0x1d')](_0x50864a[_0xf7c0('0x1c')],function(_0x191223){return{'model':db[_0x191223[_0xf7c0('0x1e')]],'as':_0x191223['as'],'attributes':_0x191223['attributes'],'include':_0x191223[_0xf7c0('0x1c')]?_[_0xf7c0('0x1d')](_0x191223[_0xf7c0('0x1c')],function(_0x9a5f51){return{'model':db[_0x9a5f51[_0xf7c0('0x1e')]],'as':_0x9a5f51['as'],'attributes':_0x9a5f51[_0xf7c0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc69eaa){logger[_0xf7c0('0xc')](_0xf7c0('0x16'),_0x23b21b);logger[_0xf7c0('0xf')]('GetCmHopperBlack',_0x23b21b,JSON[_0xf7c0('0x1f')](_0xc69eaa));_0x2b4cc2(_0xc69eaa);})[_0xf7c0('0x15')](function(_0x1770ba){logger[_0xf7c0('0x11')](_0xf7c0('0x16'),_0x1770ba[_0xf7c0('0x13')],_0x23b21b);_0x828898(_0x466736[_0xf7c0('0x11')](0x1f4,_0x1770ba[_0xf7c0('0x13')]));});});};exports[_0xf7c0('0x20')]=function(_0x29a4ad){var _0x360f0d=this;return new Promise(function(_0x3fdcd2,_0x4b8b80){return db[_0xf7c0('0x17')]['update'](_0x29a4ad[_0xf7c0('0x21')],{'raw':_0x29a4ad[_0xf7c0('0x19')]?_0x29a4ad['options'][_0xf7c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a4ad[_0xf7c0('0x19')]?_0x29a4ad[_0xf7c0('0x19')][_0xf7c0('0x22')]||null:null,'attributes':_0x29a4ad['options']?_0x29a4ad[_0xf7c0('0x19')][_0xf7c0('0x1b')]||null:null,'limit':_0x29a4ad[_0xf7c0('0x19')]?_0x29a4ad[_0xf7c0('0x19')][_0xf7c0('0x23')]||null:null})['then'](function(_0xd79a3a){logger[_0xf7c0('0xc')](_0xf7c0('0x20'),_0x29a4ad);logger[_0xf7c0('0xf')](_0xf7c0('0x20'),_0x29a4ad,JSON['stringify'](_0xd79a3a));_0x3fdcd2(_0xd79a3a);})[_0xf7c0('0x15')](function(_0x409f99){logger[_0xf7c0('0x11')](_0xf7c0('0x20'),_0x409f99[_0xf7c0('0x13')],_0x29a4ad);_0x4b8b80(_0x360f0d[_0xf7c0('0x11')](0x1f4,_0x409f99[_0xf7c0('0x13')]));});});};exports[_0xf7c0('0x24')]=function(_0x2f4e99){var _0x3e1d19=this;return new Promise(function(_0x590d74,_0x28497f){return db[_0xf7c0('0x17')][_0xf7c0('0x25')]({'where':_0x2f4e99['options']?_0x2f4e99[_0xf7c0('0x19')]['where']||null:null})['then'](function(_0x1c6b63){logger[_0xf7c0('0xc')](_0xf7c0('0x24'),_0x2f4e99);logger['debug'](_0xf7c0('0x24'),_0x2f4e99,JSON[_0xf7c0('0x1f')](_0x1c6b63));_0x590d74(_0x1c6b63);})[_0xf7c0('0x15')](function(_0x2d8685){logger[_0xf7c0('0x11')](_0xf7c0('0x24'),_0x2d8685['message'],_0x2f4e99);_0x28497f(_0x3e1d19[_0xf7c0('0x11')](0x1f4,_0x2d8685[_0xf7c0('0x13')]));});});}; \ No newline at end of file +var _0x5a27=['CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','GetCmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','CmHopperBlack','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','request','then','info'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5a27,0xc7));var _0x75a2=function(_0x28688d,_0x190a6c){_0x28688d=_0x28688d-0x0;var _0x2c043e=_0x5a27[_0x28688d];return _0x2c043e;};'use strict';var _=require(_0x75a2('0x0'));var util=require(_0x75a2('0x1'));var moment=require(_0x75a2('0x2'));var BPromise=require(_0x75a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75a2('0x5'));var config=require(_0x75a2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x75a2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3115fa,_0x4b12c3,_0x4f4e45){return new BPromise(function(_0x1d8578,_0x5cd2b0){return client[_0x75a2('0x8')](_0x3115fa,_0x4f4e45)[_0x75a2('0x9')](function(_0x271bcc){logger[_0x75a2('0xa')](_0x75a2('0xb'),_0x4b12c3,'request\x20sent');logger[_0x75a2('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4b12c3,_0x75a2('0xd'),JSON[_0x75a2('0xe')](_0x271bcc));if(_0x271bcc['error']){if(_0x271bcc['error'][_0x75a2('0xf')]===0x1f4){logger['error'](_0x75a2('0xb'),_0x4b12c3,_0x271bcc[_0x75a2('0x10')][_0x75a2('0x11')]);return _0x5cd2b0(_0x271bcc['error'][_0x75a2('0x11')]);}logger[_0x75a2('0x10')](_0x75a2('0xb'),_0x4b12c3,_0x271bcc['error'][_0x75a2('0x11')]);return _0x1d8578(_0x271bcc['error'][_0x75a2('0x11')]);}else{logger['info'](_0x75a2('0xb'),_0x4b12c3,_0x75a2('0xd'));_0x1d8578(_0x271bcc['result'][_0x75a2('0x11')]);}})[_0x75a2('0x12')](function(_0x1a4361){logger[_0x75a2('0x10')](_0x75a2('0xb'),_0x4b12c3,_0x1a4361);_0x5cd2b0(_0x1a4361);});});}exports[_0x75a2('0x13')]=function(_0x97a136){var _0x5cb681=this;return new Promise(function(_0x3abf48,_0x412bf8){return db['CmHopperBlack'][_0x75a2('0x14')]({'raw':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x16')]===undefined?!![]:![]:!![],'where':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x17')]||null:null,'attributes':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')]['attributes']||null:null,'limit':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x18')]||null:null,'include':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x97a136[_0x75a2('0x15')][_0x75a2('0x19')],function(_0x5c379b){return{'model':db[_0x5c379b[_0x75a2('0x1b')]],'as':_0x5c379b['as'],'attributes':_0x5c379b['attributes'],'include':_0x5c379b[_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x5c379b[_0x75a2('0x19')],function(_0x5de28b){return{'model':db[_0x5de28b[_0x75a2('0x1b')]],'as':_0x5de28b['as'],'attributes':_0x5de28b[_0x75a2('0x1c')],'include':_0x5de28b[_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x5de28b[_0x75a2('0x19')],function(_0x36bcf9){return{'model':db[_0x36bcf9['model']],'as':_0x36bcf9['as'],'attributes':_0x36bcf9[_0x75a2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x399963){logger['info'](_0x75a2('0x13'),_0x97a136);logger['debug']('GetCmHopperBlack',_0x97a136,JSON[_0x75a2('0xe')](_0x399963));_0x3abf48(_0x399963);})[_0x75a2('0x12')](function(_0x42d743){logger['error'](_0x75a2('0x13'),_0x42d743[_0x75a2('0x11')],_0x97a136);_0x412bf8(_0x5cb681[_0x75a2('0x10')](0x1f4,_0x42d743[_0x75a2('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x332fa3){var _0x5e6e17=this;return new Promise(function(_0x3acdc0,_0x116b4f){return db[_0x75a2('0x1d')][_0x75a2('0x1e')](_0x332fa3[_0x75a2('0x1f')],{'raw':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x17')]||null:null,'attributes':_0x332fa3[_0x75a2('0x15')]?_0x332fa3['options'][_0x75a2('0x1c')]||null:null,'limit':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x18')]||null:null})[_0x75a2('0x9')](function(_0x44f16e){logger[_0x75a2('0xa')]('UpdateCmHopperBlack',_0x332fa3);logger[_0x75a2('0xc')](_0x75a2('0x20'),_0x332fa3,JSON[_0x75a2('0xe')](_0x44f16e));_0x3acdc0(_0x44f16e);})['catch'](function(_0x8c3cb0){logger[_0x75a2('0x10')](_0x75a2('0x20'),_0x8c3cb0['message'],_0x332fa3);_0x116b4f(_0x5e6e17[_0x75a2('0x10')](0x1f4,_0x8c3cb0['message']));});});};exports[_0x75a2('0x21')]=function(_0x17b1f1){var _0x43f26a=this;return new Promise(function(_0x1fb391,_0x8fb274){return db['CmHopperBlack'][_0x75a2('0x22')]({'where':_0x17b1f1[_0x75a2('0x15')]?_0x17b1f1[_0x75a2('0x15')][_0x75a2('0x17')]||null:null})[_0x75a2('0x9')](function(_0x241fe2){logger['info'](_0x75a2('0x21'),_0x17b1f1);logger[_0x75a2('0xc')](_0x75a2('0x21'),_0x17b1f1,JSON[_0x75a2('0xe')](_0x241fe2));_0x1fb391(_0x241fe2);})['catch'](function(_0x18bb0b){logger['error'](_0x75a2('0x21'),_0x18bb0b[_0x75a2('0x11')],_0x17b1f1);_0x8fb274(_0x43f26a['error'](0x1f4,_0x18bb0b['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 393bca6..8759ad7 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 _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperBlack.controller','index','get','describe','show','/:id'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xd046,0x129));var _0x6d04=function(_0x50f6ef,_0x393397){_0x50f6ef=_0x50f6ef-0x0;var _0x6020f1=_0xd046[_0x50f6ef];return _0x6020f1;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['put'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d04('0xa'),auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router; \ No newline at end of file +var _0x9a5a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x1c62ce,_0x3c20ff){var _0x346c75=function(_0x374fd5){while(--_0x374fd5){_0x1c62ce['push'](_0x1c62ce['shift']());}};_0x346c75(++_0x3c20ff);}(_0x9a5a,0x194));var _0xa9a5=function(_0x1922c1,_0x835260){_0x1922c1=_0x1922c1-0x0;var _0x3d744c=_0x9a5a[_0x1922c1];return _0x3d744c;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')](_0xa9a5('0x11'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x12')]);router[_0xa9a5('0x13')](_0xa9a5('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8aa74f7..5b60199 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 _0x8102=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x5b2b04,_0x2bbd81){var _0x1b5148=function(_0x1c9c8c){while(--_0x1c9c8c){_0x5b2b04['push'](_0x5b2b04['shift']());}};_0x1b5148(++_0x2bbd81);}(_0x8102,0x1c9));var _0x2810=function(_0x41ab07,_0x52ae84){_0x41ab07=_0x41ab07-0x0;var _0x4106b2=_0x8102[_0x41ab07];return _0x4106b2;};'use strict';var Sequelize=require(_0x2810('0x0'));var moment=require(_0x2810('0x1'));module[_0x2810('0x2')]={'state':{'type':Sequelize[_0x2810('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2810('0x4')]},'scheduledat':{'type':Sequelize[_0x2810('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2810('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2810('0x4')]},'calleridnum':{'type':Sequelize[_0x2810('0x4')]},'calleridname':{'type':Sequelize[_0x2810('0x4')]},'starttime':{'type':Sequelize[_0x2810('0x5')]},'responsetime':{'type':Sequelize[_0x2810('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2810('0x5')]},'endtime':{'type':Sequelize[_0x2810('0x5')]},'ringtime':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2810('0x4')]},'campaign':{'type':Sequelize[_0x2810('0x4')]},'campaigntype':{'type':Sequelize[_0x2810('0x4')]},'membername':{'type':Sequelize[_0x2810('0x4')]},'reason':{'type':Sequelize[_0x2810('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2810('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2810('0x4')]},'dispositionat':{'type':Sequelize[_0x2810('0x5')],'set':function(_0x3b973e){var _0x407161=this['getDataValue'](_0x2810('0x6'));if(_0x407161&&_0x3b973e){this[_0x2810('0x7')](_0x2810('0x8'),moment(_0x3b973e)[_0x2810('0x9')](moment(_0x407161),_0x2810('0xa')));}return this[_0x2810('0x7')](_0x2810('0xb'),_0x3b973e);}},'amd':{'type':Sequelize[_0x2810('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2810('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2810('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2810('0x5')]},'callback':{'type':Sequelize[_0x2810('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2810('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2810('0x5')]},'deleted':{'type':Sequelize[_0x2810('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2810('0x5')]},'recallme':{'type':Sequelize[_0x2810('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2810('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5165=['followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x595b02,_0x4d7c97){var _0x50d5ec=function(_0x6c2bc8){while(--_0x6c2bc8){_0x595b02['push'](_0x595b02['shift']());}};_0x50d5ec(++_0x4d7c97);}(_0x5165,0x1bc));var _0x5516=function(_0x5264a7,_0x44a706){_0x5264a7=_0x5264a7-0x0;var _0x44f401=_0x5165[_0x5264a7];return _0x44f401;};'use strict';var Sequelize=require(_0x5516('0x0'));var moment=require(_0x5516('0x1'));module['exports']={'state':{'type':Sequelize[_0x5516('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5516('0x3')]},'scheduledat':{'type':Sequelize[_0x5516('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5516('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5516('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5516('0x3')]},'starttime':{'type':Sequelize[_0x5516('0x4')]},'responsetime':{'type':Sequelize[_0x5516('0x4')]},'answertime':{'type':Sequelize[_0x5516('0x4')]},'droptime':{'type':Sequelize[_0x5516('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5516('0x3')]},'campaign':{'type':Sequelize[_0x5516('0x3')]},'campaigntype':{'type':Sequelize[_0x5516('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x5516('0x3')]},'disposition':{'type':Sequelize[_0x5516('0x3')]},'secondDisposition':{'type':Sequelize[_0x5516('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5516('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x59fe9a){var _0x31688f=this[_0x5516('0x5')]('endtime');if(_0x31688f&&_0x59fe9a){this[_0x5516('0x6')](_0x5516('0x7'),moment(_0x59fe9a)[_0x5516('0x8')](moment(_0x31688f),'seconds'));}return this[_0x5516('0x6')](_0x5516('0x9'),_0x59fe9a);}},'amd':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5516('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5516('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5516('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 4c14e3d..1f19107 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 _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x1f245d,_0x28a7e3){var _0xb1a777=function(_0x41d084){while(--_0x41d084){_0x1f245d['push'](_0x1f245d['shift']());}};_0xb1a777(++_0x28a7e3);}(_0x4c60,0xc1));var _0x04c6=function(_0x52cf2a,_0x1a4c93){_0x52cf2a=_0x52cf2a-0x0;var _0x364feb=_0x4c60[_0x52cf2a];return _0x364feb;};'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['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_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['CmHopperFinal'][_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['CmHopperFinal'][_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')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));}; \ No newline at end of file +var _0x2a07=['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','index','map','CmHopperFinal','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','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x28cdfb,_0x208cec){var _0x312003=function(_0x24eebe){while(--_0x24eebe){_0x28cdfb['push'](_0x28cdfb['shift']());}};_0x312003(++_0x208cec);}(_0x2a07,0x74));var _0x72a0=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x2a07[_0x30c2ae];return _0x1ee1cc;};'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['CmHopperFinal'][_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')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8bf4617..9eb7c32 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 _0x9012=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x342b69,_0x33890c){var _0x409937=function(_0x5d338e){while(--_0x5d338e){_0x342b69['push'](_0x342b69['shift']());}};_0x409937(++_0x33890c);}(_0x9012,0x1b6));var _0x2901=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x9012[_0x301c34];return _0x1a8c5a;};'use strict';var _=require(_0x2901('0x0'));var util=require(_0x2901('0x1'));var logger=require('../../config/logger')(_0x2901('0x2'));var moment=require(_0x2901('0x3'));var BPromise=require(_0x2901('0x4'));var rp=require(_0x2901('0x5'));var fs=require('fs');var path=require(_0x2901('0x6'));var rimraf=require(_0x2901('0x7'));var config=require(_0x2901('0x8'));var attributes=require(_0x2901('0x9'));module[_0x2901('0xa')]=function(_0x3cb279,_0x40fcd3){return _0x3cb279[_0x2901('0xb')](_0x2901('0xc'),attributes,{'tableName':_0x2901('0xd'),'paranoid':![],'indexes':[{'name':_0x2901('0xe'),'fields':[_0x2901('0xe')]},{'name':_0x2901('0xf'),'fields':[_0x2901('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0211=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','CmHopperFinal','calleridnum','uniqueid'];(function(_0x5b4deb,_0x11a5eb){var _0xf26cfe=function(_0xc4e86d){while(--_0xc4e86d){_0x5b4deb['push'](_0x5b4deb['shift']());}};_0xf26cfe(++_0x11a5eb);}(_0x0211,0x144));var _0x1021=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0211[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1021('0x0'));var util=require(_0x1021('0x1'));var logger=require(_0x1021('0x2'))(_0x1021('0x3'));var moment=require('moment');var BPromise=require(_0x1021('0x4'));var rp=require(_0x1021('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1021('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x1021('0x7')]=function(_0x50c530,_0x546a63){return _0x50c530[_0x1021('0x8')](_0x1021('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x1021('0xa'),'fields':[_0x1021('0xa')]},{'name':'uniqueid','fields':[_0x1021('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index a9abbe6..a6d6e2f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50002a,_0x5c182c){var _0x3691bc=function(_0x4acf5f){while(--_0x4acf5f){_0x50002a['push'](_0x50002a['shift']());}};_0x3691bc(++_0x5c182c);}(_0x7a54,0x106));var _0x47a5=function(_0x5395ec,_0x49b25c){_0x5395ec=_0x5395ec-0x0;var _0x41e3dd=_0x7a54[_0x5395ec];return _0x41e3dd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4f062d,_0x1b05e2){var _0x4b42ee=function(_0x4da45b){while(--_0x4da45b){_0x4f062d['push'](_0x4f062d['shift']());}};_0x4b42ee(++_0x1b05e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x3db750,_0x5d66c2){_0x3db750=_0x3db750-0x0;var _0x5427a=_0xb10b[_0x3db750];return _0x5427a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 079f808..5bb918c 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 _0x80d4=['index','get','/describe','isAuthenticated','/:id','show','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x290acc,_0x390e04){var _0x1f82a5=function(_0x5d4837){while(--_0x5d4837){_0x290acc['push'](_0x290acc['shift']());}};_0x1f82a5(++_0x390e04);}(_0x80d4,0x1da));var _0x480d=function(_0xe41323,_0x3c9267){_0xe41323=_0xe41323-0x0;var _0x3f39b6=_0x80d4[_0xe41323];return _0x3f39b6;};'use strict';var multer=require(_0x480d('0x0'));var util=require(_0x480d('0x1'));var path=require(_0x480d('0x2'));var timeout=require('connect-timeout');var express=require(_0x480d('0x3'));var router=express['Router']();var fs_extra=require(_0x480d('0x4'));var auth=require(_0x480d('0x5'));var interaction=require(_0x480d('0x6'));var config=require(_0x480d('0x7'));var controller=require(_0x480d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x480d('0x9')]);router[_0x480d('0xa')](_0x480d('0xb'),auth[_0x480d('0xc')](),controller['describe']);router['get'](_0x480d('0xd'),auth[_0x480d('0xc')](),controller[_0x480d('0xe')]);router[_0x480d('0xa')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x480d('0xf')]);router[_0x480d('0xa')]('/campaign/countAttributes/:id',auth[_0x480d('0xc')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x480d('0x10'),auth[_0x480d('0xc')](),controller[_0x480d('0x11')]);router[_0x480d('0x12')](_0x480d('0x13'),auth[_0x480d('0xc')](),controller[_0x480d('0x14')]);router['post'](_0x480d('0x15'),auth[_0x480d('0xc')](),controller['checkContactHopper']);router['put']('/:id',auth[_0x480d('0xc')](),controller['update']);module[_0x480d('0x16')]=router; \ No newline at end of file +var _0xffaf=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show'];(function(_0x31815d,_0x2ddaab){var _0x5c1f8d=function(_0x4701ce){while(--_0x4701ce){_0x31815d['push'](_0x31815d['shift']());}};_0x5c1f8d(++_0x2ddaab);}(_0xffaf,0x1c3));var _0xfffa=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xffaf[_0x53f0db];return _0xae0a5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfffa('0x0'));var timeout=require(_0xfffa('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfffa('0x2'));var auth=require(_0xfffa('0x3'));var interaction=require(_0xfffa('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xfffa('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfffa('0x5')](_0xfffa('0x6'),auth['isAuthenticated'](),controller[_0xfffa('0x7')]);router[_0xfffa('0x5')](_0xfffa('0x8'),auth[_0xfffa('0x9')](),controller[_0xfffa('0xa')]);router[_0xfffa('0x5')](_0xfffa('0xb'),auth[_0xfffa('0x9')](),controller[_0xfffa('0xc')]);router[_0xfffa('0x5')](_0xfffa('0xd'),auth[_0xfffa('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xfffa('0xe')](_0xfffa('0xf'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x10')]);router[_0xfffa('0xe')]('/voice/campaign/moveContacts/:id',auth[_0xfffa('0x9')](),controller[_0xfffa('0x11')]);router[_0xfffa('0xe')](_0xfffa('0x12'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x13')]);router['put'](_0xfffa('0x8'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x14')]);module[_0xfffa('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 34b6ebd..6bcd7f0 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 _0x97b8=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x97b8,0x90));var _0x897b=function(_0x3079f1,_0x2b8762){_0x3079f1=_0x3079f1-0x0;var _0x37e8c1=_0x97b8[_0x3079f1];return _0x37e8c1;};'use strict';var Sequelize=require('sequelize');module[_0x897b('0x0')]={'state':{'type':Sequelize[_0x897b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x897b('0x2')]},'scheduledat':{'type':Sequelize[_0x897b('0x3')]},'countbusyretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x897b('0x2')]},'originatecalleridname':{'type':Sequelize[_0x897b('0x2')]},'calleridnum':{'type':Sequelize[_0x897b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x897b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x897b('0x3')]},'droptime':{'type':Sequelize[_0x897b('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x897b('0x2')]},'campaign':{'type':Sequelize[_0x897b('0x2')]},'campaigntype':{'type':Sequelize[_0x897b('0x2')]},'membername':{'type':Sequelize[_0x897b('0x2')]},'reason':{'type':Sequelize[_0x897b('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x897b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x897b('0x3')]},'recallme':{'type':Sequelize[_0x897b('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x897b('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x897b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa23e=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x5c47ef,_0x29ccf8){var _0x29ffc1=function(_0x470370){while(--_0x470370){_0x5c47ef['push'](_0x5c47ef['shift']());}};_0x29ffc1(++_0x29ccf8);}(_0xa23e,0x1f0));var _0xea23=function(_0x3f1417,_0x1d389d){_0x3f1417=_0x3f1417-0x0;var _0x11eb77=_0xa23e[_0x3f1417];return _0x11eb77;};'use strict';var Sequelize=require(_0xea23('0x0'));module[_0xea23('0x1')]={'state':{'type':Sequelize[_0xea23('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xea23('0x3')]},'scheduledat':{'type':Sequelize[_0xea23('0x4')]},'countbusyretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xea23('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xea23('0x3')]},'calleridname':{'type':Sequelize[_0xea23('0x3')]},'starttime':{'type':Sequelize[_0xea23('0x4')]},'responsetime':{'type':Sequelize[_0xea23('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xea23('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xea23('0x3')]},'campaigntype':{'type':Sequelize[_0xea23('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xea23('0x3')]},'amd':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xea23('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xea23('0x4')]},'recallme':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xea23('0x4')]},'edited':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f7a9b8c..8fd6d9a 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 _0x72c1=['describe','uniqueid','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x98108e,_0x581221){var _0xbbf8ba=function(_0x48cc1f){while(--_0x48cc1f){_0x98108e['push'](_0x98108e['shift']());}};_0xbbf8ba(++_0x581221);}(_0x72c1,0xe1));var _0x172c=function(_0xe42ed5,_0x1af9b4){_0xe42ed5=_0xe42ed5-0x0;var _0x371325=_0x72c1[_0xe42ed5];return _0x371325;};'use strict';var emlformat=require(_0x172c('0x0'));var rimraf=require(_0x172c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x172c('0x2'));var rp=require(_0x172c('0x3'));var moment=require(_0x172c('0x4'));var BPromise=require(_0x172c('0x5'));var Mustache=require(_0x172c('0x6'));var util=require(_0x172c('0x7'));var path=require(_0x172c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x172c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x172c('0xa'));var crypto=require(_0x172c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x172c('0xc'));var querystring=require(_0x172c('0xd'));var Papa=require(_0x172c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x172c('0xf'));var as=require(_0x172c('0x10'));var hardwareService=require(_0x172c('0x11'));var logger=require('../../config/logger')(_0x172c('0x12'));var utils=require('../../config/utils');var config=require(_0x172c('0x13'));var licenseUtil=require(_0x172c('0x14'));var db=require(_0x172c('0x15'))['db'];function respondWithStatusCode(_0x1d0f99,_0x274b28){_0x274b28=_0x274b28||0xcc;return function(_0x4c85b3){if(_0x4c85b3){return _0x1d0f99['sendStatus'](_0x274b28);}return _0x1d0f99[_0x172c('0x16')](_0x274b28)[_0x172c('0x17')]();};}function respondWithResult(_0x2de1c3,_0x42f125){_0x42f125=_0x42f125||0xc8;return function(_0x5ea90f){if(_0x5ea90f){return _0x2de1c3[_0x172c('0x16')](_0x42f125)[_0x172c('0x18')](_0x5ea90f);}};}function respondWithFilteredResult(_0x58228b,_0x55edc0){return function(_0x24f588){if(_0x24f588){var _0x315841=typeof _0x55edc0['offset']===_0x172c('0x19')&&typeof _0x55edc0[_0x172c('0x1a')]===_0x172c('0x19');var _0x66bb97=_0x24f588[_0x172c('0x1b')];var _0x5c7998=_0x315841?0x0:_0x55edc0['offset'];var _0x176ae0=_0x315841?_0x24f588[_0x172c('0x1b')]:_0x55edc0[_0x172c('0x1c')]+_0x55edc0['limit'];var _0x4bec87;if(_0x176ae0>=_0x66bb97){_0x176ae0=_0x66bb97;_0x4bec87=0xc8;}else{_0x4bec87=0xce;}_0x58228b[_0x172c('0x16')](_0x4bec87);return _0x58228b[_0x172c('0x1d')](_0x172c('0x1e'),_0x5c7998+'-'+_0x176ae0+'/'+_0x66bb97)[_0x172c('0x18')](_0x24f588);}return null;};}function patchUpdates(_0x2c0242){return function(_0x288cc4){try{jsonpatch[_0x172c('0x1f')](_0x288cc4,_0x2c0242,!![]);}catch(_0x25f483){return BPromise['reject'](_0x25f483);}return _0x288cc4[_0x172c('0x20')]();};}function saveUpdates(_0x43dddc,_0x1622b3){return function(_0x4fa48d){if(_0x4fa48d){return _0x4fa48d[_0x172c('0x21')](_0x43dddc)[_0x172c('0x22')](function(_0x2ebe3c){return _0x2ebe3c;});}return null;};}function removeEntity(_0x268108,_0x503ef2){return function(_0x2b5e2a){if(_0x2b5e2a){return _0x2b5e2a[_0x172c('0x23')]()['then'](function(){_0x268108['status'](0xcc)[_0x172c('0x17')]();});}};}function handleEntityNotFound(_0x2679c8,_0x1b30a6){return function(_0x8b98de){if(!_0x8b98de){_0x2679c8[_0x172c('0x24')](0x194);}return _0x8b98de;};}function handleError(_0x1c7171,_0x2c7e7e){_0x2c7e7e=_0x2c7e7e||0x1f4;return function(_0x551cc4){logger[_0x172c('0x25')](_0x551cc4[_0x172c('0x26')]);if(_0x551cc4[_0x172c('0x27')]){delete _0x551cc4[_0x172c('0x27')];}_0x1c7171[_0x172c('0x16')](_0x2c7e7e)['send'](_0x551cc4);};}exports['index']=function(_0x528723,_0x5cdf8d){var _0x2bc6b6={},_0x13430b={},_0x143710={'count':0x0,'rows':[]};var _0x32fc35=_[_0x172c('0x28')](db[_0x172c('0x29')][_0x172c('0x2a')],function(_0x4f744b){return{'name':_0x4f744b[_0x172c('0x2b')],'type':_0x4f744b[_0x172c('0x2c')][_0x172c('0x2d')]};});_0x13430b[_0x172c('0x2e')]=_['map'](_0x32fc35,'name');_0x13430b[_0x172c('0x2f')]=_[_0x172c('0x30')](_0x528723[_0x172c('0x2f')]);_0x13430b[_0x172c('0x31')]=_[_0x172c('0x32')](_0x13430b['model'],_0x13430b[_0x172c('0x2f')]);_0x2bc6b6[_0x172c('0x33')]=_[_0x172c('0x32')](_0x13430b['model'],qs[_0x172c('0x34')](_0x528723[_0x172c('0x2f')][_0x172c('0x34')]));_0x2bc6b6[_0x172c('0x33')]=_0x2bc6b6['attributes'][_0x172c('0x35')]?_0x2bc6b6[_0x172c('0x33')]:_0x13430b[_0x172c('0x2e')];if(!_0x528723[_0x172c('0x2f')][_0x172c('0x36')](_0x172c('0x37'))){_0x2bc6b6[_0x172c('0x1a')]=qs['limit'](_0x528723[_0x172c('0x2f')]['limit']);_0x2bc6b6['offset']=qs[_0x172c('0x1c')](_0x528723[_0x172c('0x2f')]['offset']);}_0x2bc6b6[_0x172c('0x38')]=qs[_0x172c('0x39')](_0x528723[_0x172c('0x2f')]['sort']);_0x2bc6b6[_0x172c('0x3a')]=qs['filters'](_['pick'](_0x528723[_0x172c('0x2f')],_0x13430b[_0x172c('0x31')]),_0x32fc35);if(_0x528723[_0x172c('0x2f')]['filter']){_0x2bc6b6[_0x172c('0x3a')]=_['merge'](_0x2bc6b6[_0x172c('0x3a')],{'$or':_['map'](_0x32fc35,function(_0xacec29){if(_0xacec29[_0x172c('0x2c')]!==_0x172c('0x3b')){var _0x3db061={};_0x3db061[_0xacec29['name']]={'$like':'%'+_0x528723['query']['filter']+'%'};return _0x3db061;}})});}_0x2bc6b6=_[_0x172c('0x3c')]({},_0x2bc6b6,_0x528723[_0x172c('0x3d')]);var _0x196ddb={'where':_0x2bc6b6[_0x172c('0x3a')]};return db['CmHopperHistory'][_0x172c('0x1b')](_0x196ddb)['then'](function(_0x3322f8){_0x143710[_0x172c('0x1b')]=_0x3322f8;if(_0x528723['query'][_0x172c('0x3e')]){_0x2bc6b6[_0x172c('0x3f')]=[{'all':!![]}];}return db[_0x172c('0x29')][_0x172c('0x40')](_0x2bc6b6);})[_0x172c('0x22')](function(_0x3f088a){_0x143710[_0x172c('0x41')]=_0x3f088a;return _0x143710;})[_0x172c('0x22')](respondWithFilteredResult(_0x5cdf8d,_0x2bc6b6))[_0x172c('0x42')](handleError(_0x5cdf8d,null));};exports[_0x172c('0x43')]=function(_0x1d94ba,_0xb50b8c){var _0x2a335d={'raw':!![],'where':{'id':_0x1d94ba[_0x172c('0x44')]['id']}},_0x1cee7a={};_0x1cee7a[_0x172c('0x2e')]=_['keys'](db[_0x172c('0x29')][_0x172c('0x2a')]);_0x1cee7a['query']=_['keys'](_0x1d94ba['query']);_0x1cee7a[_0x172c('0x31')]=_[_0x172c('0x32')](_0x1cee7a[_0x172c('0x2e')],_0x1cee7a['query']);_0x2a335d[_0x172c('0x33')]=_[_0x172c('0x32')](_0x1cee7a[_0x172c('0x2e')],qs['fields'](_0x1d94ba['query']['fields']));_0x2a335d[_0x172c('0x33')]=_0x2a335d[_0x172c('0x33')]['length']?_0x2a335d[_0x172c('0x33')]:_0x1cee7a[_0x172c('0x2e')];if(_0x1d94ba['query'][_0x172c('0x3e')]){_0x2a335d['include']=[{'all':!![]}];}_0x2a335d=_[_0x172c('0x3c')]({},_0x2a335d,_0x1d94ba[_0x172c('0x3d')]);return db['CmHopperHistory']['find'](_0x2a335d)[_0x172c('0x22')](handleEntityNotFound(_0xb50b8c,null))[_0x172c('0x22')](respondWithResult(_0xb50b8c,null))[_0x172c('0x42')](handleError(_0xb50b8c,null));};exports[_0x172c('0x45')]=function(_0x3c35b1,_0x350981){return db['CmHopperHistory'][_0x172c('0x45')](_0x3c35b1[_0x172c('0x46')],{})[_0x172c('0x22')](respondWithResult(_0x350981,0xc9))[_0x172c('0x42')](handleError(_0x350981,null));};exports['describe']=function(_0x37b131,_0x1506a6){return db[_0x172c('0x29')][_0x172c('0x47')]()[_0x172c('0x22')](respondWithResult(_0x1506a6,null))[_0x172c('0x42')](handleError(_0x1506a6,null));};exports[_0x172c('0x21')]=function(_0x5de0e3,_0x57a891){if(_0x5de0e3['body'][_0x172c('0x48')]){delete _0x5de0e3[_0x172c('0x46')][_0x172c('0x48')];}return db['CmHopperHistory'][_0x172c('0x49')]({'where':{'uniqueid':_0x5de0e3[_0x172c('0x44')]['id']}})[_0x172c('0x22')](handleEntityNotFound(_0x57a891,null))[_0x172c('0x22')](saveUpdates(_0x5de0e3[_0x172c('0x46')],null))[_0x172c('0x22')](respondWithResult(_0x57a891,null))['catch'](handleError(_0x57a891,null));}; \ No newline at end of file +var _0x8f96=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','describe','body','uniqueid','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','CmHopperHistory','key','query'];(function(_0x1313ef,_0x41cea1){var _0x42a5a7=function(_0x592793){while(--_0x592793){_0x1313ef['push'](_0x1313ef['shift']());}};_0x42a5a7(++_0x41cea1);}(_0x8f96,0x1e4));var _0x68f9=function(_0x32216e,_0x50b867){_0x32216e=_0x32216e-0x0;var _0x4e7d71=_0x8f96[_0x32216e];return _0x4e7d71;};'use strict';var emlformat=require(_0x68f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68f9('0x1'));var rp=require(_0x68f9('0x2'));var moment=require(_0x68f9('0x3'));var BPromise=require(_0x68f9('0x4'));var Mustache=require('mustache');var util=require(_0x68f9('0x5'));var path=require(_0x68f9('0x6'));var sox=require(_0x68f9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68f9('0x8'));var _=require(_0x68f9('0x9'));var squel=require(_0x68f9('0xa'));var crypto=require(_0x68f9('0xb'));var jsforce=require(_0x68f9('0xc'));var deskjs=require(_0x68f9('0xd'));var toCsv=require(_0x68f9('0xe'));var querystring=require('querystring');var Papa=require(_0x68f9('0xf'));var Redis=require(_0x68f9('0x10'));var authService=require(_0x68f9('0x11'));var qs=require(_0x68f9('0x12'));var as=require(_0x68f9('0x13'));var hardwareService=require(_0x68f9('0x14'));var logger=require(_0x68f9('0x15'))('api');var utils=require(_0x68f9('0x16'));var config=require(_0x68f9('0x17'));var licenseUtil=require(_0x68f9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2703,_0x31ed78){_0x31ed78=_0x31ed78||0xcc;return function(_0x2716ed){if(_0x2716ed){return _0x3d2703[_0x68f9('0x19')](_0x31ed78);}return _0x3d2703[_0x68f9('0x1a')](_0x31ed78)[_0x68f9('0x1b')]();};}function respondWithResult(_0x29f97a,_0x1c48da){_0x1c48da=_0x1c48da||0xc8;return function(_0x52a958){if(_0x52a958){return _0x29f97a[_0x68f9('0x1a')](_0x1c48da)[_0x68f9('0x1c')](_0x52a958);}};}function respondWithFilteredResult(_0x4d50a0,_0x3f9fd9){return function(_0x385a21){if(_0x385a21){var _0x10f903=typeof _0x3f9fd9['offset']===_0x68f9('0x1d')&&typeof _0x3f9fd9[_0x68f9('0x1e')]===_0x68f9('0x1d');var _0x423466=_0x385a21[_0x68f9('0x1f')];var _0x3b650c=_0x10f903?0x0:_0x3f9fd9[_0x68f9('0x20')];var _0x5c5254=_0x10f903?_0x385a21[_0x68f9('0x1f')]:_0x3f9fd9[_0x68f9('0x20')]+_0x3f9fd9[_0x68f9('0x1e')];var _0x1eebbb;if(_0x5c5254>=_0x423466){_0x5c5254=_0x423466;_0x1eebbb=0xc8;}else{_0x1eebbb=0xce;}_0x4d50a0[_0x68f9('0x1a')](_0x1eebbb);return _0x4d50a0[_0x68f9('0x21')](_0x68f9('0x22'),_0x3b650c+'-'+_0x5c5254+'/'+_0x423466)[_0x68f9('0x1c')](_0x385a21);}return null;};}function patchUpdates(_0x16779a){return function(_0x33a82e){try{jsonpatch[_0x68f9('0x23')](_0x33a82e,_0x16779a,!![]);}catch(_0x1f423c){return BPromise[_0x68f9('0x24')](_0x1f423c);}return _0x33a82e['save']();};}function saveUpdates(_0x2460a4,_0x2a1ca0){return function(_0x3a3dd0){if(_0x3a3dd0){return _0x3a3dd0[_0x68f9('0x25')](_0x2460a4)[_0x68f9('0x26')](function(_0x3f6b4c){return _0x3f6b4c;});}return null;};}function removeEntity(_0x1357bd,_0x3fdb8d){return function(_0x10400c){if(_0x10400c){return _0x10400c['destroy']()[_0x68f9('0x26')](function(){_0x1357bd[_0x68f9('0x1a')](0xcc)[_0x68f9('0x1b')]();});}};}function handleEntityNotFound(_0x5f08c3,_0x43cd67){return function(_0x5bea35){if(!_0x5bea35){_0x5f08c3[_0x68f9('0x19')](0x194);}return _0x5bea35;};}function handleError(_0x1efc0c,_0x17e104){_0x17e104=_0x17e104||0x1f4;return function(_0x1391c4){logger[_0x68f9('0x27')](_0x1391c4[_0x68f9('0x28')]);if(_0x1391c4[_0x68f9('0x29')]){delete _0x1391c4[_0x68f9('0x29')];}_0x1efc0c[_0x68f9('0x1a')](_0x17e104)[_0x68f9('0x2a')](_0x1391c4);};}exports[_0x68f9('0x2b')]=function(_0x3f041f,_0x5582ea){var _0x226dc7={},_0x47d660={},_0x19d5f7={'count':0x0,'rows':[]};var _0x45d469=_[_0x68f9('0x2c')](db[_0x68f9('0x2d')]['rawAttributes'],function(_0x2d3a00){return{'name':_0x2d3a00['fieldName'],'type':_0x2d3a00['type'][_0x68f9('0x2e')]};});_0x47d660['model']=_[_0x68f9('0x2c')](_0x45d469,_0x68f9('0x29'));_0x47d660[_0x68f9('0x2f')]=_['keys'](_0x3f041f[_0x68f9('0x2f')]);_0x47d660['filters']=_[_0x68f9('0x30')](_0x47d660[_0x68f9('0x31')],_0x47d660[_0x68f9('0x2f')]);_0x226dc7[_0x68f9('0x32')]=_[_0x68f9('0x30')](_0x47d660[_0x68f9('0x31')],qs[_0x68f9('0x33')](_0x3f041f['query'][_0x68f9('0x33')]));_0x226dc7[_0x68f9('0x32')]=_0x226dc7[_0x68f9('0x32')][_0x68f9('0x34')]?_0x226dc7[_0x68f9('0x32')]:_0x47d660[_0x68f9('0x31')];if(!_0x3f041f['query'][_0x68f9('0x35')](_0x68f9('0x36'))){_0x226dc7[_0x68f9('0x1e')]=qs[_0x68f9('0x1e')](_0x3f041f[_0x68f9('0x2f')]['limit']);_0x226dc7[_0x68f9('0x20')]=qs[_0x68f9('0x20')](_0x3f041f[_0x68f9('0x2f')][_0x68f9('0x20')]);}_0x226dc7[_0x68f9('0x37')]=qs[_0x68f9('0x38')](_0x3f041f['query']['sort']);_0x226dc7[_0x68f9('0x39')]=qs[_0x68f9('0x3a')](_['pick'](_0x3f041f['query'],_0x47d660[_0x68f9('0x3a')]),_0x45d469);if(_0x3f041f['query'][_0x68f9('0x3b')]){_0x226dc7['where']=_['merge'](_0x226dc7[_0x68f9('0x39')],{'$or':_[_0x68f9('0x2c')](_0x45d469,function(_0x2f50c9){if(_0x2f50c9[_0x68f9('0x3c')]!==_0x68f9('0x3d')){var _0x468078={};_0x468078[_0x2f50c9[_0x68f9('0x29')]]={'$like':'%'+_0x3f041f[_0x68f9('0x2f')]['filter']+'%'};return _0x468078;}})});}_0x226dc7=_[_0x68f9('0x3e')]({},_0x226dc7,_0x3f041f[_0x68f9('0x3f')]);var _0x22b1ee={'where':_0x226dc7[_0x68f9('0x39')]};return db['CmHopperHistory'][_0x68f9('0x1f')](_0x22b1ee)[_0x68f9('0x26')](function(_0x2a0898){_0x19d5f7['count']=_0x2a0898;if(_0x3f041f['query'][_0x68f9('0x40')]){_0x226dc7[_0x68f9('0x41')]=[{'all':!![]}];}return db[_0x68f9('0x2d')][_0x68f9('0x42')](_0x226dc7);})[_0x68f9('0x26')](function(_0x1a4c8b){_0x19d5f7[_0x68f9('0x43')]=_0x1a4c8b;return _0x19d5f7;})[_0x68f9('0x26')](respondWithFilteredResult(_0x5582ea,_0x226dc7))['catch'](handleError(_0x5582ea,null));};exports['show']=function(_0x1253ba,_0xb93db9){var _0x3665fb={'raw':!![],'where':{'id':_0x1253ba[_0x68f9('0x44')]['id']}},_0x58e21b={};_0x58e21b[_0x68f9('0x31')]=_['keys'](db[_0x68f9('0x2d')][_0x68f9('0x45')]);_0x58e21b[_0x68f9('0x2f')]=_['keys'](_0x1253ba[_0x68f9('0x2f')]);_0x58e21b[_0x68f9('0x3a')]=_['intersection'](_0x58e21b[_0x68f9('0x31')],_0x58e21b['query']);_0x3665fb[_0x68f9('0x32')]=_[_0x68f9('0x30')](_0x58e21b[_0x68f9('0x31')],qs[_0x68f9('0x33')](_0x1253ba[_0x68f9('0x2f')][_0x68f9('0x33')]));_0x3665fb[_0x68f9('0x32')]=_0x3665fb['attributes'][_0x68f9('0x34')]?_0x3665fb['attributes']:_0x58e21b['model'];if(_0x1253ba[_0x68f9('0x2f')][_0x68f9('0x40')]){_0x3665fb['include']=[{'all':!![]}];}_0x3665fb=_['merge']({},_0x3665fb,_0x1253ba[_0x68f9('0x3f')]);return db[_0x68f9('0x2d')][_0x68f9('0x46')](_0x3665fb)[_0x68f9('0x26')](handleEntityNotFound(_0xb93db9,null))['then'](respondWithResult(_0xb93db9,null))[_0x68f9('0x47')](handleError(_0xb93db9,null));};exports[_0x68f9('0x48')]=function(_0xefd309,_0x1941ee){return db['CmHopperHistory']['create'](_0xefd309['body'],{})['then'](respondWithResult(_0x1941ee,0xc9))[_0x68f9('0x47')](handleError(_0x1941ee,null));};exports['describe']=function(_0x1e299e,_0x37ba5f){return db[_0x68f9('0x2d')][_0x68f9('0x49')]()['then'](respondWithResult(_0x37ba5f,null))[_0x68f9('0x47')](handleError(_0x37ba5f,null));};exports['update']=function(_0x3fafc7,_0x1472d1){if(_0x3fafc7[_0x68f9('0x4a')][_0x68f9('0x4b')]){delete _0x3fafc7['body'][_0x68f9('0x4b')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x3fafc7[_0x68f9('0x44')]['id']}})[_0x68f9('0x26')](handleEntityNotFound(_0x1472d1,null))[_0x68f9('0x26')](saveUpdates(_0x3fafc7['body'],null))[_0x68f9('0x26')](respondWithResult(_0x1472d1,null))[_0x68f9('0x47')](handleError(_0x1472d1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0f63fd7..816cf6f 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 _0x349e=['path','rimraf','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x222599,_0xb5450a){var _0x3cc470=function(_0xafe42){while(--_0xafe42){_0x222599['push'](_0x222599['shift']());}};_0x3cc470(++_0xb5450a);}(_0x349e,0xcb));var _0xe349=function(_0x546718,_0x3a237f){_0x546718=_0x546718-0x0;var _0x509f56=_0x349e[_0x546718];return _0x509f56;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var logger=require(_0xe349('0x2'))(_0xe349('0x3'));var moment=require(_0xe349('0x4'));var BPromise=require(_0xe349('0x5'));var rp=require(_0xe349('0x6'));var fs=require('fs');var path=require(_0xe349('0x7'));var rimraf=require(_0xe349('0x8'));var config=require('../../config/environment');var attributes=require(_0xe349('0x9'));module['exports']=function(_0x55aae6,_0xb21068){return _0x55aae6['define'](_0xe349('0xa'),attributes,{'tableName':_0xe349('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xe349('0xc')]},{'name':_0xe349('0xd'),'fields':[_0xe349('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x42c3=['bluebird','request-promise','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x227b0b,_0x32c8aa){var _0x12ed33=function(_0x3ea21f){while(--_0x3ea21f){_0x227b0b['push'](_0x227b0b['shift']());}};_0x12ed33(++_0x32c8aa);}(_0x42c3,0x1bc));var _0x342c=function(_0x4b320d,_0x5b6957){_0x4b320d=_0x4b320d-0x0;var _0x3a15c6=_0x42c3[_0x4b320d];return _0x3a15c6;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var logger=require(_0x342c('0x2'))('api');var moment=require(_0x342c('0x3'));var BPromise=require(_0x342c('0x4'));var rp=require(_0x342c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x342c('0x6'));var config=require('../../config/environment');var attributes=require(_0x342c('0x7'));module[_0x342c('0x8')]=function(_0x4c7ba3,_0x4edcfe){return _0x4c7ba3[_0x342c('0x9')](_0x342c('0xa'),attributes,{'tableName':_0x342c('0xb'),'paranoid':![],'indexes':[{'name':_0x342c('0xc'),'fields':['endtime']},{'name':_0x342c('0xd'),'fields':[_0x342c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 5e91f32..3019240 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 _0x1e9f=['catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','AvgHandleTime','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`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','campaign','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3eaea7,_0x9968ff){var _0xd7cd35=function(_0x34539f){while(--_0x34539f){_0x3eaea7['push'](_0x3eaea7['shift']());}};_0xd7cd35(++_0x9968ff);}(_0x1e9f,0x107));var _0xf1e9=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x1e9f[_0x74892f];return _0x10ee61;};'use strict';var _=require(_0xf1e9('0x0'));var util=require('util');var moment=require(_0xf1e9('0x1'));var BPromise=require(_0xf1e9('0x2'));var rs=require(_0xf1e9('0x3'));var fs=require('fs');var Redis=require(_0xf1e9('0x4'));var db=require(_0xf1e9('0x5'))['db'];var utils=require(_0xf1e9('0x6'));var logger=require('../../config/logger')(_0xf1e9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf1e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eb1b6,_0x29e7a2,_0x37029b){return new BPromise(function(_0x3002d4,_0x562a67){return client[_0xf1e9('0x9')](_0x4eb1b6,_0x37029b)[_0xf1e9('0xa')](function(_0xcec345){logger[_0xf1e9('0xb')](_0xf1e9('0xc'),_0x29e7a2,_0xf1e9('0xd'));logger[_0xf1e9('0xe')](_0xf1e9('0xf'),_0x29e7a2,_0xf1e9('0xd'),JSON[_0xf1e9('0x10')](_0xcec345));if(_0xcec345[_0xf1e9('0x11')]){if(_0xcec345['error'][_0xf1e9('0x12')]===0x1f4){logger[_0xf1e9('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x29e7a2,_0xcec345[_0xf1e9('0x11')]['message']);return _0x562a67(_0xcec345[_0xf1e9('0x11')][_0xf1e9('0x13')]);}logger[_0xf1e9('0x11')](_0xf1e9('0xc'),_0x29e7a2,_0xcec345[_0xf1e9('0x11')][_0xf1e9('0x13')]);return _0x3002d4(_0xcec345[_0xf1e9('0x11')]['message']);}else{logger[_0xf1e9('0xb')](_0xf1e9('0xc'),_0x29e7a2,_0xf1e9('0xd'));_0x3002d4(_0xcec345[_0xf1e9('0x14')][_0xf1e9('0x13')]);}})[_0xf1e9('0x15')](function(_0x30c666){logger[_0xf1e9('0x11')](_0xf1e9('0xc'),_0x29e7a2,_0x30c666);_0x562a67(_0x30c666);});});}exports[_0xf1e9('0x16')]=function(_0x4365db){var _0x3b1da1=this;return new Promise(function(_0x1e6f08,_0x4a9d91){return db[_0xf1e9('0x17')][_0xf1e9('0x18')](_0x4365db[_0xf1e9('0x19')],{'raw':_0x4365db[_0xf1e9('0x1a')]?_0x4365db['options'][_0xf1e9('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5e64ce){logger['info'](_0xf1e9('0x16'),_0x4365db);logger['debug']('CreateCmHopperHistory',_0x4365db,JSON['stringify'](_0x5e64ce));_0x1e6f08(_0x5e64ce);})['catch'](function(_0x1aed5f){logger[_0xf1e9('0x11')]('CreateCmHopperHistory',_0x1aed5f[_0xf1e9('0x13')],_0x4365db);_0x4a9d91(_0x3b1da1[_0xf1e9('0x11')](0x1f4,_0x1aed5f[_0xf1e9('0x13')]));});});};exports['AvgHandleTime']=function(_0x52303b){var _0x48fc21=this;return new Promise(function(_0x430915,_0x573583){return db['CmHopperHistory'][_0xf1e9('0x1c')]({'raw':_0x52303b[_0xf1e9('0x1a')]?_0x52303b[_0xf1e9('0x1a')][_0xf1e9('0x1b')]===undefined?!![]:![]:!![],'where':_0x52303b[_0xf1e9('0x1a')]?_0x52303b[_0xf1e9('0x1a')][_0xf1e9('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf1e9('0x1e'),db['sequelize'][_0xf1e9('0x1f')]('id')),_0xf1e9('0x20')],[db['sequelize']['fn']('COUNT',db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x24')))),_0xf1e9('0x25')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')]['literal'](_0xf1e9('0x27')))),_0xf1e9('0x28')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x29'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0xf1e9('0xa')](function(_0x32de6a){logger[_0xf1e9('0xb')](_0xf1e9('0x2a'),_0x52303b);logger['debug'](_0xf1e9('0x2a'),_0x52303b,JSON[_0xf1e9('0x10')](_0x32de6a));_0x430915(_0x32de6a);})['catch'](function(_0x34a949){logger[_0xf1e9('0x11')](_0xf1e9('0x2a'),_0x34a949[_0xf1e9('0x13')],_0x52303b);_0x573583(_0x48fc21['error'](0x1f4,_0x34a949['message']));});});};exports[_0xf1e9('0x2b')]=function(_0x3ef80a){var _0x581d16=this;return new Promise(function(_0x3e323b,_0x994438){return db[_0xf1e9('0x17')][_0xf1e9('0x1c')]({'raw':_0x3ef80a[_0xf1e9('0x1a')]?_0x3ef80a[_0xf1e9('0x1a')][_0xf1e9('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ef80a[_0xf1e9('0x1a')]?_0x3ef80a[_0xf1e9('0x1a')][_0xf1e9('0x1d')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x2c')))),_0xf1e9('0x2d')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')]['literal'](_0xf1e9('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x23')))),'outboundAnswerCallsDay'],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db[_0xf1e9('0x21')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xf1e9('0x2f')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x30')))),_0xf1e9('0x31')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db['sequelize'][_0xf1e9('0x22')](_0xf1e9('0x32')))),_0xf1e9('0x33')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xf1e9('0x22')](_0xf1e9('0x34')))),_0xf1e9('0x35')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')]['literal'](_0xf1e9('0x36')))),_0xf1e9('0x37')],[db[_0xf1e9('0x21')]['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xf1e9('0x38')))),_0xf1e9('0x39')],[db['sequelize']['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db['sequelize'][_0xf1e9('0x22')](_0xf1e9('0x3a')))),_0xf1e9('0x3b')],[db[_0xf1e9('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x3c')))),_0xf1e9('0x3d')],[db[_0xf1e9('0x21')]['fn']('COUNT',db[_0xf1e9('0x21')]['fn']('IF',db['sequelize'][_0xf1e9('0x22')](_0xf1e9('0x3e')))),_0xf1e9('0x3f')],[db['sequelize']['fn'](_0xf1e9('0x1e'),db['sequelize']['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x40')))),_0xf1e9('0x3d')],[db['sequelize']['fn'](_0xf1e9('0x1e'),db[_0xf1e9('0x21')]['fn']('IF',db[_0xf1e9('0x21')][_0xf1e9('0x22')](_0xf1e9('0x41')))),'outboundReCallsDay']],'group':[_0xf1e9('0x42')]})[_0xf1e9('0xa')](function(_0x205857){logger[_0xf1e9('0xb')](_0xf1e9('0x2b'),_0x3ef80a);logger[_0xf1e9('0xe')](_0xf1e9('0x2b'),_0x3ef80a,JSON[_0xf1e9('0x10')](_0x205857));_0x3e323b(_0x205857);})['catch'](function(_0x5d62ef){logger['error'](_0xf1e9('0x2b'),_0x5d62ef['message'],_0x3ef80a);_0x994438(_0x581d16[_0xf1e9('0x11')](0x1f4,_0x5d62ef[_0xf1e9('0x13')]));});});};exports[_0xf1e9('0x43')]=function(_0x226a68){var _0x5783c2=this;return new Promise(function(_0x141196,_0x5647ac){return db[_0xf1e9('0x17')][_0xf1e9('0x1c')]({'raw':_0x226a68['options']?_0x226a68[_0xf1e9('0x1a')][_0xf1e9('0x1b')]===undefined?!![]:![]:!![],'where':_0x226a68['options']?_0x226a68[_0xf1e9('0x1a')][_0xf1e9('0x1d')]||null:null,'attributes':[['campaign',_0xf1e9('0x44')],[db['sequelize']['fn'](_0xf1e9('0x1e'),db['sequelize'][_0xf1e9('0x1f')]('id')),_0xf1e9('0x45')],[db[_0xf1e9('0x21')]['fn']('COUNT',db[_0xf1e9('0x21')]['fn']('IF',db['sequelize'][_0xf1e9('0x22')](_0xf1e9('0x23')))),_0xf1e9('0x46')]],'group':[_0xf1e9('0x42')]})[_0xf1e9('0xa')](function(_0x20f87d){logger[_0xf1e9('0xb')]('GetCampaignHopperHistory',_0x226a68);logger[_0xf1e9('0xe')](_0xf1e9('0x43'),_0x226a68,JSON['stringify'](_0x20f87d));_0x141196(_0x20f87d);})[_0xf1e9('0x15')](function(_0x6ccc4b){logger[_0xf1e9('0x11')]('GetCampaignHopperHistory',_0x6ccc4b[_0xf1e9('0x13')],_0x226a68);_0x5647ac(_0x5783c2[_0xf1e9('0x11')](0x1f4,_0x6ccc4b[_0xf1e9('0x13')]));});});}; \ No newline at end of file +var _0x33a1=['jayson/promise','client','request','then','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','info','CreateCmHopperHistory','create','options','raw','catch','AvgHandleTime','CmHopperHistory','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1f698a,_0x484dec){var _0x50ae17=function(_0x2a1fcb){while(--_0x2a1fcb){_0x1f698a['push'](_0x1f698a['shift']());}};_0x50ae17(++_0x484dec);}(_0x33a1,0x7c));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133a('0x2'))['db'];var utils=require(_0x133a('0x3'));var logger=require(_0x133a('0x4'))('rpc');var config=require(_0x133a('0x5'));var jayson=require(_0x133a('0x6'));var client=jayson[_0x133a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13fe1d,_0x1a6b64,_0x31409d){return new BPromise(function(_0x5f3a8f,_0x37e7cc){return client[_0x133a('0x8')](_0x13fe1d,_0x31409d)[_0x133a('0x9')](function(_0x43974a){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x1a6b64,'request\x20sent');logger[_0x133a('0xa')](_0x133a('0xb'),_0x1a6b64,_0x133a('0xc'),JSON[_0x133a('0xd')](_0x43974a));if(_0x43974a[_0x133a('0xe')]){if(_0x43974a['error']['code']===0x1f4){logger[_0x133a('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1a6b64,_0x43974a['error'][_0x133a('0xf')]);return _0x37e7cc(_0x43974a[_0x133a('0xe')]['message']);}logger[_0x133a('0xe')](_0x133a('0x10'),_0x1a6b64,_0x43974a[_0x133a('0xe')]['message']);return _0x5f3a8f(_0x43974a['error'][_0x133a('0xf')]);}else{logger[_0x133a('0x11')](_0x133a('0x10'),_0x1a6b64,_0x133a('0xc'));_0x5f3a8f(_0x43974a['result']['message']);}})['catch'](function(_0x2f85f1){logger['error'](_0x133a('0x10'),_0x1a6b64,_0x2f85f1);_0x37e7cc(_0x2f85f1);});});}exports[_0x133a('0x12')]=function(_0x4fb80f){var _0xb91a9e=this;return new Promise(function(_0x1489c9,_0x5483dc){return db['CmHopperHistory'][_0x133a('0x13')](_0x4fb80f['body'],{'raw':_0x4fb80f[_0x133a('0x14')]?_0x4fb80f[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![]})[_0x133a('0x9')](function(_0x86ba96){logger[_0x133a('0x11')]('CreateCmHopperHistory',_0x4fb80f);logger[_0x133a('0xa')](_0x133a('0x12'),_0x4fb80f,JSON[_0x133a('0xd')](_0x86ba96));_0x1489c9(_0x86ba96);})[_0x133a('0x16')](function(_0x122405){logger[_0x133a('0xe')]('CreateCmHopperHistory',_0x122405['message'],_0x4fb80f);_0x5483dc(_0xb91a9e['error'](0x1f4,_0x122405['message']));});});};exports[_0x133a('0x17')]=function(_0x63f401){var _0x1d4035=this;return new Promise(function(_0x49097d,_0x33c486){return db[_0x133a('0x18')]['findAll']({'raw':_0x63f401[_0x133a('0x14')]?_0x63f401[_0x133a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x63f401[_0x133a('0x14')]?_0x63f401[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')][_0x133a('0x1c')]('id')),_0x133a('0x1d')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x133a('0x1f')],[db['sequelize']['fn'](_0x133a('0x1b'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x20')))),_0x133a('0x21')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x22')))),_0x133a('0x23')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x24'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x25')))),_0x133a('0x26')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x24'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x27')))),_0x133a('0x28')]]})['then'](function(_0x7fdbe2){logger[_0x133a('0x11')](_0x133a('0x17'),_0x63f401);logger['debug'](_0x133a('0x17'),_0x63f401,JSON[_0x133a('0xd')](_0x7fdbe2));_0x49097d(_0x7fdbe2);})[_0x133a('0x16')](function(_0x2cb442){logger[_0x133a('0xe')](_0x133a('0x17'),_0x2cb442[_0x133a('0xf')],_0x63f401);_0x33c486(_0x1d4035[_0x133a('0xe')](0x1f4,_0x2cb442[_0x133a('0xf')]));});});};exports[_0x133a('0x29')]=function(_0x4dc487){var _0x48b7f=this;return new Promise(function(_0x2acdee,_0x144f72){return db[_0x133a('0x18')][_0x133a('0x2a')]({'raw':_0x4dc487['options']?_0x4dc487[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![],'where':_0x4dc487['options']?_0x4dc487[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[['campaign',_0x133a('0x2b')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2c')))),_0x133a('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0x133a('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2f')))),_0x133a('0x30')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x31')))),_0x133a('0x32')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x133a('0x33')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x133a('0x34')],[db[_0x133a('0x1a')]['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x35')))),_0x133a('0x36')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')](_0x133a('0x37')))),_0x133a('0x38')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal'](_0x133a('0x39')))),_0x133a('0x3a')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')]('`state`\x20=\x2016,\x201,\x20null'))),_0x133a('0x3b')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),_0x133a('0x3a')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x3c')))),_0x133a('0x3d')]],'group':[_0x133a('0x3e')]})[_0x133a('0x9')](function(_0x216aad){logger[_0x133a('0x11')](_0x133a('0x29'),_0x4dc487);logger[_0x133a('0xa')](_0x133a('0x29'),_0x4dc487,JSON['stringify'](_0x216aad));_0x2acdee(_0x216aad);})[_0x133a('0x16')](function(_0x5b41ca){logger[_0x133a('0xe')](_0x133a('0x29'),_0x5b41ca[_0x133a('0xf')],_0x4dc487);_0x144f72(_0x48b7f['error'](0x1f4,_0x5b41ca[_0x133a('0xf')]));});});};exports[_0x133a('0x3f')]=function(_0x543fc2){var _0x511128=this;return new Promise(function(_0x2ec856,_0x8d3f01){return db['CmHopperHistory']['findAll']({'raw':_0x543fc2[_0x133a('0x14')]?_0x543fc2[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![],'where':_0x543fc2['options']?_0x543fc2[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[['campaign',_0x133a('0x2b')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')][_0x133a('0x1c')]('id')),'ivrTotalCallsDays'],[db[_0x133a('0x1a')]['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2f')))),_0x133a('0x40')]],'group':['campaign']})[_0x133a('0x9')](function(_0xec69a1){logger['info'](_0x133a('0x3f'),_0x543fc2);logger[_0x133a('0xa')](_0x133a('0x3f'),_0x543fc2,JSON['stringify'](_0xec69a1));_0x2ec856(_0xec69a1);})[_0x133a('0x16')](function(_0x4ed930){logger[_0x133a('0xe')](_0x133a('0x3f'),_0x4ed930['message'],_0x543fc2);_0x8d3f01(_0x511128[_0x133a('0xe')](0x1f4,_0x4ed930[_0x133a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6251fbe..b20e263 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 _0xb814=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','exports','multer'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xb814,0x1af));var _0x4b81=function(_0x1abd28,_0x44827c){_0x1abd28=_0x1abd28-0x0;var _0x44c205=_0xb814[_0x1abd28];return _0x44c205;};'use strict';var multer=require(_0x4b81('0x0'));var util=require(_0x4b81('0x1'));var path=require(_0x4b81('0x2'));var timeout=require(_0x4b81('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4b81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b81('0x5'));var config=require(_0x4b81('0x6'));var controller=require(_0x4b81('0x7'));router['get']('/',auth[_0x4b81('0x8')](),controller[_0x4b81('0x9')]);router[_0x4b81('0xa')]('/describe',auth[_0x4b81('0x8')](),controller[_0x4b81('0xb')]);router[_0x4b81('0xa')](_0x4b81('0xc'),auth[_0x4b81('0x8')](),controller[_0x4b81('0xd')]);router[_0x4b81('0xe')]('/',auth[_0x4b81('0x8')](),controller['create']);router[_0x4b81('0xf')]('/:id',auth[_0x4b81('0x8')](),controller[_0x4b81('0x10')]);module[_0x4b81('0x11')]=router; \ No newline at end of file +var _0x783a=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x559858,_0x184073){var _0x297b10=function(_0x1e3a05){while(--_0x1e3a05){_0x559858['push'](_0x559858['shift']());}};_0x297b10(++_0x184073);}(_0x783a,0xcb));var _0xa783=function(_0x124b40,_0x23e289){_0x124b40=_0x124b40-0x0;var _0x2c3255=_0x783a[_0x124b40];return _0x2c3255;};'use strict';var multer=require(_0xa783('0x0'));var util=require(_0xa783('0x1'));var path=require(_0xa783('0x2'));var timeout=require(_0xa783('0x3'));var express=require(_0xa783('0x4'));var router=express[_0xa783('0x5')]();var fs_extra=require(_0xa783('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa783('0x7'));var config=require(_0xa783('0x8'));var controller=require(_0xa783('0x9'));router[_0xa783('0xa')]('/',auth[_0xa783('0xb')](),controller[_0xa783('0xc')]);router[_0xa783('0xa')]('/describe',auth[_0xa783('0xb')](),controller[_0xa783('0xd')]);router[_0xa783('0xa')](_0xa783('0xe'),auth[_0xa783('0xb')](),controller[_0xa783('0xf')]);router[_0xa783('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa783('0x11')](_0xa783('0xe'),auth[_0xa783('0xb')](),controller[_0xa783('0x12')]);module[_0xa783('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3403bdc..8939fae 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 _0x32ef=['name','sequelize','exports','STRING'];(function(_0x13fb4f,_0x42f6af){var _0x298a4e=function(_0x18c6c1){while(--_0x18c6c1){_0x13fb4f['push'](_0x13fb4f['shift']());}};_0x298a4e(++_0x42f6af);}(_0x32ef,0xf9));var _0xf32e=function(_0x5246ab,_0x2cf8b0){_0x5246ab=_0x5246ab-0x0;var _0xb99ed3=_0x32ef[_0x5246ab];return _0xb99ed3;};'use strict';var Sequelize=require(_0xf32e('0x0'));module[_0xf32e('0x1')]={'name':{'type':Sequelize[_0xf32e('0x2')],'unique':_0xf32e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf32e('0x2')]},'dialPrefix':{'type':Sequelize[_0xf32e('0x2')]}}; \ No newline at end of file +var _0x4bc3=['name','STRING','sequelize','exports'];(function(_0x47bb90,_0x446b50){var _0x5a2309=function(_0x1f4158){while(--_0x1f4158){_0x47bb90['push'](_0x47bb90['shift']());}};_0x5a2309(++_0x446b50);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x4bc3[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x34bc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x34bc('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 2028b25..d449728 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 _0x03e2=['defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','sendStatus','error','stack','name','index','map','CmList','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','order','pick','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','sort','removeDispositions','ids','addContacts','tags','isArray','join','push','each','CmContact','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xf6c077,_0x5df96a){var _0x12a53d=function(_0x4a3f41){while(--_0x4a3f41){_0xf6c077['push'](_0xf6c077['shift']());}};_0x12a53d(++_0x5df96a);}(_0x03e2,0x1a9));var _0x203e=function(_0x32fe83,_0x7c564c){_0x32fe83=_0x32fe83-0x0;var _0x303747=_0x03e2[_0x32fe83];return _0x303747;};'use strict';var emlformat=require(_0x203e('0x0'));var rimraf=require(_0x203e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x203e('0x2'));var rp=require('request-promise');var moment=require(_0x203e('0x3'));var BPromise=require(_0x203e('0x4'));var Mustache=require(_0x203e('0x5'));var util=require(_0x203e('0x6'));var path=require(_0x203e('0x7'));var sox=require(_0x203e('0x8'));var csv=require(_0x203e('0x9'));var ejs=require(_0x203e('0xa'));var fs=require('fs');var fs_extra=require(_0x203e('0xb'));var _=require('lodash');var squel=require(_0x203e('0xc'));var crypto=require(_0x203e('0xd'));var jsforce=require(_0x203e('0xe'));var deskjs=require(_0x203e('0xf'));var toCsv=require(_0x203e('0x9'));var querystring=require(_0x203e('0x10'));var Papa=require(_0x203e('0x11'));var Redis=require('ioredis');var authService=require(_0x203e('0x12'));var qs=require(_0x203e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x203e('0x14'));var logger=require('../../config/logger')(_0x203e('0x15'));var utils=require('../../config/utils');var config=require(_0x203e('0x16'));var licenseUtil=require(_0x203e('0x17'));var db=require(_0x203e('0x18'))['db'];config['redis']=_[_0x203e('0x19')](config[_0x203e('0x1a')],{'host':_0x203e('0x1b'),'port':0x18eb});var socket=require(_0x203e('0x1c'))(new Redis(config['redis']));require(_0x203e('0x1d'))[_0x203e('0x1e')](socket);function respondWithStatusCode(_0x1421b9,_0x5cb78a){_0x5cb78a=_0x5cb78a||0xcc;return function(_0x4f2990){if(_0x4f2990){return _0x1421b9['sendStatus'](_0x5cb78a);}return _0x1421b9[_0x203e('0x1f')](_0x5cb78a)[_0x203e('0x20')]();};}function respondWithResult(_0xde8fe8,_0x37ced4){_0x37ced4=_0x37ced4||0xc8;return function(_0x324e8e){if(_0x324e8e){return _0xde8fe8[_0x203e('0x1f')](_0x37ced4)[_0x203e('0x21')](_0x324e8e);}};}function respondWithFilteredResult(_0xa357fa,_0x40c9a0){return function(_0x5c7df2){if(_0x5c7df2){var _0x3408b4=typeof _0x40c9a0['offset']==='undefined'&&typeof _0x40c9a0['limit']===_0x203e('0x22');var _0x6c84fb=_0x5c7df2[_0x203e('0x23')];var _0x2dfc80=_0x3408b4?0x0:_0x40c9a0[_0x203e('0x24')];var _0x255a3d=_0x3408b4?_0x5c7df2[_0x203e('0x23')]:_0x40c9a0[_0x203e('0x24')]+_0x40c9a0[_0x203e('0x25')];var _0x228b8b;if(_0x255a3d>=_0x6c84fb){_0x255a3d=_0x6c84fb;_0x228b8b=0xc8;}else{_0x228b8b=0xce;}_0xa357fa[_0x203e('0x1f')](_0x228b8b);return _0xa357fa[_0x203e('0x26')](_0x203e('0x27'),_0x2dfc80+'-'+_0x255a3d+'/'+_0x6c84fb)['json'](_0x5c7df2);}return null;};}function patchUpdates(_0x9811c7){return function(_0x5e628e){try{jsonpatch[_0x203e('0x28')](_0x5e628e,_0x9811c7,!![]);}catch(_0x30a4b0){return BPromise[_0x203e('0x29')](_0x30a4b0);}return _0x5e628e[_0x203e('0x2a')]();};}function saveUpdates(_0x230c91,_0x2a19fa){return function(_0x22617c){if(_0x22617c){return _0x22617c['update'](_0x230c91)[_0x203e('0x2b')](function(_0x260eef){return _0x260eef;});}return null;};}function removeEntity(_0x31d10d,_0x18b4ee){return function(_0x4921cc){if(_0x4921cc){return _0x4921cc[_0x203e('0x2c')]()[_0x203e('0x2b')](function(){var _0xab1653=_0x4921cc[_0x203e('0x2d')]({'plain':!![]});var _0xda1f25=_0x203e('0x2e');return db[_0x203e('0x2f')][_0x203e('0x2c')]({'where':{'type':_0xda1f25,'resourceId':_0xab1653['id']}})[_0x203e('0x2b')](function(){return _0x4921cc;});})['then'](function(){_0x31d10d[_0x203e('0x1f')](0xcc)[_0x203e('0x20')]();});}};}function handleEntityNotFound(_0x2967ff,_0x30e9a2){return function(_0x571b80){if(!_0x571b80){_0x2967ff[_0x203e('0x30')](0x194);}return _0x571b80;};}function handleError(_0x50e73e,_0x25ac55){_0x25ac55=_0x25ac55||0x1f4;return function(_0x2624ca){logger[_0x203e('0x31')](_0x2624ca[_0x203e('0x32')]);if(_0x2624ca[_0x203e('0x33')]){delete _0x2624ca['name'];}_0x50e73e[_0x203e('0x1f')](_0x25ac55)['send'](_0x2624ca);};}exports[_0x203e('0x34')]=function(_0x11f775,_0x9dba28){var _0x2d7077={},_0x49638f={},_0x1fdd25={'count':0x0,'rows':[]};var _0x3626bd=_[_0x203e('0x35')](db[_0x203e('0x36')][_0x203e('0x37')],function(_0xbb83f2){return{'name':_0xbb83f2[_0x203e('0x38')],'type':_0xbb83f2['type']['key']};});_0x49638f[_0x203e('0x39')]=_['map'](_0x3626bd,_0x203e('0x33'));_0x49638f['query']=_[_0x203e('0x3a')](_0x11f775['query']);_0x49638f[_0x203e('0x3b')]=_[_0x203e('0x3c')](_0x49638f[_0x203e('0x39')],_0x49638f[_0x203e('0x3d')]);_0x2d7077[_0x203e('0x3e')]=_[_0x203e('0x3c')](_0x49638f[_0x203e('0x39')],qs[_0x203e('0x3f')](_0x11f775[_0x203e('0x3d')][_0x203e('0x3f')]));_0x2d7077[_0x203e('0x3e')]=_0x2d7077[_0x203e('0x3e')][_0x203e('0x40')]?_0x2d7077[_0x203e('0x3e')]:_0x49638f[_0x203e('0x39')];if(!_0x11f775['query']['hasOwnProperty']('nolimit')){_0x2d7077[_0x203e('0x25')]=qs[_0x203e('0x25')](_0x11f775[_0x203e('0x3d')][_0x203e('0x25')]);_0x2d7077[_0x203e('0x24')]=qs[_0x203e('0x24')](_0x11f775['query']['offset']);}_0x2d7077[_0x203e('0x41')]=qs['sort'](_0x11f775[_0x203e('0x3d')]['sort']);_0x2d7077['where']=qs[_0x203e('0x3b')](_[_0x203e('0x42')](_0x11f775[_0x203e('0x3d')],_0x49638f[_0x203e('0x3b')]),_0x3626bd);if(_0x11f775[_0x203e('0x3d')][_0x203e('0x43')]){_0x2d7077[_0x203e('0x44')]=_[_0x203e('0x45')](_0x2d7077['where'],{'$or':_[_0x203e('0x35')](_0x3626bd,function(_0x5ce04d){if(_0x5ce04d[_0x203e('0x46')]!==_0x203e('0x47')){var _0x1b9c95={};_0x1b9c95[_0x5ce04d[_0x203e('0x33')]]={'$like':'%'+_0x11f775[_0x203e('0x3d')]['filter']+'%'};return _0x1b9c95;}})});}_0x2d7077=_['merge']({},_0x2d7077,_0x11f775['options']);var _0x4a9c7d={'where':_0x2d7077['where']};return db[_0x203e('0x36')][_0x203e('0x23')](_0x4a9c7d)[_0x203e('0x2b')](function(_0x32a0d4){_0x1fdd25[_0x203e('0x23')]=_0x32a0d4;if(_0x11f775['query']['includeAll']){_0x2d7077[_0x203e('0x48')]=[{'all':!![]}];}return db[_0x203e('0x36')][_0x203e('0x49')](_0x2d7077);})['then'](function(_0xcf62d9){_0x1fdd25[_0x203e('0x4a')]=_0xcf62d9;return _0x1fdd25;})[_0x203e('0x2b')](respondWithFilteredResult(_0x9dba28,_0x2d7077))[_0x203e('0x4b')](handleError(_0x9dba28,null));};exports[_0x203e('0x4c')]=function(_0x4dd5f6,_0x25f1dc){var _0x38784a={'raw':![],'where':{'id':_0x4dd5f6[_0x203e('0x4d')]['id']}},_0x51b31a={};_0x51b31a[_0x203e('0x39')]=_[_0x203e('0x3a')](db['CmList'][_0x203e('0x37')]);_0x51b31a[_0x203e('0x3d')]=_[_0x203e('0x3a')](_0x4dd5f6['query']);_0x51b31a[_0x203e('0x3b')]=_[_0x203e('0x3c')](_0x51b31a['model'],_0x51b31a['query']);_0x38784a[_0x203e('0x3e')]=_['intersection'](_0x51b31a[_0x203e('0x39')],qs[_0x203e('0x3f')](_0x4dd5f6[_0x203e('0x3d')][_0x203e('0x3f')]));_0x38784a[_0x203e('0x3e')]=_0x38784a[_0x203e('0x3e')][_0x203e('0x40')]?_0x38784a[_0x203e('0x3e')]:_0x51b31a[_0x203e('0x39')];if(_0x4dd5f6[_0x203e('0x3d')][_0x203e('0x4e')]){_0x38784a['include']=[{'all':!![]}];}_0x38784a=_[_0x203e('0x45')]({},_0x38784a,_0x4dd5f6[_0x203e('0x4f')]);return db[_0x203e('0x36')][_0x203e('0x50')](_0x38784a)[_0x203e('0x2b')](handleEntityNotFound(_0x25f1dc,null))[_0x203e('0x2b')](respondWithResult(_0x25f1dc,null))['catch'](handleError(_0x25f1dc,null));};exports[_0x203e('0x51')]=function(_0x48e445,_0x396ded){return db['CmList'][_0x203e('0x51')](_0x48e445[_0x203e('0x52')],{})[_0x203e('0x2b')](function(_0x54a6b8){var _0x1bed6e=_0x48e445['user'][_0x203e('0x2d')]({'plain':!![]});if(!_0x1bed6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bed6e[_0x203e('0x53')]==='user'){var _0x487a4b=_0x54a6b8[_0x203e('0x2d')]({'plain':!![]});var _0x737627=_0x203e('0x2e');return db['UserProfileSection'][_0x203e('0x50')]({'where':{'name':_0x737627,'userProfileId':_0x1bed6e[_0x203e('0x54')]},'raw':!![]})['then'](function(_0x36d3a6){if(_0x36d3a6&&_0x36d3a6['autoAssociation']===0x0){return db[_0x203e('0x2f')][_0x203e('0x51')]({'name':_0x487a4b[_0x203e('0x33')],'resourceId':_0x487a4b['id'],'type':_0x36d3a6['name'],'sectionId':_0x36d3a6['id']},{})[_0x203e('0x2b')](function(){return _0x54a6b8;});}else{return _0x54a6b8;}})[_0x203e('0x4b')](function(_0xccaab4){logger[_0x203e('0x31')](_0x203e('0x55'),_0xccaab4);throw _0xccaab4;});}return _0x54a6b8;})[_0x203e('0x2b')](respondWithResult(_0x396ded,0xc9))[_0x203e('0x4b')](handleError(_0x396ded,null));};exports[_0x203e('0x56')]=function(_0x201ee4,_0x23190c){if(_0x201ee4[_0x203e('0x52')]['id']){delete _0x201ee4[_0x203e('0x52')]['id'];}return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x201ee4[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x23190c,null))[_0x203e('0x2b')](saveUpdates(_0x201ee4[_0x203e('0x52')],null))[_0x203e('0x2b')](respondWithResult(_0x23190c,null))['catch'](handleError(_0x23190c,null));};exports[_0x203e('0x2c')]=function(_0x40ab59,_0x3e3741){return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x40ab59[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x3e3741,null))[_0x203e('0x2b')](removeEntity(_0x3e3741,null))[_0x203e('0x4b')](handleError(_0x3e3741,null));};exports['describe']=function(_0x1d207e,_0x48b567){return db[_0x203e('0x36')][_0x203e('0x57')]()['then'](respondWithResult(_0x48b567,null))[_0x203e('0x4b')](handleError(_0x48b567,null));};exports[_0x203e('0x58')]=function(_0x573e33,_0xa78ec6,_0x587e6e){if(_0x573e33['body']['id']){delete _0x573e33['body']['id'];}return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x573e33['params']['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0xa78ec6,null))['then'](function(_0x53fb64){if(_0x53fb64){_0x573e33[_0x203e('0x52')][_0x203e('0x59')]=_0x53fb64['id'];return db[_0x203e('0x5a')][_0x203e('0x51')](_0x573e33['body']);}})['then'](respondWithResult(_0xa78ec6,null))['catch'](handleError(_0xa78ec6,null));};exports[_0x203e('0x5b')]=function(_0x26197f,_0x271383,_0x36514f){var _0x70ab3a={'raw':![],'where':{}};var _0x4eb9ae={};var _0x556203={'count':0x0,'rows':[]};return db[_0x203e('0x36')][_0x203e('0x5c')]({'where':{'id':_0x26197f[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x271383,null))['then'](function(_0x40c5df){if(_0x40c5df){_0x4eb9ae[_0x203e('0x39')]=_['keys'](db[_0x203e('0x5a')][_0x203e('0x37')]);_0x4eb9ae[_0x203e('0x3d')]=_[_0x203e('0x3a')](_0x26197f[_0x203e('0x3d')]);_0x4eb9ae[_0x203e('0x3b')]=_[_0x203e('0x3c')](_0x4eb9ae['model'],_0x4eb9ae[_0x203e('0x3d')]);_0x70ab3a[_0x203e('0x3e')]=_[_0x203e('0x3c')](_0x4eb9ae[_0x203e('0x39')],qs[_0x203e('0x3f')](_0x26197f[_0x203e('0x3d')][_0x203e('0x3f')]));_0x70ab3a[_0x203e('0x3e')]=_0x70ab3a[_0x203e('0x3e')][_0x203e('0x40')]?_0x70ab3a[_0x203e('0x3e')]:_0x4eb9ae[_0x203e('0x39')];if(!_0x26197f['query'][_0x203e('0x5d')](_0x203e('0x5e'))){_0x70ab3a['limit']=qs['limit'](_0x26197f['query'][_0x203e('0x25')]);_0x70ab3a[_0x203e('0x24')]=qs[_0x203e('0x24')](_0x26197f['query'][_0x203e('0x24')]);}_0x70ab3a[_0x203e('0x41')]=qs[_0x203e('0x5f')](_0x26197f[_0x203e('0x3d')][_0x203e('0x5f')]);_0x70ab3a[_0x203e('0x44')]=qs[_0x203e('0x3b')](_['pick'](_0x26197f[_0x203e('0x3d')],_0x4eb9ae[_0x203e('0x3b')]));_0x70ab3a[_0x203e('0x44')][_0x203e('0x59')]=_0x40c5df['id'];if(_0x26197f['query'][_0x203e('0x43')]){_0x70ab3a[_0x203e('0x44')]=_[_0x203e('0x45')](_0x70ab3a[_0x203e('0x44')],{'$or':_['map'](_0x70ab3a['attributes'],function(_0x1a9575){var _0x3f0164={};_0x3f0164[_0x1a9575]={'$like':'%'+_0x26197f[_0x203e('0x3d')]['filter']+'%'};return _0x3f0164;})});}_0x70ab3a=_[_0x203e('0x45')]({},_0x70ab3a,_0x26197f[_0x203e('0x4f')]);return db[_0x203e('0x5a')][_0x203e('0x23')]({'where':_0x70ab3a[_0x203e('0x44')]})[_0x203e('0x2b')](function(_0x5d5418){_0x556203[_0x203e('0x23')]=_0x5d5418;if(_0x26197f[_0x203e('0x3d')][_0x203e('0x4e')]){_0x70ab3a['include']=[{'all':!![]}];}return db[_0x203e('0x5a')][_0x203e('0x49')](_0x70ab3a);})['then'](function(_0x4a495e){_0x556203['rows']=_0x4a495e;return _0x556203;});}})[_0x203e('0x2b')](respondWithFilteredResult(_0x271383,_0x70ab3a))[_0x203e('0x4b')](handleError(_0x271383,null));};exports[_0x203e('0x60')]=function(_0x44f6ad,_0x47e052,_0x439be4){return db['CmList'][_0x203e('0x50')]({'where':{'id':_0x44f6ad[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x47e052,null))[_0x203e('0x2b')](function(_0x4e7640){if(_0x4e7640){return _0x4e7640['removeDispositions'](_0x44f6ad[_0x203e('0x3d')][_0x203e('0x61')]);}})['then'](respondWithStatusCode(_0x47e052,null))[_0x203e('0x4b')](handleError(_0x47e052,null));};exports[_0x203e('0x62')]=function(_0x3c7fb7,_0x5ed730,_0x1098b3){return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x3c7fb7[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x5ed730,null))[_0x203e('0x2b')](function(_0x316151){if(_0x316151){var _0x416796=[];var _0x114c9b={'success':[],'errors':[]};return db['CmContact'][_0x203e('0x57')]()[_0x203e('0x2b')](function(_0x5eee37){if(_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')]&&_[_0x203e('0x64')](_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')])){if(_0x3c7fb7['body']['tags'][_0x203e('0x40')]){_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')]=_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')][_0x203e('0x65')](';')+';';}else{_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')]=null;}}else{_0x3c7fb7[_0x203e('0x52')][_0x203e('0x63')]=null;}if(_0x3c7fb7[_0x203e('0x52')]&&_['isArray'](_0x3c7fb7['body'])){for(var _0x4df96a=0x0;_0x4df96a<_0x3c7fb7[_0x203e('0x52')][_0x203e('0x40')];_0x4df96a+=0x1){_0x3c7fb7['body'][_0x4df96a]['ListId']=_0x3c7fb7[_0x203e('0x4d')]['id'];_0x416796[_0x203e('0x66')](_0x3c7fb7[_0x203e('0x52')][_0x4df96a]);}return BPromise[_0x203e('0x67')](_0x416796,function(_0x166543){return db[_0x203e('0x68')][_0x203e('0x51')](_['omit'](_0x166543,[_0x203e('0x61'),'id'])||{},{'fields':_[_0x203e('0x3a')](_0x5eee37),'raw':!![]})['then'](function(_0x17c232){_0x114c9b[_0x203e('0x69')][_0x203e('0x66')](_0x17c232['dataValues']);})[_0x203e('0x4b')](function(_0x36f1cc){_0x114c9b[_0x203e('0x6a')]['push']({'data':_0x166543,'error':_0x36f1cc[_0x203e('0x6b')]});});})['then'](function(_0x47fc01){return _0x114c9b;})[_0x203e('0x4b')](function(_0x4ac1d8){return _0x4ac1d8;});}else{_0x5ed730[_0x203e('0x1f')](0x190)[_0x203e('0x21')]({'message':_0x203e('0x6c')});}});}})[_0x203e('0x2b')](respondWithResult(_0x5ed730,null))[_0x203e('0x4b')](handleError(_0x5ed730,null));};exports[_0x203e('0x6d')]=function(_0x57e145,_0x379ed6,_0xabbdc6){var _0xb6dbff;return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x57e145[_0x203e('0x4d')]['id']},'include':[{'model':db[_0x203e('0x6e')],'as':_0x203e('0x6f')}]})[_0x203e('0x2b')](handleEntityNotFound(_0x379ed6,null))[_0x203e('0x2b')](function(_0x5084b0){if(_0x5084b0){_0xb6dbff=_0x5084b0;return db[_0x203e('0x68')][_0x203e('0x37')];}})[_0x203e('0x2b')](function(_0x4eb732){if(_0x4eb732){var _0x5a63be={};var _0xd29890={};_0xd29890[_0x203e('0x39')]=_[_0x203e('0x70')](_[_0x203e('0x3a')](_0x4eb732),_['map'](_0xb6dbff['CustomFields'],function(_0x228efc){return util['format'](_0x203e('0x71'),_0x228efc['id']);}));_0xd29890[_0x203e('0x3d')]=_[_0x203e('0x3a')](_0x57e145[_0x203e('0x3d')]);_0xd29890[_0x203e('0x3b')]=_[_0x203e('0x3c')](_0xd29890[_0x203e('0x39')],_0xd29890[_0x203e('0x3d')]);_0x5a63be[_0x203e('0x3e')]=_['intersection'](_0xd29890[_0x203e('0x39')],qs['fields'](_0x57e145['query'][_0x203e('0x3f')]));_0x5a63be['attributes']=_0x5a63be['attributes'][_0x203e('0x40')]?_0x5a63be[_0x203e('0x3e')]:_0xd29890[_0x203e('0x39')];if(!_0x57e145['query'][_0x203e('0x5d')](_0x203e('0x5e'))){_0x5a63be['limit']=qs[_0x203e('0x25')](_0x57e145[_0x203e('0x3d')][_0x203e('0x25')]);_0x5a63be[_0x203e('0x24')]=qs[_0x203e('0x24')](_0x57e145['query'][_0x203e('0x24')]);}_0x5a63be[_0x203e('0x41')]=qs[_0x203e('0x5f')](_0x57e145[_0x203e('0x3d')][_0x203e('0x5f')]);_0x5a63be[_0x203e('0x44')]=qs['filters'](_['pick'](_0x57e145['query'],_0xd29890['filters']));_0x5a63be[_0x203e('0x72')]=!![];if(_0x57e145[_0x203e('0x3d')][_0x203e('0x43')]){_0x5a63be[_0x203e('0x44')]=_[_0x203e('0x45')](_0x5a63be['where'],{'$or':_[_0x203e('0x35')](_0x5a63be['attributes'],function(_0x3dd5e1){var _0x486496={};_0x486496[_0x3dd5e1]={'$like':'%'+_0x57e145[_0x203e('0x3d')][_0x203e('0x43')]+'%'};return _0x486496;})});}_0x5a63be=_[_0x203e('0x45')]({},_0x5a63be,_0x57e145['options']);return _0xb6dbff[_0x203e('0x6d')](_0x5a63be);}})[_0x203e('0x2b')](respondWithResult(_0x379ed6,null))['catch'](handleError(_0x379ed6,null));};exports[_0x203e('0x73')]=function(_0x503529,_0x4b29c4,_0x23008f){var _0x3a0d78;return db['CmList'][_0x203e('0x50')]({'where':{'id':_0x503529[_0x203e('0x4d')]['id']},'include':[{'model':db[_0x203e('0x6e')],'as':_0x203e('0x6f')}]})[_0x203e('0x2b')](handleEntityNotFound(_0x4b29c4,null))[_0x203e('0x2b')](function(_0x27e490){if(_0x27e490){_0x3a0d78=_0x27e490;return db['CmContact'][_0x203e('0x37')];}})[_0x203e('0x2b')](function(_0x40ab30){if(_0x40ab30){var _0x3d7100={};var _0x48d76e={};_0x48d76e['model']=_[_0x203e('0x70')](_['keys'](_0x40ab30),_[_0x203e('0x35')](_0x3a0d78[_0x203e('0x6f')],function(_0x4f3e18){return util[_0x203e('0x74')](_0x203e('0x71'),_0x4f3e18['id']);}));_0x48d76e[_0x203e('0x3d')]=_[_0x203e('0x3a')](_0x503529[_0x203e('0x3d')]);_0x48d76e[_0x203e('0x3b')]=_['intersection'](_0x48d76e['model'],_0x48d76e['query']);_0x3d7100[_0x203e('0x3e')]=_[_0x203e('0x3c')](_0x48d76e[_0x203e('0x39')],qs[_0x203e('0x3f')](_0x503529[_0x203e('0x3d')][_0x203e('0x3f')]));_0x3d7100['attributes']=_0x3d7100[_0x203e('0x3e')]['length']?_0x3d7100[_0x203e('0x3e')]:_0x48d76e[_0x203e('0x39')];if(!_0x503529[_0x203e('0x3d')][_0x203e('0x5d')](_0x203e('0x5e'))){_0x3d7100[_0x203e('0x25')]=qs[_0x203e('0x25')](_0x503529[_0x203e('0x3d')][_0x203e('0x25')]);_0x3d7100[_0x203e('0x24')]=qs[_0x203e('0x24')](_0x503529['query'][_0x203e('0x24')]);}_0x3d7100[_0x203e('0x41')]=qs[_0x203e('0x5f')](_0x503529[_0x203e('0x3d')][_0x203e('0x5f')]);_0x3d7100[_0x203e('0x44')]=qs[_0x203e('0x3b')](_[_0x203e('0x42')](_0x503529[_0x203e('0x3d')],_0x48d76e[_0x203e('0x3b')]));_0x3d7100['raw']=!![];if(_0x503529['query'][_0x203e('0x43')]){_0x3d7100[_0x203e('0x44')]=_[_0x203e('0x45')](_0x3d7100[_0x203e('0x44')],{'$or':_[_0x203e('0x35')](_0x3d7100[_0x203e('0x3e')],function(_0x1ab26c){var _0xdc347e={};_0xdc347e[_0x1ab26c]={'$like':'%'+_0x503529['query'][_0x203e('0x43')]+'%'};return _0xdc347e;})});}_0x3d7100=_[_0x203e('0x45')]({},_0x3d7100,_0x503529[_0x203e('0x4f')]);return _0x3a0d78[_0x203e('0x6d')](_0x3d7100);}})['then'](function(_0x1376d9){if(!_[_0x203e('0x75')](_0x1376d9)){var _0x208f7a=toCsv(_0x1376d9);var _0x417b12=Date[_0x203e('0x76')]();fs[_0x203e('0x77')](util['format'](_0x203e('0x78'),_0x3a0d78['id'],_0x417b12),_0x208f7a);_0x4b29c4['setHeader'](_0x203e('0x79'),_0x203e('0x7a')+util['format'](_0x203e('0x7b'),_0x3a0d78['id'],_0x417b12));_0x4b29c4[_0x203e('0x7c')](_0x203e('0x7d'),_0x203e('0x7e'));return _0x4b29c4[_0x203e('0x7f')](util[_0x203e('0x74')](_0x203e('0x78'),_0x3a0d78['id'],_0x417b12));}else{return _0x4b29c4['sendStatus'](0xcc);}})[_0x203e('0x4b')](handleError(_0x4b29c4,null));};exports[_0x203e('0x80')]=function(_0x562e6a,_0x4fea3b,_0x1729fd){var _0x464869;delete _0x562e6a[_0x203e('0x52')]['id'];return db[_0x203e('0x36')][_0x203e('0x5c')]({'where':{'id':_0x562e6a[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x4fea3b,null))['then'](function(_0x5af1fb){if(_0x5af1fb){return db[_0x203e('0x81')]['transaction'](function(_0x20cd18){return db[_0x203e('0x6e')][_0x203e('0x51')](_0x562e6a[_0x203e('0x52')],{'transaction':_0x20cd18})[_0x203e('0x2b')](function(_0x55f6e9){_0x464869=_0x55f6e9;return _0x5af1fb[_0x203e('0x82')](_0x55f6e9,{'transaction':_0x20cd18});})['then'](function(){var _0x164e86={'type':db[_0x203e('0x83')][_0x203e('0x84')],'transaction':_0x20cd18};switch(_0x562e6a[_0x203e('0x52')]['type']){case'text':_0x164e86[_0x203e('0x46')]=db[_0x203e('0x83')][_0x203e('0x84')];break;case _0x203e('0x85'):_0x164e86['type']=db[_0x203e('0x83')][_0x203e('0x86')];break;case _0x203e('0x87'):_0x164e86[_0x203e('0x46')]=db[_0x203e('0x83')][_0x203e('0x88')];_0x164e86[_0x203e('0x89')]=![];break;default:}return db[_0x203e('0x81')][_0x203e('0x8a')][_0x203e('0x8b')](_0x203e('0x8c'),util[_0x203e('0x74')]('cf_%s',_0x464869['id']),_0x164e86);})[_0x203e('0x2b')](function(){return _0x464869;});});}})[_0x203e('0x2b')](respondWithResult(_0x4fea3b,null))[_0x203e('0x4b')](handleError(_0x4fea3b,null));};exports[_0x203e('0x8d')]=function(_0x3662c8,_0x5d8991,_0x3dc76a){var _0x5eb8c1={};var _0x5c884a={};var _0x20ad0d;var _0x267332;return db[_0x203e('0x36')][_0x203e('0x5c')]({'where':{'id':_0x3662c8[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x5d8991,null))[_0x203e('0x2b')](function(_0x858f1e){if(_0x858f1e){_0x20ad0d=_0x858f1e;_0x5c884a['model']=_[_0x203e('0x3a')](db[_0x203e('0x6e')]['rawAttributes']);_0x5c884a['query']=_[_0x203e('0x3a')](_0x3662c8[_0x203e('0x3d')]);_0x5c884a[_0x203e('0x3b')]=_['intersection'](_0x5c884a['model'],_0x5c884a[_0x203e('0x3d')]);_0x5eb8c1[_0x203e('0x3e')]=_['intersection'](_0x5c884a[_0x203e('0x39')],qs['fields'](_0x3662c8[_0x203e('0x3d')][_0x203e('0x3f')]));_0x5eb8c1[_0x203e('0x3e')]=_0x5eb8c1[_0x203e('0x3e')][_0x203e('0x40')]?_0x5eb8c1[_0x203e('0x3e')]:_0x5c884a['model'];_0x5eb8c1['order']=qs[_0x203e('0x5f')](_0x3662c8['query'][_0x203e('0x5f')]);_0x5eb8c1[_0x203e('0x44')]=qs[_0x203e('0x3b')](_[_0x203e('0x42')](_0x3662c8[_0x203e('0x3d')],_0x5c884a[_0x203e('0x3b')]));_0x5eb8c1[_0x203e('0x44')]=_[_0x203e('0x45')](_0x5eb8c1[_0x203e('0x44')],{'$or':[{'ListId':_0x858f1e['id']},{'ListId':null}]});if(_0x3662c8[_0x203e('0x3d')][_0x203e('0x43')]){_0x5eb8c1[_0x203e('0x44')]=_[_0x203e('0x45')](_0x5eb8c1[_0x203e('0x44')],{'$or':_[_0x203e('0x35')](_0x5eb8c1['attributes'],function(_0x156747){var _0x41bafa={};_0x41bafa[_0x156747]={'$like':'%'+_0x3662c8[_0x203e('0x3d')][_0x203e('0x43')]+'%'};return _0x41bafa;})});}_0x5eb8c1=_['merge']({},_0x5eb8c1,_0x3662c8[_0x203e('0x4f')]);return db[_0x203e('0x6e')]['findAndCountAll'](_0x5eb8c1);}})[_0x203e('0x2b')](respondWithResult(_0x5d8991,null))['catch'](handleError(_0x5d8991,null));};exports[_0x203e('0x8e')]=function(_0x30d553,_0x23204e,_0x2ce83e){return db['CmList'][_0x203e('0x50')]({'where':{'id':_0x30d553[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x23204e,null))[_0x203e('0x2b')](function(_0x104b65){if(_0x104b65){return _0x104b65[_0x203e('0x8e')](_0x30d553[_0x203e('0x52')][_0x203e('0x61')],_['omit'](_0x30d553[_0x203e('0x52')],[_0x203e('0x61'),'id'])||{})[_0x203e('0x8f')](function(_0x212cec){for(var _0x1f96c3=0x0;_0x1f96c3<_0x30d553[_0x203e('0x52')][_0x203e('0x61')]['length'];_0x1f96c3+=0x1){socket[_0x203e('0x90')](_0x203e('0x91'),{'UserId':Number(_0x30d553[_0x203e('0x52')][_0x203e('0x61')][_0x1f96c3]),'CmListId':Number(_0x30d553[_0x203e('0x4d')]['id'])});}return _0x212cec;});}})['then'](respondWithResult(_0x23204e,null))[_0x203e('0x4b')](handleError(_0x23204e,null));};exports[_0x203e('0x92')]=function(_0x3fe138,_0x50bf62,_0x1b834d){return db[_0x203e('0x36')][_0x203e('0x50')]({'where':{'id':_0x3fe138[_0x203e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x50bf62,null))['then'](function(_0x5f529a){if(_0x5f529a){return _0x5f529a[_0x203e('0x92')](_0x3fe138[_0x203e('0x3d')][_0x203e('0x61')])[_0x203e('0x2b')](function(){if(_[_0x203e('0x64')](_0x3fe138[_0x203e('0x3d')]['ids'])){for(var _0x366baf=0x0;_0x366baf<_0x3fe138[_0x203e('0x3d')][_0x203e('0x61')][_0x203e('0x40')];_0x366baf+=0x1){socket[_0x203e('0x90')](_0x203e('0x93'),{'UserId':Number(_0x3fe138[_0x203e('0x3d')][_0x203e('0x61')][_0x366baf]),'CmListId':Number(_0x3fe138['params']['id'])});}}else{socket[_0x203e('0x90')](_0x203e('0x93'),{'UserId':Number(_0x3fe138[_0x203e('0x3d')]['ids']),'CmListId':Number(_0x3fe138['params']['id'])});}});}})[_0x203e('0x2b')](respondWithStatusCode(_0x50bf62,null))[_0x203e('0x4b')](handleError(_0x50bf62,null));};exports[_0x203e('0x94')]=function(_0x350333,_0x579466,_0x5550d0){var _0x5339a5={};var _0x508b20={};var _0x4395ac;var _0x3152ac;return db[_0x203e('0x36')][_0x203e('0x5c')]({'where':{'id':_0x350333[_0x203e('0x4d')]['id']}})[_0x203e('0x2b')](handleEntityNotFound(_0x579466,null))[_0x203e('0x2b')](function(_0x3bd96f){if(_0x3bd96f){_0x4395ac=_0x3bd96f;_0x508b20['model']=_[_0x203e('0x3a')](db[_0x203e('0x95')]['rawAttributes']);_0x508b20[_0x203e('0x3d')]=_[_0x203e('0x3a')](_0x350333['query']);_0x508b20[_0x203e('0x3b')]=_[_0x203e('0x3c')](_0x508b20[_0x203e('0x39')],_0x508b20[_0x203e('0x3d')]);_0x5339a5[_0x203e('0x3e')]=_[_0x203e('0x3c')](_0x508b20['model'],qs['fields'](_0x350333[_0x203e('0x3d')][_0x203e('0x3f')]));_0x5339a5['attributes']=_0x5339a5[_0x203e('0x3e')][_0x203e('0x40')]?_0x5339a5[_0x203e('0x3e')]:_0x508b20[_0x203e('0x39')];_0x5339a5[_0x203e('0x41')]=qs[_0x203e('0x5f')](_0x350333[_0x203e('0x3d')][_0x203e('0x5f')]);_0x5339a5[_0x203e('0x44')]=qs[_0x203e('0x3b')](_[_0x203e('0x42')](_0x350333['query'],_0x508b20['filters']));if(_0x350333[_0x203e('0x3d')][_0x203e('0x43')]){_0x5339a5['where']=_['merge'](_0x5339a5[_0x203e('0x44')],{'$or':_[_0x203e('0x35')](_0x5339a5[_0x203e('0x3e')],function(_0xa0fa9e){var _0x1627e6={};_0x1627e6[_0xa0fa9e]={'$like':'%'+_0x350333['query']['filter']+'%'};return _0x1627e6;})});}_0x5339a5=_[_0x203e('0x45')]({},_0x5339a5,_0x350333[_0x203e('0x4f')]);return _0x4395ac[_0x203e('0x94')](_0x5339a5);}})[_0x203e('0x2b')](function(_0x56566e){if(_0x56566e){_0x3152ac=_0x56566e[_0x203e('0x40')];if(!_0x350333[_0x203e('0x3d')][_0x203e('0x5d')](_0x203e('0x5e'))){_0x5339a5['limit']=qs['limit'](_0x350333[_0x203e('0x3d')][_0x203e('0x25')]);_0x5339a5[_0x203e('0x24')]=qs[_0x203e('0x24')](_0x350333['query'][_0x203e('0x24')]);}return _0x4395ac[_0x203e('0x94')](_0x5339a5);}})[_0x203e('0x2b')](function(_0xad0644){if(_0xad0644){return _0xad0644?{'count':_0x3152ac,'rows':_0xad0644}:null;}})[_0x203e('0x2b')](respondWithResult(_0x579466,null))[_0x203e('0x4b')](handleError(_0x579466,null));}; \ No newline at end of file +var _0x461f=['download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','ids','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','map','rows','removeDispositions','addContacts','CmContact','tags','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','Content-type'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0x461f,0x142));var _0xf461=function(_0x4aea3a,_0x3839f9){_0x4aea3a=_0x4aea3a-0x0;var _0x5a349e=_0x461f[_0x4aea3a];return _0x5a349e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf461('0x0'));var zipdir=require(_0xf461('0x1'));var jsonpatch=require(_0xf461('0x2'));var rp=require(_0xf461('0x3'));var moment=require('moment');var BPromise=require(_0xf461('0x4'));var Mustache=require(_0xf461('0x5'));var util=require(_0xf461('0x6'));var path=require(_0xf461('0x7'));var sox=require(_0xf461('0x8'));var csv=require('to-csv');var ejs=require(_0xf461('0x9'));var fs=require('fs');var fs_extra=require(_0xf461('0xa'));var _=require(_0xf461('0xb'));var squel=require(_0xf461('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf461('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf461('0xe'));var Papa=require('papaparse');var Redis=require(_0xf461('0xf'));var authService=require(_0xf461('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf461('0x11'));var logger=require(_0xf461('0x12'))(_0xf461('0x13'));var utils=require(_0xf461('0x14'));var config=require(_0xf461('0x15'));var licenseUtil=require(_0xf461('0x16'));var db=require(_0xf461('0x17'))['db'];config[_0xf461('0x18')]=_['defaults'](config[_0xf461('0x18')],{'host':_0xf461('0x19'),'port':0x18eb});var socket=require(_0xf461('0x1a'))(new Redis(config[_0xf461('0x18')]));require(_0xf461('0x1b'))[_0xf461('0x1c')](socket);function respondWithStatusCode(_0x1079d7,_0x2eee66){_0x2eee66=_0x2eee66||0xcc;return function(_0x1b3bd6){if(_0x1b3bd6){return _0x1079d7[_0xf461('0x1d')](_0x2eee66);}return _0x1079d7[_0xf461('0x1e')](_0x2eee66)['end']();};}function respondWithResult(_0x409c50,_0x49fb67){_0x49fb67=_0x49fb67||0xc8;return function(_0x5da71f){if(_0x5da71f){return _0x409c50[_0xf461('0x1e')](_0x49fb67)[_0xf461('0x1f')](_0x5da71f);}};}function respondWithFilteredResult(_0x416dfe,_0x1106f0){return function(_0x4ffe70){if(_0x4ffe70){var _0x3a57a7=typeof _0x1106f0[_0xf461('0x20')]==='undefined'&&typeof _0x1106f0['limit']===_0xf461('0x21');var _0x5ad875=_0x4ffe70[_0xf461('0x22')];var _0x4ed4ac=_0x3a57a7?0x0:_0x1106f0[_0xf461('0x20')];var _0x315d8a=_0x3a57a7?_0x4ffe70[_0xf461('0x22')]:_0x1106f0[_0xf461('0x20')]+_0x1106f0['limit'];var _0x4e7503;if(_0x315d8a>=_0x5ad875){_0x315d8a=_0x5ad875;_0x4e7503=0xc8;}else{_0x4e7503=0xce;}_0x416dfe[_0xf461('0x1e')](_0x4e7503);return _0x416dfe['set']('Content-Range',_0x4ed4ac+'-'+_0x315d8a+'/'+_0x5ad875)[_0xf461('0x1f')](_0x4ffe70);}return null;};}function patchUpdates(_0x15cdac){return function(_0x2ee168){try{jsonpatch[_0xf461('0x23')](_0x2ee168,_0x15cdac,!![]);}catch(_0x310a2d){return BPromise[_0xf461('0x24')](_0x310a2d);}return _0x2ee168[_0xf461('0x25')]();};}function saveUpdates(_0x417677,_0x1282f8){return function(_0x4348cf){if(_0x4348cf){return _0x4348cf[_0xf461('0x26')](_0x417677)[_0xf461('0x27')](function(_0x908ad5){return _0x908ad5;});}return null;};}function removeEntity(_0x5ce5c1,_0x522420){return function(_0x5abe99){if(_0x5abe99){return _0x5abe99[_0xf461('0x28')]()[_0xf461('0x27')](function(){var _0x30fadb=_0x5abe99[_0xf461('0x29')]({'plain':!![]});var _0x1eb42f=_0xf461('0x2a');return db[_0xf461('0x2b')][_0xf461('0x28')]({'where':{'type':_0x1eb42f,'resourceId':_0x30fadb['id']}})[_0xf461('0x27')](function(){return _0x5abe99;});})[_0xf461('0x27')](function(){_0x5ce5c1['status'](0xcc)[_0xf461('0x2c')]();});}};}function handleEntityNotFound(_0x2dcf8e,_0x4645d0){return function(_0x11c2b2){if(!_0x11c2b2){_0x2dcf8e['sendStatus'](0x194);}return _0x11c2b2;};}function handleError(_0x4e3613,_0x44a4a8){_0x44a4a8=_0x44a4a8||0x1f4;return function(_0x58bc58){logger[_0xf461('0x2d')](_0x58bc58[_0xf461('0x2e')]);if(_0x58bc58[_0xf461('0x2f')]){delete _0x58bc58[_0xf461('0x2f')];}_0x4e3613[_0xf461('0x1e')](_0x44a4a8)[_0xf461('0x30')](_0x58bc58);};}exports['index']=function(_0x876ffc,_0xee6575){var _0x26a2b5={},_0x3917e0={},_0x5bb70e={'count':0x0,'rows':[]};var _0x4b0a01=_['map'](db[_0xf461('0x31')][_0xf461('0x32')],function(_0x58bd0a){return{'name':_0x58bd0a[_0xf461('0x33')],'type':_0x58bd0a[_0xf461('0x34')][_0xf461('0x35')]};});_0x3917e0[_0xf461('0x36')]=_['map'](_0x4b0a01,_0xf461('0x2f'));_0x3917e0[_0xf461('0x37')]=_[_0xf461('0x38')](_0x876ffc[_0xf461('0x37')]);_0x3917e0[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x3917e0[_0xf461('0x36')],_0x3917e0[_0xf461('0x37')]);_0x26a2b5[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x3917e0[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x876ffc[_0xf461('0x37')]['fields']));_0x26a2b5[_0xf461('0x3b')]=_0x26a2b5['attributes'][_0xf461('0x3d')]?_0x26a2b5[_0xf461('0x3b')]:_0x3917e0[_0xf461('0x36')];if(!_0x876ffc[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x26a2b5[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x876ffc[_0xf461('0x37')][_0xf461('0x40')]);_0x26a2b5[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x876ffc[_0xf461('0x37')][_0xf461('0x20')]);}_0x26a2b5[_0xf461('0x41')]=qs['sort'](_0x876ffc['query'][_0xf461('0x42')]);_0x26a2b5[_0xf461('0x43')]=qs['filters'](_[_0xf461('0x44')](_0x876ffc[_0xf461('0x37')],_0x3917e0[_0xf461('0x39')]),_0x4b0a01);if(_0x876ffc[_0xf461('0x37')]['filter']){_0x26a2b5['where']=_[_0xf461('0x45')](_0x26a2b5[_0xf461('0x43')],{'$or':_['map'](_0x4b0a01,function(_0x2614b8){if(_0x2614b8['type']!==_0xf461('0x46')){var _0x36339e={};_0x36339e[_0x2614b8['name']]={'$like':'%'+_0x876ffc[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x36339e;}})});}_0x26a2b5=_[_0xf461('0x45')]({},_0x26a2b5,_0x876ffc['options']);var _0x5250b4={'where':_0x26a2b5[_0xf461('0x43')]};return db['CmList'][_0xf461('0x22')](_0x5250b4)[_0xf461('0x27')](function(_0x10f180){_0x5bb70e[_0xf461('0x22')]=_0x10f180;if(_0x876ffc[_0xf461('0x37')][_0xf461('0x48')]){_0x26a2b5[_0xf461('0x49')]=[{'all':!![]}];}return db['CmList'][_0xf461('0x4a')](_0x26a2b5);})[_0xf461('0x27')](function(_0x2d0bda){_0x5bb70e['rows']=_0x2d0bda;return _0x5bb70e;})[_0xf461('0x27')](respondWithFilteredResult(_0xee6575,_0x26a2b5))[_0xf461('0x4b')](handleError(_0xee6575,null));};exports[_0xf461('0x4c')]=function(_0x19880c,_0x3735c7){var _0x4a20a8={'raw':![],'where':{'id':_0x19880c[_0xf461('0x4d')]['id']}},_0x129f97={};_0x129f97[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x31')][_0xf461('0x32')]);_0x129f97['query']=_[_0xf461('0x38')](_0x19880c[_0xf461('0x37')]);_0x129f97[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x129f97[_0xf461('0x36')],_0x129f97['query']);_0x4a20a8[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x129f97[_0xf461('0x36')],qs['fields'](_0x19880c[_0xf461('0x37')][_0xf461('0x3c')]));_0x4a20a8[_0xf461('0x3b')]=_0x4a20a8[_0xf461('0x3b')][_0xf461('0x3d')]?_0x4a20a8['attributes']:_0x129f97['model'];if(_0x19880c[_0xf461('0x37')][_0xf461('0x48')]){_0x4a20a8['include']=[{'all':!![]}];}_0x4a20a8=_['merge']({},_0x4a20a8,_0x19880c[_0xf461('0x4e')]);return db[_0xf461('0x31')][_0xf461('0x4f')](_0x4a20a8)['then'](handleEntityNotFound(_0x3735c7,null))[_0xf461('0x27')](respondWithResult(_0x3735c7,null))[_0xf461('0x4b')](handleError(_0x3735c7,null));};exports[_0xf461('0x50')]=function(_0x381f0a,_0x248b6b){return db['CmList']['create'](_0x381f0a[_0xf461('0x51')],{})['then'](function(_0x440127){var _0x4b71ce=_0x381f0a[_0xf461('0x52')][_0xf461('0x29')]({'plain':!![]});if(!_0x4b71ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b71ce[_0xf461('0x53')]===_0xf461('0x52')){var _0x556cbd=_0x440127[_0xf461('0x29')]({'plain':!![]});var _0x4221b5=_0xf461('0x2a');return db[_0xf461('0x54')][_0xf461('0x4f')]({'where':{'name':_0x4221b5,'userProfileId':_0x4b71ce['userProfileId']},'raw':!![]})[_0xf461('0x27')](function(_0x4ffe94){if(_0x4ffe94&&_0x4ffe94[_0xf461('0x55')]===0x0){return db['UserProfileResource'][_0xf461('0x50')]({'name':_0x556cbd[_0xf461('0x2f')],'resourceId':_0x556cbd['id'],'type':_0x4ffe94[_0xf461('0x2f')],'sectionId':_0x4ffe94['id']},{})['then'](function(){return _0x440127;});}else{return _0x440127;}})[_0xf461('0x4b')](function(_0x5d670a){logger[_0xf461('0x2d')](_0xf461('0x56'),_0x5d670a);throw _0x5d670a;});}return _0x440127;})[_0xf461('0x27')](respondWithResult(_0x248b6b,0xc9))['catch'](handleError(_0x248b6b,null));};exports[_0xf461('0x26')]=function(_0x5085fa,_0x20bc3c){if(_0x5085fa[_0xf461('0x51')]['id']){delete _0x5085fa[_0xf461('0x51')]['id'];}return db['CmList'][_0xf461('0x4f')]({'where':{'id':_0x5085fa[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x20bc3c,null))['then'](saveUpdates(_0x5085fa[_0xf461('0x51')],null))['then'](respondWithResult(_0x20bc3c,null))[_0xf461('0x4b')](handleError(_0x20bc3c,null));};exports['destroy']=function(_0x493d06,_0x21139e){return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x493d06[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x21139e,null))[_0xf461('0x27')](removeEntity(_0x21139e,null))[_0xf461('0x4b')](handleError(_0x21139e,null));};exports[_0xf461('0x57')]=function(_0x34e91d,_0x34bde9){return db[_0xf461('0x31')]['describe']()[_0xf461('0x27')](respondWithResult(_0x34bde9,null))['catch'](handleError(_0x34bde9,null));};exports[_0xf461('0x58')]=function(_0x57afa0,_0x4819f9,_0x5a84fb){if(_0x57afa0[_0xf461('0x51')]['id']){delete _0x57afa0[_0xf461('0x51')]['id'];}return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x57afa0[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x4819f9,null))[_0xf461('0x27')](function(_0xe4cfc){if(_0xe4cfc){_0x57afa0[_0xf461('0x51')][_0xf461('0x59')]=_0xe4cfc['id'];return db['Disposition'][_0xf461('0x50')](_0x57afa0['body']);}})[_0xf461('0x27')](respondWithResult(_0x4819f9,null))[_0xf461('0x4b')](handleError(_0x4819f9,null));};exports[_0xf461('0x5a')]=function(_0x49033d,_0x107f1c,_0x49bef0){var _0x10c444={'raw':![],'where':{}};var _0x50bf05={};var _0x1b5e9b={'count':0x0,'rows':[]};return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x49033d[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x107f1c,null))['then'](function(_0x5d7ead){if(_0x5d7ead){_0x50bf05[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x5c')]['rawAttributes']);_0x50bf05[_0xf461('0x37')]=_[_0xf461('0x38')](_0x49033d[_0xf461('0x37')]);_0x50bf05[_0xf461('0x39')]=_['intersection'](_0x50bf05['model'],_0x50bf05[_0xf461('0x37')]);_0x10c444[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x50bf05[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x49033d[_0xf461('0x37')][_0xf461('0x3c')]));_0x10c444[_0xf461('0x3b')]=_0x10c444[_0xf461('0x3b')][_0xf461('0x3d')]?_0x10c444[_0xf461('0x3b')]:_0x50bf05[_0xf461('0x36')];if(!_0x49033d[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x10c444[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x49033d['query'][_0xf461('0x40')]);_0x10c444[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x49033d[_0xf461('0x37')][_0xf461('0x20')]);}_0x10c444['order']=qs['sort'](_0x49033d[_0xf461('0x37')][_0xf461('0x42')]);_0x10c444['where']=qs['filters'](_[_0xf461('0x44')](_0x49033d[_0xf461('0x37')],_0x50bf05[_0xf461('0x39')]));_0x10c444[_0xf461('0x43')][_0xf461('0x59')]=_0x5d7ead['id'];if(_0x49033d['query'][_0xf461('0x47')]){_0x10c444[_0xf461('0x43')]=_[_0xf461('0x45')](_0x10c444[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x10c444[_0xf461('0x3b')],function(_0x1cc76d){var _0x3b8c5f={};_0x3b8c5f[_0x1cc76d]={'$like':'%'+_0x49033d['query'][_0xf461('0x47')]+'%'};return _0x3b8c5f;})});}_0x10c444=_[_0xf461('0x45')]({},_0x10c444,_0x49033d[_0xf461('0x4e')]);return db['Disposition']['count']({'where':_0x10c444[_0xf461('0x43')]})[_0xf461('0x27')](function(_0x2069c9){_0x1b5e9b['count']=_0x2069c9;if(_0x49033d['query'][_0xf461('0x48')]){_0x10c444['include']=[{'all':!![]}];}return db[_0xf461('0x5c')][_0xf461('0x4a')](_0x10c444);})['then'](function(_0x21d28f){_0x1b5e9b[_0xf461('0x5e')]=_0x21d28f;return _0x1b5e9b;});}})[_0xf461('0x27')](respondWithFilteredResult(_0x107f1c,_0x10c444))[_0xf461('0x4b')](handleError(_0x107f1c,null));};exports[_0xf461('0x5f')]=function(_0x4c6074,_0x1e2152,_0xb8fccb){return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x4c6074[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x1e2152,null))[_0xf461('0x27')](function(_0x3a41f3){if(_0x3a41f3){return _0x3a41f3['removeDispositions'](_0x4c6074['query']['ids']);}})[_0xf461('0x27')](respondWithStatusCode(_0x1e2152,null))[_0xf461('0x4b')](handleError(_0x1e2152,null));};exports[_0xf461('0x60')]=function(_0x134698,_0x1de6ef,_0x375677){return db[_0xf461('0x31')]['find']({'where':{'id':_0x134698[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x1de6ef,null))[_0xf461('0x27')](function(_0x17a7ae){if(_0x17a7ae){var _0xa3b625=[];var _0x5d9517={'success':[],'errors':[]};return db[_0xf461('0x61')][_0xf461('0x57')]()[_0xf461('0x27')](function(_0x410286){if(_0x134698['body'][_0xf461('0x62')]&&_['isArray'](_0x134698['body'][_0xf461('0x62')])){if(_0x134698[_0xf461('0x51')]['tags'][_0xf461('0x3d')]){_0x134698[_0xf461('0x51')][_0xf461('0x62')]=_0x134698[_0xf461('0x51')][_0xf461('0x62')][_0xf461('0x63')](';')+';';}else{_0x134698[_0xf461('0x51')][_0xf461('0x62')]=null;}}else{_0x134698[_0xf461('0x51')][_0xf461('0x62')]=null;}if(_0x134698[_0xf461('0x51')]&&_['isArray'](_0x134698[_0xf461('0x51')])){for(var _0x27370b=0x0;_0x27370b<_0x134698[_0xf461('0x51')][_0xf461('0x3d')];_0x27370b+=0x1){_0x134698[_0xf461('0x51')][_0x27370b][_0xf461('0x59')]=_0x134698['params']['id'];_0xa3b625[_0xf461('0x64')](_0x134698[_0xf461('0x51')][_0x27370b]);}return BPromise['each'](_0xa3b625,function(_0x59c2e2){return db[_0xf461('0x61')][_0xf461('0x50')](_[_0xf461('0x65')](_0x59c2e2,['ids','id'])||{},{'fields':_[_0xf461('0x38')](_0x410286),'raw':!![]})['then'](function(_0x517fe5){_0x5d9517[_0xf461('0x66')]['push'](_0x517fe5[_0xf461('0x67')]);})[_0xf461('0x4b')](function(_0x14af31){_0x5d9517[_0xf461('0x68')][_0xf461('0x64')]({'data':_0x59c2e2,'error':_0x14af31[_0xf461('0x69')]});});})[_0xf461('0x27')](function(_0x412d1d){return _0x5d9517;})['catch'](function(_0x1b5cda){return _0x1b5cda;});}else{_0x1de6ef['status'](0x190)[_0xf461('0x1f')]({'message':_0xf461('0x6a')});}});}})[_0xf461('0x27')](respondWithResult(_0x1de6ef,null))['catch'](handleError(_0x1de6ef,null));};exports[_0xf461('0x6b')]=function(_0x4cdfea,_0x3175e4,_0x301a30){var _0x356014;return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x4cdfea[_0xf461('0x4d')]['id']},'include':[{'model':db[_0xf461('0x6c')],'as':'CustomFields'}]})[_0xf461('0x27')](handleEntityNotFound(_0x3175e4,null))[_0xf461('0x27')](function(_0x841a17){if(_0x841a17){_0x356014=_0x841a17;return db[_0xf461('0x61')][_0xf461('0x32')];}})[_0xf461('0x27')](function(_0x397cf5){if(_0x397cf5){var _0x23431f={};var _0x369372={};_0x369372[_0xf461('0x36')]=_[_0xf461('0x6d')](_['keys'](_0x397cf5),_[_0xf461('0x5d')](_0x356014[_0xf461('0x6e')],function(_0xf014e6){return util[_0xf461('0x6f')](_0xf461('0x70'),_0xf014e6['id']);}));_0x369372['query']=_[_0xf461('0x38')](_0x4cdfea[_0xf461('0x37')]);_0x369372['filters']=_[_0xf461('0x3a')](_0x369372[_0xf461('0x36')],_0x369372[_0xf461('0x37')]);_0x23431f[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x369372[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x4cdfea[_0xf461('0x37')][_0xf461('0x3c')]));_0x23431f['attributes']=_0x23431f[_0xf461('0x3b')][_0xf461('0x3d')]?_0x23431f['attributes']:_0x369372[_0xf461('0x36')];if(!_0x4cdfea[_0xf461('0x37')]['hasOwnProperty'](_0xf461('0x3f'))){_0x23431f[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x4cdfea[_0xf461('0x37')][_0xf461('0x40')]);_0x23431f[_0xf461('0x20')]=qs['offset'](_0x4cdfea[_0xf461('0x37')][_0xf461('0x20')]);}_0x23431f[_0xf461('0x41')]=qs[_0xf461('0x42')](_0x4cdfea['query'][_0xf461('0x42')]);_0x23431f[_0xf461('0x43')]=qs['filters'](_['pick'](_0x4cdfea['query'],_0x369372[_0xf461('0x39')]));_0x23431f[_0xf461('0x71')]=!![];if(_0x4cdfea[_0xf461('0x37')][_0xf461('0x47')]){_0x23431f['where']=_[_0xf461('0x45')](_0x23431f[_0xf461('0x43')],{'$or':_['map'](_0x23431f[_0xf461('0x3b')],function(_0x5e4e89){var _0x4138c1={};_0x4138c1[_0x5e4e89]={'$like':'%'+_0x4cdfea[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x4138c1;})});}_0x23431f=_[_0xf461('0x45')]({},_0x23431f,_0x4cdfea['options']);return _0x356014[_0xf461('0x6b')](_0x23431f);}})[_0xf461('0x27')](respondWithResult(_0x3175e4,null))[_0xf461('0x4b')](handleError(_0x3175e4,null));};exports[_0xf461('0x72')]=function(_0x532cde,_0x13ff68,_0x5849a5){var _0x6052fc;return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x532cde[_0xf461('0x4d')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf461('0x6e')}]})[_0xf461('0x27')](handleEntityNotFound(_0x13ff68,null))[_0xf461('0x27')](function(_0x279b59){if(_0x279b59){_0x6052fc=_0x279b59;return db[_0xf461('0x61')]['rawAttributes'];}})[_0xf461('0x27')](function(_0x1b7965){if(_0x1b7965){var _0x6a4816={};var _0x538280={};_0x538280['model']=_[_0xf461('0x6d')](_[_0xf461('0x38')](_0x1b7965),_[_0xf461('0x5d')](_0x6052fc['CustomFields'],function(_0x14c7e8){return util[_0xf461('0x6f')](_0xf461('0x70'),_0x14c7e8['id']);}));_0x538280[_0xf461('0x37')]=_[_0xf461('0x38')](_0x532cde[_0xf461('0x37')]);_0x538280[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x538280[_0xf461('0x36')],_0x538280['query']);_0x6a4816[_0xf461('0x3b')]=_['intersection'](_0x538280[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x532cde[_0xf461('0x37')][_0xf461('0x3c')]));_0x6a4816[_0xf461('0x3b')]=_0x6a4816['attributes'][_0xf461('0x3d')]?_0x6a4816['attributes']:_0x538280[_0xf461('0x36')];if(!_0x532cde[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x6a4816[_0xf461('0x40')]=qs['limit'](_0x532cde[_0xf461('0x37')][_0xf461('0x40')]);_0x6a4816[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x532cde[_0xf461('0x37')][_0xf461('0x20')]);}_0x6a4816['order']=qs[_0xf461('0x42')](_0x532cde[_0xf461('0x37')]['sort']);_0x6a4816['where']=qs[_0xf461('0x39')](_[_0xf461('0x44')](_0x532cde[_0xf461('0x37')],_0x538280['filters']));_0x6a4816[_0xf461('0x71')]=!![];if(_0x532cde[_0xf461('0x37')]['filter']){_0x6a4816['where']=_[_0xf461('0x45')](_0x6a4816['where'],{'$or':_[_0xf461('0x5d')](_0x6a4816['attributes'],function(_0x25e8ac){var _0x35bf16={};_0x35bf16[_0x25e8ac]={'$like':'%'+_0x532cde['query'][_0xf461('0x47')]+'%'};return _0x35bf16;})});}_0x6a4816=_['merge']({},_0x6a4816,_0x532cde[_0xf461('0x4e')]);return _0x6052fc['getContacts'](_0x6a4816);}})[_0xf461('0x27')](function(_0x5a57f5){if(!_[_0xf461('0x73')](_0x5a57f5)){var _0xdbc79c=toCsv(_0x5a57f5);var _0x2c9518=Date[_0xf461('0x74')]();fs[_0xf461('0x75')](util[_0xf461('0x6f')](_0xf461('0x76'),_0x6052fc['id'],_0x2c9518),_0xdbc79c);_0x13ff68['setHeader'](_0xf461('0x77'),_0xf461('0x78')+util[_0xf461('0x6f')]('list_%d_%s.csv',_0x6052fc['id'],_0x2c9518));_0x13ff68['setHeader'](_0xf461('0x79'),'text/csv');return _0x13ff68[_0xf461('0x7a')](util[_0xf461('0x6f')]('/tmp/list_%d_%s.csv',_0x6052fc['id'],_0x2c9518));}else{return _0x13ff68[_0xf461('0x1d')](0xcc);}})[_0xf461('0x4b')](handleError(_0x13ff68,null));};exports[_0xf461('0x7b')]=function(_0x3697e2,_0xc62cd7,_0x29afea){var _0xa0315a;delete _0x3697e2['body']['id'];return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x3697e2['params']['id']}})[_0xf461('0x27')](handleEntityNotFound(_0xc62cd7,null))[_0xf461('0x27')](function(_0x4372d4){if(_0x4372d4){return db[_0xf461('0x7c')][_0xf461('0x7d')](function(_0x4852e8){return db[_0xf461('0x6c')][_0xf461('0x50')](_0x3697e2[_0xf461('0x51')],{'transaction':_0x4852e8})[_0xf461('0x27')](function(_0x36dc96){_0xa0315a=_0x36dc96;return _0x4372d4[_0xf461('0x7e')](_0x36dc96,{'transaction':_0x4852e8});})[_0xf461('0x27')](function(){var _0x1b83dc={'type':db[_0xf461('0x7f')][_0xf461('0x80')],'transaction':_0x4852e8};switch(_0x3697e2[_0xf461('0x51')][_0xf461('0x34')]){case _0xf461('0x81'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x80')];break;case _0xf461('0x82'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x83')];break;case _0xf461('0x84'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x85')];_0x1b83dc[_0xf461('0x86')]=![];break;default:}return db[_0xf461('0x7c')][_0xf461('0x87')][_0xf461('0x88')](_0xf461('0x89'),util[_0xf461('0x6f')]('cf_%s',_0xa0315a['id']),_0x1b83dc);})[_0xf461('0x27')](function(){return _0xa0315a;});});}})[_0xf461('0x27')](respondWithResult(_0xc62cd7,null))[_0xf461('0x4b')](handleError(_0xc62cd7,null));};exports[_0xf461('0x8a')]=function(_0x3ce06a,_0xf67ac,_0x3dac63){var _0x332f60={};var _0x55be73={};var _0x1319a8;var _0x1ce129;return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x3ce06a[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0xf67ac,null))[_0xf461('0x27')](function(_0x2a02ba){if(_0x2a02ba){_0x1319a8=_0x2a02ba;_0x55be73[_0xf461('0x36')]=_['keys'](db[_0xf461('0x6c')][_0xf461('0x32')]);_0x55be73[_0xf461('0x37')]=_[_0xf461('0x38')](_0x3ce06a[_0xf461('0x37')]);_0x55be73[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x55be73[_0xf461('0x36')],_0x55be73[_0xf461('0x37')]);_0x332f60[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x55be73[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x3ce06a['query']['fields']));_0x332f60[_0xf461('0x3b')]=_0x332f60[_0xf461('0x3b')][_0xf461('0x3d')]?_0x332f60[_0xf461('0x3b')]:_0x55be73['model'];_0x332f60['order']=qs[_0xf461('0x42')](_0x3ce06a[_0xf461('0x37')][_0xf461('0x42')]);_0x332f60[_0xf461('0x43')]=qs[_0xf461('0x39')](_[_0xf461('0x44')](_0x3ce06a[_0xf461('0x37')],_0x55be73[_0xf461('0x39')]));_0x332f60[_0xf461('0x43')]=_['merge'](_0x332f60[_0xf461('0x43')],{'$or':[{'ListId':_0x2a02ba['id']},{'ListId':null}]});if(_0x3ce06a['query'][_0xf461('0x47')]){_0x332f60['where']=_['merge'](_0x332f60[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x332f60[_0xf461('0x3b')],function(_0x33e164){var _0x3cbef7={};_0x3cbef7[_0x33e164]={'$like':'%'+_0x3ce06a['query']['filter']+'%'};return _0x3cbef7;})});}_0x332f60=_[_0xf461('0x45')]({},_0x332f60,_0x3ce06a['options']);return db['CmCustomField'][_0xf461('0x8b')](_0x332f60);}})[_0xf461('0x27')](respondWithResult(_0xf67ac,null))[_0xf461('0x4b')](handleError(_0xf67ac,null));};exports[_0xf461('0x8c')]=function(_0x350174,_0x2b3ae3,_0x1c2755){return db[_0xf461('0x31')]['find']({'where':{'id':_0x350174[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x2b3ae3,null))[_0xf461('0x27')](function(_0x3f34e1){if(_0x3f34e1){return _0x3f34e1[_0xf461('0x8c')](_0x350174['body']['ids'],_[_0xf461('0x65')](_0x350174[_0xf461('0x51')],[_0xf461('0x8d'),'id'])||{})['spread'](function(_0x3034bc){for(var _0x172f62=0x0;_0x172f62<_0x350174[_0xf461('0x51')][_0xf461('0x8d')][_0xf461('0x3d')];_0x172f62+=0x1){socket[_0xf461('0x8e')](_0xf461('0x8f'),{'UserId':Number(_0x350174['body']['ids'][_0x172f62]),'CmListId':Number(_0x350174['params']['id'])});}return _0x3034bc;});}})['then'](respondWithResult(_0x2b3ae3,null))[_0xf461('0x4b')](handleError(_0x2b3ae3,null));};exports[_0xf461('0x90')]=function(_0x54987b,_0x5c0c30,_0x4d983c){return db[_0xf461('0x31')]['find']({'where':{'id':_0x54987b[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x5c0c30,null))[_0xf461('0x27')](function(_0x144486){if(_0x144486){return _0x144486['removeAgents'](_0x54987b[_0xf461('0x37')][_0xf461('0x8d')])[_0xf461('0x27')](function(){if(_['isArray'](_0x54987b[_0xf461('0x37')]['ids'])){for(var _0x5ec185=0x0;_0x5ec185<_0x54987b['query'][_0xf461('0x8d')][_0xf461('0x3d')];_0x5ec185+=0x1){socket[_0xf461('0x8e')](_0xf461('0x91'),{'UserId':Number(_0x54987b[_0xf461('0x37')][_0xf461('0x8d')][_0x5ec185]),'CmListId':Number(_0x54987b[_0xf461('0x4d')]['id'])});}}else{socket[_0xf461('0x8e')](_0xf461('0x91'),{'UserId':Number(_0x54987b[_0xf461('0x37')][_0xf461('0x8d')]),'CmListId':Number(_0x54987b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5c0c30,null))[_0xf461('0x4b')](handleError(_0x5c0c30,null));};exports[_0xf461('0x92')]=function(_0x390855,_0x3ebd3d,_0x3b33b8){var _0x5704a6={};var _0x1132a4={};var _0x393cb0;var _0x498e84;return db['CmList'][_0xf461('0x5b')]({'where':{'id':_0x390855[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x3ebd3d,null))[_0xf461('0x27')](function(_0x3e4515){if(_0x3e4515){_0x393cb0=_0x3e4515;_0x1132a4[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x93')][_0xf461('0x32')]);_0x1132a4[_0xf461('0x37')]=_[_0xf461('0x38')](_0x390855[_0xf461('0x37')]);_0x1132a4[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x1132a4['model'],_0x1132a4['query']);_0x5704a6[_0xf461('0x3b')]=_['intersection'](_0x1132a4['model'],qs[_0xf461('0x3c')](_0x390855[_0xf461('0x37')]['fields']));_0x5704a6[_0xf461('0x3b')]=_0x5704a6[_0xf461('0x3b')][_0xf461('0x3d')]?_0x5704a6[_0xf461('0x3b')]:_0x1132a4[_0xf461('0x36')];_0x5704a6[_0xf461('0x41')]=qs[_0xf461('0x42')](_0x390855[_0xf461('0x37')][_0xf461('0x42')]);_0x5704a6[_0xf461('0x43')]=qs[_0xf461('0x39')](_['pick'](_0x390855[_0xf461('0x37')],_0x1132a4[_0xf461('0x39')]));if(_0x390855[_0xf461('0x37')]['filter']){_0x5704a6[_0xf461('0x43')]=_[_0xf461('0x45')](_0x5704a6[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x5704a6['attributes'],function(_0x38c123){var _0x44a25a={};_0x44a25a[_0x38c123]={'$like':'%'+_0x390855[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x44a25a;})});}_0x5704a6=_[_0xf461('0x45')]({},_0x5704a6,_0x390855['options']);return _0x393cb0[_0xf461('0x92')](_0x5704a6);}})[_0xf461('0x27')](function(_0x2ea4b1){if(_0x2ea4b1){_0x498e84=_0x2ea4b1[_0xf461('0x3d')];if(!_0x390855[_0xf461('0x37')][_0xf461('0x3e')]('nolimit')){_0x5704a6[_0xf461('0x40')]=qs['limit'](_0x390855[_0xf461('0x37')][_0xf461('0x40')]);_0x5704a6[_0xf461('0x20')]=qs['offset'](_0x390855['query'][_0xf461('0x20')]);}return _0x393cb0[_0xf461('0x92')](_0x5704a6);}})['then'](function(_0x264820){if(_0x264820){return _0x264820?{'count':_0x498e84,'rows':_0x264820}:null;}})['then'](respondWithResult(_0x3ebd3d,null))[_0xf461('0x4b')](handleError(_0x3ebd3d,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5ad5dd2..61a3e34 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x21f520,_0x5861f4){_0x21f520=_0x21f520-0x0;var _0x56604a=_0x326f[_0x21f520];return _0x56604a;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0x5fc3[_0x4b9978];return _0x42f0e5;};'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 92c34f1..4b85654 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 _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x539222,_0x5956a5){var _0x2515e1=function(_0x2ba0aa){while(--_0x2ba0aa){_0x539222['push'](_0x539222['shift']());}};_0x2515e1(++_0x5956a5);}(_0x3c81,0x102));var _0x13c8=function(_0x11b8c4,_0x555e5b){_0x11b8c4=_0x11b8c4-0x0;var _0x21a02a=_0x3c81[_0x11b8c4];return _0x21a02a;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1390a0,_0x499668){var _0x359f67=function(_0x3daff4){while(--_0x3daff4){_0x1390a0['push'](_0x1390a0['shift']());}};_0x359f67(++_0x499668);}(_0xb903,0x185));var _0x3b90=function(_0x183c05,_0xdef747){_0x183c05=_0x183c05-0x0;var _0x1a9844=_0xb903[_0x183c05];return _0x1a9844;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('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 cdb2eb1..20370a3 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 _0x3eb3=['http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','CmList,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5819a1,_0x20fbad){var _0x337ce8=function(_0x5f353f){while(--_0x5f353f){_0x5819a1['push'](_0x5819a1['shift']());}};_0x337ce8(++_0x20fbad);}(_0x3eb3,0x1ef));var _0x33eb=function(_0x32187a,_0x1fed9b){_0x32187a=_0x32187a-0x0;var _0x4e8393=_0x3eb3[_0x32187a];return _0x4e8393;};'use strict';var _=require(_0x33eb('0x0'));var util=require('util');var moment=require(_0x33eb('0x1'));var BPromise=require(_0x33eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x33eb('0x4'));var logger=require(_0x33eb('0x5'))('rpc');var config=require(_0x33eb('0x6'));var jayson=require(_0x33eb('0x7'));var client=jayson[_0x33eb('0x8')][_0x33eb('0x9')]({'port':0x232a});config[_0x33eb('0xa')]=_[_0x33eb('0xb')](config[_0x33eb('0xa')],{'host':_0x33eb('0xc'),'port':0x18eb});var socket=require(_0x33eb('0xd'))(new Redis(config[_0x33eb('0xa')]));require(_0x33eb('0xe'))[_0x33eb('0xf')](socket);function respondWithRpcPromise(_0x378c42,_0x5e49fc,_0x18a2ac){return new BPromise(function(_0x36aacc,_0x322834){return client['request'](_0x378c42,_0x18a2ac)[_0x33eb('0x10')](function(_0xfdfb96){logger[_0x33eb('0x11')]('CmList,\x20%s,\x20%s',_0x5e49fc,_0x33eb('0x12'));logger['debug'](_0x33eb('0x13'),_0x5e49fc,_0x33eb('0x12'),JSON['stringify'](_0xfdfb96));if(_0xfdfb96[_0x33eb('0x14')]){if(_0xfdfb96[_0x33eb('0x14')]['code']===0x1f4){logger['error'](_0x33eb('0x15'),_0x5e49fc,_0xfdfb96[_0x33eb('0x14')][_0x33eb('0x16')]);return _0x322834(_0xfdfb96[_0x33eb('0x14')][_0x33eb('0x16')]);}logger[_0x33eb('0x14')]('CmList,\x20%s,\x20%s',_0x5e49fc,_0xfdfb96['error'][_0x33eb('0x16')]);return _0x36aacc(_0xfdfb96[_0x33eb('0x14')][_0x33eb('0x16')]);}else{logger[_0x33eb('0x11')](_0x33eb('0x15'),_0x5e49fc,'request\x20sent');_0x36aacc(_0xfdfb96['result']['message']);}})[_0x33eb('0x17')](function(_0x3bc972){logger[_0x33eb('0x14')](_0x33eb('0x15'),_0x5e49fc,_0x3bc972);_0x322834(_0x3bc972);});});} \ No newline at end of file +var _0xc8be=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x300756,_0x1ba019){var _0x55d2c6=function(_0x34d18d){while(--_0x34d18d){_0x300756['push'](_0x300756['shift']());}};_0x55d2c6(++_0x1ba019);}(_0xc8be,0x163));var _0xec8b=function(_0x7b0396,_0x3427eb){_0x7b0396=_0x7b0396-0x0;var _0xdce43b=_0xc8be[_0x7b0396];return _0xdce43b;};'use strict';var _=require(_0xec8b('0x0'));var util=require(_0xec8b('0x1'));var moment=require(_0xec8b('0x2'));var BPromise=require(_0xec8b('0x3'));var rs=require(_0xec8b('0x4'));var fs=require('fs');var Redis=require(_0xec8b('0x5'));var db=require(_0xec8b('0x6'))['db'];var utils=require(_0xec8b('0x7'));var logger=require(_0xec8b('0x8'))('rpc');var config=require(_0xec8b('0x9'));var jayson=require(_0xec8b('0xa'));var client=jayson[_0xec8b('0xb')]['http']({'port':0x232a});config[_0xec8b('0xc')]=_[_0xec8b('0xd')](config[_0xec8b('0xc')],{'host':_0xec8b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec8b('0xc')]));require(_0xec8b('0xf'))[_0xec8b('0x10')](socket);function respondWithRpcPromise(_0x1a5f98,_0x58e3ca,_0x3cab9b){return new BPromise(function(_0x55976f,_0x78359f){return client[_0xec8b('0x11')](_0x1a5f98,_0x3cab9b)['then'](function(_0x30f40e){logger[_0xec8b('0x12')](_0xec8b('0x13'),_0x58e3ca,_0xec8b('0x14'));logger['debug'](_0xec8b('0x15'),_0x58e3ca,_0xec8b('0x14'),JSON[_0xec8b('0x16')](_0x30f40e));if(_0x30f40e[_0xec8b('0x17')]){if(_0x30f40e['error'][_0xec8b('0x18')]===0x1f4){logger[_0xec8b('0x17')]('CmList,\x20%s,\x20%s',_0x58e3ca,_0x30f40e['error'][_0xec8b('0x19')]);return _0x78359f(_0x30f40e[_0xec8b('0x17')][_0xec8b('0x19')]);}logger[_0xec8b('0x17')](_0xec8b('0x13'),_0x58e3ca,_0x30f40e[_0xec8b('0x17')]['message']);return _0x55976f(_0x30f40e[_0xec8b('0x17')][_0xec8b('0x19')]);}else{logger[_0xec8b('0x12')](_0xec8b('0x13'),_0x58e3ca,_0xec8b('0x14'));_0x55976f(_0x30f40e['result']['message']);}})[_0xec8b('0x1a')](function(_0x3e9608){logger[_0xec8b('0x17')](_0xec8b('0x13'),_0x58e3ca,_0x3e9608);_0x78359f(_0x3e9608);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d5ff4da..74624db 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 _0x49fc=['./cmList.events','save','remove','emit','removeListener','register','length','cmList:'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x49fc,0x88));var _0xc49f=function(_0x4b23ca,_0xa667cb){_0x4b23ca=_0x4b23ca-0x0;var _0x69e719=_0x49fc[_0x4b23ca];return _0x69e719;};'use strict';var CmListEvents=require(_0xc49f('0x0'));var events=[_0xc49f('0x1'),_0xc49f('0x2'),'update'];function createListener(_0x2ca9ab,_0x2c4db6){return function(_0x47f8d5){_0x2c4db6[_0xc49f('0x3')](_0x2ca9ab,_0x47f8d5);};}function removeListener(_0x2dba1b,_0x3a5932){return function(){CmListEvents[_0xc49f('0x4')](_0x2dba1b,_0x3a5932);};}exports[_0xc49f('0x5')]=function(_0x31c71e){for(var _0x2a0694=0x0,_0x4455a9=events[_0xc49f('0x6')];_0x2a0694<_0x4455a9;_0x2a0694++){var _0x5890c9=events[_0x2a0694];var _0x59dd4e=createListener(_0xc49f('0x7')+_0x5890c9,_0x31c71e);CmListEvents['on'](_0x5890c9,_0x59dd4e);}}; \ No newline at end of file +var _0x1e38=['register','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x519c67,_0x586a23){var _0xd645ca=function(_0x2ebea9){while(--_0x2ebea9){_0x519c67['push'](_0x519c67['shift']());}};_0xd645ca(++_0x586a23);}(_0x1e38,0x143));var _0x81e3=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x1e38[_0x4a7843];return _0x2c57fe;};'use strict';var CmListEvents=require(_0x81e3('0x0'));var events=[_0x81e3('0x1'),_0x81e3('0x2'),_0x81e3('0x3')];function createListener(_0x1f2358,_0x18d5f8){return function(_0x7d0232){_0x18d5f8[_0x81e3('0x4')](_0x1f2358,_0x7d0232);};}function removeListener(_0x5e2cee,_0x391861){return function(){CmListEvents['removeListener'](_0x5e2cee,_0x391861);};}exports[_0x81e3('0x5')]=function(_0xde6ab7){for(var _0x1c4cbb=0x0,_0x4f4951=events[_0x81e3('0x6')];_0x1c4cbb<_0x4f4951;_0x1c4cbb++){var _0xfbbbcc=events[_0x1c4cbb];var _0x30a16b=createListener(_0x81e3('0x7')+_0xfbbbcc,_0xde6ab7);CmListEvents['on'](_0xfbbbcc,_0x30a16b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e27b6d8..3610fda 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 _0x93e5=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','/:id/fields','addAgents','put','update','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index'];(function(_0x553839,_0xb9e2c2){var _0x389cfa=function(_0x1d3c44){while(--_0x1d3c44){_0x553839['push'](_0x553839['shift']());}};_0x389cfa(++_0xb9e2c2);}(_0x93e5,0x1a1));var _0x593e=function(_0x3ce4f3,_0x235707){_0x3ce4f3=_0x3ce4f3-0x0;var _0x4fdefa=_0x93e5[_0x3ce4f3];return _0x4fdefa;};'use strict';var multer=require('multer');var util=require(_0x593e('0x0'));var path=require(_0x593e('0x1'));var timeout=require(_0x593e('0x2'));var express=require(_0x593e('0x3'));var router=express[_0x593e('0x4')]();var fs_extra=require(_0x593e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x593e('0x6'));var config=require(_0x593e('0x7'));var controller=require(_0x593e('0x8'));router[_0x593e('0x9')]('/',auth[_0x593e('0xa')](),controller[_0x593e('0xb')]);router[_0x593e('0x9')]('/describe',auth[_0x593e('0xa')](),controller['describe']);router[_0x593e('0x9')](_0x593e('0xc'),auth[_0x593e('0xa')](),controller[_0x593e('0xd')]);router[_0x593e('0x9')](_0x593e('0xe'),auth['isAuthenticated'](),controller[_0x593e('0xf')]);router[_0x593e('0x9')](_0x593e('0x10'),auth[_0x593e('0xa')](),controller[_0x593e('0x11')]);router[_0x593e('0x9')](_0x593e('0x12'),auth['isAuthenticated'](),controller[_0x593e('0x13')]);router[_0x593e('0x9')]('/:id/fields',auth[_0x593e('0xa')](),controller['getCustomFields']);router[_0x593e('0x9')](_0x593e('0x14'),auth[_0x593e('0xa')](),controller[_0x593e('0x15')]);router[_0x593e('0x16')]('/',auth[_0x593e('0xa')](),controller[_0x593e('0x17')]);router[_0x593e('0x16')](_0x593e('0xe'),auth[_0x593e('0xa')](),controller[_0x593e('0x18')]);router[_0x593e('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x593e('0x16')](_0x593e('0x19'),auth[_0x593e('0xa')](),controller['addCustomField']);router[_0x593e('0x16')](_0x593e('0x14'),auth[_0x593e('0xa')](),controller[_0x593e('0x1a')]);router[_0x593e('0x1b')]('/:id',auth[_0x593e('0xa')](),controller[_0x593e('0x1c')]);router['delete'](_0x593e('0xc'),auth[_0x593e('0xa')](),controller[_0x593e('0x1d')]);router['delete'](_0x593e('0xe'),auth['isAuthenticated'](),controller[_0x593e('0x1e')]);router['delete'](_0x593e('0x14'),auth[_0x593e('0xa')](),controller[_0x593e('0x1f')]);module[_0x593e('0x20')]=router; \ No newline at end of file +var _0x9385=['put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','/:id/contacts','addCustomField','addAgents'];(function(_0x54514c,_0xf1c84a){var _0x5cd80e=function(_0x186444){while(--_0x186444){_0x54514c['push'](_0x54514c['shift']());}};_0x5cd80e(++_0xf1c84a);}(_0x9385,0x170));var _0x5938=function(_0x2ca4d1,_0x148124){_0x2ca4d1=_0x2ca4d1-0x0;var _0x45589a=_0x9385[_0x2ca4d1];return _0x45589a;};'use strict';var multer=require(_0x5938('0x0'));var util=require(_0x5938('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5938('0x2')]();var fs_extra=require(_0x5938('0x3'));var auth=require(_0x5938('0x4'));var interaction=require(_0x5938('0x5'));var config=require(_0x5938('0x6'));var controller=require(_0x5938('0x7'));router[_0x5938('0x8')]('/',auth[_0x5938('0x9')](),controller['index']);router[_0x5938('0x8')]('/describe',auth[_0x5938('0x9')](),controller[_0x5938('0xa')]);router['get'](_0x5938('0xb'),auth[_0x5938('0x9')](),controller[_0x5938('0xc')]);router[_0x5938('0x8')](_0x5938('0xd'),auth[_0x5938('0x9')](),controller['getDispositions']);router['get']('/:id/contacts',auth[_0x5938('0x9')](),controller[_0x5938('0xe')]);router[_0x5938('0x8')](_0x5938('0xf'),auth['isAuthenticated'](),controller[_0x5938('0x10')]);router[_0x5938('0x8')]('/:id/fields',auth[_0x5938('0x9')](),controller['getCustomFields']);router[_0x5938('0x8')](_0x5938('0x11'),auth[_0x5938('0x9')](),controller[_0x5938('0x12')]);router[_0x5938('0x13')]('/',auth[_0x5938('0x9')](),controller[_0x5938('0x14')]);router[_0x5938('0x13')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x5938('0x13')](_0x5938('0x15'),auth[_0x5938('0x9')](),controller['addContacts']);router[_0x5938('0x13')]('/:id/fields',auth[_0x5938('0x9')](),controller[_0x5938('0x16')]);router['post'](_0x5938('0x11'),auth[_0x5938('0x9')](),controller[_0x5938('0x17')]);router[_0x5938('0x18')](_0x5938('0xb'),auth[_0x5938('0x9')](),controller['update']);router[_0x5938('0x19')](_0x5938('0xb'),auth[_0x5938('0x9')](),controller[_0x5938('0x1a')]);router[_0x5938('0x19')]('/:id/dispositions',auth[_0x5938('0x9')](),controller['removeDispositions']);router[_0x5938('0x19')]('/:id/users',auth[_0x5938('0x9')](),controller['removeAgents']);module[_0x5938('0x1b')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 7964fbb..73f3b1c 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 _0x7028=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x7028,0x139));var _0x8702=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x7028[_0x1aba25];return _0x47d997;};'use strict';var Sequelize=require(_0x8702('0x0'));module['exports']={'name':{'type':Sequelize[_0x8702('0x1')],'get':function(_0x4d776d){return this[_0x8702('0x2')](_0x8702('0x3'));}},'field':{'type':Sequelize[_0x8702('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x8702('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x8702('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xc62a=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x84dbc9,_0x804160){var _0x365eea=function(_0x5c11c6){while(--_0x5c11c6){_0x84dbc9['push'](_0x84dbc9['shift']());}};_0x365eea(++_0x804160);}(_0xc62a,0x111));var _0xac62=function(_0x217b74,_0x25cb41){_0x217b74=_0x217b74-0x0;var _0x3a4234=_0xc62a[_0x217b74];return _0x3a4234;};'use strict';var Sequelize=require(_0xac62('0x0'));module['exports']={'name':{'type':Sequelize[_0xac62('0x1')],'get':function(_0x41ff8a){return this[_0xac62('0x2')](_0xac62('0x3'));}},'field':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 51ccb83..ccbac59 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x40ccbc,_0xba3858){var _0x1c1f49=function(_0x2fc100){while(--_0x2fc100){_0x40ccbc['push'](_0x40ccbc['shift']());}};_0x1c1f49(++_0xba3858);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x42a7f5,_0x1628ec){var _0x3d541a=function(_0xba390c){while(--_0xba390c){_0x42a7f5['push'](_0x42a7f5['shift']());}};_0x3d541a(++_0x1628ec);}(_0x7a54,0x106));var _0x47a5=function(_0x4651cb,_0x3873d3){_0x4651cb=_0x4651cb-0x0;var _0x461af1=_0x7a54[_0x4651cb];return _0x461af1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 0f12ec6..46ef912 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 _0x0f51=['define','Condition','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports'];(function(_0x22889a,_0x4b75f7){var _0x763d34=function(_0x2040e5){while(--_0x2040e5){_0x22889a['push'](_0x22889a['shift']());}};_0x763d34(++_0x4b75f7);}(_0x0f51,0xb8));var _0x10f5=function(_0x3779eb,_0xc19002){_0x3779eb=_0x3779eb-0x0;var _0x50423a=_0x0f51[_0x3779eb];return _0x50423a;};'use strict';var _=require(_0x10f5('0x0'));var util=require(_0x10f5('0x1'));var logger=require(_0x10f5('0x2'))(_0x10f5('0x3'));var moment=require(_0x10f5('0x4'));var BPromise=require(_0x10f5('0x5'));var rp=require(_0x10f5('0x6'));var fs=require('fs');var path=require(_0x10f5('0x7'));var rimraf=require('rimraf');var config=require(_0x10f5('0x8'));var attributes=require(_0x10f5('0x9'));module[_0x10f5('0xa')]=function(_0x23e3ac,_0x402e9d){return _0x23e3ac[_0x10f5('0xb')](_0x10f5('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0ae=['tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x2e93d0,_0x5d6526){var _0x2a88a6=function(_0x9bcb0f){while(--_0x9bcb0f){_0x2e93d0['push'](_0x2e93d0['shift']());}};_0x2a88a6(++_0x5d6526);}(_0xf0ae,0x12c));var _0xef0a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xf0ae[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xef0a('0x0'));var util=require(_0xef0a('0x1'));var logger=require(_0xef0a('0x2'))(_0xef0a('0x3'));var moment=require('moment');var BPromise=require(_0xef0a('0x4'));var rp=require(_0xef0a('0x5'));var fs=require('fs');var path=require(_0xef0a('0x6'));var rimraf=require('rimraf');var config=require(_0xef0a('0x7'));var attributes=require(_0xef0a('0x8'));module[_0xef0a('0x9')]=function(_0xb4157d,_0x4afc22){return _0xb4157d[_0xef0a('0xa')](_0xef0a('0xb'),attributes,{'tableName':_0xef0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 86b5313..f2a65a7 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 _0xd5e8=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch'];(function(_0x12a6fd,_0x515833){var _0x5de6d8=function(_0x4d8145){while(--_0x4d8145){_0x12a6fd['push'](_0x12a6fd['shift']());}};_0x5de6d8(++_0x515833);}(_0xd5e8,0xa8));var _0x8d5e=function(_0x1b8e96,_0x308b1f){_0x1b8e96=_0x1b8e96-0x0;var _0x4b32c5=_0xd5e8[_0x1b8e96];return _0x4b32c5;};'use strict';var _=require(_0x8d5e('0x0'));var util=require(_0x8d5e('0x1'));var moment=require(_0x8d5e('0x2'));var BPromise=require(_0x8d5e('0x3'));var rs=require(_0x8d5e('0x4'));var fs=require('fs');var Redis=require(_0x8d5e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d5e('0x6'));var logger=require('../../config/logger')(_0x8d5e('0x7'));var config=require(_0x8d5e('0x8'));var jayson=require(_0x8d5e('0x9'));var client=jayson[_0x8d5e('0xa')][_0x8d5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2691f5,_0x47f137,_0x8fc393){return new BPromise(function(_0x4136d9,_0x392b66){return client[_0x8d5e('0xc')](_0x2691f5,_0x8fc393)[_0x8d5e('0xd')](function(_0x46000e){logger[_0x8d5e('0xe')]('Condition,\x20%s,\x20%s',_0x47f137,'request\x20sent');logger['debug'](_0x8d5e('0xf'),_0x47f137,_0x8d5e('0x10'),JSON[_0x8d5e('0x11')](_0x46000e));if(_0x46000e[_0x8d5e('0x12')]){if(_0x46000e[_0x8d5e('0x12')][_0x8d5e('0x13')]===0x1f4){logger[_0x8d5e('0x12')](_0x8d5e('0x14'),_0x47f137,_0x46000e[_0x8d5e('0x12')]['message']);return _0x392b66(_0x46000e['error'][_0x8d5e('0x15')]);}logger[_0x8d5e('0x12')](_0x8d5e('0x14'),_0x47f137,_0x46000e['error']['message']);return _0x4136d9(_0x46000e[_0x8d5e('0x12')][_0x8d5e('0x15')]);}else{logger[_0x8d5e('0xe')](_0x8d5e('0x14'),_0x47f137,'request\x20sent');_0x4136d9(_0x46000e[_0x8d5e('0x16')]['message']);}})[_0x8d5e('0x17')](function(_0x3e697a){logger[_0x8d5e('0x12')](_0x8d5e('0x14'),_0x47f137,_0x3e697a);_0x392b66(_0x3e697a);});});} \ No newline at end of file +var _0x633c=['info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x195a3b,_0x6e9cf1){var _0x3b915f=function(_0x89f215){while(--_0x89f215){_0x195a3b['push'](_0x195a3b['shift']());}};_0x3b915f(++_0x6e9cf1);}(_0x633c,0x16a));var _0xc633=function(_0x98d8c6,_0x477c92){_0x98d8c6=_0x98d8c6-0x0;var _0x296459=_0x633c[_0x98d8c6];return _0x296459;};'use strict';var _=require(_0xc633('0x0'));var util=require(_0xc633('0x1'));var moment=require(_0xc633('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc633('0x3'));var db=require(_0xc633('0x4'))['db'];var utils=require(_0xc633('0x5'));var logger=require(_0xc633('0x6'))(_0xc633('0x7'));var config=require(_0xc633('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc633('0x9')][_0xc633('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfcd71b,_0x466e12,_0x462ade){return new BPromise(function(_0x45cf66,_0x5007f5){return client['request'](_0xfcd71b,_0x462ade)[_0xc633('0xb')](function(_0x48bce0){logger[_0xc633('0xc')]('Condition,\x20%s,\x20%s',_0x466e12,_0xc633('0xd'));logger[_0xc633('0xe')](_0xc633('0xf'),_0x466e12,_0xc633('0xd'),JSON[_0xc633('0x10')](_0x48bce0));if(_0x48bce0[_0xc633('0x11')]){if(_0x48bce0[_0xc633('0x11')][_0xc633('0x12')]===0x1f4){logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x48bce0[_0xc633('0x11')][_0xc633('0x14')]);return _0x5007f5(_0x48bce0[_0xc633('0x11')][_0xc633('0x14')]);}logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x48bce0['error'][_0xc633('0x14')]);return _0x45cf66(_0x48bce0['error'][_0xc633('0x14')]);}else{logger[_0xc633('0xc')]('Condition,\x20%s,\x20%s',_0x466e12,_0xc633('0xd'));_0x45cf66(_0x48bce0[_0xc633('0x15')][_0xc633('0x14')]);}})['catch'](function(_0x28ed1f){logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x28ed1f);_0x5007f5(_0x28ed1f);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 0122634..5ab66f4 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 _0x64fe=['./condition.controller','put','/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19aee2,_0x351a12){var _0x4b48a9=function(_0x509151){while(--_0x509151){_0x19aee2['push'](_0x19aee2['shift']());}};_0x4b48a9(++_0x351a12);}(_0x64fe,0x1d7));var _0xe64f=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x64fe[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0xe64f('0x0'));var util=require('util');var path=require(_0xe64f('0x1'));var timeout=require(_0xe64f('0x2'));var express=require(_0xe64f('0x3'));var router=express[_0xe64f('0x4')]();var fs_extra=require(_0xe64f('0x5'));var auth=require(_0xe64f('0x6'));var interaction=require(_0xe64f('0x7'));var config=require(_0xe64f('0x8'));var controller=require(_0xe64f('0x9'));router[_0xe64f('0xa')](_0xe64f('0xb'),auth[_0xe64f('0xc')](),controller[_0xe64f('0xd')]);router[_0xe64f('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe64f('0xf')]=router; \ No newline at end of file +var _0xa451=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','destroy'];(function(_0x59accf,_0x1d4650){var _0x47ade1=function(_0x2e1f94){while(--_0x2e1f94){_0x59accf['push'](_0x59accf['shift']());}};_0x47ade1(++_0x1d4650);}(_0xa451,0x187));var _0x1a45=function(_0x37f606,_0x4a4861){_0x37f606=_0x37f606-0x0;var _0x56452d=_0xa451[_0x37f606];return _0x56452d;};'use strict';var multer=require('multer');var util=require(_0x1a45('0x0'));var path=require(_0x1a45('0x1'));var timeout=require(_0x1a45('0x2'));var express=require(_0x1a45('0x3'));var router=express['Router']();var fs_extra=require(_0x1a45('0x4'));var auth=require(_0x1a45('0x5'));var interaction=require(_0x1a45('0x6'));var config=require(_0x1a45('0x7'));var controller=require('./condition.controller');router[_0x1a45('0x8')]('/:id',auth[_0x1a45('0x9')](),controller[_0x1a45('0xa')]);router[_0x1a45('0xb')](_0x1a45('0xc'),auth[_0x1a45('0x9')](),controller[_0x1a45('0xd')]);module[_0x1a45('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 8549c32..1aee783 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 _0xb7e7=['STRING','sequelize'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x2094e5,_0x236265){var _0x21af38=function(_0x5a3751){while(--_0x5a3751){_0x2094e5['push'](_0x2094e5['shift']());}};_0x21af38(++_0x236265);}(_0x757a,0xde));var _0xa757=function(_0x582e42,_0x33e9ae){_0x582e42=_0x582e42-0x0;var _0x1e22b0=_0x757a[_0x582e42];return _0x1e22b0;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index accaf2b..270edf4 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 _0x48ef=['error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Dashboard','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','params','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','order','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x48ef,0xcd));var _0xf48e=function(_0x32b894,_0x14c458){_0x32b894=_0x32b894-0x0;var _0x1f4d76=_0x48ef[_0x32b894];return _0x1f4d76;};'use strict';var emlformat=require(_0xf48e('0x0'));var rimraf=require(_0xf48e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf48e('0x2'));var rp=require('request-promise');var moment=require(_0xf48e('0x3'));var BPromise=require(_0xf48e('0x4'));var Mustache=require(_0xf48e('0x5'));var util=require(_0xf48e('0x6'));var path=require(_0xf48e('0x7'));var sox=require(_0xf48e('0x8'));var csv=require(_0xf48e('0x9'));var ejs=require(_0xf48e('0xa'));var fs=require('fs');var fs_extra=require(_0xf48e('0xb'));var _=require(_0xf48e('0xc'));var squel=require(_0xf48e('0xd'));var crypto=require(_0xf48e('0xe'));var jsforce=require(_0xf48e('0xf'));var deskjs=require(_0xf48e('0x10'));var toCsv=require(_0xf48e('0x9'));var querystring=require('querystring');var Papa=require(_0xf48e('0x11'));var Redis=require(_0xf48e('0x12'));var authService=require(_0xf48e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf48e('0x14'));var hardwareService=require(_0xf48e('0x15'));var logger=require(_0xf48e('0x16'))('api');var utils=require(_0xf48e('0x17'));var config=require(_0xf48e('0x18'));var licenseUtil=require(_0xf48e('0x19'));var db=require('../../mysqldb')['db'];config[_0xf48e('0x1a')]=_[_0xf48e('0x1b')](config[_0xf48e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf48e('0x1c'))(new Redis(config[_0xf48e('0x1a')]));require('./dashboard.socket')[_0xf48e('0x1d')](socket);function respondWithStatusCode(_0x35ee6a,_0xf8f77e){_0xf8f77e=_0xf8f77e||0xcc;return function(_0x6fdb20){if(_0x6fdb20){return _0x35ee6a['sendStatus'](_0xf8f77e);}return _0x35ee6a[_0xf48e('0x1e')](_0xf8f77e)[_0xf48e('0x1f')]();};}function respondWithResult(_0x30c36c,_0x46604c){_0x46604c=_0x46604c||0xc8;return function(_0x5c3adc){if(_0x5c3adc){return _0x30c36c[_0xf48e('0x1e')](_0x46604c)[_0xf48e('0x20')](_0x5c3adc);}};}function respondWithFilteredResult(_0x3f7435,_0x45fa17){return function(_0x5de5ea){if(_0x5de5ea){var _0x5b4f8e=typeof _0x45fa17[_0xf48e('0x21')]===_0xf48e('0x22')&&typeof _0x45fa17['limit']===_0xf48e('0x22');var _0x3230b1=_0x5de5ea['count'];var _0x48bdf1=_0x5b4f8e?0x0:_0x45fa17[_0xf48e('0x21')];var _0x4d73bf=_0x5b4f8e?_0x5de5ea[_0xf48e('0x23')]:_0x45fa17[_0xf48e('0x21')]+_0x45fa17[_0xf48e('0x24')];var _0x42cf7d;if(_0x4d73bf>=_0x3230b1){_0x4d73bf=_0x3230b1;_0x42cf7d=0xc8;}else{_0x42cf7d=0xce;}_0x3f7435['status'](_0x42cf7d);return _0x3f7435[_0xf48e('0x25')](_0xf48e('0x26'),_0x48bdf1+'-'+_0x4d73bf+'/'+_0x3230b1)[_0xf48e('0x20')](_0x5de5ea);}return null;};}function patchUpdates(_0xf9155a){return function(_0x4d640b){try{jsonpatch[_0xf48e('0x27')](_0x4d640b,_0xf9155a,!![]);}catch(_0x3d38b2){return BPromise[_0xf48e('0x28')](_0x3d38b2);}return _0x4d640b[_0xf48e('0x29')]();};}function saveUpdates(_0x4bf768,_0x8aa604){return function(_0x499f34){if(_0x499f34){return _0x499f34[_0xf48e('0x2a')](_0x4bf768)[_0xf48e('0x2b')](function(_0x2751d9){return _0x2751d9;});}return null;};}function removeEntity(_0x32d207,_0x3f73e2){return function(_0x3a3edd){if(_0x3a3edd){return _0x3a3edd[_0xf48e('0x2c')]()[_0xf48e('0x2b')](function(){var _0x371109=_0x3a3edd[_0xf48e('0x2d')]({'plain':!![]});var _0x1b8dc7=_0xf48e('0x2e');return db[_0xf48e('0x2f')][_0xf48e('0x2c')]({'where':{'type':_0x1b8dc7,'resourceId':_0x371109['id']}})[_0xf48e('0x2b')](function(){return _0x3a3edd;});})['then'](function(){_0x32d207[_0xf48e('0x1e')](0xcc)[_0xf48e('0x1f')]();});}};}function handleEntityNotFound(_0x4c911f,_0x118a95){return function(_0x3121ef){if(!_0x3121ef){_0x4c911f[_0xf48e('0x30')](0x194);}return _0x3121ef;};}function handleError(_0x69c838,_0x2172e3){_0x2172e3=_0x2172e3||0x1f4;return function(_0x3ef617){logger[_0xf48e('0x31')](_0x3ef617[_0xf48e('0x32')]);if(_0x3ef617['name']){delete _0x3ef617[_0xf48e('0x33')];}_0x69c838[_0xf48e('0x1e')](_0x2172e3)['send'](_0x3ef617);};}exports[_0xf48e('0x34')]=function(_0x21722a,_0x3cc6f4){var _0x22eddf={},_0xeecedf={},_0x58b4ec={'count':0x0,'rows':[]};var _0x1ae3b7=_[_0xf48e('0x35')](db['Dashboard'][_0xf48e('0x36')],function(_0x2b3501){return{'name':_0x2b3501[_0xf48e('0x37')],'type':_0x2b3501[_0xf48e('0x38')][_0xf48e('0x39')]};});_0xeecedf[_0xf48e('0x3a')]=_[_0xf48e('0x35')](_0x1ae3b7,_0xf48e('0x33'));_0xeecedf[_0xf48e('0x3b')]=_[_0xf48e('0x3c')](_0x21722a['query']);_0xeecedf[_0xf48e('0x3d')]=_[_0xf48e('0x3e')](_0xeecedf[_0xf48e('0x3a')],_0xeecedf[_0xf48e('0x3b')]);_0x22eddf['attributes']=_['intersection'](_0xeecedf[_0xf48e('0x3a')],qs[_0xf48e('0x3f')](_0x21722a[_0xf48e('0x3b')][_0xf48e('0x3f')]));_0x22eddf[_0xf48e('0x40')]=_0x22eddf[_0xf48e('0x40')][_0xf48e('0x41')]?_0x22eddf[_0xf48e('0x40')]:_0xeecedf[_0xf48e('0x3a')];if(!_0x21722a[_0xf48e('0x3b')][_0xf48e('0x42')](_0xf48e('0x43'))){_0x22eddf['limit']=qs['limit'](_0x21722a[_0xf48e('0x3b')][_0xf48e('0x24')]);_0x22eddf['offset']=qs[_0xf48e('0x21')](_0x21722a['query']['offset']);}_0x22eddf['order']=qs[_0xf48e('0x44')](_0x21722a[_0xf48e('0x3b')][_0xf48e('0x44')]);_0x22eddf[_0xf48e('0x45')]=qs[_0xf48e('0x3d')](_[_0xf48e('0x46')](_0x21722a[_0xf48e('0x3b')],_0xeecedf[_0xf48e('0x3d')]),_0x1ae3b7);if(_0x21722a['query']['filter']){_0x22eddf[_0xf48e('0x45')]=_['merge'](_0x22eddf[_0xf48e('0x45')],{'$or':_[_0xf48e('0x35')](_0x1ae3b7,function(_0x49d011){if(_0x49d011['type']!=='VIRTUAL'){var _0x26e532={};_0x26e532[_0x49d011[_0xf48e('0x33')]]={'$like':'%'+_0x21722a[_0xf48e('0x3b')][_0xf48e('0x47')]+'%'};return _0x26e532;}})});}_0x22eddf=_[_0xf48e('0x48')]({},_0x22eddf,_0x21722a[_0xf48e('0x49')]);var _0x568765={'where':_0x22eddf[_0xf48e('0x45')]};return db[_0xf48e('0x4a')][_0xf48e('0x23')](_0x568765)[_0xf48e('0x2b')](function(_0x510722){_0x58b4ec['count']=_0x510722;if(_0x21722a[_0xf48e('0x3b')][_0xf48e('0x4b')]){_0x22eddf[_0xf48e('0x4c')]=[{'all':!![]}];}return db[_0xf48e('0x4a')][_0xf48e('0x4d')](_0x22eddf);})['then'](function(_0x2551a2){_0x58b4ec[_0xf48e('0x4e')]=_0x2551a2;return _0x58b4ec;})[_0xf48e('0x2b')](respondWithFilteredResult(_0x3cc6f4,_0x22eddf))[_0xf48e('0x4f')](handleError(_0x3cc6f4,null));};exports['show']=function(_0x4bd0f6,_0x4c22db){var _0x2ee8ff={'raw':![],'where':{'id':_0x4bd0f6['params']['id']}},_0x200108={};_0x200108[_0xf48e('0x3a')]=_[_0xf48e('0x3c')](db[_0xf48e('0x4a')]['rawAttributes']);_0x200108['query']=_[_0xf48e('0x3c')](_0x4bd0f6[_0xf48e('0x3b')]);_0x200108[_0xf48e('0x3d')]=_[_0xf48e('0x3e')](_0x200108[_0xf48e('0x3a')],_0x200108[_0xf48e('0x3b')]);_0x2ee8ff[_0xf48e('0x40')]=_['intersection'](_0x200108[_0xf48e('0x3a')],qs[_0xf48e('0x3f')](_0x4bd0f6[_0xf48e('0x3b')][_0xf48e('0x3f')]));_0x2ee8ff[_0xf48e('0x40')]=_0x2ee8ff[_0xf48e('0x40')][_0xf48e('0x41')]?_0x2ee8ff['attributes']:_0x200108[_0xf48e('0x3a')];if(_0x4bd0f6[_0xf48e('0x3b')]['includeAll']){_0x2ee8ff[_0xf48e('0x4c')]=[{'all':!![]}];}_0x2ee8ff=_[_0xf48e('0x48')]({},_0x2ee8ff,_0x4bd0f6['options']);return db['Dashboard'][_0xf48e('0x50')](_0x2ee8ff)['then'](handleEntityNotFound(_0x4c22db,null))[_0xf48e('0x2b')](respondWithResult(_0x4c22db,null))[_0xf48e('0x4f')](handleError(_0x4c22db,null));};exports['create']=function(_0x2a1e7a,_0x282815){return db[_0xf48e('0x4a')][_0xf48e('0x51')](_0x2a1e7a[_0xf48e('0x52')],{})[_0xf48e('0x2b')](function(_0x3aa8bc){var _0x3e3c97=_0x2a1e7a['user'][_0xf48e('0x2d')]({'plain':!![]});if(!_0x3e3c97)throw new Error(_0xf48e('0x53'));if(_0x3e3c97[_0xf48e('0x54')]==='user'){var _0x2eafb7=_0x3aa8bc['get']({'plain':!![]});var _0x3b25d2=_0xf48e('0x2e');return db[_0xf48e('0x55')][_0xf48e('0x50')]({'where':{'name':_0x3b25d2,'userProfileId':_0x3e3c97[_0xf48e('0x56')]},'raw':!![]})[_0xf48e('0x2b')](function(_0x46ceab){if(_0x46ceab&&_0x46ceab[_0xf48e('0x57')]===0x0){return db[_0xf48e('0x2f')][_0xf48e('0x51')]({'name':_0x2eafb7[_0xf48e('0x33')],'resourceId':_0x2eafb7['id'],'type':_0x46ceab[_0xf48e('0x33')],'sectionId':_0x46ceab['id']},{})[_0xf48e('0x2b')](function(){return _0x3aa8bc;});}else{return _0x3aa8bc;}})['catch'](function(_0x5bcced){logger[_0xf48e('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bcced);throw _0x5bcced;});}return _0x3aa8bc;})['then'](respondWithResult(_0x282815,0xc9))['catch'](handleError(_0x282815,null));};exports[_0xf48e('0x58')]=function(_0x379603,_0x461714){var _0x30263b={'where':{'id':_0x379603[_0xf48e('0x59')]['id']}},_0x4526e5={};_0x4526e5[_0xf48e('0x3a')]=_[_0xf48e('0x3c')](db[_0xf48e('0x4a')][_0xf48e('0x36')]);_0x30263b[_0xf48e('0x40')]=_[_0xf48e('0x3e')](_0x4526e5['model'],qs[_0xf48e('0x3f')](_0x379603[_0xf48e('0x3b')][_0xf48e('0x3f')]));_0x30263b[_0xf48e('0x40')]=_0x30263b[_0xf48e('0x40')][_0xf48e('0x41')]?_0x30263b['attributes']:_0x4526e5[_0xf48e('0x3a')];if(_0x379603[_0xf48e('0x3b')][_0xf48e('0x4b')]){_0x30263b[_0xf48e('0x4c')]=[{'all':!![]}];}_0x30263b=_['merge']({},_0x30263b,_0x379603[_0xf48e('0x49')]);return db['Dashboard']['find'](_0x30263b)[_0xf48e('0x2b')](handleEntityNotFound(_0x461714,null))[_0xf48e('0x2b')](function(_0x28bfce){if(_0x28bfce){var _0x332229=_0x28bfce[_0xf48e('0x2d')]({'plain':!![]});_0x332229=qs[_0xf48e('0x5a')](_0x332229,['id',_0xf48e('0x5b'),_0xf48e('0x5c')]);_0x379603[_0xf48e('0x52')]=_[_0xf48e('0x5a')](_0x379603[_0xf48e('0x52')],['id',_0xf48e('0x5b'),'updatedAt']);return db['Dashboard']['create'](_[_0xf48e('0x48')](_0x332229,_0x379603[_0xf48e('0x52')]),{'include':_0x379603[_0xf48e('0x3b')][_0xf48e('0x4b')]?[{'all':!![]}]:undefined})[_0xf48e('0x2b')](function(_0x580c69){var _0x2b3161=_0x379603[_0xf48e('0x5d')][_0xf48e('0x2d')]({'plain':!![]});if(!_0x2b3161)throw new Error(_0xf48e('0x53'));if(_0x2b3161[_0xf48e('0x54')]==='user'){var _0x5d731b=_0x580c69[_0xf48e('0x2d')]({'plain':!![]});var _0x534d64=_0xf48e('0x2e');return db[_0xf48e('0x55')][_0xf48e('0x50')]({'where':{'name':_0x534d64,'userProfileId':_0x2b3161[_0xf48e('0x56')]},'raw':!![]})[_0xf48e('0x2b')](function(_0x363bc1){if(_0x363bc1&&_0x363bc1[_0xf48e('0x57')]===0x0){return db[_0xf48e('0x2f')]['create']({'name':_0x5d731b[_0xf48e('0x33')],'resourceId':_0x5d731b['id'],'type':_0x363bc1[_0xf48e('0x33')],'sectionId':_0x363bc1['id']},{})[_0xf48e('0x2b')](function(){return _0x580c69;});}else{return _0x580c69;}})[_0xf48e('0x4f')](function(_0x112d76){logger[_0xf48e('0x31')](_0xf48e('0x5e'),_0x112d76);throw _0x112d76;});}return _0x580c69;});}})['then'](respondWithResult(_0x461714,0xc9))[_0xf48e('0x4f')](handleError(_0x461714,null));};exports[_0xf48e('0x2a')]=function(_0x4f4500,_0x54a3c0){if(_0x4f4500['body']['id']){delete _0x4f4500[_0xf48e('0x52')]['id'];}return db[_0xf48e('0x4a')][_0xf48e('0x50')]({'where':{'id':_0x4f4500[_0xf48e('0x59')]['id']}})[_0xf48e('0x2b')](handleEntityNotFound(_0x54a3c0,null))[_0xf48e('0x2b')](saveUpdates(_0x4f4500[_0xf48e('0x52')],null))[_0xf48e('0x2b')](respondWithResult(_0x54a3c0,null))[_0xf48e('0x4f')](handleError(_0x54a3c0,null));};exports['destroy']=function(_0x1b2901,_0x362052){return db[_0xf48e('0x4a')][_0xf48e('0x50')]({'where':{'id':_0x1b2901['params']['id']}})[_0xf48e('0x2b')](handleEntityNotFound(_0x362052,null))[_0xf48e('0x2b')](removeEntity(_0x362052,null))[_0xf48e('0x4f')](handleError(_0x362052,null));};function widgetAttributes(_0x4622d2){try{switch(_0x4622d2['type']){case'iframe':return[{'name':_0xf48e('0x5f'),'value':_0x4622d2[_0xf48e('0x5f')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2[_0xf48e('0x60')][0x0][_0xf48e('0x61')]:undefined)||_0xf48e('0x62')}];case _0xf48e('0x63'):return[{'name':_0xf48e('0x64'),'value':_0x4622d2[_0xf48e('0x64')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2['attrs'][0x0]?_0x4622d2[_0xf48e('0x60')][0x0]['value']:undefined)||''}];case _0xf48e('0x65'):return[{'name':_0xf48e('0x66'),'value':_0x4622d2['attrHourFormat']||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2[_0xf48e('0x60')][0x0][_0xf48e('0x61')]:undefined)||_0xf48e('0x67')},{'name':_0xf48e('0x68'),'value':_0x4622d2[_0xf48e('0x68')]||(_0x4622d2['attrs']&&_0x4622d2[_0xf48e('0x60')][0x1]?_0x4622d2['attrs'][0x1][_0xf48e('0x61')]:undefined)||_0xf48e('0x69')},{'name':'attrFontSize','value':_0x4622d2[_0xf48e('0x6a')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x2]?_0x4622d2[_0xf48e('0x60')][0x2]['value']:undefined)||0xc}];case _0xf48e('0x6b'):return[{'name':'attrMetric','value':_0x4622d2[_0xf48e('0x6c')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2[_0xf48e('0x60')][0x0][_0xf48e('0x61')]:undefined)||_0xf48e('0x6d')},{'name':_0xf48e('0x6e'),'value':_0x4622d2[_0xf48e('0x6e')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x1]?_0x4622d2[_0xf48e('0x60')][0x1][_0xf48e('0x61')]:undefined)||[]},{'name':_0xf48e('0x6a'),'value':_0x4622d2[_0xf48e('0x6a')]||(_0x4622d2['attrs']&&_0x4622d2['attrs'][0x2]?_0x4622d2[_0xf48e('0x60')][0x2][_0xf48e('0x61')]:undefined)||0x14}];case _0xf48e('0x6f'):case _0xf48e('0x70'):return[{'name':_0xf48e('0x71'),'value':_0x4622d2[_0xf48e('0x71')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2[_0xf48e('0x60')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x4622d2[_0xf48e('0x72')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x1]?_0x4622d2[_0xf48e('0x60')][0x1]['value']:undefined)||null},{'name':_0xf48e('0x73'),'value':_0x4622d2[_0xf48e('0x73')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x2]?_0x4622d2[_0xf48e('0x60')][0x2]['value']:undefined)||null},{'name':_0xf48e('0x6e'),'value':_0x4622d2[_0xf48e('0x6e')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x3]?_0x4622d2[_0xf48e('0x60')][0x3][_0xf48e('0x61')]:undefined)||[]}];case'web-report':return[{'name':_0xf48e('0x74'),'type':_0x4622d2[_0xf48e('0x75')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2['attrs'][0x0][_0xf48e('0x38')]:undefined)||null,'value':_0x4622d2[_0xf48e('0x74')]||(_0x4622d2[_0xf48e('0x60')]&&_0x4622d2[_0xf48e('0x60')][0x0]?_0x4622d2['attrs'][0x0][_0xf48e('0x61')]:undefined)||null},{'name':_0xf48e('0x76'),'value':_0x4622d2[_0xf48e('0x76')]||(_0x4622d2['attrs']&&_0x4622d2[_0xf48e('0x60')][0x1]?_0x4622d2[_0xf48e('0x60')][0x1][_0xf48e('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x151b92){logger['error'](_0xf48e('0x77'),JSON[_0xf48e('0x78')](_0x151b92));return[];}}exports[_0xf48e('0x79')]=function(_0x23cfa2,_0x1dd036,_0x443352){if(_0x23cfa2[_0xf48e('0x52')]['id']){delete _0x23cfa2[_0xf48e('0x52')]['id'];}return db[_0xf48e('0x4a')][_0xf48e('0x50')]({'where':{'id':_0x23cfa2['params']['id']}})[_0xf48e('0x2b')](handleEntityNotFound(_0x1dd036,null))['then'](function(_0x1750d1){if(_0x1750d1){_0x23cfa2[_0xf48e('0x52')][_0xf48e('0x7a')]=_0x1750d1['id'];_0x23cfa2[_0xf48e('0x52')][_0xf48e('0x60')]=widgetAttributes(_0x23cfa2['body']);return db['DashboardItem'][_0xf48e('0x51')](_0x23cfa2[_0xf48e('0x52')]);}})[_0xf48e('0x2b')](respondWithResult(_0x1dd036,null))[_0xf48e('0x4f')](handleError(_0x1dd036,null));};exports[_0xf48e('0x7b')]=function(_0x224c7e,_0x4d5618,_0x278db3){var _0x2e8d5e={};var _0x244e86={};var _0x400ce1;var _0x59e6a0;return db[_0xf48e('0x4a')][_0xf48e('0x7c')]({'where':{'id':_0x224c7e['params']['id']}})[_0xf48e('0x2b')](handleEntityNotFound(_0x4d5618,null))['then'](function(_0x4db61c){if(_0x4db61c){_0x400ce1=_0x4db61c;_0x244e86[_0xf48e('0x3a')]=_[_0xf48e('0x3c')](db[_0xf48e('0x7d')][_0xf48e('0x36')]);_0x244e86[_0xf48e('0x3b')]=_[_0xf48e('0x3c')](_0x224c7e[_0xf48e('0x3b')]);_0x244e86[_0xf48e('0x3d')]=_[_0xf48e('0x3e')](_0x244e86[_0xf48e('0x3a')],_0x244e86[_0xf48e('0x3b')]);_0x2e8d5e[_0xf48e('0x40')]=_[_0xf48e('0x3e')](_0x244e86[_0xf48e('0x3a')],qs[_0xf48e('0x3f')](_0x224c7e[_0xf48e('0x3b')][_0xf48e('0x3f')]));_0x2e8d5e[_0xf48e('0x40')]=_0x2e8d5e[_0xf48e('0x40')][_0xf48e('0x41')]?_0x2e8d5e[_0xf48e('0x40')]:_0x244e86[_0xf48e('0x3a')];_0x2e8d5e[_0xf48e('0x7e')]=qs[_0xf48e('0x44')](_0x224c7e[_0xf48e('0x3b')][_0xf48e('0x44')]);_0x2e8d5e[_0xf48e('0x45')]=qs[_0xf48e('0x3d')](_['pick'](_0x224c7e[_0xf48e('0x3b')],_0x244e86['filters']));if(_0x224c7e[_0xf48e('0x3b')]['filter']){_0x2e8d5e[_0xf48e('0x45')]=_[_0xf48e('0x48')](_0x2e8d5e[_0xf48e('0x45')],{'$or':_[_0xf48e('0x35')](_0x2e8d5e[_0xf48e('0x40')],function(_0x45144f){var _0x36d265={};_0x36d265[_0x45144f]={'$like':'%'+_0x224c7e[_0xf48e('0x3b')][_0xf48e('0x47')]+'%'};return _0x36d265;})});}_0x2e8d5e=_[_0xf48e('0x48')]({},_0x2e8d5e,_0x224c7e[_0xf48e('0x49')]);return _0x400ce1[_0xf48e('0x7b')](_0x2e8d5e);}})['then'](function(_0x7b5989){if(_0x7b5989){_0x59e6a0=_0x7b5989[_0xf48e('0x41')];if(!_0x224c7e['query'][_0xf48e('0x42')]('nolimit')){_0x2e8d5e[_0xf48e('0x24')]=qs[_0xf48e('0x24')](_0x224c7e[_0xf48e('0x3b')][_0xf48e('0x24')]);_0x2e8d5e[_0xf48e('0x21')]=qs['offset'](_0x224c7e[_0xf48e('0x3b')][_0xf48e('0x21')]);}return _0x400ce1[_0xf48e('0x7b')](_0x2e8d5e);}})['then'](function(_0x1bf291){if(_0x1bf291){return _0x1bf291?{'count':_0x59e6a0,'rows':_0x1bf291}:null;}})[_0xf48e('0x2b')](respondWithResult(_0x4d5618,null))[_0xf48e('0x4f')](handleError(_0x4d5618,null));}; \ No newline at end of file +var _0xbe71=['attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','name','send','Dashboard','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','https://','custom','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report'];(function(_0xf3782c,_0x324d78){var _0x58668d=function(_0x59f369){while(--_0x59f369){_0xf3782c['push'](_0xf3782c['shift']());}};_0x58668d(++_0x324d78);}(_0xbe71,0xfa));var _0x1be7=function(_0x412e7d,_0x3e72e6){_0x412e7d=_0x412e7d-0x0;var _0x2be1f5=_0xbe71[_0x412e7d];return _0x2be1f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be7('0x0'));var zipdir=require(_0x1be7('0x1'));var jsonpatch=require(_0x1be7('0x2'));var rp=require(_0x1be7('0x3'));var moment=require(_0x1be7('0x4'));var BPromise=require(_0x1be7('0x5'));var Mustache=require(_0x1be7('0x6'));var util=require(_0x1be7('0x7'));var path=require('path');var sox=require(_0x1be7('0x8'));var csv=require('to-csv');var ejs=require(_0x1be7('0x9'));var fs=require('fs');var fs_extra=require(_0x1be7('0xa'));var _=require('lodash');var squel=require(_0x1be7('0xb'));var crypto=require(_0x1be7('0xc'));var jsforce=require(_0x1be7('0xd'));var deskjs=require(_0x1be7('0xe'));var toCsv=require(_0x1be7('0xf'));var querystring=require(_0x1be7('0x10'));var Papa=require(_0x1be7('0x11'));var Redis=require(_0x1be7('0x12'));var authService=require(_0x1be7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1be7('0x14'));var hardwareService=require(_0x1be7('0x15'));var logger=require(_0x1be7('0x16'))(_0x1be7('0x17'));var utils=require(_0x1be7('0x18'));var config=require(_0x1be7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1be7('0x1a'))['db'];config[_0x1be7('0x1b')]=_[_0x1be7('0x1c')](config['redis'],{'host':_0x1be7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1be7('0x1b')]));require('./dashboard.socket')[_0x1be7('0x1e')](socket);function respondWithStatusCode(_0x121fbb,_0xcd1504){_0xcd1504=_0xcd1504||0xcc;return function(_0x1f7ea3){if(_0x1f7ea3){return _0x121fbb[_0x1be7('0x1f')](_0xcd1504);}return _0x121fbb[_0x1be7('0x20')](_0xcd1504)[_0x1be7('0x21')]();};}function respondWithResult(_0x21a73e,_0x1facfd){_0x1facfd=_0x1facfd||0xc8;return function(_0x305869){if(_0x305869){return _0x21a73e[_0x1be7('0x20')](_0x1facfd)[_0x1be7('0x22')](_0x305869);}};}function respondWithFilteredResult(_0x442a02,_0x3837f2){return function(_0x2dceb7){if(_0x2dceb7){var _0x593cdf=typeof _0x3837f2[_0x1be7('0x23')]===_0x1be7('0x24')&&typeof _0x3837f2['limit']===_0x1be7('0x24');var _0x18a7d4=_0x2dceb7[_0x1be7('0x25')];var _0x1a1b9f=_0x593cdf?0x0:_0x3837f2[_0x1be7('0x23')];var _0xc1958a=_0x593cdf?_0x2dceb7[_0x1be7('0x25')]:_0x3837f2['offset']+_0x3837f2['limit'];var _0x2e49f3;if(_0xc1958a>=_0x18a7d4){_0xc1958a=_0x18a7d4;_0x2e49f3=0xc8;}else{_0x2e49f3=0xce;}_0x442a02[_0x1be7('0x20')](_0x2e49f3);return _0x442a02['set'](_0x1be7('0x26'),_0x1a1b9f+'-'+_0xc1958a+'/'+_0x18a7d4)['json'](_0x2dceb7);}return null;};}function patchUpdates(_0xb9368a){return function(_0x15394d){try{jsonpatch[_0x1be7('0x27')](_0x15394d,_0xb9368a,!![]);}catch(_0x2a97f7){return BPromise['reject'](_0x2a97f7);}return _0x15394d[_0x1be7('0x28')]();};}function saveUpdates(_0xc0522b,_0x10570e){return function(_0x289607){if(_0x289607){return _0x289607['update'](_0xc0522b)[_0x1be7('0x29')](function(_0xedc638){return _0xedc638;});}return null;};}function removeEntity(_0x57f47d,_0x38ec55){return function(_0x278652){if(_0x278652){return _0x278652[_0x1be7('0x2a')]()[_0x1be7('0x29')](function(){var _0x3a28bb=_0x278652[_0x1be7('0x2b')]({'plain':!![]});var _0x465b7e=_0x1be7('0x2c');return db[_0x1be7('0x2d')][_0x1be7('0x2a')]({'where':{'type':_0x465b7e,'resourceId':_0x3a28bb['id']}})[_0x1be7('0x29')](function(){return _0x278652;});})[_0x1be7('0x29')](function(){_0x57f47d['status'](0xcc)[_0x1be7('0x21')]();});}};}function handleEntityNotFound(_0x301848,_0x368e31){return function(_0x4f36db){if(!_0x4f36db){_0x301848[_0x1be7('0x1f')](0x194);}return _0x4f36db;};}function handleError(_0x5a5867,_0x310ad0){_0x310ad0=_0x310ad0||0x1f4;return function(_0x3175ff){logger['error'](_0x3175ff['stack']);if(_0x3175ff[_0x1be7('0x2e')]){delete _0x3175ff[_0x1be7('0x2e')];}_0x5a5867[_0x1be7('0x20')](_0x310ad0)[_0x1be7('0x2f')](_0x3175ff);};}exports['index']=function(_0x566a20,_0x4bdda6){var _0x4333ea={},_0x5ddb36={},_0x11ef59={'count':0x0,'rows':[]};var _0xe471a2=_['map'](db[_0x1be7('0x30')]['rawAttributes'],function(_0x405e6a){return{'name':_0x405e6a[_0x1be7('0x31')],'type':_0x405e6a[_0x1be7('0x32')]['key']};});_0x5ddb36['model']=_[_0x1be7('0x33')](_0xe471a2,_0x1be7('0x2e'));_0x5ddb36[_0x1be7('0x34')]=_[_0x1be7('0x35')](_0x566a20[_0x1be7('0x34')]);_0x5ddb36[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x5ddb36[_0x1be7('0x38')],_0x5ddb36[_0x1be7('0x34')]);_0x4333ea[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x5ddb36[_0x1be7('0x38')],qs[_0x1be7('0x3a')](_0x566a20[_0x1be7('0x34')]['fields']));_0x4333ea[_0x1be7('0x39')]=_0x4333ea[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x4333ea['attributes']:_0x5ddb36[_0x1be7('0x38')];if(!_0x566a20['query'][_0x1be7('0x3c')](_0x1be7('0x3d'))){_0x4333ea[_0x1be7('0x3e')]=qs[_0x1be7('0x3e')](_0x566a20[_0x1be7('0x34')][_0x1be7('0x3e')]);_0x4333ea[_0x1be7('0x23')]=qs['offset'](_0x566a20[_0x1be7('0x34')][_0x1be7('0x23')]);}_0x4333ea[_0x1be7('0x3f')]=qs[_0x1be7('0x40')](_0x566a20[_0x1be7('0x34')]['sort']);_0x4333ea[_0x1be7('0x41')]=qs[_0x1be7('0x36')](_[_0x1be7('0x42')](_0x566a20[_0x1be7('0x34')],_0x5ddb36[_0x1be7('0x36')]),_0xe471a2);if(_0x566a20[_0x1be7('0x34')][_0x1be7('0x43')]){_0x4333ea[_0x1be7('0x41')]=_['merge'](_0x4333ea[_0x1be7('0x41')],{'$or':_[_0x1be7('0x33')](_0xe471a2,function(_0x4e87e1){if(_0x4e87e1[_0x1be7('0x32')]!=='VIRTUAL'){var _0x152d7b={};_0x152d7b[_0x4e87e1[_0x1be7('0x2e')]]={'$like':'%'+_0x566a20[_0x1be7('0x34')][_0x1be7('0x43')]+'%'};return _0x152d7b;}})});}_0x4333ea=_[_0x1be7('0x44')]({},_0x4333ea,_0x566a20[_0x1be7('0x45')]);var _0x383d30={'where':_0x4333ea[_0x1be7('0x41')]};return db[_0x1be7('0x30')][_0x1be7('0x25')](_0x383d30)['then'](function(_0x3a781d){_0x11ef59['count']=_0x3a781d;if(_0x566a20['query'][_0x1be7('0x46')]){_0x4333ea[_0x1be7('0x47')]=[{'all':!![]}];}return db[_0x1be7('0x30')][_0x1be7('0x48')](_0x4333ea);})[_0x1be7('0x29')](function(_0x43fd59){_0x11ef59[_0x1be7('0x49')]=_0x43fd59;return _0x11ef59;})[_0x1be7('0x29')](respondWithFilteredResult(_0x4bdda6,_0x4333ea))['catch'](handleError(_0x4bdda6,null));};exports[_0x1be7('0x4a')]=function(_0x1e5ae5,_0x59e2ae){var _0x163c74={'raw':![],'where':{'id':_0x1e5ae5[_0x1be7('0x4b')]['id']}},_0x13de0f={};_0x13de0f[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x30')][_0x1be7('0x4c')]);_0x13de0f[_0x1be7('0x34')]=_[_0x1be7('0x35')](_0x1e5ae5[_0x1be7('0x34')]);_0x13de0f[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x13de0f[_0x1be7('0x38')],_0x13de0f[_0x1be7('0x34')]);_0x163c74[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x13de0f[_0x1be7('0x38')],qs[_0x1be7('0x3a')](_0x1e5ae5[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x163c74[_0x1be7('0x39')]=_0x163c74[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x163c74[_0x1be7('0x39')]:_0x13de0f[_0x1be7('0x38')];if(_0x1e5ae5[_0x1be7('0x34')]['includeAll']){_0x163c74[_0x1be7('0x47')]=[{'all':!![]}];}_0x163c74=_[_0x1be7('0x44')]({},_0x163c74,_0x1e5ae5[_0x1be7('0x45')]);return db['Dashboard'][_0x1be7('0x4d')](_0x163c74)[_0x1be7('0x29')](handleEntityNotFound(_0x59e2ae,null))[_0x1be7('0x29')](respondWithResult(_0x59e2ae,null))[_0x1be7('0x4e')](handleError(_0x59e2ae,null));};exports[_0x1be7('0x4f')]=function(_0x235063,_0x5d1da6){return db[_0x1be7('0x30')]['create'](_0x235063[_0x1be7('0x50')],{})[_0x1be7('0x29')](function(_0x18a363){var _0x4417d7=_0x235063[_0x1be7('0x51')][_0x1be7('0x2b')]({'plain':!![]});if(!_0x4417d7)throw new Error(_0x1be7('0x52'));if(_0x4417d7[_0x1be7('0x53')]===_0x1be7('0x51')){var _0xaad3a6=_0x18a363['get']({'plain':!![]});var _0x39cd18=_0x1be7('0x2c');return db[_0x1be7('0x54')][_0x1be7('0x4d')]({'where':{'name':_0x39cd18,'userProfileId':_0x4417d7['userProfileId']},'raw':!![]})[_0x1be7('0x29')](function(_0x1a3d71){if(_0x1a3d71&&_0x1a3d71[_0x1be7('0x55')]===0x0){return db[_0x1be7('0x2d')][_0x1be7('0x4f')]({'name':_0xaad3a6[_0x1be7('0x2e')],'resourceId':_0xaad3a6['id'],'type':_0x1a3d71[_0x1be7('0x2e')],'sectionId':_0x1a3d71['id']},{})[_0x1be7('0x29')](function(){return _0x18a363;});}else{return _0x18a363;}})['catch'](function(_0x3050e9){logger[_0x1be7('0x56')](_0x1be7('0x57'),_0x3050e9);throw _0x3050e9;});}return _0x18a363;})['then'](respondWithResult(_0x5d1da6,0xc9))[_0x1be7('0x4e')](handleError(_0x5d1da6,null));};exports['clone']=function(_0xc75350,_0x333f4e){var _0x24b0a1={'where':{'id':_0xc75350['params']['id']}},_0x3ab5e1={};_0x3ab5e1[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x30')][_0x1be7('0x4c')]);_0x24b0a1['attributes']=_[_0x1be7('0x37')](_0x3ab5e1[_0x1be7('0x38')],qs['fields'](_0xc75350[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x24b0a1[_0x1be7('0x39')]=_0x24b0a1[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x24b0a1[_0x1be7('0x39')]:_0x3ab5e1[_0x1be7('0x38')];if(_0xc75350[_0x1be7('0x34')][_0x1be7('0x46')]){_0x24b0a1[_0x1be7('0x47')]=[{'all':!![]}];}_0x24b0a1=_['merge']({},_0x24b0a1,_0xc75350[_0x1be7('0x45')]);return db['Dashboard'][_0x1be7('0x4d')](_0x24b0a1)[_0x1be7('0x29')](handleEntityNotFound(_0x333f4e,null))['then'](function(_0x151cdd){if(_0x151cdd){var _0x11990e=_0x151cdd[_0x1be7('0x2b')]({'plain':!![]});_0x11990e=qs[_0x1be7('0x58')](_0x11990e,['id',_0x1be7('0x59'),_0x1be7('0x5a')]);_0xc75350['body']=_[_0x1be7('0x58')](_0xc75350[_0x1be7('0x50')],['id',_0x1be7('0x59'),_0x1be7('0x5a')]);return db[_0x1be7('0x30')]['create'](_[_0x1be7('0x44')](_0x11990e,_0xc75350[_0x1be7('0x50')]),{'include':_0xc75350[_0x1be7('0x34')][_0x1be7('0x46')]?[{'all':!![]}]:undefined})[_0x1be7('0x29')](function(_0x551a56){var _0x2e756c=_0xc75350[_0x1be7('0x51')][_0x1be7('0x2b')]({'plain':!![]});if(!_0x2e756c)throw new Error(_0x1be7('0x52'));if(_0x2e756c[_0x1be7('0x53')]==='user'){var _0x1902f5=_0x551a56[_0x1be7('0x2b')]({'plain':!![]});var _0x15975d=_0x1be7('0x2c');return db[_0x1be7('0x54')][_0x1be7('0x4d')]({'where':{'name':_0x15975d,'userProfileId':_0x2e756c[_0x1be7('0x5b')]},'raw':!![]})[_0x1be7('0x29')](function(_0x58ff72){if(_0x58ff72&&_0x58ff72[_0x1be7('0x55')]===0x0){return db[_0x1be7('0x2d')][_0x1be7('0x4f')]({'name':_0x1902f5[_0x1be7('0x2e')],'resourceId':_0x1902f5['id'],'type':_0x58ff72[_0x1be7('0x2e')],'sectionId':_0x58ff72['id']},{})[_0x1be7('0x29')](function(){return _0x551a56;});}else{return _0x551a56;}})[_0x1be7('0x4e')](function(_0x5a8478){logger[_0x1be7('0x56')](_0x1be7('0x57'),_0x5a8478);throw _0x5a8478;});}return _0x551a56;});}})[_0x1be7('0x29')](respondWithResult(_0x333f4e,0xc9))[_0x1be7('0x4e')](handleError(_0x333f4e,null));};exports['update']=function(_0x44bb63,_0x23922a){if(_0x44bb63[_0x1be7('0x50')]['id']){delete _0x44bb63[_0x1be7('0x50')]['id'];}return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x44bb63[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x23922a,null))[_0x1be7('0x29')](saveUpdates(_0x44bb63[_0x1be7('0x50')],null))[_0x1be7('0x29')](respondWithResult(_0x23922a,null))[_0x1be7('0x4e')](handleError(_0x23922a,null));};exports[_0x1be7('0x2a')]=function(_0x587d7f,_0x46f8b7){return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x587d7f[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x46f8b7,null))[_0x1be7('0x29')](removeEntity(_0x46f8b7,null))[_0x1be7('0x4e')](handleError(_0x46f8b7,null));};function widgetAttributes(_0xda50){try{switch(_0xda50[_0x1be7('0x32')]){case _0x1be7('0x5c'):return[{'name':_0x1be7('0x5d'),'value':_0xda50['attrUrl']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50['attrs'][0x0]['value']:undefined)||_0x1be7('0x5f')}];case _0x1be7('0x60'):return[{'name':'attrPath','value':_0xda50['attrPath']||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||''}];case _0x1be7('0x62'):return[{'name':_0x1be7('0x63'),'value':_0xda50['attrHourFormat']||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x1be7('0x64'),'value':_0xda50[_0x1be7('0x64')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||_0x1be7('0x65')},{'name':'attrFontSize','value':_0xda50[_0x1be7('0x66')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x2]?_0xda50['attrs'][0x2][_0x1be7('0x61')]:undefined)||0xc}];case _0x1be7('0x67'):return[{'name':_0x1be7('0x68'),'value':_0xda50[_0x1be7('0x68')]||(_0xda50['attrs']&&_0xda50['attrs'][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||_0x1be7('0x69')},{'name':_0x1be7('0x6a'),'value':_0xda50[_0x1be7('0x6a')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0xda50[_0x1be7('0x66')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x2]?_0xda50[_0x1be7('0x5e')][0x2]['value']:undefined)||0x14}];case _0x1be7('0x6b'):case _0x1be7('0x6c'):return[{'name':_0x1be7('0x6d'),'value':_0xda50['attrSerie1']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50['attrs'][0x0][_0x1be7('0x61')]:undefined)||_0x1be7('0x69')},{'name':_0x1be7('0x6e'),'value':_0xda50[_0x1be7('0x6e')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50[_0x1be7('0x5e')][0x1][_0x1be7('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0xda50[_0x1be7('0x6f')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x2]?_0xda50[_0x1be7('0x5e')][0x2]['value']:undefined)||null},{'name':_0x1be7('0x6a'),'value':_0xda50['attrVoiceQueues']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x3]?_0xda50[_0x1be7('0x5e')][0x3][_0x1be7('0x61')]:undefined)||[]}];case _0x1be7('0x70'):return[{'name':'attrReport','type':_0xda50['reportType']||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x32')]:undefined)||null,'value':_0xda50[_0x1be7('0x71')]||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||null},{'name':_0x1be7('0x72'),'value':_0xda50[_0x1be7('0x72')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x16a512){logger[_0x1be7('0x56')](_0x1be7('0x73'),JSON[_0x1be7('0x74')](_0x16a512));return[];}}exports[_0x1be7('0x75')]=function(_0x5d0915,_0x3798d9,_0x20bd07){if(_0x5d0915[_0x1be7('0x50')]['id']){delete _0x5d0915[_0x1be7('0x50')]['id'];}return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x5d0915[_0x1be7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3798d9,null))[_0x1be7('0x29')](function(_0x12d8a3){if(_0x12d8a3){_0x5d0915[_0x1be7('0x50')][_0x1be7('0x76')]=_0x12d8a3['id'];_0x5d0915['body'][_0x1be7('0x5e')]=widgetAttributes(_0x5d0915['body']);return db[_0x1be7('0x77')][_0x1be7('0x4f')](_0x5d0915['body']);}})[_0x1be7('0x29')](respondWithResult(_0x3798d9,null))[_0x1be7('0x4e')](handleError(_0x3798d9,null));};exports[_0x1be7('0x78')]=function(_0x35ebb9,_0x1e83ea,_0xca2373){var _0x4e0b5a={};var _0x907282={};var _0x2f4829;var _0x5f1c3a;return db[_0x1be7('0x30')]['findOne']({'where':{'id':_0x35ebb9[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x1e83ea,null))['then'](function(_0x39f300){if(_0x39f300){_0x2f4829=_0x39f300;_0x907282[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x77')][_0x1be7('0x4c')]);_0x907282[_0x1be7('0x34')]=_['keys'](_0x35ebb9[_0x1be7('0x34')]);_0x907282[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x907282['model'],_0x907282[_0x1be7('0x34')]);_0x4e0b5a[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x907282['model'],qs[_0x1be7('0x3a')](_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x4e0b5a[_0x1be7('0x39')]=_0x4e0b5a['attributes'][_0x1be7('0x3b')]?_0x4e0b5a[_0x1be7('0x39')]:_0x907282[_0x1be7('0x38')];_0x4e0b5a[_0x1be7('0x3f')]=qs[_0x1be7('0x40')](_0x35ebb9['query'][_0x1be7('0x40')]);_0x4e0b5a['where']=qs[_0x1be7('0x36')](_[_0x1be7('0x42')](_0x35ebb9[_0x1be7('0x34')],_0x907282[_0x1be7('0x36')]));if(_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x43')]){_0x4e0b5a['where']=_[_0x1be7('0x44')](_0x4e0b5a[_0x1be7('0x41')],{'$or':_[_0x1be7('0x33')](_0x4e0b5a[_0x1be7('0x39')],function(_0x2598c7){var _0x50c7ca={};_0x50c7ca[_0x2598c7]={'$like':'%'+_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x43')]+'%'};return _0x50c7ca;})});}_0x4e0b5a=_['merge']({},_0x4e0b5a,_0x35ebb9[_0x1be7('0x45')]);return _0x2f4829[_0x1be7('0x78')](_0x4e0b5a);}})[_0x1be7('0x29')](function(_0x3c5dfd){if(_0x3c5dfd){_0x5f1c3a=_0x3c5dfd[_0x1be7('0x3b')];if(!_0x35ebb9[_0x1be7('0x34')]['hasOwnProperty'](_0x1be7('0x3d'))){_0x4e0b5a[_0x1be7('0x3e')]=qs[_0x1be7('0x3e')](_0x35ebb9['query'][_0x1be7('0x3e')]);_0x4e0b5a[_0x1be7('0x23')]=qs[_0x1be7('0x23')](_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x23')]);}return _0x2f4829[_0x1be7('0x78')](_0x4e0b5a);}})['then'](function(_0x25b6e7){if(_0x25b6e7){return _0x25b6e7?{'count':_0x5f1c3a,'rows':_0x25b6e7}:null;}})[_0x1be7('0x29')](respondWithResult(_0x1e83ea,null))[_0x1be7('0x4e')](handleError(_0x1e83ea,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1ae2b69..4248a01 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 _0x9f83=['exports','events','Dashboard','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x1320a4,_0x24f285){var _0x7c0134=function(_0x32f842){while(--_0x32f842){_0x1320a4['push'](_0x1320a4['shift']());}};_0x7c0134(++_0x24f285);}(_0x9f83,0x1ac));var _0x39f8=function(_0x428a87,_0x1c10ed){_0x428a87=_0x428a87-0x0;var _0x2ba996=_0x9f83[_0x428a87];return _0x2ba996;};'use strict';var EventEmitter=require(_0x39f8('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x39f8('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x39f8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x39f8('0x3')};function emitEvent(_0x3b621e){return function(_0x380223,_0x2e80ca,_0x2917f6){DashboardEvents['emit'](_0x3b621e+':'+_0x380223['id'],_0x380223);DashboardEvents[_0x39f8('0x4')](_0x3b621e,_0x380223);_0x2917f6(null);};}for(var e in events){if(events[_0x39f8('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x39f8('0x6')]=DashboardEvents; \ No newline at end of file +var _0x5790=['exports','events','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x5790,0xa1));var _0x0579=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5790[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x0579('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x0579('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0579('0x2')](0x0);var events={'afterCreate':_0x0579('0x3'),'afterUpdate':_0x0579('0x4'),'afterDestroy':_0x0579('0x5')};function emitEvent(_0x3f8736){return function(_0x464651,_0x42ea59,_0x3f3019){DashboardEvents[_0x0579('0x6')](_0x3f8736+':'+_0x464651['id'],_0x464651);DashboardEvents[_0x0579('0x6')](_0x3f8736,_0x464651);_0x3f3019(null);};}for(var e in events){if(events[_0x0579('0x7')](e)){var event=events[e];Dashboard[_0x0579('0x8')](e,emitEvent(event));}}module[_0x0579('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 59d7855..527d75e 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 _0x8884=['../../config/environment','./dashboard.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x19fd39,_0x5dc771){var _0x31d985=function(_0x3ed209){while(--_0x3ed209){_0x19fd39['push'](_0x19fd39['shift']());}};_0x31d985(++_0x5dc771);}(_0x8884,0x1c6));var _0x4888=function(_0x81c2c5,_0x5edf27){_0x81c2c5=_0x81c2c5-0x0;var _0x33b5c7=_0x8884[_0x81c2c5];return _0x33b5c7;};'use strict';var _=require(_0x4888('0x0'));var util=require(_0x4888('0x1'));var logger=require(_0x4888('0x2'))(_0x4888('0x3'));var moment=require(_0x4888('0x4'));var BPromise=require(_0x4888('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4888('0x6'));var rimraf=require(_0x4888('0x7'));var config=require(_0x4888('0x8'));var attributes=require(_0x4888('0x9'));module['exports']=function(_0x3aeca0,_0x4a346d){return _0x3aeca0[_0x4888('0xa')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe96f=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','lodash'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xe96f,0x199));var _0xfe96=function(_0x5967e2,_0x3661d4){_0x5967e2=_0x5967e2-0x0;var _0x56078d=_0xe96f[_0x5967e2];return _0x56078d;};'use strict';var _=require(_0xfe96('0x0'));var util=require(_0xfe96('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe96('0x2'));var BPromise=require(_0xfe96('0x3'));var rp=require(_0xfe96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe96('0x5'));var config=require(_0xfe96('0x6'));var attributes=require(_0xfe96('0x7'));module[_0xfe96('0x8')]=function(_0x1c300f,_0x35947d){return _0x1c300f[_0xfe96('0x9')]('Dashboard',attributes,{'tableName':'dashboards','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 c9c4d03..225ae1a 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 _0x8512=['debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x8512,0x1d9));var _0x2851=function(_0x148b67,_0xb5d156){_0x148b67=_0x148b67-0x0;var _0x432281=_0x8512[_0x148b67];return _0x432281;};'use strict';var _=require(_0x2851('0x0'));var util=require(_0x2851('0x1'));var moment=require('moment');var BPromise=require(_0x2851('0x2'));var rs=require(_0x2851('0x3'));var fs=require('fs');var Redis=require(_0x2851('0x4'));var db=require(_0x2851('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2851('0x6'))(_0x2851('0x7'));var config=require('../../config/environment');var jayson=require(_0x2851('0x8'));var client=jayson[_0x2851('0x9')][_0x2851('0xa')]({'port':0x232a});config[_0x2851('0xb')]=_[_0x2851('0xc')](config[_0x2851('0xb')],{'host':_0x2851('0xd'),'port':0x18eb});var socket=require(_0x2851('0xe'))(new Redis(config[_0x2851('0xb')]));require(_0x2851('0xf'))[_0x2851('0x10')](socket);function respondWithRpcPromise(_0x5adeea,_0x97101,_0x42f7c4){return new BPromise(function(_0x2482cb,_0x12ad6d){return client[_0x2851('0x11')](_0x5adeea,_0x42f7c4)[_0x2851('0x12')](function(_0x37ae22){logger[_0x2851('0x13')](_0x2851('0x14'),_0x97101,'request\x20sent');logger[_0x2851('0x15')](_0x2851('0x16'),_0x97101,'request\x20sent',JSON['stringify'](_0x37ae22));if(_0x37ae22['error']){if(_0x37ae22[_0x2851('0x17')]['code']===0x1f4){logger[_0x2851('0x17')](_0x2851('0x14'),_0x97101,_0x37ae22[_0x2851('0x17')]['message']);return _0x12ad6d(_0x37ae22[_0x2851('0x17')]['message']);}logger[_0x2851('0x17')](_0x2851('0x14'),_0x97101,_0x37ae22[_0x2851('0x17')][_0x2851('0x18')]);return _0x2482cb(_0x37ae22[_0x2851('0x17')]['message']);}else{logger[_0x2851('0x13')](_0x2851('0x14'),_0x97101,'request\x20sent');_0x2482cb(_0x37ae22[_0x2851('0x19')][_0x2851('0x18')]);}})['catch'](function(_0x5d0f3f){logger[_0x2851('0x17')]('Dashboard,\x20%s,\x20%s',_0x97101,_0x5d0f3f);_0x12ad6d(_0x5d0f3f);});});} \ No newline at end of file +var _0x9f17=['debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x55394,_0x4c6273){var _0x4d7942=function(_0x311bfa){while(--_0x311bfa){_0x55394['push'](_0x55394['shift']());}};_0x4d7942(++_0x4c6273);}(_0x9f17,0x11a));var _0x79f1=function(_0x550eb1,_0x26d9eb){_0x550eb1=_0x550eb1-0x0;var _0x353471=_0x9f17[_0x550eb1];return _0x353471;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x79f1('0x0'));var rs=require(_0x79f1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79f1('0x2'))['db'];var utils=require(_0x79f1('0x3'));var logger=require(_0x79f1('0x4'))(_0x79f1('0x5'));var config=require(_0x79f1('0x6'));var jayson=require(_0x79f1('0x7'));var client=jayson[_0x79f1('0x8')][_0x79f1('0x9')]({'port':0x232a});config[_0x79f1('0xa')]=_['defaults'](config[_0x79f1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x79f1('0xb'))(new Redis(config[_0x79f1('0xa')]));require('./dashboard.socket')[_0x79f1('0xc')](socket);function respondWithRpcPromise(_0xf074af,_0x59da0b,_0x5e26ec){return new BPromise(function(_0x4c0c8e,_0x1ede3f){return client['request'](_0xf074af,_0x5e26ec)[_0x79f1('0xd')](function(_0x46ff9d){logger[_0x79f1('0xe')](_0x79f1('0xf'),_0x59da0b,_0x79f1('0x10'));logger[_0x79f1('0x11')](_0x79f1('0x12'),_0x59da0b,_0x79f1('0x10'),JSON['stringify'](_0x46ff9d));if(_0x46ff9d['error']){if(_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x14')]===0x1f4){logger[_0x79f1('0x13')](_0x79f1('0xf'),_0x59da0b,_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x15')]);return _0x1ede3f(_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x15')]);}logger['error'](_0x79f1('0xf'),_0x59da0b,_0x46ff9d[_0x79f1('0x13')]['message']);return _0x4c0c8e(_0x46ff9d['error'][_0x79f1('0x15')]);}else{logger[_0x79f1('0xe')](_0x79f1('0xf'),_0x59da0b,_0x79f1('0x10'));_0x4c0c8e(_0x46ff9d['result'][_0x79f1('0x15')]);}})[_0x79f1('0x16')](function(_0x398263){logger[_0x79f1('0x13')](_0x79f1('0xf'),_0x59da0b,_0x398263);_0x1ede3f(_0x398263);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1e3ceed..2b5e256 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 _0x0fd6=['./dashboard.events','remove','emit','removeListener','register','length','dashboard:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd6,0x12d));var _0x60fd=function(_0x3db17b,_0x154758){_0x3db17b=_0x3db17b-0x0;var _0x40035f=_0x0fd6[_0x3db17b];return _0x40035f;};'use strict';var DashboardEvents=require(_0x60fd('0x0'));var events=['save',_0x60fd('0x1'),'update'];function createListener(_0x431811,_0x282bb2){return function(_0x537630){_0x282bb2[_0x60fd('0x2')](_0x431811,_0x537630);};}function removeListener(_0x13321f,_0x33ecce){return function(){DashboardEvents[_0x60fd('0x3')](_0x13321f,_0x33ecce);};}exports[_0x60fd('0x4')]=function(_0x116e6f){for(var _0x1199b4=0x0,_0x4bc25e=events[_0x60fd('0x5')];_0x1199b4<_0x4bc25e;_0x1199b4++){var _0x54ebaf=events[_0x1199b4];var _0x2ff63d=createListener(_0x60fd('0x6')+_0x54ebaf,_0x116e6f);DashboardEvents['on'](_0x54ebaf,_0x2ff63d);}}; \ No newline at end of file +var _0x11ef=['dashboard:','./dashboard.events','remove','emit','removeListener','register','length'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x11ef,0x94));var _0xf11e=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x11ef[_0x45d3f0];return _0x314b79;};'use strict';var DashboardEvents=require(_0xf11e('0x0'));var events=['save',_0xf11e('0x1'),'update'];function createListener(_0x4f19d6,_0x5207b2){return function(_0xa0ada6){_0x5207b2[_0xf11e('0x2')](_0x4f19d6,_0xa0ada6);};}function removeListener(_0x268eb8,_0x4f5b9e){return function(){DashboardEvents[_0xf11e('0x3')](_0x268eb8,_0x4f5b9e);};}exports[_0xf11e('0x4')]=function(_0x3d3ddc){for(var _0xcc4e4b=0x0,_0x20bf13=events[_0xf11e('0x5')];_0xcc4e4b<_0x20bf13;_0xcc4e4b++){var _0x21b432=events[_0xcc4e4b];var _0x406150=createListener(_0xf11e('0x6')+_0x21b432,_0x3d3ddc);DashboardEvents['on'](_0x21b432,_0x406150);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1c5ba59..f98eddf 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 _0x24d4=['index','get','/:id','show','/:id/items','getItems','create','post','clone','addItem','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x24d4,0x109));var _0x424d=function(_0x2a5fa1,_0x1752c5){_0x2a5fa1=_0x2a5fa1-0x0;var _0x134572=_0x24d4[_0x2a5fa1];return _0x134572;};'use strict';var multer=require(_0x424d('0x0'));var util=require(_0x424d('0x1'));var path=require(_0x424d('0x2'));var timeout=require('connect-timeout');var express=require(_0x424d('0x3'));var router=express['Router']();var fs_extra=require(_0x424d('0x4'));var auth=require(_0x424d('0x5'));var interaction=require(_0x424d('0x6'));var config=require(_0x424d('0x7'));var controller=require(_0x424d('0x8'));router['get']('/',auth[_0x424d('0x9')](),controller[_0x424d('0xa')]);router[_0x424d('0xb')](_0x424d('0xc'),auth['isAuthenticated'](),controller[_0x424d('0xd')]);router[_0x424d('0xb')](_0x424d('0xe'),auth['isAuthenticated'](),controller[_0x424d('0xf')]);router['post']('/',auth[_0x424d('0x9')](),controller[_0x424d('0x10')]);router[_0x424d('0x11')]('/:id/clone',auth[_0x424d('0x9')](),controller[_0x424d('0x12')]);router['post']('/:id/items',auth[_0x424d('0x9')](),controller[_0x424d('0x13')]);router[_0x424d('0x14')]('/:id',auth[_0x424d('0x9')](),controller[_0x424d('0x15')]);router[_0x424d('0x16')](_0x424d('0xc'),auth[_0x424d('0x9')](),controller[_0x424d('0x17')]);module[_0x424d('0x18')]=router; \ No newline at end of file +var _0x1194=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/items','getItems','post','/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','util','connect-timeout'];(function(_0x1b3b91,_0x434e67){var _0x5d64a6=function(_0x4bcc66){while(--_0x4bcc66){_0x1b3b91['push'](_0x1b3b91['shift']());}};_0x5d64a6(++_0x434e67);}(_0x1194,0x82));var _0x4119=function(_0x281a3b,_0x1df435){_0x281a3b=_0x281a3b-0x0;var _0x387721=_0x1194[_0x281a3b];return _0x387721;};'use strict';var multer=require('multer');var util=require(_0x4119('0x0'));var path=require('path');var timeout=require(_0x4119('0x1'));var express=require('express');var router=express[_0x4119('0x2')]();var fs_extra=require(_0x4119('0x3'));var auth=require(_0x4119('0x4'));var interaction=require(_0x4119('0x5'));var config=require(_0x4119('0x6'));var controller=require('./dashboard.controller');router[_0x4119('0x7')]('/',auth[_0x4119('0x8')](),controller[_0x4119('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4119('0x7')](_0x4119('0xa'),auth[_0x4119('0x8')](),controller[_0x4119('0xb')]);router['post']('/',auth[_0x4119('0x8')](),controller['create']);router[_0x4119('0xc')](_0x4119('0xd'),auth[_0x4119('0x8')](),controller[_0x4119('0xe')]);router[_0x4119('0xc')](_0x4119('0xa'),auth[_0x4119('0x8')](),controller[_0x4119('0xf')]);router[_0x4119('0x10')](_0x4119('0x11'),auth[_0x4119('0x8')](),controller[_0x4119('0x12')]);router[_0x4119('0x13')](_0x4119('0x11'),auth[_0x4119('0x8')](),controller[_0x4119('0x14')]);module[_0x4119('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3ac0279..5dec588 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 _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x5a2ae4,_0x1893e6){var _0xa8294c=function(_0x56387e){while(--_0x56387e){_0x5a2ae4['push'](_0x5a2ae4['shift']());}};_0xa8294c(++_0x1893e6);}(_0x2ef3,0xba));var _0x32ef=function(_0x19bb3d,_0x730e11){_0x19bb3d=_0x19bb3d-0x0;var _0x54e4cc=_0x2ef3[_0x19bb3d];return _0x54e4cc;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xf61e=['TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x4aca2e,_0x4ab321){var _0x2d60d3=function(_0x30cbc5){while(--_0x30cbc5){_0x4aca2e['push'](_0x4aca2e['shift']());}};_0x2d60d3(++_0x4ab321);}(_0xf61e,0x191));var _0xef61=function(_0x6f85e0,_0x3acdd1){_0x6f85e0=_0x6f85e0-0x0;var _0x2c6dd0=_0xf61e[_0x6f85e0];return _0x2c6dd0;};'use strict';var Sequelize=require(_0xef61('0x0'));var squel=require(_0xef61('0x1'));var _=require(_0xef61('0x2'));module[_0xef61('0x3')]={'title':{'type':Sequelize[_0xef61('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xef61('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6')),'get':function(){try{return JSON[_0xef61('0x7')](this[_0xef61('0x8')](_0xef61('0x9')));}catch(_0x45a18d){return[];}},'set':function(_0x5b00b2){try{this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify'](_0x5b00b2));}catch(_0x2242a7){this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xef61('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xef61('0xb')]},'col':{'type':Sequelize[_0xef61('0xb')]},'background':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xef61('0x4')]},'titleFontSize':{'type':Sequelize[_0xef61('0xb')],'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 6a0f5d8..2cfc487 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 _0x11fd=['destroy','catch','type','attrUrl','attrs','https://','custom','attrPath','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','include','options','DashboardItem','find'];(function(_0x57b7bc,_0x149fc0){var _0x2af179=function(_0x393137){while(--_0x393137){_0x57b7bc['push'](_0x57b7bc['shift']());}};_0x2af179(++_0x149fc0);}(_0x11fd,0x1c7));var _0xd11f=function(_0x47791d,_0x53fc31){_0x47791d=_0x47791d-0x0;var _0x549c8f=_0x11fd[_0x47791d];return _0x549c8f;};'use strict';var emlformat=require(_0xd11f('0x0'));var rimraf=require(_0xd11f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd11f('0x2'));var BPromise=require(_0xd11f('0x3'));var Mustache=require(_0xd11f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd11f('0x5'));var csv=require(_0xd11f('0x6'));var ejs=require(_0xd11f('0x7'));var fs=require('fs');var fs_extra=require(_0xd11f('0x8'));var _=require(_0xd11f('0x9'));var squel=require(_0xd11f('0xa'));var crypto=require(_0xd11f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd11f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd11f('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd11f('0xd'));var as=require(_0xd11f('0xe'));var hardwareService=require(_0xd11f('0xf'));var logger=require(_0xd11f('0x10'))(_0xd11f('0x11'));var utils=require(_0xd11f('0x12'));var config=require(_0xd11f('0x13'));var licenseUtil=require(_0xd11f('0x14'));var db=require(_0xd11f('0x15'))['db'];config[_0xd11f('0x16')]=_['defaults'](config[_0xd11f('0x16')],{'host':_0xd11f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd11f('0x16')]));require(_0xd11f('0x18'))[_0xd11f('0x19')](socket);function respondWithStatusCode(_0x54c455,_0x58c6a3){_0x58c6a3=_0x58c6a3||0xcc;return function(_0x4a6c2c){if(_0x4a6c2c){return _0x54c455[_0xd11f('0x1a')](_0x58c6a3);}return _0x54c455[_0xd11f('0x1b')](_0x58c6a3)[_0xd11f('0x1c')]();};}function respondWithResult(_0xef8fc4,_0x57413f){_0x57413f=_0x57413f||0xc8;return function(_0x10afd8){if(_0x10afd8){return _0xef8fc4[_0xd11f('0x1b')](_0x57413f)['json'](_0x10afd8);}};}function respondWithFilteredResult(_0x2f65de,_0x10d7f5){return function(_0xb9afb0){if(_0xb9afb0){var _0x35e325=typeof _0x10d7f5[_0xd11f('0x1d')]===_0xd11f('0x1e')&&typeof _0x10d7f5[_0xd11f('0x1f')]==='undefined';var _0x2b7278=_0xb9afb0['count'];var _0x104080=_0x35e325?0x0:_0x10d7f5[_0xd11f('0x1d')];var _0x1b6bd6=_0x35e325?_0xb9afb0[_0xd11f('0x20')]:_0x10d7f5['offset']+_0x10d7f5[_0xd11f('0x1f')];var _0x2452d4;if(_0x1b6bd6>=_0x2b7278){_0x1b6bd6=_0x2b7278;_0x2452d4=0xc8;}else{_0x2452d4=0xce;}_0x2f65de[_0xd11f('0x1b')](_0x2452d4);return _0x2f65de[_0xd11f('0x21')](_0xd11f('0x22'),_0x104080+'-'+_0x1b6bd6+'/'+_0x2b7278)['json'](_0xb9afb0);}return null;};}function patchUpdates(_0x457db0){return function(_0x3f5309){try{jsonpatch[_0xd11f('0x23')](_0x3f5309,_0x457db0,!![]);}catch(_0x234842){return BPromise[_0xd11f('0x24')](_0x234842);}return _0x3f5309[_0xd11f('0x25')]();};}function saveUpdates(_0x724708,_0xc2eb35){return function(_0x1de728){if(_0x1de728){return _0x1de728['update'](_0x724708)['then'](function(_0x450a8b){return _0x450a8b;});}return null;};}function removeEntity(_0x3fd440,_0x8552b3){return function(_0x18080d){if(_0x18080d){return _0x18080d['destroy']()[_0xd11f('0x26')](function(){_0x3fd440[_0xd11f('0x1b')](0xcc)[_0xd11f('0x1c')]();});}};}function handleEntityNotFound(_0x23a73d,_0x584bf4){return function(_0x24db9b){if(!_0x24db9b){_0x23a73d[_0xd11f('0x1a')](0x194);}return _0x24db9b;};}function handleError(_0x1c7914,_0x8a8639){_0x8a8639=_0x8a8639||0x1f4;return function(_0x31a0cd){logger['error'](_0x31a0cd[_0xd11f('0x27')]);if(_0x31a0cd[_0xd11f('0x28')]){delete _0x31a0cd['name'];}_0x1c7914[_0xd11f('0x1b')](_0x8a8639)[_0xd11f('0x29')](_0x31a0cd);};}exports['show']=function(_0x20f78b,_0xdb3c03){var _0x20f200={'raw':![],'where':{'id':_0x20f78b[_0xd11f('0x2a')]['id']}},_0x70a969={};_0x70a969[_0xd11f('0x2b')]=_['keys'](db['DashboardItem'][_0xd11f('0x2c')]);_0x70a969[_0xd11f('0x2d')]=_[_0xd11f('0x2e')](_0x20f78b[_0xd11f('0x2d')]);_0x70a969['filters']=_[_0xd11f('0x2f')](_0x70a969[_0xd11f('0x2b')],_0x70a969[_0xd11f('0x2d')]);_0x20f200['attributes']=_[_0xd11f('0x2f')](_0x70a969[_0xd11f('0x2b')],qs[_0xd11f('0x30')](_0x20f78b[_0xd11f('0x2d')][_0xd11f('0x30')]));_0x20f200['attributes']=_0x20f200[_0xd11f('0x31')]['length']?_0x20f200[_0xd11f('0x31')]:_0x70a969['model'];if(_0x20f78b[_0xd11f('0x2d')][_0xd11f('0x32')]){_0x20f200[_0xd11f('0x33')]=[{'all':!![]}];}_0x20f200=_['merge']({},_0x20f200,_0x20f78b[_0xd11f('0x34')]);return db[_0xd11f('0x35')][_0xd11f('0x36')](_0x20f200)[_0xd11f('0x26')](handleEntityNotFound(_0xdb3c03,null))['then'](respondWithResult(_0xdb3c03,null))['catch'](handleError(_0xdb3c03,null));};exports[_0xd11f('0x37')]=function(_0x781cd6,_0x273866){return db[_0xd11f('0x35')]['find']({'where':{'id':_0x781cd6['params']['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x273866,null))[_0xd11f('0x26')](removeEntity(_0x273866,null))[_0xd11f('0x38')](handleError(_0x273866,null));};function widgetAttributes(_0x4e3eae){try{switch(_0x4e3eae[_0xd11f('0x39')]){case'iframe':return[{'name':_0xd11f('0x3a'),'value':_0x4e3eae[_0xd11f('0x3a')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae['attrs'][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0]['value']:undefined)||_0xd11f('0x3c')}];case _0xd11f('0x3d'):return[{'name':_0xd11f('0x3e'),'value':_0x4e3eae[_0xd11f('0x3e')]||(_0x4e3eae['attrs']&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x4e3eae['attrHourFormat']||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0][_0xd11f('0x3f')]:undefined)||_0xd11f('0x40')},{'name':'attrTimezone','value':_0x4e3eae[_0xd11f('0x41')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x1]?_0x4e3eae[_0xd11f('0x3b')][0x1][_0xd11f('0x3f')]:undefined)||_0xd11f('0x42')},{'name':_0xd11f('0x43'),'value':_0x4e3eae['attrFontSize']||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x2]?_0x4e3eae[_0xd11f('0x3b')][0x2]['value']:undefined)||0xc}];case _0xd11f('0x44'):return[{'name':_0xd11f('0x45'),'value':_0x4e3eae[_0xd11f('0x45')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0][_0xd11f('0x3f')]:undefined)||_0xd11f('0x46')},{'name':_0xd11f('0x47'),'value':_0x4e3eae[_0xd11f('0x47')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae['attrs'][0x1]?_0x4e3eae[_0xd11f('0x3b')][0x1][_0xd11f('0x3f')]:undefined)||[]},{'name':_0xd11f('0x43'),'value':_0x4e3eae['attrFontSize']||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x2]?_0x4e3eae[_0xd11f('0x3b')][0x2][_0xd11f('0x3f')]:undefined)||0x14}];case _0xd11f('0x48'):case _0xd11f('0x49'):return[{'name':_0xd11f('0x4a'),'value':_0x4e3eae[_0xd11f('0x4a')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0][_0xd11f('0x3f')]:undefined)||_0xd11f('0x46')},{'name':_0xd11f('0x4b'),'value':_0x4e3eae[_0xd11f('0x4b')]||(_0x4e3eae['attrs']&&_0x4e3eae[_0xd11f('0x3b')][0x1]?_0x4e3eae[_0xd11f('0x3b')][0x1][_0xd11f('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x4e3eae[_0xd11f('0x4c')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x2]?_0x4e3eae[_0xd11f('0x3b')][0x2][_0xd11f('0x3f')]:undefined)||null},{'name':_0xd11f('0x47'),'value':_0x4e3eae[_0xd11f('0x47')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x3]?_0x4e3eae['attrs'][0x3][_0xd11f('0x3f')]:undefined)||[]}];case _0xd11f('0x4d'):return[{'name':_0xd11f('0x4e'),'type':_0x4e3eae[_0xd11f('0x4f')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae[_0xd11f('0x3b')][0x0][_0xd11f('0x39')]:undefined)||null,'value':_0x4e3eae[_0xd11f('0x4e')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x0]?_0x4e3eae['attrs'][0x0][_0xd11f('0x3f')]:undefined)||null},{'name':_0xd11f('0x50'),'value':_0x4e3eae[_0xd11f('0x50')]||(_0x4e3eae[_0xd11f('0x3b')]&&_0x4e3eae[_0xd11f('0x3b')][0x1]?_0x4e3eae[_0xd11f('0x3b')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2eaa9b){logger['error'](_0xd11f('0x51'),JSON[_0xd11f('0x52')](_0x2eaa9b));return[];}}exports[_0xd11f('0x53')]=function(_0x497e10,_0xfd78e4){if(_0x497e10[_0xd11f('0x54')]){_0x497e10['body']['attrs']=widgetAttributes(_0x497e10[_0xd11f('0x54')]);}return db[_0xd11f('0x35')]['create'](_0x497e10[_0xd11f('0x54')],{})['then'](respondWithResult(_0xfd78e4,0xc9))[_0xd11f('0x38')](handleError(_0xfd78e4,null));};exports['update']=function(_0x4f4fad,_0x112488){if(_0x4f4fad[_0xd11f('0x54')]['id']){delete _0x4f4fad[_0xd11f('0x54')]['id'];}_0x4f4fad[_0xd11f('0x54')][_0xd11f('0x3b')]=widgetAttributes(_0x4f4fad['body']);return db[_0xd11f('0x35')][_0xd11f('0x36')]({'where':{'id':_0x4f4fad[_0xd11f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x112488,null))[_0xd11f('0x26')](saveUpdates(_0x4f4fad[_0xd11f('0x54')],null))[_0xd11f('0x26')](respondWithResult(_0x112488,null))['catch'](handleError(_0x112488,null));}; \ No newline at end of file +var _0xf28f=['0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','stringify','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','params','query','filters','model','attributes','intersection','fields','includeAll','include','options','DashboardItem','find','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x57d41c,_0x4a16e8){var _0x5d9d9e=function(_0x4f416f){while(--_0x4f416f){_0x57d41c['push'](_0x57d41c['shift']());}};_0x5d9d9e(++_0x4a16e8);}(_0xf28f,0x11a));var _0xff28=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xf28f[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0xff28('0x0'));var rimraf=require(_0xff28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff28('0x2'));var rp=require(_0xff28('0x3'));var moment=require(_0xff28('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff28('0x5'));var util=require(_0xff28('0x6'));var path=require(_0xff28('0x7'));var sox=require(_0xff28('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff28('0x9'));var _=require('lodash');var squel=require(_0xff28('0xa'));var crypto=require(_0xff28('0xb'));var jsforce=require(_0xff28('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xff28('0xd'));var querystring=require(_0xff28('0xe'));var Papa=require(_0xff28('0xf'));var Redis=require(_0xff28('0x10'));var authService=require(_0xff28('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff28('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff28('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xff28('0x14'));var licenseUtil=require(_0xff28('0x15'));var db=require(_0xff28('0x16'))['db'];config[_0xff28('0x17')]=_[_0xff28('0x18')](config['redis'],{'host':_0xff28('0x19'),'port':0x18eb});var socket=require(_0xff28('0x1a'))(new Redis(config[_0xff28('0x17')]));require(_0xff28('0x1b'))[_0xff28('0x1c')](socket);function respondWithStatusCode(_0x2335cb,_0xf341fb){_0xf341fb=_0xf341fb||0xcc;return function(_0x54cef5){if(_0x54cef5){return _0x2335cb[_0xff28('0x1d')](_0xf341fb);}return _0x2335cb[_0xff28('0x1e')](_0xf341fb)[_0xff28('0x1f')]();};}function respondWithResult(_0x264ea8,_0x2cbcc1){_0x2cbcc1=_0x2cbcc1||0xc8;return function(_0x2bae65){if(_0x2bae65){return _0x264ea8[_0xff28('0x1e')](_0x2cbcc1)[_0xff28('0x20')](_0x2bae65);}};}function respondWithFilteredResult(_0x465635,_0x36d991){return function(_0x3188da){if(_0x3188da){var _0x25ec4e=typeof _0x36d991[_0xff28('0x21')]===_0xff28('0x22')&&typeof _0x36d991[_0xff28('0x23')]==='undefined';var _0x297169=_0x3188da[_0xff28('0x24')];var _0xa80c93=_0x25ec4e?0x0:_0x36d991[_0xff28('0x21')];var _0xdcf5c3=_0x25ec4e?_0x3188da[_0xff28('0x24')]:_0x36d991[_0xff28('0x21')]+_0x36d991['limit'];var _0xf38eb9;if(_0xdcf5c3>=_0x297169){_0xdcf5c3=_0x297169;_0xf38eb9=0xc8;}else{_0xf38eb9=0xce;}_0x465635['status'](_0xf38eb9);return _0x465635[_0xff28('0x25')]('Content-Range',_0xa80c93+'-'+_0xdcf5c3+'/'+_0x297169)[_0xff28('0x20')](_0x3188da);}return null;};}function patchUpdates(_0x1a790d){return function(_0x59d4ed){try{jsonpatch[_0xff28('0x26')](_0x59d4ed,_0x1a790d,!![]);}catch(_0x546a92){return BPromise[_0xff28('0x27')](_0x546a92);}return _0x59d4ed[_0xff28('0x28')]();};}function saveUpdates(_0x3a7a65,_0x42aa65){return function(_0x25f05b){if(_0x25f05b){return _0x25f05b['update'](_0x3a7a65)[_0xff28('0x29')](function(_0x5ba78d){return _0x5ba78d;});}return null;};}function removeEntity(_0x5ae639,_0x2c1000){return function(_0x306785){if(_0x306785){return _0x306785[_0xff28('0x2a')]()[_0xff28('0x29')](function(){_0x5ae639[_0xff28('0x1e')](0xcc)[_0xff28('0x1f')]();});}};}function handleEntityNotFound(_0x5bba21,_0x455f31){return function(_0x132e71){if(!_0x132e71){_0x5bba21[_0xff28('0x1d')](0x194);}return _0x132e71;};}function handleError(_0x1e41a3,_0x1c4484){_0x1c4484=_0x1c4484||0x1f4;return function(_0x59cfc8){logger[_0xff28('0x2b')](_0x59cfc8[_0xff28('0x2c')]);if(_0x59cfc8[_0xff28('0x2d')]){delete _0x59cfc8[_0xff28('0x2d')];}_0x1e41a3['status'](_0x1c4484)[_0xff28('0x2e')](_0x59cfc8);};}exports['show']=function(_0xd6313,_0x39c137){var _0x519257={'raw':![],'where':{'id':_0xd6313[_0xff28('0x2f')]['id']}},_0x472301={};_0x472301['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x472301[_0xff28('0x30')]=_['keys'](_0xd6313[_0xff28('0x30')]);_0x472301[_0xff28('0x31')]=_['intersection'](_0x472301[_0xff28('0x32')],_0x472301[_0xff28('0x30')]);_0x519257[_0xff28('0x33')]=_[_0xff28('0x34')](_0x472301['model'],qs[_0xff28('0x35')](_0xd6313[_0xff28('0x30')][_0xff28('0x35')]));_0x519257[_0xff28('0x33')]=_0x519257[_0xff28('0x33')]['length']?_0x519257['attributes']:_0x472301[_0xff28('0x32')];if(_0xd6313['query'][_0xff28('0x36')]){_0x519257[_0xff28('0x37')]=[{'all':!![]}];}_0x519257=_['merge']({},_0x519257,_0xd6313[_0xff28('0x38')]);return db[_0xff28('0x39')][_0xff28('0x3a')](_0x519257)[_0xff28('0x29')](handleEntityNotFound(_0x39c137,null))[_0xff28('0x29')](respondWithResult(_0x39c137,null))['catch'](handleError(_0x39c137,null));};exports[_0xff28('0x2a')]=function(_0x11f4fd,_0x445903){return db['DashboardItem']['find']({'where':{'id':_0x11f4fd[_0xff28('0x2f')]['id']}})['then'](handleEntityNotFound(_0x445903,null))[_0xff28('0x29')](removeEntity(_0x445903,null))['catch'](handleError(_0x445903,null));};function widgetAttributes(_0x3507d3){try{switch(_0x3507d3[_0xff28('0x3b')]){case _0xff28('0x3c'):return[{'name':_0xff28('0x3d'),'value':_0x3507d3[_0xff28('0x3d')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||'https://'}];case _0xff28('0x40'):return[{'name':_0xff28('0x41'),'value':_0x3507d3[_0xff28('0x41')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||''}];case _0xff28('0x42'):return[{'name':'attrHourFormat','value':_0x3507d3[_0xff28('0x43')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||_0xff28('0x44')},{'name':_0xff28('0x45'),'value':_0x3507d3[_0xff28('0x45')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3['attrs'][0x1][_0xff28('0x3f')]:undefined)||_0xff28('0x46')},{'name':_0xff28('0x47'),'value':_0x3507d3[_0xff28('0x47')]||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2]['value']:undefined)||0xc}];case _0xff28('0x48'):return[{'name':'attrMetric','value':_0x3507d3[_0xff28('0x49')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||'total'},{'name':_0xff28('0x4a'),'value':_0x3507d3[_0xff28('0x4a')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3[_0xff28('0x3e')][0x1]['value']:undefined)||[]},{'name':_0xff28('0x47'),'value':_0x3507d3[_0xff28('0x47')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2]['value']:undefined)||0x14}];case _0xff28('0x4b'):case _0xff28('0x4c'):return[{'name':'attrSerie1','value':_0x3507d3[_0xff28('0x4d')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||_0xff28('0x4e')},{'name':_0xff28('0x4f'),'value':_0x3507d3['attrSerie2']||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3[_0xff28('0x3e')][0x1]['value']:undefined)||null},{'name':_0xff28('0x50'),'value':_0x3507d3[_0xff28('0x50')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2][_0xff28('0x3f')]:undefined)||null},{'name':_0xff28('0x4a'),'value':_0x3507d3['attrVoiceQueues']||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x3]?_0x3507d3[_0xff28('0x3e')][0x3][_0xff28('0x3f')]:undefined)||[]}];case _0xff28('0x51'):return[{'name':_0xff28('0x52'),'type':_0x3507d3['reportType']||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3b')]:undefined)||null,'value':_0x3507d3[_0xff28('0x52')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x3507d3['attrRefresh']||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x68f965){logger['error'](_0xff28('0x53'),JSON[_0xff28('0x54')](_0x68f965));return[];}}exports[_0xff28('0x55')]=function(_0x2ff2c0,_0x5e3fa5){if(_0x2ff2c0[_0xff28('0x56')]){_0x2ff2c0[_0xff28('0x56')][_0xff28('0x3e')]=widgetAttributes(_0x2ff2c0[_0xff28('0x56')]);}return db['DashboardItem'][_0xff28('0x55')](_0x2ff2c0['body'],{})[_0xff28('0x29')](respondWithResult(_0x5e3fa5,0xc9))[_0xff28('0x57')](handleError(_0x5e3fa5,null));};exports['update']=function(_0x2d5008,_0x32fdbc){if(_0x2d5008[_0xff28('0x56')]['id']){delete _0x2d5008[_0xff28('0x56')]['id'];}_0x2d5008[_0xff28('0x56')]['attrs']=widgetAttributes(_0x2d5008[_0xff28('0x56')]);return db[_0xff28('0x39')][_0xff28('0x3a')]({'where':{'id':_0x2d5008[_0xff28('0x2f')]['id']}})['then'](handleEntityNotFound(_0x32fdbc,null))[_0xff28('0x29')](saveUpdates(_0x2d5008[_0xff28('0x56')],null))[_0xff28('0x29')](respondWithResult(_0x32fdbc,null))[_0xff28('0x57')](handleError(_0x32fdbc,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e7f288e..9ec1f90 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 _0x7e74=['hook','exports','events','../../mysqldb','update','emit'];(function(_0x323023,_0x223922){var _0x19c04b=function(_0x731399){while(--_0x731399){_0x323023['push'](_0x323023['shift']());}};_0x19c04b(++_0x223922);}(_0x7e74,0x1d6));var _0x47e7=function(_0x519602,_0x405644){_0x519602=_0x519602-0x0;var _0x5934f8=_0x7e74[_0x519602];return _0x5934f8;};'use strict';var EventEmitter=require(_0x47e7('0x0'));var DashboardItem=require(_0x47e7('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x47e7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5a8774){return function(_0x3ee47a,_0x52eae5,_0x5b9f03){DashboardItemEvents[_0x47e7('0x3')](_0x5a8774+':'+_0x3ee47a['id'],_0x3ee47a);DashboardItemEvents['emit'](_0x5a8774,_0x3ee47a);_0x5b9f03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x47e7('0x4')](e,emitEvent(event));}}module[_0x47e7('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x79df=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x79df,0xee));var _0xf79d=function(_0x399483,_0x14a697){_0x399483=_0x399483-0x0;var _0x5da8b4=_0x79df[_0x399483];return _0x5da8b4;};'use strict';var EventEmitter=require(_0xf79d('0x0'));var DashboardItem=require(_0xf79d('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf79d('0x2')](0x0);var events={'afterCreate':_0xf79d('0x3'),'afterUpdate':_0xf79d('0x4'),'afterDestroy':'remove'};function emitEvent(_0xed2f6e){return function(_0xe34d08,_0x3f4ed4,_0x2e1d34){DashboardItemEvents[_0xf79d('0x5')](_0xed2f6e+':'+_0xe34d08['id'],_0xe34d08);DashboardItemEvents[_0xf79d('0x5')](_0xed2f6e,_0xe34d08);_0x2e1d34(null);};}for(var e in events){if(events[_0xf79d('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf79d('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index af22a31..297a557 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 _0x4f29=['dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x4af778,_0x2c1456){var _0x56cb60=function(_0x130dfb){while(--_0x130dfb){_0x4af778['push'](_0x4af778['shift']());}};_0x56cb60(++_0x2c1456);}(_0x4f29,0xfd));var _0x94f2=function(_0x112918,_0x527e74){_0x112918=_0x112918-0x0;var _0x1c020b=_0x4f29[_0x112918];return _0x1c020b;};'use strict';var _=require('lodash');var util=require(_0x94f2('0x0'));var logger=require(_0x94f2('0x1'))(_0x94f2('0x2'));var moment=require(_0x94f2('0x3'));var BPromise=require(_0x94f2('0x4'));var rp=require(_0x94f2('0x5'));var fs=require('fs');var path=require(_0x94f2('0x6'));var rimraf=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var attributes=require(_0x94f2('0x9'));module[_0x94f2('0xa')]=function(_0x493302,_0x5e9216){return _0x493302[_0x94f2('0xb')](_0x94f2('0xc'),attributes,{'tableName':_0x94f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4200=['../../config/logger','api','moment','bluebird','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util'];(function(_0x23f0bd,_0x4beb7e){var _0x44756a=function(_0x35b924){while(--_0x35b924){_0x23f0bd['push'](_0x23f0bd['shift']());}};_0x44756a(++_0x4beb7e);}(_0x4200,0x199));var _0x0420=function(_0x1d0be5,_0x4d7d8f){_0x1d0be5=_0x1d0be5-0x0;var _0x91c519=_0x4200[_0x1d0be5];return _0x91c519;};'use strict';var _=require('lodash');var util=require(_0x0420('0x0'));var logger=require(_0x0420('0x1'))(_0x0420('0x2'));var moment=require(_0x0420('0x3'));var BPromise=require(_0x0420('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(_0x0420('0x5'));module[_0x0420('0x6')]=function(_0x4d7002,_0x4670d6){return _0x4d7002[_0x0420('0x7')](_0x0420('0x8'),attributes,{'tableName':_0x0420('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index e939b81..ae44deb 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 _0x23b7=['info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x4b6a04,_0x4221e8){var _0x3f066d=function(_0x226349){while(--_0x226349){_0x4b6a04['push'](_0x4b6a04['shift']());}};_0x3f066d(++_0x4221e8);}(_0x23b7,0x19f));var _0x723b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23b7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x723b('0x0'));var moment=require(_0x723b('0x1'));var BPromise=require(_0x723b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x723b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x723b('0x4'));var logger=require(_0x723b('0x5'))(_0x723b('0x6'));var config=require(_0x723b('0x7'));var jayson=require(_0x723b('0x8'));var client=jayson[_0x723b('0x9')]['http']({'port':0x232a});config[_0x723b('0xa')]=_[_0x723b('0xb')](config[_0x723b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x723b('0xc'))(new Redis(config[_0x723b('0xa')]));require(_0x723b('0xd'))[_0x723b('0xe')](socket);function respondWithRpcPromise(_0x7cb856,_0x3fee5a,_0x264cd4){return new BPromise(function(_0x2d8ac8,_0x667173){return client[_0x723b('0xf')](_0x7cb856,_0x264cd4)[_0x723b('0x10')](function(_0x606422){logger[_0x723b('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3fee5a,_0x723b('0x12'));logger[_0x723b('0x13')](_0x723b('0x14'),_0x3fee5a,'request\x20sent',JSON[_0x723b('0x15')](_0x606422));if(_0x606422[_0x723b('0x16')]){if(_0x606422[_0x723b('0x16')][_0x723b('0x17')]===0x1f4){logger['error'](_0x723b('0x18'),_0x3fee5a,_0x606422['error']['message']);return _0x667173(_0x606422['error'][_0x723b('0x19')]);}logger[_0x723b('0x16')](_0x723b('0x18'),_0x3fee5a,_0x606422['error'][_0x723b('0x19')]);return _0x2d8ac8(_0x606422[_0x723b('0x16')][_0x723b('0x19')]);}else{logger[_0x723b('0x11')](_0x723b('0x18'),_0x3fee5a,_0x723b('0x12'));_0x2d8ac8(_0x606422['result'][_0x723b('0x19')]);}})[_0x723b('0x1a')](function(_0x98fddb){logger['error'](_0x723b('0x18'),_0x3fee5a,_0x98fddb);_0x667173(_0x98fddb);});});} \ No newline at end of file +var _0xc03f=['socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x3c5735,_0x1f4f53){var _0x2cd61d=function(_0x183e55){while(--_0x183e55){_0x3c5735['push'](_0x3c5735['shift']());}};_0x2cd61d(++_0x1f4f53);}(_0xc03f,0x115));var _0xfc03=function(_0x4a6c4d,_0x455768){_0x4a6c4d=_0x4a6c4d-0x0;var _0x31800b=_0xc03f[_0x4a6c4d];return _0x31800b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfc03('0x0'));var rs=require(_0xfc03('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc03('0x2'))['db'];var utils=require(_0xfc03('0x3'));var logger=require('../../config/logger')(_0xfc03('0x4'));var config=require(_0xfc03('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfc03('0x6')][_0xfc03('0x7')]({'port':0x232a});config[_0xfc03('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfc03('0x9'))(new Redis(config[_0xfc03('0x8')]));require(_0xfc03('0xa'))[_0xfc03('0xb')](socket);function respondWithRpcPromise(_0x4b7ce7,_0x2dfa43,_0x411b9f){return new BPromise(function(_0x2152c,_0xb40c53){return client['request'](_0x4b7ce7,_0x411b9f)[_0xfc03('0xc')](function(_0x1ecd8d){logger[_0xfc03('0xd')](_0xfc03('0xe'),_0x2dfa43,'request\x20sent');logger[_0xfc03('0xf')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2dfa43,'request\x20sent',JSON[_0xfc03('0x10')](_0x1ecd8d));if(_0x1ecd8d[_0xfc03('0x11')]){if(_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x12')]===0x1f4){logger['error'](_0xfc03('0xe'),_0x2dfa43,_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x13')]);return _0xb40c53(_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x13')]);}logger[_0xfc03('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2dfa43,_0x1ecd8d['error']['message']);return _0x2152c(_0x1ecd8d['error'][_0xfc03('0x13')]);}else{logger[_0xfc03('0xd')](_0xfc03('0xe'),_0x2dfa43,_0xfc03('0x14'));_0x2152c(_0x1ecd8d[_0xfc03('0x15')][_0xfc03('0x13')]);}})['catch'](function(_0x117d1f){logger[_0xfc03('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2dfa43,_0x117d1f);_0xb40c53(_0x117d1f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1ffa6d7..3ea0639 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 _0xe07b=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0xb3b49c,_0x1b6836){var _0x17e478=function(_0x50ea92){while(--_0x50ea92){_0xb3b49c['push'](_0xb3b49c['shift']());}};_0x17e478(++_0x1b6836);}(_0xe07b,0xb5));var _0xbe07=function(_0x1d4e99,_0x39bf5f){_0x1d4e99=_0x1d4e99-0x0;var _0x2bc444=_0xe07b[_0x1d4e99];return _0x2bc444;};'use strict';var DashboardItemEvents=require(_0xbe07('0x0'));var events=[_0xbe07('0x1'),_0xbe07('0x2'),'update'];function createListener(_0x178374,_0x411b22){return function(_0x3167db){_0x411b22[_0xbe07('0x3')](_0x178374,_0x3167db);};}function removeListener(_0x20dddd,_0x988053){return function(){DashboardItemEvents[_0xbe07('0x4')](_0x20dddd,_0x988053);};}exports[_0xbe07('0x5')]=function(_0x5419ef){for(var _0x2976d3=0x0,_0x5c7766=events[_0xbe07('0x6')];_0x2976d3<_0x5c7766;_0x2976d3++){var _0x486080=events[_0x2976d3];var _0xe0fdfd=createListener(_0xbe07('0x7')+_0x486080,_0x5419ef);DashboardItemEvents['on'](_0x486080,_0xe0fdfd);}}; \ No newline at end of file +var _0xdfed=['update','removeListener','register','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x14128a,_0x3762b6){var _0x2b0968=function(_0x293c7e){while(--_0x293c7e){_0x14128a['push'](_0x14128a['shift']());}};_0x2b0968(++_0x3762b6);}(_0xdfed,0x146));var _0xddfe=function(_0x15de11,_0x3cd20d){_0x15de11=_0x15de11-0x0;var _0x4f1c07=_0xdfed[_0x15de11];return _0x4f1c07;};'use strict';var DashboardItemEvents=require(_0xddfe('0x0'));var events=[_0xddfe('0x1'),_0xddfe('0x2'),_0xddfe('0x3')];function createListener(_0xc84d86,_0x5367f3){return function(_0x432e15){_0x5367f3['emit'](_0xc84d86,_0x432e15);};}function removeListener(_0xa25f8d,_0x34df63){return function(){DashboardItemEvents[_0xddfe('0x4')](_0xa25f8d,_0x34df63);};}exports[_0xddfe('0x5')]=function(_0x295904){for(var _0x3c81e4=0x0,_0x5c82b1=events['length'];_0x3c81e4<_0x5c82b1;_0x3c81e4++){var _0x3d80e6=events[_0x3c81e4];var _0x3de6f8=createListener(_0xddfe('0x6')+_0x3d80e6,_0x295904);DashboardItemEvents['on'](_0x3d80e6,_0x3de6f8);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index fb1e29f..f336e97 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 _0x28c7=['/:id','isAuthenticated','create','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x1349a6,_0x413382){var _0x39b1fb=function(_0x43fc8b){while(--_0x43fc8b){_0x1349a6['push'](_0x1349a6['shift']());}};_0x39b1fb(++_0x413382);}(_0x28c7,0x136));var _0x728c=function(_0x3a508c,_0x3c977a){_0x3a508c=_0x3a508c-0x0;var _0x4c8884=_0x28c7[_0x3a508c];return _0x4c8884;};'use strict';var multer=require(_0x728c('0x0'));var util=require(_0x728c('0x1'));var path=require(_0x728c('0x2'));var timeout=require(_0x728c('0x3'));var express=require('express');var router=express[_0x728c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x728c('0x5'));var interaction=require(_0x728c('0x6'));var config=require(_0x728c('0x7'));var controller=require(_0x728c('0x8'));router[_0x728c('0x9')](_0x728c('0xa'),auth[_0x728c('0xb')](),controller['show']);router['post']('/',auth[_0x728c('0xb')](),controller[_0x728c('0xc')]);router['put'](_0x728c('0xa'),auth[_0x728c('0xb')](),controller[_0x728c('0xd')]);router[_0x728c('0xe')](_0x728c('0xa'),auth[_0x728c('0xb')](),controller[_0x728c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x53e6=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53e6,0x66));var _0x653e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53e6[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x653e('0x0'));var util=require('util');var path=require(_0x653e('0x1'));var timeout=require(_0x653e('0x2'));var express=require('express');var router=express[_0x653e('0x3')]();var fs_extra=require(_0x653e('0x4'));var auth=require(_0x653e('0x5'));var interaction=require(_0x653e('0x6'));var config=require(_0x653e('0x7'));var controller=require(_0x653e('0x8'));router['get']('/:id',auth[_0x653e('0x9')](),controller[_0x653e('0xa')]);router[_0x653e('0xb')]('/',auth[_0x653e('0x9')](),controller['create']);router[_0x653e('0xc')](_0x653e('0xd'),auth[_0x653e('0x9')](),controller[_0x653e('0xe')]);router[_0x653e('0xf')]('/:id',auth[_0x653e('0x9')](),controller[_0x653e('0x10')]);module[_0x653e('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5a6d82f..1cda343 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 _0x36e8=['STRING','ENUM','first','second','third'];(function(_0x475fea,_0x28b47e){var _0x5ae39e=function(_0x51d37a){while(--_0x51d37a){_0x475fea['push'](_0x475fea['shift']());}};_0x5ae39e(++_0x28b47e);}(_0x36e8,0x186));var _0x836e=function(_0x48e60f,_0x5c42d2){_0x48e60f=_0x48e60f-0x0;var _0x540089=_0x36e8[_0x48e60f];return _0x540089;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x836e('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x836e('0x1')](_0x836e('0x2'),_0x836e('0x3'),_0x836e('0x4')),'allowNull':![],'defaultValue':_0x836e('0x2')},'description':{'type':Sequelize[_0x836e('0x0')]}}; \ No newline at end of file +var _0xc441=['exports','STRING','ENUM','second','third','first'];(function(_0x591d95,_0x3df684){var _0x472982=function(_0x20942b){while(--_0x20942b){_0x591d95['push'](_0x591d95['shift']());}};_0x472982(++_0x3df684);}(_0xc441,0x7e));var _0x1c44=function(_0x43c3b,_0x70b26c){_0x43c3b=_0x43c3b-0x0;var _0xba99e1=_0xc441[_0x43c3b];return _0xba99e1;};'use strict';var Sequelize=require('sequelize');module[_0x1c44('0x0')]={'name':{'type':Sequelize[_0x1c44('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x1c44('0x2')]('first',_0x1c44('0x3'),_0x1c44('0x4')),'allowNull':![],'defaultValue':_0x1c44('0x5')},'description':{'type':Sequelize[_0x1c44('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c819e77..d24090e 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 _0xb68a=['order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x45dae6,_0x477d02){var _0x50d208=function(_0x4bf081){while(--_0x4bf081){_0x45dae6['push'](_0x45dae6['shift']());}};_0x50d208(++_0x477d02);}(_0xb68a,0x1a8));var _0xab68=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0xb68a[_0x1b7ea6];return _0x4fcea6;};'use strict';var emlformat=require(_0xab68('0x0'));var rimraf=require(_0xab68('0x1'));var zipdir=require(_0xab68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab68('0x3'));var moment=require(_0xab68('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xab68('0x5'));var sox=require('sox');var csv=require(_0xab68('0x6'));var ejs=require(_0xab68('0x7'));var fs=require('fs');var fs_extra=require(_0xab68('0x8'));var _=require(_0xab68('0x9'));var squel=require(_0xab68('0xa'));var crypto=require('crypto');var jsforce=require(_0xab68('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xab68('0x6'));var querystring=require(_0xab68('0xc'));var Papa=require(_0xab68('0xd'));var Redis=require(_0xab68('0xe'));var authService=require(_0xab68('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab68('0x10'));var utils=require(_0xab68('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xab68('0x12'));var db=require(_0xab68('0x13'))['db'];function respondWithStatusCode(_0xfb31dc,_0x2c5bf4){_0x2c5bf4=_0x2c5bf4||0xcc;return function(_0x7477e2){if(_0x7477e2){return _0xfb31dc[_0xab68('0x14')](_0x2c5bf4);}return _0xfb31dc[_0xab68('0x15')](_0x2c5bf4)[_0xab68('0x16')]();};}function respondWithResult(_0x5e5c80,_0x4de1fd){_0x4de1fd=_0x4de1fd||0xc8;return function(_0x57ed9a){if(_0x57ed9a){return _0x5e5c80[_0xab68('0x15')](_0x4de1fd)[_0xab68('0x17')](_0x57ed9a);}};}function respondWithFilteredResult(_0x320f10,_0x314ee1){return function(_0x96212b){if(_0x96212b){var _0x35a7d5=typeof _0x314ee1[_0xab68('0x18')]===_0xab68('0x19')&&typeof _0x314ee1[_0xab68('0x1a')]===_0xab68('0x19');var _0x4e8cd6=_0x96212b[_0xab68('0x1b')];var _0x3c8222=_0x35a7d5?0x0:_0x314ee1['offset'];var _0x255535=_0x35a7d5?_0x96212b[_0xab68('0x1b')]:_0x314ee1['offset']+_0x314ee1[_0xab68('0x1a')];var _0x4f7d7d;if(_0x255535>=_0x4e8cd6){_0x255535=_0x4e8cd6;_0x4f7d7d=0xc8;}else{_0x4f7d7d=0xce;}_0x320f10[_0xab68('0x15')](_0x4f7d7d);return _0x320f10['set']('Content-Range',_0x3c8222+'-'+_0x255535+'/'+_0x4e8cd6)[_0xab68('0x17')](_0x96212b);}return null;};}function patchUpdates(_0x4b6227){return function(_0x3b3c75){try{jsonpatch[_0xab68('0x1c')](_0x3b3c75,_0x4b6227,!![]);}catch(_0x2fc698){return BPromise[_0xab68('0x1d')](_0x2fc698);}return _0x3b3c75[_0xab68('0x1e')]();};}function saveUpdates(_0x2d96d8,_0x476f09){return function(_0xe018b8){if(_0xe018b8){return _0xe018b8[_0xab68('0x1f')](_0x2d96d8)[_0xab68('0x20')](function(_0x39a174){return _0x39a174;});}return null;};}function removeEntity(_0x15b319,_0x1c6fcc){return function(_0x24d37b){if(_0x24d37b){return _0x24d37b[_0xab68('0x21')]()[_0xab68('0x20')](function(){var _0xb52f87=_0x24d37b[_0xab68('0x22')]({'plain':!![]});var _0x32a396=_0xab68('0x23');return db[_0xab68('0x24')][_0xab68('0x21')]({'where':{'type':_0x32a396,'resourceId':_0xb52f87['id']}})[_0xab68('0x20')](function(){return _0x24d37b;});})['then'](function(){_0x15b319['status'](0xcc)[_0xab68('0x16')]();});}};}function handleEntityNotFound(_0x177088,_0x14e737){return function(_0x3d28ed){if(!_0x3d28ed){_0x177088[_0xab68('0x14')](0x194);}return _0x3d28ed;};}function handleError(_0x410c90,_0x3f53f7){_0x3f53f7=_0x3f53f7||0x1f4;return function(_0x3dd36d){logger[_0xab68('0x25')](_0x3dd36d[_0xab68('0x26')]);if(_0x3dd36d[_0xab68('0x27')]){delete _0x3dd36d['name'];}_0x410c90[_0xab68('0x15')](_0x3f53f7)['send'](_0x3dd36d);};}exports[_0xab68('0x28')]=function(_0x329aac,_0x2def87){var _0x1e1d99={},_0xc472f8={},_0x68f102={'count':0x0,'rows':[]};var _0x3580bf=_[_0xab68('0x29')](db[_0xab68('0x2a')][_0xab68('0x2b')],function(_0x6c648d){return{'name':_0x6c648d[_0xab68('0x2c')],'type':_0x6c648d[_0xab68('0x2d')][_0xab68('0x2e')]};});_0xc472f8[_0xab68('0x2f')]=_[_0xab68('0x29')](_0x3580bf,_0xab68('0x27'));_0xc472f8['query']=_[_0xab68('0x30')](_0x329aac[_0xab68('0x31')]);_0xc472f8[_0xab68('0x32')]=_[_0xab68('0x33')](_0xc472f8[_0xab68('0x2f')],_0xc472f8[_0xab68('0x31')]);_0x1e1d99['attributes']=_['intersection'](_0xc472f8[_0xab68('0x2f')],qs[_0xab68('0x34')](_0x329aac['query']['fields']));_0x1e1d99['attributes']=_0x1e1d99[_0xab68('0x35')][_0xab68('0x36')]?_0x1e1d99[_0xab68('0x35')]:_0xc472f8[_0xab68('0x2f')];if(!_0x329aac[_0xab68('0x31')][_0xab68('0x37')]('nolimit')){_0x1e1d99[_0xab68('0x1a')]=qs[_0xab68('0x1a')](_0x329aac[_0xab68('0x31')]['limit']);_0x1e1d99[_0xab68('0x18')]=qs['offset'](_0x329aac['query']['offset']);}_0x1e1d99[_0xab68('0x38')]=qs[_0xab68('0x39')](_0x329aac[_0xab68('0x31')]['sort']);_0x1e1d99['where']=qs[_0xab68('0x32')](_['pick'](_0x329aac[_0xab68('0x31')],_0xc472f8[_0xab68('0x32')]),_0x3580bf);if(_0x329aac[_0xab68('0x31')][_0xab68('0x3a')]){_0x1e1d99[_0xab68('0x3b')]=_[_0xab68('0x3c')](_0x1e1d99[_0xab68('0x3b')],{'$or':_[_0xab68('0x29')](_0x3580bf,function(_0x33f259){if(_0x33f259['type']!==_0xab68('0x3d')){var _0x4ea895={};_0x4ea895[_0x33f259[_0xab68('0x27')]]={'$like':'%'+_0x329aac['query'][_0xab68('0x3a')]+'%'};return _0x4ea895;}})});}_0x1e1d99=_[_0xab68('0x3c')]({},_0x1e1d99,_0x329aac[_0xab68('0x3e')]);var _0xc9758a={'where':_0x1e1d99[_0xab68('0x3b')]};return db[_0xab68('0x2a')][_0xab68('0x1b')](_0xc9758a)[_0xab68('0x20')](function(_0x287c56){_0x68f102[_0xab68('0x1b')]=_0x287c56;if(_0x329aac[_0xab68('0x31')][_0xab68('0x3f')]){_0x1e1d99[_0xab68('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xab68('0x41')](_0x1e1d99);})[_0xab68('0x20')](function(_0x1615de){_0x68f102[_0xab68('0x42')]=_0x1615de;return _0x68f102;})['then'](respondWithFilteredResult(_0x2def87,_0x1e1d99))[_0xab68('0x43')](handleError(_0x2def87,null));};exports[_0xab68('0x44')]=function(_0xe46139,_0x5ce3de){var _0x738583={'raw':!![],'where':{'id':_0xe46139[_0xab68('0x45')]['id']}},_0x5dacfd={};_0x5dacfd['model']=_['keys'](db[_0xab68('0x2a')][_0xab68('0x2b')]);_0x5dacfd[_0xab68('0x31')]=_[_0xab68('0x30')](_0xe46139['query']);_0x5dacfd['filters']=_['intersection'](_0x5dacfd[_0xab68('0x2f')],_0x5dacfd[_0xab68('0x31')]);_0x738583[_0xab68('0x35')]=_[_0xab68('0x33')](_0x5dacfd[_0xab68('0x2f')],qs[_0xab68('0x34')](_0xe46139['query'][_0xab68('0x34')]));_0x738583[_0xab68('0x35')]=_0x738583[_0xab68('0x35')][_0xab68('0x36')]?_0x738583[_0xab68('0x35')]:_0x5dacfd[_0xab68('0x2f')];if(_0xe46139[_0xab68('0x31')][_0xab68('0x3f')]){_0x738583[_0xab68('0x40')]=[{'all':!![]}];}_0x738583=_[_0xab68('0x3c')]({},_0x738583,_0xe46139[_0xab68('0x3e')]);return db[_0xab68('0x2a')]['find'](_0x738583)[_0xab68('0x20')](handleEntityNotFound(_0x5ce3de,null))[_0xab68('0x20')](respondWithResult(_0x5ce3de,null))[_0xab68('0x43')](handleError(_0x5ce3de,null));};exports[_0xab68('0x46')]=function(_0x37e682,_0x2956e6){return db[_0xab68('0x2a')][_0xab68('0x46')](_0x37e682[_0xab68('0x47')],{})[_0xab68('0x20')](function(_0x1d89c5){var _0x4f2595=_0x37e682[_0xab68('0x48')]['get']({'plain':!![]});if(!_0x4f2595)throw new Error(_0xab68('0x49'));if(_0x4f2595[_0xab68('0x4a')]===_0xab68('0x48')){var _0x1e8b01=_0x1d89c5[_0xab68('0x22')]({'plain':!![]});var _0x4f328a='Dispositions';return db[_0xab68('0x4b')]['find']({'where':{'name':_0x4f328a,'userProfileId':_0x4f2595[_0xab68('0x4c')]},'raw':!![]})[_0xab68('0x20')](function(_0x33329f){if(_0x33329f&&_0x33329f[_0xab68('0x4d')]===0x0){return db[_0xab68('0x24')]['create']({'name':_0x1e8b01[_0xab68('0x27')],'resourceId':_0x1e8b01['id'],'type':_0x33329f[_0xab68('0x27')],'sectionId':_0x33329f['id']},{})[_0xab68('0x20')](function(){return _0x1d89c5;});}else{return _0x1d89c5;}})[_0xab68('0x43')](function(_0x5cccb1){logger[_0xab68('0x25')](_0xab68('0x4e'),_0x5cccb1);throw _0x5cccb1;});}return _0x1d89c5;})[_0xab68('0x20')](respondWithResult(_0x2956e6,0xc9))[_0xab68('0x43')](handleError(_0x2956e6,null));};exports[_0xab68('0x1f')]=function(_0x26345e,_0x31ebe4){if(_0x26345e[_0xab68('0x47')]['id']){delete _0x26345e[_0xab68('0x47')]['id'];}return db[_0xab68('0x2a')][_0xab68('0x4f')]({'where':{'id':_0x26345e[_0xab68('0x45')]['id']}})[_0xab68('0x20')](handleEntityNotFound(_0x31ebe4,null))[_0xab68('0x20')](saveUpdates(_0x26345e['body'],null))['then'](respondWithResult(_0x31ebe4,null))[_0xab68('0x43')](handleError(_0x31ebe4,null));};exports[_0xab68('0x21')]=function(_0x141a95,_0x4bd918){return db[_0xab68('0x2a')]['find']({'where':{'id':_0x141a95[_0xab68('0x45')]['id']}})[_0xab68('0x20')](handleEntityNotFound(_0x4bd918,null))['then'](removeEntity(_0x4bd918,null))[_0xab68('0x43')](handleError(_0x4bd918,null));}; \ No newline at end of file +var _0x4330=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x4330,0x13d));var _0x0433=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4330[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x0433('0x0'));var rimraf=require(_0x0433('0x1'));var zipdir=require(_0x0433('0x2'));var jsonpatch=require(_0x0433('0x3'));var rp=require(_0x0433('0x4'));var moment=require(_0x0433('0x5'));var BPromise=require(_0x0433('0x6'));var Mustache=require(_0x0433('0x7'));var util=require(_0x0433('0x8'));var path=require(_0x0433('0x9'));var sox=require(_0x0433('0xa'));var csv=require(_0x0433('0xb'));var ejs=require(_0x0433('0xc'));var fs=require('fs');var fs_extra=require(_0x0433('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0433('0xe'));var jsforce=require(_0x0433('0xf'));var deskjs=require(_0x0433('0x10'));var toCsv=require(_0x0433('0xb'));var querystring=require(_0x0433('0x11'));var Papa=require('papaparse');var Redis=require(_0x0433('0x12'));var authService=require(_0x0433('0x13'));var qs=require(_0x0433('0x14'));var as=require(_0x0433('0x15'));var hardwareService=require(_0x0433('0x16'));var logger=require(_0x0433('0x17'))('api');var utils=require(_0x0433('0x18'));var config=require(_0x0433('0x19'));var licenseUtil=require(_0x0433('0x1a'));var db=require(_0x0433('0x1b'))['db'];function respondWithStatusCode(_0x49a14e,_0x5a1edc){_0x5a1edc=_0x5a1edc||0xcc;return function(_0x5b629e){if(_0x5b629e){return _0x49a14e[_0x0433('0x1c')](_0x5a1edc);}return _0x49a14e[_0x0433('0x1d')](_0x5a1edc)[_0x0433('0x1e')]();};}function respondWithResult(_0x562a4e,_0x2203f4){_0x2203f4=_0x2203f4||0xc8;return function(_0x219cde){if(_0x219cde){return _0x562a4e[_0x0433('0x1d')](_0x2203f4)[_0x0433('0x1f')](_0x219cde);}};}function respondWithFilteredResult(_0x3cb569,_0x343c5a){return function(_0x10ab77){if(_0x10ab77){var _0x3cf0e8=typeof _0x343c5a[_0x0433('0x20')]===_0x0433('0x21')&&typeof _0x343c5a[_0x0433('0x22')]===_0x0433('0x21');var _0x4ab561=_0x10ab77[_0x0433('0x23')];var _0x5accf5=_0x3cf0e8?0x0:_0x343c5a['offset'];var _0x2dccbc=_0x3cf0e8?_0x10ab77[_0x0433('0x23')]:_0x343c5a[_0x0433('0x20')]+_0x343c5a['limit'];var _0x11002e;if(_0x2dccbc>=_0x4ab561){_0x2dccbc=_0x4ab561;_0x11002e=0xc8;}else{_0x11002e=0xce;}_0x3cb569[_0x0433('0x1d')](_0x11002e);return _0x3cb569[_0x0433('0x24')](_0x0433('0x25'),_0x5accf5+'-'+_0x2dccbc+'/'+_0x4ab561)['json'](_0x10ab77);}return null;};}function patchUpdates(_0x3e09cd){return function(_0x30bca5){try{jsonpatch[_0x0433('0x26')](_0x30bca5,_0x3e09cd,!![]);}catch(_0x38d1d4){return BPromise[_0x0433('0x27')](_0x38d1d4);}return _0x30bca5['save']();};}function saveUpdates(_0x5048a1,_0x55bdba){return function(_0x7577b0){if(_0x7577b0){return _0x7577b0[_0x0433('0x28')](_0x5048a1)[_0x0433('0x29')](function(_0x272b91){return _0x272b91;});}return null;};}function removeEntity(_0x956d,_0x32e035){return function(_0x36bd8b){if(_0x36bd8b){return _0x36bd8b[_0x0433('0x2a')]()[_0x0433('0x29')](function(){var _0x24f1e2=_0x36bd8b[_0x0433('0x2b')]({'plain':!![]});var _0x5007a9=_0x0433('0x2c');return db[_0x0433('0x2d')]['destroy']({'where':{'type':_0x5007a9,'resourceId':_0x24f1e2['id']}})['then'](function(){return _0x36bd8b;});})[_0x0433('0x29')](function(){_0x956d[_0x0433('0x1d')](0xcc)[_0x0433('0x1e')]();});}};}function handleEntityNotFound(_0x2237da,_0x14cf16){return function(_0x18b840){if(!_0x18b840){_0x2237da[_0x0433('0x1c')](0x194);}return _0x18b840;};}function handleError(_0x2d08cf,_0x3b6f39){_0x3b6f39=_0x3b6f39||0x1f4;return function(_0x3ae499){logger['error'](_0x3ae499[_0x0433('0x2e')]);if(_0x3ae499[_0x0433('0x2f')]){delete _0x3ae499[_0x0433('0x2f')];}_0x2d08cf['status'](_0x3b6f39)[_0x0433('0x30')](_0x3ae499);};}exports[_0x0433('0x31')]=function(_0x3df239,_0x2d47b8){var _0x338c4e={},_0xc2aa92={},_0x115c72={'count':0x0,'rows':[]};var _0x18dc44=_[_0x0433('0x32')](db[_0x0433('0x33')][_0x0433('0x34')],function(_0x21da5d){return{'name':_0x21da5d[_0x0433('0x35')],'type':_0x21da5d[_0x0433('0x36')][_0x0433('0x37')]};});_0xc2aa92[_0x0433('0x38')]=_['map'](_0x18dc44,_0x0433('0x2f'));_0xc2aa92['query']=_[_0x0433('0x39')](_0x3df239[_0x0433('0x3a')]);_0xc2aa92[_0x0433('0x3b')]=_['intersection'](_0xc2aa92[_0x0433('0x38')],_0xc2aa92[_0x0433('0x3a')]);_0x338c4e['attributes']=_[_0x0433('0x3c')](_0xc2aa92['model'],qs['fields'](_0x3df239[_0x0433('0x3a')][_0x0433('0x3d')]));_0x338c4e['attributes']=_0x338c4e['attributes'][_0x0433('0x3e')]?_0x338c4e[_0x0433('0x3f')]:_0xc2aa92[_0x0433('0x38')];if(!_0x3df239[_0x0433('0x3a')]['hasOwnProperty']('nolimit')){_0x338c4e[_0x0433('0x22')]=qs[_0x0433('0x22')](_0x3df239[_0x0433('0x3a')][_0x0433('0x22')]);_0x338c4e['offset']=qs[_0x0433('0x20')](_0x3df239[_0x0433('0x3a')][_0x0433('0x20')]);}_0x338c4e['order']=qs[_0x0433('0x40')](_0x3df239[_0x0433('0x3a')][_0x0433('0x40')]);_0x338c4e[_0x0433('0x41')]=qs[_0x0433('0x3b')](_[_0x0433('0x42')](_0x3df239[_0x0433('0x3a')],_0xc2aa92['filters']),_0x18dc44);if(_0x3df239[_0x0433('0x3a')][_0x0433('0x43')]){_0x338c4e[_0x0433('0x41')]=_['merge'](_0x338c4e[_0x0433('0x41')],{'$or':_[_0x0433('0x32')](_0x18dc44,function(_0x30851b){if(_0x30851b['type']!=='VIRTUAL'){var _0x192f5c={};_0x192f5c[_0x30851b['name']]={'$like':'%'+_0x3df239[_0x0433('0x3a')][_0x0433('0x43')]+'%'};return _0x192f5c;}})});}_0x338c4e=_[_0x0433('0x44')]({},_0x338c4e,_0x3df239['options']);var _0x4f45e5={'where':_0x338c4e[_0x0433('0x41')]};return db[_0x0433('0x33')][_0x0433('0x23')](_0x4f45e5)[_0x0433('0x29')](function(_0xd628b7){_0x115c72[_0x0433('0x23')]=_0xd628b7;if(_0x3df239[_0x0433('0x3a')]['includeAll']){_0x338c4e[_0x0433('0x45')]=[{'all':!![]}];}return db['Disposition'][_0x0433('0x46')](_0x338c4e);})[_0x0433('0x29')](function(_0x582187){_0x115c72[_0x0433('0x47')]=_0x582187;return _0x115c72;})[_0x0433('0x29')](respondWithFilteredResult(_0x2d47b8,_0x338c4e))[_0x0433('0x48')](handleError(_0x2d47b8,null));};exports[_0x0433('0x49')]=function(_0x4ac64b,_0x5c0a49){var _0x232f28={'raw':!![],'where':{'id':_0x4ac64b[_0x0433('0x4a')]['id']}},_0x1ac739={};_0x1ac739[_0x0433('0x38')]=_[_0x0433('0x39')](db[_0x0433('0x33')][_0x0433('0x34')]);_0x1ac739['query']=_['keys'](_0x4ac64b[_0x0433('0x3a')]);_0x1ac739[_0x0433('0x3b')]=_[_0x0433('0x3c')](_0x1ac739['model'],_0x1ac739[_0x0433('0x3a')]);_0x232f28[_0x0433('0x3f')]=_[_0x0433('0x3c')](_0x1ac739[_0x0433('0x38')],qs['fields'](_0x4ac64b['query'][_0x0433('0x3d')]));_0x232f28[_0x0433('0x3f')]=_0x232f28[_0x0433('0x3f')][_0x0433('0x3e')]?_0x232f28[_0x0433('0x3f')]:_0x1ac739[_0x0433('0x38')];if(_0x4ac64b[_0x0433('0x3a')][_0x0433('0x4b')]){_0x232f28[_0x0433('0x45')]=[{'all':!![]}];}_0x232f28=_[_0x0433('0x44')]({},_0x232f28,_0x4ac64b[_0x0433('0x4c')]);return db['Disposition']['find'](_0x232f28)[_0x0433('0x29')](handleEntityNotFound(_0x5c0a49,null))[_0x0433('0x29')](respondWithResult(_0x5c0a49,null))[_0x0433('0x48')](handleError(_0x5c0a49,null));};exports['create']=function(_0x3df294,_0x58fbc4){return db[_0x0433('0x33')][_0x0433('0x4d')](_0x3df294[_0x0433('0x4e')],{})[_0x0433('0x29')](function(_0xcb250d){var _0x464248=_0x3df294[_0x0433('0x4f')]['get']({'plain':!![]});if(!_0x464248)throw new Error(_0x0433('0x50'));if(_0x464248[_0x0433('0x51')]===_0x0433('0x4f')){var _0x1c82cc=_0xcb250d[_0x0433('0x2b')]({'plain':!![]});var _0x7d7b66=_0x0433('0x2c');return db[_0x0433('0x52')][_0x0433('0x53')]({'where':{'name':_0x7d7b66,'userProfileId':_0x464248['userProfileId']},'raw':!![]})[_0x0433('0x29')](function(_0x1f5a70){if(_0x1f5a70&&_0x1f5a70['autoAssociation']===0x0){return db[_0x0433('0x2d')][_0x0433('0x4d')]({'name':_0x1c82cc['name'],'resourceId':_0x1c82cc['id'],'type':_0x1f5a70['name'],'sectionId':_0x1f5a70['id']},{})[_0x0433('0x29')](function(){return _0xcb250d;});}else{return _0xcb250d;}})['catch'](function(_0x5afb79){logger[_0x0433('0x54')](_0x0433('0x55'),_0x5afb79);throw _0x5afb79;});}return _0xcb250d;})[_0x0433('0x29')](respondWithResult(_0x58fbc4,0xc9))[_0x0433('0x48')](handleError(_0x58fbc4,null));};exports[_0x0433('0x28')]=function(_0x137960,_0x131a48){if(_0x137960['body']['id']){delete _0x137960[_0x0433('0x4e')]['id'];}return db[_0x0433('0x33')][_0x0433('0x53')]({'where':{'id':_0x137960[_0x0433('0x4a')]['id']}})[_0x0433('0x29')](handleEntityNotFound(_0x131a48,null))[_0x0433('0x29')](saveUpdates(_0x137960[_0x0433('0x4e')],null))['then'](respondWithResult(_0x131a48,null))[_0x0433('0x48')](handleError(_0x131a48,null));};exports[_0x0433('0x2a')]=function(_0x113c13,_0xb31d86){return db[_0x0433('0x33')]['find']({'where':{'id':_0x113c13[_0x0433('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb31d86,null))['then'](removeEntity(_0xb31d86,null))[_0x0433('0x48')](handleError(_0xb31d86,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2c87deb..a1f7d58 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 _0x83fa=['rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44cf8a,_0x25b667){var _0x41d2e3=function(_0xe5e566){while(--_0xe5e566){_0x44cf8a['push'](_0x44cf8a['shift']());}};_0x41d2e3(++_0x25b667);}(_0x83fa,0x124));var _0xa83f=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x83fa[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xa83f('0x0'));var util=require(_0xa83f('0x1'));var logger=require(_0xa83f('0x2'))(_0xa83f('0x3'));var moment=require(_0xa83f('0x4'));var BPromise=require(_0xa83f('0x5'));var rp=require(_0xa83f('0x6'));var fs=require('fs');var path=require(_0xa83f('0x7'));var rimraf=require(_0xa83f('0x8'));var config=require(_0xa83f('0x9'));var attributes=require(_0xa83f('0xa'));module[_0xa83f('0xb')]=function(_0x15e71c,_0x1c9d9c){return _0x15e71c['define'](_0xa83f('0xc'),attributes,{'tableName':_0xa83f('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa83f('0xe'),'fields':[_0xa83f('0xf'),_0xa83f('0x10')]},{'unique':!![],'name':_0xa83f('0x11'),'fields':[_0xa83f('0xf'),_0xa83f('0x12')]},{'unique':!![],'name':_0xa83f('0x13'),'fields':[_0xa83f('0xf'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0xa83f('0x14')]},{'unique':!![],'name':_0xa83f('0x15'),'fields':[_0xa83f('0xf'),'FaxAccountId']},{'unique':!![],'name':_0xa83f('0x16'),'fields':[_0xa83f('0xf'),_0xa83f('0x17')]},{'unique':!![],'name':_0xa83f('0x18'),'fields':[_0xa83f('0xf'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x62ff=['FaxAccountId','name_openchannel','WhatsappAccountId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax'];(function(_0x4da5cc,_0x8e2c43){var _0x312ab0=function(_0x2ebe04){while(--_0x2ebe04){_0x4da5cc['push'](_0x4da5cc['shift']());}};_0x312ab0(++_0x8e2c43);}(_0x62ff,0x168));var _0xf62f=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x62ff[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf62f('0x0'))(_0xf62f('0x1'));var moment=require(_0xf62f('0x2'));var BPromise=require(_0xf62f('0x3'));var rp=require(_0xf62f('0x4'));var fs=require('fs');var path=require(_0xf62f('0x5'));var rimraf=require(_0xf62f('0x6'));var config=require(_0xf62f('0x7'));var attributes=require(_0xf62f('0x8'));module[_0xf62f('0x9')]=function(_0xf72377,_0xdd7068){return _0xf72377['define'](_0xf62f('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf62f('0xb'),'fields':[_0xf62f('0xc'),'ListId']},{'unique':!![],'name':_0xf62f('0xd'),'fields':['name',_0xf62f('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xf62f('0xc'),_0xf62f('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0xf62f('0xc'),_0xf62f('0x10')]},{'unique':!![],'name':_0xf62f('0x11'),'fields':[_0xf62f('0xc'),_0xf62f('0x12')]},{'unique':!![],'name':_0xf62f('0x13'),'fields':[_0xf62f('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xf62f('0xc'),_0xf62f('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2048be2..ef30ffc 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(_0x347c6e,_0x44734a){var _0x71af73=function(_0x112428){while(--_0x112428){_0x347c6e['push'](_0x347c6e['shift']());}};_0x71af73(++_0x44734a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x577822,_0x5b3c71){var _0x51a44b=function(_0xb11fab){while(--_0xb11fab){_0x577822['push'](_0x577822['shift']());}};_0x51a44b(++_0x5b3c71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 10da2b9..56f2a7c 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 _0x7d3a=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x36a5a6,_0xd81f60){var _0x2afb6c=function(_0x2f53c8){while(--_0x2f53c8){_0x36a5a6['push'](_0x36a5a6['shift']());}};_0x2afb6c(++_0xd81f60);}(_0x7d3a,0x17a));var _0xa7d3=function(_0x19dd8a,_0x4af545){_0x19dd8a=_0x19dd8a-0x0;var _0x6245d3=_0x7d3a[_0x19dd8a];return _0x6245d3;};'use strict';var multer=require(_0xa7d3('0x0'));var util=require(_0xa7d3('0x1'));var path=require(_0xa7d3('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7d3('0x3'));var router=express[_0xa7d3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa7d3('0x5'));var interaction=require(_0xa7d3('0x6'));var config=require('../../config/environment');var controller=require(_0xa7d3('0x7'));router[_0xa7d3('0x8')]('/',auth[_0xa7d3('0x9')](),controller[_0xa7d3('0xa')]);router['get'](_0xa7d3('0xb'),auth[_0xa7d3('0x9')](),controller[_0xa7d3('0xc')]);router[_0xa7d3('0xd')]('/',auth[_0xa7d3('0x9')](),controller[_0xa7d3('0xe')]);router[_0xa7d3('0xf')](_0xa7d3('0xb'),auth[_0xa7d3('0x9')](),controller[_0xa7d3('0x10')]);router['delete'](_0xa7d3('0xb'),auth[_0xa7d3('0x9')](),controller[_0xa7d3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0876=['util','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','create','put','update','delete','destroy','multer'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0876,0xb5));var _0x6087=function(_0x506b34,_0x1ab9ca){_0x506b34=_0x506b34-0x0;var _0x4b0465=_0x0876[_0x506b34];return _0x4b0465;};'use strict';var multer=require(_0x6087('0x0'));var util=require(_0x6087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6087('0x2')]();var fs_extra=require(_0x6087('0x3'));var auth=require(_0x6087('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6087('0x5'));var controller=require('./disposition.controller');router[_0x6087('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6087('0x6')](_0x6087('0x7'),auth[_0x6087('0x8')](),controller['show']);router['post']('/',auth[_0x6087('0x8')](),controller[_0x6087('0x9')]);router[_0x6087('0xa')]('/:id',auth[_0x6087('0x8')](),controller[_0x6087('0xb')]);router[_0x6087('0xc')](_0x6087('0x7'),auth[_0x6087('0x8')](),controller[_0x6087('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9af1b25..b0a0cd0 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 _0xdde9=['9600','12000','4800','14400','INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','localstationid','2400','7200'];(function(_0x272874,_0x2b9634){var _0x5dc42b=function(_0x3656d8){while(--_0x3656d8){_0x272874['push'](_0x272874['shift']());}};_0x5dc42b(++_0x2b9634);}(_0xdde9,0x1b0));var _0x9dde=function(_0x50773d,_0x38736a){_0x50773d=_0x50773d-0x0;var _0x1be68a=_0xdde9[_0x50773d];return _0x1be68a;};'use strict';var Sequelize=require(_0x9dde('0x0'));module[_0x9dde('0x1')]={'name':{'type':Sequelize[_0x9dde('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9dde('0x2')]},'ecm':{'type':Sequelize[_0x9dde('0x3')](_0x9dde('0x4'),'no'),'defaultValue':_0x9dde('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x9dde('0x2')],'unique':_0x9dde('0x5')},'minrate':{'type':Sequelize[_0x9dde('0x3')](_0x9dde('0x6'),'4800',_0x9dde('0x7'),_0x9dde('0x8'),_0x9dde('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x9dde('0x3')](_0x9dde('0x6'),_0x9dde('0xa'),_0x9dde('0x7'),_0x9dde('0x8'),_0x9dde('0x9'),'14400'),'defaultValue':_0x9dde('0xb')},'modem':{'type':Sequelize[_0x9dde('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x9dde('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9dde('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9dde('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x9dde('0xd'),_0x9dde('0xe'),_0x9dde('0xf')),'defaultValue':_0x9dde('0x10')},'key':{'type':Sequelize[_0x9dde('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9dde('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9dde('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9dde('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9dde('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9dde('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9dde('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x9dde('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x9dde('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x48ec4f){if(!_0x48ec4f)this['setDataValue'](_0x9dde('0x14'),null);this[_0x9dde('0x15')]('mandatoryDisposition',_0x48ec4f);}}}; \ No newline at end of file +var _0xe44b=['KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','localstationid','4800','7200','2400','12000','14400','INTEGER','SIP','IAX','DADHI'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe44b,0xc3));var _0xbe44=function(_0x3b7714,_0x488818){_0x3b7714=_0x3b7714-0x0;var _0xee5952=_0xe44b[_0x3b7714];return _0xee5952;};'use strict';var Sequelize=require('sequelize');module[_0xbe44('0x0')]={'name':{'type':Sequelize[_0xbe44('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe44('0x1')]},'ecm':{'type':Sequelize[_0xbe44('0x2')](_0xbe44('0x3'),'no'),'defaultValue':_0xbe44('0x3')},'headerinfo':{'type':Sequelize[_0xbe44('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xbe44('0x1')],'unique':_0xbe44('0x4')},'minrate':{'type':Sequelize[_0xbe44('0x2')]('2400',_0xbe44('0x5'),_0xbe44('0x6'),'9600','12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xbe44('0x7'),_0xbe44('0x5'),_0xbe44('0x6'),'9600',_0xbe44('0x8'),_0xbe44('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xbe44('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbe44('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[_0xbe44('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xbe44('0xb'),_0xbe44('0xc'),_0xbe44('0xd'),_0xbe44('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xbe44('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbe44('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d0a6f){if(!_0x2d0a6f)this[_0xbe44('0x11')](_0xbe44('0x12'),null);this[_0xbe44('0x11')]('mandatoryDisposition',_0x2d0a6f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 28eba7f..7cabb99 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 _0x0aee=['fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','params','Pause','mandatoryDispositionPause','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','Disposition','getDispositions','findOne','order','removeDispositions','getAnswers','CannedAnswer','FaxAccountId','removeAnswers','ids','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','headerinfo','maxrate','minrate','modem','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3d1877,_0x3e98a7){var _0x1a3a70=function(_0x3efdca){while(--_0x3efdca){_0x3d1877['push'](_0x3d1877['shift']());}};_0x1a3a70(++_0x3e98a7);}(_0x0aee,0xb5));var _0xe0ae=function(_0x3e06dd,_0x55694f){_0x3e06dd=_0x3e06dd-0x0;var _0x4bbb8b=_0x0aee[_0x3e06dd];return _0x4bbb8b;};'use strict';var emlformat=require(_0xe0ae('0x0'));var rimraf=require(_0xe0ae('0x1'));var zipdir=require(_0xe0ae('0x2'));var jsonpatch=require(_0xe0ae('0x3'));var rp=require(_0xe0ae('0x4'));var moment=require(_0xe0ae('0x5'));var BPromise=require(_0xe0ae('0x6'));var Mustache=require(_0xe0ae('0x7'));var util=require(_0xe0ae('0x8'));var path=require(_0xe0ae('0x9'));var sox=require(_0xe0ae('0xa'));var csv=require(_0xe0ae('0xb'));var ejs=require(_0xe0ae('0xc'));var fs=require('fs');var fs_extra=require(_0xe0ae('0xd'));var _=require(_0xe0ae('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe0ae('0xf'));var toCsv=require(_0xe0ae('0xb'));var querystring=require(_0xe0ae('0x10'));var Papa=require(_0xe0ae('0x11'));var Redis=require(_0xe0ae('0x12'));var authService=require(_0xe0ae('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe0ae('0x14'));var hardwareService=require(_0xe0ae('0x15'));var logger=require(_0xe0ae('0x16'))(_0xe0ae('0x17'));var utils=require('../../config/utils');var config=require(_0xe0ae('0x18'));var licenseUtil=require(_0xe0ae('0x19'));var db=require(_0xe0ae('0x1a'))['db'];config[_0xe0ae('0x1b')]=_[_0xe0ae('0x1c')](config[_0xe0ae('0x1b')],{'host':_0xe0ae('0x1d'),'port':0x18eb});var socket=require(_0xe0ae('0x1e'))(new Redis(config[_0xe0ae('0x1b')]));require('./faxAccount.socket')[_0xe0ae('0x1f')](socket);var jayson=require(_0xe0ae('0x20'));var client=jayson[_0xe0ae('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xe0ae('0x21')][_0xe0ae('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x46091e,_0x4a6275,_0x1bb5f6,_0x5c5c88){return new BPromise(function(_0x4bc80c,_0x390daf){var _0x31b95a=_0x5c5c88||client;return _0x31b95a[_0xe0ae('0x23')](_0x46091e,_0x1bb5f6)[_0xe0ae('0x24')](function(_0x496e5c){logger[_0xe0ae('0x25')](_0xe0ae('0x26'),_0x4a6275,_0xe0ae('0x27'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4a6275,_0xe0ae('0x27'),JSON[_0xe0ae('0x28')](_0x496e5c));if(_0x496e5c[_0xe0ae('0x29')]){if(_0x496e5c['error']['code']===0x1f4){logger['error'](_0xe0ae('0x26'),_0x4a6275,_0x496e5c[_0xe0ae('0x29')][_0xe0ae('0x2a')]);return _0x390daf(_0x496e5c[_0xe0ae('0x29')][_0xe0ae('0x2a')]);}logger[_0xe0ae('0x29')](_0xe0ae('0x26'),_0x4a6275,_0x496e5c[_0xe0ae('0x29')]['message']);return _0x4bc80c(_0x496e5c[_0xe0ae('0x29')][_0xe0ae('0x2a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4a6275,_0xe0ae('0x27'));_0x4bc80c(_0x496e5c['result'][_0xe0ae('0x2a')]);}})[_0xe0ae('0x2b')](function(_0x43c19b){logger['error'](_0xe0ae('0x26'),_0x4a6275,_0x43c19b);_0x390daf(_0x43c19b);});});}function respondWithStatusCode(_0x2b598f,_0x45dba0){_0x45dba0=_0x45dba0||0xcc;return function(_0x54343b){if(_0x54343b){return _0x2b598f[_0xe0ae('0x2c')](_0x45dba0);}return _0x2b598f[_0xe0ae('0x2d')](_0x45dba0)[_0xe0ae('0x2e')]();};}function respondWithResult(_0x59e6f4,_0x59405c){_0x59405c=_0x59405c||0xc8;return function(_0x651250){if(_0x651250){return _0x59e6f4[_0xe0ae('0x2d')](_0x59405c)[_0xe0ae('0x2f')](_0x651250);}};}function respondWithFilteredResult(_0x2339bf,_0x10b62c){return function(_0x37238a){if(_0x37238a){var _0x3ab425=typeof _0x10b62c[_0xe0ae('0x30')]===_0xe0ae('0x31')&&typeof _0x10b62c[_0xe0ae('0x32')]===_0xe0ae('0x31');var _0xf1dc25=_0x37238a['count'];var _0x579883=_0x3ab425?0x0:_0x10b62c['offset'];var _0x3bdc80=_0x3ab425?_0x37238a['count']:_0x10b62c['offset']+_0x10b62c[_0xe0ae('0x32')];var _0x241c51;if(_0x3bdc80>=_0xf1dc25){_0x3bdc80=_0xf1dc25;_0x241c51=0xc8;}else{_0x241c51=0xce;}_0x2339bf[_0xe0ae('0x2d')](_0x241c51);return _0x2339bf[_0xe0ae('0x33')]('Content-Range',_0x579883+'-'+_0x3bdc80+'/'+_0xf1dc25)[_0xe0ae('0x2f')](_0x37238a);}return null;};}function patchUpdates(_0x2684cd){return function(_0x1e0fde){try{jsonpatch[_0xe0ae('0x34')](_0x1e0fde,_0x2684cd,!![]);}catch(_0x1b5a6e){return BPromise[_0xe0ae('0x35')](_0x1b5a6e);}return _0x1e0fde['save']();};}function saveUpdates(_0x4d8e66,_0x3db6d9){return function(_0x5ebea6){if(_0x5ebea6){return _0x5ebea6[_0xe0ae('0x36')](_0x4d8e66)[_0xe0ae('0x24')](function(_0x5a80c5){return _0x5a80c5;});}return null;};}function removeEntity(_0x20a39b,_0x344f50){return function(_0x1466d5){if(_0x1466d5){return _0x1466d5[_0xe0ae('0x37')]()[_0xe0ae('0x24')](function(){var _0x306ba1=_0x1466d5[_0xe0ae('0x38')]({'plain':!![]});var _0x12852b=_0xe0ae('0x39');return db[_0xe0ae('0x3a')]['destroy']({'where':{'type':_0x12852b,'resourceId':_0x306ba1['id']}})['then'](function(){return _0x1466d5;});})[_0xe0ae('0x24')](function(){_0x20a39b[_0xe0ae('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42baa4,_0x5b2be4){return function(_0x5a327b){if(!_0x5a327b){_0x42baa4[_0xe0ae('0x2c')](0x194);}return _0x5a327b;};}function handleError(_0x23fc98,_0x472292){_0x472292=_0x472292||0x1f4;return function(_0x15357f){logger[_0xe0ae('0x29')](_0x15357f[_0xe0ae('0x3b')]);if(_0x15357f['name']){delete _0x15357f[_0xe0ae('0x3c')];}_0x23fc98[_0xe0ae('0x2d')](_0x472292)[_0xe0ae('0x3d')](_0x15357f);};}exports[_0xe0ae('0x3e')]=function(_0x2132a2,_0x480b70){var _0x21e30d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5462d5={},_0x58a03d={'count':0x0,'rows':[]};var _0x4be7cc=_['map'](db[_0xe0ae('0x3f')][_0xe0ae('0x40')],function(_0x595924){return{'name':_0x595924[_0xe0ae('0x41')],'type':_0x595924['type'][_0xe0ae('0x42')]};});_0x5462d5[_0xe0ae('0x43')]=_[_0xe0ae('0x44')](_0x4be7cc,_0xe0ae('0x3c'));_0x5462d5[_0xe0ae('0x45')]=_[_0xe0ae('0x46')](_0x2132a2['query']);_0x5462d5[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0x5462d5[_0xe0ae('0x43')],_0x5462d5[_0xe0ae('0x45')]);_0x21e30d[_0xe0ae('0x49')]=_['intersection'](_0x5462d5[_0xe0ae('0x43')],qs[_0xe0ae('0x4a')](_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x4a')]));_0x21e30d[_0xe0ae('0x49')]=_0x21e30d['attributes']['length']?_0x21e30d[_0xe0ae('0x49')]:_0x5462d5['model'];if(!_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x4b')](_0xe0ae('0x4c'))){_0x21e30d[_0xe0ae('0x32')]=qs['limit'](_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x32')]);_0x21e30d['offset']=qs[_0xe0ae('0x30')](_0x2132a2[_0xe0ae('0x45')]['offset']);}_0x21e30d['order']=qs[_0xe0ae('0x4d')](_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0x21e30d['where']=qs['filters'](_[_0xe0ae('0x4e')](_0x2132a2[_0xe0ae('0x45')],_0x5462d5[_0xe0ae('0x47')]),_0x4be7cc);if(_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x4f')]){_0x21e30d[_0xe0ae('0x50')]=_[_0xe0ae('0x51')](_0x21e30d[_0xe0ae('0x50')],{'$or':_[_0xe0ae('0x44')](_0x4be7cc,function(_0x1ab9fa){if(_0x1ab9fa[_0xe0ae('0x52')]!==_0xe0ae('0x53')){var _0x2eb4a5={};_0x2eb4a5[_0x1ab9fa['name']]={'$like':'%'+_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x4f')]+'%'};return _0x2eb4a5;}})});}_0x21e30d=_['merge']({},_0x21e30d,_0x2132a2[_0xe0ae('0x54')]);var _0x3772c1={'where':_0x21e30d[_0xe0ae('0x50')]};return db[_0xe0ae('0x3f')][_0xe0ae('0x55')](_0x3772c1)[_0xe0ae('0x24')](function(_0x44b23a){_0x58a03d['count']=_0x44b23a;if(_0x2132a2[_0xe0ae('0x45')][_0xe0ae('0x56')]){_0x21e30d[_0xe0ae('0x57')]=[{'all':!![]}];}return db[_0xe0ae('0x3f')][_0xe0ae('0x58')](_0x21e30d);})[_0xe0ae('0x24')](function(_0xcf4ccf){_0x58a03d[_0xe0ae('0x59')]=_0xcf4ccf;return _0x58a03d;})[_0xe0ae('0x24')](respondWithFilteredResult(_0x480b70,_0x21e30d))['catch'](handleError(_0x480b70,null));};exports['show']=function(_0x3225f6,_0x5d8929){var _0x5df9ed={'raw':![],'where':{'id':_0x3225f6[_0xe0ae('0x5a')]['id']},'include':[{'model':db[_0xe0ae('0x5b')],'as':_0xe0ae('0x5c')}]},_0x3dd0b6={};_0x3dd0b6[_0xe0ae('0x43')]=_['keys'](db[_0xe0ae('0x3f')][_0xe0ae('0x40')]);_0x3dd0b6[_0xe0ae('0x45')]=_[_0xe0ae('0x46')](_0x3225f6[_0xe0ae('0x45')]);_0x3dd0b6[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0x3dd0b6['model'],_0x3dd0b6[_0xe0ae('0x45')]);_0x5df9ed[_0xe0ae('0x49')]=_[_0xe0ae('0x48')](_0x3dd0b6[_0xe0ae('0x43')],qs[_0xe0ae('0x4a')](_0x3225f6[_0xe0ae('0x45')]['fields']));_0x5df9ed[_0xe0ae('0x49')]=_0x5df9ed['attributes'][_0xe0ae('0x5d')]?_0x5df9ed[_0xe0ae('0x49')]:_0x3dd0b6[_0xe0ae('0x43')];if(_0x3225f6[_0xe0ae('0x45')][_0xe0ae('0x56')]){_0x5df9ed[_0xe0ae('0x57')]=[{'all':!![]}];}_0x5df9ed=_[_0xe0ae('0x51')]({},_0x5df9ed,_0x3225f6[_0xe0ae('0x54')]);return db[_0xe0ae('0x3f')]['find'](_0x5df9ed)[_0xe0ae('0x24')](handleEntityNotFound(_0x5d8929,null))[_0xe0ae('0x24')](respondWithResult(_0x5d8929,null))['catch'](handleError(_0x5d8929,null));};exports[_0xe0ae('0x5e')]=function(_0x5a2129,_0x21b7b1){return db[_0xe0ae('0x3f')]['create'](_0x5a2129['body'],{})[_0xe0ae('0x24')](function(_0x24d401){var _0x4eb4b1=_0x5a2129[_0xe0ae('0x5f')][_0xe0ae('0x38')]({'plain':!![]});if(!_0x4eb4b1)throw new Error(_0xe0ae('0x60'));if(_0x4eb4b1[_0xe0ae('0x61')]===_0xe0ae('0x5f')){var _0x326883=_0x24d401[_0xe0ae('0x38')]({'plain':!![]});var _0x31089c=_0xe0ae('0x39');return db[_0xe0ae('0x62')]['find']({'where':{'name':_0x31089c,'userProfileId':_0x4eb4b1['userProfileId']},'raw':!![]})[_0xe0ae('0x24')](function(_0x1ea14a){if(_0x1ea14a&&_0x1ea14a[_0xe0ae('0x63')]===0x0){return db['UserProfileResource'][_0xe0ae('0x5e')]({'name':_0x326883[_0xe0ae('0x3c')],'resourceId':_0x326883['id'],'type':_0x1ea14a[_0xe0ae('0x3c')],'sectionId':_0x1ea14a['id']},{})['then'](function(){return _0x24d401;});}else{return _0x24d401;}})[_0xe0ae('0x2b')](function(_0x344fcc){logger[_0xe0ae('0x29')](_0xe0ae('0x64'),_0x344fcc);throw _0x344fcc;});}return _0x24d401;})[_0xe0ae('0x24')](respondWithResult(_0x21b7b1,0xc9))[_0xe0ae('0x2b')](handleError(_0x21b7b1,null));};exports[_0xe0ae('0x36')]=function(_0x2747cf,_0x96999d){if(_0x2747cf[_0xe0ae('0x65')]['id']){delete _0x2747cf[_0xe0ae('0x65')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2747cf[_0xe0ae('0x5a')]['id']},'include':[{'model':db[_0xe0ae('0x5b')],'as':_0xe0ae('0x5c')}]})['then'](handleEntityNotFound(_0x96999d,null))[_0xe0ae('0x24')](saveUpdates(_0x2747cf[_0xe0ae('0x65')],null))[_0xe0ae('0x24')](respondWithResult(_0x96999d,null))[_0xe0ae('0x2b')](handleError(_0x96999d,null));};exports['destroy']=function(_0x3e0ec3,_0x47aa82){return db['FaxAccount'][_0xe0ae('0x66')]({'where':{'id':_0x3e0ec3[_0xe0ae('0x5a')]['id']}})['then'](handleEntityNotFound(_0x47aa82,null))[_0xe0ae('0x24')](removeEntity(_0x47aa82,null))[_0xe0ae('0x2b')](handleError(_0x47aa82,null));};exports['describe']=function(_0x4e97f8,_0xb96a95){return db[_0xe0ae('0x3f')][_0xe0ae('0x67')]()['then'](respondWithResult(_0xb96a95,null))[_0xe0ae('0x2b')](handleError(_0xb96a95,null));};exports[_0xe0ae('0x68')]=function(_0xf3fb30,_0x7da79a,_0x344dea){if(_0xf3fb30[_0xe0ae('0x65')]['id']){delete _0xf3fb30['body']['id'];}return db['FaxAccount'][_0xe0ae('0x66')]({'where':{'id':_0xf3fb30['params']['id']}})['then'](handleEntityNotFound(_0x7da79a,null))[_0xe0ae('0x24')](function(_0x1a46e7){if(_0x1a46e7){_0xf3fb30[_0xe0ae('0x65')]['FaxAccountId']=_0x1a46e7['id'];return db[_0xe0ae('0x69')][_0xe0ae('0x5e')](_0xf3fb30['body']);}})[_0xe0ae('0x24')](respondWithResult(_0x7da79a,null))[_0xe0ae('0x2b')](handleError(_0x7da79a,null));};exports[_0xe0ae('0x6a')]=function(_0x14e898,_0x34197c,_0x31e798){var _0x17a888={'raw':![],'where':{}};var _0x5406b1={};var _0x1b45c3={'count':0x0,'rows':[]};return db[_0xe0ae('0x3f')][_0xe0ae('0x6b')]({'where':{'id':_0x14e898[_0xe0ae('0x5a')]['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x34197c,null))['then'](function(_0x16a32a){if(_0x16a32a){_0x5406b1[_0xe0ae('0x43')]=_[_0xe0ae('0x46')](db['Disposition'][_0xe0ae('0x40')]);_0x5406b1['query']=_[_0xe0ae('0x46')](_0x14e898[_0xe0ae('0x45')]);_0x5406b1[_0xe0ae('0x47')]=_['intersection'](_0x5406b1[_0xe0ae('0x43')],_0x5406b1[_0xe0ae('0x45')]);_0x17a888[_0xe0ae('0x49')]=_['intersection'](_0x5406b1[_0xe0ae('0x43')],qs[_0xe0ae('0x4a')](_0x14e898['query'][_0xe0ae('0x4a')]));_0x17a888[_0xe0ae('0x49')]=_0x17a888[_0xe0ae('0x49')]['length']?_0x17a888[_0xe0ae('0x49')]:_0x5406b1[_0xe0ae('0x43')];if(!_0x14e898[_0xe0ae('0x45')][_0xe0ae('0x4b')](_0xe0ae('0x4c'))){_0x17a888[_0xe0ae('0x32')]=qs[_0xe0ae('0x32')](_0x14e898['query'][_0xe0ae('0x32')]);_0x17a888['offset']=qs['offset'](_0x14e898[_0xe0ae('0x45')][_0xe0ae('0x30')]);}_0x17a888[_0xe0ae('0x6c')]=qs[_0xe0ae('0x4d')](_0x14e898[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0x17a888[_0xe0ae('0x50')]=qs[_0xe0ae('0x47')](_[_0xe0ae('0x4e')](_0x14e898[_0xe0ae('0x45')],_0x5406b1[_0xe0ae('0x47')]));_0x17a888[_0xe0ae('0x50')]['FaxAccountId']=_0x16a32a['id'];if(_0x14e898[_0xe0ae('0x45')]['filter']){_0x17a888['where']=_['merge'](_0x17a888['where'],{'$or':_['map'](_0x17a888['attributes'],function(_0x462dcf){var _0x2e8538={};_0x2e8538[_0x462dcf]={'$like':'%'+_0x14e898['query'][_0xe0ae('0x4f')]+'%'};return _0x2e8538;})});}_0x17a888=_[_0xe0ae('0x51')]({},_0x17a888,_0x14e898[_0xe0ae('0x54')]);return db[_0xe0ae('0x69')][_0xe0ae('0x55')]({'where':_0x17a888['where']})['then'](function(_0x1c44e4){_0x1b45c3[_0xe0ae('0x55')]=_0x1c44e4;if(_0x14e898[_0xe0ae('0x45')][_0xe0ae('0x56')]){_0x17a888[_0xe0ae('0x57')]=[{'all':!![]}];}return db[_0xe0ae('0x69')][_0xe0ae('0x58')](_0x17a888);})[_0xe0ae('0x24')](function(_0x5c5f0f){_0x1b45c3[_0xe0ae('0x59')]=_0x5c5f0f;return _0x1b45c3;});}})['then'](respondWithFilteredResult(_0x34197c,_0x17a888))[_0xe0ae('0x2b')](handleError(_0x34197c,null));};exports[_0xe0ae('0x6d')]=function(_0x469c9c,_0x5a24d2,_0x34b93f){return db[_0xe0ae('0x3f')][_0xe0ae('0x66')]({'where':{'id':_0x469c9c[_0xe0ae('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5a24d2,null))[_0xe0ae('0x24')](function(_0xb46307){if(_0xb46307){return _0xb46307[_0xe0ae('0x6d')](_0x469c9c['query']['ids']);}})[_0xe0ae('0x24')](respondWithStatusCode(_0x5a24d2,null))[_0xe0ae('0x2b')](handleError(_0x5a24d2,null));};exports['addAnswer']=function(_0x2bea0b,_0x15c493,_0x3e0fec){if(_0x2bea0b['body']['id']){delete _0x2bea0b['body']['id'];}return db[_0xe0ae('0x3f')]['find']({'where':{'id':_0x2bea0b[_0xe0ae('0x5a')]['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x15c493,null))[_0xe0ae('0x24')](function(_0x46e361){if(_0x46e361){_0x2bea0b[_0xe0ae('0x65')]['FaxAccountId']=_0x46e361['id'];return db['CannedAnswer']['create'](_0x2bea0b[_0xe0ae('0x65')]);}})[_0xe0ae('0x24')](respondWithResult(_0x15c493,null))['catch'](handleError(_0x15c493,null));};exports[_0xe0ae('0x6e')]=function(_0xb50fc,_0x5d792f,_0x21165a){var _0x53bac7={'raw':![],'where':{}};var _0xd1ae7d={};var _0x4243c0={'count':0x0,'rows':[]};return db[_0xe0ae('0x3f')][_0xe0ae('0x6b')]({'where':{'id':_0xb50fc['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x5d792f,null))[_0xe0ae('0x24')](function(_0x396237){if(_0x396237){_0xd1ae7d[_0xe0ae('0x43')]=_[_0xe0ae('0x46')](db[_0xe0ae('0x6f')][_0xe0ae('0x40')]);_0xd1ae7d[_0xe0ae('0x45')]=_[_0xe0ae('0x46')](_0xb50fc[_0xe0ae('0x45')]);_0xd1ae7d[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0xd1ae7d['model'],_0xd1ae7d[_0xe0ae('0x45')]);_0x53bac7[_0xe0ae('0x49')]=_['intersection'](_0xd1ae7d['model'],qs[_0xe0ae('0x4a')](_0xb50fc['query'][_0xe0ae('0x4a')]));_0x53bac7[_0xe0ae('0x49')]=_0x53bac7[_0xe0ae('0x49')][_0xe0ae('0x5d')]?_0x53bac7[_0xe0ae('0x49')]:_0xd1ae7d['model'];if(!_0xb50fc['query'][_0xe0ae('0x4b')]('nolimit')){_0x53bac7[_0xe0ae('0x32')]=qs[_0xe0ae('0x32')](_0xb50fc[_0xe0ae('0x45')]['limit']);_0x53bac7[_0xe0ae('0x30')]=qs[_0xe0ae('0x30')](_0xb50fc[_0xe0ae('0x45')][_0xe0ae('0x30')]);}_0x53bac7['order']=qs[_0xe0ae('0x4d')](_0xb50fc[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0x53bac7['where']=qs[_0xe0ae('0x47')](_[_0xe0ae('0x4e')](_0xb50fc[_0xe0ae('0x45')],_0xd1ae7d[_0xe0ae('0x47')]));_0x53bac7['where'][_0xe0ae('0x70')]=_0x396237['id'];if(_0xb50fc['query'][_0xe0ae('0x4f')]){_0x53bac7[_0xe0ae('0x50')]=_[_0xe0ae('0x51')](_0x53bac7[_0xe0ae('0x50')],{'$or':_[_0xe0ae('0x44')](_0x53bac7['attributes'],function(_0x5becea){var _0x5ee0cc={};_0x5ee0cc[_0x5becea]={'$like':'%'+_0xb50fc[_0xe0ae('0x45')][_0xe0ae('0x4f')]+'%'};return _0x5ee0cc;})});}_0x53bac7=_['merge']({},_0x53bac7,_0xb50fc[_0xe0ae('0x54')]);return db['CannedAnswer']['count']({'where':_0x53bac7[_0xe0ae('0x50')]})[_0xe0ae('0x24')](function(_0x23911e){_0x4243c0[_0xe0ae('0x55')]=_0x23911e;if(_0xb50fc[_0xe0ae('0x45')]['includeAll']){_0x53bac7['include']=[{'all':!![]}];}return db[_0xe0ae('0x6f')][_0xe0ae('0x58')](_0x53bac7);})[_0xe0ae('0x24')](function(_0x2d4a39){_0x4243c0[_0xe0ae('0x59')]=_0x2d4a39;return _0x4243c0;});}})[_0xe0ae('0x24')](respondWithFilteredResult(_0x5d792f,_0x53bac7))[_0xe0ae('0x2b')](handleError(_0x5d792f,null));};exports[_0xe0ae('0x71')]=function(_0x28fb3b,_0x35fb4f,_0x33077c){return db[_0xe0ae('0x3f')][_0xe0ae('0x66')]({'where':{'id':_0x28fb3b[_0xe0ae('0x5a')]['id']}})['then'](handleEntityNotFound(_0x35fb4f,null))[_0xe0ae('0x24')](function(_0xcc9593){if(_0xcc9593){return _0xcc9593[_0xe0ae('0x71')](_0x28fb3b[_0xe0ae('0x45')][_0xe0ae('0x72')]);}})[_0xe0ae('0x24')](respondWithStatusCode(_0x35fb4f,null))[_0xe0ae('0x2b')](handleError(_0x35fb4f,null));};exports['addInteraction']=function(_0x55c398,_0x298fb6,_0x38771d){return db[_0xe0ae('0x73')][_0xe0ae('0x66')]({'where':{'id':_0x55c398['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x298fb6,null))['then'](function(_0x402354){if(_0x402354){return _0x402354['addInteraction'](_0x55c398[_0xe0ae('0x65')]['ids'],_['omit'](_0x55c398[_0xe0ae('0x65')],[_0xe0ae('0x72'),'id'])||{});}})[_0xe0ae('0x24')](respondWithResult(_0x298fb6,null))[_0xe0ae('0x2b')](handleError(_0x298fb6,null));};exports[_0xe0ae('0x74')]=function(_0x19b091,_0x296b32,_0x51199a){var _0x26f0b8={'raw':![],'where':{}};var _0x1e52f3={};var _0x4363d5={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x19b091[_0xe0ae('0x5a')]['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x296b32,null))['then'](function(_0x325686){if(_0x325686){_0x1e52f3[_0xe0ae('0x43')]=_[_0xe0ae('0x46')](db[_0xe0ae('0x73')]['rawAttributes']);_0x1e52f3[_0xe0ae('0x45')]=_[_0xe0ae('0x46')](_0x19b091[_0xe0ae('0x45')]);_0x1e52f3[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0x1e52f3['model'],_0x1e52f3[_0xe0ae('0x45')]);_0x26f0b8[_0xe0ae('0x49')]=_[_0xe0ae('0x48')](_0x1e52f3[_0xe0ae('0x43')],qs[_0xe0ae('0x4a')](_0x19b091[_0xe0ae('0x45')]['fields']));_0x26f0b8[_0xe0ae('0x49')]=_0x26f0b8[_0xe0ae('0x49')][_0xe0ae('0x5d')]?_0x26f0b8['attributes']:_0x1e52f3[_0xe0ae('0x43')];if(!_0x19b091[_0xe0ae('0x45')][_0xe0ae('0x4b')](_0xe0ae('0x4c'))){_0x26f0b8['limit']=qs[_0xe0ae('0x32')](_0x19b091[_0xe0ae('0x45')]['limit']);_0x26f0b8['offset']=qs[_0xe0ae('0x30')](_0x19b091[_0xe0ae('0x45')][_0xe0ae('0x30')]);}_0x26f0b8[_0xe0ae('0x6c')]=qs['sort'](_0x19b091['query'][_0xe0ae('0x4d')]);_0x26f0b8['where']=qs['filters'](_[_0xe0ae('0x4e')](_0x19b091[_0xe0ae('0x45')],_0x1e52f3[_0xe0ae('0x47')]));_0x26f0b8['where'][_0xe0ae('0x70')]=_0x325686['id'];if(_0x19b091['query'][_0xe0ae('0x4f')]){_0x26f0b8['where']=_['merge'](_0x26f0b8[_0xe0ae('0x50')],{'$or':_[_0xe0ae('0x44')](_0x26f0b8[_0xe0ae('0x49')],function(_0x29c622){var _0x4c5072={};_0x4c5072[_0x29c622]={'$like':'%'+_0x19b091[_0xe0ae('0x45')][_0xe0ae('0x4f')]+'%'};return _0x4c5072;})});}_0x26f0b8=_[_0xe0ae('0x51')]({},_0x26f0b8,_0x19b091['options']);return db[_0xe0ae('0x73')][_0xe0ae('0x55')]({'where':_0x26f0b8[_0xe0ae('0x50')]})[_0xe0ae('0x24')](function(_0x22de81){_0x4363d5['count']=_0x22de81;if(_0x19b091[_0xe0ae('0x45')]['includeAll']){_0x26f0b8[_0xe0ae('0x57')]=[{'model':db[_0xe0ae('0x75')],'as':_0xe0ae('0x76'),'required':![]},{'model':db[_0xe0ae('0x77')],'as':_0xe0ae('0x78'),'attributes':[_0xe0ae('0x3c'),_0xe0ae('0x79'),_0xe0ae('0x7a')],'required':![]},{'model':db[_0xe0ae('0x7b')],'as':_0xe0ae('0x7c'),'attributes':['id','name','color'],'where':_0x19b091['query'][_0xe0ae('0x7d')]?{'id':_0x19b091[_0xe0ae('0x45')][_0xe0ae('0x7d')]}:undefined,'required':_0x19b091[_0xe0ae('0x45')][_0xe0ae('0x7d')]?!![]:![]}];}return db['FaxInteraction'][_0xe0ae('0x58')](_0x26f0b8);})[_0xe0ae('0x24')](function(_0x42417b){_0x4363d5[_0xe0ae('0x59')]=_0x42417b;return _0x4363d5;});}})['then'](respondWithFilteredResult(_0x296b32,_0x26f0b8))['catch'](handleError(_0x296b32,null));};exports[_0xe0ae('0x7e')]=function(_0x5a6537,_0x504dd6,_0xdd06f0){return db[_0xe0ae('0x3f')]['findOne']({'where':{'id':_0x5a6537['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x504dd6,null))[_0xe0ae('0x24')](function(_0x5db66d){if(_0x5db66d){return db[_0xe0ae('0x7f')][_0xe0ae('0x80')](function(_0x40c9d6){return db[_0xe0ae('0x81')]['destroy']({'where':{'FaxAccountId':_0x5a6537['params']['id']},'transaction':_0x40c9d6})[_0xe0ae('0x24')](function(_0x116e77){var _0x7d1f0b=_['map'](_0x5a6537[_0xe0ae('0x65')],function(_0x4e7ccb){_0x4e7ccb['FaxAccountId']=_0x5a6537[_0xe0ae('0x5a')]['id'];return _0x4e7ccb;});return db['FaxApplication'][_0xe0ae('0x82')](_0x7d1f0b,{'transaction':_0x40c9d6});});})[_0xe0ae('0x24')](function(){return db[_0xe0ae('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x5a6537[_0xe0ae('0x5a')]['id']},'order':_0xe0ae('0x83')});});}})[_0xe0ae('0x24')](respondWithResult(_0x504dd6,null))[_0xe0ae('0x2b')](handleError(_0x504dd6,null));};exports[_0xe0ae('0x84')]=function(_0x18b81f,_0x591e3a,_0x486b69){var _0x4d0696={};var _0x109df0={};var _0x23be3c;var _0x591ba2;return db[_0xe0ae('0x3f')][_0xe0ae('0x6b')]({'where':{'id':_0x18b81f['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x591e3a,null))[_0xe0ae('0x24')](function(_0x5dcb33){if(_0x5dcb33){_0x23be3c=_0x5dcb33;_0x109df0[_0xe0ae('0x43')]=_[_0xe0ae('0x46')](db[_0xe0ae('0x81')][_0xe0ae('0x40')]);_0x109df0[_0xe0ae('0x45')]=_['keys'](_0x18b81f[_0xe0ae('0x45')]);_0x109df0[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0x109df0[_0xe0ae('0x43')],_0x109df0[_0xe0ae('0x45')]);_0x4d0696['attributes']=_['intersection'](_0x109df0['model'],qs[_0xe0ae('0x4a')](_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x4a')]));_0x4d0696[_0xe0ae('0x49')]=_0x4d0696[_0xe0ae('0x49')][_0xe0ae('0x5d')]?_0x4d0696[_0xe0ae('0x49')]:_0x109df0[_0xe0ae('0x43')];_0x4d0696[_0xe0ae('0x6c')]=qs['sort'](_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0x4d0696[_0xe0ae('0x50')]=qs['filters'](_[_0xe0ae('0x4e')](_0x18b81f[_0xe0ae('0x45')],_0x109df0[_0xe0ae('0x47')]));if(_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x4f')]){_0x4d0696[_0xe0ae('0x50')]=_['merge'](_0x4d0696[_0xe0ae('0x50')],{'$or':_['map'](_0x4d0696[_0xe0ae('0x49')],function(_0x20f7d0){var _0x146b28={};_0x146b28[_0x20f7d0]={'$like':'%'+_0x18b81f['query']['filter']+'%'};return _0x146b28;})});}_0x4d0696=_[_0xe0ae('0x51')]({},_0x4d0696,_0x18b81f[_0xe0ae('0x54')]);return _0x23be3c[_0xe0ae('0x84')](_0x4d0696);}})[_0xe0ae('0x24')](function(_0x22e112){if(_0x22e112){_0x591ba2=_0x22e112[_0xe0ae('0x5d')];if(!_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x4b')](_0xe0ae('0x4c'))){_0x4d0696[_0xe0ae('0x32')]=qs['limit'](_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x32')]);_0x4d0696[_0xe0ae('0x30')]=qs[_0xe0ae('0x30')](_0x18b81f[_0xe0ae('0x45')][_0xe0ae('0x30')]);}return _0x23be3c[_0xe0ae('0x84')](_0x4d0696);}})[_0xe0ae('0x24')](function(_0x55a813){if(_0x55a813){return _0x55a813?{'count':_0x591ba2,'rows':_0x55a813}:null;}})['then'](respondWithResult(_0x591e3a,null))['catch'](handleError(_0x591e3a,null));};function Extension(_0x4f3ba8,_0x52f35a,_0x3ed33f,_0x344b98){this[_0xe0ae('0x85')]=_0xe0ae('0x86');this[_0xe0ae('0x87')]=_0x4f3ba8[_0xe0ae('0x88')];this['app']=_0x344b98;this[_0xe0ae('0x52')]=_0xe0ae('0x89');this['description']=_0xe0ae('0x8a');this[_0xe0ae('0x70')]=_0x4f3ba8['id'];this[_0xe0ae('0x83')]=_0x52f35a;this[_0xe0ae('0x8b')]=_0x3ed33f;}function createExtensionsReciveFax(_0xde62ab){var _0x157fbc=0x1;var _0x5a7c79=[];_0x5a7c79[_0xe0ae('0x8c')](new Extension(_0xde62ab,_0x157fbc,'',_0xe0ae('0x8d')));_0x157fbc+=0x1;_0x5a7c79[_0xe0ae('0x8c')](new Extension(_0xde62ab,_0x157fbc,_0xe0ae('0x8e'),_0xe0ae('0x8f')));_0x157fbc+=0x1;for(var _0x1252c7 in _0xde62ab){if(_0xde62ab[_0xe0ae('0x4b')](_0x1252c7)&&(_0x1252c7==='ecm'||_0x1252c7==='localstationid'||_0x1252c7===_0xe0ae('0x90')||_0x1252c7==='faxdetect'||_0x1252c7===_0xe0ae('0x91')||_0x1252c7===_0xe0ae('0x92')||_0x1252c7===_0xe0ae('0x93')||_0x1252c7===_0xe0ae('0x94')||_0x1252c7==='t38timeout')){_0x5a7c79['push'](new Extension(_0xde62ab,_0x157fbc,'FAXOPT('+_0x1252c7+')='+_0xde62ab[_0x1252c7],_0xe0ae('0x8f')));_0x157fbc+=0x1;}}_0x5a7c79['push'](new Extension(_0xde62ab,_0x157fbc,'6',_0xe0ae('0x95')));_0x157fbc+=0x1;_0x5a7c79[_0xe0ae('0x8c')](new Extension(_0xde62ab,_0x157fbc,_0xe0ae('0x96'),_0xe0ae('0x97')));_0x157fbc=0x0;return _0x5a7c79;}exports[_0xe0ae('0x98')]=function(_0x4615e1,_0x2b7a54,_0x2dbaaf){var _0x127e7b;return db[_0xe0ae('0x7f')][_0xe0ae('0x80')](function(_0x2e9611){return db[_0xe0ae('0x3f')][_0xe0ae('0x5e')](_0x4615e1['body'],{'transaction':_0x2e9611})[_0xe0ae('0x24')](function(_0xcf5580){_0x127e7b=_0xcf5580['get']({'plain':!![]});return db[_0xe0ae('0x99')][_0xe0ae('0x82')](createExtensionsReciveFax(_0x127e7b),{'transaction':_0x2e9611});});})[_0xe0ae('0x24')](function(){return _0x127e7b;})[_0xe0ae('0x24')](respondWithResult(_0x2b7a54,null))[_0xe0ae('0x2b')](handleError(_0x2b7a54,null));};exports[_0xe0ae('0x9a')]=function(_0x4f1e87,_0x874905,_0x5bc35f){var _0x1b1d06;return db[_0xe0ae('0x7f')][_0xe0ae('0x80')](function(_0x1634be){return db[_0xe0ae('0x3f')]['update'](_0x4f1e87[_0xe0ae('0x65')],{'where':{'id':_0x4f1e87[_0xe0ae('0x65')]['id']},'transaction':_0x1634be})[_0xe0ae('0x24')](function(_0x48ea7e){return db[_0xe0ae('0x99')][_0xe0ae('0x37')]({'where':{'FaxAccountId':_0x4f1e87['body']['id']},'transaction':_0x1634be})[_0xe0ae('0x24')](function(_0x489e5e){return db[_0xe0ae('0x99')][_0xe0ae('0x82')](createExtensionsReciveFax(_[_0xe0ae('0x9b')](_0x4f1e87[_0xe0ae('0x65')],['tech',_0xe0ae('0x42'),_0xe0ae('0x9c'),'updatedAt',_0xe0ae('0x9d'),_0xe0ae('0x9e')])),{'transaction':_0x1634be});});});})[_0xe0ae('0x24')](function(){return db[_0xe0ae('0x3f')][_0xe0ae('0x9f')](_0x4f1e87[_0xe0ae('0x65')]['id']);})[_0xe0ae('0x24')](respondWithResult(_0x874905,null))[_0xe0ae('0x2b')](handleError(_0x874905,null));};exports[_0xe0ae('0xa0')]=function(_0x2dd16a,_0x276351,_0x53ae87){var _0x357fb3={'raw':!![],'where':{}};var _0x36c0ec={};var _0x3d40d0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2dd16a['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x276351,null))[_0xe0ae('0x24')](function(_0x4e8b13){if(_0x4e8b13){_0x36c0ec[_0xe0ae('0x43')]=_['keys'](db[_0xe0ae('0xa1')][_0xe0ae('0x40')]);_0x36c0ec['query']=_[_0xe0ae('0x46')](_0x2dd16a[_0xe0ae('0x45')]);_0x36c0ec[_0xe0ae('0x47')]=_[_0xe0ae('0x48')](_0x36c0ec[_0xe0ae('0x43')],_0x36c0ec['query']);_0x357fb3[_0xe0ae('0x49')]=_['intersection'](_0x36c0ec[_0xe0ae('0x43')],qs['fields'](_0x2dd16a['query'][_0xe0ae('0x4a')]));_0x357fb3['attributes']=_0x357fb3[_0xe0ae('0x49')][_0xe0ae('0x5d')]?_0x357fb3[_0xe0ae('0x49')]:_0x36c0ec[_0xe0ae('0x43')];if(!_0x2dd16a[_0xe0ae('0x45')]['hasOwnProperty'](_0xe0ae('0x4c'))){_0x357fb3[_0xe0ae('0x32')]=qs[_0xe0ae('0x32')](_0x2dd16a[_0xe0ae('0x45')][_0xe0ae('0x32')]);_0x357fb3[_0xe0ae('0x30')]=qs[_0xe0ae('0x30')](_0x2dd16a[_0xe0ae('0x45')][_0xe0ae('0x30')]);}_0x357fb3[_0xe0ae('0x6c')]=qs['sort'](_0x2dd16a[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0x357fb3[_0xe0ae('0x50')]=qs['filters'](_[_0xe0ae('0x4e')](_0x2dd16a['query'],_0x36c0ec['filters']));_0x357fb3[_0xe0ae('0x50')]['FaxAccountId']=_0x4e8b13['id'];if(_0x2dd16a['query']['filter']){_0x357fb3[_0xe0ae('0x50')]=_['merge'](_0x357fb3['where'],{'$or':_[_0xe0ae('0x44')](_0x357fb3[_0xe0ae('0x49')],function(_0x26414d){var _0x2c577a={};_0x2c577a[_0x26414d]={'$like':'%'+_0x2dd16a['query']['filter']+'%'};return _0x2c577a;})});}if(_0x2dd16a['query']['$gte']){var _0x4286ec=_0x2dd16a[_0xe0ae('0x45')]['$gte'][_0xe0ae('0xa2')](',');var _0x5c4dbf={};_0x5c4dbf[_0x4286ec[0x0]]={'$gte':moment(_0x4286ec[0x1])[_0xe0ae('0xa3')](_0xe0ae('0xa4'))};_0x357fb3[_0xe0ae('0x50')]=_[_0xe0ae('0x51')](_0x357fb3[_0xe0ae('0x50')],_0x5c4dbf);}_0x357fb3=_[_0xe0ae('0x51')]({},_0x357fb3,_0x2dd16a[_0xe0ae('0x54')]);return db[_0xe0ae('0xa1')][_0xe0ae('0x55')]({'where':_0x357fb3['where']})[_0xe0ae('0x24')](function(_0x47aa4a){_0x3d40d0[_0xe0ae('0x55')]=_0x47aa4a;if(_0x2dd16a[_0xe0ae('0x45')][_0xe0ae('0x56')]){_0x357fb3[_0xe0ae('0x57')]=[{'all':!![]}];}return db[_0xe0ae('0xa1')][_0xe0ae('0x58')](_0x357fb3);})[_0xe0ae('0x24')](function(_0x19f995){_0x3d40d0[_0xe0ae('0x59')]=_0x19f995;return _0x3d40d0;});}})['then'](respondWithFilteredResult(_0x276351,_0x357fb3))[_0xe0ae('0x2b')](handleError(_0x276351,null));};exports[_0xe0ae('0x3d')]=function(_0x5339f3,_0x4fc703,_0x2e0988){var _0x12cde5,_0x166371={},_0x301b1b;if(_0x5339f3[_0xe0ae('0x65')]['to']){_0x301b1b=_0x5339f3[_0xe0ae('0x65')]['to'][0x0];}return db[_0xe0ae('0x3f')]['find']({'where':{'id':_0x5339f3['params']['id']},'include':[{'model':db[_0xe0ae('0xa5')],'as':'List','include':[{'model':db[_0xe0ae('0x75')],'as':_0xe0ae('0xa6'),'where':{'fax':_0x301b1b},'limit':0x1,'order':[[_0xe0ae('0xa7'),_0xe0ae('0xa8')]]}]}]})[_0xe0ae('0x24')](handleEntityNotFound(_0x4fc703,null))['then'](function(_0x5476f4){_0x12cde5=_0x5476f4;if(_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')]&&_0x5339f3['body']['attachments'][_0xe0ae('0x5d')]){for(var _0x594615=0x0;_0x594615<_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')]['length'];_0x594615+=0x1){_0x5339f3[_0xe0ae('0x65')]['attachments'][_0x594615]={'filename':_0x5339f3['body'][_0xe0ae('0xa9')][_0x594615][_0xe0ae('0x3c')],'id':_0x5339f3[_0xe0ae('0x65')]['attachments'][_0x594615]['id'],'path':path['join'](config[_0xe0ae('0xaa')],_0xe0ae('0xab'),_0x5339f3['body'][_0xe0ae('0xa9')][_0x594615]['basename'])};}}return respondWithRpcPromise(_0xe0ae('0xac'),_0xe0ae('0xac'),{'FaxAccountId':_[_0xe0ae('0xad')](_0x5339f3[_0xe0ae('0x5a')]['id'])?undefined:_0x5339f3[_0xe0ae('0x5a')]['id'],'path':_[_0xe0ae('0xad')](_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')][0x0][_0xe0ae('0x9')])?undefined:_0x5339f3[_0xe0ae('0x65')]['attachments'][0x0][_0xe0ae('0x9')],'fax':_[_0xe0ae('0xad')](_0x5339f3[_0xe0ae('0x65')]['to'][0x0])?undefined:_0x5339f3[_0xe0ae('0x65')]['to'][0x0]},client9002);})[_0xe0ae('0x24')](function(){if(_0x12cde5){if(_['isNil'](_0x5339f3['body'][_0xe0ae('0xae')])){_0x5339f3['body'][_0xe0ae('0xae')]=util['format'](_0xe0ae('0xaf'),_0x12cde5[_0xe0ae('0x3c')],_0x12cde5[_0xe0ae('0xb0')]);}if(_0x12cde5[_0xe0ae('0xb1')]){if(_0x12cde5['List'][_0xe0ae('0xa6')][_0xe0ae('0x5d')]){return _0x12cde5['List']['Contacts'][0x0];}else{return db['CmContact'][_0xe0ae('0x5e')](_[_0xe0ae('0x1c')](_0x5339f3[_0xe0ae('0x65')],{'firstName':_0x5339f3['body']['to'][0x0],'phone':_0x5339f3[_0xe0ae('0x65')]['to'][0x0],'fax':_0x5339f3[_0xe0ae('0x65')]['to'][0x0],'ListId':_0x12cde5[_0xe0ae('0x9e')]}));}}else{throw new Error(_0xe0ae('0xb2'));}}else{throw new Error(_0xe0ae('0xb3'));}})['then'](function(_0x58bc7b){if(_0x58bc7b){return db[_0xe0ae('0x73')][_0xe0ae('0x66')]({'where':{'ContactId':_0x58bc7b['id'],'closed':![],'FaxAccountId':_0x12cde5['id']}})['then'](function(_0x13e3b3){if(_0x13e3b3){return[_0x13e3b3,![]];}return db[_0xe0ae('0x73')][_0xe0ae('0x5e')]({'UserId':_0x5339f3['user']['id'],'ContactId':_0x58bc7b['id'],'FaxAccountId':_0x12cde5['id'],'fax':_0x5339f3[_0xe0ae('0x65')]['to'][0x0],'firstMsgDirection':_0xe0ae('0xb4'),'Messages':[_[_0xe0ae('0x51')](_0x5339f3[_0xe0ae('0x65')],{'read':![],'body':_0x5339f3[_0xe0ae('0x65')]['attachments'][0x0][_0xe0ae('0xb5')],'FaxAccountId':_0x12cde5['id'],'UserId':_0x5339f3[_0xe0ae('0x5f')]['id'],'ContactId':_0x58bc7b['id'],'AttachmentId':_0x5339f3[_0xe0ae('0x65')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xe0ae('0xa1')],'as':_0xe0ae('0xb6')}]})[_0xe0ae('0x24')](function(_0x38efd4){return[_0x38efd4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe0ae('0xb7')](function(_0x13c02e,_0x5e3712){if(_0x5e3712){return _0x13c02e;}return db[_0xe0ae('0xa1')][_0xe0ae('0x5e')]({'direction':_0xe0ae('0xb4'),'read':![],'body':_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')][0x0][_0xe0ae('0xb5')],'FaxAccountId':_0x12cde5['id'],'FaxInteractionId':_0x13c02e['id'],'UserId':_0x5339f3['user']['id'],'ContactId':_0x13c02e['ContactId'],'AttachmentId':_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')][0x0]['id']})[_0xe0ae('0x24')](function(_0x126e55){_0x13c02e[_0xe0ae('0xb8')][_0xe0ae('0xb6')]=[];_0x13c02e[_0xe0ae('0xb8')][_0xe0ae('0xb6')]['push'](_0x126e55[_0xe0ae('0xb8')]);return _0x13c02e;});})[_0xe0ae('0x24')](function(_0x22ce58){respondWithRpcPromise(_0xe0ae('0xb9'),_0xe0ae('0xb9'),{'FaxAccountId':_[_0xe0ae('0xad')](_0x5339f3['params']['id'])?undefined:_0x5339f3[_0xe0ae('0x5a')]['id'],'path':_[_0xe0ae('0xad')](_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')][0x0]['path'])?undefined:_0x5339f3[_0xe0ae('0x65')][_0xe0ae('0xa9')][0x0][_0xe0ae('0x9')],'fax':_[_0xe0ae('0xad')](_0x5339f3[_0xe0ae('0x65')]['to'][0x0])?undefined:_0x5339f3[_0xe0ae('0x65')]['to'][0x0],'AttachmentId':_0x5339f3['body'][_0xe0ae('0xa9')][0x0]['id']},client9002)[_0xe0ae('0x24')](function(_0x258caf){logger['info'](_0xe0ae('0xba'),_0x258caf);})[_0xe0ae('0x2b')](function(_0x6a0928){logger[_0xe0ae('0x25')](_0xe0ae('0xba'),_0x6a0928);});return _0x22ce58;})[_0xe0ae('0x24')](respondWithResult(_0x4fc703,null))[_0xe0ae('0x2b')](handleError(_0x4fc703,null));};exports[_0xe0ae('0xbb')]=function(_0x1bef22,_0x58fcc2,_0x463ef0){return db[_0xe0ae('0x3f')][_0xe0ae('0x66')]({'where':{'id':_0x1bef22['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x58fcc2,null))[_0xe0ae('0x24')](function(_0x154ad4){if(_0x154ad4){return _0x154ad4[_0xe0ae('0xbb')](_0x1bef22[_0xe0ae('0x65')]['ids'],_[_0xe0ae('0x9b')](_0x1bef22[_0xe0ae('0x65')],[_0xe0ae('0x72'),'id'])||{})['spread'](function(_0x2bbbbd){for(var _0x1cad60=0x0;_0x1cad60<_0x1bef22[_0xe0ae('0x65')][_0xe0ae('0x72')][_0xe0ae('0x5d')];_0x1cad60+=0x1){socket['emit'](_0xe0ae('0xbc'),{'UserId':Number(_0x1bef22['body'][_0xe0ae('0x72')][_0x1cad60]),'FaxAccountId':Number(_0x1bef22[_0xe0ae('0x5a')]['id'])});}return _0x2bbbbd;});}})[_0xe0ae('0x24')](respondWithResult(_0x58fcc2,null))[_0xe0ae('0x2b')](handleError(_0x58fcc2,null));};exports[_0xe0ae('0xbd')]=function(_0x56f2a4,_0x2ea031,_0x481948){return db[_0xe0ae('0x3f')]['find']({'where':{'id':_0x56f2a4['params']['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x2ea031,null))[_0xe0ae('0x24')](function(_0x457e3c){if(_0x457e3c){return _0x457e3c[_0xe0ae('0xbd')](_0x56f2a4[_0xe0ae('0x45')][_0xe0ae('0x72')])[_0xe0ae('0x24')](function(){if(_[_0xe0ae('0xbe')](_0x56f2a4[_0xe0ae('0x45')][_0xe0ae('0x72')])){for(var _0x4c1b3c=0x0;_0x4c1b3c<_0x56f2a4['query'][_0xe0ae('0x72')][_0xe0ae('0x5d')];_0x4c1b3c+=0x1){socket[_0xe0ae('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x56f2a4['query']['ids'][_0x4c1b3c]),'FaxAccountId':Number(_0x56f2a4[_0xe0ae('0x5a')]['id'])});}}else{socket[_0xe0ae('0xbf')](_0xe0ae('0xc0'),{'UserId':Number(_0x56f2a4[_0xe0ae('0x45')][_0xe0ae('0x72')]),'FaxAccountId':Number(_0x56f2a4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2ea031,null))['catch'](handleError(_0x2ea031,null));};exports[_0xe0ae('0xc1')]=function(_0x321ca8,_0x150cf2,_0x40a200){var _0xcefd27={};var _0x535eed={};var _0x5dd6bd;var _0x2839b8;return db[_0xe0ae('0x3f')][_0xe0ae('0x6b')]({'where':{'id':_0x321ca8[_0xe0ae('0x5a')]['id']}})[_0xe0ae('0x24')](handleEntityNotFound(_0x150cf2,null))[_0xe0ae('0x24')](function(_0x13cf68){if(_0x13cf68){_0x5dd6bd=_0x13cf68;_0x535eed['model']=_[_0xe0ae('0x46')](db[_0xe0ae('0x77')][_0xe0ae('0x40')]);_0x535eed[_0xe0ae('0x45')]=_[_0xe0ae('0x46')](_0x321ca8[_0xe0ae('0x45')]);_0x535eed['filters']=_['intersection'](_0x535eed[_0xe0ae('0x43')],_0x535eed[_0xe0ae('0x45')]);_0xcefd27[_0xe0ae('0x49')]=_[_0xe0ae('0x48')](_0x535eed[_0xe0ae('0x43')],qs[_0xe0ae('0x4a')](_0x321ca8[_0xe0ae('0x45')][_0xe0ae('0x4a')]));_0xcefd27[_0xe0ae('0x49')]=_0xcefd27[_0xe0ae('0x49')][_0xe0ae('0x5d')]?_0xcefd27['attributes']:_0x535eed[_0xe0ae('0x43')];_0xcefd27[_0xe0ae('0x6c')]=qs[_0xe0ae('0x4d')](_0x321ca8[_0xe0ae('0x45')][_0xe0ae('0x4d')]);_0xcefd27[_0xe0ae('0x50')]=qs[_0xe0ae('0x47')](_[_0xe0ae('0x4e')](_0x321ca8[_0xe0ae('0x45')],_0x535eed[_0xe0ae('0x47')]));if(_0x321ca8['query'][_0xe0ae('0x4f')]){_0xcefd27[_0xe0ae('0x50')]=_[_0xe0ae('0x51')](_0xcefd27[_0xe0ae('0x50')],{'$or':_['map'](_0xcefd27[_0xe0ae('0x49')],function(_0x26572e){var _0x409e91={};_0x409e91[_0x26572e]={'$like':'%'+_0x321ca8['query']['filter']+'%'};return _0x409e91;})});}_0xcefd27=_[_0xe0ae('0x51')]({},_0xcefd27,_0x321ca8[_0xe0ae('0x54')]);return _0x5dd6bd[_0xe0ae('0xc1')](_0xcefd27);}})['then'](function(_0x1f0a41){if(_0x1f0a41){_0x2839b8=_0x1f0a41[_0xe0ae('0x5d')];if(!_0x321ca8['query'][_0xe0ae('0x4b')](_0xe0ae('0x4c'))){_0xcefd27['limit']=qs[_0xe0ae('0x32')](_0x321ca8[_0xe0ae('0x45')][_0xe0ae('0x32')]);_0xcefd27[_0xe0ae('0x30')]=qs['offset'](_0x321ca8[_0xe0ae('0x45')][_0xe0ae('0x30')]);}return _0x5dd6bd[_0xe0ae('0xc1')](_0xcefd27);}})[_0xe0ae('0x24')](function(_0x4795ef){if(_0x4795ef){return _0x4795ef?{'count':_0x2839b8,'rows':_0x4795ef}:null;}})[_0xe0ae('0x24')](respondWithResult(_0x150cf2,null))[_0xe0ae('0x2b')](handleError(_0x150cf2,null));}; \ No newline at end of file +var _0x03ae=['Pause','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','description','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','FaxAccount','type','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x03ae,0x12d));var _0xe03a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x03ae[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xe03a('0x0'));var rimraf=require(_0xe03a('0x1'));var zipdir=require(_0xe03a('0x2'));var jsonpatch=require(_0xe03a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe03a('0x4'));var Mustache=require(_0xe03a('0x5'));var util=require(_0xe03a('0x6'));var path=require(_0xe03a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe03a('0x8'));var fs=require('fs');var fs_extra=require(_0xe03a('0x9'));var _=require(_0xe03a('0xa'));var squel=require(_0xe03a('0xb'));var crypto=require(_0xe03a('0xc'));var jsforce=require(_0xe03a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe03a('0xe'));var Papa=require('papaparse');var Redis=require(_0xe03a('0xf'));var authService=require(_0xe03a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe03a('0x11'));var hardwareService=require(_0xe03a('0x12'));var logger=require(_0xe03a('0x13'))('api');var utils=require(_0xe03a('0x14'));var config=require(_0xe03a('0x15'));var licenseUtil=require(_0xe03a('0x16'));var db=require(_0xe03a('0x17'))['db'];config['redis']=_[_0xe03a('0x18')](config[_0xe03a('0x19')],{'host':_0xe03a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe03a('0x19')]));require(_0xe03a('0x1b'))[_0xe03a('0x1c')](socket);var jayson=require(_0xe03a('0x1d'));var client=jayson[_0xe03a('0x1e')][_0xe03a('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3222f2,_0x59031d,_0x55b31b,_0x47315d){return new BPromise(function(_0x3176dc,_0x30b271){var _0x235348=_0x47315d||client;return _0x235348['request'](_0x3222f2,_0x55b31b)['then'](function(_0x5cf321){logger[_0xe03a('0x20')](_0xe03a('0x21'),_0x59031d,_0xe03a('0x22'));logger[_0xe03a('0x23')](_0xe03a('0x24'),_0x59031d,'request\x20sent',JSON[_0xe03a('0x25')](_0x5cf321));if(_0x5cf321[_0xe03a('0x26')]){if(_0x5cf321[_0xe03a('0x26')][_0xe03a('0x27')]===0x1f4){logger[_0xe03a('0x26')](_0xe03a('0x21'),_0x59031d,_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);return _0x30b271(_0x5cf321[_0xe03a('0x26')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x59031d,_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);return _0x3176dc(_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);}else{logger['info'](_0xe03a('0x21'),_0x59031d,_0xe03a('0x22'));_0x3176dc(_0x5cf321[_0xe03a('0x29')][_0xe03a('0x28')]);}})[_0xe03a('0x2a')](function(_0x4f3b38){logger['error']('FaxAccount,\x20%s,\x20%s',_0x59031d,_0x4f3b38);_0x30b271(_0x4f3b38);});});}function respondWithStatusCode(_0x5a4cc6,_0x5e2667){_0x5e2667=_0x5e2667||0xcc;return function(_0xa39697){if(_0xa39697){return _0x5a4cc6[_0xe03a('0x2b')](_0x5e2667);}return _0x5a4cc6[_0xe03a('0x2c')](_0x5e2667)[_0xe03a('0x2d')]();};}function respondWithResult(_0x32e302,_0xe5ab01){_0xe5ab01=_0xe5ab01||0xc8;return function(_0x1fd9e4){if(_0x1fd9e4){return _0x32e302[_0xe03a('0x2c')](_0xe5ab01)[_0xe03a('0x2e')](_0x1fd9e4);}};}function respondWithFilteredResult(_0x2f7e86,_0x1af574){return function(_0xd40a5f){if(_0xd40a5f){var _0x4c997f=typeof _0x1af574[_0xe03a('0x2f')]===_0xe03a('0x30')&&typeof _0x1af574[_0xe03a('0x31')]===_0xe03a('0x30');var _0x59fd00=_0xd40a5f['count'];var _0xdbf725=_0x4c997f?0x0:_0x1af574[_0xe03a('0x2f')];var _0x245f86=_0x4c997f?_0xd40a5f[_0xe03a('0x32')]:_0x1af574['offset']+_0x1af574[_0xe03a('0x31')];var _0x3f8e27;if(_0x245f86>=_0x59fd00){_0x245f86=_0x59fd00;_0x3f8e27=0xc8;}else{_0x3f8e27=0xce;}_0x2f7e86[_0xe03a('0x2c')](_0x3f8e27);return _0x2f7e86[_0xe03a('0x33')]('Content-Range',_0xdbf725+'-'+_0x245f86+'/'+_0x59fd00)[_0xe03a('0x2e')](_0xd40a5f);}return null;};}function patchUpdates(_0xc3f5a5){return function(_0x5deb7d){try{jsonpatch[_0xe03a('0x34')](_0x5deb7d,_0xc3f5a5,!![]);}catch(_0x4b5a10){return BPromise[_0xe03a('0x35')](_0x4b5a10);}return _0x5deb7d[_0xe03a('0x36')]();};}function saveUpdates(_0x3e6505,_0x5ebdf2){return function(_0xdf9068){if(_0xdf9068){return _0xdf9068[_0xe03a('0x37')](_0x3e6505)[_0xe03a('0x38')](function(_0x4b89eb){return _0x4b89eb;});}return null;};}function removeEntity(_0x562f16,_0x4d58a7){return function(_0x5d95db){if(_0x5d95db){return _0x5d95db[_0xe03a('0x39')]()[_0xe03a('0x38')](function(){var _0x23dc73=_0x5d95db[_0xe03a('0x3a')]({'plain':!![]});var _0x1514d4=_0xe03a('0x3b');return db[_0xe03a('0x3c')][_0xe03a('0x39')]({'where':{'type':_0x1514d4,'resourceId':_0x23dc73['id']}})[_0xe03a('0x38')](function(){return _0x5d95db;});})[_0xe03a('0x38')](function(){_0x562f16[_0xe03a('0x2c')](0xcc)[_0xe03a('0x2d')]();});}};}function handleEntityNotFound(_0x1f1598,_0xd04c01){return function(_0x3f9552){if(!_0x3f9552){_0x1f1598[_0xe03a('0x2b')](0x194);}return _0x3f9552;};}function handleError(_0x5b9f7a,_0xd827d9){_0xd827d9=_0xd827d9||0x1f4;return function(_0x141ee5){logger[_0xe03a('0x26')](_0x141ee5[_0xe03a('0x3d')]);if(_0x141ee5[_0xe03a('0x3e')]){delete _0x141ee5['name'];}_0x5b9f7a[_0xe03a('0x2c')](_0xd827d9)['send'](_0x141ee5);};}exports[_0xe03a('0x3f')]=function(_0x1ea878,_0x4b0f1f){var _0x1d0b09={'include':[{'model':db['Pause'],'as':_0xe03a('0x40')}]},_0x41030c={},_0x4910d1={'count':0x0,'rows':[]};var _0x4476de=_[_0xe03a('0x41')](db[_0xe03a('0x42')]['rawAttributes'],function(_0x5065f2){return{'name':_0x5065f2['fieldName'],'type':_0x5065f2[_0xe03a('0x43')]['key']};});_0x41030c['model']=_[_0xe03a('0x41')](_0x4476de,_0xe03a('0x3e'));_0x41030c[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x1ea878['query']);_0x41030c['filters']=_['intersection'](_0x41030c['model'],_0x41030c[_0xe03a('0x44')]);_0x1d0b09[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x41030c[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x1ea878['query'][_0xe03a('0x49')]));_0x1d0b09[_0xe03a('0x46')]=_0x1d0b09['attributes'][_0xe03a('0x4a')]?_0x1d0b09['attributes']:_0x41030c[_0xe03a('0x48')];if(!_0x1ea878['query'][_0xe03a('0x4b')]('nolimit')){_0x1d0b09[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x1ea878['query']['limit']);_0x1d0b09[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x1ea878[_0xe03a('0x44')][_0xe03a('0x2f')]);}_0x1d0b09[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x1ea878[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x1d0b09[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x1ea878[_0xe03a('0x44')],_0x41030c[_0xe03a('0x4f')]),_0x4476de);if(_0x1ea878['query'][_0xe03a('0x51')]){_0x1d0b09[_0xe03a('0x4e')]=_['merge'](_0x1d0b09[_0xe03a('0x4e')],{'$or':_['map'](_0x4476de,function(_0x258364){if(_0x258364['type']!=='VIRTUAL'){var _0x3d772b={};_0x3d772b[_0x258364[_0xe03a('0x3e')]]={'$like':'%'+_0x1ea878['query']['filter']+'%'};return _0x3d772b;}})});}_0x1d0b09=_[_0xe03a('0x52')]({},_0x1d0b09,_0x1ea878[_0xe03a('0x53')]);var _0xcc5985={'where':_0x1d0b09[_0xe03a('0x4e')]};return db[_0xe03a('0x42')][_0xe03a('0x32')](_0xcc5985)[_0xe03a('0x38')](function(_0x537830){_0x4910d1['count']=_0x537830;if(_0x1ea878['query'][_0xe03a('0x54')]){_0x1d0b09[_0xe03a('0x55')]=[{'all':!![]}];}return db[_0xe03a('0x42')]['findAll'](_0x1d0b09);})['then'](function(_0x39258f){_0x4910d1[_0xe03a('0x56')]=_0x39258f;return _0x4910d1;})[_0xe03a('0x38')](respondWithFilteredResult(_0x4b0f1f,_0x1d0b09))[_0xe03a('0x2a')](handleError(_0x4b0f1f,null));};exports[_0xe03a('0x57')]=function(_0x58c505,_0x3bfea1){var _0x39b4de={'raw':![],'where':{'id':_0x58c505[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0x59')],'as':_0xe03a('0x40')}]},_0x3a824d={};_0x3a824d[_0xe03a('0x48')]=_[_0xe03a('0x45')](db['FaxAccount'][_0xe03a('0x5a')]);_0x3a824d[_0xe03a('0x44')]=_['keys'](_0x58c505[_0xe03a('0x44')]);_0x3a824d[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x3a824d['model'],_0x3a824d['query']);_0x39b4de[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3a824d[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x58c505[_0xe03a('0x44')][_0xe03a('0x49')]));_0x39b4de[_0xe03a('0x46')]=_0x39b4de[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x39b4de[_0xe03a('0x46')]:_0x3a824d[_0xe03a('0x48')];if(_0x58c505[_0xe03a('0x44')][_0xe03a('0x54')]){_0x39b4de[_0xe03a('0x55')]=[{'all':!![]}];}_0x39b4de=_['merge']({},_0x39b4de,_0x58c505[_0xe03a('0x53')]);return db[_0xe03a('0x42')]['find'](_0x39b4de)[_0xe03a('0x38')](handleEntityNotFound(_0x3bfea1,null))[_0xe03a('0x38')](respondWithResult(_0x3bfea1,null))[_0xe03a('0x2a')](handleError(_0x3bfea1,null));};exports[_0xe03a('0x5b')]=function(_0x2f7a8f,_0x413de2){return db[_0xe03a('0x42')][_0xe03a('0x5b')](_0x2f7a8f[_0xe03a('0x5c')],{})[_0xe03a('0x38')](function(_0x4a3427){var _0x21d6c5=_0x2f7a8f['user'][_0xe03a('0x3a')]({'plain':!![]});if(!_0x21d6c5)throw new Error(_0xe03a('0x5d'));if(_0x21d6c5[_0xe03a('0x5e')]===_0xe03a('0x5f')){var _0x364995=_0x4a3427[_0xe03a('0x3a')]({'plain':!![]});var _0x1c5b89=_0xe03a('0x3b');return db['UserProfileSection'][_0xe03a('0x60')]({'where':{'name':_0x1c5b89,'userProfileId':_0x21d6c5['userProfileId']},'raw':!![]})[_0xe03a('0x38')](function(_0x551ef5){if(_0x551ef5&&_0x551ef5[_0xe03a('0x61')]===0x0){return db[_0xe03a('0x3c')][_0xe03a('0x5b')]({'name':_0x364995[_0xe03a('0x3e')],'resourceId':_0x364995['id'],'type':_0x551ef5[_0xe03a('0x3e')],'sectionId':_0x551ef5['id']},{})[_0xe03a('0x38')](function(){return _0x4a3427;});}else{return _0x4a3427;}})[_0xe03a('0x2a')](function(_0x3a46d3){logger[_0xe03a('0x26')](_0xe03a('0x62'),_0x3a46d3);throw _0x3a46d3;});}return _0x4a3427;})['then'](respondWithResult(_0x413de2,0xc9))[_0xe03a('0x2a')](handleError(_0x413de2,null));};exports[_0xe03a('0x37')]=function(_0x1ea1f4,_0x413902){if(_0x1ea1f4['body']['id']){delete _0x1ea1f4[_0xe03a('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x1ea1f4[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0x59')],'as':_0xe03a('0x40')}]})[_0xe03a('0x38')](handleEntityNotFound(_0x413902,null))[_0xe03a('0x38')](saveUpdates(_0x1ea1f4[_0xe03a('0x5c')],null))['then'](respondWithResult(_0x413902,null))[_0xe03a('0x2a')](handleError(_0x413902,null));};exports[_0xe03a('0x39')]=function(_0x4937e9,_0x40099f){return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x4937e9['params']['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x40099f,null))[_0xe03a('0x38')](removeEntity(_0x40099f,null))['catch'](handleError(_0x40099f,null));};exports[_0xe03a('0x63')]=function(_0x541690,_0x29cb00){return db[_0xe03a('0x42')][_0xe03a('0x63')]()[_0xe03a('0x38')](respondWithResult(_0x29cb00,null))['catch'](handleError(_0x29cb00,null));};exports[_0xe03a('0x64')]=function(_0x23a1d6,_0x353118,_0x3d0da4){if(_0x23a1d6[_0xe03a('0x5c')]['id']){delete _0x23a1d6[_0xe03a('0x5c')]['id'];}return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x23a1d6[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x353118,null))[_0xe03a('0x38')](function(_0x497dd3){if(_0x497dd3){_0x23a1d6[_0xe03a('0x5c')][_0xe03a('0x65')]=_0x497dd3['id'];return db[_0xe03a('0x66')]['create'](_0x23a1d6[_0xe03a('0x5c')]);}})[_0xe03a('0x38')](respondWithResult(_0x353118,null))[_0xe03a('0x2a')](handleError(_0x353118,null));};exports['getDispositions']=function(_0x1b0772,_0x57ce4c,_0x2e9a16){var _0x67c756={'raw':![],'where':{}};var _0x2a2f4e={};var _0x29d842={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x1b0772[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x57ce4c,null))[_0xe03a('0x38')](function(_0x4f628c){if(_0x4f628c){_0x2a2f4e['model']=_['keys'](db[_0xe03a('0x66')][_0xe03a('0x5a')]);_0x2a2f4e[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x1b0772['query']);_0x2a2f4e[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x2a2f4e[_0xe03a('0x48')],_0x2a2f4e['query']);_0x67c756['attributes']=_[_0xe03a('0x47')](_0x2a2f4e[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x1b0772[_0xe03a('0x44')]['fields']));_0x67c756[_0xe03a('0x46')]=_0x67c756[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x67c756[_0xe03a('0x46')]:_0x2a2f4e['model'];if(!_0x1b0772[_0xe03a('0x44')]['hasOwnProperty'](_0xe03a('0x68'))){_0x67c756['limit']=qs[_0xe03a('0x31')](_0x1b0772[_0xe03a('0x44')]['limit']);_0x67c756[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x1b0772['query'][_0xe03a('0x2f')]);}_0x67c756[_0xe03a('0x4c')]=qs['sort'](_0x1b0772[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x67c756[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x1b0772[_0xe03a('0x44')],_0x2a2f4e[_0xe03a('0x4f')]));_0x67c756[_0xe03a('0x4e')]['FaxAccountId']=_0x4f628c['id'];if(_0x1b0772[_0xe03a('0x44')][_0xe03a('0x51')]){_0x67c756[_0xe03a('0x4e')]=_['merge'](_0x67c756[_0xe03a('0x4e')],{'$or':_['map'](_0x67c756['attributes'],function(_0x40eaeb){var _0x3ba2af={};_0x3ba2af[_0x40eaeb]={'$like':'%'+_0x1b0772['query']['filter']+'%'};return _0x3ba2af;})});}_0x67c756=_[_0xe03a('0x52')]({},_0x67c756,_0x1b0772[_0xe03a('0x53')]);return db[_0xe03a('0x66')][_0xe03a('0x32')]({'where':_0x67c756[_0xe03a('0x4e')]})['then'](function(_0x2a9ec2){_0x29d842['count']=_0x2a9ec2;if(_0x1b0772[_0xe03a('0x44')][_0xe03a('0x54')]){_0x67c756['include']=[{'all':!![]}];}return db[_0xe03a('0x66')][_0xe03a('0x69')](_0x67c756);})[_0xe03a('0x38')](function(_0x657e57){_0x29d842['rows']=_0x657e57;return _0x29d842;});}})['then'](respondWithFilteredResult(_0x57ce4c,_0x67c756))[_0xe03a('0x2a')](handleError(_0x57ce4c,null));};exports[_0xe03a('0x6a')]=function(_0x5a1068,_0xa7c5e5,_0x5cc57c){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x5a1068[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0xa7c5e5,null))[_0xe03a('0x38')](function(_0x25c219){if(_0x25c219){return _0x25c219[_0xe03a('0x6a')](_0x5a1068['query'][_0xe03a('0x6b')]);}})[_0xe03a('0x38')](respondWithStatusCode(_0xa7c5e5,null))[_0xe03a('0x2a')](handleError(_0xa7c5e5,null));};exports[_0xe03a('0x6c')]=function(_0x363908,_0x5267e0,_0x2bf811){if(_0x363908['body']['id']){delete _0x363908[_0xe03a('0x5c')]['id'];}return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x363908['params']['id']}})['then'](handleEntityNotFound(_0x5267e0,null))[_0xe03a('0x38')](function(_0x1bade4){if(_0x1bade4){_0x363908[_0xe03a('0x5c')][_0xe03a('0x65')]=_0x1bade4['id'];return db['CannedAnswer'][_0xe03a('0x5b')](_0x363908[_0xe03a('0x5c')]);}})['then'](respondWithResult(_0x5267e0,null))[_0xe03a('0x2a')](handleError(_0x5267e0,null));};exports['getAnswers']=function(_0x4a9a28,_0x1c4c1b,_0x23c709){var _0x2a76a8={'raw':![],'where':{}};var _0x3b5d32={};var _0x25d38f={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x4a9a28[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x1c4c1b,null))['then'](function(_0x5289ca){if(_0x5289ca){_0x3b5d32[_0xe03a('0x48')]=_[_0xe03a('0x45')](db['CannedAnswer']['rawAttributes']);_0x3b5d32[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x4a9a28[_0xe03a('0x44')]);_0x3b5d32[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x3b5d32[_0xe03a('0x48')],_0x3b5d32[_0xe03a('0x44')]);_0x2a76a8[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3b5d32[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x4a9a28['query'][_0xe03a('0x49')]));_0x2a76a8[_0xe03a('0x46')]=_0x2a76a8[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x2a76a8[_0xe03a('0x46')]:_0x3b5d32[_0xe03a('0x48')];if(!_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x4b')](_0xe03a('0x68'))){_0x2a76a8[_0xe03a('0x31')]=qs['limit'](_0x4a9a28[_0xe03a('0x44')]['limit']);_0x2a76a8[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x4a9a28[_0xe03a('0x44')]['offset']);}_0x2a76a8[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x2a76a8[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x4a9a28[_0xe03a('0x44')],_0x3b5d32[_0xe03a('0x4f')]));_0x2a76a8['where'][_0xe03a('0x65')]=_0x5289ca['id'];if(_0x4a9a28['query']['filter']){_0x2a76a8[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0x2a76a8[_0xe03a('0x4e')],{'$or':_['map'](_0x2a76a8[_0xe03a('0x46')],function(_0x18114e){var _0xf2bdab={};_0xf2bdab[_0x18114e]={'$like':'%'+_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0xf2bdab;})});}_0x2a76a8=_[_0xe03a('0x52')]({},_0x2a76a8,_0x4a9a28[_0xe03a('0x53')]);return db[_0xe03a('0x6d')]['count']({'where':_0x2a76a8[_0xe03a('0x4e')]})[_0xe03a('0x38')](function(_0x2baa36){_0x25d38f['count']=_0x2baa36;if(_0x4a9a28[_0xe03a('0x44')]['includeAll']){_0x2a76a8[_0xe03a('0x55')]=[{'all':!![]}];}return db[_0xe03a('0x6d')][_0xe03a('0x69')](_0x2a76a8);})[_0xe03a('0x38')](function(_0x9eb970){_0x25d38f[_0xe03a('0x56')]=_0x9eb970;return _0x25d38f;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x1c4c1b,_0x2a76a8))['catch'](handleError(_0x1c4c1b,null));};exports[_0xe03a('0x6e')]=function(_0x3fbb37,_0x50787b,_0x3f4244){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x3fbb37[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x50787b,null))[_0xe03a('0x38')](function(_0x58d9ee){if(_0x58d9ee){return _0x58d9ee['removeAnswers'](_0x3fbb37[_0xe03a('0x44')][_0xe03a('0x6b')]);}})[_0xe03a('0x38')](respondWithStatusCode(_0x50787b,null))[_0xe03a('0x2a')](handleError(_0x50787b,null));};exports['addInteraction']=function(_0x30a599,_0x54e100,_0xa96422){return db[_0xe03a('0x6f')][_0xe03a('0x60')]({'where':{'id':_0x30a599[_0xe03a('0x58')]['id']}})['then'](handleEntityNotFound(_0x54e100,null))[_0xe03a('0x38')](function(_0x562c14){if(_0x562c14){return _0x562c14[_0xe03a('0x70')](_0x30a599[_0xe03a('0x5c')][_0xe03a('0x6b')],_[_0xe03a('0x71')](_0x30a599[_0xe03a('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x54e100,null))[_0xe03a('0x2a')](handleError(_0x54e100,null));};exports['getInteractions']=function(_0x27ca8f,_0x1abcd1,_0x44762d){var _0x57cacb={'raw':![],'where':{}};var _0xbcf643={};var _0x28287c={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x27ca8f[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x1abcd1,null))[_0xe03a('0x38')](function(_0x2b0d9a){if(_0x2b0d9a){_0xbcf643['model']=_[_0xe03a('0x45')](db[_0xe03a('0x6f')][_0xe03a('0x5a')]);_0xbcf643[_0xe03a('0x44')]=_['keys'](_0x27ca8f[_0xe03a('0x44')]);_0xbcf643[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0xbcf643['model'],_0xbcf643['query']);_0x57cacb[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0xbcf643['model'],qs[_0xe03a('0x49')](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x49')]));_0x57cacb['attributes']=_0x57cacb[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x57cacb[_0xe03a('0x46')]:_0xbcf643['model'];if(!_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x4b')](_0xe03a('0x68'))){_0x57cacb[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x31')]);_0x57cacb[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x27ca8f[_0xe03a('0x44')]['offset']);}_0x57cacb[_0xe03a('0x4c')]=qs['sort'](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x57cacb['where']=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x27ca8f[_0xe03a('0x44')],_0xbcf643['filters']));_0x57cacb[_0xe03a('0x4e')][_0xe03a('0x65')]=_0x2b0d9a['id'];if(_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x51')]){_0x57cacb[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0x57cacb[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0x57cacb[_0xe03a('0x46')],function(_0x4576fe){var _0x2d0d9b={};_0x2d0d9b[_0x4576fe]={'$like':'%'+_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0x2d0d9b;})});}_0x57cacb=_['merge']({},_0x57cacb,_0x27ca8f[_0xe03a('0x53')]);return db[_0xe03a('0x6f')]['count']({'where':_0x57cacb['where']})[_0xe03a('0x38')](function(_0x8fb8e5){_0x28287c[_0xe03a('0x32')]=_0x8fb8e5;if(_0x27ca8f[_0xe03a('0x44')]['includeAll']){_0x57cacb[_0xe03a('0x55')]=[{'model':db[_0xe03a('0x72')],'as':_0xe03a('0x73'),'required':![]},{'model':db[_0xe03a('0x74')],'as':_0xe03a('0x75'),'attributes':['name',_0xe03a('0x76'),_0xe03a('0x77')],'required':![]},{'model':db[_0xe03a('0x78')],'as':_0xe03a('0x79'),'attributes':['id','name',_0xe03a('0x7a')],'where':_0x27ca8f['query'][_0xe03a('0x7b')]?{'id':_0x27ca8f[_0xe03a('0x44')]['tag']}:undefined,'required':_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x7b')]?!![]:![]}];}return db[_0xe03a('0x6f')][_0xe03a('0x69')](_0x57cacb);})[_0xe03a('0x38')](function(_0x3e2810){_0x28287c[_0xe03a('0x56')]=_0x3e2810;return _0x28287c;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x1abcd1,_0x57cacb))[_0xe03a('0x2a')](handleError(_0x1abcd1,null));};exports[_0xe03a('0x7c')]=function(_0x58c939,_0x452d6d,_0x40be76){return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x58c939[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x452d6d,null))['then'](function(_0x292f38){if(_0x292f38){return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x34e5cd){return db['FaxApplication'][_0xe03a('0x39')]({'where':{'FaxAccountId':_0x58c939[_0xe03a('0x58')]['id']},'transaction':_0x34e5cd})[_0xe03a('0x38')](function(_0x268ac7){var _0x4c9d29=_[_0xe03a('0x41')](_0x58c939[_0xe03a('0x5c')],function(_0x510476){_0x510476[_0xe03a('0x65')]=_0x58c939[_0xe03a('0x58')]['id'];return _0x510476;});return db[_0xe03a('0x7f')][_0xe03a('0x80')](_0x4c9d29,{'transaction':_0x34e5cd});});})[_0xe03a('0x38')](function(){return db['FaxApplication'][_0xe03a('0x81')]({'where':{'FaxAccountId':_0x58c939[_0xe03a('0x58')]['id']},'order':_0xe03a('0x82')});});}})['then'](respondWithResult(_0x452d6d,null))[_0xe03a('0x2a')](handleError(_0x452d6d,null));};exports[_0xe03a('0x83')]=function(_0x3f04b7,_0x11426c,_0x2ff724){var _0xe43560={};var _0x3e4165={};var _0xe1de9f;var _0x2b4e3c;return db['FaxAccount']['findOne']({'where':{'id':_0x3f04b7[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x11426c,null))[_0xe03a('0x38')](function(_0x196077){if(_0x196077){_0xe1de9f=_0x196077;_0x3e4165[_0xe03a('0x48')]=_['keys'](db[_0xe03a('0x7f')][_0xe03a('0x5a')]);_0x3e4165[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x3f04b7['query']);_0x3e4165[_0xe03a('0x4f')]=_['intersection'](_0x3e4165[_0xe03a('0x48')],_0x3e4165[_0xe03a('0x44')]);_0xe43560[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3e4165[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x49')]));_0xe43560[_0xe03a('0x46')]=_0xe43560[_0xe03a('0x46')][_0xe03a('0x4a')]?_0xe43560['attributes']:_0x3e4165[_0xe03a('0x48')];_0xe43560['order']=qs[_0xe03a('0x4d')](_0x3f04b7[_0xe03a('0x44')]['sort']);_0xe43560[_0xe03a('0x4e')]=qs['filters'](_[_0xe03a('0x50')](_0x3f04b7[_0xe03a('0x44')],_0x3e4165[_0xe03a('0x4f')]));if(_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x51')]){_0xe43560['where']=_[_0xe03a('0x52')](_0xe43560[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0xe43560['attributes'],function(_0x171a66){var _0x517154={};_0x517154[_0x171a66]={'$like':'%'+_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0x517154;})});}_0xe43560=_[_0xe03a('0x52')]({},_0xe43560,_0x3f04b7[_0xe03a('0x53')]);return _0xe1de9f[_0xe03a('0x83')](_0xe43560);}})[_0xe03a('0x38')](function(_0x2a1500){if(_0x2a1500){_0x2b4e3c=_0x2a1500[_0xe03a('0x4a')];if(!_0x3f04b7['query'][_0xe03a('0x4b')]('nolimit')){_0xe43560['limit']=qs[_0xe03a('0x31')](_0x3f04b7[_0xe03a('0x44')]['limit']);_0xe43560[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x2f')]);}return _0xe1de9f[_0xe03a('0x83')](_0xe43560);}})[_0xe03a('0x38')](function(_0x23f7a4){if(_0x23f7a4){return _0x23f7a4?{'count':_0x2b4e3c,'rows':_0x23f7a4}:null;}})[_0xe03a('0x38')](respondWithResult(_0x11426c,null))['catch'](handleError(_0x11426c,null));};function Extension(_0x439811,_0x5d7afa,_0x45d4b6,_0x4b7031){this['context']=_0xe03a('0x84');this[_0xe03a('0x85')]=_0x439811[_0xe03a('0x86')];this[_0xe03a('0x87')]=_0x4b7031;this[_0xe03a('0x43')]='system';this[_0xe03a('0x88')]='Fax\x20Extension';this[_0xe03a('0x65')]=_0x439811['id'];this[_0xe03a('0x82')]=_0x5d7afa;this[_0xe03a('0x89')]=_0x45d4b6;}function createExtensionsReciveFax(_0x4521ef){var _0x442587=0x1;var _0x276c4e=[];_0x276c4e['push'](new Extension(_0x4521ef,_0x442587,'',_0xe03a('0x8a')));_0x442587+=0x1;_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x8c'),_0xe03a('0x8d')));_0x442587+=0x1;for(var _0x235961 in _0x4521ef){if(_0x4521ef[_0xe03a('0x4b')](_0x235961)&&(_0x235961==='ecm'||_0x235961==='localstationid'||_0x235961===_0xe03a('0x8e')||_0x235961===_0xe03a('0x8f')||_0x235961===_0xe03a('0x90')||_0x235961===_0xe03a('0x91')||_0x235961===_0xe03a('0x92')||_0x235961==='modem'||_0x235961===_0xe03a('0x93'))){_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x94')+_0x235961+')='+_0x4521ef[_0x235961],_0xe03a('0x8d')));_0x442587+=0x1;}}_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,'6',_0xe03a('0x95')));_0x442587+=0x1;_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x96'),_0xe03a('0x97')));_0x442587=0x0;return _0x276c4e;}exports[_0xe03a('0x98')]=function(_0x290195,_0x5c742f,_0x4df3a3){var _0x18c70c;return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x4ca903){return db[_0xe03a('0x42')][_0xe03a('0x5b')](_0x290195[_0xe03a('0x5c')],{'transaction':_0x4ca903})[_0xe03a('0x38')](function(_0x29f86b){_0x18c70c=_0x29f86b[_0xe03a('0x3a')]({'plain':!![]});return db[_0xe03a('0x99')][_0xe03a('0x80')](createExtensionsReciveFax(_0x18c70c),{'transaction':_0x4ca903});});})[_0xe03a('0x38')](function(){return _0x18c70c;})[_0xe03a('0x38')](respondWithResult(_0x5c742f,null))[_0xe03a('0x2a')](handleError(_0x5c742f,null));};exports['updateAccountApplications']=function(_0x3838bc,_0x569e4d,_0x3c895d){var _0x29d4e9;return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x20c0fa){return db[_0xe03a('0x42')][_0xe03a('0x37')](_0x3838bc[_0xe03a('0x5c')],{'where':{'id':_0x3838bc[_0xe03a('0x5c')]['id']},'transaction':_0x20c0fa})[_0xe03a('0x38')](function(_0x18c18c){return db[_0xe03a('0x99')][_0xe03a('0x39')]({'where':{'FaxAccountId':_0x3838bc['body']['id']},'transaction':_0x20c0fa})[_0xe03a('0x38')](function(_0x47f998){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x3838bc[_0xe03a('0x5c')],[_0xe03a('0x9a'),_0xe03a('0x9b'),_0xe03a('0x9c'),_0xe03a('0x9d'),_0xe03a('0x9e'),_0xe03a('0x9f')])),{'transaction':_0x20c0fa});});});})[_0xe03a('0x38')](function(){return db[_0xe03a('0x42')][_0xe03a('0xa0')](_0x3838bc[_0xe03a('0x5c')]['id']);})[_0xe03a('0x38')](respondWithResult(_0x569e4d,null))['catch'](handleError(_0x569e4d,null));};exports[_0xe03a('0xa1')]=function(_0x14448c,_0x3a1da4,_0x285ec1){var _0xffd4d={'raw':!![],'where':{}};var _0x347354={};var _0x22f48d={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x14448c[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x3a1da4,null))[_0xe03a('0x38')](function(_0x1cc846){if(_0x1cc846){_0x347354[_0xe03a('0x48')]=_[_0xe03a('0x45')](db[_0xe03a('0xa2')][_0xe03a('0x5a')]);_0x347354[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x14448c[_0xe03a('0x44')]);_0x347354[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x347354['model'],_0x347354['query']);_0xffd4d[_0xe03a('0x46')]=_['intersection'](_0x347354[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x49')]));_0xffd4d[_0xe03a('0x46')]=_0xffd4d[_0xe03a('0x46')][_0xe03a('0x4a')]?_0xffd4d['attributes']:_0x347354[_0xe03a('0x48')];if(!_0x14448c[_0xe03a('0x44')]['hasOwnProperty'](_0xe03a('0x68'))){_0xffd4d[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x31')]);_0xffd4d[_0xe03a('0x2f')]=qs['offset'](_0x14448c['query'][_0xe03a('0x2f')]);}_0xffd4d[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x4d')]);_0xffd4d[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x14448c[_0xe03a('0x44')],_0x347354[_0xe03a('0x4f')]));_0xffd4d['where']['FaxAccountId']=_0x1cc846['id'];if(_0x14448c[_0xe03a('0x44')][_0xe03a('0x51')]){_0xffd4d[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0xffd4d[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0xffd4d[_0xe03a('0x46')],function(_0x3c48cc){var _0x1d7450={};_0x1d7450[_0x3c48cc]={'$like':'%'+_0x14448c[_0xe03a('0x44')]['filter']+'%'};return _0x1d7450;})});}if(_0x14448c[_0xe03a('0x44')]['$gte']){var _0x5b28b9=_0x14448c[_0xe03a('0x44')][_0xe03a('0xa3')][_0xe03a('0xa4')](',');var _0x12adeb={};_0x12adeb[_0x5b28b9[0x0]]={'$gte':moment(_0x5b28b9[0x1])[_0xe03a('0xa5')](_0xe03a('0xa6'))};_0xffd4d[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0xffd4d[_0xe03a('0x4e')],_0x12adeb);}_0xffd4d=_[_0xe03a('0x52')]({},_0xffd4d,_0x14448c[_0xe03a('0x53')]);return db['FaxMessage'][_0xe03a('0x32')]({'where':_0xffd4d[_0xe03a('0x4e')]})[_0xe03a('0x38')](function(_0x5d40cd){_0x22f48d[_0xe03a('0x32')]=_0x5d40cd;if(_0x14448c['query'][_0xe03a('0x54')]){_0xffd4d[_0xe03a('0x55')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0xffd4d);})['then'](function(_0x445c4a){_0x22f48d[_0xe03a('0x56')]=_0x445c4a;return _0x22f48d;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x3a1da4,_0xffd4d))[_0xe03a('0x2a')](handleError(_0x3a1da4,null));};exports[_0xe03a('0xa7')]=function(_0x2c61a0,_0x241d1a,_0x5e3667){var _0x128038,_0x284c08={},_0xb01a9a;if(_0x2c61a0['body']['to']){_0xb01a9a=_0x2c61a0[_0xe03a('0x5c')]['to'][0x0];}return db['FaxAccount'][_0xe03a('0x60')]({'where':{'id':_0x2c61a0[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0xa8')],'as':_0xe03a('0xa9'),'include':[{'model':db['CmContact'],'as':_0xe03a('0xaa'),'where':{'fax':_0xb01a9a},'limit':0x1,'order':[[_0xe03a('0x9d'),_0xe03a('0xab')]]}]}]})[_0xe03a('0x38')](handleEntityNotFound(_0x241d1a,null))[_0xe03a('0x38')](function(_0x5245eb){_0x128038=_0x5245eb;if(_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')]&&_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')]['length']){for(var _0x3cc479=0x0;_0x3cc479<_0x2c61a0['body'][_0xe03a('0xac')][_0xe03a('0x4a')];_0x3cc479+=0x1){_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]={'filename':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]['name'],'id':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]['id'],'path':path[_0xe03a('0xad')](config[_0xe03a('0xae')],'server/files/attachments',_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479][_0xe03a('0xaf')])};}}return respondWithRpcPromise(_0xe03a('0xb0'),'CheckAfterSend',{'FaxAccountId':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x58')]['id'])?undefined:_0x2c61a0[_0xe03a('0x58')]['id'],'path':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')])?undefined:_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')],'fax':_['isNil'](_0x2c61a0['body']['to'][0x0])?undefined:_0x2c61a0[_0xe03a('0x5c')]['to'][0x0]},client9002);})[_0xe03a('0x38')](function(){if(_0x128038){if(_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xb2')])){_0x2c61a0['body'][_0xe03a('0xb2')]=util['format'](_0xe03a('0xb3'),_0x128038[_0xe03a('0x3e')],_0x128038['fax']);}if(_0x128038['List']){if(_0x128038[_0xe03a('0xa9')][_0xe03a('0xaa')][_0xe03a('0x4a')]){return _0x128038['List'][_0xe03a('0xaa')][0x0];}else{return db[_0xe03a('0x72')][_0xe03a('0x5b')](_[_0xe03a('0x18')](_0x2c61a0[_0xe03a('0x5c')],{'firstName':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'phone':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'fax':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'ListId':_0x128038[_0xe03a('0x9f')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xe03a('0x38')](function(_0x218856){if(_0x218856){return db['FaxInteraction'][_0xe03a('0x60')]({'where':{'ContactId':_0x218856['id'],'closed':![],'FaxAccountId':_0x128038['id']}})[_0xe03a('0x38')](function(_0xd0e263){if(_0xd0e263){return[_0xd0e263,![]];}return db[_0xe03a('0x6f')]['create']({'UserId':_0x2c61a0['user']['id'],'ContactId':_0x218856['id'],'FaxAccountId':_0x128038['id'],'fax':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'firstMsgDirection':_0xe03a('0xb4'),'Messages':[_['merge'](_0x2c61a0[_0xe03a('0x5c')],{'read':![],'body':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0xb5')],'FaxAccountId':_0x128038['id'],'UserId':_0x2c61a0[_0xe03a('0x5f')]['id'],'ContactId':_0x218856['id'],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']})]},{'include':[{'model':db[_0xe03a('0xa2')],'as':_0xe03a('0xb6')}]})['then'](function(_0x3a53b5){return[_0x3a53b5,!![]];});});}else{throw new Error(_0xe03a('0xb7'));}})[_0xe03a('0xb8')](function(_0x2ea3f1,_0x540d52){if(_0x540d52){return _0x2ea3f1;}return db[_0xe03a('0xa2')][_0xe03a('0x5b')]({'direction':_0xe03a('0xb4'),'read':![],'body':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0xb5')],'FaxAccountId':_0x128038['id'],'FaxInteractionId':_0x2ea3f1['id'],'UserId':_0x2c61a0['user']['id'],'ContactId':_0x2ea3f1[_0xe03a('0xb9')],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']})['then'](function(_0x12a92a){_0x2ea3f1[_0xe03a('0xba')][_0xe03a('0xb6')]=[];_0x2ea3f1[_0xe03a('0xba')][_0xe03a('0xb6')][_0xe03a('0x8b')](_0x12a92a[_0xe03a('0xba')]);return _0x2ea3f1;});})[_0xe03a('0x38')](function(_0x5b1c){respondWithRpcPromise(_0xe03a('0xbb'),_0xe03a('0xbb'),{'FaxAccountId':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x58')]['id'])?undefined:_0x2c61a0[_0xe03a('0x58')]['id'],'path':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')])?undefined:_0x2c61a0[_0xe03a('0x5c')]['attachments'][0x0][_0xe03a('0x7')],'fax':_[_0xe03a('0xb1')](_0x2c61a0['body']['to'][0x0])?undefined:_0x2c61a0['body']['to'][0x0],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']},client9002)[_0xe03a('0x38')](function(_0x3136de){logger['info'](_0xe03a('0xbc'),_0x3136de);})[_0xe03a('0x2a')](function(_0x8d4c1){logger[_0xe03a('0x20')]('SendFaxRpc,\x20%s',_0x8d4c1);});return _0x5b1c;})['then'](respondWithResult(_0x241d1a,null))[_0xe03a('0x2a')](handleError(_0x241d1a,null));};exports[_0xe03a('0xbd')]=function(_0x3243a0,_0x2e4a82,_0x48a5af){return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x3243a0['params']['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x2e4a82,null))[_0xe03a('0x38')](function(_0x2e7907){if(_0x2e7907){return _0x2e7907[_0xe03a('0xbd')](_0x3243a0[_0xe03a('0x5c')]['ids'],_[_0xe03a('0x71')](_0x3243a0[_0xe03a('0x5c')],[_0xe03a('0x6b'),'id'])||{})[_0xe03a('0xb8')](function(_0x3ff76d){for(var _0x31e0ac=0x0;_0x31e0ac<_0x3243a0[_0xe03a('0x5c')][_0xe03a('0x6b')][_0xe03a('0x4a')];_0x31e0ac+=0x1){socket[_0xe03a('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x3243a0[_0xe03a('0x5c')]['ids'][_0x31e0ac]),'FaxAccountId':Number(_0x3243a0['params']['id'])});}return _0x3ff76d;});}})[_0xe03a('0x38')](respondWithResult(_0x2e4a82,null))[_0xe03a('0x2a')](handleError(_0x2e4a82,null));};exports['removeAgents']=function(_0x553067,_0x4f5a25,_0x582d94){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x553067['params']['id']}})['then'](handleEntityNotFound(_0x4f5a25,null))[_0xe03a('0x38')](function(_0x5d99c0){if(_0x5d99c0){return _0x5d99c0[_0xe03a('0xbf')](_0x553067[_0xe03a('0x44')][_0xe03a('0x6b')])[_0xe03a('0x38')](function(){if(_[_0xe03a('0xc0')](_0x553067['query'][_0xe03a('0x6b')])){for(var _0x52fe70=0x0;_0x52fe70<_0x553067['query'][_0xe03a('0x6b')][_0xe03a('0x4a')];_0x52fe70+=0x1){socket[_0xe03a('0xbe')](_0xe03a('0xc1'),{'UserId':Number(_0x553067[_0xe03a('0x44')]['ids'][_0x52fe70]),'FaxAccountId':Number(_0x553067[_0xe03a('0x58')]['id'])});}}else{socket[_0xe03a('0xbe')](_0xe03a('0xc1'),{'UserId':Number(_0x553067[_0xe03a('0x44')][_0xe03a('0x6b')]),'FaxAccountId':Number(_0x553067[_0xe03a('0x58')]['id'])});}});}})[_0xe03a('0x38')](respondWithStatusCode(_0x4f5a25,null))[_0xe03a('0x2a')](handleError(_0x4f5a25,null));};exports[_0xe03a('0xc2')]=function(_0x53aca5,_0x55a1f9,_0x220e3e){var _0x49b75c={};var _0x3dd441={};var _0x4438b4;var _0x162ebd;return db['FaxAccount']['findOne']({'where':{'id':_0x53aca5['params']['id']}})['then'](handleEntityNotFound(_0x55a1f9,null))[_0xe03a('0x38')](function(_0x33402c){if(_0x33402c){_0x4438b4=_0x33402c;_0x3dd441[_0xe03a('0x48')]=_[_0xe03a('0x45')](db[_0xe03a('0x74')][_0xe03a('0x5a')]);_0x3dd441[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x53aca5['query']);_0x3dd441[_0xe03a('0x4f')]=_['intersection'](_0x3dd441['model'],_0x3dd441['query']);_0x49b75c['attributes']=_['intersection'](_0x3dd441[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x49')]));_0x49b75c['attributes']=_0x49b75c[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x49b75c['attributes']:_0x3dd441[_0xe03a('0x48')];_0x49b75c[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x49b75c[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_['pick'](_0x53aca5[_0xe03a('0x44')],_0x3dd441['filters']));if(_0x53aca5['query'][_0xe03a('0x51')]){_0x49b75c['where']=_['merge'](_0x49b75c[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0x49b75c[_0xe03a('0x46')],function(_0x9ca88f){var _0x537566={};_0x537566[_0x9ca88f]={'$like':'%'+_0x53aca5['query'][_0xe03a('0x51')]+'%'};return _0x537566;})});}_0x49b75c=_[_0xe03a('0x52')]({},_0x49b75c,_0x53aca5[_0xe03a('0x53')]);return _0x4438b4[_0xe03a('0xc2')](_0x49b75c);}})[_0xe03a('0x38')](function(_0x56e0a8){if(_0x56e0a8){_0x162ebd=_0x56e0a8[_0xe03a('0x4a')];if(!_0x53aca5['query'][_0xe03a('0x4b')]('nolimit')){_0x49b75c[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x31')]);_0x49b75c[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x2f')]);}return _0x4438b4[_0xe03a('0xc2')](_0x49b75c);}})[_0xe03a('0x38')](function(_0x391a27){if(_0x391a27){return _0x391a27?{'count':_0x162ebd,'rows':_0x391a27}:null;}})[_0xe03a('0x38')](respondWithResult(_0x55a1f9,null))['catch'](handleError(_0x55a1f9,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4778651..6fdfea2 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 _0xfdd6=['FaxAccount','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x49767f,_0x25c006){var _0x5a30b2=function(_0x8f0880){while(--_0x8f0880){_0x49767f['push'](_0x49767f['shift']());}};_0x5a30b2(++_0x25c006);}(_0xfdd6,0x1af));var _0x6fdd=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0xfdd6[_0x631a3c];return _0x2bdfa3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x6fdd('0x0'))['db'][_0x6fdd('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6fdd('0x2'),'afterUpdate':_0x6fdd('0x3'),'afterDestroy':_0x6fdd('0x4')};function emitEvent(_0xb3c0f7){return function(_0x5138b4,_0x2cbb57,_0x250a16){FaxAccountEvents['emit'](_0xb3c0f7+':'+_0x5138b4['id'],_0x5138b4);FaxAccountEvents['emit'](_0xb3c0f7,_0x5138b4);_0x250a16(null);};}for(var e in events){if(events[_0x6fdd('0x5')](e)){var event=events[e];FaxAccount[_0x6fdd('0x6')](e,emitEvent(event));}}module[_0x6fdd('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x6e5a=['../../mysqldb','FaxAccount','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x191b2d,_0x15f3d9){var _0x364d36=function(_0x4f1f26){while(--_0x4f1f26){_0x191b2d['push'](_0x191b2d['shift']());}};_0x364d36(++_0x15f3d9);}(_0x6e5a,0x13a));var _0xa6e5=function(_0x28d8fc,_0x3c0cea){_0x28d8fc=_0x28d8fc-0x0;var _0x572be6=_0x6e5a[_0x28d8fc];return _0x572be6;};'use strict';var EventEmitter=require(_0xa6e5('0x0'));var FaxAccount=require(_0xa6e5('0x1'))['db'][_0xa6e5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6e5('0x3'),'afterUpdate':_0xa6e5('0x4'),'afterDestroy':_0xa6e5('0x5')};function emitEvent(_0x2b9f01){return function(_0x28a2d3,_0x5e8d5b,_0x1b173f){FaxAccountEvents[_0xa6e5('0x6')](_0x2b9f01+':'+_0x28a2d3['id'],_0x28a2d3);FaxAccountEvents[_0xa6e5('0x6')](_0x2b9f01,_0x28a2d3);_0x1b173f(null);};}for(var e in events){if(events[_0xa6e5('0x7')](e)){var event=events[e];FaxAccount[_0xa6e5('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 44422dd..bdf83f1 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 _0xf837=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','util','../../config/logger'];(function(_0x3a5a91,_0x480760){var _0x4d363a=function(_0x1c5b0e){while(--_0x1c5b0e){_0x3a5a91['push'](_0x3a5a91['shift']());}};_0x4d363a(++_0x480760);}(_0xf837,0x73));var _0x7f83=function(_0x2a20e4,_0x52d92e){_0x2a20e4=_0x2a20e4-0x0;var _0x23037c=_0xf837[_0x2a20e4];return _0x23037c;};'use strict';var _=require('lodash');var util=require(_0x7f83('0x0'));var logger=require(_0x7f83('0x1'))(_0x7f83('0x2'));var moment=require(_0x7f83('0x3'));var BPromise=require(_0x7f83('0x4'));var rp=require(_0x7f83('0x5'));var fs=require('fs');var path=require(_0x7f83('0x6'));var rimraf=require(_0x7f83('0x7'));var config=require(_0x7f83('0x8'));var attributes=require(_0x7f83('0x9'));module['exports']=function(_0x31866f,_0x5a39f6){return _0x31866f[_0x7f83('0xa')](_0x7f83('0xb'),attributes,{'tableName':_0x7f83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49b5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxAccount','fax_accounts','lodash','../../config/logger','api'];(function(_0x31e719,_0x43c524){var _0x29f6e1=function(_0x34134f){while(--_0x34134f){_0x31e719['push'](_0x31e719['shift']());}};_0x29f6e1(++_0x43c524);}(_0x49b5,0xd5));var _0x549b=function(_0x1ed9b5,_0x200061){_0x1ed9b5=_0x1ed9b5-0x0;var _0x5cf9fc=_0x49b5[_0x1ed9b5];return _0x5cf9fc;};'use strict';var _=require(_0x549b('0x0'));var util=require('util');var logger=require(_0x549b('0x1'))(_0x549b('0x2'));var moment=require(_0x549b('0x3'));var BPromise=require(_0x549b('0x4'));var rp=require(_0x549b('0x5'));var fs=require('fs');var path=require(_0x549b('0x6'));var rimraf=require(_0x549b('0x7'));var config=require(_0x549b('0x8'));var attributes=require('./faxAccount.attributes');module[_0x549b('0x9')]=function(_0x2da9a5,_0x1a7ea1){return _0x2da9a5['define'](_0x549b('0xa'),attributes,{'tableName':_0x549b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 0cda827..c90716b 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 _0xbaa0=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','Contacts','DESC','FaxApplication','List','applications','Applications','list','orderBy','asc','length','ListId','contact','fax','FaxInteraction','create','spread','get','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','map','include','model','info','GetFaxAccount','debug','NotifyFaxAccount','body','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','isNil','from','Sequelize'];(function(_0x35ca58,_0x1a6371){var _0x2efd2e=function(_0x362283){while(--_0x362283){_0x35ca58['push'](_0x35ca58['shift']());}};_0x2efd2e(++_0x1a6371);}(_0xbaa0,0x147));var _0x0baa=function(_0x43dcb6,_0x2c9c40){_0x43dcb6=_0x43dcb6-0x0;var _0x39f118=_0xbaa0[_0x43dcb6];return _0x39f118;};'use strict';var _=require(_0x0baa('0x0'));var util=require('util');var moment=require(_0x0baa('0x1'));var BPromise=require(_0x0baa('0x2'));var rs=require(_0x0baa('0x3'));var fs=require('fs');var Redis=require(_0x0baa('0x4'));var db=require(_0x0baa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baa('0x6'))(_0x0baa('0x7'));var config=require(_0x0baa('0x8'));var jayson=require(_0x0baa('0x9'));var client=jayson[_0x0baa('0xa')][_0x0baa('0xb')]({'port':0x232c});config['redis']=_[_0x0baa('0xc')](config[_0x0baa('0xd')],{'host':_0x0baa('0xe'),'port':0x18eb});var socket=require(_0x0baa('0xf'))(new Redis(config[_0x0baa('0xd')]));require('./faxAccount.socket')[_0x0baa('0x10')](socket);function respondWithRpcPromise(_0x6bc505,_0x5ecd86,_0x3ceaa7){return new BPromise(function(_0x5900a3,_0x33e58b){return client[_0x0baa('0x11')](_0x6bc505,_0x3ceaa7)[_0x0baa('0x12')](function(_0x38f478){logger['info'](_0x0baa('0x13'),_0x5ecd86,_0x0baa('0x14'));logger['debug'](_0x0baa('0x15'),_0x5ecd86,_0x0baa('0x14'),JSON[_0x0baa('0x16')](_0x38f478));if(_0x38f478[_0x0baa('0x17')]){if(_0x38f478[_0x0baa('0x17')][_0x0baa('0x18')]===0x1f4){logger['error'](_0x0baa('0x13'),_0x5ecd86,_0x38f478[_0x0baa('0x17')][_0x0baa('0x19')]);return _0x33e58b(_0x38f478['error']['message']);}logger[_0x0baa('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5ecd86,_0x38f478['error']['message']);return _0x5900a3(_0x38f478[_0x0baa('0x17')][_0x0baa('0x19')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x5ecd86,_0x0baa('0x14'));_0x5900a3(_0x38f478[_0x0baa('0x1a')][_0x0baa('0x19')]);}})[_0x0baa('0x1b')](function(_0x4dcaab){logger[_0x0baa('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5ecd86,_0x4dcaab);_0x33e58b(_0x4dcaab);});});}exports['GetFaxAccount']=function(_0x49d6bc){var _0x2ebb33=this;return new Promise(function(_0x3aa1e0,_0x2e8b48){return db['FaxAccount'][_0x0baa('0x1c')]({'raw':_0x49d6bc[_0x0baa('0x1d')]?_0x49d6bc[_0x0baa('0x1d')][_0x0baa('0x1e')]===undefined?!![]:![]:!![],'where':_0x49d6bc[_0x0baa('0x1d')]?_0x49d6bc[_0x0baa('0x1d')][_0x0baa('0x1f')]||null:null,'attributes':_0x49d6bc[_0x0baa('0x1d')]?_0x49d6bc[_0x0baa('0x1d')][_0x0baa('0x20')]||null:null,'limit':_0x49d6bc[_0x0baa('0x1d')]?_0x49d6bc['options']['limit']||null:null,'include':_0x49d6bc['options']?_0x49d6bc[_0x0baa('0x1d')]['include']?_[_0x0baa('0x21')](_0x49d6bc[_0x0baa('0x1d')][_0x0baa('0x22')],function(_0x5d27ad){return{'model':db[_0x5d27ad[_0x0baa('0x23')]],'as':_0x5d27ad['as'],'attributes':_0x5d27ad[_0x0baa('0x20')],'include':_0x5d27ad[_0x0baa('0x22')]?_[_0x0baa('0x21')](_0x5d27ad[_0x0baa('0x22')],function(_0x4e52b5){return{'model':db[_0x4e52b5[_0x0baa('0x23')]],'as':_0x4e52b5['as'],'attributes':_0x4e52b5[_0x0baa('0x20')],'include':_0x4e52b5[_0x0baa('0x22')]?_['map'](_0x4e52b5[_0x0baa('0x22')],function(_0x149637){return{'model':db[_0x149637[_0x0baa('0x23')]],'as':_0x149637['as'],'attributes':_0x149637[_0x0baa('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0baa('0x12')](function(_0xc1f073){logger[_0x0baa('0x24')](_0x0baa('0x25'),_0x49d6bc);logger[_0x0baa('0x26')](_0x0baa('0x25'),_0x49d6bc,JSON[_0x0baa('0x16')](_0xc1f073));_0x3aa1e0(_0xc1f073);})[_0x0baa('0x1b')](function(_0x563604){logger['error'](_0x0baa('0x25'),_0x563604[_0x0baa('0x19')],_0x49d6bc);_0x2e8b48(_0x2ebb33[_0x0baa('0x17')](0x1f4,_0x563604['message']));});});};exports[_0x0baa('0x27')]=function(_0xdfae2b,_0x226f9a,_0x5061f7){var _0x48ffa5=this;return new Promise(function(_0x265870,_0x3c8f24){var _0x2ea3a0={'body':_0xdfae2b[_0x0baa('0x28')],'channel':'fax'};var _0x5b3627=[];var _0x3ea85c=[];var _0x5b9562={};return db[_0x0baa('0x29')][_0x0baa('0x2a')]()[_0x0baa('0x12')](function(_0x5de243){if(!_0x5de243){throw new db['Sequelize'][(_0x0baa('0x2b'))](_0x0baa('0x2c'));}_0x5b3627=_[_0x0baa('0x2d')](_['keys'](_0x5de243),[_0x0baa('0x2e'),_0x0baa('0x2f')]);_0x3ea85c=_[_0x0baa('0x2d')](_[_0x0baa('0x30')](_0x5de243),[_0x0baa('0x2e'),_0x0baa('0x2f'),_0x0baa('0x31'),'ListId']);if(_0xdfae2b[_0x0baa('0x28')]['id']){delete _0xdfae2b['body']['id'];}if(_[_0x0baa('0x32')](_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x33')])){throw new db[(_0x0baa('0x34'))][(_0x0baa('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x0baa('0x32')](_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x28')])||_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x28')]===''){throw new db[(_0x0baa('0x34'))][(_0x0baa('0x2b'))](_0x0baa('0x35'));}if(_[_0x0baa('0x32')](_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x36')])){throw new db[(_0x0baa('0x34'))][(_0x0baa('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ea85c);}if(!_[_0x0baa('0x37')](_0x3ea85c,_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x36')])){throw new db[(_0x0baa('0x34'))][(_0x0baa('0x2b'))](_0x0baa('0x38')+_0x3ea85c);}_0x5b9562[_0xdfae2b['body']['mapKey']]=_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x33')];})['then'](function(){return db[_0x0baa('0x39')][_0x0baa('0x3a')]({'where':{'id':_0xdfae2b[_0x0baa('0x3b')]['id']},'include':[{'model':db[_0x0baa('0x3c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0baa('0x3d'),'where':_0x5b9562,'limit':0x1,'order':[['updatedAt',_0x0baa('0x3e')]]}]},{'model':db[_0x0baa('0x3f')],'as':'Applications'}]});})[_0x0baa('0x12')](function(_0x19d0ab){if(_0x19d0ab&&_0x19d0ab[_0x0baa('0x40')]){var _0x4ff698=_0x19d0ab['get']({'plain':!![]});_0x2ea3a0[_0x0baa('0x3b')]=_0x4ff698;_0x2ea3a0[_0x0baa('0x41')]=_0x4ff698[_0x0baa('0x42')];_0x2ea3a0[_0x0baa('0x43')]=_0x4ff698[_0x0baa('0x40')];_0x2ea3a0[_0x0baa('0x41')]=_[_0x0baa('0x44')](_0x2ea3a0[_0x0baa('0x41')],['priority'],[_0x0baa('0x45')]);if(_0x2ea3a0[_0x0baa('0x3b')][_0x0baa('0x42')]){delete _0x2ea3a0[_0x0baa('0x3b')][_0x0baa('0x42')];}if(_0x2ea3a0[_0x0baa('0x3b')][_0x0baa('0x40')]&&_0x2ea3a0['account'][_0x0baa('0x40')][_0x0baa('0x3d')][_0x0baa('0x46')]){return _0x2ea3a0[_0x0baa('0x3b')][_0x0baa('0x40')][_0x0baa('0x3d')][0x0];}var _0x2f6db2=_[_0x0baa('0xc')](_0xdfae2b[_0x0baa('0x28')],{'firstName':_0xdfae2b[_0x0baa('0x28')]['from'],'ListId':_0x4ff698[_0x0baa('0x47')]});_0x2f6db2[_0xdfae2b[_0x0baa('0x28')]['mapKey']]=_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x33')];return db['CmContact']['create'](_0x2f6db2,{'fields':_0x5b3627,'raw':!![]});}})[_0x0baa('0x12')](function(_0x861614){_0x2ea3a0[_0x0baa('0x48')]=_0x861614;if(_0x861614){var _0x315689={'ContactId':_0x861614['id'],'FaxAccountId':_0xdfae2b[_0x0baa('0x3b')]['id'],'fax':_0x861614[_0x0baa('0x49')]};return db['FaxInteraction'][_0x0baa('0x3a')]({'where':{'ContactId':_0x861614['id'],'closed':![],'FaxAccountId':_0xdfae2b['account']['id']}})['then'](function(_0x5adc2a){if(_0x5adc2a){return[_0x5adc2a,![]];}return db[_0x0baa('0x4a')][_0x0baa('0x4b')](_0x315689)[_0x0baa('0x12')](function(_0xa5563f){return[_0xa5563f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0baa('0x4c')](function(_0x2d69ee,_0x5a8c5b){var _0x57ec47=_0x2d69ee[_0x0baa('0x4d')]({'plain':!![]});if(_0x5a8c5b){if(_0x2ea3a0['account']['autoclose']){_0x2ea3a0['applications'][_0x0baa('0x4e')]({'id':0x0,'priority':_0x2ea3a0[_0x0baa('0x41')][_0x0baa('0x46')]+0x1,'app':_0x0baa('0x4f'),'appdata':_0x0baa('0x50'),'interval':_0x0baa('0x51')});}_0x57ec47[_0x0baa('0x52')]=!![];}else{_0x57ec47['created']=![];}_0x2ea3a0[_0x0baa('0x53')]=_0x57ec47;return db[_0x0baa('0x54')][_0x0baa('0x4b')]({'body':_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x28')],'FaxAccountId':_0xdfae2b[_0x0baa('0x3b')]['id'],'FaxInteractionId':_0x2d69ee['id'],'direction':'in','ContactId':_0x2d69ee[_0x0baa('0x55')],'AttachmentId':_0xdfae2b[_0x0baa('0x28')][_0x0baa('0x56')]});})['then'](function(_0x13dcf2){_0x2ea3a0[_0x0baa('0x19')]=_0x13dcf2;if(_0x2ea3a0[_0x0baa('0x53')][_0x0baa('0x57')]){return db[_0x0baa('0x58')][_0x0baa('0x3a')]({'attributes':['id','name'],'where':{'id':_0x2ea3a0[_0x0baa('0x53')][_0x0baa('0x57')]}})['then'](function(_0x224172){if(_0x224172){_0x2ea3a0[_0x0baa('0x41')][_0x0baa('0x59')]({'id':0x0,'priority':0x0,'app':_0x0baa('0x5a'),'appdata':_0x224172[_0x0baa('0x5b')]+','+(_0x2ea3a0[_0x0baa('0x3b')][_0x0baa('0x5c')]||0xa),'interval':_0x0baa('0x51')});}return respondWithRpcPromise(_0x0baa('0x5d'),'startRouting',_0x2ea3a0);});}return respondWithRpcPromise(_0x0baa('0x5d'),_0x0baa('0x5e'),_0x2ea3a0);})['then'](function(_0x416899){_0x265870(_0x416899);})['catch'](function(_0x1f9e95){_0x3c8f24(_0x48ffa5[_0x0baa('0x17')](0x1f4,_0x1f9e95[_0x0baa('0x19')]));});});}; \ No newline at end of file +var _0xaefa=['asc','Contacts','length','contact','find','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','include','map','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','keys','updatedAt','difference','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','FaxApplication','Applications','get','applications','orderBy'];(function(_0x43635b,_0x1686f3){var _0x210fb8=function(_0x757dbc){while(--_0x757dbc){_0x43635b['push'](_0x43635b['shift']());}};_0x210fb8(++_0x1686f3);}(_0xaefa,0xd4));var _0xaaef=function(_0x131273,_0x27983a){_0x131273=_0x131273-0x0;var _0x537e6b=_0xaefa[_0x131273];return _0x537e6b;};'use strict';var _=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaef('0x4'));var db=require(_0xaaef('0x5'))['db'];var utils=require(_0xaaef('0x6'));var logger=require(_0xaaef('0x7'))(_0xaaef('0x8'));var config=require(_0xaaef('0x9'));var jayson=require(_0xaaef('0xa'));var client=jayson['client'][_0xaaef('0xb')]({'port':0x232c});config[_0xaaef('0xc')]=_[_0xaaef('0xd')](config[_0xaaef('0xc')],{'host':_0xaaef('0xe'),'port':0x18eb});var socket=require(_0xaaef('0xf'))(new Redis(config[_0xaaef('0xc')]));require('./faxAccount.socket')[_0xaaef('0x10')](socket);function respondWithRpcPromise(_0x609515,_0x542e6e,_0x103c24){return new BPromise(function(_0x5a5feb,_0xe9da2b){return client[_0xaaef('0x11')](_0x609515,_0x103c24)[_0xaaef('0x12')](function(_0x18c817){logger[_0xaaef('0x13')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0xaaef('0x14'));logger[_0xaaef('0x15')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x542e6e,_0xaaef('0x14'),JSON[_0xaaef('0x16')](_0x18c817));if(_0x18c817['error']){if(_0x18c817[_0xaaef('0x17')][_0xaaef('0x18')]===0x1f4){logger[_0xaaef('0x17')](_0xaaef('0x19'),_0x542e6e,_0x18c817[_0xaaef('0x17')][_0xaaef('0x1a')]);return _0xe9da2b(_0x18c817[_0xaaef('0x17')][_0xaaef('0x1a')]);}logger[_0xaaef('0x17')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0x18c817[_0xaaef('0x17')]['message']);return _0x5a5feb(_0x18c817['error'][_0xaaef('0x1a')]);}else{logger[_0xaaef('0x13')](_0xaaef('0x19'),_0x542e6e,'request\x20sent');_0x5a5feb(_0x18c817[_0xaaef('0x1b')][_0xaaef('0x1a')]);}})[_0xaaef('0x1c')](function(_0x33bedd){logger[_0xaaef('0x17')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0x33bedd);_0xe9da2b(_0x33bedd);});});}exports['GetFaxAccount']=function(_0x1249e2){var _0x36f8e4=this;return new Promise(function(_0x1c8585,_0x350094){return db[_0xaaef('0x1d')][_0xaaef('0x1e')]({'raw':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x20')]===undefined?!![]:![]:!![],'where':_0x1249e2[_0xaaef('0x1f')]?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x21')]||null:null,'attributes':_0x1249e2['options']?_0x1249e2['options'][_0xaaef('0x22')]||null:null,'limit':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')]['limit']||null:null,'include':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x23')]?_[_0xaaef('0x24')](_0x1249e2['options']['include'],function(_0x289dd2){return{'model':db[_0x289dd2['model']],'as':_0x289dd2['as'],'attributes':_0x289dd2[_0xaaef('0x22')],'include':_0x289dd2[_0xaaef('0x23')]?_['map'](_0x289dd2[_0xaaef('0x23')],function(_0x206df1){return{'model':db[_0x206df1[_0xaaef('0x25')]],'as':_0x206df1['as'],'attributes':_0x206df1[_0xaaef('0x22')],'include':_0x206df1[_0xaaef('0x23')]?_[_0xaaef('0x24')](_0x206df1[_0xaaef('0x23')],function(_0x5ef3b5){return{'model':db[_0x5ef3b5[_0xaaef('0x25')]],'as':_0x5ef3b5['as'],'attributes':_0x5ef3b5[_0xaaef('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaaef('0x12')](function(_0x44115e){logger[_0xaaef('0x13')](_0xaaef('0x26'),_0x1249e2);logger[_0xaaef('0x15')](_0xaaef('0x26'),_0x1249e2,JSON[_0xaaef('0x16')](_0x44115e));_0x1c8585(_0x44115e);})[_0xaaef('0x1c')](function(_0x280707){logger['error'](_0xaaef('0x26'),_0x280707[_0xaaef('0x1a')],_0x1249e2);_0x350094(_0x36f8e4[_0xaaef('0x17')](0x1f4,_0x280707[_0xaaef('0x1a')]));});});};exports[_0xaaef('0x27')]=function(_0x36c32f,_0x2ea032,_0x3fee40){var _0x208966=this;return new Promise(function(_0x4ad0ff,_0x129187){var _0x50d1d0={'body':_0x36c32f['body'],'channel':_0xaaef('0x28')};var _0xecbdfc=[];var _0xe87ffe=[];var _0x16768b={};return db[_0xaaef('0x29')][_0xaaef('0x2a')]()[_0xaaef('0x12')](function(_0x2253de){if(!_0x2253de){throw new db[(_0xaaef('0x2b'))]['ValidationError'](_0xaaef('0x2c'));}_0xecbdfc=_['difference'](_[_0xaaef('0x2d')](_0x2253de),['createdAt',_0xaaef('0x2e')]);_0xe87ffe=_[_0xaaef('0x2f')](_['keys'](_0x2253de),[_0xaaef('0x30'),_0xaaef('0x2e'),_0xaaef('0x31'),_0xaaef('0x32')]);if(_0x36c32f[_0xaaef('0x33')]['id']){delete _0x36c32f[_0xaaef('0x33')]['id'];}if(_[_0xaaef('0x34')](_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')])){throw new db['Sequelize']['ValidationError'](_0xaaef('0x36'));}if(_[_0xaaef('0x34')](_0x36c32f[_0xaaef('0x33')][_0xaaef('0x33')])||_0x36c32f[_0xaaef('0x33')]['body']===''){throw new db['Sequelize'][(_0xaaef('0x37'))](_0xaaef('0x38'));}if(_['isNil'](_0x36c32f[_0xaaef('0x33')]['mapKey'])){throw new db[(_0xaaef('0x2b'))][(_0xaaef('0x37'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe87ffe);}if(!_[_0xaaef('0x39')](_0xe87ffe,_0x36c32f[_0xaaef('0x33')][_0xaaef('0x3a')])){throw new db[(_0xaaef('0x2b'))][(_0xaaef('0x37'))](_0xaaef('0x3b')+_0xe87ffe);}_0x16768b[_0x36c32f[_0xaaef('0x33')]['mapKey']]=_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')];})[_0xaaef('0x12')](function(){return db[_0xaaef('0x1d')]['find']({'where':{'id':_0x36c32f[_0xaaef('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0xaaef('0x3d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x16768b,'limit':0x1,'order':[[_0xaaef('0x2e'),'DESC']]}]},{'model':db[_0xaaef('0x3e')],'as':_0xaaef('0x3f')}]});})['then'](function(_0x2ddfee){if(_0x2ddfee&&_0x2ddfee[_0xaaef('0x3d')]){var _0x5bf986=_0x2ddfee[_0xaaef('0x40')]({'plain':!![]});_0x50d1d0[_0xaaef('0x3c')]=_0x5bf986;_0x50d1d0['applications']=_0x5bf986[_0xaaef('0x3f')];_0x50d1d0['list']=_0x5bf986[_0xaaef('0x3d')];_0x50d1d0[_0xaaef('0x41')]=_[_0xaaef('0x42')](_0x50d1d0[_0xaaef('0x41')],['priority'],[_0xaaef('0x43')]);if(_0x50d1d0['account'][_0xaaef('0x3f')]){delete _0x50d1d0['account'][_0xaaef('0x3f')];}if(_0x50d1d0[_0xaaef('0x3c')]['List']&&_0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x3d')][_0xaaef('0x44')][_0xaaef('0x45')]){return _0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x3d')]['Contacts'][0x0];}var _0x4ff64f=_[_0xaaef('0xd')](_0x36c32f[_0xaaef('0x33')],{'firstName':_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')],'ListId':_0x5bf986[_0xaaef('0x32')]});_0x4ff64f[_0x36c32f['body']['mapKey']]=_0x36c32f['body'][_0xaaef('0x35')];return db[_0xaaef('0x29')]['create'](_0x4ff64f,{'fields':_0xecbdfc,'raw':!![]});}})[_0xaaef('0x12')](function(_0x15e6f6){_0x50d1d0[_0xaaef('0x46')]=_0x15e6f6;if(_0x15e6f6){var _0x2187fe={'ContactId':_0x15e6f6['id'],'FaxAccountId':_0x36c32f[_0xaaef('0x3c')]['id'],'fax':_0x15e6f6['fax']};return db['FaxInteraction'][_0xaaef('0x47')]({'where':{'ContactId':_0x15e6f6['id'],'closed':![],'FaxAccountId':_0x36c32f[_0xaaef('0x3c')]['id']}})['then'](function(_0x269ee7){if(_0x269ee7){return[_0x269ee7,![]];}return db[_0xaaef('0x48')][_0xaaef('0x49')](_0x2187fe)[_0xaaef('0x12')](function(_0xd0f216){return[_0xd0f216,!![]];});});}else{throw new Error(_0xaaef('0x4a'));}})[_0xaaef('0x4b')](function(_0x368f27,_0x3cdad5){var _0x347473=_0x368f27[_0xaaef('0x40')]({'plain':!![]});if(_0x3cdad5){if(_0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x4c')]){_0x50d1d0[_0xaaef('0x41')][_0xaaef('0x4d')]({'id':0x0,'priority':_0x50d1d0['applications'][_0xaaef('0x45')]+0x1,'app':_0xaaef('0x4e'),'appdata':_0xaaef('0x4f'),'interval':_0xaaef('0x50')});}_0x347473[_0xaaef('0x51')]=!![];}else{_0x347473['created']=![];}_0x50d1d0[_0xaaef('0x52')]=_0x347473;return db[_0xaaef('0x53')][_0xaaef('0x49')]({'body':_0x36c32f['body'][_0xaaef('0x33')],'FaxAccountId':_0x36c32f['account']['id'],'FaxInteractionId':_0x368f27['id'],'direction':'in','ContactId':_0x368f27[_0xaaef('0x54')],'AttachmentId':_0x36c32f[_0xaaef('0x33')][_0xaaef('0x55')]});})[_0xaaef('0x12')](function(_0x30e5bb){_0x50d1d0[_0xaaef('0x1a')]=_0x30e5bb;if(_0x50d1d0[_0xaaef('0x52')][_0xaaef('0x56')]){return db[_0xaaef('0x57')][_0xaaef('0x47')]({'attributes':['id',_0xaaef('0x58')],'where':{'id':_0x50d1d0[_0xaaef('0x52')][_0xaaef('0x56')]}})['then'](function(_0x50a560){if(_0x50a560){_0x50d1d0['applications'][_0xaaef('0x59')]({'id':0x0,'priority':0x0,'app':_0xaaef('0x5a'),'appdata':_0x50a560[_0xaaef('0x58')]+','+(_0x50d1d0['account'][_0xaaef('0x5b')]||0xa),'interval':_0xaaef('0x50')});}return respondWithRpcPromise(_0xaaef('0x5c'),'startRouting',_0x50d1d0);});}return respondWithRpcPromise(_0xaaef('0x5c'),'startRouting',_0x50d1d0);})[_0xaaef('0x12')](function(_0x2b580c){_0x4ad0ff(_0x2b580c);})[_0xaaef('0x1c')](function(_0x4e4c99){_0x129187(_0x208966[_0xaaef('0x17')](0x1f4,_0x4e4c99[_0xaaef('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 1d94c39..6db142a 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 _0x0e25=['remove','update','emit','removeListener','length','./faxAccount.events','save'];(function(_0x420745,_0x1a6314){var _0x153a1a=function(_0xa1135a){while(--_0xa1135a){_0x420745['push'](_0x420745['shift']());}};_0x153a1a(++_0x1a6314);}(_0x0e25,0x8a));var _0x50e2=function(_0x16806a,_0x1f94e7){_0x16806a=_0x16806a-0x0;var _0x26c482=_0x0e25[_0x16806a];return _0x26c482;};'use strict';var FaxAccountEvents=require(_0x50e2('0x0'));var events=[_0x50e2('0x1'),_0x50e2('0x2'),_0x50e2('0x3')];function createListener(_0x3296c1,_0xdc8287){return function(_0x3e0cda){_0xdc8287[_0x50e2('0x4')](_0x3296c1,_0x3e0cda);};}function removeListener(_0x4a36ce,_0x4c10c3){return function(){FaxAccountEvents[_0x50e2('0x5')](_0x4a36ce,_0x4c10c3);};}exports['register']=function(_0x770d97){for(var _0x154a6f=0x0,_0x378f85=events[_0x50e2('0x6')];_0x154a6f<_0x378f85;_0x154a6f++){var _0x48f1ef=events[_0x154a6f];var _0x5ac2e6=createListener('faxAccount:'+_0x48f1ef,_0x770d97);FaxAccountEvents['on'](_0x48f1ef,_0x5ac2e6);}}; \ No newline at end of file +var _0x8732=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x12a06b,_0x417b51){var _0x5d0bb8=function(_0x41d3d0){while(--_0x41d3d0){_0x12a06b['push'](_0x12a06b['shift']());}};_0x5d0bb8(++_0x417b51);}(_0x8732,0x1b5));var _0x2873=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0x8732[_0x1f62c3];return _0x385c1c;};'use strict';var FaxAccountEvents=require(_0x2873('0x0'));var events=[_0x2873('0x1'),_0x2873('0x2'),_0x2873('0x3')];function createListener(_0x3cc40f,_0x4aa58e){return function(_0xb8ec7a){_0x4aa58e[_0x2873('0x4')](_0x3cc40f,_0xb8ec7a);};}function removeListener(_0x362fab,_0x259d75){return function(){FaxAccountEvents[_0x2873('0x5')](_0x362fab,_0x259d75);};}exports[_0x2873('0x6')]=function(_0x443310){for(var _0xce873=0x0,_0x269cc6=events[_0x2873('0x7')];_0xce873<_0x269cc6;_0xce873++){var _0x197602=events[_0xce873];var _0x518093=createListener(_0x2873('0x8')+_0x197602,_0x443310);FaxAccountEvents['on'](_0x197602,_0x518093);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5f010dd..80fc6e6 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x42bf4f,_0x2fea05){var _0x2ed183=function(_0x2f0002){while(--_0x2f0002){_0x42bf4f['push'](_0x42bf4f['shift']());}};_0x2ed183(++_0x2fea05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xeea013,_0x3332c8){var _0x555d2e=function(_0x3b3797){while(--_0x3b3797){_0xeea013['push'](_0xeea013['shift']());}};_0x555d2e(++_0x3332c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 426eb6a..0d3a8f2 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 _0x4d86=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x434123,_0x1b83aa){var _0x569d21=function(_0x56cb62){while(--_0x56cb62){_0x434123['push'](_0x434123['shift']());}};_0x569d21(++_0x1b83aa);}(_0x4d86,0x1a5));var _0x64d8=function(_0xc5bcf4,_0x263f21){_0xc5bcf4=_0xc5bcf4-0x0;var _0x5075b2=_0x4d86[_0xc5bcf4];return _0x5075b2;};'use strict';var Sequelize=require(_0x64d8('0x0'));module[_0x64d8('0x1')]={'priority':{'type':Sequelize[_0x64d8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x64d8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x64d8('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x64d8('0x5')}}; \ No newline at end of file +var _0x1bcd=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1bcd,0xa7));var _0xd1bc=function(_0x3e089f,_0x4571cb){_0x3e089f=_0x3e089f-0x0;var _0x3edef1=_0x1bcd[_0x3e089f];return _0x3edef1;};'use strict';var Sequelize=require('sequelize');module[_0xd1bc('0x0')]={'priority':{'type':Sequelize[_0xd1bc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd1bc('0x2')],'allowNull':![],'defaultValue':_0xd1bc('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd1bc('0x2')]},'interval':{'type':Sequelize[_0xd1bc('0x2')],'defaultValue':_0xd1bc('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4ae82c5..d26a143 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 _0xcdbe=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','then','destroy','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','catch','show','find','create','body','params'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xcdbe,0x1aa));var _0xecdb=function(_0x5429e6,_0x1f78fe){_0x5429e6=_0x5429e6-0x0;var _0x3c6711=_0xcdbe[_0x5429e6];return _0x3c6711;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecdb('0x0'));var zipdir=require(_0xecdb('0x1'));var jsonpatch=require(_0xecdb('0x2'));var rp=require(_0xecdb('0x3'));var moment=require(_0xecdb('0x4'));var BPromise=require(_0xecdb('0x5'));var Mustache=require(_0xecdb('0x6'));var util=require(_0xecdb('0x7'));var path=require(_0xecdb('0x8'));var sox=require(_0xecdb('0x9'));var csv=require(_0xecdb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecdb('0xb'));var _=require(_0xecdb('0xc'));var squel=require(_0xecdb('0xd'));var crypto=require(_0xecdb('0xe'));var jsforce=require(_0xecdb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xecdb('0x10'));var Papa=require('papaparse');var Redis=require(_0xecdb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xecdb('0x12'));var as=require(_0xecdb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xecdb('0x14'));var config=require(_0xecdb('0x15'));var licenseUtil=require(_0xecdb('0x16'));var db=require(_0xecdb('0x17'))['db'];function respondWithStatusCode(_0x514985,_0x1547fb){_0x1547fb=_0x1547fb||0xcc;return function(_0x4152a1){if(_0x4152a1){return _0x514985[_0xecdb('0x18')](_0x1547fb);}return _0x514985['status'](_0x1547fb)[_0xecdb('0x19')]();};}function respondWithResult(_0x353f05,_0x57f7be){_0x57f7be=_0x57f7be||0xc8;return function(_0xe188e3){if(_0xe188e3){return _0x353f05[_0xecdb('0x1a')](_0x57f7be)[_0xecdb('0x1b')](_0xe188e3);}};}function respondWithFilteredResult(_0x31ff30,_0xf92f3c){return function(_0x14f7ff){if(_0x14f7ff){var _0x512e70=typeof _0xf92f3c['offset']===_0xecdb('0x1c')&&typeof _0xf92f3c[_0xecdb('0x1d')]===_0xecdb('0x1c');var _0x332944=_0x14f7ff[_0xecdb('0x1e')];var _0x450113=_0x512e70?0x0:_0xf92f3c[_0xecdb('0x1f')];var _0x4fcc64=_0x512e70?_0x14f7ff['count']:_0xf92f3c[_0xecdb('0x1f')]+_0xf92f3c[_0xecdb('0x1d')];var _0x5d1ce4;if(_0x4fcc64>=_0x332944){_0x4fcc64=_0x332944;_0x5d1ce4=0xc8;}else{_0x5d1ce4=0xce;}_0x31ff30['status'](_0x5d1ce4);return _0x31ff30[_0xecdb('0x20')]('Content-Range',_0x450113+'-'+_0x4fcc64+'/'+_0x332944)[_0xecdb('0x1b')](_0x14f7ff);}return null;};}function patchUpdates(_0x53b971){return function(_0x51f9d0){try{jsonpatch['apply'](_0x51f9d0,_0x53b971,!![]);}catch(_0x5c1e0f){return BPromise[_0xecdb('0x21')](_0x5c1e0f);}return _0x51f9d0[_0xecdb('0x22')]();};}function saveUpdates(_0x2675fd,_0x5bb44e){return function(_0x1fe238){if(_0x1fe238){return _0x1fe238['update'](_0x2675fd)[_0xecdb('0x23')](function(_0x3315e4){return _0x3315e4;});}return null;};}function removeEntity(_0x5b6e00,_0xa3e007){return function(_0x36d77f){if(_0x36d77f){return _0x36d77f[_0xecdb('0x24')]()[_0xecdb('0x23')](function(){_0x5b6e00[_0xecdb('0x1a')](0xcc)[_0xecdb('0x19')]();});}};}function handleEntityNotFound(_0x513b28,_0x3eee40){return function(_0x3db1ec){if(!_0x3db1ec){_0x513b28['sendStatus'](0x194);}return _0x3db1ec;};}function handleError(_0x48abda,_0x492dfd){_0x492dfd=_0x492dfd||0x1f4;return function(_0xf68d33){logger[_0xecdb('0x25')](_0xf68d33['stack']);if(_0xf68d33['name']){delete _0xf68d33[_0xecdb('0x26')];}_0x48abda['status'](_0x492dfd)[_0xecdb('0x27')](_0xf68d33);};}exports[_0xecdb('0x28')]=function(_0x18ba9c,_0x3a5f86){var _0x5a58e3={},_0x3b010a={},_0x4de3ba={'count':0x0,'rows':[]};var _0x45fea0=_[_0xecdb('0x29')](db[_0xecdb('0x2a')][_0xecdb('0x2b')],function(_0x27658b){return{'name':_0x27658b[_0xecdb('0x2c')],'type':_0x27658b[_0xecdb('0x2d')][_0xecdb('0x2e')]};});_0x3b010a[_0xecdb('0x2f')]=_['map'](_0x45fea0,_0xecdb('0x26'));_0x3b010a['query']=_[_0xecdb('0x30')](_0x18ba9c[_0xecdb('0x31')]);_0x3b010a[_0xecdb('0x32')]=_['intersection'](_0x3b010a[_0xecdb('0x2f')],_0x3b010a[_0xecdb('0x31')]);_0x5a58e3[_0xecdb('0x33')]=_[_0xecdb('0x34')](_0x3b010a[_0xecdb('0x2f')],qs[_0xecdb('0x35')](_0x18ba9c['query']['fields']));_0x5a58e3[_0xecdb('0x33')]=_0x5a58e3[_0xecdb('0x33')][_0xecdb('0x36')]?_0x5a58e3[_0xecdb('0x33')]:_0x3b010a[_0xecdb('0x2f')];if(!_0x18ba9c[_0xecdb('0x31')][_0xecdb('0x37')]('nolimit')){_0x5a58e3[_0xecdb('0x1d')]=qs[_0xecdb('0x1d')](_0x18ba9c['query'][_0xecdb('0x1d')]);_0x5a58e3[_0xecdb('0x1f')]=qs['offset'](_0x18ba9c[_0xecdb('0x31')][_0xecdb('0x1f')]);}_0x5a58e3[_0xecdb('0x38')]=qs[_0xecdb('0x39')](_0x18ba9c[_0xecdb('0x31')][_0xecdb('0x39')]);_0x5a58e3['where']=qs[_0xecdb('0x32')](_['pick'](_0x18ba9c['query'],_0x3b010a[_0xecdb('0x32')]),_0x45fea0);if(_0x18ba9c[_0xecdb('0x31')]['filter']){_0x5a58e3[_0xecdb('0x3a')]=_['merge'](_0x5a58e3[_0xecdb('0x3a')],{'$or':_[_0xecdb('0x29')](_0x45fea0,function(_0x1f318d){if(_0x1f318d[_0xecdb('0x2d')]!==_0xecdb('0x3b')){var _0x123e18={};_0x123e18[_0x1f318d[_0xecdb('0x26')]]={'$like':'%'+_0x18ba9c[_0xecdb('0x31')][_0xecdb('0x3c')]+'%'};return _0x123e18;}})});}_0x5a58e3=_[_0xecdb('0x3d')]({},_0x5a58e3,_0x18ba9c[_0xecdb('0x3e')]);var _0x565bd2={'where':_0x5a58e3[_0xecdb('0x3a')]};return db['FaxApplication'][_0xecdb('0x1e')](_0x565bd2)['then'](function(_0xaacb85){_0x4de3ba['count']=_0xaacb85;if(_0x18ba9c[_0xecdb('0x31')][_0xecdb('0x3f')]){_0x5a58e3[_0xecdb('0x40')]=[{'all':!![]}];}return db[_0xecdb('0x2a')]['findAll'](_0x5a58e3);})[_0xecdb('0x23')](function(_0x32d753){_0x4de3ba['rows']=_0x32d753;return _0x4de3ba;})[_0xecdb('0x23')](respondWithFilteredResult(_0x3a5f86,_0x5a58e3))[_0xecdb('0x41')](handleError(_0x3a5f86,null));};exports[_0xecdb('0x42')]=function(_0x29f1df,_0x1a1978){var _0x226e45={'raw':!![],'where':{'id':_0x29f1df['params']['id']}},_0x33d794={};_0x33d794['model']=_[_0xecdb('0x30')](db[_0xecdb('0x2a')][_0xecdb('0x2b')]);_0x33d794['query']=_['keys'](_0x29f1df[_0xecdb('0x31')]);_0x33d794[_0xecdb('0x32')]=_[_0xecdb('0x34')](_0x33d794[_0xecdb('0x2f')],_0x33d794[_0xecdb('0x31')]);_0x226e45[_0xecdb('0x33')]=_[_0xecdb('0x34')](_0x33d794['model'],qs[_0xecdb('0x35')](_0x29f1df[_0xecdb('0x31')][_0xecdb('0x35')]));_0x226e45[_0xecdb('0x33')]=_0x226e45[_0xecdb('0x33')][_0xecdb('0x36')]?_0x226e45['attributes']:_0x33d794[_0xecdb('0x2f')];if(_0x29f1df['query'][_0xecdb('0x3f')]){_0x226e45[_0xecdb('0x40')]=[{'all':!![]}];}_0x226e45=_[_0xecdb('0x3d')]({},_0x226e45,_0x29f1df[_0xecdb('0x3e')]);return db['FaxApplication'][_0xecdb('0x43')](_0x226e45)['then'](handleEntityNotFound(_0x1a1978,null))[_0xecdb('0x23')](respondWithResult(_0x1a1978,null))['catch'](handleError(_0x1a1978,null));};exports[_0xecdb('0x44')]=function(_0x311eab,_0x4d3436){return db[_0xecdb('0x2a')][_0xecdb('0x44')](_0x311eab['body'],{})[_0xecdb('0x23')](respondWithResult(_0x4d3436,0xc9))['catch'](handleError(_0x4d3436,null));};exports['update']=function(_0x2ea9e9,_0x59942b){if(_0x2ea9e9[_0xecdb('0x45')]['id']){delete _0x2ea9e9[_0xecdb('0x45')]['id'];}return db['FaxApplication'][_0xecdb('0x43')]({'where':{'id':_0x2ea9e9[_0xecdb('0x46')]['id']}})[_0xecdb('0x23')](handleEntityNotFound(_0x59942b,null))[_0xecdb('0x23')](saveUpdates(_0x2ea9e9['body'],null))[_0xecdb('0x23')](respondWithResult(_0x59942b,null))[_0xecdb('0x41')](handleError(_0x59942b,null));};exports[_0xecdb('0x24')]=function(_0x594bf2,_0x5ccd74){return db[_0xecdb('0x2a')]['find']({'where':{'id':_0x594bf2['params']['id']}})[_0xecdb('0x23')](handleEntityNotFound(_0x5ccd74,null))[_0xecdb('0x23')](removeEntity(_0x5ccd74,null))[_0xecdb('0x41')](handleError(_0x5ccd74,null));}; \ No newline at end of file +var _0x1106=['order','sort','where','filter','VIRTUAL','merge','FaxApplication','include','findAll','catch','show','params','includeAll','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','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','apply','reject','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x4ddcac,_0x26bf3c){var _0x46d87b=function(_0x49bf8c){while(--_0x49bf8c){_0x4ddcac['push'](_0x4ddcac['shift']());}};_0x46d87b(++_0x26bf3c);}(_0x1106,0x1f4));var _0x6110=function(_0x515fd0,_0x543a29){_0x515fd0=_0x515fd0-0x0;var _0x40dc53=_0x1106[_0x515fd0];return _0x40dc53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6110('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6110('0x1'));var rp=require(_0x6110('0x2'));var moment=require(_0x6110('0x3'));var BPromise=require(_0x6110('0x4'));var Mustache=require(_0x6110('0x5'));var util=require(_0x6110('0x6'));var path=require(_0x6110('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6110('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6110('0x9'));var crypto=require(_0x6110('0xa'));var jsforce=require(_0x6110('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6110('0xc'));var Papa=require(_0x6110('0xd'));var Redis=require(_0x6110('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6110('0xf'));var as=require(_0x6110('0x10'));var hardwareService=require(_0x6110('0x11'));var logger=require(_0x6110('0x12'))('api');var utils=require(_0x6110('0x13'));var config=require(_0x6110('0x14'));var licenseUtil=require(_0x6110('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50bc64,_0x5ccc1a){_0x5ccc1a=_0x5ccc1a||0xcc;return function(_0x456790){if(_0x456790){return _0x50bc64[_0x6110('0x16')](_0x5ccc1a);}return _0x50bc64[_0x6110('0x17')](_0x5ccc1a)[_0x6110('0x18')]();};}function respondWithResult(_0x3e875d,_0x421d94){_0x421d94=_0x421d94||0xc8;return function(_0x18e2cb){if(_0x18e2cb){return _0x3e875d[_0x6110('0x17')](_0x421d94)[_0x6110('0x19')](_0x18e2cb);}};}function respondWithFilteredResult(_0x2f5fc1,_0x544181){return function(_0x20f134){if(_0x20f134){var _0x38d934=typeof _0x544181['offset']===_0x6110('0x1a')&&typeof _0x544181['limit']==='undefined';var _0x1cc945=_0x20f134[_0x6110('0x1b')];var _0x1cc1de=_0x38d934?0x0:_0x544181['offset'];var _0x157900=_0x38d934?_0x20f134[_0x6110('0x1b')]:_0x544181[_0x6110('0x1c')]+_0x544181['limit'];var _0x2b13fc;if(_0x157900>=_0x1cc945){_0x157900=_0x1cc945;_0x2b13fc=0xc8;}else{_0x2b13fc=0xce;}_0x2f5fc1[_0x6110('0x17')](_0x2b13fc);return _0x2f5fc1['set']('Content-Range',_0x1cc1de+'-'+_0x157900+'/'+_0x1cc945)[_0x6110('0x19')](_0x20f134);}return null;};}function patchUpdates(_0x2e9ae5){return function(_0x2172fa){try{jsonpatch[_0x6110('0x1d')](_0x2172fa,_0x2e9ae5,!![]);}catch(_0xa2c90a){return BPromise[_0x6110('0x1e')](_0xa2c90a);}return _0x2172fa['save']();};}function saveUpdates(_0x408ca8,_0x1bca56){return function(_0x3d1ad5){if(_0x3d1ad5){return _0x3d1ad5['update'](_0x408ca8)['then'](function(_0x4b77d3){return _0x4b77d3;});}return null;};}function removeEntity(_0x1fd124,_0x2258b5){return function(_0x572853){if(_0x572853){return _0x572853[_0x6110('0x1f')]()[_0x6110('0x20')](function(){_0x1fd124[_0x6110('0x17')](0xcc)[_0x6110('0x18')]();});}};}function handleEntityNotFound(_0x570ab0,_0x2109dd){return function(_0x3ff9e5){if(!_0x3ff9e5){_0x570ab0[_0x6110('0x16')](0x194);}return _0x3ff9e5;};}function handleError(_0x361876,_0x2f2524){_0x2f2524=_0x2f2524||0x1f4;return function(_0x30f6b1){logger[_0x6110('0x21')](_0x30f6b1['stack']);if(_0x30f6b1[_0x6110('0x22')]){delete _0x30f6b1[_0x6110('0x22')];}_0x361876[_0x6110('0x17')](_0x2f2524)['send'](_0x30f6b1);};}exports[_0x6110('0x23')]=function(_0x404df1,_0x26b2ee){var _0x3e8ab3={},_0x1432f4={},_0x31d2c0={'count':0x0,'rows':[]};var _0x1e70e7=_[_0x6110('0x24')](db['FaxApplication'][_0x6110('0x25')],function(_0x1f40a4){return{'name':_0x1f40a4[_0x6110('0x26')],'type':_0x1f40a4[_0x6110('0x27')][_0x6110('0x28')]};});_0x1432f4[_0x6110('0x29')]=_['map'](_0x1e70e7,_0x6110('0x22'));_0x1432f4[_0x6110('0x2a')]=_[_0x6110('0x2b')](_0x404df1[_0x6110('0x2a')]);_0x1432f4[_0x6110('0x2c')]=_[_0x6110('0x2d')](_0x1432f4[_0x6110('0x29')],_0x1432f4[_0x6110('0x2a')]);_0x3e8ab3[_0x6110('0x2e')]=_[_0x6110('0x2d')](_0x1432f4[_0x6110('0x29')],qs['fields'](_0x404df1[_0x6110('0x2a')][_0x6110('0x2f')]));_0x3e8ab3['attributes']=_0x3e8ab3['attributes'][_0x6110('0x30')]?_0x3e8ab3[_0x6110('0x2e')]:_0x1432f4[_0x6110('0x29')];if(!_0x404df1[_0x6110('0x2a')][_0x6110('0x31')](_0x6110('0x32'))){_0x3e8ab3[_0x6110('0x33')]=qs['limit'](_0x404df1[_0x6110('0x2a')][_0x6110('0x33')]);_0x3e8ab3['offset']=qs[_0x6110('0x1c')](_0x404df1[_0x6110('0x2a')][_0x6110('0x1c')]);}_0x3e8ab3[_0x6110('0x34')]=qs[_0x6110('0x35')](_0x404df1[_0x6110('0x2a')][_0x6110('0x35')]);_0x3e8ab3[_0x6110('0x36')]=qs[_0x6110('0x2c')](_['pick'](_0x404df1[_0x6110('0x2a')],_0x1432f4['filters']),_0x1e70e7);if(_0x404df1[_0x6110('0x2a')][_0x6110('0x37')]){_0x3e8ab3['where']=_['merge'](_0x3e8ab3['where'],{'$or':_[_0x6110('0x24')](_0x1e70e7,function(_0x34daf4){if(_0x34daf4[_0x6110('0x27')]!==_0x6110('0x38')){var _0x3f8fdb={};_0x3f8fdb[_0x34daf4[_0x6110('0x22')]]={'$like':'%'+_0x404df1['query']['filter']+'%'};return _0x3f8fdb;}})});}_0x3e8ab3=_[_0x6110('0x39')]({},_0x3e8ab3,_0x404df1['options']);var _0x577b29={'where':_0x3e8ab3['where']};return db[_0x6110('0x3a')][_0x6110('0x1b')](_0x577b29)[_0x6110('0x20')](function(_0x41ec27){_0x31d2c0[_0x6110('0x1b')]=_0x41ec27;if(_0x404df1[_0x6110('0x2a')]['includeAll']){_0x3e8ab3[_0x6110('0x3b')]=[{'all':!![]}];}return db[_0x6110('0x3a')][_0x6110('0x3c')](_0x3e8ab3);})[_0x6110('0x20')](function(_0xb33c25){_0x31d2c0['rows']=_0xb33c25;return _0x31d2c0;})[_0x6110('0x20')](respondWithFilteredResult(_0x26b2ee,_0x3e8ab3))[_0x6110('0x3d')](handleError(_0x26b2ee,null));};exports[_0x6110('0x3e')]=function(_0xd6e984,_0xe75406){var _0x5a7a9d={'raw':!![],'where':{'id':_0xd6e984[_0x6110('0x3f')]['id']}},_0x2dd175={};_0x2dd175[_0x6110('0x29')]=_[_0x6110('0x2b')](db[_0x6110('0x3a')][_0x6110('0x25')]);_0x2dd175['query']=_[_0x6110('0x2b')](_0xd6e984[_0x6110('0x2a')]);_0x2dd175['filters']=_[_0x6110('0x2d')](_0x2dd175['model'],_0x2dd175[_0x6110('0x2a')]);_0x5a7a9d[_0x6110('0x2e')]=_[_0x6110('0x2d')](_0x2dd175[_0x6110('0x29')],qs[_0x6110('0x2f')](_0xd6e984[_0x6110('0x2a')][_0x6110('0x2f')]));_0x5a7a9d[_0x6110('0x2e')]=_0x5a7a9d[_0x6110('0x2e')][_0x6110('0x30')]?_0x5a7a9d[_0x6110('0x2e')]:_0x2dd175[_0x6110('0x29')];if(_0xd6e984['query'][_0x6110('0x40')]){_0x5a7a9d[_0x6110('0x3b')]=[{'all':!![]}];}_0x5a7a9d=_['merge']({},_0x5a7a9d,_0xd6e984[_0x6110('0x41')]);return db[_0x6110('0x3a')][_0x6110('0x42')](_0x5a7a9d)[_0x6110('0x20')](handleEntityNotFound(_0xe75406,null))[_0x6110('0x20')](respondWithResult(_0xe75406,null))[_0x6110('0x3d')](handleError(_0xe75406,null));};exports[_0x6110('0x43')]=function(_0x442776,_0xababe8){return db['FaxApplication'][_0x6110('0x43')](_0x442776['body'],{})[_0x6110('0x20')](respondWithResult(_0xababe8,0xc9))[_0x6110('0x3d')](handleError(_0xababe8,null));};exports['update']=function(_0x4e37a9,_0x3f2910){if(_0x4e37a9[_0x6110('0x44')]['id']){delete _0x4e37a9[_0x6110('0x44')]['id'];}return db[_0x6110('0x3a')]['find']({'where':{'id':_0x4e37a9[_0x6110('0x3f')]['id']}})[_0x6110('0x20')](handleEntityNotFound(_0x3f2910,null))[_0x6110('0x20')](saveUpdates(_0x4e37a9[_0x6110('0x44')],null))[_0x6110('0x20')](respondWithResult(_0x3f2910,null))['catch'](handleError(_0x3f2910,null));};exports[_0x6110('0x1f')]=function(_0x332c6f,_0x4e4932){return db['FaxApplication'][_0x6110('0x42')]({'where':{'id':_0x332c6f['params']['id']}})[_0x6110('0x20')](handleEntityNotFound(_0x4e4932,null))[_0x6110('0x20')](removeEntity(_0x4e4932,null))[_0x6110('0x3d')](handleError(_0x4e4932,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 09765fb..35aa18a 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 _0x517e=['./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x517e,0x11f));var _0xe517=function(_0x2c2781,_0x5f1153){_0x2c2781=_0x2c2781-0x0;var _0x3fe469=_0x517e[_0x2c2781];return _0x3fe469;};'use strict';var _=require(_0xe517('0x0'));var util=require('util');var logger=require(_0xe517('0x1'))('api');var moment=require(_0xe517('0x2'));var BPromise=require('bluebird');var rp=require(_0xe517('0x3'));var fs=require('fs');var path=require(_0xe517('0x4'));var rimraf=require(_0xe517('0x5'));var config=require(_0xe517('0x6'));var attributes=require(_0xe517('0x7'));module[_0xe517('0x8')]=function(_0x1bc139,_0x2678a0){return _0x1bc139[_0xe517('0x9')](_0xe517('0xa'),attributes,{'tableName':_0xe517('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe517('0xc'),'collate':_0xe517('0xd')});}; \ No newline at end of file +var _0xb03a=['lodash','util','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xb03a,0x9a));var _0xab03=function(_0x1ad548,_0x55e605){_0x1ad548=_0x1ad548-0x0;var _0x2511f6=_0xb03a[_0x1ad548];return _0x2511f6;};'use strict';var _=require(_0xab03('0x0'));var util=require(_0xab03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xab03('0x2'));var BPromise=require('bluebird');var rp=require(_0xab03('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab03('0x4'));var config=require(_0xab03('0x5'));var attributes=require(_0xab03('0x6'));module['exports']=function(_0x1ceebf,_0x1341e4){return _0x1ceebf[_0xab03('0x7')](_0xab03('0x8'),attributes,{'tableName':_0xab03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab03('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ed7a7a4..3990a18 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 _0xcb26=['raw','attributes','limit','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxApplication','FaxApplication','body','options'];(function(_0x8aa0be,_0x20f625){var _0x1af40d=function(_0x7d94d0){while(--_0x7d94d0){_0x8aa0be['push'](_0x8aa0be['shift']());}};_0x1af40d(++_0x20f625);}(_0xcb26,0xf6));var _0x6cb2=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xcb26[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x6cb2('0x0'));var util=require(_0x6cb2('0x1'));var moment=require(_0x6cb2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb2('0x4'));var logger=require(_0x6cb2('0x5'))('rpc');var config=require(_0x6cb2('0x6'));var jayson=require(_0x6cb2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x446656,_0x5ca77d,_0x42c7d6){return new BPromise(function(_0x456916,_0xf7e38d){return client['request'](_0x446656,_0x42c7d6)[_0x6cb2('0x8')](function(_0x11681e){logger['info'](_0x6cb2('0x9'),_0x5ca77d,'request\x20sent');logger[_0x6cb2('0xa')](_0x6cb2('0xb'),_0x5ca77d,_0x6cb2('0xc'),JSON[_0x6cb2('0xd')](_0x11681e));if(_0x11681e[_0x6cb2('0xe')]){if(_0x11681e[_0x6cb2('0xe')][_0x6cb2('0xf')]===0x1f4){logger[_0x6cb2('0xe')](_0x6cb2('0x9'),_0x5ca77d,_0x11681e[_0x6cb2('0xe')][_0x6cb2('0x10')]);return _0xf7e38d(_0x11681e[_0x6cb2('0xe')][_0x6cb2('0x10')]);}logger[_0x6cb2('0xe')](_0x6cb2('0x9'),_0x5ca77d,_0x11681e[_0x6cb2('0xe')]['message']);return _0x456916(_0x11681e[_0x6cb2('0xe')][_0x6cb2('0x10')]);}else{logger[_0x6cb2('0x11')](_0x6cb2('0x9'),_0x5ca77d,'request\x20sent');_0x456916(_0x11681e[_0x6cb2('0x12')][_0x6cb2('0x10')]);}})[_0x6cb2('0x13')](function(_0x40c677){logger['error'](_0x6cb2('0x9'),_0x5ca77d,_0x40c677);_0xf7e38d(_0x40c677);});});}exports[_0x6cb2('0x14')]=function(_0x321d22){var _0x9a2af9=this;return new Promise(function(_0x433bd9,_0x4b7b9a){return db[_0x6cb2('0x15')]['update'](_0x321d22[_0x6cb2('0x16')],{'raw':_0x321d22[_0x6cb2('0x17')]?_0x321d22[_0x6cb2('0x17')][_0x6cb2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321d22[_0x6cb2('0x17')]?_0x321d22['options']['where']||null:null,'attributes':_0x321d22[_0x6cb2('0x17')]?_0x321d22['options'][_0x6cb2('0x19')]||null:null,'limit':_0x321d22[_0x6cb2('0x17')]?_0x321d22[_0x6cb2('0x17')][_0x6cb2('0x1a')]||null:null})[_0x6cb2('0x8')](function(_0x1175ed){logger[_0x6cb2('0x11')](_0x6cb2('0x14'),_0x321d22);logger[_0x6cb2('0xa')](_0x6cb2('0x14'),_0x321d22,JSON[_0x6cb2('0xd')](_0x1175ed));_0x433bd9(_0x1175ed);})[_0x6cb2('0x13')](function(_0x3a4680){logger[_0x6cb2('0xe')](_0x6cb2('0x14'),_0x3a4680[_0x6cb2('0x10')],_0x321d22);_0x4b7b9a(_0x9a2af9[_0x6cb2('0xe')](0x1f4,_0x3a4680[_0x6cb2('0x10')]));});});}; \ No newline at end of file +var _0x276b=['client','http','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','attributes','limit','then','info','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4e0788,_0x21e3f6){var _0x2f4903=function(_0x222070){while(--_0x222070){_0x4e0788['push'](_0x4e0788['shift']());}};_0x2f4903(++_0x21e3f6);}(_0x276b,0xd6));var _0xb276=function(_0x5a5980,_0x6b44c4){_0x5a5980=_0x5a5980-0x0;var _0x12c3a3=_0x276b[_0x5a5980];return _0x12c3a3;};'use strict';var _=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var moment=require(_0xb276('0x2'));var BPromise=require(_0xb276('0x3'));var rs=require(_0xb276('0x4'));var fs=require('fs');var Redis=require(_0xb276('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb276('0x6'));var logger=require(_0xb276('0x7'))(_0xb276('0x8'));var config=require('../../config/environment');var jayson=require(_0xb276('0x9'));var client=jayson[_0xb276('0xa')][_0xb276('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x545204,_0x1c8414,_0x39c19){return new BPromise(function(_0x4f1556,_0x113af8){return client['request'](_0x545204,_0x39c19)['then'](function(_0x2f44fe){logger['info'](_0xb276('0xc'),_0x1c8414,_0xb276('0xd'));logger[_0xb276('0xe')](_0xb276('0xf'),_0x1c8414,_0xb276('0xd'),JSON[_0xb276('0x10')](_0x2f44fe));if(_0x2f44fe[_0xb276('0x11')]){if(_0x2f44fe['error']['code']===0x1f4){logger[_0xb276('0x11')](_0xb276('0xc'),_0x1c8414,_0x2f44fe[_0xb276('0x11')]['message']);return _0x113af8(_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);}logger['error'](_0xb276('0xc'),_0x1c8414,_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);return _0x4f1556(_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);}else{logger['info'](_0xb276('0xc'),_0x1c8414,_0xb276('0xd'));_0x4f1556(_0x2f44fe[_0xb276('0x13')][_0xb276('0x12')]);}})[_0xb276('0x14')](function(_0x16dadf){logger[_0xb276('0x11')](_0xb276('0xc'),_0x1c8414,_0x16dadf);_0x113af8(_0x16dadf);});});}exports['UpdateFaxApplication']=function(_0x283528){var _0xc43851=this;return new Promise(function(_0x255b42,_0x3d9cbd){return db['FaxApplication']['update'](_0x283528['body'],{'raw':_0x283528['options']?_0x283528[_0xb276('0x15')][_0xb276('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x283528['options']?_0x283528[_0xb276('0x15')]['where']||null:null,'attributes':_0x283528[_0xb276('0x15')]?_0x283528['options'][_0xb276('0x17')]||null:null,'limit':_0x283528[_0xb276('0x15')]?_0x283528[_0xb276('0x15')][_0xb276('0x18')]||null:null})[_0xb276('0x19')](function(_0x4fa607){logger[_0xb276('0x1a')](_0xb276('0x1b'),_0x283528);logger[_0xb276('0xe')](_0xb276('0x1b'),_0x283528,JSON[_0xb276('0x10')](_0x4fa607));_0x255b42(_0x4fa607);})[_0xb276('0x14')](function(_0x186923){logger[_0xb276('0x11')](_0xb276('0x1b'),_0x186923[_0xb276('0x12')],_0x283528);_0x3d9cbd(_0xc43851[_0xb276('0x11')](0x1f4,_0x186923[_0xb276('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 81c8d9b..abfd803 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 _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(_0x39b7d8,_0xa44989){var _0x42d6dd=function(_0x2922ab){while(--_0x2922ab){_0x39b7d8['push'](_0x39b7d8['shift']());}};_0x42d6dd(++_0xa44989);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b69aa,_0x5aa147){_0x1b69aa=_0x1b69aa-0x0;var _0x42647d=_0x0b0e[_0x1b69aa];return _0x42647d;};'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 +var _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_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('./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 diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 26bab04..163e8d1 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 _0x9c8b=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9c8b,0x12f));var _0xb9c8=function(_0x2500ac,_0x27dd55){_0x2500ac=_0x2500ac-0x0;var _0x483f6d=_0x9c8b[_0x2500ac];return _0x483f6d;};'use strict';var Sequelize=require(_0xb9c8('0x0'));module[_0xb9c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb9c8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9c8('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xb9c8('0x4')]('in',_0xb9c8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb9c8('0x4')]('in',_0xb9c8('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9708=['out','ENUM','sequelize','exports','DATE','STRING'];(function(_0xa51824,_0x4bbe6e){var _0x346f05=function(_0x505541){while(--_0x505541){_0xa51824['push'](_0xa51824['shift']());}};_0x346f05(++_0x4bbe6e);}(_0x9708,0xe6));var _0x8970=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x9708[_0x318840];return _0x223da4;};'use strict';var Sequelize=require(_0x8970('0x0'));module[_0x8970('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8970('0x2')]},'disposition':{'type':Sequelize[_0x8970('0x3')]},'secondDisposition':{'type':Sequelize[_0x8970('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8970('0x3')]},'note':{'type':Sequelize[_0x8970('0x3')]},'read1stAt':{'type':Sequelize[_0x8970('0x2')]},'fax':{'type':Sequelize[_0x8970('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8970('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8970('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8970('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index c61b10e..0efcfbf 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 _0xc2e2=['Owner.internal','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','includeAll','include','options','catch','create','describe','addMessage','FaxMessage','ids','getMessages','rawAttributes','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','Tag','emit','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','status','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','index','FaxInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','color','from','tools_tags','field','u.fullname','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','text','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile','c.fax','o.fullname','Owner.fullname'];(function(_0x2ca7d9,_0x240b45){var _0x37e067=function(_0x14f36d){while(--_0x14f36d){_0x2ca7d9['push'](_0x2ca7d9['shift']());}};_0x37e067(++_0x240b45);}(_0xc2e2,0x1e6));var _0x2c2e=function(_0x1171ff,_0x1baa94){_0x1171ff=_0x1171ff-0x0;var _0x1416f3=_0xc2e2[_0x1171ff];return _0x1416f3;};'use strict';var emlformat=require(_0x2c2e('0x0'));var rimraf=require(_0x2c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c2e('0x2'));var rp=require(_0x2c2e('0x3'));var moment=require(_0x2c2e('0x4'));var BPromise=require(_0x2c2e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2c2e('0x6'));var csv=require(_0x2c2e('0x7'));var ejs=require(_0x2c2e('0x8'));var fs=require('fs');var fs_extra=require(_0x2c2e('0x9'));var _=require(_0x2c2e('0xa'));var squel=require(_0x2c2e('0xb'));var crypto=require(_0x2c2e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c2e('0x7'));var querystring=require(_0x2c2e('0xd'));var Papa=require(_0x2c2e('0xe'));var Redis=require(_0x2c2e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2c2e('0x10'));var as=require(_0x2c2e('0x11'));var hardwareService=require(_0x2c2e('0x12'));var logger=require(_0x2c2e('0x13'))(_0x2c2e('0x14'));var utils=require('../../config/utils');var config=require(_0x2c2e('0x15'));var licenseUtil=require(_0x2c2e('0x16'));var db=require(_0x2c2e('0x17'))['db'];config[_0x2c2e('0x18')]=_['defaults'](config[_0x2c2e('0x18')],{'host':_0x2c2e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c2e('0x18')]));require(_0x2c2e('0x1a'))[_0x2c2e('0x1b')](socket);function respondWithStatusCode(_0x3fd2b5,_0x28f0b4){_0x28f0b4=_0x28f0b4||0xcc;return function(_0x1e5aa2){if(_0x1e5aa2){return _0x3fd2b5['sendStatus'](_0x28f0b4);}return _0x3fd2b5[_0x2c2e('0x1c')](_0x28f0b4)['end']();};}function respondWithResult(_0x3f3339,_0x2bab8b){_0x2bab8b=_0x2bab8b||0xc8;return function(_0x1ecd82){if(_0x1ecd82){return _0x3f3339['status'](_0x2bab8b)[_0x2c2e('0x1d')](_0x1ecd82);}};}function respondWithFilteredResult(_0x5c082b,_0x5c0211){return function(_0x83bb39){if(_0x83bb39){var _0x475873=typeof _0x5c0211[_0x2c2e('0x1e')]==='undefined'&&typeof _0x5c0211[_0x2c2e('0x1f')]==='undefined';var _0x3dc959=_0x83bb39[_0x2c2e('0x20')];var _0x2826f5=_0x475873?0x0:_0x5c0211[_0x2c2e('0x1e')];var _0x3df27c=_0x475873?_0x83bb39[_0x2c2e('0x20')]:_0x5c0211[_0x2c2e('0x1e')]+_0x5c0211[_0x2c2e('0x1f')];var _0x16d1bd;if(_0x3df27c>=_0x3dc959){_0x3df27c=_0x3dc959;_0x16d1bd=0xc8;}else{_0x16d1bd=0xce;}_0x5c082b['status'](_0x16d1bd);return _0x5c082b['set'](_0x2c2e('0x21'),_0x2826f5+'-'+_0x3df27c+'/'+_0x3dc959)[_0x2c2e('0x1d')](_0x83bb39);}return null;};}function patchUpdates(_0xb74bb5){return function(_0x1c2ef2){try{jsonpatch[_0x2c2e('0x22')](_0x1c2ef2,_0xb74bb5,!![]);}catch(_0x10837a){return BPromise['reject'](_0x10837a);}return _0x1c2ef2[_0x2c2e('0x23')]();};}function saveUpdates(_0xe4e3fe,_0x552d28){return function(_0x54510d){if(_0x54510d){return _0x54510d[_0x2c2e('0x24')](_0xe4e3fe)[_0x2c2e('0x25')](function(_0x42acce){return _0x42acce;});}return null;};}function removeEntity(_0x1bef10,_0x3d2928){return function(_0x308eca){if(_0x308eca){return _0x308eca[_0x2c2e('0x26')]()[_0x2c2e('0x25')](function(){_0x1bef10[_0x2c2e('0x1c')](0xcc)[_0x2c2e('0x27')]();});}};}function handleEntityNotFound(_0x454a77,_0x57a667){return function(_0x2864f1){if(!_0x2864f1){_0x454a77[_0x2c2e('0x28')](0x194);}return _0x2864f1;};}function handleError(_0x2070af,_0x11e17c){_0x11e17c=_0x11e17c||0x1f4;return function(_0x45ae14){logger['error'](_0x45ae14[_0x2c2e('0x29')]);if(_0x45ae14[_0x2c2e('0x2a')]){delete _0x45ae14[_0x2c2e('0x2a')];}_0x2070af[_0x2c2e('0x1c')](_0x11e17c)[_0x2c2e('0x2b')](_0x45ae14);};}function getInteractionUsers(_0x2c6736,_0x10cd68){return new BPromise(function(_0x30f698,_0x57177c){try{if(_0x10cd68[_0x2c6736['id']]){_0x2c6736[_0x2c2e('0x2c')]=_[_0x2c2e('0x2d')](_0x10cd68[_0x2c6736['id']],function(_0x2bac02){return{'id':_0x2bac02['id'],'fullname':_0x2bac02[_0x2c2e('0x2e')]};});}}catch(_0x152817){_0x57177c(_0x152817);}_0x30f698(_0x2c6736);});}function getInteractionTags(_0x1a48a4,_0x6b630d){return new BPromise(function(_0x39effd,_0x5d2503){try{if(_0x1a48a4['TagIds']){_0x1a48a4[_0x2c2e('0x2f')]=[];_0x1a48a4[_0x2c2e('0x30')][_0x2c2e('0x31')](',')[_0x2c2e('0x32')](function(_0x520da8){_0x1a48a4['Tags'][_0x2c2e('0x33')](_0x6b630d[_0x520da8]);});}delete _0x1a48a4['TagIds'];}catch(_0x1a0755){_0x5d2503(_0x1a0755);}_0x39effd(_0x1a48a4);});}function updateFaxInteraction(_0x27dfc6,_0x8fe468,_0x11e0a1){return new BPromise(function(_0x22dce,_0x1ff25f){return getInteractionUsers(_0x27dfc6,_0x11e0a1)[_0x2c2e('0x25')](function(_0x2c75f8){return getInteractionTags(_0x2c75f8,_0x8fe468);})['then'](function(_0x34d718){_0x22dce(_0x34d718);})['catch'](function(_0x5a3011){_0x1ff25f(_0x5a3011);});});}exports[_0x2c2e('0x34')]=function(_0x111a50,_0x1cabfb){var _0x4756e1={},_0xa8b2bd={},_0x148bd4={'count':0x0,'rows':[]};var _0x4d7ef6=_['map'](db[_0x2c2e('0x35')]['rawAttributes'],function(_0x16d24a){return{'name':_0x16d24a[_0x2c2e('0x36')],'type':_0x16d24a['type'][_0x2c2e('0x37')]};});_0xa8b2bd[_0x2c2e('0x38')]=_[_0x2c2e('0x2d')](_0x4d7ef6,'name');_0xa8b2bd[_0x2c2e('0x39')]=_[_0x2c2e('0x3a')](_0x111a50[_0x2c2e('0x39')]);_0xa8b2bd[_0x2c2e('0x3b')]=_[_0x2c2e('0x3c')](_0xa8b2bd[_0x2c2e('0x38')],_0xa8b2bd[_0x2c2e('0x39')]);_0x4756e1[_0x2c2e('0x3d')]=_[_0x2c2e('0x3c')](_0xa8b2bd[_0x2c2e('0x38')],qs[_0x2c2e('0x3e')](_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x3e')]));_0x4756e1[_0x2c2e('0x3d')]=_0x4756e1[_0x2c2e('0x3d')][_0x2c2e('0x3f')]?_0x4756e1[_0x2c2e('0x3d')]:_0xa8b2bd[_0x2c2e('0x38')];if(!_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x40')](_0x2c2e('0x41'))){_0x4756e1[_0x2c2e('0x1f')]=qs[_0x2c2e('0x1f')](_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x1f')]);_0x4756e1[_0x2c2e('0x1e')]=qs[_0x2c2e('0x1e')](_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x1e')]);}_0x4756e1[_0x2c2e('0x42')]=qs[_0x2c2e('0x43')](_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x43')]);_0x4756e1[_0x2c2e('0x44')]=qs[_0x2c2e('0x3b')](_['pick'](_0x111a50[_0x2c2e('0x39')],_0xa8b2bd[_0x2c2e('0x3b')]),_0x4d7ef6);var _0x37b1b8=[];var _0x2e2a10=squel[_0x2c2e('0x45')]()['field']('id')['field'](_0x2c2e('0x2a'))['field'](_0x2c2e('0x46'))[_0x2c2e('0x47')](_0x2c2e('0x48'));var _0x1e77b5=squel[_0x2c2e('0x45')]()[_0x2c2e('0x49')]('u.id')[_0x2c2e('0x49')](_0x2c2e('0x4a'))[_0x2c2e('0x49')]('ui.FaxInteractionId')[_0x2c2e('0x47')]('user_has_fax_interactions','ui')['left_join'](_0x2c2e('0x4b'),'u',_0x2c2e('0x4c'));var _0x5df321=squel[_0x2c2e('0x45')]()[_0x2c2e('0x47')](_0x2c2e('0x4d'),'i')[_0x2c2e('0x4e')](_0x2c2e('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2c2e('0x4e')](_0x2c2e('0x4b'),'o',_0x2c2e('0x50'))['left_join'](_0x2c2e('0x51'),'a',_0x2c2e('0x52'))['left_join'](_0x2c2e('0x53'),'me',_0x2c2e('0x54'))[_0x2c2e('0x4e')](_0x2c2e('0x55'),'it',_0x2c2e('0x56'))[_0x2c2e('0x4e')](_0x2c2e('0x48'),'t',_0x2c2e('0x57'));var _0x5b1b43=squel[_0x2c2e('0x58')]();var _0x2f0af5=[];var _0x1698de=squel['expr']();var _0x4be253;if(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x59')]){_0x4be253=as['parseSearch'](_0x111a50['query'][_0x2c2e('0x59')]);var _0x5e96ac=_0x4be253[_0x2c2e('0x5a')];for(var _0x32f140=0x0;_0x32f140<_0x4be253[_0x2c2e('0x5b')][_0x2c2e('0x3f')];_0x32f140++){var _0xf71962=_0x4be253[_0x2c2e('0x5b')][_0x32f140];var _0x2619a7='i';var _0x2c371f=_[_0x2c2e('0x5c')](_0x4d7ef6,['name',_0xf71962[_0x2c2e('0x49')]]);if(!_0x2c371f){switch(_0xf71962[_0x2c2e('0x49')]){case _0x2c2e('0x5d'):if(_0xf71962[_0x2c2e('0x5e')]==0x1){_0x5df321[_0x2c2e('0x5f')]('`'+_0xf71962[_0x2c2e('0x49')]+_0x2c2e('0x60'));}else{_0x5df321['having']('`'+_0xf71962[_0x2c2e('0x49')]+_0x2c2e('0x61'));}break;case _0x2c2e('0x62'):if(_0xf71962[_0x2c2e('0x63')]===_0x2c2e('0x64')){if(_0xf71962['value'][_0x2c2e('0x31')]('\x20')[_0x2c2e('0x3f')]>0x1){_0x5b1b43[_0x5e96ac](_0x2c2e('0x65'),qs[_0x2c2e('0x66')](_0xf71962[_0x2c2e('0x5e')]),null);}else{var _0x41ba9a='%'+_0xf71962[_0x2c2e('0x5e')]+'%';_0x5b1b43[_0x5e96ac](_0x2c2e('0x67'),_0x41ba9a,_0x41ba9a,_0x41ba9a);}}else{_0x2c371f=_[_0x2c2e('0x5c')](_0x4d7ef6,[_0x2c2e('0x2a'),_0x2c2e('0x68')]);_0xf71962['field']=_0x2c2e('0x68');_0x5602b3=as[_0x2c2e('0x69')](_0x2619a7,_0x2c371f['type'],_0xf71962);_0x5b1b43[_0x5e96ac](_0x5602b3['text'],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x6a')],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x27')]);}break;case'Tag':var _0x57e1d0=_0xf71962[_0x2c2e('0x5e')][_0x2c2e('0x31')](',')[_0x2c2e('0x2d')](function(_0x178a56){return Number(_0x178a56);});_0x57e1d0[_0x2c2e('0x32')](function(_0x5d0a80){_0x1698de['or'](_0x2c2e('0x6b'),'%,'+_0x5d0a80+',%');});_0x2f0af5=_['union'](_0x2f0af5,_0x57e1d0);break;case'User':if(_0xf71962[_0x2c2e('0x63')]===_0x2c2e('0x64')){_0x5b1b43[_0x5e96ac](_0x2c2e('0x6c'),'%'+_0xf71962[_0x2c2e('0x5e')]+'%',null);}else{_0x2c371f=_[_0x2c2e('0x5c')](_0x4d7ef6,['name',_0x2c2e('0x6d')]);_0xf71962[_0x2c2e('0x49')]=_0x2c2e('0x6d');_0x5602b3=as[_0x2c2e('0x69')](_0x2619a7,_0x2c371f[_0x2c2e('0x6e')],_0xf71962);_0x5b1b43[_0x5e96ac](_0x5602b3[_0x2c2e('0x6f')],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x6a')],_0x5602b3['value'][_0x2c2e('0x27')]);}break;case _0x2c2e('0x70'):_0x5602b3=as[_0x2c2e('0x69')]('me',null,_0xf71962);_0x5b1b43[_0x5e96ac](_0x5602b3['text'],_0x5602b3[_0x2c2e('0x5e')]['start'],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x27')]);break;}}else{var _0x5602b3=as[_0x2c2e('0x69')](_0x2619a7,_0x2c371f['type'],_0xf71962);_0x5b1b43[_0x5e96ac](_0x5602b3[_0x2c2e('0x6f')],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x6a')],_0x5602b3[_0x2c2e('0x5e')][_0x2c2e('0x27')]);}}}else{var _0x21c542=_(_0x111a50[_0x2c2e('0x39')])[_0x2c2e('0x3a')]()[_0x2c2e('0x2d')](function(_0x5cac75){return _[_0x2c2e('0x71')](_0x4d7ef6,[_0x2c2e('0x2a'),_0x5cac75])?_0x5cac75:undefined;})[_0x2c2e('0x72')]()[_0x2c2e('0x5e')]();if(!_[_0x2c2e('0x73')](_0x21c542)){_0x21c542[_0x2c2e('0x32')](function(_0x59201c){if(_0x59201c===_0x2c2e('0x74')){_0x5df321[_0x2c2e('0x44')](_0x2c2e('0x75'),[][_0x2c2e('0x76')](_0x111a50[_0x2c2e('0x39')][_0x59201c]));}else if(_0x59201c===_0x2c2e('0x77')){var _0x3800ff=JSON[_0x2c2e('0x78')](_0x111a50[_0x2c2e('0x39')][_0x59201c])['$gte'];var _0x3d7aa0=JSON[_0x2c2e('0x78')](_0x111a50[_0x2c2e('0x39')][_0x59201c])[_0x2c2e('0x79')];_0x5df321[_0x2c2e('0x44')](_0x2c2e('0x7a'),_0x3800ff,_0x3d7aa0);}else{if(_0x111a50['query'][_0x59201c]===_0x2c2e('0x7b')){_0x5df321['where']('i.'+_0x59201c+'\x20IS\x20NULL');}else{_0x5df321[_0x2c2e('0x44')]('i.'+_0x59201c+_0x2c2e('0x7c'),_0x111a50[_0x2c2e('0x39')][_0x59201c]);}}});}if(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x7d')]){if(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x7d')]==0x1){_0x5df321['having'](_0x2c2e('0x7e'));}else{_0x5df321[_0x2c2e('0x5f')](_0x2c2e('0x7f'));}}if(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x80')]){_0x2f0af5=_[_0x2c2e('0x81')](_0x111a50['query'][_0x2c2e('0x80')])?_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x80')]:new Array(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x80')]);_0x2f0af5[_0x2c2e('0x32')](function(_0x690fbd){_0x1698de['or'](_0x2c2e('0x6b'),'%,'+_0x690fbd+',%');});}if(_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x82')]){var _0x2e9106=_0x111a50['query'][_0x2c2e('0x82')][_0x2c2e('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2c2e('0x84')](_0x2e9106)){_0x5b1b43['or'](_0x2c2e('0x85'),_0x2e9106+'%')['or']('i.fax\x20LIKE\x20?',_0x2e9106+'%');}_0x5b1b43['or'](_0x2c2e('0x86'),_0x2e9106+'%');}}_0x5df321[_0x2c2e('0x44')](_0x5b1b43);_0x5df321[_0x2c2e('0x87')](_0x2c2e('0x88'));var _0x452d21={'type':db[_0x2c2e('0x89')][_0x2c2e('0x8a')]['SELECT'],'raw':!![]};var _0x5cf696=_0x5df321['clone']();_0x5cf696[_0x2c2e('0x49')](_0x2c2e('0x88'));_0x5cf696[_0x2c2e('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2c2e('0x5d'));if(_0x4756e1[_0x2c2e('0x42')]){_0x4756e1[_0x2c2e('0x42')]['forEach'](function(_0x210669){var _0x523d31=_0x210669[0x0]===_0x2c2e('0x8b')?_0x210669[0x0]:'i.'+_0x210669[0x0];_0x5df321[_0x2c2e('0x42')](_0x523d31,_0x210669[0x1]===_0x2c2e('0x8c')?![]:!![]);});}if(!_[_0x2c2e('0x73')](_0x2f0af5)){_0x5df321[_0x2c2e('0x5f')](_0x1698de);_0x5cf696['where'](_0x2c2e('0x8d'),_0x2f0af5);}BPromise['resolve']()[_0x2c2e('0x25')](function(){if(!_0x4be253){if(_0x111a50['query'][_0x2c2e('0x74')])return;_0x5cf696[_0x2c2e('0x44')](_0x2c2e('0x8e'));_0x5df321[_0x2c2e('0x44')](_0x2c2e('0x8e'));return;}if(_0x111a50[_0x2c2e('0x8f')][_0x2c2e('0x90')]!==_0x2c2e('0x91'))return;return _0x111a50['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x2c2e('0x25')](function(_0x33ad90){if(_[_0x2c2e('0x73')](_0x33ad90)){_0x5cf696[_0x2c2e('0x44')](_0x2c2e('0x92'));_0x5df321[_0x2c2e('0x44')](_0x2c2e('0x92'));}else{_0x5cf696[_0x2c2e('0x44')](_0x2c2e('0x75'),_[_0x2c2e('0x2d')](_0x33ad90,'id'));_0x5df321[_0x2c2e('0x44')](_0x2c2e('0x75'),_[_0x2c2e('0x2d')](_0x33ad90,'id'));}});})[_0x2c2e('0x25')](function(){if(_0x111a50[_0x2c2e('0x8f')]['role']==='agent'&&!_0x4be253&&!_0x111a50[_0x2c2e('0x39')][_0x2c2e('0x74')])return[];return db[_0x2c2e('0x93')]['query'](_0x5cf696['toString'](),_0x452d21);})[_0x2c2e('0x25')](function(_0x24d546){_0x148bd4[_0x2c2e('0x20')]=_0x24d546[_0x2c2e('0x3f')];if(_0x148bd4[_0x2c2e('0x20')]===0x0)return[];return db[_0x2c2e('0x93')][_0x2c2e('0x39')](_0x2e2a10[_0x2c2e('0x94')](),_0x452d21)[_0x2c2e('0x25')](function(_0x33bd7a){_0x37b1b8=_[_0x2c2e('0x95')](_0x33bd7a,'id');_0x452d21=_[_0x2c2e('0x96')](_0x452d21,{'model':db[_0x2c2e('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x111a50[_0x2c2e('0x39')]['fields']){_0x4756e1[_0x2c2e('0x3d')][_0x2c2e('0x32')](function(_0x4ea3a3){_0x5df321['field']('i.'+_0x4ea3a3);});}else{_0x5df321[_0x2c2e('0x49')](_0x2c2e('0x97'),_0x2c2e('0x5d'));_0x5df321[_0x2c2e('0x49')]('a.key',_0x2c2e('0x98'));_0x5df321[_0x2c2e('0x49')]('a.mandatoryDisposition',_0x2c2e('0x99'));_0x5df321[_0x2c2e('0x49')](_0x2c2e('0x9a'),_0x2c2e('0x8b'));_0x5df321['field'](_0x2c2e('0x9b'));_0x5df321[_0x2c2e('0x49')](_0x2c2e('0x9c'),_0x2c2e('0x9d'));_0x5df321[_0x2c2e('0x49')](_0x2c2e('0x9e'),_0x2c2e('0x9f'));_0x5df321['field'](_0x2c2e('0xa0'),'Contact.email');_0x5df321['field']('c.phone','Contact.phone');_0x5df321[_0x2c2e('0x49')](_0x2c2e('0xa1'),'Contact.mobile');_0x5df321[_0x2c2e('0x49')](_0x2c2e('0xa2'),'Contact.fax');_0x5df321[_0x2c2e('0x49')](_0x2c2e('0xa3'),_0x2c2e('0xa4'));_0x5df321[_0x2c2e('0x49')]('o.internal',_0x2c2e('0xa5'));_0x5df321[_0x2c2e('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4756e1[_0x2c2e('0x1f')])_0x5df321['limit'](_0x4756e1['limit']);if(_0x4756e1[_0x2c2e('0x1e')])_0x5df321[_0x2c2e('0x1e')](_0x4756e1[_0x2c2e('0x1e')]);return db['sequelize'][_0x2c2e('0x39')](_0x5df321['toString'](),_0x452d21);})[_0x2c2e('0x25')](function(_0x17a01b){if(_0x17a01b[_0x2c2e('0x3f')]>0x0)_0x1e77b5[_0x2c2e('0x44')](_0x2c2e('0xa6'),_['map'](_0x17a01b,'id'));return db[_0x2c2e('0x93')][_0x2c2e('0x39')](_0x1e77b5['toString'](),_0x452d21)['then'](function(_0x9366e6){var _0x53b693=_['groupBy'](_0x9366e6,_0x2c2e('0xa7'));var _0x1b19b7=[];_0x17a01b[_0x2c2e('0x32')](function(_0x3aa1d8){_0x1b19b7[_0x2c2e('0x33')](updateFaxInteraction(_0x3aa1d8,_0x37b1b8,_0x53b693));});return BPromise[_0x2c2e('0xa8')](_0x1b19b7);});});})['then'](function(_0x34c730){_0x148bd4[_0x2c2e('0xa9')]=_0x34c730;return _0x148bd4;})[_0x2c2e('0x25')](respondWithFilteredResult(_0x1cabfb,_0x4756e1))['catch'](handleError(_0x1cabfb,null));};exports[_0x2c2e('0xaa')]=function(_0x2b3c2d,_0x527510){var _0x1a5372={'raw':![],'where':{'id':_0x2b3c2d[_0x2c2e('0xab')]['id']}},_0x47d521={};_0x47d521['model']=_[_0x2c2e('0x3a')](db[_0x2c2e('0x35')]['rawAttributes']);_0x47d521['query']=_[_0x2c2e('0x3a')](_0x2b3c2d[_0x2c2e('0x39')]);_0x47d521['filters']=_[_0x2c2e('0x3c')](_0x47d521['model'],_0x47d521[_0x2c2e('0x39')]);_0x1a5372[_0x2c2e('0x3d')]=_[_0x2c2e('0x3c')](_0x47d521[_0x2c2e('0x38')],qs[_0x2c2e('0x3e')](_0x2b3c2d[_0x2c2e('0x39')][_0x2c2e('0x3e')]));_0x1a5372[_0x2c2e('0x3d')]=_0x1a5372[_0x2c2e('0x3d')][_0x2c2e('0x3f')]?_0x1a5372[_0x2c2e('0x3d')]:_0x47d521['model'];if(_0x2b3c2d[_0x2c2e('0x39')][_0x2c2e('0xac')]){_0x1a5372[_0x2c2e('0xad')]=[{'all':!![]}];}_0x1a5372=_[_0x2c2e('0x96')]({},_0x1a5372,_0x2b3c2d[_0x2c2e('0xae')]);return db[_0x2c2e('0x35')][_0x2c2e('0x5c')](_0x1a5372)[_0x2c2e('0x25')](handleEntityNotFound(_0x527510,null))[_0x2c2e('0x25')](respondWithResult(_0x527510,null))[_0x2c2e('0xaf')](handleError(_0x527510,null));};exports['create']=function(_0x5a2a9f,_0x13113d){return db[_0x2c2e('0x35')][_0x2c2e('0xb0')](_0x5a2a9f[_0x2c2e('0x70')],{})[_0x2c2e('0x25')](respondWithResult(_0x13113d,0xc9))[_0x2c2e('0xaf')](handleError(_0x13113d,null));};exports[_0x2c2e('0x24')]=function(_0x5c8061,_0x5292a5){if(_0x5c8061['body']['id']){delete _0x5c8061[_0x2c2e('0x70')]['id'];}return db[_0x2c2e('0x35')][_0x2c2e('0x5c')]({'where':{'id':_0x5c8061['params']['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x5292a5,null))[_0x2c2e('0x25')](saveUpdates(_0x5c8061[_0x2c2e('0x70')],null))['then'](respondWithResult(_0x5292a5,null))[_0x2c2e('0xaf')](handleError(_0x5292a5,null));};exports[_0x2c2e('0x26')]=function(_0x2816b2,_0x2fc338){return db['FaxInteraction'][_0x2c2e('0x5c')]({'where':{'id':_0x2816b2[_0x2c2e('0xab')]['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x2fc338,null))['then'](removeEntity(_0x2fc338,null))[_0x2c2e('0xaf')](handleError(_0x2fc338,null));};exports[_0x2c2e('0xb1')]=function(_0x4b6deb,_0x5cb313){return db[_0x2c2e('0x35')][_0x2c2e('0xb1')]()[_0x2c2e('0x25')](respondWithResult(_0x5cb313,null))[_0x2c2e('0xaf')](handleError(_0x5cb313,null));};exports[_0x2c2e('0xb2')]=function(_0xe49f87,_0x592529,_0x14f773){return db[_0x2c2e('0xb3')][_0x2c2e('0x5c')]({'where':{'id':_0xe49f87[_0x2c2e('0xab')]['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x592529,null))[_0x2c2e('0x25')](function(_0x14012e){if(_0x14012e){return _0x14012e[_0x2c2e('0xb2')](_0xe49f87[_0x2c2e('0x70')][_0x2c2e('0xb4')],_['omit'](_0xe49f87[_0x2c2e('0x70')],['ids','id'])||{});}})[_0x2c2e('0x25')](respondWithResult(_0x592529,null))[_0x2c2e('0xaf')](handleError(_0x592529,null));};exports[_0x2c2e('0xb5')]=function(_0x4724cc,_0x33e916,_0x1fc0d1){var _0x4fc985={'raw':![],'where':{}};var _0x158453={};var _0x154db5={'count':0x0,'rows':[]};return db[_0x2c2e('0x35')]['findOne']({'where':{'id':_0x4724cc[_0x2c2e('0xab')]['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x33e916,null))['then'](function(_0x4335ff){if(_0x4335ff){_0x158453[_0x2c2e('0x38')]=_[_0x2c2e('0x3a')](db[_0x2c2e('0xb3')][_0x2c2e('0xb6')]);_0x158453[_0x2c2e('0x39')]=_['keys'](_0x4724cc[_0x2c2e('0x39')]);_0x158453[_0x2c2e('0x3b')]=_[_0x2c2e('0x3c')](_0x158453[_0x2c2e('0x38')],_0x158453[_0x2c2e('0x39')]);_0x4fc985['attributes']=_[_0x2c2e('0x3c')](_0x158453[_0x2c2e('0x38')],qs[_0x2c2e('0x3e')](_0x4724cc[_0x2c2e('0x39')]['fields']));_0x4fc985[_0x2c2e('0x3d')]=_0x4fc985[_0x2c2e('0x3d')][_0x2c2e('0x3f')]?_0x4fc985[_0x2c2e('0x3d')]:_0x158453[_0x2c2e('0x38')];if(!_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0x40')](_0x2c2e('0x41'))){_0x4fc985[_0x2c2e('0x1f')]=qs[_0x2c2e('0x1f')](_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0x1f')]);_0x4fc985[_0x2c2e('0x1e')]=qs[_0x2c2e('0x1e')](_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0x1e')]);}_0x4fc985[_0x2c2e('0x42')]=qs[_0x2c2e('0x43')](_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0x43')]);_0x4fc985[_0x2c2e('0x44')]=qs['filters'](_[_0x2c2e('0xb7')](_0x4724cc['query'],_0x158453[_0x2c2e('0x3b')]));_0x4fc985[_0x2c2e('0x44')]['FaxInteractionId']=_0x4335ff['id'];if(_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0x82')]){_0x4fc985[_0x2c2e('0x44')]=_[_0x2c2e('0x96')](_0x4fc985[_0x2c2e('0x44')],{'$or':_[_0x2c2e('0x2d')](_0x4fc985[_0x2c2e('0x3d')],function(_0x1b5382){var _0x2b99f5={};_0x2b99f5[_0x1b5382]={'$like':'%'+_0x4724cc['query'][_0x2c2e('0x82')]+'%'};return _0x2b99f5;})});}if(_0x4724cc[_0x2c2e('0x39')][_0x2c2e('0xb8')]){var _0x4ddb06=_0x4724cc[_0x2c2e('0x39')]['$gte'][_0x2c2e('0x31')](',');var _0x458e99={};_0x458e99[_0x4ddb06[0x0]]={'$gte':moment(_0x4ddb06[0x1])['format'](_0x2c2e('0xb9'))};_0x4fc985[_0x2c2e('0x44')]=_['merge'](_0x4fc985[_0x2c2e('0x44')],_0x458e99);}_0x4fc985=_[_0x2c2e('0x96')]({},_0x4fc985,_0x4724cc[_0x2c2e('0xae')]);return db[_0x2c2e('0xb3')][_0x2c2e('0x20')]({'where':_0x4fc985[_0x2c2e('0x44')]})[_0x2c2e('0x25')](function(_0x16905c){_0x154db5[_0x2c2e('0x20')]=_0x16905c;if(_0x4724cc[_0x2c2e('0x39')]['includeAll']){_0x4fc985[_0x2c2e('0xad')]=[{'all':!![]}];}return db[_0x2c2e('0xb3')][_0x2c2e('0xba')](_0x4fc985);})['then'](function(_0x3443ef){_0x154db5[_0x2c2e('0xa9')]=_0x3443ef;return _0x154db5;});}})[_0x2c2e('0x25')](respondWithFilteredResult(_0x33e916,_0x4fc985))[_0x2c2e('0xaf')](handleError(_0x33e916,null));};exports[_0x2c2e('0xbb')]=function(_0x37a41b,_0x32707e,_0x133086){return db[_0x2c2e('0x35')][_0x2c2e('0x5c')]({'where':{'id':_0x37a41b['params']['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x32707e,null))[_0x2c2e('0x25')](function(_0x490e82){if(_0x490e82){return _0x490e82[_0x2c2e('0xbc')](_0x37a41b[_0x2c2e('0x70')]['ids'],_[_0x2c2e('0xbd')](_0x37a41b[_0x2c2e('0x70')],[_0x2c2e('0xb4'),'id'])||{})[_0x2c2e('0xbe')](function(){return db[_0x2c2e('0xbf')]['findAll']({'attributes':['id','name',_0x2c2e('0x46')],'where':{'id':_0x37a41b[_0x2c2e('0x70')][_0x2c2e('0xb4')]}});})[_0x2c2e('0x25')](function(_0x7b133c){socket[_0x2c2e('0xc0')](_0x2c2e('0xc1'),{'id':Number(_0x37a41b[_0x2c2e('0xab')]['id']),'tags':_0x7b133c||[]});return{'id':Number(_0x37a41b[_0x2c2e('0xab')]['id']),'tags':_0x7b133c||[]};});}})['then'](respondWithResult(_0x32707e,null))[_0x2c2e('0xaf')](handleError(_0x32707e,null));};exports['removeTags']=function(_0x4e2745,_0x17086c,_0x3c5534){return db[_0x2c2e('0x35')][_0x2c2e('0x5c')]({'where':{'id':_0x4e2745[_0x2c2e('0xab')]['id']}})[_0x2c2e('0x25')](handleEntityNotFound(_0x17086c,null))['then'](function(_0x3410ef){if(_0x3410ef){return _0x3410ef[_0x2c2e('0xc2')](_0x4e2745[_0x2c2e('0x39')]['ids']);}})[_0x2c2e('0x25')](respondWithStatusCode(_0x17086c,null))[_0x2c2e('0xaf')](handleError(_0x17086c,null));};exports[_0x2c2e('0xc3')]=function(_0x2248d4,_0x585313){var _0x379715=moment()['unix']()[_0x2c2e('0x94')]();var _0x3d8441=path[_0x2c2e('0xc4')](config[_0x2c2e('0xc5')],_0x2c2e('0xc6'),'files',_0x2c2e('0xc7'));var _0x38aec4=path['join'](config[_0x2c2e('0xc5')],_0x2c2e('0xc6'),_0x2c2e('0xc8'),_0x2c2e('0xc9'));var _0x55aa3b=path['join'](_0x3d8441,_0x379715);var _0x2f54b9=util[_0x2c2e('0xca')](_0x2c2e('0xcb'),_0x2248d4[_0x2c2e('0xab')]['id'],_0x379715);var _0x574b8c=path[_0x2c2e('0xc4')](_0x3d8441,_0x2f54b9);var _0x38ab9f=[];_0x38ab9f['push']({'model':db['Attachment'],'as':_0x2c2e('0xcc'),'raw':!![]});var _0x5d9a45=[{'model':db[_0x2c2e('0xb3')],'as':_0x2c2e('0xcd'),'attributes':['id',_0x2c2e('0x70'),_0x2c2e('0x77')],'include':_0x38ab9f}];return db[_0x2c2e('0x35')][_0x2c2e('0x5c')]({'where':{'id':_0x2248d4[_0x2c2e('0xab')]['id']},'include':_0x5d9a45})[_0x2c2e('0x25')](handleEntityNotFound(_0x585313,null))[_0x2c2e('0x25')](function(_0x1b48df){if(_0x1b48df&&_0x1b48df['Messages']){var _0x29c88a=_0x1b48df[_0x2c2e('0xce')]({'plain':!![]});fs[_0x2c2e('0xcf')](_0x55aa3b);for(var _0x2c508f=0x0;_0x2c508f<_0x29c88a[_0x2c2e('0xcd')]['length'];_0x2c508f++){var _0x4eb113=_0x29c88a[_0x2c2e('0xcd')][_0x2c508f][_0x2c2e('0xcc')];if(_0x4eb113){var _0x2ec3bf=path[_0x2c2e('0xc4')](_0x38aec4,_0x4eb113[_0x2c2e('0xd0')]);if(fs[_0x2c2e('0xd1')](_0x2ec3bf)){fs[_0x2c2e('0xd2')](_0x2ec3bf)[_0x2c2e('0xd3')](fs[_0x2c2e('0xd4')](path[_0x2c2e('0xc4')](_0x55aa3b,_0x4eb113['basename'])));}}}return BPromise[_0x2c2e('0xd5')]()['then'](function(){return new BPromise(function(_0x55f215,_0x554d0a){zipdir(_0x55aa3b,{'saveTo':_0x574b8c},function(_0x3432e4,_0x1fdadf){if(_0x3432e4)return _0x554d0a(_0x3432e4);return _0x55f215(_0x1fdadf);});})[_0x2c2e('0x25')](function(){return new BPromise(function(_0x3a6b70,_0x3e52ca){rimraf(_0x55aa3b,function(_0x14a92b){if(_0x14a92b)_0x3e52ca(_0x14a92b);return _0x3a6b70();});});})[_0x2c2e('0x25')](function(){return _0x585313[_0x2c2e('0xc3')](_0x574b8c,_0x2f54b9,function(_0xc7d12){if(_0xc7d12){console[_0x2c2e('0xd6')](_0x2c2e('0xd7'),_0xc7d12);}else{fs[_0x2c2e('0xd8')](_0x574b8c);}});});});}else{return _0x585313[_0x2c2e('0x28')](0xc8);}})[_0x2c2e('0xaf')](handleError(_0x585313,null));}; \ No newline at end of file +var _0x4376=['fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','field','color','tools_tags','select','u.fullname','ui.FaxInteractionId','from','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','toString','sequelize','merge','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','includeAll','options','describe','addMessage','ids','omit','getMessages','findOne','nolimit','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','include','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','Attachment','Messages','get','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','Users','map'];(function(_0x4dc7e3,_0x420204){var _0x122f29=function(_0x4d47c0){while(--_0x4d47c0){_0x4dc7e3['push'](_0x4dc7e3['shift']());}};_0x122f29(++_0x420204);}(_0x4376,0x176));var _0x6437=function(_0xdb44b1,_0x38fae0){_0xdb44b1=_0xdb44b1-0x0;var _0x351bd0=_0x4376[_0xdb44b1];return _0x351bd0;};'use strict';var emlformat=require(_0x6437('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6437('0x1'));var jsonpatch=require(_0x6437('0x2'));var rp=require(_0x6437('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6437('0x4'));var sox=require('sox');var csv=require(_0x6437('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6437('0x6'));var _=require('lodash');var squel=require(_0x6437('0x7'));var crypto=require(_0x6437('0x8'));var jsforce=require(_0x6437('0x9'));var deskjs=require(_0x6437('0xa'));var toCsv=require(_0x6437('0x5'));var querystring=require('querystring');var Papa=require(_0x6437('0xb'));var Redis=require(_0x6437('0xc'));var authService=require(_0x6437('0xd'));var qs=require(_0x6437('0xe'));var as=require(_0x6437('0xf'));var hardwareService=require(_0x6437('0x10'));var logger=require(_0x6437('0x11'))(_0x6437('0x12'));var utils=require(_0x6437('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6437('0x14'));var db=require(_0x6437('0x15'))['db'];config[_0x6437('0x16')]=_['defaults'](config['redis'],{'host':_0x6437('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6437('0x18'))[_0x6437('0x19')](socket);function respondWithStatusCode(_0x13176a,_0x47fd78){_0x47fd78=_0x47fd78||0xcc;return function(_0x360cfe){if(_0x360cfe){return _0x13176a[_0x6437('0x1a')](_0x47fd78);}return _0x13176a[_0x6437('0x1b')](_0x47fd78)[_0x6437('0x1c')]();};}function respondWithResult(_0x57b8ba,_0x569f03){_0x569f03=_0x569f03||0xc8;return function(_0x3e31ca){if(_0x3e31ca){return _0x57b8ba[_0x6437('0x1b')](_0x569f03)[_0x6437('0x1d')](_0x3e31ca);}};}function respondWithFilteredResult(_0x59509e,_0x177742){return function(_0x1ebffc){if(_0x1ebffc){var _0x495af7=typeof _0x177742['offset']==='undefined'&&typeof _0x177742[_0x6437('0x1e')]===_0x6437('0x1f');var _0x45b031=_0x1ebffc[_0x6437('0x20')];var _0x45cf5e=_0x495af7?0x0:_0x177742[_0x6437('0x21')];var _0x6c3f59=_0x495af7?_0x1ebffc[_0x6437('0x20')]:_0x177742[_0x6437('0x21')]+_0x177742[_0x6437('0x1e')];var _0x5b22fa;if(_0x6c3f59>=_0x45b031){_0x6c3f59=_0x45b031;_0x5b22fa=0xc8;}else{_0x5b22fa=0xce;}_0x59509e[_0x6437('0x1b')](_0x5b22fa);return _0x59509e[_0x6437('0x22')](_0x6437('0x23'),_0x45cf5e+'-'+_0x6c3f59+'/'+_0x45b031)[_0x6437('0x1d')](_0x1ebffc);}return null;};}function patchUpdates(_0x29f6b4){return function(_0x4862ad){try{jsonpatch[_0x6437('0x24')](_0x4862ad,_0x29f6b4,!![]);}catch(_0x39a7ad){return BPromise['reject'](_0x39a7ad);}return _0x4862ad[_0x6437('0x25')]();};}function saveUpdates(_0x4dc39c,_0x119be3){return function(_0x176c6c){if(_0x176c6c){return _0x176c6c['update'](_0x4dc39c)['then'](function(_0xc0cfe8){return _0xc0cfe8;});}return null;};}function removeEntity(_0x36003c,_0x582efe){return function(_0x4b6cc6){if(_0x4b6cc6){return _0x4b6cc6[_0x6437('0x26')]()[_0x6437('0x27')](function(){_0x36003c[_0x6437('0x1b')](0xcc)[_0x6437('0x1c')]();});}};}function handleEntityNotFound(_0x54967b,_0x16b0bb){return function(_0x514f2a){if(!_0x514f2a){_0x54967b[_0x6437('0x1a')](0x194);}return _0x514f2a;};}function handleError(_0xd496f2,_0x392074){_0x392074=_0x392074||0x1f4;return function(_0x26d099){logger[_0x6437('0x28')](_0x26d099[_0x6437('0x29')]);if(_0x26d099[_0x6437('0x2a')]){delete _0x26d099[_0x6437('0x2a')];}_0xd496f2[_0x6437('0x1b')](_0x392074)[_0x6437('0x2b')](_0x26d099);};}function getInteractionUsers(_0xde3da5,_0x34f119){return new BPromise(function(_0x3e49dc,_0x2bc863){try{if(_0x34f119[_0xde3da5['id']]){_0xde3da5[_0x6437('0x2c')]=_[_0x6437('0x2d')](_0x34f119[_0xde3da5['id']],function(_0x39c61a){return{'id':_0x39c61a['id'],'fullname':_0x39c61a[_0x6437('0x2e')]};});}}catch(_0x404004){_0x2bc863(_0x404004);}_0x3e49dc(_0xde3da5);});}function getInteractionTags(_0x456b3a,_0x30012b){return new BPromise(function(_0x3ce308,_0x1f9a57){try{if(_0x456b3a[_0x6437('0x2f')]){_0x456b3a[_0x6437('0x30')]=[];_0x456b3a[_0x6437('0x2f')][_0x6437('0x31')](',')[_0x6437('0x32')](function(_0x3d33d9){_0x456b3a[_0x6437('0x30')][_0x6437('0x33')](_0x30012b[_0x3d33d9]);});}delete _0x456b3a[_0x6437('0x2f')];}catch(_0x5174f4){_0x1f9a57(_0x5174f4);}_0x3ce308(_0x456b3a);});}function updateFaxInteraction(_0x414cd5,_0x24013b,_0x4ff0b6){return new BPromise(function(_0x55a68c,_0x3eba68){return getInteractionUsers(_0x414cd5,_0x4ff0b6)[_0x6437('0x27')](function(_0x301709){return getInteractionTags(_0x301709,_0x24013b);})[_0x6437('0x27')](function(_0x3e433a){_0x55a68c(_0x3e433a);})[_0x6437('0x34')](function(_0x2feaf4){_0x3eba68(_0x2feaf4);});});}exports[_0x6437('0x35')]=function(_0xf54461,_0x460397){var _0x451811={},_0x575ed9={},_0x47b82b={'count':0x0,'rows':[]};var _0x11caf3=_[_0x6437('0x2d')](db[_0x6437('0x36')][_0x6437('0x37')],function(_0x3a3c88){return{'name':_0x3a3c88['fieldName'],'type':_0x3a3c88[_0x6437('0x38')][_0x6437('0x39')]};});_0x575ed9[_0x6437('0x3a')]=_[_0x6437('0x2d')](_0x11caf3,_0x6437('0x2a'));_0x575ed9['query']=_[_0x6437('0x3b')](_0xf54461[_0x6437('0x3c')]);_0x575ed9[_0x6437('0x3d')]=_[_0x6437('0x3e')](_0x575ed9[_0x6437('0x3a')],_0x575ed9[_0x6437('0x3c')]);_0x451811[_0x6437('0x3f')]=_['intersection'](_0x575ed9['model'],qs[_0x6437('0x40')](_0xf54461[_0x6437('0x3c')][_0x6437('0x40')]));_0x451811[_0x6437('0x3f')]=_0x451811[_0x6437('0x3f')][_0x6437('0x41')]?_0x451811['attributes']:_0x575ed9[_0x6437('0x3a')];if(!_0xf54461[_0x6437('0x3c')][_0x6437('0x42')]('nolimit')){_0x451811[_0x6437('0x1e')]=qs[_0x6437('0x1e')](_0xf54461[_0x6437('0x3c')][_0x6437('0x1e')]);_0x451811['offset']=qs[_0x6437('0x21')](_0xf54461[_0x6437('0x3c')][_0x6437('0x21')]);}_0x451811[_0x6437('0x43')]=qs[_0x6437('0x44')](_0xf54461['query'][_0x6437('0x44')]);_0x451811['where']=qs[_0x6437('0x3d')](_['pick'](_0xf54461[_0x6437('0x3c')],_0x575ed9[_0x6437('0x3d')]),_0x11caf3);var _0x326382=[];var _0x97ad8=squel['select']()[_0x6437('0x45')]('id')['field']('name')[_0x6437('0x45')](_0x6437('0x46'))['from'](_0x6437('0x47'));var _0xa240f4=squel[_0x6437('0x48')]()[_0x6437('0x45')]('u.id')['field'](_0x6437('0x49'))[_0x6437('0x45')](_0x6437('0x4a'))[_0x6437('0x4b')]('user_has_fax_interactions','ui')['left_join']('users','u',_0x6437('0x4c'));var _0x529449=squel['select']()['from'](_0x6437('0x4d'),'i')[_0x6437('0x4e')](_0x6437('0x4f'),'c',_0x6437('0x50'))[_0x6437('0x4e')](_0x6437('0x51'),'o',_0x6437('0x52'))[_0x6437('0x4e')]('fax_accounts','a',_0x6437('0x53'))[_0x6437('0x4e')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x6437('0x54'),'it',_0x6437('0x55'))['left_join'](_0x6437('0x47'),'t',_0x6437('0x56'));var _0x567e50=squel[_0x6437('0x57')]();var _0x198e55=[];var _0x55e408=squel[_0x6437('0x57')]();var _0x3629a8;if(_0xf54461[_0x6437('0x3c')]['search']){_0x3629a8=as[_0x6437('0x58')](_0xf54461[_0x6437('0x3c')][_0x6437('0x59')]);var _0x1e8f08=_0x3629a8[_0x6437('0x5a')];for(var _0x519c07=0x0;_0x519c07<_0x3629a8[_0x6437('0x5b')][_0x6437('0x41')];_0x519c07++){var _0x4f6296=_0x3629a8[_0x6437('0x5b')][_0x519c07];var _0x15b78e='i';var _0x4c53c3=_['find'](_0x11caf3,[_0x6437('0x2a'),_0x4f6296['field']]);if(!_0x4c53c3){switch(_0x4f6296[_0x6437('0x45')]){case _0x6437('0x5c'):if(_0x4f6296[_0x6437('0x5d')]==0x1){_0x529449[_0x6437('0x5e')]('`'+_0x4f6296['field']+'`\x20=\x200');}else{_0x529449[_0x6437('0x5e')]('`'+_0x4f6296[_0x6437('0x45')]+_0x6437('0x5f'));}break;case _0x6437('0x60'):if(_0x4f6296[_0x6437('0x61')]===_0x6437('0x62')){if(_0x4f6296['value'][_0x6437('0x31')]('\x20')[_0x6437('0x41')]>0x1){_0x567e50[_0x1e8f08](_0x6437('0x63'),qs['getFullTextValue'](_0x4f6296[_0x6437('0x5d')]),null);}else{var _0x534a96='%'+_0x4f6296[_0x6437('0x5d')]+'%';_0x567e50[_0x1e8f08]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x534a96,_0x534a96,_0x534a96);}}else{_0x4c53c3=_[_0x6437('0x64')](_0x11caf3,['name',_0x6437('0x65')]);_0x4f6296[_0x6437('0x45')]=_0x6437('0x65');_0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3[_0x6437('0x38')],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x68')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x1c')]);}break;case _0x6437('0x69'):var _0x3b5f8e=_0x4f6296[_0x6437('0x5d')]['split'](',')[_0x6437('0x2d')](function(_0x48d659){return Number(_0x48d659);});_0x3b5f8e['forEach'](function(_0x563b5f){_0x55e408['or'](_0x6437('0x6a'),'%,'+_0x563b5f+',%');});_0x198e55=_[_0x6437('0x6b')](_0x198e55,_0x3b5f8e);break;case _0x6437('0x6c'):if(_0x4f6296[_0x6437('0x61')]===_0x6437('0x62')){_0x567e50[_0x1e8f08](_0x6437('0x6d'),'%'+_0x4f6296[_0x6437('0x5d')]+'%',null);}else{_0x4c53c3=_['find'](_0x11caf3,['name',_0x6437('0x6e')]);_0x4f6296[_0x6437('0x45')]=_0x6437('0x6e');_0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3[_0x6437('0x38')],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f['text'],_0x42f84f['value'][_0x6437('0x68')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x1c')]);}break;case _0x6437('0x6f'):_0x42f84f=as[_0x6437('0x66')]('me',null,_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x68')],_0x42f84f['value']['end']);break;}}else{var _0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3['type'],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')]['start'],_0x42f84f['value'][_0x6437('0x1c')]);}}}else{var _0x59a9cc=_(_0xf54461[_0x6437('0x3c')])[_0x6437('0x3b')]()[_0x6437('0x2d')](function(_0x3ebb58){return _[_0x6437('0x70')](_0x11caf3,[_0x6437('0x2a'),_0x3ebb58])?_0x3ebb58:undefined;})[_0x6437('0x71')]()[_0x6437('0x5d')]();if(!_[_0x6437('0x72')](_0x59a9cc)){_0x59a9cc[_0x6437('0x32')](function(_0x5c0c41){if(_0x5c0c41==='FaxAccountId'){_0x529449[_0x6437('0x73')](_0x6437('0x74'),[]['concat'](_0xf54461[_0x6437('0x3c')][_0x5c0c41]));}else if(_0x5c0c41===_0x6437('0x75')){var _0x3d92af=JSON[_0x6437('0x76')](_0xf54461[_0x6437('0x3c')][_0x5c0c41])['$gte'];var _0x16db89=JSON[_0x6437('0x76')](_0xf54461[_0x6437('0x3c')][_0x5c0c41])[_0x6437('0x77')];_0x529449[_0x6437('0x73')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3d92af,_0x16db89);}else{if(_0xf54461[_0x6437('0x3c')][_0x5c0c41]===_0x6437('0x78')){_0x529449[_0x6437('0x73')]('i.'+_0x5c0c41+_0x6437('0x79'));}else{_0x529449[_0x6437('0x73')]('i.'+_0x5c0c41+_0x6437('0x7a'),_0xf54461[_0x6437('0x3c')][_0x5c0c41]);}}});}if(_0xf54461[_0x6437('0x3c')][_0x6437('0x7b')]){if(_0xf54461[_0x6437('0x3c')][_0x6437('0x7b')]==0x1){_0x529449[_0x6437('0x5e')](_0x6437('0x7c'));}else{_0x529449['having'](_0x6437('0x7d'));}}if(_0xf54461['query'][_0x6437('0x7e')]){_0x198e55=_[_0x6437('0x7f')](_0xf54461[_0x6437('0x3c')][_0x6437('0x7e')])?_0xf54461[_0x6437('0x3c')][_0x6437('0x7e')]:new Array(_0xf54461['query'][_0x6437('0x7e')]);_0x198e55[_0x6437('0x32')](function(_0x5ebef7){_0x55e408['or'](_0x6437('0x6a'),'%,'+_0x5ebef7+',%');});}if(_0xf54461[_0x6437('0x3c')]['filter']){var _0x33f8f2=_0xf54461['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x6437('0x80')](/'/g,'\x27\x27');if(qs[_0x6437('0x81')](_0x33f8f2)){_0x567e50['or'](_0x6437('0x82'),_0x33f8f2+'%')['or'](_0x6437('0x83'),_0x33f8f2+'%');}_0x567e50['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x33f8f2+'%');}}_0x529449['where'](_0x567e50);_0x529449[_0x6437('0x84')](_0x6437('0x85'));var _0x1af227={'type':db['Sequelize'][_0x6437('0x86')]['SELECT'],'raw':!![]};var _0x365638=_0x529449[_0x6437('0x87')]();_0x365638[_0x6437('0x45')](_0x6437('0x85'));_0x365638[_0x6437('0x45')](_0x6437('0x88'),_0x6437('0x5c'));if(_0x451811[_0x6437('0x43')]){_0x451811['order'][_0x6437('0x32')](function(_0x3a0aa3){var _0x5863ad=_0x3a0aa3[0x0]===_0x6437('0x89')?_0x3a0aa3[0x0]:'i.'+_0x3a0aa3[0x0];_0x529449[_0x6437('0x43')](_0x5863ad,_0x3a0aa3[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6437('0x72')](_0x198e55)){_0x529449[_0x6437('0x5e')](_0x55e408);_0x365638[_0x6437('0x73')]('t.id\x20IN\x20?',_0x198e55);}BPromise['resolve']()[_0x6437('0x27')](function(){if(!_0x3629a8){if(_0xf54461[_0x6437('0x3c')][_0x6437('0x8a')])return;_0x365638['where'](_0x6437('0x8b'));_0x529449[_0x6437('0x73')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xf54461['user'][_0x6437('0x8c')]!==_0x6437('0x8d'))return;return _0xf54461[_0x6437('0x8e')][_0x6437('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41fdce){if(_[_0x6437('0x72')](_0x41fdce)){_0x365638['where']('i.FaxAccountId\x20IS\x20NULL');_0x529449['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x365638[_0x6437('0x73')](_0x6437('0x74'),_[_0x6437('0x2d')](_0x41fdce,'id'));_0x529449['where'](_0x6437('0x74'),_[_0x6437('0x2d')](_0x41fdce,'id'));}});})['then'](function(){if(_0xf54461[_0x6437('0x8e')][_0x6437('0x8c')]===_0x6437('0x8d')&&!_0x3629a8&&!_0xf54461[_0x6437('0x3c')][_0x6437('0x8a')])return[];return db['sequelize'][_0x6437('0x3c')](_0x365638[_0x6437('0x90')](),_0x1af227);})[_0x6437('0x27')](function(_0x3a4f74){_0x47b82b[_0x6437('0x20')]=_0x3a4f74[_0x6437('0x41')];if(_0x47b82b[_0x6437('0x20')]===0x0)return[];return db[_0x6437('0x91')][_0x6437('0x3c')](_0x97ad8[_0x6437('0x90')](),_0x1af227)[_0x6437('0x27')](function(_0x5afcee){_0x326382=_['keyBy'](_0x5afcee,'id');_0x1af227=_[_0x6437('0x92')](_0x1af227,{'model':db[_0x6437('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf54461[_0x6437('0x3c')][_0x6437('0x40')]){_0x451811[_0x6437('0x3f')][_0x6437('0x32')](function(_0x50f360){_0x529449[_0x6437('0x45')]('i.'+_0x50f360);});}else{_0x529449[_0x6437('0x45')](_0x6437('0x88'),_0x6437('0x5c'));_0x529449[_0x6437('0x45')](_0x6437('0x93'),'Account.key');_0x529449['field'](_0x6437('0x94'),'Account.mandatoryDisposition');_0x529449[_0x6437('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x529449['field'](_0x6437('0x95'));_0x529449[_0x6437('0x45')](_0x6437('0x96'),_0x6437('0x97'));_0x529449['field'](_0x6437('0x98'),_0x6437('0x99'));_0x529449[_0x6437('0x45')](_0x6437('0x9a'),_0x6437('0x9b'));_0x529449[_0x6437('0x45')](_0x6437('0x9c'),_0x6437('0x9d'));_0x529449['field'](_0x6437('0x9e'),_0x6437('0x9f'));_0x529449['field'](_0x6437('0xa0'),_0x6437('0xa1'));_0x529449['field']('o.fullname',_0x6437('0xa2'));_0x529449[_0x6437('0x45')](_0x6437('0xa3'),_0x6437('0xa4'));_0x529449['field'](_0x6437('0xa5'),_0x6437('0x2f'));}if(_0x451811[_0x6437('0x1e')])_0x529449['limit'](_0x451811[_0x6437('0x1e')]);if(_0x451811[_0x6437('0x21')])_0x529449['offset'](_0x451811['offset']);return db[_0x6437('0x91')][_0x6437('0x3c')](_0x529449[_0x6437('0x90')](),_0x1af227);})[_0x6437('0x27')](function(_0x17c307){if(_0x17c307[_0x6437('0x41')]>0x0)_0xa240f4['where'](_0x6437('0xa6'),_[_0x6437('0x2d')](_0x17c307,'id'));return db['sequelize'][_0x6437('0x3c')](_0xa240f4[_0x6437('0x90')](),_0x1af227)[_0x6437('0x27')](function(_0x7d94a8){var _0x52e68a=_['groupBy'](_0x7d94a8,_0x6437('0xa7'));var _0x5d774c=[];_0x17c307[_0x6437('0x32')](function(_0x3c07fe){_0x5d774c[_0x6437('0x33')](updateFaxInteraction(_0x3c07fe,_0x326382,_0x52e68a));});return BPromise[_0x6437('0xa8')](_0x5d774c);});});})[_0x6437('0x27')](function(_0x3b7915){_0x47b82b[_0x6437('0xa9')]=_0x3b7915;return _0x47b82b;})[_0x6437('0x27')](respondWithFilteredResult(_0x460397,_0x451811))[_0x6437('0x34')](handleError(_0x460397,null));};exports[_0x6437('0xaa')]=function(_0x3ce9c6,_0xe3b16a){var _0x216114={'raw':![],'where':{'id':_0x3ce9c6[_0x6437('0xab')]['id']}},_0xb40c84={};_0xb40c84[_0x6437('0x3a')]=_[_0x6437('0x3b')](db['FaxInteraction']['rawAttributes']);_0xb40c84[_0x6437('0x3c')]=_['keys'](_0x3ce9c6[_0x6437('0x3c')]);_0xb40c84[_0x6437('0x3d')]=_['intersection'](_0xb40c84[_0x6437('0x3a')],_0xb40c84[_0x6437('0x3c')]);_0x216114[_0x6437('0x3f')]=_[_0x6437('0x3e')](_0xb40c84[_0x6437('0x3a')],qs['fields'](_0x3ce9c6[_0x6437('0x3c')][_0x6437('0x40')]));_0x216114[_0x6437('0x3f')]=_0x216114[_0x6437('0x3f')]['length']?_0x216114[_0x6437('0x3f')]:_0xb40c84[_0x6437('0x3a')];if(_0x3ce9c6['query'][_0x6437('0xac')]){_0x216114['include']=[{'all':!![]}];}_0x216114=_[_0x6437('0x92')]({},_0x216114,_0x3ce9c6[_0x6437('0xad')]);return db['FaxInteraction']['find'](_0x216114)['then'](handleEntityNotFound(_0xe3b16a,null))[_0x6437('0x27')](respondWithResult(_0xe3b16a,null))[_0x6437('0x34')](handleError(_0xe3b16a,null));};exports['create']=function(_0x16783d,_0x493212){return db[_0x6437('0x36')]['create'](_0x16783d[_0x6437('0x6f')],{})[_0x6437('0x27')](respondWithResult(_0x493212,0xc9))['catch'](handleError(_0x493212,null));};exports['update']=function(_0xf59581,_0x2f3dd5){if(_0xf59581['body']['id']){delete _0xf59581[_0x6437('0x6f')]['id'];}return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0xf59581[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x2f3dd5,null))['then'](saveUpdates(_0xf59581['body'],null))[_0x6437('0x27')](respondWithResult(_0x2f3dd5,null))[_0x6437('0x34')](handleError(_0x2f3dd5,null));};exports[_0x6437('0x26')]=function(_0x4a8dba,_0x1fe619){return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0x4a8dba[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x1fe619,null))[_0x6437('0x27')](removeEntity(_0x1fe619,null))['catch'](handleError(_0x1fe619,null));};exports[_0x6437('0xae')]=function(_0x25070c,_0x59790c){return db[_0x6437('0x36')][_0x6437('0xae')]()[_0x6437('0x27')](respondWithResult(_0x59790c,null))[_0x6437('0x34')](handleError(_0x59790c,null));};exports[_0x6437('0xaf')]=function(_0x28cea1,_0x1396a4,_0x309dc4){return db['FaxMessage'][_0x6437('0x64')]({'where':{'id':_0x28cea1[_0x6437('0xab')]['id']}})['then'](handleEntityNotFound(_0x1396a4,null))[_0x6437('0x27')](function(_0xb4ccf6){if(_0xb4ccf6){return _0xb4ccf6['addMessage'](_0x28cea1['body'][_0x6437('0xb0')],_[_0x6437('0xb1')](_0x28cea1[_0x6437('0x6f')],['ids','id'])||{});}})[_0x6437('0x27')](respondWithResult(_0x1396a4,null))[_0x6437('0x34')](handleError(_0x1396a4,null));};exports[_0x6437('0xb2')]=function(_0x43493e,_0xf52bd0,_0x2a35c0){var _0x186004={'raw':![],'where':{}};var _0x284ff4={};var _0x2356a1={'count':0x0,'rows':[]};return db[_0x6437('0x36')][_0x6437('0xb3')]({'where':{'id':_0x43493e[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0xf52bd0,null))[_0x6437('0x27')](function(_0x3d38cd){if(_0x3d38cd){_0x284ff4['model']=_[_0x6437('0x3b')](db['FaxMessage'][_0x6437('0x37')]);_0x284ff4['query']=_[_0x6437('0x3b')](_0x43493e['query']);_0x284ff4['filters']=_[_0x6437('0x3e')](_0x284ff4[_0x6437('0x3a')],_0x284ff4['query']);_0x186004[_0x6437('0x3f')]=_[_0x6437('0x3e')](_0x284ff4[_0x6437('0x3a')],qs['fields'](_0x43493e['query'][_0x6437('0x40')]));_0x186004[_0x6437('0x3f')]=_0x186004[_0x6437('0x3f')][_0x6437('0x41')]?_0x186004['attributes']:_0x284ff4['model'];if(!_0x43493e['query'][_0x6437('0x42')](_0x6437('0xb4'))){_0x186004[_0x6437('0x1e')]=qs[_0x6437('0x1e')](_0x43493e['query']['limit']);_0x186004[_0x6437('0x21')]=qs[_0x6437('0x21')](_0x43493e[_0x6437('0x3c')]['offset']);}_0x186004['order']=qs[_0x6437('0x44')](_0x43493e[_0x6437('0x3c')]['sort']);_0x186004[_0x6437('0x73')]=qs[_0x6437('0x3d')](_['pick'](_0x43493e['query'],_0x284ff4[_0x6437('0x3d')]));_0x186004[_0x6437('0x73')][_0x6437('0xa7')]=_0x3d38cd['id'];if(_0x43493e[_0x6437('0x3c')][_0x6437('0xb5')]){_0x186004['where']=_[_0x6437('0x92')](_0x186004['where'],{'$or':_[_0x6437('0x2d')](_0x186004[_0x6437('0x3f')],function(_0x4b9c08){var _0xe72b01={};_0xe72b01[_0x4b9c08]={'$like':'%'+_0x43493e[_0x6437('0x3c')][_0x6437('0xb5')]+'%'};return _0xe72b01;})});}if(_0x43493e[_0x6437('0x3c')][_0x6437('0xb6')]){var _0x22916f=_0x43493e['query'][_0x6437('0xb6')][_0x6437('0x31')](',');var _0x10036f={};_0x10036f[_0x22916f[0x0]]={'$gte':moment(_0x22916f[0x1])[_0x6437('0xb7')](_0x6437('0xb8'))};_0x186004[_0x6437('0x73')]=_['merge'](_0x186004[_0x6437('0x73')],_0x10036f);}_0x186004=_[_0x6437('0x92')]({},_0x186004,_0x43493e[_0x6437('0xad')]);return db[_0x6437('0xb9')][_0x6437('0x20')]({'where':_0x186004['where']})[_0x6437('0x27')](function(_0x3c6ebe){_0x2356a1[_0x6437('0x20')]=_0x3c6ebe;if(_0x43493e[_0x6437('0x3c')][_0x6437('0xac')]){_0x186004[_0x6437('0xba')]=[{'all':!![]}];}return db[_0x6437('0xb9')][_0x6437('0xbb')](_0x186004);})['then'](function(_0x201eb9){_0x2356a1[_0x6437('0xa9')]=_0x201eb9;return _0x2356a1;});}})[_0x6437('0x27')](respondWithFilteredResult(_0xf52bd0,_0x186004))[_0x6437('0x34')](handleError(_0xf52bd0,null));};exports[_0x6437('0xbc')]=function(_0xd2d7d3,_0x1a9e48,_0xa6f3e1){return db[_0x6437('0x36')]['find']({'where':{'id':_0xd2d7d3[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x1a9e48,null))[_0x6437('0x27')](function(_0x49dfcb){if(_0x49dfcb){return _0x49dfcb['setTags'](_0xd2d7d3[_0x6437('0x6f')]['ids'],_['omit'](_0xd2d7d3['body'],['ids','id'])||{})[_0x6437('0xbd')](function(){return db[_0x6437('0x69')][_0x6437('0xbb')]({'attributes':['id',_0x6437('0x2a'),_0x6437('0x46')],'where':{'id':_0xd2d7d3[_0x6437('0x6f')][_0x6437('0xb0')]}});})[_0x6437('0x27')](function(_0x54dc05){socket[_0x6437('0xbe')](_0x6437('0xbf'),{'id':Number(_0xd2d7d3[_0x6437('0xab')]['id']),'tags':_0x54dc05||[]});return{'id':Number(_0xd2d7d3['params']['id']),'tags':_0x54dc05||[]};});}})[_0x6437('0x27')](respondWithResult(_0x1a9e48,null))[_0x6437('0x34')](handleError(_0x1a9e48,null));};exports[_0x6437('0xc0')]=function(_0x1ceb9f,_0x4a7ad7,_0x3cd41b){return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0x1ceb9f[_0x6437('0xab')]['id']}})['then'](handleEntityNotFound(_0x4a7ad7,null))[_0x6437('0x27')](function(_0x56fc8f){if(_0x56fc8f){return _0x56fc8f['removeTags'](_0x1ceb9f[_0x6437('0x3c')][_0x6437('0xb0')]);}})[_0x6437('0x27')](respondWithStatusCode(_0x4a7ad7,null))[_0x6437('0x34')](handleError(_0x4a7ad7,null));};exports['download']=function(_0x98d0c6,_0xef2c01){var _0x13498c=moment()[_0x6437('0xc1')]()['toString']();var _0x5494e2=path[_0x6437('0xc2')](config[_0x6437('0xc3')],_0x6437('0xc4'),_0x6437('0xc5'),_0x6437('0xc6'));var _0x16155c=path[_0x6437('0xc2')](config['root'],'server',_0x6437('0xc5'),_0x6437('0xc7'));var _0x2b2df8=path['join'](_0x5494e2,_0x13498c);var _0x52360b=util['format']('transcript-%d-%s.zip',_0x98d0c6[_0x6437('0xab')]['id'],_0x13498c);var _0x52c0fa=path[_0x6437('0xc2')](_0x5494e2,_0x52360b);var _0x3a4330=[];_0x3a4330[_0x6437('0x33')]({'model':db[_0x6437('0xc8')],'as':'Attachment','raw':!![]});var _0x20e3cf=[{'model':db[_0x6437('0xb9')],'as':_0x6437('0xc9'),'attributes':['id',_0x6437('0x6f'),_0x6437('0x75')],'include':_0x3a4330}];return db[_0x6437('0x36')]['find']({'where':{'id':_0x98d0c6[_0x6437('0xab')]['id']},'include':_0x20e3cf})[_0x6437('0x27')](handleEntityNotFound(_0xef2c01,null))[_0x6437('0x27')](function(_0x127410){if(_0x127410&&_0x127410[_0x6437('0xc9')]){var _0x1d6ad9=_0x127410[_0x6437('0xca')]({'plain':!![]});fs['mkdirSync'](_0x2b2df8);for(var _0x1c367f=0x0;_0x1c367f<_0x1d6ad9[_0x6437('0xc9')]['length'];_0x1c367f++){var _0x4b4d2c=_0x1d6ad9[_0x6437('0xc9')][_0x1c367f][_0x6437('0xc8')];if(_0x4b4d2c){var _0x5c6ba0=path[_0x6437('0xc2')](_0x16155c,_0x4b4d2c['basename']);if(fs['existsSync'](_0x5c6ba0)){fs['createReadStream'](_0x5c6ba0)[_0x6437('0xcb')](fs[_0x6437('0xcc')](path['join'](_0x2b2df8,_0x4b4d2c[_0x6437('0xcd')])));}}}return BPromise[_0x6437('0xce')]()[_0x6437('0x27')](function(){return new BPromise(function(_0x184f97,_0x239f7d){zipdir(_0x2b2df8,{'saveTo':_0x52c0fa},function(_0x366857,_0x24c3ab){if(_0x366857)return _0x239f7d(_0x366857);return _0x184f97(_0x24c3ab);});})[_0x6437('0x27')](function(){return new BPromise(function(_0x47ffde,_0x55b4bf){rimraf(_0x2b2df8,function(_0x31082f){if(_0x31082f)_0x55b4bf(_0x31082f);return _0x47ffde();});});})[_0x6437('0x27')](function(){return _0xef2c01['download'](_0x52c0fa,_0x52360b,function(_0x5d3683){if(_0x5d3683){console[_0x6437('0xcf')](_0x6437('0xd0'),_0x5d3683);}else{fs[_0x6437('0xd1')](_0x52c0fa);}});});});}else{return _0xef2c01['sendStatus'](0xc8);}})[_0x6437('0x34')](handleError(_0xef2c01,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 21e52ec..f328db1 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 _0x1d24=['findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue','Users'];(function(_0x454115,_0x107e1b){var _0x588bdf=function(_0x43eeb6){while(--_0x43eeb6){_0x454115['push'](_0x454115['shift']());}};_0x588bdf(++_0x107e1b);}(_0x1d24,0xe7));var _0x41d2=function(_0x549443,_0x2e04c8){_0x549443=_0x549443-0x0;var _0x372ed3=_0x1d24[_0x549443];return _0x372ed3;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x41d2('0x0'))['db'][_0x41d2('0x1')];var FaxMessage=require(_0x41d2('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x41d2('0x2')](0x0);var events={'afterCreate':_0x41d2('0x3'),'afterUpdate':'update','afterDestroy':_0x41d2('0x4')};function emitEvent(_0x1ad465){return function(_0x5262b5,_0x4999ab,_0x30b3bb){_0x5262b5[_0x41d2('0x5')]({'attributes':['id'],'raw':!![]})[_0x41d2('0x6')](function(_0x40429a){_0x5262b5[_0x41d2('0x7')](_0x41d2('0x8'),_0x40429a['map'](function(_0x28bb04){return{'id':_0x28bb04['id']};}));return FaxMessage[_0x41d2('0x9')]({'where':{'FaxInteractionId':_0x5262b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x41d2('0x6')](function(_0x84fe3d){_0x5262b5[_0x41d2('0x7')](_0x41d2('0xa'),_0x84fe3d[_0x41d2('0xb')]);FaxInteractionEvents[_0x41d2('0xc')](_0x1ad465+':'+_0x5262b5['id'],_0x5262b5);FaxInteractionEvents[_0x41d2('0xc')](_0x1ad465,_0x5262b5);_0x30b3bb(null);})['catch'](_0x30b3bb(null));};}for(var e in events){if(events[_0x41d2('0xd')](e)){var event=events[e];FaxInteraction[_0x41d2('0xe')](e,emitEvent(event));}}module[_0x41d2('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x145c=['remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x2c1607,_0x65f591){var _0x30826b=function(_0x480b8c){while(--_0x480b8c){_0x2c1607['push'](_0x2c1607['shift']());}};_0x30826b(++_0x65f591);}(_0x145c,0x13b));var _0xc145=function(_0x47c500,_0x108b42){_0x47c500=_0x47c500-0x0;var _0x2b7656=_0x145c[_0x47c500];return _0x2b7656;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc145('0x0'))['db'][_0xc145('0x1')];var FaxMessage=require(_0xc145('0x0'))['db'][_0xc145('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc145('0x3')](0x0);var events={'afterCreate':_0xc145('0x4'),'afterUpdate':'update','afterDestroy':_0xc145('0x5')};function emitEvent(_0x142e76){return function(_0x46cbd3,_0x4ada88,_0x326585){_0x46cbd3[_0xc145('0x6')]({'attributes':['id'],'raw':!![]})[_0xc145('0x7')](function(_0x409f10){_0x46cbd3[_0xc145('0x8')](_0xc145('0x9'),_0x409f10[_0xc145('0xa')](function(_0x5a745a){return{'id':_0x5a745a['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x46cbd3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x361ea3){_0x46cbd3[_0xc145('0x8')](_0xc145('0xb'),_0x361ea3[_0xc145('0xc')]);FaxInteractionEvents[_0xc145('0xd')](_0x142e76+':'+_0x46cbd3['id'],_0x46cbd3);FaxInteractionEvents[_0xc145('0xd')](_0x142e76,_0x46cbd3);_0x326585(null);})['catch'](_0x326585(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc145('0xe')](e,emitEvent(event));}}module[_0xc145('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 702b2ac..2d100d0 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 _0x1c63=['request-promise','path','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird'];(function(_0x332546,_0x3c0d8b){var _0x5ac6f3=function(_0x2358bc){while(--_0x2358bc){_0x332546['push'](_0x332546['shift']());}};_0x5ac6f3(++_0x3c0d8b);}(_0x1c63,0xdc));var _0x31c6=function(_0x172e0a,_0x15d22a){_0x172e0a=_0x172e0a-0x0;var _0x4baf16=_0x1c63[_0x172e0a];return _0x4baf16;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var logger=require(_0x31c6('0x2'))(_0x31c6('0x3'));var moment=require('moment');var BPromise=require(_0x31c6('0x4'));var rp=require(_0x31c6('0x5'));var fs=require('fs');var path=require(_0x31c6('0x6'));var rimraf=require('rimraf');var config=require(_0x31c6('0x7'));var attributes=require(_0x31c6('0x8'));module[_0x31c6('0x9')]=function(_0x1f4994,_0xfd3cf3){return _0x1f4994['define']('FaxInteraction',attributes,{'tableName':_0x31c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x184d7d,_0x37cc89,_0x289926){if(_0x184d7d[_0x31c6('0xb')]('closed')){_0x184d7d[_0x31c6('0xc')]=moment()[_0x31c6('0xd')](_0x31c6('0xe'));}_0x289926(null,_0x184d7d);}}});}; \ No newline at end of file +var _0xd530=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','changed','closed'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd530,0x7a));var _0x0d53=function(_0x582e2b,_0x26d132){_0x582e2b=_0x582e2b-0x0;var _0x3cc735=_0xd530[_0x582e2b];return _0x3cc735;};'use strict';var _=require(_0x0d53('0x0'));var util=require('util');var logger=require(_0x0d53('0x1'))(_0x0d53('0x2'));var moment=require(_0x0d53('0x3'));var BPromise=require(_0x0d53('0x4'));var rp=require(_0x0d53('0x5'));var fs=require('fs');var path=require(_0x0d53('0x6'));var rimraf=require(_0x0d53('0x7'));var config=require(_0x0d53('0x8'));var attributes=require('./faxInteraction.attributes');module[_0x0d53('0x9')]=function(_0x6a30d4,_0x495ab1){return _0x6a30d4['define'](_0x0d53('0xa'),attributes,{'tableName':_0x0d53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1edc3b,_0x2fece9,_0xbc90ec){if(_0x1edc3b[_0x0d53('0xc')](_0x0d53('0xd'))){_0x1edc3b[_0x0d53('0xe')]=moment()[_0x0d53('0xf')](_0x0d53('0x10'));}_0xbc90ec(null,_0x1edc3b);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 094c7e1..23a9866 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 _0x841e=['then','info','request\x20sent','debug','error','code','FaxInteraction,\x20%s,\x20%s','message','result','FaxInteraction','body','options','limit','UpdateFaxInteraction','stringify','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x841e,0xb7));var _0xe841=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x841e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var moment=require(_0xe841('0x2'));var BPromise=require(_0xe841('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe841('0x4'));var db=require(_0xe841('0x5'))['db'];var utils=require(_0xe841('0x6'));var logger=require('../../config/logger')(_0xe841('0x7'));var config=require(_0xe841('0x8'));var jayson=require(_0xe841('0x9'));var client=jayson[_0xe841('0xa')][_0xe841('0xb')]({'port':0x232a});config['redis']=_[_0xe841('0xc')](config['redis'],{'host':_0xe841('0xd'),'port':0x18eb});var socket=require(_0xe841('0xe'))(new Redis(config[_0xe841('0xf')]));require(_0xe841('0x10'))['register'](socket);function respondWithRpcPromise(_0x776461,_0x31ff5a,_0x580724){return new BPromise(function(_0x4eb688,_0x2264b0){return client['request'](_0x776461,_0x580724)[_0xe841('0x11')](function(_0x96369c){logger[_0xe841('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x31ff5a,_0xe841('0x13'));logger[_0xe841('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x31ff5a,_0xe841('0x13'),JSON['stringify'](_0x96369c));if(_0x96369c['error']){if(_0x96369c[_0xe841('0x15')][_0xe841('0x16')]===0x1f4){logger[_0xe841('0x15')](_0xe841('0x17'),_0x31ff5a,_0x96369c[_0xe841('0x15')][_0xe841('0x18')]);return _0x2264b0(_0x96369c[_0xe841('0x15')]['message']);}logger[_0xe841('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x31ff5a,_0x96369c[_0xe841('0x15')][_0xe841('0x18')]);return _0x4eb688(_0x96369c[_0xe841('0x15')][_0xe841('0x18')]);}else{logger['info'](_0xe841('0x17'),_0x31ff5a,_0xe841('0x13'));_0x4eb688(_0x96369c[_0xe841('0x19')][_0xe841('0x18')]);}})['catch'](function(_0x4c0d28){logger[_0xe841('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x31ff5a,_0x4c0d28);_0x2264b0(_0x4c0d28);});});}exports['UpdateFaxInteraction']=function(_0x4dc9cb){var _0x52a7e1=this;return new Promise(function(_0x567990,_0x42bb49){return db[_0xe841('0x1a')]['update'](_0x4dc9cb[_0xe841('0x1b')],{'raw':_0x4dc9cb[_0xe841('0x1c')]?_0x4dc9cb[_0xe841('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dc9cb[_0xe841('0x1c')]?_0x4dc9cb[_0xe841('0x1c')]['where']||null:null,'attributes':_0x4dc9cb[_0xe841('0x1c')]?_0x4dc9cb[_0xe841('0x1c')]['attributes']||null:null,'limit':_0x4dc9cb['options']?_0x4dc9cb[_0xe841('0x1c')][_0xe841('0x1d')]||null:null})['then'](function(_0x94f589){logger[_0xe841('0x12')]('UpdateFaxInteraction',_0x4dc9cb);logger[_0xe841('0x14')](_0xe841('0x1e'),_0x4dc9cb,JSON[_0xe841('0x1f')](_0x94f589));_0x567990(_0x94f589);})[_0xe841('0x20')](function(_0x3bdae5){logger[_0xe841('0x15')]('UpdateFaxInteraction',_0x3bdae5[_0xe841('0x18')],_0x4dc9cb);_0x42bb49(_0x52a7e1[_0xe841('0x15')](0x1f4,_0x3bdae5[_0xe841('0x18')]));});});};exports[_0xe841('0x21')]=function(_0x12a61c){return new Promise(function(_0x79c3d2,_0x4b2847){return db[_0xe841('0x1a')][_0xe841('0x22')]({'where':_0x12a61c[_0xe841('0x1c')]?_0x12a61c['options']['where']||null:null})[_0xe841('0x11')](function(_0x608a3f){if(_0x608a3f){return _0x608a3f[_0xe841('0x23')](_0x12a61c[_0xe841('0x1b')][_0xe841('0x24')],_[_0xe841('0x25')](_0x12a61c[_0xe841('0x1b')],[_0xe841('0x24'),'id'])||{});}})[_0xe841('0x26')](function(_0x4452cc){logger[_0xe841('0x12')](_0xe841('0x27'),_0x12a61c);logger['debug'](_0xe841('0x27'),_0x12a61c,JSON[_0xe841('0x1f')](_0x4452cc));_0x79c3d2(_0x4452cc);})[_0xe841('0x20')](function(_0x306f99){logger[_0xe841('0x15')](_0xe841('0x27'),_0x306f99[_0xe841('0x18')],_0x12a61c);_0x4b2847(_this[_0xe841('0x15')](0x1f4,_0x306f99['message']));});});}; \ No newline at end of file +var _0x02a1=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x355041,_0x951ec9){var _0x16b089=function(_0x494192){while(--_0x494192){_0x355041['push'](_0x355041['shift']());}};_0x16b089(++_0x951ec9);}(_0x02a1,0x1a3));var _0x102a=function(_0x1064af,_0x54126f){_0x1064af=_0x1064af-0x0;var _0x1ad5cc=_0x02a1[_0x1064af];return _0x1ad5cc;};'use strict';var _=require('lodash');var util=require(_0x102a('0x0'));var moment=require(_0x102a('0x1'));var BPromise=require(_0x102a('0x2'));var rs=require(_0x102a('0x3'));var fs=require('fs');var Redis=require(_0x102a('0x4'));var db=require(_0x102a('0x5'))['db'];var utils=require(_0x102a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x102a('0x7'));var jayson=require(_0x102a('0x8'));var client=jayson[_0x102a('0x9')][_0x102a('0xa')]({'port':0x232a});config[_0x102a('0xb')]=_[_0x102a('0xc')](config['redis'],{'host':_0x102a('0xd'),'port':0x18eb});var socket=require(_0x102a('0xe'))(new Redis(config[_0x102a('0xb')]));require('./faxInteraction.socket')[_0x102a('0xf')](socket);function respondWithRpcPromise(_0x533584,_0x4f8cf9,_0x5b57f3){return new BPromise(function(_0x48318c,_0x16c746){return client[_0x102a('0x10')](_0x533584,_0x5b57f3)[_0x102a('0x11')](function(_0x1c0a02){logger[_0x102a('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x4f8cf9,_0x102a('0x13'));logger[_0x102a('0x14')](_0x102a('0x15'),_0x4f8cf9,_0x102a('0x13'),JSON['stringify'](_0x1c0a02));if(_0x1c0a02[_0x102a('0x16')]){if(_0x1c0a02[_0x102a('0x16')][_0x102a('0x17')]===0x1f4){logger[_0x102a('0x16')](_0x102a('0x18'),_0x4f8cf9,_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);return _0x16c746(_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);}logger[_0x102a('0x16')](_0x102a('0x18'),_0x4f8cf9,_0x1c0a02['error'][_0x102a('0x19')]);return _0x48318c(_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);}else{logger[_0x102a('0x12')](_0x102a('0x18'),_0x4f8cf9,_0x102a('0x13'));_0x48318c(_0x1c0a02[_0x102a('0x1a')][_0x102a('0x19')]);}})['catch'](function(_0x26e33a){logger[_0x102a('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x4f8cf9,_0x26e33a);_0x16c746(_0x26e33a);});});}exports[_0x102a('0x1b')]=function(_0x1d8480){var _0x226bc7=this;return new Promise(function(_0x44271e,_0x36e160){return db[_0x102a('0x1c')][_0x102a('0x1d')](_0x1d8480[_0x102a('0x1e')],{'raw':_0x1d8480[_0x102a('0x1f')]?_0x1d8480['options'][_0x102a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8480[_0x102a('0x1f')]?_0x1d8480[_0x102a('0x1f')][_0x102a('0x21')]||null:null,'attributes':_0x1d8480[_0x102a('0x1f')]?_0x1d8480[_0x102a('0x1f')][_0x102a('0x22')]||null:null,'limit':_0x1d8480['options']?_0x1d8480[_0x102a('0x1f')][_0x102a('0x23')]||null:null})['then'](function(_0x5addbc){logger['info']('UpdateFaxInteraction',_0x1d8480);logger[_0x102a('0x14')]('UpdateFaxInteraction',_0x1d8480,JSON[_0x102a('0x24')](_0x5addbc));_0x44271e(_0x5addbc);})[_0x102a('0x25')](function(_0x191792){logger[_0x102a('0x16')](_0x102a('0x1b'),_0x191792[_0x102a('0x19')],_0x1d8480);_0x36e160(_0x226bc7[_0x102a('0x16')](0x1f4,_0x191792[_0x102a('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x356af9){return new Promise(function(_0x37bf17,_0x297e5a){return db[_0x102a('0x1c')][_0x102a('0x26')]({'where':_0x356af9['options']?_0x356af9['options'][_0x102a('0x21')]||null:null})['then'](function(_0xc13b14){if(_0xc13b14){return _0xc13b14[_0x102a('0x27')](_0x356af9['body'][_0x102a('0x28')],_[_0x102a('0x29')](_0x356af9['body'],['ids','id'])||{});}})[_0x102a('0x2a')](function(_0x56fa63){logger[_0x102a('0x12')](_0x102a('0x2b'),_0x356af9);logger[_0x102a('0x14')](_0x102a('0x2b'),_0x356af9,JSON['stringify'](_0x56fa63));_0x37bf17(_0x56fa63);})[_0x102a('0x25')](function(_0x5454d1){logger['error'](_0x102a('0x2b'),_0x5454d1['message'],_0x356af9);_0x297e5a(_this[_0x102a('0x16')](0x1f4,_0x5454d1[_0x102a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4634263..f0cf0e2 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 _0xfa4f=['./faxInteraction.events','save','remove','update','emit','removeListener','register','length','faxInteraction:'];(function(_0x400e13,_0x2a8967){var _0x46e5a1=function(_0x3757b0){while(--_0x3757b0){_0x400e13['push'](_0x400e13['shift']());}};_0x46e5a1(++_0x2a8967);}(_0xfa4f,0x6c));var _0xffa4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xfa4f[_0x273c39];return _0x46d6b5;};'use strict';var FaxInteractionEvents=require(_0xffa4('0x0'));var events=[_0xffa4('0x1'),_0xffa4('0x2'),_0xffa4('0x3')];function createListener(_0xab368f,_0x1e3301){return function(_0x2cf68b){_0x1e3301[_0xffa4('0x4')](_0xab368f,_0x2cf68b);};}function removeListener(_0x3780c8,_0xe66ae2){return function(){FaxInteractionEvents[_0xffa4('0x5')](_0x3780c8,_0xe66ae2);};}exports[_0xffa4('0x6')]=function(_0xa3489f){for(var _0x2917bf=0x0,_0xbf11fb=events[_0xffa4('0x7')];_0x2917bf<_0xbf11fb;_0x2917bf++){var _0xe5cc9c=events[_0x2917bf];var _0x307a38=createListener(_0xffa4('0x8')+_0xe5cc9c,_0xa3489f);FaxInteractionEvents['on'](_0xe5cc9c,_0x307a38);}}; \ No newline at end of file +var _0xc286=['remove','emit','removeListener','register','faxInteraction:','save'];(function(_0x349449,_0x407a2f){var _0x4025ff=function(_0x47731d){while(--_0x47731d){_0x349449['push'](_0x349449['shift']());}};_0x4025ff(++_0x407a2f);}(_0xc286,0xfb));var _0x6c28=function(_0x588d7f,_0x129444){_0x588d7f=_0x588d7f-0x0;var _0x447659=_0xc286[_0x588d7f];return _0x447659;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x6c28('0x0'),_0x6c28('0x1'),'update'];function createListener(_0x3fdb82,_0x4770f3){return function(_0x4f74cc){_0x4770f3[_0x6c28('0x2')](_0x3fdb82,_0x4f74cc);};}function removeListener(_0x2ca5d8,_0x32c7b9){return function(){FaxInteractionEvents[_0x6c28('0x3')](_0x2ca5d8,_0x32c7b9);};}exports[_0x6c28('0x4')]=function(_0x1969df){for(var _0x10f20a=0x0,_0x184f5b=events['length'];_0x10f20a<_0x184f5b;_0x10f20a++){var _0x4c292d=events[_0x10f20a];var _0x49766f=createListener(_0x6c28('0x5')+_0x4c292d,_0x1969df);FaxInteractionEvents['on'](_0x4c292d,_0x49766f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b7d2e2e..57a6bd5 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 _0xd709=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57a603,_0x449c01){var _0x2f7b9f=function(_0x2cf419){while(--_0x2cf419){_0x57a603['push'](_0x57a603['shift']());}};_0x2f7b9f(++_0x449c01);}(_0xd709,0x7d));var _0x9d70=function(_0x2aa0f,_0x58bee9){_0x2aa0f=_0x2aa0f-0x0;var _0xfee0e9=_0xd709[_0x2aa0f];return _0xfee0e9;};'use strict';var multer=require(_0x9d70('0x0'));var util=require(_0x9d70('0x1'));var path=require(_0x9d70('0x2'));var timeout=require(_0x9d70('0x3'));var express=require(_0x9d70('0x4'));var router=express[_0x9d70('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d70('0x6'));var interaction=require(_0x9d70('0x7'));var config=require(_0x9d70('0x8'));var controller=require(_0x9d70('0x9'));router[_0x9d70('0xa')]('/',auth[_0x9d70('0xb')](),controller[_0x9d70('0xc')]);router[_0x9d70('0xa')](_0x9d70('0xd'),auth['isAuthenticated'](),controller[_0x9d70('0xe')]);router[_0x9d70('0xa')](_0x9d70('0xf'),auth[_0x9d70('0xb')](),controller['show']);router['get'](_0x9d70('0x10'),auth[_0x9d70('0xb')](),controller[_0x9d70('0x11')]);router[_0x9d70('0xa')](_0x9d70('0x12'),auth[_0x9d70('0xb')](),controller['download']);router[_0x9d70('0x13')]('/',auth[_0x9d70('0xb')](),controller[_0x9d70('0x14')]);router[_0x9d70('0x13')](_0x9d70('0x10'),auth[_0x9d70('0xb')](),controller[_0x9d70('0x15')]);router[_0x9d70('0x13')](_0x9d70('0x16'),auth[_0x9d70('0xb')](),interaction[_0x9d70('0x17')]('fax',_0x9d70('0x18')),controller[_0x9d70('0x19')]);router[_0x9d70('0x1a')](_0x9d70('0xf'),auth[_0x9d70('0xb')](),interaction[_0x9d70('0x17')](_0x9d70('0x1b'),'faxinteraction:update'),controller[_0x9d70('0x1c')]);router[_0x9d70('0x1d')]('/:id',auth[_0x9d70('0xb')](),interaction['tracked'](_0x9d70('0x1b'),_0x9d70('0x1e')),controller['destroy']);router[_0x9d70('0x1d')](_0x9d70('0x16'),auth['isAuthenticated'](),controller[_0x9d70('0x1f')]);module[_0x9d70('0x20')]=router; \ No newline at end of file +var _0xb0b7=['addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','fax','faxinteraction:addtags'];(function(_0x63dcd1,_0x3703d5){var _0x1bc9a9=function(_0x3db511){while(--_0x3db511){_0x63dcd1['push'](_0x63dcd1['shift']());}};_0x1bc9a9(++_0x3703d5);}(_0xb0b7,0x196));var _0x7b0b=function(_0x3c8073,_0x23a0b6){_0x3c8073=_0x3c8073-0x0;var _0xc7e0b8=_0xb0b7[_0x3c8073];return _0xc7e0b8;};'use strict';var multer=require(_0x7b0b('0x0'));var util=require('util');var path=require(_0x7b0b('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b0b('0x2'));var router=express[_0x7b0b('0x3')]();var fs_extra=require(_0x7b0b('0x4'));var auth=require(_0x7b0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b0b('0x6'));var controller=require(_0x7b0b('0x7'));router[_0x7b0b('0x8')]('/',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xa')]);router[_0x7b0b('0x8')]('/describe',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xb')]);router[_0x7b0b('0x8')](_0x7b0b('0xc'),auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xd')]);router['get'](_0x7b0b('0xe'),auth['isAuthenticated'](),controller[_0x7b0b('0xf')]);router[_0x7b0b('0x8')](_0x7b0b('0x10'),auth['isAuthenticated'](),controller[_0x7b0b('0x11')]);router[_0x7b0b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7b0b('0x12')](_0x7b0b('0xe'),auth['isAuthenticated'](),controller[_0x7b0b('0x13')]);router[_0x7b0b('0x12')]('/:id/tags',auth[_0x7b0b('0x9')](),interaction[_0x7b0b('0x14')](_0x7b0b('0x15'),_0x7b0b('0x16')),controller[_0x7b0b('0x17')]);router[_0x7b0b('0x18')](_0x7b0b('0xc'),auth[_0x7b0b('0x9')](),interaction['tracked']('fax',_0x7b0b('0x19')),controller[_0x7b0b('0x1a')]);router[_0x7b0b('0x1b')](_0x7b0b('0xc'),auth['isAuthenticated'](),interaction[_0x7b0b('0x14')](_0x7b0b('0x15'),_0x7b0b('0x1c')),controller[_0x7b0b('0x1d')]);router[_0x7b0b('0x1b')](_0x7b0b('0x1e'),auth[_0x7b0b('0x9')](),controller[_0x7b0b('0x1f')]);module[_0x7b0b('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index b72b0aa..cc57ee5 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 _0x6fad=['DATE','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0xc3b452,_0x2a8419){var _0x2dcf32=function(_0x43f968){while(--_0x43f968){_0xc3b452['push'](_0xc3b452['shift']());}};_0x2dcf32(++_0x2a8419);}(_0x6fad,0x174));var _0xd6fa=function(_0x4e7490,_0x4b26ae){_0x4e7490=_0x4e7490-0x0;var _0x3622d0=_0x6fad[_0x4e7490];return _0x3622d0;};'use strict';var Sequelize=require(_0xd6fa('0x0'));module[_0xd6fa('0x1')]={'body':{'type':Sequelize[_0xd6fa('0x2')](_0xd6fa('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6fa('0x4')]('in','out'),'defaultValue':_0xd6fa('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd6fa('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6fa('0x6')]}}; \ No newline at end of file +var _0x9221=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x564324,_0x218522){var _0x102d59=function(_0x2b97ce){while(--_0x2b97ce){_0x564324['push'](_0x564324['shift']());}};_0x102d59(++_0x218522);}(_0x9221,0x64));var _0x1922=function(_0x35201e,_0x34341b){_0x35201e=_0x35201e-0x0;var _0x4bc5b7=_0x9221[_0x35201e];return _0x4bc5b7;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'body':{'type':Sequelize[_0x1922('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1922('0x3')]('in','out'),'defaultValue':_0x1922('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1922('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1922('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5c1640a..508bb02 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 _0x3436=['EventManager','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','internal','interface','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','files','attachments','Attachment','basename','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','fields','body','find','destroy','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','FaxInteractionId','isNil','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event'];(function(_0xf160f8,_0x121702){var _0x4ee221=function(_0x35cf32){while(--_0x35cf32){_0xf160f8['push'](_0xf160f8['shift']());}};_0x4ee221(++_0x121702);}(_0x3436,0x143));var _0x6343=function(_0x73a2a7,_0x549b2c){_0x73a2a7=_0x73a2a7-0x0;var _0x1d03da=_0x3436[_0x73a2a7];return _0x1d03da;};'use strict';var emlformat=require(_0x6343('0x0'));var rimraf=require(_0x6343('0x1'));var zipdir=require(_0x6343('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6343('0x3'));var BPromise=require(_0x6343('0x4'));var Mustache=require(_0x6343('0x5'));var util=require(_0x6343('0x6'));var path=require('path');var sox=require(_0x6343('0x7'));var csv=require(_0x6343('0x8'));var ejs=require(_0x6343('0x9'));var fs=require('fs');var fs_extra=require(_0x6343('0xa'));var _=require(_0x6343('0xb'));var squel=require(_0x6343('0xc'));var crypto=require(_0x6343('0xd'));var jsforce=require(_0x6343('0xe'));var deskjs=require(_0x6343('0xf'));var toCsv=require(_0x6343('0x8'));var querystring=require(_0x6343('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6343('0x11'));var qs=require(_0x6343('0x12'));var as=require(_0x6343('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6343('0x14'));var utils=require(_0x6343('0x15'));var config=require(_0x6343('0x16'));var licenseUtil=require(_0x6343('0x17'));var db=require(_0x6343('0x18'))['db'];config[_0x6343('0x19')]=_[_0x6343('0x1a')](config['redis'],{'host':_0x6343('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6343('0x19')]));require(_0x6343('0x1c'))[_0x6343('0x1d')](socket);var jayson=require(_0x6343('0x1e'));var client=jayson[_0x6343('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x6343('0x1f')][_0x6343('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x10ece4,_0x2732c6,_0x533dca,_0x35c4c2){return new BPromise(function(_0x1c8c9c,_0x21b113){var _0x43c455=_0x35c4c2||client;return _0x43c455[_0x6343('0x21')](_0x10ece4,_0x533dca)[_0x6343('0x22')](function(_0x5d1379){logger[_0x6343('0x23')]('FaxMessage,\x20%s,\x20%s',_0x2732c6,_0x6343('0x24'));logger[_0x6343('0x25')](_0x6343('0x26'),_0x2732c6,'request\x20sent',JSON[_0x6343('0x27')](_0x5d1379));if(_0x5d1379[_0x6343('0x28')]){if(_0x5d1379[_0x6343('0x28')]['code']===0x1f4){logger[_0x6343('0x28')](_0x6343('0x29'),_0x2732c6,_0x5d1379[_0x6343('0x28')][_0x6343('0x2a')]);return _0x21b113(_0x5d1379[_0x6343('0x28')][_0x6343('0x2a')]);}logger[_0x6343('0x28')]('FaxMessage,\x20%s,\x20%s',_0x2732c6,_0x5d1379[_0x6343('0x28')]['message']);return _0x1c8c9c(_0x5d1379['error'][_0x6343('0x2a')]);}else{logger[_0x6343('0x23')]('FaxMessage,\x20%s,\x20%s',_0x2732c6,_0x6343('0x24'));_0x1c8c9c(_0x5d1379[_0x6343('0x2b')][_0x6343('0x2a')]);}})[_0x6343('0x2c')](function(_0x21e8df){logger[_0x6343('0x28')]('FaxMessage,\x20%s,\x20%s',_0x2732c6,_0x21e8df);_0x21b113(_0x21e8df);});});}function respondWithStatusCode(_0x469094,_0x3abf83){_0x3abf83=_0x3abf83||0xcc;return function(_0x5d78c4){if(_0x5d78c4){return _0x469094[_0x6343('0x2d')](_0x3abf83);}return _0x469094[_0x6343('0x2e')](_0x3abf83)['end']();};}function respondWithResult(_0x5c17c0,_0x33e33f){_0x33e33f=_0x33e33f||0xc8;return function(_0x34ce1a){if(_0x34ce1a){return _0x5c17c0[_0x6343('0x2e')](_0x33e33f)['json'](_0x34ce1a);}};}function respondWithFilteredResult(_0x54086f,_0x357180){return function(_0x75fa29){if(_0x75fa29){var _0x21ba50=typeof _0x357180[_0x6343('0x2f')]===_0x6343('0x30')&&typeof _0x357180['limit']===_0x6343('0x30');var _0x3b20c2=_0x75fa29[_0x6343('0x31')];var _0x5ad4e0=_0x21ba50?0x0:_0x357180[_0x6343('0x2f')];var _0x3853e9=_0x21ba50?_0x75fa29[_0x6343('0x31')]:_0x357180['offset']+_0x357180[_0x6343('0x32')];var _0x55a621;if(_0x3853e9>=_0x3b20c2){_0x3853e9=_0x3b20c2;_0x55a621=0xc8;}else{_0x55a621=0xce;}_0x54086f[_0x6343('0x2e')](_0x55a621);return _0x54086f[_0x6343('0x33')](_0x6343('0x34'),_0x5ad4e0+'-'+_0x3853e9+'/'+_0x3b20c2)[_0x6343('0x35')](_0x75fa29);}return null;};}function patchUpdates(_0x3d053e){return function(_0x51fd04){try{jsonpatch[_0x6343('0x36')](_0x51fd04,_0x3d053e,!![]);}catch(_0x18babd){return BPromise['reject'](_0x18babd);}return _0x51fd04[_0x6343('0x37')]();};}function saveUpdates(_0x7bb0ed,_0x2e4b7b){return function(_0x4823d6){if(_0x4823d6){return _0x4823d6[_0x6343('0x38')](_0x7bb0ed)['then'](function(_0xf30553){return _0xf30553;});}return null;};}function removeEntity(_0x1ff01e,_0xe5aab8){return function(_0x1e4138){if(_0x1e4138){return _0x1e4138['destroy']()['then'](function(){_0x1ff01e[_0x6343('0x2e')](0xcc)[_0x6343('0x39')]();});}};}function handleEntityNotFound(_0x2efaaa,_0x5b1d05){return function(_0x3f94f2){if(!_0x3f94f2){_0x2efaaa['sendStatus'](0x194);}return _0x3f94f2;};}function handleError(_0x49f35f,_0x19b77b){_0x19b77b=_0x19b77b||0x1f4;return function(_0x2de9d5){logger['error'](_0x2de9d5[_0x6343('0x3a')]);if(_0x2de9d5[_0x6343('0x3b')]){delete _0x2de9d5[_0x6343('0x3b')];}_0x49f35f['status'](_0x19b77b)[_0x6343('0x3c')](_0x2de9d5);};}exports[_0x6343('0x3d')]=function(_0xe99995,_0x2ef6e0){var _0x11cd4c={},_0x1a1cd0={},_0x2dd43b={'count':0x0,'rows':[]};var _0x185ec8=_[_0x6343('0x3e')](db[_0x6343('0x3f')][_0x6343('0x40')],function(_0x51b9b0){return{'name':_0x51b9b0[_0x6343('0x41')],'type':_0x51b9b0[_0x6343('0x42')][_0x6343('0x43')]};});_0x1a1cd0['model']=_[_0x6343('0x3e')](_0x185ec8,_0x6343('0x3b'));_0x1a1cd0[_0x6343('0x44')]=_['keys'](_0xe99995['query']);_0x1a1cd0[_0x6343('0x45')]=_[_0x6343('0x46')](_0x1a1cd0[_0x6343('0x47')],_0x1a1cd0['query']);_0x11cd4c['attributes']=_[_0x6343('0x46')](_0x1a1cd0[_0x6343('0x47')],qs['fields'](_0xe99995[_0x6343('0x44')]['fields']));_0x11cd4c[_0x6343('0x48')]=_0x11cd4c[_0x6343('0x48')][_0x6343('0x49')]?_0x11cd4c[_0x6343('0x48')]:_0x1a1cd0['model'];if(!_0xe99995[_0x6343('0x44')][_0x6343('0x4a')](_0x6343('0x4b'))){_0x11cd4c[_0x6343('0x32')]=qs[_0x6343('0x32')](_0xe99995[_0x6343('0x44')]['limit']);_0x11cd4c[_0x6343('0x2f')]=qs[_0x6343('0x2f')](_0xe99995['query'][_0x6343('0x2f')]);}_0x11cd4c['order']=qs[_0x6343('0x4c')](_0xe99995[_0x6343('0x44')][_0x6343('0x4c')]);_0x11cd4c[_0x6343('0x4d')]=qs[_0x6343('0x45')](_[_0x6343('0x4e')](_0xe99995[_0x6343('0x44')],_0x1a1cd0[_0x6343('0x45')]),_0x185ec8);if(_0xe99995[_0x6343('0x44')][_0x6343('0x4f')]){_0x11cd4c[_0x6343('0x4d')]=_['merge'](_0x11cd4c[_0x6343('0x4d')],{'$or':_[_0x6343('0x3e')](_0x185ec8,function(_0x14b37c){if(_0x14b37c[_0x6343('0x42')]!=='VIRTUAL'){var _0x2af489={};_0x2af489[_0x14b37c[_0x6343('0x3b')]]={'$like':'%'+_0xe99995[_0x6343('0x44')]['filter']+'%'};return _0x2af489;}})});}_0x11cd4c=_[_0x6343('0x50')]({},_0x11cd4c,_0xe99995[_0x6343('0x51')]);var _0x2345cf={'where':_0x11cd4c['where']};return db[_0x6343('0x3f')][_0x6343('0x31')](_0x2345cf)[_0x6343('0x22')](function(_0x17b0f7){_0x2dd43b['count']=_0x17b0f7;if(_0xe99995[_0x6343('0x44')][_0x6343('0x52')]){_0x11cd4c[_0x6343('0x53')]=[{'all':!![]}];}return db[_0x6343('0x3f')][_0x6343('0x54')](_0x11cd4c);})[_0x6343('0x22')](function(_0x17c66c){_0x2dd43b[_0x6343('0x55')]=_0x17c66c;return _0x2dd43b;})[_0x6343('0x22')](respondWithFilteredResult(_0x2ef6e0,_0x11cd4c))[_0x6343('0x2c')](handleError(_0x2ef6e0,null));};exports[_0x6343('0x56')]=function(_0x4a6b9d,_0x285649){var _0x81f3c0={'raw':!![],'where':{'id':_0x4a6b9d['params']['id']}},_0x33121c={};_0x33121c[_0x6343('0x47')]=_['keys'](db['FaxMessage'][_0x6343('0x40')]);_0x33121c[_0x6343('0x44')]=_[_0x6343('0x57')](_0x4a6b9d['query']);_0x33121c['filters']=_[_0x6343('0x46')](_0x33121c[_0x6343('0x47')],_0x33121c[_0x6343('0x44')]);_0x81f3c0[_0x6343('0x48')]=_['intersection'](_0x33121c[_0x6343('0x47')],qs[_0x6343('0x58')](_0x4a6b9d['query']['fields']));_0x81f3c0[_0x6343('0x48')]=_0x81f3c0['attributes'][_0x6343('0x49')]?_0x81f3c0[_0x6343('0x48')]:_0x33121c['model'];if(_0x4a6b9d[_0x6343('0x44')]['includeAll']){_0x81f3c0[_0x6343('0x53')]=[{'all':!![]}];}_0x81f3c0=_[_0x6343('0x50')]({},_0x81f3c0,_0x4a6b9d[_0x6343('0x51')]);return db[_0x6343('0x3f')]['find'](_0x81f3c0)[_0x6343('0x22')](handleEntityNotFound(_0x285649,null))[_0x6343('0x22')](respondWithResult(_0x285649,null))[_0x6343('0x2c')](handleError(_0x285649,null));};exports[_0x6343('0x38')]=function(_0x98f6d,_0x12acf1){if(_0x98f6d[_0x6343('0x59')]['id']){delete _0x98f6d[_0x6343('0x59')]['id'];}return db[_0x6343('0x3f')][_0x6343('0x5a')]({'where':{'id':_0x98f6d['params']['id']}})[_0x6343('0x22')](handleEntityNotFound(_0x12acf1,null))['then'](saveUpdates(_0x98f6d[_0x6343('0x59')],null))[_0x6343('0x22')](respondWithResult(_0x12acf1,null))['catch'](handleError(_0x12acf1,null));};exports[_0x6343('0x5b')]=function(_0x5bb0ad,_0x4acfff){return db['FaxMessage'][_0x6343('0x5a')]({'where':{'id':_0x5bb0ad['params']['id']}})[_0x6343('0x22')](handleEntityNotFound(_0x4acfff,null))[_0x6343('0x22')](removeEntity(_0x4acfff,null))[_0x6343('0x2c')](handleError(_0x4acfff,null));};exports[_0x6343('0x5c')]=function(_0x361094,_0x106f4a){return db['FaxMessage']['describe']()[_0x6343('0x22')](respondWithResult(_0x106f4a,null))[_0x6343('0x2c')](handleError(_0x106f4a,null));};var interaction_log=require(_0x6343('0x5d'))(_0x6343('0x5e'));exports[_0x6343('0x5f')]=function(_0xc8596d,_0x325804,_0x5bf070){var _0xc55a38={'agent':{},'channel':_0x6343('0x60')};if(_0xc8596d[_0x6343('0x59')]['id']){delete _0xc8596d['body']['id'];}_0xc8596d['body'][_0x6343('0x61')]=!![];_0xc8596d['body'][_0x6343('0x62')]=moment()['format'](_0x6343('0x63'));_0xc8596d[_0x6343('0x59')][_0x6343('0x64')]=_0xc8596d[_0x6343('0x59')][_0x6343('0x64')]||_0xc8596d[_0x6343('0x65')]['id'];_0xc55a38[_0x6343('0x66')]['id']=_0xc8596d[_0x6343('0x59')]['UserId'];return db['FaxMessage'][_0x6343('0x5a')]({'where':{'id':_0xc8596d[_0x6343('0x67')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x325804,null))[_0x6343('0x22')](saveUpdates(_0xc8596d[_0x6343('0x59')],null))['then'](function(_0x46d32b){if(_0x46d32b){_0xc55a38['message']=_0x46d32b[_0x6343('0x68')]({'plain':!![]});return db['FaxInteraction'][_0x6343('0x5a')]({'where':{'id':_0x46d32b[_0x6343('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x325804,null))[_0x6343('0x22')](function(_0xf16ff2){if(_0xf16ff2){return _0xf16ff2[_0x6343('0x38')]({'UserId':_0xc8596d['body'][_0x6343('0x64')],'read1stAt':_[_0x6343('0x6a')](_0xf16ff2['read1stAt'])?moment()[_0x6343('0x6b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5ae82a){if(_0x5ae82a){_0xc55a38['interaction']=_0x5ae82a[_0x6343('0x68')]({'plain':!![]});interaction_log[_0x6343('0x23')](_0x6343('0x6c'),_0xc8596d[_0x6343('0x65')]['id'],_0xc8596d['user'][_0x6343('0x3b')],_0xc8596d['user']['role'],_0xc55a38[_0x6343('0x6d')]['id'],_0xc8596d[_0x6343('0x59')]?JSON[_0x6343('0x27')](_0xc8596d[_0x6343('0x59')]):_0x6343('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x6343('0x6f'),_0xc55a38);}return null;})[_0x6343('0x22')](function(_0xb77f9b){var _0x1e66b6=_0x6343('0x70')+_0xb77f9b[_0x6343('0x2a')][_0x6343('0x71')];return db[_0x6343('0x72')][_0x6343('0x44')](_0x1e66b6,{'type':db[_0x6343('0x73')][_0x6343('0x74')][_0x6343('0x75')],'raw':!![]})[_0x6343('0x22')](function(_0x3f5b5d){return _0x3f5b5d;});})[_0x6343('0x22')](function(_0x8cc2a9){if(_0x8cc2a9){_0xc55a38[_0x6343('0x2a')][_0x6343('0x76')]=_0x8cc2a9[0x0];if(!_0xc8596d[_0x6343('0x59')][_0x6343('0x64')])return;return db[_0x6343('0x77')][_0x6343('0x5a')]({'where':{'id':_0xc8596d[_0x6343('0x59')][_0x6343('0x64')],'role':_0x6343('0x66')},'attributes':['id',_0x6343('0x3b'),_0x6343('0x78'),_0x6343('0x79'),'internal'],'raw':!![]});}return null;})[_0x6343('0x22')](function(_0x2c076e){if(!_0x2c076e)return null;_0xc55a38[_0x6343('0x2a')][_0x6343('0x66')]=_0x2c076e;return _0xc55a38;})['then'](function(_0x361fe1){if(_0x361fe1){if(_0xc8596d[_0x6343('0x59')][_0x6343('0x7a')]){_0xc55a38[_0x6343('0x2a')]['interface']=util[_0x6343('0x6b')](_0x6343('0x7b'),_0xc8596d['user'][_0x6343('0x3b')]);_0xc55a38[_0x6343('0x2a')][_0x6343('0x7c')]=_0xc55a38[_0x6343('0x7c')];_0xc55a38['message'][_0x6343('0x7d')]=_0xc55a38[_0x6343('0x7c')];_0xc55a38[_0x6343('0x2a')][_0x6343('0x7e')]=_0x6343('0x5f');return respondWithRpcPromise(_0x6343('0x7f'),'EventManager',{'event':'acceptmessage','message':_0xc55a38[_0x6343('0x2a')]},client9002)[_0x6343('0x22')](function(){return _0xc55a38;});}return _0xc55a38;}return null;})[_0x6343('0x22')](respondWithResult(_0x325804,null))[_0x6343('0x2c')](handleError(_0x325804,null));};var interaction_log=require(_0x6343('0x5d'))(_0x6343('0x5e'));exports[_0x6343('0x80')]=function(_0x252c1d,_0x2d6df2,_0x1ce50c){var _0x59ded9={'agent':{},'channel':_0x6343('0x60')};if(_0x252c1d[_0x6343('0x59')]['id']){delete _0x252c1d[_0x6343('0x59')]['id'];}_0x252c1d['body'][_0x6343('0x64')]=_0x252c1d[_0x6343('0x59')][_0x6343('0x64')]||_0x252c1d[_0x6343('0x65')]['id'];_0x59ded9[_0x6343('0x66')]['id']=_0x252c1d[_0x6343('0x59')][_0x6343('0x64')];return db[_0x6343('0x3f')][_0x6343('0x5a')]({'where':{'id':_0x252c1d[_0x6343('0x67')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d6df2,null))[_0x6343('0x22')](function(_0x4fb8d7){if(_0x4fb8d7){_0x59ded9[_0x6343('0x2a')]=_0x4fb8d7['get']({'plain':!![]});return db['FaxInteraction'][_0x6343('0x5a')]({'where':{'id':_0x4fb8d7[_0x6343('0x69')]}});}return null;})[_0x6343('0x22')](handleEntityNotFound(_0x2d6df2,null))[_0x6343('0x22')](function(_0x340057){if(_0x340057){_0x59ded9[_0x6343('0x6d')]=_0x340057[_0x6343('0x68')]({'plain':!![]});interaction_log[_0x6343('0x23')](_0x6343('0x81'),_0x252c1d[_0x6343('0x65')]['id'],_0x252c1d[_0x6343('0x65')]['name'],_0x252c1d[_0x6343('0x65')][_0x6343('0x82')],_0x59ded9[_0x6343('0x6d')]['id'],_0x252c1d[_0x6343('0x59')]?JSON[_0x6343('0x27')](_0x252c1d[_0x6343('0x59')]):_0x6343('0x6e'));return respondWithRpcPromise(_0x6343('0x83'),_0x6343('0x84'),_0x59ded9);}return null;})[_0x6343('0x22')](function(_0x4e4ac0){var _0xcd2d76='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e4ac0['message'][_0x6343('0x71')];return db['sequelize'][_0x6343('0x44')](_0xcd2d76,{'type':db[_0x6343('0x73')]['QueryTypes'][_0x6343('0x75')],'raw':!![]})[_0x6343('0x22')](function(_0x7122d5){return _0x7122d5;});})[_0x6343('0x22')](function(_0x349065){if(_0x349065){_0x59ded9['message'][_0x6343('0x76')]=_0x349065[0x0];if(!_0x252c1d[_0x6343('0x59')]['UserId'])return;return db[_0x6343('0x77')][_0x6343('0x5a')]({'where':{'id':_0x252c1d['body'][_0x6343('0x64')],'role':_0x6343('0x66')},'attributes':['id','name',_0x6343('0x78'),_0x6343('0x79'),_0x6343('0x85')],'raw':!![]});}return null;})[_0x6343('0x22')](function(_0x1732b3){if(!_0x1732b3)return null;_0x59ded9[_0x6343('0x2a')][_0x6343('0x66')]=_0x1732b3;return _0x59ded9;})[_0x6343('0x22')](function(_0x62237e){if(_0x62237e){_0x62237e[_0x6343('0x2a')][_0x6343('0x86')]=util['format'](_0x6343('0x7b'),_0x252c1d['user'][_0x6343('0x3b')]);_0x62237e[_0x6343('0x2a')]['channel']=_0x59ded9['channel'];_0x62237e[_0x6343('0x2a')]['motionChannel']=_0x59ded9[_0x6343('0x7c')];_0x62237e[_0x6343('0x2a')][_0x6343('0x7e')]=_0x6343('0x80');respondWithRpcPromise(_0x6343('0x7f'),_0x6343('0x7f'),{'event':'rejectmessage','message':_0x62237e[_0x6343('0x2a')]},client9002);return _0x59ded9;}return null;})[_0x6343('0x22')](respondWithResult(_0x2d6df2,null))[_0x6343('0x2c')](handleError(_0x2d6df2,null));};exports[_0x6343('0x87')]=function(_0x1c7259,_0x2c595e){var _0x30446f;return db['FaxMessage']['create'](_0x1c7259[_0x6343('0x59')],{})[_0x6343('0x22')](function(_0x2b946a){_0x30446f=_0x2b946a;return db[_0x6343('0x88')][_0x6343('0x89')]({'where':{'id':_0x30446f[_0x6343('0x71')]}});})[_0x6343('0x22')](function(_0x59953f){if(_[_0x6343('0x6a')](_0x59953f)){return;}else{_0x30446f[_0x6343('0x60')]=_0x59953f[_0x6343('0x60')];return db['Attachment'][_0x6343('0x89')]({'where':{'id':_0x30446f['AttachmentId']}});}})[_0x6343('0x22')](function(_0xa55401){return respondWithRpcPromise(_0x6343('0x8a'),_0x6343('0x8a'),{'FaxAccountId':_['isNil'](_0x1c7259[_0x6343('0x59')])?undefined:_0x1c7259['body'][_0x6343('0x8b')],'path':_[_0x6343('0x6a')](_0xa55401)?undefined:util['format'](_0x6343('0x8c'),_0xa55401['basename']),'fax':_['isNil'](_0x30446f[_0x6343('0x60')])?undefined:_0x30446f[_0x6343('0x60')],'AttachmentId':_0x30446f[_0x6343('0x8d')]},client9002);})[_0x6343('0x22')](respondWithResult(_0x2c595e,0xc9))['catch'](handleError(_0x2c595e,null));};exports[_0x6343('0x8e')]=function(_0x5d7aa9,_0x49a040){var _0x9f0dea=path[_0x6343('0x8f')](config[_0x6343('0x90')],_0x6343('0x91'),_0x6343('0x92'),_0x6343('0x93'));return db[_0x6343('0x3f')][_0x6343('0x5a')]({'where':{'id':_0x5d7aa9[_0x6343('0x67')]['id']},'include':[{'model':db[_0x6343('0x94')],'as':_0x6343('0x94')}]})[_0x6343('0x22')](handleEntityNotFound(_0x49a040,null))[_0x6343('0x22')](function(_0x31b1d7){if(_0x31b1d7){return _0x49a040[_0x6343('0x8e')](path[_0x6343('0x8f')](_0x9f0dea,_0x31b1d7[_0x6343('0x94')][_0x6343('0x95')]));}})[_0x6343('0x2c')](handleError(_0x49a040,null));}; \ No newline at end of file +var _0x1c81=['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/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','length','include','find','body','fax-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','internal','interface','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','eml-format','fast-json-patch','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1c81,0x8b));var _0x11c8=function(_0xbc59be,_0xcee41a){_0xbc59be=_0xbc59be-0x0;var _0x5a64a8=_0x1c81[_0xbc59be];return _0x5a64a8;};'use strict';var emlformat=require(_0x11c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x11c8('0x1'));var rp=require(_0x11c8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x11c8('0x3'));var path=require(_0x11c8('0x4'));var sox=require('sox');var csv=require(_0x11c8('0x5'));var ejs=require(_0x11c8('0x6'));var fs=require('fs');var fs_extra=require(_0x11c8('0x7'));var _=require(_0x11c8('0x8'));var squel=require(_0x11c8('0x9'));var crypto=require(_0x11c8('0xa'));var jsforce=require(_0x11c8('0xb'));var deskjs=require(_0x11c8('0xc'));var toCsv=require(_0x11c8('0x5'));var querystring=require(_0x11c8('0xd'));var Papa=require(_0x11c8('0xe'));var Redis=require(_0x11c8('0xf'));var authService=require(_0x11c8('0x10'));var qs=require(_0x11c8('0x11'));var as=require(_0x11c8('0x12'));var hardwareService=require(_0x11c8('0x13'));var logger=require(_0x11c8('0x14'))(_0x11c8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x11c8('0x16'));var db=require(_0x11c8('0x17'))['db'];config[_0x11c8('0x18')]=_[_0x11c8('0x19')](config[_0x11c8('0x18')],{'host':_0x11c8('0x1a'),'port':0x18eb});var socket=require(_0x11c8('0x1b'))(new Redis(config[_0x11c8('0x18')]));require('./faxMessage.socket')[_0x11c8('0x1c')](socket);var jayson=require(_0x11c8('0x1d'));var client=jayson['client'][_0x11c8('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x11c8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x41e482,_0x20743c,_0x1b4be4,_0x54a414){return new BPromise(function(_0x5425df,_0x2a90ae){var _0x3e0459=_0x54a414||client;return _0x3e0459[_0x11c8('0x1f')](_0x41e482,_0x1b4be4)[_0x11c8('0x20')](function(_0x516467){logger[_0x11c8('0x21')](_0x11c8('0x22'),_0x20743c,'request\x20sent');logger[_0x11c8('0x23')](_0x11c8('0x24'),_0x20743c,_0x11c8('0x25'),JSON['stringify'](_0x516467));if(_0x516467[_0x11c8('0x26')]){if(_0x516467['error']['code']===0x1f4){logger[_0x11c8('0x26')](_0x11c8('0x22'),_0x20743c,_0x516467['error'][_0x11c8('0x27')]);return _0x2a90ae(_0x516467['error']['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x20743c,_0x516467['error'][_0x11c8('0x27')]);return _0x5425df(_0x516467[_0x11c8('0x26')][_0x11c8('0x27')]);}else{logger[_0x11c8('0x21')](_0x11c8('0x22'),_0x20743c,'request\x20sent');_0x5425df(_0x516467['result'][_0x11c8('0x27')]);}})[_0x11c8('0x28')](function(_0x14ba43){logger[_0x11c8('0x26')](_0x11c8('0x22'),_0x20743c,_0x14ba43);_0x2a90ae(_0x14ba43);});});}function respondWithStatusCode(_0xdfb8b3,_0x5ccbfb){_0x5ccbfb=_0x5ccbfb||0xcc;return function(_0x19d493){if(_0x19d493){return _0xdfb8b3[_0x11c8('0x29')](_0x5ccbfb);}return _0xdfb8b3[_0x11c8('0x2a')](_0x5ccbfb)[_0x11c8('0x2b')]();};}function respondWithResult(_0x5c61e5,_0x2a8108){_0x2a8108=_0x2a8108||0xc8;return function(_0x18b038){if(_0x18b038){return _0x5c61e5[_0x11c8('0x2a')](_0x2a8108)[_0x11c8('0x2c')](_0x18b038);}};}function respondWithFilteredResult(_0x554636,_0x487faa){return function(_0x5c1e39){if(_0x5c1e39){var _0xb8a9c5=typeof _0x487faa[_0x11c8('0x2d')]===_0x11c8('0x2e')&&typeof _0x487faa[_0x11c8('0x2f')]==='undefined';var _0x4d0f84=_0x5c1e39[_0x11c8('0x30')];var _0x552b90=_0xb8a9c5?0x0:_0x487faa[_0x11c8('0x2d')];var _0x568371=_0xb8a9c5?_0x5c1e39[_0x11c8('0x30')]:_0x487faa['offset']+_0x487faa['limit'];var _0x280fae;if(_0x568371>=_0x4d0f84){_0x568371=_0x4d0f84;_0x280fae=0xc8;}else{_0x280fae=0xce;}_0x554636[_0x11c8('0x2a')](_0x280fae);return _0x554636[_0x11c8('0x31')](_0x11c8('0x32'),_0x552b90+'-'+_0x568371+'/'+_0x4d0f84)[_0x11c8('0x2c')](_0x5c1e39);}return null;};}function patchUpdates(_0x7400fb){return function(_0x331489){try{jsonpatch[_0x11c8('0x33')](_0x331489,_0x7400fb,!![]);}catch(_0x3fec45){return BPromise[_0x11c8('0x34')](_0x3fec45);}return _0x331489[_0x11c8('0x35')]();};}function saveUpdates(_0x32c40c,_0xfa6e4f){return function(_0x2957db){if(_0x2957db){return _0x2957db[_0x11c8('0x36')](_0x32c40c)[_0x11c8('0x20')](function(_0x433cd7){return _0x433cd7;});}return null;};}function removeEntity(_0x33311e,_0x42eaa2){return function(_0x342909){if(_0x342909){return _0x342909[_0x11c8('0x37')]()['then'](function(){_0x33311e[_0x11c8('0x2a')](0xcc)[_0x11c8('0x2b')]();});}};}function handleEntityNotFound(_0x5ca398,_0x2ded09){return function(_0x125f30){if(!_0x125f30){_0x5ca398['sendStatus'](0x194);}return _0x125f30;};}function handleError(_0x1fb4b8,_0x3dd1c2){_0x3dd1c2=_0x3dd1c2||0x1f4;return function(_0x50943a){logger[_0x11c8('0x26')](_0x50943a[_0x11c8('0x38')]);if(_0x50943a[_0x11c8('0x39')]){delete _0x50943a[_0x11c8('0x39')];}_0x1fb4b8[_0x11c8('0x2a')](_0x3dd1c2)[_0x11c8('0x3a')](_0x50943a);};}exports[_0x11c8('0x3b')]=function(_0x23bfc5,_0x49958d){var _0x265f1d={},_0x180529={},_0x39f12b={'count':0x0,'rows':[]};var _0x456dba=_[_0x11c8('0x3c')](db[_0x11c8('0x3d')][_0x11c8('0x3e')],function(_0x19d976){return{'name':_0x19d976[_0x11c8('0x3f')],'type':_0x19d976[_0x11c8('0x40')][_0x11c8('0x41')]};});_0x180529[_0x11c8('0x42')]=_[_0x11c8('0x3c')](_0x456dba,_0x11c8('0x39'));_0x180529[_0x11c8('0x43')]=_[_0x11c8('0x44')](_0x23bfc5['query']);_0x180529[_0x11c8('0x45')]=_['intersection'](_0x180529[_0x11c8('0x42')],_0x180529['query']);_0x265f1d[_0x11c8('0x46')]=_['intersection'](_0x180529[_0x11c8('0x42')],qs[_0x11c8('0x47')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x47')]));_0x265f1d[_0x11c8('0x46')]=_0x265f1d[_0x11c8('0x46')]['length']?_0x265f1d[_0x11c8('0x46')]:_0x180529[_0x11c8('0x42')];if(!_0x23bfc5[_0x11c8('0x43')]['hasOwnProperty'](_0x11c8('0x48'))){_0x265f1d[_0x11c8('0x2f')]=qs[_0x11c8('0x2f')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x2f')]);_0x265f1d['offset']=qs[_0x11c8('0x2d')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x2d')]);}_0x265f1d['order']=qs['sort'](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x49')]);_0x265f1d[_0x11c8('0x4a')]=qs['filters'](_[_0x11c8('0x4b')](_0x23bfc5['query'],_0x180529[_0x11c8('0x45')]),_0x456dba);if(_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x4c')]){_0x265f1d[_0x11c8('0x4a')]=_[_0x11c8('0x4d')](_0x265f1d[_0x11c8('0x4a')],{'$or':_[_0x11c8('0x3c')](_0x456dba,function(_0x2a03a2){if(_0x2a03a2[_0x11c8('0x40')]!==_0x11c8('0x4e')){var _0x150daa={};_0x150daa[_0x2a03a2[_0x11c8('0x39')]]={'$like':'%'+_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x4c')]+'%'};return _0x150daa;}})});}_0x265f1d=_['merge']({},_0x265f1d,_0x23bfc5[_0x11c8('0x4f')]);var _0x1143e1={'where':_0x265f1d[_0x11c8('0x4a')]};return db['FaxMessage']['count'](_0x1143e1)['then'](function(_0x52c7f6){_0x39f12b[_0x11c8('0x30')]=_0x52c7f6;if(_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x50')]){_0x265f1d['include']=[{'all':!![]}];}return db[_0x11c8('0x3d')][_0x11c8('0x51')](_0x265f1d);})[_0x11c8('0x20')](function(_0x226c53){_0x39f12b[_0x11c8('0x52')]=_0x226c53;return _0x39f12b;})[_0x11c8('0x20')](respondWithFilteredResult(_0x49958d,_0x265f1d))['catch'](handleError(_0x49958d,null));};exports[_0x11c8('0x53')]=function(_0x4072fb,_0x184f00){var _0x3b10fb={'raw':!![],'where':{'id':_0x4072fb[_0x11c8('0x54')]['id']}},_0x6c34a4={};_0x6c34a4[_0x11c8('0x42')]=_[_0x11c8('0x44')](db[_0x11c8('0x3d')]['rawAttributes']);_0x6c34a4[_0x11c8('0x43')]=_[_0x11c8('0x44')](_0x4072fb['query']);_0x6c34a4[_0x11c8('0x45')]=_[_0x11c8('0x55')](_0x6c34a4[_0x11c8('0x42')],_0x6c34a4['query']);_0x3b10fb['attributes']=_[_0x11c8('0x55')](_0x6c34a4['model'],qs[_0x11c8('0x47')](_0x4072fb['query']['fields']));_0x3b10fb[_0x11c8('0x46')]=_0x3b10fb[_0x11c8('0x46')][_0x11c8('0x56')]?_0x3b10fb['attributes']:_0x6c34a4[_0x11c8('0x42')];if(_0x4072fb[_0x11c8('0x43')][_0x11c8('0x50')]){_0x3b10fb[_0x11c8('0x57')]=[{'all':!![]}];}_0x3b10fb=_['merge']({},_0x3b10fb,_0x4072fb[_0x11c8('0x4f')]);return db[_0x11c8('0x3d')][_0x11c8('0x58')](_0x3b10fb)[_0x11c8('0x20')](handleEntityNotFound(_0x184f00,null))['then'](respondWithResult(_0x184f00,null))['catch'](handleError(_0x184f00,null));};exports[_0x11c8('0x36')]=function(_0x2acd83,_0x293ee7){if(_0x2acd83[_0x11c8('0x59')]['id']){delete _0x2acd83['body']['id'];}return db[_0x11c8('0x3d')]['find']({'where':{'id':_0x2acd83[_0x11c8('0x54')]['id']}})[_0x11c8('0x20')](handleEntityNotFound(_0x293ee7,null))[_0x11c8('0x20')](saveUpdates(_0x2acd83['body'],null))[_0x11c8('0x20')](respondWithResult(_0x293ee7,null))['catch'](handleError(_0x293ee7,null));};exports['destroy']=function(_0x1971c1,_0x272d0b){return db[_0x11c8('0x3d')][_0x11c8('0x58')]({'where':{'id':_0x1971c1['params']['id']}})['then'](handleEntityNotFound(_0x272d0b,null))[_0x11c8('0x20')](removeEntity(_0x272d0b,null))[_0x11c8('0x28')](handleError(_0x272d0b,null));};exports['describe']=function(_0x295aac,_0x2f3101){return db[_0x11c8('0x3d')]['describe']()[_0x11c8('0x20')](respondWithResult(_0x2f3101,null))[_0x11c8('0x28')](handleError(_0x2f3101,null));};var interaction_log=require(_0x11c8('0x14'))(_0x11c8('0x5a'));exports['accept']=function(_0x37c343,_0x402132,_0x176cf3){var _0x4acc98={'agent':{},'channel':'fax'};if(_0x37c343[_0x11c8('0x59')]['id']){delete _0x37c343[_0x11c8('0x59')]['id'];}_0x37c343[_0x11c8('0x59')][_0x11c8('0x5b')]=!![];_0x37c343[_0x11c8('0x59')][_0x11c8('0x5c')]=moment()['format'](_0x11c8('0x5d'));_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')]=_0x37c343['body']['UserId']||_0x37c343[_0x11c8('0x5f')]['id'];_0x4acc98['agent']['id']=_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')];return db[_0x11c8('0x3d')][_0x11c8('0x58')]({'where':{'id':_0x37c343[_0x11c8('0x54')]['id'],'UserId':null}})[_0x11c8('0x20')](handleEntityNotFound(_0x402132,null))[_0x11c8('0x20')](saveUpdates(_0x37c343[_0x11c8('0x59')],null))['then'](function(_0x1be498){if(_0x1be498){_0x4acc98[_0x11c8('0x27')]=_0x1be498[_0x11c8('0x60')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1be498[_0x11c8('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x402132,null))[_0x11c8('0x20')](function(_0x5178b6){if(_0x5178b6){return _0x5178b6[_0x11c8('0x36')]({'UserId':_0x37c343['body'][_0x11c8('0x5e')],'read1stAt':_[_0x11c8('0x62')](_0x5178b6[_0x11c8('0x63')])?moment()[_0x11c8('0x64')](_0x11c8('0x5d')):undefined});}return null;})[_0x11c8('0x20')](function(_0x3dbb2c){if(_0x3dbb2c){_0x4acc98[_0x11c8('0x65')]=_0x3dbb2c[_0x11c8('0x60')]({'plain':!![]});interaction_log[_0x11c8('0x21')](_0x11c8('0x66'),_0x37c343[_0x11c8('0x5f')]['id'],_0x37c343['user']['name'],_0x37c343[_0x11c8('0x5f')]['role'],_0x4acc98[_0x11c8('0x65')]['id'],_0x37c343[_0x11c8('0x59')]?JSON[_0x11c8('0x67')](_0x37c343[_0x11c8('0x59')]):_0x11c8('0x68'));return respondWithRpcPromise(_0x11c8('0x69'),_0x11c8('0x6a'),_0x4acc98);}return null;})[_0x11c8('0x20')](function(_0x329308){var _0x4cc67f=_0x11c8('0x6b')+_0x329308[_0x11c8('0x27')][_0x11c8('0x6c')];return db[_0x11c8('0x6d')][_0x11c8('0x43')](_0x4cc67f,{'type':db[_0x11c8('0x6e')][_0x11c8('0x6f')][_0x11c8('0x70')],'raw':!![]})[_0x11c8('0x20')](function(_0x1dcd08){return _0x1dcd08;});})[_0x11c8('0x20')](function(_0x58e9fe){if(_0x58e9fe){_0x4acc98[_0x11c8('0x27')]['contact']=_0x58e9fe[0x0];if(!_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')])return;return db[_0x11c8('0x71')]['find']({'where':{'id':_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')],'role':_0x11c8('0x72')},'attributes':['id',_0x11c8('0x39'),_0x11c8('0x73'),_0x11c8('0x74'),'internal'],'raw':!![]});}return null;})[_0x11c8('0x20')](function(_0x409f7f){if(!_0x409f7f)return null;_0x4acc98[_0x11c8('0x27')][_0x11c8('0x72')]=_0x409f7f;return _0x4acc98;})[_0x11c8('0x20')](function(_0x136e01){if(_0x136e01){if(_0x37c343[_0x11c8('0x59')]['manual']){_0x4acc98[_0x11c8('0x27')]['interface']=util[_0x11c8('0x64')](_0x11c8('0x75'),_0x37c343[_0x11c8('0x5f')][_0x11c8('0x39')]);_0x4acc98[_0x11c8('0x27')][_0x11c8('0x76')]=_0x4acc98[_0x11c8('0x76')];_0x4acc98[_0x11c8('0x27')][_0x11c8('0x77')]=_0x4acc98[_0x11c8('0x76')];_0x4acc98[_0x11c8('0x27')][_0x11c8('0x78')]='accept';return respondWithRpcPromise(_0x11c8('0x79'),_0x11c8('0x79'),{'event':'acceptmessage','message':_0x4acc98[_0x11c8('0x27')]},client9002)[_0x11c8('0x20')](function(){return _0x4acc98;});}return _0x4acc98;}return null;})[_0x11c8('0x20')](respondWithResult(_0x402132,null))['catch'](handleError(_0x402132,null));};var interaction_log=require('../../config/logger')(_0x11c8('0x5a'));exports[_0x11c8('0x34')]=function(_0x1c509d,_0x72e2a1,_0x39e665){var _0x4a6bc5={'agent':{},'channel':_0x11c8('0x7a')};if(_0x1c509d[_0x11c8('0x59')]['id']){delete _0x1c509d[_0x11c8('0x59')]['id'];}_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')]=_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')]||_0x1c509d['user']['id'];_0x4a6bc5[_0x11c8('0x72')]['id']=_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')];return db[_0x11c8('0x3d')]['find']({'where':{'id':_0x1c509d['params']['id'],'UserId':null}})[_0x11c8('0x20')](handleEntityNotFound(_0x72e2a1,null))[_0x11c8('0x20')](function(_0x42ffad){if(_0x42ffad){_0x4a6bc5[_0x11c8('0x27')]=_0x42ffad[_0x11c8('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x11c8('0x58')]({'where':{'id':_0x42ffad[_0x11c8('0x61')]}});}return null;})[_0x11c8('0x20')](handleEntityNotFound(_0x72e2a1,null))['then'](function(_0x121459){if(_0x121459){_0x4a6bc5['interaction']=_0x121459[_0x11c8('0x60')]({'plain':!![]});interaction_log[_0x11c8('0x21')](_0x11c8('0x7b'),_0x1c509d[_0x11c8('0x5f')]['id'],_0x1c509d['user'][_0x11c8('0x39')],_0x1c509d[_0x11c8('0x5f')]['role'],_0x4a6bc5[_0x11c8('0x65')]['id'],_0x1c509d[_0x11c8('0x59')]?JSON['stringify'](_0x1c509d[_0x11c8('0x59')]):_0x11c8('0x68'));return respondWithRpcPromise('RejectMessage',_0x11c8('0x7c'),_0x4a6bc5);}return null;})[_0x11c8('0x20')](function(_0x5cd644){var _0x5b18d1=_0x11c8('0x6b')+_0x5cd644[_0x11c8('0x27')]['ContactId'];return db['sequelize'][_0x11c8('0x43')](_0x5b18d1,{'type':db['Sequelize']['QueryTypes'][_0x11c8('0x70')],'raw':!![]})[_0x11c8('0x20')](function(_0x26ff8c){return _0x26ff8c;});})['then'](function(_0xccc576){if(_0xccc576){_0x4a6bc5[_0x11c8('0x27')][_0x11c8('0x7d')]=_0xccc576[0x0];if(!_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')])return;return db['User'][_0x11c8('0x58')]({'where':{'id':_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')],'role':'agent'},'attributes':['id',_0x11c8('0x39'),_0x11c8('0x73'),_0x11c8('0x74'),_0x11c8('0x7e')],'raw':!![]});}return null;})[_0x11c8('0x20')](function(_0x3ecf83){if(!_0x3ecf83)return null;_0x4a6bc5[_0x11c8('0x27')]['agent']=_0x3ecf83;return _0x4a6bc5;})['then'](function(_0x220efe){if(_0x220efe){_0x220efe[_0x11c8('0x27')][_0x11c8('0x7f')]=util['format'](_0x11c8('0x75'),_0x1c509d[_0x11c8('0x5f')][_0x11c8('0x39')]);_0x220efe[_0x11c8('0x27')][_0x11c8('0x76')]=_0x4a6bc5[_0x11c8('0x76')];_0x220efe[_0x11c8('0x27')][_0x11c8('0x77')]=_0x4a6bc5[_0x11c8('0x76')];_0x220efe[_0x11c8('0x27')]['event']=_0x11c8('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x11c8('0x80'),'message':_0x220efe[_0x11c8('0x27')]},client9002);return _0x4a6bc5;}return null;})['then'](respondWithResult(_0x72e2a1,null))['catch'](handleError(_0x72e2a1,null));};exports[_0x11c8('0x81')]=function(_0x369a44,_0x5d7df9){var _0x138793;return db[_0x11c8('0x3d')][_0x11c8('0x81')](_0x369a44[_0x11c8('0x59')],{})[_0x11c8('0x20')](function(_0x3f895e){_0x138793=_0x3f895e;return db['CmContact'][_0x11c8('0x82')]({'where':{'id':_0x138793[_0x11c8('0x6c')]}});})[_0x11c8('0x20')](function(_0x4866d6){if(_[_0x11c8('0x62')](_0x4866d6)){return;}else{_0x138793[_0x11c8('0x7a')]=_0x4866d6[_0x11c8('0x7a')];return db[_0x11c8('0x83')][_0x11c8('0x82')]({'where':{'id':_0x138793[_0x11c8('0x84')]}});}})[_0x11c8('0x20')](function(_0x2449b6){return respondWithRpcPromise(_0x11c8('0x85'),_0x11c8('0x85'),{'FaxAccountId':_['isNil'](_0x369a44[_0x11c8('0x59')])?undefined:_0x369a44['body'][_0x11c8('0x86')],'path':_['isNil'](_0x2449b6)?undefined:util[_0x11c8('0x64')](_0x11c8('0x87'),_0x2449b6[_0x11c8('0x88')]),'fax':_[_0x11c8('0x62')](_0x138793[_0x11c8('0x7a')])?undefined:_0x138793['fax'],'AttachmentId':_0x138793['AttachmentId']},client9002);})[_0x11c8('0x20')](respondWithResult(_0x5d7df9,0xc9))['catch'](handleError(_0x5d7df9,null));};exports[_0x11c8('0x89')]=function(_0x5449d2,_0x9363b2){var _0x4c4b17=path[_0x11c8('0x8a')](config[_0x11c8('0x8b')],'server',_0x11c8('0x8c'),_0x11c8('0x8d'));return db['FaxMessage'][_0x11c8('0x58')]({'where':{'id':_0x5449d2[_0x11c8('0x54')]['id']},'include':[{'model':db[_0x11c8('0x83')],'as':_0x11c8('0x83')}]})[_0x11c8('0x20')](handleEntityNotFound(_0x9363b2,null))['then'](function(_0x280d54){if(_0x280d54){return _0x9363b2[_0x11c8('0x89')](path[_0x11c8('0x8a')](_0x4c4b17,_0x280d54['Attachment']['basename']));}})[_0x11c8('0x28')](handleError(_0x9363b2,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 64fc226..470ca9b 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 _0x29eb=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove','emit'];(function(_0x48889c,_0x3d3bcb){var _0x1ac24e=function(_0xeba3cb){while(--_0xeba3cb){_0x48889c['push'](_0x48889c['shift']());}};_0x1ac24e(++_0x3d3bcb);}(_0x29eb,0x1c5));var _0xb29e=function(_0x3a8f96,_0x390632){_0x3a8f96=_0x3a8f96-0x0;var _0x427b77=_0x29eb[_0x3a8f96];return _0x427b77;};'use strict';var EventEmitter=require(_0xb29e('0x0'));var FaxMessage=require(_0xb29e('0x1'))['db'][_0xb29e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb29e('0x3'),'afterUpdate':_0xb29e('0x4'),'afterDestroy':_0xb29e('0x5')};function emitEvent(_0x4a9b91){return function(_0x29356f,_0x4c648e,_0x14c35b){FaxMessageEvents[_0xb29e('0x6')](_0x4a9b91+':'+_0x29356f['id'],_0x29356f);FaxMessageEvents[_0xb29e('0x6')](_0x4a9b91,_0x29356f);_0x14c35b(null);};}for(var e in events){if(events[_0xb29e('0x7')](e)){var event=events[e];FaxMessage[_0xb29e('0x8')](e,emitEvent(event));}}module[_0xb29e('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xc1db=['hasOwnProperty','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc1db,0x120));var _0xbc1d=function(_0x1919c4,_0x593467){_0x1919c4=_0x1919c4-0x0;var _0xab99f8=_0xc1db[_0x1919c4];return _0xab99f8;};'use strict';var EventEmitter=require(_0xbc1d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xbc1d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbc1d('0x2')](0x0);var events={'afterCreate':_0xbc1d('0x3'),'afterUpdate':_0xbc1d('0x4'),'afterDestroy':_0xbc1d('0x5')};function emitEvent(_0x4b69f6){return function(_0x3d0b27,_0x329960,_0x23a61e){FaxMessageEvents['emit'](_0x4b69f6+':'+_0x3d0b27['id'],_0x3d0b27);FaxMessageEvents['emit'](_0x4b69f6,_0x3d0b27);_0x23a61e(null);};}for(var e in events){if(events[_0xbc1d('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 850e5ba..168667d 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 _0x1a98=['define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','findOne','FaxInteractionId','then','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0xa6dd01,_0x1903f3){var _0x46f5b2=function(_0x52a73d){while(--_0x52a73d){_0xa6dd01['push'](_0xa6dd01['shift']());}};_0x46f5b2(++_0x1903f3);}(_0x1a98,0x67));var _0x81a9=function(_0x1c5239,_0x32a9e5){_0x1c5239=_0x1c5239-0x0;var _0x4da252=_0x1a98[_0x1c5239];return _0x4da252;};'use strict';var _=require(_0x81a9('0x0'));var util=require(_0x81a9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x81a9('0x2'));var BPromise=require(_0x81a9('0x3'));var rp=require(_0x81a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81a9('0x5'));var config=require(_0x81a9('0x6'));var attributes=require(_0x81a9('0x7'));module[_0x81a9('0x8')]=function(_0x2089c4,_0x32187f){return _0x2089c4[_0x81a9('0x9')](_0x81a9('0xa'),attributes,{'tableName':_0x81a9('0xb'),'paranoid':![],'indexes':[{'name':_0x81a9('0xc'),'fields':[_0x81a9('0xd')],'type':_0x81a9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x536524,_0x2dbd4e,_0x515086){var _0x1990e0=_0x2089c4[_0x81a9('0xf')];var _0x54cf5f=_0x536524[_0x81a9('0x10')]({'plain':!![]});if(_0x54cf5f['direction'][_0x81a9('0x11')]()==='in'||_0x54cf5f[_0x81a9('0x12')]['toLowerCase']()==='out'&&!_0x54cf5f[_0x81a9('0x13')]&&!_[_0x81a9('0x14')](_0x54cf5f[_0x81a9('0x15')])){_0x1990e0['FaxInteraction'][_0x81a9('0x16')]({'where':{'id':_0x54cf5f[_0x81a9('0x17')]}})[_0x81a9('0x18')](function(_0x4df094){if(_0x4df094){_0x4df094['update']({'lastMsgAt':_0x54cf5f['createdAt'],'lastMsgDirection':_0x54cf5f['direction'][_0x81a9('0x11')]()});}})['catch'](function(_0x51567e){console[_0x81a9('0x19')](_0x51567e);});}_0x515086();}},'charset':_0x81a9('0x1a'),'collate':_0x81a9('0x1b')});}; \ No newline at end of file +var _0x86f6=['rimraf','../../config/environment','./faxMessage.attributes','exports','fti_fax_messages','body','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x571453,_0x3f6bd6){var _0x5a2404=function(_0x3d1f83){while(--_0x3d1f83){_0x571453['push'](_0x571453['shift']());}};_0x5a2404(++_0x3f6bd6);}(_0x86f6,0x19a));var _0x686f=function(_0x243a60,_0x376dcf){_0x243a60=_0x243a60-0x0;var _0xb3a4de=_0x86f6[_0x243a60];return _0xb3a4de;};'use strict';var _=require(_0x686f('0x0'));var util=require(_0x686f('0x1'));var logger=require('../../config/logger')(_0x686f('0x2'));var moment=require(_0x686f('0x3'));var BPromise=require(_0x686f('0x4'));var rp=require(_0x686f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x686f('0x6'));var config=require(_0x686f('0x7'));var attributes=require(_0x686f('0x8'));module[_0x686f('0x9')]=function(_0x5b3f91,_0x22f118){return _0x5b3f91['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x686f('0xa'),'fields':[_0x686f('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59dcd9,_0x167ada,_0x21d247){var _0x510933=_0x5b3f91['models'];var _0x5d9d31=_0x59dcd9[_0x686f('0xc')]({'plain':!![]});if(_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()==='in'||_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()===_0x686f('0xf')&&!_0x5d9d31[_0x686f('0x10')]&&!_[_0x686f('0x11')](_0x5d9d31['UserId'])){_0x510933[_0x686f('0x12')][_0x686f('0x13')]({'where':{'id':_0x5d9d31[_0x686f('0x14')]}})[_0x686f('0x15')](function(_0x1f60fd){if(_0x1f60fd){_0x1f60fd['update']({'lastMsgAt':_0x5d9d31[_0x686f('0x16')],'lastMsgDirection':_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()});}})[_0x686f('0x17')](function(_0x5a5925){console['error'](_0x5a5925);});}_0x21d247();}},'charset':_0x686f('0x18'),'collate':_0x686f('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 0498ee1..bf9be9b 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 _0x008c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','options','raw','then','CreateFaxMessage','attributes','limit','UpdateFaxMessage','stringify','lodash','util','moment','bluebird'];(function(_0xdff215,_0x51203d){var _0x51b48e=function(_0x42df88){while(--_0x42df88){_0xdff215['push'](_0xdff215['shift']());}};_0x51b48e(++_0x51203d);}(_0x008c,0x188));var _0xc008=function(_0x406ddc,_0x233a84){_0x406ddc=_0x406ddc-0x0;var _0x4a2bf2=_0x008c[_0x406ddc];return _0x4a2bf2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});}exports['CreateFaxMessage']=function(_0x543e5d){var _0x50261c=this;return new Promise(function(_0x5754a0,_0x4b9726){return db['FaxMessage']['create'](_0x543e5d['body'],{'raw':_0x543e5d['options']?_0x543e5d[_0xc008('0x19')][_0xc008('0x1a')]===undefined?!![]:![]:!![]})[_0xc008('0x1b')](function(_0x415af3){logger[_0xc008('0x11')](_0xc008('0x1c'),_0x543e5d);logger['debug'](_0xc008('0x1c'),_0x543e5d,JSON['stringify'](_0x415af3));_0x5754a0(_0x415af3);})['catch'](function(_0x218599){logger[_0xc008('0x16')](_0xc008('0x1c'),_0x218599[_0xc008('0x17')],_0x543e5d);_0x4b9726(_0x50261c['error'](0x1f4,_0x218599['message']));});});};exports['UpdateFaxMessage']=function(_0x3f7b07){var _0x15dade=this;return new Promise(function(_0x92c582,_0x2e31c2){return db['FaxMessage']['update'](_0x3f7b07['body'],{'raw':_0x3f7b07['options']?_0x3f7b07['options'][_0xc008('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')]['where']||null:null,'attributes':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')][_0xc008('0x1d')]||null:null,'limit':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07['options'][_0xc008('0x1e')]||null:null})[_0xc008('0x1b')](function(_0x53ed35){logger['info']('UpdateFaxMessage',_0x3f7b07);logger[_0xc008('0x14')](_0xc008('0x1f'),_0x3f7b07,JSON[_0xc008('0x20')](_0x53ed35));_0x92c582(_0x53ed35);})[_0xc008('0x18')](function(_0x1de04b){logger[_0xc008('0x16')](_0xc008('0x1f'),_0x1de04b[_0xc008('0x17')],_0x3f7b07);_0x2e31c2(_0x15dade[_0xc008('0x16')](0x1f4,_0x1de04b[_0xc008('0x17')]));});});}; \ No newline at end of file +var _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdace,0xc5));var _0xedac=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0xdace[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8f47740..d5c88c8 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 _0xf5ef=['update','removeListener','register','length','save'];(function(_0x635a54,_0x22c797){var _0x5bc413=function(_0x5d57a7){while(--_0x5d57a7){_0x635a54['push'](_0x635a54['shift']());}};_0x5bc413(++_0x22c797);}(_0xf5ef,0xc7));var _0xff5e=function(_0x45d8f3,_0x45b357){_0x45d8f3=_0x45d8f3-0x0;var _0xbf4658=_0xf5ef[_0x45d8f3];return _0xbf4658;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xff5e('0x0'),'remove',_0xff5e('0x1')];function createListener(_0x141773,_0x383f10){return function(_0x49a284){_0x383f10['emit'](_0x141773,_0x49a284);};}function removeListener(_0x3f700f,_0x471bdf){return function(){FaxMessageEvents[_0xff5e('0x2')](_0x3f700f,_0x471bdf);};}exports[_0xff5e('0x3')]=function(_0x375464){for(var _0x5ae626=0x0,_0x1ebb3e=events[_0xff5e('0x4')];_0x5ae626<_0x1ebb3e;_0x5ae626++){var _0xd3b0d1=events[_0x5ae626];var _0x31816e=createListener('faxMessage:'+_0xd3b0d1,_0x375464);FaxMessageEvents['on'](_0xd3b0d1,_0x31816e);}}; \ No newline at end of file +var _0xc0d6=['faxMessage:','remove','update','emit','removeListener','register','length'];(function(_0x545f19,_0x291a17){var _0x1b0731=function(_0x5710e4){while(--_0x5710e4){_0x545f19['push'](_0x545f19['shift']());}};_0x1b0731(++_0x291a17);}(_0xc0d6,0x197));var _0x6c0d=function(_0x167c01,_0x8fd3e9){_0x167c01=_0x167c01-0x0;var _0x5eeaa9=_0xc0d6[_0x167c01];return _0x5eeaa9;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x6c0d('0x0'),_0x6c0d('0x1')];function createListener(_0x56d7fd,_0x5b7924){return function(_0x215892){_0x5b7924[_0x6c0d('0x2')](_0x56d7fd,_0x215892);};}function removeListener(_0x599454,_0x43b87e){return function(){FaxMessageEvents[_0x6c0d('0x3')](_0x599454,_0x43b87e);};}exports[_0x6c0d('0x4')]=function(_0x5b99c5){for(var _0x396f47=0x0,_0x274ed2=events[_0x6c0d('0x5')];_0x396f47<_0x274ed2;_0x396f47++){var _0x416d44=events[_0x396f47];var _0x169e8c=createListener(_0x6c0d('0x6')+_0x416d44,_0x5b99c5);FaxMessageEvents['on'](_0x416d44,_0x169e8c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 66575df..d2e1efe 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 _0xc6d8=['describe','/:id','show','/:id/download','download','post','tracked','faxmessage:create','update','put','/:id/accept','accept','/:id/reject','delete','exports','multer','path','express','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x39be3b,_0x4c094e){var _0x393f48=function(_0x520452){while(--_0x520452){_0x39be3b['push'](_0x39be3b['shift']());}};_0x393f48(++_0x4c094e);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x401d4e,_0x2f6357){_0x401d4e=_0x401d4e-0x0;var _0x382ee1=_0xc6d8[_0x401d4e];return _0x382ee1;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var fs_extra=require(_0x8c6d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x4'));var controller=require(_0x8c6d('0x5'));router[_0x8c6d('0x6')]('/',auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x8')]);router[_0x8c6d('0x6')](_0x8c6d('0x9'),auth['isAuthenticated'](),controller[_0x8c6d('0xa')]);router[_0x8c6d('0x6')](_0x8c6d('0xb'),auth['isAuthenticated'](),controller[_0x8c6d('0xc')]);router[_0x8c6d('0x6')](_0x8c6d('0xd'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xe')]);router[_0x8c6d('0xf')]('/',auth[_0x8c6d('0x7')](),interaction[_0x8c6d('0x10')]('fax',_0x8c6d('0x11')),controller['create']);router['put'](_0x8c6d('0xb'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x12')]);router[_0x8c6d('0x13')](_0x8c6d('0x14'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x15')]);router[_0x8c6d('0x13')](_0x8c6d('0x16'),auth[_0x8c6d('0x7')](),controller['reject']);router[_0x8c6d('0x17')]('/:id',auth[_0x8c6d('0x7')](),controller['destroy']);module[_0x8c6d('0x18')]=router; \ No newline at end of file +var _0x39cb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['describe']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),interaction[_0xb39c('0xf')](_0xb39c('0x10'),_0xb39c('0x11')),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x14')]);router[_0xb39c('0x13')](_0xb39c('0x15'),auth['isAuthenticated'](),controller[_0xb39c('0x16')]);router[_0xb39c('0x13')](_0xb39c('0x17'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x18')]);router[_0xb39c('0x19')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x1a')]);module[_0xb39c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index e4d2fb4..75f023e 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 _0xaf37=['STRING','name','INTEGER','rrmemory','roundrobin','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xaf37,0xa1));var _0x7af3=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xaf37[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require('sequelize');module[_0x7af3('0x0')]={'name':{'type':Sequelize[_0x7af3('0x1')],'unique':_0x7af3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7af3('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7af3('0x4'),'beepall',_0x7af3('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7af3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2f61=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x1469b5,_0x454875){var _0x543a97=function(_0x2ffd1c){while(--_0x2ffd1c){_0x1469b5['push'](_0x1469b5['shift']());}};_0x543a97(++_0x454875);}(_0x2f61,0x15c));var _0x12f6=function(_0x3778f4,_0x286d4c){_0x3778f4=_0x3778f4-0x0;var _0x332da1=_0x2f61[_0x3778f4];return _0x332da1;};'use strict';var Sequelize=require(_0x12f6('0x0'));module[_0x12f6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x12f6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x12f6('0x3')]},'timeout':{'type':Sequelize[_0x12f6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x12f6('0x5')](_0x12f6('0x6'),_0x12f6('0x7'),_0x12f6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x12f6('0x4')],'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 6267375..e3d34bf 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 _0x008e=['value','transaction','isEmpty','removeAgents','forEach','addAgents','omit','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','options','FaxQueue','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','merge','User','UserId','updatedAt','createdAt','format','SIP','faxPause','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','each','emit','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','union'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x008e,0x120));var _0xe008=function(_0x498009,_0x4d4dd8){_0x498009=_0x498009-0x0;var _0x38892d=_0x008e[_0x498009];return _0x38892d;};'use strict';var emlformat=require(_0xe008('0x0'));var rimraf=require(_0xe008('0x1'));var zipdir=require(_0xe008('0x2'));var jsonpatch=require(_0xe008('0x3'));var rp=require(_0xe008('0x4'));var moment=require('moment');var BPromise=require(_0xe008('0x5'));var Mustache=require(_0xe008('0x6'));var util=require(_0xe008('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe008('0x8'));var fs=require('fs');var fs_extra=require(_0xe008('0x9'));var _=require('lodash');var squel=require(_0xe008('0xa'));var crypto=require(_0xe008('0xb'));var jsforce=require(_0xe008('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe008('0xd'));var querystring=require('querystring');var Papa=require(_0xe008('0xe'));var Redis=require(_0xe008('0xf'));var authService=require(_0xe008('0x10'));var qs=require(_0xe008('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe008('0x12'));var logger=require(_0xe008('0x13'))(_0xe008('0x14'));var utils=require('../../config/utils');var config=require(_0xe008('0x15'));var licenseUtil=require(_0xe008('0x16'));var db=require(_0xe008('0x17'))['db'];config[_0xe008('0x18')]=_[_0xe008('0x19')](config[_0xe008('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe008('0x1a'))(new Redis(config[_0xe008('0x18')]));require(_0xe008('0x1b'))[_0xe008('0x1c')](socket);function respondWithStatusCode(_0x1868f1,_0x17250e){_0x17250e=_0x17250e||0xcc;return function(_0x1db847){if(_0x1db847){return _0x1868f1['sendStatus'](_0x17250e);}return _0x1868f1[_0xe008('0x1d')](_0x17250e)[_0xe008('0x1e')]();};}function respondWithResult(_0x46d0c5,_0x2ae3e2){_0x2ae3e2=_0x2ae3e2||0xc8;return function(_0x29e134){if(_0x29e134){return _0x46d0c5['status'](_0x2ae3e2)[_0xe008('0x1f')](_0x29e134);}};}function respondWithFilteredResult(_0x14f102,_0x26e4e6){return function(_0x41cffa){if(_0x41cffa){var _0x60de6=typeof _0x26e4e6[_0xe008('0x20')]===_0xe008('0x21')&&typeof _0x26e4e6[_0xe008('0x22')]===_0xe008('0x21');var _0x3bd4a2=_0x41cffa[_0xe008('0x23')];var _0x28d8e1=_0x60de6?0x0:_0x26e4e6[_0xe008('0x20')];var _0x6447f8=_0x60de6?_0x41cffa[_0xe008('0x23')]:_0x26e4e6[_0xe008('0x20')]+_0x26e4e6[_0xe008('0x22')];var _0x3f76a9;if(_0x6447f8>=_0x3bd4a2){_0x6447f8=_0x3bd4a2;_0x3f76a9=0xc8;}else{_0x3f76a9=0xce;}_0x14f102['status'](_0x3f76a9);return _0x14f102[_0xe008('0x24')]('Content-Range',_0x28d8e1+'-'+_0x6447f8+'/'+_0x3bd4a2)[_0xe008('0x1f')](_0x41cffa);}return null;};}function patchUpdates(_0xd33816){return function(_0x54750a){try{jsonpatch[_0xe008('0x25')](_0x54750a,_0xd33816,!![]);}catch(_0x286a5e){return BPromise[_0xe008('0x26')](_0x286a5e);}return _0x54750a[_0xe008('0x27')]();};}function saveUpdates(_0x4c5c75,_0x2d3ca4){return function(_0x23f58b){if(_0x23f58b){return _0x23f58b['update'](_0x4c5c75)[_0xe008('0x28')](function(_0x531b90){return _0x531b90;});}return null;};}function removeEntity(_0x3874d1,_0x5cdaa4){return function(_0x4dac7f){if(_0x4dac7f){return _0x4dac7f[_0xe008('0x29')]()['then'](function(){var _0x96e620=_0x4dac7f['get']({'plain':!![]});var _0xfc1acb=_0xe008('0x2a');return db[_0xe008('0x2b')][_0xe008('0x29')]({'where':{'type':_0xfc1acb,'resourceId':_0x96e620['id']}})['then'](function(){return _0x4dac7f;});})[_0xe008('0x28')](function(){_0x3874d1[_0xe008('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43770e,_0x440de0){return function(_0x5b0418){if(!_0x5b0418){_0x43770e[_0xe008('0x2c')](0x194);}return _0x5b0418;};}function handleError(_0x5775d9,_0x5287a0){_0x5287a0=_0x5287a0||0x1f4;return function(_0x2bd4e7){logger[_0xe008('0x2d')](_0x2bd4e7[_0xe008('0x2e')]);if(_0x2bd4e7[_0xe008('0x2f')]){delete _0x2bd4e7[_0xe008('0x2f')];}_0x5775d9['status'](_0x5287a0)[_0xe008('0x30')](_0x2bd4e7);};}exports['index']=function(_0x58ed04,_0x443341){var _0x24b294={},_0x4b837c={},_0x52fdca={'count':0x0,'rows':[]};var _0x106793=_[_0xe008('0x31')](db['FaxQueue'][_0xe008('0x32')],function(_0x577262){return{'name':_0x577262[_0xe008('0x33')],'type':_0x577262[_0xe008('0x34')][_0xe008('0x35')]};});_0x4b837c[_0xe008('0x36')]=_[_0xe008('0x31')](_0x106793,_0xe008('0x2f'));_0x4b837c['query']=_[_0xe008('0x37')](_0x58ed04[_0xe008('0x38')]);_0x4b837c['filters']=_[_0xe008('0x39')](_0x4b837c[_0xe008('0x36')],_0x4b837c[_0xe008('0x38')]);_0x24b294[_0xe008('0x3a')]=_[_0xe008('0x39')](_0x4b837c[_0xe008('0x36')],qs[_0xe008('0x3b')](_0x58ed04[_0xe008('0x38')][_0xe008('0x3b')]));_0x24b294[_0xe008('0x3a')]=_0x24b294[_0xe008('0x3a')][_0xe008('0x3c')]?_0x24b294[_0xe008('0x3a')]:_0x4b837c[_0xe008('0x36')];if(!_0x58ed04[_0xe008('0x38')][_0xe008('0x3d')](_0xe008('0x3e'))){_0x24b294[_0xe008('0x22')]=qs[_0xe008('0x22')](_0x58ed04['query']['limit']);_0x24b294[_0xe008('0x20')]=qs[_0xe008('0x20')](_0x58ed04[_0xe008('0x38')][_0xe008('0x20')]);}_0x24b294[_0xe008('0x3f')]=qs[_0xe008('0x40')](_0x58ed04[_0xe008('0x38')]['sort']);_0x24b294[_0xe008('0x41')]=qs[_0xe008('0x42')](_['pick'](_0x58ed04['query'],_0x4b837c[_0xe008('0x42')]),_0x106793);if(_0x58ed04[_0xe008('0x38')]['filter']){_0x24b294['where']=_['merge'](_0x24b294['where'],{'$or':_[_0xe008('0x31')](_0x106793,function(_0x395d55){if(_0x395d55[_0xe008('0x34')]!==_0xe008('0x43')){var _0x2b3db4={};_0x2b3db4[_0x395d55[_0xe008('0x2f')]]={'$like':'%'+_0x58ed04[_0xe008('0x38')][_0xe008('0x44')]+'%'};return _0x2b3db4;}})});}_0x24b294=_['merge']({},_0x24b294,_0x58ed04[_0xe008('0x45')]);var _0x52f67e={'where':_0x24b294[_0xe008('0x41')]};return db[_0xe008('0x46')][_0xe008('0x23')](_0x52f67e)['then'](function(_0x1512e9){_0x52fdca[_0xe008('0x23')]=_0x1512e9;if(_0x58ed04['query'][_0xe008('0x47')]){_0x24b294[_0xe008('0x48')]=[{'all':!![]}];}return db['FaxQueue'][_0xe008('0x49')](_0x24b294);})[_0xe008('0x28')](function(_0xae1602){_0x52fdca[_0xe008('0x4a')]=_0xae1602;return _0x52fdca;})[_0xe008('0x28')](respondWithFilteredResult(_0x443341,_0x24b294))['catch'](handleError(_0x443341,null));};exports[_0xe008('0x4b')]=function(_0x3bcfe2,_0x155f8f){var _0x310361={'raw':!![],'where':{'id':_0x3bcfe2[_0xe008('0x4c')]['id']}},_0x1884c0={};_0x1884c0['model']=_[_0xe008('0x37')](db[_0xe008('0x46')][_0xe008('0x32')]);_0x1884c0['query']=_['keys'](_0x3bcfe2[_0xe008('0x38')]);_0x1884c0[_0xe008('0x42')]=_[_0xe008('0x39')](_0x1884c0[_0xe008('0x36')],_0x1884c0[_0xe008('0x38')]);_0x310361['attributes']=_[_0xe008('0x39')](_0x1884c0['model'],qs[_0xe008('0x3b')](_0x3bcfe2[_0xe008('0x38')][_0xe008('0x3b')]));_0x310361[_0xe008('0x3a')]=_0x310361['attributes'][_0xe008('0x3c')]?_0x310361[_0xe008('0x3a')]:_0x1884c0['model'];if(_0x3bcfe2[_0xe008('0x38')]['includeAll']){_0x310361['include']=[{'all':!![]}];}_0x310361=_['merge']({},_0x310361,_0x3bcfe2[_0xe008('0x45')]);return db['FaxQueue'][_0xe008('0x4d')](_0x310361)[_0xe008('0x28')](handleEntityNotFound(_0x155f8f,null))[_0xe008('0x28')](respondWithResult(_0x155f8f,null))[_0xe008('0x4e')](handleError(_0x155f8f,null));};exports[_0xe008('0x4f')]=function(_0x2f2158,_0x2de0dc){return db['FaxQueue'][_0xe008('0x4f')](_0x2f2158[_0xe008('0x50')],{})[_0xe008('0x28')](function(_0x2bc976){var _0x5de06b=_0x2f2158[_0xe008('0x51')][_0xe008('0x52')]({'plain':!![]});if(!_0x5de06b)throw new Error(_0xe008('0x53'));if(_0x5de06b['role']===_0xe008('0x51')){var _0x979a79=_0x2bc976[_0xe008('0x52')]({'plain':!![]});var _0x46e621=_0xe008('0x2a');return db['UserProfileSection'][_0xe008('0x4d')]({'where':{'name':_0x46e621,'userProfileId':_0x5de06b[_0xe008('0x54')]},'raw':!![]})[_0xe008('0x28')](function(_0x1ebe1c){if(_0x1ebe1c&&_0x1ebe1c[_0xe008('0x55')]===0x0){return db[_0xe008('0x2b')][_0xe008('0x4f')]({'name':_0x979a79['name'],'resourceId':_0x979a79['id'],'type':_0x1ebe1c[_0xe008('0x2f')],'sectionId':_0x1ebe1c['id']},{})['then'](function(){return _0x2bc976;});}else{return _0x2bc976;}})[_0xe008('0x4e')](function(_0x186406){logger[_0xe008('0x2d')](_0xe008('0x56'),_0x186406);throw _0x186406;});}return _0x2bc976;})[_0xe008('0x28')](respondWithResult(_0x2de0dc,0xc9))[_0xe008('0x4e')](handleError(_0x2de0dc,null));};exports[_0xe008('0x57')]=function(_0x35febd,_0x48da73){if(_0x35febd[_0xe008('0x50')]['id']){delete _0x35febd[_0xe008('0x50')]['id'];}return db['FaxQueue'][_0xe008('0x4d')]({'where':{'id':_0x35febd[_0xe008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48da73,null))[_0xe008('0x28')](saveUpdates(_0x35febd[_0xe008('0x50')],null))[_0xe008('0x28')](respondWithResult(_0x48da73,null))['catch'](handleError(_0x48da73,null));};exports[_0xe008('0x29')]=function(_0x29582e,_0x3cea33){return db['FaxQueue'][_0xe008('0x4d')]({'where':{'id':_0x29582e[_0xe008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3cea33,null))[_0xe008('0x28')](removeEntity(_0x3cea33,null))[_0xe008('0x4e')](handleError(_0x3cea33,null));};exports['describe']=function(_0x1434e8,_0x34698b){return db[_0xe008('0x46')][_0xe008('0x58')]()[_0xe008('0x28')](respondWithResult(_0x34698b,null))['catch'](handleError(_0x34698b,null));};exports[_0xe008('0x59')]=function(_0x47bcfa,_0x149af8,_0x202ff6){var _0x5f0ee3={'raw':!![],'where':{}},_0x5258c6={},_0x186e66;return db[_0xe008('0x46')][_0xe008('0x5a')]({'where':{'id':_0x47bcfa['params']['id']}})[_0xe008('0x28')](handleEntityNotFound(_0x149af8,null))[_0xe008('0x28')](function(_0x1089f3){if(_0x1089f3){_0x186e66=_0x1089f3['get']({'plain':!![]});_0x5258c6[_0xe008('0x36')]=_[_0xe008('0x37')](db[_0xe008('0x5b')]['rawAttributes']);_0x5258c6['query']=_['keys'](_0x47bcfa[_0xe008('0x38')]);_0x5258c6['filters']=_['intersection'](_0x5258c6[_0xe008('0x36')],_0x5258c6['query']);_0x5f0ee3[_0xe008('0x3a')]=_[_0xe008('0x39')](_0x5258c6[_0xe008('0x36')],qs[_0xe008('0x3b')](_0x47bcfa[_0xe008('0x38')][_0xe008('0x3b')]));_0x5f0ee3[_0xe008('0x3a')]=_0x5f0ee3[_0xe008('0x3a')][_0xe008('0x3c')]?_0x5f0ee3['attributes']:_0x5258c6[_0xe008('0x36')];if(!_0x47bcfa[_0xe008('0x38')][_0xe008('0x3d')]('nolimit')){_0x5f0ee3[_0xe008('0x22')]=qs['limit'](_0x47bcfa[_0xe008('0x38')][_0xe008('0x22')]);_0x5f0ee3[_0xe008('0x20')]=qs[_0xe008('0x20')](_0x47bcfa[_0xe008('0x38')][_0xe008('0x20')]);}_0x5f0ee3['order']=qs[_0xe008('0x40')](_0x47bcfa['query'][_0xe008('0x40')]);_0x5f0ee3['where']=qs['filters'](_[_0xe008('0x5c')](_0x47bcfa['query'],_0x5258c6[_0xe008('0x42')]));_0x5f0ee3[_0xe008('0x41')][_0xe008('0x5d')]=_0x1089f3['id'];if(_0x47bcfa[_0xe008('0x38')][_0xe008('0x44')]){_0x5f0ee3[_0xe008('0x41')]=_['merge'](_0x5f0ee3['where'],{'$or':_['map'](_0x5f0ee3[_0xe008('0x3a')],function(_0x30b512){var _0x157b26={};_0x157b26[_0x30b512]={'$like':'%'+_0x47bcfa['query']['filter']+'%'};return _0x157b26;})});}_0x5f0ee3=_[_0xe008('0x5e')]({},_0x5f0ee3,_0x47bcfa[_0xe008('0x45')]);return db['UserFaxQueue'][_0xe008('0x49')](_0x5f0ee3);}})[_0xe008('0x28')](function(_0x3bda5d){if(_0x3bda5d){return db[_0xe008('0x5f')]['findAndCountAll']({'where':{'id':_[_0xe008('0x31')](_0x3bda5d,_0xe008('0x60')),'role':'agent'},'attributes':['id',_0xe008('0x2f'),'faxPause',_0xe008('0x61'),_0xe008('0x62')]});}})['then'](function(_0x13cc16){if(_0x13cc16){return{'count':_0x13cc16[_0xe008('0x23')],'rows':_[_0xe008('0x31')](_0x13cc16[_0xe008('0x4a')],function(_0x81eab7){return{'membername':_0x81eab7[_0xe008('0x2f')],'UserId':_0x81eab7['id'],'queue_name':_0x186e66[_0xe008('0x2f')],'FaxQueueId':_0x186e66['id'],'interface':util[_0xe008('0x63')]('%s/%s',_0xe008('0x64'),_0x81eab7[_0xe008('0x2f')]),'penalty':0x0,'paused':_0x81eab7[_0xe008('0x65')],'createdAt':_0x81eab7[_0xe008('0x62')],'updatedAt':_0x81eab7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe008('0x28')](respondWithFilteredResult(_0x149af8,_0x5f0ee3))[_0xe008('0x4e')](handleError(_0x149af8,null));};exports[_0xe008('0x66')]=function(_0x2acc47,_0x128f8b,_0x38d254){var _0x226ef8={};var _0x3426a1={};var _0x1f5e43;var _0x12e6d5;return db[_0xe008('0x46')]['findOne']({'where':{'id':_0x2acc47['params']['id']}})[_0xe008('0x28')](handleEntityNotFound(_0x128f8b,null))[_0xe008('0x28')](function(_0x1c9d0a){if(_0x1c9d0a){_0x1f5e43=_0x1c9d0a;_0x3426a1[_0xe008('0x36')]=_[_0xe008('0x37')](db['Team'][_0xe008('0x32')]);_0x3426a1[_0xe008('0x38')]=_[_0xe008('0x37')](_0x2acc47['query']);_0x3426a1[_0xe008('0x42')]=_[_0xe008('0x39')](_0x3426a1[_0xe008('0x36')],_0x3426a1['query']);_0x226ef8[_0xe008('0x3a')]=_[_0xe008('0x39')](_0x3426a1[_0xe008('0x36')],qs[_0xe008('0x3b')](_0x2acc47[_0xe008('0x38')][_0xe008('0x3b')]));_0x226ef8[_0xe008('0x3a')]=_0x226ef8['attributes']['length']?_0x226ef8[_0xe008('0x3a')]:_0x3426a1[_0xe008('0x36')];_0x226ef8[_0xe008('0x3f')]=qs[_0xe008('0x40')](_0x2acc47[_0xe008('0x38')][_0xe008('0x40')]);_0x226ef8[_0xe008('0x41')]=qs[_0xe008('0x42')](_['pick'](_0x2acc47[_0xe008('0x38')],_0x3426a1[_0xe008('0x42')]));if(_0x2acc47[_0xe008('0x38')]['filter']){_0x226ef8['where']=_[_0xe008('0x5e')](_0x226ef8[_0xe008('0x41')],{'$or':_[_0xe008('0x31')](_0x226ef8[_0xe008('0x3a')],function(_0x39582c){var _0x9286e2={};_0x9286e2[_0x39582c]={'$like':'%'+_0x2acc47[_0xe008('0x38')][_0xe008('0x44')]+'%'};return _0x9286e2;})});}_0x226ef8=_[_0xe008('0x5e')]({},_0x226ef8,_0x2acc47[_0xe008('0x45')]);return _0x1f5e43[_0xe008('0x66')](_0x226ef8);}})[_0xe008('0x28')](function(_0x49875e){if(_0x49875e){_0x12e6d5=_0x49875e[_0xe008('0x3c')];if(!_0x2acc47[_0xe008('0x38')][_0xe008('0x3d')](_0xe008('0x3e'))){_0x226ef8['limit']=qs[_0xe008('0x22')](_0x2acc47['query']['limit']);_0x226ef8[_0xe008('0x20')]=qs[_0xe008('0x20')](_0x2acc47[_0xe008('0x38')][_0xe008('0x20')]);}return _0x1f5e43[_0xe008('0x66')](_0x226ef8);}})['then'](function(_0x1637f2){if(_0x1637f2){return _0x1637f2?{'count':_0x12e6d5,'rows':_0x1637f2}:null;}})[_0xe008('0x28')](respondWithResult(_0x128f8b,null))['catch'](handleError(_0x128f8b,null));};exports[_0xe008('0x67')]=function(_0x24689f,_0x200d04,_0x3879bf){var _0x476604=_0x24689f[_0xe008('0x50')]['ids'];return db[_0xe008('0x68')]['findAll']({'where':{'id':_0x476604},'attributes':['id'],'include':[{'model':db[_0xe008('0x5f')],'as':_0xe008('0x69'),'attributes':['id',_0xe008('0x2f'),_0xe008('0x6a'),_0xe008('0x6b'),_0xe008('0x6c')],'raw':!![]}]})[_0xe008('0x28')](function(_0x30257b){if(_0x30257b){var _0x40c08b=_['flatMap'](_0x30257b,function(_0x10fcc6){var _0x21cdf0=_0x10fcc6[_0xe008('0x52')]({'plain':!![]});return _0x21cdf0[_0xe008('0x69')];});return db[_0xe008('0x46')]['find']({'where':{'id':_0x24689f['params']['id']}})[_0xe008('0x28')](function(_0x3c99e9){return db[_0xe008('0x6d')]['transaction'](function(_0x4495e7){return _0x3c99e9[_0xe008('0x67')](_0x476604,{'transaction':_0x4495e7})[_0xe008('0x28')](function(){return BPromise[_0xe008('0x6e')](_0x40c08b,function(_0xefcff7){return db[_0xe008('0x5b')]['findOrCreate']({'where':{'UserId':_0xefcff7['id'],'FaxQueueId':_0x24689f[_0xe008('0x4c')]['id']},'transaction':_0x4495e7});});})[_0xe008('0x28')](function(){_0x40c08b['forEach'](function(_0x3724c8){socket[_0xe008('0x6f')]('userFaxQueue:save',{'UserId':_0x3724c8['id'],'FaxQueueId':_0x3c99e9['id']});});});});});}})[_0xe008('0x28')](respondWithStatusCode(_0x200d04,null))['catch'](handleError(_0x200d04,null));};exports[_0xe008('0x70')]=function(_0x35c432,_0x65c205,_0x552805){return db[_0xe008('0x68')]['findAll']({'where':{'id':_0x35c432[_0xe008('0x38')][_0xe008('0x71')]},'attributes':['id'],'include':[{'model':db[_0xe008('0x5f')],'as':_0xe008('0x69'),'attributes':['id'],'raw':!![]}]})[_0xe008('0x28')](handleEntityNotFound(_0x65c205,null))[_0xe008('0x28')](function(_0x1dcfde){var _0x79adf2=_['map'](_0x1dcfde,'id');var _0x7ca16b=[];var _0x36d593=[];var _0x22d810=squel[_0xe008('0x72')]();_0x22d810['field'](_0xe008('0x73'))[_0xe008('0x74')](_0xe008('0x75'),'tq')[_0xe008('0x76')](_0xe008('0x77'),'ut',_0xe008('0x78'))[_0xe008('0x41')](_0xe008('0x79'),_0x35c432[_0xe008('0x4c')]['id']);for(var _0x34afb2=0x0;_0x34afb2<_0x1dcfde[_0xe008('0x3c')];_0x34afb2+=0x1){let _0x40451c=_0x1dcfde[_0x34afb2];for(var _0x2a976a=0x0;_0x2a976a<_0x40451c[_0xe008('0x69')][_0xe008('0x3c')];_0x2a976a+=0x1){let _0x38bb60=_0x40451c[_0xe008('0x69')][_0x2a976a];var _0x48d990=_0x22d810[_0xe008('0x7a')]();_0x48d990[_0xe008('0x41')](_0xe008('0x7b'),_0x38bb60['id']);_0x36d593[_0xe008('0x7c')](db['sequelize']['query'](_0x48d990['toString'](),{'type':db['sequelize'][_0xe008('0x7d')][_0xe008('0x7e')]})[_0xe008('0x28')](function(_0x68c902){if(_0x68c902['length']===0x1){return _0x38bb60['id'];}else{var _0x320573=_[_0xe008('0x7f')](_[_0xe008('0x31')](_0x68c902,'TeamId'),function(_0x254221){return _['includes'](_0x79adf2,_0x254221);});if(_0x320573){return _0x38bb60['id'];}}}));}}return BPromise['all'](_0x36d593)[_0xe008('0x28')](function(_0x47b78c){_0x7ca16b=_(_0x7ca16b)[_0xe008('0x80')](_0x47b78c)['compact']()[_0xe008('0x81')]();return db[_0xe008('0x46')][_0xe008('0x4d')]({'where':{'id':_0x35c432[_0xe008('0x4c')]['id']}})[_0xe008('0x28')](function(_0x272be7){return db[_0xe008('0x6d')][_0xe008('0x82')](function(_0x3bc2a){return _0x272be7[_0xe008('0x70')](_0x35c432[_0xe008('0x38')]['ids'],{'transaction':_0x3bc2a})[_0xe008('0x28')](function(){if(!_[_0xe008('0x83')](_0x7ca16b)){return _0x272be7[_0xe008('0x84')](_0x7ca16b,{'transaction':_0x3bc2a});}})[_0xe008('0x28')](function(){_0x7ca16b[_0xe008('0x85')](function(_0x4dc447){socket['emit']('userFaxQueue:remove',{'UserId':_0x4dc447,'FaxQueueId':_0x272be7['id']});});});});});});})[_0xe008('0x28')](respondWithStatusCode(_0x65c205,null))[_0xe008('0x4e')](handleError(_0x65c205,null));};exports[_0xe008('0x86')]=function(_0x73a20b,_0x5e81e6,_0x1c8251){return db['FaxQueue']['find']({'where':{'id':_0x73a20b['params']['id']}})[_0xe008('0x28')](handleEntityNotFound(_0x5e81e6,null))[_0xe008('0x28')](function(_0x1553e2){if(_0x1553e2){return _0x1553e2[_0xe008('0x86')](_0x73a20b[_0xe008('0x50')][_0xe008('0x71')],_[_0xe008('0x87')](_0x73a20b[_0xe008('0x50')],[_0xe008('0x71'),'id'])||{})['spread'](function(_0x3706c3){for(var _0x8bbca4=0x0;_0x8bbca4<_0x73a20b[_0xe008('0x50')]['ids'][_0xe008('0x3c')];_0x8bbca4+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x73a20b[_0xe008('0x50')][_0xe008('0x71')][_0x8bbca4]),'FaxQueueId':Number(_0x73a20b[_0xe008('0x4c')]['id'])});}return _0x3706c3;});}})['then'](respondWithResult(_0x5e81e6,null))[_0xe008('0x4e')](handleError(_0x5e81e6,null));};exports['removeAgents']=function(_0x513d2e,_0x44ab4a,_0x2bfe1a){return db[_0xe008('0x46')]['find']({'where':{'id':_0x513d2e['params']['id']}})[_0xe008('0x28')](handleEntityNotFound(_0x44ab4a,null))[_0xe008('0x28')](function(_0x4c95af){if(_0x4c95af){return _0x4c95af[_0xe008('0x84')](_0x513d2e[_0xe008('0x38')]['ids'])['then'](function(){if(_[_0xe008('0x88')](_0x513d2e[_0xe008('0x38')][_0xe008('0x71')])){for(var _0x1f9148=0x0;_0x1f9148<_0x513d2e[_0xe008('0x38')]['ids'][_0xe008('0x3c')];_0x1f9148+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x513d2e['query'][_0xe008('0x71')][_0x1f9148]),'FaxQueueId':Number(_0x513d2e[_0xe008('0x4c')]['id'])});}}else{socket['emit'](_0xe008('0x89'),{'UserId':Number(_0x513d2e[_0xe008('0x38')]['ids']),'FaxQueueId':Number(_0x513d2e[_0xe008('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x44ab4a,null))[_0xe008('0x4e')](handleError(_0x44ab4a,null));};exports[_0xe008('0x8a')]=function(_0x3969e0,_0x48feac,_0x4390e5){var _0x2f8241={};var _0x5e3833={};var _0x56c669;var _0x3ba05c;return db[_0xe008('0x46')]['findOne']({'where':{'id':_0x3969e0[_0xe008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48feac,null))[_0xe008('0x28')](function(_0x2a8db9){if(_0x2a8db9){_0x56c669=_0x2a8db9;_0x5e3833[_0xe008('0x36')]=_['keys'](db[_0xe008('0x5f')]['rawAttributes']);_0x5e3833['query']=_[_0xe008('0x37')](_0x3969e0['query']);_0x5e3833['filters']=_[_0xe008('0x39')](_0x5e3833[_0xe008('0x36')],_0x5e3833[_0xe008('0x38')]);_0x2f8241['attributes']=_[_0xe008('0x39')](_0x5e3833[_0xe008('0x36')],qs[_0xe008('0x3b')](_0x3969e0['query'][_0xe008('0x3b')]));_0x2f8241[_0xe008('0x3a')]=_0x2f8241['attributes'][_0xe008('0x3c')]?_0x2f8241['attributes']:_0x5e3833[_0xe008('0x36')];_0x2f8241[_0xe008('0x3f')]=qs[_0xe008('0x40')](_0x3969e0['query']['sort']);_0x2f8241[_0xe008('0x41')]=qs[_0xe008('0x42')](_[_0xe008('0x5c')](_0x3969e0[_0xe008('0x38')],_0x5e3833['filters']));if(_0x3969e0[_0xe008('0x38')][_0xe008('0x44')]){_0x2f8241[_0xe008('0x41')]=_[_0xe008('0x5e')](_0x2f8241['where'],{'$or':_[_0xe008('0x31')](_0x2f8241[_0xe008('0x3a')],function(_0x45c459){var _0x360856={};_0x360856[_0x45c459]={'$like':'%'+_0x3969e0['query'][_0xe008('0x44')]+'%'};return _0x360856;})});}_0x2f8241=_[_0xe008('0x5e')]({},_0x2f8241,_0x3969e0['options']);return _0x56c669[_0xe008('0x8a')](_0x2f8241);}})[_0xe008('0x28')](function(_0x1465e0){if(_0x1465e0){_0x3ba05c=_0x1465e0[_0xe008('0x3c')];if(!_0x3969e0['query'][_0xe008('0x3d')](_0xe008('0x3e'))){_0x2f8241[_0xe008('0x22')]=qs['limit'](_0x3969e0[_0xe008('0x38')][_0xe008('0x22')]);_0x2f8241[_0xe008('0x20')]=qs['offset'](_0x3969e0[_0xe008('0x38')][_0xe008('0x20')]);}return _0x56c669['getAgents'](_0x2f8241);}})[_0xe008('0x28')](function(_0x1df4b0){if(_0x1df4b0){return _0x1df4b0?{'count':_0x3ba05c,'rows':_0x1df4b0}:null;}})[_0xe008('0x28')](respondWithResult(_0x48feac,null))['catch'](handleError(_0x48feac,null));}; \ No newline at end of file +var _0xca91=['hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserFaxQueue','order','FaxQueueId','findAndCountAll','UserId','faxPause','updatedAt','createdAt','%s/%s','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','userFaxQueue:save','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','value','transaction','isEmpty','forEach','emit','userFaxQueue:remove','addAgents','spread','removeAgents','getAgents','findOne','rimraf','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','end','error','name','index','map','FaxQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x4b969d,_0x5b6e52){var _0x10354d=function(_0x9a6ffb){while(--_0x9a6ffb){_0x4b969d['push'](_0x4b969d['shift']());}};_0x10354d(++_0x5b6e52);}(_0xca91,0x1e2));var _0x1ca9=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xca91[_0x3f7598];return _0x51fb16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ca9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1ca9('0x1'));var moment=require('moment');var BPromise=require(_0x1ca9('0x2'));var Mustache=require('mustache');var util=require(_0x1ca9('0x3'));var path=require(_0x1ca9('0x4'));var sox=require('sox');var csv=require(_0x1ca9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ca9('0x6'));var _=require(_0x1ca9('0x7'));var squel=require(_0x1ca9('0x8'));var crypto=require(_0x1ca9('0x9'));var jsforce=require(_0x1ca9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1ca9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1ca9('0xc'));var as=require(_0x1ca9('0xd'));var hardwareService=require(_0x1ca9('0xe'));var logger=require(_0x1ca9('0xf'))(_0x1ca9('0x10'));var utils=require(_0x1ca9('0x11'));var config=require(_0x1ca9('0x12'));var licenseUtil=require(_0x1ca9('0x13'));var db=require(_0x1ca9('0x14'))['db'];config[_0x1ca9('0x15')]=_[_0x1ca9('0x16')](config[_0x1ca9('0x15')],{'host':_0x1ca9('0x17'),'port':0x18eb});var socket=require(_0x1ca9('0x18'))(new Redis(config['redis']));require(_0x1ca9('0x19'))[_0x1ca9('0x1a')](socket);function respondWithStatusCode(_0x34eaf7,_0x50878f){_0x50878f=_0x50878f||0xcc;return function(_0x69499d){if(_0x69499d){return _0x34eaf7[_0x1ca9('0x1b')](_0x50878f);}return _0x34eaf7['status'](_0x50878f)['end']();};}function respondWithResult(_0x202539,_0x35c14f){_0x35c14f=_0x35c14f||0xc8;return function(_0x45d302){if(_0x45d302){return _0x202539[_0x1ca9('0x1c')](_0x35c14f)[_0x1ca9('0x1d')](_0x45d302);}};}function respondWithFilteredResult(_0x3621d2,_0xc5aee4){return function(_0x4805d1){if(_0x4805d1){var _0x5d19b7=typeof _0xc5aee4[_0x1ca9('0x1e')]==='undefined'&&typeof _0xc5aee4[_0x1ca9('0x1f')]===_0x1ca9('0x20');var _0x44c7b5=_0x4805d1['count'];var _0x2a0a25=_0x5d19b7?0x0:_0xc5aee4[_0x1ca9('0x1e')];var _0x871405=_0x5d19b7?_0x4805d1['count']:_0xc5aee4['offset']+_0xc5aee4[_0x1ca9('0x1f')];var _0x5d5833;if(_0x871405>=_0x44c7b5){_0x871405=_0x44c7b5;_0x5d5833=0xc8;}else{_0x5d5833=0xce;}_0x3621d2[_0x1ca9('0x1c')](_0x5d5833);return _0x3621d2[_0x1ca9('0x21')](_0x1ca9('0x22'),_0x2a0a25+'-'+_0x871405+'/'+_0x44c7b5)['json'](_0x4805d1);}return null;};}function patchUpdates(_0x59212a){return function(_0xd47bad){try{jsonpatch[_0x1ca9('0x23')](_0xd47bad,_0x59212a,!![]);}catch(_0x39ee3d){return BPromise[_0x1ca9('0x24')](_0x39ee3d);}return _0xd47bad[_0x1ca9('0x25')]();};}function saveUpdates(_0x364192,_0x359031){return function(_0x24be1a){if(_0x24be1a){return _0x24be1a[_0x1ca9('0x26')](_0x364192)['then'](function(_0x55fe01){return _0x55fe01;});}return null;};}function removeEntity(_0x491b1c,_0x1ea73d){return function(_0x3da440){if(_0x3da440){return _0x3da440[_0x1ca9('0x27')]()[_0x1ca9('0x28')](function(){var _0x4a24ec=_0x3da440['get']({'plain':!![]});var _0x383f1f=_0x1ca9('0x29');return db[_0x1ca9('0x2a')][_0x1ca9('0x27')]({'where':{'type':_0x383f1f,'resourceId':_0x4a24ec['id']}})[_0x1ca9('0x28')](function(){return _0x3da440;});})[_0x1ca9('0x28')](function(){_0x491b1c[_0x1ca9('0x1c')](0xcc)[_0x1ca9('0x2b')]();});}};}function handleEntityNotFound(_0x57fbff,_0x3a6614){return function(_0x5155a8){if(!_0x5155a8){_0x57fbff[_0x1ca9('0x1b')](0x194);}return _0x5155a8;};}function handleError(_0x58202c,_0x14b6f4){_0x14b6f4=_0x14b6f4||0x1f4;return function(_0x189c96){logger[_0x1ca9('0x2c')](_0x189c96['stack']);if(_0x189c96[_0x1ca9('0x2d')]){delete _0x189c96['name'];}_0x58202c[_0x1ca9('0x1c')](_0x14b6f4)['send'](_0x189c96);};}exports[_0x1ca9('0x2e')]=function(_0x5dd686,_0x5ea756){var _0x12e019={},_0x5aae01={},_0x8aa1a={'count':0x0,'rows':[]};var _0x210ce2=_[_0x1ca9('0x2f')](db[_0x1ca9('0x30')]['rawAttributes'],function(_0x17c493){return{'name':_0x17c493[_0x1ca9('0x31')],'type':_0x17c493[_0x1ca9('0x32')][_0x1ca9('0x33')]};});_0x5aae01[_0x1ca9('0x34')]=_[_0x1ca9('0x2f')](_0x210ce2,_0x1ca9('0x2d'));_0x5aae01[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x5dd686['query']);_0x5aae01['filters']=_[_0x1ca9('0x37')](_0x5aae01[_0x1ca9('0x34')],_0x5aae01[_0x1ca9('0x35')]);_0x12e019[_0x1ca9('0x38')]=_['intersection'](_0x5aae01[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0x5dd686['query']['fields']));_0x12e019[_0x1ca9('0x38')]=_0x12e019['attributes']['length']?_0x12e019[_0x1ca9('0x38')]:_0x5aae01[_0x1ca9('0x34')];if(!_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x12e019['limit']=qs[_0x1ca9('0x1f')](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x12e019[_0x1ca9('0x1e')]=qs[_0x1ca9('0x1e')](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}_0x12e019['order']=qs['sort'](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x12e019[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0x5dd686['query'],_0x5aae01['filters']),_0x210ce2);if(_0x5dd686['query'][_0x1ca9('0x40')]){_0x12e019[_0x1ca9('0x3d')]=_[_0x1ca9('0x41')](_0x12e019[_0x1ca9('0x3d')],{'$or':_['map'](_0x210ce2,function(_0x17c4b9){if(_0x17c4b9[_0x1ca9('0x32')]!==_0x1ca9('0x42')){var _0x26be9b={};_0x26be9b[_0x17c4b9[_0x1ca9('0x2d')]]={'$like':'%'+_0x5dd686['query'][_0x1ca9('0x40')]+'%'};return _0x26be9b;}})});}_0x12e019=_[_0x1ca9('0x41')]({},_0x12e019,_0x5dd686[_0x1ca9('0x43')]);var _0x476ca0={'where':_0x12e019[_0x1ca9('0x3d')]};return db['FaxQueue'][_0x1ca9('0x44')](_0x476ca0)[_0x1ca9('0x28')](function(_0x451884){_0x8aa1a[_0x1ca9('0x44')]=_0x451884;if(_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x45')]){_0x12e019[_0x1ca9('0x46')]=[{'all':!![]}];}return db[_0x1ca9('0x30')][_0x1ca9('0x47')](_0x12e019);})[_0x1ca9('0x28')](function(_0x1060a5){_0x8aa1a[_0x1ca9('0x48')]=_0x1060a5;return _0x8aa1a;})[_0x1ca9('0x28')](respondWithFilteredResult(_0x5ea756,_0x12e019))[_0x1ca9('0x49')](handleError(_0x5ea756,null));};exports['show']=function(_0x24cff2,_0x18c3a0){var _0x232507={'raw':!![],'where':{'id':_0x24cff2['params']['id']}},_0x59fafc={};_0x59fafc[_0x1ca9('0x34')]=_['keys'](db[_0x1ca9('0x30')][_0x1ca9('0x4a')]);_0x59fafc[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x24cff2[_0x1ca9('0x35')]);_0x59fafc[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x59fafc[_0x1ca9('0x34')],_0x59fafc[_0x1ca9('0x35')]);_0x232507[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x59fafc[_0x1ca9('0x34')],qs['fields'](_0x24cff2[_0x1ca9('0x35')][_0x1ca9('0x39')]));_0x232507['attributes']=_0x232507['attributes'][_0x1ca9('0x4b')]?_0x232507[_0x1ca9('0x38')]:_0x59fafc[_0x1ca9('0x34')];if(_0x24cff2[_0x1ca9('0x35')][_0x1ca9('0x45')]){_0x232507[_0x1ca9('0x46')]=[{'all':!![]}];}_0x232507=_['merge']({},_0x232507,_0x24cff2[_0x1ca9('0x43')]);return db[_0x1ca9('0x30')]['find'](_0x232507)[_0x1ca9('0x28')](handleEntityNotFound(_0x18c3a0,null))[_0x1ca9('0x28')](respondWithResult(_0x18c3a0,null))[_0x1ca9('0x49')](handleError(_0x18c3a0,null));};exports[_0x1ca9('0x4c')]=function(_0x122d1c,_0x1d18d7){return db[_0x1ca9('0x30')]['create'](_0x122d1c['body'],{})[_0x1ca9('0x28')](function(_0x186c66){var _0x404e0d=_0x122d1c[_0x1ca9('0x4d')]['get']({'plain':!![]});if(!_0x404e0d)throw new Error(_0x1ca9('0x4e'));if(_0x404e0d[_0x1ca9('0x4f')]==='user'){var _0x53d29b=_0x186c66[_0x1ca9('0x50')]({'plain':!![]});var _0x2d104e=_0x1ca9('0x29');return db['UserProfileSection'][_0x1ca9('0x51')]({'where':{'name':_0x2d104e,'userProfileId':_0x404e0d[_0x1ca9('0x52')]},'raw':!![]})['then'](function(_0x46c615){if(_0x46c615&&_0x46c615[_0x1ca9('0x53')]===0x0){return db[_0x1ca9('0x2a')]['create']({'name':_0x53d29b[_0x1ca9('0x2d')],'resourceId':_0x53d29b['id'],'type':_0x46c615['name'],'sectionId':_0x46c615['id']},{})['then'](function(){return _0x186c66;});}else{return _0x186c66;}})[_0x1ca9('0x49')](function(_0x5df7c5){logger['error'](_0x1ca9('0x54'),_0x5df7c5);throw _0x5df7c5;});}return _0x186c66;})[_0x1ca9('0x28')](respondWithResult(_0x1d18d7,0xc9))[_0x1ca9('0x49')](handleError(_0x1d18d7,null));};exports[_0x1ca9('0x26')]=function(_0x1f4918,_0x169376){if(_0x1f4918['body']['id']){delete _0x1f4918[_0x1ca9('0x55')]['id'];}return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1f4918['params']['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x169376,null))[_0x1ca9('0x28')](saveUpdates(_0x1f4918[_0x1ca9('0x55')],null))[_0x1ca9('0x28')](respondWithResult(_0x169376,null))[_0x1ca9('0x49')](handleError(_0x169376,null));};exports[_0x1ca9('0x27')]=function(_0xf7e666,_0x295375){return db[_0x1ca9('0x30')]['find']({'where':{'id':_0xf7e666[_0x1ca9('0x56')]['id']}})['then'](handleEntityNotFound(_0x295375,null))[_0x1ca9('0x28')](removeEntity(_0x295375,null))['catch'](handleError(_0x295375,null));};exports[_0x1ca9('0x57')]=function(_0x54a9ec,_0x200e88){return db[_0x1ca9('0x30')][_0x1ca9('0x57')]()[_0x1ca9('0x28')](respondWithResult(_0x200e88,null))[_0x1ca9('0x49')](handleError(_0x200e88,null));};exports[_0x1ca9('0x58')]=function(_0xc4d03c,_0x339186,_0x3c64a7){var _0x9eee02={'raw':!![],'where':{}},_0x326fdb={},_0x5f1956;return db['FaxQueue']['findOne']({'where':{'id':_0xc4d03c['params']['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x339186,null))['then'](function(_0x5b28dd){if(_0x5b28dd){_0x5f1956=_0x5b28dd[_0x1ca9('0x50')]({'plain':!![]});_0x326fdb[_0x1ca9('0x34')]=_['keys'](db[_0x1ca9('0x59')]['rawAttributes']);_0x326fdb['query']=_[_0x1ca9('0x36')](_0xc4d03c['query']);_0x326fdb[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x326fdb[_0x1ca9('0x34')],_0x326fdb[_0x1ca9('0x35')]);_0x9eee02[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x326fdb[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x39')]));_0x9eee02[_0x1ca9('0x38')]=_0x9eee02[_0x1ca9('0x38')][_0x1ca9('0x4b')]?_0x9eee02['attributes']:_0x326fdb[_0x1ca9('0x34')];if(!_0xc4d03c['query'][_0x1ca9('0x3a')]('nolimit')){_0x9eee02[_0x1ca9('0x1f')]=qs[_0x1ca9('0x1f')](_0xc4d03c[_0x1ca9('0x35')]['limit']);_0x9eee02[_0x1ca9('0x1e')]=qs[_0x1ca9('0x1e')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}_0x9eee02[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x9eee02[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0xc4d03c['query'],_0x326fdb[_0x1ca9('0x3e')]));_0x9eee02[_0x1ca9('0x3d')][_0x1ca9('0x5b')]=_0x5b28dd['id'];if(_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x9eee02['where']=_[_0x1ca9('0x41')](_0x9eee02['where'],{'$or':_[_0x1ca9('0x2f')](_0x9eee02[_0x1ca9('0x38')],function(_0x265e68){var _0xc5ea7={};_0xc5ea7[_0x265e68]={'$like':'%'+_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x40')]+'%'};return _0xc5ea7;})});}_0x9eee02=_['merge']({},_0x9eee02,_0xc4d03c['options']);return db[_0x1ca9('0x59')][_0x1ca9('0x47')](_0x9eee02);}})[_0x1ca9('0x28')](function(_0x5cdab4){if(_0x5cdab4){return db['User'][_0x1ca9('0x5c')]({'where':{'id':_[_0x1ca9('0x2f')](_0x5cdab4,_0x1ca9('0x5d')),'role':'agent'},'attributes':['id','name',_0x1ca9('0x5e'),_0x1ca9('0x5f'),_0x1ca9('0x60')]});}})[_0x1ca9('0x28')](function(_0x82f1f9){if(_0x82f1f9){return{'count':_0x82f1f9[_0x1ca9('0x44')],'rows':_['map'](_0x82f1f9['rows'],function(_0x53b48b){return{'membername':_0x53b48b[_0x1ca9('0x2d')],'UserId':_0x53b48b['id'],'queue_name':_0x5f1956[_0x1ca9('0x2d')],'FaxQueueId':_0x5f1956['id'],'interface':util['format'](_0x1ca9('0x61'),'SIP',_0x53b48b['name']),'penalty':0x0,'paused':_0x53b48b[_0x1ca9('0x5e')],'createdAt':_0x53b48b[_0x1ca9('0x60')],'updatedAt':_0x53b48b[_0x1ca9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1ca9('0x28')](respondWithFilteredResult(_0x339186,_0x9eee02))[_0x1ca9('0x49')](handleError(_0x339186,null));};exports[_0x1ca9('0x62')]=function(_0x236095,_0xacdbf3,_0xfb716b){var _0x99435f={};var _0x1def33={};var _0x442ad2;var _0x4d5313;return db[_0x1ca9('0x30')]['findOne']({'where':{'id':_0x236095[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0xacdbf3,null))[_0x1ca9('0x28')](function(_0x27b0c1){if(_0x27b0c1){_0x442ad2=_0x27b0c1;_0x1def33['model']=_[_0x1ca9('0x36')](db['Team']['rawAttributes']);_0x1def33[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x236095[_0x1ca9('0x35')]);_0x1def33[_0x1ca9('0x3e')]=_['intersection'](_0x1def33[_0x1ca9('0x34')],_0x1def33['query']);_0x99435f[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x1def33[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0x236095[_0x1ca9('0x35')]['fields']));_0x99435f[_0x1ca9('0x38')]=_0x99435f[_0x1ca9('0x38')][_0x1ca9('0x4b')]?_0x99435f[_0x1ca9('0x38')]:_0x1def33['model'];_0x99435f[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x99435f[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_['pick'](_0x236095['query'],_0x1def33['filters']));if(_0x236095[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x99435f[_0x1ca9('0x3d')]=_['merge'](_0x99435f[_0x1ca9('0x3d')],{'$or':_[_0x1ca9('0x2f')](_0x99435f[_0x1ca9('0x38')],function(_0x536621){var _0x1e276a={};_0x1e276a[_0x536621]={'$like':'%'+_0x236095[_0x1ca9('0x35')]['filter']+'%'};return _0x1e276a;})});}_0x99435f=_['merge']({},_0x99435f,_0x236095['options']);return _0x442ad2['getTeams'](_0x99435f);}})[_0x1ca9('0x28')](function(_0x51c6b4){if(_0x51c6b4){_0x4d5313=_0x51c6b4['length'];if(!_0x236095[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x99435f[_0x1ca9('0x1f')]=qs[_0x1ca9('0x1f')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x99435f['offset']=qs[_0x1ca9('0x1e')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}return _0x442ad2['getTeams'](_0x99435f);}})['then'](function(_0x261194){if(_0x261194){return _0x261194?{'count':_0x4d5313,'rows':_0x261194}:null;}})['then'](respondWithResult(_0xacdbf3,null))[_0x1ca9('0x49')](handleError(_0xacdbf3,null));};exports[_0x1ca9('0x63')]=function(_0xdacad9,_0x5eaa13,_0x40cdfd){var _0x5c0500=_0xdacad9[_0x1ca9('0x55')][_0x1ca9('0x64')];return db[_0x1ca9('0x65')][_0x1ca9('0x47')]({'where':{'id':_0x5c0500},'attributes':['id'],'include':[{'model':db[_0x1ca9('0x66')],'as':_0x1ca9('0x67'),'attributes':['id',_0x1ca9('0x2d'),_0x1ca9('0x68'),_0x1ca9('0x69'),_0x1ca9('0x6a')],'raw':!![]}]})[_0x1ca9('0x28')](function(_0x6f4dbb){if(_0x6f4dbb){var _0x1040d3=_[_0x1ca9('0x6b')](_0x6f4dbb,function(_0x353e2a){var _0x1313f0=_0x353e2a[_0x1ca9('0x50')]({'plain':!![]});return _0x1313f0['Agents'];});return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0xdacad9[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](function(_0x17ffb1){return db[_0x1ca9('0x6c')]['transaction'](function(_0x57b879){return _0x17ffb1[_0x1ca9('0x63')](_0x5c0500,{'transaction':_0x57b879})[_0x1ca9('0x28')](function(){return BPromise[_0x1ca9('0x6d')](_0x1040d3,function(_0x394643){return db[_0x1ca9('0x59')][_0x1ca9('0x6e')]({'where':{'UserId':_0x394643['id'],'FaxQueueId':_0xdacad9[_0x1ca9('0x56')]['id']},'transaction':_0x57b879});});})[_0x1ca9('0x28')](function(){_0x1040d3['forEach'](function(_0x59b0c2){socket['emit'](_0x1ca9('0x6f'),{'UserId':_0x59b0c2['id'],'FaxQueueId':_0x17ffb1['id']});});});});});}})[_0x1ca9('0x28')](respondWithStatusCode(_0x5eaa13,null))[_0x1ca9('0x49')](handleError(_0x5eaa13,null));};exports[_0x1ca9('0x70')]=function(_0x1a4f8b,_0x46390a,_0x4fa0e7){return db['Team'][_0x1ca9('0x47')]({'where':{'id':_0x1a4f8b['query'][_0x1ca9('0x64')]},'attributes':['id'],'include':[{'model':db[_0x1ca9('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1ca9('0x28')](handleEntityNotFound(_0x46390a,null))[_0x1ca9('0x28')](function(_0x5da55b){var _0x5b271b=_['map'](_0x5da55b,'id');var _0x26b90e=[];var _0x1e5d04=[];var _0x5cdf2c=squel[_0x1ca9('0x71')]();_0x5cdf2c['field']('tq.TeamId')[_0x1ca9('0x72')]('team_has_fax_queues','tq')[_0x1ca9('0x73')](_0x1ca9('0x74'),'ut',_0x1ca9('0x75'))[_0x1ca9('0x3d')](_0x1ca9('0x76'),_0x1a4f8b[_0x1ca9('0x56')]['id']);for(var _0x2a2e67=0x0;_0x2a2e67<_0x5da55b[_0x1ca9('0x4b')];_0x2a2e67+=0x1){let _0x4ae65e=_0x5da55b[_0x2a2e67];for(var _0x23c994=0x0;_0x23c994<_0x4ae65e[_0x1ca9('0x67')][_0x1ca9('0x4b')];_0x23c994+=0x1){let _0x1f3a2e=_0x4ae65e['Agents'][_0x23c994];var _0x5af634=_0x5cdf2c[_0x1ca9('0x77')]();_0x5af634['where'](_0x1ca9('0x78'),_0x1f3a2e['id']);_0x1e5d04['push'](db['sequelize'][_0x1ca9('0x35')](_0x5af634[_0x1ca9('0x79')](),{'type':db[_0x1ca9('0x6c')][_0x1ca9('0x7a')]['SELECT']})[_0x1ca9('0x28')](function(_0x5bb0b3){if(_0x5bb0b3['length']===0x1){return _0x1f3a2e['id'];}else{var _0x598d2f=_[_0x1ca9('0x7b')](_[_0x1ca9('0x2f')](_0x5bb0b3,'TeamId'),function(_0x1d1d9a){return _['includes'](_0x5b271b,_0x1d1d9a);});if(_0x598d2f){return _0x1f3a2e['id'];}}}));}}return BPromise['all'](_0x1e5d04)['then'](function(_0x29911a){_0x26b90e=_(_0x26b90e)['union'](_0x29911a)['compact']()[_0x1ca9('0x7c')]();return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1a4f8b[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](function(_0x4c81f0){return db['sequelize'][_0x1ca9('0x7d')](function(_0x32ce34){return _0x4c81f0[_0x1ca9('0x70')](_0x1a4f8b[_0x1ca9('0x35')][_0x1ca9('0x64')],{'transaction':_0x32ce34})[_0x1ca9('0x28')](function(){if(!_[_0x1ca9('0x7e')](_0x26b90e)){return _0x4c81f0['removeAgents'](_0x26b90e,{'transaction':_0x32ce34});}})[_0x1ca9('0x28')](function(){_0x26b90e[_0x1ca9('0x7f')](function(_0xf42bd0){socket[_0x1ca9('0x80')](_0x1ca9('0x81'),{'UserId':_0xf42bd0,'FaxQueueId':_0x4c81f0['id']});});});});});});})[_0x1ca9('0x28')](respondWithStatusCode(_0x46390a,null))[_0x1ca9('0x49')](handleError(_0x46390a,null));};exports[_0x1ca9('0x82')]=function(_0x1a7a6b,_0x17cbe9,_0x4801ef){return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1a7a6b[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x17cbe9,null))['then'](function(_0x4181fd){if(_0x4181fd){return _0x4181fd[_0x1ca9('0x82')](_0x1a7a6b[_0x1ca9('0x55')][_0x1ca9('0x64')],_['omit'](_0x1a7a6b[_0x1ca9('0x55')],[_0x1ca9('0x64'),'id'])||{})[_0x1ca9('0x83')](function(_0x197501){for(var _0x3d1ecf=0x0;_0x3d1ecf<_0x1a7a6b['body']['ids']['length'];_0x3d1ecf+=0x1){socket[_0x1ca9('0x80')](_0x1ca9('0x6f'),{'UserId':Number(_0x1a7a6b[_0x1ca9('0x55')]['ids'][_0x3d1ecf]),'FaxQueueId':Number(_0x1a7a6b['params']['id'])});}return _0x197501;});}})[_0x1ca9('0x28')](respondWithResult(_0x17cbe9,null))['catch'](handleError(_0x17cbe9,null));};exports[_0x1ca9('0x84')]=function(_0x4726c8,_0xcc9769,_0x154bfc){return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x4726c8[_0x1ca9('0x56')]['id']}})['then'](handleEntityNotFound(_0xcc9769,null))[_0x1ca9('0x28')](function(_0x1b6166){if(_0x1b6166){return _0x1b6166[_0x1ca9('0x84')](_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')])[_0x1ca9('0x28')](function(){if(_['isArray'](_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')])){for(var _0x1a9919=0x0;_0x1a9919<_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')]['length'];_0x1a9919+=0x1){socket[_0x1ca9('0x80')](_0x1ca9('0x81'),{'UserId':Number(_0x4726c8['query']['ids'][_0x1a9919]),'FaxQueueId':Number(_0x4726c8[_0x1ca9('0x56')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')]),'FaxQueueId':Number(_0x4726c8[_0x1ca9('0x56')]['id'])});}});}})[_0x1ca9('0x28')](respondWithStatusCode(_0xcc9769,null))[_0x1ca9('0x49')](handleError(_0xcc9769,null));};exports[_0x1ca9('0x85')]=function(_0xef30b8,_0x4bae4e,_0x266a5c){var _0x188286={};var _0x27276d={};var _0x54ef72;var _0xee48c9;return db[_0x1ca9('0x30')][_0x1ca9('0x86')]({'where':{'id':_0xef30b8[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x4bae4e,null))[_0x1ca9('0x28')](function(_0x39aa5e){if(_0x39aa5e){_0x54ef72=_0x39aa5e;_0x27276d['model']=_[_0x1ca9('0x36')](db[_0x1ca9('0x66')][_0x1ca9('0x4a')]);_0x27276d[_0x1ca9('0x35')]=_['keys'](_0xef30b8[_0x1ca9('0x35')]);_0x27276d[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x27276d[_0x1ca9('0x34')],_0x27276d[_0x1ca9('0x35')]);_0x188286[_0x1ca9('0x38')]=_['intersection'](_0x27276d[_0x1ca9('0x34')],qs['fields'](_0xef30b8[_0x1ca9('0x35')]['fields']));_0x188286['attributes']=_0x188286['attributes']['length']?_0x188286['attributes']:_0x27276d[_0x1ca9('0x34')];_0x188286[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x188286[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0xef30b8[_0x1ca9('0x35')],_0x27276d[_0x1ca9('0x3e')]));if(_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x188286[_0x1ca9('0x3d')]=_[_0x1ca9('0x41')](_0x188286[_0x1ca9('0x3d')],{'$or':_[_0x1ca9('0x2f')](_0x188286[_0x1ca9('0x38')],function(_0x3fea03){var _0x22d33b={};_0x22d33b[_0x3fea03]={'$like':'%'+_0xef30b8['query']['filter']+'%'};return _0x22d33b;})});}_0x188286=_['merge']({},_0x188286,_0xef30b8[_0x1ca9('0x43')]);return _0x54ef72['getAgents'](_0x188286);}})[_0x1ca9('0x28')](function(_0x137df2){if(_0x137df2){_0xee48c9=_0x137df2[_0x1ca9('0x4b')];if(!_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x188286[_0x1ca9('0x1f')]=qs['limit'](_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x188286['offset']=qs[_0x1ca9('0x1e')](_0xef30b8[_0x1ca9('0x35')]['offset']);}return _0x54ef72[_0x1ca9('0x85')](_0x188286);}})[_0x1ca9('0x28')](function(_0x1ccaed){if(_0x1ccaed){return _0x1ccaed?{'count':_0xee48c9,'rows':_0x1ccaed}:null;}})[_0x1ca9('0x28')](respondWithResult(_0x4bae4e,null))[_0x1ca9('0x49')](handleError(_0x4bae4e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c78b1a0..66209f7 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 _0x5bbb=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x2dbbc1,_0x5cd851){var _0x3181cf=function(_0xe6a97b){while(--_0xe6a97b){_0x2dbbc1['push'](_0x2dbbc1['shift']());}};_0x3181cf(++_0x5cd851);}(_0x5bbb,0xe2));var _0xb5bb=function(_0x3530cc,_0x52fcae){_0x3530cc=_0x3530cc-0x0;var _0x4bb1ae=_0x5bbb[_0x3530cc];return _0x4bb1ae;};'use strict';var EventEmitter=require(_0xb5bb('0x0'));var FaxQueue=require(_0xb5bb('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb5bb('0x2'),'afterUpdate':'update','afterDestroy':_0xb5bb('0x3')};function emitEvent(_0x3e652e){return function(_0x427049,_0x4d37b9,_0x53253e){FaxQueueEvents[_0xb5bb('0x4')](_0x3e652e+':'+_0x427049['id'],_0x427049);FaxQueueEvents[_0xb5bb('0x4')](_0x3e652e,_0x427049);_0x53253e(null);};}for(var e in events){if(events[_0xb5bb('0x5')](e)){var event=events[e];FaxQueue[_0xb5bb('0x6')](e,emitEvent(event));}}module[_0xb5bb('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xb88d=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xb88d,0xd2));var _0xdb88=function(_0x2b390d,_0x29450c){_0x2b390d=_0x2b390d-0x0;var _0x35ae52=_0xb88d[_0x2b390d];return _0x35ae52;};'use strict';var EventEmitter=require(_0xdb88('0x0'));var FaxQueue=require(_0xdb88('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xdb88('0x2')](0x0);var events={'afterCreate':_0xdb88('0x3'),'afterUpdate':_0xdb88('0x4'),'afterDestroy':_0xdb88('0x5')};function emitEvent(_0x3d4982){return function(_0x413c2c,_0x24eb92,_0x3a4006){FaxQueueEvents['emit'](_0x3d4982+':'+_0x413c2c['id'],_0x413c2c);FaxQueueEvents[_0xdb88('0x6')](_0x3d4982,_0x413c2c);_0x3a4006(null);};}for(var e in events){if(events[_0xdb88('0x7')](e)){var event=events[e];FaxQueue[_0xdb88('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index c6fc74d..42f13c9 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 _0xfab2=['exports','define','FaxQueue','fax_queues','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x4e52f9,_0x3a4f90){var _0x46b380=function(_0x25d699){while(--_0x25d699){_0x4e52f9['push'](_0x4e52f9['shift']());}};_0x46b380(++_0x3a4f90);}(_0xfab2,0x72));var _0x2fab=function(_0x4c9f3c,_0x2b7b50){_0x4c9f3c=_0x4c9f3c-0x0;var _0x23a056=_0xfab2[_0x4c9f3c];return _0x23a056;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2fab('0x0'));var moment=require(_0x2fab('0x1'));var BPromise=require(_0x2fab('0x2'));var rp=require(_0x2fab('0x3'));var fs=require('fs');var path=require(_0x2fab('0x4'));var rimraf=require(_0x2fab('0x5'));var config=require('../../config/environment');var attributes=require(_0x2fab('0x6'));module[_0x2fab('0x7')]=function(_0x57152c,_0x53f673){return _0x57152c[_0x2fab('0x8')](_0x2fab('0x9'),attributes,{'tableName':_0x2fab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e4d=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2e4d,0x1e5));var _0xd2e4=function(_0x485261,_0x551505){_0x485261=_0x485261-0x0;var _0x1bfa98=_0x2e4d[_0x485261];return _0x1bfa98;};'use strict';var _=require(_0xd2e4('0x0'));var util=require(_0xd2e4('0x1'));var logger=require(_0xd2e4('0x2'))(_0xd2e4('0x3'));var moment=require('moment');var BPromise=require(_0xd2e4('0x4'));var rp=require(_0xd2e4('0x5'));var fs=require('fs');var path=require(_0xd2e4('0x6'));var rimraf=require(_0xd2e4('0x7'));var config=require(_0xd2e4('0x8'));var attributes=require(_0xd2e4('0x9'));module[_0xd2e4('0xa')]=function(_0x5a52bb,_0x1910d2){return _0x5a52bb[_0xd2e4('0xb')](_0xd2e4('0xc'),attributes,{'tableName':_0xd2e4('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 4971cf3..c819b00 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 _0xd309=['rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowFaxQueue','find','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xd309,0x19d));var _0x9d30=function(_0x58da00,_0x32dc71){_0x58da00=_0x58da00-0x0;var _0x1ee07f=_0xd309[_0x58da00];return _0x1ee07f;};'use strict';var _=require(_0x9d30('0x0'));var util=require(_0x9d30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d30('0x2'));var fs=require('fs');var Redis=require(_0x9d30('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d30('0x4'));var logger=require('../../config/logger')(_0x9d30('0x5'));var config=require(_0x9d30('0x6'));var jayson=require(_0x9d30('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x9d30('0x8')]=_['defaults'](config[_0x9d30('0x8')],{'host':_0x9d30('0x9'),'port':0x18eb});var socket=require(_0x9d30('0xa'))(new Redis(config[_0x9d30('0x8')]));require(_0x9d30('0xb'))[_0x9d30('0xc')](socket);function respondWithRpcPromise(_0x330b50,_0x249b22,_0x1c65e8){return new BPromise(function(_0x582272,_0x30da86){return client['request'](_0x330b50,_0x1c65e8)[_0x9d30('0xd')](function(_0x15c67e){logger[_0x9d30('0xe')]('FaxQueue,\x20%s,\x20%s',_0x249b22,'request\x20sent');logger[_0x9d30('0xf')](_0x9d30('0x10'),_0x249b22,_0x9d30('0x11'),JSON[_0x9d30('0x12')](_0x15c67e));if(_0x15c67e[_0x9d30('0x13')]){if(_0x15c67e[_0x9d30('0x13')][_0x9d30('0x14')]===0x1f4){logger['error'](_0x9d30('0x15'),_0x249b22,_0x15c67e[_0x9d30('0x13')][_0x9d30('0x16')]);return _0x30da86(_0x15c67e['error'][_0x9d30('0x16')]);}logger[_0x9d30('0x13')](_0x9d30('0x15'),_0x249b22,_0x15c67e[_0x9d30('0x13')][_0x9d30('0x16')]);return _0x582272(_0x15c67e[_0x9d30('0x13')][_0x9d30('0x16')]);}else{logger[_0x9d30('0xe')](_0x9d30('0x15'),_0x249b22,'request\x20sent');_0x582272(_0x15c67e[_0x9d30('0x17')][_0x9d30('0x16')]);}})['catch'](function(_0x13a3ed){logger[_0x9d30('0x13')]('FaxQueue,\x20%s,\x20%s',_0x249b22,_0x13a3ed);_0x30da86(_0x13a3ed);});});}exports[_0x9d30('0x18')]=function(_0xae1134){var _0x22751a=this;return new Promise(function(_0x42e391,_0x5be791){return db[_0x9d30('0x19')][_0x9d30('0x1a')]({'raw':_0xae1134[_0x9d30('0x1b')]?_0xae1134[_0x9d30('0x1b')][_0x9d30('0x1c')]===undefined?!![]:![]:!![],'where':_0xae1134[_0x9d30('0x1b')]?_0xae1134['options'][_0x9d30('0x1d')]||null:null,'attributes':_0xae1134[_0x9d30('0x1b')]?_0xae1134[_0x9d30('0x1b')][_0x9d30('0x1e')]||null:null,'limit':_0xae1134[_0x9d30('0x1b')]?_0xae1134[_0x9d30('0x1b')][_0x9d30('0x1f')]||null:null,'include':_0xae1134[_0x9d30('0x1b')]?_0xae1134[_0x9d30('0x1b')][_0x9d30('0x20')]?_[_0x9d30('0x21')](_0xae1134['options']['include'],function(_0x55038f){return{'model':db[_0x55038f[_0x9d30('0x22')]],'as':_0x55038f['as'],'attributes':_0x55038f['attributes'],'include':_0x55038f[_0x9d30('0x20')]?_[_0x9d30('0x21')](_0x55038f[_0x9d30('0x20')],function(_0x336e1c){return{'model':db[_0x336e1c[_0x9d30('0x22')]],'as':_0x336e1c['as'],'attributes':_0x336e1c[_0x9d30('0x1e')],'include':_0x336e1c[_0x9d30('0x20')]?_['map'](_0x336e1c[_0x9d30('0x20')],function(_0x2805d5){return{'model':db[_0x2805d5[_0x9d30('0x22')]],'as':_0x2805d5['as'],'attributes':_0x2805d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d30('0xd')](function(_0x3782c7){logger[_0x9d30('0xe')](_0x9d30('0x18'),_0xae1134);logger[_0x9d30('0xf')](_0x9d30('0x18'),_0xae1134,JSON['stringify'](_0x3782c7));_0x42e391(_0x3782c7);})[_0x9d30('0x23')](function(_0xa6b2c2){logger['error'](_0x9d30('0x18'),_0xa6b2c2[_0x9d30('0x16')],_0xae1134);_0x5be791(_0x22751a[_0x9d30('0x13')](0x1f4,_0xa6b2c2[_0x9d30('0x16')]));});});};exports[_0x9d30('0x24')]=function(_0x4c8462){var _0x4ac269=this;return new Promise(function(_0x50a4e9,_0x494843){return db[_0x9d30('0x19')][_0x9d30('0x25')]({'raw':_0x4c8462['options']?_0x4c8462[_0x9d30('0x1b')][_0x9d30('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c8462[_0x9d30('0x1b')]?_0x4c8462[_0x9d30('0x1b')][_0x9d30('0x1d')]||null:null,'attributes':_0x4c8462[_0x9d30('0x1b')]?_0x4c8462[_0x9d30('0x1b')][_0x9d30('0x1e')]||null:null,'include':_0x4c8462[_0x9d30('0x1b')]?_0x4c8462[_0x9d30('0x1b')][_0x9d30('0x20')]?_['map'](_0x4c8462[_0x9d30('0x1b')][_0x9d30('0x20')],function(_0xd22d16){return{'model':db[_0xd22d16[_0x9d30('0x22')]],'as':_0xd22d16['as'],'attributes':_0xd22d16[_0x9d30('0x1e')],'include':_0xd22d16[_0x9d30('0x20')]?_[_0x9d30('0x21')](_0xd22d16[_0x9d30('0x20')],function(_0x517387){return{'model':db[_0x517387[_0x9d30('0x22')]],'as':_0x517387['as'],'attributes':_0x517387[_0x9d30('0x1e')],'include':_0x517387['include']?_[_0x9d30('0x21')](_0x517387[_0x9d30('0x20')],function(_0x32987a){return{'model':db[_0x32987a[_0x9d30('0x22')]],'as':_0x32987a['as'],'attributes':_0x32987a[_0x9d30('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1912eb){logger[_0x9d30('0xe')](_0x9d30('0x24'),_0x4c8462);logger['debug'](_0x9d30('0x24'),_0x4c8462,JSON['stringify'](_0x1912eb));_0x50a4e9(_0x1912eb);})[_0x9d30('0x23')](function(_0x523a7){logger[_0x9d30('0x13')](_0x9d30('0x24'),_0x523a7['message'],_0x4c8462);_0x494843(_0x4ac269[_0x9d30('0x13')](0x1f4,_0x523a7[_0x9d30('0x16')]));});});}; \ No newline at end of file +var _0xb85b=['client','defaults','localhost','redis','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','stringify','ShowFaxQueue','find','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb85b,0x67));var _0xbb85=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb85b[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xbb85('0x0'));var moment=require(_0xbb85('0x1'));var BPromise=require(_0xbb85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb85('0x3'));var db=require(_0xbb85('0x4'))['db'];var utils=require(_0xbb85('0x5'));var logger=require('../../config/logger')(_0xbb85('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb85('0x7'));var client=jayson[_0xbb85('0x8')]['http']({'port':0x232a});config['redis']=_[_0xbb85('0x9')](config['redis'],{'host':_0xbb85('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb85('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x426987,_0x263e77,_0x8d0ba8){return new BPromise(function(_0x32c032,_0x56c31c){return client[_0xbb85('0xc')](_0x426987,_0x8d0ba8)[_0xbb85('0xd')](function(_0x383859){logger[_0xbb85('0xe')](_0xbb85('0xf'),_0x263e77,_0xbb85('0x10'));logger[_0xbb85('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x263e77,'request\x20sent',JSON['stringify'](_0x383859));if(_0x383859[_0xbb85('0x12')]){if(_0x383859[_0xbb85('0x12')][_0xbb85('0x13')]===0x1f4){logger[_0xbb85('0x12')](_0xbb85('0xf'),_0x263e77,_0x383859[_0xbb85('0x12')][_0xbb85('0x14')]);return _0x56c31c(_0x383859['error'][_0xbb85('0x14')]);}logger[_0xbb85('0x12')]('FaxQueue,\x20%s,\x20%s',_0x263e77,_0x383859[_0xbb85('0x12')]['message']);return _0x32c032(_0x383859[_0xbb85('0x12')][_0xbb85('0x14')]);}else{logger[_0xbb85('0xe')](_0xbb85('0xf'),_0x263e77,_0xbb85('0x10'));_0x32c032(_0x383859[_0xbb85('0x15')][_0xbb85('0x14')]);}})[_0xbb85('0x16')](function(_0x5a7e88){logger[_0xbb85('0x12')](_0xbb85('0xf'),_0x263e77,_0x5a7e88);_0x56c31c(_0x5a7e88);});});}exports[_0xbb85('0x17')]=function(_0x10afa7){var _0x7c03fb=this;return new Promise(function(_0x75187e,_0x352cbf){return db[_0xbb85('0x18')][_0xbb85('0x19')]({'raw':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1b')]===undefined?!![]:![]:!![],'where':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1c')]||null:null,'attributes':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1d')]||null:null,'limit':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7['options'][_0xbb85('0x1e')]||null:null,'include':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1f')]?_['map'](_0x10afa7['options'][_0xbb85('0x1f')],function(_0x5f1cbd){return{'model':db[_0x5f1cbd['model']],'as':_0x5f1cbd['as'],'attributes':_0x5f1cbd[_0xbb85('0x1d')],'include':_0x5f1cbd[_0xbb85('0x1f')]?_['map'](_0x5f1cbd[_0xbb85('0x1f')],function(_0x44963c){return{'model':db[_0x44963c['model']],'as':_0x44963c['as'],'attributes':_0x44963c[_0xbb85('0x1d')],'include':_0x44963c[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x44963c[_0xbb85('0x1f')],function(_0x2f7d2f){return{'model':db[_0x2f7d2f['model']],'as':_0x2f7d2f['as'],'attributes':_0x2f7d2f[_0xbb85('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb85('0xd')](function(_0xbc347b){logger[_0xbb85('0xe')]('GetFaxQueue',_0x10afa7);logger[_0xbb85('0x11')](_0xbb85('0x17'),_0x10afa7,JSON[_0xbb85('0x21')](_0xbc347b));_0x75187e(_0xbc347b);})[_0xbb85('0x16')](function(_0x11f676){logger[_0xbb85('0x12')](_0xbb85('0x17'),_0x11f676[_0xbb85('0x14')],_0x10afa7);_0x352cbf(_0x7c03fb[_0xbb85('0x12')](0x1f4,_0x11f676[_0xbb85('0x14')]));});});};exports[_0xbb85('0x22')]=function(_0x41167c){var _0x1624cd=this;return new Promise(function(_0x5df4d7,_0x2eedd3){return db['FaxQueue'][_0xbb85('0x23')]({'raw':_0x41167c[_0xbb85('0x1a')]?_0x41167c['options']['raw']===undefined?!![]:![]:!![],'where':_0x41167c[_0xbb85('0x1a')]?_0x41167c[_0xbb85('0x1a')][_0xbb85('0x1c')]||null:null,'attributes':_0x41167c[_0xbb85('0x1a')]?_0x41167c['options']['attributes']||null:null,'include':_0x41167c[_0xbb85('0x1a')]?_0x41167c[_0xbb85('0x1a')][_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x41167c['options']['include'],function(_0x2f6387){return{'model':db[_0x2f6387[_0xbb85('0x24')]],'as':_0x2f6387['as'],'attributes':_0x2f6387[_0xbb85('0x1d')],'include':_0x2f6387[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x2f6387[_0xbb85('0x1f')],function(_0x2e298b){return{'model':db[_0x2e298b['model']],'as':_0x2e298b['as'],'attributes':_0x2e298b[_0xbb85('0x1d')],'include':_0x2e298b[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x2e298b[_0xbb85('0x1f')],function(_0x2e04f5){return{'model':db[_0x2e04f5[_0xbb85('0x24')]],'as':_0x2e04f5['as'],'attributes':_0x2e04f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb85('0xd')](function(_0x1914cc){logger[_0xbb85('0xe')](_0xbb85('0x22'),_0x41167c);logger[_0xbb85('0x11')](_0xbb85('0x22'),_0x41167c,JSON[_0xbb85('0x21')](_0x1914cc));_0x5df4d7(_0x1914cc);})['catch'](function(_0x26bb29){logger[_0xbb85('0x12')](_0xbb85('0x22'),_0x26bb29[_0xbb85('0x14')],_0x41167c);_0x2eedd3(_0x1624cd['error'](0x1f4,_0x26bb29[_0xbb85('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b581f9d..a4df972 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 _0xf404=['./faxQueue.events','update','emit','register','length','faxQueue:'];(function(_0x54cb98,_0x41f762){var _0x34feed=function(_0x2e1b64){while(--_0x2e1b64){_0x54cb98['push'](_0x54cb98['shift']());}};_0x34feed(++_0x41f762);}(_0xf404,0x120));var _0x4f40=function(_0x2aebbb,_0x358b3a){_0x2aebbb=_0x2aebbb-0x0;var _0x56c0df=_0xf404[_0x2aebbb];return _0x56c0df;};'use strict';var FaxQueueEvents=require(_0x4f40('0x0'));var events=['save','remove',_0x4f40('0x1')];function createListener(_0x2005b0,_0x2332d6){return function(_0x4eec91){_0x2332d6[_0x4f40('0x2')](_0x2005b0,_0x4eec91);};}function removeListener(_0x598af2,_0x61ed76){return function(){FaxQueueEvents['removeListener'](_0x598af2,_0x61ed76);};}exports[_0x4f40('0x3')]=function(_0x49bd76){for(var _0x3f3af7=0x0,_0x1aea28=events[_0x4f40('0x4')];_0x3f3af7<_0x1aea28;_0x3f3af7++){var _0x45970a=events[_0x3f3af7];var _0x23e3eb=createListener(_0x4f40('0x5')+_0x45970a,_0x49bd76);FaxQueueEvents['on'](_0x45970a,_0x23e3eb);}}; \ No newline at end of file +var _0x808f=['save','remove','emit','register','length'];(function(_0xdd50a9,_0xe452c4){var _0x51d71e=function(_0x4322ff){while(--_0x4322ff){_0xdd50a9['push'](_0xdd50a9['shift']());}};_0x51d71e(++_0xe452c4);}(_0x808f,0x1ea));var _0xf808=function(_0xa5e821,_0x4dd2f6){_0xa5e821=_0xa5e821-0x0;var _0x62d0cd=_0x808f[_0xa5e821];return _0x62d0cd;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf808('0x0'),_0xf808('0x1'),'update'];function createListener(_0x526ef8,_0x19ba9c){return function(_0x59d101){_0x19ba9c[_0xf808('0x2')](_0x526ef8,_0x59d101);};}function removeListener(_0xdbfe2f,_0x49b073){return function(){FaxQueueEvents['removeListener'](_0xdbfe2f,_0x49b073);};}exports[_0xf808('0x3')]=function(_0x3b7d50){for(var _0xbaabac=0x0,_0x479cf1=events[_0xf808('0x4')];_0xbaabac<_0x479cf1;_0xbaabac++){var _0x1e4b11=events[_0xbaabac];var _0x5c9dbb=createListener('faxQueue:'+_0x1e4b11,_0x3b7d50);FaxQueueEvents['on'](_0x1e4b11,_0x5c9dbb);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 90aaef8..e940a3d 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 _0xb4b6=['addAgents','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x1111f6,_0x3a24e0){_0x1111f6=_0x1111f6-0x0;var _0x5036b5=_0xb4b6[_0x1111f6];return _0x5036b5;};'use strict';var multer=require('multer');var util=require(_0x6b4b('0x0'));var path=require(_0x6b4b('0x1'));var timeout=require(_0x6b4b('0x2'));var express=require(_0x6b4b('0x3'));var router=express[_0x6b4b('0x4')]();var fs_extra=require(_0x6b4b('0x5'));var auth=require(_0x6b4b('0x6'));var interaction=require(_0x6b4b('0x7'));var config=require(_0x6b4b('0x8'));var controller=require('./faxQueue.controller');router[_0x6b4b('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b4b('0xa')]);router[_0x6b4b('0x9')](_0x6b4b('0xb'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0xd')]);router['get'](_0x6b4b('0xe'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0xf')]);router[_0x6b4b('0x9')](_0x6b4b('0x10'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x11')]);router[_0x6b4b('0x9')]('/:id/teams',auth[_0x6b4b('0xc')](),controller['getTeams']);router[_0x6b4b('0x9')](_0x6b4b('0x12'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x13')]);router[_0x6b4b('0x14')]('/',auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x15')]);router['post'](_0x6b4b('0x16'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x17')]);router['post']('/:id/users',auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x18')]);router['put'](_0x6b4b('0xe'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x19')]);router[_0x6b4b('0x1a')](_0x6b4b('0xe'),auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x1b')]);router[_0x6b4b('0x1a')](_0x6b4b('0x16'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x6b4b('0x1a')]('/:id/users',auth[_0x6b4b('0xc')](),controller[_0x6b4b('0x1c')]);module[_0x6b4b('0x1d')]=router; \ No newline at end of file +var _0x0a6b=['update','destroy','delete','removeTeams','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','index','/describe','describe','show','get','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x77fcad,_0xeebb41){_0x77fcad=_0x77fcad-0x0;var _0x3d032e=_0x0a6b[_0x77fcad];return _0x3d032e;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')](_0xb0a6('0xc'),auth[_0xb0a6('0x6')](),controller['getMembers']);router[_0xb0a6('0xb')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0xe')]);router[_0xb0a6('0xb')](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x10')]);router[_0xb0a6('0x11')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x12')]);router[_0xb0a6('0x11')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0x13')]);router['post'](_0xb0a6('0xf'),auth['isAuthenticated'](),controller[_0xb0a6('0x14')]);router['put'](_0xb0a6('0x15'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x16')]);router['delete']('/:id',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x17')]);router[_0xb0a6('0x18')](_0xb0a6('0xd'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x19')]);router['delete'](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x1a')]);module[_0xb0a6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 079c7d1..66423bb 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 _0x696d=['DATE','sequelize','exports','STRING'];(function(_0x208e5b,_0x39eac7){var _0xec1bb5=function(_0x52a558){while(--_0x52a558){_0x208e5b['push'](_0x208e5b['shift']());}};_0xec1bb5(++_0x39eac7);}(_0x696d,0xdd));var _0xd696=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x696d[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require('moment');var Sequelize=require(_0xd696('0x0'));module[_0xd696('0x1')]={'uniqueid':{'type':Sequelize[_0xd696('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd696('0x2')]},'joinAt':{'type':Sequelize[_0xd696('0x3')]},'leaveAt':{'type':Sequelize[_0xd696('0x3')]},'acceptAt':{'type':Sequelize[_0xd696('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd696('0x2')]}}; \ No newline at end of file +var _0x6ff9=['STRING','DATE','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ff9,0x167));var _0x96ff=function(_0x260183,_0x4294f2){_0x260183=_0x260183-0x0;var _0x30ce38=_0x6ff9[_0x260183];return _0x30ce38;};'use strict';var moment=require('moment');var Sequelize=require(_0x96ff('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x96ff('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x96ff('0x1')]},'joinAt':{'type':Sequelize[_0x96ff('0x2')]},'leaveAt':{'type':Sequelize[_0x96ff('0x2')]},'acceptAt':{'type':Sequelize[_0x96ff('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 968e3ac..46e4c34 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 _0x885e=['mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x53b929,_0x26f710){var _0x38e906=function(_0x12a283){while(--_0x12a283){_0x53b929['push'](_0x53b929['shift']());}};_0x38e906(++_0x26f710);}(_0x885e,0xe4));var _0xe885=function(_0x1f5682,_0x541b20){_0x1f5682=_0x1f5682-0x0;var _0x54102f=_0x885e[_0x1f5682];return _0x54102f;};'use strict';var emlformat=require(_0xe885('0x0'));var rimraf=require(_0xe885('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe885('0x2'));var rp=require(_0xe885('0x3'));var moment=require(_0xe885('0x4'));var BPromise=require(_0xe885('0x5'));var Mustache=require(_0xe885('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe885('0x7'));var csv=require(_0xe885('0x8'));var ejs=require(_0xe885('0x9'));var fs=require('fs');var fs_extra=require(_0xe885('0xa'));var _=require('lodash');var squel=require(_0xe885('0xb'));var crypto=require('crypto');var jsforce=require(_0xe885('0xc'));var deskjs=require(_0xe885('0xd'));var toCsv=require(_0xe885('0x8'));var querystring=require(_0xe885('0xe'));var Papa=require(_0xe885('0xf'));var Redis=require(_0xe885('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe885('0x11'));var as=require(_0xe885('0x12'));var hardwareService=require(_0xe885('0x13'));var logger=require(_0xe885('0x14'))(_0xe885('0x15'));var utils=require(_0xe885('0x16'));var config=require(_0xe885('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe885('0x18'))['db'];function respondWithStatusCode(_0x5a9697,_0x457e0f){_0x457e0f=_0x457e0f||0xcc;return function(_0x2fc609){if(_0x2fc609){return _0x5a9697[_0xe885('0x19')](_0x457e0f);}return _0x5a9697[_0xe885('0x1a')](_0x457e0f)[_0xe885('0x1b')]();};}function respondWithResult(_0x5c7442,_0x51c10d){_0x51c10d=_0x51c10d||0xc8;return function(_0x497c18){if(_0x497c18){return _0x5c7442[_0xe885('0x1a')](_0x51c10d)[_0xe885('0x1c')](_0x497c18);}};}function respondWithFilteredResult(_0x2bf6a9,_0x443399){return function(_0x494738){if(_0x494738){var _0x516a0f=typeof _0x443399[_0xe885('0x1d')]==='undefined'&&typeof _0x443399[_0xe885('0x1e')]===_0xe885('0x1f');var _0x4176a4=_0x494738[_0xe885('0x20')];var _0x25a002=_0x516a0f?0x0:_0x443399[_0xe885('0x1d')];var _0x4f5045=_0x516a0f?_0x494738[_0xe885('0x20')]:_0x443399[_0xe885('0x1d')]+_0x443399[_0xe885('0x1e')];var _0x4142a2;if(_0x4f5045>=_0x4176a4){_0x4f5045=_0x4176a4;_0x4142a2=0xc8;}else{_0x4142a2=0xce;}_0x2bf6a9[_0xe885('0x1a')](_0x4142a2);return _0x2bf6a9[_0xe885('0x21')](_0xe885('0x22'),_0x25a002+'-'+_0x4f5045+'/'+_0x4176a4)['json'](_0x494738);}return null;};}function patchUpdates(_0x159624){return function(_0x7ed861){try{jsonpatch[_0xe885('0x23')](_0x7ed861,_0x159624,!![]);}catch(_0x30cc04){return BPromise[_0xe885('0x24')](_0x30cc04);}return _0x7ed861[_0xe885('0x25')]();};}function saveUpdates(_0x221832,_0x4375ff){return function(_0x84a30f){if(_0x84a30f){return _0x84a30f[_0xe885('0x26')](_0x221832)[_0xe885('0x27')](function(_0x6d229a){return _0x6d229a;});}return null;};}function removeEntity(_0x581f03,_0x5b7f07){return function(_0x3e5868){if(_0x3e5868){return _0x3e5868[_0xe885('0x28')]()[_0xe885('0x27')](function(){_0x581f03[_0xe885('0x1a')](0xcc)[_0xe885('0x1b')]();});}};}function handleEntityNotFound(_0x50dd42,_0x249abc){return function(_0x1cac46){if(!_0x1cac46){_0x50dd42[_0xe885('0x19')](0x194);}return _0x1cac46;};}function handleError(_0x4b4049,_0x524190){_0x524190=_0x524190||0x1f4;return function(_0x2ba36e){logger[_0xe885('0x29')](_0x2ba36e[_0xe885('0x2a')]);if(_0x2ba36e[_0xe885('0x2b')]){delete _0x2ba36e[_0xe885('0x2b')];}_0x4b4049['status'](_0x524190)['send'](_0x2ba36e);};}exports[_0xe885('0x2c')]=function(_0xa4916f,_0x1701bd){var _0x4bbbcb={},_0x370a10={},_0x1d7c84={'count':0x0,'rows':[]};var _0x2b56a8=_[_0xe885('0x2d')](db[_0xe885('0x2e')][_0xe885('0x2f')],function(_0x1187c0){return{'name':_0x1187c0[_0xe885('0x30')],'type':_0x1187c0[_0xe885('0x31')]['key']};});_0x370a10['model']=_[_0xe885('0x2d')](_0x2b56a8,_0xe885('0x2b'));_0x370a10[_0xe885('0x32')]=_['keys'](_0xa4916f['query']);_0x370a10[_0xe885('0x33')]=_[_0xe885('0x34')](_0x370a10[_0xe885('0x35')],_0x370a10[_0xe885('0x32')]);_0x4bbbcb[_0xe885('0x36')]=_[_0xe885('0x34')](_0x370a10[_0xe885('0x35')],qs['fields'](_0xa4916f[_0xe885('0x32')]['fields']));_0x4bbbcb['attributes']=_0x4bbbcb['attributes'][_0xe885('0x37')]?_0x4bbbcb[_0xe885('0x36')]:_0x370a10[_0xe885('0x35')];if(!_0xa4916f['query'][_0xe885('0x38')](_0xe885('0x39'))){_0x4bbbcb[_0xe885('0x1e')]=qs[_0xe885('0x1e')](_0xa4916f[_0xe885('0x32')]['limit']);_0x4bbbcb['offset']=qs[_0xe885('0x1d')](_0xa4916f['query'][_0xe885('0x1d')]);}_0x4bbbcb[_0xe885('0x3a')]=qs[_0xe885('0x3b')](_0xa4916f[_0xe885('0x32')][_0xe885('0x3b')]);_0x4bbbcb['where']=qs[_0xe885('0x33')](_[_0xe885('0x3c')](_0xa4916f['query'],_0x370a10['filters']),_0x2b56a8);if(_0xa4916f['query'][_0xe885('0x3d')]){_0x4bbbcb[_0xe885('0x3e')]=_[_0xe885('0x3f')](_0x4bbbcb[_0xe885('0x3e')],{'$or':_['map'](_0x2b56a8,function(_0x116428){if(_0x116428[_0xe885('0x31')]!==_0xe885('0x40')){var _0x3ec257={};_0x3ec257[_0x116428['name']]={'$like':'%'+_0xa4916f['query']['filter']+'%'};return _0x3ec257;}})});}_0x4bbbcb=_[_0xe885('0x3f')]({},_0x4bbbcb,_0xa4916f[_0xe885('0x41')]);var _0x442ca4={'where':_0x4bbbcb[_0xe885('0x3e')]};return db[_0xe885('0x2e')][_0xe885('0x20')](_0x442ca4)[_0xe885('0x27')](function(_0x45870a){_0x1d7c84[_0xe885('0x20')]=_0x45870a;if(_0xa4916f[_0xe885('0x32')][_0xe885('0x42')]){_0x4bbbcb[_0xe885('0x43')]=[{'all':!![]}];}return db[_0xe885('0x2e')][_0xe885('0x44')](_0x4bbbcb);})[_0xe885('0x27')](function(_0x49f74c){_0x1d7c84[_0xe885('0x45')]=_0x49f74c;return _0x1d7c84;})['then'](respondWithFilteredResult(_0x1701bd,_0x4bbbcb))[_0xe885('0x46')](handleError(_0x1701bd,null));};exports[_0xe885('0x47')]=function(_0x5a710c,_0x51898d){var _0x7a2219={'raw':!![],'where':{'id':_0x5a710c[_0xe885('0x48')]['id']}},_0x3339f4={};_0x3339f4[_0xe885('0x35')]=_[_0xe885('0x49')](db[_0xe885('0x2e')][_0xe885('0x2f')]);_0x3339f4[_0xe885('0x32')]=_[_0xe885('0x49')](_0x5a710c[_0xe885('0x32')]);_0x3339f4[_0xe885('0x33')]=_[_0xe885('0x34')](_0x3339f4[_0xe885('0x35')],_0x3339f4[_0xe885('0x32')]);_0x7a2219[_0xe885('0x36')]=_['intersection'](_0x3339f4[_0xe885('0x35')],qs['fields'](_0x5a710c[_0xe885('0x32')][_0xe885('0x4a')]));_0x7a2219['attributes']=_0x7a2219[_0xe885('0x36')][_0xe885('0x37')]?_0x7a2219[_0xe885('0x36')]:_0x3339f4['model'];if(_0x5a710c['query'][_0xe885('0x42')]){_0x7a2219[_0xe885('0x43')]=[{'all':!![]}];}_0x7a2219=_[_0xe885('0x3f')]({},_0x7a2219,_0x5a710c[_0xe885('0x41')]);return db[_0xe885('0x2e')]['find'](_0x7a2219)[_0xe885('0x27')](handleEntityNotFound(_0x51898d,null))[_0xe885('0x27')](respondWithResult(_0x51898d,null))[_0xe885('0x46')](handleError(_0x51898d,null));};exports['create']=function(_0x4dad7c,_0x51a285){return db[_0xe885('0x2e')]['create'](_0x4dad7c[_0xe885('0x4b')],{})[_0xe885('0x27')](respondWithResult(_0x51a285,0xc9))[_0xe885('0x46')](handleError(_0x51a285,null));};exports[_0xe885('0x26')]=function(_0x20fcee,_0x5d736c){if(_0x20fcee[_0xe885('0x4b')]['id']){delete _0x20fcee['body']['id'];}return db[_0xe885('0x2e')][_0xe885('0x4c')]({'where':{'id':_0x20fcee[_0xe885('0x48')]['id']}})[_0xe885('0x27')](handleEntityNotFound(_0x5d736c,null))[_0xe885('0x27')](saveUpdates(_0x20fcee[_0xe885('0x4b')],null))[_0xe885('0x27')](respondWithResult(_0x5d736c,null))[_0xe885('0x46')](handleError(_0x5d736c,null));};exports[_0xe885('0x28')]=function(_0x5f4531,_0x11ce41){return db[_0xe885('0x2e')]['find']({'where':{'id':_0x5f4531['params']['id']}})['then'](handleEntityNotFound(_0x11ce41,null))[_0xe885('0x27')](removeEntity(_0x11ce41,null))[_0xe885('0x46')](handleError(_0x11ce41,null));};exports[_0xe885('0x4d')]=function(_0x3b866b,_0x4194a8){return db[_0xe885('0x2e')][_0xe885('0x4d')]()['then'](respondWithResult(_0x4194a8,null))['catch'](handleError(_0x4194a8,null));}; \ No newline at end of file +var _0xc9c3=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x2e4de6,_0x14e66f){var _0x25a586=function(_0x49dc7f){while(--_0x49dc7f){_0x2e4de6['push'](_0x2e4de6['shift']());}};_0x25a586(++_0x14e66f);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x7435a5,_0x445685){_0x7435a5=_0x7435a5-0x0;var _0x28f290=_0xc9c3[_0x7435a5];return _0x28f290;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c9c('0x0'));var zipdir=require(_0x3c9c('0x1'));var jsonpatch=require(_0x3c9c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require('util');var path=require(_0x3c9c('0x5'));var sox=require(_0x3c9c('0x6'));var csv=require(_0x3c9c('0x7'));var ejs=require(_0x3c9c('0x8'));var fs=require('fs');var fs_extra=require(_0x3c9c('0x9'));var _=require(_0x3c9c('0xa'));var squel=require(_0x3c9c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0x7'));var querystring=require('querystring');var Papa=require(_0x3c9c('0xd'));var Redis=require(_0x3c9c('0xe'));var authService=require(_0x3c9c('0xf'));var qs=require(_0x3c9c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c9c('0x11'))(_0x3c9c('0x12'));var utils=require(_0x3c9c('0x13'));var config=require(_0x3c9c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53bd31,_0x4a092d){_0x4a092d=_0x4a092d||0xcc;return function(_0x6d0a1a){if(_0x6d0a1a){return _0x53bd31[_0x3c9c('0x15')](_0x4a092d);}return _0x53bd31['status'](_0x4a092d)[_0x3c9c('0x16')]();};}function respondWithResult(_0x50a62d,_0x2de024){_0x2de024=_0x2de024||0xc8;return function(_0x12dd2d){if(_0x12dd2d){return _0x50a62d[_0x3c9c('0x17')](_0x2de024)['json'](_0x12dd2d);}};}function respondWithFilteredResult(_0x1940fa,_0x59fb0f){return function(_0x3b9fef){if(_0x3b9fef){var _0x4b9b7f=typeof _0x59fb0f[_0x3c9c('0x18')]===_0x3c9c('0x19')&&typeof _0x59fb0f[_0x3c9c('0x1a')]==='undefined';var _0x16841a=_0x3b9fef['count'];var _0x39da0d=_0x4b9b7f?0x0:_0x59fb0f[_0x3c9c('0x18')];var _0x1d8e47=_0x4b9b7f?_0x3b9fef[_0x3c9c('0x1b')]:_0x59fb0f[_0x3c9c('0x18')]+_0x59fb0f[_0x3c9c('0x1a')];var _0x445d1f;if(_0x1d8e47>=_0x16841a){_0x1d8e47=_0x16841a;_0x445d1f=0xc8;}else{_0x445d1f=0xce;}_0x1940fa[_0x3c9c('0x17')](_0x445d1f);return _0x1940fa[_0x3c9c('0x1c')](_0x3c9c('0x1d'),_0x39da0d+'-'+_0x1d8e47+'/'+_0x16841a)[_0x3c9c('0x1e')](_0x3b9fef);}return null;};}function patchUpdates(_0x398479){return function(_0x4ec5b3){try{jsonpatch[_0x3c9c('0x1f')](_0x4ec5b3,_0x398479,!![]);}catch(_0x5a393d){return BPromise['reject'](_0x5a393d);}return _0x4ec5b3[_0x3c9c('0x20')]();};}function saveUpdates(_0x17e73d,_0x281757){return function(_0x564139){if(_0x564139){return _0x564139['update'](_0x17e73d)[_0x3c9c('0x21')](function(_0x52534c){return _0x52534c;});}return null;};}function removeEntity(_0x5a9ed3,_0x219076){return function(_0x32161b){if(_0x32161b){return _0x32161b['destroy']()[_0x3c9c('0x21')](function(){_0x5a9ed3[_0x3c9c('0x17')](0xcc)[_0x3c9c('0x16')]();});}};}function handleEntityNotFound(_0x169ba4,_0x43c18b){return function(_0x335bb4){if(!_0x335bb4){_0x169ba4['sendStatus'](0x194);}return _0x335bb4;};}function handleError(_0x643593,_0x599d1b){_0x599d1b=_0x599d1b||0x1f4;return function(_0x52924e){logger[_0x3c9c('0x22')](_0x52924e[_0x3c9c('0x23')]);if(_0x52924e[_0x3c9c('0x24')]){delete _0x52924e[_0x3c9c('0x24')];}_0x643593[_0x3c9c('0x17')](_0x599d1b)[_0x3c9c('0x25')](_0x52924e);};}exports[_0x3c9c('0x26')]=function(_0x43046d,_0x24e8d6){var _0x52c9bb={},_0x10511f={},_0x2d2e90={'count':0x0,'rows':[]};var _0xf04bab=_['map'](db['FaxQueueReport'][_0x3c9c('0x27')],function(_0x3bdccc){return{'name':_0x3bdccc[_0x3c9c('0x28')],'type':_0x3bdccc['type'][_0x3c9c('0x29')]};});_0x10511f[_0x3c9c('0x2a')]=_['map'](_0xf04bab,_0x3c9c('0x24'));_0x10511f[_0x3c9c('0x2b')]=_['keys'](_0x43046d[_0x3c9c('0x2b')]);_0x10511f[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x10511f[_0x3c9c('0x2a')],_0x10511f[_0x3c9c('0x2b')]);_0x52c9bb[_0x3c9c('0x2e')]=_[_0x3c9c('0x2d')](_0x10511f[_0x3c9c('0x2a')],qs[_0x3c9c('0x2f')](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x2f')]));_0x52c9bb[_0x3c9c('0x2e')]=_0x52c9bb[_0x3c9c('0x2e')][_0x3c9c('0x30')]?_0x52c9bb[_0x3c9c('0x2e')]:_0x10511f[_0x3c9c('0x2a')];if(!_0x43046d[_0x3c9c('0x2b')]['hasOwnProperty'](_0x3c9c('0x31'))){_0x52c9bb[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x43046d[_0x3c9c('0x2b')]['limit']);_0x52c9bb[_0x3c9c('0x18')]=qs[_0x3c9c('0x18')](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x18')]);}_0x52c9bb[_0x3c9c('0x32')]=qs['sort'](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x33')]);_0x52c9bb[_0x3c9c('0x34')]=qs[_0x3c9c('0x2c')](_[_0x3c9c('0x35')](_0x43046d[_0x3c9c('0x2b')],_0x10511f[_0x3c9c('0x2c')]),_0xf04bab);if(_0x43046d['query'][_0x3c9c('0x36')]){_0x52c9bb[_0x3c9c('0x34')]=_[_0x3c9c('0x37')](_0x52c9bb[_0x3c9c('0x34')],{'$or':_['map'](_0xf04bab,function(_0x40b744){if(_0x40b744['type']!==_0x3c9c('0x38')){var _0x58aa4f={};_0x58aa4f[_0x40b744[_0x3c9c('0x24')]]={'$like':'%'+_0x43046d['query'][_0x3c9c('0x36')]+'%'};return _0x58aa4f;}})});}_0x52c9bb=_['merge']({},_0x52c9bb,_0x43046d[_0x3c9c('0x39')]);var _0x2dcc58={'where':_0x52c9bb[_0x3c9c('0x34')]};return db[_0x3c9c('0x3a')]['count'](_0x2dcc58)[_0x3c9c('0x21')](function(_0xd2d3e7){_0x2d2e90['count']=_0xd2d3e7;if(_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x3b')]){_0x52c9bb[_0x3c9c('0x3c')]=[{'all':!![]}];}return db[_0x3c9c('0x3a')][_0x3c9c('0x3d')](_0x52c9bb);})['then'](function(_0x489b6e){_0x2d2e90['rows']=_0x489b6e;return _0x2d2e90;})['then'](respondWithFilteredResult(_0x24e8d6,_0x52c9bb))[_0x3c9c('0x3e')](handleError(_0x24e8d6,null));};exports[_0x3c9c('0x3f')]=function(_0x371c13,_0x289c12){var _0x511a1f={'raw':!![],'where':{'id':_0x371c13['params']['id']}},_0x2a47c6={};_0x2a47c6[_0x3c9c('0x2a')]=_[_0x3c9c('0x40')](db[_0x3c9c('0x3a')][_0x3c9c('0x27')]);_0x2a47c6[_0x3c9c('0x2b')]=_[_0x3c9c('0x40')](_0x371c13['query']);_0x2a47c6[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x2a47c6[_0x3c9c('0x2a')],_0x2a47c6[_0x3c9c('0x2b')]);_0x511a1f[_0x3c9c('0x2e')]=_[_0x3c9c('0x2d')](_0x2a47c6[_0x3c9c('0x2a')],qs[_0x3c9c('0x2f')](_0x371c13[_0x3c9c('0x2b')]['fields']));_0x511a1f['attributes']=_0x511a1f[_0x3c9c('0x2e')][_0x3c9c('0x30')]?_0x511a1f[_0x3c9c('0x2e')]:_0x2a47c6[_0x3c9c('0x2a')];if(_0x371c13['query'][_0x3c9c('0x3b')]){_0x511a1f[_0x3c9c('0x3c')]=[{'all':!![]}];}_0x511a1f=_[_0x3c9c('0x37')]({},_0x511a1f,_0x371c13[_0x3c9c('0x39')]);return db[_0x3c9c('0x3a')][_0x3c9c('0x41')](_0x511a1f)[_0x3c9c('0x21')](handleEntityNotFound(_0x289c12,null))[_0x3c9c('0x21')](respondWithResult(_0x289c12,null))[_0x3c9c('0x3e')](handleError(_0x289c12,null));};exports[_0x3c9c('0x42')]=function(_0xe866e0,_0xe5b0c7){return db[_0x3c9c('0x3a')]['create'](_0xe866e0[_0x3c9c('0x43')],{})['then'](respondWithResult(_0xe5b0c7,0xc9))[_0x3c9c('0x3e')](handleError(_0xe5b0c7,null));};exports['update']=function(_0x59f4cf,_0x3d3f67){if(_0x59f4cf['body']['id']){delete _0x59f4cf[_0x3c9c('0x43')]['id'];}return db[_0x3c9c('0x3a')][_0x3c9c('0x41')]({'where':{'id':_0x59f4cf[_0x3c9c('0x44')]['id']}})[_0x3c9c('0x21')](handleEntityNotFound(_0x3d3f67,null))[_0x3c9c('0x21')](saveUpdates(_0x59f4cf[_0x3c9c('0x43')],null))[_0x3c9c('0x21')](respondWithResult(_0x3d3f67,null))[_0x3c9c('0x3e')](handleError(_0x3d3f67,null));};exports[_0x3c9c('0x45')]=function(_0x4bb1d9,_0x2cd997){return db[_0x3c9c('0x3a')]['find']({'where':{'id':_0x4bb1d9[_0x3c9c('0x44')]['id']}})[_0x3c9c('0x21')](handleEntityNotFound(_0x2cd997,null))[_0x3c9c('0x21')](removeEntity(_0x2cd997,null))[_0x3c9c('0x3e')](handleError(_0x2cd997,null));};exports[_0x3c9c('0x46')]=function(_0x54ecd0,_0x45d1eb){return db[_0x3c9c('0x3a')][_0x3c9c('0x46')]()[_0x3c9c('0x21')](respondWithResult(_0x45d1eb,null))[_0x3c9c('0x3e')](handleError(_0x45d1eb,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index dbdce03..682501c 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x196ce1,_0x46e836){var _0x360a64=function(_0x3f339f){while(--_0x3f339f){_0x196ce1['push'](_0x196ce1['shift']());}};_0x360a64(++_0x46e836);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0x5fc3[_0x2ecc65];return _0x103cc3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x229d1f,_0x56de56){var _0x5e04e0=function(_0x9a1f4b){while(--_0x9a1f4b){_0x229d1f['push'](_0x229d1f['shift']());}};_0x5e04e0(++_0x56de56);}(_0x4975,0x86));var _0x5497=function(_0x10d161,_0xf5b101){_0x10d161=_0x10d161-0x0;var _0x5ba9e5=_0x4975[_0x10d161];return _0x5ba9e5;};'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':[{'name':_0x5497('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 c845858..191b214 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 _0xfcc4=['../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','UpdateFaxQueueReport','body','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x22073d,_0x4c0327){var _0x14b138=function(_0x300d88){while(--_0x300d88){_0x22073d['push'](_0x22073d['shift']());}};_0x14b138(++_0x4c0327);}(_0xfcc4,0x107));var _0x4fcc=function(_0x58c053,_0x51c43f){_0x58c053=_0x58c053-0x0;var _0xe1079=_0xfcc4[_0x58c053];return _0xe1079;};'use strict';var _=require(_0x4fcc('0x0'));var util=require(_0x4fcc('0x1'));var moment=require(_0x4fcc('0x2'));var BPromise=require(_0x4fcc('0x3'));var rs=require(_0x4fcc('0x4'));var fs=require('fs');var Redis=require(_0x4fcc('0x5'));var db=require(_0x4fcc('0x6'))['db'];var utils=require(_0x4fcc('0x7'));var logger=require('../../config/logger')(_0x4fcc('0x8'));var config=require(_0x4fcc('0x9'));var jayson=require(_0x4fcc('0xa'));var client=jayson[_0x4fcc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ba47b,_0x15400b,_0x18458c){return new BPromise(function(_0x52c9c8,_0x185e9d){return client[_0x4fcc('0xc')](_0x1ba47b,_0x18458c)[_0x4fcc('0xd')](function(_0x1b4092){logger[_0x4fcc('0xe')](_0x4fcc('0xf'),_0x15400b,_0x4fcc('0x10'));logger[_0x4fcc('0x11')](_0x4fcc('0x12'),_0x15400b,_0x4fcc('0x10'),JSON[_0x4fcc('0x13')](_0x1b4092));if(_0x1b4092[_0x4fcc('0x14')]){if(_0x1b4092[_0x4fcc('0x14')][_0x4fcc('0x15')]===0x1f4){logger[_0x4fcc('0x14')](_0x4fcc('0xf'),_0x15400b,_0x1b4092[_0x4fcc('0x14')][_0x4fcc('0x16')]);return _0x185e9d(_0x1b4092[_0x4fcc('0x14')]['message']);}logger[_0x4fcc('0x14')](_0x4fcc('0xf'),_0x15400b,_0x1b4092[_0x4fcc('0x14')][_0x4fcc('0x16')]);return _0x52c9c8(_0x1b4092[_0x4fcc('0x14')][_0x4fcc('0x16')]);}else{logger[_0x4fcc('0xe')](_0x4fcc('0xf'),_0x15400b,_0x4fcc('0x10'));_0x52c9c8(_0x1b4092[_0x4fcc('0x17')][_0x4fcc('0x16')]);}})[_0x4fcc('0x18')](function(_0x25a74a){logger[_0x4fcc('0x14')](_0x4fcc('0xf'),_0x15400b,_0x25a74a);_0x185e9d(_0x25a74a);});});}exports[_0x4fcc('0x19')]=function(_0x2f9949){var _0x34b807=this;return new Promise(function(_0x214b83,_0x479f12){return db[_0x4fcc('0x1a')][_0x4fcc('0x1b')](_0x2f9949['body'],{'raw':_0x2f9949['options']?_0x2f9949[_0x4fcc('0x1c')][_0x4fcc('0x1d')]===undefined?!![]:![]:!![]})[_0x4fcc('0xd')](function(_0x51a2ba){logger['info'](_0x4fcc('0x19'),_0x2f9949);logger[_0x4fcc('0x11')](_0x4fcc('0x19'),_0x2f9949,JSON[_0x4fcc('0x13')](_0x51a2ba));_0x214b83(_0x51a2ba);})[_0x4fcc('0x18')](function(_0x43e3c5){logger[_0x4fcc('0x14')](_0x4fcc('0x19'),_0x43e3c5[_0x4fcc('0x16')],_0x2f9949);_0x479f12(_0x34b807['error'](0x1f4,_0x43e3c5[_0x4fcc('0x16')]));});});};exports[_0x4fcc('0x1e')]=function(_0x375692){var _0x547e17=this;return new Promise(function(_0x1eed0e,_0x57f902){return db[_0x4fcc('0x1a')]['update'](_0x375692[_0x4fcc('0x1f')],{'raw':_0x375692[_0x4fcc('0x1c')]?_0x375692[_0x4fcc('0x1c')][_0x4fcc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x375692[_0x4fcc('0x1c')]?_0x375692[_0x4fcc('0x1c')][_0x4fcc('0x20')]||null:null,'attributes':_0x375692[_0x4fcc('0x1c')]?_0x375692[_0x4fcc('0x1c')][_0x4fcc('0x21')]||null:null,'limit':_0x375692[_0x4fcc('0x1c')]?_0x375692['options']['limit']||null:null})['then'](function(_0x257412){logger['info'](_0x4fcc('0x1e'),_0x375692);logger['debug']('UpdateFaxQueueReport',_0x375692,JSON[_0x4fcc('0x13')](_0x257412));_0x1eed0e(_0x257412);})[_0x4fcc('0x18')](function(_0x208256){logger['error']('UpdateFaxQueueReport',_0x208256[_0x4fcc('0x16')],_0x375692);_0x57f902(_0x547e17['error'](0x1f4,_0x208256['message']));});});}; \ No newline at end of file +var _0xe17b=['jayson/promise','http','info','request\x20sent','debug','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then','UpdateFaxQueueReport','update','body','attributes','limit','catch','util','moment','../../mysqldb','../../config/environment'];(function(_0x1141ca,_0x3c7c0d){var _0x11eae5=function(_0x5034e7){while(--_0x5034e7){_0x1141ca['push'](_0x1141ca['shift']());}};_0x11eae5(++_0x3c7c0d);}(_0xe17b,0xb9));var _0xbe17=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0xe17b[_0x11e03f];return _0x5666fe;};'use strict';var _=require('lodash');var util=require(_0xbe17('0x0'));var moment=require(_0xbe17('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe17('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbe17('0x3'));var jayson=require(_0xbe17('0x4'));var client=jayson['client'][_0xbe17('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1e5fc9,_0x2953f6,_0x48bf88){return new BPromise(function(_0x876e,_0x3dd8ea){return client['request'](_0x1e5fc9,_0x48bf88)['then'](function(_0x42897d){logger[_0xbe17('0x6')]('FaxQueueReport,\x20%s,\x20%s',_0x2953f6,_0xbe17('0x7'));logger[_0xbe17('0x8')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2953f6,_0xbe17('0x7'),JSON[_0xbe17('0x9')](_0x42897d));if(_0x42897d[_0xbe17('0xa')]){if(_0x42897d[_0xbe17('0xa')][_0xbe17('0xb')]===0x1f4){logger[_0xbe17('0xa')](_0xbe17('0xc'),_0x2953f6,_0x42897d['error'][_0xbe17('0xd')]);return _0x3dd8ea(_0x42897d['error'][_0xbe17('0xd')]);}logger[_0xbe17('0xa')](_0xbe17('0xc'),_0x2953f6,_0x42897d[_0xbe17('0xa')][_0xbe17('0xd')]);return _0x876e(_0x42897d['error'][_0xbe17('0xd')]);}else{logger[_0xbe17('0x6')]('FaxQueueReport,\x20%s,\x20%s',_0x2953f6,'request\x20sent');_0x876e(_0x42897d[_0xbe17('0xe')][_0xbe17('0xd')]);}})['catch'](function(_0xa8493c){logger['error'](_0xbe17('0xc'),_0x2953f6,_0xa8493c);_0x3dd8ea(_0xa8493c);});});}exports[_0xbe17('0xf')]=function(_0xea464c){var _0x34448e=this;return new Promise(function(_0x4816ef,_0x536cef){return db[_0xbe17('0x10')][_0xbe17('0x11')](_0xea464c['body'],{'raw':_0xea464c[_0xbe17('0x12')]?_0xea464c[_0xbe17('0x12')][_0xbe17('0x13')]===undefined?!![]:![]:!![]})[_0xbe17('0x14')](function(_0x2fe62f){logger[_0xbe17('0x6')](_0xbe17('0xf'),_0xea464c);logger[_0xbe17('0x8')](_0xbe17('0xf'),_0xea464c,JSON['stringify'](_0x2fe62f));_0x4816ef(_0x2fe62f);})['catch'](function(_0x3410d5){logger[_0xbe17('0xa')]('CreateFaxQueueReport',_0x3410d5[_0xbe17('0xd')],_0xea464c);_0x536cef(_0x34448e[_0xbe17('0xa')](0x1f4,_0x3410d5[_0xbe17('0xd')]));});});};exports[_0xbe17('0x15')]=function(_0x3a499c){var _0x5f073d=this;return new Promise(function(_0x2870d0,_0x4e92a8){return db[_0xbe17('0x10')][_0xbe17('0x16')](_0x3a499c[_0xbe17('0x17')],{'raw':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')]['where']||null:null,'attributes':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')][_0xbe17('0x18')]||null:null,'limit':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')][_0xbe17('0x19')]||null:null})[_0xbe17('0x14')](function(_0x387eec){logger[_0xbe17('0x6')](_0xbe17('0x15'),_0x3a499c);logger['debug'](_0xbe17('0x15'),_0x3a499c,JSON[_0xbe17('0x9')](_0x387eec));_0x2870d0(_0x387eec);})[_0xbe17('0x1a')](function(_0x14f188){logger['error'](_0xbe17('0x15'),_0x14f188[_0xbe17('0xd')],_0x3a499c);_0x4e92a8(_0x5f073d[_0xbe17('0xa')](0x1f4,_0x14f188[_0xbe17('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c709605..ce2d398 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 _0x86dc=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x2ee76c,_0x29ee6d){var _0xff1711=function(_0x3d6425){while(--_0x3d6425){_0x2ee76c['push'](_0x2ee76c['shift']());}};_0xff1711(++_0x29ee6d);}(_0x86dc,0x1cb));var _0xc86d=function(_0xe98855,_0x377bef){_0xe98855=_0xe98855-0x0;var _0xfcc067=_0x86dc[_0xe98855];return _0xfcc067;};'use strict';var multer=require(_0xc86d('0x0'));var util=require('util');var path=require(_0xc86d('0x1'));var timeout=require(_0xc86d('0x2'));var express=require(_0xc86d('0x3'));var router=express[_0xc86d('0x4')]();var fs_extra=require(_0xc86d('0x5'));var auth=require(_0xc86d('0x6'));var interaction=require(_0xc86d('0x7'));var config=require(_0xc86d('0x8'));var controller=require(_0xc86d('0x9'));router[_0xc86d('0xa')]('/',auth[_0xc86d('0xb')](),controller['index']);router['get'](_0xc86d('0xc'),auth[_0xc86d('0xb')](),controller[_0xc86d('0xd')]);router[_0xc86d('0xa')](_0xc86d('0xe'),auth['isAuthenticated'](),controller[_0xc86d('0xf')]);router[_0xc86d('0x10')]('/',auth[_0xc86d('0xb')](),controller[_0xc86d('0x11')]);router[_0xc86d('0x12')]('/:id',auth[_0xc86d('0xb')](),controller[_0xc86d('0x13')]);router['delete'](_0xc86d('0xe'),auth['isAuthenticated'](),controller[_0xc86d('0x14')]);module[_0xc86d('0x15')]=router; \ No newline at end of file +var _0x9532=['multer','express','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9532,0x130));var _0x2953=function(_0x4ad89c,_0x290f55){_0x4ad89c=_0x4ad89c-0x0;var _0x53e5fd=_0x9532[_0x4ad89c];return _0x53e5fd;};'use strict';var multer=require(_0x2953('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2953('0x1'));var router=express['Router']();var fs_extra=require(_0x2953('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2953('0x3'));var config=require(_0x2953('0x4'));var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2953('0x5')]);router['get'](_0x2953('0x6'),auth[_0x2953('0x7')](),controller[_0x2953('0x8')]);router[_0x2953('0x9')](_0x2953('0xa'),auth[_0x2953('0x7')](),controller[_0x2953('0xb')]);router[_0x2953('0xc')]('/',auth['isAuthenticated'](),controller[_0x2953('0xd')]);router[_0x2953('0xe')](_0x2953('0xa'),auth['isAuthenticated'](),controller[_0x2953('0xf')]);router[_0x2953('0x10')](_0x2953('0xa'),auth[_0x2953('0x7')](),controller[_0x2953('0x11')]);module[_0x2953('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3850331..87cb28f 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x31c073,_0x4ebd93){var _0x501ce9=function(_0x3dc84b){while(--_0x3dc84b){_0x31c073['push'](_0x31c073['shift']());}};_0x501ce9(++_0x4ebd93);}(_0xe706,0xa3));var _0x6e70=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0xe706[_0x1265fa];return _0x1fe35e;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x354279,_0x1573a9){var _0x55db41=function(_0x159f95){while(--_0x159f95){_0x354279['push'](_0x354279['shift']());}};_0x55db41(++_0x1573a9);}(_0x008c,0x188));var _0xc008=function(_0x17791f,_0x1d16d8){_0x17791f=_0x17791f-0x0;var _0x332dc4=_0x008c[_0x17791f];return _0x332dc4;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0f0edc2..099e8fc 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 _0x8ead=['key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','FaxTransferReport','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type'];(function(_0x3df910,_0x4dc0bc){var _0x315473=function(_0x5efb6c){while(--_0x5efb6c){_0x3df910['push'](_0x3df910['shift']());}};_0x315473(++_0x4dc0bc);}(_0x8ead,0x14f));var _0xd8ea=function(_0x37d3cf,_0x526d29){_0x37d3cf=_0x37d3cf-0x0;var _0x2779c4=_0x8ead[_0x37d3cf];return _0x2779c4;};'use strict';var emlformat=require(_0xd8ea('0x0'));var rimraf=require(_0xd8ea('0x1'));var zipdir=require(_0xd8ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8ea('0x3'));var moment=require('moment');var BPromise=require(_0xd8ea('0x4'));var Mustache=require(_0xd8ea('0x5'));var util=require(_0xd8ea('0x6'));var path=require(_0xd8ea('0x7'));var sox=require(_0xd8ea('0x8'));var csv=require(_0xd8ea('0x9'));var ejs=require(_0xd8ea('0xa'));var fs=require('fs');var fs_extra=require(_0xd8ea('0xb'));var _=require(_0xd8ea('0xc'));var squel=require(_0xd8ea('0xd'));var crypto=require(_0xd8ea('0xe'));var jsforce=require(_0xd8ea('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd8ea('0x10'));var Redis=require(_0xd8ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd8ea('0x12'));var as=require(_0xd8ea('0x13'));var hardwareService=require(_0xd8ea('0x14'));var logger=require('../../config/logger')(_0xd8ea('0x15'));var utils=require(_0xd8ea('0x16'));var config=require(_0xd8ea('0x17'));var licenseUtil=require(_0xd8ea('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6f2a,_0x4e3dc4){_0x4e3dc4=_0x4e3dc4||0xcc;return function(_0x1beec6){if(_0x1beec6){return _0x1e6f2a['sendStatus'](_0x4e3dc4);}return _0x1e6f2a[_0xd8ea('0x19')](_0x4e3dc4)[_0xd8ea('0x1a')]();};}function respondWithResult(_0x401f88,_0x232de4){_0x232de4=_0x232de4||0xc8;return function(_0x77b4b){if(_0x77b4b){return _0x401f88[_0xd8ea('0x19')](_0x232de4)[_0xd8ea('0x1b')](_0x77b4b);}};}function respondWithFilteredResult(_0x1f93a2,_0x3ad221){return function(_0xecb715){if(_0xecb715){var _0x5ba43c=typeof _0x3ad221[_0xd8ea('0x1c')]===_0xd8ea('0x1d')&&typeof _0x3ad221[_0xd8ea('0x1e')]===_0xd8ea('0x1d');var _0x2e269b=_0xecb715[_0xd8ea('0x1f')];var _0x5ba761=_0x5ba43c?0x0:_0x3ad221[_0xd8ea('0x1c')];var _0x30a1dc=_0x5ba43c?_0xecb715[_0xd8ea('0x1f')]:_0x3ad221[_0xd8ea('0x1c')]+_0x3ad221[_0xd8ea('0x1e')];var _0x92d2d2;if(_0x30a1dc>=_0x2e269b){_0x30a1dc=_0x2e269b;_0x92d2d2=0xc8;}else{_0x92d2d2=0xce;}_0x1f93a2[_0xd8ea('0x19')](_0x92d2d2);return _0x1f93a2['set'](_0xd8ea('0x20'),_0x5ba761+'-'+_0x30a1dc+'/'+_0x2e269b)[_0xd8ea('0x1b')](_0xecb715);}return null;};}function patchUpdates(_0x386a3b){return function(_0x4b408a){try{jsonpatch[_0xd8ea('0x21')](_0x4b408a,_0x386a3b,!![]);}catch(_0x1212b3){return BPromise[_0xd8ea('0x22')](_0x1212b3);}return _0x4b408a['save']();};}function saveUpdates(_0x195937,_0x340dcf){return function(_0x45a2af){if(_0x45a2af){return _0x45a2af[_0xd8ea('0x23')](_0x195937)[_0xd8ea('0x24')](function(_0x447fbc){return _0x447fbc;});}return null;};}function removeEntity(_0x506abd,_0xae0129){return function(_0x362551){if(_0x362551){return _0x362551['destroy']()['then'](function(){_0x506abd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4349d3,_0x3bdcb5){return function(_0x5033d2){if(!_0x5033d2){_0x4349d3[_0xd8ea('0x25')](0x194);}return _0x5033d2;};}function handleError(_0xb6c5c8,_0x41613f){_0x41613f=_0x41613f||0x1f4;return function(_0x28994){logger[_0xd8ea('0x26')](_0x28994[_0xd8ea('0x27')]);if(_0x28994[_0xd8ea('0x28')]){delete _0x28994[_0xd8ea('0x28')];}_0xb6c5c8[_0xd8ea('0x19')](_0x41613f)['send'](_0x28994);};}exports['index']=function(_0x551993,_0x5df62d){var _0x53879a={},_0x1f83e4={},_0x4bfe9a={'count':0x0,'rows':[]};var _0x120bdf=_[_0xd8ea('0x29')](db['FaxTransferReport'][_0xd8ea('0x2a')],function(_0x4ee5b1){return{'name':_0x4ee5b1[_0xd8ea('0x2b')],'type':_0x4ee5b1[_0xd8ea('0x2c')][_0xd8ea('0x2d')]};});_0x1f83e4[_0xd8ea('0x2e')]=_[_0xd8ea('0x29')](_0x120bdf,_0xd8ea('0x28'));_0x1f83e4[_0xd8ea('0x2f')]=_[_0xd8ea('0x30')](_0x551993[_0xd8ea('0x2f')]);_0x1f83e4[_0xd8ea('0x31')]=_['intersection'](_0x1f83e4[_0xd8ea('0x2e')],_0x1f83e4[_0xd8ea('0x2f')]);_0x53879a[_0xd8ea('0x32')]=_[_0xd8ea('0x33')](_0x1f83e4[_0xd8ea('0x2e')],qs[_0xd8ea('0x34')](_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x34')]));_0x53879a['attributes']=_0x53879a[_0xd8ea('0x32')][_0xd8ea('0x35')]?_0x53879a[_0xd8ea('0x32')]:_0x1f83e4['model'];if(!_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x36')](_0xd8ea('0x37'))){_0x53879a['limit']=qs[_0xd8ea('0x1e')](_0x551993['query'][_0xd8ea('0x1e')]);_0x53879a[_0xd8ea('0x1c')]=qs[_0xd8ea('0x1c')](_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x1c')]);}_0x53879a[_0xd8ea('0x38')]=qs[_0xd8ea('0x39')](_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x39')]);_0x53879a[_0xd8ea('0x3a')]=qs['filters'](_['pick'](_0x551993[_0xd8ea('0x2f')],_0x1f83e4[_0xd8ea('0x31')]),_0x120bdf);if(_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x3b')]){_0x53879a[_0xd8ea('0x3a')]=_[_0xd8ea('0x3c')](_0x53879a[_0xd8ea('0x3a')],{'$or':_['map'](_0x120bdf,function(_0x411a6b){if(_0x411a6b[_0xd8ea('0x2c')]!==_0xd8ea('0x3d')){var _0x9e7eaa={};_0x9e7eaa[_0x411a6b[_0xd8ea('0x28')]]={'$like':'%'+_0x551993[_0xd8ea('0x2f')][_0xd8ea('0x3b')]+'%'};return _0x9e7eaa;}})});}_0x53879a=_[_0xd8ea('0x3c')]({},_0x53879a,_0x551993[_0xd8ea('0x3e')]);var _0x1ac2d9={'where':_0x53879a[_0xd8ea('0x3a')]};return db['FaxTransferReport']['count'](_0x1ac2d9)[_0xd8ea('0x24')](function(_0x5f1bfd){_0x4bfe9a['count']=_0x5f1bfd;if(_0x551993[_0xd8ea('0x2f')]['includeAll']){_0x53879a[_0xd8ea('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xd8ea('0x40')](_0x53879a);})[_0xd8ea('0x24')](function(_0x5107ce){_0x4bfe9a[_0xd8ea('0x41')]=_0x5107ce;return _0x4bfe9a;})[_0xd8ea('0x24')](respondWithFilteredResult(_0x5df62d,_0x53879a))[_0xd8ea('0x42')](handleError(_0x5df62d,null));};exports[_0xd8ea('0x43')]=function(_0x49e7f9,_0x396f63){var _0x3c28e0={'raw':!![],'where':{'id':_0x49e7f9[_0xd8ea('0x44')]['id']}},_0x1f376f={};_0x1f376f[_0xd8ea('0x2e')]=_[_0xd8ea('0x30')](db['FaxTransferReport'][_0xd8ea('0x2a')]);_0x1f376f[_0xd8ea('0x2f')]=_[_0xd8ea('0x30')](_0x49e7f9[_0xd8ea('0x2f')]);_0x1f376f[_0xd8ea('0x31')]=_[_0xd8ea('0x33')](_0x1f376f[_0xd8ea('0x2e')],_0x1f376f['query']);_0x3c28e0[_0xd8ea('0x32')]=_[_0xd8ea('0x33')](_0x1f376f[_0xd8ea('0x2e')],qs[_0xd8ea('0x34')](_0x49e7f9[_0xd8ea('0x2f')]['fields']));_0x3c28e0[_0xd8ea('0x32')]=_0x3c28e0[_0xd8ea('0x32')][_0xd8ea('0x35')]?_0x3c28e0[_0xd8ea('0x32')]:_0x1f376f[_0xd8ea('0x2e')];if(_0x49e7f9[_0xd8ea('0x2f')][_0xd8ea('0x45')]){_0x3c28e0['include']=[{'all':!![]}];}_0x3c28e0=_[_0xd8ea('0x3c')]({},_0x3c28e0,_0x49e7f9['options']);return db['FaxTransferReport']['find'](_0x3c28e0)[_0xd8ea('0x24')](handleEntityNotFound(_0x396f63,null))[_0xd8ea('0x24')](respondWithResult(_0x396f63,null))['catch'](handleError(_0x396f63,null));};exports[_0xd8ea('0x46')]=function(_0x17f79c,_0x28fa39){return db['FaxTransferReport'][_0xd8ea('0x46')](_0x17f79c[_0xd8ea('0x47')],{})[_0xd8ea('0x24')](respondWithResult(_0x28fa39,0xc9))['catch'](handleError(_0x28fa39,null));};exports[_0xd8ea('0x23')]=function(_0x570057,_0x38d9a2){if(_0x570057[_0xd8ea('0x47')]['id']){delete _0x570057[_0xd8ea('0x47')]['id'];}return db[_0xd8ea('0x48')][_0xd8ea('0x49')]({'where':{'id':_0x570057[_0xd8ea('0x44')]['id']}})[_0xd8ea('0x24')](handleEntityNotFound(_0x38d9a2,null))[_0xd8ea('0x24')](saveUpdates(_0x570057[_0xd8ea('0x47')],null))[_0xd8ea('0x24')](respondWithResult(_0x38d9a2,null))[_0xd8ea('0x42')](handleError(_0x38d9a2,null));};exports[_0xd8ea('0x4a')]=function(_0x48304b,_0x3046dc){return db['FaxTransferReport'][_0xd8ea('0x49')]({'where':{'id':_0x48304b[_0xd8ea('0x44')]['id']}})['then'](handleEntityNotFound(_0x3046dc,null))[_0xd8ea('0x24')](removeEntity(_0x3046dc,null))[_0xd8ea('0x42')](handleError(_0x3046dc,null));};exports[_0xd8ea('0x4b')]=function(_0x26b209,_0x3330a6){return db[_0xd8ea('0x48')][_0xd8ea('0x4b')]()[_0xd8ea('0x24')](respondWithResult(_0x3330a6,null))['catch'](handleError(_0x3330a6,null));}; \ No newline at end of file +var _0xc556=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0xae3fe2,_0x59fd02){var _0x2e4d8e=function(_0x424c0b){while(--_0x424c0b){_0xae3fe2['push'](_0xae3fe2['shift']());}};_0x2e4d8e(++_0x59fd02);}(_0xc556,0x95));var _0x6c55=function(_0x105367,_0x2d2d4d){_0x105367=_0x105367-0x0;var _0x294beb=_0xc556[_0x105367];return _0x294beb;};'use strict';var emlformat=require(_0x6c55('0x0'));var rimraf=require(_0x6c55('0x1'));var zipdir=require(_0x6c55('0x2'));var jsonpatch=require(_0x6c55('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c55('0x4'));var path=require(_0x6c55('0x5'));var sox=require('sox');var csv=require(_0x6c55('0x6'));var ejs=require(_0x6c55('0x7'));var fs=require('fs');var fs_extra=require(_0x6c55('0x8'));var _=require(_0x6c55('0x9'));var squel=require(_0x6c55('0xa'));var crypto=require(_0x6c55('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c55('0xc'));var Papa=require(_0x6c55('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c55('0xe'));var as=require(_0x6c55('0xf'));var hardwareService=require(_0x6c55('0x10'));var logger=require(_0x6c55('0x11'))(_0x6c55('0x12'));var utils=require(_0x6c55('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x299e43,_0x332cb6){_0x332cb6=_0x332cb6||0xcc;return function(_0x2039e8){if(_0x2039e8){return _0x299e43[_0x6c55('0x14')](_0x332cb6);}return _0x299e43[_0x6c55('0x15')](_0x332cb6)[_0x6c55('0x16')]();};}function respondWithResult(_0x580970,_0x46407){_0x46407=_0x46407||0xc8;return function(_0x433b7a){if(_0x433b7a){return _0x580970[_0x6c55('0x15')](_0x46407)[_0x6c55('0x17')](_0x433b7a);}};}function respondWithFilteredResult(_0x19a7ce,_0x238a1f){return function(_0x2ec301){if(_0x2ec301){var _0x1a3555=typeof _0x238a1f[_0x6c55('0x18')]===_0x6c55('0x19')&&typeof _0x238a1f[_0x6c55('0x1a')]===_0x6c55('0x19');var _0x1b235c=_0x2ec301['count'];var _0x4514e4=_0x1a3555?0x0:_0x238a1f[_0x6c55('0x18')];var _0x46ec5e=_0x1a3555?_0x2ec301[_0x6c55('0x1b')]:_0x238a1f['offset']+_0x238a1f[_0x6c55('0x1a')];var _0x5114eb;if(_0x46ec5e>=_0x1b235c){_0x46ec5e=_0x1b235c;_0x5114eb=0xc8;}else{_0x5114eb=0xce;}_0x19a7ce[_0x6c55('0x15')](_0x5114eb);return _0x19a7ce[_0x6c55('0x1c')](_0x6c55('0x1d'),_0x4514e4+'-'+_0x46ec5e+'/'+_0x1b235c)[_0x6c55('0x17')](_0x2ec301);}return null;};}function patchUpdates(_0x24fd66){return function(_0xeeb843){try{jsonpatch['apply'](_0xeeb843,_0x24fd66,!![]);}catch(_0x2413f6){return BPromise[_0x6c55('0x1e')](_0x2413f6);}return _0xeeb843[_0x6c55('0x1f')]();};}function saveUpdates(_0x3eb66b,_0x372f67){return function(_0x4f2022){if(_0x4f2022){return _0x4f2022[_0x6c55('0x20')](_0x3eb66b)['then'](function(_0x13b690){return _0x13b690;});}return null;};}function removeEntity(_0x4d63e4,_0x1f4613){return function(_0x463b14){if(_0x463b14){return _0x463b14[_0x6c55('0x21')]()[_0x6c55('0x22')](function(){_0x4d63e4[_0x6c55('0x15')](0xcc)[_0x6c55('0x16')]();});}};}function handleEntityNotFound(_0x20b6ed,_0x3b615e){return function(_0x14dde5){if(!_0x14dde5){_0x20b6ed[_0x6c55('0x14')](0x194);}return _0x14dde5;};}function handleError(_0x3604d5,_0x3fee58){_0x3fee58=_0x3fee58||0x1f4;return function(_0x363306){logger[_0x6c55('0x23')](_0x363306[_0x6c55('0x24')]);if(_0x363306[_0x6c55('0x25')]){delete _0x363306[_0x6c55('0x25')];}_0x3604d5[_0x6c55('0x15')](_0x3fee58)[_0x6c55('0x26')](_0x363306);};}exports['index']=function(_0x57bb9c,_0x364144){var _0x24b78e={},_0x30fc94={},_0x1e7051={'count':0x0,'rows':[]};var _0x26cdc1=_[_0x6c55('0x27')](db[_0x6c55('0x28')][_0x6c55('0x29')],function(_0x580189){return{'name':_0x580189[_0x6c55('0x2a')],'type':_0x580189['type']['key']};});_0x30fc94[_0x6c55('0x2b')]=_[_0x6c55('0x27')](_0x26cdc1,_0x6c55('0x25'));_0x30fc94[_0x6c55('0x2c')]=_[_0x6c55('0x2d')](_0x57bb9c['query']);_0x30fc94[_0x6c55('0x2e')]=_[_0x6c55('0x2f')](_0x30fc94['model'],_0x30fc94[_0x6c55('0x2c')]);_0x24b78e['attributes']=_[_0x6c55('0x2f')](_0x30fc94[_0x6c55('0x2b')],qs[_0x6c55('0x30')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x30')]));_0x24b78e[_0x6c55('0x31')]=_0x24b78e['attributes'][_0x6c55('0x32')]?_0x24b78e['attributes']:_0x30fc94[_0x6c55('0x2b')];if(!_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x33')](_0x6c55('0x34'))){_0x24b78e[_0x6c55('0x1a')]=qs[_0x6c55('0x1a')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x1a')]);_0x24b78e['offset']=qs[_0x6c55('0x18')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x18')]);}_0x24b78e[_0x6c55('0x35')]=qs[_0x6c55('0x36')](_0x57bb9c['query'][_0x6c55('0x36')]);_0x24b78e[_0x6c55('0x37')]=qs['filters'](_[_0x6c55('0x38')](_0x57bb9c['query'],_0x30fc94[_0x6c55('0x2e')]),_0x26cdc1);if(_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x39')]){_0x24b78e[_0x6c55('0x37')]=_[_0x6c55('0x3a')](_0x24b78e[_0x6c55('0x37')],{'$or':_[_0x6c55('0x27')](_0x26cdc1,function(_0x4d877d){if(_0x4d877d[_0x6c55('0x3b')]!==_0x6c55('0x3c')){var _0x339c9c={};_0x339c9c[_0x4d877d[_0x6c55('0x25')]]={'$like':'%'+_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x39')]+'%'};return _0x339c9c;}})});}_0x24b78e=_[_0x6c55('0x3a')]({},_0x24b78e,_0x57bb9c[_0x6c55('0x3d')]);var _0x5a29c8={'where':_0x24b78e[_0x6c55('0x37')]};return db[_0x6c55('0x28')][_0x6c55('0x1b')](_0x5a29c8)['then'](function(_0x4c930a){_0x1e7051[_0x6c55('0x1b')]=_0x4c930a;if(_0x57bb9c[_0x6c55('0x2c')]['includeAll']){_0x24b78e[_0x6c55('0x3e')]=[{'all':!![]}];}return db[_0x6c55('0x28')][_0x6c55('0x3f')](_0x24b78e);})[_0x6c55('0x22')](function(_0x10774f){_0x1e7051[_0x6c55('0x40')]=_0x10774f;return _0x1e7051;})[_0x6c55('0x22')](respondWithFilteredResult(_0x364144,_0x24b78e))[_0x6c55('0x41')](handleError(_0x364144,null));};exports[_0x6c55('0x42')]=function(_0xd9472,_0x1613e0){var _0x4f5ba3={'raw':!![],'where':{'id':_0xd9472[_0x6c55('0x43')]['id']}},_0x4d9153={};_0x4d9153[_0x6c55('0x2b')]=_[_0x6c55('0x2d')](db[_0x6c55('0x28')][_0x6c55('0x29')]);_0x4d9153[_0x6c55('0x2c')]=_['keys'](_0xd9472['query']);_0x4d9153[_0x6c55('0x2e')]=_[_0x6c55('0x2f')](_0x4d9153['model'],_0x4d9153['query']);_0x4f5ba3['attributes']=_['intersection'](_0x4d9153[_0x6c55('0x2b')],qs[_0x6c55('0x30')](_0xd9472[_0x6c55('0x2c')][_0x6c55('0x30')]));_0x4f5ba3[_0x6c55('0x31')]=_0x4f5ba3[_0x6c55('0x31')][_0x6c55('0x32')]?_0x4f5ba3[_0x6c55('0x31')]:_0x4d9153['model'];if(_0xd9472[_0x6c55('0x2c')][_0x6c55('0x44')]){_0x4f5ba3['include']=[{'all':!![]}];}_0x4f5ba3=_[_0x6c55('0x3a')]({},_0x4f5ba3,_0xd9472[_0x6c55('0x3d')]);return db['FaxTransferReport'][_0x6c55('0x45')](_0x4f5ba3)[_0x6c55('0x22')](handleEntityNotFound(_0x1613e0,null))[_0x6c55('0x22')](respondWithResult(_0x1613e0,null))[_0x6c55('0x41')](handleError(_0x1613e0,null));};exports[_0x6c55('0x46')]=function(_0x3b29c6,_0x213374){return db[_0x6c55('0x28')][_0x6c55('0x46')](_0x3b29c6[_0x6c55('0x47')],{})['then'](respondWithResult(_0x213374,0xc9))['catch'](handleError(_0x213374,null));};exports[_0x6c55('0x20')]=function(_0x7dc729,_0x2bc332){if(_0x7dc729[_0x6c55('0x47')]['id']){delete _0x7dc729[_0x6c55('0x47')]['id'];}return db[_0x6c55('0x28')]['find']({'where':{'id':_0x7dc729['params']['id']}})['then'](handleEntityNotFound(_0x2bc332,null))[_0x6c55('0x22')](saveUpdates(_0x7dc729[_0x6c55('0x47')],null))['then'](respondWithResult(_0x2bc332,null))[_0x6c55('0x41')](handleError(_0x2bc332,null));};exports[_0x6c55('0x21')]=function(_0x5248b5,_0x4fff85){return db[_0x6c55('0x28')][_0x6c55('0x45')]({'where':{'id':_0x5248b5[_0x6c55('0x43')]['id']}})[_0x6c55('0x22')](handleEntityNotFound(_0x4fff85,null))[_0x6c55('0x22')](removeEntity(_0x4fff85,null))['catch'](handleError(_0x4fff85,null));};exports['describe']=function(_0x520e04,_0x354057){return db[_0x6c55('0x28')][_0x6c55('0x48')]()[_0x6c55('0x22')](respondWithResult(_0x354057,null))[_0x6c55('0x41')](handleError(_0x354057,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 11543c6..4467d71 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 _0x71ee=['bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','../../config/logger','moment'];(function(_0x5a9055,_0x48668d){var _0x24a9ae=function(_0x9c8b6c){while(--_0x9c8b6c){_0x5a9055['push'](_0x5a9055['shift']());}};_0x24a9ae(++_0x48668d);}(_0x71ee,0x1cb));var _0xe71e=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x71ee[_0x36bc58];return _0x4a547e;};'use strict';var _=require(_0xe71e('0x0'));var util=require('util');var logger=require(_0xe71e('0x1'))('api');var moment=require(_0xe71e('0x2'));var BPromise=require(_0xe71e('0x3'));var rp=require(_0xe71e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe71e('0x5'));var config=require(_0xe71e('0x6'));var attributes=require(_0xe71e('0x7'));module[_0xe71e('0x8')]=function(_0x30acff,_0x87181f){return _0x30acff['define'](_0xe71e('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xe71e('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdd4=['request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','uniqueid','../../config/logger','api'];(function(_0x1b60c1,_0x37078a){var _0x1e2e89=function(_0x15bf51){while(--_0x15bf51){_0x1b60c1['push'](_0x1b60c1['shift']());}};_0x1e2e89(++_0x37078a);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xbdd4[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4bdd('0x0'))(_0x4bdd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4bdd('0x2'));var fs=require('fs');var path=require(_0x4bdd('0x3'));var rimraf=require('rimraf');var config=require(_0x4bdd('0x4'));var attributes=require(_0x4bdd('0x5'));module[_0x4bdd('0x6')]=function(_0x494b9d,_0x19a31a){return _0x494b9d['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4bdd('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 5ec592d..db2fb49 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 _0x7235=['FaxTransferReport,\x20%s,\x20%s,\x20%s','code','error','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','request\x20sent','debug'];(function(_0x60adb2,_0x536a3c){var _0x5ef23e=function(_0x11c784){while(--_0x11c784){_0x60adb2['push'](_0x60adb2['shift']());}};_0x5ef23e(++_0x536a3c);}(_0x7235,0x1d6));var _0x5723=function(_0x84a0e6,_0x367638){_0x84a0e6=_0x84a0e6-0x0;var _0x1dd6ea=_0x7235[_0x84a0e6];return _0x1dd6ea;};'use strict';var _=require(_0x5723('0x0'));var util=require(_0x5723('0x1'));var moment=require(_0x5723('0x2'));var BPromise=require(_0x5723('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5723('0x4'));var db=require(_0x5723('0x5'))['db'];var utils=require(_0x5723('0x6'));var logger=require(_0x5723('0x7'))('rpc');var config=require(_0x5723('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5723('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1df975,_0xfcaad,_0x50845a){return new BPromise(function(_0x2d1896,_0x5949ee){return client[_0x5723('0xa')](_0x1df975,_0x50845a)[_0x5723('0xb')](function(_0x12fd34){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0xfcaad,_0x5723('0xc'));logger[_0x5723('0xd')](_0x5723('0xe'),_0xfcaad,_0x5723('0xc'),JSON['stringify'](_0x12fd34));if(_0x12fd34['error']){if(_0x12fd34['error'][_0x5723('0xf')]===0x1f4){logger[_0x5723('0x10')](_0x5723('0x11'),_0xfcaad,_0x12fd34[_0x5723('0x10')]['message']);return _0x5949ee(_0x12fd34['error']['message']);}logger['error'](_0x5723('0x11'),_0xfcaad,_0x12fd34[_0x5723('0x10')]['message']);return _0x2d1896(_0x12fd34['error'][_0x5723('0x12')]);}else{logger[_0x5723('0x13')](_0x5723('0x11'),_0xfcaad,_0x5723('0xc'));_0x2d1896(_0x12fd34[_0x5723('0x14')][_0x5723('0x12')]);}})[_0x5723('0x15')](function(_0x3dcc1d){logger[_0x5723('0x10')](_0x5723('0x11'),_0xfcaad,_0x3dcc1d);_0x5949ee(_0x3dcc1d);});});} \ No newline at end of file +var _0x86d6=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4e64c1,_0x304558){var _0x896ee9=function(_0x5c6f64){while(--_0x5c6f64){_0x4e64c1['push'](_0x4e64c1['shift']());}};_0x896ee9(++_0x304558);}(_0x86d6,0x18f));var _0x686d=function(_0x32d82f,_0x3ccfe6){_0x32d82f=_0x32d82f-0x0;var _0x534d45=_0x86d6[_0x32d82f];return _0x534d45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x686d('0x0'));var BPromise=require(_0x686d('0x1'));var rs=require(_0x686d('0x2'));var fs=require('fs');var Redis=require(_0x686d('0x3'));var db=require(_0x686d('0x4'))['db'];var utils=require(_0x686d('0x5'));var logger=require(_0x686d('0x6'))(_0x686d('0x7'));var config=require(_0x686d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x686d('0x9')][_0x686d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x158a3b,_0x33cacb,_0x2a845f){return new BPromise(function(_0xc2001a,_0x180306){return client['request'](_0x158a3b,_0x2a845f)[_0x686d('0xb')](function(_0x21cd5e){logger[_0x686d('0xc')](_0x686d('0xd'),_0x33cacb,_0x686d('0xe'));logger[_0x686d('0xf')](_0x686d('0x10'),_0x33cacb,'request\x20sent',JSON[_0x686d('0x11')](_0x21cd5e));if(_0x21cd5e[_0x686d('0x12')]){if(_0x21cd5e['error'][_0x686d('0x13')]===0x1f4){logger[_0x686d('0x12')](_0x686d('0xd'),_0x33cacb,_0x21cd5e[_0x686d('0x12')]['message']);return _0x180306(_0x21cd5e['error'][_0x686d('0x14')]);}logger['error'](_0x686d('0xd'),_0x33cacb,_0x21cd5e[_0x686d('0x12')][_0x686d('0x14')]);return _0xc2001a(_0x21cd5e[_0x686d('0x12')][_0x686d('0x14')]);}else{logger[_0x686d('0xc')](_0x686d('0xd'),_0x33cacb,'request\x20sent');_0xc2001a(_0x21cd5e[_0x686d('0x15')]['message']);}})[_0x686d('0x16')](function(_0x2f5d42){logger[_0x686d('0x12')](_0x686d('0xd'),_0x33cacb,_0x2f5d42);_0x180306(_0x2f5d42);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0589bba..2f16ac3 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 _0xe6a4=['../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x585920,_0x11541e){var _0x271588=function(_0x1e3ada){while(--_0x1e3ada){_0x585920['push'](_0x585920['shift']());}};_0x271588(++_0x11541e);}(_0xe6a4,0x120));var _0x4e6a=function(_0x115b84,_0x1d2479){_0x115b84=_0x115b84-0x0;var _0x2b7f4a=_0xe6a4[_0x115b84];return _0x2b7f4a;};'use strict';var multer=require(_0x4e6a('0x0'));var util=require(_0x4e6a('0x1'));var path=require(_0x4e6a('0x2'));var timeout=require(_0x4e6a('0x3'));var express=require(_0x4e6a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4e6a('0x5'));var config=require(_0x4e6a('0x6'));var controller=require(_0x4e6a('0x7'));router['get']('/',auth[_0x4e6a('0x8')](),controller[_0x4e6a('0x9')]);router[_0x4e6a('0xa')](_0x4e6a('0xb'),auth[_0x4e6a('0x8')](),controller[_0x4e6a('0xc')]);router[_0x4e6a('0xa')](_0x4e6a('0xd'),auth['isAuthenticated'](),controller[_0x4e6a('0xe')]);router[_0x4e6a('0xf')]('/',auth[_0x4e6a('0x8')](),controller[_0x4e6a('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4e6a('0x11')]);router[_0x4e6a('0x12')]('/:id',auth[_0x4e6a('0x8')](),controller[_0x4e6a('0x13')]);module[_0x4e6a('0x14')]=router; \ No newline at end of file +var _0x38a1=['post','create','update','destroy','path','connect-timeout','Router','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5b3820,_0x51889c){var _0x442af8=function(_0x597ee1){while(--_0x597ee1){_0x5b3820['push'](_0x5b3820['shift']());}};_0x442af8(++_0x51889c);}(_0x38a1,0xd6));var _0x138a=function(_0x30bebd,_0x4986e5){_0x30bebd=_0x30bebd-0x0;var _0x532cbd=_0x38a1[_0x30bebd];return _0x532cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x138a('0x0'));var timeout=require(_0x138a('0x1'));var express=require('express');var router=express[_0x138a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x138a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x138a('0x4'));router[_0x138a('0x5')]('/',auth[_0x138a('0x6')](),controller[_0x138a('0x7')]);router[_0x138a('0x5')](_0x138a('0x8'),auth[_0x138a('0x6')](),controller[_0x138a('0x9')]);router[_0x138a('0x5')](_0x138a('0xa'),auth[_0x138a('0x6')](),controller['show']);router[_0x138a('0xb')]('/',auth['isAuthenticated'](),controller[_0x138a('0xc')]);router['put']('/:id',auth[_0x138a('0x6')](),controller[_0x138a('0xd')]);router['delete'](_0x138a('0xa'),auth[_0x138a('0x6')](),controller[_0x138a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b7a4bda..07f22fc 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 _0x4bbd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x49cae8,_0x76c17e){var _0x5b4ba6=function(_0x87612){while(--_0x87612){_0x49cae8['push'](_0x49cae8['shift']());}};_0x5b4ba6(++_0x76c17e);}(_0x4bbd,0x120));var _0xd4bb=function(_0x38c9c2,_0x10fd92){_0x38c9c2=_0x38c9c2-0x0;var _0x3d8fa2=_0x4bbd[_0x38c9c2];return _0x3d8fa2;};'use strict';var multer=require(_0xd4bb('0x0'));var util=require(_0xd4bb('0x1'));var path=require(_0xd4bb('0x2'));var timeout=require(_0xd4bb('0x3'));var express=require(_0xd4bb('0x4'));var router=express[_0xd4bb('0x5')]();var fs_extra=require(_0xd4bb('0x6'));var auth=require(_0xd4bb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd4bb('0x8'));var controller=require(_0xd4bb('0x9'));router['get']('/',auth[_0xd4bb('0xa')](),controller[_0xd4bb('0xb')]);router[_0xd4bb('0xc')](_0xd4bb('0xd'),auth[_0xd4bb('0xa')](),controller[_0xd4bb('0xe')]);router[_0xd4bb('0xc')](_0xd4bb('0xf'),auth[_0xd4bb('0xa')](),controller['getConfigurations']);router[_0xd4bb('0xc')](_0xd4bb('0x10'),auth[_0xd4bb('0xa')](),controller[_0xd4bb('0x11')]);router[_0xd4bb('0x12')]('/',auth[_0xd4bb('0xa')](),controller[_0xd4bb('0x13')]);router['post'](_0xd4bb('0xf'),auth[_0xd4bb('0xa')](),controller[_0xd4bb('0x14')]);router[_0xd4bb('0x15')]('/:id',auth[_0xd4bb('0xa')](),controller[_0xd4bb('0x16')]);router[_0xd4bb('0x17')](_0xd4bb('0xd'),auth[_0xd4bb('0xa')](),controller[_0xd4bb('0x18')]);module[_0xd4bb('0x19')]=router; \ No newline at end of file +var _0x0195=['show','/:id/configurations','getConfigurations','get','/:id/fields','getFields','post','put','/:id','update','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0195,0x1c4));var _0x5019=function(_0x2fc738,_0x55724f){_0x2fc738=_0x2fc738-0x0;var _0x49ad46=_0x0195[_0x2fc738];return _0x49ad46;};'use strict';var multer=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5019('0x2'));var router=express['Router']();var fs_extra=require(_0x5019('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5019('0x4'));var config=require(_0x5019('0x5'));var controller=require(_0x5019('0x6'));router['get']('/',auth[_0x5019('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5019('0x8')]);router['get'](_0x5019('0x9'),auth[_0x5019('0x7')](),controller[_0x5019('0xa')]);router[_0x5019('0xb')](_0x5019('0xc'),auth[_0x5019('0x7')](),controller[_0x5019('0xd')]);router[_0x5019('0xe')]('/',auth[_0x5019('0x7')](),controller['create']);router['post'](_0x5019('0x9'),auth[_0x5019('0x7')](),controller['addConfiguration']);router[_0x5019('0xf')](_0x5019('0x10'),auth[_0x5019('0x7')](),controller[_0x5019('0x11')]);router['delete'](_0x5019('0x10'),auth[_0x5019('0x7')](),controller[_0x5019('0x12')]);module[_0x5019('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5b2d5a6..058a06a 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 _0x5570=['exports','STRING','ENUM','basic','integrationTab'];(function(_0x270b7d,_0x456f9f){var _0x2818f1=function(_0x57e433){while(--_0x57e433){_0x270b7d['push'](_0x270b7d['shift']());}};_0x2818f1(++_0x456f9f);}(_0x5570,0x159));var _0x0557=function(_0x37fff5,_0x2e32a4){_0x37fff5=_0x37fff5-0x0;var _0x51c788=_0x5570[_0x37fff5];return _0x51c788;};'use strict';var Sequelize=require('sequelize');module[_0x0557('0x0')]={'name':{'type':Sequelize[_0x0557('0x1')]},'description':{'type':Sequelize[_0x0557('0x1')]},'username':{'type':Sequelize[_0x0557('0x1')]},'remoteUri':{'type':Sequelize[_0x0557('0x1')]},'authType':{'type':Sequelize[_0x0557('0x2')]('basic'),'defaultValue':_0x0557('0x3')},'password':{'type':Sequelize[_0x0557('0x1')]},'consumerKey':{'type':Sequelize[_0x0557('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x0557('0x1')]},'serverUrl':{'type':Sequelize[_0x0557('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0557('0x2')]('integrationTab','newTab'),'defaultValue':_0x0557('0x4')}}; \ No newline at end of file +var _0x75af=['integrationTab','sequelize','STRING','ENUM','basic','newTab'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x75af,0x1cf));var _0xf75a=function(_0x1974a5,_0x2779a9){_0x1974a5=_0x1974a5-0x0;var _0x7a90ed=_0x75af[_0x1974a5];return _0x7a90ed;};'use strict';var Sequelize=require(_0xf75a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf75a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf75a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf75a('0x2')](_0xf75a('0x3')),'defaultValue':_0xf75a('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xf75a('0x1')]},'consumerSecret':{'type':Sequelize[_0xf75a('0x1')]},'token':{'type':Sequelize[_0xf75a('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf75a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf75a('0x2')]('integrationTab',_0xf75a('0x4')),'defaultValue':_0xf75a('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 71e402e..f5e8e53 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 _0x98f4=['name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','channel','getDescriptions','DeskField','Descriptions','getFields','priority','authType','username','password','consumerKey','consumerSecret','remoteUri','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0x98f4,0x128));var _0x498f=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0x98f4[_0x49b14d];return _0x3d2488;};'use strict';var emlformat=require(_0x498f('0x0'));var rimraf=require(_0x498f('0x1'));var zipdir=require(_0x498f('0x2'));var jsonpatch=require(_0x498f('0x3'));var rp=require(_0x498f('0x4'));var moment=require(_0x498f('0x5'));var BPromise=require(_0x498f('0x6'));var Mustache=require(_0x498f('0x7'));var util=require(_0x498f('0x8'));var path=require(_0x498f('0x9'));var sox=require(_0x498f('0xa'));var csv=require(_0x498f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x498f('0xc'));var _=require('lodash');var squel=require(_0x498f('0xd'));var crypto=require(_0x498f('0xe'));var jsforce=require(_0x498f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x498f('0xb'));var querystring=require(_0x498f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x498f('0x11'));var qs=require(_0x498f('0x12'));var as=require(_0x498f('0x13'));var hardwareService=require(_0x498f('0x14'));var logger=require(_0x498f('0x15'))(_0x498f('0x16'));var utils=require(_0x498f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x498f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x498f('0x19'));function respondWithStatusCode(_0x5061b2,_0x9fa7d){_0x9fa7d=_0x9fa7d||0xcc;return function(_0x1ca1f8){if(_0x1ca1f8){return _0x5061b2[_0x498f('0x1a')](_0x9fa7d);}return _0x5061b2[_0x498f('0x1b')](_0x9fa7d)['end']();};}function respondWithResult(_0x500d0a,_0x38ddb0){_0x38ddb0=_0x38ddb0||0xc8;return function(_0x3506a9){if(_0x3506a9){return _0x500d0a['status'](_0x38ddb0)['json'](_0x3506a9);}};}function respondWithFilteredResult(_0x4cf65a,_0x332843){return function(_0x8076c7){if(_0x8076c7){var _0x424482=typeof _0x332843[_0x498f('0x1c')]===_0x498f('0x1d')&&typeof _0x332843['limit']===_0x498f('0x1d');var _0x4c3d62=_0x8076c7[_0x498f('0x1e')];var _0x1c5db9=_0x424482?0x0:_0x332843[_0x498f('0x1c')];var _0x3b6248=_0x424482?_0x8076c7[_0x498f('0x1e')]:_0x332843[_0x498f('0x1c')]+_0x332843[_0x498f('0x1f')];var _0x2f0046;if(_0x3b6248>=_0x4c3d62){_0x3b6248=_0x4c3d62;_0x2f0046=0xc8;}else{_0x2f0046=0xce;}_0x4cf65a[_0x498f('0x1b')](_0x2f0046);return _0x4cf65a[_0x498f('0x20')](_0x498f('0x21'),_0x1c5db9+'-'+_0x3b6248+'/'+_0x4c3d62)[_0x498f('0x22')](_0x8076c7);}return null;};}function patchUpdates(_0x22991a){return function(_0xb9b584){try{jsonpatch[_0x498f('0x23')](_0xb9b584,_0x22991a,!![]);}catch(_0x39b5e8){return BPromise[_0x498f('0x24')](_0x39b5e8);}return _0xb9b584[_0x498f('0x25')]();};}function saveUpdates(_0x1de385,_0x10fa3a){return function(_0x1638d2){if(_0x1638d2){return _0x1638d2[_0x498f('0x26')](_0x1de385)[_0x498f('0x27')](function(_0x21b550){return _0x21b550;});}return null;};}function removeEntity(_0x21de45,_0xb7f82b){return function(_0x571942){if(_0x571942){return _0x571942[_0x498f('0x28')]()[_0x498f('0x27')](function(){_0x21de45[_0x498f('0x1b')](0xcc)[_0x498f('0x29')]();});}};}function handleEntityNotFound(_0x5c6c4e,_0xb4877c){return function(_0x3a56cd){if(!_0x3a56cd){_0x5c6c4e[_0x498f('0x1a')](0x194);}return _0x3a56cd;};}function handleError(_0x3cd2f1,_0x5d9555){_0x5d9555=_0x5d9555||0x1f4;return function(_0x349e6c){logger[_0x498f('0x2a')](_0x349e6c['stack']);if(_0x349e6c[_0x498f('0x2b')]){delete _0x349e6c[_0x498f('0x2b')];}_0x3cd2f1[_0x498f('0x1b')](_0x5d9555)[_0x498f('0x2c')](_0x349e6c);};}exports[_0x498f('0x2d')]=function(_0x2867bf,_0x3c1422){var _0x151c26={},_0x26184d={},_0x353e0a={'count':0x0,'rows':[]};var _0xdaa0da=_['map'](db[_0x498f('0x2e')][_0x498f('0x2f')],function(_0x492b14){return{'name':_0x492b14[_0x498f('0x30')],'type':_0x492b14[_0x498f('0x31')][_0x498f('0x32')]};});_0x26184d[_0x498f('0x33')]=_[_0x498f('0x34')](_0xdaa0da,_0x498f('0x2b'));_0x26184d[_0x498f('0x35')]=_[_0x498f('0x36')](_0x2867bf['query']);_0x26184d[_0x498f('0x37')]=_[_0x498f('0x38')](_0x26184d[_0x498f('0x33')],_0x26184d[_0x498f('0x35')]);_0x151c26[_0x498f('0x39')]=_[_0x498f('0x38')](_0x26184d[_0x498f('0x33')],qs[_0x498f('0x3a')](_0x2867bf[_0x498f('0x35')][_0x498f('0x3a')]));_0x151c26[_0x498f('0x39')]=_0x151c26[_0x498f('0x39')][_0x498f('0x3b')]?_0x151c26[_0x498f('0x39')]:_0x26184d[_0x498f('0x33')];if(!_0x2867bf[_0x498f('0x35')][_0x498f('0x3c')](_0x498f('0x3d'))){_0x151c26[_0x498f('0x1f')]=qs[_0x498f('0x1f')](_0x2867bf[_0x498f('0x35')][_0x498f('0x1f')]);_0x151c26['offset']=qs[_0x498f('0x1c')](_0x2867bf['query'][_0x498f('0x1c')]);}_0x151c26['order']=qs[_0x498f('0x3e')](_0x2867bf['query'][_0x498f('0x3e')]);_0x151c26[_0x498f('0x3f')]=qs[_0x498f('0x37')](_[_0x498f('0x40')](_0x2867bf['query'],_0x26184d[_0x498f('0x37')]),_0xdaa0da);if(_0x2867bf[_0x498f('0x35')]['filter']){_0x151c26[_0x498f('0x3f')]=_['merge'](_0x151c26['where'],{'$or':_['map'](_0xdaa0da,function(_0x21a328){if(_0x21a328['type']!=='VIRTUAL'){var _0x42582d={};_0x42582d[_0x21a328[_0x498f('0x2b')]]={'$like':'%'+_0x2867bf[_0x498f('0x35')][_0x498f('0x41')]+'%'};return _0x42582d;}})});}_0x151c26=_[_0x498f('0x42')]({},_0x151c26,_0x2867bf[_0x498f('0x43')]);var _0x32de87={'where':_0x151c26[_0x498f('0x3f')]};return db[_0x498f('0x2e')]['count'](_0x32de87)[_0x498f('0x27')](function(_0x30bc59){_0x353e0a[_0x498f('0x1e')]=_0x30bc59;if(_0x2867bf[_0x498f('0x35')][_0x498f('0x44')]){_0x151c26[_0x498f('0x45')]=[{'all':!![]}];}return db[_0x498f('0x2e')][_0x498f('0x46')](_0x151c26);})[_0x498f('0x27')](function(_0x1465c1){_0x353e0a[_0x498f('0x47')]=_0x1465c1;return _0x353e0a;})[_0x498f('0x27')](respondWithFilteredResult(_0x3c1422,_0x151c26))[_0x498f('0x48')](handleError(_0x3c1422,null));};exports[_0x498f('0x49')]=function(_0x2b16c8,_0x45e9a5){var _0x4e7695={'raw':![],'where':{'id':_0x2b16c8['params']['id']}},_0x54f596={};_0x54f596[_0x498f('0x33')]=_[_0x498f('0x36')](db[_0x498f('0x2e')][_0x498f('0x2f')]);_0x54f596[_0x498f('0x35')]=_['keys'](_0x2b16c8[_0x498f('0x35')]);_0x54f596[_0x498f('0x37')]=_['intersection'](_0x54f596[_0x498f('0x33')],_0x54f596['query']);_0x4e7695[_0x498f('0x39')]=_[_0x498f('0x38')](_0x54f596[_0x498f('0x33')],qs['fields'](_0x2b16c8[_0x498f('0x35')][_0x498f('0x3a')]));_0x4e7695[_0x498f('0x39')]=_0x4e7695[_0x498f('0x39')][_0x498f('0x3b')]?_0x4e7695[_0x498f('0x39')]:_0x54f596['model'];if(_0x2b16c8[_0x498f('0x35')][_0x498f('0x44')]){_0x4e7695[_0x498f('0x45')]=[{'all':!![]}];}_0x4e7695=_[_0x498f('0x42')]({},_0x4e7695,_0x2b16c8[_0x498f('0x43')]);return db[_0x498f('0x2e')][_0x498f('0x4a')](_0x4e7695)['then'](handleEntityNotFound(_0x45e9a5,null))['then'](respondWithResult(_0x45e9a5,null))[_0x498f('0x48')](handleError(_0x45e9a5,null));};exports[_0x498f('0x4b')]=function(_0x42b9c9,_0x3ca4ab){return db[_0x498f('0x2e')][_0x498f('0x4b')](_0x42b9c9[_0x498f('0x4c')],{})['then'](respondWithResult(_0x3ca4ab,0xc9))[_0x498f('0x48')](handleError(_0x3ca4ab,null));};exports['update']=function(_0x1cc32f,_0x4d0d8c){if(_0x1cc32f[_0x498f('0x4c')]['id']){delete _0x1cc32f[_0x498f('0x4c')]['id'];}return db[_0x498f('0x2e')][_0x498f('0x4a')]({'where':{'id':_0x1cc32f['params']['id']}})[_0x498f('0x27')](handleEntityNotFound(_0x4d0d8c,null))[_0x498f('0x27')](saveUpdates(_0x1cc32f[_0x498f('0x4c')],null))[_0x498f('0x27')](respondWithResult(_0x4d0d8c,null))[_0x498f('0x48')](handleError(_0x4d0d8c,null));};exports['destroy']=function(_0x3dff72,_0x84fd14){return db[_0x498f('0x2e')][_0x498f('0x4a')]({'where':{'id':_0x3dff72[_0x498f('0x4d')]['id']}})[_0x498f('0x27')](handleEntityNotFound(_0x84fd14,null))[_0x498f('0x27')](removeEntity(_0x84fd14,null))['catch'](handleError(_0x84fd14,null));};exports[_0x498f('0x4e')]=function(_0x55943b,_0x311241,_0xade702){var _0x5614c6={};var _0x10e3e1={};var _0x4fc341;var _0x51cf43;return db['DeskAccount'][_0x498f('0x4f')]({'where':{'id':_0x55943b[_0x498f('0x4d')]['id']}})[_0x498f('0x27')](handleEntityNotFound(_0x311241,null))[_0x498f('0x27')](function(_0x552326){if(_0x552326){_0x4fc341=_0x552326;_0x10e3e1[_0x498f('0x33')]=_[_0x498f('0x36')](db[_0x498f('0x50')][_0x498f('0x2f')]);_0x10e3e1[_0x498f('0x35')]=_['keys'](_0x55943b[_0x498f('0x35')]);_0x10e3e1[_0x498f('0x37')]=_[_0x498f('0x38')](_0x10e3e1[_0x498f('0x33')],_0x10e3e1[_0x498f('0x35')]);_0x5614c6[_0x498f('0x39')]=_[_0x498f('0x38')](_0x10e3e1['model'],qs['fields'](_0x55943b[_0x498f('0x35')][_0x498f('0x3a')]));_0x5614c6[_0x498f('0x39')]=_0x5614c6[_0x498f('0x39')][_0x498f('0x3b')]?_0x5614c6[_0x498f('0x39')]:_0x10e3e1[_0x498f('0x33')];_0x5614c6[_0x498f('0x51')]=qs[_0x498f('0x3e')](_0x55943b[_0x498f('0x35')][_0x498f('0x3e')]);_0x5614c6['where']=qs[_0x498f('0x37')](_[_0x498f('0x40')](_0x55943b[_0x498f('0x35')],_0x10e3e1[_0x498f('0x37')]));if(_0x55943b[_0x498f('0x35')][_0x498f('0x41')]){_0x5614c6[_0x498f('0x3f')]=_[_0x498f('0x42')](_0x5614c6[_0x498f('0x3f')],{'$or':_[_0x498f('0x34')](_0x5614c6[_0x498f('0x39')],function(_0x1da0b2){var _0x251034={};_0x251034[_0x1da0b2]={'$like':'%'+_0x55943b[_0x498f('0x35')][_0x498f('0x41')]+'%'};return _0x251034;})});}_0x5614c6=_['merge']({},_0x5614c6,_0x55943b[_0x498f('0x43')]);return _0x4fc341[_0x498f('0x4e')](_0x5614c6);}})['then'](function(_0x3a08f5){if(_0x3a08f5){_0x51cf43=_0x3a08f5['length'];if(!_0x55943b[_0x498f('0x35')][_0x498f('0x3c')](_0x498f('0x3d'))){_0x5614c6[_0x498f('0x1f')]=qs['limit'](_0x55943b[_0x498f('0x35')][_0x498f('0x1f')]);_0x5614c6[_0x498f('0x1c')]=qs[_0x498f('0x1c')](_0x55943b[_0x498f('0x35')][_0x498f('0x1c')]);}return _0x4fc341[_0x498f('0x4e')](_0x5614c6);}})[_0x498f('0x27')](function(_0x21527e){if(_0x21527e){return _0x21527e?{'count':_0x51cf43,'rows':_0x21527e}:null;}})[_0x498f('0x27')](respondWithResult(_0x311241,null))[_0x498f('0x48')](handleError(_0x311241,null));};exports[_0x498f('0x52')]=function(_0x2b12a2,_0x1c1d3e,_0x2a92b3){if(_0x2b12a2['body']['id']){delete _0x2b12a2[_0x498f('0x4c')]['id'];}return db[_0x498f('0x2e')][_0x498f('0x4f')]({'where':{'id':_0x2b12a2[_0x498f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c1d3e,null))[_0x498f('0x27')](function(_0x15a83d){if(_0x15a83d){_0x2b12a2[_0x498f('0x4c')][_0x498f('0x53')]=_0x15a83d['id'];_0x2b12a2[_0x498f('0x4c')]['Subjects']=integrations['getSubjects'](_0x2b12a2[_0x498f('0x4c')][_0x498f('0x54')],_0x2b12a2['body'][_0x498f('0x31')]);_0x2b12a2[_0x498f('0x4c')]['Descriptions']=integrations[_0x498f('0x55')](_0x2b12a2[_0x498f('0x4c')][_0x498f('0x54')],_0x2b12a2[_0x498f('0x4c')][_0x498f('0x31')]);return db[_0x498f('0x50')][_0x498f('0x4b')](_0x2b12a2[_0x498f('0x4c')],{'include':[{'model':db[_0x498f('0x56')],'as':'Subjects'},{'model':db[_0x498f('0x56')],'as':_0x498f('0x57')}]});}return null;})['then'](respondWithResult(_0x1c1d3e,null))['catch'](handleError(_0x1c1d3e,null));};exports[_0x498f('0x58')]=function(_0x4f9d8b,_0xcf1edb,_0x24ff39){var _0x551756=[{'name':_0x498f('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 _0x27891d='';return db['DeskAccount'][_0x498f('0x4f')]({'where':{'id':_0x4f9d8b['params']['id']},'attributes':['id','remoteUri',_0x498f('0x5a'),_0x498f('0x5b'),_0x498f('0x5c'),_0x498f('0x5d'),_0x498f('0x5e'),'token','tokenSecret']})['then'](handleEntityNotFound(_0xcf1edb,null))['then'](function(_0x1390ae){if(_0x1390ae){_0x27891d=_0x1390ae[_0x498f('0x5f')];var _0x2e5272=_0x27891d['slice'](-0x1);if(_0x2e5272==='/'){_0x27891d=_0x27891d[_0x498f('0x60')](0x0,_0x27891d[_0x498f('0x61')](_0x2e5272));}var _0x5ac791={'method':_0x498f('0x62'),'uri':util['format'](_0x498f('0x63'),_0x27891d),'headers':{'Content-Type':_0x498f('0x64'),'Accept':'application/json'},'json':!![]};if(_0x1390ae[_0x498f('0x5a')]===_0x498f('0x65')){_0x5ac791[_0x498f('0x66')][_0x498f('0x67')]=util['format'](_0x498f('0x68'),new Buffer(util[_0x498f('0x69')](_0x498f('0x6a'),_0x1390ae[_0x498f('0x5b')],_0x1390ae[_0x498f('0x5c')]))['toString']('base64'));}return rp(_0x5ac791)[_0x498f('0x27')](function(_0x13e17f){return _0x551756['concat'](_['map'](_0x13e17f[_0x498f('0x6b')][_0x498f('0x6c')],function(_0x2f7220){return{'id':_0x2f7220[_0x498f('0x2b')],'name':_0x2f7220[_0x498f('0x2b')],'type':_0x2f7220[_0x498f('0x31')],'active':_0x2f7220['active'],'label':_0x2f7220[_0x498f('0x6d')],'custom':!![]};}));});}})[_0x498f('0x27')](function(_0xf843c6){return{'count':_0xf843c6['length'],'rows':_0xf843c6};})[_0x498f('0x27')](respondWithResult(_0xcf1edb,null))[_0x498f('0x48')](function(_0x25374e){var _0x162d90=_0x4f9d8b[_0x498f('0x35')][_0x498f('0x6e')]?0x1f4:_0x25374e['statusCode']||0x1f4;logger[_0x498f('0x2a')](_0x498f('0x6f'),'getFields',_0x162d90,JSON['stringify'](_0x25374e));delete _0x25374e[_0x498f('0x2b')];if(_0x162d90===0x191){_0x162d90=0x190;}_0xcf1edb[_0x498f('0x1b')](_0x162d90)[_0x498f('0x2c')](_0x4f9d8b[_0x498f('0x35')][_0x498f('0x6e')]?{'message':_0x498f('0x70'),'statusCode':_0x25374e['statusCode']}:_0x25374e);});}; \ No newline at end of file +var _0x9633=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','offset','limit','set','reject','save','update','destroy','then','sendStatus','error','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','keys','DeskConfiguration','length','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','statusCode','test','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x571763,_0x209644){var _0x64b856=function(_0x1a6ea3){while(--_0x1a6ea3){_0x571763['push'](_0x571763['shift']());}};_0x64b856(++_0x209644);}(_0x9633,0x1b8));var _0x3963=function(_0x1649c9,_0x28f848){_0x1649c9=_0x1649c9-0x0;var _0x280cbb=_0x9633[_0x1649c9];return _0x280cbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3963('0x0'));var zipdir=require(_0x3963('0x1'));var jsonpatch=require(_0x3963('0x2'));var rp=require(_0x3963('0x3'));var moment=require(_0x3963('0x4'));var BPromise=require(_0x3963('0x5'));var Mustache=require('mustache');var util=require(_0x3963('0x6'));var path=require(_0x3963('0x7'));var sox=require(_0x3963('0x8'));var csv=require(_0x3963('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3963('0xa'));var squel=require(_0x3963('0xb'));var crypto=require(_0x3963('0xc'));var jsforce=require(_0x3963('0xd'));var deskjs=require(_0x3963('0xe'));var toCsv=require(_0x3963('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3963('0xf'));var authService=require(_0x3963('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3963('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3963('0x12'))(_0x3963('0x13'));var utils=require(_0x3963('0x14'));var config=require(_0x3963('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3963('0x16'))['db'];var integrations=require(_0x3963('0x17'));function respondWithStatusCode(_0x4144c3,_0xa1cc56){_0xa1cc56=_0xa1cc56||0xcc;return function(_0x32d7e6){if(_0x32d7e6){return _0x4144c3['sendStatus'](_0xa1cc56);}return _0x4144c3[_0x3963('0x18')](_0xa1cc56)[_0x3963('0x19')]();};}function respondWithResult(_0x501e7d,_0x398e5e){_0x398e5e=_0x398e5e||0xc8;return function(_0xbe7167){if(_0xbe7167){return _0x501e7d[_0x3963('0x18')](_0x398e5e)[_0x3963('0x1a')](_0xbe7167);}};}function respondWithFilteredResult(_0x141c33,_0x16d4b6){return function(_0x23c4da){if(_0x23c4da){var _0x4d565a=typeof _0x16d4b6['offset']===_0x3963('0x1b')&&typeof _0x16d4b6['limit']==='undefined';var _0x497a1c=_0x23c4da['count'];var _0x6e9086=_0x4d565a?0x0:_0x16d4b6[_0x3963('0x1c')];var _0x38748b=_0x4d565a?_0x23c4da['count']:_0x16d4b6[_0x3963('0x1c')]+_0x16d4b6[_0x3963('0x1d')];var _0x378c61;if(_0x38748b>=_0x497a1c){_0x38748b=_0x497a1c;_0x378c61=0xc8;}else{_0x378c61=0xce;}_0x141c33[_0x3963('0x18')](_0x378c61);return _0x141c33[_0x3963('0x1e')]('Content-Range',_0x6e9086+'-'+_0x38748b+'/'+_0x497a1c)['json'](_0x23c4da);}return null;};}function patchUpdates(_0x26f60a){return function(_0x479d21){try{jsonpatch['apply'](_0x479d21,_0x26f60a,!![]);}catch(_0x2fc8a8){return BPromise[_0x3963('0x1f')](_0x2fc8a8);}return _0x479d21[_0x3963('0x20')]();};}function saveUpdates(_0x5235a2,_0x2d0da5){return function(_0x191774){if(_0x191774){return _0x191774[_0x3963('0x21')](_0x5235a2)['then'](function(_0x3ee50b){return _0x3ee50b;});}return null;};}function removeEntity(_0x33380e,_0x5cc37a){return function(_0x110a2e){if(_0x110a2e){return _0x110a2e[_0x3963('0x22')]()[_0x3963('0x23')](function(){_0x33380e[_0x3963('0x18')](0xcc)[_0x3963('0x19')]();});}};}function handleEntityNotFound(_0x39bf7b,_0x39e33b){return function(_0x1e7be4){if(!_0x1e7be4){_0x39bf7b[_0x3963('0x24')](0x194);}return _0x1e7be4;};}function handleError(_0x5ae363,_0x26e014){_0x26e014=_0x26e014||0x1f4;return function(_0x4d27af){logger[_0x3963('0x25')](_0x4d27af['stack']);if(_0x4d27af['name']){delete _0x4d27af['name'];}_0x5ae363[_0x3963('0x18')](_0x26e014)[_0x3963('0x26')](_0x4d27af);};}exports[_0x3963('0x27')]=function(_0x40816c,_0x216b53){var _0xe85dc3={},_0x675712={},_0x44a131={'count':0x0,'rows':[]};var _0x42ee6e=_['map'](db[_0x3963('0x28')][_0x3963('0x29')],function(_0x324c3a){return{'name':_0x324c3a[_0x3963('0x2a')],'type':_0x324c3a[_0x3963('0x2b')][_0x3963('0x2c')]};});_0x675712[_0x3963('0x2d')]=_[_0x3963('0x2e')](_0x42ee6e,'name');_0x675712['query']=_['keys'](_0x40816c[_0x3963('0x2f')]);_0x675712[_0x3963('0x30')]=_['intersection'](_0x675712[_0x3963('0x2d')],_0x675712[_0x3963('0x2f')]);_0xe85dc3[_0x3963('0x31')]=_[_0x3963('0x32')](_0x675712[_0x3963('0x2d')],qs[_0x3963('0x33')](_0x40816c[_0x3963('0x2f')][_0x3963('0x33')]));_0xe85dc3[_0x3963('0x31')]=_0xe85dc3['attributes']['length']?_0xe85dc3[_0x3963('0x31')]:_0x675712[_0x3963('0x2d')];if(!_0x40816c['query'][_0x3963('0x34')](_0x3963('0x35'))){_0xe85dc3[_0x3963('0x1d')]=qs[_0x3963('0x1d')](_0x40816c['query'][_0x3963('0x1d')]);_0xe85dc3[_0x3963('0x1c')]=qs[_0x3963('0x1c')](_0x40816c[_0x3963('0x2f')]['offset']);}_0xe85dc3[_0x3963('0x36')]=qs['sort'](_0x40816c[_0x3963('0x2f')][_0x3963('0x37')]);_0xe85dc3['where']=qs['filters'](_[_0x3963('0x38')](_0x40816c['query'],_0x675712[_0x3963('0x30')]),_0x42ee6e);if(_0x40816c['query'][_0x3963('0x39')]){_0xe85dc3[_0x3963('0x3a')]=_[_0x3963('0x3b')](_0xe85dc3[_0x3963('0x3a')],{'$or':_['map'](_0x42ee6e,function(_0x166a6f){if(_0x166a6f['type']!==_0x3963('0x3c')){var _0x4f4225={};_0x4f4225[_0x166a6f[_0x3963('0x3d')]]={'$like':'%'+_0x40816c[_0x3963('0x2f')][_0x3963('0x39')]+'%'};return _0x4f4225;}})});}_0xe85dc3=_[_0x3963('0x3b')]({},_0xe85dc3,_0x40816c[_0x3963('0x3e')]);var _0x169257={'where':_0xe85dc3[_0x3963('0x3a')]};return db[_0x3963('0x28')][_0x3963('0x3f')](_0x169257)['then'](function(_0x1ee5b0){_0x44a131['count']=_0x1ee5b0;if(_0x40816c[_0x3963('0x2f')][_0x3963('0x40')]){_0xe85dc3[_0x3963('0x41')]=[{'all':!![]}];}return db[_0x3963('0x28')][_0x3963('0x42')](_0xe85dc3);})[_0x3963('0x23')](function(_0x1f7d62){_0x44a131[_0x3963('0x43')]=_0x1f7d62;return _0x44a131;})['then'](respondWithFilteredResult(_0x216b53,_0xe85dc3))['catch'](handleError(_0x216b53,null));};exports[_0x3963('0x44')]=function(_0xe94ffd,_0x2688d5){var _0x13a8e7={'raw':![],'where':{'id':_0xe94ffd['params']['id']}},_0x47de3c={};_0x47de3c['model']=_['keys'](db[_0x3963('0x28')][_0x3963('0x29')]);_0x47de3c[_0x3963('0x2f')]=_['keys'](_0xe94ffd[_0x3963('0x2f')]);_0x47de3c[_0x3963('0x30')]=_[_0x3963('0x32')](_0x47de3c['model'],_0x47de3c[_0x3963('0x2f')]);_0x13a8e7[_0x3963('0x31')]=_[_0x3963('0x32')](_0x47de3c[_0x3963('0x2d')],qs[_0x3963('0x33')](_0xe94ffd[_0x3963('0x2f')]['fields']));_0x13a8e7[_0x3963('0x31')]=_0x13a8e7[_0x3963('0x31')]['length']?_0x13a8e7[_0x3963('0x31')]:_0x47de3c[_0x3963('0x2d')];if(_0xe94ffd[_0x3963('0x2f')][_0x3963('0x40')]){_0x13a8e7[_0x3963('0x41')]=[{'all':!![]}];}_0x13a8e7=_['merge']({},_0x13a8e7,_0xe94ffd['options']);return db[_0x3963('0x28')][_0x3963('0x45')](_0x13a8e7)[_0x3963('0x23')](handleEntityNotFound(_0x2688d5,null))[_0x3963('0x23')](respondWithResult(_0x2688d5,null))[_0x3963('0x46')](handleError(_0x2688d5,null));};exports[_0x3963('0x47')]=function(_0x18afd6,_0x1133e0){return db[_0x3963('0x28')][_0x3963('0x47')](_0x18afd6['body'],{})[_0x3963('0x23')](respondWithResult(_0x1133e0,0xc9))[_0x3963('0x46')](handleError(_0x1133e0,null));};exports[_0x3963('0x21')]=function(_0x310687,_0x53353a){if(_0x310687[_0x3963('0x48')]['id']){delete _0x310687[_0x3963('0x48')]['id'];}return db['DeskAccount'][_0x3963('0x45')]({'where':{'id':_0x310687[_0x3963('0x49')]['id']}})['then'](handleEntityNotFound(_0x53353a,null))[_0x3963('0x23')](saveUpdates(_0x310687[_0x3963('0x48')],null))[_0x3963('0x23')](respondWithResult(_0x53353a,null))[_0x3963('0x46')](handleError(_0x53353a,null));};exports[_0x3963('0x22')]=function(_0x3524c0,_0x539dc3){return db[_0x3963('0x28')][_0x3963('0x45')]({'where':{'id':_0x3524c0[_0x3963('0x49')]['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x539dc3,null))[_0x3963('0x23')](removeEntity(_0x539dc3,null))['catch'](handleError(_0x539dc3,null));};exports[_0x3963('0x4a')]=function(_0xcf9f7,_0x506e9f,_0x2b6682){var _0xbd3aba={};var _0x1c5cc2={};var _0x462cb2;var _0x515871;return db[_0x3963('0x28')][_0x3963('0x4b')]({'where':{'id':_0xcf9f7['params']['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x506e9f,null))[_0x3963('0x23')](function(_0x51cc8b){if(_0x51cc8b){_0x462cb2=_0x51cc8b;_0x1c5cc2[_0x3963('0x2d')]=_[_0x3963('0x4c')](db[_0x3963('0x4d')][_0x3963('0x29')]);_0x1c5cc2['query']=_[_0x3963('0x4c')](_0xcf9f7[_0x3963('0x2f')]);_0x1c5cc2[_0x3963('0x30')]=_['intersection'](_0x1c5cc2[_0x3963('0x2d')],_0x1c5cc2[_0x3963('0x2f')]);_0xbd3aba[_0x3963('0x31')]=_[_0x3963('0x32')](_0x1c5cc2[_0x3963('0x2d')],qs[_0x3963('0x33')](_0xcf9f7['query'][_0x3963('0x33')]));_0xbd3aba[_0x3963('0x31')]=_0xbd3aba[_0x3963('0x31')][_0x3963('0x4e')]?_0xbd3aba['attributes']:_0x1c5cc2['model'];_0xbd3aba[_0x3963('0x36')]=qs[_0x3963('0x37')](_0xcf9f7[_0x3963('0x2f')][_0x3963('0x37')]);_0xbd3aba[_0x3963('0x3a')]=qs[_0x3963('0x30')](_['pick'](_0xcf9f7[_0x3963('0x2f')],_0x1c5cc2[_0x3963('0x30')]));if(_0xcf9f7[_0x3963('0x2f')][_0x3963('0x39')]){_0xbd3aba['where']=_[_0x3963('0x3b')](_0xbd3aba[_0x3963('0x3a')],{'$or':_[_0x3963('0x2e')](_0xbd3aba[_0x3963('0x31')],function(_0x476b32){var _0x44dc35={};_0x44dc35[_0x476b32]={'$like':'%'+_0xcf9f7['query'][_0x3963('0x39')]+'%'};return _0x44dc35;})});}_0xbd3aba=_[_0x3963('0x3b')]({},_0xbd3aba,_0xcf9f7['options']);return _0x462cb2[_0x3963('0x4a')](_0xbd3aba);}})['then'](function(_0x4e2eda){if(_0x4e2eda){_0x515871=_0x4e2eda[_0x3963('0x4e')];if(!_0xcf9f7[_0x3963('0x2f')][_0x3963('0x34')]('nolimit')){_0xbd3aba['limit']=qs['limit'](_0xcf9f7['query'][_0x3963('0x1d')]);_0xbd3aba['offset']=qs[_0x3963('0x1c')](_0xcf9f7[_0x3963('0x2f')][_0x3963('0x1c')]);}return _0x462cb2[_0x3963('0x4a')](_0xbd3aba);}})['then'](function(_0x45445e){if(_0x45445e){return _0x45445e?{'count':_0x515871,'rows':_0x45445e}:null;}})[_0x3963('0x23')](respondWithResult(_0x506e9f,null))[_0x3963('0x46')](handleError(_0x506e9f,null));};exports[_0x3963('0x4f')]=function(_0x181c55,_0x52957e,_0x11b2c6){if(_0x181c55[_0x3963('0x48')]['id']){delete _0x181c55[_0x3963('0x48')]['id'];}return db['DeskAccount'][_0x3963('0x4b')]({'where':{'id':_0x181c55[_0x3963('0x49')]['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x52957e,null))['then'](function(_0x53812b){if(_0x53812b){_0x181c55[_0x3963('0x48')]['AccountId']=_0x53812b['id'];_0x181c55[_0x3963('0x48')]['Subjects']=integrations[_0x3963('0x50')](_0x181c55[_0x3963('0x48')]['channel'],_0x181c55[_0x3963('0x48')][_0x3963('0x2b')]);_0x181c55['body'][_0x3963('0x51')]=integrations[_0x3963('0x52')](_0x181c55[_0x3963('0x48')][_0x3963('0x53')],_0x181c55[_0x3963('0x48')][_0x3963('0x2b')]);return db[_0x3963('0x4d')][_0x3963('0x47')](_0x181c55[_0x3963('0x48')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x3963('0x54')],'as':_0x3963('0x51')}]});}return null;})[_0x3963('0x23')](respondWithResult(_0x52957e,null))[_0x3963('0x46')](handleError(_0x52957e,null));};exports[_0x3963('0x55')]=function(_0x457811,_0x4e4b76,_0x471010){var _0x37c29e=[{'name':_0x3963('0x56'),'label':_0x3963('0x56'),'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 _0x2bc254='';return db[_0x3963('0x28')][_0x3963('0x4b')]({'where':{'id':_0x457811[_0x3963('0x49')]['id']},'attributes':['id',_0x3963('0x57'),_0x3963('0x58'),_0x3963('0x59'),_0x3963('0x5a'),_0x3963('0x5b'),_0x3963('0x5c'),_0x3963('0x5d'),_0x3963('0x5e')]})['then'](handleEntityNotFound(_0x4e4b76,null))[_0x3963('0x23')](function(_0x5a78e5){if(_0x5a78e5){_0x2bc254=_0x5a78e5[_0x3963('0x57')];var _0x24e045=_0x2bc254[_0x3963('0x5f')](-0x1);if(_0x24e045==='/'){_0x2bc254=_0x2bc254[_0x3963('0x60')](0x0,_0x2bc254[_0x3963('0x61')](_0x24e045));}var _0x5efa32={'method':_0x3963('0x62'),'uri':util[_0x3963('0x63')](_0x3963('0x64'),_0x2bc254),'headers':{'Content-Type':_0x3963('0x65'),'Accept':_0x3963('0x65')},'json':!![]};if(_0x5a78e5['authType']===_0x3963('0x66')){_0x5efa32['headers'][_0x3963('0x67')]=util[_0x3963('0x63')](_0x3963('0x68'),new Buffer(util[_0x3963('0x63')](_0x3963('0x69'),_0x5a78e5[_0x3963('0x59')],_0x5a78e5['password']))[_0x3963('0x6a')]('base64'));}return rp(_0x5efa32)['then'](function(_0x7c7762){return _0x37c29e[_0x3963('0x6b')](_[_0x3963('0x2e')](_0x7c7762[_0x3963('0x6c')][_0x3963('0x6d')],function(_0x1d1154){return{'id':_0x1d1154['name'],'name':_0x1d1154[_0x3963('0x3d')],'type':_0x1d1154[_0x3963('0x2b')],'active':_0x1d1154[_0x3963('0x6e')],'label':_0x1d1154[_0x3963('0x6f')],'custom':!![]};}));});}})[_0x3963('0x23')](function(_0x42b960){return{'count':_0x42b960['length'],'rows':_0x42b960};})[_0x3963('0x23')](respondWithResult(_0x4e4b76,null))[_0x3963('0x46')](function(_0x542c6b){var _0x56ca95=_0x457811[_0x3963('0x2f')]['test']?0x1f4:_0x542c6b[_0x3963('0x70')]||0x1f4;logger[_0x3963('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x3963('0x55'),_0x56ca95,JSON['stringify'](_0x542c6b));delete _0x542c6b[_0x3963('0x3d')];if(_0x56ca95===0x191){_0x56ca95=0x190;}_0x4e4b76['status'](_0x56ca95)[_0x3963('0x26')](_0x457811[_0x3963('0x2f')][_0x3963('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x542c6b[_0x3963('0x70')]}:_0x542c6b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index f152ce7..07259ad 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 _0xced4=['api','moment','bluebird','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','../../config/logger'];(function(_0xc9b565,_0x14970d){var _0x3ce997=function(_0xa6e811){while(--_0xa6e811){_0xc9b565['push'](_0xc9b565['shift']());}};_0x3ce997(++_0x14970d);}(_0xced4,0x1ac));var _0x4ced=function(_0x509f97,_0x442414){_0x509f97=_0x509f97-0x0;var _0x18bbef=_0xced4[_0x509f97];return _0x18bbef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ced('0x0'))(_0x4ced('0x1'));var moment=require(_0x4ced('0x2'));var BPromise=require(_0x4ced('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ced('0x4'));var rimraf=require('rimraf');var config=require(_0x4ced('0x5'));var attributes=require(_0x4ced('0x6'));var integrations=require(_0x4ced('0x7'));module[_0x4ced('0x8')]=function(_0xc37c8a,_0x5c45c2){return _0xc37c8a['define'](_0x4ced('0x9'),attributes,{'tableName':_0x4ced('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c9f=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3692c9,_0x1e1ca9){var _0x311c74=function(_0x5b0834){while(--_0x5b0834){_0x3692c9['push'](_0x3692c9['shift']());}};_0x311c74(++_0x1e1ca9);}(_0x9c9f,0xbc));var _0xf9c9=function(_0x3d203e,_0x2c2a26){_0x3d203e=_0x3d203e-0x0;var _0x154e60=_0x9c9f[_0x3d203e];return _0x154e60;};'use strict';var _=require(_0xf9c9('0x0'));var util=require(_0xf9c9('0x1'));var logger=require(_0xf9c9('0x2'))('api');var moment=require(_0xf9c9('0x3'));var BPromise=require(_0xf9c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9c9('0x5'));var rimraf=require(_0xf9c9('0x6'));var config=require(_0xf9c9('0x7'));var attributes=require(_0xf9c9('0x8'));var integrations=require(_0xf9c9('0x9'));module['exports']=function(_0x39bdd1,_0x57f9f9){return _0x39bdd1[_0xf9c9('0xa')](_0xf9c9('0xb'),attributes,{'tableName':_0xf9c9('0xc'),'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 426177f..4d07321 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 _0x8e65=['map','model','stringify','catch','ShowDeskAccount','find','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','GetDeskAccount','findAll','options','where','limit','include','attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8e65,0x1b3));var _0x58e6=function(_0x186746,_0x3ae562){_0x186746=_0x186746-0x0;var _0x1bf71b=_0x8e65[_0x186746];return _0x1bf71b;};'use strict';var _=require(_0x58e6('0x0'));var util=require(_0x58e6('0x1'));var moment=require(_0x58e6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58e6('0x4'));var logger=require(_0x58e6('0x5'))('rpc');var config=require(_0x58e6('0x6'));var jayson=require(_0x58e6('0x7'));var client=jayson[_0x58e6('0x8')][_0x58e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf75c,_0x1a43f2,_0x453432){return new BPromise(function(_0xff8d7d,_0x7c62b){return client[_0x58e6('0xa')](_0x1bf75c,_0x453432)[_0x58e6('0xb')](function(_0x1dd31c){logger[_0x58e6('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1a43f2,'request\x20sent');logger[_0x58e6('0xd')](_0x58e6('0xe'),_0x1a43f2,_0x58e6('0xf'),JSON['stringify'](_0x1dd31c));if(_0x1dd31c[_0x58e6('0x10')]){if(_0x1dd31c[_0x58e6('0x10')][_0x58e6('0x11')]===0x1f4){logger[_0x58e6('0x10')](_0x58e6('0x12'),_0x1a43f2,_0x1dd31c[_0x58e6('0x10')][_0x58e6('0x13')]);return _0x7c62b(_0x1dd31c[_0x58e6('0x10')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x1a43f2,_0x1dd31c[_0x58e6('0x10')]['message']);return _0xff8d7d(_0x1dd31c['error']['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x1a43f2,'request\x20sent');_0xff8d7d(_0x1dd31c['result'][_0x58e6('0x13')]);}})['catch'](function(_0x1880e0){logger[_0x58e6('0x10')](_0x58e6('0x12'),_0x1a43f2,_0x1880e0);_0x7c62b(_0x1880e0);});});}exports[_0x58e6('0x14')]=function(_0x412a00){var _0x4df44=this;return new Promise(function(_0x2fbbff,_0x4ef363){return db['DeskAccount'][_0x58e6('0x15')]({'raw':_0x412a00[_0x58e6('0x16')]?_0x412a00[_0x58e6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x412a00[_0x58e6('0x16')]?_0x412a00['options'][_0x58e6('0x17')]||null:null,'attributes':_0x412a00[_0x58e6('0x16')]?_0x412a00['options']['attributes']||null:null,'limit':_0x412a00[_0x58e6('0x16')]?_0x412a00[_0x58e6('0x16')][_0x58e6('0x18')]||null:null,'include':_0x412a00[_0x58e6('0x16')]?_0x412a00['options'][_0x58e6('0x19')]?_['map'](_0x412a00[_0x58e6('0x16')]['include'],function(_0x29e262){return{'model':db[_0x29e262['model']],'as':_0x29e262['as'],'attributes':_0x29e262[_0x58e6('0x1a')],'include':_0x29e262['include']?_[_0x58e6('0x1b')](_0x29e262[_0x58e6('0x19')],function(_0x287f58){return{'model':db[_0x287f58[_0x58e6('0x1c')]],'as':_0x287f58['as'],'attributes':_0x287f58[_0x58e6('0x1a')],'include':_0x287f58[_0x58e6('0x19')]?_[_0x58e6('0x1b')](_0x287f58[_0x58e6('0x19')],function(_0x172658){return{'model':db[_0x172658[_0x58e6('0x1c')]],'as':_0x172658['as'],'attributes':_0x172658['attributes']};}):[]};}):[]};}):[]:[]})[_0x58e6('0xb')](function(_0x3057fb){logger[_0x58e6('0xc')](_0x58e6('0x14'),_0x412a00);logger['debug'](_0x58e6('0x14'),_0x412a00,JSON[_0x58e6('0x1d')](_0x3057fb));_0x2fbbff(_0x3057fb);})[_0x58e6('0x1e')](function(_0xd94183){logger['error'](_0x58e6('0x14'),_0xd94183['message'],_0x412a00);_0x4ef363(_0x4df44[_0x58e6('0x10')](0x1f4,_0xd94183[_0x58e6('0x13')]));});});};exports[_0x58e6('0x1f')]=function(_0x4a6519){var _0x3193f4=this;return new Promise(function(_0x1bf5c4,_0x4f4f67){return db['DeskAccount'][_0x58e6('0x20')]({'raw':_0x4a6519[_0x58e6('0x16')]?_0x4a6519[_0x58e6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4a6519[_0x58e6('0x16')]?_0x4a6519[_0x58e6('0x16')]['where']||null:null,'attributes':_0x4a6519[_0x58e6('0x16')]?_0x4a6519[_0x58e6('0x16')]['attributes']||null:null,'include':_0x4a6519[_0x58e6('0x16')]?_0x4a6519[_0x58e6('0x16')][_0x58e6('0x19')]?_['map'](_0x4a6519['options'][_0x58e6('0x19')],function(_0x10d718){return{'model':db[_0x10d718[_0x58e6('0x1c')]],'as':_0x10d718['as'],'attributes':_0x10d718[_0x58e6('0x1a')],'include':_0x10d718[_0x58e6('0x19')]?_[_0x58e6('0x1b')](_0x10d718['include'],function(_0x1b9ec2){return{'model':db[_0x1b9ec2[_0x58e6('0x1c')]],'as':_0x1b9ec2['as'],'attributes':_0x1b9ec2[_0x58e6('0x1a')],'include':_0x1b9ec2['include']?_[_0x58e6('0x1b')](_0x1b9ec2[_0x58e6('0x19')],function(_0xf7cef8){return{'model':db[_0xf7cef8[_0x58e6('0x1c')]],'as':_0xf7cef8['as'],'attributes':_0xf7cef8[_0x58e6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x58e6('0xb')](function(_0x30f317){logger[_0x58e6('0xc')](_0x58e6('0x1f'),_0x4a6519);logger[_0x58e6('0xd')](_0x58e6('0x1f'),_0x4a6519,JSON[_0x58e6('0x1d')](_0x30f317));_0x1bf5c4(_0x30f317);})[_0x58e6('0x1e')](function(_0x2d2447){logger['error'](_0x58e6('0x1f'),_0x2d2447['message'],_0x4a6519);_0x4f4f67(_0x3193f4['error'](0x1f4,_0x2d2447[_0x58e6('0x13')]));});});}; \ No newline at end of file +var _0xcc3b=['DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetDeskAccount','DeskAccount','options','raw','where','include','map','model','attributes','catch','ShowDeskAccount','find','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','debug'];(function(_0x1aee46,_0x35a25f){var _0xf2be12=function(_0x37f364){while(--_0x37f364){_0x1aee46['push'](_0x1aee46['shift']());}};_0xf2be12(++_0x35a25f);}(_0xcc3b,0xd3));var _0xbcc3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xcc3b[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0xbcc3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcc3('0x1'));var fs=require('fs');var Redis=require(_0xbcc3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbcc3('0x3'))(_0xbcc3('0x4'));var config=require(_0xbcc3('0x5'));var jayson=require(_0xbcc3('0x6'));var client=jayson[_0xbcc3('0x7')][_0xbcc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x121591,_0x122fa7,_0x4e5e12){return new BPromise(function(_0x15104c,_0x2bd207){return client[_0xbcc3('0x9')](_0x121591,_0x4e5e12)[_0xbcc3('0xa')](function(_0x509618){logger['info'](_0xbcc3('0xb'),_0x122fa7,'request\x20sent');logger[_0xbcc3('0xc')](_0xbcc3('0xd'),_0x122fa7,_0xbcc3('0xe'),JSON[_0xbcc3('0xf')](_0x509618));if(_0x509618[_0xbcc3('0x10')]){if(_0x509618[_0xbcc3('0x10')][_0xbcc3('0x11')]===0x1f4){logger[_0xbcc3('0x10')](_0xbcc3('0xb'),_0x122fa7,_0x509618['error']['message']);return _0x2bd207(_0x509618[_0xbcc3('0x10')][_0xbcc3('0x12')]);}logger[_0xbcc3('0x10')](_0xbcc3('0xb'),_0x122fa7,_0x509618[_0xbcc3('0x10')][_0xbcc3('0x12')]);return _0x15104c(_0x509618['error'][_0xbcc3('0x12')]);}else{logger[_0xbcc3('0x13')]('DeskAccount,\x20%s,\x20%s',_0x122fa7,'request\x20sent');_0x15104c(_0x509618['result'][_0xbcc3('0x12')]);}})['catch'](function(_0x48147f){logger[_0xbcc3('0x10')]('DeskAccount,\x20%s,\x20%s',_0x122fa7,_0x48147f);_0x2bd207(_0x48147f);});});}exports[_0xbcc3('0x14')]=function(_0x4b900d){var _0xce01a9=this;return new Promise(function(_0x3aac35,_0x1fcf70){return db[_0xbcc3('0x15')]['findAll']({'raw':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x17')]===undefined?!![]:![]:!![],'where':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x18')]||null:null,'attributes':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')]['attributes']||null:null,'limit':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')]['limit']||null:null,'include':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x19')],function(_0x5d86ee){return{'model':db[_0x5d86ee[_0xbcc3('0x1b')]],'as':_0x5d86ee['as'],'attributes':_0x5d86ee[_0xbcc3('0x1c')],'include':_0x5d86ee[_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x5d86ee[_0xbcc3('0x19')],function(_0x16f10e){return{'model':db[_0x16f10e[_0xbcc3('0x1b')]],'as':_0x16f10e['as'],'attributes':_0x16f10e[_0xbcc3('0x1c')],'include':_0x16f10e[_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x16f10e[_0xbcc3('0x19')],function(_0x857e48){return{'model':db[_0x857e48['model']],'as':_0x857e48['as'],'attributes':_0x857e48[_0xbcc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523173){logger[_0xbcc3('0x13')]('GetDeskAccount',_0x4b900d);logger[_0xbcc3('0xc')](_0xbcc3('0x14'),_0x4b900d,JSON[_0xbcc3('0xf')](_0x523173));_0x3aac35(_0x523173);})[_0xbcc3('0x1d')](function(_0x2138b6){logger[_0xbcc3('0x10')](_0xbcc3('0x14'),_0x2138b6['message'],_0x4b900d);_0x1fcf70(_0xce01a9[_0xbcc3('0x10')](0x1f4,_0x2138b6[_0xbcc3('0x12')]));});});};exports[_0xbcc3('0x1e')]=function(_0x24c56d){var _0x172463=this;return new Promise(function(_0x5ee7f7,_0x29d0e1){return db[_0xbcc3('0x15')][_0xbcc3('0x1f')]({'raw':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x17')]===undefined?!![]:![]:!![],'where':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x18')]||null:null,'attributes':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d['options'][_0xbcc3('0x1c')]||null:null,'include':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x19')],function(_0x5f4724){return{'model':db[_0x5f4724[_0xbcc3('0x1b')]],'as':_0x5f4724['as'],'attributes':_0x5f4724[_0xbcc3('0x1c')],'include':_0x5f4724[_0xbcc3('0x19')]?_['map'](_0x5f4724[_0xbcc3('0x19')],function(_0x1e1fea){return{'model':db[_0x1e1fea['model']],'as':_0x1e1fea['as'],'attributes':_0x1e1fea[_0xbcc3('0x1c')],'include':_0x1e1fea[_0xbcc3('0x19')]?_['map'](_0x1e1fea[_0xbcc3('0x19')],function(_0x56ce54){return{'model':db[_0x56ce54[_0xbcc3('0x1b')]],'as':_0x56ce54['as'],'attributes':_0x56ce54[_0xbcc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42ebfa){logger[_0xbcc3('0x13')](_0xbcc3('0x1e'),_0x24c56d);logger[_0xbcc3('0xc')]('ShowDeskAccount',_0x24c56d,JSON[_0xbcc3('0xf')](_0x42ebfa));_0x5ee7f7(_0x42ebfa);})[_0xbcc3('0x1d')](function(_0x312553){logger['error'](_0xbcc3('0x1e'),_0x312553['message'],_0x24c56d);_0x29d0e1(_0x172463[_0xbcc3('0x10')](0x1f4,_0x312553[_0xbcc3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 788b95e..840a2d3 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(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0x55ca,0x126));var _0xa55c=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x55ca[_0x7d62cb];return _0x3a6266;};'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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x376489,_0x8e4fba){var _0x24f6ee=function(_0x40800f){while(--_0x40800f){_0x376489['push'](_0x376489['shift']());}};_0x24f6ee(++_0x8e4fba);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 8a0a796..b8a731a 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 _0x10a8=['STRING','sequelize','exports'];(function(_0x4f094a,_0x5dafd1){var _0x759d2b=function(_0x55c63e){while(--_0x55c63e){_0x4f094a['push'](_0x4f094a['shift']());}};_0x759d2b(++_0x5dafd1);}(_0x10a8,0x112));var _0x810a=function(_0x5b3afd,_0x469cb9){_0x5b3afd=_0x5b3afd-0x0;var _0x1d19db=_0x10a8[_0x5b3afd];return _0x1d19db;};'use strict';var Sequelize=require(_0x810a('0x0'));module[_0x810a('0x1')]={'name':{'type':Sequelize[_0x810a('0x2')]},'description':{'type':Sequelize[_0x810a('0x2')]}}; \ No newline at end of file +var _0xc094=['exports','STRING','sequelize'];(function(_0x524662,_0x1efb51){var _0x758d2e=function(_0x2d5c18){while(--_0x2d5c18){_0x524662['push'](_0x524662['shift']());}};_0x758d2e(++_0x1efb51);}(_0xc094,0xa1));var _0x4c09=function(_0x3ab5b5,_0x51ac49){_0x3ab5b5=_0x3ab5b5-0x0;var _0xec5463=_0xc094[_0x3ab5b5];return _0xec5463;};'use strict';var Sequelize=require(_0x4c09('0x0'));module[_0x4c09('0x1')]={'name':{'type':Sequelize[_0x4c09('0x2')]},'description':{'type':Sequelize[_0x4c09('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index f75f1aa..f58a5b3 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 _0x07f3=['DeskField','filter','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','limit','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','map','DeskConfiguration','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','options','count','includeAll','include','findAll','catch','params','keys','find','create','body'];(function(_0x237a1b,_0xcd87ab){var _0x3ce998=function(_0x2e71d3){while(--_0x2e71d3){_0x237a1b['push'](_0x237a1b['shift']());}};_0x3ce998(++_0xcd87ab);}(_0x07f3,0x1dd));var _0x307f=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0x07f3[_0x3598bb];return _0x13c837;};'use strict';var emlformat=require(_0x307f('0x0'));var rimraf=require(_0x307f('0x1'));var zipdir=require(_0x307f('0x2'));var jsonpatch=require(_0x307f('0x3'));var rp=require(_0x307f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x307f('0x5'));var util=require('util');var path=require(_0x307f('0x6'));var sox=require(_0x307f('0x7'));var csv=require('to-csv');var ejs=require(_0x307f('0x8'));var fs=require('fs');var fs_extra=require(_0x307f('0x9'));var _=require(_0x307f('0xa'));var squel=require(_0x307f('0xb'));var crypto=require(_0x307f('0xc'));var jsforce=require(_0x307f('0xd'));var deskjs=require(_0x307f('0xe'));var toCsv=require(_0x307f('0xf'));var querystring=require(_0x307f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x307f('0x11'));var qs=require(_0x307f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x307f('0x13'));var logger=require('../../config/logger')(_0x307f('0x14'));var utils=require(_0x307f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x307f('0x16'))['db'];function respondWithStatusCode(_0x4a7a8d,_0x1271d2){_0x1271d2=_0x1271d2||0xcc;return function(_0x37eee0){if(_0x37eee0){return _0x4a7a8d['sendStatus'](_0x1271d2);}return _0x4a7a8d[_0x307f('0x17')](_0x1271d2)[_0x307f('0x18')]();};}function respondWithResult(_0x393e3d,_0x1b7f81){_0x1b7f81=_0x1b7f81||0xc8;return function(_0x37628a){if(_0x37628a){return _0x393e3d[_0x307f('0x17')](_0x1b7f81)['json'](_0x37628a);}};}function respondWithFilteredResult(_0x1c5664,_0x1119a3){return function(_0x14c55f){if(_0x14c55f){var _0x6d264=typeof _0x1119a3['offset']==='undefined'&&typeof _0x1119a3[_0x307f('0x19')]==='undefined';var _0x3a9d40=_0x14c55f['count'];var _0x36d140=_0x6d264?0x0:_0x1119a3[_0x307f('0x1a')];var _0x375cb9=_0x6d264?_0x14c55f['count']:_0x1119a3[_0x307f('0x1a')]+_0x1119a3[_0x307f('0x19')];var _0xc8235e;if(_0x375cb9>=_0x3a9d40){_0x375cb9=_0x3a9d40;_0xc8235e=0xc8;}else{_0xc8235e=0xce;}_0x1c5664[_0x307f('0x17')](_0xc8235e);return _0x1c5664[_0x307f('0x1b')]('Content-Range',_0x36d140+'-'+_0x375cb9+'/'+_0x3a9d40)[_0x307f('0x1c')](_0x14c55f);}return null;};}function patchUpdates(_0x2274be){return function(_0x50772f){try{jsonpatch[_0x307f('0x1d')](_0x50772f,_0x2274be,!![]);}catch(_0xc6828e){return BPromise[_0x307f('0x1e')](_0xc6828e);}return _0x50772f[_0x307f('0x1f')]();};}function saveUpdates(_0x5f452a,_0x28916b){return function(_0x2b6d9b){if(_0x2b6d9b){return _0x2b6d9b[_0x307f('0x20')](_0x5f452a)[_0x307f('0x21')](function(_0x38262a){return _0x38262a;});}return null;};}function removeEntity(_0x23029a,_0x5db6c7){return function(_0x47c5b4){if(_0x47c5b4){return _0x47c5b4[_0x307f('0x22')]()[_0x307f('0x21')](function(){_0x23029a['status'](0xcc)[_0x307f('0x18')]();});}};}function handleEntityNotFound(_0xd3fa3,_0xd4a8f8){return function(_0x26b604){if(!_0x26b604){_0xd3fa3[_0x307f('0x23')](0x194);}return _0x26b604;};}function handleError(_0x57c529,_0xc09d41){_0xc09d41=_0xc09d41||0x1f4;return function(_0xa6f3f4){logger[_0x307f('0x24')](_0xa6f3f4['stack']);if(_0xa6f3f4[_0x307f('0x25')]){delete _0xa6f3f4[_0x307f('0x25')];}_0x57c529[_0x307f('0x17')](_0xc09d41)['send'](_0xa6f3f4);};}exports['index']=function(_0x38684f,_0x3baa7a){var _0x72ca61={},_0xc9011c={},_0x1c136a={'count':0x0,'rows':[]};var _0x138025=_[_0x307f('0x26')](db[_0x307f('0x27')][_0x307f('0x28')],function(_0x1fbfb2){return{'name':_0x1fbfb2[_0x307f('0x29')],'type':_0x1fbfb2['type'][_0x307f('0x2a')]};});_0xc9011c[_0x307f('0x2b')]=_[_0x307f('0x26')](_0x138025,'name');_0xc9011c['query']=_['keys'](_0x38684f['query']);_0xc9011c[_0x307f('0x2c')]=_[_0x307f('0x2d')](_0xc9011c['model'],_0xc9011c['query']);_0x72ca61[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0xc9011c[_0x307f('0x2b')],qs[_0x307f('0x2f')](_0x38684f['query'][_0x307f('0x2f')]));_0x72ca61[_0x307f('0x2e')]=_0x72ca61['attributes'][_0x307f('0x30')]?_0x72ca61[_0x307f('0x2e')]:_0xc9011c[_0x307f('0x2b')];if(!_0x38684f[_0x307f('0x31')][_0x307f('0x32')](_0x307f('0x33'))){_0x72ca61['limit']=qs[_0x307f('0x19')](_0x38684f['query'][_0x307f('0x19')]);_0x72ca61[_0x307f('0x1a')]=qs['offset'](_0x38684f[_0x307f('0x31')][_0x307f('0x1a')]);}_0x72ca61[_0x307f('0x34')]=qs['sort'](_0x38684f[_0x307f('0x31')][_0x307f('0x35')]);_0x72ca61['where']=qs[_0x307f('0x2c')](_[_0x307f('0x36')](_0x38684f[_0x307f('0x31')],_0xc9011c[_0x307f('0x2c')]),_0x138025);if(_0x38684f['query']['filter']){_0x72ca61[_0x307f('0x37')]=_[_0x307f('0x38')](_0x72ca61[_0x307f('0x37')],{'$or':_[_0x307f('0x26')](_0x138025,function(_0x1436d7){if(_0x1436d7[_0x307f('0x39')]!=='VIRTUAL'){var _0x5439a4={};_0x5439a4[_0x1436d7[_0x307f('0x25')]]={'$like':'%'+_0x38684f[_0x307f('0x31')]['filter']+'%'};return _0x5439a4;}})});}_0x72ca61=_[_0x307f('0x38')]({},_0x72ca61,_0x38684f[_0x307f('0x3a')]);var _0x6d17d7={'where':_0x72ca61[_0x307f('0x37')]};return db[_0x307f('0x27')][_0x307f('0x3b')](_0x6d17d7)[_0x307f('0x21')](function(_0x2c4955){_0x1c136a[_0x307f('0x3b')]=_0x2c4955;if(_0x38684f[_0x307f('0x31')][_0x307f('0x3c')]){_0x72ca61[_0x307f('0x3d')]=[{'all':!![]}];}return db[_0x307f('0x27')][_0x307f('0x3e')](_0x72ca61);})[_0x307f('0x21')](function(_0x483136){_0x1c136a['rows']=_0x483136;return _0x1c136a;})[_0x307f('0x21')](respondWithFilteredResult(_0x3baa7a,_0x72ca61))[_0x307f('0x3f')](handleError(_0x3baa7a,null));};exports['show']=function(_0xd5a791,_0x4150c5){var _0x2ba2cf={'raw':![],'where':{'id':_0xd5a791[_0x307f('0x40')]['id']}},_0x1ecba9={};_0x1ecba9[_0x307f('0x2b')]=_[_0x307f('0x41')](db[_0x307f('0x27')][_0x307f('0x28')]);_0x1ecba9[_0x307f('0x31')]=_[_0x307f('0x41')](_0xd5a791['query']);_0x1ecba9['filters']=_[_0x307f('0x2d')](_0x1ecba9[_0x307f('0x2b')],_0x1ecba9[_0x307f('0x31')]);_0x2ba2cf[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0x1ecba9[_0x307f('0x2b')],qs[_0x307f('0x2f')](_0xd5a791[_0x307f('0x31')][_0x307f('0x2f')]));_0x2ba2cf[_0x307f('0x2e')]=_0x2ba2cf['attributes'][_0x307f('0x30')]?_0x2ba2cf[_0x307f('0x2e')]:_0x1ecba9['model'];if(_0xd5a791[_0x307f('0x31')][_0x307f('0x3c')]){_0x2ba2cf['include']=[{'all':!![]}];}_0x2ba2cf=_[_0x307f('0x38')]({},_0x2ba2cf,_0xd5a791['options']);return db['DeskConfiguration'][_0x307f('0x42')](_0x2ba2cf)[_0x307f('0x21')](handleEntityNotFound(_0x4150c5,null))[_0x307f('0x21')](respondWithResult(_0x4150c5,null))['catch'](handleError(_0x4150c5,null));};exports[_0x307f('0x43')]=function(_0x47b44a,_0x32a6d2){return db[_0x307f('0x27')][_0x307f('0x43')](_0x47b44a['body'],{})[_0x307f('0x21')](respondWithResult(_0x32a6d2,0xc9))[_0x307f('0x3f')](handleError(_0x32a6d2,null));};exports['update']=function(_0x370836,_0x3eb21e){if(_0x370836[_0x307f('0x44')]['id']){delete _0x370836[_0x307f('0x44')]['id'];}return db[_0x307f('0x27')][_0x307f('0x42')]({'where':{'id':_0x370836[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x3eb21e,null))[_0x307f('0x21')](saveUpdates(_0x370836[_0x307f('0x44')],null))[_0x307f('0x21')](respondWithResult(_0x3eb21e,null))[_0x307f('0x3f')](handleError(_0x3eb21e,null));};exports[_0x307f('0x22')]=function(_0x29a1fd,_0xae2928){return db[_0x307f('0x27')][_0x307f('0x42')]({'where':{'id':_0x29a1fd[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0xae2928,null))[_0x307f('0x21')](removeEntity(_0xae2928,null))[_0x307f('0x3f')](handleError(_0xae2928,null));};exports['getFields']=function(_0x216779,_0x4df3b1,_0x253d83){var _0x4abbb6={};var _0x5e71d1={};var _0x1f96ab;var _0x5300f5;return db[_0x307f('0x27')]['findOne']({'where':{'id':_0x216779[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x4df3b1,null))[_0x307f('0x21')](function(_0x216d55){if(_0x216d55){_0x1f96ab=_0x216d55;_0x5e71d1[_0x307f('0x2b')]=_[_0x307f('0x41')](db[_0x307f('0x45')][_0x307f('0x28')]);_0x5e71d1[_0x307f('0x31')]=_[_0x307f('0x41')](_0x216779[_0x307f('0x31')]);_0x5e71d1['filters']=_[_0x307f('0x2d')](_0x5e71d1[_0x307f('0x2b')],_0x5e71d1[_0x307f('0x31')]);_0x4abbb6[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0x5e71d1[_0x307f('0x2b')],qs[_0x307f('0x2f')](_0x216779[_0x307f('0x31')][_0x307f('0x2f')]));_0x4abbb6[_0x307f('0x2e')]=_0x4abbb6[_0x307f('0x2e')][_0x307f('0x30')]?_0x4abbb6[_0x307f('0x2e')]:_0x5e71d1['model'];_0x4abbb6[_0x307f('0x34')]=qs[_0x307f('0x35')](_0x216779[_0x307f('0x31')][_0x307f('0x35')]);_0x4abbb6['where']=qs[_0x307f('0x2c')](_[_0x307f('0x36')](_0x216779['query'],_0x5e71d1[_0x307f('0x2c')]));if(_0x216779[_0x307f('0x31')][_0x307f('0x46')]){_0x4abbb6[_0x307f('0x37')]=_[_0x307f('0x38')](_0x4abbb6[_0x307f('0x37')],{'$or':_[_0x307f('0x26')](_0x4abbb6[_0x307f('0x2e')],function(_0xf3e733){var _0x49ecb9={};_0x49ecb9[_0xf3e733]={'$like':'%'+_0x216779[_0x307f('0x31')][_0x307f('0x46')]+'%'};return _0x49ecb9;})});}_0x4abbb6=_['merge']({},_0x4abbb6,_0x216779['options']);return _0x1f96ab['getFields'](_0x4abbb6);}})[_0x307f('0x21')](function(_0x5a451a){if(_0x5a451a){_0x5300f5=_0x5a451a[_0x307f('0x30')];if(!_0x216779[_0x307f('0x31')][_0x307f('0x32')]('nolimit')){_0x4abbb6['limit']=qs[_0x307f('0x19')](_0x216779[_0x307f('0x31')][_0x307f('0x19')]);_0x4abbb6[_0x307f('0x1a')]=qs[_0x307f('0x1a')](_0x216779['query']['offset']);}return _0x1f96ab[_0x307f('0x47')](_0x4abbb6);}})[_0x307f('0x21')](function(_0x1015fc){if(_0x1015fc){return _0x1015fc?{'count':_0x5300f5,'rows':_0x1015fc}:null;}})['then'](respondWithResult(_0x4df3b1,null))[_0x307f('0x3f')](handleError(_0x4df3b1,null));};exports[_0x307f('0x48')]=function(_0x32118f,_0x5c6f54,_0x10c8e6){var _0x21a81d={};var _0x117ae7={};var _0x28da3f;var _0x3123b2;return db[_0x307f('0x27')][_0x307f('0x49')]({'where':{'id':_0x32118f[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x5c6f54,null))[_0x307f('0x21')](function(_0x594d9e){if(_0x594d9e){_0x28da3f=_0x594d9e;_0x117ae7[_0x307f('0x2b')]=_[_0x307f('0x41')](db[_0x307f('0x45')][_0x307f('0x28')]);_0x117ae7['query']=_[_0x307f('0x41')](_0x32118f[_0x307f('0x31')]);_0x117ae7[_0x307f('0x2c')]=_[_0x307f('0x2d')](_0x117ae7[_0x307f('0x2b')],_0x117ae7[_0x307f('0x31')]);_0x21a81d[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0x117ae7[_0x307f('0x2b')],qs['fields'](_0x32118f[_0x307f('0x31')][_0x307f('0x2f')]));_0x21a81d[_0x307f('0x2e')]=_0x21a81d[_0x307f('0x2e')]['length']?_0x21a81d[_0x307f('0x2e')]:_0x117ae7['model'];_0x21a81d[_0x307f('0x34')]=qs[_0x307f('0x35')](_0x32118f[_0x307f('0x31')][_0x307f('0x35')]);_0x21a81d[_0x307f('0x37')]=qs[_0x307f('0x2c')](_[_0x307f('0x36')](_0x32118f['query'],_0x117ae7[_0x307f('0x2c')]));if(_0x32118f[_0x307f('0x31')][_0x307f('0x46')]){_0x21a81d[_0x307f('0x37')]=_[_0x307f('0x38')](_0x21a81d[_0x307f('0x37')],{'$or':_[_0x307f('0x26')](_0x21a81d[_0x307f('0x2e')],function(_0x5945cd){var _0x567442={};_0x567442[_0x5945cd]={'$like':'%'+_0x32118f[_0x307f('0x31')]['filter']+'%'};return _0x567442;})});}_0x21a81d=_['merge']({},_0x21a81d,_0x32118f[_0x307f('0x3a')]);return _0x28da3f[_0x307f('0x48')](_0x21a81d);}})[_0x307f('0x21')](function(_0x29c6cc){if(_0x29c6cc){_0x3123b2=_0x29c6cc[_0x307f('0x30')];if(!_0x32118f['query']['hasOwnProperty'](_0x307f('0x33'))){_0x21a81d[_0x307f('0x19')]=qs[_0x307f('0x19')](_0x32118f['query']['limit']);_0x21a81d[_0x307f('0x1a')]=qs[_0x307f('0x1a')](_0x32118f[_0x307f('0x31')][_0x307f('0x1a')]);}return _0x28da3f[_0x307f('0x48')](_0x21a81d);}})[_0x307f('0x21')](function(_0x3318b2){if(_0x3318b2){return _0x3318b2?{'count':_0x3123b2,'rows':_0x3318b2}:null;}})[_0x307f('0x21')](respondWithResult(_0x5c6f54,null))[_0x307f('0x3f')](handleError(_0x5c6f54,null));};exports[_0x307f('0x4a')]=function(_0x3bc0ff,_0x5a06a1,_0x156ada){var _0x4dff95={};var _0x429d3a={};var _0x96719e;var _0xeb3f8c;return db[_0x307f('0x27')]['findOne']({'where':{'id':_0x3bc0ff[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x5a06a1,null))[_0x307f('0x21')](function(_0x403595){if(_0x403595){_0x96719e=_0x403595;_0x429d3a[_0x307f('0x2b')]=_[_0x307f('0x41')](db[_0x307f('0x45')]['rawAttributes']);_0x429d3a[_0x307f('0x31')]=_[_0x307f('0x41')](_0x3bc0ff['query']);_0x429d3a[_0x307f('0x2c')]=_[_0x307f('0x2d')](_0x429d3a['model'],_0x429d3a[_0x307f('0x31')]);_0x4dff95[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0x429d3a[_0x307f('0x2b')],qs['fields'](_0x3bc0ff[_0x307f('0x31')][_0x307f('0x2f')]));_0x4dff95[_0x307f('0x2e')]=_0x4dff95[_0x307f('0x2e')][_0x307f('0x30')]?_0x4dff95[_0x307f('0x2e')]:_0x429d3a[_0x307f('0x2b')];_0x4dff95[_0x307f('0x34')]=qs['sort'](_0x3bc0ff[_0x307f('0x31')]['sort']);_0x4dff95[_0x307f('0x37')]=qs[_0x307f('0x2c')](_[_0x307f('0x36')](_0x3bc0ff[_0x307f('0x31')],_0x429d3a[_0x307f('0x2c')]));if(_0x3bc0ff[_0x307f('0x31')][_0x307f('0x46')]){_0x4dff95[_0x307f('0x37')]=_[_0x307f('0x38')](_0x4dff95[_0x307f('0x37')],{'$or':_[_0x307f('0x26')](_0x4dff95[_0x307f('0x2e')],function(_0x10061f){var _0x1e2c07={};_0x1e2c07[_0x10061f]={'$like':'%'+_0x3bc0ff[_0x307f('0x31')][_0x307f('0x46')]+'%'};return _0x1e2c07;})});}_0x4dff95=_[_0x307f('0x38')]({},_0x4dff95,_0x3bc0ff[_0x307f('0x3a')]);return _0x96719e[_0x307f('0x4a')](_0x4dff95);}})[_0x307f('0x21')](function(_0x2993b4){if(_0x2993b4){_0xeb3f8c=_0x2993b4[_0x307f('0x30')];if(!_0x3bc0ff[_0x307f('0x31')]['hasOwnProperty']('nolimit')){_0x4dff95[_0x307f('0x19')]=qs['limit'](_0x3bc0ff[_0x307f('0x31')]['limit']);_0x4dff95[_0x307f('0x1a')]=qs[_0x307f('0x1a')](_0x3bc0ff[_0x307f('0x31')]['offset']);}return _0x96719e[_0x307f('0x4a')](_0x4dff95);}})[_0x307f('0x21')](function(_0x125ded){if(_0x125ded){return _0x125ded?{'count':_0xeb3f8c,'rows':_0x125ded}:null;}})[_0x307f('0x21')](respondWithResult(_0x5a06a1,null))['catch'](handleError(_0x5a06a1,null));};exports[_0x307f('0x4b')]=function(_0x2951d8,_0x1fb901,_0x425134){var _0x52a0cc={};var _0x4632ab={};var _0x1e4e7b;var _0x29990e;return db['DeskConfiguration'][_0x307f('0x49')]({'where':{'id':_0x2951d8[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x1fb901,null))[_0x307f('0x21')](function(_0x4b76c5){if(_0x4b76c5){_0x1e4e7b=_0x4b76c5;_0x4632ab[_0x307f('0x2b')]=_[_0x307f('0x41')](db[_0x307f('0x4c')][_0x307f('0x28')]);_0x4632ab['query']=_[_0x307f('0x41')](_0x2951d8[_0x307f('0x31')]);_0x4632ab['filters']=_[_0x307f('0x2d')](_0x4632ab['model'],_0x4632ab[_0x307f('0x31')]);_0x52a0cc[_0x307f('0x2e')]=_[_0x307f('0x2d')](_0x4632ab[_0x307f('0x2b')],qs[_0x307f('0x2f')](_0x2951d8['query'][_0x307f('0x2f')]));_0x52a0cc[_0x307f('0x2e')]=_0x52a0cc[_0x307f('0x2e')][_0x307f('0x30')]?_0x52a0cc[_0x307f('0x2e')]:_0x4632ab[_0x307f('0x2b')];_0x52a0cc[_0x307f('0x34')]=qs['sort'](_0x2951d8[_0x307f('0x31')]['sort']);_0x52a0cc[_0x307f('0x37')]=qs[_0x307f('0x2c')](_[_0x307f('0x36')](_0x2951d8[_0x307f('0x31')],_0x4632ab[_0x307f('0x2c')]));if(_0x2951d8[_0x307f('0x31')][_0x307f('0x46')]){_0x52a0cc[_0x307f('0x37')]=_[_0x307f('0x38')](_0x52a0cc[_0x307f('0x37')],{'$or':_[_0x307f('0x26')](_0x52a0cc[_0x307f('0x2e')],function(_0x170609){var _0x26af43={};_0x26af43[_0x170609]={'$like':'%'+_0x2951d8[_0x307f('0x31')]['filter']+'%'};return _0x26af43;})});}_0x52a0cc=_[_0x307f('0x38')]({},_0x52a0cc,_0x2951d8['options']);return _0x1e4e7b[_0x307f('0x4b')](_0x52a0cc);}})[_0x307f('0x21')](function(_0x1e6582){if(_0x1e6582){_0x29990e=_0x1e6582[_0x307f('0x30')];if(!_0x2951d8['query']['hasOwnProperty'](_0x307f('0x33'))){_0x52a0cc[_0x307f('0x19')]=qs[_0x307f('0x19')](_0x2951d8[_0x307f('0x31')][_0x307f('0x19')]);_0x52a0cc[_0x307f('0x1a')]=qs[_0x307f('0x1a')](_0x2951d8[_0x307f('0x31')]['offset']);}return _0x1e4e7b['getTags'](_0x52a0cc);}})[_0x307f('0x21')](function(_0xe50225){if(_0xe50225){return _0xe50225?{'count':_0x29990e,'rows':_0xe50225}:null;}})['then'](respondWithResult(_0x1fb901,null))[_0x307f('0x3f')](handleError(_0x1fb901,null));};exports['setTags']=function(_0x14f213,_0x5b6c20,_0x35ff1f){if(_0x14f213[_0x307f('0x44')]['id']){delete _0x14f213[_0x307f('0x44')]['id'];}return db[_0x307f('0x27')][_0x307f('0x49')]({'where':{'id':_0x14f213[_0x307f('0x40')]['id']}})[_0x307f('0x21')](handleEntityNotFound(_0x5b6c20,null))[_0x307f('0x21')](function(_0x419623){if(_0x419623){return _0x419623['setTags'](_0x14f213[_0x307f('0x44')][_0x307f('0x4d')]||[]);}return null;})[_0x307f('0x21')](respondWithResult(_0x5b6c20,null))['catch'](handleError(_0x5b6c20,null));}; \ No newline at end of file +var _0x6eb4=['filter','DeskConfiguration','includeAll','include','rows','params','keys','length','options','find','catch','create','body','getFields','DeskField','hasOwnProperty','order','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','merge'];(function(_0x27f5e1,_0x9503bf){var _0x428cdd=function(_0xd90cec){while(--_0xd90cec){_0x27f5e1['push'](_0x27f5e1['shift']());}};_0x428cdd(++_0x9503bf);}(_0x6eb4,0xbb));var _0x46eb=function(_0x24c392,_0xe1a064){_0x24c392=_0x24c392-0x0;var _0xf921fe=_0x6eb4[_0x24c392];return _0xf921fe;};'use strict';var emlformat=require(_0x46eb('0x0'));var rimraf=require(_0x46eb('0x1'));var zipdir=require(_0x46eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46eb('0x3'));var moment=require(_0x46eb('0x4'));var BPromise=require(_0x46eb('0x5'));var Mustache=require(_0x46eb('0x6'));var util=require(_0x46eb('0x7'));var path=require(_0x46eb('0x8'));var sox=require(_0x46eb('0x9'));var csv=require(_0x46eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46eb('0xb'));var _=require(_0x46eb('0xc'));var squel=require('squel');var crypto=require(_0x46eb('0xd'));var jsforce=require(_0x46eb('0xe'));var deskjs=require(_0x46eb('0xf'));var toCsv=require(_0x46eb('0xa'));var querystring=require(_0x46eb('0x10'));var Papa=require(_0x46eb('0x11'));var Redis=require('ioredis');var authService=require(_0x46eb('0x12'));var qs=require(_0x46eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x46eb('0x14'))(_0x46eb('0x15'));var utils=require(_0x46eb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x46eb('0x17'));var db=require(_0x46eb('0x18'))['db'];function respondWithStatusCode(_0x222fdb,_0x4ca7b2){_0x4ca7b2=_0x4ca7b2||0xcc;return function(_0x5cc14d){if(_0x5cc14d){return _0x222fdb['sendStatus'](_0x4ca7b2);}return _0x222fdb[_0x46eb('0x19')](_0x4ca7b2)[_0x46eb('0x1a')]();};}function respondWithResult(_0x507020,_0x445d2f){_0x445d2f=_0x445d2f||0xc8;return function(_0x331422){if(_0x331422){return _0x507020[_0x46eb('0x19')](_0x445d2f)[_0x46eb('0x1b')](_0x331422);}};}function respondWithFilteredResult(_0x5731ec,_0xec9402){return function(_0x1febf1){if(_0x1febf1){var _0x47d1a0=typeof _0xec9402[_0x46eb('0x1c')]===_0x46eb('0x1d')&&typeof _0xec9402[_0x46eb('0x1e')]===_0x46eb('0x1d');var _0x2683bb=_0x1febf1[_0x46eb('0x1f')];var _0x2cf5a9=_0x47d1a0?0x0:_0xec9402[_0x46eb('0x1c')];var _0x1ae641=_0x47d1a0?_0x1febf1[_0x46eb('0x1f')]:_0xec9402[_0x46eb('0x1c')]+_0xec9402[_0x46eb('0x1e')];var _0x491fae;if(_0x1ae641>=_0x2683bb){_0x1ae641=_0x2683bb;_0x491fae=0xc8;}else{_0x491fae=0xce;}_0x5731ec['status'](_0x491fae);return _0x5731ec[_0x46eb('0x20')](_0x46eb('0x21'),_0x2cf5a9+'-'+_0x1ae641+'/'+_0x2683bb)[_0x46eb('0x1b')](_0x1febf1);}return null;};}function patchUpdates(_0x351d05){return function(_0x46dd33){try{jsonpatch['apply'](_0x46dd33,_0x351d05,!![]);}catch(_0x586aa3){return BPromise[_0x46eb('0x22')](_0x586aa3);}return _0x46dd33['save']();};}function saveUpdates(_0x4ac8e5,_0x5bbc7f){return function(_0x443105){if(_0x443105){return _0x443105[_0x46eb('0x23')](_0x4ac8e5)[_0x46eb('0x24')](function(_0x4e20cf){return _0x4e20cf;});}return null;};}function removeEntity(_0x2abbea,_0x7e1892){return function(_0x1e59c3){if(_0x1e59c3){return _0x1e59c3[_0x46eb('0x25')]()[_0x46eb('0x24')](function(){_0x2abbea['status'](0xcc)[_0x46eb('0x1a')]();});}};}function handleEntityNotFound(_0x3ae300,_0x474bb1){return function(_0x355ea){if(!_0x355ea){_0x3ae300[_0x46eb('0x26')](0x194);}return _0x355ea;};}function handleError(_0x745e64,_0xabb331){_0xabb331=_0xabb331||0x1f4;return function(_0x48e745){logger[_0x46eb('0x27')](_0x48e745[_0x46eb('0x28')]);if(_0x48e745['name']){delete _0x48e745[_0x46eb('0x29')];}_0x745e64['status'](_0xabb331)[_0x46eb('0x2a')](_0x48e745);};}exports['index']=function(_0x2cde69,_0x79fb24){var _0x5d0bb3={},_0x5daee4={},_0x41e883={'count':0x0,'rows':[]};var _0x4c3dff=_[_0x46eb('0x2b')](db['DeskConfiguration'][_0x46eb('0x2c')],function(_0x471820){return{'name':_0x471820[_0x46eb('0x2d')],'type':_0x471820[_0x46eb('0x2e')][_0x46eb('0x2f')]};});_0x5daee4[_0x46eb('0x30')]=_[_0x46eb('0x2b')](_0x4c3dff,'name');_0x5daee4['query']=_['keys'](_0x2cde69[_0x46eb('0x31')]);_0x5daee4[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x5daee4['model'],_0x5daee4[_0x46eb('0x31')]);_0x5d0bb3['attributes']=_['intersection'](_0x5daee4['model'],qs[_0x46eb('0x34')](_0x2cde69[_0x46eb('0x31')]['fields']));_0x5d0bb3[_0x46eb('0x35')]=_0x5d0bb3[_0x46eb('0x35')]['length']?_0x5d0bb3[_0x46eb('0x35')]:_0x5daee4[_0x46eb('0x30')];if(!_0x2cde69[_0x46eb('0x31')]['hasOwnProperty'](_0x46eb('0x36'))){_0x5d0bb3[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x2cde69[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x5d0bb3['offset']=qs[_0x46eb('0x1c')](_0x2cde69[_0x46eb('0x31')]['offset']);}_0x5d0bb3['order']=qs['sort'](_0x2cde69[_0x46eb('0x31')][_0x46eb('0x37')]);_0x5d0bb3[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x2cde69['query'],_0x5daee4[_0x46eb('0x32')]),_0x4c3dff);if(_0x2cde69[_0x46eb('0x31')]['filter']){_0x5d0bb3[_0x46eb('0x38')]=_[_0x46eb('0x3a')](_0x5d0bb3[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0x4c3dff,function(_0x1fc773){if(_0x1fc773['type']!=='VIRTUAL'){var _0x417aa2={};_0x417aa2[_0x1fc773['name']]={'$like':'%'+_0x2cde69[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x417aa2;}})});}_0x5d0bb3=_['merge']({},_0x5d0bb3,_0x2cde69['options']);var _0x5818fa={'where':_0x5d0bb3[_0x46eb('0x38')]};return db[_0x46eb('0x3c')][_0x46eb('0x1f')](_0x5818fa)[_0x46eb('0x24')](function(_0x10e3c9){_0x41e883['count']=_0x10e3c9;if(_0x2cde69[_0x46eb('0x31')][_0x46eb('0x3d')]){_0x5d0bb3[_0x46eb('0x3e')]=[{'all':!![]}];}return db[_0x46eb('0x3c')]['findAll'](_0x5d0bb3);})[_0x46eb('0x24')](function(_0x52465a){_0x41e883[_0x46eb('0x3f')]=_0x52465a;return _0x41e883;})['then'](respondWithFilteredResult(_0x79fb24,_0x5d0bb3))['catch'](handleError(_0x79fb24,null));};exports['show']=function(_0x1c2e04,_0x3c04a8){var _0xd71370={'raw':![],'where':{'id':_0x1c2e04[_0x46eb('0x40')]['id']}},_0x1b36ea={};_0x1b36ea['model']=_[_0x46eb('0x41')](db['DeskConfiguration'][_0x46eb('0x2c')]);_0x1b36ea[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x1c2e04[_0x46eb('0x31')]);_0x1b36ea[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x1b36ea['model'],_0x1b36ea[_0x46eb('0x31')]);_0xd71370['attributes']=_[_0x46eb('0x33')](_0x1b36ea[_0x46eb('0x30')],qs['fields'](_0x1c2e04['query'][_0x46eb('0x34')]));_0xd71370['attributes']=_0xd71370[_0x46eb('0x35')][_0x46eb('0x42')]?_0xd71370['attributes']:_0x1b36ea[_0x46eb('0x30')];if(_0x1c2e04[_0x46eb('0x31')][_0x46eb('0x3d')]){_0xd71370[_0x46eb('0x3e')]=[{'all':!![]}];}_0xd71370=_[_0x46eb('0x3a')]({},_0xd71370,_0x1c2e04[_0x46eb('0x43')]);return db[_0x46eb('0x3c')][_0x46eb('0x44')](_0xd71370)[_0x46eb('0x24')](handleEntityNotFound(_0x3c04a8,null))[_0x46eb('0x24')](respondWithResult(_0x3c04a8,null))[_0x46eb('0x45')](handleError(_0x3c04a8,null));};exports['create']=function(_0x13259a,_0x39c91e){return db[_0x46eb('0x3c')][_0x46eb('0x46')](_0x13259a[_0x46eb('0x47')],{})[_0x46eb('0x24')](respondWithResult(_0x39c91e,0xc9))['catch'](handleError(_0x39c91e,null));};exports[_0x46eb('0x23')]=function(_0x523ac7,_0x583b4c){if(_0x523ac7[_0x46eb('0x47')]['id']){delete _0x523ac7[_0x46eb('0x47')]['id'];}return db[_0x46eb('0x3c')][_0x46eb('0x44')]({'where':{'id':_0x523ac7[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x583b4c,null))[_0x46eb('0x24')](saveUpdates(_0x523ac7[_0x46eb('0x47')],null))[_0x46eb('0x24')](respondWithResult(_0x583b4c,null))['catch'](handleError(_0x583b4c,null));};exports[_0x46eb('0x25')]=function(_0x26d992,_0x369a3b){return db[_0x46eb('0x3c')][_0x46eb('0x44')]({'where':{'id':_0x26d992[_0x46eb('0x40')]['id']}})['then'](handleEntityNotFound(_0x369a3b,null))['then'](removeEntity(_0x369a3b,null))[_0x46eb('0x45')](handleError(_0x369a3b,null));};exports[_0x46eb('0x48')]=function(_0x1b87b4,_0x5d93c2,_0x21f3c2){var _0x43dfb8={};var _0x285d62={};var _0x1af462;var _0x428159;return db[_0x46eb('0x3c')]['findOne']({'where':{'id':_0x1b87b4['params']['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x5d93c2,null))['then'](function(_0x28c020){if(_0x28c020){_0x1af462=_0x28c020;_0x285d62[_0x46eb('0x30')]=_[_0x46eb('0x41')](db[_0x46eb('0x49')][_0x46eb('0x2c')]);_0x285d62[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x1b87b4[_0x46eb('0x31')]);_0x285d62['filters']=_[_0x46eb('0x33')](_0x285d62['model'],_0x285d62['query']);_0x43dfb8['attributes']=_[_0x46eb('0x33')](_0x285d62[_0x46eb('0x30')],qs[_0x46eb('0x34')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x34')]));_0x43dfb8[_0x46eb('0x35')]=_0x43dfb8[_0x46eb('0x35')]['length']?_0x43dfb8['attributes']:_0x285d62['model'];_0x43dfb8['order']=qs[_0x46eb('0x37')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x37')]);_0x43dfb8[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x1b87b4[_0x46eb('0x31')],_0x285d62[_0x46eb('0x32')]));if(_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x3b')]){_0x43dfb8['where']=_[_0x46eb('0x3a')](_0x43dfb8['where'],{'$or':_[_0x46eb('0x2b')](_0x43dfb8[_0x46eb('0x35')],function(_0x1b79fa){var _0x2d6fd0={};_0x2d6fd0[_0x1b79fa]={'$like':'%'+_0x1b87b4['query']['filter']+'%'};return _0x2d6fd0;})});}_0x43dfb8=_['merge']({},_0x43dfb8,_0x1b87b4[_0x46eb('0x43')]);return _0x1af462['getFields'](_0x43dfb8);}})['then'](function(_0x2b1ea7){if(_0x2b1ea7){_0x428159=_0x2b1ea7[_0x46eb('0x42')];if(!_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x43dfb8[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x1b87b4['query'][_0x46eb('0x1e')]);_0x43dfb8[_0x46eb('0x1c')]=qs[_0x46eb('0x1c')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x1af462['getFields'](_0x43dfb8);}})[_0x46eb('0x24')](function(_0x53700b){if(_0x53700b){return _0x53700b?{'count':_0x428159,'rows':_0x53700b}:null;}})[_0x46eb('0x24')](respondWithResult(_0x5d93c2,null))[_0x46eb('0x45')](handleError(_0x5d93c2,null));};exports['getSubjects']=function(_0x3a630a,_0x512498,_0x1a53e4){var _0xa83bda={};var _0x4ed0ec={};var _0x54c93d;var _0x5a5f2c;return db[_0x46eb('0x3c')]['findOne']({'where':{'id':_0x3a630a[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x512498,null))[_0x46eb('0x24')](function(_0x190b06){if(_0x190b06){_0x54c93d=_0x190b06;_0x4ed0ec[_0x46eb('0x30')]=_['keys'](db['DeskField']['rawAttributes']);_0x4ed0ec['query']=_['keys'](_0x3a630a[_0x46eb('0x31')]);_0x4ed0ec[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x4ed0ec[_0x46eb('0x30')],_0x4ed0ec[_0x46eb('0x31')]);_0xa83bda[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x4ed0ec['model'],qs[_0x46eb('0x34')](_0x3a630a[_0x46eb('0x31')]['fields']));_0xa83bda[_0x46eb('0x35')]=_0xa83bda[_0x46eb('0x35')][_0x46eb('0x42')]?_0xa83bda[_0x46eb('0x35')]:_0x4ed0ec[_0x46eb('0x30')];_0xa83bda[_0x46eb('0x4b')]=qs[_0x46eb('0x37')](_0x3a630a[_0x46eb('0x31')][_0x46eb('0x37')]);_0xa83bda[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x3a630a[_0x46eb('0x31')],_0x4ed0ec[_0x46eb('0x32')]));if(_0x3a630a[_0x46eb('0x31')]['filter']){_0xa83bda[_0x46eb('0x38')]=_['merge'](_0xa83bda[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0xa83bda['attributes'],function(_0x16b4f3){var _0x29d494={};_0x29d494[_0x16b4f3]={'$like':'%'+_0x3a630a[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x29d494;})});}_0xa83bda=_['merge']({},_0xa83bda,_0x3a630a[_0x46eb('0x43')]);return _0x54c93d[_0x46eb('0x4c')](_0xa83bda);}})['then'](function(_0x54a01a){if(_0x54a01a){_0x5a5f2c=_0x54a01a[_0x46eb('0x42')];if(!_0x3a630a[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0xa83bda[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x3a630a['query'][_0x46eb('0x1e')]);_0xa83bda[_0x46eb('0x1c')]=qs['offset'](_0x3a630a[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x54c93d[_0x46eb('0x4c')](_0xa83bda);}})[_0x46eb('0x24')](function(_0x32c641){if(_0x32c641){return _0x32c641?{'count':_0x5a5f2c,'rows':_0x32c641}:null;}})[_0x46eb('0x24')](respondWithResult(_0x512498,null))['catch'](handleError(_0x512498,null));};exports[_0x46eb('0x4d')]=function(_0x23f66a,_0x10f286,_0x1dce69){var _0x409ee0={};var _0x2c56df={};var _0x4f612f;var _0x237864;return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0x23f66a['params']['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x10f286,null))['then'](function(_0x493050){if(_0x493050){_0x4f612f=_0x493050;_0x2c56df['model']=_[_0x46eb('0x41')](db[_0x46eb('0x49')][_0x46eb('0x2c')]);_0x2c56df[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x23f66a['query']);_0x2c56df[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x2c56df[_0x46eb('0x30')],_0x2c56df[_0x46eb('0x31')]);_0x409ee0[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x2c56df[_0x46eb('0x30')],qs['fields'](_0x23f66a['query'][_0x46eb('0x34')]));_0x409ee0[_0x46eb('0x35')]=_0x409ee0[_0x46eb('0x35')][_0x46eb('0x42')]?_0x409ee0['attributes']:_0x2c56df[_0x46eb('0x30')];_0x409ee0[_0x46eb('0x4b')]=qs['sort'](_0x23f66a['query']['sort']);_0x409ee0[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_['pick'](_0x23f66a[_0x46eb('0x31')],_0x2c56df[_0x46eb('0x32')]));if(_0x23f66a['query'][_0x46eb('0x3b')]){_0x409ee0[_0x46eb('0x38')]=_['merge'](_0x409ee0[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0x409ee0[_0x46eb('0x35')],function(_0x2d2b2d){var _0x31effe={};_0x31effe[_0x2d2b2d]={'$like':'%'+_0x23f66a[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x31effe;})});}_0x409ee0=_[_0x46eb('0x3a')]({},_0x409ee0,_0x23f66a[_0x46eb('0x43')]);return _0x4f612f[_0x46eb('0x4d')](_0x409ee0);}})[_0x46eb('0x24')](function(_0x311fff){if(_0x311fff){_0x237864=_0x311fff[_0x46eb('0x42')];if(!_0x23f66a['query'][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x409ee0[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x23f66a[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x409ee0[_0x46eb('0x1c')]=qs['offset'](_0x23f66a[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x4f612f[_0x46eb('0x4d')](_0x409ee0);}})[_0x46eb('0x24')](function(_0x35832e){if(_0x35832e){return _0x35832e?{'count':_0x237864,'rows':_0x35832e}:null;}})[_0x46eb('0x24')](respondWithResult(_0x10f286,null))[_0x46eb('0x45')](handleError(_0x10f286,null));};exports[_0x46eb('0x4f')]=function(_0x181721,_0x40dee0,_0xedaee9){var _0x30aa58={};var _0x519970={};var _0x208c0d;var _0x423c89;return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0x181721[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x40dee0,null))[_0x46eb('0x24')](function(_0x239bbf){if(_0x239bbf){_0x208c0d=_0x239bbf;_0x519970[_0x46eb('0x30')]=_[_0x46eb('0x41')](db[_0x46eb('0x50')][_0x46eb('0x2c')]);_0x519970[_0x46eb('0x31')]=_['keys'](_0x181721['query']);_0x519970[_0x46eb('0x32')]=_['intersection'](_0x519970[_0x46eb('0x30')],_0x519970[_0x46eb('0x31')]);_0x30aa58[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x519970[_0x46eb('0x30')],qs[_0x46eb('0x34')](_0x181721[_0x46eb('0x31')][_0x46eb('0x34')]));_0x30aa58[_0x46eb('0x35')]=_0x30aa58[_0x46eb('0x35')][_0x46eb('0x42')]?_0x30aa58[_0x46eb('0x35')]:_0x519970[_0x46eb('0x30')];_0x30aa58[_0x46eb('0x4b')]=qs[_0x46eb('0x37')](_0x181721['query']['sort']);_0x30aa58[_0x46eb('0x38')]=qs['filters'](_[_0x46eb('0x39')](_0x181721[_0x46eb('0x31')],_0x519970[_0x46eb('0x32')]));if(_0x181721[_0x46eb('0x31')][_0x46eb('0x3b')]){_0x30aa58['where']=_['merge'](_0x30aa58[_0x46eb('0x38')],{'$or':_['map'](_0x30aa58[_0x46eb('0x35')],function(_0xee7845){var _0x56813e={};_0x56813e[_0xee7845]={'$like':'%'+_0x181721[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x56813e;})});}_0x30aa58=_[_0x46eb('0x3a')]({},_0x30aa58,_0x181721[_0x46eb('0x43')]);return _0x208c0d['getTags'](_0x30aa58);}})['then'](function(_0x40c367){if(_0x40c367){_0x423c89=_0x40c367['length'];if(!_0x181721[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x30aa58[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x181721[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x30aa58['offset']=qs[_0x46eb('0x1c')](_0x181721[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x208c0d[_0x46eb('0x4f')](_0x30aa58);}})[_0x46eb('0x24')](function(_0x257ec7){if(_0x257ec7){return _0x257ec7?{'count':_0x423c89,'rows':_0x257ec7}:null;}})[_0x46eb('0x24')](respondWithResult(_0x40dee0,null))[_0x46eb('0x45')](handleError(_0x40dee0,null));};exports[_0x46eb('0x51')]=function(_0xc1f8ff,_0x12e504,_0x41bd58){if(_0xc1f8ff[_0x46eb('0x47')]['id']){delete _0xc1f8ff[_0x46eb('0x47')]['id'];}return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0xc1f8ff[_0x46eb('0x40')]['id']}})['then'](handleEntityNotFound(_0x12e504,null))[_0x46eb('0x24')](function(_0x5013d0){if(_0x5013d0){return _0x5013d0[_0x46eb('0x51')](_0xc1f8ff[_0x46eb('0x47')]['ids']||[]);}return null;})[_0x46eb('0x24')](respondWithResult(_0x12e504,null))[_0x46eb('0x45')](handleError(_0x12e504,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 9e83a5d..b4daffa 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 _0x284f=['../../config/logger','api','moment','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x3af150,_0x17ddfe){var _0x1eb695=function(_0x39f5b1){while(--_0x39f5b1){_0x3af150['push'](_0x3af150['shift']());}};_0x1eb695(++_0x17ddfe);}(_0x284f,0x6c));var _0xf284=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x284f[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xf284('0x0'));var util=require(_0xf284('0x1'));var logger=require(_0xf284('0x2'))(_0xf284('0x3'));var moment=require(_0xf284('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf284('0x5'));var attributes=require(_0xf284('0x6'));module[_0xf284('0x7')]=function(_0x288f2f,_0x2d81b7){return _0x288f2f[_0xf284('0x8')](_0xf284('0x9'),attributes,{'tableName':_0xf284('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6de9=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6de9,0xe6));var _0x96de=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6de9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x96de('0x0'));var util=require(_0x96de('0x1'));var logger=require(_0x96de('0x2'))(_0x96de('0x3'));var moment=require(_0x96de('0x4'));var BPromise=require('bluebird');var rp=require(_0x96de('0x5'));var fs=require('fs');var path=require(_0x96de('0x6'));var rimraf=require('rimraf');var config=require(_0x96de('0x7'));var attributes=require(_0x96de('0x8'));module['exports']=function(_0x84f9b0,_0x24da4e){return _0x84f9b0[_0x96de('0x9')](_0x96de('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index a9d7b81..467f132 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 _0x3e2a=['../../config/logger','../../config/environment','client','http','request','info','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x585f85,_0xcaf1d0){var _0x564eff=function(_0x3106f1){while(--_0x3106f1){_0x585f85['push'](_0x585f85['shift']());}};_0x564eff(++_0xcaf1d0);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x447114,_0xfc226b){_0x447114=_0x447114-0x0;var _0x5cdffb=_0x3e2a[_0x447114];return _0x5cdffb;};'use strict';var _=require(_0xa3e2('0x0'));var util=require(_0xa3e2('0x1'));var moment=require(_0xa3e2('0x2'));var BPromise=require(_0xa3e2('0x3'));var rs=require(_0xa3e2('0x4'));var fs=require('fs');var Redis=require(_0xa3e2('0x5'));var db=require(_0xa3e2('0x6'))['db'];var utils=require(_0xa3e2('0x7'));var logger=require(_0xa3e2('0x8'))('rpc');var config=require(_0xa3e2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa3e2('0xa')][_0xa3e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a5ae5,_0xb5d12b,_0x1ef5bd){return new BPromise(function(_0x51fc2d,_0xb676f7){return client[_0xa3e2('0xc')](_0x2a5ae5,_0x1ef5bd)['then'](function(_0x3b5326){logger[_0xa3e2('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0xb5d12b,'request\x20sent');logger['debug'](_0xa3e2('0xe'),_0xb5d12b,_0xa3e2('0xf'),JSON[_0xa3e2('0x10')](_0x3b5326));if(_0x3b5326['error']){if(_0x3b5326[_0xa3e2('0x11')][_0xa3e2('0x12')]===0x1f4){logger[_0xa3e2('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0xb5d12b,_0x3b5326[_0xa3e2('0x11')][_0xa3e2('0x13')]);return _0xb676f7(_0x3b5326['error'][_0xa3e2('0x13')]);}logger[_0xa3e2('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0xb5d12b,_0x3b5326[_0xa3e2('0x11')]['message']);return _0x51fc2d(_0x3b5326['error'][_0xa3e2('0x13')]);}else{logger[_0xa3e2('0xd')](_0xa3e2('0x14'),_0xb5d12b,'request\x20sent');_0x51fc2d(_0x3b5326[_0xa3e2('0x15')]['message']);}})[_0xa3e2('0x16')](function(_0x4995b1){logger[_0xa3e2('0x11')](_0xa3e2('0x14'),_0xb5d12b,_0x4995b1);_0xb676f7(_0x4995b1);});});} \ No newline at end of file +var _0xaf97=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xaf97,0x15a));var _0x7af9=function(_0x410d5e,_0x5e9946){_0x410d5e=_0x410d5e-0x0;var _0xac4e89=_0xaf97[_0x410d5e];return _0xac4e89;};'use strict';var _=require(_0x7af9('0x0'));var util=require(_0x7af9('0x1'));var moment=require(_0x7af9('0x2'));var BPromise=require(_0x7af9('0x3'));var rs=require(_0x7af9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7af9('0x5'))['db'];var utils=require(_0x7af9('0x6'));var logger=require(_0x7af9('0x7'))(_0x7af9('0x8'));var config=require('../../config/environment');var jayson=require(_0x7af9('0x9'));var client=jayson[_0x7af9('0xa')][_0x7af9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369746,_0x5c98b8,_0x1e9ccc){return new BPromise(function(_0x2055c2,_0x2963b7){return client[_0x7af9('0xc')](_0x369746,_0x1e9ccc)[_0x7af9('0xd')](function(_0x44867d){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5c98b8,_0x7af9('0xe'));logger[_0x7af9('0xf')](_0x7af9('0x10'),_0x5c98b8,'request\x20sent',JSON[_0x7af9('0x11')](_0x44867d));if(_0x44867d[_0x7af9('0x12')]){if(_0x44867d[_0x7af9('0x12')]['code']===0x1f4){logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2963b7(_0x44867d[_0x7af9('0x12')]['message']);}logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2055c2(_0x44867d['error'][_0x7af9('0x14')]);}else{logger[_0x7af9('0x15')](_0x7af9('0x13'),_0x5c98b8,_0x7af9('0xe'));_0x2055c2(_0x44867d[_0x7af9('0x16')][_0x7af9('0x14')]);}})[_0x7af9('0x17')](function(_0x238814){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5c98b8,_0x238814);_0x2963b7(_0x238814);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 90b124d..70f8761 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 _0x21bd=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','create','put'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x21bd,0x157));var _0xd21b=function(_0x4c33bb,_0x1c04c0){_0x4c33bb=_0x4c33bb-0x0;var _0x3e49d4=_0x21bd[_0x4c33bb];return _0x3e49d4;};'use strict';var multer=require(_0xd21b('0x0'));var util=require(_0xd21b('0x1'));var path=require(_0xd21b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd21b('0x3'));var router=express[_0xd21b('0x4')]();var fs_extra=require(_0xd21b('0x5'));var auth=require(_0xd21b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd21b('0x7'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xd21b('0x8')](),controller[_0xd21b('0x9')]);router['get'](_0xd21b('0xa'),auth[_0xd21b('0x8')](),controller[_0xd21b('0xb')]);router['post']('/',auth[_0xd21b('0x8')](),controller[_0xd21b('0xc')]);router[_0xd21b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd21b('0xe')]);router[_0xd21b('0xf')](_0xd21b('0xa'),auth['isAuthenticated'](),controller[_0xd21b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6333=['get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x3ae96c,_0x5f1e7e){var _0x1b0c90=function(_0x1ecc83){while(--_0x1ecc83){_0x3ae96c['push'](_0x3ae96c['shift']());}};_0x1b0c90(++_0x5f1e7e);}(_0x6333,0x185));var _0x3633=function(_0x5de3ed,_0x3ae98f){_0x5de3ed=_0x5de3ed-0x0;var _0x5d2a2c=_0x6333[_0x5de3ed];return _0x5d2a2c;};'use strict';var multer=require(_0x3633('0x0'));var util=require(_0x3633('0x1'));var path=require(_0x3633('0x2'));var timeout=require('connect-timeout');var express=require(_0x3633('0x3'));var router=express[_0x3633('0x4')]();var fs_extra=require(_0x3633('0x5'));var auth=require(_0x3633('0x6'));var interaction=require(_0x3633('0x7'));var config=require(_0x3633('0x8'));var controller=require(_0x3633('0x9'));router[_0x3633('0xa')]('/',auth[_0x3633('0xb')](),controller['index']);router[_0x3633('0xa')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0xd')]);router['post']('/',auth[_0x3633('0xb')](),controller[_0x3633('0xe')]);router[_0x3633('0xf')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0x10')]);router[_0x3633('0x11')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 5bb117d..5cb7b00 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 _0x2ae3=['keyValue','picklist','string','STRING','ENUM','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x48e92c,_0x530b26){var _0x26e351=function(_0x49d96d){while(--_0x49d96d){_0x48e92c['push'](_0x48e92c['shift']());}};_0x26e351(++_0x530b26);}(_0x2ae3,0x10b));var _0x32ae=function(_0x32bab7,_0x140c56){_0x32bab7=_0x32bab7-0x0;var _0x214ac2=_0x2ae3[_0x32bab7];return _0x214ac2;};'use strict';var Sequelize=require(_0x32ae('0x0'));module[_0x32ae('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x32ae('0x2'),_0x32ae('0x3'),_0x32ae('0x4')),'defaultValue':_0x32ae('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x32ae('0x6')]},'keyType':{'type':Sequelize[_0x32ae('0x7')](_0x32ae('0x5'),_0x32ae('0x8'),_0x32ae('0x2'))},'keyContent':{'type':Sequelize[_0x32ae('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x32ae('0x6')]},'customField':{'type':Sequelize[_0x32ae('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32ae('0x6')]}}; \ No newline at end of file +var _0x5dcc=['exports','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5dcc,0x1b0));var _0xc5dc=function(_0x2bb53e,_0x535eff){_0x2bb53e=_0x2bb53e-0x0;var _0x57f74b=_0x5dcc[_0x2bb53e];return _0x57f74b;};'use strict';var Sequelize=require('sequelize');module[_0xc5dc('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc5dc('0x1'),_0xc5dc('0x2'),'customVariable',_0xc5dc('0x3'),'picklist'),'defaultValue':_0xc5dc('0x1')},'content':{'type':Sequelize[_0xc5dc('0x4')]},'key':{'type':Sequelize[_0xc5dc('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc5dc('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc5dc('0x4')]},'customField':{'type':Sequelize[_0xc5dc('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc5dc('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index eb8cdbb..bbb793e 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 _0xe928=['count','set','reject','save','destroy','then','end','name','send','map','DeskField','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','bluebird','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xe928,0x145));var _0x8e92=function(_0x29178c,_0x5e1efd){_0x29178c=_0x29178c-0x0;var _0x4dd2c7=_0xe928[_0x29178c];return _0x4dd2c7;};'use strict';var emlformat=require(_0x8e92('0x0'));var rimraf=require(_0x8e92('0x1'));var zipdir=require(_0x8e92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e92('0x3'));var moment=require('moment');var BPromise=require(_0x8e92('0x4'));var Mustache=require(_0x8e92('0x5'));var util=require(_0x8e92('0x6'));var path=require(_0x8e92('0x7'));var sox=require('sox');var csv=require(_0x8e92('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e92('0x9'));var _=require(_0x8e92('0xa'));var squel=require(_0x8e92('0xb'));var crypto=require(_0x8e92('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8e92('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e92('0xe'));var Papa=require(_0x8e92('0xf'));var Redis=require(_0x8e92('0x10'));var authService=require(_0x8e92('0x11'));var qs=require(_0x8e92('0x12'));var as=require(_0x8e92('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e92('0x14'))(_0x8e92('0x15'));var utils=require(_0x8e92('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8e92('0x17'));var db=require(_0x8e92('0x18'))['db'];function respondWithStatusCode(_0x3cbe0a,_0x3b19fa){_0x3b19fa=_0x3b19fa||0xcc;return function(_0x324f3f){if(_0x324f3f){return _0x3cbe0a[_0x8e92('0x19')](_0x3b19fa);}return _0x3cbe0a[_0x8e92('0x1a')](_0x3b19fa)['end']();};}function respondWithResult(_0x97be72,_0x5c06fd){_0x5c06fd=_0x5c06fd||0xc8;return function(_0x1cf5ee){if(_0x1cf5ee){return _0x97be72[_0x8e92('0x1a')](_0x5c06fd)['json'](_0x1cf5ee);}};}function respondWithFilteredResult(_0x101ea1,_0x57ff38){return function(_0x1d866f){if(_0x1d866f){var _0x26cce1=typeof _0x57ff38[_0x8e92('0x1b')]===_0x8e92('0x1c')&&typeof _0x57ff38[_0x8e92('0x1d')]===_0x8e92('0x1c');var _0x182e05=_0x1d866f[_0x8e92('0x1e')];var _0x55f325=_0x26cce1?0x0:_0x57ff38[_0x8e92('0x1b')];var _0x192b0b=_0x26cce1?_0x1d866f[_0x8e92('0x1e')]:_0x57ff38[_0x8e92('0x1b')]+_0x57ff38[_0x8e92('0x1d')];var _0x5ab67b;if(_0x192b0b>=_0x182e05){_0x192b0b=_0x182e05;_0x5ab67b=0xc8;}else{_0x5ab67b=0xce;}_0x101ea1[_0x8e92('0x1a')](_0x5ab67b);return _0x101ea1[_0x8e92('0x1f')]('Content-Range',_0x55f325+'-'+_0x192b0b+'/'+_0x182e05)['json'](_0x1d866f);}return null;};}function patchUpdates(_0x558694){return function(_0x334628){try{jsonpatch['apply'](_0x334628,_0x558694,!![]);}catch(_0x3d23f1){return BPromise[_0x8e92('0x20')](_0x3d23f1);}return _0x334628[_0x8e92('0x21')]();};}function saveUpdates(_0x3147ef,_0x368253){return function(_0x70f846){if(_0x70f846){return _0x70f846['update'](_0x3147ef)['then'](function(_0x53b5aa){return _0x53b5aa;});}return null;};}function removeEntity(_0x5b5ea2,_0x322765){return function(_0x3a86e4){if(_0x3a86e4){return _0x3a86e4[_0x8e92('0x22')]()[_0x8e92('0x23')](function(){_0x5b5ea2[_0x8e92('0x1a')](0xcc)[_0x8e92('0x24')]();});}};}function handleEntityNotFound(_0x585adb,_0x1b0e14){return function(_0x22cdbe){if(!_0x22cdbe){_0x585adb[_0x8e92('0x19')](0x194);}return _0x22cdbe;};}function handleError(_0x127fff,_0x40b576){_0x40b576=_0x40b576||0x1f4;return function(_0x2aaf1d){logger['error'](_0x2aaf1d['stack']);if(_0x2aaf1d['name']){delete _0x2aaf1d[_0x8e92('0x25')];}_0x127fff['status'](_0x40b576)[_0x8e92('0x26')](_0x2aaf1d);};}exports['index']=function(_0x3bfb1e,_0x492c89){var _0x208384={},_0x57c4de={},_0xc7e9c0={'count':0x0,'rows':[]};var _0x3c8897=_[_0x8e92('0x27')](db[_0x8e92('0x28')]['rawAttributes'],function(_0x456d0b){return{'name':_0x456d0b[_0x8e92('0x29')],'type':_0x456d0b['type'][_0x8e92('0x2a')]};});_0x57c4de['model']=_[_0x8e92('0x27')](_0x3c8897,_0x8e92('0x25'));_0x57c4de['query']=_[_0x8e92('0x2b')](_0x3bfb1e[_0x8e92('0x2c')]);_0x57c4de[_0x8e92('0x2d')]=_[_0x8e92('0x2e')](_0x57c4de[_0x8e92('0x2f')],_0x57c4de[_0x8e92('0x2c')]);_0x208384[_0x8e92('0x30')]=_[_0x8e92('0x2e')](_0x57c4de[_0x8e92('0x2f')],qs['fields'](_0x3bfb1e['query'][_0x8e92('0x31')]));_0x208384['attributes']=_0x208384['attributes'][_0x8e92('0x32')]?_0x208384[_0x8e92('0x30')]:_0x57c4de[_0x8e92('0x2f')];if(!_0x3bfb1e['query'][_0x8e92('0x33')](_0x8e92('0x34'))){_0x208384[_0x8e92('0x1d')]=qs['limit'](_0x3bfb1e['query'][_0x8e92('0x1d')]);_0x208384['offset']=qs[_0x8e92('0x1b')](_0x3bfb1e[_0x8e92('0x2c')][_0x8e92('0x1b')]);}_0x208384[_0x8e92('0x35')]=qs[_0x8e92('0x36')](_0x3bfb1e['query'][_0x8e92('0x36')]);_0x208384[_0x8e92('0x37')]=qs[_0x8e92('0x2d')](_['pick'](_0x3bfb1e['query'],_0x57c4de[_0x8e92('0x2d')]),_0x3c8897);if(_0x3bfb1e['query'][_0x8e92('0x38')]){_0x208384[_0x8e92('0x37')]=_[_0x8e92('0x39')](_0x208384[_0x8e92('0x37')],{'$or':_['map'](_0x3c8897,function(_0x4b74c4){if(_0x4b74c4['type']!==_0x8e92('0x3a')){var _0x5c5f5d={};_0x5c5f5d[_0x4b74c4[_0x8e92('0x25')]]={'$like':'%'+_0x3bfb1e['query']['filter']+'%'};return _0x5c5f5d;}})});}_0x208384=_['merge']({},_0x208384,_0x3bfb1e[_0x8e92('0x3b')]);var _0x3c3d83={'where':_0x208384[_0x8e92('0x37')]};return db[_0x8e92('0x28')][_0x8e92('0x1e')](_0x3c3d83)[_0x8e92('0x23')](function(_0x5e0f6f){_0xc7e9c0[_0x8e92('0x1e')]=_0x5e0f6f;if(_0x3bfb1e[_0x8e92('0x2c')][_0x8e92('0x3c')]){_0x208384[_0x8e92('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x8e92('0x3e')](_0x208384);})[_0x8e92('0x23')](function(_0x5c4a29){_0xc7e9c0[_0x8e92('0x3f')]=_0x5c4a29;return _0xc7e9c0;})[_0x8e92('0x23')](respondWithFilteredResult(_0x492c89,_0x208384))['catch'](handleError(_0x492c89,null));};exports['show']=function(_0x105114,_0x4fd1e2){var _0x543e7f={'raw':!![],'where':{'id':_0x105114[_0x8e92('0x40')]['id']}},_0x4e9683={};_0x4e9683[_0x8e92('0x2f')]=_['keys'](db[_0x8e92('0x28')][_0x8e92('0x41')]);_0x4e9683[_0x8e92('0x2c')]=_[_0x8e92('0x2b')](_0x105114['query']);_0x4e9683[_0x8e92('0x2d')]=_['intersection'](_0x4e9683[_0x8e92('0x2f')],_0x4e9683[_0x8e92('0x2c')]);_0x543e7f['attributes']=_[_0x8e92('0x2e')](_0x4e9683[_0x8e92('0x2f')],qs[_0x8e92('0x31')](_0x105114[_0x8e92('0x2c')][_0x8e92('0x31')]));_0x543e7f[_0x8e92('0x30')]=_0x543e7f[_0x8e92('0x30')][_0x8e92('0x32')]?_0x543e7f[_0x8e92('0x30')]:_0x4e9683[_0x8e92('0x2f')];if(_0x105114[_0x8e92('0x2c')][_0x8e92('0x3c')]){_0x543e7f['include']=[{'all':!![]}];}_0x543e7f=_[_0x8e92('0x39')]({},_0x543e7f,_0x105114[_0x8e92('0x3b')]);return db[_0x8e92('0x28')][_0x8e92('0x42')](_0x543e7f)['then'](handleEntityNotFound(_0x4fd1e2,null))[_0x8e92('0x23')](respondWithResult(_0x4fd1e2,null))[_0x8e92('0x43')](handleError(_0x4fd1e2,null));};exports[_0x8e92('0x44')]=function(_0x508c6e,_0x33e097){return db[_0x8e92('0x28')][_0x8e92('0x44')](_0x508c6e[_0x8e92('0x45')],{})[_0x8e92('0x23')](respondWithResult(_0x33e097,0xc9))[_0x8e92('0x43')](handleError(_0x33e097,null));};exports[_0x8e92('0x46')]=function(_0x399047,_0x113a6a){if(_0x399047[_0x8e92('0x45')]['id']){delete _0x399047[_0x8e92('0x45')]['id'];}return db[_0x8e92('0x28')]['find']({'where':{'id':_0x399047[_0x8e92('0x40')]['id']}})[_0x8e92('0x23')](handleEntityNotFound(_0x113a6a,null))[_0x8e92('0x23')](saveUpdates(_0x399047[_0x8e92('0x45')],null))[_0x8e92('0x23')](respondWithResult(_0x113a6a,null))[_0x8e92('0x43')](handleError(_0x113a6a,null));};exports['destroy']=function(_0x2baafa,_0x3d6991){return db[_0x8e92('0x28')][_0x8e92('0x42')]({'where':{'id':_0x2baafa[_0x8e92('0x40')]['id']}})[_0x8e92('0x23')](handleEntityNotFound(_0x3d6991,null))[_0x8e92('0x23')](removeEntity(_0x3d6991,null))[_0x8e92('0x43')](handleError(_0x3d6991,null));}; \ No newline at end of file +var _0x83d0=['sendStatus','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','filters','fields','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy'];(function(_0x1bdf2a,_0x27dd26){var _0x1703ae=function(_0x4f06f8){while(--_0x4f06f8){_0x1bdf2a['push'](_0x1bdf2a['shift']());}};_0x1703ae(++_0x27dd26);}(_0x83d0,0xb7));var _0x083d=function(_0x253b3c,_0x159c39){_0x253b3c=_0x253b3c-0x0;var _0x56c104=_0x83d0[_0x253b3c];return _0x56c104;};'use strict';var emlformat=require(_0x083d('0x0'));var rimraf=require(_0x083d('0x1'));var zipdir=require(_0x083d('0x2'));var jsonpatch=require(_0x083d('0x3'));var rp=require(_0x083d('0x4'));var moment=require(_0x083d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x083d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x083d('0x7'));var csv=require(_0x083d('0x8'));var ejs=require(_0x083d('0x9'));var fs=require('fs');var fs_extra=require(_0x083d('0xa'));var _=require(_0x083d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x083d('0xc'));var deskjs=require(_0x083d('0xd'));var toCsv=require(_0x083d('0x8'));var querystring=require('querystring');var Papa=require(_0x083d('0xe'));var Redis=require(_0x083d('0xf'));var authService=require(_0x083d('0x10'));var qs=require(_0x083d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x083d('0x12'));var logger=require('../../config/logger')(_0x083d('0x13'));var utils=require(_0x083d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x083d('0x15'));var db=require(_0x083d('0x16'))['db'];function respondWithStatusCode(_0x23ccf2,_0x3e5be5){_0x3e5be5=_0x3e5be5||0xcc;return function(_0x3dfe4a){if(_0x3dfe4a){return _0x23ccf2['sendStatus'](_0x3e5be5);}return _0x23ccf2[_0x083d('0x17')](_0x3e5be5)[_0x083d('0x18')]();};}function respondWithResult(_0x4ee93c,_0x11c03f){_0x11c03f=_0x11c03f||0xc8;return function(_0x525a36){if(_0x525a36){return _0x4ee93c['status'](_0x11c03f)[_0x083d('0x19')](_0x525a36);}};}function respondWithFilteredResult(_0x3c95fe,_0x356d8e){return function(_0x20ca5f){if(_0x20ca5f){var _0x381455=typeof _0x356d8e['offset']===_0x083d('0x1a')&&typeof _0x356d8e['limit']===_0x083d('0x1a');var _0x28893f=_0x20ca5f[_0x083d('0x1b')];var _0xb34759=_0x381455?0x0:_0x356d8e[_0x083d('0x1c')];var _0x63c0b6=_0x381455?_0x20ca5f[_0x083d('0x1b')]:_0x356d8e[_0x083d('0x1c')]+_0x356d8e[_0x083d('0x1d')];var _0x2cb79c;if(_0x63c0b6>=_0x28893f){_0x63c0b6=_0x28893f;_0x2cb79c=0xc8;}else{_0x2cb79c=0xce;}_0x3c95fe[_0x083d('0x17')](_0x2cb79c);return _0x3c95fe[_0x083d('0x1e')]('Content-Range',_0xb34759+'-'+_0x63c0b6+'/'+_0x28893f)[_0x083d('0x19')](_0x20ca5f);}return null;};}function patchUpdates(_0x56d7f2){return function(_0x21ac51){try{jsonpatch[_0x083d('0x1f')](_0x21ac51,_0x56d7f2,!![]);}catch(_0x48bf68){return BPromise[_0x083d('0x20')](_0x48bf68);}return _0x21ac51['save']();};}function saveUpdates(_0x4efbea,_0x59828a){return function(_0xcde93c){if(_0xcde93c){return _0xcde93c[_0x083d('0x21')](_0x4efbea)[_0x083d('0x22')](function(_0x2669b6){return _0x2669b6;});}return null;};}function removeEntity(_0x1045c5,_0x1b2e65){return function(_0x5d8397){if(_0x5d8397){return _0x5d8397[_0x083d('0x23')]()[_0x083d('0x22')](function(){_0x1045c5['status'](0xcc)[_0x083d('0x18')]();});}};}function handleEntityNotFound(_0x38ca23,_0x33d32a){return function(_0x3117af){if(!_0x3117af){_0x38ca23[_0x083d('0x24')](0x194);}return _0x3117af;};}function handleError(_0x2ff697,_0x9bc640){_0x9bc640=_0x9bc640||0x1f4;return function(_0x3923ff){logger['error'](_0x3923ff[_0x083d('0x25')]);if(_0x3923ff['name']){delete _0x3923ff[_0x083d('0x26')];}_0x2ff697[_0x083d('0x17')](_0x9bc640)[_0x083d('0x27')](_0x3923ff);};}exports[_0x083d('0x28')]=function(_0x3e59d0,_0x13c376){var _0x2b4825={},_0xfbe79b={},_0x205e0c={'count':0x0,'rows':[]};var _0x3f41a4=_[_0x083d('0x29')](db[_0x083d('0x2a')][_0x083d('0x2b')],function(_0x2c7223){return{'name':_0x2c7223[_0x083d('0x2c')],'type':_0x2c7223['type'][_0x083d('0x2d')]};});_0xfbe79b[_0x083d('0x2e')]=_['map'](_0x3f41a4,'name');_0xfbe79b[_0x083d('0x2f')]=_['keys'](_0x3e59d0[_0x083d('0x2f')]);_0xfbe79b['filters']=_[_0x083d('0x30')](_0xfbe79b['model'],_0xfbe79b[_0x083d('0x2f')]);_0x2b4825[_0x083d('0x31')]=_[_0x083d('0x30')](_0xfbe79b['model'],qs['fields'](_0x3e59d0[_0x083d('0x2f')]['fields']));_0x2b4825[_0x083d('0x31')]=_0x2b4825[_0x083d('0x31')][_0x083d('0x32')]?_0x2b4825[_0x083d('0x31')]:_0xfbe79b['model'];if(!_0x3e59d0[_0x083d('0x2f')][_0x083d('0x33')](_0x083d('0x34'))){_0x2b4825[_0x083d('0x1d')]=qs['limit'](_0x3e59d0[_0x083d('0x2f')][_0x083d('0x1d')]);_0x2b4825[_0x083d('0x1c')]=qs[_0x083d('0x1c')](_0x3e59d0['query']['offset']);}_0x2b4825[_0x083d('0x35')]=qs[_0x083d('0x36')](_0x3e59d0[_0x083d('0x2f')][_0x083d('0x36')]);_0x2b4825[_0x083d('0x37')]=qs['filters'](_[_0x083d('0x38')](_0x3e59d0[_0x083d('0x2f')],_0xfbe79b['filters']),_0x3f41a4);if(_0x3e59d0[_0x083d('0x2f')]['filter']){_0x2b4825['where']=_[_0x083d('0x39')](_0x2b4825[_0x083d('0x37')],{'$or':_['map'](_0x3f41a4,function(_0x32e179){if(_0x32e179[_0x083d('0x3a')]!==_0x083d('0x3b')){var _0x594327={};_0x594327[_0x32e179['name']]={'$like':'%'+_0x3e59d0['query']['filter']+'%'};return _0x594327;}})});}_0x2b4825=_[_0x083d('0x39')]({},_0x2b4825,_0x3e59d0[_0x083d('0x3c')]);var _0x2c8196={'where':_0x2b4825[_0x083d('0x37')]};return db['DeskField'][_0x083d('0x1b')](_0x2c8196)[_0x083d('0x22')](function(_0x5706d1){_0x205e0c[_0x083d('0x1b')]=_0x5706d1;if(_0x3e59d0[_0x083d('0x2f')][_0x083d('0x3d')]){_0x2b4825[_0x083d('0x3e')]=[{'all':!![]}];}return db[_0x083d('0x2a')][_0x083d('0x3f')](_0x2b4825);})[_0x083d('0x22')](function(_0x30b913){_0x205e0c['rows']=_0x30b913;return _0x205e0c;})[_0x083d('0x22')](respondWithFilteredResult(_0x13c376,_0x2b4825))[_0x083d('0x40')](handleError(_0x13c376,null));};exports[_0x083d('0x41')]=function(_0x19302d,_0x2fd7cb){var _0x3cf0fb={'raw':!![],'where':{'id':_0x19302d['params']['id']}},_0x11b872={};_0x11b872[_0x083d('0x2e')]=_[_0x083d('0x42')](db['DeskField'][_0x083d('0x2b')]);_0x11b872[_0x083d('0x2f')]=_[_0x083d('0x42')](_0x19302d[_0x083d('0x2f')]);_0x11b872[_0x083d('0x43')]=_['intersection'](_0x11b872[_0x083d('0x2e')],_0x11b872[_0x083d('0x2f')]);_0x3cf0fb[_0x083d('0x31')]=_[_0x083d('0x30')](_0x11b872[_0x083d('0x2e')],qs['fields'](_0x19302d[_0x083d('0x2f')][_0x083d('0x44')]));_0x3cf0fb[_0x083d('0x31')]=_0x3cf0fb[_0x083d('0x31')][_0x083d('0x32')]?_0x3cf0fb[_0x083d('0x31')]:_0x11b872['model'];if(_0x19302d[_0x083d('0x2f')][_0x083d('0x3d')]){_0x3cf0fb[_0x083d('0x3e')]=[{'all':!![]}];}_0x3cf0fb=_[_0x083d('0x39')]({},_0x3cf0fb,_0x19302d[_0x083d('0x3c')]);return db[_0x083d('0x2a')][_0x083d('0x45')](_0x3cf0fb)['then'](handleEntityNotFound(_0x2fd7cb,null))['then'](respondWithResult(_0x2fd7cb,null))['catch'](handleError(_0x2fd7cb,null));};exports[_0x083d('0x46')]=function(_0x509b72,_0x4268bc){return db[_0x083d('0x2a')][_0x083d('0x46')](_0x509b72[_0x083d('0x47')],{})['then'](respondWithResult(_0x4268bc,0xc9))[_0x083d('0x40')](handleError(_0x4268bc,null));};exports[_0x083d('0x21')]=function(_0x2b0f33,_0x235998){if(_0x2b0f33[_0x083d('0x47')]['id']){delete _0x2b0f33['body']['id'];}return db['DeskField']['find']({'where':{'id':_0x2b0f33[_0x083d('0x48')]['id']}})[_0x083d('0x22')](handleEntityNotFound(_0x235998,null))[_0x083d('0x22')](saveUpdates(_0x2b0f33[_0x083d('0x47')],null))[_0x083d('0x22')](respondWithResult(_0x235998,null))[_0x083d('0x40')](handleError(_0x235998,null));};exports[_0x083d('0x23')]=function(_0x6c2794,_0x35252d){return db['DeskField']['find']({'where':{'id':_0x6c2794[_0x083d('0x48')]['id']}})['then'](handleEntityNotFound(_0x35252d,null))[_0x083d('0x22')](removeEntity(_0x35252d,null))[_0x083d('0x40')](handleError(_0x35252d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1eb2cf1..e72aa40 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 _0xa3ec=['./intDeskField.attributes','exports','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x306c02,_0x1912c0){var _0x5f6a4=function(_0x3b8663){while(--_0x3b8663){_0x306c02['push'](_0x306c02['shift']());}};_0x5f6a4(++_0x1912c0);}(_0xa3ec,0x1cd));var _0xca3e=function(_0x580821,_0x276a7c){_0x580821=_0x580821-0x0;var _0x368d86=_0xa3ec[_0x580821];return _0x368d86;};'use strict';var _=require(_0xca3e('0x0'));var util=require(_0xca3e('0x1'));var logger=require(_0xca3e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca3e('0x3'));var fs=require('fs');var path=require(_0xca3e('0x4'));var rimraf=require(_0xca3e('0x5'));var config=require(_0xca3e('0x6'));var attributes=require(_0xca3e('0x7'));module[_0xca3e('0x8')]=function(_0x977bdd,_0x228435){return _0x977bdd['define'](_0xca3e('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xca3e('0xa'),'fields':[_0xca3e('0xb'),_0xca3e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05d6=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x05d6,0x134));var _0x605d=function(_0x3e38fc,_0x3a0824){_0x3e38fc=_0x3e38fc-0x0;var _0x807561=_0x05d6[_0x3e38fc];return _0x807561;};'use strict';var _=require(_0x605d('0x0'));var util=require(_0x605d('0x1'));var logger=require(_0x605d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x605d('0x3'));var rp=require(_0x605d('0x4'));var fs=require('fs');var path=require(_0x605d('0x5'));var rimraf=require(_0x605d('0x6'));var config=require(_0x605d('0x7'));var attributes=require(_0x605d('0x8'));module['exports']=function(_0x45d45e,_0x439ab7){return _0x45d45e[_0x605d('0x9')](_0x605d('0xa'),attributes,{'tableName':_0x605d('0xb'),'paranoid':![],'indexes':[{'name':_0x605d('0xc'),'fields':['idField',_0x605d('0xd')],'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 b107261..b8d097f 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 _0x50d4=['stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x188213,_0x156082){var _0x2a0e22=function(_0xca10b0){while(--_0xca10b0){_0x188213['push'](_0x188213['shift']());}};_0x2a0e22(++_0x156082);}(_0x50d4,0xa0));var _0x450d=function(_0x1034f8,_0x1ef446){_0x1034f8=_0x1034f8-0x0;var _0x4589c8=_0x50d4[_0x1034f8];return _0x4589c8;};'use strict';var _=require(_0x450d('0x0'));var util=require(_0x450d('0x1'));var moment=require(_0x450d('0x2'));var BPromise=require('bluebird');var rs=require(_0x450d('0x3'));var fs=require('fs');var Redis=require(_0x450d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x450d('0x5'));var config=require(_0x450d('0x6'));var jayson=require(_0x450d('0x7'));var client=jayson[_0x450d('0x8')][_0x450d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28b9a5,_0x304c83,_0x2f6261){return new BPromise(function(_0x45dce0,_0x5a6bc0){return client[_0x450d('0xa')](_0x28b9a5,_0x2f6261)[_0x450d('0xb')](function(_0x22250a){logger[_0x450d('0xc')]('DeskField,\x20%s,\x20%s',_0x304c83,_0x450d('0xd'));logger[_0x450d('0xe')](_0x450d('0xf'),_0x304c83,_0x450d('0xd'),JSON[_0x450d('0x10')](_0x22250a));if(_0x22250a['error']){if(_0x22250a[_0x450d('0x11')][_0x450d('0x12')]===0x1f4){logger['error'](_0x450d('0x13'),_0x304c83,_0x22250a[_0x450d('0x11')][_0x450d('0x14')]);return _0x5a6bc0(_0x22250a[_0x450d('0x11')][_0x450d('0x14')]);}logger['error'](_0x450d('0x13'),_0x304c83,_0x22250a[_0x450d('0x11')][_0x450d('0x14')]);return _0x45dce0(_0x22250a['error']['message']);}else{logger[_0x450d('0xc')]('DeskField,\x20%s,\x20%s',_0x304c83,'request\x20sent');_0x45dce0(_0x22250a['result'][_0x450d('0x14')]);}})[_0x450d('0x15')](function(_0x4c8cd7){logger[_0x450d('0x11')](_0x450d('0x13'),_0x304c83,_0x4c8cd7);_0x5a6bc0(_0x4c8cd7);});});} \ No newline at end of file +var _0xdf2d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x512359,_0x3b03d6){var _0x5ae120=function(_0x14f255){while(--_0x14f255){_0x512359['push'](_0x512359['shift']());}};_0x5ae120(++_0x3b03d6);}(_0xdf2d,0x19f));var _0xddf2=function(_0x2165f8,_0x140863){_0x2165f8=_0x2165f8-0x0;var _0x53f7f9=_0xdf2d[_0x2165f8];return _0x53f7f9;};'use strict';var _=require(_0xddf2('0x0'));var util=require('util');var moment=require(_0xddf2('0x1'));var BPromise=require(_0xddf2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddf2('0x3'));var db=require(_0xddf2('0x4'))['db'];var utils=require(_0xddf2('0x5'));var logger=require(_0xddf2('0x6'))(_0xddf2('0x7'));var config=require(_0xddf2('0x8'));var jayson=require(_0xddf2('0x9'));var client=jayson['client'][_0xddf2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eb02d,_0x490141,_0x33a624){return new BPromise(function(_0x5989ae,_0xbff84c){return client['request'](_0x1eb02d,_0x33a624)['then'](function(_0x21f585){logger[_0xddf2('0xb')](_0xddf2('0xc'),_0x490141,_0xddf2('0xd'));logger[_0xddf2('0xe')](_0xddf2('0xf'),_0x490141,_0xddf2('0xd'),JSON[_0xddf2('0x10')](_0x21f585));if(_0x21f585['error']){if(_0x21f585[_0xddf2('0x11')][_0xddf2('0x12')]===0x1f4){logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);return _0xbff84c(_0x21f585[_0xddf2('0x11')]['message']);}logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);return _0x5989ae(_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);}else{logger[_0xddf2('0xb')](_0xddf2('0xc'),_0x490141,_0xddf2('0xd'));_0x5989ae(_0x21f585[_0xddf2('0x14')]['message']);}})['catch'](function(_0x339e7e){logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x339e7e);_0xbff84c(_0x339e7e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 147a40d..8aff69d 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 _0xf08a=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/fields','post','create','/:id/configurations','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x1a4134,_0x110ba3){var _0xce32ce=function(_0x56edb5){while(--_0x56edb5){_0x1a4134['push'](_0x1a4134['shift']());}};_0xce32ce(++_0x110ba3);}(_0xf08a,0x171));var _0xaf08=function(_0x5b2e74,_0x4eb1f4){_0x5b2e74=_0x5b2e74-0x0;var _0xe3c5c=_0xf08a[_0x5b2e74];return _0xe3c5c;};'use strict';var multer=require(_0xaf08('0x0'));var util=require(_0xaf08('0x1'));var path=require(_0xaf08('0x2'));var timeout=require(_0xaf08('0x3'));var express=require('express');var router=express[_0xaf08('0x4')]();var fs_extra=require(_0xaf08('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf08('0x6'));var config=require(_0xaf08('0x7'));var controller=require(_0xaf08('0x8'));router[_0xaf08('0x9')]('/',auth[_0xaf08('0xa')](),controller[_0xaf08('0xb')]);router['get'](_0xaf08('0xc'),auth[_0xaf08('0xa')](),controller[_0xaf08('0xd')]);router[_0xaf08('0x9')]('/:id/configurations',auth[_0xaf08('0xa')](),controller['getConfigurations']);router[_0xaf08('0x9')](_0xaf08('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xaf08('0xf')]('/',auth[_0xaf08('0xa')](),controller[_0xaf08('0x10')]);router['post'](_0xaf08('0x11'),auth[_0xaf08('0xa')](),controller[_0xaf08('0x12')]);router[_0xaf08('0x13')](_0xaf08('0xc'),auth[_0xaf08('0xa')](),controller['update']);router[_0xaf08('0x14')](_0xaf08('0xc'),auth[_0xaf08('0xa')](),controller['destroy']);module[_0xaf08('0x15')]=router; \ No newline at end of file +var _0xa870=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x13f6bb,_0x1d625f){var _0x413673=function(_0x6dacf6){while(--_0x6dacf6){_0x13f6bb['push'](_0x13f6bb['shift']());}};_0x413673(++_0x1d625f);}(_0xa870,0x117));var _0x0a87=function(_0x5cb52a,_0x519f64){_0x5cb52a=_0x5cb52a-0x0;var _0x68af63=_0xa870[_0x5cb52a];return _0x68af63;};'use strict';var multer=require('multer');var util=require(_0x0a87('0x0'));var path=require(_0x0a87('0x1'));var timeout=require(_0x0a87('0x2'));var express=require(_0x0a87('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0a87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a87('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x0a87('0x6')]('/',auth[_0x0a87('0x7')](),controller['index']);router['get'](_0x0a87('0x8'),auth[_0x0a87('0x7')](),controller[_0x0a87('0x9')]);router[_0x0a87('0x6')](_0x0a87('0xa'),auth[_0x0a87('0x7')](),controller[_0x0a87('0xb')]);router['get'](_0x0a87('0xc'),auth[_0x0a87('0x7')](),controller[_0x0a87('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0a87('0xe')](_0x0a87('0xa'),auth[_0x0a87('0x7')](),controller['addConfiguration']);router['put'](_0x0a87('0x8'),auth['isAuthenticated'](),controller[_0x0a87('0xf')]);router[_0x0a87('0x10')](_0x0a87('0x8'),auth[_0x0a87('0x7')](),controller[_0x0a87('0x11')]);module[_0x0a87('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 802bbc2..c489059 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 _0x51d6=['sequelize','exports','STRING'];(function(_0x37454f,_0x524505){var _0x1fa5d3=function(_0x578cfa){while(--_0x578cfa){_0x37454f['push'](_0x37454f['shift']());}};_0x1fa5d3(++_0x524505);}(_0x51d6,0xbd));var _0x651d=function(_0x28b637,_0x2a19f0){_0x28b637=_0x28b637-0x0;var _0x4413a0=_0x51d6[_0x28b637];return _0x4413a0;};'use strict';var Sequelize=require(_0x651d('0x0'));module[_0x651d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x651d('0x2')]},'password':{'type':Sequelize[_0x651d('0x2')]},'remoteUri':{'type':Sequelize[_0x651d('0x2')]},'tenantId':{'type':Sequelize[_0x651d('0x2')]},'clientId':{'type':Sequelize[_0x651d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x651d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x651d('0x2')]}}; \ No newline at end of file +var _0x1945=['sequelize','exports','STRING'];(function(_0x359104,_0x3627ce){var _0x1eda0c=function(_0x1e5f01){while(--_0x1e5f01){_0x359104['push'](_0x359104['shift']());}};_0x1eda0c(++_0x3627ce);}(_0x1945,0xfc));var _0x5194=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x1945[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x5194('0x0'));module[_0x5194('0x1')]={'name':{'type':Sequelize[_0x5194('0x2')]},'username':{'type':Sequelize[_0x5194('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5194('0x2')]},'tenantId':{'type':Sequelize[_0x5194('0x2')]},'clientId':{'type':Sequelize[_0x5194('0x2')]},'clientSecret':{'type':Sequelize[_0x5194('0x2')]},'serverUrl':{'type':Sequelize[_0x5194('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5194('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index bf44c6f..8217bbc 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 _0x2fda=['set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','length','options','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','productidname','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset'];(function(_0x42ebab,_0x7746ca){var _0x2b595f=function(_0x5539fa){while(--_0x5539fa){_0x42ebab['push'](_0x42ebab['shift']());}};_0x2b595f(++_0x7746ca);}(_0x2fda,0x186));var _0xa2fd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2fda[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xa2fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2fd('0x1'));var rp=require(_0xa2fd('0x2'));var moment=require(_0xa2fd('0x3'));var BPromise=require(_0xa2fd('0x4'));var Mustache=require(_0xa2fd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa2fd('0x6'));var ejs=require(_0xa2fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2fd('0x8'));var squel=require(_0xa2fd('0x9'));var crypto=require(_0xa2fd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2fd('0xb'));var toCsv=require(_0xa2fd('0x6'));var querystring=require(_0xa2fd('0xc'));var Papa=require(_0xa2fd('0xd'));var Redis=require(_0xa2fd('0xe'));var authService=require(_0xa2fd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2fd('0x10'))('api');var utils=require(_0xa2fd('0x11'));var config=require(_0xa2fd('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa2fd('0x13'));function respondWithStatusCode(_0x295780,_0x71c59a){_0x71c59a=_0x71c59a||0xcc;return function(_0x325f35){if(_0x325f35){return _0x295780[_0xa2fd('0x14')](_0x71c59a);}return _0x295780[_0xa2fd('0x15')](_0x71c59a)['end']();};}function respondWithResult(_0x4e0a72,_0x3a1708){_0x3a1708=_0x3a1708||0xc8;return function(_0x4c75e5){if(_0x4c75e5){return _0x4e0a72[_0xa2fd('0x15')](_0x3a1708)['json'](_0x4c75e5);}};}function respondWithFilteredResult(_0xcf45fb,_0x3a3e51){return function(_0x10590d){if(_0x10590d){var _0x31c996=typeof _0x3a3e51['offset']===_0xa2fd('0x16')&&typeof _0x3a3e51[_0xa2fd('0x17')]===_0xa2fd('0x16');var _0x195d32=_0x10590d[_0xa2fd('0x18')];var _0x5c0697=_0x31c996?0x0:_0x3a3e51[_0xa2fd('0x19')];var _0x22a3aa=_0x31c996?_0x10590d[_0xa2fd('0x18')]:_0x3a3e51[_0xa2fd('0x19')]+_0x3a3e51[_0xa2fd('0x17')];var _0x10b8d5;if(_0x22a3aa>=_0x195d32){_0x22a3aa=_0x195d32;_0x10b8d5=0xc8;}else{_0x10b8d5=0xce;}_0xcf45fb[_0xa2fd('0x15')](_0x10b8d5);return _0xcf45fb[_0xa2fd('0x1a')](_0xa2fd('0x1b'),_0x5c0697+'-'+_0x22a3aa+'/'+_0x195d32)[_0xa2fd('0x1c')](_0x10590d);}return null;};}function patchUpdates(_0x244bcf){return function(_0x535d05){try{jsonpatch[_0xa2fd('0x1d')](_0x535d05,_0x244bcf,!![]);}catch(_0x1f2ec7){return BPromise[_0xa2fd('0x1e')](_0x1f2ec7);}return _0x535d05[_0xa2fd('0x1f')]();};}function saveUpdates(_0x36dd15,_0x58b1d6){return function(_0x40e0f8){if(_0x40e0f8){return _0x40e0f8[_0xa2fd('0x20')](_0x36dd15)[_0xa2fd('0x21')](function(_0x2f9744){return _0x2f9744;});}return null;};}function removeEntity(_0x3e2110,_0x1e111a){return function(_0x2bd046){if(_0x2bd046){return _0x2bd046[_0xa2fd('0x22')]()[_0xa2fd('0x21')](function(){_0x3e2110['status'](0xcc)[_0xa2fd('0x23')]();});}};}function handleEntityNotFound(_0x44b155,_0x457434){return function(_0x584339){if(!_0x584339){_0x44b155['sendStatus'](0x194);}return _0x584339;};}function handleError(_0x20041e,_0x113739){_0x113739=_0x113739||0x1f4;return function(_0x30539d){logger[_0xa2fd('0x24')](_0x30539d['stack']);if(_0x30539d['name']){delete _0x30539d[_0xa2fd('0x25')];}_0x20041e[_0xa2fd('0x15')](_0x113739)[_0xa2fd('0x26')](_0x30539d);};}exports[_0xa2fd('0x27')]=function(_0x42a1d3,_0x26b042){var _0x583a19={},_0x3b32a9={},_0xffe5a1={'count':0x0,'rows':[]};var _0x1dda7b=_[_0xa2fd('0x28')](db[_0xa2fd('0x29')][_0xa2fd('0x2a')],function(_0x4938af){return{'name':_0x4938af[_0xa2fd('0x2b')],'type':_0x4938af[_0xa2fd('0x2c')][_0xa2fd('0x2d')]};});_0x3b32a9[_0xa2fd('0x2e')]=_[_0xa2fd('0x28')](_0x1dda7b,_0xa2fd('0x25'));_0x3b32a9[_0xa2fd('0x2f')]=_[_0xa2fd('0x30')](_0x42a1d3['query']);_0x3b32a9[_0xa2fd('0x31')]=_[_0xa2fd('0x32')](_0x3b32a9[_0xa2fd('0x2e')],_0x3b32a9[_0xa2fd('0x2f')]);_0x583a19['attributes']=_['intersection'](_0x3b32a9['model'],qs[_0xa2fd('0x33')](_0x42a1d3['query']['fields']));_0x583a19[_0xa2fd('0x34')]=_0x583a19[_0xa2fd('0x34')]['length']?_0x583a19[_0xa2fd('0x34')]:_0x3b32a9[_0xa2fd('0x2e')];if(!_0x42a1d3[_0xa2fd('0x2f')]['hasOwnProperty'](_0xa2fd('0x35'))){_0x583a19[_0xa2fd('0x17')]=qs[_0xa2fd('0x17')](_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x17')]);_0x583a19['offset']=qs[_0xa2fd('0x19')](_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x19')]);}_0x583a19[_0xa2fd('0x36')]=qs[_0xa2fd('0x37')](_0x42a1d3['query'][_0xa2fd('0x37')]);_0x583a19['where']=qs[_0xa2fd('0x31')](_[_0xa2fd('0x38')](_0x42a1d3['query'],_0x3b32a9[_0xa2fd('0x31')]),_0x1dda7b);if(_0x42a1d3['query']['filter']){_0x583a19[_0xa2fd('0x39')]=_[_0xa2fd('0x3a')](_0x583a19['where'],{'$or':_[_0xa2fd('0x28')](_0x1dda7b,function(_0x47d7ce){if(_0x47d7ce[_0xa2fd('0x2c')]!==_0xa2fd('0x3b')){var _0x5c9a29={};_0x5c9a29[_0x47d7ce['name']]={'$like':'%'+_0x42a1d3[_0xa2fd('0x2f')][_0xa2fd('0x3c')]+'%'};return _0x5c9a29;}})});}_0x583a19=_[_0xa2fd('0x3a')]({},_0x583a19,_0x42a1d3['options']);var _0xadd4df={'where':_0x583a19[_0xa2fd('0x39')]};return db['Dynamics365Account'][_0xa2fd('0x18')](_0xadd4df)[_0xa2fd('0x21')](function(_0x350504){_0xffe5a1[_0xa2fd('0x18')]=_0x350504;if(_0x42a1d3[_0xa2fd('0x2f')]['includeAll']){_0x583a19[_0xa2fd('0x3d')]=[{'all':!![]}];}return db[_0xa2fd('0x29')][_0xa2fd('0x3e')](_0x583a19);})[_0xa2fd('0x21')](function(_0x4b40b2){_0xffe5a1[_0xa2fd('0x3f')]=_0x4b40b2;return _0xffe5a1;})[_0xa2fd('0x21')](respondWithFilteredResult(_0x26b042,_0x583a19))[_0xa2fd('0x40')](handleError(_0x26b042,null));};exports[_0xa2fd('0x41')]=function(_0x2acfb5,_0x3f3b06){var _0x2153b9={'raw':![],'where':{'id':_0x2acfb5['params']['id']}},_0x3feb5a={};_0x3feb5a[_0xa2fd('0x2e')]=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x3feb5a[_0xa2fd('0x2f')]=_['keys'](_0x2acfb5[_0xa2fd('0x2f')]);_0x3feb5a['filters']=_['intersection'](_0x3feb5a[_0xa2fd('0x2e')],_0x3feb5a[_0xa2fd('0x2f')]);_0x2153b9['attributes']=_['intersection'](_0x3feb5a[_0xa2fd('0x2e')],qs[_0xa2fd('0x33')](_0x2acfb5['query']['fields']));_0x2153b9[_0xa2fd('0x34')]=_0x2153b9[_0xa2fd('0x34')][_0xa2fd('0x42')]?_0x2153b9[_0xa2fd('0x34')]:_0x3feb5a[_0xa2fd('0x2e')];if(_0x2acfb5[_0xa2fd('0x2f')]['includeAll']){_0x2153b9[_0xa2fd('0x3d')]=[{'all':!![]}];}_0x2153b9=_[_0xa2fd('0x3a')]({},_0x2153b9,_0x2acfb5[_0xa2fd('0x43')]);return db[_0xa2fd('0x29')][_0xa2fd('0x44')](_0x2153b9)[_0xa2fd('0x21')](handleEntityNotFound(_0x3f3b06,null))[_0xa2fd('0x21')](respondWithResult(_0x3f3b06,null))[_0xa2fd('0x40')](handleError(_0x3f3b06,null));};exports['create']=function(_0x513b58,_0x1456b0){return db[_0xa2fd('0x29')][_0xa2fd('0x45')](_0x513b58[_0xa2fd('0x46')],{})['then'](respondWithResult(_0x1456b0,0xc9))[_0xa2fd('0x40')](handleError(_0x1456b0,null));};exports[_0xa2fd('0x20')]=function(_0x29366e,_0x5bd5d2){if(_0x29366e[_0xa2fd('0x46')]['id']){delete _0x29366e['body']['id'];}return db['Dynamics365Account'][_0xa2fd('0x44')]({'where':{'id':_0x29366e[_0xa2fd('0x47')]['id']}})[_0xa2fd('0x21')](handleEntityNotFound(_0x5bd5d2,null))['then'](saveUpdates(_0x29366e[_0xa2fd('0x46')],null))[_0xa2fd('0x21')](respondWithResult(_0x5bd5d2,null))[_0xa2fd('0x40')](handleError(_0x5bd5d2,null));};exports[_0xa2fd('0x22')]=function(_0x2bf113,_0x55a507){return db['Dynamics365Account'][_0xa2fd('0x44')]({'where':{'id':_0x2bf113[_0xa2fd('0x47')]['id']}})['then'](handleEntityNotFound(_0x55a507,null))[_0xa2fd('0x21')](removeEntity(_0x55a507,null))[_0xa2fd('0x40')](handleError(_0x55a507,null));};exports[_0xa2fd('0x48')]=function(_0x33c73f,_0x2cc3a3,_0x4f9f12){var _0x552fa5={};var _0x3369a3={};var _0x41ee7b;var _0xa95b27;return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x33c73f['params']['id']}})['then'](handleEntityNotFound(_0x2cc3a3,null))[_0xa2fd('0x21')](function(_0x214e9a){if(_0x214e9a){_0x41ee7b=_0x214e9a;_0x3369a3[_0xa2fd('0x2e')]=_[_0xa2fd('0x30')](db[_0xa2fd('0x4a')][_0xa2fd('0x2a')]);_0x3369a3[_0xa2fd('0x2f')]=_[_0xa2fd('0x30')](_0x33c73f[_0xa2fd('0x2f')]);_0x3369a3[_0xa2fd('0x31')]=_[_0xa2fd('0x32')](_0x3369a3[_0xa2fd('0x2e')],_0x3369a3[_0xa2fd('0x2f')]);_0x552fa5[_0xa2fd('0x34')]=_['intersection'](_0x3369a3[_0xa2fd('0x2e')],qs[_0xa2fd('0x33')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x33')]));_0x552fa5[_0xa2fd('0x34')]=_0x552fa5[_0xa2fd('0x34')][_0xa2fd('0x42')]?_0x552fa5[_0xa2fd('0x34')]:_0x3369a3[_0xa2fd('0x2e')];_0x552fa5[_0xa2fd('0x36')]=qs[_0xa2fd('0x37')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x37')]);_0x552fa5['where']=qs[_0xa2fd('0x31')](_['pick'](_0x33c73f[_0xa2fd('0x2f')],_0x3369a3['filters']));if(_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x3c')]){_0x552fa5[_0xa2fd('0x39')]=_[_0xa2fd('0x3a')](_0x552fa5[_0xa2fd('0x39')],{'$or':_['map'](_0x552fa5[_0xa2fd('0x34')],function(_0x5e90ac){var _0x1bb3f1={};_0x1bb3f1[_0x5e90ac]={'$like':'%'+_0x33c73f['query'][_0xa2fd('0x3c')]+'%'};return _0x1bb3f1;})});}_0x552fa5=_[_0xa2fd('0x3a')]({},_0x552fa5,_0x33c73f[_0xa2fd('0x43')]);return _0x41ee7b['getConfigurations'](_0x552fa5);}})[_0xa2fd('0x21')](function(_0x15feff){if(_0x15feff){_0xa95b27=_0x15feff[_0xa2fd('0x42')];if(!_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x4b')]('nolimit')){_0x552fa5['limit']=qs[_0xa2fd('0x17')](_0x33c73f[_0xa2fd('0x2f')]['limit']);_0x552fa5['offset']=qs[_0xa2fd('0x19')](_0x33c73f[_0xa2fd('0x2f')][_0xa2fd('0x19')]);}return _0x41ee7b[_0xa2fd('0x48')](_0x552fa5);}})[_0xa2fd('0x21')](function(_0x24b37c){if(_0x24b37c){return _0x24b37c?{'count':_0xa95b27,'rows':_0x24b37c}:null;}})['then'](respondWithResult(_0x2cc3a3,null))[_0xa2fd('0x40')](handleError(_0x2cc3a3,null));};exports[_0xa2fd('0x4c')]=function(_0x3694a4,_0x2f50ff,_0xb51ed9){if(_0x3694a4[_0xa2fd('0x46')]['id']){delete _0x3694a4[_0xa2fd('0x46')]['id'];}return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x3694a4[_0xa2fd('0x47')]['id']}})[_0xa2fd('0x21')](handleEntityNotFound(_0x2f50ff,null))[_0xa2fd('0x21')](function(_0x55eb11){if(_0x55eb11){_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x4d')]=_0x55eb11['id'];_0x3694a4[_0xa2fd('0x46')]['Subjects']=integrations[_0xa2fd('0x4e')](_0x3694a4[_0xa2fd('0x46')]['channel'],_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x2c')]);_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x4f')]=integrations[_0xa2fd('0x50')](_0x3694a4[_0xa2fd('0x46')][_0xa2fd('0x51')],_0x3694a4[_0xa2fd('0x46')]['type']);return db[_0xa2fd('0x4a')][_0xa2fd('0x45')](_0x3694a4[_0xa2fd('0x46')],{'include':[{'model':db[_0xa2fd('0x52')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xa2fd('0x21')](respondWithResult(_0x2f50ff,null))[_0xa2fd('0x40')](handleError(_0x2f50ff,null));};exports[_0xa2fd('0x53')]=function(_0x592be8,_0x160eca,_0x396dcb){var _0x50a8c9=_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0x54')];var _0xaa5c15=_0x50a8c9===_0xa2fd('0x55')?'Incident':_0xa2fd('0x56');var _0x3e9b5e='';var _0x1b5e23='';var _0x3ab5c5='';var _0x35df54='';var _0x16eb6e='';var _0x5ef99a='';var _0x15227d='';var _0x2d432b='';var _0xceddca=['title','description',_0xa2fd('0x57'),_0xa2fd('0x58'),_0xa2fd('0x59'),_0xa2fd('0x5a'),_0xa2fd('0x5b'),'regardingobjectid','directioncode',_0xa2fd('0x5c')];var _0x5f5a75=[_0xa2fd('0x5d'),_0xa2fd('0x5e'),_0xa2fd('0x5f'),_0xa2fd('0x60'),_0xa2fd('0x61'),'contactidyominame',_0xa2fd('0x62'),_0xa2fd('0x63'),_0xa2fd('0x64'),_0xa2fd('0x65'),'createdbyname',_0xa2fd('0x66'),_0xa2fd('0x67'),_0xa2fd('0x68'),_0xa2fd('0x69'),_0xa2fd('0x6a'),'customeridtype',_0xa2fd('0x6b'),_0xa2fd('0x6c'),'entitlementidname',_0xa2fd('0x6d'),_0xa2fd('0x6e'),_0xa2fd('0x6f'),_0xa2fd('0x70'),_0xa2fd('0x71'),_0xa2fd('0x72'),_0xa2fd('0x73'),'influencescore','kbarticleidname','lastonholdtime',_0xa2fd('0x74'),_0xa2fd('0x75'),_0xa2fd('0x76'),_0xa2fd('0x77'),_0xa2fd('0x78'),_0xa2fd('0x79'),_0xa2fd('0x7a'),_0xa2fd('0x7b'),_0xa2fd('0x7c'),_0xa2fd('0x7d'),_0xa2fd('0x7e'),_0xa2fd('0x7f'),_0xa2fd('0x80'),_0xa2fd('0x81'),'owneridtype','owneridyominame',_0xa2fd('0x82'),_0xa2fd('0x83'),'primarycontactidyominame','prioritycodename',_0xa2fd('0x84'),'productserialnumber','resolveby',_0xa2fd('0x85'),_0xa2fd('0x86'),'responsiblecontactidname',_0xa2fd('0x87'),_0xa2fd('0x88'),_0xa2fd('0x89'),_0xa2fd('0x8a'),_0xa2fd('0x8b'),_0xa2fd('0x8c'),_0xa2fd('0x8d'),_0xa2fd('0x8e'),'ticketnumber',_0xa2fd('0x8f'),_0xa2fd('0x90'),'traversedpath',_0xa2fd('0x91'),'versionnumber'];var _0x39979a=_0xceddca['concat'](_0x5f5a75);return db[_0xa2fd('0x29')][_0xa2fd('0x49')]({'where':{'id':_0x592be8[_0xa2fd('0x47')]['id']},'attributes':['id','username',_0xa2fd('0x92'),'remoteUri',_0xa2fd('0x93'),_0xa2fd('0x94'),_0xa2fd('0x95')]})[_0xa2fd('0x21')](handleEntityNotFound(_0x160eca,null))['then'](function(_0x10d199){if(_0x10d199){_0x2d432b=_0x10d199[_0xa2fd('0x96')];var _0x4584f7=_0x2d432b[_0xa2fd('0x97')](-0x1);if(_0x4584f7==='/'){_0x2d432b=_0x2d432b[_0xa2fd('0x98')](0x0,_0x2d432b[_0xa2fd('0x99')](_0x4584f7));}_0x15227d=util[_0xa2fd('0x9a')](_0xa2fd('0x9b'),_0x2d432b);var _0x1cd5dc={'method':_0xa2fd('0x9c'),'uri':_0xa2fd('0x9d')+_0x10d199[_0xa2fd('0x93')]+_0xa2fd('0x9e'),'form':{'client_id':_0x10d199[_0xa2fd('0x94')],'resource':_0x2d432b,'username':_0x10d199[_0xa2fd('0x9f')],'password':_0x10d199['password'],'grant_type':_0xa2fd('0x92'),'client_secret':_0x10d199[_0xa2fd('0x95')]},'json':!![]};return rp(_0x1cd5dc);}})['then'](function(_0x148161){_0x5ef99a=_0x148161['access_token'];var _0x3e2179={'method':_0xa2fd('0xa0'),'uri':encodeURI(_0x15227d+_0xa2fd('0xa1')+_0xaa5c15+'\x27'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x5ef99a,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x3e2179);})['then'](function(_0x1543dc){var _0x4e6301=_0x1543dc[_0xa2fd('0xa4')][0x0];var _0x1f94b2=_0x4e6301['MetadataId'];var _0x25f78e={'method':_0xa2fd('0xa0'),'uri':_0x15227d+_0xa2fd('0xa5')+_0x1f94b2+_0xa2fd('0xa6'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x5ef99a,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x25f78e);})['then'](function(_0x3a80a9){_0x3e9b5e=_0x3a80a9;_0x1b5e23=_0x3e9b5e[_0xa2fd('0xa7')];_0x1b5e23=_[_0xa2fd('0xa8')](_0x1b5e23,function(_0x4148a6){return!_0x39979a[_0xa2fd('0xa9')](_0x4148a6[_0xa2fd('0xaa')]);});var _0x352870=[];var _0x54e62f=[];_0x1b5e23[_0xa2fd('0xab')](function(_0x54bc5){if(_0x54bc5[_0xa2fd('0xac')]){var _0x2c8d94=_0x54bc5['@odata.type'][_0xa2fd('0x98')](_0x54bc5[_0xa2fd('0xac')][_0xa2fd('0x99')]('.')+0x1);if(_0x2c8d94===_0xa2fd('0xad')){_0x352870[_0xa2fd('0xae')](getSelectList(_0x15227d,_0x50a8c9,_0x54e62f,_0x3e9b5e[_0xa2fd('0xaf')],_0x54bc5['MetadataId'],_0x5ef99a));}}});return Promise[_0xa2fd('0xb0')](_0x352870);})['then'](function(_0x496cd9){_0x3ab5c5=_0x496cd9[0x0];var _0x2f9b87=[];var _0x31363b=[];_0x1b5e23[_0xa2fd('0xab')](function(_0xa41fed){if(!_[_0xa2fd('0xb1')](_0xa41fed[_0xa2fd('0xac')])){var _0x10b84c=_0xa41fed[_0xa2fd('0xac')]['substring'](_0xa41fed[_0xa2fd('0xac')]['lastIndexOf']('.')+0x1);if(_0x10b84c===_0xa2fd('0xb2')){_0x2f9b87[_0xa2fd('0xae')](getBooleanList(_0x15227d,_0x50a8c9,_0x31363b,_0x3e9b5e[_0xa2fd('0xaf')],_0xa41fed[_0xa2fd('0xaf')],_0x5ef99a));}}});return Promise['all'](_0x2f9b87);})['then'](function(_0x1022c4){_0x35df54=_0x1022c4[0x0];var _0x2029d3=[];var _0x3005ba=[];_0x1b5e23[_0xa2fd('0xab')](function(_0x9d4390){if(_0x9d4390[_0xa2fd('0xac')]){var _0x58ae44=_0x9d4390['@odata.type']['substring'](_0x9d4390['@odata.type'][_0xa2fd('0x99')]('.')+0x1);if(_0x58ae44===_0xa2fd('0xb3')||_0x58ae44===_0xa2fd('0xb4')||_0x58ae44==='BigIntAttributeMetadata'||_0x58ae44===_0xa2fd('0xb5')||_0x58ae44===_0xa2fd('0xb6')||_0x58ae44===_0xa2fd('0xb7')||_0x58ae44===_0xa2fd('0xb8')||_0x58ae44===_0xa2fd('0xb9')||_0x58ae44==='StateAttributeMetadata'||_0x58ae44===_0xa2fd('0xba')){_0x2029d3[_0xa2fd('0xae')](getInputList(_0x15227d,_0x50a8c9,_0x58ae44,_0x3005ba,_0x3e9b5e[_0xa2fd('0xaf')],_0x9d4390['MetadataId'],_0x5ef99a));}}});return Promise[_0xa2fd('0xb0')](_0x2029d3);})[_0xa2fd('0x21')](function(_0x197fd5){_0x16eb6e=_0x197fd5[0x0];var _0x418c75=_0x3ab5c5[_0xa2fd('0xbb')](_0x35df54)[_0xa2fd('0xbb')](_0x16eb6e);var _0x318765={'count':_0x418c75[_0xa2fd('0x42')],'rows':_0x418c75};return _0x318765;})['then'](respondWithResult(_0x160eca,null))['catch'](function(_0x1bd495){var _0x5e249e=_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0xbc')]?0x1f4:_0x1bd495[_0xa2fd('0xbd')]||0x1f4;logger[_0xa2fd('0x24')](_0x1bd495[_0xa2fd('0xbe')]);delete _0x1bd495[_0xa2fd('0x25')];if(_0x5e249e===0x191){_0x5e249e=0x190;}_0x160eca[_0xa2fd('0x15')](_0x5e249e)[_0xa2fd('0x26')](_0x592be8[_0xa2fd('0x2f')][_0xa2fd('0xbc')]?{'message':_0xa2fd('0xbf'),'statusCode':_0x1bd495[_0xa2fd('0xbd')]}:_0x1bd495);});};function getSelectList(_0x3fa0ef,_0x44137e,_0x2494c0,_0x53af3b,_0x41eb25,_0x304183){var _0x4ac86e={'method':_0xa2fd('0xa0'),'uri':_0x3fa0ef+'EntityDefinitions('+_0x53af3b+_0xa2fd('0xc0')+_0x41eb25+_0xa2fd('0xc1')+_0xa2fd('0xc2'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x304183,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x4ac86e)[_0xa2fd('0x21')](function(_0x5b0f75){var _0x17f7b1=[];var _0x539cdb=_0x5b0f75[_0xa2fd('0xc3')][_0xa2fd('0xc4')];_0x539cdb[_0xa2fd('0xab')](function(_0x687a32){_0x17f7b1[_0xa2fd('0xae')]({'name':_0x687a32['Label'][_0xa2fd('0xc5')]['Label'],'value':String(_0x687a32[_0xa2fd('0xc6')])});});var _0x319ccb={'id':_0x44137e+'_'+_0x5b0f75[_0xa2fd('0xaa')],'name':_0x5b0f75[_0xa2fd('0xc7')]['UserLocalizedLabel'][_0xa2fd('0xc8')],'custom':![],'options':_0x17f7b1};_0x2494c0[_0xa2fd('0xae')](_0x319ccb);return _0x2494c0;});}function getBooleanList(_0xe373af,_0xcbb372,_0x54b90d,_0x14f2f5,_0x21193c,_0xb71087){var _0x340b2e={'method':_0xa2fd('0xa0'),'uri':_0xe373af+_0xa2fd('0xa5')+_0x14f2f5+')/Attributes('+_0x21193c+_0xa2fd('0xc9'),'headers':{'Authorization':_0xa2fd('0xa2')+_0xb71087,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0x340b2e)[_0xa2fd('0x21')](function(_0xf81bf8){var _0x1b5a1f=[];_0x1b5a1f[_0xa2fd('0xae')]({'name':_0xf81bf8[_0xa2fd('0xc3')][_0xa2fd('0xca')]['Label']['UserLocalizedLabel'][_0xa2fd('0xc8')],'value':_0xa2fd('0xcb')},{'name':_0xf81bf8['OptionSet'][_0xa2fd('0xcc')][_0xa2fd('0xc8')][_0xa2fd('0xc5')]['Label'],'value':_0xa2fd('0xcd')});var _0x508bfd={'id':_0xcbb372+'_'+_0xf81bf8[_0xa2fd('0xaa')],'name':_0xf81bf8[_0xa2fd('0xc7')][_0xa2fd('0xc5')][_0xa2fd('0xc8')],'custom':![],'options':_0x1b5a1f};_0x54b90d[_0xa2fd('0xae')](_0x508bfd);return _0x54b90d;});}function getInputList(_0x4ecde5,_0x268dd4,_0x13e999,_0x4759cc,_0x31932f,_0x310605,_0x17566e){var _0xf72837={'method':'GET','uri':_0x4ecde5+_0xa2fd('0xa5')+_0x31932f+_0xa2fd('0xc0')+_0x310605+_0xa2fd('0xce')+_0x13e999+_0xa2fd('0xcf'),'headers':{'Authorization':_0xa2fd('0xa2')+_0x17566e,'If-None-Match':null,'OData-Version':_0xa2fd('0xa3')},'json':!![]};return rp(_0xf72837)[_0xa2fd('0x21')](function(_0x2b826a){var _0x470be3={'id':_0x268dd4+'_'+_0x2b826a['LogicalName'],'name':_0x2b826a[_0xa2fd('0xc7')][_0xa2fd('0xc5')]?_0x2b826a[_0xa2fd('0xc7')][_0xa2fd('0xc5')][_0xa2fd('0xc8')]:_0x2b826a[_0xa2fd('0xaa')],'custom':![],'options':[]};_0x4759cc['push'](_0x470be3);return _0x4759cc;});} \ No newline at end of file +var _0xf725=['AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientSecret','remoteUri','substring','%s/api/data/v9.0/','POST','clientId','access_token','Bearer\x20','4.0','value','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','EntityDefinitions(',')/Attributes(','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','Dynamics365Configuration','pick','addConfiguration'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf725,0x7e));var _0x5f72=function(_0x2c322e,_0x19b4d0){_0x2c322e=_0x2c322e-0x0;var _0x134577=_0xf725[_0x2c322e];return _0x134577;};'use strict';var emlformat=require(_0x5f72('0x0'));var rimraf=require(_0x5f72('0x1'));var zipdir=require(_0x5f72('0x2'));var jsonpatch=require(_0x5f72('0x3'));var rp=require(_0x5f72('0x4'));var moment=require(_0x5f72('0x5'));var BPromise=require(_0x5f72('0x6'));var Mustache=require(_0x5f72('0x7'));var util=require(_0x5f72('0x8'));var path=require(_0x5f72('0x9'));var sox=require('sox');var csv=require(_0x5f72('0xa'));var ejs=require(_0x5f72('0xb'));var fs=require('fs');var fs_extra=require(_0x5f72('0xc'));var _=require(_0x5f72('0xd'));var squel=require(_0x5f72('0xe'));var crypto=require(_0x5f72('0xf'));var jsforce=require(_0x5f72('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5f72('0x11'));var Papa=require(_0x5f72('0x12'));var Redis=require('ioredis');var authService=require(_0x5f72('0x13'));var qs=require(_0x5f72('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f72('0x15'));var logger=require(_0x5f72('0x16'))(_0x5f72('0x17'));var utils=require(_0x5f72('0x18'));var config=require(_0x5f72('0x19'));var licenseUtil=require(_0x5f72('0x1a'));var db=require(_0x5f72('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1ac591,_0x3307ed){_0x3307ed=_0x3307ed||0xcc;return function(_0x8a9487){if(_0x8a9487){return _0x1ac591[_0x5f72('0x1c')](_0x3307ed);}return _0x1ac591[_0x5f72('0x1d')](_0x3307ed)['end']();};}function respondWithResult(_0x43d1fd,_0x4f81e9){_0x4f81e9=_0x4f81e9||0xc8;return function(_0x50f8c8){if(_0x50f8c8){return _0x43d1fd[_0x5f72('0x1d')](_0x4f81e9)['json'](_0x50f8c8);}};}function respondWithFilteredResult(_0x3267a,_0x4adc76){return function(_0x317eed){if(_0x317eed){var _0x4e0c32=typeof _0x4adc76[_0x5f72('0x1e')]===_0x5f72('0x1f')&&typeof _0x4adc76['limit']===_0x5f72('0x1f');var _0x276323=_0x317eed[_0x5f72('0x20')];var _0x4af7d3=_0x4e0c32?0x0:_0x4adc76['offset'];var _0x4b62e1=_0x4e0c32?_0x317eed[_0x5f72('0x20')]:_0x4adc76[_0x5f72('0x1e')]+_0x4adc76[_0x5f72('0x21')];var _0x32f487;if(_0x4b62e1>=_0x276323){_0x4b62e1=_0x276323;_0x32f487=0xc8;}else{_0x32f487=0xce;}_0x3267a[_0x5f72('0x1d')](_0x32f487);return _0x3267a[_0x5f72('0x22')](_0x5f72('0x23'),_0x4af7d3+'-'+_0x4b62e1+'/'+_0x276323)['json'](_0x317eed);}return null;};}function patchUpdates(_0x151a67){return function(_0x315b71){try{jsonpatch[_0x5f72('0x24')](_0x315b71,_0x151a67,!![]);}catch(_0xd5a0c5){return BPromise[_0x5f72('0x25')](_0xd5a0c5);}return _0x315b71[_0x5f72('0x26')]();};}function saveUpdates(_0x30235e,_0x367716){return function(_0x27b1f6){if(_0x27b1f6){return _0x27b1f6[_0x5f72('0x27')](_0x30235e)[_0x5f72('0x28')](function(_0x530009){return _0x530009;});}return null;};}function removeEntity(_0x433935,_0x21f4a3){return function(_0x258b8c){if(_0x258b8c){return _0x258b8c[_0x5f72('0x29')]()['then'](function(){_0x433935[_0x5f72('0x1d')](0xcc)[_0x5f72('0x2a')]();});}};}function handleEntityNotFound(_0x5c3325,_0x447019){return function(_0x3bb0a6){if(!_0x3bb0a6){_0x5c3325[_0x5f72('0x1c')](0x194);}return _0x3bb0a6;};}function handleError(_0x521174,_0x58ff77){_0x58ff77=_0x58ff77||0x1f4;return function(_0x3d4cfe){logger[_0x5f72('0x2b')](_0x3d4cfe[_0x5f72('0x2c')]);if(_0x3d4cfe[_0x5f72('0x2d')]){delete _0x3d4cfe[_0x5f72('0x2d')];}_0x521174[_0x5f72('0x1d')](_0x58ff77)[_0x5f72('0x2e')](_0x3d4cfe);};}exports['index']=function(_0x1b12cd,_0x49eea5){var _0xc8ca5a={},_0x35fa31={},_0x7cce31={'count':0x0,'rows':[]};var _0x3c5dbb=_[_0x5f72('0x2f')](db['Dynamics365Account']['rawAttributes'],function(_0x27822b){return{'name':_0x27822b[_0x5f72('0x30')],'type':_0x27822b[_0x5f72('0x31')][_0x5f72('0x32')]};});_0x35fa31[_0x5f72('0x33')]=_[_0x5f72('0x2f')](_0x3c5dbb,_0x5f72('0x2d'));_0x35fa31['query']=_[_0x5f72('0x34')](_0x1b12cd[_0x5f72('0x35')]);_0x35fa31[_0x5f72('0x36')]=_[_0x5f72('0x37')](_0x35fa31[_0x5f72('0x33')],_0x35fa31['query']);_0xc8ca5a[_0x5f72('0x38')]=_[_0x5f72('0x37')](_0x35fa31[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x39')]));_0xc8ca5a['attributes']=_0xc8ca5a['attributes'][_0x5f72('0x3a')]?_0xc8ca5a[_0x5f72('0x38')]:_0x35fa31['model'];if(!_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x3b')](_0x5f72('0x3c'))){_0xc8ca5a[_0x5f72('0x21')]=qs[_0x5f72('0x21')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x21')]);_0xc8ca5a[_0x5f72('0x1e')]=qs[_0x5f72('0x1e')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x1e')]);}_0xc8ca5a[_0x5f72('0x3d')]=qs[_0x5f72('0x3e')](_0x1b12cd[_0x5f72('0x35')]['sort']);_0xc8ca5a[_0x5f72('0x3f')]=qs['filters'](_['pick'](_0x1b12cd[_0x5f72('0x35')],_0x35fa31[_0x5f72('0x36')]),_0x3c5dbb);if(_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x40')]){_0xc8ca5a[_0x5f72('0x3f')]=_[_0x5f72('0x41')](_0xc8ca5a['where'],{'$or':_[_0x5f72('0x2f')](_0x3c5dbb,function(_0x1b6949){if(_0x1b6949[_0x5f72('0x31')]!==_0x5f72('0x42')){var _0x148cd6={};_0x148cd6[_0x1b6949[_0x5f72('0x2d')]]={'$like':'%'+_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x40')]+'%'};return _0x148cd6;}})});}_0xc8ca5a=_[_0x5f72('0x41')]({},_0xc8ca5a,_0x1b12cd[_0x5f72('0x43')]);var _0x39c2af={'where':_0xc8ca5a[_0x5f72('0x3f')]};return db[_0x5f72('0x44')][_0x5f72('0x20')](_0x39c2af)[_0x5f72('0x28')](function(_0x56d2f0){_0x7cce31['count']=_0x56d2f0;if(_0x1b12cd[_0x5f72('0x35')]['includeAll']){_0xc8ca5a['include']=[{'all':!![]}];}return db[_0x5f72('0x44')][_0x5f72('0x45')](_0xc8ca5a);})['then'](function(_0x3f0f8d){_0x7cce31[_0x5f72('0x46')]=_0x3f0f8d;return _0x7cce31;})['then'](respondWithFilteredResult(_0x49eea5,_0xc8ca5a))[_0x5f72('0x47')](handleError(_0x49eea5,null));};exports[_0x5f72('0x48')]=function(_0x4f2d4a,_0xcfefc5){var _0x4f57a6={'raw':![],'where':{'id':_0x4f2d4a[_0x5f72('0x49')]['id']}},_0x5720d4={};_0x5720d4[_0x5f72('0x33')]=_[_0x5f72('0x34')](db[_0x5f72('0x44')][_0x5f72('0x4a')]);_0x5720d4[_0x5f72('0x35')]=_[_0x5f72('0x34')](_0x4f2d4a['query']);_0x5720d4[_0x5f72('0x36')]=_[_0x5f72('0x37')](_0x5720d4[_0x5f72('0x33')],_0x5720d4[_0x5f72('0x35')]);_0x4f57a6['attributes']=_[_0x5f72('0x37')](_0x5720d4[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x4f2d4a[_0x5f72('0x35')]['fields']));_0x4f57a6[_0x5f72('0x38')]=_0x4f57a6[_0x5f72('0x38')][_0x5f72('0x3a')]?_0x4f57a6[_0x5f72('0x38')]:_0x5720d4['model'];if(_0x4f2d4a[_0x5f72('0x35')][_0x5f72('0x4b')]){_0x4f57a6['include']=[{'all':!![]}];}_0x4f57a6=_[_0x5f72('0x41')]({},_0x4f57a6,_0x4f2d4a[_0x5f72('0x43')]);return db['Dynamics365Account'][_0x5f72('0x4c')](_0x4f57a6)[_0x5f72('0x28')](handleEntityNotFound(_0xcfefc5,null))[_0x5f72('0x28')](respondWithResult(_0xcfefc5,null))['catch'](handleError(_0xcfefc5,null));};exports[_0x5f72('0x4d')]=function(_0x5efa48,_0x30a9b6){return db[_0x5f72('0x44')]['create'](_0x5efa48[_0x5f72('0x4e')],{})[_0x5f72('0x28')](respondWithResult(_0x30a9b6,0xc9))[_0x5f72('0x47')](handleError(_0x30a9b6,null));};exports[_0x5f72('0x27')]=function(_0x506774,_0x41319a){if(_0x506774[_0x5f72('0x4e')]['id']){delete _0x506774[_0x5f72('0x4e')]['id'];}return db[_0x5f72('0x44')]['find']({'where':{'id':_0x506774[_0x5f72('0x49')]['id']}})['then'](handleEntityNotFound(_0x41319a,null))[_0x5f72('0x28')](saveUpdates(_0x506774[_0x5f72('0x4e')],null))[_0x5f72('0x28')](respondWithResult(_0x41319a,null))[_0x5f72('0x47')](handleError(_0x41319a,null));};exports[_0x5f72('0x29')]=function(_0x3f071c,_0x28008c){return db[_0x5f72('0x44')][_0x5f72('0x4c')]({'where':{'id':_0x3f071c[_0x5f72('0x49')]['id']}})['then'](handleEntityNotFound(_0x28008c,null))[_0x5f72('0x28')](removeEntity(_0x28008c,null))[_0x5f72('0x47')](handleError(_0x28008c,null));};exports[_0x5f72('0x4f')]=function(_0x30e03,_0x2195c7,_0x5426f1){var _0x2fa280={};var _0x6f9638={};var _0x198609;var _0x37443b;return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x30e03['params']['id']}})[_0x5f72('0x28')](handleEntityNotFound(_0x2195c7,null))[_0x5f72('0x28')](function(_0xae3be1){if(_0xae3be1){_0x198609=_0xae3be1;_0x6f9638['model']=_[_0x5f72('0x34')](db[_0x5f72('0x50')][_0x5f72('0x4a')]);_0x6f9638['query']=_[_0x5f72('0x34')](_0x30e03[_0x5f72('0x35')]);_0x6f9638['filters']=_['intersection'](_0x6f9638[_0x5f72('0x33')],_0x6f9638['query']);_0x2fa280['attributes']=_[_0x5f72('0x37')](_0x6f9638[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x30e03[_0x5f72('0x35')][_0x5f72('0x39')]));_0x2fa280[_0x5f72('0x38')]=_0x2fa280[_0x5f72('0x38')]['length']?_0x2fa280[_0x5f72('0x38')]:_0x6f9638['model'];_0x2fa280[_0x5f72('0x3d')]=qs[_0x5f72('0x3e')](_0x30e03['query'][_0x5f72('0x3e')]);_0x2fa280[_0x5f72('0x3f')]=qs[_0x5f72('0x36')](_[_0x5f72('0x51')](_0x30e03[_0x5f72('0x35')],_0x6f9638['filters']));if(_0x30e03[_0x5f72('0x35')][_0x5f72('0x40')]){_0x2fa280[_0x5f72('0x3f')]=_['merge'](_0x2fa280[_0x5f72('0x3f')],{'$or':_[_0x5f72('0x2f')](_0x2fa280[_0x5f72('0x38')],function(_0xb1e925){var _0x80639={};_0x80639[_0xb1e925]={'$like':'%'+_0x30e03[_0x5f72('0x35')][_0x5f72('0x40')]+'%'};return _0x80639;})});}_0x2fa280=_[_0x5f72('0x41')]({},_0x2fa280,_0x30e03[_0x5f72('0x43')]);return _0x198609[_0x5f72('0x4f')](_0x2fa280);}})[_0x5f72('0x28')](function(_0x554dcf){if(_0x554dcf){_0x37443b=_0x554dcf['length'];if(!_0x30e03[_0x5f72('0x35')][_0x5f72('0x3b')](_0x5f72('0x3c'))){_0x2fa280[_0x5f72('0x21')]=qs[_0x5f72('0x21')](_0x30e03[_0x5f72('0x35')]['limit']);_0x2fa280[_0x5f72('0x1e')]=qs[_0x5f72('0x1e')](_0x30e03[_0x5f72('0x35')][_0x5f72('0x1e')]);}return _0x198609['getConfigurations'](_0x2fa280);}})[_0x5f72('0x28')](function(_0x5b119c){if(_0x5b119c){return _0x5b119c?{'count':_0x37443b,'rows':_0x5b119c}:null;}})[_0x5f72('0x28')](respondWithResult(_0x2195c7,null))[_0x5f72('0x47')](handleError(_0x2195c7,null));};exports[_0x5f72('0x52')]=function(_0x6b865d,_0x58b330,_0x4013bf){if(_0x6b865d[_0x5f72('0x4e')]['id']){delete _0x6b865d[_0x5f72('0x4e')]['id'];}return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x6b865d['params']['id']}})[_0x5f72('0x28')](handleEntityNotFound(_0x58b330,null))['then'](function(_0x4b6a90){if(_0x4b6a90){_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x53')]=_0x4b6a90['id'];_0x6b865d[_0x5f72('0x4e')]['Subjects']=integrations[_0x5f72('0x54')](_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x55')],_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x31')]);_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x56')]=integrations[_0x5f72('0x57')](_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x55')],_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x31')]);return db[_0x5f72('0x50')]['create'](_0x6b865d[_0x5f72('0x4e')],{'include':[{'model':db[_0x5f72('0x58')],'as':_0x5f72('0x59')},{'model':db['Dynamics365Field'],'as':_0x5f72('0x56')}]});}return null;})['then'](respondWithResult(_0x58b330,null))['catch'](handleError(_0x58b330,null));};exports['getFields']=function(_0x5ca842,_0x49d3d7,_0x1cd273){var _0x4cc70c=_0x5ca842['query'][_0x5f72('0x5a')];var _0x2404fd=_0x4cc70c===_0x5f72('0x5b')?_0x5f72('0x5c'):_0x5f72('0x5d');var _0x3352c5='';var _0x25ed96='';var _0x23ebb4='';var _0x59e2a7='';var _0x28646b='';var _0x1f8370='';var _0x1c9cc4='';var _0x40674f='';var _0x2c2dc2=[_0x5f72('0x5e'),_0x5f72('0x5f'),_0x5f72('0x60'),_0x5f72('0x61'),_0x5f72('0x62'),_0x5f72('0x63'),_0x5f72('0x64'),_0x5f72('0x65'),_0x5f72('0x66'),_0x5f72('0x67')];var _0x5d3dd5=[_0x5f72('0x68'),_0x5f72('0x69'),_0x5f72('0x6a'),'billedserviceunits',_0x5f72('0x6b'),'contactidyominame',_0x5f72('0x6c'),_0x5f72('0x6d'),_0x5f72('0x6e'),_0x5f72('0x6f'),'createdbyname',_0x5f72('0x70'),_0x5f72('0x71'),'createdonbehalfbyname',_0x5f72('0x72'),_0x5f72('0x73'),_0x5f72('0x74'),_0x5f72('0x75'),_0x5f72('0x76'),_0x5f72('0x77'),_0x5f72('0x78'),_0x5f72('0x79'),'escalatedon',_0x5f72('0x7a'),_0x5f72('0x7b'),_0x5f72('0x7c'),_0x5f72('0x7d'),_0x5f72('0x7e'),_0x5f72('0x7f'),_0x5f72('0x80'),_0x5f72('0x81'),'modifiedbyexternalpartyname',_0x5f72('0x82'),_0x5f72('0x83'),_0x5f72('0x84'),'modifiedon',_0x5f72('0x85'),_0x5f72('0x86'),_0x5f72('0x87'),'msdyn_iotalertname',_0x5f72('0x88'),_0x5f72('0x89'),_0x5f72('0x8a'),_0x5f72('0x8b'),_0x5f72('0x8c'),_0x5f72('0x8d'),_0x5f72('0x8e'),'primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber',_0x5f72('0x8f'),'resolvebykpiidname',_0x5f72('0x90'),_0x5f72('0x91'),_0x5f72('0x92'),_0x5f72('0x93'),_0x5f72('0x94'),_0x5f72('0x95'),_0x5f72('0x96'),_0x5f72('0x97'),_0x5f72('0x98'),_0x5f72('0x99'),_0x5f72('0x9a'),'timezoneruleversionnumber',_0x5f72('0x9b'),_0x5f72('0x9c'),_0x5f72('0x9d'),_0x5f72('0x9e')];var _0x4b8748=_0x2c2dc2[_0x5f72('0x9f')](_0x5d3dd5);return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x5ca842['params']['id']},'attributes':['id','username',_0x5f72('0xa0'),'remoteUri','tenantId','clientId',_0x5f72('0xa1')]})['then'](handleEntityNotFound(_0x49d3d7,null))[_0x5f72('0x28')](function(_0x5096cb){if(_0x5096cb){_0x40674f=_0x5096cb[_0x5f72('0xa2')];var _0x15baa4=_0x40674f['slice'](-0x1);if(_0x15baa4==='/'){_0x40674f=_0x40674f[_0x5f72('0xa3')](0x0,_0x40674f['lastIndexOf'](_0x15baa4));}_0x1c9cc4=util['format'](_0x5f72('0xa4'),_0x40674f);var _0x5009c6={'method':_0x5f72('0xa5'),'uri':'https://login.microsoftonline.com/'+_0x5096cb['tenantId']+'/oauth2/token','form':{'client_id':_0x5096cb[_0x5f72('0xa6')],'resource':_0x40674f,'username':_0x5096cb['username'],'password':_0x5096cb['password'],'grant_type':'password','client_secret':_0x5096cb['clientSecret']},'json':!![]};return rp(_0x5009c6);}})[_0x5f72('0x28')](function(_0x424422){_0x1f8370=_0x424422[_0x5f72('0xa7')];var _0x2722e0={'method':'GET','uri':encodeURI(_0x1c9cc4+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2404fd+'\x27'),'headers':{'Authorization':_0x5f72('0xa8')+_0x1f8370,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x2722e0);})[_0x5f72('0x28')](function(_0x1bf453){var _0x49f890=_0x1bf453[_0x5f72('0xaa')][0x0];var _0xc13ee7=_0x49f890['MetadataId'];var _0x466f89={'method':_0x5f72('0xab'),'uri':_0x1c9cc4+'EntityDefinitions('+_0xc13ee7+_0x5f72('0xac'),'headers':{'Authorization':_0x5f72('0xa8')+_0x1f8370,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x466f89);})[_0x5f72('0x28')](function(_0x579869){_0x3352c5=_0x579869;_0x25ed96=_0x3352c5['Attributes'];_0x25ed96=_[_0x5f72('0xad')](_0x25ed96,function(_0xfc665b){return!_0x4b8748['includes'](_0xfc665b['LogicalName']);});var _0x3ee9be=[];var _0x20fe5d=[];_0x25ed96['forEach'](function(_0x51ff27){if(_0x51ff27['@odata.type']){var _0x2fd743=_0x51ff27[_0x5f72('0xae')][_0x5f72('0xa3')](_0x51ff27[_0x5f72('0xae')]['lastIndexOf']('.')+0x1);if(_0x2fd743===_0x5f72('0xaf')){_0x3ee9be[_0x5f72('0xb0')](getSelectList(_0x1c9cc4,_0x4cc70c,_0x20fe5d,_0x3352c5[_0x5f72('0xb1')],_0x51ff27[_0x5f72('0xb1')],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x3ee9be);})[_0x5f72('0x28')](function(_0x6e945a){_0x23ebb4=_0x6e945a[0x0];var _0x5688b9=[];var _0x2697e0=[];_0x25ed96[_0x5f72('0xb3')](function(_0x137510){if(!_[_0x5f72('0xb4')](_0x137510['@odata.type'])){var _0x372611=_0x137510[_0x5f72('0xae')][_0x5f72('0xa3')](_0x137510[_0x5f72('0xae')][_0x5f72('0xb5')]('.')+0x1);if(_0x372611===_0x5f72('0xb6')){_0x5688b9[_0x5f72('0xb0')](getBooleanList(_0x1c9cc4,_0x4cc70c,_0x2697e0,_0x3352c5['MetadataId'],_0x137510[_0x5f72('0xb1')],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x5688b9);})[_0x5f72('0x28')](function(_0x1b38c3){_0x59e2a7=_0x1b38c3[0x0];var _0x80d5bd=[];var _0xeaf63b=[];_0x25ed96[_0x5f72('0xb3')](function(_0x4aad69){if(_0x4aad69[_0x5f72('0xae')]){var _0x38c365=_0x4aad69['@odata.type'][_0x5f72('0xa3')](_0x4aad69['@odata.type'][_0x5f72('0xb5')]('.')+0x1);if(_0x38c365===_0x5f72('0xb7')||_0x38c365===_0x5f72('0xb8')||_0x38c365===_0x5f72('0xb9')||_0x38c365===_0x5f72('0xba')||_0x38c365===_0x5f72('0xbb')||_0x38c365===_0x5f72('0xbc')||_0x38c365==='StatusAttributeMetadata'||_0x38c365==='EntityNameAttributeMetadata'||_0x38c365==='StateAttributeMetadata'||_0x38c365===_0x5f72('0xbd')){_0x80d5bd[_0x5f72('0xb0')](getInputList(_0x1c9cc4,_0x4cc70c,_0x38c365,_0xeaf63b,_0x3352c5[_0x5f72('0xb1')],_0x4aad69['MetadataId'],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x80d5bd);})[_0x5f72('0x28')](function(_0x4acdaa){_0x28646b=_0x4acdaa[0x0];var _0x571b29=_0x23ebb4[_0x5f72('0x9f')](_0x59e2a7)['concat'](_0x28646b);var _0x52de22={'count':_0x571b29[_0x5f72('0x3a')],'rows':_0x571b29};return _0x52de22;})['then'](respondWithResult(_0x49d3d7,null))[_0x5f72('0x47')](function(_0x42ba29){var _0x12fc33=_0x5ca842['query'][_0x5f72('0xbe')]?0x1f4:_0x42ba29[_0x5f72('0xbf')]||0x1f4;logger[_0x5f72('0x2b')](_0x42ba29[_0x5f72('0x2c')]);delete _0x42ba29['name'];if(_0x12fc33===0x191){_0x12fc33=0x190;}_0x49d3d7['status'](_0x12fc33)['send'](_0x5ca842['query']['test']?{'message':_0x5f72('0xc0'),'statusCode':_0x42ba29[_0x5f72('0xbf')]}:_0x42ba29);});};function getSelectList(_0x5f9aa5,_0xaab7d4,_0x41c239,_0x20b398,_0x3bba6c,_0xcde4){var _0xee39f4={'method':_0x5f72('0xab'),'uri':_0x5f9aa5+'EntityDefinitions('+_0x20b398+')/Attributes('+_0x3bba6c+_0x5f72('0xc1')+_0x5f72('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0xcde4,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0xee39f4)[_0x5f72('0x28')](function(_0x283bd4){var _0x5c1c1a=[];var _0x2bfc8d=_0x283bd4[_0x5f72('0xc3')][_0x5f72('0xc4')];_0x2bfc8d[_0x5f72('0xb3')](function(_0x299530){_0x5c1c1a['push']({'name':_0x299530[_0x5f72('0xc5')][_0x5f72('0xc6')][_0x5f72('0xc5')],'value':String(_0x299530[_0x5f72('0xc7')])});});var _0x53c338={'id':_0xaab7d4+'_'+_0x283bd4[_0x5f72('0xc8')],'name':_0x283bd4[_0x5f72('0xc9')][_0x5f72('0xc6')]['Label'],'custom':![],'options':_0x5c1c1a};_0x41c239['push'](_0x53c338);return _0x41c239;});}function getBooleanList(_0x4a2755,_0x1a23b3,_0xf8d005,_0x5763cc,_0x5c680f,_0x309d44){var _0x38ce28={'method':_0x5f72('0xab'),'uri':_0x4a2755+_0x5f72('0xca')+_0x5763cc+_0x5f72('0xcb')+_0x5c680f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x5f72('0xa8')+_0x309d44,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x38ce28)[_0x5f72('0x28')](function(_0x59633c){var _0x17e9d2=[];_0x17e9d2['push']({'name':_0x59633c[_0x5f72('0xc3')][_0x5f72('0xcc')][_0x5f72('0xc5')][_0x5f72('0xc6')][_0x5f72('0xc5')],'value':_0x5f72('0xcd')},{'name':_0x59633c[_0x5f72('0xc3')][_0x5f72('0xce')]['Label'][_0x5f72('0xc6')]['Label'],'value':_0x5f72('0xcf')});var _0x78dd71={'id':_0x1a23b3+'_'+_0x59633c[_0x5f72('0xc8')],'name':_0x59633c['DisplayName']['UserLocalizedLabel'][_0x5f72('0xc5')],'custom':![],'options':_0x17e9d2};_0xf8d005['push'](_0x78dd71);return _0xf8d005;});}function getInputList(_0x1718d2,_0x3abbb8,_0x5c15e7,_0x5d7dbe,_0x9d0259,_0x266204,_0x5587a3){var _0x196021={'method':_0x5f72('0xab'),'uri':_0x1718d2+'EntityDefinitions('+_0x9d0259+_0x5f72('0xcb')+_0x266204+_0x5f72('0xd0')+_0x5c15e7+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5f72('0xa8')+_0x5587a3,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x196021)[_0x5f72('0x28')](function(_0x1bc7ff){var _0x52dfe6={'id':_0x3abbb8+'_'+_0x1bc7ff[_0x5f72('0xc8')],'name':_0x1bc7ff[_0x5f72('0xc9')][_0x5f72('0xc6')]?_0x1bc7ff[_0x5f72('0xc9')][_0x5f72('0xc6')]['Label']:_0x1bc7ff[_0x5f72('0xc8')],'custom':![],'options':[]};_0x5d7dbe[_0x5f72('0xb0')](_0x52dfe6);return _0x5d7dbe;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3c2d5ce..059ff6f 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x113563,_0x178f66){var _0x12738e=function(_0x50bfd9){while(--_0x50bfd9){_0x113563['push'](_0x113563['shift']());}};_0x12738e(++_0x178f66);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 8f6679a..159a08e 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 _0x016f=['error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','limit','model','attributes','include','map','stringify','catch','ShowDynamics365Account','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x503f61,_0x5d7c28){var _0x42afaf=function(_0x370a15){while(--_0x370a15){_0x503f61['push'](_0x503f61['shift']());}};_0x42afaf(++_0x5d7c28);}(_0x016f,0x7e));var _0xf016=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x016f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf016('0x0'));var util=require('util');var moment=require(_0xf016('0x1'));var BPromise=require(_0xf016('0x2'));var rs=require(_0xf016('0x3'));var fs=require('fs');var Redis=require(_0xf016('0x4'));var db=require(_0xf016('0x5'))['db'];var utils=require(_0xf016('0x6'));var logger=require(_0xf016('0x7'))(_0xf016('0x8'));var config=require(_0xf016('0x9'));var jayson=require(_0xf016('0xa'));var client=jayson['client'][_0xf016('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b6524,_0x5a06a1,_0x15c97f){return new BPromise(function(_0x34606a,_0x55fc19){return client[_0xf016('0xc')](_0x1b6524,_0x15c97f)[_0xf016('0xd')](function(_0x58fa07){logger[_0xf016('0xe')](_0xf016('0xf'),_0x5a06a1,_0xf016('0x10'));logger[_0xf016('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5a06a1,_0xf016('0x10'),JSON['stringify'](_0x58fa07));if(_0x58fa07['error']){if(_0x58fa07[_0xf016('0x12')][_0xf016('0x13')]===0x1f4){logger[_0xf016('0x12')](_0xf016('0xf'),_0x5a06a1,_0x58fa07[_0xf016('0x12')][_0xf016('0x14')]);return _0x55fc19(_0x58fa07[_0xf016('0x12')][_0xf016('0x14')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5a06a1,_0x58fa07[_0xf016('0x12')][_0xf016('0x14')]);return _0x34606a(_0x58fa07[_0xf016('0x12')]['message']);}else{logger[_0xf016('0xe')](_0xf016('0xf'),_0x5a06a1,_0xf016('0x10'));_0x34606a(_0x58fa07['result'][_0xf016('0x14')]);}})['catch'](function(_0x1561e9){logger['error'](_0xf016('0xf'),_0x5a06a1,_0x1561e9);_0x55fc19(_0x1561e9);});});}exports[_0xf016('0x15')]=function(_0x4fc457){var _0x114e9b=this;return new Promise(function(_0x5270ce,_0x55127a){return db[_0xf016('0x16')][_0xf016('0x17')]({'raw':_0x4fc457[_0xf016('0x18')]?_0x4fc457[_0xf016('0x18')][_0xf016('0x19')]===undefined?!![]:![]:!![],'where':_0x4fc457[_0xf016('0x18')]?_0x4fc457[_0xf016('0x18')]['where']||null:null,'attributes':_0x4fc457['options']?_0x4fc457[_0xf016('0x18')]['attributes']||null:null,'limit':_0x4fc457[_0xf016('0x18')]?_0x4fc457[_0xf016('0x18')][_0xf016('0x1a')]||null:null,'include':_0x4fc457[_0xf016('0x18')]?_0x4fc457[_0xf016('0x18')]['include']?_['map'](_0x4fc457[_0xf016('0x18')]['include'],function(_0x3c5de6){return{'model':db[_0x3c5de6[_0xf016('0x1b')]],'as':_0x3c5de6['as'],'attributes':_0x3c5de6[_0xf016('0x1c')],'include':_0x3c5de6[_0xf016('0x1d')]?_[_0xf016('0x1e')](_0x3c5de6[_0xf016('0x1d')],function(_0x1fdde6){return{'model':db[_0x1fdde6[_0xf016('0x1b')]],'as':_0x1fdde6['as'],'attributes':_0x1fdde6['attributes'],'include':_0x1fdde6['include']?_[_0xf016('0x1e')](_0x1fdde6[_0xf016('0x1d')],function(_0x50e1e9){return{'model':db[_0x50e1e9[_0xf016('0x1b')]],'as':_0x50e1e9['as'],'attributes':_0x50e1e9[_0xf016('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf016('0xd')](function(_0x271b11){logger['info'](_0xf016('0x15'),_0x4fc457);logger['debug'](_0xf016('0x15'),_0x4fc457,JSON[_0xf016('0x1f')](_0x271b11));_0x5270ce(_0x271b11);})[_0xf016('0x20')](function(_0x236870){logger[_0xf016('0x12')](_0xf016('0x15'),_0x236870[_0xf016('0x14')],_0x4fc457);_0x55127a(_0x114e9b[_0xf016('0x12')](0x1f4,_0x236870['message']));});});};exports[_0xf016('0x21')]=function(_0x287779){var _0x2e3184=this;return new Promise(function(_0x5aca7a,_0x434958){return db[_0xf016('0x16')][_0xf016('0x22')]({'raw':_0x287779[_0xf016('0x18')]?_0x287779['options'][_0xf016('0x19')]===undefined?!![]:![]:!![],'where':_0x287779[_0xf016('0x18')]?_0x287779[_0xf016('0x18')][_0xf016('0x23')]||null:null,'attributes':_0x287779['options']?_0x287779[_0xf016('0x18')]['attributes']||null:null,'include':_0x287779[_0xf016('0x18')]?_0x287779[_0xf016('0x18')]['include']?_[_0xf016('0x1e')](_0x287779[_0xf016('0x18')][_0xf016('0x1d')],function(_0x258e10){return{'model':db[_0x258e10[_0xf016('0x1b')]],'as':_0x258e10['as'],'attributes':_0x258e10[_0xf016('0x1c')],'include':_0x258e10['include']?_[_0xf016('0x1e')](_0x258e10[_0xf016('0x1d')],function(_0x3cbcc8){return{'model':db[_0x3cbcc8[_0xf016('0x1b')]],'as':_0x3cbcc8['as'],'attributes':_0x3cbcc8[_0xf016('0x1c')],'include':_0x3cbcc8[_0xf016('0x1d')]?_[_0xf016('0x1e')](_0x3cbcc8['include'],function(_0x358a77){return{'model':db[_0x358a77[_0xf016('0x1b')]],'as':_0x358a77['as'],'attributes':_0x358a77[_0xf016('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf016('0xd')](function(_0x4c3c90){logger[_0xf016('0xe')](_0xf016('0x21'),_0x287779);logger[_0xf016('0x11')](_0xf016('0x21'),_0x287779,JSON[_0xf016('0x1f')](_0x4c3c90));_0x5aca7a(_0x4c3c90);})[_0xf016('0x20')](function(_0x513726){logger[_0xf016('0x12')]('ShowDynamics365Account',_0x513726['message'],_0x287779);_0x434958(_0x2e3184[_0xf016('0x12')](0x1f4,_0x513726[_0xf016('0x14')]));});});}; \ No newline at end of file +var _0xce35=['attributes','model','info','debug','GetDynamics365Account','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dynamics365Account','options','where','limit','include','map'];(function(_0x18914a,_0x1878cd){var _0x1adffb=function(_0x13d1ca){while(--_0x13d1ca){_0x18914a['push'](_0x18914a['shift']());}};_0x1adffb(++_0x1878cd);}(_0xce35,0xb0));var _0x5ce3=function(_0x33b74a,_0x58253e){_0x33b74a=_0x33b74a-0x0;var _0x52dfc2=_0xce35[_0x33b74a];return _0x52dfc2;};'use strict';var _=require('lodash');var util=require(_0x5ce3('0x0'));var moment=require(_0x5ce3('0x1'));var BPromise=require(_0x5ce3('0x2'));var rs=require(_0x5ce3('0x3'));var fs=require('fs');var Redis=require(_0x5ce3('0x4'));var db=require(_0x5ce3('0x5'))['db'];var utils=require(_0x5ce3('0x6'));var logger=require(_0x5ce3('0x7'))(_0x5ce3('0x8'));var config=require(_0x5ce3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ce3('0xa')][_0x5ce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3494ba,_0x3cb4c3,_0x2a1607){return new BPromise(function(_0x26df59,_0x121bc7){return client[_0x5ce3('0xc')](_0x3494ba,_0x2a1607)[_0x5ce3('0xd')](function(_0x2541e8){logger['info'](_0x5ce3('0xe'),_0x3cb4c3,_0x5ce3('0xf'));logger['debug'](_0x5ce3('0x10'),_0x3cb4c3,_0x5ce3('0xf'),JSON[_0x5ce3('0x11')](_0x2541e8));if(_0x2541e8[_0x5ce3('0x12')]){if(_0x2541e8[_0x5ce3('0x12')]['code']===0x1f4){logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);return _0x121bc7(_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);}logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x2541e8[_0x5ce3('0x12')]['message']);return _0x26df59(_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3cb4c3,_0x5ce3('0xf'));_0x26df59(_0x2541e8[_0x5ce3('0x14')][_0x5ce3('0x13')]);}})[_0x5ce3('0x15')](function(_0x53717e){logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x53717e);_0x121bc7(_0x53717e);});});}exports['GetDynamics365Account']=function(_0x4bcdd0){var _0x5e1b20=this;return new Promise(function(_0x3c92e1,_0x5d194b){return db[_0x5ce3('0x16')]['findAll']({'raw':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4bcdd0['options']?_0x4bcdd0['options'][_0x5ce3('0x18')]||null:null,'attributes':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0['options']['attributes']||null:null,'limit':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x19')]||null:null,'include':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x1a')],function(_0xa2abe){return{'model':db[_0xa2abe['model']],'as':_0xa2abe['as'],'attributes':_0xa2abe[_0x5ce3('0x1c')],'include':_0xa2abe[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0xa2abe[_0x5ce3('0x1a')],function(_0x433444){return{'model':db[_0x433444[_0x5ce3('0x1d')]],'as':_0x433444['as'],'attributes':_0x433444[_0x5ce3('0x1c')],'include':_0x433444[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x433444[_0x5ce3('0x1a')],function(_0x577d1a){return{'model':db[_0x577d1a['model']],'as':_0x577d1a['as'],'attributes':_0x577d1a[_0x5ce3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5ce3('0xd')](function(_0x6e8e6c){logger[_0x5ce3('0x1e')]('GetDynamics365Account',_0x4bcdd0);logger[_0x5ce3('0x1f')](_0x5ce3('0x20'),_0x4bcdd0,JSON[_0x5ce3('0x11')](_0x6e8e6c));_0x3c92e1(_0x6e8e6c);})[_0x5ce3('0x15')](function(_0x1ea684){logger['error']('GetDynamics365Account',_0x1ea684[_0x5ce3('0x13')],_0x4bcdd0);_0x5d194b(_0x5e1b20[_0x5ce3('0x12')](0x1f4,_0x1ea684['message']));});});};exports['ShowDynamics365Account']=function(_0x2afb95){var _0x211d0c=this;return new Promise(function(_0x1892dc,_0x5aaf38){return db[_0x5ce3('0x16')]['find']({'raw':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x18')]||null:null,'attributes':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')]['attributes']||null:null,'include':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x1a')]?_['map'](_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x1a')],function(_0x5aba62){return{'model':db[_0x5aba62[_0x5ce3('0x1d')]],'as':_0x5aba62['as'],'attributes':_0x5aba62[_0x5ce3('0x1c')],'include':_0x5aba62[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x5aba62['include'],function(_0x350e3d){return{'model':db[_0x350e3d['model']],'as':_0x350e3d['as'],'attributes':_0x350e3d[_0x5ce3('0x1c')],'include':_0x350e3d['include']?_[_0x5ce3('0x1b')](_0x350e3d[_0x5ce3('0x1a')],function(_0x259271){return{'model':db[_0x259271['model']],'as':_0x259271['as'],'attributes':_0x259271[_0x5ce3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5ce3('0xd')](function(_0x648b5d){logger[_0x5ce3('0x1e')](_0x5ce3('0x21'),_0x2afb95);logger[_0x5ce3('0x1f')](_0x5ce3('0x21'),_0x2afb95,JSON[_0x5ce3('0x11')](_0x648b5d));_0x1892dc(_0x648b5d);})[_0x5ce3('0x15')](function(_0x5ac385){logger[_0x5ce3('0x12')](_0x5ce3('0x21'),_0x5ac385[_0x5ce3('0x13')],_0x2afb95);_0x5aaf38(_0x211d0c['error'](0x1f4,_0x5ac385[_0x5ce3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 094ea52..94cc7d3 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 _0xd732=['Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path'];(function(_0x2dca8c,_0x5583f5){var _0x1db10c=function(_0x59db6f){while(--_0x59db6f){_0x2dca8c['push'](_0x2dca8c['shift']());}};_0x1db10c(++_0x5583f5);}(_0xd732,0x18e));var _0x2d73=function(_0x3c2237,_0x551c5a){_0x3c2237=_0x3c2237-0x0;var _0x74b86=_0xd732[_0x3c2237];return _0x74b86;};'use strict';var multer=require(_0x2d73('0x0'));var util=require('util');var path=require(_0x2d73('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d73('0x2')]();var fs_extra=require(_0x2d73('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d73('0x4'));var controller=require('./intDynamics365Configuration.controller');router[_0x2d73('0x5')]('/',auth[_0x2d73('0x6')](),controller['index']);router['get'](_0x2d73('0x7'),auth['isAuthenticated'](),controller[_0x2d73('0x8')]);router[_0x2d73('0x5')](_0x2d73('0x9'),auth[_0x2d73('0x6')](),controller['getFields']);router[_0x2d73('0x5')](_0x2d73('0xa'),auth[_0x2d73('0x6')](),controller[_0x2d73('0xb')]);router['get'](_0x2d73('0xc'),auth[_0x2d73('0x6')](),controller[_0x2d73('0xd')]);router[_0x2d73('0xe')]('/',auth[_0x2d73('0x6')](),controller[_0x2d73('0xf')]);router[_0x2d73('0x10')](_0x2d73('0x7'),auth[_0x2d73('0x6')](),controller[_0x2d73('0x11')]);router[_0x2d73('0x12')](_0x2d73('0x7'),auth['isAuthenticated'](),controller[_0x2d73('0x13')]);module['exports']=router; \ No newline at end of file +var _0x18af=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x2a5021,_0xf5bcd2){var _0x363f1f=function(_0x5a2fe2){while(--_0x5a2fe2){_0x2a5021['push'](_0x2a5021['shift']());}};_0x363f1f(++_0xf5bcd2);}(_0x18af,0x19d));var _0xf18a=function(_0x1ef269,_0x1c92f5){_0x1ef269=_0x1ef269-0x0;var _0x674f0e=_0x18af[_0x1ef269];return _0x674f0e;};'use strict';var multer=require(_0xf18a('0x0'));var util=require('util');var path=require(_0xf18a('0x1'));var timeout=require(_0xf18a('0x2'));var express=require(_0xf18a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf18a('0x4'));var interaction=require(_0xf18a('0x5'));var config=require(_0xf18a('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xf18a('0x7')]('/',auth[_0xf18a('0x8')](),controller[_0xf18a('0x9')]);router['get']('/:id',auth[_0xf18a('0x8')](),controller[_0xf18a('0xa')]);router['get'](_0xf18a('0xb'),auth[_0xf18a('0x8')](),controller[_0xf18a('0xc')]);router[_0xf18a('0x7')](_0xf18a('0xd'),auth[_0xf18a('0x8')](),controller['getSubjects']);router[_0xf18a('0x7')](_0xf18a('0xe'),auth[_0xf18a('0x8')](),controller[_0xf18a('0xf')]);router[_0xf18a('0x10')]('/',auth[_0xf18a('0x8')](),controller[_0xf18a('0x11')]);router[_0xf18a('0x12')](_0xf18a('0x13'),auth['isAuthenticated'](),controller[_0xf18a('0x14')]);router[_0xf18a('0x15')](_0xf18a('0x13'),auth[_0xf18a('0x8')](),controller[_0xf18a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index b06b182..88fb7e7 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 _0x4c56=['exports','STRING','ENUM','incident','phonecall','sequelize'];(function(_0x598b37,_0x1a676d){var _0x57bb95=function(_0x28eb68){while(--_0x28eb68){_0x598b37['push'](_0x598b37['shift']());}};_0x57bb95(++_0x1a676d);}(_0x4c56,0xa7));var _0x64c5=function(_0x12b248,_0x57a33a){_0x12b248=_0x12b248-0x0;var _0xde9a=_0x4c56[_0x12b248];return _0xde9a;};'use strict';var Sequelize=require(_0x64c5('0x0'));module[_0x64c5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x64c5('0x2')]},'ticketType':{'type':Sequelize[_0x64c5('0x3')](_0x64c5('0x4'),_0x64c5('0x5')),'defaultValue':'incident'}}; \ No newline at end of file +var _0xb550=['ENUM','incident','phonecall','exports','STRING'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xb550,0x17a));var _0x0b55=function(_0x103e64,_0x8344cc){_0x103e64=_0x103e64-0x0;var _0xae5a66=_0xb550[_0x103e64];return _0xae5a66;};'use strict';var Sequelize=require('sequelize');module[_0x0b55('0x0')]={'name':{'type':Sequelize[_0x0b55('0x1')]},'description':{'type':Sequelize[_0x0b55('0x1')]},'ticketType':{'type':Sequelize[_0x0b55('0x2')](_0x0b55('0x3'),_0x0b55('0x4')),'defaultValue':_0x0b55('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 68e8ad3..5824512 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 _0x64ee=['filter','getDescriptions','rimraf','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','rows','catch','length','include','find','create','body','params','findOne','Dynamics365Field','order','getFields','getSubjects'];(function(_0x6ffb58,_0x472a6e){var _0x38bbaf=function(_0x436682){while(--_0x436682){_0x6ffb58['push'](_0x6ffb58['shift']());}};_0x38bbaf(++_0x472a6e);}(_0x64ee,0x1e2));var _0xe64e=function(_0x5488ee,_0x19366c){_0x5488ee=_0x5488ee-0x0;var _0x3d21b9=_0x64ee[_0x5488ee];return _0x3d21b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe64e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe64e('0x1'));var moment=require(_0xe64e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe64e('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe64e('0x4'));var csv=require('to-csv');var ejs=require(_0xe64e('0x5'));var fs=require('fs');var fs_extra=require(_0xe64e('0x6'));var _=require(_0xe64e('0x7'));var squel=require('squel');var crypto=require(_0xe64e('0x8'));var jsforce=require(_0xe64e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe64e('0xa'));var querystring=require(_0xe64e('0xb'));var Papa=require('papaparse');var Redis=require(_0xe64e('0xc'));var authService=require(_0xe64e('0xd'));var qs=require(_0xe64e('0xe'));var as=require(_0xe64e('0xf'));var hardwareService=require(_0xe64e('0x10'));var logger=require(_0xe64e('0x11'))(_0xe64e('0x12'));var utils=require(_0xe64e('0x13'));var config=require(_0xe64e('0x14'));var licenseUtil=require(_0xe64e('0x15'));var db=require(_0xe64e('0x16'))['db'];function respondWithStatusCode(_0x4220e4,_0x5109d3){_0x5109d3=_0x5109d3||0xcc;return function(_0x109972){if(_0x109972){return _0x4220e4[_0xe64e('0x17')](_0x5109d3);}return _0x4220e4[_0xe64e('0x18')](_0x5109d3)[_0xe64e('0x19')]();};}function respondWithResult(_0x5dbed3,_0x248cb4){_0x248cb4=_0x248cb4||0xc8;return function(_0x208d70){if(_0x208d70){return _0x5dbed3[_0xe64e('0x18')](_0x248cb4)[_0xe64e('0x1a')](_0x208d70);}};}function respondWithFilteredResult(_0x749c4a,_0x3c9da2){return function(_0x26fd63){if(_0x26fd63){var _0x118367=typeof _0x3c9da2['offset']===_0xe64e('0x1b')&&typeof _0x3c9da2[_0xe64e('0x1c')]===_0xe64e('0x1b');var _0x44bd4f=_0x26fd63[_0xe64e('0x1d')];var _0x27d7e5=_0x118367?0x0:_0x3c9da2[_0xe64e('0x1e')];var _0x4fcd18=_0x118367?_0x26fd63[_0xe64e('0x1d')]:_0x3c9da2[_0xe64e('0x1e')]+_0x3c9da2[_0xe64e('0x1c')];var _0x5b1284;if(_0x4fcd18>=_0x44bd4f){_0x4fcd18=_0x44bd4f;_0x5b1284=0xc8;}else{_0x5b1284=0xce;}_0x749c4a[_0xe64e('0x18')](_0x5b1284);return _0x749c4a[_0xe64e('0x1f')](_0xe64e('0x20'),_0x27d7e5+'-'+_0x4fcd18+'/'+_0x44bd4f)['json'](_0x26fd63);}return null;};}function patchUpdates(_0x2e7d91){return function(_0x470143){try{jsonpatch[_0xe64e('0x21')](_0x470143,_0x2e7d91,!![]);}catch(_0x1d3d8e){return BPromise[_0xe64e('0x22')](_0x1d3d8e);}return _0x470143[_0xe64e('0x23')]();};}function saveUpdates(_0x58a285,_0x343a6e){return function(_0x4402c7){if(_0x4402c7){return _0x4402c7[_0xe64e('0x24')](_0x58a285)['then'](function(_0x5883aa){return _0x5883aa;});}return null;};}function removeEntity(_0x2a1c23,_0xcae073){return function(_0x44fbe3){if(_0x44fbe3){return _0x44fbe3[_0xe64e('0x25')]()[_0xe64e('0x26')](function(){_0x2a1c23[_0xe64e('0x18')](0xcc)[_0xe64e('0x19')]();});}};}function handleEntityNotFound(_0x4f50ab,_0x53b377){return function(_0x4e5952){if(!_0x4e5952){_0x4f50ab[_0xe64e('0x17')](0x194);}return _0x4e5952;};}function handleError(_0x20114d,_0x59bd58){_0x59bd58=_0x59bd58||0x1f4;return function(_0xa3c2a4){logger[_0xe64e('0x27')](_0xa3c2a4[_0xe64e('0x28')]);if(_0xa3c2a4[_0xe64e('0x29')]){delete _0xa3c2a4[_0xe64e('0x29')];}_0x20114d[_0xe64e('0x18')](_0x59bd58)[_0xe64e('0x2a')](_0xa3c2a4);};}exports[_0xe64e('0x2b')]=function(_0x485e26,_0x2d16c1){var _0x394b51={},_0x41c1fb={},_0x37e77e={'count':0x0,'rows':[]};var _0x2251e9=_['map'](db['Dynamics365Configuration'][_0xe64e('0x2c')],function(_0x253df1){return{'name':_0x253df1['fieldName'],'type':_0x253df1[_0xe64e('0x2d')][_0xe64e('0x2e')]};});_0x41c1fb['model']=_[_0xe64e('0x2f')](_0x2251e9,'name');_0x41c1fb[_0xe64e('0x30')]=_[_0xe64e('0x31')](_0x485e26[_0xe64e('0x30')]);_0x41c1fb['filters']=_[_0xe64e('0x32')](_0x41c1fb[_0xe64e('0x33')],_0x41c1fb['query']);_0x394b51[_0xe64e('0x34')]=_[_0xe64e('0x32')](_0x41c1fb[_0xe64e('0x33')],qs[_0xe64e('0x35')](_0x485e26[_0xe64e('0x30')][_0xe64e('0x35')]));_0x394b51[_0xe64e('0x34')]=_0x394b51['attributes']['length']?_0x394b51['attributes']:_0x41c1fb[_0xe64e('0x33')];if(!_0x485e26['query'][_0xe64e('0x36')](_0xe64e('0x37'))){_0x394b51[_0xe64e('0x1c')]=qs[_0xe64e('0x1c')](_0x485e26[_0xe64e('0x30')]['limit']);_0x394b51[_0xe64e('0x1e')]=qs['offset'](_0x485e26[_0xe64e('0x30')][_0xe64e('0x1e')]);}_0x394b51['order']=qs[_0xe64e('0x38')](_0x485e26[_0xe64e('0x30')]['sort']);_0x394b51[_0xe64e('0x39')]=qs[_0xe64e('0x3a')](_[_0xe64e('0x3b')](_0x485e26['query'],_0x41c1fb[_0xe64e('0x3a')]),_0x2251e9);if(_0x485e26[_0xe64e('0x30')]['filter']){_0x394b51[_0xe64e('0x39')]=_[_0xe64e('0x3c')](_0x394b51['where'],{'$or':_['map'](_0x2251e9,function(_0x3a8be9){if(_0x3a8be9[_0xe64e('0x2d')]!==_0xe64e('0x3d')){var _0x1754e3={};_0x1754e3[_0x3a8be9[_0xe64e('0x29')]]={'$like':'%'+_0x485e26[_0xe64e('0x30')]['filter']+'%'};return _0x1754e3;}})});}_0x394b51=_[_0xe64e('0x3c')]({},_0x394b51,_0x485e26[_0xe64e('0x3e')]);var _0x11a314={'where':_0x394b51['where']};return db[_0xe64e('0x3f')][_0xe64e('0x1d')](_0x11a314)['then'](function(_0x54fe39){_0x37e77e['count']=_0x54fe39;if(_0x485e26['query'][_0xe64e('0x40')]){_0x394b51['include']=[{'all':!![]}];}return db[_0xe64e('0x3f')]['findAll'](_0x394b51);})[_0xe64e('0x26')](function(_0x47503c){_0x37e77e[_0xe64e('0x41')]=_0x47503c;return _0x37e77e;})[_0xe64e('0x26')](respondWithFilteredResult(_0x2d16c1,_0x394b51))[_0xe64e('0x42')](handleError(_0x2d16c1,null));};exports['show']=function(_0x1b5595,_0x5ac2ec){var _0x56e831={'raw':![],'where':{'id':_0x1b5595['params']['id']}},_0x5bd867={};_0x5bd867[_0xe64e('0x33')]=_[_0xe64e('0x31')](db[_0xe64e('0x3f')]['rawAttributes']);_0x5bd867[_0xe64e('0x30')]=_[_0xe64e('0x31')](_0x1b5595[_0xe64e('0x30')]);_0x5bd867[_0xe64e('0x3a')]=_[_0xe64e('0x32')](_0x5bd867['model'],_0x5bd867[_0xe64e('0x30')]);_0x56e831['attributes']=_['intersection'](_0x5bd867[_0xe64e('0x33')],qs[_0xe64e('0x35')](_0x1b5595[_0xe64e('0x30')][_0xe64e('0x35')]));_0x56e831[_0xe64e('0x34')]=_0x56e831['attributes'][_0xe64e('0x43')]?_0x56e831['attributes']:_0x5bd867['model'];if(_0x1b5595['query'][_0xe64e('0x40')]){_0x56e831[_0xe64e('0x44')]=[{'all':!![]}];}_0x56e831=_[_0xe64e('0x3c')]({},_0x56e831,_0x1b5595[_0xe64e('0x3e')]);return db['Dynamics365Configuration'][_0xe64e('0x45')](_0x56e831)[_0xe64e('0x26')](handleEntityNotFound(_0x5ac2ec,null))['then'](respondWithResult(_0x5ac2ec,null))[_0xe64e('0x42')](handleError(_0x5ac2ec,null));};exports[_0xe64e('0x46')]=function(_0x184039,_0x3a5ba7){return db[_0xe64e('0x3f')]['create'](_0x184039['body'],{})[_0xe64e('0x26')](respondWithResult(_0x3a5ba7,0xc9))['catch'](handleError(_0x3a5ba7,null));};exports['update']=function(_0x36cbd8,_0x2288be){if(_0x36cbd8['body']['id']){delete _0x36cbd8[_0xe64e('0x47')]['id'];}return db[_0xe64e('0x3f')]['find']({'where':{'id':_0x36cbd8['params']['id']}})[_0xe64e('0x26')](handleEntityNotFound(_0x2288be,null))['then'](saveUpdates(_0x36cbd8[_0xe64e('0x47')],null))[_0xe64e('0x26')](respondWithResult(_0x2288be,null))[_0xe64e('0x42')](handleError(_0x2288be,null));};exports[_0xe64e('0x25')]=function(_0x258124,_0x2d6a4e){return db[_0xe64e('0x3f')][_0xe64e('0x45')]({'where':{'id':_0x258124[_0xe64e('0x48')]['id']}})[_0xe64e('0x26')](handleEntityNotFound(_0x2d6a4e,null))[_0xe64e('0x26')](removeEntity(_0x2d6a4e,null))['catch'](handleError(_0x2d6a4e,null));};exports['getFields']=function(_0x2b4d50,_0x30c00f,_0x24fe6a){var _0x4eab90={};var _0x27ba0c={};var _0x12affb;var _0x5c5b62;return db[_0xe64e('0x3f')][_0xe64e('0x49')]({'where':{'id':_0x2b4d50[_0xe64e('0x48')]['id']}})[_0xe64e('0x26')](handleEntityNotFound(_0x30c00f,null))[_0xe64e('0x26')](function(_0x39a39b){if(_0x39a39b){_0x12affb=_0x39a39b;_0x27ba0c[_0xe64e('0x33')]=_['keys'](db[_0xe64e('0x4a')][_0xe64e('0x2c')]);_0x27ba0c[_0xe64e('0x30')]=_[_0xe64e('0x31')](_0x2b4d50['query']);_0x27ba0c[_0xe64e('0x3a')]=_[_0xe64e('0x32')](_0x27ba0c[_0xe64e('0x33')],_0x27ba0c[_0xe64e('0x30')]);_0x4eab90['attributes']=_[_0xe64e('0x32')](_0x27ba0c['model'],qs['fields'](_0x2b4d50[_0xe64e('0x30')]['fields']));_0x4eab90[_0xe64e('0x34')]=_0x4eab90[_0xe64e('0x34')][_0xe64e('0x43')]?_0x4eab90[_0xe64e('0x34')]:_0x27ba0c[_0xe64e('0x33')];_0x4eab90[_0xe64e('0x4b')]=qs[_0xe64e('0x38')](_0x2b4d50[_0xe64e('0x30')][_0xe64e('0x38')]);_0x4eab90[_0xe64e('0x39')]=qs['filters'](_[_0xe64e('0x3b')](_0x2b4d50[_0xe64e('0x30')],_0x27ba0c['filters']));if(_0x2b4d50['query']['filter']){_0x4eab90['where']=_[_0xe64e('0x3c')](_0x4eab90[_0xe64e('0x39')],{'$or':_[_0xe64e('0x2f')](_0x4eab90[_0xe64e('0x34')],function(_0x537137){var _0x69686f={};_0x69686f[_0x537137]={'$like':'%'+_0x2b4d50[_0xe64e('0x30')]['filter']+'%'};return _0x69686f;})});}_0x4eab90=_[_0xe64e('0x3c')]({},_0x4eab90,_0x2b4d50[_0xe64e('0x3e')]);return _0x12affb[_0xe64e('0x4c')](_0x4eab90);}})['then'](function(_0x45f2a4){if(_0x45f2a4){_0x5c5b62=_0x45f2a4[_0xe64e('0x43')];if(!_0x2b4d50[_0xe64e('0x30')][_0xe64e('0x36')](_0xe64e('0x37'))){_0x4eab90[_0xe64e('0x1c')]=qs['limit'](_0x2b4d50[_0xe64e('0x30')]['limit']);_0x4eab90[_0xe64e('0x1e')]=qs[_0xe64e('0x1e')](_0x2b4d50['query'][_0xe64e('0x1e')]);}return _0x12affb[_0xe64e('0x4c')](_0x4eab90);}})[_0xe64e('0x26')](function(_0x4aa49e){if(_0x4aa49e){return _0x4aa49e?{'count':_0x5c5b62,'rows':_0x4aa49e}:null;}})[_0xe64e('0x26')](respondWithResult(_0x30c00f,null))[_0xe64e('0x42')](handleError(_0x30c00f,null));};exports[_0xe64e('0x4d')]=function(_0x3d274b,_0x54646b,_0xcacaf9){var _0x41187f={};var _0x2a4ccb={};var _0x599610;var _0xa60c0d;return db[_0xe64e('0x3f')][_0xe64e('0x49')]({'where':{'id':_0x3d274b[_0xe64e('0x48')]['id']}})[_0xe64e('0x26')](handleEntityNotFound(_0x54646b,null))['then'](function(_0x3462de){if(_0x3462de){_0x599610=_0x3462de;_0x2a4ccb[_0xe64e('0x33')]=_[_0xe64e('0x31')](db[_0xe64e('0x4a')]['rawAttributes']);_0x2a4ccb['query']=_[_0xe64e('0x31')](_0x3d274b[_0xe64e('0x30')]);_0x2a4ccb[_0xe64e('0x3a')]=_[_0xe64e('0x32')](_0x2a4ccb[_0xe64e('0x33')],_0x2a4ccb[_0xe64e('0x30')]);_0x41187f[_0xe64e('0x34')]=_[_0xe64e('0x32')](_0x2a4ccb[_0xe64e('0x33')],qs[_0xe64e('0x35')](_0x3d274b[_0xe64e('0x30')]['fields']));_0x41187f['attributes']=_0x41187f['attributes'][_0xe64e('0x43')]?_0x41187f[_0xe64e('0x34')]:_0x2a4ccb[_0xe64e('0x33')];_0x41187f['order']=qs[_0xe64e('0x38')](_0x3d274b['query']['sort']);_0x41187f[_0xe64e('0x39')]=qs[_0xe64e('0x3a')](_[_0xe64e('0x3b')](_0x3d274b[_0xe64e('0x30')],_0x2a4ccb[_0xe64e('0x3a')]));if(_0x3d274b['query'][_0xe64e('0x4e')]){_0x41187f[_0xe64e('0x39')]=_[_0xe64e('0x3c')](_0x41187f[_0xe64e('0x39')],{'$or':_[_0xe64e('0x2f')](_0x41187f[_0xe64e('0x34')],function(_0x1c835f){var _0x1833e2={};_0x1833e2[_0x1c835f]={'$like':'%'+_0x3d274b[_0xe64e('0x30')]['filter']+'%'};return _0x1833e2;})});}_0x41187f=_['merge']({},_0x41187f,_0x3d274b[_0xe64e('0x3e')]);return _0x599610['getSubjects'](_0x41187f);}})['then'](function(_0x5ac93f){if(_0x5ac93f){_0xa60c0d=_0x5ac93f[_0xe64e('0x43')];if(!_0x3d274b['query'][_0xe64e('0x36')](_0xe64e('0x37'))){_0x41187f[_0xe64e('0x1c')]=qs[_0xe64e('0x1c')](_0x3d274b[_0xe64e('0x30')]['limit']);_0x41187f[_0xe64e('0x1e')]=qs[_0xe64e('0x1e')](_0x3d274b[_0xe64e('0x30')]['offset']);}return _0x599610['getSubjects'](_0x41187f);}})[_0xe64e('0x26')](function(_0x377a3f){if(_0x377a3f){return _0x377a3f?{'count':_0xa60c0d,'rows':_0x377a3f}:null;}})[_0xe64e('0x26')](respondWithResult(_0x54646b,null))['catch'](handleError(_0x54646b,null));};exports['getDescriptions']=function(_0x642bdc,_0x3a3789,_0x4b4e3a){var _0x5d43a7={};var _0x5df3e9={};var _0x18bfaa;var _0xe4b088;return db['Dynamics365Configuration'][_0xe64e('0x49')]({'where':{'id':_0x642bdc['params']['id']}})[_0xe64e('0x26')](handleEntityNotFound(_0x3a3789,null))['then'](function(_0x3fd6b0){if(_0x3fd6b0){_0x18bfaa=_0x3fd6b0;_0x5df3e9['model']=_['keys'](db[_0xe64e('0x4a')][_0xe64e('0x2c')]);_0x5df3e9['query']=_[_0xe64e('0x31')](_0x642bdc['query']);_0x5df3e9[_0xe64e('0x3a')]=_['intersection'](_0x5df3e9['model'],_0x5df3e9[_0xe64e('0x30')]);_0x5d43a7[_0xe64e('0x34')]=_[_0xe64e('0x32')](_0x5df3e9[_0xe64e('0x33')],qs['fields'](_0x642bdc['query']['fields']));_0x5d43a7[_0xe64e('0x34')]=_0x5d43a7['attributes'][_0xe64e('0x43')]?_0x5d43a7[_0xe64e('0x34')]:_0x5df3e9[_0xe64e('0x33')];_0x5d43a7[_0xe64e('0x4b')]=qs[_0xe64e('0x38')](_0x642bdc[_0xe64e('0x30')]['sort']);_0x5d43a7[_0xe64e('0x39')]=qs[_0xe64e('0x3a')](_[_0xe64e('0x3b')](_0x642bdc['query'],_0x5df3e9['filters']));if(_0x642bdc[_0xe64e('0x30')]['filter']){_0x5d43a7[_0xe64e('0x39')]=_[_0xe64e('0x3c')](_0x5d43a7['where'],{'$or':_[_0xe64e('0x2f')](_0x5d43a7['attributes'],function(_0x1c284d){var _0x1d20c5={};_0x1d20c5[_0x1c284d]={'$like':'%'+_0x642bdc[_0xe64e('0x30')][_0xe64e('0x4e')]+'%'};return _0x1d20c5;})});}_0x5d43a7=_[_0xe64e('0x3c')]({},_0x5d43a7,_0x642bdc[_0xe64e('0x3e')]);return _0x18bfaa[_0xe64e('0x4f')](_0x5d43a7);}})['then'](function(_0x4e5dfa){if(_0x4e5dfa){_0xe4b088=_0x4e5dfa[_0xe64e('0x43')];if(!_0x642bdc[_0xe64e('0x30')][_0xe64e('0x36')](_0xe64e('0x37'))){_0x5d43a7[_0xe64e('0x1c')]=qs[_0xe64e('0x1c')](_0x642bdc[_0xe64e('0x30')][_0xe64e('0x1c')]);_0x5d43a7[_0xe64e('0x1e')]=qs[_0xe64e('0x1e')](_0x642bdc[_0xe64e('0x30')][_0xe64e('0x1e')]);}return _0x18bfaa[_0xe64e('0x4f')](_0x5d43a7);}})[_0xe64e('0x26')](function(_0xb57efb){if(_0xb57efb){return _0xb57efb?{'count':_0xe4b088,'rows':_0xb57efb}:null;}})[_0xe64e('0x26')](respondWithResult(_0x3a3789,null))['catch'](handleError(_0x3a3789,null));}; \ No newline at end of file +var _0xb929=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','save','then','destroy','error','stack','name','send','map','Dynamics365Configuration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','update','getFields','order','pick','filter','hasOwnProperty','nolimit','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js'];(function(_0x2a16f4,_0x781a14){var _0x56defb=function(_0x34c4ce){while(--_0x34c4ce){_0x2a16f4['push'](_0x2a16f4['shift']());}};_0x56defb(++_0x781a14);}(_0xb929,0x182));var _0x9b92=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb929[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9b92('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b92('0x1'));var jsonpatch=require(_0x9b92('0x2'));var rp=require(_0x9b92('0x3'));var moment=require(_0x9b92('0x4'));var BPromise=require(_0x9b92('0x5'));var Mustache=require(_0x9b92('0x6'));var util=require(_0x9b92('0x7'));var path=require(_0x9b92('0x8'));var sox=require('sox');var csv=require(_0x9b92('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b92('0xa'));var _=require(_0x9b92('0xb'));var squel=require('squel');var crypto=require(_0x9b92('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b92('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b92('0xe'));var Redis=require(_0x9b92('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9b92('0x10'));var as=require(_0x9b92('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b92('0x12'))(_0x9b92('0x13'));var utils=require(_0x9b92('0x14'));var config=require(_0x9b92('0x15'));var licenseUtil=require(_0x9b92('0x16'));var db=require(_0x9b92('0x17'))['db'];function respondWithStatusCode(_0x2a881a,_0x187797){_0x187797=_0x187797||0xcc;return function(_0x46c862){if(_0x46c862){return _0x2a881a[_0x9b92('0x18')](_0x187797);}return _0x2a881a['status'](_0x187797)[_0x9b92('0x19')]();};}function respondWithResult(_0x339d63,_0x2df129){_0x2df129=_0x2df129||0xc8;return function(_0x3420a8){if(_0x3420a8){return _0x339d63[_0x9b92('0x1a')](_0x2df129)[_0x9b92('0x1b')](_0x3420a8);}};}function respondWithFilteredResult(_0x142c4f,_0x4e6f51){return function(_0x714e63){if(_0x714e63){var _0x2f93d1=typeof _0x4e6f51['offset']===_0x9b92('0x1c')&&typeof _0x4e6f51['limit']==='undefined';var _0x54ba0b=_0x714e63[_0x9b92('0x1d')];var _0x4b940c=_0x2f93d1?0x0:_0x4e6f51[_0x9b92('0x1e')];var _0x2f048a=_0x2f93d1?_0x714e63[_0x9b92('0x1d')]:_0x4e6f51['offset']+_0x4e6f51[_0x9b92('0x1f')];var _0x227569;if(_0x2f048a>=_0x54ba0b){_0x2f048a=_0x54ba0b;_0x227569=0xc8;}else{_0x227569=0xce;}_0x142c4f['status'](_0x227569);return _0x142c4f[_0x9b92('0x20')]('Content-Range',_0x4b940c+'-'+_0x2f048a+'/'+_0x54ba0b)[_0x9b92('0x1b')](_0x714e63);}return null;};}function patchUpdates(_0x433829){return function(_0x39cc2d){try{jsonpatch['apply'](_0x39cc2d,_0x433829,!![]);}catch(_0x4ecdf6){return BPromise['reject'](_0x4ecdf6);}return _0x39cc2d[_0x9b92('0x21')]();};}function saveUpdates(_0x5e7be1,_0xf805a3){return function(_0x1eebd1){if(_0x1eebd1){return _0x1eebd1['update'](_0x5e7be1)[_0x9b92('0x22')](function(_0x26d5e8){return _0x26d5e8;});}return null;};}function removeEntity(_0x4bb49b,_0x5310fb){return function(_0x176854){if(_0x176854){return _0x176854[_0x9b92('0x23')]()[_0x9b92('0x22')](function(){_0x4bb49b[_0x9b92('0x1a')](0xcc)[_0x9b92('0x19')]();});}};}function handleEntityNotFound(_0x1aaab9,_0x26f603){return function(_0x2464c7){if(!_0x2464c7){_0x1aaab9[_0x9b92('0x18')](0x194);}return _0x2464c7;};}function handleError(_0x13c203,_0x3f865f){_0x3f865f=_0x3f865f||0x1f4;return function(_0x3f30f6){logger[_0x9b92('0x24')](_0x3f30f6[_0x9b92('0x25')]);if(_0x3f30f6['name']){delete _0x3f30f6[_0x9b92('0x26')];}_0x13c203[_0x9b92('0x1a')](_0x3f865f)[_0x9b92('0x27')](_0x3f30f6);};}exports['index']=function(_0x2b9e63,_0x2ec3bf){var _0x353b3c={},_0x137e72={},_0x40233c={'count':0x0,'rows':[]};var _0x3b6c1=_[_0x9b92('0x28')](db[_0x9b92('0x29')]['rawAttributes'],function(_0x4056d3){return{'name':_0x4056d3[_0x9b92('0x2a')],'type':_0x4056d3[_0x9b92('0x2b')][_0x9b92('0x2c')]};});_0x137e72[_0x9b92('0x2d')]=_['map'](_0x3b6c1,_0x9b92('0x26'));_0x137e72['query']=_['keys'](_0x2b9e63[_0x9b92('0x2e')]);_0x137e72[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x137e72['model'],_0x137e72[_0x9b92('0x2e')]);_0x353b3c[_0x9b92('0x31')]=_[_0x9b92('0x30')](_0x137e72[_0x9b92('0x2d')],qs['fields'](_0x2b9e63['query'][_0x9b92('0x32')]));_0x353b3c['attributes']=_0x353b3c[_0x9b92('0x31')][_0x9b92('0x33')]?_0x353b3c[_0x9b92('0x31')]:_0x137e72[_0x9b92('0x2d')];if(!_0x2b9e63[_0x9b92('0x2e')]['hasOwnProperty']('nolimit')){_0x353b3c[_0x9b92('0x1f')]=qs[_0x9b92('0x1f')](_0x2b9e63[_0x9b92('0x2e')]['limit']);_0x353b3c[_0x9b92('0x1e')]=qs[_0x9b92('0x1e')](_0x2b9e63[_0x9b92('0x2e')]['offset']);}_0x353b3c['order']=qs[_0x9b92('0x34')](_0x2b9e63[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x353b3c[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_['pick'](_0x2b9e63['query'],_0x137e72[_0x9b92('0x2f')]),_0x3b6c1);if(_0x2b9e63[_0x9b92('0x2e')]['filter']){_0x353b3c[_0x9b92('0x35')]=_['merge'](_0x353b3c['where'],{'$or':_[_0x9b92('0x28')](_0x3b6c1,function(_0x5eaaa1){if(_0x5eaaa1[_0x9b92('0x2b')]!==_0x9b92('0x36')){var _0xd7859c={};_0xd7859c[_0x5eaaa1['name']]={'$like':'%'+_0x2b9e63[_0x9b92('0x2e')]['filter']+'%'};return _0xd7859c;}})});}_0x353b3c=_[_0x9b92('0x37')]({},_0x353b3c,_0x2b9e63[_0x9b92('0x38')]);var _0x274b1={'where':_0x353b3c['where']};return db[_0x9b92('0x29')]['count'](_0x274b1)[_0x9b92('0x22')](function(_0x334b5e){_0x40233c[_0x9b92('0x1d')]=_0x334b5e;if(_0x2b9e63[_0x9b92('0x2e')][_0x9b92('0x39')]){_0x353b3c[_0x9b92('0x3a')]=[{'all':!![]}];}return db[_0x9b92('0x29')][_0x9b92('0x3b')](_0x353b3c);})['then'](function(_0x1ebbc9){_0x40233c[_0x9b92('0x3c')]=_0x1ebbc9;return _0x40233c;})[_0x9b92('0x22')](respondWithFilteredResult(_0x2ec3bf,_0x353b3c))[_0x9b92('0x3d')](handleError(_0x2ec3bf,null));};exports[_0x9b92('0x3e')]=function(_0x20a5f1,_0x174b59){var _0x498199={'raw':![],'where':{'id':_0x20a5f1[_0x9b92('0x3f')]['id']}},_0x2137c5={};_0x2137c5[_0x9b92('0x2d')]=_['keys'](db[_0x9b92('0x29')][_0x9b92('0x40')]);_0x2137c5['query']=_[_0x9b92('0x41')](_0x20a5f1[_0x9b92('0x2e')]);_0x2137c5[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x2137c5[_0x9b92('0x2d')],_0x2137c5['query']);_0x498199[_0x9b92('0x31')]=_[_0x9b92('0x30')](_0x2137c5[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x20a5f1[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x498199[_0x9b92('0x31')]=_0x498199[_0x9b92('0x31')][_0x9b92('0x33')]?_0x498199['attributes']:_0x2137c5['model'];if(_0x20a5f1['query'][_0x9b92('0x39')]){_0x498199['include']=[{'all':!![]}];}_0x498199=_[_0x9b92('0x37')]({},_0x498199,_0x20a5f1[_0x9b92('0x38')]);return db[_0x9b92('0x29')][_0x9b92('0x42')](_0x498199)[_0x9b92('0x22')](handleEntityNotFound(_0x174b59,null))['then'](respondWithResult(_0x174b59,null))[_0x9b92('0x3d')](handleError(_0x174b59,null));};exports[_0x9b92('0x43')]=function(_0x5281ae,_0x12f1b6){return db[_0x9b92('0x29')][_0x9b92('0x43')](_0x5281ae[_0x9b92('0x44')],{})['then'](respondWithResult(_0x12f1b6,0xc9))['catch'](handleError(_0x12f1b6,null));};exports[_0x9b92('0x45')]=function(_0x233ef2,_0x1fb16e){if(_0x233ef2['body']['id']){delete _0x233ef2[_0x9b92('0x44')]['id'];}return db[_0x9b92('0x29')]['find']({'where':{'id':_0x233ef2[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x1fb16e,null))[_0x9b92('0x22')](saveUpdates(_0x233ef2[_0x9b92('0x44')],null))[_0x9b92('0x22')](respondWithResult(_0x1fb16e,null))[_0x9b92('0x3d')](handleError(_0x1fb16e,null));};exports[_0x9b92('0x23')]=function(_0x247b18,_0x53da91){return db['Dynamics365Configuration'][_0x9b92('0x42')]({'where':{'id':_0x247b18['params']['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x53da91,null))[_0x9b92('0x22')](removeEntity(_0x53da91,null))['catch'](handleError(_0x53da91,null));};exports[_0x9b92('0x46')]=function(_0x394e24,_0x24de96,_0x735f9d){var _0x3adb32={};var _0x9c786f={};var _0x4cd4c6;var _0x492e5d;return db[_0x9b92('0x29')]['findOne']({'where':{'id':_0x394e24[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x24de96,null))['then'](function(_0x30120f){if(_0x30120f){_0x4cd4c6=_0x30120f;_0x9c786f['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x9c786f['query']=_[_0x9b92('0x41')](_0x394e24['query']);_0x9c786f[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x9c786f[_0x9b92('0x2d')],_0x9c786f[_0x9b92('0x2e')]);_0x3adb32['attributes']=_[_0x9b92('0x30')](_0x9c786f[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x3adb32[_0x9b92('0x31')]=_0x3adb32[_0x9b92('0x31')][_0x9b92('0x33')]?_0x3adb32[_0x9b92('0x31')]:_0x9c786f['model'];_0x3adb32[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x3adb32[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x394e24['query'],_0x9c786f[_0x9b92('0x2f')]));if(_0x394e24[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x3adb32['where']=_[_0x9b92('0x37')](_0x3adb32[_0x9b92('0x35')],{'$or':_[_0x9b92('0x28')](_0x3adb32[_0x9b92('0x31')],function(_0xa391a8){var _0x5ac88e={};_0x5ac88e[_0xa391a8]={'$like':'%'+_0x394e24[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x5ac88e;})});}_0x3adb32=_[_0x9b92('0x37')]({},_0x3adb32,_0x394e24[_0x9b92('0x38')]);return _0x4cd4c6[_0x9b92('0x46')](_0x3adb32);}})[_0x9b92('0x22')](function(_0x39d96d){if(_0x39d96d){_0x492e5d=_0x39d96d[_0x9b92('0x33')];if(!_0x394e24[_0x9b92('0x2e')][_0x9b92('0x4a')](_0x9b92('0x4b'))){_0x3adb32['limit']=qs[_0x9b92('0x1f')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x1f')]);_0x3adb32[_0x9b92('0x1e')]=qs['offset'](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x4cd4c6['getFields'](_0x3adb32);}})[_0x9b92('0x22')](function(_0x37817d){if(_0x37817d){return _0x37817d?{'count':_0x492e5d,'rows':_0x37817d}:null;}})[_0x9b92('0x22')](respondWithResult(_0x24de96,null))[_0x9b92('0x3d')](handleError(_0x24de96,null));};exports[_0x9b92('0x4c')]=function(_0x388015,_0x1e8a3a,_0x3f0f72){var _0x2fdbab={};var _0x4fdd2e={};var _0x4557b;var _0x2e74ff;return db['Dynamics365Configuration'][_0x9b92('0x4d')]({'where':{'id':_0x388015[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x1e8a3a,null))[_0x9b92('0x22')](function(_0x523cff){if(_0x523cff){_0x4557b=_0x523cff;_0x4fdd2e[_0x9b92('0x2d')]=_[_0x9b92('0x41')](db[_0x9b92('0x4e')]['rawAttributes']);_0x4fdd2e[_0x9b92('0x2e')]=_[_0x9b92('0x41')](_0x388015['query']);_0x4fdd2e[_0x9b92('0x2f')]=_['intersection'](_0x4fdd2e['model'],_0x4fdd2e['query']);_0x2fdbab[_0x9b92('0x31')]=_['intersection'](_0x4fdd2e[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x388015['query']['fields']));_0x2fdbab[_0x9b92('0x31')]=_0x2fdbab[_0x9b92('0x31')][_0x9b92('0x33')]?_0x2fdbab[_0x9b92('0x31')]:_0x4fdd2e[_0x9b92('0x2d')];_0x2fdbab[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x388015[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x2fdbab[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x388015[_0x9b92('0x2e')],_0x4fdd2e['filters']));if(_0x388015[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x2fdbab['where']=_['merge'](_0x2fdbab[_0x9b92('0x35')],{'$or':_[_0x9b92('0x28')](_0x2fdbab['attributes'],function(_0x431fde){var _0x103617={};_0x103617[_0x431fde]={'$like':'%'+_0x388015[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x103617;})});}_0x2fdbab=_[_0x9b92('0x37')]({},_0x2fdbab,_0x388015[_0x9b92('0x38')]);return _0x4557b[_0x9b92('0x4c')](_0x2fdbab);}})[_0x9b92('0x22')](function(_0x218a14){if(_0x218a14){_0x2e74ff=_0x218a14[_0x9b92('0x33')];if(!_0x388015['query']['hasOwnProperty'](_0x9b92('0x4b'))){_0x2fdbab[_0x9b92('0x1f')]=qs[_0x9b92('0x1f')](_0x388015[_0x9b92('0x2e')]['limit']);_0x2fdbab['offset']=qs[_0x9b92('0x1e')](_0x388015[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x4557b[_0x9b92('0x4c')](_0x2fdbab);}})[_0x9b92('0x22')](function(_0x3b0137){if(_0x3b0137){return _0x3b0137?{'count':_0x2e74ff,'rows':_0x3b0137}:null;}})[_0x9b92('0x22')](respondWithResult(_0x1e8a3a,null))[_0x9b92('0x3d')](handleError(_0x1e8a3a,null));};exports[_0x9b92('0x4f')]=function(_0x36b524,_0x2af820,_0x4367fa){var _0x19f87e={};var _0x3e581c={};var _0x21f743;var _0x5ae0c2;return db[_0x9b92('0x29')][_0x9b92('0x4d')]({'where':{'id':_0x36b524[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x2af820,null))[_0x9b92('0x22')](function(_0x263bc4){if(_0x263bc4){_0x21f743=_0x263bc4;_0x3e581c[_0x9b92('0x2d')]=_['keys'](db['Dynamics365Field'][_0x9b92('0x40')]);_0x3e581c[_0x9b92('0x2e')]=_['keys'](_0x36b524['query']);_0x3e581c[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x3e581c[_0x9b92('0x2d')],_0x3e581c[_0x9b92('0x2e')]);_0x19f87e['attributes']=_[_0x9b92('0x30')](_0x3e581c[_0x9b92('0x2d')],qs['fields'](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x19f87e[_0x9b92('0x31')]=_0x19f87e[_0x9b92('0x31')][_0x9b92('0x33')]?_0x19f87e[_0x9b92('0x31')]:_0x3e581c[_0x9b92('0x2d')];_0x19f87e[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x19f87e[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x36b524[_0x9b92('0x2e')],_0x3e581c[_0x9b92('0x2f')]));if(_0x36b524[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x19f87e[_0x9b92('0x35')]=_['merge'](_0x19f87e['where'],{'$or':_[_0x9b92('0x28')](_0x19f87e[_0x9b92('0x31')],function(_0x3e30d5){var _0x42ff23={};_0x42ff23[_0x3e30d5]={'$like':'%'+_0x36b524[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x42ff23;})});}_0x19f87e=_[_0x9b92('0x37')]({},_0x19f87e,_0x36b524[_0x9b92('0x38')]);return _0x21f743[_0x9b92('0x4f')](_0x19f87e);}})['then'](function(_0xef5005){if(_0xef5005){_0x5ae0c2=_0xef5005['length'];if(!_0x36b524['query'][_0x9b92('0x4a')](_0x9b92('0x4b'))){_0x19f87e[_0x9b92('0x1f')]=qs['limit'](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x1f')]);_0x19f87e[_0x9b92('0x1e')]=qs[_0x9b92('0x1e')](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x21f743[_0x9b92('0x4f')](_0x19f87e);}})['then'](function(_0x2a1c90){if(_0x2a1c90){return _0x2a1c90?{'count':_0x5ae0c2,'rows':_0x2a1c90}:null;}})[_0x9b92('0x22')](respondWithResult(_0x2af820,null))[_0x9b92('0x3d')](handleError(_0x2af820,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d2a9176..3ed469b 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x1e05aa,_0x400710){var _0x4b700f=function(_0x2af307){while(--_0x2af307){_0x1e05aa['push'](_0x1e05aa['shift']());}};_0x4b700f(++_0x400710);}(_0xaa88,0x137));var _0x8aa8=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xaa88[_0x1b5aea];return _0x15cfc6;};'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 +var _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x59c30a,_0x3f9fc5){var _0x1355bf=function(_0x3e79c6){while(--_0x3e79c6){_0x59c30a['push'](_0x59c30a['shift']());}};_0x1355bf(++_0x3f9fc5);}(_0x34e8,0x12c));var _0x834e=function(_0x76ec5,_0x2b097e){_0x76ec5=_0x76ec5-0x0;var _0x282076=_0x34e8[_0x76ec5];return _0x282076;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 3587a02..b016352 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 _0x6792=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6792,0x168));var _0x2679=function(_0x5ae1b1,_0x27ef0c){_0x5ae1b1=_0x5ae1b1-0x0;var _0x4e40ae=_0x6792[_0x5ae1b1];return _0x4e40ae;};'use strict';var _=require(_0x2679('0x0'));var util=require(_0x2679('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2679('0x2'));var fs=require('fs');var Redis=require(_0x2679('0x3'));var db=require(_0x2679('0x4'))['db'];var utils=require(_0x2679('0x5'));var logger=require(_0x2679('0x6'))(_0x2679('0x7'));var config=require(_0x2679('0x8'));var jayson=require(_0x2679('0x9'));var client=jayson[_0x2679('0xa')][_0x2679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x317c58,_0xafaa8e,_0x1122c4){return new BPromise(function(_0x39b56a,_0x5a5818){return client[_0x2679('0xc')](_0x317c58,_0x1122c4)[_0x2679('0xd')](function(_0x5b5f49){logger[_0x2679('0xe')](_0x2679('0xf'),_0xafaa8e,_0x2679('0x10'));logger['debug'](_0x2679('0x11'),_0xafaa8e,'request\x20sent',JSON[_0x2679('0x12')](_0x5b5f49));if(_0x5b5f49[_0x2679('0x13')]){if(_0x5b5f49[_0x2679('0x13')][_0x2679('0x14')]===0x1f4){logger[_0x2679('0x13')](_0x2679('0xf'),_0xafaa8e,_0x5b5f49[_0x2679('0x13')][_0x2679('0x15')]);return _0x5a5818(_0x5b5f49[_0x2679('0x13')]['message']);}logger[_0x2679('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0xafaa8e,_0x5b5f49[_0x2679('0x13')][_0x2679('0x15')]);return _0x39b56a(_0x5b5f49[_0x2679('0x13')][_0x2679('0x15')]);}else{logger[_0x2679('0xe')](_0x2679('0xf'),_0xafaa8e,_0x2679('0x10'));_0x39b56a(_0x5b5f49[_0x2679('0x16')][_0x2679('0x15')]);}})['catch'](function(_0x27b848){logger[_0x2679('0x13')](_0x2679('0xf'),_0xafaa8e,_0x27b848);_0x5a5818(_0x27b848);});});} \ No newline at end of file +var _0x5a38=['result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4f8ac5,_0x1f81b7){var _0x23b66c=function(_0x44d376){while(--_0x44d376){_0x4f8ac5['push'](_0x4f8ac5['shift']());}};_0x23b66c(++_0x1f81b7);}(_0x5a38,0x13d));var _0x85a3=function(_0x42508b,_0x693bd2){_0x42508b=_0x42508b-0x0;var _0x4739b6=_0x5a38[_0x42508b];return _0x4739b6;};'use strict';var _=require('lodash');var util=require(_0x85a3('0x0'));var moment=require(_0x85a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x85a3('0x2'));var fs=require('fs');var Redis=require(_0x85a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x85a3('0x4'));var logger=require('../../config/logger')(_0x85a3('0x5'));var config=require(_0x85a3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x85a3('0x7')][_0x85a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x520777,_0x1a7c91,_0x29bf55){return new BPromise(function(_0x1c6f67,_0x4f70d3){return client[_0x85a3('0x9')](_0x520777,_0x29bf55)[_0x85a3('0xa')](function(_0x4b9367){logger['info'](_0x85a3('0xb'),_0x1a7c91,_0x85a3('0xc'));logger[_0x85a3('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1a7c91,'request\x20sent',JSON[_0x85a3('0xe')](_0x4b9367));if(_0x4b9367[_0x85a3('0xf')]){if(_0x4b9367[_0x85a3('0xf')][_0x85a3('0x10')]===0x1f4){logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x4b9367['error'][_0x85a3('0x11')]);return _0x4f70d3(_0x4b9367[_0x85a3('0xf')][_0x85a3('0x11')]);}logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x4b9367[_0x85a3('0xf')]['message']);return _0x1c6f67(_0x4b9367['error'][_0x85a3('0x11')]);}else{logger[_0x85a3('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a7c91,'request\x20sent');_0x1c6f67(_0x4b9367[_0x85a3('0x13')][_0x85a3('0x11')]);}})[_0x85a3('0x14')](function(_0x5c7686){logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x5c7686);_0x4f70d3(_0x5c7686);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5b8a63e..ebbb774 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 _0x2bd3=['../../config/environment','get','isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24a72c,_0x484269){var _0x3e654f=function(_0x4199c7){while(--_0x4199c7){_0x24a72c['push'](_0x24a72c['shift']());}};_0x3e654f(++_0x484269);}(_0x2bd3,0x1ba));var _0x32bd=function(_0x472516,_0x507cad){_0x472516=_0x472516-0x0;var _0x3819c0=_0x2bd3[_0x472516];return _0x3819c0;};'use strict';var multer=require(_0x32bd('0x0'));var util=require('util');var path=require(_0x32bd('0x1'));var timeout=require(_0x32bd('0x2'));var express=require(_0x32bd('0x3'));var router=express[_0x32bd('0x4')]();var fs_extra=require(_0x32bd('0x5'));var auth=require(_0x32bd('0x6'));var interaction=require(_0x32bd('0x7'));var config=require(_0x32bd('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x32bd('0x9')]('/',auth[_0x32bd('0xa')](),controller[_0x32bd('0xb')]);router[_0x32bd('0x9')](_0x32bd('0xc'),auth[_0x32bd('0xa')](),controller[_0x32bd('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x32bd('0xc'),auth[_0x32bd('0xa')](),controller[_0x32bd('0xe')]);router[_0x32bd('0xf')](_0x32bd('0xc'),auth[_0x32bd('0xa')](),controller[_0x32bd('0x10')]);module[_0x32bd('0x11')]=router; \ No newline at end of file +var _0x8265=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3ab3ce,_0x5e3960){var _0x2021e1=function(_0x375b64){while(--_0x375b64){_0x3ab3ce['push'](_0x3ab3ce['shift']());}};_0x2021e1(++_0x5e3960);}(_0x8265,0x12d));var _0x5826=function(_0x26ac0f,_0x52fee1){_0x26ac0f=_0x26ac0f-0x0;var _0x5ab067=_0x8265[_0x26ac0f];return _0x5ab067;};'use strict';var multer=require(_0x5826('0x0'));var util=require(_0x5826('0x1'));var path=require(_0x5826('0x2'));var timeout=require(_0x5826('0x3'));var express=require(_0x5826('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5826('0x5'));var interaction=require(_0x5826('0x6'));var config=require(_0x5826('0x7'));var controller=require(_0x5826('0x8'));router[_0x5826('0x9')]('/',auth[_0x5826('0xa')](),controller['index']);router['get'](_0x5826('0xb'),auth['isAuthenticated'](),controller[_0x5826('0xc')]);router[_0x5826('0xd')]('/',auth[_0x5826('0xa')](),controller[_0x5826('0xe')]);router[_0x5826('0xf')]('/:id',auth[_0x5826('0xa')](),controller[_0x5826('0x10')]);router[_0x5826('0x11')](_0x5826('0xb'),auth['isAuthenticated'](),controller[_0x5826('0x12')]);module[_0x5826('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 54de539..9e6c22a 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 _0xb996=['picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x408472,_0xbea12e){var _0x14c7f7=function(_0x28195e){while(--_0x28195e){_0x408472['push'](_0x408472['shift']());}};_0x14c7f7(++_0xbea12e);}(_0xb996,0xa6));var _0x6b99=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb996[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x6b99('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b99('0x1')](_0x6b99('0x2'),'variable',_0x6b99('0x3'),_0x6b99('0x4'),_0x6b99('0x5')),'defaultValue':_0x6b99('0x2')},'content':{'type':Sequelize[_0x6b99('0x6')]},'key':{'type':Sequelize[_0x6b99('0x6')]},'keyType':{'type':Sequelize[_0x6b99('0x1')](_0x6b99('0x2'),_0x6b99('0x7'),_0x6b99('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6b99('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6b99('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b99('0x6')]}}; \ No newline at end of file +var _0xebb4=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist','string'];(function(_0x36c321,_0x13fcbe){var _0x2de6fb=function(_0x577be7){while(--_0x577be7){_0x36c321['push'](_0x36c321['shift']());}};_0x2de6fb(++_0x13fcbe);}(_0xebb4,0x186));var _0x4ebb=function(_0x178574,_0x3e6621){_0x178574=_0x178574-0x0;var _0x310389=_0xebb4[_0x178574];return _0x310389;};'use strict';var Sequelize=require(_0x4ebb('0x0'));module[_0x4ebb('0x1')]={'type':{'type':Sequelize[_0x4ebb('0x2')]('string','variable',_0x4ebb('0x3'),'keyValue',_0x4ebb('0x4')),'defaultValue':_0x4ebb('0x5')},'content':{'type':Sequelize[_0x4ebb('0x6')]},'key':{'type':Sequelize[_0x4ebb('0x6')]},'keyType':{'type':Sequelize[_0x4ebb('0x2')]('string',_0x4ebb('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x4ebb('0x6')]},'idField':{'type':Sequelize[_0x4ebb('0x6')]},'nameField':{'type':Sequelize[_0x4ebb('0x6')]},'customField':{'type':Sequelize[_0x4ebb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 2a6d0fa..3e98780 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 _0xb187=['name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack'];(function(_0x3e4abc,_0x529ca4){var _0x1eb45b=function(_0x1e231c){while(--_0x1e231c){_0x3e4abc['push'](_0x3e4abc['shift']());}};_0x1eb45b(++_0x529ca4);}(_0xb187,0x1c1));var _0x7b18=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb187[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b18('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b18('0x1'));var rp=require(_0x7b18('0x2'));var moment=require(_0x7b18('0x3'));var BPromise=require(_0x7b18('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7b18('0x5'));var sox=require('sox');var csv=require(_0x7b18('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b18('0x7'));var _=require(_0x7b18('0x8'));var squel=require('squel');var crypto=require(_0x7b18('0x9'));var jsforce=require(_0x7b18('0xa'));var deskjs=require(_0x7b18('0xb'));var toCsv=require(_0x7b18('0x6'));var querystring=require(_0x7b18('0xc'));var Papa=require(_0x7b18('0xd'));var Redis=require('ioredis');var authService=require(_0x7b18('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7b18('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b18('0x10'));var utils=require('../../config/utils');var config=require(_0x7b18('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b18('0x12'))['db'];function respondWithStatusCode(_0x3cf0f0,_0x5b16b5){_0x5b16b5=_0x5b16b5||0xcc;return function(_0x217665){if(_0x217665){return _0x3cf0f0[_0x7b18('0x13')](_0x5b16b5);}return _0x3cf0f0[_0x7b18('0x14')](_0x5b16b5)[_0x7b18('0x15')]();};}function respondWithResult(_0x14e2d5,_0x307753){_0x307753=_0x307753||0xc8;return function(_0x36450c){if(_0x36450c){return _0x14e2d5[_0x7b18('0x14')](_0x307753)[_0x7b18('0x16')](_0x36450c);}};}function respondWithFilteredResult(_0x16131a,_0x5b61d7){return function(_0x1b0fc0){if(_0x1b0fc0){var _0x4c2e17=typeof _0x5b61d7[_0x7b18('0x17')]===_0x7b18('0x18')&&typeof _0x5b61d7[_0x7b18('0x19')]===_0x7b18('0x18');var _0x31d34a=_0x1b0fc0[_0x7b18('0x1a')];var _0x5532ed=_0x4c2e17?0x0:_0x5b61d7[_0x7b18('0x17')];var _0x227d5c=_0x4c2e17?_0x1b0fc0[_0x7b18('0x1a')]:_0x5b61d7['offset']+_0x5b61d7['limit'];var _0x23acf0;if(_0x227d5c>=_0x31d34a){_0x227d5c=_0x31d34a;_0x23acf0=0xc8;}else{_0x23acf0=0xce;}_0x16131a[_0x7b18('0x14')](_0x23acf0);return _0x16131a[_0x7b18('0x1b')](_0x7b18('0x1c'),_0x5532ed+'-'+_0x227d5c+'/'+_0x31d34a)['json'](_0x1b0fc0);}return null;};}function patchUpdates(_0x38b1ae){return function(_0x3cfd97){try{jsonpatch[_0x7b18('0x1d')](_0x3cfd97,_0x38b1ae,!![]);}catch(_0x49ec21){return BPromise[_0x7b18('0x1e')](_0x49ec21);}return _0x3cfd97[_0x7b18('0x1f')]();};}function saveUpdates(_0x34b161,_0x2f06b0){return function(_0x2c759b){if(_0x2c759b){return _0x2c759b['update'](_0x34b161)[_0x7b18('0x20')](function(_0x726d0e){return _0x726d0e;});}return null;};}function removeEntity(_0x55e696,_0xde895){return function(_0x13e30f){if(_0x13e30f){return _0x13e30f['destroy']()[_0x7b18('0x20')](function(){_0x55e696[_0x7b18('0x14')](0xcc)[_0x7b18('0x15')]();});}};}function handleEntityNotFound(_0x5733b1,_0x4afced){return function(_0xe4f17a){if(!_0xe4f17a){_0x5733b1[_0x7b18('0x13')](0x194);}return _0xe4f17a;};}function handleError(_0x31bdde,_0x13cccc){_0x13cccc=_0x13cccc||0x1f4;return function(_0x54325a){logger['error'](_0x54325a[_0x7b18('0x21')]);if(_0x54325a[_0x7b18('0x22')]){delete _0x54325a['name'];}_0x31bdde[_0x7b18('0x14')](_0x13cccc)[_0x7b18('0x23')](_0x54325a);};}exports['index']=function(_0x44d164,_0x3e5578){var _0x91a64e={},_0x5bff9b={},_0x1acaa3={'count':0x0,'rows':[]};var _0x4b1722=_[_0x7b18('0x24')](db[_0x7b18('0x25')][_0x7b18('0x26')],function(_0x3943a4){return{'name':_0x3943a4[_0x7b18('0x27')],'type':_0x3943a4[_0x7b18('0x28')][_0x7b18('0x29')]};});_0x5bff9b[_0x7b18('0x2a')]=_['map'](_0x4b1722,_0x7b18('0x22'));_0x5bff9b[_0x7b18('0x2b')]=_[_0x7b18('0x2c')](_0x44d164[_0x7b18('0x2b')]);_0x5bff9b[_0x7b18('0x2d')]=_['intersection'](_0x5bff9b[_0x7b18('0x2a')],_0x5bff9b[_0x7b18('0x2b')]);_0x91a64e[_0x7b18('0x2e')]=_[_0x7b18('0x2f')](_0x5bff9b[_0x7b18('0x2a')],qs[_0x7b18('0x30')](_0x44d164['query']['fields']));_0x91a64e[_0x7b18('0x2e')]=_0x91a64e[_0x7b18('0x2e')]['length']?_0x91a64e[_0x7b18('0x2e')]:_0x5bff9b[_0x7b18('0x2a')];if(!_0x44d164[_0x7b18('0x2b')][_0x7b18('0x31')]('nolimit')){_0x91a64e['limit']=qs['limit'](_0x44d164['query'][_0x7b18('0x19')]);_0x91a64e['offset']=qs[_0x7b18('0x17')](_0x44d164['query'][_0x7b18('0x17')]);}_0x91a64e[_0x7b18('0x32')]=qs[_0x7b18('0x33')](_0x44d164[_0x7b18('0x2b')]['sort']);_0x91a64e['where']=qs[_0x7b18('0x2d')](_[_0x7b18('0x34')](_0x44d164[_0x7b18('0x2b')],_0x5bff9b[_0x7b18('0x2d')]),_0x4b1722);if(_0x44d164['query']['filter']){_0x91a64e[_0x7b18('0x35')]=_[_0x7b18('0x36')](_0x91a64e[_0x7b18('0x35')],{'$or':_[_0x7b18('0x24')](_0x4b1722,function(_0x5d46c6){if(_0x5d46c6['type']!==_0x7b18('0x37')){var _0x38c119={};_0x38c119[_0x5d46c6['name']]={'$like':'%'+_0x44d164['query']['filter']+'%'};return _0x38c119;}})});}_0x91a64e=_[_0x7b18('0x36')]({},_0x91a64e,_0x44d164['options']);var _0x4d2786={'where':_0x91a64e[_0x7b18('0x35')]};return db[_0x7b18('0x25')][_0x7b18('0x1a')](_0x4d2786)['then'](function(_0x459a7b){_0x1acaa3[_0x7b18('0x1a')]=_0x459a7b;if(_0x44d164['query'][_0x7b18('0x38')]){_0x91a64e[_0x7b18('0x39')]=[{'all':!![]}];}return db[_0x7b18('0x25')][_0x7b18('0x3a')](_0x91a64e);})[_0x7b18('0x20')](function(_0x17ace2){_0x1acaa3[_0x7b18('0x3b')]=_0x17ace2;return _0x1acaa3;})[_0x7b18('0x20')](respondWithFilteredResult(_0x3e5578,_0x91a64e))[_0x7b18('0x3c')](handleError(_0x3e5578,null));};exports[_0x7b18('0x3d')]=function(_0x366a30,_0x18e32f){var _0x21caad={'raw':!![],'where':{'id':_0x366a30[_0x7b18('0x3e')]['id']}},_0x4f7707={};_0x4f7707[_0x7b18('0x2a')]=_['keys'](db[_0x7b18('0x25')][_0x7b18('0x26')]);_0x4f7707[_0x7b18('0x2b')]=_['keys'](_0x366a30[_0x7b18('0x2b')]);_0x4f7707['filters']=_[_0x7b18('0x2f')](_0x4f7707[_0x7b18('0x2a')],_0x4f7707[_0x7b18('0x2b')]);_0x21caad['attributes']=_['intersection'](_0x4f7707[_0x7b18('0x2a')],qs['fields'](_0x366a30['query'][_0x7b18('0x30')]));_0x21caad[_0x7b18('0x2e')]=_0x21caad[_0x7b18('0x2e')][_0x7b18('0x3f')]?_0x21caad[_0x7b18('0x2e')]:_0x4f7707[_0x7b18('0x2a')];if(_0x366a30[_0x7b18('0x2b')][_0x7b18('0x38')]){_0x21caad[_0x7b18('0x39')]=[{'all':!![]}];}_0x21caad=_[_0x7b18('0x36')]({},_0x21caad,_0x366a30[_0x7b18('0x40')]);return db[_0x7b18('0x25')]['find'](_0x21caad)['then'](handleEntityNotFound(_0x18e32f,null))[_0x7b18('0x20')](respondWithResult(_0x18e32f,null))['catch'](handleError(_0x18e32f,null));};exports['create']=function(_0x362da3,_0x46038e){return db['Dynamics365Field'][_0x7b18('0x41')](_0x362da3['body'],{})[_0x7b18('0x20')](respondWithResult(_0x46038e,0xc9))[_0x7b18('0x3c')](handleError(_0x46038e,null));};exports['update']=function(_0xeb3db0,_0x2d6fa0){if(_0xeb3db0['body']['id']){delete _0xeb3db0[_0x7b18('0x42')]['id'];}return db[_0x7b18('0x25')][_0x7b18('0x43')]({'where':{'id':_0xeb3db0['params']['id']}})[_0x7b18('0x20')](handleEntityNotFound(_0x2d6fa0,null))['then'](saveUpdates(_0xeb3db0[_0x7b18('0x42')],null))[_0x7b18('0x20')](respondWithResult(_0x2d6fa0,null))[_0x7b18('0x3c')](handleError(_0x2d6fa0,null));};exports[_0x7b18('0x44')]=function(_0x3f7e88,_0x4127ab){return db[_0x7b18('0x25')]['find']({'where':{'id':_0x3f7e88[_0x7b18('0x3e')]['id']}})[_0x7b18('0x20')](handleEntityNotFound(_0x4127ab,null))['then'](removeEntity(_0x4127ab,null))[_0x7b18('0x3c')](handleError(_0x4127ab,null));}; \ No newline at end of file +var _0xa24f=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','show','params','options','find','catch'];(function(_0x3e2768,_0x5ac211){var _0x593a9e=function(_0x3e10aa){while(--_0x3e10aa){_0x3e2768['push'](_0x3e2768['shift']());}};_0x593a9e(++_0x5ac211);}(_0xa24f,0xd1));var _0xfa24=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0xa24f[_0x4d3187];return _0x107906;};'use strict';var emlformat=require(_0xfa24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa24('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa24('0x2'));var moment=require(_0xfa24('0x3'));var BPromise=require(_0xfa24('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa24('0x5'));var sox=require('sox');var csv=require(_0xfa24('0x6'));var ejs=require(_0xfa24('0x7'));var fs=require('fs');var fs_extra=require(_0xfa24('0x8'));var _=require(_0xfa24('0x9'));var squel=require(_0xfa24('0xa'));var crypto=require(_0xfa24('0xb'));var jsforce=require(_0xfa24('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa24('0x6'));var querystring=require(_0xfa24('0xd'));var Papa=require(_0xfa24('0xe'));var Redis=require(_0xfa24('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa24('0x10'));var hardwareService=require(_0xfa24('0x11'));var logger=require('../../config/logger')(_0xfa24('0x12'));var utils=require('../../config/utils');var config=require(_0xfa24('0x13'));var licenseUtil=require(_0xfa24('0x14'));var db=require(_0xfa24('0x15'))['db'];function respondWithStatusCode(_0x2dcb85,_0x465127){_0x465127=_0x465127||0xcc;return function(_0x57983f){if(_0x57983f){return _0x2dcb85[_0xfa24('0x16')](_0x465127);}return _0x2dcb85[_0xfa24('0x17')](_0x465127)[_0xfa24('0x18')]();};}function respondWithResult(_0x1319d1,_0x3b3b10){_0x3b3b10=_0x3b3b10||0xc8;return function(_0x4868d1){if(_0x4868d1){return _0x1319d1['status'](_0x3b3b10)[_0xfa24('0x19')](_0x4868d1);}};}function respondWithFilteredResult(_0x1b1975,_0x5067e3){return function(_0x1e4f24){if(_0x1e4f24){var _0x39ac95=typeof _0x5067e3[_0xfa24('0x1a')]==='undefined'&&typeof _0x5067e3[_0xfa24('0x1b')]===_0xfa24('0x1c');var _0x529ee2=_0x1e4f24[_0xfa24('0x1d')];var _0x4b13ac=_0x39ac95?0x0:_0x5067e3[_0xfa24('0x1a')];var _0x475afd=_0x39ac95?_0x1e4f24[_0xfa24('0x1d')]:_0x5067e3['offset']+_0x5067e3[_0xfa24('0x1b')];var _0x5a04db;if(_0x475afd>=_0x529ee2){_0x475afd=_0x529ee2;_0x5a04db=0xc8;}else{_0x5a04db=0xce;}_0x1b1975[_0xfa24('0x17')](_0x5a04db);return _0x1b1975[_0xfa24('0x1e')]('Content-Range',_0x4b13ac+'-'+_0x475afd+'/'+_0x529ee2)[_0xfa24('0x19')](_0x1e4f24);}return null;};}function patchUpdates(_0x4a6cf3){return function(_0x40b281){try{jsonpatch[_0xfa24('0x1f')](_0x40b281,_0x4a6cf3,!![]);}catch(_0x4afca2){return BPromise[_0xfa24('0x20')](_0x4afca2);}return _0x40b281[_0xfa24('0x21')]();};}function saveUpdates(_0x2eab06,_0x4653dc){return function(_0x542360){if(_0x542360){return _0x542360[_0xfa24('0x22')](_0x2eab06)[_0xfa24('0x23')](function(_0x2aa8c7){return _0x2aa8c7;});}return null;};}function removeEntity(_0x214e1a,_0x375dd0){return function(_0x12e536){if(_0x12e536){return _0x12e536[_0xfa24('0x24')]()[_0xfa24('0x23')](function(){_0x214e1a['status'](0xcc)[_0xfa24('0x18')]();});}};}function handleEntityNotFound(_0x573118,_0x2e3cf2){return function(_0x1f2cfd){if(!_0x1f2cfd){_0x573118[_0xfa24('0x16')](0x194);}return _0x1f2cfd;};}function handleError(_0x146228,_0x12a08c){_0x12a08c=_0x12a08c||0x1f4;return function(_0xcc8e85){logger[_0xfa24('0x25')](_0xcc8e85[_0xfa24('0x26')]);if(_0xcc8e85[_0xfa24('0x27')]){delete _0xcc8e85[_0xfa24('0x27')];}_0x146228[_0xfa24('0x17')](_0x12a08c)['send'](_0xcc8e85);};}exports['index']=function(_0x94b8f7,_0x24baed){var _0x424275={},_0x45bcc3={},_0x4d56b1={'count':0x0,'rows':[]};var _0x3ea610=_[_0xfa24('0x28')](db[_0xfa24('0x29')][_0xfa24('0x2a')],function(_0x5930e2){return{'name':_0x5930e2[_0xfa24('0x2b')],'type':_0x5930e2['type']['key']};});_0x45bcc3[_0xfa24('0x2c')]=_[_0xfa24('0x28')](_0x3ea610,_0xfa24('0x27'));_0x45bcc3['query']=_[_0xfa24('0x2d')](_0x94b8f7[_0xfa24('0x2e')]);_0x45bcc3['filters']=_[_0xfa24('0x2f')](_0x45bcc3[_0xfa24('0x2c')],_0x45bcc3[_0xfa24('0x2e')]);_0x424275[_0xfa24('0x30')]=_[_0xfa24('0x2f')](_0x45bcc3['model'],qs[_0xfa24('0x31')](_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x31')]));_0x424275['attributes']=_0x424275[_0xfa24('0x30')][_0xfa24('0x32')]?_0x424275[_0xfa24('0x30')]:_0x45bcc3[_0xfa24('0x2c')];if(!_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x33')](_0xfa24('0x34'))){_0x424275[_0xfa24('0x1b')]=qs['limit'](_0x94b8f7['query'][_0xfa24('0x1b')]);_0x424275[_0xfa24('0x1a')]=qs[_0xfa24('0x1a')](_0x94b8f7['query']['offset']);}_0x424275[_0xfa24('0x35')]=qs[_0xfa24('0x36')](_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x36')]);_0x424275['where']=qs[_0xfa24('0x37')](_[_0xfa24('0x38')](_0x94b8f7[_0xfa24('0x2e')],_0x45bcc3[_0xfa24('0x37')]),_0x3ea610);if(_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x39')]){_0x424275[_0xfa24('0x3a')]=_['merge'](_0x424275[_0xfa24('0x3a')],{'$or':_[_0xfa24('0x28')](_0x3ea610,function(_0x52cbe0){if(_0x52cbe0['type']!=='VIRTUAL'){var _0x813183={};_0x813183[_0x52cbe0[_0xfa24('0x27')]]={'$like':'%'+_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x39')]+'%'};return _0x813183;}})});}_0x424275=_[_0xfa24('0x3b')]({},_0x424275,_0x94b8f7['options']);var _0x505d5f={'where':_0x424275[_0xfa24('0x3a')]};return db[_0xfa24('0x29')][_0xfa24('0x1d')](_0x505d5f)[_0xfa24('0x23')](function(_0x47c8d4){_0x4d56b1[_0xfa24('0x1d')]=_0x47c8d4;if(_0x94b8f7['query'][_0xfa24('0x3c')]){_0x424275[_0xfa24('0x3d')]=[{'all':!![]}];}return db[_0xfa24('0x29')]['findAll'](_0x424275);})['then'](function(_0x4b76e5){_0x4d56b1['rows']=_0x4b76e5;return _0x4d56b1;})[_0xfa24('0x23')](respondWithFilteredResult(_0x24baed,_0x424275))['catch'](handleError(_0x24baed,null));};exports[_0xfa24('0x3e')]=function(_0x32da0b,_0x3182f1){var _0x6c4912={'raw':!![],'where':{'id':_0x32da0b[_0xfa24('0x3f')]['id']}},_0x2f6bb1={};_0x2f6bb1[_0xfa24('0x2c')]=_[_0xfa24('0x2d')](db[_0xfa24('0x29')]['rawAttributes']);_0x2f6bb1[_0xfa24('0x2e')]=_['keys'](_0x32da0b[_0xfa24('0x2e')]);_0x2f6bb1[_0xfa24('0x37')]=_[_0xfa24('0x2f')](_0x2f6bb1[_0xfa24('0x2c')],_0x2f6bb1[_0xfa24('0x2e')]);_0x6c4912[_0xfa24('0x30')]=_['intersection'](_0x2f6bb1[_0xfa24('0x2c')],qs[_0xfa24('0x31')](_0x32da0b['query'][_0xfa24('0x31')]));_0x6c4912[_0xfa24('0x30')]=_0x6c4912[_0xfa24('0x30')][_0xfa24('0x32')]?_0x6c4912[_0xfa24('0x30')]:_0x2f6bb1[_0xfa24('0x2c')];if(_0x32da0b[_0xfa24('0x2e')]['includeAll']){_0x6c4912[_0xfa24('0x3d')]=[{'all':!![]}];}_0x6c4912=_['merge']({},_0x6c4912,_0x32da0b[_0xfa24('0x40')]);return db[_0xfa24('0x29')][_0xfa24('0x41')](_0x6c4912)[_0xfa24('0x23')](handleEntityNotFound(_0x3182f1,null))[_0xfa24('0x23')](respondWithResult(_0x3182f1,null))[_0xfa24('0x42')](handleError(_0x3182f1,null));};exports[_0xfa24('0x43')]=function(_0x5c02a9,_0x3af97d){return db[_0xfa24('0x29')][_0xfa24('0x43')](_0x5c02a9[_0xfa24('0x44')],{})['then'](respondWithResult(_0x3af97d,0xc9))[_0xfa24('0x42')](handleError(_0x3af97d,null));};exports['update']=function(_0xfbcdd,_0x4f58d1){if(_0xfbcdd[_0xfa24('0x44')]['id']){delete _0xfbcdd[_0xfa24('0x44')]['id'];}return db[_0xfa24('0x29')][_0xfa24('0x41')]({'where':{'id':_0xfbcdd[_0xfa24('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f58d1,null))[_0xfa24('0x23')](saveUpdates(_0xfbcdd['body'],null))[_0xfa24('0x23')](respondWithResult(_0x4f58d1,null))[_0xfa24('0x42')](handleError(_0x4f58d1,null));};exports['destroy']=function(_0x56f47b,_0xd445e9){return db[_0xfa24('0x29')]['find']({'where':{'id':_0x56f47b[_0xfa24('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd445e9,null))[_0xfa24('0x23')](removeEntity(_0xd445e9,null))[_0xfa24('0x42')](handleError(_0xd445e9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0fa7ea9..8756b45 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 _0xbb67=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x5bbf5b,_0x14c997){var _0x284973=function(_0x110468){while(--_0x110468){_0x5bbf5b['push'](_0x5bbf5b['shift']());}};_0x284973(++_0x14c997);}(_0xbb67,0x10d));var _0x7bb6=function(_0x45f927,_0x374eef){_0x45f927=_0x45f927-0x0;var _0x127802=_0xbb67[_0x45f927];return _0x127802;};'use strict';var _=require(_0x7bb6('0x0'));var util=require(_0x7bb6('0x1'));var logger=require(_0x7bb6('0x2'))('api');var moment=require(_0x7bb6('0x3'));var BPromise=require(_0x7bb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7bb6('0x5'));var config=require('../../config/environment');var attributes=require(_0x7bb6('0x6'));module[_0x7bb6('0x7')]=function(_0x110a30,_0x4fd1fe){return _0x110a30[_0x7bb6('0x8')](_0x7bb6('0x9'),attributes,{'tableName':_0x7bb6('0xa'),'paranoid':![],'indexes':[{'name':_0x7bb6('0xb'),'fields':[_0x7bb6('0xc'),_0x7bb6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb423=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x4a3138,_0x41d5a5){var _0x1b189=function(_0x2b6cd1){while(--_0x2b6cd1){_0x4a3138['push'](_0x4a3138['shift']());}};_0x1b189(++_0x41d5a5);}(_0xb423,0xa8));var _0x3b42=function(_0x3379e5,_0x20a093){_0x3379e5=_0x3379e5-0x0;var _0x21164a=_0xb423[_0x3379e5];return _0x21164a;};'use strict';var _=require(_0x3b42('0x0'));var util=require(_0x3b42('0x1'));var logger=require(_0x3b42('0x2'))(_0x3b42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b42('0x4'));var fs=require('fs');var path=require(_0x3b42('0x5'));var rimraf=require(_0x3b42('0x6'));var config=require(_0x3b42('0x7'));var attributes=require(_0x3b42('0x8'));module['exports']=function(_0x5ba3f9,_0x20eee4){return _0x5ba3f9[_0x3b42('0x9')](_0x3b42('0xa'),attributes,{'tableName':_0x3b42('0xb'),'paranoid':![],'indexes':[{'name':_0x3b42('0xc'),'fields':[_0x3b42('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 91d8cae..11073ba 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 _0x1890=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','util','moment'];(function(_0x3ce598,_0xcd97a8){var _0x228a3b=function(_0x25a234){while(--_0x25a234){_0x3ce598['push'](_0x3ce598['shift']());}};_0x228a3b(++_0xcd97a8);}(_0x1890,0x16e));var _0x0189=function(_0x4aa1c2,_0x1cc6b9){_0x4aa1c2=_0x4aa1c2-0x0;var _0x3e372c=_0x1890[_0x4aa1c2];return _0x3e372c;};'use strict';var _=require('lodash');var util=require(_0x0189('0x0'));var moment=require(_0x0189('0x1'));var BPromise=require('bluebird');var rs=require(_0x0189('0x2'));var fs=require('fs');var Redis=require(_0x0189('0x3'));var db=require(_0x0189('0x4'))['db'];var utils=require(_0x0189('0x5'));var logger=require(_0x0189('0x6'))(_0x0189('0x7'));var config=require(_0x0189('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0189('0x9')][_0x0189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c96c,_0x1faa7f,_0x20f864){return new BPromise(function(_0x58c436,_0x18f9e4){return client[_0x0189('0xb')](_0x47c96c,_0x20f864)['then'](function(_0x1f833b){logger[_0x0189('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x1faa7f,_0x0189('0xd'));logger[_0x0189('0xe')](_0x0189('0xf'),_0x1faa7f,_0x0189('0xd'),JSON[_0x0189('0x10')](_0x1f833b));if(_0x1f833b[_0x0189('0x11')]){if(_0x1f833b[_0x0189('0x11')][_0x0189('0x12')]===0x1f4){logger[_0x0189('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1faa7f,_0x1f833b[_0x0189('0x11')]['message']);return _0x18f9e4(_0x1f833b[_0x0189('0x11')][_0x0189('0x13')]);}logger[_0x0189('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1faa7f,_0x1f833b['error'][_0x0189('0x13')]);return _0x58c436(_0x1f833b[_0x0189('0x11')]['message']);}else{logger[_0x0189('0xc')](_0x0189('0x14'),_0x1faa7f,'request\x20sent');_0x58c436(_0x1f833b[_0x0189('0x15')]['message']);}})[_0x0189('0x16')](function(_0x2eb213){logger[_0x0189('0x11')](_0x0189('0x14'),_0x1faa7f,_0x2eb213);_0x18f9e4(_0x2eb213);});});} \ No newline at end of file +var _0xc330=['http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0xc330,0xae));var _0x0c33=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc330[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0c33('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c33('0x1'));var fs=require('fs');var Redis=require(_0x0c33('0x2'));var db=require(_0x0c33('0x3'))['db'];var utils=require(_0x0c33('0x4'));var logger=require(_0x0c33('0x5'))(_0x0c33('0x6'));var config=require(_0x0c33('0x7'));var jayson=require(_0x0c33('0x8'));var client=jayson[_0x0c33('0x9')][_0x0c33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a19be,_0x420bfc,_0x20f06b){return new BPromise(function(_0x58c935,_0x324857){return client[_0x0c33('0xb')](_0x1a19be,_0x20f06b)['then'](function(_0x20fade){logger[_0x0c33('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x420bfc,_0x0c33('0xd'));logger[_0x0c33('0xe')](_0x0c33('0xf'),_0x420bfc,_0x0c33('0xd'),JSON[_0x0c33('0x10')](_0x20fade));if(_0x20fade[_0x0c33('0x11')]){if(_0x20fade[_0x0c33('0x11')][_0x0c33('0x12')]===0x1f4){logger[_0x0c33('0x11')](_0x0c33('0x13'),_0x420bfc,_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);return _0x324857(_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);}logger['error'](_0x0c33('0x13'),_0x420bfc,_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);return _0x58c935(_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);}else{logger[_0x0c33('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x420bfc,_0x0c33('0xd'));_0x58c935(_0x20fade[_0x0c33('0x15')]['message']);}})[_0x0c33('0x16')](function(_0x1f1d57){logger['error'](_0x0c33('0x13'),_0x420bfc,_0x1f1d57);_0x324857(_0x1f1d57);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index da0578b..da13fae 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 _0xbf7f=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','post'];(function(_0x42e4bc,_0x441683){var _0x50d8b4=function(_0xe65192){while(--_0xe65192){_0x42e4bc['push'](_0x42e4bc['shift']());}};_0x50d8b4(++_0x441683);}(_0xbf7f,0x1a5));var _0xfbf7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbf7f[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xfbf7('0x0'));var util=require(_0xfbf7('0x1'));var path=require(_0xfbf7('0x2'));var timeout=require(_0xfbf7('0x3'));var express=require(_0xfbf7('0x4'));var router=express[_0xfbf7('0x5')]();var fs_extra=require(_0xfbf7('0x6'));var auth=require(_0xfbf7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfbf7('0x8'));var controller=require(_0xfbf7('0x9'));router['get']('/',auth[_0xfbf7('0xa')](),controller[_0xfbf7('0xb')]);router['get'](_0xfbf7('0xc'),auth[_0xfbf7('0xa')](),controller['show']);router[_0xfbf7('0xd')](_0xfbf7('0xe'),auth[_0xfbf7('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xfbf7('0xf')]('/',auth[_0xfbf7('0xa')](),controller[_0xfbf7('0x10')]);router['post'](_0xfbf7('0xe'),auth[_0xfbf7('0xa')](),controller[_0xfbf7('0x11')]);router[_0xfbf7('0x12')](_0xfbf7('0xc'),auth['isAuthenticated'](),controller[_0xfbf7('0x13')]);router[_0xfbf7('0x14')](_0xfbf7('0xc'),auth[_0xfbf7('0xa')](),controller[_0xfbf7('0x15')]);module[_0xfbf7('0x16')]=router; \ No newline at end of file +var _0x0d0d=['./intFreshdeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','create','post','addConfiguration','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xabc49d,_0xef5bef){var _0x154be2=function(_0x382b94){while(--_0x382b94){_0xabc49d['push'](_0xabc49d['shift']());}};_0x154be2(++_0xef5bef);}(_0x0d0d,0x1d2));var _0xd0d0=function(_0x4c4311,_0xf75821){_0x4c4311=_0x4c4311-0x0;var _0x5bba6e=_0x0d0d[_0x4c4311];return _0x5bba6e;};'use strict';var multer=require(_0xd0d0('0x0'));var util=require('util');var path=require(_0xd0d0('0x1'));var timeout=require(_0xd0d0('0x2'));var express=require(_0xd0d0('0x3'));var router=express[_0xd0d0('0x4')]();var fs_extra=require(_0xd0d0('0x5'));var auth=require(_0xd0d0('0x6'));var interaction=require(_0xd0d0('0x7'));var config=require(_0xd0d0('0x8'));var controller=require(_0xd0d0('0x9'));router[_0xd0d0('0xa')]('/',auth['isAuthenticated'](),controller[_0xd0d0('0xb')]);router[_0xd0d0('0xa')](_0xd0d0('0xc'),auth['isAuthenticated'](),controller[_0xd0d0('0xd')]);router[_0xd0d0('0xa')](_0xd0d0('0xe'),auth['isAuthenticated'](),controller[_0xd0d0('0xf')]);router[_0xd0d0('0xa')](_0xd0d0('0x10'),auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x12')]);router['post']('/',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x13')]);router[_0xd0d0('0x14')]('/:id/configurations',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x15')]);router[_0xd0d0('0x16')]('/:id',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x17')]);router['delete'](_0xd0d0('0xc'),auth[_0xd0d0('0x11')](),controller['destroy']);module[_0xd0d0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 5c65292..03f0338 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 _0x77e6=['STRING','username','sequelize','exports'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x77e6,0x1a6));var _0x677e=function(_0x49d118,_0x5d7f21){_0x49d118=_0x49d118-0x0;var _0x52d7bf=_0x77e6[_0x49d118];return _0x52d7bf;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'apiKey':{'type':Sequelize[_0x677e('0x2')]},'remoteUri':{'type':Sequelize[_0x677e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x677e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4b17=['username','sequelize','STRING'];(function(_0x3e98c3,_0x598349){var _0x5d750c=function(_0x56610e){while(--_0x56610e){_0x3e98c3['push'](_0x3e98c3['shift']());}};_0x5d750c(++_0x598349);}(_0x4b17,0x10f));var _0x74b1=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x4b17[_0x3c2b2e];return _0x27a338;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 6dd0601..e416993 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 _0xe890=['save','update','destroy','then','end','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','getFields','remoteUri','apiKey','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x34acf7,_0x2a6be8){var _0x3cedd9=function(_0x1f8622){while(--_0x1f8622){_0x34acf7['push'](_0x34acf7['shift']());}};_0x3cedd9(++_0x2a6be8);}(_0xe890,0x1a6));var _0x0e89=function(_0x165398,_0x9b2ede){_0x165398=_0x165398-0x0;var _0x5d79f8=_0xe890[_0x165398];return _0x5d79f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0e89('0x0'));var jsonpatch=require(_0x0e89('0x1'));var rp=require(_0x0e89('0x2'));var moment=require(_0x0e89('0x3'));var BPromise=require(_0x0e89('0x4'));var Mustache=require(_0x0e89('0x5'));var util=require(_0x0e89('0x6'));var path=require(_0x0e89('0x7'));var sox=require(_0x0e89('0x8'));var csv=require(_0x0e89('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e89('0xa'));var squel=require(_0x0e89('0xb'));var crypto=require('crypto');var jsforce=require(_0x0e89('0xc'));var deskjs=require(_0x0e89('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e89('0xe'));var Papa=require(_0x0e89('0xf'));var Redis=require(_0x0e89('0x10'));var authService=require(_0x0e89('0x11'));var qs=require(_0x0e89('0x12'));var as=require(_0x0e89('0x13'));var hardwareService=require(_0x0e89('0x14'));var logger=require(_0x0e89('0x15'))(_0x0e89('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0e89('0x17'));function respondWithStatusCode(_0x43bf31,_0x3447cb){_0x3447cb=_0x3447cb||0xcc;return function(_0x4330a3){if(_0x4330a3){return _0x43bf31['sendStatus'](_0x3447cb);}return _0x43bf31['status'](_0x3447cb)['end']();};}function respondWithResult(_0x15cd84,_0x28b23c){_0x28b23c=_0x28b23c||0xc8;return function(_0x45cd03){if(_0x45cd03){return _0x15cd84[_0x0e89('0x18')](_0x28b23c)[_0x0e89('0x19')](_0x45cd03);}};}function respondWithFilteredResult(_0x211cad,_0x167c7b){return function(_0x45e31f){if(_0x45e31f){var _0x295be8=typeof _0x167c7b[_0x0e89('0x1a')]===_0x0e89('0x1b')&&typeof _0x167c7b[_0x0e89('0x1c')]===_0x0e89('0x1b');var _0x4493a3=_0x45e31f[_0x0e89('0x1d')];var _0x9cf6c4=_0x295be8?0x0:_0x167c7b[_0x0e89('0x1a')];var _0x40eb1d=_0x295be8?_0x45e31f[_0x0e89('0x1d')]:_0x167c7b[_0x0e89('0x1a')]+_0x167c7b[_0x0e89('0x1c')];var _0x56c12a;if(_0x40eb1d>=_0x4493a3){_0x40eb1d=_0x4493a3;_0x56c12a=0xc8;}else{_0x56c12a=0xce;}_0x211cad[_0x0e89('0x18')](_0x56c12a);return _0x211cad[_0x0e89('0x1e')](_0x0e89('0x1f'),_0x9cf6c4+'-'+_0x40eb1d+'/'+_0x4493a3)[_0x0e89('0x19')](_0x45e31f);}return null;};}function patchUpdates(_0x361291){return function(_0x35ac2a){try{jsonpatch[_0x0e89('0x20')](_0x35ac2a,_0x361291,!![]);}catch(_0x200469){return BPromise[_0x0e89('0x21')](_0x200469);}return _0x35ac2a[_0x0e89('0x22')]();};}function saveUpdates(_0x2c641d,_0x18dd88){return function(_0x4768d6){if(_0x4768d6){return _0x4768d6[_0x0e89('0x23')](_0x2c641d)['then'](function(_0x5e5463){return _0x5e5463;});}return null;};}function removeEntity(_0x59fffe,_0x1ad62c){return function(_0x8d02e2){if(_0x8d02e2){return _0x8d02e2[_0x0e89('0x24')]()[_0x0e89('0x25')](function(){_0x59fffe['status'](0xcc)[_0x0e89('0x26')]();});}};}function handleEntityNotFound(_0x2d6e9b,_0x3cf50c){return function(_0x4b6f00){if(!_0x4b6f00){_0x2d6e9b[_0x0e89('0x27')](0x194);}return _0x4b6f00;};}function handleError(_0x589ed1,_0x2a378a){_0x2a378a=_0x2a378a||0x1f4;return function(_0x30c0f4){logger[_0x0e89('0x28')](_0x30c0f4[_0x0e89('0x29')]);if(_0x30c0f4[_0x0e89('0x2a')]){delete _0x30c0f4[_0x0e89('0x2a')];}_0x589ed1[_0x0e89('0x18')](_0x2a378a)['send'](_0x30c0f4);};}exports[_0x0e89('0x2b')]=function(_0x14b857,_0xf1ebac){var _0x18cfb5={},_0x174ed9={},_0x7584db={'count':0x0,'rows':[]};var _0x502452=_[_0x0e89('0x2c')](db[_0x0e89('0x2d')][_0x0e89('0x2e')],function(_0x521587){return{'name':_0x521587[_0x0e89('0x2f')],'type':_0x521587[_0x0e89('0x30')][_0x0e89('0x31')]};});_0x174ed9[_0x0e89('0x32')]=_['map'](_0x502452,_0x0e89('0x2a'));_0x174ed9[_0x0e89('0x33')]=_[_0x0e89('0x34')](_0x14b857[_0x0e89('0x33')]);_0x174ed9['filters']=_[_0x0e89('0x35')](_0x174ed9[_0x0e89('0x32')],_0x174ed9[_0x0e89('0x33')]);_0x18cfb5[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x174ed9[_0x0e89('0x32')],qs[_0x0e89('0x37')](_0x14b857['query'][_0x0e89('0x37')]));_0x18cfb5[_0x0e89('0x36')]=_0x18cfb5[_0x0e89('0x36')][_0x0e89('0x38')]?_0x18cfb5[_0x0e89('0x36')]:_0x174ed9['model'];if(!_0x14b857[_0x0e89('0x33')][_0x0e89('0x39')](_0x0e89('0x3a'))){_0x18cfb5[_0x0e89('0x1c')]=qs[_0x0e89('0x1c')](_0x14b857['query'][_0x0e89('0x1c')]);_0x18cfb5[_0x0e89('0x1a')]=qs[_0x0e89('0x1a')](_0x14b857[_0x0e89('0x33')][_0x0e89('0x1a')]);}_0x18cfb5[_0x0e89('0x3b')]=qs[_0x0e89('0x3c')](_0x14b857[_0x0e89('0x33')]['sort']);_0x18cfb5['where']=qs['filters'](_[_0x0e89('0x3d')](_0x14b857[_0x0e89('0x33')],_0x174ed9[_0x0e89('0x3e')]),_0x502452);if(_0x14b857['query'][_0x0e89('0x3f')]){_0x18cfb5[_0x0e89('0x40')]=_[_0x0e89('0x41')](_0x18cfb5[_0x0e89('0x40')],{'$or':_[_0x0e89('0x2c')](_0x502452,function(_0x5984e2){if(_0x5984e2['type']!==_0x0e89('0x42')){var _0x280291={};_0x280291[_0x5984e2[_0x0e89('0x2a')]]={'$like':'%'+_0x14b857[_0x0e89('0x33')][_0x0e89('0x3f')]+'%'};return _0x280291;}})});}_0x18cfb5=_[_0x0e89('0x41')]({},_0x18cfb5,_0x14b857[_0x0e89('0x43')]);var _0x38692f={'where':_0x18cfb5[_0x0e89('0x40')]};return db[_0x0e89('0x2d')][_0x0e89('0x1d')](_0x38692f)[_0x0e89('0x25')](function(_0x1ed0f0){_0x7584db[_0x0e89('0x1d')]=_0x1ed0f0;if(_0x14b857[_0x0e89('0x33')][_0x0e89('0x44')]){_0x18cfb5[_0x0e89('0x45')]=[{'all':!![]}];}return db[_0x0e89('0x2d')][_0x0e89('0x46')](_0x18cfb5);})[_0x0e89('0x25')](function(_0x1f477a){_0x7584db[_0x0e89('0x47')]=_0x1f477a;return _0x7584db;})[_0x0e89('0x25')](respondWithFilteredResult(_0xf1ebac,_0x18cfb5))[_0x0e89('0x48')](handleError(_0xf1ebac,null));};exports[_0x0e89('0x49')]=function(_0x4cbd0a,_0x205898){var _0x399a2e={'raw':![],'where':{'id':_0x4cbd0a[_0x0e89('0x4a')]['id']}},_0x1d38b2={};_0x1d38b2[_0x0e89('0x32')]=_[_0x0e89('0x34')](db[_0x0e89('0x2d')][_0x0e89('0x2e')]);_0x1d38b2[_0x0e89('0x33')]=_[_0x0e89('0x34')](_0x4cbd0a[_0x0e89('0x33')]);_0x1d38b2[_0x0e89('0x3e')]=_[_0x0e89('0x35')](_0x1d38b2[_0x0e89('0x32')],_0x1d38b2[_0x0e89('0x33')]);_0x399a2e[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x1d38b2[_0x0e89('0x32')],qs[_0x0e89('0x37')](_0x4cbd0a[_0x0e89('0x33')][_0x0e89('0x37')]));_0x399a2e[_0x0e89('0x36')]=_0x399a2e[_0x0e89('0x36')][_0x0e89('0x38')]?_0x399a2e['attributes']:_0x1d38b2[_0x0e89('0x32')];if(_0x4cbd0a[_0x0e89('0x33')][_0x0e89('0x44')]){_0x399a2e[_0x0e89('0x45')]=[{'all':!![]}];}_0x399a2e=_[_0x0e89('0x41')]({},_0x399a2e,_0x4cbd0a[_0x0e89('0x43')]);return db['FreshdeskAccount'][_0x0e89('0x4b')](_0x399a2e)['then'](handleEntityNotFound(_0x205898,null))['then'](respondWithResult(_0x205898,null))['catch'](handleError(_0x205898,null));};exports[_0x0e89('0x4c')]=function(_0x2f2971,_0x313db9){return db['FreshdeskAccount']['create'](_0x2f2971[_0x0e89('0x4d')],{})['then'](respondWithResult(_0x313db9,0xc9))[_0x0e89('0x48')](handleError(_0x313db9,null));};exports['update']=function(_0x249431,_0x5d0b35){if(_0x249431['body']['id']){delete _0x249431[_0x0e89('0x4d')]['id'];}return db[_0x0e89('0x2d')]['find']({'where':{'id':_0x249431[_0x0e89('0x4a')]['id']}})[_0x0e89('0x25')](handleEntityNotFound(_0x5d0b35,null))[_0x0e89('0x25')](saveUpdates(_0x249431[_0x0e89('0x4d')],null))[_0x0e89('0x25')](respondWithResult(_0x5d0b35,null))[_0x0e89('0x48')](handleError(_0x5d0b35,null));};exports[_0x0e89('0x24')]=function(_0x24249a,_0x124241){return db[_0x0e89('0x2d')][_0x0e89('0x4b')]({'where':{'id':_0x24249a[_0x0e89('0x4a')]['id']}})['then'](handleEntityNotFound(_0x124241,null))[_0x0e89('0x25')](removeEntity(_0x124241,null))[_0x0e89('0x48')](handleError(_0x124241,null));};exports[_0x0e89('0x4e')]=function(_0x2c4752,_0x507ce3,_0x4feba5){var _0x54457a={};var _0x24134c={};var _0xf7dbee;var _0x25a9d9;return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x2c4752[_0x0e89('0x4a')]['id']}})['then'](handleEntityNotFound(_0x507ce3,null))[_0x0e89('0x25')](function(_0x2d31b2){if(_0x2d31b2){_0xf7dbee=_0x2d31b2;_0x24134c[_0x0e89('0x32')]=_[_0x0e89('0x34')](db['FreshdeskConfiguration'][_0x0e89('0x2e')]);_0x24134c[_0x0e89('0x33')]=_['keys'](_0x2c4752[_0x0e89('0x33')]);_0x24134c[_0x0e89('0x3e')]=_['intersection'](_0x24134c['model'],_0x24134c['query']);_0x54457a[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x24134c['model'],qs['fields'](_0x2c4752[_0x0e89('0x33')][_0x0e89('0x37')]));_0x54457a[_0x0e89('0x36')]=_0x54457a[_0x0e89('0x36')]['length']?_0x54457a[_0x0e89('0x36')]:_0x24134c[_0x0e89('0x32')];_0x54457a[_0x0e89('0x3b')]=qs[_0x0e89('0x3c')](_0x2c4752['query'][_0x0e89('0x3c')]);_0x54457a[_0x0e89('0x40')]=qs[_0x0e89('0x3e')](_['pick'](_0x2c4752[_0x0e89('0x33')],_0x24134c[_0x0e89('0x3e')]));if(_0x2c4752[_0x0e89('0x33')][_0x0e89('0x3f')]){_0x54457a['where']=_[_0x0e89('0x41')](_0x54457a[_0x0e89('0x40')],{'$or':_[_0x0e89('0x2c')](_0x54457a[_0x0e89('0x36')],function(_0x35c45f){var _0x31a8ff={};_0x31a8ff[_0x35c45f]={'$like':'%'+_0x2c4752[_0x0e89('0x33')]['filter']+'%'};return _0x31a8ff;})});}_0x54457a=_[_0x0e89('0x41')]({},_0x54457a,_0x2c4752[_0x0e89('0x43')]);return _0xf7dbee[_0x0e89('0x4e')](_0x54457a);}})[_0x0e89('0x25')](function(_0x2e1441){if(_0x2e1441){_0x25a9d9=_0x2e1441[_0x0e89('0x38')];if(!_0x2c4752[_0x0e89('0x33')][_0x0e89('0x39')](_0x0e89('0x3a'))){_0x54457a[_0x0e89('0x1c')]=qs[_0x0e89('0x1c')](_0x2c4752[_0x0e89('0x33')][_0x0e89('0x1c')]);_0x54457a['offset']=qs['offset'](_0x2c4752['query'][_0x0e89('0x1a')]);}return _0xf7dbee[_0x0e89('0x4e')](_0x54457a);}})[_0x0e89('0x25')](function(_0xf71b88){if(_0xf71b88){return _0xf71b88?{'count':_0x25a9d9,'rows':_0xf71b88}:null;}})['then'](respondWithResult(_0x507ce3,null))[_0x0e89('0x48')](handleError(_0x507ce3,null));};exports[_0x0e89('0x4f')]=function(_0x28f05b,_0x51c6a1,_0x31fb58){if(_0x28f05b[_0x0e89('0x4d')]['id']){delete _0x28f05b[_0x0e89('0x4d')]['id'];}return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x28f05b[_0x0e89('0x4a')]['id']}})[_0x0e89('0x25')](handleEntityNotFound(_0x51c6a1,null))[_0x0e89('0x25')](function(_0x40dd6d){if(_0x40dd6d){_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x50')]=_0x40dd6d['id'];_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x51')]=integrations[_0x0e89('0x52')](_0x28f05b[_0x0e89('0x4d')]['channel'],_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x30')]);_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x53')]=integrations[_0x0e89('0x54')](_0x28f05b['body'][_0x0e89('0x55')],_0x28f05b[_0x0e89('0x4d')]['type']);return db[_0x0e89('0x56')][_0x0e89('0x4c')](_0x28f05b['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x0e89('0x53')}]});}return null;})[_0x0e89('0x25')](respondWithResult(_0x51c6a1,null))['catch'](handleError(_0x51c6a1,null));};exports[_0x0e89('0x57')]=function(_0x411c03,_0x16a12e,_0x58adfa){var _0x21abda='';return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x411c03[_0x0e89('0x4a')]['id']},'attributes':['id',_0x0e89('0x58'),_0x0e89('0x59')]})[_0x0e89('0x25')](handleEntityNotFound(_0x16a12e,null))[_0x0e89('0x25')](function(_0x22a78f){if(_0x22a78f){_0x21abda=_0x22a78f[_0x0e89('0x58')];var _0x4dc7d3=_0x21abda['slice'](-0x1);if(_0x4dc7d3==='/'){_0x21abda=_0x21abda['substring'](0x0,_0x21abda['lastIndexOf'](_0x4dc7d3));}return rp({'method':'GET','uri':util[_0x0e89('0x5a')](_0x0e89('0x5b'),_0x21abda,_0x0e89('0x5c')),'headers':{'Authorization':util['format'](_0x0e89('0x5d'),new Buffer(util['format'](_0x0e89('0x5e'),_0x22a78f[_0x0e89('0x59')]))[_0x0e89('0x5f')](_0x0e89('0x60')))},'json':!![]});}})[_0x0e89('0x25')](function(_0x2fa558){if(_0x2fa558){var _0x152f8f=[_0x0e89('0x61'),_0x0e89('0x62'),_0x0e89('0x63'),_0x0e89('0x64'),_0x0e89('0x18'),'priority',_0x0e89('0x65'),_0x0e89('0x66'),_0x0e89('0x67'),_0x0e89('0x65'),_0x0e89('0x68')];_[_0x0e89('0x69')](_0x2fa558,function(_0x1b4ad6){return _0x152f8f[_0x0e89('0x6a')](_0x1b4ad6[_0x0e89('0x2a')])||!_0x1b4ad6[_0x0e89('0x6b')]&&_0x1b4ad6['type']!=='custom_text'&&_0x1b4ad6[_0x0e89('0x30')]!=='custom_dropdown';});return{'count':_0x2fa558[_0x0e89('0x38')],'rows':_[_0x0e89('0x2c')](_0x2fa558,function(_0x3adea7){return{'id':_0x3adea7[_0x0e89('0x2a')],'name':_0x3adea7['label'],'custom':!_0x3adea7[_0x0e89('0x6b')],'options':_0x3adea7[_0x0e89('0x6c')]?_[_0x0e89('0x2c')](_0x3adea7['choices'],function(_0xfaac03){return{'name':_[_0x0e89('0x6d')](_0xfaac03),'value':_0xfaac03};}):[]};})};}})[_0x0e89('0x25')](respondWithResult(_0x16a12e,null))[_0x0e89('0x48')](function(_0x2d42bc){var _0x3da749=_0x411c03[_0x0e89('0x33')][_0x0e89('0x6e')]?0x1f4:_0x2d42bc[_0x0e89('0x6f')]||0x1f4;logger['error'](_0x0e89('0x70'),_0x0e89('0x57'),_0x3da749,JSON[_0x0e89('0x71')](_0x2d42bc));delete _0x2d42bc[_0x0e89('0x2a')];if(_0x3da749===0x191){_0x3da749=0x190;}_0x16a12e[_0x0e89('0x18')](_0x3da749)['send'](_0x411c03[_0x0e89('0x33')][_0x0e89('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x2d42bc['statusCode']}:_0x2d42bc);});}; \ No newline at end of file +var _0xbefe=['remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','apiKey','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','capitalize','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','map','rawAttributes','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','filters','merge','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields'];(function(_0x26b45c,_0x53d6a6){var _0x2a0bca=function(_0x3723e3){while(--_0x3723e3){_0x26b45c['push'](_0x26b45c['shift']());}};_0x2a0bca(++_0x53d6a6);}(_0xbefe,0x168));var _0xebef=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0xbefe[_0x3396cd];return _0x2d6b4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];var integrations=require(_0xebef('0x1a'));function respondWithStatusCode(_0x566dbe,_0x584ac2){_0x584ac2=_0x584ac2||0xcc;return function(_0x5dd833){if(_0x5dd833){return _0x566dbe['sendStatus'](_0x584ac2);}return _0x566dbe[_0xebef('0x1b')](_0x584ac2)[_0xebef('0x1c')]();};}function respondWithResult(_0x31772a,_0x35cd7a){_0x35cd7a=_0x35cd7a||0xc8;return function(_0x2f53e5){if(_0x2f53e5){return _0x31772a[_0xebef('0x1b')](_0x35cd7a)['json'](_0x2f53e5);}};}function respondWithFilteredResult(_0x32ec37,_0x9411d4){return function(_0x1921aa){if(_0x1921aa){var _0x46849f=typeof _0x9411d4[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x9411d4[_0xebef('0x1f')]===_0xebef('0x1e');var _0x2e5efa=_0x1921aa[_0xebef('0x20')];var _0x458e83=_0x46849f?0x0:_0x9411d4['offset'];var _0x1a99ba=_0x46849f?_0x1921aa[_0xebef('0x20')]:_0x9411d4[_0xebef('0x1d')]+_0x9411d4['limit'];var _0xc3518f;if(_0x1a99ba>=_0x2e5efa){_0x1a99ba=_0x2e5efa;_0xc3518f=0xc8;}else{_0xc3518f=0xce;}_0x32ec37[_0xebef('0x1b')](_0xc3518f);return _0x32ec37[_0xebef('0x21')](_0xebef('0x22'),_0x458e83+'-'+_0x1a99ba+'/'+_0x2e5efa)[_0xebef('0x23')](_0x1921aa);}return null;};}function patchUpdates(_0x138760){return function(_0x2f72e3){try{jsonpatch['apply'](_0x2f72e3,_0x138760,!![]);}catch(_0x4dcc76){return BPromise['reject'](_0x4dcc76);}return _0x2f72e3[_0xebef('0x24')]();};}function saveUpdates(_0x2f1193,_0x38f0b8){return function(_0x221a7e){if(_0x221a7e){return _0x221a7e[_0xebef('0x25')](_0x2f1193)[_0xebef('0x26')](function(_0xe8dcbf){return _0xe8dcbf;});}return null;};}function removeEntity(_0x5c5091,_0x460104){return function(_0x449767){if(_0x449767){return _0x449767[_0xebef('0x27')]()[_0xebef('0x26')](function(){_0x5c5091[_0xebef('0x1b')](0xcc)[_0xebef('0x1c')]();});}};}function handleEntityNotFound(_0x36ca6b,_0x42d2af){return function(_0x45bb67){if(!_0x45bb67){_0x36ca6b[_0xebef('0x28')](0x194);}return _0x45bb67;};}function handleError(_0x456a81,_0x4fb77f){_0x4fb77f=_0x4fb77f||0x1f4;return function(_0xc068de){logger['error'](_0xc068de['stack']);if(_0xc068de['name']){delete _0xc068de['name'];}_0x456a81['status'](_0x4fb77f)['send'](_0xc068de);};}exports['index']=function(_0x5703fc,_0x506e64){var _0x5a9249={},_0x54001c={},_0x136ac3={'count':0x0,'rows':[]};var _0x49a6fb=_[_0xebef('0x29')](db['FreshdeskAccount'][_0xebef('0x2a')],function(_0xa0a713){return{'name':_0xa0a713['fieldName'],'type':_0xa0a713[_0xebef('0x2b')]['key']};});_0x54001c[_0xebef('0x2c')]=_[_0xebef('0x29')](_0x49a6fb,_0xebef('0x2d'));_0x54001c[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5703fc[_0xebef('0x2e')]);_0x54001c['filters']=_[_0xebef('0x30')](_0x54001c['model'],_0x54001c[_0xebef('0x2e')]);_0x5a9249[_0xebef('0x31')]=_[_0xebef('0x30')](_0x54001c[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x32')]));_0x5a9249['attributes']=_0x5a9249[_0xebef('0x31')][_0xebef('0x33')]?_0x5a9249[_0xebef('0x31')]:_0x54001c[_0xebef('0x2c')];if(!_0x5703fc[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x5a9249['limit']=qs[_0xebef('0x1f')](_0x5703fc[_0xebef('0x2e')]['limit']);_0x5a9249[_0xebef('0x1d')]=qs[_0xebef('0x1d')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x1d')]);}_0x5a9249[_0xebef('0x36')]=qs['sort'](_0x5703fc[_0xebef('0x2e')][_0xebef('0x37')]);_0x5a9249['where']=qs['filters'](_[_0xebef('0x38')](_0x5703fc['query'],_0x54001c['filters']),_0x49a6fb);if(_0x5703fc['query'][_0xebef('0x39')]){_0x5a9249['where']=_['merge'](_0x5a9249[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x49a6fb,function(_0x1348a4){if(_0x1348a4['type']!==_0xebef('0x3b')){var _0x4d61c1={};_0x4d61c1[_0x1348a4['name']]={'$like':'%'+_0x5703fc['query'][_0xebef('0x39')]+'%'};return _0x4d61c1;}})});}_0x5a9249=_['merge']({},_0x5a9249,_0x5703fc[_0xebef('0x3c')]);var _0x5078ec={'where':_0x5a9249['where']};return db[_0xebef('0x3d')][_0xebef('0x20')](_0x5078ec)[_0xebef('0x26')](function(_0x297ee0){_0x136ac3[_0xebef('0x20')]=_0x297ee0;if(_0x5703fc[_0xebef('0x2e')]['includeAll']){_0x5a9249[_0xebef('0x3e')]=[{'all':!![]}];}return db[_0xebef('0x3d')][_0xebef('0x3f')](_0x5a9249);})[_0xebef('0x26')](function(_0x32b93c){_0x136ac3[_0xebef('0x40')]=_0x32b93c;return _0x136ac3;})[_0xebef('0x26')](respondWithFilteredResult(_0x506e64,_0x5a9249))[_0xebef('0x41')](handleError(_0x506e64,null));};exports[_0xebef('0x42')]=function(_0xa69151,_0x56fe84){var _0x5cf908={'raw':![],'where':{'id':_0xa69151['params']['id']}},_0x4e3f60={};_0x4e3f60[_0xebef('0x2c')]=_[_0xebef('0x2f')](db[_0xebef('0x3d')][_0xebef('0x2a')]);_0x4e3f60[_0xebef('0x2e')]=_['keys'](_0xa69151['query']);_0x4e3f60[_0xebef('0x43')]=_['intersection'](_0x4e3f60['model'],_0x4e3f60[_0xebef('0x2e')]);_0x5cf908[_0xebef('0x31')]=_[_0xebef('0x30')](_0x4e3f60[_0xebef('0x2c')],qs[_0xebef('0x32')](_0xa69151[_0xebef('0x2e')][_0xebef('0x32')]));_0x5cf908[_0xebef('0x31')]=_0x5cf908[_0xebef('0x31')][_0xebef('0x33')]?_0x5cf908[_0xebef('0x31')]:_0x4e3f60[_0xebef('0x2c')];if(_0xa69151[_0xebef('0x2e')]['includeAll']){_0x5cf908[_0xebef('0x3e')]=[{'all':!![]}];}_0x5cf908=_[_0xebef('0x44')]({},_0x5cf908,_0xa69151[_0xebef('0x3c')]);return db[_0xebef('0x3d')][_0xebef('0x45')](_0x5cf908)[_0xebef('0x26')](handleEntityNotFound(_0x56fe84,null))['then'](respondWithResult(_0x56fe84,null))[_0xebef('0x41')](handleError(_0x56fe84,null));};exports[_0xebef('0x46')]=function(_0x1c7c81,_0x4ce35e){return db['FreshdeskAccount'][_0xebef('0x46')](_0x1c7c81['body'],{})[_0xebef('0x26')](respondWithResult(_0x4ce35e,0xc9))[_0xebef('0x41')](handleError(_0x4ce35e,null));};exports[_0xebef('0x25')]=function(_0x1d70e8,_0x297550){if(_0x1d70e8[_0xebef('0x47')]['id']){delete _0x1d70e8[_0xebef('0x47')]['id'];}return db['FreshdeskAccount'][_0xebef('0x45')]({'where':{'id':_0x1d70e8['params']['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x297550,null))[_0xebef('0x26')](saveUpdates(_0x1d70e8[_0xebef('0x47')],null))[_0xebef('0x26')](respondWithResult(_0x297550,null))['catch'](handleError(_0x297550,null));};exports[_0xebef('0x27')]=function(_0x52f067,_0x5f1ce5){return db[_0xebef('0x3d')][_0xebef('0x45')]({'where':{'id':_0x52f067[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x5f1ce5,null))[_0xebef('0x26')](removeEntity(_0x5f1ce5,null))[_0xebef('0x41')](handleError(_0x5f1ce5,null));};exports[_0xebef('0x49')]=function(_0x35a755,_0x25bd2,_0x1189ff){var _0x255b01={};var _0xb1d606={};var _0x4321d4;var _0x766610;return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x35a755[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x25bd2,null))[_0xebef('0x26')](function(_0x59db6d){if(_0x59db6d){_0x4321d4=_0x59db6d;_0xb1d606['model']=_['keys'](db[_0xebef('0x4b')]['rawAttributes']);_0xb1d606['query']=_[_0xebef('0x2f')](_0x35a755[_0xebef('0x2e')]);_0xb1d606[_0xebef('0x43')]=_['intersection'](_0xb1d606[_0xebef('0x2c')],_0xb1d606[_0xebef('0x2e')]);_0x255b01[_0xebef('0x31')]=_[_0xebef('0x30')](_0xb1d606[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x35a755['query'][_0xebef('0x32')]));_0x255b01[_0xebef('0x31')]=_0x255b01['attributes']['length']?_0x255b01['attributes']:_0xb1d606[_0xebef('0x2c')];_0x255b01[_0xebef('0x36')]=qs[_0xebef('0x37')](_0x35a755[_0xebef('0x2e')][_0xebef('0x37')]);_0x255b01[_0xebef('0x3a')]=qs['filters'](_[_0xebef('0x38')](_0x35a755[_0xebef('0x2e')],_0xb1d606[_0xebef('0x43')]));if(_0x35a755['query'][_0xebef('0x39')]){_0x255b01['where']=_['merge'](_0x255b01[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x255b01[_0xebef('0x31')],function(_0x380206){var _0x353fe2={};_0x353fe2[_0x380206]={'$like':'%'+_0x35a755[_0xebef('0x2e')][_0xebef('0x39')]+'%'};return _0x353fe2;})});}_0x255b01=_['merge']({},_0x255b01,_0x35a755[_0xebef('0x3c')]);return _0x4321d4[_0xebef('0x49')](_0x255b01);}})[_0xebef('0x26')](function(_0x2f390a){if(_0x2f390a){_0x766610=_0x2f390a['length'];if(!_0x35a755[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x255b01[_0xebef('0x1f')]=qs['limit'](_0x35a755[_0xebef('0x2e')]['limit']);_0x255b01[_0xebef('0x1d')]=qs['offset'](_0x35a755[_0xebef('0x2e')][_0xebef('0x1d')]);}return _0x4321d4[_0xebef('0x49')](_0x255b01);}})['then'](function(_0x46d421){if(_0x46d421){return _0x46d421?{'count':_0x766610,'rows':_0x46d421}:null;}})['then'](respondWithResult(_0x25bd2,null))[_0xebef('0x41')](handleError(_0x25bd2,null));};exports[_0xebef('0x4c')]=function(_0xb117cf,_0x40ee9d,_0x424fc1){if(_0xb117cf['body']['id']){delete _0xb117cf[_0xebef('0x47')]['id'];}return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0xb117cf['params']['id']}})['then'](handleEntityNotFound(_0x40ee9d,null))[_0xebef('0x26')](function(_0xb0a7d6){if(_0xb0a7d6){_0xb117cf[_0xebef('0x47')][_0xebef('0x4d')]=_0xb0a7d6['id'];_0xb117cf[_0xebef('0x47')][_0xebef('0x4e')]=integrations[_0xebef('0x4f')](_0xb117cf[_0xebef('0x47')]['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);_0xb117cf[_0xebef('0x47')][_0xebef('0x50')]=integrations[_0xebef('0x51')](_0xb117cf['body']['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);return db[_0xebef('0x4b')]['create'](_0xb117cf[_0xebef('0x47')],{'include':[{'model':db[_0xebef('0x52')],'as':_0xebef('0x4e')},{'model':db[_0xebef('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x40ee9d,null))[_0xebef('0x41')](handleError(_0x40ee9d,null));};exports[_0xebef('0x53')]=function(_0x214bea,_0x41958a,_0x109a21){var _0x2c91c5='';return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x214bea[_0xebef('0x48')]['id']},'attributes':['id',_0xebef('0x54'),'apiKey']})[_0xebef('0x26')](handleEntityNotFound(_0x41958a,null))[_0xebef('0x26')](function(_0x1f7bc4){if(_0x1f7bc4){_0x2c91c5=_0x1f7bc4[_0xebef('0x54')];var _0x1c0eb6=_0x2c91c5[_0xebef('0x55')](-0x1);if(_0x1c0eb6==='/'){_0x2c91c5=_0x2c91c5['substring'](0x0,_0x2c91c5[_0xebef('0x56')](_0x1c0eb6));}return rp({'method':_0xebef('0x57'),'uri':util[_0xebef('0x58')]('%s/%s',_0x2c91c5,_0xebef('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xebef('0x58')]('%s:X',_0x1f7bc4[_0xebef('0x5a')]))['toString'](_0xebef('0x5b')))},'json':!![]});}})[_0xebef('0x26')](function(_0x2e4ca8){if(_0x2e4ca8){var _0x225aa1=[_0xebef('0x5c'),_0xebef('0x5d'),_0xebef('0x5e'),_0xebef('0x5f'),_0xebef('0x1b'),_0xebef('0x60'),_0xebef('0x61'),'source',_0xebef('0x62'),_0xebef('0x61'),_0xebef('0x63')];_[_0xebef('0x64')](_0x2e4ca8,function(_0x575591){return _0x225aa1[_0xebef('0x65')](_0x575591['name'])||!_0x575591[_0xebef('0x66')]&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x67')&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x68');});return{'count':_0x2e4ca8[_0xebef('0x33')],'rows':_[_0xebef('0x29')](_0x2e4ca8,function(_0x25d845){return{'id':_0x25d845[_0xebef('0x2d')],'name':_0x25d845['label'],'custom':!_0x25d845[_0xebef('0x66')],'options':_0x25d845['choices']?_[_0xebef('0x29')](_0x25d845['choices'],function(_0x110e23){return{'name':_[_0xebef('0x69')](_0x110e23),'value':_0x110e23};}):[]};})};}})['then'](respondWithResult(_0x41958a,null))[_0xebef('0x41')](function(_0x54a0b3){var _0x1209fc=_0x214bea[_0xebef('0x2e')]['test']?0x1f4:_0x54a0b3[_0xebef('0x6a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xebef('0x53'),_0x1209fc,JSON[_0xebef('0x6b')](_0x54a0b3));delete _0x54a0b3[_0xebef('0x2d')];if(_0x1209fc===0x191){_0x1209fc=0x190;}_0x41958a[_0xebef('0x1b')](_0x1209fc)[_0xebef('0x6c')](_0x214bea[_0xebef('0x2e')][_0xebef('0x6d')]?{'message':_0xebef('0x6e'),'statusCode':_0x54a0b3[_0xebef('0x6a')]}:_0x54a0b3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f79e3af..d8df979 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 _0x3f67=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x2fd88b,_0x3cbae0){var _0x3e9f0d=function(_0x2dc173){while(--_0x2dc173){_0x2fd88b['push'](_0x2fd88b['shift']());}};_0x3e9f0d(++_0x3cbae0);}(_0x3f67,0x1d4));var _0x73f6=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x3f67[_0x5e6cb8];return _0x3faeb3;};'use strict';var _=require(_0x73f6('0x0'));var util=require(_0x73f6('0x1'));var logger=require(_0x73f6('0x2'))(_0x73f6('0x3'));var moment=require(_0x73f6('0x4'));var BPromise=require(_0x73f6('0x5'));var rp=require(_0x73f6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73f6('0x7'));var attributes=require(_0x73f6('0x8'));var integrations=require(_0x73f6('0x9'));module['exports']=function(_0x57dad0,_0x1a5778){return _0x57dad0['define'](_0x73f6('0xa'),attributes,{'tableName':_0x73f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfaab=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x59b15d,_0x104fcf){var _0x3a49fc=function(_0x1a1073){while(--_0x1a1073){_0x59b15d['push'](_0x59b15d['shift']());}};_0x3a49fc(++_0x104fcf);}(_0xfaab,0x1b2));var _0xbfaa=function(_0x22ff19,_0x659de5){_0x22ff19=_0x22ff19-0x0;var _0x271ead=_0xfaab[_0x22ff19];return _0x271ead;};'use strict';var _=require(_0xbfaa('0x0'));var util=require(_0xbfaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbfaa('0x2'));var BPromise=require(_0xbfaa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfaa('0x4'));var rimraf=require(_0xbfaa('0x5'));var config=require('../../config/environment');var attributes=require(_0xbfaa('0x6'));var integrations=require(_0xbfaa('0x7'));module[_0xbfaa('0x8')]=function(_0x2e7d5c,_0x4fb743){return _0x2e7d5c[_0xbfaa('0x9')](_0xbfaa('0xa'),attributes,{'tableName':_0xbfaa('0xb'),'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 aadcad0..3883224 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 _0x44e5=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','randomstring','ioredis'];(function(_0x4e2604,_0x508dcb){var _0x294c2a=function(_0x4d04f3){while(--_0x4d04f3){_0x4e2604['push'](_0x4e2604['shift']());}};_0x294c2a(++_0x508dcb);}(_0x44e5,0x187));var _0x544e=function(_0x59166d,_0x415c2d){_0x59166d=_0x59166d-0x0;var _0x2184e1=_0x44e5[_0x59166d];return _0x2184e1;};'use strict';var _=require(_0x544e('0x0'));var util=require(_0x544e('0x1'));var moment=require(_0x544e('0x2'));var BPromise=require('bluebird');var rs=require(_0x544e('0x3'));var fs=require('fs');var Redis=require(_0x544e('0x4'));var db=require(_0x544e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x544e('0x6'))(_0x544e('0x7'));var config=require(_0x544e('0x8'));var jayson=require(_0x544e('0x9'));var client=jayson['client'][_0x544e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274269,_0x5dd085,_0x23a13e){return new BPromise(function(_0xadd8e4,_0x31cca4){return client['request'](_0x274269,_0x23a13e)[_0x544e('0xb')](function(_0x506293){logger[_0x544e('0xc')](_0x544e('0xd'),_0x5dd085,_0x544e('0xe'));logger[_0x544e('0xf')](_0x544e('0x10'),_0x5dd085,'request\x20sent',JSON[_0x544e('0x11')](_0x506293));if(_0x506293[_0x544e('0x12')]){if(_0x506293['error'][_0x544e('0x13')]===0x1f4){logger[_0x544e('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x5dd085,_0x506293[_0x544e('0x12')][_0x544e('0x14')]);return _0x31cca4(_0x506293[_0x544e('0x12')][_0x544e('0x14')]);}logger['error'](_0x544e('0xd'),_0x5dd085,_0x506293[_0x544e('0x12')][_0x544e('0x14')]);return _0xadd8e4(_0x506293['error'][_0x544e('0x14')]);}else{logger[_0x544e('0xc')](_0x544e('0xd'),_0x5dd085,'request\x20sent');_0xadd8e4(_0x506293['result']['message']);}})[_0x544e('0x15')](function(_0x2a9927){logger[_0x544e('0x12')](_0x544e('0xd'),_0x5dd085,_0x2a9927);_0x31cca4(_0x2a9927);});});}exports['GetFreshdeskAccount']=function(_0x2c0ee0){var _0x11f32b=this;return new Promise(function(_0x3eaa52,_0x56e433){return db[_0x544e('0x16')][_0x544e('0x17')]({'raw':_0x2c0ee0['options']?_0x2c0ee0[_0x544e('0x18')][_0x544e('0x19')]===undefined?!![]:![]:!![],'where':_0x2c0ee0[_0x544e('0x18')]?_0x2c0ee0[_0x544e('0x18')][_0x544e('0x1a')]||null:null,'attributes':_0x2c0ee0[_0x544e('0x18')]?_0x2c0ee0[_0x544e('0x18')][_0x544e('0x1b')]||null:null,'limit':_0x2c0ee0[_0x544e('0x18')]?_0x2c0ee0[_0x544e('0x18')]['limit']||null:null,'include':_0x2c0ee0[_0x544e('0x18')]?_0x2c0ee0[_0x544e('0x18')]['include']?_['map'](_0x2c0ee0['options'][_0x544e('0x1c')],function(_0x3e73da){return{'model':db[_0x3e73da[_0x544e('0x1d')]],'as':_0x3e73da['as'],'attributes':_0x3e73da[_0x544e('0x1b')],'include':_0x3e73da[_0x544e('0x1c')]?_[_0x544e('0x1e')](_0x3e73da['include'],function(_0x1c4218){return{'model':db[_0x1c4218[_0x544e('0x1d')]],'as':_0x1c4218['as'],'attributes':_0x1c4218[_0x544e('0x1b')],'include':_0x1c4218[_0x544e('0x1c')]?_[_0x544e('0x1e')](_0x1c4218['include'],function(_0x81df85){return{'model':db[_0x81df85[_0x544e('0x1d')]],'as':_0x81df85['as'],'attributes':_0x81df85[_0x544e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x544e('0xb')](function(_0x2cddfd){logger[_0x544e('0xc')](_0x544e('0x1f'),_0x2c0ee0);logger[_0x544e('0xf')]('GetFreshdeskAccount',_0x2c0ee0,JSON[_0x544e('0x11')](_0x2cddfd));_0x3eaa52(_0x2cddfd);})[_0x544e('0x15')](function(_0x2f58f6){logger[_0x544e('0x12')]('GetFreshdeskAccount',_0x2f58f6[_0x544e('0x14')],_0x2c0ee0);_0x56e433(_0x11f32b['error'](0x1f4,_0x2f58f6[_0x544e('0x14')]));});});};exports[_0x544e('0x20')]=function(_0x3b1b2e){var _0x1a2e62=this;return new Promise(function(_0x1d9b85,_0x2babf9){return db[_0x544e('0x16')]['find']({'raw':_0x3b1b2e[_0x544e('0x18')]?_0x3b1b2e[_0x544e('0x18')][_0x544e('0x19')]===undefined?!![]:![]:!![],'where':_0x3b1b2e['options']?_0x3b1b2e[_0x544e('0x18')][_0x544e('0x1a')]||null:null,'attributes':_0x3b1b2e[_0x544e('0x18')]?_0x3b1b2e[_0x544e('0x18')][_0x544e('0x1b')]||null:null,'include':_0x3b1b2e['options']?_0x3b1b2e[_0x544e('0x18')][_0x544e('0x1c')]?_[_0x544e('0x1e')](_0x3b1b2e['options'][_0x544e('0x1c')],function(_0x1c4a39){return{'model':db[_0x1c4a39[_0x544e('0x1d')]],'as':_0x1c4a39['as'],'attributes':_0x1c4a39[_0x544e('0x1b')],'include':_0x1c4a39[_0x544e('0x1c')]?_[_0x544e('0x1e')](_0x1c4a39[_0x544e('0x1c')],function(_0x222f44){return{'model':db[_0x222f44[_0x544e('0x1d')]],'as':_0x222f44['as'],'attributes':_0x222f44[_0x544e('0x1b')],'include':_0x222f44['include']?_[_0x544e('0x1e')](_0x222f44[_0x544e('0x1c')],function(_0x538a2f){return{'model':db[_0x538a2f[_0x544e('0x1d')]],'as':_0x538a2f['as'],'attributes':_0x538a2f[_0x544e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x544e('0xb')](function(_0x536e12){logger['info'](_0x544e('0x20'),_0x3b1b2e);logger[_0x544e('0xf')](_0x544e('0x20'),_0x3b1b2e,JSON[_0x544e('0x11')](_0x536e12));_0x1d9b85(_0x536e12);})['catch'](function(_0x2d663f){logger[_0x544e('0x12')](_0x544e('0x20'),_0x2d663f[_0x544e('0x14')],_0x3b1b2e);_0x2babf9(_0x1a2e62[_0x544e('0x12')](0x1f4,_0x2d663f[_0x544e('0x14')]));});});}; \ No newline at end of file +var _0x4318=['jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','options','where','attributes','limit','map','include','model','GetFreshdeskAccount','catch','find','raw','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x464ac9,_0xe7533a){var _0x1bec0a=function(_0x22419b){while(--_0x22419b){_0x464ac9['push'](_0x464ac9['shift']());}};_0x1bec0a(++_0xe7533a);}(_0x4318,0x1a7));var _0x8431=function(_0x191823,_0xb81250){_0x191823=_0x191823-0x0;var _0x73a245=_0x4318[_0x191823];return _0x73a245;};'use strict';var _=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var moment=require(_0x8431('0x2'));var BPromise=require(_0x8431('0x3'));var rs=require(_0x8431('0x4'));var fs=require('fs');var Redis=require(_0x8431('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8431('0x6'));var logger=require(_0x8431('0x7'))(_0x8431('0x8'));var config=require('../../config/environment');var jayson=require(_0x8431('0x9'));var client=jayson[_0x8431('0xa')][_0x8431('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d53b1,_0x450ac0,_0x186aa4){return new BPromise(function(_0x3a0d2e,_0x5aeb32){return client[_0x8431('0xc')](_0x1d53b1,_0x186aa4)[_0x8431('0xd')](function(_0x14d241){logger[_0x8431('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x8431('0xf'));logger[_0x8431('0x10')](_0x8431('0x11'),_0x450ac0,_0x8431('0xf'),JSON[_0x8431('0x12')](_0x14d241));if(_0x14d241[_0x8431('0x13')]){if(_0x14d241[_0x8431('0x13')][_0x8431('0x14')]===0x1f4){logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);return _0x5aeb32(_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);}logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);return _0x3a0d2e(_0x14d241[_0x8431('0x13')]['message']);}else{logger[_0x8431('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x8431('0xf'));_0x3a0d2e(_0x14d241[_0x8431('0x16')][_0x8431('0x15')]);}})['catch'](function(_0x1fa3c4){logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x1fa3c4);_0x5aeb32(_0x1fa3c4);});});}exports['GetFreshdeskAccount']=function(_0x32eda1){var _0x41cbf5=this;return new Promise(function(_0x59d23e,_0x35a21d){return db[_0x8431('0x17')]['findAll']({'raw':_0x32eda1['options']?_0x32eda1[_0x8431('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')][_0x8431('0x19')]||null:null,'attributes':_0x32eda1['options']?_0x32eda1[_0x8431('0x18')][_0x8431('0x1a')]||null:null,'limit':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')][_0x8431('0x1b')]||null:null,'include':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')]['include']?_[_0x8431('0x1c')](_0x32eda1['options']['include'],function(_0x3add85){return{'model':db[_0x3add85['model']],'as':_0x3add85['as'],'attributes':_0x3add85[_0x8431('0x1a')],'include':_0x3add85[_0x8431('0x1d')]?_['map'](_0x3add85[_0x8431('0x1d')],function(_0x5e5d41){return{'model':db[_0x5e5d41[_0x8431('0x1e')]],'as':_0x5e5d41['as'],'attributes':_0x5e5d41[_0x8431('0x1a')],'include':_0x5e5d41[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x5e5d41[_0x8431('0x1d')],function(_0x4b6a33){return{'model':db[_0x4b6a33['model']],'as':_0x4b6a33['as'],'attributes':_0x4b6a33[_0x8431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8431('0xd')](function(_0x4c6c15){logger['info'](_0x8431('0x1f'),_0x32eda1);logger['debug']('GetFreshdeskAccount',_0x32eda1,JSON[_0x8431('0x12')](_0x4c6c15));_0x59d23e(_0x4c6c15);})[_0x8431('0x20')](function(_0x381d71){logger[_0x8431('0x13')](_0x8431('0x1f'),_0x381d71['message'],_0x32eda1);_0x35a21d(_0x41cbf5[_0x8431('0x13')](0x1f4,_0x381d71[_0x8431('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x5acff9){var _0x30b2af=this;return new Promise(function(_0x492a95,_0x32fb1c){return db[_0x8431('0x17')][_0x8431('0x21')]({'raw':_0x5acff9['options']?_0x5acff9['options'][_0x8431('0x22')]===undefined?!![]:![]:!![],'where':_0x5acff9[_0x8431('0x18')]?_0x5acff9[_0x8431('0x18')][_0x8431('0x19')]||null:null,'attributes':_0x5acff9[_0x8431('0x18')]?_0x5acff9[_0x8431('0x18')]['attributes']||null:null,'include':_0x5acff9['options']?_0x5acff9[_0x8431('0x18')][_0x8431('0x1d')]?_['map'](_0x5acff9[_0x8431('0x18')][_0x8431('0x1d')],function(_0x454eef){return{'model':db[_0x454eef[_0x8431('0x1e')]],'as':_0x454eef['as'],'attributes':_0x454eef[_0x8431('0x1a')],'include':_0x454eef[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x454eef[_0x8431('0x1d')],function(_0x54f05e){return{'model':db[_0x54f05e[_0x8431('0x1e')]],'as':_0x54f05e['as'],'attributes':_0x54f05e[_0x8431('0x1a')],'include':_0x54f05e[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x54f05e[_0x8431('0x1d')],function(_0x4c8749){return{'model':db[_0x4c8749['model']],'as':_0x4c8749['as'],'attributes':_0x4c8749[_0x8431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8431('0xd')](function(_0x3f486a){logger[_0x8431('0xe')](_0x8431('0x23'),_0x5acff9);logger[_0x8431('0x10')]('ShowFreshdeskAccount',_0x5acff9,JSON[_0x8431('0x12')](_0x3f486a));_0x492a95(_0x3f486a);})[_0x8431('0x20')](function(_0x544b43){logger['error'](_0x8431('0x23'),_0x544b43[_0x8431('0x15')],_0x5acff9);_0x32fb1c(_0x30b2af[_0x8431('0x13')](0x1f4,_0x544b43[_0x8431('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index e96c608..d7ab35f 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 _0x32bf=['/:id/tags','getTags','create','post','setTags','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x48dbf2,_0x39e8c1){var _0x12d880=function(_0x91c972){while(--_0x91c972){_0x48dbf2['push'](_0x48dbf2['shift']());}};_0x12d880(++_0x39e8c1);}(_0x32bf,0x1e5));var _0xf32b=function(_0x4afe7d,_0x262bd7){_0x4afe7d=_0x4afe7d-0x0;var _0x7562f6=_0x32bf[_0x4afe7d];return _0x7562f6;};'use strict';var multer=require(_0xf32b('0x0'));var util=require(_0xf32b('0x1'));var path=require('path');var timeout=require(_0xf32b('0x2'));var express=require(_0xf32b('0x3'));var router=express[_0xf32b('0x4')]();var fs_extra=require(_0xf32b('0x5'));var auth=require(_0xf32b('0x6'));var interaction=require(_0xf32b('0x7'));var config=require(_0xf32b('0x8'));var controller=require(_0xf32b('0x9'));router['get']('/',auth[_0xf32b('0xa')](),controller[_0xf32b('0xb')]);router[_0xf32b('0xc')](_0xf32b('0xd'),auth['isAuthenticated'](),controller[_0xf32b('0xe')]);router[_0xf32b('0xc')](_0xf32b('0xf'),auth[_0xf32b('0xa')](),controller['getFields']);router[_0xf32b('0xc')](_0xf32b('0x10'),auth[_0xf32b('0xa')](),controller[_0xf32b('0x11')]);router['get'](_0xf32b('0x12'),auth[_0xf32b('0xa')](),controller['getDescriptions']);router['get'](_0xf32b('0x13'),auth[_0xf32b('0xa')](),controller[_0xf32b('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf32b('0x15')]);router[_0xf32b('0x16')](_0xf32b('0x13'),auth[_0xf32b('0xa')](),controller[_0xf32b('0x17')]);router[_0xf32b('0x18')](_0xf32b('0xd'),auth[_0xf32b('0xa')](),controller[_0xf32b('0x19')]);router[_0xf32b('0x1a')](_0xf32b('0xd'),auth[_0xf32b('0xa')](),controller['destroy']);module[_0xf32b('0x1b')]=router; \ No newline at end of file +var _0xafca=['/:id/tags','getTags','post','setTags','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x459180,_0xca2366){var _0x463dbe=function(_0x3597e8){while(--_0x3597e8){_0x459180['push'](_0x459180['shift']());}};_0x463dbe(++_0xca2366);}(_0xafca,0x16f));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xaafc('0x0'));var util=require('util');var path=require(_0xaafc('0x1'));var timeout=require(_0xaafc('0x2'));var express=require(_0xaafc('0x3'));var router=express['Router']();var fs_extra=require(_0xaafc('0x4'));var auth=require(_0xaafc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaafc('0x6'));var controller=require(_0xaafc('0x7'));router['get']('/',auth[_0xaafc('0x8')](),controller[_0xaafc('0x9')]);router[_0xaafc('0xa')](_0xaafc('0xb'),auth[_0xaafc('0x8')](),controller[_0xaafc('0xc')]);router['get'](_0xaafc('0xd'),auth[_0xaafc('0x8')](),controller[_0xaafc('0xe')]);router[_0xaafc('0xa')](_0xaafc('0xf'),auth[_0xaafc('0x8')](),controller[_0xaafc('0x10')]);router[_0xaafc('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xaafc('0xa')](_0xaafc('0x11'),auth[_0xaafc('0x8')](),controller[_0xaafc('0x12')]);router[_0xaafc('0x13')]('/',auth[_0xaafc('0x8')](),controller['create']);router[_0xaafc('0x13')]('/:id/tags',auth[_0xaafc('0x8')](),controller[_0xaafc('0x14')]);router['put'](_0xaafc('0xb'),auth['isAuthenticated'](),controller[_0xaafc('0x15')]);router[_0xaafc('0x16')]('/:id',auth[_0xaafc('0x8')](),controller['destroy']);module[_0xaafc('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index cd9674f..d63ab2c 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 _0x8a26=['STRING','sequelize'];(function(_0x3c3cb6,_0x5e0c7c){var _0x40eae8=function(_0x108fa5){while(--_0x108fa5){_0x3c3cb6['push'](_0x3c3cb6['shift']());}};_0x40eae8(++_0x5e0c7c);}(_0x8a26,0xdd));var _0x68a2=function(_0x45ef0f,_0x49f13b){_0x45ef0f=_0x45ef0f-0x0;var _0x53f8c4=_0x8a26[_0x45ef0f];return _0x53f8c4;};'use strict';var Sequelize=require(_0x68a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x68a2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3b6b=['STRING','sequelize'];(function(_0x468ae4,_0x58d17d){var _0x53bb10=function(_0x70308d){while(--_0x70308d){_0x468ae4['push'](_0x468ae4['shift']());}};_0x53bb10(++_0x58d17d);}(_0x3b6b,0x1b1));var _0xb3b6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b6b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb3b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb3b6('0x1')]},'description':{'type':Sequelize[_0xb3b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e56544e..70aeed3 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 _0xde46=['offset','undefined','limit','count','status','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','catch','params','find','create','body','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','json'];(function(_0x301506,_0x54fee6){var _0x1dd5ee=function(_0x2ea0d8){while(--_0x2ea0d8){_0x301506['push'](_0x301506['shift']());}};_0x1dd5ee(++_0x54fee6);}(_0xde46,0xd4));var _0x6de4=function(_0x26ec5f,_0x458a1d){_0x26ec5f=_0x26ec5f-0x0;var _0x2cde81=_0xde46[_0x26ec5f];return _0x2cde81;};'use strict';var emlformat=require(_0x6de4('0x0'));var rimraf=require(_0x6de4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6de4('0x2'));var rp=require(_0x6de4('0x3'));var moment=require(_0x6de4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6de4('0x5'));var util=require('util');var path=require(_0x6de4('0x6'));var sox=require('sox');var csv=require(_0x6de4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6de4('0x8'));var _=require(_0x6de4('0x9'));var squel=require(_0x6de4('0xa'));var crypto=require(_0x6de4('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6de4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6de4('0xc'));var authService=require(_0x6de4('0xd'));var qs=require(_0x6de4('0xe'));var as=require(_0x6de4('0xf'));var hardwareService=require(_0x6de4('0x10'));var logger=require('../../config/logger')(_0x6de4('0x11'));var utils=require('../../config/utils');var config=require(_0x6de4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6de4('0x13'))['db'];function respondWithStatusCode(_0x48c637,_0x507be7){_0x507be7=_0x507be7||0xcc;return function(_0x18e9f0){if(_0x18e9f0){return _0x48c637['sendStatus'](_0x507be7);}return _0x48c637['status'](_0x507be7)[_0x6de4('0x14')]();};}function respondWithResult(_0x4f5f09,_0x1310e4){_0x1310e4=_0x1310e4||0xc8;return function(_0x12d3a9){if(_0x12d3a9){return _0x4f5f09['status'](_0x1310e4)[_0x6de4('0x15')](_0x12d3a9);}};}function respondWithFilteredResult(_0x1d09a0,_0x568f1f){return function(_0x144e54){if(_0x144e54){var _0x290bf6=typeof _0x568f1f[_0x6de4('0x16')]===_0x6de4('0x17')&&typeof _0x568f1f[_0x6de4('0x18')]===_0x6de4('0x17');var _0x40f768=_0x144e54[_0x6de4('0x19')];var _0x29056a=_0x290bf6?0x0:_0x568f1f[_0x6de4('0x16')];var _0x373c9c=_0x290bf6?_0x144e54[_0x6de4('0x19')]:_0x568f1f['offset']+_0x568f1f[_0x6de4('0x18')];var _0x3d3b64;if(_0x373c9c>=_0x40f768){_0x373c9c=_0x40f768;_0x3d3b64=0xc8;}else{_0x3d3b64=0xce;}_0x1d09a0[_0x6de4('0x1a')](_0x3d3b64);return _0x1d09a0['set'](_0x6de4('0x1b'),_0x29056a+'-'+_0x373c9c+'/'+_0x40f768)[_0x6de4('0x15')](_0x144e54);}return null;};}function patchUpdates(_0x5193b6){return function(_0x21e332){try{jsonpatch[_0x6de4('0x1c')](_0x21e332,_0x5193b6,!![]);}catch(_0x5399b9){return BPromise[_0x6de4('0x1d')](_0x5399b9);}return _0x21e332['save']();};}function saveUpdates(_0x4b35cb,_0x3817f2){return function(_0x17cd25){if(_0x17cd25){return _0x17cd25[_0x6de4('0x1e')](_0x4b35cb)['then'](function(_0x1651b4){return _0x1651b4;});}return null;};}function removeEntity(_0x55e73b,_0x56802b){return function(_0x3b05be){if(_0x3b05be){return _0x3b05be[_0x6de4('0x1f')]()[_0x6de4('0x20')](function(){_0x55e73b[_0x6de4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58466c,_0xbf361e){return function(_0x3c52c3){if(!_0x3c52c3){_0x58466c['sendStatus'](0x194);}return _0x3c52c3;};}function handleError(_0x438aba,_0x249a25){_0x249a25=_0x249a25||0x1f4;return function(_0x2efedf){logger[_0x6de4('0x21')](_0x2efedf['stack']);if(_0x2efedf['name']){delete _0x2efedf[_0x6de4('0x22')];}_0x438aba['status'](_0x249a25)[_0x6de4('0x23')](_0x2efedf);};}exports[_0x6de4('0x24')]=function(_0x2e414a,_0x1c85ca){var _0x5dcf6e={},_0x13425e={},_0x3d46d2={'count':0x0,'rows':[]};var _0x3ecf1a=_[_0x6de4('0x25')](db['FreshdeskConfiguration'][_0x6de4('0x26')],function(_0x3cfe9d){return{'name':_0x3cfe9d[_0x6de4('0x27')],'type':_0x3cfe9d[_0x6de4('0x28')][_0x6de4('0x29')]};});_0x13425e[_0x6de4('0x2a')]=_[_0x6de4('0x25')](_0x3ecf1a,_0x6de4('0x22'));_0x13425e[_0x6de4('0x2b')]=_[_0x6de4('0x2c')](_0x2e414a['query']);_0x13425e[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x13425e['model'],_0x13425e[_0x6de4('0x2b')]);_0x5dcf6e[_0x6de4('0x2f')]=_[_0x6de4('0x2e')](_0x13425e['model'],qs[_0x6de4('0x30')](_0x2e414a['query'][_0x6de4('0x30')]));_0x5dcf6e[_0x6de4('0x2f')]=_0x5dcf6e[_0x6de4('0x2f')][_0x6de4('0x31')]?_0x5dcf6e[_0x6de4('0x2f')]:_0x13425e[_0x6de4('0x2a')];if(!_0x2e414a['query']['hasOwnProperty'](_0x6de4('0x32'))){_0x5dcf6e['limit']=qs[_0x6de4('0x18')](_0x2e414a[_0x6de4('0x2b')]['limit']);_0x5dcf6e[_0x6de4('0x16')]=qs[_0x6de4('0x16')](_0x2e414a['query'][_0x6de4('0x16')]);}_0x5dcf6e[_0x6de4('0x33')]=qs[_0x6de4('0x34')](_0x2e414a[_0x6de4('0x2b')]['sort']);_0x5dcf6e[_0x6de4('0x35')]=qs[_0x6de4('0x2d')](_[_0x6de4('0x36')](_0x2e414a[_0x6de4('0x2b')],_0x13425e[_0x6de4('0x2d')]),_0x3ecf1a);if(_0x2e414a[_0x6de4('0x2b')][_0x6de4('0x37')]){_0x5dcf6e[_0x6de4('0x35')]=_[_0x6de4('0x38')](_0x5dcf6e['where'],{'$or':_[_0x6de4('0x25')](_0x3ecf1a,function(_0x5b3fcb){if(_0x5b3fcb[_0x6de4('0x28')]!==_0x6de4('0x39')){var _0x3217b8={};_0x3217b8[_0x5b3fcb[_0x6de4('0x22')]]={'$like':'%'+_0x2e414a['query'][_0x6de4('0x37')]+'%'};return _0x3217b8;}})});}_0x5dcf6e=_[_0x6de4('0x38')]({},_0x5dcf6e,_0x2e414a[_0x6de4('0x3a')]);var _0x57d8f2={'where':_0x5dcf6e[_0x6de4('0x35')]};return db[_0x6de4('0x3b')][_0x6de4('0x19')](_0x57d8f2)['then'](function(_0x55c360){_0x3d46d2[_0x6de4('0x19')]=_0x55c360;if(_0x2e414a[_0x6de4('0x2b')][_0x6de4('0x3c')]){_0x5dcf6e[_0x6de4('0x3d')]=[{'all':!![]}];}return db[_0x6de4('0x3b')][_0x6de4('0x3e')](_0x5dcf6e);})[_0x6de4('0x20')](function(_0xd3ef6a){_0x3d46d2['rows']=_0xd3ef6a;return _0x3d46d2;})[_0x6de4('0x20')](respondWithFilteredResult(_0x1c85ca,_0x5dcf6e))[_0x6de4('0x3f')](handleError(_0x1c85ca,null));};exports['show']=function(_0x38f2ff,_0x4fb25d){var _0x5e87f1={'raw':![],'where':{'id':_0x38f2ff[_0x6de4('0x40')]['id']}},_0x4220f8={};_0x4220f8[_0x6de4('0x2a')]=_[_0x6de4('0x2c')](db[_0x6de4('0x3b')][_0x6de4('0x26')]);_0x4220f8['query']=_[_0x6de4('0x2c')](_0x38f2ff[_0x6de4('0x2b')]);_0x4220f8[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x4220f8[_0x6de4('0x2a')],_0x4220f8[_0x6de4('0x2b')]);_0x5e87f1[_0x6de4('0x2f')]=_[_0x6de4('0x2e')](_0x4220f8[_0x6de4('0x2a')],qs['fields'](_0x38f2ff[_0x6de4('0x2b')][_0x6de4('0x30')]));_0x5e87f1[_0x6de4('0x2f')]=_0x5e87f1[_0x6de4('0x2f')][_0x6de4('0x31')]?_0x5e87f1[_0x6de4('0x2f')]:_0x4220f8[_0x6de4('0x2a')];if(_0x38f2ff[_0x6de4('0x2b')][_0x6de4('0x3c')]){_0x5e87f1['include']=[{'all':!![]}];}_0x5e87f1=_[_0x6de4('0x38')]({},_0x5e87f1,_0x38f2ff[_0x6de4('0x3a')]);return db[_0x6de4('0x3b')][_0x6de4('0x41')](_0x5e87f1)['then'](handleEntityNotFound(_0x4fb25d,null))[_0x6de4('0x20')](respondWithResult(_0x4fb25d,null))['catch'](handleError(_0x4fb25d,null));};exports['create']=function(_0x4ae218,_0x11482d){return db[_0x6de4('0x3b')][_0x6de4('0x42')](_0x4ae218[_0x6de4('0x43')],{})[_0x6de4('0x20')](respondWithResult(_0x11482d,0xc9))[_0x6de4('0x3f')](handleError(_0x11482d,null));};exports[_0x6de4('0x1e')]=function(_0x50f809,_0x4223f7){if(_0x50f809[_0x6de4('0x43')]['id']){delete _0x50f809[_0x6de4('0x43')]['id'];}return db[_0x6de4('0x3b')][_0x6de4('0x41')]({'where':{'id':_0x50f809[_0x6de4('0x40')]['id']}})[_0x6de4('0x20')](handleEntityNotFound(_0x4223f7,null))[_0x6de4('0x20')](saveUpdates(_0x50f809['body'],null))[_0x6de4('0x20')](respondWithResult(_0x4223f7,null))[_0x6de4('0x3f')](handleError(_0x4223f7,null));};exports[_0x6de4('0x1f')]=function(_0x518bd3,_0x49230b){return db[_0x6de4('0x3b')][_0x6de4('0x41')]({'where':{'id':_0x518bd3[_0x6de4('0x40')]['id']}})['then'](handleEntityNotFound(_0x49230b,null))[_0x6de4('0x20')](removeEntity(_0x49230b,null))[_0x6de4('0x3f')](handleError(_0x49230b,null));};exports[_0x6de4('0x44')]=function(_0x494f,_0x454e81,_0x229831){var _0x4fba02={};var _0x35ec3b={};var _0x301ae0;var _0x1e8b6a;return db['FreshdeskConfiguration'][_0x6de4('0x45')]({'where':{'id':_0x494f[_0x6de4('0x40')]['id']}})['then'](handleEntityNotFound(_0x454e81,null))['then'](function(_0x32f9aa){if(_0x32f9aa){_0x301ae0=_0x32f9aa;_0x35ec3b[_0x6de4('0x2a')]=_[_0x6de4('0x2c')](db[_0x6de4('0x46')][_0x6de4('0x26')]);_0x35ec3b['query']=_['keys'](_0x494f[_0x6de4('0x2b')]);_0x35ec3b[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x35ec3b['model'],_0x35ec3b[_0x6de4('0x2b')]);_0x4fba02[_0x6de4('0x2f')]=_[_0x6de4('0x2e')](_0x35ec3b[_0x6de4('0x2a')],qs[_0x6de4('0x30')](_0x494f[_0x6de4('0x2b')][_0x6de4('0x30')]));_0x4fba02[_0x6de4('0x2f')]=_0x4fba02[_0x6de4('0x2f')][_0x6de4('0x31')]?_0x4fba02[_0x6de4('0x2f')]:_0x35ec3b['model'];_0x4fba02[_0x6de4('0x33')]=qs['sort'](_0x494f[_0x6de4('0x2b')][_0x6de4('0x34')]);_0x4fba02[_0x6de4('0x35')]=qs[_0x6de4('0x2d')](_[_0x6de4('0x36')](_0x494f[_0x6de4('0x2b')],_0x35ec3b[_0x6de4('0x2d')]));if(_0x494f['query']['filter']){_0x4fba02[_0x6de4('0x35')]=_[_0x6de4('0x38')](_0x4fba02[_0x6de4('0x35')],{'$or':_[_0x6de4('0x25')](_0x4fba02['attributes'],function(_0x5a84d0){var _0xb68868={};_0xb68868[_0x5a84d0]={'$like':'%'+_0x494f[_0x6de4('0x2b')][_0x6de4('0x37')]+'%'};return _0xb68868;})});}_0x4fba02=_[_0x6de4('0x38')]({},_0x4fba02,_0x494f[_0x6de4('0x3a')]);return _0x301ae0['getFields'](_0x4fba02);}})['then'](function(_0x3bc565){if(_0x3bc565){_0x1e8b6a=_0x3bc565[_0x6de4('0x31')];if(!_0x494f['query'][_0x6de4('0x47')]('nolimit')){_0x4fba02['limit']=qs[_0x6de4('0x18')](_0x494f[_0x6de4('0x2b')][_0x6de4('0x18')]);_0x4fba02[_0x6de4('0x16')]=qs['offset'](_0x494f[_0x6de4('0x2b')][_0x6de4('0x16')]);}return _0x301ae0['getFields'](_0x4fba02);}})['then'](function(_0x10c404){if(_0x10c404){return _0x10c404?{'count':_0x1e8b6a,'rows':_0x10c404}:null;}})[_0x6de4('0x20')](respondWithResult(_0x454e81,null))['catch'](handleError(_0x454e81,null));};exports['getSubjects']=function(_0x4bc7bd,_0x52f313,_0x476a8d){var _0x45e0e7={};var _0x4c83de={};var _0x28db6e;var _0x3cdcb1;return db[_0x6de4('0x3b')][_0x6de4('0x45')]({'where':{'id':_0x4bc7bd['params']['id']}})[_0x6de4('0x20')](handleEntityNotFound(_0x52f313,null))[_0x6de4('0x20')](function(_0x423842){if(_0x423842){_0x28db6e=_0x423842;_0x4c83de['model']=_[_0x6de4('0x2c')](db['FreshdeskField'][_0x6de4('0x26')]);_0x4c83de['query']=_[_0x6de4('0x2c')](_0x4bc7bd[_0x6de4('0x2b')]);_0x4c83de[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x4c83de[_0x6de4('0x2a')],_0x4c83de[_0x6de4('0x2b')]);_0x45e0e7[_0x6de4('0x2f')]=_[_0x6de4('0x2e')](_0x4c83de['model'],qs['fields'](_0x4bc7bd[_0x6de4('0x2b')]['fields']));_0x45e0e7[_0x6de4('0x2f')]=_0x45e0e7[_0x6de4('0x2f')][_0x6de4('0x31')]?_0x45e0e7[_0x6de4('0x2f')]:_0x4c83de[_0x6de4('0x2a')];_0x45e0e7[_0x6de4('0x33')]=qs[_0x6de4('0x34')](_0x4bc7bd[_0x6de4('0x2b')][_0x6de4('0x34')]);_0x45e0e7[_0x6de4('0x35')]=qs[_0x6de4('0x2d')](_[_0x6de4('0x36')](_0x4bc7bd[_0x6de4('0x2b')],_0x4c83de[_0x6de4('0x2d')]));if(_0x4bc7bd[_0x6de4('0x2b')][_0x6de4('0x37')]){_0x45e0e7['where']=_[_0x6de4('0x38')](_0x45e0e7[_0x6de4('0x35')],{'$or':_[_0x6de4('0x25')](_0x45e0e7[_0x6de4('0x2f')],function(_0x422632){var _0x5cb7bc={};_0x5cb7bc[_0x422632]={'$like':'%'+_0x4bc7bd[_0x6de4('0x2b')][_0x6de4('0x37')]+'%'};return _0x5cb7bc;})});}_0x45e0e7=_[_0x6de4('0x38')]({},_0x45e0e7,_0x4bc7bd[_0x6de4('0x3a')]);return _0x28db6e[_0x6de4('0x48')](_0x45e0e7);}})['then'](function(_0x80ec2){if(_0x80ec2){_0x3cdcb1=_0x80ec2[_0x6de4('0x31')];if(!_0x4bc7bd['query'][_0x6de4('0x47')](_0x6de4('0x32'))){_0x45e0e7[_0x6de4('0x18')]=qs['limit'](_0x4bc7bd[_0x6de4('0x2b')][_0x6de4('0x18')]);_0x45e0e7['offset']=qs[_0x6de4('0x16')](_0x4bc7bd[_0x6de4('0x2b')][_0x6de4('0x16')]);}return _0x28db6e['getSubjects'](_0x45e0e7);}})[_0x6de4('0x20')](function(_0x5a2561){if(_0x5a2561){return _0x5a2561?{'count':_0x3cdcb1,'rows':_0x5a2561}:null;}})['then'](respondWithResult(_0x52f313,null))[_0x6de4('0x3f')](handleError(_0x52f313,null));};exports[_0x6de4('0x49')]=function(_0x3f0e1a,_0x527066,_0x444576){var _0xa3ff71={};var _0x54d30d={};var _0x4e3aba;var _0x1a01a2;return db[_0x6de4('0x3b')][_0x6de4('0x45')]({'where':{'id':_0x3f0e1a[_0x6de4('0x40')]['id']}})[_0x6de4('0x20')](handleEntityNotFound(_0x527066,null))[_0x6de4('0x20')](function(_0x590712){if(_0x590712){_0x4e3aba=_0x590712;_0x54d30d['model']=_[_0x6de4('0x2c')](db[_0x6de4('0x46')][_0x6de4('0x26')]);_0x54d30d[_0x6de4('0x2b')]=_['keys'](_0x3f0e1a[_0x6de4('0x2b')]);_0x54d30d[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x54d30d['model'],_0x54d30d['query']);_0xa3ff71['attributes']=_[_0x6de4('0x2e')](_0x54d30d[_0x6de4('0x2a')],qs['fields'](_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x30')]));_0xa3ff71['attributes']=_0xa3ff71[_0x6de4('0x2f')]['length']?_0xa3ff71[_0x6de4('0x2f')]:_0x54d30d[_0x6de4('0x2a')];_0xa3ff71[_0x6de4('0x33')]=qs['sort'](_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x34')]);_0xa3ff71[_0x6de4('0x35')]=qs['filters'](_[_0x6de4('0x36')](_0x3f0e1a[_0x6de4('0x2b')],_0x54d30d[_0x6de4('0x2d')]));if(_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x37')]){_0xa3ff71['where']=_[_0x6de4('0x38')](_0xa3ff71[_0x6de4('0x35')],{'$or':_[_0x6de4('0x25')](_0xa3ff71['attributes'],function(_0x2983eb){var _0x1a2fd6={};_0x1a2fd6[_0x2983eb]={'$like':'%'+_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x37')]+'%'};return _0x1a2fd6;})});}_0xa3ff71=_[_0x6de4('0x38')]({},_0xa3ff71,_0x3f0e1a['options']);return _0x4e3aba[_0x6de4('0x49')](_0xa3ff71);}})[_0x6de4('0x20')](function(_0xce5c10){if(_0xce5c10){_0x1a01a2=_0xce5c10[_0x6de4('0x31')];if(!_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x47')](_0x6de4('0x32'))){_0xa3ff71[_0x6de4('0x18')]=qs[_0x6de4('0x18')](_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x18')]);_0xa3ff71[_0x6de4('0x16')]=qs['offset'](_0x3f0e1a[_0x6de4('0x2b')][_0x6de4('0x16')]);}return _0x4e3aba[_0x6de4('0x49')](_0xa3ff71);}})[_0x6de4('0x20')](function(_0x1c5a15){if(_0x1c5a15){return _0x1c5a15?{'count':_0x1a01a2,'rows':_0x1c5a15}:null;}})[_0x6de4('0x20')](respondWithResult(_0x527066,null))[_0x6de4('0x3f')](handleError(_0x527066,null));};exports[_0x6de4('0x4a')]=function(_0x54542d,_0xa2cce6,_0xecb3d4){var _0x227e3a={};var _0x3403f9={};var _0x546d26;var _0x10c4f2;return db[_0x6de4('0x3b')][_0x6de4('0x45')]({'where':{'id':_0x54542d[_0x6de4('0x40')]['id']}})[_0x6de4('0x20')](handleEntityNotFound(_0xa2cce6,null))[_0x6de4('0x20')](function(_0x46b751){if(_0x46b751){_0x546d26=_0x46b751;_0x3403f9['model']=_['keys'](db[_0x6de4('0x4b')][_0x6de4('0x26')]);_0x3403f9[_0x6de4('0x2b')]=_[_0x6de4('0x2c')](_0x54542d[_0x6de4('0x2b')]);_0x3403f9[_0x6de4('0x2d')]=_[_0x6de4('0x2e')](_0x3403f9[_0x6de4('0x2a')],_0x3403f9['query']);_0x227e3a[_0x6de4('0x2f')]=_['intersection'](_0x3403f9['model'],qs[_0x6de4('0x30')](_0x54542d[_0x6de4('0x2b')][_0x6de4('0x30')]));_0x227e3a[_0x6de4('0x2f')]=_0x227e3a[_0x6de4('0x2f')][_0x6de4('0x31')]?_0x227e3a['attributes']:_0x3403f9[_0x6de4('0x2a')];_0x227e3a[_0x6de4('0x33')]=qs[_0x6de4('0x34')](_0x54542d[_0x6de4('0x2b')][_0x6de4('0x34')]);_0x227e3a['where']=qs[_0x6de4('0x2d')](_[_0x6de4('0x36')](_0x54542d['query'],_0x3403f9[_0x6de4('0x2d')]));if(_0x54542d['query'][_0x6de4('0x37')]){_0x227e3a[_0x6de4('0x35')]=_['merge'](_0x227e3a['where'],{'$or':_[_0x6de4('0x25')](_0x227e3a[_0x6de4('0x2f')],function(_0x2b4d5b){var _0xcb4b4a={};_0xcb4b4a[_0x2b4d5b]={'$like':'%'+_0x54542d[_0x6de4('0x2b')][_0x6de4('0x37')]+'%'};return _0xcb4b4a;})});}_0x227e3a=_['merge']({},_0x227e3a,_0x54542d[_0x6de4('0x3a')]);return _0x546d26[_0x6de4('0x4a')](_0x227e3a);}})[_0x6de4('0x20')](function(_0x294741){if(_0x294741){_0x10c4f2=_0x294741[_0x6de4('0x31')];if(!_0x54542d[_0x6de4('0x2b')][_0x6de4('0x47')]('nolimit')){_0x227e3a[_0x6de4('0x18')]=qs[_0x6de4('0x18')](_0x54542d[_0x6de4('0x2b')][_0x6de4('0x18')]);_0x227e3a['offset']=qs[_0x6de4('0x16')](_0x54542d[_0x6de4('0x2b')][_0x6de4('0x16')]);}return _0x546d26[_0x6de4('0x4a')](_0x227e3a);}})[_0x6de4('0x20')](function(_0xb95078){if(_0xb95078){return _0xb95078?{'count':_0x10c4f2,'rows':_0xb95078}:null;}})[_0x6de4('0x20')](respondWithResult(_0xa2cce6,null))[_0x6de4('0x3f')](handleError(_0xa2cce6,null));};exports[_0x6de4('0x4c')]=function(_0x322061,_0x37bcb5,_0x1d5922){if(_0x322061['body']['id']){delete _0x322061[_0x6de4('0x43')]['id'];}return db[_0x6de4('0x3b')][_0x6de4('0x45')]({'where':{'id':_0x322061[_0x6de4('0x40')]['id']}})[_0x6de4('0x20')](handleEntityNotFound(_0x37bcb5,null))[_0x6de4('0x20')](function(_0x21b918){if(_0x21b918){return _0x21b918[_0x6de4('0x4c')](_0x322061[_0x6de4('0x43')][_0x6de4('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x37bcb5,null))[_0x6de4('0x3f')](handleError(_0x37bcb5,null));}; \ No newline at end of file +var _0xd2b8=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','body','update','getFields','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf'];(function(_0x1c6570,_0x1ec401){var _0x331bbe=function(_0x18cd85){while(--_0x18cd85){_0x1c6570['push'](_0x1c6570['shift']());}};_0x331bbe(++_0x1ec401);}(_0xd2b8,0xf7));var _0x8d2b=function(_0x4f7468,_0x2225e7){_0x4f7468=_0x4f7468-0x0;var _0x44e6b3=_0xd2b8[_0x4f7468];return _0x44e6b3;};'use strict';var emlformat=require(_0x8d2b('0x0'));var rimraf=require(_0x8d2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d2b('0x2'));var rp=require(_0x8d2b('0x3'));var moment=require(_0x8d2b('0x4'));var BPromise=require(_0x8d2b('0x5'));var Mustache=require(_0x8d2b('0x6'));var util=require('util');var path=require(_0x8d2b('0x7'));var sox=require('sox');var csv=require(_0x8d2b('0x8'));var ejs=require(_0x8d2b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d2b('0xa'));var squel=require(_0x8d2b('0xb'));var crypto=require(_0x8d2b('0xc'));var jsforce=require(_0x8d2b('0xd'));var deskjs=require(_0x8d2b('0xe'));var toCsv=require(_0x8d2b('0x8'));var querystring=require('querystring');var Papa=require(_0x8d2b('0xf'));var Redis=require('ioredis');var authService=require(_0x8d2b('0x10'));var qs=require(_0x8d2b('0x11'));var as=require(_0x8d2b('0x12'));var hardwareService=require(_0x8d2b('0x13'));var logger=require(_0x8d2b('0x14'))(_0x8d2b('0x15'));var utils=require('../../config/utils');var config=require(_0x8d2b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f5594,_0x417812){_0x417812=_0x417812||0xcc;return function(_0x26d4df){if(_0x26d4df){return _0x5f5594[_0x8d2b('0x17')](_0x417812);}return _0x5f5594['status'](_0x417812)['end']();};}function respondWithResult(_0xfb3286,_0x56c5ac){_0x56c5ac=_0x56c5ac||0xc8;return function(_0x1aa50){if(_0x1aa50){return _0xfb3286[_0x8d2b('0x18')](_0x56c5ac)[_0x8d2b('0x19')](_0x1aa50);}};}function respondWithFilteredResult(_0x102410,_0x3b7407){return function(_0x133202){if(_0x133202){var _0xd00505=typeof _0x3b7407[_0x8d2b('0x1a')]===_0x8d2b('0x1b')&&typeof _0x3b7407[_0x8d2b('0x1c')]==='undefined';var _0xd95887=_0x133202[_0x8d2b('0x1d')];var _0x1105d7=_0xd00505?0x0:_0x3b7407[_0x8d2b('0x1a')];var _0x4e6d1f=_0xd00505?_0x133202[_0x8d2b('0x1d')]:_0x3b7407[_0x8d2b('0x1a')]+_0x3b7407[_0x8d2b('0x1c')];var _0x324e70;if(_0x4e6d1f>=_0xd95887){_0x4e6d1f=_0xd95887;_0x324e70=0xc8;}else{_0x324e70=0xce;}_0x102410[_0x8d2b('0x18')](_0x324e70);return _0x102410['set'](_0x8d2b('0x1e'),_0x1105d7+'-'+_0x4e6d1f+'/'+_0xd95887)[_0x8d2b('0x19')](_0x133202);}return null;};}function patchUpdates(_0x524c80){return function(_0x4c1f7d){try{jsonpatch[_0x8d2b('0x1f')](_0x4c1f7d,_0x524c80,!![]);}catch(_0x33c371){return BPromise[_0x8d2b('0x20')](_0x33c371);}return _0x4c1f7d[_0x8d2b('0x21')]();};}function saveUpdates(_0x20760d,_0x132435){return function(_0x51afac){if(_0x51afac){return _0x51afac['update'](_0x20760d)[_0x8d2b('0x22')](function(_0x1092a8){return _0x1092a8;});}return null;};}function removeEntity(_0x520293,_0x2e04f5){return function(_0x15e9b9){if(_0x15e9b9){return _0x15e9b9[_0x8d2b('0x23')]()['then'](function(){_0x520293['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x566135,_0xdf7b64){return function(_0x5428fa){if(!_0x5428fa){_0x566135[_0x8d2b('0x17')](0x194);}return _0x5428fa;};}function handleError(_0x1c00e6,_0xb8976){_0xb8976=_0xb8976||0x1f4;return function(_0x513018){logger[_0x8d2b('0x24')](_0x513018[_0x8d2b('0x25')]);if(_0x513018[_0x8d2b('0x26')]){delete _0x513018[_0x8d2b('0x26')];}_0x1c00e6['status'](_0xb8976)[_0x8d2b('0x27')](_0x513018);};}exports[_0x8d2b('0x28')]=function(_0x392690,_0x494689){var _0x218920={},_0x182e2e={},_0x519a67={'count':0x0,'rows':[]};var _0x244c33=_[_0x8d2b('0x29')](db[_0x8d2b('0x2a')]['rawAttributes'],function(_0x37a9fa){return{'name':_0x37a9fa[_0x8d2b('0x2b')],'type':_0x37a9fa['type'][_0x8d2b('0x2c')]};});_0x182e2e[_0x8d2b('0x2d')]=_[_0x8d2b('0x29')](_0x244c33,'name');_0x182e2e[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x392690[_0x8d2b('0x2e')]);_0x182e2e[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x182e2e['model'],_0x182e2e[_0x8d2b('0x2e')]);_0x218920[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x182e2e[_0x8d2b('0x2d')],qs['fields'](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x218920['attributes']=_0x218920['attributes'][_0x8d2b('0x34')]?_0x218920[_0x8d2b('0x32')]:_0x182e2e[_0x8d2b('0x2d')];if(!_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x218920[_0x8d2b('0x1c')]=qs[_0x8d2b('0x1c')](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x218920[_0x8d2b('0x1a')]=qs['offset'](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}_0x218920[_0x8d2b('0x37')]=qs[_0x8d2b('0x38')](_0x392690[_0x8d2b('0x2e')]['sort']);_0x218920[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x392690[_0x8d2b('0x2e')],_0x182e2e[_0x8d2b('0x30')]),_0x244c33);if(_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x218920[_0x8d2b('0x39')]=_['merge'](_0x218920['where'],{'$or':_['map'](_0x244c33,function(_0xbbbcb2){if(_0xbbbcb2[_0x8d2b('0x3c')]!==_0x8d2b('0x3d')){var _0x334a06={};_0x334a06[_0xbbbcb2[_0x8d2b('0x26')]]={'$like':'%'+_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x334a06;}})});}_0x218920=_['merge']({},_0x218920,_0x392690[_0x8d2b('0x3e')]);var _0x34b43d={'where':_0x218920[_0x8d2b('0x39')]};return db[_0x8d2b('0x2a')][_0x8d2b('0x1d')](_0x34b43d)[_0x8d2b('0x22')](function(_0x1358e5){_0x519a67[_0x8d2b('0x1d')]=_0x1358e5;if(_0x392690['query'][_0x8d2b('0x3f')]){_0x218920[_0x8d2b('0x40')]=[{'all':!![]}];}return db[_0x8d2b('0x2a')][_0x8d2b('0x41')](_0x218920);})[_0x8d2b('0x22')](function(_0x149cb6){_0x519a67[_0x8d2b('0x42')]=_0x149cb6;return _0x519a67;})[_0x8d2b('0x22')](respondWithFilteredResult(_0x494689,_0x218920))[_0x8d2b('0x43')](handleError(_0x494689,null));};exports[_0x8d2b('0x44')]=function(_0x3ab563,_0x207313){var _0x28f0dc={'raw':![],'where':{'id':_0x3ab563[_0x8d2b('0x45')]['id']}},_0x2e23d9={};_0x2e23d9[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x2a')][_0x8d2b('0x46')]);_0x2e23d9[_0x8d2b('0x2e')]=_['keys'](_0x3ab563[_0x8d2b('0x2e')]);_0x2e23d9[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x2e23d9[_0x8d2b('0x2d')],_0x2e23d9[_0x8d2b('0x2e')]);_0x28f0dc[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x2e23d9[_0x8d2b('0x2d')],qs['fields'](_0x3ab563[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x28f0dc[_0x8d2b('0x32')]=_0x28f0dc[_0x8d2b('0x32')]['length']?_0x28f0dc[_0x8d2b('0x32')]:_0x2e23d9[_0x8d2b('0x2d')];if(_0x3ab563['query'][_0x8d2b('0x3f')]){_0x28f0dc[_0x8d2b('0x40')]=[{'all':!![]}];}_0x28f0dc=_[_0x8d2b('0x47')]({},_0x28f0dc,_0x3ab563[_0x8d2b('0x3e')]);return db[_0x8d2b('0x2a')][_0x8d2b('0x48')](_0x28f0dc)['then'](handleEntityNotFound(_0x207313,null))[_0x8d2b('0x22')](respondWithResult(_0x207313,null))[_0x8d2b('0x43')](handleError(_0x207313,null));};exports['create']=function(_0x20d0d8,_0x4d57df){return db[_0x8d2b('0x2a')]['create'](_0x20d0d8[_0x8d2b('0x49')],{})[_0x8d2b('0x22')](respondWithResult(_0x4d57df,0xc9))[_0x8d2b('0x43')](handleError(_0x4d57df,null));};exports[_0x8d2b('0x4a')]=function(_0x38223b,_0x5002ba){if(_0x38223b[_0x8d2b('0x49')]['id']){delete _0x38223b[_0x8d2b('0x49')]['id'];}return db[_0x8d2b('0x2a')]['find']({'where':{'id':_0x38223b['params']['id']}})['then'](handleEntityNotFound(_0x5002ba,null))[_0x8d2b('0x22')](saveUpdates(_0x38223b['body'],null))[_0x8d2b('0x22')](respondWithResult(_0x5002ba,null))['catch'](handleError(_0x5002ba,null));};exports['destroy']=function(_0x5334cb,_0x433e21){return db[_0x8d2b('0x2a')][_0x8d2b('0x48')]({'where':{'id':_0x5334cb[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x433e21,null))[_0x8d2b('0x22')](removeEntity(_0x433e21,null))[_0x8d2b('0x43')](handleError(_0x433e21,null));};exports[_0x8d2b('0x4b')]=function(_0x535a5b,_0x129230,_0xcc4fcb){var _0x49677e={};var _0x233332={};var _0x1b6106;var _0x4e6e99;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x535a5b[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x129230,null))[_0x8d2b('0x22')](function(_0x4aba6d){if(_0x4aba6d){_0x1b6106=_0x4aba6d;_0x233332[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db['FreshdeskField'][_0x8d2b('0x46')]);_0x233332[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x535a5b[_0x8d2b('0x2e')]);_0x233332[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x233332[_0x8d2b('0x2d')],_0x233332['query']);_0x49677e[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x233332[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x49677e['attributes']=_0x49677e[_0x8d2b('0x32')][_0x8d2b('0x34')]?_0x49677e[_0x8d2b('0x32')]:_0x233332[_0x8d2b('0x2d')];_0x49677e['order']=qs[_0x8d2b('0x38')](_0x535a5b[_0x8d2b('0x2e')]['sort']);_0x49677e[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_['pick'](_0x535a5b[_0x8d2b('0x2e')],_0x233332[_0x8d2b('0x30')]));if(_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x49677e[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x49677e['where'],{'$or':_['map'](_0x49677e[_0x8d2b('0x32')],function(_0x503da6){var _0x55397a={};_0x55397a[_0x503da6]={'$like':'%'+_0x535a5b[_0x8d2b('0x2e')]['filter']+'%'};return _0x55397a;})});}_0x49677e=_[_0x8d2b('0x47')]({},_0x49677e,_0x535a5b[_0x8d2b('0x3e')]);return _0x1b6106[_0x8d2b('0x4b')](_0x49677e);}})['then'](function(_0xbe90e9){if(_0xbe90e9){_0x4e6e99=_0xbe90e9[_0x8d2b('0x34')];if(!_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x49677e['limit']=qs[_0x8d2b('0x1c')](_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x49677e['offset']=qs[_0x8d2b('0x1a')](_0x535a5b[_0x8d2b('0x2e')]['offset']);}return _0x1b6106[_0x8d2b('0x4b')](_0x49677e);}})['then'](function(_0x1c167b){if(_0x1c167b){return _0x1c167b?{'count':_0x4e6e99,'rows':_0x1c167b}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x129230,null))[_0x8d2b('0x43')](handleError(_0x129230,null));};exports[_0x8d2b('0x4d')]=function(_0x545782,_0x55800f,_0x18464f){var _0x31a4fb={};var _0x58c18a={};var _0x6fb3d;var _0x194ede;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x545782[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x55800f,null))[_0x8d2b('0x22')](function(_0x6b0413){if(_0x6b0413){_0x6fb3d=_0x6b0413;_0x58c18a[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x4e')]['rawAttributes']);_0x58c18a['query']=_[_0x8d2b('0x2f')](_0x545782['query']);_0x58c18a[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x58c18a[_0x8d2b('0x2d')],_0x58c18a[_0x8d2b('0x2e')]);_0x31a4fb[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x58c18a[_0x8d2b('0x2d')],qs['fields'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x31a4fb[_0x8d2b('0x32')]=_0x31a4fb['attributes'][_0x8d2b('0x34')]?_0x31a4fb[_0x8d2b('0x32')]:_0x58c18a['model'];_0x31a4fb[_0x8d2b('0x37')]=qs['sort'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x38')]);_0x31a4fb[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x545782['query'],_0x58c18a[_0x8d2b('0x30')]));if(_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x31a4fb[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x31a4fb[_0x8d2b('0x39')],{'$or':_['map'](_0x31a4fb[_0x8d2b('0x32')],function(_0x2979b4){var _0x527c7f={};_0x527c7f[_0x2979b4]={'$like':'%'+_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x527c7f;})});}_0x31a4fb=_[_0x8d2b('0x47')]({},_0x31a4fb,_0x545782[_0x8d2b('0x3e')]);return _0x6fb3d[_0x8d2b('0x4d')](_0x31a4fb);}})[_0x8d2b('0x22')](function(_0x1cf6cc){if(_0x1cf6cc){_0x194ede=_0x1cf6cc[_0x8d2b('0x34')];if(!_0x545782['query'][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x31a4fb['limit']=qs['limit'](_0x545782['query'][_0x8d2b('0x1c')]);_0x31a4fb[_0x8d2b('0x1a')]=qs['offset'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}return _0x6fb3d[_0x8d2b('0x4d')](_0x31a4fb);}})[_0x8d2b('0x22')](function(_0xf3429d){if(_0xf3429d){return _0xf3429d?{'count':_0x194ede,'rows':_0xf3429d}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x55800f,null))[_0x8d2b('0x43')](handleError(_0x55800f,null));};exports['getDescriptions']=function(_0x3c1bc1,_0x1b4368,_0x1388e9){var _0x192e7e={};var _0x17d057={};var _0x41ebeb;var _0xba753a;return db['FreshdeskConfiguration'][_0x8d2b('0x4c')]({'where':{'id':_0x3c1bc1[_0x8d2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b4368,null))[_0x8d2b('0x22')](function(_0x58b246){if(_0x58b246){_0x41ebeb=_0x58b246;_0x17d057[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x4e')][_0x8d2b('0x46')]);_0x17d057[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x3c1bc1[_0x8d2b('0x2e')]);_0x17d057[_0x8d2b('0x30')]=_['intersection'](_0x17d057[_0x8d2b('0x2d')],_0x17d057[_0x8d2b('0x2e')]);_0x192e7e[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x17d057[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x192e7e[_0x8d2b('0x32')]=_0x192e7e[_0x8d2b('0x32')][_0x8d2b('0x34')]?_0x192e7e[_0x8d2b('0x32')]:_0x17d057['model'];_0x192e7e[_0x8d2b('0x37')]=qs['sort'](_0x3c1bc1['query'][_0x8d2b('0x38')]);_0x192e7e['where']=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x3c1bc1['query'],_0x17d057[_0x8d2b('0x30')]));if(_0x3c1bc1['query']['filter']){_0x192e7e[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x192e7e[_0x8d2b('0x39')],{'$or':_[_0x8d2b('0x29')](_0x192e7e[_0x8d2b('0x32')],function(_0x2788c4){var _0x3281a8={};_0x3281a8[_0x2788c4]={'$like':'%'+_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x3281a8;})});}_0x192e7e=_[_0x8d2b('0x47')]({},_0x192e7e,_0x3c1bc1[_0x8d2b('0x3e')]);return _0x41ebeb[_0x8d2b('0x4f')](_0x192e7e);}})[_0x8d2b('0x22')](function(_0x4c8258){if(_0x4c8258){_0xba753a=_0x4c8258['length'];if(!_0x3c1bc1[_0x8d2b('0x2e')]['hasOwnProperty'](_0x8d2b('0x36'))){_0x192e7e[_0x8d2b('0x1c')]=qs['limit'](_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x192e7e[_0x8d2b('0x1a')]=qs['offset'](_0x3c1bc1['query']['offset']);}return _0x41ebeb['getDescriptions'](_0x192e7e);}})['then'](function(_0x6d04a5){if(_0x6d04a5){return _0x6d04a5?{'count':_0xba753a,'rows':_0x6d04a5}:null;}})['then'](respondWithResult(_0x1b4368,null))[_0x8d2b('0x43')](handleError(_0x1b4368,null));};exports[_0x8d2b('0x50')]=function(_0x4f2b1d,_0x4e1af4,_0x5120c2){var _0x42726d={};var _0x59ed7e={};var _0x290c4b;var _0x5c44e2;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x4f2b1d[_0x8d2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e1af4,null))[_0x8d2b('0x22')](function(_0x589817){if(_0x589817){_0x290c4b=_0x589817;_0x59ed7e[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db['Tag'][_0x8d2b('0x46')]);_0x59ed7e[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x4f2b1d[_0x8d2b('0x2e')]);_0x59ed7e[_0x8d2b('0x30')]=_['intersection'](_0x59ed7e[_0x8d2b('0x2d')],_0x59ed7e['query']);_0x42726d['attributes']=_[_0x8d2b('0x31')](_0x59ed7e[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x42726d[_0x8d2b('0x32')]=_0x42726d[_0x8d2b('0x32')]['length']?_0x42726d['attributes']:_0x59ed7e[_0x8d2b('0x2d')];_0x42726d[_0x8d2b('0x37')]=qs[_0x8d2b('0x38')](_0x4f2b1d[_0x8d2b('0x2e')]['sort']);_0x42726d['where']=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x4f2b1d[_0x8d2b('0x2e')],_0x59ed7e[_0x8d2b('0x30')]));if(_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x42726d[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x42726d[_0x8d2b('0x39')],{'$or':_['map'](_0x42726d[_0x8d2b('0x32')],function(_0x31d46d){var _0x53e834={};_0x53e834[_0x31d46d]={'$like':'%'+_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x53e834;})});}_0x42726d=_[_0x8d2b('0x47')]({},_0x42726d,_0x4f2b1d[_0x8d2b('0x3e')]);return _0x290c4b['getTags'](_0x42726d);}})['then'](function(_0x2e02ea){if(_0x2e02ea){_0x5c44e2=_0x2e02ea[_0x8d2b('0x34')];if(!_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x42726d[_0x8d2b('0x1c')]=qs['limit'](_0x4f2b1d['query'][_0x8d2b('0x1c')]);_0x42726d[_0x8d2b('0x1a')]=qs[_0x8d2b('0x1a')](_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}return _0x290c4b[_0x8d2b('0x50')](_0x42726d);}})[_0x8d2b('0x22')](function(_0x486cbd){if(_0x486cbd){return _0x486cbd?{'count':_0x5c44e2,'rows':_0x486cbd}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x4e1af4,null))[_0x8d2b('0x43')](handleError(_0x4e1af4,null));};exports[_0x8d2b('0x51')]=function(_0xedeb,_0x3c32f4,_0x43a14c){if(_0xedeb['body']['id']){delete _0xedeb['body']['id'];}return db['FreshdeskConfiguration'][_0x8d2b('0x4c')]({'where':{'id':_0xedeb[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x3c32f4,null))[_0x8d2b('0x22')](function(_0x5eaeb9){if(_0x5eaeb9){return _0x5eaeb9[_0x8d2b('0x51')](_0xedeb[_0x8d2b('0x49')][_0x8d2b('0x52')]||[]);}return null;})[_0x8d2b('0x22')](respondWithResult(_0x3c32f4,null))['catch'](handleError(_0x3c32f4,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3e377c3..9d5280b 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 _0x0a6a=['util','../../config/logger','api','bluebird','path','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x4418d8,_0x3c6083){var _0x354564=function(_0x5b6e04){while(--_0x5b6e04){_0x4418d8['push'](_0x4418d8['shift']());}};_0x354564(++_0x3c6083);}(_0x0a6a,0x1a3));var _0xa0a6=function(_0x5e9590,_0x390b30){_0x5e9590=_0x5e9590-0x0;var _0x3d0ecd=_0x0a6a[_0x5e9590];return _0x3d0ecd;};'use strict';var _=require(_0xa0a6('0x0'));var util=require(_0xa0a6('0x1'));var logger=require(_0xa0a6('0x2'))(_0xa0a6('0x3'));var moment=require('moment');var BPromise=require(_0xa0a6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0a6('0x5'));var rimraf=require('rimraf');var config=require(_0xa0a6('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x18e666,_0x50debf){return _0x18e666[_0xa0a6('0x7')](_0xa0a6('0x8'),attributes,{'tableName':_0xa0a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6c6=['path','rimraf','../../config/environment','exports','int_freshdesk_configurations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x36e8bc,_0x35a0b4){var _0x4071ef=function(_0x404637){while(--_0x404637){_0x36e8bc['push'](_0x36e8bc['shift']());}};_0x4071ef(++_0x35a0b4);}(_0xe6c6,0x18b));var _0x6e6c=function(_0x458fc0,_0x3e7a67){_0x458fc0=_0x458fc0-0x0;var _0x3cc021=_0xe6c6[_0x458fc0];return _0x3cc021;};'use strict';var _=require(_0x6e6c('0x0'));var util=require('util');var logger=require(_0x6e6c('0x1'))(_0x6e6c('0x2'));var moment=require('moment');var BPromise=require(_0x6e6c('0x3'));var rp=require(_0x6e6c('0x4'));var fs=require('fs');var path=require(_0x6e6c('0x5'));var rimraf=require(_0x6e6c('0x6'));var config=require(_0x6e6c('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6e6c('0x8')]=function(_0x1b4280,_0x42884f){return _0x1b4280['define']('FreshdeskConfiguration',attributes,{'tableName':_0x6e6c('0x9'),'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 e6f1aa3..0644947 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 _0xc88b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a0d36,_0x217d02){var _0x815f2a=function(_0x1b0850){while(--_0x1b0850){_0x3a0d36['push'](_0x3a0d36['shift']());}};_0x815f2a(++_0x217d02);}(_0xc88b,0x143));var _0xbc88=function(_0x2e1adb,_0x2f8a5f){_0x2e1adb=_0x2e1adb-0x0;var _0x4d981f=_0xc88b[_0x2e1adb];return _0x4d981f;};'use strict';var _=require(_0xbc88('0x0'));var util=require(_0xbc88('0x1'));var moment=require(_0xbc88('0x2'));var BPromise=require(_0xbc88('0x3'));var rs=require(_0xbc88('0x4'));var fs=require('fs');var Redis=require(_0xbc88('0x5'));var db=require(_0xbc88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc88('0x7'))(_0xbc88('0x8'));var config=require(_0xbc88('0x9'));var jayson=require(_0xbc88('0xa'));var client=jayson[_0xbc88('0xb')][_0xbc88('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e5af7,_0x346224,_0x5380d5){return new BPromise(function(_0x2cc4ab,_0x2a7efa){return client['request'](_0x3e5af7,_0x5380d5)[_0xbc88('0xd')](function(_0x250a4b){logger[_0xbc88('0xe')](_0xbc88('0xf'),_0x346224,_0xbc88('0x10'));logger['debug'](_0xbc88('0x11'),_0x346224,_0xbc88('0x10'),JSON[_0xbc88('0x12')](_0x250a4b));if(_0x250a4b[_0xbc88('0x13')]){if(_0x250a4b[_0xbc88('0x13')]['code']===0x1f4){logger['error'](_0xbc88('0xf'),_0x346224,_0x250a4b[_0xbc88('0x13')]['message']);return _0x2a7efa(_0x250a4b[_0xbc88('0x13')][_0xbc88('0x14')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x346224,_0x250a4b['error'][_0xbc88('0x14')]);return _0x2cc4ab(_0x250a4b[_0xbc88('0x13')][_0xbc88('0x14')]);}else{logger[_0xbc88('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x346224,_0xbc88('0x10'));_0x2cc4ab(_0x250a4b['result'][_0xbc88('0x14')]);}})[_0xbc88('0x15')](function(_0x27f1e3){logger['error'](_0xbc88('0xf'),_0x346224,_0x27f1e3);_0x2a7efa(_0x27f1e3);});});} \ No newline at end of file +var _0x61af=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xfc2ee,_0x4882f8){var _0x493371=function(_0x14e72b){while(--_0x14e72b){_0xfc2ee['push'](_0xfc2ee['shift']());}};_0x493371(++_0x4882f8);}(_0x61af,0x80));var _0xf61a=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x61af[_0x295a3d];return _0x23a732;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf61a('0x0'));var BPromise=require(_0xf61a('0x1'));var rs=require(_0xf61a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf61a('0x3'));var logger=require(_0xf61a('0x4'))(_0xf61a('0x5'));var config=require(_0xf61a('0x6'));var jayson=require(_0xf61a('0x7'));var client=jayson[_0xf61a('0x8')][_0xf61a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ed2a,_0x225dd5,_0x57cadb){return new BPromise(function(_0x204433,_0x3e83f8){return client[_0xf61a('0xa')](_0x13ed2a,_0x57cadb)['then'](function(_0x4e8737){logger[_0xf61a('0xb')](_0xf61a('0xc'),_0x225dd5,_0xf61a('0xd'));logger[_0xf61a('0xe')](_0xf61a('0xf'),_0x225dd5,_0xf61a('0xd'),JSON[_0xf61a('0x10')](_0x4e8737));if(_0x4e8737[_0xf61a('0x11')]){if(_0x4e8737['error'][_0xf61a('0x12')]===0x1f4){logger[_0xf61a('0x11')](_0xf61a('0xc'),_0x225dd5,_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);return _0x3e83f8(_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);}logger[_0xf61a('0x11')](_0xf61a('0xc'),_0x225dd5,_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);return _0x204433(_0x4e8737['error'][_0xf61a('0x13')]);}else{logger[_0xf61a('0xb')](_0xf61a('0xc'),_0x225dd5,_0xf61a('0xd'));_0x204433(_0x4e8737[_0xf61a('0x14')][_0xf61a('0x13')]);}})[_0xf61a('0x15')](function(_0x2c7ae6){logger[_0xf61a('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x225dd5,_0x2c7ae6);_0x3e83f8(_0x2c7ae6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3c5df49..85fcf0b 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 _0xdf3c=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','Router'];(function(_0x34ad4f,_0x3b9428){var _0x1a868f=function(_0x1c8194){while(--_0x1c8194){_0x34ad4f['push'](_0x34ad4f['shift']());}};_0x1a868f(++_0x3b9428);}(_0xdf3c,0x7d));var _0xcdf3=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xdf3c[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xcdf3('0x0'));var util=require(_0xcdf3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdf3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcdf3('0x3'));var interaction=require(_0xcdf3('0x4'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0xcdf3('0x5')]('/',auth['isAuthenticated'](),controller[_0xcdf3('0x6')]);router[_0xcdf3('0x5')](_0xcdf3('0x7'),auth[_0xcdf3('0x8')](),controller[_0xcdf3('0x9')]);router[_0xcdf3('0xa')]('/',auth[_0xcdf3('0x8')](),controller[_0xcdf3('0xb')]);router[_0xcdf3('0xc')](_0xcdf3('0x7'),auth[_0xcdf3('0x8')](),controller[_0xcdf3('0xd')]);router['delete'](_0xcdf3('0x7'),auth['isAuthenticated'](),controller[_0xcdf3('0xe')]);module[_0xcdf3('0xf')]=router; \ No newline at end of file +var _0xebee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xebee,0x1d7));var _0xeebe=function(_0xd8c450,_0x1a43a6){_0xd8c450=_0xd8c450-0x0;var _0x160797=_0xebee[_0xd8c450];return _0x160797;};'use strict';var multer=require(_0xeebe('0x0'));var util=require('util');var path=require(_0xeebe('0x1'));var timeout=require(_0xeebe('0x2'));var express=require(_0xeebe('0x3'));var router=express[_0xeebe('0x4')]();var fs_extra=require(_0xeebe('0x5'));var auth=require(_0xeebe('0x6'));var interaction=require(_0xeebe('0x7'));var config=require('../../config/environment');var controller=require(_0xeebe('0x8'));router[_0xeebe('0x9')]('/',auth[_0xeebe('0xa')](),controller[_0xeebe('0xb')]);router[_0xeebe('0x9')](_0xeebe('0xc'),auth['isAuthenticated'](),controller[_0xeebe('0xd')]);router['post']('/',auth[_0xeebe('0xa')](),controller[_0xeebe('0xe')]);router['put'](_0xeebe('0xc'),auth['isAuthenticated'](),controller[_0xeebe('0xf')]);router[_0xeebe('0x10')](_0xeebe('0xc'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x11')]);module[_0xeebe('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 9423b0a..337115c 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 _0xb965=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xb965,0x68));var _0x5b96=function(_0x290232,_0x225df1){_0x290232=_0x290232-0x0;var _0x52572c=_0xb965[_0x290232];return _0x52572c;};'use strict';var Sequelize=require(_0x5b96('0x0'));module[_0x5b96('0x1')]={'type':{'type':Sequelize[_0x5b96('0x2')]('string',_0x5b96('0x3'),_0x5b96('0x4'),_0x5b96('0x5'),_0x5b96('0x6')),'defaultValue':_0x5b96('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5b96('0x8')]},'keyType':{'type':Sequelize[_0x5b96('0x2')](_0x5b96('0x7'),'variable',_0x5b96('0x4'))},'keyContent':{'type':Sequelize[_0x5b96('0x8')]},'idField':{'type':Sequelize[_0x5b96('0x8')]},'nameField':{'type':Sequelize[_0x5b96('0x8')]},'customField':{'type':Sequelize[_0x5b96('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5b96('0x8')]}}; \ No newline at end of file +var _0x4d4a=['sequelize','exports','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5b98b6,_0xfd2b69){var _0x2d4242=function(_0x4d7947){while(--_0x4d7947){_0x5b98b6['push'](_0x5b98b6['shift']());}};_0x2d4242(++_0xfd2b69);}(_0x4d4a,0x1b0));var _0xa4d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d4a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa4d4('0x0'));module[_0xa4d4('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa4d4('0x2'),_0xa4d4('0x3'),_0xa4d4('0x4'),_0xa4d4('0x5'),'picklist'),'defaultValue':_0xa4d4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa4d4('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa4d4('0x2'),_0xa4d4('0x3'),_0xa4d4('0x4'))},'keyContent':{'type':Sequelize[_0xa4d4('0x6')]},'idField':{'type':Sequelize[_0xa4d4('0x6')]},'nameField':{'type':Sequelize[_0xa4d4('0x6')]},'customField':{'type':Sequelize[_0xa4d4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index b6e7165..5a97c8d 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 _0x13f6=['filter','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','create','body','find','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','name','send','map','FreshdeskField','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL'];(function(_0x1b55e8,_0x26f6ce){var _0x58244b=function(_0x495d51){while(--_0x495d51){_0x1b55e8['push'](_0x1b55e8['shift']());}};_0x58244b(++_0x26f6ce);}(_0x13f6,0x124));var _0x613f=function(_0x476b8b,_0x1ce6d9){_0x476b8b=_0x476b8b-0x0;var _0x30f928=_0x13f6[_0x476b8b];return _0x30f928;};'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(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['index']=function(_0x121241,_0x2551c1){var _0x4c8aa1={},_0x4cff5d={},_0x4f892d={'count':0x0,'rows':[]};var _0x24be7c=_[_0x613f('0x27')](db[_0x613f('0x28')]['rawAttributes'],function(_0x23eda8){return{'name':_0x23eda8[_0x613f('0x29')],'type':_0x23eda8[_0x613f('0x2a')][_0x613f('0x2b')]};});_0x4cff5d['model']=_[_0x613f('0x27')](_0x24be7c,_0x613f('0x25'));_0x4cff5d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x121241[_0x613f('0x2c')]);_0x4cff5d[_0x613f('0x2e')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],_0x4cff5d[_0x613f('0x2c')]);_0x4c8aa1[_0x613f('0x30')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],qs['fields'](_0x121241[_0x613f('0x2c')][_0x613f('0x31')]));_0x4c8aa1[_0x613f('0x30')]=_0x4c8aa1[_0x613f('0x30')][_0x613f('0x32')]?_0x4c8aa1[_0x613f('0x30')]:_0x4cff5d['model'];if(!_0x121241[_0x613f('0x2c')][_0x613f('0x33')](_0x613f('0x34'))){_0x4c8aa1[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x121241['query']['limit']);_0x4c8aa1['offset']=qs[_0x613f('0x1d')](_0x121241[_0x613f('0x2c')][_0x613f('0x1d')]);}_0x4c8aa1[_0x613f('0x35')]=qs['sort'](_0x121241[_0x613f('0x2c')][_0x613f('0x36')]);_0x4c8aa1['where']=qs[_0x613f('0x2e')](_['pick'](_0x121241[_0x613f('0x2c')],_0x4cff5d['filters']),_0x24be7c);if(_0x121241[_0x613f('0x2c')]['filter']){_0x4c8aa1[_0x613f('0x37')]=_[_0x613f('0x38')](_0x4c8aa1[_0x613f('0x37')],{'$or':_['map'](_0x24be7c,function(_0x36eaa0){if(_0x36eaa0[_0x613f('0x2a')]!==_0x613f('0x39')){var _0x2fb3a6={};_0x2fb3a6[_0x36eaa0[_0x613f('0x25')]]={'$like':'%'+_0x121241[_0x613f('0x2c')][_0x613f('0x3a')]+'%'};return _0x2fb3a6;}})});}_0x4c8aa1=_[_0x613f('0x38')]({},_0x4c8aa1,_0x121241[_0x613f('0x3b')]);var _0x3313c1={'where':_0x4c8aa1['where']};return db[_0x613f('0x28')][_0x613f('0x1c')](_0x3313c1)[_0x613f('0x23')](function(_0x1e5af0){_0x4f892d[_0x613f('0x1c')]=_0x1e5af0;if(_0x121241[_0x613f('0x2c')][_0x613f('0x3c')]){_0x4c8aa1['include']=[{'all':!![]}];}return db[_0x613f('0x28')][_0x613f('0x3d')](_0x4c8aa1);})[_0x613f('0x23')](function(_0x3d2d7b){_0x4f892d[_0x613f('0x3e')]=_0x3d2d7b;return _0x4f892d;})[_0x613f('0x23')](respondWithFilteredResult(_0x2551c1,_0x4c8aa1))[_0x613f('0x3f')](handleError(_0x2551c1,null));};exports['show']=function(_0x343a59,_0x18f427){var _0x3bb605={'raw':!![],'where':{'id':_0x343a59[_0x613f('0x40')]['id']}},_0x2f584e={};_0x2f584e[_0x613f('0x2f')]=_[_0x613f('0x2d')](db[_0x613f('0x28')][_0x613f('0x41')]);_0x2f584e[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x343a59[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x2e')]=_['intersection'](_0x2f584e[_0x613f('0x2f')],_0x2f584e[_0x613f('0x2c')]);_0x3bb605[_0x613f('0x30')]=_[_0x613f('0x42')](_0x2f584e['model'],qs[_0x613f('0x31')](_0x343a59[_0x613f('0x2c')][_0x613f('0x31')]));_0x3bb605[_0x613f('0x30')]=_0x3bb605[_0x613f('0x30')][_0x613f('0x32')]?_0x3bb605[_0x613f('0x30')]:_0x2f584e[_0x613f('0x2f')];if(_0x343a59[_0x613f('0x2c')][_0x613f('0x3c')]){_0x3bb605['include']=[{'all':!![]}];}_0x3bb605=_['merge']({},_0x3bb605,_0x343a59[_0x613f('0x3b')]);return db[_0x613f('0x28')]['find'](_0x3bb605)[_0x613f('0x23')](handleEntityNotFound(_0x18f427,null))[_0x613f('0x23')](respondWithResult(_0x18f427,null))[_0x613f('0x3f')](handleError(_0x18f427,null));};exports[_0x613f('0x43')]=function(_0x39b8b2,_0x1c0b07){return db[_0x613f('0x28')][_0x613f('0x43')](_0x39b8b2[_0x613f('0x44')],{})[_0x613f('0x23')](respondWithResult(_0x1c0b07,0xc9))[_0x613f('0x3f')](handleError(_0x1c0b07,null));};exports[_0x613f('0x22')]=function(_0x174e22,_0x17f8e5){if(_0x174e22[_0x613f('0x44')]['id']){delete _0x174e22[_0x613f('0x44')]['id'];}return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x174e22['params']['id']}})['then'](handleEntityNotFound(_0x17f8e5,null))[_0x613f('0x23')](saveUpdates(_0x174e22[_0x613f('0x44')],null))['then'](respondWithResult(_0x17f8e5,null))['catch'](handleError(_0x17f8e5,null));};exports[_0x613f('0x24')]=function(_0x51729a,_0x513bf1){return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x51729a[_0x613f('0x40')]['id']}})['then'](handleEntityNotFound(_0x513bf1,null))[_0x613f('0x23')](removeEntity(_0x513bf1,null))[_0x613f('0x3f')](handleError(_0x513bf1,null));}; \ No newline at end of file +var _0x1339=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','FreshdeskField','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x1339,0x1ed));var _0x9133=function(_0x584ba1,_0x3093e4){_0x584ba1=_0x584ba1-0x0;var _0x1fc384=_0x1339[_0x584ba1];return _0x1fc384;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f7e83df..634c61d 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 _0xcf66=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskField','lodash','../../config/logger','api'];(function(_0x2b773a,_0x49b97f){var _0x3b7c77=function(_0x1be6d0){while(--_0x1be6d0){_0x2b773a['push'](_0x2b773a['shift']());}};_0x3b7c77(++_0x49b97f);}(_0xcf66,0x110));var _0x6cf6=function(_0x7b0808,_0x1843e9){_0x7b0808=_0x7b0808-0x0;var _0x1f633e=_0xcf66[_0x7b0808];return _0x1f633e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require('util');var logger=require(_0x6cf6('0x1'))(_0x6cf6('0x2'));var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require(_0x6cf6('0x5'));var fs=require('fs');var path=require(_0x6cf6('0x6'));var rimraf=require(_0x6cf6('0x7'));var config=require(_0x6cf6('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x33d550,_0x1f92f4){return _0x33d550[_0x6cf6('0x9')](_0x6cf6('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x500a=['define','FreshdeskField','int_freshdesk_fields','FieldId','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5642bd,_0x5dbcc2){var _0x366ca1=function(_0x15bfdb){while(--_0x15bfdb){_0x5642bd['push'](_0x5642bd['shift']());}};_0x366ca1(++_0x5dbcc2);}(_0x500a,0xd6));var _0xa500=function(_0x4f8045,_0x2b908a){_0x4f8045=_0x4f8045-0x0;var _0x52721a=_0x500a[_0x4f8045];return _0x52721a;};'use strict';var _=require('lodash');var util=require(_0xa500('0x0'));var logger=require('../../config/logger')(_0xa500('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa500('0x2'));var fs=require('fs');var path=require(_0xa500('0x3'));var rimraf=require(_0xa500('0x4'));var config=require(_0xa500('0x5'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x340329,_0x4333a3){return _0x340329[_0xa500('0x6')](_0xa500('0x7'),attributes,{'tableName':_0xa500('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xa500('0x9')],'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 4d1ad5e..b7239d0 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 _0xf078=['request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x1c1798,_0x24812b){var _0x4f235e=function(_0x30028e){while(--_0x30028e){_0x1c1798['push'](_0x1c1798['shift']());}};_0x4f235e(++_0x24812b);}(_0xf078,0x1ea));var _0x8f07=function(_0x3b1b86,_0x367657){_0x3b1b86=_0x3b1b86-0x0;var _0x5da203=_0xf078[_0x3b1b86];return _0x5da203;};'use strict';var _=require(_0x8f07('0x0'));var util=require('util');var moment=require(_0x8f07('0x1'));var BPromise=require(_0x8f07('0x2'));var rs=require(_0x8f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f07('0x4'))['db'];var utils=require(_0x8f07('0x5'));var logger=require(_0x8f07('0x6'))(_0x8f07('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f07('0x8'));var client=jayson[_0x8f07('0x9')][_0x8f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x413da3,_0x513cb8,_0x1d579d){return new BPromise(function(_0xc72e66,_0x56ee4d){return client[_0x8f07('0xb')](_0x413da3,_0x1d579d)['then'](function(_0x38f740){logger[_0x8f07('0xc')](_0x8f07('0xd'),_0x513cb8,_0x8f07('0xe'));logger[_0x8f07('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x513cb8,_0x8f07('0xe'),JSON[_0x8f07('0x10')](_0x38f740));if(_0x38f740[_0x8f07('0x11')]){if(_0x38f740[_0x8f07('0x11')][_0x8f07('0x12')]===0x1f4){logger[_0x8f07('0x11')](_0x8f07('0xd'),_0x513cb8,_0x38f740['error'][_0x8f07('0x13')]);return _0x56ee4d(_0x38f740[_0x8f07('0x11')][_0x8f07('0x13')]);}logger[_0x8f07('0x11')](_0x8f07('0xd'),_0x513cb8,_0x38f740[_0x8f07('0x11')][_0x8f07('0x13')]);return _0xc72e66(_0x38f740[_0x8f07('0x11')][_0x8f07('0x13')]);}else{logger[_0x8f07('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x513cb8,'request\x20sent');_0xc72e66(_0x38f740[_0x8f07('0x14')]['message']);}})['catch'](function(_0x13b63e){logger[_0x8f07('0x11')](_0x8f07('0xd'),_0x513cb8,_0x13b63e);_0x56ee4d(_0x13b63e);});});} \ No newline at end of file +var _0x7672=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','../../mysqldb'];(function(_0xc5a1a2,_0x49df81){var _0x5d3fe6=function(_0x3d443d){while(--_0x3d443d){_0xc5a1a2['push'](_0xc5a1a2['shift']());}};_0x5d3fe6(++_0x49df81);}(_0x7672,0x89));var _0x2767=function(_0x3876eb,_0x36715a){_0x3876eb=_0x3876eb-0x0;var _0x1e901b=_0x7672[_0x3876eb];return _0x1e901b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2767('0x0'));var BPromise=require(_0x2767('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2767('0x2'))['db'];var utils=require(_0x2767('0x3'));var logger=require(_0x2767('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2767('0x5'));var client=jayson[_0x2767('0x6')][_0x2767('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31e6b9,_0x23fbd3,_0x23aeb7){return new BPromise(function(_0x3d9e6e,_0x5b4aba){return client[_0x2767('0x8')](_0x31e6b9,_0x23aeb7)[_0x2767('0x9')](function(_0x16c69d){logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,'request\x20sent');logger[_0x2767('0xc')](_0x2767('0xd'),_0x23fbd3,_0x2767('0xe'),JSON[_0x2767('0xf')](_0x16c69d));if(_0x16c69d[_0x2767('0x10')]){if(_0x16c69d['error'][_0x2767('0x11')]===0x1f4){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);return _0x5b4aba(_0x16c69d['error'][_0x2767('0x12')]);}logger[_0x2767('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x23fbd3,_0x16c69d['error'][_0x2767('0x12')]);return _0x3d9e6e(_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);}else{logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,_0x2767('0xe'));_0x3d9e6e(_0x16c69d[_0x2767('0x13')][_0x2767('0x12')]);}})['catch'](function(_0x2a098c){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x2a098c);_0x5b4aba(_0x2a098c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index cee573e..f335697 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 _0x878f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','/:id/configurations','/:id/fields','isAuthenticated','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x878f,0x173));var _0xf878=function(_0x19db8d,_0x1e265a){_0x19db8d=_0x19db8d-0x0;var _0x4bcbd8=_0x878f[_0x19db8d];return _0x4bcbd8;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getFields']);router[_0xf878('0xf')]('/',auth[_0xf878('0xe')](),controller['create']);router[_0xf878('0xf')]('/:id/configurations',auth[_0xf878('0xe')](),controller[_0xf878('0x10')]);router[_0xf878('0x11')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router[_0xf878('0x13')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x14')]);module[_0xf878('0x15')]=router; \ No newline at end of file +var _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4cebcc,_0x56253e){var _0x4d1669=function(_0x89e326){while(--_0x89e326){_0x4cebcc['push'](_0x4cebcc['shift']());}};_0x4d1669(++_0x56253e);}(_0x96cc,0x16c));var _0xc96c=function(_0x32e8f2,_0x33cff3){_0x32e8f2=_0x32e8f2-0x0;var _0xefd2e6=_0x96cc[_0x32e8f2];return _0xefd2e6;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 2a582d4..ae9c65d 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x14a91d,_0x3df2f9){var _0x439561=function(_0x5e2204){while(--_0x5e2204){_0x14a91d['push'](_0x14a91d['shift']());}};_0x439561(++_0x3df2f9);}(_0x4991,0xf7));var _0x1499=function(_0x79757b,_0x2d38f7){_0x79757b=_0x79757b-0x0;var _0x164b8f=_0x4991[_0x79757b];return _0x164b8f;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x93e9=['sequelize','exports','STRING','username'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x93e9,0xcc));var _0x993e=function(_0x4c8700,_0x25e672){_0x4c8700=_0x4c8700-0x0;var _0x16dcaa=_0x93e9[_0x4c8700];return _0x16dcaa;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('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 c0a23e0..98820dc 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 _0xa838=['count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesAccount','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','options','where','include','findAll','rows','show','params','rawAttributes','length','find','create','catch','update','body','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','remoteUri','username','slice','substring','GET','format','%s%s','/api/selector/owners','apiKey','users','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa838,0x1bb));var _0x8a83=function(_0x1cfe0e,_0xe87e0b){_0x1cfe0e=_0x1cfe0e-0x0;var _0xe46fe5=_0xa838[_0x1cfe0e];return _0xe46fe5;};'use strict';var emlformat=require(_0x8a83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a83('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a83('0x2'));var moment=require(_0x8a83('0x3'));var BPromise=require(_0x8a83('0x4'));var Mustache=require(_0x8a83('0x5'));var util=require(_0x8a83('0x6'));var path=require(_0x8a83('0x7'));var sox=require(_0x8a83('0x8'));var csv=require('to-csv');var ejs=require(_0x8a83('0x9'));var fs=require('fs');var fs_extra=require(_0x8a83('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a83('0xb'));var jsforce=require(_0x8a83('0xc'));var deskjs=require(_0x8a83('0xd'));var toCsv=require(_0x8a83('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a83('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a83('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8a83('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8a83('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8a83('0x13'));function respondWithStatusCode(_0x316e86,_0x1b8001){_0x1b8001=_0x1b8001||0xcc;return function(_0x3d5df3){if(_0x3d5df3){return _0x316e86[_0x8a83('0x14')](_0x1b8001);}return _0x316e86[_0x8a83('0x15')](_0x1b8001)[_0x8a83('0x16')]();};}function respondWithResult(_0x4e7b51,_0x1fa7a7){_0x1fa7a7=_0x1fa7a7||0xc8;return function(_0x26f0ac){if(_0x26f0ac){return _0x4e7b51[_0x8a83('0x15')](_0x1fa7a7)[_0x8a83('0x17')](_0x26f0ac);}};}function respondWithFilteredResult(_0xb3e89f,_0x2ef82d){return function(_0xf5f1ca){if(_0xf5f1ca){var _0x4996df=typeof _0x2ef82d[_0x8a83('0x18')]===_0x8a83('0x19')&&typeof _0x2ef82d[_0x8a83('0x1a')]===_0x8a83('0x19');var _0xa020ec=_0xf5f1ca[_0x8a83('0x1b')];var _0x41f1cf=_0x4996df?0x0:_0x2ef82d['offset'];var _0x3ac16b=_0x4996df?_0xf5f1ca['count']:_0x2ef82d['offset']+_0x2ef82d[_0x8a83('0x1a')];var _0x37a8b4;if(_0x3ac16b>=_0xa020ec){_0x3ac16b=_0xa020ec;_0x37a8b4=0xc8;}else{_0x37a8b4=0xce;}_0xb3e89f['status'](_0x37a8b4);return _0xb3e89f[_0x8a83('0x1c')](_0x8a83('0x1d'),_0x41f1cf+'-'+_0x3ac16b+'/'+_0xa020ec)['json'](_0xf5f1ca);}return null;};}function patchUpdates(_0x31053d){return function(_0x17f302){try{jsonpatch[_0x8a83('0x1e')](_0x17f302,_0x31053d,!![]);}catch(_0x16ba43){return BPromise[_0x8a83('0x1f')](_0x16ba43);}return _0x17f302[_0x8a83('0x20')]();};}function saveUpdates(_0x5055b6,_0xc8c872){return function(_0x4fc056){if(_0x4fc056){return _0x4fc056['update'](_0x5055b6)[_0x8a83('0x21')](function(_0x2c63ea){return _0x2c63ea;});}return null;};}function removeEntity(_0x577691,_0x845829){return function(_0x4a6fef){if(_0x4a6fef){return _0x4a6fef[_0x8a83('0x22')]()['then'](function(){_0x577691[_0x8a83('0x15')](0xcc)[_0x8a83('0x16')]();});}};}function handleEntityNotFound(_0x3c24d7,_0x45bd29){return function(_0x202afb){if(!_0x202afb){_0x3c24d7[_0x8a83('0x14')](0x194);}return _0x202afb;};}function handleError(_0x58ed3d,_0x2999cb){_0x2999cb=_0x2999cb||0x1f4;return function(_0x40e0cd){logger[_0x8a83('0x23')](_0x40e0cd[_0x8a83('0x24')]);if(_0x40e0cd[_0x8a83('0x25')]){delete _0x40e0cd[_0x8a83('0x25')];}_0x58ed3d[_0x8a83('0x15')](_0x2999cb)[_0x8a83('0x26')](_0x40e0cd);};}exports['index']=function(_0x5b52bc,_0x590fa2){var _0x445bc3={},_0x13e786={},_0x304ed5={'count':0x0,'rows':[]};var _0x2ad860=_[_0x8a83('0x27')](db[_0x8a83('0x28')]['rawAttributes'],function(_0x18fa71){return{'name':_0x18fa71[_0x8a83('0x29')],'type':_0x18fa71[_0x8a83('0x2a')][_0x8a83('0x2b')]};});_0x13e786['model']=_[_0x8a83('0x27')](_0x2ad860,'name');_0x13e786[_0x8a83('0x2c')]=_[_0x8a83('0x2d')](_0x5b52bc[_0x8a83('0x2c')]);_0x13e786['filters']=_[_0x8a83('0x2e')](_0x13e786[_0x8a83('0x2f')],_0x13e786[_0x8a83('0x2c')]);_0x445bc3[_0x8a83('0x30')]=_[_0x8a83('0x2e')](_0x13e786['model'],qs[_0x8a83('0x31')](_0x5b52bc['query']['fields']));_0x445bc3['attributes']=_0x445bc3[_0x8a83('0x30')]['length']?_0x445bc3[_0x8a83('0x30')]:_0x13e786[_0x8a83('0x2f')];if(!_0x5b52bc[_0x8a83('0x2c')][_0x8a83('0x32')]('nolimit')){_0x445bc3[_0x8a83('0x1a')]=qs[_0x8a83('0x1a')](_0x5b52bc[_0x8a83('0x2c')]['limit']);_0x445bc3[_0x8a83('0x18')]=qs[_0x8a83('0x18')](_0x5b52bc[_0x8a83('0x2c')][_0x8a83('0x18')]);}_0x445bc3[_0x8a83('0x33')]=qs[_0x8a83('0x34')](_0x5b52bc[_0x8a83('0x2c')]['sort']);_0x445bc3['where']=qs[_0x8a83('0x35')](_[_0x8a83('0x36')](_0x5b52bc[_0x8a83('0x2c')],_0x13e786[_0x8a83('0x35')]),_0x2ad860);if(_0x5b52bc[_0x8a83('0x2c')][_0x8a83('0x37')]){_0x445bc3['where']=_['merge'](_0x445bc3['where'],{'$or':_[_0x8a83('0x27')](_0x2ad860,function(_0x5d3806){if(_0x5d3806[_0x8a83('0x2a')]!=='VIRTUAL'){var _0x469d98={};_0x469d98[_0x5d3806[_0x8a83('0x25')]]={'$like':'%'+_0x5b52bc['query']['filter']+'%'};return _0x469d98;}})});}_0x445bc3=_[_0x8a83('0x38')]({},_0x445bc3,_0x5b52bc[_0x8a83('0x39')]);var _0x13fa4f={'where':_0x445bc3[_0x8a83('0x3a')]};return db[_0x8a83('0x28')][_0x8a83('0x1b')](_0x13fa4f)['then'](function(_0x413262){_0x304ed5['count']=_0x413262;if(_0x5b52bc['query']['includeAll']){_0x445bc3[_0x8a83('0x3b')]=[{'all':!![]}];}return db[_0x8a83('0x28')][_0x8a83('0x3c')](_0x445bc3);})['then'](function(_0x33dea3){_0x304ed5[_0x8a83('0x3d')]=_0x33dea3;return _0x304ed5;})['then'](respondWithFilteredResult(_0x590fa2,_0x445bc3))['catch'](handleError(_0x590fa2,null));};exports[_0x8a83('0x3e')]=function(_0x50ee1b,_0x2a3aeb){var _0x1eeec9={'raw':![],'where':{'id':_0x50ee1b[_0x8a83('0x3f')]['id']}},_0x47ea85={};_0x47ea85[_0x8a83('0x2f')]=_[_0x8a83('0x2d')](db[_0x8a83('0x28')][_0x8a83('0x40')]);_0x47ea85[_0x8a83('0x2c')]=_[_0x8a83('0x2d')](_0x50ee1b['query']);_0x47ea85[_0x8a83('0x35')]=_[_0x8a83('0x2e')](_0x47ea85[_0x8a83('0x2f')],_0x47ea85[_0x8a83('0x2c')]);_0x1eeec9[_0x8a83('0x30')]=_[_0x8a83('0x2e')](_0x47ea85['model'],qs[_0x8a83('0x31')](_0x50ee1b['query']['fields']));_0x1eeec9['attributes']=_0x1eeec9[_0x8a83('0x30')][_0x8a83('0x41')]?_0x1eeec9[_0x8a83('0x30')]:_0x47ea85['model'];if(_0x50ee1b[_0x8a83('0x2c')]['includeAll']){_0x1eeec9[_0x8a83('0x3b')]=[{'all':!![]}];}_0x1eeec9=_[_0x8a83('0x38')]({},_0x1eeec9,_0x50ee1b[_0x8a83('0x39')]);return db[_0x8a83('0x28')][_0x8a83('0x42')](_0x1eeec9)['then'](handleEntityNotFound(_0x2a3aeb,null))[_0x8a83('0x21')](respondWithResult(_0x2a3aeb,null))['catch'](handleError(_0x2a3aeb,null));};exports[_0x8a83('0x43')]=function(_0x443e67,_0x4dc7be){return db[_0x8a83('0x28')][_0x8a83('0x43')](_0x443e67['body'],{})[_0x8a83('0x21')](respondWithResult(_0x4dc7be,0xc9))[_0x8a83('0x44')](handleError(_0x4dc7be,null));};exports[_0x8a83('0x45')]=function(_0x2d5e48,_0x56cc6e){if(_0x2d5e48[_0x8a83('0x46')]['id']){delete _0x2d5e48[_0x8a83('0x46')]['id'];}return db['FreshsalesAccount'][_0x8a83('0x42')]({'where':{'id':_0x2d5e48[_0x8a83('0x3f')]['id']}})[_0x8a83('0x21')](handleEntityNotFound(_0x56cc6e,null))[_0x8a83('0x21')](saveUpdates(_0x2d5e48[_0x8a83('0x46')],null))[_0x8a83('0x21')](respondWithResult(_0x56cc6e,null))['catch'](handleError(_0x56cc6e,null));};exports[_0x8a83('0x22')]=function(_0x15db39,_0x2713e7){return db['FreshsalesAccount'][_0x8a83('0x42')]({'where':{'id':_0x15db39[_0x8a83('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2713e7,null))['then'](removeEntity(_0x2713e7,null))[_0x8a83('0x44')](handleError(_0x2713e7,null));};exports[_0x8a83('0x47')]=function(_0x3b295b,_0x498065,_0x38aa28){var _0x1fbcbb={};var _0x5c9fb5={};var _0x5c6700;var _0x441a72;return db[_0x8a83('0x28')]['findOne']({'where':{'id':_0x3b295b['params']['id']}})['then'](handleEntityNotFound(_0x498065,null))[_0x8a83('0x21')](function(_0x47b9f8){if(_0x47b9f8){_0x5c6700=_0x47b9f8;_0x5c9fb5['model']=_[_0x8a83('0x2d')](db[_0x8a83('0x48')][_0x8a83('0x40')]);_0x5c9fb5[_0x8a83('0x2c')]=_['keys'](_0x3b295b[_0x8a83('0x2c')]);_0x5c9fb5['filters']=_[_0x8a83('0x2e')](_0x5c9fb5['model'],_0x5c9fb5[_0x8a83('0x2c')]);_0x1fbcbb[_0x8a83('0x30')]=_[_0x8a83('0x2e')](_0x5c9fb5[_0x8a83('0x2f')],qs[_0x8a83('0x31')](_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x31')]));_0x1fbcbb[_0x8a83('0x30')]=_0x1fbcbb['attributes'][_0x8a83('0x41')]?_0x1fbcbb[_0x8a83('0x30')]:_0x5c9fb5[_0x8a83('0x2f')];_0x1fbcbb[_0x8a83('0x33')]=qs[_0x8a83('0x34')](_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x34')]);_0x1fbcbb[_0x8a83('0x3a')]=qs[_0x8a83('0x35')](_[_0x8a83('0x36')](_0x3b295b[_0x8a83('0x2c')],_0x5c9fb5[_0x8a83('0x35')]));if(_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x37')]){_0x1fbcbb[_0x8a83('0x3a')]=_[_0x8a83('0x38')](_0x1fbcbb[_0x8a83('0x3a')],{'$or':_[_0x8a83('0x27')](_0x1fbcbb['attributes'],function(_0xa84948){var _0x3ff724={};_0x3ff724[_0xa84948]={'$like':'%'+_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x37')]+'%'};return _0x3ff724;})});}_0x1fbcbb=_[_0x8a83('0x38')]({},_0x1fbcbb,_0x3b295b['options']);return _0x5c6700[_0x8a83('0x47')](_0x1fbcbb);}})[_0x8a83('0x21')](function(_0x34da46){if(_0x34da46){_0x441a72=_0x34da46[_0x8a83('0x41')];if(!_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x32')]('nolimit')){_0x1fbcbb[_0x8a83('0x1a')]=qs[_0x8a83('0x1a')](_0x3b295b[_0x8a83('0x2c')][_0x8a83('0x1a')]);_0x1fbcbb[_0x8a83('0x18')]=qs[_0x8a83('0x18')](_0x3b295b[_0x8a83('0x2c')]['offset']);}return _0x5c6700[_0x8a83('0x47')](_0x1fbcbb);}})[_0x8a83('0x21')](function(_0x2cb5c4){if(_0x2cb5c4){return _0x2cb5c4?{'count':_0x441a72,'rows':_0x2cb5c4}:null;}})[_0x8a83('0x21')](respondWithResult(_0x498065,null))[_0x8a83('0x44')](handleError(_0x498065,null));};exports[_0x8a83('0x49')]=function(_0x5339f0,_0x5eddba,_0x250485){if(_0x5339f0[_0x8a83('0x46')]['id']){delete _0x5339f0[_0x8a83('0x46')]['id'];}return db[_0x8a83('0x28')][_0x8a83('0x4a')]({'where':{'id':_0x5339f0[_0x8a83('0x3f')]['id']}})[_0x8a83('0x21')](handleEntityNotFound(_0x5eddba,null))[_0x8a83('0x21')](function(_0x5609f0){if(_0x5609f0){_0x5339f0[_0x8a83('0x46')][_0x8a83('0x4b')]=_0x5609f0['id'];_0x5339f0[_0x8a83('0x46')][_0x8a83('0x4c')]=integrations[_0x8a83('0x4d')](_0x5339f0['body'][_0x8a83('0x4e')],_0x5339f0[_0x8a83('0x46')][_0x8a83('0x2a')]);_0x5339f0['body'][_0x8a83('0x4f')]=integrations['getDescriptions'](_0x5339f0[_0x8a83('0x46')][_0x8a83('0x4e')],_0x5339f0['body'][_0x8a83('0x2a')]);return db[_0x8a83('0x48')][_0x8a83('0x43')](_0x5339f0[_0x8a83('0x46')],{'include':[{'model':db[_0x8a83('0x50')],'as':_0x8a83('0x4c')},{'model':db[_0x8a83('0x50')],'as':_0x8a83('0x4f')}]});}return null;})[_0x8a83('0x21')](respondWithResult(_0x5eddba,null))[_0x8a83('0x44')](handleError(_0x5eddba,null));};exports['getFields']=function(_0x42dc3a,_0xc9b08,_0x452070){var _0x409f93='';var _0x49237e='';return db[_0x8a83('0x28')][_0x8a83('0x4a')]({'where':{'id':_0x42dc3a[_0x8a83('0x3f')]['id']},'attributes':['id','username',_0x8a83('0x51'),'apiKey']})[_0x8a83('0x21')](handleEntityNotFound(_0xc9b08,null))[_0x8a83('0x21')](function(_0x51b51b){if(_0x51b51b){_0x49237e=_0x51b51b[_0x8a83('0x52')];_0x409f93=_0x51b51b[_0x8a83('0x51')];var _0x1469d7=_0x51b51b[_0x8a83('0x51')][_0x8a83('0x53')](-0x1);if(_0x1469d7==='/'){_0x409f93=_0x409f93[_0x8a83('0x54')](0x0,_0x409f93['lastIndexOf'](_0x1469d7));}return rp({'method':_0x8a83('0x55'),'uri':util[_0x8a83('0x56')](_0x8a83('0x57'),_0x409f93,_0x8a83('0x58')),'headers':{'Authorization':'Token\x20token='+_0x51b51b[_0x8a83('0x59')]},'json':!![]});}})[_0x8a83('0x21')](function(_0x421e6e){if(_0x421e6e){var _0x24185f=_0x421e6e[_0x8a83('0x5a')];var _0x3f4416=![];var _0x17178e=null;for(_0x17178e=0x0;_0x17178e<_0x24185f[_0x8a83('0x41')];_0x17178e++){if(_0x24185f[_0x17178e]['email']===_0x49237e){_0x3f4416=!![];}}if(_0x3f4416){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0xc9b08,null))[_0x8a83('0x44')](function(_0x3e2e3c){var _0x380c37=_0x42dc3a[_0x8a83('0x2c')][_0x8a83('0x5b')]?0x1f4:_0x3e2e3c['statusCode']||0x1f4;logger[_0x8a83('0x23')](_0x8a83('0x5c'),'getFields',_0x380c37,JSON['stringify'](_0x3e2e3c));delete _0x3e2e3c[_0x8a83('0x25')];if(_0x380c37===0x191){_0x380c37=0x190;}_0xc9b08[_0x8a83('0x15')](_0x380c37)['send'](_0x42dc3a['query'][_0x8a83('0x5b')]?{'message':'Wrong\x20credentials','statusCode':_0x3e2e3c[_0x8a83('0x5d')]}:_0x3e2e3c);});}; \ No newline at end of file +var _0x4fce=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','FreshsalesConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type'];(function(_0x465bb1,_0x34f0cc){var _0xfdc1c8=function(_0x15e36a){while(--_0x15e36a){_0x465bb1['push'](_0x465bb1['shift']());}};_0xfdc1c8(++_0x34f0cc);}(_0x4fce,0xf6));var _0xe4fc=function(_0x3eb9d6,_0x1995b8){_0x3eb9d6=_0x3eb9d6-0x0;var _0x1329eb=_0x4fce[_0x3eb9d6];return _0x1329eb;};'use strict';var emlformat=require(_0xe4fc('0x0'));var rimraf=require(_0xe4fc('0x1'));var zipdir=require(_0xe4fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe4fc('0x4'));var util=require('util');var path=require(_0xe4fc('0x5'));var sox=require(_0xe4fc('0x6'));var csv=require(_0xe4fc('0x7'));var ejs=require(_0xe4fc('0x8'));var fs=require('fs');var fs_extra=require(_0xe4fc('0x9'));var _=require(_0xe4fc('0xa'));var squel=require(_0xe4fc('0xb'));var crypto=require(_0xe4fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe4fc('0xd'));var toCsv=require(_0xe4fc('0x7'));var querystring=require(_0xe4fc('0xe'));var Papa=require('papaparse');var Redis=require(_0xe4fc('0xf'));var authService=require(_0xe4fc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4fc('0x11'));var logger=require(_0xe4fc('0x12'))(_0xe4fc('0x13'));var utils=require('../../config/utils');var config=require(_0xe4fc('0x14'));var licenseUtil=require(_0xe4fc('0x15'));var db=require(_0xe4fc('0x16'))['db'];var integrations=require(_0xe4fc('0x17'));function respondWithStatusCode(_0x430f4f,_0x433b7d){_0x433b7d=_0x433b7d||0xcc;return function(_0x27fde0){if(_0x27fde0){return _0x430f4f[_0xe4fc('0x18')](_0x433b7d);}return _0x430f4f['status'](_0x433b7d)['end']();};}function respondWithResult(_0x1b49c3,_0x4865be){_0x4865be=_0x4865be||0xc8;return function(_0x3abe08){if(_0x3abe08){return _0x1b49c3[_0xe4fc('0x19')](_0x4865be)[_0xe4fc('0x1a')](_0x3abe08);}};}function respondWithFilteredResult(_0x1960ec,_0x420d01){return function(_0x2b4a89){if(_0x2b4a89){var _0x308d10=typeof _0x420d01[_0xe4fc('0x1b')]===_0xe4fc('0x1c')&&typeof _0x420d01[_0xe4fc('0x1d')]===_0xe4fc('0x1c');var _0x1c276b=_0x2b4a89[_0xe4fc('0x1e')];var _0x5ac053=_0x308d10?0x0:_0x420d01[_0xe4fc('0x1b')];var _0x342abb=_0x308d10?_0x2b4a89[_0xe4fc('0x1e')]:_0x420d01[_0xe4fc('0x1b')]+_0x420d01['limit'];var _0x28edfd;if(_0x342abb>=_0x1c276b){_0x342abb=_0x1c276b;_0x28edfd=0xc8;}else{_0x28edfd=0xce;}_0x1960ec['status'](_0x28edfd);return _0x1960ec['set'](_0xe4fc('0x1f'),_0x5ac053+'-'+_0x342abb+'/'+_0x1c276b)[_0xe4fc('0x1a')](_0x2b4a89);}return null;};}function patchUpdates(_0x493f84){return function(_0x3755de){try{jsonpatch[_0xe4fc('0x20')](_0x3755de,_0x493f84,!![]);}catch(_0x2d7cea){return BPromise[_0xe4fc('0x21')](_0x2d7cea);}return _0x3755de[_0xe4fc('0x22')]();};}function saveUpdates(_0x35f6cb,_0x2eee3a){return function(_0x308bc1){if(_0x308bc1){return _0x308bc1[_0xe4fc('0x23')](_0x35f6cb)[_0xe4fc('0x24')](function(_0x578d59){return _0x578d59;});}return null;};}function removeEntity(_0x299dae,_0x285053){return function(_0x5a43b4){if(_0x5a43b4){return _0x5a43b4[_0xe4fc('0x25')]()[_0xe4fc('0x24')](function(){_0x299dae[_0xe4fc('0x19')](0xcc)[_0xe4fc('0x26')]();});}};}function handleEntityNotFound(_0x304bd1,_0x19f253){return function(_0x54ba60){if(!_0x54ba60){_0x304bd1[_0xe4fc('0x18')](0x194);}return _0x54ba60;};}function handleError(_0x116e65,_0x1db60e){_0x1db60e=_0x1db60e||0x1f4;return function(_0x19c53c){logger[_0xe4fc('0x27')](_0x19c53c[_0xe4fc('0x28')]);if(_0x19c53c[_0xe4fc('0x29')]){delete _0x19c53c[_0xe4fc('0x29')];}_0x116e65[_0xe4fc('0x19')](_0x1db60e)[_0xe4fc('0x2a')](_0x19c53c);};}exports['index']=function(_0x3336de,_0x3eac22){var _0x56aa9a={},_0x2bed01={},_0x13e4cb={'count':0x0,'rows':[]};var _0x3a3d1f=_[_0xe4fc('0x2b')](db[_0xe4fc('0x2c')][_0xe4fc('0x2d')],function(_0x2d5f0a){return{'name':_0x2d5f0a[_0xe4fc('0x2e')],'type':_0x2d5f0a[_0xe4fc('0x2f')]['key']};});_0x2bed01[_0xe4fc('0x30')]=_[_0xe4fc('0x2b')](_0x3a3d1f,_0xe4fc('0x29'));_0x2bed01[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x3336de['query']);_0x2bed01[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x2bed01[_0xe4fc('0x30')],_0x2bed01[_0xe4fc('0x31')]);_0x56aa9a[_0xe4fc('0x35')]=_[_0xe4fc('0x34')](_0x2bed01['model'],qs[_0xe4fc('0x36')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x36')]));_0x56aa9a[_0xe4fc('0x35')]=_0x56aa9a[_0xe4fc('0x35')][_0xe4fc('0x37')]?_0x56aa9a[_0xe4fc('0x35')]:_0x2bed01['model'];if(!_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x38')](_0xe4fc('0x39'))){_0x56aa9a[_0xe4fc('0x1d')]=qs[_0xe4fc('0x1d')](_0x3336de[_0xe4fc('0x31')]['limit']);_0x56aa9a[_0xe4fc('0x1b')]=qs[_0xe4fc('0x1b')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x1b')]);}_0x56aa9a[_0xe4fc('0x3a')]=qs[_0xe4fc('0x3b')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x3b')]);_0x56aa9a[_0xe4fc('0x3c')]=qs[_0xe4fc('0x33')](_[_0xe4fc('0x3d')](_0x3336de[_0xe4fc('0x31')],_0x2bed01[_0xe4fc('0x33')]),_0x3a3d1f);if(_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x3e')]){_0x56aa9a[_0xe4fc('0x3c')]=_[_0xe4fc('0x3f')](_0x56aa9a[_0xe4fc('0x3c')],{'$or':_[_0xe4fc('0x2b')](_0x3a3d1f,function(_0x21f846){if(_0x21f846[_0xe4fc('0x2f')]!==_0xe4fc('0x40')){var _0x566860={};_0x566860[_0x21f846[_0xe4fc('0x29')]]={'$like':'%'+_0x3336de['query']['filter']+'%'};return _0x566860;}})});}_0x56aa9a=_[_0xe4fc('0x3f')]({},_0x56aa9a,_0x3336de[_0xe4fc('0x41')]);var _0x4ed7b3={'where':_0x56aa9a[_0xe4fc('0x3c')]};return db[_0xe4fc('0x2c')][_0xe4fc('0x1e')](_0x4ed7b3)['then'](function(_0x3ecc98){_0x13e4cb[_0xe4fc('0x1e')]=_0x3ecc98;if(_0x3336de['query'][_0xe4fc('0x42')]){_0x56aa9a[_0xe4fc('0x43')]=[{'all':!![]}];}return db[_0xe4fc('0x2c')][_0xe4fc('0x44')](_0x56aa9a);})[_0xe4fc('0x24')](function(_0x546f1b){_0x13e4cb['rows']=_0x546f1b;return _0x13e4cb;})['then'](respondWithFilteredResult(_0x3eac22,_0x56aa9a))[_0xe4fc('0x45')](handleError(_0x3eac22,null));};exports[_0xe4fc('0x46')]=function(_0x26ddd9,_0x436906){var _0x2997a3={'raw':![],'where':{'id':_0x26ddd9[_0xe4fc('0x47')]['id']}},_0x1a3d1b={};_0x1a3d1b['model']=_[_0xe4fc('0x32')](db['FreshsalesAccount']['rawAttributes']);_0x1a3d1b[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x26ddd9['query']);_0x1a3d1b[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x1a3d1b[_0xe4fc('0x30')],_0x1a3d1b[_0xe4fc('0x31')]);_0x2997a3['attributes']=_['intersection'](_0x1a3d1b[_0xe4fc('0x30')],qs[_0xe4fc('0x36')](_0x26ddd9[_0xe4fc('0x31')][_0xe4fc('0x36')]));_0x2997a3['attributes']=_0x2997a3[_0xe4fc('0x35')]['length']?_0x2997a3[_0xe4fc('0x35')]:_0x1a3d1b[_0xe4fc('0x30')];if(_0x26ddd9[_0xe4fc('0x31')][_0xe4fc('0x42')]){_0x2997a3['include']=[{'all':!![]}];}_0x2997a3=_[_0xe4fc('0x3f')]({},_0x2997a3,_0x26ddd9[_0xe4fc('0x41')]);return db[_0xe4fc('0x2c')][_0xe4fc('0x48')](_0x2997a3)[_0xe4fc('0x24')](handleEntityNotFound(_0x436906,null))['then'](respondWithResult(_0x436906,null))[_0xe4fc('0x45')](handleError(_0x436906,null));};exports['create']=function(_0x2f907e,_0x3aadc7){return db['FreshsalesAccount'][_0xe4fc('0x49')](_0x2f907e[_0xe4fc('0x4a')],{})[_0xe4fc('0x24')](respondWithResult(_0x3aadc7,0xc9))['catch'](handleError(_0x3aadc7,null));};exports[_0xe4fc('0x23')]=function(_0x34da66,_0x70270d){if(_0x34da66[_0xe4fc('0x4a')]['id']){delete _0x34da66[_0xe4fc('0x4a')]['id'];}return db[_0xe4fc('0x2c')][_0xe4fc('0x48')]({'where':{'id':_0x34da66['params']['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x70270d,null))[_0xe4fc('0x24')](saveUpdates(_0x34da66[_0xe4fc('0x4a')],null))[_0xe4fc('0x24')](respondWithResult(_0x70270d,null))['catch'](handleError(_0x70270d,null));};exports[_0xe4fc('0x25')]=function(_0x42ac10,_0x3a280f){return db['FreshsalesAccount']['find']({'where':{'id':_0x42ac10[_0xe4fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a280f,null))[_0xe4fc('0x24')](removeEntity(_0x3a280f,null))[_0xe4fc('0x45')](handleError(_0x3a280f,null));};exports[_0xe4fc('0x4b')]=function(_0x128fc6,_0x3c7422,_0x40e1e4){var _0x5c7691={};var _0x1be8be={};var _0xe783;var _0x3e57ab;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x128fc6['params']['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x3c7422,null))[_0xe4fc('0x24')](function(_0x4a414f){if(_0x4a414f){_0xe783=_0x4a414f;_0x1be8be[_0xe4fc('0x30')]=_[_0xe4fc('0x32')](db[_0xe4fc('0x4c')][_0xe4fc('0x2d')]);_0x1be8be[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x128fc6[_0xe4fc('0x31')]);_0x1be8be[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x1be8be[_0xe4fc('0x30')],_0x1be8be[_0xe4fc('0x31')]);_0x5c7691[_0xe4fc('0x35')]=_[_0xe4fc('0x34')](_0x1be8be[_0xe4fc('0x30')],qs[_0xe4fc('0x36')](_0x128fc6['query'][_0xe4fc('0x36')]));_0x5c7691['attributes']=_0x5c7691[_0xe4fc('0x35')][_0xe4fc('0x37')]?_0x5c7691[_0xe4fc('0x35')]:_0x1be8be[_0xe4fc('0x30')];_0x5c7691[_0xe4fc('0x3a')]=qs[_0xe4fc('0x3b')](_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x3b')]);_0x5c7691['where']=qs[_0xe4fc('0x33')](_['pick'](_0x128fc6[_0xe4fc('0x31')],_0x1be8be[_0xe4fc('0x33')]));if(_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x3e')]){_0x5c7691[_0xe4fc('0x3c')]=_[_0xe4fc('0x3f')](_0x5c7691[_0xe4fc('0x3c')],{'$or':_['map'](_0x5c7691[_0xe4fc('0x35')],function(_0x34f712){var _0x4cc397={};_0x4cc397[_0x34f712]={'$like':'%'+_0x128fc6[_0xe4fc('0x31')]['filter']+'%'};return _0x4cc397;})});}_0x5c7691=_[_0xe4fc('0x3f')]({},_0x5c7691,_0x128fc6[_0xe4fc('0x41')]);return _0xe783[_0xe4fc('0x4b')](_0x5c7691);}})[_0xe4fc('0x24')](function(_0x2f5323){if(_0x2f5323){_0x3e57ab=_0x2f5323[_0xe4fc('0x37')];if(!_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x38')](_0xe4fc('0x39'))){_0x5c7691[_0xe4fc('0x1d')]=qs['limit'](_0x128fc6['query'][_0xe4fc('0x1d')]);_0x5c7691[_0xe4fc('0x1b')]=qs['offset'](_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x1b')]);}return _0xe783[_0xe4fc('0x4b')](_0x5c7691);}})['then'](function(_0x25472d){if(_0x25472d){return _0x25472d?{'count':_0x3e57ab,'rows':_0x25472d}:null;}})[_0xe4fc('0x24')](respondWithResult(_0x3c7422,null))[_0xe4fc('0x45')](handleError(_0x3c7422,null));};exports['addConfiguration']=function(_0x3e69e7,_0x6681f2,_0x52e5b2){if(_0x3e69e7[_0xe4fc('0x4a')]['id']){delete _0x3e69e7[_0xe4fc('0x4a')]['id'];}return db[_0xe4fc('0x2c')][_0xe4fc('0x4d')]({'where':{'id':_0x3e69e7[_0xe4fc('0x47')]['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x6681f2,null))['then'](function(_0x2c2c8d){if(_0x2c2c8d){_0x3e69e7['body']['AccountId']=_0x2c2c8d['id'];_0x3e69e7['body'][_0xe4fc('0x4e')]=integrations[_0xe4fc('0x4f')](_0x3e69e7[_0xe4fc('0x4a')][_0xe4fc('0x50')],_0x3e69e7[_0xe4fc('0x4a')]['type']);_0x3e69e7[_0xe4fc('0x4a')][_0xe4fc('0x51')]=integrations['getDescriptions'](_0x3e69e7[_0xe4fc('0x4a')]['channel'],_0x3e69e7['body'][_0xe4fc('0x2f')]);return db[_0xe4fc('0x4c')][_0xe4fc('0x49')](_0x3e69e7[_0xe4fc('0x4a')],{'include':[{'model':db[_0xe4fc('0x52')],'as':_0xe4fc('0x4e')},{'model':db['FreshsalesField'],'as':_0xe4fc('0x51')}]});}return null;})[_0xe4fc('0x24')](respondWithResult(_0x6681f2,null))[_0xe4fc('0x45')](handleError(_0x6681f2,null));};exports[_0xe4fc('0x53')]=function(_0x4e5490,_0x5de41c,_0x5c2faa){var _0x42343b='';var _0x59cbd4='';return db[_0xe4fc('0x2c')][_0xe4fc('0x4d')]({'where':{'id':_0x4e5490[_0xe4fc('0x47')]['id']},'attributes':['id',_0xe4fc('0x54'),'remoteUri',_0xe4fc('0x55')]})[_0xe4fc('0x24')](handleEntityNotFound(_0x5de41c,null))[_0xe4fc('0x24')](function(_0xa8f1a8){if(_0xa8f1a8){_0x59cbd4=_0xa8f1a8['username'];_0x42343b=_0xa8f1a8[_0xe4fc('0x56')];var _0xbf65f=_0xa8f1a8[_0xe4fc('0x56')][_0xe4fc('0x57')](-0x1);if(_0xbf65f==='/'){_0x42343b=_0x42343b['substring'](0x0,_0x42343b[_0xe4fc('0x58')](_0xbf65f));}return rp({'method':'GET','uri':util[_0xe4fc('0x59')](_0xe4fc('0x5a'),_0x42343b,_0xe4fc('0x5b')),'headers':{'Authorization':_0xe4fc('0x5c')+_0xa8f1a8[_0xe4fc('0x55')]},'json':!![]});}})['then'](function(_0x3ee22d){if(_0x3ee22d){var _0x1357ed=_0x3ee22d['users'];var _0x14ea3e=![];var _0x28a1e3=null;for(_0x28a1e3=0x0;_0x28a1e3<_0x1357ed[_0xe4fc('0x37')];_0x28a1e3++){if(_0x1357ed[_0x28a1e3]['email']===_0x59cbd4){_0x14ea3e=!![];}}if(_0x14ea3e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe4fc('0x5d')});}}})[_0xe4fc('0x24')](respondWithResult(_0x5de41c,null))[_0xe4fc('0x45')](function(_0x1fafd8){var _0x489c50=_0x4e5490['query']['test']?0x1f4:_0x1fafd8[_0xe4fc('0x5e')]||0x1f4;logger[_0xe4fc('0x27')](_0xe4fc('0x5f'),_0xe4fc('0x53'),_0x489c50,JSON['stringify'](_0x1fafd8));delete _0x1fafd8[_0xe4fc('0x29')];if(_0x489c50===0x191){_0x489c50=0x190;}_0x5de41c[_0xe4fc('0x19')](_0x489c50)['send'](_0x4e5490[_0xe4fc('0x31')][_0xe4fc('0x60')]?{'message':_0xe4fc('0x61'),'statusCode':_0x1fafd8[_0xe4fc('0x5e')]}:_0x1fafd8);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 43f4092..f85196f 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 _0x0a6b=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','moment'];(function(_0x5304c5,_0x5787bb){var _0x3131fa=function(_0xa283de){while(--_0xa283de){_0x5304c5['push'](_0x5304c5['shift']());}};_0x3131fa(++_0x5787bb);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x3ed2ef,_0x296c36){_0x3ed2ef=_0x3ed2ef-0x0;var _0x3f231f=_0x0a6b[_0x3ed2ef];return _0x3f231f;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xb0a6('0x6')]=function(_0x415e9e,_0x5e2d2d){return _0x415e9e[_0xb0a6('0x7')](_0xb0a6('0x8'),attributes,{'tableName':_0xb0a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0xc22df2,_0x16f608){var _0x4b1166=function(_0x3af9c3){while(--_0x3af9c3){_0xc22df2['push'](_0xc22df2['shift']());}};_0x4b1166(++_0x16f608);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'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 84684f1..880033a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e3f=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3fdab4,_0x41eca9){var _0x484516=function(_0x3ccbb3){while(--_0x3ccbb3){_0x3fdab4['push'](_0x3fdab4['shift']());}};_0x484516(++_0x41eca9);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});}; \ No newline at end of file +var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where'];(function(_0x2ecae3,_0x352773){var _0x45bc0b=function(_0x1c04b1){while(--_0x1c04b1){_0x2ecae3['push'](_0x2ecae3['shift']());}};_0x45bc0b(++_0x352773);}(_0xb44a,0x1c2));var _0xab44=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0xb44a[_0x5f3905];return _0x2923b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['findAll']({'raw':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')]['where']||null:null,'attributes':_0x354b09[_0xab44('0x14')]?_0x354b09['options'][_0xab44('0x16')]||null:null,'limit':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x17')]||null:null,'include':_0x354b09['options']?_0x354b09[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x354b09[_0xab44('0x14')][_0xab44('0x18')],function(_0x402950){return{'model':db[_0x402950[_0xab44('0x1a')]],'as':_0x402950['as'],'attributes':_0x402950['attributes'],'include':_0x402950['include']?_[_0xab44('0x19')](_0x402950['include'],function(_0x2439f3){return{'model':db[_0x2439f3['model']],'as':_0x2439f3['as'],'attributes':_0x2439f3[_0xab44('0x16')],'include':_0x2439f3['include']?_['map'](_0x2439f3[_0xab44('0x18')],function(_0x25287b){return{'model':db[_0x25287b[_0xab44('0x1a')]],'as':_0x25287b['as'],'attributes':_0x25287b[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x4e820c){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger['debug'](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x4e820c));_0x310b15(_0x4e820c);})[_0xab44('0x11')](function(_0x1cd486){logger[_0xab44('0xd')](_0xab44('0x12'),_0x1cd486['message'],_0x354b09);_0xc4b3dc(_0x44fa43[_0xab44('0xd')](0x1f4,_0x1cd486[_0xab44('0xf')]));});});};exports[_0xab44('0x1b')]=function(_0x47e1be){var _0x54cac8=this;return new Promise(function(_0x106d3a,_0x5082e4){return db['FreshsalesAccount'][_0xab44('0x1c')]({'raw':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x1d')]||null:null,'attributes':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x16')]||null:null,'include':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x47e1be['options']['include'],function(_0x27e318){return{'model':db[_0x27e318[_0xab44('0x1a')]],'as':_0x27e318['as'],'attributes':_0x27e318['attributes'],'include':_0x27e318[_0xab44('0x18')]?_[_0xab44('0x19')](_0x27e318[_0xab44('0x18')],function(_0x1e0be7){return{'model':db[_0x1e0be7[_0xab44('0x1a')]],'as':_0x1e0be7['as'],'attributes':_0x1e0be7[_0xab44('0x16')],'include':_0x1e0be7[_0xab44('0x18')]?_[_0xab44('0x19')](_0x1e0be7[_0xab44('0x18')],function(_0xe26f9f){return{'model':db[_0xe26f9f[_0xab44('0x1a')]],'as':_0xe26f9f['as'],'attributes':_0xe26f9f[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x532aad){logger[_0xab44('0x10')](_0xab44('0x1b'),_0x47e1be);logger[_0xab44('0xb')](_0xab44('0x1b'),_0x47e1be,JSON['stringify'](_0x532aad));_0x106d3a(_0x532aad);})[_0xab44('0x11')](function(_0x31b599){logger[_0xab44('0xd')](_0xab44('0x1b'),_0x31b599['message'],_0x47e1be);_0x5082e4(_0x54cac8[_0xab44('0xd')](0x1f4,_0x31b599[_0xab44('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0de1a12..c059b67 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 _0x8f9d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','post','create','put','destroy','exports','multer','util'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x8f9d,0x16e));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require(_0xd8f9('0x1'));var path=require(_0xd8f9('0x2'));var timeout=require(_0xd8f9('0x3'));var express=require(_0xd8f9('0x4'));var router=express[_0xd8f9('0x5')]();var fs_extra=require(_0xd8f9('0x6'));var auth=require(_0xd8f9('0x7'));var interaction=require(_0xd8f9('0x8'));var config=require('../../config/environment');var controller=require(_0xd8f9('0x9'));router[_0xd8f9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd8f9('0xa')](_0xd8f9('0xb'),auth[_0xd8f9('0xc')](),controller[_0xd8f9('0xd')]);router['get'](_0xd8f9('0xe'),auth[_0xd8f9('0xc')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0xa')](_0xd8f9('0x10'),auth[_0xd8f9('0xc')](),controller['getDescriptions']);router[_0xd8f9('0xa')](_0xd8f9('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0xd8f9('0x12')]('/',auth[_0xd8f9('0xc')](),controller[_0xd8f9('0x13')]);router[_0xd8f9('0x14')](_0xd8f9('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd8f9('0xb'),auth[_0xd8f9('0xc')](),controller[_0xd8f9('0x15')]);module[_0xd8f9('0x16')]=router; \ No newline at end of file +var _0x1250=['getFields','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x505238,_0x528195){var _0x5977fe=function(_0xb61e93){while(--_0xb61e93){_0x505238['push'](_0x505238['shift']());}};_0x5977fe(++_0x528195);}(_0x1250,0x11c));var _0x0125=function(_0x381cd5,_0x1f66dd){_0x381cd5=_0x381cd5-0x0;var _0x14b162=_0x1250[_0x381cd5];return _0x14b162;};'use strict';var multer=require(_0x0125('0x0'));var util=require(_0x0125('0x1'));var path=require(_0x0125('0x2'));var timeout=require('connect-timeout');var express=require(_0x0125('0x3'));var router=express['Router']();var fs_extra=require(_0x0125('0x4'));var auth=require(_0x0125('0x5'));var interaction=require(_0x0125('0x6'));var config=require(_0x0125('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x0125('0x8')]('/',auth[_0x0125('0x9')](),controller[_0x0125('0xa')]);router[_0x0125('0x8')](_0x0125('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/subjects',auth[_0x0125('0x9')](),controller[_0x0125('0xc')]);router[_0x0125('0x8')](_0x0125('0xd'),auth['isAuthenticated'](),controller[_0x0125('0xe')]);router[_0x0125('0x8')]('/:id/fields',auth[_0x0125('0x9')](),controller[_0x0125('0xf')]);router[_0x0125('0x10')]('/',auth['isAuthenticated'](),controller[_0x0125('0x11')]);router[_0x0125('0x12')]('/:id',auth[_0x0125('0x9')](),controller[_0x0125('0x13')]);router[_0x0125('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0125('0x15')]);module[_0x0125('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 83cd59c..d7ea44b 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 _0x2864=['STRING','exports'];(function(_0xc05c4b,_0x2a44b3){var _0x410d44=function(_0x9f90b2){while(--_0x9f90b2){_0xc05c4b['push'](_0xc05c4b['shift']());}};_0x410d44(++_0x2a44b3);}(_0x2864,0x8b));var _0x4286=function(_0x33f62a,_0x524ab5){_0x33f62a=_0x33f62a-0x0;var _0x4f5bd8=_0x2864[_0x33f62a];return _0x4f5bd8;};'use strict';var Sequelize=require('sequelize');module[_0x4286('0x0')]={'name':{'type':Sequelize[_0x4286('0x1')]},'description':{'type':Sequelize[_0x4286('0x1')]}}; \ No newline at end of file +var _0x531c=['STRING','sequelize','exports'];(function(_0x2c37b2,_0x107055){var _0x559312=function(_0x53e3d3){while(--_0x53e3d3){_0x2c37b2['push'](_0x2c37b2['shift']());}};_0x559312(++_0x107055);}(_0x531c,0x14b));var _0xc531=function(_0x2a2ef3,_0x25cbea){_0x2a2ef3=_0x2a2ef3-0x0;var _0x50c9e4=_0x531c[_0x2a2ef3];return _0x50c9e4;};'use strict';var Sequelize=require(_0xc531('0x0'));module[_0xc531('0x1')]={'name':{'type':Sequelize[_0xc531('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index dcdb05a..0f67a37 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 _0x9a8b=['findOne','FreshsalesField','keys','map','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','body','params','getSubjects'];(function(_0x3a4966,_0x147959){var _0x41cf85=function(_0x4fc322){while(--_0x4fc322){_0x3a4966['push'](_0x3a4966['shift']());}};_0x41cf85(++_0x147959);}(_0x9a8b,0xa6));var _0xb9a8=function(_0x5e65b3,_0x3e5d8f){_0x5e65b3=_0x5e65b3-0x0;var _0x1e8504=_0x9a8b[_0x5e65b3];return _0x1e8504;};'use strict';var emlformat=require(_0xb9a8('0x0'));var rimraf=require(_0xb9a8('0x1'));var zipdir=require(_0xb9a8('0x2'));var jsonpatch=require(_0xb9a8('0x3'));var rp=require(_0xb9a8('0x4'));var moment=require('moment');var BPromise=require(_0xb9a8('0x5'));var Mustache=require(_0xb9a8('0x6'));var util=require(_0xb9a8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb9a8('0x8'));var ejs=require(_0xb9a8('0x9'));var fs=require('fs');var fs_extra=require(_0xb9a8('0xa'));var _=require('lodash');var squel=require(_0xb9a8('0xb'));var crypto=require('crypto');var jsforce=require(_0xb9a8('0xc'));var deskjs=require(_0xb9a8('0xd'));var toCsv=require(_0xb9a8('0x8'));var querystring=require(_0xb9a8('0xe'));var Papa=require(_0xb9a8('0xf'));var Redis=require(_0xb9a8('0x10'));var authService=require(_0xb9a8('0x11'));var qs=require(_0xb9a8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9a8('0x13'));var logger=require(_0xb9a8('0x14'))(_0xb9a8('0x15'));var utils=require(_0xb9a8('0x16'));var config=require(_0xb9a8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58a878,_0x186e35){_0x186e35=_0x186e35||0xcc;return function(_0x495a00){if(_0x495a00){return _0x58a878['sendStatus'](_0x186e35);}return _0x58a878[_0xb9a8('0x18')](_0x186e35)[_0xb9a8('0x19')]();};}function respondWithResult(_0x5d9c99,_0xf199c8){_0xf199c8=_0xf199c8||0xc8;return function(_0x367134){if(_0x367134){return _0x5d9c99[_0xb9a8('0x18')](_0xf199c8)['json'](_0x367134);}};}function respondWithFilteredResult(_0x458262,_0xe04a5b){return function(_0x2dbe06){if(_0x2dbe06){var _0x29a31d=typeof _0xe04a5b[_0xb9a8('0x1a')]==='undefined'&&typeof _0xe04a5b[_0xb9a8('0x1b')]===_0xb9a8('0x1c');var _0x475c1d=_0x2dbe06[_0xb9a8('0x1d')];var _0x1d34f1=_0x29a31d?0x0:_0xe04a5b[_0xb9a8('0x1a')];var _0x37d29e=_0x29a31d?_0x2dbe06[_0xb9a8('0x1d')]:_0xe04a5b['offset']+_0xe04a5b[_0xb9a8('0x1b')];var _0x1a05e6;if(_0x37d29e>=_0x475c1d){_0x37d29e=_0x475c1d;_0x1a05e6=0xc8;}else{_0x1a05e6=0xce;}_0x458262[_0xb9a8('0x18')](_0x1a05e6);return _0x458262[_0xb9a8('0x1e')](_0xb9a8('0x1f'),_0x1d34f1+'-'+_0x37d29e+'/'+_0x475c1d)[_0xb9a8('0x20')](_0x2dbe06);}return null;};}function patchUpdates(_0x1ddc5d){return function(_0x55b236){try{jsonpatch[_0xb9a8('0x21')](_0x55b236,_0x1ddc5d,!![]);}catch(_0x53d0d6){return BPromise[_0xb9a8('0x22')](_0x53d0d6);}return _0x55b236['save']();};}function saveUpdates(_0x598b97,_0x3b1d4f){return function(_0xa4883){if(_0xa4883){return _0xa4883[_0xb9a8('0x23')](_0x598b97)[_0xb9a8('0x24')](function(_0x264fb5){return _0x264fb5;});}return null;};}function removeEntity(_0x462af2,_0x53a25b){return function(_0x28fe5e){if(_0x28fe5e){return _0x28fe5e[_0xb9a8('0x25')]()[_0xb9a8('0x24')](function(){_0x462af2[_0xb9a8('0x18')](0xcc)[_0xb9a8('0x19')]();});}};}function handleEntityNotFound(_0x4e6795,_0xee8f3f){return function(_0x1787aa){if(!_0x1787aa){_0x4e6795[_0xb9a8('0x26')](0x194);}return _0x1787aa;};}function handleError(_0x41e270,_0x2fa42c){_0x2fa42c=_0x2fa42c||0x1f4;return function(_0x845311){logger[_0xb9a8('0x27')](_0x845311[_0xb9a8('0x28')]);if(_0x845311[_0xb9a8('0x29')]){delete _0x845311[_0xb9a8('0x29')];}_0x41e270[_0xb9a8('0x18')](_0x2fa42c)[_0xb9a8('0x2a')](_0x845311);};}exports[_0xb9a8('0x2b')]=function(_0x2aca67,_0x5cee0f){var _0x129b3f={},_0x41715a={},_0x209170={'count':0x0,'rows':[]};var _0x338fe2=_['map'](db[_0xb9a8('0x2c')][_0xb9a8('0x2d')],function(_0xe4741){return{'name':_0xe4741['fieldName'],'type':_0xe4741[_0xb9a8('0x2e')][_0xb9a8('0x2f')]};});_0x41715a[_0xb9a8('0x30')]=_['map'](_0x338fe2,_0xb9a8('0x29'));_0x41715a[_0xb9a8('0x31')]=_['keys'](_0x2aca67[_0xb9a8('0x31')]);_0x41715a['filters']=_[_0xb9a8('0x32')](_0x41715a[_0xb9a8('0x30')],_0x41715a[_0xb9a8('0x31')]);_0x129b3f[_0xb9a8('0x33')]=_[_0xb9a8('0x32')](_0x41715a[_0xb9a8('0x30')],qs['fields'](_0x2aca67[_0xb9a8('0x31')][_0xb9a8('0x34')]));_0x129b3f[_0xb9a8('0x33')]=_0x129b3f[_0xb9a8('0x33')][_0xb9a8('0x35')]?_0x129b3f[_0xb9a8('0x33')]:_0x41715a[_0xb9a8('0x30')];if(!_0x2aca67[_0xb9a8('0x31')][_0xb9a8('0x36')](_0xb9a8('0x37'))){_0x129b3f[_0xb9a8('0x1b')]=qs['limit'](_0x2aca67[_0xb9a8('0x31')][_0xb9a8('0x1b')]);_0x129b3f['offset']=qs[_0xb9a8('0x1a')](_0x2aca67['query'][_0xb9a8('0x1a')]);}_0x129b3f[_0xb9a8('0x38')]=qs[_0xb9a8('0x39')](_0x2aca67[_0xb9a8('0x31')][_0xb9a8('0x39')]);_0x129b3f[_0xb9a8('0x3a')]=qs['filters'](_[_0xb9a8('0x3b')](_0x2aca67[_0xb9a8('0x31')],_0x41715a[_0xb9a8('0x3c')]),_0x338fe2);if(_0x2aca67[_0xb9a8('0x31')][_0xb9a8('0x3d')]){_0x129b3f['where']=_[_0xb9a8('0x3e')](_0x129b3f['where'],{'$or':_['map'](_0x338fe2,function(_0x83b935){if(_0x83b935['type']!==_0xb9a8('0x3f')){var _0x2702c4={};_0x2702c4[_0x83b935[_0xb9a8('0x29')]]={'$like':'%'+_0x2aca67['query']['filter']+'%'};return _0x2702c4;}})});}_0x129b3f=_[_0xb9a8('0x3e')]({},_0x129b3f,_0x2aca67[_0xb9a8('0x40')]);var _0x1e96d8={'where':_0x129b3f[_0xb9a8('0x3a')]};return db[_0xb9a8('0x2c')]['count'](_0x1e96d8)['then'](function(_0x2989c2){_0x209170[_0xb9a8('0x1d')]=_0x2989c2;if(_0x2aca67['query'][_0xb9a8('0x41')]){_0x129b3f[_0xb9a8('0x42')]=[{'all':!![]}];}return db[_0xb9a8('0x2c')][_0xb9a8('0x43')](_0x129b3f);})[_0xb9a8('0x24')](function(_0x5ad463){_0x209170[_0xb9a8('0x44')]=_0x5ad463;return _0x209170;})['then'](respondWithFilteredResult(_0x5cee0f,_0x129b3f))[_0xb9a8('0x45')](handleError(_0x5cee0f,null));};exports['show']=function(_0x460f3b,_0x5130b9){var _0x1356fd={'raw':![],'where':{'id':_0x460f3b['params']['id']}},_0x103e2d={};_0x103e2d[_0xb9a8('0x30')]=_['keys'](db[_0xb9a8('0x2c')][_0xb9a8('0x2d')]);_0x103e2d[_0xb9a8('0x31')]=_['keys'](_0x460f3b[_0xb9a8('0x31')]);_0x103e2d[_0xb9a8('0x3c')]=_['intersection'](_0x103e2d['model'],_0x103e2d[_0xb9a8('0x31')]);_0x1356fd[_0xb9a8('0x33')]=_['intersection'](_0x103e2d[_0xb9a8('0x30')],qs[_0xb9a8('0x34')](_0x460f3b[_0xb9a8('0x31')]['fields']));_0x1356fd[_0xb9a8('0x33')]=_0x1356fd[_0xb9a8('0x33')]['length']?_0x1356fd[_0xb9a8('0x33')]:_0x103e2d[_0xb9a8('0x30')];if(_0x460f3b[_0xb9a8('0x31')][_0xb9a8('0x41')]){_0x1356fd[_0xb9a8('0x42')]=[{'all':!![]}];}_0x1356fd=_['merge']({},_0x1356fd,_0x460f3b['options']);return db[_0xb9a8('0x2c')][_0xb9a8('0x46')](_0x1356fd)['then'](handleEntityNotFound(_0x5130b9,null))['then'](respondWithResult(_0x5130b9,null))[_0xb9a8('0x45')](handleError(_0x5130b9,null));};exports['create']=function(_0x9155e2,_0x560a8b){return db[_0xb9a8('0x2c')]['create'](_0x9155e2['body'],{})['then'](respondWithResult(_0x560a8b,0xc9))[_0xb9a8('0x45')](handleError(_0x560a8b,null));};exports['update']=function(_0x4bb038,_0x22e1ae){if(_0x4bb038['body']['id']){delete _0x4bb038[_0xb9a8('0x47')]['id'];}return db[_0xb9a8('0x2c')]['find']({'where':{'id':_0x4bb038[_0xb9a8('0x48')]['id']}})[_0xb9a8('0x24')](handleEntityNotFound(_0x22e1ae,null))['then'](saveUpdates(_0x4bb038['body'],null))['then'](respondWithResult(_0x22e1ae,null))[_0xb9a8('0x45')](handleError(_0x22e1ae,null));};exports[_0xb9a8('0x25')]=function(_0xbf3a75,_0x112690){return db[_0xb9a8('0x2c')][_0xb9a8('0x46')]({'where':{'id':_0xbf3a75[_0xb9a8('0x48')]['id']}})[_0xb9a8('0x24')](handleEntityNotFound(_0x112690,null))[_0xb9a8('0x24')](removeEntity(_0x112690,null))[_0xb9a8('0x45')](handleError(_0x112690,null));};exports[_0xb9a8('0x49')]=function(_0x59e79e,_0x7b205f,_0x195831){var _0x5e9b3b={};var _0x16f062={};var _0x31b1b6;var _0x1211ad;return db[_0xb9a8('0x2c')][_0xb9a8('0x4a')]({'where':{'id':_0x59e79e['params']['id']}})[_0xb9a8('0x24')](handleEntityNotFound(_0x7b205f,null))['then'](function(_0x29677a){if(_0x29677a){_0x31b1b6=_0x29677a;_0x16f062[_0xb9a8('0x30')]=_['keys'](db[_0xb9a8('0x4b')][_0xb9a8('0x2d')]);_0x16f062[_0xb9a8('0x31')]=_[_0xb9a8('0x4c')](_0x59e79e[_0xb9a8('0x31')]);_0x16f062[_0xb9a8('0x3c')]=_[_0xb9a8('0x32')](_0x16f062['model'],_0x16f062[_0xb9a8('0x31')]);_0x5e9b3b[_0xb9a8('0x33')]=_[_0xb9a8('0x32')](_0x16f062[_0xb9a8('0x30')],qs[_0xb9a8('0x34')](_0x59e79e[_0xb9a8('0x31')][_0xb9a8('0x34')]));_0x5e9b3b['attributes']=_0x5e9b3b[_0xb9a8('0x33')][_0xb9a8('0x35')]?_0x5e9b3b[_0xb9a8('0x33')]:_0x16f062[_0xb9a8('0x30')];_0x5e9b3b['order']=qs['sort'](_0x59e79e['query'][_0xb9a8('0x39')]);_0x5e9b3b[_0xb9a8('0x3a')]=qs[_0xb9a8('0x3c')](_[_0xb9a8('0x3b')](_0x59e79e[_0xb9a8('0x31')],_0x16f062[_0xb9a8('0x3c')]));if(_0x59e79e[_0xb9a8('0x31')][_0xb9a8('0x3d')]){_0x5e9b3b[_0xb9a8('0x3a')]=_[_0xb9a8('0x3e')](_0x5e9b3b['where'],{'$or':_[_0xb9a8('0x4d')](_0x5e9b3b[_0xb9a8('0x33')],function(_0x13f117){var _0x2d0296={};_0x2d0296[_0x13f117]={'$like':'%'+_0x59e79e[_0xb9a8('0x31')][_0xb9a8('0x3d')]+'%'};return _0x2d0296;})});}_0x5e9b3b=_[_0xb9a8('0x3e')]({},_0x5e9b3b,_0x59e79e['options']);return _0x31b1b6['getSubjects'](_0x5e9b3b);}})[_0xb9a8('0x24')](function(_0x2ecc00){if(_0x2ecc00){_0x1211ad=_0x2ecc00[_0xb9a8('0x35')];if(!_0x59e79e[_0xb9a8('0x31')]['hasOwnProperty'](_0xb9a8('0x37'))){_0x5e9b3b['limit']=qs[_0xb9a8('0x1b')](_0x59e79e[_0xb9a8('0x31')][_0xb9a8('0x1b')]);_0x5e9b3b['offset']=qs['offset'](_0x59e79e[_0xb9a8('0x31')][_0xb9a8('0x1a')]);}return _0x31b1b6['getSubjects'](_0x5e9b3b);}})[_0xb9a8('0x24')](function(_0x24c0df){if(_0x24c0df){return _0x24c0df?{'count':_0x1211ad,'rows':_0x24c0df}:null;}})[_0xb9a8('0x24')](respondWithResult(_0x7b205f,null))[_0xb9a8('0x45')](handleError(_0x7b205f,null));};exports[_0xb9a8('0x4e')]=function(_0x2fd710,_0x342cce,_0x2c79fd){var _0x2a4a08={};var _0x530fc8={};var _0x135c29;var _0x1dbcee;return db[_0xb9a8('0x2c')][_0xb9a8('0x4a')]({'where':{'id':_0x2fd710['params']['id']}})[_0xb9a8('0x24')](handleEntityNotFound(_0x342cce,null))[_0xb9a8('0x24')](function(_0x3bc904){if(_0x3bc904){_0x135c29=_0x3bc904;_0x530fc8[_0xb9a8('0x30')]=_[_0xb9a8('0x4c')](db[_0xb9a8('0x4b')][_0xb9a8('0x2d')]);_0x530fc8[_0xb9a8('0x31')]=_['keys'](_0x2fd710[_0xb9a8('0x31')]);_0x530fc8['filters']=_['intersection'](_0x530fc8[_0xb9a8('0x30')],_0x530fc8['query']);_0x2a4a08[_0xb9a8('0x33')]=_[_0xb9a8('0x32')](_0x530fc8['model'],qs[_0xb9a8('0x34')](_0x2fd710['query'][_0xb9a8('0x34')]));_0x2a4a08['attributes']=_0x2a4a08[_0xb9a8('0x33')][_0xb9a8('0x35')]?_0x2a4a08[_0xb9a8('0x33')]:_0x530fc8['model'];_0x2a4a08['order']=qs[_0xb9a8('0x39')](_0x2fd710['query'][_0xb9a8('0x39')]);_0x2a4a08['where']=qs[_0xb9a8('0x3c')](_[_0xb9a8('0x3b')](_0x2fd710['query'],_0x530fc8[_0xb9a8('0x3c')]));if(_0x2fd710['query'][_0xb9a8('0x3d')]){_0x2a4a08[_0xb9a8('0x3a')]=_[_0xb9a8('0x3e')](_0x2a4a08['where'],{'$or':_[_0xb9a8('0x4d')](_0x2a4a08[_0xb9a8('0x33')],function(_0x3fbf6b){var _0x1802d0={};_0x1802d0[_0x3fbf6b]={'$like':'%'+_0x2fd710['query'][_0xb9a8('0x3d')]+'%'};return _0x1802d0;})});}_0x2a4a08=_[_0xb9a8('0x3e')]({},_0x2a4a08,_0x2fd710[_0xb9a8('0x40')]);return _0x135c29[_0xb9a8('0x4e')](_0x2a4a08);}})[_0xb9a8('0x24')](function(_0x2064b3){if(_0x2064b3){_0x1dbcee=_0x2064b3[_0xb9a8('0x35')];if(!_0x2fd710[_0xb9a8('0x31')]['hasOwnProperty']('nolimit')){_0x2a4a08['limit']=qs['limit'](_0x2fd710[_0xb9a8('0x31')][_0xb9a8('0x1b')]);_0x2a4a08[_0xb9a8('0x1a')]=qs[_0xb9a8('0x1a')](_0x2fd710[_0xb9a8('0x31')][_0xb9a8('0x1a')]);}return _0x135c29[_0xb9a8('0x4e')](_0x2a4a08);}})[_0xb9a8('0x24')](function(_0x1b3b73){if(_0x1b3b73){return _0x1b3b73?{'count':_0x1dbcee,'rows':_0x1b3b73}:null;}})[_0xb9a8('0x24')](respondWithResult(_0x342cce,null))['catch'](handleError(_0x342cce,null));};exports[_0xb9a8('0x4f')]=function(_0x1ec68d,_0x573b40,_0x2b2bd7){var _0x3bff62={};var _0x51bebf={};var _0x535969;var _0x38208d;return db[_0xb9a8('0x2c')][_0xb9a8('0x4a')]({'where':{'id':_0x1ec68d[_0xb9a8('0x48')]['id']}})[_0xb9a8('0x24')](handleEntityNotFound(_0x573b40,null))['then'](function(_0x330b7c){if(_0x330b7c){_0x535969=_0x330b7c;_0x51bebf[_0xb9a8('0x30')]=_[_0xb9a8('0x4c')](db['FreshsalesField'][_0xb9a8('0x2d')]);_0x51bebf['query']=_['keys'](_0x1ec68d[_0xb9a8('0x31')]);_0x51bebf['filters']=_['intersection'](_0x51bebf[_0xb9a8('0x30')],_0x51bebf[_0xb9a8('0x31')]);_0x3bff62['attributes']=_[_0xb9a8('0x32')](_0x51bebf[_0xb9a8('0x30')],qs[_0xb9a8('0x34')](_0x1ec68d['query'][_0xb9a8('0x34')]));_0x3bff62[_0xb9a8('0x33')]=_0x3bff62[_0xb9a8('0x33')][_0xb9a8('0x35')]?_0x3bff62[_0xb9a8('0x33')]:_0x51bebf['model'];_0x3bff62[_0xb9a8('0x38')]=qs[_0xb9a8('0x39')](_0x1ec68d[_0xb9a8('0x31')]['sort']);_0x3bff62[_0xb9a8('0x3a')]=qs[_0xb9a8('0x3c')](_['pick'](_0x1ec68d[_0xb9a8('0x31')],_0x51bebf['filters']));if(_0x1ec68d['query'][_0xb9a8('0x3d')]){_0x3bff62[_0xb9a8('0x3a')]=_['merge'](_0x3bff62[_0xb9a8('0x3a')],{'$or':_['map'](_0x3bff62[_0xb9a8('0x33')],function(_0x97d342){var _0x4ee9dd={};_0x4ee9dd[_0x97d342]={'$like':'%'+_0x1ec68d[_0xb9a8('0x31')][_0xb9a8('0x3d')]+'%'};return _0x4ee9dd;})});}_0x3bff62=_[_0xb9a8('0x3e')]({},_0x3bff62,_0x1ec68d['options']);return _0x535969[_0xb9a8('0x4f')](_0x3bff62);}})[_0xb9a8('0x24')](function(_0x263893){if(_0x263893){_0x38208d=_0x263893['length'];if(!_0x1ec68d[_0xb9a8('0x31')]['hasOwnProperty'](_0xb9a8('0x37'))){_0x3bff62[_0xb9a8('0x1b')]=qs['limit'](_0x1ec68d[_0xb9a8('0x31')][_0xb9a8('0x1b')]);_0x3bff62[_0xb9a8('0x1a')]=qs[_0xb9a8('0x1a')](_0x1ec68d['query'][_0xb9a8('0x1a')]);}return _0x535969[_0xb9a8('0x4f')](_0x3bff62);}})[_0xb9a8('0x24')](function(_0x31c194){if(_0x31c194){return _0x31c194?{'count':_0x38208d,'rows':_0x31c194}:null;}})['then'](respondWithResult(_0x573b40,null))[_0xb9a8('0x45')](handleError(_0x573b40,null));}; \ No newline at end of file +var _0x8591=['error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','getSubjects','findOne','FreshsalesField','order','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8591,0xd3));var _0x1859=function(_0x3061a1,_0x119d80){_0x3061a1=_0x3061a1-0x0;var _0x4108b6=_0x8591[_0x3061a1];return _0x4108b6;};'use strict';var emlformat=require(_0x1859('0x0'));var rimraf=require(_0x1859('0x1'));var zipdir=require(_0x1859('0x2'));var jsonpatch=require(_0x1859('0x3'));var rp=require(_0x1859('0x4'));var moment=require(_0x1859('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1859('0x6'));var util=require(_0x1859('0x7'));var path=require(_0x1859('0x8'));var sox=require(_0x1859('0x9'));var csv=require(_0x1859('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1859('0xb'));var squel=require(_0x1859('0xc'));var crypto=require(_0x1859('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1859('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1859('0xf'));var Papa=require(_0x1859('0x10'));var Redis=require(_0x1859('0x11'));var authService=require(_0x1859('0x12'));var qs=require(_0x1859('0x13'));var as=require(_0x1859('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1859('0x15'))('api');var utils=require(_0x1859('0x16'));var config=require(_0x1859('0x17'));var licenseUtil=require(_0x1859('0x18'));var db=require(_0x1859('0x19'))['db'];function respondWithStatusCode(_0x143578,_0x24bcb3){_0x24bcb3=_0x24bcb3||0xcc;return function(_0x262123){if(_0x262123){return _0x143578[_0x1859('0x1a')](_0x24bcb3);}return _0x143578[_0x1859('0x1b')](_0x24bcb3)[_0x1859('0x1c')]();};}function respondWithResult(_0x4e1536,_0x39d533){_0x39d533=_0x39d533||0xc8;return function(_0x12fcd6){if(_0x12fcd6){return _0x4e1536['status'](_0x39d533)['json'](_0x12fcd6);}};}function respondWithFilteredResult(_0x101980,_0x4b25a1){return function(_0x50fb18){if(_0x50fb18){var _0x567091=typeof _0x4b25a1['offset']===_0x1859('0x1d')&&typeof _0x4b25a1[_0x1859('0x1e')]===_0x1859('0x1d');var _0x24d620=_0x50fb18[_0x1859('0x1f')];var _0x51628f=_0x567091?0x0:_0x4b25a1[_0x1859('0x20')];var _0x4bf686=_0x567091?_0x50fb18['count']:_0x4b25a1['offset']+_0x4b25a1[_0x1859('0x1e')];var _0x596e57;if(_0x4bf686>=_0x24d620){_0x4bf686=_0x24d620;_0x596e57=0xc8;}else{_0x596e57=0xce;}_0x101980[_0x1859('0x1b')](_0x596e57);return _0x101980[_0x1859('0x21')]('Content-Range',_0x51628f+'-'+_0x4bf686+'/'+_0x24d620)[_0x1859('0x22')](_0x50fb18);}return null;};}function patchUpdates(_0x3d29aa){return function(_0x235c27){try{jsonpatch[_0x1859('0x23')](_0x235c27,_0x3d29aa,!![]);}catch(_0x2c6c16){return BPromise[_0x1859('0x24')](_0x2c6c16);}return _0x235c27[_0x1859('0x25')]();};}function saveUpdates(_0x3e3caa,_0x3ccdc5){return function(_0x8d1000){if(_0x8d1000){return _0x8d1000[_0x1859('0x26')](_0x3e3caa)[_0x1859('0x27')](function(_0xa8042f){return _0xa8042f;});}return null;};}function removeEntity(_0xcb7544,_0x571baa){return function(_0x439720){if(_0x439720){return _0x439720[_0x1859('0x28')]()[_0x1859('0x27')](function(){_0xcb7544['status'](0xcc)[_0x1859('0x1c')]();});}};}function handleEntityNotFound(_0x34508e,_0x24baf9){return function(_0x35fa4e){if(!_0x35fa4e){_0x34508e[_0x1859('0x1a')](0x194);}return _0x35fa4e;};}function handleError(_0x8caae8,_0x4807dc){_0x4807dc=_0x4807dc||0x1f4;return function(_0x25800c){logger[_0x1859('0x29')](_0x25800c['stack']);if(_0x25800c[_0x1859('0x2a')]){delete _0x25800c[_0x1859('0x2a')];}_0x8caae8[_0x1859('0x1b')](_0x4807dc)[_0x1859('0x2b')](_0x25800c);};}exports[_0x1859('0x2c')]=function(_0xbe04d4,_0x707b4){var _0x241058={},_0xa00d68={},_0x31ad9c={'count':0x0,'rows':[]};var _0x82233=_[_0x1859('0x2d')](db[_0x1859('0x2e')][_0x1859('0x2f')],function(_0x56f038){return{'name':_0x56f038[_0x1859('0x30')],'type':_0x56f038[_0x1859('0x31')][_0x1859('0x32')]};});_0xa00d68['model']=_[_0x1859('0x2d')](_0x82233,_0x1859('0x2a'));_0xa00d68['query']=_[_0x1859('0x33')](_0xbe04d4[_0x1859('0x34')]);_0xa00d68[_0x1859('0x35')]=_[_0x1859('0x36')](_0xa00d68['model'],_0xa00d68[_0x1859('0x34')]);_0x241058[_0x1859('0x37')]=_[_0x1859('0x36')](_0xa00d68['model'],qs[_0x1859('0x38')](_0xbe04d4['query']['fields']));_0x241058[_0x1859('0x37')]=_0x241058['attributes'][_0x1859('0x39')]?_0x241058[_0x1859('0x37')]:_0xa00d68[_0x1859('0x3a')];if(!_0xbe04d4[_0x1859('0x34')][_0x1859('0x3b')](_0x1859('0x3c'))){_0x241058[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0xbe04d4[_0x1859('0x34')][_0x1859('0x1e')]);_0x241058[_0x1859('0x20')]=qs[_0x1859('0x20')](_0xbe04d4[_0x1859('0x34')]['offset']);}_0x241058['order']=qs['sort'](_0xbe04d4['query'][_0x1859('0x3d')]);_0x241058['where']=qs[_0x1859('0x35')](_['pick'](_0xbe04d4[_0x1859('0x34')],_0xa00d68[_0x1859('0x35')]),_0x82233);if(_0xbe04d4[_0x1859('0x34')][_0x1859('0x3e')]){_0x241058[_0x1859('0x3f')]=_['merge'](_0x241058[_0x1859('0x3f')],{'$or':_[_0x1859('0x2d')](_0x82233,function(_0xacf483){if(_0xacf483['type']!==_0x1859('0x40')){var _0x25461f={};_0x25461f[_0xacf483[_0x1859('0x2a')]]={'$like':'%'+_0xbe04d4[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0x25461f;}})});}_0x241058=_[_0x1859('0x41')]({},_0x241058,_0xbe04d4[_0x1859('0x42')]);var _0x3319ff={'where':_0x241058[_0x1859('0x3f')]};return db['FreshsalesConfiguration'][_0x1859('0x1f')](_0x3319ff)['then'](function(_0x56ba9a){_0x31ad9c['count']=_0x56ba9a;if(_0xbe04d4[_0x1859('0x34')]['includeAll']){_0x241058['include']=[{'all':!![]}];}return db[_0x1859('0x2e')][_0x1859('0x43')](_0x241058);})[_0x1859('0x27')](function(_0x260b52){_0x31ad9c[_0x1859('0x44')]=_0x260b52;return _0x31ad9c;})['then'](respondWithFilteredResult(_0x707b4,_0x241058))[_0x1859('0x45')](handleError(_0x707b4,null));};exports[_0x1859('0x46')]=function(_0x598de1,_0x4e7839){var _0x24bffd={'raw':![],'where':{'id':_0x598de1['params']['id']}},_0xa0e988={};_0xa0e988[_0x1859('0x3a')]=_[_0x1859('0x33')](db[_0x1859('0x2e')][_0x1859('0x2f')]);_0xa0e988['query']=_[_0x1859('0x33')](_0x598de1[_0x1859('0x34')]);_0xa0e988[_0x1859('0x35')]=_[_0x1859('0x36')](_0xa0e988[_0x1859('0x3a')],_0xa0e988['query']);_0x24bffd[_0x1859('0x37')]=_['intersection'](_0xa0e988[_0x1859('0x3a')],qs[_0x1859('0x38')](_0x598de1[_0x1859('0x34')][_0x1859('0x38')]));_0x24bffd[_0x1859('0x37')]=_0x24bffd[_0x1859('0x37')][_0x1859('0x39')]?_0x24bffd[_0x1859('0x37')]:_0xa0e988[_0x1859('0x3a')];if(_0x598de1[_0x1859('0x34')][_0x1859('0x47')]){_0x24bffd[_0x1859('0x48')]=[{'all':!![]}];}_0x24bffd=_[_0x1859('0x41')]({},_0x24bffd,_0x598de1[_0x1859('0x42')]);return db[_0x1859('0x2e')][_0x1859('0x49')](_0x24bffd)[_0x1859('0x27')](handleEntityNotFound(_0x4e7839,null))[_0x1859('0x27')](respondWithResult(_0x4e7839,null))[_0x1859('0x45')](handleError(_0x4e7839,null));};exports[_0x1859('0x4a')]=function(_0x58537,_0xdd5b7){return db[_0x1859('0x2e')][_0x1859('0x4a')](_0x58537[_0x1859('0x4b')],{})[_0x1859('0x27')](respondWithResult(_0xdd5b7,0xc9))['catch'](handleError(_0xdd5b7,null));};exports[_0x1859('0x26')]=function(_0x42d704,_0x4f0e9b){if(_0x42d704[_0x1859('0x4b')]['id']){delete _0x42d704[_0x1859('0x4b')]['id'];}return db['FreshsalesConfiguration'][_0x1859('0x49')]({'where':{'id':_0x42d704[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x4f0e9b,null))[_0x1859('0x27')](saveUpdates(_0x42d704[_0x1859('0x4b')],null))['then'](respondWithResult(_0x4f0e9b,null))[_0x1859('0x45')](handleError(_0x4f0e9b,null));};exports[_0x1859('0x28')]=function(_0x55be31,_0x1ba41b){return db[_0x1859('0x2e')][_0x1859('0x49')]({'where':{'id':_0x55be31['params']['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x1ba41b,null))['then'](removeEntity(_0x1ba41b,null))['catch'](handleError(_0x1ba41b,null));};exports[_0x1859('0x4d')]=function(_0x529c65,_0x202a99,_0x4ab714){var _0xeb35b4={};var _0x2b614e={};var _0x82a61b;var _0x10cc42;return db[_0x1859('0x2e')][_0x1859('0x4e')]({'where':{'id':_0x529c65[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x202a99,null))['then'](function(_0x3d7209){if(_0x3d7209){_0x82a61b=_0x3d7209;_0x2b614e['model']=_[_0x1859('0x33')](db[_0x1859('0x4f')][_0x1859('0x2f')]);_0x2b614e[_0x1859('0x34')]=_['keys'](_0x529c65[_0x1859('0x34')]);_0x2b614e[_0x1859('0x35')]=_[_0x1859('0x36')](_0x2b614e[_0x1859('0x3a')],_0x2b614e[_0x1859('0x34')]);_0xeb35b4[_0x1859('0x37')]=_['intersection'](_0x2b614e[_0x1859('0x3a')],qs['fields'](_0x529c65[_0x1859('0x34')][_0x1859('0x38')]));_0xeb35b4['attributes']=_0xeb35b4[_0x1859('0x37')][_0x1859('0x39')]?_0xeb35b4[_0x1859('0x37')]:_0x2b614e['model'];_0xeb35b4[_0x1859('0x50')]=qs['sort'](_0x529c65['query']['sort']);_0xeb35b4['where']=qs[_0x1859('0x35')](_['pick'](_0x529c65[_0x1859('0x34')],_0x2b614e[_0x1859('0x35')]));if(_0x529c65['query'][_0x1859('0x3e')]){_0xeb35b4[_0x1859('0x3f')]=_[_0x1859('0x41')](_0xeb35b4[_0x1859('0x3f')],{'$or':_['map'](_0xeb35b4[_0x1859('0x37')],function(_0x58a5a4){var _0x2ae5f3={};_0x2ae5f3[_0x58a5a4]={'$like':'%'+_0x529c65['query']['filter']+'%'};return _0x2ae5f3;})});}_0xeb35b4=_[_0x1859('0x41')]({},_0xeb35b4,_0x529c65[_0x1859('0x42')]);return _0x82a61b['getSubjects'](_0xeb35b4);}})[_0x1859('0x27')](function(_0x2fea0d){if(_0x2fea0d){_0x10cc42=_0x2fea0d['length'];if(!_0x529c65[_0x1859('0x34')][_0x1859('0x3b')](_0x1859('0x3c'))){_0xeb35b4[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0x529c65[_0x1859('0x34')][_0x1859('0x1e')]);_0xeb35b4[_0x1859('0x20')]=qs['offset'](_0x529c65[_0x1859('0x34')][_0x1859('0x20')]);}return _0x82a61b[_0x1859('0x4d')](_0xeb35b4);}})['then'](function(_0x32544c){if(_0x32544c){return _0x32544c?{'count':_0x10cc42,'rows':_0x32544c}:null;}})[_0x1859('0x27')](respondWithResult(_0x202a99,null))[_0x1859('0x45')](handleError(_0x202a99,null));};exports[_0x1859('0x51')]=function(_0xf33ddd,_0x5bbd5d,_0x8f789d){var _0x1e4808={};var _0x3b6cee={};var _0x1a6c2d;var _0x5c3c15;return db[_0x1859('0x2e')]['findOne']({'where':{'id':_0xf33ddd[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x5bbd5d,null))['then'](function(_0x676450){if(_0x676450){_0x1a6c2d=_0x676450;_0x3b6cee[_0x1859('0x3a')]=_['keys'](db['FreshsalesField'][_0x1859('0x2f')]);_0x3b6cee[_0x1859('0x34')]=_[_0x1859('0x33')](_0xf33ddd[_0x1859('0x34')]);_0x3b6cee[_0x1859('0x35')]=_[_0x1859('0x36')](_0x3b6cee['model'],_0x3b6cee['query']);_0x1e4808['attributes']=_[_0x1859('0x36')](_0x3b6cee[_0x1859('0x3a')],qs[_0x1859('0x38')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x38')]));_0x1e4808[_0x1859('0x37')]=_0x1e4808[_0x1859('0x37')][_0x1859('0x39')]?_0x1e4808[_0x1859('0x37')]:_0x3b6cee[_0x1859('0x3a')];_0x1e4808[_0x1859('0x50')]=qs[_0x1859('0x3d')](_0xf33ddd['query'][_0x1859('0x3d')]);_0x1e4808[_0x1859('0x3f')]=qs[_0x1859('0x35')](_[_0x1859('0x52')](_0xf33ddd[_0x1859('0x34')],_0x3b6cee[_0x1859('0x35')]));if(_0xf33ddd[_0x1859('0x34')]['filter']){_0x1e4808['where']=_[_0x1859('0x41')](_0x1e4808[_0x1859('0x3f')],{'$or':_[_0x1859('0x2d')](_0x1e4808[_0x1859('0x37')],function(_0x1b52c6){var _0x2892ba={};_0x2892ba[_0x1b52c6]={'$like':'%'+_0xf33ddd[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0x2892ba;})});}_0x1e4808=_['merge']({},_0x1e4808,_0xf33ddd['options']);return _0x1a6c2d[_0x1859('0x51')](_0x1e4808);}})[_0x1859('0x27')](function(_0x149863){if(_0x149863){_0x5c3c15=_0x149863['length'];if(!_0xf33ddd[_0x1859('0x34')][_0x1859('0x3b')]('nolimit')){_0x1e4808[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x1e')]);_0x1e4808[_0x1859('0x20')]=qs[_0x1859('0x20')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x20')]);}return _0x1a6c2d[_0x1859('0x51')](_0x1e4808);}})[_0x1859('0x27')](function(_0x1bccfa){if(_0x1bccfa){return _0x1bccfa?{'count':_0x5c3c15,'rows':_0x1bccfa}:null;}})['then'](respondWithResult(_0x5bbd5d,null))[_0x1859('0x45')](handleError(_0x5bbd5d,null));};exports['getFields']=function(_0x2acd7a,_0x16bd93,_0x131b67){var _0x1603da={};var _0x418606={};var _0x366253;var _0x2a4b82;return db[_0x1859('0x2e')][_0x1859('0x4e')]({'where':{'id':_0x2acd7a[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x16bd93,null))['then'](function(_0x9861d3){if(_0x9861d3){_0x366253=_0x9861d3;_0x418606[_0x1859('0x3a')]=_[_0x1859('0x33')](db['FreshsalesField'][_0x1859('0x2f')]);_0x418606[_0x1859('0x34')]=_[_0x1859('0x33')](_0x2acd7a[_0x1859('0x34')]);_0x418606[_0x1859('0x35')]=_[_0x1859('0x36')](_0x418606[_0x1859('0x3a')],_0x418606['query']);_0x1603da[_0x1859('0x37')]=_[_0x1859('0x36')](_0x418606[_0x1859('0x3a')],qs[_0x1859('0x38')](_0x2acd7a['query'][_0x1859('0x38')]));_0x1603da[_0x1859('0x37')]=_0x1603da[_0x1859('0x37')][_0x1859('0x39')]?_0x1603da['attributes']:_0x418606[_0x1859('0x3a')];_0x1603da[_0x1859('0x50')]=qs[_0x1859('0x3d')](_0x2acd7a['query'][_0x1859('0x3d')]);_0x1603da['where']=qs[_0x1859('0x35')](_[_0x1859('0x52')](_0x2acd7a['query'],_0x418606['filters']));if(_0x2acd7a['query'][_0x1859('0x3e')]){_0x1603da[_0x1859('0x3f')]=_[_0x1859('0x41')](_0x1603da[_0x1859('0x3f')],{'$or':_['map'](_0x1603da['attributes'],function(_0x4313f5){var _0xefd395={};_0xefd395[_0x4313f5]={'$like':'%'+_0x2acd7a[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0xefd395;})});}_0x1603da=_[_0x1859('0x41')]({},_0x1603da,_0x2acd7a[_0x1859('0x42')]);return _0x366253[_0x1859('0x53')](_0x1603da);}})['then'](function(_0x1f4173){if(_0x1f4173){_0x2a4b82=_0x1f4173[_0x1859('0x39')];if(!_0x2acd7a['query'][_0x1859('0x3b')]('nolimit')){_0x1603da[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0x2acd7a[_0x1859('0x34')][_0x1859('0x1e')]);_0x1603da['offset']=qs[_0x1859('0x20')](_0x2acd7a[_0x1859('0x34')][_0x1859('0x20')]);}return _0x366253[_0x1859('0x53')](_0x1603da);}})[_0x1859('0x27')](function(_0x9273bd){if(_0x9273bd){return _0x9273bd?{'count':_0x2a4b82,'rows':_0x9273bd}:null;}})[_0x1859('0x27')](respondWithResult(_0x16bd93,null))[_0x1859('0x45')](handleError(_0x16bd93,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 692afcc..4a5f2da 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 _0x0fe2=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x52b5f6,_0x334368){var _0x250383=function(_0x298738){while(--_0x298738){_0x52b5f6['push'](_0x52b5f6['shift']());}};_0x250383(++_0x334368);}(_0x0fe2,0xab));var _0x20fe=function(_0x4e1060,_0x3ea39b){_0x4e1060=_0x4e1060-0x0;var _0x226e66=_0x0fe2[_0x4e1060];return _0x226e66;};'use strict';var _=require(_0x20fe('0x0'));var util=require(_0x20fe('0x1'));var logger=require(_0x20fe('0x2'))('api');var moment=require(_0x20fe('0x3'));var BPromise=require(_0x20fe('0x4'));var rp=require(_0x20fe('0x5'));var fs=require('fs');var path=require(_0x20fe('0x6'));var rimraf=require('rimraf');var config=require(_0x20fe('0x7'));var attributes=require(_0x20fe('0x8'));module[_0x20fe('0x9')]=function(_0x4cee06,_0x6765a7){return _0x4cee06[_0x20fe('0xa')](_0x20fe('0xb'),attributes,{'tableName':_0x20fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24ad=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x1131d6,_0x11257a){var _0x3a4e6e=function(_0x21acf7){while(--_0x21acf7){_0x1131d6['push'](_0x1131d6['shift']());}};_0x3a4e6e(++_0x11257a);}(_0x24ad,0x1c3));var _0xd24a=function(_0x56bb68,_0x1eb891){_0x56bb68=_0x56bb68-0x0;var _0x317930=_0x24ad[_0x56bb68];return _0x317930;};'use strict';var _=require(_0xd24a('0x0'));var util=require('util');var logger=require(_0xd24a('0x1'))('api');var moment=require(_0xd24a('0x2'));var BPromise=require(_0xd24a('0x3'));var rp=require(_0xd24a('0x4'));var fs=require('fs');var path=require(_0xd24a('0x5'));var rimraf=require(_0xd24a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd24a('0x7'));module[_0xd24a('0x8')]=function(_0x53cb95,_0x3062d0){return _0x53cb95[_0xd24a('0x9')](_0xd24a('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 88ac2ef..10fa7a5 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 _0x4da4=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x40b6d3,_0x1e8e5b){var _0x8c1389=function(_0x36a8ff){while(--_0x36a8ff){_0x40b6d3['push'](_0x40b6d3['shift']());}};_0x8c1389(++_0x1e8e5b);}(_0x4da4,0x1ed));var _0x44da=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0x4da4[_0x572637];return _0xb6748;};'use strict';var _=require(_0x44da('0x0'));var util=require(_0x44da('0x1'));var moment=require(_0x44da('0x2'));var BPromise=require('bluebird');var rs=require(_0x44da('0x3'));var fs=require('fs');var Redis=require(_0x44da('0x4'));var db=require(_0x44da('0x5'))['db'];var utils=require(_0x44da('0x6'));var logger=require('../../config/logger')(_0x44da('0x7'));var config=require(_0x44da('0x8'));var jayson=require(_0x44da('0x9'));var client=jayson[_0x44da('0xa')][_0x44da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b38c,_0x17a6e1,_0x4bbb1c){return new BPromise(function(_0x4bc6ef,_0x3a1db5){return client[_0x44da('0xc')](_0x15b38c,_0x4bbb1c)[_0x44da('0xd')](function(_0x4b7299){logger[_0x44da('0xe')](_0x44da('0xf'),_0x17a6e1,'request\x20sent');logger[_0x44da('0x10')](_0x44da('0x11'),_0x17a6e1,_0x44da('0x12'),JSON[_0x44da('0x13')](_0x4b7299));if(_0x4b7299['error']){if(_0x4b7299[_0x44da('0x14')][_0x44da('0x15')]===0x1f4){logger[_0x44da('0x14')](_0x44da('0xf'),_0x17a6e1,_0x4b7299['error']['message']);return _0x3a1db5(_0x4b7299['error'][_0x44da('0x16')]);}logger[_0x44da('0x14')](_0x44da('0xf'),_0x17a6e1,_0x4b7299[_0x44da('0x14')][_0x44da('0x16')]);return _0x4bc6ef(_0x4b7299[_0x44da('0x14')]['message']);}else{logger[_0x44da('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x17a6e1,_0x44da('0x12'));_0x4bc6ef(_0x4b7299[_0x44da('0x17')][_0x44da('0x16')]);}})[_0x44da('0x18')](function(_0x566816){logger[_0x44da('0x14')](_0x44da('0xf'),_0x17a6e1,_0x566816);_0x3a1db5(_0x566816);});});} \ No newline at end of file +var _0x791a=['code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2fd61e,_0x408859){var _0x55ee6b=function(_0x175115){while(--_0x175115){_0x2fd61e['push'](_0x2fd61e['shift']());}};_0x55ee6b(++_0x408859);}(_0x791a,0x119));var _0xa791=function(_0xb239a5,_0x5e84c9){_0xb239a5=_0xb239a5-0x0;var _0x1756cf=_0x791a[_0xb239a5];return _0x1756cf;};'use strict';var _=require('lodash');var util=require(_0xa791('0x0'));var moment=require('moment');var BPromise=require(_0xa791('0x1'));var rs=require(_0xa791('0x2'));var fs=require('fs');var Redis=require(_0xa791('0x3'));var db=require(_0xa791('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa791('0x5'))(_0xa791('0x6'));var config=require(_0xa791('0x7'));var jayson=require(_0xa791('0x8'));var client=jayson[_0xa791('0x9')][_0xa791('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446c99,_0x103a8d,_0x24dcfc){return new BPromise(function(_0x405c95,_0x2f6f10){return client[_0xa791('0xb')](_0x446c99,_0x24dcfc)[_0xa791('0xc')](function(_0x2091a0){logger[_0xa791('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x103a8d,'request\x20sent');logger['debug'](_0xa791('0xe'),_0x103a8d,_0xa791('0xf'),JSON[_0xa791('0x10')](_0x2091a0));if(_0x2091a0['error']){if(_0x2091a0[_0xa791('0x11')][_0xa791('0x12')]===0x1f4){logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);return _0x2f6f10(_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);}logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);return _0x405c95(_0x2091a0['error'][_0xa791('0x14')]);}else{logger[_0xa791('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x103a8d,_0xa791('0xf'));_0x405c95(_0x2091a0[_0xa791('0x15')][_0xa791('0x14')]);}})[_0xa791('0x16')](function(_0x5108f7){logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x5108f7);_0x2f6f10(_0x5108f7);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 317d7c9..36b82f4 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 _0xe600=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','create','put'];(function(_0x29b8b0,_0x23b6ec){var _0x5dd8a1=function(_0x352b2a){while(--_0x352b2a){_0x29b8b0['push'](_0x29b8b0['shift']());}};_0x5dd8a1(++_0x23b6ec);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require('path');var timeout=require(_0x0e60('0x1'));var express=require(_0x0e60('0x2'));var router=express[_0x0e60('0x3')]();var fs_extra=require(_0x0e60('0x4'));var auth=require(_0x0e60('0x5'));var interaction=require(_0x0e60('0x6'));var config=require(_0x0e60('0x7'));var controller=require(_0x0e60('0x8'));router[_0x0e60('0x9')]('/',auth[_0x0e60('0xa')](),controller['index']);router[_0x0e60('0x9')](_0x0e60('0xb'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xc')]);router['post']('/',auth[_0x0e60('0xa')](),controller[_0x0e60('0xd')]);router[_0x0e60('0xe')](_0x0e60('0xb'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xf')]);router['delete'](_0x0e60('0xb'),auth[_0x0e60('0xa')](),controller[_0x0e60('0x10')]);module[_0x0e60('0x11')]=router; \ No newline at end of file +var _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x59ab3f,_0x25a848){var _0x1669eb=function(_0x5cf1d4){while(--_0x5cf1d4){_0x59ab3f['push'](_0x59ab3f['shift']());}};_0x1669eb(++_0x25a848);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x1598e8,_0x5df7a7){_0x1598e8=_0x1598e8-0x0;var _0x1f71da=_0xa1fd[_0x1598e8];return _0x1f71da;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e6f04cb..3332dec 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 _0x7c42=['ENUM','customVariable','sequelize','string','variable','picklist','STRING'];(function(_0x3096d6,_0x2ba58a){var _0x32c39d=function(_0x117b00){while(--_0x117b00){_0x3096d6['push'](_0x3096d6['shift']());}};_0x32c39d(++_0x2ba58a);}(_0x7c42,0x1f3));var _0x27c4=function(_0x2c0abc,_0x4d4624){_0x2c0abc=_0x2c0abc-0x0;var _0x32a6ca=_0x7c42[_0x2c0abc];return _0x32a6ca;};'use strict';var Sequelize=require(_0x27c4('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x27c4('0x1'),_0x27c4('0x2'),'customVariable','keyValue',_0x27c4('0x3')),'defaultValue':_0x27c4('0x1')},'content':{'type':Sequelize[_0x27c4('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x27c4('0x5')](_0x27c4('0x1'),_0x27c4('0x2'),_0x27c4('0x6'))},'keyContent':{'type':Sequelize[_0x27c4('0x4')]},'idField':{'type':Sequelize[_0x27c4('0x4')]},'nameField':{'type':Sequelize[_0x27c4('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x27c4('0x4')]}}; \ No newline at end of file +var _0x28c4=['picklist','STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0xb27827,_0x742a3c){var _0x28f6dc=function(_0x3a87d3){while(--_0x3a87d3){_0xb27827['push'](_0xb27827['shift']());}};_0x28f6dc(++_0x742a3c);}(_0x28c4,0x1c4));var _0x428c=function(_0x25d4ee,_0xc95872){_0x25d4ee=_0x25d4ee-0x0;var _0x214a35=_0x28c4[_0x25d4ee];return _0x214a35;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x428c('0x0')](_0x428c('0x1'),'variable',_0x428c('0x2'),_0x428c('0x3'),_0x428c('0x4')),'defaultValue':_0x428c('0x1')},'content':{'type':Sequelize[_0x428c('0x5')]},'key':{'type':Sequelize[_0x428c('0x5')]},'keyType':{'type':Sequelize[_0x428c('0x0')]('string',_0x428c('0x6'),_0x428c('0x2'))},'keyContent':{'type':Sequelize[_0x428c('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x428c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f0cb002..59b6d5b 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 _0x46f5=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','FreshsalesField','rows','catch','intersection','include','options','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x46f5,0x1c8));var _0x546f=function(_0x47fe16,_0x3f4938){_0x47fe16=_0x47fe16-0x0;var _0x6b37b9=_0x46f5[_0x47fe16];return _0x6b37b9;};'use strict';var emlformat=require(_0x546f('0x0'));var rimraf=require(_0x546f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x546f('0x2'));var rp=require(_0x546f('0x3'));var moment=require(_0x546f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x546f('0x5'));var util=require(_0x546f('0x6'));var path=require(_0x546f('0x7'));var sox=require(_0x546f('0x8'));var csv=require(_0x546f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x546f('0xa'));var _=require(_0x546f('0xb'));var squel=require(_0x546f('0xc'));var crypto=require(_0x546f('0xd'));var jsforce=require(_0x546f('0xe'));var deskjs=require(_0x546f('0xf'));var toCsv=require(_0x546f('0x9'));var querystring=require('querystring');var Papa=require(_0x546f('0x10'));var Redis=require(_0x546f('0x11'));var authService=require(_0x546f('0x12'));var qs=require(_0x546f('0x13'));var as=require(_0x546f('0x14'));var hardwareService=require(_0x546f('0x15'));var logger=require(_0x546f('0x16'))(_0x546f('0x17'));var utils=require(_0x546f('0x18'));var config=require(_0x546f('0x19'));var licenseUtil=require(_0x546f('0x1a'));var db=require(_0x546f('0x1b'))['db'];function respondWithStatusCode(_0x1d0a3a,_0x7db5e5){_0x7db5e5=_0x7db5e5||0xcc;return function(_0x47be55){if(_0x47be55){return _0x1d0a3a[_0x546f('0x1c')](_0x7db5e5);}return _0x1d0a3a[_0x546f('0x1d')](_0x7db5e5)['end']();};}function respondWithResult(_0x47fc0d,_0x75e402){_0x75e402=_0x75e402||0xc8;return function(_0x4b5175){if(_0x4b5175){return _0x47fc0d[_0x546f('0x1d')](_0x75e402)[_0x546f('0x1e')](_0x4b5175);}};}function respondWithFilteredResult(_0xaade9d,_0x153a12){return function(_0x193d19){if(_0x193d19){var _0x401cb0=typeof _0x153a12[_0x546f('0x1f')]==='undefined'&&typeof _0x153a12[_0x546f('0x20')]===_0x546f('0x21');var _0xd146f0=_0x193d19[_0x546f('0x22')];var _0x425b4c=_0x401cb0?0x0:_0x153a12[_0x546f('0x1f')];var _0x5a8743=_0x401cb0?_0x193d19[_0x546f('0x22')]:_0x153a12[_0x546f('0x1f')]+_0x153a12[_0x546f('0x20')];var _0x5277f9;if(_0x5a8743>=_0xd146f0){_0x5a8743=_0xd146f0;_0x5277f9=0xc8;}else{_0x5277f9=0xce;}_0xaade9d[_0x546f('0x1d')](_0x5277f9);return _0xaade9d['set'](_0x546f('0x23'),_0x425b4c+'-'+_0x5a8743+'/'+_0xd146f0)[_0x546f('0x1e')](_0x193d19);}return null;};}function patchUpdates(_0x31c46a){return function(_0x1e9595){try{jsonpatch[_0x546f('0x24')](_0x1e9595,_0x31c46a,!![]);}catch(_0x1bece5){return BPromise[_0x546f('0x25')](_0x1bece5);}return _0x1e9595[_0x546f('0x26')]();};}function saveUpdates(_0x429848,_0x5b372d){return function(_0x5cdffc){if(_0x5cdffc){return _0x5cdffc[_0x546f('0x27')](_0x429848)['then'](function(_0x327627){return _0x327627;});}return null;};}function removeEntity(_0x1842ce,_0x2549e2){return function(_0xd3e502){if(_0xd3e502){return _0xd3e502['destroy']()[_0x546f('0x28')](function(){_0x1842ce['status'](0xcc)[_0x546f('0x29')]();});}};}function handleEntityNotFound(_0x53cb94,_0x4c6d29){return function(_0x38ca1e){if(!_0x38ca1e){_0x53cb94['sendStatus'](0x194);}return _0x38ca1e;};}function handleError(_0x195d0e,_0x4ada5d){_0x4ada5d=_0x4ada5d||0x1f4;return function(_0x3df024){logger[_0x546f('0x2a')](_0x3df024[_0x546f('0x2b')]);if(_0x3df024[_0x546f('0x2c')]){delete _0x3df024[_0x546f('0x2c')];}_0x195d0e['status'](_0x4ada5d)[_0x546f('0x2d')](_0x3df024);};}exports[_0x546f('0x2e')]=function(_0x143ed7,_0x415992){var _0x103395={},_0x21ed7c={},_0x4be94b={'count':0x0,'rows':[]};var _0x5951c8=_[_0x546f('0x2f')](db['FreshsalesField'][_0x546f('0x30')],function(_0x1a1e48){return{'name':_0x1a1e48[_0x546f('0x31')],'type':_0x1a1e48['type'][_0x546f('0x32')]};});_0x21ed7c[_0x546f('0x33')]=_[_0x546f('0x2f')](_0x5951c8,_0x546f('0x2c'));_0x21ed7c[_0x546f('0x34')]=_[_0x546f('0x35')](_0x143ed7[_0x546f('0x34')]);_0x21ed7c[_0x546f('0x36')]=_['intersection'](_0x21ed7c['model'],_0x21ed7c[_0x546f('0x34')]);_0x103395[_0x546f('0x37')]=_['intersection'](_0x21ed7c[_0x546f('0x33')],qs[_0x546f('0x38')](_0x143ed7[_0x546f('0x34')][_0x546f('0x38')]));_0x103395[_0x546f('0x37')]=_0x103395[_0x546f('0x37')][_0x546f('0x39')]?_0x103395[_0x546f('0x37')]:_0x21ed7c[_0x546f('0x33')];if(!_0x143ed7[_0x546f('0x34')][_0x546f('0x3a')](_0x546f('0x3b'))){_0x103395['limit']=qs[_0x546f('0x20')](_0x143ed7[_0x546f('0x34')][_0x546f('0x20')]);_0x103395['offset']=qs[_0x546f('0x1f')](_0x143ed7['query'][_0x546f('0x1f')]);}_0x103395[_0x546f('0x3c')]=qs[_0x546f('0x3d')](_0x143ed7[_0x546f('0x34')][_0x546f('0x3d')]);_0x103395[_0x546f('0x3e')]=qs[_0x546f('0x36')](_['pick'](_0x143ed7[_0x546f('0x34')],_0x21ed7c[_0x546f('0x36')]),_0x5951c8);if(_0x143ed7[_0x546f('0x34')]['filter']){_0x103395['where']=_[_0x546f('0x3f')](_0x103395[_0x546f('0x3e')],{'$or':_['map'](_0x5951c8,function(_0x37f5e8){if(_0x37f5e8[_0x546f('0x40')]!==_0x546f('0x41')){var _0x2c492e={};_0x2c492e[_0x37f5e8[_0x546f('0x2c')]]={'$like':'%'+_0x143ed7[_0x546f('0x34')][_0x546f('0x42')]+'%'};return _0x2c492e;}})});}_0x103395=_[_0x546f('0x3f')]({},_0x103395,_0x143ed7['options']);var _0x1bf072={'where':_0x103395['where']};return db['FreshsalesField'][_0x546f('0x22')](_0x1bf072)['then'](function(_0x178646){_0x4be94b[_0x546f('0x22')]=_0x178646;if(_0x143ed7[_0x546f('0x34')][_0x546f('0x43')]){_0x103395['include']=[{'all':!![]}];}return db[_0x546f('0x44')]['findAll'](_0x103395);})[_0x546f('0x28')](function(_0x2dc860){_0x4be94b[_0x546f('0x45')]=_0x2dc860;return _0x4be94b;})[_0x546f('0x28')](respondWithFilteredResult(_0x415992,_0x103395))[_0x546f('0x46')](handleError(_0x415992,null));};exports['show']=function(_0x5e337b,_0x27c17c){var _0x2938ba={'raw':!![],'where':{'id':_0x5e337b['params']['id']}},_0x28a5b0={};_0x28a5b0['model']=_[_0x546f('0x35')](db['FreshsalesField']['rawAttributes']);_0x28a5b0['query']=_[_0x546f('0x35')](_0x5e337b[_0x546f('0x34')]);_0x28a5b0[_0x546f('0x36')]=_[_0x546f('0x47')](_0x28a5b0[_0x546f('0x33')],_0x28a5b0['query']);_0x2938ba[_0x546f('0x37')]=_[_0x546f('0x47')](_0x28a5b0['model'],qs[_0x546f('0x38')](_0x5e337b[_0x546f('0x34')][_0x546f('0x38')]));_0x2938ba['attributes']=_0x2938ba['attributes'][_0x546f('0x39')]?_0x2938ba['attributes']:_0x28a5b0[_0x546f('0x33')];if(_0x5e337b['query'][_0x546f('0x43')]){_0x2938ba[_0x546f('0x48')]=[{'all':!![]}];}_0x2938ba=_[_0x546f('0x3f')]({},_0x2938ba,_0x5e337b[_0x546f('0x49')]);return db[_0x546f('0x44')][_0x546f('0x4a')](_0x2938ba)[_0x546f('0x28')](handleEntityNotFound(_0x27c17c,null))['then'](respondWithResult(_0x27c17c,null))[_0x546f('0x46')](handleError(_0x27c17c,null));};exports[_0x546f('0x4b')]=function(_0x392344,_0x5b0236){return db[_0x546f('0x44')][_0x546f('0x4b')](_0x392344[_0x546f('0x4c')],{})[_0x546f('0x28')](respondWithResult(_0x5b0236,0xc9))['catch'](handleError(_0x5b0236,null));};exports['update']=function(_0x1273bc,_0xd07b99){if(_0x1273bc['body']['id']){delete _0x1273bc[_0x546f('0x4c')]['id'];}return db[_0x546f('0x44')]['find']({'where':{'id':_0x1273bc[_0x546f('0x4d')]['id']}})[_0x546f('0x28')](handleEntityNotFound(_0xd07b99,null))[_0x546f('0x28')](saveUpdates(_0x1273bc[_0x546f('0x4c')],null))[_0x546f('0x28')](respondWithResult(_0xd07b99,null))[_0x546f('0x46')](handleError(_0xd07b99,null));};exports[_0x546f('0x4e')]=function(_0x22abd4,_0x2b04a9){return db['FreshsalesField'][_0x546f('0x4a')]({'where':{'id':_0x22abd4[_0x546f('0x4d')]['id']}})[_0x546f('0x28')](handleEntityNotFound(_0x2b04a9,null))[_0x546f('0x28')](removeEntity(_0x2b04a9,null))[_0x546f('0x46')](handleError(_0x2b04a9,null));}; \ No newline at end of file +var _0x7dbd=['stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','then','catch','keys','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','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','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update'];(function(_0x51f703,_0x25e615){var _0x9b26ce=function(_0x2a2998){while(--_0x2a2998){_0x51f703['push'](_0x51f703['shift']());}};_0x9b26ce(++_0x25e615);}(_0x7dbd,0x191));var _0xd7db=function(_0x45cd59,_0x5be7c0){_0x45cd59=_0x45cd59-0x0;var _0x39541a=_0x7dbd[_0x45cd59];return _0x39541a;};'use strict';var emlformat=require(_0xd7db('0x0'));var rimraf=require(_0xd7db('0x1'));var zipdir=require(_0xd7db('0x2'));var jsonpatch=require(_0xd7db('0x3'));var rp=require(_0xd7db('0x4'));var moment=require(_0xd7db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd7db('0x6'));var util=require(_0xd7db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd7db('0x8'));var ejs=require(_0xd7db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7db('0xa'));var squel=require('squel');var crypto=require(_0xd7db('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7db('0xc'));var toCsv=require(_0xd7db('0x8'));var querystring=require(_0xd7db('0xd'));var Papa=require('papaparse');var Redis=require(_0xd7db('0xe'));var authService=require(_0xd7db('0xf'));var qs=require(_0xd7db('0x10'));var as=require(_0xd7db('0x11'));var hardwareService=require(_0xd7db('0x12'));var logger=require(_0xd7db('0x13'))(_0xd7db('0x14'));var utils=require(_0xd7db('0x15'));var config=require(_0xd7db('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7db('0x17'))['db'];function respondWithStatusCode(_0x53c0de,_0x5f102d){_0x5f102d=_0x5f102d||0xcc;return function(_0x1bc9fa){if(_0x1bc9fa){return _0x53c0de[_0xd7db('0x18')](_0x5f102d);}return _0x53c0de[_0xd7db('0x19')](_0x5f102d)[_0xd7db('0x1a')]();};}function respondWithResult(_0x2afd6d,_0x2d3903){_0x2d3903=_0x2d3903||0xc8;return function(_0x258ea0){if(_0x258ea0){return _0x2afd6d[_0xd7db('0x19')](_0x2d3903)[_0xd7db('0x1b')](_0x258ea0);}};}function respondWithFilteredResult(_0x2b66ad,_0xe29fb5){return function(_0x2cd161){if(_0x2cd161){var _0x399c47=typeof _0xe29fb5[_0xd7db('0x1c')]==='undefined'&&typeof _0xe29fb5[_0xd7db('0x1d')]===_0xd7db('0x1e');var _0x43227e=_0x2cd161[_0xd7db('0x1f')];var _0x3feb2b=_0x399c47?0x0:_0xe29fb5['offset'];var _0x4d8925=_0x399c47?_0x2cd161[_0xd7db('0x1f')]:_0xe29fb5['offset']+_0xe29fb5[_0xd7db('0x1d')];var _0x18cdc7;if(_0x4d8925>=_0x43227e){_0x4d8925=_0x43227e;_0x18cdc7=0xc8;}else{_0x18cdc7=0xce;}_0x2b66ad[_0xd7db('0x19')](_0x18cdc7);return _0x2b66ad[_0xd7db('0x20')](_0xd7db('0x21'),_0x3feb2b+'-'+_0x4d8925+'/'+_0x43227e)[_0xd7db('0x1b')](_0x2cd161);}return null;};}function patchUpdates(_0x531a42){return function(_0x5e83cc){try{jsonpatch[_0xd7db('0x22')](_0x5e83cc,_0x531a42,!![]);}catch(_0x638d1b){return BPromise[_0xd7db('0x23')](_0x638d1b);}return _0x5e83cc['save']();};}function saveUpdates(_0x2715a2,_0x1acdd9){return function(_0x2f2d15){if(_0x2f2d15){return _0x2f2d15[_0xd7db('0x24')](_0x2715a2)['then'](function(_0x1d5b0e){return _0x1d5b0e;});}return null;};}function removeEntity(_0x16606e,_0x3076a8){return function(_0x2d1736){if(_0x2d1736){return _0x2d1736['destroy']()['then'](function(){_0x16606e[_0xd7db('0x19')](0xcc)[_0xd7db('0x1a')]();});}};}function handleEntityNotFound(_0x374c7e,_0x4d288a){return function(_0x58631b){if(!_0x58631b){_0x374c7e[_0xd7db('0x18')](0x194);}return _0x58631b;};}function handleError(_0x357e5e,_0x469c88){_0x469c88=_0x469c88||0x1f4;return function(_0x4cdd3d){logger['error'](_0x4cdd3d[_0xd7db('0x25')]);if(_0x4cdd3d[_0xd7db('0x26')]){delete _0x4cdd3d[_0xd7db('0x26')];}_0x357e5e[_0xd7db('0x19')](_0x469c88)[_0xd7db('0x27')](_0x4cdd3d);};}exports[_0xd7db('0x28')]=function(_0x153859,_0x19b5c6){var _0x513bf={},_0x439eca={},_0x43e4a6={'count':0x0,'rows':[]};var _0x50b442=_[_0xd7db('0x29')](db[_0xd7db('0x2a')][_0xd7db('0x2b')],function(_0x4bcf26){return{'name':_0x4bcf26[_0xd7db('0x2c')],'type':_0x4bcf26[_0xd7db('0x2d')]['key']};});_0x439eca[_0xd7db('0x2e')]=_[_0xd7db('0x29')](_0x50b442,_0xd7db('0x26'));_0x439eca[_0xd7db('0x2f')]=_['keys'](_0x153859['query']);_0x439eca[_0xd7db('0x30')]=_[_0xd7db('0x31')](_0x439eca[_0xd7db('0x2e')],_0x439eca[_0xd7db('0x2f')]);_0x513bf['attributes']=_['intersection'](_0x439eca['model'],qs[_0xd7db('0x32')](_0x153859[_0xd7db('0x2f')][_0xd7db('0x32')]));_0x513bf[_0xd7db('0x33')]=_0x513bf[_0xd7db('0x33')][_0xd7db('0x34')]?_0x513bf[_0xd7db('0x33')]:_0x439eca['model'];if(!_0x153859['query'][_0xd7db('0x35')](_0xd7db('0x36'))){_0x513bf['limit']=qs[_0xd7db('0x1d')](_0x153859['query'][_0xd7db('0x1d')]);_0x513bf['offset']=qs['offset'](_0x153859[_0xd7db('0x2f')][_0xd7db('0x1c')]);}_0x513bf['order']=qs['sort'](_0x153859['query'][_0xd7db('0x37')]);_0x513bf['where']=qs[_0xd7db('0x30')](_[_0xd7db('0x38')](_0x153859[_0xd7db('0x2f')],_0x439eca[_0xd7db('0x30')]),_0x50b442);if(_0x153859[_0xd7db('0x2f')][_0xd7db('0x39')]){_0x513bf['where']=_[_0xd7db('0x3a')](_0x513bf[_0xd7db('0x3b')],{'$or':_['map'](_0x50b442,function(_0x55b76e){if(_0x55b76e[_0xd7db('0x2d')]!==_0xd7db('0x3c')){var _0x4ed66b={};_0x4ed66b[_0x55b76e[_0xd7db('0x26')]]={'$like':'%'+_0x153859[_0xd7db('0x2f')][_0xd7db('0x39')]+'%'};return _0x4ed66b;}})});}_0x513bf=_[_0xd7db('0x3a')]({},_0x513bf,_0x153859[_0xd7db('0x3d')]);var _0x225797={'where':_0x513bf[_0xd7db('0x3b')]};return db[_0xd7db('0x2a')][_0xd7db('0x1f')](_0x225797)['then'](function(_0x3f60ca){_0x43e4a6[_0xd7db('0x1f')]=_0x3f60ca;if(_0x153859['query']['includeAll']){_0x513bf[_0xd7db('0x3e')]=[{'all':!![]}];}return db['FreshsalesField'][_0xd7db('0x3f')](_0x513bf);})['then'](function(_0x137a0f){_0x43e4a6['rows']=_0x137a0f;return _0x43e4a6;})[_0xd7db('0x40')](respondWithFilteredResult(_0x19b5c6,_0x513bf))[_0xd7db('0x41')](handleError(_0x19b5c6,null));};exports['show']=function(_0x1b406f,_0x747dd4){var _0x31ff3e={'raw':!![],'where':{'id':_0x1b406f['params']['id']}},_0x2c8a80={};_0x2c8a80['model']=_[_0xd7db('0x42')](db[_0xd7db('0x2a')][_0xd7db('0x2b')]);_0x2c8a80[_0xd7db('0x2f')]=_[_0xd7db('0x42')](_0x1b406f[_0xd7db('0x2f')]);_0x2c8a80[_0xd7db('0x30')]=_[_0xd7db('0x31')](_0x2c8a80[_0xd7db('0x2e')],_0x2c8a80[_0xd7db('0x2f')]);_0x31ff3e[_0xd7db('0x33')]=_[_0xd7db('0x31')](_0x2c8a80[_0xd7db('0x2e')],qs[_0xd7db('0x32')](_0x1b406f['query'][_0xd7db('0x32')]));_0x31ff3e[_0xd7db('0x33')]=_0x31ff3e[_0xd7db('0x33')]['length']?_0x31ff3e[_0xd7db('0x33')]:_0x2c8a80[_0xd7db('0x2e')];if(_0x1b406f[_0xd7db('0x2f')][_0xd7db('0x43')]){_0x31ff3e['include']=[{'all':!![]}];}_0x31ff3e=_[_0xd7db('0x3a')]({},_0x31ff3e,_0x1b406f['options']);return db[_0xd7db('0x2a')][_0xd7db('0x44')](_0x31ff3e)['then'](handleEntityNotFound(_0x747dd4,null))[_0xd7db('0x40')](respondWithResult(_0x747dd4,null))[_0xd7db('0x41')](handleError(_0x747dd4,null));};exports[_0xd7db('0x45')]=function(_0x120443,_0x488284){return db[_0xd7db('0x2a')][_0xd7db('0x45')](_0x120443[_0xd7db('0x46')],{})[_0xd7db('0x40')](respondWithResult(_0x488284,0xc9))['catch'](handleError(_0x488284,null));};exports[_0xd7db('0x24')]=function(_0x1fdb6b,_0x2ed386){if(_0x1fdb6b[_0xd7db('0x46')]['id']){delete _0x1fdb6b[_0xd7db('0x46')]['id'];}return db[_0xd7db('0x2a')]['find']({'where':{'id':_0x1fdb6b[_0xd7db('0x47')]['id']}})[_0xd7db('0x40')](handleEntityNotFound(_0x2ed386,null))[_0xd7db('0x40')](saveUpdates(_0x1fdb6b[_0xd7db('0x46')],null))[_0xd7db('0x40')](respondWithResult(_0x2ed386,null))[_0xd7db('0x41')](handleError(_0x2ed386,null));};exports[_0xd7db('0x48')]=function(_0x571f13,_0x20c1c9){return db[_0xd7db('0x2a')]['find']({'where':{'id':_0x571f13[_0xd7db('0x47')]['id']}})[_0xd7db('0x40')](handleEntityNotFound(_0x20c1c9,null))['then'](removeEntity(_0x20c1c9,null))[_0xd7db('0x41')](handleError(_0x20c1c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 83a3a22..02d2961 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 _0xe062=['request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','freshsales_unique_index','idField','lodash','util','moment','bluebird'];(function(_0x570f7c,_0x22d46a){var _0x2f6816=function(_0x2c6125){while(--_0x2c6125){_0x570f7c['push'](_0x570f7c['shift']());}};_0x2f6816(++_0x22d46a);}(_0xe062,0x1b8));var _0x2e06=function(_0x3b46d1,_0x201ca8){_0x3b46d1=_0x3b46d1-0x0;var _0x53ead0=_0xe062[_0x3b46d1];return _0x53ead0;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2e06('0x2'));var BPromise=require(_0x2e06('0x3'));var rp=require(_0x2e06('0x4'));var fs=require('fs');var path=require(_0x2e06('0x5'));var rimraf=require(_0x2e06('0x6'));var config=require(_0x2e06('0x7'));var attributes=require(_0x2e06('0x8'));module[_0x2e06('0x9')]=function(_0x7fc3ae,_0x480c91){return _0x7fc3ae['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x2e06('0xa'),'fields':[_0x2e06('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f8=['path','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','bluebird'];(function(_0x41cf16,_0x17ff65){var _0x54c205=function(_0x7136f){while(--_0x7136f){_0x41cf16['push'](_0x41cf16['shift']());}};_0x54c205(++_0x17ff65);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xd1f8[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0x8d1f('0x0'));var util=require(_0x8d1f('0x1'));var logger=require(_0x8d1f('0x2'))(_0x8d1f('0x3'));var moment=require('moment');var BPromise=require(_0x8d1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x8d1f('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x8d1f('0x7')]=function(_0x26d2de,_0x5a17b0){return _0x26d2de[_0x8d1f('0x8')](_0x8d1f('0x9'),attributes,{'tableName':_0x8d1f('0xa'),'paranoid':![],'indexes':[{'name':_0x8d1f('0xb'),'fields':[_0x8d1f('0xc'),'FieldId'],'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 d5ba95b..70da9bc 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 _0x31f0=['../../config/environment','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x10a1ac,_0x25f5b0){var _0x45b99e=function(_0x2fe46a){while(--_0x2fe46a){_0x10a1ac['push'](_0x10a1ac['shift']());}};_0x45b99e(++_0x25f5b0);}(_0x31f0,0xb7));var _0x031f=function(_0x10b812,_0x34860a){_0x10b812=_0x10b812-0x0;var _0x4283be=_0x31f0[_0x10b812];return _0x4283be;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x3dd003,_0x3cbd52){var _0x3fe6c5=function(_0x12b959){while(--_0x12b959){_0x3dd003['push'](_0x3dd003['shift']());}};_0x3fe6c5(++_0x3cbd52);}(_0x4c60,0xc1));var _0x04c6=function(_0xa07c46,_0x126e13){_0xa07c46=_0xa07c46-0x0;var _0x5ce901=_0x4c60[_0xa07c46];return _0x5ce901;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3852cad..da31d6c 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4947bf,_0x334f29){var _0x1f5f13=function(_0x28dea4){while(--_0x28dea4){_0x4947bf['push'](_0x4947bf['shift']());}};_0x1f5f13(++_0x334f29);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x404d3f,_0x3f73d1){var _0x79f8ba=function(_0x11a56e){while(--_0x11a56e){_0x404d3f['push'](_0x404d3f['shift']());}};_0x79f8ba(++_0x3f73d1);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 221f02a..bb8a8c7 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 _0xba37=['ENUM','integrationTab','sequelize','STRING'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xba37,0xb6));var _0x7ba3=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xba37[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x7ba3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ba3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7ba3('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x7ba3('0x1')]},'password':{'type':Sequelize[_0x7ba3('0x1')]},'clientId':{'type':Sequelize[_0x7ba3('0x1')]},'clientSecret':{'type':Sequelize[_0x7ba3('0x1')]},'securityToken':{'type':Sequelize[_0x7ba3('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7ba3('0x2')]('integrationTab','newTab'),'defaultValue':_0x7ba3('0x3')}}; \ No newline at end of file +var _0xcdd2=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2cdd('0x0'));module[_0x2cdd('0x1')]={'name':{'type':Sequelize[_0x2cdd('0x2')]},'description':{'type':Sequelize[_0x2cdd('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2cdd('0x3')},'remoteUri':{'type':Sequelize[_0x2cdd('0x2')]},'password':{'type':Sequelize[_0x2cdd('0x2')]},'clientId':{'type':Sequelize[_0x2cdd('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x2cdd('0x2')]},'serverUrl':{'type':Sequelize[_0x2cdd('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2cdd('0x4'),_0x2cdd('0x5')),'defaultValue':_0x2cdd('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b0d905c..42608dd 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 _0xc8c2=['undefined','limit','count','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','SalesforceAccount','include','findAll','rows','params','keys','length','includeAll','find','catch','create','body','destroy','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','string','int','boolean','email','textarea','phone','includes','label','custom','picklistValues','True','true','False','false','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset'];(function(_0x21da17,_0xc839e3){var _0x545fc4=function(_0x486c70){while(--_0x486c70){_0x21da17['push'](_0x21da17['shift']());}};_0x545fc4(++_0xc839e3);}(_0xc8c2,0xd7));var _0x2c8c=function(_0x52b922,_0xd70829){_0x52b922=_0x52b922-0x0;var _0x62d6b6=_0xc8c2[_0x52b922];return _0x62d6b6;};'use strict';var emlformat=require(_0x2c8c('0x0'));var rimraf=require(_0x2c8c('0x1'));var zipdir=require(_0x2c8c('0x2'));var jsonpatch=require(_0x2c8c('0x3'));var rp=require('request-promise');var moment=require(_0x2c8c('0x4'));var BPromise=require(_0x2c8c('0x5'));var Mustache=require(_0x2c8c('0x6'));var util=require(_0x2c8c('0x7'));var path=require(_0x2c8c('0x8'));var sox=require(_0x2c8c('0x9'));var csv=require(_0x2c8c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c8c('0xb'));var _=require(_0x2c8c('0xc'));var squel=require(_0x2c8c('0xd'));var crypto=require(_0x2c8c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2c8c('0xf'));var toCsv=require(_0x2c8c('0xa'));var querystring=require(_0x2c8c('0x10'));var Papa=require(_0x2c8c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c8c('0x12'));var hardwareService=require(_0x2c8c('0x13'));var logger=require(_0x2c8c('0x14'))(_0x2c8c('0x15'));var utils=require(_0x2c8c('0x16'));var config=require(_0x2c8c('0x17'));var licenseUtil=require(_0x2c8c('0x18'));var db=require(_0x2c8c('0x19'))['db'];var integrations=require(_0x2c8c('0x1a'));function respondWithStatusCode(_0x446002,_0x421e90){_0x421e90=_0x421e90||0xcc;return function(_0x156641){if(_0x156641){return _0x446002[_0x2c8c('0x1b')](_0x421e90);}return _0x446002[_0x2c8c('0x1c')](_0x421e90)['end']();};}function respondWithResult(_0x1e18d4,_0x1ba260){_0x1ba260=_0x1ba260||0xc8;return function(_0x4c2895){if(_0x4c2895){return _0x1e18d4[_0x2c8c('0x1c')](_0x1ba260)[_0x2c8c('0x1d')](_0x4c2895);}};}function respondWithFilteredResult(_0x43f011,_0x55c80b){return function(_0x54a2d9){if(_0x54a2d9){var _0xaf10fa=typeof _0x55c80b[_0x2c8c('0x1e')]===_0x2c8c('0x1f')&&typeof _0x55c80b[_0x2c8c('0x20')]==='undefined';var _0x5c1b1c=_0x54a2d9[_0x2c8c('0x21')];var _0x160bee=_0xaf10fa?0x0:_0x55c80b[_0x2c8c('0x1e')];var _0x49c497=_0xaf10fa?_0x54a2d9[_0x2c8c('0x21')]:_0x55c80b[_0x2c8c('0x1e')]+_0x55c80b[_0x2c8c('0x20')];var _0x4936b0;if(_0x49c497>=_0x5c1b1c){_0x49c497=_0x5c1b1c;_0x4936b0=0xc8;}else{_0x4936b0=0xce;}_0x43f011[_0x2c8c('0x1c')](_0x4936b0);return _0x43f011['set']('Content-Range',_0x160bee+'-'+_0x49c497+'/'+_0x5c1b1c)[_0x2c8c('0x1d')](_0x54a2d9);}return null;};}function patchUpdates(_0x37e726){return function(_0x202154){try{jsonpatch[_0x2c8c('0x22')](_0x202154,_0x37e726,!![]);}catch(_0x32df72){return BPromise['reject'](_0x32df72);}return _0x202154[_0x2c8c('0x23')]();};}function saveUpdates(_0x40064a,_0x4a31d4){return function(_0x330eb1){if(_0x330eb1){return _0x330eb1[_0x2c8c('0x24')](_0x40064a)['then'](function(_0x4b15da){return _0x4b15da;});}return null;};}function removeEntity(_0x2980f1,_0x19f261){return function(_0x2717ef){if(_0x2717ef){return _0x2717ef['destroy']()[_0x2c8c('0x25')](function(){_0x2980f1[_0x2c8c('0x1c')](0xcc)[_0x2c8c('0x26')]();});}};}function handleEntityNotFound(_0x110ba7,_0x49bc21){return function(_0x5e4bd5){if(!_0x5e4bd5){_0x110ba7[_0x2c8c('0x1b')](0x194);}return _0x5e4bd5;};}function handleError(_0x597ca1,_0x1adae7){_0x1adae7=_0x1adae7||0x1f4;return function(_0x5d46e3){logger[_0x2c8c('0x27')](_0x5d46e3[_0x2c8c('0x28')]);if(_0x5d46e3[_0x2c8c('0x29')]){delete _0x5d46e3[_0x2c8c('0x29')];}_0x597ca1[_0x2c8c('0x1c')](_0x1adae7)[_0x2c8c('0x2a')](_0x5d46e3);};}exports[_0x2c8c('0x2b')]=function(_0x513630,_0x4c9d29){var _0x572c35={},_0x3a013c={},_0x5c3399={'count':0x0,'rows':[]};var _0x3139a9=_[_0x2c8c('0x2c')](db['SalesforceAccount'][_0x2c8c('0x2d')],function(_0x4fb109){return{'name':_0x4fb109['fieldName'],'type':_0x4fb109[_0x2c8c('0x2e')][_0x2c8c('0x2f')]};});_0x3a013c['model']=_[_0x2c8c('0x2c')](_0x3139a9,'name');_0x3a013c[_0x2c8c('0x30')]=_['keys'](_0x513630[_0x2c8c('0x30')]);_0x3a013c['filters']=_[_0x2c8c('0x31')](_0x3a013c['model'],_0x3a013c[_0x2c8c('0x30')]);_0x572c35[_0x2c8c('0x32')]=_['intersection'](_0x3a013c[_0x2c8c('0x33')],qs[_0x2c8c('0x34')](_0x513630[_0x2c8c('0x30')][_0x2c8c('0x34')]));_0x572c35['attributes']=_0x572c35[_0x2c8c('0x32')]['length']?_0x572c35[_0x2c8c('0x32')]:_0x3a013c['model'];if(!_0x513630[_0x2c8c('0x30')][_0x2c8c('0x35')](_0x2c8c('0x36'))){_0x572c35['limit']=qs['limit'](_0x513630[_0x2c8c('0x30')][_0x2c8c('0x20')]);_0x572c35['offset']=qs[_0x2c8c('0x1e')](_0x513630[_0x2c8c('0x30')][_0x2c8c('0x1e')]);}_0x572c35[_0x2c8c('0x37')]=qs['sort'](_0x513630[_0x2c8c('0x30')][_0x2c8c('0x38')]);_0x572c35[_0x2c8c('0x39')]=qs[_0x2c8c('0x3a')](_[_0x2c8c('0x3b')](_0x513630['query'],_0x3a013c[_0x2c8c('0x3a')]),_0x3139a9);if(_0x513630[_0x2c8c('0x30')]['filter']){_0x572c35['where']=_[_0x2c8c('0x3c')](_0x572c35[_0x2c8c('0x39')],{'$or':_[_0x2c8c('0x2c')](_0x3139a9,function(_0x2550bf){if(_0x2550bf[_0x2c8c('0x2e')]!==_0x2c8c('0x3d')){var _0x599b68={};_0x599b68[_0x2550bf[_0x2c8c('0x29')]]={'$like':'%'+_0x513630[_0x2c8c('0x30')][_0x2c8c('0x3e')]+'%'};return _0x599b68;}})});}_0x572c35=_['merge']({},_0x572c35,_0x513630[_0x2c8c('0x3f')]);var _0x5e8c00={'where':_0x572c35['where']};return db[_0x2c8c('0x40')][_0x2c8c('0x21')](_0x5e8c00)[_0x2c8c('0x25')](function(_0x12a608){_0x5c3399[_0x2c8c('0x21')]=_0x12a608;if(_0x513630[_0x2c8c('0x30')]['includeAll']){_0x572c35[_0x2c8c('0x41')]=[{'all':!![]}];}return db[_0x2c8c('0x40')][_0x2c8c('0x42')](_0x572c35);})['then'](function(_0x26f1f3){_0x5c3399[_0x2c8c('0x43')]=_0x26f1f3;return _0x5c3399;})[_0x2c8c('0x25')](respondWithFilteredResult(_0x4c9d29,_0x572c35))['catch'](handleError(_0x4c9d29,null));};exports['show']=function(_0x35d6c8,_0x30aad4){var _0x420cc4={'raw':![],'where':{'id':_0x35d6c8[_0x2c8c('0x44')]['id']}},_0x486be7={};_0x486be7['model']=_[_0x2c8c('0x45')](db['SalesforceAccount'][_0x2c8c('0x2d')]);_0x486be7[_0x2c8c('0x30')]=_[_0x2c8c('0x45')](_0x35d6c8['query']);_0x486be7['filters']=_[_0x2c8c('0x31')](_0x486be7[_0x2c8c('0x33')],_0x486be7[_0x2c8c('0x30')]);_0x420cc4[_0x2c8c('0x32')]=_[_0x2c8c('0x31')](_0x486be7['model'],qs['fields'](_0x35d6c8[_0x2c8c('0x30')][_0x2c8c('0x34')]));_0x420cc4[_0x2c8c('0x32')]=_0x420cc4[_0x2c8c('0x32')][_0x2c8c('0x46')]?_0x420cc4[_0x2c8c('0x32')]:_0x486be7['model'];if(_0x35d6c8['query'][_0x2c8c('0x47')]){_0x420cc4['include']=[{'all':!![]}];}_0x420cc4=_[_0x2c8c('0x3c')]({},_0x420cc4,_0x35d6c8[_0x2c8c('0x3f')]);return db[_0x2c8c('0x40')][_0x2c8c('0x48')](_0x420cc4)[_0x2c8c('0x25')](handleEntityNotFound(_0x30aad4,null))[_0x2c8c('0x25')](respondWithResult(_0x30aad4,null))[_0x2c8c('0x49')](handleError(_0x30aad4,null));};exports[_0x2c8c('0x4a')]=function(_0x61039b,_0x40a8ad){return db[_0x2c8c('0x40')][_0x2c8c('0x4a')](_0x61039b[_0x2c8c('0x4b')],{})['then'](respondWithResult(_0x40a8ad,0xc9))[_0x2c8c('0x49')](handleError(_0x40a8ad,null));};exports['update']=function(_0x575955,_0x10ccdb){if(_0x575955[_0x2c8c('0x4b')]['id']){delete _0x575955[_0x2c8c('0x4b')]['id'];}return db[_0x2c8c('0x40')][_0x2c8c('0x48')]({'where':{'id':_0x575955['params']['id']}})[_0x2c8c('0x25')](handleEntityNotFound(_0x10ccdb,null))[_0x2c8c('0x25')](saveUpdates(_0x575955['body'],null))[_0x2c8c('0x25')](respondWithResult(_0x10ccdb,null))[_0x2c8c('0x49')](handleError(_0x10ccdb,null));};exports[_0x2c8c('0x4c')]=function(_0x11b960,_0x295fb6){return db[_0x2c8c('0x40')][_0x2c8c('0x48')]({'where':{'id':_0x11b960['params']['id']}})[_0x2c8c('0x25')](handleEntityNotFound(_0x295fb6,null))['then'](removeEntity(_0x295fb6,null))['catch'](handleError(_0x295fb6,null));};exports[_0x2c8c('0x4d')]=function(_0x40343b,_0x5c6c68,_0x54e43a){var _0x4b79fe={};var _0xd62a6a={};var _0x5d6779;var _0x5dc546;return db['SalesforceAccount']['findOne']({'where':{'id':_0x40343b[_0x2c8c('0x44')]['id']}})[_0x2c8c('0x25')](handleEntityNotFound(_0x5c6c68,null))[_0x2c8c('0x25')](function(_0x598271){if(_0x598271){_0x5d6779=_0x598271;_0xd62a6a[_0x2c8c('0x33')]=_['keys'](db[_0x2c8c('0x4e')]['rawAttributes']);_0xd62a6a[_0x2c8c('0x30')]=_[_0x2c8c('0x45')](_0x40343b[_0x2c8c('0x30')]);_0xd62a6a[_0x2c8c('0x3a')]=_[_0x2c8c('0x31')](_0xd62a6a[_0x2c8c('0x33')],_0xd62a6a['query']);_0x4b79fe[_0x2c8c('0x32')]=_['intersection'](_0xd62a6a[_0x2c8c('0x33')],qs[_0x2c8c('0x34')](_0x40343b[_0x2c8c('0x30')]['fields']));_0x4b79fe[_0x2c8c('0x32')]=_0x4b79fe[_0x2c8c('0x32')]['length']?_0x4b79fe['attributes']:_0xd62a6a[_0x2c8c('0x33')];_0x4b79fe[_0x2c8c('0x37')]=qs[_0x2c8c('0x38')](_0x40343b[_0x2c8c('0x30')][_0x2c8c('0x38')]);_0x4b79fe[_0x2c8c('0x39')]=qs[_0x2c8c('0x3a')](_[_0x2c8c('0x3b')](_0x40343b[_0x2c8c('0x30')],_0xd62a6a[_0x2c8c('0x3a')]));if(_0x40343b[_0x2c8c('0x30')][_0x2c8c('0x3e')]){_0x4b79fe[_0x2c8c('0x39')]=_[_0x2c8c('0x3c')](_0x4b79fe[_0x2c8c('0x39')],{'$or':_['map'](_0x4b79fe[_0x2c8c('0x32')],function(_0x5d368b){var _0x4470dd={};_0x4470dd[_0x5d368b]={'$like':'%'+_0x40343b[_0x2c8c('0x30')][_0x2c8c('0x3e')]+'%'};return _0x4470dd;})});}_0x4b79fe=_['merge']({},_0x4b79fe,_0x40343b[_0x2c8c('0x3f')]);return _0x5d6779['getConfigurations'](_0x4b79fe);}})['then'](function(_0x4e0eac){if(_0x4e0eac){_0x5dc546=_0x4e0eac['length'];if(!_0x40343b[_0x2c8c('0x30')]['hasOwnProperty'](_0x2c8c('0x36'))){_0x4b79fe[_0x2c8c('0x20')]=qs['limit'](_0x40343b[_0x2c8c('0x30')][_0x2c8c('0x20')]);_0x4b79fe[_0x2c8c('0x1e')]=qs['offset'](_0x40343b[_0x2c8c('0x30')][_0x2c8c('0x1e')]);}return _0x5d6779[_0x2c8c('0x4d')](_0x4b79fe);}})[_0x2c8c('0x25')](function(_0x1ee64a){if(_0x1ee64a){return _0x1ee64a?{'count':_0x5dc546,'rows':_0x1ee64a}:null;}})[_0x2c8c('0x25')](respondWithResult(_0x5c6c68,null))[_0x2c8c('0x49')](handleError(_0x5c6c68,null));};exports[_0x2c8c('0x4f')]=function(_0x5558b4,_0x31eba4,_0x5e0a36){if(_0x5558b4[_0x2c8c('0x4b')]['id']){delete _0x5558b4[_0x2c8c('0x4b')]['id'];}return db[_0x2c8c('0x40')][_0x2c8c('0x50')]({'where':{'id':_0x5558b4[_0x2c8c('0x44')]['id']}})['then'](handleEntityNotFound(_0x31eba4,null))[_0x2c8c('0x25')](function(_0xd55b2){if(_0xd55b2){_0x5558b4[_0x2c8c('0x4b')][_0x2c8c('0x51')]=_0xd55b2['id'];_0x5558b4[_0x2c8c('0x4b')][_0x2c8c('0x52')]=integrations[_0x2c8c('0x53')](_0x5558b4[_0x2c8c('0x4b')][_0x2c8c('0x54')],_0x5558b4['body'][_0x2c8c('0x2e')]);_0x5558b4[_0x2c8c('0x4b')][_0x2c8c('0x55')]=integrations[_0x2c8c('0x56')](_0x5558b4[_0x2c8c('0x4b')]['channel'],_0x5558b4[_0x2c8c('0x4b')]['type']);return db['SalesforceConfiguration'][_0x2c8c('0x4a')](_0x5558b4[_0x2c8c('0x4b')],{'include':[{'model':db[_0x2c8c('0x57')],'as':_0x2c8c('0x52')},{'model':db[_0x2c8c('0x57')],'as':'Descriptions'}]});}return null;})[_0x2c8c('0x25')](respondWithResult(_0x31eba4,null))['catch'](handleError(_0x31eba4,null));};exports[_0x2c8c('0x58')]=function(_0x407b15,_0x3fdc9c,_0x4d9813){var _0x2e3d55;var _0xf7df7f='';var _0x16bf17=_0x2c8c('0x59');return db[_0x2c8c('0x40')]['findOne']({'where':{'id':_0x407b15[_0x2c8c('0x44')]['id']},'attributes':['id',_0x2c8c('0x5a'),_0x2c8c('0x5b'),_0x2c8c('0x5c'),_0x2c8c('0x5d'),_0x2c8c('0x5e'),_0x2c8c('0x5f')]})[_0x2c8c('0x25')](handleEntityNotFound(_0x3fdc9c,null))['then'](function(_0xe158f1){if(_0xe158f1){_0xf7df7f=_0xe158f1[_0x2c8c('0x5a')];var _0x36b6b8=_0xf7df7f[_0x2c8c('0x60')](-0x1);if(_0x36b6b8==='/'){_0xf7df7f=_0xf7df7f['substring'](0x0,_0xf7df7f[_0x2c8c('0x61')](_0x36b6b8));}_0x2e3d55=new jsforce['Connection']({'oauth2':{'loginUrl':_0xf7df7f,'clientId':_0xe158f1[_0x2c8c('0x5b')],'clientSecret':_0xe158f1[_0x2c8c('0x5c')]}});return _0x2e3d55[_0x2c8c('0x62')](_0xe158f1[_0x2c8c('0x5d')],_0xe158f1[_0x2c8c('0x5e')][_0x2c8c('0x63')](_0xe158f1[_0x2c8c('0x5f')]));}})['then'](function(_0x15c793){if(_0x15c793){if(!_[_0x2c8c('0x64')](_0x407b15[_0x2c8c('0x30')][_0x2c8c('0x65')])){_0x16bf17=_0x407b15['query'][_0x2c8c('0x65')];}return _0x2e3d55[_0x2c8c('0x66')](_0x16bf17)['describe']();}})[_0x2c8c('0x25')](function(_0x1c6559){var _0x15e007=[_0x2c8c('0x67'),_0x2c8c('0x68'),_0x2c8c('0x69'),'IsRecurrence',_0x2c8c('0x6a'),'Description'];var _0x50b43b=[_0x2c8c('0x6b'),_0x2c8c('0x6c'),'picklist',_0x2c8c('0x6d'),_0x2c8c('0x6e'),_0x2c8c('0x6f'),_0x2c8c('0x70')];if(_0x1c6559){_['remove'](_0x1c6559[_0x2c8c('0x34')],function(_0x463369){return _0x15e007[_0x2c8c('0x71')](_0x463369[_0x2c8c('0x29')])||!_0x50b43b[_0x2c8c('0x71')](_0x463369[_0x2c8c('0x2e')]);});return{'count':_0x1c6559[_0x2c8c('0x34')][_0x2c8c('0x46')],'rows':_['map'](_0x1c6559[_0x2c8c('0x34')],function(_0x364ae1){return{'id':_0x364ae1[_0x2c8c('0x29')],'name':_0x364ae1[_0x2c8c('0x72')],'custom':_0x364ae1[_0x2c8c('0x73')],'options':_0x364ae1[_0x2c8c('0x74')]['length']>0x0?_['map'](_0x364ae1[_0x2c8c('0x74')],function(_0xb52fd5){return{'name':_0xb52fd5[_0x2c8c('0x72')],'value':_0xb52fd5['value']};}):_0x364ae1[_0x2c8c('0x2e')]==_0x2c8c('0x6d')?[{'name':_0x2c8c('0x75'),'value':_0x2c8c('0x76')},{'name':_0x2c8c('0x77'),'value':_0x2c8c('0x78')}]:[]};})};}})[_0x2c8c('0x25')](respondWithResult(_0x3fdc9c,null))['catch'](function(_0xc64657){var _0x2addca=_0x407b15[_0x2c8c('0x30')]['test']?0x1f4:_0xc64657['statusCode']||0x1f4;logger[_0x2c8c('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x2c8c('0x58'),_0x2addca,JSON[_0x2c8c('0x79')](_0xc64657));delete _0xc64657[_0x2c8c('0x29')];if(_0x2addca===0x191){_0x2addca=0x190;}_0x3fdc9c[_0x2c8c('0x1c')](_0x2addca)['send'](_0x407b15['query']['test']?{'message':_0x2c8c('0x7a'),'statusCode':_0xc64657['statusCode']}:_0xc64657);});}; \ No newline at end of file +var _0xc7a2=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','map','SalesforceAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','pick','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','ActivityDate','IsRecurrence','Description','int','picklist','boolean','email','textarea','phone','includes','custom','picklistValues','value','true','False','false','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc7a2,0x64));var _0x2c7a=function(_0x232715,_0x4bd63e){_0x232715=_0x232715-0x0;var _0x1e6090=_0xc7a2[_0x232715];return _0x1e6090;};'use strict';var emlformat=require(_0x2c7a('0x0'));var rimraf=require(_0x2c7a('0x1'));var zipdir=require(_0x2c7a('0x2'));var jsonpatch=require(_0x2c7a('0x3'));var rp=require(_0x2c7a('0x4'));var moment=require(_0x2c7a('0x5'));var BPromise=require(_0x2c7a('0x6'));var Mustache=require(_0x2c7a('0x7'));var util=require(_0x2c7a('0x8'));var path=require(_0x2c7a('0x9'));var sox=require('sox');var csv=require(_0x2c7a('0xa'));var ejs=require(_0x2c7a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c7a('0xc'));var squel=require(_0x2c7a('0xd'));var crypto=require(_0x2c7a('0xe'));var jsforce=require(_0x2c7a('0xf'));var deskjs=require(_0x2c7a('0x10'));var toCsv=require(_0x2c7a('0xa'));var querystring=require(_0x2c7a('0x11'));var Papa=require(_0x2c7a('0x12'));var Redis=require(_0x2c7a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c7a('0x14'));var logger=require(_0x2c7a('0x15'))(_0x2c7a('0x16'));var utils=require(_0x2c7a('0x17'));var config=require(_0x2c7a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2c7a('0x19'));function respondWithStatusCode(_0x5c9a3d,_0x47aaeb){_0x47aaeb=_0x47aaeb||0xcc;return function(_0x314d69){if(_0x314d69){return _0x5c9a3d[_0x2c7a('0x1a')](_0x47aaeb);}return _0x5c9a3d[_0x2c7a('0x1b')](_0x47aaeb)[_0x2c7a('0x1c')]();};}function respondWithResult(_0x3f5acc,_0x4da1ec){_0x4da1ec=_0x4da1ec||0xc8;return function(_0x4d7e7){if(_0x4d7e7){return _0x3f5acc[_0x2c7a('0x1b')](_0x4da1ec)['json'](_0x4d7e7);}};}function respondWithFilteredResult(_0x3fe74a,_0x59c156){return function(_0x4e798e){if(_0x4e798e){var _0x4384ae=typeof _0x59c156[_0x2c7a('0x1d')]===_0x2c7a('0x1e')&&typeof _0x59c156[_0x2c7a('0x1f')]===_0x2c7a('0x1e');var _0x59450f=_0x4e798e[_0x2c7a('0x20')];var _0x25946e=_0x4384ae?0x0:_0x59c156[_0x2c7a('0x1d')];var _0x31ae0a=_0x4384ae?_0x4e798e['count']:_0x59c156[_0x2c7a('0x1d')]+_0x59c156[_0x2c7a('0x1f')];var _0x17bc98;if(_0x31ae0a>=_0x59450f){_0x31ae0a=_0x59450f;_0x17bc98=0xc8;}else{_0x17bc98=0xce;}_0x3fe74a[_0x2c7a('0x1b')](_0x17bc98);return _0x3fe74a[_0x2c7a('0x21')](_0x2c7a('0x22'),_0x25946e+'-'+_0x31ae0a+'/'+_0x59450f)[_0x2c7a('0x23')](_0x4e798e);}return null;};}function patchUpdates(_0x19dacd){return function(_0x111cae){try{jsonpatch[_0x2c7a('0x24')](_0x111cae,_0x19dacd,!![]);}catch(_0x8518fb){return BPromise[_0x2c7a('0x25')](_0x8518fb);}return _0x111cae[_0x2c7a('0x26')]();};}function saveUpdates(_0x45d813,_0x5a0c64){return function(_0x4344d2){if(_0x4344d2){return _0x4344d2['update'](_0x45d813)[_0x2c7a('0x27')](function(_0x2fe487){return _0x2fe487;});}return null;};}function removeEntity(_0x581ac3,_0x54af8a){return function(_0x3569ad){if(_0x3569ad){return _0x3569ad[_0x2c7a('0x28')]()[_0x2c7a('0x27')](function(){_0x581ac3[_0x2c7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab0b1,_0x3b37f){return function(_0x592923){if(!_0x592923){_0x5ab0b1[_0x2c7a('0x1a')](0x194);}return _0x592923;};}function handleError(_0x411b88,_0x26a118){_0x26a118=_0x26a118||0x1f4;return function(_0x14d9e6){logger[_0x2c7a('0x29')](_0x14d9e6['stack']);if(_0x14d9e6[_0x2c7a('0x2a')]){delete _0x14d9e6[_0x2c7a('0x2a')];}_0x411b88[_0x2c7a('0x1b')](_0x26a118)[_0x2c7a('0x2b')](_0x14d9e6);};}exports['index']=function(_0x55b565,_0x1ebd06){var _0x3d586d={},_0x1a2632={},_0x45dd11={'count':0x0,'rows':[]};var _0x1114f0=_[_0x2c7a('0x2c')](db[_0x2c7a('0x2d')][_0x2c7a('0x2e')],function(_0xbf261d){return{'name':_0xbf261d[_0x2c7a('0x2f')],'type':_0xbf261d['type']['key']};});_0x1a2632[_0x2c7a('0x30')]=_[_0x2c7a('0x2c')](_0x1114f0,'name');_0x1a2632[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x55b565[_0x2c7a('0x31')]);_0x1a2632[_0x2c7a('0x33')]=_[_0x2c7a('0x34')](_0x1a2632[_0x2c7a('0x30')],_0x1a2632['query']);_0x3d586d[_0x2c7a('0x35')]=_[_0x2c7a('0x34')](_0x1a2632[_0x2c7a('0x30')],qs[_0x2c7a('0x36')](_0x55b565['query'][_0x2c7a('0x36')]));_0x3d586d[_0x2c7a('0x35')]=_0x3d586d[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x3d586d[_0x2c7a('0x35')]:_0x1a2632['model'];if(!_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x38')](_0x2c7a('0x39'))){_0x3d586d['limit']=qs[_0x2c7a('0x1f')](_0x55b565['query'][_0x2c7a('0x1f')]);_0x3d586d[_0x2c7a('0x1d')]=qs[_0x2c7a('0x1d')](_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x1d')]);}_0x3d586d[_0x2c7a('0x3a')]=qs[_0x2c7a('0x3b')](_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x3b')]);_0x3d586d[_0x2c7a('0x3c')]=qs[_0x2c7a('0x33')](_['pick'](_0x55b565['query'],_0x1a2632[_0x2c7a('0x33')]),_0x1114f0);if(_0x55b565['query'][_0x2c7a('0x3d')]){_0x3d586d[_0x2c7a('0x3c')]=_[_0x2c7a('0x3e')](_0x3d586d[_0x2c7a('0x3c')],{'$or':_[_0x2c7a('0x2c')](_0x1114f0,function(_0x44ca8c){if(_0x44ca8c[_0x2c7a('0x3f')]!==_0x2c7a('0x40')){var _0x4593dd={};_0x4593dd[_0x44ca8c['name']]={'$like':'%'+_0x55b565[_0x2c7a('0x31')]['filter']+'%'};return _0x4593dd;}})});}_0x3d586d=_[_0x2c7a('0x3e')]({},_0x3d586d,_0x55b565[_0x2c7a('0x41')]);var _0x522d80={'where':_0x3d586d['where']};return db[_0x2c7a('0x2d')][_0x2c7a('0x20')](_0x522d80)[_0x2c7a('0x27')](function(_0x2f17fd){_0x45dd11['count']=_0x2f17fd;if(_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x42')]){_0x3d586d['include']=[{'all':!![]}];}return db[_0x2c7a('0x2d')]['findAll'](_0x3d586d);})[_0x2c7a('0x27')](function(_0x5d1da4){_0x45dd11[_0x2c7a('0x43')]=_0x5d1da4;return _0x45dd11;})[_0x2c7a('0x27')](respondWithFilteredResult(_0x1ebd06,_0x3d586d))[_0x2c7a('0x44')](handleError(_0x1ebd06,null));};exports['show']=function(_0x1b5b83,_0x5cf7d5){var _0x1cbb43={'raw':![],'where':{'id':_0x1b5b83[_0x2c7a('0x45')]['id']}},_0x5d7a17={};_0x5d7a17[_0x2c7a('0x30')]=_['keys'](db[_0x2c7a('0x2d')][_0x2c7a('0x2e')]);_0x5d7a17[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x1b5b83[_0x2c7a('0x31')]);_0x5d7a17[_0x2c7a('0x33')]=_['intersection'](_0x5d7a17[_0x2c7a('0x30')],_0x5d7a17[_0x2c7a('0x31')]);_0x1cbb43[_0x2c7a('0x35')]=_['intersection'](_0x5d7a17['model'],qs['fields'](_0x1b5b83[_0x2c7a('0x31')]['fields']));_0x1cbb43['attributes']=_0x1cbb43[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x1cbb43['attributes']:_0x5d7a17[_0x2c7a('0x30')];if(_0x1b5b83['query']['includeAll']){_0x1cbb43['include']=[{'all':!![]}];}_0x1cbb43=_[_0x2c7a('0x3e')]({},_0x1cbb43,_0x1b5b83[_0x2c7a('0x41')]);return db[_0x2c7a('0x2d')][_0x2c7a('0x46')](_0x1cbb43)[_0x2c7a('0x27')](handleEntityNotFound(_0x5cf7d5,null))[_0x2c7a('0x27')](respondWithResult(_0x5cf7d5,null))[_0x2c7a('0x44')](handleError(_0x5cf7d5,null));};exports['create']=function(_0x6371e5,_0x5b6a0d){return db[_0x2c7a('0x2d')][_0x2c7a('0x47')](_0x6371e5[_0x2c7a('0x48')],{})['then'](respondWithResult(_0x5b6a0d,0xc9))[_0x2c7a('0x44')](handleError(_0x5b6a0d,null));};exports[_0x2c7a('0x49')]=function(_0x306882,_0x5f8616){if(_0x306882['body']['id']){delete _0x306882[_0x2c7a('0x48')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x306882[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x5f8616,null))['then'](saveUpdates(_0x306882[_0x2c7a('0x48')],null))[_0x2c7a('0x27')](respondWithResult(_0x5f8616,null))['catch'](handleError(_0x5f8616,null));};exports[_0x2c7a('0x28')]=function(_0x479c89,_0x73e32a){return db['SalesforceAccount']['find']({'where':{'id':_0x479c89[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x73e32a,null))[_0x2c7a('0x27')](removeEntity(_0x73e32a,null))[_0x2c7a('0x44')](handleError(_0x73e32a,null));};exports[_0x2c7a('0x4a')]=function(_0x141a09,_0x5912fe,_0x411597){var _0x18a0b1={};var _0x5f4292={};var _0x1d0bb0;var _0x1664c2;return db[_0x2c7a('0x2d')][_0x2c7a('0x4b')]({'where':{'id':_0x141a09[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x5912fe,null))[_0x2c7a('0x27')](function(_0x4adcd6){if(_0x4adcd6){_0x1d0bb0=_0x4adcd6;_0x5f4292['model']=_[_0x2c7a('0x32')](db[_0x2c7a('0x4c')][_0x2c7a('0x2e')]);_0x5f4292[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x141a09['query']);_0x5f4292['filters']=_['intersection'](_0x5f4292[_0x2c7a('0x30')],_0x5f4292[_0x2c7a('0x31')]);_0x18a0b1['attributes']=_[_0x2c7a('0x34')](_0x5f4292[_0x2c7a('0x30')],qs[_0x2c7a('0x36')](_0x141a09['query']['fields']));_0x18a0b1[_0x2c7a('0x35')]=_0x18a0b1[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x18a0b1[_0x2c7a('0x35')]:_0x5f4292[_0x2c7a('0x30')];_0x18a0b1[_0x2c7a('0x3a')]=qs[_0x2c7a('0x3b')](_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3b')]);_0x18a0b1[_0x2c7a('0x3c')]=qs['filters'](_[_0x2c7a('0x4d')](_0x141a09[_0x2c7a('0x31')],_0x5f4292[_0x2c7a('0x33')]));if(_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3d')]){_0x18a0b1[_0x2c7a('0x3c')]=_[_0x2c7a('0x3e')](_0x18a0b1[_0x2c7a('0x3c')],{'$or':_['map'](_0x18a0b1['attributes'],function(_0x462659){var _0x7357f7={};_0x7357f7[_0x462659]={'$like':'%'+_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3d')]+'%'};return _0x7357f7;})});}_0x18a0b1=_['merge']({},_0x18a0b1,_0x141a09[_0x2c7a('0x41')]);return _0x1d0bb0['getConfigurations'](_0x18a0b1);}})[_0x2c7a('0x27')](function(_0x3b09a8){if(_0x3b09a8){_0x1664c2=_0x3b09a8[_0x2c7a('0x37')];if(!_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x38')](_0x2c7a('0x39'))){_0x18a0b1[_0x2c7a('0x1f')]=qs[_0x2c7a('0x1f')](_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x1f')]);_0x18a0b1['offset']=qs[_0x2c7a('0x1d')](_0x141a09['query'][_0x2c7a('0x1d')]);}return _0x1d0bb0['getConfigurations'](_0x18a0b1);}})[_0x2c7a('0x27')](function(_0x5ca9c0){if(_0x5ca9c0){return _0x5ca9c0?{'count':_0x1664c2,'rows':_0x5ca9c0}:null;}})[_0x2c7a('0x27')](respondWithResult(_0x5912fe,null))[_0x2c7a('0x44')](handleError(_0x5912fe,null));};exports['addConfiguration']=function(_0x267a68,_0x45cd3b,_0x57a3b8){if(_0x267a68['body']['id']){delete _0x267a68[_0x2c7a('0x48')]['id'];}return db[_0x2c7a('0x2d')][_0x2c7a('0x4b')]({'where':{'id':_0x267a68[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x45cd3b,null))[_0x2c7a('0x27')](function(_0x383fed){if(_0x383fed){_0x267a68[_0x2c7a('0x48')][_0x2c7a('0x4e')]=_0x383fed['id'];_0x267a68['body']['Subjects']=integrations[_0x2c7a('0x4f')](_0x267a68[_0x2c7a('0x48')][_0x2c7a('0x50')],_0x267a68['body']['type']);_0x267a68['body'][_0x2c7a('0x51')]=integrations[_0x2c7a('0x52')](_0x267a68[_0x2c7a('0x48')]['channel'],_0x267a68['body'][_0x2c7a('0x3f')]);return db[_0x2c7a('0x4c')]['create'](_0x267a68[_0x2c7a('0x48')],{'include':[{'model':db[_0x2c7a('0x53')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x2c7a('0x51')}]});}return null;})['then'](respondWithResult(_0x45cd3b,null))['catch'](handleError(_0x45cd3b,null));};exports[_0x2c7a('0x54')]=function(_0xe5ba47,_0xe61518,_0xe20d4){var _0x594b28;var _0x552e30='';var _0x30e4fa=_0x2c7a('0x55');return db[_0x2c7a('0x2d')]['findOne']({'where':{'id':_0xe5ba47[_0x2c7a('0x45')]['id']},'attributes':['id',_0x2c7a('0x56'),_0x2c7a('0x57'),_0x2c7a('0x58'),_0x2c7a('0x59'),_0x2c7a('0x5a'),'securityToken']})[_0x2c7a('0x27')](handleEntityNotFound(_0xe61518,null))[_0x2c7a('0x27')](function(_0x1d57ea){if(_0x1d57ea){_0x552e30=_0x1d57ea[_0x2c7a('0x56')];var _0x30f611=_0x552e30[_0x2c7a('0x5b')](-0x1);if(_0x30f611==='/'){_0x552e30=_0x552e30[_0x2c7a('0x5c')](0x0,_0x552e30[_0x2c7a('0x5d')](_0x30f611));}_0x594b28=new jsforce[(_0x2c7a('0x5e'))]({'oauth2':{'loginUrl':_0x552e30,'clientId':_0x1d57ea[_0x2c7a('0x57')],'clientSecret':_0x1d57ea['clientSecret']}});return _0x594b28[_0x2c7a('0x5f')](_0x1d57ea[_0x2c7a('0x59')],_0x1d57ea[_0x2c7a('0x5a')][_0x2c7a('0x60')](_0x1d57ea[_0x2c7a('0x61')]));}})[_0x2c7a('0x27')](function(_0x5a1d44){if(_0x5a1d44){if(!_[_0x2c7a('0x62')](_0xe5ba47[_0x2c7a('0x31')][_0x2c7a('0x63')])){_0x30e4fa=_0xe5ba47['query'][_0x2c7a('0x63')];}return _0x594b28['sobject'](_0x30e4fa)['describe']();}})[_0x2c7a('0x27')](function(_0x53625e){var _0x5b259d=['OwnerId',_0x2c7a('0x64'),'IsReminderSet',_0x2c7a('0x65'),'Subject',_0x2c7a('0x66')];var _0x4dc474=['string',_0x2c7a('0x67'),_0x2c7a('0x68'),_0x2c7a('0x69'),_0x2c7a('0x6a'),_0x2c7a('0x6b'),_0x2c7a('0x6c')];if(_0x53625e){_['remove'](_0x53625e[_0x2c7a('0x36')],function(_0x4ca127){return _0x5b259d['includes'](_0x4ca127['name'])||!_0x4dc474[_0x2c7a('0x6d')](_0x4ca127['type']);});return{'count':_0x53625e[_0x2c7a('0x36')][_0x2c7a('0x37')],'rows':_[_0x2c7a('0x2c')](_0x53625e[_0x2c7a('0x36')],function(_0x2c12c8){return{'id':_0x2c12c8[_0x2c7a('0x2a')],'name':_0x2c12c8['label'],'custom':_0x2c12c8[_0x2c7a('0x6e')],'options':_0x2c12c8['picklistValues']['length']>0x0?_[_0x2c7a('0x2c')](_0x2c12c8[_0x2c7a('0x6f')],function(_0x4b4642){return{'name':_0x4b4642['label'],'value':_0x4b4642[_0x2c7a('0x70')]};}):_0x2c12c8[_0x2c7a('0x3f')]==_0x2c7a('0x69')?[{'name':'True','value':_0x2c7a('0x71')},{'name':_0x2c7a('0x72'),'value':_0x2c7a('0x73')}]:[]};})};}})[_0x2c7a('0x27')](respondWithResult(_0xe61518,null))['catch'](function(_0x1c1830){var _0x5db9ff=_0xe5ba47[_0x2c7a('0x31')][_0x2c7a('0x74')]?0x1f4:_0x1c1830[_0x2c7a('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2c7a('0x54'),_0x5db9ff,JSON[_0x2c7a('0x76')](_0x1c1830));delete _0x1c1830[_0x2c7a('0x2a')];if(_0x5db9ff===0x191){_0x5db9ff=0x190;}_0xe61518['status'](_0x5db9ff)['send'](_0xe5ba47['query'][_0x2c7a('0x74')]?{'message':_0x2c7a('0x77'),'statusCode':_0x1c1830[_0x2c7a('0x75')]}:_0x1c1830);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0a9a38e..d1d9e79 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 _0x33e1=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x1715b2,_0x263ece){var _0x5f24fb=function(_0x2c479f){while(--_0x2c479f){_0x1715b2['push'](_0x1715b2['shift']());}};_0x5f24fb(++_0x263ece);}(_0x33e1,0x142));var _0x133e=function(_0x601d62,_0x56d036){_0x601d62=_0x601d62-0x0;var _0x2f7f0f=_0x33e1[_0x601d62];return _0x2f7f0f;};'use strict';var _=require(_0x133e('0x0'));var util=require(_0x133e('0x1'));var logger=require(_0x133e('0x2'))(_0x133e('0x3'));var moment=require(_0x133e('0x4'));var BPromise=require('bluebird');var rp=require(_0x133e('0x5'));var fs=require('fs');var path=require(_0x133e('0x6'));var rimraf=require(_0x133e('0x7'));var config=require(_0x133e('0x8'));var attributes=require(_0x133e('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4c0286,_0x47417b){return _0x4c0286[_0x133e('0xa')](_0x133e('0xb'),attributes,{'tableName':_0x133e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e3d=['request-promise','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','api','moment','bluebird'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x1958dc,_0x533f1a){_0x1958dc=_0x1958dc-0x0;var _0x141ff7=_0x2e3d[_0x1958dc];return _0x141ff7;};'use strict';var _=require(_0xd2e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2e3('0x1'));var moment=require(_0xd2e3('0x2'));var BPromise=require(_0xd2e3('0x3'));var rp=require(_0xd2e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2e3('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xd2e3('0x6'));module[_0xd2e3('0x7')]=function(_0x3beebf,_0x471fd0){return _0x3beebf[_0xd2e3('0x8')](_0xd2e3('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 89915aa..f2295c2 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 _0x5771=['bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','SalesforceAccount','options','where','attributes','limit','map','model','include','then','ShowSalesforceAccount','find','raw','lodash','util','moment'];(function(_0xbf632,_0x5b2448){var _0xab1370=function(_0x5735d2){while(--_0x5735d2){_0xbf632['push'](_0xbf632['shift']());}};_0xab1370(++_0x5b2448);}(_0x5771,0x114));var _0x1577=function(_0x4d54df,_0x5055c3){_0x4d54df=_0x4d54df-0x0;var _0x58752a=_0x5771[_0x4d54df];return _0x58752a;};'use strict';var _=require(_0x1577('0x0'));var util=require(_0x1577('0x1'));var moment=require(_0x1577('0x2'));var BPromise=require(_0x1577('0x3'));var rs=require(_0x1577('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1577('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1577('0x6'));var client=jayson[_0x1577('0x7')][_0x1577('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2abcbc,_0x395794,_0x12086a){return new BPromise(function(_0x3f37e3,_0x13c641){return client[_0x1577('0x9')](_0x2abcbc,_0x12086a)['then'](function(_0x214137){logger[_0x1577('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x395794,'request\x20sent');logger[_0x1577('0xb')](_0x1577('0xc'),_0x395794,'request\x20sent',JSON[_0x1577('0xd')](_0x214137));if(_0x214137[_0x1577('0xe')]){if(_0x214137[_0x1577('0xe')]['code']===0x1f4){logger[_0x1577('0xe')](_0x1577('0xf'),_0x395794,_0x214137[_0x1577('0xe')]['message']);return _0x13c641(_0x214137['error']['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x395794,_0x214137[_0x1577('0xe')][_0x1577('0x10')]);return _0x3f37e3(_0x214137['error'][_0x1577('0x10')]);}else{logger[_0x1577('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x395794,'request\x20sent');_0x3f37e3(_0x214137['result'][_0x1577('0x10')]);}})[_0x1577('0x11')](function(_0x530e30){logger['error'](_0x1577('0xf'),_0x395794,_0x530e30);_0x13c641(_0x530e30);});});}exports[_0x1577('0x12')]=function(_0x4ac695){var _0x55b50e=this;return new Promise(function(_0x167d2b,_0x4fad0a){return db[_0x1577('0x13')]['findAll']({'raw':_0x4ac695['options']?_0x4ac695[_0x1577('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4ac695[_0x1577('0x14')]?_0x4ac695[_0x1577('0x14')][_0x1577('0x15')]||null:null,'attributes':_0x4ac695['options']?_0x4ac695[_0x1577('0x14')][_0x1577('0x16')]||null:null,'limit':_0x4ac695[_0x1577('0x14')]?_0x4ac695['options'][_0x1577('0x17')]||null:null,'include':_0x4ac695[_0x1577('0x14')]?_0x4ac695[_0x1577('0x14')]['include']?_[_0x1577('0x18')](_0x4ac695[_0x1577('0x14')]['include'],function(_0x504cdc){return{'model':db[_0x504cdc[_0x1577('0x19')]],'as':_0x504cdc['as'],'attributes':_0x504cdc[_0x1577('0x16')],'include':_0x504cdc[_0x1577('0x1a')]?_[_0x1577('0x18')](_0x504cdc[_0x1577('0x1a')],function(_0x56364c){return{'model':db[_0x56364c[_0x1577('0x19')]],'as':_0x56364c['as'],'attributes':_0x56364c[_0x1577('0x16')],'include':_0x56364c[_0x1577('0x1a')]?_[_0x1577('0x18')](_0x56364c['include'],function(_0x320801){return{'model':db[_0x320801[_0x1577('0x19')]],'as':_0x320801['as'],'attributes':_0x320801[_0x1577('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1577('0x1b')](function(_0x319bc){logger['info']('GetSalesforceAccount',_0x4ac695);logger[_0x1577('0xb')](_0x1577('0x12'),_0x4ac695,JSON[_0x1577('0xd')](_0x319bc));_0x167d2b(_0x319bc);})[_0x1577('0x11')](function(_0x1e938a){logger[_0x1577('0xe')]('GetSalesforceAccount',_0x1e938a[_0x1577('0x10')],_0x4ac695);_0x4fad0a(_0x55b50e[_0x1577('0xe')](0x1f4,_0x1e938a['message']));});});};exports[_0x1577('0x1c')]=function(_0x1f2d87){var _0x49e844=this;return new Promise(function(_0x2dc24e,_0x9907c9){return db[_0x1577('0x13')][_0x1577('0x1d')]({'raw':_0x1f2d87[_0x1577('0x14')]?_0x1f2d87[_0x1577('0x14')][_0x1577('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f2d87[_0x1577('0x14')]?_0x1f2d87[_0x1577('0x14')]['where']||null:null,'attributes':_0x1f2d87[_0x1577('0x14')]?_0x1f2d87[_0x1577('0x14')]['attributes']||null:null,'include':_0x1f2d87[_0x1577('0x14')]?_0x1f2d87[_0x1577('0x14')]['include']?_['map'](_0x1f2d87[_0x1577('0x14')][_0x1577('0x1a')],function(_0x2c0bb6){return{'model':db[_0x2c0bb6[_0x1577('0x19')]],'as':_0x2c0bb6['as'],'attributes':_0x2c0bb6[_0x1577('0x16')],'include':_0x2c0bb6[_0x1577('0x1a')]?_[_0x1577('0x18')](_0x2c0bb6[_0x1577('0x1a')],function(_0x23bf5a){return{'model':db[_0x23bf5a[_0x1577('0x19')]],'as':_0x23bf5a['as'],'attributes':_0x23bf5a['attributes'],'include':_0x23bf5a[_0x1577('0x1a')]?_[_0x1577('0x18')](_0x23bf5a[_0x1577('0x1a')],function(_0x2c55aa){return{'model':db[_0x2c55aa['model']],'as':_0x2c55aa['as'],'attributes':_0x2c55aa[_0x1577('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1577('0x1b')](function(_0x2eb2b1){logger[_0x1577('0xa')](_0x1577('0x1c'),_0x1f2d87);logger[_0x1577('0xb')](_0x1577('0x1c'),_0x1f2d87,JSON[_0x1577('0xd')](_0x2eb2b1));_0x2dc24e(_0x2eb2b1);})[_0x1577('0x11')](function(_0x406070){logger[_0x1577('0xe')]('ShowSalesforceAccount',_0x406070[_0x1577('0x10')],_0x1f2d87);_0x9907c9(_0x49e844[_0x1577('0xe')](0x1f4,_0x406070[_0x1577('0x10')]));});});}; \ No newline at end of file +var _0x7524=['limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes'];(function(_0x448a34,_0x2ea5f4){var _0x5e41d0=function(_0x4397ba){while(--_0x4397ba){_0x448a34['push'](_0x448a34['shift']());}};_0x5e41d0(++_0x2ea5f4);}(_0x7524,0xce));var _0x4752=function(_0x3a4d86,_0x2d0e84){_0x3a4d86=_0x3a4d86-0x0;var _0x44fd39=_0x7524[_0x3a4d86];return _0x44fd39;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var moment=require(_0x4752('0x1'));var BPromise=require('bluebird');var rs=require(_0x4752('0x2'));var fs=require('fs');var Redis=require(_0x4752('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4752('0x4'))('rpc');var config=require(_0x4752('0x5'));var jayson=require(_0x4752('0x6'));var client=jayson[_0x4752('0x7')][_0x4752('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x104962,_0x5b98c0,_0x1e76cf){return new BPromise(function(_0x1cbf34,_0x59477c){return client['request'](_0x104962,_0x1e76cf)[_0x4752('0x9')](function(_0x45e0ff){logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,'request\x20sent');logger[_0x4752('0xc')](_0x4752('0xd'),_0x5b98c0,_0x4752('0xe'),JSON[_0x4752('0xf')](_0x45e0ff));if(_0x45e0ff[_0x4752('0x10')]){if(_0x45e0ff['error'][_0x4752('0x11')]===0x1f4){logger[_0x4752('0x10')](_0x4752('0xb'),_0x5b98c0,_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);return _0x59477c(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}logger['error'](_0x4752('0xb'),_0x5b98c0,_0x45e0ff['error'][_0x4752('0x12')]);return _0x1cbf34(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}else{logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,_0x4752('0xe'));_0x1cbf34(_0x45e0ff[_0x4752('0x13')]['message']);}})[_0x4752('0x14')](function(_0x1dad7c){logger['error'](_0x4752('0xb'),_0x5b98c0,_0x1dad7c);_0x59477c(_0x1dad7c);});});}exports['GetSalesforceAccount']=function(_0x1429f4){var _0x3c9ccc=this;return new Promise(function(_0x516f3e,_0x2d7ab6){return db['SalesforceAccount']['findAll']({'raw':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x16')]===undefined?!![]:![]:!![],'where':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x17')]||null:null,'attributes':_0x1429f4['options']?_0x1429f4[_0x4752('0x15')][_0x4752('0x18')]||null:null,'limit':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x19')]||null:null,'include':_0x1429f4[_0x4752('0x15')]?_0x1429f4['options'][_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x1429f4['options'][_0x4752('0x1a')],function(_0x403005){return{'model':db[_0x403005[_0x4752('0x1c')]],'as':_0x403005['as'],'attributes':_0x403005[_0x4752('0x18')],'include':_0x403005[_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x403005[_0x4752('0x1a')],function(_0x45c557){return{'model':db[_0x45c557[_0x4752('0x1c')]],'as':_0x45c557['as'],'attributes':_0x45c557[_0x4752('0x18')],'include':_0x45c557['include']?_[_0x4752('0x1b')](_0x45c557['include'],function(_0x4b2635){return{'model':db[_0x4b2635['model']],'as':_0x4b2635['as'],'attributes':_0x4b2635[_0x4752('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4752('0x9')](function(_0x1bc71b){logger[_0x4752('0xa')](_0x4752('0x1d'),_0x1429f4);logger[_0x4752('0xc')](_0x4752('0x1d'),_0x1429f4,JSON[_0x4752('0xf')](_0x1bc71b));_0x516f3e(_0x1bc71b);})['catch'](function(_0x5745c0){logger[_0x4752('0x10')](_0x4752('0x1d'),_0x5745c0[_0x4752('0x12')],_0x1429f4);_0x2d7ab6(_0x3c9ccc[_0x4752('0x10')](0x1f4,_0x5745c0[_0x4752('0x12')]));});});};exports[_0x4752('0x1e')]=function(_0x258795){var _0x3164d0=this;return new Promise(function(_0x3b2774,_0x1f54ab){return db[_0x4752('0x1f')][_0x4752('0x20')]({'raw':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x16')]===undefined?!![]:![]:!![],'where':_0x258795[_0x4752('0x15')]?_0x258795['options']['where']||null:null,'attributes':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x18')]||null:null,'include':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x258795[_0x4752('0x15')][_0x4752('0x1a')],function(_0x3f2f44){return{'model':db[_0x3f2f44['model']],'as':_0x3f2f44['as'],'attributes':_0x3f2f44[_0x4752('0x18')],'include':_0x3f2f44['include']?_[_0x4752('0x1b')](_0x3f2f44[_0x4752('0x1a')],function(_0x4411d6){return{'model':db[_0x4411d6[_0x4752('0x1c')]],'as':_0x4411d6['as'],'attributes':_0x4411d6[_0x4752('0x18')],'include':_0x4411d6['include']?_[_0x4752('0x1b')](_0x4411d6['include'],function(_0x26d283){return{'model':db[_0x26d283[_0x4752('0x1c')]],'as':_0x26d283['as'],'attributes':_0x26d283[_0x4752('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4752('0x9')](function(_0xa96174){logger[_0x4752('0xa')](_0x4752('0x1e'),_0x258795);logger[_0x4752('0xc')](_0x4752('0x1e'),_0x258795,JSON[_0x4752('0xf')](_0xa96174));_0x3b2774(_0xa96174);})['catch'](function(_0x1717ea){logger[_0x4752('0x10')](_0x4752('0x1e'),_0x1717ea[_0x4752('0x12')],_0x258795);_0x1f54ab(_0x3164d0[_0x4752('0x10')](0x1f4,_0x1717ea[_0x4752('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 79eeb09..dbdb60f 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2f1c3b,_0x19dd4e){var _0x5d31a3=function(_0x479b64){while(--_0x479b64){_0x2f1c3b['push'](_0x2f1c3b['shift']());}};_0x5d31a3(++_0x19dd4e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x392320,_0x428048){_0x392320=_0x392320-0x0;var _0x1fa64d=_0x5f2f[_0x392320];return _0x1fa64d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x170d4c,_0x4fc4f2){var _0x2ea811=function(_0x5acbb7){while(--_0x5acbb7){_0x170d4c['push'](_0x170d4c['shift']());}};_0x2ea811(++_0x4fc4f2);}(_0x2ef3,0xba));var _0x32ef=function(_0xb9f075,_0x407568){_0xb9f075=_0xb9f075-0x0;var _0x3c6e0c=_0x2ef3[_0xb9f075];return _0x3c6e0c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f8e2a43..854cf6f 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 _0x3012=['account','nothing','STRING','Task','ENUM','contact_lead','contact','lead'];(function(_0x120fb7,_0x53a996){var _0x4fecc2=function(_0x5a513f){while(--_0x5a513f){_0x120fb7['push'](_0x120fb7['shift']());}};_0x4fecc2(++_0x53a996);}(_0x3012,0x182));var _0x2301=function(_0x2beda9,_0x31cf95){_0x2beda9=_0x2beda9-0x0;var _0x7c3df6=_0x3012[_0x2beda9];return _0x7c3df6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2301('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x2301('0x1'),'Case'),'defaultValue':_0x2301('0x1')},'moduleSearch':{'type':Sequelize[_0x2301('0x2')](_0x2301('0x3'),_0x2301('0x4'),_0x2301('0x5'),'account_contact_lead',_0x2301('0x6')),'defaultValue':_0x2301('0x3')},'moduleCreate':{'type':Sequelize[_0x2301('0x2')](_0x2301('0x7'),_0x2301('0x4'),_0x2301('0x5'),'account'),'defaultValue':_0x2301('0x5')},'leadId':{'type':Sequelize[_0x2301('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x2301('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2301('0x0')]}}; \ No newline at end of file +var _0x8da8=['nothing','sequelize','exports','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead'];(function(_0x37c2cb,_0x18397b){var _0x5dda0c=function(_0x476bab){while(--_0x476bab){_0x37c2cb['push'](_0x37c2cb['shift']());}};_0x5dda0c(++_0x18397b);}(_0x8da8,0x187));var _0x88da=function(_0x23289e,_0x5085ad){_0x23289e=_0x23289e-0x0;var _0xf201bf=_0x8da8[_0x23289e];return _0xf201bf;};'use strict';var Sequelize=require(_0x88da('0x0'));module[_0x88da('0x1')]={'name':{'type':Sequelize[_0x88da('0x2')]},'description':{'type':Sequelize[_0x88da('0x2')]},'ticketType':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x4'),'Case'),'defaultValue':_0x88da('0x4')},'moduleSearch':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x5'),_0x88da('0x6'),_0x88da('0x7'),_0x88da('0x8'),'account'),'defaultValue':_0x88da('0x5')},'moduleCreate':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x9'),_0x88da('0x6'),'lead','account'),'defaultValue':_0x88da('0x7')},'leadId':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x88da('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 5e529ad..849a753 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 _0x4e13=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','findOne','SalesforceField','rawAttributes','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x547998,_0x409efc){var _0x1d9bff=function(_0x3fb9e6){while(--_0x3fb9e6){_0x547998['push'](_0x547998['shift']());}};_0x1d9bff(++_0x409efc);}(_0x4e13,0xdf));var _0x34e1=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0x4e13[_0x5ece84];return _0x2a12c4;};'use strict';var emlformat=require(_0x34e1('0x0'));var rimraf=require(_0x34e1('0x1'));var zipdir=require(_0x34e1('0x2'));var jsonpatch=require(_0x34e1('0x3'));var rp=require(_0x34e1('0x4'));var moment=require(_0x34e1('0x5'));var BPromise=require(_0x34e1('0x6'));var Mustache=require(_0x34e1('0x7'));var util=require(_0x34e1('0x8'));var path=require(_0x34e1('0x9'));var sox=require(_0x34e1('0xa'));var csv=require(_0x34e1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34e1('0xc'));var _=require(_0x34e1('0xd'));var squel=require(_0x34e1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x34e1('0xf'));var toCsv=require(_0x34e1('0xb'));var querystring=require(_0x34e1('0x10'));var Papa=require(_0x34e1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x34e1('0x12'));var as=require(_0x34e1('0x13'));var hardwareService=require(_0x34e1('0x14'));var logger=require(_0x34e1('0x15'))(_0x34e1('0x16'));var utils=require(_0x34e1('0x17'));var config=require(_0x34e1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x34e1('0x19'))['db'];function respondWithStatusCode(_0x261a67,_0xd71139){_0xd71139=_0xd71139||0xcc;return function(_0xf7f633){if(_0xf7f633){return _0x261a67[_0x34e1('0x1a')](_0xd71139);}return _0x261a67['status'](_0xd71139)[_0x34e1('0x1b')]();};}function respondWithResult(_0x4b009e,_0x2e51da){_0x2e51da=_0x2e51da||0xc8;return function(_0xe3e3a8){if(_0xe3e3a8){return _0x4b009e[_0x34e1('0x1c')](_0x2e51da)['json'](_0xe3e3a8);}};}function respondWithFilteredResult(_0x322021,_0x366edb){return function(_0x450959){if(_0x450959){var _0x21be94=typeof _0x366edb[_0x34e1('0x1d')]===_0x34e1('0x1e')&&typeof _0x366edb[_0x34e1('0x1f')]===_0x34e1('0x1e');var _0x4630ef=_0x450959[_0x34e1('0x20')];var _0x3a09db=_0x21be94?0x0:_0x366edb[_0x34e1('0x1d')];var _0x3f2f93=_0x21be94?_0x450959[_0x34e1('0x20')]:_0x366edb['offset']+_0x366edb[_0x34e1('0x1f')];var _0x5906c0;if(_0x3f2f93>=_0x4630ef){_0x3f2f93=_0x4630ef;_0x5906c0=0xc8;}else{_0x5906c0=0xce;}_0x322021['status'](_0x5906c0);return _0x322021[_0x34e1('0x21')](_0x34e1('0x22'),_0x3a09db+'-'+_0x3f2f93+'/'+_0x4630ef)['json'](_0x450959);}return null;};}function patchUpdates(_0x4aada1){return function(_0x2f6645){try{jsonpatch[_0x34e1('0x23')](_0x2f6645,_0x4aada1,!![]);}catch(_0x15b76e){return BPromise[_0x34e1('0x24')](_0x15b76e);}return _0x2f6645[_0x34e1('0x25')]();};}function saveUpdates(_0x2952b7,_0x5cf2ec){return function(_0x15c756){if(_0x15c756){return _0x15c756[_0x34e1('0x26')](_0x2952b7)[_0x34e1('0x27')](function(_0x11824e){return _0x11824e;});}return null;};}function removeEntity(_0x4529c8,_0x4af88a){return function(_0x294784){if(_0x294784){return _0x294784[_0x34e1('0x28')]()['then'](function(){_0x4529c8[_0x34e1('0x1c')](0xcc)[_0x34e1('0x1b')]();});}};}function handleEntityNotFound(_0x4aa164,_0x35c4e0){return function(_0x119ba7){if(!_0x119ba7){_0x4aa164['sendStatus'](0x194);}return _0x119ba7;};}function handleError(_0x3d1b51,_0x368aaa){_0x368aaa=_0x368aaa||0x1f4;return function(_0x5dd4c3){logger[_0x34e1('0x29')](_0x5dd4c3['stack']);if(_0x5dd4c3['name']){delete _0x5dd4c3['name'];}_0x3d1b51['status'](_0x368aaa)[_0x34e1('0x2a')](_0x5dd4c3);};}exports[_0x34e1('0x2b')]=function(_0x59c179,_0x1a252d){var _0x5cdad2={},_0x1000f4={},_0x1b4172={'count':0x0,'rows':[]};var _0x4ca4ce=_[_0x34e1('0x2c')](db[_0x34e1('0x2d')]['rawAttributes'],function(_0x1609b3){return{'name':_0x1609b3[_0x34e1('0x2e')],'type':_0x1609b3[_0x34e1('0x2f')][_0x34e1('0x30')]};});_0x1000f4[_0x34e1('0x31')]=_[_0x34e1('0x2c')](_0x4ca4ce,'name');_0x1000f4[_0x34e1('0x32')]=_[_0x34e1('0x33')](_0x59c179[_0x34e1('0x32')]);_0x1000f4['filters']=_['intersection'](_0x1000f4[_0x34e1('0x31')],_0x1000f4[_0x34e1('0x32')]);_0x5cdad2['attributes']=_[_0x34e1('0x34')](_0x1000f4[_0x34e1('0x31')],qs[_0x34e1('0x35')](_0x59c179[_0x34e1('0x32')]['fields']));_0x5cdad2[_0x34e1('0x36')]=_0x5cdad2[_0x34e1('0x36')][_0x34e1('0x37')]?_0x5cdad2[_0x34e1('0x36')]:_0x1000f4[_0x34e1('0x31')];if(!_0x59c179[_0x34e1('0x32')][_0x34e1('0x38')](_0x34e1('0x39'))){_0x5cdad2['limit']=qs[_0x34e1('0x1f')](_0x59c179[_0x34e1('0x32')]['limit']);_0x5cdad2[_0x34e1('0x1d')]=qs[_0x34e1('0x1d')](_0x59c179[_0x34e1('0x32')][_0x34e1('0x1d')]);}_0x5cdad2[_0x34e1('0x3a')]=qs['sort'](_0x59c179[_0x34e1('0x32')][_0x34e1('0x3b')]);_0x5cdad2[_0x34e1('0x3c')]=qs[_0x34e1('0x3d')](_['pick'](_0x59c179[_0x34e1('0x32')],_0x1000f4[_0x34e1('0x3d')]),_0x4ca4ce);if(_0x59c179['query'][_0x34e1('0x3e')]){_0x5cdad2[_0x34e1('0x3c')]=_[_0x34e1('0x3f')](_0x5cdad2[_0x34e1('0x3c')],{'$or':_['map'](_0x4ca4ce,function(_0x373bad){if(_0x373bad[_0x34e1('0x2f')]!==_0x34e1('0x40')){var _0x344b58={};_0x344b58[_0x373bad['name']]={'$like':'%'+_0x59c179[_0x34e1('0x32')][_0x34e1('0x3e')]+'%'};return _0x344b58;}})});}_0x5cdad2=_[_0x34e1('0x3f')]({},_0x5cdad2,_0x59c179[_0x34e1('0x41')]);var _0x437138={'where':_0x5cdad2[_0x34e1('0x3c')]};return db[_0x34e1('0x2d')]['count'](_0x437138)['then'](function(_0x3ac641){_0x1b4172[_0x34e1('0x20')]=_0x3ac641;if(_0x59c179[_0x34e1('0x32')][_0x34e1('0x42')]){_0x5cdad2[_0x34e1('0x43')]=[{'all':!![]}];}return db[_0x34e1('0x2d')][_0x34e1('0x44')](_0x5cdad2);})[_0x34e1('0x27')](function(_0x26dc6f){_0x1b4172[_0x34e1('0x45')]=_0x26dc6f;return _0x1b4172;})[_0x34e1('0x27')](respondWithFilteredResult(_0x1a252d,_0x5cdad2))[_0x34e1('0x46')](handleError(_0x1a252d,null));};exports['show']=function(_0x34217b,_0x4a4550){var _0x161bf4={'raw':![],'where':{'id':_0x34217b['params']['id']}},_0x19e7f6={};_0x19e7f6[_0x34e1('0x31')]=_[_0x34e1('0x33')](db[_0x34e1('0x2d')]['rawAttributes']);_0x19e7f6[_0x34e1('0x32')]=_[_0x34e1('0x33')](_0x34217b['query']);_0x19e7f6[_0x34e1('0x3d')]=_[_0x34e1('0x34')](_0x19e7f6['model'],_0x19e7f6[_0x34e1('0x32')]);_0x161bf4[_0x34e1('0x36')]=_[_0x34e1('0x34')](_0x19e7f6[_0x34e1('0x31')],qs[_0x34e1('0x35')](_0x34217b[_0x34e1('0x32')][_0x34e1('0x35')]));_0x161bf4[_0x34e1('0x36')]=_0x161bf4[_0x34e1('0x36')][_0x34e1('0x37')]?_0x161bf4['attributes']:_0x19e7f6[_0x34e1('0x31')];if(_0x34217b[_0x34e1('0x32')][_0x34e1('0x42')]){_0x161bf4[_0x34e1('0x43')]=[{'all':!![]}];}_0x161bf4=_[_0x34e1('0x3f')]({},_0x161bf4,_0x34217b[_0x34e1('0x41')]);return db[_0x34e1('0x2d')][_0x34e1('0x47')](_0x161bf4)['then'](handleEntityNotFound(_0x4a4550,null))[_0x34e1('0x27')](respondWithResult(_0x4a4550,null))[_0x34e1('0x46')](handleError(_0x4a4550,null));};exports[_0x34e1('0x48')]=function(_0x15d418,_0x326b03){return db[_0x34e1('0x2d')][_0x34e1('0x48')](_0x15d418[_0x34e1('0x49')],{})[_0x34e1('0x27')](respondWithResult(_0x326b03,0xc9))[_0x34e1('0x46')](handleError(_0x326b03,null));};exports['update']=function(_0xb15274,_0x187d1e){if(_0xb15274[_0x34e1('0x49')]['id']){delete _0xb15274[_0x34e1('0x49')]['id'];}return db[_0x34e1('0x2d')]['find']({'where':{'id':_0xb15274[_0x34e1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x187d1e,null))['then'](saveUpdates(_0xb15274[_0x34e1('0x49')],null))[_0x34e1('0x27')](respondWithResult(_0x187d1e,null))['catch'](handleError(_0x187d1e,null));};exports['destroy']=function(_0x17711a,_0x289b9d){return db[_0x34e1('0x2d')][_0x34e1('0x47')]({'where':{'id':_0x17711a[_0x34e1('0x4a')]['id']}})[_0x34e1('0x27')](handleEntityNotFound(_0x289b9d,null))[_0x34e1('0x27')](removeEntity(_0x289b9d,null))[_0x34e1('0x46')](handleError(_0x289b9d,null));};exports['getFields']=function(_0x199efe,_0x2d4820,_0x4d4f79){var _0x41f677={};var _0x1c0c2a={};var _0x49b584;var _0x15dcf8;return db['SalesforceConfiguration'][_0x34e1('0x4b')]({'where':{'id':_0x199efe[_0x34e1('0x4a')]['id']}})[_0x34e1('0x27')](handleEntityNotFound(_0x2d4820,null))[_0x34e1('0x27')](function(_0x4ce901){if(_0x4ce901){_0x49b584=_0x4ce901;_0x1c0c2a[_0x34e1('0x31')]=_[_0x34e1('0x33')](db[_0x34e1('0x4c')][_0x34e1('0x4d')]);_0x1c0c2a[_0x34e1('0x32')]=_[_0x34e1('0x33')](_0x199efe[_0x34e1('0x32')]);_0x1c0c2a[_0x34e1('0x3d')]=_[_0x34e1('0x34')](_0x1c0c2a['model'],_0x1c0c2a['query']);_0x41f677[_0x34e1('0x36')]=_['intersection'](_0x1c0c2a[_0x34e1('0x31')],qs['fields'](_0x199efe['query']['fields']));_0x41f677[_0x34e1('0x36')]=_0x41f677[_0x34e1('0x36')][_0x34e1('0x37')]?_0x41f677['attributes']:_0x1c0c2a[_0x34e1('0x31')];_0x41f677[_0x34e1('0x3a')]=qs[_0x34e1('0x3b')](_0x199efe['query'][_0x34e1('0x3b')]);_0x41f677[_0x34e1('0x3c')]=qs['filters'](_[_0x34e1('0x4e')](_0x199efe[_0x34e1('0x32')],_0x1c0c2a['filters']));if(_0x199efe[_0x34e1('0x32')][_0x34e1('0x3e')]){_0x41f677['where']=_['merge'](_0x41f677[_0x34e1('0x3c')],{'$or':_[_0x34e1('0x2c')](_0x41f677[_0x34e1('0x36')],function(_0x52d45f){var _0x43e67f={};_0x43e67f[_0x52d45f]={'$like':'%'+_0x199efe['query'][_0x34e1('0x3e')]+'%'};return _0x43e67f;})});}_0x41f677=_[_0x34e1('0x3f')]({},_0x41f677,_0x199efe[_0x34e1('0x41')]);return _0x49b584[_0x34e1('0x4f')](_0x41f677);}})['then'](function(_0x3303ce){if(_0x3303ce){_0x15dcf8=_0x3303ce['length'];if(!_0x199efe[_0x34e1('0x32')][_0x34e1('0x38')](_0x34e1('0x39'))){_0x41f677['limit']=qs[_0x34e1('0x1f')](_0x199efe[_0x34e1('0x32')][_0x34e1('0x1f')]);_0x41f677[_0x34e1('0x1d')]=qs[_0x34e1('0x1d')](_0x199efe[_0x34e1('0x32')]['offset']);}return _0x49b584[_0x34e1('0x4f')](_0x41f677);}})[_0x34e1('0x27')](function(_0x222f39){if(_0x222f39){return _0x222f39?{'count':_0x15dcf8,'rows':_0x222f39}:null;}})[_0x34e1('0x27')](respondWithResult(_0x2d4820,null))[_0x34e1('0x46')](handleError(_0x2d4820,null));};exports[_0x34e1('0x50')]=function(_0x55db86,_0x291672,_0x2d6f91){var _0x5844d8={};var _0x218fb5={};var _0x14d033;var _0xe7cd26;return db[_0x34e1('0x2d')][_0x34e1('0x4b')]({'where':{'id':_0x55db86[_0x34e1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x291672,null))['then'](function(_0x1eb548){if(_0x1eb548){_0x14d033=_0x1eb548;_0x218fb5[_0x34e1('0x31')]=_[_0x34e1('0x33')](db[_0x34e1('0x4c')]['rawAttributes']);_0x218fb5[_0x34e1('0x32')]=_[_0x34e1('0x33')](_0x55db86[_0x34e1('0x32')]);_0x218fb5[_0x34e1('0x3d')]=_[_0x34e1('0x34')](_0x218fb5[_0x34e1('0x31')],_0x218fb5[_0x34e1('0x32')]);_0x5844d8[_0x34e1('0x36')]=_[_0x34e1('0x34')](_0x218fb5[_0x34e1('0x31')],qs['fields'](_0x55db86['query'][_0x34e1('0x35')]));_0x5844d8[_0x34e1('0x36')]=_0x5844d8['attributes'][_0x34e1('0x37')]?_0x5844d8['attributes']:_0x218fb5[_0x34e1('0x31')];_0x5844d8[_0x34e1('0x3a')]=qs['sort'](_0x55db86[_0x34e1('0x32')][_0x34e1('0x3b')]);_0x5844d8['where']=qs[_0x34e1('0x3d')](_[_0x34e1('0x4e')](_0x55db86[_0x34e1('0x32')],_0x218fb5[_0x34e1('0x3d')]));if(_0x55db86[_0x34e1('0x32')][_0x34e1('0x3e')]){_0x5844d8[_0x34e1('0x3c')]=_[_0x34e1('0x3f')](_0x5844d8[_0x34e1('0x3c')],{'$or':_[_0x34e1('0x2c')](_0x5844d8['attributes'],function(_0x14eef6){var _0x3b381d={};_0x3b381d[_0x14eef6]={'$like':'%'+_0x55db86['query'][_0x34e1('0x3e')]+'%'};return _0x3b381d;})});}_0x5844d8=_[_0x34e1('0x3f')]({},_0x5844d8,_0x55db86[_0x34e1('0x41')]);return _0x14d033['getSubjects'](_0x5844d8);}})[_0x34e1('0x27')](function(_0x849437){if(_0x849437){_0xe7cd26=_0x849437[_0x34e1('0x37')];if(!_0x55db86[_0x34e1('0x32')][_0x34e1('0x38')](_0x34e1('0x39'))){_0x5844d8['limit']=qs[_0x34e1('0x1f')](_0x55db86[_0x34e1('0x32')][_0x34e1('0x1f')]);_0x5844d8['offset']=qs[_0x34e1('0x1d')](_0x55db86['query']['offset']);}return _0x14d033['getSubjects'](_0x5844d8);}})['then'](function(_0x3f5d9a){if(_0x3f5d9a){return _0x3f5d9a?{'count':_0xe7cd26,'rows':_0x3f5d9a}:null;}})['then'](respondWithResult(_0x291672,null))[_0x34e1('0x46')](handleError(_0x291672,null));};exports[_0x34e1('0x51')]=function(_0x294e42,_0x2489d2,_0x3d5ed9){var _0x916085={};var _0x4a9619={};var _0x16653e;var _0x4453a8;return db[_0x34e1('0x2d')][_0x34e1('0x4b')]({'where':{'id':_0x294e42[_0x34e1('0x4a')]['id']}})[_0x34e1('0x27')](handleEntityNotFound(_0x2489d2,null))['then'](function(_0x5a0d6e){if(_0x5a0d6e){_0x16653e=_0x5a0d6e;_0x4a9619[_0x34e1('0x31')]=_['keys'](db[_0x34e1('0x4c')][_0x34e1('0x4d')]);_0x4a9619[_0x34e1('0x32')]=_[_0x34e1('0x33')](_0x294e42[_0x34e1('0x32')]);_0x4a9619[_0x34e1('0x3d')]=_[_0x34e1('0x34')](_0x4a9619['model'],_0x4a9619[_0x34e1('0x32')]);_0x916085[_0x34e1('0x36')]=_[_0x34e1('0x34')](_0x4a9619['model'],qs[_0x34e1('0x35')](_0x294e42['query']['fields']));_0x916085[_0x34e1('0x36')]=_0x916085[_0x34e1('0x36')][_0x34e1('0x37')]?_0x916085[_0x34e1('0x36')]:_0x4a9619[_0x34e1('0x31')];_0x916085[_0x34e1('0x3a')]=qs['sort'](_0x294e42[_0x34e1('0x32')]['sort']);_0x916085[_0x34e1('0x3c')]=qs['filters'](_['pick'](_0x294e42['query'],_0x4a9619[_0x34e1('0x3d')]));if(_0x294e42[_0x34e1('0x32')][_0x34e1('0x3e')]){_0x916085[_0x34e1('0x3c')]=_['merge'](_0x916085['where'],{'$or':_[_0x34e1('0x2c')](_0x916085['attributes'],function(_0x4cf708){var _0x1b94be={};_0x1b94be[_0x4cf708]={'$like':'%'+_0x294e42[_0x34e1('0x32')][_0x34e1('0x3e')]+'%'};return _0x1b94be;})});}_0x916085=_['merge']({},_0x916085,_0x294e42[_0x34e1('0x41')]);return _0x16653e['getDescriptions'](_0x916085);}})['then'](function(_0x26a9fc){if(_0x26a9fc){_0x4453a8=_0x26a9fc['length'];if(!_0x294e42[_0x34e1('0x32')][_0x34e1('0x38')](_0x34e1('0x39'))){_0x916085[_0x34e1('0x1f')]=qs[_0x34e1('0x1f')](_0x294e42[_0x34e1('0x32')][_0x34e1('0x1f')]);_0x916085[_0x34e1('0x1d')]=qs['offset'](_0x294e42[_0x34e1('0x32')][_0x34e1('0x1d')]);}return _0x16653e[_0x34e1('0x51')](_0x916085);}})[_0x34e1('0x27')](function(_0x4beeca){if(_0x4beeca){return _0x4beeca?{'count':_0x4453a8,'rows':_0x4beeca}:null;}})[_0x34e1('0x27')](respondWithResult(_0x2489d2,null))[_0x34e1('0x46')](handleError(_0x2489d2,null));}; \ No newline at end of file +var _0x18a6=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x412215,_0x2fdb1e){var _0x1ff77f=function(_0x4bffa6){while(--_0x4bffa6){_0x412215['push'](_0x412215['shift']());}};_0x1ff77f(++_0x2fdb1e);}(_0x18a6,0x1d4));var _0x618a=function(_0x23a374,_0x6da169){_0x23a374=_0x23a374-0x0;var _0x5cba20=_0x18a6[_0x23a374];return _0x5cba20;};'use strict';var emlformat=require(_0x618a('0x0'));var rimraf=require(_0x618a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x618a('0x2'));var rp=require(_0x618a('0x3'));var moment=require(_0x618a('0x4'));var BPromise=require(_0x618a('0x5'));var Mustache=require(_0x618a('0x6'));var util=require(_0x618a('0x7'));var path=require(_0x618a('0x8'));var sox=require(_0x618a('0x9'));var csv=require('to-csv');var ejs=require(_0x618a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x618a('0xb'));var squel=require(_0x618a('0xc'));var crypto=require(_0x618a('0xd'));var jsforce=require(_0x618a('0xe'));var deskjs=require(_0x618a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x618a('0x10'));var Papa=require('papaparse');var Redis=require(_0x618a('0x11'));var authService=require(_0x618a('0x12'));var qs=require(_0x618a('0x13'));var as=require(_0x618a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x618a('0x15'))(_0x618a('0x16'));var utils=require(_0x618a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x618a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d2f96,_0x4d79b4){_0x4d79b4=_0x4d79b4||0xcc;return function(_0x181f67){if(_0x181f67){return _0x1d2f96[_0x618a('0x19')](_0x4d79b4);}return _0x1d2f96[_0x618a('0x1a')](_0x4d79b4)[_0x618a('0x1b')]();};}function respondWithResult(_0x13f5e1,_0x4e5cf0){_0x4e5cf0=_0x4e5cf0||0xc8;return function(_0x26407d){if(_0x26407d){return _0x13f5e1[_0x618a('0x1a')](_0x4e5cf0)[_0x618a('0x1c')](_0x26407d);}};}function respondWithFilteredResult(_0x12656a,_0x5f1785){return function(_0x2cdbbe){if(_0x2cdbbe){var _0x349cbc=typeof _0x5f1785[_0x618a('0x1d')]===_0x618a('0x1e')&&typeof _0x5f1785[_0x618a('0x1f')]===_0x618a('0x1e');var _0x5a3c72=_0x2cdbbe[_0x618a('0x20')];var _0x249231=_0x349cbc?0x0:_0x5f1785[_0x618a('0x1d')];var _0x5d5a70=_0x349cbc?_0x2cdbbe[_0x618a('0x20')]:_0x5f1785[_0x618a('0x1d')]+_0x5f1785[_0x618a('0x1f')];var _0x921483;if(_0x5d5a70>=_0x5a3c72){_0x5d5a70=_0x5a3c72;_0x921483=0xc8;}else{_0x921483=0xce;}_0x12656a['status'](_0x921483);return _0x12656a['set'](_0x618a('0x21'),_0x249231+'-'+_0x5d5a70+'/'+_0x5a3c72)[_0x618a('0x1c')](_0x2cdbbe);}return null;};}function patchUpdates(_0x136293){return function(_0x2bb724){try{jsonpatch[_0x618a('0x22')](_0x2bb724,_0x136293,!![]);}catch(_0x3f0f7b){return BPromise[_0x618a('0x23')](_0x3f0f7b);}return _0x2bb724[_0x618a('0x24')]();};}function saveUpdates(_0x564900,_0x425915){return function(_0x572b80){if(_0x572b80){return _0x572b80[_0x618a('0x25')](_0x564900)[_0x618a('0x26')](function(_0x3106a7){return _0x3106a7;});}return null;};}function removeEntity(_0x4d87d6,_0x20f613){return function(_0x1f4e94){if(_0x1f4e94){return _0x1f4e94[_0x618a('0x27')]()[_0x618a('0x26')](function(){_0x4d87d6[_0x618a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e84ff,_0x44d93b){return function(_0x1870a2){if(!_0x1870a2){_0x5e84ff[_0x618a('0x19')](0x194);}return _0x1870a2;};}function handleError(_0x3f08fc,_0x34b1a9){_0x34b1a9=_0x34b1a9||0x1f4;return function(_0x4d11d0){logger['error'](_0x4d11d0['stack']);if(_0x4d11d0[_0x618a('0x28')]){delete _0x4d11d0[_0x618a('0x28')];}_0x3f08fc[_0x618a('0x1a')](_0x34b1a9)['send'](_0x4d11d0);};}exports[_0x618a('0x29')]=function(_0x42636d,_0x538c9b){var _0x1cdd4f={},_0xfac4c9={},_0x27ff7c={'count':0x0,'rows':[]};var _0x215778=_[_0x618a('0x2a')](db[_0x618a('0x2b')][_0x618a('0x2c')],function(_0x225180){return{'name':_0x225180[_0x618a('0x2d')],'type':_0x225180[_0x618a('0x2e')][_0x618a('0x2f')]};});_0xfac4c9['model']=_[_0x618a('0x2a')](_0x215778,_0x618a('0x28'));_0xfac4c9[_0x618a('0x30')]=_[_0x618a('0x31')](_0x42636d['query']);_0xfac4c9[_0x618a('0x32')]=_[_0x618a('0x33')](_0xfac4c9[_0x618a('0x34')],_0xfac4c9['query']);_0x1cdd4f[_0x618a('0x35')]=_[_0x618a('0x33')](_0xfac4c9[_0x618a('0x34')],qs[_0x618a('0x36')](_0x42636d['query'][_0x618a('0x36')]));_0x1cdd4f[_0x618a('0x35')]=_0x1cdd4f[_0x618a('0x35')][_0x618a('0x37')]?_0x1cdd4f[_0x618a('0x35')]:_0xfac4c9['model'];if(!_0x42636d[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0x1cdd4f[_0x618a('0x1f')]=qs['limit'](_0x42636d['query'][_0x618a('0x1f')]);_0x1cdd4f['offset']=qs[_0x618a('0x1d')](_0x42636d[_0x618a('0x30')][_0x618a('0x1d')]);}_0x1cdd4f[_0x618a('0x3a')]=qs['sort'](_0x42636d[_0x618a('0x30')][_0x618a('0x3b')]);_0x1cdd4f[_0x618a('0x3c')]=qs['filters'](_[_0x618a('0x3d')](_0x42636d['query'],_0xfac4c9[_0x618a('0x32')]),_0x215778);if(_0x42636d[_0x618a('0x30')]['filter']){_0x1cdd4f['where']=_[_0x618a('0x3e')](_0x1cdd4f['where'],{'$or':_[_0x618a('0x2a')](_0x215778,function(_0x4604dc){if(_0x4604dc[_0x618a('0x2e')]!==_0x618a('0x3f')){var _0x1d1c4b={};_0x1d1c4b[_0x4604dc[_0x618a('0x28')]]={'$like':'%'+_0x42636d[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0x1d1c4b;}})});}_0x1cdd4f=_['merge']({},_0x1cdd4f,_0x42636d[_0x618a('0x41')]);var _0x9fa82b={'where':_0x1cdd4f[_0x618a('0x3c')]};return db[_0x618a('0x2b')]['count'](_0x9fa82b)[_0x618a('0x26')](function(_0x1e4b6c){_0x27ff7c[_0x618a('0x20')]=_0x1e4b6c;if(_0x42636d[_0x618a('0x30')][_0x618a('0x42')]){_0x1cdd4f[_0x618a('0x43')]=[{'all':!![]}];}return db[_0x618a('0x2b')][_0x618a('0x44')](_0x1cdd4f);})[_0x618a('0x26')](function(_0x29d684){_0x27ff7c['rows']=_0x29d684;return _0x27ff7c;})['then'](respondWithFilteredResult(_0x538c9b,_0x1cdd4f))['catch'](handleError(_0x538c9b,null));};exports[_0x618a('0x45')]=function(_0x37c57d,_0x428513){var _0x236be8={'raw':![],'where':{'id':_0x37c57d[_0x618a('0x46')]['id']}},_0x13602b={};_0x13602b[_0x618a('0x34')]=_[_0x618a('0x31')](db[_0x618a('0x2b')][_0x618a('0x2c')]);_0x13602b[_0x618a('0x30')]=_[_0x618a('0x31')](_0x37c57d[_0x618a('0x30')]);_0x13602b['filters']=_[_0x618a('0x33')](_0x13602b[_0x618a('0x34')],_0x13602b['query']);_0x236be8['attributes']=_['intersection'](_0x13602b[_0x618a('0x34')],qs[_0x618a('0x36')](_0x37c57d[_0x618a('0x30')][_0x618a('0x36')]));_0x236be8[_0x618a('0x35')]=_0x236be8[_0x618a('0x35')][_0x618a('0x37')]?_0x236be8[_0x618a('0x35')]:_0x13602b[_0x618a('0x34')];if(_0x37c57d[_0x618a('0x30')][_0x618a('0x42')]){_0x236be8['include']=[{'all':!![]}];}_0x236be8=_[_0x618a('0x3e')]({},_0x236be8,_0x37c57d[_0x618a('0x41')]);return db[_0x618a('0x2b')][_0x618a('0x47')](_0x236be8)['then'](handleEntityNotFound(_0x428513,null))[_0x618a('0x26')](respondWithResult(_0x428513,null))[_0x618a('0x48')](handleError(_0x428513,null));};exports[_0x618a('0x49')]=function(_0x2dfefa,_0x572cd9){return db[_0x618a('0x2b')]['create'](_0x2dfefa[_0x618a('0x4a')],{})['then'](respondWithResult(_0x572cd9,0xc9))[_0x618a('0x48')](handleError(_0x572cd9,null));};exports[_0x618a('0x25')]=function(_0x52325e,_0x523b2b){if(_0x52325e[_0x618a('0x4a')]['id']){delete _0x52325e[_0x618a('0x4a')]['id'];}return db[_0x618a('0x2b')][_0x618a('0x47')]({'where':{'id':_0x52325e['params']['id']}})['then'](handleEntityNotFound(_0x523b2b,null))[_0x618a('0x26')](saveUpdates(_0x52325e[_0x618a('0x4a')],null))[_0x618a('0x26')](respondWithResult(_0x523b2b,null))[_0x618a('0x48')](handleError(_0x523b2b,null));};exports[_0x618a('0x27')]=function(_0xcc37e7,_0x48a5fa){return db['SalesforceConfiguration']['find']({'where':{'id':_0xcc37e7[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x48a5fa,null))[_0x618a('0x26')](removeEntity(_0x48a5fa,null))[_0x618a('0x48')](handleError(_0x48a5fa,null));};exports['getFields']=function(_0x66c0c4,_0x251bcd,_0x1ac6b2){var _0x1359e9={};var _0x573834={};var _0x1caed1;var _0x4d7dfe;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x66c0c4['params']['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x251bcd,null))[_0x618a('0x26')](function(_0x4d2d85){if(_0x4d2d85){_0x1caed1=_0x4d2d85;_0x573834[_0x618a('0x34')]=_['keys'](db[_0x618a('0x4c')][_0x618a('0x2c')]);_0x573834['query']=_['keys'](_0x66c0c4[_0x618a('0x30')]);_0x573834[_0x618a('0x32')]=_[_0x618a('0x33')](_0x573834['model'],_0x573834[_0x618a('0x30')]);_0x1359e9[_0x618a('0x35')]=_[_0x618a('0x33')](_0x573834[_0x618a('0x34')],qs['fields'](_0x66c0c4[_0x618a('0x30')][_0x618a('0x36')]));_0x1359e9[_0x618a('0x35')]=_0x1359e9[_0x618a('0x35')]['length']?_0x1359e9[_0x618a('0x35')]:_0x573834['model'];_0x1359e9[_0x618a('0x3a')]=qs[_0x618a('0x3b')](_0x66c0c4[_0x618a('0x30')][_0x618a('0x3b')]);_0x1359e9[_0x618a('0x3c')]=qs[_0x618a('0x32')](_[_0x618a('0x3d')](_0x66c0c4[_0x618a('0x30')],_0x573834[_0x618a('0x32')]));if(_0x66c0c4['query'][_0x618a('0x40')]){_0x1359e9['where']=_['merge'](_0x1359e9[_0x618a('0x3c')],{'$or':_['map'](_0x1359e9['attributes'],function(_0x33c382){var _0x3f9561={};_0x3f9561[_0x33c382]={'$like':'%'+_0x66c0c4['query'][_0x618a('0x40')]+'%'};return _0x3f9561;})});}_0x1359e9=_[_0x618a('0x3e')]({},_0x1359e9,_0x66c0c4['options']);return _0x1caed1['getFields'](_0x1359e9);}})['then'](function(_0x6d3c3b){if(_0x6d3c3b){_0x4d7dfe=_0x6d3c3b[_0x618a('0x37')];if(!_0x66c0c4[_0x618a('0x30')][_0x618a('0x38')]('nolimit')){_0x1359e9['limit']=qs[_0x618a('0x1f')](_0x66c0c4['query']['limit']);_0x1359e9[_0x618a('0x1d')]=qs['offset'](_0x66c0c4[_0x618a('0x30')][_0x618a('0x1d')]);}return _0x1caed1[_0x618a('0x4d')](_0x1359e9);}})[_0x618a('0x26')](function(_0x39acc7){if(_0x39acc7){return _0x39acc7?{'count':_0x4d7dfe,'rows':_0x39acc7}:null;}})[_0x618a('0x26')](respondWithResult(_0x251bcd,null))['catch'](handleError(_0x251bcd,null));};exports[_0x618a('0x4e')]=function(_0x41813b,_0x509b13,_0x421dbf){var _0xbe0943={};var _0x23ac39={};var _0x43ae78;var _0x5aaf1a;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x41813b[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x509b13,null))['then'](function(_0x1fc626){if(_0x1fc626){_0x43ae78=_0x1fc626;_0x23ac39[_0x618a('0x34')]=_[_0x618a('0x31')](db[_0x618a('0x4c')]['rawAttributes']);_0x23ac39[_0x618a('0x30')]=_[_0x618a('0x31')](_0x41813b[_0x618a('0x30')]);_0x23ac39[_0x618a('0x32')]=_[_0x618a('0x33')](_0x23ac39['model'],_0x23ac39[_0x618a('0x30')]);_0xbe0943[_0x618a('0x35')]=_[_0x618a('0x33')](_0x23ac39[_0x618a('0x34')],qs['fields'](_0x41813b[_0x618a('0x30')][_0x618a('0x36')]));_0xbe0943[_0x618a('0x35')]=_0xbe0943[_0x618a('0x35')][_0x618a('0x37')]?_0xbe0943['attributes']:_0x23ac39['model'];_0xbe0943[_0x618a('0x3a')]=qs['sort'](_0x41813b[_0x618a('0x30')][_0x618a('0x3b')]);_0xbe0943[_0x618a('0x3c')]=qs[_0x618a('0x32')](_[_0x618a('0x3d')](_0x41813b[_0x618a('0x30')],_0x23ac39[_0x618a('0x32')]));if(_0x41813b['query'][_0x618a('0x40')]){_0xbe0943[_0x618a('0x3c')]=_[_0x618a('0x3e')](_0xbe0943[_0x618a('0x3c')],{'$or':_[_0x618a('0x2a')](_0xbe0943[_0x618a('0x35')],function(_0x15e9b8){var _0xd1ed7a={};_0xd1ed7a[_0x15e9b8]={'$like':'%'+_0x41813b[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0xd1ed7a;})});}_0xbe0943=_[_0x618a('0x3e')]({},_0xbe0943,_0x41813b[_0x618a('0x41')]);return _0x43ae78[_0x618a('0x4e')](_0xbe0943);}})[_0x618a('0x26')](function(_0x289298){if(_0x289298){_0x5aaf1a=_0x289298[_0x618a('0x37')];if(!_0x41813b[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0xbe0943[_0x618a('0x1f')]=qs[_0x618a('0x1f')](_0x41813b[_0x618a('0x30')]['limit']);_0xbe0943['offset']=qs['offset'](_0x41813b[_0x618a('0x30')][_0x618a('0x1d')]);}return _0x43ae78[_0x618a('0x4e')](_0xbe0943);}})['then'](function(_0x283ccf){if(_0x283ccf){return _0x283ccf?{'count':_0x5aaf1a,'rows':_0x283ccf}:null;}})[_0x618a('0x26')](respondWithResult(_0x509b13,null))[_0x618a('0x48')](handleError(_0x509b13,null));};exports['getDescriptions']=function(_0x4e06d8,_0x1e5318,_0x5b937f){var _0x2d3b87={};var _0x45e479={};var _0x127bfd;var _0x5d9cdd;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x4e06d8[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x1e5318,null))[_0x618a('0x26')](function(_0x1090dd){if(_0x1090dd){_0x127bfd=_0x1090dd;_0x45e479[_0x618a('0x34')]=_[_0x618a('0x31')](db['SalesforceField'][_0x618a('0x2c')]);_0x45e479[_0x618a('0x30')]=_[_0x618a('0x31')](_0x4e06d8[_0x618a('0x30')]);_0x45e479[_0x618a('0x32')]=_[_0x618a('0x33')](_0x45e479[_0x618a('0x34')],_0x45e479['query']);_0x2d3b87[_0x618a('0x35')]=_[_0x618a('0x33')](_0x45e479[_0x618a('0x34')],qs[_0x618a('0x36')](_0x4e06d8[_0x618a('0x30')][_0x618a('0x36')]));_0x2d3b87[_0x618a('0x35')]=_0x2d3b87['attributes'][_0x618a('0x37')]?_0x2d3b87[_0x618a('0x35')]:_0x45e479[_0x618a('0x34')];_0x2d3b87[_0x618a('0x3a')]=qs[_0x618a('0x3b')](_0x4e06d8[_0x618a('0x30')][_0x618a('0x3b')]);_0x2d3b87['where']=qs[_0x618a('0x32')](_['pick'](_0x4e06d8['query'],_0x45e479[_0x618a('0x32')]));if(_0x4e06d8[_0x618a('0x30')]['filter']){_0x2d3b87[_0x618a('0x3c')]=_[_0x618a('0x3e')](_0x2d3b87['where'],{'$or':_['map'](_0x2d3b87[_0x618a('0x35')],function(_0x2038c8){var _0x1f62d9={};_0x1f62d9[_0x2038c8]={'$like':'%'+_0x4e06d8[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0x1f62d9;})});}_0x2d3b87=_[_0x618a('0x3e')]({},_0x2d3b87,_0x4e06d8[_0x618a('0x41')]);return _0x127bfd['getDescriptions'](_0x2d3b87);}})['then'](function(_0x31d07a){if(_0x31d07a){_0x5d9cdd=_0x31d07a[_0x618a('0x37')];if(!_0x4e06d8[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0x2d3b87[_0x618a('0x1f')]=qs[_0x618a('0x1f')](_0x4e06d8[_0x618a('0x30')]['limit']);_0x2d3b87[_0x618a('0x1d')]=qs[_0x618a('0x1d')](_0x4e06d8[_0x618a('0x30')]['offset']);}return _0x127bfd[_0x618a('0x4f')](_0x2d3b87);}})[_0x618a('0x26')](function(_0x341ea6){if(_0x341ea6){return _0x341ea6?{'count':_0x5d9cdd,'rows':_0x341ea6}:null;}})['then'](respondWithResult(_0x1e5318,null))['catch'](handleError(_0x1e5318,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 55ec2e2..1aae7c6 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 _0x2065=['moment','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x41942f,_0x9e108e){var _0x4c9988=function(_0x4f1e9c){while(--_0x4f1e9c){_0x41942f['push'](_0x41942f['shift']());}};_0x4c9988(++_0x9e108e);}(_0x2065,0x1a0));var _0x5206=function(_0xe9579d,_0x5cd3ee){_0xe9579d=_0xe9579d-0x0;var _0x5f326e=_0x2065[_0xe9579d];return _0x5f326e;};'use strict';var _=require(_0x5206('0x0'));var util=require(_0x5206('0x1'));var logger=require(_0x5206('0x2'))(_0x5206('0x3'));var moment=require(_0x5206('0x4'));var BPromise=require(_0x5206('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5206('0x6'));var config=require(_0x5206('0x7'));var attributes=require(_0x5206('0x8'));module[_0x5206('0x9')]=function(_0x3e84c7,_0x2595ad){return _0x3e84c7['define'](_0x5206('0xa'),attributes,{'tableName':_0x5206('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b62=['SalesforceConfiguration','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x8b62,0x1d1));var _0x28b6=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x8b62[_0x280ae7];return _0x418b9e;};'use strict';var _=require(_0x28b6('0x0'));var util=require(_0x28b6('0x1'));var logger=require(_0x28b6('0x2'))(_0x28b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x28b6('0x4'));var fs=require('fs');var path=require(_0x28b6('0x5'));var rimraf=require(_0x28b6('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x5c8e81,_0x1bca32){return _0x5c8e81['define'](_0x28b6('0x7'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index bfc7ef4..e0e6e57 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 _0xe031=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info'];(function(_0x3502fd,_0xa33fcd){var _0x2a4c3d=function(_0x30d932){while(--_0x30d932){_0x3502fd['push'](_0x3502fd['shift']());}};_0x2a4c3d(++_0xa33fcd);}(_0xe031,0xc2));var _0x1e03=function(_0x26232e,_0x4963a7){_0x26232e=_0x26232e-0x0;var _0x31f921=_0xe031[_0x26232e];return _0x31f921;};'use strict';var _=require('lodash');var util=require(_0x1e03('0x0'));var moment=require('moment');var BPromise=require(_0x1e03('0x1'));var rs=require(_0x1e03('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e03('0x3'));var logger=require(_0x1e03('0x4'))('rpc');var config=require(_0x1e03('0x5'));var jayson=require(_0x1e03('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x327c9a,_0x5a1c6d,_0x47272d){return new BPromise(function(_0x5dbdcd,_0x5f492b){return client[_0x1e03('0x7')](_0x327c9a,_0x47272d)[_0x1e03('0x8')](function(_0x3f3b27){logger[_0x1e03('0x9')](_0x1e03('0xa'),_0x5a1c6d,_0x1e03('0xb'));logger['debug'](_0x1e03('0xc'),_0x5a1c6d,_0x1e03('0xb'),JSON[_0x1e03('0xd')](_0x3f3b27));if(_0x3f3b27[_0x1e03('0xe')]){if(_0x3f3b27['error']['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1c6d,_0x3f3b27[_0x1e03('0xe')]['message']);return _0x5f492b(_0x3f3b27[_0x1e03('0xe')]['message']);}logger['error'](_0x1e03('0xa'),_0x5a1c6d,_0x3f3b27[_0x1e03('0xe')][_0x1e03('0xf')]);return _0x5dbdcd(_0x3f3b27[_0x1e03('0xe')][_0x1e03('0xf')]);}else{logger[_0x1e03('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1c6d,_0x1e03('0xb'));_0x5dbdcd(_0x3f3b27['result'][_0x1e03('0xf')]);}})[_0x1e03('0x10')](function(_0x583a61){logger[_0x1e03('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a1c6d,_0x583a61);_0x5f492b(_0x583a61);});});} \ No newline at end of file +var _0xdfe0=['../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1e10ac,_0x407d6b){var _0x26c953=function(_0x48f5c3){while(--_0x48f5c3){_0x1e10ac['push'](_0x1e10ac['shift']());}};_0x26c953(++_0x407d6b);}(_0xdfe0,0xcb));var _0x0dfe=function(_0x3a0124,_0x5be611){_0x3a0124=_0x3a0124-0x0;var _0x33aec3=_0xdfe0[_0x3a0124];return _0x33aec3;};'use strict';var _=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));var moment=require('moment');var BPromise=require(_0x0dfe('0x2'));var rs=require(_0x0dfe('0x3'));var fs=require('fs');var Redis=require(_0x0dfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dfe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0dfe('0x6'));var jayson=require(_0x0dfe('0x7'));var client=jayson[_0x0dfe('0x8')][_0x0dfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38f476,_0x50fa6e,_0xc2d252){return new BPromise(function(_0x57d049,_0x222955){return client[_0x0dfe('0xa')](_0x38f476,_0xc2d252)['then'](function(_0x4feeb6){logger[_0x0dfe('0xb')](_0x0dfe('0xc'),_0x50fa6e,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x50fa6e,'request\x20sent',JSON[_0x0dfe('0xd')](_0x4feeb6));if(_0x4feeb6['error']){if(_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0xf')]===0x1f4){logger[_0x0dfe('0xe')](_0x0dfe('0xc'),_0x50fa6e,_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0x10')]);return _0x222955(_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0x10')]);}logger[_0x0dfe('0xe')](_0x0dfe('0xc'),_0x50fa6e,_0x4feeb6[_0x0dfe('0xe')]['message']);return _0x57d049(_0x4feeb6[_0x0dfe('0xe')]['message']);}else{logger[_0x0dfe('0xb')](_0x0dfe('0xc'),_0x50fa6e,'request\x20sent');_0x57d049(_0x4feeb6[_0x0dfe('0x11')][_0x0dfe('0x10')]);}})[_0x0dfe('0x12')](function(_0x430c2f){logger[_0x0dfe('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x50fa6e,_0x430c2f);_0x222955(_0x430c2f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 70cf3e4..d5f3684 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 _0xa0dd=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0xdb1894,_0xf2d873){var _0x59b069=function(_0x25a260){while(--_0x25a260){_0xdb1894['push'](_0xdb1894['shift']());}};_0x59b069(++_0xf2d873);}(_0xa0dd,0x1ea));var _0xda0d=function(_0x1ea100,_0x1f80b8){_0x1ea100=_0x1ea100-0x0;var _0x547ae5=_0xa0dd[_0x1ea100];return _0x547ae5;};'use strict';var multer=require(_0xda0d('0x0'));var util=require('util');var path=require(_0xda0d('0x1'));var timeout=require(_0xda0d('0x2'));var express=require(_0xda0d('0x3'));var router=express[_0xda0d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xda0d('0x5'));var config=require(_0xda0d('0x6'));var controller=require(_0xda0d('0x7'));router[_0xda0d('0x8')]('/',auth[_0xda0d('0x9')](),controller[_0xda0d('0xa')]);router[_0xda0d('0x8')](_0xda0d('0xb'),auth[_0xda0d('0x9')](),controller[_0xda0d('0xc')]);router[_0xda0d('0xd')]('/',auth[_0xda0d('0x9')](),controller[_0xda0d('0xe')]);router[_0xda0d('0xf')]('/:id',auth[_0xda0d('0x9')](),controller[_0xda0d('0x10')]);router[_0xda0d('0x11')](_0xda0d('0xb'),auth[_0xda0d('0x9')](),controller[_0xda0d('0x12')]);module[_0xda0d('0x13')]=router; \ No newline at end of file +var _0x59de=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x3049a0,_0x4eb982){var _0x1bcefb=function(_0x5a2be4){while(--_0x5a2be4){_0x3049a0['push'](_0x3049a0['shift']());}};_0x1bcefb(++_0x4eb982);}(_0x59de,0xa9));var _0xe59d=function(_0x151002,_0x1c9af6){_0x151002=_0x151002-0x0;var _0x1a7a58=_0x59de[_0x151002];return _0x1a7a58;};'use strict';var multer=require(_0xe59d('0x0'));var util=require(_0xe59d('0x1'));var path=require(_0xe59d('0x2'));var timeout=require(_0xe59d('0x3'));var express=require('express');var router=express[_0xe59d('0x4')]();var fs_extra=require(_0xe59d('0x5'));var auth=require(_0xe59d('0x6'));var interaction=require(_0xe59d('0x7'));var config=require(_0xe59d('0x8'));var controller=require('./intSalesforceField.controller');router[_0xe59d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe59d('0xa')]);router[_0xe59d('0x9')](_0xe59d('0xb'),auth[_0xe59d('0xc')](),controller[_0xe59d('0xd')]);router[_0xe59d('0xe')]('/',auth['isAuthenticated'](),controller[_0xe59d('0xf')]);router[_0xe59d('0x10')](_0xe59d('0xb'),auth[_0xe59d('0xc')](),controller[_0xe59d('0x11')]);router[_0xe59d('0x12')]('/:id',auth[_0xe59d('0xc')](),controller[_0xe59d('0x13')]);module[_0xe59d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 6372f80..9d7e92d 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 _0xa7b4=['ENUM','string','variable','keyValue','STRING'];(function(_0x3e7675,_0x28ba8e){var _0x36a639=function(_0xb5af88){while(--_0xb5af88){_0x3e7675['push'](_0x3e7675['shift']());}};_0x36a639(++_0x28ba8e);}(_0xa7b4,0x1d1));var _0x4a7b=function(_0x193d5a,_0x3ef3be){_0x193d5a=_0x193d5a-0x0;var _0x2e5fb1=_0xa7b4[_0x193d5a];return _0x2e5fb1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4a7b('0x0')](_0x4a7b('0x1'),_0x4a7b('0x2'),'customVariable',_0x4a7b('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4a7b('0x4')]},'key':{'type':Sequelize[_0x4a7b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x4a7b('0x1'),_0x4a7b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x4a7b('0x4')]},'idField':{'type':Sequelize[_0x4a7b('0x4')]},'variableName':{'type':Sequelize[_0x4a7b('0x4')]}}; \ No newline at end of file +var _0xaa1a=['customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x3bd70b,_0x2c116c){var _0x326b67=function(_0x17e143){while(--_0x17e143){_0x3bd70b['push'](_0x3bd70b['shift']());}};_0x326b67(++_0x2c116c);}(_0xaa1a,0xe6));var _0xaaa1=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xaa1a[_0x2842b4];return _0x2b9521;};'use strict';var Sequelize=require(_0xaaa1('0x0'));module[_0xaaa1('0x1')]={'type':{'type':Sequelize[_0xaaa1('0x2')]('string',_0xaaa1('0x3'),_0xaaa1('0x4'),_0xaaa1('0x5'),_0xaaa1('0x6')),'defaultValue':_0xaaa1('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaaa1('0x2')](_0xaaa1('0x7'),_0xaaa1('0x3'),_0xaaa1('0x4'))},'keyContent':{'type':Sequelize[_0xaaa1('0x8')]},'idField':{'type':Sequelize[_0xaaa1('0x8')]},'variableName':{'type':Sequelize[_0xaaa1('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index df61ebc..0e167c4 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 _0xdb22=['save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','params','find','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb22,0x152));var _0x2db2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdb22[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x2db2('0x0'));var rimraf=require(_0x2db2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2db2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2db2('0x3'));var Mustache=require(_0x2db2('0x4'));var util=require(_0x2db2('0x5'));var path=require(_0x2db2('0x6'));var sox=require('sox');var csv=require(_0x2db2('0x7'));var ejs=require(_0x2db2('0x8'));var fs=require('fs');var fs_extra=require(_0x2db2('0x9'));var _=require('lodash');var squel=require(_0x2db2('0xa'));var crypto=require(_0x2db2('0xb'));var jsforce=require(_0x2db2('0xc'));var deskjs=require(_0x2db2('0xd'));var toCsv=require(_0x2db2('0x7'));var querystring=require(_0x2db2('0xe'));var Papa=require(_0x2db2('0xf'));var Redis=require(_0x2db2('0x10'));var authService=require(_0x2db2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2db2('0x12'));var utils=require(_0x2db2('0x13'));var config=require(_0x2db2('0x14'));var licenseUtil=require(_0x2db2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e7f73,_0x2c9763){_0x2c9763=_0x2c9763||0xcc;return function(_0x22c527){if(_0x22c527){return _0x2e7f73['sendStatus'](_0x2c9763);}return _0x2e7f73[_0x2db2('0x16')](_0x2c9763)[_0x2db2('0x17')]();};}function respondWithResult(_0x4ad076,_0x17a585){_0x17a585=_0x17a585||0xc8;return function(_0x45b7d3){if(_0x45b7d3){return _0x4ad076['status'](_0x17a585)[_0x2db2('0x18')](_0x45b7d3);}};}function respondWithFilteredResult(_0xdc4619,_0x31952f){return function(_0x23c3e6){if(_0x23c3e6){var _0x33c031=typeof _0x31952f[_0x2db2('0x19')]===_0x2db2('0x1a')&&typeof _0x31952f['limit']==='undefined';var _0x2c93d3=_0x23c3e6['count'];var _0x4e4099=_0x33c031?0x0:_0x31952f[_0x2db2('0x19')];var _0x45ec29=_0x33c031?_0x23c3e6[_0x2db2('0x1b')]:_0x31952f[_0x2db2('0x19')]+_0x31952f[_0x2db2('0x1c')];var _0x5e3275;if(_0x45ec29>=_0x2c93d3){_0x45ec29=_0x2c93d3;_0x5e3275=0xc8;}else{_0x5e3275=0xce;}_0xdc4619[_0x2db2('0x16')](_0x5e3275);return _0xdc4619[_0x2db2('0x1d')]('Content-Range',_0x4e4099+'-'+_0x45ec29+'/'+_0x2c93d3)[_0x2db2('0x18')](_0x23c3e6);}return null;};}function patchUpdates(_0x3191a3){return function(_0xc948b8){try{jsonpatch[_0x2db2('0x1e')](_0xc948b8,_0x3191a3,!![]);}catch(_0x37d68b){return BPromise[_0x2db2('0x1f')](_0x37d68b);}return _0xc948b8[_0x2db2('0x20')]();};}function saveUpdates(_0x3bc646,_0x513694){return function(_0x11aa34){if(_0x11aa34){return _0x11aa34[_0x2db2('0x21')](_0x3bc646)['then'](function(_0x1733da){return _0x1733da;});}return null;};}function removeEntity(_0x358005,_0x4e2021){return function(_0x559148){if(_0x559148){return _0x559148[_0x2db2('0x22')]()[_0x2db2('0x23')](function(){_0x358005[_0x2db2('0x16')](0xcc)[_0x2db2('0x17')]();});}};}function handleEntityNotFound(_0x39b3d2,_0x3c2886){return function(_0x382803){if(!_0x382803){_0x39b3d2[_0x2db2('0x24')](0x194);}return _0x382803;};}function handleError(_0x34e442,_0x4b3963){_0x4b3963=_0x4b3963||0x1f4;return function(_0x29aee5){logger[_0x2db2('0x25')](_0x29aee5[_0x2db2('0x26')]);if(_0x29aee5[_0x2db2('0x27')]){delete _0x29aee5[_0x2db2('0x27')];}_0x34e442[_0x2db2('0x16')](_0x4b3963)[_0x2db2('0x28')](_0x29aee5);};}exports[_0x2db2('0x29')]=function(_0x4ebd82,_0x6c6be8){var _0x1e2cf3={},_0x2202e9={},_0x7f906e={'count':0x0,'rows':[]};var _0x158e5e=_[_0x2db2('0x2a')](db[_0x2db2('0x2b')][_0x2db2('0x2c')],function(_0x16d948){return{'name':_0x16d948[_0x2db2('0x2d')],'type':_0x16d948[_0x2db2('0x2e')][_0x2db2('0x2f')]};});_0x2202e9[_0x2db2('0x30')]=_[_0x2db2('0x2a')](_0x158e5e,'name');_0x2202e9[_0x2db2('0x31')]=_[_0x2db2('0x32')](_0x4ebd82[_0x2db2('0x31')]);_0x2202e9[_0x2db2('0x33')]=_['intersection'](_0x2202e9['model'],_0x2202e9[_0x2db2('0x31')]);_0x1e2cf3[_0x2db2('0x34')]=_[_0x2db2('0x35')](_0x2202e9['model'],qs[_0x2db2('0x36')](_0x4ebd82['query'][_0x2db2('0x36')]));_0x1e2cf3[_0x2db2('0x34')]=_0x1e2cf3[_0x2db2('0x34')][_0x2db2('0x37')]?_0x1e2cf3[_0x2db2('0x34')]:_0x2202e9[_0x2db2('0x30')];if(!_0x4ebd82['query']['hasOwnProperty'](_0x2db2('0x38'))){_0x1e2cf3[_0x2db2('0x1c')]=qs['limit'](_0x4ebd82[_0x2db2('0x31')][_0x2db2('0x1c')]);_0x1e2cf3[_0x2db2('0x19')]=qs[_0x2db2('0x19')](_0x4ebd82['query']['offset']);}_0x1e2cf3[_0x2db2('0x39')]=qs[_0x2db2('0x3a')](_0x4ebd82['query']['sort']);_0x1e2cf3[_0x2db2('0x3b')]=qs[_0x2db2('0x33')](_[_0x2db2('0x3c')](_0x4ebd82[_0x2db2('0x31')],_0x2202e9[_0x2db2('0x33')]),_0x158e5e);if(_0x4ebd82['query']['filter']){_0x1e2cf3[_0x2db2('0x3b')]=_[_0x2db2('0x3d')](_0x1e2cf3[_0x2db2('0x3b')],{'$or':_['map'](_0x158e5e,function(_0x276aac){if(_0x276aac['type']!==_0x2db2('0x3e')){var _0x48111f={};_0x48111f[_0x276aac['name']]={'$like':'%'+_0x4ebd82[_0x2db2('0x31')]['filter']+'%'};return _0x48111f;}})});}_0x1e2cf3=_['merge']({},_0x1e2cf3,_0x4ebd82[_0x2db2('0x3f')]);var _0xaa0826={'where':_0x1e2cf3[_0x2db2('0x3b')]};return db[_0x2db2('0x2b')][_0x2db2('0x1b')](_0xaa0826)['then'](function(_0x54d60a){_0x7f906e[_0x2db2('0x1b')]=_0x54d60a;if(_0x4ebd82[_0x2db2('0x31')][_0x2db2('0x40')]){_0x1e2cf3['include']=[{'all':!![]}];}return db[_0x2db2('0x2b')][_0x2db2('0x41')](_0x1e2cf3);})['then'](function(_0x4a0af8){_0x7f906e[_0x2db2('0x42')]=_0x4a0af8;return _0x7f906e;})[_0x2db2('0x23')](respondWithFilteredResult(_0x6c6be8,_0x1e2cf3))[_0x2db2('0x43')](handleError(_0x6c6be8,null));};exports[_0x2db2('0x44')]=function(_0x32ce55,_0x5f5332){var _0x5bb14a={'raw':!![],'where':{'id':_0x32ce55['params']['id']}},_0x28e390={};_0x28e390[_0x2db2('0x30')]=_['keys'](db['SalesforceField'][_0x2db2('0x2c')]);_0x28e390[_0x2db2('0x31')]=_[_0x2db2('0x32')](_0x32ce55[_0x2db2('0x31')]);_0x28e390[_0x2db2('0x33')]=_[_0x2db2('0x35')](_0x28e390[_0x2db2('0x30')],_0x28e390[_0x2db2('0x31')]);_0x5bb14a[_0x2db2('0x34')]=_['intersection'](_0x28e390[_0x2db2('0x30')],qs[_0x2db2('0x36')](_0x32ce55[_0x2db2('0x31')][_0x2db2('0x36')]));_0x5bb14a['attributes']=_0x5bb14a[_0x2db2('0x34')][_0x2db2('0x37')]?_0x5bb14a[_0x2db2('0x34')]:_0x28e390['model'];if(_0x32ce55[_0x2db2('0x31')][_0x2db2('0x40')]){_0x5bb14a[_0x2db2('0x45')]=[{'all':!![]}];}_0x5bb14a=_[_0x2db2('0x3d')]({},_0x5bb14a,_0x32ce55['options']);return db[_0x2db2('0x2b')]['find'](_0x5bb14a)['then'](handleEntityNotFound(_0x5f5332,null))[_0x2db2('0x23')](respondWithResult(_0x5f5332,null))['catch'](handleError(_0x5f5332,null));};exports[_0x2db2('0x46')]=function(_0x317141,_0x49f4bb){return db[_0x2db2('0x2b')][_0x2db2('0x46')](_0x317141['body'],{})['then'](respondWithResult(_0x49f4bb,0xc9))[_0x2db2('0x43')](handleError(_0x49f4bb,null));};exports[_0x2db2('0x21')]=function(_0xbd0049,_0x30b684){if(_0xbd0049[_0x2db2('0x47')]['id']){delete _0xbd0049[_0x2db2('0x47')]['id'];}return db[_0x2db2('0x2b')]['find']({'where':{'id':_0xbd0049[_0x2db2('0x48')]['id']}})[_0x2db2('0x23')](handleEntityNotFound(_0x30b684,null))[_0x2db2('0x23')](saveUpdates(_0xbd0049[_0x2db2('0x47')],null))[_0x2db2('0x23')](respondWithResult(_0x30b684,null))[_0x2db2('0x43')](handleError(_0x30b684,null));};exports[_0x2db2('0x22')]=function(_0x17ab23,_0xbf7214){return db['SalesforceField'][_0x2db2('0x49')]({'where':{'id':_0x17ab23[_0x2db2('0x48')]['id']}})[_0x2db2('0x23')](handleEntityNotFound(_0xbf7214,null))[_0x2db2('0x23')](removeEntity(_0xbf7214,null))[_0x2db2('0x43')](handleError(_0xbf7214,null));}; \ No newline at end of file +var _0xa8be=['hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','include','findAll','params','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','end','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x2e5540,_0x1fa16b){var _0x54fc5a=function(_0x3b3275){while(--_0x3b3275){_0x2e5540['push'](_0x2e5540['shift']());}};_0x54fc5a(++_0x1fa16b);}(_0xa8be,0x16a));var _0xea8b=function(_0x2c7d5b,_0x18b598){_0x2c7d5b=_0x2c7d5b-0x0;var _0x24227d=_0xa8be[_0x2c7d5b];return _0x24227d;};'use strict';var emlformat=require(_0xea8b('0x0'));var rimraf=require(_0xea8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea8b('0x2'));var rp=require(_0xea8b('0x3'));var moment=require(_0xea8b('0x4'));var BPromise=require(_0xea8b('0x5'));var Mustache=require('mustache');var util=require(_0xea8b('0x6'));var path=require(_0xea8b('0x7'));var sox=require(_0xea8b('0x8'));var csv=require(_0xea8b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea8b('0xa'));var crypto=require(_0xea8b('0xb'));var jsforce=require(_0xea8b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea8b('0xd'));var Papa=require(_0xea8b('0xe'));var Redis=require('ioredis');var authService=require(_0xea8b('0xf'));var qs=require(_0xea8b('0x10'));var as=require(_0xea8b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea8b('0x12'))('api');var utils=require(_0xea8b('0x13'));var config=require(_0xea8b('0x14'));var licenseUtil=require(_0xea8b('0x15'));var db=require(_0xea8b('0x16'))['db'];function respondWithStatusCode(_0x9e4f6,_0x6c1f85){_0x6c1f85=_0x6c1f85||0xcc;return function(_0x598e21){if(_0x598e21){return _0x9e4f6[_0xea8b('0x17')](_0x6c1f85);}return _0x9e4f6[_0xea8b('0x18')](_0x6c1f85)['end']();};}function respondWithResult(_0x4ee043,_0x5e9be1){_0x5e9be1=_0x5e9be1||0xc8;return function(_0x2292e1){if(_0x2292e1){return _0x4ee043['status'](_0x5e9be1)[_0xea8b('0x19')](_0x2292e1);}};}function respondWithFilteredResult(_0x10d59f,_0x512264){return function(_0x515aee){if(_0x515aee){var _0x4872dd=typeof _0x512264[_0xea8b('0x1a')]==='undefined'&&typeof _0x512264['limit']===_0xea8b('0x1b');var _0xbe8519=_0x515aee[_0xea8b('0x1c')];var _0x5b2a3c=_0x4872dd?0x0:_0x512264[_0xea8b('0x1a')];var _0x2e12d0=_0x4872dd?_0x515aee[_0xea8b('0x1c')]:_0x512264[_0xea8b('0x1a')]+_0x512264[_0xea8b('0x1d')];var _0x3542b7;if(_0x2e12d0>=_0xbe8519){_0x2e12d0=_0xbe8519;_0x3542b7=0xc8;}else{_0x3542b7=0xce;}_0x10d59f[_0xea8b('0x18')](_0x3542b7);return _0x10d59f[_0xea8b('0x1e')](_0xea8b('0x1f'),_0x5b2a3c+'-'+_0x2e12d0+'/'+_0xbe8519)[_0xea8b('0x19')](_0x515aee);}return null;};}function patchUpdates(_0x57535d){return function(_0x166a78){try{jsonpatch['apply'](_0x166a78,_0x57535d,!![]);}catch(_0x5314c7){return BPromise[_0xea8b('0x20')](_0x5314c7);}return _0x166a78['save']();};}function saveUpdates(_0x36b6ba,_0x39e00f){return function(_0x138522){if(_0x138522){return _0x138522['update'](_0x36b6ba)[_0xea8b('0x21')](function(_0x5c79e1){return _0x5c79e1;});}return null;};}function removeEntity(_0x3426a7,_0x2b3b8c){return function(_0x178fc1){if(_0x178fc1){return _0x178fc1[_0xea8b('0x22')]()[_0xea8b('0x21')](function(){_0x3426a7['status'](0xcc)[_0xea8b('0x23')]();});}};}function handleEntityNotFound(_0x4a7f96,_0x404527){return function(_0x4a2004){if(!_0x4a2004){_0x4a7f96[_0xea8b('0x17')](0x194);}return _0x4a2004;};}function handleError(_0x1ccdd3,_0x35c5a2){_0x35c5a2=_0x35c5a2||0x1f4;return function(_0x3ad13e){logger['error'](_0x3ad13e[_0xea8b('0x24')]);if(_0x3ad13e[_0xea8b('0x25')]){delete _0x3ad13e[_0xea8b('0x25')];}_0x1ccdd3[_0xea8b('0x18')](_0x35c5a2)[_0xea8b('0x26')](_0x3ad13e);};}exports[_0xea8b('0x27')]=function(_0x8faf0e,_0x3bfc05){var _0x52e922={},_0x3a4d21={},_0x5afbc1={'count':0x0,'rows':[]};var _0x44b0bd=_[_0xea8b('0x28')](db[_0xea8b('0x29')][_0xea8b('0x2a')],function(_0x2966a4){return{'name':_0x2966a4['fieldName'],'type':_0x2966a4[_0xea8b('0x2b')][_0xea8b('0x2c')]};});_0x3a4d21[_0xea8b('0x2d')]=_[_0xea8b('0x28')](_0x44b0bd,'name');_0x3a4d21[_0xea8b('0x2e')]=_[_0xea8b('0x2f')](_0x8faf0e[_0xea8b('0x2e')]);_0x3a4d21['filters']=_[_0xea8b('0x30')](_0x3a4d21[_0xea8b('0x2d')],_0x3a4d21['query']);_0x52e922[_0xea8b('0x31')]=_['intersection'](_0x3a4d21[_0xea8b('0x2d')],qs[_0xea8b('0x32')](_0x8faf0e['query']['fields']));_0x52e922[_0xea8b('0x31')]=_0x52e922[_0xea8b('0x31')][_0xea8b('0x33')]?_0x52e922[_0xea8b('0x31')]:_0x3a4d21[_0xea8b('0x2d')];if(!_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x34')]('nolimit')){_0x52e922[_0xea8b('0x1d')]=qs['limit'](_0x8faf0e['query'][_0xea8b('0x1d')]);_0x52e922[_0xea8b('0x1a')]=qs[_0xea8b('0x1a')](_0x8faf0e[_0xea8b('0x2e')]['offset']);}_0x52e922['order']=qs[_0xea8b('0x35')](_0x8faf0e[_0xea8b('0x2e')]['sort']);_0x52e922['where']=qs[_0xea8b('0x36')](_[_0xea8b('0x37')](_0x8faf0e[_0xea8b('0x2e')],_0x3a4d21['filters']),_0x44b0bd);if(_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x38')]){_0x52e922[_0xea8b('0x39')]=_['merge'](_0x52e922[_0xea8b('0x39')],{'$or':_['map'](_0x44b0bd,function(_0x234e60){if(_0x234e60[_0xea8b('0x2b')]!==_0xea8b('0x3a')){var _0x217b23={};_0x217b23[_0x234e60[_0xea8b('0x25')]]={'$like':'%'+_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x38')]+'%'};return _0x217b23;}})});}_0x52e922=_['merge']({},_0x52e922,_0x8faf0e['options']);var _0x14324a={'where':_0x52e922[_0xea8b('0x39')]};return db[_0xea8b('0x29')][_0xea8b('0x1c')](_0x14324a)['then'](function(_0x434a0b){_0x5afbc1[_0xea8b('0x1c')]=_0x434a0b;if(_0x8faf0e[_0xea8b('0x2e')]['includeAll']){_0x52e922[_0xea8b('0x3b')]=[{'all':!![]}];}return db[_0xea8b('0x29')][_0xea8b('0x3c')](_0x52e922);})[_0xea8b('0x21')](function(_0x249e84){_0x5afbc1['rows']=_0x249e84;return _0x5afbc1;})[_0xea8b('0x21')](respondWithFilteredResult(_0x3bfc05,_0x52e922))['catch'](handleError(_0x3bfc05,null));};exports['show']=function(_0x3e8e8a,_0x542082){var _0x5a7afd={'raw':!![],'where':{'id':_0x3e8e8a[_0xea8b('0x3d')]['id']}},_0x31128a={};_0x31128a[_0xea8b('0x2d')]=_[_0xea8b('0x2f')](db[_0xea8b('0x29')]['rawAttributes']);_0x31128a[_0xea8b('0x2e')]=_[_0xea8b('0x2f')](_0x3e8e8a['query']);_0x31128a[_0xea8b('0x36')]=_['intersection'](_0x31128a[_0xea8b('0x2d')],_0x31128a[_0xea8b('0x2e')]);_0x5a7afd[_0xea8b('0x31')]=_['intersection'](_0x31128a[_0xea8b('0x2d')],qs[_0xea8b('0x32')](_0x3e8e8a[_0xea8b('0x2e')]['fields']));_0x5a7afd[_0xea8b('0x31')]=_0x5a7afd[_0xea8b('0x31')][_0xea8b('0x33')]?_0x5a7afd['attributes']:_0x31128a[_0xea8b('0x2d')];if(_0x3e8e8a[_0xea8b('0x2e')][_0xea8b('0x3e')]){_0x5a7afd['include']=[{'all':!![]}];}_0x5a7afd=_[_0xea8b('0x3f')]({},_0x5a7afd,_0x3e8e8a[_0xea8b('0x40')]);return db[_0xea8b('0x29')][_0xea8b('0x41')](_0x5a7afd)[_0xea8b('0x21')](handleEntityNotFound(_0x542082,null))[_0xea8b('0x21')](respondWithResult(_0x542082,null))['catch'](handleError(_0x542082,null));};exports[_0xea8b('0x42')]=function(_0x2b8c4f,_0x234030){return db[_0xea8b('0x29')]['create'](_0x2b8c4f[_0xea8b('0x43')],{})[_0xea8b('0x21')](respondWithResult(_0x234030,0xc9))['catch'](handleError(_0x234030,null));};exports['update']=function(_0x11ad63,_0x21242c){if(_0x11ad63[_0xea8b('0x43')]['id']){delete _0x11ad63[_0xea8b('0x43')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x11ad63[_0xea8b('0x3d')]['id']}})[_0xea8b('0x21')](handleEntityNotFound(_0x21242c,null))['then'](saveUpdates(_0x11ad63[_0xea8b('0x43')],null))[_0xea8b('0x21')](respondWithResult(_0x21242c,null))['catch'](handleError(_0x21242c,null));};exports['destroy']=function(_0x345566,_0x2d76c0){return db[_0xea8b('0x29')][_0xea8b('0x41')]({'where':{'id':_0x345566['params']['id']}})[_0xea8b('0x21')](handleEntityNotFound(_0x2d76c0,null))['then'](removeEntity(_0x2d76c0,null))[_0xea8b('0x44')](handleError(_0x2d76c0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e4f191a..9b752a7 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 _0x9aec=['idField','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index'];(function(_0x45877b,_0x2bcfc7){var _0x1b06f0=function(_0x31704e){while(--_0x31704e){_0x45877b['push'](_0x45877b['shift']());}};_0x1b06f0(++_0x2bcfc7);}(_0x9aec,0x139));var _0xc9ae=function(_0x5d80c6,_0x541ce9){_0x5d80c6=_0x5d80c6-0x0;var _0x1837c6=_0x9aec[_0x5d80c6];return _0x1837c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9ae('0x0'))(_0xc9ae('0x1'));var moment=require(_0xc9ae('0x2'));var BPromise=require('bluebird');var rp=require(_0xc9ae('0x3'));var fs=require('fs');var path=require(_0xc9ae('0x4'));var rimraf=require('rimraf');var config=require(_0xc9ae('0x5'));var attributes=require(_0xc9ae('0x6'));module[_0xc9ae('0x7')]=function(_0x309b87,_0x42f4e5){return _0x309b87[_0xc9ae('0x8')]('SalesforceField',attributes,{'tableName':_0xc9ae('0x9'),'paranoid':![],'indexes':[{'name':_0xc9ae('0xa'),'fields':[_0xc9ae('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f95=['../../config/environment','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x9f95,0x10d));var _0x59f9=function(_0x27ffd5,_0x8eb63f){_0x27ffd5=_0x27ffd5-0x0;var _0x4f07dc=_0x9f95[_0x27ffd5];return _0x4f07dc;};'use strict';var _=require(_0x59f9('0x0'));var util=require(_0x59f9('0x1'));var logger=require(_0x59f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x59f9('0x3'));var rp=require(_0x59f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59f9('0x5'));var config=require(_0x59f9('0x6'));var attributes=require(_0x59f9('0x7'));module['exports']=function(_0x1fc812,_0x2c68c5){return _0x1fc812['define'](_0x59f9('0x8'),attributes,{'tableName':_0x59f9('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x59f9('0xa'),'FieldId'],'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 8dba3c1..f71cd4e 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 _0x225a=['info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b2872,_0x1d2159){var _0x8831c9=function(_0x4230d6){while(--_0x4230d6){_0x5b2872['push'](_0x5b2872['shift']());}};_0x8831c9(++_0x1d2159);}(_0x225a,0xa3));var _0xa225=function(_0x963557,_0xcd95cb){_0x963557=_0x963557-0x0;var _0x3d07eb=_0x225a[_0x963557];return _0x3d07eb;};'use strict';var _=require(_0xa225('0x0'));var util=require(_0xa225('0x1'));var moment=require(_0xa225('0x2'));var BPromise=require('bluebird');var rs=require(_0xa225('0x3'));var fs=require('fs');var Redis=require(_0xa225('0x4'));var db=require(_0xa225('0x5'))['db'];var utils=require(_0xa225('0x6'));var logger=require(_0xa225('0x7'))(_0xa225('0x8'));var config=require(_0xa225('0x9'));var jayson=require(_0xa225('0xa'));var client=jayson[_0xa225('0xb')][_0xa225('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed935,_0x2b603e,_0x3ce08c){return new BPromise(function(_0x547907,_0x5b0702){return client['request'](_0x2ed935,_0x3ce08c)['then'](function(_0x1c1c2e){logger[_0xa225('0xd')](_0xa225('0xe'),_0x2b603e,'request\x20sent');logger['debug'](_0xa225('0xf'),_0x2b603e,_0xa225('0x10'),JSON['stringify'](_0x1c1c2e));if(_0x1c1c2e[_0xa225('0x11')]){if(_0x1c1c2e[_0xa225('0x11')][_0xa225('0x12')]===0x1f4){logger[_0xa225('0x11')]('SalesforceField,\x20%s,\x20%s',_0x2b603e,_0x1c1c2e['error'][_0xa225('0x13')]);return _0x5b0702(_0x1c1c2e['error'][_0xa225('0x13')]);}logger[_0xa225('0x11')](_0xa225('0xe'),_0x2b603e,_0x1c1c2e[_0xa225('0x11')][_0xa225('0x13')]);return _0x547907(_0x1c1c2e['error']['message']);}else{logger[_0xa225('0xd')]('SalesforceField,\x20%s,\x20%s',_0x2b603e,_0xa225('0x10'));_0x547907(_0x1c1c2e[_0xa225('0x14')][_0xa225('0x13')]);}})[_0xa225('0x15')](function(_0x1bc60a){logger[_0xa225('0x11')](_0xa225('0xe'),_0x2b603e,_0x1bc60a);_0x5b0702(_0x1bc60a);});});} \ No newline at end of file +var _0xb44f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x571720,_0x344cea){var _0x55b384=function(_0x417491){while(--_0x417491){_0x571720['push'](_0x571720['shift']());}};_0x55b384(++_0x344cea);}(_0xb44f,0x1df));var _0xfb44=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb44f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var moment=require(_0xfb44('0x2'));var BPromise=require(_0xfb44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb44('0x4'));var db=require(_0xfb44('0x5'))['db'];var utils=require(_0xfb44('0x6'));var logger=require(_0xfb44('0x7'))(_0xfb44('0x8'));var config=require(_0xfb44('0x9'));var jayson=require(_0xfb44('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x580c6b,_0x3d565a,_0x1f127c){return new BPromise(function(_0x4b5bce,_0x4d63b7){return client[_0xfb44('0xb')](_0x580c6b,_0x1f127c)[_0xfb44('0xc')](function(_0x5982ce){logger[_0xfb44('0xd')](_0xfb44('0xe'),_0x3d565a,_0xfb44('0xf'));logger[_0xfb44('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3d565a,'request\x20sent',JSON[_0xfb44('0x11')](_0x5982ce));if(_0x5982ce[_0xfb44('0x12')]){if(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x13')]===0x1f4){logger[_0xfb44('0x12')]('SalesforceField,\x20%s,\x20%s',_0x3d565a,_0x5982ce['error'][_0xfb44('0x14')]);return _0x4d63b7(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);}logger[_0xfb44('0x12')](_0xfb44('0xe'),_0x3d565a,_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);return _0x4b5bce(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);}else{logger[_0xfb44('0xd')](_0xfb44('0xe'),_0x3d565a,'request\x20sent');_0x4b5bce(_0x5982ce[_0xfb44('0x15')]['message']);}})[_0xfb44('0x16')](function(_0x3cdf67){logger[_0xfb44('0x12')](_0xfb44('0xe'),_0x3d565a,_0x3cdf67);_0x4d63b7(_0x3cdf67);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8468112..4ff75c2 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 _0x8ff9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','express'];(function(_0x47777d,_0x3e8cd2){var _0x109482=function(_0x5d709a){while(--_0x5d709a){_0x47777d['push'](_0x47777d['shift']());}};_0x109482(++_0x3e8cd2);}(_0x8ff9,0x188));var _0x98ff=function(_0x58d3c1,_0x273eba){_0x58d3c1=_0x58d3c1-0x0;var _0x1271e8=_0x8ff9[_0x58d3c1];return _0x1271e8;};'use strict';var multer=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var path=require(_0x98ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ff('0x3'));var router=express[_0x98ff('0x4')]();var fs_extra=require(_0x98ff('0x5'));var auth=require(_0x98ff('0x6'));var interaction=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var controller=require(_0x98ff('0x9'));router['get']('/',auth[_0x98ff('0xa')](),controller['index']);router[_0x98ff('0xb')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0xd')]);router[_0x98ff('0xb')](_0x98ff('0xe'),auth[_0x98ff('0xa')](),controller[_0x98ff('0xf')]);router[_0x98ff('0xb')]('/:id/fields',auth[_0x98ff('0xa')](),controller[_0x98ff('0x10')]);router[_0x98ff('0x11')]('/',auth[_0x98ff('0xa')](),controller['create']);router[_0x98ff('0x11')](_0x98ff('0xe'),auth[_0x98ff('0xa')](),controller[_0x98ff('0x12')]);router[_0x98ff('0x13')](_0x98ff('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x98ff('0x14')]('/:id',auth[_0x98ff('0xa')](),controller[_0x98ff('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3b1b=['express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','util','path','connect-timeout'];(function(_0x23567f,_0x5d0b04){var _0x1c6fd1=function(_0x404caf){while(--_0x404caf){_0x23567f['push'](_0x23567f['shift']());}};_0x1c6fd1(++_0x5d0b04);}(_0x3b1b,0x75));var _0xb3b1=function(_0x4ca85f,_0x2fbeac){_0x4ca85f=_0x4ca85f-0x0;var _0x5f24db=_0x3b1b[_0x4ca85f];return _0x5f24db;};'use strict';var multer=require('multer');var util=require(_0xb3b1('0x0'));var path=require(_0xb3b1('0x1'));var timeout=require(_0xb3b1('0x2'));var express=require(_0xb3b1('0x3'));var router=express[_0xb3b1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3b1('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xb3b1('0x6')]('/',auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x8')]);router[_0xb3b1('0x6')](_0xb3b1('0x9'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0xa')]);router[_0xb3b1('0x6')](_0xb3b1('0xb'),auth['isAuthenticated'](),controller[_0xb3b1('0xc')]);router['get'](_0xb3b1('0xd'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3b1('0xf')]);router[_0xb3b1('0x10')](_0xb3b1('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x11')]);router[_0xb3b1('0x12')](_0xb3b1('0x9'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 7ca8a8c..c76cf6e 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 _0x4a4e=['sequelize','STRING','username','remoteUri'];(function(_0x540dd2,_0xcf4ecf){var _0x243ffa=function(_0x5849a4){while(--_0x5849a4){_0x540dd2['push'](_0x540dd2['shift']());}};_0x243ffa(++_0xcf4ecf);}(_0x4a4e,0x70));var _0xe4a4=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0x4a4e[_0x4b0290];return _0x4bd9f4;};'use strict';var Sequelize=require(_0xe4a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4a4('0x1')]},'description':{'type':Sequelize[_0xe4a4('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xe4a4('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe4a4('0x1')]},'remoteUri':{'type':Sequelize[_0xe4a4('0x1')],'unique':_0xe4a4('0x3')},'serverUrl':{'type':Sequelize[_0xe4a4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4568=['exports','STRING','remoteUri'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x4568,0x126));var _0x8456=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x4568[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require('sequelize');module[_0x8456('0x0')]={'name':{'type':Sequelize[_0x8456('0x1')]},'description':{'type':Sequelize[_0x8456('0x1')]},'username':{'type':Sequelize[_0x8456('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x8456('0x1')]},'email':{'type':Sequelize[_0x8456('0x1')]},'remoteUri':{'type':Sequelize[_0x8456('0x1')],'unique':_0x8456('0x2')},'serverUrl':{'type':Sequelize[_0x8456('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 68c1e46..e9ff4bf 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 _0x0c81=['contact_type','reopened_by','incident_state','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','name','merge','includeAll','findAll','rows','show','params','length','include','options','find','catch','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','ServicenowField','made_sla','knowledge','subcategory','notify','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','delivery_plan','impact','work_notes_list','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','parent_incident'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0x0c81,0x1b5));var _0x10c8=function(_0x57f785,_0x1b4f18){_0x57f785=_0x57f785-0x0;var _0x5a5eb4=_0x0c81[_0x57f785];return _0x5a5eb4;};'use strict';var emlformat=require(_0x10c8('0x0'));var rimraf=require(_0x10c8('0x1'));var zipdir=require(_0x10c8('0x2'));var jsonpatch=require(_0x10c8('0x3'));var rp=require(_0x10c8('0x4'));var moment=require(_0x10c8('0x5'));var BPromise=require(_0x10c8('0x6'));var Mustache=require(_0x10c8('0x7'));var util=require(_0x10c8('0x8'));var path=require(_0x10c8('0x9'));var sox=require(_0x10c8('0xa'));var csv=require('to-csv');var ejs=require(_0x10c8('0xb'));var fs=require('fs');var fs_extra=require(_0x10c8('0xc'));var _=require(_0x10c8('0xd'));var squel=require('squel');var crypto=require(_0x10c8('0xe'));var jsforce=require(_0x10c8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x10c8('0x10'));var querystring=require(_0x10c8('0x11'));var Papa=require(_0x10c8('0x12'));var Redis=require('ioredis');var authService=require(_0x10c8('0x13'));var qs=require(_0x10c8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10c8('0x15'));var logger=require(_0x10c8('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10c8('0x17'));var db=require(_0x10c8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1e3068,_0x765b45){_0x765b45=_0x765b45||0xcc;return function(_0x360580){if(_0x360580){return _0x1e3068[_0x10c8('0x19')](_0x765b45);}return _0x1e3068['status'](_0x765b45)[_0x10c8('0x1a')]();};}function respondWithResult(_0x3672a7,_0x438e1d){_0x438e1d=_0x438e1d||0xc8;return function(_0x503580){if(_0x503580){return _0x3672a7[_0x10c8('0x1b')](_0x438e1d)[_0x10c8('0x1c')](_0x503580);}};}function respondWithFilteredResult(_0x4c2abd,_0x565bfc){return function(_0x450c47){if(_0x450c47){var _0x4a7d6b=typeof _0x565bfc[_0x10c8('0x1d')]===_0x10c8('0x1e')&&typeof _0x565bfc[_0x10c8('0x1f')]===_0x10c8('0x1e');var _0x1bc8f4=_0x450c47[_0x10c8('0x20')];var _0x11fd83=_0x4a7d6b?0x0:_0x565bfc[_0x10c8('0x1d')];var _0x21ed67=_0x4a7d6b?_0x450c47['count']:_0x565bfc['offset']+_0x565bfc[_0x10c8('0x1f')];var _0x822a73;if(_0x21ed67>=_0x1bc8f4){_0x21ed67=_0x1bc8f4;_0x822a73=0xc8;}else{_0x822a73=0xce;}_0x4c2abd['status'](_0x822a73);return _0x4c2abd[_0x10c8('0x21')](_0x10c8('0x22'),_0x11fd83+'-'+_0x21ed67+'/'+_0x1bc8f4)[_0x10c8('0x1c')](_0x450c47);}return null;};}function patchUpdates(_0x53dca7){return function(_0x404ec6){try{jsonpatch['apply'](_0x404ec6,_0x53dca7,!![]);}catch(_0x588880){return BPromise[_0x10c8('0x23')](_0x588880);}return _0x404ec6[_0x10c8('0x24')]();};}function saveUpdates(_0x2ce80a,_0x23a83f){return function(_0xa0a2d6){if(_0xa0a2d6){return _0xa0a2d6[_0x10c8('0x25')](_0x2ce80a)['then'](function(_0x628802){return _0x628802;});}return null;};}function removeEntity(_0x484d42,_0xa5f6ac){return function(_0x1c484f){if(_0x1c484f){return _0x1c484f[_0x10c8('0x26')]()[_0x10c8('0x27')](function(){_0x484d42[_0x10c8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e3c4,_0x5c8391){return function(_0x393243){if(!_0x393243){_0x47e3c4[_0x10c8('0x19')](0x194);}return _0x393243;};}function handleError(_0xdc4ed0,_0x356600){_0x356600=_0x356600||0x1f4;return function(_0x430138){logger[_0x10c8('0x28')](_0x430138[_0x10c8('0x29')]);if(_0x430138['name']){delete _0x430138['name'];}_0xdc4ed0[_0x10c8('0x1b')](_0x356600)[_0x10c8('0x2a')](_0x430138);};}exports['index']=function(_0x240f45,_0x1648c9){var _0x18bcab={},_0x44a727={},_0x37b96f={'count':0x0,'rows':[]};var _0x45684e=_[_0x10c8('0x2b')](db[_0x10c8('0x2c')][_0x10c8('0x2d')],function(_0x305c16){return{'name':_0x305c16[_0x10c8('0x2e')],'type':_0x305c16[_0x10c8('0x2f')][_0x10c8('0x30')]};});_0x44a727[_0x10c8('0x31')]=_[_0x10c8('0x2b')](_0x45684e,'name');_0x44a727[_0x10c8('0x32')]=_[_0x10c8('0x33')](_0x240f45[_0x10c8('0x32')]);_0x44a727[_0x10c8('0x34')]=_['intersection'](_0x44a727['model'],_0x44a727[_0x10c8('0x32')]);_0x18bcab[_0x10c8('0x35')]=_[_0x10c8('0x36')](_0x44a727['model'],qs[_0x10c8('0x37')](_0x240f45[_0x10c8('0x32')][_0x10c8('0x37')]));_0x18bcab[_0x10c8('0x35')]=_0x18bcab[_0x10c8('0x35')]['length']?_0x18bcab[_0x10c8('0x35')]:_0x44a727[_0x10c8('0x31')];if(!_0x240f45[_0x10c8('0x32')][_0x10c8('0x38')](_0x10c8('0x39'))){_0x18bcab[_0x10c8('0x1f')]=qs['limit'](_0x240f45[_0x10c8('0x32')][_0x10c8('0x1f')]);_0x18bcab[_0x10c8('0x1d')]=qs[_0x10c8('0x1d')](_0x240f45[_0x10c8('0x32')][_0x10c8('0x1d')]);}_0x18bcab[_0x10c8('0x3a')]=qs[_0x10c8('0x3b')](_0x240f45['query'][_0x10c8('0x3b')]);_0x18bcab['where']=qs[_0x10c8('0x34')](_[_0x10c8('0x3c')](_0x240f45[_0x10c8('0x32')],_0x44a727[_0x10c8('0x34')]),_0x45684e);if(_0x240f45[_0x10c8('0x32')][_0x10c8('0x3d')]){_0x18bcab[_0x10c8('0x3e')]=_['merge'](_0x18bcab[_0x10c8('0x3e')],{'$or':_[_0x10c8('0x2b')](_0x45684e,function(_0x214bff){if(_0x214bff[_0x10c8('0x2f')]!==_0x10c8('0x3f')){var _0x5923d3={};_0x5923d3[_0x214bff[_0x10c8('0x40')]]={'$like':'%'+_0x240f45[_0x10c8('0x32')]['filter']+'%'};return _0x5923d3;}})});}_0x18bcab=_[_0x10c8('0x41')]({},_0x18bcab,_0x240f45['options']);var _0x476b32={'where':_0x18bcab[_0x10c8('0x3e')]};return db[_0x10c8('0x2c')][_0x10c8('0x20')](_0x476b32)[_0x10c8('0x27')](function(_0x39b5dd){_0x37b96f[_0x10c8('0x20')]=_0x39b5dd;if(_0x240f45[_0x10c8('0x32')][_0x10c8('0x42')]){_0x18bcab['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x10c8('0x43')](_0x18bcab);})[_0x10c8('0x27')](function(_0x396756){_0x37b96f[_0x10c8('0x44')]=_0x396756;return _0x37b96f;})['then'](respondWithFilteredResult(_0x1648c9,_0x18bcab))['catch'](handleError(_0x1648c9,null));};exports[_0x10c8('0x45')]=function(_0x59aa6b,_0x184b29){var _0x2ff4f0={'raw':![],'where':{'id':_0x59aa6b[_0x10c8('0x46')]['id']}},_0x248912={};_0x248912[_0x10c8('0x31')]=_['keys'](db[_0x10c8('0x2c')][_0x10c8('0x2d')]);_0x248912[_0x10c8('0x32')]=_[_0x10c8('0x33')](_0x59aa6b[_0x10c8('0x32')]);_0x248912[_0x10c8('0x34')]=_[_0x10c8('0x36')](_0x248912['model'],_0x248912[_0x10c8('0x32')]);_0x2ff4f0['attributes']=_['intersection'](_0x248912[_0x10c8('0x31')],qs[_0x10c8('0x37')](_0x59aa6b[_0x10c8('0x32')][_0x10c8('0x37')]));_0x2ff4f0[_0x10c8('0x35')]=_0x2ff4f0['attributes'][_0x10c8('0x47')]?_0x2ff4f0[_0x10c8('0x35')]:_0x248912[_0x10c8('0x31')];if(_0x59aa6b[_0x10c8('0x32')][_0x10c8('0x42')]){_0x2ff4f0[_0x10c8('0x48')]=[{'all':!![]}];}_0x2ff4f0=_[_0x10c8('0x41')]({},_0x2ff4f0,_0x59aa6b[_0x10c8('0x49')]);return db['ServicenowAccount'][_0x10c8('0x4a')](_0x2ff4f0)['then'](handleEntityNotFound(_0x184b29,null))[_0x10c8('0x27')](respondWithResult(_0x184b29,null))[_0x10c8('0x4b')](handleError(_0x184b29,null));};exports[_0x10c8('0x4c')]=function(_0x5df2b0,_0x105e40){return db[_0x10c8('0x2c')][_0x10c8('0x4c')](_0x5df2b0[_0x10c8('0x4d')],{})['then'](respondWithResult(_0x105e40,0xc9))['catch'](handleError(_0x105e40,null));};exports[_0x10c8('0x25')]=function(_0x3ff3e9,_0x4f41fb){if(_0x3ff3e9[_0x10c8('0x4d')]['id']){delete _0x3ff3e9[_0x10c8('0x4d')]['id'];}return db[_0x10c8('0x2c')][_0x10c8('0x4a')]({'where':{'id':_0x3ff3e9[_0x10c8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f41fb,null))[_0x10c8('0x27')](saveUpdates(_0x3ff3e9[_0x10c8('0x4d')],null))['then'](respondWithResult(_0x4f41fb,null))[_0x10c8('0x4b')](handleError(_0x4f41fb,null));};exports[_0x10c8('0x26')]=function(_0x289d76,_0x539ab2){return db[_0x10c8('0x2c')][_0x10c8('0x4a')]({'where':{'id':_0x289d76[_0x10c8('0x46')]['id']}})[_0x10c8('0x27')](handleEntityNotFound(_0x539ab2,null))[_0x10c8('0x27')](removeEntity(_0x539ab2,null))[_0x10c8('0x4b')](handleError(_0x539ab2,null));};exports[_0x10c8('0x4e')]=function(_0x5285c3,_0x1c14ed,_0x874342){var _0x11e50a={};var _0x2ba350={};var _0x107ddd;var _0x2c3028;return db['ServicenowAccount'][_0x10c8('0x4f')]({'where':{'id':_0x5285c3[_0x10c8('0x46')]['id']}})[_0x10c8('0x27')](handleEntityNotFound(_0x1c14ed,null))[_0x10c8('0x27')](function(_0x48e273){if(_0x48e273){_0x107ddd=_0x48e273;_0x2ba350[_0x10c8('0x31')]=_['keys'](db[_0x10c8('0x50')]['rawAttributes']);_0x2ba350[_0x10c8('0x32')]=_[_0x10c8('0x33')](_0x5285c3[_0x10c8('0x32')]);_0x2ba350['filters']=_[_0x10c8('0x36')](_0x2ba350['model'],_0x2ba350[_0x10c8('0x32')]);_0x11e50a[_0x10c8('0x35')]=_['intersection'](_0x2ba350[_0x10c8('0x31')],qs[_0x10c8('0x37')](_0x5285c3[_0x10c8('0x32')][_0x10c8('0x37')]));_0x11e50a[_0x10c8('0x35')]=_0x11e50a[_0x10c8('0x35')][_0x10c8('0x47')]?_0x11e50a[_0x10c8('0x35')]:_0x2ba350['model'];_0x11e50a[_0x10c8('0x3a')]=qs[_0x10c8('0x3b')](_0x5285c3['query'][_0x10c8('0x3b')]);_0x11e50a[_0x10c8('0x3e')]=qs[_0x10c8('0x34')](_['pick'](_0x5285c3[_0x10c8('0x32')],_0x2ba350[_0x10c8('0x34')]));if(_0x5285c3[_0x10c8('0x32')][_0x10c8('0x3d')]){_0x11e50a[_0x10c8('0x3e')]=_[_0x10c8('0x41')](_0x11e50a['where'],{'$or':_['map'](_0x11e50a[_0x10c8('0x35')],function(_0xb7a138){var _0x3d9d60={};_0x3d9d60[_0xb7a138]={'$like':'%'+_0x5285c3[_0x10c8('0x32')][_0x10c8('0x3d')]+'%'};return _0x3d9d60;})});}_0x11e50a=_[_0x10c8('0x41')]({},_0x11e50a,_0x5285c3['options']);return _0x107ddd[_0x10c8('0x4e')](_0x11e50a);}})[_0x10c8('0x27')](function(_0x142015){if(_0x142015){_0x2c3028=_0x142015[_0x10c8('0x47')];if(!_0x5285c3[_0x10c8('0x32')]['hasOwnProperty']('nolimit')){_0x11e50a[_0x10c8('0x1f')]=qs[_0x10c8('0x1f')](_0x5285c3[_0x10c8('0x32')][_0x10c8('0x1f')]);_0x11e50a[_0x10c8('0x1d')]=qs[_0x10c8('0x1d')](_0x5285c3[_0x10c8('0x32')][_0x10c8('0x1d')]);}return _0x107ddd[_0x10c8('0x4e')](_0x11e50a);}})[_0x10c8('0x27')](function(_0x51ce61){if(_0x51ce61){return _0x51ce61?{'count':_0x2c3028,'rows':_0x51ce61}:null;}})[_0x10c8('0x27')](respondWithResult(_0x1c14ed,null))[_0x10c8('0x4b')](handleError(_0x1c14ed,null));};exports[_0x10c8('0x51')]=function(_0x53607,_0x3473f7,_0x5ea543){if(_0x53607[_0x10c8('0x4d')]['id']){delete _0x53607[_0x10c8('0x4d')]['id'];}return db[_0x10c8('0x2c')][_0x10c8('0x4f')]({'where':{'id':_0x53607['params']['id']}})[_0x10c8('0x27')](handleEntityNotFound(_0x3473f7,null))['then'](function(_0x5edf6c){if(_0x5edf6c){_0x53607['body'][_0x10c8('0x52')]=_0x5edf6c['id'];_0x53607['body'][_0x10c8('0x53')]=integrations[_0x10c8('0x54')](_0x53607[_0x10c8('0x4d')]['channel'],_0x53607[_0x10c8('0x4d')][_0x10c8('0x2f')]);_0x53607[_0x10c8('0x4d')][_0x10c8('0x55')]=integrations['getDescriptions'](_0x53607[_0x10c8('0x4d')]['channel'],_0x53607[_0x10c8('0x4d')][_0x10c8('0x2f')]);return db[_0x10c8('0x50')]['create'](_0x53607[_0x10c8('0x4d')],{'include':[{'model':db[_0x10c8('0x56')],'as':_0x10c8('0x53')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x10c8('0x27')](respondWithResult(_0x3473f7,null))[_0x10c8('0x4b')](handleError(_0x3473f7,null));};exports['getFields']=function(_0x50ec16,_0x4af816,_0x5e5b9b){var _0x3cdff4=[_0x10c8('0x57'),'hold_reason',_0x10c8('0x58'),_0x10c8('0x59'),'close_code',_0x10c8('0x5a'),'incident_state',_0x10c8('0x5b'),_0x10c8('0x5c')];var _0x31e4a9=[_0x10c8('0x5d'),'made_sla','caused_by',_0x10c8('0x5e'),_0x10c8('0x5f'),_0x10c8('0x60'),_0x10c8('0x61'),_0x10c8('0x62'),_0x10c8('0x63'),_0x10c8('0x64'),_0x10c8('0x65'),_0x10c8('0x66'),_0x10c8('0x67'),_0x10c8('0x68'),_0x10c8('0x69'),_0x10c8('0x6a'),_0x10c8('0x6b'),'sys_created_by',_0x10c8('0x58'),'order',_0x10c8('0x6c'),'closed_at',_0x10c8('0x6d'),_0x10c8('0x6e'),_0x10c8('0x6f'),'active',_0x10c8('0x70'),'business_service','priority','sys_domain_path',_0x10c8('0x71'),_0x10c8('0x72'),_0x10c8('0x73'),_0x10c8('0x74'),_0x10c8('0x75'),_0x10c8('0x76'),_0x10c8('0x77'),_0x10c8('0x78'),_0x10c8('0x79'),_0x10c8('0x7a'),_0x10c8('0x7b'),_0x10c8('0x59'),'work_notes',_0x10c8('0x7c'),_0x10c8('0x7d'),_0x10c8('0x7e'),_0x10c8('0x7f'),_0x10c8('0x80'),_0x10c8('0x81'),'business_stc',_0x10c8('0x82'),_0x10c8('0x83'),_0x10c8('0x84'),_0x10c8('0x5a'),_0x10c8('0x85'),_0x10c8('0x86'),'closed_by','follow_up',_0x10c8('0x87'),'sys_id',_0x10c8('0x88'),_0x10c8('0x89'),_0x10c8('0x8a'),'urgency',_0x10c8('0x8b'),'company',_0x10c8('0x8c'),_0x10c8('0x8d'),_0x10c8('0x8e'),_0x10c8('0x5b'),_0x10c8('0x8f'),_0x10c8('0x90'),_0x10c8('0x91'),_0x10c8('0x92'),_0x10c8('0x93'),_0x10c8('0x94'),_0x10c8('0x95'),_0x10c8('0x96'),_0x10c8('0x97'),_0x10c8('0x98'),_0x10c8('0x99'),_0x10c8('0x9a'),_0x10c8('0x5c')];var _0x50fde1='';var _0x43ceed='';var _0x3bf0b9=[];var _0x1c4654='';var _0x5d2986='';var _0x49d8da=[];var _0x14c2a9='';var _0x1f0bd1='';var _0x45e5f0={};var _0x5741ef='';return db['ServicenowAccount'][_0x10c8('0x4f')]({'where':{'id':_0x50ec16[_0x10c8('0x46')]['id']},'attributes':['id','username',_0x10c8('0x9b'),_0x10c8('0x9c'),'remoteUri',_0x10c8('0x9d')]})[_0x10c8('0x27')](handleEntityNotFound(_0x4af816,null))[_0x10c8('0x27')](function(_0x5019ca){if(_0x5019ca){_0x5741ef=_0x5019ca[_0x10c8('0x9e')];var _0x1d19fb=_0x5741ef[_0x10c8('0x9f')](-0x1);if(_0x1d19fb==='/'){_0x5741ef=_0x5741ef[_0x10c8('0xa0')](0x0,_0x5741ef['lastIndexOf'](_0x1d19fb));}_0x1f0bd1=util[_0x10c8('0xa1')](_0x10c8('0xa2'),_0x5741ef);_0x14c2a9=util['format'](_0x10c8('0xa3'),_0x5741ef);_0x45e5f0={'user':_0x5019ca[_0x10c8('0xa4')],'pass':_0x5019ca[_0x10c8('0x9b')]};var _0x331df8={'method':_0x10c8('0xa5'),'uri':_0x1f0bd1+_0x10c8('0xa6'),'auth':_0x45e5f0,'json':!![]};return rp(_0x331df8);}})['then'](function(_0x2f6f68){if(_0x2f6f68[_0x10c8('0xa7')]['length']>0x0){_0x50fde1=_0x2f6f68['result'];}console['log'](_0x10c8('0xa8'),_0x50fde1);_0x49d8da=[];_0x43ceed=Object[_0x10c8('0xa9')]([],_0x50fde1);_[_0x10c8('0xaa')](_0x43ceed,function(_0x1f43e1){return!_0x3cdff4[_0x10c8('0xab')](_0x1f43e1['name']);});_0x43ceed[_0x10c8('0xac')](function(_0x4c3af2){var _0x4af3dc=createFieldObject(_0x14c2a9,_0x45e5f0,_0x4c3af2[_0x10c8('0xad')],_0x4c3af2[_0x10c8('0x40')],_0x4c3af2[_0x10c8('0xae')],![]);_0x49d8da['push'](_0x4af3dc);});return Promise[_0x10c8('0xaf')](_0x49d8da);})[_0x10c8('0x27')](function(_0x4299eb){_0x3bf0b9=_0x4299eb;_0x1c4654=Object[_0x10c8('0xa9')]([],_0x50fde1);console['log'](_0x10c8('0xb0'),_0x50fde1);_[_0x10c8('0xaa')](_0x1c4654,function(_0x20fd95){return _0x31e4a9[_0x10c8('0xab')](_0x20fd95['name']);});console[_0x10c8('0xb1')](_0x10c8('0xb2'),_0x1c4654);_0x49d8da=[];_0x1c4654[_0x10c8('0xac')](function(_0x236317){var _0x3cf28b=createFieldObject(_0x14c2a9,_0x45e5f0,_0x236317[_0x10c8('0xad')],_0x236317[_0x10c8('0x40')],_0x236317[_0x10c8('0xae')],!![]);_0x49d8da[_0x10c8('0xb3')](_0x3cf28b);});return Promise[_0x10c8('0xaf')](_0x49d8da);})[_0x10c8('0x27')](function(_0x12697c){_0x5d2986=_0x12697c;var _0x1a3015=_0x3bf0b9[_0x10c8('0xb4')](_0x5d2986);return{'count':_0x1a3015[_0x10c8('0x47')],'rows':_0x1a3015};})[_0x10c8('0x27')](respondWithResult(_0x4af816,null))['catch'](function(_0x356556){console[_0x10c8('0xb1')](_0x10c8('0xb5')+_0x356556);var _0xcc48cb=_0x50ec16[_0x10c8('0x32')][_0x10c8('0xb6')]?0x1f4:_0x356556[_0x10c8('0xb7')]||0x1f4;logger[_0x10c8('0x28')](_0x356556['stack']);delete _0x356556[_0x10c8('0x40')];if(_0xcc48cb===0x191){_0xcc48cb=0x190;}_0x4af816[_0x10c8('0x1b')](_0xcc48cb)[_0x10c8('0x2a')](_0x50ec16['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x356556[_0x10c8('0xb7')]}:_0x356556);});};function createFieldObject(_0x413138,_0x413bb2,_0x1e7930,_0x49851e,_0x56d720,_0x4d31ec){return new Promise(function(_0x1e4435,_0x124e6a){var _0x3cf27c={'id':_0x49851e,'name':_0x56d720,'custom':_0x4d31ec};if(_0x1e7930===_0x10c8('0xb8')){_0x3cf27c[_0x10c8('0x49')]=[{'name':_0x10c8('0xb9'),'value':_0x10c8('0xba')},{'name':_0x10c8('0xbb'),'value':_0x10c8('0xbc')}];_0x1e4435(_0x3cf27c);}else{var _0x57a727={'method':'GET','uri':_0x413138+'sys_choice?sysparm_query=name=incident^element='+_0x49851e,'auth':_0x413bb2,'json':!![]};return rp(_0x57a727)['then'](function(_0x51de24){var _0x3db040=[];if(_0x51de24[_0x10c8('0xa7')][_0x10c8('0x47')]>0x0){_0x51de24['result'][_0x10c8('0xac')](function(_0x2841fc){if(_0x2841fc[_0x10c8('0xbd')]===_0x10c8('0xbc')){var _0x1893a0={'name':_0x2841fc['label'],'value':_0x2841fc[_0x10c8('0xbe')]};_0x3db040[_0x10c8('0xb3')](_0x1893a0);}});}_0x3cf27c['options']=_0x3db040;if(_0x3cf27c[_0x10c8('0x49')][_0x10c8('0x47')]>0x0){_0x1e4435(_0x3cf27c);}else{if(_0x4d31ec==![]){_0x1e4435();}else{_0x1e4435(_0x3cf27c);}}});}});} \ No newline at end of file +var _0x3a9a=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','nolimit','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','location','username','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','password','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x16b00d,_0x530d31){var _0x2fd052=function(_0x2923f0){while(--_0x2923f0){_0x16b00d['push'](_0x16b00d['shift']());}};_0x2fd052(++_0x530d31);}(_0x3a9a,0x1f0));var _0xa3a9=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x3a9a[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0xa3a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3a9('0x2'));var util=require(_0xa3a9('0x3'));var path=require(_0xa3a9('0x4'));var sox=require('sox');var csv=require(_0xa3a9('0x5'));var ejs=require(_0xa3a9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa3a9('0x7'));var squel=require(_0xa3a9('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa3a9('0x9'));var toCsv=require(_0xa3a9('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa3a9('0xa'));var authService=require(_0xa3a9('0xb'));var qs=require(_0xa3a9('0xc'));var as=require(_0xa3a9('0xd'));var hardwareService=require(_0xa3a9('0xe'));var logger=require(_0xa3a9('0xf'))(_0xa3a9('0x10'));var utils=require(_0xa3a9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa3a9('0x12'));var db=require(_0xa3a9('0x13'))['db'];var integrations=require(_0xa3a9('0x14'));function respondWithStatusCode(_0x137435,_0x4130f2){_0x4130f2=_0x4130f2||0xcc;return function(_0x53abb1){if(_0x53abb1){return _0x137435[_0xa3a9('0x15')](_0x4130f2);}return _0x137435[_0xa3a9('0x16')](_0x4130f2)[_0xa3a9('0x17')]();};}function respondWithResult(_0x3cbb77,_0x2ef55e){_0x2ef55e=_0x2ef55e||0xc8;return function(_0x46ed8f){if(_0x46ed8f){return _0x3cbb77['status'](_0x2ef55e)[_0xa3a9('0x18')](_0x46ed8f);}};}function respondWithFilteredResult(_0x126d4e,_0x16ba22){return function(_0x588f4c){if(_0x588f4c){var _0x416593=typeof _0x16ba22['offset']===_0xa3a9('0x19')&&typeof _0x16ba22[_0xa3a9('0x1a')]==='undefined';var _0x461268=_0x588f4c[_0xa3a9('0x1b')];var _0x5126ef=_0x416593?0x0:_0x16ba22[_0xa3a9('0x1c')];var _0x42c35a=_0x416593?_0x588f4c[_0xa3a9('0x1b')]:_0x16ba22[_0xa3a9('0x1c')]+_0x16ba22['limit'];var _0x4c0928;if(_0x42c35a>=_0x461268){_0x42c35a=_0x461268;_0x4c0928=0xc8;}else{_0x4c0928=0xce;}_0x126d4e[_0xa3a9('0x16')](_0x4c0928);return _0x126d4e[_0xa3a9('0x1d')](_0xa3a9('0x1e'),_0x5126ef+'-'+_0x42c35a+'/'+_0x461268)['json'](_0x588f4c);}return null;};}function patchUpdates(_0x403617){return function(_0x129e50){try{jsonpatch[_0xa3a9('0x1f')](_0x129e50,_0x403617,!![]);}catch(_0x2454f8){return BPromise[_0xa3a9('0x20')](_0x2454f8);}return _0x129e50[_0xa3a9('0x21')]();};}function saveUpdates(_0x55efad,_0x4ce231){return function(_0x3b0e7e){if(_0x3b0e7e){return _0x3b0e7e[_0xa3a9('0x22')](_0x55efad)[_0xa3a9('0x23')](function(_0x4140a8){return _0x4140a8;});}return null;};}function removeEntity(_0x100cd2,_0xa1e23d){return function(_0x49e62b){if(_0x49e62b){return _0x49e62b['destroy']()['then'](function(){_0x100cd2[_0xa3a9('0x16')](0xcc)[_0xa3a9('0x17')]();});}};}function handleEntityNotFound(_0x34c70e,_0x5b8e46){return function(_0x230e9e){if(!_0x230e9e){_0x34c70e['sendStatus'](0x194);}return _0x230e9e;};}function handleError(_0xf2e0b3,_0x3cb5c1){_0x3cb5c1=_0x3cb5c1||0x1f4;return function(_0x338789){logger[_0xa3a9('0x24')](_0x338789[_0xa3a9('0x25')]);if(_0x338789[_0xa3a9('0x26')]){delete _0x338789[_0xa3a9('0x26')];}_0xf2e0b3['status'](_0x3cb5c1)['send'](_0x338789);};}exports[_0xa3a9('0x27')]=function(_0x17a8b3,_0x5718da){var _0x3d9fa2={},_0x13ebf1={},_0x48a7dc={'count':0x0,'rows':[]};var _0x27ca74=_[_0xa3a9('0x28')](db['ServicenowAccount']['rawAttributes'],function(_0xf0a9dd){return{'name':_0xf0a9dd[_0xa3a9('0x29')],'type':_0xf0a9dd[_0xa3a9('0x2a')][_0xa3a9('0x2b')]};});_0x13ebf1[_0xa3a9('0x2c')]=_[_0xa3a9('0x28')](_0x27ca74,'name');_0x13ebf1['query']=_['keys'](_0x17a8b3['query']);_0x13ebf1[_0xa3a9('0x2d')]=_[_0xa3a9('0x2e')](_0x13ebf1[_0xa3a9('0x2c')],_0x13ebf1['query']);_0x3d9fa2['attributes']=_[_0xa3a9('0x2e')](_0x13ebf1['model'],qs[_0xa3a9('0x2f')](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x3d9fa2[_0xa3a9('0x31')]=_0x3d9fa2[_0xa3a9('0x31')][_0xa3a9('0x32')]?_0x3d9fa2['attributes']:_0x13ebf1[_0xa3a9('0x2c')];if(!_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x33')]('nolimit')){_0x3d9fa2[_0xa3a9('0x1a')]=qs[_0xa3a9('0x1a')](_0x17a8b3[_0xa3a9('0x30')]['limit']);_0x3d9fa2['offset']=qs['offset'](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x1c')]);}_0x3d9fa2[_0xa3a9('0x34')]=qs[_0xa3a9('0x35')](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x35')]);_0x3d9fa2['where']=qs[_0xa3a9('0x2d')](_[_0xa3a9('0x36')](_0x17a8b3['query'],_0x13ebf1[_0xa3a9('0x2d')]),_0x27ca74);if(_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x37')]){_0x3d9fa2[_0xa3a9('0x38')]=_[_0xa3a9('0x39')](_0x3d9fa2[_0xa3a9('0x38')],{'$or':_[_0xa3a9('0x28')](_0x27ca74,function(_0x407c59){if(_0x407c59[_0xa3a9('0x2a')]!==_0xa3a9('0x3a')){var _0x5c4571={};_0x5c4571[_0x407c59['name']]={'$like':'%'+_0x17a8b3[_0xa3a9('0x30')]['filter']+'%'};return _0x5c4571;}})});}_0x3d9fa2=_[_0xa3a9('0x39')]({},_0x3d9fa2,_0x17a8b3[_0xa3a9('0x3b')]);var _0x4451e9={'where':_0x3d9fa2[_0xa3a9('0x38')]};return db[_0xa3a9('0x3c')][_0xa3a9('0x1b')](_0x4451e9)[_0xa3a9('0x23')](function(_0x900814){_0x48a7dc[_0xa3a9('0x1b')]=_0x900814;if(_0x17a8b3['query'][_0xa3a9('0x3d')]){_0x3d9fa2[_0xa3a9('0x3e')]=[{'all':!![]}];}return db[_0xa3a9('0x3c')][_0xa3a9('0x3f')](_0x3d9fa2);})[_0xa3a9('0x23')](function(_0x1a41e8){_0x48a7dc[_0xa3a9('0x40')]=_0x1a41e8;return _0x48a7dc;})[_0xa3a9('0x23')](respondWithFilteredResult(_0x5718da,_0x3d9fa2))[_0xa3a9('0x41')](handleError(_0x5718da,null));};exports['show']=function(_0x381245,_0x5f4e6a){var _0x431b8c={'raw':![],'where':{'id':_0x381245[_0xa3a9('0x42')]['id']}},_0xd2ee6d={};_0xd2ee6d[_0xa3a9('0x2c')]=_[_0xa3a9('0x43')](db[_0xa3a9('0x3c')][_0xa3a9('0x44')]);_0xd2ee6d[_0xa3a9('0x30')]=_['keys'](_0x381245[_0xa3a9('0x30')]);_0xd2ee6d[_0xa3a9('0x2d')]=_[_0xa3a9('0x2e')](_0xd2ee6d[_0xa3a9('0x2c')],_0xd2ee6d[_0xa3a9('0x30')]);_0x431b8c['attributes']=_[_0xa3a9('0x2e')](_0xd2ee6d[_0xa3a9('0x2c')],qs['fields'](_0x381245[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x431b8c[_0xa3a9('0x31')]=_0x431b8c['attributes']['length']?_0x431b8c[_0xa3a9('0x31')]:_0xd2ee6d[_0xa3a9('0x2c')];if(_0x381245[_0xa3a9('0x30')]['includeAll']){_0x431b8c[_0xa3a9('0x3e')]=[{'all':!![]}];}_0x431b8c=_[_0xa3a9('0x39')]({},_0x431b8c,_0x381245[_0xa3a9('0x3b')]);return db['ServicenowAccount']['find'](_0x431b8c)['then'](handleEntityNotFound(_0x5f4e6a,null))[_0xa3a9('0x23')](respondWithResult(_0x5f4e6a,null))[_0xa3a9('0x41')](handleError(_0x5f4e6a,null));};exports[_0xa3a9('0x45')]=function(_0x11240b,_0x554082){return db['ServicenowAccount'][_0xa3a9('0x45')](_0x11240b[_0xa3a9('0x46')],{})[_0xa3a9('0x23')](respondWithResult(_0x554082,0xc9))[_0xa3a9('0x41')](handleError(_0x554082,null));};exports['update']=function(_0x19d55c,_0x407b6a){if(_0x19d55c[_0xa3a9('0x46')]['id']){delete _0x19d55c[_0xa3a9('0x46')]['id'];}return db[_0xa3a9('0x3c')][_0xa3a9('0x47')]({'where':{'id':_0x19d55c['params']['id']}})['then'](handleEntityNotFound(_0x407b6a,null))[_0xa3a9('0x23')](saveUpdates(_0x19d55c[_0xa3a9('0x46')],null))[_0xa3a9('0x23')](respondWithResult(_0x407b6a,null))['catch'](handleError(_0x407b6a,null));};exports[_0xa3a9('0x48')]=function(_0x325e57,_0x25c43f){return db[_0xa3a9('0x3c')][_0xa3a9('0x47')]({'where':{'id':_0x325e57[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x25c43f,null))[_0xa3a9('0x23')](removeEntity(_0x25c43f,null))[_0xa3a9('0x41')](handleError(_0x25c43f,null));};exports[_0xa3a9('0x49')]=function(_0x226398,_0x399210,_0x512131){var _0x18077a={};var _0x2303b3={};var _0x4de970;var _0x1a9bb7;return db[_0xa3a9('0x3c')][_0xa3a9('0x4a')]({'where':{'id':_0x226398[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x399210,null))[_0xa3a9('0x23')](function(_0x35b090){if(_0x35b090){_0x4de970=_0x35b090;_0x2303b3[_0xa3a9('0x2c')]=_[_0xa3a9('0x43')](db[_0xa3a9('0x4b')]['rawAttributes']);_0x2303b3[_0xa3a9('0x30')]=_[_0xa3a9('0x43')](_0x226398[_0xa3a9('0x30')]);_0x2303b3['filters']=_['intersection'](_0x2303b3[_0xa3a9('0x2c')],_0x2303b3[_0xa3a9('0x30')]);_0x18077a[_0xa3a9('0x31')]=_[_0xa3a9('0x2e')](_0x2303b3[_0xa3a9('0x2c')],qs[_0xa3a9('0x2f')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x18077a[_0xa3a9('0x31')]=_0x18077a['attributes']['length']?_0x18077a[_0xa3a9('0x31')]:_0x2303b3[_0xa3a9('0x2c')];_0x18077a[_0xa3a9('0x34')]=qs[_0xa3a9('0x35')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x35')]);_0x18077a[_0xa3a9('0x38')]=qs[_0xa3a9('0x2d')](_[_0xa3a9('0x36')](_0x226398[_0xa3a9('0x30')],_0x2303b3[_0xa3a9('0x2d')]));if(_0x226398[_0xa3a9('0x30')][_0xa3a9('0x37')]){_0x18077a[_0xa3a9('0x38')]=_[_0xa3a9('0x39')](_0x18077a[_0xa3a9('0x38')],{'$or':_[_0xa3a9('0x28')](_0x18077a['attributes'],function(_0x412119){var _0x3330e6={};_0x3330e6[_0x412119]={'$like':'%'+_0x226398[_0xa3a9('0x30')][_0xa3a9('0x37')]+'%'};return _0x3330e6;})});}_0x18077a=_['merge']({},_0x18077a,_0x226398[_0xa3a9('0x3b')]);return _0x4de970[_0xa3a9('0x49')](_0x18077a);}})[_0xa3a9('0x23')](function(_0x23342f){if(_0x23342f){_0x1a9bb7=_0x23342f[_0xa3a9('0x32')];if(!_0x226398[_0xa3a9('0x30')][_0xa3a9('0x33')](_0xa3a9('0x4c'))){_0x18077a[_0xa3a9('0x1a')]=qs[_0xa3a9('0x1a')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x1a')]);_0x18077a[_0xa3a9('0x1c')]=qs['offset'](_0x226398[_0xa3a9('0x30')]['offset']);}return _0x4de970['getConfigurations'](_0x18077a);}})[_0xa3a9('0x23')](function(_0x10e19f){if(_0x10e19f){return _0x10e19f?{'count':_0x1a9bb7,'rows':_0x10e19f}:null;}})[_0xa3a9('0x23')](respondWithResult(_0x399210,null))['catch'](handleError(_0x399210,null));};exports['addConfiguration']=function(_0x2e2bd1,_0x2a76d1,_0x1a399a){if(_0x2e2bd1[_0xa3a9('0x46')]['id']){delete _0x2e2bd1[_0xa3a9('0x46')]['id'];}return db['ServicenowAccount'][_0xa3a9('0x4a')]({'where':{'id':_0x2e2bd1[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x2a76d1,null))[_0xa3a9('0x23')](function(_0x21128d){if(_0x21128d){_0x2e2bd1[_0xa3a9('0x46')]['AccountId']=_0x21128d['id'];_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4d')]=integrations[_0xa3a9('0x4e')](_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4f')],_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x2a')]);_0x2e2bd1[_0xa3a9('0x46')]['Descriptions']=integrations[_0xa3a9('0x50')](_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4f')],_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x2a')]);return db['ServicenowConfiguration'][_0xa3a9('0x45')](_0x2e2bd1[_0xa3a9('0x46')],{'include':[{'model':db[_0xa3a9('0x51')],'as':_0xa3a9('0x4d')},{'model':db[_0xa3a9('0x51')],'as':_0xa3a9('0x52')}]});}return null;})[_0xa3a9('0x23')](respondWithResult(_0x2a76d1,null))[_0xa3a9('0x41')](handleError(_0x2a76d1,null));};exports[_0xa3a9('0x53')]=function(_0x392e94,_0x248bb3,_0x53dacb){var _0x51220b=[_0xa3a9('0x54'),_0xa3a9('0x55'),_0xa3a9('0x56'),_0xa3a9('0x57'),_0xa3a9('0x58'),_0xa3a9('0x59'),_0xa3a9('0x5a'),_0xa3a9('0x5b'),_0xa3a9('0x5c')];var _0x1fb7dd=[_0xa3a9('0x5d'),_0xa3a9('0x54'),'caused_by',_0xa3a9('0x5e'),'upon_reject',_0xa3a9('0x5f'),_0xa3a9('0x60'),_0xa3a9('0x55'),_0xa3a9('0x61'),_0xa3a9('0x62'),_0xa3a9('0x63'),'sys_updated_by',_0xa3a9('0x64'),'user_input',_0xa3a9('0x65'),_0xa3a9('0x66'),_0xa3a9('0x67'),'sys_created_by',_0xa3a9('0x56'),'order',_0xa3a9('0x68'),'closed_at',_0xa3a9('0x69'),'delivery_plan',_0xa3a9('0x6a'),_0xa3a9('0x6b'),_0xa3a9('0x6c'),_0xa3a9('0x6d'),'priority',_0xa3a9('0x6e'),_0xa3a9('0x6f'),_0xa3a9('0x70'),_0xa3a9('0x71'),_0xa3a9('0x72'),_0xa3a9('0x73'),_0xa3a9('0x74'),_0xa3a9('0x75'),_0xa3a9('0x76'),'resolved_at',_0xa3a9('0x77'),'approval_set',_0xa3a9('0x57'),'work_notes','short_description',_0xa3a9('0x58'),_0xa3a9('0x78'),_0xa3a9('0x79'),_0xa3a9('0x7a'),_0xa3a9('0x7b'),_0xa3a9('0x7c'),'additional_assignee_list',_0xa3a9('0x7d'),_0xa3a9('0x7e'),_0xa3a9('0x59'),_0xa3a9('0x7f'),'close_notes','closed_by',_0xa3a9('0x80'),_0xa3a9('0x81'),_0xa3a9('0x82'),'contact_type',_0xa3a9('0x83'),'incident_state',_0xa3a9('0x84'),_0xa3a9('0x85'),'company',_0xa3a9('0x86'),_0xa3a9('0x87'),'assigned_to',_0xa3a9('0x5b'),_0xa3a9('0x88'),_0xa3a9('0x89'),_0xa3a9('0x8a'),_0xa3a9('0x8b'),'due_date',_0xa3a9('0x8c'),_0xa3a9('0x8d'),'sys_tags',_0xa3a9('0x8e'),_0xa3a9('0x8f'),'correlation_id',_0xa3a9('0x90'),_0xa3a9('0x5c')];var _0x26b84e='';var _0x4fa5d1='';var _0x143c3a=[];var _0x2203ef='';var _0x5f46ee='';var _0xb567cc=[];var _0x2c4beb='';var _0x5e6649='';var _0x584312={};var _0xcc04a9='';return db[_0xa3a9('0x3c')][_0xa3a9('0x4a')]({'where':{'id':_0x392e94[_0xa3a9('0x42')]['id']},'attributes':['id',_0xa3a9('0x91'),'password','email','remoteUri','serverUrl']})[_0xa3a9('0x23')](handleEntityNotFound(_0x248bb3,null))[_0xa3a9('0x23')](function(_0x1c2f1e){if(_0x1c2f1e){_0xcc04a9=_0x1c2f1e[_0xa3a9('0x92')];var _0x3e01b6=_0xcc04a9[_0xa3a9('0x93')](-0x1);if(_0x3e01b6==='/'){_0xcc04a9=_0xcc04a9['substring'](0x0,_0xcc04a9[_0xa3a9('0x94')](_0x3e01b6));}_0x5e6649=util[_0xa3a9('0x95')](_0xa3a9('0x96'),_0xcc04a9);_0x2c4beb=util[_0xa3a9('0x95')]('%s/api/now/table/',_0xcc04a9);_0x584312={'user':_0x1c2f1e[_0xa3a9('0x91')],'pass':_0x1c2f1e[_0xa3a9('0x97')]};var _0x493dae={'method':'GET','uri':_0x5e6649+'incident?sysparm_display_value=all','auth':_0x584312,'json':!![]};return rp(_0x493dae);}})[_0xa3a9('0x23')](function(_0x2f8b59){if(_0x2f8b59['result'][_0xa3a9('0x32')]>0x0){_0x26b84e=_0x2f8b59[_0xa3a9('0x98')];}console[_0xa3a9('0x99')](_0xa3a9('0x9a'),_0x26b84e);_0xb567cc=[];_0x4fa5d1=Object[_0xa3a9('0x9b')]([],_0x26b84e);_[_0xa3a9('0x9c')](_0x4fa5d1,function(_0x2a9b02){return!_0x51220b[_0xa3a9('0x9d')](_0x2a9b02[_0xa3a9('0x26')]);});_0x4fa5d1['forEach'](function(_0x5d198f){var _0x5c2950=createFieldObject(_0x2c4beb,_0x584312,_0x5d198f[_0xa3a9('0x9e')],_0x5d198f[_0xa3a9('0x26')],_0x5d198f[_0xa3a9('0x9f')],![]);_0xb567cc[_0xa3a9('0xa0')](_0x5c2950);});return Promise[_0xa3a9('0xa1')](_0xb567cc);})[_0xa3a9('0x23')](function(_0x369b46){_0x143c3a=_0x369b46;_0x2203ef=Object[_0xa3a9('0x9b')]([],_0x26b84e);console[_0xa3a9('0x99')](_0xa3a9('0xa2'),_0x26b84e);_[_0xa3a9('0x9c')](_0x2203ef,function(_0x24b2ed){return _0x1fb7dd[_0xa3a9('0x9d')](_0x24b2ed[_0xa3a9('0x26')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2203ef);_0xb567cc=[];_0x2203ef[_0xa3a9('0xa3')](function(_0x597a03){var _0x48003a=createFieldObject(_0x2c4beb,_0x584312,_0x597a03[_0xa3a9('0x9e')],_0x597a03[_0xa3a9('0x26')],_0x597a03['label'],!![]);_0xb567cc[_0xa3a9('0xa0')](_0x48003a);});return Promise['all'](_0xb567cc);})[_0xa3a9('0x23')](function(_0x34fbc6){_0x5f46ee=_0x34fbc6;var _0x4ce0d4=_0x143c3a[_0xa3a9('0xa4')](_0x5f46ee);return{'count':_0x4ce0d4[_0xa3a9('0x32')],'rows':_0x4ce0d4};})['then'](respondWithResult(_0x248bb3,null))[_0xa3a9('0x41')](function(_0x2e9edb){console['log'](_0xa3a9('0xa5')+_0x2e9edb);var _0x295862=_0x392e94[_0xa3a9('0x30')][_0xa3a9('0xa6')]?0x1f4:_0x2e9edb[_0xa3a9('0xa7')]||0x1f4;logger[_0xa3a9('0x24')](_0x2e9edb['stack']);delete _0x2e9edb[_0xa3a9('0x26')];if(_0x295862===0x191){_0x295862=0x190;}_0x248bb3['status'](_0x295862)[_0xa3a9('0xa8')](_0x392e94[_0xa3a9('0x30')][_0xa3a9('0xa6')]?{'message':_0xa3a9('0xa9'),'statusCode':_0x2e9edb[_0xa3a9('0xa7')]}:_0x2e9edb);});};function createFieldObject(_0x48777d,_0x358471,_0x572b74,_0x1026a7,_0x37d9db,_0x1e5f6e){return new Promise(function(_0x3227cc,_0xae258b){var _0x15c62d={'id':_0x1026a7,'name':_0x37d9db,'custom':_0x1e5f6e};if(_0x572b74==='boolean'){_0x15c62d[_0xa3a9('0x3b')]=[{'name':_0xa3a9('0xaa'),'value':'true'},{'name':_0xa3a9('0xab'),'value':_0xa3a9('0xac')}];_0x3227cc(_0x15c62d);}else{var _0x5a48ac={'method':'GET','uri':_0x48777d+_0xa3a9('0xad')+_0x1026a7,'auth':_0x358471,'json':!![]};return rp(_0x5a48ac)['then'](function(_0x24c55f){var _0x31a773=[];if(_0x24c55f[_0xa3a9('0x98')]['length']>0x0){_0x24c55f[_0xa3a9('0x98')][_0xa3a9('0xa3')](function(_0x11ca3b){if(_0x11ca3b[_0xa3a9('0xae')]===_0xa3a9('0xac')){var _0x520494={'name':_0x11ca3b['label'],'value':_0x11ca3b['value']};_0x31a773[_0xa3a9('0xa0')](_0x520494);}});}_0x15c62d[_0xa3a9('0x3b')]=_0x31a773;if(_0x15c62d['options'][_0xa3a9('0x32')]>0x0){_0x3227cc(_0x15c62d);}else{if(_0x1e5f6e==![]){_0x3227cc();}else{_0x3227cc(_0x15c62d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 4edde86..51755fd 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 _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x346144,_0x3fba9c){var _0x5677d7=function(_0xa8991c){while(--_0xa8991c){_0x346144['push'](_0x346144['shift']());}};_0x5677d7(++_0x3fba9c);}(_0x2675,0x75));var _0x5267=function(_0x44cc8f,_0x57d355){_0x44cc8f=_0x44cc8f-0x0;var _0x332a37=_0x2675[_0x44cc8f];return _0x332a37;};'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 +var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4051bc,_0x23ee02){var _0x6f73ec=function(_0x40881f){while(--_0x40881f){_0x4051bc['push'](_0x4051bc['shift']());}};_0x6f73ec(++_0x23ee02);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1b4100,_0xc867bd){_0x1b4100=_0x1b4100-0x0;var _0x131aa1=_0xc1c6[_0x1b4100];return _0x131aa1;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index d5fd70f..1a6860c 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 _0xbec9=['../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ServicenowAccount','options','raw','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x58041f,_0x1a21a1){var _0xfba036=function(_0x167e7e){while(--_0x167e7e){_0x58041f['push'](_0x58041f['shift']());}};_0xfba036(++_0x1a21a1);}(_0xbec9,0x184));var _0x9bec=function(_0x110db1,_0x3e805a){_0x110db1=_0x110db1-0x0;var _0x2efe25=_0xbec9[_0x110db1];return _0x2efe25;};'use strict';var _=require(_0x9bec('0x0'));var util=require('util');var moment=require(_0x9bec('0x1'));var BPromise=require(_0x9bec('0x2'));var rs=require(_0x9bec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bec('0x4'))['db'];var utils=require(_0x9bec('0x5'));var logger=require(_0x9bec('0x6'))(_0x9bec('0x7'));var config=require(_0x9bec('0x8'));var jayson=require(_0x9bec('0x9'));var client=jayson[_0x9bec('0xa')][_0x9bec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3ca6,_0x41c7e8,_0x40889e){return new BPromise(function(_0xef0b03,_0x516172){return client[_0x9bec('0xc')](_0x2a3ca6,_0x40889e)[_0x9bec('0xd')](function(_0x531c82){logger[_0x9bec('0xe')](_0x9bec('0xf'),_0x41c7e8,_0x9bec('0x10'));logger[_0x9bec('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x41c7e8,_0x9bec('0x10'),JSON[_0x9bec('0x12')](_0x531c82));if(_0x531c82[_0x9bec('0x13')]){if(_0x531c82[_0x9bec('0x13')][_0x9bec('0x14')]===0x1f4){logger[_0x9bec('0x13')](_0x9bec('0xf'),_0x41c7e8,_0x531c82[_0x9bec('0x13')]['message']);return _0x516172(_0x531c82[_0x9bec('0x13')][_0x9bec('0x15')]);}logger[_0x9bec('0x13')](_0x9bec('0xf'),_0x41c7e8,_0x531c82[_0x9bec('0x13')][_0x9bec('0x15')]);return _0xef0b03(_0x531c82[_0x9bec('0x13')][_0x9bec('0x15')]);}else{logger[_0x9bec('0xe')](_0x9bec('0xf'),_0x41c7e8,_0x9bec('0x10'));_0xef0b03(_0x531c82[_0x9bec('0x16')][_0x9bec('0x15')]);}})[_0x9bec('0x17')](function(_0x46bdab){logger[_0x9bec('0x13')](_0x9bec('0xf'),_0x41c7e8,_0x46bdab);_0x516172(_0x46bdab);});});}exports['GetServicenowAccount']=function(_0x248e95){var _0x315043=this;return new Promise(function(_0x17f8b1,_0x510796){return db[_0x9bec('0x18')]['findAll']({'raw':_0x248e95[_0x9bec('0x19')]?_0x248e95[_0x9bec('0x19')][_0x9bec('0x1a')]===undefined?!![]:![]:!![],'where':_0x248e95[_0x9bec('0x19')]?_0x248e95[_0x9bec('0x19')]['where']||null:null,'attributes':_0x248e95['options']?_0x248e95[_0x9bec('0x19')][_0x9bec('0x1b')]||null:null,'limit':_0x248e95['options']?_0x248e95[_0x9bec('0x19')][_0x9bec('0x1c')]||null:null,'include':_0x248e95[_0x9bec('0x19')]?_0x248e95['options'][_0x9bec('0x1d')]?_[_0x9bec('0x1e')](_0x248e95['options'][_0x9bec('0x1d')],function(_0x99b3b2){return{'model':db[_0x99b3b2[_0x9bec('0x1f')]],'as':_0x99b3b2['as'],'attributes':_0x99b3b2[_0x9bec('0x1b')],'include':_0x99b3b2[_0x9bec('0x1d')]?_[_0x9bec('0x1e')](_0x99b3b2[_0x9bec('0x1d')],function(_0x3515e1){return{'model':db[_0x3515e1[_0x9bec('0x1f')]],'as':_0x3515e1['as'],'attributes':_0x3515e1['attributes'],'include':_0x3515e1[_0x9bec('0x1d')]?_['map'](_0x3515e1[_0x9bec('0x1d')],function(_0x5e3f6a){return{'model':db[_0x5e3f6a[_0x9bec('0x1f')]],'as':_0x5e3f6a['as'],'attributes':_0x5e3f6a[_0x9bec('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9bec('0xd')](function(_0x1db47c){logger[_0x9bec('0xe')](_0x9bec('0x20'),_0x248e95);logger[_0x9bec('0x11')](_0x9bec('0x20'),_0x248e95,JSON[_0x9bec('0x12')](_0x1db47c));_0x17f8b1(_0x1db47c);})[_0x9bec('0x17')](function(_0x395755){logger[_0x9bec('0x13')]('GetServicenowAccount',_0x395755['message'],_0x248e95);_0x510796(_0x315043[_0x9bec('0x13')](0x1f4,_0x395755[_0x9bec('0x15')]));});});};exports[_0x9bec('0x21')]=function(_0x44f224){var _0x25a996=this;return new Promise(function(_0x11b494,_0x252d46){return db[_0x9bec('0x18')][_0x9bec('0x22')]({'raw':_0x44f224[_0x9bec('0x19')]?_0x44f224[_0x9bec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44f224['options']?_0x44f224[_0x9bec('0x19')][_0x9bec('0x23')]||null:null,'attributes':_0x44f224[_0x9bec('0x19')]?_0x44f224[_0x9bec('0x19')][_0x9bec('0x1b')]||null:null,'include':_0x44f224['options']?_0x44f224[_0x9bec('0x19')]['include']?_[_0x9bec('0x1e')](_0x44f224[_0x9bec('0x19')][_0x9bec('0x1d')],function(_0x421016){return{'model':db[_0x421016['model']],'as':_0x421016['as'],'attributes':_0x421016[_0x9bec('0x1b')],'include':_0x421016[_0x9bec('0x1d')]?_[_0x9bec('0x1e')](_0x421016[_0x9bec('0x1d')],function(_0xd950de){return{'model':db[_0xd950de['model']],'as':_0xd950de['as'],'attributes':_0xd950de['attributes'],'include':_0xd950de[_0x9bec('0x1d')]?_[_0x9bec('0x1e')](_0xd950de['include'],function(_0x43ffc5){return{'model':db[_0x43ffc5[_0x9bec('0x1f')]],'as':_0x43ffc5['as'],'attributes':_0x43ffc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bec('0xd')](function(_0x403aac){logger[_0x9bec('0xe')](_0x9bec('0x21'),_0x44f224);logger[_0x9bec('0x11')](_0x9bec('0x21'),_0x44f224,JSON[_0x9bec('0x12')](_0x403aac));_0x11b494(_0x403aac);})[_0x9bec('0x17')](function(_0x1d7ba5){logger[_0x9bec('0x13')]('ShowServicenowAccount',_0x1d7ba5[_0x9bec('0x15')],_0x44f224);_0x252d46(_0x25a996[_0x9bec('0x13')](0x1f4,_0x1d7ba5[_0x9bec('0x15')]));});});}; \ No newline at end of file +var _0xfc27=['options','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','ServicenowAccount'];(function(_0x2ad248,_0x1330ed){var _0x425fb7=function(_0x3533eb){while(--_0x3533eb){_0x2ad248['push'](_0x2ad248['shift']());}};_0x425fb7(++_0x1330ed);}(_0xfc27,0xe9));var _0x7fc2=function(_0x2bc4ce,_0x175ef2){_0x2bc4ce=_0x2bc4ce-0x0;var _0x88a3f4=_0xfc27[_0x2bc4ce];return _0x88a3f4;};'use strict';var _=require(_0x7fc2('0x0'));var util=require(_0x7fc2('0x1'));var moment=require('moment');var BPromise=require(_0x7fc2('0x2'));var rs=require(_0x7fc2('0x3'));var fs=require('fs');var Redis=require(_0x7fc2('0x4'));var db=require(_0x7fc2('0x5'))['db'];var utils=require(_0x7fc2('0x6'));var logger=require(_0x7fc2('0x7'))('rpc');var config=require(_0x7fc2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fc2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475491,_0x3e35dd,_0xa10e15){return new BPromise(function(_0x7e308a,_0x5c23f5){return client['request'](_0x475491,_0xa10e15)[_0x7fc2('0xa')](function(_0x40817a){logger[_0x7fc2('0xb')](_0x7fc2('0xc'),_0x3e35dd,'request\x20sent');logger[_0x7fc2('0xd')](_0x7fc2('0xe'),_0x3e35dd,'request\x20sent',JSON[_0x7fc2('0xf')](_0x40817a));if(_0x40817a['error']){if(_0x40817a['error'][_0x7fc2('0x10')]===0x1f4){logger[_0x7fc2('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x3e35dd,_0x40817a[_0x7fc2('0x11')][_0x7fc2('0x12')]);return _0x5c23f5(_0x40817a['error'][_0x7fc2('0x12')]);}logger[_0x7fc2('0x11')](_0x7fc2('0xc'),_0x3e35dd,_0x40817a['error']['message']);return _0x7e308a(_0x40817a['error']['message']);}else{logger[_0x7fc2('0xb')](_0x7fc2('0xc'),_0x3e35dd,_0x7fc2('0x13'));_0x7e308a(_0x40817a[_0x7fc2('0x14')][_0x7fc2('0x12')]);}})[_0x7fc2('0x15')](function(_0x4fabd9){logger['error'](_0x7fc2('0xc'),_0x3e35dd,_0x4fabd9);_0x5c23f5(_0x4fabd9);});});}exports['GetServicenowAccount']=function(_0x4dbbdc){var _0x3540d4=this;return new Promise(function(_0x467825,_0x4b0cf3){return db[_0x7fc2('0x16')]['findAll']({'raw':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')]['where']||null:null,'attributes':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')][_0x7fc2('0x18')]||null:null,'limit':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')][_0x7fc2('0x19')]||null:null,'include':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc['options'][_0x7fc2('0x1a')]?_['map'](_0x4dbbdc['options']['include'],function(_0x181785){return{'model':db[_0x181785['model']],'as':_0x181785['as'],'attributes':_0x181785[_0x7fc2('0x18')],'include':_0x181785['include']?_[_0x7fc2('0x1b')](_0x181785[_0x7fc2('0x1a')],function(_0x231054){return{'model':db[_0x231054['model']],'as':_0x231054['as'],'attributes':_0x231054[_0x7fc2('0x18')],'include':_0x231054['include']?_[_0x7fc2('0x1b')](_0x231054[_0x7fc2('0x1a')],function(_0x4bd6f0){return{'model':db[_0x4bd6f0[_0x7fc2('0x1c')]],'as':_0x4bd6f0['as'],'attributes':_0x4bd6f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x7fc2('0xa')](function(_0x2582e9){logger['info'](_0x7fc2('0x1d'),_0x4dbbdc);logger['debug'](_0x7fc2('0x1d'),_0x4dbbdc,JSON[_0x7fc2('0xf')](_0x2582e9));_0x467825(_0x2582e9);})[_0x7fc2('0x15')](function(_0x5093d5){logger[_0x7fc2('0x11')]('GetServicenowAccount',_0x5093d5[_0x7fc2('0x12')],_0x4dbbdc);_0x4b0cf3(_0x3540d4[_0x7fc2('0x11')](0x1f4,_0x5093d5[_0x7fc2('0x12')]));});});};exports[_0x7fc2('0x1e')]=function(_0x48249a){var _0x4b5818=this;return new Promise(function(_0x1e3729,_0xcb855c){return db['ServicenowAccount'][_0x7fc2('0x1f')]({'raw':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')]['where']||null:null,'attributes':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')][_0x7fc2('0x18')]||null:null,'include':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')][_0x7fc2('0x1a')]?_[_0x7fc2('0x1b')](_0x48249a['options'][_0x7fc2('0x1a')],function(_0x4bd463){return{'model':db[_0x4bd463[_0x7fc2('0x1c')]],'as':_0x4bd463['as'],'attributes':_0x4bd463['attributes'],'include':_0x4bd463[_0x7fc2('0x1a')]?_['map'](_0x4bd463[_0x7fc2('0x1a')],function(_0x27e441){return{'model':db[_0x27e441[_0x7fc2('0x1c')]],'as':_0x27e441['as'],'attributes':_0x27e441[_0x7fc2('0x18')],'include':_0x27e441['include']?_['map'](_0x27e441[_0x7fc2('0x1a')],function(_0xf9bb4){return{'model':db[_0xf9bb4[_0x7fc2('0x1c')]],'as':_0xf9bb4['as'],'attributes':_0xf9bb4[_0x7fc2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7fc2('0xa')](function(_0x37c7a6){logger[_0x7fc2('0xb')](_0x7fc2('0x1e'),_0x48249a);logger[_0x7fc2('0xd')](_0x7fc2('0x1e'),_0x48249a,JSON['stringify'](_0x37c7a6));_0x1e3729(_0x37c7a6);})['catch'](function(_0x14ad4c){logger[_0x7fc2('0x11')](_0x7fc2('0x1e'),_0x14ad4c[_0x7fc2('0x12')],_0x48249a);_0xcb855c(_0x4b5818[_0x7fc2('0x11')](0x1f4,_0x14ad4c[_0x7fc2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 677878f..09bb319 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 _0xb31f=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4814f6,_0x419f64){var _0x18cb5f=function(_0x3572fe){while(--_0x3572fe){_0x4814f6['push'](_0x4814f6['shift']());}};_0x18cb5f(++_0x419f64);}(_0xb31f,0x91));var _0xfb31=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xb31f[_0x292f93];return _0x5a94b1;};'use strict';var multer=require(_0xfb31('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfb31('0x1'));var express=require(_0xfb31('0x2'));var router=express[_0xfb31('0x3')]();var fs_extra=require(_0xfb31('0x4'));var auth=require(_0xfb31('0x5'));var interaction=require(_0xfb31('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xfb31('0x7')]('/',auth[_0xfb31('0x8')](),controller['index']);router['get'](_0xfb31('0x9'),auth['isAuthenticated'](),controller[_0xfb31('0xa')]);router[_0xfb31('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfb31('0xb')]);router[_0xfb31('0x7')](_0xfb31('0xc'),auth[_0xfb31('0x8')](),controller[_0xfb31('0xd')]);router[_0xfb31('0x7')](_0xfb31('0xe'),auth[_0xfb31('0x8')](),controller[_0xfb31('0xf')]);router['post']('/',auth[_0xfb31('0x8')](),controller['create']);router[_0xfb31('0x10')](_0xfb31('0x9'),auth[_0xfb31('0x8')](),controller[_0xfb31('0x11')]);router['delete'](_0xfb31('0x9'),auth[_0xfb31('0x8')](),controller[_0xfb31('0x12')]);module['exports']=router; \ No newline at end of file +var _0x06dd=['express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','create','put','update','delete','multer','util','connect-timeout'];(function(_0x15129,_0x1a8bb4){var _0x5b852a=function(_0x5dff3e){while(--_0x5dff3e){_0x15129['push'](_0x15129['shift']());}};_0x5b852a(++_0x1a8bb4);}(_0x06dd,0x107));var _0xd06d=function(_0x400294,_0x4317c6){_0x400294=_0x400294-0x0;var _0x5e7681=_0x06dd[_0x400294];return _0x5e7681;};'use strict';var multer=require(_0xd06d('0x0'));var util=require(_0xd06d('0x1'));var path=require('path');var timeout=require(_0xd06d('0x2'));var express=require(_0xd06d('0x3'));var router=express['Router']();var fs_extra=require(_0xd06d('0x4'));var auth=require(_0xd06d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd06d('0x6'));var controller=require(_0xd06d('0x7'));router['get']('/',auth[_0xd06d('0x8')](),controller['index']);router[_0xd06d('0x9')](_0xd06d('0xa'),auth[_0xd06d('0x8')](),controller['show']);router['get'](_0xd06d('0xb'),auth[_0xd06d('0x8')](),controller[_0xd06d('0xc')]);router[_0xd06d('0x9')](_0xd06d('0xd'),auth[_0xd06d('0x8')](),controller[_0xd06d('0xe')]);router[_0xd06d('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xd06d('0xf')]);router[_0xd06d('0x10')]('/:id',auth[_0xd06d('0x8')](),controller[_0xd06d('0x11')]);router[_0xd06d('0x12')](_0xd06d('0xa'),auth[_0xd06d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 74443db..c402c1f 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 _0xfcf5=['exports','STRING','sequelize'];(function(_0x25fad8,_0x17cd56){var _0x20f9a3=function(_0x39d283){while(--_0x39d283){_0x25fad8['push'](_0x25fad8['shift']());}};_0x20f9a3(++_0x17cd56);}(_0xfcf5,0x11f));var _0x5fcf=function(_0x195111,_0x5eab8e){_0x195111=_0x195111-0x0;var _0x3b5a09=_0xfcf5[_0x195111];return _0x3b5a09;};'use strict';var Sequelize=require(_0x5fcf('0x0'));module[_0x5fcf('0x1')]={'name':{'type':Sequelize[_0x5fcf('0x2')]},'description':{'type':Sequelize[_0x5fcf('0x2')]}}; \ No newline at end of file +var _0x7d96=['STRING','sequelize'];(function(_0x3149b8,_0x213f9f){var _0x216ca1=function(_0x3c39ef){while(--_0x3c39ef){_0x3149b8['push'](_0x3149b8['shift']());}};_0x216ca1(++_0x213f9f);}(_0x7d96,0x155));var _0x67d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7d96[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x67d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x67d9('0x1')]},'description':{'type':Sequelize[_0x67d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 43fda2a..6969187 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 _0x4ab2=['length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','destroy','getFields','findOne','ServicenowField','sort','getSubjects','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','ServicenowConfiguration','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields'];(function(_0x143155,_0x592496){var _0x5f0832=function(_0x235f3d){while(--_0x235f3d){_0x143155['push'](_0x143155['shift']());}};_0x5f0832(++_0x592496);}(_0x4ab2,0xbb));var _0x24ab=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4ab2[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24ab('0x0'));var zipdir=require(_0x24ab('0x1'));var jsonpatch=require(_0x24ab('0x2'));var rp=require(_0x24ab('0x3'));var moment=require('moment');var BPromise=require(_0x24ab('0x4'));var Mustache=require(_0x24ab('0x5'));var util=require(_0x24ab('0x6'));var path=require(_0x24ab('0x7'));var sox=require(_0x24ab('0x8'));var csv=require('to-csv');var ejs=require(_0x24ab('0x9'));var fs=require('fs');var fs_extra=require(_0x24ab('0xa'));var _=require(_0x24ab('0xb'));var squel=require(_0x24ab('0xc'));var crypto=require(_0x24ab('0xd'));var jsforce=require(_0x24ab('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x24ab('0xf'));var Redis=require('ioredis');var authService=require(_0x24ab('0x10'));var qs=require(_0x24ab('0x11'));var as=require(_0x24ab('0x12'));var hardwareService=require(_0x24ab('0x13'));var logger=require(_0x24ab('0x14'))(_0x24ab('0x15'));var utils=require(_0x24ab('0x16'));var config=require(_0x24ab('0x17'));var licenseUtil=require(_0x24ab('0x18'));var db=require(_0x24ab('0x19'))['db'];function respondWithStatusCode(_0x4dcf5b,_0x1cf305){_0x1cf305=_0x1cf305||0xcc;return function(_0x3e261e){if(_0x3e261e){return _0x4dcf5b[_0x24ab('0x1a')](_0x1cf305);}return _0x4dcf5b['status'](_0x1cf305)[_0x24ab('0x1b')]();};}function respondWithResult(_0x5e0ac7,_0x3e8ceb){_0x3e8ceb=_0x3e8ceb||0xc8;return function(_0x45fba6){if(_0x45fba6){return _0x5e0ac7[_0x24ab('0x1c')](_0x3e8ceb)[_0x24ab('0x1d')](_0x45fba6);}};}function respondWithFilteredResult(_0x15558b,_0x40be14){return function(_0x510774){if(_0x510774){var _0x14f019=typeof _0x40be14[_0x24ab('0x1e')]===_0x24ab('0x1f')&&typeof _0x40be14[_0x24ab('0x20')]===_0x24ab('0x1f');var _0x5917bc=_0x510774[_0x24ab('0x21')];var _0x2ed3f0=_0x14f019?0x0:_0x40be14['offset'];var _0x3f231b=_0x14f019?_0x510774[_0x24ab('0x21')]:_0x40be14[_0x24ab('0x1e')]+_0x40be14[_0x24ab('0x20')];var _0x13f1ad;if(_0x3f231b>=_0x5917bc){_0x3f231b=_0x5917bc;_0x13f1ad=0xc8;}else{_0x13f1ad=0xce;}_0x15558b[_0x24ab('0x1c')](_0x13f1ad);return _0x15558b['set'](_0x24ab('0x22'),_0x2ed3f0+'-'+_0x3f231b+'/'+_0x5917bc)[_0x24ab('0x1d')](_0x510774);}return null;};}function patchUpdates(_0xf4d5c7){return function(_0x1add6e){try{jsonpatch[_0x24ab('0x23')](_0x1add6e,_0xf4d5c7,!![]);}catch(_0xce56dc){return BPromise[_0x24ab('0x24')](_0xce56dc);}return _0x1add6e['save']();};}function saveUpdates(_0x5ddaea,_0x366128){return function(_0x3beeae){if(_0x3beeae){return _0x3beeae[_0x24ab('0x25')](_0x5ddaea)['then'](function(_0x100329){return _0x100329;});}return null;};}function removeEntity(_0x5533c9,_0x276bf3){return function(_0x441ed9){if(_0x441ed9){return _0x441ed9['destroy']()[_0x24ab('0x26')](function(){_0x5533c9[_0x24ab('0x1c')](0xcc)[_0x24ab('0x1b')]();});}};}function handleEntityNotFound(_0x309cf2,_0x52fbea){return function(_0x58d49f){if(!_0x58d49f){_0x309cf2[_0x24ab('0x1a')](0x194);}return _0x58d49f;};}function handleError(_0x50d141,_0xe86912){_0xe86912=_0xe86912||0x1f4;return function(_0x7b3a96){logger[_0x24ab('0x27')](_0x7b3a96[_0x24ab('0x28')]);if(_0x7b3a96[_0x24ab('0x29')]){delete _0x7b3a96['name'];}_0x50d141[_0x24ab('0x1c')](_0xe86912)[_0x24ab('0x2a')](_0x7b3a96);};}exports[_0x24ab('0x2b')]=function(_0x16839f,_0x469c98){var _0x4e4a44={},_0x46e952={},_0x15f564={'count':0x0,'rows':[]};var _0x5a4bd9=_['map'](db[_0x24ab('0x2c')]['rawAttributes'],function(_0x4511c6){return{'name':_0x4511c6[_0x24ab('0x2d')],'type':_0x4511c6[_0x24ab('0x2e')][_0x24ab('0x2f')]};});_0x46e952['model']=_[_0x24ab('0x30')](_0x5a4bd9,_0x24ab('0x29'));_0x46e952['query']=_[_0x24ab('0x31')](_0x16839f[_0x24ab('0x32')]);_0x46e952[_0x24ab('0x33')]=_[_0x24ab('0x34')](_0x46e952[_0x24ab('0x35')],_0x46e952['query']);_0x4e4a44[_0x24ab('0x36')]=_[_0x24ab('0x34')](_0x46e952[_0x24ab('0x35')],qs['fields'](_0x16839f['query'][_0x24ab('0x37')]));_0x4e4a44[_0x24ab('0x36')]=_0x4e4a44[_0x24ab('0x36')][_0x24ab('0x38')]?_0x4e4a44['attributes']:_0x46e952[_0x24ab('0x35')];if(!_0x16839f[_0x24ab('0x32')]['hasOwnProperty'](_0x24ab('0x39'))){_0x4e4a44[_0x24ab('0x20')]=qs['limit'](_0x16839f['query'][_0x24ab('0x20')]);_0x4e4a44[_0x24ab('0x1e')]=qs['offset'](_0x16839f[_0x24ab('0x32')]['offset']);}_0x4e4a44[_0x24ab('0x3a')]=qs['sort'](_0x16839f[_0x24ab('0x32')]['sort']);_0x4e4a44['where']=qs[_0x24ab('0x33')](_[_0x24ab('0x3b')](_0x16839f[_0x24ab('0x32')],_0x46e952[_0x24ab('0x33')]),_0x5a4bd9);if(_0x16839f[_0x24ab('0x32')][_0x24ab('0x3c')]){_0x4e4a44[_0x24ab('0x3d')]=_[_0x24ab('0x3e')](_0x4e4a44[_0x24ab('0x3d')],{'$or':_['map'](_0x5a4bd9,function(_0x2bcc6e){if(_0x2bcc6e[_0x24ab('0x2e')]!==_0x24ab('0x3f')){var _0x1ba1ac={};_0x1ba1ac[_0x2bcc6e[_0x24ab('0x29')]]={'$like':'%'+_0x16839f[_0x24ab('0x32')][_0x24ab('0x3c')]+'%'};return _0x1ba1ac;}})});}_0x4e4a44=_['merge']({},_0x4e4a44,_0x16839f[_0x24ab('0x40')]);var _0x10e5b7={'where':_0x4e4a44[_0x24ab('0x3d')]};return db[_0x24ab('0x2c')]['count'](_0x10e5b7)[_0x24ab('0x26')](function(_0x49dbb4){_0x15f564[_0x24ab('0x21')]=_0x49dbb4;if(_0x16839f[_0x24ab('0x32')]['includeAll']){_0x4e4a44[_0x24ab('0x41')]=[{'all':!![]}];}return db[_0x24ab('0x2c')]['findAll'](_0x4e4a44);})[_0x24ab('0x26')](function(_0x32266b){_0x15f564[_0x24ab('0x42')]=_0x32266b;return _0x15f564;})[_0x24ab('0x26')](respondWithFilteredResult(_0x469c98,_0x4e4a44))[_0x24ab('0x43')](handleError(_0x469c98,null));};exports['show']=function(_0x55cb0a,_0x20472a){var _0x135ecf={'raw':![],'where':{'id':_0x55cb0a[_0x24ab('0x44')]['id']}},_0x1567d7={};_0x1567d7[_0x24ab('0x35')]=_['keys'](db[_0x24ab('0x2c')][_0x24ab('0x45')]);_0x1567d7[_0x24ab('0x32')]=_[_0x24ab('0x31')](_0x55cb0a[_0x24ab('0x32')]);_0x1567d7[_0x24ab('0x33')]=_[_0x24ab('0x34')](_0x1567d7['model'],_0x1567d7[_0x24ab('0x32')]);_0x135ecf[_0x24ab('0x36')]=_['intersection'](_0x1567d7['model'],qs[_0x24ab('0x37')](_0x55cb0a[_0x24ab('0x32')][_0x24ab('0x37')]));_0x135ecf['attributes']=_0x135ecf[_0x24ab('0x36')]['length']?_0x135ecf[_0x24ab('0x36')]:_0x1567d7[_0x24ab('0x35')];if(_0x55cb0a[_0x24ab('0x32')][_0x24ab('0x46')]){_0x135ecf[_0x24ab('0x41')]=[{'all':!![]}];}_0x135ecf=_['merge']({},_0x135ecf,_0x55cb0a[_0x24ab('0x40')]);return db['ServicenowConfiguration'][_0x24ab('0x47')](_0x135ecf)[_0x24ab('0x26')](handleEntityNotFound(_0x20472a,null))['then'](respondWithResult(_0x20472a,null))[_0x24ab('0x43')](handleError(_0x20472a,null));};exports[_0x24ab('0x48')]=function(_0x2844be,_0x21e3da){return db[_0x24ab('0x2c')][_0x24ab('0x48')](_0x2844be[_0x24ab('0x49')],{})['then'](respondWithResult(_0x21e3da,0xc9))[_0x24ab('0x43')](handleError(_0x21e3da,null));};exports[_0x24ab('0x25')]=function(_0x4535b4,_0x1ec5ae){if(_0x4535b4[_0x24ab('0x49')]['id']){delete _0x4535b4[_0x24ab('0x49')]['id'];}return db[_0x24ab('0x2c')]['find']({'where':{'id':_0x4535b4[_0x24ab('0x44')]['id']}})[_0x24ab('0x26')](handleEntityNotFound(_0x1ec5ae,null))[_0x24ab('0x26')](saveUpdates(_0x4535b4['body'],null))['then'](respondWithResult(_0x1ec5ae,null))[_0x24ab('0x43')](handleError(_0x1ec5ae,null));};exports[_0x24ab('0x4a')]=function(_0x283e9c,_0x24ad84){return db['ServicenowConfiguration'][_0x24ab('0x47')]({'where':{'id':_0x283e9c[_0x24ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x24ad84,null))['then'](removeEntity(_0x24ad84,null))['catch'](handleError(_0x24ad84,null));};exports[_0x24ab('0x4b')]=function(_0x12a561,_0xb5c89e,_0x4ed92b){var _0x9d5663={};var _0x58930b={};var _0x54e177;var _0x17180e;return db[_0x24ab('0x2c')][_0x24ab('0x4c')]({'where':{'id':_0x12a561[_0x24ab('0x44')]['id']}})[_0x24ab('0x26')](handleEntityNotFound(_0xb5c89e,null))[_0x24ab('0x26')](function(_0x3f4fb4){if(_0x3f4fb4){_0x54e177=_0x3f4fb4;_0x58930b[_0x24ab('0x35')]=_['keys'](db[_0x24ab('0x4d')]['rawAttributes']);_0x58930b[_0x24ab('0x32')]=_[_0x24ab('0x31')](_0x12a561[_0x24ab('0x32')]);_0x58930b[_0x24ab('0x33')]=_['intersection'](_0x58930b[_0x24ab('0x35')],_0x58930b[_0x24ab('0x32')]);_0x9d5663['attributes']=_[_0x24ab('0x34')](_0x58930b[_0x24ab('0x35')],qs[_0x24ab('0x37')](_0x12a561[_0x24ab('0x32')]['fields']));_0x9d5663[_0x24ab('0x36')]=_0x9d5663['attributes'][_0x24ab('0x38')]?_0x9d5663['attributes']:_0x58930b['model'];_0x9d5663[_0x24ab('0x3a')]=qs[_0x24ab('0x4e')](_0x12a561['query'][_0x24ab('0x4e')]);_0x9d5663[_0x24ab('0x3d')]=qs['filters'](_[_0x24ab('0x3b')](_0x12a561['query'],_0x58930b[_0x24ab('0x33')]));if(_0x12a561[_0x24ab('0x32')][_0x24ab('0x3c')]){_0x9d5663['where']=_[_0x24ab('0x3e')](_0x9d5663[_0x24ab('0x3d')],{'$or':_['map'](_0x9d5663[_0x24ab('0x36')],function(_0x53b2f8){var _0x35831e={};_0x35831e[_0x53b2f8]={'$like':'%'+_0x12a561[_0x24ab('0x32')]['filter']+'%'};return _0x35831e;})});}_0x9d5663=_['merge']({},_0x9d5663,_0x12a561['options']);return _0x54e177[_0x24ab('0x4b')](_0x9d5663);}})['then'](function(_0x39daaa){if(_0x39daaa){_0x17180e=_0x39daaa[_0x24ab('0x38')];if(!_0x12a561['query']['hasOwnProperty'](_0x24ab('0x39'))){_0x9d5663[_0x24ab('0x20')]=qs[_0x24ab('0x20')](_0x12a561[_0x24ab('0x32')][_0x24ab('0x20')]);_0x9d5663[_0x24ab('0x1e')]=qs[_0x24ab('0x1e')](_0x12a561[_0x24ab('0x32')]['offset']);}return _0x54e177[_0x24ab('0x4b')](_0x9d5663);}})[_0x24ab('0x26')](function(_0x20c521){if(_0x20c521){return _0x20c521?{'count':_0x17180e,'rows':_0x20c521}:null;}})[_0x24ab('0x26')](respondWithResult(_0xb5c89e,null))[_0x24ab('0x43')](handleError(_0xb5c89e,null));};exports['getSubjects']=function(_0x536c4d,_0x5d6cfc,_0x12715c){var _0x508a1a={};var _0x2b3aa9={};var _0x3754a4;var _0x4aca37;return db[_0x24ab('0x2c')][_0x24ab('0x4c')]({'where':{'id':_0x536c4d[_0x24ab('0x44')]['id']}})[_0x24ab('0x26')](handleEntityNotFound(_0x5d6cfc,null))[_0x24ab('0x26')](function(_0x206867){if(_0x206867){_0x3754a4=_0x206867;_0x2b3aa9['model']=_[_0x24ab('0x31')](db['ServicenowField'][_0x24ab('0x45')]);_0x2b3aa9[_0x24ab('0x32')]=_[_0x24ab('0x31')](_0x536c4d[_0x24ab('0x32')]);_0x2b3aa9[_0x24ab('0x33')]=_[_0x24ab('0x34')](_0x2b3aa9[_0x24ab('0x35')],_0x2b3aa9['query']);_0x508a1a[_0x24ab('0x36')]=_[_0x24ab('0x34')](_0x2b3aa9[_0x24ab('0x35')],qs[_0x24ab('0x37')](_0x536c4d[_0x24ab('0x32')][_0x24ab('0x37')]));_0x508a1a[_0x24ab('0x36')]=_0x508a1a[_0x24ab('0x36')][_0x24ab('0x38')]?_0x508a1a[_0x24ab('0x36')]:_0x2b3aa9[_0x24ab('0x35')];_0x508a1a[_0x24ab('0x3a')]=qs[_0x24ab('0x4e')](_0x536c4d['query'][_0x24ab('0x4e')]);_0x508a1a[_0x24ab('0x3d')]=qs['filters'](_[_0x24ab('0x3b')](_0x536c4d[_0x24ab('0x32')],_0x2b3aa9[_0x24ab('0x33')]));if(_0x536c4d[_0x24ab('0x32')]['filter']){_0x508a1a[_0x24ab('0x3d')]=_[_0x24ab('0x3e')](_0x508a1a['where'],{'$or':_[_0x24ab('0x30')](_0x508a1a[_0x24ab('0x36')],function(_0xcec6f1){var _0x17d59a={};_0x17d59a[_0xcec6f1]={'$like':'%'+_0x536c4d[_0x24ab('0x32')][_0x24ab('0x3c')]+'%'};return _0x17d59a;})});}_0x508a1a=_[_0x24ab('0x3e')]({},_0x508a1a,_0x536c4d[_0x24ab('0x40')]);return _0x3754a4[_0x24ab('0x4f')](_0x508a1a);}})[_0x24ab('0x26')](function(_0x3d680e){if(_0x3d680e){_0x4aca37=_0x3d680e['length'];if(!_0x536c4d[_0x24ab('0x32')][_0x24ab('0x50')](_0x24ab('0x39'))){_0x508a1a['limit']=qs[_0x24ab('0x20')](_0x536c4d[_0x24ab('0x32')]['limit']);_0x508a1a['offset']=qs['offset'](_0x536c4d[_0x24ab('0x32')][_0x24ab('0x1e')]);}return _0x3754a4[_0x24ab('0x4f')](_0x508a1a);}})[_0x24ab('0x26')](function(_0x1c1071){if(_0x1c1071){return _0x1c1071?{'count':_0x4aca37,'rows':_0x1c1071}:null;}})['then'](respondWithResult(_0x5d6cfc,null))[_0x24ab('0x43')](handleError(_0x5d6cfc,null));};exports['getDescriptions']=function(_0x357577,_0x310273,_0x56bb53){var _0x304c5f={};var _0x1f0cbc={};var _0x75a97c;var _0x275354;return db[_0x24ab('0x2c')][_0x24ab('0x4c')]({'where':{'id':_0x357577[_0x24ab('0x44')]['id']}})[_0x24ab('0x26')](handleEntityNotFound(_0x310273,null))['then'](function(_0x2a13ea){if(_0x2a13ea){_0x75a97c=_0x2a13ea;_0x1f0cbc[_0x24ab('0x35')]=_[_0x24ab('0x31')](db['ServicenowField'][_0x24ab('0x45')]);_0x1f0cbc['query']=_[_0x24ab('0x31')](_0x357577['query']);_0x1f0cbc[_0x24ab('0x33')]=_['intersection'](_0x1f0cbc['model'],_0x1f0cbc[_0x24ab('0x32')]);_0x304c5f[_0x24ab('0x36')]=_[_0x24ab('0x34')](_0x1f0cbc[_0x24ab('0x35')],qs[_0x24ab('0x37')](_0x357577['query'][_0x24ab('0x37')]));_0x304c5f[_0x24ab('0x36')]=_0x304c5f['attributes'][_0x24ab('0x38')]?_0x304c5f[_0x24ab('0x36')]:_0x1f0cbc[_0x24ab('0x35')];_0x304c5f[_0x24ab('0x3a')]=qs[_0x24ab('0x4e')](_0x357577[_0x24ab('0x32')][_0x24ab('0x4e')]);_0x304c5f[_0x24ab('0x3d')]=qs[_0x24ab('0x33')](_[_0x24ab('0x3b')](_0x357577[_0x24ab('0x32')],_0x1f0cbc[_0x24ab('0x33')]));if(_0x357577[_0x24ab('0x32')]['filter']){_0x304c5f['where']=_[_0x24ab('0x3e')](_0x304c5f['where'],{'$or':_[_0x24ab('0x30')](_0x304c5f[_0x24ab('0x36')],function(_0xb8922b){var _0x5a2246={};_0x5a2246[_0xb8922b]={'$like':'%'+_0x357577[_0x24ab('0x32')][_0x24ab('0x3c')]+'%'};return _0x5a2246;})});}_0x304c5f=_[_0x24ab('0x3e')]({},_0x304c5f,_0x357577['options']);return _0x75a97c['getDescriptions'](_0x304c5f);}})['then'](function(_0x54cbfb){if(_0x54cbfb){_0x275354=_0x54cbfb[_0x24ab('0x38')];if(!_0x357577[_0x24ab('0x32')][_0x24ab('0x50')](_0x24ab('0x39'))){_0x304c5f[_0x24ab('0x20')]=qs[_0x24ab('0x20')](_0x357577['query'][_0x24ab('0x20')]);_0x304c5f[_0x24ab('0x1e')]=qs[_0x24ab('0x1e')](_0x357577[_0x24ab('0x32')][_0x24ab('0x1e')]);}return _0x75a97c['getDescriptions'](_0x304c5f);}})[_0x24ab('0x26')](function(_0x52a28c){if(_0x52a28c){return _0x52a28c?{'count':_0x275354,'rows':_0x52a28c}:null;}})[_0x24ab('0x26')](respondWithResult(_0x310273,null))[_0x24ab('0x43')](handleError(_0x310273,null));}; \ No newline at end of file +var _0x81d1=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','length','includeAll','find','catch','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x35175a,_0x4c63d7){var _0x3c02ed=function(_0x261fe2){while(--_0x261fe2){_0x35175a['push'](_0x35175a['shift']());}};_0x3c02ed(++_0x4c63d7);}(_0x81d1,0x1bb));var _0x181d=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x81d1[_0xcf581b];return _0x4f454d;};'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(_0x181d('0x0'));var moment=require(_0x181d('0x1'));var BPromise=require(_0x181d('0x2'));var Mustache=require(_0x181d('0x3'));var util=require('util');var path=require(_0x181d('0x4'));var sox=require(_0x181d('0x5'));var csv=require(_0x181d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x181d('0x7'));var squel=require(_0x181d('0x8'));var crypto=require(_0x181d('0x9'));var jsforce=require(_0x181d('0xa'));var deskjs=require(_0x181d('0xb'));var toCsv=require(_0x181d('0x6'));var querystring=require('querystring');var Papa=require(_0x181d('0xc'));var Redis=require(_0x181d('0xd'));var authService=require(_0x181d('0xe'));var qs=require(_0x181d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x181d('0x10'));var logger=require(_0x181d('0x11'))(_0x181d('0x12'));var utils=require(_0x181d('0x13'));var config=require(_0x181d('0x14'));var licenseUtil=require(_0x181d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x577227,_0x33633c){_0x33633c=_0x33633c||0xcc;return function(_0x584be9){if(_0x584be9){return _0x577227[_0x181d('0x16')](_0x33633c);}return _0x577227[_0x181d('0x17')](_0x33633c)[_0x181d('0x18')]();};}function respondWithResult(_0x12e8d6,_0x41bacd){_0x41bacd=_0x41bacd||0xc8;return function(_0x4ed547){if(_0x4ed547){return _0x12e8d6[_0x181d('0x17')](_0x41bacd)[_0x181d('0x19')](_0x4ed547);}};}function respondWithFilteredResult(_0x34e4b1,_0x31bb17){return function(_0xcf8e99){if(_0xcf8e99){var _0x4b74fb=typeof _0x31bb17[_0x181d('0x1a')]===_0x181d('0x1b')&&typeof _0x31bb17['limit']===_0x181d('0x1b');var _0x374012=_0xcf8e99[_0x181d('0x1c')];var _0x111308=_0x4b74fb?0x0:_0x31bb17[_0x181d('0x1a')];var _0xcd655f=_0x4b74fb?_0xcf8e99['count']:_0x31bb17[_0x181d('0x1a')]+_0x31bb17[_0x181d('0x1d')];var _0x2043bc;if(_0xcd655f>=_0x374012){_0xcd655f=_0x374012;_0x2043bc=0xc8;}else{_0x2043bc=0xce;}_0x34e4b1[_0x181d('0x17')](_0x2043bc);return _0x34e4b1[_0x181d('0x1e')](_0x181d('0x1f'),_0x111308+'-'+_0xcd655f+'/'+_0x374012)['json'](_0xcf8e99);}return null;};}function patchUpdates(_0x239bbd){return function(_0x81fd61){try{jsonpatch[_0x181d('0x20')](_0x81fd61,_0x239bbd,!![]);}catch(_0x8e454b){return BPromise['reject'](_0x8e454b);}return _0x81fd61[_0x181d('0x21')]();};}function saveUpdates(_0x56df31,_0x32e2a9){return function(_0x33e204){if(_0x33e204){return _0x33e204[_0x181d('0x22')](_0x56df31)[_0x181d('0x23')](function(_0x1251ca){return _0x1251ca;});}return null;};}function removeEntity(_0x2f457d,_0x4bb384){return function(_0x1a5216){if(_0x1a5216){return _0x1a5216['destroy']()[_0x181d('0x23')](function(){_0x2f457d[_0x181d('0x17')](0xcc)[_0x181d('0x18')]();});}};}function handleEntityNotFound(_0x5cf67a,_0x1b6d3b){return function(_0x56d7e5){if(!_0x56d7e5){_0x5cf67a[_0x181d('0x16')](0x194);}return _0x56d7e5;};}function handleError(_0x15e4fd,_0x162604){_0x162604=_0x162604||0x1f4;return function(_0x274039){logger[_0x181d('0x24')](_0x274039[_0x181d('0x25')]);if(_0x274039['name']){delete _0x274039[_0x181d('0x26')];}_0x15e4fd[_0x181d('0x17')](_0x162604)[_0x181d('0x27')](_0x274039);};}exports[_0x181d('0x28')]=function(_0x26e2da,_0x43b10d){var _0x48a3d5={},_0x3ac622={},_0x1439bf={'count':0x0,'rows':[]};var _0x1b1a01=_[_0x181d('0x29')](db[_0x181d('0x2a')][_0x181d('0x2b')],function(_0x1f15ce){return{'name':_0x1f15ce[_0x181d('0x2c')],'type':_0x1f15ce[_0x181d('0x2d')]['key']};});_0x3ac622[_0x181d('0x2e')]=_[_0x181d('0x29')](_0x1b1a01,_0x181d('0x26'));_0x3ac622[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x26e2da[_0x181d('0x2f')]);_0x3ac622[_0x181d('0x31')]=_[_0x181d('0x32')](_0x3ac622[_0x181d('0x2e')],_0x3ac622[_0x181d('0x2f')]);_0x48a3d5['attributes']=_[_0x181d('0x32')](_0x3ac622[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x33')]));_0x48a3d5[_0x181d('0x34')]=_0x48a3d5[_0x181d('0x34')]['length']?_0x48a3d5[_0x181d('0x34')]:_0x3ac622[_0x181d('0x2e')];if(!_0x26e2da[_0x181d('0x2f')][_0x181d('0x35')](_0x181d('0x36'))){_0x48a3d5['limit']=qs[_0x181d('0x1d')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x1d')]);_0x48a3d5[_0x181d('0x1a')]=qs[_0x181d('0x1a')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x1a')]);}_0x48a3d5[_0x181d('0x37')]=qs[_0x181d('0x38')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x38')]);_0x48a3d5[_0x181d('0x39')]=qs[_0x181d('0x31')](_[_0x181d('0x3a')](_0x26e2da[_0x181d('0x2f')],_0x3ac622[_0x181d('0x31')]),_0x1b1a01);if(_0x26e2da[_0x181d('0x2f')][_0x181d('0x3b')]){_0x48a3d5['where']=_[_0x181d('0x3c')](_0x48a3d5[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0x1b1a01,function(_0x4b57f6){if(_0x4b57f6[_0x181d('0x2d')]!=='VIRTUAL'){var _0x2fcbd3={};_0x2fcbd3[_0x4b57f6[_0x181d('0x26')]]={'$like':'%'+_0x26e2da['query']['filter']+'%'};return _0x2fcbd3;}})});}_0x48a3d5=_['merge']({},_0x48a3d5,_0x26e2da[_0x181d('0x3d')]);var _0x2dbc79={'where':_0x48a3d5[_0x181d('0x39')]};return db[_0x181d('0x2a')][_0x181d('0x1c')](_0x2dbc79)[_0x181d('0x23')](function(_0x144eea){_0x1439bf[_0x181d('0x1c')]=_0x144eea;if(_0x26e2da['query']['includeAll']){_0x48a3d5[_0x181d('0x3e')]=[{'all':!![]}];}return db[_0x181d('0x2a')][_0x181d('0x3f')](_0x48a3d5);})[_0x181d('0x23')](function(_0x38ab77){_0x1439bf[_0x181d('0x40')]=_0x38ab77;return _0x1439bf;})[_0x181d('0x23')](respondWithFilteredResult(_0x43b10d,_0x48a3d5))['catch'](handleError(_0x43b10d,null));};exports['show']=function(_0x578c25,_0xe1fc2d){var _0xfed823={'raw':![],'where':{'id':_0x578c25[_0x181d('0x41')]['id']}},_0x12d076={};_0x12d076['model']=_[_0x181d('0x30')](db[_0x181d('0x2a')]['rawAttributes']);_0x12d076['query']=_[_0x181d('0x30')](_0x578c25[_0x181d('0x2f')]);_0x12d076[_0x181d('0x31')]=_['intersection'](_0x12d076[_0x181d('0x2e')],_0x12d076[_0x181d('0x2f')]);_0xfed823['attributes']=_[_0x181d('0x32')](_0x12d076[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x578c25[_0x181d('0x2f')][_0x181d('0x33')]));_0xfed823[_0x181d('0x34')]=_0xfed823[_0x181d('0x34')][_0x181d('0x42')]?_0xfed823[_0x181d('0x34')]:_0x12d076[_0x181d('0x2e')];if(_0x578c25[_0x181d('0x2f')][_0x181d('0x43')]){_0xfed823[_0x181d('0x3e')]=[{'all':!![]}];}_0xfed823=_[_0x181d('0x3c')]({},_0xfed823,_0x578c25['options']);return db['ServicenowConfiguration'][_0x181d('0x44')](_0xfed823)[_0x181d('0x23')](handleEntityNotFound(_0xe1fc2d,null))[_0x181d('0x23')](respondWithResult(_0xe1fc2d,null))[_0x181d('0x45')](handleError(_0xe1fc2d,null));};exports['create']=function(_0x548ec8,_0x2befca){return db[_0x181d('0x2a')]['create'](_0x548ec8[_0x181d('0x46')],{})['then'](respondWithResult(_0x2befca,0xc9))[_0x181d('0x45')](handleError(_0x2befca,null));};exports[_0x181d('0x22')]=function(_0x145a29,_0x1d0ff8){if(_0x145a29[_0x181d('0x46')]['id']){delete _0x145a29['body']['id'];}return db[_0x181d('0x2a')][_0x181d('0x44')]({'where':{'id':_0x145a29[_0x181d('0x41')]['id']}})[_0x181d('0x23')](handleEntityNotFound(_0x1d0ff8,null))[_0x181d('0x23')](saveUpdates(_0x145a29[_0x181d('0x46')],null))[_0x181d('0x23')](respondWithResult(_0x1d0ff8,null))[_0x181d('0x45')](handleError(_0x1d0ff8,null));};exports[_0x181d('0x47')]=function(_0x2ac178,_0x5e63ea){return db[_0x181d('0x2a')][_0x181d('0x44')]({'where':{'id':_0x2ac178[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e63ea,null))[_0x181d('0x23')](removeEntity(_0x5e63ea,null))[_0x181d('0x45')](handleError(_0x5e63ea,null));};exports[_0x181d('0x48')]=function(_0x4f8cc2,_0x2c809c,_0x3fd267){var _0x177e07={};var _0x1554db={};var _0x76b712;var _0x256e3e;return db[_0x181d('0x2a')][_0x181d('0x49')]({'where':{'id':_0x4f8cc2[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c809c,null))[_0x181d('0x23')](function(_0x2174fa){if(_0x2174fa){_0x76b712=_0x2174fa;_0x1554db['model']=_[_0x181d('0x30')](db[_0x181d('0x4a')][_0x181d('0x2b')]);_0x1554db[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x4f8cc2[_0x181d('0x2f')]);_0x1554db[_0x181d('0x31')]=_[_0x181d('0x32')](_0x1554db[_0x181d('0x2e')],_0x1554db[_0x181d('0x2f')]);_0x177e07[_0x181d('0x34')]=_['intersection'](_0x1554db[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x4f8cc2['query'][_0x181d('0x33')]));_0x177e07[_0x181d('0x34')]=_0x177e07[_0x181d('0x34')][_0x181d('0x42')]?_0x177e07[_0x181d('0x34')]:_0x1554db[_0x181d('0x2e')];_0x177e07['order']=qs[_0x181d('0x38')](_0x4f8cc2[_0x181d('0x2f')]['sort']);_0x177e07[_0x181d('0x39')]=qs[_0x181d('0x31')](_[_0x181d('0x3a')](_0x4f8cc2[_0x181d('0x2f')],_0x1554db[_0x181d('0x31')]));if(_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x3b')]){_0x177e07[_0x181d('0x39')]=_[_0x181d('0x3c')](_0x177e07[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0x177e07[_0x181d('0x34')],function(_0x4b37af){var _0x1d94be={};_0x1d94be[_0x4b37af]={'$like':'%'+_0x4f8cc2['query'][_0x181d('0x3b')]+'%'};return _0x1d94be;})});}_0x177e07=_[_0x181d('0x3c')]({},_0x177e07,_0x4f8cc2[_0x181d('0x3d')]);return _0x76b712[_0x181d('0x48')](_0x177e07);}})[_0x181d('0x23')](function(_0x1c944e){if(_0x1c944e){_0x256e3e=_0x1c944e[_0x181d('0x42')];if(!_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x35')](_0x181d('0x36'))){_0x177e07[_0x181d('0x1d')]=qs[_0x181d('0x1d')](_0x4f8cc2['query'][_0x181d('0x1d')]);_0x177e07['offset']=qs['offset'](_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x1a')]);}return _0x76b712[_0x181d('0x48')](_0x177e07);}})[_0x181d('0x23')](function(_0x26be5f){if(_0x26be5f){return _0x26be5f?{'count':_0x256e3e,'rows':_0x26be5f}:null;}})[_0x181d('0x23')](respondWithResult(_0x2c809c,null))[_0x181d('0x45')](handleError(_0x2c809c,null));};exports['getSubjects']=function(_0xd4186e,_0xeaeda1,_0x4056d1){var _0x374e07={};var _0x56e978={};var _0x1e97b6;var _0x1077c3;return db['ServicenowConfiguration'][_0x181d('0x49')]({'where':{'id':_0xd4186e[_0x181d('0x41')]['id']}})[_0x181d('0x23')](handleEntityNotFound(_0xeaeda1,null))[_0x181d('0x23')](function(_0x5c3e56){if(_0x5c3e56){_0x1e97b6=_0x5c3e56;_0x56e978['model']=_[_0x181d('0x30')](db[_0x181d('0x4a')]['rawAttributes']);_0x56e978[_0x181d('0x2f')]=_[_0x181d('0x30')](_0xd4186e[_0x181d('0x2f')]);_0x56e978[_0x181d('0x31')]=_[_0x181d('0x32')](_0x56e978['model'],_0x56e978[_0x181d('0x2f')]);_0x374e07[_0x181d('0x34')]=_['intersection'](_0x56e978[_0x181d('0x2e')],qs[_0x181d('0x33')](_0xd4186e[_0x181d('0x2f')][_0x181d('0x33')]));_0x374e07[_0x181d('0x34')]=_0x374e07[_0x181d('0x34')][_0x181d('0x42')]?_0x374e07[_0x181d('0x34')]:_0x56e978[_0x181d('0x2e')];_0x374e07[_0x181d('0x37')]=qs['sort'](_0xd4186e[_0x181d('0x2f')]['sort']);_0x374e07[_0x181d('0x39')]=qs['filters'](_[_0x181d('0x3a')](_0xd4186e['query'],_0x56e978[_0x181d('0x31')]));if(_0xd4186e[_0x181d('0x2f')][_0x181d('0x3b')]){_0x374e07[_0x181d('0x39')]=_[_0x181d('0x3c')](_0x374e07[_0x181d('0x39')],{'$or':_['map'](_0x374e07['attributes'],function(_0x117efa){var _0x434639={};_0x434639[_0x117efa]={'$like':'%'+_0xd4186e[_0x181d('0x2f')][_0x181d('0x3b')]+'%'};return _0x434639;})});}_0x374e07=_[_0x181d('0x3c')]({},_0x374e07,_0xd4186e[_0x181d('0x3d')]);return _0x1e97b6[_0x181d('0x4b')](_0x374e07);}})[_0x181d('0x23')](function(_0x139a79){if(_0x139a79){_0x1077c3=_0x139a79['length'];if(!_0xd4186e['query'][_0x181d('0x35')]('nolimit')){_0x374e07['limit']=qs[_0x181d('0x1d')](_0xd4186e['query'][_0x181d('0x1d')]);_0x374e07[_0x181d('0x1a')]=qs[_0x181d('0x1a')](_0xd4186e[_0x181d('0x2f')][_0x181d('0x1a')]);}return _0x1e97b6[_0x181d('0x4b')](_0x374e07);}})[_0x181d('0x23')](function(_0x5482d1){if(_0x5482d1){return _0x5482d1?{'count':_0x1077c3,'rows':_0x5482d1}:null;}})['then'](respondWithResult(_0xeaeda1,null))[_0x181d('0x45')](handleError(_0xeaeda1,null));};exports[_0x181d('0x4c')]=function(_0x133587,_0x3b37dd,_0x114d70){var _0xf2313b={};var _0x5d39c0={};var _0x5a7af2;var _0x6804b9;return db[_0x181d('0x2a')][_0x181d('0x49')]({'where':{'id':_0x133587[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b37dd,null))[_0x181d('0x23')](function(_0x5140ed){if(_0x5140ed){_0x5a7af2=_0x5140ed;_0x5d39c0[_0x181d('0x2e')]=_['keys'](db[_0x181d('0x4a')][_0x181d('0x2b')]);_0x5d39c0[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x133587[_0x181d('0x2f')]);_0x5d39c0[_0x181d('0x31')]=_[_0x181d('0x32')](_0x5d39c0[_0x181d('0x2e')],_0x5d39c0[_0x181d('0x2f')]);_0xf2313b[_0x181d('0x34')]=_['intersection'](_0x5d39c0[_0x181d('0x2e')],qs['fields'](_0x133587['query'][_0x181d('0x33')]));_0xf2313b[_0x181d('0x34')]=_0xf2313b[_0x181d('0x34')][_0x181d('0x42')]?_0xf2313b[_0x181d('0x34')]:_0x5d39c0[_0x181d('0x2e')];_0xf2313b[_0x181d('0x37')]=qs[_0x181d('0x38')](_0x133587['query'][_0x181d('0x38')]);_0xf2313b['where']=qs['filters'](_[_0x181d('0x3a')](_0x133587[_0x181d('0x2f')],_0x5d39c0[_0x181d('0x31')]));if(_0x133587[_0x181d('0x2f')][_0x181d('0x3b')]){_0xf2313b['where']=_[_0x181d('0x3c')](_0xf2313b[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0xf2313b['attributes'],function(_0x11371b){var _0x258229={};_0x258229[_0x11371b]={'$like':'%'+_0x133587[_0x181d('0x2f')]['filter']+'%'};return _0x258229;})});}_0xf2313b=_[_0x181d('0x3c')]({},_0xf2313b,_0x133587[_0x181d('0x3d')]);return _0x5a7af2[_0x181d('0x4c')](_0xf2313b);}})[_0x181d('0x23')](function(_0x32a03e){if(_0x32a03e){_0x6804b9=_0x32a03e[_0x181d('0x42')];if(!_0x133587['query'][_0x181d('0x35')](_0x181d('0x36'))){_0xf2313b[_0x181d('0x1d')]=qs[_0x181d('0x1d')](_0x133587[_0x181d('0x2f')][_0x181d('0x1d')]);_0xf2313b['offset']=qs['offset'](_0x133587[_0x181d('0x2f')]['offset']);}return _0x5a7af2[_0x181d('0x4c')](_0xf2313b);}})[_0x181d('0x23')](function(_0x3663a9){if(_0x3663a9){return _0x3663a9?{'count':_0x6804b9,'rows':_0x3663a9}:null;}})[_0x181d('0x23')](respondWithResult(_0x3b37dd,null))['catch'](handleError(_0x3b37dd,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 782e42f..fe0505e 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 _0x85f8=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5e523f,_0x2b9773){var _0x27697d=function(_0x3efbdc){while(--_0x3efbdc){_0x5e523f['push'](_0x5e523f['shift']());}};_0x27697d(++_0x2b9773);}(_0x85f8,0xd7));var _0x885f=function(_0x12e16e,_0x41c888){_0x12e16e=_0x12e16e-0x0;var _0x422df1=_0x85f8[_0x12e16e];return _0x422df1;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var logger=require(_0x885f('0x2'))(_0x885f('0x3'));var moment=require(_0x885f('0x4'));var BPromise=require(_0x885f('0x5'));var rp=require(_0x885f('0x6'));var fs=require('fs');var path=require(_0x885f('0x7'));var rimraf=require('rimraf');var config=require(_0x885f('0x8'));var attributes=require(_0x885f('0x9'));module[_0x885f('0xa')]=function(_0x52404d,_0x3800c6){return _0x52404d[_0x885f('0xb')](_0x885f('0xc'),attributes,{'tableName':_0x885f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9f=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xad9f,0x1be));var _0xfad9=function(_0x37a5f7,_0x55b45e){_0x37a5f7=_0x37a5f7-0x0;var _0x37c1d2=_0xad9f[_0x37a5f7];return _0x37c1d2;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var logger=require(_0xfad9('0x2'))('api');var moment=require(_0xfad9('0x3'));var BPromise=require(_0xfad9('0x4'));var rp=require(_0xfad9('0x5'));var fs=require('fs');var path=require(_0xfad9('0x6'));var rimraf=require('rimraf');var config=require(_0xfad9('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xfad9('0x8')]=function(_0x24d3fb,_0x19230a){return _0x24d3fb[_0xfad9('0x9')](_0xfad9('0xa'),attributes,{'tableName':_0xfad9('0xb'),'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 435f4ad..4d4bd23 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 _0xdf7c=['error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xdf7c,0x149));var _0xcdf7=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xdf7c[_0x2becba];return _0x90b5dd;};'use strict';var _=require('lodash');var util=require(_0xcdf7('0x0'));var moment=require(_0xcdf7('0x1'));var BPromise=require(_0xcdf7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcdf7('0x3'));var logger=require(_0xcdf7('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcdf7('0x5'));var client=jayson['client'][_0xcdf7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5dffd9,_0x1a3f2f,_0x665e5f){return new BPromise(function(_0x577b07,_0x223a65){return client[_0xcdf7('0x7')](_0x5dffd9,_0x665e5f)[_0xcdf7('0x8')](function(_0x56472d){logger[_0xcdf7('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a3f2f,_0xcdf7('0xa'));logger[_0xcdf7('0xb')](_0xcdf7('0xc'),_0x1a3f2f,_0xcdf7('0xa'),JSON['stringify'](_0x56472d));if(_0x56472d[_0xcdf7('0xd')]){if(_0x56472d[_0xcdf7('0xd')][_0xcdf7('0xe')]===0x1f4){logger[_0xcdf7('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a3f2f,_0x56472d[_0xcdf7('0xd')][_0xcdf7('0xf')]);return _0x223a65(_0x56472d[_0xcdf7('0xd')]['message']);}logger[_0xcdf7('0xd')](_0xcdf7('0x10'),_0x1a3f2f,_0x56472d['error']['message']);return _0x577b07(_0x56472d[_0xcdf7('0xd')][_0xcdf7('0xf')]);}else{logger[_0xcdf7('0x9')](_0xcdf7('0x10'),_0x1a3f2f,_0xcdf7('0xa'));_0x577b07(_0x56472d[_0xcdf7('0x11')]['message']);}})[_0xcdf7('0x12')](function(_0x101d6b){logger[_0xcdf7('0xd')](_0xcdf7('0x10'),_0x1a3f2f,_0x101d6b);_0x223a65(_0x101d6b);});});} \ No newline at end of file +var _0x5100=['ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x5100,0xe8));var _0x0510=function(_0xd4b570,_0x57c71c){_0xd4b570=_0xd4b570-0x0;var _0x44d795=_0x5100[_0xd4b570];return _0x44d795;};'use strict';var _=require('lodash');var util=require(_0x0510('0x0'));var moment=require(_0x0510('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0510('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0510('0x3'));var logger=require(_0x0510('0x4'))('rpc');var config=require(_0x0510('0x5'));var jayson=require(_0x0510('0x6'));var client=jayson['client'][_0x0510('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32d5bf,_0x595a20,_0x46ee92){return new BPromise(function(_0x278a99,_0x29d902){return client[_0x0510('0x8')](_0x32d5bf,_0x46ee92)['then'](function(_0x37e9a5){logger[_0x0510('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x595a20,'request\x20sent');logger['debug'](_0x0510('0xa'),_0x595a20,_0x0510('0xb'),JSON[_0x0510('0xc')](_0x37e9a5));if(_0x37e9a5[_0x0510('0xd')]){if(_0x37e9a5[_0x0510('0xd')][_0x0510('0xe')]===0x1f4){logger[_0x0510('0xd')](_0x0510('0xf'),_0x595a20,_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);return _0x29d902(_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);}logger[_0x0510('0xd')](_0x0510('0xf'),_0x595a20,_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);return _0x278a99(_0x37e9a5[_0x0510('0xd')]['message']);}else{logger[_0x0510('0x9')](_0x0510('0xf'),_0x595a20,_0x0510('0xb'));_0x278a99(_0x37e9a5[_0x0510('0x11')][_0x0510('0x10')]);}})[_0x0510('0x12')](function(_0x2af7d8){logger[_0x0510('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x595a20,_0x2af7d8);_0x29d902(_0x2af7d8);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c761459..e7d2961 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 _0xe724=['get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1dfe43,_0x157872){var _0x5bad11=function(_0x58fdb4){while(--_0x58fdb4){_0x1dfe43['push'](_0x1dfe43['shift']());}};_0x5bad11(++_0x157872);}(_0xe724,0x1cc));var _0x4e72=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xe724[_0x4dbba7];return _0x43ef83;};'use strict';var multer=require(_0x4e72('0x0'));var util=require(_0x4e72('0x1'));var path=require(_0x4e72('0x2'));var timeout=require(_0x4e72('0x3'));var express=require(_0x4e72('0x4'));var router=express[_0x4e72('0x5')]();var fs_extra=require(_0x4e72('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4e72('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x4e72('0x8')]('/',auth[_0x4e72('0x9')](),controller[_0x4e72('0xa')]);router[_0x4e72('0x8')](_0x4e72('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4e72('0xc')]);router[_0x4e72('0xd')]('/:id',auth[_0x4e72('0x9')](),controller[_0x4e72('0xe')]);router[_0x4e72('0xf')]('/:id',auth[_0x4e72('0x9')](),controller[_0x4e72('0x10')]);module[_0x4e72('0x11')]=router; \ No newline at end of file +var _0x9360=['show','create','put','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x5c749e,_0xc1935c){var _0x5ade0a=function(_0x1af038){while(--_0x1af038){_0x5c749e['push'](_0x5c749e['shift']());}};_0x5ade0a(++_0xc1935c);}(_0x9360,0x199));var _0x0936=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9360[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0936('0x0'));var util=require('util');var path=require(_0x0936('0x1'));var timeout=require('connect-timeout');var express=require(_0x0936('0x2'));var router=express[_0x0936('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0936('0x4'));var interaction=require(_0x0936('0x5'));var config=require(_0x0936('0x6'));var controller=require(_0x0936('0x7'));router[_0x0936('0x8')]('/',auth[_0x0936('0x9')](),controller[_0x0936('0xa')]);router[_0x0936('0x8')]('/:id',auth[_0x0936('0x9')](),controller[_0x0936('0xb')]);router['post']('/',auth[_0x0936('0x9')](),controller[_0x0936('0xc')]);router[_0x0936('0xd')]('/:id',auth[_0x0936('0x9')](),controller['update']);router[_0x0936('0xe')]('/:id',auth[_0x0936('0x9')](),controller['destroy']);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 f617701..dc56e48 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 _0x4dcf=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x35c4b7,_0x1a859a){var _0x3eb19a=function(_0x5bcf60){while(--_0x5bcf60){_0x35c4b7['push'](_0x35c4b7['shift']());}};_0x3eb19a(++_0x1a859a);}(_0x4dcf,0x65));var _0xf4dc=function(_0x13f38e,_0x10ecce){_0x13f38e=_0x13f38e-0x0;var _0x2a4b96=_0x4dcf[_0x13f38e];return _0x2a4b96;};'use strict';var Sequelize=require(_0xf4dc('0x0'));module[_0xf4dc('0x1')]={'type':{'type':Sequelize[_0xf4dc('0x2')](_0xf4dc('0x3'),_0xf4dc('0x4'),_0xf4dc('0x5'),_0xf4dc('0x6'),_0xf4dc('0x7')),'defaultValue':_0xf4dc('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf4dc('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xf4dc('0x3'),_0xf4dc('0x4'),_0xf4dc('0x5'))},'keyContent':{'type':Sequelize[_0xf4dc('0x8')]},'idField':{'type':Sequelize[_0xf4dc('0x8')]},'nameField':{'type':Sequelize[_0xf4dc('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf4dc('0x8')]}}; \ No newline at end of file +var _0x2e86=['BOOLEAN','sequelize','ENUM','string','customVariable','picklist','STRING'];(function(_0x1dca40,_0x555000){var _0xaa9bab=function(_0x254de2){while(--_0x254de2){_0x1dca40['push'](_0x1dca40['shift']());}};_0xaa9bab(++_0x555000);}(_0x2e86,0x1cf));var _0x62e8=function(_0x370011,_0x36278c){_0x370011=_0x370011-0x0;var _0x3d76e8=_0x2e86[_0x370011];return _0x3d76e8;};'use strict';var Sequelize=require(_0x62e8('0x0'));module['exports']={'type':{'type':Sequelize[_0x62e8('0x1')](_0x62e8('0x2'),'variable',_0x62e8('0x3'),'keyValue',_0x62e8('0x4')),'defaultValue':_0x62e8('0x2')},'content':{'type':Sequelize[_0x62e8('0x5')]},'key':{'type':Sequelize[_0x62e8('0x5')]},'keyType':{'type':Sequelize[_0x62e8('0x1')](_0x62e8('0x2'),'variable',_0x62e8('0x3'))},'keyContent':{'type':Sequelize[_0x62e8('0x5')]},'idField':{'type':Sequelize[_0x62e8('0x5')]},'nameField':{'type':Sequelize[_0x62e8('0x5')]},'customField':{'type':Sequelize[_0x62e8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x62e8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 340edda..4f38076 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 _0xefbb=['request-promise','moment','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','fields','options','find','create','body','rimraf','zip-dir'];(function(_0x2acd15,_0x15d4c7){var _0x2faaf7=function(_0x1be67c){while(--_0x1be67c){_0x2acd15['push'](_0x2acd15['shift']());}};_0x2faaf7(++_0x15d4c7);}(_0xefbb,0xd3));var _0xbefb=function(_0x4e4fbf,_0x1c3da3){_0x4e4fbf=_0x4e4fbf-0x0;var _0xc79e31=_0xefbb[_0x4e4fbf];return _0xc79e31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbefb('0x0'));var zipdir=require(_0xbefb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbefb('0x2'));var moment=require(_0xbefb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbefb('0x4'));var sox=require('sox');var csv=require(_0xbefb('0x5'));var ejs=require(_0xbefb('0x6'));var fs=require('fs');var fs_extra=require(_0xbefb('0x7'));var _=require('lodash');var squel=require(_0xbefb('0x8'));var crypto=require(_0xbefb('0x9'));var jsforce=require(_0xbefb('0xa'));var deskjs=require(_0xbefb('0xb'));var toCsv=require(_0xbefb('0x5'));var querystring=require(_0xbefb('0xc'));var Papa=require(_0xbefb('0xd'));var Redis=require(_0xbefb('0xe'));var authService=require(_0xbefb('0xf'));var qs=require(_0xbefb('0x10'));var as=require(_0xbefb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbefb('0x12'))('api');var utils=require(_0xbefb('0x13'));var config=require(_0xbefb('0x14'));var licenseUtil=require(_0xbefb('0x15'));var db=require(_0xbefb('0x16'))['db'];function respondWithStatusCode(_0x4c3109,_0x4035df){_0x4035df=_0x4035df||0xcc;return function(_0x3f53ba){if(_0x3f53ba){return _0x4c3109[_0xbefb('0x17')](_0x4035df);}return _0x4c3109['status'](_0x4035df)[_0xbefb('0x18')]();};}function respondWithResult(_0x19a422,_0x327537){_0x327537=_0x327537||0xc8;return function(_0x47a4e1){if(_0x47a4e1){return _0x19a422[_0xbefb('0x19')](_0x327537)[_0xbefb('0x1a')](_0x47a4e1);}};}function respondWithFilteredResult(_0x2a81af,_0x113d52){return function(_0x3ec1c2){if(_0x3ec1c2){var _0x11b136=typeof _0x113d52[_0xbefb('0x1b')]===_0xbefb('0x1c')&&typeof _0x113d52['limit']===_0xbefb('0x1c');var _0x1ef37b=_0x3ec1c2[_0xbefb('0x1d')];var _0x9e2a8c=_0x11b136?0x0:_0x113d52[_0xbefb('0x1b')];var _0x374277=_0x11b136?_0x3ec1c2[_0xbefb('0x1d')]:_0x113d52[_0xbefb('0x1b')]+_0x113d52[_0xbefb('0x1e')];var _0x370982;if(_0x374277>=_0x1ef37b){_0x374277=_0x1ef37b;_0x370982=0xc8;}else{_0x370982=0xce;}_0x2a81af[_0xbefb('0x19')](_0x370982);return _0x2a81af[_0xbefb('0x1f')](_0xbefb('0x20'),_0x9e2a8c+'-'+_0x374277+'/'+_0x1ef37b)['json'](_0x3ec1c2);}return null;};}function patchUpdates(_0x46f624){return function(_0x2aef24){try{jsonpatch[_0xbefb('0x21')](_0x2aef24,_0x46f624,!![]);}catch(_0x4559ff){return BPromise['reject'](_0x4559ff);}return _0x2aef24['save']();};}function saveUpdates(_0x409af6,_0x1c8a41){return function(_0x91073b){if(_0x91073b){return _0x91073b[_0xbefb('0x22')](_0x409af6)[_0xbefb('0x23')](function(_0x1f298b){return _0x1f298b;});}return null;};}function removeEntity(_0x24c56d,_0x33bb1e){return function(_0x4d4f07){if(_0x4d4f07){return _0x4d4f07[_0xbefb('0x24')]()[_0xbefb('0x23')](function(){_0x24c56d[_0xbefb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2608a3,_0x4da2db){return function(_0x54bbe1){if(!_0x54bbe1){_0x2608a3['sendStatus'](0x194);}return _0x54bbe1;};}function handleError(_0x54561e,_0x56051f){_0x56051f=_0x56051f||0x1f4;return function(_0x28e5f8){logger[_0xbefb('0x25')](_0x28e5f8['stack']);if(_0x28e5f8[_0xbefb('0x26')]){delete _0x28e5f8[_0xbefb('0x26')];}_0x54561e[_0xbefb('0x19')](_0x56051f)[_0xbefb('0x27')](_0x28e5f8);};}exports[_0xbefb('0x28')]=function(_0x3bfe14,_0x19b7a6){var _0x22e520={},_0x4faf5e={},_0xc53a0f={'count':0x0,'rows':[]};var _0x2d285a=_[_0xbefb('0x29')](db[_0xbefb('0x2a')][_0xbefb('0x2b')],function(_0x55bd34){return{'name':_0x55bd34[_0xbefb('0x2c')],'type':_0x55bd34['type']['key']};});_0x4faf5e[_0xbefb('0x2d')]=_[_0xbefb('0x29')](_0x2d285a,'name');_0x4faf5e[_0xbefb('0x2e')]=_[_0xbefb('0x2f')](_0x3bfe14[_0xbefb('0x2e')]);_0x4faf5e[_0xbefb('0x30')]=_[_0xbefb('0x31')](_0x4faf5e['model'],_0x4faf5e['query']);_0x22e520[_0xbefb('0x32')]=_[_0xbefb('0x31')](_0x4faf5e['model'],qs['fields'](_0x3bfe14[_0xbefb('0x2e')]['fields']));_0x22e520[_0xbefb('0x32')]=_0x22e520['attributes']['length']?_0x22e520[_0xbefb('0x32')]:_0x4faf5e[_0xbefb('0x2d')];if(!_0x3bfe14[_0xbefb('0x2e')][_0xbefb('0x33')]('nolimit')){_0x22e520[_0xbefb('0x1e')]=qs[_0xbefb('0x1e')](_0x3bfe14['query'][_0xbefb('0x1e')]);_0x22e520[_0xbefb('0x1b')]=qs[_0xbefb('0x1b')](_0x3bfe14['query']['offset']);}_0x22e520[_0xbefb('0x34')]=qs[_0xbefb('0x35')](_0x3bfe14['query']['sort']);_0x22e520[_0xbefb('0x36')]=qs[_0xbefb('0x30')](_[_0xbefb('0x37')](_0x3bfe14[_0xbefb('0x2e')],_0x4faf5e[_0xbefb('0x30')]),_0x2d285a);if(_0x3bfe14['query'][_0xbefb('0x38')]){_0x22e520[_0xbefb('0x36')]=_['merge'](_0x22e520[_0xbefb('0x36')],{'$or':_[_0xbefb('0x29')](_0x2d285a,function(_0x43a7a8){if(_0x43a7a8[_0xbefb('0x39')]!==_0xbefb('0x3a')){var _0x209753={};_0x209753[_0x43a7a8[_0xbefb('0x26')]]={'$like':'%'+_0x3bfe14[_0xbefb('0x2e')]['filter']+'%'};return _0x209753;}})});}_0x22e520=_[_0xbefb('0x3b')]({},_0x22e520,_0x3bfe14['options']);var _0x168cc5={'where':_0x22e520[_0xbefb('0x36')]};return db[_0xbefb('0x2a')]['count'](_0x168cc5)[_0xbefb('0x23')](function(_0x4f51c1){_0xc53a0f[_0xbefb('0x1d')]=_0x4f51c1;if(_0x3bfe14[_0xbefb('0x2e')][_0xbefb('0x3c')]){_0x22e520[_0xbefb('0x3d')]=[{'all':!![]}];}return db[_0xbefb('0x2a')][_0xbefb('0x3e')](_0x22e520);})[_0xbefb('0x23')](function(_0x17b74d){_0xc53a0f[_0xbefb('0x3f')]=_0x17b74d;return _0xc53a0f;})[_0xbefb('0x23')](respondWithFilteredResult(_0x19b7a6,_0x22e520))[_0xbefb('0x40')](handleError(_0x19b7a6,null));};exports['show']=function(_0x44c40b,_0x21c770){var _0x20486f={'raw':!![],'where':{'id':_0x44c40b[_0xbefb('0x41')]['id']}},_0x4350e2={};_0x4350e2[_0xbefb('0x2d')]=_[_0xbefb('0x2f')](db['ServicenowField'][_0xbefb('0x2b')]);_0x4350e2[_0xbefb('0x2e')]=_[_0xbefb('0x2f')](_0x44c40b[_0xbefb('0x2e')]);_0x4350e2[_0xbefb('0x30')]=_['intersection'](_0x4350e2[_0xbefb('0x2d')],_0x4350e2[_0xbefb('0x2e')]);_0x20486f['attributes']=_[_0xbefb('0x31')](_0x4350e2[_0xbefb('0x2d')],qs[_0xbefb('0x42')](_0x44c40b[_0xbefb('0x2e')][_0xbefb('0x42')]));_0x20486f['attributes']=_0x20486f[_0xbefb('0x32')]['length']?_0x20486f['attributes']:_0x4350e2[_0xbefb('0x2d')];if(_0x44c40b[_0xbefb('0x2e')]['includeAll']){_0x20486f['include']=[{'all':!![]}];}_0x20486f=_[_0xbefb('0x3b')]({},_0x20486f,_0x44c40b[_0xbefb('0x43')]);return db[_0xbefb('0x2a')][_0xbefb('0x44')](_0x20486f)['then'](handleEntityNotFound(_0x21c770,null))['then'](respondWithResult(_0x21c770,null))[_0xbefb('0x40')](handleError(_0x21c770,null));};exports[_0xbefb('0x45')]=function(_0x465fb1,_0x4017d0){return db['ServicenowField'][_0xbefb('0x45')](_0x465fb1[_0xbefb('0x46')],{})[_0xbefb('0x23')](respondWithResult(_0x4017d0,0xc9))['catch'](handleError(_0x4017d0,null));};exports[_0xbefb('0x22')]=function(_0x2c9e83,_0x513656){if(_0x2c9e83[_0xbefb('0x46')]['id']){delete _0x2c9e83[_0xbefb('0x46')]['id'];}return db[_0xbefb('0x2a')][_0xbefb('0x44')]({'where':{'id':_0x2c9e83[_0xbefb('0x41')]['id']}})[_0xbefb('0x23')](handleEntityNotFound(_0x513656,null))[_0xbefb('0x23')](saveUpdates(_0x2c9e83['body'],null))['then'](respondWithResult(_0x513656,null))['catch'](handleError(_0x513656,null));};exports['destroy']=function(_0x5b9bd6,_0x1704e1){return db[_0xbefb('0x2a')][_0xbefb('0x44')]({'where':{'id':_0x5b9bd6[_0xbefb('0x41')]['id']}})[_0xbefb('0x23')](handleEntityNotFound(_0x1704e1,null))[_0xbefb('0x23')](removeEntity(_0x1704e1,null))['catch'](handleError(_0x1704e1,null));}; \ No newline at end of file +var _0x79ff=['rows','params','rawAttributes','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','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','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ServicenowField','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x59a927,_0x42de1c){var _0x4fecee=function(_0x1f2543){while(--_0x1f2543){_0x59a927['push'](_0x59a927['shift']());}};_0x4fecee(++_0x42de1c);}(_0x79ff,0xe9));var _0xf79f=function(_0x53b93b,_0x1bfab1){_0x53b93b=_0x53b93b-0x0;var _0x485761=_0x79ff[_0x53b93b];return _0x485761;};'use strict';var emlformat=require(_0xf79f('0x0'));var rimraf=require(_0xf79f('0x1'));var zipdir=require(_0xf79f('0x2'));var jsonpatch=require(_0xf79f('0x3'));var rp=require(_0xf79f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf79f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf79f('0x6'));var csv=require(_0xf79f('0x7'));var ejs=require(_0xf79f('0x8'));var fs=require('fs');var fs_extra=require(_0xf79f('0x9'));var _=require(_0xf79f('0xa'));var squel=require(_0xf79f('0xb'));var crypto=require(_0xf79f('0xc'));var jsforce=require(_0xf79f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf79f('0x7'));var querystring=require(_0xf79f('0xe'));var Papa=require(_0xf79f('0xf'));var Redis=require(_0xf79f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf79f('0x11'));var as=require(_0xf79f('0x12'));var hardwareService=require(_0xf79f('0x13'));var logger=require(_0xf79f('0x14'))(_0xf79f('0x15'));var utils=require(_0xf79f('0x16'));var config=require(_0xf79f('0x17'));var licenseUtil=require(_0xf79f('0x18'));var db=require(_0xf79f('0x19'))['db'];function respondWithStatusCode(_0x4a00f7,_0x1673c0){_0x1673c0=_0x1673c0||0xcc;return function(_0x1cbcb5){if(_0x1cbcb5){return _0x4a00f7[_0xf79f('0x1a')](_0x1673c0);}return _0x4a00f7['status'](_0x1673c0)['end']();};}function respondWithResult(_0x3580f5,_0x35e68c){_0x35e68c=_0x35e68c||0xc8;return function(_0x54f97b){if(_0x54f97b){return _0x3580f5[_0xf79f('0x1b')](_0x35e68c)['json'](_0x54f97b);}};}function respondWithFilteredResult(_0x565593,_0xbd94ac){return function(_0x459d30){if(_0x459d30){var _0x5ed4b9=typeof _0xbd94ac['offset']===_0xf79f('0x1c')&&typeof _0xbd94ac[_0xf79f('0x1d')]===_0xf79f('0x1c');var _0xa9e40=_0x459d30[_0xf79f('0x1e')];var _0x422e4d=_0x5ed4b9?0x0:_0xbd94ac[_0xf79f('0x1f')];var _0x21a4ab=_0x5ed4b9?_0x459d30[_0xf79f('0x1e')]:_0xbd94ac['offset']+_0xbd94ac['limit'];var _0x4fbca8;if(_0x21a4ab>=_0xa9e40){_0x21a4ab=_0xa9e40;_0x4fbca8=0xc8;}else{_0x4fbca8=0xce;}_0x565593['status'](_0x4fbca8);return _0x565593['set']('Content-Range',_0x422e4d+'-'+_0x21a4ab+'/'+_0xa9e40)[_0xf79f('0x20')](_0x459d30);}return null;};}function patchUpdates(_0x5d5c0d){return function(_0x3d17ec){try{jsonpatch[_0xf79f('0x21')](_0x3d17ec,_0x5d5c0d,!![]);}catch(_0x1c531e){return BPromise[_0xf79f('0x22')](_0x1c531e);}return _0x3d17ec[_0xf79f('0x23')]();};}function saveUpdates(_0x18a68e,_0xa00ab4){return function(_0x2335e1){if(_0x2335e1){return _0x2335e1[_0xf79f('0x24')](_0x18a68e)['then'](function(_0x39d902){return _0x39d902;});}return null;};}function removeEntity(_0x5a2ff1,_0x9f9cb9){return function(_0x48ddeb){if(_0x48ddeb){return _0x48ddeb[_0xf79f('0x25')]()[_0xf79f('0x26')](function(){_0x5a2ff1['status'](0xcc)[_0xf79f('0x27')]();});}};}function handleEntityNotFound(_0x4028c8,_0x441e7d){return function(_0x4b6caa){if(!_0x4b6caa){_0x4028c8[_0xf79f('0x1a')](0x194);}return _0x4b6caa;};}function handleError(_0x1d24fd,_0x1b3ab8){_0x1b3ab8=_0x1b3ab8||0x1f4;return function(_0x2ccd45){logger[_0xf79f('0x28')](_0x2ccd45[_0xf79f('0x29')]);if(_0x2ccd45[_0xf79f('0x2a')]){delete _0x2ccd45[_0xf79f('0x2a')];}_0x1d24fd['status'](_0x1b3ab8)[_0xf79f('0x2b')](_0x2ccd45);};}exports[_0xf79f('0x2c')]=function(_0xaad4aa,_0x396d1d){var _0x5e400e={},_0x4ad34b={},_0x3a8f9a={'count':0x0,'rows':[]};var _0x1bfb71=_['map'](db[_0xf79f('0x2d')]['rawAttributes'],function(_0x39f2fd){return{'name':_0x39f2fd['fieldName'],'type':_0x39f2fd[_0xf79f('0x2e')][_0xf79f('0x2f')]};});_0x4ad34b['model']=_[_0xf79f('0x30')](_0x1bfb71,_0xf79f('0x2a'));_0x4ad34b[_0xf79f('0x31')]=_[_0xf79f('0x32')](_0xaad4aa[_0xf79f('0x31')]);_0x4ad34b[_0xf79f('0x33')]=_['intersection'](_0x4ad34b[_0xf79f('0x34')],_0x4ad34b[_0xf79f('0x31')]);_0x5e400e['attributes']=_[_0xf79f('0x35')](_0x4ad34b[_0xf79f('0x34')],qs['fields'](_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x36')]));_0x5e400e['attributes']=_0x5e400e[_0xf79f('0x37')][_0xf79f('0x38')]?_0x5e400e[_0xf79f('0x37')]:_0x4ad34b[_0xf79f('0x34')];if(!_0xaad4aa[_0xf79f('0x31')]['hasOwnProperty']('nolimit')){_0x5e400e['limit']=qs['limit'](_0xaad4aa['query']['limit']);_0x5e400e[_0xf79f('0x1f')]=qs[_0xf79f('0x1f')](_0xaad4aa[_0xf79f('0x31')]['offset']);}_0x5e400e[_0xf79f('0x39')]=qs[_0xf79f('0x3a')](_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x3a')]);_0x5e400e[_0xf79f('0x3b')]=qs[_0xf79f('0x33')](_[_0xf79f('0x3c')](_0xaad4aa[_0xf79f('0x31')],_0x4ad34b[_0xf79f('0x33')]),_0x1bfb71);if(_0xaad4aa['query'][_0xf79f('0x3d')]){_0x5e400e[_0xf79f('0x3b')]=_[_0xf79f('0x3e')](_0x5e400e['where'],{'$or':_[_0xf79f('0x30')](_0x1bfb71,function(_0x53bbbf){if(_0x53bbbf[_0xf79f('0x2e')]!==_0xf79f('0x3f')){var _0x9d6c13={};_0x9d6c13[_0x53bbbf[_0xf79f('0x2a')]]={'$like':'%'+_0xaad4aa[_0xf79f('0x31')]['filter']+'%'};return _0x9d6c13;}})});}_0x5e400e=_[_0xf79f('0x3e')]({},_0x5e400e,_0xaad4aa['options']);var _0xf2ea86={'where':_0x5e400e[_0xf79f('0x3b')]};return db[_0xf79f('0x2d')][_0xf79f('0x1e')](_0xf2ea86)['then'](function(_0x541675){_0x3a8f9a[_0xf79f('0x1e')]=_0x541675;if(_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x40')]){_0x5e400e[_0xf79f('0x41')]=[{'all':!![]}];}return db[_0xf79f('0x2d')][_0xf79f('0x42')](_0x5e400e);})[_0xf79f('0x26')](function(_0x20cbea){_0x3a8f9a[_0xf79f('0x43')]=_0x20cbea;return _0x3a8f9a;})[_0xf79f('0x26')](respondWithFilteredResult(_0x396d1d,_0x5e400e))['catch'](handleError(_0x396d1d,null));};exports['show']=function(_0x5ed5b3,_0x1cb7b5){var _0x115a5e={'raw':!![],'where':{'id':_0x5ed5b3[_0xf79f('0x44')]['id']}},_0xb666fc={};_0xb666fc[_0xf79f('0x34')]=_[_0xf79f('0x32')](db[_0xf79f('0x2d')][_0xf79f('0x45')]);_0xb666fc[_0xf79f('0x31')]=_[_0xf79f('0x32')](_0x5ed5b3[_0xf79f('0x31')]);_0xb666fc[_0xf79f('0x33')]=_['intersection'](_0xb666fc['model'],_0xb666fc[_0xf79f('0x31')]);_0x115a5e[_0xf79f('0x37')]=_[_0xf79f('0x35')](_0xb666fc[_0xf79f('0x34')],qs[_0xf79f('0x36')](_0x5ed5b3['query'][_0xf79f('0x36')]));_0x115a5e[_0xf79f('0x37')]=_0x115a5e[_0xf79f('0x37')]['length']?_0x115a5e[_0xf79f('0x37')]:_0xb666fc[_0xf79f('0x34')];if(_0x5ed5b3[_0xf79f('0x31')][_0xf79f('0x40')]){_0x115a5e[_0xf79f('0x41')]=[{'all':!![]}];}_0x115a5e=_[_0xf79f('0x3e')]({},_0x115a5e,_0x5ed5b3[_0xf79f('0x46')]);return db[_0xf79f('0x2d')][_0xf79f('0x47')](_0x115a5e)[_0xf79f('0x26')](handleEntityNotFound(_0x1cb7b5,null))[_0xf79f('0x26')](respondWithResult(_0x1cb7b5,null))[_0xf79f('0x48')](handleError(_0x1cb7b5,null));};exports[_0xf79f('0x49')]=function(_0x256717,_0x259e33){return db[_0xf79f('0x2d')][_0xf79f('0x49')](_0x256717[_0xf79f('0x4a')],{})[_0xf79f('0x26')](respondWithResult(_0x259e33,0xc9))['catch'](handleError(_0x259e33,null));};exports[_0xf79f('0x24')]=function(_0xd12b8b,_0x55bba8){if(_0xd12b8b['body']['id']){delete _0xd12b8b[_0xf79f('0x4a')]['id'];}return db[_0xf79f('0x2d')]['find']({'where':{'id':_0xd12b8b[_0xf79f('0x44')]['id']}})[_0xf79f('0x26')](handleEntityNotFound(_0x55bba8,null))[_0xf79f('0x26')](saveUpdates(_0xd12b8b[_0xf79f('0x4a')],null))[_0xf79f('0x26')](respondWithResult(_0x55bba8,null))[_0xf79f('0x48')](handleError(_0x55bba8,null));};exports[_0xf79f('0x25')]=function(_0x1f82c9,_0x3262fb){return db['ServicenowField'][_0xf79f('0x47')]({'where':{'id':_0x1f82c9[_0xf79f('0x44')]['id']}})[_0xf79f('0x26')](handleEntityNotFound(_0x3262fb,null))[_0xf79f('0x26')](removeEntity(_0x3262fb,null))[_0xf79f('0x48')](handleError(_0x3262fb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8802eb7..cbbbe79 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 _0x9e05=['exports','ServicenowField','servicenow_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x531c55,_0x3f5d48){var _0x2968f9=function(_0x18f09a){while(--_0x18f09a){_0x531c55['push'](_0x531c55['shift']());}};_0x2968f9(++_0x3f5d48);}(_0x9e05,0x1e5));var _0x59e0=function(_0x576cf9,_0x582741){_0x576cf9=_0x576cf9-0x0;var _0x2ad998=_0x9e05[_0x576cf9];return _0x2ad998;};'use strict';var _=require(_0x59e0('0x0'));var util=require(_0x59e0('0x1'));var logger=require(_0x59e0('0x2'))(_0x59e0('0x3'));var moment=require('moment');var BPromise=require(_0x59e0('0x4'));var rp=require(_0x59e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59e0('0x6'));var config=require(_0x59e0('0x7'));var attributes=require(_0x59e0('0x8'));module[_0x59e0('0x9')]=function(_0x4994d2,_0xa78e99){return _0x4994d2['define'](_0x59e0('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x59e0('0xb'),'fields':[_0x59e0('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc60d=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24ce3f,_0xea9571){var _0x4b5aeb=function(_0x5d0b67){while(--_0x5d0b67){_0x24ce3f['push'](_0x24ce3f['shift']());}};_0x4b5aeb(++_0xea9571);}(_0xc60d,0x1da));var _0xdc60=function(_0x2b6482,_0x95e8a8){_0x2b6482=_0x2b6482-0x0;var _0x53e68f=_0xc60d[_0x2b6482];return _0x53e68f;};'use strict';var _=require(_0xdc60('0x0'));var util=require(_0xdc60('0x1'));var logger=require(_0xdc60('0x2'))(_0xdc60('0x3'));var moment=require(_0xdc60('0x4'));var BPromise=require(_0xdc60('0x5'));var rp=require(_0xdc60('0x6'));var fs=require('fs');var path=require(_0xdc60('0x7'));var rimraf=require(_0xdc60('0x8'));var config=require(_0xdc60('0x9'));var attributes=require(_0xdc60('0xa'));module[_0xdc60('0xb')]=function(_0x5cab52,_0x2be0ed){return _0x5cab52['define']('ServicenowField',attributes,{'tableName':_0xdc60('0xc'),'paranoid':![],'indexes':[{'name':_0xdc60('0xd'),'fields':[_0xdc60('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9d07f6d..9917d3f 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x166a46,_0x1d78bb){var _0x389fa0=function(_0x5c7774){while(--_0x5c7774){_0x166a46['push'](_0x166a46['shift']());}};_0x389fa0(++_0x1d78bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3eefac,_0x2a8cbd){var _0x517b33=function(_0x270553){while(--_0x270553){_0x3eefac['push'](_0x3eefac['shift']());}};_0x517b33(++_0x2a8cbd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e5dbe58..6504683 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(_0xf3a0a1,_0x45618a){var _0x2fabe7=function(_0x359ddb){while(--_0x359ddb){_0xf3a0a1['push'](_0xf3a0a1['shift']());}};_0x2fabe7(++_0x45618a);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x528ce7,_0x3d162d){var _0x361ce8=function(_0x51c5e9){while(--_0x51c5e9){_0x528ce7['push'](_0x528ce7['shift']());}};_0x361ce8(++_0x3d162d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 aa39a9e..780138f 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(_0x3faf87,_0x97216e){var _0x149049=function(_0x327f1f){while(--_0x327f1f){_0x3faf87['push'](_0x3faf87['shift']());}};_0x149049(++_0x97216e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0xab8e6f,_0x3bd054){var _0x146eb0=function(_0x3f7d21){while(--_0x3f7d21){_0xab8e6f['push'](_0xab8e6f['shift']());}};_0x146eb0(++_0x3bd054);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 da13bdc..665882c 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 _0x4bd7=['end','sendStatus','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','getConfigurations','SugarcrmConfiguration','sort','findOne','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','stringify','Calls','values','remove','includes','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','set','Content-Range','json','apply','destroy'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x4bd7,0x13e));var _0x74bd=function(_0x3d66f0,_0x3f4e63){_0x3d66f0=_0x3d66f0-0x0;var _0x4164f3=_0x4bd7[_0x3d66f0];return _0x4164f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74bd('0x0'));var zipdir=require(_0x74bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x74bd('0x2'));var Mustache=require(_0x74bd('0x3'));var util=require('util');var path=require('path');var sox=require(_0x74bd('0x4'));var csv=require(_0x74bd('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74bd('0x6'));var _=require('lodash');var squel=require(_0x74bd('0x7'));var crypto=require(_0x74bd('0x8'));var jsforce=require(_0x74bd('0x9'));var deskjs=require(_0x74bd('0xa'));var toCsv=require(_0x74bd('0x5'));var querystring=require(_0x74bd('0xb'));var Papa=require(_0x74bd('0xc'));var Redis=require(_0x74bd('0xd'));var authService=require(_0x74bd('0xe'));var qs=require(_0x74bd('0xf'));var as=require(_0x74bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x74bd('0x11'));var utils=require(_0x74bd('0x12'));var config=require(_0x74bd('0x13'));var licenseUtil=require(_0x74bd('0x14'));var db=require(_0x74bd('0x15'))['db'];var integrations=require(_0x74bd('0x16'));function respondWithStatusCode(_0x5cefa4,_0x1953ec){_0x1953ec=_0x1953ec||0xcc;return function(_0x3e9fab){if(_0x3e9fab){return _0x5cefa4['sendStatus'](_0x1953ec);}return _0x5cefa4[_0x74bd('0x17')](_0x1953ec)['end']();};}function respondWithResult(_0x5e9cfb,_0x1d4ef1){_0x1d4ef1=_0x1d4ef1||0xc8;return function(_0x247df8){if(_0x247df8){return _0x5e9cfb[_0x74bd('0x17')](_0x1d4ef1)['json'](_0x247df8);}};}function respondWithFilteredResult(_0x1cd189,_0x501a71){return function(_0x5475b5){if(_0x5475b5){var _0x47738a=typeof _0x501a71[_0x74bd('0x18')]==='undefined'&&typeof _0x501a71['limit']===_0x74bd('0x19');var _0x3ce628=_0x5475b5[_0x74bd('0x1a')];var _0x2879bf=_0x47738a?0x0:_0x501a71['offset'];var _0x3c46b3=_0x47738a?_0x5475b5[_0x74bd('0x1a')]:_0x501a71[_0x74bd('0x18')]+_0x501a71[_0x74bd('0x1b')];var _0x2e2102;if(_0x3c46b3>=_0x3ce628){_0x3c46b3=_0x3ce628;_0x2e2102=0xc8;}else{_0x2e2102=0xce;}_0x1cd189[_0x74bd('0x17')](_0x2e2102);return _0x1cd189[_0x74bd('0x1c')](_0x74bd('0x1d'),_0x2879bf+'-'+_0x3c46b3+'/'+_0x3ce628)[_0x74bd('0x1e')](_0x5475b5);}return null;};}function patchUpdates(_0x471eb1){return function(_0x217f3a){try{jsonpatch[_0x74bd('0x1f')](_0x217f3a,_0x471eb1,!![]);}catch(_0x2a5ca6){return BPromise['reject'](_0x2a5ca6);}return _0x217f3a['save']();};}function saveUpdates(_0x5cb03d,_0x5459f6){return function(_0x5c6fcf){if(_0x5c6fcf){return _0x5c6fcf['update'](_0x5cb03d)['then'](function(_0x50dbf){return _0x50dbf;});}return null;};}function removeEntity(_0x142846,_0x2bc91d){return function(_0x51c07e){if(_0x51c07e){return _0x51c07e[_0x74bd('0x20')]()['then'](function(){_0x142846[_0x74bd('0x17')](0xcc)[_0x74bd('0x21')]();});}};}function handleEntityNotFound(_0x1edc86,_0x5b5caf){return function(_0x209489){if(!_0x209489){_0x1edc86[_0x74bd('0x22')](0x194);}return _0x209489;};}function handleError(_0x4a3b67,_0x535a0e){_0x535a0e=_0x535a0e||0x1f4;return function(_0x3c6e0a){logger['error'](_0x3c6e0a[_0x74bd('0x23')]);if(_0x3c6e0a[_0x74bd('0x24')]){delete _0x3c6e0a[_0x74bd('0x24')];}_0x4a3b67[_0x74bd('0x17')](_0x535a0e)[_0x74bd('0x25')](_0x3c6e0a);};}exports[_0x74bd('0x26')]=function(_0x2df036,_0x1d8a51){var _0x5e295d={},_0x4f6853={},_0x3e4055={'count':0x0,'rows':[]};var _0x5be4c3=_['map'](db[_0x74bd('0x27')][_0x74bd('0x28')],function(_0xf60a5c){return{'name':_0xf60a5c[_0x74bd('0x29')],'type':_0xf60a5c[_0x74bd('0x2a')]['key']};});_0x4f6853[_0x74bd('0x2b')]=_[_0x74bd('0x2c')](_0x5be4c3,_0x74bd('0x24'));_0x4f6853[_0x74bd('0x2d')]=_[_0x74bd('0x2e')](_0x2df036['query']);_0x4f6853[_0x74bd('0x2f')]=_[_0x74bd('0x30')](_0x4f6853[_0x74bd('0x2b')],_0x4f6853[_0x74bd('0x2d')]);_0x5e295d[_0x74bd('0x31')]=_['intersection'](_0x4f6853[_0x74bd('0x2b')],qs[_0x74bd('0x32')](_0x2df036['query'][_0x74bd('0x32')]));_0x5e295d[_0x74bd('0x31')]=_0x5e295d[_0x74bd('0x31')][_0x74bd('0x33')]?_0x5e295d[_0x74bd('0x31')]:_0x4f6853[_0x74bd('0x2b')];if(!_0x2df036[_0x74bd('0x2d')][_0x74bd('0x34')](_0x74bd('0x35'))){_0x5e295d[_0x74bd('0x1b')]=qs['limit'](_0x2df036[_0x74bd('0x2d')][_0x74bd('0x1b')]);_0x5e295d[_0x74bd('0x18')]=qs[_0x74bd('0x18')](_0x2df036[_0x74bd('0x2d')]['offset']);}_0x5e295d[_0x74bd('0x36')]=qs['sort'](_0x2df036[_0x74bd('0x2d')]['sort']);_0x5e295d[_0x74bd('0x37')]=qs[_0x74bd('0x2f')](_[_0x74bd('0x38')](_0x2df036[_0x74bd('0x2d')],_0x4f6853[_0x74bd('0x2f')]),_0x5be4c3);if(_0x2df036[_0x74bd('0x2d')][_0x74bd('0x39')]){_0x5e295d['where']=_['merge'](_0x5e295d[_0x74bd('0x37')],{'$or':_[_0x74bd('0x2c')](_0x5be4c3,function(_0x44f86f){if(_0x44f86f[_0x74bd('0x2a')]!==_0x74bd('0x3a')){var _0x522569={};_0x522569[_0x44f86f[_0x74bd('0x24')]]={'$like':'%'+_0x2df036[_0x74bd('0x2d')]['filter']+'%'};return _0x522569;}})});}_0x5e295d=_[_0x74bd('0x3b')]({},_0x5e295d,_0x2df036[_0x74bd('0x3c')]);var _0x50c3a8={'where':_0x5e295d[_0x74bd('0x37')]};return db[_0x74bd('0x27')][_0x74bd('0x1a')](_0x50c3a8)[_0x74bd('0x3d')](function(_0xc8764b){_0x3e4055['count']=_0xc8764b;if(_0x2df036[_0x74bd('0x2d')][_0x74bd('0x3e')]){_0x5e295d[_0x74bd('0x3f')]=[{'all':!![]}];}return db[_0x74bd('0x27')][_0x74bd('0x40')](_0x5e295d);})[_0x74bd('0x3d')](function(_0x49e6ee){_0x3e4055[_0x74bd('0x41')]=_0x49e6ee;return _0x3e4055;})[_0x74bd('0x3d')](respondWithFilteredResult(_0x1d8a51,_0x5e295d))[_0x74bd('0x42')](handleError(_0x1d8a51,null));};exports[_0x74bd('0x43')]=function(_0x1cef1b,_0x35b9e4){var _0x173fb9={'raw':![],'where':{'id':_0x1cef1b['params']['id']}},_0x4e1e61={};_0x4e1e61[_0x74bd('0x2b')]=_[_0x74bd('0x2e')](db[_0x74bd('0x27')]['rawAttributes']);_0x4e1e61[_0x74bd('0x2d')]=_['keys'](_0x1cef1b['query']);_0x4e1e61['filters']=_[_0x74bd('0x30')](_0x4e1e61[_0x74bd('0x2b')],_0x4e1e61[_0x74bd('0x2d')]);_0x173fb9['attributes']=_[_0x74bd('0x30')](_0x4e1e61[_0x74bd('0x2b')],qs[_0x74bd('0x32')](_0x1cef1b['query'][_0x74bd('0x32')]));_0x173fb9[_0x74bd('0x31')]=_0x173fb9[_0x74bd('0x31')][_0x74bd('0x33')]?_0x173fb9[_0x74bd('0x31')]:_0x4e1e61[_0x74bd('0x2b')];if(_0x1cef1b[_0x74bd('0x2d')][_0x74bd('0x3e')]){_0x173fb9['include']=[{'all':!![]}];}_0x173fb9=_[_0x74bd('0x3b')]({},_0x173fb9,_0x1cef1b[_0x74bd('0x3c')]);return db['SugarcrmAccount']['find'](_0x173fb9)[_0x74bd('0x3d')](handleEntityNotFound(_0x35b9e4,null))[_0x74bd('0x3d')](respondWithResult(_0x35b9e4,null))[_0x74bd('0x42')](handleError(_0x35b9e4,null));};exports['create']=function(_0x33fc3f,_0xfbd9b3){return db[_0x74bd('0x27')][_0x74bd('0x44')](_0x33fc3f[_0x74bd('0x45')],{})[_0x74bd('0x3d')](respondWithResult(_0xfbd9b3,0xc9))[_0x74bd('0x42')](handleError(_0xfbd9b3,null));};exports[_0x74bd('0x46')]=function(_0x31b207,_0x2d9dad){if(_0x31b207[_0x74bd('0x45')]['id']){delete _0x31b207['body']['id'];}return db[_0x74bd('0x27')][_0x74bd('0x47')]({'where':{'id':_0x31b207[_0x74bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d9dad,null))[_0x74bd('0x3d')](saveUpdates(_0x31b207['body'],null))[_0x74bd('0x3d')](respondWithResult(_0x2d9dad,null))[_0x74bd('0x42')](handleError(_0x2d9dad,null));};exports[_0x74bd('0x20')]=function(_0xe09846,_0xe9f3cb){return db[_0x74bd('0x27')][_0x74bd('0x47')]({'where':{'id':_0xe09846[_0x74bd('0x48')]['id']}})[_0x74bd('0x3d')](handleEntityNotFound(_0xe9f3cb,null))[_0x74bd('0x3d')](removeEntity(_0xe9f3cb,null))[_0x74bd('0x42')](handleError(_0xe9f3cb,null));};exports[_0x74bd('0x49')]=function(_0x20784b,_0x370f48,_0x5c6f99){var _0xa0e20b={};var _0x58da11={};var _0x4f9aa0;var _0x4f0a70;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x20784b[_0x74bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x370f48,null))[_0x74bd('0x3d')](function(_0xe82916){if(_0xe82916){_0x4f9aa0=_0xe82916;_0x58da11[_0x74bd('0x2b')]=_[_0x74bd('0x2e')](db[_0x74bd('0x4a')]['rawAttributes']);_0x58da11[_0x74bd('0x2d')]=_[_0x74bd('0x2e')](_0x20784b['query']);_0x58da11[_0x74bd('0x2f')]=_[_0x74bd('0x30')](_0x58da11[_0x74bd('0x2b')],_0x58da11[_0x74bd('0x2d')]);_0xa0e20b[_0x74bd('0x31')]=_[_0x74bd('0x30')](_0x58da11[_0x74bd('0x2b')],qs['fields'](_0x20784b[_0x74bd('0x2d')][_0x74bd('0x32')]));_0xa0e20b['attributes']=_0xa0e20b[_0x74bd('0x31')][_0x74bd('0x33')]?_0xa0e20b[_0x74bd('0x31')]:_0x58da11[_0x74bd('0x2b')];_0xa0e20b[_0x74bd('0x36')]=qs[_0x74bd('0x4b')](_0x20784b[_0x74bd('0x2d')][_0x74bd('0x4b')]);_0xa0e20b['where']=qs['filters'](_[_0x74bd('0x38')](_0x20784b[_0x74bd('0x2d')],_0x58da11['filters']));if(_0x20784b['query'][_0x74bd('0x39')]){_0xa0e20b['where']=_[_0x74bd('0x3b')](_0xa0e20b['where'],{'$or':_[_0x74bd('0x2c')](_0xa0e20b[_0x74bd('0x31')],function(_0x163750){var _0x18e8d0={};_0x18e8d0[_0x163750]={'$like':'%'+_0x20784b['query'][_0x74bd('0x39')]+'%'};return _0x18e8d0;})});}_0xa0e20b=_['merge']({},_0xa0e20b,_0x20784b[_0x74bd('0x3c')]);return _0x4f9aa0[_0x74bd('0x49')](_0xa0e20b);}})['then'](function(_0x3716b3){if(_0x3716b3){_0x4f0a70=_0x3716b3[_0x74bd('0x33')];if(!_0x20784b[_0x74bd('0x2d')][_0x74bd('0x34')]('nolimit')){_0xa0e20b[_0x74bd('0x1b')]=qs['limit'](_0x20784b[_0x74bd('0x2d')][_0x74bd('0x1b')]);_0xa0e20b[_0x74bd('0x18')]=qs[_0x74bd('0x18')](_0x20784b[_0x74bd('0x2d')]['offset']);}return _0x4f9aa0[_0x74bd('0x49')](_0xa0e20b);}})[_0x74bd('0x3d')](function(_0x353dc8){if(_0x353dc8){return _0x353dc8?{'count':_0x4f0a70,'rows':_0x353dc8}:null;}})[_0x74bd('0x3d')](respondWithResult(_0x370f48,null))['catch'](handleError(_0x370f48,null));};exports['addConfiguration']=function(_0x4dffba,_0x122d7c,_0x2c0efd){if(_0x4dffba[_0x74bd('0x45')]['id']){delete _0x4dffba['body']['id'];}return db[_0x74bd('0x27')][_0x74bd('0x4c')]({'where':{'id':_0x4dffba[_0x74bd('0x48')]['id']}})[_0x74bd('0x3d')](handleEntityNotFound(_0x122d7c,null))[_0x74bd('0x3d')](function(_0x4d6ba9){if(_0x4d6ba9){_0x4dffba[_0x74bd('0x45')]['AccountId']=_0x4d6ba9['id'];_0x4dffba[_0x74bd('0x45')]['Subjects']=integrations[_0x74bd('0x4d')](_0x4dffba[_0x74bd('0x45')][_0x74bd('0x4e')],_0x4dffba['body'][_0x74bd('0x2a')]);_0x4dffba[_0x74bd('0x45')][_0x74bd('0x4f')]=integrations[_0x74bd('0x50')](_0x4dffba[_0x74bd('0x45')][_0x74bd('0x4e')],_0x4dffba[_0x74bd('0x45')][_0x74bd('0x2a')]);return db[_0x74bd('0x4a')][_0x74bd('0x44')](_0x4dffba[_0x74bd('0x45')],{'include':[{'model':db[_0x74bd('0x51')],'as':'Subjects'},{'model':db[_0x74bd('0x51')],'as':'Descriptions'}]});}return null;})[_0x74bd('0x3d')](respondWithResult(_0x122d7c,null))[_0x74bd('0x42')](handleError(_0x122d7c,null));};exports[_0x74bd('0x52')]=function(_0x789ebc,_0x267a3c,_0x7cfded){var _0x5f2cbf='';var _0x218ba3=['id',_0x74bd('0x24'),_0x74bd('0x53'),_0x74bd('0x54'),'description','date_start','duration_hours',_0x74bd('0x55'),_0x74bd('0x56'),_0x74bd('0x57'),_0x74bd('0x58'),_0x74bd('0x59')];return db[_0x74bd('0x27')]['findOne']({'where':{'id':_0x789ebc[_0x74bd('0x48')]['id']},'attributes':['id',_0x74bd('0x5a'),_0x74bd('0x5b'),_0x74bd('0x5c')]})[_0x74bd('0x3d')](handleEntityNotFound(_0x267a3c,null))[_0x74bd('0x3d')](function(_0x44609c){if(_0x44609c){_0x5f2cbf=_0x44609c[_0x74bd('0x5c')];var _0x16a0f9=_0x5f2cbf[_0x74bd('0x5d')](-0x1);if(_0x16a0f9==='/'){_0x5f2cbf=_0x5f2cbf[_0x74bd('0x5e')](0x0,_0x5f2cbf[_0x74bd('0x5f')](_0x16a0f9));}return rp({'method':'POST','uri':util[_0x74bd('0x60')](_0x74bd('0x61'),_0x5f2cbf,_0x74bd('0x62')),'json':!![],'form':{'method':_0x74bd('0x63'),'input_type':_0x74bd('0x64'),'response_type':_0x74bd('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x44609c['username'],'password':_0x44609c[_0x74bd('0x5b')],'encryption':_0x74bd('0x65')},'application':_0x74bd('0x66')})}});}})[_0x74bd('0x3d')](function(_0x47c628){if(_0x47c628&&_0x47c628[_0x74bd('0x24')]!==_0x74bd('0x67')&&_0x47c628['name']!==_0x74bd('0x68')){return rp({'method':_0x74bd('0x69'),'uri':util[_0x74bd('0x60')](_0x74bd('0x61'),_0x5f2cbf,_0x74bd('0x62')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x74bd('0x64'),'response_type':_0x74bd('0x64'),'rest_data':JSON[_0x74bd('0x6a')]({'session':_0x47c628['id'],'module_name':_0x74bd('0x6b')})}})[_0x74bd('0x3d')](function(_0x4fc259){if(_0x4fc259){var _0x1652a2=_[_0x74bd('0x6c')](_0x4fc259['module_fields']);_[_0x74bd('0x6d')](_0x1652a2,function(_0x9d4c46){return _0x218ba3[_0x74bd('0x6e')](_0x9d4c46[_0x74bd('0x24')]);});return{'count':_0x1652a2[_0x74bd('0x33')],'rows':_[_0x74bd('0x2c')](_0x1652a2,function(_0x564a84){return{'id':_0x564a84[_0x74bd('0x24')],'name':_0x564a84['label'],'custom':_['endsWith'](_0x564a84[_0x74bd('0x24')],'_c')?!![]:![],'options':_0x564a84['options']?_[_0x74bd('0x2c')](_['values'](_0x564a84[_0x74bd('0x3c')]),function(_0x4366d5){return{'name':_0x4366d5[_0x74bd('0x6f')],'value':_0x4366d5['name']};}):[]};})};}})[_0x74bd('0x3d')](respondWithResult(_0x267a3c,null))[_0x74bd('0x42')](function(_0x4c3cdf){var _0xdcaf6c=_0x789ebc[_0x74bd('0x2d')][_0x74bd('0x70')]?0x1f4:_0x4c3cdf[_0x74bd('0x71')]||0x1f4;logger[_0x74bd('0x72')](_0x74bd('0x73'),_0x74bd('0x52'),_0xdcaf6c,JSON['stringify'](_0x4c3cdf));delete _0x4c3cdf[_0x74bd('0x24')];if(_0xdcaf6c===0x191){_0xdcaf6c=0x190;}_0x267a3c[_0x74bd('0x17')](_0xdcaf6c)[_0x74bd('0x25')](_0x789ebc[_0x74bd('0x2d')][_0x74bd('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x4c3cdf['statusCode']}:_0x4c3cdf);});}else{var _0x192711=0x1f4;_0x267a3c[_0x74bd('0x17')](_0x192711)[_0x74bd('0x25')]({'message':_0x74bd('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6de8=['mustache','util','path','sox','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','destroy','getConfigurations','findOne','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','label','endsWith','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','moment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x6de8,0x15f));var _0x86de=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x6de8[_0x43444b];return _0x392fe5;};'use strict';var emlformat=require(_0x86de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86de('0x1'));var rp=require('request-promise');var moment=require(_0x86de('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x86de('0x3'));var util=require(_0x86de('0x4'));var path=require(_0x86de('0x5'));var sox=require(_0x86de('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86de('0x7'));var deskjs=require(_0x86de('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x86de('0x9'));var Redis=require(_0x86de('0xa'));var authService=require(_0x86de('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x86de('0xc'));var hardwareService=require(_0x86de('0xd'));var logger=require(_0x86de('0xe'))(_0x86de('0xf'));var utils=require('../../config/utils');var config=require(_0x86de('0x10'));var licenseUtil=require(_0x86de('0x11'));var db=require(_0x86de('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5c56cb,_0x45f508){_0x45f508=_0x45f508||0xcc;return function(_0x59ab3a){if(_0x59ab3a){return _0x5c56cb[_0x86de('0x13')](_0x45f508);}return _0x5c56cb[_0x86de('0x14')](_0x45f508)[_0x86de('0x15')]();};}function respondWithResult(_0x4134bc,_0x178aab){_0x178aab=_0x178aab||0xc8;return function(_0x2d15c9){if(_0x2d15c9){return _0x4134bc['status'](_0x178aab)[_0x86de('0x16')](_0x2d15c9);}};}function respondWithFilteredResult(_0x44ee65,_0x468805){return function(_0x3ea09a){if(_0x3ea09a){var _0x1f0ef2=typeof _0x468805[_0x86de('0x17')]===_0x86de('0x18')&&typeof _0x468805[_0x86de('0x19')]==='undefined';var _0x90a3ac=_0x3ea09a[_0x86de('0x1a')];var _0x3064a7=_0x1f0ef2?0x0:_0x468805[_0x86de('0x17')];var _0x3453c7=_0x1f0ef2?_0x3ea09a[_0x86de('0x1a')]:_0x468805[_0x86de('0x17')]+_0x468805[_0x86de('0x19')];var _0x36c268;if(_0x3453c7>=_0x90a3ac){_0x3453c7=_0x90a3ac;_0x36c268=0xc8;}else{_0x36c268=0xce;}_0x44ee65[_0x86de('0x14')](_0x36c268);return _0x44ee65[_0x86de('0x1b')](_0x86de('0x1c'),_0x3064a7+'-'+_0x3453c7+'/'+_0x90a3ac)[_0x86de('0x16')](_0x3ea09a);}return null;};}function patchUpdates(_0x58146b){return function(_0x24729d){try{jsonpatch[_0x86de('0x1d')](_0x24729d,_0x58146b,!![]);}catch(_0x5e37ff){return BPromise[_0x86de('0x1e')](_0x5e37ff);}return _0x24729d[_0x86de('0x1f')]();};}function saveUpdates(_0x5904ab,_0x1b8dd0){return function(_0x8ee4d2){if(_0x8ee4d2){return _0x8ee4d2[_0x86de('0x20')](_0x5904ab)[_0x86de('0x21')](function(_0x425cb8){return _0x425cb8;});}return null;};}function removeEntity(_0x373d45,_0x2ef8fd){return function(_0x4bcd5d){if(_0x4bcd5d){return _0x4bcd5d['destroy']()[_0x86de('0x21')](function(){_0x373d45[_0x86de('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bc5d5,_0xe7ad1b){return function(_0x17cf69){if(!_0x17cf69){_0x3bc5d5[_0x86de('0x13')](0x194);}return _0x17cf69;};}function handleError(_0x29143f,_0x194c08){_0x194c08=_0x194c08||0x1f4;return function(_0x4def12){logger['error'](_0x4def12[_0x86de('0x22')]);if(_0x4def12[_0x86de('0x23')]){delete _0x4def12[_0x86de('0x23')];}_0x29143f[_0x86de('0x14')](_0x194c08)[_0x86de('0x24')](_0x4def12);};}exports[_0x86de('0x25')]=function(_0x3f3827,_0x263a9d){var _0x297b04={},_0x291ce2={},_0x474df1={'count':0x0,'rows':[]};var _0x3ef1fd=_['map'](db[_0x86de('0x26')][_0x86de('0x27')],function(_0x45b427){return{'name':_0x45b427[_0x86de('0x28')],'type':_0x45b427[_0x86de('0x29')][_0x86de('0x2a')]};});_0x291ce2[_0x86de('0x2b')]=_[_0x86de('0x2c')](_0x3ef1fd,_0x86de('0x23'));_0x291ce2[_0x86de('0x2d')]=_[_0x86de('0x2e')](_0x3f3827['query']);_0x291ce2[_0x86de('0x2f')]=_[_0x86de('0x30')](_0x291ce2[_0x86de('0x2b')],_0x291ce2['query']);_0x297b04['attributes']=_[_0x86de('0x30')](_0x291ce2[_0x86de('0x2b')],qs[_0x86de('0x31')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x31')]));_0x297b04[_0x86de('0x32')]=_0x297b04[_0x86de('0x32')][_0x86de('0x33')]?_0x297b04['attributes']:_0x291ce2[_0x86de('0x2b')];if(!_0x3f3827['query']['hasOwnProperty'](_0x86de('0x34'))){_0x297b04['limit']=qs[_0x86de('0x19')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x19')]);_0x297b04[_0x86de('0x17')]=qs[_0x86de('0x17')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x17')]);}_0x297b04[_0x86de('0x35')]=qs[_0x86de('0x36')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x36')]);_0x297b04['where']=qs[_0x86de('0x2f')](_[_0x86de('0x37')](_0x3f3827[_0x86de('0x2d')],_0x291ce2[_0x86de('0x2f')]),_0x3ef1fd);if(_0x3f3827[_0x86de('0x2d')][_0x86de('0x38')]){_0x297b04[_0x86de('0x39')]=_['merge'](_0x297b04[_0x86de('0x39')],{'$or':_[_0x86de('0x2c')](_0x3ef1fd,function(_0x9fbf53){if(_0x9fbf53['type']!=='VIRTUAL'){var _0x127ec4={};_0x127ec4[_0x9fbf53[_0x86de('0x23')]]={'$like':'%'+_0x3f3827[_0x86de('0x2d')][_0x86de('0x38')]+'%'};return _0x127ec4;}})});}_0x297b04=_['merge']({},_0x297b04,_0x3f3827[_0x86de('0x3a')]);var _0x333d87={'where':_0x297b04['where']};return db[_0x86de('0x26')][_0x86de('0x1a')](_0x333d87)[_0x86de('0x21')](function(_0x495b6d){_0x474df1[_0x86de('0x1a')]=_0x495b6d;if(_0x3f3827[_0x86de('0x2d')]['includeAll']){_0x297b04[_0x86de('0x3b')]=[{'all':!![]}];}return db[_0x86de('0x26')][_0x86de('0x3c')](_0x297b04);})[_0x86de('0x21')](function(_0x4a1905){_0x474df1[_0x86de('0x3d')]=_0x4a1905;return _0x474df1;})[_0x86de('0x21')](respondWithFilteredResult(_0x263a9d,_0x297b04))[_0x86de('0x3e')](handleError(_0x263a9d,null));};exports[_0x86de('0x3f')]=function(_0x2bc855,_0x3fee5d){var _0x1e2d80={'raw':![],'where':{'id':_0x2bc855[_0x86de('0x40')]['id']}},_0x422c1c={};_0x422c1c[_0x86de('0x2b')]=_[_0x86de('0x2e')](db[_0x86de('0x26')]['rawAttributes']);_0x422c1c[_0x86de('0x2d')]=_[_0x86de('0x2e')](_0x2bc855[_0x86de('0x2d')]);_0x422c1c[_0x86de('0x2f')]=_['intersection'](_0x422c1c['model'],_0x422c1c[_0x86de('0x2d')]);_0x1e2d80[_0x86de('0x32')]=_['intersection'](_0x422c1c['model'],qs[_0x86de('0x31')](_0x2bc855[_0x86de('0x2d')][_0x86de('0x31')]));_0x1e2d80[_0x86de('0x32')]=_0x1e2d80[_0x86de('0x32')][_0x86de('0x33')]?_0x1e2d80[_0x86de('0x32')]:_0x422c1c['model'];if(_0x2bc855[_0x86de('0x2d')][_0x86de('0x41')]){_0x1e2d80[_0x86de('0x3b')]=[{'all':!![]}];}_0x1e2d80=_[_0x86de('0x42')]({},_0x1e2d80,_0x2bc855[_0x86de('0x3a')]);return db[_0x86de('0x26')]['find'](_0x1e2d80)[_0x86de('0x21')](handleEntityNotFound(_0x3fee5d,null))[_0x86de('0x21')](respondWithResult(_0x3fee5d,null))[_0x86de('0x3e')](handleError(_0x3fee5d,null));};exports['create']=function(_0x164d6d,_0x574a83){return db[_0x86de('0x26')][_0x86de('0x43')](_0x164d6d[_0x86de('0x44')],{})[_0x86de('0x21')](respondWithResult(_0x574a83,0xc9))[_0x86de('0x3e')](handleError(_0x574a83,null));};exports[_0x86de('0x20')]=function(_0x3132b5,_0x1e5cdd){if(_0x3132b5[_0x86de('0x44')]['id']){delete _0x3132b5[_0x86de('0x44')]['id'];}return db['SugarcrmAccount'][_0x86de('0x45')]({'where':{'id':_0x3132b5['params']['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x1e5cdd,null))['then'](saveUpdates(_0x3132b5[_0x86de('0x44')],null))[_0x86de('0x21')](respondWithResult(_0x1e5cdd,null))[_0x86de('0x3e')](handleError(_0x1e5cdd,null));};exports[_0x86de('0x46')]=function(_0x12e121,_0x13bff3){return db[_0x86de('0x26')]['find']({'where':{'id':_0x12e121[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x13bff3,null))['then'](removeEntity(_0x13bff3,null))[_0x86de('0x3e')](handleError(_0x13bff3,null));};exports[_0x86de('0x47')]=function(_0x44c89e,_0x41c99a,_0x395d0e){var _0x154b3a={};var _0x38f56f={};var _0x4aa73b;var _0x2fbc9c;return db[_0x86de('0x26')][_0x86de('0x48')]({'where':{'id':_0x44c89e[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x41c99a,null))[_0x86de('0x21')](function(_0x312320){if(_0x312320){_0x4aa73b=_0x312320;_0x38f56f['model']=_[_0x86de('0x2e')](db['SugarcrmConfiguration'][_0x86de('0x27')]);_0x38f56f[_0x86de('0x2d')]=_['keys'](_0x44c89e[_0x86de('0x2d')]);_0x38f56f['filters']=_[_0x86de('0x30')](_0x38f56f[_0x86de('0x2b')],_0x38f56f[_0x86de('0x2d')]);_0x154b3a[_0x86de('0x32')]=_[_0x86de('0x30')](_0x38f56f['model'],qs[_0x86de('0x31')](_0x44c89e[_0x86de('0x2d')][_0x86de('0x31')]));_0x154b3a[_0x86de('0x32')]=_0x154b3a[_0x86de('0x32')][_0x86de('0x33')]?_0x154b3a['attributes']:_0x38f56f[_0x86de('0x2b')];_0x154b3a[_0x86de('0x35')]=qs['sort'](_0x44c89e[_0x86de('0x2d')][_0x86de('0x36')]);_0x154b3a[_0x86de('0x39')]=qs['filters'](_[_0x86de('0x37')](_0x44c89e[_0x86de('0x2d')],_0x38f56f[_0x86de('0x2f')]));if(_0x44c89e[_0x86de('0x2d')][_0x86de('0x38')]){_0x154b3a[_0x86de('0x39')]=_[_0x86de('0x42')](_0x154b3a[_0x86de('0x39')],{'$or':_[_0x86de('0x2c')](_0x154b3a['attributes'],function(_0x29843b){var _0x1cc1d5={};_0x1cc1d5[_0x29843b]={'$like':'%'+_0x44c89e[_0x86de('0x2d')]['filter']+'%'};return _0x1cc1d5;})});}_0x154b3a=_[_0x86de('0x42')]({},_0x154b3a,_0x44c89e[_0x86de('0x3a')]);return _0x4aa73b[_0x86de('0x47')](_0x154b3a);}})[_0x86de('0x21')](function(_0x37ffca){if(_0x37ffca){_0x2fbc9c=_0x37ffca[_0x86de('0x33')];if(!_0x44c89e[_0x86de('0x2d')][_0x86de('0x49')](_0x86de('0x34'))){_0x154b3a['limit']=qs[_0x86de('0x19')](_0x44c89e['query'][_0x86de('0x19')]);_0x154b3a[_0x86de('0x17')]=qs[_0x86de('0x17')](_0x44c89e[_0x86de('0x2d')]['offset']);}return _0x4aa73b[_0x86de('0x47')](_0x154b3a);}})[_0x86de('0x21')](function(_0x4084d6){if(_0x4084d6){return _0x4084d6?{'count':_0x2fbc9c,'rows':_0x4084d6}:null;}})['then'](respondWithResult(_0x41c99a,null))[_0x86de('0x3e')](handleError(_0x41c99a,null));};exports['addConfiguration']=function(_0x5e5d10,_0x5ba0eb,_0x25166a){if(_0x5e5d10[_0x86de('0x44')]['id']){delete _0x5e5d10[_0x86de('0x44')]['id'];}return db[_0x86de('0x26')]['findOne']({'where':{'id':_0x5e5d10[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x5ba0eb,null))['then'](function(_0x4ade04){if(_0x4ade04){_0x5e5d10[_0x86de('0x44')][_0x86de('0x4a')]=_0x4ade04['id'];_0x5e5d10['body']['Subjects']=integrations[_0x86de('0x4b')](_0x5e5d10['body'][_0x86de('0x4c')],_0x5e5d10['body'][_0x86de('0x29')]);_0x5e5d10[_0x86de('0x44')][_0x86de('0x4d')]=integrations[_0x86de('0x4e')](_0x5e5d10['body'][_0x86de('0x4c')],_0x5e5d10['body'][_0x86de('0x29')]);return db[_0x86de('0x4f')]['create'](_0x5e5d10['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x86de('0x50')},{'model':db[_0x86de('0x51')],'as':_0x86de('0x4d')}]});}return null;})[_0x86de('0x21')](respondWithResult(_0x5ba0eb,null))[_0x86de('0x3e')](handleError(_0x5ba0eb,null));};exports[_0x86de('0x52')]=function(_0x5e710f,_0xa9cfdf,_0x4853ec){var _0x127f4b='';var _0x3fcf94=['id','name',_0x86de('0x53'),_0x86de('0x54'),_0x86de('0x55'),_0x86de('0x56'),'duration_hours',_0x86de('0x57'),_0x86de('0x58'),'parent_type','parent_name',_0x86de('0x59')];return db['SugarcrmAccount'][_0x86de('0x48')]({'where':{'id':_0x5e710f[_0x86de('0x40')]['id']},'attributes':['id',_0x86de('0x5a'),_0x86de('0x5b'),'remoteUri']})[_0x86de('0x21')](handleEntityNotFound(_0xa9cfdf,null))[_0x86de('0x21')](function(_0x4a4454){if(_0x4a4454){_0x127f4b=_0x4a4454[_0x86de('0x5c')];var _0xd7a8ae=_0x127f4b[_0x86de('0x5d')](-0x1);if(_0xd7a8ae==='/'){_0x127f4b=_0x127f4b[_0x86de('0x5e')](0x0,_0x127f4b[_0x86de('0x5f')](_0xd7a8ae));}return rp({'method':'POST','uri':util[_0x86de('0x60')](_0x86de('0x61'),_0x127f4b,_0x86de('0x62')),'json':!![],'form':{'method':_0x86de('0x63'),'input_type':_0x86de('0x64'),'response_type':_0x86de('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4a4454[_0x86de('0x5a')],'password':_0x4a4454['password'],'encryption':_0x86de('0x65')},'application':_0x86de('0x66')})}});}})[_0x86de('0x21')](function(_0x520877){if(_0x520877&&_0x520877[_0x86de('0x23')]!==_0x86de('0x67')&&_0x520877[_0x86de('0x23')]!==_0x86de('0x68')){return rp({'method':'POST','uri':util[_0x86de('0x60')](_0x86de('0x61'),_0x127f4b,_0x86de('0x62')),'json':!![],'form':{'method':_0x86de('0x69'),'input_type':_0x86de('0x64'),'response_type':'JSON','rest_data':JSON[_0x86de('0x6a')]({'session':_0x520877['id'],'module_name':_0x86de('0x6b')})}})[_0x86de('0x21')](function(_0x2f6046){if(_0x2f6046){var _0x124b2c=_[_0x86de('0x6c')](_0x2f6046[_0x86de('0x6d')]);_['remove'](_0x124b2c,function(_0x5af8b5){return _0x3fcf94[_0x86de('0x6e')](_0x5af8b5['name']);});return{'count':_0x124b2c[_0x86de('0x33')],'rows':_[_0x86de('0x2c')](_0x124b2c,function(_0x5a8d16){return{'id':_0x5a8d16[_0x86de('0x23')],'name':_0x5a8d16[_0x86de('0x6f')],'custom':_[_0x86de('0x70')](_0x5a8d16[_0x86de('0x23')],'_c')?!![]:![],'options':_0x5a8d16[_0x86de('0x3a')]?_['map'](_[_0x86de('0x6c')](_0x5a8d16['options']),function(_0x52e403){return{'name':_0x52e403['value'],'value':_0x52e403[_0x86de('0x23')]};}):[]};})};}})[_0x86de('0x21')](respondWithResult(_0xa9cfdf,null))['catch'](function(_0x12a0a6){var _0x287a41=_0x5e710f['query'][_0x86de('0x71')]?0x1f4:_0x12a0a6[_0x86de('0x72')]||0x1f4;logger[_0x86de('0x73')](_0x86de('0x74'),'getFields',_0x287a41,JSON['stringify'](_0x12a0a6));delete _0x12a0a6[_0x86de('0x23')];if(_0x287a41===0x191){_0x287a41=0x190;}_0xa9cfdf['status'](_0x287a41)[_0x86de('0x24')](_0x5e710f[_0x86de('0x2d')]['test']?{'message':_0x86de('0x75'),'statusCode':_0x12a0a6[_0x86de('0x72')]}:_0x12a0a6);});}else{var _0x228d5a=0x1f4;_0xa9cfdf[_0x86de('0x14')](_0x228d5a)[_0x86de('0x24')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 9b2c995..efc7de6 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 _0x8886=['bluebird','path','rimraf','../../config/environment','int_sugarcrm_accounts','lodash','util','api','moment'];(function(_0x206cb8,_0x52b4a2){var _0x250455=function(_0x5d1d23){while(--_0x5d1d23){_0x206cb8['push'](_0x206cb8['shift']());}};_0x250455(++_0x52b4a2);}(_0x8886,0xcb));var _0x6888=function(_0x4d625b,_0x137709){_0x4d625b=_0x4d625b-0x0;var _0x59fc32=_0x8886[_0x4d625b];return _0x59fc32;};'use strict';var _=require(_0x6888('0x0'));var util=require(_0x6888('0x1'));var logger=require('../../config/logger')(_0x6888('0x2'));var moment=require(_0x6888('0x3'));var BPromise=require(_0x6888('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6888('0x5'));var rimraf=require(_0x6888('0x6'));var config=require(_0x6888('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3e316d,_0x49681a){return _0x3e316d['define']('SugarcrmAccount',attributes,{'tableName':_0x6888('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe082=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x88f8ca,_0x1e419a){var _0x46f4b1=function(_0x5a21a1){while(--_0x5a21a1){_0x88f8ca['push'](_0x88f8ca['shift']());}};_0x46f4b1(++_0x1e419a);}(_0xe082,0x8f));var _0x2e08=function(_0x47afba,_0x290a9d){_0x47afba=_0x47afba-0x0;var _0x55d7b4=_0xe082[_0x47afba];return _0x55d7b4;};'use strict';var _=require(_0x2e08('0x0'));var util=require(_0x2e08('0x1'));var logger=require(_0x2e08('0x2'))('api');var moment=require(_0x2e08('0x3'));var BPromise=require(_0x2e08('0x4'));var rp=require(_0x2e08('0x5'));var fs=require('fs');var path=require(_0x2e08('0x6'));var rimraf=require(_0x2e08('0x7'));var config=require(_0x2e08('0x8'));var attributes=require(_0x2e08('0x9'));var integrations=require(_0x2e08('0xa'));module[_0x2e08('0xb')]=function(_0x3de149,_0x1036b1){return _0x3de149[_0x2e08('0xc')](_0x2e08('0xd'),attributes,{'tableName':_0x2e08('0xe'),'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 0ea237d..75ddc2c 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 _0x77d8=['map','model','ShowSugarcrmAccount','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0xebbe99,_0x500048){var _0x3eef2a=function(_0x333204){while(--_0x333204){_0xebbe99['push'](_0xebbe99['shift']());}};_0x3eef2a(++_0x500048);}(_0x77d8,0x114));var _0x877d=function(_0x381dbb,_0x4a1419){_0x381dbb=_0x381dbb-0x0;var _0x301378=_0x77d8[_0x381dbb];return _0x301378;};'use strict';var _=require('lodash');var util=require(_0x877d('0x0'));var moment=require('moment');var BPromise=require(_0x877d('0x1'));var rs=require(_0x877d('0x2'));var fs=require('fs');var Redis=require(_0x877d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x877d('0x4'));var logger=require(_0x877d('0x5'))('rpc');var config=require(_0x877d('0x6'));var jayson=require(_0x877d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b579,_0x2e4542,_0x201479){return new BPromise(function(_0xcac35,_0x167642){return client[_0x877d('0x8')](_0x27b579,_0x201479)[_0x877d('0x9')](function(_0x2aa9ca){logger[_0x877d('0xa')](_0x877d('0xb'),_0x2e4542,'request\x20sent');logger[_0x877d('0xc')](_0x877d('0xd'),_0x2e4542,_0x877d('0xe'),JSON[_0x877d('0xf')](_0x2aa9ca));if(_0x2aa9ca[_0x877d('0x10')]){if(_0x2aa9ca[_0x877d('0x10')][_0x877d('0x11')]===0x1f4){logger[_0x877d('0x10')](_0x877d('0xb'),_0x2e4542,_0x2aa9ca['error'][_0x877d('0x12')]);return _0x167642(_0x2aa9ca[_0x877d('0x10')][_0x877d('0x12')]);}logger[_0x877d('0x10')](_0x877d('0xb'),_0x2e4542,_0x2aa9ca['error']['message']);return _0xcac35(_0x2aa9ca[_0x877d('0x10')][_0x877d('0x12')]);}else{logger[_0x877d('0xa')](_0x877d('0xb'),_0x2e4542,_0x877d('0xe'));_0xcac35(_0x2aa9ca[_0x877d('0x13')][_0x877d('0x12')]);}})[_0x877d('0x14')](function(_0x4fdc00){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2e4542,_0x4fdc00);_0x167642(_0x4fdc00);});});}exports[_0x877d('0x15')]=function(_0x65edf9){var _0x4e83a2=this;return new Promise(function(_0x20320c,_0x5e1b83){return db[_0x877d('0x16')][_0x877d('0x17')]({'raw':_0x65edf9[_0x877d('0x18')]?_0x65edf9[_0x877d('0x18')][_0x877d('0x19')]===undefined?!![]:![]:!![],'where':_0x65edf9[_0x877d('0x18')]?_0x65edf9['options'][_0x877d('0x1a')]||null:null,'attributes':_0x65edf9[_0x877d('0x18')]?_0x65edf9[_0x877d('0x18')][_0x877d('0x1b')]||null:null,'limit':_0x65edf9[_0x877d('0x18')]?_0x65edf9[_0x877d('0x18')][_0x877d('0x1c')]||null:null,'include':_0x65edf9['options']?_0x65edf9[_0x877d('0x18')][_0x877d('0x1d')]?_[_0x877d('0x1e')](_0x65edf9[_0x877d('0x18')][_0x877d('0x1d')],function(_0x45ef40){return{'model':db[_0x45ef40['model']],'as':_0x45ef40['as'],'attributes':_0x45ef40[_0x877d('0x1b')],'include':_0x45ef40[_0x877d('0x1d')]?_[_0x877d('0x1e')](_0x45ef40[_0x877d('0x1d')],function(_0x52fdfe){return{'model':db[_0x52fdfe[_0x877d('0x1f')]],'as':_0x52fdfe['as'],'attributes':_0x52fdfe[_0x877d('0x1b')],'include':_0x52fdfe[_0x877d('0x1d')]?_['map'](_0x52fdfe[_0x877d('0x1d')],function(_0x1d1da4){return{'model':db[_0x1d1da4[_0x877d('0x1f')]],'as':_0x1d1da4['as'],'attributes':_0x1d1da4[_0x877d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x877d('0x9')](function(_0x4ed1dc){logger[_0x877d('0xa')](_0x877d('0x15'),_0x65edf9);logger[_0x877d('0xc')](_0x877d('0x15'),_0x65edf9,JSON['stringify'](_0x4ed1dc));_0x20320c(_0x4ed1dc);})[_0x877d('0x14')](function(_0x42784e){logger[_0x877d('0x10')]('GetSugarcrmAccount',_0x42784e[_0x877d('0x12')],_0x65edf9);_0x5e1b83(_0x4e83a2['error'](0x1f4,_0x42784e[_0x877d('0x12')]));});});};exports[_0x877d('0x20')]=function(_0x3c14aa){var _0x2f76d0=this;return new Promise(function(_0x560eeb,_0xa470b5){return db[_0x877d('0x16')][_0x877d('0x21')]({'raw':_0x3c14aa[_0x877d('0x18')]?_0x3c14aa[_0x877d('0x18')][_0x877d('0x19')]===undefined?!![]:![]:!![],'where':_0x3c14aa[_0x877d('0x18')]?_0x3c14aa[_0x877d('0x18')][_0x877d('0x1a')]||null:null,'attributes':_0x3c14aa[_0x877d('0x18')]?_0x3c14aa[_0x877d('0x18')]['attributes']||null:null,'include':_0x3c14aa[_0x877d('0x18')]?_0x3c14aa['options'][_0x877d('0x1d')]?_[_0x877d('0x1e')](_0x3c14aa[_0x877d('0x18')][_0x877d('0x1d')],function(_0x3188c9){return{'model':db[_0x3188c9['model']],'as':_0x3188c9['as'],'attributes':_0x3188c9['attributes'],'include':_0x3188c9[_0x877d('0x1d')]?_[_0x877d('0x1e')](_0x3188c9[_0x877d('0x1d')],function(_0x1afd3d){return{'model':db[_0x1afd3d[_0x877d('0x1f')]],'as':_0x1afd3d['as'],'attributes':_0x1afd3d[_0x877d('0x1b')],'include':_0x1afd3d[_0x877d('0x1d')]?_['map'](_0x1afd3d[_0x877d('0x1d')],function(_0x8e29bd){return{'model':db[_0x8e29bd[_0x877d('0x1f')]],'as':_0x8e29bd['as'],'attributes':_0x8e29bd[_0x877d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c7f58){logger[_0x877d('0xa')](_0x877d('0x20'),_0x3c14aa);logger[_0x877d('0xc')]('ShowSugarcrmAccount',_0x3c14aa,JSON[_0x877d('0xf')](_0x5c7f58));_0x560eeb(_0x5c7f58);})['catch'](function(_0x571f7b){logger[_0x877d('0x10')](_0x877d('0x20'),_0x571f7b['message'],_0x3c14aa);_0xa470b5(_0x2f76d0[_0x877d('0x10')](0x1f4,_0x571f7b[_0x877d('0x12')]));});});}; \ No newline at end of file +var _0xc99a=['info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xe5d511,_0x9d9cdf){var _0x142b83=function(_0x3d32df){while(--_0x3d32df){_0xe5d511['push'](_0xe5d511['shift']());}};_0x142b83(++_0x9d9cdf);}(_0xc99a,0x12e));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xac99('0x0'));var moment=require('moment');var BPromise=require(_0xac99('0x1'));var rs=require(_0xac99('0x2'));var fs=require('fs');var Redis=require(_0xac99('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac99('0x4'));var logger=require(_0xac99('0x5'))(_0xac99('0x6'));var config=require(_0xac99('0x7'));var jayson=require(_0xac99('0x8'));var client=jayson[_0xac99('0x9')][_0xac99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f2b15,_0x5f58de,_0x5822ff){return new BPromise(function(_0x32be79,_0x4fd313){return client[_0xac99('0xb')](_0x5f2b15,_0x5822ff)[_0xac99('0xc')](function(_0x69f56f){logger[_0xac99('0xd')](_0xac99('0xe'),_0x5f58de,'request\x20sent');logger['debug'](_0xac99('0xf'),_0x5f58de,'request\x20sent',JSON[_0xac99('0x10')](_0x69f56f));if(_0x69f56f[_0xac99('0x11')]){if(_0x69f56f[_0xac99('0x11')][_0xac99('0x12')]===0x1f4){logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x69f56f[_0xac99('0x11')][_0xac99('0x13')]);return _0x4fd313(_0x69f56f[_0xac99('0x11')]['message']);}logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x69f56f['error']['message']);return _0x32be79(_0x69f56f['error'][_0xac99('0x13')]);}else{logger[_0xac99('0xd')](_0xac99('0xe'),_0x5f58de,_0xac99('0x14'));_0x32be79(_0x69f56f['result'][_0xac99('0x13')]);}})[_0xac99('0x15')](function(_0x226a55){logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x226a55);_0x4fd313(_0x226a55);});});}exports[_0xac99('0x16')]=function(_0x480a98){var _0x17a202=this;return new Promise(function(_0x3ccec2,_0x29c9e2){return db[_0xac99('0x17')]['findAll']({'raw':_0x480a98[_0xac99('0x18')]?_0x480a98[_0xac99('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x480a98['options']?_0x480a98[_0xac99('0x18')][_0xac99('0x19')]||null:null,'attributes':_0x480a98['options']?_0x480a98[_0xac99('0x18')][_0xac99('0x1a')]||null:null,'limit':_0x480a98[_0xac99('0x18')]?_0x480a98[_0xac99('0x18')][_0xac99('0x1b')]||null:null,'include':_0x480a98['options']?_0x480a98['options']['include']?_['map'](_0x480a98[_0xac99('0x18')][_0xac99('0x1c')],function(_0x2ea103){return{'model':db[_0x2ea103['model']],'as':_0x2ea103['as'],'attributes':_0x2ea103['attributes'],'include':_0x2ea103[_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x2ea103['include'],function(_0x236184){return{'model':db[_0x236184['model']],'as':_0x236184['as'],'attributes':_0x236184[_0xac99('0x1a')],'include':_0x236184['include']?_[_0xac99('0x1d')](_0x236184[_0xac99('0x1c')],function(_0x2457df){return{'model':db[_0x2457df[_0xac99('0x1e')]],'as':_0x2457df['as'],'attributes':_0x2457df[_0xac99('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xac99('0xc')](function(_0x229ad3){logger['info'](_0xac99('0x16'),_0x480a98);logger[_0xac99('0x1f')](_0xac99('0x16'),_0x480a98,JSON[_0xac99('0x10')](_0x229ad3));_0x3ccec2(_0x229ad3);})['catch'](function(_0xa25bc5){logger[_0xac99('0x11')](_0xac99('0x16'),_0xa25bc5['message'],_0x480a98);_0x29c9e2(_0x17a202[_0xac99('0x11')](0x1f4,_0xa25bc5['message']));});});};exports[_0xac99('0x20')]=function(_0x3d35a7){var _0x8f996e=this;return new Promise(function(_0x5359d2,_0x1a897e){return db['SugarcrmAccount'][_0xac99('0x21')]({'raw':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7[_0xac99('0x18')][_0xac99('0x22')]===undefined?!![]:![]:!![],'where':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7['options'][_0xac99('0x19')]||null:null,'attributes':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7[_0xac99('0x18')][_0xac99('0x1a')]||null:null,'include':_0x3d35a7['options']?_0x3d35a7[_0xac99('0x18')][_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x3d35a7[_0xac99('0x18')][_0xac99('0x1c')],function(_0x2e173f){return{'model':db[_0x2e173f['model']],'as':_0x2e173f['as'],'attributes':_0x2e173f[_0xac99('0x1a')],'include':_0x2e173f[_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x2e173f['include'],function(_0x53b9af){return{'model':db[_0x53b9af[_0xac99('0x1e')]],'as':_0x53b9af['as'],'attributes':_0x53b9af[_0xac99('0x1a')],'include':_0x53b9af['include']?_[_0xac99('0x1d')](_0x53b9af[_0xac99('0x1c')],function(_0xfbc078){return{'model':db[_0xfbc078[_0xac99('0x1e')]],'as':_0xfbc078['as'],'attributes':_0xfbc078[_0xac99('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xac99('0xc')](function(_0xb8699d){logger[_0xac99('0xd')](_0xac99('0x20'),_0x3d35a7);logger[_0xac99('0x1f')](_0xac99('0x20'),_0x3d35a7,JSON[_0xac99('0x10')](_0xb8699d));_0x5359d2(_0xb8699d);})['catch'](function(_0x516151){logger[_0xac99('0x11')](_0xac99('0x20'),_0x516151['message'],_0x3d35a7);_0x1a897e(_0x8f996e[_0xac99('0x11')](0x1f4,_0x516151[_0xac99('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ec9fcb2..4099bd2 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 _0x1190=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0x1190,0x101));var _0x0119=function(_0x53b54f,_0x42d8b6){_0x53b54f=_0x53b54f-0x0;var _0x1b05bf=_0x1190[_0x53b54f];return _0x1b05bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0119('0x0'));var timeout=require(_0x0119('0x1'));var express=require(_0x0119('0x2'));var router=express[_0x0119('0x3')]();var fs_extra=require(_0x0119('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0119('0x5'));var config=require(_0x0119('0x6'));var controller=require(_0x0119('0x7'));router[_0x0119('0x8')]('/',auth[_0x0119('0x9')](),controller[_0x0119('0xa')]);router[_0x0119('0x8')](_0x0119('0xb'),auth[_0x0119('0x9')](),controller[_0x0119('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x0119('0xd')]);router[_0x0119('0x8')](_0x0119('0xe'),auth[_0x0119('0x9')](),controller[_0x0119('0xf')]);router[_0x0119('0x8')](_0x0119('0x10'),auth[_0x0119('0x9')](),controller[_0x0119('0x11')]);router[_0x0119('0x12')]('/',auth[_0x0119('0x9')](),controller['create']);router['put'](_0x0119('0xb'),auth[_0x0119('0x9')](),controller[_0x0119('0x13')]);router[_0x0119('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0119('0x15')]);module[_0x0119('0x16')]=router; \ No newline at end of file +var _0x233b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x233b,0xa9));var _0xb233=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x233b[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var path=require(_0xb233('0x2'));var timeout=require(_0xb233('0x3'));var express=require(_0xb233('0x4'));var router=express[_0xb233('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb233('0x6'));var interaction=require(_0xb233('0x7'));var config=require(_0xb233('0x8'));var controller=require(_0xb233('0x9'));router['get']('/',auth[_0xb233('0xa')](),controller[_0xb233('0xb')]);router[_0xb233('0xc')](_0xb233('0xd'),auth[_0xb233('0xa')](),controller[_0xb233('0xe')]);router['get'](_0xb233('0xf'),auth[_0xb233('0xa')](),controller[_0xb233('0x10')]);router[_0xb233('0xc')]('/:id/subjects',auth[_0xb233('0xa')](),controller[_0xb233('0x11')]);router['get'](_0xb233('0x12'),auth[_0xb233('0xa')](),controller['getDescriptions']);router[_0xb233('0x13')]('/',auth[_0xb233('0xa')](),controller[_0xb233('0x14')]);router[_0xb233('0x15')](_0xb233('0xd'),auth[_0xb233('0xa')](),controller[_0xb233('0x16')]);router[_0xb233('0x17')](_0xb233('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb233('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 62cd0d7..a42f8f3 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 _0xfb35=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb35,0x1dd));var _0x5fb3=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xfb35[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0x5fb3('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fb3('0x1')]},'description':{'type':Sequelize[_0x5fb3('0x1')]}}; \ No newline at end of file +var _0x1ef2=['STRING','sequelize','exports'];(function(_0xfbb805,_0x594b78){var _0x272f35=function(_0x2d4c02){while(--_0x2d4c02){_0xfbb805['push'](_0xfbb805['shift']());}};_0x272f35(++_0x594b78);}(_0x1ef2,0x1a8));var _0x21ef=function(_0xb292f9,_0x42a4bc){_0xb292f9=_0xb292f9-0x0;var _0x366dab=_0x1ef2[_0xb292f9];return _0x366dab;};'use strict';var Sequelize=require(_0x21ef('0x0'));module[_0x21ef('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2befbdd..53b7dec 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 _0x59b1=['end','error','stack','name','index','map','SugarcrmConfiguration','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','catch','rawAttributes','length','include','find','create','body','params','findOne','SugarcrmField','order','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then'];(function(_0x54016f,_0x34d5c5){var _0x3ee2b8=function(_0x344f00){while(--_0x344f00){_0x54016f['push'](_0x54016f['shift']());}};_0x3ee2b8(++_0x34d5c5);}(_0x59b1,0x71));var _0x159b=function(_0x47f76b,_0x25cf72){_0x47f76b=_0x47f76b-0x0;var _0x3bcec8=_0x59b1[_0x47f76b];return _0x3bcec8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x159b('0x0'));var jsonpatch=require(_0x159b('0x1'));var rp=require(_0x159b('0x2'));var moment=require(_0x159b('0x3'));var BPromise=require(_0x159b('0x4'));var Mustache=require(_0x159b('0x5'));var util=require('util');var path=require(_0x159b('0x6'));var sox=require(_0x159b('0x7'));var csv=require(_0x159b('0x8'));var ejs=require(_0x159b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x159b('0xa'));var squel=require('squel');var crypto=require(_0x159b('0xb'));var jsforce=require(_0x159b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x159b('0x8'));var querystring=require(_0x159b('0xd'));var Papa=require(_0x159b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x159b('0xf'));var hardwareService=require(_0x159b('0x10'));var logger=require(_0x159b('0x11'))(_0x159b('0x12'));var utils=require(_0x159b('0x13'));var config=require(_0x159b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x159b('0x15'))['db'];function respondWithStatusCode(_0x239d43,_0x53bc02){_0x53bc02=_0x53bc02||0xcc;return function(_0x254b8c){if(_0x254b8c){return _0x239d43[_0x159b('0x16')](_0x53bc02);}return _0x239d43[_0x159b('0x17')](_0x53bc02)['end']();};}function respondWithResult(_0x51db97,_0x504425){_0x504425=_0x504425||0xc8;return function(_0x15806e){if(_0x15806e){return _0x51db97[_0x159b('0x17')](_0x504425)[_0x159b('0x18')](_0x15806e);}};}function respondWithFilteredResult(_0xec95fc,_0x23fd14){return function(_0x1b0c2d){if(_0x1b0c2d){var _0x53d959=typeof _0x23fd14[_0x159b('0x19')]===_0x159b('0x1a')&&typeof _0x23fd14[_0x159b('0x1b')]==='undefined';var _0x2bf1eb=_0x1b0c2d[_0x159b('0x1c')];var _0x50b1dd=_0x53d959?0x0:_0x23fd14['offset'];var _0x1dc721=_0x53d959?_0x1b0c2d['count']:_0x23fd14['offset']+_0x23fd14[_0x159b('0x1b')];var _0x2bc0d3;if(_0x1dc721>=_0x2bf1eb){_0x1dc721=_0x2bf1eb;_0x2bc0d3=0xc8;}else{_0x2bc0d3=0xce;}_0xec95fc[_0x159b('0x17')](_0x2bc0d3);return _0xec95fc[_0x159b('0x1d')]('Content-Range',_0x50b1dd+'-'+_0x1dc721+'/'+_0x2bf1eb)[_0x159b('0x18')](_0x1b0c2d);}return null;};}function patchUpdates(_0x279db5){return function(_0x229a87){try{jsonpatch[_0x159b('0x1e')](_0x229a87,_0x279db5,!![]);}catch(_0x2628c6){return BPromise[_0x159b('0x1f')](_0x2628c6);}return _0x229a87['save']();};}function saveUpdates(_0x52fe2d,_0x451443){return function(_0x5ba976){if(_0x5ba976){return _0x5ba976[_0x159b('0x20')](_0x52fe2d)['then'](function(_0x3b9408){return _0x3b9408;});}return null;};}function removeEntity(_0x30b277,_0x483b05){return function(_0xd252b3){if(_0xd252b3){return _0xd252b3[_0x159b('0x21')]()[_0x159b('0x22')](function(){_0x30b277[_0x159b('0x17')](0xcc)[_0x159b('0x23')]();});}};}function handleEntityNotFound(_0x186e80,_0x4c3042){return function(_0x284ec3){if(!_0x284ec3){_0x186e80[_0x159b('0x16')](0x194);}return _0x284ec3;};}function handleError(_0x26c7f7,_0x593c43){_0x593c43=_0x593c43||0x1f4;return function(_0x173224){logger[_0x159b('0x24')](_0x173224[_0x159b('0x25')]);if(_0x173224[_0x159b('0x26')]){delete _0x173224[_0x159b('0x26')];}_0x26c7f7[_0x159b('0x17')](_0x593c43)['send'](_0x173224);};}exports[_0x159b('0x27')]=function(_0x4fd3e5,_0x32ea74){var _0x481cad={},_0x546c2b={},_0x3ffaf3={'count':0x0,'rows':[]};var _0x295cf9=_[_0x159b('0x28')](db[_0x159b('0x29')]['rawAttributes'],function(_0x111abd){return{'name':_0x111abd['fieldName'],'type':_0x111abd[_0x159b('0x2a')][_0x159b('0x2b')]};});_0x546c2b[_0x159b('0x2c')]=_['map'](_0x295cf9,_0x159b('0x26'));_0x546c2b[_0x159b('0x2d')]=_[_0x159b('0x2e')](_0x4fd3e5['query']);_0x546c2b[_0x159b('0x2f')]=_['intersection'](_0x546c2b[_0x159b('0x2c')],_0x546c2b[_0x159b('0x2d')]);_0x481cad[_0x159b('0x30')]=_[_0x159b('0x31')](_0x546c2b[_0x159b('0x2c')],qs[_0x159b('0x32')](_0x4fd3e5[_0x159b('0x2d')][_0x159b('0x32')]));_0x481cad[_0x159b('0x30')]=_0x481cad[_0x159b('0x30')]['length']?_0x481cad[_0x159b('0x30')]:_0x546c2b['model'];if(!_0x4fd3e5[_0x159b('0x2d')][_0x159b('0x33')](_0x159b('0x34'))){_0x481cad[_0x159b('0x1b')]=qs[_0x159b('0x1b')](_0x4fd3e5[_0x159b('0x2d')][_0x159b('0x1b')]);_0x481cad[_0x159b('0x19')]=qs[_0x159b('0x19')](_0x4fd3e5['query'][_0x159b('0x19')]);}_0x481cad['order']=qs[_0x159b('0x35')](_0x4fd3e5[_0x159b('0x2d')][_0x159b('0x35')]);_0x481cad[_0x159b('0x36')]=qs[_0x159b('0x2f')](_[_0x159b('0x37')](_0x4fd3e5['query'],_0x546c2b[_0x159b('0x2f')]),_0x295cf9);if(_0x4fd3e5[_0x159b('0x2d')]['filter']){_0x481cad['where']=_[_0x159b('0x38')](_0x481cad[_0x159b('0x36')],{'$or':_[_0x159b('0x28')](_0x295cf9,function(_0x2952e7){if(_0x2952e7['type']!=='VIRTUAL'){var _0x20acea={};_0x20acea[_0x2952e7['name']]={'$like':'%'+_0x4fd3e5['query'][_0x159b('0x39')]+'%'};return _0x20acea;}})});}_0x481cad=_['merge']({},_0x481cad,_0x4fd3e5[_0x159b('0x3a')]);var _0x19b989={'where':_0x481cad[_0x159b('0x36')]};return db[_0x159b('0x29')][_0x159b('0x1c')](_0x19b989)[_0x159b('0x22')](function(_0x52c71b){_0x3ffaf3['count']=_0x52c71b;if(_0x4fd3e5[_0x159b('0x2d')][_0x159b('0x3b')]){_0x481cad['include']=[{'all':!![]}];}return db[_0x159b('0x29')][_0x159b('0x3c')](_0x481cad);})[_0x159b('0x22')](function(_0x4b4d40){_0x3ffaf3['rows']=_0x4b4d40;return _0x3ffaf3;})[_0x159b('0x22')](respondWithFilteredResult(_0x32ea74,_0x481cad))[_0x159b('0x3d')](handleError(_0x32ea74,null));};exports['show']=function(_0x4e2ece,_0x2bc0f3){var _0x14b4f0={'raw':![],'where':{'id':_0x4e2ece['params']['id']}},_0x1e4ba6={};_0x1e4ba6[_0x159b('0x2c')]=_[_0x159b('0x2e')](db[_0x159b('0x29')][_0x159b('0x3e')]);_0x1e4ba6['query']=_[_0x159b('0x2e')](_0x4e2ece[_0x159b('0x2d')]);_0x1e4ba6[_0x159b('0x2f')]=_['intersection'](_0x1e4ba6[_0x159b('0x2c')],_0x1e4ba6['query']);_0x14b4f0['attributes']=_[_0x159b('0x31')](_0x1e4ba6[_0x159b('0x2c')],qs[_0x159b('0x32')](_0x4e2ece[_0x159b('0x2d')][_0x159b('0x32')]));_0x14b4f0[_0x159b('0x30')]=_0x14b4f0[_0x159b('0x30')][_0x159b('0x3f')]?_0x14b4f0['attributes']:_0x1e4ba6[_0x159b('0x2c')];if(_0x4e2ece[_0x159b('0x2d')][_0x159b('0x3b')]){_0x14b4f0[_0x159b('0x40')]=[{'all':!![]}];}_0x14b4f0=_['merge']({},_0x14b4f0,_0x4e2ece[_0x159b('0x3a')]);return db[_0x159b('0x29')][_0x159b('0x41')](_0x14b4f0)[_0x159b('0x22')](handleEntityNotFound(_0x2bc0f3,null))[_0x159b('0x22')](respondWithResult(_0x2bc0f3,null))['catch'](handleError(_0x2bc0f3,null));};exports[_0x159b('0x42')]=function(_0x1f535d,_0x164851){return db[_0x159b('0x29')][_0x159b('0x42')](_0x1f535d[_0x159b('0x43')],{})[_0x159b('0x22')](respondWithResult(_0x164851,0xc9))[_0x159b('0x3d')](handleError(_0x164851,null));};exports[_0x159b('0x20')]=function(_0x6df90f,_0x24d869){if(_0x6df90f[_0x159b('0x43')]['id']){delete _0x6df90f['body']['id'];}return db[_0x159b('0x29')][_0x159b('0x41')]({'where':{'id':_0x6df90f['params']['id']}})['then'](handleEntityNotFound(_0x24d869,null))[_0x159b('0x22')](saveUpdates(_0x6df90f['body'],null))['then'](respondWithResult(_0x24d869,null))[_0x159b('0x3d')](handleError(_0x24d869,null));};exports[_0x159b('0x21')]=function(_0xa1ccc,_0x259e52){return db['SugarcrmConfiguration'][_0x159b('0x41')]({'where':{'id':_0xa1ccc[_0x159b('0x44')]['id']}})['then'](handleEntityNotFound(_0x259e52,null))[_0x159b('0x22')](removeEntity(_0x259e52,null))[_0x159b('0x3d')](handleError(_0x259e52,null));};exports['getFields']=function(_0x16b785,_0x3e41ed,_0xe6d93f){var _0x3217bd={};var _0x2e60ec={};var _0x41e0ff;var _0x5744b4;return db[_0x159b('0x29')][_0x159b('0x45')]({'where':{'id':_0x16b785[_0x159b('0x44')]['id']}})[_0x159b('0x22')](handleEntityNotFound(_0x3e41ed,null))[_0x159b('0x22')](function(_0xb8532a){if(_0xb8532a){_0x41e0ff=_0xb8532a;_0x2e60ec[_0x159b('0x2c')]=_[_0x159b('0x2e')](db[_0x159b('0x46')][_0x159b('0x3e')]);_0x2e60ec['query']=_[_0x159b('0x2e')](_0x16b785['query']);_0x2e60ec[_0x159b('0x2f')]=_[_0x159b('0x31')](_0x2e60ec[_0x159b('0x2c')],_0x2e60ec[_0x159b('0x2d')]);_0x3217bd[_0x159b('0x30')]=_[_0x159b('0x31')](_0x2e60ec[_0x159b('0x2c')],qs[_0x159b('0x32')](_0x16b785[_0x159b('0x2d')][_0x159b('0x32')]));_0x3217bd[_0x159b('0x30')]=_0x3217bd[_0x159b('0x30')][_0x159b('0x3f')]?_0x3217bd['attributes']:_0x2e60ec[_0x159b('0x2c')];_0x3217bd['order']=qs[_0x159b('0x35')](_0x16b785[_0x159b('0x2d')][_0x159b('0x35')]);_0x3217bd[_0x159b('0x36')]=qs[_0x159b('0x2f')](_[_0x159b('0x37')](_0x16b785['query'],_0x2e60ec[_0x159b('0x2f')]));if(_0x16b785[_0x159b('0x2d')]['filter']){_0x3217bd[_0x159b('0x36')]=_[_0x159b('0x38')](_0x3217bd[_0x159b('0x36')],{'$or':_[_0x159b('0x28')](_0x3217bd[_0x159b('0x30')],function(_0x21fa44){var _0xf7554f={};_0xf7554f[_0x21fa44]={'$like':'%'+_0x16b785[_0x159b('0x2d')][_0x159b('0x39')]+'%'};return _0xf7554f;})});}_0x3217bd=_[_0x159b('0x38')]({},_0x3217bd,_0x16b785[_0x159b('0x3a')]);return _0x41e0ff['getFields'](_0x3217bd);}})[_0x159b('0x22')](function(_0x323bb0){if(_0x323bb0){_0x5744b4=_0x323bb0[_0x159b('0x3f')];if(!_0x16b785['query'][_0x159b('0x33')](_0x159b('0x34'))){_0x3217bd[_0x159b('0x1b')]=qs['limit'](_0x16b785[_0x159b('0x2d')][_0x159b('0x1b')]);_0x3217bd['offset']=qs[_0x159b('0x19')](_0x16b785[_0x159b('0x2d')][_0x159b('0x19')]);}return _0x41e0ff['getFields'](_0x3217bd);}})['then'](function(_0x29646e){if(_0x29646e){return _0x29646e?{'count':_0x5744b4,'rows':_0x29646e}:null;}})[_0x159b('0x22')](respondWithResult(_0x3e41ed,null))[_0x159b('0x3d')](handleError(_0x3e41ed,null));};exports['getSubjects']=function(_0x382ad3,_0x4dfe77,_0x23d44a){var _0x85b481={};var _0x32eec8={};var _0x44270c;var _0x41c1f5;return db[_0x159b('0x29')][_0x159b('0x45')]({'where':{'id':_0x382ad3[_0x159b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4dfe77,null))[_0x159b('0x22')](function(_0x4c4360){if(_0x4c4360){_0x44270c=_0x4c4360;_0x32eec8[_0x159b('0x2c')]=_[_0x159b('0x2e')](db[_0x159b('0x46')][_0x159b('0x3e')]);_0x32eec8['query']=_['keys'](_0x382ad3[_0x159b('0x2d')]);_0x32eec8['filters']=_[_0x159b('0x31')](_0x32eec8[_0x159b('0x2c')],_0x32eec8['query']);_0x85b481[_0x159b('0x30')]=_[_0x159b('0x31')](_0x32eec8['model'],qs['fields'](_0x382ad3[_0x159b('0x2d')]['fields']));_0x85b481['attributes']=_0x85b481[_0x159b('0x30')][_0x159b('0x3f')]?_0x85b481[_0x159b('0x30')]:_0x32eec8['model'];_0x85b481[_0x159b('0x47')]=qs[_0x159b('0x35')](_0x382ad3['query'][_0x159b('0x35')]);_0x85b481[_0x159b('0x36')]=qs[_0x159b('0x2f')](_[_0x159b('0x37')](_0x382ad3[_0x159b('0x2d')],_0x32eec8[_0x159b('0x2f')]));if(_0x382ad3['query']['filter']){_0x85b481['where']=_[_0x159b('0x38')](_0x85b481[_0x159b('0x36')],{'$or':_[_0x159b('0x28')](_0x85b481[_0x159b('0x30')],function(_0x51a82e){var _0x2dd460={};_0x2dd460[_0x51a82e]={'$like':'%'+_0x382ad3[_0x159b('0x2d')][_0x159b('0x39')]+'%'};return _0x2dd460;})});}_0x85b481=_[_0x159b('0x38')]({},_0x85b481,_0x382ad3[_0x159b('0x3a')]);return _0x44270c[_0x159b('0x48')](_0x85b481);}})[_0x159b('0x22')](function(_0x3afa7f){if(_0x3afa7f){_0x41c1f5=_0x3afa7f[_0x159b('0x3f')];if(!_0x382ad3[_0x159b('0x2d')][_0x159b('0x33')](_0x159b('0x34'))){_0x85b481[_0x159b('0x1b')]=qs[_0x159b('0x1b')](_0x382ad3[_0x159b('0x2d')]['limit']);_0x85b481[_0x159b('0x19')]=qs[_0x159b('0x19')](_0x382ad3[_0x159b('0x2d')][_0x159b('0x19')]);}return _0x44270c[_0x159b('0x48')](_0x85b481);}})[_0x159b('0x22')](function(_0x45fd8f){if(_0x45fd8f){return _0x45fd8f?{'count':_0x41c1f5,'rows':_0x45fd8f}:null;}})[_0x159b('0x22')](respondWithResult(_0x4dfe77,null))[_0x159b('0x3d')](handleError(_0x4dfe77,null));};exports[_0x159b('0x49')]=function(_0x927519,_0x2bd08c,_0x411695){var _0x4d9ec7={};var _0x753a67={};var _0x3fb627;var _0x79bd5e;return db['SugarcrmConfiguration'][_0x159b('0x45')]({'where':{'id':_0x927519[_0x159b('0x44')]['id']}})[_0x159b('0x22')](handleEntityNotFound(_0x2bd08c,null))[_0x159b('0x22')](function(_0x42af74){if(_0x42af74){_0x3fb627=_0x42af74;_0x753a67[_0x159b('0x2c')]=_['keys'](db[_0x159b('0x46')][_0x159b('0x3e')]);_0x753a67['query']=_[_0x159b('0x2e')](_0x927519[_0x159b('0x2d')]);_0x753a67[_0x159b('0x2f')]=_[_0x159b('0x31')](_0x753a67[_0x159b('0x2c')],_0x753a67[_0x159b('0x2d')]);_0x4d9ec7['attributes']=_[_0x159b('0x31')](_0x753a67[_0x159b('0x2c')],qs['fields'](_0x927519['query']['fields']));_0x4d9ec7[_0x159b('0x30')]=_0x4d9ec7[_0x159b('0x30')][_0x159b('0x3f')]?_0x4d9ec7['attributes']:_0x753a67[_0x159b('0x2c')];_0x4d9ec7[_0x159b('0x47')]=qs['sort'](_0x927519['query'][_0x159b('0x35')]);_0x4d9ec7[_0x159b('0x36')]=qs[_0x159b('0x2f')](_[_0x159b('0x37')](_0x927519[_0x159b('0x2d')],_0x753a67[_0x159b('0x2f')]));if(_0x927519['query'][_0x159b('0x39')]){_0x4d9ec7[_0x159b('0x36')]=_['merge'](_0x4d9ec7[_0x159b('0x36')],{'$or':_[_0x159b('0x28')](_0x4d9ec7['attributes'],function(_0x59f28d){var _0x45d0bd={};_0x45d0bd[_0x59f28d]={'$like':'%'+_0x927519[_0x159b('0x2d')][_0x159b('0x39')]+'%'};return _0x45d0bd;})});}_0x4d9ec7=_[_0x159b('0x38')]({},_0x4d9ec7,_0x927519['options']);return _0x3fb627[_0x159b('0x49')](_0x4d9ec7);}})['then'](function(_0xd322ec){if(_0xd322ec){_0x79bd5e=_0xd322ec['length'];if(!_0x927519[_0x159b('0x2d')][_0x159b('0x33')]('nolimit')){_0x4d9ec7['limit']=qs[_0x159b('0x1b')](_0x927519[_0x159b('0x2d')]['limit']);_0x4d9ec7[_0x159b('0x19')]=qs['offset'](_0x927519[_0x159b('0x2d')][_0x159b('0x19')]);}return _0x3fb627[_0x159b('0x49')](_0x4d9ec7);}})[_0x159b('0x22')](function(_0x566b1d){if(_0x566b1d){return _0x566b1d?{'count':_0x79bd5e,'rows':_0x566b1d}:null;}})[_0x159b('0x22')](respondWithResult(_0x2bd08c,null))[_0x159b('0x3d')](handleError(_0x2bd08c,null));}; \ No newline at end of file +var _0xe6f0=['zip-dir','moment','bluebird','path','sox','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','rawAttributes','length','find','catch','create','body','params','getFields','findOne','getSubjects','SugarcrmField','hasOwnProperty','getDescriptions','eml-format'];(function(_0x4af9e7,_0x52b524){var _0x54e758=function(_0x496842){while(--_0x496842){_0x4af9e7['push'](_0x4af9e7['shift']());}};_0x54e758(++_0x52b524);}(_0xe6f0,0xda));var _0x0e6f=function(_0x1066a3,_0x4ae4b6){_0x1066a3=_0x1066a3-0x0;var _0x488ca3=_0xe6f0[_0x1066a3];return _0x488ca3;};'use strict';var emlformat=require(_0x0e6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e6f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e6f('0x2'));var BPromise=require(_0x0e6f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0e6f('0x4'));var sox=require(_0x0e6f('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0e6f('0x6'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0e6f('0x7'));var querystring=require(_0x0e6f('0x8'));var Papa=require(_0x0e6f('0x9'));var Redis=require(_0x0e6f('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x0e6f('0xb'));var as=require(_0x0e6f('0xc'));var hardwareService=require(_0x0e6f('0xd'));var logger=require(_0x0e6f('0xe'))(_0x0e6f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e6f('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b023,_0x2a23d4){_0x2a23d4=_0x2a23d4||0xcc;return function(_0x2c2a9f){if(_0x2c2a9f){return _0x49b023['sendStatus'](_0x2a23d4);}return _0x49b023[_0x0e6f('0x11')](_0x2a23d4)['end']();};}function respondWithResult(_0x143481,_0x5983f2){_0x5983f2=_0x5983f2||0xc8;return function(_0x507386){if(_0x507386){return _0x143481[_0x0e6f('0x11')](_0x5983f2)[_0x0e6f('0x12')](_0x507386);}};}function respondWithFilteredResult(_0x1e5f21,_0x264b9f){return function(_0xeeb385){if(_0xeeb385){var _0xb6996e=typeof _0x264b9f['offset']===_0x0e6f('0x13')&&typeof _0x264b9f[_0x0e6f('0x14')]===_0x0e6f('0x13');var _0x46c150=_0xeeb385[_0x0e6f('0x15')];var _0xa3bfa4=_0xb6996e?0x0:_0x264b9f[_0x0e6f('0x16')];var _0x335dea=_0xb6996e?_0xeeb385[_0x0e6f('0x15')]:_0x264b9f['offset']+_0x264b9f[_0x0e6f('0x14')];var _0x3b5600;if(_0x335dea>=_0x46c150){_0x335dea=_0x46c150;_0x3b5600=0xc8;}else{_0x3b5600=0xce;}_0x1e5f21[_0x0e6f('0x11')](_0x3b5600);return _0x1e5f21['set'](_0x0e6f('0x17'),_0xa3bfa4+'-'+_0x335dea+'/'+_0x46c150)[_0x0e6f('0x12')](_0xeeb385);}return null;};}function patchUpdates(_0x12f259){return function(_0x550b02){try{jsonpatch[_0x0e6f('0x18')](_0x550b02,_0x12f259,!![]);}catch(_0x4169eb){return BPromise[_0x0e6f('0x19')](_0x4169eb);}return _0x550b02[_0x0e6f('0x1a')]();};}function saveUpdates(_0x401252,_0x31b57f){return function(_0x4b0fab){if(_0x4b0fab){return _0x4b0fab[_0x0e6f('0x1b')](_0x401252)[_0x0e6f('0x1c')](function(_0x242e64){return _0x242e64;});}return null;};}function removeEntity(_0xb84cf0,_0x1490ea){return function(_0x31b55b){if(_0x31b55b){return _0x31b55b[_0x0e6f('0x1d')]()[_0x0e6f('0x1c')](function(){_0xb84cf0[_0x0e6f('0x11')](0xcc)[_0x0e6f('0x1e')]();});}};}function handleEntityNotFound(_0x187741,_0x12881b){return function(_0x193d6c){if(!_0x193d6c){_0x187741[_0x0e6f('0x1f')](0x194);}return _0x193d6c;};}function handleError(_0x4b4357,_0x36aa16){_0x36aa16=_0x36aa16||0x1f4;return function(_0x23ae14){logger[_0x0e6f('0x20')](_0x23ae14[_0x0e6f('0x21')]);if(_0x23ae14[_0x0e6f('0x22')]){delete _0x23ae14['name'];}_0x4b4357['status'](_0x36aa16)[_0x0e6f('0x23')](_0x23ae14);};}exports[_0x0e6f('0x24')]=function(_0xeaece,_0x35a41a){var _0x2825b2={},_0xff6756={},_0xf987e2={'count':0x0,'rows':[]};var _0x400605=_['map'](db[_0x0e6f('0x25')]['rawAttributes'],function(_0x3586b5){return{'name':_0x3586b5[_0x0e6f('0x26')],'type':_0x3586b5[_0x0e6f('0x27')][_0x0e6f('0x28')]};});_0xff6756[_0x0e6f('0x29')]=_['map'](_0x400605,_0x0e6f('0x22'));_0xff6756[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0xeaece[_0x0e6f('0x2a')]);_0xff6756[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0xff6756['model'],_0xff6756[_0x0e6f('0x2a')]);_0x2825b2[_0x0e6f('0x2e')]=_['intersection'](_0xff6756['model'],qs[_0x0e6f('0x2f')](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x2825b2[_0x0e6f('0x2e')]=_0x2825b2[_0x0e6f('0x2e')]['length']?_0x2825b2[_0x0e6f('0x2e')]:_0xff6756[_0x0e6f('0x29')];if(!_0xeaece[_0x0e6f('0x2a')]['hasOwnProperty'](_0x0e6f('0x30'))){_0x2825b2[_0x0e6f('0x14')]=qs[_0x0e6f('0x14')](_0xeaece[_0x0e6f('0x2a')]['limit']);_0x2825b2[_0x0e6f('0x16')]=qs['offset'](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x16')]);}_0x2825b2[_0x0e6f('0x31')]=qs[_0x0e6f('0x32')](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x32')]);_0x2825b2[_0x0e6f('0x33')]=qs[_0x0e6f('0x2c')](_[_0x0e6f('0x34')](_0xeaece[_0x0e6f('0x2a')],_0xff6756[_0x0e6f('0x2c')]),_0x400605);if(_0xeaece['query'][_0x0e6f('0x35')]){_0x2825b2['where']=_[_0x0e6f('0x36')](_0x2825b2[_0x0e6f('0x33')],{'$or':_[_0x0e6f('0x37')](_0x400605,function(_0x336d4a){if(_0x336d4a[_0x0e6f('0x27')]!==_0x0e6f('0x38')){var _0x2340b6={};_0x2340b6[_0x336d4a[_0x0e6f('0x22')]]={'$like':'%'+_0xeaece[_0x0e6f('0x2a')]['filter']+'%'};return _0x2340b6;}})});}_0x2825b2=_[_0x0e6f('0x36')]({},_0x2825b2,_0xeaece[_0x0e6f('0x39')]);var _0x598e94={'where':_0x2825b2[_0x0e6f('0x33')]};return db['SugarcrmConfiguration'][_0x0e6f('0x15')](_0x598e94)[_0x0e6f('0x1c')](function(_0x2d1828){_0xf987e2['count']=_0x2d1828;if(_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x3a')]){_0x2825b2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x2825b2);})[_0x0e6f('0x1c')](function(_0x3dcb72){_0xf987e2[_0x0e6f('0x3b')]=_0x3dcb72;return _0xf987e2;})[_0x0e6f('0x1c')](respondWithFilteredResult(_0x35a41a,_0x2825b2))['catch'](handleError(_0x35a41a,null));};exports['show']=function(_0x5cbe71,_0x152b62){var _0x577986={'raw':![],'where':{'id':_0x5cbe71['params']['id']}},_0x2da033={};_0x2da033[_0x0e6f('0x29')]=_[_0x0e6f('0x2b')](db[_0x0e6f('0x25')][_0x0e6f('0x3c')]);_0x2da033[_0x0e6f('0x2a')]=_['keys'](_0x5cbe71[_0x0e6f('0x2a')]);_0x2da033['filters']=_[_0x0e6f('0x2d')](_0x2da033[_0x0e6f('0x29')],_0x2da033['query']);_0x577986[_0x0e6f('0x2e')]=_[_0x0e6f('0x2d')](_0x2da033[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x5cbe71[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x577986['attributes']=_0x577986[_0x0e6f('0x2e')][_0x0e6f('0x3d')]?_0x577986[_0x0e6f('0x2e')]:_0x2da033[_0x0e6f('0x29')];if(_0x5cbe71['query']['includeAll']){_0x577986['include']=[{'all':!![]}];}_0x577986=_['merge']({},_0x577986,_0x5cbe71[_0x0e6f('0x39')]);return db[_0x0e6f('0x25')][_0x0e6f('0x3e')](_0x577986)[_0x0e6f('0x1c')](handleEntityNotFound(_0x152b62,null))[_0x0e6f('0x1c')](respondWithResult(_0x152b62,null))[_0x0e6f('0x3f')](handleError(_0x152b62,null));};exports['create']=function(_0x34da12,_0x9cdb5){return db[_0x0e6f('0x25')][_0x0e6f('0x40')](_0x34da12['body'],{})[_0x0e6f('0x1c')](respondWithResult(_0x9cdb5,0xc9))[_0x0e6f('0x3f')](handleError(_0x9cdb5,null));};exports[_0x0e6f('0x1b')]=function(_0x59c2fe,_0x14192c){if(_0x59c2fe[_0x0e6f('0x41')]['id']){delete _0x59c2fe[_0x0e6f('0x41')]['id'];}return db[_0x0e6f('0x25')][_0x0e6f('0x3e')]({'where':{'id':_0x59c2fe[_0x0e6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x14192c,null))[_0x0e6f('0x1c')](saveUpdates(_0x59c2fe[_0x0e6f('0x41')],null))['then'](respondWithResult(_0x14192c,null))[_0x0e6f('0x3f')](handleError(_0x14192c,null));};exports[_0x0e6f('0x1d')]=function(_0x5abd20,_0x244f67){return db[_0x0e6f('0x25')][_0x0e6f('0x3e')]({'where':{'id':_0x5abd20[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0x244f67,null))['then'](removeEntity(_0x244f67,null))[_0x0e6f('0x3f')](handleError(_0x244f67,null));};exports[_0x0e6f('0x43')]=function(_0x2e4bf1,_0x4210d7,_0x1b9ad8){var _0x113c12={};var _0xe09bc5={};var _0x3ecf4b;var _0x5e9b31;return db[_0x0e6f('0x25')][_0x0e6f('0x44')]({'where':{'id':_0x2e4bf1[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0x4210d7,null))[_0x0e6f('0x1c')](function(_0x565cf3){if(_0x565cf3){_0x3ecf4b=_0x565cf3;_0xe09bc5['model']=_[_0x0e6f('0x2b')](db['SugarcrmField']['rawAttributes']);_0xe09bc5[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x2e4bf1[_0x0e6f('0x2a')]);_0xe09bc5[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0xe09bc5[_0x0e6f('0x29')],_0xe09bc5[_0x0e6f('0x2a')]);_0x113c12[_0x0e6f('0x2e')]=_[_0x0e6f('0x2d')](_0xe09bc5[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x113c12['attributes']=_0x113c12[_0x0e6f('0x2e')][_0x0e6f('0x3d')]?_0x113c12[_0x0e6f('0x2e')]:_0xe09bc5['model'];_0x113c12[_0x0e6f('0x31')]=qs[_0x0e6f('0x32')](_0x2e4bf1['query'][_0x0e6f('0x32')]);_0x113c12[_0x0e6f('0x33')]=qs['filters'](_[_0x0e6f('0x34')](_0x2e4bf1[_0x0e6f('0x2a')],_0xe09bc5[_0x0e6f('0x2c')]));if(_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x35')]){_0x113c12[_0x0e6f('0x33')]=_[_0x0e6f('0x36')](_0x113c12[_0x0e6f('0x33')],{'$or':_[_0x0e6f('0x37')](_0x113c12[_0x0e6f('0x2e')],function(_0x273703){var _0xe1ac87={};_0xe1ac87[_0x273703]={'$like':'%'+_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x35')]+'%'};return _0xe1ac87;})});}_0x113c12=_[_0x0e6f('0x36')]({},_0x113c12,_0x2e4bf1[_0x0e6f('0x39')]);return _0x3ecf4b[_0x0e6f('0x43')](_0x113c12);}})[_0x0e6f('0x1c')](function(_0x424e01){if(_0x424e01){_0x5e9b31=_0x424e01[_0x0e6f('0x3d')];if(!_0x2e4bf1['query']['hasOwnProperty'](_0x0e6f('0x30'))){_0x113c12['limit']=qs[_0x0e6f('0x14')](_0x2e4bf1[_0x0e6f('0x2a')]['limit']);_0x113c12[_0x0e6f('0x16')]=qs['offset'](_0x2e4bf1['query']['offset']);}return _0x3ecf4b['getFields'](_0x113c12);}})[_0x0e6f('0x1c')](function(_0x99cc6a){if(_0x99cc6a){return _0x99cc6a?{'count':_0x5e9b31,'rows':_0x99cc6a}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0x4210d7,null))[_0x0e6f('0x3f')](handleError(_0x4210d7,null));};exports[_0x0e6f('0x45')]=function(_0x73e17f,_0xe2e84a,_0x5d9fc8){var _0x44ce94={};var _0x18eeb6={};var _0x561531;var _0x2c9cfc;return db[_0x0e6f('0x25')][_0x0e6f('0x44')]({'where':{'id':_0x73e17f[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0xe2e84a,null))[_0x0e6f('0x1c')](function(_0x4fe050){if(_0x4fe050){_0x561531=_0x4fe050;_0x18eeb6[_0x0e6f('0x29')]=_[_0x0e6f('0x2b')](db[_0x0e6f('0x46')][_0x0e6f('0x3c')]);_0x18eeb6[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x73e17f[_0x0e6f('0x2a')]);_0x18eeb6[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0x18eeb6['model'],_0x18eeb6[_0x0e6f('0x2a')]);_0x44ce94['attributes']=_[_0x0e6f('0x2d')](_0x18eeb6[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x44ce94[_0x0e6f('0x2e')]=_0x44ce94['attributes']['length']?_0x44ce94[_0x0e6f('0x2e')]:_0x18eeb6[_0x0e6f('0x29')];_0x44ce94[_0x0e6f('0x31')]=qs['sort'](_0x73e17f['query'][_0x0e6f('0x32')]);_0x44ce94[_0x0e6f('0x33')]=qs[_0x0e6f('0x2c')](_[_0x0e6f('0x34')](_0x73e17f['query'],_0x18eeb6[_0x0e6f('0x2c')]));if(_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x35')]){_0x44ce94[_0x0e6f('0x33')]=_[_0x0e6f('0x36')](_0x44ce94[_0x0e6f('0x33')],{'$or':_['map'](_0x44ce94[_0x0e6f('0x2e')],function(_0x2d83ba){var _0x320f99={};_0x320f99[_0x2d83ba]={'$like':'%'+_0x73e17f[_0x0e6f('0x2a')]['filter']+'%'};return _0x320f99;})});}_0x44ce94=_[_0x0e6f('0x36')]({},_0x44ce94,_0x73e17f['options']);return _0x561531[_0x0e6f('0x45')](_0x44ce94);}})[_0x0e6f('0x1c')](function(_0x4a67af){if(_0x4a67af){_0x2c9cfc=_0x4a67af[_0x0e6f('0x3d')];if(!_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x47')](_0x0e6f('0x30'))){_0x44ce94[_0x0e6f('0x14')]=qs['limit'](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x14')]);_0x44ce94[_0x0e6f('0x16')]=qs['offset'](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x16')]);}return _0x561531['getSubjects'](_0x44ce94);}})[_0x0e6f('0x1c')](function(_0x4a99fc){if(_0x4a99fc){return _0x4a99fc?{'count':_0x2c9cfc,'rows':_0x4a99fc}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0xe2e84a,null))['catch'](handleError(_0xe2e84a,null));};exports[_0x0e6f('0x48')]=function(_0x3ba629,_0x4f4410,_0x4cc5e0){var _0x4a92bb={};var _0x2031df={};var _0x4dee3b;var _0x1b6679;return db['SugarcrmConfiguration'][_0x0e6f('0x44')]({'where':{'id':_0x3ba629['params']['id']}})['then'](handleEntityNotFound(_0x4f4410,null))[_0x0e6f('0x1c')](function(_0x378f99){if(_0x378f99){_0x4dee3b=_0x378f99;_0x2031df[_0x0e6f('0x29')]=_['keys'](db[_0x0e6f('0x46')][_0x0e6f('0x3c')]);_0x2031df[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x3ba629[_0x0e6f('0x2a')]);_0x2031df[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0x2031df['model'],_0x2031df[_0x0e6f('0x2a')]);_0x4a92bb[_0x0e6f('0x2e')]=_['intersection'](_0x2031df['model'],qs[_0x0e6f('0x2f')](_0x3ba629[_0x0e6f('0x2a')]['fields']));_0x4a92bb[_0x0e6f('0x2e')]=_0x4a92bb['attributes'][_0x0e6f('0x3d')]?_0x4a92bb[_0x0e6f('0x2e')]:_0x2031df[_0x0e6f('0x29')];_0x4a92bb[_0x0e6f('0x31')]=qs['sort'](_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x32')]);_0x4a92bb[_0x0e6f('0x33')]=qs['filters'](_['pick'](_0x3ba629[_0x0e6f('0x2a')],_0x2031df[_0x0e6f('0x2c')]));if(_0x3ba629['query'][_0x0e6f('0x35')]){_0x4a92bb[_0x0e6f('0x33')]=_['merge'](_0x4a92bb[_0x0e6f('0x33')],{'$or':_['map'](_0x4a92bb['attributes'],function(_0x2388a2){var _0x512bd4={};_0x512bd4[_0x2388a2]={'$like':'%'+_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x35')]+'%'};return _0x512bd4;})});}_0x4a92bb=_[_0x0e6f('0x36')]({},_0x4a92bb,_0x3ba629[_0x0e6f('0x39')]);return _0x4dee3b[_0x0e6f('0x48')](_0x4a92bb);}})[_0x0e6f('0x1c')](function(_0x5ed0fe){if(_0x5ed0fe){_0x1b6679=_0x5ed0fe[_0x0e6f('0x3d')];if(!_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x47')](_0x0e6f('0x30'))){_0x4a92bb[_0x0e6f('0x14')]=qs[_0x0e6f('0x14')](_0x3ba629[_0x0e6f('0x2a')]['limit']);_0x4a92bb[_0x0e6f('0x16')]=qs[_0x0e6f('0x16')](_0x3ba629[_0x0e6f('0x2a')]['offset']);}return _0x4dee3b['getDescriptions'](_0x4a92bb);}})[_0x0e6f('0x1c')](function(_0x2ed9ba){if(_0x2ed9ba){return _0x2ed9ba?{'count':_0x1b6679,'rows':_0x2ed9ba}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0x4f4410,null))[_0x0e6f('0x3f')](handleError(_0x4f4410,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index bb03681..a82f783 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 _0xdd4d=['request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger','api','moment','bluebird'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xdd4d,0xf7));var _0xddd4=function(_0x2aa03f,_0x19bd44){_0x2aa03f=_0x2aa03f-0x0;var _0x4d0695=_0xdd4d[_0x2aa03f];return _0x4d0695;};'use strict';var _=require(_0xddd4('0x0'));var util=require('util');var logger=require(_0xddd4('0x1'))(_0xddd4('0x2'));var moment=require(_0xddd4('0x3'));var BPromise=require(_0xddd4('0x4'));var rp=require(_0xddd4('0x5'));var fs=require('fs');var path=require(_0xddd4('0x6'));var rimraf=require(_0xddd4('0x7'));var config=require('../../config/environment');var attributes=require(_0xddd4('0x8'));module[_0xddd4('0x9')]=function(_0x1bce52,_0x2d8490){return _0x1bce52[_0xddd4('0xa')](_0xddd4('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67cc=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash'];(function(_0x110309,_0x36cd12){var _0x4c4030=function(_0x269e61){while(--_0x269e61){_0x110309['push'](_0x110309['shift']());}};_0x4c4030(++_0x36cd12);}(_0x67cc,0x1a3));var _0xc67c=function(_0x5a84d1,_0x4a330f){_0x5a84d1=_0x5a84d1-0x0;var _0x4b656c=_0x67cc[_0x5a84d1];return _0x4b656c;};'use strict';var _=require(_0xc67c('0x0'));var util=require(_0xc67c('0x1'));var logger=require(_0xc67c('0x2'))(_0xc67c('0x3'));var moment=require('moment');var BPromise=require(_0xc67c('0x4'));var rp=require(_0xc67c('0x5'));var fs=require('fs');var path=require(_0xc67c('0x6'));var rimraf=require('rimraf');var config=require(_0xc67c('0x7'));var attributes=require(_0xc67c('0x8'));module[_0xc67c('0x9')]=function(_0x5bd6bb,_0x49ec5e){return _0x5bd6bb[_0xc67c('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xc67c('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 93b65c6..52a60dd 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 _0x942e=['stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x50f1d6,_0x56440a){var _0x4c74f2=function(_0x3baf5b){while(--_0x3baf5b){_0x50f1d6['push'](_0x50f1d6['shift']());}};_0x4c74f2(++_0x56440a);}(_0x942e,0xf6));var _0xe942=function(_0x256fb1,_0x23caf3){_0x256fb1=_0x256fb1-0x0;var _0x1f5781=_0x942e[_0x256fb1];return _0x1f5781;};'use strict';var _=require(_0xe942('0x0'));var util=require(_0xe942('0x1'));var moment=require(_0xe942('0x2'));var BPromise=require('bluebird');var rs=require(_0xe942('0x3'));var fs=require('fs');var Redis=require(_0xe942('0x4'));var db=require(_0xe942('0x5'))['db'];var utils=require(_0xe942('0x6'));var logger=require(_0xe942('0x7'))('rpc');var config=require(_0xe942('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe942('0x9')][_0xe942('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19a42c,_0x15a90b,_0x4b9462){return new BPromise(function(_0x29e562,_0x3a4b5f){return client[_0xe942('0xb')](_0x19a42c,_0x4b9462)[_0xe942('0xc')](function(_0x3af71c){logger[_0xe942('0xd')](_0xe942('0xe'),_0x15a90b,'request\x20sent');logger[_0xe942('0xf')](_0xe942('0x10'),_0x15a90b,_0xe942('0x11'),JSON[_0xe942('0x12')](_0x3af71c));if(_0x3af71c[_0xe942('0x13')]){if(_0x3af71c[_0xe942('0x13')]['code']===0x1f4){logger[_0xe942('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15a90b,_0x3af71c['error'][_0xe942('0x14')]);return _0x3a4b5f(_0x3af71c[_0xe942('0x13')][_0xe942('0x14')]);}logger[_0xe942('0x13')](_0xe942('0xe'),_0x15a90b,_0x3af71c[_0xe942('0x13')][_0xe942('0x14')]);return _0x29e562(_0x3af71c[_0xe942('0x13')]['message']);}else{logger['info'](_0xe942('0xe'),_0x15a90b,'request\x20sent');_0x29e562(_0x3af71c['result'][_0xe942('0x14')]);}})[_0xe942('0x15')](function(_0x1c4a6d){logger['error'](_0xe942('0xe'),_0x15a90b,_0x1c4a6d);_0x3a4b5f(_0x1c4a6d);});});} \ No newline at end of file +var _0xf993=['request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf993,0x8a));var _0x3f99=function(_0x41dd31,_0x1df6a3){_0x41dd31=_0x41dd31-0x0;var _0xfb6772=_0xf993[_0x41dd31];return _0xfb6772;};'use strict';var _=require(_0x3f99('0x0'));var util=require(_0x3f99('0x1'));var moment=require(_0x3f99('0x2'));var BPromise=require(_0x3f99('0x3'));var rs=require(_0x3f99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f99('0x5'))['db'];var utils=require(_0x3f99('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f99('0x7')][_0x3f99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35b327,_0x38fb21,_0xbb5354){return new BPromise(function(_0x1cb608,_0x1b00ac){return client[_0x3f99('0x9')](_0x35b327,_0xbb5354)[_0x3f99('0xa')](function(_0x204ab3){logger[_0x3f99('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x38fb21,_0x3f99('0xc'));logger['debug'](_0x3f99('0xd'),_0x38fb21,_0x3f99('0xc'),JSON[_0x3f99('0xe')](_0x204ab3));if(_0x204ab3[_0x3f99('0xf')]){if(_0x204ab3[_0x3f99('0xf')][_0x3f99('0x10')]===0x1f4){logger[_0x3f99('0xf')](_0x3f99('0x11'),_0x38fb21,_0x204ab3['error']['message']);return _0x1b00ac(_0x204ab3['error']['message']);}logger['error'](_0x3f99('0x11'),_0x38fb21,_0x204ab3['error'][_0x3f99('0x12')]);return _0x1cb608(_0x204ab3[_0x3f99('0xf')][_0x3f99('0x12')]);}else{logger[_0x3f99('0xb')](_0x3f99('0x11'),_0x38fb21,_0x3f99('0xc'));_0x1cb608(_0x204ab3[_0x3f99('0x13')][_0x3f99('0x12')]);}})[_0x3f99('0x14')](function(_0x477106){logger[_0x3f99('0xf')](_0x3f99('0x11'),_0x38fb21,_0x477106);_0x1b00ac(_0x477106);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f73d4ee..5c510bb 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 _0xd0b4=['../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0xd0b4,0xd7));var _0x4d0b=function(_0x1a8985,_0x8d8fde){_0x1a8985=_0x1a8985-0x0;var _0x37e624=_0xd0b4[_0x1a8985];return _0x37e624;};'use strict';var multer=require(_0x4d0b('0x0'));var util=require(_0x4d0b('0x1'));var path=require(_0x4d0b('0x2'));var timeout=require(_0x4d0b('0x3'));var express=require(_0x4d0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d0b('0x5'));var interaction=require(_0x4d0b('0x6'));var config=require('../../config/environment');var controller=require(_0x4d0b('0x7'));router[_0x4d0b('0x8')]('/',auth[_0x4d0b('0x9')](),controller[_0x4d0b('0xa')]);router[_0x4d0b('0x8')](_0x4d0b('0xb'),auth[_0x4d0b('0x9')](),controller[_0x4d0b('0xc')]);router[_0x4d0b('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d0b('0xe')]);router[_0x4d0b('0xf')](_0x4d0b('0xb'),auth[_0x4d0b('0x9')](),controller[_0x4d0b('0x10')]);router[_0x4d0b('0x11')](_0x4d0b('0xb'),auth[_0x4d0b('0x9')](),controller[_0x4d0b('0x12')]);module[_0x4d0b('0x13')]=router; \ No newline at end of file +var _0x7246=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x433701,_0x585146){var _0x32a6b6=function(_0x3576f9){while(--_0x3576f9){_0x433701['push'](_0x433701['shift']());}};_0x32a6b6(++_0x585146);}(_0x7246,0x14a));var _0x6724=function(_0x169c5c,_0x2a0596){_0x169c5c=_0x169c5c-0x0;var _0x4a1bd5=_0x7246[_0x169c5c];return _0x4a1bd5;};'use strict';var multer=require(_0x6724('0x0'));var util=require(_0x6724('0x1'));var path=require('path');var timeout=require(_0x6724('0x2'));var express=require(_0x6724('0x3'));var router=express[_0x6724('0x4')]();var fs_extra=require(_0x6724('0x5'));var auth=require(_0x6724('0x6'));var interaction=require(_0x6724('0x7'));var config=require(_0x6724('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x6724('0x9')]('/',auth[_0x6724('0xa')](),controller[_0x6724('0xb')]);router[_0x6724('0x9')](_0x6724('0xc'),auth[_0x6724('0xa')](),controller['show']);router[_0x6724('0xd')]('/',auth[_0x6724('0xa')](),controller[_0x6724('0xe')]);router[_0x6724('0xf')](_0x6724('0xc'),auth['isAuthenticated'](),controller[_0x6724('0x10')]);router[_0x6724('0x11')]('/:id',auth[_0x6724('0xa')](),controller[_0x6724('0x12')]);module[_0x6724('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 05b441d..eba6b36 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 _0x902e=['ENUM','string','customVariable','STRING','BOOLEAN','exports'];(function(_0x5af0f7,_0x1fd5fd){var _0x3f28ba=function(_0x221cbc){while(--_0x221cbc){_0x5af0f7['push'](_0x5af0f7['shift']());}};_0x3f28ba(++_0x1fd5fd);}(_0x902e,0xef));var _0xe902=function(_0x2ebec6,_0x27f955){_0x2ebec6=_0x2ebec6-0x0;var _0x5c032f=_0x902e[_0x2ebec6];return _0x5c032f;};'use strict';var Sequelize=require('sequelize');module[_0xe902('0x0')]={'type':{'type':Sequelize[_0xe902('0x1')](_0xe902('0x2'),'variable',_0xe902('0x3'),'keyValue','picklist'),'defaultValue':_0xe902('0x2')},'content':{'type':Sequelize[_0xe902('0x4')]},'key':{'type':Sequelize[_0xe902('0x4')]},'keyType':{'type':Sequelize[_0xe902('0x1')](_0xe902('0x2'),'variable',_0xe902('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe902('0x4')]},'nameField':{'type':Sequelize[_0xe902('0x4')]},'customField':{'type':Sequelize[_0xe902('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe902('0x4')]}}; \ No newline at end of file +var _0xd363=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd363,0x147));var _0x3d36=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0xd363[_0x28678d];return _0x1643e9;};'use strict';var Sequelize=require(_0x3d36('0x0'));module[_0x3d36('0x1')]={'type':{'type':Sequelize[_0x3d36('0x2')](_0x3d36('0x3'),_0x3d36('0x4'),_0x3d36('0x5'),'keyValue',_0x3d36('0x6')),'defaultValue':_0x3d36('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3d36('0x7')]},'keyType':{'type':Sequelize[_0x3d36('0x2')](_0x3d36('0x3'),'variable',_0x3d36('0x5'))},'keyContent':{'type':Sequelize[_0x3d36('0x7')]},'idField':{'type':Sequelize[_0x3d36('0x7')]},'nameField':{'type':Sequelize[_0x3d36('0x7')]},'customField':{'type':Sequelize[_0x3d36('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 6ec4999..908b1a2 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 _0x1c10=['body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','find','create'];(function(_0x8cdf52,_0x10902e){var _0x7c0fa2=function(_0x519726){while(--_0x519726){_0x8cdf52['push'](_0x8cdf52['shift']());}};_0x7c0fa2(++_0x10902e);}(_0x1c10,0xd9));var _0x01c1=function(_0x35a4e8,_0x3a0054){_0x35a4e8=_0x35a4e8-0x0;var _0x33df26=_0x1c10[_0x35a4e8];return _0x33df26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x01c1('0x0'));var jsonpatch=require(_0x01c1('0x1'));var rp=require(_0x01c1('0x2'));var moment=require(_0x01c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x01c1('0x4'));var util=require(_0x01c1('0x5'));var path=require(_0x01c1('0x6'));var sox=require('sox');var csv=require(_0x01c1('0x7'));var ejs=require(_0x01c1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01c1('0x9'));var squel=require(_0x01c1('0xa'));var crypto=require(_0x01c1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x01c1('0xc'));var toCsv=require(_0x01c1('0x7'));var querystring=require(_0x01c1('0xd'));var Papa=require(_0x01c1('0xe'));var Redis=require(_0x01c1('0xf'));var authService=require(_0x01c1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x01c1('0x11'));var hardwareService=require(_0x01c1('0x12'));var logger=require(_0x01c1('0x13'))('api');var utils=require(_0x01c1('0x14'));var config=require(_0x01c1('0x15'));var licenseUtil=require(_0x01c1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8830,_0x2568ac){_0x2568ac=_0x2568ac||0xcc;return function(_0x3ac590){if(_0x3ac590){return _0x2f8830[_0x01c1('0x17')](_0x2568ac);}return _0x2f8830['status'](_0x2568ac)[_0x01c1('0x18')]();};}function respondWithResult(_0x1d3901,_0xa0f938){_0xa0f938=_0xa0f938||0xc8;return function(_0x232503){if(_0x232503){return _0x1d3901[_0x01c1('0x19')](_0xa0f938)[_0x01c1('0x1a')](_0x232503);}};}function respondWithFilteredResult(_0xd473b3,_0x31083d){return function(_0x545d61){if(_0x545d61){var _0x167ac2=typeof _0x31083d[_0x01c1('0x1b')]===_0x01c1('0x1c')&&typeof _0x31083d[_0x01c1('0x1d')]==='undefined';var _0x59e456=_0x545d61['count'];var _0x5c34bc=_0x167ac2?0x0:_0x31083d[_0x01c1('0x1b')];var _0x2b82e2=_0x167ac2?_0x545d61[_0x01c1('0x1e')]:_0x31083d[_0x01c1('0x1b')]+_0x31083d[_0x01c1('0x1d')];var _0x52c18a;if(_0x2b82e2>=_0x59e456){_0x2b82e2=_0x59e456;_0x52c18a=0xc8;}else{_0x52c18a=0xce;}_0xd473b3['status'](_0x52c18a);return _0xd473b3['set'](_0x01c1('0x1f'),_0x5c34bc+'-'+_0x2b82e2+'/'+_0x59e456)[_0x01c1('0x1a')](_0x545d61);}return null;};}function patchUpdates(_0x3a13b4){return function(_0x1124bd){try{jsonpatch[_0x01c1('0x20')](_0x1124bd,_0x3a13b4,!![]);}catch(_0xe31ee4){return BPromise[_0x01c1('0x21')](_0xe31ee4);}return _0x1124bd['save']();};}function saveUpdates(_0x74ac0,_0x1df566){return function(_0x385513){if(_0x385513){return _0x385513[_0x01c1('0x22')](_0x74ac0)[_0x01c1('0x23')](function(_0x4a1908){return _0x4a1908;});}return null;};}function removeEntity(_0x1e6818,_0x268c0b){return function(_0x5142f5){if(_0x5142f5){return _0x5142f5[_0x01c1('0x24')]()[_0x01c1('0x23')](function(){_0x1e6818[_0x01c1('0x19')](0xcc)[_0x01c1('0x18')]();});}};}function handleEntityNotFound(_0x390fec,_0x1d07c4){return function(_0xa0e5c1){if(!_0xa0e5c1){_0x390fec[_0x01c1('0x17')](0x194);}return _0xa0e5c1;};}function handleError(_0x389106,_0x1cd0df){_0x1cd0df=_0x1cd0df||0x1f4;return function(_0x16c470){logger[_0x01c1('0x25')](_0x16c470['stack']);if(_0x16c470['name']){delete _0x16c470[_0x01c1('0x26')];}_0x389106['status'](_0x1cd0df)[_0x01c1('0x27')](_0x16c470);};}exports[_0x01c1('0x28')]=function(_0xcf9da5,_0x504f08){var _0x115583={},_0x57d294={},_0x25d27a={'count':0x0,'rows':[]};var _0x3f3472=_[_0x01c1('0x29')](db[_0x01c1('0x2a')][_0x01c1('0x2b')],function(_0x55e8f6){return{'name':_0x55e8f6[_0x01c1('0x2c')],'type':_0x55e8f6[_0x01c1('0x2d')]['key']};});_0x57d294[_0x01c1('0x2e')]=_[_0x01c1('0x29')](_0x3f3472,'name');_0x57d294['query']=_[_0x01c1('0x2f')](_0xcf9da5['query']);_0x57d294[_0x01c1('0x30')]=_[_0x01c1('0x31')](_0x57d294[_0x01c1('0x2e')],_0x57d294['query']);_0x115583['attributes']=_[_0x01c1('0x31')](_0x57d294[_0x01c1('0x2e')],qs[_0x01c1('0x32')](_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x32')]));_0x115583[_0x01c1('0x34')]=_0x115583[_0x01c1('0x34')][_0x01c1('0x35')]?_0x115583[_0x01c1('0x34')]:_0x57d294[_0x01c1('0x2e')];if(!_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x36')](_0x01c1('0x37'))){_0x115583[_0x01c1('0x1d')]=qs[_0x01c1('0x1d')](_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x1d')]);_0x115583[_0x01c1('0x1b')]=qs[_0x01c1('0x1b')](_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x1b')]);}_0x115583[_0x01c1('0x38')]=qs[_0x01c1('0x39')](_0xcf9da5[_0x01c1('0x33')]['sort']);_0x115583[_0x01c1('0x3a')]=qs[_0x01c1('0x30')](_[_0x01c1('0x3b')](_0xcf9da5[_0x01c1('0x33')],_0x57d294['filters']),_0x3f3472);if(_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x3c')]){_0x115583[_0x01c1('0x3a')]=_[_0x01c1('0x3d')](_0x115583[_0x01c1('0x3a')],{'$or':_[_0x01c1('0x29')](_0x3f3472,function(_0x377c10){if(_0x377c10[_0x01c1('0x2d')]!==_0x01c1('0x3e')){var _0x102b1b={};_0x102b1b[_0x377c10[_0x01c1('0x26')]]={'$like':'%'+_0xcf9da5[_0x01c1('0x33')][_0x01c1('0x3c')]+'%'};return _0x102b1b;}})});}_0x115583=_[_0x01c1('0x3d')]({},_0x115583,_0xcf9da5[_0x01c1('0x3f')]);var _0x1a528e={'where':_0x115583[_0x01c1('0x3a')]};return db[_0x01c1('0x2a')]['count'](_0x1a528e)[_0x01c1('0x23')](function(_0x1f6148){_0x25d27a[_0x01c1('0x1e')]=_0x1f6148;if(_0xcf9da5[_0x01c1('0x33')]['includeAll']){_0x115583[_0x01c1('0x40')]=[{'all':!![]}];}return db[_0x01c1('0x2a')][_0x01c1('0x41')](_0x115583);})[_0x01c1('0x23')](function(_0x3d5c82){_0x25d27a['rows']=_0x3d5c82;return _0x25d27a;})[_0x01c1('0x23')](respondWithFilteredResult(_0x504f08,_0x115583))[_0x01c1('0x42')](handleError(_0x504f08,null));};exports[_0x01c1('0x43')]=function(_0x4504e2,_0x1d122a){var _0x5ceaee={'raw':!![],'where':{'id':_0x4504e2[_0x01c1('0x44')]['id']}},_0x5a2b4e={};_0x5a2b4e['model']=_[_0x01c1('0x2f')](db[_0x01c1('0x2a')][_0x01c1('0x2b')]);_0x5a2b4e['query']=_[_0x01c1('0x2f')](_0x4504e2[_0x01c1('0x33')]);_0x5a2b4e[_0x01c1('0x30')]=_['intersection'](_0x5a2b4e[_0x01c1('0x2e')],_0x5a2b4e[_0x01c1('0x33')]);_0x5ceaee['attributes']=_[_0x01c1('0x31')](_0x5a2b4e[_0x01c1('0x2e')],qs[_0x01c1('0x32')](_0x4504e2['query'][_0x01c1('0x32')]));_0x5ceaee[_0x01c1('0x34')]=_0x5ceaee['attributes'][_0x01c1('0x35')]?_0x5ceaee[_0x01c1('0x34')]:_0x5a2b4e[_0x01c1('0x2e')];if(_0x4504e2[_0x01c1('0x33')]['includeAll']){_0x5ceaee[_0x01c1('0x40')]=[{'all':!![]}];}_0x5ceaee=_['merge']({},_0x5ceaee,_0x4504e2[_0x01c1('0x3f')]);return db[_0x01c1('0x2a')][_0x01c1('0x45')](_0x5ceaee)[_0x01c1('0x23')](handleEntityNotFound(_0x1d122a,null))['then'](respondWithResult(_0x1d122a,null))[_0x01c1('0x42')](handleError(_0x1d122a,null));};exports[_0x01c1('0x46')]=function(_0x1b2bab,_0x202486){return db[_0x01c1('0x2a')][_0x01c1('0x46')](_0x1b2bab[_0x01c1('0x47')],{})[_0x01c1('0x23')](respondWithResult(_0x202486,0xc9))[_0x01c1('0x42')](handleError(_0x202486,null));};exports['update']=function(_0x47e4bb,_0x4a7a3b){if(_0x47e4bb[_0x01c1('0x47')]['id']){delete _0x47e4bb['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x47e4bb[_0x01c1('0x44')]['id']}})[_0x01c1('0x23')](handleEntityNotFound(_0x4a7a3b,null))['then'](saveUpdates(_0x47e4bb[_0x01c1('0x47')],null))['then'](respondWithResult(_0x4a7a3b,null))[_0x01c1('0x42')](handleError(_0x4a7a3b,null));};exports[_0x01c1('0x24')]=function(_0x581318,_0x2ba4cf){return db['SugarcrmField'][_0x01c1('0x45')]({'where':{'id':_0x581318[_0x01c1('0x44')]['id']}})[_0x01c1('0x23')](handleEntityNotFound(_0x2ba4cf,null))[_0x01c1('0x23')](removeEntity(_0x2ba4cf,null))[_0x01c1('0x42')](handleError(_0x2ba4cf,null));}; \ No newline at end of file +var _0x28b1=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4d1300,_0x398146){var _0x58a858=function(_0x5dbf93){while(--_0x5dbf93){_0x4d1300['push'](_0x4d1300['shift']());}};_0x58a858(++_0x398146);}(_0x28b1,0x17d));var _0x128b=function(_0x3e8ebf,_0xb683af){_0x3e8ebf=_0x3e8ebf-0x0;var _0x32c56d=_0x28b1[_0x3e8ebf];return _0x32c56d;};'use strict';var emlformat=require(_0x128b('0x0'));var rimraf=require(_0x128b('0x1'));var zipdir=require(_0x128b('0x2'));var jsonpatch=require(_0x128b('0x3'));var rp=require(_0x128b('0x4'));var moment=require(_0x128b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x128b('0x6'));var util=require(_0x128b('0x7'));var path=require(_0x128b('0x8'));var sox=require(_0x128b('0x9'));var csv=require(_0x128b('0xa'));var ejs=require(_0x128b('0xb'));var fs=require('fs');var fs_extra=require(_0x128b('0xc'));var _=require('lodash');var squel=require(_0x128b('0xd'));var crypto=require('crypto');var jsforce=require(_0x128b('0xe'));var deskjs=require(_0x128b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x128b('0x10'));var Redis=require(_0x128b('0x11'));var authService=require(_0x128b('0x12'));var qs=require(_0x128b('0x13'));var as=require(_0x128b('0x14'));var hardwareService=require(_0x128b('0x15'));var logger=require(_0x128b('0x16'))(_0x128b('0x17'));var utils=require(_0x128b('0x18'));var config=require(_0x128b('0x19'));var licenseUtil=require(_0x128b('0x1a'));var db=require(_0x128b('0x1b'))['db'];function respondWithStatusCode(_0x4fd4af,_0x4dd21f){_0x4dd21f=_0x4dd21f||0xcc;return function(_0x1500a8){if(_0x1500a8){return _0x4fd4af[_0x128b('0x1c')](_0x4dd21f);}return _0x4fd4af['status'](_0x4dd21f)[_0x128b('0x1d')]();};}function respondWithResult(_0x49f67b,_0x2270fc){_0x2270fc=_0x2270fc||0xc8;return function(_0x52a7ae){if(_0x52a7ae){return _0x49f67b[_0x128b('0x1e')](_0x2270fc)['json'](_0x52a7ae);}};}function respondWithFilteredResult(_0x5ee226,_0x13d8fb){return function(_0x4d7c3c){if(_0x4d7c3c){var _0x434bc2=typeof _0x13d8fb[_0x128b('0x1f')]==='undefined'&&typeof _0x13d8fb[_0x128b('0x20')]===_0x128b('0x21');var _0x557967=_0x4d7c3c[_0x128b('0x22')];var _0x11f277=_0x434bc2?0x0:_0x13d8fb[_0x128b('0x1f')];var _0x1cdf50=_0x434bc2?_0x4d7c3c['count']:_0x13d8fb[_0x128b('0x1f')]+_0x13d8fb['limit'];var _0x930494;if(_0x1cdf50>=_0x557967){_0x1cdf50=_0x557967;_0x930494=0xc8;}else{_0x930494=0xce;}_0x5ee226[_0x128b('0x1e')](_0x930494);return _0x5ee226['set']('Content-Range',_0x11f277+'-'+_0x1cdf50+'/'+_0x557967)[_0x128b('0x23')](_0x4d7c3c);}return null;};}function patchUpdates(_0xec62b4){return function(_0x4b92f8){try{jsonpatch[_0x128b('0x24')](_0x4b92f8,_0xec62b4,!![]);}catch(_0x42c350){return BPromise[_0x128b('0x25')](_0x42c350);}return _0x4b92f8[_0x128b('0x26')]();};}function saveUpdates(_0x1f492e,_0x195b37){return function(_0x15a2e4){if(_0x15a2e4){return _0x15a2e4[_0x128b('0x27')](_0x1f492e)[_0x128b('0x28')](function(_0x3844a9){return _0x3844a9;});}return null;};}function removeEntity(_0x2de33f,_0x47e42f){return function(_0x5b2ac4){if(_0x5b2ac4){return _0x5b2ac4[_0x128b('0x29')]()[_0x128b('0x28')](function(){_0x2de33f[_0x128b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f7b4,_0x329fab){return function(_0x1e7c87){if(!_0x1e7c87){_0x49f7b4[_0x128b('0x1c')](0x194);}return _0x1e7c87;};}function handleError(_0x32ab69,_0x511ca5){_0x511ca5=_0x511ca5||0x1f4;return function(_0x47a7df){logger['error'](_0x47a7df[_0x128b('0x2a')]);if(_0x47a7df[_0x128b('0x2b')]){delete _0x47a7df['name'];}_0x32ab69['status'](_0x511ca5)[_0x128b('0x2c')](_0x47a7df);};}exports[_0x128b('0x2d')]=function(_0x17325,_0x4c9640){var _0x55bcae={},_0x230168={},_0x35ab7e={'count':0x0,'rows':[]};var _0x17b360=_[_0x128b('0x2e')](db[_0x128b('0x2f')][_0x128b('0x30')],function(_0x14acc9){return{'name':_0x14acc9[_0x128b('0x31')],'type':_0x14acc9[_0x128b('0x32')][_0x128b('0x33')]};});_0x230168[_0x128b('0x34')]=_['map'](_0x17b360,_0x128b('0x2b'));_0x230168[_0x128b('0x35')]=_[_0x128b('0x36')](_0x17325[_0x128b('0x35')]);_0x230168[_0x128b('0x37')]=_[_0x128b('0x38')](_0x230168['model'],_0x230168[_0x128b('0x35')]);_0x55bcae['attributes']=_[_0x128b('0x38')](_0x230168['model'],qs[_0x128b('0x39')](_0x17325['query'][_0x128b('0x39')]));_0x55bcae[_0x128b('0x3a')]=_0x55bcae['attributes'][_0x128b('0x3b')]?_0x55bcae[_0x128b('0x3a')]:_0x230168[_0x128b('0x34')];if(!_0x17325[_0x128b('0x35')][_0x128b('0x3c')]('nolimit')){_0x55bcae[_0x128b('0x20')]=qs[_0x128b('0x20')](_0x17325[_0x128b('0x35')]['limit']);_0x55bcae['offset']=qs['offset'](_0x17325[_0x128b('0x35')]['offset']);}_0x55bcae[_0x128b('0x3d')]=qs[_0x128b('0x3e')](_0x17325[_0x128b('0x35')][_0x128b('0x3e')]);_0x55bcae['where']=qs['filters'](_[_0x128b('0x3f')](_0x17325[_0x128b('0x35')],_0x230168['filters']),_0x17b360);if(_0x17325[_0x128b('0x35')]['filter']){_0x55bcae[_0x128b('0x40')]=_[_0x128b('0x41')](_0x55bcae[_0x128b('0x40')],{'$or':_[_0x128b('0x2e')](_0x17b360,function(_0x28c3c9){if(_0x28c3c9[_0x128b('0x32')]!=='VIRTUAL'){var _0x3402b5={};_0x3402b5[_0x28c3c9[_0x128b('0x2b')]]={'$like':'%'+_0x17325['query']['filter']+'%'};return _0x3402b5;}})});}_0x55bcae=_['merge']({},_0x55bcae,_0x17325[_0x128b('0x42')]);var _0x477e36={'where':_0x55bcae[_0x128b('0x40')]};return db[_0x128b('0x2f')]['count'](_0x477e36)['then'](function(_0x32eacc){_0x35ab7e[_0x128b('0x22')]=_0x32eacc;if(_0x17325['query']['includeAll']){_0x55bcae['include']=[{'all':!![]}];}return db[_0x128b('0x2f')][_0x128b('0x43')](_0x55bcae);})[_0x128b('0x28')](function(_0x56f2de){_0x35ab7e[_0x128b('0x44')]=_0x56f2de;return _0x35ab7e;})[_0x128b('0x28')](respondWithFilteredResult(_0x4c9640,_0x55bcae))[_0x128b('0x45')](handleError(_0x4c9640,null));};exports[_0x128b('0x46')]=function(_0xe38871,_0x3e511d){var _0x13422c={'raw':!![],'where':{'id':_0xe38871[_0x128b('0x47')]['id']}},_0x1817e5={};_0x1817e5['model']=_[_0x128b('0x36')](db[_0x128b('0x2f')][_0x128b('0x30')]);_0x1817e5[_0x128b('0x35')]=_[_0x128b('0x36')](_0xe38871[_0x128b('0x35')]);_0x1817e5[_0x128b('0x37')]=_[_0x128b('0x38')](_0x1817e5[_0x128b('0x34')],_0x1817e5[_0x128b('0x35')]);_0x13422c['attributes']=_[_0x128b('0x38')](_0x1817e5[_0x128b('0x34')],qs[_0x128b('0x39')](_0xe38871[_0x128b('0x35')][_0x128b('0x39')]));_0x13422c[_0x128b('0x3a')]=_0x13422c['attributes'][_0x128b('0x3b')]?_0x13422c[_0x128b('0x3a')]:_0x1817e5[_0x128b('0x34')];if(_0xe38871[_0x128b('0x35')][_0x128b('0x48')]){_0x13422c[_0x128b('0x49')]=[{'all':!![]}];}_0x13422c=_['merge']({},_0x13422c,_0xe38871[_0x128b('0x42')]);return db[_0x128b('0x2f')][_0x128b('0x4a')](_0x13422c)[_0x128b('0x28')](handleEntityNotFound(_0x3e511d,null))[_0x128b('0x28')](respondWithResult(_0x3e511d,null))['catch'](handleError(_0x3e511d,null));};exports[_0x128b('0x4b')]=function(_0x1e42ef,_0x30d006){return db[_0x128b('0x2f')]['create'](_0x1e42ef['body'],{})[_0x128b('0x28')](respondWithResult(_0x30d006,0xc9))[_0x128b('0x45')](handleError(_0x30d006,null));};exports[_0x128b('0x27')]=function(_0x18dec7,_0x4c14da){if(_0x18dec7[_0x128b('0x4c')]['id']){delete _0x18dec7['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x18dec7[_0x128b('0x47')]['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x4c14da,null))[_0x128b('0x28')](saveUpdates(_0x18dec7[_0x128b('0x4c')],null))['then'](respondWithResult(_0x4c14da,null))[_0x128b('0x45')](handleError(_0x4c14da,null));};exports[_0x128b('0x29')]=function(_0x49457a,_0x29987e){return db[_0x128b('0x2f')][_0x128b('0x4a')]({'where':{'id':_0x49457a[_0x128b('0x47')]['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x29987e,null))[_0x128b('0x28')](removeEntity(_0x29987e,null))[_0x128b('0x45')](handleError(_0x29987e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a7455e5..93df6c4 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 _0x11a1=['int_sugarcrm_fields','idField','FieldId','lodash','util','api','moment','bluebird','path','./intSugarcrmField.attributes','exports','define'];(function(_0x47f414,_0x4c63f3){var _0x1c4e5c=function(_0x5c080a){while(--_0x5c080a){_0x47f414['push'](_0x47f414['shift']());}};_0x1c4e5c(++_0x4c63f3);}(_0x11a1,0x15f));var _0x111a=function(_0x1f559a,_0x2a9398){_0x1f559a=_0x1f559a-0x0;var _0x31922f=_0x11a1[_0x1f559a];return _0x31922f;};'use strict';var _=require(_0x111a('0x0'));var util=require(_0x111a('0x1'));var logger=require('../../config/logger')(_0x111a('0x2'));var moment=require(_0x111a('0x3'));var BPromise=require(_0x111a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x111a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x111a('0x6'));module[_0x111a('0x7')]=function(_0x178bf6,_0x3a5560){return _0x178bf6[_0x111a('0x8')]('SugarcrmField',attributes,{'tableName':_0x111a('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x111a('0xa'),_0x111a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95cb=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x95cb,0xf5));var _0xb95c=function(_0x1c4cf0,_0x421f07){_0x1c4cf0=_0x1c4cf0-0x0;var _0x32c086=_0x95cb[_0x1c4cf0];return _0x32c086;};'use strict';var _=require(_0xb95c('0x0'));var util=require(_0xb95c('0x1'));var logger=require(_0xb95c('0x2'))(_0xb95c('0x3'));var moment=require('moment');var BPromise=require(_0xb95c('0x4'));var rp=require(_0xb95c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb95c('0x6'));var config=require(_0xb95c('0x7'));var attributes=require(_0xb95c('0x8'));module[_0xb95c('0x9')]=function(_0x434995,_0x4f9cec){return _0x434995[_0xb95c('0xa')](_0xb95c('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xb95c('0xc'),_0xb95c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index de7ef90..ac3260e 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 _0xea19=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x1e9dcc,_0x5bd8d8){var _0x55445b=function(_0x29d155){while(--_0x29d155){_0x1e9dcc['push'](_0x1e9dcc['shift']());}};_0x55445b(++_0x5bd8d8);}(_0xea19,0x12d));var _0x9ea1=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xea19[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0x9ea1('0x0'));var util=require(_0x9ea1('0x1'));var moment=require('moment');var BPromise=require(_0x9ea1('0x2'));var rs=require(_0x9ea1('0x3'));var fs=require('fs');var Redis=require(_0x9ea1('0x4'));var db=require(_0x9ea1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9ea1('0x6'));var jayson=require(_0x9ea1('0x7'));var client=jayson[_0x9ea1('0x8')][_0x9ea1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x522e32,_0x4abc1a,_0x5d5c77){return new BPromise(function(_0x46bfcf,_0x27527c){return client[_0x9ea1('0xa')](_0x522e32,_0x5d5c77)['then'](function(_0x504496){logger[_0x9ea1('0xb')](_0x9ea1('0xc'),_0x4abc1a,'request\x20sent');logger['debug'](_0x9ea1('0xd'),_0x4abc1a,_0x9ea1('0xe'),JSON[_0x9ea1('0xf')](_0x504496));if(_0x504496[_0x9ea1('0x10')]){if(_0x504496[_0x9ea1('0x10')]['code']===0x1f4){logger[_0x9ea1('0x10')](_0x9ea1('0xc'),_0x4abc1a,_0x504496[_0x9ea1('0x10')][_0x9ea1('0x11')]);return _0x27527c(_0x504496[_0x9ea1('0x10')][_0x9ea1('0x11')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x4abc1a,_0x504496[_0x9ea1('0x10')]['message']);return _0x46bfcf(_0x504496['error'][_0x9ea1('0x11')]);}else{logger[_0x9ea1('0xb')](_0x9ea1('0xc'),_0x4abc1a,_0x9ea1('0xe'));_0x46bfcf(_0x504496[_0x9ea1('0x12')][_0x9ea1('0x11')]);}})[_0x9ea1('0x13')](function(_0x29b3d7){logger[_0x9ea1('0x10')](_0x9ea1('0xc'),_0x4abc1a,_0x29b3d7);_0x27527c(_0x29b3d7);});});} \ No newline at end of file +var _0x656c=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x656c,0x1f1));var _0xc656=function(_0x46c4fe,_0x238145){_0x46c4fe=_0x46c4fe-0x0;var _0x521bfd=_0x656c[_0x46c4fe];return _0x521bfd;};'use strict';var _=require(_0xc656('0x0'));var util=require(_0xc656('0x1'));var moment=require(_0xc656('0x2'));var BPromise=require(_0xc656('0x3'));var rs=require(_0xc656('0x4'));var fs=require('fs');var Redis=require(_0xc656('0x5'));var db=require(_0xc656('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc656('0x7'))(_0xc656('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc656('0x9')][_0xc656('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7e23,_0x1e28ba,_0x216edc){return new BPromise(function(_0x48d8b2,_0x329232){return client[_0xc656('0xb')](_0x5a7e23,_0x216edc)[_0xc656('0xc')](function(_0xc22863){logger[_0xc656('0xd')](_0xc656('0xe'),_0x1e28ba,_0xc656('0xf'));logger[_0xc656('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1e28ba,'request\x20sent',JSON['stringify'](_0xc22863));if(_0xc22863['error']){if(_0xc22863[_0xc656('0x11')][_0xc656('0x12')]===0x1f4){logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0xc22863['error'][_0xc656('0x13')]);return _0x329232(_0xc22863[_0xc656('0x11')][_0xc656('0x13')]);}logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0xc22863['error'][_0xc656('0x13')]);return _0x48d8b2(_0xc22863[_0xc656('0x11')][_0xc656('0x13')]);}else{logger[_0xc656('0xd')](_0xc656('0xe'),_0x1e28ba,_0xc656('0xf'));_0x48d8b2(_0xc22863[_0xc656('0x14')][_0xc656('0x13')]);}})[_0xc656('0x15')](function(_0x1e139b){logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0x1e139b);_0x329232(_0x1e139b);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 93b3794..c4a4724 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 _0xc992=['/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3115ab,_0x138240){var _0x51550e=function(_0x4c8e84){while(--_0x4c8e84){_0x3115ab['push'](_0x3115ab['shift']());}};_0x51550e(++_0x138240);}(_0xc992,0xbb));var _0x2c99=function(_0x1c0153,_0x45562f){_0x1c0153=_0x1c0153-0x0;var _0x3fffe5=_0xc992[_0x1c0153];return _0x3fffe5;};'use strict';var multer=require(_0x2c99('0x0'));var util=require('util');var path=require(_0x2c99('0x1'));var timeout=require(_0x2c99('0x2'));var express=require('express');var router=express[_0x2c99('0x3')]();var fs_extra=require(_0x2c99('0x4'));var auth=require(_0x2c99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c99('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x2c99('0x7')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0x9')]);router[_0x2c99('0x7')](_0x2c99('0xa'),auth[_0x2c99('0x8')](),controller['show']);router[_0x2c99('0x7')](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0xc')]);router['get'](_0x2c99('0xd'),auth[_0x2c99('0x8')](),controller['getFields']);router[_0x2c99('0xe')]('/',auth[_0x2c99('0x8')](),controller[_0x2c99('0xf')]);router['post'](_0x2c99('0xb'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x10')]);router[_0x2c99('0x11')](_0x2c99('0xa'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x12')]);router[_0x2c99('0x13')](_0x2c99('0xa'),auth[_0x2c99('0x8')](),controller[_0x2c99('0x14')]);module[_0x2c99('0x15')]=router; \ No newline at end of file +var _0x43f5=['index','show','/:id/configurations','getFields','create','post','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x22a3f0,_0x513d0e){var _0x2d8a9c=function(_0xea3b42){while(--_0xea3b42){_0x22a3f0['push'](_0x22a3f0['shift']());}};_0x2d8a9c(++_0x513d0e);}(_0x43f5,0x9d));var _0x543f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x43f5[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x543f('0x0'));var util=require(_0x543f('0x1'));var path=require('path');var timeout=require(_0x543f('0x2'));var express=require(_0x543f('0x3'));var router=express[_0x543f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x543f('0x5'));var interaction=require(_0x543f('0x6'));var config=require(_0x543f('0x7'));var controller=require(_0x543f('0x8'));router[_0x543f('0x9')]('/',auth[_0x543f('0xa')](),controller[_0x543f('0xb')]);router[_0x543f('0x9')]('/:id',auth[_0x543f('0xa')](),controller[_0x543f('0xc')]);router[_0x543f('0x9')](_0x543f('0xd'),auth[_0x543f('0xa')](),controller['getConfigurations']);router[_0x543f('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x543f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x543f('0xf')]);router[_0x543f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x543f('0x11')](_0x543f('0x12'),auth[_0x543f('0xa')](),controller['update']);router[_0x543f('0x13')](_0x543f('0x12'),auth[_0x543f('0xa')](),controller['destroy']);module[_0x543f('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 0618dd5..f787f04 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 _0x8cff=['sequelize','exports','STRING','HelpDesk'];(function(_0x5be977,_0x3a11a6){var _0x224c18=function(_0x2ecfb3){while(--_0x2ecfb3){_0x5be977['push'](_0x5be977['shift']());}};_0x224c18(++_0x3a11a6);}(_0x8cff,0xa0));var _0xf8cf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8cff[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xf8cf('0x0'));module[_0xf8cf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf8cf('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf8cf('0x3')},'remoteUri':{'type':Sequelize[_0xf8cf('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf8cf('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbda8=['sequelize','exports','STRING','HelpDesk'];(function(_0x100e0c,_0x5523b8){var _0x4db1aa=function(_0x29f480){while(--_0x29f480){_0x100e0c['push'](_0x100e0c['shift']());}};_0x4db1aa(++_0x5523b8);}(_0xbda8,0x1d4));var _0x8bda=function(_0x523ee5,_0xa760de){_0x523ee5=_0x523ee5-0x0;var _0x8f5a3a=_0xbda8[_0x523ee5];return _0x8f5a3a;};'use strict';var Sequelize=require(_0x8bda('0x0'));module[_0x8bda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8bda('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![],'defaultValue':_0x8bda('0x3')},'remoteUri':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8bda('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 83238b6..6be867e 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 _0x1e85=['false','label','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','sort','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','serverUrl','accessKey','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','success','login','token','result','autogenerated','reference','owner','remove','editable'];(function(_0x46162a,_0x1204de){var _0x4126a6=function(_0x3720ee){while(--_0x3720ee){_0x46162a['push'](_0x46162a['shift']());}};_0x4126a6(++_0x1204de);}(_0x1e85,0x1ec));var _0x51e8=function(_0x27f9be,_0x268da6){_0x27f9be=_0x27f9be-0x0;var _0x3783a6=_0x1e85[_0x27f9be];return _0x3783a6;};'use strict';var emlformat=require(_0x51e8('0x0'));var rimraf=require(_0x51e8('0x1'));var zipdir=require(_0x51e8('0x2'));var jsonpatch=require(_0x51e8('0x3'));var rp=require('request-promise');var moment=require(_0x51e8('0x4'));var BPromise=require(_0x51e8('0x5'));var Mustache=require(_0x51e8('0x6'));var util=require('util');var path=require(_0x51e8('0x7'));var sox=require('sox');var csv=require(_0x51e8('0x8'));var ejs=require(_0x51e8('0x9'));var fs=require('fs');var fs_extra=require(_0x51e8('0xa'));var _=require(_0x51e8('0xb'));var squel=require(_0x51e8('0xc'));var crypto=require(_0x51e8('0xd'));var jsforce=require(_0x51e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51e8('0x8'));var querystring=require(_0x51e8('0xf'));var Papa=require('papaparse');var Redis=require(_0x51e8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51e8('0x11'));var logger=require(_0x51e8('0x12'))(_0x51e8('0x13'));var utils=require(_0x51e8('0x14'));var config=require(_0x51e8('0x15'));var licenseUtil=require(_0x51e8('0x16'));var db=require(_0x51e8('0x17'))['db'];var integrations=require(_0x51e8('0x18'));function respondWithStatusCode(_0x3828f9,_0x5c6612){_0x5c6612=_0x5c6612||0xcc;return function(_0x54881a){if(_0x54881a){return _0x3828f9[_0x51e8('0x19')](_0x5c6612);}return _0x3828f9[_0x51e8('0x1a')](_0x5c6612)['end']();};}function respondWithResult(_0x514f23,_0x504c57){_0x504c57=_0x504c57||0xc8;return function(_0x506b1b){if(_0x506b1b){return _0x514f23[_0x51e8('0x1a')](_0x504c57)[_0x51e8('0x1b')](_0x506b1b);}};}function respondWithFilteredResult(_0x28684b,_0x3cae09){return function(_0x1a7316){if(_0x1a7316){var _0xa26606=typeof _0x3cae09[_0x51e8('0x1c')]===_0x51e8('0x1d')&&typeof _0x3cae09[_0x51e8('0x1e')]===_0x51e8('0x1d');var _0x21e2e6=_0x1a7316[_0x51e8('0x1f')];var _0x4f1d5f=_0xa26606?0x0:_0x3cae09[_0x51e8('0x1c')];var _0xb59984=_0xa26606?_0x1a7316['count']:_0x3cae09[_0x51e8('0x1c')]+_0x3cae09[_0x51e8('0x1e')];var _0x3c8326;if(_0xb59984>=_0x21e2e6){_0xb59984=_0x21e2e6;_0x3c8326=0xc8;}else{_0x3c8326=0xce;}_0x28684b[_0x51e8('0x1a')](_0x3c8326);return _0x28684b[_0x51e8('0x20')](_0x51e8('0x21'),_0x4f1d5f+'-'+_0xb59984+'/'+_0x21e2e6)[_0x51e8('0x1b')](_0x1a7316);}return null;};}function patchUpdates(_0xb34e5f){return function(_0x1da4d7){try{jsonpatch[_0x51e8('0x22')](_0x1da4d7,_0xb34e5f,!![]);}catch(_0x1a9e81){return BPromise[_0x51e8('0x23')](_0x1a9e81);}return _0x1da4d7[_0x51e8('0x24')]();};}function saveUpdates(_0x1ca81b,_0x4eb1f2){return function(_0x59433f){if(_0x59433f){return _0x59433f[_0x51e8('0x25')](_0x1ca81b)[_0x51e8('0x26')](function(_0x3ea08c){return _0x3ea08c;});}return null;};}function removeEntity(_0x3de540,_0x3d5ea4){return function(_0x3cece1){if(_0x3cece1){return _0x3cece1[_0x51e8('0x27')]()[_0x51e8('0x26')](function(){_0x3de540[_0x51e8('0x1a')](0xcc)[_0x51e8('0x28')]();});}};}function handleEntityNotFound(_0xbcfd6c,_0x419bf1){return function(_0x5cb3f8){if(!_0x5cb3f8){_0xbcfd6c[_0x51e8('0x19')](0x194);}return _0x5cb3f8;};}function handleError(_0x4da151,_0x1a7d5b){_0x1a7d5b=_0x1a7d5b||0x1f4;return function(_0x33f2f4){logger[_0x51e8('0x29')](_0x33f2f4[_0x51e8('0x2a')]);if(_0x33f2f4[_0x51e8('0x2b')]){delete _0x33f2f4[_0x51e8('0x2b')];}_0x4da151[_0x51e8('0x1a')](_0x1a7d5b)['send'](_0x33f2f4);};}exports[_0x51e8('0x2c')]=function(_0x3a3c5d,_0x2fc423){var _0x249780={},_0x90bc14={},_0x5ca255={'count':0x0,'rows':[]};var _0x2bf913=_['map'](db[_0x51e8('0x2d')][_0x51e8('0x2e')],function(_0x2db888){return{'name':_0x2db888[_0x51e8('0x2f')],'type':_0x2db888[_0x51e8('0x30')][_0x51e8('0x31')]};});_0x90bc14[_0x51e8('0x32')]=_[_0x51e8('0x33')](_0x2bf913,_0x51e8('0x2b'));_0x90bc14['query']=_[_0x51e8('0x34')](_0x3a3c5d[_0x51e8('0x35')]);_0x90bc14[_0x51e8('0x36')]=_[_0x51e8('0x37')](_0x90bc14['model'],_0x90bc14[_0x51e8('0x35')]);_0x249780[_0x51e8('0x38')]=_[_0x51e8('0x37')](_0x90bc14['model'],qs[_0x51e8('0x39')](_0x3a3c5d[_0x51e8('0x35')][_0x51e8('0x39')]));_0x249780[_0x51e8('0x38')]=_0x249780['attributes'][_0x51e8('0x3a')]?_0x249780[_0x51e8('0x38')]:_0x90bc14['model'];if(!_0x3a3c5d[_0x51e8('0x35')]['hasOwnProperty']('nolimit')){_0x249780[_0x51e8('0x1e')]=qs['limit'](_0x3a3c5d['query'][_0x51e8('0x1e')]);_0x249780[_0x51e8('0x1c')]=qs[_0x51e8('0x1c')](_0x3a3c5d[_0x51e8('0x35')][_0x51e8('0x1c')]);}_0x249780['order']=qs['sort'](_0x3a3c5d[_0x51e8('0x35')]['sort']);_0x249780['where']=qs['filters'](_[_0x51e8('0x3b')](_0x3a3c5d[_0x51e8('0x35')],_0x90bc14[_0x51e8('0x36')]),_0x2bf913);if(_0x3a3c5d['query'][_0x51e8('0x3c')]){_0x249780[_0x51e8('0x3d')]=_[_0x51e8('0x3e')](_0x249780[_0x51e8('0x3d')],{'$or':_[_0x51e8('0x33')](_0x2bf913,function(_0x1b1abb){if(_0x1b1abb[_0x51e8('0x30')]!==_0x51e8('0x3f')){var _0x2d1b20={};_0x2d1b20[_0x1b1abb[_0x51e8('0x2b')]]={'$like':'%'+_0x3a3c5d[_0x51e8('0x35')][_0x51e8('0x3c')]+'%'};return _0x2d1b20;}})});}_0x249780=_[_0x51e8('0x3e')]({},_0x249780,_0x3a3c5d[_0x51e8('0x40')]);var _0x34d024={'where':_0x249780[_0x51e8('0x3d')]};return db['VtigerAccount'][_0x51e8('0x1f')](_0x34d024)[_0x51e8('0x26')](function(_0x249f24){_0x5ca255['count']=_0x249f24;if(_0x3a3c5d['query'][_0x51e8('0x41')]){_0x249780[_0x51e8('0x42')]=[{'all':!![]}];}return db[_0x51e8('0x2d')][_0x51e8('0x43')](_0x249780);})['then'](function(_0x3c44d1){_0x5ca255[_0x51e8('0x44')]=_0x3c44d1;return _0x5ca255;})[_0x51e8('0x26')](respondWithFilteredResult(_0x2fc423,_0x249780))[_0x51e8('0x45')](handleError(_0x2fc423,null));};exports[_0x51e8('0x46')]=function(_0x34e609,_0x54fc68){var _0x2bc3a6={'raw':![],'where':{'id':_0x34e609[_0x51e8('0x47')]['id']}},_0x4ca041={};_0x4ca041['model']=_['keys'](db[_0x51e8('0x2d')][_0x51e8('0x2e')]);_0x4ca041['query']=_['keys'](_0x34e609[_0x51e8('0x35')]);_0x4ca041['filters']=_[_0x51e8('0x37')](_0x4ca041['model'],_0x4ca041['query']);_0x2bc3a6['attributes']=_[_0x51e8('0x37')](_0x4ca041[_0x51e8('0x32')],qs[_0x51e8('0x39')](_0x34e609[_0x51e8('0x35')][_0x51e8('0x39')]));_0x2bc3a6[_0x51e8('0x38')]=_0x2bc3a6[_0x51e8('0x38')]['length']?_0x2bc3a6[_0x51e8('0x38')]:_0x4ca041[_0x51e8('0x32')];if(_0x34e609[_0x51e8('0x35')][_0x51e8('0x41')]){_0x2bc3a6[_0x51e8('0x42')]=[{'all':!![]}];}_0x2bc3a6=_['merge']({},_0x2bc3a6,_0x34e609[_0x51e8('0x40')]);return db[_0x51e8('0x2d')][_0x51e8('0x48')](_0x2bc3a6)['then'](handleEntityNotFound(_0x54fc68,null))[_0x51e8('0x26')](respondWithResult(_0x54fc68,null))[_0x51e8('0x45')](handleError(_0x54fc68,null));};exports[_0x51e8('0x49')]=function(_0x4b5c63,_0x36d6c0){return db['VtigerAccount'][_0x51e8('0x49')](_0x4b5c63[_0x51e8('0x4a')],{})[_0x51e8('0x26')](respondWithResult(_0x36d6c0,0xc9))[_0x51e8('0x45')](handleError(_0x36d6c0,null));};exports[_0x51e8('0x25')]=function(_0x23faab,_0x313e20){if(_0x23faab[_0x51e8('0x4a')]['id']){delete _0x23faab['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x23faab[_0x51e8('0x47')]['id']}})[_0x51e8('0x26')](handleEntityNotFound(_0x313e20,null))['then'](saveUpdates(_0x23faab['body'],null))[_0x51e8('0x26')](respondWithResult(_0x313e20,null))[_0x51e8('0x45')](handleError(_0x313e20,null));};exports['destroy']=function(_0x963dbd,_0x4b7186){return db[_0x51e8('0x2d')][_0x51e8('0x48')]({'where':{'id':_0x963dbd['params']['id']}})[_0x51e8('0x26')](handleEntityNotFound(_0x4b7186,null))[_0x51e8('0x26')](removeEntity(_0x4b7186,null))[_0x51e8('0x45')](handleError(_0x4b7186,null));};exports[_0x51e8('0x4b')]=function(_0x589bc6,_0x434498,_0x110881){var _0x48ad8a={};var _0x471d7e={};var _0x224ae8;var _0x58b8f1;return db['VtigerAccount'][_0x51e8('0x4c')]({'where':{'id':_0x589bc6['params']['id']}})[_0x51e8('0x26')](handleEntityNotFound(_0x434498,null))[_0x51e8('0x26')](function(_0x2edfcd){if(_0x2edfcd){_0x224ae8=_0x2edfcd;_0x471d7e[_0x51e8('0x32')]=_[_0x51e8('0x34')](db[_0x51e8('0x4d')][_0x51e8('0x2e')]);_0x471d7e['query']=_['keys'](_0x589bc6['query']);_0x471d7e[_0x51e8('0x36')]=_[_0x51e8('0x37')](_0x471d7e[_0x51e8('0x32')],_0x471d7e[_0x51e8('0x35')]);_0x48ad8a['attributes']=_[_0x51e8('0x37')](_0x471d7e[_0x51e8('0x32')],qs['fields'](_0x589bc6[_0x51e8('0x35')][_0x51e8('0x39')]));_0x48ad8a[_0x51e8('0x38')]=_0x48ad8a[_0x51e8('0x38')]['length']?_0x48ad8a[_0x51e8('0x38')]:_0x471d7e[_0x51e8('0x32')];_0x48ad8a[_0x51e8('0x4e')]=qs[_0x51e8('0x4f')](_0x589bc6[_0x51e8('0x35')][_0x51e8('0x4f')]);_0x48ad8a[_0x51e8('0x3d')]=qs[_0x51e8('0x36')](_[_0x51e8('0x3b')](_0x589bc6[_0x51e8('0x35')],_0x471d7e[_0x51e8('0x36')]));if(_0x589bc6['query']['filter']){_0x48ad8a['where']=_[_0x51e8('0x3e')](_0x48ad8a[_0x51e8('0x3d')],{'$or':_[_0x51e8('0x33')](_0x48ad8a['attributes'],function(_0x40c274){var _0x505bc6={};_0x505bc6[_0x40c274]={'$like':'%'+_0x589bc6[_0x51e8('0x35')][_0x51e8('0x3c')]+'%'};return _0x505bc6;})});}_0x48ad8a=_[_0x51e8('0x3e')]({},_0x48ad8a,_0x589bc6['options']);return _0x224ae8[_0x51e8('0x4b')](_0x48ad8a);}})[_0x51e8('0x26')](function(_0x1d5956){if(_0x1d5956){_0x58b8f1=_0x1d5956[_0x51e8('0x3a')];if(!_0x589bc6[_0x51e8('0x35')][_0x51e8('0x50')]('nolimit')){_0x48ad8a[_0x51e8('0x1e')]=qs[_0x51e8('0x1e')](_0x589bc6[_0x51e8('0x35')][_0x51e8('0x1e')]);_0x48ad8a[_0x51e8('0x1c')]=qs[_0x51e8('0x1c')](_0x589bc6[_0x51e8('0x35')][_0x51e8('0x1c')]);}return _0x224ae8[_0x51e8('0x4b')](_0x48ad8a);}})[_0x51e8('0x26')](function(_0x332b75){if(_0x332b75){return _0x332b75?{'count':_0x58b8f1,'rows':_0x332b75}:null;}})[_0x51e8('0x26')](respondWithResult(_0x434498,null))['catch'](handleError(_0x434498,null));};exports[_0x51e8('0x51')]=function(_0x27accd,_0x12fa45,_0x59d532){if(_0x27accd[_0x51e8('0x4a')]['id']){delete _0x27accd[_0x51e8('0x4a')]['id'];}return db['VtigerAccount'][_0x51e8('0x4c')]({'where':{'id':_0x27accd['params']['id']}})['then'](handleEntityNotFound(_0x12fa45,null))['then'](function(_0x289ab1){if(_0x289ab1){_0x27accd[_0x51e8('0x4a')]['AccountId']=_0x289ab1['id'];_0x27accd[_0x51e8('0x4a')][_0x51e8('0x52')]=integrations[_0x51e8('0x53')](_0x27accd['body'][_0x51e8('0x54')],_0x27accd[_0x51e8('0x4a')][_0x51e8('0x30')]);_0x27accd[_0x51e8('0x4a')][_0x51e8('0x55')]=integrations[_0x51e8('0x56')](_0x27accd[_0x51e8('0x4a')]['channel'],_0x27accd[_0x51e8('0x4a')]['type']);return db[_0x51e8('0x4d')]['create'](_0x27accd['body'],{'include':[{'model':db[_0x51e8('0x57')],'as':_0x51e8('0x52')},{'model':db[_0x51e8('0x57')],'as':'Descriptions'}]});}return null;})[_0x51e8('0x26')](respondWithResult(_0x12fa45,null))[_0x51e8('0x45')](handleError(_0x12fa45,null));};var md5=require(_0x51e8('0x58'));exports[_0x51e8('0x59')]=function(_0x1700c3,_0x4832b3,_0x459163){var _0xbbd42=null;var _0x9fdf4e=null;var _0x25bb6a=null;var _0x5a7674=null;var _0xc9ef16='';return db[_0x51e8('0x2d')][_0x51e8('0x4c')]({'where':{'id':_0x1700c3[_0x51e8('0x47')]['id']},'attributes':['id',_0x51e8('0x2b'),_0x51e8('0x5a'),'description',_0x51e8('0x5b'),'remoteUri',_0x51e8('0x5c'),'accessKey']})[_0x51e8('0x26')](handleEntityNotFound(_0x4832b3,null))[_0x51e8('0x26')](function(_0x4a1073){if(_0x4a1073){_0xbbd42=_0x4a1073[_0x51e8('0x5a')];_0x9fdf4e=_0x4a1073[_0x51e8('0x5d')];_0x25bb6a=_0x4a1073[_0x51e8('0x5b')];_0xc9ef16=_0x4a1073['remoteUri'];var _0x148de5=_0xc9ef16[_0x51e8('0x5e')](-0x1);if(_0x148de5==='/'){_0xc9ef16=_0xc9ef16['substring'](0x0,_0xc9ef16[_0x51e8('0x5f')](_0x148de5));}_0x5a7674=util['format'](_0x51e8('0x60'),_0xc9ef16);var _0x5909e6={'method':_0x51e8('0x61'),'uri':_0x5a7674,'qs':{'operation':_0x51e8('0x62'),'username':_0x4a1073[_0x51e8('0x5a')]},'json':!![]};return rp(_0x5909e6);}})[_0x51e8('0x26')](function(_0x2da5e5){if(_0x2da5e5[_0x51e8('0x63')]){var _0x166aab={'method':'POST','uri':_0x5a7674,'form':{'operation':_0x51e8('0x64'),'username':_0xbbd42,'accessKey':md5(_0x2da5e5['result'][_0x51e8('0x65')]+_0x9fdf4e)},'json':!![]};return rp(_0x166aab);}})['then'](function(_0x561970){if(_0x561970['success']){var _0x2a71f5={'method':_0x51e8('0x61'),'uri':_0x5a7674,'qs':{'operation':'describe','username':_0xbbd42,'sessionName':_0x561970[_0x51e8('0x66')]['sessionName'],'elementType':_0x25bb6a},'json':!![]};return rp(_0x2a71f5);}})[_0x51e8('0x26')](function(_0x45fbab){if(_0x45fbab['success']){var _0x988d39=[_0x51e8('0x67'),_0x51e8('0x68'),_0x51e8('0x69')];_[_0x51e8('0x6a')](_0x45fbab[_0x51e8('0x66')][_0x51e8('0x39')],function(_0x4e66c7){return _0x988d39['includes'](_0x4e66c7[_0x51e8('0x30')][_0x51e8('0x2b')]);});_[_0x51e8('0x6a')](_0x45fbab[_0x51e8('0x66')][_0x51e8('0x39')],function(_0x553e61){return _0x553e61[_0x51e8('0x6b')]===_0x51e8('0x6c');});return{'count':_0x45fbab['result'][_0x51e8('0x39')][_0x51e8('0x3a')],'rows':_[_0x51e8('0x33')](_0x45fbab[_0x51e8('0x66')][_0x51e8('0x39')],function(_0x242c18){return{'id':_0x242c18[_0x51e8('0x2b')],'name':_0x242c18[_0x51e8('0x6d')],'custom':_['startsWith'](_0x242c18['name'],_0x51e8('0x6e'))?!![]:![],'options':_0x242c18['type'][_0x51e8('0x2b')]===_0x51e8('0x6f')&&_0x242c18[_0x51e8('0x30')]['picklistValues'][_0x51e8('0x3a')]>0x0?_[_0x51e8('0x33')](_0x242c18[_0x51e8('0x30')][_0x51e8('0x70')],function(_0x2dff05){return{'name':_0x2dff05[_0x51e8('0x6d')],'value':_0x2dff05['value']};}):[]};})};}})['then'](respondWithResult(_0x4832b3,null))[_0x51e8('0x45')](function(_0x354dd3){console[_0x51e8('0x71')](_0x51e8('0x72')+_0x354dd3);var _0x59ba7c=_0x1700c3[_0x51e8('0x35')][_0x51e8('0x73')]?0x1f4:_0x354dd3[_0x51e8('0x74')]||0x1f4;logger['error'](_0x51e8('0x75'),'getFields',_0x59ba7c,JSON['stringify'](_0x354dd3));delete _0x354dd3[_0x51e8('0x2b')];if(_0x59ba7c===0x191){_0x59ba7c=0x190;}_0x4832b3[_0x51e8('0x1a')](_0x59ba7c)[_0x51e8('0x76')](_0x1700c3[_0x51e8('0x35')][_0x51e8('0x73')]?{'message':_0x51e8('0x77'),'statusCode':_0x354dd3[_0x51e8('0x74')]}:_0x354dd3);});}; \ No newline at end of file +var _0x978b=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','end','error','name','send','index','map','VtigerAccount','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','getConfigurations','VtigerConfiguration','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','username','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','result','token','describe','sessionName','autogenerated','owner','remove','includes','editable','false','startsWith','picklistValues','label','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','eml-format','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x978b,0x77));var _0xb978=function(_0x360533,_0x46e554){_0x360533=_0x360533-0x0;var _0x4fc78d=_0x978b[_0x360533];return _0x4fc78d;};'use strict';var emlformat=require(_0xb978('0x0'));var rimraf=require(_0xb978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb978('0x2'));var rp=require(_0xb978('0x3'));var moment=require(_0xb978('0x4'));var BPromise=require(_0xb978('0x5'));var Mustache=require(_0xb978('0x6'));var util=require(_0xb978('0x7'));var path=require(_0xb978('0x8'));var sox=require(_0xb978('0x9'));var csv=require(_0xb978('0xa'));var ejs=require(_0xb978('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb978('0xc'));var squel=require(_0xb978('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb978('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb978('0xf'));var Papa=require(_0xb978('0x10'));var Redis=require(_0xb978('0x11'));var authService=require(_0xb978('0x12'));var qs=require(_0xb978('0x13'));var as=require(_0xb978('0x14'));var hardwareService=require(_0xb978('0x15'));var logger=require(_0xb978('0x16'))(_0xb978('0x17'));var utils=require('../../config/utils');var config=require(_0xb978('0x18'));var licenseUtil=require(_0xb978('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ba2ec,_0x5e07f5){_0x5e07f5=_0x5e07f5||0xcc;return function(_0x445af0){if(_0x445af0){return _0x2ba2ec[_0xb978('0x1a')](_0x5e07f5);}return _0x2ba2ec[_0xb978('0x1b')](_0x5e07f5)['end']();};}function respondWithResult(_0x5efcde,_0x45e05c){_0x45e05c=_0x45e05c||0xc8;return function(_0x142fdd){if(_0x142fdd){return _0x5efcde[_0xb978('0x1b')](_0x45e05c)[_0xb978('0x1c')](_0x142fdd);}};}function respondWithFilteredResult(_0x3e456b,_0x4c7b44){return function(_0x5d926a){if(_0x5d926a){var _0x4897e9=typeof _0x4c7b44[_0xb978('0x1d')]===_0xb978('0x1e')&&typeof _0x4c7b44[_0xb978('0x1f')]===_0xb978('0x1e');var _0x381aaf=_0x5d926a['count'];var _0x5b01dc=_0x4897e9?0x0:_0x4c7b44[_0xb978('0x1d')];var _0x2ed722=_0x4897e9?_0x5d926a[_0xb978('0x20')]:_0x4c7b44['offset']+_0x4c7b44[_0xb978('0x1f')];var _0x4cd9ff;if(_0x2ed722>=_0x381aaf){_0x2ed722=_0x381aaf;_0x4cd9ff=0xc8;}else{_0x4cd9ff=0xce;}_0x3e456b[_0xb978('0x1b')](_0x4cd9ff);return _0x3e456b[_0xb978('0x21')]('Content-Range',_0x5b01dc+'-'+_0x2ed722+'/'+_0x381aaf)[_0xb978('0x1c')](_0x5d926a);}return null;};}function patchUpdates(_0x5a0b5d){return function(_0x24f9f1){try{jsonpatch['apply'](_0x24f9f1,_0x5a0b5d,!![]);}catch(_0x4b88b5){return BPromise[_0xb978('0x22')](_0x4b88b5);}return _0x24f9f1[_0xb978('0x23')]();};}function saveUpdates(_0x2bc7e6,_0x1c173c){return function(_0x5726d7){if(_0x5726d7){return _0x5726d7[_0xb978('0x24')](_0x2bc7e6)[_0xb978('0x25')](function(_0xc206f0){return _0xc206f0;});}return null;};}function removeEntity(_0x3e1b44,_0x1b993d){return function(_0x3b3dbd){if(_0x3b3dbd){return _0x3b3dbd['destroy']()[_0xb978('0x25')](function(){_0x3e1b44[_0xb978('0x1b')](0xcc)[_0xb978('0x26')]();});}};}function handleEntityNotFound(_0x2dfea6,_0x2b9bdc){return function(_0x9dcf36){if(!_0x9dcf36){_0x2dfea6[_0xb978('0x1a')](0x194);}return _0x9dcf36;};}function handleError(_0x1463f0,_0x2a5adb){_0x2a5adb=_0x2a5adb||0x1f4;return function(_0x137118){logger[_0xb978('0x27')](_0x137118['stack']);if(_0x137118[_0xb978('0x28')]){delete _0x137118['name'];}_0x1463f0[_0xb978('0x1b')](_0x2a5adb)[_0xb978('0x29')](_0x137118);};}exports[_0xb978('0x2a')]=function(_0x2c69c7,_0x3d47fc){var _0x4cbb47={},_0x596c35={},_0x5f36c4={'count':0x0,'rows':[]};var _0x25f800=_[_0xb978('0x2b')](db[_0xb978('0x2c')]['rawAttributes'],function(_0x228cf0){return{'name':_0x228cf0[_0xb978('0x2d')],'type':_0x228cf0['type'][_0xb978('0x2e')]};});_0x596c35['model']=_[_0xb978('0x2b')](_0x25f800,_0xb978('0x28'));_0x596c35[_0xb978('0x2f')]=_['keys'](_0x2c69c7[_0xb978('0x2f')]);_0x596c35['filters']=_[_0xb978('0x30')](_0x596c35[_0xb978('0x31')],_0x596c35[_0xb978('0x2f')]);_0x4cbb47[_0xb978('0x32')]=_[_0xb978('0x30')](_0x596c35[_0xb978('0x31')],qs[_0xb978('0x33')](_0x2c69c7[_0xb978('0x2f')]['fields']));_0x4cbb47[_0xb978('0x32')]=_0x4cbb47[_0xb978('0x32')]['length']?_0x4cbb47[_0xb978('0x32')]:_0x596c35[_0xb978('0x31')];if(!_0x2c69c7['query'][_0xb978('0x34')]('nolimit')){_0x4cbb47['limit']=qs[_0xb978('0x1f')](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x1f')]);_0x4cbb47[_0xb978('0x1d')]=qs[_0xb978('0x1d')](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x1d')]);}_0x4cbb47['order']=qs['sort'](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x35')]);_0x4cbb47[_0xb978('0x36')]=qs[_0xb978('0x37')](_[_0xb978('0x38')](_0x2c69c7[_0xb978('0x2f')],_0x596c35[_0xb978('0x37')]),_0x25f800);if(_0x2c69c7['query'][_0xb978('0x39')]){_0x4cbb47[_0xb978('0x36')]=_[_0xb978('0x3a')](_0x4cbb47[_0xb978('0x36')],{'$or':_[_0xb978('0x2b')](_0x25f800,function(_0x2774c5){if(_0x2774c5[_0xb978('0x3b')]!==_0xb978('0x3c')){var _0x1b8329={};_0x1b8329[_0x2774c5[_0xb978('0x28')]]={'$like':'%'+_0x2c69c7[_0xb978('0x2f')]['filter']+'%'};return _0x1b8329;}})});}_0x4cbb47=_[_0xb978('0x3a')]({},_0x4cbb47,_0x2c69c7[_0xb978('0x3d')]);var _0x2d530e={'where':_0x4cbb47[_0xb978('0x36')]};return db[_0xb978('0x2c')][_0xb978('0x20')](_0x2d530e)[_0xb978('0x25')](function(_0x2a34a1){_0x5f36c4[_0xb978('0x20')]=_0x2a34a1;if(_0x2c69c7[_0xb978('0x2f')][_0xb978('0x3e')]){_0x4cbb47['include']=[{'all':!![]}];}return db[_0xb978('0x2c')][_0xb978('0x3f')](_0x4cbb47);})[_0xb978('0x25')](function(_0x2c3566){_0x5f36c4[_0xb978('0x40')]=_0x2c3566;return _0x5f36c4;})[_0xb978('0x25')](respondWithFilteredResult(_0x3d47fc,_0x4cbb47))[_0xb978('0x41')](handleError(_0x3d47fc,null));};exports[_0xb978('0x42')]=function(_0x865082,_0x3a7306){var _0x3f49f8={'raw':![],'where':{'id':_0x865082[_0xb978('0x43')]['id']}},_0x4ef1ff={};_0x4ef1ff[_0xb978('0x31')]=_[_0xb978('0x44')](db['VtigerAccount'][_0xb978('0x45')]);_0x4ef1ff['query']=_['keys'](_0x865082[_0xb978('0x2f')]);_0x4ef1ff[_0xb978('0x37')]=_[_0xb978('0x30')](_0x4ef1ff[_0xb978('0x31')],_0x4ef1ff[_0xb978('0x2f')]);_0x3f49f8[_0xb978('0x32')]=_[_0xb978('0x30')](_0x4ef1ff[_0xb978('0x31')],qs[_0xb978('0x33')](_0x865082[_0xb978('0x2f')][_0xb978('0x33')]));_0x3f49f8['attributes']=_0x3f49f8['attributes'][_0xb978('0x46')]?_0x3f49f8[_0xb978('0x32')]:_0x4ef1ff['model'];if(_0x865082['query'][_0xb978('0x3e')]){_0x3f49f8['include']=[{'all':!![]}];}_0x3f49f8=_[_0xb978('0x3a')]({},_0x3f49f8,_0x865082[_0xb978('0x3d')]);return db[_0xb978('0x2c')][_0xb978('0x47')](_0x3f49f8)['then'](handleEntityNotFound(_0x3a7306,null))[_0xb978('0x25')](respondWithResult(_0x3a7306,null))[_0xb978('0x41')](handleError(_0x3a7306,null));};exports['create']=function(_0x5172a7,_0x321a2d){return db[_0xb978('0x2c')][_0xb978('0x48')](_0x5172a7[_0xb978('0x49')],{})[_0xb978('0x25')](respondWithResult(_0x321a2d,0xc9))['catch'](handleError(_0x321a2d,null));};exports[_0xb978('0x24')]=function(_0x1b2462,_0x3527e1){if(_0x1b2462[_0xb978('0x49')]['id']){delete _0x1b2462[_0xb978('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x1b2462[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x3527e1,null))[_0xb978('0x25')](saveUpdates(_0x1b2462[_0xb978('0x49')],null))[_0xb978('0x25')](respondWithResult(_0x3527e1,null))['catch'](handleError(_0x3527e1,null));};exports['destroy']=function(_0x461bb1,_0x25227d){return db[_0xb978('0x2c')][_0xb978('0x47')]({'where':{'id':_0x461bb1[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x25227d,null))['then'](removeEntity(_0x25227d,null))[_0xb978('0x41')](handleError(_0x25227d,null));};exports[_0xb978('0x4a')]=function(_0x314722,_0x83755a,_0x1aa32d){var _0x4b0b9e={};var _0x1af367={};var _0x54d64b;var _0x515a73;return db[_0xb978('0x2c')]['findOne']({'where':{'id':_0x314722[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x83755a,null))[_0xb978('0x25')](function(_0xee39c9){if(_0xee39c9){_0x54d64b=_0xee39c9;_0x1af367['model']=_[_0xb978('0x44')](db[_0xb978('0x4b')][_0xb978('0x45')]);_0x1af367[_0xb978('0x2f')]=_[_0xb978('0x44')](_0x314722['query']);_0x1af367[_0xb978('0x37')]=_[_0xb978('0x30')](_0x1af367['model'],_0x1af367[_0xb978('0x2f')]);_0x4b0b9e[_0xb978('0x32')]=_[_0xb978('0x30')](_0x1af367[_0xb978('0x31')],qs['fields'](_0x314722[_0xb978('0x2f')][_0xb978('0x33')]));_0x4b0b9e[_0xb978('0x32')]=_0x4b0b9e[_0xb978('0x32')][_0xb978('0x46')]?_0x4b0b9e[_0xb978('0x32')]:_0x1af367[_0xb978('0x31')];_0x4b0b9e[_0xb978('0x4c')]=qs[_0xb978('0x35')](_0x314722[_0xb978('0x2f')][_0xb978('0x35')]);_0x4b0b9e[_0xb978('0x36')]=qs['filters'](_[_0xb978('0x38')](_0x314722[_0xb978('0x2f')],_0x1af367[_0xb978('0x37')]));if(_0x314722['query'][_0xb978('0x39')]){_0x4b0b9e[_0xb978('0x36')]=_['merge'](_0x4b0b9e[_0xb978('0x36')],{'$or':_[_0xb978('0x2b')](_0x4b0b9e[_0xb978('0x32')],function(_0x45334d){var _0x5dda2c={};_0x5dda2c[_0x45334d]={'$like':'%'+_0x314722[_0xb978('0x2f')][_0xb978('0x39')]+'%'};return _0x5dda2c;})});}_0x4b0b9e=_['merge']({},_0x4b0b9e,_0x314722[_0xb978('0x3d')]);return _0x54d64b[_0xb978('0x4a')](_0x4b0b9e);}})['then'](function(_0x2eadb8){if(_0x2eadb8){_0x515a73=_0x2eadb8[_0xb978('0x46')];if(!_0x314722[_0xb978('0x2f')][_0xb978('0x34')](_0xb978('0x4d'))){_0x4b0b9e[_0xb978('0x1f')]=qs['limit'](_0x314722[_0xb978('0x2f')][_0xb978('0x1f')]);_0x4b0b9e[_0xb978('0x1d')]=qs['offset'](_0x314722[_0xb978('0x2f')]['offset']);}return _0x54d64b[_0xb978('0x4a')](_0x4b0b9e);}})[_0xb978('0x25')](function(_0x3c415b){if(_0x3c415b){return _0x3c415b?{'count':_0x515a73,'rows':_0x3c415b}:null;}})[_0xb978('0x25')](respondWithResult(_0x83755a,null))[_0xb978('0x41')](handleError(_0x83755a,null));};exports[_0xb978('0x4e')]=function(_0xe824e1,_0x4496a8,_0x3b7ff2){if(_0xe824e1['body']['id']){delete _0xe824e1[_0xb978('0x49')]['id'];}return db[_0xb978('0x2c')][_0xb978('0x4f')]({'where':{'id':_0xe824e1[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x4496a8,null))[_0xb978('0x25')](function(_0x311615){if(_0x311615){_0xe824e1['body'][_0xb978('0x50')]=_0x311615['id'];_0xe824e1[_0xb978('0x49')][_0xb978('0x51')]=integrations[_0xb978('0x52')](_0xe824e1[_0xb978('0x49')][_0xb978('0x53')],_0xe824e1[_0xb978('0x49')]['type']);_0xe824e1[_0xb978('0x49')][_0xb978('0x54')]=integrations[_0xb978('0x55')](_0xe824e1[_0xb978('0x49')][_0xb978('0x53')],_0xe824e1[_0xb978('0x49')][_0xb978('0x3b')]);return db['VtigerConfiguration']['create'](_0xe824e1[_0xb978('0x49')],{'include':[{'model':db[_0xb978('0x56')],'as':_0xb978('0x51')},{'model':db[_0xb978('0x56')],'as':_0xb978('0x54')}]});}return null;})[_0xb978('0x25')](respondWithResult(_0x4496a8,null))[_0xb978('0x41')](handleError(_0x4496a8,null));};var md5=require(_0xb978('0x57'));exports[_0xb978('0x58')]=function(_0x3d61b7,_0x2feb62,_0x1df2ba){var _0x3550d5=null;var _0x425259=null;var _0x48e469=null;var _0x461e8f=null;var _0x1f66a0='';return db[_0xb978('0x2c')][_0xb978('0x4f')]({'where':{'id':_0x3d61b7['params']['id']},'attributes':['id','name','username','description',_0xb978('0x59'),_0xb978('0x5a'),_0xb978('0x5b'),'accessKey']})[_0xb978('0x25')](handleEntityNotFound(_0x2feb62,null))[_0xb978('0x25')](function(_0x467235){if(_0x467235){_0x3550d5=_0x467235[_0xb978('0x5c')];_0x425259=_0x467235[_0xb978('0x5d')];_0x48e469=_0x467235[_0xb978('0x59')];_0x1f66a0=_0x467235['remoteUri'];var _0x2403a2=_0x1f66a0['slice'](-0x1);if(_0x2403a2==='/'){_0x1f66a0=_0x1f66a0[_0xb978('0x5e')](0x0,_0x1f66a0[_0xb978('0x5f')](_0x2403a2));}_0x461e8f=util['format'](_0xb978('0x60'),_0x1f66a0);var _0x3f3bd8={'method':_0xb978('0x61'),'uri':_0x461e8f,'qs':{'operation':_0xb978('0x62'),'username':_0x467235[_0xb978('0x5c')]},'json':!![]};return rp(_0x3f3bd8);}})[_0xb978('0x25')](function(_0x50bb30){if(_0x50bb30[_0xb978('0x63')]){var _0x43efbd={'method':_0xb978('0x64'),'uri':_0x461e8f,'form':{'operation':'login','username':_0x3550d5,'accessKey':md5(_0x50bb30[_0xb978('0x65')][_0xb978('0x66')]+_0x425259)},'json':!![]};return rp(_0x43efbd);}})[_0xb978('0x25')](function(_0x172e45){if(_0x172e45[_0xb978('0x63')]){var _0x3a4033={'method':_0xb978('0x61'),'uri':_0x461e8f,'qs':{'operation':_0xb978('0x67'),'username':_0x3550d5,'sessionName':_0x172e45[_0xb978('0x65')][_0xb978('0x68')],'elementType':_0x48e469},'json':!![]};return rp(_0x3a4033);}})[_0xb978('0x25')](function(_0x546faf){if(_0x546faf['success']){var _0x4a1b41=[_0xb978('0x69'),'reference',_0xb978('0x6a')];_[_0xb978('0x6b')](_0x546faf['result'][_0xb978('0x33')],function(_0x312ca0){return _0x4a1b41[_0xb978('0x6c')](_0x312ca0[_0xb978('0x3b')][_0xb978('0x28')]);});_[_0xb978('0x6b')](_0x546faf[_0xb978('0x65')][_0xb978('0x33')],function(_0x18d407){return _0x18d407[_0xb978('0x6d')]===_0xb978('0x6e');});return{'count':_0x546faf[_0xb978('0x65')][_0xb978('0x33')][_0xb978('0x46')],'rows':_[_0xb978('0x2b')](_0x546faf['result'][_0xb978('0x33')],function(_0x3fcd83){return{'id':_0x3fcd83[_0xb978('0x28')],'name':_0x3fcd83['label'],'custom':_[_0xb978('0x6f')](_0x3fcd83[_0xb978('0x28')],'cf_')?!![]:![],'options':_0x3fcd83['type'][_0xb978('0x28')]==='picklist'&&_0x3fcd83['type'][_0xb978('0x70')][_0xb978('0x46')]>0x0?_['map'](_0x3fcd83[_0xb978('0x3b')][_0xb978('0x70')],function(_0xc44131){return{'name':_0xc44131[_0xb978('0x71')],'value':_0xc44131[_0xb978('0x72')]};}):[]};})};}})[_0xb978('0x25')](respondWithResult(_0x2feb62,null))[_0xb978('0x41')](function(_0x12f517){console[_0xb978('0x73')](_0xb978('0x74')+_0x12f517);var _0x38e23f=_0x3d61b7['query']['test']?0x1f4:_0x12f517['statusCode']||0x1f4;logger[_0xb978('0x27')](_0xb978('0x75'),_0xb978('0x58'),_0x38e23f,JSON[_0xb978('0x76')](_0x12f517));delete _0x12f517[_0xb978('0x28')];if(_0x38e23f===0x191){_0x38e23f=0x190;}_0x2feb62[_0xb978('0x1b')](_0x38e23f)[_0xb978('0x29')](_0x3d61b7['query'][_0xb978('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x12f517[_0xb978('0x78')]}:_0x12f517);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index c76e62c..7afbfdf 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 _0xd588=['request-promise','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','lodash','../../config/logger','api','moment'];(function(_0x257bed,_0xd547da){var _0xd21f94=function(_0x59de75){while(--_0x59de75){_0x257bed['push'](_0x257bed['shift']());}};_0xd21f94(++_0xd547da);}(_0xd588,0x114));var _0x8d58=function(_0x4dd2ac,_0x5ad179){_0x4dd2ac=_0x4dd2ac-0x0;var _0x2526e9=_0xd588[_0x4dd2ac];return _0x2526e9;};'use strict';var _=require(_0x8d58('0x0'));var util=require('util');var logger=require(_0x8d58('0x1'))(_0x8d58('0x2'));var moment=require(_0x8d58('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d58('0x5'));var config=require('../../config/environment');var attributes=require(_0x8d58('0x6'));var integrations=require(_0x8d58('0x7'));module[_0x8d58('0x8')]=function(_0x403959,_0x1506f0){return _0x403959['define'](_0x8d58('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3c0=['request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','api'];(function(_0x376b4d,_0x302856){var _0x24916b=function(_0x5cf20e){while(--_0x5cf20e){_0x376b4d['push'](_0x376b4d['shift']());}};_0x24916b(++_0x302856);}(_0xa3c0,0x11f));var _0x0a3c=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa3c0[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0a3c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a3c('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a3c('0x2'));var config=require(_0x0a3c('0x3'));var attributes=require(_0x0a3c('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x0a3c('0x5')]=function(_0x2af764,_0x2ae708){return _0x2af764[_0x0a3c('0x6')](_0x0a3c('0x7'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 71c0564..a019c97 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 _0xbc9d=['VtigerAccount','options','raw','where','limit','include','model','attributes','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVtigerAccount'];(function(_0x6711e4,_0x4fe1ec){var _0x588792=function(_0xe19391){while(--_0xe19391){_0x6711e4['push'](_0x6711e4['shift']());}};_0x588792(++_0x4fe1ec);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x298376,_0x1b8431){_0x298376=_0x298376-0x0;var _0xe54673=_0xbc9d[_0x298376];return _0xe54673;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});}exports[_0xdbc9('0x17')]=function(_0x33f1bd){var _0x9f343d=this;return new Promise(function(_0xc2ddd2,_0x2ad952){return db[_0xdbc9('0x18')]['findAll']({'raw':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1b')]||null:null,'attributes':_0x33f1bd['options']?_0x33f1bd['options']['attributes']||null:null,'limit':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1c')]||null:null,'include':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_['map'](_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')],function(_0x1b1c0d){return{'model':db[_0x1b1c0d[_0xdbc9('0x1e')]],'as':_0x1b1c0d['as'],'attributes':_0x1b1c0d[_0xdbc9('0x1f')],'include':_0x1b1c0d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1b1c0d[_0xdbc9('0x1d')],function(_0x3c8c1d){return{'model':db[_0x3c8c1d['model']],'as':_0x3c8c1d['as'],'attributes':_0x3c8c1d[_0xdbc9('0x1f')],'include':_0x3c8c1d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x3c8c1d[_0xdbc9('0x1d')],function(_0x24fdec){return{'model':db[_0x24fdec['model']],'as':_0x24fdec['as'],'attributes':_0x24fdec[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5300bd){logger['info'](_0xdbc9('0x17'),_0x33f1bd);logger[_0xdbc9('0xe')](_0xdbc9('0x17'),_0x33f1bd,JSON['stringify'](_0x5300bd));_0xc2ddd2(_0x5300bd);})[_0xdbc9('0x16')](function(_0x539e57){logger['error'](_0xdbc9('0x17'),_0x539e57['message'],_0x33f1bd);_0x2ad952(_0x9f343d['error'](0x1f4,_0x539e57[_0xdbc9('0x13')]));});});};exports[_0xdbc9('0x21')]=function(_0x1cb557){var _0x4db824=this;return new Promise(function(_0x35eaf8,_0x22f8aa){return db['VtigerAccount']['find']({'raw':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1b')]||null:null,'attributes':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557['options'][_0xdbc9('0x1f')]||null:null,'include':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1cb557[_0xdbc9('0x19')]['include'],function(_0x1cf210){return{'model':db[_0x1cf210['model']],'as':_0x1cf210['as'],'attributes':_0x1cf210['attributes'],'include':_0x1cf210['include']?_['map'](_0x1cf210['include'],function(_0x321a37){return{'model':db[_0x321a37[_0xdbc9('0x1e')]],'as':_0x321a37['as'],'attributes':_0x321a37[_0xdbc9('0x1f')],'include':_0x321a37['include']?_[_0xdbc9('0x20')](_0x321a37[_0xdbc9('0x1d')],function(_0x2c1053){return{'model':db[_0x2c1053[_0xdbc9('0x1e')]],'as':_0x2c1053['as'],'attributes':_0x2c1053[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5bc477){logger[_0xdbc9('0x14')](_0xdbc9('0x21'),_0x1cb557);logger[_0xdbc9('0xe')]('ShowVtigerAccount',_0x1cb557,JSON[_0xdbc9('0x10')](_0x5bc477));_0x35eaf8(_0x5bc477);})[_0xdbc9('0x16')](function(_0x30fa5c){logger[_0xdbc9('0x11')]('ShowVtigerAccount',_0x30fa5c['message'],_0x1cb557);_0x22f8aa(_0x4db824[_0xdbc9('0x11')](0x1f4,_0x30fa5c[_0xdbc9('0x13')]));});});}; \ No newline at end of file +var _0x84a0=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment'];(function(_0x16c6b5,_0x28f662){var _0x48ba7b=function(_0x3c2191){while(--_0x3c2191){_0x16c6b5['push'](_0x16c6b5['shift']());}};_0x48ba7b(++_0x28f662);}(_0x84a0,0x66));var _0x084a=function(_0x3f5f56,_0x5bde9e){_0x3f5f56=_0x3f5f56-0x0;var _0x1a27c7=_0x84a0[_0x3f5f56];return _0x1a27c7;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['GetVtigerAccount']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')]({'raw':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'limit':_0xf2c333['options']?_0xf2c333[_0x084a('0x18')][_0x084a('0x1c')]||null:null,'include':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')]?_['map'](_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')],function(_0x6346a5){return{'model':db[_0x6346a5[_0x084a('0x1e')]],'as':_0x6346a5['as'],'attributes':_0x6346a5[_0x084a('0x1b')],'include':_0x6346a5[_0x084a('0x1d')]?_['map'](_0x6346a5[_0x084a('0x1d')],function(_0x2af138){return{'model':db[_0x2af138[_0x084a('0x1e')]],'as':_0x2af138['as'],'attributes':_0x2af138['attributes'],'include':_0x2af138[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x2af138[_0x084a('0x1d')],function(_0x4c5658){return{'model':db[_0x4c5658['model']],'as':_0x4c5658['as'],'attributes':_0x4c5658['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b88f){logger['info']('GetVtigerAccount',_0xf2c333);logger['debug'](_0x084a('0x20'),_0xf2c333,JSON[_0x084a('0x10')](_0x33b88f));_0x4134b9(_0x33b88f);})[_0x084a('0x15')](function(_0x2c4149){logger[_0x084a('0x11')](_0x084a('0x20'),_0x2c4149[_0x084a('0x13')],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x2c4149['message']));});});};exports[_0x084a('0x21')]=function(_0x3b2b38){var _0x501a16=this;return new Promise(function(_0xe1980b,_0x24bcf5){return db[_0x084a('0x16')][_0x084a('0x22')]({'raw':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'include':_0x3b2b38['options']?_0x3b2b38['options'][_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x3b2b38[_0x084a('0x18')][_0x084a('0x1d')],function(_0x83f94f){return{'model':db[_0x83f94f['model']],'as':_0x83f94f['as'],'attributes':_0x83f94f[_0x084a('0x1b')],'include':_0x83f94f[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x83f94f['include'],function(_0x109593){return{'model':db[_0x109593[_0x084a('0x1e')]],'as':_0x109593['as'],'attributes':_0x109593[_0x084a('0x1b')],'include':_0x109593['include']?_['map'](_0x109593['include'],function(_0xf97d1b){return{'model':db[_0xf97d1b[_0x084a('0x1e')]],'as':_0xf97d1b['as'],'attributes':_0xf97d1b[_0x084a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09c3){logger[_0x084a('0xc')](_0x084a('0x21'),_0x3b2b38);logger[_0x084a('0xd')](_0x084a('0x21'),_0x3b2b38,JSON[_0x084a('0x10')](_0x3c09c3));_0xe1980b(_0x3c09c3);})[_0x084a('0x15')](function(_0x19354f){logger[_0x084a('0x11')](_0x084a('0x21'),_0x19354f[_0x084a('0x13')],_0x3b2b38);_0x24bcf5(_0x501a16[_0x084a('0x11')](0x1f4,_0x19354f[_0x084a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 1bda7b5..13f6d68 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 _0x7304=['getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x421d8b,_0x3dcb87){var _0x3bc5b6=function(_0x3d9795){while(--_0x3d9795){_0x421d8b['push'](_0x421d8b['shift']());}};_0x3bc5b6(++_0x3dcb87);}(_0x7304,0x7b));var _0x4730=function(_0x489c95,_0x53159c){_0x489c95=_0x489c95-0x0;var _0x10e7a7=_0x7304[_0x489c95];return _0x10e7a7;};'use strict';var multer=require(_0x4730('0x0'));var util=require(_0x4730('0x1'));var path=require('path');var timeout=require(_0x4730('0x2'));var express=require('express');var router=express[_0x4730('0x3')]();var fs_extra=require(_0x4730('0x4'));var auth=require(_0x4730('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4730('0x6'));router[_0x4730('0x7')]('/',auth[_0x4730('0x8')](),controller[_0x4730('0x9')]);router[_0x4730('0x7')](_0x4730('0xa'),auth[_0x4730('0x8')](),controller[_0x4730('0xb')]);router['get'](_0x4730('0xc'),auth[_0x4730('0x8')](),controller[_0x4730('0xd')]);router[_0x4730('0x7')](_0x4730('0xe'),auth[_0x4730('0x8')](),controller[_0x4730('0xf')]);router['get'](_0x4730('0x10'),auth[_0x4730('0x8')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x4730('0x11')]);router[_0x4730('0x12')](_0x4730('0xa'),auth[_0x4730('0x8')](),controller[_0x4730('0x13')]);router[_0x4730('0x14')](_0x4730('0xa'),auth[_0x4730('0x8')](),controller[_0x4730('0x15')]);module[_0x4730('0x16')]=router; \ No newline at end of file +var _0x044a=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','util','express'];(function(_0x308493,_0x421ed6){var _0xcffb56=function(_0x643989){while(--_0x643989){_0x308493['push'](_0x308493['shift']());}};_0xcffb56(++_0x421ed6);}(_0x044a,0x82));var _0xa044=function(_0x58f711,_0x12b09e){_0x58f711=_0x58f711-0x0;var _0x2ec037=_0x044a[_0x58f711];return _0x2ec037;};'use strict';var multer=require('multer');var util=require(_0xa044('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa044('0x1'));var router=express[_0xa044('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa044('0x3'));var interaction=require(_0xa044('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xa044('0x5')]('/',auth[_0xa044('0x6')](),controller[_0xa044('0x7')]);router[_0xa044('0x5')]('/:id',auth[_0xa044('0x6')](),controller[_0xa044('0x8')]);router['get'](_0xa044('0x9'),auth['isAuthenticated'](),controller[_0xa044('0xa')]);router[_0xa044('0x5')](_0xa044('0xb'),auth[_0xa044('0x6')](),controller[_0xa044('0xc')]);router['get'](_0xa044('0xd'),auth[_0xa044('0x6')](),controller[_0xa044('0xe')]);router[_0xa044('0xf')]('/',auth['isAuthenticated'](),controller[_0xa044('0x10')]);router[_0xa044('0x11')](_0xa044('0x12'),auth[_0xa044('0x6')](),controller[_0xa044('0x13')]);router['delete'](_0xa044('0x12'),auth[_0xa044('0x6')](),controller[_0xa044('0x14')]);module[_0xa044('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 fc56495..c16ee0b 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 _0xa6d5=['STRING','sequelize','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa6d5,0x1bd));var _0x5a6d=function(_0x289db1,_0x226cc9){_0x289db1=_0x289db1-0x0;var _0xb3d744=_0xa6d5[_0x289db1];return _0xb3d744;};'use strict';var Sequelize=require(_0x5a6d('0x0'));module[_0x5a6d('0x1')]={'name':{'type':Sequelize[_0x5a6d('0x2')]},'description':{'type':Sequelize[_0x5a6d('0x2')]}}; \ No newline at end of file +var _0x4b5c=['STRING','sequelize','exports'];(function(_0x185c8b,_0x4dd54a){var _0x5b4777=function(_0x295fbd){while(--_0x295fbd){_0x185c8b['push'](_0x185c8b['shift']());}};_0x5b4777(++_0x4dd54a);}(_0x4b5c,0x1cc));var _0xc4b5=function(_0x2a2d1f,_0x478e4b){_0x2a2d1f=_0x2a2d1f-0x0;var _0x57d7eb=_0x4b5c[_0x2a2d1f];return _0x57d7eb;};'use strict';var Sequelize=require(_0xc4b5('0x0'));module[_0xc4b5('0x1')]={'name':{'type':Sequelize[_0xc4b5('0x2')]},'description':{'type':Sequelize[_0xc4b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 14416ee..2701e61 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 _0x69ae=['attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','filter','VtigerConfiguration','include','rows','catch','show','params','includeAll','options','find','create','body','getFields','findOne','VtigerField','order','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x69ae,0x1b1));var _0xe69a=function(_0x30baff,_0x1757e9){_0x30baff=_0x30baff-0x0;var _0x31abde=_0x69ae[_0x30baff];return _0x31abde;};'use strict';var emlformat=require(_0xe69a('0x0'));var rimraf=require(_0xe69a('0x1'));var zipdir=require(_0xe69a('0x2'));var jsonpatch=require(_0xe69a('0x3'));var rp=require('request-promise');var moment=require(_0xe69a('0x4'));var BPromise=require(_0xe69a('0x5'));var Mustache=require(_0xe69a('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe69a('0x7'));var csv=require('to-csv');var ejs=require(_0xe69a('0x8'));var fs=require('fs');var fs_extra=require(_0xe69a('0x9'));var _=require(_0xe69a('0xa'));var squel=require(_0xe69a('0xb'));var crypto=require(_0xe69a('0xc'));var jsforce=require(_0xe69a('0xd'));var deskjs=require(_0xe69a('0xe'));var toCsv=require(_0xe69a('0xf'));var querystring=require(_0xe69a('0x10'));var Papa=require('papaparse');var Redis=require(_0xe69a('0x11'));var authService=require(_0xe69a('0x12'));var qs=require(_0xe69a('0x13'));var as=require(_0xe69a('0x14'));var hardwareService=require(_0xe69a('0x15'));var logger=require(_0xe69a('0x16'))('api');var utils=require(_0xe69a('0x17'));var config=require(_0xe69a('0x18'));var licenseUtil=require(_0xe69a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x462c7a,_0x4d3fd1){_0x4d3fd1=_0x4d3fd1||0xcc;return function(_0x4e382b){if(_0x4e382b){return _0x462c7a[_0xe69a('0x1a')](_0x4d3fd1);}return _0x462c7a['status'](_0x4d3fd1)['end']();};}function respondWithResult(_0x27a15e,_0x47852e){_0x47852e=_0x47852e||0xc8;return function(_0x8bed97){if(_0x8bed97){return _0x27a15e['status'](_0x47852e)[_0xe69a('0x1b')](_0x8bed97);}};}function respondWithFilteredResult(_0x20079e,_0x26544a){return function(_0x27b543){if(_0x27b543){var _0x1c6fc3=typeof _0x26544a['offset']===_0xe69a('0x1c')&&typeof _0x26544a['limit']==='undefined';var _0x2e581e=_0x27b543[_0xe69a('0x1d')];var _0xb051ac=_0x1c6fc3?0x0:_0x26544a[_0xe69a('0x1e')];var _0x2f4959=_0x1c6fc3?_0x27b543[_0xe69a('0x1d')]:_0x26544a[_0xe69a('0x1e')]+_0x26544a['limit'];var _0x7229d9;if(_0x2f4959>=_0x2e581e){_0x2f4959=_0x2e581e;_0x7229d9=0xc8;}else{_0x7229d9=0xce;}_0x20079e[_0xe69a('0x1f')](_0x7229d9);return _0x20079e[_0xe69a('0x20')](_0xe69a('0x21'),_0xb051ac+'-'+_0x2f4959+'/'+_0x2e581e)['json'](_0x27b543);}return null;};}function patchUpdates(_0x5c0491){return function(_0xc4d65f){try{jsonpatch[_0xe69a('0x22')](_0xc4d65f,_0x5c0491,!![]);}catch(_0x1840eb){return BPromise[_0xe69a('0x23')](_0x1840eb);}return _0xc4d65f[_0xe69a('0x24')]();};}function saveUpdates(_0x72ad90,_0x494850){return function(_0x3af458){if(_0x3af458){return _0x3af458[_0xe69a('0x25')](_0x72ad90)[_0xe69a('0x26')](function(_0x261d01){return _0x261d01;});}return null;};}function removeEntity(_0x599155,_0x133d6b){return function(_0x5d9d8f){if(_0x5d9d8f){return _0x5d9d8f[_0xe69a('0x27')]()[_0xe69a('0x26')](function(){_0x599155[_0xe69a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e62a,_0xfb2b3c){return function(_0x393cb7){if(!_0x393cb7){_0x51e62a['sendStatus'](0x194);}return _0x393cb7;};}function handleError(_0x461e12,_0x5d7402){_0x5d7402=_0x5d7402||0x1f4;return function(_0xb7d2ee){logger['error'](_0xb7d2ee[_0xe69a('0x28')]);if(_0xb7d2ee[_0xe69a('0x29')]){delete _0xb7d2ee['name'];}_0x461e12['status'](_0x5d7402)[_0xe69a('0x2a')](_0xb7d2ee);};}exports['index']=function(_0x7aacd4,_0x2fc105){var _0x2b81c0={},_0x477600={},_0x1aabfa={'count':0x0,'rows':[]};var _0x509837=_[_0xe69a('0x2b')](db['VtigerConfiguration'][_0xe69a('0x2c')],function(_0x182cbe){return{'name':_0x182cbe[_0xe69a('0x2d')],'type':_0x182cbe[_0xe69a('0x2e')]['key']};});_0x477600['model']=_[_0xe69a('0x2b')](_0x509837,_0xe69a('0x29'));_0x477600[_0xe69a('0x2f')]=_[_0xe69a('0x30')](_0x7aacd4[_0xe69a('0x2f')]);_0x477600[_0xe69a('0x31')]=_['intersection'](_0x477600['model'],_0x477600[_0xe69a('0x2f')]);_0x2b81c0['attributes']=_[_0xe69a('0x32')](_0x477600[_0xe69a('0x33')],qs[_0xe69a('0x34')](_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x34')]));_0x2b81c0[_0xe69a('0x35')]=_0x2b81c0[_0xe69a('0x35')][_0xe69a('0x36')]?_0x2b81c0[_0xe69a('0x35')]:_0x477600[_0xe69a('0x33')];if(!_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x37')](_0xe69a('0x38'))){_0x2b81c0[_0xe69a('0x39')]=qs[_0xe69a('0x39')](_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x39')]);_0x2b81c0['offset']=qs[_0xe69a('0x1e')](_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x1e')]);}_0x2b81c0['order']=qs[_0xe69a('0x3a')](_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x3a')]);_0x2b81c0[_0xe69a('0x3b')]=qs['filters'](_['pick'](_0x7aacd4['query'],_0x477600['filters']),_0x509837);if(_0x7aacd4[_0xe69a('0x2f')]['filter']){_0x2b81c0[_0xe69a('0x3b')]=_[_0xe69a('0x3c')](_0x2b81c0[_0xe69a('0x3b')],{'$or':_[_0xe69a('0x2b')](_0x509837,function(_0x55bfce){if(_0x55bfce[_0xe69a('0x2e')]!==_0xe69a('0x3d')){var _0x1396a8={};_0x1396a8[_0x55bfce[_0xe69a('0x29')]]={'$like':'%'+_0x7aacd4[_0xe69a('0x2f')][_0xe69a('0x3e')]+'%'};return _0x1396a8;}})});}_0x2b81c0=_[_0xe69a('0x3c')]({},_0x2b81c0,_0x7aacd4['options']);var _0x57d08b={'where':_0x2b81c0[_0xe69a('0x3b')]};return db[_0xe69a('0x3f')][_0xe69a('0x1d')](_0x57d08b)[_0xe69a('0x26')](function(_0x1d2de4){_0x1aabfa[_0xe69a('0x1d')]=_0x1d2de4;if(_0x7aacd4[_0xe69a('0x2f')]['includeAll']){_0x2b81c0[_0xe69a('0x40')]=[{'all':!![]}];}return db[_0xe69a('0x3f')]['findAll'](_0x2b81c0);})[_0xe69a('0x26')](function(_0x1bd9d8){_0x1aabfa[_0xe69a('0x41')]=_0x1bd9d8;return _0x1aabfa;})[_0xe69a('0x26')](respondWithFilteredResult(_0x2fc105,_0x2b81c0))[_0xe69a('0x42')](handleError(_0x2fc105,null));};exports[_0xe69a('0x43')]=function(_0x2b9f19,_0x4d700c){var _0x18d041={'raw':![],'where':{'id':_0x2b9f19[_0xe69a('0x44')]['id']}},_0xc4698={};_0xc4698['model']=_[_0xe69a('0x30')](db[_0xe69a('0x3f')][_0xe69a('0x2c')]);_0xc4698[_0xe69a('0x2f')]=_[_0xe69a('0x30')](_0x2b9f19['query']);_0xc4698[_0xe69a('0x31')]=_['intersection'](_0xc4698['model'],_0xc4698[_0xe69a('0x2f')]);_0x18d041[_0xe69a('0x35')]=_['intersection'](_0xc4698[_0xe69a('0x33')],qs[_0xe69a('0x34')](_0x2b9f19[_0xe69a('0x2f')][_0xe69a('0x34')]));_0x18d041[_0xe69a('0x35')]=_0x18d041[_0xe69a('0x35')][_0xe69a('0x36')]?_0x18d041[_0xe69a('0x35')]:_0xc4698['model'];if(_0x2b9f19['query'][_0xe69a('0x45')]){_0x18d041[_0xe69a('0x40')]=[{'all':!![]}];}_0x18d041=_['merge']({},_0x18d041,_0x2b9f19[_0xe69a('0x46')]);return db[_0xe69a('0x3f')][_0xe69a('0x47')](_0x18d041)['then'](handleEntityNotFound(_0x4d700c,null))[_0xe69a('0x26')](respondWithResult(_0x4d700c,null))['catch'](handleError(_0x4d700c,null));};exports['create']=function(_0x350053,_0x18a97b){return db['VtigerConfiguration'][_0xe69a('0x48')](_0x350053[_0xe69a('0x49')],{})[_0xe69a('0x26')](respondWithResult(_0x18a97b,0xc9))['catch'](handleError(_0x18a97b,null));};exports['update']=function(_0x350f66,_0x4c7df6){if(_0x350f66['body']['id']){delete _0x350f66['body']['id'];}return db[_0xe69a('0x3f')][_0xe69a('0x47')]({'where':{'id':_0x350f66[_0xe69a('0x44')]['id']}})[_0xe69a('0x26')](handleEntityNotFound(_0x4c7df6,null))[_0xe69a('0x26')](saveUpdates(_0x350f66[_0xe69a('0x49')],null))[_0xe69a('0x26')](respondWithResult(_0x4c7df6,null))[_0xe69a('0x42')](handleError(_0x4c7df6,null));};exports['destroy']=function(_0x3da42b,_0x5bec77){return db['VtigerConfiguration']['find']({'where':{'id':_0x3da42b[_0xe69a('0x44')]['id']}})[_0xe69a('0x26')](handleEntityNotFound(_0x5bec77,null))[_0xe69a('0x26')](removeEntity(_0x5bec77,null))['catch'](handleError(_0x5bec77,null));};exports[_0xe69a('0x4a')]=function(_0x5314eb,_0x4e0dcb,_0x12d040){var _0x29c9d0={};var _0xc61330={};var _0x475ea1;var _0x45b93c;return db['VtigerConfiguration'][_0xe69a('0x4b')]({'where':{'id':_0x5314eb['params']['id']}})['then'](handleEntityNotFound(_0x4e0dcb,null))[_0xe69a('0x26')](function(_0x33b168){if(_0x33b168){_0x475ea1=_0x33b168;_0xc61330[_0xe69a('0x33')]=_[_0xe69a('0x30')](db[_0xe69a('0x4c')][_0xe69a('0x2c')]);_0xc61330[_0xe69a('0x2f')]=_[_0xe69a('0x30')](_0x5314eb[_0xe69a('0x2f')]);_0xc61330[_0xe69a('0x31')]=_[_0xe69a('0x32')](_0xc61330[_0xe69a('0x33')],_0xc61330['query']);_0x29c9d0['attributes']=_['intersection'](_0xc61330[_0xe69a('0x33')],qs[_0xe69a('0x34')](_0x5314eb[_0xe69a('0x2f')]['fields']));_0x29c9d0['attributes']=_0x29c9d0['attributes'][_0xe69a('0x36')]?_0x29c9d0[_0xe69a('0x35')]:_0xc61330['model'];_0x29c9d0[_0xe69a('0x4d')]=qs[_0xe69a('0x3a')](_0x5314eb[_0xe69a('0x2f')]['sort']);_0x29c9d0[_0xe69a('0x3b')]=qs[_0xe69a('0x31')](_[_0xe69a('0x4e')](_0x5314eb[_0xe69a('0x2f')],_0xc61330['filters']));if(_0x5314eb[_0xe69a('0x2f')][_0xe69a('0x3e')]){_0x29c9d0[_0xe69a('0x3b')]=_['merge'](_0x29c9d0[_0xe69a('0x3b')],{'$or':_['map'](_0x29c9d0[_0xe69a('0x35')],function(_0x12c346){var _0x14b6c4={};_0x14b6c4[_0x12c346]={'$like':'%'+_0x5314eb[_0xe69a('0x2f')][_0xe69a('0x3e')]+'%'};return _0x14b6c4;})});}_0x29c9d0=_[_0xe69a('0x3c')]({},_0x29c9d0,_0x5314eb[_0xe69a('0x46')]);return _0x475ea1[_0xe69a('0x4a')](_0x29c9d0);}})[_0xe69a('0x26')](function(_0xeb7fde){if(_0xeb7fde){_0x45b93c=_0xeb7fde[_0xe69a('0x36')];if(!_0x5314eb[_0xe69a('0x2f')][_0xe69a('0x37')](_0xe69a('0x38'))){_0x29c9d0['limit']=qs['limit'](_0x5314eb[_0xe69a('0x2f')][_0xe69a('0x39')]);_0x29c9d0[_0xe69a('0x1e')]=qs[_0xe69a('0x1e')](_0x5314eb[_0xe69a('0x2f')][_0xe69a('0x1e')]);}return _0x475ea1[_0xe69a('0x4a')](_0x29c9d0);}})[_0xe69a('0x26')](function(_0x50096d){if(_0x50096d){return _0x50096d?{'count':_0x45b93c,'rows':_0x50096d}:null;}})[_0xe69a('0x26')](respondWithResult(_0x4e0dcb,null))['catch'](handleError(_0x4e0dcb,null));};exports[_0xe69a('0x4f')]=function(_0x3b2779,_0x5f115c,_0x399ea1){var _0x2a5751={};var _0x4003c1={};var _0x3e63b8;var _0x24d1a6;return db[_0xe69a('0x3f')]['findOne']({'where':{'id':_0x3b2779[_0xe69a('0x44')]['id']}})[_0xe69a('0x26')](handleEntityNotFound(_0x5f115c,null))['then'](function(_0x4d0c0a){if(_0x4d0c0a){_0x3e63b8=_0x4d0c0a;_0x4003c1[_0xe69a('0x33')]=_['keys'](db[_0xe69a('0x4c')][_0xe69a('0x2c')]);_0x4003c1['query']=_[_0xe69a('0x30')](_0x3b2779[_0xe69a('0x2f')]);_0x4003c1[_0xe69a('0x31')]=_['intersection'](_0x4003c1[_0xe69a('0x33')],_0x4003c1[_0xe69a('0x2f')]);_0x2a5751[_0xe69a('0x35')]=_[_0xe69a('0x32')](_0x4003c1[_0xe69a('0x33')],qs[_0xe69a('0x34')](_0x3b2779['query'][_0xe69a('0x34')]));_0x2a5751[_0xe69a('0x35')]=_0x2a5751[_0xe69a('0x35')][_0xe69a('0x36')]?_0x2a5751[_0xe69a('0x35')]:_0x4003c1['model'];_0x2a5751[_0xe69a('0x4d')]=qs[_0xe69a('0x3a')](_0x3b2779[_0xe69a('0x2f')][_0xe69a('0x3a')]);_0x2a5751[_0xe69a('0x3b')]=qs['filters'](_[_0xe69a('0x4e')](_0x3b2779[_0xe69a('0x2f')],_0x4003c1[_0xe69a('0x31')]));if(_0x3b2779[_0xe69a('0x2f')][_0xe69a('0x3e')]){_0x2a5751['where']=_[_0xe69a('0x3c')](_0x2a5751['where'],{'$or':_[_0xe69a('0x2b')](_0x2a5751['attributes'],function(_0x46af02){var _0x19439b={};_0x19439b[_0x46af02]={'$like':'%'+_0x3b2779[_0xe69a('0x2f')][_0xe69a('0x3e')]+'%'};return _0x19439b;})});}_0x2a5751=_[_0xe69a('0x3c')]({},_0x2a5751,_0x3b2779[_0xe69a('0x46')]);return _0x3e63b8[_0xe69a('0x4f')](_0x2a5751);}})['then'](function(_0x2ed979){if(_0x2ed979){_0x24d1a6=_0x2ed979[_0xe69a('0x36')];if(!_0x3b2779[_0xe69a('0x2f')][_0xe69a('0x37')]('nolimit')){_0x2a5751[_0xe69a('0x39')]=qs['limit'](_0x3b2779[_0xe69a('0x2f')]['limit']);_0x2a5751[_0xe69a('0x1e')]=qs['offset'](_0x3b2779['query']['offset']);}return _0x3e63b8[_0xe69a('0x4f')](_0x2a5751);}})['then'](function(_0x3f6890){if(_0x3f6890){return _0x3f6890?{'count':_0x24d1a6,'rows':_0x3f6890}:null;}})[_0xe69a('0x26')](respondWithResult(_0x5f115c,null))['catch'](handleError(_0x5f115c,null));};exports[_0xe69a('0x50')]=function(_0x23883c,_0x5b62f3,_0x3937cf){var _0xdc5136={};var _0x5c67ee={};var _0x5935cf;var _0x1bdc17;return db[_0xe69a('0x3f')][_0xe69a('0x4b')]({'where':{'id':_0x23883c['params']['id']}})['then'](handleEntityNotFound(_0x5b62f3,null))[_0xe69a('0x26')](function(_0xd1ae6f){if(_0xd1ae6f){_0x5935cf=_0xd1ae6f;_0x5c67ee['model']=_[_0xe69a('0x30')](db[_0xe69a('0x4c')][_0xe69a('0x2c')]);_0x5c67ee['query']=_['keys'](_0x23883c[_0xe69a('0x2f')]);_0x5c67ee[_0xe69a('0x31')]=_[_0xe69a('0x32')](_0x5c67ee[_0xe69a('0x33')],_0x5c67ee[_0xe69a('0x2f')]);_0xdc5136[_0xe69a('0x35')]=_[_0xe69a('0x32')](_0x5c67ee['model'],qs['fields'](_0x23883c[_0xe69a('0x2f')][_0xe69a('0x34')]));_0xdc5136[_0xe69a('0x35')]=_0xdc5136[_0xe69a('0x35')][_0xe69a('0x36')]?_0xdc5136[_0xe69a('0x35')]:_0x5c67ee[_0xe69a('0x33')];_0xdc5136[_0xe69a('0x4d')]=qs[_0xe69a('0x3a')](_0x23883c['query'][_0xe69a('0x3a')]);_0xdc5136[_0xe69a('0x3b')]=qs[_0xe69a('0x31')](_['pick'](_0x23883c[_0xe69a('0x2f')],_0x5c67ee[_0xe69a('0x31')]));if(_0x23883c['query']['filter']){_0xdc5136['where']=_[_0xe69a('0x3c')](_0xdc5136[_0xe69a('0x3b')],{'$or':_[_0xe69a('0x2b')](_0xdc5136[_0xe69a('0x35')],function(_0x467970){var _0xd91aeb={};_0xd91aeb[_0x467970]={'$like':'%'+_0x23883c[_0xe69a('0x2f')][_0xe69a('0x3e')]+'%'};return _0xd91aeb;})});}_0xdc5136=_[_0xe69a('0x3c')]({},_0xdc5136,_0x23883c['options']);return _0x5935cf['getDescriptions'](_0xdc5136);}})['then'](function(_0x460d15){if(_0x460d15){_0x1bdc17=_0x460d15['length'];if(!_0x23883c[_0xe69a('0x2f')]['hasOwnProperty'](_0xe69a('0x38'))){_0xdc5136[_0xe69a('0x39')]=qs[_0xe69a('0x39')](_0x23883c['query']['limit']);_0xdc5136[_0xe69a('0x1e')]=qs['offset'](_0x23883c['query'][_0xe69a('0x1e')]);}return _0x5935cf['getDescriptions'](_0xdc5136);}})[_0xe69a('0x26')](function(_0x22f4a2){if(_0x22f4a2){return _0x22f4a2?{'count':_0x1bdc17,'rows':_0x22f4a2}:null;}})[_0xe69a('0x26')](respondWithResult(_0x5b62f3,null))[_0xe69a('0x42')](handleError(_0x5b62f3,null));}; \ No newline at end of file +var _0x8f12=['name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','fields','find','create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','options','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8f12,0x122));var _0x28f1=function(_0xd281e2,_0x5b9fc4){_0xd281e2=_0xd281e2-0x0;var _0xfbc4e1=_0x8f12[_0xd281e2];return _0xfbc4e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28f1('0x0'));var zipdir=require(_0x28f1('0x1'));var jsonpatch=require(_0x28f1('0x2'));var rp=require(_0x28f1('0x3'));var moment=require(_0x28f1('0x4'));var BPromise=require(_0x28f1('0x5'));var Mustache=require(_0x28f1('0x6'));var util=require(_0x28f1('0x7'));var path=require('path');var sox=require(_0x28f1('0x8'));var csv=require(_0x28f1('0x9'));var ejs=require(_0x28f1('0xa'));var fs=require('fs');var fs_extra=require(_0x28f1('0xb'));var _=require(_0x28f1('0xc'));var squel=require(_0x28f1('0xd'));var crypto=require(_0x28f1('0xe'));var jsforce=require(_0x28f1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x28f1('0x9'));var querystring=require(_0x28f1('0x10'));var Papa=require(_0x28f1('0x11'));var Redis=require(_0x28f1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x28f1('0x13'));var as=require(_0x28f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28f1('0x15'))(_0x28f1('0x16'));var utils=require(_0x28f1('0x17'));var config=require(_0x28f1('0x18'));var licenseUtil=require(_0x28f1('0x19'));var db=require(_0x28f1('0x1a'))['db'];function respondWithStatusCode(_0x5b1803,_0x1cdc05){_0x1cdc05=_0x1cdc05||0xcc;return function(_0x53120f){if(_0x53120f){return _0x5b1803[_0x28f1('0x1b')](_0x1cdc05);}return _0x5b1803[_0x28f1('0x1c')](_0x1cdc05)['end']();};}function respondWithResult(_0x288e95,_0x2ef17f){_0x2ef17f=_0x2ef17f||0xc8;return function(_0x3760b3){if(_0x3760b3){return _0x288e95[_0x28f1('0x1c')](_0x2ef17f)[_0x28f1('0x1d')](_0x3760b3);}};}function respondWithFilteredResult(_0x259031,_0x4c8432){return function(_0x51bff4){if(_0x51bff4){var _0x28603f=typeof _0x4c8432['offset']===_0x28f1('0x1e')&&typeof _0x4c8432[_0x28f1('0x1f')]===_0x28f1('0x1e');var _0x431b62=_0x51bff4[_0x28f1('0x20')];var _0x4d2414=_0x28603f?0x0:_0x4c8432['offset'];var _0x235ae0=_0x28603f?_0x51bff4[_0x28f1('0x20')]:_0x4c8432['offset']+_0x4c8432[_0x28f1('0x1f')];var _0x390667;if(_0x235ae0>=_0x431b62){_0x235ae0=_0x431b62;_0x390667=0xc8;}else{_0x390667=0xce;}_0x259031[_0x28f1('0x1c')](_0x390667);return _0x259031[_0x28f1('0x21')](_0x28f1('0x22'),_0x4d2414+'-'+_0x235ae0+'/'+_0x431b62)[_0x28f1('0x1d')](_0x51bff4);}return null;};}function patchUpdates(_0x178c5d){return function(_0x5e8785){try{jsonpatch[_0x28f1('0x23')](_0x5e8785,_0x178c5d,!![]);}catch(_0x209a2d){return BPromise['reject'](_0x209a2d);}return _0x5e8785[_0x28f1('0x24')]();};}function saveUpdates(_0x407e3c,_0x35f1fb){return function(_0x58de7e){if(_0x58de7e){return _0x58de7e[_0x28f1('0x25')](_0x407e3c)[_0x28f1('0x26')](function(_0x4e3ca1){return _0x4e3ca1;});}return null;};}function removeEntity(_0x3cf594,_0x3e1762){return function(_0x1d5fc2){if(_0x1d5fc2){return _0x1d5fc2[_0x28f1('0x27')]()[_0x28f1('0x26')](function(){_0x3cf594[_0x28f1('0x1c')](0xcc)[_0x28f1('0x28')]();});}};}function handleEntityNotFound(_0x822756,_0x57301a){return function(_0x2de57b){if(!_0x2de57b){_0x822756[_0x28f1('0x1b')](0x194);}return _0x2de57b;};}function handleError(_0x29365e,_0x2b260a){_0x2b260a=_0x2b260a||0x1f4;return function(_0x11b7bc){logger[_0x28f1('0x29')](_0x11b7bc['stack']);if(_0x11b7bc[_0x28f1('0x2a')]){delete _0x11b7bc[_0x28f1('0x2a')];}_0x29365e[_0x28f1('0x1c')](_0x2b260a)[_0x28f1('0x2b')](_0x11b7bc);};}exports[_0x28f1('0x2c')]=function(_0x49e575,_0xa58b88){var _0x22542c={},_0x905327={},_0x599b9c={'count':0x0,'rows':[]};var _0x323c0c=_[_0x28f1('0x2d')](db[_0x28f1('0x2e')][_0x28f1('0x2f')],function(_0x551d4e){return{'name':_0x551d4e[_0x28f1('0x30')],'type':_0x551d4e[_0x28f1('0x31')][_0x28f1('0x32')]};});_0x905327[_0x28f1('0x33')]=_[_0x28f1('0x2d')](_0x323c0c,_0x28f1('0x2a'));_0x905327['query']=_[_0x28f1('0x34')](_0x49e575['query']);_0x905327[_0x28f1('0x35')]=_[_0x28f1('0x36')](_0x905327[_0x28f1('0x33')],_0x905327[_0x28f1('0x37')]);_0x22542c[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x905327[_0x28f1('0x33')],qs['fields'](_0x49e575['query']['fields']));_0x22542c[_0x28f1('0x38')]=_0x22542c[_0x28f1('0x38')][_0x28f1('0x39')]?_0x22542c[_0x28f1('0x38')]:_0x905327['model'];if(!_0x49e575[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x22542c[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x49e575['query'][_0x28f1('0x1f')]);_0x22542c[_0x28f1('0x3c')]=qs[_0x28f1('0x3c')](_0x49e575['query'][_0x28f1('0x3c')]);}_0x22542c[_0x28f1('0x3d')]=qs[_0x28f1('0x3e')](_0x49e575[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x22542c['where']=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x49e575[_0x28f1('0x37')],_0x905327[_0x28f1('0x35')]),_0x323c0c);if(_0x49e575[_0x28f1('0x37')][_0x28f1('0x40')]){_0x22542c[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x22542c[_0x28f1('0x41')],{'$or':_[_0x28f1('0x2d')](_0x323c0c,function(_0x4c6448){if(_0x4c6448[_0x28f1('0x31')]!==_0x28f1('0x43')){var _0x189ac6={};_0x189ac6[_0x4c6448[_0x28f1('0x2a')]]={'$like':'%'+_0x49e575['query']['filter']+'%'};return _0x189ac6;}})});}_0x22542c=_[_0x28f1('0x42')]({},_0x22542c,_0x49e575['options']);var _0x236df0={'where':_0x22542c[_0x28f1('0x41')]};return db['VtigerConfiguration']['count'](_0x236df0)[_0x28f1('0x26')](function(_0x260d5c){_0x599b9c[_0x28f1('0x20')]=_0x260d5c;if(_0x49e575[_0x28f1('0x37')]['includeAll']){_0x22542c[_0x28f1('0x44')]=[{'all':!![]}];}return db[_0x28f1('0x2e')][_0x28f1('0x45')](_0x22542c);})['then'](function(_0x47267a){_0x599b9c[_0x28f1('0x46')]=_0x47267a;return _0x599b9c;})['then'](respondWithFilteredResult(_0xa58b88,_0x22542c))[_0x28f1('0x47')](handleError(_0xa58b88,null));};exports['show']=function(_0x593794,_0x1dd18b){var _0x142445={'raw':![],'where':{'id':_0x593794[_0x28f1('0x48')]['id']}},_0x36493b={};_0x36493b['model']=_[_0x28f1('0x34')](db[_0x28f1('0x2e')]['rawAttributes']);_0x36493b['query']=_[_0x28f1('0x34')](_0x593794[_0x28f1('0x37')]);_0x36493b[_0x28f1('0x35')]=_['intersection'](_0x36493b['model'],_0x36493b[_0x28f1('0x37')]);_0x142445['attributes']=_[_0x28f1('0x36')](_0x36493b[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x593794['query']['fields']));_0x142445['attributes']=_0x142445[_0x28f1('0x38')][_0x28f1('0x39')]?_0x142445[_0x28f1('0x38')]:_0x36493b[_0x28f1('0x33')];if(_0x593794['query']['includeAll']){_0x142445[_0x28f1('0x44')]=[{'all':!![]}];}_0x142445=_[_0x28f1('0x42')]({},_0x142445,_0x593794['options']);return db[_0x28f1('0x2e')][_0x28f1('0x4a')](_0x142445)[_0x28f1('0x26')](handleEntityNotFound(_0x1dd18b,null))[_0x28f1('0x26')](respondWithResult(_0x1dd18b,null))[_0x28f1('0x47')](handleError(_0x1dd18b,null));};exports['create']=function(_0x5e8425,_0x3768d1){return db[_0x28f1('0x2e')][_0x28f1('0x4b')](_0x5e8425['body'],{})[_0x28f1('0x26')](respondWithResult(_0x3768d1,0xc9))['catch'](handleError(_0x3768d1,null));};exports['update']=function(_0x32d3a9,_0x47dfb4){if(_0x32d3a9[_0x28f1('0x4c')]['id']){delete _0x32d3a9[_0x28f1('0x4c')]['id'];}return db['VtigerConfiguration'][_0x28f1('0x4a')]({'where':{'id':_0x32d3a9['params']['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x47dfb4,null))[_0x28f1('0x26')](saveUpdates(_0x32d3a9[_0x28f1('0x4c')],null))['then'](respondWithResult(_0x47dfb4,null))[_0x28f1('0x47')](handleError(_0x47dfb4,null));};exports[_0x28f1('0x27')]=function(_0x518f4d,_0x42b2b8){return db['VtigerConfiguration'][_0x28f1('0x4a')]({'where':{'id':_0x518f4d[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x42b2b8,null))[_0x28f1('0x26')](removeEntity(_0x42b2b8,null))[_0x28f1('0x47')](handleError(_0x42b2b8,null));};exports['getFields']=function(_0x815c49,_0x217f37,_0x31e993){var _0x4a6873={};var _0x1c566e={};var _0x529e91;var _0x13cc2c;return db['VtigerConfiguration'][_0x28f1('0x4d')]({'where':{'id':_0x815c49[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x217f37,null))['then'](function(_0x35a66f){if(_0x35a66f){_0x529e91=_0x35a66f;_0x1c566e[_0x28f1('0x33')]=_[_0x28f1('0x34')](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x1c566e[_0x28f1('0x37')]=_[_0x28f1('0x34')](_0x815c49[_0x28f1('0x37')]);_0x1c566e[_0x28f1('0x35')]=_[_0x28f1('0x36')](_0x1c566e['model'],_0x1c566e['query']);_0x4a6873[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x1c566e[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x815c49['query']['fields']));_0x4a6873['attributes']=_0x4a6873[_0x28f1('0x38')][_0x28f1('0x39')]?_0x4a6873[_0x28f1('0x38')]:_0x1c566e['model'];_0x4a6873[_0x28f1('0x3d')]=qs[_0x28f1('0x3e')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x4a6873[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x815c49[_0x28f1('0x37')],_0x1c566e[_0x28f1('0x35')]));if(_0x815c49[_0x28f1('0x37')][_0x28f1('0x40')]){_0x4a6873[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x4a6873['where'],{'$or':_[_0x28f1('0x2d')](_0x4a6873[_0x28f1('0x38')],function(_0x524ed1){var _0x2c681e={};_0x2c681e[_0x524ed1]={'$like':'%'+_0x815c49[_0x28f1('0x37')]['filter']+'%'};return _0x2c681e;})});}_0x4a6873=_[_0x28f1('0x42')]({},_0x4a6873,_0x815c49['options']);return _0x529e91[_0x28f1('0x4f')](_0x4a6873);}})[_0x28f1('0x26')](function(_0x5c1812){if(_0x5c1812){_0x13cc2c=_0x5c1812[_0x28f1('0x39')];if(!_0x815c49[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x4a6873[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x1f')]);_0x4a6873[_0x28f1('0x3c')]=qs[_0x28f1('0x3c')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x3c')]);}return _0x529e91['getFields'](_0x4a6873);}})[_0x28f1('0x26')](function(_0x52f875){if(_0x52f875){return _0x52f875?{'count':_0x13cc2c,'rows':_0x52f875}:null;}})[_0x28f1('0x26')](respondWithResult(_0x217f37,null))['catch'](handleError(_0x217f37,null));};exports['getSubjects']=function(_0x35ad47,_0xbf1e7f,_0xa6ce6f){var _0x5802b7={};var _0x24d24e={};var _0x22b068;var _0x2b57f5;return db[_0x28f1('0x2e')][_0x28f1('0x4d')]({'where':{'id':_0x35ad47[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0xbf1e7f,null))[_0x28f1('0x26')](function(_0x464e76){if(_0x464e76){_0x22b068=_0x464e76;_0x24d24e[_0x28f1('0x33')]=_[_0x28f1('0x34')](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x24d24e[_0x28f1('0x37')]=_['keys'](_0x35ad47[_0x28f1('0x37')]);_0x24d24e[_0x28f1('0x35')]=_['intersection'](_0x24d24e[_0x28f1('0x33')],_0x24d24e[_0x28f1('0x37')]);_0x5802b7[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x24d24e[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x35ad47['query'][_0x28f1('0x49')]));_0x5802b7[_0x28f1('0x38')]=_0x5802b7['attributes'][_0x28f1('0x39')]?_0x5802b7['attributes']:_0x24d24e['model'];_0x5802b7[_0x28f1('0x3d')]=qs['sort'](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x5802b7[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x35ad47[_0x28f1('0x37')],_0x24d24e[_0x28f1('0x35')]));if(_0x35ad47[_0x28f1('0x37')]['filter']){_0x5802b7[_0x28f1('0x41')]=_['merge'](_0x5802b7[_0x28f1('0x41')],{'$or':_[_0x28f1('0x2d')](_0x5802b7[_0x28f1('0x38')],function(_0xe89a0e){var _0x2c8822={};_0x2c8822[_0xe89a0e]={'$like':'%'+_0x35ad47[_0x28f1('0x37')][_0x28f1('0x40')]+'%'};return _0x2c8822;})});}_0x5802b7=_[_0x28f1('0x42')]({},_0x5802b7,_0x35ad47['options']);return _0x22b068[_0x28f1('0x50')](_0x5802b7);}})[_0x28f1('0x26')](function(_0xff9782){if(_0xff9782){_0x2b57f5=_0xff9782[_0x28f1('0x39')];if(!_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x5802b7[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x1f')]);_0x5802b7[_0x28f1('0x3c')]=qs['offset'](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3c')]);}return _0x22b068[_0x28f1('0x50')](_0x5802b7);}})['then'](function(_0x2c0d56){if(_0x2c0d56){return _0x2c0d56?{'count':_0x2b57f5,'rows':_0x2c0d56}:null;}})[_0x28f1('0x26')](respondWithResult(_0xbf1e7f,null))[_0x28f1('0x47')](handleError(_0xbf1e7f,null));};exports[_0x28f1('0x51')]=function(_0x3b5595,_0xe8b5e2,_0x297b5d){var _0x148c40={};var _0x56f5c8={};var _0x555831;var _0x1c52c6;return db['VtigerConfiguration'][_0x28f1('0x4d')]({'where':{'id':_0x3b5595[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0xe8b5e2,null))['then'](function(_0x3f9fc0){if(_0x3f9fc0){_0x555831=_0x3f9fc0;_0x56f5c8[_0x28f1('0x33')]=_['keys'](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x56f5c8[_0x28f1('0x37')]=_[_0x28f1('0x34')](_0x3b5595[_0x28f1('0x37')]);_0x56f5c8['filters']=_[_0x28f1('0x36')](_0x56f5c8[_0x28f1('0x33')],_0x56f5c8[_0x28f1('0x37')]);_0x148c40[_0x28f1('0x38')]=_['intersection'](_0x56f5c8['model'],qs['fields'](_0x3b5595[_0x28f1('0x37')][_0x28f1('0x49')]));_0x148c40[_0x28f1('0x38')]=_0x148c40[_0x28f1('0x38')][_0x28f1('0x39')]?_0x148c40['attributes']:_0x56f5c8[_0x28f1('0x33')];_0x148c40['order']=qs[_0x28f1('0x3e')](_0x3b5595[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x148c40[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x3b5595['query'],_0x56f5c8[_0x28f1('0x35')]));if(_0x3b5595[_0x28f1('0x37')][_0x28f1('0x40')]){_0x148c40[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x148c40['where'],{'$or':_[_0x28f1('0x2d')](_0x148c40['attributes'],function(_0x2b41e6){var _0x2bf6dc={};_0x2bf6dc[_0x2b41e6]={'$like':'%'+_0x3b5595[_0x28f1('0x37')][_0x28f1('0x40')]+'%'};return _0x2bf6dc;})});}_0x148c40=_[_0x28f1('0x42')]({},_0x148c40,_0x3b5595[_0x28f1('0x52')]);return _0x555831[_0x28f1('0x51')](_0x148c40);}})[_0x28f1('0x26')](function(_0x201e54){if(_0x201e54){_0x1c52c6=_0x201e54[_0x28f1('0x39')];if(!_0x3b5595[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x148c40[_0x28f1('0x1f')]=qs['limit'](_0x3b5595['query'][_0x28f1('0x1f')]);_0x148c40['offset']=qs[_0x28f1('0x3c')](_0x3b5595[_0x28f1('0x37')]['offset']);}return _0x555831[_0x28f1('0x51')](_0x148c40);}})[_0x28f1('0x26')](function(_0x58590c){if(_0x58590c){return _0x58590c?{'count':_0x1c52c6,'rows':_0x58590c}:null;}})[_0x28f1('0x26')](respondWithResult(_0xe8b5e2,null))[_0x28f1('0x47')](handleError(_0xe8b5e2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 700b087..5b7113a 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 _0xef72=['path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x451655,_0x1be29f){var _0x2bdf91=function(_0x593d70){while(--_0x593d70){_0x451655['push'](_0x451655['shift']());}};_0x2bdf91(++_0x1be29f);}(_0xef72,0x156));var _0x2ef7=function(_0x17fe54,_0x21b124){_0x17fe54=_0x17fe54-0x0;var _0x228c78=_0xef72[_0x17fe54];return _0x228c78;};'use strict';var _=require(_0x2ef7('0x0'));var util=require('util');var logger=require(_0x2ef7('0x1'))(_0x2ef7('0x2'));var moment=require(_0x2ef7('0x3'));var BPromise=require(_0x2ef7('0x4'));var rp=require(_0x2ef7('0x5'));var fs=require('fs');var path=require(_0x2ef7('0x6'));var rimraf=require('rimraf');var config=require(_0x2ef7('0x7'));var attributes=require(_0x2ef7('0x8'));module[_0x2ef7('0x9')]=function(_0x2642ac,_0x3c04f1){return _0x2642ac[_0x2ef7('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x2ef7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc6c=['./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc6c,0xfb));var _0xcdc6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xdc6c[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xcdc6('0x0'));var util=require(_0xcdc6('0x1'));var logger=require(_0xcdc6('0x2'))(_0xcdc6('0x3'));var moment=require(_0xcdc6('0x4'));var BPromise=require('bluebird');var rp=require(_0xcdc6('0x5'));var fs=require('fs');var path=require(_0xcdc6('0x6'));var rimraf=require(_0xcdc6('0x7'));var config=require(_0xcdc6('0x8'));var attributes=require(_0xcdc6('0x9'));module['exports']=function(_0x59f229,_0x47197f){return _0x59f229[_0xcdc6('0xa')](_0xcdc6('0xb'),attributes,{'tableName':_0xcdc6('0xc'),'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 c6e4978..2db437f 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 _0x4821=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4821,0x107));var _0x1482=function(_0x4d82b1,_0x616257){_0x4d82b1=_0x4d82b1-0x0;var _0x3803c1=_0x4821[_0x4d82b1];return _0x3803c1;};'use strict';var _=require(_0x1482('0x0'));var util=require(_0x1482('0x1'));var moment=require(_0x1482('0x2'));var BPromise=require(_0x1482('0x3'));var rs=require(_0x1482('0x4'));var fs=require('fs');var Redis=require(_0x1482('0x5'));var db=require(_0x1482('0x6'))['db'];var utils=require(_0x1482('0x7'));var logger=require(_0x1482('0x8'))(_0x1482('0x9'));var config=require(_0x1482('0xa'));var jayson=require(_0x1482('0xb'));var client=jayson[_0x1482('0xc')][_0x1482('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2fc172,_0x19b62d,_0xda7de9){return new BPromise(function(_0x148c7f,_0x1b028a){return client[_0x1482('0xe')](_0x2fc172,_0xda7de9)[_0x1482('0xf')](function(_0x5cb761){logger[_0x1482('0x10')](_0x1482('0x11'),_0x19b62d,_0x1482('0x12'));logger[_0x1482('0x13')](_0x1482('0x14'),_0x19b62d,'request\x20sent',JSON[_0x1482('0x15')](_0x5cb761));if(_0x5cb761[_0x1482('0x16')]){if(_0x5cb761[_0x1482('0x16')][_0x1482('0x17')]===0x1f4){logger[_0x1482('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x19b62d,_0x5cb761['error'][_0x1482('0x18')]);return _0x1b028a(_0x5cb761[_0x1482('0x16')]['message']);}logger['error'](_0x1482('0x11'),_0x19b62d,_0x5cb761[_0x1482('0x16')][_0x1482('0x18')]);return _0x148c7f(_0x5cb761[_0x1482('0x16')][_0x1482('0x18')]);}else{logger['info'](_0x1482('0x11'),_0x19b62d,_0x1482('0x12'));_0x148c7f(_0x5cb761[_0x1482('0x19')][_0x1482('0x18')]);}})[_0x1482('0x1a')](function(_0x1e5923){logger['error'](_0x1482('0x11'),_0x19b62d,_0x1e5923);_0x1b028a(_0x1e5923);});});} \ No newline at end of file +var _0x29ae=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0x508081,_0x17364f){var _0x2f06fb=function(_0x247411){while(--_0x247411){_0x508081['push'](_0x508081['shift']());}};_0x2f06fb(++_0x17364f);}(_0x29ae,0x16e));var _0xe29a=function(_0x4467f7,_0x4c0b24){_0x4467f7=_0x4467f7-0x0;var _0x36a27b=_0x29ae[_0x4467f7];return _0x36a27b;};'use strict';var _=require(_0xe29a('0x0'));var util=require(_0xe29a('0x1'));var moment=require('moment');var BPromise=require(_0xe29a('0x2'));var rs=require(_0xe29a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe29a('0x4'))['db'];var utils=require(_0xe29a('0x5'));var logger=require(_0xe29a('0x6'))(_0xe29a('0x7'));var config=require(_0xe29a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe29a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0335b,_0x2d8f49,_0x131926){return new BPromise(function(_0x50ca69,_0x1e5ad4){return client['request'](_0xa0335b,_0x131926)[_0xe29a('0xa')](function(_0x299cab){logger[_0xe29a('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x2d8f49,_0xe29a('0xc'));logger[_0xe29a('0xd')](_0xe29a('0xe'),_0x2d8f49,_0xe29a('0xc'),JSON['stringify'](_0x299cab));if(_0x299cab['error']){if(_0x299cab[_0xe29a('0xf')][_0xe29a('0x10')]===0x1f4){logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x299cab[_0xe29a('0xf')]['message']);return _0x1e5ad4(_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);}logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);return _0x50ca69(_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);}else{logger['info'](_0xe29a('0x11'),_0x2d8f49,_0xe29a('0xc'));_0x50ca69(_0x299cab[_0xe29a('0x13')][_0xe29a('0x12')]);}})[_0xe29a('0x14')](function(_0x23aaee){logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x23aaee);_0x1e5ad4(_0x23aaee);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index da9ed9c..79cc07e 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 _0x9e14=['show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e14,0x1ce));var _0x49e1=function(_0x7f74be,_0x4bb101){_0x7f74be=_0x7f74be-0x0;var _0x18cbf5=_0x9e14[_0x7f74be];return _0x18cbf5;};'use strict';var multer=require(_0x49e1('0x0'));var util=require(_0x49e1('0x1'));var path=require(_0x49e1('0x2'));var timeout=require(_0x49e1('0x3'));var express=require('express');var router=express[_0x49e1('0x4')]();var fs_extra=require(_0x49e1('0x5'));var auth=require(_0x49e1('0x6'));var interaction=require(_0x49e1('0x7'));var config=require(_0x49e1('0x8'));var controller=require(_0x49e1('0x9'));router[_0x49e1('0xa')]('/',auth[_0x49e1('0xb')](),controller['index']);router[_0x49e1('0xa')](_0x49e1('0xc'),auth[_0x49e1('0xb')](),controller[_0x49e1('0xd')]);router[_0x49e1('0xe')]('/',auth[_0x49e1('0xb')](),controller[_0x49e1('0xf')]);router[_0x49e1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x49e1('0x11')](_0x49e1('0xc'),auth[_0x49e1('0xb')](),controller[_0x49e1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x60dc=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x59db98,_0x554650){var _0x95e9f2=function(_0xbd3dab){while(--_0xbd3dab){_0x59db98['push'](_0x59db98['shift']());}};_0x95e9f2(++_0x554650);}(_0x60dc,0x12d));var _0xc60d=function(_0x11916b,_0x43e325){_0x11916b=_0x11916b-0x0;var _0x13affd=_0x60dc[_0x11916b];return _0x13affd;};'use strict';var multer=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var path=require(_0xc60d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc60d('0x3'));var router=express[_0xc60d('0x4')]();var fs_extra=require(_0xc60d('0x5'));var auth=require(_0xc60d('0x6'));var interaction=require(_0xc60d('0x7'));var config=require('../../config/environment');var controller=require(_0xc60d('0x8'));router[_0xc60d('0x9')]('/',auth['isAuthenticated'](),controller[_0xc60d('0xa')]);router[_0xc60d('0x9')](_0xc60d('0xb'),auth[_0xc60d('0xc')](),controller[_0xc60d('0xd')]);router['post']('/',auth[_0xc60d('0xc')](),controller[_0xc60d('0xe')]);router[_0xc60d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc60d('0x10')](_0xc60d('0xb'),auth[_0xc60d('0xc')](),controller[_0xc60d('0x11')]);module[_0xc60d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b274649..27ec494 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 _0x3325=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x326526,_0x18f942){var _0x835bef=function(_0x6dbdb0){while(--_0x6dbdb0){_0x326526['push'](_0x326526['shift']());}};_0x835bef(++_0x18f942);}(_0x3325,0xdd));var _0x5332=function(_0x40d548,_0x233d52){_0x40d548=_0x40d548-0x0;var _0x1791f8=_0x3325[_0x40d548];return _0x1791f8;};'use strict';var Sequelize=require(_0x5332('0x0'));module['exports']={'type':{'type':Sequelize[_0x5332('0x1')](_0x5332('0x2'),_0x5332('0x3'),_0x5332('0x4'),_0x5332('0x5'),_0x5332('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5332('0x7')]},'key':{'type':Sequelize[_0x5332('0x7')]},'keyType':{'type':Sequelize[_0x5332('0x1')](_0x5332('0x2'),_0x5332('0x3'),_0x5332('0x4'))},'keyContent':{'type':Sequelize[_0x5332('0x7')]},'idField':{'type':Sequelize[_0x5332('0x7')]},'nameField':{'type':Sequelize[_0x5332('0x7')]},'customField':{'type':Sequelize[_0x5332('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5332('0x7')]}}; \ No newline at end of file +var _0x1de0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1de0,0xb2));var _0x01de=function(_0x7bc63a,_0x26422a){_0x7bc63a=_0x7bc63a-0x0;var _0xed898e=_0x1de0[_0x7bc63a];return _0xed898e;};'use strict';var Sequelize=require(_0x01de('0x0'));module[_0x01de('0x1')]={'type':{'type':Sequelize[_0x01de('0x2')](_0x01de('0x3'),_0x01de('0x4'),_0x01de('0x5'),_0x01de('0x6'),_0x01de('0x7')),'defaultValue':_0x01de('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x01de('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x01de('0x5'))},'keyContent':{'type':Sequelize[_0x01de('0x8')]},'idField':{'type':Sequelize[_0x01de('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x01de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f5b62cf..1163dd2 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 _0x3e90=['ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VtigerField','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse'];(function(_0x5d0f97,_0x25009f){var _0xc7236=function(_0xa7353f){while(--_0xa7353f){_0x5d0f97['push'](_0x5d0f97['shift']());}};_0xc7236(++_0x25009f);}(_0x3e90,0x114));var _0x03e9=function(_0x4bd0a7,_0xade16){_0x4bd0a7=_0x4bd0a7-0x0;var _0x560d7a=_0x3e90[_0x4bd0a7];return _0x560d7a;};'use strict';var emlformat=require(_0x03e9('0x0'));var rimraf=require(_0x03e9('0x1'));var zipdir=require(_0x03e9('0x2'));var jsonpatch=require(_0x03e9('0x3'));var rp=require('request-promise');var moment=require(_0x03e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03e9('0x5'));var util=require(_0x03e9('0x6'));var path=require('path');var sox=require(_0x03e9('0x7'));var csv=require('to-csv');var ejs=require(_0x03e9('0x8'));var fs=require('fs');var fs_extra=require(_0x03e9('0x9'));var _=require(_0x03e9('0xa'));var squel=require(_0x03e9('0xb'));var crypto=require(_0x03e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x03e9('0xd'));var toCsv=require(_0x03e9('0xe'));var querystring=require('querystring');var Papa=require(_0x03e9('0xf'));var Redis=require(_0x03e9('0x10'));var authService=require(_0x03e9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03e9('0x12'));var logger=require('../../config/logger')(_0x03e9('0x13'));var utils=require(_0x03e9('0x14'));var config=require(_0x03e9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x03e9('0x16'))['db'];function respondWithStatusCode(_0x319f42,_0x4f1a64){_0x4f1a64=_0x4f1a64||0xcc;return function(_0x1a4de8){if(_0x1a4de8){return _0x319f42[_0x03e9('0x17')](_0x4f1a64);}return _0x319f42[_0x03e9('0x18')](_0x4f1a64)['end']();};}function respondWithResult(_0x4ba627,_0x570f7b){_0x570f7b=_0x570f7b||0xc8;return function(_0x254b35){if(_0x254b35){return _0x4ba627['status'](_0x570f7b)[_0x03e9('0x19')](_0x254b35);}};}function respondWithFilteredResult(_0x119bf0,_0x403f8e){return function(_0x19ee2b){if(_0x19ee2b){var _0x426b38=typeof _0x403f8e[_0x03e9('0x1a')]===_0x03e9('0x1b')&&typeof _0x403f8e[_0x03e9('0x1c')]===_0x03e9('0x1b');var _0x22b114=_0x19ee2b[_0x03e9('0x1d')];var _0x510231=_0x426b38?0x0:_0x403f8e[_0x03e9('0x1a')];var _0x205697=_0x426b38?_0x19ee2b[_0x03e9('0x1d')]:_0x403f8e[_0x03e9('0x1a')]+_0x403f8e[_0x03e9('0x1c')];var _0x3a448e;if(_0x205697>=_0x22b114){_0x205697=_0x22b114;_0x3a448e=0xc8;}else{_0x3a448e=0xce;}_0x119bf0[_0x03e9('0x18')](_0x3a448e);return _0x119bf0['set']('Content-Range',_0x510231+'-'+_0x205697+'/'+_0x22b114)[_0x03e9('0x19')](_0x19ee2b);}return null;};}function patchUpdates(_0x446424){return function(_0x39ea75){try{jsonpatch[_0x03e9('0x1e')](_0x39ea75,_0x446424,!![]);}catch(_0x3cfc7e){return BPromise[_0x03e9('0x1f')](_0x3cfc7e);}return _0x39ea75[_0x03e9('0x20')]();};}function saveUpdates(_0x3deae1,_0x59ae8f){return function(_0x4d36ac){if(_0x4d36ac){return _0x4d36ac['update'](_0x3deae1)[_0x03e9('0x21')](function(_0x59cf12){return _0x59cf12;});}return null;};}function removeEntity(_0xffee5f,_0x1d5e6d){return function(_0xab798){if(_0xab798){return _0xab798[_0x03e9('0x22')]()[_0x03e9('0x21')](function(){_0xffee5f['status'](0xcc)[_0x03e9('0x23')]();});}};}function handleEntityNotFound(_0x5a737a,_0x305148){return function(_0x58c6bc){if(!_0x58c6bc){_0x5a737a[_0x03e9('0x17')](0x194);}return _0x58c6bc;};}function handleError(_0x13120e,_0x3e9dfc){_0x3e9dfc=_0x3e9dfc||0x1f4;return function(_0x4a4b9e){logger[_0x03e9('0x24')](_0x4a4b9e['stack']);if(_0x4a4b9e['name']){delete _0x4a4b9e[_0x03e9('0x25')];}_0x13120e[_0x03e9('0x18')](_0x3e9dfc)['send'](_0x4a4b9e);};}exports[_0x03e9('0x26')]=function(_0x185de2,_0x46e449){var _0x4ea80a={},_0x519b28={},_0x5026fa={'count':0x0,'rows':[]};var _0x1fa99e=_[_0x03e9('0x27')](db['VtigerField'][_0x03e9('0x28')],function(_0xf1ed3b){return{'name':_0xf1ed3b[_0x03e9('0x29')],'type':_0xf1ed3b[_0x03e9('0x2a')][_0x03e9('0x2b')]};});_0x519b28['model']=_[_0x03e9('0x27')](_0x1fa99e,_0x03e9('0x25'));_0x519b28['query']=_[_0x03e9('0x2c')](_0x185de2['query']);_0x519b28['filters']=_[_0x03e9('0x2d')](_0x519b28[_0x03e9('0x2e')],_0x519b28[_0x03e9('0x2f')]);_0x4ea80a[_0x03e9('0x30')]=_['intersection'](_0x519b28[_0x03e9('0x2e')],qs[_0x03e9('0x31')](_0x185de2[_0x03e9('0x2f')]['fields']));_0x4ea80a[_0x03e9('0x30')]=_0x4ea80a['attributes'][_0x03e9('0x32')]?_0x4ea80a[_0x03e9('0x30')]:_0x519b28['model'];if(!_0x185de2[_0x03e9('0x2f')][_0x03e9('0x33')](_0x03e9('0x34'))){_0x4ea80a['limit']=qs[_0x03e9('0x1c')](_0x185de2['query'][_0x03e9('0x1c')]);_0x4ea80a['offset']=qs[_0x03e9('0x1a')](_0x185de2[_0x03e9('0x2f')][_0x03e9('0x1a')]);}_0x4ea80a[_0x03e9('0x35')]=qs[_0x03e9('0x36')](_0x185de2['query'][_0x03e9('0x36')]);_0x4ea80a[_0x03e9('0x37')]=qs[_0x03e9('0x38')](_[_0x03e9('0x39')](_0x185de2['query'],_0x519b28[_0x03e9('0x38')]),_0x1fa99e);if(_0x185de2[_0x03e9('0x2f')][_0x03e9('0x3a')]){_0x4ea80a['where']=_[_0x03e9('0x3b')](_0x4ea80a['where'],{'$or':_[_0x03e9('0x27')](_0x1fa99e,function(_0x50f631){if(_0x50f631[_0x03e9('0x2a')]!=='VIRTUAL'){var _0x3a5eac={};_0x3a5eac[_0x50f631[_0x03e9('0x25')]]={'$like':'%'+_0x185de2[_0x03e9('0x2f')][_0x03e9('0x3a')]+'%'};return _0x3a5eac;}})});}_0x4ea80a=_[_0x03e9('0x3b')]({},_0x4ea80a,_0x185de2[_0x03e9('0x3c')]);var _0x59db8a={'where':_0x4ea80a[_0x03e9('0x37')]};return db[_0x03e9('0x3d')]['count'](_0x59db8a)['then'](function(_0x2250d0){_0x5026fa[_0x03e9('0x1d')]=_0x2250d0;if(_0x185de2[_0x03e9('0x2f')]['includeAll']){_0x4ea80a[_0x03e9('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x03e9('0x3f')](_0x4ea80a);})[_0x03e9('0x21')](function(_0x2a8440){_0x5026fa[_0x03e9('0x40')]=_0x2a8440;return _0x5026fa;})[_0x03e9('0x21')](respondWithFilteredResult(_0x46e449,_0x4ea80a))[_0x03e9('0x41')](handleError(_0x46e449,null));};exports[_0x03e9('0x42')]=function(_0xc777b8,_0xe5185b){var _0x569f01={'raw':!![],'where':{'id':_0xc777b8[_0x03e9('0x43')]['id']}},_0x34f9bb={};_0x34f9bb[_0x03e9('0x2e')]=_[_0x03e9('0x2c')](db[_0x03e9('0x3d')][_0x03e9('0x28')]);_0x34f9bb['query']=_[_0x03e9('0x2c')](_0xc777b8[_0x03e9('0x2f')]);_0x34f9bb['filters']=_[_0x03e9('0x2d')](_0x34f9bb[_0x03e9('0x2e')],_0x34f9bb['query']);_0x569f01[_0x03e9('0x30')]=_[_0x03e9('0x2d')](_0x34f9bb[_0x03e9('0x2e')],qs[_0x03e9('0x31')](_0xc777b8['query']['fields']));_0x569f01[_0x03e9('0x30')]=_0x569f01[_0x03e9('0x30')]['length']?_0x569f01[_0x03e9('0x30')]:_0x34f9bb[_0x03e9('0x2e')];if(_0xc777b8[_0x03e9('0x2f')][_0x03e9('0x44')]){_0x569f01[_0x03e9('0x3e')]=[{'all':!![]}];}_0x569f01=_['merge']({},_0x569f01,_0xc777b8[_0x03e9('0x3c')]);return db[_0x03e9('0x3d')][_0x03e9('0x45')](_0x569f01)[_0x03e9('0x21')](handleEntityNotFound(_0xe5185b,null))['then'](respondWithResult(_0xe5185b,null))['catch'](handleError(_0xe5185b,null));};exports[_0x03e9('0x46')]=function(_0x58ef4b,_0x2a90c0){return db[_0x03e9('0x3d')][_0x03e9('0x46')](_0x58ef4b['body'],{})['then'](respondWithResult(_0x2a90c0,0xc9))[_0x03e9('0x41')](handleError(_0x2a90c0,null));};exports[_0x03e9('0x47')]=function(_0x2cecc0,_0xc19e45){if(_0x2cecc0['body']['id']){delete _0x2cecc0[_0x03e9('0x48')]['id'];}return db[_0x03e9('0x3d')][_0x03e9('0x45')]({'where':{'id':_0x2cecc0[_0x03e9('0x43')]['id']}})['then'](handleEntityNotFound(_0xc19e45,null))[_0x03e9('0x21')](saveUpdates(_0x2cecc0[_0x03e9('0x48')],null))['then'](respondWithResult(_0xc19e45,null))[_0x03e9('0x41')](handleError(_0xc19e45,null));};exports['destroy']=function(_0x51e9b8,_0x2447b3){return db['VtigerField'][_0x03e9('0x45')]({'where':{'id':_0x51e9b8['params']['id']}})[_0x03e9('0x21')](handleEntityNotFound(_0x2447b3,null))[_0x03e9('0x21')](removeEntity(_0x2447b3,null))['catch'](handleError(_0x2447b3,null));}; \ No newline at end of file +var _0x6828=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','then','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','name','send','index','map','VtigerField'];(function(_0x588cbd,_0x35d7a3){var _0x88e11b=function(_0x2fb23b){while(--_0x2fb23b){_0x588cbd['push'](_0x588cbd['shift']());}};_0x88e11b(++_0x35d7a3);}(_0x6828,0xf5));var _0x8682=function(_0x478301,_0x485c86){_0x478301=_0x478301-0x0;var _0x2f7778=_0x6828[_0x478301];return _0x2f7778;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8682('0x0'));var zipdir=require(_0x8682('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8682('0x2'));var moment=require(_0x8682('0x3'));var BPromise=require(_0x8682('0x4'));var Mustache=require(_0x8682('0x5'));var util=require('util');var path=require(_0x8682('0x6'));var sox=require(_0x8682('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8682('0x8'));var _=require(_0x8682('0x9'));var squel=require(_0x8682('0xa'));var crypto=require(_0x8682('0xb'));var jsforce=require(_0x8682('0xc'));var deskjs=require(_0x8682('0xd'));var toCsv=require(_0x8682('0xe'));var querystring=require(_0x8682('0xf'));var Papa=require(_0x8682('0x10'));var Redis=require('ioredis');var authService=require(_0x8682('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8682('0x12'));var logger=require('../../config/logger')(_0x8682('0x13'));var utils=require(_0x8682('0x14'));var config=require(_0x8682('0x15'));var licenseUtil=require(_0x8682('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f0907,_0x1304c2){_0x1304c2=_0x1304c2||0xcc;return function(_0x296a65){if(_0x296a65){return _0x3f0907[_0x8682('0x17')](_0x1304c2);}return _0x3f0907['status'](_0x1304c2)[_0x8682('0x18')]();};}function respondWithResult(_0x1e3ac2,_0x1c118d){_0x1c118d=_0x1c118d||0xc8;return function(_0x518aad){if(_0x518aad){return _0x1e3ac2[_0x8682('0x19')](_0x1c118d)[_0x8682('0x1a')](_0x518aad);}};}function respondWithFilteredResult(_0x2d9657,_0x145e94){return function(_0x38b6a0){if(_0x38b6a0){var _0x3271ff=typeof _0x145e94[_0x8682('0x1b')]===_0x8682('0x1c')&&typeof _0x145e94[_0x8682('0x1d')]==='undefined';var _0xb200ed=_0x38b6a0[_0x8682('0x1e')];var _0xaa3754=_0x3271ff?0x0:_0x145e94['offset'];var _0x1e7ee8=_0x3271ff?_0x38b6a0['count']:_0x145e94[_0x8682('0x1b')]+_0x145e94['limit'];var _0x4054a8;if(_0x1e7ee8>=_0xb200ed){_0x1e7ee8=_0xb200ed;_0x4054a8=0xc8;}else{_0x4054a8=0xce;}_0x2d9657[_0x8682('0x19')](_0x4054a8);return _0x2d9657[_0x8682('0x1f')](_0x8682('0x20'),_0xaa3754+'-'+_0x1e7ee8+'/'+_0xb200ed)[_0x8682('0x1a')](_0x38b6a0);}return null;};}function patchUpdates(_0x2f9714){return function(_0x3dc958){try{jsonpatch[_0x8682('0x21')](_0x3dc958,_0x2f9714,!![]);}catch(_0x43e534){return BPromise[_0x8682('0x22')](_0x43e534);}return _0x3dc958[_0x8682('0x23')]();};}function saveUpdates(_0x3bf391,_0xa47715){return function(_0x49d33f){if(_0x49d33f){return _0x49d33f['update'](_0x3bf391)['then'](function(_0x46ec0a){return _0x46ec0a;});}return null;};}function removeEntity(_0x6aff79,_0x43981e){return function(_0x3737ae){if(_0x3737ae){return _0x3737ae[_0x8682('0x24')]()['then'](function(){_0x6aff79[_0x8682('0x19')](0xcc)[_0x8682('0x18')]();});}};}function handleEntityNotFound(_0x67f9f2,_0x2b84f){return function(_0x3e302c){if(!_0x3e302c){_0x67f9f2[_0x8682('0x17')](0x194);}return _0x3e302c;};}function handleError(_0x4d7cd3,_0x5d0a06){_0x5d0a06=_0x5d0a06||0x1f4;return function(_0x321427){logger[_0x8682('0x25')](_0x321427['stack']);if(_0x321427[_0x8682('0x26')]){delete _0x321427[_0x8682('0x26')];}_0x4d7cd3[_0x8682('0x19')](_0x5d0a06)[_0x8682('0x27')](_0x321427);};}exports[_0x8682('0x28')]=function(_0x41addc,_0x476e4b){var _0x871b11={},_0x33b48e={},_0x566742={'count':0x0,'rows':[]};var _0x510655=_[_0x8682('0x29')](db[_0x8682('0x2a')]['rawAttributes'],function(_0x11cd62){return{'name':_0x11cd62[_0x8682('0x2b')],'type':_0x11cd62[_0x8682('0x2c')][_0x8682('0x2d')]};});_0x33b48e[_0x8682('0x2e')]=_[_0x8682('0x29')](_0x510655,_0x8682('0x26'));_0x33b48e[_0x8682('0x2f')]=_[_0x8682('0x30')](_0x41addc[_0x8682('0x2f')]);_0x33b48e[_0x8682('0x31')]=_[_0x8682('0x32')](_0x33b48e['model'],_0x33b48e[_0x8682('0x2f')]);_0x871b11['attributes']=_[_0x8682('0x32')](_0x33b48e[_0x8682('0x2e')],qs[_0x8682('0x33')](_0x41addc[_0x8682('0x2f')][_0x8682('0x33')]));_0x871b11[_0x8682('0x34')]=_0x871b11[_0x8682('0x34')][_0x8682('0x35')]?_0x871b11[_0x8682('0x34')]:_0x33b48e[_0x8682('0x2e')];if(!_0x41addc[_0x8682('0x2f')][_0x8682('0x36')]('nolimit')){_0x871b11[_0x8682('0x1d')]=qs['limit'](_0x41addc[_0x8682('0x2f')]['limit']);_0x871b11['offset']=qs[_0x8682('0x1b')](_0x41addc[_0x8682('0x2f')]['offset']);}_0x871b11['order']=qs['sort'](_0x41addc[_0x8682('0x2f')][_0x8682('0x37')]);_0x871b11[_0x8682('0x38')]=qs[_0x8682('0x31')](_[_0x8682('0x39')](_0x41addc[_0x8682('0x2f')],_0x33b48e[_0x8682('0x31')]),_0x510655);if(_0x41addc['query'][_0x8682('0x3a')]){_0x871b11[_0x8682('0x38')]=_[_0x8682('0x3b')](_0x871b11['where'],{'$or':_[_0x8682('0x29')](_0x510655,function(_0x20b70b){if(_0x20b70b[_0x8682('0x2c')]!=='VIRTUAL'){var _0x1cd36e={};_0x1cd36e[_0x20b70b[_0x8682('0x26')]]={'$like':'%'+_0x41addc['query']['filter']+'%'};return _0x1cd36e;}})});}_0x871b11=_[_0x8682('0x3b')]({},_0x871b11,_0x41addc['options']);var _0x35933e={'where':_0x871b11[_0x8682('0x38')]};return db[_0x8682('0x2a')]['count'](_0x35933e)[_0x8682('0x3c')](function(_0x292579){_0x566742['count']=_0x292579;if(_0x41addc[_0x8682('0x2f')][_0x8682('0x3d')]){_0x871b11['include']=[{'all':!![]}];}return db['VtigerField'][_0x8682('0x3e')](_0x871b11);})[_0x8682('0x3c')](function(_0x1afaff){_0x566742['rows']=_0x1afaff;return _0x566742;})[_0x8682('0x3c')](respondWithFilteredResult(_0x476e4b,_0x871b11))[_0x8682('0x3f')](handleError(_0x476e4b,null));};exports[_0x8682('0x40')]=function(_0xabfe51,_0x4d732f){var _0x43e028={'raw':!![],'where':{'id':_0xabfe51[_0x8682('0x41')]['id']}},_0x2caa5e={};_0x2caa5e[_0x8682('0x2e')]=_[_0x8682('0x30')](db[_0x8682('0x2a')][_0x8682('0x42')]);_0x2caa5e[_0x8682('0x2f')]=_[_0x8682('0x30')](_0xabfe51[_0x8682('0x2f')]);_0x2caa5e[_0x8682('0x31')]=_[_0x8682('0x32')](_0x2caa5e['model'],_0x2caa5e[_0x8682('0x2f')]);_0x43e028[_0x8682('0x34')]=_[_0x8682('0x32')](_0x2caa5e[_0x8682('0x2e')],qs[_0x8682('0x33')](_0xabfe51['query'][_0x8682('0x33')]));_0x43e028['attributes']=_0x43e028[_0x8682('0x34')][_0x8682('0x35')]?_0x43e028[_0x8682('0x34')]:_0x2caa5e['model'];if(_0xabfe51['query'][_0x8682('0x3d')]){_0x43e028[_0x8682('0x43')]=[{'all':!![]}];}_0x43e028=_[_0x8682('0x3b')]({},_0x43e028,_0xabfe51['options']);return db[_0x8682('0x2a')][_0x8682('0x44')](_0x43e028)[_0x8682('0x3c')](handleEntityNotFound(_0x4d732f,null))['then'](respondWithResult(_0x4d732f,null))[_0x8682('0x3f')](handleError(_0x4d732f,null));};exports[_0x8682('0x45')]=function(_0x1e46c4,_0x4711bc){return db['VtigerField'][_0x8682('0x45')](_0x1e46c4[_0x8682('0x46')],{})[_0x8682('0x3c')](respondWithResult(_0x4711bc,0xc9))['catch'](handleError(_0x4711bc,null));};exports[_0x8682('0x47')]=function(_0xa183b7,_0x2972f0){if(_0xa183b7[_0x8682('0x46')]['id']){delete _0xa183b7['body']['id'];}return db[_0x8682('0x2a')][_0x8682('0x44')]({'where':{'id':_0xa183b7[_0x8682('0x41')]['id']}})[_0x8682('0x3c')](handleEntityNotFound(_0x2972f0,null))[_0x8682('0x3c')](saveUpdates(_0xa183b7[_0x8682('0x46')],null))['then'](respondWithResult(_0x2972f0,null))[_0x8682('0x3f')](handleError(_0x2972f0,null));};exports[_0x8682('0x24')]=function(_0x3ce4d7,_0x3327b2){return db[_0x8682('0x2a')]['find']({'where':{'id':_0x3ce4d7['params']['id']}})[_0x8682('0x3c')](handleEntityNotFound(_0x3327b2,null))[_0x8682('0x3c')](removeEntity(_0x3327b2,null))[_0x8682('0x3f')](handleError(_0x3327b2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 988fa42..23f3b3d 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 _0xd6af=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerField.attributes','exports','define'];(function(_0x3f1c73,_0x4b7353){var _0x177138=function(_0x4760b1){while(--_0x4760b1){_0x3f1c73['push'](_0x3f1c73['shift']());}};_0x177138(++_0x4b7353);}(_0xd6af,0x15d));var _0xfd6a=function(_0x489543,_0x588996){_0x489543=_0x489543-0x0;var _0x18cf3b=_0xd6af[_0x489543];return _0x18cf3b;};'use strict';var _=require(_0xfd6a('0x0'));var util=require(_0xfd6a('0x1'));var logger=require(_0xfd6a('0x2'))(_0xfd6a('0x3'));var moment=require(_0xfd6a('0x4'));var BPromise=require(_0xfd6a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd6a('0x6'));var rimraf=require(_0xfd6a('0x7'));var config=require('../../config/environment');var attributes=require(_0xfd6a('0x8'));module[_0xfd6a('0x9')]=function(_0x170475,_0x107346){return _0x170475[_0xfd6a('0xa')](_0xfd6a('0xb'),attributes,{'tableName':_0xfd6a('0xc'),'paranoid':![],'indexes':[{'name':_0xfd6a('0xd'),'fields':[_0xfd6a('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2902=['exports','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2902,0x1e5));var _0x2290=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x2902[_0x2c0ded];return _0x4473e5;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var logger=require(_0x2290('0x2'))('api');var moment=require(_0x2290('0x3'));var BPromise=require(_0x2290('0x4'));var rp=require(_0x2290('0x5'));var fs=require('fs');var path=require(_0x2290('0x6'));var rimraf=require('rimraf');var config=require(_0x2290('0x7'));var attributes=require(_0x2290('0x8'));module[_0x2290('0x9')]=function(_0x5abd65,_0x1f3177){return _0x5abd65['define']('VtigerField',attributes,{'tableName':_0x2290('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x2290('0xb'),_0x2290('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 672870b..ab70e11 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 _0x5759=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5759,0x160));var _0x9575=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5759[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x9575('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9575('0x1'));var fs=require('fs');var Redis=require(_0x9575('0x2'));var db=require(_0x9575('0x3'))['db'];var utils=require(_0x9575('0x4'));var logger=require(_0x9575('0x5'))(_0x9575('0x6'));var config=require(_0x9575('0x7'));var jayson=require(_0x9575('0x8'));var client=jayson[_0x9575('0x9')][_0x9575('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x357672,_0x48f6c5,_0x1f8ed7){return new BPromise(function(_0x4c2924,_0x44d1ab){return client[_0x9575('0xb')](_0x357672,_0x1f8ed7)[_0x9575('0xc')](function(_0x3f96e2){logger[_0x9575('0xd')](_0x9575('0xe'),_0x48f6c5,_0x9575('0xf'));logger[_0x9575('0x10')](_0x9575('0x11'),_0x48f6c5,'request\x20sent',JSON[_0x9575('0x12')](_0x3f96e2));if(_0x3f96e2['error']){if(_0x3f96e2[_0x9575('0x13')][_0x9575('0x14')]===0x1f4){logger[_0x9575('0x13')](_0x9575('0xe'),_0x48f6c5,_0x3f96e2[_0x9575('0x13')][_0x9575('0x15')]);return _0x44d1ab(_0x3f96e2[_0x9575('0x13')][_0x9575('0x15')]);}logger[_0x9575('0x13')]('VtigerField,\x20%s,\x20%s',_0x48f6c5,_0x3f96e2[_0x9575('0x13')][_0x9575('0x15')]);return _0x4c2924(_0x3f96e2[_0x9575('0x13')][_0x9575('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x48f6c5,_0x9575('0xf'));_0x4c2924(_0x3f96e2['result'][_0x9575('0x15')]);}})[_0x9575('0x16')](function(_0x3a2e25){logger[_0x9575('0x13')]('VtigerField,\x20%s,\x20%s',_0x48f6c5,_0x3a2e25);_0x44d1ab(_0x3a2e25);});});} \ No newline at end of file +var _0x11c5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird'];(function(_0x271447,_0x40228d){var _0x1456ee=function(_0x58f3a8){while(--_0x58f3a8){_0x271447['push'](_0x271447['shift']());}};_0x1456ee(++_0x40228d);}(_0x11c5,0x9d));var _0x511c=function(_0x3e2237,_0x373b49){_0x3e2237=_0x3e2237-0x0;var _0xb495ac=_0x11c5[_0x3e2237];return _0xb495ac;};'use strict';var _=require('lodash');var util=require(_0x511c('0x0'));var moment=require(_0x511c('0x1'));var BPromise=require(_0x511c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511c('0x3'));var db=require(_0x511c('0x4'))['db'];var utils=require(_0x511c('0x5'));var logger=require(_0x511c('0x6'))('rpc');var config=require(_0x511c('0x7'));var jayson=require(_0x511c('0x8'));var client=jayson['client'][_0x511c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x586494,_0x3e49fd,_0x4d41f5){return new BPromise(function(_0xa46919,_0x34b5d7){return client['request'](_0x586494,_0x4d41f5)['then'](function(_0x493cf3){logger[_0x511c('0xa')](_0x511c('0xb'),_0x3e49fd,'request\x20sent');logger[_0x511c('0xc')](_0x511c('0xd'),_0x3e49fd,_0x511c('0xe'),JSON['stringify'](_0x493cf3));if(_0x493cf3[_0x511c('0xf')]){if(_0x493cf3['error'][_0x511c('0x10')]===0x1f4){logger[_0x511c('0xf')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);return _0x34b5d7(_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);}logger[_0x511c('0xf')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);return _0xa46919(_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);}else{logger[_0x511c('0xa')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,'request\x20sent');_0xa46919(_0x493cf3[_0x511c('0x12')][_0x511c('0x11')]);}})[_0x511c('0x13')](function(_0x39d3cf){logger[_0x511c('0xf')](_0x511c('0xb'),_0x3e49fd,_0x39d3cf);_0x34b5d7(_0x39d3cf);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8bd0909..59e8111 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 _0x722b=['getFields','create','post','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x722b,0x16e));var _0xb722=function(_0x56ce20,_0x10d35f){_0x56ce20=_0x56ce20-0x0;var _0x341595=_0x722b[_0x56ce20];return _0x341595;};'use strict';var multer=require(_0xb722('0x0'));var util=require(_0xb722('0x1'));var path=require(_0xb722('0x2'));var timeout=require('connect-timeout');var express=require(_0xb722('0x3'));var router=express[_0xb722('0x4')]();var fs_extra=require(_0xb722('0x5'));var auth=require(_0xb722('0x6'));var interaction=require(_0xb722('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xb722('0x8')]('/',auth[_0xb722('0x9')](),controller[_0xb722('0xa')]);router[_0xb722('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb722('0xb')]);router['get'](_0xb722('0xc'),auth[_0xb722('0x9')](),controller[_0xb722('0xd')]);router[_0xb722('0x8')]('/:id/fields',auth[_0xb722('0x9')](),controller[_0xb722('0xe')]);router['post']('/',auth[_0xb722('0x9')](),controller[_0xb722('0xf')]);router[_0xb722('0x10')]('/:id/configurations',auth[_0xb722('0x9')](),controller['addConfiguration']);router['put'](_0xb722('0x11'),auth[_0xb722('0x9')](),controller['update']);router['delete']('/:id',auth[_0xb722('0x9')](),controller[_0xb722('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfe92=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id/configurations','get','/:id/fields','getFields','post','addConfiguration','put','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x17ebd1,_0x5bc2e3){var _0x3fe498=function(_0x202150){while(--_0x202150){_0x17ebd1['push'](_0x17ebd1['shift']());}};_0x3fe498(++_0x5bc2e3);}(_0xfe92,0x174));var _0x2fe9=function(_0x2387c5,_0xfcc74c){_0x2387c5=_0x2387c5-0x0;var _0x2c414c=_0xfe92[_0x2387c5];return _0x2c414c;};'use strict';var multer=require(_0x2fe9('0x0'));var util=require(_0x2fe9('0x1'));var path=require('path');var timeout=require(_0x2fe9('0x2'));var express=require(_0x2fe9('0x3'));var router=express[_0x2fe9('0x4')]();var fs_extra=require(_0x2fe9('0x5'));var auth=require(_0x2fe9('0x6'));var interaction=require(_0x2fe9('0x7'));var config=require(_0x2fe9('0x8'));var controller=require(_0x2fe9('0x9'));router['get']('/',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0xb')]);router['get']('/:id',auth[_0x2fe9('0xa')](),controller['show']);router['get'](_0x2fe9('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2fe9('0xd')](_0x2fe9('0xe'),auth['isAuthenticated'](),controller[_0x2fe9('0xf')]);router[_0x2fe9('0x10')]('/',auth[_0x2fe9('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0x11')]);router[_0x2fe9('0x12')](_0x2fe9('0x13'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2afa81e..8b103a8 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 _0x6132=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM','password'];(function(_0xd4b8c4,_0x17399f){var _0x949cac=function(_0x1e406c){while(--_0x1e406c){_0xd4b8c4['push'](_0xd4b8c4['shift']());}};_0x949cac(++_0x17399f);}(_0x6132,0x13a));var _0x2613=function(_0x4d8bdb,_0x4b8571){_0x4d8bdb=_0x4d8bdb-0x0;var _0x2341ff=_0x6132[_0x4d8bdb];return _0x2341ff;};'use strict';var Sequelize=require(_0x2613('0x0'));module[_0x2613('0x1')]={'name':{'type':Sequelize[_0x2613('0x2')]},'description':{'type':Sequelize[_0x2613('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2613('0x3')},'password':{'type':Sequelize[_0x2613('0x2')]},'token':{'type':Sequelize[_0x2613('0x2')]},'remoteUri':{'type':Sequelize[_0x2613('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x2613('0x4')]('password','token'),'defaultValue':_0x2613('0x5')},'serverUrl':{'type':Sequelize[_0x2613('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2613('0x4')](_0x2613('0x6'),_0x2613('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa423=['password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x48b724,_0x5a8e26){var _0x4d38b3=function(_0xef820f){while(--_0xef820f){_0x48b724['push'](_0x48b724['shift']());}};_0x4d38b3(++_0x5a8e26);}(_0xa423,0x16c));var _0x3a42=function(_0xc18afe,_0x2e94a0){_0xc18afe=_0xc18afe-0x0;var _0x1b6c13=_0xa423[_0xc18afe];return _0x1b6c13;};'use strict';var Sequelize=require(_0x3a42('0x0'));module[_0x3a42('0x1')]={'name':{'type':Sequelize[_0x3a42('0x2')]},'description':{'type':Sequelize[_0x3a42('0x2')]},'username':{'type':Sequelize[_0x3a42('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x3a42('0x2')]},'token':{'type':Sequelize[_0x3a42('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3a42('0x3')},'authType':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x5'),_0x3a42('0x6')),'defaultValue':_0x3a42('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x7'),_0x3a42('0x8')),'defaultValue':_0x3a42('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 9e389b6..9e47497 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 _0x8f59=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','params','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','position','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0xa8c867,_0x430288){var _0x4f9bdb=function(_0x9c6a2){while(--_0x9c6a2){_0xa8c867['push'](_0xa8c867['shift']());}};_0x4f9bdb(++_0x430288);}(_0x8f59,0x11d));var _0x98f5=function(_0x55186e,_0xd9123e){_0x55186e=_0x55186e-0x0;var _0x32e59f=_0x8f59[_0x55186e];return _0x32e59f;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];var integrations=require(_0x98f5('0x18'));function respondWithStatusCode(_0x1f00e8,_0x160626){_0x160626=_0x160626||0xcc;return function(_0x3286f7){if(_0x3286f7){return _0x1f00e8[_0x98f5('0x19')](_0x160626);}return _0x1f00e8['status'](_0x160626)[_0x98f5('0x1a')]();};}function respondWithResult(_0xbade31,_0x5b8bab){_0x5b8bab=_0x5b8bab||0xc8;return function(_0x9df84){if(_0x9df84){return _0xbade31[_0x98f5('0x1b')](_0x5b8bab)[_0x98f5('0x1c')](_0x9df84);}};}function respondWithFilteredResult(_0x4ae70d,_0x2437e7){return function(_0xc7a49b){if(_0xc7a49b){var _0x113545=typeof _0x2437e7['offset']===_0x98f5('0x1d')&&typeof _0x2437e7[_0x98f5('0x1e')]==='undefined';var _0x1df52d=_0xc7a49b['count'];var _0x10c57c=_0x113545?0x0:_0x2437e7[_0x98f5('0x1f')];var _0x2291d5=_0x113545?_0xc7a49b[_0x98f5('0x20')]:_0x2437e7[_0x98f5('0x1f')]+_0x2437e7[_0x98f5('0x1e')];var _0x484e1d;if(_0x2291d5>=_0x1df52d){_0x2291d5=_0x1df52d;_0x484e1d=0xc8;}else{_0x484e1d=0xce;}_0x4ae70d[_0x98f5('0x1b')](_0x484e1d);return _0x4ae70d['set'](_0x98f5('0x21'),_0x10c57c+'-'+_0x2291d5+'/'+_0x1df52d)[_0x98f5('0x1c')](_0xc7a49b);}return null;};}function patchUpdates(_0x5deca0){return function(_0x146db1){try{jsonpatch[_0x98f5('0x22')](_0x146db1,_0x5deca0,!![]);}catch(_0x331695){return BPromise[_0x98f5('0x23')](_0x331695);}return _0x146db1[_0x98f5('0x24')]();};}function saveUpdates(_0x3dc7c2,_0x38b46d){return function(_0x5ac2b7){if(_0x5ac2b7){return _0x5ac2b7[_0x98f5('0x25')](_0x3dc7c2)['then'](function(_0xcb10d6){return _0xcb10d6;});}return null;};}function removeEntity(_0x495889,_0x44bfbb){return function(_0x40c69b){if(_0x40c69b){return _0x40c69b[_0x98f5('0x26')]()[_0x98f5('0x27')](function(){_0x495889[_0x98f5('0x1b')](0xcc)[_0x98f5('0x1a')]();});}};}function handleEntityNotFound(_0x46dbd4,_0x58d506){return function(_0x27a533){if(!_0x27a533){_0x46dbd4[_0x98f5('0x19')](0x194);}return _0x27a533;};}function handleError(_0x5d7423,_0x1a1c55){_0x1a1c55=_0x1a1c55||0x1f4;return function(_0x18b0af){logger[_0x98f5('0x28')](_0x18b0af[_0x98f5('0x29')]);if(_0x18b0af[_0x98f5('0x2a')]){delete _0x18b0af[_0x98f5('0x2a')];}_0x5d7423[_0x98f5('0x1b')](_0x1a1c55)[_0x98f5('0x2b')](_0x18b0af);};}exports['index']=function(_0x4c10b8,_0x428c85){var _0x71661e={},_0x18bb29={},_0x209d15={'count':0x0,'rows':[]};var _0x15bf92=_[_0x98f5('0x2c')](db['ZendeskAccount'][_0x98f5('0x2d')],function(_0x6d7418){return{'name':_0x6d7418[_0x98f5('0x2e')],'type':_0x6d7418[_0x98f5('0x2f')][_0x98f5('0x30')]};});_0x18bb29[_0x98f5('0x31')]=_['map'](_0x15bf92,_0x98f5('0x2a'));_0x18bb29[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x4c10b8[_0x98f5('0x32')]);_0x18bb29['filters']=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],_0x18bb29[_0x98f5('0x32')]);_0x71661e[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],qs[_0x98f5('0x36')](_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x36')]));_0x71661e[_0x98f5('0x35')]=_0x71661e[_0x98f5('0x35')][_0x98f5('0x37')]?_0x71661e[_0x98f5('0x35')]:_0x18bb29[_0x98f5('0x31')];if(!_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x38')](_0x98f5('0x39'))){_0x71661e[_0x98f5('0x1e')]=qs[_0x98f5('0x1e')](_0x4c10b8[_0x98f5('0x32')]['limit']);_0x71661e[_0x98f5('0x1f')]=qs['offset'](_0x4c10b8['query'][_0x98f5('0x1f')]);}_0x71661e[_0x98f5('0x3a')]=qs[_0x98f5('0x3b')](_0x4c10b8[_0x98f5('0x32')]['sort']);_0x71661e[_0x98f5('0x3c')]=qs[_0x98f5('0x3d')](_[_0x98f5('0x3e')](_0x4c10b8['query'],_0x18bb29[_0x98f5('0x3d')]),_0x15bf92);if(_0x4c10b8[_0x98f5('0x32')]['filter']){_0x71661e[_0x98f5('0x3c')]=_[_0x98f5('0x3f')](_0x71661e[_0x98f5('0x3c')],{'$or':_['map'](_0x15bf92,function(_0x15d704){if(_0x15d704[_0x98f5('0x2f')]!==_0x98f5('0x40')){var _0x544fbf={};_0x544fbf[_0x15d704[_0x98f5('0x2a')]]={'$like':'%'+_0x4c10b8['query']['filter']+'%'};return _0x544fbf;}})});}_0x71661e=_[_0x98f5('0x3f')]({},_0x71661e,_0x4c10b8[_0x98f5('0x41')]);var _0x33e6e2={'where':_0x71661e[_0x98f5('0x3c')]};return db[_0x98f5('0x42')][_0x98f5('0x20')](_0x33e6e2)['then'](function(_0x4a4129){_0x209d15[_0x98f5('0x20')]=_0x4a4129;if(_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x43')]){_0x71661e[_0x98f5('0x44')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x71661e);})[_0x98f5('0x27')](function(_0x469d2c){_0x209d15[_0x98f5('0x45')]=_0x469d2c;return _0x209d15;})[_0x98f5('0x27')](respondWithFilteredResult(_0x428c85,_0x71661e))['catch'](handleError(_0x428c85,null));};exports['show']=function(_0x3db067,_0x3a191f){var _0x372c33={'raw':![],'where':{'id':_0x3db067[_0x98f5('0x46')]['id']}},_0x4a9b53={};_0x4a9b53['model']=_[_0x98f5('0x33')](db['ZendeskAccount'][_0x98f5('0x2d')]);_0x4a9b53[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x3db067['query']);_0x4a9b53[_0x98f5('0x3d')]=_[_0x98f5('0x34')](_0x4a9b53['model'],_0x4a9b53[_0x98f5('0x32')]);_0x372c33[_0x98f5('0x35')]=_['intersection'](_0x4a9b53[_0x98f5('0x31')],qs['fields'](_0x3db067[_0x98f5('0x32')][_0x98f5('0x36')]));_0x372c33['attributes']=_0x372c33['attributes']['length']?_0x372c33['attributes']:_0x4a9b53[_0x98f5('0x31')];if(_0x3db067['query'][_0x98f5('0x43')]){_0x372c33[_0x98f5('0x44')]=[{'all':!![]}];}_0x372c33=_[_0x98f5('0x3f')]({},_0x372c33,_0x3db067[_0x98f5('0x41')]);return db[_0x98f5('0x42')][_0x98f5('0x47')](_0x372c33)['then'](handleEntityNotFound(_0x3a191f,null))[_0x98f5('0x27')](respondWithResult(_0x3a191f,null))[_0x98f5('0x48')](handleError(_0x3a191f,null));};exports[_0x98f5('0x49')]=function(_0x2c3cef,_0x178867){return db[_0x98f5('0x42')]['create'](_0x2c3cef[_0x98f5('0x4a')],{})[_0x98f5('0x27')](respondWithResult(_0x178867,0xc9))[_0x98f5('0x48')](handleError(_0x178867,null));};exports[_0x98f5('0x25')]=function(_0x4a0cda,_0x2c5f96){if(_0x4a0cda[_0x98f5('0x4a')]['id']){delete _0x4a0cda[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4a0cda['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x2c5f96,null))[_0x98f5('0x27')](saveUpdates(_0x4a0cda['body'],null))[_0x98f5('0x27')](respondWithResult(_0x2c5f96,null))['catch'](handleError(_0x2c5f96,null));};exports[_0x98f5('0x26')]=function(_0x4cb157,_0x1bd2b9){return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4cb157['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x1bd2b9,null))[_0x98f5('0x27')](removeEntity(_0x1bd2b9,null))[_0x98f5('0x48')](handleError(_0x1bd2b9,null));};exports[_0x98f5('0x4b')]=function(_0xde3d2d,_0xf39073,_0x37e620){var _0x1891ac={};var _0x2c3a23={};var _0x2e48a1;var _0x50343c;return db[_0x98f5('0x42')][_0x98f5('0x4c')]({'where':{'id':_0xde3d2d[_0x98f5('0x46')]['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0xf39073,null))[_0x98f5('0x27')](function(_0x23e955){if(_0x23e955){_0x2e48a1=_0x23e955;_0x2c3a23['model']=_[_0x98f5('0x33')](db[_0x98f5('0x4d')][_0x98f5('0x2d')]);_0x2c3a23[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0xde3d2d[_0x98f5('0x32')]);_0x2c3a23['filters']=_['intersection'](_0x2c3a23['model'],_0x2c3a23[_0x98f5('0x32')]);_0x1891ac[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x2c3a23[_0x98f5('0x31')],qs['fields'](_0xde3d2d[_0x98f5('0x32')]['fields']));_0x1891ac[_0x98f5('0x35')]=_0x1891ac['attributes']['length']?_0x1891ac[_0x98f5('0x35')]:_0x2c3a23[_0x98f5('0x31')];_0x1891ac[_0x98f5('0x3a')]=qs['sort'](_0xde3d2d['query'][_0x98f5('0x3b')]);_0x1891ac[_0x98f5('0x3c')]=qs['filters'](_[_0x98f5('0x3e')](_0xde3d2d[_0x98f5('0x32')],_0x2c3a23['filters']));if(_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]){_0x1891ac[_0x98f5('0x3c')]=_['merge'](_0x1891ac[_0x98f5('0x3c')],{'$or':_[_0x98f5('0x2c')](_0x1891ac[_0x98f5('0x35')],function(_0xabde69){var _0x459c64={};_0x459c64[_0xabde69]={'$like':'%'+_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]+'%'};return _0x459c64;})});}_0x1891ac=_['merge']({},_0x1891ac,_0xde3d2d[_0x98f5('0x41')]);return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x58041d){if(_0x58041d){_0x50343c=_0x58041d['length'];if(!_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x38')]('nolimit')){_0x1891ac['limit']=qs['limit'](_0xde3d2d['query'][_0x98f5('0x1e')]);_0x1891ac['offset']=qs[_0x98f5('0x1f')](_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x1f')]);}return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x26cc86){if(_0x26cc86){return _0x26cc86?{'count':_0x50343c,'rows':_0x26cc86}:null;}})[_0x98f5('0x27')](respondWithResult(_0xf39073,null))[_0x98f5('0x48')](handleError(_0xf39073,null));};exports['addConfiguration']=function(_0x4d89b6,_0x3b8229,_0x505209){if(_0x4d89b6[_0x98f5('0x4a')]['id']){delete _0x4d89b6[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')]['findOne']({'where':{'id':_0x4d89b6[_0x98f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b8229,null))['then'](function(_0x595aee){if(_0x595aee){_0x4d89b6[_0x98f5('0x4a')]['AccountId']=_0x595aee['id'];_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x4f')]=integrations[_0x98f5('0x50')](_0x4d89b6['body']['channel'],_0x4d89b6['body'][_0x98f5('0x2f')]);_0x4d89b6[_0x98f5('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x51')],_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x2f')]);return db[_0x98f5('0x4d')][_0x98f5('0x49')](_0x4d89b6[_0x98f5('0x4a')],{'include':[{'model':db[_0x98f5('0x52')],'as':_0x98f5('0x4f')},{'model':db['ZendeskField'],'as':_0x98f5('0x53')}]});}return null;})[_0x98f5('0x27')](respondWithResult(_0x3b8229,null))[_0x98f5('0x48')](handleError(_0x3b8229,null));};exports[_0x98f5('0x54')]=function(_0x50911c,_0x3e00bf,_0x48b175){var _0x42c7a6='';return db['ZendeskAccount'][_0x98f5('0x4c')]({'where':{'id':_0x50911c[_0x98f5('0x46')]['id']},'attributes':['id','username',_0x98f5('0x55'),_0x98f5('0x56'),_0x98f5('0x57'),'remoteUri']})[_0x98f5('0x27')](handleEntityNotFound(_0x3e00bf,null))[_0x98f5('0x27')](function(_0x14c4f1){if(_0x14c4f1){_0x42c7a6=_0x14c4f1[_0x98f5('0x58')];var _0x154e19=_0x42c7a6[_0x98f5('0x59')](-0x1);if(_0x154e19==='/'){_0x42c7a6=_0x42c7a6[_0x98f5('0x5a')](0x0,_0x42c7a6[_0x98f5('0x5b')](_0x154e19));}var _0x368f76={'method':'GET','uri':util[_0x98f5('0x5c')]('%s/%s',_0x42c7a6,_0x98f5('0x5d')),'json':!![]};switch(_0x14c4f1[_0x98f5('0x57')]){case _0x98f5('0x55'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format'](_0x98f5('0x5f'),new Buffer(util[_0x98f5('0x5c')]('%s:%s',_0x14c4f1[_0x98f5('0x60')],_0x14c4f1['password']))[_0x98f5('0x61')](_0x98f5('0x62')))};break;case _0x98f5('0x56'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x98f5('0x5c')](_0x98f5('0x63'),_0x14c4f1['username'],_0x14c4f1[_0x98f5('0x56')]))[_0x98f5('0x61')](_0x98f5('0x62')))};break;default:throw new db[(_0x98f5('0x64'))][(_0x98f5('0x65'))](_0x98f5('0x66'));}return rp(_0x368f76);}})[_0x98f5('0x27')](function(_0x1a3cb8){if(_0x1a3cb8){var _0x2e0484=[_0x98f5('0x67'),_0x98f5('0x68'),'group','assignee'];_[_0x98f5('0x69')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x10cd2d){return _0x2e0484['includes'](_0x10cd2d[_0x98f5('0x2f')]);});return{'count':_0x1a3cb8[_0x98f5('0x5d')]['length'],'rows':_[_0x98f5('0x2c')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x4c1dda){return{'id':_0x4c1dda['id'],'name':_0x4c1dda['position']>0x7?_0x4c1dda['title']:_0x4c1dda['type'],'custom':_0x4c1dda[_0x98f5('0x6a')]>0x7?!![]:![],'options':_0x4c1dda[_0x98f5('0x6b')]?_0x4c1dda['system_field_options']:_0x4c1dda[_0x98f5('0x6c')]?_0x4c1dda[_0x98f5('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3e00bf,null))[_0x98f5('0x48')](function(_0x4f582b){var _0x4814da=_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?0x1f4:_0x4f582b[_0x98f5('0x6e')]||0x1f4;logger[_0x98f5('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x98f5('0x54'),_0x4814da,JSON['stringify'](_0x4f582b));delete _0x4f582b['name'];if(_0x4814da===0x191){_0x4814da=0x190;}_0x3e00bf['status'](_0x4814da)[_0x98f5('0x2b')](_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?{'message':_0x98f5('0x6f'),'statusCode':_0x4f582b[_0x98f5('0x6e')]}:_0x4f582b);});}; \ No newline at end of file +var _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x2b3cf4,_0x2d1908){var _0x184124=function(_0x2f37b3){while(--_0x2f37b3){_0x2b3cf4['push'](_0x2b3cf4['shift']());}};_0x184124(++_0x2d1908);}(_0x351d,0x90));var _0xd351=function(_0x3404f2,_0x3a5298){_0x3404f2=_0x3404f2-0x0;var _0x63204c=_0x351d[_0x3404f2];return _0x63204c;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 46a4423..5607627 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 _0x0834=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0834,0x64));var _0x4083=function(_0x18f3f8,_0x36a345){_0x18f3f8=_0x18f3f8-0x0;var _0x29233c=_0x0834[_0x18f3f8];return _0x29233c;};'use strict';var _=require(_0x4083('0x0'));var util=require(_0x4083('0x1'));var logger=require(_0x4083('0x2'))(_0x4083('0x3'));var moment=require(_0x4083('0x4'));var BPromise=require(_0x4083('0x5'));var rp=require(_0x4083('0x6'));var fs=require('fs');var path=require(_0x4083('0x7'));var rimraf=require(_0x4083('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x4083('0x9'));module[_0x4083('0xa')]=function(_0x12f324,_0x2e70a3){return _0x12f324[_0x4083('0xb')](_0x4083('0xc'),attributes,{'tableName':_0x4083('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3b8=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskAccount.attributes'];(function(_0x196f6a,_0x37d9cd){var _0x23f465=function(_0x521423){while(--_0x521423){_0x196f6a['push'](_0x196f6a['shift']());}};_0x23f465(++_0x37d9cd);}(_0xa3b8,0x99));var _0x8a3b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa3b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a3b('0x0'));var util=require(_0x8a3b('0x1'));var logger=require(_0x8a3b('0x2'))(_0x8a3b('0x3'));var moment=require(_0x8a3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a3b('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x398351,_0x24e5d1){return _0x398351[_0x8a3b('0x7')](_0x8a3b('0x8'),attributes,{'tableName':_0x8a3b('0x9'),'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 55551c7..08cb391 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 _0x1cb9=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','options','attributes','limit','include','map','model','find','raw','where','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2a41cb,_0x4c2332){var _0x3bc062=function(_0x29740e){while(--_0x29740e){_0x2a41cb['push'](_0x2a41cb['shift']());}};_0x3bc062(++_0x4c2332);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e31d7,_0x278a73){_0x1e31d7=_0x1e31d7-0x0;var _0x4125ad=_0x1cb9[_0x1e31d7];return _0x4125ad;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['findAll']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'limit':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]||null:null,'include':_0x1cd34b['options']?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1b')]?_[_0x91cb('0x1c')](_0x1cd34b['options'][_0x91cb('0x1b')],function(_0x1a7a54){return{'model':db[_0x1a7a54[_0x91cb('0x1d')]],'as':_0x1a7a54['as'],'attributes':_0x1a7a54[_0x91cb('0x19')],'include':_0x1a7a54[_0x91cb('0x1b')]?_[_0x91cb('0x1c')](_0x1a7a54[_0x91cb('0x1b')],function(_0x423c4f){return{'model':db[_0x423c4f[_0x91cb('0x1d')]],'as':_0x423c4f['as'],'attributes':_0x423c4f['attributes'],'include':_0x423c4f['include']?_[_0x91cb('0x1c')](_0x423c4f['include'],function(_0x1c67d2){return{'model':db[_0x1c67d2[_0x91cb('0x1d')]],'as':_0x1c67d2['as'],'attributes':_0x1c67d2[_0x91cb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b26a6){logger['info'](_0x91cb('0x16'),_0x1cd34b);logger[_0x91cb('0xf')](_0x91cb('0x16'),_0x1cd34b,JSON[_0x91cb('0x11')](_0x9b26a6));_0x5cc1c3(_0x9b26a6);})[_0x91cb('0x15')](function(_0x504275){logger[_0x91cb('0x12')]('GetZendeskAccount',_0x504275[_0x91cb('0x13')],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x504275[_0x91cb('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x775c25){var _0x146e1f=this;return new Promise(function(_0x25bbf9,_0x361e4c){return db[_0x91cb('0x17')][_0x91cb('0x1e')]({'raw':_0x775c25[_0x91cb('0x18')]?_0x775c25[_0x91cb('0x18')][_0x91cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x775c25['options']?_0x775c25[_0x91cb('0x18')][_0x91cb('0x20')]||null:null,'attributes':_0x775c25[_0x91cb('0x18')]?_0x775c25[_0x91cb('0x18')][_0x91cb('0x19')]||null:null,'include':_0x775c25['options']?_0x775c25[_0x91cb('0x18')][_0x91cb('0x1b')]?_[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x18')][_0x91cb('0x1b')],function(_0x47ed2f){return{'model':db[_0x47ed2f[_0x91cb('0x1d')]],'as':_0x47ed2f['as'],'attributes':_0x47ed2f['attributes'],'include':_0x47ed2f['include']?_['map'](_0x47ed2f[_0x91cb('0x1b')],function(_0x4bba88){return{'model':db[_0x4bba88[_0x91cb('0x1d')]],'as':_0x4bba88['as'],'attributes':_0x4bba88['attributes'],'include':_0x4bba88['include']?_[_0x91cb('0x1c')](_0x4bba88[_0x91cb('0x1b')],function(_0x1deabb){return{'model':db[_0x1deabb[_0x91cb('0x1d')]],'as':_0x1deabb['as'],'attributes':_0x1deabb[_0x91cb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8beb3a){logger[_0x91cb('0xc')](_0x91cb('0x21'),_0x775c25);logger[_0x91cb('0xf')]('ShowZendeskAccount',_0x775c25,JSON['stringify'](_0x8beb3a));_0x25bbf9(_0x8beb3a);})[_0x91cb('0x15')](function(_0x135bf1){logger['error'](_0x91cb('0x21'),_0x135bf1[_0x91cb('0x13')],_0x775c25);_0x361e4c(_0x146e1f['error'](0x1f4,_0x135bf1[_0x91cb('0x13')]));});});}; \ No newline at end of file +var _0x0eb1=['options','raw','where','attributes','include','model','map','then','GetZendeskAccount','ZendeskAccount','ShowZendeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll'];(function(_0x175142,_0x2fecfa){var _0x24f5fe=function(_0x8f33b3){while(--_0x8f33b3){_0x175142['push'](_0x175142['shift']());}};_0x24f5fe(++_0x2fecfa);}(_0x0eb1,0xf2));var _0x10eb=function(_0x44427f,_0x50fba9){_0x44427f=_0x44427f-0x0;var _0x56e61e=_0x0eb1[_0x44427f];return _0x56e61e;};'use strict';var _=require('lodash');var util=require(_0x10eb('0x0'));var moment=require('moment');var BPromise=require(_0x10eb('0x1'));var rs=require(_0x10eb('0x2'));var fs=require('fs');var Redis=require(_0x10eb('0x3'));var db=require(_0x10eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10eb('0x5'))(_0x10eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x10eb('0x7'));var client=jayson[_0x10eb('0x8')][_0x10eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xebcf27,_0x28e7c8,_0x4c7c00){return new BPromise(function(_0x53215a,_0xb76b16){return client[_0x10eb('0xa')](_0xebcf27,_0x4c7c00)['then'](function(_0x28f919){logger[_0x10eb('0xb')](_0x10eb('0xc'),_0x28e7c8,_0x10eb('0xd'));logger[_0x10eb('0xe')](_0x10eb('0xf'),_0x28e7c8,'request\x20sent',JSON[_0x10eb('0x10')](_0x28f919));if(_0x28f919[_0x10eb('0x11')]){if(_0x28f919[_0x10eb('0x11')][_0x10eb('0x12')]===0x1f4){logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);return _0xb76b16(_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);}logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x28f919['error'][_0x10eb('0x13')]);return _0x53215a(_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);}else{logger[_0x10eb('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x28e7c8,_0x10eb('0xd'));_0x53215a(_0x28f919['result']['message']);}})[_0x10eb('0x14')](function(_0x26218a){logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x26218a);_0xb76b16(_0x26218a);});});}exports['GetZendeskAccount']=function(_0x5928fa){var _0x3329db=this;return new Promise(function(_0x1f1b44,_0x591f0b){return db['ZendeskAccount'][_0x10eb('0x15')]({'raw':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x17')]===undefined?!![]:![]:!![],'where':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x18')]||null:null,'attributes':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x19')]||null:null,'limit':_0x5928fa['options']?_0x5928fa[_0x10eb('0x16')]['limit']||null:null,'include':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x1a')]?_['map'](_0x5928fa[_0x10eb('0x16')][_0x10eb('0x1a')],function(_0x448111){return{'model':db[_0x448111[_0x10eb('0x1b')]],'as':_0x448111['as'],'attributes':_0x448111[_0x10eb('0x19')],'include':_0x448111[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x448111[_0x10eb('0x1a')],function(_0x34e257){return{'model':db[_0x34e257[_0x10eb('0x1b')]],'as':_0x34e257['as'],'attributes':_0x34e257[_0x10eb('0x19')],'include':_0x34e257[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x34e257[_0x10eb('0x1a')],function(_0x1dec83){return{'model':db[_0x1dec83[_0x10eb('0x1b')]],'as':_0x1dec83['as'],'attributes':_0x1dec83[_0x10eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x10eb('0x1d')](function(_0x5121c0){logger[_0x10eb('0xb')](_0x10eb('0x1e'),_0x5928fa);logger['debug'](_0x10eb('0x1e'),_0x5928fa,JSON[_0x10eb('0x10')](_0x5121c0));_0x1f1b44(_0x5121c0);})[_0x10eb('0x14')](function(_0x31bf7c){logger[_0x10eb('0x11')](_0x10eb('0x1e'),_0x31bf7c['message'],_0x5928fa);_0x591f0b(_0x3329db[_0x10eb('0x11')](0x1f4,_0x31bf7c[_0x10eb('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x332dbc){var _0x28c57b=this;return new Promise(function(_0x371469,_0x376c9e){return db[_0x10eb('0x1f')]['find']({'raw':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x17')]===undefined?!![]:![]:!![],'where':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x18')]||null:null,'attributes':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x19')]||null:null,'include':_0x332dbc['options']?_0x332dbc['options'][_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x332dbc[_0x10eb('0x16')]['include'],function(_0x319e53){return{'model':db[_0x319e53[_0x10eb('0x1b')]],'as':_0x319e53['as'],'attributes':_0x319e53[_0x10eb('0x19')],'include':_0x319e53[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x319e53[_0x10eb('0x1a')],function(_0x157ced){return{'model':db[_0x157ced[_0x10eb('0x1b')]],'as':_0x157ced['as'],'attributes':_0x157ced[_0x10eb('0x19')],'include':_0x157ced[_0x10eb('0x1a')]?_['map'](_0x157ced[_0x10eb('0x1a')],function(_0x188189){return{'model':db[_0x188189[_0x10eb('0x1b')]],'as':_0x188189['as'],'attributes':_0x188189[_0x10eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x10eb('0x1d')](function(_0x176bcb){logger[_0x10eb('0xb')](_0x10eb('0x20'),_0x332dbc);logger[_0x10eb('0xe')](_0x10eb('0x20'),_0x332dbc,JSON['stringify'](_0x176bcb));_0x371469(_0x176bcb);})['catch'](function(_0x1eaae7){logger[_0x10eb('0x11')](_0x10eb('0x20'),_0x1eaae7[_0x10eb('0x13')],_0x332dbc);_0x376c9e(_0x28c57b[_0x10eb('0x11')](0x1f4,_0x1eaae7[_0x10eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9232195..6f6179b 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x34a37d,_0x18afc7){var _0x3ef5e3=function(_0x4045ae){while(--_0x4045ae){_0x34a37d['push'](_0x34a37d['shift']());}};_0x3ef5e3(++_0x18afc7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file +var _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3e9be1,_0x2fac9c){var _0x41518b=function(_0x5f19ed){while(--_0x5f19ed){_0x3e9be1['push'](_0x3e9be1['shift']());}};_0x41518b(++_0x2fac9c);}(_0xea28,0x13a));var _0x8ea2=function(_0x651262,_0x1b15d4){_0x651262=_0x651262-0x0;var _0x53fcb7=_0xea28[_0x651262];return _0x53fcb7;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9ae8ddc..598d87e 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 _0x372c=['exports','STRING'];(function(_0x31147e,_0x2ff5b9){var _0x395bf8=function(_0x4bdec4){while(--_0x4bdec4){_0x31147e['push'](_0x31147e['shift']());}};_0x395bf8(++_0x2ff5b9);}(_0x372c,0x8c));var _0xc372=function(_0x5f0c61,_0x250461){_0x5f0c61=_0x5f0c61-0x0;var _0x2cacb3=_0x372c[_0x5f0c61];return _0x2cacb3;};'use strict';var Sequelize=require('sequelize');module[_0xc372('0x0')]={'name':{'type':Sequelize[_0xc372('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe496=['sequelize','STRING'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe496,0xba));var _0x6e49=function(_0x45f33b,_0x16ae3b){_0x45f33b=_0x45f33b-0x0;var _0x472849=_0xe496[_0x45f33b];return _0x472849;};'use strict';var Sequelize=require(_0x6e49('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e49('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 94c467e..4f3a436 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 _0x86a0=['reject','save','update','destroy','then','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','include','find','create','body','catch','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','apply'];(function(_0x69d413,_0x272cf5){var _0x5c0c61=function(_0x327dc9){while(--_0x327dc9){_0x69d413['push'](_0x69d413['shift']());}};_0x5c0c61(++_0x272cf5);}(_0x86a0,0x83));var _0x086a=function(_0x470c9d,_0x228fd0){_0x470c9d=_0x470c9d-0x0;var _0x4536cf=_0x86a0[_0x470c9d];return _0x4536cf;};'use strict';var emlformat=require(_0x086a('0x0'));var rimraf=require(_0x086a('0x1'));var zipdir=require(_0x086a('0x2'));var jsonpatch=require(_0x086a('0x3'));var rp=require(_0x086a('0x4'));var moment=require(_0x086a('0x5'));var BPromise=require(_0x086a('0x6'));var Mustache=require(_0x086a('0x7'));var util=require(_0x086a('0x8'));var path=require('path');var sox=require(_0x086a('0x9'));var csv=require(_0x086a('0xa'));var ejs=require(_0x086a('0xb'));var fs=require('fs');var fs_extra=require(_0x086a('0xc'));var _=require(_0x086a('0xd'));var squel=require('squel');var crypto=require(_0x086a('0xe'));var jsforce=require(_0x086a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x086a('0xa'));var querystring=require(_0x086a('0x10'));var Papa=require('papaparse');var Redis=require(_0x086a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x086a('0x12'));var as=require(_0x086a('0x13'));var hardwareService=require(_0x086a('0x14'));var logger=require('../../config/logger')(_0x086a('0x15'));var utils=require('../../config/utils');var config=require(_0x086a('0x16'));var licenseUtil=require(_0x086a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x411ec0,_0x142fc0){_0x142fc0=_0x142fc0||0xcc;return function(_0x472ef6){if(_0x472ef6){return _0x411ec0[_0x086a('0x18')](_0x142fc0);}return _0x411ec0['status'](_0x142fc0)[_0x086a('0x19')]();};}function respondWithResult(_0x20d791,_0x5e6479){_0x5e6479=_0x5e6479||0xc8;return function(_0x1a3bda){if(_0x1a3bda){return _0x20d791[_0x086a('0x1a')](_0x5e6479)[_0x086a('0x1b')](_0x1a3bda);}};}function respondWithFilteredResult(_0x87dbf8,_0x21d10a){return function(_0x17eb3d){if(_0x17eb3d){var _0x2dd738=typeof _0x21d10a[_0x086a('0x1c')]===_0x086a('0x1d')&&typeof _0x21d10a[_0x086a('0x1e')]===_0x086a('0x1d');var _0x4bcac2=_0x17eb3d['count'];var _0x42fecd=_0x2dd738?0x0:_0x21d10a['offset'];var _0xa82bf5=_0x2dd738?_0x17eb3d['count']:_0x21d10a[_0x086a('0x1c')]+_0x21d10a[_0x086a('0x1e')];var _0x4a9d62;if(_0xa82bf5>=_0x4bcac2){_0xa82bf5=_0x4bcac2;_0x4a9d62=0xc8;}else{_0x4a9d62=0xce;}_0x87dbf8['status'](_0x4a9d62);return _0x87dbf8[_0x086a('0x1f')]('Content-Range',_0x42fecd+'-'+_0xa82bf5+'/'+_0x4bcac2)[_0x086a('0x1b')](_0x17eb3d);}return null;};}function patchUpdates(_0xdf4195){return function(_0x16162c){try{jsonpatch[_0x086a('0x20')](_0x16162c,_0xdf4195,!![]);}catch(_0x49ea83){return BPromise[_0x086a('0x21')](_0x49ea83);}return _0x16162c[_0x086a('0x22')]();};}function saveUpdates(_0x5f1c2e,_0x3211ba){return function(_0x3720db){if(_0x3720db){return _0x3720db[_0x086a('0x23')](_0x5f1c2e)['then'](function(_0x106de8){return _0x106de8;});}return null;};}function removeEntity(_0x3d7e0c,_0x3bc86b){return function(_0x6c3b22){if(_0x6c3b22){return _0x6c3b22[_0x086a('0x24')]()[_0x086a('0x25')](function(){_0x3d7e0c[_0x086a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bac3c,_0x35c766){return function(_0x14cb6a){if(!_0x14cb6a){_0x1bac3c[_0x086a('0x18')](0x194);}return _0x14cb6a;};}function handleError(_0x42f0f8,_0x3f8d80){_0x3f8d80=_0x3f8d80||0x1f4;return function(_0x2357fb){logger['error'](_0x2357fb[_0x086a('0x26')]);if(_0x2357fb[_0x086a('0x27')]){delete _0x2357fb[_0x086a('0x27')];}_0x42f0f8['status'](_0x3f8d80)[_0x086a('0x28')](_0x2357fb);};}exports[_0x086a('0x29')]=function(_0x51533c,_0x70c2e6){var _0x3a2c79={},_0x43a15b={},_0xfcbb7a={'count':0x0,'rows':[]};var _0x58605e=_[_0x086a('0x2a')](db[_0x086a('0x2b')][_0x086a('0x2c')],function(_0xf12e9b){return{'name':_0xf12e9b['fieldName'],'type':_0xf12e9b['type'][_0x086a('0x2d')]};});_0x43a15b['model']=_[_0x086a('0x2a')](_0x58605e,_0x086a('0x27'));_0x43a15b['query']=_[_0x086a('0x2e')](_0x51533c[_0x086a('0x2f')]);_0x43a15b[_0x086a('0x30')]=_[_0x086a('0x31')](_0x43a15b[_0x086a('0x32')],_0x43a15b[_0x086a('0x2f')]);_0x3a2c79[_0x086a('0x33')]=_[_0x086a('0x31')](_0x43a15b['model'],qs[_0x086a('0x34')](_0x51533c['query']['fields']));_0x3a2c79[_0x086a('0x33')]=_0x3a2c79[_0x086a('0x33')][_0x086a('0x35')]?_0x3a2c79[_0x086a('0x33')]:_0x43a15b[_0x086a('0x32')];if(!_0x51533c[_0x086a('0x2f')][_0x086a('0x36')](_0x086a('0x37'))){_0x3a2c79[_0x086a('0x1e')]=qs[_0x086a('0x1e')](_0x51533c[_0x086a('0x2f')]['limit']);_0x3a2c79[_0x086a('0x1c')]=qs['offset'](_0x51533c[_0x086a('0x2f')]['offset']);}_0x3a2c79[_0x086a('0x38')]=qs[_0x086a('0x39')](_0x51533c[_0x086a('0x2f')][_0x086a('0x39')]);_0x3a2c79[_0x086a('0x3a')]=qs['filters'](_['pick'](_0x51533c['query'],_0x43a15b[_0x086a('0x30')]),_0x58605e);if(_0x51533c['query'][_0x086a('0x3b')]){_0x3a2c79[_0x086a('0x3a')]=_[_0x086a('0x3c')](_0x3a2c79['where'],{'$or':_[_0x086a('0x2a')](_0x58605e,function(_0x493ff6){if(_0x493ff6['type']!==_0x086a('0x3d')){var _0x501d89={};_0x501d89[_0x493ff6[_0x086a('0x27')]]={'$like':'%'+_0x51533c['query'][_0x086a('0x3b')]+'%'};return _0x501d89;}})});}_0x3a2c79=_[_0x086a('0x3c')]({},_0x3a2c79,_0x51533c[_0x086a('0x3e')]);var _0x35f8c5={'where':_0x3a2c79[_0x086a('0x3a')]};return db[_0x086a('0x2b')]['count'](_0x35f8c5)[_0x086a('0x25')](function(_0x383824){_0xfcbb7a[_0x086a('0x3f')]=_0x383824;if(_0x51533c[_0x086a('0x2f')][_0x086a('0x40')]){_0x3a2c79['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x3a2c79);})[_0x086a('0x25')](function(_0x15c73e){_0xfcbb7a[_0x086a('0x41')]=_0x15c73e;return _0xfcbb7a;})[_0x086a('0x25')](respondWithFilteredResult(_0x70c2e6,_0x3a2c79))['catch'](handleError(_0x70c2e6,null));};exports[_0x086a('0x42')]=function(_0x6f5667,_0x52198d){var _0x2e506e={'raw':![],'where':{'id':_0x6f5667[_0x086a('0x43')]['id']}},_0x480a51={};_0x480a51[_0x086a('0x32')]=_['keys'](db[_0x086a('0x2b')]['rawAttributes']);_0x480a51['query']=_[_0x086a('0x2e')](_0x6f5667[_0x086a('0x2f')]);_0x480a51[_0x086a('0x30')]=_[_0x086a('0x31')](_0x480a51[_0x086a('0x32')],_0x480a51['query']);_0x2e506e[_0x086a('0x33')]=_['intersection'](_0x480a51['model'],qs['fields'](_0x6f5667[_0x086a('0x2f')][_0x086a('0x34')]));_0x2e506e[_0x086a('0x33')]=_0x2e506e['attributes'][_0x086a('0x35')]?_0x2e506e['attributes']:_0x480a51[_0x086a('0x32')];if(_0x6f5667[_0x086a('0x2f')]['includeAll']){_0x2e506e[_0x086a('0x44')]=[{'all':!![]}];}_0x2e506e=_[_0x086a('0x3c')]({},_0x2e506e,_0x6f5667[_0x086a('0x3e')]);return db[_0x086a('0x2b')][_0x086a('0x45')](_0x2e506e)['then'](handleEntityNotFound(_0x52198d,null))['then'](respondWithResult(_0x52198d,null))['catch'](handleError(_0x52198d,null));};exports[_0x086a('0x46')]=function(_0x4a833a,_0x302fe5){return db['ZendeskConfiguration'][_0x086a('0x46')](_0x4a833a[_0x086a('0x47')],{})['then'](respondWithResult(_0x302fe5,0xc9))[_0x086a('0x48')](handleError(_0x302fe5,null));};exports['update']=function(_0x4f437b,_0x47469d){if(_0x4f437b[_0x086a('0x47')]['id']){delete _0x4f437b[_0x086a('0x47')]['id'];}return db['ZendeskConfiguration'][_0x086a('0x45')]({'where':{'id':_0x4f437b[_0x086a('0x43')]['id']}})[_0x086a('0x25')](handleEntityNotFound(_0x47469d,null))['then'](saveUpdates(_0x4f437b[_0x086a('0x47')],null))[_0x086a('0x25')](respondWithResult(_0x47469d,null))[_0x086a('0x48')](handleError(_0x47469d,null));};exports[_0x086a('0x24')]=function(_0x3f76d9,_0x41a40b){return db[_0x086a('0x2b')][_0x086a('0x45')]({'where':{'id':_0x3f76d9[_0x086a('0x43')]['id']}})[_0x086a('0x25')](handleEntityNotFound(_0x41a40b,null))[_0x086a('0x25')](removeEntity(_0x41a40b,null))['catch'](handleError(_0x41a40b,null));};exports[_0x086a('0x49')]=function(_0x26c24f,_0x3ba6a0,_0x1685f9){var _0x1d0801={};var _0x2ab9c9={};var _0x4a341a;var _0xd30105;return db[_0x086a('0x2b')][_0x086a('0x4a')]({'where':{'id':_0x26c24f[_0x086a('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ba6a0,null))[_0x086a('0x25')](function(_0xe00e86){if(_0xe00e86){_0x4a341a=_0xe00e86;_0x2ab9c9[_0x086a('0x32')]=_[_0x086a('0x2e')](db[_0x086a('0x4b')][_0x086a('0x2c')]);_0x2ab9c9[_0x086a('0x2f')]=_[_0x086a('0x2e')](_0x26c24f['query']);_0x2ab9c9[_0x086a('0x30')]=_[_0x086a('0x31')](_0x2ab9c9[_0x086a('0x32')],_0x2ab9c9[_0x086a('0x2f')]);_0x1d0801[_0x086a('0x33')]=_[_0x086a('0x31')](_0x2ab9c9[_0x086a('0x32')],qs[_0x086a('0x34')](_0x26c24f[_0x086a('0x2f')][_0x086a('0x34')]));_0x1d0801[_0x086a('0x33')]=_0x1d0801[_0x086a('0x33')]['length']?_0x1d0801[_0x086a('0x33')]:_0x2ab9c9[_0x086a('0x32')];_0x1d0801[_0x086a('0x38')]=qs['sort'](_0x26c24f[_0x086a('0x2f')][_0x086a('0x39')]);_0x1d0801['where']=qs[_0x086a('0x30')](_[_0x086a('0x4c')](_0x26c24f['query'],_0x2ab9c9[_0x086a('0x30')]));if(_0x26c24f[_0x086a('0x2f')][_0x086a('0x3b')]){_0x1d0801[_0x086a('0x3a')]=_[_0x086a('0x3c')](_0x1d0801[_0x086a('0x3a')],{'$or':_[_0x086a('0x2a')](_0x1d0801[_0x086a('0x33')],function(_0x43a0a3){var _0x1227ac={};_0x1227ac[_0x43a0a3]={'$like':'%'+_0x26c24f[_0x086a('0x2f')]['filter']+'%'};return _0x1227ac;})});}_0x1d0801=_['merge']({},_0x1d0801,_0x26c24f[_0x086a('0x3e')]);return _0x4a341a[_0x086a('0x49')](_0x1d0801);}})['then'](function(_0x2763d5){if(_0x2763d5){_0xd30105=_0x2763d5[_0x086a('0x35')];if(!_0x26c24f[_0x086a('0x2f')][_0x086a('0x36')](_0x086a('0x37'))){_0x1d0801[_0x086a('0x1e')]=qs['limit'](_0x26c24f[_0x086a('0x2f')][_0x086a('0x1e')]);_0x1d0801['offset']=qs[_0x086a('0x1c')](_0x26c24f['query'][_0x086a('0x1c')]);}return _0x4a341a[_0x086a('0x49')](_0x1d0801);}})[_0x086a('0x25')](function(_0x327e4c){if(_0x327e4c){return _0x327e4c?{'count':_0xd30105,'rows':_0x327e4c}:null;}})[_0x086a('0x25')](respondWithResult(_0x3ba6a0,null))[_0x086a('0x48')](handleError(_0x3ba6a0,null));};exports[_0x086a('0x4d')]=function(_0x589807,_0x4cb8f6,_0x435fed){var _0x71a550={};var _0x5d783c={};var _0x26c358;var _0x17d5f7;return db[_0x086a('0x2b')][_0x086a('0x4a')]({'where':{'id':_0x589807['params']['id']}})['then'](handleEntityNotFound(_0x4cb8f6,null))['then'](function(_0xbe716a){if(_0xbe716a){_0x26c358=_0xbe716a;_0x5d783c[_0x086a('0x32')]=_[_0x086a('0x2e')](db[_0x086a('0x4b')][_0x086a('0x2c')]);_0x5d783c[_0x086a('0x2f')]=_[_0x086a('0x2e')](_0x589807[_0x086a('0x2f')]);_0x5d783c[_0x086a('0x30')]=_[_0x086a('0x31')](_0x5d783c[_0x086a('0x32')],_0x5d783c['query']);_0x71a550['attributes']=_[_0x086a('0x31')](_0x5d783c['model'],qs[_0x086a('0x34')](_0x589807[_0x086a('0x2f')][_0x086a('0x34')]));_0x71a550[_0x086a('0x33')]=_0x71a550[_0x086a('0x33')][_0x086a('0x35')]?_0x71a550[_0x086a('0x33')]:_0x5d783c[_0x086a('0x32')];_0x71a550['order']=qs[_0x086a('0x39')](_0x589807[_0x086a('0x2f')][_0x086a('0x39')]);_0x71a550[_0x086a('0x3a')]=qs[_0x086a('0x30')](_[_0x086a('0x4c')](_0x589807['query'],_0x5d783c[_0x086a('0x30')]));if(_0x589807['query'][_0x086a('0x3b')]){_0x71a550[_0x086a('0x3a')]=_[_0x086a('0x3c')](_0x71a550[_0x086a('0x3a')],{'$or':_[_0x086a('0x2a')](_0x71a550[_0x086a('0x33')],function(_0x15083a){var _0x594b1d={};_0x594b1d[_0x15083a]={'$like':'%'+_0x589807[_0x086a('0x2f')]['filter']+'%'};return _0x594b1d;})});}_0x71a550=_[_0x086a('0x3c')]({},_0x71a550,_0x589807[_0x086a('0x3e')]);return _0x26c358[_0x086a('0x4d')](_0x71a550);}})['then'](function(_0x5a3ecd){if(_0x5a3ecd){_0x17d5f7=_0x5a3ecd[_0x086a('0x35')];if(!_0x589807['query']['hasOwnProperty'](_0x086a('0x37'))){_0x71a550[_0x086a('0x1e')]=qs[_0x086a('0x1e')](_0x589807[_0x086a('0x2f')][_0x086a('0x1e')]);_0x71a550['offset']=qs['offset'](_0x589807[_0x086a('0x2f')][_0x086a('0x1c')]);}return _0x26c358['getSubjects'](_0x71a550);}})[_0x086a('0x25')](function(_0x114f39){if(_0x114f39){return _0x114f39?{'count':_0x17d5f7,'rows':_0x114f39}:null;}})[_0x086a('0x25')](respondWithResult(_0x4cb8f6,null))[_0x086a('0x48')](handleError(_0x4cb8f6,null));};exports[_0x086a('0x4e')]=function(_0x232760,_0xf33286,_0x8f3e60){var _0x3619c9={};var _0x5a7d6b={};var _0x53aed5;var _0x382f4f;return db[_0x086a('0x2b')][_0x086a('0x4a')]({'where':{'id':_0x232760[_0x086a('0x43')]['id']}})['then'](handleEntityNotFound(_0xf33286,null))['then'](function(_0x193c77){if(_0x193c77){_0x53aed5=_0x193c77;_0x5a7d6b[_0x086a('0x32')]=_['keys'](db[_0x086a('0x4b')][_0x086a('0x2c')]);_0x5a7d6b[_0x086a('0x2f')]=_[_0x086a('0x2e')](_0x232760[_0x086a('0x2f')]);_0x5a7d6b[_0x086a('0x30')]=_['intersection'](_0x5a7d6b[_0x086a('0x32')],_0x5a7d6b[_0x086a('0x2f')]);_0x3619c9[_0x086a('0x33')]=_[_0x086a('0x31')](_0x5a7d6b[_0x086a('0x32')],qs[_0x086a('0x34')](_0x232760[_0x086a('0x2f')]['fields']));_0x3619c9[_0x086a('0x33')]=_0x3619c9[_0x086a('0x33')][_0x086a('0x35')]?_0x3619c9['attributes']:_0x5a7d6b[_0x086a('0x32')];_0x3619c9['order']=qs[_0x086a('0x39')](_0x232760['query'][_0x086a('0x39')]);_0x3619c9['where']=qs[_0x086a('0x30')](_[_0x086a('0x4c')](_0x232760[_0x086a('0x2f')],_0x5a7d6b['filters']));if(_0x232760[_0x086a('0x2f')][_0x086a('0x3b')]){_0x3619c9['where']=_[_0x086a('0x3c')](_0x3619c9[_0x086a('0x3a')],{'$or':_[_0x086a('0x2a')](_0x3619c9[_0x086a('0x33')],function(_0x366766){var _0x1acb72={};_0x1acb72[_0x366766]={'$like':'%'+_0x232760[_0x086a('0x2f')][_0x086a('0x3b')]+'%'};return _0x1acb72;})});}_0x3619c9=_[_0x086a('0x3c')]({},_0x3619c9,_0x232760[_0x086a('0x3e')]);return _0x53aed5[_0x086a('0x4e')](_0x3619c9);}})[_0x086a('0x25')](function(_0x406169){if(_0x406169){_0x382f4f=_0x406169[_0x086a('0x35')];if(!_0x232760['query'][_0x086a('0x36')]('nolimit')){_0x3619c9[_0x086a('0x1e')]=qs[_0x086a('0x1e')](_0x232760[_0x086a('0x2f')][_0x086a('0x1e')]);_0x3619c9[_0x086a('0x1c')]=qs['offset'](_0x232760[_0x086a('0x2f')][_0x086a('0x1c')]);}return _0x53aed5['getDescriptions'](_0x3619c9);}})[_0x086a('0x25')](function(_0x44f6b4){if(_0x44f6b4){return _0x44f6b4?{'count':_0x382f4f,'rows':_0x44f6b4}:null;}})[_0x086a('0x25')](respondWithResult(_0xf33286,null))['catch'](handleError(_0xf33286,null));};exports[_0x086a('0x4f')]=function(_0x1d0ae1,_0x5a1cf3,_0x967c99){var _0x12916f={};var _0x24c9c7={};var _0x48923a;var _0x563e70;return db['ZendeskConfiguration'][_0x086a('0x4a')]({'where':{'id':_0x1d0ae1[_0x086a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a1cf3,null))['then'](function(_0x4b1d26){if(_0x4b1d26){_0x48923a=_0x4b1d26;_0x24c9c7[_0x086a('0x32')]=_[_0x086a('0x2e')](db['Tag'][_0x086a('0x2c')]);_0x24c9c7[_0x086a('0x2f')]=_[_0x086a('0x2e')](_0x1d0ae1['query']);_0x24c9c7[_0x086a('0x30')]=_['intersection'](_0x24c9c7[_0x086a('0x32')],_0x24c9c7[_0x086a('0x2f')]);_0x12916f[_0x086a('0x33')]=_['intersection'](_0x24c9c7[_0x086a('0x32')],qs['fields'](_0x1d0ae1['query']['fields']));_0x12916f['attributes']=_0x12916f[_0x086a('0x33')]['length']?_0x12916f[_0x086a('0x33')]:_0x24c9c7['model'];_0x12916f[_0x086a('0x38')]=qs[_0x086a('0x39')](_0x1d0ae1[_0x086a('0x2f')][_0x086a('0x39')]);_0x12916f[_0x086a('0x3a')]=qs['filters'](_[_0x086a('0x4c')](_0x1d0ae1['query'],_0x24c9c7['filters']));if(_0x1d0ae1['query'][_0x086a('0x3b')]){_0x12916f[_0x086a('0x3a')]=_[_0x086a('0x3c')](_0x12916f[_0x086a('0x3a')],{'$or':_['map'](_0x12916f[_0x086a('0x33')],function(_0x10c5e7){var _0x195c7c={};_0x195c7c[_0x10c5e7]={'$like':'%'+_0x1d0ae1[_0x086a('0x2f')][_0x086a('0x3b')]+'%'};return _0x195c7c;})});}_0x12916f=_[_0x086a('0x3c')]({},_0x12916f,_0x1d0ae1[_0x086a('0x3e')]);return _0x48923a[_0x086a('0x4f')](_0x12916f);}})[_0x086a('0x25')](function(_0x385859){if(_0x385859){_0x563e70=_0x385859[_0x086a('0x35')];if(!_0x1d0ae1['query'][_0x086a('0x36')](_0x086a('0x37'))){_0x12916f['limit']=qs[_0x086a('0x1e')](_0x1d0ae1[_0x086a('0x2f')][_0x086a('0x1e')]);_0x12916f['offset']=qs['offset'](_0x1d0ae1[_0x086a('0x2f')][_0x086a('0x1c')]);}return _0x48923a['getTags'](_0x12916f);}})[_0x086a('0x25')](function(_0x3a087e){if(_0x3a087e){return _0x3a087e?{'count':_0x563e70,'rows':_0x3a087e}:null;}})[_0x086a('0x25')](respondWithResult(_0x5a1cf3,null))[_0x086a('0x48')](handleError(_0x5a1cf3,null));};exports[_0x086a('0x50')]=function(_0x23730c,_0x2f3ce5,_0xef3d1a){if(_0x23730c[_0x086a('0x47')]['id']){delete _0x23730c[_0x086a('0x47')]['id'];}return db[_0x086a('0x2b')][_0x086a('0x4a')]({'where':{'id':_0x23730c[_0x086a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f3ce5,null))['then'](function(_0x527e2f){if(_0x527e2f){return _0x527e2f[_0x086a('0x50')](_0x23730c[_0x086a('0x47')][_0x086a('0x51')]||[]);}return null;})[_0x086a('0x25')](respondWithResult(_0x2f3ce5,null))['catch'](handleError(_0x2f3ce5,null));}; \ No newline at end of file +var _0x3a72=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskConfiguration','includeAll','findAll','rows','catch','show','params','keys','include','find','body','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key'];(function(_0x3b93ba,_0x55b0a5){var _0x5cd7cb=function(_0x1ec96a){while(--_0x1ec96a){_0x3b93ba['push'](_0x3b93ba['shift']());}};_0x5cd7cb(++_0x55b0a5);}(_0x3a72,0xd7));var _0x23a7=function(_0x3ee8da,_0xb416b3){_0x3ee8da=_0x3ee8da-0x0;var _0x29dd43=_0x3a72[_0x3ee8da];return _0x29dd43;};'use strict';var emlformat=require(_0x23a7('0x0'));var rimraf=require(_0x23a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23a7('0x2'));var rp=require('request-promise');var moment=require(_0x23a7('0x3'));var BPromise=require(_0x23a7('0x4'));var Mustache=require(_0x23a7('0x5'));var util=require(_0x23a7('0x6'));var path=require(_0x23a7('0x7'));var sox=require(_0x23a7('0x8'));var csv=require(_0x23a7('0x9'));var ejs=require(_0x23a7('0xa'));var fs=require('fs');var fs_extra=require(_0x23a7('0xb'));var _=require(_0x23a7('0xc'));var squel=require(_0x23a7('0xd'));var crypto=require('crypto');var jsforce=require(_0x23a7('0xe'));var deskjs=require(_0x23a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x23a7('0x10'));var Papa=require(_0x23a7('0x11'));var Redis=require(_0x23a7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x23a7('0x13'));var as=require(_0x23a7('0x14'));var hardwareService=require(_0x23a7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x23a7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x23a7('0x17'));var db=require(_0x23a7('0x18'))['db'];function respondWithStatusCode(_0x2ca4ec,_0x15b8a8){_0x15b8a8=_0x15b8a8||0xcc;return function(_0x584693){if(_0x584693){return _0x2ca4ec[_0x23a7('0x19')](_0x15b8a8);}return _0x2ca4ec[_0x23a7('0x1a')](_0x15b8a8)[_0x23a7('0x1b')]();};}function respondWithResult(_0xb42a98,_0xeed311){_0xeed311=_0xeed311||0xc8;return function(_0x619f67){if(_0x619f67){return _0xb42a98['status'](_0xeed311)[_0x23a7('0x1c')](_0x619f67);}};}function respondWithFilteredResult(_0x5240bc,_0x391b58){return function(_0x1ab5b4){if(_0x1ab5b4){var _0x12ebb0=typeof _0x391b58[_0x23a7('0x1d')]==='undefined'&&typeof _0x391b58[_0x23a7('0x1e')]===_0x23a7('0x1f');var _0x2723a2=_0x1ab5b4[_0x23a7('0x20')];var _0x39871c=_0x12ebb0?0x0:_0x391b58[_0x23a7('0x1d')];var _0x1b0ae3=_0x12ebb0?_0x1ab5b4[_0x23a7('0x20')]:_0x391b58[_0x23a7('0x1d')]+_0x391b58[_0x23a7('0x1e')];var _0x489ab1;if(_0x1b0ae3>=_0x2723a2){_0x1b0ae3=_0x2723a2;_0x489ab1=0xc8;}else{_0x489ab1=0xce;}_0x5240bc[_0x23a7('0x1a')](_0x489ab1);return _0x5240bc[_0x23a7('0x21')](_0x23a7('0x22'),_0x39871c+'-'+_0x1b0ae3+'/'+_0x2723a2)[_0x23a7('0x1c')](_0x1ab5b4);}return null;};}function patchUpdates(_0xa155ed){return function(_0x2124b2){try{jsonpatch[_0x23a7('0x23')](_0x2124b2,_0xa155ed,!![]);}catch(_0xa7af24){return BPromise[_0x23a7('0x24')](_0xa7af24);}return _0x2124b2[_0x23a7('0x25')]();};}function saveUpdates(_0x24354,_0x11a1e7){return function(_0x5c7eec){if(_0x5c7eec){return _0x5c7eec[_0x23a7('0x26')](_0x24354)[_0x23a7('0x27')](function(_0x259236){return _0x259236;});}return null;};}function removeEntity(_0x427de3,_0x1e3be2){return function(_0x196604){if(_0x196604){return _0x196604[_0x23a7('0x28')]()[_0x23a7('0x27')](function(){_0x427de3[_0x23a7('0x1a')](0xcc)[_0x23a7('0x1b')]();});}};}function handleEntityNotFound(_0x47ecfe,_0x4326e6){return function(_0x53234f){if(!_0x53234f){_0x47ecfe[_0x23a7('0x19')](0x194);}return _0x53234f;};}function handleError(_0x1d3ae8,_0x17b55b){_0x17b55b=_0x17b55b||0x1f4;return function(_0x4bba76){logger[_0x23a7('0x29')](_0x4bba76[_0x23a7('0x2a')]);if(_0x4bba76[_0x23a7('0x2b')]){delete _0x4bba76[_0x23a7('0x2b')];}_0x1d3ae8[_0x23a7('0x1a')](_0x17b55b)[_0x23a7('0x2c')](_0x4bba76);};}exports[_0x23a7('0x2d')]=function(_0x99fe37,_0x27b00c){var _0x390206={},_0x13014c={},_0x545f29={'count':0x0,'rows':[]};var _0x7c2adc=_['map'](db['ZendeskConfiguration'][_0x23a7('0x2e')],function(_0x38b5a9){return{'name':_0x38b5a9[_0x23a7('0x2f')],'type':_0x38b5a9['type'][_0x23a7('0x30')]};});_0x13014c[_0x23a7('0x31')]=_[_0x23a7('0x32')](_0x7c2adc,'name');_0x13014c['query']=_['keys'](_0x99fe37[_0x23a7('0x33')]);_0x13014c[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x13014c[_0x23a7('0x31')],_0x13014c['query']);_0x390206[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x13014c[_0x23a7('0x31')],qs['fields'](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x37')]));_0x390206[_0x23a7('0x36')]=_0x390206['attributes'][_0x23a7('0x38')]?_0x390206[_0x23a7('0x36')]:_0x13014c[_0x23a7('0x31')];if(!_0x99fe37[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x390206[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x390206[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x99fe37[_0x23a7('0x33')]['offset']);}_0x390206['order']=qs[_0x23a7('0x3b')](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x390206[_0x23a7('0x3c')]=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x99fe37[_0x23a7('0x33')],_0x13014c[_0x23a7('0x34')]),_0x7c2adc);if(_0x99fe37[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x390206['where']=_[_0x23a7('0x3f')](_0x390206[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x7c2adc,function(_0x297ab1){if(_0x297ab1[_0x23a7('0x40')]!==_0x23a7('0x41')){var _0x373e8c={};_0x373e8c[_0x297ab1[_0x23a7('0x2b')]]={'$like':'%'+_0x99fe37['query'][_0x23a7('0x3e')]+'%'};return _0x373e8c;}})});}_0x390206=_[_0x23a7('0x3f')]({},_0x390206,_0x99fe37[_0x23a7('0x42')]);var _0xce56dc={'where':_0x390206['where']};return db[_0x23a7('0x43')][_0x23a7('0x20')](_0xce56dc)[_0x23a7('0x27')](function(_0x333b20){_0x545f29['count']=_0x333b20;if(_0x99fe37[_0x23a7('0x33')][_0x23a7('0x44')]){_0x390206['include']=[{'all':!![]}];}return db[_0x23a7('0x43')][_0x23a7('0x45')](_0x390206);})['then'](function(_0x2defa5){_0x545f29[_0x23a7('0x46')]=_0x2defa5;return _0x545f29;})[_0x23a7('0x27')](respondWithFilteredResult(_0x27b00c,_0x390206))[_0x23a7('0x47')](handleError(_0x27b00c,null));};exports[_0x23a7('0x48')]=function(_0x596ddc,_0x3f6343){var _0x216758={'raw':![],'where':{'id':_0x596ddc[_0x23a7('0x49')]['id']}},_0x3ad37a={};_0x3ad37a[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db['ZendeskConfiguration']['rawAttributes']);_0x3ad37a[_0x23a7('0x33')]=_[_0x23a7('0x4a')](_0x596ddc[_0x23a7('0x33')]);_0x3ad37a[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x3ad37a[_0x23a7('0x31')],_0x3ad37a['query']);_0x216758[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x3ad37a[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x596ddc[_0x23a7('0x33')]['fields']));_0x216758[_0x23a7('0x36')]=_0x216758['attributes'][_0x23a7('0x38')]?_0x216758[_0x23a7('0x36')]:_0x3ad37a[_0x23a7('0x31')];if(_0x596ddc[_0x23a7('0x33')][_0x23a7('0x44')]){_0x216758[_0x23a7('0x4b')]=[{'all':!![]}];}_0x216758=_['merge']({},_0x216758,_0x596ddc[_0x23a7('0x42')]);return db['ZendeskConfiguration'][_0x23a7('0x4c')](_0x216758)[_0x23a7('0x27')](handleEntityNotFound(_0x3f6343,null))['then'](respondWithResult(_0x3f6343,null))[_0x23a7('0x47')](handleError(_0x3f6343,null));};exports['create']=function(_0x67bf40,_0x447e63){return db[_0x23a7('0x43')]['create'](_0x67bf40[_0x23a7('0x4d')],{})['then'](respondWithResult(_0x447e63,0xc9))['catch'](handleError(_0x447e63,null));};exports[_0x23a7('0x26')]=function(_0xebc66d,_0x405377){if(_0xebc66d['body']['id']){delete _0xebc66d[_0x23a7('0x4d')]['id'];}return db[_0x23a7('0x43')][_0x23a7('0x4c')]({'where':{'id':_0xebc66d[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x405377,null))['then'](saveUpdates(_0xebc66d[_0x23a7('0x4d')],null))[_0x23a7('0x27')](respondWithResult(_0x405377,null))[_0x23a7('0x47')](handleError(_0x405377,null));};exports[_0x23a7('0x28')]=function(_0x4375c1,_0x3946ab){return db[_0x23a7('0x43')][_0x23a7('0x4c')]({'where':{'id':_0x4375c1[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x3946ab,null))['then'](removeEntity(_0x3946ab,null))[_0x23a7('0x47')](handleError(_0x3946ab,null));};exports[_0x23a7('0x4e')]=function(_0x12122d,_0x1eb592,_0x4907cb){var _0x8fcb3={};var _0x582a18={};var _0x16e7e0;var _0x3c42f9;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x12122d[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x1eb592,null))[_0x23a7('0x27')](function(_0x2a8754){if(_0x2a8754){_0x16e7e0=_0x2a8754;_0x582a18[_0x23a7('0x31')]=_['keys'](db[_0x23a7('0x50')]['rawAttributes']);_0x582a18[_0x23a7('0x33')]=_[_0x23a7('0x4a')](_0x12122d['query']);_0x582a18[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x582a18[_0x23a7('0x31')],_0x582a18[_0x23a7('0x33')]);_0x8fcb3[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x582a18['model'],qs[_0x23a7('0x37')](_0x12122d[_0x23a7('0x33')][_0x23a7('0x37')]));_0x8fcb3[_0x23a7('0x36')]=_0x8fcb3[_0x23a7('0x36')][_0x23a7('0x38')]?_0x8fcb3[_0x23a7('0x36')]:_0x582a18['model'];_0x8fcb3[_0x23a7('0x51')]=qs[_0x23a7('0x3b')](_0x12122d[_0x23a7('0x33')]['sort']);_0x8fcb3[_0x23a7('0x3c')]=qs['filters'](_[_0x23a7('0x3d')](_0x12122d[_0x23a7('0x33')],_0x582a18['filters']));if(_0x12122d[_0x23a7('0x33')]['filter']){_0x8fcb3[_0x23a7('0x3c')]=_[_0x23a7('0x3f')](_0x8fcb3[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x8fcb3[_0x23a7('0x36')],function(_0x343c9e){var _0x2eaf1d={};_0x2eaf1d[_0x343c9e]={'$like':'%'+_0x12122d[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x2eaf1d;})});}_0x8fcb3=_[_0x23a7('0x3f')]({},_0x8fcb3,_0x12122d[_0x23a7('0x42')]);return _0x16e7e0[_0x23a7('0x4e')](_0x8fcb3);}})['then'](function(_0x463638){if(_0x463638){_0x3c42f9=_0x463638[_0x23a7('0x38')];if(!_0x12122d[_0x23a7('0x33')]['hasOwnProperty'](_0x23a7('0x3a'))){_0x8fcb3[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x12122d['query']['limit']);_0x8fcb3[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x12122d[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x16e7e0[_0x23a7('0x4e')](_0x8fcb3);}})[_0x23a7('0x27')](function(_0x3285b9){if(_0x3285b9){return _0x3285b9?{'count':_0x3c42f9,'rows':_0x3285b9}:null;}})[_0x23a7('0x27')](respondWithResult(_0x1eb592,null))[_0x23a7('0x47')](handleError(_0x1eb592,null));};exports[_0x23a7('0x52')]=function(_0x33cda2,_0x1d7e2d,_0x2600d2){var _0x65f7db={};var _0x1c83d3={};var _0x5b8107;var _0x509aff;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x33cda2[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x1d7e2d,null))[_0x23a7('0x27')](function(_0x121d8a){if(_0x121d8a){_0x5b8107=_0x121d8a;_0x1c83d3[_0x23a7('0x31')]=_['keys'](db[_0x23a7('0x50')]['rawAttributes']);_0x1c83d3[_0x23a7('0x33')]=_['keys'](_0x33cda2['query']);_0x1c83d3[_0x23a7('0x34')]=_['intersection'](_0x1c83d3[_0x23a7('0x31')],_0x1c83d3[_0x23a7('0x33')]);_0x65f7db['attributes']=_[_0x23a7('0x35')](_0x1c83d3[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x37')]));_0x65f7db['attributes']=_0x65f7db['attributes'][_0x23a7('0x38')]?_0x65f7db['attributes']:_0x1c83d3[_0x23a7('0x31')];_0x65f7db[_0x23a7('0x51')]=qs[_0x23a7('0x3b')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x65f7db[_0x23a7('0x3c')]=qs['filters'](_[_0x23a7('0x3d')](_0x33cda2['query'],_0x1c83d3[_0x23a7('0x34')]));if(_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x65f7db['where']=_[_0x23a7('0x3f')](_0x65f7db[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x65f7db['attributes'],function(_0x3421ca){var _0x57e58d={};_0x57e58d[_0x3421ca]={'$like':'%'+_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x57e58d;})});}_0x65f7db=_[_0x23a7('0x3f')]({},_0x65f7db,_0x33cda2[_0x23a7('0x42')]);return _0x5b8107[_0x23a7('0x52')](_0x65f7db);}})['then'](function(_0x5b3920){if(_0x5b3920){_0x509aff=_0x5b3920[_0x23a7('0x38')];if(!_0x33cda2[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x65f7db[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x65f7db['offset']=qs[_0x23a7('0x1d')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x5b8107['getSubjects'](_0x65f7db);}})['then'](function(_0x4f7743){if(_0x4f7743){return _0x4f7743?{'count':_0x509aff,'rows':_0x4f7743}:null;}})[_0x23a7('0x27')](respondWithResult(_0x1d7e2d,null))['catch'](handleError(_0x1d7e2d,null));};exports[_0x23a7('0x53')]=function(_0x5a2323,_0x274792,_0x396313){var _0x468502={};var _0x236021={};var _0x3c1e67;var _0x138794;return db['ZendeskConfiguration'][_0x23a7('0x4f')]({'where':{'id':_0x5a2323[_0x23a7('0x49')]['id']}})['then'](handleEntityNotFound(_0x274792,null))[_0x23a7('0x27')](function(_0x5b4c5b){if(_0x5b4c5b){_0x3c1e67=_0x5b4c5b;_0x236021[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db[_0x23a7('0x50')][_0x23a7('0x2e')]);_0x236021['query']=_['keys'](_0x5a2323[_0x23a7('0x33')]);_0x236021[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x236021[_0x23a7('0x31')],_0x236021['query']);_0x468502['attributes']=_[_0x23a7('0x35')](_0x236021[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x5a2323[_0x23a7('0x33')]['fields']));_0x468502['attributes']=_0x468502[_0x23a7('0x36')][_0x23a7('0x38')]?_0x468502[_0x23a7('0x36')]:_0x236021['model'];_0x468502['order']=qs[_0x23a7('0x3b')](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x468502['where']=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x5a2323['query'],_0x236021[_0x23a7('0x34')]));if(_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x468502[_0x23a7('0x3c')]=_['merge'](_0x468502[_0x23a7('0x3c')],{'$or':_['map'](_0x468502['attributes'],function(_0x2eb94b){var _0x6953e={};_0x6953e[_0x2eb94b]={'$like':'%'+_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x6953e;})});}_0x468502=_[_0x23a7('0x3f')]({},_0x468502,_0x5a2323[_0x23a7('0x42')]);return _0x3c1e67['getDescriptions'](_0x468502);}})[_0x23a7('0x27')](function(_0xe3c8c8){if(_0xe3c8c8){_0x138794=_0xe3c8c8[_0x23a7('0x38')];if(!_0x5a2323[_0x23a7('0x33')][_0x23a7('0x39')]('nolimit')){_0x468502[_0x23a7('0x1e')]=qs['limit'](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x468502[_0x23a7('0x1d')]=qs['offset'](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x3c1e67[_0x23a7('0x53')](_0x468502);}})['then'](function(_0x1b2dc6){if(_0x1b2dc6){return _0x1b2dc6?{'count':_0x138794,'rows':_0x1b2dc6}:null;}})[_0x23a7('0x27')](respondWithResult(_0x274792,null))[_0x23a7('0x47')](handleError(_0x274792,null));};exports[_0x23a7('0x54')]=function(_0x5a1981,_0x203460,_0x40a4c0){var _0x49d9d9={};var _0x1fbfe4={};var _0x163d1c;var _0x46960c;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x5a1981[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x203460,null))[_0x23a7('0x27')](function(_0x4bf28b){if(_0x4bf28b){_0x163d1c=_0x4bf28b;_0x1fbfe4[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db[_0x23a7('0x55')][_0x23a7('0x2e')]);_0x1fbfe4[_0x23a7('0x33')]=_['keys'](_0x5a1981[_0x23a7('0x33')]);_0x1fbfe4[_0x23a7('0x34')]=_['intersection'](_0x1fbfe4[_0x23a7('0x31')],_0x1fbfe4[_0x23a7('0x33')]);_0x49d9d9[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x1fbfe4[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x5a1981['query'][_0x23a7('0x37')]));_0x49d9d9[_0x23a7('0x36')]=_0x49d9d9[_0x23a7('0x36')][_0x23a7('0x38')]?_0x49d9d9['attributes']:_0x1fbfe4[_0x23a7('0x31')];_0x49d9d9['order']=qs[_0x23a7('0x3b')](_0x5a1981['query'][_0x23a7('0x3b')]);_0x49d9d9[_0x23a7('0x3c')]=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x5a1981[_0x23a7('0x33')],_0x1fbfe4[_0x23a7('0x34')]));if(_0x5a1981[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x49d9d9['where']=_['merge'](_0x49d9d9[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x49d9d9[_0x23a7('0x36')],function(_0x1c216f){var _0x591087={};_0x591087[_0x1c216f]={'$like':'%'+_0x5a1981[_0x23a7('0x33')]['filter']+'%'};return _0x591087;})});}_0x49d9d9=_[_0x23a7('0x3f')]({},_0x49d9d9,_0x5a1981[_0x23a7('0x42')]);return _0x163d1c['getTags'](_0x49d9d9);}})[_0x23a7('0x27')](function(_0x229f83){if(_0x229f83){_0x46960c=_0x229f83[_0x23a7('0x38')];if(!_0x5a1981[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x49d9d9[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x5a1981[_0x23a7('0x33')]['limit']);_0x49d9d9[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x5a1981['query'][_0x23a7('0x1d')]);}return _0x163d1c[_0x23a7('0x54')](_0x49d9d9);}})[_0x23a7('0x27')](function(_0x5542a2){if(_0x5542a2){return _0x5542a2?{'count':_0x46960c,'rows':_0x5542a2}:null;}})[_0x23a7('0x27')](respondWithResult(_0x203460,null))['catch'](handleError(_0x203460,null));};exports[_0x23a7('0x56')]=function(_0x364fb7,_0x5024e5,_0x35acae){if(_0x364fb7[_0x23a7('0x4d')]['id']){delete _0x364fb7['body']['id'];}return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x364fb7['params']['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x5024e5,null))[_0x23a7('0x27')](function(_0x178e46){if(_0x178e46){return _0x178e46[_0x23a7('0x56')](_0x364fb7[_0x23a7('0x4d')][_0x23a7('0x57')]||[]);}return null;})[_0x23a7('0x27')](respondWithResult(_0x5024e5,null))[_0x23a7('0x47')](handleError(_0x5024e5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f184007..53be7da 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 _0x7334=['exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0xbf1132,_0x176b34){var _0xe63ce4=function(_0x52d8ed){while(--_0x52d8ed){_0xbf1132['push'](_0xbf1132['shift']());}};_0xe63ce4(++_0x176b34);}(_0x7334,0x184));var _0x4733=function(_0x2d4840,_0x49f8b0){_0x2d4840=_0x2d4840-0x0;var _0x2bb17f=_0x7334[_0x2d4840];return _0x2bb17f;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var logger=require(_0x4733('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4733('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4733('0x4'));var rimraf=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var attributes=require(_0x4733('0x7'));module[_0x4733('0x8')]=function(_0x449ead,_0x16d7cc){return _0x449ead[_0x4733('0x9')](_0x4733('0xa'),attributes,{'tableName':_0x4733('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb78e=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x40784a,_0x561c1b){var _0x4bbea1=function(_0x13ad7b){while(--_0x13ad7b){_0x40784a['push'](_0x40784a['shift']());}};_0x4bbea1(++_0x561c1b);}(_0xb78e,0x1c9));var _0xeb78=function(_0x1be076,_0x1f7be3){_0x1be076=_0x1be076-0x0;var _0x544859=_0xb78e[_0x1be076];return _0x544859;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'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 531f4cf..7eb519f 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 _0xf4fd=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4d612f,_0x1d2fc7){var _0xfa6212=function(_0x2425fb){while(--_0x2425fb){_0x4d612f['push'](_0x4d612f['shift']());}};_0xfa6212(++_0x1d2fc7);}(_0xf4fd,0x15b));var _0xdf4f=function(_0x4d38f5,_0x3ebf77){_0x4d38f5=_0x4d38f5-0x0;var _0x4efa94=_0xf4fd[_0x4d38f5];return _0x4efa94;};'use strict';var _=require(_0xdf4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf4f('0x1'));var rs=require(_0xdf4f('0x2'));var fs=require('fs');var Redis=require(_0xdf4f('0x3'));var db=require(_0xdf4f('0x4'))['db'];var utils=require(_0xdf4f('0x5'));var logger=require(_0xdf4f('0x6'))(_0xdf4f('0x7'));var config=require(_0xdf4f('0x8'));var jayson=require(_0xdf4f('0x9'));var client=jayson[_0xdf4f('0xa')][_0xdf4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203d3f,_0x427397,_0x28815c){return new BPromise(function(_0x577d35,_0x3c8bec){return client[_0xdf4f('0xc')](_0x203d3f,_0x28815c)[_0xdf4f('0xd')](function(_0x5460cf){logger[_0xdf4f('0xe')](_0xdf4f('0xf'),_0x427397,_0xdf4f('0x10'));logger[_0xdf4f('0x11')](_0xdf4f('0x12'),_0x427397,_0xdf4f('0x10'),JSON[_0xdf4f('0x13')](_0x5460cf));if(_0x5460cf['error']){if(_0x5460cf[_0xdf4f('0x14')]['code']===0x1f4){logger[_0xdf4f('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x427397,_0x5460cf[_0xdf4f('0x14')]['message']);return _0x3c8bec(_0x5460cf[_0xdf4f('0x14')]['message']);}logger[_0xdf4f('0x14')](_0xdf4f('0xf'),_0x427397,_0x5460cf[_0xdf4f('0x14')]['message']);return _0x577d35(_0x5460cf[_0xdf4f('0x14')][_0xdf4f('0x15')]);}else{logger['info'](_0xdf4f('0xf'),_0x427397,_0xdf4f('0x10'));_0x577d35(_0x5460cf[_0xdf4f('0x16')][_0xdf4f('0x15')]);}})[_0xdf4f('0x17')](function(_0x2e7413){logger[_0xdf4f('0x14')](_0xdf4f('0xf'),_0x427397,_0x2e7413);_0x3c8bec(_0x2e7413);});});} \ No newline at end of file +var _0x43f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0xbb76d2,_0x5c290b){var _0x4ce6cd=function(_0x157c8c){while(--_0x157c8c){_0xbb76d2['push'](_0xbb76d2['shift']());}};_0x4ce6cd(++_0x5c290b);}(_0x43f0,0x131));var _0x043f=function(_0x13cc34,_0x28bb2c){_0x13cc34=_0x13cc34-0x0;var _0xb3d0ee=_0x43f0[_0x13cc34];return _0xb3d0ee;};'use strict';var _=require(_0x043f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x043f('0x1'));var rs=require(_0x043f('0x2'));var fs=require('fs');var Redis=require(_0x043f('0x3'));var db=require(_0x043f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x043f('0x5'))('rpc');var config=require(_0x043f('0x6'));var jayson=require(_0x043f('0x7'));var client=jayson['client'][_0x043f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55432e,_0x4e05a3,_0x58820d){return new BPromise(function(_0x1b69f6,_0x38d867){return client[_0x043f('0x9')](_0x55432e,_0x58820d)['then'](function(_0xf5e2b4){logger[_0x043f('0xa')](_0x043f('0xb'),_0x4e05a3,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4e05a3,_0x043f('0xc'),JSON['stringify'](_0xf5e2b4));if(_0xf5e2b4[_0x043f('0xd')]){if(_0xf5e2b4['error'][_0x043f('0xe')]===0x1f4){logger[_0x043f('0xd')](_0x043f('0xb'),_0x4e05a3,_0xf5e2b4[_0x043f('0xd')]['message']);return _0x38d867(_0xf5e2b4[_0x043f('0xd')][_0x043f('0xf')]);}logger[_0x043f('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4e05a3,_0xf5e2b4['error'][_0x043f('0xf')]);return _0x1b69f6(_0xf5e2b4['error'][_0x043f('0xf')]);}else{logger['info'](_0x043f('0xb'),_0x4e05a3,'request\x20sent');_0x1b69f6(_0xf5e2b4[_0x043f('0x10')][_0x043f('0xf')]);}})[_0x043f('0x11')](function(_0x27ce66){logger['error'](_0x043f('0xb'),_0x4e05a3,_0x27ce66);_0x38d867(_0x27ce66);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 132b895..cb51b40 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 _0x7da0=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4fc460,_0x256740){var _0x5957d3=function(_0x567289){while(--_0x567289){_0x4fc460['push'](_0x4fc460['shift']());}};_0x5957d3(++_0x256740);}(_0x7da0,0x162));var _0x07da=function(_0x4bee96,_0x1810b6){_0x4bee96=_0x4bee96-0x0;var _0x2c1ed1=_0x7da0[_0x4bee96];return _0x2c1ed1;};'use strict';var multer=require(_0x07da('0x0'));var util=require(_0x07da('0x1'));var path=require(_0x07da('0x2'));var timeout=require(_0x07da('0x3'));var express=require(_0x07da('0x4'));var router=express[_0x07da('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x07da('0x6'));var config=require(_0x07da('0x7'));var controller=require(_0x07da('0x8'));router[_0x07da('0x9')]('/',auth[_0x07da('0xa')](),controller['index']);router[_0x07da('0x9')](_0x07da('0xb'),auth[_0x07da('0xa')](),controller[_0x07da('0xc')]);router[_0x07da('0xd')]('/',auth['isAuthenticated'](),controller[_0x07da('0xe')]);router[_0x07da('0xf')]('/:id',auth[_0x07da('0xa')](),controller['update']);router['delete']('/:id',auth[_0x07da('0xa')](),controller[_0x07da('0x10')]);module[_0x07da('0x11')]=router; \ No newline at end of file +var _0xbd97=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xbd97,0x1c7));var _0x7bd9=function(_0x1e7696,_0x5e4a6d){_0x1e7696=_0x1e7696-0x0;var _0x36343e=_0xbd97[_0x1e7696];return _0x36343e;};'use strict';var multer=require(_0x7bd9('0x0'));var util=require(_0x7bd9('0x1'));var path=require(_0x7bd9('0x2'));var timeout=require(_0x7bd9('0x3'));var express=require(_0x7bd9('0x4'));var router=express[_0x7bd9('0x5')]();var fs_extra=require(_0x7bd9('0x6'));var auth=require(_0x7bd9('0x7'));var interaction=require(_0x7bd9('0x8'));var config=require(_0x7bd9('0x9'));var controller=require(_0x7bd9('0xa'));router['get']('/',auth[_0x7bd9('0xb')](),controller[_0x7bd9('0xc')]);router[_0x7bd9('0xd')]('/:id',auth[_0x7bd9('0xb')](),controller[_0x7bd9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7bd9('0xf')]);router[_0x7bd9('0x10')](_0x7bd9('0x11'),auth['isAuthenticated'](),controller[_0x7bd9('0x12')]);router['delete']('/:id',auth[_0x7bd9('0xb')](),controller['destroy']);module[_0x7bd9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5dee9d4..041b8ef 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 _0xf660=['ENUM','string','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x2b3575,_0x1810da){var _0x1bd53b=function(_0x48a8f6){while(--_0x48a8f6){_0x2b3575['push'](_0x2b3575['shift']());}};_0x1bd53b(++_0x1810da);}(_0xf660,0x15e));var _0x0f66=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xf660[_0x421eeb];return _0x2c7371;};'use strict';var Sequelize=require(_0x0f66('0x0'));module[_0x0f66('0x1')]={'type':{'type':Sequelize[_0x0f66('0x2')](_0x0f66('0x3'),'variable',_0x0f66('0x4'),_0x0f66('0x5'),'picklist'),'defaultValue':_0x0f66('0x3')},'content':{'type':Sequelize[_0x0f66('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f66('0x2')](_0x0f66('0x3'),'variable',_0x0f66('0x4'))},'keyContent':{'type':Sequelize[_0x0f66('0x6')]},'idField':{'type':Sequelize[_0x0f66('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f66('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f66('0x6')]}}; \ No newline at end of file +var _0xa846=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x28d6ae,_0x53ae37){var _0x3d7180=function(_0x3cd7c0){while(--_0x3cd7c0){_0x28d6ae['push'](_0x28d6ae['shift']());}};_0x3d7180(++_0x53ae37);}(_0xa846,0x1c8));var _0x6a84=function(_0x1da42f,_0x23dc53){_0x1da42f=_0x1da42f-0x0;var _0x458c83=_0xa846[_0x1da42f];return _0x458c83;};'use strict';var Sequelize=require(_0x6a84('0x0'));module[_0x6a84('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x6a84('0x2'),_0x6a84('0x3'),_0x6a84('0x4'),_0x6a84('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6a84('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a84('0x7')]('string','variable',_0x6a84('0x3'))},'keyContent':{'type':Sequelize[_0x6a84('0x6')]},'idField':{'type':Sequelize[_0x6a84('0x6')]},'nameField':{'type':Sequelize[_0x6a84('0x6')]},'customField':{'type':Sequelize[_0x6a84('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a84('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1128ade..ca6ccb2 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 _0x6cd7=['bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6cd7,0x127));var _0x76cd=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x6cd7[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require(_0x76cd('0x0'));var rimraf=require(_0x76cd('0x1'));var zipdir=require(_0x76cd('0x2'));var jsonpatch=require(_0x76cd('0x3'));var rp=require('request-promise');var moment=require(_0x76cd('0x4'));var BPromise=require(_0x76cd('0x5'));var Mustache=require(_0x76cd('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x76cd('0x7'));var ejs=require(_0x76cd('0x8'));var fs=require('fs');var fs_extra=require(_0x76cd('0x9'));var _=require(_0x76cd('0xa'));var squel=require(_0x76cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x76cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x76cd('0x7'));var querystring=require(_0x76cd('0xd'));var Papa=require(_0x76cd('0xe'));var Redis=require(_0x76cd('0xf'));var authService=require(_0x76cd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x76cd('0x11'));var hardwareService=require(_0x76cd('0x12'));var logger=require(_0x76cd('0x13'))(_0x76cd('0x14'));var utils=require(_0x76cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x76cd('0x16'))['db'];function respondWithStatusCode(_0x474750,_0x352501){_0x352501=_0x352501||0xcc;return function(_0x55b76e){if(_0x55b76e){return _0x474750[_0x76cd('0x17')](_0x352501);}return _0x474750[_0x76cd('0x18')](_0x352501)[_0x76cd('0x19')]();};}function respondWithResult(_0x359b9e,_0x25eaad){_0x25eaad=_0x25eaad||0xc8;return function(_0xacaf19){if(_0xacaf19){return _0x359b9e[_0x76cd('0x18')](_0x25eaad)[_0x76cd('0x1a')](_0xacaf19);}};}function respondWithFilteredResult(_0x35b69d,_0x59380b){return function(_0x1a5229){if(_0x1a5229){var _0x10979a=typeof _0x59380b['offset']==='undefined'&&typeof _0x59380b[_0x76cd('0x1b')]===_0x76cd('0x1c');var _0x470dfd=_0x1a5229[_0x76cd('0x1d')];var _0xfe1bb8=_0x10979a?0x0:_0x59380b[_0x76cd('0x1e')];var _0x18eacb=_0x10979a?_0x1a5229['count']:_0x59380b[_0x76cd('0x1e')]+_0x59380b['limit'];var _0x2db27;if(_0x18eacb>=_0x470dfd){_0x18eacb=_0x470dfd;_0x2db27=0xc8;}else{_0x2db27=0xce;}_0x35b69d[_0x76cd('0x18')](_0x2db27);return _0x35b69d[_0x76cd('0x1f')](_0x76cd('0x20'),_0xfe1bb8+'-'+_0x18eacb+'/'+_0x470dfd)[_0x76cd('0x1a')](_0x1a5229);}return null;};}function patchUpdates(_0x2b4ec4){return function(_0x2cccb0){try{jsonpatch['apply'](_0x2cccb0,_0x2b4ec4,!![]);}catch(_0x1e7e6d){return BPromise[_0x76cd('0x21')](_0x1e7e6d);}return _0x2cccb0[_0x76cd('0x22')]();};}function saveUpdates(_0x23bfbf,_0x23dfce){return function(_0x5a000c){if(_0x5a000c){return _0x5a000c[_0x76cd('0x23')](_0x23bfbf)[_0x76cd('0x24')](function(_0x709c23){return _0x709c23;});}return null;};}function removeEntity(_0x4505e5,_0x26880c){return function(_0x29794b){if(_0x29794b){return _0x29794b[_0x76cd('0x25')]()[_0x76cd('0x24')](function(){_0x4505e5['status'](0xcc)[_0x76cd('0x19')]();});}};}function handleEntityNotFound(_0xde6f9c,_0x344bc4){return function(_0x542cd4){if(!_0x542cd4){_0xde6f9c[_0x76cd('0x17')](0x194);}return _0x542cd4;};}function handleError(_0x48e0fa,_0xe3699b){_0xe3699b=_0xe3699b||0x1f4;return function(_0x38cdd7){logger[_0x76cd('0x26')](_0x38cdd7[_0x76cd('0x27')]);if(_0x38cdd7[_0x76cd('0x28')]){delete _0x38cdd7[_0x76cd('0x28')];}_0x48e0fa['status'](_0xe3699b)[_0x76cd('0x29')](_0x38cdd7);};}exports[_0x76cd('0x2a')]=function(_0x404a1d,_0xb3d4ea){var _0x3ef4be={},_0x56e6a2={},_0x5dcc4a={'count':0x0,'rows':[]};var _0x4f382e=_[_0x76cd('0x2b')](db[_0x76cd('0x2c')][_0x76cd('0x2d')],function(_0x348291){return{'name':_0x348291[_0x76cd('0x2e')],'type':_0x348291[_0x76cd('0x2f')][_0x76cd('0x30')]};});_0x56e6a2[_0x76cd('0x31')]=_[_0x76cd('0x2b')](_0x4f382e,_0x76cd('0x28'));_0x56e6a2[_0x76cd('0x32')]=_[_0x76cd('0x33')](_0x404a1d[_0x76cd('0x32')]);_0x56e6a2[_0x76cd('0x34')]=_[_0x76cd('0x35')](_0x56e6a2['model'],_0x56e6a2[_0x76cd('0x32')]);_0x3ef4be[_0x76cd('0x36')]=_[_0x76cd('0x35')](_0x56e6a2[_0x76cd('0x31')],qs[_0x76cd('0x37')](_0x404a1d['query'][_0x76cd('0x37')]));_0x3ef4be[_0x76cd('0x36')]=_0x3ef4be[_0x76cd('0x36')][_0x76cd('0x38')]?_0x3ef4be[_0x76cd('0x36')]:_0x56e6a2[_0x76cd('0x31')];if(!_0x404a1d[_0x76cd('0x32')][_0x76cd('0x39')]('nolimit')){_0x3ef4be[_0x76cd('0x1b')]=qs[_0x76cd('0x1b')](_0x404a1d['query']['limit']);_0x3ef4be[_0x76cd('0x1e')]=qs[_0x76cd('0x1e')](_0x404a1d[_0x76cd('0x32')][_0x76cd('0x1e')]);}_0x3ef4be['order']=qs['sort'](_0x404a1d['query'][_0x76cd('0x3a')]);_0x3ef4be[_0x76cd('0x3b')]=qs[_0x76cd('0x34')](_[_0x76cd('0x3c')](_0x404a1d[_0x76cd('0x32')],_0x56e6a2[_0x76cd('0x34')]),_0x4f382e);if(_0x404a1d[_0x76cd('0x32')][_0x76cd('0x3d')]){_0x3ef4be[_0x76cd('0x3b')]=_[_0x76cd('0x3e')](_0x3ef4be[_0x76cd('0x3b')],{'$or':_['map'](_0x4f382e,function(_0x15b9f5){if(_0x15b9f5[_0x76cd('0x2f')]!==_0x76cd('0x3f')){var _0x12eb19={};_0x12eb19[_0x15b9f5[_0x76cd('0x28')]]={'$like':'%'+_0x404a1d['query'][_0x76cd('0x3d')]+'%'};return _0x12eb19;}})});}_0x3ef4be=_[_0x76cd('0x3e')]({},_0x3ef4be,_0x404a1d[_0x76cd('0x40')]);var _0x55b195={'where':_0x3ef4be[_0x76cd('0x3b')]};return db[_0x76cd('0x2c')][_0x76cd('0x1d')](_0x55b195)[_0x76cd('0x24')](function(_0x1aaf95){_0x5dcc4a['count']=_0x1aaf95;if(_0x404a1d[_0x76cd('0x32')][_0x76cd('0x41')]){_0x3ef4be[_0x76cd('0x42')]=[{'all':!![]}];}return db[_0x76cd('0x2c')][_0x76cd('0x43')](_0x3ef4be);})[_0x76cd('0x24')](function(_0x1f2dc9){_0x5dcc4a[_0x76cd('0x44')]=_0x1f2dc9;return _0x5dcc4a;})[_0x76cd('0x24')](respondWithFilteredResult(_0xb3d4ea,_0x3ef4be))[_0x76cd('0x45')](handleError(_0xb3d4ea,null));};exports[_0x76cd('0x46')]=function(_0x55a12,_0x4a862d){var _0x25007d={'raw':!![],'where':{'id':_0x55a12[_0x76cd('0x47')]['id']}},_0x57a0f8={};_0x57a0f8[_0x76cd('0x31')]=_[_0x76cd('0x33')](db['ZendeskField'][_0x76cd('0x2d')]);_0x57a0f8[_0x76cd('0x32')]=_[_0x76cd('0x33')](_0x55a12[_0x76cd('0x32')]);_0x57a0f8[_0x76cd('0x34')]=_[_0x76cd('0x35')](_0x57a0f8[_0x76cd('0x31')],_0x57a0f8['query']);_0x25007d[_0x76cd('0x36')]=_[_0x76cd('0x35')](_0x57a0f8[_0x76cd('0x31')],qs[_0x76cd('0x37')](_0x55a12[_0x76cd('0x32')][_0x76cd('0x37')]));_0x25007d[_0x76cd('0x36')]=_0x25007d[_0x76cd('0x36')]['length']?_0x25007d[_0x76cd('0x36')]:_0x57a0f8[_0x76cd('0x31')];if(_0x55a12[_0x76cd('0x32')][_0x76cd('0x41')]){_0x25007d['include']=[{'all':!![]}];}_0x25007d=_[_0x76cd('0x3e')]({},_0x25007d,_0x55a12['options']);return db[_0x76cd('0x2c')][_0x76cd('0x48')](_0x25007d)['then'](handleEntityNotFound(_0x4a862d,null))[_0x76cd('0x24')](respondWithResult(_0x4a862d,null))[_0x76cd('0x45')](handleError(_0x4a862d,null));};exports[_0x76cd('0x49')]=function(_0x30368b,_0xf62230){return db[_0x76cd('0x2c')][_0x76cd('0x49')](_0x30368b[_0x76cd('0x4a')],{})[_0x76cd('0x24')](respondWithResult(_0xf62230,0xc9))[_0x76cd('0x45')](handleError(_0xf62230,null));};exports[_0x76cd('0x23')]=function(_0x3af24a,_0x17d36f){if(_0x3af24a['body']['id']){delete _0x3af24a['body']['id'];}return db[_0x76cd('0x2c')]['find']({'where':{'id':_0x3af24a['params']['id']}})[_0x76cd('0x24')](handleEntityNotFound(_0x17d36f,null))[_0x76cd('0x24')](saveUpdates(_0x3af24a['body'],null))[_0x76cd('0x24')](respondWithResult(_0x17d36f,null))[_0x76cd('0x45')](handleError(_0x17d36f,null));};exports['destroy']=function(_0x4df431,_0x249311){return db[_0x76cd('0x2c')][_0x76cd('0x48')]({'where':{'id':_0x4df431['params']['id']}})[_0x76cd('0x24')](handleEntityNotFound(_0x249311,null))['then'](removeEntity(_0x249311,null))[_0x76cd('0x45')](handleError(_0x249311,null));}; \ No newline at end of file +var _0xdb76=['to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ZendeskField','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x4a1902,_0x498455){var _0x1185cf=function(_0x57f01a){while(--_0x57f01a){_0x4a1902['push'](_0x4a1902['shift']());}};_0x1185cf(++_0x498455);}(_0xdb76,0x8c));var _0x6db7=function(_0xefb84a,_0x217c3e){_0xefb84a=_0xefb84a-0x0;var _0x1ecff9=_0xdb76[_0xefb84a];return _0x1ecff9;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require(_0x6db7('0x5'));var BPromise=require(_0x6db7('0x6'));var Mustache=require(_0x6db7('0x7'));var util=require('util');var path=require(_0x6db7('0x8'));var sox=require(_0x6db7('0x9'));var csv=require(_0x6db7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require(_0x6db7('0xe'));var jsforce=require(_0x6db7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6db7('0xa'));var querystring=require('querystring');var Papa=require(_0x6db7('0x10'));var Redis=require(_0x6db7('0x11'));var authService=require(_0x6db7('0x12'));var qs=require(_0x6db7('0x13'));var as=require(_0x6db7('0x14'));var hardwareService=require(_0x6db7('0x15'));var logger=require(_0x6db7('0x16'))(_0x6db7('0x17'));var utils=require(_0x6db7('0x18'));var config=require(_0x6db7('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ec515,_0x2cbba1){_0x2cbba1=_0x2cbba1||0xcc;return function(_0x44bc8f){if(_0x44bc8f){return _0x4ec515[_0x6db7('0x1a')](_0x2cbba1);}return _0x4ec515[_0x6db7('0x1b')](_0x2cbba1)[_0x6db7('0x1c')]();};}function respondWithResult(_0x3b16a8,_0x35ec4f){_0x35ec4f=_0x35ec4f||0xc8;return function(_0x1f9e8c){if(_0x1f9e8c){return _0x3b16a8[_0x6db7('0x1b')](_0x35ec4f)[_0x6db7('0x1d')](_0x1f9e8c);}};}function respondWithFilteredResult(_0xe437ca,_0x3617d8){return function(_0x4abfb4){if(_0x4abfb4){var _0x4d9965=typeof _0x3617d8[_0x6db7('0x1e')]==='undefined'&&typeof _0x3617d8[_0x6db7('0x1f')]==='undefined';var _0xaef975=_0x4abfb4[_0x6db7('0x20')];var _0x16c3bf=_0x4d9965?0x0:_0x3617d8[_0x6db7('0x1e')];var _0x381b08=_0x4d9965?_0x4abfb4[_0x6db7('0x20')]:_0x3617d8[_0x6db7('0x1e')]+_0x3617d8[_0x6db7('0x1f')];var _0x3a76f5;if(_0x381b08>=_0xaef975){_0x381b08=_0xaef975;_0x3a76f5=0xc8;}else{_0x3a76f5=0xce;}_0xe437ca[_0x6db7('0x1b')](_0x3a76f5);return _0xe437ca[_0x6db7('0x21')](_0x6db7('0x22'),_0x16c3bf+'-'+_0x381b08+'/'+_0xaef975)[_0x6db7('0x1d')](_0x4abfb4);}return null;};}function patchUpdates(_0x5c8a7c){return function(_0x44a65f){try{jsonpatch[_0x6db7('0x23')](_0x44a65f,_0x5c8a7c,!![]);}catch(_0x2a3f0b){return BPromise[_0x6db7('0x24')](_0x2a3f0b);}return _0x44a65f[_0x6db7('0x25')]();};}function saveUpdates(_0x3453e2,_0x1c31fd){return function(_0x3d26a5){if(_0x3d26a5){return _0x3d26a5[_0x6db7('0x26')](_0x3453e2)[_0x6db7('0x27')](function(_0x766ee8){return _0x766ee8;});}return null;};}function removeEntity(_0x5f2a14,_0x304269){return function(_0x428429){if(_0x428429){return _0x428429[_0x6db7('0x28')]()[_0x6db7('0x27')](function(){_0x5f2a14[_0x6db7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2571f4,_0xd1ffe8){return function(_0x5bba99){if(!_0x5bba99){_0x2571f4[_0x6db7('0x1a')](0x194);}return _0x5bba99;};}function handleError(_0x5235a7,_0x2be4a8){_0x2be4a8=_0x2be4a8||0x1f4;return function(_0x59a150){logger[_0x6db7('0x29')](_0x59a150['stack']);if(_0x59a150[_0x6db7('0x2a')]){delete _0x59a150[_0x6db7('0x2a')];}_0x5235a7[_0x6db7('0x1b')](_0x2be4a8)[_0x6db7('0x2b')](_0x59a150);};}exports[_0x6db7('0x2c')]=function(_0x4a15fd,_0x2833d9){var _0x234f3c={},_0x4c0810={},_0x4766e7={'count':0x0,'rows':[]};var _0x22de42=_['map'](db[_0x6db7('0x2d')][_0x6db7('0x2e')],function(_0xe766fd){return{'name':_0xe766fd['fieldName'],'type':_0xe766fd['type'][_0x6db7('0x2f')]};});_0x4c0810[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x22de42,'name');_0x4c0810[_0x6db7('0x32')]=_[_0x6db7('0x33')](_0x4a15fd['query']);_0x4c0810['filters']=_['intersection'](_0x4c0810[_0x6db7('0x30')],_0x4c0810[_0x6db7('0x32')]);_0x234f3c[_0x6db7('0x34')]=_[_0x6db7('0x35')](_0x4c0810[_0x6db7('0x30')],qs[_0x6db7('0x36')](_0x4a15fd['query']['fields']));_0x234f3c[_0x6db7('0x34')]=_0x234f3c[_0x6db7('0x34')]['length']?_0x234f3c['attributes']:_0x4c0810[_0x6db7('0x30')];if(!_0x4a15fd[_0x6db7('0x32')][_0x6db7('0x37')](_0x6db7('0x38'))){_0x234f3c['limit']=qs[_0x6db7('0x1f')](_0x4a15fd['query'][_0x6db7('0x1f')]);_0x234f3c[_0x6db7('0x1e')]=qs[_0x6db7('0x1e')](_0x4a15fd[_0x6db7('0x32')]['offset']);}_0x234f3c[_0x6db7('0x39')]=qs[_0x6db7('0x3a')](_0x4a15fd[_0x6db7('0x32')]['sort']);_0x234f3c['where']=qs['filters'](_[_0x6db7('0x3b')](_0x4a15fd[_0x6db7('0x32')],_0x4c0810[_0x6db7('0x3c')]),_0x22de42);if(_0x4a15fd[_0x6db7('0x32')][_0x6db7('0x3d')]){_0x234f3c[_0x6db7('0x3e')]=_[_0x6db7('0x3f')](_0x234f3c['where'],{'$or':_[_0x6db7('0x31')](_0x22de42,function(_0x97e8ae){if(_0x97e8ae['type']!==_0x6db7('0x40')){var _0x54aa8a={};_0x54aa8a[_0x97e8ae[_0x6db7('0x2a')]]={'$like':'%'+_0x4a15fd['query'][_0x6db7('0x3d')]+'%'};return _0x54aa8a;}})});}_0x234f3c=_[_0x6db7('0x3f')]({},_0x234f3c,_0x4a15fd[_0x6db7('0x41')]);var _0x1707c8={'where':_0x234f3c[_0x6db7('0x3e')]};return db[_0x6db7('0x2d')][_0x6db7('0x20')](_0x1707c8)[_0x6db7('0x27')](function(_0x51b3c9){_0x4766e7[_0x6db7('0x20')]=_0x51b3c9;if(_0x4a15fd[_0x6db7('0x32')]['includeAll']){_0x234f3c[_0x6db7('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x6db7('0x43')](_0x234f3c);})[_0x6db7('0x27')](function(_0x5d2935){_0x4766e7['rows']=_0x5d2935;return _0x4766e7;})[_0x6db7('0x27')](respondWithFilteredResult(_0x2833d9,_0x234f3c))[_0x6db7('0x44')](handleError(_0x2833d9,null));};exports['show']=function(_0x746ec6,_0x55781c){var _0xfcd3b4={'raw':!![],'where':{'id':_0x746ec6[_0x6db7('0x45')]['id']}},_0x3254e9={};_0x3254e9[_0x6db7('0x30')]=_[_0x6db7('0x33')](db['ZendeskField'][_0x6db7('0x2e')]);_0x3254e9[_0x6db7('0x32')]=_[_0x6db7('0x33')](_0x746ec6[_0x6db7('0x32')]);_0x3254e9[_0x6db7('0x3c')]=_['intersection'](_0x3254e9[_0x6db7('0x30')],_0x3254e9[_0x6db7('0x32')]);_0xfcd3b4[_0x6db7('0x34')]=_[_0x6db7('0x35')](_0x3254e9[_0x6db7('0x30')],qs[_0x6db7('0x36')](_0x746ec6['query']['fields']));_0xfcd3b4['attributes']=_0xfcd3b4['attributes'][_0x6db7('0x46')]?_0xfcd3b4[_0x6db7('0x34')]:_0x3254e9[_0x6db7('0x30')];if(_0x746ec6[_0x6db7('0x32')][_0x6db7('0x47')]){_0xfcd3b4[_0x6db7('0x42')]=[{'all':!![]}];}_0xfcd3b4=_[_0x6db7('0x3f')]({},_0xfcd3b4,_0x746ec6[_0x6db7('0x41')]);return db[_0x6db7('0x2d')][_0x6db7('0x48')](_0xfcd3b4)['then'](handleEntityNotFound(_0x55781c,null))[_0x6db7('0x27')](respondWithResult(_0x55781c,null))['catch'](handleError(_0x55781c,null));};exports[_0x6db7('0x49')]=function(_0x541453,_0x4f7a45){return db[_0x6db7('0x2d')][_0x6db7('0x49')](_0x541453[_0x6db7('0x4a')],{})['then'](respondWithResult(_0x4f7a45,0xc9))[_0x6db7('0x44')](handleError(_0x4f7a45,null));};exports[_0x6db7('0x26')]=function(_0x42f484,_0x4e4a02){if(_0x42f484[_0x6db7('0x4a')]['id']){delete _0x42f484[_0x6db7('0x4a')]['id'];}return db[_0x6db7('0x2d')][_0x6db7('0x48')]({'where':{'id':_0x42f484[_0x6db7('0x45')]['id']}})[_0x6db7('0x27')](handleEntityNotFound(_0x4e4a02,null))['then'](saveUpdates(_0x42f484[_0x6db7('0x4a')],null))[_0x6db7('0x27')](respondWithResult(_0x4e4a02,null))[_0x6db7('0x44')](handleError(_0x4e4a02,null));};exports[_0x6db7('0x28')]=function(_0x24894b,_0x18900c){return db[_0x6db7('0x2d')]['find']({'where':{'id':_0x24894b[_0x6db7('0x45')]['id']}})[_0x6db7('0x27')](handleEntityNotFound(_0x18900c,null))[_0x6db7('0x27')](removeEntity(_0x18900c,null))[_0x6db7('0x44')](handleError(_0x18900c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 761a68e..e53048b 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 _0xec6d=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x57b159,_0x4c54ac){var _0x2010d5=function(_0x1ddf55){while(--_0x1ddf55){_0x57b159['push'](_0x57b159['shift']());}};_0x2010d5(++_0x4c54ac);}(_0xec6d,0xf5));var _0xdec6=function(_0x4e7040,_0x15d35a){_0x4e7040=_0x4e7040-0x0;var _0x827181=_0xec6d[_0x4e7040];return _0x827181;};'use strict';var _=require('lodash');var util=require(_0xdec6('0x0'));var logger=require(_0xdec6('0x1'))(_0xdec6('0x2'));var moment=require('moment');var BPromise=require(_0xdec6('0x3'));var rp=require(_0xdec6('0x4'));var fs=require('fs');var path=require(_0xdec6('0x5'));var rimraf=require(_0xdec6('0x6'));var config=require(_0xdec6('0x7'));var attributes=require(_0xdec6('0x8'));module[_0xdec6('0x9')]=function(_0x911557,_0x329181){return _0x911557[_0xdec6('0xa')](_0xdec6('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xdec6('0xc'),'fields':[_0xdec6('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6674=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x497fc4,_0x5c4397){var _0x4aa448=function(_0x716950){while(--_0x716950){_0x497fc4['push'](_0x497fc4['shift']());}};_0x4aa448(++_0x5c4397);}(_0x6674,0xb9));var _0x4667=function(_0x448d37,_0x2c4c1a){_0x448d37=_0x448d37-0x0;var _0x79c922=_0x6674[_0x448d37];return _0x79c922;};'use strict';var _=require(_0x4667('0x0'));var util=require(_0x4667('0x1'));var logger=require('../../config/logger')(_0x4667('0x2'));var moment=require(_0x4667('0x3'));var BPromise=require(_0x4667('0x4'));var rp=require(_0x4667('0x5'));var fs=require('fs');var path=require(_0x4667('0x6'));var rimraf=require('rimraf');var config=require(_0x4667('0x7'));var attributes=require(_0x4667('0x8'));module[_0x4667('0x9')]=function(_0xbad3c0,_0x5a77a4){return _0xbad3c0[_0x4667('0xa')](_0x4667('0xb'),attributes,{'tableName':_0x4667('0xc'),'paranoid':![],'indexes':[{'name':_0x4667('0xd'),'fields':[_0x4667('0xe'),_0x4667('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 96cdcb0..317e347 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 _0x19a6=['../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x534fed,_0x10e705){var _0x7d8375=function(_0x20a539){while(--_0x20a539){_0x534fed['push'](_0x534fed['shift']());}};_0x7d8375(++_0x10e705);}(_0x19a6,0xc8));var _0x619a=function(_0x2e53af,_0x3f2d1e){_0x2e53af=_0x2e53af-0x0;var _0x508a9e=_0x19a6[_0x2e53af];return _0x508a9e;};'use strict';var _=require(_0x619a('0x0'));var util=require(_0x619a('0x1'));var moment=require(_0x619a('0x2'));var BPromise=require(_0x619a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x619a('0x4'))['db'];var utils=require(_0x619a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x619a('0x6'));var client=jayson['client'][_0x619a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19e224,_0xd5e5ed,_0x548dd7){return new BPromise(function(_0x548c37,_0x3f81f9){return client[_0x619a('0x8')](_0x19e224,_0x548dd7)[_0x619a('0x9')](function(_0x40e746){logger[_0x619a('0xa')](_0x619a('0xb'),_0xd5e5ed,_0x619a('0xc'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0xd5e5ed,'request\x20sent',JSON['stringify'](_0x40e746));if(_0x40e746['error']){if(_0x40e746[_0x619a('0xd')][_0x619a('0xe')]===0x1f4){logger[_0x619a('0xd')]('ZendeskField,\x20%s,\x20%s',_0xd5e5ed,_0x40e746[_0x619a('0xd')]['message']);return _0x3f81f9(_0x40e746['error'][_0x619a('0xf')]);}logger[_0x619a('0xd')](_0x619a('0xb'),_0xd5e5ed,_0x40e746[_0x619a('0xd')]['message']);return _0x548c37(_0x40e746[_0x619a('0xd')][_0x619a('0xf')]);}else{logger[_0x619a('0xa')](_0x619a('0xb'),_0xd5e5ed,_0x619a('0xc'));_0x548c37(_0x40e746[_0x619a('0x10')][_0x619a('0xf')]);}})['catch'](function(_0x4921f5){logger[_0x619a('0xd')](_0x619a('0xb'),_0xd5e5ed,_0x4921f5);_0x3f81f9(_0x4921f5);});});} \ No newline at end of file +var _0x20c0=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x493376,_0x49d7f7){var _0x29520c=function(_0x4f8c06){while(--_0x4f8c06){_0x493376['push'](_0x493376['shift']());}};_0x29520c(++_0x49d7f7);}(_0x20c0,0x142));var _0x020c=function(_0x55acbb,_0x459a49){_0x55acbb=_0x55acbb-0x0;var _0x5c8e7a=_0x20c0[_0x55acbb];return _0x5c8e7a;};'use strict';var _=require(_0x020c('0x0'));var util=require(_0x020c('0x1'));var moment=require('moment');var BPromise=require(_0x020c('0x2'));var rs=require(_0x020c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x020c('0x4'))['db'];var utils=require(_0x020c('0x5'));var logger=require('../../config/logger')(_0x020c('0x6'));var config=require(_0x020c('0x7'));var jayson=require(_0x020c('0x8'));var client=jayson[_0x020c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9206,_0x21798e,_0x56b597){return new BPromise(function(_0x49e780,_0x2d51e5){return client[_0x020c('0xa')](_0x1b9206,_0x56b597)['then'](function(_0x1d8f94){logger[_0x020c('0xb')](_0x020c('0xc'),_0x21798e,_0x020c('0xd'));logger[_0x020c('0xe')](_0x020c('0xf'),_0x21798e,'request\x20sent',JSON[_0x020c('0x10')](_0x1d8f94));if(_0x1d8f94[_0x020c('0x11')]){if(_0x1d8f94[_0x020c('0x11')][_0x020c('0x12')]===0x1f4){logger[_0x020c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x21798e,_0x1d8f94[_0x020c('0x11')][_0x020c('0x13')]);return _0x2d51e5(_0x1d8f94[_0x020c('0x11')]['message']);}logger[_0x020c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x21798e,_0x1d8f94['error'][_0x020c('0x13')]);return _0x49e780(_0x1d8f94['error'][_0x020c('0x13')]);}else{logger[_0x020c('0xb')](_0x020c('0xc'),_0x21798e,_0x020c('0xd'));_0x49e780(_0x1d8f94['result'][_0x020c('0x13')]);}})[_0x020c('0x14')](function(_0x772902){logger[_0x020c('0x11')](_0x020c('0xc'),_0x21798e,_0x772902);_0x2d51e5(_0x772902);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f4d066b..96c9bd2 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 _0x7174=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra'];(function(_0x55d2ae,_0x231cf1){var _0x40dae1=function(_0x3dd769){while(--_0x3dd769){_0x55d2ae['push'](_0x55d2ae['shift']());}};_0x40dae1(++_0x231cf1);}(_0x7174,0x85));var _0x4717=function(_0x532df3,_0x3ebe41){_0x532df3=_0x532df3-0x0;var _0x330ddf=_0x7174[_0x532df3];return _0x330ddf;};'use strict';var multer=require(_0x4717('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4717('0x1'));var express=require(_0x4717('0x2'));var router=express[_0x4717('0x3')]();var fs_extra=require(_0x4717('0x4'));var auth=require(_0x4717('0x5'));var interaction=require(_0x4717('0x6'));var config=require(_0x4717('0x7'));var controller=require(_0x4717('0x8'));router[_0x4717('0x9')]('/',auth[_0x4717('0xa')](),controller[_0x4717('0xb')]);router['get'](_0x4717('0xc'),auth['isAuthenticated'](),controller[_0x4717('0xd')]);router[_0x4717('0x9')](_0x4717('0xe'),auth['isAuthenticated'](),controller[_0x4717('0xf')]);router[_0x4717('0x9')](_0x4717('0x10'),auth[_0x4717('0xa')](),controller[_0x4717('0x11')]);router[_0x4717('0x12')]('/',auth[_0x4717('0xa')](),controller[_0x4717('0x13')]);router[_0x4717('0x12')](_0x4717('0xe'),auth[_0x4717('0xa')](),controller['addConfiguration']);router['put'](_0x4717('0xc'),auth[_0x4717('0xa')](),controller[_0x4717('0x14')]);router[_0x4717('0x15')](_0x4717('0xc'),auth[_0x4717('0xa')](),controller[_0x4717('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8251=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x554507,_0x3617ef){var _0x2a6b61=function(_0xbde1c1){while(--_0xbde1c1){_0x554507['push'](_0x554507['shift']());}};_0x2a6b61(++_0x3617ef);}(_0x8251,0x19e));var _0x1825=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8251[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x1825('0x0'));var util=require('util');var path=require(_0x1825('0x1'));var timeout=require(_0x1825('0x2'));var express=require(_0x1825('0x3'));var router=express['Router']();var fs_extra=require(_0x1825('0x4'));var auth=require(_0x1825('0x5'));var interaction=require(_0x1825('0x6'));var config=require(_0x1825('0x7'));var controller=require(_0x1825('0x8'));router[_0x1825('0x9')]('/',auth[_0x1825('0xa')](),controller[_0x1825('0xb')]);router[_0x1825('0x9')](_0x1825('0xc'),auth['isAuthenticated'](),controller[_0x1825('0xd')]);router[_0x1825('0x9')](_0x1825('0xe'),auth[_0x1825('0xa')](),controller[_0x1825('0xf')]);router[_0x1825('0x9')](_0x1825('0x10'),auth[_0x1825('0xa')](),controller['getFields']);router[_0x1825('0x11')]('/',auth[_0x1825('0xa')](),controller[_0x1825('0x12')]);router[_0x1825('0x11')]('/:id/configurations',auth[_0x1825('0xa')](),controller[_0x1825('0x13')]);router[_0x1825('0x14')](_0x1825('0xc'),auth[_0x1825('0xa')](),controller[_0x1825('0x15')]);router[_0x1825('0x16')](_0x1825('0xc'),auth[_0x1825('0xa')](),controller[_0x1825('0x17')]);module[_0x1825('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d26c79d..d3a2096 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(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'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 _0xee5b=['sequelize','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x32a0d1,_0x2f915c){_0x32a0d1=_0x32a0d1-0x0;var _0x4b2f3c=_0xee5b[_0x32a0d1];return _0x4b2f3c;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 89a63f2..f1fa83e 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 _0x0faf=['create','body','params','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','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','clientId','serverUrl','code','zoho.eu','com','slice','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','ZohoAccount','findAll','rows','catch','show','options','find'];(function(_0x1d61fa,_0xc70c3){var _0xde2a8a=function(_0x44fcf5){while(--_0x44fcf5){_0x1d61fa['push'](_0x1d61fa['shift']());}};_0xde2a8a(++_0xc70c3);}(_0x0faf,0x148));var _0xf0fa=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x0faf[_0x193ddf];return _0x5bc6df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0fa('0x0'));var zipdir=require(_0xf0fa('0x1'));var jsonpatch=require(_0xf0fa('0x2'));var rp=require('request-promise');var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var Mustache=require(_0xf0fa('0x5'));var util=require('util');var path=require(_0xf0fa('0x6'));var sox=require(_0xf0fa('0x7'));var csv=require(_0xf0fa('0x8'));var ejs=require(_0xf0fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0fa('0xa'));var squel=require(_0xf0fa('0xb'));var crypto=require(_0xf0fa('0xc'));var jsforce=require(_0xf0fa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf0fa('0x8'));var querystring=require(_0xf0fa('0xe'));var Papa=require('papaparse');var Redis=require(_0xf0fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf0fa('0x10'));var as=require(_0xf0fa('0x11'));var hardwareService=require(_0xf0fa('0x12'));var logger=require(_0xf0fa('0x13'))(_0xf0fa('0x14'));var utils=require(_0xf0fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf0fa('0x16'));var db=require(_0xf0fa('0x17'))['db'];var integrations=require(_0xf0fa('0x18'));function respondWithStatusCode(_0x47762f,_0x19583c){_0x19583c=_0x19583c||0xcc;return function(_0x513b9c){if(_0x513b9c){return _0x47762f['sendStatus'](_0x19583c);}return _0x47762f[_0xf0fa('0x19')](_0x19583c)[_0xf0fa('0x1a')]();};}function respondWithResult(_0x4321a0,_0x49e72c){_0x49e72c=_0x49e72c||0xc8;return function(_0x467533){if(_0x467533){return _0x4321a0[_0xf0fa('0x19')](_0x49e72c)[_0xf0fa('0x1b')](_0x467533);}};}function respondWithFilteredResult(_0x53067b,_0x58d538){return function(_0x4b89cb){if(_0x4b89cb){var _0x21bdd8=typeof _0x58d538[_0xf0fa('0x1c')]===_0xf0fa('0x1d')&&typeof _0x58d538[_0xf0fa('0x1e')]===_0xf0fa('0x1d');var _0x4d2ef5=_0x4b89cb[_0xf0fa('0x1f')];var _0x538b1b=_0x21bdd8?0x0:_0x58d538['offset'];var _0x4781fe=_0x21bdd8?_0x4b89cb[_0xf0fa('0x1f')]:_0x58d538[_0xf0fa('0x1c')]+_0x58d538[_0xf0fa('0x1e')];var _0xd43f42;if(_0x4781fe>=_0x4d2ef5){_0x4781fe=_0x4d2ef5;_0xd43f42=0xc8;}else{_0xd43f42=0xce;}_0x53067b[_0xf0fa('0x19')](_0xd43f42);return _0x53067b[_0xf0fa('0x20')](_0xf0fa('0x21'),_0x538b1b+'-'+_0x4781fe+'/'+_0x4d2ef5)[_0xf0fa('0x1b')](_0x4b89cb);}return null;};}function patchUpdates(_0x31b4d1){return function(_0x435bd3){try{jsonpatch[_0xf0fa('0x22')](_0x435bd3,_0x31b4d1,!![]);}catch(_0x18f0ad){return BPromise[_0xf0fa('0x23')](_0x18f0ad);}return _0x435bd3[_0xf0fa('0x24')]();};}function saveUpdates(_0x190e36,_0x2c5569){return function(_0x38039f){if(_0x38039f){return _0x38039f[_0xf0fa('0x25')](_0x190e36)[_0xf0fa('0x26')](function(_0x3b3b4b){return _0x3b3b4b;});}return null;};}function removeEntity(_0x4992cf,_0x549f9e){return function(_0x58d883){if(_0x58d883){return _0x58d883[_0xf0fa('0x27')]()[_0xf0fa('0x26')](function(){_0x4992cf[_0xf0fa('0x19')](0xcc)[_0xf0fa('0x1a')]();});}};}function handleEntityNotFound(_0x4624cc,_0x1bc7b8){return function(_0x1ee6c2){if(!_0x1ee6c2){_0x4624cc[_0xf0fa('0x28')](0x194);}return _0x1ee6c2;};}function handleError(_0x520298,_0x45ceb5){_0x45ceb5=_0x45ceb5||0x1f4;return function(_0x187e50){logger[_0xf0fa('0x29')](_0x187e50[_0xf0fa('0x2a')]);if(_0x187e50[_0xf0fa('0x2b')]){delete _0x187e50[_0xf0fa('0x2b')];}_0x520298[_0xf0fa('0x19')](_0x45ceb5)[_0xf0fa('0x2c')](_0x187e50);};}exports['index']=function(_0x364ec4,_0x4e4e12){var _0x2b8916={},_0x2e540f={},_0x45a27d={'count':0x0,'rows':[]};var _0x566f04=_[_0xf0fa('0x2d')](db['ZohoAccount'][_0xf0fa('0x2e')],function(_0x307f1c){return{'name':_0x307f1c[_0xf0fa('0x2f')],'type':_0x307f1c[_0xf0fa('0x30')][_0xf0fa('0x31')]};});_0x2e540f[_0xf0fa('0x32')]=_['map'](_0x566f04,_0xf0fa('0x2b'));_0x2e540f[_0xf0fa('0x33')]=_[_0xf0fa('0x34')](_0x364ec4[_0xf0fa('0x33')]);_0x2e540f[_0xf0fa('0x35')]=_[_0xf0fa('0x36')](_0x2e540f[_0xf0fa('0x32')],_0x2e540f[_0xf0fa('0x33')]);_0x2b8916[_0xf0fa('0x37')]=_[_0xf0fa('0x36')](_0x2e540f[_0xf0fa('0x32')],qs['fields'](_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x38')]));_0x2b8916['attributes']=_0x2b8916[_0xf0fa('0x37')][_0xf0fa('0x39')]?_0x2b8916[_0xf0fa('0x37')]:_0x2e540f[_0xf0fa('0x32')];if(!_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x3a')](_0xf0fa('0x3b'))){_0x2b8916[_0xf0fa('0x1e')]=qs[_0xf0fa('0x1e')](_0x364ec4[_0xf0fa('0x33')]['limit']);_0x2b8916[_0xf0fa('0x1c')]=qs[_0xf0fa('0x1c')](_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x1c')]);}_0x2b8916['order']=qs[_0xf0fa('0x3c')](_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x3c')]);_0x2b8916[_0xf0fa('0x3d')]=qs[_0xf0fa('0x35')](_['pick'](_0x364ec4[_0xf0fa('0x33')],_0x2e540f[_0xf0fa('0x35')]),_0x566f04);if(_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x3e')]){_0x2b8916['where']=_[_0xf0fa('0x3f')](_0x2b8916[_0xf0fa('0x3d')],{'$or':_[_0xf0fa('0x2d')](_0x566f04,function(_0xd30f3d){if(_0xd30f3d[_0xf0fa('0x30')]!==_0xf0fa('0x40')){var _0x1f05a1={};_0x1f05a1[_0xd30f3d[_0xf0fa('0x2b')]]={'$like':'%'+_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x3e')]+'%'};return _0x1f05a1;}})});}_0x2b8916=_[_0xf0fa('0x3f')]({},_0x2b8916,_0x364ec4['options']);var _0x5b255f={'where':_0x2b8916[_0xf0fa('0x3d')]};return db['ZohoAccount'][_0xf0fa('0x1f')](_0x5b255f)[_0xf0fa('0x26')](function(_0x318393){_0x45a27d[_0xf0fa('0x1f')]=_0x318393;if(_0x364ec4[_0xf0fa('0x33')][_0xf0fa('0x41')]){_0x2b8916[_0xf0fa('0x42')]=[{'all':!![]}];}return db[_0xf0fa('0x43')][_0xf0fa('0x44')](_0x2b8916);})[_0xf0fa('0x26')](function(_0x37c47c){_0x45a27d[_0xf0fa('0x45')]=_0x37c47c;return _0x45a27d;})[_0xf0fa('0x26')](respondWithFilteredResult(_0x4e4e12,_0x2b8916))[_0xf0fa('0x46')](handleError(_0x4e4e12,null));};exports[_0xf0fa('0x47')]=function(_0x5db5db,_0x1460c2){var _0x1eba0c={'raw':![],'where':{'id':_0x5db5db['params']['id']}},_0x1abcf7={};_0x1abcf7[_0xf0fa('0x32')]=_[_0xf0fa('0x34')](db['ZohoAccount'][_0xf0fa('0x2e')]);_0x1abcf7[_0xf0fa('0x33')]=_[_0xf0fa('0x34')](_0x5db5db['query']);_0x1abcf7['filters']=_[_0xf0fa('0x36')](_0x1abcf7['model'],_0x1abcf7[_0xf0fa('0x33')]);_0x1eba0c['attributes']=_[_0xf0fa('0x36')](_0x1abcf7[_0xf0fa('0x32')],qs['fields'](_0x5db5db['query'][_0xf0fa('0x38')]));_0x1eba0c[_0xf0fa('0x37')]=_0x1eba0c[_0xf0fa('0x37')][_0xf0fa('0x39')]?_0x1eba0c[_0xf0fa('0x37')]:_0x1abcf7[_0xf0fa('0x32')];if(_0x5db5db[_0xf0fa('0x33')][_0xf0fa('0x41')]){_0x1eba0c['include']=[{'all':!![]}];}_0x1eba0c=_[_0xf0fa('0x3f')]({},_0x1eba0c,_0x5db5db[_0xf0fa('0x48')]);return db[_0xf0fa('0x43')][_0xf0fa('0x49')](_0x1eba0c)[_0xf0fa('0x26')](handleEntityNotFound(_0x1460c2,null))[_0xf0fa('0x26')](respondWithResult(_0x1460c2,null))['catch'](handleError(_0x1460c2,null));};exports['create']=function(_0x58ab2a,_0x2ccee2){return db[_0xf0fa('0x43')][_0xf0fa('0x4a')](_0x58ab2a[_0xf0fa('0x4b')],{})[_0xf0fa('0x26')](respondWithResult(_0x2ccee2,0xc9))['catch'](handleError(_0x2ccee2,null));};exports[_0xf0fa('0x25')]=function(_0x168b41,_0x5a8403){if(_0x168b41['body']['id']){delete _0x168b41['body']['id'];}return db[_0xf0fa('0x43')][_0xf0fa('0x49')]({'where':{'id':_0x168b41[_0xf0fa('0x4c')]['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x5a8403,null))['then'](saveUpdates(_0x168b41[_0xf0fa('0x4b')],null))['then'](respondWithResult(_0x5a8403,null))[_0xf0fa('0x46')](handleError(_0x5a8403,null));};exports[_0xf0fa('0x27')]=function(_0x1d3bee,_0x23b387){return db[_0xf0fa('0x43')]['find']({'where':{'id':_0x1d3bee[_0xf0fa('0x4c')]['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x23b387,null))[_0xf0fa('0x26')](removeEntity(_0x23b387,null))[_0xf0fa('0x46')](handleError(_0x23b387,null));};exports[_0xf0fa('0x4d')]=function(_0x3b5881,_0x15e2f2,_0x243f0f){var _0x34f5dd={};var _0x24a4f6={};var _0x3a274c;var _0x561789;return db[_0xf0fa('0x43')][_0xf0fa('0x4e')]({'where':{'id':_0x3b5881['params']['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x15e2f2,null))[_0xf0fa('0x26')](function(_0x4f26e3){if(_0x4f26e3){_0x3a274c=_0x4f26e3;_0x24a4f6['model']=_['keys'](db[_0xf0fa('0x4f')][_0xf0fa('0x2e')]);_0x24a4f6[_0xf0fa('0x33')]=_['keys'](_0x3b5881[_0xf0fa('0x33')]);_0x24a4f6['filters']=_['intersection'](_0x24a4f6[_0xf0fa('0x32')],_0x24a4f6[_0xf0fa('0x33')]);_0x34f5dd[_0xf0fa('0x37')]=_[_0xf0fa('0x36')](_0x24a4f6[_0xf0fa('0x32')],qs[_0xf0fa('0x38')](_0x3b5881[_0xf0fa('0x33')][_0xf0fa('0x38')]));_0x34f5dd[_0xf0fa('0x37')]=_0x34f5dd[_0xf0fa('0x37')][_0xf0fa('0x39')]?_0x34f5dd['attributes']:_0x24a4f6['model'];_0x34f5dd[_0xf0fa('0x50')]=qs[_0xf0fa('0x3c')](_0x3b5881[_0xf0fa('0x33')][_0xf0fa('0x3c')]);_0x34f5dd[_0xf0fa('0x3d')]=qs[_0xf0fa('0x35')](_['pick'](_0x3b5881[_0xf0fa('0x33')],_0x24a4f6[_0xf0fa('0x35')]));if(_0x3b5881[_0xf0fa('0x33')][_0xf0fa('0x3e')]){_0x34f5dd[_0xf0fa('0x3d')]=_[_0xf0fa('0x3f')](_0x34f5dd[_0xf0fa('0x3d')],{'$or':_[_0xf0fa('0x2d')](_0x34f5dd[_0xf0fa('0x37')],function(_0x63bfa9){var _0x2ecad5={};_0x2ecad5[_0x63bfa9]={'$like':'%'+_0x3b5881[_0xf0fa('0x33')]['filter']+'%'};return _0x2ecad5;})});}_0x34f5dd=_[_0xf0fa('0x3f')]({},_0x34f5dd,_0x3b5881[_0xf0fa('0x48')]);return _0x3a274c[_0xf0fa('0x4d')](_0x34f5dd);}})[_0xf0fa('0x26')](function(_0x6aab75){if(_0x6aab75){_0x561789=_0x6aab75[_0xf0fa('0x39')];if(!_0x3b5881[_0xf0fa('0x33')]['hasOwnProperty'](_0xf0fa('0x3b'))){_0x34f5dd['limit']=qs['limit'](_0x3b5881['query'][_0xf0fa('0x1e')]);_0x34f5dd[_0xf0fa('0x1c')]=qs[_0xf0fa('0x1c')](_0x3b5881[_0xf0fa('0x33')][_0xf0fa('0x1c')]);}return _0x3a274c[_0xf0fa('0x4d')](_0x34f5dd);}})[_0xf0fa('0x26')](function(_0x1d524d){if(_0x1d524d){return _0x1d524d?{'count':_0x561789,'rows':_0x1d524d}:null;}})['then'](respondWithResult(_0x15e2f2,null))[_0xf0fa('0x46')](handleError(_0x15e2f2,null));};exports[_0xf0fa('0x51')]=function(_0x262fe6,_0x402873,_0x2cd38b){if(_0x262fe6['body']['id']){delete _0x262fe6[_0xf0fa('0x4b')]['id'];}return db[_0xf0fa('0x43')][_0xf0fa('0x4e')]({'where':{'id':_0x262fe6[_0xf0fa('0x4c')]['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x402873,null))[_0xf0fa('0x26')](function(_0x1927c5){if(_0x1927c5){_0x262fe6[_0xf0fa('0x4b')][_0xf0fa('0x52')]=_0x1927c5['id'];_0x262fe6['body']['Subjects']=integrations[_0xf0fa('0x53')](_0x262fe6[_0xf0fa('0x4b')][_0xf0fa('0x54')],_0x262fe6[_0xf0fa('0x4b')]['type']);_0x262fe6[_0xf0fa('0x4b')][_0xf0fa('0x55')]=integrations[_0xf0fa('0x56')](_0x262fe6['body'][_0xf0fa('0x54')],_0x262fe6[_0xf0fa('0x4b')][_0xf0fa('0x30')]);return db[_0xf0fa('0x4f')][_0xf0fa('0x4a')](_0x262fe6[_0xf0fa('0x4b')],{'include':[{'model':db[_0xf0fa('0x57')],'as':_0xf0fa('0x58')},{'model':db['ZohoField'],'as':_0xf0fa('0x55')}]});}return null;})[_0xf0fa('0x26')](respondWithResult(_0x402873,null))[_0xf0fa('0x46')](handleError(_0x402873,null));};function getAccessToken(_0x46e577){return new Promise(function(_0x49b575,_0x1057cc){var _0x34339c;switch(_0x46e577[_0xf0fa('0x59')]){case'US':_0x34339c=_0xf0fa('0x5a');break;case'AU':_0x34339c='https://accounts.zoho.com.au';break;case'EU':_0x34339c=_0xf0fa('0x5b');break;case'IN':_0x34339c=_0xf0fa('0x5c');break;case'CN':_0x34339c=_0xf0fa('0x5d');break;default:_0x34339c=_0xf0fa('0x5b');break;}var _0x4c4d2d={'method':'POST','uri':_0x34339c+_0xf0fa('0x5e'),'qs':{'refresh_token':_0x46e577[_0xf0fa('0x5f')],'client_id':_0x46e577['clientId'],'client_secret':_0x46e577[_0xf0fa('0x60')],'grant_type':_0xf0fa('0x61')},'json':!![]};return rp(_0x4c4d2d)['then'](function(_0x38bfcd){if(_0x38bfcd[_0xf0fa('0x62')]){_0x49b575(_0x38bfcd[_0xf0fa('0x62')]);}else{_0x1057cc(_0xf0fa('0x63'));}})[_0xf0fa('0x46')](function(_0x296e27){_0x1057cc(_0x296e27);});});}exports['getFields']=function(_0x54e566,_0x1b3740,_0x31d6be){var _0xd96493,_0x4b9bda,_0x17a52d,_0x29d021,_0x526bcf;return db[_0xf0fa('0x43')]['findOne']({'where':{'id':_0x54e566['params']['id']},'attributes':['id',_0xf0fa('0x64'),_0xf0fa('0x59'),_0xf0fa('0x65'),_0xf0fa('0x60'),_0xf0fa('0x66'),_0xf0fa('0x67'),'refreshToken']})['then'](handleEntityNotFound(_0x1b3740,null))[_0xf0fa('0x26')](function(_0x3d3e9f){_0x526bcf=_0x3d3e9f;_0xd96493=_0x526bcf[_0xf0fa('0x64')];_0x4b9bda=_0xd96493===_0xf0fa('0x68')?'eu':_0xf0fa('0x69');_0x17a52d=_0x526bcf[_0xf0fa('0x66')];var _0x15ed2a=_0x17a52d[_0xf0fa('0x6a')](-0x1);if(_0x15ed2a==='/'||_0x15ed2a==='\x5c'||_0x15ed2a===':'){_0x17a52d=_0x17a52d['substring'](0x0,_0x17a52d[_0xf0fa('0x6b')](_0x15ed2a));}if(!_0x526bcf[_0xf0fa('0x5f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x526bcf);})[_0xf0fa('0x26')](function(_0x148bb2){if(_0x148bb2){return rp({'method':_0xf0fa('0x6c'),'uri':util[_0xf0fa('0x6d')](_0xf0fa('0x6e'),_0x4b9bda),'qs':{'module':_0xf0fa('0x6f')},'headers':{'Authorization':_0xf0fa('0x70')+_0x148bb2},'json':!![]});}})[_0xf0fa('0x26')](function(_0x3d859a){if(_0x3d859a){if(_0x3d859a[_0xf0fa('0x71')]&&_0x3d859a[_0xf0fa('0x71')][_0xf0fa('0x29')]){throw new Error(_0x3d859a[_0xf0fa('0x71')][_0xf0fa('0x29')][_0xf0fa('0x72')]);}var _0x5c8819=[];var _0x493167=[];var _0x2bcecf=[_0xf0fa('0x73'),'Subject','Description',_0xf0fa('0x74'),_0xf0fa('0x75'),_0xf0fa('0x76'),'Call_Start_Time',_0xf0fa('0x77')];_0x493167=_[_0xf0fa('0x78')](_0x3d859a[_0xf0fa('0x38')],function(_0x434d10){return _0x2bcecf[_0xf0fa('0x79')](_0x434d10[_0xf0fa('0x7a')]);});for(var _0x56dce0=0x0;_0x56dce0<_0x493167[_0xf0fa('0x39')];_0x56dce0++){if(_0x493167[_0x56dce0][_0xf0fa('0x7b')]===![]){_0x5c8819[_0xf0fa('0x7c')]({'id':_0x493167[_0x56dce0]['id'],'name':_0x493167[_0x56dce0][_0xf0fa('0x7d')],'custom':_0x493167[_0x56dce0]['custom_field'],'options':_0x493167[_0x56dce0][_0xf0fa('0x7e')]===_0xf0fa('0x7f')&&_0x493167[_0x56dce0][_0xf0fa('0x80')][_0xf0fa('0x39')]>-0x1?_['map'](_0x493167[_0x56dce0]['pick_list_values'],function(_0x65d6cf){return{'name':_0x65d6cf,'value':_0x65d6cf};}):[]});}}return{'count':_0x5c8819['length'],'rows':_0x5c8819};}else{return{'count':0x0,'rows':[]};}})[_0xf0fa('0x26')](respondWithResult(_0x1b3740,null))[_0xf0fa('0x46')](function(_0x50a782){var _0x5c796d=_0x54e566[_0xf0fa('0x33')][_0xf0fa('0x81')]?0x1f4:_0x50a782[_0xf0fa('0x82')]||0x1f4;logger[_0xf0fa('0x29')](_0xf0fa('0x83'),'getFields',_0x5c796d,JSON[_0xf0fa('0x84')](_0x50a782));delete _0x50a782[_0xf0fa('0x2b')];if(_0x5c796d===0x191){_0x5c796d=0x190;}_0x1b3740['status'](_0x5c796d)[_0xf0fa('0x2c')](_0x54e566[_0xf0fa('0x33')][_0xf0fa('0x81')]?{'message':_0xf0fa('0x85'),'statusCode':_0x50a782[_0xf0fa('0x82')]}:_0x50a782);});}; \ No newline at end of file +var _0xac1a=['filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','getConfigurations','ZohoConfiguration','order','findOne','AccountId','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','refreshToken','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','ZohoAccount','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xac1a,0x156));var _0xaac1=function(_0x4f841b,_0x487982){_0x4f841b=_0x4f841b-0x0;var _0x226bac=_0xac1a[_0x4f841b];return _0x226bac;};'use strict';var emlformat=require(_0xaac1('0x0'));var rimraf=require(_0xaac1('0x1'));var zipdir=require(_0xaac1('0x2'));var jsonpatch=require(_0xaac1('0x3'));var rp=require(_0xaac1('0x4'));var moment=require(_0xaac1('0x5'));var BPromise=require(_0xaac1('0x6'));var Mustache=require('mustache');var util=require(_0xaac1('0x7'));var path=require(_0xaac1('0x8'));var sox=require('sox');var csv=require(_0xaac1('0x9'));var ejs=require(_0xaac1('0xa'));var fs=require('fs');var fs_extra=require(_0xaac1('0xb'));var _=require(_0xaac1('0xc'));var squel=require(_0xaac1('0xd'));var crypto=require('crypto');var jsforce=require(_0xaac1('0xe'));var deskjs=require(_0xaac1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaac1('0x10'));var Papa=require(_0xaac1('0x11'));var Redis=require(_0xaac1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac1('0x13'));var hardwareService=require(_0xaac1('0x14'));var logger=require(_0xaac1('0x15'))(_0xaac1('0x16'));var utils=require('../../config/utils');var config=require(_0xaac1('0x17'));var licenseUtil=require(_0xaac1('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeba9d6,_0x5293b0){_0x5293b0=_0x5293b0||0xcc;return function(_0x587e63){if(_0x587e63){return _0xeba9d6[_0xaac1('0x19')](_0x5293b0);}return _0xeba9d6[_0xaac1('0x1a')](_0x5293b0)['end']();};}function respondWithResult(_0x262fcc,_0x57e6b5){_0x57e6b5=_0x57e6b5||0xc8;return function(_0x21b1fd){if(_0x21b1fd){return _0x262fcc[_0xaac1('0x1a')](_0x57e6b5)['json'](_0x21b1fd);}};}function respondWithFilteredResult(_0x3b1169,_0x27bb90){return function(_0x52930b){if(_0x52930b){var _0x294c7e=typeof _0x27bb90[_0xaac1('0x1b')]===_0xaac1('0x1c')&&typeof _0x27bb90[_0xaac1('0x1d')]==='undefined';var _0x5ee773=_0x52930b[_0xaac1('0x1e')];var _0x5d8f33=_0x294c7e?0x0:_0x27bb90[_0xaac1('0x1b')];var _0x158b10=_0x294c7e?_0x52930b[_0xaac1('0x1e')]:_0x27bb90[_0xaac1('0x1b')]+_0x27bb90['limit'];var _0x2cbc2f;if(_0x158b10>=_0x5ee773){_0x158b10=_0x5ee773;_0x2cbc2f=0xc8;}else{_0x2cbc2f=0xce;}_0x3b1169[_0xaac1('0x1a')](_0x2cbc2f);return _0x3b1169[_0xaac1('0x1f')](_0xaac1('0x20'),_0x5d8f33+'-'+_0x158b10+'/'+_0x5ee773)['json'](_0x52930b);}return null;};}function patchUpdates(_0x661b09){return function(_0x2391cc){try{jsonpatch[_0xaac1('0x21')](_0x2391cc,_0x661b09,!![]);}catch(_0x12fb7f){return BPromise[_0xaac1('0x22')](_0x12fb7f);}return _0x2391cc[_0xaac1('0x23')]();};}function saveUpdates(_0x23caf1,_0x2ff5af){return function(_0x30e121){if(_0x30e121){return _0x30e121[_0xaac1('0x24')](_0x23caf1)[_0xaac1('0x25')](function(_0x27a769){return _0x27a769;});}return null;};}function removeEntity(_0x27178b,_0x46d9a2){return function(_0x233906){if(_0x233906){return _0x233906[_0xaac1('0x26')]()[_0xaac1('0x25')](function(){_0x27178b[_0xaac1('0x1a')](0xcc)[_0xaac1('0x27')]();});}};}function handleEntityNotFound(_0x4ccde0,_0x251ffb){return function(_0x24d033){if(!_0x24d033){_0x4ccde0[_0xaac1('0x19')](0x194);}return _0x24d033;};}function handleError(_0x24d141,_0x42f342){_0x42f342=_0x42f342||0x1f4;return function(_0x52ece6){logger[_0xaac1('0x28')](_0x52ece6[_0xaac1('0x29')]);if(_0x52ece6[_0xaac1('0x2a')]){delete _0x52ece6[_0xaac1('0x2a')];}_0x24d141[_0xaac1('0x1a')](_0x42f342)['send'](_0x52ece6);};}exports[_0xaac1('0x2b')]=function(_0x4a021d,_0x1885e4){var _0xa6fdc0={},_0x1cccb8={},_0x2f3e52={'count':0x0,'rows':[]};var _0x394207=_[_0xaac1('0x2c')](db[_0xaac1('0x2d')][_0xaac1('0x2e')],function(_0x2a0f96){return{'name':_0x2a0f96['fieldName'],'type':_0x2a0f96[_0xaac1('0x2f')][_0xaac1('0x30')]};});_0x1cccb8['model']=_['map'](_0x394207,_0xaac1('0x2a'));_0x1cccb8[_0xaac1('0x31')]=_[_0xaac1('0x32')](_0x4a021d[_0xaac1('0x31')]);_0x1cccb8[_0xaac1('0x33')]=_['intersection'](_0x1cccb8[_0xaac1('0x34')],_0x1cccb8[_0xaac1('0x31')]);_0xa6fdc0['attributes']=_[_0xaac1('0x35')](_0x1cccb8[_0xaac1('0x34')],qs['fields'](_0x4a021d[_0xaac1('0x31')][_0xaac1('0x36')]));_0xa6fdc0[_0xaac1('0x37')]=_0xa6fdc0['attributes']['length']?_0xa6fdc0['attributes']:_0x1cccb8[_0xaac1('0x34')];if(!_0x4a021d[_0xaac1('0x31')][_0xaac1('0x38')](_0xaac1('0x39'))){_0xa6fdc0[_0xaac1('0x1d')]=qs[_0xaac1('0x1d')](_0x4a021d['query'][_0xaac1('0x1d')]);_0xa6fdc0[_0xaac1('0x1b')]=qs['offset'](_0x4a021d['query']['offset']);}_0xa6fdc0['order']=qs['sort'](_0x4a021d[_0xaac1('0x31')][_0xaac1('0x3a')]);_0xa6fdc0['where']=qs['filters'](_[_0xaac1('0x3b')](_0x4a021d['query'],_0x1cccb8[_0xaac1('0x33')]),_0x394207);if(_0x4a021d[_0xaac1('0x31')][_0xaac1('0x3c')]){_0xa6fdc0[_0xaac1('0x3d')]=_[_0xaac1('0x3e')](_0xa6fdc0[_0xaac1('0x3d')],{'$or':_['map'](_0x394207,function(_0x5b0656){if(_0x5b0656[_0xaac1('0x2f')]!==_0xaac1('0x3f')){var _0x869335={};_0x869335[_0x5b0656[_0xaac1('0x2a')]]={'$like':'%'+_0x4a021d['query'][_0xaac1('0x3c')]+'%'};return _0x869335;}})});}_0xa6fdc0=_[_0xaac1('0x3e')]({},_0xa6fdc0,_0x4a021d[_0xaac1('0x40')]);var _0x2bd1e4={'where':_0xa6fdc0[_0xaac1('0x3d')]};return db[_0xaac1('0x2d')][_0xaac1('0x1e')](_0x2bd1e4)[_0xaac1('0x25')](function(_0x1ba0d9){_0x2f3e52[_0xaac1('0x1e')]=_0x1ba0d9;if(_0x4a021d[_0xaac1('0x31')][_0xaac1('0x41')]){_0xa6fdc0[_0xaac1('0x42')]=[{'all':!![]}];}return db['ZohoAccount'][_0xaac1('0x43')](_0xa6fdc0);})['then'](function(_0x1b73c2){_0x2f3e52[_0xaac1('0x44')]=_0x1b73c2;return _0x2f3e52;})['then'](respondWithFilteredResult(_0x1885e4,_0xa6fdc0))['catch'](handleError(_0x1885e4,null));};exports[_0xaac1('0x45')]=function(_0x405b85,_0x2942c6){var _0x389a37={'raw':![],'where':{'id':_0x405b85['params']['id']}},_0x3e73f8={};_0x3e73f8[_0xaac1('0x34')]=_['keys'](db['ZohoAccount'][_0xaac1('0x2e')]);_0x3e73f8[_0xaac1('0x31')]=_[_0xaac1('0x32')](_0x405b85[_0xaac1('0x31')]);_0x3e73f8[_0xaac1('0x33')]=_[_0xaac1('0x35')](_0x3e73f8[_0xaac1('0x34')],_0x3e73f8[_0xaac1('0x31')]);_0x389a37[_0xaac1('0x37')]=_[_0xaac1('0x35')](_0x3e73f8[_0xaac1('0x34')],qs[_0xaac1('0x36')](_0x405b85['query'][_0xaac1('0x36')]));_0x389a37[_0xaac1('0x37')]=_0x389a37[_0xaac1('0x37')][_0xaac1('0x46')]?_0x389a37[_0xaac1('0x37')]:_0x3e73f8[_0xaac1('0x34')];if(_0x405b85[_0xaac1('0x31')]['includeAll']){_0x389a37['include']=[{'all':!![]}];}_0x389a37=_[_0xaac1('0x3e')]({},_0x389a37,_0x405b85[_0xaac1('0x40')]);return db[_0xaac1('0x2d')][_0xaac1('0x47')](_0x389a37)[_0xaac1('0x25')](handleEntityNotFound(_0x2942c6,null))[_0xaac1('0x25')](respondWithResult(_0x2942c6,null))[_0xaac1('0x48')](handleError(_0x2942c6,null));};exports['create']=function(_0x55ad3d,_0x39cf28){return db[_0xaac1('0x2d')][_0xaac1('0x49')](_0x55ad3d[_0xaac1('0x4a')],{})[_0xaac1('0x25')](respondWithResult(_0x39cf28,0xc9))[_0xaac1('0x48')](handleError(_0x39cf28,null));};exports[_0xaac1('0x24')]=function(_0x43bb9a,_0x3730bf){if(_0x43bb9a[_0xaac1('0x4a')]['id']){delete _0x43bb9a['body']['id'];}return db[_0xaac1('0x2d')]['find']({'where':{'id':_0x43bb9a[_0xaac1('0x4b')]['id']}})[_0xaac1('0x25')](handleEntityNotFound(_0x3730bf,null))['then'](saveUpdates(_0x43bb9a[_0xaac1('0x4a')],null))[_0xaac1('0x25')](respondWithResult(_0x3730bf,null))[_0xaac1('0x48')](handleError(_0x3730bf,null));};exports[_0xaac1('0x26')]=function(_0x1b2de2,_0xc8ec23){return db[_0xaac1('0x2d')][_0xaac1('0x47')]({'where':{'id':_0x1b2de2[_0xaac1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc8ec23,null))[_0xaac1('0x25')](removeEntity(_0xc8ec23,null))[_0xaac1('0x48')](handleError(_0xc8ec23,null));};exports[_0xaac1('0x4c')]=function(_0x408b0b,_0x8e193b,_0x1fe365){var _0x2e1668={};var _0x4eaa15={};var _0x3f4b44;var _0x31c039;return db[_0xaac1('0x2d')]['findOne']({'where':{'id':_0x408b0b[_0xaac1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8e193b,null))['then'](function(_0x256899){if(_0x256899){_0x3f4b44=_0x256899;_0x4eaa15['model']=_[_0xaac1('0x32')](db[_0xaac1('0x4d')][_0xaac1('0x2e')]);_0x4eaa15[_0xaac1('0x31')]=_['keys'](_0x408b0b[_0xaac1('0x31')]);_0x4eaa15['filters']=_['intersection'](_0x4eaa15[_0xaac1('0x34')],_0x4eaa15[_0xaac1('0x31')]);_0x2e1668[_0xaac1('0x37')]=_[_0xaac1('0x35')](_0x4eaa15['model'],qs[_0xaac1('0x36')](_0x408b0b[_0xaac1('0x31')]['fields']));_0x2e1668[_0xaac1('0x37')]=_0x2e1668[_0xaac1('0x37')]['length']?_0x2e1668[_0xaac1('0x37')]:_0x4eaa15[_0xaac1('0x34')];_0x2e1668[_0xaac1('0x4e')]=qs['sort'](_0x408b0b[_0xaac1('0x31')]['sort']);_0x2e1668[_0xaac1('0x3d')]=qs[_0xaac1('0x33')](_[_0xaac1('0x3b')](_0x408b0b['query'],_0x4eaa15[_0xaac1('0x33')]));if(_0x408b0b['query']['filter']){_0x2e1668[_0xaac1('0x3d')]=_[_0xaac1('0x3e')](_0x2e1668['where'],{'$or':_[_0xaac1('0x2c')](_0x2e1668[_0xaac1('0x37')],function(_0x1623f0){var _0x4a4584={};_0x4a4584[_0x1623f0]={'$like':'%'+_0x408b0b[_0xaac1('0x31')][_0xaac1('0x3c')]+'%'};return _0x4a4584;})});}_0x2e1668=_[_0xaac1('0x3e')]({},_0x2e1668,_0x408b0b[_0xaac1('0x40')]);return _0x3f4b44[_0xaac1('0x4c')](_0x2e1668);}})[_0xaac1('0x25')](function(_0x30c245){if(_0x30c245){_0x31c039=_0x30c245['length'];if(!_0x408b0b['query']['hasOwnProperty'](_0xaac1('0x39'))){_0x2e1668['limit']=qs[_0xaac1('0x1d')](_0x408b0b[_0xaac1('0x31')][_0xaac1('0x1d')]);_0x2e1668[_0xaac1('0x1b')]=qs[_0xaac1('0x1b')](_0x408b0b[_0xaac1('0x31')][_0xaac1('0x1b')]);}return _0x3f4b44[_0xaac1('0x4c')](_0x2e1668);}})[_0xaac1('0x25')](function(_0x2c8908){if(_0x2c8908){return _0x2c8908?{'count':_0x31c039,'rows':_0x2c8908}:null;}})[_0xaac1('0x25')](respondWithResult(_0x8e193b,null))[_0xaac1('0x48')](handleError(_0x8e193b,null));};exports['addConfiguration']=function(_0x4fa371,_0x1e7d0f,_0x1ea2fb){if(_0x4fa371['body']['id']){delete _0x4fa371[_0xaac1('0x4a')]['id'];}return db[_0xaac1('0x2d')][_0xaac1('0x4f')]({'where':{'id':_0x4fa371[_0xaac1('0x4b')]['id']}})[_0xaac1('0x25')](handleEntityNotFound(_0x1e7d0f,null))['then'](function(_0x3f3c6e){if(_0x3f3c6e){_0x4fa371['body'][_0xaac1('0x50')]=_0x3f3c6e['id'];_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x51')]=integrations['getSubjects'](_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x52')],_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x2f')]);_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x53')]=integrations['getDescriptions'](_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x52')],_0x4fa371[_0xaac1('0x4a')]['type']);return db[_0xaac1('0x4d')]['create'](_0x4fa371[_0xaac1('0x4a')],{'include':[{'model':db[_0xaac1('0x54')],'as':_0xaac1('0x51')},{'model':db[_0xaac1('0x54')],'as':_0xaac1('0x53')}]});}return null;})['then'](respondWithResult(_0x1e7d0f,null))['catch'](handleError(_0x1e7d0f,null));};function getAccessToken(_0x284e0f){return new Promise(function(_0x2d8160,_0x6bd4d0){var _0xfca0ec;switch(_0x284e0f[_0xaac1('0x55')]){case'US':_0xfca0ec=_0xaac1('0x56');break;case'AU':_0xfca0ec=_0xaac1('0x57');break;case'EU':_0xfca0ec=_0xaac1('0x58');break;case'IN':_0xfca0ec=_0xaac1('0x59');break;case'CN':_0xfca0ec=_0xaac1('0x5a');break;default:_0xfca0ec='https://accounts.zoho.eu';break;}var _0x30cff5={'method':'POST','uri':_0xfca0ec+_0xaac1('0x5b'),'qs':{'refresh_token':_0x284e0f['refreshToken'],'client_id':_0x284e0f[_0xaac1('0x5c')],'client_secret':_0x284e0f[_0xaac1('0x5d')],'grant_type':_0xaac1('0x5e')},'json':!![]};return rp(_0x30cff5)[_0xaac1('0x25')](function(_0x536522){if(_0x536522[_0xaac1('0x5f')]){_0x2d8160(_0x536522['access_token']);}else{_0x6bd4d0(_0xaac1('0x60'));}})['catch'](function(_0xfb5c47){_0x6bd4d0(_0xfb5c47);});});}exports[_0xaac1('0x61')]=function(_0x50c431,_0x24c059,_0x23458a){var _0x40810d,_0x13377c,_0x52182a,_0xe2e2e7,_0x28846b;return db['ZohoAccount'][_0xaac1('0x4f')]({'where':{'id':_0x50c431[_0xaac1('0x4b')]['id']},'attributes':['id',_0xaac1('0x62'),'zone','clientId',_0xaac1('0x5d'),'serverUrl','code',_0xaac1('0x63')]})[_0xaac1('0x25')](handleEntityNotFound(_0x24c059,null))['then'](function(_0x51b293){_0x28846b=_0x51b293;_0x40810d=_0x28846b['host'];_0x13377c=_0x40810d===_0xaac1('0x64')?'eu':_0xaac1('0x65');_0x52182a=_0x28846b[_0xaac1('0x66')];var _0x42311c=_0x52182a['slice'](-0x1);if(_0x42311c==='/'||_0x42311c==='\x5c'||_0x42311c===':'){_0x52182a=_0x52182a[_0xaac1('0x67')](0x0,_0x52182a[_0xaac1('0x68')](_0x42311c));}if(!_0x28846b[_0xaac1('0x63')]){throw new Error(_0xaac1('0x69'));}return getAccessToken(_0x28846b);})[_0xaac1('0x25')](function(_0x46c5ed){if(_0x46c5ed){return rp({'method':_0xaac1('0x6a'),'uri':util['format'](_0xaac1('0x6b'),_0x13377c),'qs':{'module':_0xaac1('0x6c')},'headers':{'Authorization':_0xaac1('0x6d')+_0x46c5ed},'json':!![]});}})[_0xaac1('0x25')](function(_0x445bca){if(_0x445bca){if(_0x445bca['response']&&_0x445bca[_0xaac1('0x6e')][_0xaac1('0x28')]){throw new Error(_0x445bca['response']['error'][_0xaac1('0x6f')]);}var _0x5ae58b=[];var _0x50e21f=[];var _0x43b472=[_0xaac1('0x70'),_0xaac1('0x71'),_0xaac1('0x72'),_0xaac1('0x73'),_0xaac1('0x74'),_0xaac1('0x75'),'Call_Start_Time',_0xaac1('0x76')];_0x50e21f=_[_0xaac1('0x77')](_0x445bca[_0xaac1('0x36')],function(_0x3201ca){return _0x43b472[_0xaac1('0x78')](_0x3201ca[_0xaac1('0x79')]);});for(var _0x307dfe=0x0;_0x307dfe<_0x50e21f[_0xaac1('0x46')];_0x307dfe++){if(_0x50e21f[_0x307dfe][_0xaac1('0x7a')]===![]){_0x5ae58b['push']({'id':_0x50e21f[_0x307dfe]['id'],'name':_0x50e21f[_0x307dfe][_0xaac1('0x7b')],'custom':_0x50e21f[_0x307dfe][_0xaac1('0x7c')],'options':_0x50e21f[_0x307dfe][_0xaac1('0x7d')]===_0xaac1('0x7e')&&_0x50e21f[_0x307dfe][_0xaac1('0x7f')]['length']>-0x1?_[_0xaac1('0x2c')](_0x50e21f[_0x307dfe][_0xaac1('0x7f')],function(_0x117b62){return{'name':_0x117b62,'value':_0x117b62};}):[]});}}return{'count':_0x5ae58b[_0xaac1('0x46')],'rows':_0x5ae58b};}else{return{'count':0x0,'rows':[]};}})[_0xaac1('0x25')](respondWithResult(_0x24c059,null))[_0xaac1('0x48')](function(_0xbe6c94){var _0x3ae2fa=_0x50c431[_0xaac1('0x31')][_0xaac1('0x80')]?0x1f4:_0xbe6c94[_0xaac1('0x81')]||0x1f4;logger[_0xaac1('0x28')](_0xaac1('0x82'),_0xaac1('0x61'),_0x3ae2fa,JSON[_0xaac1('0x83')](_0xbe6c94));delete _0xbe6c94['name'];if(_0x3ae2fa===0x191){_0x3ae2fa=0x190;}_0x24c059[_0xaac1('0x1a')](_0x3ae2fa)[_0xaac1('0x84')](_0x50c431[_0xaac1('0x31')][_0xaac1('0x80')]?{'message':_0xaac1('0x85'),'statusCode':_0xbe6c94[_0xaac1('0x81')]}:_0xbe6c94);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a09f2cf..69b86a0 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 _0xff39=['https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','serverUrl','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','zone','https://accounts.zoho.com','info','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au'];(function(_0x24cfb3,_0x2da737){var _0x1e2159=function(_0x5135d2){while(--_0x5135d2){_0x24cfb3['push'](_0x24cfb3['shift']());}};_0x1e2159(++_0x2da737);}(_0xff39,0x72));var _0x9ff3=function(_0x2b192e,_0x28ec8a){_0x2b192e=_0x2b192e-0x0;var _0x3478b5=_0xff39[_0x2b192e];return _0x3478b5;};'use strict';var _=require(_0x9ff3('0x0'));var util=require(_0x9ff3('0x1'));var logger=require(_0x9ff3('0x2'))('api');var moment=require(_0x9ff3('0x3'));var BPromise=require(_0x9ff3('0x4'));var rp=require(_0x9ff3('0x5'));var fs=require('fs');var path=require(_0x9ff3('0x6'));var rimraf=require(_0x9ff3('0x7'));var config=require(_0x9ff3('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x9ff3('0x9'));module[_0x9ff3('0xa')]=function(_0x4c07f9,_0x41cd89){return _0x4c07f9[_0x9ff3('0xb')](_0x9ff3('0xc'),attributes,{'tableName':_0x9ff3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x213322,_0x38bb3,_0x530675){if(_0x213322[_0x9ff3('0xe')]('zone')||_0x213322['changed']('serverUrl')||_0x213322[_0x9ff3('0xe')](_0x9ff3('0xf'))||_0x213322[_0x9ff3('0xe')]('clientSecret')||_0x213322[_0x9ff3('0xe')]('code')||_0x213322[_0x9ff3('0xe')](_0x9ff3('0x10'))){var _0x4ab1f6,_0x8088d1;_0x4ab1f6=_0x213322['serverUrl'];var _0x35f2d1=_0x4ab1f6[_0x9ff3('0x11')](-0x1);if(_0x35f2d1==='/'||_0x35f2d1==='\x5c'||_0x35f2d1===':'){_0x4ab1f6=_0x4ab1f6[_0x9ff3('0x12')](0x0,_0x4ab1f6[_0x9ff3('0x13')](_0x35f2d1));}switch(_0x213322['zone']){case'US':_0x8088d1='https://accounts.zoho.com';break;case'AU':_0x8088d1=_0x9ff3('0x14');break;case'IN':_0x8088d1=_0x9ff3('0x15');break;case'CN':_0x8088d1=_0x9ff3('0x16');break;default:_0x8088d1=_0x9ff3('0x17');break;}var _0x32b744={'method':_0x9ff3('0x18'),'uri':_0x8088d1+_0x9ff3('0x19'),'form':{'grant_type':_0x9ff3('0x1a'),'client_id':_0x213322[_0x9ff3('0xf')],'client_secret':_0x213322[_0x9ff3('0x1b')],'redirect_uri':_0x213322[_0x9ff3('0x1c')],'code':_0x213322[_0x9ff3('0x1d')]},'headers':{'Content-Type':_0x9ff3('0x1e')}};return rp(_0x32b744)[_0x9ff3('0x1f')](function(_0x5d035c){var _0x4261d4=JSON[_0x9ff3('0x20')](_0x5d035c);if(_0x4261d4[_0x9ff3('0x21')]){_0x213322[_0x9ff3('0x22')]=_0x4261d4[_0x9ff3('0x21')];logger['info'](util['format'](_0x9ff3('0x23'),_0x213322['name'],_0x213322['id']));}else{logger['error'](util[_0x9ff3('0x24')](_0x9ff3('0x25'),_0x213322[_0x9ff3('0x26')],_0x213322['id']),util[_0x9ff3('0x27')](_0x4261d4,{'showHidden':![],'depth':null}));}return _0x530675(null,_0x38bb3);})[_0x9ff3('0x28')](function(_0x18eacd){logger[_0x9ff3('0x29')](util[_0x9ff3('0x24')](_0x9ff3('0x25'),_0x213322[_0x9ff3('0x26')],_0x213322['id']),util[_0x9ff3('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x530675(_0x18eacd);});}else{return _0x530675(null,_0x38bb3);}},'beforeUpdate':function(_0x4ff44c,_0x140a85,_0x1b7b92){if(_0x4ff44c[_0x9ff3('0xe')]('zone')||_0x4ff44c[_0x9ff3('0xe')](_0x9ff3('0x1c'))||_0x4ff44c[_0x9ff3('0xe')](_0x9ff3('0xf'))||_0x4ff44c[_0x9ff3('0xe')](_0x9ff3('0x1b'))||_0x4ff44c[_0x9ff3('0xe')]('code')||_0x4ff44c[_0x9ff3('0xe')](_0x9ff3('0x10'))){var _0x3626b5,_0x75642f;_0x3626b5=_0x4ff44c[_0x9ff3('0x1c')];var _0x2e823a=_0x3626b5[_0x9ff3('0x11')](-0x1);if(_0x2e823a==='/'||_0x2e823a==='\x5c'||_0x2e823a===':'){_0x3626b5=_0x3626b5[_0x9ff3('0x12')](0x0,_0x3626b5[_0x9ff3('0x13')](_0x2e823a));}switch(_0x4ff44c[_0x9ff3('0x2a')]){case'US':_0x75642f=_0x9ff3('0x2b');break;case'AU':_0x75642f=_0x9ff3('0x14');break;case'IN':_0x75642f=_0x9ff3('0x15');break;case'CN':_0x75642f=_0x9ff3('0x16');break;default:_0x75642f='https://accounts.zoho.eu';break;}var _0x19c54d={'method':'POST','uri':_0x75642f+_0x9ff3('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x4ff44c[_0x9ff3('0xf')],'client_secret':_0x4ff44c[_0x9ff3('0x1b')],'redirect_uri':_0x4ff44c[_0x9ff3('0x1c')],'code':_0x4ff44c['code']},'headers':{'Content-Type':_0x9ff3('0x1e')}};return rp(_0x19c54d)['then'](function(_0x4d644b){var _0xd17aff=JSON['parse'](_0x4d644b);if(_0xd17aff['refresh_token']){_0x4ff44c[_0x9ff3('0x22')]=_0xd17aff['refresh_token'];logger[_0x9ff3('0x2c')](util['format'](_0x9ff3('0x23'),_0x4ff44c[_0x9ff3('0x26')],_0x4ff44c['id']));}else{logger[_0x9ff3('0x29')](util[_0x9ff3('0x24')](_0x9ff3('0x25'),_0x4ff44c[_0x9ff3('0x26')],_0x4ff44c['id']),util['inspect'](_0xd17aff,{'showHidden':![],'depth':null}));}return _0x1b7b92(null,_0x140a85);})[_0x9ff3('0x28')](function(_0x119853){logger[_0x9ff3('0x29')](util[_0x9ff3('0x24')](_0x9ff3('0x25'),_0x4ff44c[_0x9ff3('0x26')],_0x4ff44c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1b7b92(_0x119853);});}else{return _0x1b7b92(null,_0x140a85);}}}});}; \ No newline at end of file +var _0x0935=['slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','refresh_token','info','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','zone','changed','clientSecret','code','host','serverUrl'];(function(_0xc491f0,_0x216d7a){var _0xe86f2a=function(_0x4e873c){while(--_0x4e873c){_0xc491f0['push'](_0xc491f0['shift']());}};_0xe86f2a(++_0x216d7a);}(_0x0935,0x126));var _0x5093=function(_0x3266f5,_0x20b834){_0x3266f5=_0x3266f5-0x0;var _0x256b71=_0x0935[_0x3266f5];return _0x256b71;};'use strict';var _=require(_0x5093('0x0'));var util=require(_0x5093('0x1'));var logger=require(_0x5093('0x2'))(_0x5093('0x3'));var moment=require(_0x5093('0x4'));var BPromise=require(_0x5093('0x5'));var rp=require(_0x5093('0x6'));var fs=require('fs');var path=require(_0x5093('0x7'));var rimraf=require(_0x5093('0x8'));var config=require(_0x5093('0x9'));var attributes=require(_0x5093('0xa'));var integrations=require(_0x5093('0xb'));module[_0x5093('0xc')]=function(_0x39c241,_0x1db165){return _0x39c241[_0x5093('0xd')]('ZohoAccount',attributes,{'tableName':_0x5093('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f81bb,_0x2b5f79,_0x5de8bf){if(_0x1f81bb['changed'](_0x5093('0xf'))||_0x1f81bb[_0x5093('0x10')]('serverUrl')||_0x1f81bb[_0x5093('0x10')]('clientId')||_0x1f81bb[_0x5093('0x10')](_0x5093('0x11'))||_0x1f81bb[_0x5093('0x10')](_0x5093('0x12'))||_0x1f81bb[_0x5093('0x10')](_0x5093('0x13'))){var _0x20b8d3,_0x40a1b4;_0x20b8d3=_0x1f81bb[_0x5093('0x14')];var _0xae0c58=_0x20b8d3[_0x5093('0x15')](-0x1);if(_0xae0c58==='/'||_0xae0c58==='\x5c'||_0xae0c58===':'){_0x20b8d3=_0x20b8d3[_0x5093('0x16')](0x0,_0x20b8d3[_0x5093('0x17')](_0xae0c58));}switch(_0x1f81bb[_0x5093('0xf')]){case'US':_0x40a1b4=_0x5093('0x18');break;case'AU':_0x40a1b4='https://accounts.zoho.com.au';break;case'IN':_0x40a1b4=_0x5093('0x19');break;case'CN':_0x40a1b4=_0x5093('0x1a');break;default:_0x40a1b4=_0x5093('0x1b');break;}var _0x3cc94e={'method':'POST','uri':_0x40a1b4+_0x5093('0x1c'),'form':{'grant_type':_0x5093('0x1d'),'client_id':_0x1f81bb[_0x5093('0x1e')],'client_secret':_0x1f81bb['clientSecret'],'redirect_uri':_0x1f81bb[_0x5093('0x14')],'code':_0x1f81bb[_0x5093('0x12')]},'headers':{'Content-Type':_0x5093('0x1f')}};return rp(_0x3cc94e)[_0x5093('0x20')](function(_0x1ab4d6){var _0x47ac2d=JSON[_0x5093('0x21')](_0x1ab4d6);if(_0x47ac2d['refresh_token']){_0x1f81bb[_0x5093('0x22')]=_0x47ac2d['refresh_token'];logger['info'](util[_0x5093('0x23')](_0x5093('0x24'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']));}else{logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']),util[_0x5093('0x28')](_0x47ac2d,{'showHidden':![],'depth':null}));}return _0x5de8bf(null,_0x2b5f79);})[_0x5093('0x29')](function(_0x237c04){logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']),util[_0x5093('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x5de8bf(_0x237c04);});}else{return _0x5de8bf(null,_0x2b5f79);}},'beforeUpdate':function(_0x5e8ecf,_0x40630c,_0x4ffb51){if(_0x5e8ecf['changed']('zone')||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x14'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x1e'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x11'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x12'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x13'))){var _0xdaa75,_0x562386;_0xdaa75=_0x5e8ecf[_0x5093('0x14')];var _0x540e1d=_0xdaa75[_0x5093('0x15')](-0x1);if(_0x540e1d==='/'||_0x540e1d==='\x5c'||_0x540e1d===':'){_0xdaa75=_0xdaa75[_0x5093('0x16')](0x0,_0xdaa75[_0x5093('0x17')](_0x540e1d));}switch(_0x5e8ecf[_0x5093('0xf')]){case'US':_0x562386=_0x5093('0x18');break;case'AU':_0x562386=_0x5093('0x2a');break;case'IN':_0x562386='https://accounts.zoho.in';break;case'CN':_0x562386=_0x5093('0x1a');break;default:_0x562386='https://accounts.zoho.eu';break;}var _0x25c7d7={'method':'POST','uri':_0x562386+_0x5093('0x1c'),'form':{'grant_type':_0x5093('0x1d'),'client_id':_0x5e8ecf['clientId'],'client_secret':_0x5e8ecf[_0x5093('0x11')],'redirect_uri':_0x5e8ecf[_0x5093('0x14')],'code':_0x5e8ecf['code']},'headers':{'Content-Type':_0x5093('0x1f')}};return rp(_0x25c7d7)[_0x5093('0x20')](function(_0x45b4ba){var _0x3ee821=JSON[_0x5093('0x21')](_0x45b4ba);if(_0x3ee821[_0x5093('0x2b')]){_0x5e8ecf['refreshToken']=_0x3ee821[_0x5093('0x2b')];logger[_0x5093('0x2c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']));}else{logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']),util[_0x5093('0x28')](_0x3ee821,{'showHidden':![],'depth':null}));}return _0x4ffb51(null,_0x40630c);})[_0x5093('0x29')](function(_0x69b4a6){logger['error'](util[_0x5093('0x23')](_0x5093('0x27'),_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4ffb51(_0x69b4a6);});}else{return _0x4ffb51(null,_0x40630c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 346c757..820ff1c 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 _0x1f81=['jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','GetZohoAccount','find','ShowZohoAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x486efc,_0x1cca6a){var _0x42ae7e=function(_0x48f4c0){while(--_0x48f4c0){_0x486efc['push'](_0x486efc['shift']());}};_0x42ae7e(++_0x1cca6a);}(_0x1f81,0xab));var _0x11f8=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1f81[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var moment=require('moment');var BPromise=require(_0x11f8('0x2'));var rs=require(_0x11f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f8('0x4'))['db'];var utils=require(_0x11f8('0x5'));var logger=require(_0x11f8('0x6'))(_0x11f8('0x7'));var config=require(_0x11f8('0x8'));var jayson=require(_0x11f8('0x9'));var client=jayson[_0x11f8('0xa')][_0x11f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fd0cf,_0x1d899d,_0x8009d7){return new BPromise(function(_0x1cecbe,_0x1bc74d){return client[_0x11f8('0xc')](_0x4fd0cf,_0x8009d7)[_0x11f8('0xd')](function(_0x5ec20c){logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));logger[_0x11f8('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x1d899d,_0x11f8('0x10'),JSON[_0x11f8('0x12')](_0x5ec20c));if(_0x5ec20c[_0x11f8('0x13')]){if(_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x14')]===0x1f4){logger[_0x11f8('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1bc74d(_0x5ec20c[_0x11f8('0x13')]['message']);}logger[_0x11f8('0x13')](_0x11f8('0xf'),_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1cecbe(_0x5ec20c['error'][_0x11f8('0x15')]);}else{logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));_0x1cecbe(_0x5ec20c[_0x11f8('0x16')]['message']);}})[_0x11f8('0x17')](function(_0x3e7fb3){logger['error'](_0x11f8('0xf'),_0x1d899d,_0x3e7fb3);_0x1bc74d(_0x3e7fb3);});});}exports['GetZohoAccount']=function(_0x10e29e){var _0x18dfe8=this;return new Promise(function(_0x2ce80f,_0x2b5ac9){return db[_0x11f8('0x18')][_0x11f8('0x19')]({'raw':_0x10e29e[_0x11f8('0x1a')]?_0x10e29e[_0x11f8('0x1a')][_0x11f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x10e29e[_0x11f8('0x1a')]?_0x10e29e[_0x11f8('0x1a')][_0x11f8('0x1c')]||null:null,'attributes':_0x10e29e[_0x11f8('0x1a')]?_0x10e29e[_0x11f8('0x1a')][_0x11f8('0x1d')]||null:null,'limit':_0x10e29e['options']?_0x10e29e['options']['limit']||null:null,'include':_0x10e29e[_0x11f8('0x1a')]?_0x10e29e[_0x11f8('0x1a')][_0x11f8('0x1e')]?_[_0x11f8('0x1f')](_0x10e29e['options'][_0x11f8('0x1e')],function(_0x3e994d){return{'model':db[_0x3e994d['model']],'as':_0x3e994d['as'],'attributes':_0x3e994d[_0x11f8('0x1d')],'include':_0x3e994d[_0x11f8('0x1e')]?_[_0x11f8('0x1f')](_0x3e994d[_0x11f8('0x1e')],function(_0x45d8d4){return{'model':db[_0x45d8d4[_0x11f8('0x20')]],'as':_0x45d8d4['as'],'attributes':_0x45d8d4[_0x11f8('0x1d')],'include':_0x45d8d4['include']?_[_0x11f8('0x1f')](_0x45d8d4['include'],function(_0x3a4c58){return{'model':db[_0x3a4c58[_0x11f8('0x20')]],'as':_0x3a4c58['as'],'attributes':_0x3a4c58[_0x11f8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x107bc7){logger[_0x11f8('0xe')](_0x11f8('0x21'),_0x10e29e);logger[_0x11f8('0x11')]('GetZohoAccount',_0x10e29e,JSON[_0x11f8('0x12')](_0x107bc7));_0x2ce80f(_0x107bc7);})['catch'](function(_0x35ba83){logger[_0x11f8('0x13')](_0x11f8('0x21'),_0x35ba83['message'],_0x10e29e);_0x2b5ac9(_0x18dfe8['error'](0x1f4,_0x35ba83[_0x11f8('0x15')]));});});};exports['ShowZohoAccount']=function(_0x292317){var _0x48a7ad=this;return new Promise(function(_0x54077c,_0xbd9358){return db['ZohoAccount'][_0x11f8('0x22')]({'raw':_0x292317[_0x11f8('0x1a')]?_0x292317['options'][_0x11f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x292317['options']?_0x292317[_0x11f8('0x1a')]['where']||null:null,'attributes':_0x292317['options']?_0x292317['options'][_0x11f8('0x1d')]||null:null,'include':_0x292317['options']?_0x292317['options'][_0x11f8('0x1e')]?_[_0x11f8('0x1f')](_0x292317[_0x11f8('0x1a')][_0x11f8('0x1e')],function(_0x5cfb6d){return{'model':db[_0x5cfb6d['model']],'as':_0x5cfb6d['as'],'attributes':_0x5cfb6d['attributes'],'include':_0x5cfb6d['include']?_[_0x11f8('0x1f')](_0x5cfb6d[_0x11f8('0x1e')],function(_0x176be5){return{'model':db[_0x176be5[_0x11f8('0x20')]],'as':_0x176be5['as'],'attributes':_0x176be5['attributes'],'include':_0x176be5[_0x11f8('0x1e')]?_[_0x11f8('0x1f')](_0x176be5[_0x11f8('0x1e')],function(_0x40cfd7){return{'model':db[_0x40cfd7[_0x11f8('0x20')]],'as':_0x40cfd7['as'],'attributes':_0x40cfd7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd09c7c){logger[_0x11f8('0xe')](_0x11f8('0x23'),_0x292317);logger[_0x11f8('0x11')]('ShowZohoAccount',_0x292317,JSON['stringify'](_0xd09c7c));_0x54077c(_0xd09c7c);})['catch'](function(_0x51a6bf){logger['error'](_0x11f8('0x23'),_0x51a6bf[_0x11f8('0x15')],_0x292317);_0xbd9358(_0x48a7ad[_0x11f8('0x13')](0x1f4,_0x51a6bf[_0x11f8('0x15')]));});});}; \ No newline at end of file +var _0x0c19=['message','request\x20sent','catch','GetZohoAccount','ZohoAccount','options','raw','where','map','attributes','include','model','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2084c6,_0x34b23f){var _0x343ebb=function(_0x5494ad){while(--_0x5494ad){_0x2084c6['push'](_0x2084c6['shift']());}};_0x343ebb(++_0x34b23f);}(_0x0c19,0xf5));var _0x90c1=function(_0x3f0cf2,_0x20d943){_0x3f0cf2=_0x3f0cf2-0x0;var _0x5673b5=_0x0c19[_0x3f0cf2];return _0x5673b5;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var moment=require(_0x90c1('0x2'));var BPromise=require(_0x90c1('0x3'));var rs=require(_0x90c1('0x4'));var fs=require('fs');var Redis=require(_0x90c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x90c1('0x6'));var logger=require(_0x90c1('0x7'))(_0x90c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x90c1('0x9'));var client=jayson[_0x90c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440f7a,_0x954ac4,_0x37d247){return new BPromise(function(_0x2ed328,_0x351d07){return client[_0x90c1('0xb')](_0x440f7a,_0x37d247)[_0x90c1('0xc')](function(_0x4895b5){logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,'request\x20sent');logger[_0x90c1('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x954ac4,'request\x20sent',JSON[_0x90c1('0x10')](_0x4895b5));if(_0x4895b5['error']){if(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x12')]===0x1f4){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error']['message']);return _0x351d07(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error'][_0x90c1('0x13')]);return _0x2ed328(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}else{logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,_0x90c1('0x14'));_0x2ed328(_0x4895b5['result'][_0x90c1('0x13')]);}})[_0x90c1('0x15')](function(_0x45a64c){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x45a64c);_0x351d07(_0x45a64c);});});}exports[_0x90c1('0x16')]=function(_0x3b6671){var _0x2960f2=this;return new Promise(function(_0x372949,_0x112aa4){return db[_0x90c1('0x17')]['findAll']({'raw':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x3b6671['options']?_0x3b6671[_0x90c1('0x18')]['attributes']||null:null,'limit':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['limit']||null:null,'include':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['include']?_[_0x90c1('0x1b')](_0x3b6671['options']['include'],function(_0x36fe37){return{'model':db[_0x36fe37['model']],'as':_0x36fe37['as'],'attributes':_0x36fe37[_0x90c1('0x1c')],'include':_0x36fe37['include']?_[_0x90c1('0x1b')](_0x36fe37[_0x90c1('0x1d')],function(_0x309f83){return{'model':db[_0x309f83[_0x90c1('0x1e')]],'as':_0x309f83['as'],'attributes':_0x309f83[_0x90c1('0x1c')],'include':_0x309f83[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x309f83['include'],function(_0x26ee39){return{'model':db[_0x26ee39[_0x90c1('0x1e')]],'as':_0x26ee39['as'],'attributes':_0x26ee39[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x3c3a20){logger[_0x90c1('0xd')](_0x90c1('0x16'),_0x3b6671);logger[_0x90c1('0xf')](_0x90c1('0x16'),_0x3b6671,JSON[_0x90c1('0x10')](_0x3c3a20));_0x372949(_0x3c3a20);})[_0x90c1('0x15')](function(_0x2f85dc){logger[_0x90c1('0x11')](_0x90c1('0x16'),_0x2f85dc[_0x90c1('0x13')],_0x3b6671);_0x112aa4(_0x2960f2['error'](0x1f4,_0x2f85dc[_0x90c1('0x13')]));});});};exports[_0x90c1('0x1f')]=function(_0x40c2f1){var _0x5be73c=this;return new Promise(function(_0x305e68,_0x578316){return db[_0x90c1('0x17')][_0x90c1('0x20')]({'raw':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x40c2f1['options']?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1['options'][_0x90c1('0x1c')]||null:null,'include':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')],function(_0x36e431){return{'model':db[_0x36e431[_0x90c1('0x1e')]],'as':_0x36e431['as'],'attributes':_0x36e431[_0x90c1('0x1c')],'include':_0x36e431[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x36e431[_0x90c1('0x1d')],function(_0x3a130f){return{'model':db[_0x3a130f['model']],'as':_0x3a130f['as'],'attributes':_0x3a130f[_0x90c1('0x1c')],'include':_0x3a130f[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x3a130f[_0x90c1('0x1d')],function(_0x5c62a4){return{'model':db[_0x5c62a4['model']],'as':_0x5c62a4['as'],'attributes':_0x5c62a4[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x1aa105){logger[_0x90c1('0xd')]('ShowZohoAccount',_0x40c2f1);logger['debug'](_0x90c1('0x1f'),_0x40c2f1,JSON[_0x90c1('0x10')](_0x1aa105));_0x305e68(_0x1aa105);})[_0x90c1('0x15')](function(_0x23bb5a){logger[_0x90c1('0x11')]('ShowZohoAccount',_0x23bb5a['message'],_0x40c2f1);_0x578316(_0x5be73c['error'](0x1f4,_0x23bb5a[_0x90c1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 57b6f11..2015c0a 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 _0xb769=['index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get'];(function(_0x4b8441,_0x32a2fd){var _0x58359d=function(_0x297d96){while(--_0x297d96){_0x4b8441['push'](_0x4b8441['shift']());}};_0x58359d(++_0x32a2fd);}(_0xb769,0x12f));var _0x9b76=function(_0x5aa226,_0x3e3d04){_0x5aa226=_0x5aa226-0x0;var _0x5ca24a=_0xb769[_0x5aa226];return _0x5ca24a;};'use strict';var multer=require(_0x9b76('0x0'));var util=require('util');var path=require(_0x9b76('0x1'));var timeout=require('connect-timeout');var express=require(_0x9b76('0x2'));var router=express[_0x9b76('0x3')]();var fs_extra=require(_0x9b76('0x4'));var auth=require(_0x9b76('0x5'));var interaction=require(_0x9b76('0x6'));var config=require('../../config/environment');var controller=require(_0x9b76('0x7'));router[_0x9b76('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b76('0x9')]);router[_0x9b76('0x8')](_0x9b76('0xa'),auth[_0x9b76('0xb')](),controller[_0x9b76('0xc')]);router[_0x9b76('0x8')](_0x9b76('0xd'),auth[_0x9b76('0xb')](),controller[_0x9b76('0xe')]);router[_0x9b76('0x8')](_0x9b76('0xf'),auth[_0x9b76('0xb')](),controller[_0x9b76('0x10')]);router[_0x9b76('0x8')](_0x9b76('0x11'),auth[_0x9b76('0xb')](),controller[_0x9b76('0x12')]);router[_0x9b76('0x13')]('/',auth[_0x9b76('0xb')](),controller[_0x9b76('0x14')]);router[_0x9b76('0x15')]('/:id',auth[_0x9b76('0xb')](),controller[_0x9b76('0x16')]);router[_0x9b76('0x17')](_0x9b76('0xa'),auth[_0x9b76('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3a83=['/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','show'];(function(_0x334db2,_0x4d9f0f){var _0x513d3e=function(_0x419c31){while(--_0x419c31){_0x334db2['push'](_0x334db2['shift']());}};_0x513d3e(++_0x4d9f0f);}(_0x3a83,0x16a));var _0x33a8=function(_0x411567,_0x15240e){_0x411567=_0x411567-0x0;var _0x20ac5c=_0x3a83[_0x411567];return _0x20ac5c;};'use strict';var multer=require('multer');var util=require(_0x33a8('0x0'));var path=require(_0x33a8('0x1'));var timeout=require(_0x33a8('0x2'));var express=require(_0x33a8('0x3'));var router=express[_0x33a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x33a8('0x5'));var interaction=require(_0x33a8('0x6'));var config=require(_0x33a8('0x7'));var controller=require(_0x33a8('0x8'));router[_0x33a8('0x9')]('/',auth['isAuthenticated'](),controller[_0x33a8('0xa')]);router['get'](_0x33a8('0xb'),auth['isAuthenticated'](),controller[_0x33a8('0xc')]);router[_0x33a8('0x9')](_0x33a8('0xd'),auth[_0x33a8('0xe')](),controller[_0x33a8('0xf')]);router[_0x33a8('0x9')](_0x33a8('0x10'),auth[_0x33a8('0xe')](),controller[_0x33a8('0x11')]);router[_0x33a8('0x9')](_0x33a8('0x12'),auth[_0x33a8('0xe')](),controller['getDescriptions']);router[_0x33a8('0x13')]('/',auth[_0x33a8('0xe')](),controller[_0x33a8('0x14')]);router[_0x33a8('0x15')](_0x33a8('0xb'),auth['isAuthenticated'](),controller[_0x33a8('0x16')]);router[_0x33a8('0x17')](_0x33a8('0xb'),auth[_0x33a8('0xe')](),controller[_0x33a8('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index e54e3b6..dad12cc 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 _0x15ec=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0xac575a,_0x6aa399){var _0x41dd64=function(_0x734d27){while(--_0x734d27){_0xac575a['push'](_0xac575a['shift']());}};_0x41dd64(++_0x6aa399);}(_0x15ec,0x6f));var _0xc15e=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x15ec[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xc15e('0x0'));module[_0xc15e('0x1')]={'name':{'type':Sequelize[_0xc15e('0x2')]},'moduleCreate':{'type':Sequelize[_0xc15e('0x3')](_0xc15e('0x4'),_0xc15e('0x5'),_0xc15e('0x6')),'defaultValue':_0xc15e('0x4')},'moduleSearch':{'type':Sequelize[_0xc15e('0x3')](_0xc15e('0x7'),_0xc15e('0x5'),_0xc15e('0x4')),'defaultValue':_0xc15e('0x7')},'description':{'type':Sequelize[_0xc15e('0x2')]}}; \ No newline at end of file +var _0xb1f6=['ENUM','lead','contact_lead','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb1f6,0x14d));var _0x6b1f=function(_0x3771c7,_0x6673b8){_0x3771c7=_0x3771c7-0x0;var _0x5e7bb0=_0xb1f6[_0x3771c7];return _0x5e7bb0;};'use strict';var Sequelize=require('sequelize');module[_0x6b1f('0x0')]={'name':{'type':Sequelize[_0x6b1f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x6b1f('0x2')]('contact_lead','contact',_0x6b1f('0x3')),'defaultValue':_0x6b1f('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6fb3f4f..cf25c4e 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 _0x8aa1=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','keys','include','create','body','update','find','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x56b2cf,_0x3f2aac){var _0xc7ed7f=function(_0x5cc384){while(--_0x5cc384){_0x56b2cf['push'](_0x56b2cf['shift']());}};_0xc7ed7f(++_0x3f2aac);}(_0x8aa1,0x1e2));var _0x18aa=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x8aa1[_0x21cb7f];return _0x5a079a;};'use strict';var emlformat=require(_0x18aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18aa('0x1'));var jsonpatch=require(_0x18aa('0x2'));var rp=require(_0x18aa('0x3'));var moment=require(_0x18aa('0x4'));var BPromise=require(_0x18aa('0x5'));var Mustache=require(_0x18aa('0x6'));var util=require(_0x18aa('0x7'));var path=require(_0x18aa('0x8'));var sox=require(_0x18aa('0x9'));var csv=require(_0x18aa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18aa('0xb'));var _=require(_0x18aa('0xc'));var squel=require('squel');var crypto=require(_0x18aa('0xd'));var jsforce=require(_0x18aa('0xe'));var deskjs=require(_0x18aa('0xf'));var toCsv=require(_0x18aa('0xa'));var querystring=require(_0x18aa('0x10'));var Papa=require(_0x18aa('0x11'));var Redis=require(_0x18aa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x18aa('0x13'));var as=require(_0x18aa('0x14'));var hardwareService=require(_0x18aa('0x15'));var logger=require('../../config/logger')(_0x18aa('0x16'));var utils=require('../../config/utils');var config=require(_0x18aa('0x17'));var licenseUtil=require(_0x18aa('0x18'));var db=require(_0x18aa('0x19'))['db'];function respondWithStatusCode(_0x2ae9d7,_0x228bfe){_0x228bfe=_0x228bfe||0xcc;return function(_0x5ca900){if(_0x5ca900){return _0x2ae9d7['sendStatus'](_0x228bfe);}return _0x2ae9d7[_0x18aa('0x1a')](_0x228bfe)[_0x18aa('0x1b')]();};}function respondWithResult(_0xe5ea4c,_0x229ff0){_0x229ff0=_0x229ff0||0xc8;return function(_0x4c40d9){if(_0x4c40d9){return _0xe5ea4c['status'](_0x229ff0)[_0x18aa('0x1c')](_0x4c40d9);}};}function respondWithFilteredResult(_0x5a1f77,_0x22b3f2){return function(_0x5c9113){if(_0x5c9113){var _0x3da3b1=typeof _0x22b3f2[_0x18aa('0x1d')]===_0x18aa('0x1e')&&typeof _0x22b3f2[_0x18aa('0x1f')]===_0x18aa('0x1e');var _0x5a8476=_0x5c9113[_0x18aa('0x20')];var _0x50f655=_0x3da3b1?0x0:_0x22b3f2[_0x18aa('0x1d')];var _0x353aea=_0x3da3b1?_0x5c9113['count']:_0x22b3f2[_0x18aa('0x1d')]+_0x22b3f2['limit'];var _0x50fb48;if(_0x353aea>=_0x5a8476){_0x353aea=_0x5a8476;_0x50fb48=0xc8;}else{_0x50fb48=0xce;}_0x5a1f77[_0x18aa('0x1a')](_0x50fb48);return _0x5a1f77[_0x18aa('0x21')](_0x18aa('0x22'),_0x50f655+'-'+_0x353aea+'/'+_0x5a8476)[_0x18aa('0x1c')](_0x5c9113);}return null;};}function patchUpdates(_0x414fde){return function(_0x32f0b2){try{jsonpatch['apply'](_0x32f0b2,_0x414fde,!![]);}catch(_0x1e1ecb){return BPromise[_0x18aa('0x23')](_0x1e1ecb);}return _0x32f0b2[_0x18aa('0x24')]();};}function saveUpdates(_0x2de23c,_0x13647a){return function(_0x444c4f){if(_0x444c4f){return _0x444c4f['update'](_0x2de23c)[_0x18aa('0x25')](function(_0x218bf9){return _0x218bf9;});}return null;};}function removeEntity(_0x40a4d6,_0x4f9eef){return function(_0x2685e0){if(_0x2685e0){return _0x2685e0[_0x18aa('0x26')]()[_0x18aa('0x25')](function(){_0x40a4d6['status'](0xcc)[_0x18aa('0x1b')]();});}};}function handleEntityNotFound(_0x2ef4ae,_0xa86413){return function(_0x4a1dfb){if(!_0x4a1dfb){_0x2ef4ae[_0x18aa('0x27')](0x194);}return _0x4a1dfb;};}function handleError(_0x109ae3,_0x51249b){_0x51249b=_0x51249b||0x1f4;return function(_0x305548){logger[_0x18aa('0x28')](_0x305548['stack']);if(_0x305548[_0x18aa('0x29')]){delete _0x305548[_0x18aa('0x29')];}_0x109ae3[_0x18aa('0x1a')](_0x51249b)['send'](_0x305548);};}exports[_0x18aa('0x2a')]=function(_0x2c975b,_0x2c50a3){var _0x572460={},_0x2213d9={},_0xb1e7aa={'count':0x0,'rows':[]};var _0x450ab2=_[_0x18aa('0x2b')](db[_0x18aa('0x2c')][_0x18aa('0x2d')],function(_0x1009be){return{'name':_0x1009be[_0x18aa('0x2e')],'type':_0x1009be[_0x18aa('0x2f')][_0x18aa('0x30')]};});_0x2213d9['model']=_[_0x18aa('0x2b')](_0x450ab2,_0x18aa('0x29'));_0x2213d9[_0x18aa('0x31')]=_['keys'](_0x2c975b[_0x18aa('0x31')]);_0x2213d9[_0x18aa('0x32')]=_[_0x18aa('0x33')](_0x2213d9['model'],_0x2213d9['query']);_0x572460[_0x18aa('0x34')]=_[_0x18aa('0x33')](_0x2213d9['model'],qs[_0x18aa('0x35')](_0x2c975b[_0x18aa('0x31')][_0x18aa('0x35')]));_0x572460['attributes']=_0x572460[_0x18aa('0x34')][_0x18aa('0x36')]?_0x572460[_0x18aa('0x34')]:_0x2213d9[_0x18aa('0x37')];if(!_0x2c975b[_0x18aa('0x31')][_0x18aa('0x38')](_0x18aa('0x39'))){_0x572460[_0x18aa('0x1f')]=qs[_0x18aa('0x1f')](_0x2c975b['query'][_0x18aa('0x1f')]);_0x572460['offset']=qs[_0x18aa('0x1d')](_0x2c975b[_0x18aa('0x31')][_0x18aa('0x1d')]);}_0x572460[_0x18aa('0x3a')]=qs[_0x18aa('0x3b')](_0x2c975b['query'][_0x18aa('0x3b')]);_0x572460['where']=qs[_0x18aa('0x32')](_[_0x18aa('0x3c')](_0x2c975b[_0x18aa('0x31')],_0x2213d9[_0x18aa('0x32')]),_0x450ab2);if(_0x2c975b[_0x18aa('0x31')][_0x18aa('0x3d')]){_0x572460['where']=_[_0x18aa('0x3e')](_0x572460[_0x18aa('0x3f')],{'$or':_[_0x18aa('0x2b')](_0x450ab2,function(_0x2764c7){if(_0x2764c7[_0x18aa('0x2f')]!==_0x18aa('0x40')){var _0x21555c={};_0x21555c[_0x2764c7['name']]={'$like':'%'+_0x2c975b['query'][_0x18aa('0x3d')]+'%'};return _0x21555c;}})});}_0x572460=_['merge']({},_0x572460,_0x2c975b[_0x18aa('0x41')]);var _0x353384={'where':_0x572460[_0x18aa('0x3f')]};return db[_0x18aa('0x2c')]['count'](_0x353384)[_0x18aa('0x25')](function(_0x1e265a){_0xb1e7aa[_0x18aa('0x20')]=_0x1e265a;if(_0x2c975b['query'][_0x18aa('0x42')]){_0x572460['include']=[{'all':!![]}];}return db[_0x18aa('0x2c')]['findAll'](_0x572460);})[_0x18aa('0x25')](function(_0x292192){_0xb1e7aa[_0x18aa('0x43')]=_0x292192;return _0xb1e7aa;})[_0x18aa('0x25')](respondWithFilteredResult(_0x2c50a3,_0x572460))[_0x18aa('0x44')](handleError(_0x2c50a3,null));};exports[_0x18aa('0x45')]=function(_0x513230,_0x4b2412){var _0x384a30={'raw':![],'where':{'id':_0x513230['params']['id']}},_0x314c60={};_0x314c60[_0x18aa('0x37')]=_['keys'](db[_0x18aa('0x2c')][_0x18aa('0x2d')]);_0x314c60[_0x18aa('0x31')]=_[_0x18aa('0x46')](_0x513230[_0x18aa('0x31')]);_0x314c60[_0x18aa('0x32')]=_[_0x18aa('0x33')](_0x314c60[_0x18aa('0x37')],_0x314c60['query']);_0x384a30[_0x18aa('0x34')]=_[_0x18aa('0x33')](_0x314c60['model'],qs[_0x18aa('0x35')](_0x513230[_0x18aa('0x31')][_0x18aa('0x35')]));_0x384a30['attributes']=_0x384a30['attributes'][_0x18aa('0x36')]?_0x384a30['attributes']:_0x314c60[_0x18aa('0x37')];if(_0x513230[_0x18aa('0x31')][_0x18aa('0x42')]){_0x384a30[_0x18aa('0x47')]=[{'all':!![]}];}_0x384a30=_[_0x18aa('0x3e')]({},_0x384a30,_0x513230[_0x18aa('0x41')]);return db[_0x18aa('0x2c')]['find'](_0x384a30)[_0x18aa('0x25')](handleEntityNotFound(_0x4b2412,null))['then'](respondWithResult(_0x4b2412,null))[_0x18aa('0x44')](handleError(_0x4b2412,null));};exports[_0x18aa('0x48')]=function(_0x1c8521,_0x4a340e){return db[_0x18aa('0x2c')][_0x18aa('0x48')](_0x1c8521[_0x18aa('0x49')],{})[_0x18aa('0x25')](respondWithResult(_0x4a340e,0xc9))[_0x18aa('0x44')](handleError(_0x4a340e,null));};exports[_0x18aa('0x4a')]=function(_0x77ac50,_0x3258f9){if(_0x77ac50[_0x18aa('0x49')]['id']){delete _0x77ac50[_0x18aa('0x49')]['id'];}return db[_0x18aa('0x2c')][_0x18aa('0x4b')]({'where':{'id':_0x77ac50[_0x18aa('0x4c')]['id']}})[_0x18aa('0x25')](handleEntityNotFound(_0x3258f9,null))[_0x18aa('0x25')](saveUpdates(_0x77ac50[_0x18aa('0x49')],null))[_0x18aa('0x25')](respondWithResult(_0x3258f9,null))['catch'](handleError(_0x3258f9,null));};exports['destroy']=function(_0x584cc1,_0x36c3c3){return db[_0x18aa('0x2c')][_0x18aa('0x4b')]({'where':{'id':_0x584cc1[_0x18aa('0x4c')]['id']}})[_0x18aa('0x25')](handleEntityNotFound(_0x36c3c3,null))[_0x18aa('0x25')](removeEntity(_0x36c3c3,null))[_0x18aa('0x44')](handleError(_0x36c3c3,null));};exports[_0x18aa('0x4d')]=function(_0x140a3a,_0x1d04ac,_0x163066){var _0x2e5c2f={};var _0x42daf2={};var _0x477712;var _0x109ce7;return db[_0x18aa('0x2c')][_0x18aa('0x4e')]({'where':{'id':_0x140a3a[_0x18aa('0x4c')]['id']}})[_0x18aa('0x25')](handleEntityNotFound(_0x1d04ac,null))['then'](function(_0x145ba6){if(_0x145ba6){_0x477712=_0x145ba6;_0x42daf2[_0x18aa('0x37')]=_[_0x18aa('0x46')](db[_0x18aa('0x4f')]['rawAttributes']);_0x42daf2[_0x18aa('0x31')]=_[_0x18aa('0x46')](_0x140a3a[_0x18aa('0x31')]);_0x42daf2[_0x18aa('0x32')]=_['intersection'](_0x42daf2[_0x18aa('0x37')],_0x42daf2['query']);_0x2e5c2f[_0x18aa('0x34')]=_[_0x18aa('0x33')](_0x42daf2['model'],qs[_0x18aa('0x35')](_0x140a3a[_0x18aa('0x31')]['fields']));_0x2e5c2f[_0x18aa('0x34')]=_0x2e5c2f[_0x18aa('0x34')]['length']?_0x2e5c2f[_0x18aa('0x34')]:_0x42daf2[_0x18aa('0x37')];_0x2e5c2f['order']=qs[_0x18aa('0x3b')](_0x140a3a['query'][_0x18aa('0x3b')]);_0x2e5c2f[_0x18aa('0x3f')]=qs[_0x18aa('0x32')](_[_0x18aa('0x3c')](_0x140a3a[_0x18aa('0x31')],_0x42daf2[_0x18aa('0x32')]));if(_0x140a3a[_0x18aa('0x31')][_0x18aa('0x3d')]){_0x2e5c2f['where']=_[_0x18aa('0x3e')](_0x2e5c2f[_0x18aa('0x3f')],{'$or':_[_0x18aa('0x2b')](_0x2e5c2f[_0x18aa('0x34')],function(_0x439a47){var _0x13f950={};_0x13f950[_0x439a47]={'$like':'%'+_0x140a3a['query']['filter']+'%'};return _0x13f950;})});}_0x2e5c2f=_[_0x18aa('0x3e')]({},_0x2e5c2f,_0x140a3a[_0x18aa('0x41')]);return _0x477712['getFields'](_0x2e5c2f);}})[_0x18aa('0x25')](function(_0x3fe447){if(_0x3fe447){_0x109ce7=_0x3fe447[_0x18aa('0x36')];if(!_0x140a3a[_0x18aa('0x31')][_0x18aa('0x38')](_0x18aa('0x39'))){_0x2e5c2f[_0x18aa('0x1f')]=qs[_0x18aa('0x1f')](_0x140a3a[_0x18aa('0x31')][_0x18aa('0x1f')]);_0x2e5c2f['offset']=qs['offset'](_0x140a3a[_0x18aa('0x31')][_0x18aa('0x1d')]);}return _0x477712[_0x18aa('0x4d')](_0x2e5c2f);}})[_0x18aa('0x25')](function(_0x5492fc){if(_0x5492fc){return _0x5492fc?{'count':_0x109ce7,'rows':_0x5492fc}:null;}})[_0x18aa('0x25')](respondWithResult(_0x1d04ac,null))[_0x18aa('0x44')](handleError(_0x1d04ac,null));};exports['getSubjects']=function(_0x2d914f,_0x2b5fa9,_0x5dfec3){var _0x7f28bc={};var _0x25eeed={};var _0x25938d;var _0x5395de;return db[_0x18aa('0x2c')][_0x18aa('0x4e')]({'where':{'id':_0x2d914f[_0x18aa('0x4c')]['id']}})[_0x18aa('0x25')](handleEntityNotFound(_0x2b5fa9,null))[_0x18aa('0x25')](function(_0x1f66b2){if(_0x1f66b2){_0x25938d=_0x1f66b2;_0x25eeed[_0x18aa('0x37')]=_['keys'](db[_0x18aa('0x4f')][_0x18aa('0x2d')]);_0x25eeed['query']=_[_0x18aa('0x46')](_0x2d914f[_0x18aa('0x31')]);_0x25eeed['filters']=_[_0x18aa('0x33')](_0x25eeed[_0x18aa('0x37')],_0x25eeed[_0x18aa('0x31')]);_0x7f28bc['attributes']=_[_0x18aa('0x33')](_0x25eeed['model'],qs[_0x18aa('0x35')](_0x2d914f['query']['fields']));_0x7f28bc['attributes']=_0x7f28bc['attributes'][_0x18aa('0x36')]?_0x7f28bc['attributes']:_0x25eeed[_0x18aa('0x37')];_0x7f28bc[_0x18aa('0x3a')]=qs[_0x18aa('0x3b')](_0x2d914f[_0x18aa('0x31')]['sort']);_0x7f28bc['where']=qs['filters'](_[_0x18aa('0x3c')](_0x2d914f['query'],_0x25eeed['filters']));if(_0x2d914f[_0x18aa('0x31')]['filter']){_0x7f28bc[_0x18aa('0x3f')]=_[_0x18aa('0x3e')](_0x7f28bc[_0x18aa('0x3f')],{'$or':_['map'](_0x7f28bc[_0x18aa('0x34')],function(_0x577f0f){var _0x41f1ad={};_0x41f1ad[_0x577f0f]={'$like':'%'+_0x2d914f[_0x18aa('0x31')][_0x18aa('0x3d')]+'%'};return _0x41f1ad;})});}_0x7f28bc=_[_0x18aa('0x3e')]({},_0x7f28bc,_0x2d914f['options']);return _0x25938d[_0x18aa('0x50')](_0x7f28bc);}})[_0x18aa('0x25')](function(_0x4ae414){if(_0x4ae414){_0x5395de=_0x4ae414[_0x18aa('0x36')];if(!_0x2d914f[_0x18aa('0x31')][_0x18aa('0x38')](_0x18aa('0x39'))){_0x7f28bc[_0x18aa('0x1f')]=qs[_0x18aa('0x1f')](_0x2d914f[_0x18aa('0x31')][_0x18aa('0x1f')]);_0x7f28bc['offset']=qs[_0x18aa('0x1d')](_0x2d914f[_0x18aa('0x31')][_0x18aa('0x1d')]);}return _0x25938d[_0x18aa('0x50')](_0x7f28bc);}})[_0x18aa('0x25')](function(_0x346e3e){if(_0x346e3e){return _0x346e3e?{'count':_0x5395de,'rows':_0x346e3e}:null;}})[_0x18aa('0x25')](respondWithResult(_0x2b5fa9,null))[_0x18aa('0x44')](handleError(_0x2b5fa9,null));};exports[_0x18aa('0x51')]=function(_0x1fc098,_0x1c5e04,_0x551a19){var _0x3a22b3={};var _0x5a3716={};var _0xd8e433;var _0x59dde3;return db[_0x18aa('0x2c')][_0x18aa('0x4e')]({'where':{'id':_0x1fc098[_0x18aa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c5e04,null))[_0x18aa('0x25')](function(_0x4c27f3){if(_0x4c27f3){_0xd8e433=_0x4c27f3;_0x5a3716[_0x18aa('0x37')]=_[_0x18aa('0x46')](db[_0x18aa('0x4f')][_0x18aa('0x2d')]);_0x5a3716[_0x18aa('0x31')]=_[_0x18aa('0x46')](_0x1fc098['query']);_0x5a3716[_0x18aa('0x32')]=_[_0x18aa('0x33')](_0x5a3716[_0x18aa('0x37')],_0x5a3716[_0x18aa('0x31')]);_0x3a22b3[_0x18aa('0x34')]=_[_0x18aa('0x33')](_0x5a3716['model'],qs[_0x18aa('0x35')](_0x1fc098[_0x18aa('0x31')][_0x18aa('0x35')]));_0x3a22b3[_0x18aa('0x34')]=_0x3a22b3[_0x18aa('0x34')]['length']?_0x3a22b3['attributes']:_0x5a3716[_0x18aa('0x37')];_0x3a22b3[_0x18aa('0x3a')]=qs['sort'](_0x1fc098[_0x18aa('0x31')][_0x18aa('0x3b')]);_0x3a22b3[_0x18aa('0x3f')]=qs['filters'](_[_0x18aa('0x3c')](_0x1fc098[_0x18aa('0x31')],_0x5a3716[_0x18aa('0x32')]));if(_0x1fc098[_0x18aa('0x31')][_0x18aa('0x3d')]){_0x3a22b3[_0x18aa('0x3f')]=_[_0x18aa('0x3e')](_0x3a22b3['where'],{'$or':_['map'](_0x3a22b3[_0x18aa('0x34')],function(_0xe61a85){var _0x2e192a={};_0x2e192a[_0xe61a85]={'$like':'%'+_0x1fc098[_0x18aa('0x31')][_0x18aa('0x3d')]+'%'};return _0x2e192a;})});}_0x3a22b3=_[_0x18aa('0x3e')]({},_0x3a22b3,_0x1fc098['options']);return _0xd8e433[_0x18aa('0x51')](_0x3a22b3);}})[_0x18aa('0x25')](function(_0x3985fe){if(_0x3985fe){_0x59dde3=_0x3985fe[_0x18aa('0x36')];if(!_0x1fc098[_0x18aa('0x31')]['hasOwnProperty']('nolimit')){_0x3a22b3[_0x18aa('0x1f')]=qs['limit'](_0x1fc098[_0x18aa('0x31')][_0x18aa('0x1f')]);_0x3a22b3['offset']=qs[_0x18aa('0x1d')](_0x1fc098[_0x18aa('0x31')][_0x18aa('0x1d')]);}return _0xd8e433['getDescriptions'](_0x3a22b3);}})['then'](function(_0x15daae){if(_0x15daae){return _0x15daae?{'count':_0x59dde3,'rows':_0x15daae}:null;}})[_0x18aa('0x25')](respondWithResult(_0x1c5e04,null))[_0x18aa('0x44')](handleError(_0x1c5e04,null));}; \ No newline at end of file +var _0xd555=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3f91f8,_0x3ac21d){var _0x31a568=function(_0xd3da14){while(--_0xd3da14){_0x3f91f8['push'](_0x3f91f8['shift']());}};_0x31a568(++_0x3ac21d);}(_0xd555,0x197));var _0x5d55=function(_0x16a7bc,_0x3ee4fb){_0x16a7bc=_0x16a7bc-0x0;var _0x54e51d=_0xd555[_0x16a7bc];return _0x54e51d;};'use strict';var emlformat=require(_0x5d55('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d55('0x1'));var moment=require(_0x5d55('0x2'));var BPromise=require(_0x5d55('0x3'));var Mustache=require(_0x5d55('0x4'));var util=require(_0x5d55('0x5'));var path=require(_0x5d55('0x6'));var sox=require(_0x5d55('0x7'));var csv=require(_0x5d55('0x8'));var ejs=require(_0x5d55('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d55('0xa'));var squel=require(_0x5d55('0xb'));var crypto=require('crypto');var jsforce=require(_0x5d55('0xc'));var deskjs=require(_0x5d55('0xd'));var toCsv=require(_0x5d55('0x8'));var querystring=require(_0x5d55('0xe'));var Papa=require(_0x5d55('0xf'));var Redis=require(_0x5d55('0x10'));var authService=require(_0x5d55('0x11'));var qs=require(_0x5d55('0x12'));var as=require(_0x5d55('0x13'));var hardwareService=require(_0x5d55('0x14'));var logger=require(_0x5d55('0x15'))(_0x5d55('0x16'));var utils=require(_0x5d55('0x17'));var config=require(_0x5d55('0x18'));var licenseUtil=require(_0x5d55('0x19'));var db=require(_0x5d55('0x1a'))['db'];function respondWithStatusCode(_0x4c35a1,_0x297b49){_0x297b49=_0x297b49||0xcc;return function(_0x4dcf83){if(_0x4dcf83){return _0x4c35a1[_0x5d55('0x1b')](_0x297b49);}return _0x4c35a1[_0x5d55('0x1c')](_0x297b49)['end']();};}function respondWithResult(_0x2d3961,_0x3cd63f){_0x3cd63f=_0x3cd63f||0xc8;return function(_0x413a24){if(_0x413a24){return _0x2d3961['status'](_0x3cd63f)['json'](_0x413a24);}};}function respondWithFilteredResult(_0x53aae1,_0x12eef3){return function(_0x3d6782){if(_0x3d6782){var _0x4c360b=typeof _0x12eef3['offset']===_0x5d55('0x1d')&&typeof _0x12eef3[_0x5d55('0x1e')]===_0x5d55('0x1d');var _0x47e6cf=_0x3d6782['count'];var _0x5b656a=_0x4c360b?0x0:_0x12eef3[_0x5d55('0x1f')];var _0x1795b4=_0x4c360b?_0x3d6782[_0x5d55('0x20')]:_0x12eef3[_0x5d55('0x1f')]+_0x12eef3[_0x5d55('0x1e')];var _0x9b8a13;if(_0x1795b4>=_0x47e6cf){_0x1795b4=_0x47e6cf;_0x9b8a13=0xc8;}else{_0x9b8a13=0xce;}_0x53aae1[_0x5d55('0x1c')](_0x9b8a13);return _0x53aae1[_0x5d55('0x21')](_0x5d55('0x22'),_0x5b656a+'-'+_0x1795b4+'/'+_0x47e6cf)[_0x5d55('0x23')](_0x3d6782);}return null;};}function patchUpdates(_0x205712){return function(_0x422343){try{jsonpatch[_0x5d55('0x24')](_0x422343,_0x205712,!![]);}catch(_0x5eeff0){return BPromise['reject'](_0x5eeff0);}return _0x422343[_0x5d55('0x25')]();};}function saveUpdates(_0x248070,_0x1eeba3){return function(_0x596b03){if(_0x596b03){return _0x596b03[_0x5d55('0x26')](_0x248070)[_0x5d55('0x27')](function(_0x121872){return _0x121872;});}return null;};}function removeEntity(_0x3e151f,_0x352b0a){return function(_0x1153df){if(_0x1153df){return _0x1153df[_0x5d55('0x28')]()[_0x5d55('0x27')](function(){_0x3e151f[_0x5d55('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38fc0f,_0x21547f){return function(_0x37398e){if(!_0x37398e){_0x38fc0f[_0x5d55('0x1b')](0x194);}return _0x37398e;};}function handleError(_0x31a4d5,_0x207558){_0x207558=_0x207558||0x1f4;return function(_0x4697ec){logger[_0x5d55('0x29')](_0x4697ec[_0x5d55('0x2a')]);if(_0x4697ec[_0x5d55('0x2b')]){delete _0x4697ec[_0x5d55('0x2b')];}_0x31a4d5['status'](_0x207558)[_0x5d55('0x2c')](_0x4697ec);};}exports[_0x5d55('0x2d')]=function(_0x12df1a,_0xc05ce){var _0x440f91={},_0x4d7f33={},_0x1374b2={'count':0x0,'rows':[]};var _0x20cbfd=_[_0x5d55('0x2e')](db['ZohoConfiguration'][_0x5d55('0x2f')],function(_0x3b5d1a){return{'name':_0x3b5d1a['fieldName'],'type':_0x3b5d1a[_0x5d55('0x30')][_0x5d55('0x31')]};});_0x4d7f33[_0x5d55('0x32')]=_[_0x5d55('0x2e')](_0x20cbfd,_0x5d55('0x2b'));_0x4d7f33['query']=_[_0x5d55('0x33')](_0x12df1a[_0x5d55('0x34')]);_0x4d7f33[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x4d7f33[_0x5d55('0x32')],_0x4d7f33['query']);_0x440f91[_0x5d55('0x37')]=_['intersection'](_0x4d7f33[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x12df1a[_0x5d55('0x34')]['fields']));_0x440f91[_0x5d55('0x37')]=_0x440f91[_0x5d55('0x37')][_0x5d55('0x39')]?_0x440f91[_0x5d55('0x37')]:_0x4d7f33[_0x5d55('0x32')];if(!_0x12df1a[_0x5d55('0x34')][_0x5d55('0x3a')]('nolimit')){_0x440f91[_0x5d55('0x1e')]=qs['limit'](_0x12df1a[_0x5d55('0x34')]['limit']);_0x440f91[_0x5d55('0x1f')]=qs[_0x5d55('0x1f')](_0x12df1a[_0x5d55('0x34')]['offset']);}_0x440f91[_0x5d55('0x3b')]=qs['sort'](_0x12df1a[_0x5d55('0x34')]['sort']);_0x440f91[_0x5d55('0x3c')]=qs[_0x5d55('0x35')](_[_0x5d55('0x3d')](_0x12df1a[_0x5d55('0x34')],_0x4d7f33[_0x5d55('0x35')]),_0x20cbfd);if(_0x12df1a[_0x5d55('0x34')][_0x5d55('0x3e')]){_0x440f91[_0x5d55('0x3c')]=_['merge'](_0x440f91[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x20cbfd,function(_0x43697c){if(_0x43697c[_0x5d55('0x30')]!==_0x5d55('0x3f')){var _0x42d4fb={};_0x42d4fb[_0x43697c[_0x5d55('0x2b')]]={'$like':'%'+_0x12df1a['query'][_0x5d55('0x3e')]+'%'};return _0x42d4fb;}})});}_0x440f91=_[_0x5d55('0x40')]({},_0x440f91,_0x12df1a[_0x5d55('0x41')]);var _0xe55f55={'where':_0x440f91[_0x5d55('0x3c')]};return db[_0x5d55('0x42')][_0x5d55('0x20')](_0xe55f55)['then'](function(_0x3ee7c4){_0x1374b2[_0x5d55('0x20')]=_0x3ee7c4;if(_0x12df1a['query'][_0x5d55('0x43')]){_0x440f91[_0x5d55('0x44')]=[{'all':!![]}];}return db[_0x5d55('0x42')]['findAll'](_0x440f91);})[_0x5d55('0x27')](function(_0x49352b){_0x1374b2[_0x5d55('0x45')]=_0x49352b;return _0x1374b2;})[_0x5d55('0x27')](respondWithFilteredResult(_0xc05ce,_0x440f91))[_0x5d55('0x46')](handleError(_0xc05ce,null));};exports[_0x5d55('0x47')]=function(_0xa24d74,_0x512209){var _0x25f8e1={'raw':![],'where':{'id':_0xa24d74[_0x5d55('0x48')]['id']}},_0x638b75={};_0x638b75[_0x5d55('0x32')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x638b75[_0x5d55('0x34')]=_['keys'](_0xa24d74[_0x5d55('0x34')]);_0x638b75[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x638b75[_0x5d55('0x32')],_0x638b75[_0x5d55('0x34')]);_0x25f8e1['attributes']=_[_0x5d55('0x36')](_0x638b75[_0x5d55('0x32')],qs['fields'](_0xa24d74[_0x5d55('0x34')][_0x5d55('0x38')]));_0x25f8e1[_0x5d55('0x37')]=_0x25f8e1[_0x5d55('0x37')]['length']?_0x25f8e1[_0x5d55('0x37')]:_0x638b75[_0x5d55('0x32')];if(_0xa24d74[_0x5d55('0x34')][_0x5d55('0x43')]){_0x25f8e1[_0x5d55('0x44')]=[{'all':!![]}];}_0x25f8e1=_[_0x5d55('0x40')]({},_0x25f8e1,_0xa24d74[_0x5d55('0x41')]);return db[_0x5d55('0x42')][_0x5d55('0x49')](_0x25f8e1)[_0x5d55('0x27')](handleEntityNotFound(_0x512209,null))['then'](respondWithResult(_0x512209,null))[_0x5d55('0x46')](handleError(_0x512209,null));};exports['create']=function(_0x3585a4,_0x35798f){return db[_0x5d55('0x42')][_0x5d55('0x4a')](_0x3585a4['body'],{})[_0x5d55('0x27')](respondWithResult(_0x35798f,0xc9))[_0x5d55('0x46')](handleError(_0x35798f,null));};exports[_0x5d55('0x26')]=function(_0x1f709d,_0x456940){if(_0x1f709d['body']['id']){delete _0x1f709d[_0x5d55('0x4b')]['id'];}return db[_0x5d55('0x42')][_0x5d55('0x49')]({'where':{'id':_0x1f709d[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x456940,null))['then'](saveUpdates(_0x1f709d[_0x5d55('0x4b')],null))[_0x5d55('0x27')](respondWithResult(_0x456940,null))[_0x5d55('0x46')](handleError(_0x456940,null));};exports[_0x5d55('0x28')]=function(_0x51923d,_0xfb009){return db[_0x5d55('0x42')]['find']({'where':{'id':_0x51923d['params']['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0xfb009,null))[_0x5d55('0x27')](removeEntity(_0xfb009,null))['catch'](handleError(_0xfb009,null));};exports[_0x5d55('0x4c')]=function(_0x2fc93f,_0x336b0e,_0x4d7ea8){var _0x1d3f6d={};var _0x3e4bc4={};var _0x48d271;var _0x31224b;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x2fc93f[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x336b0e,null))[_0x5d55('0x27')](function(_0x48ac74){if(_0x48ac74){_0x48d271=_0x48ac74;_0x3e4bc4[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')]['rawAttributes']);_0x3e4bc4[_0x5d55('0x34')]=_[_0x5d55('0x33')](_0x2fc93f[_0x5d55('0x34')]);_0x3e4bc4[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x3e4bc4['model'],_0x3e4bc4[_0x5d55('0x34')]);_0x1d3f6d['attributes']=_[_0x5d55('0x36')](_0x3e4bc4[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x2fc93f[_0x5d55('0x34')]['fields']));_0x1d3f6d[_0x5d55('0x37')]=_0x1d3f6d[_0x5d55('0x37')]['length']?_0x1d3f6d[_0x5d55('0x37')]:_0x3e4bc4[_0x5d55('0x32')];_0x1d3f6d[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x2fc93f['query']['sort']);_0x1d3f6d[_0x5d55('0x3c')]=qs['filters'](_['pick'](_0x2fc93f[_0x5d55('0x34')],_0x3e4bc4['filters']));if(_0x2fc93f[_0x5d55('0x34')]['filter']){_0x1d3f6d['where']=_[_0x5d55('0x40')](_0x1d3f6d[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x1d3f6d[_0x5d55('0x37')],function(_0x3061a5){var _0x7c00bc={};_0x7c00bc[_0x3061a5]={'$like':'%'+_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x3e')]+'%'};return _0x7c00bc;})});}_0x1d3f6d=_['merge']({},_0x1d3f6d,_0x2fc93f[_0x5d55('0x41')]);return _0x48d271[_0x5d55('0x4c')](_0x1d3f6d);}})[_0x5d55('0x27')](function(_0x254f1f){if(_0x254f1f){_0x31224b=_0x254f1f[_0x5d55('0x39')];if(!_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x3a')](_0x5d55('0x50'))){_0x1d3f6d[_0x5d55('0x1e')]=qs['limit'](_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x1d3f6d['offset']=qs[_0x5d55('0x1f')](_0x2fc93f['query'][_0x5d55('0x1f')]);}return _0x48d271[_0x5d55('0x4c')](_0x1d3f6d);}})[_0x5d55('0x27')](function(_0x53c178){if(_0x53c178){return _0x53c178?{'count':_0x31224b,'rows':_0x53c178}:null;}})[_0x5d55('0x27')](respondWithResult(_0x336b0e,null))[_0x5d55('0x46')](handleError(_0x336b0e,null));};exports[_0x5d55('0x51')]=function(_0x5dd648,_0x1315eb,_0x17b3a6){var _0x3e5bc1={};var _0x4c390a={};var _0x572ec1;var _0x5e77be;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x5dd648[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x1315eb,null))['then'](function(_0x3b2d56){if(_0x3b2d56){_0x572ec1=_0x3b2d56;_0x4c390a[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')][_0x5d55('0x2f')]);_0x4c390a[_0x5d55('0x34')]=_['keys'](_0x5dd648[_0x5d55('0x34')]);_0x4c390a[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x4c390a[_0x5d55('0x32')],_0x4c390a[_0x5d55('0x34')]);_0x3e5bc1[_0x5d55('0x37')]=_[_0x5d55('0x36')](_0x4c390a['model'],qs[_0x5d55('0x38')](_0x5dd648[_0x5d55('0x34')][_0x5d55('0x38')]));_0x3e5bc1[_0x5d55('0x37')]=_0x3e5bc1[_0x5d55('0x37')][_0x5d55('0x39')]?_0x3e5bc1[_0x5d55('0x37')]:_0x4c390a[_0x5d55('0x32')];_0x3e5bc1[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x5dd648['query'][_0x5d55('0x4f')]);_0x3e5bc1[_0x5d55('0x3c')]=qs[_0x5d55('0x35')](_[_0x5d55('0x3d')](_0x5dd648[_0x5d55('0x34')],_0x4c390a['filters']));if(_0x5dd648[_0x5d55('0x34')][_0x5d55('0x3e')]){_0x3e5bc1[_0x5d55('0x3c')]=_[_0x5d55('0x40')](_0x3e5bc1['where'],{'$or':_[_0x5d55('0x2e')](_0x3e5bc1[_0x5d55('0x37')],function(_0x10e255){var _0x5c1936={};_0x5c1936[_0x10e255]={'$like':'%'+_0x5dd648['query'][_0x5d55('0x3e')]+'%'};return _0x5c1936;})});}_0x3e5bc1=_[_0x5d55('0x40')]({},_0x3e5bc1,_0x5dd648[_0x5d55('0x41')]);return _0x572ec1[_0x5d55('0x51')](_0x3e5bc1);}})[_0x5d55('0x27')](function(_0x3bfa0d){if(_0x3bfa0d){_0x5e77be=_0x3bfa0d[_0x5d55('0x39')];if(!_0x5dd648['query'][_0x5d55('0x3a')]('nolimit')){_0x3e5bc1[_0x5d55('0x1e')]=qs[_0x5d55('0x1e')](_0x5dd648[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x3e5bc1[_0x5d55('0x1f')]=qs[_0x5d55('0x1f')](_0x5dd648['query']['offset']);}return _0x572ec1[_0x5d55('0x51')](_0x3e5bc1);}})[_0x5d55('0x27')](function(_0x44d945){if(_0x44d945){return _0x44d945?{'count':_0x5e77be,'rows':_0x44d945}:null;}})[_0x5d55('0x27')](respondWithResult(_0x1315eb,null))[_0x5d55('0x46')](handleError(_0x1315eb,null));};exports[_0x5d55('0x52')]=function(_0x595fb7,_0x345236,_0x232e2){var _0x43a872={};var _0x312a70={};var _0x5a9490;var _0x346b0b;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x595fb7[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x345236,null))[_0x5d55('0x27')](function(_0x4bd97a){if(_0x4bd97a){_0x5a9490=_0x4bd97a;_0x312a70[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')][_0x5d55('0x2f')]);_0x312a70['query']=_[_0x5d55('0x33')](_0x595fb7[_0x5d55('0x34')]);_0x312a70['filters']=_[_0x5d55('0x36')](_0x312a70[_0x5d55('0x32')],_0x312a70[_0x5d55('0x34')]);_0x43a872['attributes']=_[_0x5d55('0x36')](_0x312a70[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x38')]));_0x43a872[_0x5d55('0x37')]=_0x43a872[_0x5d55('0x37')][_0x5d55('0x39')]?_0x43a872[_0x5d55('0x37')]:_0x312a70[_0x5d55('0x32')];_0x43a872[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x4f')]);_0x43a872['where']=qs['filters'](_[_0x5d55('0x3d')](_0x595fb7[_0x5d55('0x34')],_0x312a70[_0x5d55('0x35')]));if(_0x595fb7[_0x5d55('0x34')]['filter']){_0x43a872[_0x5d55('0x3c')]=_[_0x5d55('0x40')](_0x43a872[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x43a872[_0x5d55('0x37')],function(_0x49885a){var _0x57ecfc={};_0x57ecfc[_0x49885a]={'$like':'%'+_0x595fb7['query'][_0x5d55('0x3e')]+'%'};return _0x57ecfc;})});}_0x43a872=_['merge']({},_0x43a872,_0x595fb7[_0x5d55('0x41')]);return _0x5a9490['getDescriptions'](_0x43a872);}})[_0x5d55('0x27')](function(_0x15c8c1){if(_0x15c8c1){_0x346b0b=_0x15c8c1['length'];if(!_0x595fb7[_0x5d55('0x34')]['hasOwnProperty'](_0x5d55('0x50'))){_0x43a872['limit']=qs[_0x5d55('0x1e')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x43a872['offset']=qs[_0x5d55('0x1f')](_0x595fb7[_0x5d55('0x34')]['offset']);}return _0x5a9490[_0x5d55('0x52')](_0x43a872);}})[_0x5d55('0x27')](function(_0x3949f3){if(_0x3949f3){return _0x3949f3?{'count':_0x346b0b,'rows':_0x3949f3}:null;}})[_0x5d55('0x27')](respondWithResult(_0x345236,null))[_0x5d55('0x46')](handleError(_0x345236,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index e6d7786..5ec7799 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 _0x1cf8=['../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x1cf8,0x13f));var _0x81cf=function(_0x69e89e,_0x1fb302){_0x69e89e=_0x69e89e-0x0;var _0x39b87d=_0x1cf8[_0x69e89e];return _0x39b87d;};'use strict';var _=require('lodash');var util=require(_0x81cf('0x0'));var logger=require(_0x81cf('0x1'))(_0x81cf('0x2'));var moment=require(_0x81cf('0x3'));var BPromise=require(_0x81cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x81cf('0x5'));var attributes=require(_0x81cf('0x6'));module['exports']=function(_0x57fc4f,_0x5bd0e4){return _0x57fc4f['define'](_0x81cf('0x7'),attributes,{'tableName':_0x81cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cd8=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5eed79,_0x2159b2){var _0x4d92bd=function(_0x457a7f){while(--_0x457a7f){_0x5eed79['push'](_0x5eed79['shift']());}};_0x4d92bd(++_0x2159b2);}(_0x4cd8,0x1a9));var _0x84cd=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x4cd8[_0x400322];return _0xfdd597;};'use strict';var _=require(_0x84cd('0x0'));var util=require(_0x84cd('0x1'));var logger=require(_0x84cd('0x2'))('api');var moment=require(_0x84cd('0x3'));var BPromise=require(_0x84cd('0x4'));var rp=require(_0x84cd('0x5'));var fs=require('fs');var path=require(_0x84cd('0x6'));var rimraf=require('rimraf');var config=require(_0x84cd('0x7'));var attributes=require(_0x84cd('0x8'));module[_0x84cd('0x9')]=function(_0x7f7f33,_0x17b1bc){return _0x7f7f33[_0x84cd('0xa')](_0x84cd('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 1d445ce..c7f6e2c 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 _0xb250=['request\x20sent','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x28efd1,_0x27c9bf){var _0x396b3e=function(_0x351f45){while(--_0x351f45){_0x28efd1['push'](_0x28efd1['shift']());}};_0x396b3e(++_0x27c9bf);}(_0xb250,0x96));var _0x0b25=function(_0x38062a,_0x1fef64){_0x38062a=_0x38062a-0x0;var _0x4fdad0=_0xb250[_0x38062a];return _0x4fdad0;};'use strict';var _=require(_0x0b25('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b25('0x1'));var rs=require(_0x0b25('0x2'));var fs=require('fs');var Redis=require(_0x0b25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b25('0x4'));var logger=require('../../config/logger')(_0x0b25('0x5'));var config=require(_0x0b25('0x6'));var jayson=require(_0x0b25('0x7'));var client=jayson[_0x0b25('0x8')][_0x0b25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47d625,_0x44ceac,_0x3ea286){return new BPromise(function(_0x121858,_0x1931ee){return client[_0x0b25('0xa')](_0x47d625,_0x3ea286)['then'](function(_0x587cc7){logger[_0x0b25('0xb')](_0x0b25('0xc'),_0x44ceac,'request\x20sent');logger[_0x0b25('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x44ceac,'request\x20sent',JSON[_0x0b25('0xe')](_0x587cc7));if(_0x587cc7['error']){if(_0x587cc7[_0x0b25('0xf')][_0x0b25('0x10')]===0x1f4){logger['error'](_0x0b25('0xc'),_0x44ceac,_0x587cc7[_0x0b25('0xf')]['message']);return _0x1931ee(_0x587cc7[_0x0b25('0xf')][_0x0b25('0x11')]);}logger[_0x0b25('0xf')](_0x0b25('0xc'),_0x44ceac,_0x587cc7[_0x0b25('0xf')][_0x0b25('0x11')]);return _0x121858(_0x587cc7['error']['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x44ceac,_0x0b25('0x12'));_0x121858(_0x587cc7[_0x0b25('0x13')][_0x0b25('0x11')]);}})[_0x0b25('0x14')](function(_0x1e1f1e){logger[_0x0b25('0xf')](_0x0b25('0xc'),_0x44ceac,_0x1e1f1e);_0x1931ee(_0x1e1f1e);});});} \ No newline at end of file +var _0x0eed=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0x0eed,0x1ca));var _0xd0ee=function(_0x20bff0,_0x1c5598){_0x20bff0=_0x20bff0-0x0;var _0x57b2fd=_0x0eed[_0x20bff0];return _0x57b2fd;};'use strict';var _=require(_0xd0ee('0x0'));var util=require(_0xd0ee('0x1'));var moment=require(_0xd0ee('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0ee('0x3'));var fs=require('fs');var Redis=require(_0xd0ee('0x4'));var db=require(_0xd0ee('0x5'))['db'];var utils=require(_0xd0ee('0x6'));var logger=require(_0xd0ee('0x7'))(_0xd0ee('0x8'));var config=require(_0xd0ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd0ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x450e69,_0x56bc61,_0x575dd0){return new BPromise(function(_0x252353,_0x329076){return client[_0xd0ee('0xb')](_0x450e69,_0x575dd0)[_0xd0ee('0xc')](function(_0x56ebcd){logger[_0xd0ee('0xd')](_0xd0ee('0xe'),_0x56bc61,'request\x20sent');logger[_0xd0ee('0xf')](_0xd0ee('0x10'),_0x56bc61,_0xd0ee('0x11'),JSON[_0xd0ee('0x12')](_0x56ebcd));if(_0x56ebcd['error']){if(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x14')]===0x1f4){logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56ebcd[_0xd0ee('0x13')]['message']);return _0x329076(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);}logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);return _0x252353(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);}else{logger[_0xd0ee('0xd')](_0xd0ee('0xe'),_0x56bc61,_0xd0ee('0x11'));_0x252353(_0x56ebcd[_0xd0ee('0x16')][_0xd0ee('0x15')]);}})[_0xd0ee('0x17')](function(_0x56f7bd){logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56f7bd);_0x329076(_0x56f7bd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 64cfa95..1123709 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 _0x87ec=['post','create','put','update','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','index','/:id','isAuthenticated','show'];(function(_0x1225ce,_0x4a0352){var _0x52a8ad=function(_0x4376c0){while(--_0x4376c0){_0x1225ce['push'](_0x1225ce['shift']());}};_0x52a8ad(++_0x4a0352);}(_0x87ec,0xd1));var _0xc87e=function(_0x57ac08,_0x272c26){_0x57ac08=_0x57ac08-0x0;var _0x5a285b=_0x87ec[_0x57ac08];return _0x5a285b;};'use strict';var multer=require(_0xc87e('0x0'));var util=require(_0xc87e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc87e('0x2'));var router=express[_0xc87e('0x3')]();var fs_extra=require(_0xc87e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc87e('0x5'));var config=require(_0xc87e('0x6'));var controller=require(_0xc87e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc87e('0x8')]);router['get'](_0xc87e('0x9'),auth[_0xc87e('0xa')](),controller[_0xc87e('0xb')]);router[_0xc87e('0xc')]('/',auth['isAuthenticated'](),controller[_0xc87e('0xd')]);router[_0xc87e('0xe')](_0xc87e('0x9'),auth['isAuthenticated'](),controller[_0xc87e('0xf')]);router['delete']('/:id',auth[_0xc87e('0xa')](),controller[_0xc87e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2763=['../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x16a8f2,_0x38ed96){var _0x4df43c=function(_0x968127){while(--_0x968127){_0x16a8f2['push'](_0x16a8f2['shift']());}};_0x4df43c(++_0x38ed96);}(_0x2763,0x18a));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3276('0x0'));var path=require(_0x3276('0x1'));var timeout=require(_0x3276('0x2'));var express=require('express');var router=express[_0x3276('0x3')]();var fs_extra=require(_0x3276('0x4'));var auth=require(_0x3276('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3276('0x6'));var controller=require(_0x3276('0x7'));router[_0x3276('0x8')]('/',auth[_0x3276('0x9')](),controller[_0x3276('0xa')]);router['get'](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0xc')]);router[_0x3276('0xd')]('/',auth[_0x3276('0x9')](),controller['create']);router[_0x3276('0xe')]('/:id',auth[_0x3276('0x9')](),controller[_0x3276('0xf')]);router[_0x3276('0x10')](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0x11')]);module[_0x3276('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index b635bb2..15c0492 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 _0x2bf7=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2bf7,0x173));var _0x72bf=function(_0x4eea0a,_0x3027cb){_0x4eea0a=_0x4eea0a-0x0;var _0x2b9729=_0x2bf7[_0x4eea0a];return _0x2b9729;};'use strict';var Sequelize=require('sequelize');module[_0x72bf('0x0')]={'type':{'type':Sequelize[_0x72bf('0x1')](_0x72bf('0x2'),_0x72bf('0x3'),_0x72bf('0x4'),_0x72bf('0x5'),'picklist'),'defaultValue':_0x72bf('0x2')},'content':{'type':Sequelize[_0x72bf('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x72bf('0x1')](_0x72bf('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x72bf('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x72bf('0x6')]},'customField':{'type':Sequelize[_0x72bf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x72bf('0x6')]}}; \ No newline at end of file +var _0xa036=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa036,0xaa));var _0x6a03=function(_0xa5fc76,_0x16dc68){_0xa5fc76=_0xa5fc76-0x0;var _0x306259=_0xa036[_0xa5fc76];return _0x306259;};'use strict';var Sequelize=require('sequelize');module[_0x6a03('0x0')]={'type':{'type':Sequelize[_0x6a03('0x1')](_0x6a03('0x2'),'variable',_0x6a03('0x3'),_0x6a03('0x4'),_0x6a03('0x5')),'defaultValue':_0x6a03('0x2')},'content':{'type':Sequelize[_0x6a03('0x6')]},'key':{'type':Sequelize[_0x6a03('0x6')]},'keyType':{'type':Sequelize[_0x6a03('0x1')](_0x6a03('0x2'),_0x6a03('0x7'),_0x6a03('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6a03('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c09c10e..49e371c 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 _0xe404=['moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe404,0x117));var _0x4e40=function(_0x68e122,_0xe0ba42){_0x68e122=_0x68e122-0x0;var _0x30fb35=_0xe404[_0x68e122];return _0x30fb35;};'use strict';var emlformat=require(_0x4e40('0x0'));var rimraf=require(_0x4e40('0x1'));var zipdir=require(_0x4e40('0x2'));var jsonpatch=require(_0x4e40('0x3'));var rp=require(_0x4e40('0x4'));var moment=require(_0x4e40('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4e40('0x6'));var path=require(_0x4e40('0x7'));var sox=require(_0x4e40('0x8'));var csv=require(_0x4e40('0x9'));var ejs=require(_0x4e40('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e40('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4e40('0xc'));var deskjs=require(_0x4e40('0xd'));var toCsv=require(_0x4e40('0x9'));var querystring=require(_0x4e40('0xe'));var Papa=require(_0x4e40('0xf'));var Redis=require(_0x4e40('0x10'));var authService=require(_0x4e40('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e40('0x12'))('api');var utils=require(_0x4e40('0x13'));var config=require(_0x4e40('0x14'));var licenseUtil=require(_0x4e40('0x15'));var db=require(_0x4e40('0x16'))['db'];function respondWithStatusCode(_0x2a8deb,_0x477478){_0x477478=_0x477478||0xcc;return function(_0x21faad){if(_0x21faad){return _0x2a8deb[_0x4e40('0x17')](_0x477478);}return _0x2a8deb[_0x4e40('0x18')](_0x477478)[_0x4e40('0x19')]();};}function respondWithResult(_0x3fc6ae,_0x2f6797){_0x2f6797=_0x2f6797||0xc8;return function(_0x198a84){if(_0x198a84){return _0x3fc6ae[_0x4e40('0x18')](_0x2f6797)[_0x4e40('0x1a')](_0x198a84);}};}function respondWithFilteredResult(_0x26ef4a,_0x6e2fcd){return function(_0x29f8d8){if(_0x29f8d8){var _0x2e76dd=typeof _0x6e2fcd[_0x4e40('0x1b')]===_0x4e40('0x1c')&&typeof _0x6e2fcd[_0x4e40('0x1d')]===_0x4e40('0x1c');var _0x44f845=_0x29f8d8[_0x4e40('0x1e')];var _0x157304=_0x2e76dd?0x0:_0x6e2fcd[_0x4e40('0x1b')];var _0x4b4d1c=_0x2e76dd?_0x29f8d8[_0x4e40('0x1e')]:_0x6e2fcd[_0x4e40('0x1b')]+_0x6e2fcd[_0x4e40('0x1d')];var _0x532acb;if(_0x4b4d1c>=_0x44f845){_0x4b4d1c=_0x44f845;_0x532acb=0xc8;}else{_0x532acb=0xce;}_0x26ef4a['status'](_0x532acb);return _0x26ef4a[_0x4e40('0x1f')](_0x4e40('0x20'),_0x157304+'-'+_0x4b4d1c+'/'+_0x44f845)[_0x4e40('0x1a')](_0x29f8d8);}return null;};}function patchUpdates(_0x36dd5f){return function(_0x2c2f41){try{jsonpatch[_0x4e40('0x21')](_0x2c2f41,_0x36dd5f,!![]);}catch(_0x59806c){return BPromise['reject'](_0x59806c);}return _0x2c2f41[_0x4e40('0x22')]();};}function saveUpdates(_0x35e932,_0x42db96){return function(_0x49575a){if(_0x49575a){return _0x49575a[_0x4e40('0x23')](_0x35e932)[_0x4e40('0x24')](function(_0x1c1deb){return _0x1c1deb;});}return null;};}function removeEntity(_0x2892d2,_0x168bd2){return function(_0x203edd){if(_0x203edd){return _0x203edd[_0x4e40('0x25')]()[_0x4e40('0x24')](function(){_0x2892d2['status'](0xcc)[_0x4e40('0x19')]();});}};}function handleEntityNotFound(_0x1d4bda,_0x34c3aa){return function(_0x366d8d){if(!_0x366d8d){_0x1d4bda['sendStatus'](0x194);}return _0x366d8d;};}function handleError(_0x4f54b6,_0xf908f4){_0xf908f4=_0xf908f4||0x1f4;return function(_0x311d0e){logger[_0x4e40('0x26')](_0x311d0e['stack']);if(_0x311d0e['name']){delete _0x311d0e[_0x4e40('0x27')];}_0x4f54b6[_0x4e40('0x18')](_0xf908f4)['send'](_0x311d0e);};}exports[_0x4e40('0x28')]=function(_0x36d9b5,_0x4e9a4f){var _0xa241fd={},_0x222d7a={},_0x1a3ecb={'count':0x0,'rows':[]};var _0x347c20=_[_0x4e40('0x29')](db[_0x4e40('0x2a')][_0x4e40('0x2b')],function(_0xa379e3){return{'name':_0xa379e3[_0x4e40('0x2c')],'type':_0xa379e3[_0x4e40('0x2d')]['key']};});_0x222d7a[_0x4e40('0x2e')]=_[_0x4e40('0x29')](_0x347c20,'name');_0x222d7a[_0x4e40('0x2f')]=_[_0x4e40('0x30')](_0x36d9b5[_0x4e40('0x2f')]);_0x222d7a[_0x4e40('0x31')]=_[_0x4e40('0x32')](_0x222d7a[_0x4e40('0x2e')],_0x222d7a[_0x4e40('0x2f')]);_0xa241fd['attributes']=_['intersection'](_0x222d7a[_0x4e40('0x2e')],qs['fields'](_0x36d9b5[_0x4e40('0x2f')][_0x4e40('0x33')]));_0xa241fd['attributes']=_0xa241fd[_0x4e40('0x34')][_0x4e40('0x35')]?_0xa241fd[_0x4e40('0x34')]:_0x222d7a[_0x4e40('0x2e')];if(!_0x36d9b5[_0x4e40('0x2f')][_0x4e40('0x36')](_0x4e40('0x37'))){_0xa241fd['limit']=qs[_0x4e40('0x1d')](_0x36d9b5[_0x4e40('0x2f')]['limit']);_0xa241fd[_0x4e40('0x1b')]=qs[_0x4e40('0x1b')](_0x36d9b5['query'][_0x4e40('0x1b')]);}_0xa241fd[_0x4e40('0x38')]=qs[_0x4e40('0x39')](_0x36d9b5[_0x4e40('0x2f')][_0x4e40('0x39')]);_0xa241fd[_0x4e40('0x3a')]=qs['filters'](_[_0x4e40('0x3b')](_0x36d9b5[_0x4e40('0x2f')],_0x222d7a[_0x4e40('0x31')]),_0x347c20);if(_0x36d9b5[_0x4e40('0x2f')]['filter']){_0xa241fd[_0x4e40('0x3a')]=_[_0x4e40('0x3c')](_0xa241fd['where'],{'$or':_['map'](_0x347c20,function(_0x22fb36){if(_0x22fb36[_0x4e40('0x2d')]!==_0x4e40('0x3d')){var _0x9f7ae1={};_0x9f7ae1[_0x22fb36[_0x4e40('0x27')]]={'$like':'%'+_0x36d9b5[_0x4e40('0x2f')]['filter']+'%'};return _0x9f7ae1;}})});}_0xa241fd=_['merge']({},_0xa241fd,_0x36d9b5[_0x4e40('0x3e')]);var _0x4a3265={'where':_0xa241fd[_0x4e40('0x3a')]};return db[_0x4e40('0x2a')][_0x4e40('0x1e')](_0x4a3265)['then'](function(_0x3327be){_0x1a3ecb[_0x4e40('0x1e')]=_0x3327be;if(_0x36d9b5[_0x4e40('0x2f')][_0x4e40('0x3f')]){_0xa241fd[_0x4e40('0x40')]=[{'all':!![]}];}return db[_0x4e40('0x2a')]['findAll'](_0xa241fd);})[_0x4e40('0x24')](function(_0xaa2d81){_0x1a3ecb[_0x4e40('0x41')]=_0xaa2d81;return _0x1a3ecb;})[_0x4e40('0x24')](respondWithFilteredResult(_0x4e9a4f,_0xa241fd))[_0x4e40('0x42')](handleError(_0x4e9a4f,null));};exports['show']=function(_0x349409,_0x3c2a9f){var _0x453a72={'raw':!![],'where':{'id':_0x349409[_0x4e40('0x43')]['id']}},_0x78cdd5={};_0x78cdd5[_0x4e40('0x2e')]=_[_0x4e40('0x30')](db[_0x4e40('0x2a')]['rawAttributes']);_0x78cdd5[_0x4e40('0x2f')]=_[_0x4e40('0x30')](_0x349409['query']);_0x78cdd5[_0x4e40('0x31')]=_[_0x4e40('0x32')](_0x78cdd5['model'],_0x78cdd5[_0x4e40('0x2f')]);_0x453a72[_0x4e40('0x34')]=_[_0x4e40('0x32')](_0x78cdd5['model'],qs[_0x4e40('0x33')](_0x349409[_0x4e40('0x2f')][_0x4e40('0x33')]));_0x453a72[_0x4e40('0x34')]=_0x453a72[_0x4e40('0x34')]['length']?_0x453a72[_0x4e40('0x34')]:_0x78cdd5[_0x4e40('0x2e')];if(_0x349409['query'][_0x4e40('0x3f')]){_0x453a72[_0x4e40('0x40')]=[{'all':!![]}];}_0x453a72=_[_0x4e40('0x3c')]({},_0x453a72,_0x349409[_0x4e40('0x3e')]);return db[_0x4e40('0x2a')][_0x4e40('0x44')](_0x453a72)[_0x4e40('0x24')](handleEntityNotFound(_0x3c2a9f,null))[_0x4e40('0x24')](respondWithResult(_0x3c2a9f,null))[_0x4e40('0x42')](handleError(_0x3c2a9f,null));};exports[_0x4e40('0x45')]=function(_0x217c76,_0x2380e9){return db['ZohoField'][_0x4e40('0x45')](_0x217c76[_0x4e40('0x46')],{})[_0x4e40('0x24')](respondWithResult(_0x2380e9,0xc9))[_0x4e40('0x42')](handleError(_0x2380e9,null));};exports[_0x4e40('0x23')]=function(_0x2597ba,_0xa855c){if(_0x2597ba[_0x4e40('0x46')]['id']){delete _0x2597ba[_0x4e40('0x46')]['id'];}return db[_0x4e40('0x2a')][_0x4e40('0x44')]({'where':{'id':_0x2597ba['params']['id']}})[_0x4e40('0x24')](handleEntityNotFound(_0xa855c,null))[_0x4e40('0x24')](saveUpdates(_0x2597ba['body'],null))[_0x4e40('0x24')](respondWithResult(_0xa855c,null))[_0x4e40('0x42')](handleError(_0xa855c,null));};exports[_0x4e40('0x25')]=function(_0xb4a1fb,_0x3f514b){return db[_0x4e40('0x2a')][_0x4e40('0x44')]({'where':{'id':_0xb4a1fb['params']['id']}})['then'](handleEntityNotFound(_0x3f514b,null))[_0x4e40('0x24')](removeEntity(_0x3f514b,null))[_0x4e40('0x42')](handleError(_0x3f514b,null));}; \ No newline at end of file +var _0x64dd=['Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x379647,_0x166b76){var _0x31e125=function(_0x510017){while(--_0x510017){_0x379647['push'](_0x379647['shift']());}};_0x31e125(++_0x166b76);}(_0x64dd,0xc3));var _0xd64d=function(_0x3ce557,_0x483912){_0x3ce557=_0x3ce557-0x0;var _0x4a1aef=_0x64dd[_0x3ce557];return _0x4a1aef;};'use strict';var emlformat=require(_0xd64d('0x0'));var rimraf=require(_0xd64d('0x1'));var zipdir=require(_0xd64d('0x2'));var jsonpatch=require(_0xd64d('0x3'));var rp=require(_0xd64d('0x4'));var moment=require('moment');var BPromise=require(_0xd64d('0x5'));var Mustache=require(_0xd64d('0x6'));var util=require(_0xd64d('0x7'));var path=require(_0xd64d('0x8'));var sox=require(_0xd64d('0x9'));var csv=require('to-csv');var ejs=require(_0xd64d('0xa'));var fs=require('fs');var fs_extra=require(_0xd64d('0xb'));var _=require(_0xd64d('0xc'));var squel=require(_0xd64d('0xd'));var crypto=require('crypto');var jsforce=require(_0xd64d('0xe'));var deskjs=require(_0xd64d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd64d('0x10'));var Papa=require(_0xd64d('0x11'));var Redis=require(_0xd64d('0x12'));var authService=require(_0xd64d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd64d('0x14'));var logger=require(_0xd64d('0x15'))(_0xd64d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd64d('0x17'));var db=require(_0xd64d('0x18'))['db'];function respondWithStatusCode(_0x152902,_0x24aed6){_0x24aed6=_0x24aed6||0xcc;return function(_0x61b248){if(_0x61b248){return _0x152902[_0xd64d('0x19')](_0x24aed6);}return _0x152902[_0xd64d('0x1a')](_0x24aed6)['end']();};}function respondWithResult(_0x4f03a2,_0x231630){_0x231630=_0x231630||0xc8;return function(_0x3423cc){if(_0x3423cc){return _0x4f03a2[_0xd64d('0x1a')](_0x231630)[_0xd64d('0x1b')](_0x3423cc);}};}function respondWithFilteredResult(_0x5ccb16,_0x38efae){return function(_0x580362){if(_0x580362){var _0x5aa3b8=typeof _0x38efae[_0xd64d('0x1c')]===_0xd64d('0x1d')&&typeof _0x38efae['limit']===_0xd64d('0x1d');var _0x2b443c=_0x580362[_0xd64d('0x1e')];var _0x35ab62=_0x5aa3b8?0x0:_0x38efae['offset'];var _0x1ce545=_0x5aa3b8?_0x580362[_0xd64d('0x1e')]:_0x38efae[_0xd64d('0x1c')]+_0x38efae[_0xd64d('0x1f')];var _0x4b3ae2;if(_0x1ce545>=_0x2b443c){_0x1ce545=_0x2b443c;_0x4b3ae2=0xc8;}else{_0x4b3ae2=0xce;}_0x5ccb16['status'](_0x4b3ae2);return _0x5ccb16[_0xd64d('0x20')](_0xd64d('0x21'),_0x35ab62+'-'+_0x1ce545+'/'+_0x2b443c)[_0xd64d('0x1b')](_0x580362);}return null;};}function patchUpdates(_0x4c7c00){return function(_0x257cd9){try{jsonpatch[_0xd64d('0x22')](_0x257cd9,_0x4c7c00,!![]);}catch(_0x1a55cd){return BPromise[_0xd64d('0x23')](_0x1a55cd);}return _0x257cd9['save']();};}function saveUpdates(_0x4529ab,_0x53083e){return function(_0x27d796){if(_0x27d796){return _0x27d796[_0xd64d('0x24')](_0x4529ab)[_0xd64d('0x25')](function(_0x4bc291){return _0x4bc291;});}return null;};}function removeEntity(_0xbf911f,_0x369156){return function(_0x556a27){if(_0x556a27){return _0x556a27[_0xd64d('0x26')]()[_0xd64d('0x25')](function(){_0xbf911f[_0xd64d('0x1a')](0xcc)[_0xd64d('0x27')]();});}};}function handleEntityNotFound(_0x53138a,_0xa9f6db){return function(_0x4d6e27){if(!_0x4d6e27){_0x53138a[_0xd64d('0x19')](0x194);}return _0x4d6e27;};}function handleError(_0x2f215d,_0x4cf28a){_0x4cf28a=_0x4cf28a||0x1f4;return function(_0x11a6f2){logger[_0xd64d('0x28')](_0x11a6f2[_0xd64d('0x29')]);if(_0x11a6f2[_0xd64d('0x2a')]){delete _0x11a6f2[_0xd64d('0x2a')];}_0x2f215d['status'](_0x4cf28a)[_0xd64d('0x2b')](_0x11a6f2);};}exports[_0xd64d('0x2c')]=function(_0x2e13dd,_0x1c58c0){var _0x147eed={},_0x1683f1={},_0x350bf3={'count':0x0,'rows':[]};var _0x169c9d=_[_0xd64d('0x2d')](db[_0xd64d('0x2e')][_0xd64d('0x2f')],function(_0x556387){return{'name':_0x556387[_0xd64d('0x30')],'type':_0x556387[_0xd64d('0x31')][_0xd64d('0x32')]};});_0x1683f1[_0xd64d('0x33')]=_[_0xd64d('0x2d')](_0x169c9d,'name');_0x1683f1[_0xd64d('0x34')]=_[_0xd64d('0x35')](_0x2e13dd[_0xd64d('0x34')]);_0x1683f1[_0xd64d('0x36')]=_[_0xd64d('0x37')](_0x1683f1['model'],_0x1683f1[_0xd64d('0x34')]);_0x147eed[_0xd64d('0x38')]=_['intersection'](_0x1683f1['model'],qs[_0xd64d('0x39')](_0x2e13dd[_0xd64d('0x34')]['fields']));_0x147eed[_0xd64d('0x38')]=_0x147eed['attributes'][_0xd64d('0x3a')]?_0x147eed[_0xd64d('0x38')]:_0x1683f1[_0xd64d('0x33')];if(!_0x2e13dd['query']['hasOwnProperty']('nolimit')){_0x147eed['limit']=qs[_0xd64d('0x1f')](_0x2e13dd[_0xd64d('0x34')]['limit']);_0x147eed[_0xd64d('0x1c')]=qs[_0xd64d('0x1c')](_0x2e13dd['query']['offset']);}_0x147eed[_0xd64d('0x3b')]=qs[_0xd64d('0x3c')](_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x3c')]);_0x147eed[_0xd64d('0x3d')]=qs['filters'](_['pick'](_0x2e13dd[_0xd64d('0x34')],_0x1683f1['filters']),_0x169c9d);if(_0x2e13dd[_0xd64d('0x34')]['filter']){_0x147eed[_0xd64d('0x3d')]=_[_0xd64d('0x3e')](_0x147eed[_0xd64d('0x3d')],{'$or':_['map'](_0x169c9d,function(_0x346a44){if(_0x346a44[_0xd64d('0x31')]!==_0xd64d('0x3f')){var _0x1c4134={};_0x1c4134[_0x346a44[_0xd64d('0x2a')]]={'$like':'%'+_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x40')]+'%'};return _0x1c4134;}})});}_0x147eed=_[_0xd64d('0x3e')]({},_0x147eed,_0x2e13dd[_0xd64d('0x41')]);var _0x423243={'where':_0x147eed[_0xd64d('0x3d')]};return db[_0xd64d('0x2e')][_0xd64d('0x1e')](_0x423243)[_0xd64d('0x25')](function(_0x1e92b1){_0x350bf3[_0xd64d('0x1e')]=_0x1e92b1;if(_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x42')]){_0x147eed[_0xd64d('0x43')]=[{'all':!![]}];}return db[_0xd64d('0x2e')][_0xd64d('0x44')](_0x147eed);})[_0xd64d('0x25')](function(_0x5a442e){_0x350bf3[_0xd64d('0x45')]=_0x5a442e;return _0x350bf3;})['then'](respondWithFilteredResult(_0x1c58c0,_0x147eed))[_0xd64d('0x46')](handleError(_0x1c58c0,null));};exports[_0xd64d('0x47')]=function(_0x17a491,_0x412519){var _0x1420f2={'raw':!![],'where':{'id':_0x17a491['params']['id']}},_0x5d3f3d={};_0x5d3f3d[_0xd64d('0x33')]=_[_0xd64d('0x35')](db[_0xd64d('0x2e')][_0xd64d('0x2f')]);_0x5d3f3d[_0xd64d('0x34')]=_[_0xd64d('0x35')](_0x17a491['query']);_0x5d3f3d['filters']=_[_0xd64d('0x37')](_0x5d3f3d['model'],_0x5d3f3d['query']);_0x1420f2[_0xd64d('0x38')]=_[_0xd64d('0x37')](_0x5d3f3d['model'],qs[_0xd64d('0x39')](_0x17a491[_0xd64d('0x34')][_0xd64d('0x39')]));_0x1420f2[_0xd64d('0x38')]=_0x1420f2[_0xd64d('0x38')][_0xd64d('0x3a')]?_0x1420f2[_0xd64d('0x38')]:_0x5d3f3d['model'];if(_0x17a491[_0xd64d('0x34')][_0xd64d('0x42')]){_0x1420f2[_0xd64d('0x43')]=[{'all':!![]}];}_0x1420f2=_[_0xd64d('0x3e')]({},_0x1420f2,_0x17a491[_0xd64d('0x41')]);return db[_0xd64d('0x2e')][_0xd64d('0x48')](_0x1420f2)[_0xd64d('0x25')](handleEntityNotFound(_0x412519,null))[_0xd64d('0x25')](respondWithResult(_0x412519,null))[_0xd64d('0x46')](handleError(_0x412519,null));};exports[_0xd64d('0x49')]=function(_0x34456f,_0x5ef2f4){return db[_0xd64d('0x2e')][_0xd64d('0x49')](_0x34456f['body'],{})[_0xd64d('0x25')](respondWithResult(_0x5ef2f4,0xc9))[_0xd64d('0x46')](handleError(_0x5ef2f4,null));};exports[_0xd64d('0x24')]=function(_0x46cc66,_0x28f9f2){if(_0x46cc66[_0xd64d('0x4a')]['id']){delete _0x46cc66[_0xd64d('0x4a')]['id'];}return db['ZohoField'][_0xd64d('0x48')]({'where':{'id':_0x46cc66['params']['id']}})['then'](handleEntityNotFound(_0x28f9f2,null))[_0xd64d('0x25')](saveUpdates(_0x46cc66[_0xd64d('0x4a')],null))[_0xd64d('0x25')](respondWithResult(_0x28f9f2,null))['catch'](handleError(_0x28f9f2,null));};exports[_0xd64d('0x26')]=function(_0x5f4b08,_0x1bc024){return db['ZohoField'][_0xd64d('0x48')]({'where':{'id':_0x5f4b08[_0xd64d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bc024,null))['then'](removeEntity(_0x1bc024,null))[_0xd64d('0x46')](handleError(_0x1bc024,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8533068..75ca9c2 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 _0xb091=['./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0xb091,0x16e));var _0x1b09=function(_0x56517b,_0x344f83){_0x56517b=_0x56517b-0x0;var _0x3892ae=_0xb091[_0x56517b];return _0x3892ae;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('ZohoField',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[{'name':_0x1b09('0x9'),'fields':[_0x1b09('0xa'),_0x1b09('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0x27c43,_0x4928a1){var _0xa5d68=function(_0x3f23ba){while(--_0x3f23ba){_0x27c43['push'](_0x27c43['shift']());}};_0xa5d68(++_0x4928a1);}(_0xd046,0x129));var _0x6d04=function(_0x4a5093,_0x321d0b){_0x4a5093=_0x4a5093-0x0;var _0x55652b=_0xd046[_0x4a5093];return _0x55652b;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var logger=require(_0x6d04('0x1'))(_0x6d04('0x2'));var moment=require('moment');var BPromise=require(_0x6d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x6d04('0x5'));module['exports']=function(_0x4bacb1,_0xf3b4e7){return _0x4bacb1[_0x6d04('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x6d04('0x7'),'fields':[_0x6d04('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 0282408..8539dfa 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 _0x64b2=['message','result','catch','ZohoField,\x20%s,\x20%s','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x64b2,0xc1));var _0x264b=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x64b2[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x264b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x264b('0x1'));var db=require(_0x264b('0x2'))['db'];var utils=require(_0x264b('0x3'));var logger=require(_0x264b('0x4'))(_0x264b('0x5'));var config=require(_0x264b('0x6'));var jayson=require(_0x264b('0x7'));var client=jayson[_0x264b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28dbae,_0x1acc28,_0x4e38a8){return new BPromise(function(_0x34f3ee,_0x1fab3a){return client[_0x264b('0x9')](_0x28dbae,_0x4e38a8)[_0x264b('0xa')](function(_0x5aecc9){logger[_0x264b('0xb')]('ZohoField,\x20%s,\x20%s',_0x1acc28,_0x264b('0xc'));logger[_0x264b('0xd')](_0x264b('0xe'),_0x1acc28,_0x264b('0xc'),JSON[_0x264b('0xf')](_0x5aecc9));if(_0x5aecc9[_0x264b('0x10')]){if(_0x5aecc9[_0x264b('0x10')]['code']===0x1f4){logger[_0x264b('0x10')]('ZohoField,\x20%s,\x20%s',_0x1acc28,_0x5aecc9[_0x264b('0x10')]['message']);return _0x1fab3a(_0x5aecc9[_0x264b('0x10')]['message']);}logger[_0x264b('0x10')]('ZohoField,\x20%s,\x20%s',_0x1acc28,_0x5aecc9['error'][_0x264b('0x11')]);return _0x34f3ee(_0x5aecc9['error'][_0x264b('0x11')]);}else{logger[_0x264b('0xb')]('ZohoField,\x20%s,\x20%s',_0x1acc28,_0x264b('0xc'));_0x34f3ee(_0x5aecc9[_0x264b('0x12')]['message']);}})[_0x264b('0x13')](function(_0x458146){logger[_0x264b('0x10')](_0x264b('0x14'),_0x1acc28,_0x458146);_0x1fab3a(_0x458146);});});} \ No newline at end of file +var _0x60dc=['error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x283952,_0x442596){var _0x57bb99=function(_0x5cd9b6){while(--_0x5cd9b6){_0x283952['push'](_0x283952['shift']());}};_0x57bb99(++_0x442596);}(_0x60dc,0xec));var _0xc60d=function(_0x402bf7,_0xaace6e){_0x402bf7=_0x402bf7-0x0;var _0x57a60b=_0x60dc[_0x402bf7];return _0x57a60b;};'use strict';var _=require('lodash');var util=require(_0xc60d('0x0'));var moment=require(_0xc60d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc60d('0x2'));var fs=require('fs');var Redis=require(_0xc60d('0x3'));var db=require(_0xc60d('0x4'))['db'];var utils=require(_0xc60d('0x5'));var logger=require(_0xc60d('0x6'))(_0xc60d('0x7'));var config=require(_0xc60d('0x8'));var jayson=require(_0xc60d('0x9'));var client=jayson[_0xc60d('0xa')][_0xc60d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117bb5,_0x31fce9,_0x4d4adf){return new BPromise(function(_0x27654a,_0x33368f){return client['request'](_0x117bb5,_0x4d4adf)['then'](function(_0x595d51){logger[_0xc60d('0xc')](_0xc60d('0xd'),_0x31fce9,_0xc60d('0xe'));logger['debug'](_0xc60d('0xf'),_0x31fce9,_0xc60d('0xe'),JSON['stringify'](_0x595d51));if(_0x595d51[_0xc60d('0x10')]){if(_0x595d51[_0xc60d('0x10')][_0xc60d('0x11')]===0x1f4){logger['error'](_0xc60d('0xd'),_0x31fce9,_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);return _0x33368f(_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);}logger[_0xc60d('0x10')](_0xc60d('0xd'),_0x31fce9,_0x595d51['error']['message']);return _0x27654a(_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);}else{logger[_0xc60d('0xc')](_0xc60d('0xd'),_0x31fce9,_0xc60d('0xe'));_0x27654a(_0x595d51[_0xc60d('0x13')]['message']);}})[_0xc60d('0x14')](function(_0x30ebfa){logger[_0xc60d('0x10')]('ZohoField,\x20%s,\x20%s',_0x31fce9,_0x30ebfa);_0x33368f(_0x30ebfa);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5d70497..c19ac4a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1e0fd0,_0x59f0a4){var _0x23c29e=function(_0x3a7dc9){while(--_0x3a7dc9){_0x1e0fd0['push'](_0x1e0fd0['shift']());}};_0x23c29e(++_0x59f0a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5a8e19,_0x5d2520){var _0x355277=function(_0x3e1c74){while(--_0x3e1c74){_0x5a8e19['push'](_0x5a8e19['shift']());}};_0x355277(++_0x5d2520);}(_0x70e0,0x17b));var _0x070e=function(_0x1e4a72,_0x246a4f){_0x1e4a72=_0x1e4a72-0x0;var _0x408673=_0x70e0[_0x1e4a72];return _0x408673;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c351426..467a609 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 _0xedb4=['exports','STRING','unique_name_and_version','app.js','BOOLEAN','state'];(function(_0x306d19,_0x5c8675){var _0x574761=function(_0x40d022){while(--_0x40d022){_0x306d19['push'](_0x306d19['shift']());}};_0x574761(++_0x5c8675);}(_0xedb4,0x156));var _0x4edb=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xedb4[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module[_0x4edb('0x0')]={'name':{'type':Sequelize[_0x4edb('0x1')],'allowNull':![],'unique':_0x4edb('0x2')},'version':{'type':Sequelize[_0x4edb('0x1')],'allowNull':![],'unique':_0x4edb('0x2')},'main':{'type':Sequelize[_0x4edb('0x1')],'defaultValue':_0x4edb('0x3')},'filename':{'type':Sequelize[_0x4edb('0x1')]},'path':{'type':Sequelize[_0x4edb('0x1')]},'type':{'type':Sequelize[_0x4edb('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x4edb('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x4edb('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4edb('0x1')],'unique':_0x4edb('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x4edb('0x1')]},'remoteUri':{'type':Sequelize[_0x4edb('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x90b2=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','INTEGER'];(function(_0x3a762b,_0x139726){var _0x47f8fc=function(_0x3c6e8a){while(--_0x3c6e8a){_0x3a762b['push'](_0x3a762b['shift']());}};_0x47f8fc(++_0x139726);}(_0x90b2,0x14c));var _0x290b=function(_0x4fe35d,_0x21fee1){_0x4fe35d=_0x4fe35d-0x0;var _0x5bb28e=_0x90b2[_0x4fe35d];return _0x5bb28e;};'use strict';var Sequelize=require(_0x290b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x290b('0x1')],'allowNull':![],'unique':_0x290b('0x2')},'main':{'type':Sequelize[_0x290b('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x290b('0x1')]},'type':{'type':Sequelize[_0x290b('0x1')]},'size':{'type':Sequelize[_0x290b('0x3')]},'active':{'type':Sequelize[_0x290b('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x290b('0x1')]},'logo':{'type':Sequelize[_0x290b('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x290b('0x5')},'description':{'type':Sequelize[_0x290b('0x1')]},'title':{'type':Sequelize[_0x290b('0x1')]},'remoteUri':{'type':Sequelize[_0x290b('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 6ce2002..aaabdbc 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 _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1a37,0xb4));var _0x71a3=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1a37[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file +var _0xd943=['mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','Integration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x302e2c,_0x1fdfc3){var _0x19a45d=function(_0x4482f5){while(--_0x4482f5){_0x302e2c['push'](_0x302e2c['shift']());}};_0x19a45d(++_0x1fdfc3);}(_0xd943,0x15d));var _0x3d94=function(_0x588f67,_0xaa4ee5){_0x588f67=_0x588f67-0x0;var _0x3dc24b=_0xd943[_0x588f67];return _0x3dc24b;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b144f41..81aa304 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 _0x9355=['exports','define','Integration','integrations','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x1afaab,_0x30af9e){var _0x140335=function(_0x3dba0){while(--_0x3dba0){_0x1afaab['push'](_0x1afaab['shift']());}};_0x140335(++_0x30af9e);}(_0x9355,0x16c));var _0x5935=function(_0x4ee88e,_0x1b0c23){_0x4ee88e=_0x4ee88e-0x0;var _0x1f688a=_0x9355[_0x4ee88e];return _0x1f688a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5935('0x0'))(_0x5935('0x1'));var moment=require(_0x5935('0x2'));var BPromise=require('bluebird');var rp=require(_0x5935('0x3'));var fs=require('fs');var path=require(_0x5935('0x4'));var rimraf=require('rimraf');var config=require(_0x5935('0x5'));var attributes=require('./integration.attributes');module[_0x5935('0x6')]=function(_0x5de61c,_0x3dcd63){return _0x5de61c[_0x5935('0x7')](_0x5935('0x8'),attributes,{'tableName':_0x5935('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa537=['integrations','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xa537,0x1d5));var _0x7a53=function(_0x5caf0b,_0x1f14c6){_0x5caf0b=_0x5caf0b-0x0;var _0x12b542=_0xa537[_0x5caf0b];return _0x12b542;};'use strict';var _=require(_0x7a53('0x0'));var util=require('util');var logger=require(_0x7a53('0x1'))(_0x7a53('0x2'));var moment=require(_0x7a53('0x3'));var BPromise=require(_0x7a53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a53('0x5'));var rimraf=require('rimraf');var config=require(_0x7a53('0x6'));var attributes=require(_0x7a53('0x7'));module[_0x7a53('0x8')]=function(_0x5c322d,_0x511837){return _0x5c322d[_0x7a53('0x9')](_0x7a53('0xa'),attributes,{'tableName':_0x7a53('0xb'),'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 ee87311..09a3b02 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4a931d,_0x40f190){var _0x20a93e=function(_0x10a6b5){while(--_0x10a6b5){_0x4a931d['push'](_0x4a931d['shift']());}};_0x20a93e(++_0x40f190);}(_0x66fa,0x117));var _0xa66f=function(_0x5e7118,_0x691cb3){_0x5e7118=_0x5e7118-0x0;var _0x1a6a4e=_0x66fa[_0x5e7118];return _0x1a6a4e;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3915f4,_0x4ad379){var _0x3d46c0=function(_0x2a8d22){while(--_0x2a8d22){_0x3915f4['push'](_0x3915f4['shift']());}};_0x3d46c0(++_0x4ad379);}(_0x57ca,0x108));var _0xa57c=function(_0x5ee893,_0x260e68){_0x5ee893=_0x5ee893-0x0;var _0x79ab0e=_0x57ca[_0x5ee893];return _0x79ab0e;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5856915..64a3eab 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x1774c2,_0x352f65){var _0x1c0cf8=function(_0x23d188){while(--_0x23d188){_0x1774c2['push'](_0x1774c2['shift']());}};_0x1c0cf8(++_0x352f65);}(_0xba34,0x119));var _0x4ba3=function(_0x53195d,_0x3b4f79){_0x53195d=_0x53195d-0x0;var _0x2aebd3=_0xba34[_0x53195d];return _0x2aebd3;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xdb28,0x106));var _0x8db2=function(_0x4a3929,_0x2a7cfa){_0x4a3929=_0x4a3929-0x0;var _0x14d0d8=_0xdb28[_0x4a3929];return _0x14d0d8;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 780eae6..c837407 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 _0xe6ee=['TEXT','ENUM','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x38ff33,_0x219bdc){var _0x4c0ae3=function(_0x5290d5){while(--_0x5290d5){_0x38ff33['push'](_0x38ff33['shift']());}};_0x4c0ae3(++_0x219bdc);}(_0xe6ee,0x68));var _0xee6e=function(_0x391c58,_0x384957){_0x391c58=_0x391c58-0x0;var _0xce59da=_0xe6ee[_0x391c58];return _0xce59da;};'use strict';var Sequelize=require(_0xee6e('0x0'));module[_0xee6e('0x1')]={'integration':{'type':Sequelize[_0xee6e('0x2')]},'eventChannel':{'type':Sequelize[_0xee6e('0x2')]},'exitStatus':{'type':Sequelize[_0xee6e('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xee6e('0x3')]},'contacts':{'type':Sequelize[_0xee6e('0x2')]},'uniqueid':{'type':Sequelize[_0xee6e('0x2')]},'calleridnum':{'type':Sequelize[_0xee6e('0x2')]},'calleridname':{'type':Sequelize[_0xee6e('0x2')]},'queue':{'type':Sequelize[_0xee6e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xee6e('0x2')]},'agentcalledAt':{'type':Sequelize[_0xee6e('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xee6e('0x3')]},'agentcomplete':{'type':Sequelize[_0xee6e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xee6e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xee6e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xee6e('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xee6e('0x4')]},'lastevent':{'type':Sequelize[_0xee6e('0x2')]},'channel':{'type':Sequelize[_0xee6e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xee6e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xee6e('0x2')]},'accountcode':{'type':Sequelize[_0xee6e('0x2')]},'context':{'type':Sequelize[_0xee6e('0x2')]},'exten':{'type':Sequelize[_0xee6e('0x2')]},'priority':{'type':Sequelize[_0xee6e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xee6e('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xee6e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xee6e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xee6e('0x2')]},'destlanguage':{'type':Sequelize[_0xee6e('0x2')]},'destaccountcode':{'type':Sequelize[_0xee6e('0x2')]},'destcontext':{'type':Sequelize[_0xee6e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xee6e('0x2')]},'messageId':{'type':Sequelize[_0xee6e('0x2')]},'inReplyTo':{'type':Sequelize[_0xee6e('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xee6e('0x2')]},'to':{'type':Sequelize[_0xee6e('0x2')]},'cc':{'type':Sequelize[_0xee6e('0x2')]},'attachment':{'type':Sequelize[_0xee6e('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xee6e('0x6')]},'status':{'type':Sequelize[_0xee6e('0x7')]('SENT','SENDING',_0xee6e('0x8'),_0xee6e('0x9'))},'url':{'type':Sequelize[_0xee6e('0x2')]},'app':{'type':Sequelize[_0xee6e('0x2')]},'appdata':{'type':Sequelize[_0xee6e('0x2')]},'projectId':{'type':Sequelize[_0xee6e('0x3')]}}; \ No newline at end of file +var _0xd5c5=['SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x4fa7a3,_0x4514b7){var _0x207c87=function(_0xe59fb9){while(--_0xe59fb9){_0x4fa7a3['push'](_0x4fa7a3['shift']());}};_0x207c87(++_0x4514b7);}(_0xd5c5,0x1e7));var _0x5d5c=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xd5c5[_0x349367];return _0x14179b;};'use strict';var Sequelize=require('sequelize');module[_0x5d5c('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x5d5c('0x1')]},'exitStatus':{'type':Sequelize[_0x5d5c('0x1')]},'ticketId':{'type':Sequelize[_0x5d5c('0x1')]},'integrationId':{'type':Sequelize[_0x5d5c('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5d5c('0x1')]},'calleridnum':{'type':Sequelize[_0x5d5c('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5d5c('0x1')]},'interface':{'type':Sequelize[_0x5d5c('0x1')]},'membername':{'type':Sequelize[_0x5d5c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5d5c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5d5c('0x3')]},'holdtime':{'type':Sequelize[_0x5d5c('0x2')]},'agentcomplete':{'type':Sequelize[_0x5d5c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5d5c('0x3')]},'talktime':{'type':Sequelize[_0x5d5c('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5d5c('0x2')]},'reason':{'type':Sequelize[_0x5d5c('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5d5c('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5d5c('0x1')]},'channel':{'type':Sequelize[_0x5d5c('0x1')]},'channelstate':{'type':Sequelize[_0x5d5c('0x2')]},'channelstatedesc':{'type':Sequelize[_0x5d5c('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5d5c('0x1')]},'connectedlinename':{'type':Sequelize[_0x5d5c('0x1')]},'language':{'type':Sequelize[_0x5d5c('0x1')]},'accountcode':{'type':Sequelize[_0x5d5c('0x1')]},'context':{'type':Sequelize[_0x5d5c('0x1')]},'exten':{'type':Sequelize[_0x5d5c('0x1')]},'priority':{'type':Sequelize[_0x5d5c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5d5c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x5d5c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x5d5c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5d5c('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5d5c('0x1')]},'destuniqueid':{'type':Sequelize[_0x5d5c('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x5d5c('0x1')]},'subject':{'type':Sequelize[_0x5d5c('0x1')]},'from':{'type':Sequelize[_0x5d5c('0x1')]},'to':{'type':Sequelize[_0x5d5c('0x1')]},'cc':{'type':Sequelize[_0x5d5c('0x1')]},'attachment':{'type':Sequelize[_0x5d5c('0x5')]},'html':{'type':Sequelize[_0x5d5c('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x5d5c('0x6')](_0x5d5c('0x7'),_0x5d5c('0x8'),_0x5d5c('0x9'),_0x5d5c('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5d5c('0x1')]},'appdata':{'type':Sequelize[_0x5d5c('0x1')]},'projectId':{'type':Sequelize[_0x5d5c('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f4e29cc..bbcf3e4 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 _0xcf48=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','set','apply','reject','save','update','then','error','stack','name','send','map','IntegrationReport','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcf48,0x11c));var _0x8cf4=function(_0x33056d,_0x4ab398){_0x33056d=_0x33056d-0x0;var _0x474db8=_0xcf48[_0x33056d];return _0x474db8;};'use strict';var emlformat=require(_0x8cf4('0x0'));var rimraf=require(_0x8cf4('0x1'));var zipdir=require(_0x8cf4('0x2'));var jsonpatch=require(_0x8cf4('0x3'));var rp=require(_0x8cf4('0x4'));var moment=require(_0x8cf4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8cf4('0x6'));var util=require(_0x8cf4('0x7'));var path=require(_0x8cf4('0x8'));var sox=require(_0x8cf4('0x9'));var csv=require(_0x8cf4('0xa'));var ejs=require(_0x8cf4('0xb'));var fs=require('fs');var fs_extra=require(_0x8cf4('0xc'));var _=require(_0x8cf4('0xd'));var squel=require(_0x8cf4('0xe'));var crypto=require('crypto');var jsforce=require(_0x8cf4('0xf'));var deskjs=require(_0x8cf4('0x10'));var toCsv=require(_0x8cf4('0xa'));var querystring=require(_0x8cf4('0x11'));var Papa=require(_0x8cf4('0x12'));var Redis=require(_0x8cf4('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cf4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cf4('0x15'))(_0x8cf4('0x16'));var utils=require(_0x8cf4('0x17'));var config=require(_0x8cf4('0x18'));var licenseUtil=require(_0x8cf4('0x19'));var db=require(_0x8cf4('0x1a'))['db'];function respondWithStatusCode(_0x54b16f,_0x20c878){_0x20c878=_0x20c878||0xcc;return function(_0x245f06){if(_0x245f06){return _0x54b16f['sendStatus'](_0x20c878);}return _0x54b16f[_0x8cf4('0x1b')](_0x20c878)[_0x8cf4('0x1c')]();};}function respondWithResult(_0x1083a5,_0x35bf00){_0x35bf00=_0x35bf00||0xc8;return function(_0x29783f){if(_0x29783f){return _0x1083a5[_0x8cf4('0x1b')](_0x35bf00)[_0x8cf4('0x1d')](_0x29783f);}};}function respondWithFilteredResult(_0x53ac87,_0x21c6af){return function(_0x4f9ed7){if(_0x4f9ed7){var _0x293281=typeof _0x21c6af['offset']==='undefined'&&typeof _0x21c6af['limit']==='undefined';var _0x562e2f=_0x4f9ed7['count'];var _0x120d8a=_0x293281?0x0:_0x21c6af[_0x8cf4('0x1e')];var _0x17be4f=_0x293281?_0x4f9ed7[_0x8cf4('0x1f')]:_0x21c6af[_0x8cf4('0x1e')]+_0x21c6af[_0x8cf4('0x20')];var _0x43e597;if(_0x17be4f>=_0x562e2f){_0x17be4f=_0x562e2f;_0x43e597=0xc8;}else{_0x43e597=0xce;}_0x53ac87[_0x8cf4('0x1b')](_0x43e597);return _0x53ac87[_0x8cf4('0x21')]('Content-Range',_0x120d8a+'-'+_0x17be4f+'/'+_0x562e2f)['json'](_0x4f9ed7);}return null;};}function patchUpdates(_0x2e92c7){return function(_0x401813){try{jsonpatch[_0x8cf4('0x22')](_0x401813,_0x2e92c7,!![]);}catch(_0x2c036b){return BPromise[_0x8cf4('0x23')](_0x2c036b);}return _0x401813[_0x8cf4('0x24')]();};}function saveUpdates(_0x22d284,_0x52a75f){return function(_0x9c4770){if(_0x9c4770){return _0x9c4770[_0x8cf4('0x25')](_0x22d284)[_0x8cf4('0x26')](function(_0xff9d0e){return _0xff9d0e;});}return null;};}function removeEntity(_0x2d5a73,_0x143bac){return function(_0x3e792f){if(_0x3e792f){return _0x3e792f['destroy']()[_0x8cf4('0x26')](function(){_0x2d5a73[_0x8cf4('0x1b')](0xcc)[_0x8cf4('0x1c')]();});}};}function handleEntityNotFound(_0x2d3ac7,_0x2eec9b){return function(_0x455c72){if(!_0x455c72){_0x2d3ac7['sendStatus'](0x194);}return _0x455c72;};}function handleError(_0x523034,_0x5448d1){_0x5448d1=_0x5448d1||0x1f4;return function(_0xf6792e){logger[_0x8cf4('0x27')](_0xf6792e[_0x8cf4('0x28')]);if(_0xf6792e['name']){delete _0xf6792e[_0x8cf4('0x29')];}_0x523034['status'](_0x5448d1)[_0x8cf4('0x2a')](_0xf6792e);};}exports['index']=function(_0x438e06,_0x8d316f){var _0x1d0422={},_0x564045={},_0x18d632={'count':0x0,'rows':[]};var _0x23701c=_[_0x8cf4('0x2b')](db[_0x8cf4('0x2c')]['rawAttributes'],function(_0x47d89f){return{'name':_0x47d89f[_0x8cf4('0x2d')],'type':_0x47d89f[_0x8cf4('0x2e')]['key']};});_0x564045[_0x8cf4('0x2f')]=_[_0x8cf4('0x2b')](_0x23701c,_0x8cf4('0x29'));_0x564045['query']=_['keys'](_0x438e06[_0x8cf4('0x30')]);_0x564045[_0x8cf4('0x31')]=_['intersection'](_0x564045[_0x8cf4('0x2f')],_0x564045[_0x8cf4('0x30')]);_0x1d0422['attributes']=_[_0x8cf4('0x32')](_0x564045[_0x8cf4('0x2f')],qs[_0x8cf4('0x33')](_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x33')]));_0x1d0422[_0x8cf4('0x34')]=_0x1d0422[_0x8cf4('0x34')]['length']?_0x1d0422[_0x8cf4('0x34')]:_0x564045['model'];if(!_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x35')](_0x8cf4('0x36'))){_0x1d0422[_0x8cf4('0x20')]=qs[_0x8cf4('0x20')](_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x20')]);_0x1d0422['offset']=qs[_0x8cf4('0x1e')](_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x1e')]);}_0x1d0422[_0x8cf4('0x37')]=qs[_0x8cf4('0x38')](_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x38')]);_0x1d0422[_0x8cf4('0x39')]=qs[_0x8cf4('0x31')](_[_0x8cf4('0x3a')](_0x438e06[_0x8cf4('0x30')],_0x564045[_0x8cf4('0x31')]),_0x23701c);if(_0x438e06['query'][_0x8cf4('0x3b')]){_0x1d0422[_0x8cf4('0x39')]=_['merge'](_0x1d0422[_0x8cf4('0x39')],{'$or':_[_0x8cf4('0x2b')](_0x23701c,function(_0x1aaedd){if(_0x1aaedd['type']!=='VIRTUAL'){var _0x770678={};_0x770678[_0x1aaedd[_0x8cf4('0x29')]]={'$like':'%'+_0x438e06['query'][_0x8cf4('0x3b')]+'%'};return _0x770678;}})});}_0x1d0422=_[_0x8cf4('0x3c')]({},_0x1d0422,_0x438e06[_0x8cf4('0x3d')]);var _0x4c5c59={'where':_0x1d0422[_0x8cf4('0x39')]};return db['IntegrationReport'][_0x8cf4('0x1f')](_0x4c5c59)['then'](function(_0x4878de){_0x18d632[_0x8cf4('0x1f')]=_0x4878de;if(_0x438e06[_0x8cf4('0x30')][_0x8cf4('0x3e')]){_0x1d0422[_0x8cf4('0x3f')]=[{'all':!![]}];}return db[_0x8cf4('0x2c')][_0x8cf4('0x40')](_0x1d0422);})[_0x8cf4('0x26')](function(_0x176437){_0x18d632['rows']=_0x176437;return _0x18d632;})[_0x8cf4('0x26')](respondWithFilteredResult(_0x8d316f,_0x1d0422))[_0x8cf4('0x41')](handleError(_0x8d316f,null));};exports[_0x8cf4('0x42')]=function(_0x5a9a7c,_0x3c8bd3){var _0x22328c={'raw':![],'where':{'id':_0x5a9a7c[_0x8cf4('0x43')]['id']}},_0x196da3={};_0x196da3['model']=_[_0x8cf4('0x44')](db[_0x8cf4('0x2c')][_0x8cf4('0x45')]);_0x196da3['query']=_['keys'](_0x5a9a7c[_0x8cf4('0x30')]);_0x196da3[_0x8cf4('0x31')]=_[_0x8cf4('0x32')](_0x196da3['model'],_0x196da3[_0x8cf4('0x30')]);_0x22328c['attributes']=_[_0x8cf4('0x32')](_0x196da3[_0x8cf4('0x2f')],qs[_0x8cf4('0x33')](_0x5a9a7c['query'][_0x8cf4('0x33')]));_0x22328c[_0x8cf4('0x34')]=_0x22328c[_0x8cf4('0x34')][_0x8cf4('0x46')]?_0x22328c[_0x8cf4('0x34')]:_0x196da3[_0x8cf4('0x2f')];if(_0x5a9a7c['query'][_0x8cf4('0x3e')]){_0x22328c[_0x8cf4('0x3f')]=[{'all':!![]}];}_0x22328c=_['merge']({},_0x22328c,_0x5a9a7c['options']);return db['IntegrationReport'][_0x8cf4('0x47')](_0x22328c)[_0x8cf4('0x26')](handleEntityNotFound(_0x3c8bd3,null))['then'](respondWithResult(_0x3c8bd3,null))[_0x8cf4('0x41')](handleError(_0x3c8bd3,null));};exports[_0x8cf4('0x48')]=function(_0x133ea0,_0x209b95){return db[_0x8cf4('0x2c')][_0x8cf4('0x48')](_0x133ea0[_0x8cf4('0x49')],{})[_0x8cf4('0x26')](respondWithResult(_0x209b95,0xc9))['catch'](handleError(_0x209b95,null));};exports[_0x8cf4('0x25')]=function(_0x2f60a1,_0x565347){if(_0x2f60a1[_0x8cf4('0x49')]['id']){delete _0x2f60a1[_0x8cf4('0x49')]['id'];}return db[_0x8cf4('0x2c')][_0x8cf4('0x47')]({'where':{'id':_0x2f60a1['params']['id']}})[_0x8cf4('0x26')](handleEntityNotFound(_0x565347,null))[_0x8cf4('0x26')](saveUpdates(_0x2f60a1[_0x8cf4('0x49')],null))[_0x8cf4('0x26')](respondWithResult(_0x565347,null))[_0x8cf4('0x41')](handleError(_0x565347,null));};exports[_0x8cf4('0x4a')]=function(_0x394f64,_0x2d8d92){return db[_0x8cf4('0x2c')]['find']({'where':{'id':_0x394f64[_0x8cf4('0x43')]['id']}})[_0x8cf4('0x26')](handleEntityNotFound(_0x2d8d92,null))[_0x8cf4('0x26')](removeEntity(_0x2d8d92,null))[_0x8cf4('0x41')](handleError(_0x2d8d92,null));};exports[_0x8cf4('0x4b')]=function(_0x18c091,_0x45300a){return db[_0x8cf4('0x2c')][_0x8cf4('0x4b')]()[_0x8cf4('0x26')](respondWithResult(_0x45300a,null))[_0x8cf4('0x41')](handleError(_0x45300a,null));}; \ No newline at end of file +var _0x1014=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x14ff54,_0xcd0dc6){var _0xb6e056=function(_0x136d45){while(--_0x136d45){_0x14ff54['push'](_0x14ff54['shift']());}};_0xb6e056(++_0xcd0dc6);}(_0x1014,0x11f));var _0x4101=function(_0x3b0209,_0x1048cd){_0x3b0209=_0x3b0209-0x0;var _0xf6c555=_0x1014[_0x3b0209];return _0xf6c555;};'use strict';var emlformat=require(_0x4101('0x0'));var rimraf=require(_0x4101('0x1'));var zipdir=require(_0x4101('0x2'));var jsonpatch=require(_0x4101('0x3'));var rp=require(_0x4101('0x4'));var moment=require(_0x4101('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4101('0x6'));var util=require(_0x4101('0x7'));var path=require('path');var sox=require(_0x4101('0x8'));var csv=require(_0x4101('0x9'));var ejs=require(_0x4101('0xa'));var fs=require('fs');var fs_extra=require(_0x4101('0xb'));var _=require(_0x4101('0xc'));var squel=require('squel');var crypto=require(_0x4101('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4101('0xe'));var toCsv=require(_0x4101('0x9'));var querystring=require(_0x4101('0xf'));var Papa=require(_0x4101('0x10'));var Redis=require('ioredis');var authService=require(_0x4101('0x11'));var qs=require(_0x4101('0x12'));var as=require(_0x4101('0x13'));var hardwareService=require(_0x4101('0x14'));var logger=require('../../config/logger')(_0x4101('0x15'));var utils=require('../../config/utils');var config=require(_0x4101('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4101('0x17'))['db'];function respondWithStatusCode(_0x508e9e,_0x8e2d1){_0x8e2d1=_0x8e2d1||0xcc;return function(_0xc8f84){if(_0xc8f84){return _0x508e9e['sendStatus'](_0x8e2d1);}return _0x508e9e[_0x4101('0x18')](_0x8e2d1)[_0x4101('0x19')]();};}function respondWithResult(_0x427b99,_0x184c7c){_0x184c7c=_0x184c7c||0xc8;return function(_0x20c6e0){if(_0x20c6e0){return _0x427b99[_0x4101('0x18')](_0x184c7c)[_0x4101('0x1a')](_0x20c6e0);}};}function respondWithFilteredResult(_0x5ddb06,_0x4235a9){return function(_0x46f804){if(_0x46f804){var _0xe9e6e4=typeof _0x4235a9[_0x4101('0x1b')]===_0x4101('0x1c')&&typeof _0x4235a9['limit']===_0x4101('0x1c');var _0x1249ee=_0x46f804['count'];var _0x452c7a=_0xe9e6e4?0x0:_0x4235a9['offset'];var _0x389038=_0xe9e6e4?_0x46f804[_0x4101('0x1d')]:_0x4235a9[_0x4101('0x1b')]+_0x4235a9[_0x4101('0x1e')];var _0x424835;if(_0x389038>=_0x1249ee){_0x389038=_0x1249ee;_0x424835=0xc8;}else{_0x424835=0xce;}_0x5ddb06[_0x4101('0x18')](_0x424835);return _0x5ddb06[_0x4101('0x1f')](_0x4101('0x20'),_0x452c7a+'-'+_0x389038+'/'+_0x1249ee)[_0x4101('0x1a')](_0x46f804);}return null;};}function patchUpdates(_0x41e7a1){return function(_0x204b8e){try{jsonpatch['apply'](_0x204b8e,_0x41e7a1,!![]);}catch(_0x3ec023){return BPromise['reject'](_0x3ec023);}return _0x204b8e[_0x4101('0x21')]();};}function saveUpdates(_0x36de05,_0x45c9e8){return function(_0x32ffc0){if(_0x32ffc0){return _0x32ffc0['update'](_0x36de05)[_0x4101('0x22')](function(_0x55d3ba){return _0x55d3ba;});}return null;};}function removeEntity(_0x519058,_0x212357){return function(_0x2d47bf){if(_0x2d47bf){return _0x2d47bf['destroy']()[_0x4101('0x22')](function(){_0x519058['status'](0xcc)[_0x4101('0x19')]();});}};}function handleEntityNotFound(_0x524dc2,_0x514851){return function(_0x1ebefa){if(!_0x1ebefa){_0x524dc2[_0x4101('0x23')](0x194);}return _0x1ebefa;};}function handleError(_0x55d1be,_0x48813a){_0x48813a=_0x48813a||0x1f4;return function(_0x4e528a){logger[_0x4101('0x24')](_0x4e528a[_0x4101('0x25')]);if(_0x4e528a[_0x4101('0x26')]){delete _0x4e528a['name'];}_0x55d1be[_0x4101('0x18')](_0x48813a)[_0x4101('0x27')](_0x4e528a);};}exports[_0x4101('0x28')]=function(_0x8b50a,_0x357790){var _0xa7cf3={},_0x4dff77={},_0x20d707={'count':0x0,'rows':[]};var _0x4901d6=_[_0x4101('0x29')](db[_0x4101('0x2a')][_0x4101('0x2b')],function(_0x41a0aa){return{'name':_0x41a0aa[_0x4101('0x2c')],'type':_0x41a0aa['type'][_0x4101('0x2d')]};});_0x4dff77['model']=_[_0x4101('0x29')](_0x4901d6,_0x4101('0x26'));_0x4dff77[_0x4101('0x2e')]=_[_0x4101('0x2f')](_0x8b50a[_0x4101('0x2e')]);_0x4dff77[_0x4101('0x30')]=_['intersection'](_0x4dff77[_0x4101('0x31')],_0x4dff77['query']);_0xa7cf3[_0x4101('0x32')]=_[_0x4101('0x33')](_0x4dff77[_0x4101('0x31')],qs[_0x4101('0x34')](_0x8b50a[_0x4101('0x2e')][_0x4101('0x34')]));_0xa7cf3['attributes']=_0xa7cf3[_0x4101('0x32')][_0x4101('0x35')]?_0xa7cf3[_0x4101('0x32')]:_0x4dff77['model'];if(!_0x8b50a[_0x4101('0x2e')][_0x4101('0x36')](_0x4101('0x37'))){_0xa7cf3[_0x4101('0x1e')]=qs[_0x4101('0x1e')](_0x8b50a[_0x4101('0x2e')]['limit']);_0xa7cf3[_0x4101('0x1b')]=qs['offset'](_0x8b50a[_0x4101('0x2e')]['offset']);}_0xa7cf3['order']=qs[_0x4101('0x38')](_0x8b50a[_0x4101('0x2e')]['sort']);_0xa7cf3[_0x4101('0x39')]=qs[_0x4101('0x30')](_[_0x4101('0x3a')](_0x8b50a[_0x4101('0x2e')],_0x4dff77[_0x4101('0x30')]),_0x4901d6);if(_0x8b50a[_0x4101('0x2e')]['filter']){_0xa7cf3[_0x4101('0x39')]=_[_0x4101('0x3b')](_0xa7cf3[_0x4101('0x39')],{'$or':_[_0x4101('0x29')](_0x4901d6,function(_0x367561){if(_0x367561[_0x4101('0x3c')]!==_0x4101('0x3d')){var _0x4bfab6={};_0x4bfab6[_0x367561[_0x4101('0x26')]]={'$like':'%'+_0x8b50a['query']['filter']+'%'};return _0x4bfab6;}})});}_0xa7cf3=_[_0x4101('0x3b')]({},_0xa7cf3,_0x8b50a[_0x4101('0x3e')]);var _0x172dd4={'where':_0xa7cf3[_0x4101('0x39')]};return db[_0x4101('0x2a')]['count'](_0x172dd4)[_0x4101('0x22')](function(_0x3156be){_0x20d707['count']=_0x3156be;if(_0x8b50a[_0x4101('0x2e')][_0x4101('0x3f')]){_0xa7cf3[_0x4101('0x40')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xa7cf3);})[_0x4101('0x22')](function(_0x2c1dad){_0x20d707[_0x4101('0x41')]=_0x2c1dad;return _0x20d707;})['then'](respondWithFilteredResult(_0x357790,_0xa7cf3))[_0x4101('0x42')](handleError(_0x357790,null));};exports[_0x4101('0x43')]=function(_0x551e33,_0x2e7c50){var _0x2a5661={'raw':![],'where':{'id':_0x551e33[_0x4101('0x44')]['id']}},_0x3b3802={};_0x3b3802[_0x4101('0x31')]=_[_0x4101('0x2f')](db[_0x4101('0x2a')][_0x4101('0x2b')]);_0x3b3802[_0x4101('0x2e')]=_[_0x4101('0x2f')](_0x551e33[_0x4101('0x2e')]);_0x3b3802[_0x4101('0x30')]=_['intersection'](_0x3b3802['model'],_0x3b3802[_0x4101('0x2e')]);_0x2a5661[_0x4101('0x32')]=_[_0x4101('0x33')](_0x3b3802[_0x4101('0x31')],qs[_0x4101('0x34')](_0x551e33[_0x4101('0x2e')]['fields']));_0x2a5661[_0x4101('0x32')]=_0x2a5661['attributes'][_0x4101('0x35')]?_0x2a5661[_0x4101('0x32')]:_0x3b3802['model'];if(_0x551e33[_0x4101('0x2e')][_0x4101('0x3f')]){_0x2a5661[_0x4101('0x40')]=[{'all':!![]}];}_0x2a5661=_[_0x4101('0x3b')]({},_0x2a5661,_0x551e33['options']);return db[_0x4101('0x2a')][_0x4101('0x45')](_0x2a5661)['then'](handleEntityNotFound(_0x2e7c50,null))[_0x4101('0x22')](respondWithResult(_0x2e7c50,null))[_0x4101('0x42')](handleError(_0x2e7c50,null));};exports['create']=function(_0x2511ad,_0x502a19){return db['IntegrationReport'][_0x4101('0x46')](_0x2511ad[_0x4101('0x47')],{})[_0x4101('0x22')](respondWithResult(_0x502a19,0xc9))[_0x4101('0x42')](handleError(_0x502a19,null));};exports[_0x4101('0x48')]=function(_0x35f8f5,_0x58ab6b){if(_0x35f8f5[_0x4101('0x47')]['id']){delete _0x35f8f5[_0x4101('0x47')]['id'];}return db[_0x4101('0x2a')]['find']({'where':{'id':_0x35f8f5[_0x4101('0x44')]['id']}})[_0x4101('0x22')](handleEntityNotFound(_0x58ab6b,null))[_0x4101('0x22')](saveUpdates(_0x35f8f5[_0x4101('0x47')],null))[_0x4101('0x22')](respondWithResult(_0x58ab6b,null))[_0x4101('0x42')](handleError(_0x58ab6b,null));};exports[_0x4101('0x49')]=function(_0x18898f,_0x1b533a){return db[_0x4101('0x2a')]['find']({'where':{'id':_0x18898f[_0x4101('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b533a,null))[_0x4101('0x22')](removeEntity(_0x1b533a,null))[_0x4101('0x42')](handleError(_0x1b533a,null));};exports[_0x4101('0x4a')]=function(_0x2bbe2a,_0x58708e){return db[_0x4101('0x2a')][_0x4101('0x4a')]()[_0x4101('0x22')](respondWithResult(_0x58708e,null))[_0x4101('0x42')](handleError(_0x58708e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b78d02b..890511b 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 _0x0296=['path','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','request-promise'];(function(_0x204d95,_0x2568c1){var _0x57c193=function(_0x11e497){while(--_0x11e497){_0x204d95['push'](_0x204d95['shift']());}};_0x57c193(++_0x2568c1);}(_0x0296,0x1a8));var _0x6029=function(_0x2317af,_0x1332d3){_0x2317af=_0x2317af-0x0;var _0x3cb58d=_0x0296[_0x2317af];return _0x3cb58d;};'use strict';var _=require('lodash');var util=require(_0x6029('0x0'));var logger=require(_0x6029('0x1'))(_0x6029('0x2'));var moment=require('moment');var BPromise=require(_0x6029('0x3'));var rp=require(_0x6029('0x4'));var fs=require('fs');var path=require(_0x6029('0x5'));var rimraf=require('rimraf');var config=require(_0x6029('0x6'));var attributes=require(_0x6029('0x7'));module['exports']=function(_0x1171ae,_0xeae8d6){return _0x1171ae[_0x6029('0x8')](_0x6029('0x9'),attributes,{'tableName':_0x6029('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ad=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x05ad,0x109));var _0xd05a=function(_0x140c8a,_0x14fb5b){_0x140c8a=_0x140c8a-0x0;var _0x391e5d=_0x05ad[_0x140c8a];return _0x391e5d;};'use strict';var _=require(_0xd05a('0x0'));var util=require(_0xd05a('0x1'));var logger=require(_0xd05a('0x2'))(_0xd05a('0x3'));var moment=require(_0xd05a('0x4'));var BPromise=require('bluebird');var rp=require(_0xd05a('0x5'));var fs=require('fs');var path=require(_0xd05a('0x6'));var rimraf=require(_0xd05a('0x7'));var config=require(_0xd05a('0x8'));var attributes=require(_0xd05a('0x9'));module[_0xd05a('0xa')]=function(_0x115b58,_0x1663ab){return _0x115b58['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index fdefa0e..e50e376 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 _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x814b,0x1a2));var _0xb814=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x814b[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x150ee9,_0x3b68ed){var _0x5d41dc=function(_0x343012){while(--_0x343012){_0x150ee9['push'](_0x150ee9['shift']());}};_0x5d41dc(++_0x3b68ed);}(_0x2ef3,0xba));var _0x32ef=function(_0xc948c5,_0x243618){_0xc948c5=_0xc948c5-0x0;var _0x7b937f=_0x2ef3[_0xc948c5];return _0x7b937f;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index dd66d17..8f43d6e 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 _0x04cc=['/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show'];(function(_0x4c73ac,_0x2e2ed2){var _0xd73127=function(_0x252e16){while(--_0x252e16){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0xd73127(++_0x2e2ed2);}(_0x04cc,0x11a));var _0xc04c=function(_0x34f1a2,_0x1f7b1c){_0x34f1a2=_0x34f1a2-0x0;var _0x2572b9=_0x04cc[_0x34f1a2];return _0x2572b9;};'use strict';var multer=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var path=require(_0xc04c('0x2'));var timeout=require(_0xc04c('0x3'));var express=require('express');var router=express[_0xc04c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc04c('0x5'));var config=require(_0xc04c('0x6'));var controller=require(_0xc04c('0x7'));router[_0xc04c('0x8')]('/',auth[_0xc04c('0x9')](),controller[_0xc04c('0xa')]);router[_0xc04c('0x8')]('/:id',auth[_0xc04c('0x9')](),controller[_0xc04c('0xb')]);router[_0xc04c('0x8')](_0xc04c('0xc'),auth[_0xc04c('0x9')](),controller[_0xc04c('0xd')]);router[_0xc04c('0xe')]('/',auth[_0xc04c('0x9')](),controller['create']);router['post'](_0xc04c('0xc'),auth[_0xc04c('0x9')](),controller[_0xc04c('0xf')]);router[_0xc04c('0xe')](_0xc04c('0x10'),auth[_0xc04c('0x9')](),controller[_0xc04c('0x11')]);router['put']('/:id',auth[_0xc04c('0x9')](),controller['update']);router[_0xc04c('0x12')](_0xc04c('0x13'),auth[_0xc04c('0x9')](),controller[_0xc04c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7412=['/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','isAuthenticated','index','get','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7412,0x161));var _0x2741=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7412[_0x59d89e];return _0x554e93;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();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('./interval.controller');router['get']('/',auth[_0x2741('0x3')](),controller[_0x2741('0x4')]);router[_0x2741('0x5')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0x6')]);router[_0x2741('0x5')](_0x2741('0x7'),auth['isAuthenticated'](),controller[_0x2741('0x8')]);router[_0x2741('0x9')]('/',auth[_0x2741('0x3')](),controller[_0x2741('0xa')]);router[_0x2741('0x9')]('/:id/sub_intervals',auth[_0x2741('0x3')](),controller[_0x2741('0xb')]);router[_0x2741('0x9')](_0x2741('0xc'),auth[_0x2741('0x3')](),controller[_0x2741('0xd')]);router[_0x2741('0xe')](_0x2741('0xf'),auth['isAuthenticated'](),controller[_0x2741('0x10')]);router[_0x2741('0x11')](_0x2741('0xf'),auth[_0x2741('0x3')](),controller[_0x2741('0x12')]);module[_0x2741('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 27bb24f..798605d 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 _0xeb86=['STRING','sequelize','exports'];(function(_0x262323,_0x4a81f1){var _0xa963c3=function(_0x5c715e){while(--_0x5c715e){_0x262323['push'](_0x262323['shift']());}};_0xa963c3(++_0x4a81f1);}(_0xeb86,0x1ba));var _0x6eb8=function(_0x4459a6,_0x1ba771){_0x4459a6=_0x4459a6-0x0;var _0x2d8cfc=_0xeb86[_0x4459a6];return _0x2d8cfc;};'use strict';var Sequelize=require(_0x6eb8('0x0'));module[_0x6eb8('0x1')]={'name':{'type':Sequelize[_0x6eb8('0x2')]},'description':{'type':Sequelize[_0x6eb8('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x48a2=['exports','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x48a2,0x1ca));var _0x248a=function(_0x3bbd1f,_0x119571){_0x3bbd1f=_0x3bbd1f-0x0;var _0x4cb1fe=_0x48a2[_0x3bbd1f];return _0x4cb1fe;};'use strict';var Sequelize=require('sequelize');module[_0x248a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x248a('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ed4d46f..a6c2652 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 _0x60c3=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','catch','show','params','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','update','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','offset','undefined','count','set','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','index','Interval','fieldName','type'];(function(_0x5e6ebe,_0x4893b7){var _0x46a33f=function(_0x5542c4){while(--_0x5542c4){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x46a33f(++_0x4893b7);}(_0x60c3,0x1e1));var _0x360c=function(_0x296816,_0x105e18){_0x296816=_0x296816-0x0;var _0x217a1f=_0x60c3[_0x296816];return _0x217a1f;};'use strict';var emlformat=require(_0x360c('0x0'));var rimraf=require(_0x360c('0x1'));var zipdir=require(_0x360c('0x2'));var jsonpatch=require(_0x360c('0x3'));var rp=require('request-promise');var moment=require(_0x360c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x360c('0x5'));var util=require(_0x360c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x360c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x360c('0x8'));var _=require('lodash');var squel=require(_0x360c('0x9'));var crypto=require(_0x360c('0xa'));var jsforce=require(_0x360c('0xb'));var deskjs=require(_0x360c('0xc'));var toCsv=require(_0x360c('0x7'));var querystring=require(_0x360c('0xd'));var Papa=require('papaparse');var Redis=require(_0x360c('0xe'));var authService=require(_0x360c('0xf'));var qs=require(_0x360c('0x10'));var as=require(_0x360c('0x11'));var hardwareService=require(_0x360c('0x12'));var logger=require(_0x360c('0x13'))(_0x360c('0x14'));var utils=require(_0x360c('0x15'));var config=require(_0x360c('0x16'));var licenseUtil=require(_0x360c('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x360c('0x18'));function respondWithStatusCode(_0x3cc7d0,_0x556f7a){_0x556f7a=_0x556f7a||0xcc;return function(_0x3260e8){if(_0x3260e8){return _0x3cc7d0['sendStatus'](_0x556f7a);}return _0x3cc7d0[_0x360c('0x19')](_0x556f7a)[_0x360c('0x1a')]();};}function respondWithResult(_0x4ba7e6,_0x1831a2){_0x1831a2=_0x1831a2||0xc8;return function(_0x5eb85e){if(_0x5eb85e){return _0x4ba7e6['status'](_0x1831a2)['json'](_0x5eb85e);}};}function respondWithFilteredResult(_0x3010de,_0x4b3889){return function(_0x22fbc6){if(_0x22fbc6){var _0x13b023=typeof _0x4b3889[_0x360c('0x1b')]==='undefined'&&typeof _0x4b3889['limit']===_0x360c('0x1c');var _0x4e231a=_0x22fbc6[_0x360c('0x1d')];var _0x4f4f99=_0x13b023?0x0:_0x4b3889[_0x360c('0x1b')];var _0x588bbf=_0x13b023?_0x22fbc6[_0x360c('0x1d')]:_0x4b3889['offset']+_0x4b3889['limit'];var _0xb08058;if(_0x588bbf>=_0x4e231a){_0x588bbf=_0x4e231a;_0xb08058=0xc8;}else{_0xb08058=0xce;}_0x3010de[_0x360c('0x19')](_0xb08058);return _0x3010de[_0x360c('0x1e')]('Content-Range',_0x4f4f99+'-'+_0x588bbf+'/'+_0x4e231a)['json'](_0x22fbc6);}return null;};}function patchUpdates(_0x14cded){return function(_0x3ba542){try{jsonpatch[_0x360c('0x1f')](_0x3ba542,_0x14cded,!![]);}catch(_0x3b3bea){return BPromise[_0x360c('0x20')](_0x3b3bea);}return _0x3ba542[_0x360c('0x21')]();};}function saveUpdates(_0xc5c889,_0x1341cc){return function(_0x20a9bb){if(_0x20a9bb){return _0x20a9bb['update'](_0xc5c889)[_0x360c('0x22')](function(_0x5355e5){return _0x5355e5;});}return null;};}function removeEntity(_0x3ade4c,_0x4c85b6){return function(_0x2ae877){if(_0x2ae877){return _0x2ae877[_0x360c('0x23')]()[_0x360c('0x22')](function(){var _0x2e854c=_0x2ae877[_0x360c('0x24')]({'plain':!![]});var _0x4868fd=_0x360c('0x25');return db[_0x360c('0x26')][_0x360c('0x23')]({'where':{'type':_0x4868fd,'resourceId':_0x2e854c['id']}})['then'](function(){return _0x2ae877;});})[_0x360c('0x22')](function(){_0x3ade4c[_0x360c('0x19')](0xcc)[_0x360c('0x1a')]();});}};}function handleEntityNotFound(_0x2c73df,_0x45e627){return function(_0xc70fce){if(!_0xc70fce){_0x2c73df[_0x360c('0x27')](0x194);}return _0xc70fce;};}function handleError(_0x469a29,_0x75f616){_0x75f616=_0x75f616||0x1f4;return function(_0x2200e3){logger['error'](_0x2200e3[_0x360c('0x28')]);if(_0x2200e3['name']){delete _0x2200e3[_0x360c('0x29')];}_0x469a29[_0x360c('0x19')](_0x75f616)[_0x360c('0x2a')](_0x2200e3);};}exports[_0x360c('0x2b')]=function(_0x4c304f,_0x37138e){var _0x2ef96d={},_0x18ea2b={},_0x140851={'count':0x0,'rows':[]};var _0x4d4c2c=_['map'](db[_0x360c('0x2c')]['rawAttributes'],function(_0x3d71ba){return{'name':_0x3d71ba[_0x360c('0x2d')],'type':_0x3d71ba[_0x360c('0x2e')]['key']};});_0x18ea2b[_0x360c('0x2f')]=_['map'](_0x4d4c2c,_0x360c('0x29'));_0x18ea2b['query']=_[_0x360c('0x30')](_0x4c304f['query']);_0x18ea2b[_0x360c('0x31')]=_[_0x360c('0x32')](_0x18ea2b[_0x360c('0x2f')],_0x18ea2b[_0x360c('0x33')]);_0x2ef96d[_0x360c('0x34')]=_[_0x360c('0x32')](_0x18ea2b[_0x360c('0x2f')],qs[_0x360c('0x35')](_0x4c304f[_0x360c('0x33')]['fields']));_0x2ef96d[_0x360c('0x34')]=_0x2ef96d[_0x360c('0x34')][_0x360c('0x36')]?_0x2ef96d['attributes']:_0x18ea2b[_0x360c('0x2f')];if(!_0x4c304f['query'][_0x360c('0x37')](_0x360c('0x38'))){_0x2ef96d[_0x360c('0x39')]=qs[_0x360c('0x39')](_0x4c304f['query']['limit']);_0x2ef96d[_0x360c('0x1b')]=qs[_0x360c('0x1b')](_0x4c304f[_0x360c('0x33')]['offset']);}_0x2ef96d[_0x360c('0x3a')]=qs[_0x360c('0x3b')](_0x4c304f[_0x360c('0x33')][_0x360c('0x3b')]);_0x2ef96d[_0x360c('0x3c')]=qs[_0x360c('0x31')](_[_0x360c('0x3d')](_0x4c304f[_0x360c('0x33')],_0x18ea2b[_0x360c('0x31')]),_0x4d4c2c);if(_0x4c304f[_0x360c('0x33')][_0x360c('0x3e')]){_0x2ef96d[_0x360c('0x3c')]=_[_0x360c('0x3f')](_0x2ef96d[_0x360c('0x3c')],{'$or':_[_0x360c('0x40')](_0x4d4c2c,function(_0x3c58a3){if(_0x3c58a3[_0x360c('0x2e')]!=='VIRTUAL'){var _0x2501ff={};_0x2501ff[_0x3c58a3[_0x360c('0x29')]]={'$like':'%'+_0x4c304f['query'][_0x360c('0x3e')]+'%'};return _0x2501ff;}})});}_0x2ef96d=_[_0x360c('0x3f')]({},_0x2ef96d,_0x4c304f[_0x360c('0x41')]);var _0x2111c1={'where':_0x2ef96d[_0x360c('0x3c')]};return db['Interval'][_0x360c('0x1d')](_0x2111c1)[_0x360c('0x22')](function(_0x22aebd){_0x140851[_0x360c('0x1d')]=_0x22aebd;if(_0x4c304f['query']['includeAll']){_0x2ef96d['include']=[{'all':!![]}];}return db[_0x360c('0x2c')]['findAll'](_0x2ef96d);})['then'](function(_0x881cb9){_0x140851['rows']=_0x881cb9;return _0x140851;})['then'](respondWithFilteredResult(_0x37138e,_0x2ef96d))[_0x360c('0x42')](handleError(_0x37138e,null));};exports[_0x360c('0x43')]=function(_0x3131a5,_0x56e898){var _0x1a8a3e={'raw':!![],'where':{'id':_0x3131a5[_0x360c('0x44')]['id']}},_0x2e576f={};_0x2e576f['model']=_[_0x360c('0x30')](db[_0x360c('0x2c')][_0x360c('0x45')]);_0x2e576f[_0x360c('0x33')]=_[_0x360c('0x30')](_0x3131a5[_0x360c('0x33')]);_0x2e576f[_0x360c('0x31')]=_[_0x360c('0x32')](_0x2e576f[_0x360c('0x2f')],_0x2e576f[_0x360c('0x33')]);_0x1a8a3e[_0x360c('0x34')]=_[_0x360c('0x32')](_0x2e576f[_0x360c('0x2f')],qs[_0x360c('0x35')](_0x3131a5[_0x360c('0x33')][_0x360c('0x35')]));_0x1a8a3e['attributes']=_0x1a8a3e[_0x360c('0x34')]['length']?_0x1a8a3e[_0x360c('0x34')]:_0x2e576f[_0x360c('0x2f')];if(_0x3131a5[_0x360c('0x33')][_0x360c('0x46')]){_0x1a8a3e['include']=[{'all':!![]}];}_0x1a8a3e=_[_0x360c('0x3f')]({},_0x1a8a3e,_0x3131a5[_0x360c('0x41')]);return db[_0x360c('0x2c')][_0x360c('0x47')](_0x1a8a3e)['then'](handleEntityNotFound(_0x56e898,null))[_0x360c('0x22')](respondWithResult(_0x56e898,null))[_0x360c('0x42')](handleError(_0x56e898,null));};exports[_0x360c('0x48')]=function(_0x59f607,_0x2f817b){return db[_0x360c('0x2c')]['create'](_0x59f607[_0x360c('0x49')],{})[_0x360c('0x22')](function(_0x1ef63d){var _0xdd72b1=_0x59f607[_0x360c('0x4a')][_0x360c('0x24')]({'plain':!![]});if(!_0xdd72b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdd72b1[_0x360c('0x4b')]===_0x360c('0x4a')){var _0x15d6c8=_0x1ef63d[_0x360c('0x24')]({'plain':!![]});var _0x95f5a5=_0x360c('0x25');return db[_0x360c('0x4c')]['find']({'where':{'name':_0x95f5a5,'userProfileId':_0xdd72b1[_0x360c('0x4d')]},'raw':!![]})[_0x360c('0x22')](function(_0x55e514){if(_0x55e514&&_0x55e514[_0x360c('0x4e')]===0x0){return db[_0x360c('0x26')][_0x360c('0x48')]({'name':_0x15d6c8[_0x360c('0x29')],'resourceId':_0x15d6c8['id'],'type':_0x55e514['name'],'sectionId':_0x55e514['id']},{})[_0x360c('0x22')](function(){return _0x1ef63d;});}else{return _0x1ef63d;}})[_0x360c('0x42')](function(_0x222805){logger[_0x360c('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x222805);throw _0x222805;});}return _0x1ef63d;})[_0x360c('0x22')](respondWithResult(_0x2f817b,0xc9))[_0x360c('0x42')](handleError(_0x2f817b,null));};exports[_0x360c('0x50')]=function(_0x5028d4,_0xd18ccc){if(_0x5028d4['body']['id']){delete _0x5028d4[_0x360c('0x49')]['id'];}return db['Interval'][_0x360c('0x47')]({'where':{'id':_0x5028d4[_0x360c('0x44')]['id']}})['then'](handleEntityNotFound(_0xd18ccc,null))[_0x360c('0x22')](saveUpdates(_0x5028d4[_0x360c('0x49')],null))['then'](respondWithResult(_0xd18ccc,null))[_0x360c('0x42')](handleError(_0xd18ccc,null));};exports[_0x360c('0x23')]=function(_0x456fab,_0x2dff16){return db[_0x360c('0x2c')][_0x360c('0x47')]({'where':{'id':_0x456fab[_0x360c('0x44')]['id']}})[_0x360c('0x22')](handleEntityNotFound(_0x2dff16,null))[_0x360c('0x22')](removeEntity(_0x2dff16,null))[_0x360c('0x42')](handleError(_0x2dff16,null));};exports['addInterval']=function(_0x94a3e4,_0x1bdd56,_0x44169a){if(_0x94a3e4[_0x360c('0x49')]['id']){delete _0x94a3e4[_0x360c('0x49')]['id'];}return db['Interval'][_0x360c('0x47')]({'where':{'id':_0x94a3e4[_0x360c('0x44')]['id']}})[_0x360c('0x22')](handleEntityNotFound(_0x1bdd56,null))['then'](function(_0x52e9cb){if(_0x52e9cb){_0x94a3e4[_0x360c('0x49')]['IntervalId']=_0x52e9cb['id'];return db[_0x360c('0x2c')][_0x360c('0x48')](_0x94a3e4[_0x360c('0x49')]);}})[_0x360c('0x22')](respondWithResult(_0x1bdd56,null))['catch'](handleError(_0x1bdd56,null));};exports[_0x360c('0x51')]=function(_0x114192,_0x790e09,_0x2c67b1){var _0x465f19={};var _0xc18416={};var _0x277c36;var _0x59a725;return db[_0x360c('0x2c')][_0x360c('0x52')]({'where':{'id':_0x114192[_0x360c('0x44')]['id']}})[_0x360c('0x22')](handleEntityNotFound(_0x790e09,null))['then'](function(_0x3cdac3){if(_0x3cdac3){_0x277c36=_0x3cdac3;_0xc18416[_0x360c('0x2f')]=_[_0x360c('0x30')](db[_0x360c('0x2c')]['rawAttributes']);_0xc18416[_0x360c('0x33')]=_[_0x360c('0x30')](_0x114192['query']);_0xc18416[_0x360c('0x31')]=_[_0x360c('0x32')](_0xc18416[_0x360c('0x2f')],_0xc18416[_0x360c('0x33')]);_0x465f19[_0x360c('0x34')]=_[_0x360c('0x32')](_0xc18416[_0x360c('0x2f')],qs[_0x360c('0x35')](_0x114192[_0x360c('0x33')][_0x360c('0x35')]));_0x465f19[_0x360c('0x34')]=_0x465f19[_0x360c('0x34')][_0x360c('0x36')]?_0x465f19[_0x360c('0x34')]:_0xc18416[_0x360c('0x2f')];_0x465f19[_0x360c('0x3a')]=qs['sort'](_0x114192['query'][_0x360c('0x3b')]);_0x465f19[_0x360c('0x3c')]=qs[_0x360c('0x31')](_['pick'](_0x114192[_0x360c('0x33')],_0xc18416['filters']));if(_0x114192[_0x360c('0x33')]['filter']){_0x465f19[_0x360c('0x3c')]=_[_0x360c('0x3f')](_0x465f19[_0x360c('0x3c')],{'$or':_[_0x360c('0x40')](_0x465f19['attributes'],function(_0x3d7257){var _0x3ece4b={};_0x3ece4b[_0x3d7257]={'$like':'%'+_0x114192[_0x360c('0x33')][_0x360c('0x3e')]+'%'};return _0x3ece4b;})});}_0x465f19=_[_0x360c('0x3f')]({},_0x465f19,_0x114192[_0x360c('0x41')]);return _0x277c36[_0x360c('0x51')](_0x465f19);}})[_0x360c('0x22')](function(_0x5941a7){if(_0x5941a7){_0x59a725=_0x5941a7[_0x360c('0x36')];if(!_0x114192[_0x360c('0x33')]['hasOwnProperty'](_0x360c('0x38'))){_0x465f19['limit']=qs[_0x360c('0x39')](_0x114192['query'][_0x360c('0x39')]);_0x465f19['offset']=qs[_0x360c('0x1b')](_0x114192[_0x360c('0x33')][_0x360c('0x1b')]);}return _0x277c36[_0x360c('0x51')](_0x465f19);}})[_0x360c('0x22')](function(_0x44787a){if(_0x44787a){return _0x44787a?{'count':_0x59a725,'rows':_0x44787a}:null;}})[_0x360c('0x22')](respondWithResult(_0x790e09,null))[_0x360c('0x42')](handleError(_0x790e09,null));};exports[_0x360c('0x53')]=function(_0xfea514,_0x564c3e,_0x4cb2ec){return db['Interval'][_0x360c('0x52')]({'where':{'id':_0xfea514['params']['id']}})[_0x360c('0x22')](handleEntityNotFound(_0x564c3e,null))[_0x360c('0x22')](function(_0x55328a){if(_0x55328a){return db[_0x360c('0x54')][_0x360c('0x55')](function(_0x4198e2){return db['Interval']['destroy']({'where':{'IntervalId':_0xfea514[_0x360c('0x44')]['id']},'transaction':_0x4198e2})[_0x360c('0x22')](function(_0x41734c){var _0xad00dd=_['map'](_0xfea514['body'],function(_0x2fcc84){delete _0x2fcc84['id'];_0x2fcc84['IntervalId']=_0xfea514['params']['id'];return _0x2fcc84;});return db[_0x360c('0x2c')][_0x360c('0x56')](_0xad00dd,{'transaction':_0x4198e2});});})[_0x360c('0x22')](function(){return db[_0x360c('0x2c')][_0x360c('0x57')]({'where':{'IntervalId':_0xfea514[_0x360c('0x44')]['id']}});});}})[_0x360c('0x22')](respondWithResult(_0x564c3e,null))[_0x360c('0x42')](handleError(_0x564c3e,null));}; \ No newline at end of file +var _0x8ae5=['fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','then','Intervals','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','Interval','findAll','rows','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','bluebird','mustache'];(function(_0xf0c851,_0x2916f0){var _0x1f2fb2=function(_0x4e8af7){while(--_0x4e8af7){_0xf0c851['push'](_0xf0c851['shift']());}};_0x1f2fb2(++_0x2916f0);}(_0x8ae5,0xa5));var _0x58ae=function(_0x3a61a1,_0x2fcfec){_0x3a61a1=_0x3a61a1-0x0;var _0x296d8c=_0x8ae5[_0x3a61a1];return _0x296d8c;};'use strict';var emlformat=require(_0x58ae('0x0'));var rimraf=require(_0x58ae('0x1'));var zipdir=require(_0x58ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58ae('0x3'));var Mustache=require(_0x58ae('0x4'));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(_0x58ae('0x5'));var _=require(_0x58ae('0x6'));var squel=require(_0x58ae('0x7'));var crypto=require(_0x58ae('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x58ae('0x9'));var toCsv=require(_0x58ae('0xa'));var querystring=require(_0x58ae('0xb'));var Papa=require(_0x58ae('0xc'));var Redis=require(_0x58ae('0xd'));var authService=require(_0x58ae('0xe'));var qs=require(_0x58ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58ae('0x10'))(_0x58ae('0x11'));var utils=require(_0x58ae('0x12'));var config=require(_0x58ae('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x58ae('0x14'))['db'];var extensions=require(_0x58ae('0x15'));function respondWithStatusCode(_0x5f57a1,_0x3af521){_0x3af521=_0x3af521||0xcc;return function(_0x584e14){if(_0x584e14){return _0x5f57a1['sendStatus'](_0x3af521);}return _0x5f57a1['status'](_0x3af521)[_0x58ae('0x16')]();};}function respondWithResult(_0x9b3a93,_0x4ad1de){_0x4ad1de=_0x4ad1de||0xc8;return function(_0x3a9358){if(_0x3a9358){return _0x9b3a93['status'](_0x4ad1de)[_0x58ae('0x17')](_0x3a9358);}};}function respondWithFilteredResult(_0xe7a55a,_0x417f78){return function(_0x49bf2f){if(_0x49bf2f){var _0x5ce4e4=typeof _0x417f78[_0x58ae('0x18')]===_0x58ae('0x19')&&typeof _0x417f78[_0x58ae('0x1a')]==='undefined';var _0xca8aa0=_0x49bf2f['count'];var _0x4bf802=_0x5ce4e4?0x0:_0x417f78['offset'];var _0x2d52a9=_0x5ce4e4?_0x49bf2f[_0x58ae('0x1b')]:_0x417f78[_0x58ae('0x18')]+_0x417f78['limit'];var _0x5aded6;if(_0x2d52a9>=_0xca8aa0){_0x2d52a9=_0xca8aa0;_0x5aded6=0xc8;}else{_0x5aded6=0xce;}_0xe7a55a[_0x58ae('0x1c')](_0x5aded6);return _0xe7a55a[_0x58ae('0x1d')]('Content-Range',_0x4bf802+'-'+_0x2d52a9+'/'+_0xca8aa0)[_0x58ae('0x17')](_0x49bf2f);}return null;};}function patchUpdates(_0x179f63){return function(_0x250171){try{jsonpatch[_0x58ae('0x1e')](_0x250171,_0x179f63,!![]);}catch(_0x118419){return BPromise[_0x58ae('0x1f')](_0x118419);}return _0x250171[_0x58ae('0x20')]();};}function saveUpdates(_0x134445,_0x13608c){return function(_0x2be372){if(_0x2be372){return _0x2be372[_0x58ae('0x21')](_0x134445)['then'](function(_0x5d10a0){return _0x5d10a0;});}return null;};}function removeEntity(_0x45bd1d,_0x5c3620){return function(_0x10f174){if(_0x10f174){return _0x10f174[_0x58ae('0x22')]()[_0x58ae('0x23')](function(){var _0x1dead3=_0x10f174['get']({'plain':!![]});var _0x1cda47=_0x58ae('0x24');return db[_0x58ae('0x25')][_0x58ae('0x22')]({'where':{'type':_0x1cda47,'resourceId':_0x1dead3['id']}})[_0x58ae('0x23')](function(){return _0x10f174;});})[_0x58ae('0x23')](function(){_0x45bd1d[_0x58ae('0x1c')](0xcc)[_0x58ae('0x16')]();});}};}function handleEntityNotFound(_0x34ffa8,_0x588eeb){return function(_0x305f31){if(!_0x305f31){_0x34ffa8[_0x58ae('0x26')](0x194);}return _0x305f31;};}function handleError(_0x33cc75,_0x315819){_0x315819=_0x315819||0x1f4;return function(_0x5beeb8){logger[_0x58ae('0x27')](_0x5beeb8['stack']);if(_0x5beeb8[_0x58ae('0x28')]){delete _0x5beeb8[_0x58ae('0x28')];}_0x33cc75[_0x58ae('0x1c')](_0x315819)[_0x58ae('0x29')](_0x5beeb8);};}exports[_0x58ae('0x2a')]=function(_0x4308cf,_0xe8763){var _0x3e0067={},_0x5c9ee3={},_0x26179f={'count':0x0,'rows':[]};var _0xaa4b70=_[_0x58ae('0x2b')](db['Interval'][_0x58ae('0x2c')],function(_0x3d024c){return{'name':_0x3d024c[_0x58ae('0x2d')],'type':_0x3d024c['type']['key']};});_0x5c9ee3[_0x58ae('0x2e')]=_['map'](_0xaa4b70,_0x58ae('0x28'));_0x5c9ee3['query']=_[_0x58ae('0x2f')](_0x4308cf['query']);_0x5c9ee3[_0x58ae('0x30')]=_[_0x58ae('0x31')](_0x5c9ee3[_0x58ae('0x2e')],_0x5c9ee3[_0x58ae('0x32')]);_0x3e0067[_0x58ae('0x33')]=_[_0x58ae('0x31')](_0x5c9ee3[_0x58ae('0x2e')],qs[_0x58ae('0x34')](_0x4308cf[_0x58ae('0x32')][_0x58ae('0x34')]));_0x3e0067[_0x58ae('0x33')]=_0x3e0067[_0x58ae('0x33')][_0x58ae('0x35')]?_0x3e0067[_0x58ae('0x33')]:_0x5c9ee3['model'];if(!_0x4308cf['query'][_0x58ae('0x36')](_0x58ae('0x37'))){_0x3e0067[_0x58ae('0x1a')]=qs[_0x58ae('0x1a')](_0x4308cf[_0x58ae('0x32')]['limit']);_0x3e0067[_0x58ae('0x18')]=qs['offset'](_0x4308cf[_0x58ae('0x32')][_0x58ae('0x18')]);}_0x3e0067[_0x58ae('0x38')]=qs[_0x58ae('0x39')](_0x4308cf[_0x58ae('0x32')]['sort']);_0x3e0067[_0x58ae('0x3a')]=qs[_0x58ae('0x30')](_[_0x58ae('0x3b')](_0x4308cf[_0x58ae('0x32')],_0x5c9ee3[_0x58ae('0x30')]),_0xaa4b70);if(_0x4308cf['query'][_0x58ae('0x3c')]){_0x3e0067[_0x58ae('0x3a')]=_[_0x58ae('0x3d')](_0x3e0067['where'],{'$or':_[_0x58ae('0x2b')](_0xaa4b70,function(_0x222a89){if(_0x222a89[_0x58ae('0x3e')]!=='VIRTUAL'){var _0x1c99d1={};_0x1c99d1[_0x222a89['name']]={'$like':'%'+_0x4308cf[_0x58ae('0x32')]['filter']+'%'};return _0x1c99d1;}})});}_0x3e0067=_[_0x58ae('0x3d')]({},_0x3e0067,_0x4308cf[_0x58ae('0x3f')]);var _0x437f61={'where':_0x3e0067[_0x58ae('0x3a')]};return db['Interval'][_0x58ae('0x1b')](_0x437f61)[_0x58ae('0x23')](function(_0x35d7fa){_0x26179f['count']=_0x35d7fa;if(_0x4308cf[_0x58ae('0x32')][_0x58ae('0x40')]){_0x3e0067[_0x58ae('0x41')]=[{'all':!![]}];}return db[_0x58ae('0x42')][_0x58ae('0x43')](_0x3e0067);})['then'](function(_0x2538f4){_0x26179f[_0x58ae('0x44')]=_0x2538f4;return _0x26179f;})[_0x58ae('0x23')](respondWithFilteredResult(_0xe8763,_0x3e0067))[_0x58ae('0x45')](handleError(_0xe8763,null));};exports[_0x58ae('0x46')]=function(_0xe445f1,_0x49013e){var _0x233dbe={'raw':!![],'where':{'id':_0xe445f1['params']['id']}},_0x204593={};_0x204593['model']=_[_0x58ae('0x2f')](db[_0x58ae('0x42')]['rawAttributes']);_0x204593[_0x58ae('0x32')]=_[_0x58ae('0x2f')](_0xe445f1[_0x58ae('0x32')]);_0x204593['filters']=_['intersection'](_0x204593[_0x58ae('0x2e')],_0x204593[_0x58ae('0x32')]);_0x233dbe[_0x58ae('0x33')]=_[_0x58ae('0x31')](_0x204593[_0x58ae('0x2e')],qs[_0x58ae('0x34')](_0xe445f1[_0x58ae('0x32')][_0x58ae('0x34')]));_0x233dbe[_0x58ae('0x33')]=_0x233dbe['attributes']['length']?_0x233dbe['attributes']:_0x204593[_0x58ae('0x2e')];if(_0xe445f1[_0x58ae('0x32')]['includeAll']){_0x233dbe[_0x58ae('0x41')]=[{'all':!![]}];}_0x233dbe=_[_0x58ae('0x3d')]({},_0x233dbe,_0xe445f1['options']);return db[_0x58ae('0x42')]['find'](_0x233dbe)[_0x58ae('0x23')](handleEntityNotFound(_0x49013e,null))[_0x58ae('0x23')](respondWithResult(_0x49013e,null))[_0x58ae('0x45')](handleError(_0x49013e,null));};exports[_0x58ae('0x47')]=function(_0x4f0376,_0x48b0fa){return db[_0x58ae('0x42')]['create'](_0x4f0376[_0x58ae('0x48')],{})['then'](function(_0x5f49c6){var _0x4acd6d=_0x4f0376[_0x58ae('0x49')][_0x58ae('0x4a')]({'plain':!![]});if(!_0x4acd6d)throw new Error(_0x58ae('0x4b'));if(_0x4acd6d[_0x58ae('0x4c')]===_0x58ae('0x49')){var _0x4bf985=_0x5f49c6[_0x58ae('0x4a')]({'plain':!![]});var _0x5da034=_0x58ae('0x24');return db[_0x58ae('0x4d')][_0x58ae('0x4e')]({'where':{'name':_0x5da034,'userProfileId':_0x4acd6d['userProfileId']},'raw':!![]})[_0x58ae('0x23')](function(_0xf5a424){if(_0xf5a424&&_0xf5a424['autoAssociation']===0x0){return db['UserProfileResource'][_0x58ae('0x47')]({'name':_0x4bf985['name'],'resourceId':_0x4bf985['id'],'type':_0xf5a424[_0x58ae('0x28')],'sectionId':_0xf5a424['id']},{})['then'](function(){return _0x5f49c6;});}else{return _0x5f49c6;}})['catch'](function(_0x4d5d56){logger[_0x58ae('0x27')](_0x58ae('0x4f'),_0x4d5d56);throw _0x4d5d56;});}return _0x5f49c6;})[_0x58ae('0x23')](respondWithResult(_0x48b0fa,0xc9))['catch'](handleError(_0x48b0fa,null));};exports[_0x58ae('0x21')]=function(_0x4f5950,_0x5498c5){if(_0x4f5950['body']['id']){delete _0x4f5950[_0x58ae('0x48')]['id'];}return db[_0x58ae('0x42')][_0x58ae('0x4e')]({'where':{'id':_0x4f5950[_0x58ae('0x50')]['id']}})['then'](handleEntityNotFound(_0x5498c5,null))['then'](saveUpdates(_0x4f5950[_0x58ae('0x48')],null))[_0x58ae('0x23')](respondWithResult(_0x5498c5,null))[_0x58ae('0x45')](handleError(_0x5498c5,null));};exports['destroy']=function(_0x1df053,_0x45d2d0){return db[_0x58ae('0x42')]['find']({'where':{'id':_0x1df053[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x45d2d0,null))[_0x58ae('0x23')](removeEntity(_0x45d2d0,null))[_0x58ae('0x45')](handleError(_0x45d2d0,null));};exports[_0x58ae('0x51')]=function(_0x9c4568,_0x14ce16,_0x4a491b){if(_0x9c4568[_0x58ae('0x48')]['id']){delete _0x9c4568['body']['id'];}return db[_0x58ae('0x42')][_0x58ae('0x4e')]({'where':{'id':_0x9c4568[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x14ce16,null))[_0x58ae('0x23')](function(_0x8f7fd1){if(_0x8f7fd1){_0x9c4568[_0x58ae('0x48')]['IntervalId']=_0x8f7fd1['id'];return db['Interval'][_0x58ae('0x47')](_0x9c4568[_0x58ae('0x48')]);}})['then'](respondWithResult(_0x14ce16,null))[_0x58ae('0x45')](handleError(_0x14ce16,null));};exports['getIntervals']=function(_0x236343,_0x2be2f8,_0x40e442){var _0x5c1acc={};var _0x565772={};var _0x3d395e;var _0x4c4e34;return db[_0x58ae('0x42')]['findOne']({'where':{'id':_0x236343[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x2be2f8,null))[_0x58ae('0x23')](function(_0x63c583){if(_0x63c583){_0x3d395e=_0x63c583;_0x565772[_0x58ae('0x2e')]=_[_0x58ae('0x2f')](db[_0x58ae('0x42')][_0x58ae('0x2c')]);_0x565772['query']=_[_0x58ae('0x2f')](_0x236343[_0x58ae('0x32')]);_0x565772[_0x58ae('0x30')]=_[_0x58ae('0x31')](_0x565772['model'],_0x565772[_0x58ae('0x32')]);_0x5c1acc[_0x58ae('0x33')]=_['intersection'](_0x565772[_0x58ae('0x2e')],qs['fields'](_0x236343[_0x58ae('0x32')][_0x58ae('0x34')]));_0x5c1acc[_0x58ae('0x33')]=_0x5c1acc[_0x58ae('0x33')][_0x58ae('0x35')]?_0x5c1acc[_0x58ae('0x33')]:_0x565772[_0x58ae('0x2e')];_0x5c1acc[_0x58ae('0x38')]=qs[_0x58ae('0x39')](_0x236343['query'][_0x58ae('0x39')]);_0x5c1acc[_0x58ae('0x3a')]=qs['filters'](_['pick'](_0x236343[_0x58ae('0x32')],_0x565772[_0x58ae('0x30')]));if(_0x236343[_0x58ae('0x32')][_0x58ae('0x3c')]){_0x5c1acc[_0x58ae('0x3a')]=_[_0x58ae('0x3d')](_0x5c1acc[_0x58ae('0x3a')],{'$or':_[_0x58ae('0x2b')](_0x5c1acc[_0x58ae('0x33')],function(_0x39a8e0){var _0x11ea1e={};_0x11ea1e[_0x39a8e0]={'$like':'%'+_0x236343['query'][_0x58ae('0x3c')]+'%'};return _0x11ea1e;})});}_0x5c1acc=_[_0x58ae('0x3d')]({},_0x5c1acc,_0x236343[_0x58ae('0x3f')]);return _0x3d395e[_0x58ae('0x52')](_0x5c1acc);}})[_0x58ae('0x23')](function(_0x3d2f23){if(_0x3d2f23){_0x4c4e34=_0x3d2f23[_0x58ae('0x35')];if(!_0x236343[_0x58ae('0x32')][_0x58ae('0x36')]('nolimit')){_0x5c1acc[_0x58ae('0x1a')]=qs[_0x58ae('0x1a')](_0x236343[_0x58ae('0x32')][_0x58ae('0x1a')]);_0x5c1acc[_0x58ae('0x18')]=qs[_0x58ae('0x18')](_0x236343['query'][_0x58ae('0x18')]);}return _0x3d395e[_0x58ae('0x52')](_0x5c1acc);}})[_0x58ae('0x23')](function(_0x516d1e){if(_0x516d1e){return _0x516d1e?{'count':_0x4c4e34,'rows':_0x516d1e}:null;}})[_0x58ae('0x23')](respondWithResult(_0x2be2f8,null))[_0x58ae('0x45')](handleError(_0x2be2f8,null));};exports[_0x58ae('0x53')]=function(_0x189b69,_0x147d32,_0x23a33c){return db[_0x58ae('0x42')]['findOne']({'where':{'id':_0x189b69[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x147d32,null))[_0x58ae('0x23')](function(_0x1ec741){if(_0x1ec741){return db['sequelize']['transaction'](function(_0x3f88f9){return db[_0x58ae('0x42')]['destroy']({'where':{'IntervalId':_0x189b69[_0x58ae('0x50')]['id']},'transaction':_0x3f88f9})[_0x58ae('0x23')](function(_0x53df30){var _0x500db6=_[_0x58ae('0x2b')](_0x189b69[_0x58ae('0x48')],function(_0x19b155){delete _0x19b155['id'];_0x19b155['IntervalId']=_0x189b69[_0x58ae('0x50')]['id'];return _0x19b155;});return db[_0x58ae('0x42')][_0x58ae('0x54')](_0x500db6,{'transaction':_0x3f88f9});});})[_0x58ae('0x23')](function(){return db[_0x58ae('0x42')][_0x58ae('0x43')]({'where':{'IntervalId':_0x189b69['params']['id']}});});}})['then'](respondWithResult(_0x147d32,null))['catch'](handleError(_0x147d32,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index df1c6e2..908f64b 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 _0xf6ca=['tools_intervals','rewrite','lodash','../../config/logger','bluebird','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf6ca,0xf4));var _0xaf6c=function(_0xab6b04,_0xb2abe3){_0xab6b04=_0xab6b04-0x0;var _0x164110=_0xf6ca[_0xab6b04];return _0x164110;};'use strict';var _=require(_0xaf6c('0x0'));var util=require('util');var logger=require(_0xaf6c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaf6c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf6c('0x3'));var rimraf=require(_0xaf6c('0x4'));var config=require('../../config/environment');var attributes=require(_0xaf6c('0x5'));var extensions=require(_0xaf6c('0x6'));module[_0xaf6c('0x7')]=function(_0x1b1cdd,_0x229df4){return _0x1b1cdd['define'](_0xaf6c('0x8'),attributes,{'tableName':_0xaf6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x44a4be,_0x5e849e){extensions['rewrite'](_0x1b1cdd,_0x44a4be);},'afterBulkCreate':function(_0x583db9,_0x19df1d,_0x2db80a){_0x2db80a();extensions[_0xaf6c('0xa')](_0x1b1cdd,_0x583db9[0x0]);},'afterUpdate':function(_0x4090c0,_0x4bc42b){extensions[_0xaf6c('0xa')](_0x1b1cdd,_0x4090c0);},'afterDestroy':function(_0xf3e670,_0x31d5fd){extensions['rewrite'](_0x1b1cdd,_0xf3e670);}}});}; \ No newline at end of file +var _0x600a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util'];(function(_0x3b9c02,_0x24655d){var _0x2bc33e=function(_0x5786b7){while(--_0x5786b7){_0x3b9c02['push'](_0x3b9c02['shift']());}};_0x2bc33e(++_0x24655d);}(_0x600a,0xe0));var _0xa600=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x600a[_0x209fcd];return _0x501d5e;};'use strict';var _=require('lodash');var util=require(_0xa600('0x0'));var logger=require('../../config/logger')(_0xa600('0x1'));var moment=require(_0xa600('0x2'));var BPromise=require(_0xa600('0x3'));var rp=require(_0xa600('0x4'));var fs=require('fs');var path=require(_0xa600('0x5'));var rimraf=require(_0xa600('0x6'));var config=require(_0xa600('0x7'));var attributes=require(_0xa600('0x8'));var extensions=require(_0xa600('0x9'));module[_0xa600('0xa')]=function(_0x33d062,_0x4dfc17){return _0x33d062[_0xa600('0xb')](_0xa600('0xc'),attributes,{'tableName':_0xa600('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58fb7a,_0x1bedac){extensions[_0xa600('0xe')](_0x33d062,_0x58fb7a);},'afterBulkCreate':function(_0x298c43,_0x29ecd8,_0x1ea8bb){_0x1ea8bb();extensions[_0xa600('0xe')](_0x33d062,_0x298c43[0x0]);},'afterUpdate':function(_0x2fbe99,_0x5ee943){extensions['rewrite'](_0x33d062,_0x2fbe99);},'afterDestroy':function(_0x394e00,_0x158c3a){extensions['rewrite'](_0x33d062,_0x394e00);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 82d6b76..fc4e2d4 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5bd83c6..1bec397 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x125d16,_0x2979f4){var _0x21d84=function(_0x7cba1){while(--_0x7cba1){_0x125d16['push'](_0x125d16['shift']());}};_0x21d84(++_0x2979f4);}(_0xadb5,0xad));var _0x5adb=function(_0x251e1f,_0x48e282){_0x251e1f=_0x251e1f-0x0;var _0x5cad09=_0xadb5[_0x251e1f];return _0x5cad09;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x18b349,_0x1b285d){var _0xa23b92=function(_0x187011){while(--_0x187011){_0x18b349['push'](_0x18b349['shift']());}};_0xa23b92(++_0x1b285d);}(_0x2032,0xd9));var _0x2203=function(_0x4daaad,_0x1aaca3){_0x4daaad=_0x4daaad-0x0;var _0x46592a=_0x2032[_0x4daaad];return _0x46592a;};'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 857ca2d..aeb2d6b 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 _0xaee9=['application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','openIssue','send','body','headers','remoteAddress','socket','bluebird','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','stringify','issuetype','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST'];(function(_0x22abb9,_0x45d42e){var _0x3a8bb6=function(_0x3b8850){while(--_0x3b8850){_0x22abb9['push'](_0x22abb9['shift']());}};_0x3a8bb6(++_0x45d42e);}(_0xaee9,0xe7));var _0x9aee=function(_0x1e95c0,_0x41454b){_0x1e95c0=_0x1e95c0-0x0;var _0x3e09ac=_0xaee9[_0x1e95c0];return _0x3e09ac;};'use strict';var BPromise=require(_0x9aee('0x0'));var https=require('https');var logger=require('../../config/logger')('api');var USERNAME=_0x9aee('0x1');var PASSWORD=_0x9aee('0x2');function openIssue(_0x192f65,_0x1f8a69){var _0x2d4e3b={'fields':{'project':{'key':_0x192f65[_0x9aee('0x3')]||'MOTGUI'},'summary':(_0x192f65[_0x9aee('0x4')]||_0x9aee('0x5'))+_0x9aee('0x6')+_0x192f65['ip'],'description':_0x192f65['description']||JSON[_0x9aee('0x7')](_0x192f65),'issuetype':{'name':_0x192f65[_0x9aee('0x8')]||'Bug'}}};_0x2d4e3b[_0x9aee('0x9')][_0x9aee('0xa')]=_0x192f65[_0x9aee('0xb')];_0x2d4e3b['fields'][_0x9aee('0xc')]=_0x192f65['oldToken'];_0x2d4e3b[_0x9aee('0x9')][_0x9aee('0xd')]=_0x192f65[_0x9aee('0xe')];_0x2d4e3b[_0x9aee('0x9')]['customfield_11503']=_0x192f65[_0x9aee('0xf')];_0x2d4e3b[_0x9aee('0x9')][_0x9aee('0x10')]=_0x192f65[_0x9aee('0x11')];_0x2d4e3b['fields']['customfield_10102']=_0x192f65['ip'];var _0x1a1bd8={'host':_0x9aee('0x12'),'port':0x1bb,'path':_0x9aee('0x13'),'method':_0x9aee('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x9aee('0x15'),'Authorization':_0x9aee('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x9aee('0x17')](_0x9aee('0x18'))}};var _0x102782=JSON['stringify'](_0x2d4e3b);var _0x208f11=https['request'](_0x1a1bd8,function(_0x6aa507){_0x6aa507[_0x9aee('0x19')](_0x9aee('0x1a'));var _0x42bef3='';_0x6aa507['on'](_0x9aee('0x1b'),function(_0x34f77c){_0x42bef3+=_0x34f77c;});_0x6aa507['on'](_0x9aee('0x1c'),function(){if(_0x1f8a69){return _0x1f8a69[_0x9aee('0x1d')](_0x6aa507[_0x9aee('0x1e')])[_0x9aee('0x1f')](JSON[_0x9aee('0x20')](_0x42bef3));}});});_0x208f11['on'](_0x9aee('0x21'),function(_0x19679c){if(_0x1f8a69){return _0x1f8a69['status'](0x1f4)[_0x9aee('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x9aee('0x22')}]});}});_0x208f11[_0x9aee('0x23')](_0x102782);_0x208f11['end']();}exports[_0x9aee('0x24')]=openIssue;exports[_0x9aee('0x25')]=function(_0x2f0f23,_0x2f4f60){_0x2f0f23[_0x9aee('0x26')]['ip']=_0x2f0f23[_0x9aee('0x27')]['x-forwarded-for']||_0x2f0f23['connection'][_0x9aee('0x28')]||_0x2f0f23[_0x9aee('0x29')]['remoteAddress']||_0x2f0f23['connection'][_0x9aee('0x29')]['remoteAddress'];return openIssue(_0x2f0f23['body'],_0x2f4f60);}; \ No newline at end of file +var _0x0422=['x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','api.jira','write','send','body','headers'];(function(_0x228a23,_0x241972){var _0x56d2fc=function(_0x769e32){while(--_0x769e32){_0x228a23['push'](_0x228a23['shift']());}};_0x56d2fc(++_0x241972);}(_0x0422,0x15c));var _0x2042=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x0422[_0x27604f];return _0x40d189;};'use strict';var BPromise=require('bluebird');var https=require(_0x2042('0x0'));var logger=require(_0x2042('0x1'))('api');var USERNAME=_0x2042('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x32c2ed,_0x22deb4){var _0x1e0741={'fields':{'project':{'key':_0x32c2ed[_0x2042('0x3')]||'MOTGUI'},'summary':(_0x32c2ed[_0x2042('0x4')]||_0x2042('0x5'))+_0x2042('0x6')+_0x32c2ed['ip'],'description':_0x32c2ed[_0x2042('0x7')]||JSON[_0x2042('0x8')](_0x32c2ed),'issuetype':{'name':_0x32c2ed[_0x2042('0x9')]||'Bug'}}};_0x1e0741[_0x2042('0xa')][_0x2042('0xb')]=_0x32c2ed[_0x2042('0xc')];_0x1e0741[_0x2042('0xa')][_0x2042('0xd')]=_0x32c2ed['oldToken'];_0x1e0741[_0x2042('0xa')][_0x2042('0xe')]=_0x32c2ed[_0x2042('0xf')];_0x1e0741[_0x2042('0xa')][_0x2042('0x10')]=_0x32c2ed['name'];_0x1e0741['fields'][_0x2042('0x11')]=_0x32c2ed[_0x2042('0x12')];_0x1e0741[_0x2042('0xa')][_0x2042('0x13')]=_0x32c2ed['ip'];var _0x276703={'host':_0x2042('0x14'),'port':0x1bb,'path':_0x2042('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x2042('0x16')](_0x2042('0x17'))}};var _0x5bd7a8=JSON[_0x2042('0x8')](_0x1e0741);var _0x433049=https[_0x2042('0x18')](_0x276703,function(_0x3d5201){_0x3d5201[_0x2042('0x19')](_0x2042('0x1a'));var _0x47f711='';_0x3d5201['on'](_0x2042('0x1b'),function(_0x10638a){_0x47f711+=_0x10638a;});_0x3d5201['on'](_0x2042('0x1c'),function(){if(_0x22deb4){return _0x22deb4[_0x2042('0x1d')](_0x3d5201[_0x2042('0x1e')])['json'](JSON[_0x2042('0x1f')](_0x47f711));}});});_0x433049['on'](_0x2042('0x20'),function(_0x3d81bb){if(_0x22deb4){return _0x22deb4[_0x2042('0x1d')](0x1f4)[_0x2042('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x2042('0x22')}]});}});_0x433049[_0x2042('0x23')](_0x5bd7a8);_0x433049[_0x2042('0x1c')]();}exports['openIssue']=openIssue;exports[_0x2042('0x24')]=function(_0x1d0625,_0x8c1c99){_0x1d0625[_0x2042('0x25')]['ip']=_0x1d0625[_0x2042('0x26')][_0x2042('0x27')]||_0x1d0625[_0x2042('0x28')][_0x2042('0x29')]||_0x1d0625[_0x2042('0x2a')][_0x2042('0x29')]||_0x1d0625['connection'][_0x2042('0x2a')][_0x2042('0x29')];return openIssue(_0x1d0625[_0x2042('0x25')],_0x8c1c99);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f4d373d..456185c 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 _0x153f=['Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x11ed81,_0x586519){var _0x463371=function(_0x230f2e){while(--_0x230f2e){_0x11ed81['push'](_0x11ed81['shift']());}};_0x463371(++_0x586519);}(_0x153f,0x15b));var _0xf153=function(_0x17446f,_0x4f72d3){_0x17446f=_0x17446f-0x0;var _0x2db0cb=_0x153f[_0x17446f];return _0x2db0cb;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router[_0xf153('0x13')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);module[_0xf153('0x15')]=router; \ No newline at end of file +var _0x3c81=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0xee7f65,_0x4ff021){var _0x5449bc=function(_0x8090e2){while(--_0x8090e2){_0xee7f65['push'](_0xee7f65['shift']());}};_0x5449bc(++_0x4ff021);}(_0x3c81,0x102));var _0x13c8=function(_0x3901bb,_0x5a6fdc){_0x3901bb=_0x3901bb-0x0;var _0x4778e1=_0x3c81[_0x3901bb];return _0x4778e1;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0xd')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 90ebe98..e8ddb78 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x3a826e,_0x725ce8){_0x3a826e=_0x3a826e-0x0;var _0x1556c3=_0x7a54[_0x3a826e];return _0x1556c3;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0xb48924,_0x1365c3){_0xb48924=_0xb48924-0x0;var _0x336e56=_0x7a54[_0xb48924];return _0x336e56;};'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 fa6c312..80e8bb8 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 _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x5e977e,_0x14fb0d){_0x5e977e=_0x5e977e-0x0;var _0x46186d=_0xf987[_0x5e977e];return _0x46186d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['JscriptyAnswerReport'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['JscriptyAnswerReport'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file +var _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x27ac27,_0x4ed567){var _0x1b077c=function(_0x2df079){while(--_0x2df079){_0x27ac27['push'](_0x27ac27['shift']());}};_0x1b077c(++_0x4ed567);}(_0x3435,0xfa));var _0x5343=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x3435[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['JscriptyAnswerReport'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['JscriptyAnswerReport'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['JscriptyAnswerReport'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 75d199b..9321fdc 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 _0x5b66=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x27e3d8,_0x3cd095){var _0x380f3b=function(_0x387d08){while(--_0x387d08){_0x27e3d8['push'](_0x27e3d8['shift']());}};_0x380f3b(++_0x3cd095);}(_0x5b66,0x144));var _0x65b6=function(_0x4bc29f,_0x519a70){_0x4bc29f=_0x4bc29f-0x0;var _0x4019a7=_0x5b66[_0x4bc29f];return _0x4019a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x65b6('0x0'));var moment=require(_0x65b6('0x1'));var BPromise=require(_0x65b6('0x2'));var rp=require(_0x65b6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65b6('0x4'));var config=require(_0x65b6('0x5'));var attributes=require(_0x65b6('0x6'));module[_0x65b6('0x7')]=function(_0x2cda7e,_0x577033){return _0x2cda7e[_0x65b6('0x8')](_0x65b6('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75a4=['util','../../config/logger','moment','request-promise','rimraf','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x4e0fef,_0x41024e){var _0x6336cf=function(_0x33bfc9){while(--_0x33bfc9){_0x4e0fef['push'](_0x4e0fef['shift']());}};_0x6336cf(++_0x41024e);}(_0x75a4,0x81));var _0x475a=function(_0x4189c8,_0x5be762){_0x4189c8=_0x4189c8-0x0;var _0x25d483=_0x75a4[_0x4189c8];return _0x25d483;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var logger=require(_0x475a('0x2'))('api');var moment=require(_0x475a('0x3'));var BPromise=require('bluebird');var rp=require(_0x475a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x475a('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x475a('0x6')]=function(_0x10b7fc,_0x414484){return _0x10b7fc[_0x475a('0x7')](_0x475a('0x8'),attributes,{'tableName':_0x475a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c3b4f30..f56a87c 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 _0xf628=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xf628,0x103));var _0x8f62=function(_0x46461a,_0x5d6477){_0x46461a=_0x46461a-0x0;var _0x286fcd=_0xf628[_0x46461a];return _0x286fcd;};'use strict';var _=require(_0x8f62('0x0'));var util=require('util');var moment=require(_0x8f62('0x1'));var BPromise=require(_0x8f62('0x2'));var rs=require(_0x8f62('0x3'));var fs=require('fs');var Redis=require(_0x8f62('0x4'));var db=require(_0x8f62('0x5'))['db'];var utils=require(_0x8f62('0x6'));var logger=require(_0x8f62('0x7'))(_0x8f62('0x8'));var config=require(_0x8f62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8f62('0xa')][_0x8f62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3509da,_0xb5c2d2,_0x5b73f6){return new BPromise(function(_0x1bd291,_0x49101c){return client['request'](_0x3509da,_0x5b73f6)[_0x8f62('0xc')](function(_0x2f2518){logger['info'](_0x8f62('0xd'),_0xb5c2d2,'request\x20sent');logger['debug'](_0x8f62('0xe'),_0xb5c2d2,_0x8f62('0xf'),JSON[_0x8f62('0x10')](_0x2f2518));if(_0x2f2518[_0x8f62('0x11')]){if(_0x2f2518['error']['code']===0x1f4){logger[_0x8f62('0x11')](_0x8f62('0xd'),_0xb5c2d2,_0x2f2518[_0x8f62('0x11')][_0x8f62('0x12')]);return _0x49101c(_0x2f2518[_0x8f62('0x11')]['message']);}logger[_0x8f62('0x11')](_0x8f62('0xd'),_0xb5c2d2,_0x2f2518[_0x8f62('0x11')][_0x8f62('0x12')]);return _0x1bd291(_0x2f2518[_0x8f62('0x11')]['message']);}else{logger[_0x8f62('0x13')](_0x8f62('0xd'),_0xb5c2d2,_0x8f62('0xf'));_0x1bd291(_0x2f2518[_0x8f62('0x14')][_0x8f62('0x12')]);}})[_0x8f62('0x15')](function(_0x136a13){logger[_0x8f62('0x11')](_0x8f62('0xd'),_0xb5c2d2,_0x136a13);_0x49101c(_0x136a13);});});} \ No newline at end of file +var _0xc424=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2081f1,_0x36e8ce){var _0x2ad889=function(_0x51ce96){while(--_0x51ce96){_0x2081f1['push'](_0x2081f1['shift']());}};_0x2ad889(++_0x36e8ce);}(_0xc424,0xbe));var _0x4c42=function(_0x3a81fd,_0x1237c0){_0x3a81fd=_0x3a81fd-0x0;var _0x126cca=_0xc424[_0x3a81fd];return _0x126cca;};'use strict';var _=require(_0x4c42('0x0'));var util=require(_0x4c42('0x1'));var moment=require(_0x4c42('0x2'));var BPromise=require(_0x4c42('0x3'));var rs=require(_0x4c42('0x4'));var fs=require('fs');var Redis=require(_0x4c42('0x5'));var db=require(_0x4c42('0x6'))['db'];var utils=require(_0x4c42('0x7'));var logger=require(_0x4c42('0x8'))(_0x4c42('0x9'));var config=require(_0x4c42('0xa'));var jayson=require(_0x4c42('0xb'));var client=jayson[_0x4c42('0xc')][_0x4c42('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x402a1c,_0x2ae8a7,_0xe62554){return new BPromise(function(_0x3ba7cb,_0x1fa6b0){return client['request'](_0x402a1c,_0xe62554)['then'](function(_0x513e03){logger[_0x4c42('0xe')](_0x4c42('0xf'),_0x2ae8a7,_0x4c42('0x10'));logger['debug'](_0x4c42('0x11'),_0x2ae8a7,_0x4c42('0x10'),JSON['stringify'](_0x513e03));if(_0x513e03[_0x4c42('0x12')]){if(_0x513e03['error'][_0x4c42('0x13')]===0x1f4){logger['error'](_0x4c42('0xf'),_0x2ae8a7,_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);return _0x1fa6b0(_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);}logger['error'](_0x4c42('0xf'),_0x2ae8a7,_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);return _0x3ba7cb(_0x513e03[_0x4c42('0x12')]['message']);}else{logger[_0x4c42('0xe')](_0x4c42('0xf'),_0x2ae8a7,_0x4c42('0x10'));_0x3ba7cb(_0x513e03[_0x4c42('0x15')]['message']);}})[_0x4c42('0x16')](function(_0x3087e5){logger[_0x4c42('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ae8a7,_0x3087e5);_0x1fa6b0(_0x3087e5);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 4deb434..73dde14 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 _0x90e6=['/:id','show','/:id/answers','/:id/summary','30s','post','/:id/clone','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x7994b8,_0x5f4d14){var _0x10e64b=function(_0x3e3e5b){while(--_0x3e3e5b){_0x7994b8['push'](_0x7994b8['shift']());}};_0x10e64b(++_0x5f4d14);}(_0x90e6,0xbb));var _0x690e=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x90e6[_0x1b5aea];return _0x51cae9;};'use strict';var multer=require(_0x690e('0x0'));var util=require('util');var path=require(_0x690e('0x1'));var timeout=require(_0x690e('0x2'));var express=require(_0x690e('0x3'));var router=express[_0x690e('0x4')]();var fs_extra=require(_0x690e('0x5'));var auth=require(_0x690e('0x6'));var interaction=require(_0x690e('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x690e('0x8')]('/',auth[_0x690e('0x9')](),controller[_0x690e('0xa')]);router[_0x690e('0x8')](_0x690e('0xb'),auth[_0x690e('0x9')](),controller[_0x690e('0xc')]);router[_0x690e('0x8')]('/:id/sessions',auth[_0x690e('0x9')](),controller['getSessions']);router['get'](_0x690e('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x690e('0x8')](_0x690e('0xe'),auth[_0x690e('0x9')](),timeout(_0x690e('0xf')),controller['getSummary']);router[_0x690e('0x10')]('/',auth[_0x690e('0x9')](),controller['create']);router[_0x690e('0x10')](_0x690e('0x11'),auth[_0x690e('0x9')](),controller['clone']);router[_0x690e('0x12')](_0x690e('0xb'),auth[_0x690e('0x9')](),controller[_0x690e('0x13')]);router[_0x690e('0x14')](_0x690e('0xb'),auth[_0x690e('0x9')](),controller[_0x690e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbb2a=['30s','getSummary','post','clone','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','getAnswers'];(function(_0x2b50e0,_0x48d2bb){var _0x379c45=function(_0x5d652f){while(--_0x5d652f){_0x2b50e0['push'](_0x2b50e0['shift']());}};_0x379c45(++_0x48d2bb);}(_0xbb2a,0x1d4));var _0xabb2=function(_0x1bb831,_0x5d76be){_0x1bb831=_0x1bb831-0x0;var _0x4a94af=_0xbb2a[_0x1bb831];return _0x4a94af;};'use strict';var multer=require('multer');var util=require(_0xabb2('0x0'));var path=require('path');var timeout=require(_0xabb2('0x1'));var express=require(_0xabb2('0x2'));var router=express[_0xabb2('0x3')]();var fs_extra=require(_0xabb2('0x4'));var auth=require(_0xabb2('0x5'));var interaction=require(_0xabb2('0x6'));var config=require(_0xabb2('0x7'));var controller=require('./jscriptyProject.controller');router[_0xabb2('0x8')]('/',auth[_0xabb2('0x9')](),controller[_0xabb2('0xa')]);router['get'](_0xabb2('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xabb2('0x8')](_0xabb2('0xc'),auth[_0xabb2('0x9')](),controller[_0xabb2('0xd')]);router[_0xabb2('0x8')]('/:id/answers',auth[_0xabb2('0x9')](),controller[_0xabb2('0xe')]);router[_0xabb2('0x8')]('/:id/summary',auth[_0xabb2('0x9')](),timeout(_0xabb2('0xf')),controller[_0xabb2('0x10')]);router[_0xabb2('0x11')]('/',auth[_0xabb2('0x9')](),controller['create']);router[_0xabb2('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0xabb2('0x12')]);router[_0xabb2('0x13')](_0xabb2('0xb'),auth['isAuthenticated'](),controller[_0xabb2('0x14')]);router[_0xabb2('0x15')](_0xabb2('0xb'),auth[_0xabb2('0x9')](),controller['destroy']);module[_0xabb2('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c4927b0..cf9dbb3 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 _0xbdb5=['getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','formData','stringify','isString','setDataValue'];(function(_0x3bfc8c,_0x1ae0f9){var _0x4080bd=function(_0x351557){while(--_0x351557){_0x3bfc8c['push'](_0x3bfc8c['shift']());}};_0x4080bd(++_0x1ae0f9);}(_0xbdb5,0x11b));var _0x5bdb=function(_0x3edfd5,_0x2187bd){_0x3edfd5=_0x3edfd5-0x0;var _0x5ab7e6=_0xbdb5[_0x3edfd5];return _0x5ab7e6;};'use strict';var Sequelize=require(_0x5bdb('0x0'));var _=require(_0x5bdb('0x1'));var util=require(_0x5bdb('0x2'));module[_0x5bdb('0x3')]={'name':{'type':Sequelize[_0x5bdb('0x4')],'unique':_0x5bdb('0x5')},'description':{'type':Sequelize[_0x5bdb('0x4')]},'formData':{'type':Sequelize[_0x5bdb('0x6')]('long'),'set':function(_0x44bc3f){if(_['isObjectLike'](_0x44bc3f)){this['setDataValue'](_0x5bdb('0x7'),JSON[_0x5bdb('0x8')](_0x44bc3f));}else if(_[_0x5bdb('0x9')](_0x44bc3f)){this['setDataValue'](_0x5bdb('0x7'),_0x44bc3f);}else{this[_0x5bdb('0xa')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x5bdb('0xb')](_0x5bdb('0x5'))||'',this['getDataValue'](_0x5bdb('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5bdb('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5bdb('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x32cd=['BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue'];(function(_0x201269,_0x24f740){var _0x44f06d=function(_0x5b63be){while(--_0x5b63be){_0x201269['push'](_0x201269['shift']());}};_0x44f06d(++_0x24f740);}(_0x32cd,0x1d1));var _0xd32c=function(_0x7000cc,_0x2258e5){_0x7000cc=_0x7000cc-0x0;var _0x480fc7=_0x32cd[_0x7000cc];return _0x480fc7;};'use strict';var Sequelize=require(_0xd32c('0x0'));var _=require(_0xd32c('0x1'));var util=require(_0xd32c('0x2'));module[_0xd32c('0x3')]={'name':{'type':Sequelize[_0xd32c('0x4')],'unique':_0xd32c('0x5')},'description':{'type':Sequelize[_0xd32c('0x4')]},'formData':{'type':Sequelize[_0xd32c('0x6')](_0xd32c('0x7')),'set':function(_0x51a6bb){if(_[_0xd32c('0x8')](_0x51a6bb)){this[_0xd32c('0x9')](_0xd32c('0xa'),JSON[_0xd32c('0xb')](_0x51a6bb));}else if(_[_0xd32c('0xc')](_0x51a6bb)){this[_0xd32c('0x9')](_0xd32c('0xa'),_0x51a6bb);}else{this['setDataValue'](_0xd32c('0xa'),util[_0xd32c('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd32c('0xe')](_0xd32c('0x5'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd32c('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e1d86a5..7edfc23 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 _0x15ec=['download','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/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','map','JscriptyProject','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','pick','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv'];(function(_0x4cddc9,_0x5e7f02){var _0x1b6f2b=function(_0x310489){while(--_0x310489){_0x4cddc9['push'](_0x4cddc9['shift']());}};_0x1b6f2b(++_0x5e7f02);}(_0x15ec,0x16c));var _0xc15e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x15ec[_0x411add];return _0x238242;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc15e('0x0'));var zipdir=require(_0xc15e('0x1'));var jsonpatch=require(_0xc15e('0x2'));var rp=require(_0xc15e('0x3'));var moment=require(_0xc15e('0x4'));var BPromise=require(_0xc15e('0x5'));var Mustache=require(_0xc15e('0x6'));var util=require(_0xc15e('0x7'));var path=require(_0xc15e('0x8'));var sox=require(_0xc15e('0x9'));var csv=require(_0xc15e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc15e('0xb'));var _=require('lodash');var squel=require(_0xc15e('0xc'));var crypto=require(_0xc15e('0xd'));var jsforce=require(_0xc15e('0xe'));var deskjs=require(_0xc15e('0xf'));var toCsv=require(_0xc15e('0xa'));var querystring=require('querystring');var Papa=require(_0xc15e('0x10'));var Redis=require(_0xc15e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc15e('0x12'));var hardwareService=require(_0xc15e('0x13'));var logger=require(_0xc15e('0x14'))('api');var utils=require(_0xc15e('0x15'));var config=require(_0xc15e('0x16'));var licenseUtil=require(_0xc15e('0x17'));var db=require(_0xc15e('0x18'))['db'];function respondWithStatusCode(_0x19ab2f,_0x16da50){_0x16da50=_0x16da50||0xcc;return function(_0x2f2cf0){if(_0x2f2cf0){return _0x19ab2f[_0xc15e('0x19')](_0x16da50);}return _0x19ab2f['status'](_0x16da50)['end']();};}function respondWithResult(_0x407dd7,_0x4e7b9d){_0x4e7b9d=_0x4e7b9d||0xc8;return function(_0xa4fe4e){if(_0xa4fe4e){return _0x407dd7[_0xc15e('0x1a')](_0x4e7b9d)[_0xc15e('0x1b')](_0xa4fe4e);}};}function respondWithFilteredResult(_0x4b98dd,_0x7d4735){return function(_0x37bf50){if(_0x37bf50){var _0x1eb040=typeof _0x7d4735[_0xc15e('0x1c')]===_0xc15e('0x1d')&&typeof _0x7d4735['limit']===_0xc15e('0x1d');var _0x323865=_0x37bf50[_0xc15e('0x1e')];var _0x57948f=_0x1eb040?0x0:_0x7d4735[_0xc15e('0x1c')];var _0x31a4c9=_0x1eb040?_0x37bf50['count']:_0x7d4735[_0xc15e('0x1c')]+_0x7d4735[_0xc15e('0x1f')];var _0x47c981;if(_0x31a4c9>=_0x323865){_0x31a4c9=_0x323865;_0x47c981=0xc8;}else{_0x47c981=0xce;}_0x4b98dd[_0xc15e('0x1a')](_0x47c981);return _0x4b98dd[_0xc15e('0x20')]('Content-Range',_0x57948f+'-'+_0x31a4c9+'/'+_0x323865)[_0xc15e('0x1b')](_0x37bf50);}return null;};}function patchUpdates(_0x76c281){return function(_0x37d2d1){try{jsonpatch[_0xc15e('0x21')](_0x37d2d1,_0x76c281,!![]);}catch(_0x5ea055){return BPromise[_0xc15e('0x22')](_0x5ea055);}return _0x37d2d1[_0xc15e('0x23')]();};}function saveUpdates(_0x2e4ef6,_0xa2527){return function(_0x5283b9){if(_0x5283b9){return _0x5283b9[_0xc15e('0x24')](_0x2e4ef6)[_0xc15e('0x25')](function(_0x48424e){return _0x48424e;});}return null;};}function removeEntity(_0x15beb7,_0x49e7ee){return function(_0x4e03c8){if(_0x4e03c8){return _0x4e03c8[_0xc15e('0x26')]()['then'](function(){var _0x427a41=_0x4e03c8[_0xc15e('0x27')]({'plain':!![]});var _0x1dfe3a=_0xc15e('0x28');return db[_0xc15e('0x29')][_0xc15e('0x26')]({'where':{'type':_0x1dfe3a,'resourceId':_0x427a41['id']}})[_0xc15e('0x25')](function(){return _0x4e03c8;});})[_0xc15e('0x25')](function(){_0x15beb7[_0xc15e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0377,_0x5b04c6){return function(_0x29f6c7){if(!_0x29f6c7){_0x2c0377[_0xc15e('0x19')](0x194);}return _0x29f6c7;};}function handleError(_0x32010b,_0x13da21){_0x13da21=_0x13da21||0x1f4;return function(_0x2e8ca7){logger[_0xc15e('0x2a')](_0x2e8ca7[_0xc15e('0x2b')]);if(_0x2e8ca7[_0xc15e('0x2c')]){delete _0x2e8ca7['name'];}_0x32010b[_0xc15e('0x1a')](_0x13da21)['send'](_0x2e8ca7);};}exports['index']=function(_0xdecae1,_0x1db0fb){var _0x47f0f7={},_0x2ca2c6={},_0x3e5160={'count':0x0,'rows':[]};var _0xb240aa=_[_0xc15e('0x2d')](db[_0xc15e('0x2e')]['rawAttributes'],function(_0xfa391c){return{'name':_0xfa391c[_0xc15e('0x2f')],'type':_0xfa391c[_0xc15e('0x30')]['key']};});_0x2ca2c6[_0xc15e('0x31')]=_[_0xc15e('0x2d')](_0xb240aa,_0xc15e('0x2c'));_0x2ca2c6[_0xc15e('0x32')]=_[_0xc15e('0x33')](_0xdecae1[_0xc15e('0x32')]);_0x2ca2c6['filters']=_[_0xc15e('0x34')](_0x2ca2c6['model'],_0x2ca2c6[_0xc15e('0x32')]);_0x47f0f7['attributes']=_[_0xc15e('0x34')](_0x2ca2c6['model'],qs[_0xc15e('0x35')](_0xdecae1[_0xc15e('0x32')]['fields']));_0x47f0f7[_0xc15e('0x36')]=_0x47f0f7[_0xc15e('0x36')]['length']?_0x47f0f7[_0xc15e('0x36')]:_0x2ca2c6[_0xc15e('0x31')];if(!_0xdecae1[_0xc15e('0x32')][_0xc15e('0x37')](_0xc15e('0x38'))){_0x47f0f7[_0xc15e('0x1f')]=qs['limit'](_0xdecae1[_0xc15e('0x32')]['limit']);_0x47f0f7[_0xc15e('0x1c')]=qs['offset'](_0xdecae1[_0xc15e('0x32')][_0xc15e('0x1c')]);}_0x47f0f7[_0xc15e('0x39')]=qs[_0xc15e('0x3a')](_0xdecae1[_0xc15e('0x32')][_0xc15e('0x3a')]);_0x47f0f7[_0xc15e('0x3b')]=qs[_0xc15e('0x3c')](_['pick'](_0xdecae1[_0xc15e('0x32')],_0x2ca2c6[_0xc15e('0x3c')]),_0xb240aa);if(_0xdecae1[_0xc15e('0x32')][_0xc15e('0x3d')]){_0x47f0f7[_0xc15e('0x3b')]=_[_0xc15e('0x3e')](_0x47f0f7[_0xc15e('0x3b')],{'$or':_[_0xc15e('0x2d')](_0xb240aa,function(_0x269fe4){if(_0x269fe4[_0xc15e('0x30')]!==_0xc15e('0x3f')){var _0x4fe3a2={};_0x4fe3a2[_0x269fe4[_0xc15e('0x2c')]]={'$like':'%'+_0xdecae1['query'][_0xc15e('0x3d')]+'%'};return _0x4fe3a2;}})});}_0x47f0f7=_[_0xc15e('0x3e')]({},_0x47f0f7,_0xdecae1[_0xc15e('0x40')]);var _0x39435a={'where':_0x47f0f7[_0xc15e('0x3b')]};return db[_0xc15e('0x2e')][_0xc15e('0x1e')](_0x39435a)['then'](function(_0x1b319d){_0x3e5160[_0xc15e('0x1e')]=_0x1b319d;if(_0xdecae1[_0xc15e('0x32')][_0xc15e('0x41')]){_0x47f0f7[_0xc15e('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0xc15e('0x43')](_0x47f0f7);})[_0xc15e('0x25')](function(_0x52a548){_0x3e5160[_0xc15e('0x44')]=_0x52a548;return _0x3e5160;})['then'](respondWithFilteredResult(_0x1db0fb,_0x47f0f7))['catch'](handleError(_0x1db0fb,null));};exports[_0xc15e('0x45')]=function(_0x2348e4,_0x3208e1){var _0x321552={'raw':![],'where':{'id':_0x2348e4[_0xc15e('0x46')]['id']}},_0x2703e0={};_0x2703e0[_0xc15e('0x31')]=_[_0xc15e('0x33')](db['JscriptyProject'][_0xc15e('0x47')]);_0x2703e0[_0xc15e('0x32')]=_['keys'](_0x2348e4[_0xc15e('0x32')]);_0x2703e0[_0xc15e('0x3c')]=_[_0xc15e('0x34')](_0x2703e0['model'],_0x2703e0[_0xc15e('0x32')]);_0x321552[_0xc15e('0x36')]=_['intersection'](_0x2703e0[_0xc15e('0x31')],qs[_0xc15e('0x35')](_0x2348e4[_0xc15e('0x32')][_0xc15e('0x35')]));_0x321552[_0xc15e('0x36')]=_0x321552['attributes'][_0xc15e('0x48')]?_0x321552[_0xc15e('0x36')]:_0x2703e0[_0xc15e('0x31')];if(_0x2348e4['query'][_0xc15e('0x41')]){_0x321552[_0xc15e('0x42')]=[{'all':!![]}];}_0x321552=_['merge']({},_0x321552,_0x2348e4[_0xc15e('0x40')]);return db[_0xc15e('0x2e')][_0xc15e('0x49')](_0x321552)[_0xc15e('0x25')](handleEntityNotFound(_0x3208e1,null))[_0xc15e('0x25')](respondWithResult(_0x3208e1,null))['catch'](handleError(_0x3208e1,null));};exports[_0xc15e('0x4a')]=function(_0x2a4b58,_0x2cd03c){return db[_0xc15e('0x2e')][_0xc15e('0x4a')](_0x2a4b58[_0xc15e('0x4b')],{})[_0xc15e('0x25')](function(_0xeeda6){var _0x5b752f=_0x2a4b58[_0xc15e('0x4c')][_0xc15e('0x27')]({'plain':!![]});if(!_0x5b752f)throw new Error(_0xc15e('0x4d'));if(_0x5b752f['role']===_0xc15e('0x4c')){var _0x4a7a29=_0xeeda6['get']({'plain':!![]});var _0x1525c8=_0xc15e('0x28');return db[_0xc15e('0x4e')][_0xc15e('0x49')]({'where':{'name':_0x1525c8,'userProfileId':_0x5b752f['userProfileId']},'raw':!![]})[_0xc15e('0x25')](function(_0xf602c1){if(_0xf602c1&&_0xf602c1[_0xc15e('0x4f')]===0x0){return db['UserProfileResource'][_0xc15e('0x4a')]({'name':_0x4a7a29[_0xc15e('0x2c')],'resourceId':_0x4a7a29['id'],'type':_0xf602c1['name'],'sectionId':_0xf602c1['id']},{})[_0xc15e('0x25')](function(){return _0xeeda6;});}else{return _0xeeda6;}})[_0xc15e('0x50')](function(_0x1eca8b){logger[_0xc15e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1eca8b);throw _0x1eca8b;});}return _0xeeda6;})[_0xc15e('0x25')](respondWithResult(_0x2cd03c,0xc9))[_0xc15e('0x50')](handleError(_0x2cd03c,null));};exports[_0xc15e('0x51')]=function(_0x2d5ebc,_0x340a51){var _0x306bc8={'where':{'id':_0x2d5ebc['params']['id']}},_0x8f9013={};_0x8f9013[_0xc15e('0x31')]=_[_0xc15e('0x33')](db[_0xc15e('0x2e')][_0xc15e('0x47')]);_0x306bc8[_0xc15e('0x36')]=_[_0xc15e('0x34')](_0x8f9013[_0xc15e('0x31')],qs[_0xc15e('0x35')](_0x2d5ebc[_0xc15e('0x32')]['fields']));_0x306bc8[_0xc15e('0x36')]=_0x306bc8[_0xc15e('0x36')][_0xc15e('0x48')]?_0x306bc8[_0xc15e('0x36')]:_0x8f9013[_0xc15e('0x31')];if(_0x2d5ebc['query'][_0xc15e('0x41')]){_0x306bc8[_0xc15e('0x42')]=[{'all':!![]}];}_0x306bc8=_[_0xc15e('0x3e')]({},_0x306bc8,_0x2d5ebc['options']);return db[_0xc15e('0x2e')]['find'](_0x306bc8)[_0xc15e('0x25')](handleEntityNotFound(_0x340a51,null))['then'](function(_0x4f3aa1){if(_0x4f3aa1){var _0x56202e=_0x4f3aa1[_0xc15e('0x27')]({'plain':!![]});_0x56202e=qs[_0xc15e('0x52')](_0x56202e,['id',_0xc15e('0x53'),_0xc15e('0x54')]);_0x2d5ebc['body']=_[_0xc15e('0x52')](_0x2d5ebc[_0xc15e('0x4b')],['id',_0xc15e('0x53'),'updatedAt']);return db[_0xc15e('0x2e')][_0xc15e('0x4a')](_[_0xc15e('0x3e')](_0x56202e,_0x2d5ebc['body']),{'include':_0x2d5ebc[_0xc15e('0x32')][_0xc15e('0x41')]?[{'all':!![]}]:undefined})[_0xc15e('0x25')](function(_0x32397b){var _0x51fdd9=_0x2d5ebc['user'][_0xc15e('0x27')]({'plain':!![]});if(!_0x51fdd9)throw new Error(_0xc15e('0x4d'));if(_0x51fdd9['role']==='user'){var _0x233c78=_0x32397b[_0xc15e('0x27')]({'plain':!![]});var _0x199f49=_0xc15e('0x28');return db[_0xc15e('0x4e')]['find']({'where':{'name':_0x199f49,'userProfileId':_0x51fdd9['userProfileId']},'raw':!![]})[_0xc15e('0x25')](function(_0x46f8ec){if(_0x46f8ec&&_0x46f8ec['autoAssociation']===0x0){return db['UserProfileResource'][_0xc15e('0x4a')]({'name':_0x233c78['name'],'resourceId':_0x233c78['id'],'type':_0x46f8ec['name'],'sectionId':_0x46f8ec['id']},{})['then'](function(){return _0x32397b;});}else{return _0x32397b;}})[_0xc15e('0x50')](function(_0x5bbf68){logger[_0xc15e('0x2a')](_0xc15e('0x55'),_0x5bbf68);throw _0x5bbf68;});}return _0x32397b;});}})[_0xc15e('0x25')](respondWithResult(_0x340a51,0xc9))[_0xc15e('0x50')](handleError(_0x340a51,null));};exports[_0xc15e('0x24')]=function(_0x3b14a4,_0x5c1e97){if(_0x3b14a4[_0xc15e('0x4b')]['id']){delete _0x3b14a4[_0xc15e('0x4b')]['id'];}return db[_0xc15e('0x2e')][_0xc15e('0x49')]({'where':{'id':_0x3b14a4[_0xc15e('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c1e97,null))[_0xc15e('0x25')](saveUpdates(_0x3b14a4[_0xc15e('0x4b')],null))[_0xc15e('0x25')](respondWithResult(_0x5c1e97,null))['catch'](handleError(_0x5c1e97,null));};exports[_0xc15e('0x26')]=function(_0x49b261,_0x288cf0){return db[_0xc15e('0x2e')]['find']({'where':{'id':_0x49b261[_0xc15e('0x46')]['id']}})[_0xc15e('0x25')](handleEntityNotFound(_0x288cf0,null))[_0xc15e('0x25')](removeEntity(_0x288cf0,null))[_0xc15e('0x50')](handleError(_0x288cf0,null));};exports[_0xc15e('0x56')]=function(_0xfb61be,_0x5d7032,_0x1788dc){var _0x1982bc={'raw':!![],'where':{}};var _0x539d15={};var _0xcc1e09={'count':0x0,'rows':[]};return db[_0xc15e('0x2e')]['findOne']({'where':{'id':_0xfb61be[_0xc15e('0x46')]['id']}})[_0xc15e('0x25')](handleEntityNotFound(_0x5d7032,null))[_0xc15e('0x25')](function(_0x2b07c1){if(_0x2b07c1){_0x539d15[_0xc15e('0x31')]=_[_0xc15e('0x33')](db['JscriptySessionReport'][_0xc15e('0x47')]);_0x539d15[_0xc15e('0x32')]=_[_0xc15e('0x33')](_0xfb61be[_0xc15e('0x32')]);_0x539d15[_0xc15e('0x3c')]=_[_0xc15e('0x34')](_0x539d15[_0xc15e('0x31')],_0x539d15['query']);_0x1982bc[_0xc15e('0x36')]=_[_0xc15e('0x34')](_0x539d15[_0xc15e('0x31')],qs[_0xc15e('0x35')](_0xfb61be['query'][_0xc15e('0x35')]));_0x1982bc[_0xc15e('0x36')]=_0x1982bc[_0xc15e('0x36')][_0xc15e('0x48')]?_0x1982bc[_0xc15e('0x36')]:_0x539d15[_0xc15e('0x31')];if(!_0xfb61be[_0xc15e('0x32')]['hasOwnProperty'](_0xc15e('0x38'))){_0x1982bc[_0xc15e('0x1f')]=qs[_0xc15e('0x1f')](_0xfb61be[_0xc15e('0x32')][_0xc15e('0x1f')]);_0x1982bc['offset']=qs[_0xc15e('0x1c')](_0xfb61be['query']['offset']);}_0x1982bc[_0xc15e('0x39')]=qs[_0xc15e('0x3a')](_0xfb61be['query'][_0xc15e('0x3a')]);_0x1982bc['where']=qs[_0xc15e('0x3c')](_['pick'](_0xfb61be[_0xc15e('0x32')],_0x539d15[_0xc15e('0x3c')]));_0x1982bc['where'][_0xc15e('0x57')]=_0x2b07c1['id'];if(_0xfb61be[_0xc15e('0x32')][_0xc15e('0x3d')]){_0x1982bc[_0xc15e('0x3b')]=_[_0xc15e('0x3e')](_0x1982bc['where'],{'$or':_[_0xc15e('0x2d')](_0x1982bc['attributes'],function(_0x3e6dca){var _0x1cc13d={};_0x1cc13d[_0x3e6dca]={'$like':'%'+_0xfb61be[_0xc15e('0x32')]['filter']+'%'};return _0x1cc13d;})});}_0x1982bc=_[_0xc15e('0x3e')]({},_0x1982bc,_0xfb61be[_0xc15e('0x40')]);return db['JscriptySessionReport'][_0xc15e('0x1e')]({'where':_0x1982bc[_0xc15e('0x3b')]})[_0xc15e('0x25')](function(_0x416d8d){_0xcc1e09[_0xc15e('0x1e')]=_0x416d8d;if(_0xfb61be[_0xc15e('0x32')][_0xc15e('0x41')]){_0x1982bc[_0xc15e('0x42')]=[{'all':!![]}];}return db[_0xc15e('0x58')][_0xc15e('0x43')](_0x1982bc);})[_0xc15e('0x25')](function(_0x56a86f){_0xcc1e09['rows']=_0x56a86f;return _0xcc1e09;});}})['then'](respondWithFilteredResult(_0x5d7032,_0x1982bc))[_0xc15e('0x50')](handleError(_0x5d7032,null));};exports[_0xc15e('0x59')]=function(_0x4cc5aa,_0x53b01a,_0x2866b4){var _0x5447ac={'raw':!![],'where':{}};var _0x4735c3={};var _0x40aa4b={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc15e('0x5a')]({'where':{'id':_0x4cc5aa[_0xc15e('0x46')]['id']}})['then'](handleEntityNotFound(_0x53b01a,null))[_0xc15e('0x25')](function(_0x4ad018){if(_0x4ad018){_0x4735c3[_0xc15e('0x31')]=_[_0xc15e('0x33')](db[_0xc15e('0x5b')][_0xc15e('0x47')]);_0x4735c3['query']=_[_0xc15e('0x33')](_0x4cc5aa['query']);_0x4735c3[_0xc15e('0x3c')]=_[_0xc15e('0x34')](_0x4735c3[_0xc15e('0x31')],_0x4735c3[_0xc15e('0x32')]);_0x5447ac['attributes']=_[_0xc15e('0x34')](_0x4735c3[_0xc15e('0x31')],qs['fields'](_0x4cc5aa[_0xc15e('0x32')]['fields']));_0x5447ac[_0xc15e('0x36')]=_0x5447ac[_0xc15e('0x36')][_0xc15e('0x48')]?_0x5447ac[_0xc15e('0x36')]:_0x4735c3[_0xc15e('0x31')];if(!_0x4cc5aa[_0xc15e('0x32')][_0xc15e('0x37')]('nolimit')){_0x5447ac[_0xc15e('0x1f')]=qs[_0xc15e('0x1f')](_0x4cc5aa['query'][_0xc15e('0x1f')]);_0x5447ac[_0xc15e('0x1c')]=qs[_0xc15e('0x1c')](_0x4cc5aa['query'][_0xc15e('0x1c')]);}_0x5447ac[_0xc15e('0x39')]=qs[_0xc15e('0x3a')](_0x4cc5aa[_0xc15e('0x32')][_0xc15e('0x3a')]);_0x5447ac['where']=qs[_0xc15e('0x3c')](_[_0xc15e('0x5c')](_0x4cc5aa[_0xc15e('0x32')],_0x4735c3[_0xc15e('0x3c')]));_0x5447ac[_0xc15e('0x3b')][_0xc15e('0x57')]=_0x4ad018['id'];if(_0x4cc5aa[_0xc15e('0x32')]['filter']){_0x5447ac[_0xc15e('0x3b')]=_[_0xc15e('0x3e')](_0x5447ac['where'],{'$or':_['map'](_0x5447ac[_0xc15e('0x36')],function(_0x5d2c96){var _0x4d1af0={};_0x4d1af0[_0x5d2c96]={'$like':'%'+_0x4cc5aa[_0xc15e('0x32')][_0xc15e('0x3d')]+'%'};return _0x4d1af0;})});}_0x5447ac=_[_0xc15e('0x3e')]({},_0x5447ac,_0x4cc5aa[_0xc15e('0x40')]);return db[_0xc15e('0x5b')]['count']({'where':_0x5447ac[_0xc15e('0x3b')]})['then'](function(_0x17a4b7){_0x40aa4b[_0xc15e('0x1e')]=_0x17a4b7;if(_0x4cc5aa[_0xc15e('0x32')]['includeAll']){_0x5447ac[_0xc15e('0x42')]=[{'all':!![]}];}return db[_0xc15e('0x5b')]['findAll'](_0x5447ac);})[_0xc15e('0x25')](function(_0x39111b){_0x40aa4b[_0xc15e('0x44')]=_0x39111b;return _0x40aa4b;});}})[_0xc15e('0x25')](respondWithFilteredResult(_0x53b01a,_0x5447ac))[_0xc15e('0x50')](handleError(_0x53b01a,null));};function char(_0x3b021e){return _0xc15e('0x5d')===typeof _0x3b021e?String[_0xc15e('0x5e')][_0xc15e('0x21')](null,arguments):_0x3b021e;}function needsEncapsulation(_0x155820){return!!_0x155820&&(_0x155820[_0xc15e('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x155820[_0xc15e('0x5f')]()[_0xc15e('0x60')](char(0xa))>=0x0||_0x155820['toString']()[_0xc15e('0x60')](char(0x2c))>=0x0||_0x155820[_0xc15e('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x50a191){var _0x1c6a5a=char(0x22),_0x248613='\x5c'+char(0x22),_0x538379=_0x50a191['toString']()['replace'](new RegExp(_0x1c6a5a,'g'),_0x248613);return _0x1c6a5a+_0x538379+_0x1c6a5a;}exports[_0xc15e('0x61')]=function(_0x4559cd,_0x337829,_0x38abbc){var _0x2b358f,_0x22d313;var _0x3d6d29={'where':{'ProjectId':_0x4559cd['params']['id']}};if(_0x4559cd[_0xc15e('0x32')][_0xc15e('0x62')]){_0x3d6d29[_0xc15e('0x3b')][_0xc15e('0x63')]=JSON[_0xc15e('0x64')](_0x4559cd[_0xc15e('0x32')][_0xc15e('0x62')]);}return db[_0xc15e('0x58')]['findAll'](_0x3d6d29)[_0xc15e('0x25')](handleEntityNotFound(_0x337829,null))[_0xc15e('0x25')](function(_0x467f1){if(_0x467f1){_0x2b358f=_0x467f1;return db[_0xc15e('0x65')][_0xc15e('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x2b358f,'id')},'ProjectId':_0x4559cd[_0xc15e('0x46')]['id']},'order':_0xc15e('0x66')});}})[_0xc15e('0x25')](handleEntityNotFound(_0x337829,null))[_0xc15e('0x25')](function(_0x289801){if(_0x289801){_0x22d313=_0x289801;var _0x4413e1={};for(var _0x4f69b0=0x0,_0x261c37=_0x22d313['length'];_0x4f69b0<_0x261c37;_0x4f69b0++){if(!_0x4413e1[_0xc15e('0x37')](_0x22d313[_0x4f69b0]['questionId'])){_0x4413e1[_0x22d313[_0x4f69b0][_0xc15e('0x67')]]=needsEncapsulation(_0x22d313[_0x4f69b0]['question'])?encapsulate(_0x22d313[_0x4f69b0][_0xc15e('0x68')]):_0x22d313[_0x4f69b0][_0xc15e('0x68')];}}var _0x584a26=[],_0xa9825a={};for(var _0x1c029c=0x0,_0xcaff4=_0x2b358f[_0xc15e('0x48')];_0x1c029c<_0xcaff4;_0x1c029c++){_0xa9825a={'ProjectId':_0x4559cd['params']['id'],'SessionId':_0x2b358f[_0x1c029c]['id'],'StartTime':moment(_0x2b358f[_0x1c029c]['starttime'])[_0xc15e('0x69')](_0xc15e('0x6a'))};for(var _0x2d0e1f=0x0,_0x2fca32=_0x22d313[_0xc15e('0x48')];_0x2d0e1f<_0x2fca32;_0x2d0e1f++){if(_0x22d313[_0x2d0e1f][_0xc15e('0x6b')]==_0x2b358f[_0x1c029c]['id']&&_0x4413e1[_0xc15e('0x37')](_0x22d313[_0x2d0e1f][_0xc15e('0x67')])){_0xa9825a[_0x4413e1[_0x22d313[_0x2d0e1f][_0xc15e('0x67')]]]=_0x22d313[_0x2d0e1f][_0xc15e('0x6c')];}}for(var _0x44d585 in _0x4413e1){if(!_0xa9825a[_0xc15e('0x37')](_0x4413e1[_0x44d585])){_0xa9825a[_0x4413e1[_0x44d585]]=null;}}_0x584a26[_0xc15e('0x6d')](_0xa9825a);}return _0x584a26;}})[_0xc15e('0x25')](function(_0x2f43dc){if(!_[_0xc15e('0x6e')](_0x2f43dc)){var _0x2f7b88=toCsv(_0x2f43dc);var _0x3b0cc5=Date[_0xc15e('0x6f')]();fs[_0xc15e('0x70')](util[_0xc15e('0x69')](_0xc15e('0x71'),_0x4559cd[_0xc15e('0x46')]['id'],_0x3b0cc5),_0x2f7b88);_0x337829[_0xc15e('0x72')](_0xc15e('0x73'),_0xc15e('0x74')+util[_0xc15e('0x69')](_0xc15e('0x75'),_0x4559cd[_0xc15e('0x46')]['id'],_0x3b0cc5));_0x337829[_0xc15e('0x72')](_0xc15e('0x76'),_0xc15e('0x77'));return _0x337829[_0xc15e('0x78')](util[_0xc15e('0x69')](_0xc15e('0x71'),_0x4559cd[_0xc15e('0x46')]['id'],_0x3b0cc5));}else{return _0x337829[_0xc15e('0x19')](0xcc);}})[_0xc15e('0x50')](handleError(_0x337829,null));}; \ No newline at end of file +var _0x281d=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','UserProfileSection','getSessions','findOne','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','hasOwnProperty','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','options','includeAll','rows','show','include'];(function(_0x2fb450,_0x2e4e56){var _0x3ce76e=function(_0x224cb2){while(--_0x224cb2){_0x2fb450['push'](_0x2fb450['shift']());}};_0x3ce76e(++_0x2e4e56);}(_0x281d,0x195));var _0xd281=function(_0x215757,_0x1a9557){_0x215757=_0x215757-0x0;var _0x5900ac=_0x281d[_0x215757];return _0x5900ac;};'use strict';var emlformat=require(_0xd281('0x0'));var rimraf=require(_0xd281('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd281('0x2'));var rp=require(_0xd281('0x3'));var moment=require(_0xd281('0x4'));var BPromise=require(_0xd281('0x5'));var Mustache=require(_0xd281('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd281('0x7'));var csv=require(_0xd281('0x8'));var ejs=require(_0xd281('0x9'));var fs=require('fs');var fs_extra=require(_0xd281('0xa'));var _=require('lodash');var squel=require(_0xd281('0xb'));var crypto=require('crypto');var jsforce=require(_0xd281('0xc'));var deskjs=require(_0xd281('0xd'));var toCsv=require(_0xd281('0x8'));var querystring=require(_0xd281('0xe'));var Papa=require(_0xd281('0xf'));var Redis=require(_0xd281('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd281('0x11'));var as=require(_0xd281('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd281('0x13'))(_0xd281('0x14'));var utils=require(_0xd281('0x15'));var config=require(_0xd281('0x16'));var licenseUtil=require(_0xd281('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9785,_0x34f63a){_0x34f63a=_0x34f63a||0xcc;return function(_0x1f3000){if(_0x1f3000){return _0x2f9785['sendStatus'](_0x34f63a);}return _0x2f9785[_0xd281('0x18')](_0x34f63a)[_0xd281('0x19')]();};}function respondWithResult(_0x14765e,_0x2e12f4){_0x2e12f4=_0x2e12f4||0xc8;return function(_0x4de9e9){if(_0x4de9e9){return _0x14765e[_0xd281('0x18')](_0x2e12f4)[_0xd281('0x1a')](_0x4de9e9);}};}function respondWithFilteredResult(_0x46f573,_0x2bd07c){return function(_0x22d167){if(_0x22d167){var _0x3a1609=typeof _0x2bd07c[_0xd281('0x1b')]===_0xd281('0x1c')&&typeof _0x2bd07c[_0xd281('0x1d')]===_0xd281('0x1c');var _0x4993fb=_0x22d167[_0xd281('0x1e')];var _0x537002=_0x3a1609?0x0:_0x2bd07c[_0xd281('0x1b')];var _0x3e9ee0=_0x3a1609?_0x22d167['count']:_0x2bd07c[_0xd281('0x1b')]+_0x2bd07c[_0xd281('0x1d')];var _0x2144b1;if(_0x3e9ee0>=_0x4993fb){_0x3e9ee0=_0x4993fb;_0x2144b1=0xc8;}else{_0x2144b1=0xce;}_0x46f573[_0xd281('0x18')](_0x2144b1);return _0x46f573[_0xd281('0x1f')](_0xd281('0x20'),_0x537002+'-'+_0x3e9ee0+'/'+_0x4993fb)['json'](_0x22d167);}return null;};}function patchUpdates(_0xcf20e6){return function(_0x13e796){try{jsonpatch[_0xd281('0x21')](_0x13e796,_0xcf20e6,!![]);}catch(_0x6f1f58){return BPromise[_0xd281('0x22')](_0x6f1f58);}return _0x13e796['save']();};}function saveUpdates(_0x1d6b91,_0x5a2416){return function(_0x1ec197){if(_0x1ec197){return _0x1ec197[_0xd281('0x23')](_0x1d6b91)[_0xd281('0x24')](function(_0x2e1798){return _0x2e1798;});}return null;};}function removeEntity(_0x67e9b6,_0x352c3b){return function(_0x3a15ce){if(_0x3a15ce){return _0x3a15ce[_0xd281('0x25')]()[_0xd281('0x24')](function(){var _0xa7165b=_0x3a15ce[_0xd281('0x26')]({'plain':!![]});var _0x4998b5=_0xd281('0x27');return db[_0xd281('0x28')][_0xd281('0x25')]({'where':{'type':_0x4998b5,'resourceId':_0xa7165b['id']}})[_0xd281('0x24')](function(){return _0x3a15ce;});})['then'](function(){_0x67e9b6[_0xd281('0x18')](0xcc)[_0xd281('0x19')]();});}};}function handleEntityNotFound(_0x3df7e5,_0x4b9e04){return function(_0x41ae36){if(!_0x41ae36){_0x3df7e5['sendStatus'](0x194);}return _0x41ae36;};}function handleError(_0x59862c,_0x21ad56){_0x21ad56=_0x21ad56||0x1f4;return function(_0x2172a4){logger[_0xd281('0x29')](_0x2172a4[_0xd281('0x2a')]);if(_0x2172a4['name']){delete _0x2172a4[_0xd281('0x2b')];}_0x59862c[_0xd281('0x18')](_0x21ad56)[_0xd281('0x2c')](_0x2172a4);};}exports[_0xd281('0x2d')]=function(_0x49c656,_0x5ef27d){var _0x113c75={},_0x4b2d64={},_0x548984={'count':0x0,'rows':[]};var _0x35690b=_[_0xd281('0x2e')](db[_0xd281('0x2f')][_0xd281('0x30')],function(_0x5d08c0){return{'name':_0x5d08c0[_0xd281('0x31')],'type':_0x5d08c0['type'][_0xd281('0x32')]};});_0x4b2d64[_0xd281('0x33')]=_['map'](_0x35690b,_0xd281('0x2b'));_0x4b2d64[_0xd281('0x34')]=_[_0xd281('0x35')](_0x49c656['query']);_0x4b2d64[_0xd281('0x36')]=_[_0xd281('0x37')](_0x4b2d64[_0xd281('0x33')],_0x4b2d64[_0xd281('0x34')]);_0x113c75[_0xd281('0x38')]=_[_0xd281('0x37')](_0x4b2d64['model'],qs[_0xd281('0x39')](_0x49c656[_0xd281('0x34')][_0xd281('0x39')]));_0x113c75[_0xd281('0x38')]=_0x113c75[_0xd281('0x38')][_0xd281('0x3a')]?_0x113c75['attributes']:_0x4b2d64[_0xd281('0x33')];if(!_0x49c656[_0xd281('0x34')]['hasOwnProperty'](_0xd281('0x3b'))){_0x113c75[_0xd281('0x1d')]=qs['limit'](_0x49c656[_0xd281('0x34')][_0xd281('0x1d')]);_0x113c75['offset']=qs[_0xd281('0x1b')](_0x49c656[_0xd281('0x34')][_0xd281('0x1b')]);}_0x113c75['order']=qs[_0xd281('0x3c')](_0x49c656['query'][_0xd281('0x3c')]);_0x113c75[_0xd281('0x3d')]=qs['filters'](_[_0xd281('0x3e')](_0x49c656['query'],_0x4b2d64[_0xd281('0x36')]),_0x35690b);if(_0x49c656[_0xd281('0x34')][_0xd281('0x3f')]){_0x113c75[_0xd281('0x3d')]=_[_0xd281('0x40')](_0x113c75[_0xd281('0x3d')],{'$or':_[_0xd281('0x2e')](_0x35690b,function(_0x29769c){if(_0x29769c[_0xd281('0x41')]!=='VIRTUAL'){var _0x151b69={};_0x151b69[_0x29769c['name']]={'$like':'%'+_0x49c656[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x151b69;}})});}_0x113c75=_['merge']({},_0x113c75,_0x49c656[_0xd281('0x42')]);var _0x3bcc8b={'where':_0x113c75[_0xd281('0x3d')]};return db['JscriptyProject'][_0xd281('0x1e')](_0x3bcc8b)[_0xd281('0x24')](function(_0xbc05a2){_0x548984[_0xd281('0x1e')]=_0xbc05a2;if(_0x49c656[_0xd281('0x34')][_0xd281('0x43')]){_0x113c75['include']=[{'all':!![]}];}return db[_0xd281('0x2f')]['findAll'](_0x113c75);})[_0xd281('0x24')](function(_0x33caaa){_0x548984[_0xd281('0x44')]=_0x33caaa;return _0x548984;})[_0xd281('0x24')](respondWithFilteredResult(_0x5ef27d,_0x113c75))['catch'](handleError(_0x5ef27d,null));};exports[_0xd281('0x45')]=function(_0x2b624a,_0x2535c3){var _0x5caff8={'raw':![],'where':{'id':_0x2b624a['params']['id']}},_0x50d958={};_0x50d958['model']=_[_0xd281('0x35')](db[_0xd281('0x2f')][_0xd281('0x30')]);_0x50d958[_0xd281('0x34')]=_['keys'](_0x2b624a[_0xd281('0x34')]);_0x50d958[_0xd281('0x36')]=_[_0xd281('0x37')](_0x50d958['model'],_0x50d958[_0xd281('0x34')]);_0x5caff8[_0xd281('0x38')]=_[_0xd281('0x37')](_0x50d958[_0xd281('0x33')],qs[_0xd281('0x39')](_0x2b624a[_0xd281('0x34')][_0xd281('0x39')]));_0x5caff8[_0xd281('0x38')]=_0x5caff8[_0xd281('0x38')]['length']?_0x5caff8[_0xd281('0x38')]:_0x50d958['model'];if(_0x2b624a[_0xd281('0x34')][_0xd281('0x43')]){_0x5caff8[_0xd281('0x46')]=[{'all':!![]}];}_0x5caff8=_[_0xd281('0x40')]({},_0x5caff8,_0x2b624a[_0xd281('0x42')]);return db[_0xd281('0x2f')]['find'](_0x5caff8)['then'](handleEntityNotFound(_0x2535c3,null))[_0xd281('0x24')](respondWithResult(_0x2535c3,null))[_0xd281('0x47')](handleError(_0x2535c3,null));};exports[_0xd281('0x48')]=function(_0x257c7b,_0xa72d34){return db['JscriptyProject'][_0xd281('0x48')](_0x257c7b[_0xd281('0x49')],{})[_0xd281('0x24')](function(_0x443582){var _0xee2a2f=_0x257c7b[_0xd281('0x4a')][_0xd281('0x26')]({'plain':!![]});if(!_0xee2a2f)throw new Error(_0xd281('0x4b'));if(_0xee2a2f[_0xd281('0x4c')]===_0xd281('0x4a')){var _0x49f580=_0x443582['get']({'plain':!![]});var _0x5d4b71='Projects';return db['UserProfileSection'][_0xd281('0x4d')]({'where':{'name':_0x5d4b71,'userProfileId':_0xee2a2f[_0xd281('0x4e')]},'raw':!![]})[_0xd281('0x24')](function(_0x50bd6f){if(_0x50bd6f&&_0x50bd6f[_0xd281('0x4f')]===0x0){return db['UserProfileResource'][_0xd281('0x48')]({'name':_0x49f580[_0xd281('0x2b')],'resourceId':_0x49f580['id'],'type':_0x50bd6f[_0xd281('0x2b')],'sectionId':_0x50bd6f['id']},{})[_0xd281('0x24')](function(){return _0x443582;});}else{return _0x443582;}})[_0xd281('0x47')](function(_0x419023){logger[_0xd281('0x29')](_0xd281('0x50'),_0x419023);throw _0x419023;});}return _0x443582;})[_0xd281('0x24')](respondWithResult(_0xa72d34,0xc9))[_0xd281('0x47')](handleError(_0xa72d34,null));};exports['clone']=function(_0x20c1b7,_0x4c3ca2){var _0x44efe0={'where':{'id':_0x20c1b7[_0xd281('0x51')]['id']}},_0x1a120c={};_0x1a120c[_0xd281('0x33')]=_[_0xd281('0x35')](db['JscriptyProject']['rawAttributes']);_0x44efe0['attributes']=_[_0xd281('0x37')](_0x1a120c[_0xd281('0x33')],qs[_0xd281('0x39')](_0x20c1b7[_0xd281('0x34')][_0xd281('0x39')]));_0x44efe0[_0xd281('0x38')]=_0x44efe0[_0xd281('0x38')]['length']?_0x44efe0[_0xd281('0x38')]:_0x1a120c[_0xd281('0x33')];if(_0x20c1b7[_0xd281('0x34')]['includeAll']){_0x44efe0[_0xd281('0x46')]=[{'all':!![]}];}_0x44efe0=_[_0xd281('0x40')]({},_0x44efe0,_0x20c1b7[_0xd281('0x42')]);return db[_0xd281('0x2f')][_0xd281('0x4d')](_0x44efe0)[_0xd281('0x24')](handleEntityNotFound(_0x4c3ca2,null))['then'](function(_0x2c7e26){if(_0x2c7e26){var _0x2ad66a=_0x2c7e26[_0xd281('0x26')]({'plain':!![]});_0x2ad66a=qs['omit'](_0x2ad66a,['id',_0xd281('0x52'),_0xd281('0x53')]);_0x20c1b7[_0xd281('0x49')]=_[_0xd281('0x54')](_0x20c1b7[_0xd281('0x49')],['id',_0xd281('0x52'),_0xd281('0x53')]);return db[_0xd281('0x2f')][_0xd281('0x48')](_['merge'](_0x2ad66a,_0x20c1b7[_0xd281('0x49')]),{'include':_0x20c1b7[_0xd281('0x34')][_0xd281('0x43')]?[{'all':!![]}]:undefined})[_0xd281('0x24')](function(_0x297fe5){var _0x17ac1b=_0x20c1b7['user'][_0xd281('0x26')]({'plain':!![]});if(!_0x17ac1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17ac1b[_0xd281('0x4c')]===_0xd281('0x4a')){var _0x3e5c1d=_0x297fe5[_0xd281('0x26')]({'plain':!![]});var _0x4c33b9=_0xd281('0x27');return db[_0xd281('0x55')][_0xd281('0x4d')]({'where':{'name':_0x4c33b9,'userProfileId':_0x17ac1b['userProfileId']},'raw':!![]})[_0xd281('0x24')](function(_0xa173ce){if(_0xa173ce&&_0xa173ce[_0xd281('0x4f')]===0x0){return db[_0xd281('0x28')][_0xd281('0x48')]({'name':_0x3e5c1d[_0xd281('0x2b')],'resourceId':_0x3e5c1d['id'],'type':_0xa173ce[_0xd281('0x2b')],'sectionId':_0xa173ce['id']},{})[_0xd281('0x24')](function(){return _0x297fe5;});}else{return _0x297fe5;}})[_0xd281('0x47')](function(_0x4fd523){logger[_0xd281('0x29')](_0xd281('0x50'),_0x4fd523);throw _0x4fd523;});}return _0x297fe5;});}})[_0xd281('0x24')](respondWithResult(_0x4c3ca2,0xc9))[_0xd281('0x47')](handleError(_0x4c3ca2,null));};exports[_0xd281('0x23')]=function(_0x1e63d5,_0x2c6ff6){if(_0x1e63d5[_0xd281('0x49')]['id']){delete _0x1e63d5['body']['id'];}return db[_0xd281('0x2f')]['find']({'where':{'id':_0x1e63d5[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x2c6ff6,null))['then'](saveUpdates(_0x1e63d5[_0xd281('0x49')],null))[_0xd281('0x24')](respondWithResult(_0x2c6ff6,null))[_0xd281('0x47')](handleError(_0x2c6ff6,null));};exports[_0xd281('0x25')]=function(_0x49d9ea,_0x28632b){return db['JscriptyProject'][_0xd281('0x4d')]({'where':{'id':_0x49d9ea[_0xd281('0x51')]['id']}})['then'](handleEntityNotFound(_0x28632b,null))[_0xd281('0x24')](removeEntity(_0x28632b,null))[_0xd281('0x47')](handleError(_0x28632b,null));};exports[_0xd281('0x56')]=function(_0x6b4e5,_0x3670b5,_0x3e5ed5){var _0xf6cbcb={'raw':!![],'where':{}};var _0x2a1a8f={};var _0x2e5bf4={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd281('0x57')]({'where':{'id':_0x6b4e5[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x3670b5,null))['then'](function(_0x1ca508){if(_0x1ca508){_0x2a1a8f[_0xd281('0x33')]=_['keys'](db[_0xd281('0x58')][_0xd281('0x30')]);_0x2a1a8f['query']=_[_0xd281('0x35')](_0x6b4e5[_0xd281('0x34')]);_0x2a1a8f[_0xd281('0x36')]=_[_0xd281('0x37')](_0x2a1a8f[_0xd281('0x33')],_0x2a1a8f['query']);_0xf6cbcb[_0xd281('0x38')]=_[_0xd281('0x37')](_0x2a1a8f[_0xd281('0x33')],qs[_0xd281('0x39')](_0x6b4e5[_0xd281('0x34')][_0xd281('0x39')]));_0xf6cbcb[_0xd281('0x38')]=_0xf6cbcb['attributes'][_0xd281('0x3a')]?_0xf6cbcb[_0xd281('0x38')]:_0x2a1a8f[_0xd281('0x33')];if(!_0x6b4e5[_0xd281('0x34')]['hasOwnProperty'](_0xd281('0x3b'))){_0xf6cbcb[_0xd281('0x1d')]=qs['limit'](_0x6b4e5['query'][_0xd281('0x1d')]);_0xf6cbcb[_0xd281('0x1b')]=qs['offset'](_0x6b4e5[_0xd281('0x34')][_0xd281('0x1b')]);}_0xf6cbcb[_0xd281('0x59')]=qs[_0xd281('0x3c')](_0x6b4e5[_0xd281('0x34')][_0xd281('0x3c')]);_0xf6cbcb[_0xd281('0x3d')]=qs['filters'](_[_0xd281('0x3e')](_0x6b4e5['query'],_0x2a1a8f[_0xd281('0x36')]));_0xf6cbcb[_0xd281('0x3d')][_0xd281('0x5a')]=_0x1ca508['id'];if(_0x6b4e5[_0xd281('0x34')][_0xd281('0x3f')]){_0xf6cbcb[_0xd281('0x3d')]=_[_0xd281('0x40')](_0xf6cbcb[_0xd281('0x3d')],{'$or':_['map'](_0xf6cbcb[_0xd281('0x38')],function(_0x392da4){var _0x1c56ec={};_0x1c56ec[_0x392da4]={'$like':'%'+_0x6b4e5[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x1c56ec;})});}_0xf6cbcb=_[_0xd281('0x40')]({},_0xf6cbcb,_0x6b4e5[_0xd281('0x42')]);return db[_0xd281('0x58')][_0xd281('0x1e')]({'where':_0xf6cbcb['where']})[_0xd281('0x24')](function(_0x2ca34c){_0x2e5bf4[_0xd281('0x1e')]=_0x2ca34c;if(_0x6b4e5[_0xd281('0x34')][_0xd281('0x43')]){_0xf6cbcb[_0xd281('0x46')]=[{'all':!![]}];}return db[_0xd281('0x58')][_0xd281('0x5b')](_0xf6cbcb);})[_0xd281('0x24')](function(_0x245831){_0x2e5bf4['rows']=_0x245831;return _0x2e5bf4;});}})[_0xd281('0x24')](respondWithFilteredResult(_0x3670b5,_0xf6cbcb))['catch'](handleError(_0x3670b5,null));};exports[_0xd281('0x5c')]=function(_0xec1a4,_0x2304b9,_0xe66e14){var _0x5b9f73={'raw':!![],'where':{}};var _0x4ab061={};var _0x2c904e={'count':0x0,'rows':[]};return db[_0xd281('0x2f')]['findOne']({'where':{'id':_0xec1a4[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x2304b9,null))['then'](function(_0x973f36){if(_0x973f36){_0x4ab061[_0xd281('0x33')]=_[_0xd281('0x35')](db[_0xd281('0x5d')]['rawAttributes']);_0x4ab061['query']=_['keys'](_0xec1a4[_0xd281('0x34')]);_0x4ab061[_0xd281('0x36')]=_['intersection'](_0x4ab061[_0xd281('0x33')],_0x4ab061[_0xd281('0x34')]);_0x5b9f73['attributes']=_[_0xd281('0x37')](_0x4ab061['model'],qs['fields'](_0xec1a4[_0xd281('0x34')][_0xd281('0x39')]));_0x5b9f73['attributes']=_0x5b9f73['attributes'][_0xd281('0x3a')]?_0x5b9f73[_0xd281('0x38')]:_0x4ab061[_0xd281('0x33')];if(!_0xec1a4['query']['hasOwnProperty'](_0xd281('0x3b'))){_0x5b9f73[_0xd281('0x1d')]=qs[_0xd281('0x1d')](_0xec1a4[_0xd281('0x34')][_0xd281('0x1d')]);_0x5b9f73[_0xd281('0x1b')]=qs[_0xd281('0x1b')](_0xec1a4['query'][_0xd281('0x1b')]);}_0x5b9f73[_0xd281('0x59')]=qs[_0xd281('0x3c')](_0xec1a4[_0xd281('0x34')][_0xd281('0x3c')]);_0x5b9f73[_0xd281('0x3d')]=qs[_0xd281('0x36')](_[_0xd281('0x3e')](_0xec1a4['query'],_0x4ab061[_0xd281('0x36')]));_0x5b9f73[_0xd281('0x3d')][_0xd281('0x5a')]=_0x973f36['id'];if(_0xec1a4[_0xd281('0x34')][_0xd281('0x3f')]){_0x5b9f73[_0xd281('0x3d')]=_[_0xd281('0x40')](_0x5b9f73['where'],{'$or':_[_0xd281('0x2e')](_0x5b9f73[_0xd281('0x38')],function(_0x4f7d2a){var _0x25f076={};_0x25f076[_0x4f7d2a]={'$like':'%'+_0xec1a4[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x25f076;})});}_0x5b9f73=_[_0xd281('0x40')]({},_0x5b9f73,_0xec1a4[_0xd281('0x42')]);return db['JscriptyAnswerReport'][_0xd281('0x1e')]({'where':_0x5b9f73[_0xd281('0x3d')]})['then'](function(_0x5dff26){_0x2c904e[_0xd281('0x1e')]=_0x5dff26;if(_0xec1a4[_0xd281('0x34')]['includeAll']){_0x5b9f73[_0xd281('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd281('0x5b')](_0x5b9f73);})[_0xd281('0x24')](function(_0x2f2676){_0x2c904e['rows']=_0x2f2676;return _0x2c904e;});}})[_0xd281('0x24')](respondWithFilteredResult(_0x2304b9,_0x5b9f73))['catch'](handleError(_0x2304b9,null));};function char(_0x218823){return _0xd281('0x5e')===typeof _0x218823?String['fromCharCode'][_0xd281('0x21')](null,arguments):_0x218823;}function needsEncapsulation(_0x512c2e){return!!_0x512c2e&&(_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0xd))>=0x0||_0x512c2e['toString']()[_0xd281('0x60')](char(0xa))>=0x0||_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0x2c))>=0x0||_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0x22))>=0x0);}function encapsulate(_0x5c9641){var _0xf7bc0d=char(0x22),_0x438145='\x5c'+char(0x22),_0x577b7f=_0x5c9641[_0xd281('0x5f')]()['replace'](new RegExp(_0xf7bc0d,'g'),_0x438145);return _0xf7bc0d+_0x577b7f+_0xf7bc0d;}exports[_0xd281('0x61')]=function(_0x3b68a8,_0x5476a7,_0x22e5e9){var _0x2443ef,_0x54dc57;var _0x8b37e1={'where':{'ProjectId':_0x3b68a8[_0xd281('0x51')]['id']}};if(_0x3b68a8[_0xd281('0x34')][_0xd281('0x62')]){_0x8b37e1[_0xd281('0x3d')][_0xd281('0x63')]=JSON[_0xd281('0x64')](_0x3b68a8[_0xd281('0x34')]['startTime']);}return db[_0xd281('0x58')]['findAll'](_0x8b37e1)[_0xd281('0x24')](handleEntityNotFound(_0x5476a7,null))['then'](function(_0x1b1dfa){if(_0x1b1dfa){_0x2443ef=_0x1b1dfa;return db[_0xd281('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xd281('0x2e')](_0x2443ef,'id')},'ProjectId':_0x3b68a8['params']['id']},'order':_0xd281('0x66')});}})[_0xd281('0x24')](handleEntityNotFound(_0x5476a7,null))[_0xd281('0x24')](function(_0x350b9d){if(_0x350b9d){_0x54dc57=_0x350b9d;var _0x13a154={};for(var _0x1f19f1=0x0,_0x541b1c=_0x54dc57[_0xd281('0x3a')];_0x1f19f1<_0x541b1c;_0x1f19f1++){if(!_0x13a154[_0xd281('0x67')](_0x54dc57[_0x1f19f1][_0xd281('0x68')])){_0x13a154[_0x54dc57[_0x1f19f1][_0xd281('0x68')]]=needsEncapsulation(_0x54dc57[_0x1f19f1][_0xd281('0x69')])?encapsulate(_0x54dc57[_0x1f19f1][_0xd281('0x69')]):_0x54dc57[_0x1f19f1][_0xd281('0x69')];}}var _0x153fa4=[],_0x467c85={};for(var _0x5b9171=0x0,_0x3acf9f=_0x2443ef[_0xd281('0x3a')];_0x5b9171<_0x3acf9f;_0x5b9171++){_0x467c85={'ProjectId':_0x3b68a8['params']['id'],'SessionId':_0x2443ef[_0x5b9171]['id'],'StartTime':moment(_0x2443ef[_0x5b9171][_0xd281('0x63')])[_0xd281('0x6a')](_0xd281('0x6b'))};for(var _0x4568ba=0x0,_0x53b66f=_0x54dc57[_0xd281('0x3a')];_0x4568ba<_0x53b66f;_0x4568ba++){if(_0x54dc57[_0x4568ba][_0xd281('0x6c')]==_0x2443ef[_0x5b9171]['id']&&_0x13a154[_0xd281('0x67')](_0x54dc57[_0x4568ba][_0xd281('0x68')])){_0x467c85[_0x13a154[_0x54dc57[_0x4568ba][_0xd281('0x68')]]]=_0x54dc57[_0x4568ba][_0xd281('0x6d')];}}for(var _0x117538 in _0x13a154){if(!_0x467c85[_0xd281('0x67')](_0x13a154[_0x117538])){_0x467c85[_0x13a154[_0x117538]]=null;}}_0x153fa4['push'](_0x467c85);}return _0x153fa4;}})[_0xd281('0x24')](function(_0x266238){if(!_[_0xd281('0x6e')](_0x266238)){var _0x3a3bba=toCsv(_0x266238);var _0x1860b4=Date[_0xd281('0x6f')]();fs['writeFileSync'](util[_0xd281('0x6a')](_0xd281('0x70'),_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4),_0x3a3bba);_0x5476a7[_0xd281('0x71')]('Content-disposition',_0xd281('0x72')+util[_0xd281('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4));_0x5476a7['setHeader'](_0xd281('0x73'),_0xd281('0x74'));return _0x5476a7[_0xd281('0x75')](util[_0xd281('0x6a')](_0xd281('0x70'),_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4));}else{return _0x5476a7[_0xd281('0x76')](0xcc);}})[_0xd281('0x47')](handleError(_0x5476a7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 6b571c4..2b052d3 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 _0x8832=['lodash','util','moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x8832,0x1f4));var _0x2883=function(_0x5e93ed,_0x10cca8){_0x5e93ed=_0x5e93ed-0x0;var _0x45462b=_0x8832[_0x5e93ed];return _0x45462b;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('JscriptyProject',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb79=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x50d757,_0x17458d){var _0x467560=function(_0x16aa0f){while(--_0x16aa0f){_0x50d757['push'](_0x50d757['shift']());}};_0x467560(++_0x17458d);}(_0xeb79,0x87));var _0x9eb7=function(_0x2bf67e,_0x16d378){_0x2bf67e=_0x2bf67e-0x0;var _0x5138d5=_0xeb79[_0x2bf67e];return _0x5138d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9eb7('0x0'))('api');var moment=require(_0x9eb7('0x1'));var BPromise=require('bluebird');var rp=require(_0x9eb7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eb7('0x3'));var config=require(_0x9eb7('0x4'));var attributes=require(_0x9eb7('0x5'));module[_0x9eb7('0x6')]=function(_0x58bc03,_0x501d0c){return _0x58bc03[_0x9eb7('0x7')]('JscriptyProject',attributes,{'tableName':_0x9eb7('0x8'),'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 9a6914d..61999e4 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(_0x2a0346,_0x2c1300){_0x2a0346=_0x2a0346-0x0;var _0x1f5232=_0xbdb7[_0x2a0346];return _0x1f5232;};'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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5bd60b,_0x13465a){var _0x2dcff0=function(_0x31079c){while(--_0x31079c){_0x5bd60b['push'](_0x5bd60b['shift']());}};_0x2dcff0(++_0x13465a);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0xaa88[_0x3e8270];return _0x1ccde9;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 814ddbb..f6de300 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 _0x52ed=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x5e5ed6,_0x9bf2fa){var _0x5186f3=function(_0x51c344){while(--_0x51c344){_0x5e5ed6['push'](_0x5e5ed6['shift']());}};_0x5186f3(++_0x9bf2fa);}(_0x52ed,0x1e7));var _0xd52e=function(_0x65ca71,_0x126845){_0x65ca71=_0x65ca71-0x0;var _0x5cb16e=_0x52ed[_0x65ca71];return _0x5cb16e;};'use strict';var multer=require(_0xd52e('0x0'));var util=require('util');var path=require(_0xd52e('0x1'));var timeout=require(_0xd52e('0x2'));var express=require(_0xd52e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd52e('0x4'));var interaction=require(_0xd52e('0x5'));var config=require(_0xd52e('0x6'));var controller=require(_0xd52e('0x7'));router[_0xd52e('0x8')]('/',auth[_0xd52e('0x9')](),controller[_0xd52e('0xa')]);router[_0xd52e('0x8')]('/describe',auth[_0xd52e('0x9')](),controller[_0xd52e('0xb')]);router[_0xd52e('0x8')](_0xd52e('0xc'),auth[_0xd52e('0x9')](),controller[_0xd52e('0xd')]);router[_0xd52e('0xe')]('/',auth[_0xd52e('0x9')](),controller[_0xd52e('0xf')]);router[_0xd52e('0x10')]('/:id',auth[_0xd52e('0x9')](),controller[_0xd52e('0x11')]);router[_0xd52e('0x12')](_0xd52e('0xc'),auth['isAuthenticated'](),controller[_0xd52e('0x13')]);module[_0xd52e('0x14')]=router; \ No newline at end of file +var _0x1171=['post','update','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xa3d3ae,_0x321f1c){var _0x46a3ce=function(_0x1e9dcb){while(--_0x1e9dcb){_0xa3d3ae['push'](_0xa3d3ae['shift']());}};_0x46a3ce(++_0x321f1c);}(_0x1171,0x1be));var _0x1117=function(_0x1b5805,_0x1d1f54){_0x1b5805=_0x1b5805-0x0;var _0x4b0de6=_0x1171[_0x1b5805];return _0x4b0de6;};'use strict';var multer=require('multer');var util=require(_0x1117('0x0'));var path=require(_0x1117('0x1'));var timeout=require('connect-timeout');var express=require(_0x1117('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1117('0x3'));var interaction=require(_0x1117('0x4'));var config=require(_0x1117('0x5'));var controller=require(_0x1117('0x6'));router[_0x1117('0x7')]('/',auth[_0x1117('0x8')](),controller[_0x1117('0x9')]);router[_0x1117('0x7')](_0x1117('0xa'),auth[_0x1117('0x8')](),controller['describe']);router[_0x1117('0x7')](_0x1117('0xb'),auth[_0x1117('0x8')](),controller[_0x1117('0xc')]);router[_0x1117('0xd')]('/',auth[_0x1117('0x8')](),controller['create']);router['put']('/:id',auth[_0x1117('0x8')](),controller[_0x1117('0xe')]);router[_0x1117('0xf')]('/:id',auth[_0x1117('0x8')](),controller['destroy']);module[_0x1117('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index b5625dc..e42cd28 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x12f4fb,_0x3d59bb){_0x12f4fb=_0x12f4fb-0x0;var _0x5a05cf=_0x7a54[_0x12f4fb];return _0x5a05cf;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0xf5a1f9,_0x36889f){_0xf5a1f9=_0xf5a1f9-0x0;var _0x5a8156=_0x7a54[_0xf5a1f9];return _0x5a8156;};'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 f037a70..25b1ea9 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 _0x3794=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','intersection','fields','length','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x3794,0x1b9));var _0x4379=function(_0x392be3,_0xf1d603){_0x392be3=_0x392be3-0x0;var _0x1453b2=_0x3794[_0x392be3];return _0x1453b2;};'use strict';var emlformat=require(_0x4379('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4379('0x1'));var jsonpatch=require(_0x4379('0x2'));var rp=require(_0x4379('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4379('0x4'));var util=require(_0x4379('0x5'));var path=require(_0x4379('0x6'));var sox=require(_0x4379('0x7'));var csv=require(_0x4379('0x8'));var ejs=require(_0x4379('0x9'));var fs=require('fs');var fs_extra=require(_0x4379('0xa'));var _=require(_0x4379('0xb'));var squel=require(_0x4379('0xc'));var crypto=require(_0x4379('0xd'));var jsforce=require(_0x4379('0xe'));var deskjs=require(_0x4379('0xf'));var toCsv=require(_0x4379('0x8'));var querystring=require(_0x4379('0x10'));var Papa=require(_0x4379('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4379('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4379('0x13'))(_0x4379('0x14'));var utils=require('../../config/utils');var config=require(_0x4379('0x15'));var licenseUtil=require(_0x4379('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152a9f,_0x1e6476){_0x1e6476=_0x1e6476||0xcc;return function(_0x53e852){if(_0x53e852){return _0x152a9f[_0x4379('0x17')](_0x1e6476);}return _0x152a9f[_0x4379('0x18')](_0x1e6476)['end']();};}function respondWithResult(_0x3245a5,_0x2e8a91){_0x2e8a91=_0x2e8a91||0xc8;return function(_0x51a7a9){if(_0x51a7a9){return _0x3245a5['status'](_0x2e8a91)[_0x4379('0x19')](_0x51a7a9);}};}function respondWithFilteredResult(_0x395905,_0x2293a0){return function(_0x26e631){if(_0x26e631){var _0x225287=typeof _0x2293a0[_0x4379('0x1a')]===_0x4379('0x1b')&&typeof _0x2293a0[_0x4379('0x1c')]===_0x4379('0x1b');var _0x29a7b0=_0x26e631['count'];var _0x29f240=_0x225287?0x0:_0x2293a0['offset'];var _0x188c26=_0x225287?_0x26e631[_0x4379('0x1d')]:_0x2293a0[_0x4379('0x1a')]+_0x2293a0['limit'];var _0x3da63c;if(_0x188c26>=_0x29a7b0){_0x188c26=_0x29a7b0;_0x3da63c=0xc8;}else{_0x3da63c=0xce;}_0x395905[_0x4379('0x18')](_0x3da63c);return _0x395905['set'](_0x4379('0x1e'),_0x29f240+'-'+_0x188c26+'/'+_0x29a7b0)[_0x4379('0x19')](_0x26e631);}return null;};}function patchUpdates(_0x126823){return function(_0x5595a3){try{jsonpatch[_0x4379('0x1f')](_0x5595a3,_0x126823,!![]);}catch(_0x483bda){return BPromise[_0x4379('0x20')](_0x483bda);}return _0x5595a3[_0x4379('0x21')]();};}function saveUpdates(_0x5de0a4,_0x4deb19){return function(_0x3cf622){if(_0x3cf622){return _0x3cf622['update'](_0x5de0a4)[_0x4379('0x22')](function(_0x1f6c2f){return _0x1f6c2f;});}return null;};}function removeEntity(_0x54bd14,_0x4a6510){return function(_0x43c54c){if(_0x43c54c){return _0x43c54c[_0x4379('0x23')]()[_0x4379('0x22')](function(){_0x54bd14['status'](0xcc)[_0x4379('0x24')]();});}};}function handleEntityNotFound(_0x382294,_0x10f025){return function(_0x472efa){if(!_0x472efa){_0x382294[_0x4379('0x17')](0x194);}return _0x472efa;};}function handleError(_0x255610,_0x2368ff){_0x2368ff=_0x2368ff||0x1f4;return function(_0x169097){logger[_0x4379('0x25')](_0x169097[_0x4379('0x26')]);if(_0x169097[_0x4379('0x27')]){delete _0x169097[_0x4379('0x27')];}_0x255610[_0x4379('0x18')](_0x2368ff)[_0x4379('0x28')](_0x169097);};}exports[_0x4379('0x29')]=function(_0xe1bb11,_0x1d183d){var _0x5097c2={},_0x51f913={},_0x5b0592={'count':0x0,'rows':[]};var _0x1530e1=_[_0x4379('0x2a')](db[_0x4379('0x2b')][_0x4379('0x2c')],function(_0x306368){return{'name':_0x306368['fieldName'],'type':_0x306368[_0x4379('0x2d')][_0x4379('0x2e')]};});_0x51f913[_0x4379('0x2f')]=_[_0x4379('0x2a')](_0x1530e1,_0x4379('0x27'));_0x51f913[_0x4379('0x30')]=_['keys'](_0xe1bb11[_0x4379('0x30')]);_0x51f913['filters']=_[_0x4379('0x31')](_0x51f913[_0x4379('0x2f')],_0x51f913[_0x4379('0x30')]);_0x5097c2['attributes']=_[_0x4379('0x31')](_0x51f913[_0x4379('0x2f')],qs[_0x4379('0x32')](_0xe1bb11[_0x4379('0x30')][_0x4379('0x32')]));_0x5097c2['attributes']=_0x5097c2['attributes'][_0x4379('0x33')]?_0x5097c2[_0x4379('0x34')]:_0x51f913['model'];if(!_0xe1bb11['query']['hasOwnProperty'](_0x4379('0x35'))){_0x5097c2[_0x4379('0x1c')]=qs['limit'](_0xe1bb11['query'][_0x4379('0x1c')]);_0x5097c2[_0x4379('0x1a')]=qs['offset'](_0xe1bb11['query']['offset']);}_0x5097c2[_0x4379('0x36')]=qs[_0x4379('0x37')](_0xe1bb11[_0x4379('0x30')][_0x4379('0x37')]);_0x5097c2[_0x4379('0x38')]=qs[_0x4379('0x39')](_[_0x4379('0x3a')](_0xe1bb11['query'],_0x51f913[_0x4379('0x39')]),_0x1530e1);if(_0xe1bb11['query'][_0x4379('0x3b')]){_0x5097c2[_0x4379('0x38')]=_[_0x4379('0x3c')](_0x5097c2[_0x4379('0x38')],{'$or':_[_0x4379('0x2a')](_0x1530e1,function(_0x1f597e){if(_0x1f597e['type']!==_0x4379('0x3d')){var _0xafa500={};_0xafa500[_0x1f597e[_0x4379('0x27')]]={'$like':'%'+_0xe1bb11[_0x4379('0x30')][_0x4379('0x3b')]+'%'};return _0xafa500;}})});}_0x5097c2=_[_0x4379('0x3c')]({},_0x5097c2,_0xe1bb11[_0x4379('0x3e')]);var _0x2d3dc5={'where':_0x5097c2['where']};return db[_0x4379('0x2b')][_0x4379('0x1d')](_0x2d3dc5)[_0x4379('0x22')](function(_0x27eee7){_0x5b0592[_0x4379('0x1d')]=_0x27eee7;if(_0xe1bb11['query']['includeAll']){_0x5097c2[_0x4379('0x3f')]=[{'all':!![]}];}return db[_0x4379('0x2b')][_0x4379('0x40')](_0x5097c2);})[_0x4379('0x22')](function(_0x20e33f){_0x5b0592[_0x4379('0x41')]=_0x20e33f;return _0x5b0592;})[_0x4379('0x22')](respondWithFilteredResult(_0x1d183d,_0x5097c2))[_0x4379('0x42')](handleError(_0x1d183d,null));};exports[_0x4379('0x43')]=function(_0x1e962d,_0x5bb136){var _0x12cb31={'raw':!![],'where':{'id':_0x1e962d[_0x4379('0x44')]['id']}},_0x458fa8={};_0x458fa8[_0x4379('0x2f')]=_['keys'](db[_0x4379('0x2b')][_0x4379('0x2c')]);_0x458fa8['query']=_[_0x4379('0x45')](_0x1e962d[_0x4379('0x30')]);_0x458fa8['filters']=_[_0x4379('0x31')](_0x458fa8[_0x4379('0x2f')],_0x458fa8[_0x4379('0x30')]);_0x12cb31[_0x4379('0x34')]=_[_0x4379('0x31')](_0x458fa8[_0x4379('0x2f')],qs[_0x4379('0x32')](_0x1e962d[_0x4379('0x30')][_0x4379('0x32')]));_0x12cb31[_0x4379('0x34')]=_0x12cb31[_0x4379('0x34')][_0x4379('0x33')]?_0x12cb31[_0x4379('0x34')]:_0x458fa8[_0x4379('0x2f')];if(_0x1e962d[_0x4379('0x30')][_0x4379('0x46')]){_0x12cb31[_0x4379('0x3f')]=[{'all':!![]}];}_0x12cb31=_[_0x4379('0x3c')]({},_0x12cb31,_0x1e962d[_0x4379('0x3e')]);return db[_0x4379('0x2b')][_0x4379('0x47')](_0x12cb31)[_0x4379('0x22')](handleEntityNotFound(_0x5bb136,null))['then'](respondWithResult(_0x5bb136,null))[_0x4379('0x42')](handleError(_0x5bb136,null));};exports['create']=function(_0x5e9e35,_0x4998d2){return db[_0x4379('0x2b')][_0x4379('0x48')](_0x5e9e35['body'],{})['then'](respondWithResult(_0x4998d2,0xc9))[_0x4379('0x42')](handleError(_0x4998d2,null));};exports['update']=function(_0x89f643,_0x1fd2d0){if(_0x89f643[_0x4379('0x49')]['id']){delete _0x89f643['body']['id'];}return db[_0x4379('0x2b')][_0x4379('0x47')]({'where':{'id':_0x89f643[_0x4379('0x44')]['id']}})[_0x4379('0x22')](handleEntityNotFound(_0x1fd2d0,null))[_0x4379('0x22')](saveUpdates(_0x89f643['body'],null))[_0x4379('0x22')](respondWithResult(_0x1fd2d0,null))[_0x4379('0x42')](handleError(_0x1fd2d0,null));};exports['destroy']=function(_0x329047,_0x1c7b2e){return db[_0x4379('0x2b')][_0x4379('0x47')]({'where':{'id':_0x329047[_0x4379('0x44')]['id']}})[_0x4379('0x22')](handleEntityNotFound(_0x1c7b2e,null))[_0x4379('0x22')](removeEntity(_0x1c7b2e,null))[_0x4379('0x42')](handleError(_0x1c7b2e,null));};exports[_0x4379('0x4a')]=function(_0x5ae082,_0x27c77f){return db[_0x4379('0x2b')][_0x4379('0x4a')]()[_0x4379('0x22')](respondWithResult(_0x27c77f,null))[_0x4379('0x42')](handleError(_0x27c77f,null));}; \ No newline at end of file +var _0x75e4=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','find','describe','rimraf','fast-json-patch'];(function(_0x57d57e,_0x285579){var _0x4331a3=function(_0x5b6d8a){while(--_0x5b6d8a){_0x57d57e['push'](_0x57d57e['shift']());}};_0x4331a3(++_0x285579);}(_0x75e4,0x92));var _0x475e=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x75e4[_0x237546];return _0x233e29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x475e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x475e('0x1'));var rp=require(_0x475e('0x2'));var moment=require(_0x475e('0x3'));var BPromise=require(_0x475e('0x4'));var Mustache=require(_0x475e('0x5'));var util=require(_0x475e('0x6'));var path=require('path');var sox=require(_0x475e('0x7'));var csv=require(_0x475e('0x8'));var ejs=require(_0x475e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x475e('0xa'));var squel=require(_0x475e('0xb'));var crypto=require(_0x475e('0xc'));var jsforce=require(_0x475e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x475e('0x8'));var querystring=require(_0x475e('0xe'));var Papa=require('papaparse');var Redis=require(_0x475e('0xf'));var authService=require(_0x475e('0x10'));var qs=require(_0x475e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x475e('0x12'));var logger=require('../../config/logger')(_0x475e('0x13'));var utils=require(_0x475e('0x14'));var config=require(_0x475e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2851c0,_0x470d2d){_0x470d2d=_0x470d2d||0xcc;return function(_0x534cf3){if(_0x534cf3){return _0x2851c0[_0x475e('0x16')](_0x470d2d);}return _0x2851c0[_0x475e('0x17')](_0x470d2d)['end']();};}function respondWithResult(_0x519736,_0x2b4140){_0x2b4140=_0x2b4140||0xc8;return function(_0xd7bd1a){if(_0xd7bd1a){return _0x519736[_0x475e('0x17')](_0x2b4140)[_0x475e('0x18')](_0xd7bd1a);}};}function respondWithFilteredResult(_0x21b8f5,_0x580ca3){return function(_0x54e7f0){if(_0x54e7f0){var _0x4047dd=typeof _0x580ca3[_0x475e('0x19')]===_0x475e('0x1a')&&typeof _0x580ca3['limit']===_0x475e('0x1a');var _0x1d5e2c=_0x54e7f0['count'];var _0x3c5744=_0x4047dd?0x0:_0x580ca3[_0x475e('0x19')];var _0x59a826=_0x4047dd?_0x54e7f0[_0x475e('0x1b')]:_0x580ca3[_0x475e('0x19')]+_0x580ca3[_0x475e('0x1c')];var _0x21fd72;if(_0x59a826>=_0x1d5e2c){_0x59a826=_0x1d5e2c;_0x21fd72=0xc8;}else{_0x21fd72=0xce;}_0x21b8f5['status'](_0x21fd72);return _0x21b8f5[_0x475e('0x1d')](_0x475e('0x1e'),_0x3c5744+'-'+_0x59a826+'/'+_0x1d5e2c)[_0x475e('0x18')](_0x54e7f0);}return null;};}function patchUpdates(_0x75c9c2){return function(_0x1db4ab){try{jsonpatch[_0x475e('0x1f')](_0x1db4ab,_0x75c9c2,!![]);}catch(_0x2a4470){return BPromise['reject'](_0x2a4470);}return _0x1db4ab[_0x475e('0x20')]();};}function saveUpdates(_0x9905b6,_0x4e7662){return function(_0x5dbaab){if(_0x5dbaab){return _0x5dbaab[_0x475e('0x21')](_0x9905b6)[_0x475e('0x22')](function(_0x31c89f){return _0x31c89f;});}return null;};}function removeEntity(_0x14700e,_0x1de032){return function(_0x4a031e){if(_0x4a031e){return _0x4a031e[_0x475e('0x23')]()['then'](function(){_0x14700e[_0x475e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281594,_0x5b599c){return function(_0x23ae5d){if(!_0x23ae5d){_0x281594[_0x475e('0x16')](0x194);}return _0x23ae5d;};}function handleError(_0x4c92fc,_0x3232aa){_0x3232aa=_0x3232aa||0x1f4;return function(_0x45e052){logger[_0x475e('0x24')](_0x45e052[_0x475e('0x25')]);if(_0x45e052['name']){delete _0x45e052[_0x475e('0x26')];}_0x4c92fc[_0x475e('0x17')](_0x3232aa)[_0x475e('0x27')](_0x45e052);};}exports[_0x475e('0x28')]=function(_0x53e54d,_0x197239){var _0x2e4a24={},_0x22aa0e={},_0xee09d2={'count':0x0,'rows':[]};var _0x5c2127=_[_0x475e('0x29')](db[_0x475e('0x2a')][_0x475e('0x2b')],function(_0x2b5155){return{'name':_0x2b5155[_0x475e('0x2c')],'type':_0x2b5155['type'][_0x475e('0x2d')]};});_0x22aa0e[_0x475e('0x2e')]=_['map'](_0x5c2127,_0x475e('0x26'));_0x22aa0e['query']=_[_0x475e('0x2f')](_0x53e54d[_0x475e('0x30')]);_0x22aa0e[_0x475e('0x31')]=_[_0x475e('0x32')](_0x22aa0e[_0x475e('0x2e')],_0x22aa0e[_0x475e('0x30')]);_0x2e4a24[_0x475e('0x33')]=_[_0x475e('0x32')](_0x22aa0e['model'],qs[_0x475e('0x34')](_0x53e54d[_0x475e('0x30')][_0x475e('0x34')]));_0x2e4a24[_0x475e('0x33')]=_0x2e4a24['attributes'][_0x475e('0x35')]?_0x2e4a24[_0x475e('0x33')]:_0x22aa0e[_0x475e('0x2e')];if(!_0x53e54d[_0x475e('0x30')][_0x475e('0x36')](_0x475e('0x37'))){_0x2e4a24[_0x475e('0x1c')]=qs[_0x475e('0x1c')](_0x53e54d['query']['limit']);_0x2e4a24[_0x475e('0x19')]=qs[_0x475e('0x19')](_0x53e54d[_0x475e('0x30')][_0x475e('0x19')]);}_0x2e4a24[_0x475e('0x38')]=qs['sort'](_0x53e54d[_0x475e('0x30')]['sort']);_0x2e4a24[_0x475e('0x39')]=qs['filters'](_[_0x475e('0x3a')](_0x53e54d['query'],_0x22aa0e['filters']),_0x5c2127);if(_0x53e54d[_0x475e('0x30')][_0x475e('0x3b')]){_0x2e4a24[_0x475e('0x39')]=_[_0x475e('0x3c')](_0x2e4a24[_0x475e('0x39')],{'$or':_[_0x475e('0x29')](_0x5c2127,function(_0x344238){if(_0x344238[_0x475e('0x3d')]!==_0x475e('0x3e')){var _0xa7416={};_0xa7416[_0x344238[_0x475e('0x26')]]={'$like':'%'+_0x53e54d[_0x475e('0x30')][_0x475e('0x3b')]+'%'};return _0xa7416;}})});}_0x2e4a24=_['merge']({},_0x2e4a24,_0x53e54d['options']);var _0x241b37={'where':_0x2e4a24[_0x475e('0x39')]};return db['JscriptyQuestionReport'][_0x475e('0x1b')](_0x241b37)[_0x475e('0x22')](function(_0x49d346){_0xee09d2[_0x475e('0x1b')]=_0x49d346;if(_0x53e54d['query'][_0x475e('0x3f')]){_0x2e4a24[_0x475e('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x2e4a24);})[_0x475e('0x22')](function(_0x17b10d){_0xee09d2[_0x475e('0x41')]=_0x17b10d;return _0xee09d2;})['then'](respondWithFilteredResult(_0x197239,_0x2e4a24))[_0x475e('0x42')](handleError(_0x197239,null));};exports[_0x475e('0x43')]=function(_0x5535f1,_0x2c814c){var _0x45bc65={'raw':!![],'where':{'id':_0x5535f1[_0x475e('0x44')]['id']}},_0x4371c6={};_0x4371c6[_0x475e('0x2e')]=_['keys'](db[_0x475e('0x2a')][_0x475e('0x2b')]);_0x4371c6[_0x475e('0x30')]=_[_0x475e('0x2f')](_0x5535f1['query']);_0x4371c6[_0x475e('0x31')]=_[_0x475e('0x32')](_0x4371c6[_0x475e('0x2e')],_0x4371c6[_0x475e('0x30')]);_0x45bc65[_0x475e('0x33')]=_[_0x475e('0x32')](_0x4371c6[_0x475e('0x2e')],qs[_0x475e('0x34')](_0x5535f1['query'][_0x475e('0x34')]));_0x45bc65['attributes']=_0x45bc65[_0x475e('0x33')][_0x475e('0x35')]?_0x45bc65[_0x475e('0x33')]:_0x4371c6[_0x475e('0x2e')];if(_0x5535f1['query'][_0x475e('0x3f')]){_0x45bc65[_0x475e('0x40')]=[{'all':!![]}];}_0x45bc65=_[_0x475e('0x3c')]({},_0x45bc65,_0x5535f1[_0x475e('0x45')]);return db['JscriptyQuestionReport']['find'](_0x45bc65)[_0x475e('0x22')](handleEntityNotFound(_0x2c814c,null))[_0x475e('0x22')](respondWithResult(_0x2c814c,null))[_0x475e('0x42')](handleError(_0x2c814c,null));};exports[_0x475e('0x46')]=function(_0xfa6b1d,_0x340efa){return db[_0x475e('0x2a')]['create'](_0xfa6b1d[_0x475e('0x47')],{})['then'](respondWithResult(_0x340efa,0xc9))[_0x475e('0x42')](handleError(_0x340efa,null));};exports[_0x475e('0x21')]=function(_0x16a47e,_0xedabc8){if(_0x16a47e[_0x475e('0x47')]['id']){delete _0x16a47e[_0x475e('0x47')]['id'];}return db[_0x475e('0x2a')][_0x475e('0x48')]({'where':{'id':_0x16a47e[_0x475e('0x44')]['id']}})[_0x475e('0x22')](handleEntityNotFound(_0xedabc8,null))['then'](saveUpdates(_0x16a47e[_0x475e('0x47')],null))[_0x475e('0x22')](respondWithResult(_0xedabc8,null))[_0x475e('0x42')](handleError(_0xedabc8,null));};exports['destroy']=function(_0x45ff9a,_0x1fdfe2){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x45ff9a['params']['id']}})[_0x475e('0x22')](handleEntityNotFound(_0x1fdfe2,null))['then'](removeEntity(_0x1fdfe2,null))[_0x475e('0x42')](handleError(_0x1fdfe2,null));};exports['describe']=function(_0x11378d,_0x4700ae){return db[_0x475e('0x2a')][_0x475e('0x49')]()[_0x475e('0x22')](respondWithResult(_0x4700ae,null))[_0x475e('0x42')](handleError(_0x4700ae,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 44f3433..20fcd38 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 _0x7838=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x48cd86,_0x2e227a){var _0x44ec41=function(_0x45ed51){while(--_0x45ed51){_0x48cd86['push'](_0x48cd86['shift']());}};_0x44ec41(++_0x2e227a);}(_0x7838,0x1ed));var _0x8783=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7838[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x8783('0x0'));var util=require(_0x8783('0x1'));var logger=require(_0x8783('0x2'))(_0x8783('0x3'));var moment=require(_0x8783('0x4'));var BPromise=require(_0x8783('0x5'));var rp=require(_0x8783('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8783('0x7'));var config=require(_0x8783('0x8'));var attributes=require(_0x8783('0x9'));module[_0x8783('0xa')]=function(_0x1889a5,_0x31a436){return _0x1889a5[_0x8783('0xb')](_0x8783('0xc'),attributes,{'tableName':_0x8783('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf67=['JscriptyQuestionReport','report_jscripty_questions','util','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0x50224a,_0x225d85){var _0x248354=function(_0x46a4e7){while(--_0x46a4e7){_0x50224a['push'](_0x50224a['shift']());}};_0x248354(++_0x225d85);}(_0xaf67,0x12e));var _0x7af6=function(_0x2b376c,_0x301c2a){_0x2b376c=_0x2b376c-0x0;var _0x4e7952=_0xaf67[_0x2b376c];return _0x4e7952;};'use strict';var _=require('lodash');var util=require(_0x7af6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7af6('0x1'));var BPromise=require(_0x7af6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7af6('0x3'));var rimraf=require(_0x7af6('0x4'));var config=require(_0x7af6('0x5'));var attributes=require(_0x7af6('0x6'));module['exports']=function(_0x56087a,_0x4ffcf4){return _0x56087a[_0x7af6('0x7')](_0x7af6('0x8'),attributes,{'tableName':_0x7af6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 9b75765..f655031 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 _0xaa21=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xaa21,0x80));var _0x1aa2=function(_0x264e7f,_0x4b8f91){_0x264e7f=_0x264e7f-0x0;var _0x173e6e=_0xaa21[_0x264e7f];return _0x173e6e;};'use strict';var _=require(_0x1aa2('0x0'));var util=require(_0x1aa2('0x1'));var moment=require(_0x1aa2('0x2'));var BPromise=require(_0x1aa2('0x3'));var rs=require(_0x1aa2('0x4'));var fs=require('fs');var Redis=require(_0x1aa2('0x5'));var db=require(_0x1aa2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1aa2('0x7'))(_0x1aa2('0x8'));var config=require('../../config/environment');var jayson=require(_0x1aa2('0x9'));var client=jayson['client'][_0x1aa2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32cd75,_0x3f890e,_0x203f95){return new BPromise(function(_0x53de5e,_0x3022be){return client[_0x1aa2('0xb')](_0x32cd75,_0x203f95)[_0x1aa2('0xc')](function(_0x7cad9c){logger[_0x1aa2('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3f890e,_0x1aa2('0xe'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3f890e,'request\x20sent',JSON['stringify'](_0x7cad9c));if(_0x7cad9c['error']){if(_0x7cad9c[_0x1aa2('0xf')][_0x1aa2('0x10')]===0x1f4){logger[_0x1aa2('0xf')](_0x1aa2('0x11'),_0x3f890e,_0x7cad9c[_0x1aa2('0xf')][_0x1aa2('0x12')]);return _0x3022be(_0x7cad9c[_0x1aa2('0xf')][_0x1aa2('0x12')]);}logger['error'](_0x1aa2('0x11'),_0x3f890e,_0x7cad9c[_0x1aa2('0xf')][_0x1aa2('0x12')]);return _0x53de5e(_0x7cad9c['error'][_0x1aa2('0x12')]);}else{logger[_0x1aa2('0xd')](_0x1aa2('0x11'),_0x3f890e,_0x1aa2('0xe'));_0x53de5e(_0x7cad9c[_0x1aa2('0x13')][_0x1aa2('0x12')]);}})[_0x1aa2('0x14')](function(_0x397cfa){logger['error'](_0x1aa2('0x11'),_0x3f890e,_0x397cfa);_0x3022be(_0x397cfa);});});} \ No newline at end of file +var _0x3628=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x44f011,_0x262232){var _0xe4ac6c=function(_0x3643fe){while(--_0x3643fe){_0x44f011['push'](_0x44f011['shift']());}};_0xe4ac6c(++_0x262232);}(_0x3628,0x1ec));var _0x8362=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x3628[_0x4492af];return _0x216729;};'use strict';var _=require(_0x8362('0x0'));var util=require(_0x8362('0x1'));var moment=require('moment');var BPromise=require(_0x8362('0x2'));var rs=require(_0x8362('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8362('0x4'))['db'];var utils=require(_0x8362('0x5'));var logger=require('../../config/logger')(_0x8362('0x6'));var config=require(_0x8362('0x7'));var jayson=require(_0x8362('0x8'));var client=jayson[_0x8362('0x9')][_0x8362('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18bdf7,_0x151d02,_0x331abb){return new BPromise(function(_0x5bf506,_0x436d01){return client['request'](_0x18bdf7,_0x331abb)[_0x8362('0xb')](function(_0x29532c){logger[_0x8362('0xc')](_0x8362('0xd'),_0x151d02,_0x8362('0xe'));logger['debug'](_0x8362('0xf'),_0x151d02,'request\x20sent',JSON[_0x8362('0x10')](_0x29532c));if(_0x29532c[_0x8362('0x11')]){if(_0x29532c[_0x8362('0x11')][_0x8362('0x12')]===0x1f4){logger[_0x8362('0x11')](_0x8362('0xd'),_0x151d02,_0x29532c[_0x8362('0x11')][_0x8362('0x13')]);return _0x436d01(_0x29532c['error'][_0x8362('0x13')]);}logger['error'](_0x8362('0xd'),_0x151d02,_0x29532c[_0x8362('0x11')]['message']);return _0x5bf506(_0x29532c['error'][_0x8362('0x13')]);}else{logger[_0x8362('0xc')](_0x8362('0xd'),_0x151d02,'request\x20sent');_0x5bf506(_0x29532c[_0x8362('0x14')][_0x8362('0x13')]);}})[_0x8362('0x15')](function(_0x953e95){logger[_0x8362('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x151d02,_0x953e95);_0x436d01(_0x953e95);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8c51a34..b321133 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 _0xca52=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','/:id','show','get','/:id/questions','getQuestions','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4d883d,_0x5ccba9){var _0x1e3022=function(_0x30d0e8){while(--_0x30d0e8){_0x4d883d['push'](_0x4d883d['shift']());}};_0x1e3022(++_0x5ccba9);}(_0xca52,0x19c));var _0x2ca5=function(_0x50cb06,_0x6f967c){_0x50cb06=_0x50cb06-0x0;var _0x1681bb=_0xca52[_0x50cb06];return _0x1681bb;};'use strict';var multer=require(_0x2ca5('0x0'));var util=require(_0x2ca5('0x1'));var path=require(_0x2ca5('0x2'));var timeout=require(_0x2ca5('0x3'));var express=require(_0x2ca5('0x4'));var router=express[_0x2ca5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2ca5('0x6'));var interaction=require(_0x2ca5('0x7'));var config=require(_0x2ca5('0x8'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x2ca5('0x9')](),controller[_0x2ca5('0xa')]);router['get'](_0x2ca5('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2ca5('0xc'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0xd')]);router[_0x2ca5('0xe')](_0x2ca5('0xf'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x10')]);router['post']('/',auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x11')]);router[_0x2ca5('0x12')](_0x2ca5('0xc'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x13')]);router[_0x2ca5('0x14')]('/:id',auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbdc2=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','show','/:id/questions','getQuestions','post','create','put','update','delete','/:id'];(function(_0x5d9f5c,_0x189d90){var _0x171fba=function(_0x136011){while(--_0x136011){_0x5d9f5c['push'](_0x5d9f5c['shift']());}};_0x171fba(++_0x189d90);}(_0xbdc2,0xe3));var _0x2bdc=function(_0xf8ef4a,_0x34a9d5){_0xf8ef4a=_0xf8ef4a-0x0;var _0x1869c9=_0xbdc2[_0xf8ef4a];return _0x1869c9;};'use strict';var multer=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var timeout=require(_0x2bdc('0x3'));var express=require(_0x2bdc('0x4'));var router=express[_0x2bdc('0x5')]();var fs_extra=require(_0x2bdc('0x6'));var auth=require(_0x2bdc('0x7'));var interaction=require(_0x2bdc('0x8'));var config=require('../../config/environment');var controller=require(_0x2bdc('0x9'));router[_0x2bdc('0xa')]('/',auth[_0x2bdc('0xb')](),controller['index']);router['get'](_0x2bdc('0xc'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0xd')]);router[_0x2bdc('0xa')]('/:id',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0xe')]);router['get'](_0x2bdc('0xf'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x10')]);router[_0x2bdc('0x11')]('/',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x12')]);router[_0x2bdc('0x13')]('/:id',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x14')]);router[_0x2bdc('0x15')](_0x2bdc('0x16'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x17')]);module[_0x2bdc('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index cb9c4ba..4c3a69b 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 _0x8c9c=['BOOLEAN','moment','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8c9c,0xf9));var _0xc8c9=function(_0x44e333,_0x586055){_0x44e333=_0x44e333-0x0;var _0x4c8d19=_0x8c9c[_0x44e333];return _0x4c8d19;};'use strict';var moment=require(_0xc8c9('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x13a723){this[_0xc8c9('0x1')](_0xc8c9('0x2'),_0x13a723);this[_0xc8c9('0x1')]('endtime',moment()[_0xc8c9('0x3')](_0xc8c9('0x4')));}},'endtime':{'type':Sequelize[_0xc8c9('0x5')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xc8c9('0x6')]},'queue':{'type':Sequelize[_0xc8c9('0x6')]},'uniqueid':{'type':Sequelize[_0xc8c9('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc8c9('0x6')]},'completed':{'type':Sequelize[_0xc8c9('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8a04=['format','DATE','STRING','sequelize','exports','setDataValue','starttime'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x8a04,0x14c));var _0x48a0=function(_0x4fea26,_0x24d062){_0x4fea26=_0x4fea26-0x0;var _0x3c7be0=_0x8a04[_0x4fea26];return _0x3c7be0;};'use strict';var moment=require('moment');var Sequelize=require(_0x48a0('0x0'));module[_0x48a0('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1150fd){this[_0x48a0('0x2')](_0x48a0('0x3'),_0x1150fd);this[_0x48a0('0x2')]('endtime',moment()[_0x48a0('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x48a0('0x5')]},'membername':{'type':Sequelize[_0x48a0('0x6')]},'projectname':{'type':Sequelize[_0x48a0('0x6')]},'queue':{'type':Sequelize[_0x48a0('0x6')]},'uniqueid':{'type':Sequelize[_0x48a0('0x6')]},'calleridname':{'type':Sequelize[_0x48a0('0x6')]},'calleridnum':{'type':Sequelize[_0x48a0('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 5a8f60c..57feedb 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 _0x6d66=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','save','update','destroy','name','send','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','VIRTUAL','merge','options','then','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','findOne','JscriptyQuestionReport','order','where','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x472561,_0x24ea18){var _0x2731e7=function(_0x5213fe){while(--_0x5213fe){_0x472561['push'](_0x472561['shift']());}};_0x2731e7(++_0x24ea18);}(_0x6d66,0x1c8));var _0x66d6=function(_0x2b9e10,_0x47329f){_0x2b9e10=_0x2b9e10-0x0;var _0x12fea6=_0x6d66[_0x2b9e10];return _0x12fea6;};'use strict';var emlformat=require(_0x66d6('0x0'));var rimraf=require(_0x66d6('0x1'));var zipdir=require(_0x66d6('0x2'));var jsonpatch=require(_0x66d6('0x3'));var rp=require(_0x66d6('0x4'));var moment=require(_0x66d6('0x5'));var BPromise=require(_0x66d6('0x6'));var Mustache=require(_0x66d6('0x7'));var util=require('util');var path=require(_0x66d6('0x8'));var sox=require(_0x66d6('0x9'));var csv=require(_0x66d6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66d6('0xb'));var _=require(_0x66d6('0xc'));var squel=require(_0x66d6('0xd'));var crypto=require(_0x66d6('0xe'));var jsforce=require(_0x66d6('0xf'));var deskjs=require(_0x66d6('0x10'));var toCsv=require(_0x66d6('0xa'));var querystring=require(_0x66d6('0x11'));var Papa=require(_0x66d6('0x12'));var Redis=require(_0x66d6('0x13'));var authService=require(_0x66d6('0x14'));var qs=require(_0x66d6('0x15'));var as=require(_0x66d6('0x16'));var hardwareService=require(_0x66d6('0x17'));var logger=require('../../config/logger')(_0x66d6('0x18'));var utils=require(_0x66d6('0x19'));var config=require(_0x66d6('0x1a'));var licenseUtil=require(_0x66d6('0x1b'));var db=require(_0x66d6('0x1c'))['db'];function respondWithStatusCode(_0x275715,_0x58d107){_0x58d107=_0x58d107||0xcc;return function(_0x378ae3){if(_0x378ae3){return _0x275715[_0x66d6('0x1d')](_0x58d107);}return _0x275715[_0x66d6('0x1e')](_0x58d107)['end']();};}function respondWithResult(_0x13dd4e,_0x36b293){_0x36b293=_0x36b293||0xc8;return function(_0x5b0822){if(_0x5b0822){return _0x13dd4e[_0x66d6('0x1e')](_0x36b293)[_0x66d6('0x1f')](_0x5b0822);}};}function respondWithFilteredResult(_0x41f957,_0xb371ba){return function(_0x575ada){if(_0x575ada){var _0xb1b427=typeof _0xb371ba[_0x66d6('0x20')]==='undefined'&&typeof _0xb371ba[_0x66d6('0x21')]==='undefined';var _0x36170d=_0x575ada[_0x66d6('0x22')];var _0x1daa18=_0xb1b427?0x0:_0xb371ba['offset'];var _0x1b91f1=_0xb1b427?_0x575ada['count']:_0xb371ba[_0x66d6('0x20')]+_0xb371ba['limit'];var _0x3bc022;if(_0x1b91f1>=_0x36170d){_0x1b91f1=_0x36170d;_0x3bc022=0xc8;}else{_0x3bc022=0xce;}_0x41f957[_0x66d6('0x1e')](_0x3bc022);return _0x41f957[_0x66d6('0x23')](_0x66d6('0x24'),_0x1daa18+'-'+_0x1b91f1+'/'+_0x36170d)[_0x66d6('0x1f')](_0x575ada);}return null;};}function patchUpdates(_0x236ca2){return function(_0x3b5a19){try{jsonpatch['apply'](_0x3b5a19,_0x236ca2,!![]);}catch(_0x4bfd28){return BPromise['reject'](_0x4bfd28);}return _0x3b5a19[_0x66d6('0x25')]();};}function saveUpdates(_0x47c79c,_0xed60e3){return function(_0x5ee01b){if(_0x5ee01b){return _0x5ee01b[_0x66d6('0x26')](_0x47c79c)['then'](function(_0x1e3927){return _0x1e3927;});}return null;};}function removeEntity(_0x29d8e9,_0x3966f0){return function(_0x2b7ec0){if(_0x2b7ec0){return _0x2b7ec0[_0x66d6('0x27')]()['then'](function(){_0x29d8e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55862c,_0x51996f){return function(_0x67b917){if(!_0x67b917){_0x55862c[_0x66d6('0x1d')](0x194);}return _0x67b917;};}function handleError(_0x4afd4a,_0x84dbbc){_0x84dbbc=_0x84dbbc||0x1f4;return function(_0x74417e){logger['error'](_0x74417e['stack']);if(_0x74417e[_0x66d6('0x28')]){delete _0x74417e['name'];}_0x4afd4a['status'](_0x84dbbc)[_0x66d6('0x29')](_0x74417e);};}exports['index']=function(_0x375706,_0x587842){var _0x55d87d={},_0x527026={},_0x1f770a={'count':0x0,'rows':[]};var _0xe9be7c=_[_0x66d6('0x2a')](db[_0x66d6('0x2b')]['rawAttributes'],function(_0x3fa784){return{'name':_0x3fa784[_0x66d6('0x2c')],'type':_0x3fa784[_0x66d6('0x2d')][_0x66d6('0x2e')]};});_0x527026[_0x66d6('0x2f')]=_[_0x66d6('0x2a')](_0xe9be7c,_0x66d6('0x28'));_0x527026[_0x66d6('0x30')]=_[_0x66d6('0x31')](_0x375706[_0x66d6('0x30')]);_0x527026[_0x66d6('0x32')]=_[_0x66d6('0x33')](_0x527026[_0x66d6('0x2f')],_0x527026[_0x66d6('0x30')]);_0x55d87d[_0x66d6('0x34')]=_['intersection'](_0x527026['model'],qs['fields'](_0x375706['query'][_0x66d6('0x35')]));_0x55d87d[_0x66d6('0x34')]=_0x55d87d[_0x66d6('0x34')][_0x66d6('0x36')]?_0x55d87d[_0x66d6('0x34')]:_0x527026['model'];if(!_0x375706[_0x66d6('0x30')][_0x66d6('0x37')](_0x66d6('0x38'))){_0x55d87d[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0x375706[_0x66d6('0x30')][_0x66d6('0x21')]);_0x55d87d['offset']=qs[_0x66d6('0x20')](_0x375706['query']['offset']);}_0x55d87d['order']=qs['sort'](_0x375706[_0x66d6('0x30')][_0x66d6('0x39')]);_0x55d87d['where']=qs['filters'](_[_0x66d6('0x3a')](_0x375706[_0x66d6('0x30')],_0x527026['filters']),_0xe9be7c);if(_0x375706['query'][_0x66d6('0x3b')]){_0x55d87d['where']=_['merge'](_0x55d87d['where'],{'$or':_[_0x66d6('0x2a')](_0xe9be7c,function(_0x41c8f8){if(_0x41c8f8[_0x66d6('0x2d')]!==_0x66d6('0x3c')){var _0x4622fc={};_0x4622fc[_0x41c8f8['name']]={'$like':'%'+_0x375706[_0x66d6('0x30')]['filter']+'%'};return _0x4622fc;}})});}_0x55d87d=_[_0x66d6('0x3d')]({},_0x55d87d,_0x375706[_0x66d6('0x3e')]);var _0x4428f6={'where':_0x55d87d['where']};return db[_0x66d6('0x2b')]['count'](_0x4428f6)[_0x66d6('0x3f')](function(_0x207a02){_0x1f770a[_0x66d6('0x22')]=_0x207a02;if(_0x375706['query']['includeAll']){_0x55d87d[_0x66d6('0x40')]=[{'all':!![]}];}return db[_0x66d6('0x2b')][_0x66d6('0x41')](_0x55d87d);})[_0x66d6('0x3f')](function(_0x202d5f){_0x1f770a[_0x66d6('0x42')]=_0x202d5f;return _0x1f770a;})['then'](respondWithFilteredResult(_0x587842,_0x55d87d))['catch'](handleError(_0x587842,null));};exports[_0x66d6('0x43')]=function(_0x498ec6,_0x1ba657){var _0x5e7454={'raw':!![],'where':{'id':_0x498ec6[_0x66d6('0x44')]['id']}},_0x561645={};_0x561645[_0x66d6('0x2f')]=_[_0x66d6('0x31')](db['JscriptySessionReport'][_0x66d6('0x45')]);_0x561645[_0x66d6('0x30')]=_[_0x66d6('0x31')](_0x498ec6[_0x66d6('0x30')]);_0x561645[_0x66d6('0x32')]=_[_0x66d6('0x33')](_0x561645[_0x66d6('0x2f')],_0x561645[_0x66d6('0x30')]);_0x5e7454[_0x66d6('0x34')]=_[_0x66d6('0x33')](_0x561645[_0x66d6('0x2f')],qs[_0x66d6('0x35')](_0x498ec6[_0x66d6('0x30')][_0x66d6('0x35')]));_0x5e7454[_0x66d6('0x34')]=_0x5e7454[_0x66d6('0x34')][_0x66d6('0x36')]?_0x5e7454['attributes']:_0x561645[_0x66d6('0x2f')];if(_0x498ec6[_0x66d6('0x30')][_0x66d6('0x46')]){_0x5e7454[_0x66d6('0x40')]=[{'all':!![]}];}_0x5e7454=_[_0x66d6('0x3d')]({},_0x5e7454,_0x498ec6[_0x66d6('0x3e')]);return db[_0x66d6('0x2b')][_0x66d6('0x47')](_0x5e7454)[_0x66d6('0x3f')](handleEntityNotFound(_0x1ba657,null))[_0x66d6('0x3f')](respondWithResult(_0x1ba657,null))[_0x66d6('0x48')](handleError(_0x1ba657,null));};exports[_0x66d6('0x49')]=function(_0x9dfd3d,_0x431853){return db['JscriptySessionReport'][_0x66d6('0x49')](_0x9dfd3d[_0x66d6('0x4a')],{})[_0x66d6('0x3f')](respondWithResult(_0x431853,0xc9))['catch'](handleError(_0x431853,null));};exports[_0x66d6('0x26')]=function(_0xee424c,_0x3460f6){if(_0xee424c[_0x66d6('0x4a')]['id']){delete _0xee424c['body']['id'];}return db[_0x66d6('0x2b')][_0x66d6('0x47')]({'where':{'id':_0xee424c[_0x66d6('0x44')]['id']}})[_0x66d6('0x3f')](handleEntityNotFound(_0x3460f6,null))[_0x66d6('0x3f')](saveUpdates(_0xee424c[_0x66d6('0x4a')],null))[_0x66d6('0x3f')](respondWithResult(_0x3460f6,null))[_0x66d6('0x48')](handleError(_0x3460f6,null));};exports[_0x66d6('0x27')]=function(_0x4ef49b,_0x5cfa37){return db[_0x66d6('0x2b')][_0x66d6('0x47')]({'where':{'id':_0x4ef49b['params']['id']}})[_0x66d6('0x3f')](handleEntityNotFound(_0x5cfa37,null))[_0x66d6('0x3f')](removeEntity(_0x5cfa37,null))[_0x66d6('0x48')](handleError(_0x5cfa37,null));};exports[_0x66d6('0x4b')]=function(_0x101b8f,_0x318c8c){return db[_0x66d6('0x2b')]['describe']()[_0x66d6('0x3f')](respondWithResult(_0x318c8c,null))[_0x66d6('0x48')](handleError(_0x318c8c,null));};exports['getQuestions']=function(_0xf9d208,_0x2fdbb9,_0x15e56e){var _0x1bdcdf={'raw':!![],'where':{}};var _0xe88de7={};var _0x3bee39={'count':0x0,'rows':[]};return db[_0x66d6('0x2b')][_0x66d6('0x4c')]({'where':{'id':_0xf9d208[_0x66d6('0x44')]['id']}})[_0x66d6('0x3f')](handleEntityNotFound(_0x2fdbb9,null))['then'](function(_0x3f0c9e){if(_0x3f0c9e){_0xe88de7['model']=_[_0x66d6('0x31')](db[_0x66d6('0x4d')][_0x66d6('0x45')]);_0xe88de7[_0x66d6('0x30')]=_[_0x66d6('0x31')](_0xf9d208['query']);_0xe88de7[_0x66d6('0x32')]=_[_0x66d6('0x33')](_0xe88de7[_0x66d6('0x2f')],_0xe88de7[_0x66d6('0x30')]);_0x1bdcdf[_0x66d6('0x34')]=_[_0x66d6('0x33')](_0xe88de7[_0x66d6('0x2f')],qs[_0x66d6('0x35')](_0xf9d208[_0x66d6('0x30')]['fields']));_0x1bdcdf[_0x66d6('0x34')]=_0x1bdcdf[_0x66d6('0x34')][_0x66d6('0x36')]?_0x1bdcdf[_0x66d6('0x34')]:_0xe88de7[_0x66d6('0x2f')];if(!_0xf9d208[_0x66d6('0x30')][_0x66d6('0x37')](_0x66d6('0x38'))){_0x1bdcdf[_0x66d6('0x21')]=qs[_0x66d6('0x21')](_0xf9d208[_0x66d6('0x30')][_0x66d6('0x21')]);_0x1bdcdf[_0x66d6('0x20')]=qs[_0x66d6('0x20')](_0xf9d208[_0x66d6('0x30')][_0x66d6('0x20')]);}_0x1bdcdf[_0x66d6('0x4e')]=qs[_0x66d6('0x39')](_0xf9d208[_0x66d6('0x30')][_0x66d6('0x39')]);_0x1bdcdf['where']=qs[_0x66d6('0x32')](_[_0x66d6('0x3a')](_0xf9d208[_0x66d6('0x30')],_0xe88de7['filters']));_0x1bdcdf[_0x66d6('0x4f')]['SessionId']=_0x3f0c9e['id'];if(_0xf9d208[_0x66d6('0x30')]['filter']){_0x1bdcdf['where']=_['merge'](_0x1bdcdf['where'],{'$or':_[_0x66d6('0x2a')](_0x1bdcdf['attributes'],function(_0x1ca9d4){var _0xf20d2f={};_0xf20d2f[_0x1ca9d4]={'$like':'%'+_0xf9d208[_0x66d6('0x30')][_0x66d6('0x3b')]+'%'};return _0xf20d2f;})});}_0x1bdcdf=_[_0x66d6('0x3d')]({},_0x1bdcdf,_0xf9d208[_0x66d6('0x3e')]);return db['JscriptyQuestionReport'][_0x66d6('0x22')]({'where':_0x1bdcdf[_0x66d6('0x4f')]})[_0x66d6('0x3f')](function(_0x7ac509){_0x3bee39[_0x66d6('0x22')]=_0x7ac509;if(_0xf9d208[_0x66d6('0x30')][_0x66d6('0x46')]){_0x1bdcdf[_0x66d6('0x40')]=[{'all':!![]}];}return db[_0x66d6('0x4d')][_0x66d6('0x41')](_0x1bdcdf);})[_0x66d6('0x3f')](function(_0x389135){_0x3bee39['rows']=_0x389135;return _0x3bee39;});}})[_0x66d6('0x3f')](respondWithFilteredResult(_0x2fdbb9,_0x1bdcdf))['catch'](handleError(_0x2fdbb9,null));}; \ No newline at end of file +var _0x8fb2=['mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','params','create','body','catch','destroy','find','describe','getQuestions','findOne','JscriptyQuestionReport','pick','findAll','rimraf','fast-json-patch','request-promise','moment'];(function(_0x845646,_0x47bfcd){var _0x274ccf=function(_0xffbb3c){while(--_0xffbb3c){_0x845646['push'](_0x845646['shift']());}};_0x274ccf(++_0x47bfcd);}(_0x8fb2,0x92));var _0x28fb=function(_0x216386,_0x4e82ff){_0x216386=_0x216386-0x0;var _0x30de65=_0x8fb2[_0x216386];return _0x30de65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28fb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28fb('0x1'));var rp=require(_0x28fb('0x2'));var moment=require(_0x28fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28fb('0x4'));var util=require(_0x28fb('0x5'));var path=require(_0x28fb('0x6'));var sox=require(_0x28fb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28fb('0x8'));var _=require(_0x28fb('0x9'));var squel=require('squel');var crypto=require(_0x28fb('0xa'));var jsforce=require(_0x28fb('0xb'));var deskjs=require(_0x28fb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28fb('0xd'));var Papa=require('papaparse');var Redis=require(_0x28fb('0xe'));var authService=require(_0x28fb('0xf'));var qs=require(_0x28fb('0x10'));var as=require(_0x28fb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28fb('0x12'))(_0x28fb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28fb('0x14'));var db=require(_0x28fb('0x15'))['db'];function respondWithStatusCode(_0x161225,_0xdb743b){_0xdb743b=_0xdb743b||0xcc;return function(_0x57b765){if(_0x57b765){return _0x161225[_0x28fb('0x16')](_0xdb743b);}return _0x161225[_0x28fb('0x17')](_0xdb743b)[_0x28fb('0x18')]();};}function respondWithResult(_0x5abdcc,_0x52989b){_0x52989b=_0x52989b||0xc8;return function(_0x3ee6bc){if(_0x3ee6bc){return _0x5abdcc['status'](_0x52989b)[_0x28fb('0x19')](_0x3ee6bc);}};}function respondWithFilteredResult(_0x28c2c9,_0x35aaec){return function(_0x20c75a){if(_0x20c75a){var _0x1118c6=typeof _0x35aaec[_0x28fb('0x1a')]===_0x28fb('0x1b')&&typeof _0x35aaec[_0x28fb('0x1c')]===_0x28fb('0x1b');var _0x367fb0=_0x20c75a[_0x28fb('0x1d')];var _0x5f2e9d=_0x1118c6?0x0:_0x35aaec[_0x28fb('0x1a')];var _0x3d29f4=_0x1118c6?_0x20c75a[_0x28fb('0x1d')]:_0x35aaec[_0x28fb('0x1a')]+_0x35aaec[_0x28fb('0x1c')];var _0x26ec41;if(_0x3d29f4>=_0x367fb0){_0x3d29f4=_0x367fb0;_0x26ec41=0xc8;}else{_0x26ec41=0xce;}_0x28c2c9['status'](_0x26ec41);return _0x28c2c9[_0x28fb('0x1e')]('Content-Range',_0x5f2e9d+'-'+_0x3d29f4+'/'+_0x367fb0)[_0x28fb('0x19')](_0x20c75a);}return null;};}function patchUpdates(_0x58ac01){return function(_0x3619a0){try{jsonpatch[_0x28fb('0x1f')](_0x3619a0,_0x58ac01,!![]);}catch(_0x2235b1){return BPromise['reject'](_0x2235b1);}return _0x3619a0['save']();};}function saveUpdates(_0x12087c,_0x573c1e){return function(_0x606ed8){if(_0x606ed8){return _0x606ed8['update'](_0x12087c)[_0x28fb('0x20')](function(_0x664be3){return _0x664be3;});}return null;};}function removeEntity(_0x54635e,_0x3ce853){return function(_0x4a414e){if(_0x4a414e){return _0x4a414e['destroy']()[_0x28fb('0x20')](function(){_0x54635e[_0x28fb('0x17')](0xcc)[_0x28fb('0x18')]();});}};}function handleEntityNotFound(_0x1465e6,_0x51384b){return function(_0x216c2e){if(!_0x216c2e){_0x1465e6[_0x28fb('0x16')](0x194);}return _0x216c2e;};}function handleError(_0x2b2056,_0xfb6fe4){_0xfb6fe4=_0xfb6fe4||0x1f4;return function(_0x34dfaa){logger[_0x28fb('0x21')](_0x34dfaa[_0x28fb('0x22')]);if(_0x34dfaa[_0x28fb('0x23')]){delete _0x34dfaa[_0x28fb('0x23')];}_0x2b2056[_0x28fb('0x17')](_0xfb6fe4)['send'](_0x34dfaa);};}exports[_0x28fb('0x24')]=function(_0x5371d5,_0x101026){var _0x515f36={},_0x45d06b={},_0x3dfea3={'count':0x0,'rows':[]};var _0x2acc29=_[_0x28fb('0x25')](db[_0x28fb('0x26')][_0x28fb('0x27')],function(_0xef7e47){return{'name':_0xef7e47[_0x28fb('0x28')],'type':_0xef7e47[_0x28fb('0x29')][_0x28fb('0x2a')]};});_0x45d06b[_0x28fb('0x2b')]=_[_0x28fb('0x25')](_0x2acc29,_0x28fb('0x23'));_0x45d06b[_0x28fb('0x2c')]=_[_0x28fb('0x2d')](_0x5371d5[_0x28fb('0x2c')]);_0x45d06b[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x45d06b['model'],_0x45d06b['query']);_0x515f36['attributes']=_[_0x28fb('0x2f')](_0x45d06b[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x515f36[_0x28fb('0x31')]=_0x515f36[_0x28fb('0x31')][_0x28fb('0x32')]?_0x515f36[_0x28fb('0x31')]:_0x45d06b[_0x28fb('0x2b')];if(!_0x5371d5['query'][_0x28fb('0x33')](_0x28fb('0x34'))){_0x515f36[_0x28fb('0x1c')]=qs[_0x28fb('0x1c')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x1c')]);_0x515f36[_0x28fb('0x1a')]=qs[_0x28fb('0x1a')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x1a')]);}_0x515f36[_0x28fb('0x35')]=qs[_0x28fb('0x36')](_0x5371d5['query'][_0x28fb('0x36')]);_0x515f36['where']=qs[_0x28fb('0x2e')](_['pick'](_0x5371d5[_0x28fb('0x2c')],_0x45d06b[_0x28fb('0x2e')]),_0x2acc29);if(_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x37')]){_0x515f36[_0x28fb('0x38')]=_['merge'](_0x515f36[_0x28fb('0x38')],{'$or':_[_0x28fb('0x25')](_0x2acc29,function(_0x4e6476){if(_0x4e6476['type']!==_0x28fb('0x39')){var _0x53974c={};_0x53974c[_0x4e6476[_0x28fb('0x23')]]={'$like':'%'+_0x5371d5['query'][_0x28fb('0x37')]+'%'};return _0x53974c;}})});}_0x515f36=_[_0x28fb('0x3a')]({},_0x515f36,_0x5371d5[_0x28fb('0x3b')]);var _0x4b9399={'where':_0x515f36['where']};return db['JscriptySessionReport']['count'](_0x4b9399)['then'](function(_0x48c8c5){_0x3dfea3[_0x28fb('0x1d')]=_0x48c8c5;if(_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x3c')]){_0x515f36[_0x28fb('0x3d')]=[{'all':!![]}];}return db[_0x28fb('0x26')]['findAll'](_0x515f36);})[_0x28fb('0x20')](function(_0x334b93){_0x3dfea3[_0x28fb('0x3e')]=_0x334b93;return _0x3dfea3;})[_0x28fb('0x20')](respondWithFilteredResult(_0x101026,_0x515f36))['catch'](handleError(_0x101026,null));};exports['show']=function(_0x3c2f12,_0xbe5376){var _0x4719e2={'raw':!![],'where':{'id':_0x3c2f12[_0x28fb('0x3f')]['id']}},_0x838339={};_0x838339[_0x28fb('0x2b')]=_['keys'](db[_0x28fb('0x26')][_0x28fb('0x27')]);_0x838339[_0x28fb('0x2c')]=_[_0x28fb('0x2d')](_0x3c2f12['query']);_0x838339[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x838339[_0x28fb('0x2b')],_0x838339[_0x28fb('0x2c')]);_0x4719e2[_0x28fb('0x31')]=_[_0x28fb('0x2f')](_0x838339[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x3c2f12[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x4719e2['attributes']=_0x4719e2[_0x28fb('0x31')][_0x28fb('0x32')]?_0x4719e2['attributes']:_0x838339['model'];if(_0x3c2f12[_0x28fb('0x2c')][_0x28fb('0x3c')]){_0x4719e2[_0x28fb('0x3d')]=[{'all':!![]}];}_0x4719e2=_[_0x28fb('0x3a')]({},_0x4719e2,_0x3c2f12[_0x28fb('0x3b')]);return db[_0x28fb('0x26')]['find'](_0x4719e2)['then'](handleEntityNotFound(_0xbe5376,null))[_0x28fb('0x20')](respondWithResult(_0xbe5376,null))['catch'](handleError(_0xbe5376,null));};exports['create']=function(_0x225fb8,_0x20a343){return db[_0x28fb('0x26')][_0x28fb('0x40')](_0x225fb8[_0x28fb('0x41')],{})['then'](respondWithResult(_0x20a343,0xc9))[_0x28fb('0x42')](handleError(_0x20a343,null));};exports['update']=function(_0xbccb7d,_0xca5bfd){if(_0xbccb7d[_0x28fb('0x41')]['id']){delete _0xbccb7d[_0x28fb('0x41')]['id'];}return db[_0x28fb('0x26')]['find']({'where':{'id':_0xbccb7d[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0xca5bfd,null))['then'](saveUpdates(_0xbccb7d[_0x28fb('0x41')],null))[_0x28fb('0x20')](respondWithResult(_0xca5bfd,null))[_0x28fb('0x42')](handleError(_0xca5bfd,null));};exports[_0x28fb('0x43')]=function(_0x379b47,_0x4adaa0){return db[_0x28fb('0x26')][_0x28fb('0x44')]({'where':{'id':_0x379b47[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0x4adaa0,null))[_0x28fb('0x20')](removeEntity(_0x4adaa0,null))[_0x28fb('0x42')](handleError(_0x4adaa0,null));};exports[_0x28fb('0x45')]=function(_0x231b22,_0x52165f){return db[_0x28fb('0x26')]['describe']()[_0x28fb('0x20')](respondWithResult(_0x52165f,null))[_0x28fb('0x42')](handleError(_0x52165f,null));};exports[_0x28fb('0x46')]=function(_0x468db8,_0x12d8c3,_0x45f8b0){var _0x3f233f={'raw':!![],'where':{}};var _0x1b1597={};var _0x1f1ac3={'count':0x0,'rows':[]};return db[_0x28fb('0x26')][_0x28fb('0x47')]({'where':{'id':_0x468db8[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0x12d8c3,null))['then'](function(_0x17515e){if(_0x17515e){_0x1b1597[_0x28fb('0x2b')]=_['keys'](db[_0x28fb('0x48')][_0x28fb('0x27')]);_0x1b1597['query']=_['keys'](_0x468db8[_0x28fb('0x2c')]);_0x1b1597[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x1b1597[_0x28fb('0x2b')],_0x1b1597[_0x28fb('0x2c')]);_0x3f233f[_0x28fb('0x31')]=_[_0x28fb('0x2f')](_0x1b1597[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x3f233f['attributes']=_0x3f233f['attributes']['length']?_0x3f233f[_0x28fb('0x31')]:_0x1b1597[_0x28fb('0x2b')];if(!_0x468db8[_0x28fb('0x2c')][_0x28fb('0x33')]('nolimit')){_0x3f233f[_0x28fb('0x1c')]=qs[_0x28fb('0x1c')](_0x468db8['query']['limit']);_0x3f233f[_0x28fb('0x1a')]=qs[_0x28fb('0x1a')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x1a')]);}_0x3f233f[_0x28fb('0x35')]=qs[_0x28fb('0x36')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x36')]);_0x3f233f[_0x28fb('0x38')]=qs[_0x28fb('0x2e')](_[_0x28fb('0x49')](_0x468db8['query'],_0x1b1597[_0x28fb('0x2e')]));_0x3f233f[_0x28fb('0x38')]['SessionId']=_0x17515e['id'];if(_0x468db8[_0x28fb('0x2c')][_0x28fb('0x37')]){_0x3f233f['where']=_[_0x28fb('0x3a')](_0x3f233f[_0x28fb('0x38')],{'$or':_[_0x28fb('0x25')](_0x3f233f[_0x28fb('0x31')],function(_0x7c7d6c){var _0x2ff774={};_0x2ff774[_0x7c7d6c]={'$like':'%'+_0x468db8[_0x28fb('0x2c')]['filter']+'%'};return _0x2ff774;})});}_0x3f233f=_[_0x28fb('0x3a')]({},_0x3f233f,_0x468db8[_0x28fb('0x3b')]);return db[_0x28fb('0x48')][_0x28fb('0x1d')]({'where':_0x3f233f['where']})[_0x28fb('0x20')](function(_0x22e0c5){_0x1f1ac3[_0x28fb('0x1d')]=_0x22e0c5;if(_0x468db8[_0x28fb('0x2c')]['includeAll']){_0x3f233f[_0x28fb('0x3d')]=[{'all':!![]}];}return db[_0x28fb('0x48')][_0x28fb('0x4a')](_0x3f233f);})[_0x28fb('0x20')](function(_0x1e0e2c){_0x1f1ac3[_0x28fb('0x3e')]=_0x1e0e2c;return _0x1f1ac3;});}})[_0x28fb('0x20')](respondWithFilteredResult(_0x12d8c3,_0x3f233f))[_0x28fb('0x42')](handleError(_0x12d8c3,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index e87ec05..798111e 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 _0xcd59=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x2ab157,_0x30f737){var _0x1399f3=function(_0x308d58){while(--_0x308d58){_0x2ab157['push'](_0x2ab157['shift']());}};_0x1399f3(++_0x30f737);}(_0xcd59,0x14b));var _0x9cd5=function(_0x2ba9ac,_0xa1fdc4){_0x2ba9ac=_0x2ba9ac-0x0;var _0x1b0fc9=_0xcd59[_0x2ba9ac];return _0x1b0fc9;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5334=['moment','request-promise','rimraf','../../config/environment','lodash','util','../../config/logger','api'];(function(_0x4b251e,_0x50150f){var _0x832ac6=function(_0x5194f5){while(--_0x5194f5){_0x4b251e['push'](_0x4b251e['shift']());}};_0x832ac6(++_0x50150f);}(_0x5334,0x84));var _0x4533=function(_0x3488a4,_0x2c59f3){_0x3488a4=_0x3488a4-0x0;var _0x4a69d6=_0x5334[_0x3488a4];return _0x4a69d6;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x51b4ce,_0x201673){return _0x51b4ce['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b4888ea..407dc4c 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 _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x5b49b0,_0x1d60a7){var _0x428eff=function(_0x20b09e){while(--_0x20b09e){_0x5b49b0['push'](_0x5b49b0['shift']());}};_0x428eff(++_0x1d60a7);}(_0x8aad,0x146));var _0xd8aa=function(_0x24f68c,_0x227f43){_0x24f68c=_0x24f68c-0x0;var _0x2e7be3=_0x8aad[_0x24f68c];return _0x2e7be3;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd0c14,_0x1c08a8){var _0x4d5789=function(_0x20c20a){while(--_0x20c20a){_0xd0c14['push'](_0xd0c14['shift']());}};_0x4d5789(++_0x1c08a8);}(_0x0295,0x1f0));var _0x5029=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x0295[_0x4b3300];return _0x2d26d3;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 32a8c45..43ca346 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 _0xc737=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','multer'];(function(_0x5dbcc8,_0x42a335){var _0xa101fd=function(_0x493ad8){while(--_0x493ad8){_0x5dbcc8['push'](_0x5dbcc8['shift']());}};_0xa101fd(++_0x42a335);}(_0xc737,0x8e));var _0x7c73=function(_0x588b85,_0x21d8a9){_0x588b85=_0x588b85-0x0;var _0x36c533=_0xc737[_0x588b85];return _0x36c533;};'use strict';var multer=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var path=require('path');var timeout=require(_0x7c73('0x2'));var express=require(_0x7c73('0x3'));var router=express[_0x7c73('0x4')]();var fs_extra=require(_0x7c73('0x5'));var auth=require(_0x7c73('0x6'));var interaction=require(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0x7c73('0x9')]);router[_0x7c73('0xa')](_0x7c73('0xb'),auth[_0x7c73('0xc')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x590c=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0x5f0707,_0x4debdf){var _0x4220d7=function(_0x184eae){while(--_0x184eae){_0x5f0707['push'](_0x5f0707['shift']());}};_0x4220d7(++_0x4debdf);}(_0x590c,0x80));var _0xc590=function(_0x1dea0d,_0x25de3f){_0x1dea0d=_0x1dea0d-0x0;var _0x11f547=_0x590c[_0x1dea0d];return _0x11f547;};'use strict';var multer=require(_0xc590('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc590('0x1'));var express=require(_0xc590('0x2'));var router=express[_0xc590('0x3')]();var fs_extra=require(_0xc590('0x4'));var auth=require(_0xc590('0x5'));var interaction=require(_0xc590('0x6'));var config=require(_0xc590('0x7'));var controller=require(_0xc590('0x8'));router[_0xc590('0x9')]('/',controller[_0xc590('0xa')]);router[_0xc590('0xb')](_0xc590('0xc'),auth[_0xc590('0xd')](),controller[_0xc590('0xe')]);module[_0xc590('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 90b0348..e628d65 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 _0x3551=['TEXT','STRING','sequelize','exports'];(function(_0x123317,_0x2cac46){var _0x4c44d1=function(_0x46a968){while(--_0x46a968){_0x123317['push'](_0x123317['shift']());}};_0x4c44d1(++_0x2cac46);}(_0x3551,0x18e));var _0x1355=function(_0x549110,_0x3880ed){_0x549110=_0x549110-0x0;var _0x10ca74=_0x3551[_0x549110];return _0x10ca74;};'use strict';var Sequelize=require(_0x1355('0x0'));module[_0x1355('0x1')]={'license':{'type':Sequelize[_0x1355('0x2')]},'data1':{'type':Sequelize[_0x1355('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7792=['sequelize','exports','STRING'];(function(_0x4a1d55,_0xb60903){var _0x463b41=function(_0x18f753){while(--_0x18f753){_0x4a1d55['push'](_0x4a1d55['shift']());}};_0x463b41(++_0xb60903);}(_0x7792,0x1d7));var _0x2779=function(_0x147e9e,_0x3dfac5){_0x147e9e=_0x147e9e-0x0;var _0x1b42cf=_0x7792[_0x147e9e];return _0x1b42cf;};'use strict';var Sequelize=require(_0x2779('0x0'));module[_0x2779('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2779('0x2')]},'data2':{'type':Sequelize[_0x2779('0x2')]},'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 7bf6f3a..fc2314d 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 _0x5fab=['checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','then','catch','body','find','params'];(function(_0x283695,_0x51cd2a){var _0x21ac4a=function(_0xaafc21){while(--_0xaafc21){_0x283695['push'](_0x283695['shift']());}};_0x21ac4a(++_0x51cd2a);}(_0x5fab,0x177));var _0xb5fa=function(_0x217e5b,_0x53776f){_0x217e5b=_0x217e5b-0x0;var _0x38f156=_0x5fab[_0x217e5b];return _0x38f156;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}var utilLicense=require(_0xb5fa('0x18'));exports[_0xb5fa('0x2b')]=function(_0x3506a4,_0x358549){var _0x353314={'raw':!![],'where':{'id':0x1}},_0x409af9={};_0x409af9[_0xb5fa('0x2c')]=_[_0xb5fa('0x2d')](db[_0xb5fa('0x2e')][_0xb5fa('0x2f')]);_0x409af9[_0xb5fa('0x30')]=_[_0xb5fa('0x2d')](_0x3506a4[_0xb5fa('0x30')]);_0x409af9[_0xb5fa('0x31')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],_0x409af9[_0xb5fa('0x30')]);_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],qs[_0xb5fa('0x34')](_0x3506a4['query'][_0xb5fa('0x34')]));_0x353314['attributes']=_0x353314['attributes']['length']?_0x353314[_0xb5fa('0x33')]:_0x409af9['model'];_0x353314=_[_0xb5fa('0x35')]({},_0x353314,_0x3506a4['options']);return utilLicense['getLicense'](_0x353314)[_0xb5fa('0x36')](respondWithResult(_0x358549,null))[_0xb5fa('0x37')](handleError(_0x358549,null));};exports['update']=function(_0x59f41d,_0x3d73c2){if(_0x59f41d[_0xb5fa('0x38')]['id']){delete _0x59f41d[_0xb5fa('0x38')]['id'];}return db['License'][_0xb5fa('0x39')]({'where':{'id':_0x59f41d[_0xb5fa('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d73c2,null))[_0xb5fa('0x36')](function(_0x2056de){var _0x204d6b=_0x2056de['get']({'plain':!![]});return utilLicense[_0xb5fa('0x3b')](_0x204d6b,_0x59f41d[_0xb5fa('0x38')][_0xb5fa('0x3c')]);})['then'](function(_0x117694){if(!_0x117694[_0xb5fa('0x3d')]){return saveUpdates(_0x59f41d[_0xb5fa('0x38')],null);}return _0x117694;})[_0xb5fa('0x36')](respondWithResult(_0x3d73c2,null))['catch'](handleError(_0x3d73c2,null));}; \ No newline at end of file +var _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x159811,_0x4caa5b){var _0x537769=function(_0xb0dfa9){while(--_0xb0dfa9){_0x159811['push'](_0x159811['shift']());}};_0x537769(++_0x4caa5b);}(_0x1261,0x144));var _0x1126=function(_0x111ccc,_0x4f5094){_0x111ccc=_0x111ccc-0x0;var _0x5bd2a5=_0x1261[_0x111ccc];return _0x5bd2a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3bd7ce3..e4e8fac 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 _0x63f3=['../../config/logger','api','moment','request-promise','rimraf','./license.attributes','exports','define','License','lodash'];(function(_0x36c15f,_0x186f6c){var _0x2065af=function(_0x27ed8c){while(--_0x27ed8c){_0x36c15f['push'](_0x36c15f['shift']());}};_0x2065af(++_0x186f6c);}(_0x63f3,0x199));var _0x363f=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x63f3[_0xa9eaa0];return _0x30897a;};'use strict';var _=require(_0x363f('0x0'));var util=require('util');var logger=require(_0x363f('0x1'))(_0x363f('0x2'));var moment=require(_0x363f('0x3'));var BPromise=require('bluebird');var rp=require(_0x363f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x363f('0x5'));var config=require('../../config/environment');var attributes=require(_0x363f('0x6'));module[_0x363f('0x7')]=function(_0x2fc9ea,_0x358c0e){return _0x2fc9ea[_0x363f('0x8')](_0x363f('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e46=['exports','define','license','lodash','api','moment','bluebird','request-promise','../../config/environment','./license.attributes'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x4e46,0x7b));var _0x64e4=function(_0x44b6df,_0x18db79){_0x44b6df=_0x44b6df-0x0;var _0x5628b3=_0x4e46[_0x44b6df];return _0x5628b3;};'use strict';var _=require(_0x64e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x64e4('0x1'));var moment=require(_0x64e4('0x2'));var BPromise=require(_0x64e4('0x3'));var rp=require(_0x64e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64e4('0x5'));var attributes=require(_0x64e4('0x6'));module[_0x64e4('0x7')]=function(_0x5b939c,_0x10d93b){return _0x5b939c[_0x64e4('0x8')]('License',attributes,{'tableName':_0x64e4('0x9'),'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 a3595b9..70685f9 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 _0xf083=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x521c56,_0x517763){var _0x23d1ca=function(_0x1ec41e){while(--_0x1ec41e){_0x521c56['push'](_0x521c56['shift']());}};_0x23d1ca(++_0x517763);}(_0xf083,0x165));var _0x3f08=function(_0x447421,_0x1324cd){_0x447421=_0x447421-0x0;var _0x52aac5=_0xf083[_0x447421];return _0x52aac5;};'use strict';var _=require(_0x3f08('0x0'));var util=require(_0x3f08('0x1'));var moment=require('moment');var BPromise=require(_0x3f08('0x2'));var rs=require(_0x3f08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f08('0x4'))['db'];var utils=require(_0x3f08('0x5'));var logger=require(_0x3f08('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3f08('0x7'));var client=jayson['client'][_0x3f08('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x302a0a,_0x63300f,_0x3b8103){return new BPromise(function(_0xcc1a2d,_0x2b0fba){return client[_0x3f08('0x9')](_0x302a0a,_0x3b8103)[_0x3f08('0xa')](function(_0x43ffb3){logger[_0x3f08('0xb')](_0x3f08('0xc'),_0x63300f,_0x3f08('0xd'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x63300f,_0x3f08('0xd'),JSON[_0x3f08('0xe')](_0x43ffb3));if(_0x43ffb3[_0x3f08('0xf')]){if(_0x43ffb3[_0x3f08('0xf')]['code']===0x1f4){logger[_0x3f08('0xf')](_0x3f08('0xc'),_0x63300f,_0x43ffb3['error'][_0x3f08('0x10')]);return _0x2b0fba(_0x43ffb3[_0x3f08('0xf')][_0x3f08('0x10')]);}logger['error'](_0x3f08('0xc'),_0x63300f,_0x43ffb3[_0x3f08('0xf')][_0x3f08('0x10')]);return _0xcc1a2d(_0x43ffb3['error']['message']);}else{logger[_0x3f08('0xb')]('License,\x20%s,\x20%s',_0x63300f,_0x3f08('0xd'));_0xcc1a2d(_0x43ffb3['result'][_0x3f08('0x10')]);}})[_0x3f08('0x11')](function(_0x396b6e){logger[_0x3f08('0xf')](_0x3f08('0xc'),_0x63300f,_0x396b6e);_0x2b0fba(_0x396b6e);});});} \ No newline at end of file +var _0x7d37=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7d37,0x1e0));var _0x77d3=function(_0x5c8c16,_0x208c6b){_0x5c8c16=_0x5c8c16-0x0;var _0x1cb779=_0x7d37[_0x5c8c16];return _0x1cb779;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require(_0x77d3('0x3'));var rs=require(_0x77d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x77d3('0x6'));var config=require(_0x77d3('0x7'));var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35dd68,_0x28fdc3,_0x4e6343){return new BPromise(function(_0x471131,_0x1b38fd){return client[_0x77d3('0xa')](_0x35dd68,_0x4e6343)[_0x77d3('0xb')](function(_0x3b3cef){logger['info'](_0x77d3('0xc'),_0x28fdc3,_0x77d3('0xd'));logger['debug'](_0x77d3('0xe'),_0x28fdc3,_0x77d3('0xd'),JSON[_0x77d3('0xf')](_0x3b3cef));if(_0x3b3cef[_0x77d3('0x10')]){if(_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x11')]===0x1f4){logger[_0x77d3('0x10')](_0x77d3('0xc'),_0x28fdc3,_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x12')]);return _0x1b38fd(_0x3b3cef['error']['message']);}logger[_0x77d3('0x10')](_0x77d3('0xc'),_0x28fdc3,_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x12')]);return _0x471131(_0x3b3cef['error'][_0x77d3('0x12')]);}else{logger[_0x77d3('0x13')](_0x77d3('0xc'),_0x28fdc3,_0x77d3('0xd'));_0x471131(_0x3b3cef[_0x77d3('0x14')]['message']);}})[_0x77d3('0x15')](function(_0x223670){logger['error']('License,\x20%s,\x20%s',_0x28fdc3,_0x223670);_0x1b38fd(_0x223670);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index fd68ef3..c0cd97e 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 _0x1636=['getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','/:id/users','post','addDisposition','create','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x1636,0x1d5));var _0x6163=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1636[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x6163('0x0'));var util=require('util');var path=require(_0x6163('0x1'));var timeout=require(_0x6163('0x2'));var express=require(_0x6163('0x3'));var router=express[_0x6163('0x4')]();var fs_extra=require(_0x6163('0x5'));var auth=require(_0x6163('0x6'));var interaction=require(_0x6163('0x7'));var config=require(_0x6163('0x8'));var controller=require(_0x6163('0x9'));router[_0x6163('0xa')]('/',auth['isAuthenticated'](),controller[_0x6163('0xb')]);router[_0x6163('0xa')](_0x6163('0xc'),auth[_0x6163('0xd')](),controller[_0x6163('0xe')]);router[_0x6163('0xa')](_0x6163('0xf'),auth[_0x6163('0xd')](),controller[_0x6163('0x10')]);router[_0x6163('0xa')]('/:id/dispositions',auth[_0x6163('0xd')](),controller[_0x6163('0x11')]);router['get'](_0x6163('0x12'),auth[_0x6163('0xd')](),controller[_0x6163('0x13')]);router[_0x6163('0xa')](_0x6163('0x14'),auth[_0x6163('0xd')](),controller[_0x6163('0x15')]);router[_0x6163('0xa')](_0x6163('0x16'),auth[_0x6163('0xd')](),controller[_0x6163('0x17')]);router[_0x6163('0xa')](_0x6163('0x18'),auth[_0x6163('0xd')](),controller[_0x6163('0x19')]);router[_0x6163('0xa')](_0x6163('0x1a'),auth[_0x6163('0xd')](),controller['getApplications']);router['get']('/:id/messages',auth[_0x6163('0xd')](),controller[_0x6163('0x1b')]);router['get'](_0x6163('0x1c'),auth[_0x6163('0xd')](),controller['verifySmtp']);router['get'](_0x6163('0x1d'),auth[_0x6163('0xd')](),controller['getAgents']);router[_0x6163('0x1e')]('/:id/dispositions',auth[_0x6163('0xd')](),controller[_0x6163('0x1f')]);router[_0x6163('0x1e')](_0x6163('0x12'),auth[_0x6163('0xd')](),controller['addAnswer']);router['post']('/',auth[_0x6163('0xd')](),controller[_0x6163('0x20')]);router['post'](_0x6163('0x14'),auth['isAuthenticated'](),controller[_0x6163('0x21')]);router[_0x6163('0x1e')]('/:id/out_servers',auth[_0x6163('0xd')](),controller[_0x6163('0x22')]);router[_0x6163('0x1e')](_0x6163('0x18'),auth[_0x6163('0xd')](),controller['addInteraction']);router[_0x6163('0x1e')](_0x6163('0x1a'),auth[_0x6163('0xd')](),controller[_0x6163('0x23')]);router[_0x6163('0x1e')](_0x6163('0x24'),auth[_0x6163('0xd')](),controller[_0x6163('0x25')]);router[_0x6163('0x1e')](_0x6163('0x1d'),auth[_0x6163('0xd')](),controller[_0x6163('0x26')]);router[_0x6163('0x27')](_0x6163('0xf'),auth[_0x6163('0xd')](),controller['update']);router[_0x6163('0x28')](_0x6163('0x29'),auth['isAuthenticated'](),controller[_0x6163('0x2a')]);router[_0x6163('0x28')]('/:id/canned_answers',auth[_0x6163('0xd')](),controller[_0x6163('0x2b')]);router[_0x6163('0x28')]('/:id/in_servers',auth[_0x6163('0xd')](),controller[_0x6163('0x2c')]);router[_0x6163('0x28')](_0x6163('0x16'),auth[_0x6163('0xd')](),controller[_0x6163('0x2d')]);router[_0x6163('0x28')](_0x6163('0xf'),auth[_0x6163('0xd')](),controller[_0x6163('0x2e')]);router['delete'](_0x6163('0x1d'),auth[_0x6163('0xd')](),controller[_0x6163('0x2f')]);module[_0x6163('0x30')]=router; \ No newline at end of file +var _0x0a38=['put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','addSmtp','addInteraction','/:id/send','send','addAgents'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0x0a38,0x9b));var _0x80a3=function(_0x1631d8,_0x42f051){_0x1631d8=_0x1631d8-0x0;var _0x287eec=_0x0a38[_0x1631d8];return _0x287eec;};'use strict';var multer=require(_0x80a3('0x0'));var util=require('util');var path=require(_0x80a3('0x1'));var timeout=require(_0x80a3('0x2'));var express=require(_0x80a3('0x3'));var router=express[_0x80a3('0x4')]();var fs_extra=require(_0x80a3('0x5'));var auth=require(_0x80a3('0x6'));var interaction=require(_0x80a3('0x7'));var config=require(_0x80a3('0x8'));var controller=require(_0x80a3('0x9'));router[_0x80a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x80a3('0xb')]);router[_0x80a3('0xa')](_0x80a3('0xc'),auth[_0x80a3('0xd')](),controller[_0x80a3('0xe')]);router[_0x80a3('0xa')](_0x80a3('0xf'),auth[_0x80a3('0xd')](),controller['show']);router[_0x80a3('0xa')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x11')]);router['get']('/:id/canned_answers',auth[_0x80a3('0xd')](),controller[_0x80a3('0x12')]);router[_0x80a3('0xa')](_0x80a3('0x13'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x14')]);router[_0x80a3('0xa')](_0x80a3('0x15'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x16')]);router[_0x80a3('0xa')](_0x80a3('0x17'),auth['isAuthenticated'](),controller[_0x80a3('0x18')]);router['get'](_0x80a3('0x19'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1a')]);router[_0x80a3('0xa')](_0x80a3('0x1b'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1c')]);router['get'](_0x80a3('0x1d'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1e')]);router[_0x80a3('0xa')](_0x80a3('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router[_0x80a3('0x20')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x21')]);router[_0x80a3('0x20')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x23')]);router[_0x80a3('0x20')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x80a3('0x13'),auth['isAuthenticated'](),controller['addImap']);router[_0x80a3('0x20')](_0x80a3('0x15'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x24')]);router['post'](_0x80a3('0x17'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x25')]);router[_0x80a3('0x20')](_0x80a3('0x19'),auth[_0x80a3('0xd')](),controller['addApplications']);router[_0x80a3('0x20')](_0x80a3('0x26'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x27')]);router[_0x80a3('0x20')](_0x80a3('0x1f'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x28')]);router[_0x80a3('0x29')](_0x80a3('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x80a3('0x2a')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2b')]);router[_0x80a3('0x2a')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x2c')]);router[_0x80a3('0x2a')](_0x80a3('0x13'),auth['isAuthenticated'](),controller['removeImap']);router[_0x80a3('0x2a')]('/:id/out_servers',auth[_0x80a3('0xd')](),controller[_0x80a3('0x2d')]);router[_0x80a3('0x2a')](_0x80a3('0xf'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2e')]);router['delete'](_0x80a3('0x1f'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2f')]);module[_0x80a3('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 0e5227e..6cbe4b7 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 _0x9de3=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER'];(function(_0x262680,_0x2347c4){var _0x310431=function(_0x56b1cc){while(--_0x56b1cc){_0x262680['push'](_0x262680['shift']());}};_0x310431(++_0x2347c4);}(_0x9de3,0xea));var _0x39de=function(_0x4bee2c,_0x3a2f0d){_0x4bee2c=_0x4bee2c-0x0;var _0x4e8e7f=_0x9de3[_0x4bee2c];return _0x4e8e7f;};'use strict';var Sequelize=require(_0x39de('0x0'));module['exports']={'description':{'type':Sequelize[_0x39de('0x1')]},'name':{'type':Sequelize[_0x39de('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x39de('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x39de('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x39de('0x3')]},'markAsUnread':{'type':Sequelize[_0x39de('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x39de('0x1')],'allowNull':![],'defaultValue':_0x39de('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x39de('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x39de('0x3')],'defaultValue':function(){return _0x39de('0x6');}},'notificationSound':{'type':Sequelize[_0x39de('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x39de('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x39de('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x39de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x39de('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x39de('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x39de('0x2')],'defaultValue':![],'comment':_0x39de('0x9'),'set':function(_0x431b4a){if(!_0x431b4a)this[_0x39de('0xa')]('mandatoryDispositionPauseId',null);this[_0x39de('0xa')]('mandatoryDisposition',_0x431b4a);}}}; \ No newline at end of file +var _0x17c4=['STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x3957ee,_0x106e67){var _0x279939=function(_0x2727c9){while(--_0x2727c9){_0x3957ee['push'](_0x3957ee['shift']());}};_0x279939(++_0x106e67);}(_0x17c4,0x102));var _0x417c=function(_0x178d9c,_0x3aaad3){_0x178d9c=_0x178d9c-0x0;var _0x9656c5=_0x17c4[_0x178d9c];return _0x9656c5;};'use strict';var Sequelize=require(_0x417c('0x0'));module[_0x417c('0x1')]={'description':{'type':Sequelize[_0x417c('0x2')]},'name':{'type':Sequelize[_0x417c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x417c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x417c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x417c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x417c('0x4')]},'markAsUnread':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x417c('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x417c('0x5')](0x2)[_0x417c('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x417c('0x4')],'defaultValue':function(){return _0x417c('0x7');}},'notificationSound':{'type':Sequelize[_0x417c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x417c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x417c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x417c('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x8755fd){if(!_0x8755fd)this[_0x417c('0x8')](_0x417c('0x9'),null);this[_0x417c('0x8')]('mandatoryDisposition',_0x8755fd);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 16058f9..8b055fc 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 _0xaf62=['Contacts','ListId','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','set','json','reject','save','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','options','include','rows','params','fields','includeAll','find','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','filter','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','active','isNil','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','bulkCreate','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','true','CmList','updatedAt','DESC','from','%s\x20<%s>','attachments','join','basename','auth','secure','sendMail','List\x20not\x20found','List'];(function(_0x4c27be,_0x348ca2){var _0x173fa9=function(_0xfb7636){while(--_0xfb7636){_0x4c27be['push'](_0x4c27be['shift']());}};_0x173fa9(++_0x348ca2);}(_0xaf62,0x19b));var _0x2af6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaf62[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x2af6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2af6('0x1'));var moment=require(_0x2af6('0x2'));var BPromise=require(_0x2af6('0x3'));var Mustache=require(_0x2af6('0x4'));var util=require(_0x2af6('0x5'));var path=require(_0x2af6('0x6'));var sox=require(_0x2af6('0x7'));var csv=require(_0x2af6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2af6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2af6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2af6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2af6('0xc'));var Papa=require(_0x2af6('0xd'));var htmlToText=require(_0x2af6('0xe'));var juice=require(_0x2af6('0xf'));var Redis=require(_0x2af6('0x10'));var authService=require(_0x2af6('0x11'));var qs=require(_0x2af6('0x12'));var as=require(_0x2af6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2af6('0x14'))(_0x2af6('0x15'));var utils=require(_0x2af6('0x16'));var config=require(_0x2af6('0x17'));var licenseUtil=require(_0x2af6('0x18'));var db=require('../../mysqldb')['db'];config[_0x2af6('0x19')]=_[_0x2af6('0x1a')](config[_0x2af6('0x19')],{'host':_0x2af6('0x1b'),'port':0x18eb});var socket=require(_0x2af6('0x1c'))(new Redis(config['redis']));require(_0x2af6('0x1d'))[_0x2af6('0x1e')](socket);var jayson=require(_0x2af6('0x1f'));var client=jayson[_0x2af6('0x20')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2b8bff,_0x4fdb5c,_0x29ee31,_0x5244be){return new BPromise(function(_0x587141,_0x3f1b47){var _0x1e11a9=_0x5244be||client;return _0x1e11a9[_0x2af6('0x21')](_0x2b8bff,_0x29ee31)['then'](function(_0x104afa){logger[_0x2af6('0x22')](_0x2af6('0x23'),_0x4fdb5c,_0x2af6('0x24'));logger[_0x2af6('0x25')](_0x2af6('0x26'),_0x4fdb5c,_0x2af6('0x24'),JSON['stringify'](_0x104afa));if(_0x104afa[_0x2af6('0x27')]){if(_0x104afa[_0x2af6('0x27')][_0x2af6('0x28')]===0x1f4){logger[_0x2af6('0x27')](_0x2af6('0x23'),_0x4fdb5c,_0x104afa['error'][_0x2af6('0x29')]);return _0x3f1b47(_0x104afa['error'][_0x2af6('0x29')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x4fdb5c,_0x104afa[_0x2af6('0x27')][_0x2af6('0x29')]);return _0x587141(_0x104afa[_0x2af6('0x27')][_0x2af6('0x29')]);}else{logger[_0x2af6('0x22')](_0x2af6('0x23'),_0x4fdb5c,_0x2af6('0x24'));_0x587141(_0x104afa[_0x2af6('0x2a')][_0x2af6('0x29')]);}})[_0x2af6('0x2b')](function(_0x33981b){logger['error']('MailAccount,\x20%s,\x20%s',_0x4fdb5c,_0x33981b);_0x3f1b47(_0x33981b);});});}function respondWithStatusCode(_0x18d08f,_0x3753fe){_0x3753fe=_0x3753fe||0xcc;return function(_0x5c6249){if(_0x5c6249){return _0x18d08f[_0x2af6('0x2c')](_0x3753fe);}return _0x18d08f['status'](_0x3753fe)[_0x2af6('0x2d')]();};}function respondWithResult(_0x4c0bf3,_0x4f1095){_0x4f1095=_0x4f1095||0xc8;return function(_0x132249){if(_0x132249){return _0x4c0bf3[_0x2af6('0x2e')](_0x4f1095)['json'](_0x132249);}};}function respondWithFilteredResult(_0x7078f1,_0x249417){return function(_0x3f4826){if(_0x3f4826){var _0x1c5636=typeof _0x249417[_0x2af6('0x2f')]===_0x2af6('0x30')&&typeof _0x249417['limit']===_0x2af6('0x30');var _0x28a175=_0x3f4826[_0x2af6('0x31')];var _0x2a1d51=_0x1c5636?0x0:_0x249417[_0x2af6('0x2f')];var _0xd8109c=_0x1c5636?_0x3f4826[_0x2af6('0x31')]:_0x249417[_0x2af6('0x2f')]+_0x249417['limit'];var _0x1ce197;if(_0xd8109c>=_0x28a175){_0xd8109c=_0x28a175;_0x1ce197=0xc8;}else{_0x1ce197=0xce;}_0x7078f1[_0x2af6('0x2e')](_0x1ce197);return _0x7078f1[_0x2af6('0x32')]('Content-Range',_0x2a1d51+'-'+_0xd8109c+'/'+_0x28a175)[_0x2af6('0x33')](_0x3f4826);}return null;};}function patchUpdates(_0x31e4b7){return function(_0x1824b4){try{jsonpatch['apply'](_0x1824b4,_0x31e4b7,!![]);}catch(_0x144a20){return BPromise[_0x2af6('0x34')](_0x144a20);}return _0x1824b4[_0x2af6('0x35')]();};}function saveUpdates(_0x3ed16e,_0x3c49ad){return function(_0x23379b){if(_0x23379b){return _0x23379b[_0x2af6('0x36')](_0x3ed16e)[_0x2af6('0x37')](function(_0x1238ee){return _0x1238ee;});}return null;};}function removeEntity(_0xcd94f2,_0x130510){return function(_0x45385a){if(_0x45385a){return _0x45385a[_0x2af6('0x38')]()[_0x2af6('0x37')](function(){var _0x5e61f3=_0x45385a[_0x2af6('0x39')]({'plain':!![]});var _0x10ea80=_0x2af6('0x3a');return db[_0x2af6('0x3b')]['destroy']({'where':{'type':_0x10ea80,'resourceId':_0x5e61f3['id']}})[_0x2af6('0x37')](function(){return _0x45385a;});})[_0x2af6('0x37')](function(){_0xcd94f2['status'](0xcc)[_0x2af6('0x2d')]();});}};}function handleEntityNotFound(_0x5deb09,_0x5f5701){return function(_0x324f75){if(!_0x324f75){_0x5deb09[_0x2af6('0x2c')](0x194);}return _0x324f75;};}function handleError(_0x5bff40,_0x577ffa){_0x577ffa=_0x577ffa||0x1f4;return function(_0x36781b){logger[_0x2af6('0x27')](_0x36781b[_0x2af6('0x3c')]);if(_0x36781b[_0x2af6('0x3d')]){delete _0x36781b['name'];}_0x5bff40[_0x2af6('0x2e')](_0x577ffa)['send'](_0x36781b);};}exports[_0x2af6('0x3e')]=function(_0x2d4cd8,_0x3dab27){var _0x24d1f1={'include':[{'model':db[_0x2af6('0x3f')],'as':_0x2af6('0x40')},{'model':db[_0x2af6('0x41')],'as':_0x2af6('0x42')},{'model':db[_0x2af6('0x43')],'as':_0x2af6('0x44')}]},_0x5863bd={},_0x9a064b={'count':0x0,'rows':[]};var _0x4fca1a=_[_0x2af6('0x45')](db[_0x2af6('0x46')][_0x2af6('0x47')],function(_0x134c93){return{'name':_0x134c93[_0x2af6('0x48')],'type':_0x134c93[_0x2af6('0x49')]['key']};});_0x5863bd[_0x2af6('0x4a')]=_[_0x2af6('0x45')](_0x4fca1a,'name');_0x5863bd[_0x2af6('0x4b')]=_[_0x2af6('0x4c')](_0x2d4cd8[_0x2af6('0x4b')]);_0x5863bd[_0x2af6('0x4d')]=_[_0x2af6('0x4e')](_0x5863bd[_0x2af6('0x4a')],_0x5863bd['query']);_0x24d1f1[_0x2af6('0x4f')]=_['intersection'](_0x5863bd[_0x2af6('0x4a')],qs['fields'](_0x2d4cd8[_0x2af6('0x4b')]['fields']));_0x24d1f1['attributes']=_0x24d1f1['attributes'][_0x2af6('0x50')]?_0x24d1f1[_0x2af6('0x4f')]:_0x5863bd['model'];if(!_0x2d4cd8[_0x2af6('0x4b')][_0x2af6('0x51')](_0x2af6('0x52'))){_0x24d1f1['limit']=qs[_0x2af6('0x53')](_0x2d4cd8[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x24d1f1[_0x2af6('0x2f')]=qs['offset'](_0x2d4cd8[_0x2af6('0x4b')]['offset']);}_0x24d1f1[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x2d4cd8['query'][_0x2af6('0x55')]);_0x24d1f1['where']=qs[_0x2af6('0x4d')](_[_0x2af6('0x56')](_0x2d4cd8[_0x2af6('0x4b')],_0x5863bd[_0x2af6('0x4d')]),_0x4fca1a);if(_0x2d4cd8[_0x2af6('0x4b')]['filter']){_0x24d1f1[_0x2af6('0x57')]=_[_0x2af6('0x58')](_0x24d1f1[_0x2af6('0x57')],{'$or':_[_0x2af6('0x45')](_0x4fca1a,function(_0x380f96){if(_0x380f96[_0x2af6('0x49')]!=='VIRTUAL'){var _0x4eb138={};_0x4eb138[_0x380f96[_0x2af6('0x3d')]]={'$like':'%'+_0x2d4cd8[_0x2af6('0x4b')]['filter']+'%'};return _0x4eb138;}})});}_0x24d1f1=_[_0x2af6('0x58')]({},_0x24d1f1,_0x2d4cd8[_0x2af6('0x59')]);var _0x12d07b={'where':_0x24d1f1[_0x2af6('0x57')]};return db['MailAccount'][_0x2af6('0x31')](_0x12d07b)[_0x2af6('0x37')](function(_0x4f0cbe){_0x9a064b[_0x2af6('0x31')]=_0x4f0cbe;if(_0x2d4cd8[_0x2af6('0x4b')]['includeAll']){_0x24d1f1[_0x2af6('0x5a')]=[{'all':!![]}];}return db[_0x2af6('0x46')]['findAll'](_0x24d1f1);})['then'](function(_0x4e4138){_0x9a064b[_0x2af6('0x5b')]=_0x4e4138;return _0x9a064b;})[_0x2af6('0x37')](respondWithFilteredResult(_0x3dab27,_0x24d1f1))[_0x2af6('0x2b')](handleError(_0x3dab27,null));};exports['show']=function(_0x43abe0,_0x25997f){var _0x257dc8={'raw':![],'where':{'id':_0x43abe0[_0x2af6('0x5c')]['id']},'include':[{'model':db[_0x2af6('0x3f')],'as':_0x2af6('0x40')},{'model':db['MailServerOut'],'as':_0x2af6('0x42')},{'model':db['Pause'],'as':_0x2af6('0x44')}]},_0x4c761d={};_0x4c761d['model']=_[_0x2af6('0x4c')](db[_0x2af6('0x46')]['rawAttributes']);_0x4c761d[_0x2af6('0x4b')]=_[_0x2af6('0x4c')](_0x43abe0['query']);_0x4c761d[_0x2af6('0x4d')]=_[_0x2af6('0x4e')](_0x4c761d[_0x2af6('0x4a')],_0x4c761d[_0x2af6('0x4b')]);_0x257dc8[_0x2af6('0x4f')]=_[_0x2af6('0x4e')](_0x4c761d['model'],qs[_0x2af6('0x5d')](_0x43abe0[_0x2af6('0x4b')]['fields']));_0x257dc8[_0x2af6('0x4f')]=_0x257dc8[_0x2af6('0x4f')]['length']?_0x257dc8[_0x2af6('0x4f')]:_0x4c761d[_0x2af6('0x4a')];if(_0x43abe0['query'][_0x2af6('0x5e')]){_0x257dc8[_0x2af6('0x5a')]=[{'all':!![]}];}_0x257dc8=_[_0x2af6('0x58')]({},_0x257dc8,_0x43abe0['options']);return db[_0x2af6('0x46')][_0x2af6('0x5f')](_0x257dc8)[_0x2af6('0x37')](handleEntityNotFound(_0x25997f,null))[_0x2af6('0x37')](respondWithResult(_0x25997f,null))[_0x2af6('0x2b')](handleError(_0x25997f,null));};exports[_0x2af6('0x36')]=function(_0x426b6d,_0x34d0d2){if(_0x426b6d[_0x2af6('0x60')]['id']){delete _0x426b6d[_0x2af6('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x426b6d['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x2af6('0x40')},{'model':db['MailServerOut'],'as':_0x2af6('0x42')},{'model':db[_0x2af6('0x43')],'as':_0x2af6('0x44')}]})[_0x2af6('0x37')](handleEntityNotFound(_0x34d0d2,null))[_0x2af6('0x37')](saveUpdates(_0x426b6d['body'],null))[_0x2af6('0x37')](function(_0x10844b){if(_0x10844b&&_0x426b6d[_0x2af6('0x60')][_0x2af6('0x40')]){return db['MailServerIn'][_0x2af6('0x36')](_0x426b6d['body'][_0x2af6('0x40')],{'where':{'MailAccountId':_0x10844b['id']}})[_0x2af6('0x37')](function(){return _0x10844b;});}return _0x10844b;})[_0x2af6('0x37')](function(_0x39961e){if(_0x39961e&&_0x426b6d['body'][_0x2af6('0x42')]){return db[_0x2af6('0x41')][_0x2af6('0x36')](_0x426b6d[_0x2af6('0x60')][_0x2af6('0x42')],{'where':{'MailAccountId':_0x39961e['id']}})[_0x2af6('0x37')](function(){return _0x39961e;});}return _0x39961e;})[_0x2af6('0x37')](respondWithResult(_0x34d0d2,null))[_0x2af6('0x2b')](handleError(_0x34d0d2,null));};exports['describe']=function(_0x587c10,_0x4b3d3f){return db[_0x2af6('0x46')][_0x2af6('0x61')]()[_0x2af6('0x37')](respondWithResult(_0x4b3d3f,null))[_0x2af6('0x2b')](handleError(_0x4b3d3f,null));};exports['addDisposition']=function(_0x266473,_0x26874d,_0x46d618){if(_0x266473[_0x2af6('0x60')]['id']){delete _0x266473[_0x2af6('0x60')]['id'];}return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x266473['params']['id']}})['then'](handleEntityNotFound(_0x26874d,null))['then'](function(_0x4576d0){if(_0x4576d0){_0x266473['body'][_0x2af6('0x62')]=_0x4576d0['id'];return db[_0x2af6('0x63')][_0x2af6('0x64')](_0x266473['body']);}})[_0x2af6('0x37')](respondWithResult(_0x26874d,null))[_0x2af6('0x2b')](handleError(_0x26874d,null));};exports[_0x2af6('0x65')]=function(_0x54e21f,_0x331c7e,_0x39aed9){var _0x9f706e={'raw':![],'where':{}};var _0x569f4e={};var _0x4e3af1={'count':0x0,'rows':[]};return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x54e21f[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x331c7e,null))[_0x2af6('0x37')](function(_0x4a70ed){if(_0x4a70ed){_0x569f4e[_0x2af6('0x4a')]=_[_0x2af6('0x4c')](db[_0x2af6('0x63')][_0x2af6('0x47')]);_0x569f4e[_0x2af6('0x4b')]=_[_0x2af6('0x4c')](_0x54e21f[_0x2af6('0x4b')]);_0x569f4e['filters']=_[_0x2af6('0x4e')](_0x569f4e[_0x2af6('0x4a')],_0x569f4e['query']);_0x9f706e[_0x2af6('0x4f')]=_['intersection'](_0x569f4e[_0x2af6('0x4a')],qs['fields'](_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x5d')]));_0x9f706e[_0x2af6('0x4f')]=_0x9f706e[_0x2af6('0x4f')][_0x2af6('0x50')]?_0x9f706e[_0x2af6('0x4f')]:_0x569f4e[_0x2af6('0x4a')];if(!_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x51')](_0x2af6('0x52'))){_0x9f706e[_0x2af6('0x53')]=qs[_0x2af6('0x53')](_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x9f706e[_0x2af6('0x2f')]=qs['offset'](_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x2f')]);}_0x9f706e[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x54e21f['query'][_0x2af6('0x55')]);_0x9f706e['where']=qs[_0x2af6('0x4d')](_['pick'](_0x54e21f['query'],_0x569f4e[_0x2af6('0x4d')]));_0x9f706e[_0x2af6('0x57')][_0x2af6('0x62')]=_0x4a70ed['id'];if(_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x67')]){_0x9f706e[_0x2af6('0x57')]=_[_0x2af6('0x58')](_0x9f706e[_0x2af6('0x57')],{'$or':_['map'](_0x9f706e[_0x2af6('0x4f')],function(_0x220bbe){var _0x41d9cf={};_0x41d9cf[_0x220bbe]={'$like':'%'+_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x41d9cf;})});}_0x9f706e=_[_0x2af6('0x58')]({},_0x9f706e,_0x54e21f['options']);return db[_0x2af6('0x63')][_0x2af6('0x31')]({'where':_0x9f706e[_0x2af6('0x57')]})['then'](function(_0x4eb605){_0x4e3af1[_0x2af6('0x31')]=_0x4eb605;if(_0x54e21f[_0x2af6('0x4b')][_0x2af6('0x5e')]){_0x9f706e[_0x2af6('0x5a')]=[{'all':!![]}];}return db[_0x2af6('0x63')][_0x2af6('0x68')](_0x9f706e);})[_0x2af6('0x37')](function(_0x3217d5){_0x4e3af1[_0x2af6('0x5b')]=_0x3217d5;return _0x4e3af1;});}})[_0x2af6('0x37')](respondWithFilteredResult(_0x331c7e,_0x9f706e))[_0x2af6('0x2b')](handleError(_0x331c7e,null));};exports[_0x2af6('0x69')]=function(_0x44f873,_0x370565,_0x512a5e){return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x44f873['params']['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x370565,null))[_0x2af6('0x37')](function(_0x590484){if(_0x590484){return _0x590484[_0x2af6('0x69')](_0x44f873[_0x2af6('0x4b')][_0x2af6('0x6a')]);}})['then'](respondWithStatusCode(_0x370565,null))['catch'](handleError(_0x370565,null));};exports[_0x2af6('0x6b')]=function(_0x3e3a5b,_0x4f9099,_0x3af124){if(_0x3e3a5b[_0x2af6('0x60')]['id']){delete _0x3e3a5b[_0x2af6('0x60')]['id'];}return db['MailAccount'][_0x2af6('0x5f')]({'where':{'id':_0x3e3a5b['params']['id']}})['then'](handleEntityNotFound(_0x4f9099,null))['then'](function(_0x3954b7){if(_0x3954b7){_0x3e3a5b[_0x2af6('0x60')][_0x2af6('0x62')]=_0x3954b7['id'];return db[_0x2af6('0x6c')]['create'](_0x3e3a5b[_0x2af6('0x60')]);}})[_0x2af6('0x37')](respondWithResult(_0x4f9099,null))['catch'](handleError(_0x4f9099,null));};exports[_0x2af6('0x6d')]=function(_0x121bd3,_0x19dc07,_0x37f860){var _0x105e3d={'raw':![],'where':{}};var _0x273a15={};var _0x17488a={'count':0x0,'rows':[]};return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x121bd3[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x19dc07,null))[_0x2af6('0x37')](function(_0x284280){if(_0x284280){_0x273a15[_0x2af6('0x4a')]=_['keys'](db['CannedAnswer'][_0x2af6('0x47')]);_0x273a15[_0x2af6('0x4b')]=_['keys'](_0x121bd3[_0x2af6('0x4b')]);_0x273a15['filters']=_['intersection'](_0x273a15[_0x2af6('0x4a')],_0x273a15['query']);_0x105e3d[_0x2af6('0x4f')]=_[_0x2af6('0x4e')](_0x273a15[_0x2af6('0x4a')],qs[_0x2af6('0x5d')](_0x121bd3[_0x2af6('0x4b')][_0x2af6('0x5d')]));_0x105e3d[_0x2af6('0x4f')]=_0x105e3d[_0x2af6('0x4f')][_0x2af6('0x50')]?_0x105e3d[_0x2af6('0x4f')]:_0x273a15[_0x2af6('0x4a')];if(!_0x121bd3['query'][_0x2af6('0x51')](_0x2af6('0x52'))){_0x105e3d['limit']=qs[_0x2af6('0x53')](_0x121bd3[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x105e3d['offset']=qs[_0x2af6('0x2f')](_0x121bd3['query'][_0x2af6('0x2f')]);}_0x105e3d[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x121bd3[_0x2af6('0x4b')][_0x2af6('0x55')]);_0x105e3d[_0x2af6('0x57')]=qs[_0x2af6('0x4d')](_[_0x2af6('0x56')](_0x121bd3[_0x2af6('0x4b')],_0x273a15[_0x2af6('0x4d')]));_0x105e3d[_0x2af6('0x57')][_0x2af6('0x62')]=_0x284280['id'];if(_0x121bd3[_0x2af6('0x4b')][_0x2af6('0x67')]){_0x105e3d[_0x2af6('0x57')]=_['merge'](_0x105e3d[_0x2af6('0x57')],{'$or':_[_0x2af6('0x45')](_0x105e3d['attributes'],function(_0x1533a9){var _0x311959={};_0x311959[_0x1533a9]={'$like':'%'+_0x121bd3[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x311959;})});}_0x105e3d=_[_0x2af6('0x58')]({},_0x105e3d,_0x121bd3[_0x2af6('0x59')]);return db[_0x2af6('0x6c')][_0x2af6('0x31')]({'where':_0x105e3d[_0x2af6('0x57')]})[_0x2af6('0x37')](function(_0x5a0638){_0x17488a[_0x2af6('0x31')]=_0x5a0638;if(_0x121bd3['query'][_0x2af6('0x5e')]){_0x105e3d['include']=[{'all':!![]}];}return db[_0x2af6('0x6c')][_0x2af6('0x68')](_0x105e3d);})['then'](function(_0x58833e){_0x17488a[_0x2af6('0x5b')]=_0x58833e;return _0x17488a;});}})[_0x2af6('0x37')](respondWithFilteredResult(_0x19dc07,_0x105e3d))[_0x2af6('0x2b')](handleError(_0x19dc07,null));};exports['removeAnswers']=function(_0x52b45d,_0x100d03,_0xa511b9){return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x52b45d['params']['id']}})['then'](handleEntityNotFound(_0x100d03,null))[_0x2af6('0x37')](function(_0x27ba02){if(_0x27ba02){return _0x27ba02[_0x2af6('0x6e')](_0x52b45d[_0x2af6('0x4b')]['ids']);}})[_0x2af6('0x37')](respondWithStatusCode(_0x100d03,null))['catch'](handleError(_0x100d03,null));};exports[_0x2af6('0x64')]=function(_0x2aedd0,_0x137da2){var _0x3c6725={'name':_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x3d')],'key':_0x2aedd0[_0x2af6('0x60')]['key'],'email':_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x6f')],'ListId':_0x2aedd0[_0x2af6('0x60')]['ListId'],'active':!_['isNil'](_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x70')])?_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x70')]:!![],'description':_0x2aedd0[_0x2af6('0x60')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x2af6('0x71')](_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x72')])){if(_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x73')]){_0x3c6725[_0x2af6('0x40')][_0x2af6('0x74')]=_0x3c6725[_0x2af6('0x42')]['user']=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x75')];_0x3c6725['Imap']['password']=_0x3c6725[_0x2af6('0x42')][_0x2af6('0x76')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x77')];}else{_0x3c6725[_0x2af6('0x40')][_0x2af6('0x78')]=_0x3c6725['Smtp']['authentication']=![];}_0x3c6725[_0x2af6('0x40')][_0x2af6('0x79')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x40')][_0x2af6('0x79')];_0x3c6725['Imap'][_0x2af6('0x7a')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x40')][_0x2af6('0x7a')];_0x3c6725[_0x2af6('0x42')][_0x2af6('0x79')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x42')][_0x2af6('0x79')];_0x3c6725[_0x2af6('0x42')][_0x2af6('0x7a')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x42')][_0x2af6('0x7a')];}else{_0x3c6725[_0x2af6('0x40')][_0x2af6('0x7b')]=_0x3c6725[_0x2af6('0x42')][_0x2af6('0x7b')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x72')];_0x3c6725[_0x2af6('0x40')]['user']=_0x3c6725['Smtp'][_0x2af6('0x74')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x75')];_0x3c6725[_0x2af6('0x40')]['password']=_0x3c6725[_0x2af6('0x42')][_0x2af6('0x76')]=_0x2aedd0[_0x2af6('0x60')][_0x2af6('0x77')];}return db[_0x2af6('0x46')][_0x2af6('0x64')](_0x3c6725,{'include':[{'model':db[_0x2af6('0x41')],'as':_0x2af6('0x42')},{'model':db['MailServerIn'],'as':_0x2af6('0x40')}]})['then'](function(_0x139fda){var _0x40508b=_0x2aedd0[_0x2af6('0x74')]['get']({'plain':!![]});if(!_0x40508b)throw new Error(_0x2af6('0x7c'));if(_0x40508b['role']===_0x2af6('0x74')){var _0x1b809d=_0x139fda[_0x2af6('0x39')]({'plain':!![]});return db[_0x2af6('0x7d')][_0x2af6('0x5f')]({'where':{'name':_0x2af6('0x3a'),'userProfileId':_0x40508b[_0x2af6('0x7e')]},'raw':!![]})[_0x2af6('0x37')](function(_0x44a9a0){if(_0x44a9a0&&_0x44a9a0[_0x2af6('0x7f')]===0x0){return db[_0x2af6('0x3b')][_0x2af6('0x64')]({'name':_0x1b809d[_0x2af6('0x3d')],'resourceId':_0x1b809d['id'],'type':_0x44a9a0[_0x2af6('0x3d')],'sectionId':_0x44a9a0['id']},{})[_0x2af6('0x37')](function(){return _0x139fda;});}else{return _0x139fda;}})['catch'](function(_0x37da2a){logger[_0x2af6('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37da2a);throw _0x37da2a;});}return _0x139fda;})['then'](respondWithResult(_0x137da2,0xc9))[_0x2af6('0x2b')](handleError(_0x137da2,null));};exports['getImap']=function(_0x50c156,_0x21e280,_0x421913){return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x50c156[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x21e280,null))[_0x2af6('0x37')](function(_0x13f756){if(_0x13f756){return _0x13f756[_0x2af6('0x80')]();}return null;})['then'](respondWithResult(_0x21e280,null))[_0x2af6('0x2b')](handleError(_0x21e280,null));};exports['addImap']=function(_0x2ff7e6,_0x2796ae,_0x4564e6){if(_0x2ff7e6[_0x2af6('0x60')]['id']){delete _0x2ff7e6[_0x2af6('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2ff7e6[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2796ae,null))['then'](function(_0x26551f){if(_0x26551f){_0x2ff7e6['body'][_0x2af6('0x62')]=_0x26551f['id'];return db['MailServerIn'][_0x2af6('0x64')](_0x2ff7e6[_0x2af6('0x60')]);}})[_0x2af6('0x37')](respondWithResult(_0x2796ae,null))[_0x2af6('0x2b')](handleError(_0x2796ae,null));};exports[_0x2af6('0x81')]=function(_0x1bd585,_0x57d0b0,_0x4c0cb6){return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x1bd585[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57d0b0,null))[_0x2af6('0x37')](function(_0x18be1c){if(_0x18be1c){return _0x18be1c[_0x2af6('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x57d0b0,null))[_0x2af6('0x2b')](handleError(_0x57d0b0,null));};exports[_0x2af6('0x83')]=function(_0x29d49,_0x129b55,_0x171b52){return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x29d49[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x129b55,null))[_0x2af6('0x37')](function(_0x82302a){if(_0x82302a){return _0x82302a[_0x2af6('0x83')]();}return null;})[_0x2af6('0x37')](respondWithResult(_0x129b55,null))[_0x2af6('0x2b')](handleError(_0x129b55,null));};exports[_0x2af6('0x84')]=function(_0x39f8f7,_0x4b11da,_0x1c394f){if(_0x39f8f7[_0x2af6('0x60')]['id']){delete _0x39f8f7['body']['id'];}return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x39f8f7[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x4b11da,null))[_0x2af6('0x37')](function(_0x3aa9c2){if(_0x3aa9c2){_0x39f8f7['body'][_0x2af6('0x62')]=_0x3aa9c2['id'];return db[_0x2af6('0x41')]['create'](_0x39f8f7[_0x2af6('0x60')]);}})['then'](respondWithResult(_0x4b11da,null))[_0x2af6('0x2b')](handleError(_0x4b11da,null));};exports[_0x2af6('0x85')]=function(_0x298b8e,_0x828081,_0x34941e){return db['MailAccount'][_0x2af6('0x66')]({'where':{'id':_0x298b8e[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x828081,null))[_0x2af6('0x37')](function(_0x46090f){if(_0x46090f){return _0x46090f[_0x2af6('0x86')](null);}return null;})[_0x2af6('0x37')](respondWithStatusCode(_0x828081,null))[_0x2af6('0x2b')](handleError(_0x828081,null));};exports[_0x2af6('0x87')]=function(_0x336b53,_0x4e68c6,_0x4fb021){return db[_0x2af6('0x88')][_0x2af6('0x5f')]({'where':{'id':_0x336b53[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e68c6,null))[_0x2af6('0x37')](function(_0x1b7a7c){if(_0x1b7a7c){return _0x1b7a7c[_0x2af6('0x87')](_0x336b53[_0x2af6('0x60')][_0x2af6('0x6a')],_[_0x2af6('0x89')](_0x336b53['body'],[_0x2af6('0x6a'),'id'])||{});}})[_0x2af6('0x37')](respondWithResult(_0x4e68c6,null))[_0x2af6('0x2b')](handleError(_0x4e68c6,null));};exports[_0x2af6('0x8a')]=function(_0x224586,_0x47b545,_0x5346e3){var _0x4a7232={'raw':![],'where':{}};var _0x5e8265={};var _0x381de6={'count':0x0,'rows':[]};return db[_0x2af6('0x46')]['findOne']({'where':{'id':_0x224586[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x47b545,null))[_0x2af6('0x37')](function(_0x49ae29){if(_0x49ae29){_0x5e8265[_0x2af6('0x4a')]=_[_0x2af6('0x4c')](db[_0x2af6('0x88')][_0x2af6('0x47')]);_0x5e8265['query']=_['keys'](_0x224586[_0x2af6('0x4b')]);_0x5e8265[_0x2af6('0x4d')]=_['intersection'](_0x5e8265[_0x2af6('0x4a')],_0x5e8265['query']);_0x4a7232[_0x2af6('0x4f')]=_[_0x2af6('0x4e')](_0x5e8265[_0x2af6('0x4a')],qs['fields'](_0x224586[_0x2af6('0x4b')][_0x2af6('0x5d')]));_0x4a7232[_0x2af6('0x4f')]=_0x4a7232[_0x2af6('0x4f')][_0x2af6('0x50')]?_0x4a7232[_0x2af6('0x4f')]:_0x5e8265[_0x2af6('0x4a')];if(!_0x224586[_0x2af6('0x4b')]['hasOwnProperty'](_0x2af6('0x52'))){_0x4a7232[_0x2af6('0x53')]=qs[_0x2af6('0x53')](_0x224586[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x4a7232[_0x2af6('0x2f')]=qs['offset'](_0x224586[_0x2af6('0x4b')][_0x2af6('0x2f')]);}_0x4a7232[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x224586[_0x2af6('0x4b')][_0x2af6('0x55')]);_0x4a7232[_0x2af6('0x57')]=qs[_0x2af6('0x4d')](_[_0x2af6('0x56')](_0x224586['query'],_0x5e8265[_0x2af6('0x4d')]));_0x4a7232[_0x2af6('0x57')][_0x2af6('0x62')]=_0x49ae29['id'];if(_0x224586[_0x2af6('0x4b')][_0x2af6('0x67')]){_0x4a7232[_0x2af6('0x57')]=_['merge'](_0x4a7232[_0x2af6('0x57')],{'$or':_[_0x2af6('0x45')](_0x4a7232[_0x2af6('0x4f')],function(_0x40024a){var _0x462966={};_0x462966[_0x40024a]={'$like':'%'+_0x224586[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x462966;})});}_0x4a7232=_[_0x2af6('0x58')]({},_0x4a7232,_0x224586[_0x2af6('0x59')]);return db['MailInteraction'][_0x2af6('0x31')]({'where':_0x4a7232[_0x2af6('0x57')]})[_0x2af6('0x37')](function(_0x16addf){_0x381de6[_0x2af6('0x31')]=_0x16addf;if(_0x224586[_0x2af6('0x4b')]['includeAll']){_0x4a7232[_0x2af6('0x5a')]=[{'model':db[_0x2af6('0x8b')],'as':_0x2af6('0x8c'),'required':![]},{'model':db[_0x2af6('0x8d')],'as':_0x2af6('0x8e'),'attributes':[_0x2af6('0x3d'),_0x2af6('0x8f'),_0x2af6('0x90')],'required':![]},{'model':db[_0x2af6('0x91')],'as':_0x2af6('0x92'),'attributes':['id',_0x2af6('0x3d'),_0x2af6('0x93')],'where':_0x224586[_0x2af6('0x4b')][_0x2af6('0x94')]?{'id':_0x224586[_0x2af6('0x4b')][_0x2af6('0x94')]}:undefined,'required':_0x224586[_0x2af6('0x4b')][_0x2af6('0x94')]?!![]:![]}];}return db['MailInteraction'][_0x2af6('0x68')](_0x4a7232);})['then'](function(_0xd5e98c){_0x381de6[_0x2af6('0x5b')]=_0xd5e98c;return _0x381de6;});}})['then'](respondWithFilteredResult(_0x47b545,_0x4a7232))[_0x2af6('0x2b')](handleError(_0x47b545,null));};exports['addApplications']=function(_0x54db4c,_0x3744aa,_0x5d1872){return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x54db4c['params']['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x3744aa,null))[_0x2af6('0x37')](function(_0x1ff349){if(_0x1ff349){return db[_0x2af6('0x95')][_0x2af6('0x96')](function(_0x1a1174){return db['MailApplication'][_0x2af6('0x38')]({'where':{'MailAccountId':_0x54db4c[_0x2af6('0x5c')]['id']},'transaction':_0x1a1174})[_0x2af6('0x37')](function(_0x219df4){var _0x4cbe56=_['map'](_0x54db4c[_0x2af6('0x60')],function(_0x49ae2c){_0x49ae2c[_0x2af6('0x62')]=_0x54db4c[_0x2af6('0x5c')]['id'];return _0x49ae2c;});return db['MailApplication'][_0x2af6('0x97')](_0x4cbe56,{'transaction':_0x1a1174});});})[_0x2af6('0x37')](function(){return db[_0x2af6('0x98')][_0x2af6('0x99')]({'where':{'MailAccountId':_0x54db4c[_0x2af6('0x5c')]['id']},'order':_0x2af6('0x9a')});});}})[_0x2af6('0x37')](respondWithResult(_0x3744aa,null))[_0x2af6('0x2b')](handleError(_0x3744aa,null));};exports['getApplications']=function(_0x1403b3,_0x464ab0,_0x593940){var _0x368d8d={};var _0x530312={};var _0x5c6e9f;var _0x271c03;return db[_0x2af6('0x46')][_0x2af6('0x66')]({'where':{'id':_0x1403b3[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x464ab0,null))['then'](function(_0x2c90c2){if(_0x2c90c2){_0x5c6e9f=_0x2c90c2;_0x530312[_0x2af6('0x4a')]=_[_0x2af6('0x4c')](db[_0x2af6('0x98')][_0x2af6('0x47')]);_0x530312[_0x2af6('0x4b')]=_[_0x2af6('0x4c')](_0x1403b3[_0x2af6('0x4b')]);_0x530312[_0x2af6('0x4d')]=_[_0x2af6('0x4e')](_0x530312[_0x2af6('0x4a')],_0x530312['query']);_0x368d8d[_0x2af6('0x4f')]=_[_0x2af6('0x4e')](_0x530312['model'],qs[_0x2af6('0x5d')](_0x1403b3[_0x2af6('0x4b')][_0x2af6('0x5d')]));_0x368d8d[_0x2af6('0x4f')]=_0x368d8d['attributes']['length']?_0x368d8d[_0x2af6('0x4f')]:_0x530312['model'];_0x368d8d[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x1403b3['query'][_0x2af6('0x55')]);_0x368d8d['where']=qs['filters'](_['pick'](_0x1403b3[_0x2af6('0x4b')],_0x530312[_0x2af6('0x4d')]));if(_0x1403b3[_0x2af6('0x4b')]['filter']){_0x368d8d[_0x2af6('0x57')]=_[_0x2af6('0x58')](_0x368d8d['where'],{'$or':_[_0x2af6('0x45')](_0x368d8d[_0x2af6('0x4f')],function(_0x407440){var _0x57a4c6={};_0x57a4c6[_0x407440]={'$like':'%'+_0x1403b3[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x57a4c6;})});}_0x368d8d=_[_0x2af6('0x58')]({},_0x368d8d,_0x1403b3[_0x2af6('0x59')]);return _0x5c6e9f[_0x2af6('0x9b')](_0x368d8d);}})[_0x2af6('0x37')](function(_0x8ca0ec){if(_0x8ca0ec){_0x271c03=_0x8ca0ec['length'];if(!_0x1403b3[_0x2af6('0x4b')]['hasOwnProperty'](_0x2af6('0x52'))){_0x368d8d['limit']=qs['limit'](_0x1403b3[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x368d8d[_0x2af6('0x2f')]=qs['offset'](_0x1403b3['query'][_0x2af6('0x2f')]);}return _0x5c6e9f[_0x2af6('0x9b')](_0x368d8d);}})[_0x2af6('0x37')](function(_0x354260){if(_0x354260){return _0x354260?{'count':_0x271c03,'rows':_0x354260}:null;}})[_0x2af6('0x37')](respondWithResult(_0x464ab0,null))[_0x2af6('0x2b')](handleError(_0x464ab0,null));};exports['getMessages']=function(_0x216dd7,_0x52b9fe,_0x2b619c){var _0x27e6c2={'raw':!![],'where':{}};var _0x24c3e3={};var _0x205a02={'count':0x0,'rows':[]};return db[_0x2af6('0x46')]['findOne']({'where':{'id':_0x216dd7[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x52b9fe,null))['then'](function(_0x431cb1){if(_0x431cb1){_0x24c3e3[_0x2af6('0x4a')]=_[_0x2af6('0x4c')](db[_0x2af6('0x9c')][_0x2af6('0x47')]);_0x24c3e3[_0x2af6('0x4b')]=_[_0x2af6('0x4c')](_0x216dd7[_0x2af6('0x4b')]);_0x24c3e3['filters']=_[_0x2af6('0x4e')](_0x24c3e3['model'],_0x24c3e3['query']);_0x27e6c2[_0x2af6('0x4f')]=_[_0x2af6('0x4e')](_0x24c3e3[_0x2af6('0x4a')],qs['fields'](_0x216dd7['query'][_0x2af6('0x5d')]));_0x27e6c2[_0x2af6('0x4f')]=_0x27e6c2[_0x2af6('0x4f')][_0x2af6('0x50')]?_0x27e6c2[_0x2af6('0x4f')]:_0x24c3e3[_0x2af6('0x4a')];if(!_0x216dd7['query'][_0x2af6('0x51')](_0x2af6('0x52'))){_0x27e6c2['limit']=qs[_0x2af6('0x53')](_0x216dd7[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x27e6c2[_0x2af6('0x2f')]=qs[_0x2af6('0x2f')](_0x216dd7[_0x2af6('0x4b')][_0x2af6('0x2f')]);}_0x27e6c2[_0x2af6('0x54')]=qs[_0x2af6('0x55')](_0x216dd7['query'][_0x2af6('0x55')]);_0x27e6c2['where']=qs[_0x2af6('0x4d')](_[_0x2af6('0x56')](_0x216dd7[_0x2af6('0x4b')],_0x24c3e3[_0x2af6('0x4d')]));_0x27e6c2[_0x2af6('0x57')][_0x2af6('0x62')]=_0x431cb1['id'];if(_0x216dd7[_0x2af6('0x4b')]['filter']){_0x27e6c2['where']=_[_0x2af6('0x58')](_0x27e6c2[_0x2af6('0x57')],{'$or':_[_0x2af6('0x45')](_0x27e6c2[_0x2af6('0x4f')],function(_0x2ac5d2){var _0x49d831={};_0x49d831[_0x2ac5d2]={'$like':'%'+_0x216dd7[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x49d831;})});}if(_0x216dd7[_0x2af6('0x4b')][_0x2af6('0x9d')]){var _0x195229=_0x216dd7[_0x2af6('0x4b')][_0x2af6('0x9d')][_0x2af6('0x9e')](',');var _0x524dac={};_0x524dac[_0x195229[0x0]]={'$gte':moment(_0x195229[0x1])[_0x2af6('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x27e6c2['where']=_[_0x2af6('0x58')](_0x27e6c2[_0x2af6('0x57')],_0x524dac);}_0x27e6c2=_['merge']({},_0x27e6c2,_0x216dd7['options']);return db['MailMessage'][_0x2af6('0x31')]({'where':_0x27e6c2['where']})['then'](function(_0x46a387){_0x205a02['count']=_0x46a387;if(_0x216dd7['query'][_0x2af6('0x5e')]){_0x27e6c2[_0x2af6('0x5a')]=[{'all':!![]}];}return db[_0x2af6('0x9c')][_0x2af6('0x68')](_0x27e6c2);})[_0x2af6('0x37')](function(_0x1b5df2){if(_0x216dd7[_0x2af6('0x4b')]['inlineCss']===_0x2af6('0xa0')){for(var _0x1bc2d7=0x0;_0x1bc2d7<_0x1b5df2[_0x2af6('0x50')];_0x1bc2d7++){_0x1b5df2[_0x1bc2d7][_0x2af6('0x60')]=juice(_0x1b5df2[_0x1bc2d7][_0x2af6('0x60')]);}}_0x205a02[_0x2af6('0x5b')]=_0x1b5df2;return _0x205a02;});}})[_0x2af6('0x37')](respondWithFilteredResult(_0x52b9fe,_0x27e6c2))[_0x2af6('0x2b')](handleError(_0x52b9fe,null));};exports['send']=function(_0x59de4a,_0x1cd5b2,_0x52079a){var _0x1aca9d,_0x270355={},_0x4aee9e;if(_0x59de4a[_0x2af6('0x60')]['to']){_0x4aee9e=_0x59de4a[_0x2af6('0x60')]['to'][_0x2af6('0x9e')](',')[0x0];}return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x59de4a[_0x2af6('0x5c')]['id']},'include':[{'model':db[_0x2af6('0xa1')],'as':'List','include':[{'model':db[_0x2af6('0x8b')],'as':'Contacts','where':{'email':_0x4aee9e},'limit':0x1,'order':[[_0x2af6('0xa2'),_0x2af6('0xa3')]]}]},{'model':db[_0x2af6('0x41')],'as':_0x2af6('0x42'),'raw':!![]}]})[_0x2af6('0x37')](handleEntityNotFound(_0x1cd5b2,null))[_0x2af6('0x37')](function(_0x49fd82){if(_0x49fd82){_0x1aca9d=_0x49fd82;if(_0x49fd82[_0x2af6('0x42')]){if(_[_0x2af6('0x71')](_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa4')])){_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa4')]=util[_0x2af6('0x9f')](_0x2af6('0xa5'),_0x49fd82[_0x2af6('0x3d')],_0x49fd82[_0x2af6('0x6f')]||_0x49fd82[_0x2af6('0x42')][_0x2af6('0x74')]);}if(_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa6')]&&_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa6')]['length']){for(var _0x402ee0=0x0;_0x402ee0<_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa6')][_0x2af6('0x50')];_0x402ee0+=0x1){_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa6')][_0x402ee0]={'filename':_0x59de4a[_0x2af6('0x60')][_0x2af6('0xa6')][_0x402ee0][_0x2af6('0x3d')],'path':path[_0x2af6('0xa7')](config['root'],'server/files/attachments',_0x59de4a[_0x2af6('0x60')]['attachments'][_0x402ee0][_0x2af6('0xa8')])};}}var _0x2c05aa={'tls':{'rejectUnauthorized':![]}};if(_[_0x2af6('0x71')](_0x49fd82['Smtp'][_0x2af6('0x7b')])){if(_0x49fd82[_0x2af6('0x42')][_0x2af6('0x78')]){_0x2c05aa[_0x2af6('0xa9')]={'user':_0x49fd82[_0x2af6('0x42')]['user'],'pass':_0x49fd82['Smtp']['pass']};}_0x2c05aa[_0x2af6('0x79')]=_0x49fd82[_0x2af6('0x42')][_0x2af6('0x79')];_0x2c05aa[_0x2af6('0x7a')]=_0x49fd82[_0x2af6('0x42')][_0x2af6('0x7a')];_0x2c05aa['secure']=_0x49fd82[_0x2af6('0x42')][_0x2af6('0xaa')];}else{_0x2c05aa[_0x2af6('0x7b')]=_0x49fd82[_0x2af6('0x42')][_0x2af6('0x7b')];_0x2c05aa['auth']={'user':_0x49fd82[_0x2af6('0x42')][_0x2af6('0x74')],'pass':_0x49fd82[_0x2af6('0x42')][_0x2af6('0x76')]};}return respondWithRpcPromise('SendMail',_0x2af6('0xab'),{'account':_0x2c05aa,'message':_0x59de4a['body']});}else{throw new Error(_0x2af6('0xac'));}}})[_0x2af6('0x37')](function(_0x1db4ce){if(_0x1db4ce){_0x270355=_0x1db4ce;if(_0x1aca9d[_0x2af6('0xad')]){if(_0x1aca9d[_0x2af6('0xad')][_0x2af6('0xae')][_0x2af6('0x50')]){return _0x1aca9d[_0x2af6('0xad')][_0x2af6('0xae')][0x0];}else{return db[_0x2af6('0x8b')][_0x2af6('0x64')](_[_0x2af6('0x1a')](_0x59de4a[_0x2af6('0x60')],{'firstName':_0x59de4a[_0x2af6('0x60')]['to'],'email':_0x59de4a['body']['to'],'phone':_0x59de4a[_0x2af6('0x60')]['to'],'ListId':_0x1aca9d[_0x2af6('0xaf')]}));}}else{throw new Error(_0x2af6('0xac'));}}})[_0x2af6('0x37')](function(_0x3870b1){if(_0x3870b1){var _0x4ac815={'UserId':_0x59de4a[_0x2af6('0x74')]['id'],'ContactId':_0x3870b1['id'],'MailAccountId':_0x1aca9d['id'],'inReplyTo':_0x270355[_0x2af6('0xb0')],'to':_0x59de4a['body'][_0x2af6('0xa4')],'cc':_0x59de4a[_0x2af6('0x60')]['cc'],'subject':_0x59de4a[_0x2af6('0x60')][_0x2af6('0xb1')],'attach':_0x59de4a['body']['attach'],'firstMsgDirection':_0x2af6('0xb2'),'lastMsgAt':moment()[_0x2af6('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x2af6('0x58')](_0x59de4a['body'],{'messageId':_0x270355[_0x2af6('0xb0')],'sentAt':moment()[_0x2af6('0x9f')](_0x2af6('0xb3')),'read':!![],'MailAccountId':_0x1aca9d['id'],'UserId':_0x59de4a[_0x2af6('0x74')]['id'],'ContactId':_0x3870b1['id']})]};if(_0x59de4a[_0x2af6('0x60')][_0x2af6('0xb4')]){_0x4ac815=_['merge'](_0x4ac815,_0x59de4a[_0x2af6('0x60')][_0x2af6('0xb4')]);}return db['MailInteraction'][_0x2af6('0x64')](_0x4ac815,{'include':[{'model':db[_0x2af6('0x9c')],'as':_0x2af6('0xb5')}]});}})[_0x2af6('0x37')](respondWithResult(_0x1cd5b2,null))[_0x2af6('0x2b')](handleError(_0x1cd5b2,null));};exports[_0x2af6('0xb6')]=function(_0x3a4449,_0x54ce45,_0x497e0d){return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0x3a4449[_0x2af6('0x5c')]['id']},'include':[{'model':db[_0x2af6('0x41')],'as':_0x2af6('0x42'),'raw':!![]}]})[_0x2af6('0x37')](handleEntityNotFound(_0x54ce45,null))[_0x2af6('0x37')](function(_0x4ffb0c){if(_0x4ffb0c&&_0x4ffb0c['Smtp']){var _0x24ef1f={'id':_0x4ffb0c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4ffb0c[_0x2af6('0x42')][_0x2af6('0x7b')]){_0x24ef1f[_0x2af6('0x7b')]=_0x4ffb0c[_0x2af6('0x42')][_0x2af6('0x7b')];}else{_0x24ef1f[_0x2af6('0x79')]=_0x4ffb0c[_0x2af6('0x42')]['host'];_0x24ef1f[_0x2af6('0x7a')]=_0x4ffb0c[_0x2af6('0x42')][_0x2af6('0x7a')];_0x24ef1f[_0x2af6('0xaa')]=_0x4ffb0c[_0x2af6('0x42')]['secure'];}if(_0x4ffb0c[_0x2af6('0x42')][_0x2af6('0x78')]){_0x24ef1f[_0x2af6('0xa9')]={'user':_0x4ffb0c[_0x2af6('0x42')]['user'],'pass':_0x4ffb0c[_0x2af6('0x42')][_0x2af6('0x76')]};}return respondWithRpcPromise(_0x2af6('0xb7'),_0x2af6('0xb6'),{'account':_0x24ef1f});}})[_0x2af6('0x37')](respondWithResult(_0x54ce45,null))[_0x2af6('0x2b')](handleError(_0x54ce45,null));};exports[_0x2af6('0x38')]=function(_0xe77ad6,_0x56942b){return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0xe77ad6[_0x2af6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x56942b,null))[_0x2af6('0x37')](function(_0x4f9f1e){if(_0x4f9f1e&&_0x4f9f1e[_0x2af6('0x7b')]){throw new db[(_0x2af6('0xb8'))][(_0x2af6('0xb9'))](_0x2af6('0xba'));}return _0x4f9f1e;})['then'](removeEntity(_0x56942b,null))[_0x2af6('0x2b')](handleError(_0x56942b,null));};exports[_0x2af6('0xbb')]=function(_0xbbb3a6,_0x31d429,_0x58c33b){return db[_0x2af6('0x46')][_0x2af6('0x5f')]({'where':{'id':_0xbbb3a6[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x31d429,null))[_0x2af6('0x37')](function(_0x11bb40){if(_0x11bb40){return _0x11bb40[_0x2af6('0xbb')](_0xbbb3a6[_0x2af6('0x60')][_0x2af6('0x6a')],_[_0x2af6('0x89')](_0xbbb3a6[_0x2af6('0x60')],['ids','id'])||{})[_0x2af6('0xbc')](function(_0x124295){for(var _0x59f2f5=0x0;_0x59f2f5<_0xbbb3a6[_0x2af6('0x60')][_0x2af6('0x6a')][_0x2af6('0x50')];_0x59f2f5+=0x1){socket[_0x2af6('0xbd')](_0x2af6('0xbe'),{'UserId':Number(_0xbbb3a6[_0x2af6('0x60')][_0x2af6('0x6a')][_0x59f2f5]),'MailAccountId':Number(_0xbbb3a6[_0x2af6('0x5c')]['id'])});}return _0x124295;});}})[_0x2af6('0x37')](respondWithResult(_0x31d429,null))['catch'](handleError(_0x31d429,null));};exports[_0x2af6('0xbf')]=function(_0x20a2c2,_0x5f3fec,_0xe7cb55){return db['MailAccount'][_0x2af6('0x5f')]({'where':{'id':_0x20a2c2['params']['id']}})['then'](handleEntityNotFound(_0x5f3fec,null))[_0x2af6('0x37')](function(_0x3ca58f){if(_0x3ca58f){return _0x3ca58f[_0x2af6('0xbf')](_0x20a2c2[_0x2af6('0x4b')][_0x2af6('0x6a')])[_0x2af6('0x37')](function(){if(_[_0x2af6('0xc0')](_0x20a2c2['query']['ids'])){for(var _0x5985c2=0x0;_0x5985c2<_0x20a2c2[_0x2af6('0x4b')]['ids'][_0x2af6('0x50')];_0x5985c2+=0x1){socket['emit'](_0x2af6('0xc1'),{'UserId':Number(_0x20a2c2['query'][_0x2af6('0x6a')][_0x5985c2]),'MailAccountId':Number(_0x20a2c2[_0x2af6('0x5c')]['id'])});}}else{socket[_0x2af6('0xbd')](_0x2af6('0xc1'),{'UserId':Number(_0x20a2c2[_0x2af6('0x4b')]['ids']),'MailAccountId':Number(_0x20a2c2['params']['id'])});}});}})[_0x2af6('0x37')](respondWithStatusCode(_0x5f3fec,null))[_0x2af6('0x2b')](handleError(_0x5f3fec,null));};exports['getAgents']=function(_0x181604,_0x1f5b3f,_0x1676bb){var _0x38a1f6={};var _0x35d1c2={};var _0x30a59b;var _0x5c1e56;return db[_0x2af6('0x46')]['findOne']({'where':{'id':_0x181604[_0x2af6('0x5c')]['id']}})[_0x2af6('0x37')](handleEntityNotFound(_0x1f5b3f,null))[_0x2af6('0x37')](function(_0x1dfdce){if(_0x1dfdce){_0x30a59b=_0x1dfdce;_0x35d1c2[_0x2af6('0x4a')]=_[_0x2af6('0x4c')](db[_0x2af6('0x8d')][_0x2af6('0x47')]);_0x35d1c2[_0x2af6('0x4b')]=_['keys'](_0x181604[_0x2af6('0x4b')]);_0x35d1c2[_0x2af6('0x4d')]=_[_0x2af6('0x4e')](_0x35d1c2['model'],_0x35d1c2[_0x2af6('0x4b')]);_0x38a1f6['attributes']=_['intersection'](_0x35d1c2[_0x2af6('0x4a')],qs[_0x2af6('0x5d')](_0x181604[_0x2af6('0x4b')][_0x2af6('0x5d')]));_0x38a1f6[_0x2af6('0x4f')]=_0x38a1f6[_0x2af6('0x4f')][_0x2af6('0x50')]?_0x38a1f6[_0x2af6('0x4f')]:_0x35d1c2[_0x2af6('0x4a')];_0x38a1f6[_0x2af6('0x54')]=qs['sort'](_0x181604[_0x2af6('0x4b')][_0x2af6('0x55')]);_0x38a1f6[_0x2af6('0x57')]=qs[_0x2af6('0x4d')](_[_0x2af6('0x56')](_0x181604[_0x2af6('0x4b')],_0x35d1c2[_0x2af6('0x4d')]));if(_0x181604[_0x2af6('0x4b')][_0x2af6('0x67')]){_0x38a1f6[_0x2af6('0x57')]=_[_0x2af6('0x58')](_0x38a1f6['where'],{'$or':_[_0x2af6('0x45')](_0x38a1f6[_0x2af6('0x4f')],function(_0x5c9579){var _0x3e4c82={};_0x3e4c82[_0x5c9579]={'$like':'%'+_0x181604[_0x2af6('0x4b')][_0x2af6('0x67')]+'%'};return _0x3e4c82;})});}_0x38a1f6=_[_0x2af6('0x58')]({},_0x38a1f6,_0x181604[_0x2af6('0x59')]);return _0x30a59b[_0x2af6('0xc2')](_0x38a1f6);}})[_0x2af6('0x37')](function(_0x1123fe){if(_0x1123fe){_0x5c1e56=_0x1123fe[_0x2af6('0x50')];if(!_0x181604[_0x2af6('0x4b')][_0x2af6('0x51')](_0x2af6('0x52'))){_0x38a1f6['limit']=qs[_0x2af6('0x53')](_0x181604[_0x2af6('0x4b')][_0x2af6('0x53')]);_0x38a1f6['offset']=qs[_0x2af6('0x2f')](_0x181604['query'][_0x2af6('0x2f')]);}return _0x30a59b[_0x2af6('0xc2')](_0x38a1f6);}})[_0x2af6('0x37')](function(_0x5088d9){if(_0x5088d9){return _0x5088d9?{'count':_0x5c1e56,'rows':_0x5088d9}:null;}})[_0x2af6('0x37')](respondWithResult(_0x1f5b3f,null))['catch'](handleError(_0x1f5b3f,null));}; \ No newline at end of file +var _0xf466=['jayson/promise','client','http','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','get','MailAccounts','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','describe','addDisposition','Disposition','create','findOne','MailAccountId','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','isNil','active','description','cservice','cauthentication','user','password','cpassword','authentication','host','port','service','pass','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','omit','CmContact','Owner','fullname','internal','Tags','color','tag','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','ListId','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','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','socket.io-emitter','./mailAccount.socket','register'];(function(_0x1ccec2,_0x3ae6de){var _0x557d89=function(_0x326fe1){while(--_0x326fe1){_0x1ccec2['push'](_0x1ccec2['shift']());}};_0x557d89(++_0x3ae6de);}(_0xf466,0xa4));var _0x6f46=function(_0x5b987d,_0x24a344){_0x5b987d=_0x5b987d-0x0;var _0x282e0d=_0xf466[_0x5b987d];return _0x282e0d;};'use strict';var emlformat=require(_0x6f46('0x0'));var rimraf=require(_0x6f46('0x1'));var zipdir=require(_0x6f46('0x2'));var jsonpatch=require(_0x6f46('0x3'));var rp=require(_0x6f46('0x4'));var moment=require(_0x6f46('0x5'));var BPromise=require(_0x6f46('0x6'));var Mustache=require(_0x6f46('0x7'));var util=require(_0x6f46('0x8'));var path=require(_0x6f46('0x9'));var sox=require(_0x6f46('0xa'));var csv=require(_0x6f46('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f46('0xc'));var _=require(_0x6f46('0xd'));var squel=require(_0x6f46('0xe'));var crypto=require(_0x6f46('0xf'));var jsforce=require(_0x6f46('0x10'));var deskjs=require(_0x6f46('0x11'));var toCsv=require(_0x6f46('0xb'));var querystring=require(_0x6f46('0x12'));var Papa=require(_0x6f46('0x13'));var htmlToText=require(_0x6f46('0x14'));var juice=require('juice');var Redis=require(_0x6f46('0x15'));var authService=require(_0x6f46('0x16'));var qs=require(_0x6f46('0x17'));var as=require(_0x6f46('0x18'));var hardwareService=require(_0x6f46('0x19'));var logger=require(_0x6f46('0x1a'))('api');var utils=require(_0x6f46('0x1b'));var config=require(_0x6f46('0x1c'));var licenseUtil=require(_0x6f46('0x1d'));var db=require(_0x6f46('0x1e'))['db'];config[_0x6f46('0x1f')]=_[_0x6f46('0x20')](config[_0x6f46('0x1f')],{'host':_0x6f46('0x21'),'port':0x18eb});var socket=require(_0x6f46('0x22'))(new Redis(config[_0x6f46('0x1f')]));require(_0x6f46('0x23'))[_0x6f46('0x24')](socket);var jayson=require(_0x6f46('0x25'));var client=jayson[_0x6f46('0x26')][_0x6f46('0x27')]({'port':0x232b});function respondWithRpcPromise(_0x1a0b31,_0x23518c,_0x52c4a0,_0x5c3565){return new BPromise(function(_0x59a52a,_0x276256){var _0x4460d4=_0x5c3565||client;return _0x4460d4[_0x6f46('0x28')](_0x1a0b31,_0x52c4a0)['then'](function(_0x12795c){logger[_0x6f46('0x29')]('MailAccount,\x20%s,\x20%s',_0x23518c,_0x6f46('0x2a'));logger[_0x6f46('0x2b')](_0x6f46('0x2c'),_0x23518c,_0x6f46('0x2a'),JSON[_0x6f46('0x2d')](_0x12795c));if(_0x12795c[_0x6f46('0x2e')]){if(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x2f')]===0x1f4){logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);return _0x276256(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);}logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);return _0x59a52a(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);}else{logger['info'](_0x6f46('0x30'),_0x23518c,'request\x20sent');_0x59a52a(_0x12795c[_0x6f46('0x32')]['message']);}})['catch'](function(_0xf80b3e){logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0xf80b3e);_0x276256(_0xf80b3e);});});}function respondWithStatusCode(_0x5a89fa,_0x4eed2d){_0x4eed2d=_0x4eed2d||0xcc;return function(_0x3f5d27){if(_0x3f5d27){return _0x5a89fa[_0x6f46('0x33')](_0x4eed2d);}return _0x5a89fa['status'](_0x4eed2d)[_0x6f46('0x34')]();};}function respondWithResult(_0x2c100c,_0x382cb2){_0x382cb2=_0x382cb2||0xc8;return function(_0x536abc){if(_0x536abc){return _0x2c100c['status'](_0x382cb2)[_0x6f46('0x35')](_0x536abc);}};}function respondWithFilteredResult(_0x139bcd,_0x200bd4){return function(_0x17051e){if(_0x17051e){var _0x258060=typeof _0x200bd4[_0x6f46('0x36')]===_0x6f46('0x37')&&typeof _0x200bd4[_0x6f46('0x38')]===_0x6f46('0x37');var _0x38a9c5=_0x17051e[_0x6f46('0x39')];var _0x337d22=_0x258060?0x0:_0x200bd4[_0x6f46('0x36')];var _0x34f781=_0x258060?_0x17051e[_0x6f46('0x39')]:_0x200bd4[_0x6f46('0x36')]+_0x200bd4[_0x6f46('0x38')];var _0x2021e5;if(_0x34f781>=_0x38a9c5){_0x34f781=_0x38a9c5;_0x2021e5=0xc8;}else{_0x2021e5=0xce;}_0x139bcd[_0x6f46('0x3a')](_0x2021e5);return _0x139bcd[_0x6f46('0x3b')](_0x6f46('0x3c'),_0x337d22+'-'+_0x34f781+'/'+_0x38a9c5)['json'](_0x17051e);}return null;};}function patchUpdates(_0x55d478){return function(_0x277266){try{jsonpatch[_0x6f46('0x3d')](_0x277266,_0x55d478,!![]);}catch(_0x5f0965){return BPromise[_0x6f46('0x3e')](_0x5f0965);}return _0x277266[_0x6f46('0x3f')]();};}function saveUpdates(_0x3e798a,_0x562a48){return function(_0x22bc50){if(_0x22bc50){return _0x22bc50[_0x6f46('0x40')](_0x3e798a)['then'](function(_0x1c6cc6){return _0x1c6cc6;});}return null;};}function removeEntity(_0x32892b,_0x4ece81){return function(_0x52cb5d){if(_0x52cb5d){return _0x52cb5d[_0x6f46('0x41')]()[_0x6f46('0x42')](function(){var _0x2cbef1=_0x52cb5d[_0x6f46('0x43')]({'plain':!![]});var _0x50207d=_0x6f46('0x44');return db['UserProfileResource'][_0x6f46('0x41')]({'where':{'type':_0x50207d,'resourceId':_0x2cbef1['id']}})[_0x6f46('0x42')](function(){return _0x52cb5d;});})[_0x6f46('0x42')](function(){_0x32892b[_0x6f46('0x3a')](0xcc)[_0x6f46('0x34')]();});}};}function handleEntityNotFound(_0x267ad7,_0x3898e0){return function(_0x2058d6){if(!_0x2058d6){_0x267ad7[_0x6f46('0x33')](0x194);}return _0x2058d6;};}function handleError(_0x57120c,_0x1ae749){_0x1ae749=_0x1ae749||0x1f4;return function(_0xeeb99c){logger['error'](_0xeeb99c['stack']);if(_0xeeb99c[_0x6f46('0x45')]){delete _0xeeb99c[_0x6f46('0x45')];}_0x57120c['status'](_0x1ae749)[_0x6f46('0x46')](_0xeeb99c);};}exports[_0x6f46('0x47')]=function(_0x42c314,_0x1b6a1a){var _0x2c67ed={'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x4c')],'as':_0x6f46('0x4d')}]},_0x3fe614={},_0x5e98b2={'count':0x0,'rows':[]};var _0x33c167=_[_0x6f46('0x4e')](db[_0x6f46('0x4f')]['rawAttributes'],function(_0x6e190a){return{'name':_0x6e190a[_0x6f46('0x50')],'type':_0x6e190a['type'][_0x6f46('0x51')]};});_0x3fe614[_0x6f46('0x52')]=_[_0x6f46('0x4e')](_0x33c167,_0x6f46('0x45'));_0x3fe614[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x42c314[_0x6f46('0x53')]);_0x3fe614[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x3fe614[_0x6f46('0x52')],_0x3fe614[_0x6f46('0x53')]);_0x2c67ed[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x3fe614['model'],qs[_0x6f46('0x58')](_0x42c314[_0x6f46('0x53')]['fields']));_0x2c67ed[_0x6f46('0x57')]=_0x2c67ed['attributes'][_0x6f46('0x59')]?_0x2c67ed[_0x6f46('0x57')]:_0x3fe614['model'];if(!_0x42c314[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x2c67ed['limit']=qs[_0x6f46('0x38')](_0x42c314[_0x6f46('0x53')][_0x6f46('0x38')]);_0x2c67ed[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x42c314[_0x6f46('0x53')]['offset']);}_0x2c67ed[_0x6f46('0x5c')]=qs[_0x6f46('0x5d')](_0x42c314[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x2c67ed['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x42c314[_0x6f46('0x53')],_0x3fe614[_0x6f46('0x55')]),_0x33c167);if(_0x42c314[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x2c67ed[_0x6f46('0x60')]=_['merge'](_0x2c67ed['where'],{'$or':_[_0x6f46('0x4e')](_0x33c167,function(_0x58f7b3){if(_0x58f7b3['type']!==_0x6f46('0x61')){var _0x3cec3a={};_0x3cec3a[_0x58f7b3[_0x6f46('0x45')]]={'$like':'%'+_0x42c314[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x3cec3a;}})});}_0x2c67ed=_[_0x6f46('0x62')]({},_0x2c67ed,_0x42c314[_0x6f46('0x63')]);var _0x2df8d8={'where':_0x2c67ed['where']};return db['MailAccount'][_0x6f46('0x39')](_0x2df8d8)[_0x6f46('0x42')](function(_0x45b441){_0x5e98b2['count']=_0x45b441;if(_0x42c314[_0x6f46('0x53')][_0x6f46('0x64')]){_0x2c67ed[_0x6f46('0x65')]=[{'all':!![]}];}return db['MailAccount'][_0x6f46('0x66')](_0x2c67ed);})[_0x6f46('0x42')](function(_0x3f1bad){_0x5e98b2[_0x6f46('0x67')]=_0x3f1bad;return _0x5e98b2;})[_0x6f46('0x42')](respondWithFilteredResult(_0x1b6a1a,_0x2c67ed))[_0x6f46('0x68')](handleError(_0x1b6a1a,null));};exports['show']=function(_0x5a8871,_0xeec41e){var _0x1c26ff={'raw':![],'where':{'id':_0x5a8871[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x6f46('0x4d')}]},_0x3abc5a={};_0x3abc5a['model']=_[_0x6f46('0x54')](db['MailAccount'][_0x6f46('0x6a')]);_0x3abc5a[_0x6f46('0x53')]=_['keys'](_0x5a8871[_0x6f46('0x53')]);_0x3abc5a['filters']=_['intersection'](_0x3abc5a['model'],_0x3abc5a[_0x6f46('0x53')]);_0x1c26ff[_0x6f46('0x57')]=_['intersection'](_0x3abc5a[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x5a8871[_0x6f46('0x53')]['fields']));_0x1c26ff['attributes']=_0x1c26ff[_0x6f46('0x57')][_0x6f46('0x59')]?_0x1c26ff[_0x6f46('0x57')]:_0x3abc5a[_0x6f46('0x52')];if(_0x5a8871[_0x6f46('0x53')][_0x6f46('0x64')]){_0x1c26ff[_0x6f46('0x65')]=[{'all':!![]}];}_0x1c26ff=_[_0x6f46('0x62')]({},_0x1c26ff,_0x5a8871[_0x6f46('0x63')]);return db[_0x6f46('0x4f')][_0x6f46('0x6b')](_0x1c26ff)['then'](handleEntityNotFound(_0xeec41e,null))['then'](respondWithResult(_0xeec41e,null))[_0x6f46('0x68')](handleError(_0xeec41e,null));};exports[_0x6f46('0x40')]=function(_0x5df00b,_0x187f09){if(_0x5df00b[_0x6f46('0x6c')]['id']){delete _0x5df00b[_0x6f46('0x6c')]['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x5df00b[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x4c')],'as':_0x6f46('0x4d')}]})[_0x6f46('0x42')](handleEntityNotFound(_0x187f09,null))[_0x6f46('0x42')](saveUpdates(_0x5df00b[_0x6f46('0x6c')],null))[_0x6f46('0x42')](function(_0x53193f){if(_0x53193f&&_0x5df00b[_0x6f46('0x6c')][_0x6f46('0x49')]){return db[_0x6f46('0x48')][_0x6f46('0x40')](_0x5df00b['body'][_0x6f46('0x49')],{'where':{'MailAccountId':_0x53193f['id']}})[_0x6f46('0x42')](function(){return _0x53193f;});}return _0x53193f;})[_0x6f46('0x42')](function(_0x2bdf30){if(_0x2bdf30&&_0x5df00b[_0x6f46('0x6c')][_0x6f46('0x4b')]){return db[_0x6f46('0x4a')][_0x6f46('0x40')](_0x5df00b['body'][_0x6f46('0x4b')],{'where':{'MailAccountId':_0x2bdf30['id']}})['then'](function(){return _0x2bdf30;});}return _0x2bdf30;})[_0x6f46('0x42')](respondWithResult(_0x187f09,null))[_0x6f46('0x68')](handleError(_0x187f09,null));};exports[_0x6f46('0x6d')]=function(_0x16576c,_0xd523c1){return db[_0x6f46('0x4f')]['describe']()[_0x6f46('0x42')](respondWithResult(_0xd523c1,null))['catch'](handleError(_0xd523c1,null));};exports[_0x6f46('0x6e')]=function(_0x58dff6,_0x27ebfd,_0x2ec588){if(_0x58dff6['body']['id']){delete _0x58dff6[_0x6f46('0x6c')]['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x58dff6['params']['id']}})['then'](handleEntityNotFound(_0x27ebfd,null))[_0x6f46('0x42')](function(_0x3600e5){if(_0x3600e5){_0x58dff6[_0x6f46('0x6c')]['MailAccountId']=_0x3600e5['id'];return db[_0x6f46('0x6f')][_0x6f46('0x70')](_0x58dff6[_0x6f46('0x6c')]);}})[_0x6f46('0x42')](respondWithResult(_0x27ebfd,null))['catch'](handleError(_0x27ebfd,null));};exports['getDispositions']=function(_0x423ad3,_0x3ce19e,_0x1bd1c2){var _0x477400={'raw':![],'where':{}};var _0x4b2379={};var _0x18dc3b={'count':0x0,'rows':[]};return db['MailAccount'][_0x6f46('0x71')]({'where':{'id':_0x423ad3[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x3ce19e,null))[_0x6f46('0x42')](function(_0x175ba7){if(_0x175ba7){_0x4b2379[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0x6f')][_0x6f46('0x6a')]);_0x4b2379['query']=_[_0x6f46('0x54')](_0x423ad3[_0x6f46('0x53')]);_0x4b2379[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x4b2379[_0x6f46('0x52')],_0x4b2379['query']);_0x477400[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x4b2379[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x423ad3[_0x6f46('0x53')][_0x6f46('0x58')]));_0x477400[_0x6f46('0x57')]=_0x477400[_0x6f46('0x57')][_0x6f46('0x59')]?_0x477400[_0x6f46('0x57')]:_0x4b2379['model'];if(!_0x423ad3[_0x6f46('0x53')]['hasOwnProperty']('nolimit')){_0x477400[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x423ad3[_0x6f46('0x53')][_0x6f46('0x38')]);_0x477400[_0x6f46('0x36')]=qs['offset'](_0x423ad3['query'][_0x6f46('0x36')]);}_0x477400[_0x6f46('0x5c')]=qs[_0x6f46('0x5d')](_0x423ad3[_0x6f46('0x53')]['sort']);_0x477400[_0x6f46('0x60')]=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x423ad3[_0x6f46('0x53')],_0x4b2379[_0x6f46('0x55')]));_0x477400[_0x6f46('0x60')][_0x6f46('0x72')]=_0x175ba7['id'];if(_0x423ad3['query'][_0x6f46('0x5f')]){_0x477400[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x477400[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x477400[_0x6f46('0x57')],function(_0x3e5e9a){var _0x48dd4a={};_0x48dd4a[_0x3e5e9a]={'$like':'%'+_0x423ad3[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x48dd4a;})});}_0x477400=_[_0x6f46('0x62')]({},_0x477400,_0x423ad3['options']);return db[_0x6f46('0x6f')][_0x6f46('0x39')]({'where':_0x477400[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x35f163){_0x18dc3b[_0x6f46('0x39')]=_0x35f163;if(_0x423ad3['query'][_0x6f46('0x64')]){_0x477400[_0x6f46('0x65')]=[{'all':!![]}];}return db[_0x6f46('0x6f')][_0x6f46('0x66')](_0x477400);})[_0x6f46('0x42')](function(_0x12e03f){_0x18dc3b[_0x6f46('0x67')]=_0x12e03f;return _0x18dc3b;});}})[_0x6f46('0x42')](respondWithFilteredResult(_0x3ce19e,_0x477400))['catch'](handleError(_0x3ce19e,null));};exports['removeDispositions']=function(_0x4434e1,_0x489f94,_0x444b94){return db[_0x6f46('0x4f')]['find']({'where':{'id':_0x4434e1[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x489f94,null))['then'](function(_0x437277){if(_0x437277){return _0x437277['removeDispositions'](_0x4434e1[_0x6f46('0x53')]['ids']);}})[_0x6f46('0x42')](respondWithStatusCode(_0x489f94,null))[_0x6f46('0x68')](handleError(_0x489f94,null));};exports[_0x6f46('0x73')]=function(_0x45e1b2,_0x45e035,_0x37c586){if(_0x45e1b2[_0x6f46('0x6c')]['id']){delete _0x45e1b2[_0x6f46('0x6c')]['id'];}return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x45e1b2['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x45e035,null))[_0x6f46('0x42')](function(_0x3fbeee){if(_0x3fbeee){_0x45e1b2[_0x6f46('0x6c')]['MailAccountId']=_0x3fbeee['id'];return db[_0x6f46('0x74')][_0x6f46('0x70')](_0x45e1b2[_0x6f46('0x6c')]);}})[_0x6f46('0x42')](respondWithResult(_0x45e035,null))[_0x6f46('0x68')](handleError(_0x45e035,null));};exports[_0x6f46('0x75')]=function(_0x41eb73,_0x4ba10a,_0x1767e6){var _0x31e1c8={'raw':![],'where':{}};var _0x3cd126={};var _0x4089ca={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x41eb73[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x4ba10a,null))[_0x6f46('0x42')](function(_0x41a5d9){if(_0x41a5d9){_0x3cd126[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0x74')][_0x6f46('0x6a')]);_0x3cd126[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x41eb73[_0x6f46('0x53')]);_0x3cd126['filters']=_[_0x6f46('0x56')](_0x3cd126['model'],_0x3cd126[_0x6f46('0x53')]);_0x31e1c8[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x3cd126[_0x6f46('0x52')],qs['fields'](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x58')]));_0x31e1c8[_0x6f46('0x57')]=_0x31e1c8[_0x6f46('0x57')]['length']?_0x31e1c8[_0x6f46('0x57')]:_0x3cd126['model'];if(!_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x31e1c8[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x41eb73['query'][_0x6f46('0x38')]);_0x31e1c8['offset']=qs[_0x6f46('0x36')](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x36')]);}_0x31e1c8[_0x6f46('0x5c')]=qs['sort'](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x31e1c8['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x41eb73['query'],_0x3cd126['filters']));_0x31e1c8[_0x6f46('0x60')][_0x6f46('0x72')]=_0x41a5d9['id'];if(_0x41eb73[_0x6f46('0x53')]['filter']){_0x31e1c8[_0x6f46('0x60')]=_['merge'](_0x31e1c8[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x31e1c8[_0x6f46('0x57')],function(_0xda86d){var _0x479089={};_0x479089[_0xda86d]={'$like':'%'+_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x479089;})});}_0x31e1c8=_[_0x6f46('0x62')]({},_0x31e1c8,_0x41eb73['options']);return db[_0x6f46('0x74')]['count']({'where':_0x31e1c8[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x565d77){_0x4089ca[_0x6f46('0x39')]=_0x565d77;if(_0x41eb73[_0x6f46('0x53')]['includeAll']){_0x31e1c8['include']=[{'all':!![]}];}return db[_0x6f46('0x74')][_0x6f46('0x66')](_0x31e1c8);})[_0x6f46('0x42')](function(_0x596a44){_0x4089ca['rows']=_0x596a44;return _0x4089ca;});}})['then'](respondWithFilteredResult(_0x4ba10a,_0x31e1c8))[_0x6f46('0x68')](handleError(_0x4ba10a,null));};exports[_0x6f46('0x76')]=function(_0x3725c7,_0x475a6e,_0x567bd4){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x3725c7[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x475a6e,null))['then'](function(_0x2a133b){if(_0x2a133b){return _0x2a133b[_0x6f46('0x76')](_0x3725c7['query'][_0x6f46('0x77')]);}})[_0x6f46('0x42')](respondWithStatusCode(_0x475a6e,null))[_0x6f46('0x68')](handleError(_0x475a6e,null));};exports[_0x6f46('0x70')]=function(_0x4f7e17,_0xe72239){var _0x14c80f={'name':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x45')],'key':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x51')],'email':_0x4f7e17['body'][_0x6f46('0x78')],'ListId':_0x4f7e17['body']['ListId'],'active':!_[_0x6f46('0x79')](_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7a')])?_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7a')]:!![],'description':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7b')]||null,'Imap':{},'Smtp':{}};if(_[_0x6f46('0x79')](_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7c')])){if(_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7d')]){_0x14c80f[_0x6f46('0x49')][_0x6f46('0x7e')]=_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x7e')]=_0x4f7e17[_0x6f46('0x6c')]['cuser'];_0x14c80f[_0x6f46('0x49')][_0x6f46('0x7f')]=_0x14c80f[_0x6f46('0x4b')]['pass']=_0x4f7e17['body'][_0x6f46('0x80')];}else{_0x14c80f[_0x6f46('0x49')]['authentication']=_0x14c80f['Smtp'][_0x6f46('0x81')]=![];}_0x14c80f[_0x6f46('0x49')][_0x6f46('0x82')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x49')][_0x6f46('0x82')];_0x14c80f['Imap'][_0x6f46('0x83')]=_0x4f7e17['body'][_0x6f46('0x49')]['port'];_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x82')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x4b')][_0x6f46('0x82')];_0x14c80f[_0x6f46('0x4b')]['port']=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x4b')][_0x6f46('0x83')];}else{_0x14c80f[_0x6f46('0x49')][_0x6f46('0x84')]=_0x14c80f['Smtp'][_0x6f46('0x84')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7c')];_0x14c80f['Imap'][_0x6f46('0x7e')]=_0x14c80f[_0x6f46('0x4b')]['user']=_0x4f7e17[_0x6f46('0x6c')]['cuser'];_0x14c80f['Imap'][_0x6f46('0x7f')]=_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x85')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x80')];}return db[_0x6f46('0x4f')]['create'](_0x14c80f,{'include':[{'model':db['MailServerOut'],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')}]})[_0x6f46('0x42')](function(_0x1298cc){var _0x2e1374=_0x4f7e17['user'][_0x6f46('0x43')]({'plain':!![]});if(!_0x2e1374)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e1374['role']===_0x6f46('0x7e')){var _0xfe55b6=_0x1298cc[_0x6f46('0x43')]({'plain':!![]});return db['UserProfileSection'][_0x6f46('0x6b')]({'where':{'name':_0x6f46('0x44'),'userProfileId':_0x2e1374[_0x6f46('0x86')]},'raw':!![]})[_0x6f46('0x42')](function(_0x4836bb){if(_0x4836bb&&_0x4836bb[_0x6f46('0x87')]===0x0){return db[_0x6f46('0x88')][_0x6f46('0x70')]({'name':_0xfe55b6[_0x6f46('0x45')],'resourceId':_0xfe55b6['id'],'type':_0x4836bb[_0x6f46('0x45')],'sectionId':_0x4836bb['id']},{})[_0x6f46('0x42')](function(){return _0x1298cc;});}else{return _0x1298cc;}})[_0x6f46('0x68')](function(_0x24e2c1){logger[_0x6f46('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e2c1);throw _0x24e2c1;});}return _0x1298cc;})['then'](respondWithResult(_0xe72239,0xc9))['catch'](handleError(_0xe72239,null));};exports[_0x6f46('0x89')]=function(_0x2440c8,_0x3fc07a,_0x1ac9e0){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x2440c8['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x3fc07a,null))['then'](function(_0x4b3090){if(_0x4b3090){return _0x4b3090['getImap']();}return null;})[_0x6f46('0x42')](respondWithResult(_0x3fc07a,null))[_0x6f46('0x68')](handleError(_0x3fc07a,null));};exports[_0x6f46('0x8a')]=function(_0x4afd62,_0x9765bf,_0xc46af1){if(_0x4afd62[_0x6f46('0x6c')]['id']){delete _0x4afd62[_0x6f46('0x6c')]['id'];}return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x4afd62[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x9765bf,null))[_0x6f46('0x42')](function(_0x214e33){if(_0x214e33){_0x4afd62[_0x6f46('0x6c')][_0x6f46('0x72')]=_0x214e33['id'];return db[_0x6f46('0x48')][_0x6f46('0x70')](_0x4afd62['body']);}})[_0x6f46('0x42')](respondWithResult(_0x9765bf,null))['catch'](handleError(_0x9765bf,null));};exports[_0x6f46('0x8b')]=function(_0x5ef072,_0x1aaa9b,_0x235893){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x5ef072[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x1aaa9b,null))[_0x6f46('0x42')](function(_0x5b3bbd){if(_0x5b3bbd){return _0x5b3bbd[_0x6f46('0x8c')](null);}return null;})[_0x6f46('0x42')](respondWithStatusCode(_0x1aaa9b,null))['catch'](handleError(_0x1aaa9b,null));};exports[_0x6f46('0x8d')]=function(_0x51de50,_0x5544f5,_0x177925){return db['MailAccount'][_0x6f46('0x71')]({'where':{'id':_0x51de50[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x5544f5,null))[_0x6f46('0x42')](function(_0x2c660d){if(_0x2c660d){return _0x2c660d[_0x6f46('0x8d')]();}return null;})[_0x6f46('0x42')](respondWithResult(_0x5544f5,null))[_0x6f46('0x68')](handleError(_0x5544f5,null));};exports[_0x6f46('0x8e')]=function(_0x17ff18,_0x39789a,_0xb97b8b){if(_0x17ff18['body']['id']){delete _0x17ff18['body']['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x17ff18[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x39789a,null))[_0x6f46('0x42')](function(_0x23c971){if(_0x23c971){_0x17ff18['body'][_0x6f46('0x72')]=_0x23c971['id'];return db['MailServerOut'][_0x6f46('0x70')](_0x17ff18['body']);}})[_0x6f46('0x42')](respondWithResult(_0x39789a,null))['catch'](handleError(_0x39789a,null));};exports['removeSmtp']=function(_0x75b7e6,_0x46762f,_0x20dcec){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x75b7e6[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x46762f,null))[_0x6f46('0x42')](function(_0x5ddc21){if(_0x5ddc21){return _0x5ddc21['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x46762f,null))[_0x6f46('0x68')](handleError(_0x46762f,null));};exports[_0x6f46('0x8f')]=function(_0x32aa18,_0x43e614,_0x361930){return db[_0x6f46('0x90')]['find']({'where':{'id':_0x32aa18[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x43e614,null))[_0x6f46('0x42')](function(_0x372af7){if(_0x372af7){return _0x372af7[_0x6f46('0x8f')](_0x32aa18[_0x6f46('0x6c')]['ids'],_[_0x6f46('0x91')](_0x32aa18['body'],[_0x6f46('0x77'),'id'])||{});}})['then'](respondWithResult(_0x43e614,null))[_0x6f46('0x68')](handleError(_0x43e614,null));};exports['getInteractions']=function(_0x43cc5f,_0x2f5a6a,_0x145663){var _0x23ad7b={'raw':![],'where':{}};var _0x545224={};var _0x147b32={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x43cc5f[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x2f5a6a,null))[_0x6f46('0x42')](function(_0x3738b4){if(_0x3738b4){_0x545224['model']=_[_0x6f46('0x54')](db[_0x6f46('0x90')][_0x6f46('0x6a')]);_0x545224['query']=_[_0x6f46('0x54')](_0x43cc5f[_0x6f46('0x53')]);_0x545224[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x545224[_0x6f46('0x52')],_0x545224['query']);_0x23ad7b['attributes']=_[_0x6f46('0x56')](_0x545224[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x43cc5f[_0x6f46('0x53')]['fields']));_0x23ad7b['attributes']=_0x23ad7b[_0x6f46('0x57')][_0x6f46('0x59')]?_0x23ad7b[_0x6f46('0x57')]:_0x545224['model'];if(!_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x23ad7b[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x38')]);_0x23ad7b[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x36')]);}_0x23ad7b['order']=qs[_0x6f46('0x5d')](_0x43cc5f['query'][_0x6f46('0x5d')]);_0x23ad7b['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x43cc5f[_0x6f46('0x53')],_0x545224['filters']));_0x23ad7b[_0x6f46('0x60')][_0x6f46('0x72')]=_0x3738b4['id'];if(_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x23ad7b[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x23ad7b[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x23ad7b['attributes'],function(_0x205afc){var _0x1befe6={};_0x1befe6[_0x205afc]={'$like':'%'+_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x1befe6;})});}_0x23ad7b=_[_0x6f46('0x62')]({},_0x23ad7b,_0x43cc5f[_0x6f46('0x63')]);return db[_0x6f46('0x90')]['count']({'where':_0x23ad7b[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x17fa46){_0x147b32[_0x6f46('0x39')]=_0x17fa46;if(_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x64')]){_0x23ad7b[_0x6f46('0x65')]=[{'model':db[_0x6f46('0x92')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6f46('0x93'),'attributes':[_0x6f46('0x45'),_0x6f46('0x94'),_0x6f46('0x95')],'required':![]},{'model':db['Tag'],'as':_0x6f46('0x96'),'attributes':['id',_0x6f46('0x45'),_0x6f46('0x97')],'where':_0x43cc5f[_0x6f46('0x53')]['tag']?{'id':_0x43cc5f['query'][_0x6f46('0x98')]}:undefined,'required':_0x43cc5f['query'][_0x6f46('0x98')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x23ad7b);})[_0x6f46('0x42')](function(_0x278ed7){_0x147b32[_0x6f46('0x67')]=_0x278ed7;return _0x147b32;});}})[_0x6f46('0x42')](respondWithFilteredResult(_0x2f5a6a,_0x23ad7b))['catch'](handleError(_0x2f5a6a,null));};exports['addApplications']=function(_0x3aa454,_0x4574e7,_0x5d981b){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x3aa454['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x4574e7,null))[_0x6f46('0x42')](function(_0x188225){if(_0x188225){return db['sequelize'][_0x6f46('0x99')](function(_0x18665e){return db['MailApplication'][_0x6f46('0x41')]({'where':{'MailAccountId':_0x3aa454[_0x6f46('0x69')]['id']},'transaction':_0x18665e})[_0x6f46('0x42')](function(_0x38c4ae){var _0x25f255=_[_0x6f46('0x4e')](_0x3aa454[_0x6f46('0x6c')],function(_0x360523){_0x360523[_0x6f46('0x72')]=_0x3aa454[_0x6f46('0x69')]['id'];return _0x360523;});return db[_0x6f46('0x9a')][_0x6f46('0x9b')](_0x25f255,{'transaction':_0x18665e});});})[_0x6f46('0x42')](function(){return db[_0x6f46('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x3aa454[_0x6f46('0x69')]['id']},'order':_0x6f46('0x9c')});});}})[_0x6f46('0x42')](respondWithResult(_0x4574e7,null))[_0x6f46('0x68')](handleError(_0x4574e7,null));};exports[_0x6f46('0x9d')]=function(_0x4a0025,_0x271e9e,_0x12c265){var _0x541bfb={};var _0x2769e4={};var _0x4bfb65;var _0x324b24;return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x4a0025[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x271e9e,null))[_0x6f46('0x42')](function(_0x916ef){if(_0x916ef){_0x4bfb65=_0x916ef;_0x2769e4[_0x6f46('0x52')]=_[_0x6f46('0x54')](db['MailApplication'][_0x6f46('0x6a')]);_0x2769e4[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x4a0025[_0x6f46('0x53')]);_0x2769e4[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x2769e4[_0x6f46('0x52')],_0x2769e4[_0x6f46('0x53')]);_0x541bfb[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x2769e4[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x4a0025['query']['fields']));_0x541bfb[_0x6f46('0x57')]=_0x541bfb[_0x6f46('0x57')]['length']?_0x541bfb[_0x6f46('0x57')]:_0x2769e4[_0x6f46('0x52')];_0x541bfb['order']=qs['sort'](_0x4a0025[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x541bfb[_0x6f46('0x60')]=qs['filters'](_[_0x6f46('0x5e')](_0x4a0025[_0x6f46('0x53')],_0x2769e4[_0x6f46('0x55')]));if(_0x4a0025['query']['filter']){_0x541bfb[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x541bfb[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x541bfb[_0x6f46('0x57')],function(_0x4d1128){var _0x36780d={};_0x36780d[_0x4d1128]={'$like':'%'+_0x4a0025[_0x6f46('0x53')]['filter']+'%'};return _0x36780d;})});}_0x541bfb=_['merge']({},_0x541bfb,_0x4a0025[_0x6f46('0x63')]);return _0x4bfb65[_0x6f46('0x9d')](_0x541bfb);}})[_0x6f46('0x42')](function(_0x1ace39){if(_0x1ace39){_0x324b24=_0x1ace39['length'];if(!_0x4a0025[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x541bfb[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x4a0025[_0x6f46('0x53')]['limit']);_0x541bfb[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x4a0025[_0x6f46('0x53')]['offset']);}return _0x4bfb65[_0x6f46('0x9d')](_0x541bfb);}})['then'](function(_0x285daa){if(_0x285daa){return _0x285daa?{'count':_0x324b24,'rows':_0x285daa}:null;}})[_0x6f46('0x42')](respondWithResult(_0x271e9e,null))['catch'](handleError(_0x271e9e,null));};exports[_0x6f46('0x9e')]=function(_0x524588,_0x1494d3,_0x29ba95){var _0x1bdb8c={'raw':!![],'where':{}};var _0x385220={};var _0x137d0c={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x524588['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x1494d3,null))[_0x6f46('0x42')](function(_0x12aa0e){if(_0x12aa0e){_0x385220['model']=_[_0x6f46('0x54')](db[_0x6f46('0x9f')]['rawAttributes']);_0x385220[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x524588['query']);_0x385220['filters']=_[_0x6f46('0x56')](_0x385220[_0x6f46('0x52')],_0x385220[_0x6f46('0x53')]);_0x1bdb8c[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x385220[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x524588['query'][_0x6f46('0x58')]));_0x1bdb8c[_0x6f46('0x57')]=_0x1bdb8c[_0x6f46('0x57')][_0x6f46('0x59')]?_0x1bdb8c[_0x6f46('0x57')]:_0x385220[_0x6f46('0x52')];if(!_0x524588[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x1bdb8c['limit']=qs[_0x6f46('0x38')](_0x524588[_0x6f46('0x53')]['limit']);_0x1bdb8c[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x524588[_0x6f46('0x53')]['offset']);}_0x1bdb8c['order']=qs[_0x6f46('0x5d')](_0x524588[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x1bdb8c[_0x6f46('0x60')]=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x524588[_0x6f46('0x53')],_0x385220[_0x6f46('0x55')]));_0x1bdb8c['where'][_0x6f46('0x72')]=_0x12aa0e['id'];if(_0x524588[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x1bdb8c['where']=_[_0x6f46('0x62')](_0x1bdb8c[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x1bdb8c['attributes'],function(_0x42f116){var _0xf44ae2={};_0xf44ae2[_0x42f116]={'$like':'%'+_0x524588[_0x6f46('0x53')]['filter']+'%'};return _0xf44ae2;})});}if(_0x524588[_0x6f46('0x53')][_0x6f46('0xa0')]){var _0x79b2cd=_0x524588['query'][_0x6f46('0xa0')][_0x6f46('0xa1')](',');var _0x5c18e3={};_0x5c18e3[_0x79b2cd[0x0]]={'$gte':moment(_0x79b2cd[0x1])[_0x6f46('0xa2')](_0x6f46('0xa3'))};_0x1bdb8c[_0x6f46('0x60')]=_['merge'](_0x1bdb8c['where'],_0x5c18e3);}_0x1bdb8c=_['merge']({},_0x1bdb8c,_0x524588[_0x6f46('0x63')]);return db[_0x6f46('0x9f')][_0x6f46('0x39')]({'where':_0x1bdb8c[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x55a0c9){_0x137d0c['count']=_0x55a0c9;if(_0x524588[_0x6f46('0x53')][_0x6f46('0x64')]){_0x1bdb8c['include']=[{'all':!![]}];}return db[_0x6f46('0x9f')][_0x6f46('0x66')](_0x1bdb8c);})[_0x6f46('0x42')](function(_0x3197d5){if(_0x524588[_0x6f46('0x53')][_0x6f46('0xa4')]===_0x6f46('0xa5')){for(var _0x2f7315=0x0;_0x2f7315<_0x3197d5[_0x6f46('0x59')];_0x2f7315++){_0x3197d5[_0x2f7315][_0x6f46('0x6c')]=juice(_0x3197d5[_0x2f7315][_0x6f46('0x6c')]);}}_0x137d0c[_0x6f46('0x67')]=_0x3197d5;return _0x137d0c;});}})['then'](respondWithFilteredResult(_0x1494d3,_0x1bdb8c))[_0x6f46('0x68')](handleError(_0x1494d3,null));};exports['send']=function(_0x9f7623,_0x1e5381,_0xd1929b){var _0x29f43e,_0x29c9a8={},_0x211e34;if(_0x9f7623['body']['to']){_0x211e34=_0x9f7623['body']['to'][_0x6f46('0xa1')](',')[0x0];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x9f7623[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0xa6')],'as':_0x6f46('0xa7'),'include':[{'model':db['CmContact'],'as':_0x6f46('0xa8'),'where':{'email':_0x211e34},'limit':0x1,'order':[[_0x6f46('0xa9'),_0x6f46('0xaa')]]}]},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b'),'raw':!![]}]})[_0x6f46('0x42')](handleEntityNotFound(_0x1e5381,null))[_0x6f46('0x42')](function(_0x4a697a){if(_0x4a697a){_0x29f43e=_0x4a697a;if(_0x4a697a['Smtp']){if(_['isNil'](_0x9f7623['body'][_0x6f46('0xab')])){_0x9f7623['body'][_0x6f46('0xab')]=util[_0x6f46('0xa2')](_0x6f46('0xac'),_0x4a697a[_0x6f46('0x45')],_0x4a697a[_0x6f46('0x78')]||_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')]);}if(_0x9f7623[_0x6f46('0x6c')]['attachments']&&_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')]['length']){for(var _0xd03f31=0x0;_0xd03f31<_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')][_0x6f46('0x59')];_0xd03f31+=0x1){_0x9f7623['body'][_0x6f46('0xad')][_0xd03f31]={'filename':_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')][_0xd03f31][_0x6f46('0x45')],'path':path[_0x6f46('0xae')](config[_0x6f46('0xaf')],_0x6f46('0xb0'),_0x9f7623['body'][_0x6f46('0xad')][_0xd03f31]['basename'])};}}var _0x354e43={'tls':{'rejectUnauthorized':![]}};if(_[_0x6f46('0x79')](_0x4a697a['Smtp'][_0x6f46('0x84')])){if(_0x4a697a['Smtp']['authentication']){_0x354e43[_0x6f46('0xb1')]={'user':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x85')]};}_0x354e43[_0x6f46('0x82')]=_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x82')];_0x354e43[_0x6f46('0x83')]=_0x4a697a['Smtp'][_0x6f46('0x83')];_0x354e43[_0x6f46('0xb2')]=_0x4a697a['Smtp']['secure'];}else{_0x354e43[_0x6f46('0x84')]=_0x4a697a[_0x6f46('0x4b')]['service'];_0x354e43['auth']={'user':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x85')]};}return respondWithRpcPromise(_0x6f46('0xb3'),_0x6f46('0xb4'),{'account':_0x354e43,'message':_0x9f7623[_0x6f46('0x6c')]});}else{throw new Error('List\x20not\x20found');}}})[_0x6f46('0x42')](function(_0x4013cb){if(_0x4013cb){_0x29c9a8=_0x4013cb;if(_0x29f43e['List']){if(_0x29f43e[_0x6f46('0xa7')][_0x6f46('0xa8')][_0x6f46('0x59')]){return _0x29f43e['List'][_0x6f46('0xa8')][0x0];}else{return db[_0x6f46('0x92')][_0x6f46('0x70')](_[_0x6f46('0x20')](_0x9f7623['body'],{'firstName':_0x9f7623['body']['to'],'email':_0x9f7623[_0x6f46('0x6c')]['to'],'phone':_0x9f7623[_0x6f46('0x6c')]['to'],'ListId':_0x29f43e[_0x6f46('0xb5')]}));}}else{throw new Error(_0x6f46('0xb6'));}}})[_0x6f46('0x42')](function(_0x21c4bb){if(_0x21c4bb){var _0xba694c={'UserId':_0x9f7623[_0x6f46('0x7e')]['id'],'ContactId':_0x21c4bb['id'],'MailAccountId':_0x29f43e['id'],'inReplyTo':_0x29c9a8[_0x6f46('0xb7')],'to':_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xab')],'cc':_0x9f7623[_0x6f46('0x6c')]['cc'],'subject':_0x9f7623['body'][_0x6f46('0xb8')],'attach':_0x9f7623[_0x6f46('0x6c')]['attach'],'firstMsgDirection':_0x6f46('0xb9'),'lastMsgAt':moment()['format'](_0x6f46('0xa3')),'lastMsgDirection':_0x6f46('0xb9'),'Messages':[_[_0x6f46('0x62')](_0x9f7623[_0x6f46('0x6c')],{'messageId':_0x29c9a8[_0x6f46('0xb7')],'sentAt':moment()['format'](_0x6f46('0xa3')),'read':!![],'MailAccountId':_0x29f43e['id'],'UserId':_0x9f7623[_0x6f46('0x7e')]['id'],'ContactId':_0x21c4bb['id']})]};if(_0x9f7623[_0x6f46('0x6c')]['Interaction']){_0xba694c=_[_0x6f46('0x62')](_0xba694c,_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xba')]);}return db['MailInteraction']['create'](_0xba694c,{'include':[{'model':db[_0x6f46('0x9f')],'as':_0x6f46('0xbb')}]});}})[_0x6f46('0x42')](respondWithResult(_0x1e5381,null))[_0x6f46('0x68')](handleError(_0x1e5381,null));};exports[_0x6f46('0xbc')]=function(_0x871852,_0x4d5a90,_0x540007){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x871852[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b'),'raw':!![]}]})[_0x6f46('0x42')](handleEntityNotFound(_0x4d5a90,null))[_0x6f46('0x42')](function(_0x2aec64){if(_0x2aec64&&_0x2aec64[_0x6f46('0x4b')]){var _0x27a265={'id':_0x2aec64['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2aec64['Smtp']['service']){_0x27a265['service']=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x84')];}else{_0x27a265[_0x6f46('0x82')]=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x82')];_0x27a265[_0x6f46('0x83')]=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x83')];_0x27a265[_0x6f46('0xb2')]=_0x2aec64['Smtp']['secure'];}if(_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x81')]){_0x27a265['auth']={'user':_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x2aec64['Smtp'][_0x6f46('0x85')]};}return respondWithRpcPromise(_0x6f46('0xbd'),_0x6f46('0xbc'),{'account':_0x27a265});}})['then'](respondWithResult(_0x4d5a90,null))[_0x6f46('0x68')](handleError(_0x4d5a90,null));};exports[_0x6f46('0x41')]=function(_0x4cf89d,_0x524100){return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x4cf89d['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x524100,null))[_0x6f46('0x42')](function(_0x4f975f){if(_0x4f975f&&_0x4f975f['service']){throw new db['Sequelize'][(_0x6f46('0xbe'))](_0x6f46('0xbf'));}return _0x4f975f;})[_0x6f46('0x42')](removeEntity(_0x524100,null))['catch'](handleError(_0x524100,null));};exports[_0x6f46('0xc0')]=function(_0x39b4d3,_0x17a1d6,_0x537389){return db[_0x6f46('0x4f')]['find']({'where':{'id':_0x39b4d3[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x17a1d6,null))['then'](function(_0x3ba1f9){if(_0x3ba1f9){return _0x3ba1f9[_0x6f46('0xc0')](_0x39b4d3[_0x6f46('0x6c')][_0x6f46('0x77')],_[_0x6f46('0x91')](_0x39b4d3[_0x6f46('0x6c')],[_0x6f46('0x77'),'id'])||{})[_0x6f46('0xc1')](function(_0xefc02f){for(var _0x576ee5=0x0;_0x576ee5<_0x39b4d3['body'][_0x6f46('0x77')][_0x6f46('0x59')];_0x576ee5+=0x1){socket[_0x6f46('0xc2')](_0x6f46('0xc3'),{'UserId':Number(_0x39b4d3[_0x6f46('0x6c')][_0x6f46('0x77')][_0x576ee5]),'MailAccountId':Number(_0x39b4d3[_0x6f46('0x69')]['id'])});}return _0xefc02f;});}})[_0x6f46('0x42')](respondWithResult(_0x17a1d6,null))['catch'](handleError(_0x17a1d6,null));};exports[_0x6f46('0xc4')]=function(_0x202dc9,_0x46a6bd,_0x176ef6){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x202dc9[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x46a6bd,null))[_0x6f46('0x42')](function(_0x276ebd){if(_0x276ebd){return _0x276ebd[_0x6f46('0xc4')](_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')])['then'](function(){if(_[_0x6f46('0xc5')](_0x202dc9[_0x6f46('0x53')]['ids'])){for(var _0x44f6d8=0x0;_0x44f6d8<_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')]['length'];_0x44f6d8+=0x1){socket[_0x6f46('0xc2')](_0x6f46('0xc6'),{'UserId':Number(_0x202dc9[_0x6f46('0x53')]['ids'][_0x44f6d8]),'MailAccountId':Number(_0x202dc9['params']['id'])});}}else{socket[_0x6f46('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')]),'MailAccountId':Number(_0x202dc9[_0x6f46('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0x46a6bd,null))[_0x6f46('0x68')](handleError(_0x46a6bd,null));};exports['getAgents']=function(_0x101f01,_0xf7190b,_0x3e2f94){var _0x42b71f={};var _0x10f9bb={};var _0x194dba;var _0x36ed69;return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x101f01[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0xf7190b,null))[_0x6f46('0x42')](function(_0x5c4ffe){if(_0x5c4ffe){_0x194dba=_0x5c4ffe;_0x10f9bb[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0xc7')]['rawAttributes']);_0x10f9bb['query']=_[_0x6f46('0x54')](_0x101f01[_0x6f46('0x53')]);_0x10f9bb[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x10f9bb[_0x6f46('0x52')],_0x10f9bb[_0x6f46('0x53')]);_0x42b71f['attributes']=_[_0x6f46('0x56')](_0x10f9bb[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x101f01[_0x6f46('0x53')]['fields']));_0x42b71f[_0x6f46('0x57')]=_0x42b71f[_0x6f46('0x57')][_0x6f46('0x59')]?_0x42b71f['attributes']:_0x10f9bb['model'];_0x42b71f['order']=qs[_0x6f46('0x5d')](_0x101f01[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x42b71f['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x101f01[_0x6f46('0x53')],_0x10f9bb['filters']));if(_0x101f01['query']['filter']){_0x42b71f[_0x6f46('0x60')]=_['merge'](_0x42b71f['where'],{'$or':_[_0x6f46('0x4e')](_0x42b71f[_0x6f46('0x57')],function(_0x432e99){var _0x492666={};_0x492666[_0x432e99]={'$like':'%'+_0x101f01[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x492666;})});}_0x42b71f=_[_0x6f46('0x62')]({},_0x42b71f,_0x101f01[_0x6f46('0x63')]);return _0x194dba['getAgents'](_0x42b71f);}})[_0x6f46('0x42')](function(_0x358cf2){if(_0x358cf2){_0x36ed69=_0x358cf2[_0x6f46('0x59')];if(!_0x101f01[_0x6f46('0x53')]['hasOwnProperty'](_0x6f46('0x5b'))){_0x42b71f[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x101f01[_0x6f46('0x53')]['limit']);_0x42b71f[_0x6f46('0x36')]=qs['offset'](_0x101f01[_0x6f46('0x53')][_0x6f46('0x36')]);}return _0x194dba[_0x6f46('0xc8')](_0x42b71f);}})[_0x6f46('0x42')](function(_0x1ea6d3){if(_0x1ea6d3){return _0x1ea6d3?{'count':_0x36ed69,'rows':_0x1ea6d3}:null;}})[_0x6f46('0x42')](respondWithResult(_0xf7190b,null))[_0x6f46('0x68')](handleError(_0xf7190b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 56af4b0..84b837a 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 _0x1a3b=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','save'];(function(_0x510d4a,_0x3a1250){var _0x3fbb34=function(_0x5e163b){while(--_0x5e163b){_0x510d4a['push'](_0x510d4a['shift']());}};_0x3fbb34(++_0x3a1250);}(_0x1a3b,0x83));var _0xb1a3=function(_0x1ad2c1,_0x390042){_0x1ad2c1=_0x1ad2c1-0x0;var _0x2ba54d=_0x1a3b[_0x1ad2c1];return _0x2ba54d;};'use strict';var EventEmitter=require(_0xb1a3('0x0'));var MailAccount=require(_0xb1a3('0x1'))['db'][_0xb1a3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1a3('0x3'),'afterUpdate':_0xb1a3('0x4'),'afterDestroy':_0xb1a3('0x5')};function emitEvent(_0x169131){return function(_0x4a63c2,_0x461d3d,_0x13033b){MailAccountEvents[_0xb1a3('0x6')](_0x169131+':'+_0x4a63c2['id'],_0x4a63c2);MailAccountEvents[_0xb1a3('0x6')](_0x169131,_0x4a63c2);_0x13033b(null);};}for(var e in events){if(events[_0xb1a3('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xb1a3('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xb3f9=['emit','hook','exports','events','../../mysqldb','save','remove'];(function(_0x2f0a48,_0xd06ab8){var _0x1c3c79=function(_0x14be7d){while(--_0x14be7d){_0x2f0a48['push'](_0x2f0a48['shift']());}};_0x1c3c79(++_0xd06ab8);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x33f296,_0x58bdba){_0x33f296=_0x33f296-0x0;var _0x3611b6=_0xb3f9[_0x33f296];return _0x3611b6;};'use strict';var EventEmitter=require(_0x9b3f('0x0'));var MailAccount=require(_0x9b3f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b3f('0x2'),'afterUpdate':'update','afterDestroy':_0x9b3f('0x3')};function emitEvent(_0x361db7){return function(_0x35fd0b,_0xa9df41,_0x227cca){MailAccountEvents[_0x9b3f('0x4')](_0x361db7+':'+_0x35fd0b['id'],_0x35fd0b);MailAccountEvents['emit'](_0x361db7,_0x35fd0b);_0x227cca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x9b3f('0x5')](e,emitEvent(event));}}module[_0x9b3f('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 59ce994..6895068 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 _0x669b=['mail_accounts','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','define','MailAccount'];(function(_0x5a6e66,_0x23250a){var _0x5f2be3=function(_0x4160e0){while(--_0x4160e0){_0x5a6e66['push'](_0x5a6e66['shift']());}};_0x5f2be3(++_0x23250a);}(_0x669b,0x198));var _0xb669=function(_0x450b8d,_0x2f0bb8){_0x450b8d=_0x450b8d-0x0;var _0x3b7bfe=_0x669b[_0x450b8d];return _0x3b7bfe;};'use strict';var _=require('lodash');var util=require(_0xb669('0x0'));var logger=require('../../config/logger')(_0xb669('0x1'));var moment=require(_0xb669('0x2'));var BPromise=require(_0xb669('0x3'));var rp=require(_0xb669('0x4'));var fs=require('fs');var path=require(_0xb669('0x5'));var rimraf=require('rimraf');var config=require(_0xb669('0x6'));var attributes=require(_0xb669('0x7'));module['exports']=function(_0x4ba84a,_0x58a779){return _0x4ba84a[_0xb669('0x8')](_0xb669('0x9'),attributes,{'tableName':_0xb669('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b72=['moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger','api'];(function(_0x2e9cef,_0x57b5c6){var _0x3f7007=function(_0x1675e5){while(--_0x1675e5){_0x2e9cef['push'](_0x2e9cef['shift']());}};_0x3f7007(++_0x57b5c6);}(_0x4b72,0x183));var _0x24b7=function(_0x22eb5b,_0x56b8f9){_0x22eb5b=_0x22eb5b-0x0;var _0x164b76=_0x4b72[_0x22eb5b];return _0x164b76;};'use strict';var _=require('lodash');var util=require(_0x24b7('0x0'));var logger=require(_0x24b7('0x1'))(_0x24b7('0x2'));var moment=require(_0x24b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x24b7('0x4'));var fs=require('fs');var path=require(_0x24b7('0x5'));var rimraf=require(_0x24b7('0x6'));var config=require(_0x24b7('0x7'));var attributes=require(_0x24b7('0x8'));module[_0x24b7('0x9')]=function(_0x2b3dc8,_0x3c1c6c){return _0x2b3dc8[_0x24b7('0xa')](_0x24b7('0xb'),attributes,{'tableName':_0x24b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e8bf2fd..aeb9e8f 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 _0xb60b=['limit','include','map','model','debug','ShowMailAccount','find','NotifyMailAccount','body','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','CmContact','MailApplication','MailServerOut','Smtp','List','omit','applications','list','priority','asc','autoclose','push','length','close','*,*,*,*','Applications','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originCc','ChatWebsiteId','originChannel','Email','Attachment','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes'];(function(_0x11a5a2,_0x1411fb){var _0xaf1ed0=function(_0x374416){while(--_0x374416){_0x11a5a2['push'](_0x11a5a2['shift']());}};_0xaf1ed0(++_0x1411fb);}(_0xb60b,0x17c));var _0xbb60=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xb60b[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xbb60('0x0'));var util=require(_0xbb60('0x1'));var moment=require('moment');var BPromise=require(_0xbb60('0x2'));var rs=require(_0xbb60('0x3'));var fs=require('fs');var Redis=require(_0xbb60('0x4'));var db=require(_0xbb60('0x5'))['db'];var utils=require(_0xbb60('0x6'));var logger=require(_0xbb60('0x7'))(_0xbb60('0x8'));var config=require('../../config/environment');var jayson=require(_0xbb60('0x9'));var client=jayson['client'][_0xbb60('0xa')]({'port':0x232c});config[_0xbb60('0xb')]=_[_0xbb60('0xc')](config[_0xbb60('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb60('0xd'))(new Redis(config[_0xbb60('0xb')]));require('./mailAccount.socket')[_0xbb60('0xe')](socket);function respondWithRpcPromise(_0x450212,_0x45afc9,_0x2a8b67){return new BPromise(function(_0x536da3,_0x2dc7e6){return client[_0xbb60('0xf')](_0x450212,_0x2a8b67)[_0xbb60('0x10')](function(_0x59373f){logger['info'](_0xbb60('0x11'),_0x45afc9,_0xbb60('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x45afc9,'request\x20sent',JSON[_0xbb60('0x13')](_0x59373f));if(_0x59373f[_0xbb60('0x14')]){if(_0x59373f[_0xbb60('0x14')][_0xbb60('0x15')]===0x1f4){logger[_0xbb60('0x14')]('MailAccount,\x20%s,\x20%s',_0x45afc9,_0x59373f[_0xbb60('0x14')]['message']);return _0x2dc7e6(_0x59373f['error'][_0xbb60('0x16')]);}logger[_0xbb60('0x14')](_0xbb60('0x11'),_0x45afc9,_0x59373f[_0xbb60('0x14')][_0xbb60('0x16')]);return _0x536da3(_0x59373f['error'][_0xbb60('0x16')]);}else{logger[_0xbb60('0x17')](_0xbb60('0x11'),_0x45afc9,_0xbb60('0x12'));_0x536da3(_0x59373f[_0xbb60('0x18')][_0xbb60('0x16')]);}})[_0xbb60('0x19')](function(_0x53d6a7){logger[_0xbb60('0x14')](_0xbb60('0x11'),_0x45afc9,_0x53d6a7);_0x2dc7e6(_0x53d6a7);});});}exports[_0xbb60('0x1a')]=function(_0x1d12c2){var _0x4aba3a=this;return new Promise(function(_0x1cc4d6,_0xe84089){return db[_0xbb60('0x1b')]['findAll']({'raw':_0x1d12c2['options']?_0x1d12c2[_0xbb60('0x1c')][_0xbb60('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d12c2[_0xbb60('0x1c')]?_0x1d12c2['options'][_0xbb60('0x1e')]||null:null,'attributes':_0x1d12c2[_0xbb60('0x1c')]?_0x1d12c2['options'][_0xbb60('0x1f')]||null:null,'limit':_0x1d12c2['options']?_0x1d12c2[_0xbb60('0x1c')][_0xbb60('0x20')]||null:null,'include':_0x1d12c2[_0xbb60('0x1c')]?_0x1d12c2['options'][_0xbb60('0x21')]?_[_0xbb60('0x22')](_0x1d12c2['options'][_0xbb60('0x21')],function(_0x104776){return{'model':db[_0x104776[_0xbb60('0x23')]],'as':_0x104776['as'],'attributes':_0x104776['attributes'],'include':_0x104776[_0xbb60('0x21')]?_['map'](_0x104776[_0xbb60('0x21')],function(_0xf3aaed){return{'model':db[_0xf3aaed[_0xbb60('0x23')]],'as':_0xf3aaed['as'],'attributes':_0xf3aaed[_0xbb60('0x1f')],'include':_0xf3aaed[_0xbb60('0x21')]?_[_0xbb60('0x22')](_0xf3aaed['include'],function(_0x50c22a){return{'model':db[_0x50c22a['model']],'as':_0x50c22a['as'],'attributes':_0x50c22a['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb60('0x10')](function(_0x14613f){logger[_0xbb60('0x17')](_0xbb60('0x1a'),_0x1d12c2);logger[_0xbb60('0x24')](_0xbb60('0x1a'),_0x1d12c2,JSON[_0xbb60('0x13')](_0x14613f));_0x1cc4d6(_0x14613f);})[_0xbb60('0x19')](function(_0x2d5a91){logger[_0xbb60('0x14')](_0xbb60('0x1a'),_0x2d5a91[_0xbb60('0x16')],_0x1d12c2);_0xe84089(_0x4aba3a[_0xbb60('0x14')](0x1f4,_0x2d5a91['message']));});});};exports[_0xbb60('0x25')]=function(_0x491463){var _0x4476ae=this;return new Promise(function(_0x50d568,_0x23fbe7){return db[_0xbb60('0x1b')][_0xbb60('0x26')]({'raw':_0x491463['options']?_0x491463[_0xbb60('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x491463['options']?_0x491463[_0xbb60('0x1c')]['where']||null:null,'attributes':_0x491463[_0xbb60('0x1c')]?_0x491463[_0xbb60('0x1c')][_0xbb60('0x1f')]||null:null,'include':_0x491463[_0xbb60('0x1c')]?_0x491463[_0xbb60('0x1c')]['include']?_[_0xbb60('0x22')](_0x491463[_0xbb60('0x1c')]['include'],function(_0x624ac1){return{'model':db[_0x624ac1['model']],'as':_0x624ac1['as'],'attributes':_0x624ac1[_0xbb60('0x1f')],'include':_0x624ac1[_0xbb60('0x21')]?_['map'](_0x624ac1['include'],function(_0x22b3ed){return{'model':db[_0x22b3ed[_0xbb60('0x23')]],'as':_0x22b3ed['as'],'attributes':_0x22b3ed[_0xbb60('0x1f')],'include':_0x22b3ed[_0xbb60('0x21')]?_[_0xbb60('0x22')](_0x22b3ed['include'],function(_0x4aa30a){return{'model':db[_0x4aa30a[_0xbb60('0x23')]],'as':_0x4aa30a['as'],'attributes':_0x4aa30a['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb60('0x10')](function(_0x2d1fcb){logger[_0xbb60('0x17')](_0xbb60('0x25'),_0x491463);logger[_0xbb60('0x24')](_0xbb60('0x25'),_0x491463,JSON[_0xbb60('0x13')](_0x2d1fcb));_0x50d568(_0x2d1fcb);})[_0xbb60('0x19')](function(_0x2085d5){logger[_0xbb60('0x14')](_0xbb60('0x25'),_0x2085d5[_0xbb60('0x16')],_0x491463);_0x23fbe7(_0x4476ae[_0xbb60('0x14')](0x1f4,_0x2085d5[_0xbb60('0x16')]));});});};exports[_0xbb60('0x27')]=function(_0x512ff5){var _0x1c9b23=this;return new Promise(function(_0x2d6e76,_0x1a7aba){var _0xcabb23={'body':_0x512ff5[_0xbb60('0x28')],'channel':'mail'};var _0x3789d6=_['difference'](_[_0xbb60('0x29')](db['CmContact'][_0xbb60('0x2a')]),[_0xbb60('0x2b'),_0xbb60('0x2c'),_0xbb60('0x2d'),_0xbb60('0x2e')]);var _0x39bd3e=![];if(_0x512ff5['body']['id']){delete _0x512ff5[_0xbb60('0x28')]['id'];}if(_[_0xbb60('0x2f')](_0x512ff5[_0xbb60('0x28')][_0xbb60('0x30')])){return _0x1a7aba(_0x1c9b23[_0xbb60('0x14')](0x1f4,_0xbb60('0x31')));}if(_['isNil'](_0x512ff5[_0xbb60('0x28')]['body'])||_0x512ff5[_0xbb60('0x28')][_0xbb60('0x28')]===''){return _0x1a7aba(_0x1c9b23[_0xbb60('0x14')](0x1f4,_0xbb60('0x32')));}if(_[_0xbb60('0x2f')](_0x512ff5[_0xbb60('0x28')][_0xbb60('0x33')])){return _0x1a7aba(_0x1c9b23['error'](0x1f4,_0xbb60('0x34')+_0x3789d6));}if(!_['includes'](_0x3789d6,_0x512ff5[_0xbb60('0x28')][_0xbb60('0x33')])){return _0x1a7aba(_0x1c9b23[_0xbb60('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3789d6));}var _0x1d1916={};_0x1d1916[_0x512ff5['body'][_0xbb60('0x33')]]=_0x512ff5[_0xbb60('0x28')]['from'];return db['MailAccount'][_0xbb60('0x26')]({'where':{'id':_0x512ff5[_0xbb60('0x35')]['id']},'include':[{'model':db[_0xbb60('0x36')],'as':'List','include':[{'model':db[_0xbb60('0x37')],'as':'Contacts','where':_0x1d1916,'limit':0x1,'order':[[_0xbb60('0x2c'),'DESC']]}]},{'model':db[_0xbb60('0x38')],'as':'Applications'},{'model':db[_0xbb60('0x39')],'as':_0xbb60('0x3a')}]})[_0xbb60('0x10')](function(_0x79de6){if(_0x79de6&&_0x79de6[_0xbb60('0x3b')]){var _0x2aa751=_0x79de6['get']({'plain':!![]});_0xcabb23[_0xbb60('0x35')]=_[_0xbb60('0x3c')](_0x2aa751,['Applications','List']);_0xcabb23[_0xbb60('0x3d')]=_0x2aa751['Applications'];_0xcabb23[_0xbb60('0x3e')]=_0x2aa751[_0xbb60('0x3b')];_0xcabb23[_0xbb60('0x3d')]=_['orderBy'](_0xcabb23[_0xbb60('0x3d')],[_0xbb60('0x3f')],[_0xbb60('0x40')]);if(_0xcabb23[_0xbb60('0x35')]&&_0xcabb23[_0xbb60('0x35')][_0xbb60('0x41')]){_0xcabb23[_0xbb60('0x3d')][_0xbb60('0x42')]({'id':0x0,'priority':_0xcabb23[_0xbb60('0x3d')][_0xbb60('0x43')]+0x1,'app':_0xbb60('0x44'),'appdata':_0xbb60('0x41'),'interval':_0xbb60('0x45')});}if(_0xcabb23['account'][_0xbb60('0x46')]){delete _0xcabb23[_0xbb60('0x35')][_0xbb60('0x46')];}if(_0xcabb23[_0xbb60('0x35')]['List']){delete _0xcabb23[_0xbb60('0x35')][_0xbb60('0x3b')];}if(_0x2aa751['List'][_0xbb60('0x47')][_0xbb60('0x43')]){return _0x2aa751[_0xbb60('0x3b')][_0xbb60('0x47')][0x0];}var _0xe2c119=_['defaults'](_0x512ff5['body'],{'firstName':_0x512ff5[_0xbb60('0x28')]['from'],'ListId':_0x2aa751[_0xbb60('0x2e')]});_0xe2c119[_0x512ff5['body'][_0xbb60('0x33')]]=_0x512ff5['body'][_0xbb60('0x30')];return db['CmContact'][_0xbb60('0x48')](_0xe2c119);}else{throw new Error(_0xbb60('0x49'));}})[_0xbb60('0x10')](function(_0x21a3d0){_0xcabb23['contact']=_0x21a3d0;if(_0x21a3d0){if(!_0x512ff5[_0xbb60('0x28')]['message'][_0xbb60('0x4a')]){_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['messageId']=rs[_0xbb60('0x4b')]()+'\x20'+_0x512ff5['body']['message'][_0xbb60('0x30')];}var _0x359321={'ContactId':_0x21a3d0['id'],'MailAccountId':_0x512ff5[_0xbb60('0x35')]['id'],'inReplyTo':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')][_0xbb60('0x4a')],'to':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')][_0xbb60('0x30')],'cc':_0x512ff5['body'][_0xbb60('0x16')]['cc'],'subject':_0x512ff5['body']['message'][_0xbb60('0x4c')],'attach':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')][_0xbb60('0x4d')],'lastMsgAt':moment()[_0xbb60('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xbb60('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0x512ff5[_0xbb60('0x35')]['id']},'include':[{'model':db[_0xbb60('0x50')],'as':_0xbb60('0x51'),'attributes':[_0xbb60('0x4a')],'where':{'messageId':_0x512ff5['body']['message'][_0xbb60('0x52')]}}]})[_0xbb60('0x10')](function(_0xa59622){if(_0xa59622){return[_0xa59622,![]];}return db[_0xbb60('0x4f')]['create'](_0x359321)['then'](function(_0x412e5b){return[_0x412e5b,!![]];});});}else{throw new Error(_0xbb60('0x53'));}})['spread'](function(_0x37b9a8,_0x1129db){if(_0x37b9a8){_0x39bd3e=_0x1129db;if(!_0x1129db){return _0x37b9a8[_0xbb60('0x54')]({'inReplyTo':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['messageId'],'to':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')][_0xbb60('0x30')],'cc':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['cc'],'subject':_0x512ff5[_0xbb60('0x28')]['message']['subject'],'attach':_0x37b9a8[_0xbb60('0x4d')]?_0x37b9a8['attach']:_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xbb60('0x55')),'lastMsgAt':moment()[_0xbb60('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x37b9a8;}}})['then'](function(_0x4d047a){_0xcabb23[_0xbb60('0x56')]=_0x4d047a['get']({'plain':!![]});_0xcabb23[_0xbb60('0x56')][_0xbb60('0x57')]=_0x39bd3e;return db['MailMessage'][_0xbb60('0x48')]({'body':_0x512ff5['body'][_0xbb60('0x28')],'MailAccountId':_0x512ff5[_0xbb60('0x35')]['id'],'MailInteractionId':_0x4d047a['id'],'direction':'in','ContactId':_0xcabb23[_0xbb60('0x58')]['id'],'messageId':_0x512ff5[_0xbb60('0x28')]['message']['messageId'],'from':_0x512ff5['body'][_0xbb60('0x16')][_0xbb60('0x30')],'to':_0x512ff5[_0xbb60('0x28')]['message']['to'],'cc':_0x512ff5[_0xbb60('0x28')]['message']['cc'],'subject':_0x512ff5['body']['message'][_0xbb60('0x4c')],'attach':_0x512ff5[_0xbb60('0x28')]['message'][_0xbb60('0x4d')],'Attachments':_0x512ff5['body'][_0xbb60('0x16')][_0xbb60('0x59')],'originTo':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['originTo'],'originCc':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')][_0xbb60('0x5a')],'bcc':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['bcc'],'ChatWebsiteId':_0x512ff5[_0xbb60('0x28')]['message'][_0xbb60('0x5b')]||null,'originChannel':_0x512ff5[_0xbb60('0x28')]['message'][_0xbb60('0x5c')]||_0xbb60('0x5d'),'ChatOfflineMessageId':_0x512ff5[_0xbb60('0x28')][_0xbb60('0x16')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xbb60('0x5e')],'as':'Attachments'}]});})[_0xbb60('0x10')](function(_0x43f94a){_0xcabb23[_0xbb60('0x16')]=_0x43f94a;if(_0xcabb23[_0xbb60('0x56')]['UserId']){return db[_0xbb60('0x5f')][_0xbb60('0x26')]({'attributes':['id',_0xbb60('0x60')],'where':{'id':_0xcabb23[_0xbb60('0x56')][_0xbb60('0x61')]}})[_0xbb60('0x10')](function(_0xe9246c){if(_0xe9246c){_0xcabb23[_0xbb60('0x3d')][_0xbb60('0x62')]({'id':0x0,'priority':0x0,'app':_0xbb60('0x63'),'appdata':_0xe9246c[_0xbb60('0x60')]+','+(_0xcabb23['account'][_0xbb60('0x64')]||0xa),'interval':_0xbb60('0x45')});}return respondWithRpcPromise(_0xbb60('0x65'),'startRouting',_0xcabb23);});}return respondWithRpcPromise(_0xbb60('0x65'),_0xbb60('0x66'),_0xcabb23);})['then'](function(_0x1a94cf){_0x2d6e76(_0x1a94cf);})[_0xbb60('0x19')](function(_0x5eb70b){_0x1a7aba(_0x1c9b23['error'](0x1f4,_0x5eb70b[_0xbb60('0x16')]));});});}; \ No newline at end of file +var _0xfd2f=['result','catch','MailAccount','findAll','options','raw','limit','include','map','model','attributes','then','GetMailAccount','ShowMailAccount','find','where','mail','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','from','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','account','List','Contacts','updatedAt','DESC','MailApplication','get','omit','Applications','list','applications','priority','autoclose','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailMessage','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','originChannel','Email','Attachments','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd2f,0x11b));var _0xffd2=function(_0x5b8ac2,_0x1939ef){_0x5b8ac2=_0x5b8ac2-0x0;var _0x54fcb=_0xfd2f[_0x5b8ac2];return _0x54fcb;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require(_0xffd2('0x3'));var rs=require(_0xffd2('0x4'));var fs=require('fs');var Redis=require(_0xffd2('0x5'));var db=require(_0xffd2('0x6'))['db'];var utils=require(_0xffd2('0x7'));var logger=require(_0xffd2('0x8'))(_0xffd2('0x9'));var config=require(_0xffd2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xffd2('0xb')][_0xffd2('0xc')]({'port':0x232c});config[_0xffd2('0xd')]=_[_0xffd2('0xe')](config[_0xffd2('0xd')],{'host':_0xffd2('0xf'),'port':0x18eb});var socket=require(_0xffd2('0x10'))(new Redis(config[_0xffd2('0xd')]));require(_0xffd2('0x11'))[_0xffd2('0x12')](socket);function respondWithRpcPromise(_0xcf4147,_0xbbad52,_0x36a653){return new BPromise(function(_0x23eb54,_0x7a62ad){return client[_0xffd2('0x13')](_0xcf4147,_0x36a653)['then'](function(_0x1b70cd){logger[_0xffd2('0x14')](_0xffd2('0x15'),_0xbbad52,_0xffd2('0x16'));logger[_0xffd2('0x17')](_0xffd2('0x18'),_0xbbad52,_0xffd2('0x16'),JSON[_0xffd2('0x19')](_0x1b70cd));if(_0x1b70cd[_0xffd2('0x1a')]){if(_0x1b70cd['error'][_0xffd2('0x1b')]===0x1f4){logger['error'](_0xffd2('0x15'),_0xbbad52,_0x1b70cd[_0xffd2('0x1a')]['message']);return _0x7a62ad(_0x1b70cd[_0xffd2('0x1a')][_0xffd2('0x1c')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0xbbad52,_0x1b70cd[_0xffd2('0x1a')][_0xffd2('0x1c')]);return _0x23eb54(_0x1b70cd[_0xffd2('0x1a')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0xbbad52,_0xffd2('0x16'));_0x23eb54(_0x1b70cd[_0xffd2('0x1d')][_0xffd2('0x1c')]);}})[_0xffd2('0x1e')](function(_0x1f4c5f){logger[_0xffd2('0x1a')](_0xffd2('0x15'),_0xbbad52,_0x1f4c5f);_0x7a62ad(_0x1f4c5f);});});}exports['GetMailAccount']=function(_0x43a474){var _0x41e79c=this;return new Promise(function(_0x41b056,_0x29ad80){return db[_0xffd2('0x1f')][_0xffd2('0x20')]({'raw':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x22')]===undefined?!![]:![]:!![],'where':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')]['where']||null:null,'attributes':_0x43a474['options']?_0x43a474[_0xffd2('0x21')]['attributes']||null:null,'limit':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x23')]||null:null,'include':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x43a474[_0xffd2('0x21')][_0xffd2('0x24')],function(_0x5b53bc){return{'model':db[_0x5b53bc[_0xffd2('0x26')]],'as':_0x5b53bc['as'],'attributes':_0x5b53bc[_0xffd2('0x27')],'include':_0x5b53bc[_0xffd2('0x24')]?_['map'](_0x5b53bc['include'],function(_0x48bfe8){return{'model':db[_0x48bfe8['model']],'as':_0x48bfe8['as'],'attributes':_0x48bfe8[_0xffd2('0x27')],'include':_0x48bfe8[_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x48bfe8[_0xffd2('0x24')],function(_0x1de3b1){return{'model':db[_0x1de3b1[_0xffd2('0x26')]],'as':_0x1de3b1['as'],'attributes':_0x1de3b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xffd2('0x28')](function(_0x3a1130){logger[_0xffd2('0x14')](_0xffd2('0x29'),_0x43a474);logger[_0xffd2('0x17')]('GetMailAccount',_0x43a474,JSON['stringify'](_0x3a1130));_0x41b056(_0x3a1130);})[_0xffd2('0x1e')](function(_0x3d6b66){logger[_0xffd2('0x1a')](_0xffd2('0x29'),_0x3d6b66[_0xffd2('0x1c')],_0x43a474);_0x29ad80(_0x41e79c[_0xffd2('0x1a')](0x1f4,_0x3d6b66[_0xffd2('0x1c')]));});});};exports[_0xffd2('0x2a')]=function(_0x33d0b1){var _0x44b7f2=this;return new Promise(function(_0x50b62a,_0x3188dc){return db[_0xffd2('0x1f')][_0xffd2('0x2b')]({'raw':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1['options'][_0xffd2('0x22')]===undefined?!![]:![]:!![],'where':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1[_0xffd2('0x21')][_0xffd2('0x2c')]||null:null,'attributes':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1[_0xffd2('0x21')]['attributes']||null:null,'include':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1['options'][_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x33d0b1['options'][_0xffd2('0x24')],function(_0x2496e8){return{'model':db[_0x2496e8['model']],'as':_0x2496e8['as'],'attributes':_0x2496e8[_0xffd2('0x27')],'include':_0x2496e8['include']?_['map'](_0x2496e8[_0xffd2('0x24')],function(_0x4065ff){return{'model':db[_0x4065ff[_0xffd2('0x26')]],'as':_0x4065ff['as'],'attributes':_0x4065ff[_0xffd2('0x27')],'include':_0x4065ff['include']?_[_0xffd2('0x25')](_0x4065ff[_0xffd2('0x24')],function(_0x39b58b){return{'model':db[_0x39b58b[_0xffd2('0x26')]],'as':_0x39b58b['as'],'attributes':_0x39b58b[_0xffd2('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x106acb){logger['info'](_0xffd2('0x2a'),_0x33d0b1);logger[_0xffd2('0x17')](_0xffd2('0x2a'),_0x33d0b1,JSON[_0xffd2('0x19')](_0x106acb));_0x50b62a(_0x106acb);})[_0xffd2('0x1e')](function(_0x210e0a){logger['error']('ShowMailAccount',_0x210e0a[_0xffd2('0x1c')],_0x33d0b1);_0x3188dc(_0x44b7f2['error'](0x1f4,_0x210e0a[_0xffd2('0x1c')]));});});};exports['NotifyMailAccount']=function(_0x186134){var _0x1fd7ba=this;return new Promise(function(_0x3cf6a6,_0xac3520){var _0x818fb8={'body':_0x186134['body'],'channel':_0xffd2('0x2d')};var _0x482b0c=_['difference'](_[_0xffd2('0x2e')](db[_0xffd2('0x2f')][_0xffd2('0x30')]),[_0xffd2('0x31'),'updatedAt',_0xffd2('0x32'),_0xffd2('0x33')]);var _0x4fede3=![];if(_0x186134[_0xffd2('0x34')]['id']){delete _0x186134[_0xffd2('0x34')]['id'];}if(_['isNil'](_0x186134['body'][_0xffd2('0x35')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xffd2('0x36')](_0x186134['body']['body'])||_0x186134['body'][_0xffd2('0x34')]===''){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x37')));}if(_[_0xffd2('0x36')](_0x186134[_0xffd2('0x34')][_0xffd2('0x38')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x39')+_0x482b0c));}if(!_[_0xffd2('0x3a')](_0x482b0c,_0x186134[_0xffd2('0x34')][_0xffd2('0x38')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x3b')+_0x482b0c));}var _0x2db9f2={};_0x2db9f2[_0x186134[_0xffd2('0x34')][_0xffd2('0x38')]]=_0x186134[_0xffd2('0x34')][_0xffd2('0x35')];return db[_0xffd2('0x1f')][_0xffd2('0x2b')]({'where':{'id':_0x186134[_0xffd2('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0xffd2('0x3d'),'include':[{'model':db[_0xffd2('0x2f')],'as':_0xffd2('0x3e'),'where':_0x2db9f2,'limit':0x1,'order':[[_0xffd2('0x3f'),_0xffd2('0x40')]]}]},{'model':db[_0xffd2('0x41')],'as':'Applications'},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xffd2('0x28')](function(_0xe3b495){if(_0xe3b495&&_0xe3b495[_0xffd2('0x3d')]){var _0x3231fe=_0xe3b495[_0xffd2('0x42')]({'plain':!![]});_0x818fb8[_0xffd2('0x3c')]=_[_0xffd2('0x43')](_0x3231fe,[_0xffd2('0x44'),_0xffd2('0x3d')]);_0x818fb8['applications']=_0x3231fe[_0xffd2('0x44')];_0x818fb8[_0xffd2('0x45')]=_0x3231fe['List'];_0x818fb8['applications']=_['orderBy'](_0x818fb8[_0xffd2('0x46')],[_0xffd2('0x47')],['asc']);if(_0x818fb8['account']&&_0x818fb8[_0xffd2('0x3c')][_0xffd2('0x48')]){_0x818fb8[_0xffd2('0x46')]['push']({'id':0x0,'priority':_0x818fb8['applications'][_0xffd2('0x49')]+0x1,'app':'close','appdata':_0xffd2('0x48'),'interval':_0xffd2('0x4a')});}if(_0x818fb8[_0xffd2('0x3c')]['Applications']){delete _0x818fb8[_0xffd2('0x3c')][_0xffd2('0x44')];}if(_0x818fb8[_0xffd2('0x3c')][_0xffd2('0x3d')]){delete _0x818fb8[_0xffd2('0x3c')]['List'];}if(_0x3231fe['List']['Contacts']['length']){return _0x3231fe['List'][_0xffd2('0x3e')][0x0];}var _0x436071=_['defaults'](_0x186134[_0xffd2('0x34')],{'firstName':_0x186134[_0xffd2('0x34')][_0xffd2('0x35')],'ListId':_0x3231fe[_0xffd2('0x33')]});_0x436071[_0x186134[_0xffd2('0x34')][_0xffd2('0x38')]]=_0x186134[_0xffd2('0x34')]['from'];return db[_0xffd2('0x2f')][_0xffd2('0x4b')](_0x436071);}else{throw new Error(_0xffd2('0x4c'));}})[_0xffd2('0x28')](function(_0x83c82a){_0x818fb8[_0xffd2('0x4d')]=_0x83c82a;if(_0x83c82a){if(!_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x4e')]){_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x4e')]=rs[_0xffd2('0x4f')]()+'\x20'+_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')];}var _0x4f6d3b={'ContactId':_0x83c82a['id'],'MailAccountId':_0x186134[_0xffd2('0x3c')]['id'],'inReplyTo':_0x186134[_0xffd2('0x34')]['message']['messageId'],'to':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x35')],'cc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['cc'],'subject':_0x186134['body'][_0xffd2('0x1c')]['subject'],'attach':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x50')],'lastMsgAt':moment()[_0xffd2('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xffd2('0x2b')]({'where':{'closed':![],'MailAccountId':_0x186134['account']['id']},'include':[{'model':db[_0xffd2('0x52')],'as':'Messages','attributes':[_0xffd2('0x4e')],'where':{'messageId':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x53')]}}]})[_0xffd2('0x28')](function(_0x313314){if(_0x313314){return[_0x313314,![]];}return db[_0xffd2('0x54')][_0xffd2('0x4b')](_0x4f6d3b)[_0xffd2('0x28')](function(_0x51ee4d){return[_0x51ee4d,!![]];});});}else{throw new Error(_0xffd2('0x55'));}})[_0xffd2('0x56')](function(_0x280ba1,_0x5d388b){if(_0x280ba1){_0x4fede3=_0x5d388b;if(!_0x5d388b){return _0x280ba1[_0xffd2('0x57')]({'inReplyTo':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x4e')],'to':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')],'cc':_0x186134['body'][_0xffd2('0x1c')]['cc'],'subject':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x58')],'attach':_0x280ba1[_0xffd2('0x50')]?_0x280ba1[_0xffd2('0x50')]:_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x50')],'substatus':null,'substatusAt':moment()[_0xffd2('0x51')](_0xffd2('0x59')),'lastMsgAt':moment()[_0xffd2('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x280ba1;}}})[_0xffd2('0x28')](function(_0x52b59f){_0x818fb8[_0xffd2('0x5a')]=_0x52b59f[_0xffd2('0x42')]({'plain':!![]});_0x818fb8['interaction'][_0xffd2('0x5b')]=_0x4fede3;return db[_0xffd2('0x52')][_0xffd2('0x4b')]({'body':_0x186134['body']['body'],'MailAccountId':_0x186134[_0xffd2('0x3c')]['id'],'MailInteractionId':_0x52b59f['id'],'direction':'in','ContactId':_0x818fb8[_0xffd2('0x4d')]['id'],'messageId':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x4e')],'from':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')],'to':_0x186134[_0xffd2('0x34')]['message']['to'],'cc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['cc'],'subject':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x58')],'attach':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x50')],'Attachments':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x5c')],'originTo':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x5d')],'originCc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['originCc'],'bcc':_0x186134['body'][_0xffd2('0x1c')]['bcc'],'ChatWebsiteId':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x5e')]||null,'originChannel':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x5f')]||_0xffd2('0x60'),'ChatOfflineMessageId':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xffd2('0x61')}]});})[_0xffd2('0x28')](function(_0xec483f){_0x818fb8['message']=_0xec483f;if(_0x818fb8[_0xffd2('0x5a')]['UserId']){return db[_0xffd2('0x62')][_0xffd2('0x2b')]({'attributes':['id','name'],'where':{'id':_0x818fb8[_0xffd2('0x5a')]['UserId']}})['then'](function(_0x39743f){if(_0x39743f){_0x818fb8[_0xffd2('0x46')][_0xffd2('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x39743f[_0xffd2('0x64')]+','+(_0x818fb8['account'][_0xffd2('0x65')]||0xa),'interval':_0xffd2('0x4a')});}return respondWithRpcPromise(_0xffd2('0x66'),_0xffd2('0x67'),_0x818fb8);});}return respondWithRpcPromise(_0xffd2('0x66'),'startRouting',_0x818fb8);})['then'](function(_0x24e25b){_0x3cf6a6(_0x24e25b);})['catch'](function(_0x4abb86){_0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0x4abb86['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a1d492d..6763435 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 _0x6462=['removeListener','register','length','./mailAccount.events','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6462,0x65));var _0x2646=function(_0x1e8646,_0x5940e6){_0x1e8646=_0x1e8646-0x0;var _0x123753=_0x6462[_0x1e8646];return _0x123753;};'use strict';var MailAccountEvents=require(_0x2646('0x0'));var events=[_0x2646('0x1'),_0x2646('0x2'),'update'];function createListener(_0x5f198b,_0x1fda6f){return function(_0x15f379){_0x1fda6f[_0x2646('0x3')](_0x5f198b,_0x15f379);};}function removeListener(_0x149875,_0x1ca4e0){return function(){MailAccountEvents[_0x2646('0x4')](_0x149875,_0x1ca4e0);};}exports[_0x2646('0x5')]=function(_0x4acb6b){for(var _0x23457d=0x0,_0x481005=events[_0x2646('0x6')];_0x23457d<_0x481005;_0x23457d++){var _0x2779bd=events[_0x23457d];var _0x156b83=createListener('mailAccount:'+_0x2779bd,_0x4acb6b);MailAccountEvents['on'](_0x2779bd,_0x156b83);}}; \ No newline at end of file +var _0xf3a8=['length','mailAccount:','save','remove','emit','register'];(function(_0x5db96a,_0x60039){var _0x13fdb0=function(_0x1efab0){while(--_0x1efab0){_0x5db96a['push'](_0x5db96a['shift']());}};_0x13fdb0(++_0x60039);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x224d19,_0x39cde7){_0x224d19=_0x224d19-0x0;var _0x212137=_0xf3a8[_0x224d19];return _0x212137;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8f3a('0x0'),_0x8f3a('0x1'),'update'];function createListener(_0xa87ecd,_0x4a1bc3){return function(_0x5c0cbb){_0x4a1bc3[_0x8f3a('0x2')](_0xa87ecd,_0x5c0cbb);};}function removeListener(_0x48673f,_0x38fe23){return function(){MailAccountEvents['removeListener'](_0x48673f,_0x38fe23);};}exports[_0x8f3a('0x3')]=function(_0x3d6e2d){for(var _0x109997=0x0,_0x32bb3a=events[_0x8f3a('0x4')];_0x109997<_0x32bb3a;_0x109997++){var _0x2e290d=events[_0x109997];var _0x3dc1ea=createListener(_0x8f3a('0x5')+_0x2e290d,_0x3d6e2d);MailAccountEvents['on'](_0x2e290d,_0x3dc1ea);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 24c449e..697cb5a 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 _0xc09a=['../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c5e5f,_0x1fa571){var _0x2ec49b=function(_0x5b1dfb){while(--_0x5b1dfb){_0x4c5e5f['push'](_0x4c5e5f['shift']());}};_0x2ec49b(++_0x1fa571);}(_0xc09a,0x109));var _0xac09=function(_0x51e647,_0x587396){_0x51e647=_0x51e647-0x0;var _0x4df594=_0xc09a[_0x51e647];return _0x4df594;};'use strict';var multer=require(_0xac09('0x0'));var util=require('util');var path=require(_0xac09('0x1'));var timeout=require(_0xac09('0x2'));var express=require(_0xac09('0x3'));var router=express[_0xac09('0x4')]();var fs_extra=require(_0xac09('0x5'));var auth=require(_0xac09('0x6'));var interaction=require(_0xac09('0x7'));var config=require(_0xac09('0x8'));var controller=require(_0xac09('0x9'));router['get'](_0xac09('0xa'),auth[_0xac09('0xb')](),controller[_0xac09('0xc')]);router['put'](_0xac09('0xa'),auth[_0xac09('0xb')](),controller[_0xac09('0xd')]);router[_0xac09('0xe')](_0xac09('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xac09('0xf')]=router; \ No newline at end of file +var _0x4d85=['get','/:id','isAuthenticated','show','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x440133,_0x9576ce){var _0x3847b8=function(_0x9b3d76){while(--_0x9b3d76){_0x440133['push'](_0x440133['shift']());}};_0x3847b8(++_0x9576ce);}(_0x4d85,0x15c));var _0x54d8=function(_0x3aaa0f,_0x24d22f){_0x3aaa0f=_0x3aaa0f-0x0;var _0x555de6=_0x4d85[_0x3aaa0f];return _0x555de6;};'use strict';var multer=require('multer');var util=require(_0x54d8('0x0'));var path=require(_0x54d8('0x1'));var timeout=require('connect-timeout');var express=require(_0x54d8('0x2'));var router=express[_0x54d8('0x3')]();var fs_extra=require(_0x54d8('0x4'));var auth=require(_0x54d8('0x5'));var interaction=require(_0x54d8('0x6'));var config=require(_0x54d8('0x7'));var controller=require(_0x54d8('0x8'));router[_0x54d8('0x9')](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xc')]);router[_0x54d8('0xd')](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xe')]);router['delete'](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xf')]);module[_0x54d8('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4189dad..df344b8 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 _0x659b=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x241d6e,_0x321da3){var _0x4e2dcd=function(_0x29d145){while(--_0x29d145){_0x241d6e['push'](_0x241d6e['shift']());}};_0x4e2dcd(++_0x321da3);}(_0x659b,0x7a));var _0xb659=function(_0xb84e49,_0x1dcf54){_0xb84e49=_0xb84e49-0x0;var _0x37dba4=_0x659b[_0xb84e49];return _0x37dba4;};'use strict';var Sequelize=require(_0xb659('0x0'));module[_0xb659('0x1')]={'priority':{'type':Sequelize[_0xb659('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb659('0x3')],'allowNull':![],'defaultValue':_0xb659('0x4')},'appdata':{'type':Sequelize[_0xb659('0x5')]()},'description':{'type':Sequelize[_0xb659('0x3')]},'interval':{'type':Sequelize[_0xb659('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x53b8=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0xffc56b,_0x5caa71){var _0xa0731b=function(_0x2f8357){while(--_0x2f8357){_0xffc56b['push'](_0xffc56b['shift']());}};_0xa0731b(++_0x5caa71);}(_0x53b8,0xf8));var _0x853b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x53b8[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x853b('0x0'));module[_0x853b('0x1')]={'priority':{'type':Sequelize[_0x853b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x853b('0x3')]()},'description':{'type':Sequelize[_0x853b('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x853b('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e2e042a..da9e9b8 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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x15bd28,_0x5a0758){var _0x3a3e0d=function(_0x2ade52){while(--_0x2ade52){_0x15bd28['push'](_0x15bd28['shift']());}};_0x3a3e0d(++_0x5a0758);}(_0xac4a,0x13f));var _0xaac4=function(_0x44714f,_0x3403b7){_0x44714f=_0x44714f-0x0;var _0x582a55=_0xac4a[_0x44714f];return _0x582a55;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x14647d,_0x20a244){var _0x3a0cae=function(_0x6f6909){while(--_0x6f6909){_0x14647d['push'](_0x14647d['shift']());}};_0x3a0cae(++_0x20a244);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 21cab3b..da014a0 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 _0x920e=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','rimraf','./mailApplication.attributes','exports'];(function(_0x779479,_0x19e8b0){var _0x1a1c68=function(_0x4038c7){while(--_0x4038c7){_0x779479['push'](_0x779479['shift']());}};_0x1a1c68(++_0x19e8b0);}(_0x920e,0x95));var _0xe920=function(_0x4b8076,_0x46942f){_0x4b8076=_0x4b8076-0x0;var _0x12587c=_0x920e[_0x4b8076];return _0x12587c;};'use strict';var _=require(_0xe920('0x0'));var util=require(_0xe920('0x1'));var logger=require(_0xe920('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe920('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe920('0x4'));var config=require('../../config/environment');var attributes=require(_0xe920('0x5'));module[_0xe920('0x6')]=function(_0x2128d5,_0x315068){return _0x2128d5[_0xe920('0x7')](_0xe920('0x8'),attributes,{'tableName':_0xe920('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe920('0xa'),'collate':_0xe920('0xb')});}; \ No newline at end of file +var _0x7597=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x5a704d,_0x4082d8){var _0x1f76e1=function(_0x3d20c0){while(--_0x3d20c0){_0x5a704d['push'](_0x5a704d['shift']());}};_0x1f76e1(++_0x4082d8);}(_0x7597,0x1c5));var _0x7759=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x7597[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x7759('0x0'));var util=require('util');var logger=require(_0x7759('0x1'))(_0x7759('0x2'));var moment=require(_0x7759('0x3'));var BPromise=require('bluebird');var rp=require(_0x7759('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7759('0x5'));var config=require(_0x7759('0x6'));var attributes=require(_0x7759('0x7'));module[_0x7759('0x8')]=function(_0x1cf28a,_0x3d0457){return _0x1cf28a[_0x7759('0x9')](_0x7759('0xa'),attributes,{'tableName':_0x7759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7759('0xc'),'collate':_0x7759('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index a0217c6..3391d19 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 _0x3e7c=['../../config/logger','../../config/environment','client','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x395ced,_0x224968){var _0x3c28dc=function(_0x2812a5){while(--_0x2812a5){_0x395ced['push'](_0x395ced['shift']());}};_0x3c28dc(++_0x224968);}(_0x3e7c,0xe9));var _0xc3e7=function(_0x3fcee3,_0x373067){_0x3fcee3=_0x3fcee3-0x0;var _0x1b1324=_0x3e7c[_0x3fcee3];return _0x1b1324;};'use strict';var _=require(_0xc3e7('0x0'));var util=require(_0xc3e7('0x1'));var moment=require(_0xc3e7('0x2'));var BPromise=require(_0xc3e7('0x3'));var rs=require(_0xc3e7('0x4'));var fs=require('fs');var Redis=require(_0xc3e7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3e7('0x6'));var logger=require(_0xc3e7('0x7'))('rpc');var config=require(_0xc3e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc3e7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eb28d,_0x3c4174,_0x263df0){return new BPromise(function(_0x5cb1d8,_0x2cd5b7){return client[_0xc3e7('0xa')](_0x2eb28d,_0x263df0)[_0xc3e7('0xb')](function(_0x37ff04){logger['info'](_0xc3e7('0xc'),_0x3c4174,_0xc3e7('0xd'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x3c4174,_0xc3e7('0xd'),JSON[_0xc3e7('0xe')](_0x37ff04));if(_0x37ff04[_0xc3e7('0xf')]){if(_0x37ff04[_0xc3e7('0xf')][_0xc3e7('0x10')]===0x1f4){logger[_0xc3e7('0xf')](_0xc3e7('0xc'),_0x3c4174,_0x37ff04[_0xc3e7('0xf')][_0xc3e7('0x11')]);return _0x2cd5b7(_0x37ff04[_0xc3e7('0xf')][_0xc3e7('0x11')]);}logger[_0xc3e7('0xf')](_0xc3e7('0xc'),_0x3c4174,_0x37ff04[_0xc3e7('0xf')][_0xc3e7('0x11')]);return _0x5cb1d8(_0x37ff04[_0xc3e7('0xf')][_0xc3e7('0x11')]);}else{logger[_0xc3e7('0x12')]('MailApplication,\x20%s,\x20%s',_0x3c4174,_0xc3e7('0xd'));_0x5cb1d8(_0x37ff04['result'][_0xc3e7('0x11')]);}})[_0xc3e7('0x13')](function(_0x26bcc1){logger['error'](_0xc3e7('0xc'),_0x3c4174,_0x26bcc1);_0x2cd5b7(_0x26bcc1);});});}exports[_0xc3e7('0x14')]=function(_0x3628ab){var _0x5e1a06=this;return new Promise(function(_0x3161a7,_0x1b9b19){return db[_0xc3e7('0x15')][_0xc3e7('0x16')](_0x3628ab[_0xc3e7('0x17')],{'raw':_0x3628ab[_0xc3e7('0x18')]?_0x3628ab['options'][_0xc3e7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3628ab[_0xc3e7('0x18')]?_0x3628ab[_0xc3e7('0x18')][_0xc3e7('0x1a')]||null:null,'attributes':_0x3628ab[_0xc3e7('0x18')]?_0x3628ab[_0xc3e7('0x18')][_0xc3e7('0x1b')]||null:null,'limit':_0x3628ab['options']?_0x3628ab[_0xc3e7('0x18')][_0xc3e7('0x1c')]||null:null})[_0xc3e7('0xb')](function(_0x10c320){logger['info'](_0xc3e7('0x14'),_0x3628ab);logger[_0xc3e7('0x1d')](_0xc3e7('0x14'),_0x3628ab,JSON[_0xc3e7('0xe')](_0x10c320));_0x3161a7(_0x10c320);})[_0xc3e7('0x13')](function(_0x2d4ded){logger[_0xc3e7('0xf')]('UpdateMailApplication',_0x2d4ded['message'],_0x3628ab);_0x1b9b19(_0x5e1a06[_0xc3e7('0xf')](0x1f4,_0x2d4ded[_0xc3e7('0x11')]));});});}; \ No newline at end of file +var _0x67ac=['debug','stringify','error','code','message','UpdateMailApplication','MailApplication','update','options','where','attributes','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0xe4852c,_0x1e02f8){var _0x405528=function(_0x45be74){while(--_0x45be74){_0xe4852c['push'](_0xe4852c['shift']());}};_0x405528(++_0x1e02f8);}(_0x67ac,0x7d));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc67a('0x0'));var util=require(_0xc67a('0x1'));var moment=require('moment');var BPromise=require(_0xc67a('0x2'));var rs=require(_0xc67a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc67a('0x4'))['db'];var utils=require(_0xc67a('0x5'));var logger=require('../../config/logger')(_0xc67a('0x6'));var config=require(_0xc67a('0x7'));var jayson=require(_0xc67a('0x8'));var client=jayson[_0xc67a('0x9')][_0xc67a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x79f6a5,_0x15b580,_0x880820){return new BPromise(function(_0x566008,_0x47126a){return client['request'](_0x79f6a5,_0x880820)[_0xc67a('0xb')](function(_0x3897f7){logger[_0xc67a('0xc')](_0xc67a('0xd'),_0x15b580,_0xc67a('0xe'));logger[_0xc67a('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x15b580,_0xc67a('0xe'),JSON[_0xc67a('0x10')](_0x3897f7));if(_0x3897f7[_0xc67a('0x11')]){if(_0x3897f7[_0xc67a('0x11')][_0xc67a('0x12')]===0x1f4){logger['error'](_0xc67a('0xd'),_0x15b580,_0x3897f7[_0xc67a('0x11')][_0xc67a('0x13')]);return _0x47126a(_0x3897f7[_0xc67a('0x11')]['message']);}logger[_0xc67a('0x11')](_0xc67a('0xd'),_0x15b580,_0x3897f7[_0xc67a('0x11')][_0xc67a('0x13')]);return _0x566008(_0x3897f7['error'][_0xc67a('0x13')]);}else{logger[_0xc67a('0xc')](_0xc67a('0xd'),_0x15b580,'request\x20sent');_0x566008(_0x3897f7['result'][_0xc67a('0x13')]);}})['catch'](function(_0x5b6a60){logger['error'](_0xc67a('0xd'),_0x15b580,_0x5b6a60);_0x47126a(_0x5b6a60);});});}exports[_0xc67a('0x14')]=function(_0x4506ab){var _0x48fe21=this;return new Promise(function(_0x3d23d6,_0x2ff426){return db[_0xc67a('0x15')][_0xc67a('0x16')](_0x4506ab['body'],{'raw':_0x4506ab[_0xc67a('0x17')]?_0x4506ab['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4506ab['options']?_0x4506ab[_0xc67a('0x17')][_0xc67a('0x18')]||null:null,'attributes':_0x4506ab['options']?_0x4506ab['options'][_0xc67a('0x19')]||null:null,'limit':_0x4506ab[_0xc67a('0x17')]?_0x4506ab[_0xc67a('0x17')][_0xc67a('0x1a')]||null:null})[_0xc67a('0xb')](function(_0x5a81b6){logger[_0xc67a('0xc')]('UpdateMailApplication',_0x4506ab);logger[_0xc67a('0xf')](_0xc67a('0x14'),_0x4506ab,JSON[_0xc67a('0x10')](_0x5a81b6));_0x3d23d6(_0x5a81b6);})[_0xc67a('0x1b')](function(_0x1e3a0d){logger[_0xc67a('0x11')]('UpdateMailApplication',_0x1e3a0d[_0xc67a('0x13')],_0x4506ab);_0x2ff426(_0x48fe21['error'](0x1f4,_0x1e3a0d[_0xc67a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c359fa6..4cccafc 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 _0x6989=['Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','/:id','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy'];(function(_0x5ba549,_0x425afd){var _0x36e3a1=function(_0x464308){while(--_0x464308){_0x5ba549['push'](_0x5ba549['shift']());}};_0x36e3a1(++_0x425afd);}(_0x6989,0xc0));var _0x9698=function(_0x24516c,_0x59fcd8){_0x24516c=_0x24516c-0x0;var _0xaf2987=_0x6989[_0x24516c];return _0xaf2987;};'use strict';var express=require('express');var router=express[_0x9698('0x0')]();var auth=require(_0x9698('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x9698('0x2'));router[_0x9698('0x3')]('/',auth[_0x9698('0x4')](),controller[_0x9698('0x5')]);router[_0x9698('0x3')]('/describe',auth[_0x9698('0x4')](),controller[_0x9698('0x6')]);router[_0x9698('0x3')]('/:id',auth[_0x9698('0x4')](),controller['show']);router[_0x9698('0x3')](_0x9698('0x7'),auth[_0x9698('0x4')](),controller[_0x9698('0x8')]);router[_0x9698('0x3')](_0x9698('0x9'),auth[_0x9698('0x4')](),controller[_0x9698('0xa')]);router[_0x9698('0xb')]('/',auth[_0x9698('0x4')](),controller[_0x9698('0xc')]);router[_0x9698('0xb')](_0x9698('0x7'),auth[_0x9698('0x4')](),controller[_0x9698('0xd')]);router[_0x9698('0xb')](_0x9698('0xe'),auth[_0x9698('0x4')](),interaction[_0x9698('0xf')]('mail',_0x9698('0x10')),controller['addTags']);router['put'](_0x9698('0x11'),auth[_0x9698('0x4')](),interaction[_0x9698('0xf')](_0x9698('0x12'),_0x9698('0x13')),controller[_0x9698('0x14')]);router[_0x9698('0x15')](_0x9698('0x11'),auth[_0x9698('0x4')](),interaction[_0x9698('0xf')](_0x9698('0x12'),_0x9698('0x16')),controller[_0x9698('0x17')]);router[_0x9698('0x15')](_0x9698('0xe'),auth[_0x9698('0x4')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x3c62=['./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','update','delete','mailinteraction:destroy','destroy','removeTags','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34d387,_0xdfae87){var _0xdff3b0=function(_0x295861){while(--_0x295861){_0x34d387['push'](_0x34d387['shift']());}};_0xdff3b0(++_0xdfae87);}(_0x3c62,0x99));var _0x23c6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3c62[_0x491a7f];return _0x3d8f44;};'use strict';var express=require('express');var router=express[_0x23c6('0x0')]();var auth=require(_0x23c6('0x1'));var interaction=require(_0x23c6('0x2'));var controller=require(_0x23c6('0x3'));router[_0x23c6('0x4')]('/',auth[_0x23c6('0x5')](),controller['index']);router[_0x23c6('0x4')](_0x23c6('0x6'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x7')]);router[_0x23c6('0x4')](_0x23c6('0x8'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x9')]);router[_0x23c6('0x4')](_0x23c6('0xa'),auth['isAuthenticated'](),controller[_0x23c6('0xb')]);router['get']('/:id/download',auth[_0x23c6('0x5')](),controller[_0x23c6('0xc')]);router[_0x23c6('0xd')]('/',auth['isAuthenticated'](),controller[_0x23c6('0xe')]);router['post'](_0x23c6('0xa'),auth[_0x23c6('0x5')](),controller[_0x23c6('0xf')]);router[_0x23c6('0xd')](_0x23c6('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x23c6('0x11'),_0x23c6('0x12')),controller[_0x23c6('0x13')]);router['put'](_0x23c6('0x8'),auth[_0x23c6('0x5')](),interaction[_0x23c6('0x14')]('mail','mailinteraction:update'),controller[_0x23c6('0x15')]);router[_0x23c6('0x16')]('/:id',auth[_0x23c6('0x5')](),interaction[_0x23c6('0x14')](_0x23c6('0x11'),_0x23c6('0x17')),controller[_0x23c6('0x18')]);router[_0x23c6('0x16')](_0x23c6('0x10'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 043b382..5bc6195 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 _0x4c60=['exports','BOOLEAN','STRING','TEXT','DATE','ENUM','out','sequelize','iconv'];(function(_0x4f50cc,_0xb95ef4){var _0xb188b1=function(_0x1addd4){while(--_0x1addd4){_0x4f50cc['push'](_0x4f50cc['shift']());}};_0xb188b1(++_0xb95ef4);}(_0x4c60,0x166));var _0x04c6=function(_0x915b3b,_0x517194){_0x915b3b=_0x915b3b-0x0;var _0x157ad3=_0x4c60[_0x915b3b];return _0x157ad3;};'use strict';var Sequelize=require(_0x04c6('0x0'));var iconv=require(_0x04c6('0x1'));module[_0x04c6('0x2')]={'closed':{'type':Sequelize[_0x04c6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x04c6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x04c6('0x4')]},'inReplyTo':{'type':Sequelize[_0x04c6('0x4')](0x1fe)},'to':{'type':Sequelize[_0x04c6('0x4')]},'cc':{'type':Sequelize[_0x04c6('0x5')]('long')},'subject':{'type':Sequelize[_0x04c6('0x5')]()},'attach':{'type':Sequelize[_0x04c6('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x04c6('0x6')]},'substatus':{'type':Sequelize[_0x04c6('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x04c6('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x04c6('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x04c6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x04c6('0x7')]('in',_0x04c6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x04c6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6fff=['DATE','STRING','TEXT','long','out','ENUM','iconv','BOOLEAN'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0x6fff,0x1ce));var _0xf6ff=function(_0x2e459b,_0x124329){_0x2e459b=_0x2e459b-0x0;var _0x20c3e9=_0x6fff[_0x2e459b];return _0x20c3e9;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf6ff('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf6ff('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf6ff('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf6ff('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf6ff('0x3')]},'inReplyTo':{'type':Sequelize[_0xf6ff('0x3')](0x1fe)},'to':{'type':Sequelize[_0xf6ff('0x3')]},'cc':{'type':Sequelize[_0xf6ff('0x4')](_0xf6ff('0x5'))},'subject':{'type':Sequelize[_0xf6ff('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf6ff('0x2')]},'substatus':{'type':Sequelize[_0xf6ff('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf6ff('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf6ff('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf6ff('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf6ff('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 911f37d..eba68fc 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 _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb10b,0x12a));var _0xbb10=function(_0x51070b,_0x39c85d){_0x51070b=_0x51070b-0x0;var _0x153240=_0xb10b[_0x51070b];return _0x153240;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x2dbd12,_0x3eedd2){_0x2dbd12=_0x2dbd12-0x0;var _0x378a8=_0xb10b[_0x2dbd12];return _0x378a8;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d7ee4aa..20211c2 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 _0xaf4a=['MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb'];(function(_0x380515,_0x112aa0){var _0x19d43e=function(_0x4497b0){while(--_0x4497b0){_0x380515['push'](_0x380515['shift']());}};_0x19d43e(++_0x112aa0);}(_0xaf4a,0xf6));var _0xaaf4=function(_0xbe8802,_0x3babad){_0xbe8802=_0xbe8802-0x0;var _0x1fae7b=_0xaf4a[_0xbe8802];return _0x1fae7b;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xaaf4('0x0'))['db'][_0xaaf4('0x1')];var MailMessage=require(_0xaaf4('0x0'))['db'][_0xaaf4('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xaaf4('0x3')](0x0);var events={'afterCreate':_0xaaf4('0x4'),'afterUpdate':_0xaaf4('0x5'),'afterDestroy':_0xaaf4('0x6')};function emitEvent(_0x2122d6){return function(_0x76b73c,_0x3a1877,_0x3ac056){_0x76b73c[_0xaaf4('0x7')]({'attributes':['id'],'raw':!![]})[_0xaaf4('0x8')](function(_0x1493b1){_0x76b73c[_0xaaf4('0x9')](_0xaaf4('0xa'),_0x1493b1[_0xaaf4('0xb')](function(_0x32a162){return{'id':_0x32a162['id']};}));return MailMessage[_0xaaf4('0xc')]({'where':{'MailInteractionId':_0x76b73c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaaf4('0x8')](function(_0x31a00f){_0x76b73c[_0xaaf4('0x9')](_0xaaf4('0xd'),_0x31a00f[_0xaaf4('0xe')]);MailInteractionEvents[_0xaaf4('0xf')](_0x2122d6+':'+_0x76b73c['id'],_0x76b73c);MailInteractionEvents[_0xaaf4('0xf')](_0x2122d6,_0x76b73c);_0x3ac056(null);})[_0xaaf4('0x10')](_0x3ac056(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xaaf4('0x11')](e,emitEvent(event));}}module[_0xaaf4('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x9ef2=['hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0x9ef2,0xdb));var _0x29ef=function(_0x2359a3,_0x39fac1){_0x2359a3=_0x2359a3-0x0;var _0x4d4e3b=_0x9ef2[_0x2359a3];return _0x4d4e3b;};'use strict';var EventEmitter=require(_0x29ef('0x0'));var MailInteraction=require(_0x29ef('0x1'))['db'][_0x29ef('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x29ef('0x3')](0x0);var events={'afterCreate':_0x29ef('0x4'),'afterUpdate':_0x29ef('0x5'),'afterDestroy':_0x29ef('0x6')};function emitEvent(_0x559da7){return function(_0x576e48,_0x5381f6,_0x1e74ed){_0x576e48['getUsers']({'attributes':['id'],'raw':!![]})[_0x29ef('0x7')](function(_0x348647){_0x576e48[_0x29ef('0x8')](_0x29ef('0x9'),_0x348647[_0x29ef('0xa')](function(_0x239ae6){return{'id':_0x239ae6['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x576e48['id'],'direction':'in','read':![]},'raw':!![]});})[_0x29ef('0x7')](function(_0x445aed){_0x576e48[_0x29ef('0x8')](_0x29ef('0xb'),_0x445aed[_0x29ef('0xc')]);MailInteractionEvents[_0x29ef('0xd')](_0x559da7+':'+_0x576e48['id'],_0x576e48);MailInteractionEvents[_0x29ef('0xd')](_0x559da7,_0x576e48);_0x1e74ed(null);})[_0x29ef('0xe')](_0x1e74ed(null));};}for(var e in events){if(events[_0x29ef('0xf')](e)){var event=events[e];MailInteraction[_0x29ef('0x10')](e,emitEvent(event));}}module[_0x29ef('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 387d7fe..3a2d235 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 _0x5b15=['catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','then'];(function(_0x39347c,_0x79842f){var _0x438a63=function(_0x2a0e02){while(--_0x2a0e02){_0x39347c['push'](_0x39347c['shift']());}};_0x438a63(++_0x79842f);}(_0x5b15,0x98));var _0x55b1=function(_0x5f1047,_0x499598){_0x5f1047=_0x5f1047-0x0;var _0x1eb31a=_0x5b15[_0x5f1047];return _0x1eb31a;};'use strict';var _=require(_0x55b1('0x0'));var util=require('util');var logger=require(_0x55b1('0x1'))(_0x55b1('0x2'));var moment=require(_0x55b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x55b1('0x4'));var fs=require('fs');var path=require(_0x55b1('0x5'));var rimraf=require(_0x55b1('0x6'));var config=require(_0x55b1('0x7'));var attributes=require(_0x55b1('0x8'));module['exports']=function(_0x5ee188,_0x29e903){return _0x5ee188[_0x55b1('0x9')](_0x55b1('0xa'),attributes,{'tableName':_0x55b1('0xb'),'paranoid':![],'indexes':[{'name':_0x55b1('0xc'),'fields':[_0x55b1('0xd'),'to'],'type':_0x55b1('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x455fd9,_0x4256a9,_0x451fa6){if(_0x455fd9[_0x55b1('0xf')]){_0x455fd9[_0x55b1('0x10')]=moment()[_0x55b1('0x11')](_0x55b1('0x12'));}if(_0x455fd9[_0x55b1('0x13')]){_0x455fd9[_0x55b1('0x14')]=moment()['format'](_0x55b1('0x12'));}_0x451fa6(null,_0x4256a9);},'beforeUpdate':function(_0x1b461d,_0x137070,_0x15d6c5){if(_0x1b461d[_0x55b1('0x15')](_0x55b1('0xf'))){_0x1b461d[_0x55b1('0x10')]=_0x1b461d[_0x55b1('0xf')]?moment()[_0x55b1('0x11')](_0x55b1('0x12')):null;}if(_0x1b461d[_0x55b1('0x15')](_0x55b1('0x13'))){_0x1b461d[_0x55b1('0x14')]=moment()[_0x55b1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b461d['substatus']=null;_0x1b461d[_0x55b1('0x10')]=null;}_0x15d6c5(null,_0x1b461d);},'afterUpdate':function(_0x42c887,_0xc9c0f4,_0x40d727){var _0x40f6aa=_0x5ee188['models'];var _0x5d939f=_0x42c887['get']({'plain':!![]});if(_0x5d939f[_0x55b1('0x13')]){return _0x40f6aa['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x5d939f['id']}})[_0x55b1('0x16')](function(){_0x40d727();})[_0x55b1('0x17')](function(_0x3133f6){_0x40d727(_0x3133f6);});}else{_0x40d727();}}},'charset':'utf8mb4','collate':_0x55b1('0x18')});}; \ No newline at end of file +var _0x68c5=['substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT'];(function(_0x41a8f5,_0x2ab807){var _0x25fb25=function(_0xd197a4){while(--_0xd197a4){_0x41a8f5['push'](_0x41a8f5['shift']());}};_0x25fb25(++_0x2ab807);}(_0x68c5,0x101));var _0x568c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x68c5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x568c('0x0'));var util=require(_0x568c('0x1'));var logger=require(_0x568c('0x2'))(_0x568c('0x3'));var moment=require('moment');var BPromise=require(_0x568c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x568c('0x5'));var rimraf=require(_0x568c('0x6'));var config=require(_0x568c('0x7'));var attributes=require(_0x568c('0x8'));module['exports']=function(_0x1b5731,_0x43bdb0){return _0x1b5731['define'](_0x568c('0x9'),attributes,{'tableName':_0x568c('0xa'),'paranoid':![],'indexes':[{'name':_0x568c('0xb'),'fields':['subject','to'],'type':_0x568c('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23e9c4,_0x2ca484,_0x23c9db){if(_0x23e9c4[_0x568c('0xd')]){_0x23e9c4[_0x568c('0xe')]=moment()['format'](_0x568c('0xf'));}if(_0x23e9c4['closed']){_0x23e9c4[_0x568c('0x10')]=moment()[_0x568c('0x11')](_0x568c('0xf'));}_0x23c9db(null,_0x2ca484);},'beforeUpdate':function(_0x4f525c,_0x6a1945,_0x108e30){if(_0x4f525c[_0x568c('0x12')](_0x568c('0xd'))){_0x4f525c[_0x568c('0xe')]=_0x4f525c[_0x568c('0xd')]?moment()['format'](_0x568c('0xf')):null;}if(_0x4f525c['changed'](_0x568c('0x13'))){_0x4f525c[_0x568c('0x10')]=moment()[_0x568c('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f525c['substatus']=null;_0x4f525c['substatusAt']=null;}_0x108e30(null,_0x4f525c);},'afterUpdate':function(_0x32b194,_0x578312,_0xf5f273){var _0x2ae06b=_0x1b5731['models'];var _0x400c96=_0x32b194[_0x568c('0x14')]({'plain':!![]});if(_0x400c96[_0x568c('0x13')]){return _0x2ae06b[_0x568c('0x15')][_0x568c('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x400c96['id']}})[_0x568c('0x17')](function(){_0xf5f273();})[_0x568c('0x18')](function(_0x42e4d1){_0xf5f273(_0x42e4d1);});}else{_0xf5f273();}}},'charset':_0x568c('0x19'),'collate':_0x568c('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 04496a7..865b179 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 _0xe47d=['MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xe47d,0x1c5));var _0xde47=function(_0x46f4bb,_0x7dc8a9){_0x46f4bb=_0x46f4bb-0x0;var _0x29f2af=_0xe47d[_0x46f4bb];return _0x29f2af;};'use strict';var _=require(_0xde47('0x0'));var util=require(_0xde47('0x1'));var moment=require(_0xde47('0x2'));var BPromise=require(_0xde47('0x3'));var rs=require(_0xde47('0x4'));var fs=require('fs');var Redis=require(_0xde47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xde47('0x6'));var logger=require(_0xde47('0x7'))(_0xde47('0x8'));var config=require(_0xde47('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde47('0xa')]['http']({'port':0x232a});config[_0xde47('0xb')]=_[_0xde47('0xc')](config[_0xde47('0xb')],{'host':_0xde47('0xd'),'port':0x18eb});var socket=require(_0xde47('0xe'))(new Redis(config['redis']));require(_0xde47('0xf'))[_0xde47('0x10')](socket);function respondWithRpcPromise(_0x3afd04,_0x300fa1,_0x386352){return new BPromise(function(_0x16cdda,_0x2f2b56){return client[_0xde47('0x11')](_0x3afd04,_0x386352)[_0xde47('0x12')](function(_0x4f3117){logger[_0xde47('0x13')]('MailInteraction,\x20%s,\x20%s',_0x300fa1,_0xde47('0x14'));logger[_0xde47('0x15')](_0xde47('0x16'),_0x300fa1,'request\x20sent',JSON[_0xde47('0x17')](_0x4f3117));if(_0x4f3117[_0xde47('0x18')]){if(_0x4f3117['error'][_0xde47('0x19')]===0x1f4){logger[_0xde47('0x18')](_0xde47('0x1a'),_0x300fa1,_0x4f3117[_0xde47('0x18')][_0xde47('0x1b')]);return _0x2f2b56(_0x4f3117[_0xde47('0x18')][_0xde47('0x1b')]);}logger[_0xde47('0x18')](_0xde47('0x1a'),_0x300fa1,_0x4f3117[_0xde47('0x18')][_0xde47('0x1b')]);return _0x16cdda(_0x4f3117[_0xde47('0x18')][_0xde47('0x1b')]);}else{logger['info'](_0xde47('0x1a'),_0x300fa1,_0xde47('0x14'));_0x16cdda(_0x4f3117[_0xde47('0x1c')][_0xde47('0x1b')]);}})[_0xde47('0x1d')](function(_0x4911bc){logger[_0xde47('0x18')](_0xde47('0x1a'),_0x300fa1,_0x4911bc);_0x2f2b56(_0x4911bc);});});}exports[_0xde47('0x1e')]=function(_0x13cf94){var _0x32b1b3=this;return new Promise(function(_0x1d8c4f,_0x9491be){return db[_0xde47('0x1f')][_0xde47('0x20')](_0x13cf94[_0xde47('0x21')],{'raw':_0x13cf94[_0xde47('0x22')]?_0x13cf94[_0xde47('0x22')][_0xde47('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13cf94['options']?_0x13cf94[_0xde47('0x22')][_0xde47('0x24')]||null:null,'attributes':_0x13cf94[_0xde47('0x22')]?_0x13cf94[_0xde47('0x22')]['attributes']||null:null,'limit':_0x13cf94[_0xde47('0x22')]?_0x13cf94[_0xde47('0x22')][_0xde47('0x25')]||null:null})[_0xde47('0x12')](function(_0x9fcbed){logger[_0xde47('0x13')]('UpdateMailInteraction',_0x13cf94);logger[_0xde47('0x15')]('UpdateMailInteraction',_0x13cf94,JSON[_0xde47('0x17')](_0x9fcbed));_0x1d8c4f(_0x9fcbed);})['catch'](function(_0xc62040){logger['error'](_0xde47('0x1e'),_0xc62040[_0xde47('0x1b')],_0x13cf94);_0x9491be(_0x32b1b3[_0xde47('0x18')](0x1f4,_0xc62040[_0xde47('0x1b')]));});});};exports[_0xde47('0x26')]=function(_0x153f47){return new Promise(function(_0x5b71a7,_0x530b54){return db[_0xde47('0x1f')][_0xde47('0x27')]({'where':_0x153f47[_0xde47('0x22')]?_0x153f47[_0xde47('0x22')][_0xde47('0x24')]||null:null})['then'](function(_0x251814){if(_0x251814){return _0x251814['addTags'](_0x153f47[_0xde47('0x21')][_0xde47('0x28')],_[_0xde47('0x29')](_0x153f47['body'],[_0xde47('0x28'),'id'])||{});}})[_0xde47('0x2a')](function(_0x55bb26){logger[_0xde47('0x13')](_0xde47('0x2b'),_0x153f47);logger[_0xde47('0x15')]('AddTags',_0x153f47,JSON[_0xde47('0x17')](_0x55bb26));_0x5b71a7(_0x55bb26);})[_0xde47('0x1d')](function(_0x6b76e){logger['error'](_0xde47('0x2b'),_0x6b76e[_0xde47('0x1b')],_0x153f47);_0x530b54(_this[_0xde47('0x18')](0x1f4,_0x6b76e[_0xde47('0x1b')]));});});}; \ No newline at end of file +var _0x7e69=['options','where','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./mailInteraction.socket','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','update','body'];(function(_0x4c61c8,_0x2f5ccc){var _0x41e34a=function(_0xe091dd){while(--_0xe091dd){_0x4c61c8['push'](_0x4c61c8['shift']());}};_0x41e34a(++_0x2f5ccc);}(_0x7e69,0x1b8));var _0x97e6=function(_0x3055ab,_0x4d1f74){_0x3055ab=_0x3055ab-0x0;var _0x31d336=_0x7e69[_0x3055ab];return _0x31d336;};'use strict';var _=require(_0x97e6('0x0'));var util=require('util');var moment=require(_0x97e6('0x1'));var BPromise=require(_0x97e6('0x2'));var rs=require(_0x97e6('0x3'));var fs=require('fs');var Redis=require(_0x97e6('0x4'));var db=require(_0x97e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97e6('0x6'))(_0x97e6('0x7'));var config=require(_0x97e6('0x8'));var jayson=require(_0x97e6('0x9'));var client=jayson['client'][_0x97e6('0xa')]({'port':0x232a});config[_0x97e6('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x97e6('0xc'))(new Redis(config['redis']));require(_0x97e6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5db1a6,_0x2a0d39,_0x3c5603){return new BPromise(function(_0x33e80c,_0x334a16){return client['request'](_0x5db1a6,_0x3c5603)[_0x97e6('0xe')](function(_0x5bd156){logger[_0x97e6('0xf')]('MailInteraction,\x20%s,\x20%s',_0x2a0d39,_0x97e6('0x10'));logger[_0x97e6('0x11')](_0x97e6('0x12'),_0x2a0d39,_0x97e6('0x10'),JSON[_0x97e6('0x13')](_0x5bd156));if(_0x5bd156['error']){if(_0x5bd156[_0x97e6('0x14')][_0x97e6('0x15')]===0x1f4){logger['error'](_0x97e6('0x16'),_0x2a0d39,_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);return _0x334a16(_0x5bd156['error'][_0x97e6('0x17')]);}logger[_0x97e6('0x14')](_0x97e6('0x16'),_0x2a0d39,_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);return _0x33e80c(_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);}else{logger[_0x97e6('0xf')](_0x97e6('0x16'),_0x2a0d39,'request\x20sent');_0x33e80c(_0x5bd156['result'][_0x97e6('0x17')]);}})[_0x97e6('0x18')](function(_0x194b40){logger[_0x97e6('0x14')](_0x97e6('0x16'),_0x2a0d39,_0x194b40);_0x334a16(_0x194b40);});});}exports[_0x97e6('0x19')]=function(_0x3e8c39){var _0x27e68d=this;return new Promise(function(_0x43a874,_0x199058){return db['MailInteraction'][_0x97e6('0x1a')](_0x3e8c39[_0x97e6('0x1b')],{'raw':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')][_0x97e6('0x1d')]||null:null,'attributes':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['attributes']||null:null,'limit':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['limit']||null:null})[_0x97e6('0xe')](function(_0x9364fd){logger[_0x97e6('0xf')]('UpdateMailInteraction',_0x3e8c39);logger[_0x97e6('0x11')](_0x97e6('0x19'),_0x3e8c39,JSON[_0x97e6('0x13')](_0x9364fd));_0x43a874(_0x9364fd);})['catch'](function(_0x16c0ad){logger[_0x97e6('0x14')]('UpdateMailInteraction',_0x16c0ad['message'],_0x3e8c39);_0x199058(_0x27e68d[_0x97e6('0x14')](0x1f4,_0x16c0ad[_0x97e6('0x17')]));});});};exports[_0x97e6('0x1e')]=function(_0x2a8e90){return new Promise(function(_0x78379c,_0x124c7b){return db['MailInteraction'][_0x97e6('0x1f')]({'where':_0x2a8e90['options']?_0x2a8e90[_0x97e6('0x1c')][_0x97e6('0x1d')]||null:null})[_0x97e6('0xe')](function(_0x283698){if(_0x283698){return _0x283698[_0x97e6('0x20')](_0x2a8e90['body'][_0x97e6('0x21')],_[_0x97e6('0x22')](_0x2a8e90[_0x97e6('0x1b')],[_0x97e6('0x21'),'id'])||{});}})['spread'](function(_0x355f71){logger['info'](_0x97e6('0x23'),_0x2a8e90);logger['debug'](_0x97e6('0x23'),_0x2a8e90,JSON[_0x97e6('0x13')](_0x355f71));_0x78379c(_0x355f71);})[_0x97e6('0x18')](function(_0x408a0c){logger['error']('AddTags',_0x408a0c[_0x97e6('0x17')],_0x2a8e90);_0x124c7b(_this[_0x97e6('0x14')](0x1f4,_0x408a0c[_0x97e6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 91ae90a..2709765 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 _0x155a=['./mailInteraction.events','update','emit','removeListener','length','mailInteraction:'];(function(_0x10b4cd,_0x41d14d){var _0xa7b4c6=function(_0x25d56d){while(--_0x25d56d){_0x10b4cd['push'](_0x10b4cd['shift']());}};_0xa7b4c6(++_0x41d14d);}(_0x155a,0x120));var _0xa155=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x155a[_0x46698a];return _0x356db0;};'use strict';var MailInteractionEvents=require(_0xa155('0x0'));var events=['save','remove',_0xa155('0x1')];function createListener(_0x1e9f2f,_0x4b3444){return function(_0x33f484){_0x4b3444[_0xa155('0x2')](_0x1e9f2f,_0x33f484);};}function removeListener(_0x271d39,_0x360b21){return function(){MailInteractionEvents[_0xa155('0x3')](_0x271d39,_0x360b21);};}exports['register']=function(_0x3c2cb7){for(var _0x441432=0x0,_0x32df55=events[_0xa155('0x4')];_0x441432<_0x32df55;_0x441432++){var _0x16c6b8=events[_0x441432];var _0x48ce00=createListener(_0xa155('0x5')+_0x16c6b8,_0x3c2cb7);MailInteractionEvents['on'](_0x16c6b8,_0x48ce00);}}; \ No newline at end of file +var _0xca75=['mailInteraction:','./mailInteraction.events','save','update','emit','length'];(function(_0x427b1c,_0x5010b9){var _0x52d73c=function(_0x3a8c99){while(--_0x3a8c99){_0x427b1c['push'](_0x427b1c['shift']());}};_0x52d73c(++_0x5010b9);}(_0xca75,0x16f));var _0x5ca7=function(_0x374ea8,_0x444720){_0x374ea8=_0x374ea8-0x0;var _0x5bdf9f=_0xca75[_0x374ea8];return _0x5bdf9f;};'use strict';var MailInteractionEvents=require(_0x5ca7('0x0'));var events=[_0x5ca7('0x1'),'remove',_0x5ca7('0x2')];function createListener(_0x34f267,_0x1a8200){return function(_0x191e52){_0x1a8200[_0x5ca7('0x3')](_0x34f267,_0x191e52);};}function removeListener(_0x39826f,_0xae2f10){return function(){MailInteractionEvents['removeListener'](_0x39826f,_0xae2f10);};}exports['register']=function(_0x3243e8){for(var _0x7315d1=0x0,_0x42b5c2=events[_0x5ca7('0x4')];_0x7315d1<_0x42b5c2;_0x7315d1++){var _0x1d2f24=events[_0x7315d1];var _0x3117d2=createListener(_0x5ca7('0x5')+_0x1d2f24,_0x3243e8);MailInteractionEvents['on'](_0x1d2f24,_0x3117d2);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 855cb7b..08c9429 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 _0x2b50=['/:id/reject','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x2b50,0x68));var _0x02b5=function(_0x51576a,_0x1c582d){_0x51576a=_0x51576a-0x0;var _0x3a7eaf=_0x2b50[_0x51576a];return _0x3a7eaf;};'use strict';var multer=require(_0x02b5('0x0'));var util=require('util');var path=require(_0x02b5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x02b5('0x2'));var auth=require(_0x02b5('0x3'));var interaction=require(_0x02b5('0x4'));var config=require(_0x02b5('0x5'));var controller=require('./mailMessage.controller');router[_0x02b5('0x6')]('/',auth[_0x02b5('0x7')](),controller['index']);router['get']('/describe',auth[_0x02b5('0x7')](),controller[_0x02b5('0x8')]);router[_0x02b5('0x6')](_0x02b5('0x9'),auth[_0x02b5('0x7')](),controller[_0x02b5('0xa')]);router[_0x02b5('0x6')](_0x02b5('0xb'),auth[_0x02b5('0x7')](),controller[_0x02b5('0xc')]);router[_0x02b5('0xd')]('/',auth[_0x02b5('0x7')](),interaction[_0x02b5('0xe')](_0x02b5('0xf'),_0x02b5('0x10')),controller[_0x02b5('0x11')]);router[_0x02b5('0x12')](_0x02b5('0x9'),auth[_0x02b5('0x7')](),controller[_0x02b5('0x13')]);router[_0x02b5('0x12')](_0x02b5('0x14'),auth[_0x02b5('0x7')](),controller['accept']);router['put'](_0x02b5('0x15'),auth[_0x02b5('0x7')](),controller['reject']);router[_0x02b5('0x16')](_0x02b5('0x9'),auth[_0x02b5('0x7')](),controller[_0x02b5('0x17')]);module[_0x02b5('0x18')]=router; \ No newline at end of file +var _0xb406=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','put','update','/:id/accept','reject','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3767a8,_0x222977){var _0x4d2ce3=function(_0x5db23b){while(--_0x5db23b){_0x3767a8['push'](_0x3767a8['shift']());}};_0x4d2ce3(++_0x222977);}(_0xb406,0x10c));var _0x6b40=function(_0x33d851,_0xa747ba){_0x33d851=_0x33d851-0x0;var _0x197a88=_0xb406[_0x33d851];return _0x197a88;};'use strict';var multer=require(_0x6b40('0x0'));var util=require(_0x6b40('0x1'));var path=require(_0x6b40('0x2'));var timeout=require(_0x6b40('0x3'));var express=require(_0x6b40('0x4'));var router=express[_0x6b40('0x5')]();var fs_extra=require(_0x6b40('0x6'));var auth=require(_0x6b40('0x7'));var interaction=require(_0x6b40('0x8'));var config=require(_0x6b40('0x9'));var controller=require('./mailMessage.controller');router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6b40('0xd')]);router[_0x6b40('0xa')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0xf')]);router[_0x6b40('0xa')](_0x6b40('0x10'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x11')]);router['post']('/',auth[_0x6b40('0xb')](),interaction[_0x6b40('0x12')](_0x6b40('0x13'),_0x6b40('0x14')),controller['create']);router[_0x6b40('0x15')](_0x6b40('0xe'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x16')]);router[_0x6b40('0x15')](_0x6b40('0x17'),auth[_0x6b40('0xb')](),controller['accept']);router[_0x6b40('0x15')]('/:id/reject',auth[_0x6b40('0xb')](),controller[_0x6b40('0x18')]);router['delete'](_0x6b40('0xe'),auth[_0x6b40('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index d1a44fc..7b009e8 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 _0x8d28=['out','STRING','DATE','INTEGER','Chat','sequelize','exports','long','TEXT','medium'];(function(_0xaadc70,_0x2c050d){var _0x3ac647=function(_0x57f7d8){while(--_0x57f7d8){_0xaadc70['push'](_0xaadc70['shift']());}};_0x3ac647(++_0x2c050d);}(_0x8d28,0xcd));var _0x88d2=function(_0x48fe15,_0x447335){_0x48fe15=_0x48fe15-0x0;var _0x484f12=_0x8d28[_0x48fe15];return _0x484f12;};'use strict';var Sequelize=require(_0x88d2('0x0'));var _=require('lodash');module[_0x88d2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x88d2('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x88d2('0x5')),'defaultValue':_0x88d2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x88d2('0x6')](0x1fe)},'from':{'type':Sequelize[_0x88d2('0x6')]},'to':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x2'))},'cc':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x2'))},'bcc':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x2'))},'subject':{'type':Sequelize[_0x88d2('0x3')]},'sentAt':{'type':Sequelize[_0x88d2('0x7')]},'attach':{'type':Sequelize[_0x88d2('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x88d2('0x7')]},'originTo':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x2'))},'originCc':{'type':Sequelize[_0x88d2('0x3')](_0x88d2('0x2'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x88d2('0x9')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x41fb=['INTEGER','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x41fb,0x1e3));var _0xb41f=function(_0x312428,_0x458f28){_0x312428=_0x312428-0x0;var _0x583514=_0x41fb[_0x312428];return _0x583514;};'use strict';var Sequelize=require(_0xb41f('0x0'));var _=require(_0xb41f('0x1'));module[_0xb41f('0x2')]={'body':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x5'))},'read':{'type':Sequelize[_0xb41f('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb41f('0x7')]('in',_0xb41f('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb41f('0x9')](0x1fe)},'from':{'type':Sequelize[_0xb41f('0x9')]},'to':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'cc':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'bcc':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xb41f('0xa')]},'attach':{'type':Sequelize[_0xb41f('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb41f('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb41f('0xa')]},'originTo':{'type':Sequelize[_0xb41f('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xb41f('0x7')]('Email',_0xb41f('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index ad1fa09..5fa5d14 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 _0xcf9b=['files','tmp','join','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','unlinkSync','eml-format','moment','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','redis','defaults','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','status','json','undefined','count','offset','set','update','destroy','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','interface','SIP/%s','motionChannel','accept','fromString','acceptmessage','get','MailInteraction','RejectMessage','rejectMessage','ContactId','sequelize','User','channel','event','reject','EventManager','download','unix','toString','server'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xcf9b,0xae));var _0xbcf9=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcf9b[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xbcf9('0x0'));var moment=require(_0xbcf9('0x1'));var BPromise=require('bluebird');var util=require(_0xbcf9('0x2'));var path=require(_0xbcf9('0x3'));var fs=require('fs');var _=require(_0xbcf9('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xbcf9('0x5'));var qs=require(_0xbcf9('0x6'));var logger=require(_0xbcf9('0x7'))(_0xbcf9('0x8'));var interaction_log=require(_0xbcf9('0x7'))('mail-interactions');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xbcf9('0x9')]=_[_0xbcf9('0xa')](config[_0xbcf9('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcf9('0x9')]));require(_0xbcf9('0xb'))[_0xbcf9('0xc')](socket);var jayson=require(_0xbcf9('0xd'));var client=jayson[_0xbcf9('0xe')][_0xbcf9('0xf')]({'port':0x232c});var client9003=jayson[_0xbcf9('0xe')][_0xbcf9('0xf')]({'port':0x232b});var client9002=jayson[_0xbcf9('0xe')][_0xbcf9('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x2567ed,_0x3aa92c,_0x103319,_0x46b0d3){return new BPromise(function(_0x27ea19,_0x28920f){var _0x5c52c4=_0x46b0d3||client;return _0x5c52c4[_0xbcf9('0x10')](_0x2567ed,_0x103319)[_0xbcf9('0x11')](function(_0x42a7fa){logger['info'](_0xbcf9('0x12'),_0x3aa92c,_0xbcf9('0x13'));logger['debug'](_0xbcf9('0x14'),_0x3aa92c,'request\x20sent',JSON[_0xbcf9('0x15')](_0x42a7fa));if(_0x42a7fa['error']){if(_0x42a7fa['error'][_0xbcf9('0x16')]===0x1f4){logger[_0xbcf9('0x17')](_0xbcf9('0x12'),_0x3aa92c,_0x42a7fa[_0xbcf9('0x17')]['message']);return _0x28920f(_0x42a7fa['error'][_0xbcf9('0x18')]);}logger[_0xbcf9('0x17')](_0xbcf9('0x12'),_0x3aa92c,_0x42a7fa[_0xbcf9('0x17')][_0xbcf9('0x18')]);return _0x27ea19(_0x42a7fa[_0xbcf9('0x17')][_0xbcf9('0x18')]);}else{logger[_0xbcf9('0x19')]('MailMessage,\x20%s,\x20%s',_0x3aa92c,_0xbcf9('0x13'));_0x27ea19(_0x42a7fa[_0xbcf9('0x1a')][_0xbcf9('0x18')]);}})['catch'](function(_0x203115){logger[_0xbcf9('0x17')](_0xbcf9('0x12'),_0x3aa92c,_0x203115);_0x28920f(_0x203115);});});}function respondWithResult(_0x10507f,_0x1c18c1){_0x1c18c1=_0x1c18c1||0xc8;return function(_0x1e2a8a){if(_0x1e2a8a){return _0x10507f[_0xbcf9('0x1b')](_0x1c18c1)[_0xbcf9('0x1c')](_0x1e2a8a);}};}function respondWithFilteredResult(_0x5c5085,_0x3f5f4c){return function(_0x4f98c8){if(_0x4f98c8){var _0x3a75d2=typeof _0x3f5f4c['offset']===_0xbcf9('0x1d')&&typeof _0x3f5f4c['limit']==='undefined';var _0x52297b=_0x4f98c8[_0xbcf9('0x1e')];var _0x531567=_0x3a75d2?0x0:_0x3f5f4c[_0xbcf9('0x1f')];var _0x1cb650=_0x3a75d2?_0x4f98c8[_0xbcf9('0x1e')]:_0x3f5f4c[_0xbcf9('0x1f')]+_0x3f5f4c['limit'];var _0x425237;if(_0x1cb650>=_0x52297b){_0x1cb650=_0x52297b;_0x425237=0xc8;}else{_0x425237=0xce;}_0x5c5085[_0xbcf9('0x1b')](_0x425237);return _0x5c5085[_0xbcf9('0x20')]('Content-Range',_0x531567+'-'+_0x1cb650+'/'+_0x52297b)[_0xbcf9('0x1c')](_0x4f98c8);}return null;};}function saveUpdates(_0x491921){return function(_0x19b55f){if(_0x19b55f){return _0x19b55f[_0xbcf9('0x21')](_0x491921)[_0xbcf9('0x11')](function(_0x12b8ad){return _0x12b8ad;});}return null;};}function removeEntity(_0x41fff3){return function(_0xf3e906){if(_0xf3e906){return _0xf3e906[_0xbcf9('0x22')]()[_0xbcf9('0x11')](function(){_0x41fff3[_0xbcf9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfc39){return function(_0x8e8e94){if(!_0x8e8e94){_0x1dfc39['sendStatus'](0x194);}return _0x8e8e94;};}function handleError(_0x37f4cc,_0x422623){_0x422623=_0x422623||0x1f4;return function(_0x39b360){logger[_0xbcf9('0x17')](_0x39b360[_0xbcf9('0x23')]);if(_0x39b360['name']){delete _0x39b360[_0xbcf9('0x24')];}_0x37f4cc[_0xbcf9('0x1b')](_0x422623)['send'](_0x39b360);};}exports[_0xbcf9('0x25')]=function(_0x557ed4,_0x2d0ec9){var _0x265802={},_0xf6c876={},_0x386af5={'count':0x0,'rows':[]};var _0x1e74bc=_[_0xbcf9('0x26')](db[_0xbcf9('0x27')][_0xbcf9('0x28')],function(_0x54bda8){return{'name':_0x54bda8[_0xbcf9('0x29')],'type':_0x54bda8[_0xbcf9('0x2a')][_0xbcf9('0x2b')]};});_0xf6c876[_0xbcf9('0x2c')]=_[_0xbcf9('0x26')](_0x1e74bc,'name');_0xf6c876[_0xbcf9('0x2d')]=_[_0xbcf9('0x2e')](_0x557ed4[_0xbcf9('0x2d')]);_0xf6c876['filters']=_[_0xbcf9('0x2f')](_0xf6c876['model'],_0xf6c876[_0xbcf9('0x2d')]);_0x265802[_0xbcf9('0x30')]=_[_0xbcf9('0x2f')](_0xf6c876[_0xbcf9('0x2c')],qs['fields'](_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x31')]));_0x265802[_0xbcf9('0x30')]=_0x265802[_0xbcf9('0x30')][_0xbcf9('0x32')]?_0x265802[_0xbcf9('0x30')]:_0xf6c876['model'];if(!_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x33')](_0xbcf9('0x34'))){_0x265802[_0xbcf9('0x35')]=qs[_0xbcf9('0x35')](_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x35')]);_0x265802[_0xbcf9('0x1f')]=qs[_0xbcf9('0x1f')](_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x1f')]);}_0x265802[_0xbcf9('0x36')]=qs[_0xbcf9('0x37')](_0x557ed4['query'][_0xbcf9('0x37')]);_0x265802[_0xbcf9('0x38')]=qs[_0xbcf9('0x39')](_[_0xbcf9('0x3a')](_0x557ed4['query'],_0xf6c876[_0xbcf9('0x39')]),_0x1e74bc);if(_0x557ed4[_0xbcf9('0x2d')]['filter']){_0x265802['where']=_['merge'](_0x265802[_0xbcf9('0x38')],{'$or':_[_0xbcf9('0x26')](_0x1e74bc,function(_0xb29c62){if(_0xb29c62[_0xbcf9('0x2a')]!==_0xbcf9('0x3b')){var _0x2c574a={};_0x2c574a[_0xb29c62[_0xbcf9('0x24')]]={'$like':'%'+_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x3c')]+'%'};return _0x2c574a;}})});}_0x265802=_[_0xbcf9('0x3d')]({},_0x265802,_0x557ed4[_0xbcf9('0x3e')]);var _0x24eb17={'where':_0x265802[_0xbcf9('0x38')]};return db['MailMessage'][_0xbcf9('0x1e')](_0x24eb17)['then'](function(_0x58afc0){_0x386af5[_0xbcf9('0x1e')]=_0x58afc0;if(_0x557ed4[_0xbcf9('0x2d')][_0xbcf9('0x3f')]){_0x265802[_0xbcf9('0x40')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x265802);})[_0xbcf9('0x11')](function(_0x53f995){_0x386af5['rows']=_0x53f995;return _0x386af5;})['then'](respondWithFilteredResult(_0x2d0ec9,_0x265802))[_0xbcf9('0x41')](handleError(_0x2d0ec9,null));};exports[_0xbcf9('0x42')]=function(_0x2966fc,_0x504d4f){var _0x4b6186={'raw':!![],'where':{'id':_0x2966fc[_0xbcf9('0x43')]['id']}},_0x33cb5f={};_0x33cb5f[_0xbcf9('0x2c')]=_[_0xbcf9('0x2e')](db[_0xbcf9('0x27')]['rawAttributes']);_0x33cb5f['query']=_['keys'](_0x2966fc[_0xbcf9('0x2d')]);_0x33cb5f[_0xbcf9('0x39')]=_[_0xbcf9('0x2f')](_0x33cb5f[_0xbcf9('0x2c')],_0x33cb5f[_0xbcf9('0x2d')]);_0x4b6186['attributes']=_['intersection'](_0x33cb5f['model'],qs[_0xbcf9('0x31')](_0x2966fc['query'][_0xbcf9('0x31')]));_0x4b6186[_0xbcf9('0x30')]=_0x4b6186['attributes'][_0xbcf9('0x32')]?_0x4b6186['attributes']:_0x33cb5f['model'];if(_0x2966fc[_0xbcf9('0x2d')][_0xbcf9('0x3f')]){_0x4b6186[_0xbcf9('0x40')]=[{'all':!![]}];}_0x4b6186=_[_0xbcf9('0x3d')]({},_0x4b6186,_0x2966fc[_0xbcf9('0x3e')]);return db['MailMessage'][_0xbcf9('0x44')](_0x4b6186)[_0xbcf9('0x11')](handleEntityNotFound(_0x504d4f,null))[_0xbcf9('0x11')](respondWithResult(_0x504d4f,null))['catch'](handleError(_0x504d4f,null));};exports[_0xbcf9('0x21')]=function(_0x1631bf,_0x2327a8){if(_0x1631bf['body']['id']){delete _0x1631bf[_0xbcf9('0x45')]['id'];}return db[_0xbcf9('0x27')][_0xbcf9('0x44')]({'where':{'id':_0x1631bf['params']['id']}})[_0xbcf9('0x11')](handleEntityNotFound(_0x2327a8,null))[_0xbcf9('0x11')](saveUpdates(_0x1631bf[_0xbcf9('0x45')],null))[_0xbcf9('0x11')](respondWithResult(_0x2327a8,null))['catch'](handleError(_0x2327a8,null));};exports[_0xbcf9('0x22')]=function(_0x188e5a,_0xe58e78){return db[_0xbcf9('0x27')][_0xbcf9('0x44')]({'where':{'id':_0x188e5a[_0xbcf9('0x43')]['id']}})[_0xbcf9('0x11')](handleEntityNotFound(_0xe58e78,null))[_0xbcf9('0x11')](removeEntity(_0xe58e78,null))[_0xbcf9('0x41')](handleError(_0xe58e78,null));};exports[_0xbcf9('0x46')]=function(_0x2d4013,_0x2f6521){return db['MailMessage'][_0xbcf9('0x46')]()[_0xbcf9('0x11')](respondWithResult(_0x2f6521,null))['catch'](handleError(_0x2f6521,null));};exports[_0xbcf9('0x47')]=function(_0x22332b,_0x21bd9a){return db[_0xbcf9('0x27')]['create'](_0x22332b[_0xbcf9('0x45')])[_0xbcf9('0x11')](function(_0x1bfa64){if(_0x1bfa64){if(_0x1bfa64[_0xbcf9('0x48')]===_0xbcf9('0x49')&&!_0x1bfa64[_0xbcf9('0x4a')]){var _0x330e30,_0x481fcf,_0xe56998;if(_0x22332b[_0xbcf9('0x45')]['to']){_0x481fcf=_0x22332b[_0xbcf9('0x45')]['to']['split'](',')[0x0];}return db[_0xbcf9('0x4b')][_0xbcf9('0x4c')]({'where':{'id':_0x1bfa64[_0xbcf9('0x4d')]},'include':[{'model':db['CmList'],'as':_0xbcf9('0x4e'),'include':[{'model':db[_0xbcf9('0x4f')],'as':_0xbcf9('0x50'),'where':{'email':_0x481fcf},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xbcf9('0x51')],'as':_0xbcf9('0x52'),'raw':!![]}]})[_0xbcf9('0x11')](function(_0x1cb4d7){_0x330e30=_0x1cb4d7;if(_0x330e30&&_0x330e30['Smtp']){var _0xfc7f9={'tls':{'rejectUnauthorized':![]}};if(_[_0xbcf9('0x53')](_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x54')])){_0xfc7f9[_0xbcf9('0x55')]=_0x330e30['Smtp']['host'];_0xfc7f9[_0xbcf9('0x56')]=_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x56')];_0xfc7f9[_0xbcf9('0x57')]=_0x330e30[_0xbcf9('0x52')]['secure'];if(_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x58')]){_0xfc7f9[_0xbcf9('0x59')]={'user':_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x5a')],'pass':_0x330e30[_0xbcf9('0x52')]['pass']};}}else{_0xfc7f9[_0xbcf9('0x54')]=_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x54')];_0xfc7f9[_0xbcf9('0x59')]={'user':_0x330e30['Smtp'][_0xbcf9('0x5a')],'pass':_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x5b')]};_0xfc7f9['secure']=_0x330e30[_0xbcf9('0x52')][_0xbcf9('0x57')];}if(_0x22332b[_0xbcf9('0x45')][_0xbcf9('0x5c')]&&_0x22332b['body']['attachments'][_0xbcf9('0x32')]){for(var _0x411566=0x0;_0x411566<_0x22332b[_0xbcf9('0x45')][_0xbcf9('0x5c')][_0xbcf9('0x32')];_0x411566+=0x1){_0x22332b['body'][_0xbcf9('0x5c')][_0x411566]={'filename':_0x22332b[_0xbcf9('0x45')][_0xbcf9('0x5c')][_0x411566][_0xbcf9('0x24')],'path':path['join'](config[_0xbcf9('0x5d')],_0xbcf9('0x5e'),_0x22332b[_0xbcf9('0x45')]['attachments'][_0x411566]['basename'])};}}_0xe56998={'account':_0xfc7f9,'message':_0x22332b['body']};return;}})[_0xbcf9('0x11')](function(){if(_0x330e30[_0xbcf9('0x4e')]){if(_0x330e30[_0xbcf9('0x4e')][_0xbcf9('0x50')]['length']){return _0x330e30[_0xbcf9('0x4e')][_0xbcf9('0x50')][0x0];}else{return db[_0xbcf9('0x4f')][_0xbcf9('0x47')](_['defaults'](_0x22332b[_0xbcf9('0x45')],{'firstName':_0x22332b['body']['to'],'email':_0x22332b[_0xbcf9('0x45')]['to'],'phone':_0x22332b[_0xbcf9('0x45')]['to'],'ListId':_0x330e30[_0xbcf9('0x5f')]}));}}else{throw new Error(_0xbcf9('0x60'));}})[_0xbcf9('0x11')](function(){if(_0xe56998){return respondWithRpcPromise(_0xbcf9('0x61'),_0xbcf9('0x62'),_0xe56998,client9003)[_0xbcf9('0x11')](function(_0x28f629){return _0x1bfa64[_0xbcf9('0x21')]({'read':!![],'messageId':_0x28f629['messageId'],'sentAt':moment()[_0xbcf9('0x63')](_0xbcf9('0x64'))});})['catch'](function(_0x485302){logger[_0xbcf9('0x17')]('%s',JSON[_0xbcf9('0x15')](_0x485302));return _0x1bfa64;});}return _0x1bfa64;});}return _0x1bfa64;}})[_0xbcf9('0x11')](respondWithResult(_0x21bd9a,0xc9))['catch'](handleError(_0x21bd9a,null));};exports['accept']=function(_0x58ed39,_0x5c76ca){var _0x218825={'agent':{},'channel':_0xbcf9('0x65')};if(_0x58ed39[_0xbcf9('0x45')]['id']){delete _0x58ed39[_0xbcf9('0x45')]['id'];}_0x58ed39['body'][_0xbcf9('0x66')]=!![];_0x58ed39['body'][_0xbcf9('0x67')]=moment()['format'](_0xbcf9('0x64'));_0x58ed39[_0xbcf9('0x45')][_0xbcf9('0x68')]=_0x58ed39[_0xbcf9('0x45')]['UserId']||_0x58ed39[_0xbcf9('0x5a')]['id'];_0x218825['agent']['id']=_0x58ed39[_0xbcf9('0x45')][_0xbcf9('0x68')];return db[_0xbcf9('0x27')][_0xbcf9('0x44')]({'where':{'id':_0x58ed39[_0xbcf9('0x43')]['id'],'UserId':null}})[_0xbcf9('0x11')](handleEntityNotFound(_0x5c76ca,null))['then'](saveUpdates(_0x58ed39['body'],null))[_0xbcf9('0x11')](function(_0x2c793c){if(_0x2c793c){_0x218825[_0xbcf9('0x18')]=_0x2c793c['get']({'plain':!![]});return db['MailInteraction'][_0xbcf9('0x44')]({'where':{'id':_0x2c793c[_0xbcf9('0x69')]}});}return null;})[_0xbcf9('0x11')](handleEntityNotFound(_0x5c76ca,null))[_0xbcf9('0x11')](function(_0x4f7654){if(_0x4f7654){return _0x4f7654['update']({'UserId':_0x58ed39[_0xbcf9('0x45')][_0xbcf9('0x68')],'read1stAt':_[_0xbcf9('0x53')](_0x4f7654[_0xbcf9('0x6a')])?moment()[_0xbcf9('0x63')](_0xbcf9('0x64')):undefined});}return null;})['then'](function(_0x581980){if(_0x581980){_0x218825[_0xbcf9('0x6b')]=_0x581980['get']({'plain':!![]});interaction_log[_0xbcf9('0x19')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58ed39[_0xbcf9('0x5a')]['id'],_0x58ed39[_0xbcf9('0x5a')][_0xbcf9('0x24')],_0x58ed39['user']['role'],_0x218825['interaction']['id'],_0x58ed39[_0xbcf9('0x45')]?JSON['stringify'](_0x58ed39['body']):_0xbcf9('0x6c'));return respondWithRpcPromise(_0xbcf9('0x6d'),_0xbcf9('0x6e'),_0x218825);}return null;})[_0xbcf9('0x11')](function(_0x147789){var _0x5d323b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x147789[_0xbcf9('0x18')]['ContactId'];return db['sequelize'][_0xbcf9('0x2d')](_0x5d323b,{'type':db[_0xbcf9('0x6f')][_0xbcf9('0x70')][_0xbcf9('0x71')],'raw':!![]})[_0xbcf9('0x11')](function(_0x58ae59){return _0x58ae59;});})[_0xbcf9('0x11')](function(_0x47943e){if(_0x47943e){_0x218825['message'][_0xbcf9('0x72')]=_0x47943e[0x0];if(!_0x58ed39[_0xbcf9('0x45')][_0xbcf9('0x68')])return;return db['User'][_0xbcf9('0x44')]({'where':{'id':_0x58ed39[_0xbcf9('0x45')]['UserId'],'role':_0xbcf9('0x73')},'attributes':['id',_0xbcf9('0x24'),_0xbcf9('0x74'),_0xbcf9('0x75'),_0xbcf9('0x76')],'raw':!![]});}return null;})[_0xbcf9('0x11')](function(_0x2738e1){if(!_0x2738e1)return null;_0x218825[_0xbcf9('0x18')][_0xbcf9('0x73')]=_0x2738e1;return _0x218825;})[_0xbcf9('0x11')](function(_0x3e4e15){if(_0x3e4e15){if(_0x58ed39[_0xbcf9('0x45')]['manual']){_0x218825[_0xbcf9('0x18')][_0xbcf9('0x77')]=util[_0xbcf9('0x63')](_0xbcf9('0x78'),_0x58ed39[_0xbcf9('0x5a')][_0xbcf9('0x24')]);_0x218825[_0xbcf9('0x18')]['channel']=_0x218825['channel'];_0x218825['message'][_0xbcf9('0x79')]=_0x218825['channel'];_0x218825['message']['event']=_0xbcf9('0x7a');_0x218825[_0xbcf9('0x18')][_0xbcf9('0x45')]=htmlToText[_0xbcf9('0x7b')](_0x218825[_0xbcf9('0x18')][_0xbcf9('0x45')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xbcf9('0x7c'),'message':_0x218825[_0xbcf9('0x18')]},client9002)[_0xbcf9('0x11')](function(){return _0x218825;});}return _0x218825;}return null;})[_0xbcf9('0x11')](respondWithResult(_0x5c76ca,null))[_0xbcf9('0x41')](handleError(_0x5c76ca,null));};exports['reject']=function(_0x8918d1,_0x27b82c){var _0x466f8f={'agent':{},'channel':_0xbcf9('0x65')};if(_0x8918d1[_0xbcf9('0x45')]['id']){delete _0x8918d1[_0xbcf9('0x45')]['id'];}_0x8918d1['body'][_0xbcf9('0x68')]=_0x8918d1[_0xbcf9('0x45')][_0xbcf9('0x68')]||_0x8918d1[_0xbcf9('0x5a')]['id'];_0x466f8f['agent']['id']=_0x8918d1[_0xbcf9('0x45')][_0xbcf9('0x68')];return db[_0xbcf9('0x27')][_0xbcf9('0x44')]({'where':{'id':_0x8918d1[_0xbcf9('0x43')]['id'],'UserId':null}})[_0xbcf9('0x11')](handleEntityNotFound(_0x27b82c,null))[_0xbcf9('0x11')](function(_0xa9f5c){if(_0xa9f5c){_0x466f8f[_0xbcf9('0x18')]=_0xa9f5c[_0xbcf9('0x7d')]({'plain':!![]});return db[_0xbcf9('0x7e')][_0xbcf9('0x44')]({'where':{'id':_0xa9f5c[_0xbcf9('0x69')]}});}return null;})[_0xbcf9('0x11')](handleEntityNotFound(_0x27b82c,null))[_0xbcf9('0x11')](function(_0xe4722c){if(_0xe4722c){_0x466f8f[_0xbcf9('0x6b')]=_0xe4722c[_0xbcf9('0x7d')]({'plain':!![]});interaction_log[_0xbcf9('0x19')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8918d1[_0xbcf9('0x5a')]['id'],_0x8918d1[_0xbcf9('0x5a')][_0xbcf9('0x24')],_0x8918d1[_0xbcf9('0x5a')]['role'],_0x466f8f[_0xbcf9('0x6b')]['id'],_0x8918d1[_0xbcf9('0x45')]?JSON[_0xbcf9('0x15')](_0x8918d1[_0xbcf9('0x45')]):_0xbcf9('0x6c'));return respondWithRpcPromise(_0xbcf9('0x7f'),_0xbcf9('0x80'),_0x466f8f);}return null;})[_0xbcf9('0x11')](function(_0x44eb00){var _0x36da96='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44eb00['message'][_0xbcf9('0x81')];return db[_0xbcf9('0x82')][_0xbcf9('0x2d')](_0x36da96,{'type':db[_0xbcf9('0x6f')][_0xbcf9('0x70')][_0xbcf9('0x71')],'raw':!![]})['then'](function(_0x316edf){return _0x316edf;});})[_0xbcf9('0x11')](function(_0x36b2b4){if(_0x36b2b4){_0x466f8f['message'][_0xbcf9('0x72')]=_0x36b2b4[0x0];if(!_0x8918d1[_0xbcf9('0x45')][_0xbcf9('0x68')])return;return db[_0xbcf9('0x83')][_0xbcf9('0x44')]({'where':{'id':_0x8918d1[_0xbcf9('0x45')][_0xbcf9('0x68')],'role':_0xbcf9('0x73')},'attributes':['id',_0xbcf9('0x24'),_0xbcf9('0x74'),'email',_0xbcf9('0x76')],'raw':!![]});}return null;})[_0xbcf9('0x11')](function(_0x2ebf84){if(!_0x2ebf84)return null;_0x466f8f[_0xbcf9('0x18')][_0xbcf9('0x73')]=_0x2ebf84;return _0x466f8f;})[_0xbcf9('0x11')](function(_0x122a67){if(_0x122a67){_0x122a67[_0xbcf9('0x18')][_0xbcf9('0x77')]=util[_0xbcf9('0x63')](_0xbcf9('0x78'),_0x8918d1['user']['name']);_0x122a67['message'][_0xbcf9('0x84')]=_0x466f8f[_0xbcf9('0x84')];_0x122a67[_0xbcf9('0x18')][_0xbcf9('0x79')]=_0x466f8f[_0xbcf9('0x84')];_0x122a67[_0xbcf9('0x18')][_0xbcf9('0x85')]=_0xbcf9('0x86');_0x122a67['message']['body']=htmlToText[_0xbcf9('0x7b')](_0x466f8f['message'][_0xbcf9('0x45')]);respondWithRpcPromise(_0xbcf9('0x87'),_0xbcf9('0x87'),{'event':'rejectmessage','message':_0x122a67[_0xbcf9('0x18')]},client9002);return _0x466f8f;}return null;})[_0xbcf9('0x11')](respondWithResult(_0x27b82c,null))[_0xbcf9('0x41')](handleError(_0x27b82c,null));};exports[_0xbcf9('0x88')]=function(_0x2d5e42,_0x501652){var _0x28cd8f=moment()[_0xbcf9('0x89')]()[_0xbcf9('0x8a')]();var _0x5c6632=path['join'](config[_0xbcf9('0x5d')],_0xbcf9('0x8b'),_0xbcf9('0x8c'),_0xbcf9('0x8d'));var _0x19e8a3=path[_0xbcf9('0x8e')](config['root'],_0xbcf9('0x8b'),_0xbcf9('0x8c'),_0xbcf9('0x5c'));var _0x8156da=util[_0xbcf9('0x63')](_0xbcf9('0x8f'),_0x28cd8f);return db[_0xbcf9('0x27')][_0xbcf9('0x44')]({'where':{'id':_0x2d5e42['params']['id']},'attributes':['id','body',_0xbcf9('0x90'),'to','cc',_0xbcf9('0x91'),_0xbcf9('0x92'),_0xbcf9('0x93')],'include':_0x2d5e42[_0xbcf9('0x2d')]['attachments']?[{'model':db[_0xbcf9('0x94')],'as':_0xbcf9('0x95')}]:undefined})[_0xbcf9('0x11')](handleEntityNotFound(_0x501652,null))[_0xbcf9('0x11')](function(_0x5385c1){if(_0x5385c1){var _0x5f3a28=_0x5385c1;var _0x1e9681={'from':_0x5f3a28[_0xbcf9('0x90')],'to':_0x5f3a28['to'],'subject':_0x5f3a28['subject'],'html':_0x5f3a28[_0xbcf9('0x45')],'headers':{'Date':moment(_0x5f3a28[_0xbcf9('0x93')])['format'](_0xbcf9('0x96'))},'attachments':[]};if(_0x5385c1['cc']){_0x1e9681[_0xbcf9('0x97')]['Cc']=_0x5385c1['cc'];}if(_0x5385c1[_0xbcf9('0x91')]){_0x1e9681[_0xbcf9('0x97')][_0xbcf9('0x98')]=_0x5385c1[_0xbcf9('0x91')];}return new BPromise(function(_0x1da713,_0x11d729){if(_0x5385c1[_0xbcf9('0x95')]){for(var _0x4539ae=0x0;_0x4539ae<_0x5385c1[_0xbcf9('0x95')][_0xbcf9('0x32')];_0x4539ae++){var _0x2d8b40=_0x5385c1[_0xbcf9('0x95')][_0x4539ae];var _0x205ca4=path[_0xbcf9('0x8e')](_0x19e8a3,_0x2d8b40[_0xbcf9('0x99')]);if(fs[_0xbcf9('0x9a')](_0x205ca4)){_0x1e9681[_0xbcf9('0x5c')][_0xbcf9('0x9b')]({'name':_0x2d8b40[_0xbcf9('0x24')],'contentType':_0x2d8b40[_0xbcf9('0x2a')],'data':fs['readFileSync'](_0x205ca4)});}}}emlformat['build'](_0x1e9681,function(_0x26f6e4,_0x4e6b56){if(_0x26f6e4)return _0x11d729(_0x26f6e4);fs['writeFileSync'](path[_0xbcf9('0x8e')](_0x5c6632,_0x8156da),_0x4e6b56);return _0x1da713(_0x4e6b56);});});}})[_0xbcf9('0x11')](function(_0x54d174){if(_0x54d174){return _0x501652[_0xbcf9('0x88')](path[_0xbcf9('0x8e')](_0x5c6632,_0x8156da),_0x8156da,function(_0x216b0d){if(!_0x216b0d)fs[_0xbcf9('0x9c')](path[_0xbcf9('0x8e')](_0x5c6632,_0x8156da));});}})[_0xbcf9('0x41')](handleError(_0x501652,null));}; \ No newline at end of file +var _0x8ee0=['where','pick','filter','type','VIRTUAL','options','MailMessage','includeAll','include','findAll','rows','show','params','keys','body','find','describe','create','out','split','findOne','MailAccountId','CmList','CmContact','DESC','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','update','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','agent','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','email','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','headers','existsSync','push','unlinkSync','eml-format','moment','bluebird','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','set','Content-Range','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x8ee0,0x19e));var _0x08ee=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x8ee0[_0x5ef161];return _0x1c6e9e;};'use strict';var emlformat=require(_0x08ee('0x0'));var moment=require(_0x08ee('0x1'));var BPromise=require(_0x08ee('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x08ee('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x08ee('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x08ee('0x5'))(_0x08ee('0x6'));var interaction_log=require(_0x08ee('0x5'))(_0x08ee('0x7'));var config=require(_0x08ee('0x8'));var db=require('../../mysqldb')['db'];config[_0x08ee('0x9')]=_[_0x08ee('0xa')](config[_0x08ee('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x08ee('0xb')](socket);var jayson=require(_0x08ee('0xc'));var client=jayson[_0x08ee('0xd')][_0x08ee('0xe')]({'port':0x232c});var client9003=jayson[_0x08ee('0xd')][_0x08ee('0xe')]({'port':0x232b});var client9002=jayson['client'][_0x08ee('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x25b351,_0x567008,_0x5cd371,_0x35b5ee){return new BPromise(function(_0xfbd7a7,_0x3ef215){var _0x4b46f6=_0x35b5ee||client;return _0x4b46f6[_0x08ee('0xf')](_0x25b351,_0x5cd371)[_0x08ee('0x10')](function(_0xb78d89){logger[_0x08ee('0x11')](_0x08ee('0x12'),_0x567008,'request\x20sent');logger[_0x08ee('0x13')](_0x08ee('0x14'),_0x567008,_0x08ee('0x15'),JSON[_0x08ee('0x16')](_0xb78d89));if(_0xb78d89[_0x08ee('0x17')]){if(_0xb78d89[_0x08ee('0x17')][_0x08ee('0x18')]===0x1f4){logger['error'](_0x08ee('0x12'),_0x567008,_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);return _0x3ef215(_0xb78d89['error'][_0x08ee('0x19')]);}logger[_0x08ee('0x17')]('MailMessage,\x20%s,\x20%s',_0x567008,_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);return _0xfbd7a7(_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);}else{logger[_0x08ee('0x11')](_0x08ee('0x12'),_0x567008,'request\x20sent');_0xfbd7a7(_0xb78d89[_0x08ee('0x1a')][_0x08ee('0x19')]);}})[_0x08ee('0x1b')](function(_0x10f913){logger[_0x08ee('0x17')](_0x08ee('0x12'),_0x567008,_0x10f913);_0x3ef215(_0x10f913);});});}function respondWithResult(_0x3a64d9,_0x2801fe){_0x2801fe=_0x2801fe||0xc8;return function(_0x208efd){if(_0x208efd){return _0x3a64d9[_0x08ee('0x1c')](_0x2801fe)[_0x08ee('0x1d')](_0x208efd);}};}function respondWithFilteredResult(_0x4765db,_0x101948){return function(_0x52d72c){if(_0x52d72c){var _0x443201=typeof _0x101948[_0x08ee('0x1e')]===_0x08ee('0x1f')&&typeof _0x101948['limit']===_0x08ee('0x1f');var _0x306945=_0x52d72c[_0x08ee('0x20')];var _0x41d317=_0x443201?0x0:_0x101948['offset'];var _0x8f5e30=_0x443201?_0x52d72c[_0x08ee('0x20')]:_0x101948[_0x08ee('0x1e')]+_0x101948['limit'];var _0x3b48cb;if(_0x8f5e30>=_0x306945){_0x8f5e30=_0x306945;_0x3b48cb=0xc8;}else{_0x3b48cb=0xce;}_0x4765db[_0x08ee('0x1c')](_0x3b48cb);return _0x4765db[_0x08ee('0x21')](_0x08ee('0x22'),_0x41d317+'-'+_0x8f5e30+'/'+_0x306945)['json'](_0x52d72c);}return null;};}function saveUpdates(_0x275452){return function(_0x11fae9){if(_0x11fae9){return _0x11fae9['update'](_0x275452)[_0x08ee('0x10')](function(_0x4bccd6){return _0x4bccd6;});}return null;};}function removeEntity(_0x5a4b37){return function(_0x1b4cda){if(_0x1b4cda){return _0x1b4cda[_0x08ee('0x23')]()['then'](function(){_0x5a4b37[_0x08ee('0x1c')](0xcc)[_0x08ee('0x24')]();});}};}function handleEntityNotFound(_0x22cbee){return function(_0x16ca0e){if(!_0x16ca0e){_0x22cbee[_0x08ee('0x25')](0x194);}return _0x16ca0e;};}function handleError(_0x201698,_0x185605){_0x185605=_0x185605||0x1f4;return function(_0x4c326e){logger[_0x08ee('0x17')](_0x4c326e[_0x08ee('0x26')]);if(_0x4c326e[_0x08ee('0x27')]){delete _0x4c326e[_0x08ee('0x27')];}_0x201698[_0x08ee('0x1c')](_0x185605)[_0x08ee('0x28')](_0x4c326e);};}exports[_0x08ee('0x29')]=function(_0x38ee2f,_0x1f59c3){var _0x5ed0cc={},_0x4968b2={},_0x5e8448={'count':0x0,'rows':[]};var _0x45f314=_[_0x08ee('0x2a')](db['MailMessage'][_0x08ee('0x2b')],function(_0x2f90c1){return{'name':_0x2f90c1[_0x08ee('0x2c')],'type':_0x2f90c1['type'][_0x08ee('0x2d')]};});_0x4968b2[_0x08ee('0x2e')]=_[_0x08ee('0x2a')](_0x45f314,_0x08ee('0x27'));_0x4968b2['query']=_['keys'](_0x38ee2f[_0x08ee('0x2f')]);_0x4968b2[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x4968b2[_0x08ee('0x2e')],_0x4968b2['query']);_0x5ed0cc['attributes']=_[_0x08ee('0x31')](_0x4968b2['model'],qs[_0x08ee('0x32')](_0x38ee2f[_0x08ee('0x2f')]['fields']));_0x5ed0cc[_0x08ee('0x33')]=_0x5ed0cc['attributes'][_0x08ee('0x34')]?_0x5ed0cc[_0x08ee('0x33')]:_0x4968b2[_0x08ee('0x2e')];if(!_0x38ee2f[_0x08ee('0x2f')]['hasOwnProperty'](_0x08ee('0x35'))){_0x5ed0cc['limit']=qs[_0x08ee('0x36')](_0x38ee2f[_0x08ee('0x2f')]['limit']);_0x5ed0cc[_0x08ee('0x1e')]=qs[_0x08ee('0x1e')](_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x1e')]);}_0x5ed0cc[_0x08ee('0x37')]=qs[_0x08ee('0x38')](_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x38')]);_0x5ed0cc[_0x08ee('0x39')]=qs[_0x08ee('0x30')](_[_0x08ee('0x3a')](_0x38ee2f[_0x08ee('0x2f')],_0x4968b2[_0x08ee('0x30')]),_0x45f314);if(_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x3b')]){_0x5ed0cc[_0x08ee('0x39')]=_['merge'](_0x5ed0cc[_0x08ee('0x39')],{'$or':_[_0x08ee('0x2a')](_0x45f314,function(_0x79bcf3){if(_0x79bcf3[_0x08ee('0x3c')]!==_0x08ee('0x3d')){var _0x1b34e1={};_0x1b34e1[_0x79bcf3['name']]={'$like':'%'+_0x38ee2f['query'][_0x08ee('0x3b')]+'%'};return _0x1b34e1;}})});}_0x5ed0cc=_['merge']({},_0x5ed0cc,_0x38ee2f[_0x08ee('0x3e')]);var _0x294e80={'where':_0x5ed0cc[_0x08ee('0x39')]};return db[_0x08ee('0x3f')][_0x08ee('0x20')](_0x294e80)[_0x08ee('0x10')](function(_0x583fc7){_0x5e8448[_0x08ee('0x20')]=_0x583fc7;if(_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x40')]){_0x5ed0cc[_0x08ee('0x41')]=[{'all':!![]}];}return db[_0x08ee('0x3f')][_0x08ee('0x42')](_0x5ed0cc);})['then'](function(_0x52c4ab){_0x5e8448[_0x08ee('0x43')]=_0x52c4ab;return _0x5e8448;})[_0x08ee('0x10')](respondWithFilteredResult(_0x1f59c3,_0x5ed0cc))[_0x08ee('0x1b')](handleError(_0x1f59c3,null));};exports[_0x08ee('0x44')]=function(_0x4d8a92,_0x51680b){var _0x5ac8bb={'raw':!![],'where':{'id':_0x4d8a92[_0x08ee('0x45')]['id']}},_0x15aa05={};_0x15aa05[_0x08ee('0x2e')]=_[_0x08ee('0x46')](db[_0x08ee('0x3f')][_0x08ee('0x2b')]);_0x15aa05[_0x08ee('0x2f')]=_[_0x08ee('0x46')](_0x4d8a92['query']);_0x15aa05[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x15aa05[_0x08ee('0x2e')],_0x15aa05[_0x08ee('0x2f')]);_0x5ac8bb[_0x08ee('0x33')]=_[_0x08ee('0x31')](_0x15aa05[_0x08ee('0x2e')],qs['fields'](_0x4d8a92[_0x08ee('0x2f')]['fields']));_0x5ac8bb[_0x08ee('0x33')]=_0x5ac8bb[_0x08ee('0x33')]['length']?_0x5ac8bb[_0x08ee('0x33')]:_0x15aa05['model'];if(_0x4d8a92[_0x08ee('0x2f')][_0x08ee('0x40')]){_0x5ac8bb[_0x08ee('0x41')]=[{'all':!![]}];}_0x5ac8bb=_['merge']({},_0x5ac8bb,_0x4d8a92[_0x08ee('0x3e')]);return db[_0x08ee('0x3f')]['find'](_0x5ac8bb)[_0x08ee('0x10')](handleEntityNotFound(_0x51680b,null))[_0x08ee('0x10')](respondWithResult(_0x51680b,null))[_0x08ee('0x1b')](handleError(_0x51680b,null));};exports['update']=function(_0x1278c7,_0x5dc96b){if(_0x1278c7['body']['id']){delete _0x1278c7[_0x08ee('0x47')]['id'];}return db[_0x08ee('0x3f')][_0x08ee('0x48')]({'where':{'id':_0x1278c7[_0x08ee('0x45')]['id']}})[_0x08ee('0x10')](handleEntityNotFound(_0x5dc96b,null))[_0x08ee('0x10')](saveUpdates(_0x1278c7['body'],null))[_0x08ee('0x10')](respondWithResult(_0x5dc96b,null))['catch'](handleError(_0x5dc96b,null));};exports['destroy']=function(_0x4432dd,_0x4364fd){return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x4432dd['params']['id']}})[_0x08ee('0x10')](handleEntityNotFound(_0x4364fd,null))[_0x08ee('0x10')](removeEntity(_0x4364fd,null))[_0x08ee('0x1b')](handleError(_0x4364fd,null));};exports[_0x08ee('0x49')]=function(_0x5eefae,_0x3ed67f){return db['MailMessage'][_0x08ee('0x49')]()[_0x08ee('0x10')](respondWithResult(_0x3ed67f,null))[_0x08ee('0x1b')](handleError(_0x3ed67f,null));};exports[_0x08ee('0x4a')]=function(_0x2fd870,_0x227bf2){return db[_0x08ee('0x3f')][_0x08ee('0x4a')](_0x2fd870[_0x08ee('0x47')])[_0x08ee('0x10')](function(_0x50d30a){if(_0x50d30a){if(_0x50d30a['direction']===_0x08ee('0x4b')&&!_0x50d30a['secret']){var _0x577a6d,_0xce9c4a,_0x4e8bdc;if(_0x2fd870[_0x08ee('0x47')]['to']){_0xce9c4a=_0x2fd870['body']['to'][_0x08ee('0x4c')](',')[0x0];}return db['MailAccount'][_0x08ee('0x4d')]({'where':{'id':_0x50d30a[_0x08ee('0x4e')]},'include':[{'model':db[_0x08ee('0x4f')],'as':'List','include':[{'model':db[_0x08ee('0x50')],'as':'Contacts','where':{'email':_0xce9c4a},'limit':0x1,'order':[['updatedAt',_0x08ee('0x51')]]}]},{'model':db[_0x08ee('0x52')],'as':_0x08ee('0x53'),'raw':!![]}]})[_0x08ee('0x10')](function(_0x55e134){_0x577a6d=_0x55e134;if(_0x577a6d&&_0x577a6d[_0x08ee('0x53')]){var _0x1e87f6={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x577a6d['Smtp'][_0x08ee('0x54')])){_0x1e87f6[_0x08ee('0x55')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x55')];_0x1e87f6[_0x08ee('0x56')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x56')];_0x1e87f6[_0x08ee('0x57')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x57')];if(_0x577a6d[_0x08ee('0x53')]['authentication']){_0x1e87f6[_0x08ee('0x58')]={'user':_0x577a6d[_0x08ee('0x53')][_0x08ee('0x59')],'pass':_0x577a6d['Smtp'][_0x08ee('0x5a')]};}}else{_0x1e87f6[_0x08ee('0x54')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x54')];_0x1e87f6[_0x08ee('0x58')]={'user':_0x577a6d[_0x08ee('0x53')]['user'],'pass':_0x577a6d[_0x08ee('0x53')][_0x08ee('0x5a')]};_0x1e87f6['secure']=_0x577a6d['Smtp'][_0x08ee('0x57')];}if(_0x2fd870['body'][_0x08ee('0x5b')]&&_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x08ee('0x34')]){for(var _0x240420=0x0;_0x240420<_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x08ee('0x34')];_0x240420+=0x1){_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x240420]={'filename':_0x2fd870['body'][_0x08ee('0x5b')][_0x240420]['name'],'path':path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],_0x08ee('0x5e'),_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x240420][_0x08ee('0x5f')])};}}_0x4e8bdc={'account':_0x1e87f6,'message':_0x2fd870[_0x08ee('0x47')]};return;}})['then'](function(){if(_0x577a6d['List']){if(_0x577a6d[_0x08ee('0x60')][_0x08ee('0x61')]['length']){return _0x577a6d[_0x08ee('0x60')][_0x08ee('0x61')][0x0];}else{return db[_0x08ee('0x50')][_0x08ee('0x4a')](_[_0x08ee('0xa')](_0x2fd870['body'],{'firstName':_0x2fd870[_0x08ee('0x47')]['to'],'email':_0x2fd870['body']['to'],'phone':_0x2fd870[_0x08ee('0x47')]['to'],'ListId':_0x577a6d[_0x08ee('0x62')]}));}}else{throw new Error(_0x08ee('0x63'));}})['then'](function(){if(_0x4e8bdc){return respondWithRpcPromise(_0x08ee('0x64'),_0x08ee('0x65'),_0x4e8bdc,client9003)[_0x08ee('0x10')](function(_0x52a02e){return _0x50d30a[_0x08ee('0x66')]({'read':!![],'messageId':_0x52a02e['messageId'],'sentAt':moment()[_0x08ee('0x67')](_0x08ee('0x68'))});})[_0x08ee('0x1b')](function(_0x80c71e){logger[_0x08ee('0x17')]('%s',JSON['stringify'](_0x80c71e));return _0x50d30a;});}return _0x50d30a;});}return _0x50d30a;}})[_0x08ee('0x10')](respondWithResult(_0x227bf2,0xc9))[_0x08ee('0x1b')](handleError(_0x227bf2,null));};exports[_0x08ee('0x69')]=function(_0x126b8f,_0x517a3e){var _0x4658b9={'agent':{},'channel':'mail'};if(_0x126b8f[_0x08ee('0x47')]['id']){delete _0x126b8f[_0x08ee('0x47')]['id'];}_0x126b8f['body'][_0x08ee('0x6a')]=!![];_0x126b8f[_0x08ee('0x47')]['readAt']=moment()['format'](_0x08ee('0x68'));_0x126b8f[_0x08ee('0x47')]['UserId']=_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')]||_0x126b8f[_0x08ee('0x59')]['id'];_0x4658b9[_0x08ee('0x6c')]['id']=_0x126b8f['body'][_0x08ee('0x6b')];return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x126b8f[_0x08ee('0x45')]['id'],'UserId':null}})[_0x08ee('0x10')](handleEntityNotFound(_0x517a3e,null))[_0x08ee('0x10')](saveUpdates(_0x126b8f[_0x08ee('0x47')],null))[_0x08ee('0x10')](function(_0x28ed25){if(_0x28ed25){_0x4658b9['message']=_0x28ed25[_0x08ee('0x6d')]({'plain':!![]});return db['MailInteraction'][_0x08ee('0x48')]({'where':{'id':_0x28ed25['MailInteractionId']}});}return null;})[_0x08ee('0x10')](handleEntityNotFound(_0x517a3e,null))[_0x08ee('0x10')](function(_0x47d02d){if(_0x47d02d){return _0x47d02d['update']({'UserId':_0x126b8f['body']['UserId'],'read1stAt':_[_0x08ee('0x6e')](_0x47d02d[_0x08ee('0x6f')])?moment()[_0x08ee('0x67')](_0x08ee('0x68')):undefined});}return null;})[_0x08ee('0x10')](function(_0x37033e){if(_0x37033e){_0x4658b9['interaction']=_0x37033e[_0x08ee('0x6d')]({'plain':!![]});interaction_log[_0x08ee('0x11')](_0x08ee('0x70'),_0x126b8f[_0x08ee('0x59')]['id'],_0x126b8f[_0x08ee('0x59')]['name'],_0x126b8f[_0x08ee('0x59')]['role'],_0x4658b9[_0x08ee('0x71')]['id'],_0x126b8f['body']?JSON[_0x08ee('0x16')](_0x126b8f['body']):_0x08ee('0x72'));return respondWithRpcPromise(_0x08ee('0x73'),'acceptMessage',_0x4658b9);}return null;})[_0x08ee('0x10')](function(_0x593541){var _0x4e9fd9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x593541['message']['ContactId'];return db['sequelize']['query'](_0x4e9fd9,{'type':db[_0x08ee('0x74')][_0x08ee('0x75')][_0x08ee('0x76')],'raw':!![]})[_0x08ee('0x10')](function(_0x38a2d2){return _0x38a2d2;});})[_0x08ee('0x10')](function(_0x334f74){if(_0x334f74){_0x4658b9[_0x08ee('0x19')][_0x08ee('0x77')]=_0x334f74[0x0];if(!_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')])return;return db[_0x08ee('0x78')][_0x08ee('0x48')]({'where':{'id':_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')],'role':'agent'},'attributes':['id',_0x08ee('0x27'),_0x08ee('0x79'),'email',_0x08ee('0x7a')],'raw':!![]});}return null;})[_0x08ee('0x10')](function(_0x46e93){if(!_0x46e93)return null;_0x4658b9['message'][_0x08ee('0x6c')]=_0x46e93;return _0x4658b9;})[_0x08ee('0x10')](function(_0x45c444){if(_0x45c444){if(_0x126b8f[_0x08ee('0x47')]['manual']){_0x4658b9[_0x08ee('0x19')]['interface']=util[_0x08ee('0x67')](_0x08ee('0x7b'),_0x126b8f[_0x08ee('0x59')][_0x08ee('0x27')]);_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7c')]=_0x4658b9[_0x08ee('0x7c')];_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7d')]=_0x4658b9[_0x08ee('0x7c')];_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7e')]=_0x08ee('0x69');_0x4658b9[_0x08ee('0x19')][_0x08ee('0x47')]=htmlToText[_0x08ee('0x7f')](_0x4658b9['message']['body']);return respondWithRpcPromise(_0x08ee('0x80'),'EventManager',{'event':_0x08ee('0x81'),'message':_0x4658b9['message']},client9002)[_0x08ee('0x10')](function(){return _0x4658b9;});}return _0x4658b9;}return null;})[_0x08ee('0x10')](respondWithResult(_0x517a3e,null))[_0x08ee('0x1b')](handleError(_0x517a3e,null));};exports[_0x08ee('0x82')]=function(_0x5ae3b7,_0x2d1bdb){var _0x350b4c={'agent':{},'channel':_0x08ee('0x83')};if(_0x5ae3b7[_0x08ee('0x47')]['id']){delete _0x5ae3b7[_0x08ee('0x47')]['id'];}_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')]=_0x5ae3b7[_0x08ee('0x47')]['UserId']||_0x5ae3b7['user']['id'];_0x350b4c[_0x08ee('0x6c')]['id']=_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')];return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x5ae3b7[_0x08ee('0x45')]['id'],'UserId':null}})[_0x08ee('0x10')](handleEntityNotFound(_0x2d1bdb,null))['then'](function(_0x4a42fc){if(_0x4a42fc){_0x350b4c[_0x08ee('0x19')]=_0x4a42fc[_0x08ee('0x6d')]({'plain':!![]});return db[_0x08ee('0x84')][_0x08ee('0x48')]({'where':{'id':_0x4a42fc['MailInteractionId']}});}return null;})[_0x08ee('0x10')](handleEntityNotFound(_0x2d1bdb,null))[_0x08ee('0x10')](function(_0x520c4f){if(_0x520c4f){_0x350b4c['interaction']=_0x520c4f[_0x08ee('0x6d')]({'plain':!![]});interaction_log[_0x08ee('0x11')](_0x08ee('0x85'),_0x5ae3b7[_0x08ee('0x59')]['id'],_0x5ae3b7[_0x08ee('0x59')][_0x08ee('0x27')],_0x5ae3b7['user'][_0x08ee('0x86')],_0x350b4c['interaction']['id'],_0x5ae3b7['body']?JSON[_0x08ee('0x16')](_0x5ae3b7[_0x08ee('0x47')]):_0x08ee('0x72'));return respondWithRpcPromise(_0x08ee('0x87'),_0x08ee('0x88'),_0x350b4c);}return null;})['then'](function(_0x2a008b){var _0x154067='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a008b[_0x08ee('0x19')][_0x08ee('0x89')];return db[_0x08ee('0x8a')]['query'](_0x154067,{'type':db[_0x08ee('0x74')][_0x08ee('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x16e3bc){return _0x16e3bc;});})['then'](function(_0x45534a){if(_0x45534a){_0x350b4c[_0x08ee('0x19')][_0x08ee('0x77')]=_0x45534a[0x0];if(!_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')])return;return db[_0x08ee('0x78')][_0x08ee('0x48')]({'where':{'id':_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')],'role':_0x08ee('0x6c')},'attributes':['id',_0x08ee('0x27'),_0x08ee('0x79'),_0x08ee('0x8b'),_0x08ee('0x7a')],'raw':!![]});}return null;})[_0x08ee('0x10')](function(_0xa45ff1){if(!_0xa45ff1)return null;_0x350b4c[_0x08ee('0x19')][_0x08ee('0x6c')]=_0xa45ff1;return _0x350b4c;})[_0x08ee('0x10')](function(_0x579094){if(_0x579094){_0x579094[_0x08ee('0x19')]['interface']=util[_0x08ee('0x67')](_0x08ee('0x7b'),_0x5ae3b7['user'][_0x08ee('0x27')]);_0x579094[_0x08ee('0x19')][_0x08ee('0x7c')]=_0x350b4c[_0x08ee('0x7c')];_0x579094['message'][_0x08ee('0x7d')]=_0x350b4c[_0x08ee('0x7c')];_0x579094[_0x08ee('0x19')]['event']='reject';_0x579094[_0x08ee('0x19')][_0x08ee('0x47')]=htmlToText[_0x08ee('0x7f')](_0x350b4c[_0x08ee('0x19')][_0x08ee('0x47')]);respondWithRpcPromise(_0x08ee('0x80'),_0x08ee('0x80'),{'event':_0x08ee('0x8c'),'message':_0x579094[_0x08ee('0x19')]},client9002);return _0x350b4c;}return null;})['then'](respondWithResult(_0x2d1bdb,null))['catch'](handleError(_0x2d1bdb,null));};exports[_0x08ee('0x8d')]=function(_0x3be076,_0x462cad){var _0x2b018b=moment()[_0x08ee('0x8e')]()[_0x08ee('0x8f')]();var _0x8fb29d=path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],_0x08ee('0x90'),_0x08ee('0x91'),'tmp');var _0x2d5d1e=path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],'server',_0x08ee('0x91'),_0x08ee('0x5b'));var _0x58f12e=util['format'](_0x08ee('0x92'),_0x2b018b);return db[_0x08ee('0x3f')]['find']({'where':{'id':_0x3be076[_0x08ee('0x45')]['id']},'attributes':['id',_0x08ee('0x47'),'from','to','cc',_0x08ee('0x93'),_0x08ee('0x94'),_0x08ee('0x95')],'include':_0x3be076['query'][_0x08ee('0x5b')]?[{'model':db[_0x08ee('0x96')],'as':_0x08ee('0x97')}]:undefined})[_0x08ee('0x10')](handleEntityNotFound(_0x462cad,null))[_0x08ee('0x10')](function(_0xfef019){if(_0xfef019){var _0x272098=_0xfef019;var _0x46afc8={'from':_0x272098[_0x08ee('0x98')],'to':_0x272098['to'],'subject':_0x272098[_0x08ee('0x94')],'html':_0x272098[_0x08ee('0x47')],'headers':{'Date':moment(_0x272098[_0x08ee('0x95')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xfef019['cc']){_0x46afc8[_0x08ee('0x99')]['Cc']=_0xfef019['cc'];}if(_0xfef019[_0x08ee('0x93')]){_0x46afc8[_0x08ee('0x99')]['Bcc']=_0xfef019['bcc'];}return new BPromise(function(_0x4d5e7e,_0x46f9e2){if(_0xfef019[_0x08ee('0x97')]){for(var _0x376595=0x0;_0x376595<_0xfef019[_0x08ee('0x97')][_0x08ee('0x34')];_0x376595++){var _0x1f9343=_0xfef019['Attachments'][_0x376595];var _0x214f1b=path['join'](_0x2d5d1e,_0x1f9343['basename']);if(fs[_0x08ee('0x9a')](_0x214f1b)){_0x46afc8[_0x08ee('0x5b')][_0x08ee('0x9b')]({'name':_0x1f9343[_0x08ee('0x27')],'contentType':_0x1f9343[_0x08ee('0x3c')],'data':fs['readFileSync'](_0x214f1b)});}}}emlformat['build'](_0x46afc8,function(_0x5d70fe,_0x3abb81){if(_0x5d70fe)return _0x46f9e2(_0x5d70fe);fs['writeFileSync'](path['join'](_0x8fb29d,_0x58f12e),_0x3abb81);return _0x4d5e7e(_0x3abb81);});});}})[_0x08ee('0x10')](function(_0x3b2f45){if(_0x3b2f45){return _0x462cad[_0x08ee('0x8d')](path[_0x08ee('0x5c')](_0x8fb29d,_0x58f12e),_0x58f12e,function(_0x37a6ed){if(!_0x37a6ed)fs[_0x08ee('0x9c')](path[_0x08ee('0x5c')](_0x8fb29d,_0x58f12e));});}})[_0x08ee('0x1b')](handleError(_0x462cad,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 9f42b07..254d627 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 _0xc337=['hook','exports','events','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x578dbf,_0x110883){var _0x3ea1f9=function(_0x2287c9){while(--_0x2287c9){_0x578dbf['push'](_0x578dbf['shift']());}};_0x3ea1f9(++_0x110883);}(_0xc337,0x17e));var _0x7c33=function(_0x5734ab,_0x537b83){_0x5734ab=_0x5734ab-0x0;var _0x4b862e=_0xc337[_0x5734ab];return _0x4b862e;};'use strict';var EventEmitter=require(_0x7c33('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x7c33('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7c33('0x2')](0x0);var events={'afterCreate':_0x7c33('0x3'),'afterUpdate':_0x7c33('0x4'),'afterDestroy':_0x7c33('0x5')};function emitEvent(_0x36e29c){return function(_0x5be064,_0x4f62d2,_0x586804){MailMessageEvents[_0x7c33('0x6')](_0x36e29c+':'+_0x5be064['id'],_0x5be064);MailMessageEvents[_0x7c33('0x6')](_0x36e29c,_0x5be064);_0x586804(null);};}for(var e in events){if(events[_0x7c33('0x7')](e)){var event=events[e];MailMessage[_0x7c33('0x8')](e,emitEvent(event));}}module[_0x7c33('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xd732=['setMaxListeners','save','update','emit','events'];(function(_0xaf0996,_0x3ee642){var _0x8fde5a=function(_0x130dc7){while(--_0x130dc7){_0xaf0996['push'](_0xaf0996['shift']());}};_0x8fde5a(++_0x3ee642);}(_0xd732,0x171));var _0x2d73=function(_0x3a8b72,_0x5746f9){_0x3a8b72=_0x3a8b72-0x0;var _0x1f66fb=_0xd732[_0x3a8b72];return _0x1f66fb;};'use strict';var EventEmitter=require(_0x2d73('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2d73('0x1')](0x0);var events={'afterCreate':_0x2d73('0x2'),'afterUpdate':_0x2d73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e2fae){return function(_0x48fa58,_0x12e063,_0x4d73eb){MailMessageEvents[_0x2d73('0x4')](_0x5e2fae+':'+_0x48fa58['id'],_0x48fa58);MailMessageEvents[_0x2d73('0x4')](_0x5e2fae,_0x48fa58);_0x4d73eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5d39711..5d91dd4 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 _0x21eb=['direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get'];(function(_0x9eebe,_0x5ef60f){var _0x891171=function(_0x423a45){while(--_0x423a45){_0x9eebe['push'](_0x9eebe['shift']());}};_0x891171(++_0x5ef60f);}(_0x21eb,0x9d));var _0xb21e=function(_0x3ad3f4,_0x2cc49a){_0x3ad3f4=_0x3ad3f4-0x0;var _0x39d845=_0x21eb[_0x3ad3f4];return _0x39d845;};'use strict';var _=require(_0xb21e('0x0'));var util=require(_0xb21e('0x1'));var logger=require('../../config/logger')(_0xb21e('0x2'));var moment=require('moment');var BPromise=require(_0xb21e('0x3'));var rp=require(_0xb21e('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb21e('0x5'));var attributes=require('./mailMessage.attributes');module[_0xb21e('0x6')]=function(_0x7f8a98,_0x42a8db){return _0x7f8a98[_0xb21e('0x7')](_0xb21e('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xb21e('0x9'),'fields':[_0xb21e('0x9')]},{'name':_0xb21e('0xa'),'fields':[_0xb21e('0xb'),'subject'],'type':_0xb21e('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2fb33f,_0x6139a7,_0x2d5d0f){if(_0x2fb33f[_0xb21e('0xd')]){_0x2fb33f['plainBody']=htmlToText[_0xb21e('0xe')](_0x2fb33f[_0xb21e('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2d5d0f(null,_0x6139a7);},'afterCreate':function(_0x128204,_0x16697f,_0x3eb4e6){var _0x5d210f=_0x7f8a98[_0xb21e('0xf')];var _0x2fabac=_0x128204[_0xb21e('0x10')]({'plain':!![]});if(_0x2fabac[_0xb21e('0x11')][_0xb21e('0x12')]()==='in'||_0x2fabac['direction'][_0xb21e('0x12')]()===_0xb21e('0x13')&&!_0x2fabac[_0xb21e('0x14')]&&!_['isNil'](_0x2fabac[_0xb21e('0x15')])){_0x5d210f[_0xb21e('0x16')][_0xb21e('0x17')]({'where':{'id':_0x2fabac['MailInteractionId']}})[_0xb21e('0x18')](function(_0x206b53){if(_0x206b53){_0x206b53[_0xb21e('0x19')]({'lastMsgAt':_0x2fabac[_0xb21e('0x1a')],'lastMsgDirection':_0x2fabac[_0xb21e('0x11')][_0xb21e('0x12')]()});}})['catch'](function(_0x7457a){console['error'](_0x7457a);});}_0x3eb4e6();}},'charset':_0xb21e('0x1b'),'collate':_0xb21e('0x1c')});}; \ No newline at end of file +var _0xb367=['update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId'];(function(_0x92a418,_0xb7558a){var _0x3eb3f1=function(_0x58e2a8){while(--_0x58e2a8){_0x92a418['push'](_0x92a418['shift']());}};_0x3eb3f1(++_0xb7558a);}(_0xb367,0x88));var _0x7b36=function(_0x3d7516,_0x3109fa){_0x3d7516=_0x3d7516-0x0;var _0xb30d=_0xb367[_0x3d7516];return _0xb30d;};'use strict';var _=require(_0x7b36('0x0'));var util=require(_0x7b36('0x1'));var logger=require(_0x7b36('0x2'))(_0x7b36('0x3'));var moment=require(_0x7b36('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b36('0x5'));var htmlToText=require(_0x7b36('0x6'));var fs=require('fs');var path=require(_0x7b36('0x7'));var rimraf=require(_0x7b36('0x8'));var config=require('../../config/environment');var attributes=require(_0x7b36('0x9'));module[_0x7b36('0xa')]=function(_0x42d7f4,_0x7a2197){return _0x42d7f4[_0x7b36('0xb')](_0x7b36('0xc'),attributes,{'tableName':_0x7b36('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7b36('0xe')]},{'name':_0x7b36('0xf'),'fields':[_0x7b36('0x10'),_0x7b36('0x11')],'type':_0x7b36('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3187d8,_0x5b4c42,_0x4ee5ab){if(_0x3187d8[_0x7b36('0x13')]){_0x3187d8[_0x7b36('0x10')]=htmlToText[_0x7b36('0x14')](_0x3187d8[_0x7b36('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4ee5ab(null,_0x5b4c42);},'afterCreate':function(_0x201762,_0x48a9c2,_0x2c0c36){var _0x4a8389=_0x42d7f4['models'];var _0x31e393=_0x201762[_0x7b36('0x15')]({'plain':!![]});if(_0x31e393[_0x7b36('0x16')]['toLowerCase']()==='in'||_0x31e393[_0x7b36('0x16')]['toLowerCase']()===_0x7b36('0x17')&&!_0x31e393[_0x7b36('0x18')]&&!_[_0x7b36('0x19')](_0x31e393[_0x7b36('0x1a')])){_0x4a8389[_0x7b36('0x1b')]['findOne']({'where':{'id':_0x31e393[_0x7b36('0x1c')]}})['then'](function(_0x15d10b){if(_0x15d10b){_0x15d10b[_0x7b36('0x1d')]({'lastMsgAt':_0x31e393['createdAt'],'lastMsgDirection':_0x31e393[_0x7b36('0x16')]['toLowerCase']()});}})[_0x7b36('0x1e')](function(_0x1e73f6){console['error'](_0x1e73f6);});}_0x2c0c36();}},'charset':_0x7b36('0x1f'),'collate':_0x7b36('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 01d516a..a115ae7 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 _0x056b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateMailMessage','MailMessage','body','options','debug','catch','util','moment','bluebird','randomstring'];(function(_0xa21fa0,_0x423401){var _0x4deb53=function(_0x5d2bb8){while(--_0x5d2bb8){_0xa21fa0['push'](_0xa21fa0['shift']());}};_0x4deb53(++_0x423401);}(_0x056b,0xb6));var _0xb056=function(_0x4ee0ba,_0x340d2c){_0x4ee0ba=_0x4ee0ba-0x0;var _0x52917f=_0x056b[_0x4ee0ba];return _0x52917f;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});config[_0xb056('0xc')]=_[_0xb056('0xd')](config[_0xb056('0xc')],{'host':_0xb056('0xe'),'port':0x18eb});var socket=require(_0xb056('0xf'))(new Redis(config['redis']));require('./mailMessage.socket')[_0xb056('0x10')](socket);function respondWithRpcPromise(_0x160c2a,_0xd33887,_0x290c9e){return new BPromise(function(_0x5ddddb,_0x170e1a){return client['request'](_0x160c2a,_0x290c9e)[_0xb056('0x11')](function(_0x23513f){logger[_0xb056('0x12')](_0xb056('0x13'),_0xd33887,_0xb056('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xd33887,_0xb056('0x14'),JSON[_0xb056('0x15')](_0x23513f));if(_0x23513f['error']){if(_0x23513f[_0xb056('0x16')][_0xb056('0x17')]===0x1f4){logger[_0xb056('0x16')](_0xb056('0x13'),_0xd33887,_0x23513f[_0xb056('0x16')][_0xb056('0x18')]);return _0x170e1a(_0x23513f[_0xb056('0x16')]['message']);}logger[_0xb056('0x16')](_0xb056('0x13'),_0xd33887,_0x23513f[_0xb056('0x16')][_0xb056('0x18')]);return _0x5ddddb(_0x23513f['error'][_0xb056('0x18')]);}else{logger['info'](_0xb056('0x13'),_0xd33887,_0xb056('0x14'));_0x5ddddb(_0x23513f['result'][_0xb056('0x18')]);}})['catch'](function(_0x45008c){logger[_0xb056('0x16')]('MailMessage,\x20%s,\x20%s',_0xd33887,_0x45008c);_0x170e1a(_0x45008c);});});}exports[_0xb056('0x19')]=function(_0x48cdaf){var _0x2107ee=this;return new Promise(function(_0x225081,_0x457b54){return db[_0xb056('0x1a')]['create'](_0x48cdaf[_0xb056('0x1b')],{'raw':_0x48cdaf['options']?_0x48cdaf[_0xb056('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb056('0x11')](function(_0x40ac2d){logger[_0xb056('0x12')](_0xb056('0x19'),_0x48cdaf);logger[_0xb056('0x1d')](_0xb056('0x19'),_0x48cdaf,JSON['stringify'](_0x40ac2d));_0x225081(_0x40ac2d);})[_0xb056('0x1e')](function(_0x18a3f2){logger[_0xb056('0x16')](_0xb056('0x19'),_0x18a3f2['message'],_0x48cdaf);_0x457b54(_0x2107ee[_0xb056('0x16')](0x1f4,_0x18a3f2[_0xb056('0x18')]));});});}; \ No newline at end of file +var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body'];(function(_0x2c697e,_0x399834){var _0x5bd6d5=function(_0x3a5c9d){while(--_0x3a5c9d){_0x2c697e['push'](_0x2c697e['shift']());}};_0x5bd6d5(++_0x399834);}(_0xb10b,0x12a));var _0xbb10=function(_0x20edd4,_0x7c30f2){_0x20edd4=_0x20edd4-0x0;var _0xc4a1e4=_0xb10b[_0x20edd4];return _0xc4a1e4;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c3986fd..04625b8 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 _0xd53a=['remove','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x407069,_0x18d9cf){var _0x2e8586=function(_0x50a9b6){while(--_0x50a9b6){_0x407069['push'](_0x407069['shift']());}};_0x2e8586(++_0x18d9cf);}(_0xd53a,0x14e));var _0xad53=function(_0x2f8dc7,_0x2e410c){_0x2f8dc7=_0x2f8dc7-0x0;var _0x1a6fd9=_0xd53a[_0x2f8dc7];return _0x1a6fd9;};'use strict';var MailMessageEvents=require(_0xad53('0x0'));var events=[_0xad53('0x1'),_0xad53('0x2'),'update'];function createListener(_0x2ac8e7,_0x36d642){return function(_0x116aba){_0x36d642[_0xad53('0x3')](_0x2ac8e7,_0x116aba);};}function removeListener(_0x2f1b3c,_0x19de86){return function(){MailMessageEvents[_0xad53('0x4')](_0x2f1b3c,_0x19de86);};}exports[_0xad53('0x5')]=function(_0x384211){for(var _0x1cceca=0x0,_0x2ee6bc=events[_0xad53('0x6')];_0x1cceca<_0x2ee6bc;_0x1cceca++){var _0xf4c56=events[_0x1cceca];var _0x32be8a=createListener(_0xad53('0x7')+_0xf4c56,_0x384211);MailMessageEvents['on'](_0xf4c56,_0x32be8a);}}; \ No newline at end of file +var _0xa43d=['remove','update','removeListener','register','length','mailMessage:','save'];(function(_0x51cad9,_0x110e59){var _0x132691=function(_0x193190){while(--_0x193190){_0x51cad9['push'](_0x51cad9['shift']());}};_0x132691(++_0x110e59);}(_0xa43d,0x172));var _0xda43=function(_0x2404ab,_0x1008c2){_0x2404ab=_0x2404ab-0x0;var _0x5edff9=_0xa43d[_0x2404ab];return _0x5edff9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xda43('0x0'),_0xda43('0x1'),_0xda43('0x2')];function createListener(_0x4a8780,_0x56fb7d){return function(_0x2435e7){_0x56fb7d['emit'](_0x4a8780,_0x2435e7);};}function removeListener(_0x3d583a,_0x492d51){return function(){MailMessageEvents[_0xda43('0x3')](_0x3d583a,_0x492d51);};}exports[_0xda43('0x4')]=function(_0x3f188b){for(var _0x16a8ed=0x0,_0x3febdc=events[_0xda43('0x5')];_0x16a8ed<_0x3febdc;_0x16a8ed++){var _0x3071da=events[_0x16a8ed];var _0x568b61=createListener(_0xda43('0x6')+_0x3071da,_0x3f188b);MailMessageEvents['on'](_0x3071da,_0x568b61);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index f7a932b..f7d29f2 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 _0x30b4=['getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x51599e,_0x5e0342){var _0x5ef3fd=function(_0x5193ec){while(--_0x5193ec){_0x51599e['push'](_0x51599e['shift']());}};_0x5ef3fd(++_0x5e0342);}(_0x30b4,0x101));var _0x430b=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x30b4[_0x487496];return _0x539dc8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x430b('0x0'));var timeout=require(_0x430b('0x1'));var express=require('express');var router=express[_0x430b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x430b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x430b('0x4'));var controller=require(_0x430b('0x5'));router[_0x430b('0x6')]('/',auth[_0x430b('0x7')](),controller[_0x430b('0x8')]);router[_0x430b('0x6')](_0x430b('0x9'),auth[_0x430b('0x7')](),controller[_0x430b('0xa')]);router[_0x430b('0x6')](_0x430b('0xb'),auth[_0x430b('0x7')](),controller[_0x430b('0xc')]);router[_0x430b('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x430b('0xd')]);router[_0x430b('0x6')]('/:id/teams',auth[_0x430b('0x7')](),controller['getTeams']);router[_0x430b('0x6')](_0x430b('0xe'),auth[_0x430b('0x7')](),controller[_0x430b('0xf')]);router[_0x430b('0x10')]('/',auth[_0x430b('0x7')](),controller[_0x430b('0x11')]);router[_0x430b('0x10')](_0x430b('0x12'),auth['isAuthenticated'](),controller[_0x430b('0x13')]);router[_0x430b('0x10')](_0x430b('0xe'),auth[_0x430b('0x7')](),controller[_0x430b('0x14')]);router[_0x430b('0x15')](_0x430b('0xb'),auth[_0x430b('0x7')](),controller[_0x430b('0x16')]);router[_0x430b('0x17')]('/:id',auth[_0x430b('0x7')](),controller[_0x430b('0x18')]);router[_0x430b('0x17')](_0x430b('0x12'),auth[_0x430b('0x7')](),controller[_0x430b('0x19')]);router[_0x430b('0x17')](_0x430b('0xe'),auth[_0x430b('0x7')](),controller[_0x430b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xdb7e=['/:id','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','index','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addAgents','put','update','delete'];(function(_0x5f4db8,_0xd07888){var _0x1430e9=function(_0x136aba){while(--_0x136aba){_0x5f4db8['push'](_0x5f4db8['shift']());}};_0x1430e9(++_0xd07888);}(_0xdb7e,0x1d4));var _0xedb7=function(_0x48d835,_0x12734){_0x48d835=_0x48d835-0x0;var _0x519f4f=_0xdb7e[_0x48d835];return _0x519f4f;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require(_0xedb7('0x3'));var express=require(_0xedb7('0x4'));var router=express['Router']();var fs_extra=require(_0xedb7('0x5'));var auth=require(_0xedb7('0x6'));var interaction=require(_0xedb7('0x7'));var config=require('../../config/environment');var controller=require(_0xedb7('0x8'));router[_0xedb7('0x9')]('/',auth['isAuthenticated'](),controller[_0xedb7('0xa')]);router[_0xedb7('0x9')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0xc')]);router[_0xedb7('0x9')]('/:id',auth[_0xedb7('0xd')](),controller[_0xedb7('0xe')]);router['get'](_0xedb7('0xf'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x10')]);router[_0xedb7('0x9')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x12')]);router['get'](_0xedb7('0x13'),auth[_0xedb7('0xd')](),controller['getAgents']);router[_0xedb7('0x14')]('/',auth[_0xedb7('0xd')](),controller['create']);router[_0xedb7('0x14')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller['addTeams']);router[_0xedb7('0x14')](_0xedb7('0x13'),auth['isAuthenticated'](),controller[_0xedb7('0x15')]);router[_0xedb7('0x16')]('/:id',auth[_0xedb7('0xd')](),controller[_0xedb7('0x17')]);router[_0xedb7('0x18')](_0xedb7('0x19'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x1a')]);router[_0xedb7('0x18')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller['removeTeams']);router['delete'](_0xedb7('0x13'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x1b')]);module[_0xedb7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5899420..ed76d1a 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 _0x3ae7=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x3ae7,0x72));var _0x73ae=function(_0x3d920d,_0x571ad9){_0x3d920d=_0x3d920d-0x0;var _0x4e46fc=_0x3ae7[_0x3d920d];return _0x4e46fc;};'use strict';var Sequelize=require(_0x73ae('0x0'));module['exports']={'name':{'type':Sequelize[_0x73ae('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x73ae('0x1')]},'timeout':{'type':Sequelize[_0x73ae('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x73ae('0x3')](_0x73ae('0x4'),_0x73ae('0x5'),_0x73ae('0x6'))}}; \ No newline at end of file +var _0x843a=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x1551b4,_0x879665){var _0x40e499=function(_0x2e81b6){while(--_0x2e81b6){_0x1551b4['push'](_0x1551b4['shift']());}};_0x40e499(++_0x879665);}(_0x843a,0xd9));var _0xa843=function(_0x3973b7,_0x5bb5c4){_0x3973b7=_0x3973b7-0x0;var _0xcb5a3c=_0x843a[_0x3973b7];return _0xcb5a3c;};'use strict';var Sequelize=require('sequelize');module[_0xa843('0x0')]={'name':{'type':Sequelize[_0xa843('0x1')],'unique':_0xa843('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa843('0x1')]},'timeout':{'type':Sequelize[_0xa843('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa843('0x4')](_0xa843('0x5'),'beepall',_0xa843('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 91095cb..4417179 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 _0xcef1=['userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','keys','UserMailQueue','nolimit','order','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact','value','removeAgents','addAgents','omit','spread','isArray'];(function(_0x5b0286,_0x2ac32b){var _0x3c15f6=function(_0x421b6e){while(--_0x421b6e){_0x5b0286['push'](_0x5b0286['shift']());}};_0x3c15f6(++_0x2ac32b);}(_0xcef1,0x1ac));var _0x1cef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcef1[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x1cef('0x0'));var rimraf=require(_0x1cef('0x1'));var zipdir=require(_0x1cef('0x2'));var jsonpatch=require(_0x1cef('0x3'));var rp=require(_0x1cef('0x4'));var moment=require(_0x1cef('0x5'));var BPromise=require(_0x1cef('0x6'));var Mustache=require(_0x1cef('0x7'));var util=require(_0x1cef('0x8'));var path=require('path');var sox=require(_0x1cef('0x9'));var csv=require('to-csv');var ejs=require(_0x1cef('0xa'));var fs=require('fs');var fs_extra=require(_0x1cef('0xb'));var _=require(_0x1cef('0xc'));var squel=require(_0x1cef('0xd'));var crypto=require(_0x1cef('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1cef('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1cef('0x10'));var Redis=require(_0x1cef('0x11'));var authService=require(_0x1cef('0x12'));var qs=require(_0x1cef('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cef('0x14'));var logger=require('../../config/logger')(_0x1cef('0x15'));var utils=require(_0x1cef('0x16'));var config=require(_0x1cef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cef('0x18'))['db'];config[_0x1cef('0x19')]=_[_0x1cef('0x1a')](config['redis'],{'host':_0x1cef('0x1b'),'port':0x18eb});var socket=require(_0x1cef('0x1c'))(new Redis(config[_0x1cef('0x19')]));require(_0x1cef('0x1d'))[_0x1cef('0x1e')](socket);function respondWithStatusCode(_0x69a3aa,_0x19a09a){_0x19a09a=_0x19a09a||0xcc;return function(_0x58753b){if(_0x58753b){return _0x69a3aa[_0x1cef('0x1f')](_0x19a09a);}return _0x69a3aa[_0x1cef('0x20')](_0x19a09a)[_0x1cef('0x21')]();};}function respondWithResult(_0x4a5d8f,_0x50d71c){_0x50d71c=_0x50d71c||0xc8;return function(_0x2d992c){if(_0x2d992c){return _0x4a5d8f['status'](_0x50d71c)[_0x1cef('0x22')](_0x2d992c);}};}function respondWithFilteredResult(_0x3b9596,_0x529376){return function(_0x61beef){if(_0x61beef){var _0xd8f41=typeof _0x529376[_0x1cef('0x23')]===_0x1cef('0x24')&&typeof _0x529376[_0x1cef('0x25')]===_0x1cef('0x24');var _0x3ef533=_0x61beef[_0x1cef('0x26')];var _0x45316e=_0xd8f41?0x0:_0x529376[_0x1cef('0x23')];var _0x4c675d=_0xd8f41?_0x61beef[_0x1cef('0x26')]:_0x529376[_0x1cef('0x23')]+_0x529376[_0x1cef('0x25')];var _0x3f1175;if(_0x4c675d>=_0x3ef533){_0x4c675d=_0x3ef533;_0x3f1175=0xc8;}else{_0x3f1175=0xce;}_0x3b9596[_0x1cef('0x20')](_0x3f1175);return _0x3b9596['set']('Content-Range',_0x45316e+'-'+_0x4c675d+'/'+_0x3ef533)['json'](_0x61beef);}return null;};}function patchUpdates(_0x4b91c6){return function(_0x25be67){try{jsonpatch[_0x1cef('0x27')](_0x25be67,_0x4b91c6,!![]);}catch(_0x3b6820){return BPromise[_0x1cef('0x28')](_0x3b6820);}return _0x25be67[_0x1cef('0x29')]();};}function saveUpdates(_0x3226d9,_0x18aba0){return function(_0x15b95c){if(_0x15b95c){return _0x15b95c[_0x1cef('0x2a')](_0x3226d9)[_0x1cef('0x2b')](function(_0x32a84b){return _0x32a84b;});}return null;};}function removeEntity(_0x1876f5,_0x9df0){return function(_0x1b2a45){if(_0x1b2a45){return _0x1b2a45[_0x1cef('0x2c')]()['then'](function(){var _0x3b2261=_0x1b2a45[_0x1cef('0x2d')]({'plain':!![]});var _0x5693d1=_0x1cef('0x2e');return db[_0x1cef('0x2f')]['destroy']({'where':{'type':_0x5693d1,'resourceId':_0x3b2261['id']}})[_0x1cef('0x2b')](function(){return _0x1b2a45;});})[_0x1cef('0x2b')](function(){_0x1876f5[_0x1cef('0x20')](0xcc)[_0x1cef('0x21')]();});}};}function handleEntityNotFound(_0x25cced,_0x35cd64){return function(_0x4cc5b1){if(!_0x4cc5b1){_0x25cced['sendStatus'](0x194);}return _0x4cc5b1;};}function handleError(_0x20a603,_0x58ba93){_0x58ba93=_0x58ba93||0x1f4;return function(_0x45f588){logger[_0x1cef('0x30')](_0x45f588[_0x1cef('0x31')]);if(_0x45f588[_0x1cef('0x32')]){delete _0x45f588[_0x1cef('0x32')];}_0x20a603[_0x1cef('0x20')](_0x58ba93)[_0x1cef('0x33')](_0x45f588);};}exports[_0x1cef('0x34')]=function(_0x42e137,_0x4e8a73){var _0x11ecd0={},_0x2a6bc2={},_0x424a7d={'count':0x0,'rows':[]};var _0x5f5cb3=_['map'](db[_0x1cef('0x35')][_0x1cef('0x36')],function(_0x1a2212){return{'name':_0x1a2212[_0x1cef('0x37')],'type':_0x1a2212['type']['key']};});_0x2a6bc2[_0x1cef('0x38')]=_['map'](_0x5f5cb3,_0x1cef('0x32'));_0x2a6bc2[_0x1cef('0x39')]=_['keys'](_0x42e137[_0x1cef('0x39')]);_0x2a6bc2[_0x1cef('0x3a')]=_[_0x1cef('0x3b')](_0x2a6bc2[_0x1cef('0x38')],_0x2a6bc2[_0x1cef('0x39')]);_0x11ecd0[_0x1cef('0x3c')]=_[_0x1cef('0x3b')](_0x2a6bc2['model'],qs['fields'](_0x42e137[_0x1cef('0x39')][_0x1cef('0x3d')]));_0x11ecd0[_0x1cef('0x3c')]=_0x11ecd0[_0x1cef('0x3c')][_0x1cef('0x3e')]?_0x11ecd0[_0x1cef('0x3c')]:_0x2a6bc2['model'];if(!_0x42e137[_0x1cef('0x39')][_0x1cef('0x3f')]('nolimit')){_0x11ecd0['limit']=qs[_0x1cef('0x25')](_0x42e137['query']['limit']);_0x11ecd0[_0x1cef('0x23')]=qs['offset'](_0x42e137[_0x1cef('0x39')][_0x1cef('0x23')]);}_0x11ecd0['order']=qs['sort'](_0x42e137[_0x1cef('0x39')][_0x1cef('0x40')]);_0x11ecd0['where']=qs[_0x1cef('0x3a')](_[_0x1cef('0x41')](_0x42e137[_0x1cef('0x39')],_0x2a6bc2[_0x1cef('0x3a')]),_0x5f5cb3);if(_0x42e137[_0x1cef('0x39')][_0x1cef('0x42')]){_0x11ecd0[_0x1cef('0x43')]=_[_0x1cef('0x44')](_0x11ecd0[_0x1cef('0x43')],{'$or':_[_0x1cef('0x45')](_0x5f5cb3,function(_0x4d5b70){if(_0x4d5b70['type']!==_0x1cef('0x46')){var _0x275651={};_0x275651[_0x4d5b70[_0x1cef('0x32')]]={'$like':'%'+_0x42e137[_0x1cef('0x39')][_0x1cef('0x42')]+'%'};return _0x275651;}})});}_0x11ecd0=_[_0x1cef('0x44')]({},_0x11ecd0,_0x42e137[_0x1cef('0x47')]);var _0x1750fb={'where':_0x11ecd0[_0x1cef('0x43')]};return db[_0x1cef('0x35')]['count'](_0x1750fb)['then'](function(_0x16b15e){_0x424a7d[_0x1cef('0x26')]=_0x16b15e;if(_0x42e137[_0x1cef('0x39')][_0x1cef('0x48')]){_0x11ecd0[_0x1cef('0x49')]=[{'all':!![]}];}return db[_0x1cef('0x35')][_0x1cef('0x4a')](_0x11ecd0);})[_0x1cef('0x2b')](function(_0x4c4eaf){_0x424a7d[_0x1cef('0x4b')]=_0x4c4eaf;return _0x424a7d;})[_0x1cef('0x2b')](respondWithFilteredResult(_0x4e8a73,_0x11ecd0))[_0x1cef('0x4c')](handleError(_0x4e8a73,null));};exports[_0x1cef('0x4d')]=function(_0x2039e0,_0x890942){var _0x2d4516={'raw':!![],'where':{'id':_0x2039e0['params']['id']}},_0x9920e9={};_0x9920e9[_0x1cef('0x38')]=_['keys'](db[_0x1cef('0x35')][_0x1cef('0x36')]);_0x9920e9[_0x1cef('0x39')]=_['keys'](_0x2039e0['query']);_0x9920e9[_0x1cef('0x3a')]=_['intersection'](_0x9920e9[_0x1cef('0x38')],_0x9920e9[_0x1cef('0x39')]);_0x2d4516[_0x1cef('0x3c')]=_[_0x1cef('0x3b')](_0x9920e9['model'],qs[_0x1cef('0x3d')](_0x2039e0['query'][_0x1cef('0x3d')]));_0x2d4516[_0x1cef('0x3c')]=_0x2d4516[_0x1cef('0x3c')]['length']?_0x2d4516[_0x1cef('0x3c')]:_0x9920e9['model'];if(_0x2039e0['query']['includeAll']){_0x2d4516[_0x1cef('0x49')]=[{'all':!![]}];}_0x2d4516=_[_0x1cef('0x44')]({},_0x2d4516,_0x2039e0[_0x1cef('0x47')]);return db[_0x1cef('0x35')][_0x1cef('0x4e')](_0x2d4516)[_0x1cef('0x2b')](handleEntityNotFound(_0x890942,null))[_0x1cef('0x2b')](respondWithResult(_0x890942,null))['catch'](handleError(_0x890942,null));};exports[_0x1cef('0x4f')]=function(_0x3ab980,_0x1592c6){return db[_0x1cef('0x35')][_0x1cef('0x4f')](_0x3ab980['body'],{})[_0x1cef('0x2b')](function(_0x4e204e){var _0x41ab3b=_0x3ab980['user'][_0x1cef('0x2d')]({'plain':!![]});if(!_0x41ab3b)throw new Error(_0x1cef('0x50'));if(_0x41ab3b['role']===_0x1cef('0x51')){var _0x247012=_0x4e204e[_0x1cef('0x2d')]({'plain':!![]});var _0x8a080d=_0x1cef('0x2e');return db[_0x1cef('0x52')][_0x1cef('0x4e')]({'where':{'name':_0x8a080d,'userProfileId':_0x41ab3b['userProfileId']},'raw':!![]})['then'](function(_0x48fd41){if(_0x48fd41&&_0x48fd41[_0x1cef('0x53')]===0x0){return db['UserProfileResource'][_0x1cef('0x4f')]({'name':_0x247012[_0x1cef('0x32')],'resourceId':_0x247012['id'],'type':_0x48fd41[_0x1cef('0x32')],'sectionId':_0x48fd41['id']},{})[_0x1cef('0x2b')](function(){return _0x4e204e;});}else{return _0x4e204e;}})[_0x1cef('0x4c')](function(_0x2be3cd){logger[_0x1cef('0x30')](_0x1cef('0x54'),_0x2be3cd);throw _0x2be3cd;});}return _0x4e204e;})[_0x1cef('0x2b')](respondWithResult(_0x1592c6,0xc9))[_0x1cef('0x4c')](handleError(_0x1592c6,null));};exports['update']=function(_0x3c1b28,_0x3631da){if(_0x3c1b28[_0x1cef('0x55')]['id']){delete _0x3c1b28[_0x1cef('0x55')]['id'];}return db[_0x1cef('0x35')][_0x1cef('0x4e')]({'where':{'id':_0x3c1b28[_0x1cef('0x56')]['id']}})[_0x1cef('0x2b')](handleEntityNotFound(_0x3631da,null))['then'](saveUpdates(_0x3c1b28[_0x1cef('0x55')],null))['then'](respondWithResult(_0x3631da,null))['catch'](handleError(_0x3631da,null));};exports[_0x1cef('0x2c')]=function(_0x578c1c,_0x2a3846){return db[_0x1cef('0x35')][_0x1cef('0x4e')]({'where':{'id':_0x578c1c[_0x1cef('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a3846,null))[_0x1cef('0x2b')](removeEntity(_0x2a3846,null))[_0x1cef('0x4c')](handleError(_0x2a3846,null));};exports[_0x1cef('0x57')]=function(_0x5305b0,_0x8a577c){return db['MailQueue'][_0x1cef('0x57')]()[_0x1cef('0x2b')](respondWithResult(_0x8a577c,null))['catch'](handleError(_0x8a577c,null));};exports['getMembers']=function(_0x47c13a,_0x2a645b,_0x5689c2){var _0x1b47bf={'raw':!![],'where':{}},_0x3a58fd={},_0x571ca5;return db['MailQueue'][_0x1cef('0x58')]({'where':{'id':_0x47c13a[_0x1cef('0x56')]['id']}})[_0x1cef('0x2b')](handleEntityNotFound(_0x2a645b,null))[_0x1cef('0x2b')](function(_0x2bd40d){if(_0x2bd40d){_0x571ca5=_0x2bd40d['get']({'plain':!![]});_0x3a58fd[_0x1cef('0x38')]=_[_0x1cef('0x59')](db[_0x1cef('0x5a')]['rawAttributes']);_0x3a58fd[_0x1cef('0x39')]=_['keys'](_0x47c13a[_0x1cef('0x39')]);_0x3a58fd['filters']=_[_0x1cef('0x3b')](_0x3a58fd[_0x1cef('0x38')],_0x3a58fd['query']);_0x1b47bf[_0x1cef('0x3c')]=_[_0x1cef('0x3b')](_0x3a58fd['model'],qs[_0x1cef('0x3d')](_0x47c13a['query'][_0x1cef('0x3d')]));_0x1b47bf[_0x1cef('0x3c')]=_0x1b47bf[_0x1cef('0x3c')][_0x1cef('0x3e')]?_0x1b47bf[_0x1cef('0x3c')]:_0x3a58fd[_0x1cef('0x38')];if(!_0x47c13a[_0x1cef('0x39')][_0x1cef('0x3f')](_0x1cef('0x5b'))){_0x1b47bf[_0x1cef('0x25')]=qs[_0x1cef('0x25')](_0x47c13a[_0x1cef('0x39')][_0x1cef('0x25')]);_0x1b47bf['offset']=qs['offset'](_0x47c13a[_0x1cef('0x39')][_0x1cef('0x23')]);}_0x1b47bf[_0x1cef('0x5c')]=qs[_0x1cef('0x40')](_0x47c13a['query'][_0x1cef('0x40')]);_0x1b47bf[_0x1cef('0x43')]=qs['filters'](_['pick'](_0x47c13a[_0x1cef('0x39')],_0x3a58fd[_0x1cef('0x3a')]));_0x1b47bf[_0x1cef('0x43')][_0x1cef('0x5d')]=_0x2bd40d['id'];if(_0x47c13a[_0x1cef('0x39')][_0x1cef('0x42')]){_0x1b47bf['where']=_[_0x1cef('0x44')](_0x1b47bf[_0x1cef('0x43')],{'$or':_[_0x1cef('0x45')](_0x1b47bf[_0x1cef('0x3c')],function(_0x325afa){var _0x17d3a6={};_0x17d3a6[_0x325afa]={'$like':'%'+_0x47c13a['query'][_0x1cef('0x42')]+'%'};return _0x17d3a6;})});}_0x1b47bf=_[_0x1cef('0x44')]({},_0x1b47bf,_0x47c13a[_0x1cef('0x47')]);return db[_0x1cef('0x5a')][_0x1cef('0x4a')](_0x1b47bf);}})[_0x1cef('0x2b')](function(_0x21493e){if(_0x21493e){return db[_0x1cef('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x21493e,_0x1cef('0x5f')),'role':'agent'},'attributes':['id','name',_0x1cef('0x60'),_0x1cef('0x61'),_0x1cef('0x62')]});}})['then'](function(_0x1c3b6e){if(_0x1c3b6e){return{'count':_0x1c3b6e['count'],'rows':_[_0x1cef('0x45')](_0x1c3b6e[_0x1cef('0x4b')],function(_0x5a8657){return{'membername':_0x5a8657[_0x1cef('0x32')],'UserId':_0x5a8657['id'],'queue_name':_0x571ca5[_0x1cef('0x32')],'MailQueueId':_0x571ca5['id'],'interface':util[_0x1cef('0x63')]('%s/%s',_0x1cef('0x64'),_0x5a8657[_0x1cef('0x32')]),'penalty':0x0,'paused':_0x5a8657[_0x1cef('0x60')],'createdAt':_0x5a8657[_0x1cef('0x62')],'updatedAt':_0x5a8657[_0x1cef('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1cef('0x2b')](respondWithFilteredResult(_0x2a645b,_0x1b47bf))['catch'](handleError(_0x2a645b,null));};exports[_0x1cef('0x65')]=function(_0x2ee9e6,_0x58fe11,_0x5dbcfc){var _0x1a1b0d={};var _0x584ecb={};var _0x44ed0f;var _0x4e713a;return db[_0x1cef('0x35')][_0x1cef('0x58')]({'where':{'id':_0x2ee9e6[_0x1cef('0x56')]['id']}})['then'](handleEntityNotFound(_0x58fe11,null))[_0x1cef('0x2b')](function(_0x477adf){if(_0x477adf){_0x44ed0f=_0x477adf;_0x584ecb['model']=_[_0x1cef('0x59')](db[_0x1cef('0x66')][_0x1cef('0x36')]);_0x584ecb[_0x1cef('0x39')]=_[_0x1cef('0x59')](_0x2ee9e6[_0x1cef('0x39')]);_0x584ecb[_0x1cef('0x3a')]=_[_0x1cef('0x3b')](_0x584ecb[_0x1cef('0x38')],_0x584ecb[_0x1cef('0x39')]);_0x1a1b0d[_0x1cef('0x3c')]=_['intersection'](_0x584ecb[_0x1cef('0x38')],qs['fields'](_0x2ee9e6[_0x1cef('0x39')][_0x1cef('0x3d')]));_0x1a1b0d[_0x1cef('0x3c')]=_0x1a1b0d[_0x1cef('0x3c')][_0x1cef('0x3e')]?_0x1a1b0d[_0x1cef('0x3c')]:_0x584ecb[_0x1cef('0x38')];_0x1a1b0d[_0x1cef('0x5c')]=qs[_0x1cef('0x40')](_0x2ee9e6[_0x1cef('0x39')][_0x1cef('0x40')]);_0x1a1b0d[_0x1cef('0x43')]=qs[_0x1cef('0x3a')](_[_0x1cef('0x41')](_0x2ee9e6[_0x1cef('0x39')],_0x584ecb[_0x1cef('0x3a')]));if(_0x2ee9e6['query'][_0x1cef('0x42')]){_0x1a1b0d[_0x1cef('0x43')]=_['merge'](_0x1a1b0d[_0x1cef('0x43')],{'$or':_[_0x1cef('0x45')](_0x1a1b0d[_0x1cef('0x3c')],function(_0x3ecc65){var _0x5a001c={};_0x5a001c[_0x3ecc65]={'$like':'%'+_0x2ee9e6[_0x1cef('0x39')]['filter']+'%'};return _0x5a001c;})});}_0x1a1b0d=_[_0x1cef('0x44')]({},_0x1a1b0d,_0x2ee9e6[_0x1cef('0x47')]);return _0x44ed0f['getTeams'](_0x1a1b0d);}})[_0x1cef('0x2b')](function(_0x2f2e59){if(_0x2f2e59){_0x4e713a=_0x2f2e59[_0x1cef('0x3e')];if(!_0x2ee9e6[_0x1cef('0x39')][_0x1cef('0x3f')](_0x1cef('0x5b'))){_0x1a1b0d['limit']=qs['limit'](_0x2ee9e6['query']['limit']);_0x1a1b0d[_0x1cef('0x23')]=qs['offset'](_0x2ee9e6[_0x1cef('0x39')]['offset']);}return _0x44ed0f['getTeams'](_0x1a1b0d);}})[_0x1cef('0x2b')](function(_0x4a93d7){if(_0x4a93d7){return _0x4a93d7?{'count':_0x4e713a,'rows':_0x4a93d7}:null;}})[_0x1cef('0x2b')](respondWithResult(_0x58fe11,null))[_0x1cef('0x4c')](handleError(_0x58fe11,null));};exports[_0x1cef('0x67')]=function(_0x272957,_0x1ed4dc,_0x15abde){var _0x263a66=_0x272957[_0x1cef('0x55')][_0x1cef('0x68')];return db[_0x1cef('0x66')]['findAll']({'where':{'id':_0x263a66},'attributes':['id'],'include':[{'model':db[_0x1cef('0x5e')],'as':_0x1cef('0x69'),'attributes':['id',_0x1cef('0x32'),_0x1cef('0x6a'),_0x1cef('0x6b'),_0x1cef('0x6c')],'raw':!![]}]})[_0x1cef('0x2b')](function(_0xcf2db1){if(_0xcf2db1){var _0x20da77=_[_0x1cef('0x6d')](_0xcf2db1,function(_0x8f7b59){var _0x530af5=_0x8f7b59[_0x1cef('0x2d')]({'plain':!![]});return _0x530af5['Agents'];});return db[_0x1cef('0x35')]['find']({'where':{'id':_0x272957['params']['id']}})[_0x1cef('0x2b')](function(_0x5ac41d){return db[_0x1cef('0x6e')][_0x1cef('0x6f')](function(_0x1a02e4){return _0x5ac41d[_0x1cef('0x67')](_0x263a66,{'transaction':_0x1a02e4})[_0x1cef('0x2b')](function(){return BPromise[_0x1cef('0x70')](_0x20da77,function(_0x902e52){return db[_0x1cef('0x5a')][_0x1cef('0x71')]({'where':{'UserId':_0x902e52['id'],'MailQueueId':_0x272957[_0x1cef('0x56')]['id']},'transaction':_0x1a02e4});});})[_0x1cef('0x2b')](function(){_0x20da77[_0x1cef('0x72')](function(_0x57b8e5){socket[_0x1cef('0x73')](_0x1cef('0x74'),{'UserId':_0x57b8e5['id'],'MailQueueId':_0x5ac41d['id']});});});});});}})[_0x1cef('0x2b')](respondWithStatusCode(_0x1ed4dc,null))[_0x1cef('0x4c')](handleError(_0x1ed4dc,null));};exports[_0x1cef('0x75')]=function(_0x17d881,_0x2c0be4,_0x247e4f){return db['Team'][_0x1cef('0x4a')]({'where':{'id':_0x17d881[_0x1cef('0x39')][_0x1cef('0x68')]},'attributes':['id'],'include':[{'model':db[_0x1cef('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1cef('0x2b')](handleEntityNotFound(_0x2c0be4,null))[_0x1cef('0x2b')](function(_0x3d33e1){var _0xfdb70a=_[_0x1cef('0x45')](_0x3d33e1,'id');var _0x324a47=[];var _0x1f273a=[];var _0x4e816a=squel[_0x1cef('0x76')]();_0x4e816a[_0x1cef('0x77')](_0x1cef('0x78'))[_0x1cef('0x79')]('team_has_mail_queues','tq')['join'](_0x1cef('0x7a'),'ut',_0x1cef('0x7b'))[_0x1cef('0x43')](_0x1cef('0x7c'),_0x17d881[_0x1cef('0x56')]['id']);for(var _0x2c7ac8=0x0;_0x2c7ac8<_0x3d33e1[_0x1cef('0x3e')];_0x2c7ac8+=0x1){let _0x362e50=_0x3d33e1[_0x2c7ac8];for(var _0x19d5c5=0x0;_0x19d5c5<_0x362e50[_0x1cef('0x69')][_0x1cef('0x3e')];_0x19d5c5+=0x1){let _0x5aff10=_0x362e50['Agents'][_0x19d5c5];var _0x29a2b9=_0x4e816a[_0x1cef('0x7d')]();_0x29a2b9[_0x1cef('0x43')](_0x1cef('0x7e'),_0x5aff10['id']);_0x1f273a[_0x1cef('0x7f')](db[_0x1cef('0x6e')][_0x1cef('0x39')](_0x29a2b9[_0x1cef('0x80')](),{'type':db['sequelize'][_0x1cef('0x81')]['SELECT']})[_0x1cef('0x2b')](function(_0x27e7e1){if(_0x27e7e1[_0x1cef('0x3e')]===0x1){return _0x5aff10['id'];}else{var _0x4facd3=_[_0x1cef('0x82')](_[_0x1cef('0x45')](_0x27e7e1,'TeamId'),function(_0x4118a4){return _[_0x1cef('0x83')](_0xfdb70a,_0x4118a4);});if(_0x4facd3){return _0x5aff10['id'];}}}));}}return BPromise['all'](_0x1f273a)[_0x1cef('0x2b')](function(_0x3bfe75){_0x324a47=_(_0x324a47)[_0x1cef('0x84')](_0x3bfe75)[_0x1cef('0x85')]()[_0x1cef('0x86')]();return db[_0x1cef('0x35')]['find']({'where':{'id':_0x17d881[_0x1cef('0x56')]['id']}})[_0x1cef('0x2b')](function(_0x40d0d0){return db['sequelize'][_0x1cef('0x6f')](function(_0xc2a3d7){return _0x40d0d0[_0x1cef('0x75')](_0x17d881[_0x1cef('0x39')][_0x1cef('0x68')],{'transaction':_0xc2a3d7})[_0x1cef('0x2b')](function(){if(!_['isEmpty'](_0x324a47)){return _0x40d0d0[_0x1cef('0x87')](_0x324a47,{'transaction':_0xc2a3d7});}})['then'](function(){_0x324a47[_0x1cef('0x72')](function(_0x1d52fd){socket[_0x1cef('0x73')]('userMailQueue:remove',{'UserId':_0x1d52fd,'MailQueueId':_0x40d0d0['id']});});});});});});})[_0x1cef('0x2b')](respondWithStatusCode(_0x2c0be4,null))[_0x1cef('0x4c')](handleError(_0x2c0be4,null));};exports[_0x1cef('0x88')]=function(_0x1f88fe,_0x103069,_0x11d88c){return db[_0x1cef('0x35')][_0x1cef('0x4e')]({'where':{'id':_0x1f88fe['params']['id']}})[_0x1cef('0x2b')](handleEntityNotFound(_0x103069,null))[_0x1cef('0x2b')](function(_0x264d0c){if(_0x264d0c){return _0x264d0c[_0x1cef('0x88')](_0x1f88fe[_0x1cef('0x55')][_0x1cef('0x68')],_[_0x1cef('0x89')](_0x1f88fe[_0x1cef('0x55')],['ids','id'])||{})[_0x1cef('0x8a')](function(_0x4dc630){for(var _0x30b2f5=0x0;_0x30b2f5<_0x1f88fe[_0x1cef('0x55')][_0x1cef('0x68')][_0x1cef('0x3e')];_0x30b2f5+=0x1){socket[_0x1cef('0x73')](_0x1cef('0x74'),{'UserId':Number(_0x1f88fe['body'][_0x1cef('0x68')][_0x30b2f5]),'MailQueueId':Number(_0x1f88fe[_0x1cef('0x56')]['id'])});}return _0x4dc630;});}})[_0x1cef('0x2b')](respondWithResult(_0x103069,null))[_0x1cef('0x4c')](handleError(_0x103069,null));};exports[_0x1cef('0x87')]=function(_0x2a9eca,_0x242fdd,_0x4b3566){return db['MailQueue'][_0x1cef('0x4e')]({'where':{'id':_0x2a9eca[_0x1cef('0x56')]['id']}})[_0x1cef('0x2b')](handleEntityNotFound(_0x242fdd,null))[_0x1cef('0x2b')](function(_0x341ad5){if(_0x341ad5){return _0x341ad5[_0x1cef('0x87')](_0x2a9eca['query'][_0x1cef('0x68')])[_0x1cef('0x2b')](function(){if(_[_0x1cef('0x8b')](_0x2a9eca['query'][_0x1cef('0x68')])){for(var _0x3184c0=0x0;_0x3184c0<_0x2a9eca['query'][_0x1cef('0x68')]['length'];_0x3184c0+=0x1){socket[_0x1cef('0x73')](_0x1cef('0x8c'),{'UserId':Number(_0x2a9eca['query'][_0x1cef('0x68')][_0x3184c0]),'MailQueueId':Number(_0x2a9eca[_0x1cef('0x56')]['id'])});}}else{socket[_0x1cef('0x73')](_0x1cef('0x8c'),{'UserId':Number(_0x2a9eca[_0x1cef('0x39')][_0x1cef('0x68')]),'MailQueueId':Number(_0x2a9eca[_0x1cef('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x242fdd,null))['catch'](handleError(_0x242fdd,null));};exports[_0x1cef('0x8d')]=function(_0x3ce9c7,_0x4cb555,_0x2062ae){var _0x3a5d45={};var _0x37a1d3={};var _0x13579e;var _0x9de572;return db[_0x1cef('0x35')][_0x1cef('0x58')]({'where':{'id':_0x3ce9c7['params']['id']}})[_0x1cef('0x2b')](handleEntityNotFound(_0x4cb555,null))[_0x1cef('0x2b')](function(_0x58b7ac){if(_0x58b7ac){_0x13579e=_0x58b7ac;_0x37a1d3[_0x1cef('0x38')]=_['keys'](db[_0x1cef('0x5e')][_0x1cef('0x36')]);_0x37a1d3['query']=_[_0x1cef('0x59')](_0x3ce9c7[_0x1cef('0x39')]);_0x37a1d3[_0x1cef('0x3a')]=_['intersection'](_0x37a1d3[_0x1cef('0x38')],_0x37a1d3[_0x1cef('0x39')]);_0x3a5d45[_0x1cef('0x3c')]=_['intersection'](_0x37a1d3[_0x1cef('0x38')],qs['fields'](_0x3ce9c7['query'][_0x1cef('0x3d')]));_0x3a5d45[_0x1cef('0x3c')]=_0x3a5d45[_0x1cef('0x3c')]['length']?_0x3a5d45['attributes']:_0x37a1d3['model'];_0x3a5d45['order']=qs[_0x1cef('0x40')](_0x3ce9c7[_0x1cef('0x39')][_0x1cef('0x40')]);_0x3a5d45['where']=qs[_0x1cef('0x3a')](_[_0x1cef('0x41')](_0x3ce9c7[_0x1cef('0x39')],_0x37a1d3[_0x1cef('0x3a')]));if(_0x3ce9c7[_0x1cef('0x39')][_0x1cef('0x42')]){_0x3a5d45[_0x1cef('0x43')]=_[_0x1cef('0x44')](_0x3a5d45[_0x1cef('0x43')],{'$or':_['map'](_0x3a5d45[_0x1cef('0x3c')],function(_0x1682a6){var _0x254327={};_0x254327[_0x1682a6]={'$like':'%'+_0x3ce9c7[_0x1cef('0x39')][_0x1cef('0x42')]+'%'};return _0x254327;})});}_0x3a5d45=_[_0x1cef('0x44')]({},_0x3a5d45,_0x3ce9c7['options']);return _0x13579e[_0x1cef('0x8d')](_0x3a5d45);}})[_0x1cef('0x2b')](function(_0x451457){if(_0x451457){_0x9de572=_0x451457[_0x1cef('0x3e')];if(!_0x3ce9c7[_0x1cef('0x39')][_0x1cef('0x3f')](_0x1cef('0x5b'))){_0x3a5d45[_0x1cef('0x25')]=qs[_0x1cef('0x25')](_0x3ce9c7['query'][_0x1cef('0x25')]);_0x3a5d45[_0x1cef('0x23')]=qs['offset'](_0x3ce9c7['query']['offset']);}return _0x13579e[_0x1cef('0x8d')](_0x3a5d45);}})[_0x1cef('0x2b')](function(_0x23d616){if(_0x23d616){return _0x23d616?{'count':_0x9de572,'rows':_0x23d616}:null;}})['then'](respondWithResult(_0x4cb555,null))[_0x1cef('0x4c')](handleError(_0x4cb555,null));}; \ No newline at end of file +var _0xd588=['get','MailQueues','UserProfileResource','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','length','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','MailQueue','include','rows','catch','show','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserMailQueue','order','pick','MailQueueId','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','emit','userMailQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy'];(function(_0x4947d7,_0x270f05){var _0x4b6e94=function(_0x469ae4){while(--_0x469ae4){_0x4947d7['push'](_0x4947d7['shift']());}};_0x4b6e94(++_0x270f05);}(_0xd588,0x195));var _0x8d58=function(_0x30d31e,_0x292e17){_0x30d31e=_0x30d31e-0x0;var _0x3ad2fe=_0xd588[_0x30d31e];return _0x3ad2fe;};'use strict';var emlformat=require(_0x8d58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d58('0x1'));var jsonpatch=require(_0x8d58('0x2'));var rp=require(_0x8d58('0x3'));var moment=require(_0x8d58('0x4'));var BPromise=require(_0x8d58('0x5'));var Mustache=require(_0x8d58('0x6'));var util=require(_0x8d58('0x7'));var path=require(_0x8d58('0x8'));var sox=require(_0x8d58('0x9'));var csv=require(_0x8d58('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d58('0xb'));var crypto=require(_0x8d58('0xc'));var jsforce=require(_0x8d58('0xd'));var deskjs=require(_0x8d58('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8d58('0xf'));var Papa=require(_0x8d58('0x10'));var Redis=require(_0x8d58('0x11'));var authService=require(_0x8d58('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8d58('0x13'));var hardwareService=require(_0x8d58('0x14'));var logger=require(_0x8d58('0x15'))(_0x8d58('0x16'));var utils=require(_0x8d58('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d58('0x18'))['db'];config[_0x8d58('0x19')]=_['defaults'](config['redis'],{'host':_0x8d58('0x1a'),'port':0x18eb});var socket=require(_0x8d58('0x1b'))(new Redis(config[_0x8d58('0x19')]));require(_0x8d58('0x1c'))[_0x8d58('0x1d')](socket);function respondWithStatusCode(_0x1ae6c9,_0x5edd33){_0x5edd33=_0x5edd33||0xcc;return function(_0x278141){if(_0x278141){return _0x1ae6c9['sendStatus'](_0x5edd33);}return _0x1ae6c9['status'](_0x5edd33)['end']();};}function respondWithResult(_0x453711,_0xe274ad){_0xe274ad=_0xe274ad||0xc8;return function(_0x593fb6){if(_0x593fb6){return _0x453711['status'](_0xe274ad)[_0x8d58('0x1e')](_0x593fb6);}};}function respondWithFilteredResult(_0x54b83c,_0x3d4db2){return function(_0x58897f){if(_0x58897f){var _0x1176c0=typeof _0x3d4db2[_0x8d58('0x1f')]===_0x8d58('0x20')&&typeof _0x3d4db2[_0x8d58('0x21')]==='undefined';var _0xfc71fe=_0x58897f['count'];var _0x1e27f7=_0x1176c0?0x0:_0x3d4db2[_0x8d58('0x1f')];var _0x1ac3e3=_0x1176c0?_0x58897f[_0x8d58('0x22')]:_0x3d4db2[_0x8d58('0x1f')]+_0x3d4db2['limit'];var _0x570c4d;if(_0x1ac3e3>=_0xfc71fe){_0x1ac3e3=_0xfc71fe;_0x570c4d=0xc8;}else{_0x570c4d=0xce;}_0x54b83c[_0x8d58('0x23')](_0x570c4d);return _0x54b83c[_0x8d58('0x24')](_0x8d58('0x25'),_0x1e27f7+'-'+_0x1ac3e3+'/'+_0xfc71fe)[_0x8d58('0x1e')](_0x58897f);}return null;};}function patchUpdates(_0x586dfb){return function(_0x5cc330){try{jsonpatch[_0x8d58('0x26')](_0x5cc330,_0x586dfb,!![]);}catch(_0x5a1684){return BPromise[_0x8d58('0x27')](_0x5a1684);}return _0x5cc330[_0x8d58('0x28')]();};}function saveUpdates(_0x44fd3f,_0x44c49c){return function(_0x803db9){if(_0x803db9){return _0x803db9['update'](_0x44fd3f)['then'](function(_0x1cc19a){return _0x1cc19a;});}return null;};}function removeEntity(_0x4405e6,_0x1e2bc7){return function(_0x3afcc6){if(_0x3afcc6){return _0x3afcc6[_0x8d58('0x29')]()['then'](function(){var _0x434a6c=_0x3afcc6[_0x8d58('0x2a')]({'plain':!![]});var _0x47544f=_0x8d58('0x2b');return db[_0x8d58('0x2c')][_0x8d58('0x29')]({'where':{'type':_0x47544f,'resourceId':_0x434a6c['id']}})[_0x8d58('0x2d')](function(){return _0x3afcc6;});})['then'](function(){_0x4405e6[_0x8d58('0x23')](0xcc)[_0x8d58('0x2e')]();});}};}function handleEntityNotFound(_0x414b10,_0x2d8975){return function(_0x188d6a){if(!_0x188d6a){_0x414b10['sendStatus'](0x194);}return _0x188d6a;};}function handleError(_0x87eca2,_0x39b05b){_0x39b05b=_0x39b05b||0x1f4;return function(_0x3fdb03){logger[_0x8d58('0x2f')](_0x3fdb03[_0x8d58('0x30')]);if(_0x3fdb03['name']){delete _0x3fdb03[_0x8d58('0x31')];}_0x87eca2[_0x8d58('0x23')](_0x39b05b)['send'](_0x3fdb03);};}exports[_0x8d58('0x32')]=function(_0x4b1b55,_0x160f8f){var _0x42c63e={},_0xec154d={},_0x395a83={'count':0x0,'rows':[]};var _0x1e15eb=_[_0x8d58('0x33')](db['MailQueue'][_0x8d58('0x34')],function(_0x41e2a4){return{'name':_0x41e2a4[_0x8d58('0x35')],'type':_0x41e2a4[_0x8d58('0x36')][_0x8d58('0x37')]};});_0xec154d[_0x8d58('0x38')]=_['map'](_0x1e15eb,_0x8d58('0x31'));_0xec154d['query']=_[_0x8d58('0x39')](_0x4b1b55[_0x8d58('0x3a')]);_0xec154d[_0x8d58('0x3b')]=_['intersection'](_0xec154d['model'],_0xec154d[_0x8d58('0x3a')]);_0x42c63e['attributes']=_['intersection'](_0xec154d[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x4b1b55[_0x8d58('0x3a')]['fields']));_0x42c63e['attributes']=_0x42c63e['attributes'][_0x8d58('0x3d')]?_0x42c63e[_0x8d58('0x3e')]:_0xec154d[_0x8d58('0x38')];if(!_0x4b1b55['query'][_0x8d58('0x3f')](_0x8d58('0x40'))){_0x42c63e[_0x8d58('0x21')]=qs['limit'](_0x4b1b55[_0x8d58('0x3a')]['limit']);_0x42c63e[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x1f')]);}_0x42c63e['order']=qs[_0x8d58('0x41')](_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x41')]);_0x42c63e[_0x8d58('0x42')]=qs['filters'](_['pick'](_0x4b1b55[_0x8d58('0x3a')],_0xec154d[_0x8d58('0x3b')]),_0x1e15eb);if(_0x4b1b55[_0x8d58('0x3a')]['filter']){_0x42c63e[_0x8d58('0x42')]=_[_0x8d58('0x43')](_0x42c63e['where'],{'$or':_[_0x8d58('0x33')](_0x1e15eb,function(_0x538416){if(_0x538416['type']!==_0x8d58('0x44')){var _0x35cea0={};_0x35cea0[_0x538416['name']]={'$like':'%'+_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x35cea0;}})});}_0x42c63e=_[_0x8d58('0x43')]({},_0x42c63e,_0x4b1b55[_0x8d58('0x46')]);var _0x43b157={'where':_0x42c63e['where']};return db[_0x8d58('0x47')][_0x8d58('0x22')](_0x43b157)[_0x8d58('0x2d')](function(_0x4c4ba8){_0x395a83[_0x8d58('0x22')]=_0x4c4ba8;if(_0x4b1b55['query']['includeAll']){_0x42c63e[_0x8d58('0x48')]=[{'all':!![]}];}return db[_0x8d58('0x47')]['findAll'](_0x42c63e);})['then'](function(_0x45f606){_0x395a83[_0x8d58('0x49')]=_0x45f606;return _0x395a83;})['then'](respondWithFilteredResult(_0x160f8f,_0x42c63e))[_0x8d58('0x4a')](handleError(_0x160f8f,null));};exports[_0x8d58('0x4b')]=function(_0x3b0593,_0x2f23c2){var _0x196d16={'raw':!![],'where':{'id':_0x3b0593['params']['id']}},_0x50e7db={};_0x50e7db[_0x8d58('0x38')]=_[_0x8d58('0x39')](db[_0x8d58('0x47')][_0x8d58('0x34')]);_0x50e7db[_0x8d58('0x3a')]=_[_0x8d58('0x39')](_0x3b0593[_0x8d58('0x3a')]);_0x50e7db[_0x8d58('0x3b')]=_[_0x8d58('0x4c')](_0x50e7db[_0x8d58('0x38')],_0x50e7db['query']);_0x196d16[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0x50e7db[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x3b0593['query']['fields']));_0x196d16['attributes']=_0x196d16[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x196d16[_0x8d58('0x3e')]:_0x50e7db['model'];if(_0x3b0593[_0x8d58('0x3a')][_0x8d58('0x4d')]){_0x196d16[_0x8d58('0x48')]=[{'all':!![]}];}_0x196d16=_[_0x8d58('0x43')]({},_0x196d16,_0x3b0593[_0x8d58('0x46')]);return db[_0x8d58('0x47')][_0x8d58('0x4e')](_0x196d16)['then'](handleEntityNotFound(_0x2f23c2,null))[_0x8d58('0x2d')](respondWithResult(_0x2f23c2,null))['catch'](handleError(_0x2f23c2,null));};exports[_0x8d58('0x4f')]=function(_0x46b1f5,_0x53fd95){return db['MailQueue'][_0x8d58('0x4f')](_0x46b1f5[_0x8d58('0x50')],{})[_0x8d58('0x2d')](function(_0x444b24){var _0x5c371f=_0x46b1f5[_0x8d58('0x51')][_0x8d58('0x2a')]({'plain':!![]});if(!_0x5c371f)throw new Error(_0x8d58('0x52'));if(_0x5c371f[_0x8d58('0x53')]==='user'){var _0x10f541=_0x444b24[_0x8d58('0x2a')]({'plain':!![]});var _0x2e6ef4=_0x8d58('0x2b');return db[_0x8d58('0x54')][_0x8d58('0x4e')]({'where':{'name':_0x2e6ef4,'userProfileId':_0x5c371f['userProfileId']},'raw':!![]})[_0x8d58('0x2d')](function(_0x27772a){if(_0x27772a&&_0x27772a[_0x8d58('0x55')]===0x0){return db[_0x8d58('0x2c')][_0x8d58('0x4f')]({'name':_0x10f541[_0x8d58('0x31')],'resourceId':_0x10f541['id'],'type':_0x27772a[_0x8d58('0x31')],'sectionId':_0x27772a['id']},{})['then'](function(){return _0x444b24;});}else{return _0x444b24;}})['catch'](function(_0x528d2a){logger[_0x8d58('0x2f')](_0x8d58('0x56'),_0x528d2a);throw _0x528d2a;});}return _0x444b24;})[_0x8d58('0x2d')](respondWithResult(_0x53fd95,0xc9))[_0x8d58('0x4a')](handleError(_0x53fd95,null));};exports[_0x8d58('0x57')]=function(_0x310141,_0x49734a){if(_0x310141[_0x8d58('0x50')]['id']){delete _0x310141[_0x8d58('0x50')]['id'];}return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x310141['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x49734a,null))[_0x8d58('0x2d')](saveUpdates(_0x310141[_0x8d58('0x50')],null))[_0x8d58('0x2d')](respondWithResult(_0x49734a,null))[_0x8d58('0x4a')](handleError(_0x49734a,null));};exports[_0x8d58('0x29')]=function(_0x540b4f,_0xf690ce){return db[_0x8d58('0x47')][_0x8d58('0x4e')]({'where':{'id':_0x540b4f[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0xf690ce,null))[_0x8d58('0x2d')](removeEntity(_0xf690ce,null))[_0x8d58('0x4a')](handleError(_0xf690ce,null));};exports[_0x8d58('0x59')]=function(_0x24e948,_0x3eba10){return db[_0x8d58('0x47')]['describe']()['then'](respondWithResult(_0x3eba10,null))[_0x8d58('0x4a')](handleError(_0x3eba10,null));};exports[_0x8d58('0x5a')]=function(_0x143abf,_0x3864b5,_0x3f1d8d){var _0x12d2c9={'raw':!![],'where':{}},_0xf71b97={},_0x108aeb;return db[_0x8d58('0x47')]['findOne']({'where':{'id':_0x143abf[_0x8d58('0x58')]['id']}})['then'](handleEntityNotFound(_0x3864b5,null))[_0x8d58('0x2d')](function(_0x4a741d){if(_0x4a741d){_0x108aeb=_0x4a741d[_0x8d58('0x2a')]({'plain':!![]});_0xf71b97[_0x8d58('0x38')]=_[_0x8d58('0x39')](db[_0x8d58('0x5b')]['rawAttributes']);_0xf71b97[_0x8d58('0x3a')]=_['keys'](_0x143abf[_0x8d58('0x3a')]);_0xf71b97['filters']=_[_0x8d58('0x4c')](_0xf71b97[_0x8d58('0x38')],_0xf71b97[_0x8d58('0x3a')]);_0x12d2c9[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0xf71b97['model'],qs[_0x8d58('0x3c')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x3c')]));_0x12d2c9[_0x8d58('0x3e')]=_0x12d2c9[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x12d2c9['attributes']:_0xf71b97[_0x8d58('0x38')];if(!_0x143abf[_0x8d58('0x3a')][_0x8d58('0x3f')]('nolimit')){_0x12d2c9['limit']=qs[_0x8d58('0x21')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x12d2c9['offset']=qs[_0x8d58('0x1f')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x1f')]);}_0x12d2c9[_0x8d58('0x5c')]=qs[_0x8d58('0x41')](_0x143abf['query'][_0x8d58('0x41')]);_0x12d2c9['where']=qs['filters'](_[_0x8d58('0x5d')](_0x143abf[_0x8d58('0x3a')],_0xf71b97[_0x8d58('0x3b')]));_0x12d2c9[_0x8d58('0x42')][_0x8d58('0x5e')]=_0x4a741d['id'];if(_0x143abf['query']['filter']){_0x12d2c9[_0x8d58('0x42')]=_[_0x8d58('0x43')](_0x12d2c9['where'],{'$or':_[_0x8d58('0x33')](_0x12d2c9[_0x8d58('0x3e')],function(_0x1cc9e8){var _0x34e052={};_0x34e052[_0x1cc9e8]={'$like':'%'+_0x143abf[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x34e052;})});}_0x12d2c9=_[_0x8d58('0x43')]({},_0x12d2c9,_0x143abf[_0x8d58('0x46')]);return db[_0x8d58('0x5b')][_0x8d58('0x5f')](_0x12d2c9);}})[_0x8d58('0x2d')](function(_0x434a42){if(_0x434a42){return db['User'][_0x8d58('0x60')]({'where':{'id':_['map'](_0x434a42,_0x8d58('0x61')),'role':_0x8d58('0x62')},'attributes':['id','name',_0x8d58('0x63'),_0x8d58('0x64'),'createdAt']});}})[_0x8d58('0x2d')](function(_0x2117c2){if(_0x2117c2){return{'count':_0x2117c2[_0x8d58('0x22')],'rows':_[_0x8d58('0x33')](_0x2117c2[_0x8d58('0x49')],function(_0x29c496){return{'membername':_0x29c496[_0x8d58('0x31')],'UserId':_0x29c496['id'],'queue_name':_0x108aeb[_0x8d58('0x31')],'MailQueueId':_0x108aeb['id'],'interface':util[_0x8d58('0x65')](_0x8d58('0x66'),_0x8d58('0x67'),_0x29c496[_0x8d58('0x31')]),'penalty':0x0,'paused':_0x29c496['mailPause'],'createdAt':_0x29c496[_0x8d58('0x68')],'updatedAt':_0x29c496[_0x8d58('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d58('0x2d')](respondWithFilteredResult(_0x3864b5,_0x12d2c9))[_0x8d58('0x4a')](handleError(_0x3864b5,null));};exports[_0x8d58('0x69')]=function(_0x2aabcb,_0x47f519,_0x20689c){var _0x810907={};var _0x549702={};var _0xa44fcd;var _0x186bb3;return db[_0x8d58('0x47')][_0x8d58('0x6a')]({'where':{'id':_0x2aabcb['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x47f519,null))[_0x8d58('0x2d')](function(_0xd80c39){if(_0xd80c39){_0xa44fcd=_0xd80c39;_0x549702[_0x8d58('0x38')]=_[_0x8d58('0x39')](db['Team']['rawAttributes']);_0x549702[_0x8d58('0x3a')]=_[_0x8d58('0x39')](_0x2aabcb[_0x8d58('0x3a')]);_0x549702['filters']=_[_0x8d58('0x4c')](_0x549702[_0x8d58('0x38')],_0x549702[_0x8d58('0x3a')]);_0x810907[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0x549702[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x3c')]));_0x810907[_0x8d58('0x3e')]=_0x810907[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x810907[_0x8d58('0x3e')]:_0x549702[_0x8d58('0x38')];_0x810907[_0x8d58('0x5c')]=qs['sort'](_0x2aabcb['query']['sort']);_0x810907[_0x8d58('0x42')]=qs[_0x8d58('0x3b')](_[_0x8d58('0x5d')](_0x2aabcb['query'],_0x549702[_0x8d58('0x3b')]));if(_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x45')]){_0x810907['where']=_['merge'](_0x810907[_0x8d58('0x42')],{'$or':_[_0x8d58('0x33')](_0x810907[_0x8d58('0x3e')],function(_0x55a369){var _0x114a87={};_0x114a87[_0x55a369]={'$like':'%'+_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x114a87;})});}_0x810907=_[_0x8d58('0x43')]({},_0x810907,_0x2aabcb[_0x8d58('0x46')]);return _0xa44fcd['getTeams'](_0x810907);}})['then'](function(_0x25f4d1){if(_0x25f4d1){_0x186bb3=_0x25f4d1['length'];if(!_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x3f')]('nolimit')){_0x810907[_0x8d58('0x21')]=qs['limit'](_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x810907[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x2aabcb['query'][_0x8d58('0x1f')]);}return _0xa44fcd[_0x8d58('0x69')](_0x810907);}})[_0x8d58('0x2d')](function(_0x49da17){if(_0x49da17){return _0x49da17?{'count':_0x186bb3,'rows':_0x49da17}:null;}})[_0x8d58('0x2d')](respondWithResult(_0x47f519,null))[_0x8d58('0x4a')](handleError(_0x47f519,null));};exports[_0x8d58('0x6b')]=function(_0x57d3cd,_0x2f01ba,_0x39f24b){var _0x41606b=_0x57d3cd['body'][_0x8d58('0x6c')];return db['Team'][_0x8d58('0x5f')]({'where':{'id':_0x41606b},'attributes':['id'],'include':[{'model':db[_0x8d58('0x6d')],'as':_0x8d58('0x6e'),'attributes':['id',_0x8d58('0x31'),_0x8d58('0x6f'),_0x8d58('0x70'),_0x8d58('0x71')],'raw':!![]}]})[_0x8d58('0x2d')](function(_0x102334){if(_0x102334){var _0x3f2996=_[_0x8d58('0x72')](_0x102334,function(_0x583bfa){var _0xd0170f=_0x583bfa[_0x8d58('0x2a')]({'plain':!![]});return _0xd0170f[_0x8d58('0x6e')];});return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x57d3cd[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](function(_0x40a304){return db['sequelize']['transaction'](function(_0xad3916){return _0x40a304[_0x8d58('0x6b')](_0x41606b,{'transaction':_0xad3916})[_0x8d58('0x2d')](function(){return BPromise[_0x8d58('0x73')](_0x3f2996,function(_0x26ddbb){return db['UserMailQueue'][_0x8d58('0x74')]({'where':{'UserId':_0x26ddbb['id'],'MailQueueId':_0x57d3cd[_0x8d58('0x58')]['id']},'transaction':_0xad3916});});})[_0x8d58('0x2d')](function(){_0x3f2996['forEach'](function(_0x3fcf35){socket[_0x8d58('0x75')](_0x8d58('0x76'),{'UserId':_0x3fcf35['id'],'MailQueueId':_0x40a304['id']});});});});});}})[_0x8d58('0x2d')](respondWithStatusCode(_0x2f01ba,null))['catch'](handleError(_0x2f01ba,null));};exports[_0x8d58('0x77')]=function(_0x1fbbf9,_0x547e78,_0x2dc34b){return db[_0x8d58('0x78')][_0x8d58('0x5f')]({'where':{'id':_0x1fbbf9[_0x8d58('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8d58('0x6d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8d58('0x2d')](handleEntityNotFound(_0x547e78,null))[_0x8d58('0x2d')](function(_0x5754ee){var _0x202228=_[_0x8d58('0x33')](_0x5754ee,'id');var _0x45174c=[];var _0x1dd264=[];var _0x101aff=squel[_0x8d58('0x79')]();_0x101aff['field'](_0x8d58('0x7a'))[_0x8d58('0x7b')](_0x8d58('0x7c'),'tq')[_0x8d58('0x7d')](_0x8d58('0x7e'),'ut',_0x8d58('0x7f'))[_0x8d58('0x42')]('MailQueueId\x20=\x20?',_0x1fbbf9[_0x8d58('0x58')]['id']);for(var _0x2dc2d9=0x0;_0x2dc2d9<_0x5754ee['length'];_0x2dc2d9+=0x1){let _0x3b7cfc=_0x5754ee[_0x2dc2d9];for(var _0x16ae2a=0x0;_0x16ae2a<_0x3b7cfc[_0x8d58('0x6e')][_0x8d58('0x3d')];_0x16ae2a+=0x1){let _0x45426c=_0x3b7cfc[_0x8d58('0x6e')][_0x16ae2a];var _0x4cd41e=_0x101aff[_0x8d58('0x80')]();_0x4cd41e[_0x8d58('0x42')]('ut.UserId\x20=\x20?',_0x45426c['id']);_0x1dd264[_0x8d58('0x81')](db['sequelize'][_0x8d58('0x3a')](_0x4cd41e[_0x8d58('0x82')](),{'type':db[_0x8d58('0x83')][_0x8d58('0x84')][_0x8d58('0x85')]})[_0x8d58('0x2d')](function(_0x14433b){if(_0x14433b[_0x8d58('0x3d')]===0x1){return _0x45426c['id'];}else{var _0x189ff6=_[_0x8d58('0x86')](_['map'](_0x14433b,_0x8d58('0x87')),function(_0x465248){return _[_0x8d58('0x88')](_0x202228,_0x465248);});if(_0x189ff6){return _0x45426c['id'];}}}));}}return BPromise[_0x8d58('0x89')](_0x1dd264)[_0x8d58('0x2d')](function(_0x241abd){_0x45174c=_(_0x45174c)[_0x8d58('0x8a')](_0x241abd)[_0x8d58('0x8b')]()[_0x8d58('0x8c')]();return db[_0x8d58('0x47')]['find']({'where':{'id':_0x1fbbf9[_0x8d58('0x58')]['id']}})['then'](function(_0x212f90){return db['sequelize']['transaction'](function(_0x5c1d83){return _0x212f90['removeTeams'](_0x1fbbf9['query'][_0x8d58('0x6c')],{'transaction':_0x5c1d83})[_0x8d58('0x2d')](function(){if(!_[_0x8d58('0x8d')](_0x45174c)){return _0x212f90['removeAgents'](_0x45174c,{'transaction':_0x5c1d83});}})[_0x8d58('0x2d')](function(){_0x45174c[_0x8d58('0x8e')](function(_0x3d88c1){socket[_0x8d58('0x75')](_0x8d58('0x8f'),{'UserId':_0x3d88c1,'MailQueueId':_0x212f90['id']});});});});});});})['then'](respondWithStatusCode(_0x547e78,null))[_0x8d58('0x4a')](handleError(_0x547e78,null));};exports[_0x8d58('0x90')]=function(_0x2fa761,_0x2b61ec,_0x240924){return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x2fa761['params']['id']}})['then'](handleEntityNotFound(_0x2b61ec,null))[_0x8d58('0x2d')](function(_0x3c3b66){if(_0x3c3b66){return _0x3c3b66[_0x8d58('0x90')](_0x2fa761[_0x8d58('0x50')][_0x8d58('0x6c')],_['omit'](_0x2fa761[_0x8d58('0x50')],['ids','id'])||{})[_0x8d58('0x91')](function(_0x274c64){for(var _0x324b1e=0x0;_0x324b1e<_0x2fa761['body'][_0x8d58('0x6c')][_0x8d58('0x3d')];_0x324b1e+=0x1){socket[_0x8d58('0x75')](_0x8d58('0x76'),{'UserId':Number(_0x2fa761[_0x8d58('0x50')][_0x8d58('0x6c')][_0x324b1e]),'MailQueueId':Number(_0x2fa761['params']['id'])});}return _0x274c64;});}})[_0x8d58('0x2d')](respondWithResult(_0x2b61ec,null))[_0x8d58('0x4a')](handleError(_0x2b61ec,null));};exports[_0x8d58('0x92')]=function(_0x841583,_0x5efca1,_0x1ebce9){return db[_0x8d58('0x47')][_0x8d58('0x4e')]({'where':{'id':_0x841583[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x5efca1,null))[_0x8d58('0x2d')](function(_0xa59b05){if(_0xa59b05){return _0xa59b05[_0x8d58('0x92')](_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')])[_0x8d58('0x2d')](function(){if(_[_0x8d58('0x93')](_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')])){for(var _0x9e3779=0x0;_0x9e3779<_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')]['length'];_0x9e3779+=0x1){socket['emit'](_0x8d58('0x8f'),{'UserId':Number(_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')][_0x9e3779]),'MailQueueId':Number(_0x841583['params']['id'])});}}else{socket['emit'](_0x8d58('0x8f'),{'UserId':Number(_0x841583['query'][_0x8d58('0x6c')]),'MailQueueId':Number(_0x841583[_0x8d58('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x5efca1,null))['catch'](handleError(_0x5efca1,null));};exports[_0x8d58('0x94')]=function(_0x25ac07,_0x555e4d,_0x114cd2){var _0x240360={};var _0x4569e5={};var _0x27bc45;var _0x1f4d80;return db[_0x8d58('0x47')][_0x8d58('0x6a')]({'where':{'id':_0x25ac07['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x555e4d,null))['then'](function(_0x167ac6){if(_0x167ac6){_0x27bc45=_0x167ac6;_0x4569e5[_0x8d58('0x38')]=_['keys'](db[_0x8d58('0x6d')][_0x8d58('0x34')]);_0x4569e5[_0x8d58('0x3a')]=_['keys'](_0x25ac07[_0x8d58('0x3a')]);_0x4569e5[_0x8d58('0x3b')]=_[_0x8d58('0x4c')](_0x4569e5[_0x8d58('0x38')],_0x4569e5[_0x8d58('0x3a')]);_0x240360[_0x8d58('0x3e')]=_['intersection'](_0x4569e5[_0x8d58('0x38')],qs['fields'](_0x25ac07[_0x8d58('0x3a')]['fields']));_0x240360[_0x8d58('0x3e')]=_0x240360[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x240360[_0x8d58('0x3e')]:_0x4569e5[_0x8d58('0x38')];_0x240360[_0x8d58('0x5c')]=qs['sort'](_0x25ac07['query'][_0x8d58('0x41')]);_0x240360['where']=qs[_0x8d58('0x3b')](_[_0x8d58('0x5d')](_0x25ac07[_0x8d58('0x3a')],_0x4569e5[_0x8d58('0x3b')]));if(_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x45')]){_0x240360['where']=_[_0x8d58('0x43')](_0x240360[_0x8d58('0x42')],{'$or':_['map'](_0x240360[_0x8d58('0x3e')],function(_0x303153){var _0x4944ae={};_0x4944ae[_0x303153]={'$like':'%'+_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x4944ae;})});}_0x240360=_[_0x8d58('0x43')]({},_0x240360,_0x25ac07[_0x8d58('0x46')]);return _0x27bc45[_0x8d58('0x94')](_0x240360);}})[_0x8d58('0x2d')](function(_0x25480f){if(_0x25480f){_0x1f4d80=_0x25480f['length'];if(!_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x3f')](_0x8d58('0x40'))){_0x240360[_0x8d58('0x21')]=qs[_0x8d58('0x21')](_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x240360['offset']=qs[_0x8d58('0x1f')](_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x1f')]);}return _0x27bc45[_0x8d58('0x94')](_0x240360);}})[_0x8d58('0x2d')](function(_0x4c2c47){if(_0x4c2c47){return _0x4c2c47?{'count':_0x1f4d80,'rows':_0x4c2c47}:null;}})[_0x8d58('0x2d')](respondWithResult(_0x555e4d,null))[_0x8d58('0x4a')](handleError(_0x555e4d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 124ee39..6b7c9fd 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 _0xcb88=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x3dbf83,_0x2a7210){var _0x3b6b9e=function(_0x411482){while(--_0x411482){_0x3dbf83['push'](_0x3dbf83['shift']());}};_0x3b6b9e(++_0x2a7210);}(_0xcb88,0x197));var _0x8cb8=function(_0x3e3a56,_0x2a9ae6){_0x3e3a56=_0x3e3a56-0x0;var _0xb38349=_0xcb88[_0x3e3a56];return _0xb38349;};'use strict';var EventEmitter=require(_0x8cb8('0x0'));var MailQueue=require(_0x8cb8('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8cb8('0x2')](0x0);var events={'afterCreate':_0x8cb8('0x3'),'afterUpdate':_0x8cb8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x174e92){return function(_0x11d63c,_0x27ac3c,_0x2a1734){MailQueueEvents[_0x8cb8('0x5')](_0x174e92+':'+_0x11d63c['id'],_0x11d63c);MailQueueEvents[_0x8cb8('0x5')](_0x174e92,_0x11d63c);_0x2a1734(null);};}for(var e in events){if(events[_0x8cb8('0x6')](e)){var event=events[e];MailQueue[_0x8cb8('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x9181=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9181,0x1f1));var _0x1918=function(_0x3fb12f,_0x57a82a){_0x3fb12f=_0x3fb12f-0x0;var _0x17d130=_0x9181[_0x3fb12f];return _0x17d130;};'use strict';var EventEmitter=require(_0x1918('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1918('0x1')](0x0);var events={'afterCreate':_0x1918('0x2'),'afterUpdate':_0x1918('0x3'),'afterDestroy':'remove'};function emitEvent(_0x258d5e){return function(_0x3bf794,_0x34a27d,_0x4a4d53){MailQueueEvents[_0x1918('0x4')](_0x258d5e+':'+_0x3bf794['id'],_0x3bf794);MailQueueEvents[_0x1918('0x4')](_0x258d5e,_0x3bf794);_0x4a4d53(null);};}for(var e in events){if(events[_0x1918('0x5')](e)){var event=events[e];MailQueue[_0x1918('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d6caffa..1be482f 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 _0x9182=['moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','api'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0x9182,0x18a));var _0x2918=function(_0x4487ba,_0x4e27ad){_0x4487ba=_0x4487ba-0x0;var _0x33879e=_0x9182[_0x4487ba];return _0x33879e;};'use strict';var _=require(_0x2918('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2918('0x1'));var moment=require(_0x2918('0x2'));var BPromise=require(_0x2918('0x3'));var rp=require(_0x2918('0x4'));var fs=require('fs');var path=require(_0x2918('0x5'));var rimraf=require('rimraf');var config=require(_0x2918('0x6'));var attributes=require(_0x2918('0x7'));module['exports']=function(_0x58d083,_0x33625e){return _0x58d083[_0x2918('0x8')](_0x2918('0x9'),attributes,{'tableName':_0x2918('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x628d=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x628d,0xe7));var _0xd628=function(_0x28b252,_0x4bae93){_0x28b252=_0x28b252-0x0;var _0x2fb34c=_0x628d[_0x28b252];return _0x2fb34c;};'use strict';var _=require(_0xd628('0x0'));var util=require(_0xd628('0x1'));var logger=require(_0xd628('0x2'))(_0xd628('0x3'));var moment=require(_0xd628('0x4'));var BPromise=require(_0xd628('0x5'));var rp=require(_0xd628('0x6'));var fs=require('fs');var path=require(_0xd628('0x7'));var rimraf=require('rimraf');var config=require(_0xd628('0x8'));var attributes=require(_0xd628('0x9'));module[_0xd628('0xa')]=function(_0x1402e9,_0x16b4c9){return _0x1402e9[_0xd628('0xb')](_0xd628('0xc'),attributes,{'tableName':_0xd628('0xd'),'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 05884c1..c926634 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 _0xdd1d=['localhost','socket.io-emitter','./mailQueue.socket','register','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailQueue,\x20%s,\x20%s','message','catch','GetMailQueue','findAll','options','raw','attributes','limit','map','include','model','where','ShowMailQueue','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis'];(function(_0x536491,_0x5dea4d){var _0x1e9ea6=function(_0x5d23b6){while(--_0x5d23b6){_0x536491['push'](_0x536491['shift']());}};_0x1e9ea6(++_0x5dea4d);}(_0xdd1d,0xb2));var _0xddd1=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xdd1d[_0x50a004];return _0x5e9992;};'use strict';var _=require(_0xddd1('0x0'));var util=require(_0xddd1('0x1'));var moment=require(_0xddd1('0x2'));var BPromise=require(_0xddd1('0x3'));var rs=require(_0xddd1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddd1('0x5'))['db'];var utils=require(_0xddd1('0x6'));var logger=require(_0xddd1('0x7'))('rpc');var config=require(_0xddd1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xddd1('0x9')][_0xddd1('0xa')]({'port':0x232a});config[_0xddd1('0xb')]=_['defaults'](config['redis'],{'host':_0xddd1('0xc'),'port':0x18eb});var socket=require(_0xddd1('0xd'))(new Redis(config[_0xddd1('0xb')]));require(_0xddd1('0xe'))[_0xddd1('0xf')](socket);function respondWithRpcPromise(_0xa1d2da,_0x2e5af7,_0x40d380){return new BPromise(function(_0x53ae12,_0x2728a0){return client['request'](_0xa1d2da,_0x40d380)[_0xddd1('0x10')](function(_0x4a195a){logger[_0xddd1('0x11')]('MailQueue,\x20%s,\x20%s',_0x2e5af7,'request\x20sent');logger[_0xddd1('0x12')](_0xddd1('0x13'),_0x2e5af7,_0xddd1('0x14'),JSON['stringify'](_0x4a195a));if(_0x4a195a[_0xddd1('0x15')]){if(_0x4a195a['error'][_0xddd1('0x16')]===0x1f4){logger[_0xddd1('0x15')](_0xddd1('0x17'),_0x2e5af7,_0x4a195a[_0xddd1('0x15')][_0xddd1('0x18')]);return _0x2728a0(_0x4a195a[_0xddd1('0x15')]['message']);}logger[_0xddd1('0x15')](_0xddd1('0x17'),_0x2e5af7,_0x4a195a[_0xddd1('0x15')][_0xddd1('0x18')]);return _0x53ae12(_0x4a195a['error']['message']);}else{logger['info'](_0xddd1('0x17'),_0x2e5af7,'request\x20sent');_0x53ae12(_0x4a195a['result'][_0xddd1('0x18')]);}})[_0xddd1('0x19')](function(_0x4f0273){logger[_0xddd1('0x15')]('MailQueue,\x20%s,\x20%s',_0x2e5af7,_0x4f0273);_0x2728a0(_0x4f0273);});});}exports[_0xddd1('0x1a')]=function(_0x5693eb){var _0x2570b8=this;return new Promise(function(_0x4858a5,_0x29c843){return db['MailQueue'][_0xddd1('0x1b')]({'raw':_0x5693eb[_0xddd1('0x1c')]?_0x5693eb[_0xddd1('0x1c')][_0xddd1('0x1d')]===undefined?!![]:![]:!![],'where':_0x5693eb[_0xddd1('0x1c')]?_0x5693eb[_0xddd1('0x1c')]['where']||null:null,'attributes':_0x5693eb[_0xddd1('0x1c')]?_0x5693eb[_0xddd1('0x1c')][_0xddd1('0x1e')]||null:null,'limit':_0x5693eb[_0xddd1('0x1c')]?_0x5693eb[_0xddd1('0x1c')][_0xddd1('0x1f')]||null:null,'include':_0x5693eb[_0xddd1('0x1c')]?_0x5693eb[_0xddd1('0x1c')]['include']?_[_0xddd1('0x20')](_0x5693eb[_0xddd1('0x1c')][_0xddd1('0x21')],function(_0x2f0e6e){return{'model':db[_0x2f0e6e[_0xddd1('0x22')]],'as':_0x2f0e6e['as'],'attributes':_0x2f0e6e[_0xddd1('0x1e')],'include':_0x2f0e6e['include']?_[_0xddd1('0x20')](_0x2f0e6e[_0xddd1('0x21')],function(_0x415ad2){return{'model':db[_0x415ad2[_0xddd1('0x22')]],'as':_0x415ad2['as'],'attributes':_0x415ad2['attributes'],'include':_0x415ad2['include']?_[_0xddd1('0x20')](_0x415ad2[_0xddd1('0x21')],function(_0x4f7bd7){return{'model':db[_0x4f7bd7['model']],'as':_0x4f7bd7['as'],'attributes':_0x4f7bd7['attributes']};}):[]};}):[]};}):[]:[]})[_0xddd1('0x10')](function(_0x146bcb){logger['info']('GetMailQueue',_0x5693eb);logger[_0xddd1('0x12')](_0xddd1('0x1a'),_0x5693eb,JSON['stringify'](_0x146bcb));_0x4858a5(_0x146bcb);})[_0xddd1('0x19')](function(_0x3fdcdc){logger['error'](_0xddd1('0x1a'),_0x3fdcdc['message'],_0x5693eb);_0x29c843(_0x2570b8[_0xddd1('0x15')](0x1f4,_0x3fdcdc[_0xddd1('0x18')]));});});};exports['ShowMailQueue']=function(_0x3d00cf){var _0x4bf0e8=this;return new Promise(function(_0x2c02aa,_0x25e73e){return db['MailQueue']['find']({'raw':_0x3d00cf[_0xddd1('0x1c')]?_0x3d00cf['options'][_0xddd1('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d00cf['options']?_0x3d00cf['options'][_0xddd1('0x23')]||null:null,'attributes':_0x3d00cf[_0xddd1('0x1c')]?_0x3d00cf[_0xddd1('0x1c')]['attributes']||null:null,'include':_0x3d00cf[_0xddd1('0x1c')]?_0x3d00cf['options'][_0xddd1('0x21')]?_['map'](_0x3d00cf[_0xddd1('0x1c')][_0xddd1('0x21')],function(_0x373868){return{'model':db[_0x373868['model']],'as':_0x373868['as'],'attributes':_0x373868['attributes'],'include':_0x373868['include']?_[_0xddd1('0x20')](_0x373868[_0xddd1('0x21')],function(_0x2faacb){return{'model':db[_0x2faacb[_0xddd1('0x22')]],'as':_0x2faacb['as'],'attributes':_0x2faacb['attributes'],'include':_0x2faacb[_0xddd1('0x21')]?_[_0xddd1('0x20')](_0x2faacb[_0xddd1('0x21')],function(_0x82ffaf){return{'model':db[_0x82ffaf[_0xddd1('0x22')]],'as':_0x82ffaf['as'],'attributes':_0x82ffaf[_0xddd1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xddd1('0x10')](function(_0x4d91cf){logger['info']('ShowMailQueue',_0x3d00cf);logger[_0xddd1('0x12')](_0xddd1('0x24'),_0x3d00cf,JSON[_0xddd1('0x25')](_0x4d91cf));_0x2c02aa(_0x4d91cf);})[_0xddd1('0x19')](function(_0xa2b4a0){logger['error'](_0xddd1('0x24'),_0xa2b4a0['message'],_0x3d00cf);_0x25e73e(_0x4bf0e8['error'](0x1f4,_0xa2b4a0['message']));});});}; \ No newline at end of file +var _0x0fd1=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','debug','find','raw','where','ShowMailQueue','lodash','util'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0x0fd1,0x12b));var _0x10fd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0fd1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x10fd('0x0'));var util=require(_0x10fd('0x1'));var moment=require(_0x10fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x10fd('0x3'));var fs=require('fs');var Redis=require(_0x10fd('0x4'));var db=require(_0x10fd('0x5'))['db'];var utils=require(_0x10fd('0x6'));var logger=require(_0x10fd('0x7'))(_0x10fd('0x8'));var config=require(_0x10fd('0x9'));var jayson=require(_0x10fd('0xa'));var client=jayson['client'][_0x10fd('0xb')]({'port':0x232a});config[_0x10fd('0xc')]=_[_0x10fd('0xd')](config[_0x10fd('0xc')],{'host':_0x10fd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x10fd('0xf'))[_0x10fd('0x10')](socket);function respondWithRpcPromise(_0x29ac15,_0x300601,_0x2ae208){return new BPromise(function(_0x53dfe3,_0x1b0fbf){return client[_0x10fd('0x11')](_0x29ac15,_0x2ae208)[_0x10fd('0x12')](function(_0x3cf82e){logger['info']('MailQueue,\x20%s,\x20%s',_0x300601,'request\x20sent');logger['debug'](_0x10fd('0x13'),_0x300601,_0x10fd('0x14'),JSON[_0x10fd('0x15')](_0x3cf82e));if(_0x3cf82e[_0x10fd('0x16')]){if(_0x3cf82e[_0x10fd('0x16')][_0x10fd('0x17')]===0x1f4){logger[_0x10fd('0x16')](_0x10fd('0x18'),_0x300601,_0x3cf82e[_0x10fd('0x16')]['message']);return _0x1b0fbf(_0x3cf82e[_0x10fd('0x16')]['message']);}logger[_0x10fd('0x16')](_0x10fd('0x18'),_0x300601,_0x3cf82e[_0x10fd('0x16')][_0x10fd('0x19')]);return _0x53dfe3(_0x3cf82e[_0x10fd('0x16')]['message']);}else{logger[_0x10fd('0x1a')](_0x10fd('0x18'),_0x300601,_0x10fd('0x14'));_0x53dfe3(_0x3cf82e[_0x10fd('0x1b')]['message']);}})[_0x10fd('0x1c')](function(_0x313dd2){logger[_0x10fd('0x16')]('MailQueue,\x20%s,\x20%s',_0x300601,_0x313dd2);_0x1b0fbf(_0x313dd2);});});}exports[_0x10fd('0x1d')]=function(_0x211cf6){var _0x1de1c5=this;return new Promise(function(_0x876e80,_0x3b49c1){return db[_0x10fd('0x1e')][_0x10fd('0x1f')]({'raw':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')]['where']||null:null,'attributes':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')][_0x10fd('0x21')]||null:null,'limit':_0x211cf6[_0x10fd('0x20')]?_0x211cf6['options'][_0x10fd('0x22')]||null:null,'include':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')][_0x10fd('0x23')]?_['map'](_0x211cf6['options'][_0x10fd('0x23')],function(_0x58c823){return{'model':db[_0x58c823['model']],'as':_0x58c823['as'],'attributes':_0x58c823[_0x10fd('0x21')],'include':_0x58c823['include']?_[_0x10fd('0x24')](_0x58c823[_0x10fd('0x23')],function(_0xa1bc61){return{'model':db[_0xa1bc61['model']],'as':_0xa1bc61['as'],'attributes':_0xa1bc61[_0x10fd('0x21')],'include':_0xa1bc61[_0x10fd('0x23')]?_['map'](_0xa1bc61[_0x10fd('0x23')],function(_0x5a46bb){return{'model':db[_0x5a46bb[_0x10fd('0x25')]],'as':_0x5a46bb['as'],'attributes':_0x5a46bb[_0x10fd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x10fd('0x12')](function(_0x4217f8){logger[_0x10fd('0x1a')]('GetMailQueue',_0x211cf6);logger[_0x10fd('0x26')](_0x10fd('0x1d'),_0x211cf6,JSON[_0x10fd('0x15')](_0x4217f8));_0x876e80(_0x4217f8);})[_0x10fd('0x1c')](function(_0x197d19){logger['error'](_0x10fd('0x1d'),_0x197d19[_0x10fd('0x19')],_0x211cf6);_0x3b49c1(_0x1de1c5[_0x10fd('0x16')](0x1f4,_0x197d19[_0x10fd('0x19')]));});});};exports['ShowMailQueue']=function(_0x5ace87){var _0x4118c8=this;return new Promise(function(_0x45720,_0x4b9ead){return db[_0x10fd('0x1e')][_0x10fd('0x27')]({'raw':_0x5ace87['options']?_0x5ace87['options'][_0x10fd('0x28')]===undefined?!![]:![]:!![],'where':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x29')]||null:null,'attributes':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x21')]||null:null,'include':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x5ace87[_0x10fd('0x20')]['include'],function(_0x56bbc5){return{'model':db[_0x56bbc5[_0x10fd('0x25')]],'as':_0x56bbc5['as'],'attributes':_0x56bbc5[_0x10fd('0x21')],'include':_0x56bbc5[_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x56bbc5[_0x10fd('0x23')],function(_0x1d7287){return{'model':db[_0x1d7287[_0x10fd('0x25')]],'as':_0x1d7287['as'],'attributes':_0x1d7287[_0x10fd('0x21')],'include':_0x1d7287[_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x1d7287[_0x10fd('0x23')],function(_0x41ff53){return{'model':db[_0x41ff53[_0x10fd('0x25')]],'as':_0x41ff53['as'],'attributes':_0x41ff53[_0x10fd('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a7bf8){logger[_0x10fd('0x1a')]('ShowMailQueue',_0x5ace87);logger[_0x10fd('0x26')](_0x10fd('0x2a'),_0x5ace87,JSON[_0x10fd('0x15')](_0x3a7bf8));_0x45720(_0x3a7bf8);})[_0x10fd('0x1c')](function(_0x3103cd){logger[_0x10fd('0x16')]('ShowMailQueue',_0x3103cd[_0x10fd('0x19')],_0x5ace87);_0x4b9ead(_0x4118c8[_0x10fd('0x16')](0x1f4,_0x3103cd[_0x10fd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e773871..63744aa 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 _0x4e94=['save','update','emit','length','mailQueue:','./mailQueue.events'];(function(_0xcceb4e,_0x16b9cd){var _0x458bda=function(_0x2efa9c){while(--_0x2efa9c){_0xcceb4e['push'](_0xcceb4e['shift']());}};_0x458bda(++_0x16b9cd);}(_0x4e94,0x155));var _0x44e9=function(_0x14ea32,_0x262909){_0x14ea32=_0x14ea32-0x0;var _0x137bbb=_0x4e94[_0x14ea32];return _0x137bbb;};'use strict';var MailQueueEvents=require(_0x44e9('0x0'));var events=[_0x44e9('0x1'),'remove',_0x44e9('0x2')];function createListener(_0xd34fab,_0x4819b9){return function(_0x588834){_0x4819b9[_0x44e9('0x3')](_0xd34fab,_0x588834);};}function removeListener(_0x589ab3,_0x3a7f9b){return function(){MailQueueEvents['removeListener'](_0x589ab3,_0x3a7f9b);};}exports['register']=function(_0x4ae4f4){for(var _0x3c2680=0x0,_0x1b9c32=events[_0x44e9('0x4')];_0x3c2680<_0x1b9c32;_0x3c2680++){var _0x55b18a=events[_0x3c2680];var _0xdc9afd=createListener(_0x44e9('0x5')+_0x55b18a,_0x4ae4f4);MailQueueEvents['on'](_0x55b18a,_0xdc9afd);}}; \ No newline at end of file +var _0x15a5=['save','update','emit','removeListener','register','length','./mailQueue.events'];(function(_0x1d1f04,_0x9d3533){var _0x448de6=function(_0x5d6300){while(--_0x5d6300){_0x1d1f04['push'](_0x1d1f04['shift']());}};_0x448de6(++_0x9d3533);}(_0x15a5,0x148));var _0x515a=function(_0x15db27,_0x5c163b){_0x15db27=_0x15db27-0x0;var _0x1d0efb=_0x15a5[_0x15db27];return _0x1d0efb;};'use strict';var MailQueueEvents=require(_0x515a('0x0'));var events=[_0x515a('0x1'),'remove',_0x515a('0x2')];function createListener(_0x467e8f,_0x913958){return function(_0x60cb5b){_0x913958[_0x515a('0x3')](_0x467e8f,_0x60cb5b);};}function removeListener(_0x33911d,_0x1740cb){return function(){MailQueueEvents[_0x515a('0x4')](_0x33911d,_0x1740cb);};}exports[_0x515a('0x5')]=function(_0x58da7d){for(var _0xeec4a4=0x0,_0x94d3e9=events[_0x515a('0x6')];_0xeec4a4<_0x94d3e9;_0xeec4a4++){var _0xc67e74=events[_0xeec4a4];var _0x8b9dee=createListener('mailQueue:'+_0xc67e74,_0x58da7d);MailQueueEvents['on'](_0xc67e74,_0x8b9dee);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4863e99..d84f3db 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 _0x5359=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get'];(function(_0xbabbca,_0x434f98){var _0x4c9cef=function(_0x5ae279){while(--_0x5ae279){_0xbabbca['push'](_0xbabbca['shift']());}};_0x4c9cef(++_0x434f98);}(_0x5359,0xa3));var _0x9535=function(_0x18ff7b,_0x3a500f){_0x18ff7b=_0x18ff7b-0x0;var _0x4a07ac=_0x5359[_0x18ff7b];return _0x4a07ac;};'use strict';var multer=require(_0x9535('0x0'));var util=require(_0x9535('0x1'));var path=require('path');var timeout=require(_0x9535('0x2'));var express=require('express');var router=express[_0x9535('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9535('0x4'));var interaction=require(_0x9535('0x5'));var config=require('../../config/environment');var controller=require(_0x9535('0x6'));router[_0x9535('0x7')]('/',auth[_0x9535('0x8')](),controller[_0x9535('0x9')]);router[_0x9535('0x7')](_0x9535('0xa'),auth[_0x9535('0x8')](),controller[_0x9535('0xb')]);router[_0x9535('0x7')](_0x9535('0xc'),auth[_0x9535('0x8')](),controller[_0x9535('0xd')]);router[_0x9535('0xe')]('/',auth['isAuthenticated'](),controller[_0x9535('0xf')]);router['put'](_0x9535('0xc'),auth[_0x9535('0x8')](),controller[_0x9535('0x10')]);router[_0x9535('0x11')](_0x9535('0xc'),auth[_0x9535('0x8')](),controller['destroy']);module[_0x9535('0x12')]=router; \ No newline at end of file +var _0x52bd=['/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe'];(function(_0x4f44e7,_0x15ef68){var _0x3e2c9a=function(_0x20468b){while(--_0x20468b){_0x4f44e7['push'](_0x4f44e7['shift']());}};_0x3e2c9a(++_0x15ef68);}(_0x52bd,0x127));var _0xd52b=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x52bd[_0x32d457];return _0x338386;};'use strict';var multer=require(_0xd52b('0x0'));var util=require('util');var path=require(_0xd52b('0x1'));var timeout=require(_0xd52b('0x2'));var express=require(_0xd52b('0x3'));var router=express['Router']();var fs_extra=require(_0xd52b('0x4'));var auth=require(_0xd52b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd52b('0x6'));var controller=require(_0xd52b('0x7'));router[_0xd52b('0x8')]('/',auth[_0xd52b('0x9')](),controller['index']);router['get']('/describe',auth[_0xd52b('0x9')](),controller[_0xd52b('0xa')]);router['get'](_0xd52b('0xb'),auth[_0xd52b('0x9')](),controller[_0xd52b('0xc')]);router['post']('/',auth[_0xd52b('0x9')](),controller['create']);router[_0xd52b('0xd')](_0xd52b('0xb'),auth['isAuthenticated'](),controller[_0xd52b('0xe')]);router[_0xd52b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd52b('0x10')]);module[_0xd52b('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2b216ad..65c5681 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 _0xa77c=['moment','sequelize','exports','STRING','DATE'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xa77c,0x131));var _0xca77=function(_0x5680e7,_0x39162d){_0x5680e7=_0x5680e7-0x0;var _0x1c0452=_0xa77c[_0x5680e7];return _0x1c0452;};'use strict';var moment=require(_0xca77('0x0'));var Sequelize=require(_0xca77('0x1'));module[_0xca77('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xca77('0x3')]},'joinAt':{'type':Sequelize[_0xca77('0x4')]},'leaveAt':{'type':Sequelize[_0xca77('0x4')]},'acceptAt':{'type':Sequelize[_0xca77('0x4')]},'exitAt':{'type':Sequelize[_0xca77('0x4')]},'reason':{'type':Sequelize[_0xca77('0x3')]}}; \ No newline at end of file +var _0x0da1=['exports','STRING','DATE'];(function(_0x2d6bf5,_0x4996a5){var _0xdfa6f4=function(_0x4f1136){while(--_0x4f1136){_0x2d6bf5['push'](_0x2d6bf5['shift']());}};_0xdfa6f4(++_0x4996a5);}(_0x0da1,0x153));var _0x10da=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0da1[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x10da('0x0')]={'uniqueid':{'type':Sequelize[_0x10da('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x10da('0x1')]},'joinAt':{'type':Sequelize[_0x10da('0x2')]},'leaveAt':{'type':Sequelize[_0x10da('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x10da('0x2')]},'reason':{'type':Sequelize[_0x10da('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 4aef5a4..4b3cb21 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 _0x66fa=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','MailQueueReport','findAll','rows','catch','merge','options','find','create','body','params','describe','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'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x66fa,0x117));var _0xa66f=function(_0xa497b6,_0x3ec79c){_0xa497b6=_0xa497b6-0x0;var _0xd16b16=_0x66fa[_0xa497b6];return _0xd16b16;};'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'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['MailQueueReport'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['MailQueueReport'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':!![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['MailQueueReport'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['MailQueueReport'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));};exports[_0xa66f('0x4a')]=function(_0x5d77d1,_0x389b9a){return db['MailQueueReport'][_0xa66f('0x4a')]()['then'](respondWithResult(_0x389b9a,null))['catch'](handleError(_0x389b9a,null));}; \ No newline at end of file +var _0xe3da=['../../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','MailQueueReport','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','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x54311d,_0x2a5e5e){var _0x376a1b=function(_0x5c08e2){while(--_0x5c08e2){_0x54311d['push'](_0x54311d['shift']());}};_0x376a1b(++_0x2a5e5e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'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));};exports['describe']=function(_0x4f4694,_0x4c6dab){return db[_0xae3d('0x2f')][_0xae3d('0x50')]()['then'](respondWithResult(_0x4c6dab,null))[_0xae3d('0x48')](handleError(_0x4c6dab,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 0c2ba5b..278927e 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 _0x4a05=['moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','api'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0x4a05,0x112));var _0x54a0=function(_0x45564a,_0x160043){_0x45564a=_0x45564a-0x0;var _0x1184c7=_0x4a05[_0x45564a];return _0x1184c7;};'use strict';var _=require(_0x54a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x54a0('0x1'));var moment=require(_0x54a0('0x2'));var BPromise=require(_0x54a0('0x3'));var rp=require(_0x54a0('0x4'));var fs=require('fs');var path=require(_0x54a0('0x5'));var rimraf=require('rimraf');var config=require(_0x54a0('0x6'));var attributes=require(_0x54a0('0x7'));module[_0x54a0('0x8')]=function(_0x53ca9d,_0x290caf){return _0x53ca9d['define'](_0x54a0('0x9'),attributes,{'tableName':_0x54a0('0xa'),'paranoid':![],'indexes':[{'name':_0x54a0('0xb'),'fields':[_0x54a0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb658=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger'];(function(_0x2d7e3b,_0xf89c8b){var _0x480845=function(_0x5bebc0){while(--_0x5bebc0){_0x2d7e3b['push'](_0x2d7e3b['shift']());}};_0x480845(++_0xf89c8b);}(_0xb658,0x15a));var _0x8b65=function(_0x4c72ee,_0x2cf314){_0x4c72ee=_0x4c72ee-0x0;var _0x13a6e7=_0xb658[_0x4c72ee];return _0x13a6e7;};'use strict';var _=require(_0x8b65('0x0'));var util=require('util');var logger=require(_0x8b65('0x1'))('api');var moment=require(_0x8b65('0x2'));var BPromise=require(_0x8b65('0x3'));var rp=require(_0x8b65('0x4'));var fs=require('fs');var path=require(_0x8b65('0x5'));var rimraf=require(_0x8b65('0x6'));var config=require(_0x8b65('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x8b65('0x8')]=function(_0x50367b,_0x1e583a){return _0x50367b['define'](_0x8b65('0x9'),attributes,{'tableName':_0x8b65('0xa'),'paranoid':![],'indexes':[{'name':_0x8b65('0xb'),'fields':[_0x8b65('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index f21e516..2d7bfbc 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0xa57737,_0x3c1c82){var _0x113fbd=function(_0x1bddb1){while(--_0x1bddb1){_0xa57737['push'](_0xa57737['shift']());}};_0x113fbd(++_0x3c1c82);}(_0x7a54,0x106));var _0x47a5=function(_0x5cbdb8,_0x9607ef){_0x5cbdb8=_0x5cbdb8-0x0;var _0x5bf60f=_0x7a54[_0x5cbdb8];return _0x5bf60f;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x52bda3,_0x42a0f9){var _0x398643=function(_0x28a2d2){while(--_0x28a2d2){_0x52bda3['push'](_0x52bda3['shift']());}};_0x398643(++_0x42a0f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53f2e6,_0x2d726e){_0x53f2e6=_0x53f2e6-0x0;var _0x347e90=_0x5f2f[_0x53f2e6];return _0x347e90;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index e4f794f..00685d7 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x25ef62,_0xe56357){var _0x43c0b3=function(_0x31d923){while(--_0x31d923){_0x25ef62['push'](_0x25ef62['shift']());}};_0x43c0b3(++_0xe56357);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xcb91[_0x1faaa1];return _0x994ec;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5d3d39,_0x5ed8a1){var _0x2de363=function(_0x450907){while(--_0x450907){_0x5d3d39['push'](_0x5d3d39['shift']());}};_0x2de363(++_0x5ed8a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0f9f896..029b574 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 _0x5ff3=['INBOX','exports','STRING','INTEGER','BOOLEAN'];(function(_0x5eb036,_0x59968b){var _0x1d3d86=function(_0x392914){while(--_0x392914){_0x5eb036['push'](_0x5eb036['shift']());}};_0x1d3d86(++_0x59968b);}(_0x5ff3,0x17d));var _0x35ff=function(_0x562cc8,_0x141f33){_0x562cc8=_0x562cc8-0x0;var _0x5d8338=_0x5ff3[_0x562cc8];return _0x5d8338;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x35ff('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x35ff('0x1')]},'password':{'type':Sequelize[_0x35ff('0x1')]},'port':{'type':Sequelize[_0x35ff('0x2')]},'tls':{'type':Sequelize[_0x35ff('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x4')},'connTimeout':{'type':Sequelize[_0x35ff('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x35ff('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file +var _0x2bb0=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x224995,_0x37fd2d){var _0x15f82e=function(_0x1ab6c3){while(--_0x1ab6c3){_0x224995['push'](_0x224995['shift']());}};_0x15f82e(++_0x37fd2d);}(_0x2bb0,0xf3));var _0x02bb=function(_0xfe38b4,_0x3b20b7){_0xfe38b4=_0xfe38b4-0x0;var _0x10c11e=_0x2bb0[_0xfe38b4];return _0x10c11e;};'use strict';var Sequelize=require(_0x02bb('0x0'));module[_0x02bb('0x1')]={'description':{'type':Sequelize[_0x02bb('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x02bb('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x02bb('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x02bb('0x2')],'defaultValue':_0x02bb('0x5')},'connTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x02bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 00e4e08..8cdefd8 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 _0x3200=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','util','api','moment','bluebird','request-promise','path'];(function(_0x552ff2,_0x198a5f){var _0x45aa93=function(_0x6db4f5){while(--_0x6db4f5){_0x552ff2['push'](_0x552ff2['shift']());}};_0x45aa93(++_0x198a5f);}(_0x3200,0x1ce));var _0x0320=function(_0x361752,_0x159f75){_0x361752=_0x361752-0x0;var _0x4c0fa8=_0x3200[_0x361752];return _0x4c0fa8;};'use strict';var _=require('lodash');var util=require(_0x0320('0x0'));var logger=require('../../config/logger')(_0x0320('0x1'));var moment=require(_0x0320('0x2'));var BPromise=require(_0x0320('0x3'));var rp=require(_0x0320('0x4'));var fs=require('fs');var path=require(_0x0320('0x5'));var rimraf=require(_0x0320('0x6'));var config=require(_0x0320('0x7'));var attributes=require(_0x0320('0x8'));module[_0x0320('0x9')]=function(_0x45dc63,_0x2ced60){return _0x45dc63[_0x0320('0xa')](_0x0320('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94dc=['MailServerIn','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes'];(function(_0x28659e,_0x494fd0){var _0x504384=function(_0x5a97fe){while(--_0x5a97fe){_0x28659e['push'](_0x28659e['shift']());}};_0x504384(++_0x494fd0);}(_0x94dc,0xf4));var _0xc94d=function(_0x35885d,_0x3edc49){_0x35885d=_0x35885d-0x0;var _0x25bc54=_0x94dc[_0x35885d];return _0x25bc54;};'use strict';var _=require('lodash');var util=require(_0xc94d('0x0'));var logger=require(_0xc94d('0x1'))('api');var moment=require(_0xc94d('0x2'));var BPromise=require(_0xc94d('0x3'));var rp=require(_0xc94d('0x4'));var fs=require('fs');var path=require(_0xc94d('0x5'));var rimraf=require(_0xc94d('0x6'));var config=require('../../config/environment');var attributes=require(_0xc94d('0x7'));module['exports']=function(_0x269c97,_0x394dc2){return _0x269c97['define'](_0xc94d('0x8'),attributes,{'tableName':'mail_servers_in','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 8a5ca09..73336b0 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 _0x4ee2=['error','code','message','result','catch','GetMailServerIn','MailServerIn','options','where','limit','include','attributes','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x83a430,_0x5b0cb7){var _0x2a1cdb=function(_0x15538c){while(--_0x15538c){_0x83a430['push'](_0x83a430['shift']());}};_0x2a1cdb(++_0x5b0cb7);}(_0x4ee2,0x140));var _0x24ee=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4ee2[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x24ee('0x0'));var util=require(_0x24ee('0x1'));var moment=require(_0x24ee('0x2'));var BPromise=require(_0x24ee('0x3'));var rs=require(_0x24ee('0x4'));var fs=require('fs');var Redis=require(_0x24ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x24ee('0x6'));var logger=require(_0x24ee('0x7'))(_0x24ee('0x8'));var config=require(_0x24ee('0x9'));var jayson=require(_0x24ee('0xa'));var client=jayson['client'][_0x24ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d2480,_0x4f0d1d,_0x4210e7){return new BPromise(function(_0x44f6a2,_0x18dabe){return client[_0x24ee('0xc')](_0x4d2480,_0x4210e7)[_0x24ee('0xd')](function(_0x2b50c0){logger[_0x24ee('0xe')](_0x24ee('0xf'),_0x4f0d1d,_0x24ee('0x10'));logger[_0x24ee('0x11')](_0x24ee('0x12'),_0x4f0d1d,_0x24ee('0x10'),JSON[_0x24ee('0x13')](_0x2b50c0));if(_0x2b50c0[_0x24ee('0x14')]){if(_0x2b50c0['error'][_0x24ee('0x15')]===0x1f4){logger[_0x24ee('0x14')](_0x24ee('0xf'),_0x4f0d1d,_0x2b50c0[_0x24ee('0x14')][_0x24ee('0x16')]);return _0x18dabe(_0x2b50c0[_0x24ee('0x14')]['message']);}logger[_0x24ee('0x14')](_0x24ee('0xf'),_0x4f0d1d,_0x2b50c0[_0x24ee('0x14')][_0x24ee('0x16')]);return _0x44f6a2(_0x2b50c0[_0x24ee('0x14')][_0x24ee('0x16')]);}else{logger[_0x24ee('0xe')]('MailServerIn,\x20%s,\x20%s',_0x4f0d1d,_0x24ee('0x10'));_0x44f6a2(_0x2b50c0[_0x24ee('0x17')]['message']);}})[_0x24ee('0x18')](function(_0x2cb4ba){logger[_0x24ee('0x14')](_0x24ee('0xf'),_0x4f0d1d,_0x2cb4ba);_0x18dabe(_0x2cb4ba);});});}exports[_0x24ee('0x19')]=function(_0x52263c){var _0x57c27a=this;return new Promise(function(_0x571347,_0x41fa43){return db[_0x24ee('0x1a')]['findAll']({'raw':_0x52263c[_0x24ee('0x1b')]?_0x52263c[_0x24ee('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x52263c['options']?_0x52263c['options'][_0x24ee('0x1c')]||null:null,'attributes':_0x52263c['options']?_0x52263c[_0x24ee('0x1b')]['attributes']||null:null,'limit':_0x52263c[_0x24ee('0x1b')]?_0x52263c[_0x24ee('0x1b')][_0x24ee('0x1d')]||null:null,'include':_0x52263c[_0x24ee('0x1b')]?_0x52263c[_0x24ee('0x1b')][_0x24ee('0x1e')]?_['map'](_0x52263c[_0x24ee('0x1b')]['include'],function(_0x137bd2){return{'model':db[_0x137bd2['model']],'as':_0x137bd2['as'],'attributes':_0x137bd2[_0x24ee('0x1f')],'include':_0x137bd2[_0x24ee('0x1e')]?_[_0x24ee('0x20')](_0x137bd2[_0x24ee('0x1e')],function(_0x54f721){return{'model':db[_0x54f721[_0x24ee('0x21')]],'as':_0x54f721['as'],'attributes':_0x54f721['attributes'],'include':_0x54f721[_0x24ee('0x1e')]?_['map'](_0x54f721['include'],function(_0x56b9af){return{'model':db[_0x56b9af[_0x24ee('0x21')]],'as':_0x56b9af['as'],'attributes':_0x56b9af[_0x24ee('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dc5db){logger[_0x24ee('0xe')]('GetMailServerIn',_0x52263c);logger['debug']('GetMailServerIn',_0x52263c,JSON[_0x24ee('0x13')](_0x4dc5db));_0x571347(_0x4dc5db);})[_0x24ee('0x18')](function(_0x3a9d27){logger[_0x24ee('0x14')]('GetMailServerIn',_0x3a9d27[_0x24ee('0x16')],_0x52263c);_0x41fa43(_0x57c27a[_0x24ee('0x14')](0x1f4,_0x3a9d27[_0x24ee('0x16')]));});});}; \ No newline at end of file +var _0xa376=['stringify','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x5bbe55,_0x117f68){var _0xf412c1=function(_0x69ba11){while(--_0x69ba11){_0x5bbe55['push'](_0x5bbe55['shift']());}};_0xf412c1(++_0x117f68);}(_0xa376,0x88));var _0x6a37=function(_0x4b2bbc,_0x3cb2ce){_0x4b2bbc=_0x4b2bbc-0x0;var _0x257290=_0xa376[_0x4b2bbc];return _0x257290;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a37('0x0'));var BPromise=require('bluebird');var rs=require(_0x6a37('0x1'));var fs=require('fs');var Redis=require(_0x6a37('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a37('0x3'))(_0x6a37('0x4'));var config=require(_0x6a37('0x5'));var jayson=require(_0x6a37('0x6'));var client=jayson[_0x6a37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247887,_0x155f90,_0x3d66c8){return new BPromise(function(_0x1ec441,_0xac3aa2){return client[_0x6a37('0x8')](_0x247887,_0x3d66c8)[_0x6a37('0x9')](function(_0x488b87){logger[_0x6a37('0xa')]('MailServerIn,\x20%s,\x20%s',_0x155f90,'request\x20sent');logger[_0x6a37('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x155f90,'request\x20sent',JSON['stringify'](_0x488b87));if(_0x488b87['error']){if(_0x488b87[_0x6a37('0xc')]['code']===0x1f4){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x488b87[_0x6a37('0xc')][_0x6a37('0xe')]);return _0xac3aa2(_0x488b87[_0x6a37('0xc')]['message']);}logger[_0x6a37('0xc')]('MailServerIn,\x20%s,\x20%s',_0x155f90,_0x488b87[_0x6a37('0xc')]['message']);return _0x1ec441(_0x488b87[_0x6a37('0xc')]['message']);}else{logger[_0x6a37('0xa')](_0x6a37('0xd'),_0x155f90,'request\x20sent');_0x1ec441(_0x488b87[_0x6a37('0xf')][_0x6a37('0xe')]);}})[_0x6a37('0x10')](function(_0x2f8e0a){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x2f8e0a);_0xac3aa2(_0x2f8e0a);});});}exports[_0x6a37('0x11')]=function(_0x6b525a){var _0x3ecd35=this;return new Promise(function(_0x22fc54,_0x4f91df){return db['MailServerIn'][_0x6a37('0x12')]({'raw':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x14')]===undefined?!![]:![]:!![],'where':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')]['where']||null:null,'attributes':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x15')]||null:null,'limit':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x16')]||null:null,'include':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')]['include']?_[_0x6a37('0x17')](_0x6b525a[_0x6a37('0x13')][_0x6a37('0x18')],function(_0x13fc84){return{'model':db[_0x13fc84[_0x6a37('0x19')]],'as':_0x13fc84['as'],'attributes':_0x13fc84[_0x6a37('0x15')],'include':_0x13fc84[_0x6a37('0x18')]?_['map'](_0x13fc84[_0x6a37('0x18')],function(_0xf8d82d){return{'model':db[_0xf8d82d[_0x6a37('0x19')]],'as':_0xf8d82d['as'],'attributes':_0xf8d82d[_0x6a37('0x15')],'include':_0xf8d82d[_0x6a37('0x18')]?_[_0x6a37('0x17')](_0xf8d82d[_0x6a37('0x18')],function(_0x3c25a5){return{'model':db[_0x3c25a5[_0x6a37('0x19')]],'as':_0x3c25a5['as'],'attributes':_0x3c25a5[_0x6a37('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6a37('0x9')](function(_0x1a45dd){logger[_0x6a37('0xa')](_0x6a37('0x11'),_0x6b525a);logger[_0x6a37('0xb')](_0x6a37('0x11'),_0x6b525a,JSON[_0x6a37('0x1a')](_0x1a45dd));_0x22fc54(_0x1a45dd);})[_0x6a37('0x10')](function(_0x2573e5){logger['error']('GetMailServerIn',_0x2573e5[_0x6a37('0xe')],_0x6b525a);_0x4f91df(_0x3ecd35[_0x6a37('0xc')](0x1f4,_0x2573e5[_0x6a37('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e6bb75c..6e0ab0f 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2756bda..ebf6462 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 _0xa88f=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x409e00,_0x407be0){var _0x39266e=function(_0x3a9b31){while(--_0x3a9b31){_0x409e00['push'](_0x409e00['shift']());}};_0x39266e(++_0x407be0);}(_0xa88f,0x182));var _0xfa88=function(_0x1bbaad,_0x4b149b){_0x1bbaad=_0x1bbaad-0x0;var _0x47860f=_0xa88f[_0x1bbaad];return _0x47860f;};'use strict';var Sequelize=require(_0xfa88('0x0'));module[_0xfa88('0x1')]={'description':{'type':Sequelize[_0xfa88('0x2')]},'host':{'type':Sequelize[_0xfa88('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfa88('0x3')]},'secure':{'type':Sequelize[_0xfa88('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xfa88('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3b71=['exports','STRING','BOOLEAN','sequelize'];(function(_0x378606,_0x2c0e11){var _0x987f1=function(_0x1242d8){while(--_0x1242d8){_0x378606['push'](_0x378606['shift']());}};_0x987f1(++_0x2c0e11);}(_0x3b71,0x18f));var _0x13b7=function(_0x5bdd72,_0x4ee4a7){_0x5bdd72=_0x5bdd72-0x0;var _0x3d6c8b=_0x3b71[_0x5bdd72];return _0x3d6c8b;};'use strict';var Sequelize=require(_0x13b7('0x0'));module[_0x13b7('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x13b7('0x2')]},'user':{'type':Sequelize[_0x13b7('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x13b7('0x2')]},'authentication':{'type':Sequelize[_0x13b7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 4b42ba4..7b2ea8c 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 _0x480a=['name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','reject','save','update','then','destroy','stack'];(function(_0x2fa585,_0x5088d){var _0x3157d0=function(_0x4881e5){while(--_0x4881e5){_0x2fa585['push'](_0x2fa585['shift']());}};_0x3157d0(++_0x5088d);}(_0x480a,0x1d8));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa480('0x0'));var rimraf=require(_0xa480('0x1'));var zipdir=require(_0xa480('0x2'));var jsonpatch=require(_0xa480('0x3'));var rp=require('request-promise');var moment=require(_0xa480('0x4'));var BPromise=require(_0xa480('0x5'));var Mustache=require(_0xa480('0x6'));var util=require(_0xa480('0x7'));var path=require(_0xa480('0x8'));var sox=require(_0xa480('0x9'));var csv=require(_0xa480('0xa'));var ejs=require(_0xa480('0xb'));var fs=require('fs');var fs_extra=require(_0xa480('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa480('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa480('0xa'));var querystring=require(_0xa480('0xe'));var Papa=require('papaparse');var Redis=require(_0xa480('0xf'));var authService=require(_0xa480('0x10'));var qs=require(_0xa480('0x11'));var as=require(_0xa480('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa480('0x13'))(_0xa480('0x14'));var utils=require(_0xa480('0x15'));var config=require(_0xa480('0x16'));var licenseUtil=require(_0xa480('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbc38e8,_0x52fd1d){_0x52fd1d=_0x52fd1d||0xcc;return function(_0x389a1b){if(_0x389a1b){return _0xbc38e8[_0xa480('0x18')](_0x52fd1d);}return _0xbc38e8[_0xa480('0x19')](_0x52fd1d)[_0xa480('0x1a')]();};}function respondWithResult(_0x1bb9cb,_0x514940){_0x514940=_0x514940||0xc8;return function(_0x5affbf){if(_0x5affbf){return _0x1bb9cb[_0xa480('0x19')](_0x514940)['json'](_0x5affbf);}};}function respondWithFilteredResult(_0x140dac,_0x4e5a51){return function(_0x109b17){if(_0x109b17){var _0x593d32=typeof _0x4e5a51['offset']===_0xa480('0x1b')&&typeof _0x4e5a51[_0xa480('0x1c')]===_0xa480('0x1b');var _0x24d06e=_0x109b17['count'];var _0x16b475=_0x593d32?0x0:_0x4e5a51[_0xa480('0x1d')];var _0x5da2f9=_0x593d32?_0x109b17[_0xa480('0x1e')]:_0x4e5a51[_0xa480('0x1d')]+_0x4e5a51[_0xa480('0x1c')];var _0x411bc5;if(_0x5da2f9>=_0x24d06e){_0x5da2f9=_0x24d06e;_0x411bc5=0xc8;}else{_0x411bc5=0xce;}_0x140dac[_0xa480('0x19')](_0x411bc5);return _0x140dac['set'](_0xa480('0x1f'),_0x16b475+'-'+_0x5da2f9+'/'+_0x24d06e)[_0xa480('0x20')](_0x109b17);}return null;};}function patchUpdates(_0x28abd5){return function(_0x3fe8e8){try{jsonpatch['apply'](_0x3fe8e8,_0x28abd5,!![]);}catch(_0x124d48){return BPromise[_0xa480('0x21')](_0x124d48);}return _0x3fe8e8[_0xa480('0x22')]();};}function saveUpdates(_0x5e7748,_0x5b7594){return function(_0x5a9605){if(_0x5a9605){return _0x5a9605[_0xa480('0x23')](_0x5e7748)[_0xa480('0x24')](function(_0x22b32a){return _0x22b32a;});}return null;};}function removeEntity(_0x42e916,_0x47f66b){return function(_0x4b92b6){if(_0x4b92b6){return _0x4b92b6[_0xa480('0x25')]()[_0xa480('0x24')](function(){_0x42e916[_0xa480('0x19')](0xcc)[_0xa480('0x1a')]();});}};}function handleEntityNotFound(_0x581339,_0xfb4859){return function(_0xe6965){if(!_0xe6965){_0x581339[_0xa480('0x18')](0x194);}return _0xe6965;};}function handleError(_0x41c679,_0x59dd81){_0x59dd81=_0x59dd81||0x1f4;return function(_0x20cadc){logger['error'](_0x20cadc[_0xa480('0x26')]);if(_0x20cadc['name']){delete _0x20cadc[_0xa480('0x27')];}_0x41c679[_0xa480('0x19')](_0x59dd81)['send'](_0x20cadc);};}exports[_0xa480('0x28')]=function(_0x446270,_0x5ae747){var _0x590c54={},_0x8858f3={},_0x14d54f={'count':0x0,'rows':[]};var _0x199183=_[_0xa480('0x29')](db[_0xa480('0x2a')][_0xa480('0x2b')],function(_0x53a3c1){return{'name':_0x53a3c1[_0xa480('0x2c')],'type':_0x53a3c1[_0xa480('0x2d')][_0xa480('0x2e')]};});_0x8858f3[_0xa480('0x2f')]=_['map'](_0x199183,_0xa480('0x27'));_0x8858f3[_0xa480('0x30')]=_[_0xa480('0x31')](_0x446270[_0xa480('0x30')]);_0x8858f3[_0xa480('0x32')]=_[_0xa480('0x33')](_0x8858f3[_0xa480('0x2f')],_0x8858f3['query']);_0x590c54[_0xa480('0x34')]=_[_0xa480('0x33')](_0x8858f3[_0xa480('0x2f')],qs[_0xa480('0x35')](_0x446270[_0xa480('0x30')][_0xa480('0x35')]));_0x590c54[_0xa480('0x34')]=_0x590c54['attributes'][_0xa480('0x36')]?_0x590c54['attributes']:_0x8858f3['model'];if(!_0x446270[_0xa480('0x30')][_0xa480('0x37')](_0xa480('0x38'))){_0x590c54[_0xa480('0x1c')]=qs['limit'](_0x446270['query'][_0xa480('0x1c')]);_0x590c54[_0xa480('0x1d')]=qs['offset'](_0x446270['query'][_0xa480('0x1d')]);}_0x590c54['order']=qs[_0xa480('0x39')](_0x446270[_0xa480('0x30')][_0xa480('0x39')]);_0x590c54[_0xa480('0x3a')]=qs['filters'](_[_0xa480('0x3b')](_0x446270[_0xa480('0x30')],_0x8858f3[_0xa480('0x32')]),_0x199183);if(_0x446270[_0xa480('0x30')][_0xa480('0x3c')]){_0x590c54[_0xa480('0x3a')]=_[_0xa480('0x3d')](_0x590c54[_0xa480('0x3a')],{'$or':_[_0xa480('0x29')](_0x199183,function(_0x8e7632){if(_0x8e7632[_0xa480('0x2d')]!==_0xa480('0x3e')){var _0x3ba75e={};_0x3ba75e[_0x8e7632[_0xa480('0x27')]]={'$like':'%'+_0x446270[_0xa480('0x30')][_0xa480('0x3c')]+'%'};return _0x3ba75e;}})});}_0x590c54=_[_0xa480('0x3d')]({},_0x590c54,_0x446270[_0xa480('0x3f')]);var _0x5b90c1={'where':_0x590c54['where']};return db['MailServerOut']['count'](_0x5b90c1)[_0xa480('0x24')](function(_0xcd09e7){_0x14d54f['count']=_0xcd09e7;if(_0x446270[_0xa480('0x30')][_0xa480('0x40')]){_0x590c54['include']=[{'all':!![]}];}return db[_0xa480('0x2a')][_0xa480('0x41')](_0x590c54);})[_0xa480('0x24')](function(_0x2cb6c3){_0x14d54f['rows']=_0x2cb6c3;return _0x14d54f;})[_0xa480('0x24')](respondWithFilteredResult(_0x5ae747,_0x590c54))[_0xa480('0x42')](handleError(_0x5ae747,null));};exports[_0xa480('0x43')]=function(_0x2696f4,_0x59545e){var _0xa617f={'raw':!![],'where':{'id':_0x2696f4[_0xa480('0x44')]['id']}},_0x1bd557={};_0x1bd557[_0xa480('0x2f')]=_[_0xa480('0x31')](db[_0xa480('0x2a')][_0xa480('0x2b')]);_0x1bd557[_0xa480('0x30')]=_[_0xa480('0x31')](_0x2696f4['query']);_0x1bd557[_0xa480('0x32')]=_['intersection'](_0x1bd557[_0xa480('0x2f')],_0x1bd557[_0xa480('0x30')]);_0xa617f[_0xa480('0x34')]=_[_0xa480('0x33')](_0x1bd557['model'],qs[_0xa480('0x35')](_0x2696f4['query']['fields']));_0xa617f[_0xa480('0x34')]=_0xa617f[_0xa480('0x34')][_0xa480('0x36')]?_0xa617f[_0xa480('0x34')]:_0x1bd557['model'];if(_0x2696f4[_0xa480('0x30')]['includeAll']){_0xa617f[_0xa480('0x45')]=[{'all':!![]}];}_0xa617f=_[_0xa480('0x3d')]({},_0xa617f,_0x2696f4[_0xa480('0x3f')]);return db['MailServerOut']['find'](_0xa617f)[_0xa480('0x24')](handleEntityNotFound(_0x59545e,null))[_0xa480('0x24')](respondWithResult(_0x59545e,null))['catch'](handleError(_0x59545e,null));};exports[_0xa480('0x46')]=function(_0x38fdc1,_0x5a9377){return db[_0xa480('0x2a')][_0xa480('0x46')](_0x38fdc1[_0xa480('0x47')],{})[_0xa480('0x24')](respondWithResult(_0x5a9377,0xc9))['catch'](handleError(_0x5a9377,null));};exports[_0xa480('0x23')]=function(_0x2fb06d,_0x2bf938){if(_0x2fb06d['body']['id']){delete _0x2fb06d[_0xa480('0x47')]['id'];}return db[_0xa480('0x2a')][_0xa480('0x48')]({'where':{'id':_0x2fb06d[_0xa480('0x44')]['id']}})[_0xa480('0x24')](handleEntityNotFound(_0x2bf938,null))[_0xa480('0x24')](saveUpdates(_0x2fb06d[_0xa480('0x47')],null))['then'](respondWithResult(_0x2bf938,null))['catch'](handleError(_0x2bf938,null));};exports['destroy']=function(_0x2cad9c,_0x1220cf){return db[_0xa480('0x2a')][_0xa480('0x48')]({'where':{'id':_0x2cad9c[_0xa480('0x44')]['id']}})[_0xa480('0x24')](handleEntityNotFound(_0x1220cf,null))[_0xa480('0x24')](removeEntity(_0x1220cf,null))[_0xa480('0x42')](handleError(_0x1220cf,null));}; \ No newline at end of file +var _0x3550=['keys','includeAll','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','end','error','stack','send','index','map','MailServerOut','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','include','findAll','show'];(function(_0x285448,_0x17f8f8){var _0x1ab6f5=function(_0x50929e){while(--_0x50929e){_0x285448['push'](_0x285448['shift']());}};_0x1ab6f5(++_0x17f8f8);}(_0x3550,0x1b1));var _0x0355=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x3550[_0x42ca15];return _0x1c6ded;};'use strict';var emlformat=require(_0x0355('0x0'));var rimraf=require(_0x0355('0x1'));var zipdir=require(_0x0355('0x2'));var jsonpatch=require(_0x0355('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0355('0x4'));var Mustache=require(_0x0355('0x5'));var util=require('util');var path=require(_0x0355('0x6'));var sox=require(_0x0355('0x7'));var csv=require('to-csv');var ejs=require(_0x0355('0x8'));var fs=require('fs');var fs_extra=require(_0x0355('0x9'));var _=require(_0x0355('0xa'));var squel=require(_0x0355('0xb'));var crypto=require(_0x0355('0xc'));var jsforce=require(_0x0355('0xd'));var deskjs=require(_0x0355('0xe'));var toCsv=require(_0x0355('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0355('0x10'));var as=require(_0x0355('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0355('0x12'))('api');var utils=require(_0x0355('0x13'));var config=require(_0x0355('0x14'));var licenseUtil=require(_0x0355('0x15'));var db=require(_0x0355('0x16'))['db'];function respondWithStatusCode(_0x4e4ea6,_0x571482){_0x571482=_0x571482||0xcc;return function(_0x5b3202){if(_0x5b3202){return _0x4e4ea6[_0x0355('0x17')](_0x571482);}return _0x4e4ea6[_0x0355('0x18')](_0x571482)['end']();};}function respondWithResult(_0x1c412f,_0xa7687e){_0xa7687e=_0xa7687e||0xc8;return function(_0x37d20f){if(_0x37d20f){return _0x1c412f[_0x0355('0x18')](_0xa7687e)[_0x0355('0x19')](_0x37d20f);}};}function respondWithFilteredResult(_0x39bff9,_0x594510){return function(_0x278925){if(_0x278925){var _0xee6d76=typeof _0x594510['offset']==='undefined'&&typeof _0x594510[_0x0355('0x1a')]===_0x0355('0x1b');var _0x37c608=_0x278925[_0x0355('0x1c')];var _0x28fb56=_0xee6d76?0x0:_0x594510['offset'];var _0x306670=_0xee6d76?_0x278925[_0x0355('0x1c')]:_0x594510[_0x0355('0x1d')]+_0x594510[_0x0355('0x1a')];var _0x89ac99;if(_0x306670>=_0x37c608){_0x306670=_0x37c608;_0x89ac99=0xc8;}else{_0x89ac99=0xce;}_0x39bff9['status'](_0x89ac99);return _0x39bff9[_0x0355('0x1e')](_0x0355('0x1f'),_0x28fb56+'-'+_0x306670+'/'+_0x37c608)['json'](_0x278925);}return null;};}function patchUpdates(_0x18061f){return function(_0x3c23a4){try{jsonpatch[_0x0355('0x20')](_0x3c23a4,_0x18061f,!![]);}catch(_0xae61bc){return BPromise['reject'](_0xae61bc);}return _0x3c23a4[_0x0355('0x21')]();};}function saveUpdates(_0x2136c9,_0x1e7108){return function(_0x296a1b){if(_0x296a1b){return _0x296a1b[_0x0355('0x22')](_0x2136c9)['then'](function(_0x530230){return _0x530230;});}return null;};}function removeEntity(_0x50c5aa,_0x31aa16){return function(_0x135ed4){if(_0x135ed4){return _0x135ed4[_0x0355('0x23')]()[_0x0355('0x24')](function(){_0x50c5aa[_0x0355('0x18')](0xcc)[_0x0355('0x25')]();});}};}function handleEntityNotFound(_0x54e36c,_0x167761){return function(_0xaf85ff){if(!_0xaf85ff){_0x54e36c[_0x0355('0x17')](0x194);}return _0xaf85ff;};}function handleError(_0x3c4e76,_0x216768){_0x216768=_0x216768||0x1f4;return function(_0x205532){logger[_0x0355('0x26')](_0x205532[_0x0355('0x27')]);if(_0x205532['name']){delete _0x205532['name'];}_0x3c4e76[_0x0355('0x18')](_0x216768)[_0x0355('0x28')](_0x205532);};}exports[_0x0355('0x29')]=function(_0x31a92b,_0x55eb32){var _0x30981e={},_0x21c24c={},_0x13e09d={'count':0x0,'rows':[]};var _0x57229c=_[_0x0355('0x2a')](db[_0x0355('0x2b')]['rawAttributes'],function(_0xde61a){return{'name':_0xde61a[_0x0355('0x2c')],'type':_0xde61a[_0x0355('0x2d')][_0x0355('0x2e')]};});_0x21c24c[_0x0355('0x2f')]=_[_0x0355('0x2a')](_0x57229c,_0x0355('0x30'));_0x21c24c[_0x0355('0x31')]=_['keys'](_0x31a92b['query']);_0x21c24c[_0x0355('0x32')]=_['intersection'](_0x21c24c[_0x0355('0x2f')],_0x21c24c[_0x0355('0x31')]);_0x30981e[_0x0355('0x33')]=_[_0x0355('0x34')](_0x21c24c[_0x0355('0x2f')],qs[_0x0355('0x35')](_0x31a92b[_0x0355('0x31')][_0x0355('0x35')]));_0x30981e[_0x0355('0x33')]=_0x30981e['attributes'][_0x0355('0x36')]?_0x30981e[_0x0355('0x33')]:_0x21c24c[_0x0355('0x2f')];if(!_0x31a92b[_0x0355('0x31')][_0x0355('0x37')](_0x0355('0x38'))){_0x30981e[_0x0355('0x1a')]=qs[_0x0355('0x1a')](_0x31a92b[_0x0355('0x31')][_0x0355('0x1a')]);_0x30981e[_0x0355('0x1d')]=qs[_0x0355('0x1d')](_0x31a92b[_0x0355('0x31')]['offset']);}_0x30981e['order']=qs[_0x0355('0x39')](_0x31a92b[_0x0355('0x31')]['sort']);_0x30981e['where']=qs[_0x0355('0x32')](_[_0x0355('0x3a')](_0x31a92b[_0x0355('0x31')],_0x21c24c['filters']),_0x57229c);if(_0x31a92b[_0x0355('0x31')]['filter']){_0x30981e[_0x0355('0x3b')]=_['merge'](_0x30981e[_0x0355('0x3b')],{'$or':_['map'](_0x57229c,function(_0x94ef28){if(_0x94ef28[_0x0355('0x2d')]!==_0x0355('0x3c')){var _0x17716c={};_0x17716c[_0x94ef28[_0x0355('0x30')]]={'$like':'%'+_0x31a92b[_0x0355('0x31')]['filter']+'%'};return _0x17716c;}})});}_0x30981e=_['merge']({},_0x30981e,_0x31a92b['options']);var _0x3b062b={'where':_0x30981e[_0x0355('0x3b')]};return db[_0x0355('0x2b')][_0x0355('0x1c')](_0x3b062b)[_0x0355('0x24')](function(_0x413203){_0x13e09d['count']=_0x413203;if(_0x31a92b['query']['includeAll']){_0x30981e[_0x0355('0x3d')]=[{'all':!![]}];}return db[_0x0355('0x2b')][_0x0355('0x3e')](_0x30981e);})[_0x0355('0x24')](function(_0x31a507){_0x13e09d['rows']=_0x31a507;return _0x13e09d;})[_0x0355('0x24')](respondWithFilteredResult(_0x55eb32,_0x30981e))['catch'](handleError(_0x55eb32,null));};exports[_0x0355('0x3f')]=function(_0x2520fa,_0x34e19d){var _0x433d7e={'raw':!![],'where':{'id':_0x2520fa['params']['id']}},_0x1ad13c={};_0x1ad13c[_0x0355('0x2f')]=_[_0x0355('0x40')](db['MailServerOut']['rawAttributes']);_0x1ad13c[_0x0355('0x31')]=_[_0x0355('0x40')](_0x2520fa[_0x0355('0x31')]);_0x1ad13c[_0x0355('0x32')]=_['intersection'](_0x1ad13c[_0x0355('0x2f')],_0x1ad13c[_0x0355('0x31')]);_0x433d7e[_0x0355('0x33')]=_['intersection'](_0x1ad13c[_0x0355('0x2f')],qs[_0x0355('0x35')](_0x2520fa[_0x0355('0x31')][_0x0355('0x35')]));_0x433d7e[_0x0355('0x33')]=_0x433d7e[_0x0355('0x33')][_0x0355('0x36')]?_0x433d7e[_0x0355('0x33')]:_0x1ad13c['model'];if(_0x2520fa[_0x0355('0x31')][_0x0355('0x41')]){_0x433d7e['include']=[{'all':!![]}];}_0x433d7e=_['merge']({},_0x433d7e,_0x2520fa['options']);return db['MailServerOut']['find'](_0x433d7e)[_0x0355('0x24')](handleEntityNotFound(_0x34e19d,null))['then'](respondWithResult(_0x34e19d,null))[_0x0355('0x42')](handleError(_0x34e19d,null));};exports[_0x0355('0x43')]=function(_0xbbb85f,_0x92e651){return db[_0x0355('0x2b')][_0x0355('0x43')](_0xbbb85f['body'],{})['then'](respondWithResult(_0x92e651,0xc9))[_0x0355('0x42')](handleError(_0x92e651,null));};exports[_0x0355('0x22')]=function(_0x41c02f,_0x333f35){if(_0x41c02f[_0x0355('0x44')]['id']){delete _0x41c02f['body']['id'];}return db['MailServerOut'][_0x0355('0x45')]({'where':{'id':_0x41c02f['params']['id']}})['then'](handleEntityNotFound(_0x333f35,null))['then'](saveUpdates(_0x41c02f['body'],null))[_0x0355('0x24')](respondWithResult(_0x333f35,null))[_0x0355('0x42')](handleError(_0x333f35,null));};exports['destroy']=function(_0x243d28,_0x3632ed){return db[_0x0355('0x2b')][_0x0355('0x45')]({'where':{'id':_0x243d28[_0x0355('0x46')]['id']}})[_0x0355('0x24')](handleEntityNotFound(_0x3632ed,null))[_0x0355('0x24')](removeEntity(_0x3632ed,null))[_0x0355('0x42')](handleError(_0x3632ed,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index b260e8d..3607840 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 _0x2e23=['exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x217e77,_0x18f3e7){var _0x56e777=function(_0x37a05c){while(--_0x37a05c){_0x217e77['push'](_0x217e77['shift']());}};_0x56e777(++_0x18f3e7);}(_0x2e23,0xc7));var _0x32e2=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x2e23[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x32e2('0x0'));var util=require(_0x32e2('0x1'));var logger=require(_0x32e2('0x2'))(_0x32e2('0x3'));var moment=require(_0x32e2('0x4'));var BPromise=require(_0x32e2('0x5'));var rp=require(_0x32e2('0x6'));var fs=require('fs');var path=require(_0x32e2('0x7'));var rimraf=require(_0x32e2('0x8'));var config=require(_0x32e2('0x9'));var attributes=require(_0x32e2('0xa'));module[_0x32e2('0xb')]=function(_0x1d2826,_0x10b183){return _0x1d2826[_0x32e2('0xc')]('MailServerOut',attributes,{'tableName':_0x32e2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x139b=['./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x139b,0x1c6));var _0xb139=function(_0x6b686d,_0x13bf06){_0x6b686d=_0x6b686d-0x0;var _0x44ab8e=_0x139b[_0x6b686d];return _0x44ab8e;};'use strict';var _=require(_0xb139('0x0'));var util=require(_0xb139('0x1'));var logger=require(_0xb139('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb139('0x3'));var rp=require(_0xb139('0x4'));var fs=require('fs');var path=require(_0xb139('0x5'));var rimraf=require(_0xb139('0x6'));var config=require(_0xb139('0x7'));var attributes=require(_0xb139('0x8'));module[_0xb139('0x9')]=function(_0x5ab4c4,_0x307f7e){return _0x5ab4c4['define'](_0xb139('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 2eace8c..e7383f9 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(_0x42c958,_0x377024){var _0x322a53=function(_0x23b3bc){while(--_0x23b3bc){_0x42c958['push'](_0x42c958['shift']());}};_0x322a53(++_0x377024);}(_0x2ef3,0xba));var _0x32ef=function(_0x439d04,_0x2e9e69){_0x439d04=_0x439d04-0x0;var _0x3a7a0f=_0x2ef3[_0x439d04];return _0x3a7a0f;};'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 _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(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x2ef3,0xba));var _0x32ef=function(_0xd0086e,_0x22b47d){_0xd0086e=_0xd0086e-0x0;var _0x2dcf06=_0x2ef3[_0xd0086e];return _0x2dcf06;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f9b7a06..44f6886 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 _0x57af=['put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x37f364,_0x56f6ae){var _0x1a97dd=function(_0x4f4161){while(--_0x4f4161){_0x37f364['push'](_0x37f364['shift']());}};_0x1a97dd(++_0x56f6ae);}(_0x57af,0x109));var _0xf57a=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x57af[_0x2a6809];return _0x11c371;};'use strict';var multer=require('multer');var util=require(_0xf57a('0x0'));var path=require(_0xf57a('0x1'));var timeout=require(_0xf57a('0x2'));var express=require(_0xf57a('0x3'));var router=express[_0xf57a('0x4')]();var fs_extra=require(_0xf57a('0x5'));var auth=require(_0xf57a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf57a('0x7'));var controller=require(_0xf57a('0x8'));router[_0xf57a('0x9')]('/',auth[_0xf57a('0xa')](),controller[_0xf57a('0xb')]);router[_0xf57a('0x9')](_0xf57a('0xc'),auth[_0xf57a('0xa')](),controller['describe']);router[_0xf57a('0x9')]('/:id',auth[_0xf57a('0xa')](),controller[_0xf57a('0xd')]);router[_0xf57a('0xe')]('/',auth[_0xf57a('0xa')](),controller['create']);router[_0xf57a('0xf')]('/:id',auth[_0xf57a('0xa')](),controller[_0xf57a('0x10')]);router[_0xf57a('0x11')](_0xf57a('0x12'),auth['isAuthenticated'](),controller[_0xf57a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x245c=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ea8f6,_0x23b546){var _0x54c517=function(_0x211f97){while(--_0x211f97){_0x2ea8f6['push'](_0x2ea8f6['shift']());}};_0x54c517(++_0x23b546);}(_0x245c,0xa9));var _0xc245=function(_0x2097ea,_0x502d35){_0x2097ea=_0x2097ea-0x0;var _0x229136=_0x245c[_0x2097ea];return _0x229136;};'use strict';var multer=require('multer');var util=require(_0xc245('0x0'));var path=require(_0xc245('0x1'));var timeout=require(_0xc245('0x2'));var express=require(_0xc245('0x3'));var router=express[_0xc245('0x4')]();var fs_extra=require(_0xc245('0x5'));var auth=require(_0xc245('0x6'));var interaction=require(_0xc245('0x7'));var config=require(_0xc245('0x8'));var controller=require(_0xc245('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc245('0xa')](_0xc245('0xb'),auth['isAuthenticated'](),controller[_0xc245('0xc')]);router[_0xc245('0xa')](_0xc245('0xd'),auth[_0xc245('0xe')](),controller[_0xc245('0xf')]);router[_0xc245('0x10')]('/',auth['isAuthenticated'](),controller[_0xc245('0x11')]);router[_0xc245('0x12')](_0xc245('0xd'),auth['isAuthenticated'](),controller[_0xc245('0x13')]);router[_0xc245('0x14')](_0xc245('0xd'),auth[_0xc245('0xe')](),controller['destroy']);module[_0xc245('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2aaf83a..3c302ac 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 _0x6b8f=['exports','name'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x337935,_0x5ad088){_0x337935=_0x337935-0x0;var _0x3e12ad=_0x6b8f[_0x337935];return _0x3e12ad;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x31f0=['STRING','sequelize'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x31f0,0xb7));var _0x031f=function(_0xfff454,_0x1cf303){_0xfff454=_0xfff454-0x0;var _0x2d994d=_0x31f0[_0xfff454];return _0x2d994d;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x031f('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index f1ba146..31e99f0 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 _0xcc2b=['count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x583259,_0x83a562){var _0x596d81=function(_0x3e60f4){while(--_0x3e60f4){_0x583259['push'](_0x583259['shift']());}};_0x596d81(++_0x83a562);}(_0xcc2b,0xc0));var _0xbcc2=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xcc2b[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require(_0xbcc2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcc2('0x1'));var jsonpatch=require(_0xbcc2('0x2'));var rp=require('request-promise');var moment=require(_0xbcc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbcc2('0x4'));var util=require(_0xbcc2('0x5'));var path=require(_0xbcc2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbcc2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbcc2('0x8'));var crypto=require('crypto');var jsforce=require(_0xbcc2('0x9'));var deskjs=require(_0xbcc2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbcc2('0xb'));var Papa=require(_0xbcc2('0xc'));var Redis=require(_0xbcc2('0xd'));var authService=require(_0xbcc2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbcc2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcc2('0x10'))('api');var utils=require(_0xbcc2('0x11'));var config=require(_0xbcc2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcc2('0x13'))['db'];function respondWithStatusCode(_0x24abd5,_0x1f10e1){_0x1f10e1=_0x1f10e1||0xcc;return function(_0x4dd862){if(_0x4dd862){return _0x24abd5[_0xbcc2('0x14')](_0x1f10e1);}return _0x24abd5[_0xbcc2('0x15')](_0x1f10e1)[_0xbcc2('0x16')]();};}function respondWithResult(_0x2c25b3,_0x2ccf37){_0x2ccf37=_0x2ccf37||0xc8;return function(_0x202a7c){if(_0x202a7c){return _0x2c25b3[_0xbcc2('0x15')](_0x2ccf37)[_0xbcc2('0x17')](_0x202a7c);}};}function respondWithFilteredResult(_0x1e850e,_0x4ee399){return function(_0x32aac5){if(_0x32aac5){var _0x33ebad=typeof _0x4ee399[_0xbcc2('0x18')]==='undefined'&&typeof _0x4ee399[_0xbcc2('0x19')]===_0xbcc2('0x1a');var _0x5b356a=_0x32aac5[_0xbcc2('0x1b')];var _0x51b5a4=_0x33ebad?0x0:_0x4ee399['offset'];var _0x3292ad=_0x33ebad?_0x32aac5[_0xbcc2('0x1b')]:_0x4ee399['offset']+_0x4ee399[_0xbcc2('0x19')];var _0x511ca3;if(_0x3292ad>=_0x5b356a){_0x3292ad=_0x5b356a;_0x511ca3=0xc8;}else{_0x511ca3=0xce;}_0x1e850e[_0xbcc2('0x15')](_0x511ca3);return _0x1e850e[_0xbcc2('0x1c')](_0xbcc2('0x1d'),_0x51b5a4+'-'+_0x3292ad+'/'+_0x5b356a)[_0xbcc2('0x17')](_0x32aac5);}return null;};}function patchUpdates(_0x41a8a0){return function(_0x1e2167){try{jsonpatch[_0xbcc2('0x1e')](_0x1e2167,_0x41a8a0,!![]);}catch(_0x48b0f8){return BPromise['reject'](_0x48b0f8);}return _0x1e2167[_0xbcc2('0x1f')]();};}function saveUpdates(_0x32fd12,_0x3cc89f){return function(_0x3867b4){if(_0x3867b4){return _0x3867b4[_0xbcc2('0x20')](_0x32fd12)[_0xbcc2('0x21')](function(_0x1ba84e){return _0x1ba84e;});}return null;};}function removeEntity(_0x1f884c,_0x16cb72){return function(_0x2c6167){if(_0x2c6167){return _0x2c6167[_0xbcc2('0x22')]()[_0xbcc2('0x21')](function(){_0x1f884c['status'](0xcc)[_0xbcc2('0x16')]();});}};}function handleEntityNotFound(_0x475985,_0x501b16){return function(_0x12c3a6){if(!_0x12c3a6){_0x475985[_0xbcc2('0x14')](0x194);}return _0x12c3a6;};}function handleError(_0x267bc0,_0x4ba7be){_0x4ba7be=_0x4ba7be||0x1f4;return function(_0x430563){logger[_0xbcc2('0x23')](_0x430563[_0xbcc2('0x24')]);if(_0x430563[_0xbcc2('0x25')]){delete _0x430563[_0xbcc2('0x25')];}_0x267bc0['status'](_0x4ba7be)[_0xbcc2('0x26')](_0x430563);};}exports[_0xbcc2('0x27')]=function(_0x764ae1,_0x3b33ef){var _0x1240fc={},_0x263fb0={},_0x4630ba={'count':0x0,'rows':[]};var _0x25c7e8=_[_0xbcc2('0x28')](db[_0xbcc2('0x29')][_0xbcc2('0x2a')],function(_0x15cbe2){return{'name':_0x15cbe2['fieldName'],'type':_0x15cbe2[_0xbcc2('0x2b')][_0xbcc2('0x2c')]};});_0x263fb0[_0xbcc2('0x2d')]=_[_0xbcc2('0x28')](_0x25c7e8,'name');_0x263fb0[_0xbcc2('0x2e')]=_[_0xbcc2('0x2f')](_0x764ae1[_0xbcc2('0x2e')]);_0x263fb0[_0xbcc2('0x30')]=_[_0xbcc2('0x31')](_0x263fb0['model'],_0x263fb0[_0xbcc2('0x2e')]);_0x1240fc[_0xbcc2('0x32')]=_['intersection'](_0x263fb0[_0xbcc2('0x2d')],qs[_0xbcc2('0x33')](_0x764ae1[_0xbcc2('0x2e')][_0xbcc2('0x33')]));_0x1240fc[_0xbcc2('0x32')]=_0x1240fc[_0xbcc2('0x32')][_0xbcc2('0x34')]?_0x1240fc[_0xbcc2('0x32')]:_0x263fb0['model'];if(!_0x764ae1['query'][_0xbcc2('0x35')](_0xbcc2('0x36'))){_0x1240fc[_0xbcc2('0x19')]=qs[_0xbcc2('0x19')](_0x764ae1[_0xbcc2('0x2e')]['limit']);_0x1240fc[_0xbcc2('0x18')]=qs[_0xbcc2('0x18')](_0x764ae1['query'][_0xbcc2('0x18')]);}_0x1240fc[_0xbcc2('0x37')]=qs[_0xbcc2('0x38')](_0x764ae1['query'][_0xbcc2('0x38')]);_0x1240fc[_0xbcc2('0x39')]=qs['filters'](_[_0xbcc2('0x3a')](_0x764ae1[_0xbcc2('0x2e')],_0x263fb0[_0xbcc2('0x30')]),_0x25c7e8);if(_0x764ae1[_0xbcc2('0x2e')][_0xbcc2('0x3b')]){_0x1240fc[_0xbcc2('0x39')]=_[_0xbcc2('0x3c')](_0x1240fc['where'],{'$or':_[_0xbcc2('0x28')](_0x25c7e8,function(_0xf9bdc){if(_0xf9bdc[_0xbcc2('0x2b')]!==_0xbcc2('0x3d')){var _0x277b9f={};_0x277b9f[_0xf9bdc[_0xbcc2('0x25')]]={'$like':'%'+_0x764ae1[_0xbcc2('0x2e')][_0xbcc2('0x3b')]+'%'};return _0x277b9f;}})});}_0x1240fc=_[_0xbcc2('0x3c')]({},_0x1240fc,_0x764ae1[_0xbcc2('0x3e')]);var _0x22d9cd={'where':_0x1240fc[_0xbcc2('0x39')]};return db[_0xbcc2('0x29')][_0xbcc2('0x1b')](_0x22d9cd)['then'](function(_0x7ab19){_0x4630ba['count']=_0x7ab19;if(_0x764ae1[_0xbcc2('0x2e')][_0xbcc2('0x3f')]){_0x1240fc[_0xbcc2('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbcc2('0x41')](_0x1240fc);})['then'](function(_0x13eb40){_0x4630ba[_0xbcc2('0x42')]=_0x13eb40;return _0x4630ba;})[_0xbcc2('0x21')](respondWithFilteredResult(_0x3b33ef,_0x1240fc))[_0xbcc2('0x43')](handleError(_0x3b33ef,null));};exports['show']=function(_0x10730a,_0x6ac97e){var _0x26c6d4={'raw':!![],'where':{'id':_0x10730a['params']['id']}},_0xde3dfc={};_0xde3dfc[_0xbcc2('0x2d')]=_['keys'](db[_0xbcc2('0x29')][_0xbcc2('0x2a')]);_0xde3dfc['query']=_[_0xbcc2('0x2f')](_0x10730a[_0xbcc2('0x2e')]);_0xde3dfc['filters']=_[_0xbcc2('0x31')](_0xde3dfc['model'],_0xde3dfc[_0xbcc2('0x2e')]);_0x26c6d4[_0xbcc2('0x32')]=_[_0xbcc2('0x31')](_0xde3dfc[_0xbcc2('0x2d')],qs['fields'](_0x10730a['query'][_0xbcc2('0x33')]));_0x26c6d4[_0xbcc2('0x32')]=_0x26c6d4[_0xbcc2('0x32')]['length']?_0x26c6d4[_0xbcc2('0x32')]:_0xde3dfc[_0xbcc2('0x2d')];if(_0x10730a[_0xbcc2('0x2e')][_0xbcc2('0x3f')]){_0x26c6d4['include']=[{'all':!![]}];}_0x26c6d4=_[_0xbcc2('0x3c')]({},_0x26c6d4,_0x10730a[_0xbcc2('0x3e')]);return db['MailSubstatus'][_0xbcc2('0x44')](_0x26c6d4)[_0xbcc2('0x21')](handleEntityNotFound(_0x6ac97e,null))['then'](respondWithResult(_0x6ac97e,null))['catch'](handleError(_0x6ac97e,null));};exports[_0xbcc2('0x45')]=function(_0x47e734,_0x2edcea){return db['MailSubstatus'][_0xbcc2('0x45')](_0x47e734['body'],{})[_0xbcc2('0x21')](respondWithResult(_0x2edcea,0xc9))['catch'](handleError(_0x2edcea,null));};exports['update']=function(_0x13ca64,_0x162ba9){if(_0x13ca64[_0xbcc2('0x46')]['id']){delete _0x13ca64['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x13ca64[_0xbcc2('0x47')]['id']}})[_0xbcc2('0x21')](handleEntityNotFound(_0x162ba9,null))['then'](saveUpdates(_0x13ca64[_0xbcc2('0x46')],null))[_0xbcc2('0x21')](respondWithResult(_0x162ba9,null))[_0xbcc2('0x43')](handleError(_0x162ba9,null));};exports[_0xbcc2('0x22')]=function(_0xccb0e5,_0x157a41){return db[_0xbcc2('0x29')][_0xbcc2('0x44')]({'where':{'id':_0xccb0e5[_0xbcc2('0x47')]['id']}})[_0xbcc2('0x21')](handleEntityNotFound(_0x157a41,null))['then'](removeEntity(_0x157a41,null))[_0xbcc2('0x43')](handleError(_0x157a41,null));};exports[_0xbcc2('0x48')]=function(_0x176c91,_0x176014){return db['MailSubstatus'][_0xbcc2('0x48')]()[_0xbcc2('0x21')](respondWithResult(_0x176014,null))[_0xbcc2('0x43')](handleError(_0x176014,null));}; \ No newline at end of file +var _0xd374=['pick','filter','where','merge','MailSubstatus','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd374,0x189));var _0x4d37=function(_0xce75,_0x1a0484){_0xce75=_0xce75-0x0;var _0x8e22bb=_0xd374[_0xce75];return _0x8e22bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d37('0x0'));var zipdir=require(_0x4d37('0x1'));var jsonpatch=require(_0x4d37('0x2'));var rp=require(_0x4d37('0x3'));var moment=require(_0x4d37('0x4'));var BPromise=require(_0x4d37('0x5'));var Mustache=require(_0x4d37('0x6'));var util=require(_0x4d37('0x7'));var path=require('path');var sox=require(_0x4d37('0x8'));var csv=require(_0x4d37('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d37('0xa'));var _=require(_0x4d37('0xb'));var squel=require(_0x4d37('0xc'));var crypto=require(_0x4d37('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d37('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d37('0xe'));var authService=require(_0x4d37('0xf'));var qs=require(_0x4d37('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d37('0x11'))(_0x4d37('0x12'));var utils=require(_0x4d37('0x13'));var config=require(_0x4d37('0x14'));var licenseUtil=require(_0x4d37('0x15'));var db=require(_0x4d37('0x16'))['db'];function respondWithStatusCode(_0x421710,_0x43da4a){_0x43da4a=_0x43da4a||0xcc;return function(_0x396d4c){if(_0x396d4c){return _0x421710[_0x4d37('0x17')](_0x43da4a);}return _0x421710[_0x4d37('0x18')](_0x43da4a)[_0x4d37('0x19')]();};}function respondWithResult(_0x35cc41,_0x4a6d2e){_0x4a6d2e=_0x4a6d2e||0xc8;return function(_0xca6224){if(_0xca6224){return _0x35cc41['status'](_0x4a6d2e)['json'](_0xca6224);}};}function respondWithFilteredResult(_0x38d1b1,_0x104eb1){return function(_0x2fbdff){if(_0x2fbdff){var _0x408893=typeof _0x104eb1[_0x4d37('0x1a')]===_0x4d37('0x1b')&&typeof _0x104eb1['limit']==='undefined';var _0x4e445c=_0x2fbdff[_0x4d37('0x1c')];var _0x1b60b9=_0x408893?0x0:_0x104eb1[_0x4d37('0x1a')];var _0x385c7a=_0x408893?_0x2fbdff['count']:_0x104eb1[_0x4d37('0x1a')]+_0x104eb1[_0x4d37('0x1d')];var _0x23e022;if(_0x385c7a>=_0x4e445c){_0x385c7a=_0x4e445c;_0x23e022=0xc8;}else{_0x23e022=0xce;}_0x38d1b1[_0x4d37('0x18')](_0x23e022);return _0x38d1b1[_0x4d37('0x1e')](_0x4d37('0x1f'),_0x1b60b9+'-'+_0x385c7a+'/'+_0x4e445c)[_0x4d37('0x20')](_0x2fbdff);}return null;};}function patchUpdates(_0x497bde){return function(_0x4eada3){try{jsonpatch[_0x4d37('0x21')](_0x4eada3,_0x497bde,!![]);}catch(_0x1e2325){return BPromise[_0x4d37('0x22')](_0x1e2325);}return _0x4eada3['save']();};}function saveUpdates(_0x2aa74a,_0x1b4422){return function(_0x302809){if(_0x302809){return _0x302809[_0x4d37('0x23')](_0x2aa74a)[_0x4d37('0x24')](function(_0x12beb3){return _0x12beb3;});}return null;};}function removeEntity(_0x12c543,_0x522cea){return function(_0x5db18d){if(_0x5db18d){return _0x5db18d['destroy']()[_0x4d37('0x24')](function(){_0x12c543['status'](0xcc)[_0x4d37('0x19')]();});}};}function handleEntityNotFound(_0x148efa,_0x8427af){return function(_0x2812e9){if(!_0x2812e9){_0x148efa[_0x4d37('0x17')](0x194);}return _0x2812e9;};}function handleError(_0xf42763,_0x48f937){_0x48f937=_0x48f937||0x1f4;return function(_0x25eeef){logger[_0x4d37('0x25')](_0x25eeef[_0x4d37('0x26')]);if(_0x25eeef[_0x4d37('0x27')]){delete _0x25eeef['name'];}_0xf42763[_0x4d37('0x18')](_0x48f937)[_0x4d37('0x28')](_0x25eeef);};}exports['index']=function(_0xa81317,_0x585aab){var _0x5cde5={},_0x15772e={},_0xfe75cc={'count':0x0,'rows':[]};var _0x527069=_[_0x4d37('0x29')](db['MailSubstatus'][_0x4d37('0x2a')],function(_0x2267c7){return{'name':_0x2267c7[_0x4d37('0x2b')],'type':_0x2267c7[_0x4d37('0x2c')][_0x4d37('0x2d')]};});_0x15772e[_0x4d37('0x2e')]=_['map'](_0x527069,_0x4d37('0x27'));_0x15772e['query']=_['keys'](_0xa81317[_0x4d37('0x2f')]);_0x15772e['filters']=_[_0x4d37('0x30')](_0x15772e[_0x4d37('0x2e')],_0x15772e[_0x4d37('0x2f')]);_0x5cde5[_0x4d37('0x31')]=_['intersection'](_0x15772e[_0x4d37('0x2e')],qs[_0x4d37('0x32')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x32')]));_0x5cde5[_0x4d37('0x31')]=_0x5cde5[_0x4d37('0x31')][_0x4d37('0x33')]?_0x5cde5[_0x4d37('0x31')]:_0x15772e['model'];if(!_0xa81317['query'][_0x4d37('0x34')](_0x4d37('0x35'))){_0x5cde5[_0x4d37('0x1d')]=qs[_0x4d37('0x1d')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x1d')]);_0x5cde5[_0x4d37('0x1a')]=qs[_0x4d37('0x1a')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x1a')]);}_0x5cde5[_0x4d37('0x36')]=qs[_0x4d37('0x37')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x37')]);_0x5cde5['where']=qs[_0x4d37('0x38')](_[_0x4d37('0x39')](_0xa81317[_0x4d37('0x2f')],_0x15772e[_0x4d37('0x38')]),_0x527069);if(_0xa81317[_0x4d37('0x2f')][_0x4d37('0x3a')]){_0x5cde5[_0x4d37('0x3b')]=_[_0x4d37('0x3c')](_0x5cde5[_0x4d37('0x3b')],{'$or':_[_0x4d37('0x29')](_0x527069,function(_0x4a9fdd){if(_0x4a9fdd['type']!=='VIRTUAL'){var _0x23dfd6={};_0x23dfd6[_0x4a9fdd[_0x4d37('0x27')]]={'$like':'%'+_0xa81317[_0x4d37('0x2f')]['filter']+'%'};return _0x23dfd6;}})});}_0x5cde5=_[_0x4d37('0x3c')]({},_0x5cde5,_0xa81317['options']);var _0x139905={'where':_0x5cde5[_0x4d37('0x3b')]};return db[_0x4d37('0x3d')]['count'](_0x139905)['then'](function(_0x54120e){_0xfe75cc[_0x4d37('0x1c')]=_0x54120e;if(_0xa81317[_0x4d37('0x2f')][_0x4d37('0x3e')]){_0x5cde5[_0x4d37('0x3f')]=[{'all':!![]}];}return db[_0x4d37('0x3d')][_0x4d37('0x40')](_0x5cde5);})['then'](function(_0x219eae){_0xfe75cc['rows']=_0x219eae;return _0xfe75cc;})['then'](respondWithFilteredResult(_0x585aab,_0x5cde5))[_0x4d37('0x41')](handleError(_0x585aab,null));};exports[_0x4d37('0x42')]=function(_0x3f080f,_0x4ba9d1){var _0x4343ca={'raw':!![],'where':{'id':_0x3f080f[_0x4d37('0x43')]['id']}},_0x57e10e={};_0x57e10e[_0x4d37('0x2e')]=_[_0x4d37('0x44')](db[_0x4d37('0x3d')][_0x4d37('0x2a')]);_0x57e10e[_0x4d37('0x2f')]=_[_0x4d37('0x44')](_0x3f080f[_0x4d37('0x2f')]);_0x57e10e[_0x4d37('0x38')]=_[_0x4d37('0x30')](_0x57e10e['model'],_0x57e10e[_0x4d37('0x2f')]);_0x4343ca[_0x4d37('0x31')]=_['intersection'](_0x57e10e['model'],qs[_0x4d37('0x32')](_0x3f080f[_0x4d37('0x2f')][_0x4d37('0x32')]));_0x4343ca[_0x4d37('0x31')]=_0x4343ca[_0x4d37('0x31')][_0x4d37('0x33')]?_0x4343ca[_0x4d37('0x31')]:_0x57e10e[_0x4d37('0x2e')];if(_0x3f080f[_0x4d37('0x2f')][_0x4d37('0x3e')]){_0x4343ca[_0x4d37('0x3f')]=[{'all':!![]}];}_0x4343ca=_[_0x4d37('0x3c')]({},_0x4343ca,_0x3f080f[_0x4d37('0x45')]);return db['MailSubstatus']['find'](_0x4343ca)[_0x4d37('0x24')](handleEntityNotFound(_0x4ba9d1,null))[_0x4d37('0x24')](respondWithResult(_0x4ba9d1,null))[_0x4d37('0x41')](handleError(_0x4ba9d1,null));};exports['create']=function(_0x45dfcc,_0x11b504){return db['MailSubstatus'][_0x4d37('0x46')](_0x45dfcc[_0x4d37('0x47')],{})[_0x4d37('0x24')](respondWithResult(_0x11b504,0xc9))['catch'](handleError(_0x11b504,null));};exports['update']=function(_0x24ecf9,_0x3e218e){if(_0x24ecf9[_0x4d37('0x47')]['id']){delete _0x24ecf9['body']['id'];}return db[_0x4d37('0x3d')][_0x4d37('0x48')]({'where':{'id':_0x24ecf9[_0x4d37('0x43')]['id']}})[_0x4d37('0x24')](handleEntityNotFound(_0x3e218e,null))[_0x4d37('0x24')](saveUpdates(_0x24ecf9[_0x4d37('0x47')],null))[_0x4d37('0x24')](respondWithResult(_0x3e218e,null))[_0x4d37('0x41')](handleError(_0x3e218e,null));};exports[_0x4d37('0x49')]=function(_0x400bf5,_0x111086){return db[_0x4d37('0x3d')][_0x4d37('0x48')]({'where':{'id':_0x400bf5[_0x4d37('0x43')]['id']}})[_0x4d37('0x24')](handleEntityNotFound(_0x111086,null))[_0x4d37('0x24')](removeEntity(_0x111086,null))['catch'](handleError(_0x111086,null));};exports['describe']=function(_0x3d29b7,_0x3d7dd2){return db[_0x4d37('0x3d')][_0x4d37('0x4a')]()['then'](respondWithResult(_0x3d7dd2,null))[_0x4d37('0x41')](handleError(_0x3d7dd2,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d5d4fef..6805608 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 _0x2bad=['exports','MailSubstatus','mail_substatuses','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailSubstatus.attributes'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x2bad,0xcf));var _0xd2ba=function(_0x27b0c4,_0xaf6d02){_0x27b0c4=_0x27b0c4-0x0;var _0xcb87b2=_0x2bad[_0x27b0c4];return _0xcb87b2;};'use strict';var _=require(_0xd2ba('0x0'));var util=require('util');var logger=require(_0xd2ba('0x1'))(_0xd2ba('0x2'));var moment=require(_0xd2ba('0x3'));var BPromise=require(_0xd2ba('0x4'));var rp=require(_0xd2ba('0x5'));var fs=require('fs');var path=require(_0xd2ba('0x6'));var rimraf=require('rimraf');var config=require(_0xd2ba('0x7'));var attributes=require(_0xd2ba('0x8'));module[_0xd2ba('0x9')]=function(_0x4a5e98,_0x155b9d){return _0x4a5e98['define'](_0xd2ba('0xa'),attributes,{'tableName':_0xd2ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfef=['../../config/logger','api','bluebird','request-promise','path','exports','lodash','util'];(function(_0x46cb09,_0x184159){var _0x234867=function(_0x27364a){while(--_0x27364a){_0x46cb09['push'](_0x46cb09['shift']());}};_0x234867(++_0x184159);}(_0xcfef,0x86));var _0xfcfe=function(_0x2fdf18,_0x61958c){_0x2fdf18=_0x2fdf18-0x0;var _0x207782=_0xcfef[_0x2fdf18];return _0x207782;};'use strict';var _=require(_0xfcfe('0x0'));var util=require(_0xfcfe('0x1'));var logger=require(_0xfcfe('0x2'))(_0xfcfe('0x3'));var moment=require('moment');var BPromise=require(_0xfcfe('0x4'));var rp=require(_0xfcfe('0x5'));var fs=require('fs');var path=require(_0xfcfe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xfcfe('0x7')]=function(_0x1568a3,_0x502f6){return _0x1568a3['define']('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 92e8ab0..361516b 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 _0x4d4b=['rpc','../../config/environment','client','http','request','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4d4b,0x1a8));var _0xb4d4=function(_0x5e6be1,_0x352fe4){_0x5e6be1=_0x5e6be1-0x0;var _0x4c97fe=_0x4d4b[_0x5e6be1];return _0x4c97fe;};'use strict';var _=require(_0xb4d4('0x0'));var util=require(_0xb4d4('0x1'));var moment=require(_0xb4d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4d4('0x3'));var fs=require('fs');var Redis=require(_0xb4d4('0x4'));var db=require(_0xb4d4('0x5'))['db'];var utils=require(_0xb4d4('0x6'));var logger=require(_0xb4d4('0x7'))(_0xb4d4('0x8'));var config=require(_0xb4d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4d4('0xa')][_0xb4d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cf3d0,_0x2a8bb4,_0x4cbd84){return new BPromise(function(_0x2ca077,_0x2d5876){return client[_0xb4d4('0xc')](_0x4cf3d0,_0x4cbd84)['then'](function(_0x366252){logger['info'](_0xb4d4('0xd'),_0x2a8bb4,'request\x20sent');logger[_0xb4d4('0xe')](_0xb4d4('0xf'),_0x2a8bb4,_0xb4d4('0x10'),JSON[_0xb4d4('0x11')](_0x366252));if(_0x366252[_0xb4d4('0x12')]){if(_0x366252['error'][_0xb4d4('0x13')]===0x1f4){logger['error'](_0xb4d4('0xd'),_0x2a8bb4,_0x366252['error'][_0xb4d4('0x14')]);return _0x2d5876(_0x366252['error']['message']);}logger[_0xb4d4('0x12')](_0xb4d4('0xd'),_0x2a8bb4,_0x366252[_0xb4d4('0x12')][_0xb4d4('0x14')]);return _0x2ca077(_0x366252[_0xb4d4('0x12')]['message']);}else{logger[_0xb4d4('0x15')](_0xb4d4('0xd'),_0x2a8bb4,_0xb4d4('0x10'));_0x2ca077(_0x366252[_0xb4d4('0x16')][_0xb4d4('0x14')]);}})[_0xb4d4('0x17')](function(_0xfe5f55){logger[_0xb4d4('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2a8bb4,_0xfe5f55);_0x2d5876(_0xfe5f55);});});} \ No newline at end of file +var _0xfa9e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfa9e,0xad));var _0xefa9=function(_0xa6ef1a,_0x3cdf3e){_0xa6ef1a=_0xa6ef1a-0x0;var _0x3448ad=_0xfa9e[_0xa6ef1a];return _0x3448ad;};'use strict';var _=require(_0xefa9('0x0'));var util=require('util');var moment=require(_0xefa9('0x1'));var BPromise=require('bluebird');var rs=require(_0xefa9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xefa9('0x3'));var logger=require(_0xefa9('0x4'))(_0xefa9('0x5'));var config=require(_0xefa9('0x6'));var jayson=require(_0xefa9('0x7'));var client=jayson[_0xefa9('0x8')][_0xefa9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae770c,_0x4e941e,_0x3b555a){return new BPromise(function(_0x5a5583,_0x59b36e){return client[_0xefa9('0xa')](_0xae770c,_0x3b555a)[_0xefa9('0xb')](function(_0x9b9586){logger[_0xefa9('0xc')](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));logger[_0xefa9('0xf')](_0xefa9('0x10'),_0x4e941e,_0xefa9('0xe'),JSON[_0xefa9('0x11')](_0x9b9586));if(_0x9b9586[_0xefa9('0x12')]){if(_0x9b9586[_0xefa9('0x12')][_0xefa9('0x13')]===0x1f4){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')][_0xefa9('0x14')]);return _0x59b36e(_0x9b9586['error'][_0xefa9('0x14')]);}logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')]['message']);return _0x5a5583(_0x9b9586['error'][_0xefa9('0x14')]);}else{logger['info'](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));_0x5a5583(_0x9b9586['result'][_0xefa9('0x14')]);}})[_0xefa9('0x15')](function(_0x1f50dd){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x1f50dd);_0x59b36e(_0x1f50dd);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index bd052d6..db2021f 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 _0xdfc0=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfc0,0x117));var _0x0dfc=function(_0x49248e,_0x5ca4d3){_0x49248e=_0x49248e-0x0;var _0x50a5e4=_0xdfc0[_0x49248e];return _0x50a5e4;};'use strict';var multer=require(_0x0dfc('0x0'));var util=require(_0x0dfc('0x1'));var path=require('path');var timeout=require(_0x0dfc('0x2'));var express=require(_0x0dfc('0x3'));var router=express['Router']();var fs_extra=require(_0x0dfc('0x4'));var auth=require(_0x0dfc('0x5'));var interaction=require(_0x0dfc('0x6'));var config=require(_0x0dfc('0x7'));var controller=require(_0x0dfc('0x8'));router['get']('/',auth[_0x0dfc('0x9')](),controller[_0x0dfc('0xa')]);router[_0x0dfc('0xb')]('/describe',auth[_0x0dfc('0x9')](),controller['describe']);router[_0x0dfc('0xb')]('/:id',auth[_0x0dfc('0x9')](),controller[_0x0dfc('0xc')]);router[_0x0dfc('0xd')]('/',auth[_0x0dfc('0x9')](),controller[_0x0dfc('0xe')]);router['put'](_0x0dfc('0xf'),auth[_0x0dfc('0x9')](),controller[_0x0dfc('0x10')]);router[_0x0dfc('0x11')](_0x0dfc('0xf'),auth[_0x0dfc('0x9')](),controller[_0x0dfc('0x12')]);module[_0x0dfc('0x13')]=router; \ No newline at end of file +var _0xc678=['index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x321c48,_0x2a88a5){var _0x417d8c=function(_0x34c64b){while(--_0x34c64b){_0x321c48['push'](_0x321c48['shift']());}};_0x417d8c(++_0x2a88a5);}(_0xc678,0xba));var _0x8c67=function(_0x2869af,_0x1d3bcf){_0x2869af=_0x2869af-0x0;var _0x3d7dea=_0xc678[_0x2869af];return _0x3d7dea;};'use strict';var multer=require(_0x8c67('0x0'));var util=require(_0x8c67('0x1'));var path=require(_0x8c67('0x2'));var timeout=require(_0x8c67('0x3'));var express=require(_0x8c67('0x4'));var router=express[_0x8c67('0x5')]();var fs_extra=require(_0x8c67('0x6'));var auth=require(_0x8c67('0x7'));var interaction=require(_0x8c67('0x8'));var config=require(_0x8c67('0x9'));var controller=require('./mailTransferReport.controller');router[_0x8c67('0xa')]('/',auth[_0x8c67('0xb')](),controller[_0x8c67('0xc')]);router[_0x8c67('0xa')](_0x8c67('0xd'),auth[_0x8c67('0xb')](),controller['describe']);router['get'](_0x8c67('0xe'),auth['isAuthenticated'](),controller[_0x8c67('0xf')]);router[_0x8c67('0x10')]('/',auth[_0x8c67('0xb')](),controller[_0x8c67('0x11')]);router['put']('/:id',auth[_0x8c67('0xb')](),controller[_0x8c67('0x12')]);router[_0x8c67('0x13')](_0x8c67('0xe'),auth[_0x8c67('0xb')](),controller[_0x8c67('0x14')]);module[_0x8c67('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 58de5d7..a3a2f00 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x579b79,_0x5b57b2){var _0x41e899=function(_0x2c8b7){while(--_0x2c8b7){_0x579b79['push'](_0x579b79['shift']());}};_0x41e899(++_0x5b57b2);}(_0x34e8,0x12c));var _0x834e=function(_0x559152,_0x6f2dce){_0x559152=_0x559152-0x0;var _0x204396=_0x34e8[_0x559152];return _0x204396;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x54ef,0x112));var _0xf54e=function(_0x5210e1,_0x167ee4){_0x5210e1=_0x5210e1-0x0;var _0x17c602=_0x54ef[_0x5210e1];return _0x17c602;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 4fa0777..5c14963 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 _0xc20c=['crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','update','then','destroy','sendStatus','error','send','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','MailTransferReport','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x209cf5,_0xe168a1){var _0x3bdd60=function(_0x2a6165){while(--_0x2a6165){_0x209cf5['push'](_0x209cf5['shift']());}};_0x3bdd60(++_0xe168a1);}(_0xc20c,0x156));var _0xcc20=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xc20c[_0x45b034];return _0x509cb0;};'use strict';var emlformat=require(_0xcc20('0x0'));var rimraf=require(_0xcc20('0x1'));var zipdir=require(_0xcc20('0x2'));var jsonpatch=require(_0xcc20('0x3'));var rp=require(_0xcc20('0x4'));var moment=require(_0xcc20('0x5'));var BPromise=require(_0xcc20('0x6'));var Mustache=require(_0xcc20('0x7'));var util=require('util');var path=require(_0xcc20('0x8'));var sox=require(_0xcc20('0x9'));var csv=require(_0xcc20('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc20('0xb'));var _=require(_0xcc20('0xc'));var squel=require('squel');var crypto=require(_0xcc20('0xd'));var jsforce=require(_0xcc20('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc20('0xa'));var querystring=require('querystring');var Papa=require(_0xcc20('0xf'));var Redis=require('ioredis');var authService=require(_0xcc20('0x10'));var qs=require(_0xcc20('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc20('0x12'));var logger=require(_0xcc20('0x13'))(_0xcc20('0x14'));var utils=require(_0xcc20('0x15'));var config=require(_0xcc20('0x16'));var licenseUtil=require(_0xcc20('0x17'));var db=require(_0xcc20('0x18'))['db'];function respondWithStatusCode(_0x2b4220,_0x3e9e8b){_0x3e9e8b=_0x3e9e8b||0xcc;return function(_0x21260e){if(_0x21260e){return _0x2b4220['sendStatus'](_0x3e9e8b);}return _0x2b4220[_0xcc20('0x19')](_0x3e9e8b)[_0xcc20('0x1a')]();};}function respondWithResult(_0x2066fe,_0x5a3447){_0x5a3447=_0x5a3447||0xc8;return function(_0x288565){if(_0x288565){return _0x2066fe['status'](_0x5a3447)[_0xcc20('0x1b')](_0x288565);}};}function respondWithFilteredResult(_0x2f3964,_0x3fd3b){return function(_0x494d6a){if(_0x494d6a){var _0x478eef=typeof _0x3fd3b[_0xcc20('0x1c')]===_0xcc20('0x1d')&&typeof _0x3fd3b['limit']===_0xcc20('0x1d');var _0x1fb0a0=_0x494d6a['count'];var _0x5befd6=_0x478eef?0x0:_0x3fd3b['offset'];var _0x410155=_0x478eef?_0x494d6a['count']:_0x3fd3b['offset']+_0x3fd3b[_0xcc20('0x1e')];var _0x148857;if(_0x410155>=_0x1fb0a0){_0x410155=_0x1fb0a0;_0x148857=0xc8;}else{_0x148857=0xce;}_0x2f3964[_0xcc20('0x19')](_0x148857);return _0x2f3964['set'](_0xcc20('0x1f'),_0x5befd6+'-'+_0x410155+'/'+_0x1fb0a0)[_0xcc20('0x1b')](_0x494d6a);}return null;};}function patchUpdates(_0x10f930){return function(_0xffa9ec){try{jsonpatch['apply'](_0xffa9ec,_0x10f930,!![]);}catch(_0xcb3602){return BPromise['reject'](_0xcb3602);}return _0xffa9ec['save']();};}function saveUpdates(_0x28a790,_0x46bfd8){return function(_0x74bed0){if(_0x74bed0){return _0x74bed0[_0xcc20('0x20')](_0x28a790)[_0xcc20('0x21')](function(_0x1ba7d2){return _0x1ba7d2;});}return null;};}function removeEntity(_0x12fcc6,_0x5e186c){return function(_0x2ed402){if(_0x2ed402){return _0x2ed402[_0xcc20('0x22')]()[_0xcc20('0x21')](function(){_0x12fcc6[_0xcc20('0x19')](0xcc)[_0xcc20('0x1a')]();});}};}function handleEntityNotFound(_0x204cd5,_0x305633){return function(_0x4d0c52){if(!_0x4d0c52){_0x204cd5[_0xcc20('0x23')](0x194);}return _0x4d0c52;};}function handleError(_0x361541,_0x28a7f6){_0x28a7f6=_0x28a7f6||0x1f4;return function(_0x50430d){logger[_0xcc20('0x24')](_0x50430d['stack']);if(_0x50430d['name']){delete _0x50430d['name'];}_0x361541[_0xcc20('0x19')](_0x28a7f6)[_0xcc20('0x25')](_0x50430d);};}exports['index']=function(_0x51bce8,_0x1e96cc){var _0x41359b={},_0x4c4c7f={},_0x3c7d07={'count':0x0,'rows':[]};var _0xd457a8=_[_0xcc20('0x26')](db['MailTransferReport']['rawAttributes'],function(_0x4ce15b){return{'name':_0x4ce15b[_0xcc20('0x27')],'type':_0x4ce15b[_0xcc20('0x28')]['key']};});_0x4c4c7f[_0xcc20('0x29')]=_['map'](_0xd457a8,'name');_0x4c4c7f[_0xcc20('0x2a')]=_[_0xcc20('0x2b')](_0x51bce8['query']);_0x4c4c7f['filters']=_[_0xcc20('0x2c')](_0x4c4c7f[_0xcc20('0x29')],_0x4c4c7f[_0xcc20('0x2a')]);_0x41359b[_0xcc20('0x2d')]=_[_0xcc20('0x2c')](_0x4c4c7f['model'],qs['fields'](_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x2e')]));_0x41359b[_0xcc20('0x2d')]=_0x41359b[_0xcc20('0x2d')][_0xcc20('0x2f')]?_0x41359b['attributes']:_0x4c4c7f[_0xcc20('0x29')];if(!_0x51bce8[_0xcc20('0x2a')]['hasOwnProperty'](_0xcc20('0x30'))){_0x41359b[_0xcc20('0x1e')]=qs[_0xcc20('0x1e')](_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x1e')]);_0x41359b['offset']=qs[_0xcc20('0x1c')](_0x51bce8[_0xcc20('0x2a')]['offset']);}_0x41359b[_0xcc20('0x31')]=qs[_0xcc20('0x32')](_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x32')]);_0x41359b[_0xcc20('0x33')]=qs['filters'](_[_0xcc20('0x34')](_0x51bce8[_0xcc20('0x2a')],_0x4c4c7f['filters']),_0xd457a8);if(_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x35')]){_0x41359b['where']=_[_0xcc20('0x36')](_0x41359b['where'],{'$or':_[_0xcc20('0x26')](_0xd457a8,function(_0x2a842f){if(_0x2a842f[_0xcc20('0x28')]!=='VIRTUAL'){var _0x407d50={};_0x407d50[_0x2a842f['name']]={'$like':'%'+_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x35')]+'%'};return _0x407d50;}})});}_0x41359b=_['merge']({},_0x41359b,_0x51bce8[_0xcc20('0x37')]);var _0x2570d2={'where':_0x41359b[_0xcc20('0x33')]};return db[_0xcc20('0x38')][_0xcc20('0x39')](_0x2570d2)[_0xcc20('0x21')](function(_0x5b9d25){_0x3c7d07[_0xcc20('0x39')]=_0x5b9d25;if(_0x51bce8[_0xcc20('0x2a')][_0xcc20('0x3a')]){_0x41359b[_0xcc20('0x3b')]=[{'all':!![]}];}return db[_0xcc20('0x38')][_0xcc20('0x3c')](_0x41359b);})[_0xcc20('0x21')](function(_0x42984e){_0x3c7d07[_0xcc20('0x3d')]=_0x42984e;return _0x3c7d07;})[_0xcc20('0x21')](respondWithFilteredResult(_0x1e96cc,_0x41359b))[_0xcc20('0x3e')](handleError(_0x1e96cc,null));};exports[_0xcc20('0x3f')]=function(_0x5c04b8,_0xc9f489){var _0xc1d55b={'raw':!![],'where':{'id':_0x5c04b8[_0xcc20('0x40')]['id']}},_0x414bed={};_0x414bed[_0xcc20('0x29')]=_[_0xcc20('0x2b')](db[_0xcc20('0x38')][_0xcc20('0x41')]);_0x414bed[_0xcc20('0x2a')]=_[_0xcc20('0x2b')](_0x5c04b8[_0xcc20('0x2a')]);_0x414bed[_0xcc20('0x42')]=_['intersection'](_0x414bed['model'],_0x414bed[_0xcc20('0x2a')]);_0xc1d55b['attributes']=_[_0xcc20('0x2c')](_0x414bed[_0xcc20('0x29')],qs['fields'](_0x5c04b8[_0xcc20('0x2a')][_0xcc20('0x2e')]));_0xc1d55b['attributes']=_0xc1d55b[_0xcc20('0x2d')]['length']?_0xc1d55b[_0xcc20('0x2d')]:_0x414bed[_0xcc20('0x29')];if(_0x5c04b8[_0xcc20('0x2a')]['includeAll']){_0xc1d55b[_0xcc20('0x3b')]=[{'all':!![]}];}_0xc1d55b=_[_0xcc20('0x36')]({},_0xc1d55b,_0x5c04b8[_0xcc20('0x37')]);return db['MailTransferReport']['find'](_0xc1d55b)[_0xcc20('0x21')](handleEntityNotFound(_0xc9f489,null))[_0xcc20('0x21')](respondWithResult(_0xc9f489,null))[_0xcc20('0x3e')](handleError(_0xc9f489,null));};exports[_0xcc20('0x43')]=function(_0x40b7ce,_0x5a5a0e){return db[_0xcc20('0x38')][_0xcc20('0x43')](_0x40b7ce[_0xcc20('0x44')],{})[_0xcc20('0x21')](respondWithResult(_0x5a5a0e,0xc9))[_0xcc20('0x3e')](handleError(_0x5a5a0e,null));};exports[_0xcc20('0x20')]=function(_0x216276,_0x57c55c){if(_0x216276['body']['id']){delete _0x216276[_0xcc20('0x44')]['id'];}return db[_0xcc20('0x38')][_0xcc20('0x45')]({'where':{'id':_0x216276[_0xcc20('0x40')]['id']}})[_0xcc20('0x21')](handleEntityNotFound(_0x57c55c,null))[_0xcc20('0x21')](saveUpdates(_0x216276['body'],null))[_0xcc20('0x21')](respondWithResult(_0x57c55c,null))['catch'](handleError(_0x57c55c,null));};exports[_0xcc20('0x22')]=function(_0x272f41,_0x414b01){return db[_0xcc20('0x38')][_0xcc20('0x45')]({'where':{'id':_0x272f41[_0xcc20('0x40')]['id']}})[_0xcc20('0x21')](handleEntityNotFound(_0x414b01,null))[_0xcc20('0x21')](removeEntity(_0x414b01,null))[_0xcc20('0x3e')](handleError(_0x414b01,null));};exports[_0xcc20('0x46')]=function(_0x5cda88,_0x263c9e){return db[_0xcc20('0x38')][_0xcc20('0x46')]()['then'](respondWithResult(_0x263c9e,null))[_0xcc20('0x3e')](handleError(_0x263c9e,null));}; \ No newline at end of file +var _0xe1af=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','count','include','findAll','then','rows','catch','show','keys','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','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','json','undefined','offset','limit','Content-Range','apply','reject','update','error','name','send','map','MailTransferReport','rawAttributes','fieldName','key'];(function(_0x43f2fd,_0x4eb9b9){var _0x28b4b8=function(_0x47b844){while(--_0x47b844){_0x43f2fd['push'](_0x43f2fd['shift']());}};_0x28b4b8(++_0x4eb9b9);}(_0xe1af,0xb1));var _0xfe1a=function(_0x2de564,_0x14ac58){_0x2de564=_0x2de564-0x0;var _0x5b7809=_0xe1af[_0x2de564];return _0x5b7809;};'use strict';var emlformat=require(_0xfe1a('0x0'));var rimraf=require(_0xfe1a('0x1'));var zipdir=require(_0xfe1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe1a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe1a('0x4'));var util=require(_0xfe1a('0x5'));var path=require('path');var sox=require(_0xfe1a('0x6'));var csv=require('to-csv');var ejs=require(_0xfe1a('0x7'));var fs=require('fs');var fs_extra=require(_0xfe1a('0x8'));var _=require(_0xfe1a('0x9'));var squel=require(_0xfe1a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe1a('0xb'));var querystring=require(_0xfe1a('0xc'));var Papa=require(_0xfe1a('0xd'));var Redis=require(_0xfe1a('0xe'));var authService=require(_0xfe1a('0xf'));var qs=require(_0xfe1a('0x10'));var as=require(_0xfe1a('0x11'));var hardwareService=require(_0xfe1a('0x12'));var logger=require(_0xfe1a('0x13'))('api');var utils=require(_0xfe1a('0x14'));var config=require(_0xfe1a('0x15'));var licenseUtil=require(_0xfe1a('0x16'));var db=require(_0xfe1a('0x17'))['db'];function respondWithStatusCode(_0x53182b,_0x967d7b){_0x967d7b=_0x967d7b||0xcc;return function(_0xfe38bf){if(_0xfe38bf){return _0x53182b[_0xfe1a('0x18')](_0x967d7b);}return _0x53182b[_0xfe1a('0x19')](_0x967d7b)['end']();};}function respondWithResult(_0x2b31fc,_0x18e6fc){_0x18e6fc=_0x18e6fc||0xc8;return function(_0x42811b){if(_0x42811b){return _0x2b31fc['status'](_0x18e6fc)[_0xfe1a('0x1a')](_0x42811b);}};}function respondWithFilteredResult(_0xb98972,_0x59615a){return function(_0x2d9bdb){if(_0x2d9bdb){var _0x3b1b3a=typeof _0x59615a['offset']===_0xfe1a('0x1b')&&typeof _0x59615a['limit']===_0xfe1a('0x1b');var _0x5df9cb=_0x2d9bdb['count'];var _0x562f9f=_0x3b1b3a?0x0:_0x59615a[_0xfe1a('0x1c')];var _0x4ea822=_0x3b1b3a?_0x2d9bdb['count']:_0x59615a[_0xfe1a('0x1c')]+_0x59615a[_0xfe1a('0x1d')];var _0x5ee2c5;if(_0x4ea822>=_0x5df9cb){_0x4ea822=_0x5df9cb;_0x5ee2c5=0xc8;}else{_0x5ee2c5=0xce;}_0xb98972[_0xfe1a('0x19')](_0x5ee2c5);return _0xb98972['set'](_0xfe1a('0x1e'),_0x562f9f+'-'+_0x4ea822+'/'+_0x5df9cb)[_0xfe1a('0x1a')](_0x2d9bdb);}return null;};}function patchUpdates(_0x407f64){return function(_0x5f1f8e){try{jsonpatch[_0xfe1a('0x1f')](_0x5f1f8e,_0x407f64,!![]);}catch(_0x3fcfd7){return BPromise[_0xfe1a('0x20')](_0x3fcfd7);}return _0x5f1f8e['save']();};}function saveUpdates(_0xbe55e8,_0x71ef00){return function(_0xa813db){if(_0xa813db){return _0xa813db[_0xfe1a('0x21')](_0xbe55e8)['then'](function(_0x319627){return _0x319627;});}return null;};}function removeEntity(_0x50b88a,_0x1e28ba){return function(_0x56b18c){if(_0x56b18c){return _0x56b18c['destroy']()['then'](function(){_0x50b88a[_0xfe1a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ed85,_0x2e1423){return function(_0x57a92c){if(!_0x57a92c){_0x38ed85[_0xfe1a('0x18')](0x194);}return _0x57a92c;};}function handleError(_0x96390b,_0xdb2ddb){_0xdb2ddb=_0xdb2ddb||0x1f4;return function(_0x88db28){logger[_0xfe1a('0x22')](_0x88db28['stack']);if(_0x88db28[_0xfe1a('0x23')]){delete _0x88db28[_0xfe1a('0x23')];}_0x96390b['status'](_0xdb2ddb)[_0xfe1a('0x24')](_0x88db28);};}exports['index']=function(_0x104516,_0x4cb7ea){var _0x55bfae={},_0x507eeb={},_0x2babcc={'count':0x0,'rows':[]};var _0x6648e7=_[_0xfe1a('0x25')](db[_0xfe1a('0x26')][_0xfe1a('0x27')],function(_0x4bd3a6){return{'name':_0x4bd3a6[_0xfe1a('0x28')],'type':_0x4bd3a6['type'][_0xfe1a('0x29')]};});_0x507eeb[_0xfe1a('0x2a')]=_['map'](_0x6648e7,_0xfe1a('0x23'));_0x507eeb[_0xfe1a('0x2b')]=_['keys'](_0x104516['query']);_0x507eeb[_0xfe1a('0x2c')]=_[_0xfe1a('0x2d')](_0x507eeb['model'],_0x507eeb[_0xfe1a('0x2b')]);_0x55bfae[_0xfe1a('0x2e')]=_['intersection'](_0x507eeb['model'],qs[_0xfe1a('0x2f')](_0x104516['query'][_0xfe1a('0x2f')]));_0x55bfae[_0xfe1a('0x2e')]=_0x55bfae[_0xfe1a('0x2e')][_0xfe1a('0x30')]?_0x55bfae['attributes']:_0x507eeb[_0xfe1a('0x2a')];if(!_0x104516['query'][_0xfe1a('0x31')](_0xfe1a('0x32'))){_0x55bfae[_0xfe1a('0x1d')]=qs['limit'](_0x104516[_0xfe1a('0x2b')][_0xfe1a('0x1d')]);_0x55bfae[_0xfe1a('0x1c')]=qs[_0xfe1a('0x1c')](_0x104516['query'][_0xfe1a('0x1c')]);}_0x55bfae['order']=qs['sort'](_0x104516[_0xfe1a('0x2b')][_0xfe1a('0x33')]);_0x55bfae['where']=qs[_0xfe1a('0x2c')](_[_0xfe1a('0x34')](_0x104516['query'],_0x507eeb[_0xfe1a('0x2c')]),_0x6648e7);if(_0x104516['query'][_0xfe1a('0x35')]){_0x55bfae['where']=_[_0xfe1a('0x36')](_0x55bfae[_0xfe1a('0x37')],{'$or':_[_0xfe1a('0x25')](_0x6648e7,function(_0x3ed6b3){if(_0x3ed6b3[_0xfe1a('0x38')]!==_0xfe1a('0x39')){var _0x4c2aaa={};_0x4c2aaa[_0x3ed6b3[_0xfe1a('0x23')]]={'$like':'%'+_0x104516[_0xfe1a('0x2b')]['filter']+'%'};return _0x4c2aaa;}})});}_0x55bfae=_['merge']({},_0x55bfae,_0x104516[_0xfe1a('0x3a')]);var _0x1c3686={'where':_0x55bfae[_0xfe1a('0x37')]};return db[_0xfe1a('0x26')][_0xfe1a('0x3b')](_0x1c3686)['then'](function(_0x50fb32){_0x2babcc[_0xfe1a('0x3b')]=_0x50fb32;if(_0x104516[_0xfe1a('0x2b')]['includeAll']){_0x55bfae[_0xfe1a('0x3c')]=[{'all':!![]}];}return db[_0xfe1a('0x26')][_0xfe1a('0x3d')](_0x55bfae);})[_0xfe1a('0x3e')](function(_0x5787f7){_0x2babcc[_0xfe1a('0x3f')]=_0x5787f7;return _0x2babcc;})[_0xfe1a('0x3e')](respondWithFilteredResult(_0x4cb7ea,_0x55bfae))[_0xfe1a('0x40')](handleError(_0x4cb7ea,null));};exports[_0xfe1a('0x41')]=function(_0xc9e926,_0x4683cb){var _0x2f0531={'raw':!![],'where':{'id':_0xc9e926['params']['id']}},_0x4af966={};_0x4af966[_0xfe1a('0x2a')]=_[_0xfe1a('0x42')](db[_0xfe1a('0x26')][_0xfe1a('0x27')]);_0x4af966[_0xfe1a('0x2b')]=_[_0xfe1a('0x42')](_0xc9e926[_0xfe1a('0x2b')]);_0x4af966['filters']=_[_0xfe1a('0x2d')](_0x4af966[_0xfe1a('0x2a')],_0x4af966[_0xfe1a('0x2b')]);_0x2f0531['attributes']=_['intersection'](_0x4af966['model'],qs[_0xfe1a('0x2f')](_0xc9e926[_0xfe1a('0x2b')][_0xfe1a('0x2f')]));_0x2f0531[_0xfe1a('0x2e')]=_0x2f0531[_0xfe1a('0x2e')][_0xfe1a('0x30')]?_0x2f0531['attributes']:_0x4af966['model'];if(_0xc9e926[_0xfe1a('0x2b')][_0xfe1a('0x43')]){_0x2f0531[_0xfe1a('0x3c')]=[{'all':!![]}];}_0x2f0531=_[_0xfe1a('0x36')]({},_0x2f0531,_0xc9e926['options']);return db['MailTransferReport']['find'](_0x2f0531)['then'](handleEntityNotFound(_0x4683cb,null))['then'](respondWithResult(_0x4683cb,null))[_0xfe1a('0x40')](handleError(_0x4683cb,null));};exports[_0xfe1a('0x44')]=function(_0x2f043e,_0x5c8672){return db['MailTransferReport'][_0xfe1a('0x44')](_0x2f043e[_0xfe1a('0x45')],{})[_0xfe1a('0x3e')](respondWithResult(_0x5c8672,0xc9))[_0xfe1a('0x40')](handleError(_0x5c8672,null));};exports[_0xfe1a('0x21')]=function(_0x22e175,_0x193c89){if(_0x22e175[_0xfe1a('0x45')]['id']){delete _0x22e175[_0xfe1a('0x45')]['id'];}return db[_0xfe1a('0x26')][_0xfe1a('0x46')]({'where':{'id':_0x22e175['params']['id']}})['then'](handleEntityNotFound(_0x193c89,null))[_0xfe1a('0x3e')](saveUpdates(_0x22e175[_0xfe1a('0x45')],null))[_0xfe1a('0x3e')](respondWithResult(_0x193c89,null))[_0xfe1a('0x40')](handleError(_0x193c89,null));};exports[_0xfe1a('0x47')]=function(_0x3354f3,_0x1b161c){return db[_0xfe1a('0x26')][_0xfe1a('0x46')]({'where':{'id':_0x3354f3['params']['id']}})['then'](handleEntityNotFound(_0x1b161c,null))[_0xfe1a('0x3e')](removeEntity(_0x1b161c,null))['catch'](handleError(_0x1b161c,null));};exports[_0xfe1a('0x48')]=function(_0x1faa05,_0x5039ac){return db[_0xfe1a('0x26')]['describe']()[_0xfe1a('0x3e')](respondWithResult(_0x5039ac,null))[_0xfe1a('0x40')](handleError(_0x5039ac,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5a49560..2cb12ad 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 _0x6347=['report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x226b17,_0x3643fe){var _0x2b7cfe=function(_0xe2d9ca){while(--_0xe2d9ca){_0x226b17['push'](_0x226b17['shift']());}};_0x2b7cfe(++_0x3643fe);}(_0x6347,0x1c9));var _0x7634=function(_0x52552e,_0xd7d2ad){_0x52552e=_0x52552e-0x0;var _0x521a2d=_0x6347[_0x52552e];return _0x521a2d;};'use strict';var _=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var logger=require('../../config/logger')(_0x7634('0x2'));var moment=require(_0x7634('0x3'));var BPromise=require(_0x7634('0x4'));var rp=require(_0x7634('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7634('0x6'));var config=require('../../config/environment');var attributes=require(_0x7634('0x7'));module[_0x7634('0x8')]=function(_0x56d2ad,_0x58d043){return _0x56d2ad[_0x7634('0x9')](_0x7634('0xa'),attributes,{'tableName':_0x7634('0xb'),'paranoid':![],'indexes':[{'name':_0x7634('0xc'),'fields':[_0x7634('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf987=['define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x2abac9,_0x4d0bcb){var _0x77125b=function(_0x11a9d4){while(--_0x11a9d4){_0x2abac9['push'](_0x2abac9['shift']());}};_0x77125b(++_0x4d0bcb);}(_0xf987,0x18a));var _0x7f98=function(_0x36ef94,_0x16ba28){_0x36ef94=_0x36ef94-0x0;var _0x9b0e30=_0xf987[_0x36ef94];return _0x9b0e30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f98('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 277776e..93fb581 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 _0xfb37=['error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x11a0b0,_0x13077c){var _0x1382e6=function(_0x562ed0){while(--_0x562ed0){_0x11a0b0['push'](_0x11a0b0['shift']());}};_0x1382e6(++_0x13077c);}(_0xfb37,0x164));var _0x7fb3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfb37[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x7fb3('0x0'));var moment=require(_0x7fb3('0x1'));var BPromise=require(_0x7fb3('0x2'));var rs=require(_0x7fb3('0x3'));var fs=require('fs');var Redis=require(_0x7fb3('0x4'));var db=require(_0x7fb3('0x5'))['db'];var utils=require(_0x7fb3('0x6'));var logger=require(_0x7fb3('0x7'))(_0x7fb3('0x8'));var config=require(_0x7fb3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7fb3('0xa')][_0x7fb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11d7d9,_0x4e2682,_0x285f15){return new BPromise(function(_0xc9a1a4,_0x27f24b){return client[_0x7fb3('0xc')](_0x11d7d9,_0x285f15)[_0x7fb3('0xd')](function(_0x394d8a){logger[_0x7fb3('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x4e2682,'request\x20sent');logger[_0x7fb3('0xf')](_0x7fb3('0x10'),_0x4e2682,_0x7fb3('0x11'),JSON[_0x7fb3('0x12')](_0x394d8a));if(_0x394d8a[_0x7fb3('0x13')]){if(_0x394d8a[_0x7fb3('0x13')][_0x7fb3('0x14')]===0x1f4){logger[_0x7fb3('0x13')](_0x7fb3('0x15'),_0x4e2682,_0x394d8a[_0x7fb3('0x13')][_0x7fb3('0x16')]);return _0x27f24b(_0x394d8a[_0x7fb3('0x13')]['message']);}logger[_0x7fb3('0x13')](_0x7fb3('0x15'),_0x4e2682,_0x394d8a['error'][_0x7fb3('0x16')]);return _0xc9a1a4(_0x394d8a['error'][_0x7fb3('0x16')]);}else{logger['info'](_0x7fb3('0x15'),_0x4e2682,_0x7fb3('0x11'));_0xc9a1a4(_0x394d8a[_0x7fb3('0x17')]['message']);}})[_0x7fb3('0x18')](function(_0x1acd9d){logger['error'](_0x7fb3('0x15'),_0x4e2682,_0x1acd9d);_0x27f24b(_0x1acd9d);});});} \ No newline at end of file +var _0xe1ee=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x2b5584,_0x2c1bab){var _0x3f8885=function(_0x4dc68c){while(--_0x4dc68c){_0x2b5584['push'](_0x2b5584['shift']());}};_0x3f8885(++_0x2c1bab);}(_0xe1ee,0xc9));var _0xee1e=function(_0x1e4b33,_0x2d64c7){_0x1e4b33=_0x1e4b33-0x0;var _0x5aeaae=_0xe1ee[_0x1e4b33];return _0x5aeaae;};'use strict';var _=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var moment=require(_0xee1e('0x2'));var BPromise=require(_0xee1e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1e('0x4'))['db'];var utils=require(_0xee1e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xee1e('0x6'));var jayson=require(_0xee1e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf9f049,_0x38060c,_0x1432ae){return new BPromise(function(_0x485d9e,_0x44c851){return client[_0xee1e('0x8')](_0xf9f049,_0x1432ae)[_0xee1e('0x9')](function(_0x497ed1){logger[_0xee1e('0xa')](_0xee1e('0xb'),_0x38060c,_0xee1e('0xc'));logger[_0xee1e('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x38060c,'request\x20sent',JSON[_0xee1e('0xe')](_0x497ed1));if(_0x497ed1[_0xee1e('0xf')]){if(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x10')]===0x1f4){logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);return _0x44c851(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);}logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);return _0x485d9e(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);}else{logger['info'](_0xee1e('0xb'),_0x38060c,_0xee1e('0xc'));_0x485d9e(_0x497ed1['result']['message']);}})[_0xee1e('0x12')](function(_0x383945){logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x383945);_0x44c851(_0x383945);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a36e3b6..32850ba 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 _0xfbe0=['show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0xfbe0,0x91));var _0x0fbe=function(_0x1de692,_0x15ad56){_0x1de692=_0x1de692-0x0;var _0x15c0b5=_0xfbe0[_0x1de692];return _0x15c0b5;};'use strict';var multer=require(_0x0fbe('0x0'));var util=require(_0x0fbe('0x1'));var path=require(_0x0fbe('0x2'));var timeout=require('connect-timeout');var express=require(_0x0fbe('0x3'));var router=express[_0x0fbe('0x4')]();var fs_extra=require(_0x0fbe('0x5'));var auth=require(_0x0fbe('0x6'));var interaction=require(_0x0fbe('0x7'));var config=require(_0x0fbe('0x8'));var controller=require(_0x0fbe('0x9'));router[_0x0fbe('0xa')]('/',auth[_0x0fbe('0xb')](),controller[_0x0fbe('0xc')]);router[_0x0fbe('0xa')](_0x0fbe('0xd'),auth[_0x0fbe('0xb')](),controller[_0x0fbe('0xe')]);router[_0x0fbe('0xa')](_0x0fbe('0xf'),auth['isAuthenticated'](),controller[_0x0fbe('0x10')]);router[_0x0fbe('0x11')]('/',auth[_0x0fbe('0xb')](),controller[_0x0fbe('0x12')]);router['put'](_0x0fbe('0xf'),auth[_0x0fbe('0xb')](),controller[_0x0fbe('0x13')]);router[_0x0fbe('0x14')]('/:id',auth[_0x0fbe('0xb')](),controller[_0x0fbe('0x15')]);module[_0x0fbe('0x16')]=router; \ No newline at end of file +var _0x62dd=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x62dd,0x10c));var _0xd62d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x62dd[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xd62d('0x0'));var path=require('path');var timeout=require(_0xd62d('0x1'));var express=require(_0xd62d('0x2'));var router=express[_0xd62d('0x3')]();var fs_extra=require(_0xd62d('0x4'));var auth=require(_0xd62d('0x5'));var interaction=require(_0xd62d('0x6'));var config=require('../../config/environment');var controller=require(_0xd62d('0x7'));router[_0xd62d('0x8')]('/',auth[_0xd62d('0x9')](),controller[_0xd62d('0xa')]);router[_0xd62d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd62d('0xb')]);router[_0xd62d('0x8')](_0xd62d('0xc'),auth[_0xd62d('0x9')](),controller[_0xd62d('0xd')]);router[_0xd62d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd62d('0xf')]('/:id',auth[_0xd62d('0x9')](),controller['update']);router[_0xd62d('0x10')](_0xd62d('0xc'),auth[_0xd62d('0x9')](),controller[_0xd62d('0x11')]);module[_0xd62d('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2f64ad7..dfa14c3 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 _0x00bb=['enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb00b('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb00b('0x3')],'defaultValue':_0xb00b('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb00b('0x5')]},'enterAt':{'type':Sequelize[_0xb00b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x574cf8){var _0x532ffb=moment(_0x574cf8);var _0x36e363=moment(this[_0xb00b('0x7')](_0xb00b('0x8')));var _0x37f07d=_0x532ffb[_0xb00b('0x9')](_0x36e363,_0xb00b('0xa'));this['setDataValue']('exitAt',_0x574cf8);this[_0xb00b('0xb')](_0xb00b('0xc'),_0x37f07d||null);}},'data1':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xd')},'data2':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xe')},'role':{'type':Sequelize[_0xb00b('0x3')]},'internal':{'type':Sequelize[_0xb00b('0x5')]},'uniqueid':{'type':Sequelize[_0xb00b('0x3')]}}; \ No newline at end of file +var _0x00bb=['enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb00b('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb00b('0x3')],'defaultValue':_0xb00b('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb00b('0x5')]},'enterAt':{'type':Sequelize[_0xb00b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x574cf8){var _0x532ffb=moment(_0x574cf8);var _0x36e363=moment(this[_0xb00b('0x7')](_0xb00b('0x8')));var _0x37f07d=_0x532ffb[_0xb00b('0x9')](_0x36e363,_0xb00b('0xa'));this['setDataValue']('exitAt',_0x574cf8);this[_0xb00b('0xb')](_0xb00b('0xc'),_0x37f07d||null);}},'data1':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xd')},'data2':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xe')},'role':{'type':Sequelize[_0xb00b('0x3')]},'internal':{'type':Sequelize[_0xb00b('0x5')]},'uniqueid':{'type':Sequelize[_0xb00b('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index cbb21ab..f926c53 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x55ca,0x126));var _0xa55c=function(_0x2e997e,_0x4edf31){_0x2e997e=_0x2e997e-0x0;var _0x5a6cb1=_0x55ca[_0x2e997e];return _0x5a6cb1;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x196388,_0x498baf){var _0x9346b2=function(_0x210214){while(--_0x210214){_0x196388['push'](_0x196388['shift']());}};_0x9346b2(++_0x498baf);}(_0x008c,0x188));var _0xc008=function(_0x434ab8,_0x164e29){_0x434ab8=_0x434ab8-0x0;var _0x4173a2=_0x008c[_0x434ab8];return _0x4173a2;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index ab519e4..dc0f4d7 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 _0xfd60=['path','rimraf','./memberReport.attributes','define','MemberReport','membername','interface','lodash','api','moment','bluebird'];(function(_0x149319,_0x4182b5){var _0x4637c9=function(_0x2ff6ce){while(--_0x2ff6ce){_0x149319['push'](_0x149319['shift']());}};_0x4637c9(++_0x4182b5);}(_0xfd60,0x151));var _0x0fd6=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xfd60[_0x595013];return _0x2a29e3;};'use strict';var _=require(_0x0fd6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0fd6('0x1'));var moment=require(_0x0fd6('0x2'));var BPromise=require(_0x0fd6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd6('0x4'));var rimraf=require(_0x0fd6('0x5'));var config=require('../../config/environment');var attributes=require(_0x0fd6('0x6'));module['exports']=function(_0x89d594,_0x52d051){return _0x89d594[_0x0fd6('0x7')](_0x0fd6('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x0fd6('0x9'),_0x0fd6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc6f=['define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x575f73,_0x55a7ef){var _0x52a3c1=function(_0x25bfdc){while(--_0x25bfdc){_0x575f73['push'](_0x575f73['shift']());}};_0x52a3c1(++_0x55a7ef);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x51a0a9,_0x569499){_0x51a0a9=_0x51a0a9-0x0;var _0x4bd20c=_0xdc6f[_0x51a0a9];return _0x4bd20c;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var logger=require(_0xfdc6('0x2'))(_0xfdc6('0x3'));var moment=require(_0xfdc6('0x4'));var BPromise=require(_0xfdc6('0x5'));var rp=require(_0xfdc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfdc6('0x7'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x2e8a52,_0x124108){return _0x2e8a52[_0xfdc6('0x8')]('MemberReport',attributes,{'tableName':_0xfdc6('0x9'),'paranoid':![],'indexes':[{'name':_0xfdc6('0xa'),'fields':[_0xfdc6('0xb'),_0xfdc6('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 9102494..38992cd 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 _0x5a9e=['where','attributes','limit','map','model','include','info','stringify','CreateMemberReport','MemberReport','body','catch','UpdateMemberReport','update','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','options','raw'];(function(_0x33ae94,_0x6f642e){var _0x233cc1=function(_0x288e91){while(--_0x288e91){_0x33ae94['push'](_0x33ae94['shift']());}};_0x233cc1(++_0x6f642e);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x5a9e[_0x2c18a8];return _0x1e009a;};'use strict';var _=require('lodash');var util=require(_0xe5a9('0x0'));var moment=require(_0xe5a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5a9('0x2'));var db=require(_0xe5a9('0x3'))['db'];var utils=require(_0xe5a9('0x4'));var logger=require(_0xe5a9('0x5'))(_0xe5a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe5a9('0x7'));var client=jayson['client'][_0xe5a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16c74e,_0x561aca,_0x4acfa6){return new BPromise(function(_0x2ed1d0,_0x13bb4f){return client[_0xe5a9('0x9')](_0x16c74e,_0x4acfa6)[_0xe5a9('0xa')](function(_0x1336ca){logger['info']('MemberReport,\x20%s,\x20%s',_0x561aca,_0xe5a9('0xb'));logger['debug'](_0xe5a9('0xc'),_0x561aca,'request\x20sent',JSON['stringify'](_0x1336ca));if(_0x1336ca[_0xe5a9('0xd')]){if(_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0xe')]===0x1f4){logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);return _0x13bb4f(_0x1336ca['error'][_0xe5a9('0x10')]);}logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);return _0x2ed1d0(_0x1336ca[_0xe5a9('0xd')][_0xe5a9('0x10')]);}else{logger['info'](_0xe5a9('0xf'),_0x561aca,_0xe5a9('0xb'));_0x2ed1d0(_0x1336ca[_0xe5a9('0x11')]['message']);}})['catch'](function(_0x1c46ba){logger[_0xe5a9('0xd')](_0xe5a9('0xf'),_0x561aca,_0x1c46ba);_0x13bb4f(_0x1c46ba);});});}exports[_0xe5a9('0x12')]=function(_0xd5f697){var _0x3c2e2c=this;return new Promise(function(_0x509cdc,_0x2ca0f3){return db['MemberReport']['findAll']({'raw':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x14')]===undefined?!![]:![]:!![],'where':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x15')]||null:null,'attributes':_0xd5f697['options']?_0xd5f697['options'][_0xe5a9('0x16')]||null:null,'limit':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')][_0xe5a9('0x17')]||null:null,'include':_0xd5f697[_0xe5a9('0x13')]?_0xd5f697[_0xe5a9('0x13')]['include']?_[_0xe5a9('0x18')](_0xd5f697[_0xe5a9('0x13')]['include'],function(_0x1c15d3){return{'model':db[_0x1c15d3[_0xe5a9('0x19')]],'as':_0x1c15d3['as'],'attributes':_0x1c15d3['attributes'],'include':_0x1c15d3[_0xe5a9('0x1a')]?_['map'](_0x1c15d3[_0xe5a9('0x1a')],function(_0x1b1fff){return{'model':db[_0x1b1fff[_0xe5a9('0x19')]],'as':_0x1b1fff['as'],'attributes':_0x1b1fff[_0xe5a9('0x16')],'include':_0x1b1fff['include']?_[_0xe5a9('0x18')](_0x1b1fff[_0xe5a9('0x1a')],function(_0x20e1a1){return{'model':db[_0x20e1a1[_0xe5a9('0x19')]],'as':_0x20e1a1['as'],'attributes':_0x20e1a1[_0xe5a9('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe5a9('0xa')](function(_0x25355f){logger[_0xe5a9('0x1b')](_0xe5a9('0x12'),_0xd5f697);logger['debug'](_0xe5a9('0x12'),_0xd5f697,JSON[_0xe5a9('0x1c')](_0x25355f));_0x509cdc(_0x25355f);})['catch'](function(_0x9b9837){logger['error'](_0xe5a9('0x12'),_0x9b9837[_0xe5a9('0x10')],_0xd5f697);_0x2ca0f3(_0x3c2e2c[_0xe5a9('0xd')](0x1f4,_0x9b9837[_0xe5a9('0x10')]));});});};exports[_0xe5a9('0x1d')]=function(_0x25f522){var _0x34b288=this;return new Promise(function(_0x291595,_0x314d61){return db[_0xe5a9('0x1e')]['create'](_0x25f522[_0xe5a9('0x1f')],{'raw':_0x25f522[_0xe5a9('0x13')]?_0x25f522[_0xe5a9('0x13')][_0xe5a9('0x14')]===undefined?!![]:![]:!![]})[_0xe5a9('0xa')](function(_0x56523c){logger['info'](_0xe5a9('0x1d'),_0x25f522);logger['debug'](_0xe5a9('0x1d'),_0x25f522,JSON[_0xe5a9('0x1c')](_0x56523c));_0x291595(_0x56523c);})[_0xe5a9('0x20')](function(_0xa488f5){logger[_0xe5a9('0xd')](_0xe5a9('0x1d'),_0xa488f5[_0xe5a9('0x10')],_0x25f522);_0x314d61(_0x34b288['error'](0x1f4,_0xa488f5[_0xe5a9('0x10')]));});});};exports[_0xe5a9('0x21')]=function(_0x2eac05){var _0x4746c4=this;return new Promise(function(_0x155946,_0x2e4b92){return db['MemberReport'][_0xe5a9('0x22')](_0x2eac05[_0xe5a9('0x1f')],{'raw':_0x2eac05[_0xe5a9('0x13')]?_0x2eac05['options'][_0xe5a9('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eac05[_0xe5a9('0x13')]?_0x2eac05[_0xe5a9('0x13')][_0xe5a9('0x15')]||null:null,'attributes':_0x2eac05[_0xe5a9('0x13')]?_0x2eac05[_0xe5a9('0x13')][_0xe5a9('0x16')]||null:null,'limit':_0x2eac05[_0xe5a9('0x13')]?_0x2eac05[_0xe5a9('0x13')][_0xe5a9('0x17')]||null:null})[_0xe5a9('0xa')](function(_0x79f4dc){logger[_0xe5a9('0x1b')]('UpdateMemberReport',_0x2eac05);logger['debug'](_0xe5a9('0x21'),_0x2eac05,JSON[_0xe5a9('0x1c')](_0x79f4dc));_0x155946(_0x79f4dc);})[_0xe5a9('0x20')](function(_0x12fb65){logger[_0xe5a9('0xd')]('UpdateMemberReport',_0x12fb65[_0xe5a9('0x10')],_0x2eac05);_0x2e4b92(_0x4746c4['error'](0x1f4,_0x12fb65[_0xe5a9('0x10')]));});});}; \ No newline at end of file +var _0x0f4d=['code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','info','CreateMemberReport','create','body','UpdateMemberReport','update','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x57292e,_0x53e24f){_0x57292e=_0x57292e-0x0;var _0x2f692e=_0x0f4d[_0x57292e];return _0x2f692e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd0f4('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0f4('0x1'));var db=require(_0xd0f4('0x2'))['db'];var utils=require(_0xd0f4('0x3'));var logger=require(_0xd0f4('0x4'))(_0xd0f4('0x5'));var config=require(_0xd0f4('0x6'));var jayson=require(_0xd0f4('0x7'));var client=jayson[_0xd0f4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1164da,_0x27acb8,_0x4d0ab0){return new BPromise(function(_0x3992be,_0x2a0057){return client['request'](_0x1164da,_0x4d0ab0)[_0xd0f4('0x9')](function(_0x2570f0){logger['info'](_0xd0f4('0xa'),_0x27acb8,_0xd0f4('0xb'));logger[_0xd0f4('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x27acb8,'request\x20sent',JSON[_0xd0f4('0xd')](_0x2570f0));if(_0x2570f0[_0xd0f4('0xe')]){if(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0xf')]===0x1f4){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x2570f0[_0xd0f4('0xe')]['message']);return _0x2a0057(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0x10')]);}logger['error'](_0xd0f4('0xa'),_0x27acb8,_0x2570f0['error'][_0xd0f4('0x10')]);return _0x3992be(_0x2570f0['error'][_0xd0f4('0x10')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x27acb8,'request\x20sent');_0x3992be(_0x2570f0[_0xd0f4('0x11')][_0xd0f4('0x10')]);}})[_0xd0f4('0x12')](function(_0x46c005){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x46c005);_0x2a0057(_0x46c005);});});}exports[_0xd0f4('0x13')]=function(_0x35be48){var _0x247cff=this;return new Promise(function(_0x5de07b,_0xb7169b){return db[_0xd0f4('0x14')][_0xd0f4('0x15')]({'raw':_0x35be48[_0xd0f4('0x16')]?_0x35be48['options'][_0xd0f4('0x17')]===undefined?!![]:![]:!![],'where':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x18')]||null:null,'attributes':_0x35be48['options']?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x19')]||null:null,'limit':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x1a')]||null:null,'include':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')]['include']?_[_0xd0f4('0x1b')](_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x1c')],function(_0x299904){return{'model':db[_0x299904['model']],'as':_0x299904['as'],'attributes':_0x299904[_0xd0f4('0x19')],'include':_0x299904['include']?_[_0xd0f4('0x1b')](_0x299904[_0xd0f4('0x1c')],function(_0x1cf493){return{'model':db[_0x1cf493['model']],'as':_0x1cf493['as'],'attributes':_0x1cf493[_0xd0f4('0x19')],'include':_0x1cf493[_0xd0f4('0x1c')]?_[_0xd0f4('0x1b')](_0x1cf493[_0xd0f4('0x1c')],function(_0x366af6){return{'model':db[_0x366af6['model']],'as':_0x366af6['as'],'attributes':_0x366af6[_0xd0f4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0f4('0x9')](function(_0x1b36c2){logger[_0xd0f4('0x1d')](_0xd0f4('0x13'),_0x35be48);logger[_0xd0f4('0xc')](_0xd0f4('0x13'),_0x35be48,JSON[_0xd0f4('0xd')](_0x1b36c2));_0x5de07b(_0x1b36c2);})[_0xd0f4('0x12')](function(_0x4cff90){logger[_0xd0f4('0xe')](_0xd0f4('0x13'),_0x4cff90[_0xd0f4('0x10')],_0x35be48);_0xb7169b(_0x247cff[_0xd0f4('0xe')](0x1f4,_0x4cff90['message']));});});};exports[_0xd0f4('0x1e')]=function(_0x52a22a){var _0x4f92a9=this;return new Promise(function(_0x4f7fd3,_0x22f599){return db[_0xd0f4('0x14')][_0xd0f4('0x1f')](_0x52a22a[_0xd0f4('0x20')],{'raw':_0x52a22a[_0xd0f4('0x16')]?_0x52a22a[_0xd0f4('0x16')][_0xd0f4('0x17')]===undefined?!![]:![]:!![]})[_0xd0f4('0x9')](function(_0x55f23f){logger[_0xd0f4('0x1d')]('CreateMemberReport',_0x52a22a);logger[_0xd0f4('0xc')](_0xd0f4('0x1e'),_0x52a22a,JSON['stringify'](_0x55f23f));_0x4f7fd3(_0x55f23f);})['catch'](function(_0x35632c){logger['error'](_0xd0f4('0x1e'),_0x35632c[_0xd0f4('0x10')],_0x52a22a);_0x22f599(_0x4f92a9['error'](0x1f4,_0x35632c[_0xd0f4('0x10')]));});});};exports[_0xd0f4('0x21')]=function(_0x4b722f){var _0x590a66=this;return new Promise(function(_0x3605fe,_0x1f22d3){return db['MemberReport'][_0xd0f4('0x22')](_0x4b722f['body'],{'raw':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')][_0xd0f4('0x18')]||null:null,'attributes':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')]['attributes']||null:null,'limit':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')][_0xd0f4('0x1a')]||null:null})[_0xd0f4('0x9')](function(_0x4ccdf2){logger[_0xd0f4('0x1d')](_0xd0f4('0x21'),_0x4b722f);logger[_0xd0f4('0xc')](_0xd0f4('0x21'),_0x4b722f,JSON[_0xd0f4('0xd')](_0x4ccdf2));_0x3605fe(_0x4ccdf2);})[_0xd0f4('0x12')](function(_0x4ff5f6){logger[_0xd0f4('0xe')](_0xd0f4('0x21'),_0x4ff5f6[_0xd0f4('0x10')],_0x4b722f);_0x1f22d3(_0x590a66['error'](0x1f4,_0x4ff5f6[_0xd0f4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2081e2d..8b58a67 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 _0xbbd8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express'];(function(_0x13033f,_0x2045af){var _0x2ed576=function(_0x491a78){while(--_0x491a78){_0x13033f['push'](_0x13033f['shift']());}};_0x2ed576(++_0x2045af);}(_0xbbd8,0x174));var _0x8bbd=function(_0x6abbe8,_0x393550){_0x6abbe8=_0x6abbe8-0x0;var _0x10b56f=_0xbbd8[_0x6abbe8];return _0x10b56f;};'use strict';var multer=require(_0x8bbd('0x0'));var util=require(_0x8bbd('0x1'));var path=require(_0x8bbd('0x2'));var timeout=require(_0x8bbd('0x3'));var express=require(_0x8bbd('0x4'));var router=express['Router']();var fs_extra=require(_0x8bbd('0x5'));var auth=require(_0x8bbd('0x6'));var interaction=require(_0x8bbd('0x7'));var config=require(_0x8bbd('0x8'));var controller=require(_0x8bbd('0x9'));router[_0x8bbd('0xa')]('/',controller[_0x8bbd('0xb')]);module[_0x8bbd('0xc')]=router; \ No newline at end of file +var _0x03f0=['../../components/interaction/service','../../config/environment','get','index','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57db65,_0x205aca){var _0x3c580b=function(_0x1e15e9){while(--_0x1e15e9){_0x57db65['push'](_0x57db65['shift']());}};_0x3c580b(++_0x205aca);}(_0x03f0,0x1b2));var _0x003f=function(_0x111f04,_0x4d17fd){_0x111f04=_0x111f04-0x0;var _0x252b1f=_0x03f0[_0x111f04];return _0x252b1f;};'use strict';var multer=require('multer');var util=require(_0x003f('0x0'));var path=require('path');var timeout=require(_0x003f('0x1'));var express=require(_0x003f('0x2'));var router=express[_0x003f('0x3')]();var fs_extra=require(_0x003f('0x4'));var auth=require(_0x003f('0x5'));var interaction=require(_0x003f('0x6'));var config=require(_0x003f('0x7'));var controller=require('./migration.controller');router[_0x003f('0x8')]('/',controller[_0x003f('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 64d0f3f..ca6578e 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 _0x2426=['STRING','version','exports'];(function(_0x2612a5,_0x230f56){var _0x3b54ad=function(_0x31254d){while(--_0x31254d){_0x2612a5['push'](_0x2612a5['shift']());}};_0x3b54ad(++_0x230f56);}(_0x2426,0xb3));var _0x6242=function(_0x6c4580,_0x52c01c){_0x6c4580=_0x6c4580-0x0;var _0xabfd37=_0x2426[_0x6c4580];return _0xabfd37;};'use strict';var Sequelize=require('sequelize');module[_0x6242('0x0')]={'version':{'type':Sequelize[_0x6242('0x1')],'unique':_0x6242('0x2')}}; \ No newline at end of file +var _0xad8b=['sequelize','exports','version'];(function(_0x1f8798,_0xfbbfd4){var _0x10c6be=function(_0x92c5a7){while(--_0x92c5a7){_0x1f8798['push'](_0x1f8798['shift']());}};_0x10c6be(++_0xfbbfd4);}(_0xad8b,0x16e));var _0xbad8=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xad8b[_0x2211ed];return _0x4d78cc;};'use strict';var Sequelize=require(_0xbad8('0x0'));module[_0xbad8('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xbad8('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 344e429..1601ddd 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 _0xf360=['set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','options','Migration','includeAll','include','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','count','offset'];(function(_0x5701e0,_0x257720){var _0x1c7aa0=function(_0x55d3fb){while(--_0x55d3fb){_0x5701e0['push'](_0x5701e0['shift']());}};_0x1c7aa0(++_0x257720);}(_0xf360,0x13c));var _0x0f36=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf360[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x0f36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f36('0x1'));var jsonpatch=require(_0x0f36('0x2'));var rp=require(_0x0f36('0x3'));var moment=require(_0x0f36('0x4'));var BPromise=require(_0x0f36('0x5'));var Mustache=require('mustache');var util=require(_0x0f36('0x6'));var path=require(_0x0f36('0x7'));var sox=require(_0x0f36('0x8'));var csv=require(_0x0f36('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f36('0xa'));var _=require(_0x0f36('0xb'));var squel=require(_0x0f36('0xc'));var crypto=require(_0x0f36('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0f36('0xe'));var toCsv=require(_0x0f36('0x9'));var querystring=require('querystring');var Papa=require(_0x0f36('0xf'));var Redis=require(_0x0f36('0x10'));var authService=require(_0x0f36('0x11'));var qs=require(_0x0f36('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f36('0x13'));var logger=require(_0x0f36('0x14'))(_0x0f36('0x15'));var utils=require(_0x0f36('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f36('0x17'))['db'];function respondWithStatusCode(_0x3427eb,_0x37f9cf){_0x37f9cf=_0x37f9cf||0xcc;return function(_0x3b4852){if(_0x3b4852){return _0x3427eb['sendStatus'](_0x37f9cf);}return _0x3427eb[_0x0f36('0x18')](_0x37f9cf)['end']();};}function respondWithResult(_0x532fea,_0x2bd012){_0x2bd012=_0x2bd012||0xc8;return function(_0x5435ec){if(_0x5435ec){return _0x532fea[_0x0f36('0x18')](_0x2bd012)[_0x0f36('0x19')](_0x5435ec);}};}function respondWithFilteredResult(_0x17980a,_0x4462e0){return function(_0x3c85b8){if(_0x3c85b8){var _0x40721a=typeof _0x4462e0['offset']===_0x0f36('0x1a')&&typeof _0x4462e0['limit']===_0x0f36('0x1a');var _0x1a0070=_0x3c85b8[_0x0f36('0x1b')];var _0x3b6956=_0x40721a?0x0:_0x4462e0[_0x0f36('0x1c')];var _0x7e27c1=_0x40721a?_0x3c85b8[_0x0f36('0x1b')]:_0x4462e0['offset']+_0x4462e0['limit'];var _0x41daa4;if(_0x7e27c1>=_0x1a0070){_0x7e27c1=_0x1a0070;_0x41daa4=0xc8;}else{_0x41daa4=0xce;}_0x17980a[_0x0f36('0x18')](_0x41daa4);return _0x17980a[_0x0f36('0x1d')](_0x0f36('0x1e'),_0x3b6956+'-'+_0x7e27c1+'/'+_0x1a0070)[_0x0f36('0x19')](_0x3c85b8);}return null;};}function patchUpdates(_0x507541){return function(_0x634bd2){try{jsonpatch[_0x0f36('0x1f')](_0x634bd2,_0x507541,!![]);}catch(_0x325849){return BPromise[_0x0f36('0x20')](_0x325849);}return _0x634bd2[_0x0f36('0x21')]();};}function saveUpdates(_0x59fccb,_0x18c1d6){return function(_0x20f999){if(_0x20f999){return _0x20f999[_0x0f36('0x22')](_0x59fccb)[_0x0f36('0x23')](function(_0x4cc2cd){return _0x4cc2cd;});}return null;};}function removeEntity(_0x1a3c54,_0x1de3fc){return function(_0x11cf86){if(_0x11cf86){return _0x11cf86[_0x0f36('0x24')]()[_0x0f36('0x23')](function(){_0x1a3c54[_0x0f36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2690b,_0x382a85){return function(_0x2a55e9){if(!_0x2a55e9){_0xe2690b[_0x0f36('0x25')](0x194);}return _0x2a55e9;};}function handleError(_0x24b785,_0x374c27){_0x374c27=_0x374c27||0x1f4;return function(_0x283d2e){logger['error'](_0x283d2e[_0x0f36('0x26')]);if(_0x283d2e[_0x0f36('0x27')]){delete _0x283d2e['name'];}_0x24b785[_0x0f36('0x18')](_0x374c27)[_0x0f36('0x28')](_0x283d2e);};}exports[_0x0f36('0x29')]=function(_0x137568,_0x362c0d){var _0x68b82a={},_0x42119d={},_0x3cfd9a={'count':0x0,'rows':[]};var _0x521b40=_[_0x0f36('0x2a')](db['Migration'][_0x0f36('0x2b')],function(_0x4aadef){return{'name':_0x4aadef['fieldName'],'type':_0x4aadef['type'][_0x0f36('0x2c')]};});_0x42119d[_0x0f36('0x2d')]=_[_0x0f36('0x2a')](_0x521b40,_0x0f36('0x27'));_0x42119d[_0x0f36('0x2e')]=_[_0x0f36('0x2f')](_0x137568[_0x0f36('0x2e')]);_0x42119d['filters']=_[_0x0f36('0x30')](_0x42119d[_0x0f36('0x2d')],_0x42119d[_0x0f36('0x2e')]);_0x68b82a['attributes']=_['intersection'](_0x42119d[_0x0f36('0x2d')],qs[_0x0f36('0x31')](_0x137568[_0x0f36('0x2e')][_0x0f36('0x31')]));_0x68b82a['attributes']=_0x68b82a[_0x0f36('0x32')][_0x0f36('0x33')]?_0x68b82a[_0x0f36('0x32')]:_0x42119d[_0x0f36('0x2d')];if(!_0x137568[_0x0f36('0x2e')][_0x0f36('0x34')](_0x0f36('0x35'))){_0x68b82a[_0x0f36('0x36')]=qs['limit'](_0x137568[_0x0f36('0x2e')]['limit']);_0x68b82a[_0x0f36('0x1c')]=qs['offset'](_0x137568[_0x0f36('0x2e')][_0x0f36('0x1c')]);}_0x68b82a[_0x0f36('0x37')]=qs[_0x0f36('0x38')](_0x137568['query'][_0x0f36('0x38')]);_0x68b82a[_0x0f36('0x39')]=qs[_0x0f36('0x3a')](_[_0x0f36('0x3b')](_0x137568[_0x0f36('0x2e')],_0x42119d[_0x0f36('0x3a')]),_0x521b40);if(_0x137568[_0x0f36('0x2e')][_0x0f36('0x3c')]){_0x68b82a[_0x0f36('0x39')]=_[_0x0f36('0x3d')](_0x68b82a[_0x0f36('0x39')],{'$or':_[_0x0f36('0x2a')](_0x521b40,function(_0xe2456d){if(_0xe2456d[_0x0f36('0x3e')]!=='VIRTUAL'){var _0x15e833={};_0x15e833[_0xe2456d[_0x0f36('0x27')]]={'$like':'%'+_0x137568[_0x0f36('0x2e')][_0x0f36('0x3c')]+'%'};return _0x15e833;}})});}_0x68b82a=_[_0x0f36('0x3d')]({},_0x68b82a,_0x137568[_0x0f36('0x3f')]);var _0xf70e2a={'where':_0x68b82a[_0x0f36('0x39')]};return db[_0x0f36('0x40')][_0x0f36('0x1b')](_0xf70e2a)[_0x0f36('0x23')](function(_0x5f14ac){_0x3cfd9a[_0x0f36('0x1b')]=_0x5f14ac;if(_0x137568[_0x0f36('0x2e')][_0x0f36('0x41')]){_0x68b82a[_0x0f36('0x42')]=[{'all':!![]}];}return db[_0x0f36('0x40')]['findAll'](_0x68b82a);})[_0x0f36('0x23')](function(_0x3fe641){_0x3cfd9a[_0x0f36('0x43')]=_0x3fe641;return _0x3cfd9a;})[_0x0f36('0x23')](respondWithFilteredResult(_0x362c0d,_0x68b82a))[_0x0f36('0x44')](handleError(_0x362c0d,null));}; \ No newline at end of file +var _0x5c1f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','Migration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x5c1f[_0x4d180c];return _0x49b57e;};'use strict';var emlformat=require(_0xf5c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5c1('0x1'));var jsonpatch=require(_0xf5c1('0x2'));var rp=require('request-promise');var moment=require(_0xf5c1('0x3'));var BPromise=require(_0xf5c1('0x4'));var Mustache=require(_0xf5c1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf5c1('0x6'));var ejs=require(_0xf5c1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5c1('0x8'));var squel=require(_0xf5c1('0x9'));var crypto=require(_0xf5c1('0xa'));var jsforce=require(_0xf5c1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf5c1('0xc'));var authService=require(_0xf5c1('0xd'));var qs=require(_0xf5c1('0xe'));var as=require(_0xf5c1('0xf'));var hardwareService=require(_0xf5c1('0x10'));var logger=require(_0xf5c1('0x11'))(_0xf5c1('0x12'));var utils=require(_0xf5c1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf5c1('0x14'));var db=require(_0xf5c1('0x15'))['db'];function respondWithStatusCode(_0x252b9f,_0x3519b4){_0x3519b4=_0x3519b4||0xcc;return function(_0x26c748){if(_0x26c748){return _0x252b9f['sendStatus'](_0x3519b4);}return _0x252b9f[_0xf5c1('0x16')](_0x3519b4)['end']();};}function respondWithResult(_0x45bf57,_0x42f44f){_0x42f44f=_0x42f44f||0xc8;return function(_0x2eb021){if(_0x2eb021){return _0x45bf57['status'](_0x42f44f)[_0xf5c1('0x17')](_0x2eb021);}};}function respondWithFilteredResult(_0x11ff7a,_0x2fe583){return function(_0x42234e){if(_0x42234e){var _0x5891a9=typeof _0x2fe583[_0xf5c1('0x18')]===_0xf5c1('0x19')&&typeof _0x2fe583[_0xf5c1('0x1a')]===_0xf5c1('0x19');var _0x32e05a=_0x42234e['count'];var _0x46d8e4=_0x5891a9?0x0:_0x2fe583[_0xf5c1('0x18')];var _0x2d1db9=_0x5891a9?_0x42234e[_0xf5c1('0x1b')]:_0x2fe583[_0xf5c1('0x18')]+_0x2fe583[_0xf5c1('0x1a')];var _0x199e25;if(_0x2d1db9>=_0x32e05a){_0x2d1db9=_0x32e05a;_0x199e25=0xc8;}else{_0x199e25=0xce;}_0x11ff7a[_0xf5c1('0x16')](_0x199e25);return _0x11ff7a['set'](_0xf5c1('0x1c'),_0x46d8e4+'-'+_0x2d1db9+'/'+_0x32e05a)[_0xf5c1('0x17')](_0x42234e);}return null;};}function patchUpdates(_0x4c360a){return function(_0x113b04){try{jsonpatch[_0xf5c1('0x1d')](_0x113b04,_0x4c360a,!![]);}catch(_0x1dd38c){return BPromise[_0xf5c1('0x1e')](_0x1dd38c);}return _0x113b04[_0xf5c1('0x1f')]();};}function saveUpdates(_0x65d095,_0x2383f8){return function(_0x4955d6){if(_0x4955d6){return _0x4955d6[_0xf5c1('0x20')](_0x65d095)[_0xf5c1('0x21')](function(_0x6b2a5d){return _0x6b2a5d;});}return null;};}function removeEntity(_0x5e99a8,_0x1d17cd){return function(_0x3f6ac8){if(_0x3f6ac8){return _0x3f6ac8[_0xf5c1('0x22')]()[_0xf5c1('0x21')](function(){_0x5e99a8['status'](0xcc)[_0xf5c1('0x23')]();});}};}function handleEntityNotFound(_0x2acb65,_0x38bcb2){return function(_0x237b70){if(!_0x237b70){_0x2acb65['sendStatus'](0x194);}return _0x237b70;};}function handleError(_0x505bfe,_0x46f866){_0x46f866=_0x46f866||0x1f4;return function(_0x12c706){logger[_0xf5c1('0x24')](_0x12c706[_0xf5c1('0x25')]);if(_0x12c706['name']){delete _0x12c706[_0xf5c1('0x26')];}_0x505bfe[_0xf5c1('0x16')](_0x46f866)['send'](_0x12c706);};}exports['index']=function(_0x3ac679,_0x291088){var _0x380178={},_0x36fff6={},_0x5eb7cd={'count':0x0,'rows':[]};var _0x24ff24=_[_0xf5c1('0x27')](db[_0xf5c1('0x28')][_0xf5c1('0x29')],function(_0x4670ad){return{'name':_0x4670ad[_0xf5c1('0x2a')],'type':_0x4670ad['type'][_0xf5c1('0x2b')]};});_0x36fff6[_0xf5c1('0x2c')]=_['map'](_0x24ff24,'name');_0x36fff6[_0xf5c1('0x2d')]=_['keys'](_0x3ac679[_0xf5c1('0x2d')]);_0x36fff6[_0xf5c1('0x2e')]=_[_0xf5c1('0x2f')](_0x36fff6[_0xf5c1('0x2c')],_0x36fff6[_0xf5c1('0x2d')]);_0x380178[_0xf5c1('0x30')]=_[_0xf5c1('0x2f')](_0x36fff6[_0xf5c1('0x2c')],qs[_0xf5c1('0x31')](_0x3ac679[_0xf5c1('0x2d')]['fields']));_0x380178[_0xf5c1('0x30')]=_0x380178[_0xf5c1('0x30')][_0xf5c1('0x32')]?_0x380178[_0xf5c1('0x30')]:_0x36fff6[_0xf5c1('0x2c')];if(!_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x33')](_0xf5c1('0x34'))){_0x380178[_0xf5c1('0x1a')]=qs['limit'](_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x1a')]);_0x380178[_0xf5c1('0x18')]=qs[_0xf5c1('0x18')](_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x18')]);}_0x380178[_0xf5c1('0x35')]=qs[_0xf5c1('0x36')](_0x3ac679['query'][_0xf5c1('0x36')]);_0x380178[_0xf5c1('0x37')]=qs[_0xf5c1('0x2e')](_[_0xf5c1('0x38')](_0x3ac679[_0xf5c1('0x2d')],_0x36fff6[_0xf5c1('0x2e')]),_0x24ff24);if(_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x39')]){_0x380178['where']=_[_0xf5c1('0x3a')](_0x380178[_0xf5c1('0x37')],{'$or':_[_0xf5c1('0x27')](_0x24ff24,function(_0x1e536b){if(_0x1e536b['type']!==_0xf5c1('0x3b')){var _0x30798d={};_0x30798d[_0x1e536b[_0xf5c1('0x26')]]={'$like':'%'+_0x3ac679['query'][_0xf5c1('0x39')]+'%'};return _0x30798d;}})});}_0x380178=_['merge']({},_0x380178,_0x3ac679[_0xf5c1('0x3c')]);var _0x4c43cc={'where':_0x380178[_0xf5c1('0x37')]};return db[_0xf5c1('0x28')][_0xf5c1('0x1b')](_0x4c43cc)[_0xf5c1('0x21')](function(_0x11e57d){_0x5eb7cd[_0xf5c1('0x1b')]=_0x11e57d;if(_0x3ac679['query']['includeAll']){_0x380178['include']=[{'all':!![]}];}return db['Migration'][_0xf5c1('0x3d')](_0x380178);})[_0xf5c1('0x21')](function(_0x46aa33){_0x5eb7cd[_0xf5c1('0x3e')]=_0x46aa33;return _0x5eb7cd;})[_0xf5c1('0x21')](respondWithFilteredResult(_0x291088,_0x380178))[_0xf5c1('0x3f')](handleError(_0x291088,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index d8ac95b..2f3dd57 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 _0x8a32=['util','api','moment','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x470b6f,_0x834065){var _0x59b5bf=function(_0x134bf7){while(--_0x134bf7){_0x470b6f['push'](_0x470b6f['shift']());}};_0x59b5bf(++_0x834065);}(_0x8a32,0x176));var _0x28a3=function(_0x7dc57d,_0x45d036){_0x7dc57d=_0x7dc57d-0x0;var _0x53acfa=_0x8a32[_0x7dc57d];return _0x53acfa;};'use strict';var _=require('lodash');var util=require(_0x28a3('0x0'));var logger=require('../../config/logger')(_0x28a3('0x1'));var moment=require(_0x28a3('0x2'));var BPromise=require('bluebird');var rp=require(_0x28a3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28a3('0x4'));var config=require(_0x28a3('0x5'));var attributes=require(_0x28a3('0x6'));module[_0x28a3('0x7')]=function(_0x3f9434,_0x1f3ab2){return _0x3f9434[_0x28a3('0x8')](_0x28a3('0x9'),attributes,{'tableName':_0x28a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff8f=['path','rimraf','../../config/environment','./migration.attributes','exports','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x495c65,_0x1325c1){var _0x1e70b9=function(_0x3b2bac){while(--_0x3b2bac){_0x495c65['push'](_0x495c65['shift']());}};_0x1e70b9(++_0x1325c1);}(_0xff8f,0x6e));var _0xfff8=function(_0x1e173d,_0x446a27){_0x1e173d=_0x1e173d-0x0;var _0x55be3d=_0xff8f[_0x1e173d];return _0x55be3d;};'use strict';var _=require(_0xfff8('0x0'));var util=require(_0xfff8('0x1'));var logger=require(_0xfff8('0x2'))(_0xfff8('0x3'));var moment=require(_0xfff8('0x4'));var BPromise=require(_0xfff8('0x5'));var rp=require(_0xfff8('0x6'));var fs=require('fs');var path=require(_0xfff8('0x7'));var rimraf=require(_0xfff8('0x8'));var config=require(_0xfff8('0x9'));var attributes=require(_0xfff8('0xa'));module[_0xfff8('0xb')]=function(_0x4bb1df,_0x4d2f5b){return _0x4bb1df['define']('Migration',attributes,{'tableName':_0xfff8('0xc'),'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 5b8f697..06efe24 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 _0x25b5=['info','request\x20sent','stringify','error','code','message','Migration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then'];(function(_0x4d2a90,_0x4c4eca){var _0x264f56=function(_0x184d5a){while(--_0x184d5a){_0x4d2a90['push'](_0x4d2a90['shift']());}};_0x264f56(++_0x4c4eca);}(_0x25b5,0x198));var _0x525b=function(_0x46ce91,_0x4c93ad){_0x46ce91=_0x46ce91-0x0;var _0x5a4ba8=_0x25b5[_0x46ce91];return _0x5a4ba8;};'use strict';var _=require(_0x525b('0x0'));var util=require(_0x525b('0x1'));var moment=require(_0x525b('0x2'));var BPromise=require(_0x525b('0x3'));var rs=require(_0x525b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x525b('0x5'))['db'];var utils=require(_0x525b('0x6'));var logger=require(_0x525b('0x7'))(_0x525b('0x8'));var config=require(_0x525b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x525b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x511ef5,_0x4d6f5b,_0x17b475){return new BPromise(function(_0x3ef6f1,_0x1656ac){return client['request'](_0x511ef5,_0x17b475)[_0x525b('0xb')](function(_0x1b2d14){logger[_0x525b('0xc')]('Migration,\x20%s,\x20%s',_0x4d6f5b,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x4d6f5b,_0x525b('0xd'),JSON[_0x525b('0xe')](_0x1b2d14));if(_0x1b2d14['error']){if(_0x1b2d14[_0x525b('0xf')][_0x525b('0x10')]===0x1f4){logger[_0x525b('0xf')]('Migration,\x20%s,\x20%s',_0x4d6f5b,_0x1b2d14['error'][_0x525b('0x11')]);return _0x1656ac(_0x1b2d14[_0x525b('0xf')][_0x525b('0x11')]);}logger[_0x525b('0xf')](_0x525b('0x12'),_0x4d6f5b,_0x1b2d14[_0x525b('0xf')][_0x525b('0x11')]);return _0x3ef6f1(_0x1b2d14[_0x525b('0xf')][_0x525b('0x11')]);}else{logger[_0x525b('0xc')](_0x525b('0x12'),_0x4d6f5b,'request\x20sent');_0x3ef6f1(_0x1b2d14[_0x525b('0x13')][_0x525b('0x11')]);}})[_0x525b('0x14')](function(_0x4d523f){logger['error'](_0x525b('0x12'),_0x4d6f5b,_0x4d523f);_0x1656ac(_0x4d523f);});});} \ No newline at end of file +var _0x9f94=['debug','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x2278de,_0x25cc69){var _0x3ed51f=function(_0x406c52){while(--_0x406c52){_0x2278de['push'](_0x2278de['shift']());}};_0x3ed51f(++_0x25cc69);}(_0x9f94,0x1e7));var _0x49f9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9f94[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 8f5bdbd..993b1eb 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 _0x508a=['get','show','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index'];(function(_0x41fe02,_0x2b646d){var _0x976c9c=function(_0x5c0a3e){while(--_0x5c0a3e){_0x41fe02['push'](_0x41fe02['shift']());}};_0x976c9c(++_0x2b646d);}(_0x508a,0x1aa));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa508('0x0'));var util=require('util');var path=require(_0xa508('0x1'));var timeout=require(_0xa508('0x2'));var express=require(_0xa508('0x3'));var router=express[_0xa508('0x4')]();var fs_extra=require(_0xa508('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa508('0x6'));var config=require(_0xa508('0x7'));var controller=require(_0xa508('0x8'));router['get']('/',auth[_0xa508('0x9')](),controller[_0xa508('0xa')]);router[_0xa508('0xb')]('/:id',auth[_0xa508('0x9')](),controller[_0xa508('0xc')]);router['post']('/',auth[_0xa508('0x9')](),controller[_0xa508('0xd')]);router['put'](_0xa508('0xe'),auth[_0xa508('0x9')](),controller[_0xa508('0xf')]);router[_0xa508('0x10')](_0xa508('0xe'),auth['isAuthenticated'](),controller[_0xa508('0x11')]);module[_0xa508('0x12')]=router; \ No newline at end of file +var _0x2bbc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bbc,0x1ea));var _0xc2bb=function(_0x500d43,_0x58db3b){_0x500d43=_0x500d43-0x0;var _0x34d7eb=_0x2bbc[_0x500d43];return _0x34d7eb;};'use strict';var multer=require(_0xc2bb('0x0'));var util=require(_0xc2bb('0x1'));var path=require(_0xc2bb('0x2'));var timeout=require(_0xc2bb('0x3'));var express=require('express');var router=express[_0xc2bb('0x4')]();var fs_extra=require(_0xc2bb('0x5'));var auth=require(_0xc2bb('0x6'));var interaction=require(_0xc2bb('0x7'));var config=require(_0xc2bb('0x8'));var controller=require(_0xc2bb('0x9'));router['get']('/',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xb')]);router[_0xc2bb('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xd')]);router[_0xc2bb('0xe')]('/:id',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xf')]);router[_0xc2bb('0x10')](_0xc2bb('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xc2bb('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 1e783f4..d3473f3 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 _0x903a=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0x143d70,_0x25e5e3){var _0x26f063=function(_0x52ba29){while(--_0x52ba29){_0x143d70['push'](_0x143d70['shift']());}};_0x26f063(++_0x25e5e3);}(_0x903a,0x149));var _0xa903=function(_0x18c671,_0x2c7ac5){_0x18c671=_0x18c671-0x0;var _0x2959fe=_0x903a[_0x18c671];return _0x2959fe;};'use strict';var Sequelize=require(_0xa903('0x0'));module[_0xa903('0x1')]={'type':{'type':Sequelize[_0xa903('0x2')](_0xa903('0x3'),_0xa903('0x4'),_0xa903('0x5'),_0xa903('0x6'))},'value':{'type':Sequelize[_0xa903('0x7')]},'username':{'type':Sequelize[_0xa903('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x06ba=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x4ec87a,_0x4ac569){var _0xf825fc=function(_0x17be2d){while(--_0x17be2d){_0x4ec87a['push'](_0x4ec87a['shift']());}};_0xf825fc(++_0x4ac569);}(_0x06ba,0x16e));var _0xa06b=function(_0x143e75,_0x86607e){_0x143e75=_0x143e75-0x0;var _0x26371b=_0x06ba[_0x143e75];return _0x26371b;};'use strict';var Sequelize=require(_0xa06b('0x0'));module[_0xa06b('0x1')]={'type':{'type':Sequelize[_0xa06b('0x2')](_0xa06b('0x3'),_0xa06b('0x4'),_0xa06b('0x5'),_0xa06b('0x6'))},'value':{'type':Sequelize[_0xa06b('0x7')]},'username':{'type':Sequelize[_0xa06b('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9a3a52f..a4f5bcc 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 _0xf41c=['sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','send','index','map','Network','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','show','params','find','create','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','sequelize','transaction','/etc/asterisk/sip_xcally_%s.conf','body','destroy','findAll','TURN','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xf41c,0x1a6));var _0xcf41=function(_0x52b956,_0x11fcc8){_0x52b956=_0x52b956-0x0;var _0x5197e7=_0xf41c[_0x52b956];return _0x5197e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf41('0x1'));var rp=require('request-promise');var moment=require(_0xcf41('0x2'));var BPromise=require(_0xcf41('0x3'));var Mustache=require(_0xcf41('0x4'));var util=require('util');var path=require(_0xcf41('0x5'));var sox=require(_0xcf41('0x6'));var csv=require(_0xcf41('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf41('0x8'));var _=require(_0xcf41('0x9'));var squel=require(_0xcf41('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf41('0xb'));var deskjs=require(_0xcf41('0xc'));var toCsv=require(_0xcf41('0x7'));var querystring=require(_0xcf41('0xd'));var Papa=require(_0xcf41('0xe'));var Redis=require(_0xcf41('0xf'));var authService=require(_0xcf41('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcf41('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf41('0x12'))(_0xcf41('0x13'));var utils=require('../../config/utils');var config=require(_0xcf41('0x14'));var licenseUtil=require(_0xcf41('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xcf41('0x16')][_0xcf41('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x469977,_0x931b98,_0x2213c7,_0x445dc8){return new BPromise(function(_0x1d28de,_0x434a07){var _0x49fc28=_0x445dc8||client;return _0x49fc28['request'](_0x469977,_0x2213c7)[_0xcf41('0x18')](function(_0x518da6){logger[_0xcf41('0x19')](_0xcf41('0x1a'),_0x931b98,_0xcf41('0x1b'));logger[_0xcf41('0x1c')](_0xcf41('0x1d'),_0x931b98,_0xcf41('0x1b'),JSON[_0xcf41('0x1e')](_0x518da6));if(_0x518da6[_0xcf41('0x1f')]){if(_0x518da6[_0xcf41('0x1f')][_0xcf41('0x20')]===0x1f4){logger['error'](_0xcf41('0x1a'),_0x931b98,_0x518da6[_0xcf41('0x1f')][_0xcf41('0x21')]);return _0x434a07(_0x518da6[_0xcf41('0x1f')][_0xcf41('0x21')]);}logger['error'](_0xcf41('0x1a'),_0x931b98,_0x518da6[_0xcf41('0x1f')]['message']);return _0x1d28de(_0x518da6[_0xcf41('0x1f')]['message']);}else{logger['info'](_0xcf41('0x1a'),_0x931b98,_0xcf41('0x1b'));_0x1d28de(_0x518da6[_0xcf41('0x22')][_0xcf41('0x21')]);}})[_0xcf41('0x23')](function(_0x5cf525){logger[_0xcf41('0x1f')](_0xcf41('0x1a'),_0x931b98,_0x5cf525);_0x434a07(_0x5cf525);});});}function respondWithStatusCode(_0x2cd37b,_0xb8731f){_0xb8731f=_0xb8731f||0xcc;return function(_0x21763f){if(_0x21763f){return _0x2cd37b['sendStatus'](_0xb8731f);}return _0x2cd37b[_0xcf41('0x24')](_0xb8731f)[_0xcf41('0x25')]();};}function respondWithResult(_0x573e03,_0x4ca2ca){_0x4ca2ca=_0x4ca2ca||0xc8;return function(_0x532f65){if(_0x532f65){return _0x573e03[_0xcf41('0x24')](_0x4ca2ca)[_0xcf41('0x26')](_0x532f65);}};}function respondWithFilteredResult(_0x11b8e7,_0x2976cd){return function(_0xcec6d1){if(_0xcec6d1){var _0x29991c=typeof _0x2976cd['offset']===_0xcf41('0x27')&&typeof _0x2976cd[_0xcf41('0x28')]==='undefined';var _0x573a24=_0xcec6d1[_0xcf41('0x29')];var _0x6a1041=_0x29991c?0x0:_0x2976cd['offset'];var _0x221d8=_0x29991c?_0xcec6d1[_0xcf41('0x29')]:_0x2976cd['offset']+_0x2976cd[_0xcf41('0x28')];var _0x17ee24;if(_0x221d8>=_0x573a24){_0x221d8=_0x573a24;_0x17ee24=0xc8;}else{_0x17ee24=0xce;}_0x11b8e7[_0xcf41('0x24')](_0x17ee24);return _0x11b8e7[_0xcf41('0x2a')](_0xcf41('0x2b'),_0x6a1041+'-'+_0x221d8+'/'+_0x573a24)[_0xcf41('0x26')](_0xcec6d1);}return null;};}function patchUpdates(_0x575772){return function(_0xec3461){try{jsonpatch[_0xcf41('0x2c')](_0xec3461,_0x575772,!![]);}catch(_0x20ecf1){return BPromise[_0xcf41('0x2d')](_0x20ecf1);}return _0xec3461[_0xcf41('0x2e')]();};}function saveUpdates(_0x4c87f3,_0x40dee3){return function(_0x15c9f9){if(_0x15c9f9){return _0x15c9f9[_0xcf41('0x2f')](_0x4c87f3)[_0xcf41('0x18')](function(_0x4b6385){return _0x4b6385;});}return null;};}function removeEntity(_0x2a3d27,_0x3939a7){return function(_0x22f507){if(_0x22f507){return _0x22f507['destroy']()[_0xcf41('0x18')](function(){_0x2a3d27['status'](0xcc)[_0xcf41('0x25')]();});}};}function handleEntityNotFound(_0x541c04,_0x4f5cdd){return function(_0x27e319){if(!_0x27e319){_0x541c04[_0xcf41('0x30')](0x194);}return _0x27e319;};}function handleError(_0x39bf23,_0x319db5){_0x319db5=_0x319db5||0x1f4;return function(_0x233cae){logger[_0xcf41('0x1f')](_0x233cae[_0xcf41('0x31')]);if(_0x233cae['name']){delete _0x233cae['name'];}_0x39bf23[_0xcf41('0x24')](_0x319db5)[_0xcf41('0x32')](_0x233cae);};}exports[_0xcf41('0x33')]=function(_0x24ae08,_0xd6f4bc){var _0x2ec113={},_0x443253={},_0x5af48e={'count':0x0,'rows':[]};var _0x3d9e90=_[_0xcf41('0x34')](db[_0xcf41('0x35')][_0xcf41('0x36')],function(_0x4bfc86){return{'name':_0x4bfc86[_0xcf41('0x37')],'type':_0x4bfc86[_0xcf41('0x38')][_0xcf41('0x39')]};});_0x443253['model']=_[_0xcf41('0x34')](_0x3d9e90,_0xcf41('0x3a'));_0x443253[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x24ae08['query']);_0x443253['filters']=_[_0xcf41('0x3d')](_0x443253[_0xcf41('0x3e')],_0x443253[_0xcf41('0x3b')]);_0x2ec113[_0xcf41('0x3f')]=_[_0xcf41('0x3d')](_0x443253[_0xcf41('0x3e')],qs[_0xcf41('0x40')](_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x40')]));_0x2ec113['attributes']=_0x2ec113['attributes'][_0xcf41('0x41')]?_0x2ec113[_0xcf41('0x3f')]:_0x443253['model'];if(!_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x42')](_0xcf41('0x43'))){_0x2ec113[_0xcf41('0x28')]=qs[_0xcf41('0x28')](_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x28')]);_0x2ec113[_0xcf41('0x44')]=qs[_0xcf41('0x44')](_0x24ae08['query']['offset']);}_0x2ec113['order']=qs[_0xcf41('0x45')](_0x24ae08[_0xcf41('0x3b')]['sort']);_0x2ec113[_0xcf41('0x46')]=qs[_0xcf41('0x47')](_[_0xcf41('0x48')](_0x24ae08[_0xcf41('0x3b')],_0x443253[_0xcf41('0x47')]),_0x3d9e90);if(_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x49')]){_0x2ec113[_0xcf41('0x46')]=_['merge'](_0x2ec113['where'],{'$or':_[_0xcf41('0x34')](_0x3d9e90,function(_0xbf56a6){if(_0xbf56a6[_0xcf41('0x38')]!==_0xcf41('0x4a')){var _0x55490f={};_0x55490f[_0xbf56a6['name']]={'$like':'%'+_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x49')]+'%'};return _0x55490f;}})});}_0x2ec113=_[_0xcf41('0x4b')]({},_0x2ec113,_0x24ae08[_0xcf41('0x4c')]);var _0x548854={'where':_0x2ec113[_0xcf41('0x46')]};return db[_0xcf41('0x35')][_0xcf41('0x29')](_0x548854)[_0xcf41('0x18')](function(_0x2a3ef5){_0x5af48e['count']=_0x2a3ef5;if(_0x24ae08[_0xcf41('0x3b')][_0xcf41('0x4d')]){_0x2ec113[_0xcf41('0x4e')]=[{'all':!![]}];}return db[_0xcf41('0x35')]['findAll'](_0x2ec113);})[_0xcf41('0x18')](function(_0xc088d2){_0x5af48e['rows']=_0xc088d2;return _0x5af48e;})[_0xcf41('0x18')](respondWithFilteredResult(_0xd6f4bc,_0x2ec113))[_0xcf41('0x23')](handleError(_0xd6f4bc,null));};exports[_0xcf41('0x4f')]=function(_0x1edc86,_0x4a541b){var _0x31767a={'raw':!![],'where':{'id':_0x1edc86[_0xcf41('0x50')]['id']}},_0x23424e={};_0x23424e[_0xcf41('0x3e')]=_[_0xcf41('0x3c')](db[_0xcf41('0x35')][_0xcf41('0x36')]);_0x23424e[_0xcf41('0x3b')]=_['keys'](_0x1edc86[_0xcf41('0x3b')]);_0x23424e['filters']=_[_0xcf41('0x3d')](_0x23424e[_0xcf41('0x3e')],_0x23424e[_0xcf41('0x3b')]);_0x31767a['attributes']=_['intersection'](_0x23424e[_0xcf41('0x3e')],qs[_0xcf41('0x40')](_0x1edc86[_0xcf41('0x3b')][_0xcf41('0x40')]));_0x31767a[_0xcf41('0x3f')]=_0x31767a[_0xcf41('0x3f')]['length']?_0x31767a['attributes']:_0x23424e[_0xcf41('0x3e')];if(_0x1edc86['query']['includeAll']){_0x31767a['include']=[{'all':!![]}];}_0x31767a=_['merge']({},_0x31767a,_0x1edc86['options']);return db[_0xcf41('0x35')][_0xcf41('0x51')](_0x31767a)[_0xcf41('0x18')](handleEntityNotFound(_0x4a541b,null))[_0xcf41('0x18')](respondWithResult(_0x4a541b,null))[_0xcf41('0x23')](handleError(_0x4a541b,null));};exports[_0xcf41('0x52')]=function(_0x2b1522,_0x4a7a8a,_0x539b76){var _0x311c3e;return db['sequelize']['transaction'](function(_0x26d07c){return db['Network'][_0xcf41('0x52')](_0x2b1522['body'],{'raw':!![]})[_0xcf41('0x18')](function(_0x1cc82c){_0x311c3e=_0x1cc82c;return db['Network']['findAll']({'where':{'type':_0x2b1522['body'][_0xcf41('0x38')]},'raw':!![]});})[_0xcf41('0x18')](function(_0x5d0c62){if(_0x311c3e[_0xcf41('0x38')][_0xcf41('0x53')]()==_0xcf41('0x54')){var _0x3d1cfe=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config[_0xcf41('0x57')],_0xcf41('0x58')),_0xcf41('0x59'));var _0x332aef=ejs[_0xcf41('0x5a')](_0x3d1cfe,{'networks':_0x5d0c62||[]});fs['writeFileSync'](_0xcf41('0x5b'),_0x332aef);return respondWithRpcPromise(_0xcf41('0x5c'),_0xcf41('0x52'),{'module':_0xcf41('0x5d')});}else if(_0x311c3e['type'][_0xcf41('0x53')]()=='TURN'){var _0x2a8b1c=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x1896ca=ejs[_0xcf41('0x5a')](_0x2a8b1c,{'networks':_0x5d0c62||[]});fs[_0xcf41('0x5e')](_0xcf41('0x5f'),_0x1896ca);return respondWithRpcPromise(_0xcf41('0x5c'),_0xcf41('0x52'),{'module':_0xcf41('0x5d')});}else{var _0x5e9af8=fs['readFileSync'](path[_0xcf41('0x56')](config[_0xcf41('0x57')],_0xcf41('0x60')),_0xcf41('0x59'));var _0x26bf7f=ejs['render'](_0x5e9af8,{'networks':_0x5d0c62||[]});fs[_0xcf41('0x5e')](util[_0xcf41('0x61')]('/etc/asterisk/sip_xcally_%s.conf',_0x2b1522['body']['type'][_0xcf41('0x62')]()),_0x26bf7f);return respondWithRpcPromise(_0xcf41('0x5c'),'create',{'module':_0xcf41('0x63')});}return null;})[_0xcf41('0x18')](function(){return _0x311c3e;});})[_0xcf41('0x18')](respondWithResult(_0x4a7a8a,0xc9))[_0xcf41('0x23')](handleError(_0x4a7a8a,null));};exports[_0xcf41('0x2f')]=function(_0x30164a,_0x4ffeb5,_0x97df30){var _0x3150bf;return db[_0xcf41('0x64')][_0xcf41('0x65')](function(_0x394de4){return db[_0xcf41('0x35')][_0xcf41('0x51')]({'where':{'id':_0x30164a['params']['id']}})[_0xcf41('0x18')](handleEntityNotFound(_0x4ffeb5,null))[_0xcf41('0x18')](saveUpdates(_0x30164a['body'],null))[_0xcf41('0x18')](function(_0x2e0f5f){if(_0x2e0f5f){_0x3150bf=_0x2e0f5f;return db[_0xcf41('0x35')]['findAll']({'where':{'type':_0x3150bf[_0xcf41('0x38')]},'raw':!![]});}return null;})[_0xcf41('0x18')](function(_0x3f9851){if(_0x3150bf[_0xcf41('0x38')][_0xcf41('0x53')]()==_0xcf41('0x54')){var _0x455e25=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config[_0xcf41('0x57')],_0xcf41('0x58')),_0xcf41('0x59'));var _0x191708=ejs['render'](_0x455e25,{'networks':_0x3f9851||[]});fs[_0xcf41('0x5e')](_0xcf41('0x5b'),_0x191708);return respondWithRpcPromise(_0xcf41('0x5c'),_0xcf41('0x2f'),{'module':_0xcf41('0x5d')});}else if(_0x3150bf[_0xcf41('0x38')][_0xcf41('0x53')]()=='TURN'){var _0x58e556=fs[_0xcf41('0x55')](path['join'](config[_0xcf41('0x57')],'server/files/templates/turn_multiple.ejs'),_0xcf41('0x59'));var _0x331d29=ejs[_0xcf41('0x5a')](_0x58e556,{'networks':_0x3f9851||[]});fs['writeFileSync'](_0xcf41('0x5f'),_0x331d29);return respondWithRpcPromise('Reload',_0xcf41('0x2f'),{'module':_0xcf41('0x5d')});}else{var _0x5a6128=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config[_0xcf41('0x57')],_0xcf41('0x60')),_0xcf41('0x59'));var _0x494357=ejs[_0xcf41('0x5a')](_0x5a6128,{'networks':_0x3f9851||[]});fs[_0xcf41('0x5e')](util[_0xcf41('0x61')](_0xcf41('0x66'),_0x30164a[_0xcf41('0x67')][_0xcf41('0x38')][_0xcf41('0x62')]()),_0x494357);return respondWithRpcPromise('Reload',_0xcf41('0x2f'),{'module':_0xcf41('0x63')});}return null;})['then'](function(_0x445bbc){if(_0x445bbc){return _0x3150bf;}return null;});})[_0xcf41('0x18')](respondWithResult(_0x4ffeb5,null))['catch'](handleError(_0x4ffeb5,null));};exports[_0xcf41('0x68')]=function(_0x489a98,_0x3c4f29,_0x422a6c){var _0x56e8ad;return db[_0xcf41('0x35')][_0xcf41('0x51')]({'where':{'id':_0x489a98[_0xcf41('0x50')]['id']}})[_0xcf41('0x18')](function(_0x2df442){_0x56e8ad=_0x2df442;return _0x2df442;})['then'](handleEntityNotFound(_0x3c4f29,null))[_0xcf41('0x18')](removeEntity(_0x3c4f29,null))[_0xcf41('0x18')](function(){if(_0x56e8ad){return db['Network'][_0xcf41('0x69')]({'where':{'type':_0x56e8ad[_0xcf41('0x38')]},'raw':!![]});}})[_0xcf41('0x18')](function(_0x4a1ff8){if(_0x56e8ad[_0xcf41('0x38')][_0xcf41('0x53')]()==_0xcf41('0x54')){var _0x5991b3=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config[_0xcf41('0x57')],_0xcf41('0x58')),_0xcf41('0x59'));var _0x28eb62=ejs['render'](_0x5991b3,{'networks':_0x4a1ff8||[]});fs[_0xcf41('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x28eb62);return respondWithRpcPromise(_0xcf41('0x5c'),_0xcf41('0x68'),{'module':_0xcf41('0x5d')});}else if(_0x56e8ad[_0xcf41('0x38')][_0xcf41('0x53')]()==_0xcf41('0x6a')){var _0x29dbf2=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config[_0xcf41('0x57')],'server/files/templates/turn_multiple.ejs'),_0xcf41('0x59'));var _0x4bea97=ejs['render'](_0x29dbf2,{'networks':_0x4a1ff8||[]});fs[_0xcf41('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x4bea97);return respondWithRpcPromise(_0xcf41('0x5c'),'destroy',{'module':_0xcf41('0x5d')});}else{var _0x4a7cda=fs[_0xcf41('0x55')](path[_0xcf41('0x56')](config['root'],_0xcf41('0x60')),_0xcf41('0x59'));var _0xbc80b2=ejs[_0xcf41('0x5a')](_0x4a7cda,{'networks':_0x4a1ff8||[]});fs[_0xcf41('0x5e')](util[_0xcf41('0x61')](_0xcf41('0x66'),_0x489a98[_0xcf41('0x67')]['type'][_0xcf41('0x62')]()),_0xbc80b2);return respondWithRpcPromise(_0xcf41('0x5c'),_0xcf41('0x68'),{'module':_0xcf41('0x63')});}return null;})[_0xcf41('0x23')](handleError(_0x3c4f29,null));}; \ No newline at end of file +var _0x2234=['includeAll','include','rows','show','find','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','res_stun_monitor.so','TURN','utf8','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','create','update','params','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','destroy','stack','name','send','index','map','Network','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x1a887f,_0x28423c){var _0x1841ff=function(_0x21f786){while(--_0x21f786){_0x1a887f['push'](_0x1a887f['shift']());}};_0x1841ff(++_0x28423c);}(_0x2234,0x16e));var _0x4223=function(_0x51b42e,_0x8dea09){_0x51b42e=_0x51b42e-0x0;var _0x43ed23=_0x2234[_0x51b42e];return _0x43ed23;};'use strict';var emlformat=require(_0x4223('0x0'));var rimraf=require(_0x4223('0x1'));var zipdir=require(_0x4223('0x2'));var jsonpatch=require(_0x4223('0x3'));var rp=require(_0x4223('0x4'));var moment=require(_0x4223('0x5'));var BPromise=require(_0x4223('0x6'));var Mustache=require(_0x4223('0x7'));var util=require(_0x4223('0x8'));var path=require(_0x4223('0x9'));var sox=require('sox');var csv=require(_0x4223('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4223('0xb'));var _=require(_0x4223('0xc'));var squel=require(_0x4223('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4223('0xa'));var querystring=require(_0x4223('0xe'));var Papa=require(_0x4223('0xf'));var Redis=require(_0x4223('0x10'));var authService=require(_0x4223('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4223('0x12'));var hardwareService=require(_0x4223('0x13'));var logger=require(_0x4223('0x14'))(_0x4223('0x15'));var utils=require(_0x4223('0x16'));var config=require(_0x4223('0x17'));var licenseUtil=require(_0x4223('0x18'));var db=require(_0x4223('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4223('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x287bbc,_0x5ebef1,_0x3c6fdb,_0x3b41bb){return new BPromise(function(_0x20649e,_0x5604b8){var _0x4dae32=_0x3b41bb||client;return _0x4dae32['request'](_0x287bbc,_0x3c6fdb)[_0x4223('0x1b')](function(_0x1da527){logger[_0x4223('0x1c')](_0x4223('0x1d'),_0x5ebef1,_0x4223('0x1e'));logger[_0x4223('0x1f')](_0x4223('0x20'),_0x5ebef1,_0x4223('0x1e'),JSON[_0x4223('0x21')](_0x1da527));if(_0x1da527[_0x4223('0x22')]){if(_0x1da527[_0x4223('0x22')][_0x4223('0x23')]===0x1f4){logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x1da527[_0x4223('0x22')]['message']);return _0x5604b8(_0x1da527[_0x4223('0x22')]['message']);}logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x1da527['error'][_0x4223('0x24')]);return _0x20649e(_0x1da527[_0x4223('0x22')][_0x4223('0x24')]);}else{logger[_0x4223('0x1c')]('Network,\x20%s,\x20%s',_0x5ebef1,_0x4223('0x1e'));_0x20649e(_0x1da527[_0x4223('0x25')]['message']);}})['catch'](function(_0x240b52){logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x240b52);_0x5604b8(_0x240b52);});});}function respondWithStatusCode(_0x2c54c5,_0x16a99c){_0x16a99c=_0x16a99c||0xcc;return function(_0x3aa2e0){if(_0x3aa2e0){return _0x2c54c5[_0x4223('0x26')](_0x16a99c);}return _0x2c54c5[_0x4223('0x27')](_0x16a99c)[_0x4223('0x28')]();};}function respondWithResult(_0x285e61,_0x415b9c){_0x415b9c=_0x415b9c||0xc8;return function(_0x3dd9e5){if(_0x3dd9e5){return _0x285e61['status'](_0x415b9c)['json'](_0x3dd9e5);}};}function respondWithFilteredResult(_0x20a8a0,_0x148dd7){return function(_0x1efbd6){if(_0x1efbd6){var _0x4b4a5c=typeof _0x148dd7[_0x4223('0x29')]==='undefined'&&typeof _0x148dd7[_0x4223('0x2a')]===_0x4223('0x2b');var _0x27bc98=_0x1efbd6[_0x4223('0x2c')];var _0x4309d3=_0x4b4a5c?0x0:_0x148dd7[_0x4223('0x29')];var _0x14e25a=_0x4b4a5c?_0x1efbd6['count']:_0x148dd7[_0x4223('0x29')]+_0x148dd7[_0x4223('0x2a')];var _0x167cc8;if(_0x14e25a>=_0x27bc98){_0x14e25a=_0x27bc98;_0x167cc8=0xc8;}else{_0x167cc8=0xce;}_0x20a8a0['status'](_0x167cc8);return _0x20a8a0[_0x4223('0x2d')](_0x4223('0x2e'),_0x4309d3+'-'+_0x14e25a+'/'+_0x27bc98)[_0x4223('0x2f')](_0x1efbd6);}return null;};}function patchUpdates(_0x5cfe9a){return function(_0x4172da){try{jsonpatch[_0x4223('0x30')](_0x4172da,_0x5cfe9a,!![]);}catch(_0x2b15f5){return BPromise[_0x4223('0x31')](_0x2b15f5);}return _0x4172da['save']();};}function saveUpdates(_0x238f42,_0x15545e){return function(_0x2f4ddf){if(_0x2f4ddf){return _0x2f4ddf['update'](_0x238f42)[_0x4223('0x1b')](function(_0x101e75){return _0x101e75;});}return null;};}function removeEntity(_0x498758,_0x1ada27){return function(_0x5e3800){if(_0x5e3800){return _0x5e3800[_0x4223('0x32')]()[_0x4223('0x1b')](function(){_0x498758[_0x4223('0x27')](0xcc)[_0x4223('0x28')]();});}};}function handleEntityNotFound(_0x4c7ab9,_0x122914){return function(_0x52b8b0){if(!_0x52b8b0){_0x4c7ab9[_0x4223('0x26')](0x194);}return _0x52b8b0;};}function handleError(_0x1051ae,_0x1c8cc4){_0x1c8cc4=_0x1c8cc4||0x1f4;return function(_0x1c82f3){logger[_0x4223('0x22')](_0x1c82f3[_0x4223('0x33')]);if(_0x1c82f3['name']){delete _0x1c82f3[_0x4223('0x34')];}_0x1051ae['status'](_0x1c8cc4)[_0x4223('0x35')](_0x1c82f3);};}exports[_0x4223('0x36')]=function(_0x309c45,_0x19e58c){var _0x4128ac={},_0x20bbc2={},_0x2587a9={'count':0x0,'rows':[]};var _0x1ed66d=_[_0x4223('0x37')](db[_0x4223('0x38')][_0x4223('0x39')],function(_0x3cf1b3){return{'name':_0x3cf1b3['fieldName'],'type':_0x3cf1b3[_0x4223('0x3a')][_0x4223('0x3b')]};});_0x20bbc2['model']=_['map'](_0x1ed66d,_0x4223('0x34'));_0x20bbc2['query']=_[_0x4223('0x3c')](_0x309c45[_0x4223('0x3d')]);_0x20bbc2[_0x4223('0x3e')]=_[_0x4223('0x3f')](_0x20bbc2['model'],_0x20bbc2['query']);_0x4128ac[_0x4223('0x40')]=_[_0x4223('0x3f')](_0x20bbc2['model'],qs['fields'](_0x309c45['query'][_0x4223('0x41')]));_0x4128ac[_0x4223('0x40')]=_0x4128ac[_0x4223('0x40')][_0x4223('0x42')]?_0x4128ac['attributes']:_0x20bbc2[_0x4223('0x43')];if(!_0x309c45[_0x4223('0x3d')][_0x4223('0x44')](_0x4223('0x45'))){_0x4128ac['limit']=qs['limit'](_0x309c45[_0x4223('0x3d')][_0x4223('0x2a')]);_0x4128ac['offset']=qs['offset'](_0x309c45[_0x4223('0x3d')][_0x4223('0x29')]);}_0x4128ac[_0x4223('0x46')]=qs[_0x4223('0x47')](_0x309c45[_0x4223('0x3d')]['sort']);_0x4128ac[_0x4223('0x48')]=qs[_0x4223('0x3e')](_[_0x4223('0x49')](_0x309c45[_0x4223('0x3d')],_0x20bbc2['filters']),_0x1ed66d);if(_0x309c45['query'][_0x4223('0x4a')]){_0x4128ac['where']=_['merge'](_0x4128ac['where'],{'$or':_[_0x4223('0x37')](_0x1ed66d,function(_0x50de3e){if(_0x50de3e['type']!==_0x4223('0x4b')){var _0x37b818={};_0x37b818[_0x50de3e['name']]={'$like':'%'+_0x309c45['query'][_0x4223('0x4a')]+'%'};return _0x37b818;}})});}_0x4128ac=_[_0x4223('0x4c')]({},_0x4128ac,_0x309c45[_0x4223('0x4d')]);var _0x5c0104={'where':_0x4128ac[_0x4223('0x48')]};return db[_0x4223('0x38')][_0x4223('0x2c')](_0x5c0104)[_0x4223('0x1b')](function(_0x2226b8){_0x2587a9[_0x4223('0x2c')]=_0x2226b8;if(_0x309c45['query'][_0x4223('0x4e')]){_0x4128ac[_0x4223('0x4f')]=[{'all':!![]}];}return db['Network']['findAll'](_0x4128ac);})[_0x4223('0x1b')](function(_0xecde5f){_0x2587a9[_0x4223('0x50')]=_0xecde5f;return _0x2587a9;})[_0x4223('0x1b')](respondWithFilteredResult(_0x19e58c,_0x4128ac))['catch'](handleError(_0x19e58c,null));};exports[_0x4223('0x51')]=function(_0x49868f,_0x39c14b){var _0x4d5698={'raw':!![],'where':{'id':_0x49868f['params']['id']}},_0x33a9cd={};_0x33a9cd['model']=_[_0x4223('0x3c')](db[_0x4223('0x38')][_0x4223('0x39')]);_0x33a9cd['query']=_[_0x4223('0x3c')](_0x49868f[_0x4223('0x3d')]);_0x33a9cd[_0x4223('0x3e')]=_['intersection'](_0x33a9cd['model'],_0x33a9cd[_0x4223('0x3d')]);_0x4d5698['attributes']=_['intersection'](_0x33a9cd[_0x4223('0x43')],qs['fields'](_0x49868f[_0x4223('0x3d')][_0x4223('0x41')]));_0x4d5698[_0x4223('0x40')]=_0x4d5698[_0x4223('0x40')]['length']?_0x4d5698['attributes']:_0x33a9cd[_0x4223('0x43')];if(_0x49868f[_0x4223('0x3d')][_0x4223('0x4e')]){_0x4d5698['include']=[{'all':!![]}];}_0x4d5698=_[_0x4223('0x4c')]({},_0x4d5698,_0x49868f[_0x4223('0x4d')]);return db[_0x4223('0x38')][_0x4223('0x52')](_0x4d5698)[_0x4223('0x1b')](handleEntityNotFound(_0x39c14b,null))[_0x4223('0x1b')](respondWithResult(_0x39c14b,null))['catch'](handleError(_0x39c14b,null));};exports['create']=function(_0x388e2a,_0x141c2f,_0x251d37){var _0xeb1320;return db[_0x4223('0x53')][_0x4223('0x54')](function(_0x52087a){return db[_0x4223('0x38')]['create'](_0x388e2a[_0x4223('0x55')],{'raw':!![]})[_0x4223('0x1b')](function(_0xf5cfe){_0xeb1320=_0xf5cfe;return db['Network'][_0x4223('0x56')]({'where':{'type':_0x388e2a[_0x4223('0x55')][_0x4223('0x3a')]},'raw':!![]});})[_0x4223('0x1b')](function(_0x72ea48){if(_0xeb1320[_0x4223('0x3a')][_0x4223('0x57')]()==_0x4223('0x58')){var _0x27df03=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x5c')),'utf8');var _0x5cbbdd=ejs[_0x4223('0x5d')](_0x27df03,{'networks':_0x72ea48||[]});fs[_0x4223('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x5cbbdd);return respondWithRpcPromise(_0x4223('0x5f'),'create',{'module':_0x4223('0x60')});}else if(_0xeb1320[_0x4223('0x3a')][_0x4223('0x57')]()==_0x4223('0x61')){var _0x2ee307=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x4223('0x62'));var _0x1b9351=ejs[_0x4223('0x5d')](_0x2ee307,{'networks':_0x72ea48||[]});fs['writeFileSync'](_0x4223('0x63'),_0x1b9351);return respondWithRpcPromise('Reload','create',{'module':_0x4223('0x60')});}else{var _0x3b8c91=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/network.ejs'),_0x4223('0x62'));var _0x5d524f=ejs['render'](_0x3b8c91,{'networks':_0x72ea48||[]});fs['writeFileSync'](util[_0x4223('0x64')](_0x4223('0x65'),_0x388e2a[_0x4223('0x55')]['type'][_0x4223('0x66')]()),_0x5d524f);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x67'),{'module':'chan_sip.so'});}return null;})[_0x4223('0x1b')](function(){return _0xeb1320;});})[_0x4223('0x1b')](respondWithResult(_0x141c2f,0xc9))['catch'](handleError(_0x141c2f,null));};exports[_0x4223('0x68')]=function(_0x451cc0,_0x182b32,_0x58f40d){var _0xdc73a6;return db[_0x4223('0x53')][_0x4223('0x54')](function(_0x20374c){return db['Network'][_0x4223('0x52')]({'where':{'id':_0x451cc0[_0x4223('0x69')]['id']}})[_0x4223('0x1b')](handleEntityNotFound(_0x182b32,null))['then'](saveUpdates(_0x451cc0[_0x4223('0x55')],null))[_0x4223('0x1b')](function(_0x1dde3a){if(_0x1dde3a){_0xdc73a6=_0x1dde3a;return db[_0x4223('0x38')][_0x4223('0x56')]({'where':{'type':_0xdc73a6[_0x4223('0x3a')]},'raw':!![]});}return null;})[_0x4223('0x1b')](function(_0x1d41f4){if(_0xdc73a6['type'][_0x4223('0x57')]()==_0x4223('0x58')){var _0x3e5544=fs[_0x4223('0x59')](path['join'](config['root'],_0x4223('0x5c')),_0x4223('0x62'));var _0x1b4150=ejs[_0x4223('0x5d')](_0x3e5544,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](_0x4223('0x6a'),_0x1b4150);return respondWithRpcPromise('Reload','update',{'module':_0x4223('0x60')});}else if(_0xdc73a6[_0x4223('0x3a')]['toUpperCase']()==_0x4223('0x61')){var _0xdf6293=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6b')),_0x4223('0x62'));var _0x4a132d=ejs[_0x4223('0x5d')](_0xdf6293,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](_0x4223('0x63'),_0x4a132d);return respondWithRpcPromise('Reload',_0x4223('0x68'),{'module':_0x4223('0x60')});}else{var _0x2ee2d0=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6c')),'utf8');var _0x2f36a1=ejs['render'](_0x2ee2d0,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](util['format'](_0x4223('0x65'),_0x451cc0[_0x4223('0x55')][_0x4223('0x3a')][_0x4223('0x66')]()),_0x2f36a1);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x68'),{'module':_0x4223('0x6d')});}return null;})[_0x4223('0x1b')](function(_0x4bc1e7){if(_0x4bc1e7){return _0xdc73a6;}return null;});})[_0x4223('0x1b')](respondWithResult(_0x182b32,null))[_0x4223('0x6e')](handleError(_0x182b32,null));};exports[_0x4223('0x32')]=function(_0x48d491,_0x12d61e,_0x55df02){var _0x4efa74;return db[_0x4223('0x38')][_0x4223('0x52')]({'where':{'id':_0x48d491[_0x4223('0x69')]['id']}})[_0x4223('0x1b')](function(_0x3195b8){_0x4efa74=_0x3195b8;return _0x3195b8;})[_0x4223('0x1b')](handleEntityNotFound(_0x12d61e,null))[_0x4223('0x1b')](removeEntity(_0x12d61e,null))[_0x4223('0x1b')](function(){if(_0x4efa74){return db['Network'][_0x4223('0x56')]({'where':{'type':_0x4efa74[_0x4223('0x3a')]},'raw':!![]});}})[_0x4223('0x1b')](function(_0x4c8dbb){if(_0x4efa74[_0x4223('0x3a')][_0x4223('0x57')]()=='STUN'){var _0x1d12d8=fs['readFileSync'](path['join'](config['root'],_0x4223('0x5c')),_0x4223('0x62'));var _0xdb3d0a=ejs[_0x4223('0x5d')](_0x1d12d8,{'networks':_0x4c8dbb||[]});fs[_0x4223('0x5e')](_0x4223('0x6a'),_0xdb3d0a);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x4efa74['type']['toUpperCase']()=='TURN'){var _0x205999=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x4223('0x62'));var _0x3aafc3=ejs[_0x4223('0x5d')](_0x205999,{'networks':_0x4c8dbb||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x3aafc3);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':'res_stun_monitor.so'});}else{var _0x51bfbe=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6c')),_0x4223('0x62'));var _0x53fd3c=ejs['render'](_0x51bfbe,{'networks':_0x4c8dbb||[]});fs[_0x4223('0x5e')](util['format'](_0x4223('0x65'),_0x48d491[_0x4223('0x55')][_0x4223('0x3a')]['toLowerCase']()),_0x53fd3c);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':_0x4223('0x6d')});}return null;})['catch'](handleError(_0x12d61e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ac125ea..da30a32 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 _0x1b73=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','Network','network','util'];(function(_0x261c85,_0x294f02){var _0x284cb8=function(_0x3e01d4){while(--_0x3e01d4){_0x261c85['push'](_0x261c85['shift']());}};_0x284cb8(++_0x294f02);}(_0x1b73,0x1d5));var _0x31b7=function(_0x4bbc7b,_0x3eb404){_0x4bbc7b=_0x4bbc7b-0x0;var _0x32ea98=_0x1b73[_0x4bbc7b];return _0x32ea98;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));var moment=require(_0x31b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31b7('0x5'));var config=require(_0x31b7('0x6'));var attributes=require('./network.attributes');module[_0x31b7('0x7')]=function(_0x3d058f,_0x15c31e){return _0x3d058f['define'](_0x31b7('0x8'),attributes,{'tableName':_0x31b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf403=['path','rimraf','../../config/environment','define','Network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdcf9ec,_0x44e08e){var _0x2ef172=function(_0x5821aa){while(--_0x5821aa){_0xdcf9ec['push'](_0xdcf9ec['shift']());}};_0x2ef172(++_0x44e08e);}(_0xf403,0x1d3));var _0x3f40=function(_0x1eeaad,_0x4a2db5){_0x1eeaad=_0x1eeaad-0x0;var _0x53bce8=_0xf403[_0x1eeaad];return _0x53bce8;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var logger=require(_0x3f40('0x1'))(_0x3f40('0x2'));var moment=require(_0x3f40('0x3'));var BPromise=require(_0x3f40('0x4'));var rp=require(_0x3f40('0x5'));var fs=require('fs');var path=require(_0x3f40('0x6'));var rimraf=require(_0x3f40('0x7'));var config=require(_0x3f40('0x8'));var attributes=require('./network.attributes');module['exports']=function(_0x33f742,_0x22d5e6){return _0x33f742[_0x3f40('0x9')](_0x3f40('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 93bd064..8f15a06 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x2eb708,_0x3213cf){_0x2eb708=_0x2eb708-0x0;var _0x1ec579=_0x7a54[_0x2eb708];return _0x1ec579;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x493e46,_0x17ea39){var _0x20ff9d=function(_0x85170c){while(--_0x85170c){_0x493e46['push'](_0x493e46['shift']());}};_0x20ff9d(++_0x17ea39);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 5e66e33..91357d1 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 _0xe58f=['notify','addApplications','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','/:id','isAuthenticated','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify'];(function(_0x27c190,_0x550696){var _0x45661e=function(_0x433abd){while(--_0x433abd){_0x27c190['push'](_0x27c190['shift']());}};_0x45661e(++_0x550696);}(_0xe58f,0x187));var _0xfe58=function(_0x2fac61,_0x5aa658){_0x2fac61=_0x2fac61-0x0;var _0x57940a=_0xe58f[_0x2fac61];return _0x57940a;};'use strict';var multer=require(_0xfe58('0x0'));var util=require(_0xfe58('0x1'));var path=require(_0xfe58('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfe58('0x3')]();var fs_extra=require(_0xfe58('0x4'));var auth=require(_0xfe58('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe58('0x6'));var controller=require(_0xfe58('0x7'));router[_0xfe58('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe58('0x9')]);router['get'](_0xfe58('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xfe58('0x8')](_0xfe58('0xb'),auth[_0xfe58('0xc')](),controller[_0xfe58('0xd')]);router['get']('/:id/dispositions',auth[_0xfe58('0xc')](),controller[_0xfe58('0xe')]);router['get'](_0xfe58('0xf'),auth['isAuthenticated'](),controller[_0xfe58('0x10')]);router[_0xfe58('0x8')](_0xfe58('0x11'),auth[_0xfe58('0xc')](),controller[_0xfe58('0x12')]);router[_0xfe58('0x8')](_0xfe58('0x13'),auth[_0xfe58('0xc')](),controller[_0xfe58('0x14')]);router[_0xfe58('0x8')](_0xfe58('0x15'),auth[_0xfe58('0xc')](),controller[_0xfe58('0x16')]);router[_0xfe58('0x17')]('/',auth[_0xfe58('0xc')](),controller[_0xfe58('0x18')]);router[_0xfe58('0x17')]('/:id/dispositions',auth[_0xfe58('0xc')](),controller[_0xfe58('0x19')]);router[_0xfe58('0x17')](_0xfe58('0xf'),auth[_0xfe58('0xc')](),controller['addAnswer']);router['post'](_0xfe58('0x1a'),controller[_0xfe58('0x1b')]);router[_0xfe58('0x17')]('/:id/applications',auth[_0xfe58('0xc')](),controller[_0xfe58('0x1c')]);router['post'](_0xfe58('0x15'),auth[_0xfe58('0xc')](),controller['addAgents']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xfe58('0x1d')]);router[_0xfe58('0x1e')](_0xfe58('0xb'),auth['isAuthenticated'](),controller[_0xfe58('0x1f')]);router[_0xfe58('0x20')](_0xfe58('0xb'),auth[_0xfe58('0xc')](),controller[_0xfe58('0x21')]);router[_0xfe58('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfe58('0x22')]);router[_0xfe58('0x20')](_0xfe58('0xf'),auth['isAuthenticated'](),controller[_0xfe58('0x23')]);router[_0xfe58('0x20')](_0xfe58('0x15'),auth[_0xfe58('0xc')](),controller[_0xfe58('0x24')]);module[_0xfe58('0x25')]=router; \ No newline at end of file +var _0x6337=['/:id/canned_answers','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','create','post','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0x6337,0x12b));var _0x7633=function(_0x525b4c,_0x232348){_0x525b4c=_0x525b4c-0x0;var _0x184b7a=_0x6337[_0x525b4c];return _0x184b7a;};'use strict';var multer=require(_0x7633('0x0'));var util=require('util');var path=require(_0x7633('0x1'));var timeout=require('connect-timeout');var express=require(_0x7633('0x2'));var router=express[_0x7633('0x3')]();var fs_extra=require(_0x7633('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7633('0x5'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x7633('0x6')]('/',auth[_0x7633('0x7')](),controller[_0x7633('0x8')]);router[_0x7633('0x6')]('/describe',auth[_0x7633('0x7')](),controller[_0x7633('0x9')]);router[_0x7633('0x6')](_0x7633('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7633('0x6')](_0x7633('0xb'),auth[_0x7633('0x7')](),controller[_0x7633('0xc')]);router[_0x7633('0x6')]('/:id/canned_answers',auth[_0x7633('0x7')](),controller[_0x7633('0xd')]);router['get'](_0x7633('0xe'),auth[_0x7633('0x7')](),controller[_0x7633('0xf')]);router['get']('/:id/interactions',auth[_0x7633('0x7')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x7633('0x7')](),controller['getAgents']);router['post']('/',auth[_0x7633('0x7')](),controller[_0x7633('0x10')]);router[_0x7633('0x11')](_0x7633('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x7633('0x11')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7633('0x12')]);router['post'](_0x7633('0x13'),controller[_0x7633('0x14')]);router[_0x7633('0x11')](_0x7633('0xe'),auth[_0x7633('0x7')](),controller[_0x7633('0x15')]);router['post'](_0x7633('0x16'),auth[_0x7633('0x7')](),controller[_0x7633('0x17')]);router[_0x7633('0x11')](_0x7633('0x18'),auth[_0x7633('0x7')](),controller[_0x7633('0x19')]);router[_0x7633('0x1a')](_0x7633('0xa'),auth[_0x7633('0x7')](),controller[_0x7633('0x1b')]);router[_0x7633('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7633('0x1d')]);router[_0x7633('0x1c')](_0x7633('0xb'),auth['isAuthenticated'](),controller[_0x7633('0x1e')]);router[_0x7633('0x1c')](_0x7633('0x1f'),auth[_0x7633('0x7')](),controller['removeAnswers']);router[_0x7633('0x1c')](_0x7633('0x16'),auth[_0x7633('0x7')](),controller['removeAgents']);module[_0x7633('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index ed805a5..0ddbf35 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 _0xd728=['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','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate'];(function(_0x2576a3,_0x1e96fe){var _0x53f756=function(_0x1f64c7){while(--_0x1f64c7){_0x2576a3['push'](_0x2576a3['shift']());}};_0x53f756(++_0x1e96fe);}(_0xd728,0x1ab));var _0x8d72=function(_0x4846c0,_0x167869){_0x4846c0=_0x4846c0-0x0;var _0x15bc8b=_0xd728[_0x4846c0];return _0x15bc8b;};'use strict';var Sequelize=require(_0x8d72('0x0'));var rs=require(_0x8d72('0x1'));module[_0x8d72('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8d72('0x3')]},'token':{'type':Sequelize[_0x8d72('0x3')],'defaultValue':function(){return rs[_0x8d72('0x4')]();}},'replyUri':{'type':Sequelize[_0x8d72('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8d72('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8d72('0x5')],'defaultValue':function(){return _0x8d72('0x6');}},'notificationSound':{'type':Sequelize[_0x8d72('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8d72('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8d72('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x8d72('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d72('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d72('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d72('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x8d72('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x8d72('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x56196b){if(!_0x56196b)this[_0x8d72('0xa')]('mandatoryDispositionPauseId',null);this[_0x8d72('0xa')](_0x8d72('0xb'),_0x56196b);}}}; \ No newline at end of file +var _0xfd05=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name'];(function(_0x59947c,_0x594122){var _0x324b2b=function(_0x5cbc04){while(--_0x5cbc04){_0x59947c['push'](_0x59947c['shift']());}};_0x324b2b(++_0x594122);}(_0xfd05,0xd9));var _0x5fd0=function(_0x193e01,_0x45df72){_0x193e01=_0x193e01-0x0;var _0xfbed4b=_0xfd05[_0x193e01];return _0xfbed4b;};'use strict';var Sequelize=require(_0x5fd0('0x0'));var rs=require('randomstring');module[_0x5fd0('0x1')]={'name':{'type':Sequelize[_0x5fd0('0x2')],'unique':_0x5fd0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5fd0('0x2')]},'token':{'type':Sequelize[_0x5fd0('0x2')],'defaultValue':function(){return rs[_0x5fd0('0x4')]();}},'replyUri':{'type':Sequelize[_0x5fd0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5fd0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5fd0('0x5')],'defaultValue':function(){return _0x5fd0('0x6');}},'notificationSound':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5fd0('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5fd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5fd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5fd0('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![],'comment':_0x5fd0('0xa'),'set':function(_0x51e1aa){if(!_0x51e1aa)this[_0x5fd0('0xb')](_0x5fd0('0xc'),null);this[_0x5fd0('0xb')]('mandatoryDisposition',_0x51e1aa);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b05a835..1ad229c 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 _0x7bb5=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','end','json','offset','undefined','limit','set','apply','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','status','send','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','OpenchannelAccount','count','include','findAll','rows','show','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','includeAll','removeDispositions','CannedAnswer','getAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','applications','Applications','list','orderBy','priority','asc','account','defaults','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3d68f3,_0x1dd548){var _0x48099f=function(_0x509565){while(--_0x509565){_0x3d68f3['push'](_0x3d68f3['shift']());}};_0x48099f(++_0x1dd548);}(_0x7bb5,0xa9));var _0x57bb=function(_0x5d46c9,_0x1373b5){_0x5d46c9=_0x5d46c9-0x0;var _0x3c7529=_0x7bb5[_0x5d46c9];return _0x3c7529;};'use strict';var emlformat=require(_0x57bb('0x0'));var rimraf=require(_0x57bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57bb('0x2'));var rp=require(_0x57bb('0x3'));var moment=require(_0x57bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57bb('0x5'));var util=require('util');var path=require(_0x57bb('0x6'));var sox=require(_0x57bb('0x7'));var csv=require(_0x57bb('0x8'));var ejs=require(_0x57bb('0x9'));var fs=require('fs');var fs_extra=require(_0x57bb('0xa'));var _=require('lodash');var squel=require(_0x57bb('0xb'));var crypto=require(_0x57bb('0xc'));var jsforce=require(_0x57bb('0xd'));var deskjs=require(_0x57bb('0xe'));var toCsv=require(_0x57bb('0x8'));var querystring=require(_0x57bb('0xf'));var Papa=require(_0x57bb('0x10'));var Redis=require(_0x57bb('0x11'));var authService=require(_0x57bb('0x12'));var qs=require(_0x57bb('0x13'));var as=require(_0x57bb('0x14'));var hardwareService=require(_0x57bb('0x15'));var logger=require(_0x57bb('0x16'))(_0x57bb('0x17'));var utils=require(_0x57bb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x57bb('0x19'));var db=require('../../mysqldb')['db'];config[_0x57bb('0x1a')]=_['defaults'](config[_0x57bb('0x1a')],{'host':_0x57bb('0x1b'),'port':0x18eb});var socket=require(_0x57bb('0x1c'))(new Redis(config[_0x57bb('0x1a')]));require('./openchannelAccount.socket')[_0x57bb('0x1d')](socket);var jayson=require(_0x57bb('0x1e'));var client=jayson[_0x57bb('0x1f')][_0x57bb('0x20')]({'port':0x232c});var client9002=jayson[_0x57bb('0x1f')][_0x57bb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xeec7b2,_0xaa9803,_0xd07c14,_0x44ee78){return new BPromise(function(_0x5bc859,_0x1a513d){var _0x20ab28=_0x44ee78||client;return _0x20ab28['request'](_0xeec7b2,_0xd07c14)[_0x57bb('0x21')](function(_0x380751){logger[_0x57bb('0x22')](_0x57bb('0x23'),_0xaa9803,'request\x20sent');logger[_0x57bb('0x24')](_0x57bb('0x25'),_0xaa9803,'request\x20sent',JSON[_0x57bb('0x26')](_0x380751));if(_0x380751[_0x57bb('0x27')]){if(_0x380751['error'][_0x57bb('0x28')]===0x1f4){logger[_0x57bb('0x27')](_0x57bb('0x23'),_0xaa9803,_0x380751['error'][_0x57bb('0x29')]);return _0x1a513d(_0x380751[_0x57bb('0x27')][_0x57bb('0x29')]);}logger['error'](_0x57bb('0x23'),_0xaa9803,_0x380751[_0x57bb('0x27')][_0x57bb('0x29')]);return _0x5bc859(_0x380751['error'][_0x57bb('0x29')]);}else{logger[_0x57bb('0x22')](_0x57bb('0x23'),_0xaa9803,_0x57bb('0x2a'));_0x5bc859(_0x380751['result']['message']);}})[_0x57bb('0x2b')](function(_0x258d78){logger[_0x57bb('0x27')](_0x57bb('0x23'),_0xaa9803,_0x258d78);_0x1a513d(_0x258d78);});});}function respondWithStatusCode(_0x2fb809,_0x36645b){_0x36645b=_0x36645b||0xcc;return function(_0x3ae02f){if(_0x3ae02f){return _0x2fb809[_0x57bb('0x2c')](_0x36645b);}return _0x2fb809['status'](_0x36645b)[_0x57bb('0x2d')]();};}function respondWithResult(_0x25d897,_0x50329c){_0x50329c=_0x50329c||0xc8;return function(_0x2cef75){if(_0x2cef75){return _0x25d897['status'](_0x50329c)[_0x57bb('0x2e')](_0x2cef75);}};}function respondWithFilteredResult(_0x438cf7,_0x5a650a){return function(_0x273f31){if(_0x273f31){var _0x40baa2=typeof _0x5a650a[_0x57bb('0x2f')]===_0x57bb('0x30')&&typeof _0x5a650a[_0x57bb('0x31')]==='undefined';var _0x4ee299=_0x273f31['count'];var _0xa0d0d7=_0x40baa2?0x0:_0x5a650a[_0x57bb('0x2f')];var _0x26fdae=_0x40baa2?_0x273f31['count']:_0x5a650a['offset']+_0x5a650a[_0x57bb('0x31')];var _0x33f622;if(_0x26fdae>=_0x4ee299){_0x26fdae=_0x4ee299;_0x33f622=0xc8;}else{_0x33f622=0xce;}_0x438cf7['status'](_0x33f622);return _0x438cf7[_0x57bb('0x32')]('Content-Range',_0xa0d0d7+'-'+_0x26fdae+'/'+_0x4ee299)[_0x57bb('0x2e')](_0x273f31);}return null;};}function patchUpdates(_0x16b78d){return function(_0xe3a0b2){try{jsonpatch[_0x57bb('0x33')](_0xe3a0b2,_0x16b78d,!![]);}catch(_0x47a6de){return BPromise['reject'](_0x47a6de);}return _0xe3a0b2['save']();};}function saveUpdates(_0x155ac3,_0x1f0aed){return function(_0xc4bb74){if(_0xc4bb74){return _0xc4bb74[_0x57bb('0x34')](_0x155ac3)[_0x57bb('0x21')](function(_0x31223e){return _0x31223e;});}return null;};}function removeEntity(_0x13c376,_0xf8018b){return function(_0x265256){if(_0x265256){return _0x265256[_0x57bb('0x35')]()['then'](function(){var _0x350eab=_0x265256[_0x57bb('0x36')]({'plain':!![]});var _0x155f96=_0x57bb('0x37');return db[_0x57bb('0x38')][_0x57bb('0x35')]({'where':{'type':_0x155f96,'resourceId':_0x350eab['id']}})[_0x57bb('0x21')](function(){return _0x265256;});})[_0x57bb('0x21')](function(){_0x13c376['status'](0xcc)[_0x57bb('0x2d')]();});}};}function handleEntityNotFound(_0x32671b,_0x2dff33){return function(_0x40b4e4){if(!_0x40b4e4){_0x32671b[_0x57bb('0x2c')](0x194);}return _0x40b4e4;};}function handleError(_0x9f1059,_0x290075){_0x290075=_0x290075||0x1f4;return function(_0x42dd3e){logger[_0x57bb('0x27')](_0x42dd3e['stack']);if(_0x42dd3e[_0x57bb('0x39')]){delete _0x42dd3e[_0x57bb('0x39')];}_0x9f1059[_0x57bb('0x3a')](_0x290075)[_0x57bb('0x3b')](_0x42dd3e);};}exports['index']=function(_0xeb11aa,_0x405d01){var _0x171cb2={'include':[{'model':db[_0x57bb('0x3c')],'as':_0x57bb('0x3d')}]},_0x92f449={},_0x5804fd={'count':0x0,'rows':[]};var _0x5c4b29=_['map'](db['OpenchannelAccount'][_0x57bb('0x3e')],function(_0x5eff2b){return{'name':_0x5eff2b['fieldName'],'type':_0x5eff2b[_0x57bb('0x3f')][_0x57bb('0x40')]};});_0x92f449[_0x57bb('0x41')]=_['map'](_0x5c4b29,_0x57bb('0x39'));_0x92f449['query']=_[_0x57bb('0x42')](_0xeb11aa['query']);_0x92f449[_0x57bb('0x43')]=_[_0x57bb('0x44')](_0x92f449['model'],_0x92f449[_0x57bb('0x45')]);_0x171cb2['attributes']=_[_0x57bb('0x44')](_0x92f449[_0x57bb('0x41')],qs[_0x57bb('0x46')](_0xeb11aa[_0x57bb('0x45')][_0x57bb('0x46')]));_0x171cb2[_0x57bb('0x47')]=_0x171cb2[_0x57bb('0x47')][_0x57bb('0x48')]?_0x171cb2[_0x57bb('0x47')]:_0x92f449[_0x57bb('0x41')];if(!_0xeb11aa['query'][_0x57bb('0x49')](_0x57bb('0x4a'))){_0x171cb2[_0x57bb('0x31')]=qs[_0x57bb('0x31')](_0xeb11aa['query'][_0x57bb('0x31')]);_0x171cb2[_0x57bb('0x2f')]=qs[_0x57bb('0x2f')](_0xeb11aa[_0x57bb('0x45')][_0x57bb('0x2f')]);}_0x171cb2[_0x57bb('0x4b')]=qs[_0x57bb('0x4c')](_0xeb11aa[_0x57bb('0x45')][_0x57bb('0x4c')]);_0x171cb2[_0x57bb('0x4d')]=qs[_0x57bb('0x43')](_[_0x57bb('0x4e')](_0xeb11aa[_0x57bb('0x45')],_0x92f449[_0x57bb('0x43')]),_0x5c4b29);if(_0xeb11aa[_0x57bb('0x45')]['filter']){_0x171cb2[_0x57bb('0x4d')]=_['merge'](_0x171cb2[_0x57bb('0x4d')],{'$or':_[_0x57bb('0x4f')](_0x5c4b29,function(_0x4158ac){if(_0x4158ac[_0x57bb('0x3f')]!=='VIRTUAL'){var _0xa7b492={};_0xa7b492[_0x4158ac[_0x57bb('0x39')]]={'$like':'%'+_0xeb11aa['query'][_0x57bb('0x50')]+'%'};return _0xa7b492;}})});}_0x171cb2=_[_0x57bb('0x51')]({},_0x171cb2,_0xeb11aa['options']);var _0x19929e={'where':_0x171cb2[_0x57bb('0x4d')]};return db[_0x57bb('0x52')]['count'](_0x19929e)[_0x57bb('0x21')](function(_0x2b88fa){_0x5804fd[_0x57bb('0x53')]=_0x2b88fa;if(_0xeb11aa[_0x57bb('0x45')]['includeAll']){_0x171cb2[_0x57bb('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x57bb('0x55')](_0x171cb2);})[_0x57bb('0x21')](function(_0x1e551f){_0x5804fd[_0x57bb('0x56')]=_0x1e551f;return _0x5804fd;})['then'](respondWithFilteredResult(_0x405d01,_0x171cb2))[_0x57bb('0x2b')](handleError(_0x405d01,null));};exports[_0x57bb('0x57')]=function(_0xe206d,_0x571aea){var _0x4f88bc={'raw':![],'where':{'id':_0xe206d['params']['id']},'include':[{'model':db[_0x57bb('0x3c')],'as':_0x57bb('0x3d')}]},_0x2921a5={};_0x2921a5[_0x57bb('0x41')]=_['keys'](db[_0x57bb('0x52')]['rawAttributes']);_0x2921a5[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0xe206d['query']);_0x2921a5[_0x57bb('0x43')]=_['intersection'](_0x2921a5['model'],_0x2921a5['query']);_0x4f88bc[_0x57bb('0x47')]=_['intersection'](_0x2921a5[_0x57bb('0x41')],qs[_0x57bb('0x46')](_0xe206d[_0x57bb('0x45')][_0x57bb('0x46')]));_0x4f88bc[_0x57bb('0x47')]=_0x4f88bc[_0x57bb('0x47')][_0x57bb('0x48')]?_0x4f88bc[_0x57bb('0x47')]:_0x2921a5[_0x57bb('0x41')];if(_0xe206d[_0x57bb('0x45')]['includeAll']){_0x4f88bc[_0x57bb('0x54')]=[{'all':!![]}];}_0x4f88bc=_['merge']({},_0x4f88bc,_0xe206d[_0x57bb('0x58')]);return db['OpenchannelAccount'][_0x57bb('0x59')](_0x4f88bc)[_0x57bb('0x21')](handleEntityNotFound(_0x571aea,null))[_0x57bb('0x21')](respondWithResult(_0x571aea,null))[_0x57bb('0x2b')](handleError(_0x571aea,null));};exports[_0x57bb('0x5a')]=function(_0x3579c6,_0x567fc1){return db[_0x57bb('0x52')][_0x57bb('0x5a')](_0x3579c6[_0x57bb('0x5b')],{})[_0x57bb('0x21')](function(_0x1bccee){var _0x55620c=_0x3579c6['user'][_0x57bb('0x36')]({'plain':!![]});if(!_0x55620c)throw new Error(_0x57bb('0x5c'));if(_0x55620c['role']===_0x57bb('0x5d')){var _0x2954ff=_0x1bccee[_0x57bb('0x36')]({'plain':!![]});var _0x34bf68='OpenchannelAccounts';return db[_0x57bb('0x5e')][_0x57bb('0x59')]({'where':{'name':_0x34bf68,'userProfileId':_0x55620c[_0x57bb('0x5f')]},'raw':!![]})[_0x57bb('0x21')](function(_0x3c1050){if(_0x3c1050&&_0x3c1050[_0x57bb('0x60')]===0x0){return db[_0x57bb('0x38')][_0x57bb('0x5a')]({'name':_0x2954ff[_0x57bb('0x39')],'resourceId':_0x2954ff['id'],'type':_0x3c1050[_0x57bb('0x39')],'sectionId':_0x3c1050['id']},{})[_0x57bb('0x21')](function(){return _0x1bccee;});}else{return _0x1bccee;}})[_0x57bb('0x2b')](function(_0xa4c1f8){logger['error'](_0x57bb('0x61'),_0xa4c1f8);throw _0xa4c1f8;});}return _0x1bccee;})[_0x57bb('0x21')](respondWithResult(_0x567fc1,0xc9))['catch'](handleError(_0x567fc1,null));};exports[_0x57bb('0x34')]=function(_0x9ac8bd,_0x47270a){if(_0x9ac8bd['body']['id']){delete _0x9ac8bd[_0x57bb('0x5b')]['id'];}return db[_0x57bb('0x52')]['find']({'where':{'id':_0x9ac8bd[_0x57bb('0x62')]['id']},'include':[{'model':db[_0x57bb('0x3c')],'as':_0x57bb('0x3d')}]})[_0x57bb('0x21')](handleEntityNotFound(_0x47270a,null))[_0x57bb('0x21')](saveUpdates(_0x9ac8bd[_0x57bb('0x5b')],null))['then'](respondWithResult(_0x47270a,null))[_0x57bb('0x2b')](handleError(_0x47270a,null));};exports[_0x57bb('0x35')]=function(_0x45c761,_0x4edbdc){return db['OpenchannelAccount'][_0x57bb('0x59')]({'where':{'id':_0x45c761['params']['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x4edbdc,null))[_0x57bb('0x21')](removeEntity(_0x4edbdc,null))[_0x57bb('0x2b')](handleError(_0x4edbdc,null));};exports[_0x57bb('0x63')]=function(_0x424c7f,_0x2aa34d){return db[_0x57bb('0x52')]['describe']()[_0x57bb('0x21')](respondWithResult(_0x2aa34d,null))[_0x57bb('0x2b')](handleError(_0x2aa34d,null));};exports[_0x57bb('0x64')]=function(_0x7e329b,_0x5b8f30,_0x4a13ab){if(_0x7e329b[_0x57bb('0x5b')]['id']){delete _0x7e329b[_0x57bb('0x5b')]['id'];}return db[_0x57bb('0x52')][_0x57bb('0x59')]({'where':{'id':_0x7e329b[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x5b8f30,null))[_0x57bb('0x21')](function(_0x4cdfc8){if(_0x4cdfc8){_0x7e329b[_0x57bb('0x5b')][_0x57bb('0x65')]=_0x4cdfc8['id'];return db[_0x57bb('0x66')][_0x57bb('0x5a')](_0x7e329b[_0x57bb('0x5b')]);}})['then'](respondWithResult(_0x5b8f30,null))[_0x57bb('0x2b')](handleError(_0x5b8f30,null));};exports[_0x57bb('0x67')]=function(_0x5bcf7d,_0xd000c7,_0x3c6f36){var _0x24adb2={'raw':![],'where':{}};var _0x2a19d5={};var _0x1be0c1={'count':0x0,'rows':[]};return db[_0x57bb('0x52')][_0x57bb('0x68')]({'where':{'id':_0x5bcf7d[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0xd000c7,null))[_0x57bb('0x21')](function(_0x238b1b){if(_0x238b1b){_0x2a19d5['model']=_[_0x57bb('0x42')](db['Disposition'][_0x57bb('0x3e')]);_0x2a19d5[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0x5bcf7d[_0x57bb('0x45')]);_0x2a19d5[_0x57bb('0x43')]=_[_0x57bb('0x44')](_0x2a19d5['model'],_0x2a19d5[_0x57bb('0x45')]);_0x24adb2[_0x57bb('0x47')]=_[_0x57bb('0x44')](_0x2a19d5[_0x57bb('0x41')],qs['fields'](_0x5bcf7d[_0x57bb('0x45')][_0x57bb('0x46')]));_0x24adb2[_0x57bb('0x47')]=_0x24adb2[_0x57bb('0x47')]['length']?_0x24adb2[_0x57bb('0x47')]:_0x2a19d5[_0x57bb('0x41')];if(!_0x5bcf7d[_0x57bb('0x45')]['hasOwnProperty'](_0x57bb('0x4a'))){_0x24adb2['limit']=qs['limit'](_0x5bcf7d[_0x57bb('0x45')][_0x57bb('0x31')]);_0x24adb2['offset']=qs[_0x57bb('0x2f')](_0x5bcf7d['query'][_0x57bb('0x2f')]);}_0x24adb2[_0x57bb('0x4b')]=qs[_0x57bb('0x4c')](_0x5bcf7d['query']['sort']);_0x24adb2[_0x57bb('0x4d')]=qs['filters'](_[_0x57bb('0x4e')](_0x5bcf7d[_0x57bb('0x45')],_0x2a19d5[_0x57bb('0x43')]));_0x24adb2[_0x57bb('0x4d')][_0x57bb('0x65')]=_0x238b1b['id'];if(_0x5bcf7d[_0x57bb('0x45')][_0x57bb('0x50')]){_0x24adb2[_0x57bb('0x4d')]=_[_0x57bb('0x51')](_0x24adb2['where'],{'$or':_[_0x57bb('0x4f')](_0x24adb2[_0x57bb('0x47')],function(_0xae3aac){var _0x147392={};_0x147392[_0xae3aac]={'$like':'%'+_0x5bcf7d['query'][_0x57bb('0x50')]+'%'};return _0x147392;})});}_0x24adb2=_[_0x57bb('0x51')]({},_0x24adb2,_0x5bcf7d[_0x57bb('0x58')]);return db[_0x57bb('0x66')]['count']({'where':_0x24adb2['where']})[_0x57bb('0x21')](function(_0x42f503){_0x1be0c1[_0x57bb('0x53')]=_0x42f503;if(_0x5bcf7d[_0x57bb('0x45')][_0x57bb('0x69')]){_0x24adb2[_0x57bb('0x54')]=[{'all':!![]}];}return db[_0x57bb('0x66')][_0x57bb('0x55')](_0x24adb2);})[_0x57bb('0x21')](function(_0x1aa5da){_0x1be0c1[_0x57bb('0x56')]=_0x1aa5da;return _0x1be0c1;});}})[_0x57bb('0x21')](respondWithFilteredResult(_0xd000c7,_0x24adb2))[_0x57bb('0x2b')](handleError(_0xd000c7,null));};exports[_0x57bb('0x6a')]=function(_0x3595b0,_0x55e020,_0x56736d){return db['OpenchannelAccount'][_0x57bb('0x59')]({'where':{'id':_0x3595b0[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x55e020,null))[_0x57bb('0x21')](function(_0x4cc8f0){if(_0x4cc8f0){return _0x4cc8f0[_0x57bb('0x6a')](_0x3595b0[_0x57bb('0x45')]['ids']);}})[_0x57bb('0x21')](respondWithStatusCode(_0x55e020,null))[_0x57bb('0x2b')](handleError(_0x55e020,null));};exports['addAnswer']=function(_0x56ff4e,_0x1a8451,_0x5cd8c3){if(_0x56ff4e[_0x57bb('0x5b')]['id']){delete _0x56ff4e['body']['id'];}return db[_0x57bb('0x52')]['find']({'where':{'id':_0x56ff4e[_0x57bb('0x62')]['id']}})['then'](handleEntityNotFound(_0x1a8451,null))['then'](function(_0x5c234e){if(_0x5c234e){_0x56ff4e['body'][_0x57bb('0x65')]=_0x5c234e['id'];return db[_0x57bb('0x6b')][_0x57bb('0x5a')](_0x56ff4e[_0x57bb('0x5b')]);}})[_0x57bb('0x21')](respondWithResult(_0x1a8451,null))['catch'](handleError(_0x1a8451,null));};exports[_0x57bb('0x6c')]=function(_0xbb23c2,_0x488949,_0x4e5135){var _0x1327fe={'raw':![],'where':{}};var _0x57cf86={};var _0x2d257e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x57bb('0x68')]({'where':{'id':_0xbb23c2[_0x57bb('0x62')]['id']}})['then'](handleEntityNotFound(_0x488949,null))[_0x57bb('0x21')](function(_0x206b0d){if(_0x206b0d){_0x57cf86[_0x57bb('0x41')]=_[_0x57bb('0x42')](db[_0x57bb('0x6b')]['rawAttributes']);_0x57cf86[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0xbb23c2[_0x57bb('0x45')]);_0x57cf86[_0x57bb('0x43')]=_['intersection'](_0x57cf86['model'],_0x57cf86['query']);_0x1327fe[_0x57bb('0x47')]=_[_0x57bb('0x44')](_0x57cf86[_0x57bb('0x41')],qs[_0x57bb('0x46')](_0xbb23c2[_0x57bb('0x45')][_0x57bb('0x46')]));_0x1327fe[_0x57bb('0x47')]=_0x1327fe[_0x57bb('0x47')][_0x57bb('0x48')]?_0x1327fe['attributes']:_0x57cf86[_0x57bb('0x41')];if(!_0xbb23c2[_0x57bb('0x45')]['hasOwnProperty']('nolimit')){_0x1327fe[_0x57bb('0x31')]=qs[_0x57bb('0x31')](_0xbb23c2[_0x57bb('0x45')]['limit']);_0x1327fe[_0x57bb('0x2f')]=qs[_0x57bb('0x2f')](_0xbb23c2[_0x57bb('0x45')][_0x57bb('0x2f')]);}_0x1327fe[_0x57bb('0x4b')]=qs[_0x57bb('0x4c')](_0xbb23c2[_0x57bb('0x45')]['sort']);_0x1327fe[_0x57bb('0x4d')]=qs['filters'](_[_0x57bb('0x4e')](_0xbb23c2['query'],_0x57cf86[_0x57bb('0x43')]));_0x1327fe[_0x57bb('0x4d')][_0x57bb('0x65')]=_0x206b0d['id'];if(_0xbb23c2[_0x57bb('0x45')]['filter']){_0x1327fe[_0x57bb('0x4d')]=_[_0x57bb('0x51')](_0x1327fe[_0x57bb('0x4d')],{'$or':_[_0x57bb('0x4f')](_0x1327fe[_0x57bb('0x47')],function(_0x5f5045){var _0x56d0b5={};_0x56d0b5[_0x5f5045]={'$like':'%'+_0xbb23c2[_0x57bb('0x45')][_0x57bb('0x50')]+'%'};return _0x56d0b5;})});}_0x1327fe=_[_0x57bb('0x51')]({},_0x1327fe,_0xbb23c2[_0x57bb('0x58')]);return db[_0x57bb('0x6b')][_0x57bb('0x53')]({'where':_0x1327fe['where']})[_0x57bb('0x21')](function(_0x4b4d0f){_0x2d257e[_0x57bb('0x53')]=_0x4b4d0f;if(_0xbb23c2['query'][_0x57bb('0x69')]){_0x1327fe[_0x57bb('0x54')]=[{'all':!![]}];}return db[_0x57bb('0x6b')][_0x57bb('0x55')](_0x1327fe);})[_0x57bb('0x21')](function(_0x441dbe){_0x2d257e[_0x57bb('0x56')]=_0x441dbe;return _0x2d257e;});}})[_0x57bb('0x21')](respondWithFilteredResult(_0x488949,_0x1327fe))[_0x57bb('0x2b')](handleError(_0x488949,null));};exports['removeAnswers']=function(_0x28f343,_0x5daddb,_0x41d18f){return db[_0x57bb('0x52')]['find']({'where':{'id':_0x28f343[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x5daddb,null))[_0x57bb('0x21')](function(_0x2e85d3){if(_0x2e85d3){return _0x2e85d3['removeAnswers'](_0x28f343[_0x57bb('0x45')]['ids']);}})[_0x57bb('0x21')](respondWithStatusCode(_0x5daddb,null))[_0x57bb('0x2b')](handleError(_0x5daddb,null));};exports[_0x57bb('0x6d')]=function(_0xea510,_0x44a129,_0x9e71f1){var _0x47e0ed={'body':_0xea510[_0x57bb('0x5b')],'channel':'openchannel'};var _0x4feb6c=[];var _0x124e29=[];var _0x4b1270={};var _0x3fdcb6=![];return db[_0x57bb('0x6e')][_0x57bb('0x63')]()['then'](function(_0x2f9a37){if(!_0x2f9a37){throw new db[(_0x57bb('0x6f'))][(_0x57bb('0x70'))]('no\x20available\x20attributes');}_0x4feb6c=_[_0x57bb('0x71')](_[_0x57bb('0x42')](_0x2f9a37),[_0x57bb('0x72'),_0x57bb('0x73')]);_0x124e29=_[_0x57bb('0x71')](_[_0x57bb('0x42')](_0x2f9a37),[_0x57bb('0x72'),_0x57bb('0x73'),_0x57bb('0x74'),_0x57bb('0x75')]);if(_0xea510[_0x57bb('0x5b')]['id']){delete _0xea510[_0x57bb('0x5b')]['id'];}if(_['isNil'](_0xea510[_0x57bb('0x5b')][_0x57bb('0x76')])){throw new db['Sequelize'][(_0x57bb('0x70'))](_0x57bb('0x77'));}if(_[_0x57bb('0x78')](_0xea510[_0x57bb('0x5b')]['body'])||_0xea510[_0x57bb('0x5b')][_0x57bb('0x5b')]===''){throw new db[(_0x57bb('0x6f'))][(_0x57bb('0x70'))](_0x57bb('0x79'));}if(_[_0x57bb('0x78')](_0xea510[_0x57bb('0x5b')][_0x57bb('0x7a')])){throw new db[(_0x57bb('0x6f'))][(_0x57bb('0x70'))](_0x57bb('0x7b')+_0x124e29);}if(!_['includes'](_0x124e29,_0xea510[_0x57bb('0x5b')][_0x57bb('0x7a')])){throw new db[(_0x57bb('0x6f'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x124e29);}_0x4b1270[_0xea510[_0x57bb('0x5b')]['mapKey']]=_0xea510[_0x57bb('0x5b')]['from'];})[_0x57bb('0x21')](function(){return db[_0x57bb('0x52')][_0x57bb('0x59')]({'where':{'id':_0xea510[_0x57bb('0x62')]['id']},'include':[{'model':db[_0x57bb('0x7c')],'as':_0x57bb('0x7d'),'include':[{'model':db[_0x57bb('0x6e')],'as':_0x57bb('0x7e'),'where':_0x4b1270,'limit':0x1,'order':[[_0x57bb('0x73'),_0x57bb('0x7f')]]}]},{'model':db[_0x57bb('0x80')],'as':'Applications'}]});})[_0x57bb('0x21')](handleEntityNotFound(_0x44a129,null))[_0x57bb('0x21')](function(_0x5e6be9){if(_0x5e6be9&&_0x5e6be9[_0x57bb('0x7d')]){_0x47e0ed['account']=_0x5e6be9;_0x47e0ed[_0x57bb('0x81')]=_0x5e6be9[_0x57bb('0x82')];_0x47e0ed[_0x57bb('0x83')]=_0x5e6be9['List'];_0x47e0ed[_0x57bb('0x81')]=_[_0x57bb('0x84')](_0x47e0ed[_0x57bb('0x81')],[_0x57bb('0x85')],[_0x57bb('0x86')]);if(_0x47e0ed[_0x57bb('0x87')][_0x57bb('0x82')]){delete _0x47e0ed['account'][_0x57bb('0x82')];}if(_0x47e0ed['account'][_0x57bb('0x7d')]&&_0x47e0ed[_0x57bb('0x87')]['List'][_0x57bb('0x7e')]['length']){return _0x47e0ed[_0x57bb('0x87')][_0x57bb('0x7d')]['Contacts'][0x0];}var _0x1fe353=_[_0x57bb('0x88')](_0xea510[_0x57bb('0x5b')],{'firstName':_0xea510['body'][_0x57bb('0x76')],'ListId':_0x5e6be9[_0x57bb('0x75')]});_0x1fe353[_0xea510[_0x57bb('0x5b')]['mapKey']]=_0xea510['body'][_0x57bb('0x76')];return db[_0x57bb('0x6e')][_0x57bb('0x5a')](_0x1fe353,{'fields':_0x4feb6c,'raw':!![]});}})[_0x57bb('0x21')](handleEntityNotFound(_0x44a129,null))['then'](function(_0x208221){_0x47e0ed[_0x57bb('0x89')]=_0x208221;if(_0x208221){var _0x5a43af={'ContactId':_0x208221['id'],'OpenchannelAccountId':_0xea510[_0x57bb('0x62')]['id'],'from':(_0x208221[_0x57bb('0x8a')]||'')+'\x20'+(_0x208221['lastName']||'')};var _0x4aca19={'OpenchannelAccountId':_0xea510[_0x57bb('0x62')]['id'],'closed':![]};if(_0xea510['body'][_0x57bb('0x8b')]){_0x4aca19['threadId']=_0xea510[_0x57bb('0x5b')][_0x57bb('0x8b')];return db[_0x57bb('0x8c')][_0x57bb('0x59')]({'where':_0x4aca19})[_0x57bb('0x21')](function(_0x28bd4d){if(_0x28bd4d){return[_0x28bd4d,![]];}_0x5a43af['threadId']=_0xea510[_0x57bb('0x5b')][_0x57bb('0x8b')];_0x5a43af[_0x57bb('0x8d')]=_0xea510[_0x57bb('0x5b')][_0x57bb('0x8d')];return db['OpenchannelInteraction']['create'](_0x5a43af)['then'](function(_0x12be20){return[_0x12be20,!![]];});});}else{_0x4aca19[_0x57bb('0x8b')]=null;}_0x4aca19[_0x57bb('0x8e')]=_0x208221['id'];return db['OpenchannelInteraction']['find']({'where':_0x4aca19})[_0x57bb('0x21')](function(_0x1e737e){if(_0x1e737e){return[_0x1e737e,![]];}return db[_0x57bb('0x8c')][_0x57bb('0x5a')](_0x5a43af)[_0x57bb('0x21')](function(_0x5d9c0a){return[_0x5d9c0a,!![]];});});}})[_0x57bb('0x8f')](function(_0x82596d,_0x2ad6e2){if(_0x82596d){_0x3fdcb6=_0x2ad6e2;if(!_0x2ad6e2){var _0x24b09c={'from':(_0x47e0ed[_0x57bb('0x89')][_0x57bb('0x8a')]||'')+'\x20'+(_0x47e0ed[_0x57bb('0x89')]['lastName']||'')};if(_0xea510['body'][_0x57bb('0x8b')]&&_0xea510[_0x57bb('0x5b')]['messageId']&&_0xea510[_0x57bb('0x5b')][_0x57bb('0x8b')]!=_0xea510[_0x57bb('0x5b')][_0x57bb('0x90')]){_0x24b09c[_0x57bb('0x8b')]=_0xea510[_0x57bb('0x5b')][_0x57bb('0x90')];}return _0x82596d[_0x57bb('0x34')](_0x24b09c);}else{return _0x82596d;}}})[_0x57bb('0x21')](function(_0x17dd04){_0x47e0ed[_0x57bb('0x91')]=_0x17dd04[_0x57bb('0x36')]({'plain':!![]});_0x47e0ed['interaction']['created']=_0x3fdcb6;if(_0x47e0ed[_0x57bb('0x91')][_0x57bb('0x92')]){if(_0x47e0ed[_0x57bb('0x87')][_0x57bb('0x93')]){_0x47e0ed[_0x57bb('0x81')][_0x57bb('0x94')]({'id':0x0,'priority':_0x47e0ed[_0x57bb('0x81')]['length']+0x1,'app':_0x57bb('0x95'),'appdata':_0x57bb('0x96'),'interval':_0x57bb('0x97')});}}return db['OpenchannelMessage']['create']({'body':_0xea510[_0x57bb('0x5b')][_0x57bb('0x5b')],'OpenchannelAccountId':_0xea510[_0x57bb('0x62')]['id'],'OpenchannelInteractionId':_0x17dd04['id'],'direction':'in','ContactId':_0x47e0ed[_0x57bb('0x89')]['id'],'AttachmentId':_0xea510['body'][_0x57bb('0x98')]});})['then'](function(_0x363802){_0x47e0ed[_0x57bb('0x29')]=_0x363802;if(_0x47e0ed[_0x57bb('0x91')][_0x57bb('0x99')]){return db[_0x57bb('0x9a')]['find']({'attributes':['id',_0x57bb('0x39')],'where':{'id':_0x47e0ed[_0x57bb('0x91')][_0x57bb('0x99')]}})[_0x57bb('0x21')](function(_0x355b61){if(_0x355b61){_0x47e0ed[_0x57bb('0x81')]['unshift']({'id':0x0,'priority':0x0,'app':_0x57bb('0x9b'),'appdata':_0x355b61[_0x57bb('0x39')]+','+(_0x47e0ed[_0x57bb('0x87')][_0x57bb('0x9c')]||0xa),'interval':'*,*,*,*'});_0x47e0ed['forcedOwnership']=![];}return respondWithRpcPromise(_0x57bb('0x9d'),_0x57bb('0x9e'),_0x47e0ed);});}return respondWithRpcPromise(_0x57bb('0x9d'),_0x57bb('0x9e'),_0x47e0ed);})[_0x57bb('0x21')](function(_0x531849){respondWithRpcPromise(_0x57bb('0x9f'),_0x57bb('0x9f'),{'event':_0x57bb('0x6d'),'message':_0x531849},client9002);return _0x531849;})['then'](respondWithResult(_0x44a129,null))['catch'](handleError(_0x44a129,null));};exports['addApplications']=function(_0x3fb1be,_0x5eeb50,_0x56e9ed){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3fb1be['params']['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x5eeb50,null))[_0x57bb('0x21')](function(_0x1aa0f4){if(_0x1aa0f4){return db[_0x57bb('0xa0')][_0x57bb('0xa1')](function(_0x155102){return db[_0x57bb('0x80')][_0x57bb('0x35')]({'where':{'OpenchannelAccountId':_0x3fb1be[_0x57bb('0x62')]['id']},'transaction':_0x155102})[_0x57bb('0x21')](function(_0x3b9433){var _0x336401=_[_0x57bb('0x4f')](_0x3fb1be['body'],function(_0x36964a){_0x36964a['OpenchannelAccountId']=_0x3fb1be['params']['id'];return _0x36964a;});return db[_0x57bb('0x80')]['bulkCreate'](_0x336401,{'transaction':_0x155102});});})[_0x57bb('0x21')](function(){return db[_0x57bb('0x80')][_0x57bb('0xa2')]({'where':{'OpenchannelAccountId':_0x3fb1be[_0x57bb('0x62')]['id']},'order':_0x57bb('0x85')});});}})[_0x57bb('0x21')](respondWithResult(_0x5eeb50,null))[_0x57bb('0x2b')](handleError(_0x5eeb50,null));};exports[_0x57bb('0xa3')]=function(_0x5c3f34,_0x3f6f06,_0x689b3d){var _0x527a31={};var _0x102183={};var _0x44a9da;var _0xa5124c;return db[_0x57bb('0x52')][_0x57bb('0x68')]({'where':{'id':_0x5c3f34[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x3f6f06,null))[_0x57bb('0x21')](function(_0x8cde5b){if(_0x8cde5b){_0x44a9da=_0x8cde5b;_0x102183[_0x57bb('0x41')]=_[_0x57bb('0x42')](db[_0x57bb('0x80')][_0x57bb('0x3e')]);_0x102183[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0x5c3f34[_0x57bb('0x45')]);_0x102183[_0x57bb('0x43')]=_['intersection'](_0x102183[_0x57bb('0x41')],_0x102183[_0x57bb('0x45')]);_0x527a31[_0x57bb('0x47')]=_['intersection'](_0x102183['model'],qs['fields'](_0x5c3f34[_0x57bb('0x45')][_0x57bb('0x46')]));_0x527a31[_0x57bb('0x47')]=_0x527a31[_0x57bb('0x47')][_0x57bb('0x48')]?_0x527a31[_0x57bb('0x47')]:_0x102183['model'];_0x527a31[_0x57bb('0x4b')]=qs[_0x57bb('0x4c')](_0x5c3f34[_0x57bb('0x45')][_0x57bb('0x4c')]);_0x527a31[_0x57bb('0x4d')]=qs[_0x57bb('0x43')](_[_0x57bb('0x4e')](_0x5c3f34[_0x57bb('0x45')],_0x102183[_0x57bb('0x43')]));if(_0x5c3f34[_0x57bb('0x45')][_0x57bb('0x50')]){_0x527a31[_0x57bb('0x4d')]=_[_0x57bb('0x51')](_0x527a31[_0x57bb('0x4d')],{'$or':_[_0x57bb('0x4f')](_0x527a31[_0x57bb('0x47')],function(_0x13e62e){var _0x5be9c2={};_0x5be9c2[_0x13e62e]={'$like':'%'+_0x5c3f34[_0x57bb('0x45')]['filter']+'%'};return _0x5be9c2;})});}_0x527a31=_['merge']({},_0x527a31,_0x5c3f34[_0x57bb('0x58')]);return _0x44a9da[_0x57bb('0xa3')](_0x527a31);}})[_0x57bb('0x21')](function(_0x38d3d9){if(_0x38d3d9){_0xa5124c=_0x38d3d9[_0x57bb('0x48')];if(!_0x5c3f34[_0x57bb('0x45')]['hasOwnProperty'](_0x57bb('0x4a'))){_0x527a31['limit']=qs[_0x57bb('0x31')](_0x5c3f34['query'][_0x57bb('0x31')]);_0x527a31[_0x57bb('0x2f')]=qs['offset'](_0x5c3f34['query'][_0x57bb('0x2f')]);}return _0x44a9da['getApplications'](_0x527a31);}})[_0x57bb('0x21')](function(_0x5ee001){if(_0x5ee001){return _0x5ee001?{'count':_0xa5124c,'rows':_0x5ee001}:null;}})['then'](respondWithResult(_0x3f6f06,null))[_0x57bb('0x2b')](handleError(_0x3f6f06,null));};exports[_0x57bb('0xa4')]=function(_0x18f3f0,_0x4fec56,_0x312f8c){var _0x59f7b3={'raw':![],'where':{}};var _0x14f418={};var _0x42a2b3={'count':0x0,'rows':[]};return db[_0x57bb('0x52')][_0x57bb('0x68')]({'where':{'id':_0x18f3f0[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x4fec56,null))[_0x57bb('0x21')](function(_0xcdc147){if(_0xcdc147){_0x14f418['model']=_[_0x57bb('0x42')](db[_0x57bb('0x8c')][_0x57bb('0x3e')]);_0x14f418[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0x18f3f0[_0x57bb('0x45')]);_0x14f418['filters']=_['intersection'](_0x14f418[_0x57bb('0x41')],_0x14f418['query']);_0x59f7b3['attributes']=_[_0x57bb('0x44')](_0x14f418['model'],qs[_0x57bb('0x46')](_0x18f3f0[_0x57bb('0x45')][_0x57bb('0x46')]));_0x59f7b3[_0x57bb('0x47')]=_0x59f7b3[_0x57bb('0x47')][_0x57bb('0x48')]?_0x59f7b3[_0x57bb('0x47')]:_0x14f418[_0x57bb('0x41')];if(!_0x18f3f0[_0x57bb('0x45')][_0x57bb('0x49')](_0x57bb('0x4a'))){_0x59f7b3[_0x57bb('0x31')]=qs[_0x57bb('0x31')](_0x18f3f0['query'][_0x57bb('0x31')]);_0x59f7b3[_0x57bb('0x2f')]=qs[_0x57bb('0x2f')](_0x18f3f0['query'][_0x57bb('0x2f')]);}_0x59f7b3['order']=qs[_0x57bb('0x4c')](_0x18f3f0[_0x57bb('0x45')]['sort']);_0x59f7b3[_0x57bb('0x4d')]=qs[_0x57bb('0x43')](_[_0x57bb('0x4e')](_0x18f3f0[_0x57bb('0x45')],_0x14f418[_0x57bb('0x43')]));_0x59f7b3[_0x57bb('0x4d')][_0x57bb('0x65')]=_0xcdc147['id'];if(_0x18f3f0[_0x57bb('0x45')]['filter']){_0x59f7b3['where']=_[_0x57bb('0x51')](_0x59f7b3[_0x57bb('0x4d')],{'$or':_[_0x57bb('0x4f')](_0x59f7b3[_0x57bb('0x47')],function(_0x2e8d37){var _0x1ca7ed={};_0x1ca7ed[_0x2e8d37]={'$like':'%'+_0x18f3f0[_0x57bb('0x45')][_0x57bb('0x50')]+'%'};return _0x1ca7ed;})});}_0x59f7b3=_[_0x57bb('0x51')]({},_0x59f7b3,_0x18f3f0[_0x57bb('0x58')]);return db['OpenchannelInteraction'][_0x57bb('0x53')]({'where':_0x59f7b3['where']})[_0x57bb('0x21')](function(_0x3cedbf){_0x42a2b3['count']=_0x3cedbf;if(_0x18f3f0[_0x57bb('0x45')][_0x57bb('0x69')]){_0x59f7b3[_0x57bb('0x54')]=[{'model':db['CmContact'],'as':_0x57bb('0xa5'),'required':![]},{'model':db['User'],'as':_0x57bb('0xa6'),'attributes':[_0x57bb('0x39'),_0x57bb('0xa7'),_0x57bb('0xa8')],'required':![]},{'model':db[_0x57bb('0xa9')],'as':_0x57bb('0xaa'),'attributes':['id',_0x57bb('0x39'),_0x57bb('0xab')],'where':_0x18f3f0['query'][_0x57bb('0xac')]?{'id':_0x18f3f0[_0x57bb('0x45')][_0x57bb('0xac')]}:undefined,'required':_0x18f3f0[_0x57bb('0x45')]['tag']?!![]:![]}];}return db[_0x57bb('0x8c')][_0x57bb('0x55')](_0x59f7b3);})[_0x57bb('0x21')](function(_0x3a20f7){_0x42a2b3[_0x57bb('0x56')]=_0x3a20f7;return _0x42a2b3;});}})['then'](respondWithFilteredResult(_0x4fec56,_0x59f7b3))[_0x57bb('0x2b')](handleError(_0x4fec56,null));};exports[_0x57bb('0xad')]=function(_0x33bd8b,_0x2653d7,_0x571eb1){return db['OpenchannelAccount'][_0x57bb('0x59')]({'where':{'id':_0x33bd8b[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x2653d7,null))[_0x57bb('0x21')](function(_0x2706bb){if(_0x2706bb){return _0x2706bb[_0x57bb('0xad')](_0x33bd8b['body'][_0x57bb('0xae')],_['omit'](_0x33bd8b[_0x57bb('0x5b')],['ids','id'])||{})['spread'](function(_0x434a66){for(var _0xcbf96b=0x0;_0xcbf96b<_0x33bd8b[_0x57bb('0x5b')][_0x57bb('0xae')][_0x57bb('0x48')];_0xcbf96b+=0x1){socket['emit'](_0x57bb('0xaf'),{'UserId':Number(_0x33bd8b[_0x57bb('0x5b')][_0x57bb('0xae')][_0xcbf96b]),'OpenchannelAccountId':Number(_0x33bd8b[_0x57bb('0x62')]['id'])});}return _0x434a66;});}})[_0x57bb('0x21')](respondWithResult(_0x2653d7,null))['catch'](handleError(_0x2653d7,null));};exports['removeAgents']=function(_0x232d3b,_0x2ca8c0,_0x486908){return db[_0x57bb('0x52')][_0x57bb('0x59')]({'where':{'id':_0x232d3b['params']['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x2ca8c0,null))['then'](function(_0x4f3bfd){if(_0x4f3bfd){return _0x4f3bfd[_0x57bb('0xb0')](_0x232d3b[_0x57bb('0x45')][_0x57bb('0xae')])[_0x57bb('0x21')](function(){if(_['isArray'](_0x232d3b[_0x57bb('0x45')][_0x57bb('0xae')])){for(var _0x422ba5=0x0;_0x422ba5<_0x232d3b[_0x57bb('0x45')][_0x57bb('0xae')][_0x57bb('0x48')];_0x422ba5+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x232d3b[_0x57bb('0x45')][_0x57bb('0xae')][_0x422ba5]),'OpenchannelAccountId':Number(_0x232d3b[_0x57bb('0x62')]['id'])});}}else{socket[_0x57bb('0xb1')](_0x57bb('0xb2'),{'UserId':Number(_0x232d3b[_0x57bb('0x45')][_0x57bb('0xae')]),'OpenchannelAccountId':Number(_0x232d3b[_0x57bb('0x62')]['id'])});}});}})[_0x57bb('0x21')](respondWithStatusCode(_0x2ca8c0,null))['catch'](handleError(_0x2ca8c0,null));};exports[_0x57bb('0xb3')]=function(_0x135f2a,_0x1f808f,_0xe0d949){var _0x1eda2d={};var _0x412f2a={};var _0x22f5f7;var _0x4e0f6c;return db[_0x57bb('0x52')][_0x57bb('0x68')]({'where':{'id':_0x135f2a[_0x57bb('0x62')]['id']}})['then'](handleEntityNotFound(_0x1f808f,null))['then'](function(_0x187ce3){if(_0x187ce3){_0x22f5f7=_0x187ce3;_0x412f2a[_0x57bb('0x41')]=_['keys'](db[_0x57bb('0x9a')][_0x57bb('0x3e')]);_0x412f2a[_0x57bb('0x45')]=_[_0x57bb('0x42')](_0x135f2a[_0x57bb('0x45')]);_0x412f2a['filters']=_[_0x57bb('0x44')](_0x412f2a[_0x57bb('0x41')],_0x412f2a[_0x57bb('0x45')]);_0x1eda2d[_0x57bb('0x47')]=_[_0x57bb('0x44')](_0x412f2a['model'],qs[_0x57bb('0x46')](_0x135f2a[_0x57bb('0x45')]['fields']));_0x1eda2d[_0x57bb('0x47')]=_0x1eda2d['attributes']['length']?_0x1eda2d[_0x57bb('0x47')]:_0x412f2a[_0x57bb('0x41')];_0x1eda2d['order']=qs[_0x57bb('0x4c')](_0x135f2a[_0x57bb('0x45')][_0x57bb('0x4c')]);_0x1eda2d[_0x57bb('0x4d')]=qs[_0x57bb('0x43')](_[_0x57bb('0x4e')](_0x135f2a[_0x57bb('0x45')],_0x412f2a['filters']));if(_0x135f2a[_0x57bb('0x45')][_0x57bb('0x50')]){_0x1eda2d[_0x57bb('0x4d')]=_['merge'](_0x1eda2d[_0x57bb('0x4d')],{'$or':_[_0x57bb('0x4f')](_0x1eda2d[_0x57bb('0x47')],function(_0xd81b50){var _0xebaa0e={};_0xebaa0e[_0xd81b50]={'$like':'%'+_0x135f2a['query'][_0x57bb('0x50')]+'%'};return _0xebaa0e;})});}_0x1eda2d=_[_0x57bb('0x51')]({},_0x1eda2d,_0x135f2a[_0x57bb('0x58')]);return _0x22f5f7[_0x57bb('0xb3')](_0x1eda2d);}})[_0x57bb('0x21')](function(_0x2161cb){if(_0x2161cb){_0x4e0f6c=_0x2161cb[_0x57bb('0x48')];if(!_0x135f2a[_0x57bb('0x45')][_0x57bb('0x49')](_0x57bb('0x4a'))){_0x1eda2d['limit']=qs[_0x57bb('0x31')](_0x135f2a[_0x57bb('0x45')]['limit']);_0x1eda2d[_0x57bb('0x2f')]=qs[_0x57bb('0x2f')](_0x135f2a[_0x57bb('0x45')]['offset']);}return _0x22f5f7[_0x57bb('0xb3')](_0x1eda2d);}})[_0x57bb('0x21')](function(_0x18e0fc){if(_0x18e0fc){return _0x18e0fc?{'count':_0x4e0f6c,'rows':_0x18e0fc}:null;}})[_0x57bb('0x21')](respondWithResult(_0x1f808f,null))[_0x57bb('0x2b')](handleError(_0x1f808f,null));};exports['send']=function(_0x10cc78,_0x5c41df,_0xf72b52){var _0x1de35d,_0x4af044,_0x140407;if(_[_0x57bb('0x78')](_0x10cc78[_0x57bb('0x5b')][_0x57bb('0x5b')])||_0x10cc78[_0x57bb('0x5b')][_0x57bb('0x5b')]===''){throw new db[(_0x57bb('0x6f'))][(_0x57bb('0x70'))](_0x57bb('0x79'));}if(_['isNil'](_0x10cc78[_0x57bb('0x5b')]['to'])){}_0x1de35d=_0x10cc78[_0x57bb('0x5b')]['to'];return db[_0x57bb('0x52')]['findOne']({'where':{'id':_0x10cc78[_0x57bb('0x62')]['id']}})[_0x57bb('0x21')](handleEntityNotFound(_0x5c41df,null))[_0x57bb('0x21')](function(_0x72c0d9){if(_0x72c0d9){return db[_0x57bb('0x52')][_0x57bb('0x59')]({'where':{'id':_0x72c0d9['id']},'include':[{'model':db[_0x57bb('0x7c')],'as':_0x57bb('0x7d'),'include':[{'model':db[_0x57bb('0x6e')],'as':_0x57bb('0x7e'),'where':{[_0x72c0d9[_0x57bb('0x7a')]]:_0x1de35d},'limit':0x1,'order':[[_0x57bb('0x73'),_0x57bb('0x7f')]]}]}]})[_0x57bb('0x21')](handleEntityNotFound(_0x5c41df,null))['then'](function(_0x59616c){if(_0x59616c&&_0x59616c['List']){_0x4af044=_0x59616c[_0x57bb('0x36')]({'plain':!![]});if(_0x4af044[_0x57bb('0x7d')]&&_0x4af044[_0x57bb('0x7d')][_0x57bb('0x7e')][_0x57bb('0x48')]){return _0x4af044[_0x57bb('0x7d')]['Contacts'][0x0];}return db[_0x57bb('0x6e')][_0x57bb('0x5a')](_['defaults'](_0x10cc78[_0x57bb('0x5b')],{'firstName':_0x1de35d,[_0x59616c['mapKey']]:_0x1de35d,'phone':_0x1de35d,'ListId':_0x4af044[_0x57bb('0x75')]}));}})['then'](handleEntityNotFound(_0x5c41df,null))[_0x57bb('0x21')](function(_0x39c0e1){if(_0x39c0e1){_0x140407=_0x39c0e1;return db['OpenchannelInteraction'][_0x57bb('0x59')]({'where':{'ContactId':_0x140407['id'],'closed':![],'OpenchannelAccountId':_0x4af044['id']}})[_0x57bb('0x21')](function(_0x2e8395){if(_0x2e8395){return[_0x2e8395,![]];}return db[_0x57bb('0x8c')][_0x57bb('0x5a')]({'UserId':_0x10cc78[_0x57bb('0x5d')]['id'],'ContactId':_0x140407['id'],'OpenchannelAccountId':_0x4af044['id'],'lastMsgDirection':_0x57bb('0xb4'),'Messages':[_[_0x57bb('0x51')](_0x10cc78[_0x57bb('0x5b')],{'read':![],'body':_0x10cc78[_0x57bb('0x5b')][_0x57bb('0x5b')],'OpenchannelAccountId':_0x4af044['id'],'UserId':_0x10cc78[_0x57bb('0x5d')]['id'],'ContactId':_0x140407['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x57bb('0xb5')}]})['then'](function(_0x471c5d){return[_0x471c5d,!![]];});});}})[_0x57bb('0x8f')](function(_0x29066c,_0xbe8a8c){if(_0xbe8a8c){return _0x29066c;}return db['OpenchannelMessage'][_0x57bb('0x5a')](_[_0x57bb('0x51')](_0x10cc78[_0x57bb('0x5b')],{'read':![],'body':_0x10cc78[_0x57bb('0x5b')][_0x57bb('0x5b')],'OpenchannelAccountId':_0x4af044['id'],'OpenchannelInteractionId':_0x29066c['id'],'UserId':_0x10cc78['user']['id'],'ContactId':_0x140407['id']}))[_0x57bb('0x21')](function(_0x507c04){_0x29066c[_0x57bb('0xb6')]['Messages']=[];_0x29066c[_0x57bb('0xb6')][_0x57bb('0xb5')][_0x57bb('0x94')](_0x507c04[_0x57bb('0xb6')]);return _0x29066c;});});}})[_0x57bb('0x21')](respondWithResult(_0x5c41df,null))['catch'](handleError(_0x5c41df,null));}; \ No newline at end of file +var _0xf970=['DESC','OpenchannelApplication','applications','Applications','list','orderBy','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','bulkCreate','priority','getApplications','Contact','fullname','internal','Tags','color','tag','omit','userOpenchannelAccount:save','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','push','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','offset','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','type','options','OpenchannelAccount','count','include','findAll','rows','show','params','keys','rawAttributes','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','where','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xf970,0x1b2));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0f97('0x0'));var rimraf=require(_0x0f97('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f97('0x2'));var rp=require('request-promise');var moment=require(_0x0f97('0x3'));var BPromise=require(_0x0f97('0x4'));var Mustache=require(_0x0f97('0x5'));var util=require(_0x0f97('0x6'));var path=require(_0x0f97('0x7'));var sox=require(_0x0f97('0x8'));var csv=require('to-csv');var ejs=require(_0x0f97('0x9'));var fs=require('fs');var fs_extra=require(_0x0f97('0xa'));var _=require(_0x0f97('0xb'));var squel=require(_0x0f97('0xc'));var crypto=require(_0x0f97('0xd'));var jsforce=require(_0x0f97('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f97('0xf'));var querystring=require(_0x0f97('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f97('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0f97('0x12'));var hardwareService=require(_0x0f97('0x13'));var logger=require(_0x0f97('0x14'))(_0x0f97('0x15'));var utils=require(_0x0f97('0x16'));var config=require(_0x0f97('0x17'));var licenseUtil=require(_0x0f97('0x18'));var db=require(_0x0f97('0x19'))['db'];config[_0x0f97('0x1a')]=_[_0x0f97('0x1b')](config[_0x0f97('0x1a')],{'host':_0x0f97('0x1c'),'port':0x18eb});var socket=require(_0x0f97('0x1d'))(new Redis(config[_0x0f97('0x1a')]));require('./openchannelAccount.socket')[_0x0f97('0x1e')](socket);var jayson=require(_0x0f97('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0f97('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbb70dd,_0x39a9ff,_0x5e4d87,_0x484933){return new BPromise(function(_0x4b9553,_0x1eb1c3){var _0x3c8027=_0x484933||client;return _0x3c8027['request'](_0xbb70dd,_0x5e4d87)[_0x0f97('0x21')](function(_0x59196a){logger[_0x0f97('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x39a9ff,_0x0f97('0x23'));logger[_0x0f97('0x24')](_0x0f97('0x25'),_0x39a9ff,_0x0f97('0x23'),JSON[_0x0f97('0x26')](_0x59196a));if(_0x59196a['error']){if(_0x59196a['error']['code']===0x1f4){logger[_0x0f97('0x27')](_0x0f97('0x28'),_0x39a9ff,_0x59196a[_0x0f97('0x27')][_0x0f97('0x29')]);return _0x1eb1c3(_0x59196a[_0x0f97('0x27')]['message']);}logger[_0x0f97('0x27')](_0x0f97('0x28'),_0x39a9ff,_0x59196a['error'][_0x0f97('0x29')]);return _0x4b9553(_0x59196a[_0x0f97('0x27')][_0x0f97('0x29')]);}else{logger[_0x0f97('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x39a9ff,_0x0f97('0x23'));_0x4b9553(_0x59196a[_0x0f97('0x2a')]['message']);}})[_0x0f97('0x2b')](function(_0x1d85db){logger['error'](_0x0f97('0x28'),_0x39a9ff,_0x1d85db);_0x1eb1c3(_0x1d85db);});});}function respondWithStatusCode(_0x4a463c,_0x36e4d0){_0x36e4d0=_0x36e4d0||0xcc;return function(_0x16638e){if(_0x16638e){return _0x4a463c[_0x0f97('0x2c')](_0x36e4d0);}return _0x4a463c[_0x0f97('0x2d')](_0x36e4d0)['end']();};}function respondWithResult(_0x40a0e0,_0x176153){_0x176153=_0x176153||0xc8;return function(_0x360d5e){if(_0x360d5e){return _0x40a0e0[_0x0f97('0x2d')](_0x176153)[_0x0f97('0x2e')](_0x360d5e);}};}function respondWithFilteredResult(_0x3792ec,_0x24b531){return function(_0x2691c6){if(_0x2691c6){var _0xa688f6=typeof _0x24b531['offset']===_0x0f97('0x2f')&&typeof _0x24b531[_0x0f97('0x30')]==='undefined';var _0x264228=_0x2691c6['count'];var _0x400aac=_0xa688f6?0x0:_0x24b531[_0x0f97('0x31')];var _0x2a9993=_0xa688f6?_0x2691c6['count']:_0x24b531[_0x0f97('0x31')]+_0x24b531[_0x0f97('0x30')];var _0x22bf27;if(_0x2a9993>=_0x264228){_0x2a9993=_0x264228;_0x22bf27=0xc8;}else{_0x22bf27=0xce;}_0x3792ec[_0x0f97('0x2d')](_0x22bf27);return _0x3792ec['set'](_0x0f97('0x32'),_0x400aac+'-'+_0x2a9993+'/'+_0x264228)[_0x0f97('0x2e')](_0x2691c6);}return null;};}function patchUpdates(_0x5915f2){return function(_0x354763){try{jsonpatch[_0x0f97('0x33')](_0x354763,_0x5915f2,!![]);}catch(_0x2f3288){return BPromise[_0x0f97('0x34')](_0x2f3288);}return _0x354763['save']();};}function saveUpdates(_0x6f3786,_0x285c98){return function(_0x476483){if(_0x476483){return _0x476483[_0x0f97('0x35')](_0x6f3786)[_0x0f97('0x21')](function(_0x42f45c){return _0x42f45c;});}return null;};}function removeEntity(_0x42e919,_0xc32b69){return function(_0x1e15aa){if(_0x1e15aa){return _0x1e15aa[_0x0f97('0x36')]()[_0x0f97('0x21')](function(){var _0x2f6f67=_0x1e15aa['get']({'plain':!![]});var _0x510301=_0x0f97('0x37');return db['UserProfileResource'][_0x0f97('0x36')]({'where':{'type':_0x510301,'resourceId':_0x2f6f67['id']}})['then'](function(){return _0x1e15aa;});})[_0x0f97('0x21')](function(){_0x42e919[_0x0f97('0x2d')](0xcc)[_0x0f97('0x38')]();});}};}function handleEntityNotFound(_0x5a9d01,_0x2f8759){return function(_0x1c7914){if(!_0x1c7914){_0x5a9d01['sendStatus'](0x194);}return _0x1c7914;};}function handleError(_0x30edc4,_0x3ae60b){_0x3ae60b=_0x3ae60b||0x1f4;return function(_0x4ee5fc){logger['error'](_0x4ee5fc[_0x0f97('0x39')]);if(_0x4ee5fc[_0x0f97('0x3a')]){delete _0x4ee5fc['name'];}_0x30edc4[_0x0f97('0x2d')](_0x3ae60b)[_0x0f97('0x3b')](_0x4ee5fc);};}exports[_0x0f97('0x3c')]=function(_0x4cde42,_0x381961){var _0x4f82e0={'include':[{'model':db[_0x0f97('0x3d')],'as':_0x0f97('0x3e')}]},_0x41626b={},_0x47050e={'count':0x0,'rows':[]};var _0x2f1353=_[_0x0f97('0x3f')](db['OpenchannelAccount']['rawAttributes'],function(_0x22febb){return{'name':_0x22febb[_0x0f97('0x40')],'type':_0x22febb['type'][_0x0f97('0x41')]};});_0x41626b[_0x0f97('0x42')]=_[_0x0f97('0x3f')](_0x2f1353,_0x0f97('0x3a'));_0x41626b[_0x0f97('0x43')]=_['keys'](_0x4cde42['query']);_0x41626b[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x41626b[_0x0f97('0x42')],_0x41626b[_0x0f97('0x43')]);_0x4f82e0[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x41626b[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x4cde42[_0x0f97('0x43')][_0x0f97('0x47')]));_0x4f82e0[_0x0f97('0x46')]=_0x4f82e0['attributes'][_0x0f97('0x48')]?_0x4f82e0['attributes']:_0x41626b[_0x0f97('0x42')];if(!_0x4cde42[_0x0f97('0x43')][_0x0f97('0x49')]('nolimit')){_0x4f82e0[_0x0f97('0x30')]=qs['limit'](_0x4cde42[_0x0f97('0x43')][_0x0f97('0x30')]);_0x4f82e0[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x4cde42['query'][_0x0f97('0x31')]);}_0x4f82e0[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x4cde42[_0x0f97('0x43')]['sort']);_0x4f82e0['where']=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x4cde42[_0x0f97('0x43')],_0x41626b[_0x0f97('0x44')]),_0x2f1353);if(_0x4cde42[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x4f82e0['where']=_[_0x0f97('0x4e')](_0x4f82e0['where'],{'$or':_[_0x0f97('0x3f')](_0x2f1353,function(_0x4f287a){if(_0x4f287a[_0x0f97('0x4f')]!=='VIRTUAL'){var _0x356878={};_0x356878[_0x4f287a[_0x0f97('0x3a')]]={'$like':'%'+_0x4cde42[_0x0f97('0x43')][_0x0f97('0x4d')]+'%'};return _0x356878;}})});}_0x4f82e0=_[_0x0f97('0x4e')]({},_0x4f82e0,_0x4cde42[_0x0f97('0x50')]);var _0xfc2a0={'where':_0x4f82e0['where']};return db[_0x0f97('0x51')][_0x0f97('0x52')](_0xfc2a0)[_0x0f97('0x21')](function(_0x43380c){_0x47050e[_0x0f97('0x52')]=_0x43380c;if(_0x4cde42['query']['includeAll']){_0x4f82e0[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x51')][_0x0f97('0x54')](_0x4f82e0);})[_0x0f97('0x21')](function(_0x497be5){_0x47050e[_0x0f97('0x55')]=_0x497be5;return _0x47050e;})[_0x0f97('0x21')](respondWithFilteredResult(_0x381961,_0x4f82e0))[_0x0f97('0x2b')](handleError(_0x381961,null));};exports[_0x0f97('0x56')]=function(_0x1b93bb,_0x1b6588){var _0x227ccf={'raw':![],'where':{'id':_0x1b93bb[_0x0f97('0x57')]['id']},'include':[{'model':db[_0x0f97('0x3d')],'as':_0x0f97('0x3e')}]},_0x1b9604={};_0x1b9604[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0x51')][_0x0f97('0x59')]);_0x1b9604[_0x0f97('0x43')]=_['keys'](_0x1b93bb[_0x0f97('0x43')]);_0x1b9604['filters']=_[_0x0f97('0x45')](_0x1b9604['model'],_0x1b9604[_0x0f97('0x43')]);_0x227ccf[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x1b9604[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x1b93bb['query'][_0x0f97('0x47')]));_0x227ccf[_0x0f97('0x46')]=_0x227ccf[_0x0f97('0x46')]['length']?_0x227ccf['attributes']:_0x1b9604[_0x0f97('0x42')];if(_0x1b93bb['query'][_0x0f97('0x5a')]){_0x227ccf[_0x0f97('0x53')]=[{'all':!![]}];}_0x227ccf=_[_0x0f97('0x4e')]({},_0x227ccf,_0x1b93bb[_0x0f97('0x50')]);return db[_0x0f97('0x51')]['find'](_0x227ccf)[_0x0f97('0x21')](handleEntityNotFound(_0x1b6588,null))['then'](respondWithResult(_0x1b6588,null))[_0x0f97('0x2b')](handleError(_0x1b6588,null));};exports[_0x0f97('0x5b')]=function(_0x4825ac,_0xeeb3b7){return db[_0x0f97('0x51')][_0x0f97('0x5b')](_0x4825ac[_0x0f97('0x5c')],{})[_0x0f97('0x21')](function(_0x2fc21a){var _0x5893f3=_0x4825ac[_0x0f97('0x5d')][_0x0f97('0x5e')]({'plain':!![]});if(!_0x5893f3)throw new Error(_0x0f97('0x5f'));if(_0x5893f3[_0x0f97('0x60')]===_0x0f97('0x5d')){var _0x1c0aa3=_0x2fc21a['get']({'plain':!![]});var _0x528d99=_0x0f97('0x37');return db[_0x0f97('0x61')][_0x0f97('0x62')]({'where':{'name':_0x528d99,'userProfileId':_0x5893f3[_0x0f97('0x63')]},'raw':!![]})[_0x0f97('0x21')](function(_0x37eacc){if(_0x37eacc&&_0x37eacc[_0x0f97('0x64')]===0x0){return db[_0x0f97('0x65')][_0x0f97('0x5b')]({'name':_0x1c0aa3['name'],'resourceId':_0x1c0aa3['id'],'type':_0x37eacc[_0x0f97('0x3a')],'sectionId':_0x37eacc['id']},{})[_0x0f97('0x21')](function(){return _0x2fc21a;});}else{return _0x2fc21a;}})[_0x0f97('0x2b')](function(_0x23d3e4){logger['error'](_0x0f97('0x66'),_0x23d3e4);throw _0x23d3e4;});}return _0x2fc21a;})[_0x0f97('0x21')](respondWithResult(_0xeeb3b7,0xc9))[_0x0f97('0x2b')](handleError(_0xeeb3b7,null));};exports[_0x0f97('0x35')]=function(_0x444f99,_0x4a091c){if(_0x444f99[_0x0f97('0x5c')]['id']){delete _0x444f99[_0x0f97('0x5c')]['id'];}return db['OpenchannelAccount'][_0x0f97('0x62')]({'where':{'id':_0x444f99[_0x0f97('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0f97('0x3e')}]})[_0x0f97('0x21')](handleEntityNotFound(_0x4a091c,null))[_0x0f97('0x21')](saveUpdates(_0x444f99['body'],null))[_0x0f97('0x21')](respondWithResult(_0x4a091c,null))[_0x0f97('0x2b')](handleError(_0x4a091c,null));};exports[_0x0f97('0x36')]=function(_0x448fb3,_0x35b6e3){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x448fb3[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x35b6e3,null))[_0x0f97('0x21')](removeEntity(_0x35b6e3,null))[_0x0f97('0x2b')](handleError(_0x35b6e3,null));};exports[_0x0f97('0x67')]=function(_0x40f6e2,_0x914e07){return db['OpenchannelAccount'][_0x0f97('0x67')]()[_0x0f97('0x21')](respondWithResult(_0x914e07,null))['catch'](handleError(_0x914e07,null));};exports[_0x0f97('0x68')]=function(_0x122639,_0x1d546f,_0x3f94a6){if(_0x122639[_0x0f97('0x5c')]['id']){delete _0x122639[_0x0f97('0x5c')]['id'];}return db[_0x0f97('0x51')]['find']({'where':{'id':_0x122639[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x1d546f,null))['then'](function(_0x165c83){if(_0x165c83){_0x122639[_0x0f97('0x5c')][_0x0f97('0x69')]=_0x165c83['id'];return db[_0x0f97('0x6a')][_0x0f97('0x5b')](_0x122639[_0x0f97('0x5c')]);}})[_0x0f97('0x21')](respondWithResult(_0x1d546f,null))[_0x0f97('0x2b')](handleError(_0x1d546f,null));};exports[_0x0f97('0x6b')]=function(_0x2e2222,_0x16c1b2,_0x4e04be){var _0x53ea78={'raw':![],'where':{}};var _0x5b0464={};var _0x1b009c={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x2e2222['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x16c1b2,null))['then'](function(_0x7e045e){if(_0x7e045e){_0x5b0464['model']=_['keys'](db[_0x0f97('0x6a')][_0x0f97('0x59')]);_0x5b0464[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x2e2222[_0x0f97('0x43')]);_0x5b0464[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x5b0464[_0x0f97('0x42')],_0x5b0464[_0x0f97('0x43')]);_0x53ea78[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x5b0464['model'],qs[_0x0f97('0x47')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x47')]));_0x53ea78['attributes']=_0x53ea78[_0x0f97('0x46')][_0x0f97('0x48')]?_0x53ea78['attributes']:_0x5b0464[_0x0f97('0x42')];if(!_0x2e2222[_0x0f97('0x43')][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x53ea78[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x30')]);_0x53ea78[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x2e2222[_0x0f97('0x43')]['offset']);}_0x53ea78['order']=qs[_0x0f97('0x4b')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x53ea78['where']=qs[_0x0f97('0x44')](_['pick'](_0x2e2222[_0x0f97('0x43')],_0x5b0464['filters']));_0x53ea78['where'][_0x0f97('0x69')]=_0x7e045e['id'];if(_0x2e2222[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x53ea78['where']=_[_0x0f97('0x4e')](_0x53ea78[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x53ea78[_0x0f97('0x46')],function(_0x3a29d4){var _0x1cbbb9={};_0x1cbbb9[_0x3a29d4]={'$like':'%'+_0x2e2222[_0x0f97('0x43')]['filter']+'%'};return _0x1cbbb9;})});}_0x53ea78=_['merge']({},_0x53ea78,_0x2e2222[_0x0f97('0x50')]);return db['Disposition'][_0x0f97('0x52')]({'where':_0x53ea78[_0x0f97('0x6e')]})[_0x0f97('0x21')](function(_0x157eff){_0x1b009c[_0x0f97('0x52')]=_0x157eff;if(_0x2e2222['query'][_0x0f97('0x5a')]){_0x53ea78[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x6a')][_0x0f97('0x54')](_0x53ea78);})[_0x0f97('0x21')](function(_0x36218e){_0x1b009c[_0x0f97('0x55')]=_0x36218e;return _0x1b009c;});}})['then'](respondWithFilteredResult(_0x16c1b2,_0x53ea78))['catch'](handleError(_0x16c1b2,null));};exports['removeDispositions']=function(_0x2cf0af,_0xb5e91a,_0x4b86da){return db[_0x0f97('0x51')]['find']({'where':{'id':_0x2cf0af[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0xb5e91a,null))['then'](function(_0xc82650){if(_0xc82650){return _0xc82650[_0x0f97('0x6f')](_0x2cf0af[_0x0f97('0x43')][_0x0f97('0x70')]);}})[_0x0f97('0x21')](respondWithStatusCode(_0xb5e91a,null))[_0x0f97('0x2b')](handleError(_0xb5e91a,null));};exports[_0x0f97('0x71')]=function(_0x5af76a,_0x12a2e5,_0x192afe){if(_0x5af76a['body']['id']){delete _0x5af76a['body']['id'];}return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5af76a[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x12a2e5,null))['then'](function(_0x2f0001){if(_0x2f0001){_0x5af76a[_0x0f97('0x5c')][_0x0f97('0x69')]=_0x2f0001['id'];return db[_0x0f97('0x72')]['create'](_0x5af76a[_0x0f97('0x5c')]);}})['then'](respondWithResult(_0x12a2e5,null))['catch'](handleError(_0x12a2e5,null));};exports[_0x0f97('0x73')]=function(_0x2c4c90,_0x319880,_0x19a83d){var _0x4752cc={'raw':![],'where':{}};var _0x23a577={};var _0x27924f={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x2c4c90[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0x319880,null))[_0x0f97('0x21')](function(_0x59e55a){if(_0x59e55a){_0x23a577[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0x72')][_0x0f97('0x59')]);_0x23a577[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x2c4c90[_0x0f97('0x43')]);_0x23a577['filters']=_['intersection'](_0x23a577[_0x0f97('0x42')],_0x23a577[_0x0f97('0x43')]);_0x4752cc['attributes']=_[_0x0f97('0x45')](_0x23a577[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x2c4c90[_0x0f97('0x43')]['fields']));_0x4752cc['attributes']=_0x4752cc[_0x0f97('0x46')][_0x0f97('0x48')]?_0x4752cc['attributes']:_0x23a577['model'];if(!_0x2c4c90['query'][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x4752cc[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x30')]);_0x4752cc[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x2c4c90['query'][_0x0f97('0x31')]);}_0x4752cc['order']=qs['sort'](_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x4752cc[_0x0f97('0x6e')]=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x2c4c90['query'],_0x23a577[_0x0f97('0x44')]));_0x4752cc[_0x0f97('0x6e')][_0x0f97('0x69')]=_0x59e55a['id'];if(_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x4752cc[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x4752cc[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x4752cc[_0x0f97('0x46')],function(_0x52aba7){var _0x183e1a={};_0x183e1a[_0x52aba7]={'$like':'%'+_0x2c4c90['query']['filter']+'%'};return _0x183e1a;})});}_0x4752cc=_['merge']({},_0x4752cc,_0x2c4c90['options']);return db[_0x0f97('0x72')][_0x0f97('0x52')]({'where':_0x4752cc[_0x0f97('0x6e')]})[_0x0f97('0x21')](function(_0x4723f1){_0x27924f[_0x0f97('0x52')]=_0x4723f1;if(_0x2c4c90[_0x0f97('0x43')]['includeAll']){_0x4752cc[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x72')]['findAll'](_0x4752cc);})[_0x0f97('0x21')](function(_0x2d9e9a){_0x27924f[_0x0f97('0x55')]=_0x2d9e9a;return _0x27924f;});}})[_0x0f97('0x21')](respondWithFilteredResult(_0x319880,_0x4752cc))[_0x0f97('0x2b')](handleError(_0x319880,null));};exports[_0x0f97('0x74')]=function(_0x5c9d41,_0x50d535,_0x1e0123){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5c9d41['params']['id']}})['then'](handleEntityNotFound(_0x50d535,null))[_0x0f97('0x21')](function(_0x43deeb){if(_0x43deeb){return _0x43deeb[_0x0f97('0x74')](_0x5c9d41[_0x0f97('0x43')]['ids']);}})[_0x0f97('0x21')](respondWithStatusCode(_0x50d535,null))[_0x0f97('0x2b')](handleError(_0x50d535,null));};exports[_0x0f97('0x75')]=function(_0x110144,_0x45f800,_0x5dfd9c){var _0x2d297={'body':_0x110144['body'],'channel':_0x0f97('0x76')};var _0x20f805=[];var _0x503f1a=[];var _0x47e022={};var _0x2fe5c3=![];return db[_0x0f97('0x77')][_0x0f97('0x67')]()['then'](function(_0x5b3b86){if(!_0x5b3b86){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x7a'));}_0x20f805=_['difference'](_['keys'](_0x5b3b86),[_0x0f97('0x7b'),_0x0f97('0x7c')]);_0x503f1a=_[_0x0f97('0x7d')](_[_0x0f97('0x58')](_0x5b3b86),[_0x0f97('0x7b'),'updatedAt',_0x0f97('0x7e'),_0x0f97('0x7f')]);if(_0x110144[_0x0f97('0x5c')]['id']){delete _0x110144[_0x0f97('0x5c')]['id'];}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')])){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x82'));}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x5c')])||_0x110144[_0x0f97('0x5c')][_0x0f97('0x5c')]===''){throw new db['Sequelize'][(_0x0f97('0x79'))](_0x0f97('0x83'));}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x84')])){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x85')+_0x503f1a);}if(!_[_0x0f97('0x86')](_0x503f1a,_0x110144[_0x0f97('0x5c')][_0x0f97('0x84')])){throw new db[(_0x0f97('0x78'))]['ValidationError'](_0x0f97('0x87')+_0x503f1a);}_0x47e022[_0x110144['body']['mapKey']]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')];})[_0x0f97('0x21')](function(){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x110144['params']['id']},'include':[{'model':db[_0x0f97('0x88')],'as':_0x0f97('0x89'),'include':[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0x8a'),'where':_0x47e022,'limit':0x1,'order':[[_0x0f97('0x7c'),_0x0f97('0x8b')]]}]},{'model':db[_0x0f97('0x8c')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x45f800,null))[_0x0f97('0x21')](function(_0x55ca09){if(_0x55ca09&&_0x55ca09['List']){_0x2d297['account']=_0x55ca09;_0x2d297[_0x0f97('0x8d')]=_0x55ca09[_0x0f97('0x8e')];_0x2d297[_0x0f97('0x8f')]=_0x55ca09[_0x0f97('0x89')];_0x2d297['applications']=_[_0x0f97('0x90')](_0x2d297['applications'],['priority'],[_0x0f97('0x91')]);if(_0x2d297['account'][_0x0f97('0x8e')]){delete _0x2d297['account']['Applications'];}if(_0x2d297[_0x0f97('0x92')][_0x0f97('0x89')]&&_0x2d297[_0x0f97('0x92')][_0x0f97('0x89')][_0x0f97('0x8a')][_0x0f97('0x48')]){return _0x2d297[_0x0f97('0x92')][_0x0f97('0x89')][_0x0f97('0x8a')][0x0];}var _0x38aa66=_[_0x0f97('0x1b')](_0x110144['body'],{'firstName':_0x110144['body'][_0x0f97('0x81')],'ListId':_0x55ca09[_0x0f97('0x7f')]});_0x38aa66[_0x110144['body'][_0x0f97('0x84')]]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')];return db[_0x0f97('0x77')]['create'](_0x38aa66,{'fields':_0x20f805,'raw':!![]});}})[_0x0f97('0x21')](handleEntityNotFound(_0x45f800,null))['then'](function(_0x233a69){_0x2d297[_0x0f97('0x93')]=_0x233a69;if(_0x233a69){var _0x5a783c={'ContactId':_0x233a69['id'],'OpenchannelAccountId':_0x110144[_0x0f97('0x57')]['id'],'from':(_0x233a69[_0x0f97('0x94')]||'')+'\x20'+(_0x233a69[_0x0f97('0x95')]||'')};var _0x5e9cff={'OpenchannelAccountId':_0x110144[_0x0f97('0x57')]['id'],'closed':![]};if(_0x110144['body'][_0x0f97('0x96')]){_0x5e9cff[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')];return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':_0x5e9cff})[_0x0f97('0x21')](function(_0x2aa0e3){if(_0x2aa0e3){return[_0x2aa0e3,![]];}_0x5a783c[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')]['threadId'];_0x5a783c[_0x0f97('0x98')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x98')];return db[_0x0f97('0x97')][_0x0f97('0x5b')](_0x5a783c)['then'](function(_0x217a14){return[_0x217a14,!![]];});});}else{_0x5e9cff['threadId']=null;}_0x5e9cff[_0x0f97('0x99')]=_0x233a69['id'];return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':_0x5e9cff})[_0x0f97('0x21')](function(_0x1a7210){if(_0x1a7210){return[_0x1a7210,![]];}return db['OpenchannelInteraction'][_0x0f97('0x5b')](_0x5a783c)['then'](function(_0x19f1a5){return[_0x19f1a5,!![]];});});}})[_0x0f97('0x9a')](function(_0x4f6f05,_0x11c2a9){if(_0x4f6f05){_0x2fe5c3=_0x11c2a9;if(!_0x11c2a9){var _0x5e9401={'from':(_0x2d297['contact'][_0x0f97('0x94')]||'')+'\x20'+(_0x2d297['contact'][_0x0f97('0x95')]||'')};if(_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')]&&_0x110144[_0x0f97('0x5c')]['messageId']&&_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')]!=_0x110144['body'][_0x0f97('0x9b')]){_0x5e9401[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x9b')];}return _0x4f6f05[_0x0f97('0x35')](_0x5e9401);}else{return _0x4f6f05;}}})['then'](function(_0x479a67){_0x2d297[_0x0f97('0x9c')]=_0x479a67[_0x0f97('0x5e')]({'plain':!![]});_0x2d297[_0x0f97('0x9c')][_0x0f97('0x9d')]=_0x2fe5c3;if(_0x2d297[_0x0f97('0x9c')][_0x0f97('0x9d')]){if(_0x2d297[_0x0f97('0x92')][_0x0f97('0x9e')]){_0x2d297[_0x0f97('0x8d')]['push']({'id':0x0,'priority':_0x2d297[_0x0f97('0x8d')][_0x0f97('0x48')]+0x1,'app':_0x0f97('0x9f'),'appdata':_0x0f97('0xa0'),'interval':'*,*,*,*'});}}return db[_0x0f97('0xa1')][_0x0f97('0x5b')]({'body':_0x110144['body']['body'],'OpenchannelAccountId':_0x110144['params']['id'],'OpenchannelInteractionId':_0x479a67['id'],'direction':'in','ContactId':_0x2d297[_0x0f97('0x93')]['id'],'AttachmentId':_0x110144[_0x0f97('0x5c')][_0x0f97('0xa2')]});})[_0x0f97('0x21')](function(_0x4388a7){_0x2d297[_0x0f97('0x29')]=_0x4388a7;if(_0x2d297[_0x0f97('0x9c')][_0x0f97('0xa3')]){return db[_0x0f97('0xa4')][_0x0f97('0x62')]({'attributes':['id',_0x0f97('0x3a')],'where':{'id':_0x2d297[_0x0f97('0x9c')][_0x0f97('0xa3')]}})[_0x0f97('0x21')](function(_0x3bac1a){if(_0x3bac1a){_0x2d297['applications'][_0x0f97('0xa5')]({'id':0x0,'priority':0x0,'app':_0x0f97('0xa6'),'appdata':_0x3bac1a[_0x0f97('0x3a')]+','+(_0x2d297[_0x0f97('0x92')][_0x0f97('0xa7')]||0xa),'interval':'*,*,*,*'});_0x2d297['forcedOwnership']=![];}return respondWithRpcPromise(_0x0f97('0xa8'),_0x0f97('0xa9'),_0x2d297);});}return respondWithRpcPromise(_0x0f97('0xa8'),_0x0f97('0xa9'),_0x2d297);})['then'](function(_0xdccb1c){respondWithRpcPromise('EventManager',_0x0f97('0xaa'),{'event':_0x0f97('0x75'),'message':_0xdccb1c},client9002);return _0xdccb1c;})['then'](respondWithResult(_0x45f800,null))[_0x0f97('0x2b')](handleError(_0x45f800,null));};exports['addApplications']=function(_0x9bae92,_0x5410b1,_0x483dea){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x9bae92[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0x5410b1,null))[_0x0f97('0x21')](function(_0xc9c1a4){if(_0xc9c1a4){return db[_0x0f97('0xab')]['transaction'](function(_0x4d062b){return db['OpenchannelApplication'][_0x0f97('0x36')]({'where':{'OpenchannelAccountId':_0x9bae92['params']['id']},'transaction':_0x4d062b})[_0x0f97('0x21')](function(_0x23b71d){var _0x4941c5=_[_0x0f97('0x3f')](_0x9bae92[_0x0f97('0x5c')],function(_0x5e3eeb){_0x5e3eeb[_0x0f97('0x69')]=_0x9bae92['params']['id'];return _0x5e3eeb;});return db[_0x0f97('0x8c')][_0x0f97('0xac')](_0x4941c5,{'transaction':_0x4d062b});});})[_0x0f97('0x21')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x9bae92[_0x0f97('0x57')]['id']},'order':_0x0f97('0xad')});});}})[_0x0f97('0x21')](respondWithResult(_0x5410b1,null))[_0x0f97('0x2b')](handleError(_0x5410b1,null));};exports[_0x0f97('0xae')]=function(_0x3f2d1b,_0xecf9ab,_0x299bc3){var _0x378f61={};var _0x13d601={};var _0x3cec9f;var _0x523a4e;return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3f2d1b[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0xecf9ab,null))[_0x0f97('0x21')](function(_0x33ab5e){if(_0x33ab5e){_0x3cec9f=_0x33ab5e;_0x13d601[_0x0f97('0x42')]=_['keys'](db[_0x0f97('0x8c')][_0x0f97('0x59')]);_0x13d601[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x3f2d1b['query']);_0x13d601[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x13d601['model'],_0x13d601[_0x0f97('0x43')]);_0x378f61['attributes']=_[_0x0f97('0x45')](_0x13d601[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x47')]));_0x378f61['attributes']=_0x378f61[_0x0f97('0x46')][_0x0f97('0x48')]?_0x378f61[_0x0f97('0x46')]:_0x13d601[_0x0f97('0x42')];_0x378f61['order']=qs[_0x0f97('0x4b')](_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x378f61['where']=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x3f2d1b[_0x0f97('0x43')],_0x13d601[_0x0f97('0x44')]));if(_0x3f2d1b[_0x0f97('0x43')]['filter']){_0x378f61[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x378f61[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x378f61[_0x0f97('0x46')],function(_0x1e1995){var _0x4a8aa7={};_0x4a8aa7[_0x1e1995]={'$like':'%'+_0x3f2d1b[_0x0f97('0x43')]['filter']+'%'};return _0x4a8aa7;})});}_0x378f61=_[_0x0f97('0x4e')]({},_0x378f61,_0x3f2d1b[_0x0f97('0x50')]);return _0x3cec9f[_0x0f97('0xae')](_0x378f61);}})[_0x0f97('0x21')](function(_0x3d3605){if(_0x3d3605){_0x523a4e=_0x3d3605[_0x0f97('0x48')];if(!_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x49')]('nolimit')){_0x378f61[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x3f2d1b[_0x0f97('0x43')]['limit']);_0x378f61[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x3f2d1b['query'][_0x0f97('0x31')]);}return _0x3cec9f[_0x0f97('0xae')](_0x378f61);}})[_0x0f97('0x21')](function(_0xe0ab70){if(_0xe0ab70){return _0xe0ab70?{'count':_0x523a4e,'rows':_0xe0ab70}:null;}})[_0x0f97('0x21')](respondWithResult(_0xecf9ab,null))[_0x0f97('0x2b')](handleError(_0xecf9ab,null));};exports['getInteractions']=function(_0x3f9f1a,_0x12bec5,_0x1623f1){var _0x1206d4={'raw':![],'where':{}};var _0x401b78={};var _0x2f4d07={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3f9f1a[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x12bec5,null))['then'](function(_0x5bb6e6){if(_0x5bb6e6){_0x401b78[_0x0f97('0x42')]=_[_0x0f97('0x58')](db['OpenchannelInteraction'][_0x0f97('0x59')]);_0x401b78[_0x0f97('0x43')]=_['keys'](_0x3f9f1a[_0x0f97('0x43')]);_0x401b78[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x401b78[_0x0f97('0x42')],_0x401b78[_0x0f97('0x43')]);_0x1206d4[_0x0f97('0x46')]=_['intersection'](_0x401b78[_0x0f97('0x42')],qs['fields'](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x47')]));_0x1206d4[_0x0f97('0x46')]=_0x1206d4['attributes'][_0x0f97('0x48')]?_0x1206d4[_0x0f97('0x46')]:_0x401b78[_0x0f97('0x42')];if(!_0x3f9f1a['query']['hasOwnProperty']('nolimit')){_0x1206d4[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x30')]);_0x1206d4['offset']=qs[_0x0f97('0x31')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x31')]);}_0x1206d4[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x1206d4[_0x0f97('0x6e')]=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x3f9f1a['query'],_0x401b78[_0x0f97('0x44')]));_0x1206d4[_0x0f97('0x6e')][_0x0f97('0x69')]=_0x5bb6e6['id'];if(_0x3f9f1a[_0x0f97('0x43')]['filter']){_0x1206d4[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x1206d4[_0x0f97('0x6e')],{'$or':_['map'](_0x1206d4[_0x0f97('0x46')],function(_0x4f2ec5){var _0x3a6a15={};_0x3a6a15[_0x4f2ec5]={'$like':'%'+_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x4d')]+'%'};return _0x3a6a15;})});}_0x1206d4=_['merge']({},_0x1206d4,_0x3f9f1a[_0x0f97('0x50')]);return db[_0x0f97('0x97')][_0x0f97('0x52')]({'where':_0x1206d4[_0x0f97('0x6e')]})['then'](function(_0x8bba1f){_0x2f4d07[_0x0f97('0x52')]=_0x8bba1f;if(_0x3f9f1a[_0x0f97('0x43')]['includeAll']){_0x1206d4['include']=[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0xaf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x0f97('0x3a'),_0x0f97('0xb0'),_0x0f97('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x0f97('0xb2'),'attributes':['id',_0x0f97('0x3a'),_0x0f97('0xb3')],'where':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]?{'id':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]}:undefined,'required':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x1206d4);})[_0x0f97('0x21')](function(_0x5be99d){_0x2f4d07[_0x0f97('0x55')]=_0x5be99d;return _0x2f4d07;});}})[_0x0f97('0x21')](respondWithFilteredResult(_0x12bec5,_0x1206d4))[_0x0f97('0x2b')](handleError(_0x12bec5,null));};exports['addAgents']=function(_0x5e63c5,_0x2b59fb,_0x169895){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5e63c5['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x2b59fb,null))[_0x0f97('0x21')](function(_0x3cb85f){if(_0x3cb85f){return _0x3cb85f['addAgents'](_0x5e63c5[_0x0f97('0x5c')][_0x0f97('0x70')],_[_0x0f97('0xb5')](_0x5e63c5['body'],[_0x0f97('0x70'),'id'])||{})[_0x0f97('0x9a')](function(_0x59db10){for(var _0x83e99=0x0;_0x83e99<_0x5e63c5[_0x0f97('0x5c')]['ids']['length'];_0x83e99+=0x1){socket['emit'](_0x0f97('0xb6'),{'UserId':Number(_0x5e63c5[_0x0f97('0x5c')][_0x0f97('0x70')][_0x83e99]),'OpenchannelAccountId':Number(_0x5e63c5['params']['id'])});}return _0x59db10;});}})[_0x0f97('0x21')](respondWithResult(_0x2b59fb,null))['catch'](handleError(_0x2b59fb,null));};exports['removeAgents']=function(_0x52a7ff,_0x404c6d,_0x3cc3b7){return db['OpenchannelAccount'][_0x0f97('0x62')]({'where':{'id':_0x52a7ff['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x404c6d,null))['then'](function(_0x43bc75){if(_0x43bc75){return _0x43bc75['removeAgents'](_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')])['then'](function(){if(_[_0x0f97('0xb7')](_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')])){for(var _0x439e05=0x0;_0x439e05<_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')][_0x0f97('0x48')];_0x439e05+=0x1){socket[_0x0f97('0xb8')](_0x0f97('0xb9'),{'UserId':Number(_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')][_0x439e05]),'OpenchannelAccountId':Number(_0x52a7ff['params']['id'])});}}else{socket['emit'](_0x0f97('0xb9'),{'UserId':Number(_0x52a7ff[_0x0f97('0x43')]['ids']),'OpenchannelAccountId':Number(_0x52a7ff[_0x0f97('0x57')]['id'])});}});}})[_0x0f97('0x21')](respondWithStatusCode(_0x404c6d,null))['catch'](handleError(_0x404c6d,null));};exports[_0x0f97('0xba')]=function(_0x3ff01c,_0x3a780a,_0x5918ed){var _0x273974={};var _0x244b1d={};var _0x319b9d;var _0x2d2b3d;return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3ff01c[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x3a780a,null))[_0x0f97('0x21')](function(_0x3cef25){if(_0x3cef25){_0x319b9d=_0x3cef25;_0x244b1d[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0xa4')][_0x0f97('0x59')]);_0x244b1d['query']=_[_0x0f97('0x58')](_0x3ff01c[_0x0f97('0x43')]);_0x244b1d[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x244b1d[_0x0f97('0x42')],_0x244b1d[_0x0f97('0x43')]);_0x273974[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x244b1d[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x47')]));_0x273974[_0x0f97('0x46')]=_0x273974[_0x0f97('0x46')][_0x0f97('0x48')]?_0x273974[_0x0f97('0x46')]:_0x244b1d[_0x0f97('0x42')];_0x273974[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x273974['where']=qs['filters'](_[_0x0f97('0x4c')](_0x3ff01c[_0x0f97('0x43')],_0x244b1d[_0x0f97('0x44')]));if(_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x273974[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x273974['where'],{'$or':_[_0x0f97('0x3f')](_0x273974[_0x0f97('0x46')],function(_0x5a1c37){var _0x6c567a={};_0x6c567a[_0x5a1c37]={'$like':'%'+_0x3ff01c['query'][_0x0f97('0x4d')]+'%'};return _0x6c567a;})});}_0x273974=_[_0x0f97('0x4e')]({},_0x273974,_0x3ff01c[_0x0f97('0x50')]);return _0x319b9d['getAgents'](_0x273974);}})[_0x0f97('0x21')](function(_0x58830b){if(_0x58830b){_0x2d2b3d=_0x58830b['length'];if(!_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x273974['limit']=qs[_0x0f97('0x30')](_0x3ff01c['query']['limit']);_0x273974[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x3ff01c['query'][_0x0f97('0x31')]);}return _0x319b9d['getAgents'](_0x273974);}})[_0x0f97('0x21')](function(_0x1b45ab){if(_0x1b45ab){return _0x1b45ab?{'count':_0x2d2b3d,'rows':_0x1b45ab}:null;}})[_0x0f97('0x21')](respondWithResult(_0x3a780a,null))[_0x0f97('0x2b')](handleError(_0x3a780a,null));};exports[_0x0f97('0x3b')]=function(_0x1d09a9,_0xa891ce,_0x1f742f){var _0x54d411,_0x5c91b6,_0x3da4a6;if(_[_0x0f97('0x80')](_0x1d09a9[_0x0f97('0x5c')]['body'])||_0x1d09a9[_0x0f97('0x5c')][_0x0f97('0x5c')]===''){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x83'));}if(_[_0x0f97('0x80')](_0x1d09a9[_0x0f97('0x5c')]['to'])){}_0x54d411=_0x1d09a9[_0x0f97('0x5c')]['to'];return db[_0x0f97('0x51')]['findOne']({'where':{'id':_0x1d09a9['params']['id']}})['then'](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x28e19d){if(_0x28e19d){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x28e19d['id']},'include':[{'model':db[_0x0f97('0x88')],'as':_0x0f97('0x89'),'include':[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0x8a'),'where':{[_0x28e19d[_0x0f97('0x84')]]:_0x54d411},'limit':0x1,'order':[[_0x0f97('0x7c'),_0x0f97('0x8b')]]}]}]})[_0x0f97('0x21')](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x4f27ce){if(_0x4f27ce&&_0x4f27ce[_0x0f97('0x89')]){_0x5c91b6=_0x4f27ce[_0x0f97('0x5e')]({'plain':!![]});if(_0x5c91b6[_0x0f97('0x89')]&&_0x5c91b6[_0x0f97('0x89')][_0x0f97('0x8a')][_0x0f97('0x48')]){return _0x5c91b6[_0x0f97('0x89')][_0x0f97('0x8a')][0x0];}return db['CmContact'][_0x0f97('0x5b')](_[_0x0f97('0x1b')](_0x1d09a9[_0x0f97('0x5c')],{'firstName':_0x54d411,[_0x4f27ce[_0x0f97('0x84')]]:_0x54d411,'phone':_0x54d411,'ListId':_0x5c91b6['ListId']}));}})[_0x0f97('0x21')](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x5bc402){if(_0x5bc402){_0x3da4a6=_0x5bc402;return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':{'ContactId':_0x3da4a6['id'],'closed':![],'OpenchannelAccountId':_0x5c91b6['id']}})[_0x0f97('0x21')](function(_0x50ddb){if(_0x50ddb){return[_0x50ddb,![]];}return db[_0x0f97('0x97')]['create']({'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id'],'OpenchannelAccountId':_0x5c91b6['id'],'lastMsgDirection':_0x0f97('0xbb'),'Messages':[_[_0x0f97('0x4e')](_0x1d09a9['body'],{'read':![],'body':_0x1d09a9[_0x0f97('0x5c')]['body'],'OpenchannelAccountId':_0x5c91b6['id'],'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id']})]},{'include':[{'model':db[_0x0f97('0xa1')],'as':_0x0f97('0xbc')}]})[_0x0f97('0x21')](function(_0xc63f4d){return[_0xc63f4d,!![]];});});}})[_0x0f97('0x9a')](function(_0x1e4d19,_0x2b3380){if(_0x2b3380){return _0x1e4d19;}return db[_0x0f97('0xa1')][_0x0f97('0x5b')](_[_0x0f97('0x4e')](_0x1d09a9['body'],{'read':![],'body':_0x1d09a9[_0x0f97('0x5c')][_0x0f97('0x5c')],'OpenchannelAccountId':_0x5c91b6['id'],'OpenchannelInteractionId':_0x1e4d19['id'],'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id']}))[_0x0f97('0x21')](function(_0x11e9d1){_0x1e4d19['dataValues'][_0x0f97('0xbc')]=[];_0x1e4d19['dataValues'][_0x0f97('0xbc')][_0x0f97('0xbd')](_0x11e9d1[_0x0f97('0xbe')]);return _0x1e4d19;});});}})[_0x0f97('0x21')](respondWithResult(_0xa891ce,null))['catch'](handleError(_0xa891ce,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 741a0d5..4bd0c53 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 _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x4a4adc,_0x41acdd){var _0x2a5e85=function(_0x1efb2b){while(--_0x1efb2b){_0x4a4adc['push'](_0x4a4adc['shift']());}};_0x2a5e85(++_0x41acdd);}(_0x5b02,0xe9));var _0x25b0=function(_0x13be4c,_0xff772e){_0x13be4c=_0x13be4c-0x0;var _0x2f32da=_0x5b02[_0x13be4c];return _0x2f32da;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda55,0x6d));var _0x5da5=function(_0x4d3be7,_0x4db16f){_0x4d3be7=_0x4d3be7-0x0;var _0x2018aa=_0xda55[_0x4d3be7];return _0x2018aa;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('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 7f0d5d9..91abcd3 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(_0x2aad32,_0x27ece3){var _0xe63cda=function(_0x5c347b){while(--_0x5c347b){_0x2aad32['push'](_0x2aad32['shift']());}};_0xe63cda(++_0x27ece3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x14296b,_0x2bf307){var _0x387d94=function(_0x1c00fc){while(--_0x1c00fc){_0x14296b['push'](_0x14296b['shift']());}};_0x387d94(++_0x2bf307);}(_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':'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 feec240..ab67934 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 _0x7d25=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x17f233,_0x5eb44c){var _0x2622a2=function(_0xddd03){while(--_0xddd03){_0x17f233['push'](_0x17f233['shift']());}};_0x2622a2(++_0x5eb44c);}(_0x7d25,0x8a));var _0x57d2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7d25[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./openchannelAccount.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});} \ No newline at end of file +var _0xd757=['redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3c0ea0,_0x127cd2){var _0x114c06=function(_0x4e58c8){while(--_0x4e58c8){_0x3c0ea0['push'](_0x3c0ea0['shift']());}};_0x114c06(++_0x127cd2);}(_0xd757,0x1e5));var _0x7d75=function(_0x54c24f,_0x30ce78){_0x54c24f=_0x54c24f-0x0;var _0x2d395b=_0xd757[_0x54c24f];return _0x2d395b;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require(_0x7d75('0x2'));var BPromise=require(_0x7d75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var jayson=require(_0x7d75('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7d75('0x9')]=_[_0x7d75('0xa')](config[_0x7d75('0x9')],{'host':_0x7d75('0xb'),'port':0x18eb});var socket=require(_0x7d75('0xc'))(new Redis(config[_0x7d75('0x9')]));require(_0x7d75('0xd'))[_0x7d75('0xe')](socket);function respondWithRpcPromise(_0x24e1d8,_0x79266b,_0x1222b3){return new BPromise(function(_0x3043fc,_0x2ac971){return client['request'](_0x24e1d8,_0x1222b3)['then'](function(_0x38cd18){logger[_0x7d75('0xf')](_0x7d75('0x10'),_0x79266b,'request\x20sent');logger[_0x7d75('0x11')](_0x7d75('0x12'),_0x79266b,'request\x20sent',JSON[_0x7d75('0x13')](_0x38cd18));if(_0x38cd18[_0x7d75('0x14')]){if(_0x38cd18[_0x7d75('0x14')][_0x7d75('0x15')]===0x1f4){logger[_0x7d75('0x14')](_0x7d75('0x10'),_0x79266b,_0x38cd18['error'][_0x7d75('0x16')]);return _0x2ac971(_0x38cd18[_0x7d75('0x14')][_0x7d75('0x16')]);}logger[_0x7d75('0x14')](_0x7d75('0x10'),_0x79266b,_0x38cd18[_0x7d75('0x14')]['message']);return _0x3043fc(_0x38cd18[_0x7d75('0x14')]['message']);}else{logger[_0x7d75('0xf')](_0x7d75('0x10'),_0x79266b,_0x7d75('0x17'));_0x3043fc(_0x38cd18[_0x7d75('0x18')][_0x7d75('0x16')]);}})[_0x7d75('0x19')](function(_0x17a61c){logger[_0x7d75('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x79266b,_0x17a61c);_0x2ac971(_0x17a61c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 59694e1..3195518 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 _0xfd2f=['./openchannelAccount.events','save','remove','emit','removeListener','length'];(function(_0x166150,_0x4dec68){var _0x1fe02c=function(_0x14f732){while(--_0x14f732){_0x166150['push'](_0x166150['shift']());}};_0x1fe02c(++_0x4dec68);}(_0xfd2f,0x14a));var _0xffd2=function(_0x2ea898,_0x22a795){_0x2ea898=_0x2ea898-0x0;var _0x45dc7f=_0xfd2f[_0x2ea898];return _0x45dc7f;};'use strict';var OpenchannelAccountEvents=require(_0xffd2('0x0'));var events=[_0xffd2('0x1'),_0xffd2('0x2'),'update'];function createListener(_0x1e12be,_0x4cf490){return function(_0x320a2a){_0x4cf490[_0xffd2('0x3')](_0x1e12be,_0x320a2a);};}function removeListener(_0x492c33,_0x983987){return function(){OpenchannelAccountEvents[_0xffd2('0x4')](_0x492c33,_0x983987);};}exports['register']=function(_0x5955d2){for(var _0x490a28=0x0,_0xd5e752=events[_0xffd2('0x5')];_0x490a28<_0xd5e752;_0x490a28++){var _0x56a1e2=events[_0x490a28];var _0x35d327=createListener('openchannelAccount:'+_0x56a1e2,_0x5955d2);OpenchannelAccountEvents['on'](_0x56a1e2,_0x35d327);}}; \ No newline at end of file +var _0x630e=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','emit'];(function(_0x373441,_0x29b77a){var _0x27848c=function(_0x456e96){while(--_0x456e96){_0x373441['push'](_0x373441['shift']());}};_0x27848c(++_0x29b77a);}(_0x630e,0x1af));var _0xe630=function(_0x3e68ae,_0x688aaa){_0x3e68ae=_0x3e68ae-0x0;var _0x773fa4=_0x630e[_0x3e68ae];return _0x773fa4;};'use strict';var OpenchannelAccountEvents=require(_0xe630('0x0'));var events=['save',_0xe630('0x1'),'update'];function createListener(_0x559334,_0x36902e){return function(_0x143cb6){_0x36902e[_0xe630('0x2')](_0x559334,_0x143cb6);};}function removeListener(_0x5c5606,_0x2f3a0f){return function(){OpenchannelAccountEvents[_0xe630('0x3')](_0x5c5606,_0x2f3a0f);};}exports[_0xe630('0x4')]=function(_0x3d6f93){for(var _0x3936fd=0x0,_0x481b21=events[_0xe630('0x5')];_0x3936fd<_0x481b21;_0x3936fd++){var _0x34bad4=events[_0x3936fd];var _0x5a73ad=createListener(_0xe630('0x6')+_0x34bad4,_0x3d6f93);OpenchannelAccountEvents['on'](_0x34bad4,_0x5a73ad);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8c2d374..e993492 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 _0x52d7=['get','index','/:id','isAuthenticated','show','put','update','delete','destroy','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x52d7,0x171));var _0x752d=function(_0x1106f4,_0x36cfdb){_0x1106f4=_0x1106f4-0x0;var _0x383deb=_0x52d7[_0x1106f4];return _0x383deb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x752d('0x0'));var router=express[_0x752d('0x1')]();var fs_extra=require(_0x752d('0x2'));var auth=require(_0x752d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x752d('0x4'));var controller=require(_0x752d('0x5'));router[_0x752d('0x6')]('/',auth['isAuthenticated'](),controller[_0x752d('0x7')]);router[_0x752d('0x6')](_0x752d('0x8'),auth[_0x752d('0x9')](),controller[_0x752d('0xa')]);router['post']('/',auth[_0x752d('0x9')](),controller['create']);router[_0x752d('0xb')](_0x752d('0x8'),auth['isAuthenticated'](),controller[_0x752d('0xc')]);router[_0x752d('0xd')](_0x752d('0x8'),auth['isAuthenticated'](),controller[_0x752d('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1560=['./openchannelApplication.controller','get','isAuthenticated','index','post','create','/:id','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x1560,0xa2));var _0x0156=function(_0x16cbe4,_0x24996e){_0x16cbe4=_0x16cbe4-0x0;var _0x276c65=_0x1560[_0x16cbe4];return _0x276c65;};'use strict';var multer=require('multer');var util=require(_0x0156('0x0'));var path=require(_0x0156('0x1'));var timeout=require(_0x0156('0x2'));var express=require(_0x0156('0x3'));var router=express['Router']();var fs_extra=require(_0x0156('0x4'));var auth=require(_0x0156('0x5'));var interaction=require(_0x0156('0x6'));var config=require(_0x0156('0x7'));var controller=require(_0x0156('0x8'));router[_0x0156('0x9')]('/',auth[_0x0156('0xa')](),controller[_0x0156('0xb')]);router['get']('/:id',auth[_0x0156('0xa')](),controller['show']);router[_0x0156('0xc')]('/',auth[_0x0156('0xa')](),controller[_0x0156('0xd')]);router['put'](_0x0156('0xe'),auth[_0x0156('0xa')](),controller[_0x0156('0xf')]);router[_0x0156('0x10')](_0x0156('0xe'),auth[_0x0156('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index dfd9df6..4a7a38c 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 _0xed82=['STRING','*,*,*,*','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed82,0x13e));var _0x2ed8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xed82[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x2ed8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2ed8('0x1')]()},'description':{'type':Sequelize[_0x2ed8('0x2')]},'interval':{'type':Sequelize[_0x2ed8('0x2')],'defaultValue':_0x2ed8('0x3')}}; \ No newline at end of file +var _0xe8ad=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8ad,0x109));var _0xde8a=function(_0x1b636b,_0x335511){_0x1b636b=_0x1b636b-0x0;var _0x4012d5=_0xe8ad[_0x1b636b];return _0x4012d5;};'use strict';var Sequelize=require('sequelize');module[_0xde8a('0x0')]={'priority':{'type':Sequelize[_0xde8a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xde8a('0x2')]},'interval':{'type':Sequelize[_0xde8a('0x2')],'defaultValue':_0xde8a('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8a5069c..929e279 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 _0x0a62=['util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','params','keys','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1bfbcd,_0x40e8ed){var _0x435b3e=function(_0xabb515){while(--_0xabb515){_0x1bfbcd['push'](_0x1bfbcd['shift']());}};_0x435b3e(++_0x40e8ed);}(_0x0a62,0xda));var _0x20a6=function(_0x21f9fc,_0x33b8f2){_0x21f9fc=_0x21f9fc-0x0;var _0x1b5af9=_0x0a62[_0x21f9fc];return _0x1b5af9;};'use strict';var emlformat=require(_0x20a6('0x0'));var rimraf=require(_0x20a6('0x1'));var zipdir=require(_0x20a6('0x2'));var jsonpatch=require(_0x20a6('0x3'));var rp=require(_0x20a6('0x4'));var moment=require(_0x20a6('0x5'));var BPromise=require(_0x20a6('0x6'));var Mustache=require('mustache');var util=require(_0x20a6('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20a6('0x8'));var fs=require('fs');var fs_extra=require(_0x20a6('0x9'));var _=require(_0x20a6('0xa'));var squel=require(_0x20a6('0xb'));var crypto=require('crypto');var jsforce=require(_0x20a6('0xc'));var deskjs=require(_0x20a6('0xd'));var toCsv=require(_0x20a6('0xe'));var querystring=require(_0x20a6('0xf'));var Papa=require(_0x20a6('0x10'));var Redis=require('ioredis');var authService=require(_0x20a6('0x11'));var qs=require(_0x20a6('0x12'));var as=require(_0x20a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20a6('0x14'))(_0x20a6('0x15'));var utils=require(_0x20a6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x20a6('0x17'));var db=require(_0x20a6('0x18'))['db'];function respondWithStatusCode(_0x5d4f5a,_0x3f4ec6){_0x3f4ec6=_0x3f4ec6||0xcc;return function(_0x2aab0e){if(_0x2aab0e){return _0x5d4f5a['sendStatus'](_0x3f4ec6);}return _0x5d4f5a[_0x20a6('0x19')](_0x3f4ec6)['end']();};}function respondWithResult(_0x12ac70,_0x1bd03e){_0x1bd03e=_0x1bd03e||0xc8;return function(_0x540b98){if(_0x540b98){return _0x12ac70[_0x20a6('0x19')](_0x1bd03e)[_0x20a6('0x1a')](_0x540b98);}};}function respondWithFilteredResult(_0x4ab179,_0x2e8c1b){return function(_0x4feb11){if(_0x4feb11){var _0x3b8f6c=typeof _0x2e8c1b['offset']===_0x20a6('0x1b')&&typeof _0x2e8c1b['limit']===_0x20a6('0x1b');var _0x25f505=_0x4feb11[_0x20a6('0x1c')];var _0x472a0e=_0x3b8f6c?0x0:_0x2e8c1b['offset'];var _0x5d8d79=_0x3b8f6c?_0x4feb11[_0x20a6('0x1c')]:_0x2e8c1b[_0x20a6('0x1d')]+_0x2e8c1b[_0x20a6('0x1e')];var _0x210355;if(_0x5d8d79>=_0x25f505){_0x5d8d79=_0x25f505;_0x210355=0xc8;}else{_0x210355=0xce;}_0x4ab179[_0x20a6('0x19')](_0x210355);return _0x4ab179['set'](_0x20a6('0x1f'),_0x472a0e+'-'+_0x5d8d79+'/'+_0x25f505)['json'](_0x4feb11);}return null;};}function patchUpdates(_0x26a3cb){return function(_0x141356){try{jsonpatch[_0x20a6('0x20')](_0x141356,_0x26a3cb,!![]);}catch(_0x553102){return BPromise[_0x20a6('0x21')](_0x553102);}return _0x141356[_0x20a6('0x22')]();};}function saveUpdates(_0x3de280,_0x986d8){return function(_0x4c028b){if(_0x4c028b){return _0x4c028b[_0x20a6('0x23')](_0x3de280)[_0x20a6('0x24')](function(_0x4d3d83){return _0x4d3d83;});}return null;};}function removeEntity(_0x6ebb3,_0x5bd751){return function(_0x17b35c){if(_0x17b35c){return _0x17b35c['destroy']()['then'](function(){_0x6ebb3['status'](0xcc)[_0x20a6('0x25')]();});}};}function handleEntityNotFound(_0x4d6fff,_0x23dc99){return function(_0x26c467){if(!_0x26c467){_0x4d6fff[_0x20a6('0x26')](0x194);}return _0x26c467;};}function handleError(_0x184cce,_0x1f7256){_0x1f7256=_0x1f7256||0x1f4;return function(_0x9db383){logger[_0x20a6('0x27')](_0x9db383[_0x20a6('0x28')]);if(_0x9db383[_0x20a6('0x29')]){delete _0x9db383[_0x20a6('0x29')];}_0x184cce[_0x20a6('0x19')](_0x1f7256)[_0x20a6('0x2a')](_0x9db383);};}exports[_0x20a6('0x2b')]=function(_0xd3109,_0x2beebe){var _0xee161b={},_0x11fe84={},_0x39b02f={'count':0x0,'rows':[]};var _0x88cb6=_[_0x20a6('0x2c')](db[_0x20a6('0x2d')][_0x20a6('0x2e')],function(_0x180674){return{'name':_0x180674[_0x20a6('0x2f')],'type':_0x180674[_0x20a6('0x30')][_0x20a6('0x31')]};});_0x11fe84[_0x20a6('0x32')]=_[_0x20a6('0x2c')](_0x88cb6,'name');_0x11fe84['query']=_['keys'](_0xd3109[_0x20a6('0x33')]);_0x11fe84[_0x20a6('0x34')]=_[_0x20a6('0x35')](_0x11fe84[_0x20a6('0x32')],_0x11fe84[_0x20a6('0x33')]);_0xee161b['attributes']=_[_0x20a6('0x35')](_0x11fe84['model'],qs[_0x20a6('0x36')](_0xd3109[_0x20a6('0x33')]['fields']));_0xee161b[_0x20a6('0x37')]=_0xee161b['attributes'][_0x20a6('0x38')]?_0xee161b[_0x20a6('0x37')]:_0x11fe84['model'];if(!_0xd3109['query'][_0x20a6('0x39')]('nolimit')){_0xee161b[_0x20a6('0x1e')]=qs['limit'](_0xd3109[_0x20a6('0x33')][_0x20a6('0x1e')]);_0xee161b[_0x20a6('0x1d')]=qs[_0x20a6('0x1d')](_0xd3109['query'][_0x20a6('0x1d')]);}_0xee161b[_0x20a6('0x3a')]=qs[_0x20a6('0x3b')](_0xd3109['query'][_0x20a6('0x3b')]);_0xee161b[_0x20a6('0x3c')]=qs[_0x20a6('0x34')](_[_0x20a6('0x3d')](_0xd3109[_0x20a6('0x33')],_0x11fe84[_0x20a6('0x34')]),_0x88cb6);if(_0xd3109[_0x20a6('0x33')]['filter']){_0xee161b[_0x20a6('0x3c')]=_[_0x20a6('0x3e')](_0xee161b['where'],{'$or':_['map'](_0x88cb6,function(_0x16c388){if(_0x16c388['type']!==_0x20a6('0x3f')){var _0xed523b={};_0xed523b[_0x16c388[_0x20a6('0x29')]]={'$like':'%'+_0xd3109[_0x20a6('0x33')][_0x20a6('0x40')]+'%'};return _0xed523b;}})});}_0xee161b=_[_0x20a6('0x3e')]({},_0xee161b,_0xd3109['options']);var _0x14946e={'where':_0xee161b[_0x20a6('0x3c')]};return db[_0x20a6('0x2d')][_0x20a6('0x1c')](_0x14946e)[_0x20a6('0x24')](function(_0x22846f){_0x39b02f[_0x20a6('0x1c')]=_0x22846f;if(_0xd3109[_0x20a6('0x33')][_0x20a6('0x41')]){_0xee161b['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x20a6('0x42')](_0xee161b);})['then'](function(_0x1f5812){_0x39b02f[_0x20a6('0x43')]=_0x1f5812;return _0x39b02f;})[_0x20a6('0x24')](respondWithFilteredResult(_0x2beebe,_0xee161b))['catch'](handleError(_0x2beebe,null));};exports['show']=function(_0x1d2bc7,_0x4ab4c9){var _0x1e0603={'raw':!![],'where':{'id':_0x1d2bc7[_0x20a6('0x44')]['id']}},_0x52b5ad={};_0x52b5ad[_0x20a6('0x32')]=_[_0x20a6('0x45')](db[_0x20a6('0x2d')][_0x20a6('0x2e')]);_0x52b5ad[_0x20a6('0x33')]=_[_0x20a6('0x45')](_0x1d2bc7[_0x20a6('0x33')]);_0x52b5ad[_0x20a6('0x34')]=_[_0x20a6('0x35')](_0x52b5ad[_0x20a6('0x32')],_0x52b5ad[_0x20a6('0x33')]);_0x1e0603[_0x20a6('0x37')]=_[_0x20a6('0x35')](_0x52b5ad[_0x20a6('0x32')],qs[_0x20a6('0x36')](_0x1d2bc7[_0x20a6('0x33')][_0x20a6('0x36')]));_0x1e0603[_0x20a6('0x37')]=_0x1e0603[_0x20a6('0x37')][_0x20a6('0x38')]?_0x1e0603['attributes']:_0x52b5ad[_0x20a6('0x32')];if(_0x1d2bc7[_0x20a6('0x33')][_0x20a6('0x41')]){_0x1e0603['include']=[{'all':!![]}];}_0x1e0603=_[_0x20a6('0x3e')]({},_0x1e0603,_0x1d2bc7['options']);return db[_0x20a6('0x2d')]['find'](_0x1e0603)[_0x20a6('0x24')](handleEntityNotFound(_0x4ab4c9,null))[_0x20a6('0x24')](respondWithResult(_0x4ab4c9,null))[_0x20a6('0x46')](handleError(_0x4ab4c9,null));};exports[_0x20a6('0x47')]=function(_0x35bd58,_0x43ad14){return db[_0x20a6('0x2d')]['create'](_0x35bd58['body'],{})[_0x20a6('0x24')](respondWithResult(_0x43ad14,0xc9))[_0x20a6('0x46')](handleError(_0x43ad14,null));};exports[_0x20a6('0x23')]=function(_0x18ff8b,_0x1f036b){if(_0x18ff8b['body']['id']){delete _0x18ff8b[_0x20a6('0x48')]['id'];}return db[_0x20a6('0x2d')][_0x20a6('0x49')]({'where':{'id':_0x18ff8b[_0x20a6('0x44')]['id']}})[_0x20a6('0x24')](handleEntityNotFound(_0x1f036b,null))[_0x20a6('0x24')](saveUpdates(_0x18ff8b[_0x20a6('0x48')],null))[_0x20a6('0x24')](respondWithResult(_0x1f036b,null))[_0x20a6('0x46')](handleError(_0x1f036b,null));};exports[_0x20a6('0x4a')]=function(_0x6962cc,_0x565a4e){return db[_0x20a6('0x2d')][_0x20a6('0x49')]({'where':{'id':_0x6962cc['params']['id']}})['then'](handleEntityNotFound(_0x565a4e,null))[_0x20a6('0x24')](removeEntity(_0x565a4e,null))[_0x20a6('0x46')](handleError(_0x565a4e,null));}; \ No newline at end of file +var _0xf732=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','error','name','send','index','map','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','OpenchannelApplication','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x560232,_0x3d3008){var _0x478ab6=function(_0x20e131){while(--_0x20e131){_0x560232['push'](_0x560232['shift']());}};_0x478ab6(++_0x3d3008);}(_0xf732,0x8f));var _0x2f73=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xf732[_0x4b2cc6];return _0x3e0b08;};'use strict';var emlformat=require(_0x2f73('0x0'));var rimraf=require(_0x2f73('0x1'));var zipdir=require(_0x2f73('0x2'));var jsonpatch=require(_0x2f73('0x3'));var rp=require(_0x2f73('0x4'));var moment=require(_0x2f73('0x5'));var BPromise=require(_0x2f73('0x6'));var Mustache=require(_0x2f73('0x7'));var util=require(_0x2f73('0x8'));var path=require(_0x2f73('0x9'));var sox=require(_0x2f73('0xa'));var csv=require(_0x2f73('0xb'));var ejs=require(_0x2f73('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f73('0xd'));var squel=require(_0x2f73('0xe'));var crypto=require(_0x2f73('0xf'));var jsforce=require(_0x2f73('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2f73('0xb'));var querystring=require(_0x2f73('0x11'));var Papa=require(_0x2f73('0x12'));var Redis=require(_0x2f73('0x13'));var authService=require(_0x2f73('0x14'));var qs=require(_0x2f73('0x15'));var as=require(_0x2f73('0x16'));var hardwareService=require(_0x2f73('0x17'));var logger=require(_0x2f73('0x18'))(_0x2f73('0x19'));var utils=require(_0x2f73('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x2f73('0x1b'));var db=require(_0x2f73('0x1c'))['db'];function respondWithStatusCode(_0x377b5a,_0x3c5aed){_0x3c5aed=_0x3c5aed||0xcc;return function(_0x5914ef){if(_0x5914ef){return _0x377b5a[_0x2f73('0x1d')](_0x3c5aed);}return _0x377b5a[_0x2f73('0x1e')](_0x3c5aed)[_0x2f73('0x1f')]();};}function respondWithResult(_0x3769e7,_0x1214ce){_0x1214ce=_0x1214ce||0xc8;return function(_0x58764b){if(_0x58764b){return _0x3769e7[_0x2f73('0x1e')](_0x1214ce)[_0x2f73('0x20')](_0x58764b);}};}function respondWithFilteredResult(_0x41d651,_0x485679){return function(_0x177956){if(_0x177956){var _0x4f6003=typeof _0x485679['offset']===_0x2f73('0x21')&&typeof _0x485679['limit']===_0x2f73('0x21');var _0xade06b=_0x177956[_0x2f73('0x22')];var _0x351b8a=_0x4f6003?0x0:_0x485679[_0x2f73('0x23')];var _0x491a6c=_0x4f6003?_0x177956[_0x2f73('0x22')]:_0x485679[_0x2f73('0x23')]+_0x485679[_0x2f73('0x24')];var _0x2ed74a;if(_0x491a6c>=_0xade06b){_0x491a6c=_0xade06b;_0x2ed74a=0xc8;}else{_0x2ed74a=0xce;}_0x41d651[_0x2f73('0x1e')](_0x2ed74a);return _0x41d651['set'](_0x2f73('0x25'),_0x351b8a+'-'+_0x491a6c+'/'+_0xade06b)[_0x2f73('0x20')](_0x177956);}return null;};}function patchUpdates(_0x3230d1){return function(_0x40721c){try{jsonpatch['apply'](_0x40721c,_0x3230d1,!![]);}catch(_0x3d64dc){return BPromise[_0x2f73('0x26')](_0x3d64dc);}return _0x40721c[_0x2f73('0x27')]();};}function saveUpdates(_0x188e4e,_0x3a6b19){return function(_0x35935d){if(_0x35935d){return _0x35935d[_0x2f73('0x28')](_0x188e4e)['then'](function(_0x20ecde){return _0x20ecde;});}return null;};}function removeEntity(_0x1fa672,_0x5d3890){return function(_0x29148b){if(_0x29148b){return _0x29148b['destroy']()[_0x2f73('0x29')](function(){_0x1fa672[_0x2f73('0x1e')](0xcc)[_0x2f73('0x1f')]();});}};}function handleEntityNotFound(_0x46cfa4,_0x970902){return function(_0xbc6db){if(!_0xbc6db){_0x46cfa4[_0x2f73('0x1d')](0x194);}return _0xbc6db;};}function handleError(_0xebf834,_0x49d995){_0x49d995=_0x49d995||0x1f4;return function(_0x1c4ef){logger[_0x2f73('0x2a')](_0x1c4ef['stack']);if(_0x1c4ef[_0x2f73('0x2b')]){delete _0x1c4ef[_0x2f73('0x2b')];}_0xebf834[_0x2f73('0x1e')](_0x49d995)[_0x2f73('0x2c')](_0x1c4ef);};}exports[_0x2f73('0x2d')]=function(_0x5862aa,_0x1d9fab){var _0x585101={},_0x2ac0b4={},_0x3363fe={'count':0x0,'rows':[]};var _0x17b947=_[_0x2f73('0x2e')](db['OpenchannelApplication']['rawAttributes'],function(_0x561b0a){return{'name':_0x561b0a[_0x2f73('0x2f')],'type':_0x561b0a['type'][_0x2f73('0x30')]};});_0x2ac0b4['model']=_[_0x2f73('0x2e')](_0x17b947,'name');_0x2ac0b4[_0x2f73('0x31')]=_[_0x2f73('0x32')](_0x5862aa[_0x2f73('0x31')]);_0x2ac0b4['filters']=_[_0x2f73('0x33')](_0x2ac0b4['model'],_0x2ac0b4[_0x2f73('0x31')]);_0x585101[_0x2f73('0x34')]=_[_0x2f73('0x33')](_0x2ac0b4[_0x2f73('0x35')],qs['fields'](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x36')]));_0x585101[_0x2f73('0x34')]=_0x585101[_0x2f73('0x34')][_0x2f73('0x37')]?_0x585101[_0x2f73('0x34')]:_0x2ac0b4[_0x2f73('0x35')];if(!_0x5862aa[_0x2f73('0x31')][_0x2f73('0x38')](_0x2f73('0x39'))){_0x585101[_0x2f73('0x24')]=qs[_0x2f73('0x24')](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x24')]);_0x585101[_0x2f73('0x23')]=qs['offset'](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x23')]);}_0x585101['order']=qs[_0x2f73('0x3a')](_0x5862aa[_0x2f73('0x31')]['sort']);_0x585101[_0x2f73('0x3b')]=qs[_0x2f73('0x3c')](_[_0x2f73('0x3d')](_0x5862aa[_0x2f73('0x31')],_0x2ac0b4[_0x2f73('0x3c')]),_0x17b947);if(_0x5862aa['query']['filter']){_0x585101[_0x2f73('0x3b')]=_[_0x2f73('0x3e')](_0x585101['where'],{'$or':_[_0x2f73('0x2e')](_0x17b947,function(_0x28a22b){if(_0x28a22b[_0x2f73('0x3f')]!==_0x2f73('0x40')){var _0x148086={};_0x148086[_0x28a22b[_0x2f73('0x2b')]]={'$like':'%'+_0x5862aa[_0x2f73('0x31')][_0x2f73('0x41')]+'%'};return _0x148086;}})});}_0x585101=_[_0x2f73('0x3e')]({},_0x585101,_0x5862aa[_0x2f73('0x42')]);var _0x4d628a={'where':_0x585101['where']};return db[_0x2f73('0x43')][_0x2f73('0x22')](_0x4d628a)[_0x2f73('0x29')](function(_0x36babb){_0x3363fe['count']=_0x36babb;if(_0x5862aa[_0x2f73('0x31')]['includeAll']){_0x585101[_0x2f73('0x44')]=[{'all':!![]}];}return db[_0x2f73('0x43')][_0x2f73('0x45')](_0x585101);})[_0x2f73('0x29')](function(_0x2ef116){_0x3363fe[_0x2f73('0x46')]=_0x2ef116;return _0x3363fe;})[_0x2f73('0x29')](respondWithFilteredResult(_0x1d9fab,_0x585101))[_0x2f73('0x47')](handleError(_0x1d9fab,null));};exports['show']=function(_0x4cfc96,_0x2aec98){var _0x464180={'raw':!![],'where':{'id':_0x4cfc96[_0x2f73('0x48')]['id']}},_0x2e94cc={};_0x2e94cc[_0x2f73('0x35')]=_['keys'](db['OpenchannelApplication'][_0x2f73('0x49')]);_0x2e94cc[_0x2f73('0x31')]=_[_0x2f73('0x32')](_0x4cfc96[_0x2f73('0x31')]);_0x2e94cc[_0x2f73('0x3c')]=_['intersection'](_0x2e94cc['model'],_0x2e94cc['query']);_0x464180['attributes']=_[_0x2f73('0x33')](_0x2e94cc['model'],qs['fields'](_0x4cfc96[_0x2f73('0x31')][_0x2f73('0x36')]));_0x464180['attributes']=_0x464180[_0x2f73('0x34')][_0x2f73('0x37')]?_0x464180[_0x2f73('0x34')]:_0x2e94cc[_0x2f73('0x35')];if(_0x4cfc96[_0x2f73('0x31')][_0x2f73('0x4a')]){_0x464180[_0x2f73('0x44')]=[{'all':!![]}];}_0x464180=_[_0x2f73('0x3e')]({},_0x464180,_0x4cfc96[_0x2f73('0x42')]);return db[_0x2f73('0x43')][_0x2f73('0x4b')](_0x464180)[_0x2f73('0x29')](handleEntityNotFound(_0x2aec98,null))[_0x2f73('0x29')](respondWithResult(_0x2aec98,null))[_0x2f73('0x47')](handleError(_0x2aec98,null));};exports['create']=function(_0x1fa5c1,_0x741f80){return db['OpenchannelApplication'][_0x2f73('0x4c')](_0x1fa5c1[_0x2f73('0x4d')],{})[_0x2f73('0x29')](respondWithResult(_0x741f80,0xc9))[_0x2f73('0x47')](handleError(_0x741f80,null));};exports[_0x2f73('0x28')]=function(_0x43353b,_0x3c7a25){if(_0x43353b[_0x2f73('0x4d')]['id']){delete _0x43353b[_0x2f73('0x4d')]['id'];}return db[_0x2f73('0x43')][_0x2f73('0x4b')]({'where':{'id':_0x43353b['params']['id']}})[_0x2f73('0x29')](handleEntityNotFound(_0x3c7a25,null))[_0x2f73('0x29')](saveUpdates(_0x43353b['body'],null))['then'](respondWithResult(_0x3c7a25,null))[_0x2f73('0x47')](handleError(_0x3c7a25,null));};exports[_0x2f73('0x4e')]=function(_0x340f2e,_0x3333a5){return db['OpenchannelApplication'][_0x2f73('0x4b')]({'where':{'id':_0x340f2e[_0x2f73('0x48')]['id']}})[_0x2f73('0x29')](handleEntityNotFound(_0x3333a5,null))[_0x2f73('0x29')](removeEntity(_0x3333a5,null))[_0x2f73('0x47')](handleError(_0x3333a5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c8e3ff7..37094d0 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 _0x991c=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x991c,0x179));var _0xc991=function(_0x206993,_0x11b404){_0x206993=_0x206993-0x0;var _0x8c1e4e=_0x991c[_0x206993];return _0x8c1e4e;};'use strict';var _=require(_0xc991('0x0'));var util=require(_0xc991('0x1'));var logger=require(_0xc991('0x2'))(_0xc991('0x3'));var moment=require(_0xc991('0x4'));var BPromise=require('bluebird');var rp=require(_0xc991('0x5'));var fs=require('fs');var path=require(_0xc991('0x6'));var rimraf=require(_0xc991('0x7'));var config=require(_0xc991('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0xc991('0x9')]=function(_0x41d014,_0x44958a){return _0x41d014[_0xc991('0xa')](_0xc991('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc991('0xc'),'collate':_0xc991('0xd')});}; \ No newline at end of file +var _0x46c7=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4'];(function(_0x4e3766,_0x4753b8){var _0x4c90cd=function(_0x5dbdb9){while(--_0x5dbdb9){_0x4e3766['push'](_0x4e3766['shift']());}};_0x4c90cd(++_0x4753b8);}(_0x46c7,0x10f));var _0x746c=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x46c7[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x746c('0x0'));var util=require(_0x746c('0x1'));var logger=require(_0x746c('0x2'))(_0x746c('0x3'));var moment=require(_0x746c('0x4'));var BPromise=require(_0x746c('0x5'));var rp=require(_0x746c('0x6'));var fs=require('fs');var path=require(_0x746c('0x7'));var rimraf=require(_0x746c('0x8'));var config=require(_0x746c('0x9'));var attributes=require(_0x746c('0xa'));module[_0x746c('0xb')]=function(_0x1ed56f,_0x335ac5){return _0x1ed56f['define'](_0x746c('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x746c('0xd'),'collate':_0x746c('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 68f9f5f..d924b36 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 _0xa587=['then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa587,0xa4));var _0x7a58=function(_0x39e18c,_0x160147){_0x39e18c=_0x39e18c-0x0;var _0x55b06d=_0xa587[_0x39e18c];return _0x55b06d;};'use strict';var _=require(_0x7a58('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7a58('0x1'));var rs=require(_0x7a58('0x2'));var fs=require('fs');var Redis=require(_0x7a58('0x3'));var db=require(_0x7a58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a58('0x5'))('rpc');var config=require(_0x7a58('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7a58('0x7')][_0x7a58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x323928,_0x1418e8,_0x1f46e6){return new BPromise(function(_0x468a89,_0xe97d12){return client[_0x7a58('0x9')](_0x323928,_0x1f46e6)[_0x7a58('0xa')](function(_0x1d79db){logger[_0x7a58('0xb')](_0x7a58('0xc'),_0x1418e8,'request\x20sent');logger[_0x7a58('0xd')](_0x7a58('0xe'),_0x1418e8,'request\x20sent',JSON[_0x7a58('0xf')](_0x1d79db));if(_0x1d79db[_0x7a58('0x10')]){if(_0x1d79db['error'][_0x7a58('0x11')]===0x1f4){logger[_0x7a58('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x1418e8,_0x1d79db[_0x7a58('0x10')]['message']);return _0xe97d12(_0x1d79db[_0x7a58('0x10')][_0x7a58('0x12')]);}logger[_0x7a58('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x1418e8,_0x1d79db[_0x7a58('0x10')][_0x7a58('0x12')]);return _0x468a89(_0x1d79db[_0x7a58('0x10')][_0x7a58('0x12')]);}else{logger[_0x7a58('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x1418e8,_0x7a58('0x13'));_0x468a89(_0x1d79db[_0x7a58('0x14')][_0x7a58('0x12')]);}})[_0x7a58('0x15')](function(_0xabe71d){logger[_0x7a58('0x10')](_0x7a58('0xc'),_0x1418e8,_0xabe71d);_0xe97d12(_0xabe71d);});});}exports[_0x7a58('0x16')]=function(_0x37475d){var _0x4541db=this;return new Promise(function(_0x5db02c,_0x23a0ed){return db[_0x7a58('0x17')][_0x7a58('0x18')](_0x37475d[_0x7a58('0x19')],{'raw':_0x37475d[_0x7a58('0x1a')]?_0x37475d['options'][_0x7a58('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37475d[_0x7a58('0x1a')]?_0x37475d['options']['where']||null:null,'attributes':_0x37475d[_0x7a58('0x1a')]?_0x37475d['options']['attributes']||null:null,'limit':_0x37475d[_0x7a58('0x1a')]?_0x37475d[_0x7a58('0x1a')][_0x7a58('0x1c')]||null:null})[_0x7a58('0xa')](function(_0x48db86){logger[_0x7a58('0xb')](_0x7a58('0x16'),_0x37475d);logger['debug']('UpdateOpenchannelApplication',_0x37475d,JSON[_0x7a58('0xf')](_0x48db86));_0x5db02c(_0x48db86);})[_0x7a58('0x15')](function(_0x2be23a){logger[_0x7a58('0x10')](_0x7a58('0x16'),_0x2be23a[_0x7a58('0x12')],_0x37475d);_0x23a0ed(_0x4541db[_0x7a58('0x10')](0x1f4,_0x2be23a[_0x7a58('0x12')]));});});}; \ No newline at end of file +var _0x53a9=['code','message','result','catch','OpenchannelApplication','update','body','options','raw','where','limit','info','UpdateOpenchannelApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x56de9d,_0x413b89){var _0x5b63fd=function(_0x2a5d13){while(--_0x2a5d13){_0x56de9d['push'](_0x56de9d['shift']());}};_0x5b63fd(++_0x413b89);}(_0x53a9,0x141));var _0x953a=function(_0x177b8c,_0x2221b3){_0x177b8c=_0x177b8c-0x0;var _0x2ab61b=_0x53a9[_0x177b8c];return _0x2ab61b;};'use strict';var _=require(_0x953a('0x0'));var util=require(_0x953a('0x1'));var moment=require(_0x953a('0x2'));var BPromise=require(_0x953a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x953a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x953a('0x5'));var logger=require('../../config/logger')(_0x953a('0x6'));var config=require('../../config/environment');var jayson=require(_0x953a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45af01,_0x4b368d,_0x432a57){return new BPromise(function(_0xee11d3,_0x2bb473){return client[_0x953a('0x8')](_0x45af01,_0x432a57)[_0x953a('0x9')](function(_0xe9ae48){logger['info'](_0x953a('0xa'),_0x4b368d,'request\x20sent');logger[_0x953a('0xb')](_0x953a('0xc'),_0x4b368d,_0x953a('0xd'),JSON['stringify'](_0xe9ae48));if(_0xe9ae48['error']){if(_0xe9ae48[_0x953a('0xe')][_0x953a('0xf')]===0x1f4){logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);return _0x2bb473(_0xe9ae48[_0x953a('0xe')]['message']);}logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);return _0xee11d3(_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);}else{logger['info'](_0x953a('0xa'),_0x4b368d,_0x953a('0xd'));_0xee11d3(_0xe9ae48[_0x953a('0x11')][_0x953a('0x10')]);}})[_0x953a('0x12')](function(_0x627d5a){logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0x627d5a);_0x2bb473(_0x627d5a);});});}exports['UpdateOpenchannelApplication']=function(_0x18b81a){var _0x166faf=this;return new Promise(function(_0x6c6d2d,_0x5debbe){return db[_0x953a('0x13')][_0x953a('0x14')](_0x18b81a[_0x953a('0x15')],{'raw':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')][_0x953a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b81a[_0x953a('0x16')]?_0x18b81a['options'][_0x953a('0x18')]||null:null,'attributes':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')]['attributes']||null:null,'limit':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')][_0x953a('0x19')]||null:null})[_0x953a('0x9')](function(_0x4995e7){logger[_0x953a('0x1a')](_0x953a('0x1b'),_0x18b81a);logger[_0x953a('0xb')](_0x953a('0x1b'),_0x18b81a,JSON['stringify'](_0x4995e7));_0x6c6d2d(_0x4995e7);})[_0x953a('0x12')](function(_0x1ea6b7){logger[_0x953a('0xe')]('UpdateOpenchannelApplication',_0x1ea6b7['message'],_0x18b81a);_0x5debbe(_0x166faf[_0x953a('0xe')](0x1f4,_0x1ea6b7[_0x953a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 2f43441..f859aca 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 _0x8504=['show','/:id/download','post','/:id/messages','addMessage','/:id/tags','openchannelinteraction:addtags','addTags','put','tracked','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','/:id'];(function(_0x3b50f3,_0x38a154){var _0x2eb4a5=function(_0x380077){while(--_0x380077){_0x3b50f3['push'](_0x3b50f3['shift']());}};_0x2eb4a5(++_0x38a154);}(_0x8504,0x6e));var _0x4850=function(_0xfdaeae,_0x5ceddb){_0xfdaeae=_0xfdaeae-0x0;var _0x418607=_0x8504[_0xfdaeae];return _0x418607;};'use strict';var multer=require(_0x4850('0x0'));var util=require('util');var path=require(_0x4850('0x1'));var timeout=require(_0x4850('0x2'));var express=require(_0x4850('0x3'));var router=express[_0x4850('0x4')]();var fs_extra=require(_0x4850('0x5'));var auth=require(_0x4850('0x6'));var interaction=require(_0x4850('0x7'));var config=require(_0x4850('0x8'));var controller=require(_0x4850('0x9'));router[_0x4850('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4850('0xa')](_0x4850('0xb'),auth[_0x4850('0xc')](),controller['describe']);router[_0x4850('0xa')](_0x4850('0xd'),auth[_0x4850('0xc')](),controller[_0x4850('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x4850('0xa')](_0x4850('0xf'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x4850('0xc')](),controller['create']);router[_0x4850('0x10')](_0x4850('0x11'),auth['isAuthenticated'](),controller[_0x4850('0x12')]);router['post'](_0x4850('0x13'),auth[_0x4850('0xc')](),interaction['tracked']('openchannel',_0x4850('0x14')),controller[_0x4850('0x15')]);router[_0x4850('0x16')](_0x4850('0xd'),auth[_0x4850('0xc')](),interaction[_0x4850('0x17')](_0x4850('0x18'),_0x4850('0x19')),controller['update']);router[_0x4850('0x1a')](_0x4850('0xd'),auth[_0x4850('0xc')](),interaction['tracked'](_0x4850('0x18'),_0x4850('0x1b')),controller[_0x4850('0x1c')]);router[_0x4850('0x1a')](_0x4850('0x13'),auth[_0x4850('0xc')](),controller[_0x4850('0x1d')]);module[_0x4850('0x1e')]=router; \ No newline at end of file +var _0x0033=['addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags'];(function(_0x84cd05,_0x8917ab){var _0x137a47=function(_0x1e86cb){while(--_0x1e86cb){_0x84cd05['push'](_0x84cd05['shift']());}};_0x137a47(++_0x8917ab);}(_0x0033,0x1b5));var _0x3003=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0x0033[_0x223c0d];return _0x207827;};'use strict';var multer=require(_0x3003('0x0'));var util=require('util');var path=require(_0x3003('0x1'));var timeout=require(_0x3003('0x2'));var express=require(_0x3003('0x3'));var router=express[_0x3003('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3003('0x5'));var interaction=require(_0x3003('0x6'));var config=require(_0x3003('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x3003('0x8')](),controller[_0x3003('0x9')]);router[_0x3003('0xa')](_0x3003('0xb'),auth[_0x3003('0x8')](),controller[_0x3003('0xc')]);router[_0x3003('0xa')](_0x3003('0xd'),auth['isAuthenticated'](),controller[_0x3003('0xe')]);router[_0x3003('0xa')](_0x3003('0xf'),auth[_0x3003('0x8')](),controller['getMessages']);router[_0x3003('0xa')](_0x3003('0x10'),auth[_0x3003('0x8')](),controller[_0x3003('0x11')]);router[_0x3003('0x12')]('/',auth['isAuthenticated'](),controller[_0x3003('0x13')]);router[_0x3003('0x12')](_0x3003('0xf'),auth[_0x3003('0x8')](),controller[_0x3003('0x14')]);router['post'](_0x3003('0x15'),auth[_0x3003('0x8')](),interaction[_0x3003('0x16')](_0x3003('0x17'),_0x3003('0x18')),controller[_0x3003('0x19')]);router[_0x3003('0x1a')]('/:id',auth[_0x3003('0x8')](),interaction[_0x3003('0x16')](_0x3003('0x17'),_0x3003('0x1b')),controller['update']);router[_0x3003('0x1c')](_0x3003('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x3003('0x17'),_0x3003('0x1d')),controller[_0x3003('0x1e')]);router[_0x3003('0x1c')]('/:id/tags',auth[_0x3003('0x8')](),controller[_0x3003('0x1f')]);module[_0x3003('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9020467..136f845 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 _0x397c=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x4a14f8,_0x581814){var _0x5d8b0e=function(_0x555aa4){while(--_0x555aa4){_0x4a14f8['push'](_0x4a14f8['shift']());}};_0x5d8b0e(++_0x581814);}(_0x397c,0xc1));var _0xc397=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x397c[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0xc397('0x0'));module[_0xc397('0x1')]={'closed':{'type':Sequelize[_0xc397('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc397('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc397('0x3')]},'note':{'type':Sequelize[_0xc397('0x3')]},'read1stAt':{'type':Sequelize[_0xc397('0x4')]},'threadId':{'type':Sequelize[_0xc397('0x3')]},'externalUrl':{'type':Sequelize[_0xc397('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc397('0x5')]('in',_0xc397('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xc397('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc992=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x14208a,_0xea7fc3){var _0x1272a8=function(_0x4ceb32){while(--_0x4ceb32){_0x14208a['push'](_0x14208a['shift']());}};_0x1272a8(++_0xea7fc3);}(_0xc992,0xbb));var _0x2c99=function(_0x165089,_0x2696f1){_0x165089=_0x165089-0x0;var _0x54ee71=_0xc992[_0x165089];return _0x54ee71;};'use strict';var Sequelize=require(_0x2c99('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2c99('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c99('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2c99('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2c99('0x3')]},'note':{'type':Sequelize[_0x2c99('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2c99('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x2c99('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2c99('0x4')]('in',_0x2c99('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2c99('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x2c99('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 109e7a0..a559f73 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 _0xdcab=['c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','Contact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Owner','get','mkdirSync','Account','N.A.','closed','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','direction','System','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','download','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','index','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','keys','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email'];(function(_0xaba9df,_0x5b322f){var _0x26e668=function(_0xef74de){while(--_0xef74de){_0xaba9df['push'](_0xaba9df['shift']());}};_0x26e668(++_0x5b322f);}(_0xdcab,0x141));var _0xbdca=function(_0x3af8c3,_0x2224a3){_0x3af8c3=_0x3af8c3-0x0;var _0x4144be=_0xdcab[_0x3af8c3];return _0x4144be;};'use strict';var emlformat=require(_0xbdca('0x0'));var rimraf=require(_0xbdca('0x1'));var zipdir=require(_0xbdca('0x2'));var jsonpatch=require(_0xbdca('0x3'));var rp=require(_0xbdca('0x4'));var moment=require(_0xbdca('0x5'));var BPromise=require(_0xbdca('0x6'));var Mustache=require('mustache');var util=require(_0xbdca('0x7'));var path=require(_0xbdca('0x8'));var sox=require(_0xbdca('0x9'));var csv=require(_0xbdca('0xa'));var ejs=require(_0xbdca('0xb'));var fs=require('fs');var fs_extra=require(_0xbdca('0xc'));var _=require(_0xbdca('0xd'));var squel=require(_0xbdca('0xe'));var crypto=require(_0xbdca('0xf'));var jsforce=require(_0xbdca('0x10'));var deskjs=require(_0xbdca('0x11'));var toCsv=require(_0xbdca('0xa'));var querystring=require(_0xbdca('0x12'));var Papa=require(_0xbdca('0x13'));var Redis=require('ioredis');var authService=require(_0xbdca('0x14'));var qs=require(_0xbdca('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbdca('0x16'));var hardwareService=require(_0xbdca('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xbdca('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbdca('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbdca('0x1a')](config[_0xbdca('0x1b')],{'host':_0xbdca('0x1c'),'port':0x18eb});var socket=require(_0xbdca('0x1d'))(new Redis(config[_0xbdca('0x1b')]));require(_0xbdca('0x1e'))[_0xbdca('0x1f')](socket);function respondWithStatusCode(_0x4b638b,_0x3d7d3d){_0x3d7d3d=_0x3d7d3d||0xcc;return function(_0x2c8b3b){if(_0x2c8b3b){return _0x4b638b[_0xbdca('0x20')](_0x3d7d3d);}return _0x4b638b[_0xbdca('0x21')](_0x3d7d3d)[_0xbdca('0x22')]();};}function respondWithResult(_0x56c234,_0x433dda){_0x433dda=_0x433dda||0xc8;return function(_0x24c2a4){if(_0x24c2a4){return _0x56c234[_0xbdca('0x21')](_0x433dda)['json'](_0x24c2a4);}};}function respondWithFilteredResult(_0x32af3e,_0x2e3ff8){return function(_0x356b52){if(_0x356b52){var _0x10dd2c=typeof _0x2e3ff8[_0xbdca('0x23')]==='undefined'&&typeof _0x2e3ff8['limit']==='undefined';var _0x4b96e9=_0x356b52['count'];var _0x7a5de5=_0x10dd2c?0x0:_0x2e3ff8[_0xbdca('0x23')];var _0x397aba=_0x10dd2c?_0x356b52[_0xbdca('0x24')]:_0x2e3ff8['offset']+_0x2e3ff8[_0xbdca('0x25')];var _0x4a7b32;if(_0x397aba>=_0x4b96e9){_0x397aba=_0x4b96e9;_0x4a7b32=0xc8;}else{_0x4a7b32=0xce;}_0x32af3e[_0xbdca('0x21')](_0x4a7b32);return _0x32af3e[_0xbdca('0x26')](_0xbdca('0x27'),_0x7a5de5+'-'+_0x397aba+'/'+_0x4b96e9)[_0xbdca('0x28')](_0x356b52);}return null;};}function patchUpdates(_0x4fa624){return function(_0x29d532){try{jsonpatch['apply'](_0x29d532,_0x4fa624,!![]);}catch(_0x5b7b62){return BPromise[_0xbdca('0x29')](_0x5b7b62);}return _0x29d532[_0xbdca('0x2a')]();};}function saveUpdates(_0x2c0210,_0x2758d1){return function(_0x47261a){if(_0x47261a){return _0x47261a[_0xbdca('0x2b')](_0x2c0210)[_0xbdca('0x2c')](function(_0x5bce77){return _0x5bce77;});}return null;};}function removeEntity(_0x479ee7,_0x211bdb){return function(_0x4ac08f){if(_0x4ac08f){return _0x4ac08f[_0xbdca('0x2d')]()['then'](function(){_0x479ee7[_0xbdca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bc1c,_0x1d34a0){return function(_0x896193){if(!_0x896193){_0x11bc1c[_0xbdca('0x20')](0x194);}return _0x896193;};}function handleError(_0x4ebdf4,_0x3b1914){_0x3b1914=_0x3b1914||0x1f4;return function(_0x392386){logger[_0xbdca('0x2e')](_0x392386[_0xbdca('0x2f')]);if(_0x392386['name']){delete _0x392386['name'];}_0x4ebdf4['status'](_0x3b1914)['send'](_0x392386);};}function getInteractionUsers(_0xd4cf84,_0x528dc6){return new BPromise(function(_0x27ae48,_0x3c9c1a){try{if(_0x528dc6[_0xd4cf84['id']]){_0xd4cf84[_0xbdca('0x30')]=_[_0xbdca('0x31')](_0x528dc6[_0xd4cf84['id']],function(_0x349dea){return{'id':_0x349dea['id'],'fullname':_0x349dea[_0xbdca('0x32')]};});}}catch(_0x2c9b3a){_0x3c9c1a(_0x2c9b3a);}_0x27ae48(_0xd4cf84);});}function getInteractionTags(_0x5dabb0,_0x5b9a4b){return new BPromise(function(_0xf072d,_0x18b9ef){try{if(_0x5dabb0[_0xbdca('0x33')]){_0x5dabb0['Tags']=[];_0x5dabb0['TagIds'][_0xbdca('0x34')](',')[_0xbdca('0x35')](function(_0x4a5b5b){_0x5dabb0[_0xbdca('0x36')][_0xbdca('0x37')](_0x5b9a4b[_0x4a5b5b]);});}delete _0x5dabb0[_0xbdca('0x33')];}catch(_0x1ec860){_0x18b9ef(_0x1ec860);}_0xf072d(_0x5dabb0);});}function updateOpenchannelInteraction(_0x206235,_0x5edb6a,_0x3e094f){return new BPromise(function(_0x4507ee,_0xfebf33){return getInteractionUsers(_0x206235,_0x3e094f)[_0xbdca('0x2c')](function(_0x4fba20){return getInteractionTags(_0x4fba20,_0x5edb6a);})[_0xbdca('0x2c')](function(_0x41a86){_0x4507ee(_0x41a86);})[_0xbdca('0x38')](function(_0x7e92bd){_0xfebf33(_0x7e92bd);});});}exports[_0xbdca('0x39')]=function(_0x16d1b3,_0x48d8a2){var _0x2e56ca={},_0x493114={},_0x19550e={'count':0x0,'rows':[]};var _0xf4cdac=_[_0xbdca('0x31')](db['OpenchannelInteraction'][_0xbdca('0x3a')],function(_0x5065d4){return{'name':_0x5065d4[_0xbdca('0x3b')],'type':_0x5065d4['type']['key']};});_0x493114[_0xbdca('0x3c')]=_['map'](_0xf4cdac,_0xbdca('0x3d'));_0x493114[_0xbdca('0x3e')]=_['keys'](_0x16d1b3[_0xbdca('0x3e')]);_0x493114[_0xbdca('0x3f')]=_[_0xbdca('0x40')](_0x493114['model'],_0x493114[_0xbdca('0x3e')]);_0x2e56ca[_0xbdca('0x41')]=_[_0xbdca('0x40')](_0x493114[_0xbdca('0x3c')],qs[_0xbdca('0x42')](_0x16d1b3[_0xbdca('0x3e')]['fields']));_0x2e56ca['attributes']=_0x2e56ca[_0xbdca('0x41')][_0xbdca('0x43')]?_0x2e56ca[_0xbdca('0x41')]:_0x493114[_0xbdca('0x3c')];if(!_0x16d1b3['query']['hasOwnProperty'](_0xbdca('0x44'))){_0x2e56ca[_0xbdca('0x25')]=qs['limit'](_0x16d1b3['query'][_0xbdca('0x25')]);_0x2e56ca[_0xbdca('0x23')]=qs['offset'](_0x16d1b3['query'][_0xbdca('0x23')]);}_0x2e56ca[_0xbdca('0x45')]=qs['sort'](_0x16d1b3['query'][_0xbdca('0x46')]);_0x2e56ca[_0xbdca('0x47')]=qs[_0xbdca('0x3f')](_['pick'](_0x16d1b3[_0xbdca('0x3e')],_0x493114[_0xbdca('0x3f')]),_0xf4cdac);var _0x2107b7=[];var _0x4b2fd3=squel[_0xbdca('0x48')]()['field']('id')['field'](_0xbdca('0x3d'))[_0xbdca('0x49')](_0xbdca('0x4a'))[_0xbdca('0x4b')](_0xbdca('0x4c'));var _0x4e0030=squel[_0xbdca('0x48')]()[_0xbdca('0x49')](_0xbdca('0x4d'))[_0xbdca('0x49')](_0xbdca('0x4e'))[_0xbdca('0x49')](_0xbdca('0x4f'))[_0xbdca('0x4b')](_0xbdca('0x50'),'ui')['left_join']('users','u',_0xbdca('0x51'));var _0x3fcb88=squel['select']()[_0xbdca('0x4b')]('openchannel_interactions','i')[_0xbdca('0x52')]('cm_contacts','c',_0xbdca('0x53'))['left_join'](_0xbdca('0x54'),'o',_0xbdca('0x55'))[_0xbdca('0x52')](_0xbdca('0x56'),'a',_0xbdca('0x57'))[_0xbdca('0x52')](_0xbdca('0x58'),'me',_0xbdca('0x59'))[_0xbdca('0x52')](_0xbdca('0x5a'),'it',_0xbdca('0x5b'))['left_join']('tools_tags','t',_0xbdca('0x5c'));var _0x149af6=squel[_0xbdca('0x5d')]();var _0x17630b=[];var _0x361673=squel['expr']();var _0x12a749;if(_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x5e')]){_0x12a749=as['parseSearch'](_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x5e')]);var _0x3be401=_0x12a749[_0xbdca('0x5f')];for(var _0x2ba740=0x0;_0x2ba740<_0x12a749[_0xbdca('0x60')][_0xbdca('0x43')];_0x2ba740++){var _0x1e8c8c=_0x12a749[_0xbdca('0x60')][_0x2ba740];var _0x57450d='i';var _0x2e92d4=_[_0xbdca('0x61')](_0xf4cdac,[_0xbdca('0x3d'),_0x1e8c8c[_0xbdca('0x49')]]);if(!_0x2e92d4){switch(_0x1e8c8c['field']){case _0xbdca('0x62'):if(_0x1e8c8c[_0xbdca('0x63')]==0x1){_0x3fcb88[_0xbdca('0x64')]('`'+_0x1e8c8c[_0xbdca('0x49')]+_0xbdca('0x65'));}else{_0x3fcb88[_0xbdca('0x64')]('`'+_0x1e8c8c[_0xbdca('0x49')]+'`\x20>\x200');}break;case'Contact':if(_0x1e8c8c[_0xbdca('0x66')]===_0xbdca('0x67')){if(_0x1e8c8c['value']['split']('\x20')[_0xbdca('0x43')]>0x1){_0x149af6[_0x3be401](_0xbdca('0x68'),qs['getFullTextValue'](_0x1e8c8c[_0xbdca('0x63')]),null);}else{var _0x105cd4='%'+_0x1e8c8c['value']+'%';_0x149af6[_0x3be401]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x105cd4,_0x105cd4,_0x105cd4);}}else{_0x2e92d4=_['find'](_0xf4cdac,[_0xbdca('0x3d'),_0xbdca('0x69')]);_0x1e8c8c[_0xbdca('0x49')]='ContactId';_0x308f5c=as[_0xbdca('0x6a')](_0x57450d,_0x2e92d4[_0xbdca('0x6b')],_0x1e8c8c);_0x149af6[_0x3be401](_0x308f5c['text'],_0x308f5c[_0xbdca('0x63')][_0xbdca('0x6c')],_0x308f5c[_0xbdca('0x63')][_0xbdca('0x22')]);}break;case _0xbdca('0x6d'):var _0x47afe1=_0x1e8c8c[_0xbdca('0x63')][_0xbdca('0x34')](',')[_0xbdca('0x31')](function(_0x15fe24){return Number(_0x15fe24);});_0x47afe1[_0xbdca('0x35')](function(_0x271403){_0x361673['or'](_0xbdca('0x6e'),'%,'+_0x271403+',%');});_0x17630b=_[_0xbdca('0x6f')](_0x17630b,_0x47afe1);break;case _0xbdca('0x70'):if(_0x1e8c8c[_0xbdca('0x66')]===_0xbdca('0x67')){_0x149af6[_0x3be401](_0xbdca('0x71'),'%'+_0x1e8c8c[_0xbdca('0x63')]+'%',null);}else{_0x2e92d4=_[_0xbdca('0x61')](_0xf4cdac,['name',_0xbdca('0x72')]);_0x1e8c8c['field']=_0xbdca('0x72');_0x308f5c=as[_0xbdca('0x6a')](_0x57450d,_0x2e92d4[_0xbdca('0x6b')],_0x1e8c8c);_0x149af6[_0x3be401](_0x308f5c[_0xbdca('0x73')],_0x308f5c['value']['start'],_0x308f5c[_0xbdca('0x63')]['end']);}break;case'body':_0x308f5c=as[_0xbdca('0x6a')]('me',null,_0x1e8c8c);_0x149af6[_0x3be401](_0x308f5c[_0xbdca('0x73')],_0x308f5c['value'][_0xbdca('0x6c')],_0x308f5c[_0xbdca('0x63')]['end']);break;}}else{var _0x308f5c=as['buildExpression'](_0x57450d,_0x2e92d4[_0xbdca('0x6b')],_0x1e8c8c);_0x149af6[_0x3be401](_0x308f5c[_0xbdca('0x73')],_0x308f5c['value'][_0xbdca('0x6c')],_0x308f5c['value']['end']);}}}else{var _0x3b2559=_(_0x16d1b3[_0xbdca('0x3e')])[_0xbdca('0x74')]()[_0xbdca('0x31')](function(_0x2c641b){return _[_0xbdca('0x75')](_0xf4cdac,[_0xbdca('0x3d'),_0x2c641b])?_0x2c641b:undefined;})['compact']()[_0xbdca('0x63')]();if(!_[_0xbdca('0x76')](_0x3b2559)){_0x3b2559['forEach'](function(_0xdc8c74){if(_0xdc8c74===_0xbdca('0x77')){_0x3fcb88[_0xbdca('0x47')](_0xbdca('0x78'),[][_0xbdca('0x79')](_0x16d1b3[_0xbdca('0x3e')][_0xdc8c74]));}else if(_0xdc8c74===_0xbdca('0x7a')){var _0x43ed62=JSON[_0xbdca('0x7b')](_0x16d1b3[_0xbdca('0x3e')][_0xdc8c74])['$gte'];var _0x3aeaef=JSON[_0xbdca('0x7b')](_0x16d1b3[_0xbdca('0x3e')][_0xdc8c74])[_0xbdca('0x7c')];_0x3fcb88[_0xbdca('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x43ed62,_0x3aeaef);}else{if(_0x16d1b3['query'][_0xdc8c74]===_0xbdca('0x7d')){_0x3fcb88[_0xbdca('0x47')]('i.'+_0xdc8c74+_0xbdca('0x7e'));}else{_0x3fcb88[_0xbdca('0x47')]('i.'+_0xdc8c74+'\x20=\x20?',_0x16d1b3['query'][_0xdc8c74]);}}});}if(_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x7f')]){if(_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x7f')]==0x1){_0x3fcb88[_0xbdca('0x64')]('`unreadMessages`\x20=\x200');}else{_0x3fcb88['having']('`unreadMessages`\x20>\x200');}}if(_0x16d1b3['query'][_0xbdca('0x80')]){_0x17630b=_['isArray'](_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x80')])?_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x80')]:new Array(_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x80')]);_0x17630b[_0xbdca('0x35')](function(_0x4d21ba){_0x361673['or'](_0xbdca('0x6e'),'%,'+_0x4d21ba+',%');});}if(_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x81')]){var _0x1bab96=_0x16d1b3['query'][_0xbdca('0x81')][_0xbdca('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbdca('0x83')](_0x1bab96)){_0x149af6['or'](_0xbdca('0x84'),_0x1bab96+'%');}else{_0x149af6['or'](_0xbdca('0x85'),qs[_0xbdca('0x86')](_0x1bab96))['or'](_0xbdca('0x87'),_0x1bab96+'%')['or'](_0xbdca('0x88'),_0x1bab96+'%');}}}_0x3fcb88[_0xbdca('0x47')](_0x149af6);_0x3fcb88[_0xbdca('0x89')](_0xbdca('0x8a'));var _0x3668d1={'type':db['Sequelize'][_0xbdca('0x8b')][_0xbdca('0x8c')],'raw':!![]};var _0x96711b=_0x3fcb88[_0xbdca('0x8d')]();_0x96711b[_0xbdca('0x49')](_0xbdca('0x8a'));_0x96711b[_0xbdca('0x49')](_0xbdca('0x8e'),_0xbdca('0x62'));if(_0x2e56ca['order']){_0x2e56ca[_0xbdca('0x45')][_0xbdca('0x35')](function(_0x191994){var _0x253180=_0x191994[0x0]===_0xbdca('0x8f')?_0x191994[0x0]:'i.'+_0x191994[0x0];_0x3fcb88[_0xbdca('0x45')](_0x253180,_0x191994[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x17630b)){_0x3fcb88[_0xbdca('0x64')](_0x361673);_0x96711b[_0xbdca('0x47')](_0xbdca('0x90'),_0x17630b);}BPromise[_0xbdca('0x91')]()[_0xbdca('0x2c')](function(){if(!_0x12a749){if(_0x16d1b3[_0xbdca('0x3e')]['OpenchannelAccountId'])return;_0x96711b[_0xbdca('0x47')](_0xbdca('0x92'));_0x3fcb88['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x16d1b3[_0xbdca('0x93')][_0xbdca('0x94')]!==_0xbdca('0x95'))return;return _0x16d1b3['user'][_0xbdca('0x96')]({'attributes':['id'],'raw':!![]})[_0xbdca('0x2c')](function(_0x592f69){if(_[_0xbdca('0x76')](_0x592f69)){_0x96711b[_0xbdca('0x47')](_0xbdca('0x97'));_0x3fcb88[_0xbdca('0x47')](_0xbdca('0x97'));}else{_0x96711b[_0xbdca('0x47')](_0xbdca('0x78'),_['map'](_0x592f69,'id'));_0x3fcb88[_0xbdca('0x47')](_0xbdca('0x78'),_[_0xbdca('0x31')](_0x592f69,'id'));}});})[_0xbdca('0x2c')](function(){if(_0x16d1b3[_0xbdca('0x93')]['role']===_0xbdca('0x95')&&!_0x12a749&&!_0x16d1b3[_0xbdca('0x3e')][_0xbdca('0x77')])return[];return db['sequelize'][_0xbdca('0x3e')](_0x96711b['toString'](),_0x3668d1);})[_0xbdca('0x2c')](function(_0x432deb){_0x19550e[_0xbdca('0x24')]=_0x432deb['length'];if(_0x19550e[_0xbdca('0x24')]===0x0)return[];return db[_0xbdca('0x98')][_0xbdca('0x3e')](_0x4b2fd3[_0xbdca('0x99')](),_0x3668d1)[_0xbdca('0x2c')](function(_0x29e300){_0x2107b7=_[_0xbdca('0x9a')](_0x29e300,'id');_0x3668d1=_[_0xbdca('0x9b')](_0x3668d1,{'model':db[_0xbdca('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16d1b3[_0xbdca('0x3e')]['fields']){_0x2e56ca['attributes'][_0xbdca('0x35')](function(_0x526027){_0x3fcb88[_0xbdca('0x49')]('i.'+_0x526027);});}else{_0x3fcb88[_0xbdca('0x49')](_0xbdca('0x8e'),_0xbdca('0x62'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0x9d'),'Account.key');_0x3fcb88[_0xbdca('0x49')]('a.mandatoryDisposition',_0xbdca('0x9e'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0x9f'),_0xbdca('0x8f'));_0x3fcb88['field'](_0xbdca('0xa0'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xa1'),_0xbdca('0xa2'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xa3'),_0xbdca('0xa4'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xa5'),_0xbdca('0xa6'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xa7'),_0xbdca('0xa8'));_0x3fcb88['field'](_0xbdca('0xa9'),'Contact.mobile');_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xaa'),_0xbdca('0xab'));_0x3fcb88['field'](_0xbdca('0xac'),'Owner.fullname');_0x3fcb88['field'](_0xbdca('0xad'),_0xbdca('0xae'));_0x3fcb88[_0xbdca('0x49')](_0xbdca('0xaf'),_0xbdca('0x33'));}if(_0x2e56ca[_0xbdca('0x25')])_0x3fcb88[_0xbdca('0x25')](_0x2e56ca[_0xbdca('0x25')]);if(_0x2e56ca['offset'])_0x3fcb88['offset'](_0x2e56ca['offset']);return db[_0xbdca('0x98')]['query'](_0x3fcb88['toString'](),_0x3668d1);})['then'](function(_0x3eb88b){if(_0x3eb88b[_0xbdca('0x43')]>0x0)_0x4e0030[_0xbdca('0x47')](_0xbdca('0xb0'),_['map'](_0x3eb88b,'id'));return db['sequelize'][_0xbdca('0x3e')](_0x4e0030[_0xbdca('0x99')](),_0x3668d1)[_0xbdca('0x2c')](function(_0x16d588){var _0x11fa6a=_[_0xbdca('0xb1')](_0x16d588,_0xbdca('0xb2'));var _0x26d64d=[];_0x3eb88b[_0xbdca('0x35')](function(_0x27b14f){_0x26d64d['push'](updateOpenchannelInteraction(_0x27b14f,_0x2107b7,_0x11fa6a));});return BPromise[_0xbdca('0xb3')](_0x26d64d);});});})['then'](function(_0x366bc){_0x19550e[_0xbdca('0xb4')]=_0x366bc;return _0x19550e;})[_0xbdca('0x2c')](respondWithFilteredResult(_0x48d8a2,_0x2e56ca))[_0xbdca('0x38')](handleError(_0x48d8a2,null));};exports['show']=function(_0x294140,_0x15dc08){var _0xad5c08={};if(_0x294140[_0xbdca('0x3e')][_0xbdca('0x6b')]&&_0x294140[_0xbdca('0x3e')][_0xbdca('0x6b')]===_0xbdca('0x4b')){_0xad5c08['from']=_0x294140[_0xbdca('0xb5')]['id'];}else{_0xad5c08['id']=_0x294140['params']['id'];}var _0x3edb37={'raw':![],'where':_0xad5c08},_0x1dd6fc={};_0x1dd6fc[_0xbdca('0x3c')]=_[_0xbdca('0x74')](db['OpenchannelInteraction'][_0xbdca('0x3a')]);_0x1dd6fc[_0xbdca('0x3e')]=_['keys'](_0x294140[_0xbdca('0x3e')]);_0x1dd6fc[_0xbdca('0x3f')]=_['intersection'](_0x1dd6fc[_0xbdca('0x3c')],_0x1dd6fc[_0xbdca('0x3e')]);_0x3edb37['attributes']=_[_0xbdca('0x40')](_0x1dd6fc[_0xbdca('0x3c')],qs[_0xbdca('0x42')](_0x294140[_0xbdca('0x3e')][_0xbdca('0x42')]));_0x3edb37[_0xbdca('0x41')]=_0x3edb37[_0xbdca('0x41')]['length']?_0x3edb37[_0xbdca('0x41')]:_0x1dd6fc[_0xbdca('0x3c')];if(_0x294140[_0xbdca('0x3e')]['includeAll']){_0x3edb37[_0xbdca('0xb6')]=[{'all':!![]}];}_0x3edb37=_[_0xbdca('0x9b')]({},_0x3edb37,_0x294140[_0xbdca('0xb7')]);return db[_0xbdca('0x9c')]['find'](_0x3edb37)['then'](handleEntityNotFound(_0x15dc08,null))['then'](respondWithResult(_0x15dc08,null))[_0xbdca('0x38')](handleError(_0x15dc08,null));};exports[_0xbdca('0xb8')]=function(_0x1eaa71,_0x5e03c1){return db[_0xbdca('0x9c')][_0xbdca('0xb8')](_0x1eaa71[_0xbdca('0xb9')],{})[_0xbdca('0x2c')](respondWithResult(_0x5e03c1,0xc9))['catch'](handleError(_0x5e03c1,null));};exports[_0xbdca('0x2b')]=function(_0x5bb1c7,_0x1cab92){if(_0x5bb1c7['body']['id']){delete _0x5bb1c7[_0xbdca('0xb9')]['id'];}return db[_0xbdca('0x9c')][_0xbdca('0x61')]({'where':{'id':_0x5bb1c7[_0xbdca('0xb5')]['id']}})[_0xbdca('0x2c')](handleEntityNotFound(_0x1cab92,null))[_0xbdca('0x2c')](saveUpdates(_0x5bb1c7[_0xbdca('0xb9')],null))[_0xbdca('0x2c')](respondWithResult(_0x1cab92,null))[_0xbdca('0x38')](handleError(_0x1cab92,null));};exports['destroy']=function(_0x1c45d5,_0x19c905){return db['OpenchannelInteraction'][_0xbdca('0x61')]({'where':{'id':_0x1c45d5[_0xbdca('0xb5')]['id']}})['then'](handleEntityNotFound(_0x19c905,null))['then'](removeEntity(_0x19c905,null))[_0xbdca('0x38')](handleError(_0x19c905,null));};exports['describe']=function(_0x4f54fa,_0x281b98){return db['OpenchannelInteraction'][_0xbdca('0xba')]()[_0xbdca('0x2c')](respondWithResult(_0x281b98,null))[_0xbdca('0x38')](handleError(_0x281b98,null));};exports[_0xbdca('0xbb')]=function(_0x1cb3ed,_0x2325c2,_0x3d09bf){return db[_0xbdca('0xbc')][_0xbdca('0x61')]({'where':{'id':_0x1cb3ed[_0xbdca('0xb5')]['id']}})[_0xbdca('0x2c')](handleEntityNotFound(_0x2325c2,null))[_0xbdca('0x2c')](function(_0x1bf847){if(_0x1bf847){return _0x1bf847['addMessage'](_0x1cb3ed[_0xbdca('0xb9')][_0xbdca('0xbd')],_[_0xbdca('0xbe')](_0x1cb3ed[_0xbdca('0xb9')],['ids','id'])||{});}})[_0xbdca('0x2c')](respondWithResult(_0x2325c2,null))[_0xbdca('0x38')](handleError(_0x2325c2,null));};exports[_0xbdca('0xbf')]=function(_0x3f9c11,_0x582118,_0x55249b){var _0x5a0e19={'raw':![],'where':{}};var _0x564324={};var _0x58fc02={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xbdca('0xc0')]({'where':{'id':_0x3f9c11['params']['id']}})[_0xbdca('0x2c')](handleEntityNotFound(_0x582118,null))[_0xbdca('0x2c')](function(_0x343869){if(_0x343869){_0x564324[_0xbdca('0x3c')]=_[_0xbdca('0x74')](db[_0xbdca('0xbc')][_0xbdca('0x3a')]);_0x564324[_0xbdca('0x3e')]=_['keys'](_0x3f9c11['query']);_0x564324[_0xbdca('0x3f')]=_[_0xbdca('0x40')](_0x564324[_0xbdca('0x3c')],_0x564324[_0xbdca('0x3e')]);_0x5a0e19[_0xbdca('0x41')]=_[_0xbdca('0x40')](_0x564324['model'],qs[_0xbdca('0x42')](_0x3f9c11[_0xbdca('0x3e')]['fields']));_0x5a0e19[_0xbdca('0x41')]=_0x5a0e19[_0xbdca('0x41')][_0xbdca('0x43')]?_0x5a0e19[_0xbdca('0x41')]:_0x564324['model'];if(!_0x3f9c11['query'][_0xbdca('0xc1')](_0xbdca('0x44'))){_0x5a0e19[_0xbdca('0x25')]=qs[_0xbdca('0x25')](_0x3f9c11['query'][_0xbdca('0x25')]);_0x5a0e19[_0xbdca('0x23')]=qs['offset'](_0x3f9c11[_0xbdca('0x3e')]['offset']);}_0x5a0e19[_0xbdca('0x45')]=qs['sort'](_0x3f9c11[_0xbdca('0x3e')]['sort']);_0x5a0e19['where']=qs['filters'](_[_0xbdca('0xc2')](_0x3f9c11[_0xbdca('0x3e')],_0x564324[_0xbdca('0x3f')]));_0x5a0e19[_0xbdca('0x47')][_0xbdca('0xb2')]=_0x343869['id'];if(_0x3f9c11[_0xbdca('0x3e')][_0xbdca('0x81')]){_0x5a0e19['where']=_[_0xbdca('0x9b')](_0x5a0e19[_0xbdca('0x47')],{'$or':_[_0xbdca('0x31')](_0x5a0e19['attributes'],function(_0x234083){var _0x514459={};_0x514459[_0x234083]={'$like':'%'+_0x3f9c11[_0xbdca('0x3e')]['filter']+'%'};return _0x514459;})});}if(_0x3f9c11[_0xbdca('0x3e')]['$gte']){var _0x325dc9=_0x3f9c11[_0xbdca('0x3e')][_0xbdca('0xc3')][_0xbdca('0x34')](',');var _0x3bddd8={};_0x3bddd8[_0x325dc9[0x0]]={'$gte':moment(_0x325dc9[0x1])[_0xbdca('0xc4')](_0xbdca('0xc5'))};_0x5a0e19[_0xbdca('0x47')]=_[_0xbdca('0x9b')](_0x5a0e19[_0xbdca('0x47')],_0x3bddd8);}_0x5a0e19=_[_0xbdca('0x9b')]({},_0x5a0e19,_0x3f9c11[_0xbdca('0xb7')]);return db['OpenchannelMessage'][_0xbdca('0x24')]({'where':_0x5a0e19[_0xbdca('0x47')]})['then'](function(_0x6d365c){_0x58fc02[_0xbdca('0x24')]=_0x6d365c;if(_0x3f9c11[_0xbdca('0x3e')][_0xbdca('0xc6')]){_0x5a0e19['include']=[{'all':!![]}];}return db[_0xbdca('0xbc')][_0xbdca('0xc7')](_0x5a0e19);})[_0xbdca('0x2c')](function(_0x4e6e57){_0x58fc02[_0xbdca('0xb4')]=_0x4e6e57;return _0x58fc02;});}})[_0xbdca('0x2c')](respondWithFilteredResult(_0x582118,_0x5a0e19))[_0xbdca('0x38')](handleError(_0x582118,null));};exports[_0xbdca('0xc8')]=function(_0x1da1b0,_0x156bf0,_0x25ce99){return db[_0xbdca('0x9c')][_0xbdca('0x61')]({'where':{'id':_0x1da1b0[_0xbdca('0xb5')]['id']}})[_0xbdca('0x2c')](handleEntityNotFound(_0x156bf0,null))[_0xbdca('0x2c')](function(_0x2d28e1){if(_0x2d28e1){return _0x2d28e1[_0xbdca('0xc9')](_0x1da1b0['body'][_0xbdca('0xbd')],_['omit'](_0x1da1b0[_0xbdca('0xb9')],[_0xbdca('0xbd'),'id'])||{})[_0xbdca('0xca')](function(){return db[_0xbdca('0x6d')]['findAll']({'attributes':['id','name',_0xbdca('0x4a')],'where':{'id':_0x1da1b0[_0xbdca('0xb9')][_0xbdca('0xbd')]}});})[_0xbdca('0x2c')](function(_0x376e32){socket[_0xbdca('0xcb')](_0xbdca('0xcc'),{'id':Number(_0x1da1b0[_0xbdca('0xb5')]['id']),'tags':_0x376e32||[]});return{'id':Number(_0x1da1b0['params']['id']),'tags':_0x376e32||[]};});}})[_0xbdca('0x2c')](respondWithResult(_0x156bf0,null))[_0xbdca('0x38')](handleError(_0x156bf0,null));};exports[_0xbdca('0xcd')]=function(_0x404897,_0x4316e0,_0x54ae0c){return db['OpenchannelInteraction'][_0xbdca('0x61')]({'where':{'id':_0x404897[_0xbdca('0xb5')]['id']}})['then'](handleEntityNotFound(_0x4316e0,null))[_0xbdca('0x2c')](function(_0x464f70){if(_0x464f70){return _0x464f70[_0xbdca('0xcd')](_0x404897[_0xbdca('0x3e')][_0xbdca('0xbd')]);}})['then'](respondWithStatusCode(_0x4316e0,null))[_0xbdca('0x38')](handleError(_0x4316e0,null));};exports['download']=function(_0x567279,_0x4b7e0d){var _0x1aa746=moment()[_0xbdca('0xce')]()[_0xbdca('0x99')]();var _0x100e04=path[_0xbdca('0xcf')](config[_0xbdca('0xd0')],_0xbdca('0xd1'),_0xbdca('0xd2'),'tmp');var _0x2c40dd=path[_0xbdca('0xcf')](config[_0xbdca('0xd0')],_0xbdca('0xd1'),_0xbdca('0xd2'),_0xbdca('0xd3'));var _0x52f47d=path[_0xbdca('0xcf')](_0x100e04,_0x1aa746);var _0x1257bb=util[_0xbdca('0xc4')]('transcript-%d-%s.zip',_0x567279['params']['id'],_0x1aa746);var _0x3ab03c=path[_0xbdca('0xcf')](_0x100e04,_0x1257bb);var _0x29b909=[];_0x29b909[_0xbdca('0x37')]({'model':db[_0xbdca('0x70')],'as':_0xbdca('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x29b909['push']({'model':db['CmContact'],'as':_0xbdca('0xd4'),'attributes':['id',_0xbdca('0xd5'),_0xbdca('0xd6')],'raw':!![]});if(_0x567279['query'][_0xbdca('0xd3')]){_0x29b909[_0xbdca('0x37')]({'model':db['Attachment'],'as':_0xbdca('0xd7'),'raw':!![]});}var _0x157fde=[{'model':db[_0xbdca('0xbc')],'as':_0xbdca('0xd8'),'attributes':['id',_0xbdca('0xb9'),_0xbdca('0x7a'),'direction',_0xbdca('0xd9'),_0xbdca('0x7f')],'include':_0x29b909}];_0x157fde[_0xbdca('0x37')]({'model':db[_0xbdca('0xda')],'as':'Account','attributes':['id',_0xbdca('0x3d')]});_0x157fde['push']({'model':db[_0xbdca('0x70')],'as':_0xbdca('0xdb'),'attributes':['id',_0xbdca('0x32')]});return db[_0xbdca('0x9c')][_0xbdca('0x61')]({'where':{'id':_0x567279['params']['id']},'include':_0x157fde})['then'](handleEntityNotFound(_0x4b7e0d,null))['then'](function(_0x269587){if(_0x269587){var _0x356bdb=_0x269587[_0xbdca('0xdc')]({'plain':!![]});fs[_0xbdca('0xdd')](_0x52f47d);var _0x466597={'channel':'Openchannel','account':_0x356bdb[_0xbdca('0xde')]['name'],'agent':_0x356bdb[_0xbdca('0xdb')]?_0x356bdb[_0xbdca('0xdb')][_0xbdca('0x32')]:_0xbdca('0xdf'),'createdAt':moment(_0x356bdb[_0xbdca('0x7a')])[_0xbdca('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x356bdb[_0xbdca('0xe0')]?moment(_0x356bdb['closedAt'])['format'](_0xbdca('0xc5'))[_0xbdca('0x99')]():'','disposition':_0x356bdb[_0xbdca('0xe1')],'visibility':_0x356bdb[_0xbdca('0xe2')]?'Public':_0xbdca('0xe3'),'messages':_(_0x356bdb[_0xbdca('0xd8')])[_0xbdca('0x81')]({'secret':![]})[_0xbdca('0x31')](function(_0x17acee){if(_0x17acee[_0xbdca('0xd7')]){var _0x1b1a35=path[_0xbdca('0xcf')](_0x2c40dd,_0x17acee[_0xbdca('0xd7')][_0xbdca('0xe4')]);if(fs[_0xbdca('0xe5')](_0x1b1a35)){fs[_0xbdca('0xe6')](_0x1b1a35)[_0xbdca('0xe7')](fs[_0xbdca('0xe8')](path[_0xbdca('0xcf')](_0x52f47d,_0x17acee[_0xbdca('0xd7')][_0xbdca('0xe4')])));}}return{'date':moment(_0x17acee['createdAt'])[_0xbdca('0xc4')](_0xbdca('0xc5'))[_0xbdca('0x99')](),'sender':_0x17acee[_0xbdca('0xe9')]==='out'?_0x17acee['User']?_0x17acee['User']['fullname']:_0xbdca('0xea'):_0x17acee[_0xbdca('0xd4')][_0xbdca('0xd5')]+(_0x17acee[_0xbdca('0xd4')][_0xbdca('0xd6')]?'\x20'+_0x17acee[_0xbdca('0xd4')][_0xbdca('0xd6')]:''),'body':_0x17acee[_0xbdca('0xd7')]?_0x17acee[_0xbdca('0xd7')][_0xbdca('0xe4')]:_0x17acee[_0xbdca('0xb9')],'direction':_0x17acee[_0xbdca('0xe9')]===_0xbdca('0xeb')?'A':'C','secret':_0x17acee[_0xbdca('0xd9')],'read':_0x17acee['read'],'attachment':_0x17acee[_0xbdca('0xd7')]};})[_0xbdca('0x63')]()};return ejs[_0xbdca('0xec')](path[_0xbdca('0xcf')](config[_0xbdca('0xd0')],_0xbdca('0xd1'),'views',_0xbdca('0xed')),{'interaction':_0x466597})[_0xbdca('0x2c')](function(_0x58f80b){var _0x4f7c76=path[_0xbdca('0xcf')](_0x52f47d,_0xbdca('0xee')+_0x356bdb['id']+'-'+_0x1aa746+_0xbdca('0xef'));var _0x3e6904={'path':_0x4f7c76,'channel':_0xbdca('0xf0'),'interactionId':_0x356bdb['id']};return pdf[_0xbdca('0xf1')](_0x58f80b,_0x3e6904);})[_0xbdca('0x2c')](function(){return new BPromise(function(_0xd32f50,_0x5f43bf){zipdir(_0x52f47d,{'saveTo':_0x3ab03c},function(_0x17b1cd,_0xf7d2c0){if(_0x17b1cd)return _0x5f43bf(_0x17b1cd);return _0xd32f50(_0xf7d2c0);});})[_0xbdca('0x2c')](function(){return new BPromise(function(_0x10f9eb,_0x9d32a3){rimraf(_0x52f47d,function(_0x55b4a2){if(_0x55b4a2)_0x9d32a3(_0x55b4a2);return _0x10f9eb();});});})[_0xbdca('0x2c')](function(){return _0x4b7e0d[_0xbdca('0xf2')](_0x3ab03c,_0x1257bb,function(_0x395c91){if(_0x395c91){console['log']('err',_0x395c91);}else{fs[_0xbdca('0xf3')](_0x3ab03c);}});});});}else{return _0x4b7e0d[_0xbdca('0x20')](0xc8);}})['catch'](handleError(_0x4b7e0d,null));}; \ No newline at end of file +var _0xfc23=['$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','push','all','rows','show','params','rawAttributes','includeAll','options','create','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','openchannelInteractionTags:save','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','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','ioredis','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','map','fullname','TagIds','Tags','forEach','catch','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse'];(function(_0x4374a4,_0x3b5799){var _0xfdb8a9=function(_0x1f2924){while(--_0x1f2924){_0x4374a4['push'](_0x4374a4['shift']());}};_0xfdb8a9(++_0x3b5799);}(_0xfc23,0x166));var _0x3fc2=function(_0x32b132,_0x80571a){_0x32b132=_0x32b132-0x0;var _0x30fa95=_0xfc23[_0x32b132];return _0x30fa95;};'use strict';var emlformat=require(_0x3fc2('0x0'));var rimraf=require(_0x3fc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fc2('0x2'));var rp=require(_0x3fc2('0x3'));var moment=require(_0x3fc2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fc2('0x5'));var util=require(_0x3fc2('0x6'));var path=require(_0x3fc2('0x7'));var sox=require(_0x3fc2('0x8'));var csv=require(_0x3fc2('0x9'));var ejs=require(_0x3fc2('0xa'));var fs=require('fs');var fs_extra=require(_0x3fc2('0xb'));var _=require(_0x3fc2('0xc'));var squel=require(_0x3fc2('0xd'));var crypto=require(_0x3fc2('0xe'));var jsforce=require(_0x3fc2('0xf'));var deskjs=require(_0x3fc2('0x10'));var toCsv=require(_0x3fc2('0x9'));var querystring=require(_0x3fc2('0x11'));var Papa=require(_0x3fc2('0x12'));var Redis=require(_0x3fc2('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3fc2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fc2('0x15'))(_0x3fc2('0x16'));var utils=require(_0x3fc2('0x17'));var config=require(_0x3fc2('0x18'));var licenseUtil=require(_0x3fc2('0x19'));var db=require(_0x3fc2('0x1a'))['db'];config[_0x3fc2('0x1b')]=_[_0x3fc2('0x1c')](config[_0x3fc2('0x1b')],{'host':_0x3fc2('0x1d'),'port':0x18eb});var socket=require(_0x3fc2('0x1e'))(new Redis(config[_0x3fc2('0x1b')]));require('./openchannelInteraction.socket')[_0x3fc2('0x1f')](socket);function respondWithStatusCode(_0x4239de,_0x1b4857){_0x1b4857=_0x1b4857||0xcc;return function(_0x1febcc){if(_0x1febcc){return _0x4239de[_0x3fc2('0x20')](_0x1b4857);}return _0x4239de[_0x3fc2('0x21')](_0x1b4857)['end']();};}function respondWithResult(_0x285e10,_0x8096db){_0x8096db=_0x8096db||0xc8;return function(_0x5b879d){if(_0x5b879d){return _0x285e10[_0x3fc2('0x21')](_0x8096db)[_0x3fc2('0x22')](_0x5b879d);}};}function respondWithFilteredResult(_0x1b47af,_0x4c5131){return function(_0x2683e1){if(_0x2683e1){var _0x27f2d0=typeof _0x4c5131['offset']===_0x3fc2('0x23')&&typeof _0x4c5131['limit']===_0x3fc2('0x23');var _0x5a70ed=_0x2683e1[_0x3fc2('0x24')];var _0x426210=_0x27f2d0?0x0:_0x4c5131['offset'];var _0x2c5604=_0x27f2d0?_0x2683e1['count']:_0x4c5131[_0x3fc2('0x25')]+_0x4c5131[_0x3fc2('0x26')];var _0x99cb42;if(_0x2c5604>=_0x5a70ed){_0x2c5604=_0x5a70ed;_0x99cb42=0xc8;}else{_0x99cb42=0xce;}_0x1b47af['status'](_0x99cb42);return _0x1b47af[_0x3fc2('0x27')](_0x3fc2('0x28'),_0x426210+'-'+_0x2c5604+'/'+_0x5a70ed)[_0x3fc2('0x22')](_0x2683e1);}return null;};}function patchUpdates(_0x4e398c){return function(_0x41a841){try{jsonpatch[_0x3fc2('0x29')](_0x41a841,_0x4e398c,!![]);}catch(_0x39e4b4){return BPromise[_0x3fc2('0x2a')](_0x39e4b4);}return _0x41a841['save']();};}function saveUpdates(_0x2aea79,_0x28cd76){return function(_0x43ea2f){if(_0x43ea2f){return _0x43ea2f[_0x3fc2('0x2b')](_0x2aea79)[_0x3fc2('0x2c')](function(_0x41ad15){return _0x41ad15;});}return null;};}function removeEntity(_0x5bd8cf,_0x2e720f){return function(_0x1b49a1){if(_0x1b49a1){return _0x1b49a1[_0x3fc2('0x2d')]()[_0x3fc2('0x2c')](function(){_0x5bd8cf[_0x3fc2('0x21')](0xcc)[_0x3fc2('0x2e')]();});}};}function handleEntityNotFound(_0x3ebc5c,_0x5f48fd){return function(_0x1a4f44){if(!_0x1a4f44){_0x3ebc5c[_0x3fc2('0x20')](0x194);}return _0x1a4f44;};}function handleError(_0x29917f,_0x3bb552){_0x3bb552=_0x3bb552||0x1f4;return function(_0x1cc52c){logger['error'](_0x1cc52c['stack']);if(_0x1cc52c[_0x3fc2('0x2f')]){delete _0x1cc52c['name'];}_0x29917f[_0x3fc2('0x21')](_0x3bb552)['send'](_0x1cc52c);};}function getInteractionUsers(_0x212bf3,_0x212863){return new BPromise(function(_0x4a4d7a,_0x489dd6){try{if(_0x212863[_0x212bf3['id']]){_0x212bf3['Users']=_[_0x3fc2('0x30')](_0x212863[_0x212bf3['id']],function(_0xb896bb){return{'id':_0xb896bb['id'],'fullname':_0xb896bb[_0x3fc2('0x31')]};});}}catch(_0x1bfc25){_0x489dd6(_0x1bfc25);}_0x4a4d7a(_0x212bf3);});}function getInteractionTags(_0x43ba77,_0x2b81a9){return new BPromise(function(_0x5009a9,_0x40aca2){try{if(_0x43ba77[_0x3fc2('0x32')]){_0x43ba77[_0x3fc2('0x33')]=[];_0x43ba77[_0x3fc2('0x32')]['split'](',')[_0x3fc2('0x34')](function(_0x2a9eab){_0x43ba77[_0x3fc2('0x33')]['push'](_0x2b81a9[_0x2a9eab]);});}delete _0x43ba77[_0x3fc2('0x32')];}catch(_0x29bd7f){_0x40aca2(_0x29bd7f);}_0x5009a9(_0x43ba77);});}function updateOpenchannelInteraction(_0x47447d,_0x548f5e,_0x23e5f8){return new BPromise(function(_0x124538,_0x962cae){return getInteractionUsers(_0x47447d,_0x23e5f8)[_0x3fc2('0x2c')](function(_0x24a3dc){return getInteractionTags(_0x24a3dc,_0x548f5e);})['then'](function(_0x4b08d5){_0x124538(_0x4b08d5);})[_0x3fc2('0x35')](function(_0xce7294){_0x962cae(_0xce7294);});});}exports[_0x3fc2('0x36')]=function(_0x5ed18f,_0x125d3a){var _0x78512f={},_0x5ed51c={},_0x3406d7={'count':0x0,'rows':[]};var _0x73c682=_[_0x3fc2('0x30')](db['OpenchannelInteraction']['rawAttributes'],function(_0x2d9728){return{'name':_0x2d9728[_0x3fc2('0x37')],'type':_0x2d9728[_0x3fc2('0x38')][_0x3fc2('0x39')]};});_0x5ed51c['model']=_[_0x3fc2('0x30')](_0x73c682,_0x3fc2('0x2f'));_0x5ed51c[_0x3fc2('0x3a')]=_[_0x3fc2('0x3b')](_0x5ed18f[_0x3fc2('0x3a')]);_0x5ed51c[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x5ed51c[_0x3fc2('0x3e')],_0x5ed51c['query']);_0x78512f['attributes']=_[_0x3fc2('0x3d')](_0x5ed51c[_0x3fc2('0x3e')],qs[_0x3fc2('0x3f')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x3f')]));_0x78512f['attributes']=_0x78512f[_0x3fc2('0x40')][_0x3fc2('0x41')]?_0x78512f['attributes']:_0x5ed51c['model'];if(!_0x5ed18f[_0x3fc2('0x3a')]['hasOwnProperty'](_0x3fc2('0x42'))){_0x78512f[_0x3fc2('0x26')]=qs[_0x3fc2('0x26')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x26')]);_0x78512f[_0x3fc2('0x25')]=qs[_0x3fc2('0x25')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x25')]);}_0x78512f['order']=qs[_0x3fc2('0x43')](_0x5ed18f['query'][_0x3fc2('0x43')]);_0x78512f[_0x3fc2('0x44')]=qs[_0x3fc2('0x3c')](_[_0x3fc2('0x45')](_0x5ed18f[_0x3fc2('0x3a')],_0x5ed51c[_0x3fc2('0x3c')]),_0x73c682);var _0x14c34c=[];var _0x225986=squel[_0x3fc2('0x46')]()[_0x3fc2('0x47')]('id')[_0x3fc2('0x47')](_0x3fc2('0x2f'))[_0x3fc2('0x47')](_0x3fc2('0x48'))[_0x3fc2('0x49')]('tools_tags');var _0x2cbd0a=squel[_0x3fc2('0x46')]()[_0x3fc2('0x47')](_0x3fc2('0x4a'))[_0x3fc2('0x47')](_0x3fc2('0x4b'))[_0x3fc2('0x47')]('ui.OpenchannelInteractionId')['from'](_0x3fc2('0x4c'),'ui')[_0x3fc2('0x4d')](_0x3fc2('0x4e'),'u',_0x3fc2('0x4f'));var _0x535ce0=squel['select']()['from'](_0x3fc2('0x50'),'i')[_0x3fc2('0x4d')](_0x3fc2('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3fc2('0x4d')](_0x3fc2('0x4e'),'o',_0x3fc2('0x52'))[_0x3fc2('0x4d')](_0x3fc2('0x53'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x3fc2('0x4d')](_0x3fc2('0x54'),'me',_0x3fc2('0x55'))['left_join']('openchannel_interaction_has_tags','it',_0x3fc2('0x56'))[_0x3fc2('0x4d')]('tools_tags','t',_0x3fc2('0x57'));var _0x3deb2d=squel[_0x3fc2('0x58')]();var _0x172cfb=[];var _0x1e3616=squel[_0x3fc2('0x58')]();var _0x4d736d;if(_0x5ed18f['query'][_0x3fc2('0x59')]){_0x4d736d=as[_0x3fc2('0x5a')](_0x5ed18f['query']['search']);var _0x48c381=_0x4d736d['sqlOperator'];for(var _0x6d159e=0x0;_0x6d159e<_0x4d736d[_0x3fc2('0x5b')]['length'];_0x6d159e++){var _0x1236b1=_0x4d736d['conditions'][_0x6d159e];var _0x335b82='i';var _0x134293=_[_0x3fc2('0x5c')](_0x73c682,[_0x3fc2('0x2f'),_0x1236b1[_0x3fc2('0x47')]]);if(!_0x134293){switch(_0x1236b1[_0x3fc2('0x47')]){case _0x3fc2('0x5d'):if(_0x1236b1['value']==0x1){_0x535ce0[_0x3fc2('0x5e')]('`'+_0x1236b1['field']+'`\x20=\x200');}else{_0x535ce0['having']('`'+_0x1236b1[_0x3fc2('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x1236b1[_0x3fc2('0x5f')]===_0x3fc2('0x60')){if(_0x1236b1[_0x3fc2('0x61')][_0x3fc2('0x62')]('\x20')[_0x3fc2('0x41')]>0x1){_0x3deb2d[_0x48c381](_0x3fc2('0x63'),qs[_0x3fc2('0x64')](_0x1236b1[_0x3fc2('0x61')]),null);}else{var _0x2ce353='%'+_0x1236b1[_0x3fc2('0x61')]+'%';_0x3deb2d[_0x48c381]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2ce353,_0x2ce353,_0x2ce353);}}else{_0x134293=_[_0x3fc2('0x5c')](_0x73c682,['name',_0x3fc2('0x65')]);_0x1236b1['field']=_0x3fc2('0x65');_0x55b5f0=as['buildExpression'](_0x335b82,_0x134293['type'],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0[_0x3fc2('0x66')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0['value'][_0x3fc2('0x2e')]);}break;case _0x3fc2('0x68'):var _0x1db797=_0x1236b1[_0x3fc2('0x61')][_0x3fc2('0x62')](',')['map'](function(_0x119733){return Number(_0x119733);});_0x1db797[_0x3fc2('0x34')](function(_0xb09229){_0x1e3616['or'](_0x3fc2('0x69'),'%,'+_0xb09229+',%');});_0x172cfb=_['union'](_0x172cfb,_0x1db797);break;case _0x3fc2('0x6a'):if(_0x1236b1['operator']===_0x3fc2('0x60')){_0x3deb2d[_0x48c381](_0x3fc2('0x6b'),'%'+_0x1236b1[_0x3fc2('0x61')]+'%',null);}else{_0x134293=_[_0x3fc2('0x5c')](_0x73c682,['name','UserId']);_0x1236b1[_0x3fc2('0x47')]='UserId';_0x55b5f0=as['buildExpression'](_0x335b82,_0x134293[_0x3fc2('0x38')],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0['text'],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x2e')]);}break;case _0x3fc2('0x6c'):_0x55b5f0=as['buildExpression']('me',null,_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0[_0x3fc2('0x66')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0['value']['end']);break;}}else{var _0x55b5f0=as[_0x3fc2('0x6d')](_0x335b82,_0x134293[_0x3fc2('0x38')],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0['text'],_0x55b5f0[_0x3fc2('0x61')]['start'],_0x55b5f0[_0x3fc2('0x61')]['end']);}}}else{var _0x386d07=_(_0x5ed18f['query'])[_0x3fc2('0x3b')]()['map'](function(_0x3e81df){return _[_0x3fc2('0x6e')](_0x73c682,['name',_0x3e81df])?_0x3e81df:undefined;})[_0x3fc2('0x6f')]()[_0x3fc2('0x61')]();if(!_[_0x3fc2('0x70')](_0x386d07)){_0x386d07[_0x3fc2('0x34')](function(_0x4fad53){if(_0x4fad53==='OpenchannelAccountId'){_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x71'),[]['concat'](_0x5ed18f['query'][_0x4fad53]));}else if(_0x4fad53===_0x3fc2('0x72')){var _0x538a8b=JSON[_0x3fc2('0x73')](_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53])[_0x3fc2('0x74')];var _0x15d572=JSON[_0x3fc2('0x73')](_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53])['$lte'];_0x535ce0[_0x3fc2('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x538a8b,_0x15d572);}else{if(_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53]===_0x3fc2('0x75')){_0x535ce0[_0x3fc2('0x44')]('i.'+_0x4fad53+_0x3fc2('0x76'));}else{_0x535ce0[_0x3fc2('0x44')]('i.'+_0x4fad53+_0x3fc2('0x77'),_0x5ed18f['query'][_0x4fad53]);}}});}if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x78')]){if(_0x5ed18f[_0x3fc2('0x3a')]['read']==0x1){_0x535ce0[_0x3fc2('0x5e')](_0x3fc2('0x79'));}else{_0x535ce0[_0x3fc2('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')]){_0x172cfb=_[_0x3fc2('0x7b')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')])?_0x5ed18f['query']['tag']:new Array(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')]);_0x172cfb[_0x3fc2('0x34')](function(_0x19c415){_0x1e3616['or'](_0x3fc2('0x69'),'%,'+_0x19c415+',%');});}if(_0x5ed18f[_0x3fc2('0x3a')]['filter']){var _0x11c964=_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7c')][_0x3fc2('0x7d')]('\x5c','\x5c\x5c')[_0x3fc2('0x7d')](/'/g,'\x27\x27');if(qs[_0x3fc2('0x7e')](_0x11c964)){_0x3deb2d['or']('i.id\x20LIKE\x20?',_0x11c964+'%');}else{_0x3deb2d['or'](_0x3fc2('0x7f'),qs[_0x3fc2('0x64')](_0x11c964))['or']('i.from\x20LIKE\x20?',_0x11c964+'%')['or'](_0x3fc2('0x80'),_0x11c964+'%');}}}_0x535ce0['where'](_0x3deb2d);_0x535ce0[_0x3fc2('0x81')]('i.id');var _0x25835d={'type':db['Sequelize'][_0x3fc2('0x82')][_0x3fc2('0x83')],'raw':!![]};var _0x3a2aeb=_0x535ce0[_0x3fc2('0x84')]();_0x3a2aeb['field'](_0x3fc2('0x85'));_0x3a2aeb[_0x3fc2('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3fc2('0x5d'));if(_0x78512f[_0x3fc2('0x86')]){_0x78512f[_0x3fc2('0x86')]['forEach'](function(_0x26182d){var _0xb53b25=_0x26182d[0x0]===_0x3fc2('0x87')?_0x26182d[0x0]:'i.'+_0x26182d[0x0];_0x535ce0[_0x3fc2('0x86')](_0xb53b25,_0x26182d[0x1]===_0x3fc2('0x88')?![]:!![]);});}if(!_[_0x3fc2('0x70')](_0x172cfb)){_0x535ce0[_0x3fc2('0x5e')](_0x1e3616);_0x3a2aeb[_0x3fc2('0x44')](_0x3fc2('0x89'),_0x172cfb);}BPromise[_0x3fc2('0x8a')]()['then'](function(){if(!_0x4d736d){if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x8b')])return;_0x3a2aeb['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x8c'));return;}if(_0x5ed18f[_0x3fc2('0x8d')][_0x3fc2('0x8e')]!==_0x3fc2('0x8f'))return;return _0x5ed18f[_0x3fc2('0x8d')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0xfc8e47){if(_['isEmpty'](_0xfc8e47)){_0x3a2aeb[_0x3fc2('0x44')](_0x3fc2('0x90'));_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x90'));}else{_0x3a2aeb[_0x3fc2('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0xfc8e47,'id'));_0x535ce0['where'](_0x3fc2('0x71'),_[_0x3fc2('0x30')](_0xfc8e47,'id'));}});})[_0x3fc2('0x2c')](function(){if(_0x5ed18f['user'][_0x3fc2('0x8e')]==='agent'&&!_0x4d736d&&!_0x5ed18f['query'][_0x3fc2('0x8b')])return[];return db[_0x3fc2('0x91')][_0x3fc2('0x3a')](_0x3a2aeb[_0x3fc2('0x92')](),_0x25835d);})['then'](function(_0x32cd2e){_0x3406d7[_0x3fc2('0x24')]=_0x32cd2e['length'];if(_0x3406d7['count']===0x0)return[];return db['sequelize'][_0x3fc2('0x3a')](_0x225986[_0x3fc2('0x92')](),_0x25835d)[_0x3fc2('0x2c')](function(_0x368013){_0x14c34c=_[_0x3fc2('0x93')](_0x368013,'id');_0x25835d=_[_0x3fc2('0x94')](_0x25835d,{'model':db[_0x3fc2('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x3f')]){_0x78512f[_0x3fc2('0x40')]['forEach'](function(_0x3d8139){_0x535ce0['field']('i.'+_0x3d8139);});}else{_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x96'),_0x3fc2('0x5d'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x97'),_0x3fc2('0x98'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x99'),_0x3fc2('0x9a'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x9b'),_0x3fc2('0x87'));_0x535ce0['field'](_0x3fc2('0x9c'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x9d'),'Contact.firstName');_0x535ce0['field'](_0x3fc2('0x9e'),_0x3fc2('0x9f'));_0x535ce0['field'](_0x3fc2('0xa0'),'Contact.email');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa1'),'Contact.phone');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa2'),_0x3fc2('0xa3'));_0x535ce0[_0x3fc2('0x47')]('c.fax',_0x3fc2('0xa4'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa5'),_0x3fc2('0xa6'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa7'),'Owner.internal');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa8'),_0x3fc2('0x32'));}if(_0x78512f[_0x3fc2('0x26')])_0x535ce0[_0x3fc2('0x26')](_0x78512f[_0x3fc2('0x26')]);if(_0x78512f['offset'])_0x535ce0[_0x3fc2('0x25')](_0x78512f[_0x3fc2('0x25')]);return db['sequelize'][_0x3fc2('0x3a')](_0x535ce0[_0x3fc2('0x92')](),_0x25835d);})[_0x3fc2('0x2c')](function(_0xa438b3){if(_0xa438b3[_0x3fc2('0x41')]>0x0)_0x2cbd0a[_0x3fc2('0x44')](_0x3fc2('0xa9'),_['map'](_0xa438b3,'id'));return db['sequelize'][_0x3fc2('0x3a')](_0x2cbd0a[_0x3fc2('0x92')](),_0x25835d)['then'](function(_0x55d411){var _0x3ed34e=_['groupBy'](_0x55d411,'OpenchannelInteractionId');var _0x31ebab=[];_0xa438b3[_0x3fc2('0x34')](function(_0x3c20d1){_0x31ebab[_0x3fc2('0xaa')](updateOpenchannelInteraction(_0x3c20d1,_0x14c34c,_0x3ed34e));});return BPromise[_0x3fc2('0xab')](_0x31ebab);});});})[_0x3fc2('0x2c')](function(_0x51d615){_0x3406d7[_0x3fc2('0xac')]=_0x51d615;return _0x3406d7;})['then'](respondWithFilteredResult(_0x125d3a,_0x78512f))['catch'](handleError(_0x125d3a,null));};exports[_0x3fc2('0xad')]=function(_0x4a5701,_0x1d99d8){var _0x279d0b={};if(_0x4a5701[_0x3fc2('0x3a')][_0x3fc2('0x38')]&&_0x4a5701[_0x3fc2('0x3a')]['type']===_0x3fc2('0x49')){_0x279d0b[_0x3fc2('0x49')]=_0x4a5701[_0x3fc2('0xae')]['id'];}else{_0x279d0b['id']=_0x4a5701[_0x3fc2('0xae')]['id'];}var _0x4fc653={'raw':![],'where':_0x279d0b},_0x388337={};_0x388337['model']=_[_0x3fc2('0x3b')](db[_0x3fc2('0x95')][_0x3fc2('0xaf')]);_0x388337[_0x3fc2('0x3a')]=_[_0x3fc2('0x3b')](_0x4a5701[_0x3fc2('0x3a')]);_0x388337[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x388337[_0x3fc2('0x3e')],_0x388337['query']);_0x4fc653[_0x3fc2('0x40')]=_['intersection'](_0x388337['model'],qs[_0x3fc2('0x3f')](_0x4a5701[_0x3fc2('0x3a')]['fields']));_0x4fc653['attributes']=_0x4fc653['attributes'][_0x3fc2('0x41')]?_0x4fc653['attributes']:_0x388337['model'];if(_0x4a5701[_0x3fc2('0x3a')][_0x3fc2('0xb0')]){_0x4fc653['include']=[{'all':!![]}];}_0x4fc653=_[_0x3fc2('0x94')]({},_0x4fc653,_0x4a5701[_0x3fc2('0xb1')]);return db['OpenchannelInteraction']['find'](_0x4fc653)['then'](handleEntityNotFound(_0x1d99d8,null))[_0x3fc2('0x2c')](respondWithResult(_0x1d99d8,null))['catch'](handleError(_0x1d99d8,null));};exports[_0x3fc2('0xb2')]=function(_0x39cdda,_0x7f7b0b){return db[_0x3fc2('0x95')][_0x3fc2('0xb2')](_0x39cdda[_0x3fc2('0x6c')],{})[_0x3fc2('0x2c')](respondWithResult(_0x7f7b0b,0xc9))[_0x3fc2('0x35')](handleError(_0x7f7b0b,null));};exports['update']=function(_0x44f3ee,_0x4ad548){if(_0x44f3ee[_0x3fc2('0x6c')]['id']){delete _0x44f3ee[_0x3fc2('0x6c')]['id'];}return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x44f3ee[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x4ad548,null))[_0x3fc2('0x2c')](saveUpdates(_0x44f3ee[_0x3fc2('0x6c')],null))[_0x3fc2('0x2c')](respondWithResult(_0x4ad548,null))['catch'](handleError(_0x4ad548,null));};exports[_0x3fc2('0x2d')]=function(_0x5f0c47,_0xfe800c){return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x5f0c47[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0xfe800c,null))[_0x3fc2('0x2c')](removeEntity(_0xfe800c,null))['catch'](handleError(_0xfe800c,null));};exports[_0x3fc2('0xb3')]=function(_0x467481,_0xfa7a93){return db[_0x3fc2('0x95')][_0x3fc2('0xb3')]()[_0x3fc2('0x2c')](respondWithResult(_0xfa7a93,null))[_0x3fc2('0x35')](handleError(_0xfa7a93,null));};exports['addMessage']=function(_0x5be2e4,_0x8c3782,_0x19e0cd){return db['OpenchannelMessage'][_0x3fc2('0x5c')]({'where':{'id':_0x5be2e4[_0x3fc2('0xae')]['id']}})['then'](handleEntityNotFound(_0x8c3782,null))[_0x3fc2('0x2c')](function(_0x210c4d){if(_0x210c4d){return _0x210c4d[_0x3fc2('0xb4')](_0x5be2e4[_0x3fc2('0x6c')][_0x3fc2('0xb5')],_[_0x3fc2('0xb6')](_0x5be2e4[_0x3fc2('0x6c')],['ids','id'])||{});}})[_0x3fc2('0x2c')](respondWithResult(_0x8c3782,null))[_0x3fc2('0x35')](handleError(_0x8c3782,null));};exports[_0x3fc2('0xb7')]=function(_0x4f648c,_0x350b04,_0x443c84){var _0x2575fd={'raw':![],'where':{}};var _0x212a32={};var _0x534b85={'count':0x0,'rows':[]};return db[_0x3fc2('0x95')][_0x3fc2('0xb8')]({'where':{'id':_0x4f648c[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x350b04,null))[_0x3fc2('0x2c')](function(_0x226287){if(_0x226287){_0x212a32[_0x3fc2('0x3e')]=_[_0x3fc2('0x3b')](db[_0x3fc2('0xb9')]['rawAttributes']);_0x212a32['query']=_[_0x3fc2('0x3b')](_0x4f648c[_0x3fc2('0x3a')]);_0x212a32[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x212a32[_0x3fc2('0x3e')],_0x212a32['query']);_0x2575fd[_0x3fc2('0x40')]=_[_0x3fc2('0x3d')](_0x212a32[_0x3fc2('0x3e')],qs[_0x3fc2('0x3f')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x3f')]));_0x2575fd['attributes']=_0x2575fd[_0x3fc2('0x40')][_0x3fc2('0x41')]?_0x2575fd[_0x3fc2('0x40')]:_0x212a32[_0x3fc2('0x3e')];if(!_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0xba')](_0x3fc2('0x42'))){_0x2575fd[_0x3fc2('0x26')]=qs[_0x3fc2('0x26')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x26')]);_0x2575fd[_0x3fc2('0x25')]=qs[_0x3fc2('0x25')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x25')]);}_0x2575fd[_0x3fc2('0x86')]=qs[_0x3fc2('0x43')](_0x4f648c['query'][_0x3fc2('0x43')]);_0x2575fd[_0x3fc2('0x44')]=qs['filters'](_[_0x3fc2('0x45')](_0x4f648c[_0x3fc2('0x3a')],_0x212a32[_0x3fc2('0x3c')]));_0x2575fd[_0x3fc2('0x44')]['OpenchannelInteractionId']=_0x226287['id'];if(_0x4f648c['query']['filter']){_0x2575fd[_0x3fc2('0x44')]=_[_0x3fc2('0x94')](_0x2575fd[_0x3fc2('0x44')],{'$or':_[_0x3fc2('0x30')](_0x2575fd[_0x3fc2('0x40')],function(_0x3f1c45){var _0x3bac43={};_0x3bac43[_0x3f1c45]={'$like':'%'+_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x7c')]+'%'};return _0x3bac43;})});}if(_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x74')]){var _0x50b6db=_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x74')][_0x3fc2('0x62')](',');var _0x5e0f5a={};_0x5e0f5a[_0x50b6db[0x0]]={'$gte':moment(_0x50b6db[0x1])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))};_0x2575fd[_0x3fc2('0x44')]=_[_0x3fc2('0x94')](_0x2575fd['where'],_0x5e0f5a);}_0x2575fd=_[_0x3fc2('0x94')]({},_0x2575fd,_0x4f648c['options']);return db[_0x3fc2('0xb9')]['count']({'where':_0x2575fd[_0x3fc2('0x44')]})[_0x3fc2('0x2c')](function(_0x560967){_0x534b85[_0x3fc2('0x24')]=_0x560967;if(_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0xb0')]){_0x2575fd['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x3fc2('0xbd')](_0x2575fd);})['then'](function(_0x2845c6){_0x534b85[_0x3fc2('0xac')]=_0x2845c6;return _0x534b85;});}})[_0x3fc2('0x2c')](respondWithFilteredResult(_0x350b04,_0x2575fd))[_0x3fc2('0x35')](handleError(_0x350b04,null));};exports['addTags']=function(_0x5521d5,_0x29a7cb,_0x4e8e15){return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x5521d5[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x29a7cb,null))[_0x3fc2('0x2c')](function(_0x14f020){if(_0x14f020){return _0x14f020[_0x3fc2('0xbe')](_0x5521d5[_0x3fc2('0x6c')][_0x3fc2('0xb5')],_[_0x3fc2('0xb6')](_0x5521d5[_0x3fc2('0x6c')],[_0x3fc2('0xb5'),'id'])||{})[_0x3fc2('0xbf')](function(){return db[_0x3fc2('0x68')][_0x3fc2('0xbd')]({'attributes':['id',_0x3fc2('0x2f'),'color'],'where':{'id':_0x5521d5[_0x3fc2('0x6c')][_0x3fc2('0xb5')]}});})[_0x3fc2('0x2c')](function(_0x344a47){socket[_0x3fc2('0xc0')](_0x3fc2('0xc1'),{'id':Number(_0x5521d5[_0x3fc2('0xae')]['id']),'tags':_0x344a47||[]});return{'id':Number(_0x5521d5[_0x3fc2('0xae')]['id']),'tags':_0x344a47||[]};});}})['then'](respondWithResult(_0x29a7cb,null))[_0x3fc2('0x35')](handleError(_0x29a7cb,null));};exports['removeTags']=function(_0x20540f,_0xb2985,_0x4442d5){return db[_0x3fc2('0x95')]['find']({'where':{'id':_0x20540f['params']['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0xb2985,null))['then'](function(_0x4d129a){if(_0x4d129a){return _0x4d129a['removeTags'](_0x20540f[_0x3fc2('0x3a')]['ids']);}})[_0x3fc2('0x2c')](respondWithStatusCode(_0xb2985,null))[_0x3fc2('0x35')](handleError(_0xb2985,null));};exports['download']=function(_0x2ab87c,_0x1f7731){var _0x21877c=moment()[_0x3fc2('0xc2')]()[_0x3fc2('0x92')]();var _0x33fb77=path[_0x3fc2('0xc3')](config[_0x3fc2('0xc4')],_0x3fc2('0xc5'),_0x3fc2('0xc6'),_0x3fc2('0xc7'));var _0x5f0817=path[_0x3fc2('0xc3')](config['root'],'server',_0x3fc2('0xc6'),_0x3fc2('0xc8'));var _0x3b17f5=path[_0x3fc2('0xc3')](_0x33fb77,_0x21877c);var _0x33d92e=util[_0x3fc2('0xbb')](_0x3fc2('0xc9'),_0x2ab87c[_0x3fc2('0xae')]['id'],_0x21877c);var _0x36c9d2=path[_0x3fc2('0xc3')](_0x33fb77,_0x33d92e);var _0x544abd=[];_0x544abd[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0x6a')],'as':_0x3fc2('0x6a'),'attributes':['id',_0x3fc2('0x31')],'raw':!![]});_0x544abd['push']({'model':db[_0x3fc2('0xca')],'as':_0x3fc2('0xcb'),'attributes':['id',_0x3fc2('0xcc'),_0x3fc2('0xcd')],'raw':!![]});if(_0x2ab87c[_0x3fc2('0x3a')][_0x3fc2('0xc8')]){_0x544abd[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0xce')],'as':_0x3fc2('0xce'),'raw':!![]});}var _0x52cfef=[{'model':db['OpenchannelMessage'],'as':_0x3fc2('0xcf'),'attributes':['id',_0x3fc2('0x6c'),_0x3fc2('0x72'),_0x3fc2('0xd0'),_0x3fc2('0xd1'),'read'],'include':_0x544abd}];_0x52cfef[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0xd2')],'as':'Account','attributes':['id',_0x3fc2('0x2f')]});_0x52cfef[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0x6a')],'as':_0x3fc2('0xd3'),'attributes':['id',_0x3fc2('0x31')]});return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x2ab87c['params']['id']},'include':_0x52cfef})['then'](handleEntityNotFound(_0x1f7731,null))[_0x3fc2('0x2c')](function(_0x4ebee3){if(_0x4ebee3){var _0x25cc65=_0x4ebee3[_0x3fc2('0xd4')]({'plain':!![]});fs[_0x3fc2('0xd5')](_0x3b17f5);var _0x1afe7b={'channel':_0x3fc2('0xd6'),'account':_0x25cc65['Account']['name'],'agent':_0x25cc65[_0x3fc2('0xd3')]?_0x25cc65['Owner'][_0x3fc2('0x31')]:_0x3fc2('0xd7'),'createdAt':moment(_0x25cc65[_0x3fc2('0x72')])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))['toString'](),'closedAt':_0x25cc65[_0x3fc2('0xd8')]?moment(_0x25cc65[_0x3fc2('0xd9')])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))['toString']():'','disposition':_0x25cc65[_0x3fc2('0xda')],'visibility':_0x25cc65[_0x3fc2('0xdb')]?_0x3fc2('0xdc'):'Private','messages':_(_0x25cc65[_0x3fc2('0xcf')])[_0x3fc2('0x7c')]({'secret':![]})[_0x3fc2('0x30')](function(_0x2f1799){if(_0x2f1799['Attachment']){var _0x1adf3a=path['join'](_0x5f0817,_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')]);if(fs[_0x3fc2('0xde')](_0x1adf3a)){fs[_0x3fc2('0xdf')](_0x1adf3a)[_0x3fc2('0xe0')](fs[_0x3fc2('0xe1')](path[_0x3fc2('0xc3')](_0x3b17f5,_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')])));}}return{'date':moment(_0x2f1799[_0x3fc2('0x72')])['format'](_0x3fc2('0xbc'))[_0x3fc2('0x92')](),'sender':_0x2f1799[_0x3fc2('0xd0')]===_0x3fc2('0xe2')?_0x2f1799[_0x3fc2('0x6a')]?_0x2f1799[_0x3fc2('0x6a')]['fullname']:_0x3fc2('0xe3'):_0x2f1799[_0x3fc2('0xcb')][_0x3fc2('0xcc')]+(_0x2f1799[_0x3fc2('0xcb')]['lastName']?'\x20'+_0x2f1799[_0x3fc2('0xcb')]['lastName']:''),'body':_0x2f1799[_0x3fc2('0xce')]?_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')]:_0x2f1799[_0x3fc2('0x6c')],'direction':_0x2f1799[_0x3fc2('0xd0')]===_0x3fc2('0xe2')?'A':'C','secret':_0x2f1799['secret'],'read':_0x2f1799[_0x3fc2('0x78')],'attachment':_0x2f1799[_0x3fc2('0xce')]};})[_0x3fc2('0x61')]()};return ejs[_0x3fc2('0xe4')](path[_0x3fc2('0xc3')](config[_0x3fc2('0xc4')],'server',_0x3fc2('0xe5'),_0x3fc2('0xe6')),{'interaction':_0x1afe7b})[_0x3fc2('0x2c')](function(_0x175330){var _0x42cddd=path[_0x3fc2('0xc3')](_0x3b17f5,_0x3fc2('0xe7')+_0x25cc65['id']+'-'+_0x21877c+_0x3fc2('0xe8'));var _0x13bf31={'path':_0x42cddd,'channel':_0x3fc2('0xd6'),'interactionId':_0x25cc65['id']};return pdf['createPdfFromHTML'](_0x175330,_0x13bf31);})[_0x3fc2('0x2c')](function(){return new BPromise(function(_0x3bb262,_0xf9f86d){zipdir(_0x3b17f5,{'saveTo':_0x36c9d2},function(_0x462613,_0x567621){if(_0x462613)return _0xf9f86d(_0x462613);return _0x3bb262(_0x567621);});})[_0x3fc2('0x2c')](function(){return new BPromise(function(_0x3b1589,_0x2f0330){rimraf(_0x3b17f5,function(_0x30156e){if(_0x30156e)_0x2f0330(_0x30156e);return _0x3b1589();});});})[_0x3fc2('0x2c')](function(){return _0x1f7731[_0x3fc2('0xe9')](_0x36c9d2,_0x33d92e,function(_0x97eae3){if(_0x97eae3){console[_0x3fc2('0xea')](_0x3fc2('0xeb'),_0x97eae3);}else{fs[_0x3fc2('0xec')](_0x36c9d2);}});});});}else{return _0x1f7731[_0x3fc2('0x20')](0xc8);}})[_0x3fc2('0x35')](handleError(_0x1f7731,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3c52efe..7b7b473 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 _0xc7ed=['../../mysqldb','setMaxListeners','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction'];(function(_0x5e462b,_0x187b06){var _0xb01a65=function(_0x2cc9a3){while(--_0x2cc9a3){_0x5e462b['push'](_0x5e462b['shift']());}};_0xb01a65(++_0x187b06);}(_0xc7ed,0x1b8));var _0xdc7e=function(_0x317722,_0x58fba2){_0x317722=_0x317722-0x0;var _0xa152ad=_0xc7ed[_0x317722];return _0xa152ad;};'use strict';var EventEmitter=require(_0xdc7e('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xdc7e('0x1')];var OpenchannelMessage=require(_0xdc7e('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdc7e('0x3')](0x0);var events={'afterCreate':_0xdc7e('0x4'),'afterUpdate':_0xdc7e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x339025){return function(_0x5f1a16,_0x1e3c3a,_0x23717b){_0x5f1a16[_0xdc7e('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x40c530){_0x5f1a16[_0xdc7e('0x7')](_0xdc7e('0x8'),_0x40c530[_0xdc7e('0x9')](function(_0x2a60e3){return{'id':_0x2a60e3['id']};}));return OpenchannelMessage[_0xdc7e('0xa')]({'where':{'OpenchannelInteractionId':_0x5f1a16['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdc7e('0xb')](function(_0x42ba8b){_0x5f1a16[_0xdc7e('0x7')](_0xdc7e('0xc'),_0x42ba8b['length']);OpenchannelInteractionEvents[_0xdc7e('0xd')](_0x339025+':'+_0x5f1a16['id'],_0x5f1a16);OpenchannelInteractionEvents[_0xdc7e('0xd')](_0x339025,_0x5f1a16);_0x23717b(null);})['catch'](_0x23717b(null));};}for(var e in events){if(events[_0xdc7e('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xdc7e('0xf')](e,emitEvent(event));}}module[_0xdc7e('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf8c3=['map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf8c3,0x98));var _0x3f8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3f8c('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3f8c('0x1')];var OpenchannelMessage=require(_0x3f8c('0x2'))['db'][_0x3f8c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3f8c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3f8c('0x5')};function emitEvent(_0x3eb2cd){return function(_0x55d6e9,_0x2f87ef,_0xbb5c01){_0x55d6e9[_0x3f8c('0x6')]({'attributes':['id'],'raw':!![]})[_0x3f8c('0x7')](function(_0x3aacce){_0x55d6e9[_0x3f8c('0x8')](_0x3f8c('0x9'),_0x3aacce[_0x3f8c('0xa')](function(_0x54f965){return{'id':_0x54f965['id']};}));return OpenchannelMessage[_0x3f8c('0xb')]({'where':{'OpenchannelInteractionId':_0x55d6e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3f8c('0x7')](function(_0x513857){_0x55d6e9[_0x3f8c('0x8')](_0x3f8c('0xc'),_0x513857['length']);OpenchannelInteractionEvents[_0x3f8c('0xd')](_0x3eb2cd+':'+_0x55d6e9['id'],_0x55d6e9);OpenchannelInteractionEvents[_0x3f8c('0xd')](_0x3eb2cd,_0x55d6e9);_0xbb5c01(null);})[_0x3f8c('0xe')](_0xbb5c01(null));};}for(var e in events){if(events[_0x3f8c('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x3f8c('0x10')](e,emitEvent(event));}}module[_0x3f8c('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index d0558ee..4d61f3b 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 _0x177a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x15462c,_0x22c397){var _0x40f93d=function(_0x301a2f){while(--_0x301a2f){_0x15462c['push'](_0x15462c['shift']());}};_0x40f93d(++_0x22c397);}(_0x177a,0x114));var _0xa177=function(_0x167d88,_0x2850da){_0x167d88=_0x167d88-0x0;var _0x343088=_0x177a[_0x167d88];return _0x343088;};'use strict';var _=require(_0xa177('0x0'));var util=require(_0xa177('0x1'));var logger=require('../../config/logger')(_0xa177('0x2'));var moment=require(_0xa177('0x3'));var BPromise=require('bluebird');var rp=require(_0xa177('0x4'));var fs=require('fs');var path=require(_0xa177('0x5'));var rimraf=require(_0xa177('0x6'));var config=require(_0xa177('0x7'));var attributes=require(_0xa177('0x8'));module['exports']=function(_0x511c4e,_0x295d08){return _0x511c4e['define'](_0xa177('0x9'),attributes,{'tableName':_0xa177('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa177('0xb'),'collate':_0xa177('0xc'),'hooks':{'beforeUpdate':function(_0x10a7dc,_0xa10b8f,_0x1446cf){if(_0x10a7dc['changed'](_0xa177('0xd'))){_0x10a7dc[_0xa177('0xe')]=moment()[_0xa177('0xf')](_0xa177('0x10'));}_0x1446cf(null,_0x10a7dc);}}});}; \ No newline at end of file +var _0x46fa=['OpenchannelInteraction','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x46fa,0x76));var _0xa46f=function(_0x462071,_0x41a842){_0x462071=_0x462071-0x0;var _0x46b2bb=_0x46fa[_0x462071];return _0x46b2bb;};'use strict';var _=require(_0xa46f('0x0'));var util=require('util');var logger=require(_0xa46f('0x1'))(_0xa46f('0x2'));var moment=require(_0xa46f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa46f('0x4'));var fs=require('fs');var path=require(_0xa46f('0x5'));var rimraf=require(_0xa46f('0x6'));var config=require(_0xa46f('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xa46f('0x8')]=function(_0x50cff6,_0x5ea799){return _0x50cff6[_0xa46f('0x9')](_0xa46f('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa46f('0xb'),'hooks':{'beforeUpdate':function(_0x1dfd5a,_0x52543a,_0x47969e){if(_0x1dfd5a[_0xa46f('0xc')](_0xa46f('0xd'))){_0x1dfd5a['closedAt']=moment()[_0xa46f('0xe')](_0xa46f('0xf'));}_0x47969e(null,_0x1dfd5a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 9864379..a3b7070 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 _0x84c2=['result','catch','UpdateOpenchannelInteraction','body','options','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3aa0f4,_0x49fa72){var _0x3ce03e=function(_0x47d449){while(--_0x47d449){_0x3aa0f4['push'](_0x3aa0f4['shift']());}};_0x3ce03e(++_0x49fa72);}(_0x84c2,0xf7));var _0x284c=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0x84c2[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0x284c('0x0'));var util=require(_0x284c('0x1'));var moment=require(_0x284c('0x2'));var BPromise=require(_0x284c('0x3'));var rs=require(_0x284c('0x4'));var fs=require('fs');var Redis=require(_0x284c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x284c('0x6'));var logger=require('../../config/logger')(_0x284c('0x7'));var config=require(_0x284c('0x8'));var jayson=require(_0x284c('0x9'));var client=jayson['client'][_0x284c('0xa')]({'port':0x232a});config['redis']=_[_0x284c('0xb')](config[_0x284c('0xc')],{'host':_0x284c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x284c('0xc')]));require('./openchannelInteraction.socket')[_0x284c('0xe')](socket);function respondWithRpcPromise(_0xe2cac7,_0x4444bc,_0x334c78){return new BPromise(function(_0x11e32a,_0x3410f6){return client[_0x284c('0xf')](_0xe2cac7,_0x334c78)[_0x284c('0x10')](function(_0x21b0df){logger[_0x284c('0x11')](_0x284c('0x12'),_0x4444bc,_0x284c('0x13'));logger[_0x284c('0x14')](_0x284c('0x15'),_0x4444bc,_0x284c('0x13'),JSON[_0x284c('0x16')](_0x21b0df));if(_0x21b0df['error']){if(_0x21b0df[_0x284c('0x17')][_0x284c('0x18')]===0x1f4){logger['error'](_0x284c('0x12'),_0x4444bc,_0x21b0df[_0x284c('0x17')][_0x284c('0x19')]);return _0x3410f6(_0x21b0df[_0x284c('0x17')][_0x284c('0x19')]);}logger['error'](_0x284c('0x12'),_0x4444bc,_0x21b0df[_0x284c('0x17')][_0x284c('0x19')]);return _0x11e32a(_0x21b0df[_0x284c('0x17')][_0x284c('0x19')]);}else{logger[_0x284c('0x11')](_0x284c('0x12'),_0x4444bc,_0x284c('0x13'));_0x11e32a(_0x21b0df[_0x284c('0x1a')][_0x284c('0x19')]);}})[_0x284c('0x1b')](function(_0x32cff){logger[_0x284c('0x17')](_0x284c('0x12'),_0x4444bc,_0x32cff);_0x3410f6(_0x32cff);});});}exports[_0x284c('0x1c')]=function(_0x2f8405){var _0x2f37e9=this;return new Promise(function(_0xee79ee,_0xe29c57){return db['OpenchannelInteraction']['update'](_0x2f8405[_0x284c('0x1d')],{'raw':_0x2f8405[_0x284c('0x1e')]?_0x2f8405[_0x284c('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f8405[_0x284c('0x1e')]?_0x2f8405[_0x284c('0x1e')][_0x284c('0x1f')]||null:null,'attributes':_0x2f8405['options']?_0x2f8405[_0x284c('0x1e')]['attributes']||null:null,'limit':_0x2f8405['options']?_0x2f8405[_0x284c('0x1e')][_0x284c('0x20')]||null:null})[_0x284c('0x10')](function(_0x433332){logger[_0x284c('0x11')]('UpdateOpenchannelInteraction',_0x2f8405);logger[_0x284c('0x14')](_0x284c('0x1c'),_0x2f8405,JSON['stringify'](_0x433332));_0xee79ee(_0x433332);})[_0x284c('0x1b')](function(_0x1cf8f9){logger[_0x284c('0x17')](_0x284c('0x1c'),_0x1cf8f9['message'],_0x2f8405);_0xe29c57(_0x2f37e9[_0x284c('0x17')](0x1f4,_0x1cf8f9[_0x284c('0x19')]));});});};exports[_0x284c('0x21')]=function(_0x5dd770){return new Promise(function(_0x28f4c7,_0x181386){return db[_0x284c('0x22')][_0x284c('0x23')]({'where':_0x5dd770[_0x284c('0x1e')]?_0x5dd770[_0x284c('0x1e')][_0x284c('0x1f')]||null:null})[_0x284c('0x10')](function(_0x42b85c){if(_0x42b85c){return _0x42b85c['addTags'](_0x5dd770['body'][_0x284c('0x24')],_[_0x284c('0x25')](_0x5dd770[_0x284c('0x1d')],[_0x284c('0x24'),'id'])||{});}})['spread'](function(_0x230c03){logger[_0x284c('0x11')](_0x284c('0x26'),_0x5dd770);logger['debug'](_0x284c('0x26'),_0x5dd770,JSON[_0x284c('0x16')](_0x230c03));_0x28f4c7(_0x230c03);})['catch'](function(_0x2f205e){logger[_0x284c('0x17')]('AddTags',_0x2f205e[_0x284c('0x19')],_0x5dd770);_0x181386(_this['error'](0x1f4,_0x2f205e[_0x284c('0x19')]));});});}; \ No newline at end of file +var _0x517a=['http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','where','options','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x57bd88,_0x2e6e03){var _0x9d70d6=function(_0x27a7c4){while(--_0x27a7c4){_0x57bd88['push'](_0x57bd88['shift']());}};_0x9d70d6(++_0x2e6e03);}(_0x517a,0x108));var _0xa517=function(_0x4c3f7a,_0x1c1baf){_0x4c3f7a=_0x4c3f7a-0x0;var _0x163c23=_0x517a[_0x4c3f7a];return _0x163c23;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa517('0x0'));var BPromise=require(_0xa517('0x1'));var rs=require(_0xa517('0x2'));var fs=require('fs');var Redis=require(_0xa517('0x3'));var db=require(_0xa517('0x4'))['db'];var utils=require(_0xa517('0x5'));var logger=require(_0xa517('0x6'))(_0xa517('0x7'));var config=require('../../config/environment');var jayson=require(_0xa517('0x8'));var client=jayson['client'][_0xa517('0x9')]({'port':0x232a});config[_0xa517('0xa')]=_['defaults'](config['redis'],{'host':_0xa517('0xb'),'port':0x18eb});var socket=require(_0xa517('0xc'))(new Redis(config[_0xa517('0xa')]));require(_0xa517('0xd'))[_0xa517('0xe')](socket);function respondWithRpcPromise(_0x395fd6,_0x4d9031,_0x52f93d){return new BPromise(function(_0x5e8842,_0x23ae45){return client['request'](_0x395fd6,_0x52f93d)['then'](function(_0x24b510){logger[_0xa517('0xf')](_0xa517('0x10'),_0x4d9031,_0xa517('0x11'));logger[_0xa517('0x12')](_0xa517('0x13'),_0x4d9031,_0xa517('0x11'),JSON[_0xa517('0x14')](_0x24b510));if(_0x24b510[_0xa517('0x15')]){if(_0x24b510[_0xa517('0x15')]['code']===0x1f4){logger['error'](_0xa517('0x10'),_0x4d9031,_0x24b510['error'][_0xa517('0x16')]);return _0x23ae45(_0x24b510[_0xa517('0x15')]['message']);}logger[_0xa517('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4d9031,_0x24b510['error'][_0xa517('0x16')]);return _0x5e8842(_0x24b510[_0xa517('0x15')]['message']);}else{logger['info'](_0xa517('0x10'),_0x4d9031,_0xa517('0x11'));_0x5e8842(_0x24b510['result'][_0xa517('0x16')]);}})['catch'](function(_0x19c470){logger[_0xa517('0x15')](_0xa517('0x10'),_0x4d9031,_0x19c470);_0x23ae45(_0x19c470);});});}exports[_0xa517('0x17')]=function(_0x244c0d){var _0x38a984=this;return new Promise(function(_0x406baa,_0x211f9e){return db[_0xa517('0x18')][_0xa517('0x19')](_0x244c0d[_0xa517('0x1a')],{'raw':_0x244c0d['options']?_0x244c0d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x244c0d['options']?_0x244c0d['options'][_0xa517('0x1b')]||null:null,'attributes':_0x244c0d[_0xa517('0x1c')]?_0x244c0d[_0xa517('0x1c')][_0xa517('0x1d')]||null:null,'limit':_0x244c0d[_0xa517('0x1c')]?_0x244c0d['options'][_0xa517('0x1e')]||null:null})[_0xa517('0x1f')](function(_0x23ad4b){logger[_0xa517('0xf')](_0xa517('0x17'),_0x244c0d);logger[_0xa517('0x12')](_0xa517('0x17'),_0x244c0d,JSON[_0xa517('0x14')](_0x23ad4b));_0x406baa(_0x23ad4b);})[_0xa517('0x20')](function(_0x5fa0d){logger[_0xa517('0x15')]('UpdateOpenchannelInteraction',_0x5fa0d[_0xa517('0x16')],_0x244c0d);_0x211f9e(_0x38a984[_0xa517('0x15')](0x1f4,_0x5fa0d[_0xa517('0x16')]));});});};exports[_0xa517('0x21')]=function(_0x382d02){return new Promise(function(_0x5c187c,_0x2689df){return db[_0xa517('0x18')][_0xa517('0x22')]({'where':_0x382d02[_0xa517('0x1c')]?_0x382d02['options'][_0xa517('0x1b')]||null:null})['then'](function(_0x91b2a9){if(_0x91b2a9){return _0x91b2a9[_0xa517('0x23')](_0x382d02['body']['ids'],_['omit'](_0x382d02[_0xa517('0x1a')],[_0xa517('0x24'),'id'])||{});}})[_0xa517('0x25')](function(_0x35ab83){logger[_0xa517('0xf')](_0xa517('0x26'),_0x382d02);logger['debug'](_0xa517('0x26'),_0x382d02,JSON[_0xa517('0x14')](_0x35ab83));_0x5c187c(_0x35ab83);})[_0xa517('0x20')](function(_0xe64de9){logger[_0xa517('0x15')](_0xa517('0x26'),_0xe64de9[_0xa517('0x16')],_0x382d02);_0x2689df(_this['error'](0x1f4,_0xe64de9[_0xa517('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ad85726..320c4b7 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 _0xdfa5=['./openchannelInteraction.events','remove','emit','removeListener','register','length','openchannelInteraction:'];(function(_0xd4f0d9,_0xf357a2){var _0x32d57f=function(_0x572130){while(--_0x572130){_0xd4f0d9['push'](_0xd4f0d9['shift']());}};_0x32d57f(++_0xf357a2);}(_0xdfa5,0x1a4));var _0x5dfa=function(_0x265607,_0x46d2b4){_0x265607=_0x265607-0x0;var _0x56496d=_0xdfa5[_0x265607];return _0x56496d;};'use strict';var OpenchannelInteractionEvents=require(_0x5dfa('0x0'));var events=['save',_0x5dfa('0x1'),'update'];function createListener(_0x3d6195,_0xc21005){return function(_0x2d7ba5){_0xc21005[_0x5dfa('0x2')](_0x3d6195,_0x2d7ba5);};}function removeListener(_0x55cbd1,_0x23ea07){return function(){OpenchannelInteractionEvents[_0x5dfa('0x3')](_0x55cbd1,_0x23ea07);};}exports[_0x5dfa('0x4')]=function(_0x3134a2){for(var _0x1b2881=0x0,_0x13ff00=events[_0x5dfa('0x5')];_0x1b2881<_0x13ff00;_0x1b2881++){var _0x1dce60=events[_0x1b2881];var _0xcb9855=createListener(_0x5dfa('0x6')+_0x1dce60,_0x3134a2);OpenchannelInteractionEvents['on'](_0x1dce60,_0xcb9855);}}; \ No newline at end of file +var _0xb2c1=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x24af04,_0x4b89f6){var _0x281812=function(_0xc44877){while(--_0xc44877){_0x24af04['push'](_0x24af04['shift']());}};_0x281812(++_0x4b89f6);}(_0xb2c1,0x1d4));var _0x1b2c=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0xb2c1[_0x1ebd10];return _0x1004d3;};'use strict';var OpenchannelInteractionEvents=require(_0x1b2c('0x0'));var events=[_0x1b2c('0x1'),_0x1b2c('0x2'),_0x1b2c('0x3')];function createListener(_0xbd4988,_0x32f2c3){return function(_0x30e271){_0x32f2c3[_0x1b2c('0x4')](_0xbd4988,_0x30e271);};}function removeListener(_0x4611ac,_0x11c4f4){return function(){OpenchannelInteractionEvents[_0x1b2c('0x5')](_0x4611ac,_0x11c4f4);};}exports[_0x1b2c('0x6')]=function(_0x127dea){for(var _0x47a518=0x0,_0x30f81e=events[_0x1b2c('0x7')];_0x47a518<_0x30f81e;_0x47a518++){var _0x152b66=events[_0x47a518];var _0xf64c93=createListener(_0x1b2c('0x8')+_0x152b66,_0x127dea);OpenchannelInteractionEvents['on'](_0x152b66,_0xf64c93);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 25f8579..b220db3 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(_0x2edfad,_0x4a1d1e){var _0x46bfce=function(_0x12b49d){while(--_0x12b49d){_0x2edfad['push'](_0x2edfad['shift']());}};_0x46bfce(++_0x4a1d1e);}(_0xe706,0xa3));var _0x6e70=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0xe706[_0x479b99];return _0x1e7eb7;};'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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x5a9461,_0x30e8dc){var _0x39a3be=function(_0x5b05ee){while(--_0x5b05ee){_0x5a9461['push'](_0x5a9461['shift']());}};_0x39a3be(++_0x30e8dc);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e4f969f..8301574 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 _0x1678=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1fe85f,_0x2c1cb3){var _0x28dbfa=function(_0x40935d){while(--_0x40935d){_0x1fe85f['push'](_0x1fe85f['shift']());}};_0x28dbfa(++_0x2c1cb3);}(_0x1678,0x17b));var _0x8167=function(_0x512222,_0x140549){_0x512222=_0x512222-0x0;var _0x569fcb=_0x1678[_0x512222];return _0x569fcb;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'body':{'type':Sequelize[_0x8167('0x2')](_0x8167('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8167('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8167('0x5')),'defaultValue':_0x8167('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8167('0x6')]},'providerName':{'type':Sequelize[_0x8167('0x7')]},'providerResponse':{'type':Sequelize[_0x8167('0x2')]}}; \ No newline at end of file +var _0x0490=['DATE','STRING','TEXT','exports','ENUM','out'];(function(_0x2090a4,_0xa68974){var _0x38b531=function(_0x409765){while(--_0x409765){_0x2090a4['push'](_0x2090a4['shift']());}};_0x38b531(++_0xa68974);}(_0x0490,0x147));var _0x0049=function(_0x5f207b,_0x2bd4f2){_0x5f207b=_0x5f207b-0x0;var _0x4a1825=_0x0490[_0x5f207b];return _0x4a1825;};'use strict';var Sequelize=require('sequelize');module[_0x0049('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0049('0x1')]('in',_0x0049('0x2')),'defaultValue':_0x0049('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0049('0x3')]},'providerName':{'type':Sequelize[_0x0049('0x4')]},'providerResponse':{'type':Sequelize[_0x0049('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 45b0e5a..804d07c 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 _0x15c7=['email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','sequelize','QueryTypes','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','options','includeAll','findAll','rows','show','params','keys','include','merge','create','body','find','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname'];(function(_0xb98078,_0x16d19c){var _0x5cc636=function(_0x1c8838){while(--_0x1c8838){_0xb98078['push'](_0xb98078['shift']());}};_0x5cc636(++_0x16d19c);}(_0x15c7,0x19f));var _0x715c=function(_0x121dc5,_0x1ced7a){_0x121dc5=_0x121dc5-0x0;var _0x321406=_0x15c7[_0x121dc5];return _0x321406;};'use strict';var emlformat=require(_0x715c('0x0'));var rimraf=require(_0x715c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x715c('0x2'));var rp=require(_0x715c('0x3'));var moment=require(_0x715c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x715c('0x5'));var util=require(_0x715c('0x6'));var path=require(_0x715c('0x7'));var sox=require(_0x715c('0x8'));var csv=require(_0x715c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x715c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x715c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x715c('0x9'));var querystring=require(_0x715c('0xc'));var Papa=require('papaparse');var Redis=require(_0x715c('0xd'));var authService=require(_0x715c('0xe'));var qs=require(_0x715c('0xf'));var as=require(_0x715c('0x10'));var hardwareService=require(_0x715c('0x11'));var logger=require(_0x715c('0x12'))(_0x715c('0x13'));var utils=require(_0x715c('0x14'));var config=require(_0x715c('0x15'));var licenseUtil=require(_0x715c('0x16'));var db=require(_0x715c('0x17'))['db'];config['redis']=_['defaults'](config[_0x715c('0x18')],{'host':_0x715c('0x19'),'port':0x18eb});var socket=require(_0x715c('0x1a'))(new Redis(config[_0x715c('0x18')]));require(_0x715c('0x1b'))['register'](socket);var jayson=require(_0x715c('0x1c'));var client=jayson[_0x715c('0x1d')][_0x715c('0x1e')]({'port':0x232c});var client9002=jayson[_0x715c('0x1d')][_0x715c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3f50c2,_0x3e8ae9,_0x3735c6,_0xa257b5){return new BPromise(function(_0x87e1ce,_0x5cfbe7){var _0x3ab5fe=_0xa257b5||client;return _0x3ab5fe[_0x715c('0x1f')](_0x3f50c2,_0x3735c6)[_0x715c('0x20')](function(_0x3e428a){logger[_0x715c('0x21')](_0x715c('0x22'),_0x3e8ae9,_0x715c('0x23'));logger['debug'](_0x715c('0x24'),_0x3e8ae9,'request\x20sent',JSON['stringify'](_0x3e428a));if(_0x3e428a[_0x715c('0x25')]){if(_0x3e428a[_0x715c('0x25')][_0x715c('0x26')]===0x1f4){logger[_0x715c('0x25')](_0x715c('0x22'),_0x3e8ae9,_0x3e428a[_0x715c('0x25')]['message']);return _0x5cfbe7(_0x3e428a[_0x715c('0x25')][_0x715c('0x27')]);}logger[_0x715c('0x25')](_0x715c('0x22'),_0x3e8ae9,_0x3e428a[_0x715c('0x25')][_0x715c('0x27')]);return _0x87e1ce(_0x3e428a[_0x715c('0x25')][_0x715c('0x27')]);}else{logger['info'](_0x715c('0x22'),_0x3e8ae9,_0x715c('0x23'));_0x87e1ce(_0x3e428a[_0x715c('0x28')][_0x715c('0x27')]);}})[_0x715c('0x29')](function(_0x9b17b0){logger[_0x715c('0x25')](_0x715c('0x22'),_0x3e8ae9,_0x9b17b0);_0x5cfbe7(_0x9b17b0);});});}function respondWithStatusCode(_0x374c60,_0x74ecd2){_0x74ecd2=_0x74ecd2||0xcc;return function(_0x5432ae){if(_0x5432ae){return _0x374c60[_0x715c('0x2a')](_0x74ecd2);}return _0x374c60[_0x715c('0x2b')](_0x74ecd2)[_0x715c('0x2c')]();};}function respondWithResult(_0x573c70,_0x20eedd){_0x20eedd=_0x20eedd||0xc8;return function(_0x160ea5){if(_0x160ea5){return _0x573c70['status'](_0x20eedd)[_0x715c('0x2d')](_0x160ea5);}};}function respondWithFilteredResult(_0x1cc2e5,_0x5babc1){return function(_0x311756){if(_0x311756){var _0x2cf667=typeof _0x5babc1[_0x715c('0x2e')]===_0x715c('0x2f')&&typeof _0x5babc1['limit']===_0x715c('0x2f');var _0x37241b=_0x311756[_0x715c('0x30')];var _0x6792a=_0x2cf667?0x0:_0x5babc1[_0x715c('0x2e')];var _0x3a1963=_0x2cf667?_0x311756[_0x715c('0x30')]:_0x5babc1[_0x715c('0x2e')]+_0x5babc1[_0x715c('0x31')];var _0x1024c3;if(_0x3a1963>=_0x37241b){_0x3a1963=_0x37241b;_0x1024c3=0xc8;}else{_0x1024c3=0xce;}_0x1cc2e5[_0x715c('0x2b')](_0x1024c3);return _0x1cc2e5[_0x715c('0x32')]('Content-Range',_0x6792a+'-'+_0x3a1963+'/'+_0x37241b)[_0x715c('0x2d')](_0x311756);}return null;};}function patchUpdates(_0xde1604){return function(_0x1727ce){try{jsonpatch[_0x715c('0x33')](_0x1727ce,_0xde1604,!![]);}catch(_0x27cf7b){return BPromise[_0x715c('0x34')](_0x27cf7b);}return _0x1727ce['save']();};}function saveUpdates(_0x84c002,_0x2a38c2){return function(_0x563679){if(_0x563679){return _0x563679[_0x715c('0x35')](_0x84c002)[_0x715c('0x20')](function(_0x383b5a){return _0x383b5a;});}return null;};}function removeEntity(_0x11d2af,_0x4eb0ec){return function(_0xc26905){if(_0xc26905){return _0xc26905['destroy']()[_0x715c('0x20')](function(){_0x11d2af[_0x715c('0x2b')](0xcc)[_0x715c('0x2c')]();});}};}function handleEntityNotFound(_0x1eba87,_0xf2247){return function(_0x25ca6d){if(!_0x25ca6d){_0x1eba87['sendStatus'](0x194);}return _0x25ca6d;};}function handleError(_0x30d765,_0x4d184f){_0x4d184f=_0x4d184f||0x1f4;return function(_0x2ffd7e){logger[_0x715c('0x25')](_0x2ffd7e['stack']);if(_0x2ffd7e['name']){delete _0x2ffd7e[_0x715c('0x36')];}_0x30d765[_0x715c('0x2b')](_0x4d184f)[_0x715c('0x37')](_0x2ffd7e);};}exports[_0x715c('0x38')]=function(_0x14cff3,_0x4e4d1f){var _0x428e11={},_0x5f28fb={},_0x36c531={'count':0x0,'rows':[]};var _0x4e16bd=_[_0x715c('0x39')](db[_0x715c('0x3a')][_0x715c('0x3b')],function(_0x48face){return{'name':_0x48face[_0x715c('0x3c')],'type':_0x48face[_0x715c('0x3d')]['key']};});_0x5f28fb['model']=_['map'](_0x4e16bd,'name');_0x5f28fb[_0x715c('0x3e')]=_['keys'](_0x14cff3['query']);_0x5f28fb['filters']=_[_0x715c('0x3f')](_0x5f28fb[_0x715c('0x40')],_0x5f28fb['query']);_0x428e11[_0x715c('0x41')]=_['intersection'](_0x5f28fb[_0x715c('0x40')],qs[_0x715c('0x42')](_0x14cff3[_0x715c('0x3e')]['fields']));_0x428e11['attributes']=_0x428e11[_0x715c('0x41')][_0x715c('0x43')]?_0x428e11[_0x715c('0x41')]:_0x5f28fb[_0x715c('0x40')];if(!_0x14cff3[_0x715c('0x3e')][_0x715c('0x44')](_0x715c('0x45'))){_0x428e11[_0x715c('0x31')]=qs[_0x715c('0x31')](_0x14cff3[_0x715c('0x3e')][_0x715c('0x31')]);_0x428e11['offset']=qs[_0x715c('0x2e')](_0x14cff3[_0x715c('0x3e')]['offset']);}_0x428e11['order']=qs['sort'](_0x14cff3[_0x715c('0x3e')][_0x715c('0x46')]);_0x428e11[_0x715c('0x47')]=qs[_0x715c('0x48')](_['pick'](_0x14cff3[_0x715c('0x3e')],_0x5f28fb[_0x715c('0x48')]),_0x4e16bd);if(_0x14cff3[_0x715c('0x3e')][_0x715c('0x49')]){_0x428e11[_0x715c('0x47')]=_['merge'](_0x428e11[_0x715c('0x47')],{'$or':_[_0x715c('0x39')](_0x4e16bd,function(_0x244889){if(_0x244889[_0x715c('0x3d')]!=='VIRTUAL'){var _0x3e8a72={};_0x3e8a72[_0x244889[_0x715c('0x36')]]={'$like':'%'+_0x14cff3[_0x715c('0x3e')]['filter']+'%'};return _0x3e8a72;}})});}_0x428e11=_['merge']({},_0x428e11,_0x14cff3[_0x715c('0x4a')]);var _0x5fa545={'where':_0x428e11[_0x715c('0x47')]};return db['OpenchannelMessage']['count'](_0x5fa545)['then'](function(_0x3ab4c1){_0x36c531[_0x715c('0x30')]=_0x3ab4c1;if(_0x14cff3[_0x715c('0x3e')][_0x715c('0x4b')]){_0x428e11['include']=[{'all':!![]}];}return db[_0x715c('0x3a')][_0x715c('0x4c')](_0x428e11);})[_0x715c('0x20')](function(_0x4876c5){_0x36c531[_0x715c('0x4d')]=_0x4876c5;return _0x36c531;})[_0x715c('0x20')](respondWithFilteredResult(_0x4e4d1f,_0x428e11))[_0x715c('0x29')](handleError(_0x4e4d1f,null));};exports[_0x715c('0x4e')]=function(_0x44455c,_0x5d34d7){var _0x436f47={'raw':!![],'where':{'id':_0x44455c[_0x715c('0x4f')]['id']}},_0x825c15={};_0x825c15[_0x715c('0x40')]=_['keys'](db[_0x715c('0x3a')][_0x715c('0x3b')]);_0x825c15['query']=_[_0x715c('0x50')](_0x44455c[_0x715c('0x3e')]);_0x825c15[_0x715c('0x48')]=_[_0x715c('0x3f')](_0x825c15[_0x715c('0x40')],_0x825c15[_0x715c('0x3e')]);_0x436f47[_0x715c('0x41')]=_[_0x715c('0x3f')](_0x825c15[_0x715c('0x40')],qs[_0x715c('0x42')](_0x44455c[_0x715c('0x3e')]['fields']));_0x436f47[_0x715c('0x41')]=_0x436f47[_0x715c('0x41')][_0x715c('0x43')]?_0x436f47[_0x715c('0x41')]:_0x825c15['model'];if(_0x44455c[_0x715c('0x3e')][_0x715c('0x4b')]){_0x436f47[_0x715c('0x51')]=[{'all':!![]}];}_0x436f47=_[_0x715c('0x52')]({},_0x436f47,_0x44455c[_0x715c('0x4a')]);return db[_0x715c('0x3a')]['find'](_0x436f47)[_0x715c('0x20')](handleEntityNotFound(_0x5d34d7,null))['then'](respondWithResult(_0x5d34d7,null))[_0x715c('0x29')](handleError(_0x5d34d7,null));};exports[_0x715c('0x53')]=function(_0x127bf2,_0x1e15e4){return db[_0x715c('0x3a')][_0x715c('0x53')](_0x127bf2[_0x715c('0x54')],{})['then'](respondWithResult(_0x1e15e4,0xc9))[_0x715c('0x29')](handleError(_0x1e15e4,null));};exports[_0x715c('0x35')]=function(_0x313c48,_0x4543cb){if(_0x313c48[_0x715c('0x54')]['id']){delete _0x313c48[_0x715c('0x54')]['id'];}return db[_0x715c('0x3a')][_0x715c('0x55')]({'where':{'id':_0x313c48['params']['id']}})[_0x715c('0x20')](handleEntityNotFound(_0x4543cb,null))[_0x715c('0x20')](saveUpdates(_0x313c48[_0x715c('0x54')],null))[_0x715c('0x20')](respondWithResult(_0x4543cb,null))[_0x715c('0x29')](handleError(_0x4543cb,null));};exports['destroy']=function(_0x2128bb,_0x264591){return db[_0x715c('0x3a')][_0x715c('0x55')]({'where':{'id':_0x2128bb[_0x715c('0x4f')]['id']}})[_0x715c('0x20')](handleEntityNotFound(_0x264591,null))[_0x715c('0x20')](removeEntity(_0x264591,null))[_0x715c('0x29')](handleError(_0x264591,null));};exports[_0x715c('0x56')]=function(_0x52816a,_0x17c646){return db[_0x715c('0x3a')][_0x715c('0x56')]()['then'](respondWithResult(_0x17c646,null))['catch'](handleError(_0x17c646,null));};var interaction_log=require('../../config/logger')(_0x715c('0x57'));exports[_0x715c('0x58')]=function(_0x1011ac,_0x57d3a4,_0x55fd6e){var _0x8db458={'agent':{},'channel':_0x715c('0x59')};if(_0x1011ac[_0x715c('0x54')]['id']){delete _0x1011ac[_0x715c('0x54')]['id'];}_0x1011ac[_0x715c('0x54')][_0x715c('0x5a')]=!![];_0x1011ac[_0x715c('0x54')][_0x715c('0x5b')]=moment()[_0x715c('0x5c')](_0x715c('0x5d'));_0x1011ac[_0x715c('0x54')]['UserId']=_0x1011ac[_0x715c('0x54')][_0x715c('0x5e')]||_0x1011ac[_0x715c('0x5f')]['id'];_0x8db458[_0x715c('0x60')]['id']=_0x1011ac[_0x715c('0x54')]['UserId'];return db[_0x715c('0x3a')]['find']({'where':{'id':_0x1011ac[_0x715c('0x4f')]['id'],'UserId':null}})[_0x715c('0x20')](handleEntityNotFound(_0x57d3a4,null))['then'](saveUpdates(_0x1011ac[_0x715c('0x54')],null))[_0x715c('0x20')](function(_0x27d811){if(_0x27d811){_0x8db458[_0x715c('0x27')]=_0x27d811['get']({'plain':!![]});return db[_0x715c('0x61')][_0x715c('0x55')]({'where':{'id':_0x27d811['OpenchannelInteractionId']}});}return null;})[_0x715c('0x20')](handleEntityNotFound(_0x57d3a4,null))[_0x715c('0x20')](function(_0xdd64d5){if(_0xdd64d5){return _0xdd64d5['update']({'UserId':_0x1011ac[_0x715c('0x54')][_0x715c('0x5e')],'read1stAt':_[_0x715c('0x62')](_0xdd64d5[_0x715c('0x63')])?moment()[_0x715c('0x5c')](_0x715c('0x5d')):undefined});}return null;})[_0x715c('0x20')](function(_0x5c8a17){if(_0x5c8a17){_0x8db458[_0x715c('0x64')]=_0x5c8a17[_0x715c('0x65')]({'plain':!![]});interaction_log['info'](_0x715c('0x66'),_0x1011ac[_0x715c('0x5f')]['id'],_0x1011ac['user'][_0x715c('0x36')],_0x1011ac['user'][_0x715c('0x67')],_0x8db458['interaction']['id'],_0x1011ac[_0x715c('0x54')]?JSON['stringify'](_0x1011ac[_0x715c('0x54')]):'null');return respondWithRpcPromise(_0x715c('0x68'),_0x715c('0x69'),_0x8db458);}return null;})[_0x715c('0x20')](function(_0x186400){var _0x3fcf4a=_0x715c('0x6a')+_0x186400[_0x715c('0x27')][_0x715c('0x6b')];return db['sequelize'][_0x715c('0x3e')](_0x3fcf4a,{'type':db[_0x715c('0x6c')]['QueryTypes'][_0x715c('0x6d')],'raw':!![]})['then'](function(_0x3e882f){return _0x3e882f;});})[_0x715c('0x20')](function(_0x13f2eb){if(_0x13f2eb){_0x8db458[_0x715c('0x27')][_0x715c('0x6e')]=_0x13f2eb[0x0];if(!_0x1011ac['body'][_0x715c('0x5e')])return;return db[_0x715c('0x6f')][_0x715c('0x55')]({'where':{'id':_0x1011ac[_0x715c('0x54')][_0x715c('0x5e')],'role':'agent'},'attributes':['id',_0x715c('0x36'),_0x715c('0x70'),_0x715c('0x71'),_0x715c('0x72')],'raw':!![]});}return null;})[_0x715c('0x20')](function(_0xc27aaf){if(!_0xc27aaf)return null;_0x8db458[_0x715c('0x27')][_0x715c('0x60')]=_0xc27aaf;return _0x8db458;})[_0x715c('0x20')](function(_0x3cfcfe){if(_0x3cfcfe){if(_0x1011ac['body'][_0x715c('0x73')]){_0x8db458[_0x715c('0x27')][_0x715c('0x74')]=util[_0x715c('0x5c')](_0x715c('0x75'),_0x1011ac[_0x715c('0x5f')][_0x715c('0x36')]);_0x8db458[_0x715c('0x27')][_0x715c('0x76')]=_0x8db458[_0x715c('0x76')];_0x8db458[_0x715c('0x27')][_0x715c('0x77')]=_0x8db458['channel'];_0x8db458[_0x715c('0x27')][_0x715c('0x78')]=_0x715c('0x58');return respondWithRpcPromise(_0x715c('0x79'),_0x715c('0x79'),{'event':_0x715c('0x7a'),'message':_0x8db458[_0x715c('0x27')]},client9002)[_0x715c('0x20')](function(){return _0x8db458;});}return _0x8db458;}return null;})[_0x715c('0x20')](respondWithResult(_0x57d3a4,null))['catch'](handleError(_0x57d3a4,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['reject']=function(_0x2fcaaf,_0x279117,_0x3d2d75){var _0x23e1b8={'agent':{},'channel':_0x715c('0x59')};if(_0x2fcaaf[_0x715c('0x54')]['id']){delete _0x2fcaaf[_0x715c('0x54')]['id'];}_0x2fcaaf[_0x715c('0x54')]['UserId']=_0x2fcaaf[_0x715c('0x54')][_0x715c('0x5e')]||_0x2fcaaf[_0x715c('0x5f')]['id'];_0x23e1b8[_0x715c('0x60')]['id']=_0x2fcaaf[_0x715c('0x54')][_0x715c('0x5e')];return db[_0x715c('0x3a')][_0x715c('0x55')]({'where':{'id':_0x2fcaaf[_0x715c('0x4f')]['id'],'UserId':null}})[_0x715c('0x20')](handleEntityNotFound(_0x279117,null))[_0x715c('0x20')](function(_0x4a7b5e){if(_0x4a7b5e){_0x23e1b8[_0x715c('0x27')]=_0x4a7b5e[_0x715c('0x65')]({'plain':!![]});return db[_0x715c('0x61')][_0x715c('0x55')]({'where':{'id':_0x4a7b5e[_0x715c('0x7b')]}});}return null;})[_0x715c('0x20')](handleEntityNotFound(_0x279117,null))[_0x715c('0x20')](function(_0xdec75e){if(_0xdec75e){_0x23e1b8[_0x715c('0x64')]=_0xdec75e[_0x715c('0x65')]({'plain':!![]});interaction_log[_0x715c('0x21')](_0x715c('0x7c'),_0x2fcaaf['user']['id'],_0x2fcaaf[_0x715c('0x5f')]['name'],_0x2fcaaf[_0x715c('0x5f')][_0x715c('0x67')],_0x23e1b8[_0x715c('0x64')]['id'],_0x2fcaaf[_0x715c('0x54')]?JSON[_0x715c('0x7d')](_0x2fcaaf[_0x715c('0x54')]):_0x715c('0x7e'));return respondWithRpcPromise(_0x715c('0x7f'),_0x715c('0x80'),_0x23e1b8);}return null;})['then'](function(_0x3a2d4b){var _0x13c215='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a2d4b['message'][_0x715c('0x6b')];return db[_0x715c('0x81')][_0x715c('0x3e')](_0x13c215,{'type':db['Sequelize'][_0x715c('0x82')]['SELECT'],'raw':!![]})[_0x715c('0x20')](function(_0xd9145f){return _0xd9145f;});})['then'](function(_0x961a4){if(_0x961a4){_0x23e1b8[_0x715c('0x27')]['contact']=_0x961a4[0x0];if(!_0x2fcaaf[_0x715c('0x54')][_0x715c('0x5e')])return;return db[_0x715c('0x6f')][_0x715c('0x55')]({'where':{'id':_0x2fcaaf['body'][_0x715c('0x5e')],'role':_0x715c('0x60')},'attributes':['id',_0x715c('0x36'),_0x715c('0x70'),_0x715c('0x71'),_0x715c('0x72')],'raw':!![]});}return null;})[_0x715c('0x20')](function(_0x3f4dcb){if(!_0x3f4dcb)return null;_0x23e1b8[_0x715c('0x27')][_0x715c('0x60')]=_0x3f4dcb;return _0x23e1b8;})[_0x715c('0x20')](function(_0x34246a){if(_0x34246a){_0x34246a['message'][_0x715c('0x74')]=util['format']('SIP/%s',_0x2fcaaf[_0x715c('0x5f')][_0x715c('0x36')]);_0x34246a[_0x715c('0x27')][_0x715c('0x76')]=_0x23e1b8[_0x715c('0x76')];_0x34246a[_0x715c('0x27')][_0x715c('0x77')]=_0x23e1b8[_0x715c('0x76')];_0x34246a[_0x715c('0x27')][_0x715c('0x78')]=_0x715c('0x34');respondWithRpcPromise(_0x715c('0x79'),_0x715c('0x79'),{'event':_0x715c('0x83'),'message':_0x34246a[_0x715c('0x27')]},client9002);return _0x23e1b8;}return null;})[_0x715c('0x20')](respondWithResult(_0x279117,null))[_0x715c('0x29')](handleError(_0x279117,null));}; \ No newline at end of file +var _0x71ab=['http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','OpenchannelMessage','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','create','body','find','describe','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','format','channel','motionChannel','event','accept','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','QueryTypes','email','SIP/%s','reject','rejectmessage','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client'];(function(_0x4a2431,_0x1a303e){var _0x2b57a6=function(_0xf43ea2){while(--_0xf43ea2){_0x4a2431['push'](_0x4a2431['shift']());}};_0x2b57a6(++_0x1a303e);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];config['redis']=_['defaults'](config[_0xb71a('0x19')],{'host':_0xb71a('0x1a'),'port':0x18eb});var socket=require(_0xb71a('0x1b'))(new Redis(config[_0xb71a('0x19')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb71a('0x1c')][_0xb71a('0x1d')]({'port':0x232c});var client9002=jayson[_0xb71a('0x1c')][_0xb71a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3cd0f0,_0x1e9363,_0x31def2,_0x2ec64a){return new BPromise(function(_0x7710a8,_0x5588cf){var _0x1ca65e=_0x2ec64a||client;return _0x1ca65e[_0xb71a('0x1e')](_0x3cd0f0,_0x31def2)[_0xb71a('0x1f')](function(_0x346524){logger[_0xb71a('0x20')](_0xb71a('0x21'),_0x1e9363,_0xb71a('0x22'));logger[_0xb71a('0x23')](_0xb71a('0x24'),_0x1e9363,_0xb71a('0x22'),JSON[_0xb71a('0x25')](_0x346524));if(_0x346524['error']){if(_0x346524['error'][_0xb71a('0x26')]===0x1f4){logger[_0xb71a('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x1e9363,_0x346524['error'][_0xb71a('0x28')]);return _0x5588cf(_0x346524['error'][_0xb71a('0x28')]);}logger[_0xb71a('0x27')](_0xb71a('0x21'),_0x1e9363,_0x346524[_0xb71a('0x27')][_0xb71a('0x28')]);return _0x7710a8(_0x346524[_0xb71a('0x27')][_0xb71a('0x28')]);}else{logger[_0xb71a('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1e9363,_0xb71a('0x22'));_0x7710a8(_0x346524[_0xb71a('0x29')][_0xb71a('0x28')]);}})[_0xb71a('0x2a')](function(_0x3401f7){logger[_0xb71a('0x27')](_0xb71a('0x21'),_0x1e9363,_0x3401f7);_0x5588cf(_0x3401f7);});});}function respondWithStatusCode(_0xfc8df0,_0x31085b){_0x31085b=_0x31085b||0xcc;return function(_0x2a847a){if(_0x2a847a){return _0xfc8df0[_0xb71a('0x2b')](_0x31085b);}return _0xfc8df0[_0xb71a('0x2c')](_0x31085b)[_0xb71a('0x2d')]();};}function respondWithResult(_0x5ae0ed,_0x2e8ea6){_0x2e8ea6=_0x2e8ea6||0xc8;return function(_0x39d874){if(_0x39d874){return _0x5ae0ed[_0xb71a('0x2c')](_0x2e8ea6)[_0xb71a('0x2e')](_0x39d874);}};}function respondWithFilteredResult(_0x2fbd73,_0x38178c){return function(_0x44826e){if(_0x44826e){var _0x25364c=typeof _0x38178c[_0xb71a('0x2f')]===_0xb71a('0x30')&&typeof _0x38178c[_0xb71a('0x31')]==='undefined';var _0x56f5a4=_0x44826e[_0xb71a('0x32')];var _0x5c2a45=_0x25364c?0x0:_0x38178c[_0xb71a('0x2f')];var _0x1b1aa8=_0x25364c?_0x44826e['count']:_0x38178c[_0xb71a('0x2f')]+_0x38178c[_0xb71a('0x31')];var _0x1fe058;if(_0x1b1aa8>=_0x56f5a4){_0x1b1aa8=_0x56f5a4;_0x1fe058=0xc8;}else{_0x1fe058=0xce;}_0x2fbd73[_0xb71a('0x2c')](_0x1fe058);return _0x2fbd73[_0xb71a('0x33')](_0xb71a('0x34'),_0x5c2a45+'-'+_0x1b1aa8+'/'+_0x56f5a4)['json'](_0x44826e);}return null;};}function patchUpdates(_0x204f99){return function(_0x3f137a){try{jsonpatch[_0xb71a('0x35')](_0x3f137a,_0x204f99,!![]);}catch(_0x31e708){return BPromise['reject'](_0x31e708);}return _0x3f137a[_0xb71a('0x36')]();};}function saveUpdates(_0x140c25,_0x3e1261){return function(_0x3db4e0){if(_0x3db4e0){return _0x3db4e0[_0xb71a('0x37')](_0x140c25)[_0xb71a('0x1f')](function(_0x2962a0){return _0x2962a0;});}return null;};}function removeEntity(_0x333280,_0x10a203){return function(_0x3f5531){if(_0x3f5531){return _0x3f5531['destroy']()['then'](function(){_0x333280[_0xb71a('0x2c')](0xcc)[_0xb71a('0x2d')]();});}};}function handleEntityNotFound(_0x2fd09e,_0x12b907){return function(_0xb5d842){if(!_0xb5d842){_0x2fd09e[_0xb71a('0x2b')](0x194);}return _0xb5d842;};}function handleError(_0x394b4f,_0x564fd8){_0x564fd8=_0x564fd8||0x1f4;return function(_0x990c82){logger['error'](_0x990c82[_0xb71a('0x38')]);if(_0x990c82[_0xb71a('0x39')]){delete _0x990c82[_0xb71a('0x39')];}_0x394b4f[_0xb71a('0x2c')](_0x564fd8)['send'](_0x990c82);};}exports[_0xb71a('0x3a')]=function(_0x3ff4ed,_0x4694fd){var _0x1fa15c={},_0x1ce0ed={},_0x3f495c={'count':0x0,'rows':[]};var _0x4571c0=_[_0xb71a('0x3b')](db[_0xb71a('0x3c')]['rawAttributes'],function(_0x24a3af){return{'name':_0x24a3af['fieldName'],'type':_0x24a3af[_0xb71a('0x3d')][_0xb71a('0x3e')]};});_0x1ce0ed[_0xb71a('0x3f')]=_[_0xb71a('0x3b')](_0x4571c0,_0xb71a('0x39'));_0x1ce0ed[_0xb71a('0x40')]=_['keys'](_0x3ff4ed['query']);_0x1ce0ed['filters']=_[_0xb71a('0x41')](_0x1ce0ed['model'],_0x1ce0ed[_0xb71a('0x40')]);_0x1fa15c[_0xb71a('0x42')]=_[_0xb71a('0x41')](_0x1ce0ed[_0xb71a('0x3f')],qs[_0xb71a('0x43')](_0x3ff4ed[_0xb71a('0x40')]['fields']));_0x1fa15c[_0xb71a('0x42')]=_0x1fa15c[_0xb71a('0x42')][_0xb71a('0x44')]?_0x1fa15c[_0xb71a('0x42')]:_0x1ce0ed[_0xb71a('0x3f')];if(!_0x3ff4ed[_0xb71a('0x40')]['hasOwnProperty'](_0xb71a('0x45'))){_0x1fa15c[_0xb71a('0x31')]=qs[_0xb71a('0x31')](_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x31')]);_0x1fa15c[_0xb71a('0x2f')]=qs[_0xb71a('0x2f')](_0x3ff4ed['query']['offset']);}_0x1fa15c[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x47')]);_0x1fa15c['where']=qs[_0xb71a('0x48')](_['pick'](_0x3ff4ed[_0xb71a('0x40')],_0x1ce0ed[_0xb71a('0x48')]),_0x4571c0);if(_0x3ff4ed['query'][_0xb71a('0x49')]){_0x1fa15c[_0xb71a('0x4a')]=_[_0xb71a('0x4b')](_0x1fa15c[_0xb71a('0x4a')],{'$or':_['map'](_0x4571c0,function(_0x188896){if(_0x188896[_0xb71a('0x3d')]!==_0xb71a('0x4c')){var _0x5516bd={};_0x5516bd[_0x188896[_0xb71a('0x39')]]={'$like':'%'+_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x49')]+'%'};return _0x5516bd;}})});}_0x1fa15c=_['merge']({},_0x1fa15c,_0x3ff4ed[_0xb71a('0x4d')]);var _0xfc6a80={'where':_0x1fa15c[_0xb71a('0x4a')]};return db[_0xb71a('0x3c')][_0xb71a('0x32')](_0xfc6a80)['then'](function(_0x1d876a){_0x3f495c[_0xb71a('0x32')]=_0x1d876a;if(_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x4e')]){_0x1fa15c['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb71a('0x4f')](_0x1fa15c);})[_0xb71a('0x1f')](function(_0x1a3755){_0x3f495c[_0xb71a('0x50')]=_0x1a3755;return _0x3f495c;})[_0xb71a('0x1f')](respondWithFilteredResult(_0x4694fd,_0x1fa15c))[_0xb71a('0x2a')](handleError(_0x4694fd,null));};exports[_0xb71a('0x51')]=function(_0x15e593,_0x2ebe69){var _0x357662={'raw':!![],'where':{'id':_0x15e593[_0xb71a('0x52')]['id']}},_0x47e8e2={};_0x47e8e2[_0xb71a('0x3f')]=_['keys'](db[_0xb71a('0x3c')]['rawAttributes']);_0x47e8e2[_0xb71a('0x40')]=_[_0xb71a('0x53')](_0x15e593[_0xb71a('0x40')]);_0x47e8e2[_0xb71a('0x48')]=_[_0xb71a('0x41')](_0x47e8e2['model'],_0x47e8e2[_0xb71a('0x40')]);_0x357662['attributes']=_[_0xb71a('0x41')](_0x47e8e2[_0xb71a('0x3f')],qs['fields'](_0x15e593['query'][_0xb71a('0x43')]));_0x357662[_0xb71a('0x42')]=_0x357662['attributes']['length']?_0x357662['attributes']:_0x47e8e2[_0xb71a('0x3f')];if(_0x15e593['query']['includeAll']){_0x357662[_0xb71a('0x54')]=[{'all':!![]}];}_0x357662=_[_0xb71a('0x4b')]({},_0x357662,_0x15e593[_0xb71a('0x4d')]);return db[_0xb71a('0x3c')]['find'](_0x357662)[_0xb71a('0x1f')](handleEntityNotFound(_0x2ebe69,null))[_0xb71a('0x1f')](respondWithResult(_0x2ebe69,null))[_0xb71a('0x2a')](handleError(_0x2ebe69,null));};exports['create']=function(_0x2ac617,_0x7de9e6){return db['OpenchannelMessage'][_0xb71a('0x55')](_0x2ac617[_0xb71a('0x56')],{})[_0xb71a('0x1f')](respondWithResult(_0x7de9e6,0xc9))['catch'](handleError(_0x7de9e6,null));};exports[_0xb71a('0x37')]=function(_0x51112b,_0x2af7f0){if(_0x51112b[_0xb71a('0x56')]['id']){delete _0x51112b['body']['id'];}return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x51112b[_0xb71a('0x52')]['id']}})[_0xb71a('0x1f')](handleEntityNotFound(_0x2af7f0,null))[_0xb71a('0x1f')](saveUpdates(_0x51112b[_0xb71a('0x56')],null))[_0xb71a('0x1f')](respondWithResult(_0x2af7f0,null))['catch'](handleError(_0x2af7f0,null));};exports['destroy']=function(_0x19c72d,_0x43e9ea){return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x19c72d[_0xb71a('0x52')]['id']}})['then'](handleEntityNotFound(_0x43e9ea,null))['then'](removeEntity(_0x43e9ea,null))[_0xb71a('0x2a')](handleError(_0x43e9ea,null));};exports[_0xb71a('0x58')]=function(_0x581bf5,_0x34d664){return db[_0xb71a('0x3c')]['describe']()[_0xb71a('0x1f')](respondWithResult(_0x34d664,null))[_0xb71a('0x2a')](handleError(_0x34d664,null));};var interaction_log=require(_0xb71a('0x15'))(_0xb71a('0x59'));exports['accept']=function(_0x22146b,_0x32e9e5,_0x4c80f8){var _0x471c3c={'agent':{},'channel':_0xb71a('0x5a')};if(_0x22146b[_0xb71a('0x56')]['id']){delete _0x22146b[_0xb71a('0x56')]['id'];}_0x22146b[_0xb71a('0x56')][_0xb71a('0x5b')]=!![];_0x22146b[_0xb71a('0x56')][_0xb71a('0x5c')]=moment()['format'](_0xb71a('0x5d'));_0x22146b[_0xb71a('0x56')]['UserId']=_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')]||_0x22146b['user']['id'];_0x471c3c[_0xb71a('0x5f')]['id']=_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')];return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x22146b[_0xb71a('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32e9e5,null))['then'](saveUpdates(_0x22146b[_0xb71a('0x56')],null))[_0xb71a('0x1f')](function(_0x6fefb8){if(_0x6fefb8){_0x471c3c['message']=_0x6fefb8[_0xb71a('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb71a('0x57')]({'where':{'id':_0x6fefb8['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x32e9e5,null))[_0xb71a('0x1f')](function(_0x9af0c){if(_0x9af0c){return _0x9af0c[_0xb71a('0x37')]({'UserId':_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')],'read1stAt':_['isNil'](_0x9af0c[_0xb71a('0x61')])?moment()['format'](_0xb71a('0x5d')):undefined});}return null;})[_0xb71a('0x1f')](function(_0x41f5fe){if(_0x41f5fe){_0x471c3c['interaction']=_0x41f5fe['get']({'plain':!![]});interaction_log[_0xb71a('0x20')](_0xb71a('0x62'),_0x22146b[_0xb71a('0x63')]['id'],_0x22146b[_0xb71a('0x63')][_0xb71a('0x39')],_0x22146b['user'][_0xb71a('0x64')],_0x471c3c[_0xb71a('0x65')]['id'],_0x22146b[_0xb71a('0x56')]?JSON[_0xb71a('0x25')](_0x22146b[_0xb71a('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0xb71a('0x66'),_0x471c3c);}return null;})[_0xb71a('0x1f')](function(_0x38a8a1){var _0x3a39be=_0xb71a('0x67')+_0x38a8a1[_0xb71a('0x28')][_0xb71a('0x68')];return db['sequelize'][_0xb71a('0x40')](_0x3a39be,{'type':db[_0xb71a('0x69')]['QueryTypes'][_0xb71a('0x6a')],'raw':!![]})[_0xb71a('0x1f')](function(_0x47486d){return _0x47486d;});})['then'](function(_0x6d255e){if(_0x6d255e){_0x471c3c[_0xb71a('0x28')][_0xb71a('0x6b')]=_0x6d255e[0x0];if(!_0x22146b['body'][_0xb71a('0x5e')])return;return db[_0xb71a('0x6c')][_0xb71a('0x57')]({'where':{'id':_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')],'role':_0xb71a('0x5f')},'attributes':['id',_0xb71a('0x39'),_0xb71a('0x6d'),'email',_0xb71a('0x6e')],'raw':!![]});}return null;})[_0xb71a('0x1f')](function(_0x57896d){if(!_0x57896d)return null;_0x471c3c[_0xb71a('0x28')][_0xb71a('0x5f')]=_0x57896d;return _0x471c3c;})[_0xb71a('0x1f')](function(_0x2e9ac6){if(_0x2e9ac6){if(_0x22146b['body'][_0xb71a('0x6f')]){_0x471c3c['message'][_0xb71a('0x70')]=util[_0xb71a('0x71')]('SIP/%s',_0x22146b[_0xb71a('0x63')]['name']);_0x471c3c[_0xb71a('0x28')]['channel']=_0x471c3c[_0xb71a('0x72')];_0x471c3c[_0xb71a('0x28')][_0xb71a('0x73')]=_0x471c3c[_0xb71a('0x72')];_0x471c3c['message'][_0xb71a('0x74')]=_0xb71a('0x75');return respondWithRpcPromise('EventManager',_0xb71a('0x76'),{'event':'acceptmessage','message':_0x471c3c['message']},client9002)['then'](function(){return _0x471c3c;});}return _0x471c3c;}return null;})['then'](respondWithResult(_0x32e9e5,null))[_0xb71a('0x2a')](handleError(_0x32e9e5,null));};var interaction_log=require(_0xb71a('0x15'))(_0xb71a('0x59'));exports['reject']=function(_0x2bdf9b,_0x433d38,_0x58ed5f){var _0x299349={'agent':{},'channel':_0xb71a('0x5a')};if(_0x2bdf9b[_0xb71a('0x56')]['id']){delete _0x2bdf9b[_0xb71a('0x56')]['id'];}_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')]=_0x2bdf9b['body'][_0xb71a('0x5e')]||_0x2bdf9b[_0xb71a('0x63')]['id'];_0x299349[_0xb71a('0x5f')]['id']=_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')];return db[_0xb71a('0x3c')]['find']({'where':{'id':_0x2bdf9b[_0xb71a('0x52')]['id'],'UserId':null}})[_0xb71a('0x1f')](handleEntityNotFound(_0x433d38,null))['then'](function(_0x1e3966){if(_0x1e3966){_0x299349[_0xb71a('0x28')]=_0x1e3966[_0xb71a('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb71a('0x57')]({'where':{'id':_0x1e3966[_0xb71a('0x77')]}});}return null;})[_0xb71a('0x1f')](handleEntityNotFound(_0x433d38,null))['then'](function(_0x1a658e){if(_0x1a658e){_0x299349[_0xb71a('0x65')]=_0x1a658e['get']({'plain':!![]});interaction_log[_0xb71a('0x20')](_0xb71a('0x78'),_0x2bdf9b[_0xb71a('0x63')]['id'],_0x2bdf9b[_0xb71a('0x63')]['name'],_0x2bdf9b[_0xb71a('0x63')][_0xb71a('0x64')],_0x299349[_0xb71a('0x65')]['id'],_0x2bdf9b[_0xb71a('0x56')]?JSON['stringify'](_0x2bdf9b[_0xb71a('0x56')]):_0xb71a('0x79'));return respondWithRpcPromise('RejectMessage',_0xb71a('0x7a'),_0x299349);}return null;})[_0xb71a('0x1f')](function(_0x5df234){var _0x1bc530=_0xb71a('0x67')+_0x5df234[_0xb71a('0x28')]['ContactId'];return db[_0xb71a('0x7b')][_0xb71a('0x40')](_0x1bc530,{'type':db[_0xb71a('0x69')][_0xb71a('0x7c')][_0xb71a('0x6a')],'raw':!![]})[_0xb71a('0x1f')](function(_0x3106c3){return _0x3106c3;});})[_0xb71a('0x1f')](function(_0x19d364){if(_0x19d364){_0x299349['message']['contact']=_0x19d364[0x0];if(!_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')])return;return db[_0xb71a('0x6c')][_0xb71a('0x57')]({'where':{'id':_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')],'role':'agent'},'attributes':['id',_0xb71a('0x39'),'fullname',_0xb71a('0x7d'),'internal'],'raw':!![]});}return null;})[_0xb71a('0x1f')](function(_0x2b5ef8){if(!_0x2b5ef8)return null;_0x299349['message'][_0xb71a('0x5f')]=_0x2b5ef8;return _0x299349;})[_0xb71a('0x1f')](function(_0xe0940f){if(_0xe0940f){_0xe0940f[_0xb71a('0x28')][_0xb71a('0x70')]=util['format'](_0xb71a('0x7e'),_0x2bdf9b[_0xb71a('0x63')]['name']);_0xe0940f[_0xb71a('0x28')][_0xb71a('0x72')]=_0x299349['channel'];_0xe0940f[_0xb71a('0x28')][_0xb71a('0x73')]=_0x299349[_0xb71a('0x72')];_0xe0940f['message'][_0xb71a('0x74')]=_0xb71a('0x7f');respondWithRpcPromise(_0xb71a('0x76'),'EventManager',{'event':_0xb71a('0x80'),'message':_0xe0940f[_0xb71a('0x28')]},client9002);return _0x299349;}return null;})[_0xb71a('0x1f')](respondWithResult(_0x433d38,null))[_0xb71a('0x2a')](handleError(_0x433d38,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c407eef..49e99e7 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 _0xbcda=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xbcda,0xe1));var _0xabcd=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xbcda[_0x411add];return _0x238242;};'use strict';var EventEmitter=require(_0xabcd('0x0'));var OpenchannelMessage=require(_0xabcd('0x1'))['db'][_0xabcd('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xabcd('0x3')](0x0);var events={'afterCreate':_0xabcd('0x4'),'afterUpdate':'update','afterDestroy':_0xabcd('0x5')};function emitEvent(_0x5c9ca6){return function(_0x55bcc4,_0x4837b8,_0x47d377){OpenchannelMessageEvents[_0xabcd('0x6')](_0x5c9ca6+':'+_0x55bcc4['id'],_0x55bcc4);OpenchannelMessageEvents[_0xabcd('0x6')](_0x5c9ca6,_0x55bcc4);_0x47d377(null);};}for(var e in events){if(events[_0xabcd('0x7')](e)){var event=events[e];OpenchannelMessage[_0xabcd('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x79ed=['emit','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x79ed,0x193));var _0xd79e=function(_0x216eeb,_0x1d4d7e){_0x216eeb=_0x216eeb-0x0;var _0x1af5ab=_0x79ed[_0x216eeb];return _0x1af5ab;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd79e('0x0'))['db'][_0xd79e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd79e('0x2')](0x0);var events={'afterCreate':_0xd79e('0x3'),'afterUpdate':'update','afterDestroy':_0xd79e('0x4')};function emitEvent(_0x17c8b9){return function(_0x2b89f0,_0x1d11e7,_0x515bd5){OpenchannelMessageEvents[_0xd79e('0x5')](_0x17c8b9+':'+_0x2b89f0['id'],_0x2b89f0);OpenchannelMessageEvents[_0xd79e('0x5')](_0x17c8b9,_0x2b89f0);_0x515bd5(null);};}for(var e in events){if(events[_0xd79e('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd79e('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 4acaa0a..7b14efc 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x1a9a66,_0x2f1105){var _0x316608=function(_0x28ce1d){while(--_0x28ce1d){_0x1a9a66['push'](_0x1a9a66['shift']());}};_0x316608(++_0x2f1105);}(_0x2032,0xd9));var _0x2203=function(_0x4d49f5,_0x242286){_0x4d49f5=_0x4d49f5-0x0;var _0x425b1a=_0x2032[_0x4d49f5];return _0x425b1a;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x399da2,_0x3fa505){var _0x3408f6=function(_0x3c6a45){while(--_0x3c6a45){_0x399da2['push'](_0x399da2['shift']());}};_0x3408f6(++_0x3fa505);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'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('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b8f65ff..df0a95f 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x4edafe,_0x1b3031){var _0x100a2d=function(_0x3c7c6c){while(--_0x3c7c6c){_0x4edafe['push'](_0x4edafe['shift']());}};_0x100a2d(++_0x1b3031);}(_0x2ef3,0xba));var _0x32ef=function(_0x48da6c,_0x256a11){_0x48da6c=_0x48da6c-0x0;var _0x1ea6d2=_0x2ef3[_0x48da6c];return _0x1ea6d2;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _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(_0x392c53,_0x2ada7c){var _0x10216a=function(_0x58d78a){while(--_0x58d78a){_0x392c53['push'](_0x392c53['shift']());}};_0x10216a(++_0x2ada7c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9bb8a74..8c61e47 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 _0x9376=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x4c15bd,_0x1ee9cf){var _0x390dfe=function(_0x306b40){while(--_0x306b40){_0x4c15bd['push'](_0x4c15bd['shift']());}};_0x390dfe(++_0x1ee9cf);}(_0x9376,0x18a));var _0x6937=function(_0x1a9183,_0x24dc8d){_0x1a9183=_0x1a9183-0x0;var _0x336913=_0x9376[_0x1a9183];return _0x336913;};'use strict';var OpenchannelMessageEvents=require(_0x6937('0x0'));var events=[_0x6937('0x1'),_0x6937('0x2'),_0x6937('0x3')];function createListener(_0x462810,_0x1625a9){return function(_0x11912d){_0x1625a9[_0x6937('0x4')](_0x462810,_0x11912d);};}function removeListener(_0x2d9089,_0xef2c4){return function(){OpenchannelMessageEvents[_0x6937('0x5')](_0x2d9089,_0xef2c4);};}exports[_0x6937('0x6')]=function(_0x483565){for(var _0x3cbf04=0x0,_0x4fe67b=events['length'];_0x3cbf04<_0x4fe67b;_0x3cbf04++){var _0x3bea89=events[_0x3cbf04];var _0x1dcb6d=createListener(_0x6937('0x7')+_0x3bea89,_0x483565);OpenchannelMessageEvents['on'](_0x3bea89,_0x1dcb6d);}}; \ No newline at end of file +var _0x3e6d=['length','save','remove','update','emit','register'];(function(_0x35b07d,_0x3d0ae7){var _0x2868bc=function(_0xd8ef42){while(--_0xd8ef42){_0x35b07d['push'](_0x35b07d['shift']());}};_0x2868bc(++_0x3d0ae7);}(_0x3e6d,0x187));var _0xd3e6=function(_0x24b2e0,_0x59e72b){_0x24b2e0=_0x24b2e0-0x0;var _0x5bc0fa=_0x3e6d[_0x24b2e0];return _0x5bc0fa;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xd3e6('0x0'),_0xd3e6('0x1'),_0xd3e6('0x2')];function createListener(_0x1d7b91,_0x4c27e3){return function(_0x35714f){_0x4c27e3[_0xd3e6('0x3')](_0x1d7b91,_0x35714f);};}function removeListener(_0x1dbbf0,_0x3b0b26){return function(){OpenchannelMessageEvents['removeListener'](_0x1dbbf0,_0x3b0b26);};}exports[_0xd3e6('0x4')]=function(_0x108e97){for(var _0x171231=0x0,_0x126e04=events[_0xd3e6('0x5')];_0x171231<_0x126e04;_0x171231++){var _0x768d4=events[_0x171231];var _0x12b32a=createListener('openchannelMessage:'+_0x768d4,_0x108e97);OpenchannelMessageEvents['on'](_0x768d4,_0x12b32a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 47eb561..6e0749e 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 _0x2803=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','index','/describe','isAuthenticated','describe','get'];(function(_0x4882dc,_0x1a6680){var _0x45257f=function(_0x4f1768){while(--_0x4f1768){_0x4882dc['push'](_0x4882dc['shift']());}};_0x45257f(++_0x1a6680);}(_0x2803,0x115));var _0x3280=function(_0x50b6cd,_0x4fd3a3){_0x50b6cd=_0x50b6cd-0x0;var _0x314ed3=_0x2803[_0x50b6cd];return _0x314ed3;};'use strict';var multer=require(_0x3280('0x0'));var util=require(_0x3280('0x1'));var path=require('path');var timeout=require(_0x3280('0x2'));var express=require(_0x3280('0x3'));var router=express['Router']();var fs_extra=require(_0x3280('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3280('0x5'));var config=require(_0x3280('0x6'));var controller=require(_0x3280('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3280('0x8')]);router['get'](_0x3280('0x9'),auth[_0x3280('0xa')](),controller[_0x3280('0xb')]);router[_0x3280('0xc')](_0x3280('0xd'),auth['isAuthenticated'](),controller[_0x3280('0xe')]);router[_0x3280('0xc')](_0x3280('0xf'),auth[_0x3280('0xa')](),controller[_0x3280('0x10')]);router[_0x3280('0xc')](_0x3280('0x11'),auth['isAuthenticated'](),controller[_0x3280('0x12')]);router['get'](_0x3280('0x13'),auth['isAuthenticated'](),controller[_0x3280('0x14')]);router[_0x3280('0x15')]('/',auth[_0x3280('0xa')](),controller[_0x3280('0x16')]);router[_0x3280('0x15')](_0x3280('0x11'),auth['isAuthenticated'](),controller[_0x3280('0x17')]);router[_0x3280('0x15')](_0x3280('0x13'),auth[_0x3280('0xa')](),controller['addAgents']);router[_0x3280('0x18')](_0x3280('0xd'),auth[_0x3280('0xa')](),controller['update']);router[_0x3280('0x19')](_0x3280('0xd'),auth[_0x3280('0xa')](),controller[_0x3280('0x1a')]);router[_0x3280('0x19')](_0x3280('0x11'),auth[_0x3280('0xa')](),controller[_0x3280('0x1b')]);router[_0x3280('0x19')](_0x3280('0x13'),auth[_0x3280('0xa')](),controller[_0x3280('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x8f67=['post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x8f67,0xac));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78f6('0x0'));var util=require(_0x78f6('0x1'));var path=require(_0x78f6('0x2'));var timeout=require(_0x78f6('0x3'));var express=require(_0x78f6('0x4'));var router=express[_0x78f6('0x5')]();var fs_extra=require(_0x78f6('0x6'));var auth=require(_0x78f6('0x7'));var interaction=require(_0x78f6('0x8'));var config=require(_0x78f6('0x9'));var controller=require('./openchannelQueue.controller');router[_0x78f6('0xa')]('/',auth[_0x78f6('0xb')](),controller[_0x78f6('0xc')]);router[_0x78f6('0xa')](_0x78f6('0xd'),auth[_0x78f6('0xb')](),controller['describe']);router[_0x78f6('0xa')](_0x78f6('0xe'),auth[_0x78f6('0xb')](),controller[_0x78f6('0xf')]);router[_0x78f6('0xa')](_0x78f6('0x10'),auth[_0x78f6('0xb')](),controller['getMembers']);router['get'](_0x78f6('0x11'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x12')]);router[_0x78f6('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x78f6('0x13')]);router[_0x78f6('0x14')]('/',auth[_0x78f6('0xb')](),controller[_0x78f6('0x15')]);router[_0x78f6('0x14')]('/:id/teams',auth[_0x78f6('0xb')](),controller[_0x78f6('0x16')]);router[_0x78f6('0x14')](_0x78f6('0x17'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x18')]);router[_0x78f6('0x19')](_0x78f6('0xe'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x1a')]);router[_0x78f6('0x1b')](_0x78f6('0xe'),auth['isAuthenticated'](),controller[_0x78f6('0x1c')]);router[_0x78f6('0x1b')](_0x78f6('0x11'),auth['isAuthenticated'](),controller[_0x78f6('0x1d')]);router['delete']('/:id/users',auth[_0x78f6('0xb')](),controller[_0x78f6('0x1e')]);module[_0x78f6('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 472332f..fdb7c93 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 _0x52ce=['rrmemory','roundrobin','STRING','name','INTEGER'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x52ce,0x18d));var _0xe52c=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x52ce[_0x2e0443];return _0x52d450;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe52c('0x0')],'unique':_0xe52c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe52c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe52c('0x3'),'beepall',_0xe52c('0x4'))}}; \ No newline at end of file +var _0x90da=['STRING','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x3338ae,_0x377968){var _0x1a5dd1=function(_0x2185e7){while(--_0x2185e7){_0x3338ae['push'](_0x3338ae['shift']());}};_0x1a5dd1(++_0x377968);}(_0x90da,0x1b5));var _0xa90d=function(_0xd46820,_0x1b6305){_0xd46820=_0xd46820-0x0;var _0x34dffc=_0x90da[_0xd46820];return _0x34dffc;};'use strict';var Sequelize=require('sequelize');module[_0xa90d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa90d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa90d('0x2')](_0xa90d('0x3'),_0xa90d('0x4'),_0xa90d('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c6bdc9f..035c2fc 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 _0x433d=['OpenchannelQueue','includeAll','findAll','rows','catch','show','keys','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','pick','OpenchannelQueueId','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','filter','where','merge','VIRTUAL'];(function(_0x15cfdc,_0x3c984b){var _0x1afa35=function(_0x1e64a8){while(--_0x1e64a8){_0x15cfdc['push'](_0x15cfdc['shift']());}};_0x1afa35(++_0x3c984b);}(_0x433d,0xd5));var _0xd433=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0x433d[_0x3f25b2];return _0xd8caeb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd433('0x0'));var zipdir=require(_0xd433('0x1'));var jsonpatch=require(_0xd433('0x2'));var rp=require(_0xd433('0x3'));var moment=require(_0xd433('0x4'));var BPromise=require(_0xd433('0x5'));var Mustache=require(_0xd433('0x6'));var util=require(_0xd433('0x7'));var path=require(_0xd433('0x8'));var sox=require(_0xd433('0x9'));var csv=require('to-csv');var ejs=require(_0xd433('0xa'));var fs=require('fs');var fs_extra=require(_0xd433('0xb'));var _=require(_0xd433('0xc'));var squel=require('squel');var crypto=require(_0xd433('0xd'));var jsforce=require(_0xd433('0xe'));var deskjs=require(_0xd433('0xf'));var toCsv=require(_0xd433('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd433('0x11'));var authService=require(_0xd433('0x12'));var qs=require(_0xd433('0x13'));var as=require(_0xd433('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd433('0x15'))(_0xd433('0x16'));var utils=require('../../config/utils');var config=require(_0xd433('0x17'));var licenseUtil=require(_0xd433('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd433('0x19'))(new Redis(config[_0xd433('0x1a')]));require(_0xd433('0x1b'))[_0xd433('0x1c')](socket);function respondWithStatusCode(_0x494ac2,_0x561dab){_0x561dab=_0x561dab||0xcc;return function(_0x354903){if(_0x354903){return _0x494ac2[_0xd433('0x1d')](_0x561dab);}return _0x494ac2['status'](_0x561dab)[_0xd433('0x1e')]();};}function respondWithResult(_0x15b8db,_0x8988d7){_0x8988d7=_0x8988d7||0xc8;return function(_0x5e04b3){if(_0x5e04b3){return _0x15b8db[_0xd433('0x1f')](_0x8988d7)[_0xd433('0x20')](_0x5e04b3);}};}function respondWithFilteredResult(_0x2e5441,_0x1cdea5){return function(_0x9b24f2){if(_0x9b24f2){var _0x4b8551=typeof _0x1cdea5[_0xd433('0x21')]===_0xd433('0x22')&&typeof _0x1cdea5[_0xd433('0x23')]===_0xd433('0x22');var _0x3b629f=_0x9b24f2[_0xd433('0x24')];var _0x276a31=_0x4b8551?0x0:_0x1cdea5['offset'];var _0x5b5a59=_0x4b8551?_0x9b24f2[_0xd433('0x24')]:_0x1cdea5['offset']+_0x1cdea5[_0xd433('0x23')];var _0x3a57ae;if(_0x5b5a59>=_0x3b629f){_0x5b5a59=_0x3b629f;_0x3a57ae=0xc8;}else{_0x3a57ae=0xce;}_0x2e5441[_0xd433('0x1f')](_0x3a57ae);return _0x2e5441[_0xd433('0x25')](_0xd433('0x26'),_0x276a31+'-'+_0x5b5a59+'/'+_0x3b629f)[_0xd433('0x20')](_0x9b24f2);}return null;};}function patchUpdates(_0x457435){return function(_0x1e3e29){try{jsonpatch['apply'](_0x1e3e29,_0x457435,!![]);}catch(_0x42bed2){return BPromise['reject'](_0x42bed2);}return _0x1e3e29[_0xd433('0x27')]();};}function saveUpdates(_0x1a363b,_0x221dcf){return function(_0x404606){if(_0x404606){return _0x404606[_0xd433('0x28')](_0x1a363b)[_0xd433('0x29')](function(_0x170dc7){return _0x170dc7;});}return null;};}function removeEntity(_0x625080,_0x5a8e56){return function(_0x4e9670){if(_0x4e9670){return _0x4e9670[_0xd433('0x2a')]()[_0xd433('0x29')](function(){var _0x50caf4=_0x4e9670[_0xd433('0x2b')]({'plain':!![]});var _0x3bbafb=_0xd433('0x2c');return db[_0xd433('0x2d')][_0xd433('0x2a')]({'where':{'type':_0x3bbafb,'resourceId':_0x50caf4['id']}})[_0xd433('0x29')](function(){return _0x4e9670;});})[_0xd433('0x29')](function(){_0x625080['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4118f6,_0x39c283){return function(_0x1fbb42){if(!_0x1fbb42){_0x4118f6['sendStatus'](0x194);}return _0x1fbb42;};}function handleError(_0x4cce4a,_0x16f3aa){_0x16f3aa=_0x16f3aa||0x1f4;return function(_0x32dbc4){logger[_0xd433('0x2e')](_0x32dbc4[_0xd433('0x2f')]);if(_0x32dbc4[_0xd433('0x30')]){delete _0x32dbc4[_0xd433('0x30')];}_0x4cce4a[_0xd433('0x1f')](_0x16f3aa)[_0xd433('0x31')](_0x32dbc4);};}exports[_0xd433('0x32')]=function(_0x4397b8,_0x16ca59){var _0x10203b={},_0x4f02b2={},_0x3c988a={'count':0x0,'rows':[]};var _0x84273d=_['map'](db['OpenchannelQueue'][_0xd433('0x33')],function(_0x6ef3ba){return{'name':_0x6ef3ba[_0xd433('0x34')],'type':_0x6ef3ba[_0xd433('0x35')]['key']};});_0x4f02b2[_0xd433('0x36')]=_[_0xd433('0x37')](_0x84273d,_0xd433('0x30'));_0x4f02b2['query']=_['keys'](_0x4397b8[_0xd433('0x38')]);_0x4f02b2[_0xd433('0x39')]=_[_0xd433('0x3a')](_0x4f02b2[_0xd433('0x36')],_0x4f02b2['query']);_0x10203b[_0xd433('0x3b')]=_['intersection'](_0x4f02b2[_0xd433('0x36')],qs[_0xd433('0x3c')](_0x4397b8[_0xd433('0x38')][_0xd433('0x3c')]));_0x10203b[_0xd433('0x3b')]=_0x10203b[_0xd433('0x3b')][_0xd433('0x3d')]?_0x10203b['attributes']:_0x4f02b2[_0xd433('0x36')];if(!_0x4397b8['query']['hasOwnProperty']('nolimit')){_0x10203b[_0xd433('0x23')]=qs['limit'](_0x4397b8['query'][_0xd433('0x23')]);_0x10203b[_0xd433('0x21')]=qs[_0xd433('0x21')](_0x4397b8[_0xd433('0x38')][_0xd433('0x21')]);}_0x10203b['order']=qs['sort'](_0x4397b8['query'][_0xd433('0x3e')]);_0x10203b['where']=qs[_0xd433('0x39')](_['pick'](_0x4397b8[_0xd433('0x38')],_0x4f02b2[_0xd433('0x39')]),_0x84273d);if(_0x4397b8[_0xd433('0x38')][_0xd433('0x3f')]){_0x10203b[_0xd433('0x40')]=_[_0xd433('0x41')](_0x10203b[_0xd433('0x40')],{'$or':_[_0xd433('0x37')](_0x84273d,function(_0x591d7c){if(_0x591d7c[_0xd433('0x35')]!==_0xd433('0x42')){var _0x383161={};_0x383161[_0x591d7c[_0xd433('0x30')]]={'$like':'%'+_0x4397b8['query'][_0xd433('0x3f')]+'%'};return _0x383161;}})});}_0x10203b=_[_0xd433('0x41')]({},_0x10203b,_0x4397b8['options']);var _0x53bd28={'where':_0x10203b[_0xd433('0x40')]};return db[_0xd433('0x43')][_0xd433('0x24')](_0x53bd28)['then'](function(_0x3d9c0a){_0x3c988a[_0xd433('0x24')]=_0x3d9c0a;if(_0x4397b8['query'][_0xd433('0x44')]){_0x10203b['include']=[{'all':!![]}];}return db[_0xd433('0x43')][_0xd433('0x45')](_0x10203b);})[_0xd433('0x29')](function(_0x17e1c0){_0x3c988a[_0xd433('0x46')]=_0x17e1c0;return _0x3c988a;})[_0xd433('0x29')](respondWithFilteredResult(_0x16ca59,_0x10203b))[_0xd433('0x47')](handleError(_0x16ca59,null));};exports[_0xd433('0x48')]=function(_0x3892bc,_0x4e313e){var _0x211e5c={'raw':!![],'where':{'id':_0x3892bc['params']['id']}},_0x45fd75={};_0x45fd75[_0xd433('0x36')]=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x45fd75[_0xd433('0x38')]=_[_0xd433('0x49')](_0x3892bc[_0xd433('0x38')]);_0x45fd75[_0xd433('0x39')]=_[_0xd433('0x3a')](_0x45fd75[_0xd433('0x36')],_0x45fd75['query']);_0x211e5c[_0xd433('0x3b')]=_[_0xd433('0x3a')](_0x45fd75[_0xd433('0x36')],qs['fields'](_0x3892bc[_0xd433('0x38')]['fields']));_0x211e5c[_0xd433('0x3b')]=_0x211e5c[_0xd433('0x3b')][_0xd433('0x3d')]?_0x211e5c[_0xd433('0x3b')]:_0x45fd75[_0xd433('0x36')];if(_0x3892bc[_0xd433('0x38')][_0xd433('0x44')]){_0x211e5c['include']=[{'all':!![]}];}_0x211e5c=_[_0xd433('0x41')]({},_0x211e5c,_0x3892bc[_0xd433('0x4a')]);return db[_0xd433('0x43')][_0xd433('0x4b')](_0x211e5c)['then'](handleEntityNotFound(_0x4e313e,null))[_0xd433('0x29')](respondWithResult(_0x4e313e,null))[_0xd433('0x47')](handleError(_0x4e313e,null));};exports[_0xd433('0x4c')]=function(_0x35de13,_0x28004e){return db[_0xd433('0x43')][_0xd433('0x4c')](_0x35de13[_0xd433('0x4d')],{})[_0xd433('0x29')](function(_0x8357a1){var _0x2f8954=_0x35de13['user'][_0xd433('0x2b')]({'plain':!![]});if(!_0x2f8954)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8954['role']===_0xd433('0x4e')){var _0x3e4d80=_0x8357a1[_0xd433('0x2b')]({'plain':!![]});var _0x3b113a=_0xd433('0x2c');return db[_0xd433('0x4f')][_0xd433('0x4b')]({'where':{'name':_0x3b113a,'userProfileId':_0x2f8954['userProfileId']},'raw':!![]})[_0xd433('0x29')](function(_0x221a9a){if(_0x221a9a&&_0x221a9a[_0xd433('0x50')]===0x0){return db[_0xd433('0x2d')][_0xd433('0x4c')]({'name':_0x3e4d80[_0xd433('0x30')],'resourceId':_0x3e4d80['id'],'type':_0x221a9a[_0xd433('0x30')],'sectionId':_0x221a9a['id']},{})[_0xd433('0x29')](function(){return _0x8357a1;});}else{return _0x8357a1;}})['catch'](function(_0x4b29c5){logger[_0xd433('0x2e')](_0xd433('0x51'),_0x4b29c5);throw _0x4b29c5;});}return _0x8357a1;})[_0xd433('0x29')](respondWithResult(_0x28004e,0xc9))[_0xd433('0x47')](handleError(_0x28004e,null));};exports[_0xd433('0x28')]=function(_0x345e18,_0x34f78c){if(_0x345e18[_0xd433('0x4d')]['id']){delete _0x345e18[_0xd433('0x4d')]['id'];}return db[_0xd433('0x43')][_0xd433('0x4b')]({'where':{'id':_0x345e18[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x34f78c,null))[_0xd433('0x29')](saveUpdates(_0x345e18[_0xd433('0x4d')],null))[_0xd433('0x29')](respondWithResult(_0x34f78c,null))[_0xd433('0x47')](handleError(_0x34f78c,null));};exports['destroy']=function(_0x1179cf,_0x20711a){return db[_0xd433('0x43')][_0xd433('0x4b')]({'where':{'id':_0x1179cf[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x20711a,null))['then'](removeEntity(_0x20711a,null))[_0xd433('0x47')](handleError(_0x20711a,null));};exports['describe']=function(_0x2527cc,_0xa1725c){return db[_0xd433('0x43')][_0xd433('0x53')]()[_0xd433('0x29')](respondWithResult(_0xa1725c,null))['catch'](handleError(_0xa1725c,null));};exports[_0xd433('0x54')]=function(_0x5a8d0e,_0x21f949,_0x51fffe){var _0x213542={'raw':!![],'where':{}},_0x2c6ef8={},_0x3b9137;return db[_0xd433('0x43')][_0xd433('0x55')]({'where':{'id':_0x5a8d0e[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x21f949,null))['then'](function(_0x216d6e){if(_0x216d6e){_0x3b9137=_0x216d6e[_0xd433('0x2b')]({'plain':!![]});_0x2c6ef8[_0xd433('0x36')]=_[_0xd433('0x49')](db[_0xd433('0x56')][_0xd433('0x33')]);_0x2c6ef8[_0xd433('0x38')]=_[_0xd433('0x49')](_0x5a8d0e[_0xd433('0x38')]);_0x2c6ef8[_0xd433('0x39')]=_[_0xd433('0x3a')](_0x2c6ef8[_0xd433('0x36')],_0x2c6ef8[_0xd433('0x38')]);_0x213542['attributes']=_['intersection'](_0x2c6ef8[_0xd433('0x36')],qs['fields'](_0x5a8d0e[_0xd433('0x38')][_0xd433('0x3c')]));_0x213542[_0xd433('0x3b')]=_0x213542[_0xd433('0x3b')]['length']?_0x213542[_0xd433('0x3b')]:_0x2c6ef8[_0xd433('0x36')];if(!_0x5a8d0e[_0xd433('0x38')][_0xd433('0x57')](_0xd433('0x58'))){_0x213542[_0xd433('0x23')]=qs['limit'](_0x5a8d0e[_0xd433('0x38')][_0xd433('0x23')]);_0x213542[_0xd433('0x21')]=qs[_0xd433('0x21')](_0x5a8d0e[_0xd433('0x38')]['offset']);}_0x213542[_0xd433('0x59')]=qs['sort'](_0x5a8d0e[_0xd433('0x38')]['sort']);_0x213542[_0xd433('0x40')]=qs[_0xd433('0x39')](_[_0xd433('0x5a')](_0x5a8d0e[_0xd433('0x38')],_0x2c6ef8['filters']));_0x213542[_0xd433('0x40')][_0xd433('0x5b')]=_0x216d6e['id'];if(_0x5a8d0e[_0xd433('0x38')][_0xd433('0x3f')]){_0x213542[_0xd433('0x40')]=_['merge'](_0x213542[_0xd433('0x40')],{'$or':_[_0xd433('0x37')](_0x213542[_0xd433('0x3b')],function(_0x202668){var _0x13a0c4={};_0x13a0c4[_0x202668]={'$like':'%'+_0x5a8d0e[_0xd433('0x38')]['filter']+'%'};return _0x13a0c4;})});}_0x213542=_[_0xd433('0x41')]({},_0x213542,_0x5a8d0e[_0xd433('0x4a')]);return db['UserOpenchannelQueue'][_0xd433('0x45')](_0x213542);}})['then'](function(_0xa1e017){if(_0xa1e017){return db['User']['findAndCountAll']({'where':{'id':_[_0xd433('0x37')](_0xa1e017,_0xd433('0x5c')),'role':_0xd433('0x5d')},'attributes':['id','name','openchannelPause','updatedAt',_0xd433('0x5e')]});}})[_0xd433('0x29')](function(_0x2066dd){if(_0x2066dd){return{'count':_0x2066dd[_0xd433('0x24')],'rows':_[_0xd433('0x37')](_0x2066dd['rows'],function(_0x26595d){return{'membername':_0x26595d[_0xd433('0x30')],'UserId':_0x26595d['id'],'queue_name':_0x3b9137['name'],'OpenchannelQueueId':_0x3b9137['id'],'interface':util[_0xd433('0x5f')](_0xd433('0x60'),_0xd433('0x61'),_0x26595d[_0xd433('0x30')]),'penalty':0x0,'paused':_0x26595d['openchannelPause'],'createdAt':_0x26595d[_0xd433('0x5e')],'updatedAt':_0x26595d[_0xd433('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd433('0x29')](respondWithFilteredResult(_0x21f949,_0x213542))[_0xd433('0x47')](handleError(_0x21f949,null));};exports['getTeams']=function(_0x15227a,_0x49545d,_0x397d1a){var _0x25c91c={};var _0x523509={};var _0xe279a2;var _0x15bfb0;return db[_0xd433('0x43')]['findOne']({'where':{'id':_0x15227a['params']['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x49545d,null))[_0xd433('0x29')](function(_0x29a711){if(_0x29a711){_0xe279a2=_0x29a711;_0x523509[_0xd433('0x36')]=_[_0xd433('0x49')](db[_0xd433('0x63')][_0xd433('0x33')]);_0x523509['query']=_['keys'](_0x15227a[_0xd433('0x38')]);_0x523509[_0xd433('0x39')]=_['intersection'](_0x523509[_0xd433('0x36')],_0x523509['query']);_0x25c91c[_0xd433('0x3b')]=_['intersection'](_0x523509[_0xd433('0x36')],qs['fields'](_0x15227a[_0xd433('0x38')][_0xd433('0x3c')]));_0x25c91c[_0xd433('0x3b')]=_0x25c91c[_0xd433('0x3b')][_0xd433('0x3d')]?_0x25c91c[_0xd433('0x3b')]:_0x523509[_0xd433('0x36')];_0x25c91c[_0xd433('0x59')]=qs[_0xd433('0x3e')](_0x15227a[_0xd433('0x38')]['sort']);_0x25c91c[_0xd433('0x40')]=qs[_0xd433('0x39')](_[_0xd433('0x5a')](_0x15227a[_0xd433('0x38')],_0x523509[_0xd433('0x39')]));if(_0x15227a['query'][_0xd433('0x3f')]){_0x25c91c[_0xd433('0x40')]=_[_0xd433('0x41')](_0x25c91c[_0xd433('0x40')],{'$or':_[_0xd433('0x37')](_0x25c91c[_0xd433('0x3b')],function(_0x2536a8){var _0x12b0df={};_0x12b0df[_0x2536a8]={'$like':'%'+_0x15227a['query'][_0xd433('0x3f')]+'%'};return _0x12b0df;})});}_0x25c91c=_[_0xd433('0x41')]({},_0x25c91c,_0x15227a[_0xd433('0x4a')]);return _0xe279a2[_0xd433('0x64')](_0x25c91c);}})['then'](function(_0x214eb2){if(_0x214eb2){_0x15bfb0=_0x214eb2['length'];if(!_0x15227a['query'][_0xd433('0x57')](_0xd433('0x58'))){_0x25c91c[_0xd433('0x23')]=qs[_0xd433('0x23')](_0x15227a[_0xd433('0x38')]['limit']);_0x25c91c[_0xd433('0x21')]=qs[_0xd433('0x21')](_0x15227a[_0xd433('0x38')][_0xd433('0x21')]);}return _0xe279a2[_0xd433('0x64')](_0x25c91c);}})[_0xd433('0x29')](function(_0x14d1c5){if(_0x14d1c5){return _0x14d1c5?{'count':_0x15bfb0,'rows':_0x14d1c5}:null;}})[_0xd433('0x29')](respondWithResult(_0x49545d,null))[_0xd433('0x47')](handleError(_0x49545d,null));};exports[_0xd433('0x65')]=function(_0x1eeaf8,_0x256f32,_0x53b818){var _0x4a8683=_0x1eeaf8[_0xd433('0x4d')][_0xd433('0x66')];return db['Team'][_0xd433('0x45')]({'where':{'id':_0x4a8683},'attributes':['id'],'include':[{'model':db[_0xd433('0x67')],'as':_0xd433('0x68'),'attributes':['id',_0xd433('0x30'),_0xd433('0x69'),_0xd433('0x6a'),_0xd433('0x6b')],'raw':!![]}]})['then'](function(_0xfdb639){if(_0xfdb639){var _0x358df0=_[_0xd433('0x6c')](_0xfdb639,function(_0x194785){var _0x181c3c=_0x194785['get']({'plain':!![]});return _0x181c3c['Agents'];});return db[_0xd433('0x43')]['find']({'where':{'id':_0x1eeaf8[_0xd433('0x52')]['id']}})['then'](function(_0x56b278){return db[_0xd433('0x6d')][_0xd433('0x6e')](function(_0x1464b4){return _0x56b278[_0xd433('0x65')](_0x4a8683,{'transaction':_0x1464b4})[_0xd433('0x29')](function(){return BPromise['each'](_0x358df0,function(_0xbf48fd){return db[_0xd433('0x56')][_0xd433('0x6f')]({'where':{'UserId':_0xbf48fd['id'],'OpenchannelQueueId':_0x1eeaf8[_0xd433('0x52')]['id']},'transaction':_0x1464b4});});})[_0xd433('0x29')](function(){_0x358df0['forEach'](function(_0x55a5f4){socket[_0xd433('0x70')](_0xd433('0x71'),{'UserId':_0x55a5f4['id'],'OpenchannelQueueId':_0x56b278['id']});});});});});}})[_0xd433('0x29')](respondWithStatusCode(_0x256f32,null))[_0xd433('0x47')](handleError(_0x256f32,null));};exports[_0xd433('0x72')]=function(_0x5a3cfc,_0x4c7005,_0x33bb3f){return db['Team']['findAll']({'where':{'id':_0x5a3cfc[_0xd433('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd433('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd433('0x29')](handleEntityNotFound(_0x4c7005,null))[_0xd433('0x29')](function(_0x55dbdb){var _0x31fa34=_[_0xd433('0x37')](_0x55dbdb,'id');var _0x260336=[];var _0x516674=[];var _0x50d13f=squel[_0xd433('0x73')]();_0x50d13f[_0xd433('0x74')](_0xd433('0x75'))['from'](_0xd433('0x76'),'tq')['join'](_0xd433('0x77'),'ut',_0xd433('0x78'))[_0xd433('0x40')](_0xd433('0x79'),_0x5a3cfc[_0xd433('0x52')]['id']);for(var _0x4fce40=0x0;_0x4fce40<_0x55dbdb['length'];_0x4fce40+=0x1){let _0xbba6ca=_0x55dbdb[_0x4fce40];for(var _0x23c564=0x0;_0x23c564<_0xbba6ca['Agents'][_0xd433('0x3d')];_0x23c564+=0x1){let _0x52b658=_0xbba6ca['Agents'][_0x23c564];var _0xb285e3=_0x50d13f['clone']();_0xb285e3[_0xd433('0x40')](_0xd433('0x7a'),_0x52b658['id']);_0x516674[_0xd433('0x7b')](db[_0xd433('0x6d')][_0xd433('0x38')](_0xb285e3[_0xd433('0x7c')](),{'type':db[_0xd433('0x6d')][_0xd433('0x7d')][_0xd433('0x7e')]})[_0xd433('0x29')](function(_0x3429f5){if(_0x3429f5[_0xd433('0x3d')]===0x1){return _0x52b658['id'];}else{var _0x2f2d00=_[_0xd433('0x7f')](_[_0xd433('0x37')](_0x3429f5,_0xd433('0x80')),function(_0x351c37){return _[_0xd433('0x81')](_0x31fa34,_0x351c37);});if(_0x2f2d00){return _0x52b658['id'];}}}));}}return BPromise[_0xd433('0x82')](_0x516674)[_0xd433('0x29')](function(_0x545b64){_0x260336=_(_0x260336)[_0xd433('0x83')](_0x545b64)['compact']()['value']();return db['OpenchannelQueue'][_0xd433('0x4b')]({'where':{'id':_0x5a3cfc[_0xd433('0x52')]['id']}})[_0xd433('0x29')](function(_0x5a47e8){return db[_0xd433('0x6d')][_0xd433('0x6e')](function(_0x3bf673){return _0x5a47e8[_0xd433('0x72')](_0x5a3cfc[_0xd433('0x38')][_0xd433('0x66')],{'transaction':_0x3bf673})['then'](function(){if(!_[_0xd433('0x84')](_0x260336)){return _0x5a47e8[_0xd433('0x85')](_0x260336,{'transaction':_0x3bf673});}})['then'](function(){_0x260336['forEach'](function(_0x3fcc42){socket['emit'](_0xd433('0x86'),{'UserId':_0x3fcc42,'OpenchannelQueueId':_0x5a47e8['id']});});});});});});})[_0xd433('0x29')](respondWithStatusCode(_0x4c7005,null))[_0xd433('0x47')](handleError(_0x4c7005,null));};exports[_0xd433('0x87')]=function(_0x3ed6d4,_0x51a654,_0x184781){return db[_0xd433('0x43')][_0xd433('0x4b')]({'where':{'id':_0x3ed6d4[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x51a654,null))['then'](function(_0x1c211d){if(_0x1c211d){return _0x1c211d[_0xd433('0x87')](_0x3ed6d4[_0xd433('0x4d')][_0xd433('0x66')],_[_0xd433('0x88')](_0x3ed6d4[_0xd433('0x4d')],[_0xd433('0x66'),'id'])||{})[_0xd433('0x89')](function(_0x4f533a){for(var _0x3218ab=0x0;_0x3218ab<_0x3ed6d4[_0xd433('0x4d')][_0xd433('0x66')]['length'];_0x3218ab+=0x1){socket[_0xd433('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x3ed6d4[_0xd433('0x4d')][_0xd433('0x66')][_0x3218ab]),'OpenchannelQueueId':Number(_0x3ed6d4[_0xd433('0x52')]['id'])});}return _0x4f533a;});}})[_0xd433('0x29')](respondWithResult(_0x51a654,null))[_0xd433('0x47')](handleError(_0x51a654,null));};exports[_0xd433('0x85')]=function(_0x318f43,_0x1feddd,_0x46f982){return db[_0xd433('0x43')]['find']({'where':{'id':_0x318f43[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x1feddd,null))[_0xd433('0x29')](function(_0x12f8b2){if(_0x12f8b2){return _0x12f8b2[_0xd433('0x85')](_0x318f43[_0xd433('0x38')][_0xd433('0x66')])[_0xd433('0x29')](function(){if(_[_0xd433('0x8a')](_0x318f43[_0xd433('0x38')]['ids'])){for(var _0x4647d5=0x0;_0x4647d5<_0x318f43[_0xd433('0x38')][_0xd433('0x66')][_0xd433('0x3d')];_0x4647d5+=0x1){socket[_0xd433('0x70')](_0xd433('0x86'),{'UserId':Number(_0x318f43['query'][_0xd433('0x66')][_0x4647d5]),'OpenchannelQueueId':Number(_0x318f43['params']['id'])});}}else{socket[_0xd433('0x70')](_0xd433('0x86'),{'UserId':Number(_0x318f43[_0xd433('0x38')][_0xd433('0x66')]),'OpenchannelQueueId':Number(_0x318f43[_0xd433('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x1feddd,null))['catch'](handleError(_0x1feddd,null));};exports[_0xd433('0x8b')]=function(_0x2e0ff3,_0x5867ae,_0x57823e){var _0x593d32={};var _0x16ed9d={};var _0x31b196;var _0x364622;return db[_0xd433('0x43')][_0xd433('0x55')]({'where':{'id':_0x2e0ff3[_0xd433('0x52')]['id']}})[_0xd433('0x29')](handleEntityNotFound(_0x5867ae,null))[_0xd433('0x29')](function(_0x10f1df){if(_0x10f1df){_0x31b196=_0x10f1df;_0x16ed9d[_0xd433('0x36')]=_['keys'](db[_0xd433('0x67')][_0xd433('0x33')]);_0x16ed9d[_0xd433('0x38')]=_[_0xd433('0x49')](_0x2e0ff3['query']);_0x16ed9d[_0xd433('0x39')]=_['intersection'](_0x16ed9d[_0xd433('0x36')],_0x16ed9d[_0xd433('0x38')]);_0x593d32[_0xd433('0x3b')]=_[_0xd433('0x3a')](_0x16ed9d['model'],qs[_0xd433('0x3c')](_0x2e0ff3['query'][_0xd433('0x3c')]));_0x593d32[_0xd433('0x3b')]=_0x593d32[_0xd433('0x3b')]['length']?_0x593d32[_0xd433('0x3b')]:_0x16ed9d[_0xd433('0x36')];_0x593d32[_0xd433('0x59')]=qs['sort'](_0x2e0ff3['query']['sort']);_0x593d32[_0xd433('0x40')]=qs['filters'](_[_0xd433('0x5a')](_0x2e0ff3['query'],_0x16ed9d[_0xd433('0x39')]));if(_0x2e0ff3['query']['filter']){_0x593d32['where']=_[_0xd433('0x41')](_0x593d32[_0xd433('0x40')],{'$or':_[_0xd433('0x37')](_0x593d32['attributes'],function(_0x3ed174){var _0x395029={};_0x395029[_0x3ed174]={'$like':'%'+_0x2e0ff3['query']['filter']+'%'};return _0x395029;})});}_0x593d32=_[_0xd433('0x41')]({},_0x593d32,_0x2e0ff3['options']);return _0x31b196[_0xd433('0x8b')](_0x593d32);}})['then'](function(_0x226f13){if(_0x226f13){_0x364622=_0x226f13[_0xd433('0x3d')];if(!_0x2e0ff3['query'][_0xd433('0x57')](_0xd433('0x58'))){_0x593d32[_0xd433('0x23')]=qs['limit'](_0x2e0ff3[_0xd433('0x38')][_0xd433('0x23')]);_0x593d32[_0xd433('0x21')]=qs[_0xd433('0x21')](_0x2e0ff3['query'][_0xd433('0x21')]);}return _0x31b196[_0xd433('0x8b')](_0x593d32);}})[_0xd433('0x29')](function(_0x8942c6){if(_0x8942c6){return _0x8942c6?{'count':_0x364622,'rows':_0x8942c6}:null;}})[_0xd433('0x29')](respondWithResult(_0x5867ae,null))[_0xd433('0x47')](handleError(_0x5867ae,null));}; \ No newline at end of file +var _0x02a3=['type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','where','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','toString','QueryTypes','every','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName'];(function(_0xa4b8e1,_0x49d30b){var _0x507e42=function(_0xca2abc){while(--_0xca2abc){_0xa4b8e1['push'](_0xa4b8e1['shift']());}};_0x507e42(++_0x49d30b);}(_0x02a3,0xe6));var _0x302a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x02a3[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x302a('0x0'));var jsonpatch=require(_0x302a('0x1'));var rp=require('request-promise');var moment=require(_0x302a('0x2'));var BPromise=require(_0x302a('0x3'));var Mustache=require(_0x302a('0x4'));var util=require(_0x302a('0x5'));var path=require(_0x302a('0x6'));var sox=require(_0x302a('0x7'));var csv=require(_0x302a('0x8'));var ejs=require(_0x302a('0x9'));var fs=require('fs');var fs_extra=require(_0x302a('0xa'));var _=require(_0x302a('0xb'));var squel=require(_0x302a('0xc'));var crypto=require(_0x302a('0xd'));var jsforce=require(_0x302a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x302a('0x8'));var querystring=require(_0x302a('0xf'));var Papa=require(_0x302a('0x10'));var Redis=require(_0x302a('0x11'));var authService=require(_0x302a('0x12'));var qs=require(_0x302a('0x13'));var as=require(_0x302a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x302a('0x15'))(_0x302a('0x16'));var utils=require(_0x302a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x302a('0x18'));var db=require(_0x302a('0x19'))['db'];config[_0x302a('0x1a')]=_[_0x302a('0x1b')](config['redis'],{'host':_0x302a('0x1c'),'port':0x18eb});var socket=require(_0x302a('0x1d'))(new Redis(config[_0x302a('0x1a')]));require('./openchannelQueue.socket')[_0x302a('0x1e')](socket);function respondWithStatusCode(_0x51ca67,_0x4d9bed){_0x4d9bed=_0x4d9bed||0xcc;return function(_0x28a3d9){if(_0x28a3d9){return _0x51ca67[_0x302a('0x1f')](_0x4d9bed);}return _0x51ca67[_0x302a('0x20')](_0x4d9bed)[_0x302a('0x21')]();};}function respondWithResult(_0x4752d1,_0x501038){_0x501038=_0x501038||0xc8;return function(_0x574ed6){if(_0x574ed6){return _0x4752d1[_0x302a('0x20')](_0x501038)[_0x302a('0x22')](_0x574ed6);}};}function respondWithFilteredResult(_0xc17ee2,_0x21b420){return function(_0x7e4d66){if(_0x7e4d66){var _0x4e3b7e=typeof _0x21b420[_0x302a('0x23')]==='undefined'&&typeof _0x21b420['limit']===_0x302a('0x24');var _0x511d00=_0x7e4d66[_0x302a('0x25')];var _0x318931=_0x4e3b7e?0x0:_0x21b420[_0x302a('0x23')];var _0x32139e=_0x4e3b7e?_0x7e4d66[_0x302a('0x25')]:_0x21b420[_0x302a('0x23')]+_0x21b420[_0x302a('0x26')];var _0x175e9b;if(_0x32139e>=_0x511d00){_0x32139e=_0x511d00;_0x175e9b=0xc8;}else{_0x175e9b=0xce;}_0xc17ee2[_0x302a('0x20')](_0x175e9b);return _0xc17ee2['set']('Content-Range',_0x318931+'-'+_0x32139e+'/'+_0x511d00)[_0x302a('0x22')](_0x7e4d66);}return null;};}function patchUpdates(_0x25833a){return function(_0x286c64){try{jsonpatch[_0x302a('0x27')](_0x286c64,_0x25833a,!![]);}catch(_0x1c8287){return BPromise['reject'](_0x1c8287);}return _0x286c64[_0x302a('0x28')]();};}function saveUpdates(_0x27b9f9,_0xeddb38){return function(_0x4605c2){if(_0x4605c2){return _0x4605c2['update'](_0x27b9f9)['then'](function(_0x189c12){return _0x189c12;});}return null;};}function removeEntity(_0x37285b,_0x86ccb2){return function(_0x56f12f){if(_0x56f12f){return _0x56f12f['destroy']()[_0x302a('0x29')](function(){var _0x2fe715=_0x56f12f[_0x302a('0x2a')]({'plain':!![]});var _0x375309=_0x302a('0x2b');return db[_0x302a('0x2c')][_0x302a('0x2d')]({'where':{'type':_0x375309,'resourceId':_0x2fe715['id']}})[_0x302a('0x29')](function(){return _0x56f12f;});})[_0x302a('0x29')](function(){_0x37285b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2ae7,_0x1c7a29){return function(_0x3f0053){if(!_0x3f0053){_0x3b2ae7[_0x302a('0x1f')](0x194);}return _0x3f0053;};}function handleError(_0x18a110,_0x9448a9){_0x9448a9=_0x9448a9||0x1f4;return function(_0x32123a){logger[_0x302a('0x2e')](_0x32123a[_0x302a('0x2f')]);if(_0x32123a[_0x302a('0x30')]){delete _0x32123a[_0x302a('0x30')];}_0x18a110['status'](_0x9448a9)[_0x302a('0x31')](_0x32123a);};}exports['index']=function(_0x3419f0,_0x2e2a3f){var _0xf7365={},_0x3af8ac={},_0x2c3093={'count':0x0,'rows':[]};var _0x579f12=_[_0x302a('0x32')](db[_0x302a('0x33')][_0x302a('0x34')],function(_0x31c80a){return{'name':_0x31c80a[_0x302a('0x35')],'type':_0x31c80a[_0x302a('0x36')]['key']};});_0x3af8ac[_0x302a('0x37')]=_[_0x302a('0x32')](_0x579f12,_0x302a('0x30'));_0x3af8ac['query']=_[_0x302a('0x38')](_0x3419f0[_0x302a('0x39')]);_0x3af8ac['filters']=_[_0x302a('0x3a')](_0x3af8ac[_0x302a('0x37')],_0x3af8ac['query']);_0xf7365[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x3af8ac[_0x302a('0x37')],qs[_0x302a('0x3c')](_0x3419f0[_0x302a('0x39')][_0x302a('0x3c')]));_0xf7365[_0x302a('0x3b')]=_0xf7365[_0x302a('0x3b')][_0x302a('0x3d')]?_0xf7365[_0x302a('0x3b')]:_0x3af8ac['model'];if(!_0x3419f0[_0x302a('0x39')]['hasOwnProperty'](_0x302a('0x3e'))){_0xf7365[_0x302a('0x26')]=qs['limit'](_0x3419f0[_0x302a('0x39')][_0x302a('0x26')]);_0xf7365[_0x302a('0x23')]=qs[_0x302a('0x23')](_0x3419f0[_0x302a('0x39')][_0x302a('0x23')]);}_0xf7365[_0x302a('0x3f')]=qs['sort'](_0x3419f0[_0x302a('0x39')][_0x302a('0x40')]);_0xf7365['where']=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x3419f0['query'],_0x3af8ac[_0x302a('0x41')]),_0x579f12);if(_0x3419f0[_0x302a('0x39')]['filter']){_0xf7365['where']=_[_0x302a('0x43')](_0xf7365['where'],{'$or':_[_0x302a('0x32')](_0x579f12,function(_0x5db8d8){if(_0x5db8d8[_0x302a('0x36')]!==_0x302a('0x44')){var _0x5b8654={};_0x5b8654[_0x5db8d8[_0x302a('0x30')]]={'$like':'%'+_0x3419f0['query'][_0x302a('0x45')]+'%'};return _0x5b8654;}})});}_0xf7365=_[_0x302a('0x43')]({},_0xf7365,_0x3419f0[_0x302a('0x46')]);var _0x1980cf={'where':_0xf7365['where']};return db['OpenchannelQueue']['count'](_0x1980cf)[_0x302a('0x29')](function(_0x7f5feb){_0x2c3093[_0x302a('0x25')]=_0x7f5feb;if(_0x3419f0['query'][_0x302a('0x47')]){_0xf7365[_0x302a('0x48')]=[{'all':!![]}];}return db[_0x302a('0x33')][_0x302a('0x49')](_0xf7365);})['then'](function(_0x1779d9){_0x2c3093['rows']=_0x1779d9;return _0x2c3093;})[_0x302a('0x29')](respondWithFilteredResult(_0x2e2a3f,_0xf7365))['catch'](handleError(_0x2e2a3f,null));};exports[_0x302a('0x4a')]=function(_0x8bb515,_0x9c09b8){var _0xf1e3e9={'raw':!![],'where':{'id':_0x8bb515[_0x302a('0x4b')]['id']}},_0x7261f5={};_0x7261f5[_0x302a('0x37')]=_[_0x302a('0x38')](db[_0x302a('0x33')][_0x302a('0x34')]);_0x7261f5[_0x302a('0x39')]=_['keys'](_0x8bb515[_0x302a('0x39')]);_0x7261f5['filters']=_[_0x302a('0x3a')](_0x7261f5[_0x302a('0x37')],_0x7261f5[_0x302a('0x39')]);_0xf1e3e9['attributes']=_[_0x302a('0x3a')](_0x7261f5['model'],qs[_0x302a('0x3c')](_0x8bb515[_0x302a('0x39')][_0x302a('0x3c')]));_0xf1e3e9['attributes']=_0xf1e3e9['attributes']['length']?_0xf1e3e9['attributes']:_0x7261f5[_0x302a('0x37')];if(_0x8bb515['query'][_0x302a('0x47')]){_0xf1e3e9[_0x302a('0x48')]=[{'all':!![]}];}_0xf1e3e9=_[_0x302a('0x43')]({},_0xf1e3e9,_0x8bb515['options']);return db[_0x302a('0x33')][_0x302a('0x4c')](_0xf1e3e9)[_0x302a('0x29')](handleEntityNotFound(_0x9c09b8,null))[_0x302a('0x29')](respondWithResult(_0x9c09b8,null))[_0x302a('0x4d')](handleError(_0x9c09b8,null));};exports['create']=function(_0x33426b,_0x54d766){return db[_0x302a('0x33')][_0x302a('0x4e')](_0x33426b[_0x302a('0x4f')],{})[_0x302a('0x29')](function(_0x3c9c02){var _0x29d046=_0x33426b[_0x302a('0x50')][_0x302a('0x2a')]({'plain':!![]});if(!_0x29d046)throw new Error(_0x302a('0x51'));if(_0x29d046[_0x302a('0x52')]===_0x302a('0x50')){var _0x2e7023=_0x3c9c02[_0x302a('0x2a')]({'plain':!![]});var _0x58b181=_0x302a('0x2b');return db[_0x302a('0x53')][_0x302a('0x4c')]({'where':{'name':_0x58b181,'userProfileId':_0x29d046[_0x302a('0x54')]},'raw':!![]})['then'](function(_0x272600){if(_0x272600&&_0x272600[_0x302a('0x55')]===0x0){return db[_0x302a('0x2c')][_0x302a('0x4e')]({'name':_0x2e7023[_0x302a('0x30')],'resourceId':_0x2e7023['id'],'type':_0x272600[_0x302a('0x30')],'sectionId':_0x272600['id']},{})[_0x302a('0x29')](function(){return _0x3c9c02;});}else{return _0x3c9c02;}})[_0x302a('0x4d')](function(_0x4e4261){logger[_0x302a('0x2e')](_0x302a('0x56'),_0x4e4261);throw _0x4e4261;});}return _0x3c9c02;})[_0x302a('0x29')](respondWithResult(_0x54d766,0xc9))[_0x302a('0x4d')](handleError(_0x54d766,null));};exports[_0x302a('0x57')]=function(_0x4566b7,_0x1c54b8){if(_0x4566b7[_0x302a('0x4f')]['id']){delete _0x4566b7['body']['id'];}return db['OpenchannelQueue'][_0x302a('0x4c')]({'where':{'id':_0x4566b7[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x1c54b8,null))[_0x302a('0x29')](saveUpdates(_0x4566b7[_0x302a('0x4f')],null))[_0x302a('0x29')](respondWithResult(_0x1c54b8,null))[_0x302a('0x4d')](handleError(_0x1c54b8,null));};exports[_0x302a('0x2d')]=function(_0x6d78b4,_0x470777){return db[_0x302a('0x33')]['find']({'where':{'id':_0x6d78b4['params']['id']}})['then'](handleEntityNotFound(_0x470777,null))['then'](removeEntity(_0x470777,null))[_0x302a('0x4d')](handleError(_0x470777,null));};exports[_0x302a('0x58')]=function(_0x545a6d,_0x38a5ae){return db[_0x302a('0x33')]['describe']()[_0x302a('0x29')](respondWithResult(_0x38a5ae,null))['catch'](handleError(_0x38a5ae,null));};exports[_0x302a('0x59')]=function(_0x43693f,_0x497626,_0x71f2ac){var _0x4c3072={'raw':!![],'where':{}},_0x2ae6fd={},_0x4e88a1;return db[_0x302a('0x33')][_0x302a('0x5a')]({'where':{'id':_0x43693f['params']['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x497626,null))[_0x302a('0x29')](function(_0x24eae7){if(_0x24eae7){_0x4e88a1=_0x24eae7[_0x302a('0x2a')]({'plain':!![]});_0x2ae6fd['model']=_[_0x302a('0x38')](db[_0x302a('0x5b')][_0x302a('0x34')]);_0x2ae6fd[_0x302a('0x39')]=_[_0x302a('0x38')](_0x43693f[_0x302a('0x39')]);_0x2ae6fd['filters']=_[_0x302a('0x3a')](_0x2ae6fd[_0x302a('0x37')],_0x2ae6fd[_0x302a('0x39')]);_0x4c3072[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x2ae6fd[_0x302a('0x37')],qs['fields'](_0x43693f['query'][_0x302a('0x3c')]));_0x4c3072[_0x302a('0x3b')]=_0x4c3072[_0x302a('0x3b')][_0x302a('0x3d')]?_0x4c3072[_0x302a('0x3b')]:_0x2ae6fd[_0x302a('0x37')];if(!_0x43693f[_0x302a('0x39')][_0x302a('0x5c')](_0x302a('0x3e'))){_0x4c3072[_0x302a('0x26')]=qs['limit'](_0x43693f[_0x302a('0x39')][_0x302a('0x26')]);_0x4c3072['offset']=qs[_0x302a('0x23')](_0x43693f[_0x302a('0x39')][_0x302a('0x23')]);}_0x4c3072[_0x302a('0x3f')]=qs['sort'](_0x43693f['query'][_0x302a('0x40')]);_0x4c3072[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x43693f['query'],_0x2ae6fd[_0x302a('0x41')]));_0x4c3072['where'][_0x302a('0x5e')]=_0x24eae7['id'];if(_0x43693f['query'][_0x302a('0x45')]){_0x4c3072['where']=_[_0x302a('0x43')](_0x4c3072[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x4c3072['attributes'],function(_0x185c0c){var _0x2c4d39={};_0x2c4d39[_0x185c0c]={'$like':'%'+_0x43693f[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x2c4d39;})});}_0x4c3072=_[_0x302a('0x43')]({},_0x4c3072,_0x43693f[_0x302a('0x46')]);return db[_0x302a('0x5b')][_0x302a('0x49')](_0x4c3072);}})[_0x302a('0x29')](function(_0x5e039f){if(_0x5e039f){return db['User'][_0x302a('0x5f')]({'where':{'id':_[_0x302a('0x32')](_0x5e039f,_0x302a('0x60')),'role':_0x302a('0x61')},'attributes':['id',_0x302a('0x30'),_0x302a('0x62'),_0x302a('0x63'),_0x302a('0x64')]});}})[_0x302a('0x29')](function(_0xcdfe63){if(_0xcdfe63){return{'count':_0xcdfe63['count'],'rows':_[_0x302a('0x32')](_0xcdfe63['rows'],function(_0x2f7e13){return{'membername':_0x2f7e13[_0x302a('0x30')],'UserId':_0x2f7e13['id'],'queue_name':_0x4e88a1[_0x302a('0x30')],'OpenchannelQueueId':_0x4e88a1['id'],'interface':util[_0x302a('0x65')](_0x302a('0x66'),_0x302a('0x67'),_0x2f7e13[_0x302a('0x30')]),'penalty':0x0,'paused':_0x2f7e13[_0x302a('0x62')],'createdAt':_0x2f7e13[_0x302a('0x64')],'updatedAt':_0x2f7e13['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x302a('0x29')](respondWithFilteredResult(_0x497626,_0x4c3072))[_0x302a('0x4d')](handleError(_0x497626,null));};exports['getTeams']=function(_0x8e7b27,_0x472af2,_0x226819){var _0x42cf3f={};var _0x17896a={};var _0x20d641;var _0x19e8e7;return db[_0x302a('0x33')][_0x302a('0x5a')]({'where':{'id':_0x8e7b27[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x472af2,null))['then'](function(_0x4f5a9f){if(_0x4f5a9f){_0x20d641=_0x4f5a9f;_0x17896a[_0x302a('0x37')]=_[_0x302a('0x38')](db[_0x302a('0x68')][_0x302a('0x34')]);_0x17896a[_0x302a('0x39')]=_[_0x302a('0x38')](_0x8e7b27[_0x302a('0x39')]);_0x17896a[_0x302a('0x41')]=_[_0x302a('0x3a')](_0x17896a[_0x302a('0x37')],_0x17896a['query']);_0x42cf3f['attributes']=_['intersection'](_0x17896a['model'],qs[_0x302a('0x3c')](_0x8e7b27[_0x302a('0x39')]['fields']));_0x42cf3f[_0x302a('0x3b')]=_0x42cf3f['attributes'][_0x302a('0x3d')]?_0x42cf3f[_0x302a('0x3b')]:_0x17896a[_0x302a('0x37')];_0x42cf3f['order']=qs['sort'](_0x8e7b27[_0x302a('0x39')][_0x302a('0x40')]);_0x42cf3f[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x8e7b27[_0x302a('0x39')],_0x17896a[_0x302a('0x41')]));if(_0x8e7b27[_0x302a('0x39')][_0x302a('0x45')]){_0x42cf3f[_0x302a('0x5d')]=_[_0x302a('0x43')](_0x42cf3f[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x42cf3f['attributes'],function(_0x496b68){var _0x316508={};_0x316508[_0x496b68]={'$like':'%'+_0x8e7b27[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x316508;})});}_0x42cf3f=_[_0x302a('0x43')]({},_0x42cf3f,_0x8e7b27[_0x302a('0x46')]);return _0x20d641['getTeams'](_0x42cf3f);}})['then'](function(_0x556fef){if(_0x556fef){_0x19e8e7=_0x556fef['length'];if(!_0x8e7b27[_0x302a('0x39')][_0x302a('0x5c')](_0x302a('0x3e'))){_0x42cf3f['limit']=qs['limit'](_0x8e7b27['query'][_0x302a('0x26')]);_0x42cf3f[_0x302a('0x23')]=qs[_0x302a('0x23')](_0x8e7b27[_0x302a('0x39')][_0x302a('0x23')]);}return _0x20d641['getTeams'](_0x42cf3f);}})[_0x302a('0x29')](function(_0x52d3c1){if(_0x52d3c1){return _0x52d3c1?{'count':_0x19e8e7,'rows':_0x52d3c1}:null;}})['then'](respondWithResult(_0x472af2,null))['catch'](handleError(_0x472af2,null));};exports['addTeams']=function(_0x319a6b,_0x468dd1,_0x4f0d7b){var _0x24024a=_0x319a6b['body'][_0x302a('0x69')];return db[_0x302a('0x68')][_0x302a('0x49')]({'where':{'id':_0x24024a},'attributes':['id'],'include':[{'model':db[_0x302a('0x6a')],'as':_0x302a('0x6b'),'attributes':['id',_0x302a('0x30'),'online',_0x302a('0x6c'),_0x302a('0x6d')],'raw':!![]}]})[_0x302a('0x29')](function(_0x1f0cc8){if(_0x1f0cc8){var _0x59d589=_[_0x302a('0x6e')](_0x1f0cc8,function(_0x584dc7){var _0x2f9e7b=_0x584dc7[_0x302a('0x2a')]({'plain':!![]});return _0x2f9e7b[_0x302a('0x6b')];});return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x319a6b[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](function(_0x4a68be){return db[_0x302a('0x6f')][_0x302a('0x70')](function(_0x3ea91b){return _0x4a68be[_0x302a('0x71')](_0x24024a,{'transaction':_0x3ea91b})[_0x302a('0x29')](function(){return BPromise['each'](_0x59d589,function(_0x3ae822){return db[_0x302a('0x5b')][_0x302a('0x72')]({'where':{'UserId':_0x3ae822['id'],'OpenchannelQueueId':_0x319a6b[_0x302a('0x4b')]['id']},'transaction':_0x3ea91b});});})['then'](function(){_0x59d589[_0x302a('0x73')](function(_0x5eeacd){socket[_0x302a('0x74')](_0x302a('0x75'),{'UserId':_0x5eeacd['id'],'OpenchannelQueueId':_0x4a68be['id']});});});});});}})[_0x302a('0x29')](respondWithStatusCode(_0x468dd1,null))['catch'](handleError(_0x468dd1,null));};exports[_0x302a('0x76')]=function(_0x4540cc,_0x3ae1b8,_0x516a4d){return db[_0x302a('0x68')][_0x302a('0x49')]({'where':{'id':_0x4540cc['query'][_0x302a('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x302a('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x302a('0x29')](handleEntityNotFound(_0x3ae1b8,null))[_0x302a('0x29')](function(_0x4de724){var _0x34813a=_[_0x302a('0x32')](_0x4de724,'id');var _0x5c5f0a=[];var _0x1bd7ab=[];var _0x62945=squel[_0x302a('0x77')]();_0x62945[_0x302a('0x78')](_0x302a('0x79'))[_0x302a('0x7a')](_0x302a('0x7b'),'tq')[_0x302a('0x7c')]('user_has_teams','ut',_0x302a('0x7d'))[_0x302a('0x5d')](_0x302a('0x7e'),_0x4540cc[_0x302a('0x4b')]['id']);for(var _0x437b0d=0x0;_0x437b0d<_0x4de724[_0x302a('0x3d')];_0x437b0d+=0x1){let _0x3814bb=_0x4de724[_0x437b0d];for(var _0x2c43d2=0x0;_0x2c43d2<_0x3814bb[_0x302a('0x6b')]['length'];_0x2c43d2+=0x1){let _0x465abf=_0x3814bb[_0x302a('0x6b')][_0x2c43d2];var _0xe5aed=_0x62945['clone']();_0xe5aed[_0x302a('0x5d')]('ut.UserId\x20=\x20?',_0x465abf['id']);_0x1bd7ab['push'](db[_0x302a('0x6f')][_0x302a('0x39')](_0xe5aed[_0x302a('0x7f')](),{'type':db['sequelize'][_0x302a('0x80')]['SELECT']})[_0x302a('0x29')](function(_0x5741e3){if(_0x5741e3[_0x302a('0x3d')]===0x1){return _0x465abf['id'];}else{var _0x52b979=_[_0x302a('0x81')](_[_0x302a('0x32')](_0x5741e3,'TeamId'),function(_0x2dee8e){return _[_0x302a('0x82')](_0x34813a,_0x2dee8e);});if(_0x52b979){return _0x465abf['id'];}}}));}}return BPromise['all'](_0x1bd7ab)[_0x302a('0x29')](function(_0x412573){_0x5c5f0a=_(_0x5c5f0a)[_0x302a('0x83')](_0x412573)[_0x302a('0x84')]()[_0x302a('0x85')]();return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x4540cc[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](function(_0x462bb9){return db[_0x302a('0x6f')][_0x302a('0x70')](function(_0x2ef814){return _0x462bb9[_0x302a('0x76')](_0x4540cc[_0x302a('0x39')][_0x302a('0x69')],{'transaction':_0x2ef814})[_0x302a('0x29')](function(){if(!_[_0x302a('0x86')](_0x5c5f0a)){return _0x462bb9['removeAgents'](_0x5c5f0a,{'transaction':_0x2ef814});}})[_0x302a('0x29')](function(){_0x5c5f0a[_0x302a('0x73')](function(_0x280b6c){socket['emit'](_0x302a('0x87'),{'UserId':_0x280b6c,'OpenchannelQueueId':_0x462bb9['id']});});});});});});})[_0x302a('0x29')](respondWithStatusCode(_0x3ae1b8,null))[_0x302a('0x4d')](handleError(_0x3ae1b8,null));};exports[_0x302a('0x88')]=function(_0x544d83,_0x4941d8,_0x232d8f){return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x544d83['params']['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x4941d8,null))[_0x302a('0x29')](function(_0x1496bf){if(_0x1496bf){return _0x1496bf['addAgents'](_0x544d83[_0x302a('0x4f')][_0x302a('0x69')],_[_0x302a('0x89')](_0x544d83[_0x302a('0x4f')],[_0x302a('0x69'),'id'])||{})[_0x302a('0x8a')](function(_0x21e7f3){for(var _0x2e6f1c=0x0;_0x2e6f1c<_0x544d83[_0x302a('0x4f')][_0x302a('0x69')][_0x302a('0x3d')];_0x2e6f1c+=0x1){socket[_0x302a('0x74')](_0x302a('0x75'),{'UserId':Number(_0x544d83['body'][_0x302a('0x69')][_0x2e6f1c]),'OpenchannelQueueId':Number(_0x544d83[_0x302a('0x4b')]['id'])});}return _0x21e7f3;});}})['then'](respondWithResult(_0x4941d8,null))[_0x302a('0x4d')](handleError(_0x4941d8,null));};exports['removeAgents']=function(_0x45c0c3,_0x1061c2,_0x2aa806){return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x45c0c3[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x1061c2,null))[_0x302a('0x29')](function(_0x20c4d0){if(_0x20c4d0){return _0x20c4d0[_0x302a('0x8b')](_0x45c0c3['query'][_0x302a('0x69')])[_0x302a('0x29')](function(){if(_[_0x302a('0x8c')](_0x45c0c3[_0x302a('0x39')]['ids'])){for(var _0x5d8bfb=0x0;_0x5d8bfb<_0x45c0c3[_0x302a('0x39')]['ids']['length'];_0x5d8bfb+=0x1){socket[_0x302a('0x74')]('userOpenchannelQueue:remove',{'UserId':Number(_0x45c0c3['query'][_0x302a('0x69')][_0x5d8bfb]),'OpenchannelQueueId':Number(_0x45c0c3[_0x302a('0x4b')]['id'])});}}else{socket[_0x302a('0x74')](_0x302a('0x87'),{'UserId':Number(_0x45c0c3['query'][_0x302a('0x69')]),'OpenchannelQueueId':Number(_0x45c0c3['params']['id'])});}});}})[_0x302a('0x29')](respondWithStatusCode(_0x1061c2,null))['catch'](handleError(_0x1061c2,null));};exports['getAgents']=function(_0x3749a4,_0x3948de,_0x16ec75){var _0x52b08c={};var _0x230abf={};var _0x3ed741;var _0x3561e8;return db[_0x302a('0x33')]['findOne']({'where':{'id':_0x3749a4[_0x302a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3948de,null))[_0x302a('0x29')](function(_0x407311){if(_0x407311){_0x3ed741=_0x407311;_0x230abf[_0x302a('0x37')]=_[_0x302a('0x38')](db['User'][_0x302a('0x34')]);_0x230abf['query']=_['keys'](_0x3749a4[_0x302a('0x39')]);_0x230abf['filters']=_[_0x302a('0x3a')](_0x230abf[_0x302a('0x37')],_0x230abf[_0x302a('0x39')]);_0x52b08c[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x230abf[_0x302a('0x37')],qs[_0x302a('0x3c')](_0x3749a4['query'][_0x302a('0x3c')]));_0x52b08c[_0x302a('0x3b')]=_0x52b08c['attributes'][_0x302a('0x3d')]?_0x52b08c[_0x302a('0x3b')]:_0x230abf[_0x302a('0x37')];_0x52b08c[_0x302a('0x3f')]=qs[_0x302a('0x40')](_0x3749a4['query'][_0x302a('0x40')]);_0x52b08c[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x3749a4[_0x302a('0x39')],_0x230abf[_0x302a('0x41')]));if(_0x3749a4[_0x302a('0x39')][_0x302a('0x45')]){_0x52b08c[_0x302a('0x5d')]=_['merge'](_0x52b08c[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x52b08c['attributes'],function(_0x1615c1){var _0x63f593={};_0x63f593[_0x1615c1]={'$like':'%'+_0x3749a4[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x63f593;})});}_0x52b08c=_[_0x302a('0x43')]({},_0x52b08c,_0x3749a4[_0x302a('0x46')]);return _0x3ed741[_0x302a('0x8d')](_0x52b08c);}})['then'](function(_0x464c57){if(_0x464c57){_0x3561e8=_0x464c57[_0x302a('0x3d')];if(!_0x3749a4['query'][_0x302a('0x5c')]('nolimit')){_0x52b08c[_0x302a('0x26')]=qs['limit'](_0x3749a4[_0x302a('0x39')][_0x302a('0x26')]);_0x52b08c['offset']=qs[_0x302a('0x23')](_0x3749a4[_0x302a('0x39')][_0x302a('0x23')]);}return _0x3ed741['getAgents'](_0x52b08c);}})[_0x302a('0x29')](function(_0x507ab){if(_0x507ab){return _0x507ab?{'count':_0x3561e8,'rows':_0x507ab}:null;}})[_0x302a('0x29')](respondWithResult(_0x3948de,null))['catch'](handleError(_0x3948de,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 3f52d6b..4f160ae 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 _0x5ba1=['OpenchannelQueue','setMaxListeners','save','update','emit','events','../../mysqldb'];(function(_0xb863c5,_0x4bdb52){var _0x2a1817=function(_0x1b6e39){while(--_0x1b6e39){_0xb863c5['push'](_0xb863c5['shift']());}};_0x2a1817(++_0x4bdb52);}(_0x5ba1,0x14e));var _0x15ba=function(_0x1fa411,_0x1e2701){_0x1fa411=_0x1fa411-0x0;var _0x4a79a4=_0x5ba1[_0x1fa411];return _0x4a79a4;};'use strict';var EventEmitter=require(_0x15ba('0x0'));var OpenchannelQueue=require(_0x15ba('0x1'))['db'][_0x15ba('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x15ba('0x3')](0x0);var events={'afterCreate':_0x15ba('0x4'),'afterUpdate':_0x15ba('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2b305c){return function(_0x52c8d8,_0x3587d1,_0x28e5ba){OpenchannelQueueEvents[_0x15ba('0x6')](_0x2b305c+':'+_0x52c8d8['id'],_0x52c8d8);OpenchannelQueueEvents['emit'](_0x2b305c,_0x52c8d8);_0x28e5ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xad0d=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x5bf309,_0x4c1c1b){var _0x42a1ed=function(_0x5e7d8a){while(--_0x5e7d8a){_0x5bf309['push'](_0x5bf309['shift']());}};_0x42a1ed(++_0x4c1c1b);}(_0xad0d,0x98));var _0xdad0=function(_0xd78bd0,_0x428c14){_0xd78bd0=_0xd78bd0-0x0;var _0x21cecd=_0xad0d[_0xd78bd0];return _0x21cecd;};'use strict';var EventEmitter=require(_0xdad0('0x0'));var OpenchannelQueue=require(_0xdad0('0x1'))['db'][_0xdad0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdad0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdad0('0x4'),'afterDestroy':_0xdad0('0x5')};function emitEvent(_0x86196d){return function(_0xc34b95,_0x20fc1c,_0x476c25){OpenchannelQueueEvents[_0xdad0('0x6')](_0x86196d+':'+_0xc34b95['id'],_0xc34b95);OpenchannelQueueEvents[_0xdad0('0x6')](_0x86196d,_0xc34b95);_0x476c25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xdad0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ee7f739..ac926c9 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 _0x6fcd=['./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xae2ba4,_0x2fed15){var _0x2b83ac=function(_0x5878a9){while(--_0x5878a9){_0xae2ba4['push'](_0xae2ba4['shift']());}};_0x2b83ac(++_0x2fed15);}(_0x6fcd,0x85));var _0xd6fc=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x6fcd[_0x29d915];return _0x160f86;};'use strict';var _=require(_0xd6fc('0x0'));var util=require(_0xd6fc('0x1'));var logger=require('../../config/logger')(_0xd6fc('0x2'));var moment=require(_0xd6fc('0x3'));var BPromise=require(_0xd6fc('0x4'));var rp=require(_0xd6fc('0x5'));var fs=require('fs');var path=require(_0xd6fc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6fc('0x7'));module[_0xd6fc('0x8')]=function(_0x35d9a7,_0x2ca36b){return _0x35d9a7['define'](_0xd6fc('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aee=['exports','define','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0aee,0xe8));var _0xe0ae=function(_0x41f991,_0x19c930){_0x41f991=_0x41f991-0x0;var _0x5aafaa=_0x0aee[_0x41f991];return _0x5aafaa;};'use strict';var _=require(_0xe0ae('0x0'));var util=require('util');var logger=require(_0xe0ae('0x1'))(_0xe0ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0ae('0x3'));var fs=require('fs');var path=require(_0xe0ae('0x4'));var rimraf=require(_0xe0ae('0x5'));var config=require(_0xe0ae('0x6'));var attributes=require(_0xe0ae('0x7'));module[_0xe0ae('0x8')]=function(_0x16db47,_0x2eca5a){return _0x16db47[_0xe0ae('0x9')]('OpenchannelQueue',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 ec27085..568bd30 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 _0x9cde=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9cde,0x128));var _0xe9cd=function(_0x3babb2,_0x4e832d){_0x3babb2=_0x3babb2-0x0;var _0x43e8fd=_0x9cde[_0x3babb2];return _0x43e8fd;};'use strict';var _=require(_0xe9cd('0x0'));var util=require(_0xe9cd('0x1'));var moment=require(_0xe9cd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9cd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe9cd('0x6'));var client=jayson[_0xe9cd('0x7')][_0xe9cd('0x8')]({'port':0x232a});config['redis']=_[_0xe9cd('0x9')](config['redis'],{'host':_0xe9cd('0xa'),'port':0x18eb});var socket=require(_0xe9cd('0xb'))(new Redis(config[_0xe9cd('0xc')]));require(_0xe9cd('0xd'))[_0xe9cd('0xe')](socket);function respondWithRpcPromise(_0x23e03c,_0x2eb048,_0x4d04ee){return new BPromise(function(_0x352b01,_0x501b7e){return client['request'](_0x23e03c,_0x4d04ee)[_0xe9cd('0xf')](function(_0x2a19bc){logger[_0xe9cd('0x10')](_0xe9cd('0x11'),_0x2eb048,_0xe9cd('0x12'));logger['debug'](_0xe9cd('0x13'),_0x2eb048,_0xe9cd('0x12'),JSON[_0xe9cd('0x14')](_0x2a19bc));if(_0x2a19bc[_0xe9cd('0x15')]){if(_0x2a19bc[_0xe9cd('0x15')][_0xe9cd('0x16')]===0x1f4){logger[_0xe9cd('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x2eb048,_0x2a19bc[_0xe9cd('0x15')][_0xe9cd('0x17')]);return _0x501b7e(_0x2a19bc['error']['message']);}logger[_0xe9cd('0x15')](_0xe9cd('0x11'),_0x2eb048,_0x2a19bc[_0xe9cd('0x15')][_0xe9cd('0x17')]);return _0x352b01(_0x2a19bc[_0xe9cd('0x15')][_0xe9cd('0x17')]);}else{logger[_0xe9cd('0x10')](_0xe9cd('0x11'),_0x2eb048,'request\x20sent');_0x352b01(_0x2a19bc['result'][_0xe9cd('0x17')]);}})[_0xe9cd('0x18')](function(_0x6759a3){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2eb048,_0x6759a3);_0x501b7e(_0x6759a3);});});}exports['GetOpenchannelQueue']=function(_0x570a31){var _0x4527c2=this;return new Promise(function(_0x3af6a4,_0x870c71){return db[_0xe9cd('0x19')][_0xe9cd('0x1a')]({'raw':_0x570a31['options']?_0x570a31[_0xe9cd('0x1b')][_0xe9cd('0x1c')]===undefined?!![]:![]:!![],'where':_0x570a31[_0xe9cd('0x1b')]?_0x570a31[_0xe9cd('0x1b')][_0xe9cd('0x1d')]||null:null,'attributes':_0x570a31['options']?_0x570a31[_0xe9cd('0x1b')][_0xe9cd('0x1e')]||null:null,'limit':_0x570a31[_0xe9cd('0x1b')]?_0x570a31[_0xe9cd('0x1b')][_0xe9cd('0x1f')]||null:null,'include':_0x570a31[_0xe9cd('0x1b')]?_0x570a31['options'][_0xe9cd('0x20')]?_[_0xe9cd('0x21')](_0x570a31[_0xe9cd('0x1b')][_0xe9cd('0x20')],function(_0xffa1f0){return{'model':db[_0xffa1f0[_0xe9cd('0x22')]],'as':_0xffa1f0['as'],'attributes':_0xffa1f0[_0xe9cd('0x1e')],'include':_0xffa1f0[_0xe9cd('0x20')]?_['map'](_0xffa1f0[_0xe9cd('0x20')],function(_0x5da75a){return{'model':db[_0x5da75a[_0xe9cd('0x22')]],'as':_0x5da75a['as'],'attributes':_0x5da75a[_0xe9cd('0x1e')],'include':_0x5da75a[_0xe9cd('0x20')]?_[_0xe9cd('0x21')](_0x5da75a[_0xe9cd('0x20')],function(_0x1cdd7b){return{'model':db[_0x1cdd7b['model']],'as':_0x1cdd7b['as'],'attributes':_0x1cdd7b[_0xe9cd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42b8da){logger[_0xe9cd('0x10')](_0xe9cd('0x23'),_0x570a31);logger[_0xe9cd('0x24')](_0xe9cd('0x23'),_0x570a31,JSON[_0xe9cd('0x14')](_0x42b8da));_0x3af6a4(_0x42b8da);})[_0xe9cd('0x18')](function(_0x2f62c5){logger[_0xe9cd('0x15')](_0xe9cd('0x23'),_0x2f62c5['message'],_0x570a31);_0x870c71(_0x4527c2[_0xe9cd('0x15')](0x1f4,_0x2f62c5['message']));});});};exports[_0xe9cd('0x25')]=function(_0x41bfe0){var _0x561429=this;return new Promise(function(_0x30aec2,_0x3b2572){return db[_0xe9cd('0x19')][_0xe9cd('0x26')]({'raw':_0x41bfe0[_0xe9cd('0x1b')]?_0x41bfe0[_0xe9cd('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x41bfe0[_0xe9cd('0x1b')]?_0x41bfe0[_0xe9cd('0x1b')][_0xe9cd('0x1d')]||null:null,'attributes':_0x41bfe0['options']?_0x41bfe0[_0xe9cd('0x1b')]['attributes']||null:null,'include':_0x41bfe0[_0xe9cd('0x1b')]?_0x41bfe0[_0xe9cd('0x1b')][_0xe9cd('0x20')]?_[_0xe9cd('0x21')](_0x41bfe0['options'][_0xe9cd('0x20')],function(_0xfa7ba){return{'model':db[_0xfa7ba[_0xe9cd('0x22')]],'as':_0xfa7ba['as'],'attributes':_0xfa7ba['attributes'],'include':_0xfa7ba[_0xe9cd('0x20')]?_[_0xe9cd('0x21')](_0xfa7ba[_0xe9cd('0x20')],function(_0xfa5851){return{'model':db[_0xfa5851[_0xe9cd('0x22')]],'as':_0xfa5851['as'],'attributes':_0xfa5851['attributes'],'include':_0xfa5851[_0xe9cd('0x20')]?_['map'](_0xfa5851[_0xe9cd('0x20')],function(_0xbf2ca5){return{'model':db[_0xbf2ca5[_0xe9cd('0x22')]],'as':_0xbf2ca5['as'],'attributes':_0xbf2ca5[_0xe9cd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20818b){logger['info'](_0xe9cd('0x25'),_0x41bfe0);logger[_0xe9cd('0x24')]('ShowOpenchannelQueue',_0x41bfe0,JSON[_0xe9cd('0x14')](_0x20818b));_0x30aec2(_0x20818b);})[_0xe9cd('0x18')](function(_0x13f25f){logger['error']('ShowOpenchannelQueue',_0x13f25f[_0xe9cd('0x17')],_0x41bfe0);_0x3b2572(_0x561429[_0xe9cd('0x15')](0x1f4,_0x13f25f[_0xe9cd('0x17')]));});});}; \ No newline at end of file +var _0xe127=['result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','model','map','ShowOpenchannelQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3f38b0,_0x38ba25){var _0x475fd9=function(_0x4d9ccf){while(--_0x4d9ccf){_0x3f38b0['push'](_0x3f38b0['shift']());}};_0x475fd9(++_0x38ba25);}(_0xe127,0x1e2));var _0x7e12=function(_0x2594d6,_0x5df875){_0x2594d6=_0x2594d6-0x0;var _0x226f3f=_0xe127[_0x2594d6];return _0x226f3f;};'use strict';var _=require('lodash');var util=require(_0x7e12('0x0'));var moment=require(_0x7e12('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e12('0x2'));var fs=require('fs');var Redis=require(_0x7e12('0x3'));var db=require(_0x7e12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e12('0x5'))(_0x7e12('0x6'));var config=require(_0x7e12('0x7'));var jayson=require(_0x7e12('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7e12('0x9')]=_[_0x7e12('0xa')](config['redis'],{'host':_0x7e12('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e12('0x9')]));require(_0x7e12('0xc'))['register'](socket);function respondWithRpcPromise(_0x17ba99,_0x477556,_0x198021){return new BPromise(function(_0x4f01a6,_0x41bee1){return client['request'](_0x17ba99,_0x198021)[_0x7e12('0xd')](function(_0x31ee92){logger[_0x7e12('0xe')](_0x7e12('0xf'),_0x477556,_0x7e12('0x10'));logger[_0x7e12('0x11')](_0x7e12('0x12'),_0x477556,_0x7e12('0x10'),JSON[_0x7e12('0x13')](_0x31ee92));if(_0x31ee92['error']){if(_0x31ee92['error']['code']===0x1f4){logger['error'](_0x7e12('0xf'),_0x477556,_0x31ee92[_0x7e12('0x14')]['message']);return _0x41bee1(_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);}logger[_0x7e12('0x14')](_0x7e12('0xf'),_0x477556,_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);return _0x4f01a6(_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);}else{logger[_0x7e12('0xe')](_0x7e12('0xf'),_0x477556,_0x7e12('0x10'));_0x4f01a6(_0x31ee92[_0x7e12('0x16')]['message']);}})[_0x7e12('0x17')](function(_0xa5c0dd){logger[_0x7e12('0x14')](_0x7e12('0xf'),_0x477556,_0xa5c0dd);_0x41bee1(_0xa5c0dd);});});}exports[_0x7e12('0x18')]=function(_0x2e46c9){var _0x2cd5a8=this;return new Promise(function(_0x38266e,_0x55de45){return db[_0x7e12('0x19')]['findAll']({'raw':_0x2e46c9['options']?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1c')]||null:null,'attributes':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1d')]||null:null,'limit':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1e')]||null:null,'include':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9['options'][_0x7e12('0x1f')]?_['map'](_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1f')],function(_0x2dc8ce){return{'model':db[_0x2dc8ce[_0x7e12('0x20')]],'as':_0x2dc8ce['as'],'attributes':_0x2dc8ce[_0x7e12('0x1d')],'include':_0x2dc8ce['include']?_[_0x7e12('0x21')](_0x2dc8ce[_0x7e12('0x1f')],function(_0x5930e6){return{'model':db[_0x5930e6[_0x7e12('0x20')]],'as':_0x5930e6['as'],'attributes':_0x5930e6['attributes'],'include':_0x5930e6['include']?_[_0x7e12('0x21')](_0x5930e6[_0x7e12('0x1f')],function(_0x4f0c58){return{'model':db[_0x4f0c58[_0x7e12('0x20')]],'as':_0x4f0c58['as'],'attributes':_0x4f0c58[_0x7e12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e12('0xd')](function(_0x3c191e){logger[_0x7e12('0xe')]('GetOpenchannelQueue',_0x2e46c9);logger[_0x7e12('0x11')](_0x7e12('0x18'),_0x2e46c9,JSON[_0x7e12('0x13')](_0x3c191e));_0x38266e(_0x3c191e);})[_0x7e12('0x17')](function(_0x1d59fa){logger[_0x7e12('0x14')]('GetOpenchannelQueue',_0x1d59fa[_0x7e12('0x15')],_0x2e46c9);_0x55de45(_0x2cd5a8['error'](0x1f4,_0x1d59fa[_0x7e12('0x15')]));});});};exports[_0x7e12('0x22')]=function(_0x163b86){var _0x15e789=this;return new Promise(function(_0x38e2b6,_0x127a7c){return db[_0x7e12('0x19')][_0x7e12('0x23')]({'raw':_0x163b86['options']?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'where':_0x163b86[_0x7e12('0x1a')]?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1c')]||null:null,'attributes':_0x163b86['options']?_0x163b86[_0x7e12('0x1a')]['attributes']||null:null,'include':_0x163b86[_0x7e12('0x1a')]?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1f')]?_['map'](_0x163b86['options'][_0x7e12('0x1f')],function(_0x3d858e){return{'model':db[_0x3d858e[_0x7e12('0x20')]],'as':_0x3d858e['as'],'attributes':_0x3d858e[_0x7e12('0x1d')],'include':_0x3d858e[_0x7e12('0x1f')]?_[_0x7e12('0x21')](_0x3d858e[_0x7e12('0x1f')],function(_0x4f6c3d){return{'model':db[_0x4f6c3d[_0x7e12('0x20')]],'as':_0x4f6c3d['as'],'attributes':_0x4f6c3d[_0x7e12('0x1d')],'include':_0x4f6c3d['include']?_[_0x7e12('0x21')](_0x4f6c3d[_0x7e12('0x1f')],function(_0x4289e2){return{'model':db[_0x4289e2[_0x7e12('0x20')]],'as':_0x4289e2['as'],'attributes':_0x4289e2[_0x7e12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e12('0xd')](function(_0xe47e49){logger[_0x7e12('0xe')](_0x7e12('0x22'),_0x163b86);logger[_0x7e12('0x11')]('ShowOpenchannelQueue',_0x163b86,JSON[_0x7e12('0x13')](_0xe47e49));_0x38e2b6(_0xe47e49);})[_0x7e12('0x17')](function(_0x491f26){logger[_0x7e12('0x14')](_0x7e12('0x22'),_0x491f26[_0x7e12('0x15')],_0x163b86);_0x127a7c(_0x15e789[_0x7e12('0x14')](0x1f4,_0x491f26['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 1926af9..34dd1be 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 _0x0f92=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x144e89,_0xe0c6b2){var _0x2e8a45=function(_0x3303e3){while(--_0x3303e3){_0x144e89['push'](_0x144e89['shift']());}};_0x2e8a45(++_0xe0c6b2);}(_0x0f92,0xeb));var _0x20f9=function(_0xdf788f,_0x4ad5a1){_0xdf788f=_0xdf788f-0x0;var _0x2452d5=_0x0f92[_0xdf788f];return _0x2452d5;};'use strict';var OpenchannelQueueEvents=require(_0x20f9('0x0'));var events=[_0x20f9('0x1'),_0x20f9('0x2'),_0x20f9('0x3')];function createListener(_0x4479a7,_0x3f4252){return function(_0x34d6ff){_0x3f4252[_0x20f9('0x4')](_0x4479a7,_0x34d6ff);};}function removeListener(_0x547d83,_0x63f17){return function(){OpenchannelQueueEvents[_0x20f9('0x5')](_0x547d83,_0x63f17);};}exports[_0x20f9('0x6')]=function(_0x5a4ad1){for(var _0x204147=0x0,_0x2ec388=events[_0x20f9('0x7')];_0x204147<_0x2ec388;_0x204147++){var _0x25a4aa=events[_0x204147];var _0x475e80=createListener(_0x20f9('0x8')+_0x25a4aa,_0x5a4ad1);OpenchannelQueueEvents['on'](_0x25a4aa,_0x475e80);}}; \ No newline at end of file +var _0x182f=['length','openchannelQueue:','./openchannelQueue.events','save','update','emit'];(function(_0x93fe3a,_0x52ba4e){var _0x35f7ce=function(_0x259567){while(--_0x259567){_0x93fe3a['push'](_0x93fe3a['shift']());}};_0x35f7ce(++_0x52ba4e);}(_0x182f,0xaa));var _0xf182=function(_0x42f05a,_0x27b3b3){_0x42f05a=_0x42f05a-0x0;var _0x524c2a=_0x182f[_0x42f05a];return _0x524c2a;};'use strict';var OpenchannelQueueEvents=require(_0xf182('0x0'));var events=[_0xf182('0x1'),'remove',_0xf182('0x2')];function createListener(_0x46614c,_0x479119){return function(_0x3375c1){_0x479119[_0xf182('0x3')](_0x46614c,_0x3375c1);};}function removeListener(_0x808f1f,_0x1092b3){return function(){OpenchannelQueueEvents['removeListener'](_0x808f1f,_0x1092b3);};}exports['register']=function(_0x1b7401){for(var _0x23beb7=0x0,_0x5377fd=events[_0xf182('0x4')];_0x23beb7<_0x5377fd;_0x23beb7++){var _0x22e98f=events[_0x23beb7];var _0x5ac689=createListener(_0xf182('0x5')+_0x22e98f,_0x1b7401);OpenchannelQueueEvents['on'](_0x22e98f,_0x5ac689);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 56d645f..e7972aa 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 _0x4e9f=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x2290e0,_0x50493f){var _0x3cc432=function(_0x2407a0){while(--_0x2407a0){_0x2290e0['push'](_0x2290e0['shift']());}};_0x3cc432(++_0x50493f);}(_0x4e9f,0x1ca));var _0xf4e9=function(_0x323a54,_0x133054){_0x323a54=_0x323a54-0x0;var _0x50ac78=_0x4e9f[_0x323a54];return _0x50ac78;};'use strict';var multer=require(_0xf4e9('0x0'));var util=require(_0xf4e9('0x1'));var path=require(_0xf4e9('0x2'));var timeout=require(_0xf4e9('0x3'));var express=require(_0xf4e9('0x4'));var router=express[_0xf4e9('0x5')]();var fs_extra=require(_0xf4e9('0x6'));var auth=require(_0xf4e9('0x7'));var interaction=require(_0xf4e9('0x8'));var config=require(_0xf4e9('0x9'));var controller=require(_0xf4e9('0xa'));router[_0xf4e9('0xb')]('/',auth[_0xf4e9('0xc')](),controller[_0xf4e9('0xd')]);router['get'](_0xf4e9('0xe'),auth[_0xf4e9('0xc')](),controller[_0xf4e9('0xf')]);router[_0xf4e9('0xb')]('/:id',auth[_0xf4e9('0xc')](),controller[_0xf4e9('0x10')]);router[_0xf4e9('0x11')]('/',auth[_0xf4e9('0xc')](),controller[_0xf4e9('0x12')]);router[_0xf4e9('0x13')](_0xf4e9('0x14'),auth[_0xf4e9('0xc')](),controller[_0xf4e9('0x15')]);router[_0xf4e9('0x16')]('/:id',auth[_0xf4e9('0xc')](),controller[_0xf4e9('0x17')]);module[_0xf4e9('0x18')]=router; \ No newline at end of file +var _0xa9f4=['./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x784e31,_0x51f0f1){var _0x221db5=function(_0x18c42c){while(--_0x18c42c){_0x784e31['push'](_0x784e31['shift']());}};_0x221db5(++_0x51f0f1);}(_0xa9f4,0x14d));var _0x4a9f=function(_0x3cfa5a,_0x3f051d){_0x3cfa5a=_0x3cfa5a-0x0;var _0x3c882e=_0xa9f4[_0x3cfa5a];return _0x3c882e;};'use strict';var multer=require('multer');var util=require(_0x4a9f('0x0'));var path=require(_0x4a9f('0x1'));var timeout=require(_0x4a9f('0x2'));var express=require('express');var router=express[_0x4a9f('0x3')]();var fs_extra=require(_0x4a9f('0x4'));var auth=require(_0x4a9f('0x5'));var interaction=require(_0x4a9f('0x6'));var config=require('../../config/environment');var controller=require(_0x4a9f('0x7'));router[_0x4a9f('0x8')]('/',auth[_0x4a9f('0x9')](),controller['index']);router['get'](_0x4a9f('0xa'),auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xb')]);router['get'](_0x4a9f('0xc'),auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xd')]);router[_0x4a9f('0xe')]('/',auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xf')]);router[_0x4a9f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4a9f('0x11')]);router[_0x4a9f('0x12')]('/:id',auth[_0x4a9f('0x9')](),controller['destroy']);module[_0x4a9f('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 043ca5e..7dcf7d0 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 _0xab70=['moment','sequelize','exports','STRING','DATE'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xab70,0x96));var _0x0ab7=function(_0x543cc,_0x2d3555){_0x543cc=_0x543cc-0x0;var _0x173c0a=_0xab70[_0x543cc];return _0x173c0a;};'use strict';var moment=require(_0x0ab7('0x0'));var Sequelize=require(_0x0ab7('0x1'));module[_0x0ab7('0x2')]={'uniqueid':{'type':Sequelize[_0x0ab7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0ab7('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0ab7('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0ab7('0x3')]}}; \ No newline at end of file +var _0x9fc3=['DATE','moment','exports','STRING'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9fc3,0x199));var _0x39fc=function(_0x4d8182,_0x304d9c){_0x4d8182=_0x4d8182-0x0;var _0x10e3ef=_0x9fc3[_0x4d8182];return _0x10e3ef;};'use strict';var moment=require(_0x39fc('0x0'));var Sequelize=require('sequelize');module[_0x39fc('0x1')]={'uniqueid':{'type':Sequelize[_0x39fc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x39fc('0x2')]},'joinAt':{'type':Sequelize[_0x39fc('0x3')]},'leaveAt':{'type':Sequelize[_0x39fc('0x3')]},'acceptAt':{'type':Sequelize[_0x39fc('0x3')]},'exitAt':{'type':Sequelize[_0x39fc('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 61c6d7b..cae768d 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 _0xbdca=['to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbdca,0x12c));var _0xabdc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbdca[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xabdc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabdc('0x1'));var jsonpatch=require(_0xabdc('0x2'));var rp=require(_0xabdc('0x3'));var moment=require(_0xabdc('0x4'));var BPromise=require(_0xabdc('0x5'));var Mustache=require(_0xabdc('0x6'));var util=require(_0xabdc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xabdc('0x8'));var ejs=require(_0xabdc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabdc('0xa'));var toCsv=require(_0xabdc('0x8'));var querystring=require(_0xabdc('0xb'));var Papa=require(_0xabdc('0xc'));var Redis=require(_0xabdc('0xd'));var authService=require(_0xabdc('0xe'));var qs=require(_0xabdc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabdc('0x10'));var logger=require(_0xabdc('0x11'))(_0xabdc('0x12'));var utils=require(_0xabdc('0x13'));var config=require(_0xabdc('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xabdc('0x15'))['db'];function respondWithStatusCode(_0x54f9ca,_0xfdba28){_0xfdba28=_0xfdba28||0xcc;return function(_0x208b97){if(_0x208b97){return _0x54f9ca[_0xabdc('0x16')](_0xfdba28);}return _0x54f9ca[_0xabdc('0x17')](_0xfdba28)[_0xabdc('0x18')]();};}function respondWithResult(_0x4657e1,_0x1bb109){_0x1bb109=_0x1bb109||0xc8;return function(_0xd65e85){if(_0xd65e85){return _0x4657e1['status'](_0x1bb109)[_0xabdc('0x19')](_0xd65e85);}};}function respondWithFilteredResult(_0x22b54b,_0x2347eb){return function(_0xc3a351){if(_0xc3a351){var _0x5df3e2=typeof _0x2347eb[_0xabdc('0x1a')]==='undefined'&&typeof _0x2347eb[_0xabdc('0x1b')]===_0xabdc('0x1c');var _0x528cf3=_0xc3a351[_0xabdc('0x1d')];var _0x1a164b=_0x5df3e2?0x0:_0x2347eb['offset'];var _0xb13572=_0x5df3e2?_0xc3a351[_0xabdc('0x1d')]:_0x2347eb['offset']+_0x2347eb[_0xabdc('0x1b')];var _0x606b68;if(_0xb13572>=_0x528cf3){_0xb13572=_0x528cf3;_0x606b68=0xc8;}else{_0x606b68=0xce;}_0x22b54b['status'](_0x606b68);return _0x22b54b[_0xabdc('0x1e')](_0xabdc('0x1f'),_0x1a164b+'-'+_0xb13572+'/'+_0x528cf3)[_0xabdc('0x19')](_0xc3a351);}return null;};}function patchUpdates(_0x5d992d){return function(_0x3e3c95){try{jsonpatch[_0xabdc('0x20')](_0x3e3c95,_0x5d992d,!![]);}catch(_0x1c84e2){return BPromise[_0xabdc('0x21')](_0x1c84e2);}return _0x3e3c95[_0xabdc('0x22')]();};}function saveUpdates(_0x530db2,_0x34b41b){return function(_0x4cb9c9){if(_0x4cb9c9){return _0x4cb9c9[_0xabdc('0x23')](_0x530db2)[_0xabdc('0x24')](function(_0xd2cdd9){return _0xd2cdd9;});}return null;};}function removeEntity(_0xcb239e,_0x2ea452){return function(_0x8d6ee0){if(_0x8d6ee0){return _0x8d6ee0[_0xabdc('0x25')]()['then'](function(){_0xcb239e[_0xabdc('0x17')](0xcc)[_0xabdc('0x18')]();});}};}function handleEntityNotFound(_0x47940f,_0x5dde31){return function(_0x5256e0){if(!_0x5256e0){_0x47940f['sendStatus'](0x194);}return _0x5256e0;};}function handleError(_0x3cf4f3,_0x235cc9){_0x235cc9=_0x235cc9||0x1f4;return function(_0x373b07){logger[_0xabdc('0x26')](_0x373b07['stack']);if(_0x373b07[_0xabdc('0x27')]){delete _0x373b07['name'];}_0x3cf4f3['status'](_0x235cc9)[_0xabdc('0x28')](_0x373b07);};}exports[_0xabdc('0x29')]=function(_0x478c08,_0x149513){var _0x1dbdee={},_0x2da2cd={},_0x4557ef={'count':0x0,'rows':[]};var _0x227087=_[_0xabdc('0x2a')](db[_0xabdc('0x2b')][_0xabdc('0x2c')],function(_0xba3943){return{'name':_0xba3943[_0xabdc('0x2d')],'type':_0xba3943[_0xabdc('0x2e')][_0xabdc('0x2f')]};});_0x2da2cd[_0xabdc('0x30')]=_[_0xabdc('0x2a')](_0x227087,_0xabdc('0x27'));_0x2da2cd[_0xabdc('0x31')]=_[_0xabdc('0x32')](_0x478c08[_0xabdc('0x31')]);_0x2da2cd[_0xabdc('0x33')]=_[_0xabdc('0x34')](_0x2da2cd[_0xabdc('0x30')],_0x2da2cd[_0xabdc('0x31')]);_0x1dbdee['attributes']=_[_0xabdc('0x34')](_0x2da2cd[_0xabdc('0x30')],qs[_0xabdc('0x35')](_0x478c08[_0xabdc('0x31')][_0xabdc('0x35')]));_0x1dbdee[_0xabdc('0x36')]=_0x1dbdee[_0xabdc('0x36')][_0xabdc('0x37')]?_0x1dbdee[_0xabdc('0x36')]:_0x2da2cd['model'];if(!_0x478c08[_0xabdc('0x31')][_0xabdc('0x38')](_0xabdc('0x39'))){_0x1dbdee['limit']=qs[_0xabdc('0x1b')](_0x478c08[_0xabdc('0x31')]['limit']);_0x1dbdee['offset']=qs[_0xabdc('0x1a')](_0x478c08['query'][_0xabdc('0x1a')]);}_0x1dbdee[_0xabdc('0x3a')]=qs[_0xabdc('0x3b')](_0x478c08[_0xabdc('0x31')][_0xabdc('0x3b')]);_0x1dbdee[_0xabdc('0x3c')]=qs[_0xabdc('0x33')](_[_0xabdc('0x3d')](_0x478c08[_0xabdc('0x31')],_0x2da2cd[_0xabdc('0x33')]),_0x227087);if(_0x478c08['query'][_0xabdc('0x3e')]){_0x1dbdee[_0xabdc('0x3c')]=_['merge'](_0x1dbdee['where'],{'$or':_[_0xabdc('0x2a')](_0x227087,function(_0x5b1b2f){if(_0x5b1b2f[_0xabdc('0x2e')]!==_0xabdc('0x3f')){var _0x27654f={};_0x27654f[_0x5b1b2f[_0xabdc('0x27')]]={'$like':'%'+_0x478c08['query'][_0xabdc('0x3e')]+'%'};return _0x27654f;}})});}_0x1dbdee=_[_0xabdc('0x40')]({},_0x1dbdee,_0x478c08['options']);var _0x14d984={'where':_0x1dbdee[_0xabdc('0x3c')]};return db[_0xabdc('0x2b')][_0xabdc('0x1d')](_0x14d984)[_0xabdc('0x24')](function(_0x528306){_0x4557ef[_0xabdc('0x1d')]=_0x528306;if(_0x478c08['query'][_0xabdc('0x41')]){_0x1dbdee[_0xabdc('0x42')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xabdc('0x43')](_0x1dbdee);})['then'](function(_0x5d8dec){_0x4557ef[_0xabdc('0x44')]=_0x5d8dec;return _0x4557ef;})[_0xabdc('0x24')](respondWithFilteredResult(_0x149513,_0x1dbdee))[_0xabdc('0x45')](handleError(_0x149513,null));};exports[_0xabdc('0x46')]=function(_0x5ad674,_0x2aa1c0){var _0x2d70fb={'raw':!![],'where':{'id':_0x5ad674[_0xabdc('0x47')]['id']}},_0x2354bc={};_0x2354bc['model']=_[_0xabdc('0x32')](db[_0xabdc('0x2b')][_0xabdc('0x2c')]);_0x2354bc[_0xabdc('0x31')]=_[_0xabdc('0x32')](_0x5ad674[_0xabdc('0x31')]);_0x2354bc[_0xabdc('0x33')]=_[_0xabdc('0x34')](_0x2354bc[_0xabdc('0x30')],_0x2354bc[_0xabdc('0x31')]);_0x2d70fb[_0xabdc('0x36')]=_[_0xabdc('0x34')](_0x2354bc[_0xabdc('0x30')],qs[_0xabdc('0x35')](_0x5ad674[_0xabdc('0x31')][_0xabdc('0x35')]));_0x2d70fb[_0xabdc('0x36')]=_0x2d70fb[_0xabdc('0x36')][_0xabdc('0x37')]?_0x2d70fb[_0xabdc('0x36')]:_0x2354bc[_0xabdc('0x30')];if(_0x5ad674['query'][_0xabdc('0x41')]){_0x2d70fb[_0xabdc('0x42')]=[{'all':!![]}];}_0x2d70fb=_[_0xabdc('0x40')]({},_0x2d70fb,_0x5ad674[_0xabdc('0x48')]);return db['OpenchannelQueueReport'][_0xabdc('0x49')](_0x2d70fb)[_0xabdc('0x24')](handleEntityNotFound(_0x2aa1c0,null))[_0xabdc('0x24')](respondWithResult(_0x2aa1c0,null))[_0xabdc('0x45')](handleError(_0x2aa1c0,null));};exports['create']=function(_0x4a5ea6,_0x5dcd01){return db[_0xabdc('0x2b')][_0xabdc('0x4a')](_0x4a5ea6['body'],{})[_0xabdc('0x24')](respondWithResult(_0x5dcd01,0xc9))[_0xabdc('0x45')](handleError(_0x5dcd01,null));};exports[_0xabdc('0x23')]=function(_0x375026,_0x2e3d27){if(_0x375026[_0xabdc('0x4b')]['id']){delete _0x375026[_0xabdc('0x4b')]['id'];}return db[_0xabdc('0x2b')]['find']({'where':{'id':_0x375026[_0xabdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e3d27,null))[_0xabdc('0x24')](saveUpdates(_0x375026['body'],null))[_0xabdc('0x24')](respondWithResult(_0x2e3d27,null))[_0xabdc('0x45')](handleError(_0x2e3d27,null));};exports[_0xabdc('0x25')]=function(_0x478fb5,_0x527540){return db[_0xabdc('0x2b')][_0xabdc('0x49')]({'where':{'id':_0x478fb5[_0xabdc('0x47')]['id']}})[_0xabdc('0x24')](handleEntityNotFound(_0x527540,null))[_0xabdc('0x24')](removeEntity(_0x527540,null))[_0xabdc('0x45')](handleError(_0x527540,null));};exports[_0xabdc('0x4c')]=function(_0x45e199,_0x459824){return db[_0xabdc('0x2b')][_0xabdc('0x4c')]()[_0xabdc('0x24')](respondWithResult(_0x459824,null))['catch'](handleError(_0x459824,null));}; \ No newline at end of file +var _0xad2f=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','json','save','update','then','destroy','sendStatus','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','filters','filter','where','VIRTUAL','merge','OpenchannelQueueReport','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad2f,0x74));var _0xfad2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xad2f[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xfad2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfad2('0x1'));var jsonpatch=require(_0xfad2('0x2'));var rp=require(_0xfad2('0x3'));var moment=require(_0xfad2('0x4'));var BPromise=require(_0xfad2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfad2('0x6'));var sox=require(_0xfad2('0x7'));var csv=require(_0xfad2('0x8'));var ejs=require(_0xfad2('0x9'));var fs=require('fs');var fs_extra=require(_0xfad2('0xa'));var _=require(_0xfad2('0xb'));var squel=require(_0xfad2('0xc'));var crypto=require(_0xfad2('0xd'));var jsforce=require(_0xfad2('0xe'));var deskjs=require(_0xfad2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfad2('0x10'));var Papa=require(_0xfad2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfad2('0x12'));var as=require(_0xfad2('0x13'));var hardwareService=require(_0xfad2('0x14'));var logger=require(_0xfad2('0x15'))('api');var utils=require(_0xfad2('0x16'));var config=require(_0xfad2('0x17'));var licenseUtil=require(_0xfad2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x100bf5,_0x21f0b4){_0x21f0b4=_0x21f0b4||0xcc;return function(_0x1a818){if(_0x1a818){return _0x100bf5['sendStatus'](_0x21f0b4);}return _0x100bf5[_0xfad2('0x19')](_0x21f0b4)[_0xfad2('0x1a')]();};}function respondWithResult(_0x3aa3fd,_0x2f5853){_0x2f5853=_0x2f5853||0xc8;return function(_0x36cd4f){if(_0x36cd4f){return _0x3aa3fd[_0xfad2('0x19')](_0x2f5853)['json'](_0x36cd4f);}};}function respondWithFilteredResult(_0x45d819,_0x4b7cbd){return function(_0x25bdd2){if(_0x25bdd2){var _0x5d600d=typeof _0x4b7cbd['offset']===_0xfad2('0x1b')&&typeof _0x4b7cbd['limit']===_0xfad2('0x1b');var _0x5ec770=_0x25bdd2[_0xfad2('0x1c')];var _0x1236f5=_0x5d600d?0x0:_0x4b7cbd[_0xfad2('0x1d')];var _0x3023c2=_0x5d600d?_0x25bdd2[_0xfad2('0x1c')]:_0x4b7cbd[_0xfad2('0x1d')]+_0x4b7cbd['limit'];var _0x2da79e;if(_0x3023c2>=_0x5ec770){_0x3023c2=_0x5ec770;_0x2da79e=0xc8;}else{_0x2da79e=0xce;}_0x45d819[_0xfad2('0x19')](_0x2da79e);return _0x45d819['set']('Content-Range',_0x1236f5+'-'+_0x3023c2+'/'+_0x5ec770)[_0xfad2('0x1e')](_0x25bdd2);}return null;};}function patchUpdates(_0x27e990){return function(_0x481484){try{jsonpatch['apply'](_0x481484,_0x27e990,!![]);}catch(_0x562de6){return BPromise['reject'](_0x562de6);}return _0x481484[_0xfad2('0x1f')]();};}function saveUpdates(_0x3b6b8f,_0x295638){return function(_0x36571b){if(_0x36571b){return _0x36571b[_0xfad2('0x20')](_0x3b6b8f)[_0xfad2('0x21')](function(_0x386d83){return _0x386d83;});}return null;};}function removeEntity(_0x175c67,_0x3f6da0){return function(_0xa508ff){if(_0xa508ff){return _0xa508ff[_0xfad2('0x22')]()[_0xfad2('0x21')](function(){_0x175c67['status'](0xcc)[_0xfad2('0x1a')]();});}};}function handleEntityNotFound(_0x39bb5a,_0x389aea){return function(_0x5e04f0){if(!_0x5e04f0){_0x39bb5a[_0xfad2('0x23')](0x194);}return _0x5e04f0;};}function handleError(_0x4c2204,_0x32bf09){_0x32bf09=_0x32bf09||0x1f4;return function(_0x56cd75){logger['error'](_0x56cd75['stack']);if(_0x56cd75[_0xfad2('0x24')]){delete _0x56cd75['name'];}_0x4c2204[_0xfad2('0x19')](_0x32bf09)[_0xfad2('0x25')](_0x56cd75);};}exports['index']=function(_0x48b5ac,_0xf6f518){var _0x5e7230={},_0x2644f8={},_0x26e2f9={'count':0x0,'rows':[]};var _0x337b31=_[_0xfad2('0x26')](db['OpenchannelQueueReport'][_0xfad2('0x27')],function(_0x469330){return{'name':_0x469330[_0xfad2('0x28')],'type':_0x469330[_0xfad2('0x29')]['key']};});_0x2644f8[_0xfad2('0x2a')]=_[_0xfad2('0x26')](_0x337b31,'name');_0x2644f8[_0xfad2('0x2b')]=_[_0xfad2('0x2c')](_0x48b5ac[_0xfad2('0x2b')]);_0x2644f8['filters']=_[_0xfad2('0x2d')](_0x2644f8[_0xfad2('0x2a')],_0x2644f8[_0xfad2('0x2b')]);_0x5e7230[_0xfad2('0x2e')]=_['intersection'](_0x2644f8[_0xfad2('0x2a')],qs[_0xfad2('0x2f')](_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x2f')]));_0x5e7230['attributes']=_0x5e7230[_0xfad2('0x2e')][_0xfad2('0x30')]?_0x5e7230[_0xfad2('0x2e')]:_0x2644f8[_0xfad2('0x2a')];if(!_0x48b5ac[_0xfad2('0x2b')]['hasOwnProperty'](_0xfad2('0x31'))){_0x5e7230['limit']=qs[_0xfad2('0x32')](_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x32')]);_0x5e7230[_0xfad2('0x1d')]=qs[_0xfad2('0x1d')](_0x48b5ac['query'][_0xfad2('0x1d')]);}_0x5e7230[_0xfad2('0x33')]=qs['sort'](_0x48b5ac[_0xfad2('0x2b')]['sort']);_0x5e7230['where']=qs[_0xfad2('0x34')](_['pick'](_0x48b5ac[_0xfad2('0x2b')],_0x2644f8['filters']),_0x337b31);if(_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x35')]){_0x5e7230['where']=_['merge'](_0x5e7230[_0xfad2('0x36')],{'$or':_[_0xfad2('0x26')](_0x337b31,function(_0xbc1dec){if(_0xbc1dec[_0xfad2('0x29')]!==_0xfad2('0x37')){var _0x3e5766={};_0x3e5766[_0xbc1dec[_0xfad2('0x24')]]={'$like':'%'+_0x48b5ac[_0xfad2('0x2b')]['filter']+'%'};return _0x3e5766;}})});}_0x5e7230=_[_0xfad2('0x38')]({},_0x5e7230,_0x48b5ac['options']);var _0x1dfe3e={'where':_0x5e7230['where']};return db[_0xfad2('0x39')][_0xfad2('0x1c')](_0x1dfe3e)[_0xfad2('0x21')](function(_0x5aea2e){_0x26e2f9[_0xfad2('0x1c')]=_0x5aea2e;if(_0x48b5ac[_0xfad2('0x2b')]['includeAll']){_0x5e7230[_0xfad2('0x3a')]=[{'all':!![]}];}return db[_0xfad2('0x39')]['findAll'](_0x5e7230);})['then'](function(_0x54a0c7){_0x26e2f9[_0xfad2('0x3b')]=_0x54a0c7;return _0x26e2f9;})[_0xfad2('0x21')](respondWithFilteredResult(_0xf6f518,_0x5e7230))[_0xfad2('0x3c')](handleError(_0xf6f518,null));};exports[_0xfad2('0x3d')]=function(_0x4d3e0f,_0xc932d3){var _0x24b743={'raw':!![],'where':{'id':_0x4d3e0f[_0xfad2('0x3e')]['id']}},_0x3e8076={};_0x3e8076[_0xfad2('0x2a')]=_[_0xfad2('0x2c')](db[_0xfad2('0x39')][_0xfad2('0x27')]);_0x3e8076[_0xfad2('0x2b')]=_['keys'](_0x4d3e0f[_0xfad2('0x2b')]);_0x3e8076['filters']=_[_0xfad2('0x2d')](_0x3e8076['model'],_0x3e8076[_0xfad2('0x2b')]);_0x24b743[_0xfad2('0x2e')]=_['intersection'](_0x3e8076[_0xfad2('0x2a')],qs[_0xfad2('0x2f')](_0x4d3e0f[_0xfad2('0x2b')][_0xfad2('0x2f')]));_0x24b743[_0xfad2('0x2e')]=_0x24b743[_0xfad2('0x2e')][_0xfad2('0x30')]?_0x24b743['attributes']:_0x3e8076[_0xfad2('0x2a')];if(_0x4d3e0f[_0xfad2('0x2b')][_0xfad2('0x3f')]){_0x24b743['include']=[{'all':!![]}];}_0x24b743=_['merge']({},_0x24b743,_0x4d3e0f['options']);return db[_0xfad2('0x39')]['find'](_0x24b743)[_0xfad2('0x21')](handleEntityNotFound(_0xc932d3,null))[_0xfad2('0x21')](respondWithResult(_0xc932d3,null))['catch'](handleError(_0xc932d3,null));};exports[_0xfad2('0x40')]=function(_0x415769,_0x507dbd){return db[_0xfad2('0x39')][_0xfad2('0x40')](_0x415769['body'],{})[_0xfad2('0x21')](respondWithResult(_0x507dbd,0xc9))['catch'](handleError(_0x507dbd,null));};exports[_0xfad2('0x20')]=function(_0x1acced,_0x56f9a1){if(_0x1acced[_0xfad2('0x41')]['id']){delete _0x1acced[_0xfad2('0x41')]['id'];}return db[_0xfad2('0x39')][_0xfad2('0x42')]({'where':{'id':_0x1acced[_0xfad2('0x3e')]['id']}})[_0xfad2('0x21')](handleEntityNotFound(_0x56f9a1,null))['then'](saveUpdates(_0x1acced[_0xfad2('0x41')],null))[_0xfad2('0x21')](respondWithResult(_0x56f9a1,null))[_0xfad2('0x3c')](handleError(_0x56f9a1,null));};exports[_0xfad2('0x22')]=function(_0x22f6d0,_0x2effce){return db[_0xfad2('0x39')][_0xfad2('0x42')]({'where':{'id':_0x22f6d0[_0xfad2('0x3e')]['id']}})[_0xfad2('0x21')](handleEntityNotFound(_0x2effce,null))[_0xfad2('0x21')](removeEntity(_0x2effce,null))[_0xfad2('0x3c')](handleError(_0x2effce,null));};exports[_0xfad2('0x43')]=function(_0x5dd3d0,_0x36cad2){return db[_0xfad2('0x39')]['describe']()[_0xfad2('0x21')](respondWithResult(_0x36cad2,null))[_0xfad2('0x3c')](handleError(_0x36cad2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index aeda7a3..6a35c34 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x213243,_0x23bf0a){var _0x4a9e57=function(_0x3549f1){while(--_0x3549f1){_0x213243['push'](_0x213243['shift']());}};_0x4a9e57(++_0x23bf0a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x3e7775,_0x325b15){var _0x4ba57a=function(_0x3c2ca1){while(--_0x3c2ca1){_0x3e7775['push'](_0x3e7775['shift']());}};_0x4ba57a(++_0x325b15);}(_0x326f,0xd1));var _0xf326=function(_0x268f1a,_0x1721ef){_0x268f1a=_0x268f1a-0x0;var _0x20f2db=_0x326f[_0x268f1a];return _0x20f2db;};'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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 322036c..0be4b74 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 _0x3266=['message','body','options','raw','catch','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3266,0x6a));var _0x6326=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x3266[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14208e,_0x5402e5,_0x161f4e){return new BPromise(function(_0x5730e7,_0x2af571){return client[_0x6326('0xc')](_0x14208e,_0x161f4e)[_0x6326('0xd')](function(_0x1aee60){logger[_0x6326('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5402e5,_0x6326('0xf'));logger[_0x6326('0x10')](_0x6326('0x11'),_0x5402e5,_0x6326('0xf'),JSON[_0x6326('0x12')](_0x1aee60));if(_0x1aee60[_0x6326('0x13')]){if(_0x1aee60[_0x6326('0x13')][_0x6326('0x14')]===0x1f4){logger[_0x6326('0x13')](_0x6326('0x15'),_0x5402e5,_0x1aee60['error']['message']);return _0x2af571(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}logger['error'](_0x6326('0x15'),_0x5402e5,_0x1aee60['error'][_0x6326('0x16')]);return _0x5730e7(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}else{logger[_0x6326('0xe')](_0x6326('0x15'),_0x5402e5,_0x6326('0xf'));_0x5730e7(_0x1aee60['result'][_0x6326('0x16')]);}})['catch'](function(_0x5945ee){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5402e5,_0x5945ee);_0x2af571(_0x5945ee);});});}exports['CreateOpenchannelQueueReport']=function(_0x58e960){var _0xdf5ced=this;return new Promise(function(_0x1f4c11,_0x2be78e){return db['OpenchannelQueueReport']['create'](_0x58e960[_0x6326('0x17')],{'raw':_0x58e960[_0x6326('0x18')]?_0x58e960[_0x6326('0x18')][_0x6326('0x19')]===undefined?!![]:![]:!![]})[_0x6326('0xd')](function(_0x25957a){logger[_0x6326('0xe')]('CreateOpenchannelQueueReport',_0x58e960);logger[_0x6326('0x10')]('CreateOpenchannelQueueReport',_0x58e960,JSON[_0x6326('0x12')](_0x25957a));_0x1f4c11(_0x25957a);})[_0x6326('0x1a')](function(_0x2482ef){logger[_0x6326('0x13')](_0x6326('0x1b'),_0x2482ef[_0x6326('0x16')],_0x58e960);_0x2be78e(_0xdf5ced[_0x6326('0x13')](0x1f4,_0x2482ef[_0x6326('0x16')]));});});};exports[_0x6326('0x1c')]=function(_0x2d0d00){var _0x34954b=this;return new Promise(function(_0x4933e1,_0x72d020){return db[_0x6326('0x1d')]['update'](_0x2d0d00['body'],{'raw':_0x2d0d00['options']?_0x2d0d00[_0x6326('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')]['where']||null:null,'attributes':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')][_0x6326('0x1e')]||null:null,'limit':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')][_0x6326('0x1f')]||null:null})[_0x6326('0xd')](function(_0x27802c){logger[_0x6326('0xe')](_0x6326('0x1c'),_0x2d0d00);logger[_0x6326('0x10')](_0x6326('0x1c'),_0x2d0d00,JSON[_0x6326('0x12')](_0x27802c));_0x4933e1(_0x27802c);})[_0x6326('0x1a')](function(_0x2e0445){logger[_0x6326('0x13')]('UpdateOpenchannelQueueReport',_0x2e0445[_0x6326('0x16')],_0x2d0d00);_0x72d020(_0x34954b[_0x6326('0x13')](0x1f4,_0x2e0445[_0x6326('0x16')]));});});}; \ No newline at end of file +var _0x1a85=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','update','where','attributes','limit','UpdateOpenchannelQueueReport','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x1a85,0x178));var _0x51a8=function(_0x2f89c0,_0x455702){_0x2f89c0=_0x2f89c0-0x0;var _0x164223=_0x1a85[_0x2f89c0];return _0x164223;};'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')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['create'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![]})[_0x51a8('0x18')](function(_0x3bc044){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger['debug'](_0x51a8('0x13'),_0x45a433,JSON['stringify'](_0x3bc044));_0x23539e(_0x3bc044);})[_0x51a8('0x12')](function(_0x12c029){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x12c029['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x12c029['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x23d26a){var _0x52e503=this;return new Promise(function(_0x384d25,_0x78d3d6){return db[_0x51a8('0x14')][_0x51a8('0x19')](_0x23d26a[_0x51a8('0x15')],{'raw':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d26a['options']?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1a')]||null:null,'attributes':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1b')]||null:null,'limit':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1c')]||null:null})[_0x51a8('0x18')](function(_0x4b5cda){logger[_0x51a8('0x8')](_0x51a8('0x1d'),_0x23d26a);logger['debug'](_0x51a8('0x1d'),_0x23d26a,JSON['stringify'](_0x4b5cda));_0x384d25(_0x4b5cda);})[_0x51a8('0x12')](function(_0x3bc19a){logger[_0x51a8('0xe')](_0x51a8('0x1d'),_0x3bc19a[_0x51a8('0x10')],_0x23d26a);_0x78d3d6(_0x52e503['error'](0x1f4,_0x3bc19a[_0x51a8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 56d173a..49ed931 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 _0x507d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0xf15d51,_0x142941){var _0x36a05b=function(_0x5c6895){while(--_0x5c6895){_0xf15d51['push'](_0xf15d51['shift']());}};_0x36a05b(++_0x142941);}(_0x507d,0x1c9));var _0xd507=function(_0x14c1d0,_0x1e2ddf){_0x14c1d0=_0x14c1d0-0x0;var _0x7bf344=_0x507d[_0x14c1d0];return _0x7bf344;};'use strict';var multer=require(_0xd507('0x0'));var util=require(_0xd507('0x1'));var path=require('path');var timeout=require(_0xd507('0x2'));var express=require(_0xd507('0x3'));var router=express[_0xd507('0x4')]();var fs_extra=require(_0xd507('0x5'));var auth=require(_0xd507('0x6'));var interaction=require(_0xd507('0x7'));var config=require(_0xd507('0x8'));var controller=require(_0xd507('0x9'));router[_0xd507('0xa')]('/',auth[_0xd507('0xb')](),controller['index']);router[_0xd507('0xa')](_0xd507('0xc'),auth[_0xd507('0xb')](),controller['describe']);router[_0xd507('0xa')](_0xd507('0xd'),auth[_0xd507('0xb')](),controller[_0xd507('0xe')]);router['post']('/',auth[_0xd507('0xb')](),controller['create']);router[_0xd507('0xf')](_0xd507('0xd'),auth[_0xd507('0xb')](),controller[_0xd507('0x10')]);router[_0xd507('0x11')](_0xd507('0xd'),auth[_0xd507('0xb')](),controller[_0xd507('0x12')]);module[_0xd507('0x13')]=router; \ No newline at end of file +var _0x7895=['isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x23e203,_0x4f3489){var _0x119c69=function(_0x50b54d){while(--_0x50b54d){_0x23e203['push'](_0x23e203['shift']());}};_0x119c69(++_0x4f3489);}(_0x7895,0x128));var _0x5789=function(_0x1f7b2,_0x323a69){_0x1f7b2=_0x1f7b2-0x0;var _0x5ef4e1=_0x7895[_0x1f7b2];return _0x5ef4e1;};'use strict';var multer=require('multer');var util=require(_0x5789('0x0'));var path=require('path');var timeout=require(_0x5789('0x1'));var express=require(_0x5789('0x2'));var router=express[_0x5789('0x3')]();var fs_extra=require(_0x5789('0x4'));var auth=require(_0x5789('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5789('0x6'));var controller=require(_0x5789('0x7'));router['get']('/',auth[_0x5789('0x8')](),controller[_0x5789('0x9')]);router['get']('/describe',auth[_0x5789('0x8')](),controller['describe']);router[_0x5789('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5789('0xb')]('/',auth[_0x5789('0x8')](),controller[_0x5789('0xc')]);router[_0x5789('0xd')](_0x5789('0xe'),auth[_0x5789('0x8')](),controller[_0x5789('0xf')]);router[_0x5789('0x10')](_0x5789('0xe'),auth[_0x5789('0x8')](),controller[_0x5789('0x11')]);module[_0x5789('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index cb7b41b..7d37ee2 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x591660,_0xe57a8e){var _0x336609=function(_0x2879b5){while(--_0x2879b5){_0x591660['push'](_0x591660['shift']());}};_0x336609(++_0xe57a8e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x584308,_0x1379b3){_0x584308=_0x584308-0x0;var _0x45865b=_0xf3cd[_0x584308];return _0x45865b;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a16f965..1d63f85 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 _0x4a2c=['filter','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','show','rawAttributes','find','catch','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','map','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','type','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a2c,0x181));var _0xc4a2=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x4a2c[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0xc4a2('0x0'));var rimraf=require(_0xc4a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4a2('0x2'));var rp=require(_0xc4a2('0x3'));var moment=require(_0xc4a2('0x4'));var BPromise=require(_0xc4a2('0x5'));var Mustache=require(_0xc4a2('0x6'));var util=require(_0xc4a2('0x7'));var path=require(_0xc4a2('0x8'));var sox=require(_0xc4a2('0x9'));var csv=require(_0xc4a2('0xa'));var ejs=require(_0xc4a2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4a2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4a2('0xd'));var toCsv=require(_0xc4a2('0xa'));var querystring=require(_0xc4a2('0xe'));var Papa=require(_0xc4a2('0xf'));var Redis=require(_0xc4a2('0x10'));var authService=require(_0xc4a2('0x11'));var qs=require(_0xc4a2('0x12'));var as=require(_0xc4a2('0x13'));var hardwareService=require(_0xc4a2('0x14'));var logger=require(_0xc4a2('0x15'))(_0xc4a2('0x16'));var utils=require(_0xc4a2('0x17'));var config=require(_0xc4a2('0x18'));var licenseUtil=require(_0xc4a2('0x19'));var db=require(_0xc4a2('0x1a'))['db'];function respondWithStatusCode(_0xd30228,_0x1db3b3){_0x1db3b3=_0x1db3b3||0xcc;return function(_0x34764a){if(_0x34764a){return _0xd30228[_0xc4a2('0x1b')](_0x1db3b3);}return _0xd30228[_0xc4a2('0x1c')](_0x1db3b3)[_0xc4a2('0x1d')]();};}function respondWithResult(_0x689877,_0x5bb75d){_0x5bb75d=_0x5bb75d||0xc8;return function(_0x2ac3f0){if(_0x2ac3f0){return _0x689877[_0xc4a2('0x1c')](_0x5bb75d)[_0xc4a2('0x1e')](_0x2ac3f0);}};}function respondWithFilteredResult(_0xc1017d,_0x551947){return function(_0x318878){if(_0x318878){var _0x573548=typeof _0x551947[_0xc4a2('0x1f')]===_0xc4a2('0x20')&&typeof _0x551947['limit']===_0xc4a2('0x20');var _0x31decf=_0x318878[_0xc4a2('0x21')];var _0x1f29ec=_0x573548?0x0:_0x551947[_0xc4a2('0x1f')];var _0x454772=_0x573548?_0x318878[_0xc4a2('0x21')]:_0x551947['offset']+_0x551947['limit'];var _0x59f18e;if(_0x454772>=_0x31decf){_0x454772=_0x31decf;_0x59f18e=0xc8;}else{_0x59f18e=0xce;}_0xc1017d[_0xc4a2('0x1c')](_0x59f18e);return _0xc1017d[_0xc4a2('0x22')](_0xc4a2('0x23'),_0x1f29ec+'-'+_0x454772+'/'+_0x31decf)[_0xc4a2('0x1e')](_0x318878);}return null;};}function patchUpdates(_0x115549){return function(_0x5167f8){try{jsonpatch[_0xc4a2('0x24')](_0x5167f8,_0x115549,!![]);}catch(_0x375e7d){return BPromise[_0xc4a2('0x25')](_0x375e7d);}return _0x5167f8['save']();};}function saveUpdates(_0x11d6e2,_0x4b55f0){return function(_0x2a715e){if(_0x2a715e){return _0x2a715e['update'](_0x11d6e2)[_0xc4a2('0x26')](function(_0x396430){return _0x396430;});}return null;};}function removeEntity(_0x4387ce,_0x422db6){return function(_0x352354){if(_0x352354){return _0x352354[_0xc4a2('0x27')]()[_0xc4a2('0x26')](function(){_0x4387ce['status'](0xcc)[_0xc4a2('0x1d')]();});}};}function handleEntityNotFound(_0x20d371,_0x5c4a92){return function(_0x57bd91){if(!_0x57bd91){_0x20d371[_0xc4a2('0x1b')](0x194);}return _0x57bd91;};}function handleError(_0x5ac578,_0x1bcb01){_0x1bcb01=_0x1bcb01||0x1f4;return function(_0x103eef){logger[_0xc4a2('0x28')](_0x103eef['stack']);if(_0x103eef[_0xc4a2('0x29')]){delete _0x103eef[_0xc4a2('0x29')];}_0x5ac578[_0xc4a2('0x1c')](_0x1bcb01)['send'](_0x103eef);};}exports['index']=function(_0x3d0d4b,_0x25431c){var _0x454db9={},_0x5d0933={},_0x3d6e13={'count':0x0,'rows':[]};var _0x768d9c=_[_0xc4a2('0x2a')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x80f2c0){return{'name':_0x80f2c0['fieldName'],'type':_0x80f2c0['type']['key']};});_0x5d0933[_0xc4a2('0x2b')]=_['map'](_0x768d9c,'name');_0x5d0933[_0xc4a2('0x2c')]=_[_0xc4a2('0x2d')](_0x3d0d4b[_0xc4a2('0x2c')]);_0x5d0933[_0xc4a2('0x2e')]=_[_0xc4a2('0x2f')](_0x5d0933[_0xc4a2('0x2b')],_0x5d0933[_0xc4a2('0x2c')]);_0x454db9[_0xc4a2('0x30')]=_['intersection'](_0x5d0933[_0xc4a2('0x2b')],qs[_0xc4a2('0x31')](_0x3d0d4b['query']['fields']));_0x454db9['attributes']=_0x454db9['attributes'][_0xc4a2('0x32')]?_0x454db9[_0xc4a2('0x30')]:_0x5d0933[_0xc4a2('0x2b')];if(!_0x3d0d4b[_0xc4a2('0x2c')]['hasOwnProperty'](_0xc4a2('0x33'))){_0x454db9[_0xc4a2('0x34')]=qs['limit'](_0x3d0d4b['query']['limit']);_0x454db9[_0xc4a2('0x1f')]=qs[_0xc4a2('0x1f')](_0x3d0d4b['query'][_0xc4a2('0x1f')]);}_0x454db9[_0xc4a2('0x35')]=qs[_0xc4a2('0x36')](_0x3d0d4b['query'][_0xc4a2('0x36')]);_0x454db9[_0xc4a2('0x37')]=qs[_0xc4a2('0x2e')](_[_0xc4a2('0x38')](_0x3d0d4b['query'],_0x5d0933[_0xc4a2('0x2e')]),_0x768d9c);if(_0x3d0d4b[_0xc4a2('0x2c')]['filter']){_0x454db9[_0xc4a2('0x37')]=_['merge'](_0x454db9[_0xc4a2('0x37')],{'$or':_[_0xc4a2('0x2a')](_0x768d9c,function(_0x4ce6b4){if(_0x4ce6b4[_0xc4a2('0x39')]!==_0xc4a2('0x3a')){var _0x37bdbc={};_0x37bdbc[_0x4ce6b4[_0xc4a2('0x29')]]={'$like':'%'+_0x3d0d4b['query'][_0xc4a2('0x3b')]+'%'};return _0x37bdbc;}})});}_0x454db9=_[_0xc4a2('0x3c')]({},_0x454db9,_0x3d0d4b[_0xc4a2('0x3d')]);var _0x33251c={'where':_0x454db9[_0xc4a2('0x37')]};return db[_0xc4a2('0x3e')]['count'](_0x33251c)[_0xc4a2('0x26')](function(_0x5be8d4){_0x3d6e13[_0xc4a2('0x21')]=_0x5be8d4;if(_0x3d0d4b['query'][_0xc4a2('0x3f')]){_0x454db9[_0xc4a2('0x40')]=[{'all':!![]}];}return db[_0xc4a2('0x3e')][_0xc4a2('0x41')](_0x454db9);})['then'](function(_0x21ff9a){_0x3d6e13[_0xc4a2('0x42')]=_0x21ff9a;return _0x3d6e13;})[_0xc4a2('0x26')](respondWithFilteredResult(_0x25431c,_0x454db9))['catch'](handleError(_0x25431c,null));};exports[_0xc4a2('0x43')]=function(_0x1aa037,_0x1df6ec){var _0x7f9692={'raw':!![],'where':{'id':_0x1aa037['params']['id']}},_0xe71580={};_0xe71580[_0xc4a2('0x2b')]=_['keys'](db[_0xc4a2('0x3e')][_0xc4a2('0x44')]);_0xe71580[_0xc4a2('0x2c')]=_[_0xc4a2('0x2d')](_0x1aa037['query']);_0xe71580[_0xc4a2('0x2e')]=_['intersection'](_0xe71580[_0xc4a2('0x2b')],_0xe71580[_0xc4a2('0x2c')]);_0x7f9692[_0xc4a2('0x30')]=_[_0xc4a2('0x2f')](_0xe71580[_0xc4a2('0x2b')],qs['fields'](_0x1aa037[_0xc4a2('0x2c')][_0xc4a2('0x31')]));_0x7f9692['attributes']=_0x7f9692['attributes'][_0xc4a2('0x32')]?_0x7f9692[_0xc4a2('0x30')]:_0xe71580['model'];if(_0x1aa037['query'][_0xc4a2('0x3f')]){_0x7f9692[_0xc4a2('0x40')]=[{'all':!![]}];}_0x7f9692=_['merge']({},_0x7f9692,_0x1aa037[_0xc4a2('0x3d')]);return db[_0xc4a2('0x3e')][_0xc4a2('0x45')](_0x7f9692)[_0xc4a2('0x26')](handleEntityNotFound(_0x1df6ec,null))[_0xc4a2('0x26')](respondWithResult(_0x1df6ec,null))[_0xc4a2('0x46')](handleError(_0x1df6ec,null));};exports['create']=function(_0x54a913,_0x222291){return db[_0xc4a2('0x3e')]['create'](_0x54a913[_0xc4a2('0x47')],{})[_0xc4a2('0x26')](respondWithResult(_0x222291,0xc9))[_0xc4a2('0x46')](handleError(_0x222291,null));};exports[_0xc4a2('0x48')]=function(_0x2af6a1,_0x193d0c){if(_0x2af6a1[_0xc4a2('0x47')]['id']){delete _0x2af6a1[_0xc4a2('0x47')]['id'];}return db[_0xc4a2('0x3e')][_0xc4a2('0x45')]({'where':{'id':_0x2af6a1['params']['id']}})['then'](handleEntityNotFound(_0x193d0c,null))['then'](saveUpdates(_0x2af6a1[_0xc4a2('0x47')],null))['then'](respondWithResult(_0x193d0c,null))[_0xc4a2('0x46')](handleError(_0x193d0c,null));};exports[_0xc4a2('0x27')]=function(_0x1b807b,_0x109fdc){return db['OpenchannelTransferReport'][_0xc4a2('0x45')]({'where':{'id':_0x1b807b['params']['id']}})[_0xc4a2('0x26')](handleEntityNotFound(_0x109fdc,null))['then'](removeEntity(_0x109fdc,null))['catch'](handleError(_0x109fdc,null));};exports[_0xc4a2('0x49')]=function(_0x572a41,_0x156d1c){return db[_0xc4a2('0x3e')][_0xc4a2('0x49')]()[_0xc4a2('0x26')](respondWithResult(_0x156d1c,null))[_0xc4a2('0x46')](handleError(_0x156d1c,null));}; \ No newline at end of file +var _0x861c=['keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','undefined','count','offset','limit','apply','reject','save','then','destroy','status','end','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x861c,0x9e));var _0xc861=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x861c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xc861('0x0'));var rimraf=require(_0xc861('0x1'));var zipdir=require(_0xc861('0x2'));var jsonpatch=require(_0xc861('0x3'));var rp=require(_0xc861('0x4'));var moment=require('moment');var BPromise=require(_0xc861('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc861('0x6'));var csv=require(_0xc861('0x7'));var ejs=require(_0xc861('0x8'));var fs=require('fs');var fs_extra=require(_0xc861('0x9'));var _=require(_0xc861('0xa'));var squel=require('squel');var crypto=require(_0xc861('0xb'));var jsforce=require(_0xc861('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc861('0x7'));var querystring=require(_0xc861('0xd'));var Papa=require('papaparse');var Redis=require(_0xc861('0xe'));var authService=require(_0xc861('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc861('0x10'));var utils=require(_0xc861('0x11'));var config=require(_0xc861('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc861('0x13'))['db'];function respondWithStatusCode(_0x190943,_0x35afdf){_0x35afdf=_0x35afdf||0xcc;return function(_0x4a321b){if(_0x4a321b){return _0x190943[_0xc861('0x14')](_0x35afdf);}return _0x190943['status'](_0x35afdf)['end']();};}function respondWithResult(_0x28ea7a,_0x4a37d0){_0x4a37d0=_0x4a37d0||0xc8;return function(_0x5613e1){if(_0x5613e1){return _0x28ea7a['status'](_0x4a37d0)[_0xc861('0x15')](_0x5613e1);}};}function respondWithFilteredResult(_0x1fa736,_0x1703d5){return function(_0x2801e4){if(_0x2801e4){var _0x36607e=typeof _0x1703d5['offset']===_0xc861('0x16')&&typeof _0x1703d5['limit']===_0xc861('0x16');var _0x12ab23=_0x2801e4[_0xc861('0x17')];var _0x190753=_0x36607e?0x0:_0x1703d5[_0xc861('0x18')];var _0x374f29=_0x36607e?_0x2801e4[_0xc861('0x17')]:_0x1703d5[_0xc861('0x18')]+_0x1703d5[_0xc861('0x19')];var _0x1043e4;if(_0x374f29>=_0x12ab23){_0x374f29=_0x12ab23;_0x1043e4=0xc8;}else{_0x1043e4=0xce;}_0x1fa736['status'](_0x1043e4);return _0x1fa736['set']('Content-Range',_0x190753+'-'+_0x374f29+'/'+_0x12ab23)[_0xc861('0x15')](_0x2801e4);}return null;};}function patchUpdates(_0x5af059){return function(_0x5095b9){try{jsonpatch[_0xc861('0x1a')](_0x5095b9,_0x5af059,!![]);}catch(_0x4d9dc2){return BPromise[_0xc861('0x1b')](_0x4d9dc2);}return _0x5095b9[_0xc861('0x1c')]();};}function saveUpdates(_0x237f37,_0x391760){return function(_0x1c70f2){if(_0x1c70f2){return _0x1c70f2['update'](_0x237f37)[_0xc861('0x1d')](function(_0x36050c){return _0x36050c;});}return null;};}function removeEntity(_0x4653d9,_0xe46a88){return function(_0x20a343){if(_0x20a343){return _0x20a343[_0xc861('0x1e')]()[_0xc861('0x1d')](function(){_0x4653d9[_0xc861('0x1f')](0xcc)[_0xc861('0x20')]();});}};}function handleEntityNotFound(_0x1cae60,_0x1179b5){return function(_0x2f0723){if(!_0x2f0723){_0x1cae60[_0xc861('0x14')](0x194);}return _0x2f0723;};}function handleError(_0x5bab44,_0x20a35f){_0x20a35f=_0x20a35f||0x1f4;return function(_0x3f70a7){logger['error'](_0x3f70a7['stack']);if(_0x3f70a7['name']){delete _0x3f70a7[_0xc861('0x21')];}_0x5bab44[_0xc861('0x1f')](_0x20a35f)['send'](_0x3f70a7);};}exports[_0xc861('0x22')]=function(_0x2a1176,_0x3926b5){var _0x26df8e={},_0x6dacf3={},_0x233623={'count':0x0,'rows':[]};var _0x185e38=_[_0xc861('0x23')](db[_0xc861('0x24')][_0xc861('0x25')],function(_0x3788c5){return{'name':_0x3788c5[_0xc861('0x26')],'type':_0x3788c5[_0xc861('0x27')][_0xc861('0x28')]};});_0x6dacf3[_0xc861('0x29')]=_['map'](_0x185e38,_0xc861('0x21'));_0x6dacf3[_0xc861('0x2a')]=_[_0xc861('0x2b')](_0x2a1176['query']);_0x6dacf3[_0xc861('0x2c')]=_['intersection'](_0x6dacf3['model'],_0x6dacf3[_0xc861('0x2a')]);_0x26df8e[_0xc861('0x2d')]=_[_0xc861('0x2e')](_0x6dacf3[_0xc861('0x29')],qs[_0xc861('0x2f')](_0x2a1176['query'][_0xc861('0x2f')]));_0x26df8e[_0xc861('0x2d')]=_0x26df8e[_0xc861('0x2d')][_0xc861('0x30')]?_0x26df8e['attributes']:_0x6dacf3[_0xc861('0x29')];if(!_0x2a1176[_0xc861('0x2a')]['hasOwnProperty']('nolimit')){_0x26df8e[_0xc861('0x19')]=qs[_0xc861('0x19')](_0x2a1176[_0xc861('0x2a')][_0xc861('0x19')]);_0x26df8e[_0xc861('0x18')]=qs[_0xc861('0x18')](_0x2a1176[_0xc861('0x2a')][_0xc861('0x18')]);}_0x26df8e[_0xc861('0x31')]=qs[_0xc861('0x32')](_0x2a1176['query'][_0xc861('0x32')]);_0x26df8e[_0xc861('0x33')]=qs[_0xc861('0x2c')](_[_0xc861('0x34')](_0x2a1176[_0xc861('0x2a')],_0x6dacf3[_0xc861('0x2c')]),_0x185e38);if(_0x2a1176['query'][_0xc861('0x35')]){_0x26df8e[_0xc861('0x33')]=_[_0xc861('0x36')](_0x26df8e[_0xc861('0x33')],{'$or':_[_0xc861('0x23')](_0x185e38,function(_0x29eb49){if(_0x29eb49[_0xc861('0x27')]!==_0xc861('0x37')){var _0x3e63e0={};_0x3e63e0[_0x29eb49[_0xc861('0x21')]]={'$like':'%'+_0x2a1176[_0xc861('0x2a')]['filter']+'%'};return _0x3e63e0;}})});}_0x26df8e=_[_0xc861('0x36')]({},_0x26df8e,_0x2a1176[_0xc861('0x38')]);var _0x1ce83f={'where':_0x26df8e[_0xc861('0x33')]};return db['OpenchannelTransferReport']['count'](_0x1ce83f)[_0xc861('0x1d')](function(_0x37ba06){_0x233623[_0xc861('0x17')]=_0x37ba06;if(_0x2a1176['query'][_0xc861('0x39')]){_0x26df8e[_0xc861('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc861('0x3b')](_0x26df8e);})['then'](function(_0x38a2db){_0x233623[_0xc861('0x3c')]=_0x38a2db;return _0x233623;})[_0xc861('0x1d')](respondWithFilteredResult(_0x3926b5,_0x26df8e))[_0xc861('0x3d')](handleError(_0x3926b5,null));};exports['show']=function(_0x25cf5f,_0x19ee7e){var _0x206596={'raw':!![],'where':{'id':_0x25cf5f[_0xc861('0x3e')]['id']}},_0x68e929={};_0x68e929[_0xc861('0x29')]=_[_0xc861('0x2b')](db[_0xc861('0x24')][_0xc861('0x25')]);_0x68e929['query']=_[_0xc861('0x2b')](_0x25cf5f[_0xc861('0x2a')]);_0x68e929[_0xc861('0x2c')]=_[_0xc861('0x2e')](_0x68e929['model'],_0x68e929[_0xc861('0x2a')]);_0x206596[_0xc861('0x2d')]=_[_0xc861('0x2e')](_0x68e929['model'],qs[_0xc861('0x2f')](_0x25cf5f[_0xc861('0x2a')][_0xc861('0x2f')]));_0x206596[_0xc861('0x2d')]=_0x206596['attributes'][_0xc861('0x30')]?_0x206596[_0xc861('0x2d')]:_0x68e929[_0xc861('0x29')];if(_0x25cf5f[_0xc861('0x2a')][_0xc861('0x39')]){_0x206596[_0xc861('0x3a')]=[{'all':!![]}];}_0x206596=_[_0xc861('0x36')]({},_0x206596,_0x25cf5f[_0xc861('0x38')]);return db[_0xc861('0x24')]['find'](_0x206596)[_0xc861('0x1d')](handleEntityNotFound(_0x19ee7e,null))[_0xc861('0x1d')](respondWithResult(_0x19ee7e,null))['catch'](handleError(_0x19ee7e,null));};exports[_0xc861('0x3f')]=function(_0x2e7fa7,_0x1ff73a){return db[_0xc861('0x24')][_0xc861('0x3f')](_0x2e7fa7[_0xc861('0x40')],{})['then'](respondWithResult(_0x1ff73a,0xc9))[_0xc861('0x3d')](handleError(_0x1ff73a,null));};exports[_0xc861('0x41')]=function(_0x8fb8d0,_0x3cdc77){if(_0x8fb8d0[_0xc861('0x40')]['id']){delete _0x8fb8d0[_0xc861('0x40')]['id'];}return db[_0xc861('0x24')][_0xc861('0x42')]({'where':{'id':_0x8fb8d0[_0xc861('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3cdc77,null))[_0xc861('0x1d')](saveUpdates(_0x8fb8d0[_0xc861('0x40')],null))[_0xc861('0x1d')](respondWithResult(_0x3cdc77,null))[_0xc861('0x3d')](handleError(_0x3cdc77,null));};exports[_0xc861('0x1e')]=function(_0x9dbe16,_0x87f4){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x9dbe16[_0xc861('0x3e')]['id']}})[_0xc861('0x1d')](handleEntityNotFound(_0x87f4,null))['then'](removeEntity(_0x87f4,null))[_0xc861('0x3d')](handleError(_0x87f4,null));};exports['describe']=function(_0x19ffb7,_0x5592b8){return db[_0xc861('0x24')]['describe']()[_0xc861('0x1d')](respondWithResult(_0x5592b8,null))[_0xc861('0x3d')](handleError(_0x5592b8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e999307..3a512cd 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 _0x6d6a=['bluebird','request-promise','path','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x26db46,_0x1973de){var _0x196c13=function(_0x18aa2f){while(--_0x18aa2f){_0x26db46['push'](_0x26db46['shift']());}};_0x196c13(++_0x1973de);}(_0x6d6a,0xa6));var _0xa6d6=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6d6a[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xa6d6('0x0'));var util=require(_0xa6d6('0x1'));var logger=require(_0xa6d6('0x2'))('api');var moment=require(_0xa6d6('0x3'));var BPromise=require(_0xa6d6('0x4'));var rp=require(_0xa6d6('0x5'));var fs=require('fs');var path=require(_0xa6d6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x396b1c,_0x55ff37){return _0x396b1c[_0xa6d6('0x7')](_0xa6d6('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xa6d6('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d71=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0xe8679c,_0x3da241){var _0x2ece11=function(_0x328ff8){while(--_0x328ff8){_0xe8679c['push'](_0xe8679c['shift']());}};_0x2ece11(++_0x3da241);}(_0x3d71,0xa6));var _0x13d7=function(_0x46374c,_0xb088ab){_0x46374c=_0x46374c-0x0;var _0x2747c3=_0x3d71[_0x46374c];return _0x2747c3;};'use strict';var _=require(_0x13d7('0x0'));var util=require(_0x13d7('0x1'));var logger=require(_0x13d7('0x2'))(_0x13d7('0x3'));var moment=require('moment');var BPromise=require(_0x13d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13d7('0x5'));var rimraf=require(_0x13d7('0x6'));var config=require(_0x13d7('0x7'));var attributes=require(_0x13d7('0x8'));module['exports']=function(_0x469796,_0x18f6ea){return _0x469796[_0x13d7('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x13d7('0xa'),'paranoid':![],'indexes':[{'name':_0x13d7('0xb'),'fields':[_0x13d7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 32e053f..21646ff 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 _0xae30=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x34d52b,_0x2de019){var _0x43e1c3=function(_0x23d355){while(--_0x23d355){_0x34d52b['push'](_0x34d52b['shift']());}};_0x43e1c3(++_0x2de019);}(_0xae30,0x10a));var _0x0ae3=function(_0x546496,_0x51544c){_0x546496=_0x546496-0x0;var _0x3afe5a=_0xae30[_0x546496];return _0x3afe5a;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require(_0x0ae3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require(_0x0ae3('0x5'))['db'];var utils=require(_0x0ae3('0x6'));var logger=require('../../config/logger')(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require(_0x0ae3('0x9'));var client=jayson[_0x0ae3('0xa')][_0x0ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda3853,_0x2b81f4,_0x15b7e2){return new BPromise(function(_0x32ea6e,_0x34e783){return client[_0x0ae3('0xc')](_0xda3853,_0x15b7e2)[_0x0ae3('0xd')](function(_0x32ca2c){logger['info'](_0x0ae3('0xe'),_0x2b81f4,_0x0ae3('0xf'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2b81f4,_0x0ae3('0xf'),JSON[_0x0ae3('0x10')](_0x32ca2c));if(_0x32ca2c[_0x0ae3('0x11')]){if(_0x32ca2c[_0x0ae3('0x11')]['code']===0x1f4){logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')]['message']);return _0x34e783(_0x32ca2c['error'][_0x0ae3('0x12')]);}logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);return _0x32ea6e(_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);}else{logger[_0x0ae3('0x13')](_0x0ae3('0xe'),_0x2b81f4,'request\x20sent');_0x32ea6e(_0x32ca2c[_0x0ae3('0x14')]['message']);}})[_0x0ae3('0x15')](function(_0x254a0f){logger[_0x0ae3('0x11')](_0x0ae3('0xe'),_0x2b81f4,_0x254a0f);_0x34e783(_0x254a0f);});});} \ No newline at end of file +var _0x7579=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x430205,_0x328c94){var _0x3f5146=function(_0x3cd6bd){while(--_0x3cd6bd){_0x430205['push'](_0x430205['shift']());}};_0x3f5146(++_0x328c94);}(_0x7579,0x1e2));var _0x9757=function(_0xa9b8fb,_0x2d66cb){_0xa9b8fb=_0xa9b8fb-0x0;var _0x1495c1=_0x7579[_0xa9b8fb];return _0x1495c1;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));var BPromise=require(_0x9757('0x3'));var rs=require(_0x9757('0x4'));var fs=require('fs');var Redis=require(_0x9757('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9757('0x6'));var logger=require(_0x9757('0x7'))(_0x9757('0x8'));var config=require(_0x9757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9757('0xa')][_0x9757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4757e9,_0x4b5446,_0x28a14a){return new BPromise(function(_0x51a1c8,_0x2d65dd){return client[_0x9757('0xc')](_0x4757e9,_0x28a14a)[_0x9757('0xd')](function(_0x5b5749){logger[_0x9757('0xe')](_0x9757('0xf'),_0x4b5446,_0x9757('0x10'));logger[_0x9757('0x11')](_0x9757('0x12'),_0x4b5446,_0x9757('0x10'),JSON[_0x9757('0x13')](_0x5b5749));if(_0x5b5749[_0x9757('0x14')]){if(_0x5b5749[_0x9757('0x14')][_0x9757('0x15')]===0x1f4){logger[_0x9757('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x2d65dd(_0x5b5749[_0x9757('0x14')]['message']);}logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x51a1c8(_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);}else{logger[_0x9757('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b5446,_0x9757('0x10'));_0x51a1c8(_0x5b5749['result'][_0x9757('0x16')]);}})[_0x9757('0x17')](function(_0xad2a22){logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0xad2a22);_0x2d65dd(_0xad2a22);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6a36129..63f61e6 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 _0x1c4d=['get','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c4d,0xa9));var _0xd1c4=function(_0x15294d,_0x56c15c){_0x15294d=_0x15294d-0x0;var _0x332084=_0x1c4d[_0x15294d];return _0x332084;};'use strict';var multer=require(_0xd1c4('0x0'));var util=require(_0xd1c4('0x1'));var path=require(_0xd1c4('0x2'));var timeout=require(_0xd1c4('0x3'));var express=require(_0xd1c4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1c4('0x5'));var interaction=require(_0xd1c4('0x6'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xd1c4('0x7')]('/',auth[_0xd1c4('0x8')](),controller[_0xd1c4('0x9')]);router[_0xd1c4('0x7')](_0xd1c4('0xa'),auth[_0xd1c4('0x8')](),controller[_0xd1c4('0xb')]);router[_0xd1c4('0xc')]('/',auth[_0xd1c4('0x8')](),controller['create']);router[_0xd1c4('0xd')](_0xd1c4('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd1c4('0xe')]('/:id',auth[_0xd1c4('0x8')](),controller[_0xd1c4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2d21=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2987ae,_0x448f60){var _0x5e6fb7=function(_0x1bcc07){while(--_0x1bcc07){_0x2987ae['push'](_0x2987ae['shift']());}};_0x5e6fb7(++_0x448f60);}(_0x2d21,0x6d));var _0x12d2=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x2d21[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0x12d2('0x0'));var util=require(_0x12d2('0x1'));var path=require(_0x12d2('0x2'));var timeout=require(_0x12d2('0x3'));var express=require(_0x12d2('0x4'));var router=express[_0x12d2('0x5')]();var fs_extra=require(_0x12d2('0x6'));var auth=require(_0x12d2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x12d2('0x8'));var controller=require(_0x12d2('0x9'));router[_0x12d2('0xa')]('/',auth['isAuthenticated'](),controller[_0x12d2('0xb')]);router['get'](_0x12d2('0xc'),auth[_0x12d2('0xd')](),controller[_0x12d2('0xe')]);router[_0x12d2('0xf')]('/',auth[_0x12d2('0xd')](),controller[_0x12d2('0x10')]);router[_0x12d2('0x11')](_0x12d2('0xc'),auth[_0x12d2('0xd')](),controller[_0x12d2('0x12')]);router[_0x12d2('0x13')](_0x12d2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x12d2('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index bb6c575..cecb8b4 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 _0x2e06=['sequelize','exports','STRING','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2e06,0x1e4));var _0x62e0=function(_0x17aaf5,_0x2dcae3){_0x17aaf5=_0x17aaf5-0x0;var _0x534397=_0x2e06[_0x17aaf5];return _0x534397;};'use strict';var Sequelize=require(_0x62e0('0x0'));module[_0x62e0('0x1')]={'name':{'type':Sequelize[_0x62e0('0x2')],'unique':_0x62e0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x62e0('0x2')]}}; \ No newline at end of file +var _0x00b7=['sequelize','exports','name'];(function(_0x3c42a6,_0x572744){var _0x50e627=function(_0x5100f5){while(--_0x5100f5){_0x3c42a6['push'](_0x3c42a6['shift']());}};_0x50e627(++_0x572744);}(_0x00b7,0xe1));var _0x700b=function(_0x1eca2e,_0x3eb8f5){_0x1eca2e=_0x1eca2e-0x0;var _0x400ae2=_0x00b7[_0x1eca2e];return _0x400ae2;};'use strict';var Sequelize=require(_0x700b('0x0'));module[_0x700b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x700b('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d9a040d..ea19426 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 _0x4b72=['json','undefined','limit','count','offset','status','Content-Range','apply','reject','save','update','then','Pauses','UserProfileResource','destroy','error','stack','name','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0xc051ed,_0x278d2f){var _0x250cc6=function(_0x244e69){while(--_0x244e69){_0xc051ed['push'](_0xc051ed['shift']());}};_0x250cc6(++_0x278d2f);}(_0x4b72,0x1dd));var _0x24b7=function(_0x5d3d12,_0x59dd63){_0x5d3d12=_0x5d3d12-0x0;var _0x3b0d12=_0x4b72[_0x5d3d12];return _0x3b0d12;};'use strict';var emlformat=require(_0x24b7('0x0'));var rimraf=require(_0x24b7('0x1'));var zipdir=require(_0x24b7('0x2'));var jsonpatch=require(_0x24b7('0x3'));var rp=require(_0x24b7('0x4'));var moment=require(_0x24b7('0x5'));var BPromise=require(_0x24b7('0x6'));var Mustache=require('mustache');var util=require(_0x24b7('0x7'));var path=require(_0x24b7('0x8'));var sox=require('sox');var csv=require(_0x24b7('0x9'));var ejs=require(_0x24b7('0xa'));var fs=require('fs');var fs_extra=require(_0x24b7('0xb'));var _=require(_0x24b7('0xc'));var squel=require(_0x24b7('0xd'));var crypto=require(_0x24b7('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x24b7('0x9'));var querystring=require(_0x24b7('0xf'));var Papa=require('papaparse');var Redis=require(_0x24b7('0x10'));var authService=require(_0x24b7('0x11'));var qs=require(_0x24b7('0x12'));var as=require(_0x24b7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24b7('0x14'))(_0x24b7('0x15'));var utils=require(_0x24b7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x24b7('0x17'));var db=require(_0x24b7('0x18'))['db'];function respondWithStatusCode(_0x1a65b0,_0x25de75){_0x25de75=_0x25de75||0xcc;return function(_0x3ca662){if(_0x3ca662){return _0x1a65b0[_0x24b7('0x19')](_0x25de75);}return _0x1a65b0['status'](_0x25de75)[_0x24b7('0x1a')]();};}function respondWithResult(_0x5c1be2,_0xeecced){_0xeecced=_0xeecced||0xc8;return function(_0x1835ed){if(_0x1835ed){return _0x5c1be2['status'](_0xeecced)[_0x24b7('0x1b')](_0x1835ed);}};}function respondWithFilteredResult(_0x47267,_0x4df056){return function(_0x1f5b0b){if(_0x1f5b0b){var _0x49ea22=typeof _0x4df056['offset']===_0x24b7('0x1c')&&typeof _0x4df056[_0x24b7('0x1d')]==='undefined';var _0x55bb19=_0x1f5b0b[_0x24b7('0x1e')];var _0x18285d=_0x49ea22?0x0:_0x4df056[_0x24b7('0x1f')];var _0x482679=_0x49ea22?_0x1f5b0b['count']:_0x4df056[_0x24b7('0x1f')]+_0x4df056[_0x24b7('0x1d')];var _0xdf3453;if(_0x482679>=_0x55bb19){_0x482679=_0x55bb19;_0xdf3453=0xc8;}else{_0xdf3453=0xce;}_0x47267[_0x24b7('0x20')](_0xdf3453);return _0x47267['set'](_0x24b7('0x21'),_0x18285d+'-'+_0x482679+'/'+_0x55bb19)[_0x24b7('0x1b')](_0x1f5b0b);}return null;};}function patchUpdates(_0x22e7f0){return function(_0x87d2d4){try{jsonpatch[_0x24b7('0x22')](_0x87d2d4,_0x22e7f0,!![]);}catch(_0x146cba){return BPromise[_0x24b7('0x23')](_0x146cba);}return _0x87d2d4[_0x24b7('0x24')]();};}function saveUpdates(_0xe7329,_0x10955d){return function(_0x3319d7){if(_0x3319d7){return _0x3319d7[_0x24b7('0x25')](_0xe7329)['then'](function(_0x5963cb){return _0x5963cb;});}return null;};}function removeEntity(_0x48602d,_0xd2cc7a){return function(_0x70197c){if(_0x70197c){return _0x70197c['destroy']()[_0x24b7('0x26')](function(){var _0x3f4ad3=_0x70197c['get']({'plain':!![]});var _0x38d290=_0x24b7('0x27');return db[_0x24b7('0x28')][_0x24b7('0x29')]({'where':{'type':_0x38d290,'resourceId':_0x3f4ad3['id']}})[_0x24b7('0x26')](function(){return _0x70197c;});})[_0x24b7('0x26')](function(){_0x48602d[_0x24b7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517a27,_0x4d09ec){return function(_0x5e46eb){if(!_0x5e46eb){_0x517a27['sendStatus'](0x194);}return _0x5e46eb;};}function handleError(_0x44e946,_0x4f9d2a){_0x4f9d2a=_0x4f9d2a||0x1f4;return function(_0x4d74fa){logger[_0x24b7('0x2a')](_0x4d74fa[_0x24b7('0x2b')]);if(_0x4d74fa[_0x24b7('0x2c')]){delete _0x4d74fa[_0x24b7('0x2c')];}_0x44e946[_0x24b7('0x20')](_0x4f9d2a)['send'](_0x4d74fa);};}exports[_0x24b7('0x2d')]=function(_0x307b7b,_0x3d5d19){var _0x18ddc5={},_0x69fb7b={},_0x12838a={'count':0x0,'rows':[]};var _0x3c3c5a=_[_0x24b7('0x2e')](db[_0x24b7('0x2f')][_0x24b7('0x30')],function(_0xd8f59b){return{'name':_0xd8f59b['fieldName'],'type':_0xd8f59b[_0x24b7('0x31')][_0x24b7('0x32')]};});_0x69fb7b[_0x24b7('0x33')]=_[_0x24b7('0x2e')](_0x3c3c5a,_0x24b7('0x2c'));_0x69fb7b[_0x24b7('0x34')]=_[_0x24b7('0x35')](_0x307b7b['query']);_0x69fb7b[_0x24b7('0x36')]=_[_0x24b7('0x37')](_0x69fb7b[_0x24b7('0x33')],_0x69fb7b['query']);_0x18ddc5['attributes']=_[_0x24b7('0x37')](_0x69fb7b[_0x24b7('0x33')],qs[_0x24b7('0x38')](_0x307b7b['query']['fields']));_0x18ddc5['attributes']=_0x18ddc5['attributes'][_0x24b7('0x39')]?_0x18ddc5[_0x24b7('0x3a')]:_0x69fb7b[_0x24b7('0x33')];if(!_0x307b7b[_0x24b7('0x34')]['hasOwnProperty'](_0x24b7('0x3b'))){_0x18ddc5['limit']=qs[_0x24b7('0x1d')](_0x307b7b['query'][_0x24b7('0x1d')]);_0x18ddc5['offset']=qs[_0x24b7('0x1f')](_0x307b7b[_0x24b7('0x34')]['offset']);}_0x18ddc5[_0x24b7('0x3c')]=qs[_0x24b7('0x3d')](_0x307b7b[_0x24b7('0x34')][_0x24b7('0x3d')]);_0x18ddc5[_0x24b7('0x3e')]=qs['filters'](_[_0x24b7('0x3f')](_0x307b7b['query'],_0x69fb7b[_0x24b7('0x36')]),_0x3c3c5a);if(_0x307b7b['query']['filter']){_0x18ddc5['where']=_['merge'](_0x18ddc5[_0x24b7('0x3e')],{'$or':_[_0x24b7('0x2e')](_0x3c3c5a,function(_0x454394){if(_0x454394[_0x24b7('0x31')]!==_0x24b7('0x40')){var _0x2b76f0={};_0x2b76f0[_0x454394['name']]={'$like':'%'+_0x307b7b[_0x24b7('0x34')][_0x24b7('0x41')]+'%'};return _0x2b76f0;}})});}_0x18ddc5=_['merge']({},_0x18ddc5,_0x307b7b[_0x24b7('0x42')]);var _0x4efbea={'where':_0x18ddc5[_0x24b7('0x3e')]};return db['Pause'][_0x24b7('0x1e')](_0x4efbea)['then'](function(_0x28c401){_0x12838a['count']=_0x28c401;if(_0x307b7b[_0x24b7('0x34')][_0x24b7('0x43')]){_0x18ddc5[_0x24b7('0x44')]=[{'all':!![]}];}return db[_0x24b7('0x2f')][_0x24b7('0x45')](_0x18ddc5);})['then'](function(_0x3c7c72){_0x12838a[_0x24b7('0x46')]=_0x3c7c72;return _0x12838a;})[_0x24b7('0x26')](respondWithFilteredResult(_0x3d5d19,_0x18ddc5))[_0x24b7('0x47')](handleError(_0x3d5d19,null));};exports[_0x24b7('0x48')]=function(_0x5223bd,_0x527929){var _0x89abfa={'raw':!![],'where':{'id':_0x5223bd[_0x24b7('0x49')]['id']}},_0x22216b={};_0x22216b['model']=_[_0x24b7('0x35')](db[_0x24b7('0x2f')]['rawAttributes']);_0x22216b[_0x24b7('0x34')]=_[_0x24b7('0x35')](_0x5223bd[_0x24b7('0x34')]);_0x22216b[_0x24b7('0x36')]=_['intersection'](_0x22216b[_0x24b7('0x33')],_0x22216b[_0x24b7('0x34')]);_0x89abfa[_0x24b7('0x3a')]=_[_0x24b7('0x37')](_0x22216b['model'],qs[_0x24b7('0x38')](_0x5223bd[_0x24b7('0x34')][_0x24b7('0x38')]));_0x89abfa[_0x24b7('0x3a')]=_0x89abfa[_0x24b7('0x3a')][_0x24b7('0x39')]?_0x89abfa[_0x24b7('0x3a')]:_0x22216b[_0x24b7('0x33')];if(_0x5223bd[_0x24b7('0x34')][_0x24b7('0x43')]){_0x89abfa[_0x24b7('0x44')]=[{'all':!![]}];}_0x89abfa=_['merge']({},_0x89abfa,_0x5223bd['options']);return db[_0x24b7('0x2f')]['find'](_0x89abfa)[_0x24b7('0x26')](handleEntityNotFound(_0x527929,null))[_0x24b7('0x26')](respondWithResult(_0x527929,null))[_0x24b7('0x47')](handleError(_0x527929,null));};exports[_0x24b7('0x4a')]=function(_0x2e8995,_0x47685c){return db[_0x24b7('0x2f')][_0x24b7('0x4a')](_0x2e8995[_0x24b7('0x4b')],{})['then'](function(_0x50edab){var _0xe4946d=_0x2e8995[_0x24b7('0x4c')][_0x24b7('0x4d')]({'plain':!![]});if(!_0xe4946d)throw new Error(_0x24b7('0x4e'));if(_0xe4946d[_0x24b7('0x4f')]===_0x24b7('0x4c')){var _0xb33eb5=_0x50edab[_0x24b7('0x4d')]({'plain':!![]});var _0x5b18f7=_0x24b7('0x27');return db['UserProfileSection'][_0x24b7('0x50')]({'where':{'name':_0x5b18f7,'userProfileId':_0xe4946d[_0x24b7('0x51')]},'raw':!![]})[_0x24b7('0x26')](function(_0x391e15){if(_0x391e15&&_0x391e15[_0x24b7('0x52')]===0x0){return db[_0x24b7('0x28')][_0x24b7('0x4a')]({'name':_0xb33eb5['name'],'resourceId':_0xb33eb5['id'],'type':_0x391e15[_0x24b7('0x2c')],'sectionId':_0x391e15['id']},{})[_0x24b7('0x26')](function(){return _0x50edab;});}else{return _0x50edab;}})[_0x24b7('0x47')](function(_0x32f1db){logger[_0x24b7('0x2a')](_0x24b7('0x53'),_0x32f1db);throw _0x32f1db;});}return _0x50edab;})[_0x24b7('0x26')](respondWithResult(_0x47685c,0xc9))[_0x24b7('0x47')](handleError(_0x47685c,null));};exports[_0x24b7('0x25')]=function(_0x34363c,_0xbaee70){if(_0x34363c[_0x24b7('0x4b')]['id']){delete _0x34363c[_0x24b7('0x4b')]['id'];}return db[_0x24b7('0x2f')][_0x24b7('0x50')]({'where':{'id':_0x34363c['params']['id']}})['then'](handleEntityNotFound(_0xbaee70,null))[_0x24b7('0x26')](saveUpdates(_0x34363c['body'],null))['then'](respondWithResult(_0xbaee70,null))[_0x24b7('0x47')](handleError(_0xbaee70,null));};exports[_0x24b7('0x29')]=function(_0x2b50d6,_0x58c982){return db[_0x24b7('0x2f')]['find']({'where':{'id':_0x2b50d6[_0x24b7('0x49')]['id']}})[_0x24b7('0x26')](handleEntityNotFound(_0x58c982,null))['then'](removeEntity(_0x58c982,null))[_0x24b7('0x47')](handleError(_0x58c982,null));}; \ No newline at end of file +var _0xd252=['options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','get','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','Pause','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','type','VIRTUAL','merge'];(function(_0x560653,_0x3c1465){var _0x1f850c=function(_0x2d3b7c){while(--_0x2d3b7c){_0x560653['push'](_0x560653['shift']());}};_0x1f850c(++_0x3c1465);}(_0xd252,0x68));var _0x2d25=function(_0x588e08,_0x494086){_0x588e08=_0x588e08-0x0;var _0x2d1902=_0xd252[_0x588e08];return _0x2d1902;};'use strict';var emlformat=require(_0x2d25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d25('0x1'));var jsonpatch=require(_0x2d25('0x2'));var rp=require(_0x2d25('0x3'));var moment=require(_0x2d25('0x4'));var BPromise=require(_0x2d25('0x5'));var Mustache=require(_0x2d25('0x6'));var util=require(_0x2d25('0x7'));var path=require('path');var sox=require(_0x2d25('0x8'));var csv=require(_0x2d25('0x9'));var ejs=require(_0x2d25('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2d25('0xb'));var crypto=require(_0x2d25('0xc'));var jsforce=require(_0x2d25('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2d25('0x9'));var querystring=require(_0x2d25('0xe'));var Papa=require(_0x2d25('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d25('0x10'));var as=require(_0x2d25('0x11'));var hardwareService=require(_0x2d25('0x12'));var logger=require(_0x2d25('0x13'))(_0x2d25('0x14'));var utils=require(_0x2d25('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d25('0x16'))['db'];function respondWithStatusCode(_0x5a7ce0,_0x4f253f){_0x4f253f=_0x4f253f||0xcc;return function(_0x560efc){if(_0x560efc){return _0x5a7ce0[_0x2d25('0x17')](_0x4f253f);}return _0x5a7ce0[_0x2d25('0x18')](_0x4f253f)[_0x2d25('0x19')]();};}function respondWithResult(_0x53aca9,_0x32141d){_0x32141d=_0x32141d||0xc8;return function(_0xa9b266){if(_0xa9b266){return _0x53aca9[_0x2d25('0x18')](_0x32141d)[_0x2d25('0x1a')](_0xa9b266);}};}function respondWithFilteredResult(_0x50643b,_0x50e0fe){return function(_0x435601){if(_0x435601){var _0x26b24a=typeof _0x50e0fe[_0x2d25('0x1b')]===_0x2d25('0x1c')&&typeof _0x50e0fe[_0x2d25('0x1d')]===_0x2d25('0x1c');var _0x1692df=_0x435601[_0x2d25('0x1e')];var _0x58124b=_0x26b24a?0x0:_0x50e0fe[_0x2d25('0x1b')];var _0x5e164f=_0x26b24a?_0x435601['count']:_0x50e0fe[_0x2d25('0x1b')]+_0x50e0fe[_0x2d25('0x1d')];var _0x3369ca;if(_0x5e164f>=_0x1692df){_0x5e164f=_0x1692df;_0x3369ca=0xc8;}else{_0x3369ca=0xce;}_0x50643b[_0x2d25('0x18')](_0x3369ca);return _0x50643b[_0x2d25('0x1f')](_0x2d25('0x20'),_0x58124b+'-'+_0x5e164f+'/'+_0x1692df)[_0x2d25('0x1a')](_0x435601);}return null;};}function patchUpdates(_0x86cb55){return function(_0x1b94ac){try{jsonpatch[_0x2d25('0x21')](_0x1b94ac,_0x86cb55,!![]);}catch(_0x5c21af){return BPromise[_0x2d25('0x22')](_0x5c21af);}return _0x1b94ac[_0x2d25('0x23')]();};}function saveUpdates(_0x5bac1b,_0x515082){return function(_0x345b04){if(_0x345b04){return _0x345b04[_0x2d25('0x24')](_0x5bac1b)[_0x2d25('0x25')](function(_0x1cb64c){return _0x1cb64c;});}return null;};}function removeEntity(_0x5099e9,_0x3d1ae0){return function(_0x404454){if(_0x404454){return _0x404454[_0x2d25('0x26')]()[_0x2d25('0x25')](function(){var _0x488737=_0x404454['get']({'plain':!![]});var _0x22cc25='Pauses';return db[_0x2d25('0x27')][_0x2d25('0x26')]({'where':{'type':_0x22cc25,'resourceId':_0x488737['id']}})['then'](function(){return _0x404454;});})[_0x2d25('0x25')](function(){_0x5099e9[_0x2d25('0x18')](0xcc)[_0x2d25('0x19')]();});}};}function handleEntityNotFound(_0x28319c,_0x428ed9){return function(_0x10e376){if(!_0x10e376){_0x28319c[_0x2d25('0x17')](0x194);}return _0x10e376;};}function handleError(_0x36b2b8,_0x5aad04){_0x5aad04=_0x5aad04||0x1f4;return function(_0x300e62){logger[_0x2d25('0x28')](_0x300e62[_0x2d25('0x29')]);if(_0x300e62[_0x2d25('0x2a')]){delete _0x300e62[_0x2d25('0x2a')];}_0x36b2b8[_0x2d25('0x18')](_0x5aad04)[_0x2d25('0x2b')](_0x300e62);};}exports[_0x2d25('0x2c')]=function(_0x469d8f,_0x49c294){var _0x4590c4={},_0x326c57={},_0xa7b4f={'count':0x0,'rows':[]};var _0x4102c9=_['map'](db[_0x2d25('0x2d')]['rawAttributes'],function(_0x119349){return{'name':_0x119349[_0x2d25('0x2e')],'type':_0x119349['type'][_0x2d25('0x2f')]};});_0x326c57[_0x2d25('0x30')]=_['map'](_0x4102c9,_0x2d25('0x2a'));_0x326c57[_0x2d25('0x31')]=_[_0x2d25('0x32')](_0x469d8f[_0x2d25('0x31')]);_0x326c57[_0x2d25('0x33')]=_[_0x2d25('0x34')](_0x326c57['model'],_0x326c57['query']);_0x4590c4[_0x2d25('0x35')]=_['intersection'](_0x326c57[_0x2d25('0x30')],qs['fields'](_0x469d8f[_0x2d25('0x31')][_0x2d25('0x36')]));_0x4590c4['attributes']=_0x4590c4[_0x2d25('0x35')][_0x2d25('0x37')]?_0x4590c4['attributes']:_0x326c57[_0x2d25('0x30')];if(!_0x469d8f['query'][_0x2d25('0x38')](_0x2d25('0x39'))){_0x4590c4[_0x2d25('0x1d')]=qs[_0x2d25('0x1d')](_0x469d8f[_0x2d25('0x31')]['limit']);_0x4590c4[_0x2d25('0x1b')]=qs[_0x2d25('0x1b')](_0x469d8f[_0x2d25('0x31')]['offset']);}_0x4590c4['order']=qs['sort'](_0x469d8f[_0x2d25('0x31')]['sort']);_0x4590c4[_0x2d25('0x3a')]=qs[_0x2d25('0x33')](_[_0x2d25('0x3b')](_0x469d8f[_0x2d25('0x31')],_0x326c57[_0x2d25('0x33')]),_0x4102c9);if(_0x469d8f[_0x2d25('0x31')][_0x2d25('0x3c')]){_0x4590c4[_0x2d25('0x3a')]=_['merge'](_0x4590c4[_0x2d25('0x3a')],{'$or':_['map'](_0x4102c9,function(_0x162445){if(_0x162445[_0x2d25('0x3d')]!==_0x2d25('0x3e')){var _0x1edd93={};_0x1edd93[_0x162445[_0x2d25('0x2a')]]={'$like':'%'+_0x469d8f[_0x2d25('0x31')][_0x2d25('0x3c')]+'%'};return _0x1edd93;}})});}_0x4590c4=_[_0x2d25('0x3f')]({},_0x4590c4,_0x469d8f[_0x2d25('0x40')]);var _0x1fce34={'where':_0x4590c4[_0x2d25('0x3a')]};return db[_0x2d25('0x2d')][_0x2d25('0x1e')](_0x1fce34)[_0x2d25('0x25')](function(_0x1aed17){_0xa7b4f[_0x2d25('0x1e')]=_0x1aed17;if(_0x469d8f['query'][_0x2d25('0x41')]){_0x4590c4[_0x2d25('0x42')]=[{'all':!![]}];}return db['Pause'][_0x2d25('0x43')](_0x4590c4);})[_0x2d25('0x25')](function(_0x1c3330){_0xa7b4f[_0x2d25('0x44')]=_0x1c3330;return _0xa7b4f;})[_0x2d25('0x25')](respondWithFilteredResult(_0x49c294,_0x4590c4))['catch'](handleError(_0x49c294,null));};exports[_0x2d25('0x45')]=function(_0x317f23,_0x100268){var _0x5aa8c5={'raw':!![],'where':{'id':_0x317f23[_0x2d25('0x46')]['id']}},_0x2ba15e={};_0x2ba15e[_0x2d25('0x30')]=_[_0x2d25('0x32')](db['Pause'][_0x2d25('0x47')]);_0x2ba15e['query']=_[_0x2d25('0x32')](_0x317f23['query']);_0x2ba15e[_0x2d25('0x33')]=_[_0x2d25('0x34')](_0x2ba15e[_0x2d25('0x30')],_0x2ba15e[_0x2d25('0x31')]);_0x5aa8c5[_0x2d25('0x35')]=_['intersection'](_0x2ba15e[_0x2d25('0x30')],qs[_0x2d25('0x36')](_0x317f23[_0x2d25('0x31')][_0x2d25('0x36')]));_0x5aa8c5[_0x2d25('0x35')]=_0x5aa8c5[_0x2d25('0x35')][_0x2d25('0x37')]?_0x5aa8c5[_0x2d25('0x35')]:_0x2ba15e[_0x2d25('0x30')];if(_0x317f23[_0x2d25('0x31')][_0x2d25('0x41')]){_0x5aa8c5[_0x2d25('0x42')]=[{'all':!![]}];}_0x5aa8c5=_[_0x2d25('0x3f')]({},_0x5aa8c5,_0x317f23[_0x2d25('0x40')]);return db['Pause'][_0x2d25('0x48')](_0x5aa8c5)[_0x2d25('0x25')](handleEntityNotFound(_0x100268,null))['then'](respondWithResult(_0x100268,null))[_0x2d25('0x49')](handleError(_0x100268,null));};exports[_0x2d25('0x4a')]=function(_0x442b39,_0x5f5298){return db[_0x2d25('0x2d')][_0x2d25('0x4a')](_0x442b39[_0x2d25('0x4b')],{})[_0x2d25('0x25')](function(_0x337904){var _0x1f7084=_0x442b39[_0x2d25('0x4c')][_0x2d25('0x4d')]({'plain':!![]});if(!_0x1f7084)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f7084[_0x2d25('0x4e')]==='user'){var _0x3975e4=_0x337904[_0x2d25('0x4d')]({'plain':!![]});var _0xbe8c1a=_0x2d25('0x4f');return db[_0x2d25('0x50')]['find']({'where':{'name':_0xbe8c1a,'userProfileId':_0x1f7084[_0x2d25('0x51')]},'raw':!![]})['then'](function(_0x56d0aa){if(_0x56d0aa&&_0x56d0aa[_0x2d25('0x52')]===0x0){return db[_0x2d25('0x27')][_0x2d25('0x4a')]({'name':_0x3975e4[_0x2d25('0x2a')],'resourceId':_0x3975e4['id'],'type':_0x56d0aa[_0x2d25('0x2a')],'sectionId':_0x56d0aa['id']},{})[_0x2d25('0x25')](function(){return _0x337904;});}else{return _0x337904;}})['catch'](function(_0x190d89){logger[_0x2d25('0x28')](_0x2d25('0x53'),_0x190d89);throw _0x190d89;});}return _0x337904;})['then'](respondWithResult(_0x5f5298,0xc9))['catch'](handleError(_0x5f5298,null));};exports[_0x2d25('0x24')]=function(_0x5db8c1,_0x1d1527){if(_0x5db8c1['body']['id']){delete _0x5db8c1['body']['id'];}return db[_0x2d25('0x2d')][_0x2d25('0x48')]({'where':{'id':_0x5db8c1[_0x2d25('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d1527,null))[_0x2d25('0x25')](saveUpdates(_0x5db8c1[_0x2d25('0x4b')],null))[_0x2d25('0x25')](respondWithResult(_0x1d1527,null))['catch'](handleError(_0x1d1527,null));};exports['destroy']=function(_0x4100bc,_0x4d5036){return db[_0x2d25('0x2d')][_0x2d25('0x48')]({'where':{'id':_0x4100bc['params']['id']}})['then'](handleEntityNotFound(_0x4d5036,null))[_0x2d25('0x25')](removeEntity(_0x4d5036,null))[_0x2d25('0x49')](handleError(_0x4d5036,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6e4865b..d73b405 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5d9a72,_0x98f08){var _0x332393=function(_0x1cf2ae){while(--_0x1cf2ae){_0x5d9a72['push'](_0x5d9a72['shift']());}};_0x332393(++_0x98f08);}(_0xabce,0x103));var _0xeabc=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xabce[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x131c81,_0x12fe63){_0x131c81=_0x131c81-0x0;var _0x241e7a=_0x7fbe[_0x131c81];return _0x241e7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index bde02d0..5ecb657 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(_0x21a765,_0x53dd3e){var _0x3f9ae7=function(_0x164031){while(--_0x164031){_0x21a765['push'](_0x21a765['shift']());}};_0x3f9ae7(++_0x53dd3e);}(_0xb10b,0x12a));var _0xbb10=function(_0x33c98e,_0x4eb3d0){_0x33c98e=_0x33c98e-0x0;var _0x39a756=_0xb10b[_0x33c98e];return _0x39a756;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x114b12,_0x1865f5){var _0x19cb1b=function(_0x44028f){while(--_0x44028f){_0x114b12['push'](_0x114b12['shift']());}};_0x19cb1b(++_0x1865f5);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0xb10b[_0x1e1fe9];return _0x4eeb06;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6338520..f9908f8 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 _0x1cc7=['path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util'];(function(_0x8e4e90,_0x6d7185){var _0x1d9d2b=function(_0x3a63e7){while(--_0x3a63e7){_0x8e4e90['push'](_0x8e4e90['shift']());}};_0x1d9d2b(++_0x6d7185);}(_0x1cc7,0x15a));var _0x71cc=function(_0x279cbd,_0x365aec){_0x279cbd=_0x279cbd-0x0;var _0x4321f4=_0x1cc7[_0x279cbd];return _0x4321f4;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')](_0x71cc('0xa'),auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0x7')](_0x71cc('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b7514,_0xeb4747,_0x2db190){_0x2db190(null,path[_0x71cc('0xd')](config['root'],_0x71cc('0xe')));},'filename':function(_0x550b3c,_0x1aad83,_0x4f9c5c){_0x1aad83[_0x71cc('0xf')]=_0x1aad83['originalname'][_0x71cc('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f9c5c(null,util[_0x71cc('0x11')](_0x71cc('0x12'),path[_0x71cc('0x13')](_0x1aad83[_0x71cc('0xf')],path['extname'](_0x1aad83[_0x71cc('0xf')])),Date[_0x71cc('0x14')](),path[_0x71cc('0x15')](_0x1aad83[_0x71cc('0xf')])));}})});router[_0x71cc('0x16')]('/',upload[_0x71cc('0x17')](_0x71cc('0x18')),controller['upload']);router[_0x71cc('0x16')](_0x71cc('0x8'),controller[_0x71cc('0x19')]);router[_0x71cc('0x1a')](_0x71cc('0xa'),auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0x1b')](_0x71cc('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x71cc('0x1c')]=router; \ No newline at end of file +var _0xb43b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','isAuthenticated','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','basename','extname','file','webhookPost','put','delete','exports','multer'];(function(_0x1d2cf2,_0x4f6aad){var _0xe5f313=function(_0xd42d92){while(--_0xd42d92){_0x1d2cf2['push'](_0x1d2cf2['shift']());}};_0xe5f313(++_0x4f6aad);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2ce4df,_0x2e28eb){_0x2ce4df=_0x2ce4df-0x0;var _0x2aa98e=_0xb43b[_0x2ce4df];return _0x2aa98e;};'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'),controller[_0xbb43('0xb')]);router[_0xbb43('0xc')](_0xbb43('0xd'),auth[_0xbb43('0xe')](),controller['show']);router[_0xbb43('0xc')](_0xbb43('0xf'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);var upload=multer({'storage':multer[_0xbb43('0x11')]({'destination':function(_0xd37cdf,_0x5e3611,_0xfac791){_0xfac791(null,path[_0xbb43('0x12')](config['root'],_0xbb43('0x13')));},'filename':function(_0x2a5a4d,_0x50e2c0,_0x578392){_0x50e2c0[_0xbb43('0x14')]=_0x50e2c0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x578392(null,util[_0xbb43('0x15')]('%s-%s%s',path[_0xbb43('0x16')](_0x50e2c0[_0xbb43('0x14')],path['extname'](_0x50e2c0['originalname'])),Date['now'](),path[_0xbb43('0x17')](_0x50e2c0[_0xbb43('0x14')])));}})});router['post']('/',upload['single'](_0xbb43('0x18')),controller['upload']);router['post'](_0xbb43('0xa'),controller[_0xbb43('0x19')]);router[_0xbb43('0x1a')]('/:id',auth[_0xbb43('0xe')](),controller['update']);router[_0xbb43('0x1b')](_0xbb43('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0xbb43('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ab41d63..42bc339 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 _0x812c=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x144205,_0x40daae){var _0x1c280c=function(_0x3b20fb){while(--_0x3b20fb){_0x144205['push'](_0x144205['shift']());}};_0x1c280c(++_0x40daae);}(_0x812c,0x1e7));var _0xc812=function(_0x3fa78c,_0x18b0f2){_0x3fa78c=_0x3fa78c-0x0;var _0x4cbcc9=_0x812c[_0x3fa78c];return _0x4cbcc9;};'use strict';var Sequelize=require(_0xc812('0x0'));module[_0xc812('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc812('0x2')](_0xc812('0x3'),'script')},'description':{'type':Sequelize[_0xc812('0x4')]},'version':{'type':Sequelize[_0xc812('0x4')]},'path':{'type':Sequelize[_0xc812('0x5')],'comment':_0xc812('0x6')},'active':{'type':Sequelize[_0xc812('0x7')],'defaultValue':0x0,'comment':_0xc812('0x8')},'sidebar':{'type':Sequelize[_0xc812('0x2')](_0xc812('0x9'),'agentOnly',_0xc812('0xa'),_0xc812('0xb')),'defaultValue':'always','comment':_0xc812('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc812('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xc812('0x5')]},'scriptPath':{'type':Sequelize[_0xc812('0x5')]}}; \ No newline at end of file +var _0x50ee=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x1fc27e,_0x52402c){var _0x252a06=function(_0x53fa6f){while(--_0x53fa6f){_0x1fc27e['push'](_0x1fc27e['shift']());}};_0x252a06(++_0x52402c);}(_0x50ee,0xe6));var _0xe50e=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x50ee[_0x101802];return _0x5d61ce;};'use strict';var Sequelize=require(_0xe50e('0x0'));module[_0xe50e('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe50e('0x2')]('html',_0xe50e('0x3'))},'description':{'type':Sequelize[_0xe50e('0x4')]},'version':{'type':Sequelize[_0xe50e('0x4')]},'path':{'type':Sequelize[_0xe50e('0x5')],'comment':_0xe50e('0x6')},'active':{'type':Sequelize[_0xe50e('0x7')],'defaultValue':0x0,'comment':_0xe50e('0x8')},'sidebar':{'type':Sequelize[_0xe50e('0x2')](_0xe50e('0x9'),_0xe50e('0xa'),_0xe50e('0xb'),_0xe50e('0xc')),'defaultValue':'always','comment':_0xe50e('0xd')},'icon':{'type':Sequelize[_0xe50e('0x5')]},'adminUrl':{'type':Sequelize[_0xe50e('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xe50e('0x5')]},'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 3e93470..f976060 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 _0x1bd7=['where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','node_modules/**/*','attachments/**/*','finalize','close','Sequelize','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','lstatSync','isFile','readdirSync','Invalid\x20plugin\x20structure','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','statusCode','method','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','Plugin','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x2d1510,_0x5d09c8){var _0x5b779b=function(_0xb21f53){while(--_0xb21f53){_0x2d1510['push'](_0x2d1510['shift']());}};_0x5b779b(++_0x5d09c8);}(_0x1bd7,0x10a));var _0x71bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bd7[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x71bd('0x0'));var jsonpatch=require(_0x71bd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x71bd('0x2'));var Mustache=require('mustache');var util=require(_0x71bd('0x3'));var path=require(_0x71bd('0x4'));var sox=require(_0x71bd('0x5'));var csv=require(_0x71bd('0x6'));var ejs=require(_0x71bd('0x7'));var fs=require('fs');var fs_extra=require(_0x71bd('0x8'));var _=require(_0x71bd('0x9'));var squel=require(_0x71bd('0xa'));var crypto=require(_0x71bd('0xb'));var jsforce=require(_0x71bd('0xc'));var deskjs=require(_0x71bd('0xd'));var toCsv=require(_0x71bd('0x6'));var querystring=require('querystring');var Papa=require(_0x71bd('0xe'));var extract=require(_0x71bd('0xf'));var rimraf=require(_0x71bd('0x10'));var archiver=require(_0x71bd('0x11'));var Redis=require(_0x71bd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x71bd('0x13'));var as=require(_0x71bd('0x14'));var hardwareService=require(_0x71bd('0x15'));var logger=require('../../config/logger')(_0x71bd('0x16'));var utils=require('../../config/utils');var config=require(_0x71bd('0x17'));var licenseUtil=require(_0x71bd('0x18'));var db=require(_0x71bd('0x19'))['db'];config['redis']=_[_0x71bd('0x1a')](config['redis'],{'host':_0x71bd('0x1b'),'port':0x18eb});var socket=require(_0x71bd('0x1c'))(new Redis(config['redis']));require(_0x71bd('0x1d'))[_0x71bd('0x1e')](socket);function respondWithStatusCode(_0x54c8ed,_0x50c8b2){_0x50c8b2=_0x50c8b2||0xcc;return function(_0x110a75){if(_0x110a75){return _0x54c8ed['sendStatus'](_0x50c8b2);}return _0x54c8ed[_0x71bd('0x1f')](_0x50c8b2)['end']();};}function respondWithResult(_0x72b087,_0xb86ab8){_0xb86ab8=_0xb86ab8||0xc8;return function(_0x4a103f){if(_0x4a103f){return _0x72b087['status'](_0xb86ab8)[_0x71bd('0x20')](_0x4a103f);}};}function respondWithFilteredResult(_0x9659ab,_0x5c9f2d){return function(_0x4be04e){if(_0x4be04e){var _0x56754e=typeof _0x5c9f2d[_0x71bd('0x21')]===_0x71bd('0x22')&&typeof _0x5c9f2d[_0x71bd('0x23')]===_0x71bd('0x22');var _0x47c76a=_0x4be04e[_0x71bd('0x24')];var _0x519ebb=_0x56754e?0x0:_0x5c9f2d['offset'];var _0xbaface=_0x56754e?_0x4be04e[_0x71bd('0x24')]:_0x5c9f2d[_0x71bd('0x21')]+_0x5c9f2d[_0x71bd('0x23')];var _0x155883;if(_0xbaface>=_0x47c76a){_0xbaface=_0x47c76a;_0x155883=0xc8;}else{_0x155883=0xce;}_0x9659ab['status'](_0x155883);return _0x9659ab[_0x71bd('0x25')](_0x71bd('0x26'),_0x519ebb+'-'+_0xbaface+'/'+_0x47c76a)[_0x71bd('0x20')](_0x4be04e);}return null;};}function patchUpdates(_0x4c2e14){return function(_0x2be1dd){try{jsonpatch[_0x71bd('0x27')](_0x2be1dd,_0x4c2e14,!![]);}catch(_0x4dc2bf){return BPromise[_0x71bd('0x28')](_0x4dc2bf);}return _0x2be1dd[_0x71bd('0x29')]();};}function saveUpdates(_0x5070ec,_0x212ccc){return function(_0x253f97){if(_0x253f97){return _0x253f97[_0x71bd('0x2a')](_0x5070ec)[_0x71bd('0x2b')](function(_0x110fad){return _0x110fad;});}return null;};}function removeEntity(_0x24b662,_0x5e1d78){return function(_0x1bdea7){if(_0x1bdea7){return _0x1bdea7[_0x71bd('0x2c')]()[_0x71bd('0x2b')](function(){var _0x197421=_0x1bdea7['get']({'plain':!![]});var _0x5801fd='Plugins';return db[_0x71bd('0x2d')][_0x71bd('0x2c')]({'where':{'type':_0x5801fd,'resourceId':_0x197421['id']}})[_0x71bd('0x2b')](function(){return _0x1bdea7;});})[_0x71bd('0x2b')](function(){_0x24b662[_0x71bd('0x1f')](0xcc)[_0x71bd('0x2e')]();});}};}function handleEntityNotFound(_0x16267e,_0x2e7742){return function(_0x433bab){if(!_0x433bab){_0x16267e[_0x71bd('0x2f')](0x194);}return _0x433bab;};}function handleError(_0x13d9f9,_0x3a3684){_0x3a3684=_0x3a3684||0x1f4;return function(_0x529717){logger[_0x71bd('0x30')](_0x529717[_0x71bd('0x31')]);if(_0x529717[_0x71bd('0x32')]){delete _0x529717[_0x71bd('0x32')];}_0x13d9f9['status'](_0x3a3684)['send'](_0x529717);};}exports[_0x71bd('0x33')]=function(_0x3f935e,_0x1b36b8){var _0x539656={},_0x101cde={},_0xe1d6d4={'count':0x0,'rows':[]};var _0x3c195e=_['map'](db[_0x71bd('0x34')][_0x71bd('0x35')],function(_0x1a51d3){return{'name':_0x1a51d3[_0x71bd('0x36')],'type':_0x1a51d3[_0x71bd('0x37')]['key']};});_0x101cde['model']=_[_0x71bd('0x38')](_0x3c195e,_0x71bd('0x32'));_0x101cde[_0x71bd('0x39')]=_[_0x71bd('0x3a')](_0x3f935e[_0x71bd('0x39')]);_0x101cde[_0x71bd('0x3b')]=_['intersection'](_0x101cde[_0x71bd('0x3c')],_0x101cde[_0x71bd('0x39')]);_0x539656[_0x71bd('0x3d')]=_[_0x71bd('0x3e')](_0x101cde[_0x71bd('0x3c')],qs[_0x71bd('0x3f')](_0x3f935e[_0x71bd('0x39')][_0x71bd('0x3f')]));_0x539656[_0x71bd('0x3d')]=_0x539656[_0x71bd('0x3d')][_0x71bd('0x40')]?_0x539656[_0x71bd('0x3d')]:_0x101cde['model'];if(!_0x3f935e[_0x71bd('0x39')]['hasOwnProperty'](_0x71bd('0x41'))){_0x539656[_0x71bd('0x23')]=qs[_0x71bd('0x23')](_0x3f935e[_0x71bd('0x39')][_0x71bd('0x23')]);_0x539656['offset']=qs[_0x71bd('0x21')](_0x3f935e[_0x71bd('0x39')][_0x71bd('0x21')]);}_0x539656[_0x71bd('0x42')]=qs[_0x71bd('0x43')](_0x3f935e['query']['sort']);_0x539656[_0x71bd('0x44')]=qs[_0x71bd('0x3b')](_['pick'](_0x3f935e[_0x71bd('0x39')],_0x101cde[_0x71bd('0x3b')]),_0x3c195e);if(_0x3f935e['query'][_0x71bd('0x45')]){_0x539656[_0x71bd('0x44')]=_[_0x71bd('0x46')](_0x539656[_0x71bd('0x44')],{'$or':_[_0x71bd('0x38')](_0x3c195e,function(_0x477f8d){if(_0x477f8d[_0x71bd('0x37')]!==_0x71bd('0x47')){var _0x4f451d={};_0x4f451d[_0x477f8d[_0x71bd('0x32')]]={'$like':'%'+_0x3f935e['query'][_0x71bd('0x45')]+'%'};return _0x4f451d;}})});}_0x539656=_[_0x71bd('0x46')]({},_0x539656,_0x3f935e['options']);var _0x1ea5a2={'where':_0x539656['where']};return db[_0x71bd('0x34')][_0x71bd('0x24')](_0x1ea5a2)['then'](function(_0x49524e){_0xe1d6d4[_0x71bd('0x24')]=_0x49524e;if(_0x3f935e[_0x71bd('0x39')][_0x71bd('0x48')]){_0x539656[_0x71bd('0x49')]=[{'all':!![]}];}return db[_0x71bd('0x34')][_0x71bd('0x4a')](_0x539656);})[_0x71bd('0x2b')](function(_0x425e44){_0xe1d6d4['rows']=_0x425e44;return _0xe1d6d4;})[_0x71bd('0x2b')](respondWithFilteredResult(_0x1b36b8,_0x539656))[_0x71bd('0x4b')](handleError(_0x1b36b8,null));};exports[_0x71bd('0x4c')]=function(_0x33fb6f,_0xd7f88f){var _0x3a94f1={'raw':!![],'where':{'id':_0x33fb6f[_0x71bd('0x4d')]['id']}},_0x39d271={};_0x39d271[_0x71bd('0x3c')]=_[_0x71bd('0x3a')](db[_0x71bd('0x34')][_0x71bd('0x35')]);_0x39d271[_0x71bd('0x39')]=_[_0x71bd('0x3a')](_0x33fb6f[_0x71bd('0x39')]);_0x39d271['filters']=_[_0x71bd('0x3e')](_0x39d271[_0x71bd('0x3c')],_0x39d271['query']);_0x3a94f1[_0x71bd('0x3d')]=_[_0x71bd('0x3e')](_0x39d271[_0x71bd('0x3c')],qs[_0x71bd('0x3f')](_0x33fb6f[_0x71bd('0x39')][_0x71bd('0x3f')]));_0x3a94f1[_0x71bd('0x3d')]=_0x3a94f1[_0x71bd('0x3d')][_0x71bd('0x40')]?_0x3a94f1[_0x71bd('0x3d')]:_0x39d271[_0x71bd('0x3c')];if(_0x33fb6f[_0x71bd('0x39')][_0x71bd('0x48')]){_0x3a94f1['include']=[{'all':!![]}];}_0x3a94f1=_['merge']({},_0x3a94f1,_0x33fb6f[_0x71bd('0x4e')]);return db['Plugin'][_0x71bd('0x4f')](_0x3a94f1)[_0x71bd('0x2b')](handleEntityNotFound(_0xd7f88f,null))[_0x71bd('0x2b')](respondWithResult(_0xd7f88f,null))[_0x71bd('0x4b')](handleError(_0xd7f88f,null));};exports['download']=function(_0x3c9c8e,_0x5d6dd2,_0x39c043){return db[_0x71bd('0x34')]['find']({'where':{'id':_0x3c9c8e[_0x71bd('0x4d')]['id']},'attributes':[_0x71bd('0x32'),'path'],'raw':!![]})[_0x71bd('0x2b')](handleEntityNotFound(_0x5d6dd2,null))['then'](function(_0x4d1119){if(_0x4d1119){var _0x47013a=path[_0x71bd('0x50')](config[_0x71bd('0x51')],_0x71bd('0x52'),util[_0x71bd('0x53')](_0x71bd('0x54'),path[_0x71bd('0x55')](_0x4d1119['path'])));var _0x561b41=fs[_0x71bd('0x56')](_0x47013a);var _0x278c7e=archiver(_0x71bd('0x57'),{'zlib':{'level':0x9}});_0x278c7e['on']('warning',function(_0x5c793d){if(_0x5c793d[_0x71bd('0x58')]===_0x71bd('0x59')){logger[_0x71bd('0x30')](_0x5c793d);}else{throw new db['Sequelize'][(_0x71bd('0x5a'))](_0x71bd('0x5b'));}});_0x278c7e['on'](_0x71bd('0x30'),function(_0x3cd1bf){throw new db['Sequelize'][(_0x71bd('0x5a'))](_0x71bd('0x5b'));});_0x278c7e['pipe'](_0x561b41);_0x278c7e[_0x71bd('0x5c')]('**/*',{'cwd':path[_0x71bd('0x50')](config[_0x71bd('0x51')],'server/files/plugins',path['dirname'](_0x4d1119[_0x71bd('0x4')])),'ignore':[path[_0x71bd('0x50')](path[_0x71bd('0x55')](_0x4d1119[_0x71bd('0x4')]),_0x71bd('0x5d')),path['join'](path[_0x71bd('0x55')](_0x4d1119[_0x71bd('0x4')]),_0x71bd('0x5e'))],'nodir':!![]})[_0x71bd('0x5f')]();_0x561b41['on'](_0x71bd('0x60'),function(){if(!fs['existsSync'](_0x47013a)){throw new db[(_0x71bd('0x61'))]['Error'](_0x71bd('0x62'));}return _0x5d6dd2[_0x71bd('0x63')](_0x47013a,util['format'](_0x71bd('0x54'),path[_0x71bd('0x55')](_0x4d1119[_0x71bd('0x4')])),function(_0x2aca81){if(_0x2aca81){throw new db[(_0x71bd('0x61'))]['Error'](_0x71bd('0x64'));}fs[_0x71bd('0x65')](_0x47013a);logger['info'](_0x71bd('0x66'));logger[_0x71bd('0x67')](_0x71bd('0x68'));});});}return null;})[_0x71bd('0x4b')](handleError(_0x5d6dd2,null));};exports[_0x71bd('0x69')]=function(_0x281802,_0x409f57,_0x40e26f){var _0x4cf090=path[_0x71bd('0x55')](_0x281802[_0x71bd('0x6a')][_0x71bd('0x6b')],path[_0x71bd('0x6c')](_0x281802[_0x71bd('0x6a')][_0x71bd('0x6b')]));var _0x2e72ed=path[_0x71bd('0x50')](config['root'],_0x71bd('0x52'),_0x281802[_0x71bd('0x6a')][_0x71bd('0x6b')]);var _0x4569a8=path[_0x71bd('0x50')](config['root'],'server/files/plugins',_0x4cf090);logger[_0x71bd('0x67')](_0x71bd('0x6d'),_0x2e72ed);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x4569a8);try{fs[_0x71bd('0x6e')](_0x2e72ed,parseInt(_0x71bd('0x6f'),0x8));extract(_0x2e72ed,{'dir':_0x4569a8},function(_0x4ec7bb){if(_0x4ec7bb){logger[_0x71bd('0x30')](_0x4ec7bb);handleError(_0x4ec7bb,!![]);};var _0x1098c2=fs['readdirSync'](_0x4569a8);if(_0x1098c2['length']>0x1){removeReferences(_0x2e72ed,_0x4569a8);logger[_0x71bd('0x30')]('Invalid\x20plugin\x20structure');return _0x40e26f(new Error('Invalid\x20plugin\x20structure'));}var _0x216b88=fs[_0x71bd('0x70')](path['join'](_0x4569a8,_0x1098c2[0x0]));if(_0x216b88[_0x71bd('0x71')]()){removeReferences(_0x2e72ed,_0x4569a8);logger['error']('Invalid\x20plugin\x20structure');return _0x40e26f(new Error('Invalid\x20plugin\x20structure'));}if(_0x216b88['isDirectory']()){var _0xd40342=fs[_0x71bd('0x72')](path[_0x71bd('0x50')](_0x4569a8,_0x1098c2[0x0]));if(_0xd40342['length']===0x0){removeReferences(_0x2e72ed,_0x4569a8);logger[_0x71bd('0x30')](_0x71bd('0x73'));return _0x40e26f(new Error(_0x71bd('0x73')));}var _0x1341e0=_0xd40342['some'](function(_0x1d82bb){return _0x1d82bb===_0x71bd('0x74');});if(!_0x1341e0){return _0x40e26f(new Error('Plugin\x20manifest\x20missing'));}var _0x47beaa=fs['readFileSync'](path[_0x71bd('0x50')](_0x4569a8,_0x1098c2[0x0],'manifest.json'));var _0x418e8f=JSON['parse'](_0x47beaa);if(_0x71bd('0x22')==typeof _0x418e8f['name']){return _0x40e26f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x71bd('0x22')==typeof _0x418e8f['type']){return _0x40e26f(new Error(_0x71bd('0x75')));}if('undefined'==typeof _0x418e8f[_0x71bd('0x76')]){return _0x40e26f(new Error(_0x71bd('0x77')));}if(_0x71bd('0x22')==typeof _0x418e8f[_0x71bd('0x78')]){return _0x40e26f(new Error(_0x71bd('0x79')));}if(_0x418e8f[_0x71bd('0x37')]==='html'){if(_0x71bd('0x22')==typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')]){return _0x40e26f(new Error(_0x71bd('0x7b')));}if(_0x71bd('0x22')==typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')][_0x71bd('0x7c')]&&_0x71bd('0x22')==typeof _0x418e8f[_0x71bd('0x78')]['views'][_0x71bd('0x7d')]){return _0x40e26f(new Error(_0x71bd('0x7e')));}}else if(_0x418e8f[_0x71bd('0x37')]==='script'){if(_0x71bd('0x22')==typeof _0x418e8f[_0x71bd('0x78')]['scriptName']){return _0x40e26f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x71bd('0x22')==typeof _0x418e8f['parameters'][_0x71bd('0x7f')]){return _0x40e26f(new Error(_0x71bd('0x80')));}}else{return _0x40e26f(new Error(_0x71bd('0x81')));}var _0x338fb4=_0x418e8f[_0x71bd('0x32')];var _0x29670b=_0x418e8f[_0x71bd('0x82')];var _0x1cf823=_0x418e8f[_0x71bd('0x37')];var _0x58a818=_0x418e8f['sidebar']?_0x418e8f[_0x71bd('0x83')]:_0x71bd('0x84');var _0x2eb674=_0x418e8f[_0x71bd('0x85')]?_0x418e8f[_0x71bd('0x85')]:_0x71bd('0x86');var _0x459368='';var _0x9d3e1a='';var _0x2fcc3d='';var _0x2fda5a='';var _0x64f9d8=_0x418e8f[_0x71bd('0x76')];if(_0x1cf823===_0x71bd('0x87')){if(_0x71bd('0x22')!=typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')][_0x71bd('0x7c')]){var _0x2e48fe=_0x418e8f['parameters'][_0x71bd('0x7a')][_0x71bd('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x71bd('0x88')](_0x2e48fe)){_0x459368=path[_0x71bd('0x50')](_0x71bd('0x89'),_0x4cf090,_0x1098c2[0x0],_0x2e48fe);}else{_0x459368=_0x2e48fe;}}else{logger[_0x71bd('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x71bd('0x22')!=typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')]['agent']){var _0x5bdb09=_0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')][_0x71bd('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x71bd('0x88')](_0x5bdb09)){_0x9d3e1a=path['join'](_0x71bd('0x89'),_0x4cf090,_0x1098c2[0x0],_0x5bdb09);}else{_0x9d3e1a=_0x5bdb09;}}else{logger[_0x71bd('0x67')](_0x71bd('0x8a'));}}else if(_0x1cf823==='script'){_0x2fcc3d=_0x418e8f[_0x71bd('0x78')][_0x71bd('0x8b')];_0x2fda5a=_0x418e8f[_0x71bd('0x78')]['scriptPath'];if(_0x71bd('0x22')!=typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')]){if('undefined'!=typeof _0x418e8f[_0x71bd('0x78')]['views'][_0x71bd('0x7c')]){var _0x2e48fe=_0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')][_0x71bd('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x71bd('0x88')](_0x2e48fe)){_0x459368=path[_0x71bd('0x50')](_0x71bd('0x89'),_0x4cf090,_0x1098c2[0x0],_0x2e48fe);}else{_0x459368=_0x2e48fe;}}if('undefined'!=typeof _0x418e8f[_0x71bd('0x78')][_0x71bd('0x7a')]['agent']){var _0x5bdb09=_0x418e8f['parameters'][_0x71bd('0x7a')][_0x71bd('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x71bd('0x88')](_0x5bdb09)){_0x9d3e1a=path[_0x71bd('0x50')](_0x71bd('0x89'),_0x4cf090,_0x1098c2[0x0],_0x5bdb09);}else{_0x9d3e1a=_0x5bdb09;}}}}var _0x3490ae={'name':_0x338fb4,'description':_0x29670b,'path':path[_0x71bd('0x50')](_0x4cf090,_0x1098c2[0x0]),'type':_0x1cf823,'sidebar':_0x58a818,'icon':_0x2eb674,'adminUrl':_0x459368,'agentUrl':_0x9d3e1a,'scriptName':_0x2fcc3d,'scriptPath':_0x2fda5a,'version':_0x64f9d8};removeReferences(_0x2e72ed,null);return db['Plugin'][_0x71bd('0x8c')](_0x3490ae)[_0x71bd('0x2b')](function(_0x291d9d){var _0x2c77af={'role':_0x281802[_0x71bd('0x8d')][_0x71bd('0x8e')],'userProfileId':_0x281802[_0x71bd('0x8d')]['userProfileId']};if(!_0x2c77af)throw new Error(_0x71bd('0x8f'));if(_0x2c77af[_0x71bd('0x8e')]==='user'){var _0x42e156=_0x291d9d[_0x71bd('0x90')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x2c77af[_0x71bd('0x91')]},'raw':!![]})[_0x71bd('0x2b')](function(_0x3ea4f0){if(_0x3ea4f0&&_0x3ea4f0[_0x71bd('0x92')]===0x0){return db[_0x71bd('0x2d')][_0x71bd('0x8c')]({'name':_0x42e156[_0x71bd('0x32')],'resourceId':_0x42e156['id'],'type':_0x3ea4f0['name'],'sectionId':_0x3ea4f0['id']},{})[_0x71bd('0x2b')](function(){return _0x291d9d;});}else{return _0x291d9d;}})[_0x71bd('0x4b')](function(_0x366399){logger['error'](_0x71bd('0x93'),_0x366399);throw _0x366399;});}return _0x291d9d;})[_0x71bd('0x2b')](respondWithResult(_0x409f57,null))[_0x71bd('0x4b')](handleError(_0x409f57,null));}});}catch(_0x3b65ad){_0x409f57[_0x71bd('0x1f')](0x1f4)[_0x71bd('0x94')](_0x3b65ad);}};function removeReferences(_0x340330,_0x4a7c87){try{if(_0x340330){fs[_0x71bd('0x65')](_0x340330);logger[_0x71bd('0x67')](_0x71bd('0x95'));}if(_0x4a7c87){rimraf(_0x4a7c87,function(){});logger[_0x71bd('0x67')](_0x71bd('0x96'));}}catch(_0x600654){logger[_0x71bd('0x30')](_0x600654);}}exports[_0x71bd('0x2a')]=function(_0x484b4a,_0x4ba943,_0x2a5afa){return db[_0x71bd('0x34')]['find']({'where':{'id':_0x484b4a[_0x71bd('0x4d')]['id']}})[_0x71bd('0x2b')](handleEntityNotFound(_0x4ba943,null))[_0x71bd('0x2b')](saveUpdates(_0x484b4a[_0x71bd('0x8d')],null))['then'](respondWithResult(_0x4ba943,null))[_0x71bd('0x4b')](handleError(_0x4ba943,null));};exports[_0x71bd('0x97')]=function(_0xe1d75,_0x21a76c,_0x2d56e2){return db[_0x71bd('0x34')]['find']({'where':{'id':_0xe1d75[_0x71bd('0x4d')]['id']}})[_0x71bd('0x2b')](function(_0x4a286b){if(_0x4a286b){return _0x4a286b[_0x71bd('0x2c')]();}})['then'](function(_0x38fec8){rimraf(path[_0x71bd('0x50')](config['root'],_0x71bd('0x52'),path[_0x71bd('0x98')](_0x38fec8[_0x71bd('0x4')])),function(){});return _0x38fec8;})[_0x71bd('0x2b')](handleEntityNotFound(_0x21a76c,null))[_0x71bd('0x2b')](respondWithStatusCode(_0x21a76c,null))[_0x71bd('0x4b')](handleError(_0x21a76c,null));};exports[_0x71bd('0x99')]=function(_0x100b4f,_0x4707c0,_0xd3da11){return BPromise[_0x71bd('0x9a')]()['then'](function(){if(!_0x100b4f[_0x71bd('0x39')][_0x71bd('0x4')]){throw new Error(_0x71bd('0x9b'));}if(!_0x100b4f[_0x71bd('0x39')][_0x71bd('0x9c')]){throw new Error(_0x71bd('0x9d'));}var _0xe12fa9=_0x100b4f[_0x71bd('0x39')][_0x71bd('0x9e')]?_0x100b4f[_0x71bd('0x39')]['hostname']+':'+_0x100b4f[_0x71bd('0x39')][_0x71bd('0x9c')]:_0x71bd('0x9f')+_0x100b4f['query'][_0x71bd('0x9c')];var _0xb72bff=_0x100b4f[_0x71bd('0x39')][_0x71bd('0x20')]?_0x100b4f[_0x71bd('0x39')]['json']:!![];var _0x27b50a=_0x100b4f['query']['encoding']?_0x100b4f[_0x71bd('0x39')][_0x71bd('0xa0')]:null;var _0x243655={'method':_0x100b4f['method'],'uri':util[_0x71bd('0x53')](_0x71bd('0xa1'),_0xe12fa9,_0x100b4f[_0x71bd('0x39')][_0x71bd('0x4')]),'json':_0xb72bff,'resolveWithFullResponse':!![],'encoding':_0x27b50a,'qs':_0x100b4f[_0x71bd('0x39')]};if(_0x100b4f[_0x71bd('0xa2')]){_0x243655[_0x71bd('0xa2')]=_0x100b4f[_0x71bd('0xa2')];if(_0x243655[_0x71bd('0xa2')]['content-length']){delete _0x243655['headers'][_0x71bd('0xa3')];}}if(_0x243655[_0x71bd('0xa2')][_0x71bd('0xa4')]){delete _0x243655[_0x71bd('0xa2')][_0x71bd('0xa4')];}return rp(_0x243655);})[_0x71bd('0x2b')](function(_0x10a454){if(_0x10a454){_0x4707c0[_0x71bd('0x25')](_0x10a454[_0x71bd('0xa2')]);logger['info'](_0x10a454[_0x71bd('0x8d')]);if(_['endsWith'](_0x100b4f[_0x71bd('0x39')]['path'],_0x71bd('0x63'))&&_0x10a454[_0x71bd('0xa5')]==0x1f4){return _0x4707c0[_0x71bd('0x2f')](_0x10a454[_0x71bd('0xa5')]);}else{return _0x4707c0['status'](_0x10a454[_0x71bd('0xa5')])[_0x71bd('0x94')](_0x10a454[_0x71bd('0x8d')]);}}else{return _0x4707c0[_0x71bd('0x2f')](0xc8);}})[_0x71bd('0x4b')](handleError(_0x4707c0,null));};exports['webhookPost']=function(_0x1a0288,_0x38073f,_0x11f19b){return BPromise[_0x71bd('0x9a')]()['then'](function(){if(!_0x1a0288['query'][_0x71bd('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1a0288[_0x71bd('0x39')][_0x71bd('0x9c')]){throw new Error(_0x71bd('0x9d'));}var _0x5942fb=_0x1a0288[_0x71bd('0x39')][_0x71bd('0x9e')]?_0x1a0288['query'][_0x71bd('0x9e')]+':'+_0x1a0288['query']['port']:_0x71bd('0x9f')+_0x1a0288[_0x71bd('0x39')][_0x71bd('0x9c')];var _0x5096bd=_0x1a0288['query'][_0x71bd('0x20')]?_0x1a0288[_0x71bd('0x39')]['json']:!![];var _0x24600c=_0x1a0288[_0x71bd('0x39')][_0x71bd('0xa0')]?_0x1a0288[_0x71bd('0x39')]['encoding']:null;var _0x3a7564={'method':_0x1a0288[_0x71bd('0xa6')],'uri':util[_0x71bd('0x53')]('%s%s',_0x5942fb,_0x1a0288[_0x71bd('0x39')][_0x71bd('0x4')]),'json':_0x5096bd,'resolveWithFullResponse':!![],'encoding':_0x24600c,'body':_0x1a0288['body']};if(_0x1a0288[_0x71bd('0xa2')]){_0x3a7564[_0x71bd('0xa2')]=_0x1a0288[_0x71bd('0xa2')];if(_0x3a7564[_0x71bd('0xa2')][_0x71bd('0xa3')]){delete _0x3a7564[_0x71bd('0xa2')]['content-length'];}}if(_0x3a7564['headers']['content-type']){delete _0x3a7564['headers']['content-type'];}return rp(_0x3a7564);})[_0x71bd('0x2b')](function(_0x51cea5){if(_0x51cea5){_0x38073f[_0x71bd('0x25')](_0x51cea5[_0x71bd('0xa2')]);logger[_0x71bd('0x67')](_0x51cea5[_0x71bd('0x8d')]);return _0x38073f[_0x71bd('0x1f')](_0x51cea5[_0x71bd('0xa5')])[_0x71bd('0x94')](_0x51cea5[_0x71bd('0x8d')]);}else{return _0x38073f[_0x71bd('0x2f')](0xc8);}})['catch'](handleError(_0x38073f,null));}; \ No newline at end of file +var _0x195f=['./plugin.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','download','join','root','server/files/plugins','%s.zip','basename','path','createWriteStream','zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x195f,0x95));var _0xf195=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x195f[_0x4287b6];return _0x5a4f7e;};'use strict';var emlformat=require(_0xf195('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf195('0x1'));var jsonpatch=require(_0xf195('0x2'));var rp=require(_0xf195('0x3'));var moment=require(_0xf195('0x4'));var BPromise=require(_0xf195('0x5'));var Mustache=require(_0xf195('0x6'));var util=require(_0xf195('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf195('0x8'));var ejs=require(_0xf195('0x9'));var fs=require('fs');var fs_extra=require(_0xf195('0xa'));var _=require(_0xf195('0xb'));var squel=require(_0xf195('0xc'));var crypto=require(_0xf195('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf195('0x8'));var querystring=require('querystring');var Papa=require(_0xf195('0xe'));var extract=require(_0xf195('0xf'));var rimraf=require(_0xf195('0x10'));var archiver=require(_0xf195('0x11'));var Redis=require('ioredis');var authService=require(_0xf195('0x12'));var qs=require(_0xf195('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf195('0x14'))(_0xf195('0x15'));var utils=require('../../config/utils');var config=require(_0xf195('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf195('0x17'))['db'];config[_0xf195('0x18')]=_[_0xf195('0x19')](config[_0xf195('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf195('0x18')]));require(_0xf195('0x1a'))['register'](socket);function respondWithStatusCode(_0x32cf14,_0x5c868){_0x5c868=_0x5c868||0xcc;return function(_0x5b57e6){if(_0x5b57e6){return _0x32cf14[_0xf195('0x1b')](_0x5c868);}return _0x32cf14[_0xf195('0x1c')](_0x5c868)[_0xf195('0x1d')]();};}function respondWithResult(_0x22af89,_0x465ea0){_0x465ea0=_0x465ea0||0xc8;return function(_0x69f444){if(_0x69f444){return _0x22af89['status'](_0x465ea0)[_0xf195('0x1e')](_0x69f444);}};}function respondWithFilteredResult(_0x561fb0,_0x31a4eb){return function(_0x446557){if(_0x446557){var _0x3fc86e=typeof _0x31a4eb[_0xf195('0x1f')]===_0xf195('0x20')&&typeof _0x31a4eb[_0xf195('0x21')]===_0xf195('0x20');var _0xcfbfa3=_0x446557[_0xf195('0x22')];var _0x52524b=_0x3fc86e?0x0:_0x31a4eb['offset'];var _0x236c50=_0x3fc86e?_0x446557[_0xf195('0x22')]:_0x31a4eb[_0xf195('0x1f')]+_0x31a4eb[_0xf195('0x21')];var _0x40db7c;if(_0x236c50>=_0xcfbfa3){_0x236c50=_0xcfbfa3;_0x40db7c=0xc8;}else{_0x40db7c=0xce;}_0x561fb0[_0xf195('0x1c')](_0x40db7c);return _0x561fb0[_0xf195('0x23')](_0xf195('0x24'),_0x52524b+'-'+_0x236c50+'/'+_0xcfbfa3)[_0xf195('0x1e')](_0x446557);}return null;};}function patchUpdates(_0x31832e){return function(_0x4e02e0){try{jsonpatch[_0xf195('0x25')](_0x4e02e0,_0x31832e,!![]);}catch(_0x17dd42){return BPromise['reject'](_0x17dd42);}return _0x4e02e0[_0xf195('0x26')]();};}function saveUpdates(_0x87f85c,_0x6efe7){return function(_0xe132c3){if(_0xe132c3){return _0xe132c3[_0xf195('0x27')](_0x87f85c)[_0xf195('0x28')](function(_0x416ff8){return _0x416ff8;});}return null;};}function removeEntity(_0x59066e,_0x36b136){return function(_0x1cba24){if(_0x1cba24){return _0x1cba24[_0xf195('0x29')]()[_0xf195('0x28')](function(){var _0x5df28f=_0x1cba24[_0xf195('0x2a')]({'plain':!![]});var _0xdde361='Plugins';return db[_0xf195('0x2b')][_0xf195('0x29')]({'where':{'type':_0xdde361,'resourceId':_0x5df28f['id']}})[_0xf195('0x28')](function(){return _0x1cba24;});})['then'](function(){_0x59066e[_0xf195('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1c6c,_0xced5e2){return function(_0x1b2e27){if(!_0x1b2e27){_0x3a1c6c[_0xf195('0x1b')](0x194);}return _0x1b2e27;};}function handleError(_0x3b7307,_0xc5f170){_0xc5f170=_0xc5f170||0x1f4;return function(_0x5c1429){logger[_0xf195('0x2c')](_0x5c1429[_0xf195('0x2d')]);if(_0x5c1429[_0xf195('0x2e')]){delete _0x5c1429['name'];}_0x3b7307[_0xf195('0x1c')](_0xc5f170)[_0xf195('0x2f')](_0x5c1429);};}exports[_0xf195('0x30')]=function(_0x39409e,_0x531a14){var _0x5e82c1={},_0x522b93={},_0x154bc5={'count':0x0,'rows':[]};var _0xcb3757=_['map'](db[_0xf195('0x31')][_0xf195('0x32')],function(_0x48d4ff){return{'name':_0x48d4ff['fieldName'],'type':_0x48d4ff[_0xf195('0x33')][_0xf195('0x34')]};});_0x522b93[_0xf195('0x35')]=_[_0xf195('0x36')](_0xcb3757,_0xf195('0x2e'));_0x522b93[_0xf195('0x37')]=_[_0xf195('0x38')](_0x39409e[_0xf195('0x37')]);_0x522b93[_0xf195('0x39')]=_[_0xf195('0x3a')](_0x522b93[_0xf195('0x35')],_0x522b93[_0xf195('0x37')]);_0x5e82c1['attributes']=_[_0xf195('0x3a')](_0x522b93[_0xf195('0x35')],qs['fields'](_0x39409e['query'][_0xf195('0x3b')]));_0x5e82c1['attributes']=_0x5e82c1['attributes']['length']?_0x5e82c1[_0xf195('0x3c')]:_0x522b93[_0xf195('0x35')];if(!_0x39409e['query']['hasOwnProperty'](_0xf195('0x3d'))){_0x5e82c1[_0xf195('0x21')]=qs[_0xf195('0x21')](_0x39409e['query'][_0xf195('0x21')]);_0x5e82c1[_0xf195('0x1f')]=qs[_0xf195('0x1f')](_0x39409e[_0xf195('0x37')]['offset']);}_0x5e82c1[_0xf195('0x3e')]=qs[_0xf195('0x3f')](_0x39409e[_0xf195('0x37')][_0xf195('0x3f')]);_0x5e82c1[_0xf195('0x40')]=qs[_0xf195('0x39')](_[_0xf195('0x41')](_0x39409e[_0xf195('0x37')],_0x522b93[_0xf195('0x39')]),_0xcb3757);if(_0x39409e[_0xf195('0x37')][_0xf195('0x42')]){_0x5e82c1[_0xf195('0x40')]=_[_0xf195('0x43')](_0x5e82c1[_0xf195('0x40')],{'$or':_[_0xf195('0x36')](_0xcb3757,function(_0x50446f){if(_0x50446f[_0xf195('0x33')]!=='VIRTUAL'){var _0x516416={};_0x516416[_0x50446f['name']]={'$like':'%'+_0x39409e[_0xf195('0x37')][_0xf195('0x42')]+'%'};return _0x516416;}})});}_0x5e82c1=_[_0xf195('0x43')]({},_0x5e82c1,_0x39409e[_0xf195('0x44')]);var _0x31c49c={'where':_0x5e82c1[_0xf195('0x40')]};return db[_0xf195('0x31')][_0xf195('0x22')](_0x31c49c)[_0xf195('0x28')](function(_0x242bb5){_0x154bc5[_0xf195('0x22')]=_0x242bb5;if(_0x39409e[_0xf195('0x37')]['includeAll']){_0x5e82c1[_0xf195('0x45')]=[{'all':!![]}];}return db[_0xf195('0x31')]['findAll'](_0x5e82c1);})[_0xf195('0x28')](function(_0x3abd54){_0x154bc5[_0xf195('0x46')]=_0x3abd54;return _0x154bc5;})['then'](respondWithFilteredResult(_0x531a14,_0x5e82c1))[_0xf195('0x47')](handleError(_0x531a14,null));};exports[_0xf195('0x48')]=function(_0x5e21f8,_0x4f5391){var _0x9b0858={'raw':!![],'where':{'id':_0x5e21f8[_0xf195('0x49')]['id']}},_0xce3a61={};_0xce3a61[_0xf195('0x35')]=_[_0xf195('0x38')](db[_0xf195('0x31')][_0xf195('0x32')]);_0xce3a61[_0xf195('0x37')]=_['keys'](_0x5e21f8[_0xf195('0x37')]);_0xce3a61['filters']=_[_0xf195('0x3a')](_0xce3a61['model'],_0xce3a61[_0xf195('0x37')]);_0x9b0858[_0xf195('0x3c')]=_[_0xf195('0x3a')](_0xce3a61[_0xf195('0x35')],qs[_0xf195('0x3b')](_0x5e21f8[_0xf195('0x37')]['fields']));_0x9b0858['attributes']=_0x9b0858[_0xf195('0x3c')][_0xf195('0x4a')]?_0x9b0858[_0xf195('0x3c')]:_0xce3a61['model'];if(_0x5e21f8[_0xf195('0x37')][_0xf195('0x4b')]){_0x9b0858[_0xf195('0x45')]=[{'all':!![]}];}_0x9b0858=_['merge']({},_0x9b0858,_0x5e21f8['options']);return db[_0xf195('0x31')][_0xf195('0x4c')](_0x9b0858)['then'](handleEntityNotFound(_0x4f5391,null))[_0xf195('0x28')](respondWithResult(_0x4f5391,null))[_0xf195('0x47')](handleError(_0x4f5391,null));};exports[_0xf195('0x4d')]=function(_0x35471e,_0x1e7248,_0x44fa33){return db[_0xf195('0x31')]['find']({'where':{'id':_0x35471e['params']['id']},'attributes':[_0xf195('0x2e'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x1e7248,null))[_0xf195('0x28')](function(_0x2a84d9){if(_0x2a84d9){var _0x376967=path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),util['format'](_0xf195('0x51'),path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')])));var _0x49e37d=fs[_0xf195('0x54')](_0x376967);var _0x3daff4=archiver(_0xf195('0x55'),{'zlib':{'level':0x9}});_0x3daff4['on']('warning',function(_0x15e5a3){if(_0x15e5a3[_0xf195('0x56')]===_0xf195('0x57')){logger[_0xf195('0x2c')](_0x15e5a3);}else{throw new db[(_0xf195('0x58'))]['Error'](_0xf195('0x59'));}});_0x3daff4['on']('error',function(_0x1b0ce7){throw new db[(_0xf195('0x58'))][(_0xf195('0x5a'))](_0xf195('0x59'));});_0x3daff4[_0xf195('0x5b')](_0x49e37d);_0x3daff4[_0xf195('0x5c')](_0xf195('0x5d'),{'cwd':path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),path[_0xf195('0x5e')](_0x2a84d9[_0xf195('0x53')])),'ignore':[path[_0xf195('0x4e')](path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')]),_0xf195('0x5f')),path[_0xf195('0x4e')](path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')]),_0xf195('0x60'))],'nodir':!![]})[_0xf195('0x61')]();_0x49e37d['on'](_0xf195('0x62'),function(){if(!fs[_0xf195('0x63')](_0x376967)){throw new db['Sequelize'][(_0xf195('0x5a'))](_0xf195('0x64'));}return _0x1e7248['download'](_0x376967,util[_0xf195('0x65')](_0xf195('0x51'),path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')])),function(_0x490db7){if(_0x490db7){throw new db[(_0xf195('0x58'))][(_0xf195('0x5a'))](_0xf195('0x66'));}fs['unlinkSync'](_0x376967);logger['info'](_0xf195('0x67'));logger[_0xf195('0x68')](_0xf195('0x69'));});});}return null;})[_0xf195('0x47')](handleError(_0x1e7248,null));};exports[_0xf195('0x6a')]=function(_0x32fcc4,_0xc6bb4d,_0x2d95bd){var _0x250f78=path[_0xf195('0x52')](_0x32fcc4['file'][_0xf195('0x6b')],path[_0xf195('0x6c')](_0x32fcc4[_0xf195('0x6d')][_0xf195('0x6b')]));var _0x104d86=path['join'](config['root'],_0xf195('0x50'),_0x32fcc4[_0xf195('0x6d')][_0xf195('0x6b')]);var _0xf68335=path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),_0x250f78);logger[_0xf195('0x68')](_0xf195('0x6e'),_0x104d86);logger[_0xf195('0x68')](_0xf195('0x6f'),_0xf68335);try{fs[_0xf195('0x70')](_0x104d86,parseInt(_0xf195('0x71'),0x8));extract(_0x104d86,{'dir':_0xf68335},function(_0x42314b){if(_0x42314b){logger['error'](_0x42314b);handleError(_0x42314b,!![]);};var _0x4a9864=fs[_0xf195('0x72')](_0xf68335);if(_0x4a9864[_0xf195('0x4a')]>0x1){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}var _0xb686f0=fs[_0xf195('0x74')](path['join'](_0xf68335,_0x4a9864[0x0]));if(_0xb686f0[_0xf195('0x75')]()){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}if(_0xb686f0[_0xf195('0x76')]()){var _0x3ce282=fs[_0xf195('0x72')](path[_0xf195('0x4e')](_0xf68335,_0x4a9864[0x0]));if(_0x3ce282['length']===0x0){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}var _0x51c29f=_0x3ce282[_0xf195('0x77')](function(_0x3135d9){return _0x3135d9===_0xf195('0x78');});if(!_0x51c29f){return _0x2d95bd(new Error(_0xf195('0x79')));}var _0x4f9bfb=fs[_0xf195('0x7a')](path[_0xf195('0x4e')](_0xf68335,_0x4a9864[0x0],'manifest.json'));var _0x4fe521=JSON['parse'](_0x4f9bfb);if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x2e')]){return _0x2d95bd(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x33')]){return _0x2d95bd(new Error(_0xf195('0x7b')));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7c')]){return _0x2d95bd(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]){return _0x2d95bd(new Error(_0xf195('0x7e')));}if(_0x4fe521[_0xf195('0x33')]===_0xf195('0x7f')){if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')]){return _0x2d95bd(new Error(_0xf195('0x81')));}if('undefined'==typeof _0x4fe521[_0xf195('0x7d')]['views']['admin']&&_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]['views']['agent']){return _0x2d95bd(new Error(_0xf195('0x82')));}}else if(_0x4fe521[_0xf195('0x33')]===_0xf195('0x83')){if(_0xf195('0x20')==typeof _0x4fe521['parameters'][_0xf195('0x84')]){return _0x2d95bd(new Error(_0xf195('0x85')));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]['scriptPath']){return _0x2d95bd(new Error(_0xf195('0x86')));}}else{return _0x2d95bd(new Error(_0xf195('0x87')));}var _0x373821=_0x4fe521['name'];var _0x28f114=_0x4fe521[_0xf195('0x88')];var _0x5bce85=_0x4fe521[_0xf195('0x33')];var _0x200198=_0x4fe521['sidebar']?_0x4fe521['sidebar']:_0xf195('0x89');var _0x4e5231=_0x4fe521[_0xf195('0x8a')]?_0x4fe521['icon']:_0xf195('0x8b');var _0x167822='';var _0x52deb0='';var _0x401324='';var _0x42bb6b='';var _0x8b3281=_0x4fe521[_0xf195('0x7c')];if(_0x5bce85===_0xf195('0x7f')){if(_0xf195('0x20')!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')]){var _0x1be70b=_0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x1be70b)){_0x167822=path[_0xf195('0x4e')](_0xf195('0x8e'),_0x250f78,_0x4a9864[0x0],_0x1be70b);}else{_0x167822=_0x1be70b;}}else{logger[_0xf195('0x68')](_0xf195('0x8f'));}if(_0xf195('0x20')!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x90')]){var _0x282320=_0x4fe521['parameters'][_0xf195('0x80')][_0xf195('0x90')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x282320)){_0x52deb0=path[_0xf195('0x4e')](_0xf195('0x8e'),_0x250f78,_0x4a9864[0x0],_0x282320);}else{_0x52deb0=_0x282320;}}else{logger[_0xf195('0x68')](_0xf195('0x91'));}}else if(_0x5bce85===_0xf195('0x83')){_0x401324=_0x4fe521['parameters'][_0xf195('0x84')];_0x42bb6b=_0x4fe521['parameters']['scriptPath'];if('undefined'!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')]){if(_0xf195('0x20')!=typeof _0x4fe521['parameters']['views']['admin']){var _0x1be70b=_0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x1be70b)){_0x167822=path['join']('plugins',_0x250f78,_0x4a9864[0x0],_0x1be70b);}else{_0x167822=_0x1be70b;}}if('undefined'!=typeof _0x4fe521['parameters']['views'][_0xf195('0x90')]){var _0x282320=_0x4fe521['parameters'][_0xf195('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x282320)){_0x52deb0=path[_0xf195('0x4e')]('plugins',_0x250f78,_0x4a9864[0x0],_0x282320);}else{_0x52deb0=_0x282320;}}}}var _0x35c0dd={'name':_0x373821,'description':_0x28f114,'path':path[_0xf195('0x4e')](_0x250f78,_0x4a9864[0x0]),'type':_0x5bce85,'sidebar':_0x200198,'icon':_0x4e5231,'adminUrl':_0x167822,'agentUrl':_0x52deb0,'scriptName':_0x401324,'scriptPath':_0x42bb6b,'version':_0x8b3281};removeReferences(_0x104d86,null);return db[_0xf195('0x31')][_0xf195('0x92')](_0x35c0dd)[_0xf195('0x28')](function(_0x4e72f2){var _0x1f8cc8={'role':_0x32fcc4['body'][_0xf195('0x93')],'userProfileId':_0x32fcc4[_0xf195('0x94')][_0xf195('0x95')]};if(!_0x1f8cc8)throw new Error(_0xf195('0x96'));if(_0x1f8cc8[_0xf195('0x93')]===_0xf195('0x97')){var _0x4705c3=_0x4e72f2[_0xf195('0x2a')]({'plain':!![]});return db[_0xf195('0x98')][_0xf195('0x4c')]({'where':{'name':_0xf195('0x99'),'userProfileId':_0x1f8cc8[_0xf195('0x95')]},'raw':!![]})[_0xf195('0x28')](function(_0x2a8119){if(_0x2a8119&&_0x2a8119[_0xf195('0x9a')]===0x0){return db[_0xf195('0x2b')][_0xf195('0x92')]({'name':_0x4705c3[_0xf195('0x2e')],'resourceId':_0x4705c3['id'],'type':_0x2a8119[_0xf195('0x2e')],'sectionId':_0x2a8119['id']},{})['then'](function(){return _0x4e72f2;});}else{return _0x4e72f2;}})[_0xf195('0x47')](function(_0xba11a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xba11a9);throw _0xba11a9;});}return _0x4e72f2;})['then'](respondWithResult(_0xc6bb4d,null))[_0xf195('0x47')](handleError(_0xc6bb4d,null));}});}catch(_0x567f54){_0xc6bb4d['status'](0x1f4)['send'](_0x567f54);}};function removeReferences(_0x598f58,_0x5d1430){try{if(_0x598f58){fs[_0xf195('0x9b')](_0x598f58);logger[_0xf195('0x68')](_0xf195('0x9c'));}if(_0x5d1430){rimraf(_0x5d1430,function(){});logger[_0xf195('0x68')](_0xf195('0x9d'));}}catch(_0x499a29){logger[_0xf195('0x2c')](_0x499a29);}}exports[_0xf195('0x27')]=function(_0xe3c218,_0x2261e4,_0x5a5f2d){return db[_0xf195('0x31')][_0xf195('0x4c')]({'where':{'id':_0xe3c218[_0xf195('0x49')]['id']}})[_0xf195('0x28')](handleEntityNotFound(_0x2261e4,null))[_0xf195('0x28')](saveUpdates(_0xe3c218[_0xf195('0x94')],null))[_0xf195('0x28')](respondWithResult(_0x2261e4,null))[_0xf195('0x47')](handleError(_0x2261e4,null));};exports[_0xf195('0x9e')]=function(_0x523b45,_0x3b3518,_0x6a02f2){return db['Plugin'][_0xf195('0x4c')]({'where':{'id':_0x523b45[_0xf195('0x49')]['id']}})[_0xf195('0x28')](function(_0x467d19){if(_0x467d19){return _0x467d19[_0xf195('0x29')]();}})[_0xf195('0x28')](function(_0x5e4db5){rimraf(path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),path[_0xf195('0x5e')](_0x5e4db5[_0xf195('0x53')])),function(){});return _0x5e4db5;})['then'](handleEntityNotFound(_0x3b3518,null))[_0xf195('0x28')](respondWithStatusCode(_0x3b3518,null))[_0xf195('0x47')](handleError(_0x3b3518,null));};exports[_0xf195('0x9f')]=function(_0x38b74e,_0x5d7964,_0x25020f){return BPromise[_0xf195('0xa0')]()[_0xf195('0x28')](function(){if(!_0x38b74e[_0xf195('0x37')][_0xf195('0x53')]){throw new Error(_0xf195('0xa1'));}if(!_0x38b74e[_0xf195('0x37')][_0xf195('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1a047a=_0x38b74e[_0xf195('0x37')]['hostname']?_0x38b74e['query'][_0xf195('0xa3')]+':'+_0x38b74e['query'][_0xf195('0xa2')]:'http://localhost:'+_0x38b74e[_0xf195('0x37')][_0xf195('0xa2')];var _0x5efb30=_0x38b74e[_0xf195('0x37')][_0xf195('0x1e')]?_0x38b74e[_0xf195('0x37')]['json']:!![];var _0x515f5d=_0x38b74e[_0xf195('0x37')][_0xf195('0xa4')]?_0x38b74e[_0xf195('0x37')][_0xf195('0xa4')]:null;var _0x5cb3ac={'method':_0x38b74e['method'],'uri':util[_0xf195('0x65')](_0xf195('0xa5'),_0x1a047a,_0x38b74e[_0xf195('0x37')][_0xf195('0x53')]),'json':_0x5efb30,'resolveWithFullResponse':!![],'encoding':_0x515f5d,'qs':_0x38b74e[_0xf195('0x37')]};if(_0x38b74e[_0xf195('0xa6')]){_0x5cb3ac[_0xf195('0xa6')]=_0x38b74e['headers'];if(_0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa7')]){delete _0x5cb3ac['headers'][_0xf195('0xa7')];}}if(_0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa8')]){delete _0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa8')];}return rp(_0x5cb3ac);})[_0xf195('0x28')](function(_0x5a3aee){if(_0x5a3aee){_0x5d7964[_0xf195('0x23')](_0x5a3aee['headers']);logger[_0xf195('0x68')](_0x5a3aee[_0xf195('0x94')]);if(_[_0xf195('0xa9')](_0x38b74e[_0xf195('0x37')]['path'],_0xf195('0x4d'))&&_0x5a3aee[_0xf195('0xaa')]==0x1f4){return _0x5d7964[_0xf195('0x1b')](_0x5a3aee[_0xf195('0xaa')]);}else{return _0x5d7964[_0xf195('0x1c')](_0x5a3aee[_0xf195('0xaa')])[_0xf195('0x2f')](_0x5a3aee['body']);}}else{return _0x5d7964['sendStatus'](0xc8);}})[_0xf195('0x47')](handleError(_0x5d7964,null));};exports[_0xf195('0xab')]=function(_0xb43d2c,_0x5aa843,_0x16e694){return BPromise[_0xf195('0xa0')]()['then'](function(){if(!_0xb43d2c['query'][_0xf195('0x53')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')]){throw new Error(_0xf195('0xac'));}var _0xf4d2ee=_0xb43d2c[_0xf195('0x37')]['hostname']?_0xb43d2c[_0xf195('0x37')][_0xf195('0xa3')]+':'+_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')]:_0xf195('0xad')+_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')];var _0x2b573b=_0xb43d2c[_0xf195('0x37')][_0xf195('0x1e')]?_0xb43d2c[_0xf195('0x37')][_0xf195('0x1e')]:!![];var _0xc4653f=_0xb43d2c['query']['encoding']?_0xb43d2c[_0xf195('0x37')][_0xf195('0xa4')]:null;var _0x52774e={'method':_0xb43d2c[_0xf195('0xae')],'uri':util['format'](_0xf195('0xa5'),_0xf4d2ee,_0xb43d2c['query'][_0xf195('0x53')]),'json':_0x2b573b,'resolveWithFullResponse':!![],'encoding':_0xc4653f,'body':_0xb43d2c[_0xf195('0x94')]};if(_0xb43d2c[_0xf195('0xa6')]){_0x52774e[_0xf195('0xa6')]=_0xb43d2c['headers'];if(_0x52774e['headers'][_0xf195('0xa7')]){delete _0x52774e[_0xf195('0xa6')][_0xf195('0xa7')];}}if(_0x52774e[_0xf195('0xa6')][_0xf195('0xa8')]){delete _0x52774e[_0xf195('0xa6')][_0xf195('0xa8')];}return rp(_0x52774e);})[_0xf195('0x28')](function(_0x105216){if(_0x105216){_0x5aa843[_0xf195('0x23')](_0x105216['headers']);logger[_0xf195('0x68')](_0x105216['body']);return _0x5aa843[_0xf195('0x1c')](_0x105216['statusCode'])['send'](_0x105216['body']);}else{return _0x5aa843['sendStatus'](0xc8);}})['catch'](handleError(_0x5aa843,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 18e38a6..3f34bfb 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 _0xe2bc=['save','update','remove','emit','hasOwnProperty','hook','events','Plugin'];(function(_0x6f002d,_0x36e6ed){var _0x32d62a=function(_0x459f43){while(--_0x459f43){_0x6f002d['push'](_0x6f002d['shift']());}};_0x32d62a(++_0x36e6ed);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe2bc[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require(_0xce2b('0x0'));var Plugin=require('../../mysqldb')['db'][_0xce2b('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce2b('0x2'),'afterUpdate':_0xce2b('0x3'),'afterDestroy':_0xce2b('0x4')};function emitEvent(_0x231ea2){return function(_0x3f7887,_0x5af322,_0x29382b){PluginEvents[_0xce2b('0x5')](_0x231ea2+':'+_0x3f7887['id'],_0x3f7887);PluginEvents[_0xce2b('0x5')](_0x231ea2,_0x3f7887);_0x29382b(null);};}for(var e in events){if(events[_0xce2b('0x6')](e)){var event=events[e];Plugin[_0xce2b('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xaf5a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','Plugin'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xaf5a,0x116));var _0xaaf5=function(_0x7d0149,_0x1b6d23){_0x7d0149=_0x7d0149-0x0;var _0xaabd78=_0xaf5a[_0x7d0149];return _0xaabd78;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xaaf5('0x0'))['db'][_0xaaf5('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xaaf5('0x2')](0x0);var events={'afterCreate':_0xaaf5('0x3'),'afterUpdate':_0xaaf5('0x4'),'afterDestroy':_0xaaf5('0x5')};function emitEvent(_0x5c55af){return function(_0x1bdf16,_0x4ae9ed,_0x23fbd9){PluginEvents[_0xaaf5('0x6')](_0x5c55af+':'+_0x1bdf16['id'],_0x1bdf16);PluginEvents[_0xaaf5('0x6')](_0x5c55af,_0x1bdf16);_0x23fbd9(null);};}for(var e in events){if(events[_0xaaf5('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0782848..3e0da59 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 _0x9365=['exports','define','plugins','util','../../config/logger','moment','bluebird','request-promise','rimraf','./plugin.attributes'];(function(_0xbde074,_0x243786){var _0x1fb78e=function(_0x3364c2){while(--_0x3364c2){_0xbde074['push'](_0xbde074['shift']());}};_0x1fb78e(++_0x243786);}(_0x9365,0xe9));var _0x5936=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0x9365[_0x3fd50c];return _0x4cebb2;};'use strict';var _=require('lodash');var util=require(_0x5936('0x0'));var logger=require(_0x5936('0x1'))('api');var moment=require(_0x5936('0x2'));var BPromise=require(_0x5936('0x3'));var rp=require(_0x5936('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5936('0x5'));var config=require('../../config/environment');var attributes=require(_0x5936('0x6'));module[_0x5936('0x7')]=function(_0x46ca0e,_0x5196c1){return _0x46ca0e[_0x5936('0x8')]('Plugin',attributes,{'tableName':_0x5936('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5523=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0x5523,0x14e));var _0x3552=function(_0x379a22,_0x20d2c9){_0x379a22=_0x379a22-0x0;var _0x4dd9e2=_0x5523[_0x379a22];return _0x4dd9e2;};'use strict';var _=require(_0x3552('0x0'));var util=require(_0x3552('0x1'));var logger=require(_0x3552('0x2'))('api');var moment=require(_0x3552('0x3'));var BPromise=require(_0x3552('0x4'));var rp=require(_0x3552('0x5'));var fs=require('fs');var path=require(_0x3552('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3552('0x7'));module[_0x3552('0x8')]=function(_0x8f6c76,_0x5134b2){return _0x8f6c76['define'](_0x3552('0x9'),attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 7e4b384..be7de04 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 _0xcb16=['defaults','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x7b3f70,_0x40a34f){var _0x5b247c=function(_0x237cff){while(--_0x237cff){_0x7b3f70['push'](_0x7b3f70['shift']());}};_0x5b247c(++_0x40a34f);}(_0xcb16,0x12e));var _0x6cb1=function(_0x24e37a,_0x25e48f){_0x24e37a=_0x24e37a-0x0;var _0xe18ce7=_0xcb16[_0x24e37a];return _0xe18ce7;};'use strict';var _=require(_0x6cb1('0x0'));var util=require(_0x6cb1('0x1'));var moment=require('moment');var BPromise=require(_0x6cb1('0x2'));var rs=require(_0x6cb1('0x3'));var fs=require('fs');var Redis=require(_0x6cb1('0x4'));var db=require(_0x6cb1('0x5'))['db'];var utils=require(_0x6cb1('0x6'));var logger=require(_0x6cb1('0x7'))('rpc');var config=require(_0x6cb1('0x8'));var jayson=require(_0x6cb1('0x9'));var client=jayson[_0x6cb1('0xa')][_0x6cb1('0xb')]({'port':0x232a});config[_0x6cb1('0xc')]=_[_0x6cb1('0xd')](config[_0x6cb1('0xc')],{'host':_0x6cb1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cb1('0xc')]));require('./plugin.socket')[_0x6cb1('0xf')](socket);function respondWithRpcPromise(_0x1eb7e7,_0x25a292,_0x1a1271){return new BPromise(function(_0x3c1003,_0x5bcacc){return client[_0x6cb1('0x10')](_0x1eb7e7,_0x1a1271)[_0x6cb1('0x11')](function(_0x303d72){logger[_0x6cb1('0x12')](_0x6cb1('0x13'),_0x25a292,_0x6cb1('0x14'));logger[_0x6cb1('0x15')](_0x6cb1('0x16'),_0x25a292,_0x6cb1('0x14'),JSON[_0x6cb1('0x17')](_0x303d72));if(_0x303d72[_0x6cb1('0x18')]){if(_0x303d72[_0x6cb1('0x18')][_0x6cb1('0x19')]===0x1f4){logger['error'](_0x6cb1('0x13'),_0x25a292,_0x303d72[_0x6cb1('0x18')][_0x6cb1('0x1a')]);return _0x5bcacc(_0x303d72[_0x6cb1('0x18')][_0x6cb1('0x1a')]);}logger[_0x6cb1('0x18')](_0x6cb1('0x13'),_0x25a292,_0x303d72[_0x6cb1('0x18')][_0x6cb1('0x1a')]);return _0x3c1003(_0x303d72[_0x6cb1('0x18')]['message']);}else{logger['info'](_0x6cb1('0x13'),_0x25a292,'request\x20sent');_0x3c1003(_0x303d72[_0x6cb1('0x1b')]['message']);}})[_0x6cb1('0x1c')](function(_0x7cc8e1){logger[_0x6cb1('0x18')](_0x6cb1('0x13'),_0x25a292,_0x7cc8e1);_0x5bcacc(_0x7cc8e1);});});}exports[_0x6cb1('0x1d')]=function(_0x2d1358){var _0x4b3a21=this;return new Promise(function(_0x181103,_0x44d758){return db[_0x6cb1('0x1e')][_0x6cb1('0x1f')](_0x2d1358[_0x6cb1('0x20')],{'raw':_0x2d1358[_0x6cb1('0x21')]?_0x2d1358[_0x6cb1('0x21')][_0x6cb1('0x22')]===undefined?!![]:![]:!![]})[_0x6cb1('0x11')](function(_0xddf20a){logger[_0x6cb1('0x12')](_0x6cb1('0x1d'),_0x2d1358);logger[_0x6cb1('0x15')](_0x6cb1('0x1d'),_0x2d1358,JSON['stringify'](_0xddf20a));_0x181103(_0xddf20a);})[_0x6cb1('0x1c')](function(_0x3d1e3a){logger[_0x6cb1('0x18')](_0x6cb1('0x1d'),_0x3d1e3a[_0x6cb1('0x1a')],_0x2d1358);_0x44d758(_0x4b3a21[_0x6cb1('0x18')](0x1f4,_0x3d1e3a['message']));});});}; \ No newline at end of file +var _0x54f3=['result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message'];(function(_0x3d3669,_0x1e1ef1){var _0x451afe=function(_0x14c68f){while(--_0x14c68f){_0x3d3669['push'](_0x3d3669['shift']());}};_0x451afe(++_0x1e1ef1);}(_0x54f3,0xdb));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var moment=require(_0x354f('0x2'));var BPromise=require(_0x354f('0x3'));var rs=require(_0x354f('0x4'));var fs=require('fs');var Redis=require(_0x354f('0x5'));var db=require(_0x354f('0x6'))['db'];var utils=require(_0x354f('0x7'));var logger=require('../../config/logger')(_0x354f('0x8'));var config=require(_0x354f('0x9'));var jayson=require(_0x354f('0xa'));var client=jayson['client'][_0x354f('0xb')]({'port':0x232a});config[_0x354f('0xc')]=_['defaults'](config[_0x354f('0xc')],{'host':_0x354f('0xd'),'port':0x18eb});var socket=require(_0x354f('0xe'))(new Redis(config[_0x354f('0xc')]));require(_0x354f('0xf'))[_0x354f('0x10')](socket);function respondWithRpcPromise(_0x29b31c,_0x4cfe49,_0x20f070){return new BPromise(function(_0x271e3a,_0x316a87){return client[_0x354f('0x11')](_0x29b31c,_0x20f070)[_0x354f('0x12')](function(_0x36c831){logger[_0x354f('0x13')]('Plugin,\x20%s,\x20%s',_0x4cfe49,_0x354f('0x14'));logger[_0x354f('0x15')](_0x354f('0x16'),_0x4cfe49,_0x354f('0x14'),JSON['stringify'](_0x36c831));if(_0x36c831[_0x354f('0x17')]){if(_0x36c831[_0x354f('0x17')]['code']===0x1f4){logger[_0x354f('0x17')](_0x354f('0x18'),_0x4cfe49,_0x36c831[_0x354f('0x17')][_0x354f('0x19')]);return _0x316a87(_0x36c831[_0x354f('0x17')]['message']);}logger[_0x354f('0x17')](_0x354f('0x18'),_0x4cfe49,_0x36c831[_0x354f('0x17')]['message']);return _0x271e3a(_0x36c831[_0x354f('0x17')][_0x354f('0x19')]);}else{logger['info'](_0x354f('0x18'),_0x4cfe49,_0x354f('0x14'));_0x271e3a(_0x36c831[_0x354f('0x1a')][_0x354f('0x19')]);}})[_0x354f('0x1b')](function(_0x5f296d){logger['error'](_0x354f('0x18'),_0x4cfe49,_0x5f296d);_0x316a87(_0x5f296d);});});}exports[_0x354f('0x1c')]=function(_0x2f49f7){var _0x3d8db0=this;return new Promise(function(_0x3a7395,_0xeb7eba){return db[_0x354f('0x1d')][_0x354f('0x1e')](_0x2f49f7[_0x354f('0x1f')],{'raw':_0x2f49f7[_0x354f('0x20')]?_0x2f49f7[_0x354f('0x20')][_0x354f('0x21')]===undefined?!![]:![]:!![]})[_0x354f('0x12')](function(_0x417553){logger[_0x354f('0x13')](_0x354f('0x1c'),_0x2f49f7);logger[_0x354f('0x15')](_0x354f('0x1c'),_0x2f49f7,JSON[_0x354f('0x22')](_0x417553));_0x3a7395(_0x417553);})[_0x354f('0x1b')](function(_0x379e8c){logger[_0x354f('0x17')](_0x354f('0x1c'),_0x379e8c[_0x354f('0x19')],_0x2f49f7);_0xeb7eba(_0x3d8db0['error'](0x1f4,_0x379e8c[_0x354f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b0209d3..261c832 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 _0x27bc=['save','emit','removeListener','register','length','plugin:'];(function(_0x1ed9d5,_0x505e2d){var _0x32b882=function(_0x54f793){while(--_0x54f793){_0x1ed9d5['push'](_0x1ed9d5['shift']());}};_0x32b882(++_0x505e2d);}(_0x27bc,0x1a4));var _0xc27b=function(_0x778603,_0xb252d2){_0x778603=_0x778603-0x0;var _0x221328=_0x27bc[_0x778603];return _0x221328;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xc27b('0x0'),'remove','update'];function createListener(_0x40d2e2,_0x1912f3){return function(_0x276c9f){_0x1912f3[_0xc27b('0x1')](_0x40d2e2,_0x276c9f);};}function removeListener(_0x260f0c,_0x1ec263){return function(){PluginEvents[_0xc27b('0x2')](_0x260f0c,_0x1ec263);};}exports[_0xc27b('0x3')]=function(_0x381abb){for(var _0x2c1c2b=0x0,_0x2e6af3=events[_0xc27b('0x4')];_0x2c1c2b<_0x2e6af3;_0x2c1c2b++){var _0xae23c9=events[_0x2c1c2b];var _0x259b0a=createListener(_0xc27b('0x5')+_0xae23c9,_0x381abb);PluginEvents['on'](_0xae23c9,_0x259b0a);}}; \ No newline at end of file +var _0xa812=['emit','removeListener','register','plugin:','./plugin.events','save','update'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0xa812,0x100));var _0x2a81=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa812[_0x82129b];return _0x2ae5dc;};'use strict';var PluginEvents=require(_0x2a81('0x0'));var events=[_0x2a81('0x1'),'remove',_0x2a81('0x2')];function createListener(_0x458f7c,_0x5df04b){return function(_0x318e3a){_0x5df04b[_0x2a81('0x3')](_0x458f7c,_0x318e3a);};}function removeListener(_0x9740e5,_0x5bfcb5){return function(){PluginEvents[_0x2a81('0x4')](_0x9740e5,_0x5bfcb5);};}exports[_0x2a81('0x5')]=function(_0x394c4c){for(var _0x44e3d7=0x0,_0xa36c7a=events['length'];_0x44e3d7<_0xa36c7a;_0x44e3d7++){var _0xd5e781=events[_0x44e3d7];var _0x1e7ccb=createListener(_0x2a81('0x6')+_0xd5e781,_0x394c4c);PluginEvents['on'](_0xd5e781,_0x1e7ccb);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index e850921..bd3fd83 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(_0x505942,_0x1db575){var _0x5dd4af=function(_0xea04ab){while(--_0xea04ab){_0x505942['push'](_0x505942['shift']());}};_0x5dd4af(++_0x1db575);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x36ea93,_0x5abc0d){var _0x5b5b08=function(_0x3cc394){while(--_0x3cc394){_0x36ea93['push'](_0x36ea93['shift']());}};_0x5b5b08(++_0x5abc0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 ce733b6..448a597 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(_0x1b35c7,_0x8ddb6){var _0x224bad=function(_0x58d9e7){while(--_0x58d9e7){_0x1b35c7['push'](_0x1b35c7['shift']());}};_0x224bad(++_0x8ddb6);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4e10bf,_0x559938){_0x4e10bf=_0x4e10bf-0x0;var _0x3c0c88=_0xd2ea[_0x4e10bf];return _0x3c0c88;};'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 _0x55e0=['hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','name','status','send','info','index','then','reject','express','motion2','catch','show','params','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x55e0,0xdc));var _0x055e=function(_0x18afb5,_0x9f0654){_0x18afb5=_0x18afb5-0x0;var _0x2c5a6b=_0x55e0[_0x18afb5];return _0x2c5a6b;};'use strict';var _=require(_0x055e('0x0'));var pm2=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var path=require('path');var exec=require('child_process')[_0x055e('0x4')];var BPromise=require(_0x055e('0x5'));function handleEntityNotFound(_0x33cd7b,_0x2773e4){return function(_0x157473){if(!_0x157473){_0x33cd7b[_0x055e('0x6')](0x194);;}return _0x157473;};}function respondWithResult(_0x490ee1,_0x5239f6){_0x5239f6=_0x5239f6||0xc8;return function(_0x4384ff){if(_0x4384ff){return _0x490ee1['status'](_0x5239f6)[_0x055e('0x7')](_0x4384ff);}return null;};}function handleError(_0x3c4cf,_0x376618){_0x376618=_0x376618||0x1f4;return function(_0x230c32){logger[_0x055e('0x8')](_0x230c32['stack']);if(_0x230c32[_0x055e('0x9')]){delete _0x230c32[_0x055e('0x9')];}_0x3c4cf[_0x055e('0xa')](_0x376618)[_0x055e('0xb')](_0x230c32);};}function execChildProcess(){return new BPromise(function(_0x238068,_0x5237d9){exec('npm\x20install',function(_0x187cce,_0x51c524,_0x3c44b2){logger[_0x055e('0xc')](_0x51c524);logger[_0x055e('0xc')](_0x3c44b2);if(_0x187cce){logger[_0x055e('0x8')](_0x187cce);return _0x5237d9(_0x187cce);}return _0x238068(_0x51c524);});});}exports[_0x055e('0xd')]=function(_0x31c649,_0x236a2b){return pm2['list']()[_0x055e('0xe')](function(_0xb80d83){if(_0xb80d83){var _0x3cfd14=_[_0x055e('0xf')](_0xb80d83,function(_0x222817){return _0x222817['name']===_0x055e('0x10')||_0x222817[_0x055e('0x9')]===_0x055e('0x11');});return{'rows':_0x3cfd14,'count':_0x3cfd14['length']};}return null;})[_0x055e('0xe')](respondWithResult(_0x236a2b,null))[_0x055e('0x12')](handleError(_0x236a2b,null));};exports[_0x055e('0x13')]=function(_0x2bad86,_0x2cc84e){return pm2['describe'](_0x2bad86[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x2cc84e,null))[_0x055e('0xe')](handleEntityNotFound(_0x2cc84e,null))[_0x055e('0x12')](handleError(_0x2cc84e,null));};exports['create']=function(_0x4004ce,_0x3cdd68){if(_0x4004ce['body'][_0x055e('0x9')]&&_0x4004ce[_0x055e('0x15')][_0x055e('0x16')]){var _0x124d86=path[_0x055e('0x17')](__dirname,_0x055e('0x18'),_0x4004ce['body'][_0x055e('0x16')]);var _0x2f0346=process[_0x055e('0x19')]();process['chdir'](path[_0x055e('0x1a')](_0x124d86));return execChildProcess()[_0x055e('0xe')](function(_0x32c64e){process[_0x055e('0x1b')](_0x2f0346);return pm2['start']({'name':_0x4004ce[_0x055e('0x15')]['name'],'script':_0x124d86});})[_0x055e('0xe')](function(_0x42a6aa){pm2[_0x055e('0x1c')]();return _0x42a6aa[0x0];})[_0x055e('0xe')](respondWithResult(_0x3cdd68,0xc9))[_0x055e('0x12')](handleError(_0x3cdd68,null));}else{return _0x3cdd68[_0x055e('0xa')](0x1f4)['send']({'message':_0x055e('0x1d')});}};exports[_0x055e('0x1e')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x15')]['id']){delete _0x2a82f8[_0x055e('0x15')]['id'];}var _0x42f2df={'online':_0x055e('0x1f'),'stopped':'stop'};if(_0x42f2df[_0x055e('0x20')](_0x2a82f8['body'][_0x055e('0xa')])){return pm2[_0x42f2df[_0x2a82f8[_0x055e('0x15')][_0x055e('0xa')]]](_0x2a82f8[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x4b5891,0xc8))['catch'](handleError(_0x4b5891,null));}else{return _0x4b5891[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':_0x055e('0x21')});}};exports[_0x055e('0x22')]=function(_0x36abb2,_0x225c88){if(_0x36abb2[_0x055e('0x15')]['id']){delete _0x36abb2[_0x055e('0x15')]['id'];}if(_0x36abb2['params']['id']){return pm2[_0x055e('0x23')](_0x36abb2[_0x055e('0x14')]['id'])['then'](function(_0xd9298d){pm2[_0x055e('0x1c')]();return _0xd9298d[0x0];})[_0x055e('0xe')](respondWithResult(_0x225c88,null))[_0x055e('0x12')](handleError(_0x225c88,null));}else{return _0x225c88[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 28b628c..c158d8c 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 _0x56b9=['express','Router','../../components/auth/service','./realtime.controller','get','/queues','getQueues'];(function(_0x39f0e9,_0x3762e4){var _0x4d48eb=function(_0x4edbae){while(--_0x4edbae){_0x39f0e9['push'](_0x39f0e9['shift']());}};_0x4d48eb(++_0x3762e4);}(_0x56b9,0x196));var _0x956b=function(_0x4c4840,_0x54e7c4){_0x4c4840=_0x4c4840-0x0;var _0xa747b8=_0x56b9[_0x4c4840];return _0xa747b8;};'use strict';var express=require(_0x956b('0x0'));var router=express[_0x956b('0x1')]();var auth=require(_0x956b('0x2'));var controller=require(_0x956b('0x3'));router[_0x956b('0x4')](_0x956b('0x5'),auth['isAuthenticated'](),controller[_0x956b('0x6')]);module['exports']=router; \ No newline at end of file +var _0x2041=['/queues','isAuthenticated','exports','express','Router','./realtime.controller','get'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x2041,0x10d));var _0x1204=function(_0x429c61,_0x36ba19){_0x429c61=_0x429c61-0x0;var _0x94e689=_0x2041[_0x429c61];return _0x94e689;};'use strict';var express=require(_0x1204('0x0'));var router=express[_0x1204('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1204('0x2'));router[_0x1204('0x3')](_0x1204('0x4'),auth[_0x1204('0x5')](),controller['getQueues']);module[_0x1204('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b5a8ed3..8b62150 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 _0x7278=['includes','channel','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','type','key','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','then','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','paused','push','pTalking','originated','message','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','loggedIn','agents','merge','pick','getAgents','online','getMembers','length','find','UserId','User','Pause','findAll','QueueId','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','json','error','stack','name','send','getQueues','mail','chat','sms','fax','whatsapp','voice','query'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x7278,0x161));var _0x8727=function(_0x1d9cf4,_0x290f11){_0x1d9cf4=_0x1d9cf4-0x0;var _0x413b08=_0x7278[_0x1d9cf4];return _0x413b08;};'use strict';var util=require(_0x8727('0x0'));var _=require(_0x8727('0x1'));var jayson=require(_0x8727('0x2'));var qs=require(_0x8727('0x3'));var logger=require(_0x8727('0x4'))('api');var db=require(_0x8727('0x5'))['db'];var client=jayson[_0x8727('0x6')][_0x8727('0x7')]({'port':0x232a});var routingClient=jayson[_0x8727('0x6')][_0x8727('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xfd8084,_0x180b71){return function(_0x5549d5){if(_0x5549d5){var _0xfd1902=typeof _0x180b71[_0x8727('0x8')]===_0x8727('0x9')&&typeof _0x180b71[_0x8727('0xa')]===_0x8727('0x9');var _0x4c5b50=_0x5549d5['count'];var _0x4df6f8=_0xfd1902?0x0:_0x180b71[_0x8727('0x8')];var _0x336193=_0xfd1902?_0x5549d5[_0x8727('0xb')]:_0x180b71[_0x8727('0x8')]+_0x180b71[_0x8727('0xa')];var _0x344490;if(_0x336193>=_0x4c5b50){_0x336193=_0x4c5b50;_0x344490=0xc8;}else{_0x344490=0xce;}_0xfd8084[_0x8727('0xc')](_0x344490);return _0xfd8084[_0x8727('0xd')]('Content-Range',_0x4df6f8+'-'+_0x336193+'/'+_0x4c5b50)[_0x8727('0xe')](_0x5549d5);}return null;};}function handleError(_0x2d9d47,_0x176389){_0x176389=_0x176389||0x1f4;return function(_0x518e56){logger[_0x8727('0xf')](_0x518e56[_0x8727('0x10')]);if(_0x518e56['name']){delete _0x518e56[_0x8727('0x11')];}_0x2d9d47[_0x8727('0xc')](_0x176389)[_0x8727('0x12')](_0x518e56);};}exports[_0x8727('0x13')]=function(_0x2ea789,_0x3d84db){var _0x3865e9=[_0x8727('0x14'),_0x8727('0x15'),_0x8727('0x16'),'openchannel',_0x8727('0x17'),_0x8727('0x18'),_0x8727('0x19')];var _0x2f6e1d={'count':0x0,'rows':[]},_0x112f04={},_0xba0af5;Promise['resolve']()['then'](function(){if(_0x2ea789[_0x8727('0x1a')]['channel']){if(!_[_0x8727('0x1b')](_0x3865e9,_0x2ea789[_0x8727('0x1a')][_0x8727('0x1c')][_0x8727('0x1d')]()))throw new Error(_0x8727('0x1e'));_0xba0af5=_0x2ea789['query'][_0x8727('0x1c')][_0x8727('0x1d')]();}var _0x8cde82=_[_0x8727('0x1f')](_0xba0af5)+_0x8727('0x20');var _0x3140e8=_[_0x8727('0x21')](db[_0x8cde82][_0x8727('0x22')],function(_0x117f58){return{'name':_0x117f58[_0x8727('0x23')],'type':_0x117f58[_0x8727('0x24')][_0x8727('0x25')]};});_0x112f04=qs['getOptions'](_0x3140e8,_0x2ea789);if(_0x2ea789[_0x8727('0x26')][_0x8727('0x27')]==='user'){var _0x5adefe={'params':{'id':_0x2ea789[_0x8727('0x26')][_0x8727('0x28')]},'query':{'section':_0xba0af5===_0x8727('0x19')&&_0x2ea789['query'][_0x8727('0x24')]===_0x8727('0x29')?_0x8727('0x2a'):_[_0x8727('0x1f')](_0xba0af5)+_0x8727('0x2b'),'type':_0x2ea789[_0x8727('0x1a')][_0x8727('0x24')],'nolimit':!![],'sort':_0x8727('0x11'),'filter':_0x2ea789['query'][_0x8727('0x2c')]}};return db[_0x8727('0x2d')]['getResources'](_0x5adefe);}return db[_0x8cde82][_0x8727('0x2e')](_0x112f04);})[_0x8727('0x2f')](function(_0x3ecd6a){_0x2f6e1d[_0x8727('0xb')]=_0x3ecd6a[_0x8727('0xb')];var _0x1e21b9=_0xba0af5==='voice'?client:routingClient;return _0x1e21b9[_0x8727('0x30')](_['startCase'](_0xba0af5)+_0x8727('0x2b'),_0x2ea789)['then'](function(_0x44ed83){if(_0x44ed83[_0x8727('0xf')])throw new Error(util[_0x8727('0x31')](_0x8727('0x32'),_0xba0af5));var _0x410240=_0x44ed83[_0x8727('0x33')];var _0x382be3=['loggedIn',_0x8727('0x34'),_0x8727('0x35'),_0x8727('0x36'),_0x8727('0x37')];if(_0xba0af5===_0x8727('0x19')&&_0x2ea789[_0x8727('0x1a')][_0x8727('0x24')]===_0x8727('0x29')){_0x382be3[_0x8727('0x38')](_0x8727('0x39'),_0x8727('0x3a'),_0x8727('0x3b'),'dialActive','dialMethod',_0x8727('0x3c'),_0x8727('0x3d'),_0x8727('0x3e'),_0x8727('0x3f'),'erlangCallToSecond',_0x8727('0x40'),_0x8727('0x41'),_0x8727('0x42'),_0x8727('0x43'),_0x8727('0x44'),'predictiveIntervalAvailable',_0x8727('0x45'),_0x8727('0x46'),_0x8727('0x47'),_0x8727('0x48'),_0x8727('0x49'),_0x8727('0x4a'));}var _0x27b950=_0x3ecd6a[_0x8727('0x4b')][_0x8727('0x21')](function(_0x1a607a){var _0x396f12=_0x1a607a[_0x8727('0x4c')]({'plain':!![]});_0x396f12['paused']=0x0;_0x396f12[_0x8727('0x4d')]=0x0;_0x396f12[_0x8727('0x4e')]=0x0;_0x396f12[_0x8727('0x34')]=0x0;_0x396f12[_0x8727('0x37')]=0x0;_0x396f12[_0x8727('0x35')]=0x0;if(_0xba0af5===_0x8727('0x19')){_0x396f12[_0x8727('0x36')]=0x0;if(_0x2ea789[_0x8727('0x1a')][_0x8727('0x24')]===_0x8727('0x29')){_0x396f12[_0x8727('0x39')]=0x0;_0x396f12[_0x8727('0x3a')]=0x0;}}_0x396f12[_0x8727('0x4f')]=[];var _0x7e3454=_['find'](_0x410240[_0x8727('0x4b')],['id',_0x396f12['id']]);if(_0x7e3454)_[_0x8727('0x50')](_0x396f12,_[_0x8727('0x51')](_0x7e3454,_0x382be3));if(_0xba0af5==='voice'){return _0x1a607a[_0x8727('0x52')]({'attributes':['id',_0x8727('0x11'),_0x8727('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x8727('0x2f')](function(_0x57817f){return _0x1a607a[_0x8727('0x54')]({'raw':!![]})[_0x8727('0x2f')](function(_0x1b90e3){for(var _0x191fe7=0x0;_0x191fe7<_0x57817f[_0x8727('0x55')];_0x191fe7++){var _0x24d7c9=_[_0x8727('0x56')](_0x1b90e3,[_0x8727('0x57'),_0x57817f[_0x191fe7]['id']]);var _0x3aac97={'id':_0x57817f[_0x191fe7]['id'],'name':_0x57817f[_0x191fe7][_0x8727('0x11')],'online':Boolean(_0x57817f[_0x191fe7]['online']),'paused':_0x24d7c9?Boolean(_0x24d7c9[_0x8727('0x37')]):![]};if(_0x3aac97[_0x8727('0x53')])_0x396f12[_0x8727('0x4d')]++;if(_0x3aac97[_0x8727('0x37')])_0x396f12[_0x8727('0x37')]++;_0x396f12['agents'][_0x8727('0x38')](_0x3aac97);}return _0x396f12;});});}else{var _0x186f38=_0x8727('0x58')+_['startCase'](_0xba0af5)+_0x8727('0x20');var _0x3234ed=_0xba0af5+_0x8727('0x59');return db[_0x186f38][_0x8727('0x5a')]({'where':{[_[_0x8727('0x1f')](_0xba0af5)+_0x8727('0x5b')]:_0x1a607a['id']},'raw':!![]})['then'](function(_0x1886b3){return db[_0x8727('0x58')][_0x8727('0x5a')]({'attributes':['id','name',_0x8727('0x53'),_0x3234ed],'where':{'id':_[_0x8727('0x21')](_0x1886b3,_0x8727('0x57')),'role':_0x8727('0x5c')},'raw':!![]});})[_0x8727('0x2f')](function(_0x11cb79){for(var _0x39e342=0x0;_0x39e342<_0x11cb79['length'];_0x39e342++){var _0x24196a={'id':_0x11cb79[_0x39e342]['id'],'name':_0x11cb79[_0x39e342][_0x8727('0x11')],'online':Boolean(_0x11cb79[_0x39e342][_0x8727('0x53')]),'paused':Boolean(_0x11cb79[_0x39e342][_0x3234ed])};if(_0x24196a[_0x8727('0x53')])_0x396f12[_0x8727('0x4d')]++;if(_0x24196a[_0x8727('0x37')])_0x396f12[_0x8727('0x37')]++;_0x396f12['agents'][_0x8727('0x38')](_0x24196a);}return _0x396f12;});}});return Promise[_0x8727('0x5d')](_0x27b950);});})[_0x8727('0x2f')](function(_0x5d6c81){_0x2f6e1d[_0x8727('0x4b')]=_0x5d6c81;return _0x2f6e1d;})[_0x8727('0x2f')](respondWithFilteredResult(_0x3d84db,_0x112f04))[_0x8727('0x5e')](handleError(_0x3d84db,null));}; \ No newline at end of file +var _0x8f9d=['fax','resolve','query','channel','Invalid\x20channel','toLowerCase','startCase','map','rawAttributes','fieldName','type','getOptions','user','role','userProfileId','voice','outbound','QueueCampaigns','Queues','findAndCountAll','then','request','format','loggedIn','available','waiting','talking','paused','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','pTalking','originated','find','merge','pick','getMembers','length','online','agents','User','Queue','Pause','findAll','QueueId','UserId','agent','all','catch','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','error','stack','name','send','getQueues','mail','chat','sms','openchannel'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xd8f9('0x0'));var _=require('lodash');var jayson=require(_0xd8f9('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xd8f9('0x2'))(_0xd8f9('0x3'));var db=require(_0xd8f9('0x4'))['db'];var client=jayson[_0xd8f9('0x5')][_0xd8f9('0x6')]({'port':0x232a});var routingClient=jayson[_0xd8f9('0x5')][_0xd8f9('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x5941ce,_0x1c37be){return function(_0x24dd1e){if(_0x24dd1e){var _0x25d417=typeof _0x1c37be[_0xd8f9('0x7')]===_0xd8f9('0x8')&&typeof _0x1c37be['limit']===_0xd8f9('0x8');var _0x6691e=_0x24dd1e['count'];var _0x33c31e=_0x25d417?0x0:_0x1c37be['offset'];var _0x5caee9=_0x25d417?_0x24dd1e[_0xd8f9('0x9')]:_0x1c37be[_0xd8f9('0x7')]+_0x1c37be[_0xd8f9('0xa')];var _0x379359;if(_0x5caee9>=_0x6691e){_0x5caee9=_0x6691e;_0x379359=0xc8;}else{_0x379359=0xce;}_0x5941ce[_0xd8f9('0xb')](_0x379359);return _0x5941ce[_0xd8f9('0xc')](_0xd8f9('0xd'),_0x33c31e+'-'+_0x5caee9+'/'+_0x6691e)['json'](_0x24dd1e);}return null;};}function handleError(_0x3a214b,_0x56e0d6){_0x56e0d6=_0x56e0d6||0x1f4;return function(_0x39aca0){logger[_0xd8f9('0xe')](_0x39aca0[_0xd8f9('0xf')]);if(_0x39aca0['name']){delete _0x39aca0[_0xd8f9('0x10')];}_0x3a214b[_0xd8f9('0xb')](_0x56e0d6)[_0xd8f9('0x11')](_0x39aca0);};}exports[_0xd8f9('0x12')]=function(_0x4c11f2,_0x3529e9){var _0x1525d6=[_0xd8f9('0x13'),_0xd8f9('0x14'),_0xd8f9('0x15'),_0xd8f9('0x16'),_0xd8f9('0x17'),'whatsapp','voice'];var _0x284a1a={'count':0x0,'rows':[]},_0xc6a825={},_0x4d5b8d;Promise[_0xd8f9('0x18')]()['then'](function(){if(_0x4c11f2[_0xd8f9('0x19')]['channel']){if(!_['includes'](_0x1525d6,_0x4c11f2['query'][_0xd8f9('0x1a')]['toLowerCase']()))throw new Error(_0xd8f9('0x1b'));_0x4d5b8d=_0x4c11f2[_0xd8f9('0x19')][_0xd8f9('0x1a')][_0xd8f9('0x1c')]();}var _0x3b141a=_[_0xd8f9('0x1d')](_0x4d5b8d)+'Queue';var _0x1de3cc=_[_0xd8f9('0x1e')](db[_0x3b141a][_0xd8f9('0x1f')],function(_0x36d740){return{'name':_0x36d740[_0xd8f9('0x20')],'type':_0x36d740[_0xd8f9('0x21')]['key']};});_0xc6a825=qs[_0xd8f9('0x22')](_0x1de3cc,_0x4c11f2);if(_0x4c11f2[_0xd8f9('0x23')][_0xd8f9('0x24')]===_0xd8f9('0x23')){var _0x290553={'params':{'id':_0x4c11f2['user'][_0xd8f9('0x25')]},'query':{'section':_0x4d5b8d===_0xd8f9('0x26')&&_0x4c11f2[_0xd8f9('0x19')][_0xd8f9('0x21')]===_0xd8f9('0x27')?_0xd8f9('0x28'):_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x29'),'type':_0x4c11f2['query'][_0xd8f9('0x21')],'nolimit':!![],'sort':_0xd8f9('0x10'),'filter':_0x4c11f2[_0xd8f9('0x19')]['filter']}};return db['UserProfile']['getResources'](_0x290553);}return db[_0x3b141a][_0xd8f9('0x2a')](_0xc6a825);})[_0xd8f9('0x2b')](function(_0x5050a4){_0x284a1a[_0xd8f9('0x9')]=_0x5050a4[_0xd8f9('0x9')];var _0x5da878=_0x4d5b8d===_0xd8f9('0x26')?client:routingClient;return _0x5da878[_0xd8f9('0x2c')](_[_0xd8f9('0x1d')](_0x4d5b8d)+'Queues',_0x4c11f2)[_0xd8f9('0x2b')](function(_0x48f7c0){if(_0x48f7c0[_0xd8f9('0xe')])throw new Error(util[_0xd8f9('0x2d')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4d5b8d));var _0x19d639=_0x48f7c0['result'];var _0x340f0a=[_0xd8f9('0x2e'),_0xd8f9('0x2f'),_0xd8f9('0x30'),_0xd8f9('0x31'),_0xd8f9('0x32')];if(_0x4d5b8d===_0xd8f9('0x26')&&_0x4c11f2['query'][_0xd8f9('0x21')]==='outbound'){_0x340f0a['push']('pTalking','originated',_0xd8f9('0x33'),_0xd8f9('0x34'),_0xd8f9('0x35'),_0xd8f9('0x36'),_0xd8f9('0x37'),'startProgressive','erlangCalls',_0xd8f9('0x38'),_0xd8f9('0x39'),'erlangBusyFactor',_0xd8f9('0x3a'),_0xd8f9('0x3b'),_0xd8f9('0x3c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xd8f9('0x3d'),_0xd8f9('0x3e'),_0xd8f9('0x3f'));}var _0x219c5f=_0x5050a4[_0xd8f9('0x40')]['map'](function(_0x3333ea){var _0x2bc390=_0x3333ea[_0xd8f9('0x41')]({'plain':!![]});_0x2bc390[_0xd8f9('0x32')]=0x0;_0x2bc390[_0xd8f9('0x42')]=0x0;_0x2bc390[_0xd8f9('0x2e')]=0x0;_0x2bc390[_0xd8f9('0x2f')]=0x0;_0x2bc390[_0xd8f9('0x32')]=0x0;_0x2bc390[_0xd8f9('0x30')]=0x0;if(_0x4d5b8d===_0xd8f9('0x26')){_0x2bc390[_0xd8f9('0x31')]=0x0;if(_0x4c11f2['query'][_0xd8f9('0x21')]===_0xd8f9('0x27')){_0x2bc390[_0xd8f9('0x43')]=0x0;_0x2bc390[_0xd8f9('0x44')]=0x0;}}_0x2bc390['agents']=[];var _0x157dfd=_[_0xd8f9('0x45')](_0x19d639[_0xd8f9('0x40')],['id',_0x2bc390['id']]);if(_0x157dfd)_[_0xd8f9('0x46')](_0x2bc390,_[_0xd8f9('0x47')](_0x157dfd,_0x340f0a));if(_0x4d5b8d===_0xd8f9('0x26')){return _0x3333ea['getAgents']({'attributes':['id','name','online'],'joinTableAttributes':[],'raw':!![]})[_0xd8f9('0x2b')](function(_0x293179){return _0x3333ea[_0xd8f9('0x48')]({'raw':!![]})[_0xd8f9('0x2b')](function(_0x9af000){for(var _0x324f18=0x0;_0x324f18<_0x293179[_0xd8f9('0x49')];_0x324f18++){var _0x2ff764=_[_0xd8f9('0x45')](_0x9af000,['UserId',_0x293179[_0x324f18]['id']]);var _0x4aabbe={'id':_0x293179[_0x324f18]['id'],'name':_0x293179[_0x324f18][_0xd8f9('0x10')],'online':Boolean(_0x293179[_0x324f18][_0xd8f9('0x4a')]),'paused':_0x2ff764?Boolean(_0x2ff764[_0xd8f9('0x32')]):![]};if(_0x4aabbe['online'])_0x2bc390['loggedInDb']++;if(_0x4aabbe[_0xd8f9('0x32')])_0x2bc390[_0xd8f9('0x32')]++;_0x2bc390[_0xd8f9('0x4b')]['push'](_0x4aabbe);}return _0x2bc390;});});}else{var _0xd6b6bf=_0xd8f9('0x4c')+_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x4d');var _0x207ad2=_0x4d5b8d+_0xd8f9('0x4e');return db[_0xd6b6bf][_0xd8f9('0x4f')]({'where':{[_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x50')]:_0x3333ea['id']},'raw':!![]})['then'](function(_0x53594f){return db['User'][_0xd8f9('0x4f')]({'attributes':['id',_0xd8f9('0x10'),_0xd8f9('0x4a'),_0x207ad2],'where':{'id':_[_0xd8f9('0x1e')](_0x53594f,_0xd8f9('0x51')),'role':_0xd8f9('0x52')},'raw':!![]});})[_0xd8f9('0x2b')](function(_0x26b892){for(var _0x26527c=0x0;_0x26527c<_0x26b892[_0xd8f9('0x49')];_0x26527c++){var _0x35f7a6={'id':_0x26b892[_0x26527c]['id'],'name':_0x26b892[_0x26527c][_0xd8f9('0x10')],'online':Boolean(_0x26b892[_0x26527c][_0xd8f9('0x4a')]),'paused':Boolean(_0x26b892[_0x26527c][_0x207ad2])};if(_0x35f7a6['online'])_0x2bc390[_0xd8f9('0x42')]++;if(_0x35f7a6[_0xd8f9('0x32')])_0x2bc390[_0xd8f9('0x32')]++;_0x2bc390[_0xd8f9('0x4b')]['push'](_0x35f7a6);}return _0x2bc390;});}});return Promise[_0xd8f9('0x53')](_0x219c5f);});})['then'](function(_0x59952e){_0x284a1a[_0xd8f9('0x40')]=_0x59952e;return _0x284a1a;})[_0xd8f9('0x2b')](respondWithFilteredResult(_0x3529e9,_0xc6a825))[_0xd8f9('0x54')](handleError(_0x3529e9,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 35282d8..eb0ffc9 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x57f79d,_0x1bbe3f){var _0x4660a4=function(_0x32224a){while(--_0x32224a){_0x57f79d['push'](_0x57f79d['shift']());}};_0x4660a4(++_0x1bbe3f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xcb91[_0x1daaa9];return _0x1dd221;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x44a483,_0xa9b240){var _0x3c6fc7=function(_0x12bdfd){while(--_0x12bdfd){_0x44a483['push'](_0x44a483['shift']());}};_0x3c6fc7(++_0xa9b240);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xcb91[_0x547456];return _0xc1fd7b;};'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 388f77c..4854c9f 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 _0xdb2a=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x4e518f,_0x1d53c2){var _0x479465=function(_0x3d8923){while(--_0x3d8923){_0x4e518f['push'](_0x4e518f['shift']());}};_0x479465(++_0x1d53c2);}(_0xdb2a,0x16f));var _0xadb2=function(_0x21b1f2,_0xbdd600){_0x21b1f2=_0x21b1f2-0x0;var _0xa4c666=_0xdb2a[_0x21b1f2];return _0xa4c666;};'use strict';var Sequelize=require(_0xadb2('0x0'));module[_0xadb2('0x1')]={'state':{'type':Sequelize[_0xadb2('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xadb2('0x3')]},'starttime':{'type':Sequelize[_0xadb2('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xadb2('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xadb2('0x3')]},'membername':{'type':Sequelize[_0xadb2('0x3')]}}; \ No newline at end of file +var _0x41fe=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x41fe,0xd1));var _0xe41f=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x41fe[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require(_0xe41f('0x0'));module[_0xe41f('0x1')]={'state':{'type':Sequelize[_0xe41f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe41f('0x3')]},'scheduledat':{'type':Sequelize[_0xe41f('0x4')]},'uniqueid':{'type':Sequelize[_0xe41f('0x3')]},'starttime':{'type':Sequelize[_0xe41f('0x4')]},'responsetime':{'type':Sequelize[_0xe41f('0x4')]},'ringtime':{'type':Sequelize[_0xe41f('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe41f('0x3')]},'campaigntype':{'type':Sequelize[_0xe41f('0x3')]},'membername':{'type':Sequelize[_0xe41f('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c5f5372..9257108 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 _0x5dd1=['exports','ReportAgentPreview','report_agent_preview','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x4a5098,_0x430287){var _0x91357f=function(_0x28c5f9){while(--_0x28c5f9){_0x4a5098['push'](_0x4a5098['shift']());}};_0x91357f(++_0x430287);}(_0x5dd1,0x19a));var _0x15dd=function(_0x3d70ae,_0x6ddb0f){_0x3d70ae=_0x3d70ae-0x0;var _0x1ba273=_0x5dd1[_0x3d70ae];return _0x1ba273;};'use strict';var _=require('lodash');var util=require(_0x15dd('0x0'));var logger=require(_0x15dd('0x1'))(_0x15dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x15dd('0x3'));var fs=require('fs');var path=require(_0x15dd('0x4'));var rimraf=require(_0x15dd('0x5'));var config=require(_0x15dd('0x6'));var attributes=require(_0x15dd('0x7'));module[_0x15dd('0x8')]=function(_0x2a1159,_0x106aa6){return _0x2a1159['define'](_0x15dd('0x9'),attributes,{'tableName':_0x15dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe70c=['moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x58b592,_0x112da5){var _0x4f5bb4=function(_0xf6658){while(--_0xf6658){_0x58b592['push'](_0x58b592['shift']());}};_0x4f5bb4(++_0x112da5);}(_0xe70c,0x1a9));var _0xce70=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe70c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xce70('0x0'));var util=require(_0xce70('0x1'));var logger=require(_0xce70('0x2'))(_0xce70('0x3'));var moment=require(_0xce70('0x4'));var BPromise=require(_0xce70('0x5'));var rp=require(_0xce70('0x6'));var fs=require('fs');var path=require(_0xce70('0x7'));var rimraf=require('rimraf');var config=require(_0xce70('0x8'));var attributes=require(_0xce70('0x9'));module[_0xce70('0xa')]=function(_0x4b8363,_0x50e03e){return _0x4b8363['define'](_0xce70('0xb'),attributes,{'tableName':_0xce70('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 bd8ce9b..600f2d8 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 _0xfbab=['CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x22045a,_0x4d8548){var _0x2dcad3=function(_0x41ca46){while(--_0x41ca46){_0x22045a['push'](_0x22045a['shift']());}};_0x2dcad3(++_0x4d8548);}(_0xfbab,0xb6));var _0xbfba=function(_0x10cd07,_0x1f3693){_0x10cd07=_0x10cd07-0x0;var _0x21bded=_0xfbab[_0x10cd07];return _0x21bded;};'use strict';var _=require('lodash');var util=require(_0xbfba('0x0'));var moment=require(_0xbfba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfba('0x2'));var db=require(_0xbfba('0x3'))['db'];var utils=require(_0xbfba('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbfba('0x5'));var jayson=require(_0xbfba('0x6'));var client=jayson[_0xbfba('0x7')][_0xbfba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcae890,_0x50e6ec,_0x38f5a4){return new BPromise(function(_0x5229c5,_0x223bd4){return client[_0xbfba('0x9')](_0xcae890,_0x38f5a4)['then'](function(_0x2fb7e2){logger[_0xbfba('0xa')](_0xbfba('0xb'),_0x50e6ec,_0xbfba('0xc'));logger[_0xbfba('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x50e6ec,_0xbfba('0xc'),JSON[_0xbfba('0xe')](_0x2fb7e2));if(_0x2fb7e2[_0xbfba('0xf')]){if(_0x2fb7e2[_0xbfba('0xf')]['code']===0x1f4){logger['error'](_0xbfba('0xb'),_0x50e6ec,_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);return _0x223bd4(_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);}logger[_0xbfba('0xf')](_0xbfba('0xb'),_0x50e6ec,_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);return _0x5229c5(_0x2fb7e2['error'][_0xbfba('0x10')]);}else{logger[_0xbfba('0xa')](_0xbfba('0xb'),_0x50e6ec,_0xbfba('0xc'));_0x5229c5(_0x2fb7e2[_0xbfba('0x11')]['message']);}})['catch'](function(_0x4df990){logger[_0xbfba('0xf')](_0xbfba('0xb'),_0x50e6ec,_0x4df990);_0x223bd4(_0x4df990);});});}exports[_0xbfba('0x12')]=function(_0x204757){var _0x38d0a9=this;return new Promise(function(_0x55d674,_0x5efb6d){return db[_0xbfba('0x13')]['create'](_0x204757[_0xbfba('0x14')],{'raw':_0x204757[_0xbfba('0x15')]?_0x204757['options'][_0xbfba('0x16')]===undefined?!![]:![]:!![]})[_0xbfba('0x17')](function(_0x1704c2){logger[_0xbfba('0xa')]('CreateReportAgentPreview',_0x204757);logger[_0xbfba('0xd')](_0xbfba('0x12'),_0x204757,JSON[_0xbfba('0xe')](_0x1704c2));_0x55d674(_0x1704c2);})[_0xbfba('0x18')](function(_0x5c668d){logger['error'](_0xbfba('0x12'),_0x5c668d[_0xbfba('0x10')],_0x204757);_0x5efb6d(_0x38d0a9[_0xbfba('0xf')](0x1f4,_0x5c668d[_0xbfba('0x10')]));});});}; \ No newline at end of file +var _0x4ec5=['error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b59d5,_0x1e23f2){var _0x30cc91=function(_0x54815d){while(--_0x54815d){_0x3b59d5['push'](_0x3b59d5['shift']());}};_0x30cc91(++_0x1e23f2);}(_0x4ec5,0x9e));var _0x54ec=function(_0x38524d,_0x1f6fd6){_0x38524d=_0x38524d-0x0;var _0x46907f=_0x4ec5[_0x38524d];return _0x46907f;};'use strict';var _=require(_0x54ec('0x0'));var util=require('util');var moment=require(_0x54ec('0x1'));var BPromise=require(_0x54ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54ec('0x3'));var db=require(_0x54ec('0x4'))['db'];var utils=require(_0x54ec('0x5'));var logger=require(_0x54ec('0x6'))('rpc');var config=require(_0x54ec('0x7'));var jayson=require(_0x54ec('0x8'));var client=jayson[_0x54ec('0x9')][_0x54ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51e8d2,_0xc5ad8b,_0x400f6d){return new BPromise(function(_0x1ae390,_0x15b3c9){return client['request'](_0x51e8d2,_0x400f6d)[_0x54ec('0xb')](function(_0x2e1423){logger['info'](_0x54ec('0xc'),_0xc5ad8b,_0x54ec('0xd'));logger['debug'](_0x54ec('0xe'),_0xc5ad8b,_0x54ec('0xd'),JSON[_0x54ec('0xf')](_0x2e1423));if(_0x2e1423[_0x54ec('0x10')]){if(_0x2e1423[_0x54ec('0x10')][_0x54ec('0x11')]===0x1f4){logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);return _0x15b3c9(_0x2e1423[_0x54ec('0x10')]['message']);}logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);return _0x1ae390(_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);}else{logger[_0x54ec('0x13')](_0x54ec('0xc'),_0xc5ad8b,_0x54ec('0xd'));_0x1ae390(_0x2e1423[_0x54ec('0x14')][_0x54ec('0x12')]);}})['catch'](function(_0x24ee4c){logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x24ee4c);_0x15b3c9(_0x24ee4c);});});}exports[_0x54ec('0x15')]=function(_0x401bc7){var _0x2903a2=this;return new Promise(function(_0x24779d,_0x1c558c){return db[_0x54ec('0x16')][_0x54ec('0x17')](_0x401bc7[_0x54ec('0x18')],{'raw':_0x401bc7[_0x54ec('0x19')]?_0x401bc7[_0x54ec('0x19')][_0x54ec('0x1a')]===undefined?!![]:![]:!![]})[_0x54ec('0xb')](function(_0x38b5e1){logger[_0x54ec('0x13')](_0x54ec('0x15'),_0x401bc7);logger[_0x54ec('0x1b')](_0x54ec('0x15'),_0x401bc7,JSON[_0x54ec('0xf')](_0x38b5e1));_0x24779d(_0x38b5e1);})[_0x54ec('0x1c')](function(_0x184173){logger['error'](_0x54ec('0x15'),_0x184173[_0x54ec('0x12')],_0x401bc7);_0x1c558c(_0x2903a2[_0x54ec('0x10')](0x1f4,_0x184173[_0x54ec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 5b62fbe..883157c 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 _0x1482=['/chat/queues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0x1482,0x90));var _0x2148=function(_0x3a872e,_0x277a40){_0x3a872e=_0x3a872e-0x0;var _0x25dc1f=_0x1482[_0x3a872e];return _0x25dc1f;};'use strict';var multer=require('multer');var util=require(_0x2148('0x0'));var path=require('path');var express=require(_0x2148('0x1'));var router=express[_0x2148('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0x2148('0x3'));router[_0x2148('0x4')](_0x2148('0x5'),auth[_0x2148('0x6')](),controller['voiceChannels']);router['get'](_0x2148('0x7'),auth[_0x2148('0x6')](),controller[_0x2148('0x8')]);router[_0x2148('0x4')](_0x2148('0x9'),auth[_0x2148('0x6')](),controller[_0x2148('0xa')]);router[_0x2148('0x4')](_0x2148('0xb'),auth[_0x2148('0x6')](),controller['voiceQueues']);router['get'](_0x2148('0xc'),auth[_0x2148('0x6')](),controller['chatQueues']);router[_0x2148('0x4')](_0x2148('0xd'),auth[_0x2148('0x6')](),controller[_0x2148('0xe')]);router['get']('/mail/accounts',auth[_0x2148('0x6')](),controller['mailAccounts']);router[_0x2148('0x4')](_0x2148('0xf'),auth['isAuthenticated'](),controller[_0x2148('0x10')]);router[_0x2148('0x4')](_0x2148('0x11'),auth[_0x2148('0x6')](),controller[_0x2148('0x12')]);router[_0x2148('0x4')](_0x2148('0x13'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x2148('0x14')]);router[_0x2148('0x4')](_0x2148('0x15'),auth[_0x2148('0x6')](),controller[_0x2148('0x16')]);router[_0x2148('0x4')](_0x2148('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router['get'](_0x2148('0x18'),auth[_0x2148('0x6')](),controller[_0x2148('0x19')]);router[_0x2148('0x4')](_0x2148('0x1a'),auth[_0x2148('0x6')](),controller[_0x2148('0x1b')]);router[_0x2148('0x4')](_0x2148('0x1c'),auth[_0x2148('0x6')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x2148('0x1d'),auth['isAuthenticated'](),controller[_0x2148('0x1e')]);router[_0x2148('0x1f')]('/voice/queues/:id',auth[_0x2148('0x6')](),controller[_0x2148('0x20')]);router[_0x2148('0x4')]('/outbound',auth[_0x2148('0x6')](),controller[_0x2148('0x21')]);router[_0x2148('0x4')](_0x2148('0x22'),auth[_0x2148('0x6')](),controller[_0x2148('0x23')]);router['get'](_0x2148('0x24'),auth[_0x2148('0x6')](),controller[_0x2148('0x25')]);router['put'](_0x2148('0x26'),auth[_0x2148('0x6')](),controller[_0x2148('0x27')]);router['get'](_0x2148('0x28'),auth[_0x2148('0x6')](),controller['telephones']);router[_0x2148('0x4')](_0x2148('0x29'),auth[_0x2148('0x6')](),controller[_0x2148('0x2a')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x2148('0x2b')]);router[_0x2148('0x4')]('/fax/accounts',auth[_0x2148('0x6')](),controller['faxAccounts']);router[_0x2148('0x4')](_0x2148('0x2c'),auth[_0x2148('0x6')](),controller[_0x2148('0x2d')]);router['get']('/mail/queues/waitinginteractions',auth[_0x2148('0x6')](),controller[_0x2148('0x2e')]);router[_0x2148('0x4')](_0x2148('0x2f'),auth[_0x2148('0x6')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x2148('0x30'),auth[_0x2148('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x2148('0x4')](_0x2148('0x31'),auth[_0x2148('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x2148('0x4')](_0x2148('0x32'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x2148('0x33'),auth[_0x2148('0x6')](),controller[_0x2148('0x34')]);router['post'](_0x2148('0x35'),auth[_0x2148('0x6')](),controller['queueNotify'](_0x2148('0x36')));router[_0x2148('0x4')](_0x2148('0x37'),auth[_0x2148('0x6')](),controller[_0x2148('0x38')]);router[_0x2148('0x39')](_0x2148('0x3a'),auth[_0x2148('0x6')](),controller[_0x2148('0x3b')]('chat'));router['get'](_0x2148('0x3c'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x2148('0x39')](_0x2148('0x3d'),auth[_0x2148('0x6')](),controller['queueNotify'](_0x2148('0x3e')));router[_0x2148('0x4')](_0x2148('0x3f'),auth[_0x2148('0x6')](),controller[_0x2148('0x40')]);router[_0x2148('0x39')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2148('0x3b')](_0x2148('0x41')));router[_0x2148('0x4')](_0x2148('0x42'),auth[_0x2148('0x6')](),controller[_0x2148('0x43')]);router[_0x2148('0x39')](_0x2148('0x44'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x2148('0x39')](_0x2148('0x45'),auth[_0x2148('0x6')](),controller[_0x2148('0x3b')](_0x2148('0x46')));router[_0x2148('0x4')](_0x2148('0x47'),auth['isAuthenticated'](),controller[_0x2148('0x48')]);router[_0x2148('0x4')](_0x2148('0x49'),auth['isAuthenticated'](),controller[_0x2148('0x4a')]);router[_0x2148('0x39')](_0x2148('0x4b'),auth[_0x2148('0x6')](),controller[_0x2148('0x4c')]);module[_0x2148('0x4d')]=router; \ No newline at end of file +var _0xb4f5=['voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','post','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup'];(function(_0x1cc2c6,_0x38b744){var _0x8e249d=function(_0x52ce6b){while(--_0x52ce6b){_0x1cc2c6['push'](_0x1cc2c6['shift']());}};_0x8e249d(++_0x38b744);}(_0xb4f5,0x80));var _0x5b4f=function(_0x43b833,_0x345a9e){_0x43b833=_0x43b833-0x0;var _0x5085d0=_0xb4f5[_0x43b833];return _0x5085d0;};'use strict';var multer=require(_0x5b4f('0x0'));var util=require(_0x5b4f('0x1'));var path=require(_0x5b4f('0x2'));var express=require(_0x5b4f('0x3'));var router=express[_0x5b4f('0x4')]();var auth=require(_0x5b4f('0x5'));var controller=require(_0x5b4f('0x6'));router[_0x5b4f('0x7')]('/voice/channels',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x9')]);router[_0x5b4f('0x7')](_0x5b4f('0xa'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x5b4f('0x7')](_0x5b4f('0xb'),auth['isAuthenticated'](),controller[_0x5b4f('0xc')]);router[_0x5b4f('0x7')]('/voice/queues',auth['isAuthenticated'](),controller[_0x5b4f('0xd')]);router['get'](_0x5b4f('0xe'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0xf')]);router['get'](_0x5b4f('0x10'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x11')]);router[_0x5b4f('0x7')](_0x5b4f('0x12'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x13')]);router[_0x5b4f('0x7')]('/openchannel/queues',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x14')]);router[_0x5b4f('0x7')](_0x5b4f('0x15'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x16')]);router[_0x5b4f('0x7')](_0x5b4f('0x17'),auth[_0x5b4f('0x8')](),controller['whatsappQueues']);router[_0x5b4f('0x7')](_0x5b4f('0x18'),auth['isAuthenticated'](),controller[_0x5b4f('0x19')]);router[_0x5b4f('0x7')](_0x5b4f('0x1a'),auth[_0x5b4f('0x8')](),controller['voiceQueuesPreview']);router[_0x5b4f('0x7')](_0x5b4f('0x1b'),auth['isAuthenticated'](),controller[_0x5b4f('0x1c')]);router[_0x5b4f('0x7')](_0x5b4f('0x1d'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x1e')]);router[_0x5b4f('0x7')](_0x5b4f('0x1f'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x20')]);router['get'](_0x5b4f('0x21'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x5b4f('0x7')](_0x5b4f('0x22'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x23')]);router[_0x5b4f('0x24')](_0x5b4f('0x22'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x25')]);router[_0x5b4f('0x7')](_0x5b4f('0x26'),auth[_0x5b4f('0x8')](),controller['outbound']);router[_0x5b4f('0x7')](_0x5b4f('0x27'),auth[_0x5b4f('0x8')](),controller['outboundChannels']);router[_0x5b4f('0x7')](_0x5b4f('0x28'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x29')]);router[_0x5b4f('0x24')]('/agents/:id/capacity',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2a')]);router[_0x5b4f('0x7')](_0x5b4f('0x2b'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2c')]);router[_0x5b4f('0x7')]('/trunks',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2d')]);router[_0x5b4f('0x7')](_0x5b4f('0x2e'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2f')]);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x5b4f('0x30')]);router[_0x5b4f('0x7')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5b4f('0x31')]);router['get'](_0x5b4f('0x32'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x33')]);router['get'](_0x5b4f('0x34'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x35')]);router[_0x5b4f('0x7')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5b4f('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5b4f('0x7')](_0x5b4f('0x36'),auth['isAuthenticated'](),controller[_0x5b4f('0x37')]);router['get'](_0x5b4f('0x38'),auth['isAuthenticated'](),controller[_0x5b4f('0x39')]);router[_0x5b4f('0x7')](_0x5b4f('0x3a'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3b')]);router['post'](_0x5b4f('0x3c'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('mail'));router[_0x5b4f('0x7')]('/mail/queues/:id',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3e')]);router['post'](_0x5b4f('0x3f'),auth['isAuthenticated'](),controller[_0x5b4f('0x3d')](_0x5b4f('0x40')));router['get'](_0x5b4f('0x41'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x42')]);router['post']('/fax/queues/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')](_0x5b4f('0x43')));router[_0x5b4f('0x7')](_0x5b4f('0x44'),auth[_0x5b4f('0x8')](),controller['showFaxQueues']);router['post'](_0x5b4f('0x45'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')](_0x5b4f('0x46')));router['get'](_0x5b4f('0x47'),auth[_0x5b4f('0x8')](),controller['showOpenchannelQueues']);router[_0x5b4f('0x48')](_0x5b4f('0x49'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('sms'));router[_0x5b4f('0x48')]('/whatsapp/queues/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('whatsapp'));router[_0x5b4f('0x7')](_0x5b4f('0x4a'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4b')]);router[_0x5b4f('0x7')](_0x5b4f('0x4c'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4d')]);router[_0x5b4f('0x48')]('/agents/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4e')]);module[_0x5b4f('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f3bb557..44c6021 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 _0x032e=['MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','uniq','value','filter','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','Interaction','update','queue','MessageId','InteractionId','From','TransferReport','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','Start','bluebird','lodash','util','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x032e,0x124));var _0xe032=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x032e[_0xae7c2f];return _0x5d7001;};'use strict';var BPromise=require(_0xe032('0x0'));var moment=require('moment');var _=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe032('0x3'));var jayson=require(_0xe032('0x4'));var amiClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232a});var mailClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232b});var routingClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){var _0x3b0ef8=_0x3289b0?_0x3289b0:amiClient;return _0x3b0ef8[_0xe032('0x7')](_0x37432f,_0x1576c8)[_0xe032('0x8')](function(_0x2dc9e5){if(_0x2dc9e5[_0xe032('0x9')]){if(_0x2dc9e5['error'][_0xe032('0xa')]===0x1f4){return _0xaf3907(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}return _0xd84027(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}else{_0xd84027(_0x2dc9e5[_0xe032('0xc')]);}})[_0xe032('0xd')](function(_0x5bcb5b){_0xaf3907(_0x5bcb5b);});});}function respondWithResult(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xc8;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0xe')](_0x266d71)['json'](_0x28c2b6);}return _0x646979[_0xe032('0xf')](0x194);};}function handleError(_0x2e267b,_0x176547){_0x176547=_0x176547||0x1f4;return function(_0x422e96){logger[_0xe032('0x9')](_0x422e96[_0xe032('0x10')]);if(_0x422e96[_0xe032('0x11')]){delete _0x422e96['name'];}_0x2e267b[_0xe032('0xe')](_0x176547)[_0xe032('0x12')](_0x422e96);};}function findById(_0x36fb7c){return function(_0x3b57d3){if(!_[_0xe032('0x13')](_0x36fb7c)&&!_[_0xe032('0x13')](_0x3b57d3)&&!_['isNil'](_0x3b57d3[_0xe032('0x14')])){return _[_0xe032('0x15')](_0x3b57d3[_0xe032('0x14')],function(_0x41d2a5){return _0x41d2a5['id']==_0x36fb7c;});}return null;};}exports[_0xe032('0x16')]=function(_0x5721ce,_0x4b644b){return respondWithRpcPromise('VoiceChannels',_0x5721ce[_0xe032('0x17')])['then'](respondWithResult(_0x4b644b,null))[_0xe032('0xd')](handleError(_0x4b644b,null));};exports[_0xe032('0x18')]=function(_0x3f0257,_0x2aa342){return respondWithRpcPromise(_0xe032('0x19'),_[_0xe032('0x1a')](_0x3f0257[_0xe032('0x17')],_0x3f0257['params']))[_0xe032('0x8')](respondWithResult(_0x2aa342,null))[_0xe032('0xd')](handleError(_0x2aa342,null));};exports[_0xe032('0x1b')]=function(_0x2be433,_0x2ca592){return respondWithRpcPromise(_0xe032('0x1c'),_[_0xe032('0x1a')](_0x2be433[_0xe032('0x17')],_0x2be433['params']))['then'](respondWithResult(_0x2ca592,null))['catch'](handleError(_0x2ca592,null));};exports[_0xe032('0x1d')]=function(_0x2568ce,_0x302559){return respondWithRpcPromise(_0xe032('0x1e'),_0x2568ce[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x302559,null))[_0xe032('0xd')](handleError(_0x302559,null));};exports[_0xe032('0x1f')]=function(_0x4dcbf1,_0x1ac20b){return respondWithRpcPromise('VoiceQueues',_0x4dcbf1[_0xe032('0x17')])[_0xe032('0x8')](findById(_0x4dcbf1[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x1ac20b,null))['catch'](handleError(_0x1ac20b,null));};exports['updateVoiceQueue']=function(_0x3e2575,_0x38e7ea){return respondWithRpcPromise(_0xe032('0x21'),_[_0xe032('0x1a')](_0x3e2575['body'],_0x3e2575['params']))['then'](respondWithResult(_0x38e7ea,null))[_0xe032('0xd')](handleError(_0x38e7ea,null));};exports[_0xe032('0x22')]=function(_0x5518ac,_0x707b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xe032('0x1a')](_0x5518ac[_0xe032('0x17')],_0x5518ac[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x707b,null))[_0xe032('0xd')](handleError(_0x707b,null));};exports['voiceQueuesChannels']=function(_0xd90bd5,_0x33634c){return respondWithRpcPromise(_0xe032('0x23'),_0xd90bd5[_0xe032('0x17')])['then'](respondWithResult(_0x33634c,null))[_0xe032('0xd')](handleError(_0x33634c,null));};exports['voiceQueuesChannel']=function(_0x2f3e59,_0x53df28){return respondWithRpcPromise(_0xe032('0x24'),_['merge'](_0x2f3e59[_0xe032('0x17')],_0x2f3e59['params']))[_0xe032('0x8')](respondWithResult(_0x53df28,null))[_0xe032('0xd')](handleError(_0x53df28,null));};exports['voiceQueuesChannelHangup']=function(_0x3e3598,_0x2fdf41){return respondWithRpcPromise(_0xe032('0x25'),_[_0xe032('0x1a')](_0x3e3598['query'],_0x3e3598[_0xe032('0x20')]))['then'](respondWithResult(_0x2fdf41,null))[_0xe032('0xd')](handleError(_0x2fdf41,null));};exports[_0xe032('0x26')]=function(_0x5d02c1,_0x450ba4){return respondWithRpcPromise(_0xe032('0x27'),_['merge'](_0x5d02c1[_0xe032('0x17')],_0x5d02c1[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x450ba4,null))[_0xe032('0xd')](handleError(_0x450ba4,null));};exports[_0xe032('0x28')]=function(_0x42f58a,_0x19ee0a){return respondWithRpcPromise(_0xe032('0x29'),_0x42f58a[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x19ee0a,null))[_0xe032('0xd')](handleError(_0x19ee0a,null));};exports[_0xe032('0x2a')]=function(_0x30571c,_0x28ba5d){return respondWithRpcPromise(_0xe032('0x2b'),_0x30571c[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x28ba5d,null))['catch'](handleError(_0x28ba5d,null));};exports[_0xe032('0x2c')]=function(_0x536c76,_0x3d02c1){var _0x2bcfb4;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76[_0xe032('0x17')])[_0xe032('0x8')](function(_0x5eccad){_0x2bcfb4=_0x5eccad;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76['query'],routingClient);})[_0xe032('0x8')](function(_0x590be2){return _[_0xe032('0x1a')]({},_0x590be2,_0x2bcfb4);})[_0xe032('0x8')](respondWithResult(_0x3d02c1,null))[_0xe032('0xd')](handleError(_0x3d02c1,null));};exports[_0xe032('0x2e')]=function(_0x4dc836,_0x477360){if(_0x4dc836['body']&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]&&_0x4dc836[_0xe032('0x31')]&&_0x4dc836[_0xe032('0x31')]['name']){for(var _0x513b0c in _0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]){if(_0x4dc836['body'][_0xe032('0x30')][_0xe032('0x32')](_0x513b0c)){db[_0xe032('0x33')][_0xe032('0x34')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'type':_0xe032('0x35'),'exitAt':null,'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')]?{'$notIn':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]}:{'$ne':null}}})['then'](function(_0x535f34){var _0x1b0e28=moment()['format'](_0xe032('0x37'));for(var _0x277207=0x0,_0x1873a6=_0x535f34[_0xe032('0x36')];_0x277207<_0x1873a6;_0x277207+=0x1){_0x535f34[_0x277207][_0xe032('0x38')]({'exitAt':_0x1b0e28});}});for(var _0x3dfb51=0x0;_0x3dfb51<_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')];_0x3dfb51+=0x1){db['MemberReport'][_0xe032('0x39')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836['user']['name'],'type':_0xe032('0x35'),'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51],'exitAt':null},'defaults':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'interface':_[_0xe032('0x13')](_0x4dc836[_0xe032('0x31')][_0xe032('0x3a')])?util[_0xe032('0x3b')](_0xe032('0x3c'),_0x4dc836[_0xe032('0x31')][_0xe032('0x11')]):_0x4dc836['user'][_0xe032('0x3a')],'type':_0xe032('0x35'),'enterAt':moment()['format'](_0xe032('0x37')),'role':_0xe032('0x3d'),'internal':_0x4dc836[_0xe032('0x31')][_0xe032('0x3e')],'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51]}});}}}}return respondWithRpcPromise(_0xe032('0x3f'),{'id':_0x4dc836[_0xe032('0x20')]['id'],'capacity':_0x4dc836[_0xe032('0x2f')][_0xe032('0x40')]},routingClient)[_0xe032('0x8')](respondWithResult(_0x477360,null))[_0xe032('0xd')](handleError(_0x477360,null));};exports[_0xe032('0x41')]=function(_0x2f8114,_0x4eabfc){return respondWithRpcPromise(_0xe032('0x42'),_0x2f8114['query'])[_0xe032('0x8')](respondWithResult(_0x4eabfc,null))[_0xe032('0xd')](handleError(_0x4eabfc,null));};exports[_0xe032('0x43')]=function(_0x11ae58,_0x41289d){return respondWithRpcPromise(_0xe032('0x44'),_0x11ae58[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x41289d,null))[_0xe032('0xd')](handleError(_0x41289d,null));};exports[_0xe032('0x45')]=function(_0x1b9012,_0x564fe0){return respondWithRpcPromise(_0xe032('0x46'),_0x1b9012[_0xe032('0x17')])['then'](respondWithResult(_0x564fe0,null))[_0xe032('0xd')](handleError(_0x564fe0,null));};exports['chatQueues']=function(_0x39b878,_0x1f2422){return respondWithRpcPromise(_0xe032('0x47'),_0x39b878[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1f2422,null))['catch'](handleError(_0x1f2422,null));};exports[_0xe032('0x48')]=function(_0x2dbc33,_0x1e1277){return respondWithRpcPromise(_0xe032('0x47'),_0x2dbc33[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x2dbc33[_0xe032('0x20')]['id']))['then'](respondWithResult(_0x1e1277,null))[_0xe032('0xd')](handleError(_0x1e1277,null));};exports[_0xe032('0x49')]=function(_0x454b29,_0x15325e){return respondWithRpcPromise(_0xe032('0x4a'),_0x454b29[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x15325e,null))[_0xe032('0xd')](handleError(_0x15325e,null));};exports[_0xe032('0x4b')]=function(_0x54c0b0,_0x795a58){return respondWithRpcPromise(_0xe032('0x4a'),_0x54c0b0[_0xe032('0x17')],routingClient)['then'](findById(_0x54c0b0[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x795a58,null))['catch'](handleError(_0x795a58,null));};exports[_0xe032('0x4c')]=function(_0x29dfa7,_0x43ad0d){return respondWithRpcPromise(_0xe032('0x4d'),_0x29dfa7[_0xe032('0x17')],mailClient)[_0xe032('0x8')](respondWithResult(_0x43ad0d,null))[_0xe032('0xd')](handleError(_0x43ad0d,null));};exports[_0xe032('0x4e')]=function(_0x1aa18e,_0x19ce2b){return respondWithRpcPromise(_0xe032('0x4f'),_0x1aa18e['query'],routingClient)[_0xe032('0x8')](respondWithResult(_0x19ce2b,null))[_0xe032('0xd')](handleError(_0x19ce2b,null));};exports[_0xe032('0x50')]=function(_0xd5cf55,_0x3d7a3f){return respondWithRpcPromise('OpenchannelQueues',_0xd5cf55[_0xe032('0x17')],routingClient)['then'](findById(_0xd5cf55[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x3d7a3f,null))[_0xe032('0xd')](handleError(_0x3d7a3f,null));};exports[_0xe032('0x51')]=function(_0x3c5eb8,_0x1ddb11){return respondWithRpcPromise(_0xe032('0x52'),_0x3c5eb8[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1ddb11,null))['catch'](handleError(_0x1ddb11,null));};exports['showSmsQueues']=function(_0x5c516a,_0x221473){return respondWithRpcPromise(_0xe032('0x52'),_0x5c516a[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x5c516a[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x221473,null))['catch'](handleError(_0x221473,null));};exports[_0xe032('0x53')]=function(_0x1d66c3,_0x1018d4){return respondWithRpcPromise('WhatsappQueues',_0x1d66c3[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x1018d4,null))[_0xe032('0xd')](handleError(_0x1018d4,null));};exports[_0xe032('0x54')]=function(_0x48063d,_0x590905){return respondWithRpcPromise('WhatsappQueues',_0x48063d[_0xe032('0x17')],routingClient)['then'](findById(_0x48063d['params']['id']))[_0xe032('0x8')](respondWithResult(_0x590905,null))[_0xe032('0xd')](handleError(_0x590905,null));};exports[_0xe032('0x55')]=function(_0x4ed078,_0x193a0f){return respondWithRpcPromise('FaxQueues',_0x4ed078[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x193a0f,null))[_0xe032('0xd')](handleError(_0x193a0f,null));};exports[_0xe032('0x56')]=function(_0x1f24ec,_0x2b987b){return respondWithRpcPromise(_0xe032('0x57'),_0x1f24ec[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x1f24ec[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x2b987b,null))['catch'](handleError(_0x2b987b,null));};exports[_0xe032('0x58')]=function(_0x338ef2,_0x5aa7a6){return respondWithRpcPromise('FaxAccounts',_0x338ef2[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x5aa7a6,null))[_0xe032('0xd')](handleError(_0x5aa7a6,null));};exports[_0xe032('0x59')]=function(_0x1e38bd,_0x23922e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1e38bd[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x23922e,null))['catch'](handleError(_0x23922e,null));};exports[_0xe032('0x5a')]=function(_0x2ea4a5,_0x1c3601){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2ea4a5[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1c3601,null))[_0xe032('0xd')](handleError(_0x1c3601,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52dfa0,_0xdd691c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52dfa0[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0xdd691c,null))[_0xe032('0xd')](handleError(_0xdd691c,null));};exports[_0xe032('0x5b')]=function(_0x37af62,_0x443fcc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37af62[_0xe032('0x17')],routingClient)[_0xe032('0x8')](function(_0x33e7c3){if(_0x37af62['query'][_0xe032('0x5c')]!==undefined){var _0x48e9c9=_(_0x33e7c3[_0xe032('0x14')])['filter']([_0x37af62[_0xe032('0x17')][_0xe032('0x5c')],_0x37af62[_0xe032('0x20')]['id']])['map'](_0xe032('0x5d'))[_0xe032('0x5e')]()[_0xe032('0x5f')]();return _0x33e7c3[_0xe032('0x14')][_0xe032('0x60')](function(_0x2a2c98){return _0x48e9c9['indexOf'](_0x2a2c98[_0xe032('0x5d')])>-0x1;});}else{return _0x33e7c3[_0xe032('0x14')]['filter'](function(_0x50fd01){return _0x50fd01[_0xe032('0x5d')]===parseInt(_0x37af62[_0xe032('0x20')]['id']);});}})[_0xe032('0x8')](respondWithResult(_0x443fcc,null))[_0xe032('0xd')](handleError(_0x443fcc,null));};exports[_0xe032('0x61')]=function(_0x54803e,_0x3a04b9){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x54803e[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x3a04b9,null))[_0xe032('0xd')](handleError(_0x3a04b9,null));};exports[_0xe032('0x62')]=function(_0x36137b,_0x2ecdc7){return respondWithRpcPromise(_0xe032('0x63'),_0x36137b[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x2ecdc7,null))[_0xe032('0xd')](handleError(_0x2ecdc7,null));};exports['faxQueuesWaitingInteractions']=function(_0x4ee54a,_0x485458){return respondWithRpcPromise(_0xe032('0x64'),_0x4ee54a[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x485458,null))[_0xe032('0xd')](handleError(_0x485458,null));};exports['queueNotify']=function(_0x5f42b1){return function(_0x2f2b74,_0x10873b){var _0x577f56,_0x4ab179;var _0x45e28d=_[_0xe032('0x65')](_0x5f42b1);var _0x51d89a=_0x5f42b1===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db[_0x45e28d+_0xe032('0x69')]['findOne']({'raw':!![],'where':{'id':_0x2f2b74[_0xe032('0x20')]['id']}})['then'](function(_0x1caebf){if(_[_0xe032('0x13')](_0x1caebf)){throw new Error(_0x45e28d+_0xe032('0x6a'));}_0x577f56=_0x1caebf;return db[_0x45e28d+'Message'][_0xe032('0x6b')]({'where':{'id':_0x2f2b74[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x45e28d+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x45e28d+_0x51d89a],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3c1b08){if(_[_0xe032('0x13')](_0x3c1b08)){throw new Error(_0x45e28d+'\x20Message\x20not\x20found');}_0x4ab179=_0x3c1b08;return _0x3c1b08[_0xe032('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe032('0x8')](function(){var _0x27eb0c={'uniqueid':_0x5f42b1+'.'+_0x4ab179['id']+'.'+_0x4ab179[_0xe032('0x6c')]['id'],'FromUserId':_0x2f2b74[_0xe032('0x31')]['id'],'type':_0xe032('0x6e')};_0x27eb0c[_0x45e28d+_0xe032('0x6f')]=_0x4ab179['id'];_0x27eb0c[_0x45e28d+_0xe032('0x70')]=_0x4ab179[_0xe032('0x6c')]['id'];_0x27eb0c[_0xe032('0x71')+_0x45e28d+_0x51d89a+'Id']=_0x4ab179[_0xe032('0x68')]['id'];_0x27eb0c['To'+_0x45e28d+'QueueId']=_0x577f56['id'];return db[_0x45e28d+_0xe032('0x72')]['create'](_0x27eb0c);})[_0xe032('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x5f42b1,'interaction':_0x4ab179[_0xe032('0x6c')],'message':_0x4ab179,'account':_0x4ab179[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x577f56[_0xe032('0x11')]+','+(_0x4ab179['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe032('0x8')](respondWithResult(_0x10873b,null))[_0xe032('0xd')](handleError(_0x10873b,null));};};exports[_0xe032('0x73')]=function(_0x4e9f83,_0x210e7a){var _0x2e6dad,_0x2d68aa;if(_['isNil'](_0x4e9f83[_0xe032('0x2f')]['channel'])){throw new Error(_0xe032('0x74'));}var _0x868fad=_0x4e9f83[_0xe032('0x2f')][_0xe032('0x75')];var _0x3ee725=_[_0xe032('0x65')](_0x868fad);var _0x205058=_0x868fad===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e9f83[_0xe032('0x20')]['id'],'role':_0xe032('0x3d')}})[_0xe032('0x8')](function(_0x1d9498){if(_['isNil'](_0x1d9498)){throw new Error(_0xe032('0x76'));}_0x2e6dad=_0x1d9498;return db[_0x3ee725+_0xe032('0x77')][_0xe032('0x6b')]({'where':{'id':_0x4e9f83[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x3ee725+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x3ee725+_0x205058],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3cf0bc){if(_[_0xe032('0x13')](_0x3cf0bc)){throw new Error(_0x3ee725+_0xe032('0x78'));}_0x2d68aa=_0x3cf0bc;return _0x3cf0bc['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x56523f={'uniqueid':_0x868fad+'.'+_0x2d68aa['id']+'.'+_0x2d68aa['Interaction']['id'],'FromUserId':_0x4e9f83['user']['id'],'type':_0xe032('0x6e'),'ToUserId':_0x2e6dad['id']};_0x56523f[_0x3ee725+_0xe032('0x6f')]=_0x2d68aa['id'];_0x56523f[_0x3ee725+_0xe032('0x70')]=_0x2d68aa[_0xe032('0x6c')]['id'];_0x56523f[_0xe032('0x71')+_0x3ee725+_0x205058+'Id']=_0x2d68aa['Account']['id'];return db[_0x3ee725+_0xe032('0x72')][_0xe032('0x79')](_0x56523f);})[_0xe032('0x8')](function(){return respondWithRpcPromise(_0xe032('0x7a'),{'channel':_0x868fad,'interaction':_0x2d68aa[_0xe032('0x6c')],'message':_0x2d68aa,'account':_0x2d68aa[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe032('0x3d'),'appdata':_0x2e6dad[_0xe032('0x11')]+','+(_0x2d68aa[_0xe032('0x68')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x210e7a,null))[_0xe032('0xd')](handleError(_0x210e7a,null));}; \ No newline at end of file +var _0x9c5a=['Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','From','Start','bluebird','moment','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','SIP/%s','format','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5b44c4,_0x1c75b7){_0x5b44c4=_0x5b44c4-0x0;var _0x4c1fa0=_0x9c5a[_0x5b44c4];return _0x4c1fa0;};'use strict';var BPromise=require(_0xa9c5('0x0'));var moment=require(_0xa9c5('0x1'));var _=require('lodash');var util=require(_0xa9c5('0x2'));var db=require(_0xa9c5('0x3'))['db'];var logger=require(_0xa9c5('0x4'))(_0xa9c5('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa9c5('0x6')][_0xa9c5('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0xa9c5('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xa9c5('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3df556,_0x4cb597,_0x4b6db6){return new BPromise(function(_0x3d6b50,_0x16f331){var _0x52afb2=_0x4b6db6?_0x4b6db6:amiClient;return _0x52afb2[_0xa9c5('0x8')](_0x3df556,_0x4cb597)[_0xa9c5('0x9')](function(_0x51c14c){if(_0x51c14c[_0xa9c5('0xa')]){if(_0x51c14c[_0xa9c5('0xa')]['code']===0x1f4){return _0x16f331(_0x51c14c['error'][_0xa9c5('0xb')]);}return _0x3d6b50(_0x51c14c[_0xa9c5('0xa')][_0xa9c5('0xb')]);}else{_0x3d6b50(_0x51c14c[_0xa9c5('0xc')]);}})[_0xa9c5('0xd')](function(_0x4492a4){_0x16f331(_0x4492a4);});});}function respondWithResult(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xc8;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0xe')](_0x42d5cf)['json'](_0x3c5ac7);}return _0x51c8d[_0xa9c5('0xf')](0x194);};}function handleError(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0x1f4;return function(_0x3806c4){logger[_0xa9c5('0xa')](_0x3806c4[_0xa9c5('0x10')]);if(_0x3806c4[_0xa9c5('0x11')]){delete _0x3806c4[_0xa9c5('0x11')];}_0x1276d2[_0xa9c5('0xe')](_0x7df76d)[_0xa9c5('0x12')](_0x3806c4);};}function findById(_0x4bb57e){return function(_0x2b0d73){if(!_[_0xa9c5('0x13')](_0x4bb57e)&&!_[_0xa9c5('0x13')](_0x2b0d73)&&!_['isNil'](_0x2b0d73[_0xa9c5('0x14')])){return _[_0xa9c5('0x15')](_0x2b0d73[_0xa9c5('0x14')],function(_0x3b8cf7){return _0x3b8cf7['id']==_0x4bb57e;});}return null;};}exports[_0xa9c5('0x16')]=function(_0x349f27,_0x3b8d4d){return respondWithRpcPromise(_0xa9c5('0x17'),_0x349f27[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x3b8d4d,null))[_0xa9c5('0xd')](handleError(_0x3b8d4d,null));};exports[_0xa9c5('0x19')]=function(_0x54f8b9,_0x1115ad){return respondWithRpcPromise(_0xa9c5('0x1a'),_['merge'](_0x54f8b9['query'],_0x54f8b9[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x1115ad,null))[_0xa9c5('0xd')](handleError(_0x1115ad,null));};exports[_0xa9c5('0x1c')]=function(_0xc0bca3,_0xd4b8a1){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0xc0bca3[_0xa9c5('0x18')],_0xc0bca3[_0xa9c5('0x1b')]))['then'](respondWithResult(_0xd4b8a1,null))[_0xa9c5('0xd')](handleError(_0xd4b8a1,null));};exports[_0xa9c5('0x1d')]=function(_0x306c9b,_0x32fc7d){return respondWithRpcPromise(_0xa9c5('0x1e'),_0x306c9b[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x32fc7d,null))['catch'](handleError(_0x32fc7d,null));};exports['showVoiceQueues']=function(_0x242771,_0x4cd5e6){return respondWithRpcPromise(_0xa9c5('0x1e'),_0x242771[_0xa9c5('0x18')])['then'](findById(_0x242771[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4cd5e6,null))['catch'](handleError(_0x4cd5e6,null));};exports[_0xa9c5('0x1f')]=function(_0x32baf9,_0x198cdf){return respondWithRpcPromise(_0xa9c5('0x20'),_[_0xa9c5('0x21')](_0x32baf9['body'],_0x32baf9[_0xa9c5('0x1b')]))['then'](respondWithResult(_0x198cdf,null))[_0xa9c5('0xd')](handleError(_0x198cdf,null));};exports[_0xa9c5('0x22')]=function(_0x2eeed1,_0x541475){return respondWithRpcPromise(_0xa9c5('0x23'),_[_0xa9c5('0x21')](_0x2eeed1['query'],_0x2eeed1[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x541475,null))[_0xa9c5('0xd')](handleError(_0x541475,null));};exports[_0xa9c5('0x24')]=function(_0x22ee21,_0x3392d0){return respondWithRpcPromise(_0xa9c5('0x25'),_0x22ee21['query'])[_0xa9c5('0x9')](respondWithResult(_0x3392d0,null))[_0xa9c5('0xd')](handleError(_0x3392d0,null));};exports[_0xa9c5('0x26')]=function(_0x1c01f9,_0x1c617c){return respondWithRpcPromise(_0xa9c5('0x27'),_[_0xa9c5('0x21')](_0x1c01f9[_0xa9c5('0x18')],_0x1c01f9['params']))['then'](respondWithResult(_0x1c617c,null))[_0xa9c5('0xd')](handleError(_0x1c617c,null));};exports[_0xa9c5('0x28')]=function(_0xf2bebc,_0x1313b2){return respondWithRpcPromise(_0xa9c5('0x29'),_[_0xa9c5('0x21')](_0xf2bebc['query'],_0xf2bebc['params']))['then'](respondWithResult(_0x1313b2,null))[_0xa9c5('0xd')](handleError(_0x1313b2,null));};exports[_0xa9c5('0x2a')]=function(_0x5087e4,_0x13a1f5){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa9c5('0x21')](_0x5087e4[_0xa9c5('0x18')],_0x5087e4[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x13a1f5,null))['catch'](handleError(_0x13a1f5,null));};exports[_0xa9c5('0x2b')]=function(_0x2cd721,_0x191153){return respondWithRpcPromise(_0xa9c5('0x2c'),_0x2cd721[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x191153,null))[_0xa9c5('0xd')](handleError(_0x191153,null));};exports[_0xa9c5('0x2d')]=function(_0x573fc0,_0x11b2b2){return respondWithRpcPromise(_0xa9c5('0x2e'),_0x573fc0[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x11b2b2,null))[_0xa9c5('0xd')](handleError(_0x11b2b2,null));};exports[_0xa9c5('0x2f')]=function(_0x493b20,_0x307736){var _0x5b7a0a;return respondWithRpcPromise(_0xa9c5('0x30'),_0x493b20['query'])[_0xa9c5('0x9')](function(_0xd4305d){_0x5b7a0a=_0xd4305d;return respondWithRpcPromise(_0xa9c5('0x30'),_0x493b20['query'],routingClient);})[_0xa9c5('0x9')](function(_0x1ddd72){return _[_0xa9c5('0x21')]({},_0x1ddd72,_0x5b7a0a);})[_0xa9c5('0x9')](respondWithResult(_0x307736,null))['catch'](handleError(_0x307736,null));};exports[_0xa9c5('0x31')]=function(_0x97803f,_0x3db918){if(_0x97803f[_0xa9c5('0x32')]&&_0x97803f[_0xa9c5('0x32')]['interaction']&&_0x97803f[_0xa9c5('0x33')]&&_0x97803f['user'][_0xa9c5('0x11')]){for(var _0x397614 in _0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')]){if(_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0xa9c5('0x35')](_0x397614)){db[_0xa9c5('0x36')][_0xa9c5('0x37')]({'where':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')]['name'],'type':_0xa9c5('0x38'),'exitAt':null,'uniqueid':_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614]&&_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0xa9c5('0x39')]?{'$notIn':_0x97803f['body'][_0xa9c5('0x34')][_0x397614]}:{'$ne':null}}})[_0xa9c5('0x9')](function(_0x557c21){var _0x52cfbf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4e97bf=0x0,_0x160020=_0x557c21[_0xa9c5('0x39')];_0x4e97bf<_0x160020;_0x4e97bf+=0x1){_0x557c21[_0x4e97bf][_0xa9c5('0x3a')]({'exitAt':_0x52cfbf});}});for(var _0x1e8f5f=0x0;_0x1e8f5f<_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0xa9c5('0x39')];_0x1e8f5f+=0x1){db[_0xa9c5('0x36')][_0xa9c5('0x3b')]({'where':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x11')],'type':_0xa9c5('0x38'),'uniqueid':_0x97803f[_0xa9c5('0x32')]['interaction'][_0x397614][_0x1e8f5f],'exitAt':null},'defaults':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')]['name'],'interface':_[_0xa9c5('0x13')](_0x97803f[_0xa9c5('0x33')]['interface'])?util['format'](_0xa9c5('0x3c'),_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x11')]):_0x97803f['user']['interface'],'type':_0xa9c5('0x38'),'enterAt':moment()[_0xa9c5('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa9c5('0x3e'),'internal':_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x3f')],'uniqueid':_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0x1e8f5f]}});}}}}return respondWithRpcPromise(_0xa9c5('0x40'),{'id':_0x97803f['params']['id'],'capacity':_0x97803f['body']['capacity']},routingClient)[_0xa9c5('0x9')](respondWithResult(_0x3db918,null))[_0xa9c5('0xd')](handleError(_0x3db918,null));};exports[_0xa9c5('0x41')]=function(_0xef4d2,_0x380266){return respondWithRpcPromise(_0xa9c5('0x42'),_0xef4d2['query'])[_0xa9c5('0x9')](respondWithResult(_0x380266,null))[_0xa9c5('0xd')](handleError(_0x380266,null));};exports[_0xa9c5('0x43')]=function(_0x2bdc77,_0xa0b458){return respondWithRpcPromise(_0xa9c5('0x44'),_0x2bdc77['query'])['then'](respondWithResult(_0xa0b458,null))[_0xa9c5('0xd')](handleError(_0xa0b458,null));};exports['campaigns']=function(_0x1b158f,_0x5ea9b0){return respondWithRpcPromise(_0xa9c5('0x45'),_0x1b158f[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x46')]=function(_0xe5390f,_0x1a75f3){return respondWithRpcPromise(_0xa9c5('0x47'),_0xe5390f['query'],routingClient)['then'](respondWithResult(_0x1a75f3,null))[_0xa9c5('0xd')](handleError(_0x1a75f3,null));};exports[_0xa9c5('0x48')]=function(_0x3205f2,_0x5b4323){return respondWithRpcPromise(_0xa9c5('0x47'),_0x3205f2[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x3205f2[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x5b4323,null))[_0xa9c5('0xd')](handleError(_0x5b4323,null));};exports[_0xa9c5('0x49')]=function(_0x298b3d,_0x5a7f0a){return respondWithRpcPromise(_0xa9c5('0x4a'),_0x298b3d['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5a7f0a,null))[_0xa9c5('0xd')](handleError(_0x5a7f0a,null));};exports[_0xa9c5('0x4b')]=function(_0x4dfe3a,_0x4d475a){return respondWithRpcPromise(_0xa9c5('0x4a'),_0x4dfe3a['query'],routingClient)[_0xa9c5('0x9')](findById(_0x4dfe3a[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4d475a,null))[_0xa9c5('0xd')](handleError(_0x4d475a,null));};exports['mailAccounts']=function(_0x3505d3,_0x222091){return respondWithRpcPromise(_0xa9c5('0x4c'),_0x3505d3[_0xa9c5('0x18')],mailClient)['then'](respondWithResult(_0x222091,null))['catch'](handleError(_0x222091,null));};exports[_0xa9c5('0x4d')]=function(_0x3deb64,_0x67c1f8){return respondWithRpcPromise(_0xa9c5('0x4e'),_0x3deb64[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x67c1f8,null))['catch'](handleError(_0x67c1f8,null));};exports[_0xa9c5('0x4f')]=function(_0x1e787e,_0x2497e1){return respondWithRpcPromise(_0xa9c5('0x4e'),_0x1e787e[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1e787e[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x2497e1,null))[_0xa9c5('0xd')](handleError(_0x2497e1,null));};exports[_0xa9c5('0x50')]=function(_0x50d438,_0x5e17a2){return respondWithRpcPromise(_0xa9c5('0x51'),_0x50d438[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5e17a2,null))[_0xa9c5('0xd')](handleError(_0x5e17a2,null));};exports['showSmsQueues']=function(_0x1c2478,_0x4aa699){return respondWithRpcPromise(_0xa9c5('0x51'),_0x1c2478[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1c2478[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4aa699,null))[_0xa9c5('0xd')](handleError(_0x4aa699,null));};exports[_0xa9c5('0x52')]=function(_0x3890b4,_0x2f323e){return respondWithRpcPromise(_0xa9c5('0x53'),_0x3890b4[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2f323e,null))['catch'](handleError(_0x2f323e,null));};exports[_0xa9c5('0x54')]=function(_0x1a4aa7,_0x15eb25){return respondWithRpcPromise(_0xa9c5('0x53'),_0x1a4aa7[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1a4aa7[_0xa9c5('0x1b')]['id']))['then'](respondWithResult(_0x15eb25,null))['catch'](handleError(_0x15eb25,null));};exports[_0xa9c5('0x55')]=function(_0x502a00,_0x2ae087){return respondWithRpcPromise(_0xa9c5('0x56'),_0x502a00['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2ae087,null))[_0xa9c5('0xd')](handleError(_0x2ae087,null));};exports['showFaxQueues']=function(_0x4f8d9e,_0x14c4f2){return respondWithRpcPromise(_0xa9c5('0x56'),_0x4f8d9e[_0xa9c5('0x18')],routingClient)['then'](findById(_0x4f8d9e['params']['id']))[_0xa9c5('0x9')](respondWithResult(_0x14c4f2,null))[_0xa9c5('0xd')](handleError(_0x14c4f2,null));};exports['faxAccounts']=function(_0xd0371c,_0x393b00){return respondWithRpcPromise(_0xa9c5('0x57'),_0xd0371c[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x393b00,null))[_0xa9c5('0xd')](handleError(_0x393b00,null));};exports['chatQueuesWaitingInteractions']=function(_0x44d969,_0x3aeb3c){return respondWithRpcPromise(_0xa9c5('0x58'),_0x44d969[_0xa9c5('0x18')],routingClient)['then'](respondWithResult(_0x3aeb3c,null))[_0xa9c5('0xd')](handleError(_0x3aeb3c,null));};exports[_0xa9c5('0x59')]=function(_0x59e917,_0x112d64){return respondWithRpcPromise(_0xa9c5('0x5a'),_0x59e917[_0xa9c5('0x18')],routingClient)['then'](respondWithResult(_0x112d64,null))[_0xa9c5('0xd')](handleError(_0x112d64,null));};exports[_0xa9c5('0x5b')]=function(_0x18dbfa,_0x2e00f5){return respondWithRpcPromise(_0xa9c5('0x5c'),_0x18dbfa[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2e00f5,null))['catch'](handleError(_0x2e00f5,null));};exports[_0xa9c5('0x5d')]=function(_0x40468b,_0x7f9e83){return respondWithRpcPromise(_0xa9c5('0x5c'),_0x40468b[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](function(_0x39fae1){if(_0x40468b[_0xa9c5('0x18')][_0xa9c5('0x5e')]!==undefined){var _0x7d0e85=_(_0x39fae1[_0xa9c5('0x14')])['filter']([_0x40468b[_0xa9c5('0x18')][_0xa9c5('0x5e')],_0x40468b['params']['id']])[_0xa9c5('0x5f')](_0xa9c5('0x60'))[_0xa9c5('0x61')]()['value']();return _0x39fae1[_0xa9c5('0x14')][_0xa9c5('0x62')](function(_0x22dfd7){return _0x7d0e85[_0xa9c5('0x63')](_0x22dfd7['queue_id'])>-0x1;});}else{return _0x39fae1[_0xa9c5('0x14')][_0xa9c5('0x62')](function(_0x4f4fa1){return _0x4f4fa1['queue_id']===parseInt(_0x40468b['params']['id']);});}})['then'](respondWithResult(_0x7f9e83,null))['catch'](handleError(_0x7f9e83,null));};exports['smsQueuesWaitingInteractions']=function(_0x5277ee,_0x54c8f5){return respondWithRpcPromise(_0xa9c5('0x64'),_0x5277ee[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x54c8f5,null))[_0xa9c5('0xd')](handleError(_0x54c8f5,null));};exports[_0xa9c5('0x65')]=function(_0x592594,_0x4d7772){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x592594['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x4d7772,null))[_0xa9c5('0xd')](handleError(_0x4d7772,null));};exports[_0xa9c5('0x66')]=function(_0x2eda17,_0x5253e8){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x2eda17[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5253e8,null))[_0xa9c5('0xd')](handleError(_0x5253e8,null));};exports[_0xa9c5('0x67')]=function(_0x1d89ec){return function(_0x5673f1,_0x2b69b9){var _0x43ae9,_0xd063cf;var _0x58de52=_[_0xa9c5('0x68')](_0x1d89ec);var _0x2741df=_0x1d89ec===_0xa9c5('0x69')?_0xa9c5('0x6a'):'Account';return db[_0x58de52+_0xa9c5('0x6b')][_0xa9c5('0x6c')]({'raw':!![],'where':{'id':_0x5673f1['params']['id']}})['then'](function(_0x2f1e9f){if(_['isNil'](_0x2f1e9f)){throw new Error(_0x58de52+'\x20Queue\x20not\x20found');}_0x43ae9=_0x2f1e9f;return db[_0x58de52+_0xa9c5('0x6d')][_0xa9c5('0x6c')]({'where':{'id':_0x5673f1[_0xa9c5('0x32')][_0xa9c5('0x6e')]},'include':[{'model':db[_0x58de52+_0xa9c5('0x6f')],'as':'Interaction'},{'model':db[_0x58de52+_0x2741df],'as':_0xa9c5('0x70')}]});})['then'](function(_0x129157){if(_[_0xa9c5('0x13')](_0x129157)){throw new Error(_0x58de52+_0xa9c5('0x71'));}_0xd063cf=_0x129157;return _0x129157[_0xa9c5('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4b056e={'uniqueid':_0x1d89ec+'.'+_0xd063cf['id']+'.'+_0xd063cf[_0xa9c5('0x6f')]['id'],'FromUserId':_0x5673f1['user']['id'],'type':'queue'};_0x4b056e[_0x58de52+_0xa9c5('0x73')]=_0xd063cf['id'];_0x4b056e[_0x58de52+_0xa9c5('0x74')]=_0xd063cf['Interaction']['id'];_0x4b056e['From'+_0x58de52+_0x2741df+'Id']=_0xd063cf[_0xa9c5('0x70')]['id'];_0x4b056e['To'+_0x58de52+_0xa9c5('0x75')]=_0x43ae9['id'];return db[_0x58de52+_0xa9c5('0x76')][_0xa9c5('0x77')](_0x4b056e);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x1d89ec,'interaction':_0xd063cf[_0xa9c5('0x6f')],'message':_0xd063cf,'account':_0xd063cf[_0xa9c5('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa9c5('0x78'),'appdata':_0x43ae9[_0xa9c5('0x11')]+','+(_0xd063cf[_0xa9c5('0x70')][_0xa9c5('0x79')]||0x12c),'interval':_0xa9c5('0x7a')}]},routingClient);})['then'](respondWithResult(_0x2b69b9,null))[_0xa9c5('0xd')](handleError(_0x2b69b9,null));};};exports[_0xa9c5('0x7b')]=function(_0x5065e2,_0x328869){var _0x2488aa,_0x5544d8;if(_[_0xa9c5('0x13')](_0x5065e2[_0xa9c5('0x32')][_0xa9c5('0x7c')])){throw new Error(_0xa9c5('0x7d'));}var _0x21e3ba=_0x5065e2[_0xa9c5('0x32')][_0xa9c5('0x7c')];var _0x13e233=_[_0xa9c5('0x68')](_0x21e3ba);var _0x24a6d3=_0x21e3ba===_0xa9c5('0x69')?_0xa9c5('0x6a'):_0xa9c5('0x70');return db[_0xa9c5('0x7e')][_0xa9c5('0x6c')]({'raw':!![],'where':{'id':_0x5065e2[_0xa9c5('0x1b')]['id'],'role':_0xa9c5('0x3e')}})['then'](function(_0x425b92){if(_[_0xa9c5('0x13')](_0x425b92)){throw new Error(_0xa9c5('0x7f'));}_0x2488aa=_0x425b92;return db[_0x13e233+'Message'][_0xa9c5('0x6c')]({'where':{'id':_0x5065e2[_0xa9c5('0x32')]['messageId']},'include':[{'model':db[_0x13e233+_0xa9c5('0x6f')],'as':_0xa9c5('0x6f')},{'model':db[_0x13e233+_0x24a6d3],'as':_0xa9c5('0x70')}]});})[_0xa9c5('0x9')](function(_0x343b35){if(_[_0xa9c5('0x13')](_0x343b35)){throw new Error(_0x13e233+_0xa9c5('0x71'));}_0x5544d8=_0x343b35;return _0x343b35[_0xa9c5('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa9c5('0x9')](function(){var _0xb09d88={'uniqueid':_0x21e3ba+'.'+_0x5544d8['id']+'.'+_0x5544d8[_0xa9c5('0x6f')]['id'],'FromUserId':_0x5065e2[_0xa9c5('0x33')]['id'],'type':_0xa9c5('0x78'),'ToUserId':_0x2488aa['id']};_0xb09d88[_0x13e233+'MessageId']=_0x5544d8['id'];_0xb09d88[_0x13e233+'InteractionId']=_0x5544d8[_0xa9c5('0x6f')]['id'];_0xb09d88[_0xa9c5('0x80')+_0x13e233+_0x24a6d3+'Id']=_0x5544d8['Account']['id'];return db[_0x13e233+_0xa9c5('0x76')][_0xa9c5('0x77')](_0xb09d88);})[_0xa9c5('0x9')](function(){return respondWithRpcPromise(_0xa9c5('0x81'),{'channel':_0x21e3ba,'interaction':_0x5544d8['Interaction'],'message':_0x5544d8,'account':_0x5544d8['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa9c5('0x3e'),'appdata':_0x2488aa[_0xa9c5('0x11')]+','+(_0x5544d8[_0xa9c5('0x70')]['agentTransferTimeout']||0x12c),'interval':_0xa9c5('0x7a')}]},routingClient);})[_0xa9c5('0x9')](respondWithResult(_0x328869,null))[_0xa9c5('0xd')](handleError(_0x328869,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b6f95b7..6f51a92 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 _0xbfc3=['path','connect-timeout','express','Router','../../components/auth/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','put','destroy','exports','multer','util'];(function(_0x3d96c7,_0x25955e){var _0x44adce=function(_0x25fd9e){while(--_0x25fd9e){_0x3d96c7['push'](_0x3d96c7['shift']());}};_0x44adce(++_0x25955e);}(_0xbfc3,0x1ec));var _0x3bfc=function(_0x27bf51,_0x4892bd){_0x27bf51=_0x27bf51-0x0;var _0x5a6415=_0xbfc3[_0x27bf51];return _0x5a6415;};'use strict';var multer=require(_0x3bfc('0x0'));var util=require(_0x3bfc('0x1'));var path=require(_0x3bfc('0x2'));var timeout=require(_0x3bfc('0x3'));var express=require(_0x3bfc('0x4'));var router=express[_0x3bfc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3bfc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bfc('0x7'));router[_0x3bfc('0x8')]('/',auth[_0x3bfc('0x9')](),controller[_0x3bfc('0xa')]);router[_0x3bfc('0x8')](_0x3bfc('0xb'),auth[_0x3bfc('0x9')](),controller[_0x3bfc('0xc')]);router['get'](_0x3bfc('0xd'),auth[_0x3bfc('0x9')](),controller[_0x3bfc('0xe')]);router[_0x3bfc('0xf')]('/',auth[_0x3bfc('0x9')](),controller['create']);router[_0x3bfc('0x10')](_0x3bfc('0xb'),auth[_0x3bfc('0x9')](),controller['update']);router['delete'](_0x3bfc('0xb'),auth[_0x3bfc('0x9')](),controller[_0x3bfc('0x11')]);module[_0x3bfc('0x12')]=router; \ No newline at end of file +var _0xffbb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','destroy'];(function(_0x3e9516,_0x454408){var _0x37e2ab=function(_0x459edd){while(--_0x459edd){_0x3e9516['push'](_0x3e9516['shift']());}};_0x37e2ab(++_0x454408);}(_0xffbb,0x15f));var _0xbffb=function(_0x3b69f2,_0xea851e){_0x3b69f2=_0x3b69f2-0x0;var _0x191fb2=_0xffbb[_0x3b69f2];return _0x191fb2;};'use strict';var multer=require(_0xbffb('0x0'));var util=require(_0xbffb('0x1'));var path=require(_0xbffb('0x2'));var timeout=require(_0xbffb('0x3'));var express=require(_0xbffb('0x4'));var router=express[_0xbffb('0x5')]();var fs_extra=require(_0xbffb('0x6'));var auth=require(_0xbffb('0x7'));var interaction=require(_0xbffb('0x8'));var config=require(_0xbffb('0x9'));var controller=require(_0xbffb('0xa'));router[_0xbffb('0xb')]('/',auth['isAuthenticated'](),controller[_0xbffb('0xc')]);router[_0xbffb('0xb')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0xf')]);router['get'](_0xbffb('0x10'),auth['isAuthenticated'](),controller[_0xbffb('0x11')]);router[_0xbffb('0x12')]('/',auth[_0xbffb('0xe')](),controller[_0xbffb('0x13')]);router[_0xbffb('0x14')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0x15')]);router[_0xbffb('0x16')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0x17')]);module[_0xbffb('0x18')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 731093a..0d5491d 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 _0xf082=['DATE','INTEGER','quarters','months','weeks','days','hours','ENUM','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0xa311f9,_0x1fe6a9){var _0x300eea=function(_0x317484){while(--_0x317484){_0xa311f9['push'](_0xa311f9['shift']());}};_0x300eea(++_0x1fe6a9);}(_0xf082,0x13f));var _0x2f08=function(_0x8d27e9,_0x29c200){_0x8d27e9=_0x8d27e9-0x0;var _0x424796=_0xf082[_0x8d27e9];return _0x424796;};'use strict';var Sequelize=require(_0x2f08('0x0'));module[_0x2f08('0x1')]={'name':{'type':Sequelize[_0x2f08('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2f08('0x2')]},'active':{'type':Sequelize[_0x2f08('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2f08('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x2f08('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2f08('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x2f08('0x6'),_0x2f08('0x7'),_0x2f08('0x8'),_0x2f08('0x9'),_0x2f08('0xa'),'minutes'),'allowNull':![],'defaultValue':_0x2f08('0x9')},'output':{'type':Sequelize[_0x2f08('0xb')](_0x2f08('0xc'),_0x2f08('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x2f08('0xc')},'type':{'type':Sequelize[_0x2f08('0xb')](_0x2f08('0xe'),_0x2f08('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x2f08('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x2f08('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x2f08('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5ed3=['minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','days','hours'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0x5ed3,0xc2));var _0x35ed=function(_0x151d79,_0x422c2b){_0x151d79=_0x151d79-0x0;var _0xe551a0=_0x5ed3[_0x151d79];return _0xe551a0;};'use strict';var Sequelize=require(_0x35ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x35ed('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x35ed('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x35ed('0x1')],'allowNull':![],'defaultValue':_0x35ed('0x3')},'startAt':{'type':Sequelize[_0x35ed('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x35ed('0x5')](_0x35ed('0x6'),'quarters',_0x35ed('0x7'),'weeks',_0x35ed('0x8'),_0x35ed('0x9'),_0x35ed('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x35ed('0xb'),_0x35ed('0xc'),_0x35ed('0xd')),'allowNull':![],'defaultValue':_0x35ed('0xb')},'type':{'type':Sequelize[_0x35ed('0x5')](_0x35ed('0xe'),_0x35ed('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x35ed('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x35ed('0x1')]},'cc':{'type':Sequelize[_0x35ed('0x10')]},'bcc':{'type':Sequelize[_0x35ed('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a3163e5..a9fb525 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 _0x4444=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Schedule','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','catch','params','includeAll','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Scheduler','UserProfileSection','find','userProfileId','autoAssociation','run','../../config/schedule','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x903227,_0x4ad4f7){var _0x2e6d5a=function(_0x269869){while(--_0x269869){_0x903227['push'](_0x903227['shift']());}};_0x2e6d5a(++_0x4ad4f7);}(_0x4444,0x191));var _0x4444=function(_0x484032,_0x11ce70){_0x484032=_0x484032-0x0;var _0xec7c10=_0x4444[_0x484032];return _0xec7c10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4444('0x0'));var jsonpatch=require(_0x4444('0x1'));var rp=require('request-promise');var moment=require(_0x4444('0x2'));var BPromise=require(_0x4444('0x3'));var Mustache=require(_0x4444('0x4'));var util=require(_0x4444('0x5'));var path=require(_0x4444('0x6'));var sox=require(_0x4444('0x7'));var csv=require(_0x4444('0x8'));var ejs=require(_0x4444('0x9'));var fs=require('fs');var fs_extra=require(_0x4444('0xa'));var _=require(_0x4444('0xb'));var squel=require('squel');var crypto=require(_0x4444('0xc'));var jsforce=require(_0x4444('0xd'));var deskjs=require(_0x4444('0xe'));var toCsv=require(_0x4444('0x8'));var querystring=require(_0x4444('0xf'));var Papa=require(_0x4444('0x10'));var Redis=require(_0x4444('0x11'));var authService=require(_0x4444('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4444('0x13'));var hardwareService=require(_0x4444('0x14'));var logger=require(_0x4444('0x15'))(_0x4444('0x16'));var utils=require(_0x4444('0x17'));var config=require(_0x4444('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4444('0x19'))['db'];function respondWithStatusCode(_0x378e7d,_0x1e094d){_0x1e094d=_0x1e094d||0xcc;return function(_0x96b1e5){if(_0x96b1e5){return _0x378e7d[_0x4444('0x1a')](_0x1e094d);}return _0x378e7d[_0x4444('0x1b')](_0x1e094d)[_0x4444('0x1c')]();};}function respondWithResult(_0x34db2e,_0x28b1fd){_0x28b1fd=_0x28b1fd||0xc8;return function(_0x5c453e){if(_0x5c453e){return _0x34db2e[_0x4444('0x1b')](_0x28b1fd)[_0x4444('0x1d')](_0x5c453e);}};}function respondWithFilteredResult(_0x1fbe2d,_0x17ea02){return function(_0x22cab9){if(_0x22cab9){var _0x93d99d=typeof _0x17ea02['offset']===_0x4444('0x1e')&&typeof _0x17ea02[_0x4444('0x1f')]===_0x4444('0x1e');var _0x573dcc=_0x22cab9['count'];var _0x49ec95=_0x93d99d?0x0:_0x17ea02[_0x4444('0x20')];var _0x47595f=_0x93d99d?_0x22cab9[_0x4444('0x21')]:_0x17ea02[_0x4444('0x20')]+_0x17ea02[_0x4444('0x1f')];var _0x9c810e;if(_0x47595f>=_0x573dcc){_0x47595f=_0x573dcc;_0x9c810e=0xc8;}else{_0x9c810e=0xce;}_0x1fbe2d[_0x4444('0x1b')](_0x9c810e);return _0x1fbe2d[_0x4444('0x22')](_0x4444('0x23'),_0x49ec95+'-'+_0x47595f+'/'+_0x573dcc)[_0x4444('0x1d')](_0x22cab9);}return null;};}function patchUpdates(_0x5ba7eb){return function(_0x390257){try{jsonpatch[_0x4444('0x24')](_0x390257,_0x5ba7eb,!![]);}catch(_0x448106){return BPromise[_0x4444('0x25')](_0x448106);}return _0x390257['save']();};}function saveUpdates(_0x1238f8,_0x311f1b){return function(_0x1f1e45){if(_0x1f1e45){return _0x1f1e45[_0x4444('0x26')](_0x1238f8)[_0x4444('0x27')](function(_0xeb4e6c){return _0xeb4e6c;});}return null;};}function removeEntity(_0x52f86e,_0x8c00ca){return function(_0x1431b8){if(_0x1431b8){return _0x1431b8[_0x4444('0x28')]()[_0x4444('0x27')](function(){var _0x438f6c=_0x1431b8[_0x4444('0x29')]({'plain':!![]});var _0x9f431='Scheduler';return db[_0x4444('0x2a')][_0x4444('0x28')]({'where':{'type':_0x9f431,'resourceId':_0x438f6c['id']}})[_0x4444('0x27')](function(){return _0x1431b8;});})['then'](function(){_0x52f86e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db67e,_0x8541c){return function(_0x346380){if(!_0x346380){_0x2db67e[_0x4444('0x1a')](0x194);}return _0x346380;};}function handleError(_0x2a8183,_0xe413b){_0xe413b=_0xe413b||0x1f4;return function(_0x364e96){logger[_0x4444('0x2b')](_0x364e96[_0x4444('0x2c')]);if(_0x364e96[_0x4444('0x2d')]){delete _0x364e96['name'];}_0x2a8183['status'](_0xe413b)[_0x4444('0x2e')](_0x364e96);};}exports[_0x4444('0x2f')]=function(_0x59947b,_0x511e6b){var _0x451c36={},_0x31dd7c={},_0x379731={'count':0x0,'rows':[]};var _0x2437ab=_[_0x4444('0x30')](db[_0x4444('0x31')]['rawAttributes'],function(_0x39c054){return{'name':_0x39c054[_0x4444('0x32')],'type':_0x39c054[_0x4444('0x33')]['key']};});_0x31dd7c['model']=_[_0x4444('0x30')](_0x2437ab,_0x4444('0x2d'));_0x31dd7c[_0x4444('0x34')]=_[_0x4444('0x35')](_0x59947b['query']);_0x31dd7c[_0x4444('0x36')]=_[_0x4444('0x37')](_0x31dd7c['model'],_0x31dd7c[_0x4444('0x34')]);_0x451c36['attributes']=_[_0x4444('0x37')](_0x31dd7c[_0x4444('0x38')],qs['fields'](_0x59947b['query'][_0x4444('0x39')]));_0x451c36[_0x4444('0x3a')]=_0x451c36['attributes'][_0x4444('0x3b')]?_0x451c36[_0x4444('0x3a')]:_0x31dd7c['model'];if(!_0x59947b['query']['hasOwnProperty']('nolimit')){_0x451c36[_0x4444('0x1f')]=qs[_0x4444('0x1f')](_0x59947b[_0x4444('0x34')]['limit']);_0x451c36['offset']=qs[_0x4444('0x20')](_0x59947b[_0x4444('0x34')][_0x4444('0x20')]);}_0x451c36[_0x4444('0x3c')]=qs[_0x4444('0x3d')](_0x59947b[_0x4444('0x34')]['sort']);_0x451c36[_0x4444('0x3e')]=qs[_0x4444('0x36')](_[_0x4444('0x3f')](_0x59947b['query'],_0x31dd7c[_0x4444('0x36')]),_0x2437ab);if(_0x59947b['query'][_0x4444('0x40')]){_0x451c36['where']=_[_0x4444('0x41')](_0x451c36[_0x4444('0x3e')],{'$or':_[_0x4444('0x30')](_0x2437ab,function(_0x6ea034){if(_0x6ea034['type']!==_0x4444('0x42')){var _0x21e635={};_0x21e635[_0x6ea034[_0x4444('0x2d')]]={'$like':'%'+_0x59947b[_0x4444('0x34')]['filter']+'%'};return _0x21e635;}})});}_0x451c36=_[_0x4444('0x41')]({},_0x451c36,_0x59947b['options']);var _0x140c73={'where':_0x451c36['where']};return db['Schedule']['count'](_0x140c73)[_0x4444('0x27')](function(_0x276ed7){_0x379731[_0x4444('0x21')]=_0x276ed7;if(_0x59947b[_0x4444('0x34')]['includeAll']){_0x451c36['include']=[{'all':!![]}];}return db[_0x4444('0x31')]['findAll'](_0x451c36);})[_0x4444('0x27')](function(_0x49fd71){_0x379731['rows']=_0x49fd71;return _0x379731;})[_0x4444('0x27')](respondWithFilteredResult(_0x511e6b,_0x451c36))[_0x4444('0x43')](handleError(_0x511e6b,null));};exports['show']=function(_0x12ad0a,_0x72ef62){var _0x526f49={'raw':![],'where':{'id':_0x12ad0a[_0x4444('0x44')]['id']}},_0x1679b5={};_0x1679b5[_0x4444('0x38')]=_['keys'](db[_0x4444('0x31')]['rawAttributes']);_0x1679b5[_0x4444('0x34')]=_[_0x4444('0x35')](_0x12ad0a['query']);_0x1679b5[_0x4444('0x36')]=_[_0x4444('0x37')](_0x1679b5[_0x4444('0x38')],_0x1679b5['query']);_0x526f49[_0x4444('0x3a')]=_[_0x4444('0x37')](_0x1679b5[_0x4444('0x38')],qs['fields'](_0x12ad0a[_0x4444('0x34')][_0x4444('0x39')]));_0x526f49[_0x4444('0x3a')]=_0x526f49[_0x4444('0x3a')][_0x4444('0x3b')]?_0x526f49[_0x4444('0x3a')]:_0x1679b5[_0x4444('0x38')];if(_0x12ad0a[_0x4444('0x34')][_0x4444('0x45')]){_0x526f49[_0x4444('0x46')]=[{'all':!![]}];}_0x526f49=_['merge']({},_0x526f49,_0x12ad0a[_0x4444('0x47')]);return db[_0x4444('0x31')]['find'](_0x526f49)[_0x4444('0x27')](handleEntityNotFound(_0x72ef62,null))[_0x4444('0x27')](respondWithResult(_0x72ef62,null))[_0x4444('0x43')](handleError(_0x72ef62,null));};exports[_0x4444('0x48')]=function(_0x58d49d,_0x3500ec){return db[_0x4444('0x31')][_0x4444('0x48')](_0x58d49d[_0x4444('0x49')],{})['then'](function(_0x3eed14){var _0x5b78f7=_0x58d49d[_0x4444('0x4a')][_0x4444('0x29')]({'plain':!![]});if(!_0x5b78f7)throw new Error(_0x4444('0x4b'));if(_0x5b78f7['role']===_0x4444('0x4a')){var _0x2adc85=_0x3eed14[_0x4444('0x29')]({'plain':!![]});var _0x3308a6=_0x4444('0x4c');return db[_0x4444('0x4d')][_0x4444('0x4e')]({'where':{'name':_0x3308a6,'userProfileId':_0x5b78f7[_0x4444('0x4f')]},'raw':!![]})[_0x4444('0x27')](function(_0x374da5){if(_0x374da5&&_0x374da5[_0x4444('0x50')]===0x0){return db[_0x4444('0x2a')][_0x4444('0x48')]({'name':_0x2adc85[_0x4444('0x2d')],'resourceId':_0x2adc85['id'],'type':_0x374da5[_0x4444('0x2d')],'sectionId':_0x374da5['id']},{})[_0x4444('0x27')](function(){return _0x3eed14;});}else{return _0x3eed14;}})['catch'](function(_0x2e4f29){logger[_0x4444('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e4f29);throw _0x2e4f29;});}return _0x3eed14;})[_0x4444('0x27')](respondWithResult(_0x3500ec,0xc9))['catch'](handleError(_0x3500ec,null));};exports[_0x4444('0x26')]=function(_0x3c46b2,_0x9a6102){if(_0x3c46b2[_0x4444('0x49')]['id']){delete _0x3c46b2[_0x4444('0x49')]['id'];}return db['Schedule'][_0x4444('0x4e')]({'where':{'id':_0x3c46b2[_0x4444('0x44')]['id']}})[_0x4444('0x27')](handleEntityNotFound(_0x9a6102,null))[_0x4444('0x27')](saveUpdates(_0x3c46b2[_0x4444('0x49')],null))['then'](respondWithResult(_0x9a6102,null))['catch'](handleError(_0x9a6102,null));};exports['destroy']=function(_0x3e628a,_0x6b12c3){return db[_0x4444('0x31')]['find']({'where':{'id':_0x3e628a[_0x4444('0x44')]['id']}})['then'](handleEntityNotFound(_0x6b12c3,null))[_0x4444('0x27')](removeEntity(_0x6b12c3,null))[_0x4444('0x43')](handleError(_0x6b12c3,null));};exports[_0x4444('0x51')]=function(_0x3a4a4a,_0x50cf13,_0x46953e){var _0x1f655d=require(_0x4444('0x52'));return db[_0x4444('0x31')][_0x4444('0x4e')]({'where':{'id':_0x3a4a4a[_0x4444('0x44')]['id']},'raw':!![]})[_0x4444('0x27')](handleEntityNotFound(_0x50cf13,null))['then'](function(){_0x1f655d[_0x4444('0x51')](_0x3a4a4a[_0x4444('0x44')]['id']);})['then'](respondWithStatusCode(_0x50cf13,null))['catch'](handleError(_0x50cf13,null));}; \ No newline at end of file +var _0x7981=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','send','map','Schedule','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','name','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','user'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7981,0x1a9));var _0x1798=function(_0x3bae0a,_0x320c37){_0x3bae0a=_0x3bae0a-0x0;var _0x2a8cc7=_0x7981[_0x3bae0a];return _0x2a8cc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1798('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1798('0x1'));var rp=require(_0x1798('0x2'));var moment=require(_0x1798('0x3'));var BPromise=require(_0x1798('0x4'));var Mustache=require(_0x1798('0x5'));var util=require(_0x1798('0x6'));var path=require('path');var sox=require(_0x1798('0x7'));var csv=require(_0x1798('0x8'));var ejs=require(_0x1798('0x9'));var fs=require('fs');var fs_extra=require(_0x1798('0xa'));var _=require(_0x1798('0xb'));var squel=require(_0x1798('0xc'));var crypto=require(_0x1798('0xd'));var jsforce=require(_0x1798('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1798('0xf'));var Papa=require(_0x1798('0x10'));var Redis=require(_0x1798('0x11'));var authService=require(_0x1798('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1798('0x13'));var logger=require(_0x1798('0x14'))('api');var utils=require(_0x1798('0x15'));var config=require(_0x1798('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1798('0x17'))['db'];function respondWithStatusCode(_0x3cb0b9,_0x2f5901){_0x2f5901=_0x2f5901||0xcc;return function(_0x1254c2){if(_0x1254c2){return _0x3cb0b9[_0x1798('0x18')](_0x2f5901);}return _0x3cb0b9[_0x1798('0x19')](_0x2f5901)[_0x1798('0x1a')]();};}function respondWithResult(_0x1368e0,_0x5da820){_0x5da820=_0x5da820||0xc8;return function(_0x25edfc){if(_0x25edfc){return _0x1368e0[_0x1798('0x19')](_0x5da820)[_0x1798('0x1b')](_0x25edfc);}};}function respondWithFilteredResult(_0x515a8c,_0x42ef53){return function(_0xd733dd){if(_0xd733dd){var _0x1319fb=typeof _0x42ef53[_0x1798('0x1c')]===_0x1798('0x1d')&&typeof _0x42ef53['limit']===_0x1798('0x1d');var _0x23dd62=_0xd733dd['count'];var _0x41a3e2=_0x1319fb?0x0:_0x42ef53['offset'];var _0x513712=_0x1319fb?_0xd733dd[_0x1798('0x1e')]:_0x42ef53['offset']+_0x42ef53[_0x1798('0x1f')];var _0x50d95e;if(_0x513712>=_0x23dd62){_0x513712=_0x23dd62;_0x50d95e=0xc8;}else{_0x50d95e=0xce;}_0x515a8c['status'](_0x50d95e);return _0x515a8c[_0x1798('0x20')](_0x1798('0x21'),_0x41a3e2+'-'+_0x513712+'/'+_0x23dd62)[_0x1798('0x1b')](_0xd733dd);}return null;};}function patchUpdates(_0x4517aa){return function(_0x3f7c72){try{jsonpatch[_0x1798('0x22')](_0x3f7c72,_0x4517aa,!![]);}catch(_0x2ac54c){return BPromise[_0x1798('0x23')](_0x2ac54c);}return _0x3f7c72['save']();};}function saveUpdates(_0x14e401,_0x115f4b){return function(_0x5bbc96){if(_0x5bbc96){return _0x5bbc96['update'](_0x14e401)[_0x1798('0x24')](function(_0x22a4d3){return _0x22a4d3;});}return null;};}function removeEntity(_0x328eba,_0x51cd18){return function(_0x2e7c0b){if(_0x2e7c0b){return _0x2e7c0b[_0x1798('0x25')]()['then'](function(){var _0x878469=_0x2e7c0b['get']({'plain':!![]});var _0x3a2fc0='Scheduler';return db[_0x1798('0x26')]['destroy']({'where':{'type':_0x3a2fc0,'resourceId':_0x878469['id']}})[_0x1798('0x24')](function(){return _0x2e7c0b;});})['then'](function(){_0x328eba[_0x1798('0x19')](0xcc)[_0x1798('0x1a')]();});}};}function handleEntityNotFound(_0x7ad8c9,_0x4f85a6){return function(_0x5b9af0){if(!_0x5b9af0){_0x7ad8c9[_0x1798('0x18')](0x194);}return _0x5b9af0;};}function handleError(_0x40204c,_0x57b39a){_0x57b39a=_0x57b39a||0x1f4;return function(_0x256f02){logger[_0x1798('0x27')](_0x256f02[_0x1798('0x28')]);if(_0x256f02['name']){delete _0x256f02['name'];}_0x40204c[_0x1798('0x19')](_0x57b39a)[_0x1798('0x29')](_0x256f02);};}exports['index']=function(_0xdc94ea,_0x4faeae){var _0x386fe4={},_0x5a9ca1={},_0x114777={'count':0x0,'rows':[]};var _0x14014e=_[_0x1798('0x2a')](db[_0x1798('0x2b')][_0x1798('0x2c')],function(_0x3438e3){return{'name':_0x3438e3[_0x1798('0x2d')],'type':_0x3438e3[_0x1798('0x2e')]['key']};});_0x5a9ca1['model']=_[_0x1798('0x2a')](_0x14014e,'name');_0x5a9ca1[_0x1798('0x2f')]=_['keys'](_0xdc94ea[_0x1798('0x2f')]);_0x5a9ca1[_0x1798('0x30')]=_[_0x1798('0x31')](_0x5a9ca1[_0x1798('0x32')],_0x5a9ca1[_0x1798('0x2f')]);_0x386fe4[_0x1798('0x33')]=_[_0x1798('0x31')](_0x5a9ca1['model'],qs[_0x1798('0x34')](_0xdc94ea[_0x1798('0x2f')][_0x1798('0x34')]));_0x386fe4['attributes']=_0x386fe4[_0x1798('0x33')][_0x1798('0x35')]?_0x386fe4['attributes']:_0x5a9ca1[_0x1798('0x32')];if(!_0xdc94ea[_0x1798('0x2f')]['hasOwnProperty'](_0x1798('0x36'))){_0x386fe4[_0x1798('0x1f')]=qs[_0x1798('0x1f')](_0xdc94ea['query']['limit']);_0x386fe4['offset']=qs[_0x1798('0x1c')](_0xdc94ea['query']['offset']);}_0x386fe4['order']=qs['sort'](_0xdc94ea[_0x1798('0x2f')][_0x1798('0x37')]);_0x386fe4[_0x1798('0x38')]=qs[_0x1798('0x30')](_['pick'](_0xdc94ea[_0x1798('0x2f')],_0x5a9ca1['filters']),_0x14014e);if(_0xdc94ea['query'][_0x1798('0x39')]){_0x386fe4[_0x1798('0x38')]=_['merge'](_0x386fe4[_0x1798('0x38')],{'$or':_[_0x1798('0x2a')](_0x14014e,function(_0x5aaaa5){if(_0x5aaaa5[_0x1798('0x2e')]!==_0x1798('0x3a')){var _0x314c3d={};_0x314c3d[_0x5aaaa5[_0x1798('0x3b')]]={'$like':'%'+_0xdc94ea['query'][_0x1798('0x39')]+'%'};return _0x314c3d;}})});}_0x386fe4=_[_0x1798('0x3c')]({},_0x386fe4,_0xdc94ea[_0x1798('0x3d')]);var _0x370b04={'where':_0x386fe4['where']};return db[_0x1798('0x2b')][_0x1798('0x1e')](_0x370b04)[_0x1798('0x24')](function(_0x1ecb14){_0x114777[_0x1798('0x1e')]=_0x1ecb14;if(_0xdc94ea[_0x1798('0x2f')][_0x1798('0x3e')]){_0x386fe4['include']=[{'all':!![]}];}return db['Schedule'][_0x1798('0x3f')](_0x386fe4);})['then'](function(_0xe38e93){_0x114777[_0x1798('0x40')]=_0xe38e93;return _0x114777;})[_0x1798('0x24')](respondWithFilteredResult(_0x4faeae,_0x386fe4))[_0x1798('0x41')](handleError(_0x4faeae,null));};exports[_0x1798('0x42')]=function(_0x4de5c1,_0x1c05e2){var _0x1e7d4a={'raw':![],'where':{'id':_0x4de5c1['params']['id']}},_0x3b4a75={};_0x3b4a75['model']=_['keys'](db[_0x1798('0x2b')][_0x1798('0x2c')]);_0x3b4a75[_0x1798('0x2f')]=_[_0x1798('0x43')](_0x4de5c1[_0x1798('0x2f')]);_0x3b4a75[_0x1798('0x30')]=_['intersection'](_0x3b4a75[_0x1798('0x32')],_0x3b4a75[_0x1798('0x2f')]);_0x1e7d4a['attributes']=_['intersection'](_0x3b4a75[_0x1798('0x32')],qs[_0x1798('0x34')](_0x4de5c1[_0x1798('0x2f')][_0x1798('0x34')]));_0x1e7d4a['attributes']=_0x1e7d4a['attributes']['length']?_0x1e7d4a[_0x1798('0x33')]:_0x3b4a75['model'];if(_0x4de5c1[_0x1798('0x2f')][_0x1798('0x3e')]){_0x1e7d4a[_0x1798('0x44')]=[{'all':!![]}];}_0x1e7d4a=_['merge']({},_0x1e7d4a,_0x4de5c1['options']);return db[_0x1798('0x2b')][_0x1798('0x45')](_0x1e7d4a)[_0x1798('0x24')](handleEntityNotFound(_0x1c05e2,null))['then'](respondWithResult(_0x1c05e2,null))[_0x1798('0x41')](handleError(_0x1c05e2,null));};exports[_0x1798('0x46')]=function(_0x3e5217,_0x2161f4){return db['Schedule'][_0x1798('0x46')](_0x3e5217[_0x1798('0x47')],{})['then'](function(_0x1375d6){var _0x86b4da=_0x3e5217[_0x1798('0x48')][_0x1798('0x49')]({'plain':!![]});if(!_0x86b4da)throw new Error(_0x1798('0x4a'));if(_0x86b4da[_0x1798('0x4b')]===_0x1798('0x48')){var _0x3fedc4=_0x1375d6[_0x1798('0x49')]({'plain':!![]});var _0x32e57b=_0x1798('0x4c');return db[_0x1798('0x4d')][_0x1798('0x45')]({'where':{'name':_0x32e57b,'userProfileId':_0x86b4da[_0x1798('0x4e')]},'raw':!![]})[_0x1798('0x24')](function(_0x20a218){if(_0x20a218&&_0x20a218['autoAssociation']===0x0){return db[_0x1798('0x26')][_0x1798('0x46')]({'name':_0x3fedc4['name'],'resourceId':_0x3fedc4['id'],'type':_0x20a218[_0x1798('0x3b')],'sectionId':_0x20a218['id']},{})[_0x1798('0x24')](function(){return _0x1375d6;});}else{return _0x1375d6;}})[_0x1798('0x41')](function(_0x4594cb){logger['error'](_0x1798('0x4f'),_0x4594cb);throw _0x4594cb;});}return _0x1375d6;})[_0x1798('0x24')](respondWithResult(_0x2161f4,0xc9))[_0x1798('0x41')](handleError(_0x2161f4,null));};exports[_0x1798('0x50')]=function(_0xd48f2f,_0x1b3e06){if(_0xd48f2f[_0x1798('0x47')]['id']){delete _0xd48f2f['body']['id'];}return db['Schedule'][_0x1798('0x45')]({'where':{'id':_0xd48f2f[_0x1798('0x51')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x1b3e06,null))[_0x1798('0x24')](saveUpdates(_0xd48f2f[_0x1798('0x47')],null))['then'](respondWithResult(_0x1b3e06,null))[_0x1798('0x41')](handleError(_0x1b3e06,null));};exports[_0x1798('0x25')]=function(_0x9c78ea,_0x11e3ff){return db[_0x1798('0x2b')][_0x1798('0x45')]({'where':{'id':_0x9c78ea[_0x1798('0x51')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x11e3ff,null))[_0x1798('0x24')](removeEntity(_0x11e3ff,null))[_0x1798('0x41')](handleError(_0x11e3ff,null));};exports[_0x1798('0x52')]=function(_0x23823d,_0x5ed6c0,_0x40e3e8){var _0x2903c8=require('../../config/schedule');return db[_0x1798('0x2b')]['find']({'where':{'id':_0x23823d[_0x1798('0x51')]['id']},'raw':!![]})[_0x1798('0x24')](handleEntityNotFound(_0x5ed6c0,null))[_0x1798('0x24')](function(){_0x2903c8[_0x1798('0x52')](_0x23823d[_0x1798('0x51')]['id']);})['then'](respondWithStatusCode(_0x5ed6c0,null))[_0x1798('0x41')](handleError(_0x5ed6c0,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cd884fd..1adc567 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 _0xa0b4=['exports','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes'];(function(_0xb93732,_0x3ad6b9){var _0x1f1316=function(_0x2a5367){while(--_0x2a5367){_0xb93732['push'](_0xb93732['shift']());}};_0x1f1316(++_0x3ad6b9);}(_0xa0b4,0xfa));var _0x4a0b=function(_0x42eb4d,_0x4e7661){_0x42eb4d=_0x42eb4d-0x0;var _0x38e8c7=_0xa0b4[_0x42eb4d];return _0x38e8c7;};'use strict';var _=require(_0x4a0b('0x0'));var util=require(_0x4a0b('0x1'));var logger=require(_0x4a0b('0x2'))(_0x4a0b('0x3'));var moment=require(_0x4a0b('0x4'));var BPromise=require(_0x4a0b('0x5'));var rp=require(_0x4a0b('0x6'));var fs=require('fs');var path=require(_0x4a0b('0x7'));var rimraf=require('rimraf');var config=require(_0x4a0b('0x8'));var attributes=require(_0x4a0b('0x9'));module[_0x4a0b('0xa')]=function(_0x5915d4,_0x4cfaff){return _0x5915d4[_0x4a0b('0xb')]('Schedule',attributes,{'tableName':_0x4a0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f22=['bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','../../config/logger','api','moment'];(function(_0x544b78,_0x25c64a){var _0x448881=function(_0x16f1c1){while(--_0x16f1c1){_0x544b78['push'](_0x544b78['shift']());}};_0x448881(++_0x25c64a);}(_0x0f22,0x128));var _0x20f2=function(_0x475c3e,_0x29459d){_0x475c3e=_0x475c3e-0x0;var _0x46977a=_0x0f22[_0x475c3e];return _0x46977a;};'use strict';var _=require(_0x20f2('0x0'));var util=require('util');var logger=require(_0x20f2('0x1'))(_0x20f2('0x2'));var moment=require(_0x20f2('0x3'));var BPromise=require(_0x20f2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20f2('0x5'));var rimraf=require(_0x20f2('0x6'));var config=require(_0x20f2('0x7'));var attributes=require(_0x20f2('0x8'));module[_0x20f2('0x9')]=function(_0x32ec14,_0x2e4c05){return _0x32ec14[_0x20f2('0xa')](_0x20f2('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index b5e3eda..b43be65 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 _0xf995=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf995,0x182));var _0x5f99=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf995[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5f99('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f99('0x1'))['db'];var utils=require(_0x5f99('0x2'));var logger=require(_0x5f99('0x3'))(_0x5f99('0x4'));var config=require(_0x5f99('0x5'));var jayson=require(_0x5f99('0x6'));var client=jayson['client'][_0x5f99('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5910a5,_0x46e74e,_0x5b39e2){return new BPromise(function(_0xe89d66,_0x3ea99c){return client[_0x5f99('0x8')](_0x5910a5,_0x5b39e2)['then'](function(_0xcf81c){logger[_0x5f99('0x9')](_0x5f99('0xa'),_0x46e74e,_0x5f99('0xb'));logger[_0x5f99('0xc')](_0x5f99('0xd'),_0x46e74e,_0x5f99('0xb'),JSON['stringify'](_0xcf81c));if(_0xcf81c['error']){if(_0xcf81c[_0x5f99('0xe')][_0x5f99('0xf')]===0x1f4){logger[_0x5f99('0xe')]('Schedule,\x20%s,\x20%s',_0x46e74e,_0xcf81c['error']['message']);return _0x3ea99c(_0xcf81c[_0x5f99('0xe')]['message']);}logger['error'](_0x5f99('0xa'),_0x46e74e,_0xcf81c[_0x5f99('0xe')][_0x5f99('0x10')]);return _0xe89d66(_0xcf81c[_0x5f99('0xe')]['message']);}else{logger[_0x5f99('0x9')]('Schedule,\x20%s,\x20%s',_0x46e74e,'request\x20sent');_0xe89d66(_0xcf81c['result'][_0x5f99('0x10')]);}})[_0x5f99('0x11')](function(_0x5e2209){logger[_0x5f99('0xe')](_0x5f99('0xa'),_0x46e74e,_0x5e2209);_0x3ea99c(_0x5e2209);});});} \ No newline at end of file +var _0x48f7=['error','code','message','Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a0957,_0x4ecb2e){var _0x49b9d3=function(_0x49d45d){while(--_0x49d45d){_0x1a0957['push'](_0x1a0957['shift']());}};_0x49b9d3(++_0x4ecb2e);}(_0x48f7,0x124));var _0x748f=function(_0x212e3a,_0x2846f4){_0x212e3a=_0x212e3a-0x0;var _0x27c076=_0x48f7[_0x212e3a];return _0x27c076;};'use strict';var _=require(_0x748f('0x0'));var util=require(_0x748f('0x1'));var moment=require(_0x748f('0x2'));var BPromise=require(_0x748f('0x3'));var rs=require(_0x748f('0x4'));var fs=require('fs');var Redis=require(_0x748f('0x5'));var db=require(_0x748f('0x6'))['db'];var utils=require(_0x748f('0x7'));var logger=require(_0x748f('0x8'))(_0x748f('0x9'));var config=require(_0x748f('0xa'));var jayson=require(_0x748f('0xb'));var client=jayson[_0x748f('0xc')][_0x748f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x312344,_0x32d93b,_0x5630ed){return new BPromise(function(_0xa982e8,_0x53248c){return client['request'](_0x312344,_0x5630ed)[_0x748f('0xe')](function(_0x229618){logger[_0x748f('0xf')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x748f('0x10'));logger[_0x748f('0x11')](_0x748f('0x12'),_0x32d93b,_0x748f('0x10'),JSON[_0x748f('0x13')](_0x229618));if(_0x229618[_0x748f('0x14')]){if(_0x229618['error'][_0x748f('0x15')]===0x1f4){logger[_0x748f('0x14')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x229618['error'][_0x748f('0x16')]);return _0x53248c(_0x229618[_0x748f('0x14')][_0x748f('0x16')]);}logger[_0x748f('0x14')](_0x748f('0x17'),_0x32d93b,_0x229618['error'][_0x748f('0x16')]);return _0xa982e8(_0x229618[_0x748f('0x14')][_0x748f('0x16')]);}else{logger[_0x748f('0xf')](_0x748f('0x17'),_0x32d93b,'request\x20sent');_0xa982e8(_0x229618[_0x748f('0x18')]['message']);}})[_0x748f('0x19')](function(_0x4bdf82){logger[_0x748f('0x14')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x4bdf82);_0x53248c(_0x4bdf82);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 940132a..40ab1ef 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 _0xf852=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./screenRecording.controller'];(function(_0x4179a4,_0x3942b1){var _0x147a85=function(_0x3ba233){while(--_0x3ba233){_0x4179a4['push'](_0x4179a4['shift']());}};_0x147a85(++_0x3942b1);}(_0xf852,0x188));var _0x2f85=function(_0x45ca4a,_0x3ba5b1){_0x45ca4a=_0x45ca4a-0x0;var _0x3ee92c=_0xf852[_0x45ca4a];return _0x3ee92c;};'use strict';var multer=require(_0x2f85('0x0'));var util=require(_0x2f85('0x1'));var path=require(_0x2f85('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f85('0x3'));var router=express[_0x2f85('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f85('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f85('0x6'));router[_0x2f85('0x7')]('/',auth[_0x2f85('0x8')](),controller[_0x2f85('0x9')]);router[_0x2f85('0x7')](_0x2f85('0xa'),auth[_0x2f85('0x8')](),controller[_0x2f85('0xb')]);router[_0x2f85('0x7')](_0x2f85('0xc'),auth[_0x2f85('0x8')](),controller[_0x2f85('0xd')]);router[_0x2f85('0x7')](_0x2f85('0xe'),auth['isAuthenticated'](),controller[_0x2f85('0xf')]);router[_0x2f85('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f85('0x11')](_0x2f85('0xc'),auth[_0x2f85('0x8')](),controller[_0x2f85('0x12')]);router['delete'](_0x2f85('0xc'),auth[_0x2f85('0x8')](),controller[_0x2f85('0x13')]);module[_0x2f85('0x14')]=router; \ No newline at end of file +var _0x3599=['index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3599,0x172));var _0x9359=function(_0x6af504,_0x14b0b2){_0x6af504=_0x6af504-0x0;var _0x469276=_0x3599[_0x6af504];return _0x469276;};'use strict';var multer=require(_0x9359('0x0'));var util=require('util');var path=require(_0x9359('0x1'));var timeout=require(_0x9359('0x2'));var express=require('express');var router=express[_0x9359('0x3')]();var fs_extra=require(_0x9359('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9359('0x5'));var config=require(_0x9359('0x6'));var controller=require(_0x9359('0x7'));router[_0x9359('0x8')]('/',auth[_0x9359('0x9')](),controller[_0x9359('0xa')]);router[_0x9359('0x8')](_0x9359('0xb'),auth[_0x9359('0x9')](),controller['describe']);router[_0x9359('0x8')](_0x9359('0xc'),auth[_0x9359('0x9')](),controller[_0x9359('0xd')]);router[_0x9359('0x8')]('/:id/download',auth[_0x9359('0x9')](),controller['download']);router[_0x9359('0xe')]('/',auth['isAuthenticated'](),controller[_0x9359('0xf')]);router[_0x9359('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9359('0x11')]);router[_0x9359('0x12')](_0x9359('0xc'),auth[_0x9359('0x9')](),controller[_0x9359('0x13')]);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 8b749da..e5d643b 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 _0xbc87=['moment','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x5c8346,_0x3b585a){_0x5c8346=_0x5c8346-0x0;var _0x7d68e7=_0xbc87[_0x5c8346];return _0x7d68e7;};'use strict';var Sequelize=require(_0x7bc8('0x0'));var moment=require(_0x7bc8('0x1'));var path=require('path');var config=require(_0x7bc8('0x2'));module[_0x7bc8('0x3')]={'format':{'type':Sequelize[_0x7bc8('0x4')],'get':function(){return this[_0x7bc8('0x5')]('value')?path[_0x7bc8('0x6')](this[_0x7bc8('0x5')](_0x7bc8('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x7bc8('0x8')]},'channel':{'type':Sequelize[_0x7bc8('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x4b2bc9){var _0x194a12=_0x4b2bc9[_0x7bc8('0x9')](/\\/g,'/');this['setDataValue'](_0x7bc8('0x7'),_0x194a12);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7bc8('0xa')],'set':function(_0x32e2b0){this['setDataValue'](_0x7bc8('0xb'),moment()[_0x7bc8('0xc')](_0x32e2b0,'ms'));this[_0x7bc8('0xd')](_0x7bc8('0xe'),moment());this[_0x7bc8('0xd')]('duration',_0x32e2b0);}},'startedAt':{'type':Sequelize[_0x7bc8('0xf')],'get':function(){return moment(this[_0x7bc8('0x5')](_0x7bc8('0xb')))[_0x7bc8('0x10')](_0x7bc8('0x11'))[_0x7bc8('0x12')]();}},'closedAt':{'type':Sequelize[_0x7bc8('0xf')],'get':function(){return moment(this[_0x7bc8('0x5')](_0x7bc8('0xe')))[_0x7bc8('0x10')](_0x7bc8('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x7bc8('0xf')],'get':function(){return moment(this[_0x7bc8('0x5')](_0x7bc8('0x13')))[_0x7bc8('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x7bc8('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7bc8('0x5')](_0x7bc8('0x14')))[_0x7bc8('0x10')](_0x7bc8('0x11'))[_0x7bc8('0x12')]();}}}; \ No newline at end of file +var _0x3d04=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt','toString','createdAt'];(function(_0x3e21c8,_0x2e53b3){var _0x131399=function(_0xb012eb){while(--_0xb012eb){_0x3e21c8['push'](_0x3e21c8['shift']());}};_0x131399(++_0x2e53b3);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x43d0('0x0'));var moment=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var config=require(_0x43d0('0x3'));module[_0x43d0('0x4')]={'format':{'type':Sequelize[_0x43d0('0x5')],'get':function(){return this[_0x43d0('0x6')](_0x43d0('0x7'))?path['extname'](this[_0x43d0('0x6')](_0x43d0('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x43d0('0x8')]},'channel':{'type':Sequelize[_0x43d0('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x484271){var _0x50919e=_0x484271['replace'](/\\/g,'/');this[_0x43d0('0x9')](_0x43d0('0x7'),_0x50919e);}},'rating':{'type':Sequelize[_0x43d0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x43d0('0xa')],'set':function(_0x44a763){this['setDataValue']('startedAt',moment()[_0x43d0('0xb')](_0x44a763,'ms'));this['setDataValue']('closedAt',moment());this[_0x43d0('0x9')](_0x43d0('0xc'),_0x44a763);}},'startedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')]('startedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')](_0x43d0('0x10')))['format'](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'createdAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue'](_0x43d0('0x12')))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'updatedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6c206d6..46ab79f 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 _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xe8d117,_0x509df1){var _0x3141bf=function(_0x51d4a5){while(--_0x51d4a5){_0xe8d117['push'](_0xe8d117['shift']());}};_0x3141bf(++_0x509df1);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file +var _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0x9a19,0x114));var _0x99a1=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9a19[_0x16b9ed];return _0x66b1f8;};'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(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index c99a030..4cc6bd2 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 _0x8204=['./screenRecording.attributes','exports','define','interactionid','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x8204,0x1bc));var _0x4820=function(_0xdbda40,_0x3a2d15){_0xdbda40=_0xdbda40-0x0;var _0x51545d=_0x8204[_0xdbda40];return _0x51545d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4820('0x0'));var moment=require(_0x4820('0x1'));var BPromise=require(_0x4820('0x2'));var rp=require(_0x4820('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4820('0x4'));var config=require(_0x4820('0x5'));var attributes=require(_0x4820('0x6'));module[_0x4820('0x7')]=function(_0x49f23f,_0x1064e3){return _0x49f23f[_0x4820('0x8')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x4820('0x9'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x272a=['./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d5fa0,_0x3c966a){var _0xd84696=function(_0x1f1e0a){while(--_0x1f1e0a){_0x3d5fa0['push'](_0x3d5fa0['shift']());}};_0xd84696(++_0x3c966a);}(_0x272a,0xef));var _0xa272=function(_0x2aedd1,_0x1c21c5){_0x2aedd1=_0x2aedd1-0x0;var _0x53d33f=_0x272a[_0x2aedd1];return _0x53d33f;};'use strict';var _=require(_0xa272('0x0'));var util=require(_0xa272('0x1'));var logger=require('../../config/logger')(_0xa272('0x2'));var moment=require(_0xa272('0x3'));var BPromise=require(_0xa272('0x4'));var rp=require(_0xa272('0x5'));var fs=require('fs');var path=require(_0xa272('0x6'));var rimraf=require(_0xa272('0x7'));var config=require('../../config/environment');var attributes=require(_0xa272('0x8'));module[_0xa272('0x9')]=function(_0x5e4bb3,_0x32496d){return _0x5e4bb3['define'](_0xa272('0xa'),attributes,{'tableName':_0xa272('0xb'),'paranoid':![],'indexes':[{'name':_0xa272('0xc'),'fields':[_0xa272('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e72567c..8b7290f 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 _0x48ef=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x45786e,_0x2ab809){var _0x5560d8=function(_0x26e083){while(--_0x26e083){_0x45786e['push'](_0x45786e['shift']());}};_0x5560d8(++_0x2ab809);}(_0x48ef,0xea));var _0xf48e=function(_0x9be508,_0x10c8ba){_0x9be508=_0x9be508-0x0;var _0x16f3c3=_0x48ef[_0x9be508];return _0x16f3c3;};'use strict';var _=require(_0xf48e('0x0'));var util=require(_0xf48e('0x1'));var moment=require(_0xf48e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf48e('0x3'));var fs=require('fs');var Redis=require(_0xf48e('0x4'));var db=require(_0xf48e('0x5'))['db'];var utils=require(_0xf48e('0x6'));var logger=require(_0xf48e('0x7'))(_0xf48e('0x8'));var config=require(_0xf48e('0x9'));var jayson=require(_0xf48e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f0579,_0x24cd69,_0x1599a6){return new BPromise(function(_0x1a1b1a,_0x560217){return client['request'](_0x5f0579,_0x1599a6)[_0xf48e('0xb')](function(_0x3ed73b){logger[_0xf48e('0xc')](_0xf48e('0xd'),_0x24cd69,_0xf48e('0xe'));logger['debug'](_0xf48e('0xf'),_0x24cd69,_0xf48e('0xe'),JSON['stringify'](_0x3ed73b));if(_0x3ed73b[_0xf48e('0x10')]){if(_0x3ed73b['error'][_0xf48e('0x11')]===0x1f4){logger[_0xf48e('0x10')](_0xf48e('0xd'),_0x24cd69,_0x3ed73b['error']['message']);return _0x560217(_0x3ed73b['error'][_0xf48e('0x12')]);}logger[_0xf48e('0x10')](_0xf48e('0xd'),_0x24cd69,_0x3ed73b[_0xf48e('0x10')][_0xf48e('0x12')]);return _0x1a1b1a(_0x3ed73b[_0xf48e('0x10')][_0xf48e('0x12')]);}else{logger[_0xf48e('0xc')](_0xf48e('0xd'),_0x24cd69,_0xf48e('0xe'));_0x1a1b1a(_0x3ed73b[_0xf48e('0x13')]['message']);}})[_0xf48e('0x14')](function(_0x856d58){logger['error'](_0xf48e('0xd'),_0x24cd69,_0x856d58);_0x560217(_0x856d58);});});} \ No newline at end of file +var _0x81d6=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x81d6,0xad));var _0x681d=function(_0x9a184f,_0x5dc1e8){_0x9a184f=_0x9a184f-0x0;var _0x5ed401=_0x81d6[_0x9a184f];return _0x5ed401;};'use strict';var _=require(_0x681d('0x0'));var util=require(_0x681d('0x1'));var moment=require(_0x681d('0x2'));var BPromise=require(_0x681d('0x3'));var rs=require(_0x681d('0x4'));var fs=require('fs');var Redis=require(_0x681d('0x5'));var db=require(_0x681d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x681d('0x7'));var config=require(_0x681d('0x8'));var jayson=require(_0x681d('0x9'));var client=jayson[_0x681d('0xa')][_0x681d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cd96b,_0x31f8f1,_0x2fce61){return new BPromise(function(_0x3b7bc0,_0x2fcbff){return client[_0x681d('0xc')](_0x3cd96b,_0x2fce61)[_0x681d('0xd')](function(_0xcc0bc2){logger[_0x681d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x31f8f1,_0x681d('0xf'));logger[_0x681d('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x31f8f1,_0x681d('0xf'),JSON['stringify'](_0xcc0bc2));if(_0xcc0bc2['error']){if(_0xcc0bc2[_0x681d('0x11')]['code']===0x1f4){logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0xcc0bc2[_0x681d('0x11')]['message']);return _0x2fcbff(_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);}logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);return _0x3b7bc0(_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);}else{logger[_0x681d('0xe')](_0x681d('0x12'),_0x31f8f1,_0x681d('0xf'));_0x3b7bc0(_0xcc0bc2[_0x681d('0x14')][_0x681d('0x13')]);}})[_0x681d('0x15')](function(_0x52e1d9){logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0x52e1d9);_0x2fcbff(_0x52e1d9);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a584fe6..9edc2f3 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 _0x596f=['/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname','post','file','addLogo','root','server/files/images/logos/','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x596f,0xe8));var _0xf596=function(_0x452fef,_0xe0c889){_0x452fef=_0x452fef-0x0;var _0x1b46cd=_0x596f[_0x452fef];return _0x1b46cd;};'use strict';var multer=require(_0xf596('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf596('0x1'));var express=require(_0xf596('0x2'));var router=express[_0xf596('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf596('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf596('0x5'));var controller=require(_0xf596('0x6'));router[_0xf596('0x7')]('/',auth[_0xf596('0x8')](),controller[_0xf596('0x9')]);router[_0xf596('0x7')](_0xf596('0xa'),controller[_0xf596('0xb')]);router[_0xf596('0x7')]('/:id',controller[_0xf596('0xc')]);router[_0xf596('0x7')](_0xf596('0xd'),controller['getLogo']);router[_0xf596('0x7')](_0xf596('0xe'),controller[_0xf596('0xf')]);router[_0xf596('0x7')]('/:id/gdpr',controller[_0xf596('0x10')]);router['get'](_0xf596('0x11'),controller[_0xf596('0x12')]);router[_0xf596('0x7')](_0xf596('0x13'),controller[_0xf596('0x14')]);var upload=multer({'storage':multer[_0xf596('0x15')]({'destination':function(_0x1703ec,_0x3749fa,_0x3598f7){_0x3598f7(null,path[_0xf596('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x557f59,_0x45aa96,_0x392195){_0x392195(null,util[_0xf596('0x17')](_0xf596('0x18'),_0xf596('0x19'),path[_0xf596('0x1a')](_0x45aa96[_0xf596('0x1b')])));}})});router[_0xf596('0x1c')](_0xf596('0xd'),upload['single'](_0xf596('0x1d')),controller[_0xf596('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15c56e,_0x300a47,_0x1b886){_0x1b886(null,path[_0xf596('0x16')](config[_0xf596('0x1f')],_0xf596('0x20')));},'filename':function(_0x12da2b,_0xdd5eeb,_0x15830e){_0x15830e(null,util[_0xf596('0x17')](_0xf596('0x18'),'logologin',path[_0xf596('0x1a')](_0xdd5eeb['originalname'])));}})});router[_0xf596('0x1c')](_0xf596('0xe'),upload[_0xf596('0x21')](_0xf596('0x1d')),controller[_0xf596('0x22')]);var upload=multer({'storage':multer[_0xf596('0x15')]({'destination':function(_0x4eb402,_0x19cfae,_0x5bfe69){_0x5bfe69(null,path[_0xf596('0x16')](config[_0xf596('0x1f')],'server/files/images/logos/'));},'filename':function(_0x12a94f,_0x290bcf,_0xdccefe){_0xdccefe(null,util[_0xf596('0x17')](_0xf596('0x18'),_0xf596('0x23'),path['extname'](_0x290bcf['originalname'])));}})});router[_0xf596('0x1c')](_0xf596('0x11'),upload[_0xf596('0x21')](_0xf596('0x1d')),controller[_0xf596('0x24')]);var upload=multer({'storage':multer[_0xf596('0x15')]({'destination':function(_0xa56daa,_0x46dba5,_0x49c33c){_0x49c33c(null,path[_0xf596('0x16')](config[_0xf596('0x1f')],_0xf596('0x20')));},'filename':function(_0x3ef996,_0x29dacc,_0x48b8f2){_0x48b8f2(null,util[_0xf596('0x17')](_0xf596('0x18'),_0xf596('0x25'),path[_0xf596('0x1a')](_0x29dacc[_0xf596('0x1b')])));}})});router[_0xf596('0x1c')](_0xf596('0x13'),upload[_0xf596('0x21')](_0xf596('0x1d')),controller[_0xf596('0x26')]);router[_0xf596('0x27')]('/:id',auth[_0xf596('0x8')](),controller[_0xf596('0x28')]);module['exports']=router; \ No newline at end of file +var _0x0986=['getFavicon','diskStorage','join','root','server/files/images/logos/','format','single','file','addLogo','%s%s','logologin','extname','originalname','post','addLogoLogin','preferred','/:id/preferred','addPreferred','addFavicon','put','/:id','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon'];(function(_0x5ee039,_0x120e85){var _0x5eaf53=function(_0x1994e1){while(--_0x1994e1){_0x5ee039['push'](_0x5ee039['shift']());}};_0x5eaf53(++_0x120e85);}(_0x0986,0x1bb));var _0x6098=function(_0x4f81bc,_0xde6714){_0x4f81bc=_0x4f81bc-0x0;var _0x16a08a=_0x0986[_0x4f81bc];return _0x16a08a;};'use strict';var multer=require(_0x6098('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6098('0x1'));var express=require(_0x6098('0x2'));var router=express[_0x6098('0x3')]();var fs_extra=require(_0x6098('0x4'));var auth=require(_0x6098('0x5'));var interaction=require(_0x6098('0x6'));var config=require(_0x6098('0x7'));var controller=require(_0x6098('0x8'));router[_0x6098('0x9')]('/',auth[_0x6098('0xa')](),controller['index']);router[_0x6098('0x9')](_0x6098('0xb'),controller[_0x6098('0xc')]);router[_0x6098('0x9')]('/:id',controller[_0x6098('0xd')]);router[_0x6098('0x9')](_0x6098('0xe'),controller['getLogo']);router[_0x6098('0x9')](_0x6098('0xf'),controller[_0x6098('0x10')]);router['get']('/:id/gdpr',controller[_0x6098('0x11')]);router[_0x6098('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x6098('0x9')](_0x6098('0x12'),controller[_0x6098('0x13')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0x182c46,_0x7988d6,_0x100627){_0x100627(null,path[_0x6098('0x15')](config[_0x6098('0x16')],_0x6098('0x17')));},'filename':function(_0x25ed4f,_0x4490c6,_0x50d511){_0x50d511(null,util[_0x6098('0x18')]('%s%s','logo',path['extname'](_0x4490c6['originalname'])));}})});router['post'](_0x6098('0xe'),upload[_0x6098('0x19')](_0x6098('0x1a')),controller[_0x6098('0x1b')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0x2cc0f8,_0x273f7c,_0x117c06){_0x117c06(null,path['join'](config[_0x6098('0x16')],_0x6098('0x17')));},'filename':function(_0x47b3d6,_0x41884e,_0x32014b){_0x32014b(null,util[_0x6098('0x18')](_0x6098('0x1c'),_0x6098('0x1d'),path[_0x6098('0x1e')](_0x41884e[_0x6098('0x1f')])));}})});router[_0x6098('0x20')](_0x6098('0xf'),upload[_0x6098('0x19')]('file'),controller[_0x6098('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5cbf9c,_0x45d103,_0x379122){_0x379122(null,path['join'](config[_0x6098('0x16')],'server/files/images/logos/'));},'filename':function(_0x4d98dd,_0x483a19,_0x1423b9){_0x1423b9(null,util[_0x6098('0x18')](_0x6098('0x1c'),_0x6098('0x22'),path[_0x6098('0x1e')](_0x483a19['originalname'])));}})});router[_0x6098('0x20')](_0x6098('0x23'),upload[_0x6098('0x19')]('file'),controller[_0x6098('0x24')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0xf15ac1,_0x398999,_0x37de97){_0x37de97(null,path[_0x6098('0x15')](config['root'],_0x6098('0x17')));},'filename':function(_0x2836e2,_0x215717,_0x3d7ae4){_0x3d7ae4(null,util[_0x6098('0x18')]('%s%s','favicon',path[_0x6098('0x1e')](_0x215717[_0x6098('0x1f')])));}})});router[_0x6098('0x20')]('/:id/favicon',upload[_0x6098('0x19')](_0x6098('0x1a')),controller[_0x6098('0x25')]);router[_0x6098('0x26')](_0x6098('0x27'),auth[_0x6098('0xa')](),controller[_0x6098('0x28')]);module[_0x6098('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index f364779..e89096f 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 _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x50ddca,_0x1741f4){var _0x46ffba=function(_0x495c2e){while(--_0x495c2e){_0x50ddca['push'](_0x50ddca['shift']());}};_0x46ffba(++_0x1741f4);}(_0x7a54,0x106));var _0x47a5=function(_0x3fb36e,_0x1f2f31){_0x3fb36e=_0x3fb36e-0x0;var _0x4c0a89=_0x7a54[_0x3fb36e];return _0x4c0a89;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb28,0x106));var _0x8db2=function(_0x3329cf,_0x4e0b7e){_0x3329cf=_0x3329cf-0x0;var _0x44e008=_0xdb28[_0x3329cf];return _0x44e008;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 2251b46..27def57 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 _0xe0e7=['attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','params','rawAttributes','options','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','Setting','type','key','model','map','query','keys','filters','intersection'];(function(_0x152341,_0x8f0c56){var _0x440e1b=function(_0x33918f){while(--_0x33918f){_0x152341['push'](_0x152341['shift']());}};_0x440e1b(++_0x8f0c56);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0xe0e7[_0x8d8f23];return _0x22bf54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e0e('0x0'));var zipdir=require(_0x7e0e('0x1'));var jsonpatch=require(_0x7e0e('0x2'));var rp=require(_0x7e0e('0x3'));var moment=require(_0x7e0e('0x4'));var BPromise=require(_0x7e0e('0x5'));var Mustache=require('mustache');var util=require(_0x7e0e('0x6'));var path=require(_0x7e0e('0x7'));var sox=require(_0x7e0e('0x8'));var csv=require(_0x7e0e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e0e('0xa'));var _=require(_0x7e0e('0xb'));var squel=require(_0x7e0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e0e('0x9'));var querystring=require('querystring');var Papa=require(_0x7e0e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e0e('0xf'));var as=require(_0x7e0e('0x10'));var hardwareService=require(_0x7e0e('0x11'));var logger=require(_0x7e0e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7e0e('0x13'));var licenseUtil=require(_0x7e0e('0x14'));var db=require(_0x7e0e('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7e0e('0x16')][_0x7e0e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4ff342,_0x331b66,_0xe1a93a,_0x353702){return new BPromise(function(_0x1b67df,_0x4ddcfe){var _0x3a0e20=_0x353702||client;return _0x3a0e20[_0x7e0e('0x18')](_0x4ff342,_0xe1a93a)[_0x7e0e('0x19')](function(_0x2e2717){logger['info']('Setting,\x20%s,\x20%s',_0x331b66,_0x7e0e('0x1a'));logger[_0x7e0e('0x1b')](_0x7e0e('0x1c'),_0x331b66,'request\x20sent',JSON['stringify'](_0x2e2717));if(_0x2e2717[_0x7e0e('0x1d')]){if(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x1e')]===0x1f4){logger[_0x7e0e('0x1d')](_0x7e0e('0x1f'),_0x331b66,_0x2e2717['error'][_0x7e0e('0x20')]);return _0x4ddcfe(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);}logger[_0x7e0e('0x1d')](_0x7e0e('0x1f'),_0x331b66,_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);return _0x1b67df(_0x2e2717[_0x7e0e('0x1d')][_0x7e0e('0x20')]);}else{logger[_0x7e0e('0x21')](_0x7e0e('0x1f'),_0x331b66,_0x7e0e('0x1a'));_0x1b67df(_0x2e2717[_0x7e0e('0x22')][_0x7e0e('0x20')]);}})[_0x7e0e('0x23')](function(_0x4ca566){logger['error'](_0x7e0e('0x1f'),_0x331b66,_0x4ca566);_0x4ddcfe(_0x4ca566);});});}function respondWithStatusCode(_0x375061,_0x5e1cf9){_0x5e1cf9=_0x5e1cf9||0xcc;return function(_0x102cfa){if(_0x102cfa){return _0x375061[_0x7e0e('0x24')](_0x5e1cf9);}return _0x375061[_0x7e0e('0x25')](_0x5e1cf9)['end']();};}function respondWithResult(_0x1665e4,_0x34e2c5){_0x34e2c5=_0x34e2c5||0xc8;return function(_0x5beb92){if(_0x5beb92){return _0x1665e4[_0x7e0e('0x25')](_0x34e2c5)[_0x7e0e('0x26')](_0x5beb92);}};}function respondWithFilteredResult(_0xe1cf7b,_0x4382b3){return function(_0x26c71c){if(_0x26c71c){var _0x36b473=typeof _0x4382b3[_0x7e0e('0x27')]===_0x7e0e('0x28')&&typeof _0x4382b3[_0x7e0e('0x29')]===_0x7e0e('0x28');var _0x1c5572=_0x26c71c[_0x7e0e('0x2a')];var _0x371b5f=_0x36b473?0x0:_0x4382b3[_0x7e0e('0x27')];var _0x8c4b36=_0x36b473?_0x26c71c[_0x7e0e('0x2a')]:_0x4382b3[_0x7e0e('0x27')]+_0x4382b3[_0x7e0e('0x29')];var _0x243414;if(_0x8c4b36>=_0x1c5572){_0x8c4b36=_0x1c5572;_0x243414=0xc8;}else{_0x243414=0xce;}_0xe1cf7b[_0x7e0e('0x25')](_0x243414);return _0xe1cf7b[_0x7e0e('0x2b')](_0x7e0e('0x2c'),_0x371b5f+'-'+_0x8c4b36+'/'+_0x1c5572)['json'](_0x26c71c);}return null;};}function patchUpdates(_0x5239e1){return function(_0x2479c4){try{jsonpatch[_0x7e0e('0x2d')](_0x2479c4,_0x5239e1,!![]);}catch(_0x3f2094){return BPromise[_0x7e0e('0x2e')](_0x3f2094);}return _0x2479c4[_0x7e0e('0x2f')]();};}function saveUpdates(_0x21cab2,_0x5b3a21){return function(_0x36a72c){if(_0x36a72c){return _0x36a72c['update'](_0x21cab2)[_0x7e0e('0x19')](function(_0x13d772){return _0x13d772;});}return null;};}function removeEntity(_0x9a9e01,_0x1d5ba7){return function(_0x42f448){if(_0x42f448){return _0x42f448[_0x7e0e('0x30')]()[_0x7e0e('0x19')](function(){_0x9a9e01[_0x7e0e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468bbc,_0x4ba0a4){return function(_0x340013){if(!_0x340013){_0x468bbc[_0x7e0e('0x24')](0x194);}return _0x340013;};}function handleError(_0x53bde9,_0x1ead3e){_0x1ead3e=_0x1ead3e||0x1f4;return function(_0xc44719){logger['error'](_0xc44719[_0x7e0e('0x31')]);if(_0xc44719['name']){delete _0xc44719[_0x7e0e('0x32')];}_0x53bde9[_0x7e0e('0x25')](_0x1ead3e)[_0x7e0e('0x33')](_0xc44719);};}exports[_0x7e0e('0x34')]=function(_0x6f534a,_0x5242b8){var _0x396293={},_0x15205e={},_0xc00baa={'count':0x0,'rows':[]};var _0x3b1b41=_['map'](db[_0x7e0e('0x35')]['rawAttributes'],function(_0x4d8d23){return{'name':_0x4d8d23['fieldName'],'type':_0x4d8d23[_0x7e0e('0x36')][_0x7e0e('0x37')]};});_0x15205e[_0x7e0e('0x38')]=_[_0x7e0e('0x39')](_0x3b1b41,_0x7e0e('0x32'));_0x15205e[_0x7e0e('0x3a')]=_[_0x7e0e('0x3b')](_0x6f534a['query']);_0x15205e[_0x7e0e('0x3c')]=_[_0x7e0e('0x3d')](_0x15205e[_0x7e0e('0x38')],_0x15205e['query']);_0x396293[_0x7e0e('0x3e')]=_[_0x7e0e('0x3d')](_0x15205e[_0x7e0e('0x38')],qs[_0x7e0e('0x3f')](_0x6f534a[_0x7e0e('0x3a')]['fields']));_0x396293[_0x7e0e('0x3e')]=_0x396293[_0x7e0e('0x3e')]['length']?_0x396293[_0x7e0e('0x3e')]:_0x15205e[_0x7e0e('0x38')];if(!_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x40')](_0x7e0e('0x41'))){_0x396293[_0x7e0e('0x29')]=qs['limit'](_0x6f534a[_0x7e0e('0x3a')]['limit']);_0x396293[_0x7e0e('0x27')]=qs[_0x7e0e('0x27')](_0x6f534a['query'][_0x7e0e('0x27')]);}_0x396293['order']=qs[_0x7e0e('0x42')](_0x6f534a['query']['sort']);_0x396293['where']=qs[_0x7e0e('0x3c')](_[_0x7e0e('0x43')](_0x6f534a['query'],_0x15205e['filters']),_0x3b1b41);if(_0x6f534a[_0x7e0e('0x3a')]['filter']){_0x396293['where']=_[_0x7e0e('0x44')](_0x396293[_0x7e0e('0x45')],{'$or':_[_0x7e0e('0x39')](_0x3b1b41,function(_0x396802){if(_0x396802[_0x7e0e('0x36')]!==_0x7e0e('0x46')){var _0x5db5e3={};_0x5db5e3[_0x396802[_0x7e0e('0x32')]]={'$like':'%'+_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x47')]+'%'};return _0x5db5e3;}})});}_0x396293=_['merge']({},_0x396293,_0x6f534a['options']);var _0x5391ee={'where':_0x396293[_0x7e0e('0x45')]};return db['Setting'][_0x7e0e('0x2a')](_0x5391ee)[_0x7e0e('0x19')](function(_0x2d3fd6){_0xc00baa[_0x7e0e('0x2a')]=_0x2d3fd6;if(_0x6f534a[_0x7e0e('0x3a')][_0x7e0e('0x48')]){_0x396293[_0x7e0e('0x49')]=[{'all':!![]}];}return db[_0x7e0e('0x35')][_0x7e0e('0x4a')](_0x396293);})['then'](function(_0x2163c8){_0xc00baa[_0x7e0e('0x4b')]=_0x2163c8;return _0xc00baa;})['then'](respondWithFilteredResult(_0x5242b8,_0x396293))['catch'](handleError(_0x5242b8,null));};exports['show']=function(_0x3be26f,_0xa23d2f){var _0x14cbce={'raw':![],'where':{'id':_0x3be26f[_0x7e0e('0x4c')]['id']}},_0xc69fc4={};_0xc69fc4[_0x7e0e('0x38')]=_['keys'](db[_0x7e0e('0x35')][_0x7e0e('0x4d')]);_0xc69fc4[_0x7e0e('0x3a')]=_['keys'](_0x3be26f['query']);_0xc69fc4[_0x7e0e('0x3c')]=_[_0x7e0e('0x3d')](_0xc69fc4[_0x7e0e('0x38')],_0xc69fc4[_0x7e0e('0x3a')]);_0x14cbce[_0x7e0e('0x3e')]=_['intersection'](_0xc69fc4[_0x7e0e('0x38')],qs[_0x7e0e('0x3f')](_0x3be26f[_0x7e0e('0x3a')][_0x7e0e('0x3f')]));_0x14cbce[_0x7e0e('0x3e')]=_0x14cbce[_0x7e0e('0x3e')]['length']?_0x14cbce[_0x7e0e('0x3e')]:_0xc69fc4[_0x7e0e('0x38')];if(_0x3be26f['query'][_0x7e0e('0x48')]){_0x14cbce['include']=[{'all':!![]}];}_0x14cbce=_[_0x7e0e('0x44')]({},_0x14cbce,_0x3be26f[_0x7e0e('0x4e')]);return db['Setting'][_0x7e0e('0x4f')](_0x14cbce)[_0x7e0e('0x19')](handleEntityNotFound(_0xa23d2f,null))[_0x7e0e('0x19')](respondWithResult(_0xa23d2f,null))[_0x7e0e('0x23')](handleError(_0xa23d2f,null));};exports[_0x7e0e('0x50')]=function(_0x5977ef,_0x1a9f7f){if(_0x5977ef['body']['id']){delete _0x5977ef[_0x7e0e('0x51')]['id'];}return db[_0x7e0e('0x35')][_0x7e0e('0x4f')]({'where':{'id':_0x5977ef[_0x7e0e('0x4c')]['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x1a9f7f,null))[_0x7e0e('0x19')](saveUpdates(_0x5977ef[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x1a9f7f,null))[_0x7e0e('0x23')](handleError(_0x1a9f7f,null));};exports[_0x7e0e('0x52')]=function(_0x27ae49,_0x29bd0f,_0x2d15a5){if(_0x27ae49[_0x7e0e('0x53')]&&_0x27ae49[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x27ae49[_0x7e0e('0x51')][_0x7e0e('0x55')]=_0x27ae49[_0x7e0e('0x53')]['filename'];}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x27ae49[_0x7e0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29bd0f,null))['then'](saveUpdates(_0x27ae49['body'],null))[_0x7e0e('0x19')](respondWithResult(_0x29bd0f,null))[_0x7e0e('0x23')](handleError(_0x29bd0f,null));};exports[_0x7e0e('0x56')]=function(_0xa6553e,_0x5786f3,_0x352364){if(_0xa6553e[_0x7e0e('0x53')]&&_0xa6553e['file'][_0x7e0e('0x54')]){_0xa6553e[_0x7e0e('0x51')][_0x7e0e('0x57')]=_0xa6553e[_0x7e0e('0x53')][_0x7e0e('0x54')];}return db[_0x7e0e('0x35')][_0x7e0e('0x4f')]({'where':{'id':_0xa6553e['params']['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x5786f3,null))[_0x7e0e('0x19')](saveUpdates(_0xa6553e['body'],null))[_0x7e0e('0x19')](respondWithResult(_0x5786f3,null))['catch'](handleError(_0x5786f3,null));};var utilLicense=require(_0x7e0e('0x14'));exports[_0x7e0e('0x58')]=function(_0x577522,_0x4822c3,_0x50ca69){var _0x51aa6e=_0x7e0e('0x59');var _0xe79ebd={'custom':![]};return utilLicense[_0x7e0e('0x5a')]()[_0x7e0e('0x19')](function(_0x35e39d){if(_0x35e39d){_0xe79ebd=_0x35e39d;}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x577522[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),'loginLogo',_0x7e0e('0x5b'),_0x7e0e('0x5c'),_0x7e0e('0x5d'),_0x7e0e('0x5e'),_0x7e0e('0x5f'),_0x7e0e('0x60')],'raw':!![]});})[_0x7e0e('0x19')](handleEntityNotFound(_0x4822c3,null))[_0x7e0e('0x19')](function(_0x2eb787){if(_0x2eb787){var _0x3f9571=_0x2eb787['logo']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config['root'],_0x51aa6e,_[_0x7e0e('0x63')](_0x2eb787[_0x7e0e('0x55')])))?path['join'](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x2eb787[_0x7e0e('0x55')])):path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x7e0e('0x65')));var _0x1fd82a=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x55'));if(_0x2eb787[_0x1fd82a]||!_0xe79ebd[_0x7e0e('0x68')]){_0x3f9571=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x51aa6e,_[_0x7e0e('0x63')](_0x7e0e('0x65')));}if(!fs['existsSync'](_0x3f9571)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')]('logo')+_0x7e0e('0x6b'));}return _0x4822c3[_0x7e0e('0x6c')](_0x3f9571);}})[_0x7e0e('0x23')](handleError(_0x4822c3,null));};var utilLicense=require(_0x7e0e('0x14'));exports['getLogoLogin']=function(_0x3c6e63,_0x27f792,_0x1e3cfc){var _0x3b969e=_0x7e0e('0x59');var _0x3b2a75={'custom':![]};return utilLicense[_0x7e0e('0x5a')]()[_0x7e0e('0x19')](function(_0x2090c8){if(_0x2090c8){_0x3b2a75=_0x2090c8;}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x3c6e63[_0x7e0e('0x4c')]['id']},'attributes':['logo','loginLogo',_0x7e0e('0x5b'),'favicon','defaultLogo',_0x7e0e('0x5e'),_0x7e0e('0x5f'),_0x7e0e('0x60')],'raw':!![]});})[_0x7e0e('0x19')](handleEntityNotFound(_0x27f792,null))[_0x7e0e('0x19')](function(_0x20ce67){if(_0x20ce67){var _0x24011d=_0x20ce67['loginLogo']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x20ce67[_0x7e0e('0x57')])))?path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x20ce67[_0x7e0e('0x57')])):path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_[_0x7e0e('0x63')](_0x7e0e('0x6d')));var _0x238b0e=_0x7e0e('0x66')+_['upperFirst'](_0x7e0e('0x57'));if(_0x20ce67[_0x238b0e]||!_0x3b2a75[_0x7e0e('0x68')]){_0x24011d=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x3b969e,_['toLower'](_0x7e0e('0x6d')));}if(!fs[_0x7e0e('0x61')](_0x24011d)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')](_0x7e0e('0x57'))+_0x7e0e('0x6b'));}return _0x27f792[_0x7e0e('0x6c')](_0x24011d);}})[_0x7e0e('0x23')](handleError(_0x27f792,null));};exports[_0x7e0e('0x6e')]=function(_0x440d03,_0x27ddcb){return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x440d03[_0x7e0e('0x4c')]['id']},'attributes':['securePassword']})[_0x7e0e('0x19')](respondWithResult(_0x27ddcb,null))[_0x7e0e('0x23')](handleError(_0x27ddcb,null));};exports[_0x7e0e('0x6f')]=function(_0x2f2efd,_0x16dc16,_0x2c3003){if(_0x2f2efd[_0x7e0e('0x53')]&&_0x2f2efd[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x2f2efd[_0x7e0e('0x51')][_0x7e0e('0x5b')]=_0x2f2efd['file'][_0x7e0e('0x54')];}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x2f2efd[_0x7e0e('0x4c')]['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x16dc16,null))['then'](saveUpdates(_0x2f2efd[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x16dc16,null))['catch'](handleError(_0x16dc16,null));};var utilLicense=require(_0x7e0e('0x14'));exports[_0x7e0e('0x70')]=function(_0x12d636,_0x327b82,_0x2c55c2){var _0x389b93='server/files/images/logos';var _0x56f673={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x189513){if(_0x189513){_0x56f673=_0x189513;}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x12d636[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),_0x7e0e('0x57'),'preferred',_0x7e0e('0x5c'),_0x7e0e('0x5d'),_0x7e0e('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x327b82,null))[_0x7e0e('0x19')](function(_0x5f582f){if(_0x5f582f){var _0x5f2179=_0x5f582f[_0x7e0e('0x5b')]&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config['root'],_0x389b93,_[_0x7e0e('0x63')](_0x5f582f['preferred'])))?path['join'](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x5f582f[_0x7e0e('0x5b')])):path['join'](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x7e0e('0x71')));var _0x34a715=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x5b'));if(_0x5f582f[_0x34a715]||!_0x56f673[_0x7e0e('0x68')]||!_0x56f673[_0x7e0e('0x5b')]){_0x5f2179=path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x389b93,_[_0x7e0e('0x63')](_0x7e0e('0x71')));}if(!fs['existsSync'](_0x5f2179)){throw new db[(_0x7e0e('0x69'))]['ValidationError'](_[_0x7e0e('0x67')](_0x7e0e('0x5b'))+_0x7e0e('0x6b'));}return _0x327b82[_0x7e0e('0x6c')](_0x5f2179);}})['catch'](handleError(_0x327b82,null));};exports[_0x7e0e('0x72')]=function(_0x19b9ca,_0x1ed898,_0x47b3b8){if(_0x19b9ca[_0x7e0e('0x53')]&&_0x19b9ca[_0x7e0e('0x53')][_0x7e0e('0x54')]){_0x19b9ca[_0x7e0e('0x51')][_0x7e0e('0x5c')]=_0x19b9ca[_0x7e0e('0x53')]['filename'];}return db['Setting'][_0x7e0e('0x4f')]({'where':{'id':_0x19b9ca['params']['id']}})[_0x7e0e('0x19')](handleEntityNotFound(_0x1ed898,null))[_0x7e0e('0x19')](saveUpdates(_0x19b9ca[_0x7e0e('0x51')],null))[_0x7e0e('0x19')](respondWithResult(_0x1ed898,null))[_0x7e0e('0x23')](handleError(_0x1ed898,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x29ebd0,_0x308a6b,_0x40cf8d){var _0x162846=_0x7e0e('0x59');var _0xbaeb00={'custom':![]};return utilLicense['getLicense']()[_0x7e0e('0x19')](function(_0x195642){if(_0x195642){_0xbaeb00=_0x195642;}return db[_0x7e0e('0x35')]['find']({'where':{'id':_0x29ebd0[_0x7e0e('0x4c')]['id']},'attributes':[_0x7e0e('0x55'),_0x7e0e('0x57'),_0x7e0e('0x5b'),'favicon',_0x7e0e('0x5d'),_0x7e0e('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x308a6b,null))[_0x7e0e('0x19')](function(_0x4966c2){if(_0x4966c2){var _0x391e4e=_0x4966c2['favicon']&&fs[_0x7e0e('0x61')](path[_0x7e0e('0x62')](config[_0x7e0e('0x64')],_0x162846,_[_0x7e0e('0x63')](_0x4966c2[_0x7e0e('0x5c')])))?path[_0x7e0e('0x62')](config['root'],_0x162846,_[_0x7e0e('0x63')](_0x4966c2['favicon'])):path['join'](config[_0x7e0e('0x64')],_0x162846,_['toLower'](_0x7e0e('0x73')));var _0x30f207=_0x7e0e('0x66')+_[_0x7e0e('0x67')](_0x7e0e('0x5c'));if(_0x4966c2[_0x30f207]||!_0xbaeb00[_0x7e0e('0x68')]){_0x391e4e=path['join'](config['root'],_0x162846,_[_0x7e0e('0x63')](_0x7e0e('0x73')));}if(!fs[_0x7e0e('0x61')](_0x391e4e)){throw new db[(_0x7e0e('0x69'))][(_0x7e0e('0x6a'))](_[_0x7e0e('0x67')](_0x7e0e('0x5c'))+_0x7e0e('0x6b'));}return _0x308a6b[_0x7e0e('0x6c')](_0x391e4e);}})[_0x7e0e('0x23')](handleError(_0x308a6b,null));};exports[_0x7e0e('0x74')]=function(_0x3d8559,_0x33e987){var _0x234857={'offset':moment()[_0x7e0e('0x75')]()};_0x234857[_0x7e0e('0x76')]=moment()[_0x7e0e('0x75')](_0x234857[_0x7e0e('0x27')])['format'](_0x7e0e('0x77'));return _0x33e987[_0x7e0e('0x25')](0xc8)['send'](_0x234857);}; \ No newline at end of file +var _0x0b1a=['defaultLogo','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','defaultFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','name','index','Setting','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys','options','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin'];(function(_0xe4c530,_0x4a01b0){var _0x365a05=function(_0x58f8df){while(--_0x58f8df){_0xe4c530['push'](_0xe4c530['shift']());}};_0x365a05(++_0x4a01b0);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x134468,_0x3c5956){_0x134468=_0x134468-0x0;var _0x3d6658=_0x0b1a[_0x134468];return _0x3d6658;};'use strict';var emlformat=require(_0xa0b1('0x0'));var rimraf=require(_0xa0b1('0x1'));var zipdir=require(_0xa0b1('0x2'));var jsonpatch=require(_0xa0b1('0x3'));var rp=require(_0xa0b1('0x4'));var moment=require(_0xa0b1('0x5'));var BPromise=require(_0xa0b1('0x6'));var Mustache=require(_0xa0b1('0x7'));var util=require(_0xa0b1('0x8'));var path=require(_0xa0b1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa0b1('0xa'));var fs=require('fs');var fs_extra=require(_0xa0b1('0xb'));var _=require(_0xa0b1('0xc'));var squel=require(_0xa0b1('0xd'));var crypto=require(_0xa0b1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0b1('0xf'));var querystring=require(_0xa0b1('0x10'));var Papa=require('papaparse');var Redis=require(_0xa0b1('0x11'));var authService=require(_0xa0b1('0x12'));var qs=require(_0xa0b1('0x13'));var as=require(_0xa0b1('0x14'));var hardwareService=require(_0xa0b1('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa0b1('0x16'));var config=require(_0xa0b1('0x17'));var licenseUtil=require(_0xa0b1('0x18'));var db=require(_0xa0b1('0x19'))['db'];var jayson=require(_0xa0b1('0x1a'));var client=jayson[_0xa0b1('0x1b')][_0xa0b1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x561521,_0x438a43,_0xa30880,_0x49691b){return new BPromise(function(_0x212c83,_0x547bda){var _0x131cb8=_0x49691b||client;return _0x131cb8[_0xa0b1('0x1d')](_0x561521,_0xa30880)['then'](function(_0x45e2fe){logger['info'](_0xa0b1('0x1e'),_0x438a43,_0xa0b1('0x1f'));logger[_0xa0b1('0x20')](_0xa0b1('0x21'),_0x438a43,_0xa0b1('0x1f'),JSON[_0xa0b1('0x22')](_0x45e2fe));if(_0x45e2fe[_0xa0b1('0x23')]){if(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x24')]===0x1f4){logger[_0xa0b1('0x23')](_0xa0b1('0x1e'),_0x438a43,_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);return _0x547bda(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);}logger[_0xa0b1('0x23')](_0xa0b1('0x1e'),_0x438a43,_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);return _0x212c83(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);}else{logger[_0xa0b1('0x26')](_0xa0b1('0x1e'),_0x438a43,_0xa0b1('0x1f'));_0x212c83(_0x45e2fe[_0xa0b1('0x27')][_0xa0b1('0x25')]);}})['catch'](function(_0x36a9dd){logger['error']('Setting,\x20%s,\x20%s',_0x438a43,_0x36a9dd);_0x547bda(_0x36a9dd);});});}function respondWithStatusCode(_0xe7c73c,_0x4198c7){_0x4198c7=_0x4198c7||0xcc;return function(_0x18c523){if(_0x18c523){return _0xe7c73c[_0xa0b1('0x28')](_0x4198c7);}return _0xe7c73c[_0xa0b1('0x29')](_0x4198c7)['end']();};}function respondWithResult(_0x59e8e2,_0x5451c6){_0x5451c6=_0x5451c6||0xc8;return function(_0x5ac90d){if(_0x5ac90d){return _0x59e8e2['status'](_0x5451c6)[_0xa0b1('0x2a')](_0x5ac90d);}};}function respondWithFilteredResult(_0x2c76f8,_0x4af13b){return function(_0x2ede08){if(_0x2ede08){var _0xf1fc1=typeof _0x4af13b['offset']===_0xa0b1('0x2b')&&typeof _0x4af13b[_0xa0b1('0x2c')]===_0xa0b1('0x2b');var _0x493eb1=_0x2ede08[_0xa0b1('0x2d')];var _0x1b7fa2=_0xf1fc1?0x0:_0x4af13b[_0xa0b1('0x2e')];var _0x212a8d=_0xf1fc1?_0x2ede08['count']:_0x4af13b['offset']+_0x4af13b['limit'];var _0x45b1d3;if(_0x212a8d>=_0x493eb1){_0x212a8d=_0x493eb1;_0x45b1d3=0xc8;}else{_0x45b1d3=0xce;}_0x2c76f8[_0xa0b1('0x29')](_0x45b1d3);return _0x2c76f8[_0xa0b1('0x2f')](_0xa0b1('0x30'),_0x1b7fa2+'-'+_0x212a8d+'/'+_0x493eb1)['json'](_0x2ede08);}return null;};}function patchUpdates(_0x21e099){return function(_0x4b2155){try{jsonpatch[_0xa0b1('0x31')](_0x4b2155,_0x21e099,!![]);}catch(_0x4eeb87){return BPromise['reject'](_0x4eeb87);}return _0x4b2155['save']();};}function saveUpdates(_0x160848,_0x5342fc){return function(_0x2ceeea){if(_0x2ceeea){return _0x2ceeea[_0xa0b1('0x32')](_0x160848)[_0xa0b1('0x33')](function(_0x5c1a47){return _0x5c1a47;});}return null;};}function removeEntity(_0x28c418,_0x46aa49){return function(_0x43a984){if(_0x43a984){return _0x43a984[_0xa0b1('0x34')]()['then'](function(){_0x28c418[_0xa0b1('0x29')](0xcc)[_0xa0b1('0x35')]();});}};}function handleEntityNotFound(_0x185583,_0x307130){return function(_0x3fd03b){if(!_0x3fd03b){_0x185583['sendStatus'](0x194);}return _0x3fd03b;};}function handleError(_0x1b6761,_0x3b6334){_0x3b6334=_0x3b6334||0x1f4;return function(_0x2fe6c6){logger[_0xa0b1('0x23')](_0x2fe6c6['stack']);if(_0x2fe6c6[_0xa0b1('0x36')]){delete _0x2fe6c6['name'];}_0x1b6761[_0xa0b1('0x29')](_0x3b6334)['send'](_0x2fe6c6);};}exports[_0xa0b1('0x37')]=function(_0x162e83,_0x98d2ae){var _0x18b787={},_0x2968eb={},_0x3ee941={'count':0x0,'rows':[]};var _0x220321=_['map'](db[_0xa0b1('0x38')][_0xa0b1('0x39')],function(_0x48a578){return{'name':_0x48a578[_0xa0b1('0x3a')],'type':_0x48a578[_0xa0b1('0x3b')]['key']};});_0x2968eb[_0xa0b1('0x3c')]=_[_0xa0b1('0x3d')](_0x220321,_0xa0b1('0x36'));_0x2968eb[_0xa0b1('0x3e')]=_['keys'](_0x162e83[_0xa0b1('0x3e')]);_0x2968eb[_0xa0b1('0x3f')]=_[_0xa0b1('0x40')](_0x2968eb['model'],_0x2968eb[_0xa0b1('0x3e')]);_0x18b787[_0xa0b1('0x41')]=_['intersection'](_0x2968eb[_0xa0b1('0x3c')],qs[_0xa0b1('0x42')](_0x162e83['query']['fields']));_0x18b787[_0xa0b1('0x41')]=_0x18b787[_0xa0b1('0x41')][_0xa0b1('0x43')]?_0x18b787[_0xa0b1('0x41')]:_0x2968eb[_0xa0b1('0x3c')];if(!_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x44')](_0xa0b1('0x45'))){_0x18b787[_0xa0b1('0x2c')]=qs[_0xa0b1('0x2c')](_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x2c')]);_0x18b787['offset']=qs[_0xa0b1('0x2e')](_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x2e')]);}_0x18b787[_0xa0b1('0x46')]=qs[_0xa0b1('0x47')](_0x162e83['query'][_0xa0b1('0x47')]);_0x18b787[_0xa0b1('0x48')]=qs['filters'](_[_0xa0b1('0x49')](_0x162e83[_0xa0b1('0x3e')],_0x2968eb[_0xa0b1('0x3f')]),_0x220321);if(_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x4a')]){_0x18b787[_0xa0b1('0x48')]=_['merge'](_0x18b787['where'],{'$or':_[_0xa0b1('0x3d')](_0x220321,function(_0x3e73a6){if(_0x3e73a6[_0xa0b1('0x3b')]!=='VIRTUAL'){var _0x2a64c6={};_0x2a64c6[_0x3e73a6['name']]={'$like':'%'+_0x162e83['query']['filter']+'%'};return _0x2a64c6;}})});}_0x18b787=_[_0xa0b1('0x4b')]({},_0x18b787,_0x162e83['options']);var _0x219b02={'where':_0x18b787[_0xa0b1('0x48')]};return db[_0xa0b1('0x38')][_0xa0b1('0x2d')](_0x219b02)[_0xa0b1('0x33')](function(_0x175286){_0x3ee941[_0xa0b1('0x2d')]=_0x175286;if(_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x4c')]){_0x18b787[_0xa0b1('0x4d')]=[{'all':!![]}];}return db[_0xa0b1('0x38')][_0xa0b1('0x4e')](_0x18b787);})[_0xa0b1('0x33')](function(_0x265e10){_0x3ee941[_0xa0b1('0x4f')]=_0x265e10;return _0x3ee941;})[_0xa0b1('0x33')](respondWithFilteredResult(_0x98d2ae,_0x18b787))[_0xa0b1('0x50')](handleError(_0x98d2ae,null));};exports['show']=function(_0x478928,_0x5c1584){var _0xd67e9={'raw':![],'where':{'id':_0x478928['params']['id']}},_0xf1e4ce={};_0xf1e4ce['model']=_[_0xa0b1('0x51')](db['Setting'][_0xa0b1('0x39')]);_0xf1e4ce[_0xa0b1('0x3e')]=_[_0xa0b1('0x51')](_0x478928[_0xa0b1('0x3e')]);_0xf1e4ce[_0xa0b1('0x3f')]=_[_0xa0b1('0x40')](_0xf1e4ce[_0xa0b1('0x3c')],_0xf1e4ce['query']);_0xd67e9[_0xa0b1('0x41')]=_[_0xa0b1('0x40')](_0xf1e4ce[_0xa0b1('0x3c')],qs['fields'](_0x478928['query'][_0xa0b1('0x42')]));_0xd67e9[_0xa0b1('0x41')]=_0xd67e9[_0xa0b1('0x41')][_0xa0b1('0x43')]?_0xd67e9[_0xa0b1('0x41')]:_0xf1e4ce['model'];if(_0x478928[_0xa0b1('0x3e')][_0xa0b1('0x4c')]){_0xd67e9['include']=[{'all':!![]}];}_0xd67e9=_[_0xa0b1('0x4b')]({},_0xd67e9,_0x478928[_0xa0b1('0x52')]);return db['Setting'][_0xa0b1('0x53')](_0xd67e9)[_0xa0b1('0x33')](handleEntityNotFound(_0x5c1584,null))['then'](respondWithResult(_0x5c1584,null))[_0xa0b1('0x50')](handleError(_0x5c1584,null));};exports[_0xa0b1('0x32')]=function(_0xc09a15,_0x6fccc9){if(_0xc09a15[_0xa0b1('0x54')]['id']){delete _0xc09a15[_0xa0b1('0x54')]['id'];}return db['Setting'][_0xa0b1('0x53')]({'where':{'id':_0xc09a15[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x6fccc9,null))[_0xa0b1('0x33')](saveUpdates(_0xc09a15[_0xa0b1('0x54')],null))[_0xa0b1('0x33')](respondWithResult(_0x6fccc9,null))[_0xa0b1('0x50')](handleError(_0x6fccc9,null));};exports[_0xa0b1('0x56')]=function(_0x1ed172,_0x205c0f,_0x1a5bf3){if(_0x1ed172['file']&&_0x1ed172[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x1ed172[_0xa0b1('0x54')][_0xa0b1('0x59')]=_0x1ed172['file'][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1ed172[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x205c0f,null))['then'](saveUpdates(_0x1ed172[_0xa0b1('0x54')],null))['then'](respondWithResult(_0x205c0f,null))[_0xa0b1('0x50')](handleError(_0x205c0f,null));};exports[_0xa0b1('0x5a')]=function(_0x1d1df2,_0x4f2b9a,_0x8d9937){if(_0x1d1df2[_0xa0b1('0x57')]&&_0x1d1df2[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x1d1df2[_0xa0b1('0x54')][_0xa0b1('0x5b')]=_0x1d1df2[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1d1df2[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x4f2b9a,null))['then'](saveUpdates(_0x1d1df2['body'],null))['then'](respondWithResult(_0x4f2b9a,null))[_0xa0b1('0x50')](handleError(_0x4f2b9a,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x5c')]=function(_0x1b1f6a,_0x51d686,_0x303d96){var _0x13849a=_0xa0b1('0x5d');var _0x4217d1={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x30efd2){if(_0x30efd2){_0x4217d1=_0x30efd2;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1b1f6a['params']['id']},'attributes':[_0xa0b1('0x59'),'loginLogo',_0xa0b1('0x5f'),_0xa0b1('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xa0b1('0x33')](handleEntityNotFound(_0x51d686,null))[_0xa0b1('0x33')](function(_0x498539){if(_0x498539){var _0x285ab0=_0x498539[_0xa0b1('0x59')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x13849a,_[_0xa0b1('0x64')](_0x498539[_0xa0b1('0x59')])))?path[_0xa0b1('0x62')](config['root'],_0x13849a,_[_0xa0b1('0x64')](_0x498539['logo'])):path['join'](config[_0xa0b1('0x63')],_0x13849a,_['toLower'](_0xa0b1('0x65')));var _0x3d96e0=_0xa0b1('0x66')+_[_0xa0b1('0x67')](_0xa0b1('0x59'));if(_0x498539[_0x3d96e0]||!_0x4217d1[_0xa0b1('0x68')]){_0x285ab0=path['join'](config[_0xa0b1('0x63')],_0x13849a,_[_0xa0b1('0x64')](_0xa0b1('0x65')));}if(!fs[_0xa0b1('0x61')](_0x285ab0)){throw new db[(_0xa0b1('0x69'))][(_0xa0b1('0x6a'))](_['upperFirst']('logo')+_0xa0b1('0x6b'));}return _0x51d686[_0xa0b1('0x6c')](_0x285ab0);}})[_0xa0b1('0x50')](handleError(_0x51d686,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x6d')]=function(_0x1b0480,_0x3f9e0e,_0x53051f){var _0x249f3c=_0xa0b1('0x5d');var _0x129662={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x187558){if(_0x187558){_0x129662=_0x187558;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1b0480[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x59'),_0xa0b1('0x5b'),_0xa0b1('0x5f'),_0xa0b1('0x60'),_0xa0b1('0x6e'),_0xa0b1('0x6f'),_0xa0b1('0x70'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3f9e0e,null))[_0xa0b1('0x33')](function(_0x42af3c){if(_0x42af3c){var _0x32fa03=_0x42af3c[_0xa0b1('0x5b')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_[_0xa0b1('0x64')](_0x42af3c['loginLogo'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_[_0xa0b1('0x64')](_0x42af3c[_0xa0b1('0x5b')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_['toLower'](_0xa0b1('0x71')));var _0x425bb2=_0xa0b1('0x66')+_['upperFirst'](_0xa0b1('0x5b'));if(_0x42af3c[_0x425bb2]||!_0x129662[_0xa0b1('0x68')]){_0x32fa03=path[_0xa0b1('0x62')](config['root'],_0x249f3c,_[_0xa0b1('0x64')]('default_loginLogo.svg'));}if(!fs[_0xa0b1('0x61')](_0x32fa03)){throw new db['Sequelize'][(_0xa0b1('0x6a'))](_[_0xa0b1('0x67')]('loginLogo')+_0xa0b1('0x6b'));}return _0x3f9e0e['download'](_0x32fa03);}})[_0xa0b1('0x50')](handleError(_0x3f9e0e,null));};exports[_0xa0b1('0x72')]=function(_0x4ef178,_0x1e8f4e){return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x4ef178[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x73')]})['then'](respondWithResult(_0x1e8f4e,null))[_0xa0b1('0x50')](handleError(_0x1e8f4e,null));};exports['addPreferred']=function(_0x5afd99,_0x5d10cc,_0x3ec2a0){if(_0x5afd99['file']&&_0x5afd99[_0xa0b1('0x57')]['filename']){_0x5afd99[_0xa0b1('0x54')][_0xa0b1('0x5f')]=_0x5afd99[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x5afd99[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x5d10cc,null))[_0xa0b1('0x33')](saveUpdates(_0x5afd99[_0xa0b1('0x54')],null))['then'](respondWithResult(_0x5d10cc,null))[_0xa0b1('0x50')](handleError(_0x5d10cc,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x74')]=function(_0x2f918a,_0x2cccf6,_0x1a1442){var _0x4fb3a2=_0xa0b1('0x5d');var _0x11f30e={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x97e82a){if(_0x97e82a){_0x11f30e=_0x97e82a;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x2f918a['params']['id']},'attributes':['logo','loginLogo',_0xa0b1('0x5f'),_0xa0b1('0x60'),_0xa0b1('0x6e'),'defaultLoginLogo',_0xa0b1('0x70'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2cccf6,null))[_0xa0b1('0x33')](function(_0x47a4b6){if(_0x47a4b6){var _0x203deb=_0x47a4b6[_0xa0b1('0x5f')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config['root'],_0x4fb3a2,_[_0xa0b1('0x64')](_0x47a4b6['preferred'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fb3a2,_[_0xa0b1('0x64')](_0x47a4b6[_0xa0b1('0x5f')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fb3a2,_['toLower'](_0xa0b1('0x75')));var _0x217b82=_0xa0b1('0x66')+_[_0xa0b1('0x67')](_0xa0b1('0x5f'));if(_0x47a4b6[_0x217b82]||!_0x11f30e[_0xa0b1('0x68')]||!_0x11f30e['preferred']){_0x203deb=path['join'](config[_0xa0b1('0x63')],_0x4fb3a2,_[_0xa0b1('0x64')]('default_preferred.png'));}if(!fs[_0xa0b1('0x61')](_0x203deb)){throw new db[(_0xa0b1('0x69'))]['ValidationError'](_['upperFirst'](_0xa0b1('0x5f'))+_0xa0b1('0x6b'));}return _0x2cccf6['download'](_0x203deb);}})[_0xa0b1('0x50')](handleError(_0x2cccf6,null));};exports[_0xa0b1('0x76')]=function(_0x44ab01,_0x39dbc9,_0xbacf20){if(_0x44ab01[_0xa0b1('0x57')]&&_0x44ab01[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x44ab01[_0xa0b1('0x54')][_0xa0b1('0x60')]=_0x44ab01[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x44ab01[_0xa0b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x39dbc9,null))[_0xa0b1('0x33')](saveUpdates(_0x44ab01['body'],null))[_0xa0b1('0x33')](respondWithResult(_0x39dbc9,null))[_0xa0b1('0x50')](handleError(_0x39dbc9,null));};var utilLicense=require(_0xa0b1('0x18'));exports['getFavicon']=function(_0x5df929,_0x3335f6,_0x2ff011){var _0x4fd46f=_0xa0b1('0x5d');var _0x5a67c3={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x256cbd){if(_0x256cbd){_0x5a67c3=_0x256cbd;}return db['Setting'][_0xa0b1('0x53')]({'where':{'id':_0x5df929[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x59'),_0xa0b1('0x5b'),'preferred',_0xa0b1('0x60'),_0xa0b1('0x6e'),_0xa0b1('0x6f'),'defaultPreferred',_0xa0b1('0x77')],'raw':!![]});})[_0xa0b1('0x33')](handleEntityNotFound(_0x3335f6,null))['then'](function(_0x5dc577){if(_0x5dc577){var _0x105450=_0x5dc577['favicon']&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_[_0xa0b1('0x64')](_0x5dc577['favicon'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_['toLower'](_0x5dc577[_0xa0b1('0x60')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_[_0xa0b1('0x64')]('default_favicon.ico'));var _0x27f37b='default'+_['upperFirst'](_0xa0b1('0x60'));if(_0x5dc577[_0x27f37b]||!_0x5a67c3[_0xa0b1('0x68')]){_0x105450=path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_['toLower'](_0xa0b1('0x78')));}if(!fs['existsSync'](_0x105450)){throw new db['Sequelize'][(_0xa0b1('0x6a'))](_['upperFirst'](_0xa0b1('0x60'))+_0xa0b1('0x6b'));}return _0x3335f6[_0xa0b1('0x6c')](_0x105450);}})[_0xa0b1('0x50')](handleError(_0x3335f6,null));};exports[_0xa0b1('0x79')]=function(_0x1af717,_0x10b97a){var _0x1b8deb={'offset':moment()[_0xa0b1('0x7a')]()};_0x1b8deb[_0xa0b1('0x7b')]=moment()[_0xa0b1('0x7a')](_0x1b8deb[_0xa0b1('0x2e')])['format'](_0xa0b1('0x7c'));return _0x10b97a[_0xa0b1('0x29')](0xc8)[_0xa0b1('0x7d')](_0x1b8deb);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index c12ac0a..f781369 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'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(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x008c,0x188));var _0xc008=function(_0x1f4f14,_0x570d4b){_0x1f4f14=_0x1f4f14-0x0;var _0x3135b1=_0x008c[_0x1f4f14];return _0x3135b1;};'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 0023cd0..4b121b6 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 _0x03ac=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','Setting,\x20%s,\x20%s','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x03ac,0x153));var _0xc03a=function(_0x106ffb,_0x42fff8){_0x106ffb=_0x106ffb-0x0;var _0x5dd7ab=_0x03ac[_0x106ffb];return _0x5dd7ab;};'use strict';var _=require(_0xc03a('0x0'));var util=require(_0xc03a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc03a('0x2'));var fs=require('fs');var Redis=require(_0xc03a('0x3'));var db=require(_0xc03a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc03a('0x5'))('rpc');var config=require(_0xc03a('0x6'));var jayson=require(_0xc03a('0x7'));var client=jayson[_0xc03a('0x8')][_0xc03a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1998fa,_0xf9a404,_0x5dce10){return new BPromise(function(_0x21e930,_0x5e48a6){return client['request'](_0x1998fa,_0x5dce10)[_0xc03a('0xa')](function(_0x3b6943){logger[_0xc03a('0xb')]('Setting,\x20%s,\x20%s',_0xf9a404,_0xc03a('0xc'));logger['debug'](_0xc03a('0xd'),_0xf9a404,_0xc03a('0xc'),JSON[_0xc03a('0xe')](_0x3b6943));if(_0x3b6943['error']){if(_0x3b6943['error'][_0xc03a('0xf')]===0x1f4){logger['error'](_0xc03a('0x10'),_0xf9a404,_0x3b6943[_0xc03a('0x11')][_0xc03a('0x12')]);return _0x5e48a6(_0x3b6943[_0xc03a('0x11')]['message']);}logger[_0xc03a('0x11')](_0xc03a('0x10'),_0xf9a404,_0x3b6943['error'][_0xc03a('0x12')]);return _0x21e930(_0x3b6943[_0xc03a('0x11')][_0xc03a('0x12')]);}else{logger[_0xc03a('0xb')]('Setting,\x20%s,\x20%s',_0xf9a404,_0xc03a('0xc'));_0x21e930(_0x3b6943[_0xc03a('0x13')]['message']);}})[_0xc03a('0x14')](function(_0x1cdee7){logger[_0xc03a('0x11')](_0xc03a('0x10'),_0xf9a404,_0x1cdee7);_0x5e48a6(_0x1cdee7);});});}exports[_0xc03a('0x15')]=function(_0x4914d3){var _0x41bb93=this;return new Promise(function(_0x4c0878,_0x464437){return db[_0xc03a('0x16')][_0xc03a('0x17')]({'raw':_0x4914d3['options']?_0x4914d3[_0xc03a('0x18')][_0xc03a('0x19')]===undefined?!![]:![]:!![],'where':_0x4914d3['options']?_0x4914d3[_0xc03a('0x18')][_0xc03a('0x1a')]||null:null,'attributes':_0x4914d3[_0xc03a('0x18')]?_0x4914d3['options'][_0xc03a('0x1b')]||null:null,'include':_0x4914d3[_0xc03a('0x18')]?_0x4914d3[_0xc03a('0x18')][_0xc03a('0x1c')]?_['map'](_0x4914d3[_0xc03a('0x18')][_0xc03a('0x1c')],function(_0x28a4c2){return{'model':db[_0x28a4c2[_0xc03a('0x1d')]],'as':_0x28a4c2['as'],'attributes':_0x28a4c2[_0xc03a('0x1b')],'include':_0x28a4c2[_0xc03a('0x1c')]?_[_0xc03a('0x1e')](_0x28a4c2[_0xc03a('0x1c')],function(_0x29a0d9){return{'model':db[_0x29a0d9[_0xc03a('0x1d')]],'as':_0x29a0d9['as'],'attributes':_0x29a0d9[_0xc03a('0x1b')],'include':_0x29a0d9[_0xc03a('0x1c')]?_[_0xc03a('0x1e')](_0x29a0d9[_0xc03a('0x1c')],function(_0x59daac){return{'model':db[_0x59daac[_0xc03a('0x1d')]],'as':_0x59daac['as'],'attributes':_0x59daac[_0xc03a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc03a('0xa')](function(_0x137fc9){logger[_0xc03a('0xb')](_0xc03a('0x15'),_0x4914d3);logger['debug']('ShowSetting',_0x4914d3,JSON['stringify'](_0x137fc9));_0x4c0878(_0x137fc9);})['catch'](function(_0xb2b7ff){logger[_0xc03a('0x11')](_0xc03a('0x15'),_0xb2b7ff[_0xc03a('0x12')],_0x4914d3);_0x464437(_0x41bb93[_0xc03a('0x11')](0x1f4,_0xb2b7ff[_0xc03a('0x12')]));});});}; \ No newline at end of file +var _0x254f=['result','catch','Setting','find','options','raw','where','attributes','map','include','model','ShowSetting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x355188,_0x44c2fc){var _0x2ca382=function(_0x33b260){while(--_0x33b260){_0x355188['push'](_0x355188['shift']());}};_0x2ca382(++_0x44c2fc);}(_0x254f,0x182));var _0xf254=function(_0x40372d,_0x2cdea7){_0x40372d=_0x40372d-0x0;var _0x3b3760=_0x254f[_0x40372d];return _0x3b3760;};'use strict';var _=require(_0xf254('0x0'));var util=require(_0xf254('0x1'));var moment=require(_0xf254('0x2'));var BPromise=require(_0xf254('0x3'));var rs=require(_0xf254('0x4'));var fs=require('fs');var Redis=require(_0xf254('0x5'));var db=require(_0xf254('0x6'))['db'];var utils=require(_0xf254('0x7'));var logger=require('../../config/logger')(_0xf254('0x8'));var config=require('../../config/environment');var jayson=require(_0xf254('0x9'));var client=jayson[_0xf254('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x842f2e,_0x4fa5d8,_0x1bfd5f){return new BPromise(function(_0x1fff82,_0x28fa76){return client[_0xf254('0xb')](_0x842f2e,_0x1bfd5f)[_0xf254('0xc')](function(_0x16dcb1){logger[_0xf254('0xd')](_0xf254('0xe'),_0x4fa5d8,_0xf254('0xf'));logger[_0xf254('0x10')](_0xf254('0x11'),_0x4fa5d8,_0xf254('0xf'),JSON[_0xf254('0x12')](_0x16dcb1));if(_0x16dcb1[_0xf254('0x13')]){if(_0x16dcb1[_0xf254('0x13')][_0xf254('0x14')]===0x1f4){logger[_0xf254('0x13')](_0xf254('0xe'),_0x4fa5d8,_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);return _0x28fa76(_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);}logger[_0xf254('0x13')](_0xf254('0xe'),_0x4fa5d8,_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);return _0x1fff82(_0x16dcb1[_0xf254('0x13')]['message']);}else{logger[_0xf254('0xd')](_0xf254('0xe'),_0x4fa5d8,_0xf254('0xf'));_0x1fff82(_0x16dcb1[_0xf254('0x16')][_0xf254('0x15')]);}})[_0xf254('0x17')](function(_0x52faa4){logger['error'](_0xf254('0xe'),_0x4fa5d8,_0x52faa4);_0x28fa76(_0x52faa4);});});}exports['ShowSetting']=function(_0x3c4ed3){var _0x207538=this;return new Promise(function(_0x29b295,_0x3d0c54){return db[_0xf254('0x18')][_0xf254('0x19')]({'raw':_0x3c4ed3['options']?_0x3c4ed3[_0xf254('0x1a')][_0xf254('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c4ed3['options']?_0x3c4ed3[_0xf254('0x1a')][_0xf254('0x1c')]||null:null,'attributes':_0x3c4ed3['options']?_0x3c4ed3['options'][_0xf254('0x1d')]||null:null,'include':_0x3c4ed3[_0xf254('0x1a')]?_0x3c4ed3['options']['include']?_[_0xf254('0x1e')](_0x3c4ed3[_0xf254('0x1a')]['include'],function(_0x32a1b8){return{'model':db[_0x32a1b8['model']],'as':_0x32a1b8['as'],'attributes':_0x32a1b8['attributes'],'include':_0x32a1b8[_0xf254('0x1f')]?_[_0xf254('0x1e')](_0x32a1b8[_0xf254('0x1f')],function(_0xeef509){return{'model':db[_0xeef509[_0xf254('0x20')]],'as':_0xeef509['as'],'attributes':_0xeef509['attributes'],'include':_0xeef509[_0xf254('0x1f')]?_[_0xf254('0x1e')](_0xeef509[_0xf254('0x1f')],function(_0x341c4a){return{'model':db[_0x341c4a[_0xf254('0x20')]],'as':_0x341c4a['as'],'attributes':_0x341c4a[_0xf254('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf254('0xc')](function(_0x1d567b){logger[_0xf254('0xd')]('ShowSetting',_0x3c4ed3);logger[_0xf254('0x10')](_0xf254('0x21'),_0x3c4ed3,JSON[_0xf254('0x12')](_0x1d567b));_0x29b295(_0x1d567b);})[_0xf254('0x17')](function(_0x798ee2){logger[_0xf254('0x13')]('ShowSetting',_0x798ee2['message'],_0x3c4ed3);_0x3d0c54(_0x207538[_0xf254('0x13')](0x1f4,_0x798ee2[_0xf254('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 663afa0..d30ceab 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x566f5d,_0x23e7bb){var _0xc2738d=function(_0x4b1cf2){while(--_0x4b1cf2){_0x566f5d['push'](_0x566f5d['shift']());}};_0xc2738d(++_0x23e7bb);}(_0x6aa7,0x178));var _0x76aa=function(_0xb18dd1,_0x51b750){_0xb18dd1=_0xb18dd1-0x0;var _0x308841=_0x6aa7[_0xb18dd1];return _0x308841;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x5e90e8,_0x4d437f){var _0x5288b7=function(_0x458569){while(--_0x458569){_0x5e90e8['push'](_0x5e90e8['shift']());}};_0x5288b7(++_0x4d437f);}(_0x6aa7,0x178));var _0x76aa=function(_0x544fd3,_0x7e104a){_0x544fd3=_0x544fd3-0x0;var _0xa3e75c=_0x6aa7[_0x544fd3];return _0xa3e75c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 87a7387..e40786a 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 _0xa0fa=['twilio','skebby','clicksend','plivo','clickatell','infobip','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING'];(function(_0x506e09,_0x2a7bb4){var _0x2e8c3e=function(_0x534a36){while(--_0x534a36){_0x506e09['push'](_0x506e09['shift']());}};_0x2e8c3e(++_0x2a7bb4);}(_0xa0fa,0x189));var _0xaa0f=function(_0x1f0c6b,_0xdfaa35){_0x1f0c6b=_0x1f0c6b-0x0;var _0x278a27=_0xa0fa[_0x1f0c6b];return _0x278a27;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xaa0f('0x0'));module[_0xaa0f('0x1')]={'name':{'type':Sequelize[_0xaa0f('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xaa0f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xaa0f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xaa0f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xaa0f('0x2')]},'type':{'type':Sequelize['ENUM'](_0xaa0f('0x3'),_0xaa0f('0x4'),'connectel',_0xaa0f('0x5'),_0xaa0f('0x6'),_0xaa0f('0x7'),'bandwidth','csc',_0xaa0f('0x8'),'intelepeer')},'accountSid':{'type':Sequelize[_0xaa0f('0x2')]},'authId':{'type':Sequelize[_0xaa0f('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xaa0f('0x9')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xaa0f('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xaa0f('0x2')]},'accountId':{'type':Sequelize[_0xaa0f('0x2')]},'senderString':{'type':Sequelize[_0xaa0f('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xaa0f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xaa0f('0xa')],'defaultValue':function(){return _0xaa0f('0xb');}},'notificationSound':{'type':Sequelize[_0xaa0f('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaa0f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaa0f('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaa0f('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaa0f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xaa0f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xaa0f('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x20f6d2){if(!_0x20f6d2)this[_0xaa0f('0xf')](_0xaa0f('0x10'),null);this[_0xaa0f('0xf')](_0xaa0f('0x11'),_0x20f6d2);}}}; \ No newline at end of file +var _0x35f2=['STRING','name','twilio','skebby','clicksend','plivo','clickatell','bandwidth','infobip','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x205d2b,_0x394f82){var _0x2de4e8=function(_0x1cc39c){while(--_0x1cc39c){_0x205d2b['push'](_0x205d2b['shift']());}};_0x2de4e8(++_0x394f82);}(_0x35f2,0x162));var _0x235f=function(_0x4c81ec,_0x3e72a1){_0x4c81ec=_0x4c81ec-0x0;var _0x5d215a=_0x35f2[_0x4c81ec];return _0x5d215a;};'use strict';var Sequelize=require(_0x235f('0x0'));var rs=require(_0x235f('0x1'));module[_0x235f('0x2')]={'name':{'type':Sequelize[_0x235f('0x3')],'unique':_0x235f('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x235f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x235f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x235f('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x235f('0x3')]},'type':{'type':Sequelize['ENUM'](_0x235f('0x5'),_0x235f('0x6'),'connectel',_0x235f('0x7'),_0x235f('0x8'),_0x235f('0x9'),_0x235f('0xa'),'csc',_0x235f('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0x235f('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x235f('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x235f('0x3')]},'password':{'type':Sequelize[_0x235f('0x3')]},'apiKey':{'type':Sequelize[_0x235f('0x3')]},'applicationId':{'type':Sequelize[_0x235f('0x3')]},'accountId':{'type':Sequelize[_0x235f('0x3')]},'senderString':{'type':Sequelize[_0x235f('0x3')]},'deliveryReport':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x235f('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x235f('0xe');}},'notificationSound':{'type':Sequelize[_0x235f('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x235f('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x235f('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x235f('0x11'),'set':function(_0xa4c7cc){if(!_0xa4c7cc)this[_0x235f('0x12')](_0x235f('0x13'),null);this['setDataValue'](_0x235f('0x14'),_0xa4c7cc);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4cc6448..b2e3c30 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 _0xb30d=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','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','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','get','SmsAccounts','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','length','options','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','find','params','describe','Disposition','getDispositions','findOne','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','account','applications','orderBy','Applications','priority','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','messageId','MessageSid','skebby','from','sender','connectel','message_id','plivo','From','Text','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','infobip','groupName','DELIVERED','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce'];(function(_0x27019b,_0x53cc28){var _0x1480f3=function(_0x4199c6){while(--_0x4199c6){_0x27019b['push'](_0x27019b['shift']());}};_0x1480f3(++_0x53cc28);}(_0xb30d,0xd7));var _0xdb30=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xb30d[_0x280ae7];return _0x418b9e;};'use strict';var emlformat=require(_0xdb30('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdb30('0x1'));var moment=require('moment');var BPromise=require(_0xdb30('0x2'));var Mustache=require(_0xdb30('0x3'));var util=require(_0xdb30('0x4'));var path=require(_0xdb30('0x5'));var sox=require(_0xdb30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb30('0x7'));var squel=require(_0xdb30('0x8'));var crypto=require(_0xdb30('0x9'));var jsforce=require(_0xdb30('0xa'));var deskjs=require(_0xdb30('0xb'));var toCsv=require(_0xdb30('0xc'));var querystring=require(_0xdb30('0xd'));var Papa=require(_0xdb30('0xe'));var Redis=require('ioredis');var authService=require(_0xdb30('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdb30('0x10'));var hardwareService=require(_0xdb30('0x11'));var logger=require('../../config/logger')(_0xdb30('0x12'));var utils=require(_0xdb30('0x13'));var config=require(_0xdb30('0x14'));var licenseUtil=require(_0xdb30('0x15'));var db=require(_0xdb30('0x16'))['db'];config[_0xdb30('0x17')]=_[_0xdb30('0x18')](config[_0xdb30('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb30('0x19'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xdb30('0x1a'));var client=jayson[_0xdb30('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3099c1,_0x457c02,_0x58571b,_0x24e928){return new BPromise(function(_0x5423f8,_0x35e886){var _0x5ad714=_0x24e928||client;return _0x5ad714[_0xdb30('0x1c')](_0x3099c1,_0x58571b)[_0xdb30('0x1d')](function(_0x16ca7d){logger[_0xdb30('0x1e')](_0xdb30('0x1f'),_0x457c02,_0xdb30('0x20'));logger[_0xdb30('0x21')](_0xdb30('0x22'),_0x457c02,'request\x20sent',JSON[_0xdb30('0x23')](_0x16ca7d));if(_0x16ca7d['error']){if(_0x16ca7d[_0xdb30('0x24')][_0xdb30('0x25')]===0x1f4){logger[_0xdb30('0x24')](_0xdb30('0x1f'),_0x457c02,_0x16ca7d[_0xdb30('0x24')][_0xdb30('0x26')]);return _0x35e886(_0x16ca7d[_0xdb30('0x24')]['message']);}logger[_0xdb30('0x24')](_0xdb30('0x1f'),_0x457c02,_0x16ca7d[_0xdb30('0x24')][_0xdb30('0x26')]);return _0x5423f8(_0x16ca7d[_0xdb30('0x24')][_0xdb30('0x26')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x457c02,_0xdb30('0x20'));_0x5423f8(_0x16ca7d[_0xdb30('0x27')][_0xdb30('0x26')]);}})[_0xdb30('0x28')](function(_0x1cbc57){logger[_0xdb30('0x24')](_0xdb30('0x1f'),_0x457c02,_0x1cbc57);_0x35e886(_0x1cbc57);});});}function respondWithStatusCode(_0x5f1c77,_0x225c9b){_0x225c9b=_0x225c9b||0xcc;return function(_0x3c0307){if(_0x3c0307){return _0x5f1c77[_0xdb30('0x29')](_0x225c9b);}return _0x5f1c77[_0xdb30('0x2a')](_0x225c9b)[_0xdb30('0x2b')]();};}function respondWithResult(_0x4d2312,_0x1ba9e9){_0x1ba9e9=_0x1ba9e9||0xc8;return function(_0x5eb5af){if(_0x5eb5af){return _0x4d2312['status'](_0x1ba9e9)['json'](_0x5eb5af);}};}function respondWithFilteredResult(_0x16ae44,_0x37bc7c){return function(_0x40e472){if(_0x40e472){var _0x1ece17=typeof _0x37bc7c[_0xdb30('0x2c')]===_0xdb30('0x2d')&&typeof _0x37bc7c['limit']===_0xdb30('0x2d');var _0x59c4db=_0x40e472[_0xdb30('0x2e')];var _0x18b9a5=_0x1ece17?0x0:_0x37bc7c[_0xdb30('0x2c')];var _0x47aced=_0x1ece17?_0x40e472[_0xdb30('0x2e')]:_0x37bc7c[_0xdb30('0x2c')]+_0x37bc7c[_0xdb30('0x2f')];var _0x1581e6;if(_0x47aced>=_0x59c4db){_0x47aced=_0x59c4db;_0x1581e6=0xc8;}else{_0x1581e6=0xce;}_0x16ae44[_0xdb30('0x2a')](_0x1581e6);return _0x16ae44[_0xdb30('0x30')](_0xdb30('0x31'),_0x18b9a5+'-'+_0x47aced+'/'+_0x59c4db)[_0xdb30('0x32')](_0x40e472);}return null;};}function patchUpdates(_0x38d986){return function(_0x16da25){try{jsonpatch[_0xdb30('0x33')](_0x16da25,_0x38d986,!![]);}catch(_0x28c732){return BPromise[_0xdb30('0x34')](_0x28c732);}return _0x16da25['save']();};}function saveUpdates(_0x326309,_0x4e0d83){return function(_0x415cf9){if(_0x415cf9){return _0x415cf9[_0xdb30('0x35')](_0x326309)[_0xdb30('0x1d')](function(_0x5bb942){return _0x5bb942;});}return null;};}function removeEntity(_0x38179b,_0x34c6c3){return function(_0x3c29f3){if(_0x3c29f3){return _0x3c29f3[_0xdb30('0x36')]()[_0xdb30('0x1d')](function(){var _0x3f05e1=_0x3c29f3[_0xdb30('0x37')]({'plain':!![]});var _0x17e35a=_0xdb30('0x38');return db['UserProfileResource'][_0xdb30('0x36')]({'where':{'type':_0x17e35a,'resourceId':_0x3f05e1['id']}})[_0xdb30('0x1d')](function(){return _0x3c29f3;});})['then'](function(){_0x38179b[_0xdb30('0x2a')](0xcc)[_0xdb30('0x2b')]();});}};}function handleEntityNotFound(_0x5c11e9,_0x5e5d03){return function(_0x1194cb){if(!_0x1194cb){_0x5c11e9[_0xdb30('0x29')](0x194);}return _0x1194cb;};}function handleError(_0xc10526,_0x57eb77){_0x57eb77=_0x57eb77||0x1f4;return function(_0x306c6e){logger['error'](_0x306c6e['stack']);if(_0x306c6e[_0xdb30('0x39')]){delete _0x306c6e['name'];}_0xc10526[_0xdb30('0x2a')](_0x57eb77)[_0xdb30('0x3a')](_0x306c6e);};}exports[_0xdb30('0x3b')]=function(_0x2817f7,_0x407fd3){var _0x5e40f3={'include':[{'model':db[_0xdb30('0x3c')],'as':_0xdb30('0x3d')}]},_0x5c1ed8={},_0x37201a={'count':0x0,'rows':[]};var _0xc8007e=_[_0xdb30('0x3e')](db[_0xdb30('0x3f')][_0xdb30('0x40')],function(_0x939d18){return{'name':_0x939d18[_0xdb30('0x41')],'type':_0x939d18[_0xdb30('0x42')][_0xdb30('0x43')]};});_0x5c1ed8[_0xdb30('0x44')]=_[_0xdb30('0x3e')](_0xc8007e,_0xdb30('0x39'));_0x5c1ed8['query']=_[_0xdb30('0x45')](_0x2817f7[_0xdb30('0x46')]);_0x5c1ed8[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x5c1ed8['model'],_0x5c1ed8[_0xdb30('0x46')]);_0x5e40f3['attributes']=_[_0xdb30('0x48')](_0x5c1ed8[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x2817f7['query']['fields']));_0x5e40f3['attributes']=_0x5e40f3[_0xdb30('0x4a')]['length']?_0x5e40f3[_0xdb30('0x4a')]:_0x5c1ed8[_0xdb30('0x44')];if(!_0x2817f7['query'][_0xdb30('0x4b')](_0xdb30('0x4c'))){_0x5e40f3[_0xdb30('0x2f')]=qs[_0xdb30('0x2f')](_0x2817f7[_0xdb30('0x46')]['limit']);_0x5e40f3['offset']=qs[_0xdb30('0x2c')](_0x2817f7[_0xdb30('0x46')]['offset']);}_0x5e40f3[_0xdb30('0x4d')]=qs['sort'](_0x2817f7['query'][_0xdb30('0x4e')]);_0x5e40f3[_0xdb30('0x4f')]=qs[_0xdb30('0x47')](_[_0xdb30('0x50')](_0x2817f7[_0xdb30('0x46')],_0x5c1ed8[_0xdb30('0x47')]),_0xc8007e);if(_0x2817f7[_0xdb30('0x46')][_0xdb30('0x51')]){_0x5e40f3[_0xdb30('0x4f')]=_['merge'](_0x5e40f3['where'],{'$or':_[_0xdb30('0x3e')](_0xc8007e,function(_0x3d8f74){if(_0x3d8f74[_0xdb30('0x42')]!=='VIRTUAL'){var _0x24eba={};_0x24eba[_0x3d8f74[_0xdb30('0x39')]]={'$like':'%'+_0x2817f7[_0xdb30('0x46')][_0xdb30('0x51')]+'%'};return _0x24eba;}})});}_0x5e40f3=_[_0xdb30('0x52')]({},_0x5e40f3,_0x2817f7['options']);var _0x3595a3={'where':_0x5e40f3[_0xdb30('0x4f')]};return db['SmsAccount']['count'](_0x3595a3)[_0xdb30('0x1d')](function(_0xeba0ca){_0x37201a['count']=_0xeba0ca;if(_0x2817f7[_0xdb30('0x46')][_0xdb30('0x53')]){_0x5e40f3[_0xdb30('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0xdb30('0x55')](_0x5e40f3);})['then'](function(_0x919871){_0x37201a[_0xdb30('0x56')]=_0x919871;return _0x37201a;})[_0xdb30('0x1d')](respondWithFilteredResult(_0x407fd3,_0x5e40f3))[_0xdb30('0x28')](handleError(_0x407fd3,null));};exports[_0xdb30('0x57')]=function(_0x3d0ed9,_0x268f65){var _0x30bc05={'raw':![],'where':{'id':_0x3d0ed9['params']['id']},'include':[{'model':db[_0xdb30('0x3c')],'as':_0xdb30('0x3d')}]},_0x246552={};_0x246552[_0xdb30('0x44')]=_[_0xdb30('0x45')](db[_0xdb30('0x3f')]['rawAttributes']);_0x246552[_0xdb30('0x46')]=_[_0xdb30('0x45')](_0x3d0ed9[_0xdb30('0x46')]);_0x246552[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x246552[_0xdb30('0x44')],_0x246552[_0xdb30('0x46')]);_0x30bc05[_0xdb30('0x4a')]=_['intersection'](_0x246552[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x3d0ed9['query']['fields']));_0x30bc05[_0xdb30('0x4a')]=_0x30bc05['attributes'][_0xdb30('0x58')]?_0x30bc05[_0xdb30('0x4a')]:_0x246552['model'];if(_0x3d0ed9[_0xdb30('0x46')]['includeAll']){_0x30bc05['include']=[{'all':!![]}];}_0x30bc05=_[_0xdb30('0x52')]({},_0x30bc05,_0x3d0ed9[_0xdb30('0x59')]);return db[_0xdb30('0x3f')]['find'](_0x30bc05)[_0xdb30('0x1d')](handleEntityNotFound(_0x268f65,null))[_0xdb30('0x1d')](respondWithResult(_0x268f65,null))['catch'](handleError(_0x268f65,null));};exports[_0xdb30('0x5a')]=function(_0x1dc2a6,_0x1910a9){return db[_0xdb30('0x3f')][_0xdb30('0x5a')](_0x1dc2a6[_0xdb30('0x5b')],{})[_0xdb30('0x1d')](function(_0x39d21e){var _0x111563=_0x1dc2a6[_0xdb30('0x5c')][_0xdb30('0x37')]({'plain':!![]});if(!_0x111563)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x111563[_0xdb30('0x5d')]==='user'){var _0xa82d4e=_0x39d21e[_0xdb30('0x37')]({'plain':!![]});var _0x327819=_0xdb30('0x38');return db[_0xdb30('0x5e')]['find']({'where':{'name':_0x327819,'userProfileId':_0x111563[_0xdb30('0x5f')]},'raw':!![]})[_0xdb30('0x1d')](function(_0x1f1640){if(_0x1f1640&&_0x1f1640['autoAssociation']===0x0){return db[_0xdb30('0x60')][_0xdb30('0x5a')]({'name':_0xa82d4e[_0xdb30('0x39')],'resourceId':_0xa82d4e['id'],'type':_0x1f1640[_0xdb30('0x39')],'sectionId':_0x1f1640['id']},{})[_0xdb30('0x1d')](function(){return _0x39d21e;});}else{return _0x39d21e;}})['catch'](function(_0x46713d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46713d);throw _0x46713d;});}return _0x39d21e;})[_0xdb30('0x1d')](respondWithResult(_0x1910a9,0xc9))[_0xdb30('0x28')](handleError(_0x1910a9,null));};exports[_0xdb30('0x35')]=function(_0x53a198,_0x466e2f){if(_0x53a198[_0xdb30('0x5b')]['id']){delete _0x53a198[_0xdb30('0x5b')]['id'];}return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x53a198[_0xdb30('0x62')]['id']},'include':[{'model':db[_0xdb30('0x3c')],'as':_0xdb30('0x3d')}]})[_0xdb30('0x1d')](handleEntityNotFound(_0x466e2f,null))['then'](saveUpdates(_0x53a198[_0xdb30('0x5b')],null))[_0xdb30('0x1d')](respondWithResult(_0x466e2f,null))[_0xdb30('0x28')](handleError(_0x466e2f,null));};exports[_0xdb30('0x36')]=function(_0x25e040,_0x5af69d){return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x25e040[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x5af69d,null))[_0xdb30('0x1d')](removeEntity(_0x5af69d,null))[_0xdb30('0x28')](handleError(_0x5af69d,null));};exports[_0xdb30('0x63')]=function(_0x577e4c,_0xa56c26){return db['SmsAccount'][_0xdb30('0x63')]()[_0xdb30('0x1d')](respondWithResult(_0xa56c26,null))[_0xdb30('0x28')](handleError(_0xa56c26,null));};exports['addDisposition']=function(_0x4bc352,_0x2f518d,_0xbe9e9a){if(_0x4bc352['body']['id']){delete _0x4bc352[_0xdb30('0x5b')]['id'];}return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x4bc352[_0xdb30('0x62')]['id']}})['then'](handleEntityNotFound(_0x2f518d,null))[_0xdb30('0x1d')](function(_0x94d358){if(_0x94d358){_0x4bc352[_0xdb30('0x5b')]['SmsAccountId']=_0x94d358['id'];return db[_0xdb30('0x64')][_0xdb30('0x5a')](_0x4bc352[_0xdb30('0x5b')]);}})['then'](respondWithResult(_0x2f518d,null))[_0xdb30('0x28')](handleError(_0x2f518d,null));};exports[_0xdb30('0x65')]=function(_0x5e2429,_0x246e47,_0x283b09){var _0x13f910={'raw':![],'where':{}};var _0x2da7ae={};var _0x581565={'count':0x0,'rows':[]};return db[_0xdb30('0x3f')][_0xdb30('0x66')]({'where':{'id':_0x5e2429[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x246e47,null))['then'](function(_0x2bb1d7){if(_0x2bb1d7){_0x2da7ae[_0xdb30('0x44')]=_['keys'](db[_0xdb30('0x64')][_0xdb30('0x40')]);_0x2da7ae[_0xdb30('0x46')]=_[_0xdb30('0x45')](_0x5e2429[_0xdb30('0x46')]);_0x2da7ae[_0xdb30('0x47')]=_['intersection'](_0x2da7ae[_0xdb30('0x44')],_0x2da7ae[_0xdb30('0x46')]);_0x13f910[_0xdb30('0x4a')]=_[_0xdb30('0x48')](_0x2da7ae[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x5e2429[_0xdb30('0x46')][_0xdb30('0x49')]));_0x13f910[_0xdb30('0x4a')]=_0x13f910['attributes'][_0xdb30('0x58')]?_0x13f910['attributes']:_0x2da7ae[_0xdb30('0x44')];if(!_0x5e2429[_0xdb30('0x46')]['hasOwnProperty']('nolimit')){_0x13f910['limit']=qs[_0xdb30('0x2f')](_0x5e2429[_0xdb30('0x46')][_0xdb30('0x2f')]);_0x13f910[_0xdb30('0x2c')]=qs[_0xdb30('0x2c')](_0x5e2429[_0xdb30('0x46')]['offset']);}_0x13f910[_0xdb30('0x4d')]=qs[_0xdb30('0x4e')](_0x5e2429['query'][_0xdb30('0x4e')]);_0x13f910[_0xdb30('0x4f')]=qs[_0xdb30('0x47')](_[_0xdb30('0x50')](_0x5e2429[_0xdb30('0x46')],_0x2da7ae[_0xdb30('0x47')]));_0x13f910['where'][_0xdb30('0x67')]=_0x2bb1d7['id'];if(_0x5e2429[_0xdb30('0x46')][_0xdb30('0x51')]){_0x13f910[_0xdb30('0x4f')]=_['merge'](_0x13f910[_0xdb30('0x4f')],{'$or':_[_0xdb30('0x3e')](_0x13f910['attributes'],function(_0x20326f){var _0x42de7d={};_0x42de7d[_0x20326f]={'$like':'%'+_0x5e2429[_0xdb30('0x46')][_0xdb30('0x51')]+'%'};return _0x42de7d;})});}_0x13f910=_[_0xdb30('0x52')]({},_0x13f910,_0x5e2429['options']);return db[_0xdb30('0x64')][_0xdb30('0x2e')]({'where':_0x13f910[_0xdb30('0x4f')]})[_0xdb30('0x1d')](function(_0x471fc8){_0x581565[_0xdb30('0x2e')]=_0x471fc8;if(_0x5e2429[_0xdb30('0x46')][_0xdb30('0x53')]){_0x13f910[_0xdb30('0x54')]=[{'all':!![]}];}return db[_0xdb30('0x64')][_0xdb30('0x55')](_0x13f910);})['then'](function(_0xadd6b5){_0x581565[_0xdb30('0x56')]=_0xadd6b5;return _0x581565;});}})['then'](respondWithFilteredResult(_0x246e47,_0x13f910))['catch'](handleError(_0x246e47,null));};exports[_0xdb30('0x68')]=function(_0x2fbd6e,_0x413889,_0x5e21f3){return db[_0xdb30('0x3f')]['find']({'where':{'id':_0x2fbd6e[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x413889,null))[_0xdb30('0x1d')](function(_0x33599f){if(_0x33599f){return _0x33599f[_0xdb30('0x68')](_0x2fbd6e[_0xdb30('0x46')][_0xdb30('0x69')]);}})[_0xdb30('0x1d')](respondWithStatusCode(_0x413889,null))[_0xdb30('0x28')](handleError(_0x413889,null));};exports[_0xdb30('0x6a')]=function(_0x26214c,_0x1adce1,_0x206173){if(_0x26214c[_0xdb30('0x5b')]['id']){delete _0x26214c[_0xdb30('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x26214c[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x1adce1,null))[_0xdb30('0x1d')](function(_0x5c20aa){if(_0x5c20aa){_0x26214c[_0xdb30('0x5b')][_0xdb30('0x67')]=_0x5c20aa['id'];return db[_0xdb30('0x6b')][_0xdb30('0x5a')](_0x26214c[_0xdb30('0x5b')]);}})[_0xdb30('0x1d')](respondWithResult(_0x1adce1,null))[_0xdb30('0x28')](handleError(_0x1adce1,null));};exports[_0xdb30('0x6c')]=function(_0x2a87ac,_0x21a3a0,_0x39ac7c){var _0x165b65={'raw':![],'where':{}};var _0x281fec={};var _0x206f7b={'count':0x0,'rows':[]};return db[_0xdb30('0x3f')][_0xdb30('0x66')]({'where':{'id':_0x2a87ac['params']['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x21a3a0,null))[_0xdb30('0x1d')](function(_0x3193cb){if(_0x3193cb){_0x281fec['model']=_['keys'](db[_0xdb30('0x6b')][_0xdb30('0x40')]);_0x281fec[_0xdb30('0x46')]=_[_0xdb30('0x45')](_0x2a87ac[_0xdb30('0x46')]);_0x281fec[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x281fec['model'],_0x281fec[_0xdb30('0x46')]);_0x165b65[_0xdb30('0x4a')]=_[_0xdb30('0x48')](_0x281fec['model'],qs[_0xdb30('0x49')](_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x49')]));_0x165b65[_0xdb30('0x4a')]=_0x165b65[_0xdb30('0x4a')]['length']?_0x165b65[_0xdb30('0x4a')]:_0x281fec[_0xdb30('0x44')];if(!_0x2a87ac['query'][_0xdb30('0x4b')](_0xdb30('0x4c'))){_0x165b65['limit']=qs['limit'](_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x2f')]);_0x165b65[_0xdb30('0x2c')]=qs[_0xdb30('0x2c')](_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x2c')]);}_0x165b65['order']=qs[_0xdb30('0x4e')](_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x4e')]);_0x165b65[_0xdb30('0x4f')]=qs[_0xdb30('0x47')](_[_0xdb30('0x50')](_0x2a87ac[_0xdb30('0x46')],_0x281fec['filters']));_0x165b65[_0xdb30('0x4f')][_0xdb30('0x67')]=_0x3193cb['id'];if(_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x51')]){_0x165b65[_0xdb30('0x4f')]=_['merge'](_0x165b65[_0xdb30('0x4f')],{'$or':_['map'](_0x165b65[_0xdb30('0x4a')],function(_0x2a13fe){var _0x3a56b6={};_0x3a56b6[_0x2a13fe]={'$like':'%'+_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x51')]+'%'};return _0x3a56b6;})});}_0x165b65=_['merge']({},_0x165b65,_0x2a87ac[_0xdb30('0x59')]);return db[_0xdb30('0x6b')][_0xdb30('0x2e')]({'where':_0x165b65['where']})[_0xdb30('0x1d')](function(_0xd67077){_0x206f7b[_0xdb30('0x2e')]=_0xd67077;if(_0x2a87ac[_0xdb30('0x46')][_0xdb30('0x53')]){_0x165b65[_0xdb30('0x54')]=[{'all':!![]}];}return db[_0xdb30('0x6b')][_0xdb30('0x55')](_0x165b65);})['then'](function(_0x41c27a){_0x206f7b[_0xdb30('0x56')]=_0x41c27a;return _0x206f7b;});}})[_0xdb30('0x1d')](respondWithFilteredResult(_0x21a3a0,_0x165b65))[_0xdb30('0x28')](handleError(_0x21a3a0,null));};exports[_0xdb30('0x6d')]=function(_0x2104d5,_0x2dae83,_0xeda37){return db['SmsAccount'][_0xdb30('0x61')]({'where':{'id':_0x2104d5[_0xdb30('0x62')]['id']}})['then'](handleEntityNotFound(_0x2dae83,null))[_0xdb30('0x1d')](function(_0x4669bf){if(_0x4669bf){return _0x4669bf[_0xdb30('0x6d')](_0x2104d5[_0xdb30('0x46')][_0xdb30('0x69')]);}})['then'](respondWithStatusCode(_0x2dae83,null))[_0xdb30('0x28')](handleError(_0x2dae83,null));};exports[_0xdb30('0x6e')]=function(_0x1ef33f,_0x3831c0,_0x6516c9){var _0x8a0612={'channel':'sms'};var _0x366316=[];var _0x4afd42=[];var _0x236fab={};return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x1ef33f[_0xdb30('0x62')]['id']},'include':[{'model':db[_0xdb30('0x6f')],'as':'Applications'}]})[_0xdb30('0x1d')](handleEntityNotFound(_0x3831c0,null))[_0xdb30('0x1d')](function(_0x1cdc49){_0x8a0612[_0xdb30('0x70')]=_0x1cdc49;_0x8a0612[_0xdb30('0x71')]=_[_0xdb30('0x72')](_0x1cdc49[_0xdb30('0x73')],[_0xdb30('0x74')],['asc']);if(_0x8a0612[_0xdb30('0x70')][_0xdb30('0x73')]){delete _0x8a0612['account']['Applications'];}return db[_0xdb30('0x75')][_0xdb30('0x63')]();})[_0xdb30('0x1d')](function(_0x19257f){if(!_0x19257f){throw new db[(_0xdb30('0x76'))][(_0xdb30('0x77'))]('no\x20available\x20attributes');}_0x366316=_[_0xdb30('0x78')](_['keys'](_0x19257f),[_0xdb30('0x79'),_0xdb30('0x7a')]);_0x4afd42=_[_0xdb30('0x78')](_[_0xdb30('0x45')](_0x19257f),[_0xdb30('0x79'),_0xdb30('0x7a'),'CompanyId',_0xdb30('0x7b')]);_0x8a0612[_0xdb30('0x5b')]={'mapKey':_0xdb30('0x7c')};if(_0x8a0612['account'][_0xdb30('0x42')]){switch(_0x8a0612[_0xdb30('0x70')][_0xdb30('0x42')]){case _0xdb30('0x7d'):_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')]['From'];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')]['Body'];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x7f')];break;case _0xdb30('0x80'):_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')]='+'+_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x82')];_0x8a0612[_0xdb30('0x5b')]['body']=_0x1ef33f[_0xdb30('0x5b')]['text'];break;case _0xdb30('0x83'):_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x81')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x26')];break;case'clicksend':_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x81')];_0x8a0612['body'][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')]['body'];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x84')];break;case _0xdb30('0x85'):_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x86')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]=_0x1ef33f['body'][_0xdb30('0x87')];_0x8a0612[_0xdb30('0x5b')]['messageId']=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x88')];break;case'infobip':_0x8a0612['body'][_0xdb30('0x81')]='+'+_0x1ef33f[_0xdb30('0x5b')]['results'][0x0]['from'];_0x8a0612['body'][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x89')][0x0][_0xdb30('0x8a')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x89')][0x0][_0xdb30('0x7e')];break;case _0xdb30('0x8b'):_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x8c')];_0x8a0612['body'][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x8d')][_0xdb30('0x26')];break;case'clickatell':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x8e')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x8a')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f['body'][_0xdb30('0x8f')];break;case _0xdb30('0x90'):_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f['body'][0x0][_0xdb30('0x26')]['id'];_0x8a0612[_0xdb30('0x5b')]['from']=_0x1ef33f[_0xdb30('0x5b')][0x0][_0xdb30('0x26')][_0xdb30('0x81')];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]=_0x1ef33f['body'][0x0][_0xdb30('0x26')]['text'];break;case _0xdb30('0x91'):_0x8a0612['body'][_0xdb30('0x81')]=_0x1ef33f[_0xdb30('0x5b')][_0xdb30('0x81')];_0x8a0612[_0xdb30('0x5b')]['body']=_0x1ef33f[_0xdb30('0x5b')]['message'];_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')]=_0x1ef33f[_0xdb30('0x5b')]['refid'];break;}}if(_0x8a0612[_0xdb30('0x5b')]['id']){delete _0x8a0612[_0xdb30('0x5b')]['id'];}if(_[_0xdb30('0x92')](_0x8a0612[_0xdb30('0x5b')]['from'])){throw new db['Sequelize']['ValidationError'](_0xdb30('0x93'));}if(_[_0xdb30('0x92')](_0x8a0612['body'][_0xdb30('0x5b')])||_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')]===''){throw new db['Sequelize'][(_0xdb30('0x77'))](_0xdb30('0x94'));}if(_[_0xdb30('0x92')](_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x95')])){throw new db['Sequelize'][(_0xdb30('0x77'))](_0xdb30('0x96')+_0x4afd42);}if(!_['includes'](_0x4afd42,_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x95')])){throw new db['Sequelize'][(_0xdb30('0x77'))](_0xdb30('0x97')+_0x4afd42);}_0x236fab[_0x8a0612['body']['mapKey']]=_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')];return db[_0xdb30('0x98')][_0xdb30('0x61')]({'where':{'id':_0x8a0612['account']['ListId']},'include':[{'model':db[_0xdb30('0x75')],'as':_0xdb30('0x99'),'where':_0x236fab,'limit':0x1,'order':[[_0xdb30('0x7a'),_0xdb30('0x9a')]]}]});})[_0xdb30('0x1d')](handleEntityNotFound(_0x3831c0,null))[_0xdb30('0x1d')](function(_0x78c371){if(_0x78c371){_0x8a0612['list']=_[_0xdb30('0x9b')](_0x78c371,[_0xdb30('0x99')]);if(_0x78c371[_0xdb30('0x99')]['length']){return _0x78c371[_0xdb30('0x99')][0x0];}var _0x2897ff=_[_0xdb30('0x18')](_0x8a0612[_0xdb30('0x5b')],{'firstName':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')],'ListId':_0x78c371['id']});_0x2897ff[_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x95')]]=_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')];return db['CmContact'][_0xdb30('0x5a')](_0x2897ff,{'fields':_0x366316,'raw':!![]});}})[_0xdb30('0x1d')](handleEntityNotFound(_0x3831c0,null))['then'](function(_0x53bf10){if(_0x53bf10){_0x8a0612[_0xdb30('0x9c')]=_0x53bf10;var _0x39730a={'ContactId':_0x53bf10['id'],'phone':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')],'SmsAccountId':_0x1ef33f[_0xdb30('0x62')]['id']};var _0x1e14b3={'ContactId':_0x53bf10['id'],'SmsAccountId':_0x1ef33f['params']['id'],'closed':![]};return db[_0xdb30('0x9d')]['find']({'where':_0x1e14b3})[_0xdb30('0x1d')](function(_0x15b31a){if(_0x15b31a){return[_0x15b31a,![]];}return db['SmsInteraction']['create'](_0x39730a)['then'](function(_0x540f2b){return[_0x540f2b,!![]];});});}})[_0xdb30('0x9e')](function(_0x374619,_0x269b73){_0x8a0612[_0xdb30('0x9f')]=_0x374619[_0xdb30('0x37')]({'plain':!![]});_0x8a0612[_0xdb30('0x9f')][_0xdb30('0xa0')]=![];if(_0x269b73){if(_0x8a0612[_0xdb30('0x70')][_0xdb30('0xa1')]){_0x8a0612[_0xdb30('0x71')][_0xdb30('0xa2')]({'id':0x0,'priority':_0x8a0612[_0xdb30('0x71')][_0xdb30('0x58')]+0x1,'app':_0xdb30('0xa3'),'appdata':_0xdb30('0xa4'),'interval':'*,*,*,*'});}_0x8a0612['interaction'][_0xdb30('0xa0')]=!![];}return db[_0xdb30('0xa5')][_0xdb30('0x5a')]({'phone':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x81')],'messageId':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x7e')],'body':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0x5b')],'SmsAccountId':_0x1ef33f[_0xdb30('0x62')]['id'],'SmsInteractionId':_0x374619['id'],'direction':'in','ContactId':_0x374619[_0xdb30('0xa6')],'AttachmentId':_0x8a0612[_0xdb30('0x5b')][_0xdb30('0xa7')]});})[_0xdb30('0x1d')](function(_0x16c97a){_0x8a0612[_0xdb30('0x26')]=_0x16c97a;if(_0x8a0612[_0xdb30('0x9f')]['UserId']){return db[_0xdb30('0xa8')][_0xdb30('0x61')]({'attributes':['id','name'],'where':{'id':_0x8a0612[_0xdb30('0x9f')][_0xdb30('0xa9')]}})[_0xdb30('0x1d')](function(_0x17b5b4){if(_0x17b5b4){_0x8a0612[_0xdb30('0x71')][_0xdb30('0xaa')]({'id':0x0,'priority':0x0,'app':_0xdb30('0xab'),'appdata':_0x17b5b4['name']+','+(_0x8a0612['account'][_0xdb30('0xac')]||0xa),'interval':_0xdb30('0xad')});}return respondWithRpcPromise(_0xdb30('0xae'),_0xdb30('0xaf'),_0x8a0612);});}return respondWithRpcPromise(_0xdb30('0xae'),_0xdb30('0xaf'),_0x8a0612);})['then'](function(_0x354d06){if(_0x354d06){var _0x2327c3=0xc8;var _0x5e7dad=_0xdb30('0xb0');logger[_0xdb30('0x1e')](_0xdb30('0x22'),_0x5e7dad,_0x2327c3,_0xdb30('0xb1'));logger[_0xdb30('0x21')](_0xdb30('0xb2'),_0x5e7dad,_0x2327c3,_0xdb30('0xb1'),JSON[_0xdb30('0x23')](_0x354d06));if(_0x8a0612[_0xdb30('0x70')][_0xdb30('0x42')]==='twilio'){return _0x3831c0[_0xdb30('0x2a')](_0x2327c3)['set'](_0xdb30('0xb3'),_0xdb30('0xb4'))[_0xdb30('0x3a')](_0xdb30('0xb5'));}else{return _0x3831c0['status'](_0x2327c3)['json'](_0x354d06);}}})[_0xdb30('0x28')](handleError(_0x3831c0,null));};exports[_0xdb30('0xb6')]=function(_0x2fe187,_0x128da9,_0x244cf0){return db['SmsAccount'][_0xdb30('0x66')]({'where':{'id':_0x2fe187[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x128da9,null))[_0xdb30('0x1d')](function(_0x319098){if(_0x319098){return db[_0xdb30('0xb7')][_0xdb30('0xb8')](function(_0x54c6d8){return db[_0xdb30('0x6f')][_0xdb30('0x36')]({'where':{'SmsAccountId':_0x2fe187[_0xdb30('0x62')]['id']},'transaction':_0x54c6d8})[_0xdb30('0x1d')](function(_0x4ba7d8){var _0x49fb02=_[_0xdb30('0x3e')](_0x2fe187[_0xdb30('0x5b')],function(_0x431aa4){_0x431aa4['SmsAccountId']=_0x2fe187[_0xdb30('0x62')]['id'];return _0x431aa4;});return db['SmsApplication'][_0xdb30('0xb9')](_0x49fb02,{'transaction':_0x54c6d8});});})[_0xdb30('0x1d')](function(){return db[_0xdb30('0x6f')][_0xdb30('0xba')]({'where':{'SmsAccountId':_0x2fe187['params']['id']},'order':'priority'});});}})[_0xdb30('0x1d')](respondWithResult(_0x128da9,null))[_0xdb30('0x28')](handleError(_0x128da9,null));};exports['getApplications']=function(_0x5b5c41,_0x5b3c54,_0x4cdd6f){var _0x4b91c1={};var _0x29c26d={};var _0x2d8583;var _0x40361b;return db['SmsAccount'][_0xdb30('0x66')]({'where':{'id':_0x5b5c41['params']['id']}})['then'](handleEntityNotFound(_0x5b3c54,null))[_0xdb30('0x1d')](function(_0x28aac6){if(_0x28aac6){_0x2d8583=_0x28aac6;_0x29c26d['model']=_[_0xdb30('0x45')](db[_0xdb30('0x6f')][_0xdb30('0x40')]);_0x29c26d[_0xdb30('0x46')]=_['keys'](_0x5b5c41[_0xdb30('0x46')]);_0x29c26d[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x29c26d[_0xdb30('0x44')],_0x29c26d['query']);_0x4b91c1['attributes']=_[_0xdb30('0x48')](_0x29c26d[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x49')]));_0x4b91c1['attributes']=_0x4b91c1[_0xdb30('0x4a')][_0xdb30('0x58')]?_0x4b91c1['attributes']:_0x29c26d[_0xdb30('0x44')];_0x4b91c1['order']=qs[_0xdb30('0x4e')](_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x4e')]);_0x4b91c1['where']=qs[_0xdb30('0x47')](_[_0xdb30('0x50')](_0x5b5c41[_0xdb30('0x46')],_0x29c26d[_0xdb30('0x47')]));if(_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x51')]){_0x4b91c1[_0xdb30('0x4f')]=_[_0xdb30('0x52')](_0x4b91c1['where'],{'$or':_[_0xdb30('0x3e')](_0x4b91c1['attributes'],function(_0x4484c4){var _0x28d49c={};_0x28d49c[_0x4484c4]={'$like':'%'+_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x51')]+'%'};return _0x28d49c;})});}_0x4b91c1=_[_0xdb30('0x52')]({},_0x4b91c1,_0x5b5c41[_0xdb30('0x59')]);return _0x2d8583['getApplications'](_0x4b91c1);}})['then'](function(_0x321d2f){if(_0x321d2f){_0x40361b=_0x321d2f[_0xdb30('0x58')];if(!_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x4b')](_0xdb30('0x4c'))){_0x4b91c1[_0xdb30('0x2f')]=qs[_0xdb30('0x2f')](_0x5b5c41[_0xdb30('0x46')][_0xdb30('0x2f')]);_0x4b91c1[_0xdb30('0x2c')]=qs[_0xdb30('0x2c')](_0x5b5c41[_0xdb30('0x46')]['offset']);}return _0x2d8583[_0xdb30('0xbb')](_0x4b91c1);}})[_0xdb30('0x1d')](function(_0x20b49c){if(_0x20b49c){return _0x20b49c?{'count':_0x40361b,'rows':_0x20b49c}:null;}})[_0xdb30('0x1d')](respondWithResult(_0x5b3c54,null))[_0xdb30('0x28')](handleError(_0x5b3c54,null));};exports[_0xdb30('0xbc')]=function(_0x2edca8,_0x4f7f17,_0x26a3fe){var _0x530c6d={'raw':![],'where':{}};var _0x5867fd={};var _0xa56564={'count':0x0,'rows':[]};return db['SmsAccount'][_0xdb30('0x66')]({'where':{'id':_0x2edca8[_0xdb30('0x62')]['id']}})['then'](handleEntityNotFound(_0x4f7f17,null))['then'](function(_0x407bb8){if(_0x407bb8){_0x5867fd[_0xdb30('0x44')]=_[_0xdb30('0x45')](db['SmsInteraction'][_0xdb30('0x40')]);_0x5867fd[_0xdb30('0x46')]=_[_0xdb30('0x45')](_0x2edca8[_0xdb30('0x46')]);_0x5867fd[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x5867fd['model'],_0x5867fd[_0xdb30('0x46')]);_0x530c6d[_0xdb30('0x4a')]=_[_0xdb30('0x48')](_0x5867fd[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x2edca8['query'][_0xdb30('0x49')]));_0x530c6d[_0xdb30('0x4a')]=_0x530c6d[_0xdb30('0x4a')][_0xdb30('0x58')]?_0x530c6d['attributes']:_0x5867fd[_0xdb30('0x44')];if(!_0x2edca8[_0xdb30('0x46')]['hasOwnProperty']('nolimit')){_0x530c6d[_0xdb30('0x2f')]=qs[_0xdb30('0x2f')](_0x2edca8['query'][_0xdb30('0x2f')]);_0x530c6d['offset']=qs[_0xdb30('0x2c')](_0x2edca8[_0xdb30('0x46')]['offset']);}_0x530c6d[_0xdb30('0x4d')]=qs[_0xdb30('0x4e')](_0x2edca8['query'][_0xdb30('0x4e')]);_0x530c6d['where']=qs[_0xdb30('0x47')](_['pick'](_0x2edca8[_0xdb30('0x46')],_0x5867fd[_0xdb30('0x47')]));_0x530c6d[_0xdb30('0x4f')]['SmsAccountId']=_0x407bb8['id'];if(_0x2edca8['query'][_0xdb30('0x51')]){_0x530c6d[_0xdb30('0x4f')]=_[_0xdb30('0x52')](_0x530c6d[_0xdb30('0x4f')],{'$or':_[_0xdb30('0x3e')](_0x530c6d[_0xdb30('0x4a')],function(_0x484d8e){var _0x2cdb1e={};_0x2cdb1e[_0x484d8e]={'$like':'%'+_0x2edca8[_0xdb30('0x46')]['filter']+'%'};return _0x2cdb1e;})});}_0x530c6d=_['merge']({},_0x530c6d,_0x2edca8[_0xdb30('0x59')]);return db[_0xdb30('0x9d')]['count']({'where':_0x530c6d[_0xdb30('0x4f')]})[_0xdb30('0x1d')](function(_0x4263ee){_0xa56564['count']=_0x4263ee;if(_0x2edca8['query']['includeAll']){_0x530c6d[_0xdb30('0x54')]=[{'model':db[_0xdb30('0x75')],'as':'Contact','required':![]},{'model':db[_0xdb30('0xa8')],'as':_0xdb30('0xbd'),'attributes':[_0xdb30('0x39'),_0xdb30('0xbe'),_0xdb30('0xbf')],'required':![]},{'model':db[_0xdb30('0xc0')],'as':_0xdb30('0xc1'),'attributes':['id',_0xdb30('0x39'),_0xdb30('0xc2')],'where':_0x2edca8[_0xdb30('0x46')][_0xdb30('0xc3')]?{'id':_0x2edca8['query']['tag']}:undefined,'required':_0x2edca8[_0xdb30('0x46')][_0xdb30('0xc3')]?!![]:![]}];}return db[_0xdb30('0x9d')]['findAll'](_0x530c6d);})[_0xdb30('0x1d')](function(_0x23ebe5){_0xa56564['rows']=_0x23ebe5;return _0xa56564;});}})[_0xdb30('0x1d')](respondWithFilteredResult(_0x4f7f17,_0x530c6d))[_0xdb30('0x28')](handleError(_0x4f7f17,null));};exports[_0xdb30('0x3a')]=function(_0x5b3cb4,_0x2822ca,_0x12d15d){var _0x2210f2,_0x2aa37c,_0x5c5174;if(_['isNil'](_0x5b3cb4[_0xdb30('0x5b')]['body'])||_0x5b3cb4[_0xdb30('0x5b')][_0xdb30('0x5b')]===''){throw new db[(_0xdb30('0x76'))][(_0xdb30('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdb30('0x92')](_0x5b3cb4[_0xdb30('0x5b')]['to'])){throw new db[(_0xdb30('0x76'))][(_0xdb30('0x77'))]('to\x20is\x20mandatory');}_0x2210f2=_0x5b3cb4[_0xdb30('0x5b')]['to'];return db['SmsAccount'][_0xdb30('0x61')]({'where':{'id':_0x5b3cb4[_0xdb30('0x62')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdb30('0x75')],'as':_0xdb30('0x99'),'where':{'mobile':_0x2210f2},'limit':0x1,'order':[[_0xdb30('0x7a'),_0xdb30('0x9a')]]}]}]})[_0xdb30('0x1d')](handleEntityNotFound(_0x2822ca,null))[_0xdb30('0x1d')](function(_0x3d898e){if(_0x3d898e&&_0x3d898e[_0xdb30('0xc4')]){_0x2aa37c=_0x3d898e['get']({'plain':!![]});if(_0x2aa37c[_0xdb30('0xc4')]&&_0x2aa37c[_0xdb30('0xc4')]['Contacts'][_0xdb30('0x58')]){return _0x2aa37c[_0xdb30('0xc4')][_0xdb30('0x99')][0x0];}return db[_0xdb30('0x75')]['create'](_[_0xdb30('0x18')](_0x5b3cb4[_0xdb30('0x5b')],{'firstName':_0x2210f2,'mobile':_0x2210f2,'phone':_0x2210f2,'ListId':_0x2aa37c[_0xdb30('0x7b')]}));}})['then'](handleEntityNotFound(_0x2822ca,null))[_0xdb30('0x1d')](function(_0x34a7b4){if(_0x34a7b4){_0x5c5174=_0x34a7b4;return db['SmsInteraction'][_0xdb30('0x61')]({'where':{'ContactId':_0x5c5174['id'],'closed':![],'SmsAccountId':_0x2aa37c['id']}})[_0xdb30('0x1d')](function(_0x32dcb6){if(_0x32dcb6){return[_0x32dcb6,![]];}return db[_0xdb30('0x9d')]['create']({'UserId':_0x5b3cb4[_0xdb30('0x5c')]['id'],'ContactId':_0x5c5174['id'],'SmsAccountId':_0x2aa37c['id'],'phone':_0x2210f2,'firstMsgDirection':_0xdb30('0xc5'),'Messages':[_[_0xdb30('0x52')](_0x5b3cb4[_0xdb30('0x5b')],{'read':![],'body':_0x5b3cb4[_0xdb30('0x5b')][_0xdb30('0x5b')],'phone':_0x2210f2,'SmsAccountId':_0x2aa37c['id'],'UserId':_0x5b3cb4['user']['id'],'ContactId':_0x5c5174['id']})]},{'include':[{'model':db[_0xdb30('0xa5')],'as':_0xdb30('0xc6')}]})[_0xdb30('0x1d')](function(_0x1e4f90){return[_0x1e4f90,!![]];});});}})[_0xdb30('0x9e')](function(_0x5f5486,_0x425ae9){if(_0x425ae9){return _0x5f5486;}return db[_0xdb30('0xa5')][_0xdb30('0x5a')](_[_0xdb30('0x52')](_0x5b3cb4[_0xdb30('0x5b')],{'read':![],'body':_0x5b3cb4[_0xdb30('0x5b')][_0xdb30('0x5b')],'phone':_0x2210f2,'SmsAccountId':_0x2aa37c['id'],'SmsInteractionId':_0x5f5486['id'],'UserId':_0x5b3cb4[_0xdb30('0x5c')]['id'],'ContactId':_0x5c5174['id']}))[_0xdb30('0x1d')](function(_0x39a68d){_0x5f5486[_0xdb30('0xc7')][_0xdb30('0xc6')]=[];_0x5f5486[_0xdb30('0xc7')][_0xdb30('0xc6')]['push'](_0x39a68d[_0xdb30('0xc7')]);return _0x5f5486;});})[_0xdb30('0x1d')](respondWithResult(_0x2822ca,null))[_0xdb30('0x28')](handleError(_0x2822ca,null));};exports[_0xdb30('0x2a')]=function(_0x583836,_0x3b73df,_0x598f70){if(_0x583836[_0xdb30('0x5b')]['id']){delete _0x583836[_0xdb30('0x5b')]['id'];}var _0x18c1ed,_0x148796,_0x2c89b1;return db['SmsAccount'][_0xdb30('0x61')]({'where':{'id':_0x583836['params']['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x3b73df,null))['then'](function(_0x1e921b){if(_0x1e921b){_0x2c89b1=_0x1e921b;logger[_0xdb30('0x21')](_0xdb30('0x22'),_0xdb30('0x2a'),_0xdb30('0xc8'),_0x1e921b[_0xdb30('0x42')],util[_0xdb30('0xc9')](_0x583836[_0xdb30('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1e921b[_0xdb30('0x42')]){case _0xdb30('0x80'):if(_0x583836[_0xdb30('0x5b')][_0xdb30('0xca')]&&_0x583836['body'][_0xdb30('0x2a')]){_0x148796=_0x583836[_0xdb30('0x5b')][_0xdb30('0x2a')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x583836[_0xdb30('0x5b')][_0xdb30('0xca')]}});}break;case _0xdb30('0x83'):if(_0x583836[_0xdb30('0x5b')][_0xdb30('0xcb')]&&_0x583836[_0xdb30('0x5b')][_0xdb30('0xcc')]){_0x148796=_0x583836[_0xdb30('0x5b')][_0xdb30('0xcc')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x583836[_0xdb30('0x5b')]['requestid']}});}break;case _0xdb30('0xcd'):if(_0x583836[_0xdb30('0x5b')][_0xdb30('0x84')]&&_0x583836[_0xdb30('0x5b')]['status_code']){_0x148796=_0x583836[_0xdb30('0x5b')][_0xdb30('0xce')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x583836[_0xdb30('0x5b')][_0xdb30('0x84')]}});}break;case _0xdb30('0xcf'):var _0x94944b=_0x583836[_0xdb30('0x5b')][_0xdb30('0x89')][0x0];if(_0x94944b[_0xdb30('0x7e')]&&_0x94944b[_0xdb30('0x2a')][_0xdb30('0xd0')]===_0xdb30('0xd1')){_0x148796=_0x94944b[_0xdb30('0x2a')][_0xdb30('0xd0')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x94944b[_0xdb30('0x7e')]}});}break;case _0xdb30('0xd2'):if(_0x583836['body'][_0xdb30('0x7e')]&&_0x583836['body']['status']){_0x148796=_0x583836[_0xdb30('0x5b')]['status'];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x583836[_0xdb30('0x5b')][_0xdb30('0x7e')]}});}break;case _0xdb30('0x90'):if(_0x583836[_0xdb30('0x5b')][0x0][_0xdb30('0x26')]['id']){_0x148796=_0x583836[_0xdb30('0x5b')][0x0][_0xdb30('0x42')];return db[_0xdb30('0xa5')]['find']({'where':{'messageId':_0x583836[_0xdb30('0x5b')][0x0][_0xdb30('0x26')]['id']}});}break;case _0xdb30('0x91'):if(_0x583836[_0xdb30('0x5b')]['redif']&&_0x583836['body'][_0xdb30('0x2a')]){_0x148796=_0x583836[_0xdb30('0x5b')][_0xdb30('0x2a')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x583836[_0xdb30('0x5b')][_0xdb30('0xd3')]}});}break;}}})[_0xdb30('0x1d')](handleEntityNotFound(_0x3b73df,null))['then'](function(_0x482158){if(_0x482158){_0x18c1ed=_0x482158;switch(_0x2c89b1['type']){case _0xdb30('0x80'):if(_0x148796===_0xdb30('0xd1')){return _0x18c1ed[_0xdb30('0x35')]({'read':!![]});}else{logger[_0xdb30('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdb30('0x2a'),_0xdb30('0x80'),util[_0xdb30('0xc9')](_0x583836[_0xdb30('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xdb30('0x83'):if(_0x148796==='1'){return _0x18c1ed['update']({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),'status',_0xdb30('0x80'),util[_0xdb30('0xc9')](_0x583836['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x583836[_0xdb30('0x5b')]['error_code']&&_0x148796>=0xc8&&_0x148796<=0xce){return _0x18c1ed[_0xdb30('0x35')]({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),_0xdb30('0x2a'),'clicksend',util[_0xdb30('0xc9')](_0x583836[_0xdb30('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xdb30('0xcf'):var _0x549935=_0x583836[_0xdb30('0x5b')][_0xdb30('0x89')][0x0];if(_0x549935[_0xdb30('0x2a')]['groupName']==='DELIVERED'){return _0x18c1ed[_0xdb30('0x35')]({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),_0xdb30('0x2a'),'infobip',util['inspect'](_0x583836['body'],{'showHidden':![],'depth':null}));}break;case _0xdb30('0xd2'):if(_0x148796==_0xdb30('0xd4')||_0x148796==_0xdb30('0xd5')){return _0x18c1ed[_0xdb30('0x35')]({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),_0xdb30('0x2a'),_0xdb30('0xd2'),util['inspect'](_0x583836[_0xdb30('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xdb30('0x90'):if(_0x148796==_0xdb30('0xd6')){return _0x18c1ed['update']({'read':!![]});}else{logger['error'](_0xdb30('0x22'),_0xdb30('0x2a'),_0xdb30('0x90'),util['inspect'](_0x583836['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x148796===_0xdb30('0xd7')||_0x148796===_0xdb30('0xd8')){return _0x18c1ed['update']({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),_0xdb30('0x2a'),_0xdb30('0x91'),util[_0xdb30('0xc9')](_0x583836[_0xdb30('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x18c1ed;}})[_0xdb30('0x1d')](respondWithResult(_0x3b73df,null))[_0xdb30('0x28')](handleError(_0x3b73df,null));};exports[_0xdb30('0xd9')]=function(_0x5f31f5,_0x3b4113,_0x4a613e){var _0x222eb0,_0x3274f5,_0x3eb78c;return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x5f31f5[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x3b4113,null))[_0xdb30('0x1d')](function(_0x4d6cc2){if(_0x4d6cc2){_0x3eb78c=_0x4d6cc2;logger[_0xdb30('0x21')](_0xdb30('0x22'),'status',_0xdb30('0xc8'),_0x4d6cc2[_0xdb30('0x42')],util[_0xdb30('0xc9')](_0x5f31f5[_0xdb30('0x46')],{'showHidden':![],'depth':null}));switch(_0x4d6cc2[_0xdb30('0x42')]){case'csc':if(_0x5f31f5[_0xdb30('0x46')][_0xdb30('0xda')]&&_0x5f31f5[_0xdb30('0x46')][_0xdb30('0xdb')]){_0x3274f5=_0x5f31f5['query'][_0xdb30('0xdb')];return db[_0xdb30('0xa5')][_0xdb30('0x61')]({'where':{'messageId':_0x5f31f5[_0xdb30('0x46')][_0xdb30('0xda')]}});}break;}}})[_0xdb30('0x1d')](handleEntityNotFound(_0x3b4113,null))[_0xdb30('0x1d')](function(_0x459795){if(_0x459795){_0x222eb0=_0x459795;switch(_0x3eb78c[_0xdb30('0x42')]){case _0xdb30('0x8b'):if(_0x3274f5==='2'||_0x3274f5==='6'){return _0x222eb0[_0xdb30('0x35')]({'read':!![]});}else{logger[_0xdb30('0x24')](_0xdb30('0x22'),_0xdb30('0x2a'),_0xdb30('0x8b'),util[_0xdb30('0xc9')](_0x5f31f5['query'],{'showHidden':![],'depth':null}));};break;}return _0x222eb0;}})[_0xdb30('0x1d')](respondWithResult(_0x3b4113,null))[_0xdb30('0x28')](handleError(_0x3b4113,null));};exports['addAgents']=function(_0x387cee,_0x543d4a,_0x11cdad){return db['SmsAccount']['find']({'where':{'id':_0x387cee[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x543d4a,null))['then'](function(_0x13e7c7){if(_0x13e7c7){return _0x13e7c7[_0xdb30('0xdc')](_0x387cee['body']['ids'],_[_0xdb30('0x9b')](_0x387cee[_0xdb30('0x5b')],[_0xdb30('0x69'),'id'])||{})['spread'](function(_0x5271d1){for(var _0x3c076f=0x0;_0x3c076f<_0x387cee[_0xdb30('0x5b')]['ids']['length'];_0x3c076f+=0x1){socket[_0xdb30('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x387cee['body']['ids'][_0x3c076f]),'SmsAccountId':Number(_0x387cee['params']['id'])});}return _0x5271d1;});}})[_0xdb30('0x1d')](respondWithResult(_0x543d4a,null))[_0xdb30('0x28')](handleError(_0x543d4a,null));};exports['removeAgents']=function(_0x3d5d7b,_0x26c80e,_0x4670e1){return db[_0xdb30('0x3f')][_0xdb30('0x61')]({'where':{'id':_0x3d5d7b[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x26c80e,null))[_0xdb30('0x1d')](function(_0x8112db){if(_0x8112db){return _0x8112db[_0xdb30('0xde')](_0x3d5d7b['query'][_0xdb30('0x69')])['then'](function(){if(_[_0xdb30('0xdf')](_0x3d5d7b[_0xdb30('0x46')][_0xdb30('0x69')])){for(var _0x4c73fb=0x0;_0x4c73fb<_0x3d5d7b['query']['ids'][_0xdb30('0x58')];_0x4c73fb+=0x1){socket[_0xdb30('0xdd')](_0xdb30('0xe0'),{'UserId':Number(_0x3d5d7b[_0xdb30('0x46')][_0xdb30('0x69')][_0x4c73fb]),'SmsAccountId':Number(_0x3d5d7b[_0xdb30('0x62')]['id'])});}}else{socket['emit'](_0xdb30('0xe0'),{'UserId':Number(_0x3d5d7b['query'][_0xdb30('0x69')]),'SmsAccountId':Number(_0x3d5d7b['params']['id'])});}});}})[_0xdb30('0x1d')](respondWithStatusCode(_0x26c80e,null))[_0xdb30('0x28')](handleError(_0x26c80e,null));};exports[_0xdb30('0xe1')]=function(_0x8e5ccf,_0x12b53c,_0x1146ef){var _0x1783d2={};var _0x56d7fa={};var _0x125f3f;var _0x1ef77a;return db[_0xdb30('0x3f')][_0xdb30('0x66')]({'where':{'id':_0x8e5ccf[_0xdb30('0x62')]['id']}})[_0xdb30('0x1d')](handleEntityNotFound(_0x12b53c,null))[_0xdb30('0x1d')](function(_0x4a2d20){if(_0x4a2d20){_0x125f3f=_0x4a2d20;_0x56d7fa[_0xdb30('0x44')]=_[_0xdb30('0x45')](db[_0xdb30('0xa8')][_0xdb30('0x40')]);_0x56d7fa[_0xdb30('0x46')]=_[_0xdb30('0x45')](_0x8e5ccf[_0xdb30('0x46')]);_0x56d7fa[_0xdb30('0x47')]=_[_0xdb30('0x48')](_0x56d7fa[_0xdb30('0x44')],_0x56d7fa['query']);_0x1783d2['attributes']=_['intersection'](_0x56d7fa[_0xdb30('0x44')],qs[_0xdb30('0x49')](_0x8e5ccf[_0xdb30('0x46')][_0xdb30('0x49')]));_0x1783d2[_0xdb30('0x4a')]=_0x1783d2['attributes'][_0xdb30('0x58')]?_0x1783d2[_0xdb30('0x4a')]:_0x56d7fa['model'];_0x1783d2[_0xdb30('0x4d')]=qs['sort'](_0x8e5ccf[_0xdb30('0x46')][_0xdb30('0x4e')]);_0x1783d2[_0xdb30('0x4f')]=qs['filters'](_[_0xdb30('0x50')](_0x8e5ccf[_0xdb30('0x46')],_0x56d7fa[_0xdb30('0x47')]));if(_0x8e5ccf[_0xdb30('0x46')][_0xdb30('0x51')]){_0x1783d2[_0xdb30('0x4f')]=_[_0xdb30('0x52')](_0x1783d2[_0xdb30('0x4f')],{'$or':_['map'](_0x1783d2[_0xdb30('0x4a')],function(_0x20f5f2){var _0x225d56={};_0x225d56[_0x20f5f2]={'$like':'%'+_0x8e5ccf['query'][_0xdb30('0x51')]+'%'};return _0x225d56;})});}_0x1783d2=_[_0xdb30('0x52')]({},_0x1783d2,_0x8e5ccf[_0xdb30('0x59')]);return _0x125f3f['getAgents'](_0x1783d2);}})[_0xdb30('0x1d')](function(_0x529314){if(_0x529314){_0x1ef77a=_0x529314[_0xdb30('0x58')];if(!_0x8e5ccf[_0xdb30('0x46')][_0xdb30('0x4b')](_0xdb30('0x4c'))){_0x1783d2[_0xdb30('0x2f')]=qs[_0xdb30('0x2f')](_0x8e5ccf['query'][_0xdb30('0x2f')]);_0x1783d2[_0xdb30('0x2c')]=qs[_0xdb30('0x2c')](_0x8e5ccf[_0xdb30('0x46')][_0xdb30('0x2c')]);}return _0x125f3f[_0xdb30('0xe1')](_0x1783d2);}})[_0xdb30('0x1d')](function(_0x5e009a){if(_0x5e009a){return _0x5e009a?{'count':_0x1ef77a,'rows':_0x5e009a}:null;}})[_0xdb30('0x1d')](respondWithResult(_0x12b53c,null))[_0xdb30('0x28')](handleError(_0x12b53c,null));}; \ No newline at end of file +var _0xc31a=['Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','include','removeDispositions','addAnswer','getAnswers','CannedAnswer','length','rows','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','type','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','Content-Type','text/xml','send','\x0a','json','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xc31a,0x1f4));var _0xac31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc31a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac31('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac31('0x1'));var rp=require(_0xac31('0x2'));var moment=require(_0xac31('0x3'));var BPromise=require(_0xac31('0x4'));var Mustache=require(_0xac31('0x5'));var util=require(_0xac31('0x6'));var path=require(_0xac31('0x7'));var sox=require(_0xac31('0x8'));var csv=require(_0xac31('0x9'));var ejs=require(_0xac31('0xa'));var fs=require('fs');var fs_extra=require(_0xac31('0xb'));var _=require(_0xac31('0xc'));var squel=require(_0xac31('0xd'));var crypto=require(_0xac31('0xe'));var jsforce=require(_0xac31('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xac31('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac31('0x10'));var qs=require(_0xac31('0x11'));var as=require(_0xac31('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac31('0x13'))(_0xac31('0x14'));var utils=require(_0xac31('0x15'));var config=require(_0xac31('0x16'));var licenseUtil=require(_0xac31('0x17'));var db=require(_0xac31('0x18'))['db'];config[_0xac31('0x19')]=_[_0xac31('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xac31('0x1b'))(new Redis(config[_0xac31('0x19')]));require(_0xac31('0x1c'))[_0xac31('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x23402c,_0x13151e,_0x19f8d6,_0x2095bd){return new BPromise(function(_0xfdc95d,_0x4b3a3b){var _0x576c98=_0x2095bd||client;return _0x576c98['request'](_0x23402c,_0x19f8d6)[_0xac31('0x1e')](function(_0x379ac4){logger[_0xac31('0x1f')](_0xac31('0x20'),_0x13151e,_0xac31('0x21'));logger[_0xac31('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x13151e,_0xac31('0x21'),JSON['stringify'](_0x379ac4));if(_0x379ac4[_0xac31('0x23')]){if(_0x379ac4['error'][_0xac31('0x24')]===0x1f4){logger[_0xac31('0x23')](_0xac31('0x20'),_0x13151e,_0x379ac4['error'][_0xac31('0x25')]);return _0x4b3a3b(_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);}logger['error'](_0xac31('0x20'),_0x13151e,_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);return _0xfdc95d(_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);}else{logger[_0xac31('0x1f')](_0xac31('0x20'),_0x13151e,'request\x20sent');_0xfdc95d(_0x379ac4[_0xac31('0x26')]['message']);}})[_0xac31('0x27')](function(_0x305eec){logger[_0xac31('0x23')]('SmsAccount,\x20%s,\x20%s',_0x13151e,_0x305eec);_0x4b3a3b(_0x305eec);});});}function respondWithStatusCode(_0x10babc,_0x450f68){_0x450f68=_0x450f68||0xcc;return function(_0x3bf9d4){if(_0x3bf9d4){return _0x10babc[_0xac31('0x28')](_0x450f68);}return _0x10babc[_0xac31('0x29')](_0x450f68)['end']();};}function respondWithResult(_0x5e39ef,_0x44858e){_0x44858e=_0x44858e||0xc8;return function(_0x3a6038){if(_0x3a6038){return _0x5e39ef[_0xac31('0x29')](_0x44858e)['json'](_0x3a6038);}};}function respondWithFilteredResult(_0x3f2280,_0x3f2285){return function(_0x5af057){if(_0x5af057){var _0x4eea6f=typeof _0x3f2285[_0xac31('0x2a')]==='undefined'&&typeof _0x3f2285[_0xac31('0x2b')]===_0xac31('0x2c');var _0x15e8e9=_0x5af057[_0xac31('0x2d')];var _0x5e6e76=_0x4eea6f?0x0:_0x3f2285[_0xac31('0x2a')];var _0x1dbda9=_0x4eea6f?_0x5af057[_0xac31('0x2d')]:_0x3f2285[_0xac31('0x2a')]+_0x3f2285['limit'];var _0x2d28e7;if(_0x1dbda9>=_0x15e8e9){_0x1dbda9=_0x15e8e9;_0x2d28e7=0xc8;}else{_0x2d28e7=0xce;}_0x3f2280[_0xac31('0x29')](_0x2d28e7);return _0x3f2280[_0xac31('0x2e')](_0xac31('0x2f'),_0x5e6e76+'-'+_0x1dbda9+'/'+_0x15e8e9)['json'](_0x5af057);}return null;};}function patchUpdates(_0x499148){return function(_0x18c752){try{jsonpatch['apply'](_0x18c752,_0x499148,!![]);}catch(_0x574884){return BPromise[_0xac31('0x30')](_0x574884);}return _0x18c752[_0xac31('0x31')]();};}function saveUpdates(_0x29290e,_0x3cfe5f){return function(_0x3f4117){if(_0x3f4117){return _0x3f4117[_0xac31('0x32')](_0x29290e)[_0xac31('0x1e')](function(_0x213958){return _0x213958;});}return null;};}function removeEntity(_0x9542e0,_0x33c600){return function(_0x482a0f){if(_0x482a0f){return _0x482a0f['destroy']()['then'](function(){var _0x4f53f4=_0x482a0f[_0xac31('0x33')]({'plain':!![]});var _0x3a8ee4=_0xac31('0x34');return db[_0xac31('0x35')][_0xac31('0x36')]({'where':{'type':_0x3a8ee4,'resourceId':_0x4f53f4['id']}})[_0xac31('0x1e')](function(){return _0x482a0f;});})['then'](function(){_0x9542e0[_0xac31('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a076a,_0x2dfb5a){return function(_0x3ecf8f){if(!_0x3ecf8f){_0x3a076a[_0xac31('0x28')](0x194);}return _0x3ecf8f;};}function handleError(_0x2437b6,_0x6e3185){_0x6e3185=_0x6e3185||0x1f4;return function(_0x525f72){logger[_0xac31('0x23')](_0x525f72['stack']);if(_0x525f72[_0xac31('0x37')]){delete _0x525f72['name'];}_0x2437b6[_0xac31('0x29')](_0x6e3185)['send'](_0x525f72);};}exports[_0xac31('0x38')]=function(_0x2d83c4,_0x16f4ca){var _0x28c277={'include':[{'model':db[_0xac31('0x39')],'as':'mandatoryDispositionPause'}]},_0x7cc165={},_0x59e7c6={'count':0x0,'rows':[]};var _0xba918e=_[_0xac31('0x3a')](db[_0xac31('0x3b')][_0xac31('0x3c')],function(_0x144368){return{'name':_0x144368[_0xac31('0x3d')],'type':_0x144368['type'][_0xac31('0x3e')]};});_0x7cc165[_0xac31('0x3f')]=_[_0xac31('0x3a')](_0xba918e,_0xac31('0x37'));_0x7cc165[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2d83c4[_0xac31('0x40')]);_0x7cc165['filters']=_[_0xac31('0x42')](_0x7cc165[_0xac31('0x3f')],_0x7cc165[_0xac31('0x40')]);_0x28c277[_0xac31('0x43')]=_[_0xac31('0x42')](_0x7cc165[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x2d83c4[_0xac31('0x40')][_0xac31('0x44')]));_0x28c277['attributes']=_0x28c277['attributes']['length']?_0x28c277['attributes']:_0x7cc165[_0xac31('0x3f')];if(!_0x2d83c4[_0xac31('0x40')][_0xac31('0x45')]('nolimit')){_0x28c277[_0xac31('0x2b')]=qs['limit'](_0x2d83c4[_0xac31('0x40')]['limit']);_0x28c277[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2d83c4[_0xac31('0x40')]['offset']);}_0x28c277[_0xac31('0x46')]=qs['sort'](_0x2d83c4[_0xac31('0x40')][_0xac31('0x47')]);_0x28c277['where']=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x2d83c4[_0xac31('0x40')],_0x7cc165['filters']),_0xba918e);if(_0x2d83c4[_0xac31('0x40')][_0xac31('0x4a')]){_0x28c277['where']=_[_0xac31('0x4b')](_0x28c277[_0xac31('0x4c')],{'$or':_['map'](_0xba918e,function(_0x58d79d){if(_0x58d79d['type']!==_0xac31('0x4d')){var _0x31a908={};_0x31a908[_0x58d79d['name']]={'$like':'%'+_0x2d83c4[_0xac31('0x40')]['filter']+'%'};return _0x31a908;}})});}_0x28c277=_[_0xac31('0x4b')]({},_0x28c277,_0x2d83c4[_0xac31('0x4e')]);var _0x4b4dd0={'where':_0x28c277[_0xac31('0x4c')]};return db[_0xac31('0x3b')][_0xac31('0x2d')](_0x4b4dd0)[_0xac31('0x1e')](function(_0x2e546b){_0x59e7c6[_0xac31('0x2d')]=_0x2e546b;if(_0x2d83c4[_0xac31('0x40')][_0xac31('0x4f')]){_0x28c277['include']=[{'all':!![]}];}return db['SmsAccount'][_0xac31('0x50')](_0x28c277);})[_0xac31('0x1e')](function(_0x1491a0){_0x59e7c6['rows']=_0x1491a0;return _0x59e7c6;})[_0xac31('0x1e')](respondWithFilteredResult(_0x16f4ca,_0x28c277))[_0xac31('0x27')](handleError(_0x16f4ca,null));};exports['show']=function(_0x4eafac,_0x54aa69){var _0x199751={'raw':![],'where':{'id':_0x4eafac[_0xac31('0x51')]['id']},'include':[{'model':db[_0xac31('0x39')],'as':'mandatoryDispositionPause'}]},_0xb7f457={};_0xb7f457['model']=_[_0xac31('0x41')](db[_0xac31('0x3b')][_0xac31('0x3c')]);_0xb7f457[_0xac31('0x40')]=_[_0xac31('0x41')](_0x4eafac['query']);_0xb7f457[_0xac31('0x48')]=_['intersection'](_0xb7f457[_0xac31('0x3f')],_0xb7f457[_0xac31('0x40')]);_0x199751['attributes']=_[_0xac31('0x42')](_0xb7f457['model'],qs[_0xac31('0x44')](_0x4eafac[_0xac31('0x40')][_0xac31('0x44')]));_0x199751[_0xac31('0x43')]=_0x199751[_0xac31('0x43')]['length']?_0x199751[_0xac31('0x43')]:_0xb7f457[_0xac31('0x3f')];if(_0x4eafac[_0xac31('0x40')][_0xac31('0x4f')]){_0x199751['include']=[{'all':!![]}];}_0x199751=_[_0xac31('0x4b')]({},_0x199751,_0x4eafac['options']);return db[_0xac31('0x3b')]['find'](_0x199751)[_0xac31('0x1e')](handleEntityNotFound(_0x54aa69,null))[_0xac31('0x1e')](respondWithResult(_0x54aa69,null))[_0xac31('0x27')](handleError(_0x54aa69,null));};exports['create']=function(_0x2b89da,_0x5a2558){return db['SmsAccount'][_0xac31('0x52')](_0x2b89da[_0xac31('0x53')],{})[_0xac31('0x1e')](function(_0xa382cc){var _0x5052e5=_0x2b89da[_0xac31('0x54')][_0xac31('0x33')]({'plain':!![]});if(!_0x5052e5)throw new Error(_0xac31('0x55'));if(_0x5052e5[_0xac31('0x56')]==='user'){var _0x2b53fd=_0xa382cc[_0xac31('0x33')]({'plain':!![]});var _0x5a14f2=_0xac31('0x34');return db[_0xac31('0x57')][_0xac31('0x58')]({'where':{'name':_0x5a14f2,'userProfileId':_0x5052e5[_0xac31('0x59')]},'raw':!![]})['then'](function(_0xa5028){if(_0xa5028&&_0xa5028['autoAssociation']===0x0){return db[_0xac31('0x35')][_0xac31('0x52')]({'name':_0x2b53fd[_0xac31('0x37')],'resourceId':_0x2b53fd['id'],'type':_0xa5028[_0xac31('0x37')],'sectionId':_0xa5028['id']},{})['then'](function(){return _0xa382cc;});}else{return _0xa382cc;}})[_0xac31('0x27')](function(_0xa4f960){logger[_0xac31('0x23')](_0xac31('0x5a'),_0xa4f960);throw _0xa4f960;});}return _0xa382cc;})[_0xac31('0x1e')](respondWithResult(_0x5a2558,0xc9))[_0xac31('0x27')](handleError(_0x5a2558,null));};exports[_0xac31('0x32')]=function(_0x360401,_0x3c3c55){if(_0x360401[_0xac31('0x53')]['id']){delete _0x360401[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')]['find']({'where':{'id':_0x360401[_0xac31('0x51')]['id']},'include':[{'model':db[_0xac31('0x39')],'as':_0xac31('0x5b')}]})['then'](handleEntityNotFound(_0x3c3c55,null))['then'](saveUpdates(_0x360401[_0xac31('0x53')],null))[_0xac31('0x1e')](respondWithResult(_0x3c3c55,null))[_0xac31('0x27')](handleError(_0x3c3c55,null));};exports[_0xac31('0x36')]=function(_0x5c3085,_0xd1c321){return db['SmsAccount'][_0xac31('0x58')]({'where':{'id':_0x5c3085[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0xd1c321,null))[_0xac31('0x1e')](removeEntity(_0xd1c321,null))[_0xac31('0x27')](handleError(_0xd1c321,null));};exports[_0xac31('0x5c')]=function(_0x3c0bab,_0x46e447){return db[_0xac31('0x3b')][_0xac31('0x5c')]()[_0xac31('0x1e')](respondWithResult(_0x46e447,null))[_0xac31('0x27')](handleError(_0x46e447,null));};exports[_0xac31('0x5d')]=function(_0x319594,_0x59b7c6,_0x5af3b4){if(_0x319594[_0xac31('0x53')]['id']){delete _0x319594[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x319594[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x59b7c6,null))[_0xac31('0x1e')](function(_0x39af1f){if(_0x39af1f){_0x319594[_0xac31('0x53')][_0xac31('0x5e')]=_0x39af1f['id'];return db[_0xac31('0x5f')][_0xac31('0x52')](_0x319594[_0xac31('0x53')]);}})[_0xac31('0x1e')](respondWithResult(_0x59b7c6,null))['catch'](handleError(_0x59b7c6,null));};exports[_0xac31('0x60')]=function(_0x2642c2,_0x588f79,_0x1560de){var _0x28c9ba={'raw':![],'where':{}};var _0x3799bc={};var _0x2a44f3={'count':0x0,'rows':[]};return db['SmsAccount'][_0xac31('0x61')]({'where':{'id':_0x2642c2['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x588f79,null))[_0xac31('0x1e')](function(_0x3e6d4b){if(_0x3e6d4b){_0x3799bc['model']=_[_0xac31('0x41')](db[_0xac31('0x5f')][_0xac31('0x3c')]);_0x3799bc[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2642c2[_0xac31('0x40')]);_0x3799bc[_0xac31('0x48')]=_[_0xac31('0x42')](_0x3799bc['model'],_0x3799bc[_0xac31('0x40')]);_0x28c9ba[_0xac31('0x43')]=_[_0xac31('0x42')](_0x3799bc[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x2642c2[_0xac31('0x40')][_0xac31('0x44')]));_0x28c9ba[_0xac31('0x43')]=_0x28c9ba[_0xac31('0x43')]['length']?_0x28c9ba[_0xac31('0x43')]:_0x3799bc[_0xac31('0x3f')];if(!_0x2642c2[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x28c9ba[_0xac31('0x2b')]=qs['limit'](_0x2642c2[_0xac31('0x40')][_0xac31('0x2b')]);_0x28c9ba[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2642c2[_0xac31('0x40')][_0xac31('0x2a')]);}_0x28c9ba[_0xac31('0x46')]=qs[_0xac31('0x47')](_0x2642c2['query'][_0xac31('0x47')]);_0x28c9ba['where']=qs[_0xac31('0x48')](_['pick'](_0x2642c2['query'],_0x3799bc[_0xac31('0x48')]));_0x28c9ba[_0xac31('0x4c')][_0xac31('0x5e')]=_0x3e6d4b['id'];if(_0x2642c2[_0xac31('0x40')][_0xac31('0x4a')]){_0x28c9ba['where']=_[_0xac31('0x4b')](_0x28c9ba[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x28c9ba[_0xac31('0x43')],function(_0x133fdb){var _0x3a82c9={};_0x3a82c9[_0x133fdb]={'$like':'%'+_0x2642c2[_0xac31('0x40')]['filter']+'%'};return _0x3a82c9;})});}_0x28c9ba=_[_0xac31('0x4b')]({},_0x28c9ba,_0x2642c2['options']);return db[_0xac31('0x5f')]['count']({'where':_0x28c9ba[_0xac31('0x4c')]})[_0xac31('0x1e')](function(_0x2b9eba){_0x2a44f3[_0xac31('0x2d')]=_0x2b9eba;if(_0x2642c2[_0xac31('0x40')][_0xac31('0x4f')]){_0x28c9ba[_0xac31('0x63')]=[{'all':!![]}];}return db[_0xac31('0x5f')]['findAll'](_0x28c9ba);})[_0xac31('0x1e')](function(_0x797e8a){_0x2a44f3['rows']=_0x797e8a;return _0x2a44f3;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x588f79,_0x28c9ba))['catch'](handleError(_0x588f79,null));};exports['removeDispositions']=function(_0x12a93d,_0x2d5d51,_0x516fac){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x12a93d[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x2d5d51,null))['then'](function(_0xa11d12){if(_0xa11d12){return _0xa11d12[_0xac31('0x64')](_0x12a93d['query']['ids']);}})['then'](respondWithStatusCode(_0x2d5d51,null))[_0xac31('0x27')](handleError(_0x2d5d51,null));};exports[_0xac31('0x65')]=function(_0x5d6bb4,_0x4eb660,_0x1e287b){if(_0x5d6bb4[_0xac31('0x53')]['id']){delete _0x5d6bb4[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x5d6bb4['params']['id']}})['then'](handleEntityNotFound(_0x4eb660,null))[_0xac31('0x1e')](function(_0x3ca153){if(_0x3ca153){_0x5d6bb4[_0xac31('0x53')][_0xac31('0x5e')]=_0x3ca153['id'];return db['CannedAnswer']['create'](_0x5d6bb4['body']);}})[_0xac31('0x1e')](respondWithResult(_0x4eb660,null))[_0xac31('0x27')](handleError(_0x4eb660,null));};exports[_0xac31('0x66')]=function(_0x2e61e0,_0x32e4ef,_0x3964b8){var _0x2fe48c={'raw':![],'where':{}};var _0x357f9d={};var _0x28354c={'count':0x0,'rows':[]};return db['SmsAccount'][_0xac31('0x61')]({'where':{'id':_0x2e61e0[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x32e4ef,null))[_0xac31('0x1e')](function(_0x311519){if(_0x311519){_0x357f9d[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0x67')][_0xac31('0x3c')]);_0x357f9d[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2e61e0[_0xac31('0x40')]);_0x357f9d[_0xac31('0x48')]=_[_0xac31('0x42')](_0x357f9d[_0xac31('0x3f')],_0x357f9d[_0xac31('0x40')]);_0x2fe48c[_0xac31('0x43')]=_['intersection'](_0x357f9d[_0xac31('0x3f')],qs['fields'](_0x2e61e0[_0xac31('0x40')][_0xac31('0x44')]));_0x2fe48c[_0xac31('0x43')]=_0x2fe48c['attributes'][_0xac31('0x68')]?_0x2fe48c[_0xac31('0x43')]:_0x357f9d[_0xac31('0x3f')];if(!_0x2e61e0[_0xac31('0x40')][_0xac31('0x45')]('nolimit')){_0x2fe48c[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x2e61e0[_0xac31('0x40')]['limit']);_0x2fe48c[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2e61e0[_0xac31('0x40')][_0xac31('0x2a')]);}_0x2fe48c[_0xac31('0x46')]=qs['sort'](_0x2e61e0[_0xac31('0x40')][_0xac31('0x47')]);_0x2fe48c[_0xac31('0x4c')]=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x2e61e0[_0xac31('0x40')],_0x357f9d['filters']));_0x2fe48c[_0xac31('0x4c')][_0xac31('0x5e')]=_0x311519['id'];if(_0x2e61e0[_0xac31('0x40')][_0xac31('0x4a')]){_0x2fe48c['where']=_['merge'](_0x2fe48c[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x2fe48c[_0xac31('0x43')],function(_0x16393a){var _0x1d5d44={};_0x1d5d44[_0x16393a]={'$like':'%'+_0x2e61e0[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0x1d5d44;})});}_0x2fe48c=_[_0xac31('0x4b')]({},_0x2fe48c,_0x2e61e0[_0xac31('0x4e')]);return db[_0xac31('0x67')][_0xac31('0x2d')]({'where':_0x2fe48c['where']})['then'](function(_0x1b6906){_0x28354c[_0xac31('0x2d')]=_0x1b6906;if(_0x2e61e0[_0xac31('0x40')][_0xac31('0x4f')]){_0x2fe48c[_0xac31('0x63')]=[{'all':!![]}];}return db[_0xac31('0x67')][_0xac31('0x50')](_0x2fe48c);})[_0xac31('0x1e')](function(_0x223e75){_0x28354c[_0xac31('0x69')]=_0x223e75;return _0x28354c;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x32e4ef,_0x2fe48c))[_0xac31('0x27')](handleError(_0x32e4ef,null));};exports[_0xac31('0x6a')]=function(_0x40918f,_0x478e4a,_0x1f1d32){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x40918f[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x478e4a,null))['then'](function(_0x3cf107){if(_0x3cf107){return _0x3cf107['removeAnswers'](_0x40918f['query']['ids']);}})[_0xac31('0x1e')](respondWithStatusCode(_0x478e4a,null))[_0xac31('0x27')](handleError(_0x478e4a,null));};exports[_0xac31('0x6b')]=function(_0x2ac620,_0x4c504a,_0x41c9ad){var _0x3642aa={'channel':_0xac31('0x6c')};var _0x5ed5cc=[];var _0x3dacab=[];var _0x2027cc={};return db[_0xac31('0x3b')]['find']({'where':{'id':_0x2ac620['params']['id']},'include':[{'model':db[_0xac31('0x6d')],'as':_0xac31('0x6e')}]})[_0xac31('0x1e')](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x3dd2bd){_0x3642aa[_0xac31('0x6f')]=_0x3dd2bd;_0x3642aa[_0xac31('0x70')]=_[_0xac31('0x71')](_0x3dd2bd[_0xac31('0x6e')],['priority'],[_0xac31('0x72')]);if(_0x3642aa[_0xac31('0x6f')][_0xac31('0x6e')]){delete _0x3642aa[_0xac31('0x6f')][_0xac31('0x6e')];}return db[_0xac31('0x73')][_0xac31('0x5c')]();})[_0xac31('0x1e')](function(_0x592a15){if(!_0x592a15){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x76'));}_0x5ed5cc=_[_0xac31('0x77')](_['keys'](_0x592a15),['createdAt',_0xac31('0x78')]);_0x3dacab=_['difference'](_[_0xac31('0x41')](_0x592a15),[_0xac31('0x79'),_0xac31('0x78'),'CompanyId',_0xac31('0x7a')]);_0x3642aa[_0xac31('0x53')]={'mapKey':_0xac31('0x7b')};if(_0x3642aa[_0xac31('0x6f')][_0xac31('0x7c')]){switch(_0x3642aa[_0xac31('0x6f')][_0xac31('0x7c')]){case'twilio':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7e')];_0x3642aa['body'][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7f')];_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x81')];break;case _0xac31('0x82'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]='+'+_0x2ac620[_0xac31('0x53')][_0xac31('0x83')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x84')];break;case _0xac31('0x85'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7d')];_0x3642aa['body']['body']=_0x2ac620[_0xac31('0x53')][_0xac31('0x25')];break;case _0xac31('0x86'):_0x3642aa[_0xac31('0x53')]['from']=_0x2ac620['body']['from'];_0x3642aa[_0xac31('0x53')]['body']=_0x2ac620['body']['body'];_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620['body'][_0xac31('0x87')];break;case _0xac31('0x88'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7e')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x89')];_0x3642aa['body'][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x8a')];break;case _0xac31('0x8b'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]='+'+_0x2ac620[_0xac31('0x53')][_0xac31('0x8c')][0x0][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')]['body']=_0x2ac620['body'][_0xac31('0x8c')][0x0][_0xac31('0x84')];_0x3642aa[_0xac31('0x53')]['messageId']=_0x2ac620[_0xac31('0x53')][_0xac31('0x8c')][0x0][_0xac31('0x80')];break;case _0xac31('0x8d'):_0x3642aa['body'][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x8e')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620['body']['segmentedMessage'][_0xac31('0x25')];break;case _0xac31('0x8f'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x90')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')]['text'];_0x3642aa['body']['messageId']=_0x2ac620[_0xac31('0x53')][_0xac31('0x91')];break;case _0xac31('0x92'):_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][0x0][_0xac31('0x25')]['id'];_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][0x0]['message'][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620['body'][0x0][_0xac31('0x25')]['text'];break;case _0xac31('0x93'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620['body'][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x25')];_0x3642aa['body'][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')]['refid'];break;}}if(_0x3642aa[_0xac31('0x53')]['id']){delete _0x3642aa[_0xac31('0x53')]['id'];}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')]['from'])){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x95'));}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')]['body'])||_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]===''){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x96'));}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')][_0xac31('0x97')])){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x98')+_0x3dacab);}if(!_[_0xac31('0x99')](_0x3dacab,_0x3642aa['body'][_0xac31('0x97')])){throw new db['Sequelize'][(_0xac31('0x75'))](_0xac31('0x9a')+_0x3dacab);}_0x2027cc[_0x3642aa['body'][_0xac31('0x97')]]=_0x3642aa['body'][_0xac31('0x7d')];return db[_0xac31('0x9b')][_0xac31('0x58')]({'where':{'id':_0x3642aa[_0xac31('0x6f')][_0xac31('0x7a')]},'include':[{'model':db[_0xac31('0x73')],'as':_0xac31('0x9c'),'where':_0x2027cc,'limit':0x1,'order':[[_0xac31('0x78'),_0xac31('0x9d')]]}]});})[_0xac31('0x1e')](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x510d51){if(_0x510d51){_0x3642aa[_0xac31('0x9e')]=_[_0xac31('0x9f')](_0x510d51,[_0xac31('0x9c')]);if(_0x510d51[_0xac31('0x9c')][_0xac31('0x68')]){return _0x510d51[_0xac31('0x9c')][0x0];}var _0xbd5034=_['defaults'](_0x3642aa[_0xac31('0x53')],{'firstName':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')],'ListId':_0x510d51['id']});_0xbd5034[_0x3642aa[_0xac31('0x53')][_0xac31('0x97')]]=_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')];return db['CmContact']['create'](_0xbd5034,{'fields':_0x5ed5cc,'raw':!![]});}})['then'](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x4bd685){if(_0x4bd685){_0x3642aa[_0xac31('0xa0')]=_0x4bd685;var _0x4c4260={'ContactId':_0x4bd685['id'],'phone':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id']};var _0x592d09={'ContactId':_0x4bd685['id'],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id'],'closed':![]};return db[_0xac31('0xa1')][_0xac31('0x58')]({'where':_0x592d09})[_0xac31('0x1e')](function(_0x501ef6){if(_0x501ef6){return[_0x501ef6,![]];}return db[_0xac31('0xa1')][_0xac31('0x52')](_0x4c4260)[_0xac31('0x1e')](function(_0x3710a6){return[_0x3710a6,!![]];});});}})[_0xac31('0xa2')](function(_0x2354d6,_0x2512f7){_0x3642aa[_0xac31('0xa3')]=_0x2354d6[_0xac31('0x33')]({'plain':!![]});_0x3642aa[_0xac31('0xa3')][_0xac31('0xa4')]=![];if(_0x2512f7){if(_0x3642aa[_0xac31('0x6f')][_0xac31('0xa5')]){_0x3642aa['applications']['push']({'id':0x0,'priority':_0x3642aa[_0xac31('0x70')][_0xac31('0x68')]+0x1,'app':_0xac31('0xa6'),'appdata':_0xac31('0xa7'),'interval':_0xac31('0xa8')});}_0x3642aa['interaction'][_0xac31('0xa4')]=!![];}return db[_0xac31('0xa9')][_0xac31('0x52')]({'phone':_0x3642aa['body'][_0xac31('0x7d')],'messageId':_0x3642aa[_0xac31('0x53')][_0xac31('0x80')],'body':_0x3642aa['body'][_0xac31('0x53')],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id'],'SmsInteractionId':_0x2354d6['id'],'direction':'in','ContactId':_0x2354d6[_0xac31('0xaa')],'AttachmentId':_0x3642aa[_0xac31('0x53')][_0xac31('0xab')]});})['then'](function(_0x3d94ae){_0x3642aa[_0xac31('0x25')]=_0x3d94ae;if(_0x3642aa[_0xac31('0xa3')][_0xac31('0xac')]){return db[_0xac31('0xad')]['find']({'attributes':['id','name'],'where':{'id':_0x3642aa[_0xac31('0xa3')]['UserId']}})[_0xac31('0x1e')](function(_0x219f40){if(_0x219f40){_0x3642aa[_0xac31('0x70')][_0xac31('0xae')]({'id':0x0,'priority':0x0,'app':_0xac31('0xaf'),'appdata':_0x219f40[_0xac31('0x37')]+','+(_0x3642aa['account']['waitForTheAssignedAgent']||0xa),'interval':_0xac31('0xa8')});}return respondWithRpcPromise(_0xac31('0xb0'),_0xac31('0xb1'),_0x3642aa);});}return respondWithRpcPromise(_0xac31('0xb0'),_0xac31('0xb1'),_0x3642aa);})[_0xac31('0x1e')](function(_0x47111d){if(_0x47111d){var _0x465576=0xc8;var _0x306a65=_0xac31('0xb2');logger['info'](_0xac31('0xb3'),_0x306a65,_0x465576,'entity\x20found');logger[_0xac31('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x306a65,_0x465576,_0xac31('0xb4'),JSON[_0xac31('0xb5')](_0x47111d));if(_0x3642aa[_0xac31('0x6f')]['type']===_0xac31('0xb6')){return _0x4c504a[_0xac31('0x29')](_0x465576)[_0xac31('0x2e')](_0xac31('0xb7'),_0xac31('0xb8'))[_0xac31('0xb9')](_0xac31('0xba'));}else{return _0x4c504a['status'](_0x465576)[_0xac31('0xbb')](_0x47111d);}}})[_0xac31('0x27')](handleError(_0x4c504a,null));};exports[_0xac31('0xbc')]=function(_0x140115,_0x136442,_0x123ea9){return db[_0xac31('0x3b')]['findOne']({'where':{'id':_0x140115['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x136442,null))[_0xac31('0x1e')](function(_0x49b543){if(_0x49b543){return db[_0xac31('0xbd')][_0xac31('0xbe')](function(_0x2c985b){return db[_0xac31('0x6d')][_0xac31('0x36')]({'where':{'SmsAccountId':_0x140115['params']['id']},'transaction':_0x2c985b})[_0xac31('0x1e')](function(_0x559066){var _0x1505a8=_[_0xac31('0x3a')](_0x140115[_0xac31('0x53')],function(_0x2450d9){_0x2450d9[_0xac31('0x5e')]=_0x140115[_0xac31('0x51')]['id'];return _0x2450d9;});return db['SmsApplication'][_0xac31('0xbf')](_0x1505a8,{'transaction':_0x2c985b});});})['then'](function(){return db[_0xac31('0x6d')][_0xac31('0xc0')]({'where':{'SmsAccountId':_0x140115[_0xac31('0x51')]['id']},'order':_0xac31('0xc1')});});}})[_0xac31('0x1e')](respondWithResult(_0x136442,null))['catch'](handleError(_0x136442,null));};exports[_0xac31('0xc2')]=function(_0x297a3f,_0x16df47,_0x43f271){var _0x243dff={};var _0x40e18c={};var _0x30714f;var _0x10bf83;return db[_0xac31('0x3b')][_0xac31('0x61')]({'where':{'id':_0x297a3f[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x16df47,null))[_0xac31('0x1e')](function(_0x1d85fa){if(_0x1d85fa){_0x30714f=_0x1d85fa;_0x40e18c[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0x6d')]['rawAttributes']);_0x40e18c[_0xac31('0x40')]=_['keys'](_0x297a3f[_0xac31('0x40')]);_0x40e18c[_0xac31('0x48')]=_['intersection'](_0x40e18c[_0xac31('0x3f')],_0x40e18c[_0xac31('0x40')]);_0x243dff[_0xac31('0x43')]=_[_0xac31('0x42')](_0x40e18c[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x297a3f[_0xac31('0x40')][_0xac31('0x44')]));_0x243dff['attributes']=_0x243dff[_0xac31('0x43')][_0xac31('0x68')]?_0x243dff[_0xac31('0x43')]:_0x40e18c[_0xac31('0x3f')];_0x243dff['order']=qs[_0xac31('0x47')](_0x297a3f[_0xac31('0x40')][_0xac31('0x47')]);_0x243dff[_0xac31('0x4c')]=qs[_0xac31('0x48')](_['pick'](_0x297a3f[_0xac31('0x40')],_0x40e18c[_0xac31('0x48')]));if(_0x297a3f['query'][_0xac31('0x4a')]){_0x243dff[_0xac31('0x4c')]=_['merge'](_0x243dff[_0xac31('0x4c')],{'$or':_['map'](_0x243dff[_0xac31('0x43')],function(_0x5769a4){var _0x21e0f2={};_0x21e0f2[_0x5769a4]={'$like':'%'+_0x297a3f[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0x21e0f2;})});}_0x243dff=_[_0xac31('0x4b')]({},_0x243dff,_0x297a3f[_0xac31('0x4e')]);return _0x30714f['getApplications'](_0x243dff);}})[_0xac31('0x1e')](function(_0x3659f2){if(_0x3659f2){_0x10bf83=_0x3659f2[_0xac31('0x68')];if(!_0x297a3f[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x243dff[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x297a3f[_0xac31('0x40')][_0xac31('0x2b')]);_0x243dff['offset']=qs[_0xac31('0x2a')](_0x297a3f[_0xac31('0x40')][_0xac31('0x2a')]);}return _0x30714f['getApplications'](_0x243dff);}})[_0xac31('0x1e')](function(_0x585a6c){if(_0x585a6c){return _0x585a6c?{'count':_0x10bf83,'rows':_0x585a6c}:null;}})[_0xac31('0x1e')](respondWithResult(_0x16df47,null))['catch'](handleError(_0x16df47,null));};exports[_0xac31('0xc3')]=function(_0x562cc5,_0x53f42d,_0x104fa9){var _0x11ae91={'raw':![],'where':{}};var _0x3deb9b={};var _0x502815={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x562cc5[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x53f42d,null))[_0xac31('0x1e')](function(_0x4317e3){if(_0x4317e3){_0x3deb9b[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0xa1')][_0xac31('0x3c')]);_0x3deb9b[_0xac31('0x40')]=_[_0xac31('0x41')](_0x562cc5[_0xac31('0x40')]);_0x3deb9b['filters']=_[_0xac31('0x42')](_0x3deb9b[_0xac31('0x3f')],_0x3deb9b[_0xac31('0x40')]);_0x11ae91['attributes']=_['intersection'](_0x3deb9b[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x562cc5[_0xac31('0x40')][_0xac31('0x44')]));_0x11ae91[_0xac31('0x43')]=_0x11ae91['attributes']['length']?_0x11ae91[_0xac31('0x43')]:_0x3deb9b['model'];if(!_0x562cc5[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x11ae91[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x562cc5['query'][_0xac31('0x2b')]);_0x11ae91[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x562cc5[_0xac31('0x40')][_0xac31('0x2a')]);}_0x11ae91[_0xac31('0x46')]=qs['sort'](_0x562cc5[_0xac31('0x40')][_0xac31('0x47')]);_0x11ae91['where']=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x562cc5[_0xac31('0x40')],_0x3deb9b[_0xac31('0x48')]));_0x11ae91['where']['SmsAccountId']=_0x4317e3['id'];if(_0x562cc5[_0xac31('0x40')][_0xac31('0x4a')]){_0x11ae91[_0xac31('0x4c')]=_[_0xac31('0x4b')](_0x11ae91[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x11ae91[_0xac31('0x43')],function(_0x2dba0d){var _0xe58f6={};_0xe58f6[_0x2dba0d]={'$like':'%'+_0x562cc5[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0xe58f6;})});}_0x11ae91=_[_0xac31('0x4b')]({},_0x11ae91,_0x562cc5[_0xac31('0x4e')]);return db['SmsInteraction'][_0xac31('0x2d')]({'where':_0x11ae91[_0xac31('0x4c')]})[_0xac31('0x1e')](function(_0x1b2cdf){_0x502815[_0xac31('0x2d')]=_0x1b2cdf;if(_0x562cc5[_0xac31('0x40')]['includeAll']){_0x11ae91[_0xac31('0x63')]=[{'model':db[_0xac31('0x73')],'as':_0xac31('0xc4'),'required':![]},{'model':db['User'],'as':_0xac31('0xc5'),'attributes':['name',_0xac31('0xc6'),_0xac31('0xc7')],'required':![]},{'model':db[_0xac31('0xc8')],'as':_0xac31('0xc9'),'attributes':['id',_0xac31('0x37'),_0xac31('0xca')],'where':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]?{'id':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]}:undefined,'required':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]?!![]:![]}];}return db['SmsInteraction'][_0xac31('0x50')](_0x11ae91);})[_0xac31('0x1e')](function(_0x166ebb){_0x502815[_0xac31('0x69')]=_0x166ebb;return _0x502815;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x53f42d,_0x11ae91))[_0xac31('0x27')](handleError(_0x53f42d,null));};exports[_0xac31('0xb9')]=function(_0x1d4639,_0x53a887,_0x36b180){var _0x2194e5,_0x2f7646,_0x210d74;if(_[_0xac31('0x94')](_0x1d4639[_0xac31('0x53')]['body'])||_0x1d4639['body'][_0xac31('0x53')]===''){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x96'));}if(_['isNil'](_0x1d4639[_0xac31('0x53')]['to'])){throw new db['Sequelize']['ValidationError'](_0xac31('0xcc'));}_0x2194e5=_0x1d4639['body']['to'];return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x1d4639[_0xac31('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0xac31('0xcd'),'include':[{'model':db[_0xac31('0x73')],'as':'Contacts','where':{'mobile':_0x2194e5},'limit':0x1,'order':[[_0xac31('0x78'),_0xac31('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x53a887,null))[_0xac31('0x1e')](function(_0x49ceb1){if(_0x49ceb1&&_0x49ceb1[_0xac31('0xcd')]){_0x2f7646=_0x49ceb1[_0xac31('0x33')]({'plain':!![]});if(_0x2f7646[_0xac31('0xcd')]&&_0x2f7646['List'][_0xac31('0x9c')][_0xac31('0x68')]){return _0x2f7646[_0xac31('0xcd')][_0xac31('0x9c')][0x0];}return db[_0xac31('0x73')]['create'](_[_0xac31('0x1a')](_0x1d4639[_0xac31('0x53')],{'firstName':_0x2194e5,'mobile':_0x2194e5,'phone':_0x2194e5,'ListId':_0x2f7646[_0xac31('0x7a')]}));}})['then'](handleEntityNotFound(_0x53a887,null))[_0xac31('0x1e')](function(_0x22a378){if(_0x22a378){_0x210d74=_0x22a378;return db[_0xac31('0xa1')]['find']({'where':{'ContactId':_0x210d74['id'],'closed':![],'SmsAccountId':_0x2f7646['id']}})[_0xac31('0x1e')](function(_0x5d1cf6){if(_0x5d1cf6){return[_0x5d1cf6,![]];}return db[_0xac31('0xa1')][_0xac31('0x52')]({'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id'],'SmsAccountId':_0x2f7646['id'],'phone':_0x2194e5,'firstMsgDirection':_0xac31('0xce'),'Messages':[_[_0xac31('0x4b')](_0x1d4639[_0xac31('0x53')],{'read':![],'body':_0x1d4639[_0xac31('0x53')][_0xac31('0x53')],'phone':_0x2194e5,'SmsAccountId':_0x2f7646['id'],'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id']})]},{'include':[{'model':db[_0xac31('0xa9')],'as':_0xac31('0xcf')}]})[_0xac31('0x1e')](function(_0x293e8d){return[_0x293e8d,!![]];});});}})[_0xac31('0xa2')](function(_0x4e4e79,_0x3438ae){if(_0x3438ae){return _0x4e4e79;}return db[_0xac31('0xa9')][_0xac31('0x52')](_[_0xac31('0x4b')](_0x1d4639[_0xac31('0x53')],{'read':![],'body':_0x1d4639['body']['body'],'phone':_0x2194e5,'SmsAccountId':_0x2f7646['id'],'SmsInteractionId':_0x4e4e79['id'],'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id']}))[_0xac31('0x1e')](function(_0x5a5851){_0x4e4e79['dataValues'][_0xac31('0xcf')]=[];_0x4e4e79[_0xac31('0xd0')][_0xac31('0xcf')]['push'](_0x5a5851[_0xac31('0xd0')]);return _0x4e4e79;});})[_0xac31('0x1e')](respondWithResult(_0x53a887,null))[_0xac31('0x27')](handleError(_0x53a887,null));};exports[_0xac31('0x29')]=function(_0x173706,_0x46df4e,_0x2572ac){if(_0x173706['body']['id']){delete _0x173706[_0xac31('0x53')]['id'];}var _0x1ea009,_0x377ec2,_0x3e777c;return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x173706[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x46df4e,null))[_0xac31('0x1e')](function(_0x266c72){if(_0x266c72){_0x3e777c=_0x266c72;logger[_0xac31('0x22')](_0xac31('0xb3'),'status','received\x20delivery\x20report\x20from',_0x266c72[_0xac31('0x7c')],util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));switch(_0x266c72[_0xac31('0x7c')]){case _0xac31('0x82'):if(_0x173706[_0xac31('0x53')]['skebby_dispatch_id']&&_0x173706[_0xac31('0x53')][_0xac31('0x29')]){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0xd2')]}});}break;case _0xac31('0x85'):if(_0x173706[_0xac31('0x53')][_0xac31('0xd3')]&&_0x173706['body'][_0xac31('0xd4')]){_0x377ec2=_0x173706[_0xac31('0x53')]['statusInt'];return db['SmsMessage'][_0xac31('0x58')]({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0xd3')]}});}break;case'clicksend':if(_0x173706[_0xac31('0x53')][_0xac31('0x87')]&&_0x173706[_0xac31('0x53')][_0xac31('0xd5')]){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0xd5')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0x87')]}});}break;case _0xac31('0x8b'):var _0x3e302a=_0x173706['body'][_0xac31('0x8c')][0x0];if(_0x3e302a['messageId']&&_0x3e302a['status'][_0xac31('0xd6')]===_0xac31('0xd7')){_0x377ec2=_0x3e302a['status']['groupName'];return db['SmsMessage'][_0xac31('0x58')]({'where':{'messageId':_0x3e302a[_0xac31('0x80')]}});}break;case _0xac31('0x8f'):if(_0x173706['body'][_0xac31('0x80')]&&_0x173706[_0xac31('0x53')]['status']){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x173706['body'][_0xac31('0x80')]}});}break;case _0xac31('0x92'):if(_0x173706[_0xac31('0x53')][0x0][_0xac31('0x25')]['id']){_0x377ec2=_0x173706['body'][0x0][_0xac31('0x7c')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706[_0xac31('0x53')][0x0][_0xac31('0x25')]['id']}});}break;case _0xac31('0x93'):if(_0x173706['body']['redif']&&_0x173706[_0xac31('0x53')]['status']){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x46df4e,null))[_0xac31('0x1e')](function(_0x3efe60){if(_0x3efe60){_0x1ea009=_0x3efe60;switch(_0x3e777c['type']){case _0xac31('0x82'):if(_0x377ec2===_0xac31('0xd7')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),_0xac31('0x82'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x377ec2==='1'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),'skebby',util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x86'):if(!_0x173706['body'][_0xac31('0xd8')]&&_0x377ec2>=0xc8&&_0x377ec2<=0xce){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),'status',_0xac31('0x86'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x8b'):var _0x128cb5=_0x173706['body'][_0xac31('0x8c')][0x0];if(_0x128cb5[_0xac31('0x29')][_0xac31('0xd6')]==='DELIVERED'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xac31('0x8b'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x377ec2==_0xac31('0xd9')||_0x377ec2==_0xac31('0xda')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),_0xac31('0x8f'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x92'):if(_0x377ec2==_0xac31('0xdb')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),'status',_0xac31('0x92'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x93'):if(_0x377ec2===_0xac31('0xdc')||_0x377ec2==='ACCEPTD'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac31('0x29'),'intelepeer',util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x1ea009;}})[_0xac31('0x1e')](respondWithResult(_0x46df4e,null))[_0xac31('0x27')](handleError(_0x46df4e,null));};exports[_0xac31('0xdd')]=function(_0x493b0c,_0x2b7d0a,_0x4c7fd9){var _0x5c14c6,_0x2b6f8f,_0x4e3510;return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x493b0c[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x2b7d0a,null))[_0xac31('0x1e')](function(_0x45c2af){if(_0x45c2af){_0x4e3510=_0x45c2af;logger[_0xac31('0x22')](_0xac31('0xb3'),'status','received\x20delivery\x20report\x20from',_0x45c2af[_0xac31('0x7c')],util['inspect'](_0x493b0c[_0xac31('0x40')],{'showHidden':![],'depth':null}));switch(_0x45c2af[_0xac31('0x7c')]){case _0xac31('0x8d'):if(_0x493b0c[_0xac31('0x40')][_0xac31('0xde')]&&_0x493b0c[_0xac31('0x40')][_0xac31('0xdf')]){_0x2b6f8f=_0x493b0c['query'][_0xac31('0xdf')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x493b0c[_0xac31('0x40')]['message-id']}});}break;}}})[_0xac31('0x1e')](handleEntityNotFound(_0x2b7d0a,null))[_0xac31('0x1e')](function(_0x28c299){if(_0x28c299){_0x5c14c6=_0x28c299;switch(_0x4e3510[_0xac31('0x7c')]){case _0xac31('0x8d'):if(_0x2b6f8f==='2'||_0x2b6f8f==='6'){return _0x5c14c6[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac31('0x29'),_0xac31('0x8d'),util[_0xac31('0xd1')](_0x493b0c[_0xac31('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x5c14c6;}})[_0xac31('0x1e')](respondWithResult(_0x2b7d0a,null))['catch'](handleError(_0x2b7d0a,null));};exports[_0xac31('0xe0')]=function(_0x1b785b,_0x5e188b,_0x1c15bb){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x1b785b[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x5e188b,null))['then'](function(_0x57f71f){if(_0x57f71f){return _0x57f71f['addAgents'](_0x1b785b[_0xac31('0x53')][_0xac31('0xe1')],_[_0xac31('0x9f')](_0x1b785b[_0xac31('0x53')],[_0xac31('0xe1'),'id'])||{})[_0xac31('0xa2')](function(_0x51b572){for(var _0x251324=0x0;_0x251324<_0x1b785b[_0xac31('0x53')][_0xac31('0xe1')][_0xac31('0x68')];_0x251324+=0x1){socket[_0xac31('0xe2')](_0xac31('0xe3'),{'UserId':Number(_0x1b785b['body'][_0xac31('0xe1')][_0x251324]),'SmsAccountId':Number(_0x1b785b['params']['id'])});}return _0x51b572;});}})['then'](respondWithResult(_0x5e188b,null))['catch'](handleError(_0x5e188b,null));};exports[_0xac31('0xe4')]=function(_0xb653e5,_0x39114a,_0x514272){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0xb653e5['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x39114a,null))['then'](function(_0x1ed52a){if(_0x1ed52a){return _0x1ed52a[_0xac31('0xe4')](_0xb653e5['query']['ids'])['then'](function(){if(_[_0xac31('0xe5')](_0xb653e5[_0xac31('0x40')]['ids'])){for(var _0x14fde9=0x0;_0x14fde9<_0xb653e5['query'][_0xac31('0xe1')][_0xac31('0x68')];_0x14fde9+=0x1){socket[_0xac31('0xe2')](_0xac31('0xe6'),{'UserId':Number(_0xb653e5[_0xac31('0x40')][_0xac31('0xe1')][_0x14fde9]),'SmsAccountId':Number(_0xb653e5['params']['id'])});}}else{socket[_0xac31('0xe2')](_0xac31('0xe6'),{'UserId':Number(_0xb653e5[_0xac31('0x40')][_0xac31('0xe1')]),'SmsAccountId':Number(_0xb653e5['params']['id'])});}});}})[_0xac31('0x1e')](respondWithStatusCode(_0x39114a,null))[_0xac31('0x27')](handleError(_0x39114a,null));};exports[_0xac31('0xe7')]=function(_0x216de5,_0xdc398f,_0x82d46d){var _0x37f2e0={};var _0x4c5007={};var _0x3dc4d2;var _0x206834;return db[_0xac31('0x3b')][_0xac31('0x61')]({'where':{'id':_0x216de5['params']['id']}})['then'](handleEntityNotFound(_0xdc398f,null))[_0xac31('0x1e')](function(_0x295d2b){if(_0x295d2b){_0x3dc4d2=_0x295d2b;_0x4c5007[_0xac31('0x3f')]=_['keys'](db[_0xac31('0xad')][_0xac31('0x3c')]);_0x4c5007['query']=_[_0xac31('0x41')](_0x216de5[_0xac31('0x40')]);_0x4c5007[_0xac31('0x48')]=_[_0xac31('0x42')](_0x4c5007[_0xac31('0x3f')],_0x4c5007[_0xac31('0x40')]);_0x37f2e0[_0xac31('0x43')]=_['intersection'](_0x4c5007[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x216de5[_0xac31('0x40')][_0xac31('0x44')]));_0x37f2e0[_0xac31('0x43')]=_0x37f2e0[_0xac31('0x43')]['length']?_0x37f2e0[_0xac31('0x43')]:_0x4c5007[_0xac31('0x3f')];_0x37f2e0[_0xac31('0x46')]=qs[_0xac31('0x47')](_0x216de5[_0xac31('0x40')][_0xac31('0x47')]);_0x37f2e0[_0xac31('0x4c')]=qs['filters'](_[_0xac31('0x49')](_0x216de5['query'],_0x4c5007[_0xac31('0x48')]));if(_0x216de5[_0xac31('0x40')][_0xac31('0x4a')]){_0x37f2e0['where']=_[_0xac31('0x4b')](_0x37f2e0[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x37f2e0[_0xac31('0x43')],function(_0x35b113){var _0xd2bbba={};_0xd2bbba[_0x35b113]={'$like':'%'+_0x216de5[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0xd2bbba;})});}_0x37f2e0=_[_0xac31('0x4b')]({},_0x37f2e0,_0x216de5[_0xac31('0x4e')]);return _0x3dc4d2[_0xac31('0xe7')](_0x37f2e0);}})[_0xac31('0x1e')](function(_0x5b86cd){if(_0x5b86cd){_0x206834=_0x5b86cd['length'];if(!_0x216de5[_0xac31('0x40')]['hasOwnProperty'](_0xac31('0x62'))){_0x37f2e0[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x216de5['query'][_0xac31('0x2b')]);_0x37f2e0[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x216de5[_0xac31('0x40')][_0xac31('0x2a')]);}return _0x3dc4d2[_0xac31('0xe7')](_0x37f2e0);}})[_0xac31('0x1e')](function(_0x1dfeed){if(_0x1dfeed){return _0x1dfeed?{'count':_0x206834,'rows':_0x1dfeed}:null;}})['then'](respondWithResult(_0xdc398f,null))['catch'](handleError(_0xdc398f,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a2f279e..98bb739 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 _0x6486=['../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','exports','events'];(function(_0xcba4b6,_0x1ecf6a){var _0x2bd8bf=function(_0x46812a){while(--_0x46812a){_0xcba4b6['push'](_0xcba4b6['shift']());}};_0x2bd8bf(++_0x1ecf6a);}(_0x6486,0x1cf));var _0x6648=function(_0x337910,_0x453153){_0x337910=_0x337910-0x0;var _0x142d90=_0x6486[_0x337910];return _0x142d90;};'use strict';var EventEmitter=require(_0x6648('0x0'));var SmsAccount=require(_0x6648('0x1'))['db'][_0x6648('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6648('0x3'),'afterDestroy':_0x6648('0x4')};function emitEvent(_0x416a81){return function(_0x4d2982,_0x338de3,_0x1ae3ba){SmsAccountEvents[_0x6648('0x5')](_0x416a81+':'+_0x4d2982['id'],_0x4d2982);SmsAccountEvents[_0x6648('0x5')](_0x416a81,_0x4d2982);_0x1ae3ba(null);};}for(var e in events){if(events[_0x6648('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x6648('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x3322=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x6e222c,_0x4ea6a4){var _0x484826=function(_0x547613){while(--_0x547613){_0x6e222c['push'](_0x6e222c['shift']());}};_0x484826(++_0x4ea6a4);}(_0x3322,0xd7));var _0x2332=function(_0x128029,_0x348b4d){_0x128029=_0x128029-0x0;var _0x4ac5ab=_0x3322[_0x128029];return _0x4ac5ab;};'use strict';var EventEmitter=require(_0x2332('0x0'));var SmsAccount=require(_0x2332('0x1'))['db'][_0x2332('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2332('0x3')](0x0);var events={'afterCreate':_0x2332('0x4'),'afterUpdate':_0x2332('0x5'),'afterDestroy':_0x2332('0x6')};function emitEvent(_0x578d62){return function(_0xc992d9,_0x377c5f,_0x169dd1){SmsAccountEvents['emit'](_0x578d62+':'+_0xc992d9['id'],_0xc992d9);SmsAccountEvents['emit'](_0x578d62,_0xc992d9);_0x169dd1(null);};}for(var e in events){if(events[_0x2332('0x7')](e)){var event=events[e];SmsAccount[_0x2332('0x8')](e,emitEvent(event));}}module[_0x2332('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 19481ce..11a09ef 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 _0x0660=['../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','util'];(function(_0xfefd0f,_0x49c04d){var _0x18faf8=function(_0x2ec84d){while(--_0x2ec84d){_0xfefd0f['push'](_0xfefd0f['shift']());}};_0x18faf8(++_0x49c04d);}(_0x0660,0xfb));var _0x0066=function(_0x5b85bf,_0x4a0e32){_0x5b85bf=_0x5b85bf-0x0;var _0x46a57a=_0x0660[_0x5b85bf];return _0x46a57a;};'use strict';var _=require(_0x0066('0x0'));var util=require(_0x0066('0x1'));var logger=require(_0x0066('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0066('0x3'));var fs=require('fs');var path=require(_0x0066('0x4'));var rimraf=require(_0x0066('0x5'));var config=require(_0x0066('0x6'));var attributes=require('./smsAccount.attributes');module[_0x0066('0x7')]=function(_0x2c0858,_0x1fdc2e){return _0x2c0858[_0x0066('0x8')](_0x0066('0x9'),attributes,{'tableName':_0x0066('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97ff=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','request-promise','path','../../config/environment'];(function(_0x224477,_0x1e669b){var _0x4e32c5=function(_0x298dbb){while(--_0x298dbb){_0x224477['push'](_0x224477['shift']());}};_0x4e32c5(++_0x1e669b);}(_0x97ff,0x94));var _0xf97f=function(_0xe3bde,_0x4e8c25){_0xe3bde=_0xe3bde-0x0;var _0x454a1c=_0x97ff[_0xe3bde];return _0x454a1c;};'use strict';var _=require(_0xf97f('0x0'));var util=require(_0xf97f('0x1'));var logger=require(_0xf97f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf97f('0x3'));var fs=require('fs');var path=require(_0xf97f('0x4'));var rimraf=require('rimraf');var config=require(_0xf97f('0x5'));var attributes=require(_0xf97f('0x6'));module[_0xf97f('0x7')]=function(_0x178bdc,_0x1cf29f){return _0x178bdc[_0xf97f('0x8')](_0xf97f('0x9'),attributes,{'tableName':_0xf97f('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 12b78b9..edbb89b 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 _0x51c0=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','map','info','ShowSmsAccount'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x51c0,0x190));var _0x051c=function(_0x2c8af5,_0xa58aab){_0x2c8af5=_0x2c8af5-0x0;var _0x16aacf=_0x51c0[_0x2c8af5];return _0x16aacf;};'use strict';var _=require(_0x051c('0x0'));var util=require(_0x051c('0x1'));var moment=require(_0x051c('0x2'));var BPromise=require('bluebird');var rs=require(_0x051c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x051c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x051c('0x5'))(_0x051c('0x6'));var config=require(_0x051c('0x7'));var jayson=require(_0x051c('0x8'));var client=jayson[_0x051c('0x9')][_0x051c('0xa')]({'port':0x232a});config['redis']=_[_0x051c('0xb')](config[_0x051c('0xc')],{'host':_0x051c('0xd'),'port':0x18eb});var socket=require(_0x051c('0xe'))(new Redis(config[_0x051c('0xc')]));require(_0x051c('0xf'))[_0x051c('0x10')](socket);function respondWithRpcPromise(_0xdb4a25,_0x5b1ff7,_0x29257b){return new BPromise(function(_0x17d06b,_0x25f00b){return client[_0x051c('0x11')](_0xdb4a25,_0x29257b)[_0x051c('0x12')](function(_0x514339){logger['info'](_0x051c('0x13'),_0x5b1ff7,_0x051c('0x14'));logger[_0x051c('0x15')](_0x051c('0x16'),_0x5b1ff7,_0x051c('0x14'),JSON[_0x051c('0x17')](_0x514339));if(_0x514339[_0x051c('0x18')]){if(_0x514339[_0x051c('0x18')][_0x051c('0x19')]===0x1f4){logger[_0x051c('0x18')](_0x051c('0x13'),_0x5b1ff7,_0x514339[_0x051c('0x18')]['message']);return _0x25f00b(_0x514339[_0x051c('0x18')][_0x051c('0x1a')]);}logger[_0x051c('0x18')](_0x051c('0x13'),_0x5b1ff7,_0x514339[_0x051c('0x18')][_0x051c('0x1a')]);return _0x17d06b(_0x514339[_0x051c('0x18')][_0x051c('0x1a')]);}else{logger['info'](_0x051c('0x13'),_0x5b1ff7,_0x051c('0x14'));_0x17d06b(_0x514339[_0x051c('0x1b')][_0x051c('0x1a')]);}})[_0x051c('0x1c')](function(_0x53d247){logger[_0x051c('0x18')](_0x051c('0x13'),_0x5b1ff7,_0x53d247);_0x25f00b(_0x53d247);});});}exports['ShowSmsAccount']=function(_0x24357f){var _0x16b0f6=this;return new Promise(function(_0x2da290,_0x2c3b2f){return db[_0x051c('0x1d')][_0x051c('0x1e')]({'raw':_0x24357f[_0x051c('0x1f')]?_0x24357f[_0x051c('0x1f')][_0x051c('0x20')]===undefined?!![]:![]:!![],'where':_0x24357f['options']?_0x24357f[_0x051c('0x1f')][_0x051c('0x21')]||null:null,'attributes':_0x24357f[_0x051c('0x1f')]?_0x24357f[_0x051c('0x1f')][_0x051c('0x22')]||null:null,'include':_0x24357f[_0x051c('0x1f')]?_0x24357f[_0x051c('0x1f')][_0x051c('0x23')]?_['map'](_0x24357f['options'][_0x051c('0x23')],function(_0x581370){return{'model':db[_0x581370[_0x051c('0x24')]],'as':_0x581370['as'],'attributes':_0x581370[_0x051c('0x22')],'include':_0x581370['include']?_['map'](_0x581370[_0x051c('0x23')],function(_0x27fbef){return{'model':db[_0x27fbef[_0x051c('0x24')]],'as':_0x27fbef['as'],'attributes':_0x27fbef['attributes'],'include':_0x27fbef[_0x051c('0x23')]?_[_0x051c('0x25')](_0x27fbef[_0x051c('0x23')],function(_0x9fe04d){return{'model':db[_0x9fe04d[_0x051c('0x24')]],'as':_0x9fe04d['as'],'attributes':_0x9fe04d['attributes']};}):[]};}):[]};}):[]:[]})[_0x051c('0x12')](function(_0x43f08d){logger[_0x051c('0x26')](_0x051c('0x27'),_0x24357f);logger[_0x051c('0x15')]('ShowSmsAccount',_0x24357f,JSON['stringify'](_0x43f08d));_0x2da290(_0x43f08d);})['catch'](function(_0x1f533f){logger[_0x051c('0x18')](_0x051c('0x27'),_0x1f533f[_0x051c('0x1a')],_0x24357f);_0x2c3b2f(_0x16b0f6[_0x051c('0x18')](0x1f4,_0x1f533f[_0x051c('0x1a')]));});});}; \ No newline at end of file +var _0x6683=['SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','map','include','model','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./smsAccount.socket','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6683,0x14a));var _0x3668=function(_0x54f1dc,_0x863c6b){_0x54f1dc=_0x54f1dc-0x0;var _0x257fcb=_0x6683[_0x54f1dc];return _0x257fcb;};'use strict';var _=require(_0x3668('0x0'));var util=require('util');var moment=require(_0x3668('0x1'));var BPromise=require(_0x3668('0x2'));var rs=require(_0x3668('0x3'));var fs=require('fs');var Redis=require(_0x3668('0x4'));var db=require(_0x3668('0x5'))['db'];var utils=require(_0x3668('0x6'));var logger=require(_0x3668('0x7'))(_0x3668('0x8'));var config=require(_0x3668('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3668('0xa')]['http']({'port':0x232a});config[_0x3668('0xb')]=_[_0x3668('0xc')](config[_0x3668('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3668('0xb')]));require(_0x3668('0xd'))['register'](socket);function respondWithRpcPromise(_0xa72075,_0x3a2556,_0x540328){return new BPromise(function(_0x37f30e,_0x1b19e0){return client['request'](_0xa72075,_0x540328)[_0x3668('0xe')](function(_0xa0bf3b){logger[_0x3668('0xf')]('SmsAccount,\x20%s,\x20%s',_0x3a2556,_0x3668('0x10'));logger['debug'](_0x3668('0x11'),_0x3a2556,'request\x20sent',JSON[_0x3668('0x12')](_0xa0bf3b));if(_0xa0bf3b[_0x3668('0x13')]){if(_0xa0bf3b[_0x3668('0x13')]['code']===0x1f4){logger[_0x3668('0x13')](_0x3668('0x14'),_0x3a2556,_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);return _0x1b19e0(_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);}logger[_0x3668('0x13')]('SmsAccount,\x20%s,\x20%s',_0x3a2556,_0xa0bf3b['error'][_0x3668('0x15')]);return _0x37f30e(_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);}else{logger[_0x3668('0xf')](_0x3668('0x14'),_0x3a2556,_0x3668('0x10'));_0x37f30e(_0xa0bf3b[_0x3668('0x16')][_0x3668('0x15')]);}})[_0x3668('0x17')](function(_0x5cf105){logger['error'](_0x3668('0x14'),_0x3a2556,_0x5cf105);_0x1b19e0(_0x5cf105);});});}exports[_0x3668('0x18')]=function(_0x346da2){var _0x4d9bac=this;return new Promise(function(_0x16d398,_0x5aeb6c){return db[_0x3668('0x19')][_0x3668('0x1a')]({'raw':_0x346da2[_0x3668('0x1b')]?_0x346da2[_0x3668('0x1b')][_0x3668('0x1c')]===undefined?!![]:![]:!![],'where':_0x346da2['options']?_0x346da2[_0x3668('0x1b')][_0x3668('0x1d')]||null:null,'attributes':_0x346da2['options']?_0x346da2['options']['attributes']||null:null,'include':_0x346da2[_0x3668('0x1b')]?_0x346da2[_0x3668('0x1b')]['include']?_[_0x3668('0x1e')](_0x346da2[_0x3668('0x1b')][_0x3668('0x1f')],function(_0x30aeaf){return{'model':db[_0x30aeaf[_0x3668('0x20')]],'as':_0x30aeaf['as'],'attributes':_0x30aeaf[_0x3668('0x21')],'include':_0x30aeaf[_0x3668('0x1f')]?_[_0x3668('0x1e')](_0x30aeaf['include'],function(_0x429f6f){return{'model':db[_0x429f6f[_0x3668('0x20')]],'as':_0x429f6f['as'],'attributes':_0x429f6f['attributes'],'include':_0x429f6f[_0x3668('0x1f')]?_['map'](_0x429f6f[_0x3668('0x1f')],function(_0x3d3739){return{'model':db[_0x3d3739[_0x3668('0x20')]],'as':_0x3d3739['as'],'attributes':_0x3d3739['attributes']};}):[]};}):[]};}):[]:[]})[_0x3668('0xe')](function(_0x483a3e){logger['info'](_0x3668('0x18'),_0x346da2);logger[_0x3668('0x22')]('ShowSmsAccount',_0x346da2,JSON['stringify'](_0x483a3e));_0x16d398(_0x483a3e);})['catch'](function(_0x169370){logger[_0x3668('0x13')]('ShowSmsAccount',_0x169370[_0x3668('0x15')],_0x346da2);_0x5aeb6c(_0x4d9bac[_0x3668('0x13')](0x1f4,_0x169370[_0x3668('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ce7b765..784e6c4 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 87bf7a3..dc0dae5 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x6788ab,_0x1bc627){var _0x4d042c=function(_0xa2bb21){while(--_0xa2bb21){_0x6788ab['push'](_0x6788ab['shift']());}};_0x4d042c(++_0x1bc627);}(_0xedd9,0xfc));var _0x9edd=function(_0x986eb,_0x6053d){_0x986eb=_0x986eb-0x0;var _0x521393=_0xedd9[_0x986eb];return _0x521393;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x54be41,_0x1d0f66){var _0x761326=function(_0x32db7f){while(--_0x32db7f){_0x54be41['push'](_0x54be41['shift']());}};_0x761326(++_0x1d0f66);}(_0x008c,0x188));var _0xc008=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x008c[_0x18a81a];return _0x114027;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a869929..a2143c9 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 _0x960f=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3600bc,_0x57ebf7){var _0x3ff211=function(_0x2c234b){while(--_0x2c234b){_0x3600bc['push'](_0x3600bc['shift']());}};_0x3ff211(++_0x57ebf7);}(_0x960f,0x1a8));var _0xf960=function(_0xeaba4b,_0x1eab4b){_0xeaba4b=_0xeaba4b-0x0;var _0x32f4fd=_0x960f[_0xeaba4b];return _0x32f4fd;};'use strict';var Sequelize=require(_0xf960('0x0'));module[_0xf960('0x1')]={'priority':{'type':Sequelize[_0xf960('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf960('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf960('0x4')]()},'description':{'type':Sequelize[_0xf960('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf960('0x5')}}; \ No newline at end of file +var _0xd677=['STRING','TEXT'];(function(_0x55b78d,_0x1d1561){var _0x3aa8c9=function(_0x3f7bb8){while(--_0x3f7bb8){_0x55b78d['push'](_0x55b78d['shift']());}};_0x3aa8c9(++_0x1d1561);}(_0xd677,0x94));var _0x7d67=function(_0x94118,_0x3bf157){_0x94118=_0x94118-0x0;var _0x685a42=_0xd677[_0x94118];return _0x685a42;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d67('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7d67('0x1')]()},'description':{'type':Sequelize[_0x7d67('0x0')]},'interval':{'type':Sequelize[_0x7d67('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f6fcab3..bba3cc4 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 _0x0115=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','SmsApplication','catch','show','params','create','body','find','rimraf','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x0115,0x10a));var _0x5011=function(_0x55cdb1,_0x29933b){_0x55cdb1=_0x55cdb1-0x0;var _0x1bf9e5=_0x0115[_0x55cdb1];return _0x1bf9e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5011('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5011('0x1'));var moment=require(_0x5011('0x2'));var BPromise=require(_0x5011('0x3'));var Mustache=require(_0x5011('0x4'));var util=require(_0x5011('0x5'));var path=require(_0x5011('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5011('0x7'));var _=require('lodash');var squel=require(_0x5011('0x8'));var crypto=require('crypto');var jsforce=require(_0x5011('0x9'));var deskjs=require(_0x5011('0xa'));var toCsv=require(_0x5011('0xb'));var querystring=require(_0x5011('0xc'));var Papa=require(_0x5011('0xd'));var Redis=require(_0x5011('0xe'));var authService=require(_0x5011('0xf'));var qs=require(_0x5011('0x10'));var as=require(_0x5011('0x11'));var hardwareService=require(_0x5011('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5011('0x13'));var config=require(_0x5011('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df8ab,_0x308423){_0x308423=_0x308423||0xcc;return function(_0x229c02){if(_0x229c02){return _0x5df8ab[_0x5011('0x15')](_0x308423);}return _0x5df8ab['status'](_0x308423)[_0x5011('0x16')]();};}function respondWithResult(_0x2c3c82,_0x24e259){_0x24e259=_0x24e259||0xc8;return function(_0x125e39){if(_0x125e39){return _0x2c3c82[_0x5011('0x17')](_0x24e259)[_0x5011('0x18')](_0x125e39);}};}function respondWithFilteredResult(_0x30c915,_0x3eb204){return function(_0x25c968){if(_0x25c968){var _0x40d2ea=typeof _0x3eb204[_0x5011('0x19')]===_0x5011('0x1a')&&typeof _0x3eb204['limit']===_0x5011('0x1a');var _0xa2a2=_0x25c968[_0x5011('0x1b')];var _0x202b40=_0x40d2ea?0x0:_0x3eb204[_0x5011('0x19')];var _0xfc5f31=_0x40d2ea?_0x25c968['count']:_0x3eb204[_0x5011('0x19')]+_0x3eb204[_0x5011('0x1c')];var _0x48178b;if(_0xfc5f31>=_0xa2a2){_0xfc5f31=_0xa2a2;_0x48178b=0xc8;}else{_0x48178b=0xce;}_0x30c915[_0x5011('0x17')](_0x48178b);return _0x30c915[_0x5011('0x1d')](_0x5011('0x1e'),_0x202b40+'-'+_0xfc5f31+'/'+_0xa2a2)['json'](_0x25c968);}return null;};}function patchUpdates(_0x6eec52){return function(_0x427128){try{jsonpatch[_0x5011('0x1f')](_0x427128,_0x6eec52,!![]);}catch(_0x18e6f5){return BPromise[_0x5011('0x20')](_0x18e6f5);}return _0x427128[_0x5011('0x21')]();};}function saveUpdates(_0x220be5,_0x2dee1a){return function(_0xf42aac){if(_0xf42aac){return _0xf42aac[_0x5011('0x22')](_0x220be5)['then'](function(_0x49b9f){return _0x49b9f;});}return null;};}function removeEntity(_0x388319,_0x1ff893){return function(_0x26f7c0){if(_0x26f7c0){return _0x26f7c0[_0x5011('0x23')]()[_0x5011('0x24')](function(){_0x388319['status'](0xcc)[_0x5011('0x16')]();});}};}function handleEntityNotFound(_0x5bacef,_0x1ea4f8){return function(_0x1b8834){if(!_0x1b8834){_0x5bacef['sendStatus'](0x194);}return _0x1b8834;};}function handleError(_0xbad1ae,_0x523a53){_0x523a53=_0x523a53||0x1f4;return function(_0x15d2a9){logger[_0x5011('0x25')](_0x15d2a9[_0x5011('0x26')]);if(_0x15d2a9[_0x5011('0x27')]){delete _0x15d2a9[_0x5011('0x27')];}_0xbad1ae[_0x5011('0x17')](_0x523a53)['send'](_0x15d2a9);};}exports['index']=function(_0x55f6c1,_0x4eb57e){var _0x2a2a7e={},_0x2069d7={},_0x2db4f1={'count':0x0,'rows':[]};var _0x41af90=_[_0x5011('0x28')](db['SmsApplication'][_0x5011('0x29')],function(_0x91f227){return{'name':_0x91f227[_0x5011('0x2a')],'type':_0x91f227[_0x5011('0x2b')][_0x5011('0x2c')]};});_0x2069d7[_0x5011('0x2d')]=_[_0x5011('0x28')](_0x41af90,_0x5011('0x27'));_0x2069d7[_0x5011('0x2e')]=_[_0x5011('0x2f')](_0x55f6c1['query']);_0x2069d7[_0x5011('0x30')]=_[_0x5011('0x31')](_0x2069d7[_0x5011('0x2d')],_0x2069d7[_0x5011('0x2e')]);_0x2a2a7e[_0x5011('0x32')]=_[_0x5011('0x31')](_0x2069d7[_0x5011('0x2d')],qs[_0x5011('0x33')](_0x55f6c1[_0x5011('0x2e')][_0x5011('0x33')]));_0x2a2a7e[_0x5011('0x32')]=_0x2a2a7e[_0x5011('0x32')][_0x5011('0x34')]?_0x2a2a7e[_0x5011('0x32')]:_0x2069d7['model'];if(!_0x55f6c1[_0x5011('0x2e')][_0x5011('0x35')]('nolimit')){_0x2a2a7e['limit']=qs[_0x5011('0x1c')](_0x55f6c1[_0x5011('0x2e')][_0x5011('0x1c')]);_0x2a2a7e['offset']=qs[_0x5011('0x19')](_0x55f6c1['query']['offset']);}_0x2a2a7e['order']=qs[_0x5011('0x36')](_0x55f6c1[_0x5011('0x2e')][_0x5011('0x36')]);_0x2a2a7e[_0x5011('0x37')]=qs[_0x5011('0x30')](_[_0x5011('0x38')](_0x55f6c1['query'],_0x2069d7[_0x5011('0x30')]),_0x41af90);if(_0x55f6c1[_0x5011('0x2e')][_0x5011('0x39')]){_0x2a2a7e[_0x5011('0x37')]=_['merge'](_0x2a2a7e[_0x5011('0x37')],{'$or':_[_0x5011('0x28')](_0x41af90,function(_0x5b8448){if(_0x5b8448['type']!==_0x5011('0x3a')){var _0x58788a={};_0x58788a[_0x5b8448[_0x5011('0x27')]]={'$like':'%'+_0x55f6c1['query'][_0x5011('0x39')]+'%'};return _0x58788a;}})});}_0x2a2a7e=_[_0x5011('0x3b')]({},_0x2a2a7e,_0x55f6c1[_0x5011('0x3c')]);var _0x2d85b3={'where':_0x2a2a7e['where']};return db['SmsApplication'][_0x5011('0x1b')](_0x2d85b3)['then'](function(_0x19584c){_0x2db4f1[_0x5011('0x1b')]=_0x19584c;if(_0x55f6c1[_0x5011('0x2e')][_0x5011('0x3d')]){_0x2a2a7e[_0x5011('0x3e')]=[{'all':!![]}];}return db[_0x5011('0x3f')]['findAll'](_0x2a2a7e);})[_0x5011('0x24')](function(_0x573e39){_0x2db4f1['rows']=_0x573e39;return _0x2db4f1;})['then'](respondWithFilteredResult(_0x4eb57e,_0x2a2a7e))[_0x5011('0x40')](handleError(_0x4eb57e,null));};exports[_0x5011('0x41')]=function(_0x4152cb,_0x1cf6a1){var _0x5ae872={'raw':!![],'where':{'id':_0x4152cb[_0x5011('0x42')]['id']}},_0x330a64={};_0x330a64[_0x5011('0x2d')]=_['keys'](db[_0x5011('0x3f')][_0x5011('0x29')]);_0x330a64[_0x5011('0x2e')]=_[_0x5011('0x2f')](_0x4152cb[_0x5011('0x2e')]);_0x330a64['filters']=_[_0x5011('0x31')](_0x330a64[_0x5011('0x2d')],_0x330a64[_0x5011('0x2e')]);_0x5ae872[_0x5011('0x32')]=_[_0x5011('0x31')](_0x330a64[_0x5011('0x2d')],qs[_0x5011('0x33')](_0x4152cb[_0x5011('0x2e')][_0x5011('0x33')]));_0x5ae872[_0x5011('0x32')]=_0x5ae872['attributes']['length']?_0x5ae872[_0x5011('0x32')]:_0x330a64[_0x5011('0x2d')];if(_0x4152cb['query'][_0x5011('0x3d')]){_0x5ae872[_0x5011('0x3e')]=[{'all':!![]}];}_0x5ae872=_[_0x5011('0x3b')]({},_0x5ae872,_0x4152cb[_0x5011('0x3c')]);return db[_0x5011('0x3f')]['find'](_0x5ae872)[_0x5011('0x24')](handleEntityNotFound(_0x1cf6a1,null))[_0x5011('0x24')](respondWithResult(_0x1cf6a1,null))['catch'](handleError(_0x1cf6a1,null));};exports[_0x5011('0x43')]=function(_0x2187ec,_0x4fef9e){return db[_0x5011('0x3f')]['create'](_0x2187ec['body'],{})[_0x5011('0x24')](respondWithResult(_0x4fef9e,0xc9))[_0x5011('0x40')](handleError(_0x4fef9e,null));};exports[_0x5011('0x22')]=function(_0x57308b,_0x225e9e){if(_0x57308b[_0x5011('0x44')]['id']){delete _0x57308b['body']['id'];}return db[_0x5011('0x3f')][_0x5011('0x45')]({'where':{'id':_0x57308b[_0x5011('0x42')]['id']}})[_0x5011('0x24')](handleEntityNotFound(_0x225e9e,null))[_0x5011('0x24')](saveUpdates(_0x57308b[_0x5011('0x44')],null))[_0x5011('0x24')](respondWithResult(_0x225e9e,null))[_0x5011('0x40')](handleError(_0x225e9e,null));};exports[_0x5011('0x23')]=function(_0x214ca5,_0x283b8a){return db[_0x5011('0x3f')][_0x5011('0x45')]({'where':{'id':_0x214ca5[_0x5011('0x42')]['id']}})[_0x5011('0x24')](handleEntityNotFound(_0x283b8a,null))[_0x5011('0x24')](removeEntity(_0x283b8a,null))['catch'](handleError(_0x283b8a,null));}; \ No newline at end of file +var _0xa2a6=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','include','findAll','rows','catch','show','params','SmsApplication','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x190912,_0x13c19b){var _0x3db018=function(_0x57625a){while(--_0x57625a){_0x190912['push'](_0x190912['shift']());}};_0x3db018(++_0x13c19b);}(_0xa2a6,0x116));var _0x6a2a=function(_0x266e50,_0x58680c){_0x266e50=_0x266e50-0x0;var _0x9d7a26=_0xa2a6[_0x266e50];return _0x9d7a26;};'use strict';var emlformat=require(_0x6a2a('0x0'));var rimraf=require(_0x6a2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a2a('0x2'));var rp=require('request-promise');var moment=require(_0x6a2a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a2a('0x4'));var util=require(_0x6a2a('0x5'));var path=require('path');var sox=require(_0x6a2a('0x6'));var csv=require(_0x6a2a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a2a('0x8'));var _=require(_0x6a2a('0x9'));var squel=require(_0x6a2a('0xa'));var crypto=require(_0x6a2a('0xb'));var jsforce=require(_0x6a2a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a2a('0x7'));var querystring=require('querystring');var Papa=require(_0x6a2a('0xd'));var Redis=require(_0x6a2a('0xe'));var authService=require(_0x6a2a('0xf'));var qs=require(_0x6a2a('0x10'));var as=require(_0x6a2a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a2a('0x12'));var utils=require('../../config/utils');var config=require(_0x6a2a('0x13'));var licenseUtil=require(_0x6a2a('0x14'));var db=require(_0x6a2a('0x15'))['db'];function respondWithStatusCode(_0x56e71e,_0x44d5a7){_0x44d5a7=_0x44d5a7||0xcc;return function(_0x560e05){if(_0x560e05){return _0x56e71e[_0x6a2a('0x16')](_0x44d5a7);}return _0x56e71e[_0x6a2a('0x17')](_0x44d5a7)[_0x6a2a('0x18')]();};}function respondWithResult(_0x4929d4,_0x4e102b){_0x4e102b=_0x4e102b||0xc8;return function(_0xe226b4){if(_0xe226b4){return _0x4929d4['status'](_0x4e102b)[_0x6a2a('0x19')](_0xe226b4);}};}function respondWithFilteredResult(_0x17f7e9,_0x4062e9){return function(_0x13149d){if(_0x13149d){var _0x27f1ba=typeof _0x4062e9[_0x6a2a('0x1a')]===_0x6a2a('0x1b')&&typeof _0x4062e9[_0x6a2a('0x1c')]===_0x6a2a('0x1b');var _0x5af11f=_0x13149d[_0x6a2a('0x1d')];var _0x40e176=_0x27f1ba?0x0:_0x4062e9[_0x6a2a('0x1a')];var _0x52ac48=_0x27f1ba?_0x13149d[_0x6a2a('0x1d')]:_0x4062e9[_0x6a2a('0x1a')]+_0x4062e9['limit'];var _0x11215b;if(_0x52ac48>=_0x5af11f){_0x52ac48=_0x5af11f;_0x11215b=0xc8;}else{_0x11215b=0xce;}_0x17f7e9['status'](_0x11215b);return _0x17f7e9['set']('Content-Range',_0x40e176+'-'+_0x52ac48+'/'+_0x5af11f)[_0x6a2a('0x19')](_0x13149d);}return null;};}function patchUpdates(_0x2807e7){return function(_0x363538){try{jsonpatch[_0x6a2a('0x1e')](_0x363538,_0x2807e7,!![]);}catch(_0x270ae0){return BPromise['reject'](_0x270ae0);}return _0x363538['save']();};}function saveUpdates(_0x2c4656,_0x2d0bc0){return function(_0x1f418e){if(_0x1f418e){return _0x1f418e[_0x6a2a('0x1f')](_0x2c4656)[_0x6a2a('0x20')](function(_0x3fd07f){return _0x3fd07f;});}return null;};}function removeEntity(_0xfa9879,_0x324881){return function(_0x5b4496){if(_0x5b4496){return _0x5b4496[_0x6a2a('0x21')]()[_0x6a2a('0x20')](function(){_0xfa9879[_0x6a2a('0x17')](0xcc)[_0x6a2a('0x18')]();});}};}function handleEntityNotFound(_0x44cfa0,_0x118589){return function(_0x1cc415){if(!_0x1cc415){_0x44cfa0[_0x6a2a('0x16')](0x194);}return _0x1cc415;};}function handleError(_0x241908,_0x2ad0bd){_0x2ad0bd=_0x2ad0bd||0x1f4;return function(_0x252bc8){logger[_0x6a2a('0x22')](_0x252bc8[_0x6a2a('0x23')]);if(_0x252bc8[_0x6a2a('0x24')]){delete _0x252bc8[_0x6a2a('0x24')];}_0x241908[_0x6a2a('0x17')](_0x2ad0bd)[_0x6a2a('0x25')](_0x252bc8);};}exports[_0x6a2a('0x26')]=function(_0x2a0927,_0x125c5e){var _0x1e6acd={},_0x335e56={},_0x3a8cd0={'count':0x0,'rows':[]};var _0x5ddba5=_[_0x6a2a('0x27')](db['SmsApplication'][_0x6a2a('0x28')],function(_0x2b9713){return{'name':_0x2b9713[_0x6a2a('0x29')],'type':_0x2b9713[_0x6a2a('0x2a')][_0x6a2a('0x2b')]};});_0x335e56[_0x6a2a('0x2c')]=_[_0x6a2a('0x27')](_0x5ddba5,_0x6a2a('0x24'));_0x335e56[_0x6a2a('0x2d')]=_[_0x6a2a('0x2e')](_0x2a0927[_0x6a2a('0x2d')]);_0x335e56[_0x6a2a('0x2f')]=_[_0x6a2a('0x30')](_0x335e56['model'],_0x335e56[_0x6a2a('0x2d')]);_0x1e6acd['attributes']=_[_0x6a2a('0x30')](_0x335e56[_0x6a2a('0x2c')],qs['fields'](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x31')]));_0x1e6acd[_0x6a2a('0x32')]=_0x1e6acd[_0x6a2a('0x32')][_0x6a2a('0x33')]?_0x1e6acd[_0x6a2a('0x32')]:_0x335e56[_0x6a2a('0x2c')];if(!_0x2a0927['query'][_0x6a2a('0x34')](_0x6a2a('0x35'))){_0x1e6acd[_0x6a2a('0x1c')]=qs[_0x6a2a('0x1c')](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x1c')]);_0x1e6acd[_0x6a2a('0x1a')]=qs['offset'](_0x2a0927[_0x6a2a('0x2d')]['offset']);}_0x1e6acd[_0x6a2a('0x36')]=qs['sort'](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x37')]);_0x1e6acd['where']=qs[_0x6a2a('0x2f')](_[_0x6a2a('0x38')](_0x2a0927['query'],_0x335e56[_0x6a2a('0x2f')]),_0x5ddba5);if(_0x2a0927[_0x6a2a('0x2d')]['filter']){_0x1e6acd[_0x6a2a('0x39')]=_['merge'](_0x1e6acd[_0x6a2a('0x39')],{'$or':_[_0x6a2a('0x27')](_0x5ddba5,function(_0x47c066){if(_0x47c066['type']!==_0x6a2a('0x3a')){var _0xdea8bf={};_0xdea8bf[_0x47c066['name']]={'$like':'%'+_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x3b')]+'%'};return _0xdea8bf;}})});}_0x1e6acd=_[_0x6a2a('0x3c')]({},_0x1e6acd,_0x2a0927['options']);var _0x56eba7={'where':_0x1e6acd[_0x6a2a('0x39')]};return db['SmsApplication']['count'](_0x56eba7)[_0x6a2a('0x20')](function(_0x25a648){_0x3a8cd0[_0x6a2a('0x1d')]=_0x25a648;if(_0x2a0927[_0x6a2a('0x2d')]['includeAll']){_0x1e6acd[_0x6a2a('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x6a2a('0x3e')](_0x1e6acd);})['then'](function(_0x3896b2){_0x3a8cd0[_0x6a2a('0x3f')]=_0x3896b2;return _0x3a8cd0;})['then'](respondWithFilteredResult(_0x125c5e,_0x1e6acd))[_0x6a2a('0x40')](handleError(_0x125c5e,null));};exports[_0x6a2a('0x41')]=function(_0x388bdb,_0x1448f4){var _0x31aa50={'raw':!![],'where':{'id':_0x388bdb[_0x6a2a('0x42')]['id']}},_0x30e16b={};_0x30e16b[_0x6a2a('0x2c')]=_['keys'](db[_0x6a2a('0x43')][_0x6a2a('0x28')]);_0x30e16b[_0x6a2a('0x2d')]=_[_0x6a2a('0x2e')](_0x388bdb[_0x6a2a('0x2d')]);_0x30e16b[_0x6a2a('0x2f')]=_[_0x6a2a('0x30')](_0x30e16b[_0x6a2a('0x2c')],_0x30e16b[_0x6a2a('0x2d')]);_0x31aa50['attributes']=_[_0x6a2a('0x30')](_0x30e16b[_0x6a2a('0x2c')],qs['fields'](_0x388bdb[_0x6a2a('0x2d')][_0x6a2a('0x31')]));_0x31aa50[_0x6a2a('0x32')]=_0x31aa50['attributes'][_0x6a2a('0x33')]?_0x31aa50['attributes']:_0x30e16b[_0x6a2a('0x2c')];if(_0x388bdb[_0x6a2a('0x2d')][_0x6a2a('0x44')]){_0x31aa50[_0x6a2a('0x3d')]=[{'all':!![]}];}_0x31aa50=_[_0x6a2a('0x3c')]({},_0x31aa50,_0x388bdb[_0x6a2a('0x45')]);return db[_0x6a2a('0x43')][_0x6a2a('0x46')](_0x31aa50)['then'](handleEntityNotFound(_0x1448f4,null))[_0x6a2a('0x20')](respondWithResult(_0x1448f4,null))[_0x6a2a('0x40')](handleError(_0x1448f4,null));};exports[_0x6a2a('0x47')]=function(_0x33eca9,_0x3109ef){return db[_0x6a2a('0x43')]['create'](_0x33eca9['body'],{})[_0x6a2a('0x20')](respondWithResult(_0x3109ef,0xc9))[_0x6a2a('0x40')](handleError(_0x3109ef,null));};exports[_0x6a2a('0x1f')]=function(_0x9bff63,_0x635abe){if(_0x9bff63[_0x6a2a('0x48')]['id']){delete _0x9bff63['body']['id'];}return db['SmsApplication'][_0x6a2a('0x46')]({'where':{'id':_0x9bff63[_0x6a2a('0x42')]['id']}})[_0x6a2a('0x20')](handleEntityNotFound(_0x635abe,null))['then'](saveUpdates(_0x9bff63[_0x6a2a('0x48')],null))[_0x6a2a('0x20')](respondWithResult(_0x635abe,null))[_0x6a2a('0x40')](handleError(_0x635abe,null));};exports[_0x6a2a('0x21')]=function(_0x723439,_0x319217){return db[_0x6a2a('0x43')][_0x6a2a('0x46')]({'where':{'id':_0x723439[_0x6a2a('0x42')]['id']}})[_0x6a2a('0x20')](handleEntityNotFound(_0x319217,null))['then'](removeEntity(_0x319217,null))['catch'](handleError(_0x319217,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index bf4d42d..6edb249 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 _0x3fed=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4f4c11,_0xdb6add){var _0x4dfd33=function(_0x163cfe){while(--_0x163cfe){_0x4f4c11['push'](_0x4f4c11['shift']());}};_0x4dfd33(++_0xdb6add);}(_0x3fed,0x1a4));var _0xd3fe=function(_0x3a0512,_0x352bb8){_0x3a0512=_0x3a0512-0x0;var _0x34e4ba=_0x3fed[_0x3a0512];return _0x34e4ba;};'use strict';var _=require(_0xd3fe('0x0'));var util=require(_0xd3fe('0x1'));var logger=require(_0xd3fe('0x2'))(_0xd3fe('0x3'));var moment=require(_0xd3fe('0x4'));var BPromise=require(_0xd3fe('0x5'));var rp=require(_0xd3fe('0x6'));var fs=require('fs');var path=require(_0xd3fe('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3fe('0x8'));module['exports']=function(_0x693071,_0x2d44d2){return _0x693071[_0xd3fe('0x9')](_0xd3fe('0xa'),attributes,{'tableName':_0xd3fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3fe('0xc'),'collate':_0xd3fe('0xd')});}; \ No newline at end of file +var _0x1f0d=['api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x549834,_0x54044c){var _0x42eb5d=function(_0x298252){while(--_0x298252){_0x549834['push'](_0x549834['shift']());}};_0x42eb5d(++_0x54044c);}(_0x1f0d,0x165));var _0xd1f0=function(_0x3bed33,_0x33e08f){_0x3bed33=_0x3bed33-0x0;var _0x389c18=_0x1f0d[_0x3bed33];return _0x389c18;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var logger=require(_0xd1f0('0x2'))(_0xd1f0('0x3'));var moment=require(_0xd1f0('0x4'));var BPromise=require(_0xd1f0('0x5'));var rp=require(_0xd1f0('0x6'));var fs=require('fs');var path=require(_0xd1f0('0x7'));var rimraf=require(_0xd1f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xd1f0('0x9'));module[_0xd1f0('0xa')]=function(_0x21dce4,_0x595cd0){return _0x21dce4[_0xd1f0('0xb')](_0xd1f0('0xc'),attributes,{'tableName':_0xd1f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1f0('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index fd2f836..c6fa149 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 _0x3c32=['request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0xb70d32,_0x42a165){var _0x324622=function(_0x539ded){while(--_0x539ded){_0xb70d32['push'](_0xb70d32['shift']());}};_0x324622(++_0x42a165);}(_0x3c32,0x161));var _0x23c3=function(_0x2934e8,_0x46bde0){_0x2934e8=_0x2934e8-0x0;var _0x3468b8=_0x3c32[_0x2934e8];return _0x3468b8;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6364,_0x56568e,_0x493ca6){return new BPromise(function(_0x4df5ee,_0x422558){return client[_0x23c3('0xb')](_0x4a6364,_0x493ca6)[_0x23c3('0xc')](function(_0x420987){logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));logger[_0x23c3('0x10')](_0x23c3('0x11'),_0x56568e,_0x23c3('0xf'),JSON[_0x23c3('0x12')](_0x420987));if(_0x420987[_0x23c3('0x13')]){if(_0x420987[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0xe'),_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x422558(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x4df5ee(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}else{logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));_0x4df5ee(_0x420987['result']['message']);}})[_0x23c3('0x16')](function(_0x43534b){logger['error'](_0x23c3('0xe'),_0x56568e,_0x43534b);_0x422558(_0x43534b);});});} \ No newline at end of file +var _0xed3c=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x501401,_0x2d8737){var _0xfd0a47=function(_0x57decb){while(--_0x57decb){_0x501401['push'](_0x501401['shift']());}};_0xfd0a47(++_0x2d8737);}(_0xed3c,0x1a6));var _0xced3=function(_0x2fb16e,_0x161667){_0x2fb16e=_0x2fb16e-0x0;var _0x5e0882=_0xed3c[_0x2fb16e];return _0x5e0882;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('SmsApplication,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ded55fe..8fc120f 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 _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x108dbe,_0x3390b5){var _0x3c9d49=function(_0x257ff0){while(--_0x257ff0){_0x108dbe['push'](_0x108dbe['shift']());}};_0x3c9d49(++_0x3390b5);}(_0xe605,0x92));var _0x5e60=function(_0x30e2a0,_0x2a8d10){_0x30e2a0=_0x30e2a0-0x0;var _0x15e0cf=_0xe605[_0x30e2a0];return _0x15e0cf;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file +var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x24ca90,_0x596e1d){var _0x31d9ef=function(_0x40fa9e){while(--_0x40fa9e){_0x24ca90['push'](_0x24ca90['shift']());}};_0x31d9ef(++_0x596e1d);}(_0x3c81,0x102));var _0x13c8=function(_0x3b2eaa,_0x108aa6){_0x3b2eaa=_0x3b2eaa-0x0;var _0x219ee0=_0x3c81[_0x3b2eaa];return _0x219ee0;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 08f9c02..01ca3a7 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 _0xce1a=['DATE','STRING','out','ENUM','BOOLEAN','sequelize'];(function(_0x5b3ce1,_0xedd65b){var _0x38b358=function(_0x154aa6){while(--_0x154aa6){_0x5b3ce1['push'](_0x5b3ce1['shift']());}};_0x38b358(++_0xedd65b);}(_0xce1a,0xbf));var _0xace1=function(_0x29f353,_0x3d4a8e){_0x29f353=_0x29f353-0x0;var _0x27994e=_0xce1a[_0x29f353];return _0x27994e;};'use strict';var Sequelize=require(_0xace1('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xace1('0x1')]},'disposition':{'type':Sequelize[_0xace1('0x2')]},'secondDisposition':{'type':Sequelize[_0xace1('0x2')]},'thirdDisposition':{'type':Sequelize[_0xace1('0x2')]},'note':{'type':Sequelize[_0xace1('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xace1('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xace1('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xace1('0x4')]('in',_0xace1('0x3')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xace1('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xf350=['ENUM','sequelize','BOOLEAN','DATE','STRING'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0xf350,0x105));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0f35('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f35('0x2')]},'disposition':{'type':Sequelize[_0x0f35('0x3')]},'secondDisposition':{'type':Sequelize[_0x0f35('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0f35('0x3')]},'note':{'type':Sequelize[_0x0f35('0x3')]},'phone':{'type':Sequelize[_0x0f35('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f35('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0f35('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 711f62f..5d11cb1 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 _0x2164=['root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','lastName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','Users','map','TagIds','Tags','split','forEach','push','catch','SmsInteraction','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','select','field','name','color','u.fullname','from','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','parseSearch','search','sqlOperator','conditions','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','rows','params','include','options','create','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','rawAttributes','filter','format','includeAll','findAll','addTags','setTags','omit','spread','emit','download','unix','join'];(function(_0x3ec098,_0x5d6adf){var _0x25507c=function(_0x2c7cc0){while(--_0x2c7cc0){_0x3ec098['push'](_0x3ec098['shift']());}};_0x25507c(++_0x5d6adf);}(_0x2164,0xf9));var _0x4216=function(_0xf5e590,_0x506d65){_0xf5e590=_0xf5e590-0x0;var _0x5229b3=_0x2164[_0xf5e590];return _0x5229b3;};'use strict';var emlformat=require(_0x4216('0x0'));var rimraf=require(_0x4216('0x1'));var zipdir=require(_0x4216('0x2'));var jsonpatch=require(_0x4216('0x3'));var rp=require('request-promise');var moment=require(_0x4216('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4216('0x5'));var csv=require(_0x4216('0x6'));var ejs=require(_0x4216('0x7'));var fs=require('fs');var fs_extra=require(_0x4216('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4216('0x9'));var jsforce=require(_0x4216('0xa'));var deskjs=require(_0x4216('0xb'));var toCsv=require(_0x4216('0x6'));var querystring=require(_0x4216('0xc'));var Papa=require(_0x4216('0xd'));var Redis=require(_0x4216('0xe'));var authService=require(_0x4216('0xf'));var qs=require(_0x4216('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4216('0x11'));var hardwareService=require(_0x4216('0x12'));var logger=require(_0x4216('0x13'))(_0x4216('0x14'));var utils=require('../../config/utils');var config=require(_0x4216('0x15'));var licenseUtil=require(_0x4216('0x16'));var db=require(_0x4216('0x17'))['db'];config[_0x4216('0x18')]=_[_0x4216('0x19')](config[_0x4216('0x18')],{'host':_0x4216('0x1a'),'port':0x18eb});var socket=require(_0x4216('0x1b'))(new Redis(config['redis']));require(_0x4216('0x1c'))['register'](socket);function respondWithStatusCode(_0x4fff47,_0x445ec1){_0x445ec1=_0x445ec1||0xcc;return function(_0x45235d){if(_0x45235d){return _0x4fff47[_0x4216('0x1d')](_0x445ec1);}return _0x4fff47[_0x4216('0x1e')](_0x445ec1)['end']();};}function respondWithResult(_0x4ddf16,_0x72cfdb){_0x72cfdb=_0x72cfdb||0xc8;return function(_0x436607){if(_0x436607){return _0x4ddf16[_0x4216('0x1e')](_0x72cfdb)[_0x4216('0x1f')](_0x436607);}};}function respondWithFilteredResult(_0x36fbd1,_0x187202){return function(_0x411efb){if(_0x411efb){var _0x585f51=typeof _0x187202[_0x4216('0x20')]===_0x4216('0x21')&&typeof _0x187202[_0x4216('0x22')]==='undefined';var _0x3f9578=_0x411efb[_0x4216('0x23')];var _0x278168=_0x585f51?0x0:_0x187202[_0x4216('0x20')];var _0x500aa4=_0x585f51?_0x411efb[_0x4216('0x23')]:_0x187202[_0x4216('0x20')]+_0x187202[_0x4216('0x22')];var _0x2d4aa4;if(_0x500aa4>=_0x3f9578){_0x500aa4=_0x3f9578;_0x2d4aa4=0xc8;}else{_0x2d4aa4=0xce;}_0x36fbd1[_0x4216('0x1e')](_0x2d4aa4);return _0x36fbd1[_0x4216('0x24')](_0x4216('0x25'),_0x278168+'-'+_0x500aa4+'/'+_0x3f9578)[_0x4216('0x1f')](_0x411efb);}return null;};}function patchUpdates(_0x3f97f2){return function(_0x4e5355){try{jsonpatch['apply'](_0x4e5355,_0x3f97f2,!![]);}catch(_0x2a33f9){return BPromise[_0x4216('0x26')](_0x2a33f9);}return _0x4e5355[_0x4216('0x27')]();};}function saveUpdates(_0x303d6c,_0x4f0e7f){return function(_0x539dbc){if(_0x539dbc){return _0x539dbc[_0x4216('0x28')](_0x303d6c)[_0x4216('0x29')](function(_0x4493f5){return _0x4493f5;});}return null;};}function removeEntity(_0x1b928d,_0x955f96){return function(_0x545481){if(_0x545481){return _0x545481[_0x4216('0x2a')]()[_0x4216('0x29')](function(){_0x1b928d[_0x4216('0x1e')](0xcc)[_0x4216('0x2b')]();});}};}function handleEntityNotFound(_0x1e16e1,_0x4c34ff){return function(_0x1602d7){if(!_0x1602d7){_0x1e16e1[_0x4216('0x1d')](0x194);}return _0x1602d7;};}function handleError(_0x420a5a,_0x4b5d26){_0x4b5d26=_0x4b5d26||0x1f4;return function(_0x462692){logger[_0x4216('0x2c')](_0x462692[_0x4216('0x2d')]);if(_0x462692['name']){delete _0x462692['name'];}_0x420a5a[_0x4216('0x1e')](_0x4b5d26)['send'](_0x462692);};}function getInteractionUsers(_0x359667,_0x4e66e2){return new BPromise(function(_0x2eb9bb,_0x344505){try{if(_0x4e66e2[_0x359667['id']]){_0x359667[_0x4216('0x2e')]=_[_0x4216('0x2f')](_0x4e66e2[_0x359667['id']],function(_0x50364a){return{'id':_0x50364a['id'],'fullname':_0x50364a['fullname']};});}}catch(_0x1c902c){_0x344505(_0x1c902c);}_0x2eb9bb(_0x359667);});}function getInteractionTags(_0x4bfd70,_0x3304f5){return new BPromise(function(_0x7f1dab,_0x3752f2){try{if(_0x4bfd70[_0x4216('0x30')]){_0x4bfd70[_0x4216('0x31')]=[];_0x4bfd70[_0x4216('0x30')][_0x4216('0x32')](',')[_0x4216('0x33')](function(_0x252849){_0x4bfd70[_0x4216('0x31')][_0x4216('0x34')](_0x3304f5[_0x252849]);});}delete _0x4bfd70[_0x4216('0x30')];}catch(_0x2e8c5f){_0x3752f2(_0x2e8c5f);}_0x7f1dab(_0x4bfd70);});}function updateSmsInteraction(_0x446bfe,_0x5e145c,_0x2db861){return new BPromise(function(_0x5e6196,_0x48f1ce){return getInteractionUsers(_0x446bfe,_0x2db861)[_0x4216('0x29')](function(_0x13ccec){return getInteractionTags(_0x13ccec,_0x5e145c);})['then'](function(_0x29eb38){_0x5e6196(_0x29eb38);})[_0x4216('0x35')](function(_0x47290b){_0x48f1ce(_0x47290b);});});}exports['index']=function(_0x2edd9b,_0x4b099a){var _0x3808c7={},_0x3be650={},_0x7a1d24={'count':0x0,'rows':[]};var _0x53c25d=_[_0x4216('0x2f')](db[_0x4216('0x36')]['rawAttributes'],function(_0x434dc3){return{'name':_0x434dc3[_0x4216('0x37')],'type':_0x434dc3[_0x4216('0x38')][_0x4216('0x39')]};});_0x3be650[_0x4216('0x3a')]=_[_0x4216('0x2f')](_0x53c25d,'name');_0x3be650['query']=_[_0x4216('0x3b')](_0x2edd9b[_0x4216('0x3c')]);_0x3be650[_0x4216('0x3d')]=_['intersection'](_0x3be650['model'],_0x3be650[_0x4216('0x3c')]);_0x3808c7[_0x4216('0x3e')]=_[_0x4216('0x3f')](_0x3be650[_0x4216('0x3a')],qs[_0x4216('0x40')](_0x2edd9b[_0x4216('0x3c')][_0x4216('0x40')]));_0x3808c7[_0x4216('0x3e')]=_0x3808c7[_0x4216('0x3e')]['length']?_0x3808c7[_0x4216('0x3e')]:_0x3be650[_0x4216('0x3a')];if(!_0x2edd9b[_0x4216('0x3c')][_0x4216('0x41')](_0x4216('0x42'))){_0x3808c7[_0x4216('0x22')]=qs['limit'](_0x2edd9b['query']['limit']);_0x3808c7[_0x4216('0x20')]=qs[_0x4216('0x20')](_0x2edd9b[_0x4216('0x3c')][_0x4216('0x20')]);}_0x3808c7['order']=qs[_0x4216('0x43')](_0x2edd9b[_0x4216('0x3c')][_0x4216('0x43')]);_0x3808c7[_0x4216('0x44')]=qs['filters'](_['pick'](_0x2edd9b['query'],_0x3be650[_0x4216('0x3d')]),_0x53c25d);var _0x455b84=[];var _0x7a6cf7=squel[_0x4216('0x45')]()[_0x4216('0x46')]('id')['field'](_0x4216('0x47'))[_0x4216('0x46')](_0x4216('0x48'))['from']('tools_tags');var _0x2480f0=squel['select']()[_0x4216('0x46')]('u.id')[_0x4216('0x46')](_0x4216('0x49'))[_0x4216('0x46')]('ui.SmsInteractionId')[_0x4216('0x4a')](_0x4216('0x4b'),'ui')['left_join'](_0x4216('0x4c'),'u',_0x4216('0x4d'));var _0x11623a=squel['select']()[_0x4216('0x4a')](_0x4216('0x4e'),'i')[_0x4216('0x4f')]('cm_contacts','c',_0x4216('0x50'))[_0x4216('0x4f')](_0x4216('0x4c'),'o',_0x4216('0x51'))[_0x4216('0x4f')](_0x4216('0x52'),'a',_0x4216('0x53'))[_0x4216('0x4f')](_0x4216('0x54'),'me',_0x4216('0x55'))[_0x4216('0x4f')](_0x4216('0x56'),'it',_0x4216('0x57'))[_0x4216('0x4f')](_0x4216('0x58'),'t','t.id\x20=\x20it.TagId');var _0x40b958=squel['expr']();var _0x50db59=[];var _0x29e62b=squel['expr']();var _0x587fcb;if(_0x2edd9b[_0x4216('0x3c')]['search']){_0x587fcb=as[_0x4216('0x59')](_0x2edd9b[_0x4216('0x3c')][_0x4216('0x5a')]);var _0x3fda17=_0x587fcb[_0x4216('0x5b')];for(var _0x148d93=0x0;_0x148d93<_0x587fcb[_0x4216('0x5c')]['length'];_0x148d93++){var _0x53f6d3=_0x587fcb[_0x4216('0x5c')][_0x148d93];var _0x35c948='i';var _0x5139c8=_['find'](_0x53c25d,[_0x4216('0x47'),_0x53f6d3[_0x4216('0x46')]]);if(!_0x5139c8){switch(_0x53f6d3[_0x4216('0x46')]){case'unreadMessages':if(_0x53f6d3[_0x4216('0x5d')]==0x1){_0x11623a['having']('`'+_0x53f6d3[_0x4216('0x46')]+_0x4216('0x5e'));}else{_0x11623a[_0x4216('0x5f')]('`'+_0x53f6d3[_0x4216('0x46')]+_0x4216('0x60'));}break;case _0x4216('0x61'):if(_0x53f6d3[_0x4216('0x62')]===_0x4216('0x63')){if(_0x53f6d3[_0x4216('0x5d')]['split']('\x20')[_0x4216('0x64')]>0x1){_0x40b958[_0x3fda17](_0x4216('0x65'),qs[_0x4216('0x66')](_0x53f6d3[_0x4216('0x5d')]),null);}else{var _0x475ad6='%'+_0x53f6d3[_0x4216('0x5d')]+'%';_0x40b958[_0x3fda17]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x475ad6,_0x475ad6,_0x475ad6);}}else{_0x5139c8=_[_0x4216('0x67')](_0x53c25d,[_0x4216('0x47'),'ContactId']);_0x53f6d3['field']='ContactId';_0x2faae2=as[_0x4216('0x68')](_0x35c948,_0x5139c8[_0x4216('0x38')],_0x53f6d3);_0x40b958[_0x3fda17](_0x2faae2[_0x4216('0x69')],_0x2faae2['value'][_0x4216('0x6a')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x2b')]);}break;case _0x4216('0x6b'):var _0x334217=_0x53f6d3[_0x4216('0x5d')][_0x4216('0x32')](',')['map'](function(_0x216430){return Number(_0x216430);});_0x334217[_0x4216('0x33')](function(_0x47ea6c){_0x29e62b['or'](_0x4216('0x6c'),'%,'+_0x47ea6c+',%');});_0x50db59=_[_0x4216('0x6d')](_0x50db59,_0x334217);break;case _0x4216('0x6e'):if(_0x53f6d3[_0x4216('0x62')]===_0x4216('0x63')){_0x40b958[_0x3fda17](_0x4216('0x6f'),'%'+_0x53f6d3['value']+'%',null);}else{_0x5139c8=_[_0x4216('0x67')](_0x53c25d,[_0x4216('0x47'),_0x4216('0x70')]);_0x53f6d3[_0x4216('0x46')]=_0x4216('0x70');_0x2faae2=as[_0x4216('0x68')](_0x35c948,_0x5139c8[_0x4216('0x38')],_0x53f6d3);_0x40b958[_0x3fda17](_0x2faae2[_0x4216('0x69')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x6a')],_0x2faae2['value'][_0x4216('0x2b')]);}break;case'body':_0x2faae2=as['buildExpression']('me',null,_0x53f6d3);_0x40b958[_0x3fda17](_0x2faae2[_0x4216('0x69')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x6a')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x2b')]);break;}}else{var _0x2faae2=as['buildExpression'](_0x35c948,_0x5139c8['type'],_0x53f6d3);_0x40b958[_0x3fda17](_0x2faae2[_0x4216('0x69')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x6a')],_0x2faae2[_0x4216('0x5d')][_0x4216('0x2b')]);}}}else{var _0x3550cb=_(_0x2edd9b[_0x4216('0x3c')])[_0x4216('0x3b')]()['map'](function(_0x590eab){return _[_0x4216('0x71')](_0x53c25d,[_0x4216('0x47'),_0x590eab])?_0x590eab:undefined;})[_0x4216('0x72')]()['value']();if(!_[_0x4216('0x73')](_0x3550cb)){_0x3550cb[_0x4216('0x33')](function(_0x2d012a){if(_0x2d012a===_0x4216('0x74')){_0x11623a[_0x4216('0x44')](_0x4216('0x75'),[]['concat'](_0x2edd9b['query'][_0x2d012a]));}else if(_0x2d012a===_0x4216('0x76')){var _0x13b389=JSON['parse'](_0x2edd9b[_0x4216('0x3c')][_0x2d012a])[_0x4216('0x77')];var _0x2c227e=JSON[_0x4216('0x78')](_0x2edd9b[_0x4216('0x3c')][_0x2d012a])[_0x4216('0x79')];_0x11623a[_0x4216('0x44')](_0x4216('0x7a'),_0x13b389,_0x2c227e);}else{if(_0x2edd9b[_0x4216('0x3c')][_0x2d012a]===_0x4216('0x7b')){_0x11623a['where']('i.'+_0x2d012a+_0x4216('0x7c'));}else{_0x11623a[_0x4216('0x44')]('i.'+_0x2d012a+_0x4216('0x7d'),_0x2edd9b[_0x4216('0x3c')][_0x2d012a]);}}});}if(_0x2edd9b[_0x4216('0x3c')][_0x4216('0x7e')]){if(_0x2edd9b['query'][_0x4216('0x7e')]==0x1){_0x11623a[_0x4216('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x11623a[_0x4216('0x5f')](_0x4216('0x7f'));}}if(_0x2edd9b[_0x4216('0x3c')][_0x4216('0x80')]){_0x50db59=_[_0x4216('0x81')](_0x2edd9b[_0x4216('0x3c')][_0x4216('0x80')])?_0x2edd9b['query'][_0x4216('0x80')]:new Array(_0x2edd9b[_0x4216('0x3c')]['tag']);_0x50db59['forEach'](function(_0x4ed11e){_0x29e62b['or'](_0x4216('0x6c'),'%,'+_0x4ed11e+',%');});}if(_0x2edd9b['query']['filter']){var _0x5e1892=_0x2edd9b[_0x4216('0x3c')]['filter'][_0x4216('0x82')]('\x5c','\x5c\x5c')[_0x4216('0x82')](/'/g,'\x27\x27');if(qs[_0x4216('0x83')](_0x5e1892)){_0x40b958['or'](_0x4216('0x84'),_0x5e1892+'%')['or']('i.phone\x20LIKE\x20?',_0x5e1892+'%');}else{_0x40b958['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4216('0x66')](_0x5e1892))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5e1892+'%');}}}_0x11623a[_0x4216('0x44')](_0x40b958);_0x11623a[_0x4216('0x85')](_0x4216('0x86'));var _0x2a85b1={'type':db[_0x4216('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x8dbdc1=_0x11623a[_0x4216('0x88')]();_0x8dbdc1[_0x4216('0x46')](_0x4216('0x86'));_0x8dbdc1[_0x4216('0x46')](_0x4216('0x89'),_0x4216('0x8a'));if(_0x3808c7[_0x4216('0x8b')]){_0x3808c7[_0x4216('0x8b')][_0x4216('0x33')](function(_0x50ff23){var _0x2fc62f=_0x50ff23[0x0]==='contactName'?_0x50ff23[0x0]:'i.'+_0x50ff23[0x0];_0x11623a['order'](_0x2fc62f,_0x50ff23[0x1]===_0x4216('0x8c')?![]:!![]);});}if(!_[_0x4216('0x73')](_0x50db59)){_0x11623a['having'](_0x29e62b);_0x8dbdc1[_0x4216('0x44')](_0x4216('0x8d'),_0x50db59);}BPromise['resolve']()['then'](function(){if(!_0x587fcb){if(_0x2edd9b[_0x4216('0x3c')]['SmsAccountId'])return;_0x8dbdc1['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x11623a['where'](_0x4216('0x8e'));return;}if(_0x2edd9b[_0x4216('0x8f')][_0x4216('0x90')]!==_0x4216('0x91'))return;return _0x2edd9b[_0x4216('0x8f')][_0x4216('0x92')]({'attributes':['id'],'raw':!![]})[_0x4216('0x29')](function(_0x2782ad){if(_['isEmpty'](_0x2782ad)){_0x8dbdc1[_0x4216('0x44')](_0x4216('0x93'));_0x11623a[_0x4216('0x44')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x8dbdc1[_0x4216('0x44')](_0x4216('0x75'),_[_0x4216('0x2f')](_0x2782ad,'id'));_0x11623a[_0x4216('0x44')](_0x4216('0x75'),_[_0x4216('0x2f')](_0x2782ad,'id'));}});})[_0x4216('0x29')](function(){if(_0x2edd9b[_0x4216('0x8f')]['role']===_0x4216('0x91')&&!_0x587fcb&&!_0x2edd9b['query'][_0x4216('0x74')])return[];return db[_0x4216('0x94')][_0x4216('0x3c')](_0x8dbdc1[_0x4216('0x95')](),_0x2a85b1);})[_0x4216('0x29')](function(_0x202115){_0x7a1d24[_0x4216('0x23')]=_0x202115[_0x4216('0x64')];if(_0x7a1d24[_0x4216('0x23')]===0x0)return[];return db[_0x4216('0x94')][_0x4216('0x3c')](_0x7a6cf7['toString'](),_0x2a85b1)[_0x4216('0x29')](function(_0xf3740b){_0x455b84=_['keyBy'](_0xf3740b,'id');_0x2a85b1=_[_0x4216('0x96')](_0x2a85b1,{'model':db[_0x4216('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2edd9b[_0x4216('0x3c')]['fields']){_0x3808c7[_0x4216('0x3e')][_0x4216('0x33')](function(_0x3dcba0){_0x11623a[_0x4216('0x46')]('i.'+_0x3dcba0);});}else{_0x11623a[_0x4216('0x46')](_0x4216('0x89'),_0x4216('0x8a'));_0x11623a[_0x4216('0x46')](_0x4216('0x97'),'Account.key');_0x11623a['field'](_0x4216('0x98'),'Account.mandatoryDisposition');_0x11623a['field'](_0x4216('0x99'),'contactName');_0x11623a[_0x4216('0x46')](_0x4216('0x9a'));_0x11623a['field'](_0x4216('0x9b'),'Contact.firstName');_0x11623a['field'](_0x4216('0x9c'),_0x4216('0x9d'));_0x11623a[_0x4216('0x46')]('c.email',_0x4216('0x9e'));_0x11623a[_0x4216('0x46')](_0x4216('0x9f'),'Contact.phone');_0x11623a[_0x4216('0x46')](_0x4216('0xa0'),_0x4216('0xa1'));_0x11623a[_0x4216('0x46')](_0x4216('0xa2'),_0x4216('0xa3'));_0x11623a[_0x4216('0x46')]('o.fullname','Owner.fullname');_0x11623a[_0x4216('0x46')]('o.internal','Owner.internal');_0x11623a['field'](_0x4216('0xa4'),_0x4216('0x30'));}if(_0x3808c7[_0x4216('0x22')])_0x11623a[_0x4216('0x22')](_0x3808c7[_0x4216('0x22')]);if(_0x3808c7[_0x4216('0x20')])_0x11623a['offset'](_0x3808c7[_0x4216('0x20')]);return db['sequelize']['query'](_0x11623a[_0x4216('0x95')](),_0x2a85b1);})[_0x4216('0x29')](function(_0x313144){if(_0x313144[_0x4216('0x64')]>0x0)_0x2480f0[_0x4216('0x44')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x313144,'id'));return db['sequelize'][_0x4216('0x3c')](_0x2480f0['toString'](),_0x2a85b1)[_0x4216('0x29')](function(_0x4f6c50){var _0x3657ac=_[_0x4216('0xa5')](_0x4f6c50,'SmsInteractionId');var _0x30268e=[];_0x313144[_0x4216('0x33')](function(_0x20ae12){_0x30268e[_0x4216('0x34')](updateSmsInteraction(_0x20ae12,_0x455b84,_0x3657ac));});return BPromise['all'](_0x30268e);});});})['then'](function(_0x3602db){_0x7a1d24[_0x4216('0xa6')]=_0x3602db;return _0x7a1d24;})['then'](respondWithFilteredResult(_0x4b099a,_0x3808c7))['catch'](handleError(_0x4b099a,null));};exports['show']=function(_0x5ee220,_0x6acb48){var _0x813c60={'raw':![],'where':{'id':_0x5ee220[_0x4216('0xa7')]['id']}},_0x385d5e={};_0x385d5e['model']=_[_0x4216('0x3b')](db['SmsInteraction']['rawAttributes']);_0x385d5e[_0x4216('0x3c')]=_[_0x4216('0x3b')](_0x5ee220[_0x4216('0x3c')]);_0x385d5e[_0x4216('0x3d')]=_[_0x4216('0x3f')](_0x385d5e['model'],_0x385d5e[_0x4216('0x3c')]);_0x813c60[_0x4216('0x3e')]=_[_0x4216('0x3f')](_0x385d5e['model'],qs[_0x4216('0x40')](_0x5ee220['query'][_0x4216('0x40')]));_0x813c60[_0x4216('0x3e')]=_0x813c60[_0x4216('0x3e')][_0x4216('0x64')]?_0x813c60['attributes']:_0x385d5e['model'];if(_0x5ee220[_0x4216('0x3c')]['includeAll']){_0x813c60[_0x4216('0xa8')]=[{'all':!![]}];}_0x813c60=_['merge']({},_0x813c60,_0x5ee220[_0x4216('0xa9')]);return db[_0x4216('0x36')]['find'](_0x813c60)['then'](handleEntityNotFound(_0x6acb48,null))[_0x4216('0x29')](respondWithResult(_0x6acb48,null))[_0x4216('0x35')](handleError(_0x6acb48,null));};exports['create']=function(_0x5cde37,_0x76311d){return db[_0x4216('0x36')][_0x4216('0xaa')](_0x5cde37[_0x4216('0xab')],{})[_0x4216('0x29')](respondWithResult(_0x76311d,0xc9))['catch'](handleError(_0x76311d,null));};exports[_0x4216('0x28')]=function(_0x4543de,_0x18d744){if(_0x4543de[_0x4216('0xab')]['id']){delete _0x4543de['body']['id'];}return db[_0x4216('0x36')][_0x4216('0x67')]({'where':{'id':_0x4543de['params']['id']}})['then'](handleEntityNotFound(_0x18d744,null))[_0x4216('0x29')](saveUpdates(_0x4543de[_0x4216('0xab')],null))['then'](respondWithResult(_0x18d744,null))[_0x4216('0x35')](handleError(_0x18d744,null));};exports['destroy']=function(_0x3c23d9,_0x10b531){return db[_0x4216('0x36')][_0x4216('0x67')]({'where':{'id':_0x3c23d9[_0x4216('0xa7')]['id']}})[_0x4216('0x29')](handleEntityNotFound(_0x10b531,null))[_0x4216('0x29')](removeEntity(_0x10b531,null))[_0x4216('0x35')](handleError(_0x10b531,null));};exports[_0x4216('0xac')]=function(_0x22920d,_0x93ee37){return db[_0x4216('0x36')][_0x4216('0xac')]()[_0x4216('0x29')](respondWithResult(_0x93ee37,null))[_0x4216('0x35')](handleError(_0x93ee37,null));};exports[_0x4216('0xad')]=function(_0xa1605,_0x4cbcf1,_0x500022){return db[_0x4216('0xae')][_0x4216('0x67')]({'where':{'id':_0xa1605['params']['id']}})['then'](handleEntityNotFound(_0x4cbcf1,null))['then'](function(_0x23aa03){if(_0x23aa03){return _0x23aa03[_0x4216('0xad')](_0xa1605[_0x4216('0xab')][_0x4216('0xaf')],_['omit'](_0xa1605[_0x4216('0xab')],['ids','id'])||{});}})[_0x4216('0x29')](respondWithResult(_0x4cbcf1,null))[_0x4216('0x35')](handleError(_0x4cbcf1,null));};exports[_0x4216('0xb0')]=function(_0x5159b3,_0x2ad6bc,_0x2a8c6d){var _0x2247d1={'raw':![],'where':{}};var _0x494c4f={};var _0x32fe4e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x4216('0xb1')]({'where':{'id':_0x5159b3[_0x4216('0xa7')]['id']}})[_0x4216('0x29')](handleEntityNotFound(_0x2ad6bc,null))['then'](function(_0xb94142){if(_0xb94142){_0x494c4f['model']=_[_0x4216('0x3b')](db[_0x4216('0xae')][_0x4216('0xb2')]);_0x494c4f['query']=_[_0x4216('0x3b')](_0x5159b3[_0x4216('0x3c')]);_0x494c4f[_0x4216('0x3d')]=_[_0x4216('0x3f')](_0x494c4f[_0x4216('0x3a')],_0x494c4f[_0x4216('0x3c')]);_0x2247d1[_0x4216('0x3e')]=_[_0x4216('0x3f')](_0x494c4f[_0x4216('0x3a')],qs[_0x4216('0x40')](_0x5159b3[_0x4216('0x3c')][_0x4216('0x40')]));_0x2247d1[_0x4216('0x3e')]=_0x2247d1['attributes'][_0x4216('0x64')]?_0x2247d1['attributes']:_0x494c4f['model'];if(!_0x5159b3['query'][_0x4216('0x41')](_0x4216('0x42'))){_0x2247d1['limit']=qs[_0x4216('0x22')](_0x5159b3[_0x4216('0x3c')]['limit']);_0x2247d1[_0x4216('0x20')]=qs[_0x4216('0x20')](_0x5159b3[_0x4216('0x3c')][_0x4216('0x20')]);}_0x2247d1[_0x4216('0x8b')]=qs[_0x4216('0x43')](_0x5159b3[_0x4216('0x3c')][_0x4216('0x43')]);_0x2247d1[_0x4216('0x44')]=qs['filters'](_['pick'](_0x5159b3[_0x4216('0x3c')],_0x494c4f[_0x4216('0x3d')]));_0x2247d1[_0x4216('0x44')]['SmsInteractionId']=_0xb94142['id'];if(_0x5159b3[_0x4216('0x3c')][_0x4216('0xb3')]){_0x2247d1['where']=_[_0x4216('0x96')](_0x2247d1[_0x4216('0x44')],{'$or':_[_0x4216('0x2f')](_0x2247d1[_0x4216('0x3e')],function(_0x347f20){var _0x360a1a={};_0x360a1a[_0x347f20]={'$like':'%'+_0x5159b3[_0x4216('0x3c')][_0x4216('0xb3')]+'%'};return _0x360a1a;})});}if(_0x5159b3[_0x4216('0x3c')][_0x4216('0x77')]){var _0x1ccb12=_0x5159b3[_0x4216('0x3c')][_0x4216('0x77')][_0x4216('0x32')](',');var _0x3107e1={};_0x3107e1[_0x1ccb12[0x0]]={'$gte':moment(_0x1ccb12[0x1])[_0x4216('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2247d1[_0x4216('0x44')]=_[_0x4216('0x96')](_0x2247d1[_0x4216('0x44')],_0x3107e1);}_0x2247d1=_[_0x4216('0x96')]({},_0x2247d1,_0x5159b3[_0x4216('0xa9')]);return db['SmsMessage'][_0x4216('0x23')]({'where':_0x2247d1[_0x4216('0x44')]})['then'](function(_0x48cb54){_0x32fe4e[_0x4216('0x23')]=_0x48cb54;if(_0x5159b3[_0x4216('0x3c')][_0x4216('0xb5')]){_0x2247d1[_0x4216('0xa8')]=[{'all':!![]}];}return db['SmsMessage'][_0x4216('0xb6')](_0x2247d1);})[_0x4216('0x29')](function(_0x1fd27c){_0x32fe4e['rows']=_0x1fd27c;return _0x32fe4e;});}})[_0x4216('0x29')](respondWithFilteredResult(_0x2ad6bc,_0x2247d1))[_0x4216('0x35')](handleError(_0x2ad6bc,null));};exports[_0x4216('0xb7')]=function(_0x4157c4,_0x1ddae0,_0x108d6b){return db['SmsInteraction'][_0x4216('0x67')]({'where':{'id':_0x4157c4['params']['id']}})[_0x4216('0x29')](handleEntityNotFound(_0x1ddae0,null))[_0x4216('0x29')](function(_0x2e6972){if(_0x2e6972){return _0x2e6972[_0x4216('0xb8')](_0x4157c4[_0x4216('0xab')]['ids'],_[_0x4216('0xb9')](_0x4157c4[_0x4216('0xab')],[_0x4216('0xaf'),'id'])||{})[_0x4216('0xba')](function(){return db[_0x4216('0x6b')]['findAll']({'attributes':['id',_0x4216('0x47'),_0x4216('0x48')],'where':{'id':_0x4157c4[_0x4216('0xab')][_0x4216('0xaf')]}});})['then'](function(_0x1bf8f3){socket[_0x4216('0xbb')]('smsInteractionTags:save',{'id':Number(_0x4157c4[_0x4216('0xa7')]['id']),'tags':_0x1bf8f3||[]});return{'id':Number(_0x4157c4[_0x4216('0xa7')]['id']),'tags':_0x1bf8f3||[]};});}})[_0x4216('0x29')](respondWithResult(_0x1ddae0,null))['catch'](handleError(_0x1ddae0,null));};exports['removeTags']=function(_0x23a234,_0x2a60cf,_0x5a473d){return db[_0x4216('0x36')][_0x4216('0x67')]({'where':{'id':_0x23a234[_0x4216('0xa7')]['id']}})[_0x4216('0x29')](handleEntityNotFound(_0x2a60cf,null))[_0x4216('0x29')](function(_0x1e5d78){if(_0x1e5d78){return _0x1e5d78['removeTags'](_0x23a234[_0x4216('0x3c')]['ids']);}})[_0x4216('0x29')](respondWithStatusCode(_0x2a60cf,null))[_0x4216('0x35')](handleError(_0x2a60cf,null));};exports[_0x4216('0xbc')]=function(_0x36b377,_0x2e30db){var _0x3af4ff=moment()[_0x4216('0xbd')]()[_0x4216('0x95')]();var _0x94dc03=path[_0x4216('0xbe')](config[_0x4216('0xbf')],_0x4216('0xc0'),_0x4216('0xc1'),_0x4216('0xc2'));var _0x4d6478=path[_0x4216('0xbe')](config['root'],_0x4216('0xc0'),'files',_0x4216('0xc3'));var _0x59f86a=path[_0x4216('0xbe')](_0x94dc03,_0x3af4ff);var _0x100e59=util[_0x4216('0xb4')](_0x4216('0xc4'),_0x36b377[_0x4216('0xa7')]['id'],_0x3af4ff);var _0x4395d9=path[_0x4216('0xbe')](_0x94dc03,_0x100e59);var _0x534298=[];_0x534298[_0x4216('0x34')]({'model':db['User'],'as':'User','attributes':['id',_0x4216('0xc5')],'raw':!![]});_0x534298[_0x4216('0x34')]({'model':db[_0x4216('0xc6')],'as':_0x4216('0x61'),'attributes':['id','firstName',_0x4216('0xc7')],'raw':!![]});var _0x38895e=[{'model':db[_0x4216('0xae')],'as':_0x4216('0xc8'),'attributes':['id',_0x4216('0xab'),_0x4216('0x76'),'direction',_0x4216('0xc9'),_0x4216('0x7e')],'include':_0x534298}];_0x38895e['push']({'model':db[_0x4216('0xca')],'as':_0x4216('0xcb'),'attributes':['id',_0x4216('0x47')]});_0x38895e[_0x4216('0x34')]({'model':db[_0x4216('0x6e')],'as':_0x4216('0xcc'),'attributes':['id',_0x4216('0xc5')]});return db['SmsInteraction'][_0x4216('0x67')]({'where':{'id':_0x36b377[_0x4216('0xa7')]['id']},'include':_0x38895e})[_0x4216('0x29')](handleEntityNotFound(_0x2e30db,null))[_0x4216('0x29')](function(_0x5cff2e){if(_0x5cff2e){var _0x5b0577=_0x5cff2e[_0x4216('0xcd')]({'plain':!![]});fs[_0x4216('0xce')](_0x59f86a);var _0x18fc2f={'channel':_0x4216('0xcf'),'account':_0x5b0577[_0x4216('0xcb')][_0x4216('0x47')],'agent':_0x5b0577[_0x4216('0xcc')]?_0x5b0577[_0x4216('0xcc')][_0x4216('0xc5')]:'N.A.','createdAt':moment(_0x5b0577[_0x4216('0x76')])[_0x4216('0xb4')](_0x4216('0xd0'))[_0x4216('0x95')](),'closedAt':_0x5b0577[_0x4216('0xd1')]?moment(_0x5b0577['closedAt'])[_0x4216('0xb4')](_0x4216('0xd0'))[_0x4216('0x95')]():'','disposition':_0x5b0577['disposition'],'messages':_(_0x5b0577['Messages'])[_0x4216('0xb3')]({'secret':![]})[_0x4216('0x2f')](function(_0x5046a5){return{'date':moment(_0x5046a5[_0x4216('0x76')])[_0x4216('0xb4')](_0x4216('0xd0'))['toString'](),'sender':_0x5046a5['direction']==='out'?_0x5046a5[_0x4216('0x6e')]?_0x5046a5[_0x4216('0x6e')][_0x4216('0xc5')]:_0x4216('0xd2'):_0x5046a5[_0x4216('0x61')][_0x4216('0xd3')]+(_0x5046a5[_0x4216('0x61')][_0x4216('0xc7')]?'\x20'+_0x5046a5[_0x4216('0x61')][_0x4216('0xc7')]:''),'body':_0x5046a5[_0x4216('0xab')],'direction':_0x5046a5['direction']==='out'?'A':'C','secret':_0x5046a5[_0x4216('0xc9')],'read':_0x5046a5[_0x4216('0x7e')]};})[_0x4216('0x5d')]()};return ejs[_0x4216('0xd4')](path[_0x4216('0xbe')](config[_0x4216('0xbf')],_0x4216('0xc0'),_0x4216('0xd5'),_0x4216('0xd6')),{'interaction':_0x18fc2f})[_0x4216('0x29')](function(_0x56f035){var _0x57beb7=path[_0x4216('0xbe')](_0x59f86a,_0x4216('0xd7')+_0x5b0577['id']+'-'+_0x3af4ff+_0x4216('0xd8'));var _0x48728a={'path':_0x57beb7,'channel':_0x4216('0xcf'),'interactionId':_0x5b0577['id']};return pdf['createPdfFromHTML'](_0x56f035,_0x48728a);})[_0x4216('0x29')](function(){return new BPromise(function(_0x135624,_0x2522a5){zipdir(_0x59f86a,{'saveTo':_0x4395d9},function(_0x4e6d45,_0x300dcd){if(_0x4e6d45)return _0x2522a5(_0x4e6d45);return _0x135624(_0x300dcd);});})[_0x4216('0x29')](function(){return new BPromise(function(_0x4e7b36,_0xdce088){rimraf(_0x59f86a,function(_0x4f09e6){if(_0x4f09e6)_0xdce088(_0x4f09e6);return _0x4e7b36();});});})[_0x4216('0x29')](function(){return _0x2e30db[_0x4216('0xbc')](_0x4395d9,_0x100e59,function(_0x32e546){if(_0x32e546){console[_0x4216('0xd9')](_0x4216('0xda'),_0x32e546);}else{fs[_0x4216('0xdb')](_0x4395d9);}});});});}else{return _0x2e30db['sendStatus'](0xc8);}})[_0x4216('0x35')](handleError(_0x2e30db,null));}; \ No newline at end of file +var _0x7a7a=['contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','SmsInteractionId','rows','catch','show','create','body','params','describe','addMessage','SmsMessage','ids','getMessages','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','addTags','setTags','omit','spread','findAll','smsInteractionTags:save','removeTags','download','server','join','root','attachments','format','transcript-%d-%s.zip','Contact','lastName','Messages','direction','secret','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closed','closedAt','disposition','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','Tags','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','buildExpression','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)'];(function(_0x3070ec,_0x4c4d59){var _0x39aef3=function(_0x46987f){while(--_0x46987f){_0x3070ec['push'](_0x3070ec['shift']());}};_0x39aef3(++_0x4c4d59);}(_0x7a7a,0x140));var _0xa7a7=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x7a7a[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa7a7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7a7('0x1'));var moment=require(_0xa7a7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa7a7('0x3'));var path=require(_0xa7a7('0x4'));var sox=require(_0xa7a7('0x5'));var csv=require('to-csv');var ejs=require(_0xa7a7('0x6'));var fs=require('fs');var fs_extra=require(_0xa7a7('0x7'));var _=require(_0xa7a7('0x8'));var squel=require('squel');var crypto=require(_0xa7a7('0x9'));var jsforce=require(_0xa7a7('0xa'));var deskjs=require(_0xa7a7('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa7a7('0xc'));var Redis=require(_0xa7a7('0xd'));var authService=require(_0xa7a7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa7a7('0xf'));var pdf=require(_0xa7a7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a7('0x11'))(_0xa7a7('0x12'));var utils=require(_0xa7a7('0x13'));var config=require(_0xa7a7('0x14'));var licenseUtil=require(_0xa7a7('0x15'));var db=require('../../mysqldb')['db'];config[_0xa7a7('0x16')]=_['defaults'](config[_0xa7a7('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7a7('0x16')]));require(_0xa7a7('0x17'))[_0xa7a7('0x18')](socket);function respondWithStatusCode(_0x13b98c,_0x2212e3){_0x2212e3=_0x2212e3||0xcc;return function(_0x1ef89c){if(_0x1ef89c){return _0x13b98c['sendStatus'](_0x2212e3);}return _0x13b98c[_0xa7a7('0x19')](_0x2212e3)[_0xa7a7('0x1a')]();};}function respondWithResult(_0x68d2c4,_0x48246d){_0x48246d=_0x48246d||0xc8;return function(_0x854fe2){if(_0x854fe2){return _0x68d2c4['status'](_0x48246d)[_0xa7a7('0x1b')](_0x854fe2);}};}function respondWithFilteredResult(_0x3f1384,_0x533fe8){return function(_0x2c955d){if(_0x2c955d){var _0x1fb868=typeof _0x533fe8[_0xa7a7('0x1c')]===_0xa7a7('0x1d')&&typeof _0x533fe8[_0xa7a7('0x1e')]===_0xa7a7('0x1d');var _0x5a0af3=_0x2c955d[_0xa7a7('0x1f')];var _0x55cb11=_0x1fb868?0x0:_0x533fe8[_0xa7a7('0x1c')];var _0xd8be63=_0x1fb868?_0x2c955d[_0xa7a7('0x1f')]:_0x533fe8[_0xa7a7('0x1c')]+_0x533fe8[_0xa7a7('0x1e')];var _0x237032;if(_0xd8be63>=_0x5a0af3){_0xd8be63=_0x5a0af3;_0x237032=0xc8;}else{_0x237032=0xce;}_0x3f1384[_0xa7a7('0x19')](_0x237032);return _0x3f1384[_0xa7a7('0x20')]('Content-Range',_0x55cb11+'-'+_0xd8be63+'/'+_0x5a0af3)[_0xa7a7('0x1b')](_0x2c955d);}return null;};}function patchUpdates(_0xfdcfdf){return function(_0x92cb7f){try{jsonpatch[_0xa7a7('0x21')](_0x92cb7f,_0xfdcfdf,!![]);}catch(_0x1b436a){return BPromise[_0xa7a7('0x22')](_0x1b436a);}return _0x92cb7f[_0xa7a7('0x23')]();};}function saveUpdates(_0x3bd5b5,_0x3db3d8){return function(_0x903914){if(_0x903914){return _0x903914[_0xa7a7('0x24')](_0x3bd5b5)[_0xa7a7('0x25')](function(_0xe765ea){return _0xe765ea;});}return null;};}function removeEntity(_0x455454,_0xa6796){return function(_0x3a6731){if(_0x3a6731){return _0x3a6731[_0xa7a7('0x26')]()[_0xa7a7('0x25')](function(){_0x455454[_0xa7a7('0x19')](0xcc)[_0xa7a7('0x1a')]();});}};}function handleEntityNotFound(_0x140f69,_0x268493){return function(_0x315c8f){if(!_0x315c8f){_0x140f69[_0xa7a7('0x27')](0x194);}return _0x315c8f;};}function handleError(_0x12440a,_0x251ec8){_0x251ec8=_0x251ec8||0x1f4;return function(_0x3e1b91){logger[_0xa7a7('0x28')](_0x3e1b91[_0xa7a7('0x29')]);if(_0x3e1b91[_0xa7a7('0x2a')]){delete _0x3e1b91[_0xa7a7('0x2a')];}_0x12440a[_0xa7a7('0x19')](_0x251ec8)[_0xa7a7('0x2b')](_0x3e1b91);};}function getInteractionUsers(_0x101aec,_0x49cd54){return new BPromise(function(_0x3241d5,_0x9ba18a){try{if(_0x49cd54[_0x101aec['id']]){_0x101aec[_0xa7a7('0x2c')]=_[_0xa7a7('0x2d')](_0x49cd54[_0x101aec['id']],function(_0x14cb82){return{'id':_0x14cb82['id'],'fullname':_0x14cb82[_0xa7a7('0x2e')]};});}}catch(_0x5b1bc7){_0x9ba18a(_0x5b1bc7);}_0x3241d5(_0x101aec);});}function getInteractionTags(_0x4efef3,_0x195943){return new BPromise(function(_0x2a2db1,_0x100772){try{if(_0x4efef3['TagIds']){_0x4efef3[_0xa7a7('0x2f')]=[];_0x4efef3['TagIds'][_0xa7a7('0x30')](',')[_0xa7a7('0x31')](function(_0x18da9d){_0x4efef3['Tags'][_0xa7a7('0x32')](_0x195943[_0x18da9d]);});}delete _0x4efef3['TagIds'];}catch(_0x483ad7){_0x100772(_0x483ad7);}_0x2a2db1(_0x4efef3);});}function updateSmsInteraction(_0x43a631,_0xf83a51,_0x20dc9a){return new BPromise(function(_0x217ba0,_0x2a2abf){return getInteractionUsers(_0x43a631,_0x20dc9a)[_0xa7a7('0x25')](function(_0x208a14){return getInteractionTags(_0x208a14,_0xf83a51);})[_0xa7a7('0x25')](function(_0x3e53a2){_0x217ba0(_0x3e53a2);})['catch'](function(_0x2d3d63){_0x2a2abf(_0x2d3d63);});});}exports[_0xa7a7('0x33')]=function(_0x3cc234,_0x3239e8){var _0x322dc0={},_0x118684={},_0x560c9a={'count':0x0,'rows':[]};var _0x368c59=_[_0xa7a7('0x2d')](db[_0xa7a7('0x34')][_0xa7a7('0x35')],function(_0x380b9b){return{'name':_0x380b9b[_0xa7a7('0x36')],'type':_0x380b9b[_0xa7a7('0x37')]['key']};});_0x118684[_0xa7a7('0x38')]=_[_0xa7a7('0x2d')](_0x368c59,'name');_0x118684[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x3cc234[_0xa7a7('0x39')]);_0x118684[_0xa7a7('0x3b')]=_[_0xa7a7('0x3c')](_0x118684[_0xa7a7('0x38')],_0x118684[_0xa7a7('0x39')]);_0x322dc0[_0xa7a7('0x3d')]=_['intersection'](_0x118684['model'],qs[_0xa7a7('0x3e')](_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x3e')]));_0x322dc0[_0xa7a7('0x3d')]=_0x322dc0[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x322dc0[_0xa7a7('0x3d')]:_0x118684['model'];if(!_0x3cc234[_0xa7a7('0x39')]['hasOwnProperty'](_0xa7a7('0x40'))){_0x322dc0[_0xa7a7('0x1e')]=qs[_0xa7a7('0x1e')](_0x3cc234[_0xa7a7('0x39')]['limit']);_0x322dc0[_0xa7a7('0x1c')]=qs['offset'](_0x3cc234[_0xa7a7('0x39')]['offset']);}_0x322dc0[_0xa7a7('0x41')]=qs[_0xa7a7('0x42')](_0x3cc234['query'][_0xa7a7('0x42')]);_0x322dc0['where']=qs['filters'](_[_0xa7a7('0x43')](_0x3cc234[_0xa7a7('0x39')],_0x118684['filters']),_0x368c59);var _0x535e05=[];var _0x192e18=squel[_0xa7a7('0x44')]()[_0xa7a7('0x45')]('id')[_0xa7a7('0x45')]('name')['field'](_0xa7a7('0x46'))[_0xa7a7('0x47')](_0xa7a7('0x48'));var _0x12c67e=squel[_0xa7a7('0x44')]()[_0xa7a7('0x45')]('u.id')[_0xa7a7('0x45')](_0xa7a7('0x49'))[_0xa7a7('0x45')](_0xa7a7('0x4a'))['from'](_0xa7a7('0x4b'),'ui')[_0xa7a7('0x4c')](_0xa7a7('0x4d'),'u',_0xa7a7('0x4e'));var _0x5998a0=squel[_0xa7a7('0x44')]()[_0xa7a7('0x47')](_0xa7a7('0x4f'),'i')[_0xa7a7('0x4c')](_0xa7a7('0x50'),'c',_0xa7a7('0x51'))['left_join']('users','o',_0xa7a7('0x52'))[_0xa7a7('0x4c')](_0xa7a7('0x53'),'a',_0xa7a7('0x54'))['left_join'](_0xa7a7('0x55'),'me',_0xa7a7('0x56'))[_0xa7a7('0x4c')](_0xa7a7('0x57'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xa7a7('0x4c')](_0xa7a7('0x48'),'t',_0xa7a7('0x58'));var _0x56f4da=squel[_0xa7a7('0x59')]();var _0x432956=[];var _0x3bb2e1=squel[_0xa7a7('0x59')]();var _0x5753a1;if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x5a')]){_0x5753a1=as[_0xa7a7('0x5b')](_0x3cc234[_0xa7a7('0x39')]['search']);var _0x16ec20=_0x5753a1['sqlOperator'];for(var _0x18b352=0x0;_0x18b352<_0x5753a1[_0xa7a7('0x5c')][_0xa7a7('0x3f')];_0x18b352++){var _0x445c68=_0x5753a1[_0xa7a7('0x5c')][_0x18b352];var _0x4bdcaf='i';var _0x49ee2c=_[_0xa7a7('0x5d')](_0x368c59,['name',_0x445c68[_0xa7a7('0x45')]]);if(!_0x49ee2c){switch(_0x445c68[_0xa7a7('0x45')]){case _0xa7a7('0x5e'):if(_0x445c68[_0xa7a7('0x5f')]==0x1){_0x5998a0['having']('`'+_0x445c68['field']+'`\x20=\x200');}else{_0x5998a0[_0xa7a7('0x60')]('`'+_0x445c68[_0xa7a7('0x45')]+_0xa7a7('0x61'));}break;case'Contact':if(_0x445c68[_0xa7a7('0x62')]==='$substring'){if(_0x445c68[_0xa7a7('0x5f')][_0xa7a7('0x30')]('\x20')[_0xa7a7('0x3f')]>0x1){_0x56f4da[_0x16ec20](_0xa7a7('0x63'),qs[_0xa7a7('0x64')](_0x445c68[_0xa7a7('0x5f')]),null);}else{var _0x1665ff='%'+_0x445c68['value']+'%';_0x56f4da[_0x16ec20]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1665ff,_0x1665ff,_0x1665ff);}}else{_0x49ee2c=_['find'](_0x368c59,[_0xa7a7('0x2a'),_0xa7a7('0x65')]);_0x445c68[_0xa7a7('0x45')]=_0xa7a7('0x65');_0xc397f4=as['buildExpression'](_0x4bdcaf,_0x49ee2c[_0xa7a7('0x37')],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4['value'][_0xa7a7('0x1a')]);}break;case _0xa7a7('0x68'):var _0x2af412=_0x445c68['value'][_0xa7a7('0x30')](',')['map'](function(_0x977dd5){return Number(_0x977dd5);});_0x2af412['forEach'](function(_0x459269){_0x3bb2e1['or'](_0xa7a7('0x69'),'%,'+_0x459269+',%');});_0x432956=_[_0xa7a7('0x6a')](_0x432956,_0x2af412);break;case _0xa7a7('0x6b'):if(_0x445c68[_0xa7a7('0x62')]===_0xa7a7('0x6c')){_0x56f4da[_0x16ec20]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x445c68[_0xa7a7('0x5f')]+'%',null);}else{_0x49ee2c=_[_0xa7a7('0x5d')](_0x368c59,[_0xa7a7('0x2a'),_0xa7a7('0x6d')]);_0x445c68['field']='UserId';_0xc397f4=as[_0xa7a7('0x6e')](_0x4bdcaf,_0x49ee2c[_0xa7a7('0x37')],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x1a')]);}break;case'body':_0xc397f4=as['buildExpression']('me',null,_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4['text'],_0xc397f4['value'][_0xa7a7('0x67')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x1a')]);break;}}else{var _0xc397f4=as[_0xa7a7('0x6e')](_0x4bdcaf,_0x49ee2c['type'],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4['value'][_0xa7a7('0x1a')]);}}}else{var _0x2e8784=_(_0x3cc234[_0xa7a7('0x39')])[_0xa7a7('0x3a')]()[_0xa7a7('0x2d')](function(_0x584d72){return _[_0xa7a7('0x6f')](_0x368c59,[_0xa7a7('0x2a'),_0x584d72])?_0x584d72:undefined;})[_0xa7a7('0x70')]()[_0xa7a7('0x5f')]();if(!_[_0xa7a7('0x71')](_0x2e8784)){_0x2e8784[_0xa7a7('0x31')](function(_0xed56b7){if(_0xed56b7===_0xa7a7('0x72')){_0x5998a0['where'](_0xa7a7('0x73'),[][_0xa7a7('0x74')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7]));}else if(_0xed56b7==='createdAt'){var _0x57371f=JSON[_0xa7a7('0x75')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7])['$gte'];var _0x5d4129=JSON[_0xa7a7('0x75')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7])[_0xa7a7('0x76')];_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x78'),_0x57371f,_0x5d4129);}else{if(_0x3cc234[_0xa7a7('0x39')][_0xed56b7]===_0xa7a7('0x79')){_0x5998a0[_0xa7a7('0x77')]('i.'+_0xed56b7+_0xa7a7('0x7a'));}else{_0x5998a0[_0xa7a7('0x77')]('i.'+_0xed56b7+_0xa7a7('0x7b'),_0x3cc234[_0xa7a7('0x39')][_0xed56b7]);}}});}if(_0x3cc234['query'][_0xa7a7('0x7c')]){if(_0x3cc234['query'][_0xa7a7('0x7c')]==0x1){_0x5998a0[_0xa7a7('0x60')](_0xa7a7('0x7d'));}else{_0x5998a0['having'](_0xa7a7('0x7e'));}}if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')]){_0x432956=_[_0xa7a7('0x80')](_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')])?_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')]:new Array(_0x3cc234['query'][_0xa7a7('0x7f')]);_0x432956['forEach'](function(_0x446e46){_0x3bb2e1['or'](_0xa7a7('0x69'),'%,'+_0x446e46+',%');});}if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x81')]){var _0xcaa26a=_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x81')][_0xa7a7('0x82')]('\x5c','\x5c\x5c')[_0xa7a7('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcaa26a)){_0x56f4da['or'](_0xa7a7('0x83'),_0xcaa26a+'%')['or'](_0xa7a7('0x84'),_0xcaa26a+'%');}else{_0x56f4da['or'](_0xa7a7('0x85'),qs[_0xa7a7('0x64')](_0xcaa26a))['or'](_0xa7a7('0x86'),_0xcaa26a+'%');}}}_0x5998a0[_0xa7a7('0x77')](_0x56f4da);_0x5998a0[_0xa7a7('0x87')](_0xa7a7('0x88'));var _0x2ae19f={'type':db[_0xa7a7('0x89')][_0xa7a7('0x8a')][_0xa7a7('0x8b')],'raw':!![]};var _0x3ceeaa=_0x5998a0[_0xa7a7('0x8c')]();_0x3ceeaa[_0xa7a7('0x45')](_0xa7a7('0x88'));_0x3ceeaa[_0xa7a7('0x45')](_0xa7a7('0x8d'),'unreadMessages');if(_0x322dc0['order']){_0x322dc0[_0xa7a7('0x41')]['forEach'](function(_0x2d483d){var _0x570412=_0x2d483d[0x0]===_0xa7a7('0x8e')?_0x2d483d[0x0]:'i.'+_0x2d483d[0x0];_0x5998a0[_0xa7a7('0x41')](_0x570412,_0x2d483d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x432956)){_0x5998a0[_0xa7a7('0x60')](_0x3bb2e1);_0x3ceeaa[_0xa7a7('0x77')](_0xa7a7('0x8f'),_0x432956);}BPromise[_0xa7a7('0x90')]()[_0xa7a7('0x25')](function(){if(!_0x5753a1){if(_0x3cc234[_0xa7a7('0x39')]['SmsAccountId'])return;_0x3ceeaa[_0xa7a7('0x77')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x91'));return;}if(_0x3cc234[_0xa7a7('0x92')][_0xa7a7('0x93')]!==_0xa7a7('0x94'))return;return _0x3cc234['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x46f369){if(_[_0xa7a7('0x71')](_0x46f369)){_0x3ceeaa['where'](_0xa7a7('0x95'));_0x5998a0[_0xa7a7('0x77')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x3ceeaa[_0xa7a7('0x77')](_0xa7a7('0x73'),_[_0xa7a7('0x2d')](_0x46f369,'id'));_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x73'),_['map'](_0x46f369,'id'));}});})[_0xa7a7('0x25')](function(){if(_0x3cc234[_0xa7a7('0x92')][_0xa7a7('0x93')]===_0xa7a7('0x94')&&!_0x5753a1&&!_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x72')])return[];return db[_0xa7a7('0x96')]['query'](_0x3ceeaa[_0xa7a7('0x97')](),_0x2ae19f);})[_0xa7a7('0x25')](function(_0x25d141){_0x560c9a[_0xa7a7('0x1f')]=_0x25d141[_0xa7a7('0x3f')];if(_0x560c9a['count']===0x0)return[];return db['sequelize'][_0xa7a7('0x39')](_0x192e18[_0xa7a7('0x97')](),_0x2ae19f)[_0xa7a7('0x25')](function(_0x319dfc){_0x535e05=_['keyBy'](_0x319dfc,'id');_0x2ae19f=_[_0xa7a7('0x98')](_0x2ae19f,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x3e')]){_0x322dc0[_0xa7a7('0x3d')][_0xa7a7('0x31')](function(_0x189193){_0x5998a0[_0xa7a7('0x45')]('i.'+_0x189193);});}else{_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x8d'),_0xa7a7('0x5e'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x99'),'Account.key');_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9a'),_0xa7a7('0x9b'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9c'),_0xa7a7('0x8e'));_0x5998a0['field'](_0xa7a7('0x9d'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9e'),'Contact.firstName');_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9f'),_0xa7a7('0xa0'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa1'),_0xa7a7('0xa2'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa3'),_0xa7a7('0xa4'));_0x5998a0[_0xa7a7('0x45')]('c.mobile',_0xa7a7('0xa5'));_0x5998a0[_0xa7a7('0x45')]('c.fax',_0xa7a7('0xa6'));_0x5998a0[_0xa7a7('0x45')]('o.fullname',_0xa7a7('0xa7'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa8'),_0xa7a7('0xa9'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xaa'),_0xa7a7('0xab'));}if(_0x322dc0[_0xa7a7('0x1e')])_0x5998a0['limit'](_0x322dc0[_0xa7a7('0x1e')]);if(_0x322dc0[_0xa7a7('0x1c')])_0x5998a0[_0xa7a7('0x1c')](_0x322dc0[_0xa7a7('0x1c')]);return db[_0xa7a7('0x96')][_0xa7a7('0x39')](_0x5998a0[_0xa7a7('0x97')](),_0x2ae19f);})[_0xa7a7('0x25')](function(_0x584b91){if(_0x584b91[_0xa7a7('0x3f')]>0x0)_0x12c67e['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x584b91,'id'));return db[_0xa7a7('0x96')][_0xa7a7('0x39')](_0x12c67e[_0xa7a7('0x97')](),_0x2ae19f)['then'](function(_0x13469b){var _0x472092=_[_0xa7a7('0xac')](_0x13469b,_0xa7a7('0xad'));var _0x12135c=[];_0x584b91[_0xa7a7('0x31')](function(_0x3063e1){_0x12135c['push'](updateSmsInteraction(_0x3063e1,_0x535e05,_0x472092));});return BPromise['all'](_0x12135c);});});})[_0xa7a7('0x25')](function(_0x524ddb){_0x560c9a[_0xa7a7('0xae')]=_0x524ddb;return _0x560c9a;})[_0xa7a7('0x25')](respondWithFilteredResult(_0x3239e8,_0x322dc0))[_0xa7a7('0xaf')](handleError(_0x3239e8,null));};exports[_0xa7a7('0xb0')]=function(_0x21cb14,_0x23a0f0){var _0x284e42={'raw':![],'where':{'id':_0x21cb14['params']['id']}},_0x36045e={};_0x36045e[_0xa7a7('0x38')]=_[_0xa7a7('0x3a')](db['SmsInteraction'][_0xa7a7('0x35')]);_0x36045e[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x21cb14[_0xa7a7('0x39')]);_0x36045e[_0xa7a7('0x3b')]=_['intersection'](_0x36045e[_0xa7a7('0x38')],_0x36045e[_0xa7a7('0x39')]);_0x284e42['attributes']=_[_0xa7a7('0x3c')](_0x36045e[_0xa7a7('0x38')],qs[_0xa7a7('0x3e')](_0x21cb14[_0xa7a7('0x39')]['fields']));_0x284e42[_0xa7a7('0x3d')]=_0x284e42[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x284e42[_0xa7a7('0x3d')]:_0x36045e[_0xa7a7('0x38')];if(_0x21cb14['query']['includeAll']){_0x284e42['include']=[{'all':!![]}];}_0x284e42=_[_0xa7a7('0x98')]({},_0x284e42,_0x21cb14['options']);return db[_0xa7a7('0x34')][_0xa7a7('0x5d')](_0x284e42)[_0xa7a7('0x25')](handleEntityNotFound(_0x23a0f0,null))[_0xa7a7('0x25')](respondWithResult(_0x23a0f0,null))['catch'](handleError(_0x23a0f0,null));};exports[_0xa7a7('0xb1')]=function(_0x45325b,_0x823d4f){return db[_0xa7a7('0x34')][_0xa7a7('0xb1')](_0x45325b[_0xa7a7('0xb2')],{})['then'](respondWithResult(_0x823d4f,0xc9))[_0xa7a7('0xaf')](handleError(_0x823d4f,null));};exports[_0xa7a7('0x24')]=function(_0x217b9a,_0x278142){if(_0x217b9a[_0xa7a7('0xb2')]['id']){delete _0x217b9a[_0xa7a7('0xb2')]['id'];}return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x217b9a[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x278142,null))[_0xa7a7('0x25')](saveUpdates(_0x217b9a[_0xa7a7('0xb2')],null))[_0xa7a7('0x25')](respondWithResult(_0x278142,null))[_0xa7a7('0xaf')](handleError(_0x278142,null));};exports['destroy']=function(_0x3aeba8,_0x4bd9d3){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x3aeba8[_0xa7a7('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4bd9d3,null))[_0xa7a7('0x25')](removeEntity(_0x4bd9d3,null))[_0xa7a7('0xaf')](handleError(_0x4bd9d3,null));};exports[_0xa7a7('0xb4')]=function(_0x34c2cf,_0x1aebaf){return db[_0xa7a7('0x34')][_0xa7a7('0xb4')]()[_0xa7a7('0x25')](respondWithResult(_0x1aebaf,null))[_0xa7a7('0xaf')](handleError(_0x1aebaf,null));};exports[_0xa7a7('0xb5')]=function(_0x190ba9,_0x3a04bf,_0x228651){return db[_0xa7a7('0xb6')][_0xa7a7('0x5d')]({'where':{'id':_0x190ba9['params']['id']}})['then'](handleEntityNotFound(_0x3a04bf,null))[_0xa7a7('0x25')](function(_0x1e1325){if(_0x1e1325){return _0x1e1325[_0xa7a7('0xb5')](_0x190ba9[_0xa7a7('0xb2')][_0xa7a7('0xb7')],_['omit'](_0x190ba9[_0xa7a7('0xb2')],['ids','id'])||{});}})[_0xa7a7('0x25')](respondWithResult(_0x3a04bf,null))[_0xa7a7('0xaf')](handleError(_0x3a04bf,null));};exports[_0xa7a7('0xb8')]=function(_0x4ec4a0,_0x144202,_0x2c062d){var _0x3a1cf9={'raw':![],'where':{}};var _0x42e1fd={};var _0x40ca36={'count':0x0,'rows':[]};return db[_0xa7a7('0x34')]['findOne']({'where':{'id':_0x4ec4a0[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x144202,null))[_0xa7a7('0x25')](function(_0x28a076){if(_0x28a076){_0x42e1fd[_0xa7a7('0x38')]=_[_0xa7a7('0x3a')](db[_0xa7a7('0xb6')]['rawAttributes']);_0x42e1fd[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x4ec4a0[_0xa7a7('0x39')]);_0x42e1fd[_0xa7a7('0x3b')]=_[_0xa7a7('0x3c')](_0x42e1fd[_0xa7a7('0x38')],_0x42e1fd[_0xa7a7('0x39')]);_0x3a1cf9[_0xa7a7('0x3d')]=_[_0xa7a7('0x3c')](_0x42e1fd[_0xa7a7('0x38')],qs['fields'](_0x4ec4a0['query'][_0xa7a7('0x3e')]));_0x3a1cf9[_0xa7a7('0x3d')]=_0x3a1cf9[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x3a1cf9[_0xa7a7('0x3d')]:_0x42e1fd[_0xa7a7('0x38')];if(!_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xb9')](_0xa7a7('0x40'))){_0x3a1cf9['limit']=qs[_0xa7a7('0x1e')](_0x4ec4a0['query'][_0xa7a7('0x1e')]);_0x3a1cf9['offset']=qs['offset'](_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x1c')]);}_0x3a1cf9[_0xa7a7('0x41')]=qs[_0xa7a7('0x42')](_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x42')]);_0x3a1cf9[_0xa7a7('0x77')]=qs[_0xa7a7('0x3b')](_[_0xa7a7('0x43')](_0x4ec4a0[_0xa7a7('0x39')],_0x42e1fd[_0xa7a7('0x3b')]));_0x3a1cf9[_0xa7a7('0x77')][_0xa7a7('0xad')]=_0x28a076['id'];if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x81')]){_0x3a1cf9[_0xa7a7('0x77')]=_[_0xa7a7('0x98')](_0x3a1cf9[_0xa7a7('0x77')],{'$or':_[_0xa7a7('0x2d')](_0x3a1cf9[_0xa7a7('0x3d')],function(_0x29a99e){var _0x22fb20={};_0x22fb20[_0x29a99e]={'$like':'%'+_0x4ec4a0['query'][_0xa7a7('0x81')]+'%'};return _0x22fb20;})});}if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xba')]){var _0x24c204=_0x4ec4a0['query']['$gte'][_0xa7a7('0x30')](',');var _0x235daa={};_0x235daa[_0x24c204[0x0]]={'$gte':moment(_0x24c204[0x1])['format'](_0xa7a7('0xbb'))};_0x3a1cf9[_0xa7a7('0x77')]=_['merge'](_0x3a1cf9[_0xa7a7('0x77')],_0x235daa);}_0x3a1cf9=_[_0xa7a7('0x98')]({},_0x3a1cf9,_0x4ec4a0[_0xa7a7('0xbc')]);return db[_0xa7a7('0xb6')][_0xa7a7('0x1f')]({'where':_0x3a1cf9[_0xa7a7('0x77')]})[_0xa7a7('0x25')](function(_0x1ccb94){_0x40ca36['count']=_0x1ccb94;if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xbd')]){_0x3a1cf9[_0xa7a7('0xbe')]=[{'all':!![]}];}return db[_0xa7a7('0xb6')]['findAll'](_0x3a1cf9);})[_0xa7a7('0x25')](function(_0x2cf814){_0x40ca36[_0xa7a7('0xae')]=_0x2cf814;return _0x40ca36;});}})['then'](respondWithFilteredResult(_0x144202,_0x3a1cf9))[_0xa7a7('0xaf')](handleError(_0x144202,null));};exports[_0xa7a7('0xbf')]=function(_0x4ba932,_0x21628c,_0x38ec93){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x4ba932[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x21628c,null))[_0xa7a7('0x25')](function(_0x4a3aa5){if(_0x4a3aa5){return _0x4a3aa5[_0xa7a7('0xc0')](_0x4ba932[_0xa7a7('0xb2')][_0xa7a7('0xb7')],_[_0xa7a7('0xc1')](_0x4ba932['body'],[_0xa7a7('0xb7'),'id'])||{})[_0xa7a7('0xc2')](function(){return db[_0xa7a7('0x68')][_0xa7a7('0xc3')]({'attributes':['id',_0xa7a7('0x2a'),_0xa7a7('0x46')],'where':{'id':_0x4ba932[_0xa7a7('0xb2')]['ids']}});})['then'](function(_0x3b7c83){socket['emit'](_0xa7a7('0xc4'),{'id':Number(_0x4ba932['params']['id']),'tags':_0x3b7c83||[]});return{'id':Number(_0x4ba932[_0xa7a7('0xb3')]['id']),'tags':_0x3b7c83||[]};});}})[_0xa7a7('0x25')](respondWithResult(_0x21628c,null))['catch'](handleError(_0x21628c,null));};exports[_0xa7a7('0xc5')]=function(_0x6db9c8,_0x36d002,_0x2c44c6){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x6db9c8[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x36d002,null))[_0xa7a7('0x25')](function(_0x996ff8){if(_0x996ff8){return _0x996ff8['removeTags'](_0x6db9c8[_0xa7a7('0x39')][_0xa7a7('0xb7')]);}})['then'](respondWithStatusCode(_0x36d002,null))[_0xa7a7('0xaf')](handleError(_0x36d002,null));};exports[_0xa7a7('0xc6')]=function(_0x2b4654,_0x38a96f){var _0x310e46=moment()['unix']()[_0xa7a7('0x97')]();var _0x1716ac=path['join'](config['root'],_0xa7a7('0xc7'),'files','tmp');var _0x3822a0=path[_0xa7a7('0xc8')](config[_0xa7a7('0xc9')],_0xa7a7('0xc7'),'files',_0xa7a7('0xca'));var _0x3a2111=path[_0xa7a7('0xc8')](_0x1716ac,_0x310e46);var _0x4f7736=util[_0xa7a7('0xcb')](_0xa7a7('0xcc'),_0x2b4654[_0xa7a7('0xb3')]['id'],_0x310e46);var _0x300575=path[_0xa7a7('0xc8')](_0x1716ac,_0x4f7736);var _0x27594e=[];_0x27594e[_0xa7a7('0x32')]({'model':db[_0xa7a7('0x6b')],'as':_0xa7a7('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x27594e['push']({'model':db['CmContact'],'as':_0xa7a7('0xcd'),'attributes':['id','firstName',_0xa7a7('0xce')],'raw':!![]});var _0xa7bfeb=[{'model':db[_0xa7a7('0xb6')],'as':_0xa7a7('0xcf'),'attributes':['id','body','createdAt',_0xa7a7('0xd0'),_0xa7a7('0xd1'),'read'],'include':_0x27594e}];_0xa7bfeb[_0xa7a7('0x32')]({'model':db['SmsAccount'],'as':_0xa7a7('0xd2'),'attributes':['id',_0xa7a7('0x2a')]});_0xa7bfeb[_0xa7a7('0x32')]({'model':db[_0xa7a7('0x6b')],'as':_0xa7a7('0xd3'),'attributes':['id','fullname']});return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x2b4654[_0xa7a7('0xb3')]['id']},'include':_0xa7bfeb})['then'](handleEntityNotFound(_0x38a96f,null))[_0xa7a7('0x25')](function(_0x300877){if(_0x300877){var _0x5078f2=_0x300877[_0xa7a7('0xd4')]({'plain':!![]});fs[_0xa7a7('0xd5')](_0x3a2111);var _0x36f7ef={'channel':_0xa7a7('0xd6'),'account':_0x5078f2['Account']['name'],'agent':_0x5078f2['Owner']?_0x5078f2[_0xa7a7('0xd3')]['fullname']:_0xa7a7('0xd7'),'createdAt':moment(_0x5078f2[_0xa7a7('0xd8')])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))['toString'](),'closedAt':_0x5078f2[_0xa7a7('0xd9')]?moment(_0x5078f2[_0xa7a7('0xda')])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))['toString']():'','disposition':_0x5078f2[_0xa7a7('0xdb')],'messages':_(_0x5078f2[_0xa7a7('0xcf')])['filter']({'secret':![]})[_0xa7a7('0x2d')](function(_0x10e726){return{'date':moment(_0x10e726['createdAt'])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))[_0xa7a7('0x97')](),'sender':_0x10e726[_0xa7a7('0xd0')]===_0xa7a7('0xdc')?_0x10e726['User']?_0x10e726[_0xa7a7('0x6b')][_0xa7a7('0x2e')]:_0xa7a7('0xdd'):_0x10e726['Contact'][_0xa7a7('0xde')]+(_0x10e726[_0xa7a7('0xcd')][_0xa7a7('0xce')]?'\x20'+_0x10e726[_0xa7a7('0xcd')][_0xa7a7('0xce')]:''),'body':_0x10e726['body'],'direction':_0x10e726[_0xa7a7('0xd0')]===_0xa7a7('0xdc')?'A':'C','secret':_0x10e726[_0xa7a7('0xd1')],'read':_0x10e726[_0xa7a7('0x7c')]};})[_0xa7a7('0x5f')]()};return ejs[_0xa7a7('0xdf')](path['join'](config['root'],_0xa7a7('0xc7'),_0xa7a7('0xe0'),_0xa7a7('0xe1')),{'interaction':_0x36f7ef})['then'](function(_0x444a00){var _0x124db9=path[_0xa7a7('0xc8')](_0x3a2111,_0xa7a7('0xe2')+_0x5078f2['id']+'-'+_0x310e46+'.pdf');var _0x4262f8={'path':_0x124db9,'channel':_0xa7a7('0xd6'),'interactionId':_0x5078f2['id']};return pdf[_0xa7a7('0xe3')](_0x444a00,_0x4262f8);})[_0xa7a7('0x25')](function(){return new BPromise(function(_0x50fef7,_0xf7fc8e){zipdir(_0x3a2111,{'saveTo':_0x300575},function(_0x435ebe,_0x39c888){if(_0x435ebe)return _0xf7fc8e(_0x435ebe);return _0x50fef7(_0x39c888);});})[_0xa7a7('0x25')](function(){return new BPromise(function(_0x49e685,_0x13867f){rimraf(_0x3a2111,function(_0x1d6c5b){if(_0x1d6c5b)_0x13867f(_0x1d6c5b);return _0x49e685();});});})[_0xa7a7('0x25')](function(){return _0x38a96f['download'](_0x300575,_0x4f7736,function(_0x28afb8){if(_0x28afb8){console[_0xa7a7('0xe4')](_0xa7a7('0xe5'),_0x28afb8);}else{fs[_0xa7a7('0xe6')](_0x300575);}});});});}else{return _0x38a96f[_0xa7a7('0x27')](0xc8);}})['catch'](handleError(_0x38a96f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c67c1c7..079cc58 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 _0x57ca=['remove','getUsers','then','setDataValue','Users','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x57ca,0x108));var _0xa57c=function(_0x43ffe8,_0x52a164){_0x43ffe8=_0x43ffe8-0x0;var _0x1a2a4e=_0x57ca[_0x43ffe8];return _0x1a2a4e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xa57c('0x0'))['db'][_0xa57c('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0xa57c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa57c('0x3')](0x0);var events={'afterCreate':_0xa57c('0x4'),'afterUpdate':_0xa57c('0x5'),'afterDestroy':_0xa57c('0x6')};function emitEvent(_0x48be2d){return function(_0x40ba22,_0x1c3e31,_0x113dcf){_0x40ba22[_0xa57c('0x7')]({'attributes':['id'],'raw':!![]})[_0xa57c('0x8')](function(_0x314574){_0x40ba22[_0xa57c('0x9')](_0xa57c('0xa'),_0x314574['map'](function(_0x13dad8){return{'id':_0x13dad8['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x40ba22['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa57c('0x8')](function(_0x932dcc){_0x40ba22['setDataValue'](_0xa57c('0xb'),_0x932dcc['length']);SmsInteractionEvents[_0xa57c('0xc')](_0x48be2d+':'+_0x40ba22['id'],_0x40ba22);SmsInteractionEvents[_0xa57c('0xc')](_0x48be2d,_0x40ba22);_0x113dcf(null);})['catch'](_0x113dcf(null));};}for(var e in events){if(events[_0xa57c('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa57c('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 3086cf4..796dbd6 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 _0x4e07=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e07,0x177));var _0x74e0=function(_0x396f35,_0xf1d00e){_0x396f35=_0x396f35-0x0;var _0x51c0aa=_0x4e07[_0x396f35];return _0x51c0aa;};'use strict';var _=require(_0x74e0('0x0'));var util=require(_0x74e0('0x1'));var logger=require(_0x74e0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x74e0('0x3'));var rp=require(_0x74e0('0x4'));var fs=require('fs');var path=require(_0x74e0('0x5'));var rimraf=require('rimraf');var config=require(_0x74e0('0x6'));var attributes=require(_0x74e0('0x7'));module[_0x74e0('0x8')]=function(_0x30749d,_0xff5536){return _0x30749d['define'](_0x74e0('0x9'),attributes,{'tableName':_0x74e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x231e1b,_0x49cb37,_0x5e73d1){if(_0x231e1b['changed'](_0x74e0('0xb'))){_0x231e1b[_0x74e0('0xc')]=moment()[_0x74e0('0xd')](_0x74e0('0xe'));}_0x5e73d1(null,_0x231e1b);}}});}; \ No newline at end of file +var _0x4475=['bluebird','request-promise','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x4475,0x189));var _0x5447=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4475[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5447('0x0'));var util=require('util');var logger=require(_0x5447('0x1'))(_0x5447('0x2'));var moment=require('moment');var BPromise=require(_0x5447('0x3'));var rp=require(_0x5447('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5447('0x5'));module[_0x5447('0x6')]=function(_0x334982,_0x4f5725){return _0x334982[_0x5447('0x7')](_0x5447('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37f9bc,_0x48e913,_0x4098cf){if(_0x37f9bc[_0x5447('0x9')](_0x5447('0xa'))){_0x37f9bc['closedAt']=moment()['format'](_0x5447('0xb'));}_0x4098cf(null,_0x37f9bc);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 73ac213..11c6562 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 _0x3052=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','debug','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x2cce38,_0x2214db){var _0x569176=function(_0xcbac0b){while(--_0xcbac0b){_0x2cce38['push'](_0x2cce38['shift']());}};_0x569176(++_0x2214db);}(_0x3052,0xc8));var _0x2305=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3052[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2305('0x0'));var util=require(_0x2305('0x1'));var moment=require(_0x2305('0x2'));var BPromise=require(_0x2305('0x3'));var rs=require(_0x2305('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2305('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2305('0x6'))(_0x2305('0x7'));var config=require(_0x2305('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2305('0x9')]({'port':0x232a});config[_0x2305('0xa')]=_[_0x2305('0xb')](config[_0x2305('0xa')],{'host':_0x2305('0xc'),'port':0x18eb});var socket=require(_0x2305('0xd'))(new Redis(config['redis']));require(_0x2305('0xe'))['register'](socket);function respondWithRpcPromise(_0x35da6b,_0x16c388,_0x4b9819){return new BPromise(function(_0x268b2a,_0x6264c){return client[_0x2305('0xf')](_0x35da6b,_0x4b9819)[_0x2305('0x10')](function(_0x44a022){logger[_0x2305('0x11')](_0x2305('0x12'),_0x16c388,_0x2305('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x16c388,_0x2305('0x13'),JSON['stringify'](_0x44a022));if(_0x44a022[_0x2305('0x14')]){if(_0x44a022['error']['code']===0x1f4){logger[_0x2305('0x14')](_0x2305('0x12'),_0x16c388,_0x44a022['error'][_0x2305('0x15')]);return _0x6264c(_0x44a022[_0x2305('0x14')][_0x2305('0x15')]);}logger[_0x2305('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x16c388,_0x44a022['error']['message']);return _0x268b2a(_0x44a022['error'][_0x2305('0x15')]);}else{logger[_0x2305('0x11')](_0x2305('0x12'),_0x16c388,_0x2305('0x13'));_0x268b2a(_0x44a022[_0x2305('0x16')][_0x2305('0x15')]);}})[_0x2305('0x17')](function(_0x3b97b6){logger[_0x2305('0x14')](_0x2305('0x12'),_0x16c388,_0x3b97b6);_0x6264c(_0x3b97b6);});});}exports['UpdateSmsInteraction']=function(_0x47773e){var _0xb7820d=this;return new Promise(function(_0x238119,_0x42843f){return db['SmsInteraction'][_0x2305('0x18')](_0x47773e[_0x2305('0x19')],{'raw':_0x47773e[_0x2305('0x1a')]?_0x47773e[_0x2305('0x1a')][_0x2305('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47773e[_0x2305('0x1a')]?_0x47773e[_0x2305('0x1a')][_0x2305('0x1c')]||null:null,'attributes':_0x47773e[_0x2305('0x1a')]?_0x47773e[_0x2305('0x1a')][_0x2305('0x1d')]||null:null,'limit':_0x47773e[_0x2305('0x1a')]?_0x47773e['options'][_0x2305('0x1e')]||null:null})[_0x2305('0x10')](function(_0x2770da){logger['info'](_0x2305('0x1f'),_0x47773e);logger[_0x2305('0x20')](_0x2305('0x1f'),_0x47773e,JSON['stringify'](_0x2770da));_0x238119(_0x2770da);})[_0x2305('0x17')](function(_0x48dd8c){logger[_0x2305('0x14')](_0x2305('0x1f'),_0x48dd8c[_0x2305('0x15')],_0x47773e);_0x42843f(_0xb7820d['error'](0x1f4,_0x48dd8c['message']));});});};exports[_0x2305('0x21')]=function(_0x3111a0){return new Promise(function(_0x9796ff,_0x3d3230){return db[_0x2305('0x22')][_0x2305('0x23')]({'where':_0x3111a0[_0x2305('0x1a')]?_0x3111a0[_0x2305('0x1a')][_0x2305('0x1c')]||null:null})[_0x2305('0x10')](function(_0x673482){if(_0x673482){return _0x673482[_0x2305('0x24')](_0x3111a0['body'][_0x2305('0x25')],_[_0x2305('0x26')](_0x3111a0['body'],[_0x2305('0x25'),'id'])||{});}})[_0x2305('0x27')](function(_0x4b5079){logger[_0x2305('0x11')](_0x2305('0x28'),_0x3111a0);logger[_0x2305('0x20')](_0x2305('0x28'),_0x3111a0,JSON['stringify'](_0x4b5079));_0x9796ff(_0x4b5079);})[_0x2305('0x17')](function(_0x54d11c){logger[_0x2305('0x14')](_0x2305('0x28'),_0x54d11c[_0x2305('0x15')],_0x3111a0);_0x3d3230(_this[_0x2305('0x14')](0x1f4,_0x54d11c[_0x2305('0x15')]));});});}; \ No newline at end of file +var _0x7845=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','find','ids','spread','AddTags','catch'];(function(_0x5036a0,_0x3817ae){var _0x315660=function(_0x5b8854){while(--_0x5b8854){_0x5036a0['push'](_0x5036a0['shift']());}};_0x315660(++_0x3817ae);}(_0x7845,0xd2));var _0x5784=function(_0x561f40,_0x22bc3e){_0x561f40=_0x561f40-0x0;var _0x52ba0c=_0x7845[_0x561f40];return _0x52ba0c;};'use strict';var _=require(_0x5784('0x0'));var util=require(_0x5784('0x1'));var moment=require(_0x5784('0x2'));var BPromise=require(_0x5784('0x3'));var rs=require(_0x5784('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5784('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5784('0x6'))(_0x5784('0x7'));var config=require(_0x5784('0x8'));var jayson=require(_0x5784('0x9'));var client=jayson['client'][_0x5784('0xa')]({'port':0x232a});config[_0x5784('0xb')]=_[_0x5784('0xc')](config[_0x5784('0xb')],{'host':_0x5784('0xd'),'port':0x18eb});var socket=require(_0x5784('0xe'))(new Redis(config[_0x5784('0xb')]));require(_0x5784('0xf'))[_0x5784('0x10')](socket);function respondWithRpcPromise(_0x3b3e83,_0x3e6532,_0x4f359b){return new BPromise(function(_0x4bfa1e,_0x3d0846){return client[_0x5784('0x11')](_0x3b3e83,_0x4f359b)[_0x5784('0x12')](function(_0x403eab){logger[_0x5784('0x13')](_0x5784('0x14'),_0x3e6532,_0x5784('0x15'));logger[_0x5784('0x16')](_0x5784('0x17'),_0x3e6532,_0x5784('0x15'),JSON[_0x5784('0x18')](_0x403eab));if(_0x403eab['error']){if(_0x403eab[_0x5784('0x19')][_0x5784('0x1a')]===0x1f4){logger[_0x5784('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x3e6532,_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);return _0x3d0846(_0x403eab[_0x5784('0x19')]['message']);}logger[_0x5784('0x19')](_0x5784('0x14'),_0x3e6532,_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);return _0x4bfa1e(_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);}else{logger[_0x5784('0x13')](_0x5784('0x14'),_0x3e6532,_0x5784('0x15'));_0x4bfa1e(_0x403eab[_0x5784('0x1c')][_0x5784('0x1b')]);}})['catch'](function(_0x23829e){logger['error'](_0x5784('0x14'),_0x3e6532,_0x23829e);_0x3d0846(_0x23829e);});});}exports[_0x5784('0x1d')]=function(_0x1ef6eb){var _0x353711=this;return new Promise(function(_0xb7e92e,_0xbe4864){return db[_0x5784('0x1e')]['update'](_0x1ef6eb[_0x5784('0x1f')],{'raw':_0x1ef6eb[_0x5784('0x20')]?_0x1ef6eb['options'][_0x5784('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ef6eb[_0x5784('0x20')]?_0x1ef6eb[_0x5784('0x20')][_0x5784('0x22')]||null:null,'attributes':_0x1ef6eb['options']?_0x1ef6eb['options'][_0x5784('0x23')]||null:null,'limit':_0x1ef6eb['options']?_0x1ef6eb[_0x5784('0x20')][_0x5784('0x24')]||null:null})[_0x5784('0x12')](function(_0x220387){logger['info'](_0x5784('0x1d'),_0x1ef6eb);logger['debug']('UpdateSmsInteraction',_0x1ef6eb,JSON[_0x5784('0x18')](_0x220387));_0xb7e92e(_0x220387);})['catch'](function(_0x5b4a81){logger[_0x5784('0x19')](_0x5784('0x1d'),_0x5b4a81[_0x5784('0x1b')],_0x1ef6eb);_0xbe4864(_0x353711[_0x5784('0x19')](0x1f4,_0x5b4a81[_0x5784('0x1b')]));});});};exports['AddTagsToSmsInteraction']=function(_0x455315){return new Promise(function(_0x3515e6,_0x2eff03){return db['SmsInteraction'][_0x5784('0x25')]({'where':_0x455315[_0x5784('0x20')]?_0x455315['options'][_0x5784('0x22')]||null:null})['then'](function(_0x40afad){if(_0x40afad){return _0x40afad['addTags'](_0x455315[_0x5784('0x1f')][_0x5784('0x26')],_['omit'](_0x455315[_0x5784('0x1f')],[_0x5784('0x26'),'id'])||{});}})[_0x5784('0x27')](function(_0x4f00bd){logger['info'](_0x5784('0x28'),_0x455315);logger[_0x5784('0x16')](_0x5784('0x28'),_0x455315,JSON[_0x5784('0x18')](_0x4f00bd));_0x3515e6(_0x4f00bd);})[_0x5784('0x29')](function(_0x565eb9){logger[_0x5784('0x19')](_0x5784('0x28'),_0x565eb9[_0x5784('0x1b')],_0x455315);_0x2eff03(_this[_0x5784('0x19')](0x1f4,_0x565eb9[_0x5784('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0b83ea3..db50346 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 _0x1c01=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','register','length'];(function(_0x552aea,_0x36cefa){var _0x5cd6b6=function(_0x1f5350){while(--_0x1f5350){_0x552aea['push'](_0x552aea['shift']());}};_0x5cd6b6(++_0x36cefa);}(_0x1c01,0x111));var _0x11c0=function(_0x49b144,_0x207bab){_0x49b144=_0x49b144-0x0;var _0x3d866d=_0x1c01[_0x49b144];return _0x3d866d;};'use strict';var SmsInteractionEvents=require(_0x11c0('0x0'));var events=[_0x11c0('0x1'),_0x11c0('0x2'),_0x11c0('0x3')];function createListener(_0x2d9075,_0x220544){return function(_0x496928){_0x220544[_0x11c0('0x4')](_0x2d9075,_0x496928);};}function removeListener(_0x20cec0,_0x31b44b){return function(){SmsInteractionEvents['removeListener'](_0x20cec0,_0x31b44b);};}exports[_0x11c0('0x5')]=function(_0x368752){for(var _0x57fdce=0x0,_0x5812ec=events[_0x11c0('0x6')];_0x57fdce<_0x5812ec;_0x57fdce++){var _0xc83152=events[_0x57fdce];var _0x20d6a1=createListener(_0x11c0('0x7')+_0xc83152,_0x368752);SmsInteractionEvents['on'](_0xc83152,_0x20d6a1);}}; \ No newline at end of file +var _0x379c=['removeListener','register','length','save','remove','emit'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x379c,0x19b));var _0xc379=function(_0x289556,_0x7f8fc5){_0x289556=_0x289556-0x0;var _0x1c59c3=_0x379c[_0x289556];return _0x1c59c3;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xc379('0x0'),_0xc379('0x1'),'update'];function createListener(_0x541690,_0x94fab3){return function(_0x4f96e3){_0x94fab3[_0xc379('0x2')](_0x541690,_0x4f96e3);};}function removeListener(_0x349d3d,_0x318634){return function(){SmsInteractionEvents[_0xc379('0x3')](_0x349d3d,_0x318634);};}exports[_0xc379('0x4')]=function(_0x5b880a){for(var _0xc84bf=0x0,_0x2a35a8=events[_0xc379('0x5')];_0xc84bf<_0x2a35a8;_0xc84bf++){var _0x20ebc6=events[_0xc84bf];var _0x52e45a=createListener('smsInteraction:'+_0x20ebc6,_0x5b880a);SmsInteractionEvents['on'](_0x20ebc6,_0x52e45a);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d25739e..6baca16 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 _0x7956=['index','get','/describe','isAuthenticated','/:id','show','post','tracked','smsmessage:create','/:id/status','status','put','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./smsMessage.controller'];(function(_0x2fdfb0,_0x1e7047){var _0x27c519=function(_0xbbbdb0){while(--_0xbbbdb0){_0x2fdfb0['push'](_0x2fdfb0['shift']());}};_0x27c519(++_0x1e7047);}(_0x7956,0x1cc));var _0x6795=function(_0x12e42c,_0x2f7294){_0x12e42c=_0x12e42c-0x0;var _0x26d3aa=_0x7956[_0x12e42c];return _0x26d3aa;};'use strict';var multer=require(_0x6795('0x0'));var util=require(_0x6795('0x1'));var path=require(_0x6795('0x2'));var timeout=require(_0x6795('0x3'));var express=require(_0x6795('0x4'));var router=express['Router']();var fs_extra=require(_0x6795('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6795('0x6'));var config=require('../../config/environment');var controller=require(_0x6795('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6795('0x8')]);router[_0x6795('0x9')](_0x6795('0xa'),auth[_0x6795('0xb')](),controller['describe']);router['get'](_0x6795('0xc'),auth[_0x6795('0xb')](),controller[_0x6795('0xd')]);router[_0x6795('0xe')]('/',auth[_0x6795('0xb')](),interaction[_0x6795('0xf')]('sms',_0x6795('0x10')),controller['create']);router['post'](_0x6795('0x11'),controller[_0x6795('0x12')]);router[_0x6795('0x13')]('/:id',auth[_0x6795('0xb')](),controller[_0x6795('0x14')]);router[_0x6795('0x13')]('/:id/accept',auth[_0x6795('0xb')](),controller[_0x6795('0x15')]);router[_0x6795('0x13')]('/:id/reject',auth[_0x6795('0xb')](),controller[_0x6795('0x16')]);router[_0x6795('0x17')]('/:id',auth[_0x6795('0xb')](),controller[_0x6795('0x18')]);module[_0x6795('0x19')]=router; \ No newline at end of file +var _0x6be9=['describe','/:id','post','tracked','smsmessage:create','create','/:id/status','status','put','reject','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x4e4966,_0x45f39c){var _0x5ecb0f=function(_0x5566b3){while(--_0x5566b3){_0x4e4966['push'](_0x4e4966['shift']());}};_0x5ecb0f(++_0x45f39c);}(_0x6be9,0xec));var _0x96be=function(_0x3e2445,_0x326268){_0x3e2445=_0x3e2445-0x0;var _0x56f3ec=_0x6be9[_0x3e2445];return _0x56f3ec;};'use strict';var multer=require(_0x96be('0x0'));var util=require(_0x96be('0x1'));var path=require(_0x96be('0x2'));var timeout=require(_0x96be('0x3'));var express=require('express');var router=express[_0x96be('0x4')]();var fs_extra=require(_0x96be('0x5'));var auth=require(_0x96be('0x6'));var interaction=require(_0x96be('0x7'));var config=require(_0x96be('0x8'));var controller=require(_0x96be('0x9'));router[_0x96be('0xa')]('/',auth[_0x96be('0xb')](),controller[_0x96be('0xc')]);router[_0x96be('0xa')](_0x96be('0xd'),auth[_0x96be('0xb')](),controller[_0x96be('0xe')]);router['get'](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['show']);router[_0x96be('0x10')]('/',auth[_0x96be('0xb')](),interaction[_0x96be('0x11')]('sms',_0x96be('0x12')),controller[_0x96be('0x13')]);router[_0x96be('0x10')](_0x96be('0x14'),controller[_0x96be('0x15')]);router['put'](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['update']);router[_0x96be('0x16')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x96be('0x16')]('/:id/reject',auth[_0x96be('0xb')](),controller[_0x96be('0x17')]);router[_0x96be('0x18')](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3eaee9e..001f11c 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 _0x5204=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5204,0xd8));var _0x4520=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x5204[_0x3cbe1c];return _0x5ee08b;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'body':{'type':Sequelize[_0x4520('0x2')](_0x4520('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4520('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4520('0x5')]('in',_0x4520('0x6')),'defaultValue':_0x4520('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4520('0x7')](0xbe)},'phone':{'type':Sequelize[_0x4520('0x7')]},'readAt':{'type':Sequelize[_0x4520('0x8')]},'secret':{'type':Sequelize[_0x4520('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x035a=['STRING','DATE','BOOLEAN','TEXT','sequelize','exports','medium','ENUM','out'];(function(_0x13e168,_0x5a97be){var _0x278370=function(_0x210b7f){while(--_0x210b7f){_0x13e168['push'](_0x13e168['shift']());}};_0x278370(++_0x5a97be);}(_0x035a,0x17e));var _0xa035=function(_0x258834,_0x127a91){_0x258834=_0x258834-0x0;var _0x59a804=_0x035a[_0x258834];return _0x59a804;};'use strict';var Sequelize=require(_0xa035('0x0'));module[_0xa035('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa035('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa035('0x3')]('in',_0xa035('0x4')),'defaultValue':_0xa035('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa035('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa035('0x6')]},'secret':{'type':Sequelize[_0xa035('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa035('0x5')]},'providerResponse':{'type':Sequelize[_0xa035('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index effac21..3df086f 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 _0xeca8=['filter','options','findAll','rows','catch','show','params','includeAll','create','body','find','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','contact','User','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','messageId','indexOf','sent','Status','plivio','infobip','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','end','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','filters','pick','where','merge'];(function(_0x26e5c4,_0x41173a){var _0x144887=function(_0x3e1ec7){while(--_0x3e1ec7){_0x26e5c4['push'](_0x26e5c4['shift']());}};_0x144887(++_0x41173a);}(_0xeca8,0x1f2));var _0x8eca=function(_0x4f149e,_0x299c9b){_0x4f149e=_0x4f149e-0x0;var _0x324682=_0xeca8[_0x4f149e];return _0x324682;};'use strict';var emlformat=require(_0x8eca('0x0'));var rimraf=require(_0x8eca('0x1'));var zipdir=require(_0x8eca('0x2'));var jsonpatch=require(_0x8eca('0x3'));var rp=require(_0x8eca('0x4'));var moment=require(_0x8eca('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8eca('0x6'));var util=require('util');var path=require(_0x8eca('0x7'));var sox=require(_0x8eca('0x8'));var csv=require(_0x8eca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8eca('0xa'));var _=require(_0x8eca('0xb'));var squel=require(_0x8eca('0xc'));var crypto=require(_0x8eca('0xd'));var jsforce=require(_0x8eca('0xe'));var deskjs=require(_0x8eca('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8eca('0x10'));var Papa=require(_0x8eca('0x11'));var Redis=require(_0x8eca('0x12'));var authService=require(_0x8eca('0x13'));var qs=require(_0x8eca('0x14'));var as=require(_0x8eca('0x15'));var hardwareService=require(_0x8eca('0x16'));var logger=require(_0x8eca('0x17'))(_0x8eca('0x18'));var utils=require(_0x8eca('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8eca('0x1a'));var db=require('../../mysqldb')['db'];config[_0x8eca('0x1b')]=_[_0x8eca('0x1c')](config['redis'],{'host':_0x8eca('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x8eca('0x1e')](socket);var jayson=require(_0x8eca('0x1f'));var client=jayson[_0x8eca('0x20')][_0x8eca('0x21')]({'port':0x232c});var client9002=jayson[_0x8eca('0x20')][_0x8eca('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xd23ac1,_0x4e390c,_0x15be36,_0x1f7012){return new BPromise(function(_0x4b8c67,_0x41ca2d){var _0x700909=_0x1f7012||client;return _0x700909['request'](_0xd23ac1,_0x15be36)['then'](function(_0xe8e3ec){logger['info'](_0x8eca('0x22'),_0x4e390c,_0x8eca('0x23'));logger[_0x8eca('0x24')](_0x8eca('0x25'),_0x4e390c,'request\x20sent',JSON[_0x8eca('0x26')](_0xe8e3ec));if(_0xe8e3ec['error']){if(_0xe8e3ec[_0x8eca('0x27')]['code']===0x1f4){logger[_0x8eca('0x27')](_0x8eca('0x22'),_0x4e390c,_0xe8e3ec[_0x8eca('0x27')][_0x8eca('0x28')]);return _0x41ca2d(_0xe8e3ec[_0x8eca('0x27')][_0x8eca('0x28')]);}logger['error'](_0x8eca('0x22'),_0x4e390c,_0xe8e3ec['error']['message']);return _0x4b8c67(_0xe8e3ec[_0x8eca('0x27')][_0x8eca('0x28')]);}else{logger[_0x8eca('0x29')](_0x8eca('0x22'),_0x4e390c,_0x8eca('0x23'));_0x4b8c67(_0xe8e3ec['result'][_0x8eca('0x28')]);}})['catch'](function(_0x45b28e){logger[_0x8eca('0x27')](_0x8eca('0x22'),_0x4e390c,_0x45b28e);_0x41ca2d(_0x45b28e);});});}function respondWithStatusCode(_0x3e1f66,_0x35a2de){_0x35a2de=_0x35a2de||0xcc;return function(_0xb3ffd7){if(_0xb3ffd7){return _0x3e1f66[_0x8eca('0x2a')](_0x35a2de);}return _0x3e1f66[_0x8eca('0x2b')](_0x35a2de)['end']();};}function respondWithResult(_0x2d76d4,_0x752faf){_0x752faf=_0x752faf||0xc8;return function(_0x746767){if(_0x746767){return _0x2d76d4[_0x8eca('0x2b')](_0x752faf)[_0x8eca('0x2c')](_0x746767);}};}function respondWithFilteredResult(_0x8b406b,_0x39e04f){return function(_0x189ecf){if(_0x189ecf){var _0x36b286=typeof _0x39e04f['offset']===_0x8eca('0x2d')&&typeof _0x39e04f[_0x8eca('0x2e')]===_0x8eca('0x2d');var _0x1f6ed5=_0x189ecf['count'];var _0x1fa79d=_0x36b286?0x0:_0x39e04f[_0x8eca('0x2f')];var _0x3701f6=_0x36b286?_0x189ecf[_0x8eca('0x30')]:_0x39e04f[_0x8eca('0x2f')]+_0x39e04f[_0x8eca('0x2e')];var _0x20e7ba;if(_0x3701f6>=_0x1f6ed5){_0x3701f6=_0x1f6ed5;_0x20e7ba=0xc8;}else{_0x20e7ba=0xce;}_0x8b406b[_0x8eca('0x2b')](_0x20e7ba);return _0x8b406b[_0x8eca('0x31')]('Content-Range',_0x1fa79d+'-'+_0x3701f6+'/'+_0x1f6ed5)['json'](_0x189ecf);}return null;};}function patchUpdates(_0x2cfbab){return function(_0x8abf4d){try{jsonpatch[_0x8eca('0x32')](_0x8abf4d,_0x2cfbab,!![]);}catch(_0xe283b1){return BPromise[_0x8eca('0x33')](_0xe283b1);}return _0x8abf4d[_0x8eca('0x34')]();};}function saveUpdates(_0x220e33,_0xffb850){return function(_0x2cb1c5){if(_0x2cb1c5){return _0x2cb1c5[_0x8eca('0x35')](_0x220e33)['then'](function(_0x544aca){return _0x544aca;});}return null;};}function removeEntity(_0x5b0a36,_0x926c70){return function(_0x3e7de4){if(_0x3e7de4){return _0x3e7de4[_0x8eca('0x36')]()[_0x8eca('0x37')](function(){_0x5b0a36[_0x8eca('0x2b')](0xcc)[_0x8eca('0x38')]();});}};}function handleEntityNotFound(_0x2f6df4,_0xa0a7f5){return function(_0x35b57e){if(!_0x35b57e){_0x2f6df4[_0x8eca('0x2a')](0x194);}return _0x35b57e;};}function handleError(_0x3c2214,_0x59c1e){_0x59c1e=_0x59c1e||0x1f4;return function(_0x1d2012){logger[_0x8eca('0x27')](_0x1d2012['stack']);if(_0x1d2012[_0x8eca('0x39')]){delete _0x1d2012['name'];}_0x3c2214[_0x8eca('0x2b')](_0x59c1e)[_0x8eca('0x3a')](_0x1d2012);};}exports['index']=function(_0x38aa7e,_0x525973){var _0x2e7d37={},_0x5e9c85={},_0x37c550={'count':0x0,'rows':[]};var _0x309688=_[_0x8eca('0x3b')](db[_0x8eca('0x3c')][_0x8eca('0x3d')],function(_0xc002e5){return{'name':_0xc002e5[_0x8eca('0x3e')],'type':_0xc002e5[_0x8eca('0x3f')][_0x8eca('0x40')]};});_0x5e9c85[_0x8eca('0x41')]=_[_0x8eca('0x3b')](_0x309688,'name');_0x5e9c85[_0x8eca('0x42')]=_[_0x8eca('0x43')](_0x38aa7e[_0x8eca('0x42')]);_0x5e9c85['filters']=_[_0x8eca('0x44')](_0x5e9c85['model'],_0x5e9c85[_0x8eca('0x42')]);_0x2e7d37['attributes']=_['intersection'](_0x5e9c85['model'],qs[_0x8eca('0x45')](_0x38aa7e['query'][_0x8eca('0x45')]));_0x2e7d37[_0x8eca('0x46')]=_0x2e7d37['attributes'][_0x8eca('0x47')]?_0x2e7d37['attributes']:_0x5e9c85['model'];if(!_0x38aa7e['query']['hasOwnProperty'](_0x8eca('0x48'))){_0x2e7d37['limit']=qs[_0x8eca('0x2e')](_0x38aa7e[_0x8eca('0x42')]['limit']);_0x2e7d37[_0x8eca('0x2f')]=qs[_0x8eca('0x2f')](_0x38aa7e[_0x8eca('0x42')][_0x8eca('0x2f')]);}_0x2e7d37['order']=qs[_0x8eca('0x49')](_0x38aa7e[_0x8eca('0x42')][_0x8eca('0x49')]);_0x2e7d37['where']=qs[_0x8eca('0x4a')](_[_0x8eca('0x4b')](_0x38aa7e[_0x8eca('0x42')],_0x5e9c85[_0x8eca('0x4a')]),_0x309688);if(_0x38aa7e[_0x8eca('0x42')]['filter']){_0x2e7d37[_0x8eca('0x4c')]=_[_0x8eca('0x4d')](_0x2e7d37[_0x8eca('0x4c')],{'$or':_[_0x8eca('0x3b')](_0x309688,function(_0x56769f){if(_0x56769f['type']!=='VIRTUAL'){var _0x3c4929={};_0x3c4929[_0x56769f['name']]={'$like':'%'+_0x38aa7e[_0x8eca('0x42')][_0x8eca('0x4e')]+'%'};return _0x3c4929;}})});}_0x2e7d37=_['merge']({},_0x2e7d37,_0x38aa7e[_0x8eca('0x4f')]);var _0x16646e={'where':_0x2e7d37['where']};return db[_0x8eca('0x3c')]['count'](_0x16646e)[_0x8eca('0x37')](function(_0x83b0ba){_0x37c550[_0x8eca('0x30')]=_0x83b0ba;if(_0x38aa7e[_0x8eca('0x42')]['includeAll']){_0x2e7d37['include']=[{'all':!![]}];}return db['SmsMessage'][_0x8eca('0x50')](_0x2e7d37);})['then'](function(_0x5bea1c){_0x37c550[_0x8eca('0x51')]=_0x5bea1c;return _0x37c550;})[_0x8eca('0x37')](respondWithFilteredResult(_0x525973,_0x2e7d37))[_0x8eca('0x52')](handleError(_0x525973,null));};exports[_0x8eca('0x53')]=function(_0x8c58d7,_0x1be27f){var _0x4e9757={'raw':!![],'where':{'id':_0x8c58d7[_0x8eca('0x54')]['id']}},_0x142da7={};_0x142da7['model']=_[_0x8eca('0x43')](db[_0x8eca('0x3c')]['rawAttributes']);_0x142da7[_0x8eca('0x42')]=_[_0x8eca('0x43')](_0x8c58d7[_0x8eca('0x42')]);_0x142da7[_0x8eca('0x4a')]=_['intersection'](_0x142da7['model'],_0x142da7[_0x8eca('0x42')]);_0x4e9757['attributes']=_[_0x8eca('0x44')](_0x142da7[_0x8eca('0x41')],qs[_0x8eca('0x45')](_0x8c58d7[_0x8eca('0x42')][_0x8eca('0x45')]));_0x4e9757[_0x8eca('0x46')]=_0x4e9757[_0x8eca('0x46')]['length']?_0x4e9757[_0x8eca('0x46')]:_0x142da7[_0x8eca('0x41')];if(_0x8c58d7[_0x8eca('0x42')][_0x8eca('0x55')]){_0x4e9757['include']=[{'all':!![]}];}_0x4e9757=_[_0x8eca('0x4d')]({},_0x4e9757,_0x8c58d7[_0x8eca('0x4f')]);return db[_0x8eca('0x3c')]['find'](_0x4e9757)[_0x8eca('0x37')](handleEntityNotFound(_0x1be27f,null))['then'](respondWithResult(_0x1be27f,null))[_0x8eca('0x52')](handleError(_0x1be27f,null));};exports[_0x8eca('0x56')]=function(_0x2c0f67,_0x314958){return db[_0x8eca('0x3c')][_0x8eca('0x56')](_0x2c0f67[_0x8eca('0x57')],{})[_0x8eca('0x37')](respondWithResult(_0x314958,0xc9))[_0x8eca('0x52')](handleError(_0x314958,null));};exports[_0x8eca('0x35')]=function(_0xef31d8,_0x28e807){if(_0xef31d8['body']['id']){delete _0xef31d8[_0x8eca('0x57')]['id'];}return db[_0x8eca('0x3c')]['find']({'where':{'id':_0xef31d8[_0x8eca('0x54')]['id']}})['then'](handleEntityNotFound(_0x28e807,null))[_0x8eca('0x37')](saveUpdates(_0xef31d8[_0x8eca('0x57')],null))[_0x8eca('0x37')](respondWithResult(_0x28e807,null))['catch'](handleError(_0x28e807,null));};exports[_0x8eca('0x36')]=function(_0x56dc87,_0x9ef9e9){return db[_0x8eca('0x3c')][_0x8eca('0x58')]({'where':{'id':_0x56dc87[_0x8eca('0x54')]['id']}})[_0x8eca('0x37')](handleEntityNotFound(_0x9ef9e9,null))['then'](removeEntity(_0x9ef9e9,null))['catch'](handleError(_0x9ef9e9,null));};exports[_0x8eca('0x59')]=function(_0x341dc5,_0x3c3361){return db[_0x8eca('0x3c')][_0x8eca('0x59')]()['then'](respondWithResult(_0x3c3361,null))[_0x8eca('0x52')](handleError(_0x3c3361,null));};var interaction_log=require(_0x8eca('0x17'))(_0x8eca('0x5a'));exports[_0x8eca('0x5b')]=function(_0x5ae5ac,_0x3f5274,_0x6c243e){var _0x4b0505={'agent':{},'channel':_0x8eca('0x5c')};if(_0x5ae5ac[_0x8eca('0x57')]['id']){delete _0x5ae5ac['body']['id'];}_0x5ae5ac[_0x8eca('0x57')]['read']=!![];_0x5ae5ac['body'][_0x8eca('0x5d')]=moment()['format'](_0x8eca('0x5e'));_0x5ae5ac[_0x8eca('0x57')]['UserId']=_0x5ae5ac[_0x8eca('0x57')][_0x8eca('0x5f')]||_0x5ae5ac[_0x8eca('0x60')]['id'];_0x4b0505[_0x8eca('0x61')]['id']=_0x5ae5ac[_0x8eca('0x57')][_0x8eca('0x5f')];return db[_0x8eca('0x3c')][_0x8eca('0x58')]({'where':{'id':_0x5ae5ac[_0x8eca('0x54')]['id'],'UserId':null}})[_0x8eca('0x37')](handleEntityNotFound(_0x3f5274,null))['then'](saveUpdates(_0x5ae5ac[_0x8eca('0x57')],null))[_0x8eca('0x37')](function(_0x14afcc){if(_0x14afcc){_0x4b0505[_0x8eca('0x28')]=_0x14afcc[_0x8eca('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x14afcc[_0x8eca('0x63')]}});}return null;})[_0x8eca('0x37')](handleEntityNotFound(_0x3f5274,null))[_0x8eca('0x37')](function(_0x528df7){if(_0x528df7){return _0x528df7[_0x8eca('0x35')]({'UserId':_0x5ae5ac[_0x8eca('0x57')][_0x8eca('0x5f')],'read1stAt':_['isNil'](_0x528df7[_0x8eca('0x64')])?moment()['format'](_0x8eca('0x5e')):undefined});}return null;})[_0x8eca('0x37')](function(_0x338361){if(_0x338361){_0x4b0505[_0x8eca('0x65')]=_0x338361[_0x8eca('0x62')]({'plain':!![]});interaction_log[_0x8eca('0x29')](_0x8eca('0x66'),_0x5ae5ac[_0x8eca('0x60')]['id'],_0x5ae5ac[_0x8eca('0x60')]['name'],_0x5ae5ac['user'][_0x8eca('0x67')],_0x4b0505['interaction']['id'],_0x5ae5ac[_0x8eca('0x57')]?JSON[_0x8eca('0x26')](_0x5ae5ac[_0x8eca('0x57')]):_0x8eca('0x68'));return respondWithRpcPromise(_0x8eca('0x69'),_0x8eca('0x6a'),_0x4b0505);}return null;})[_0x8eca('0x37')](function(_0x191d34){var _0x378112=_0x8eca('0x6b')+_0x191d34[_0x8eca('0x28')]['ContactId'];return db[_0x8eca('0x6c')][_0x8eca('0x42')](_0x378112,{'type':db[_0x8eca('0x6d')]['QueryTypes'][_0x8eca('0x6e')],'raw':!![]})[_0x8eca('0x37')](function(_0x5ac4e3){return _0x5ac4e3;});})['then'](function(_0x275b88){if(_0x275b88){_0x4b0505[_0x8eca('0x28')]['contact']=_0x275b88[0x0];if(!_0x5ae5ac[_0x8eca('0x57')][_0x8eca('0x5f')])return;return db['User']['find']({'where':{'id':_0x5ae5ac['body'][_0x8eca('0x5f')],'role':_0x8eca('0x61')},'attributes':['id',_0x8eca('0x39'),_0x8eca('0x6f'),_0x8eca('0x70'),_0x8eca('0x71')],'raw':!![]});}return null;})[_0x8eca('0x37')](function(_0x3ee369){if(!_0x3ee369)return null;_0x4b0505[_0x8eca('0x28')]['agent']=_0x3ee369;return _0x4b0505;})[_0x8eca('0x37')](function(_0x490642){if(_0x490642){if(_0x5ae5ac['body'][_0x8eca('0x72')]){_0x4b0505[_0x8eca('0x28')][_0x8eca('0x73')]=util[_0x8eca('0x74')](_0x8eca('0x75'),_0x5ae5ac[_0x8eca('0x60')][_0x8eca('0x39')]);_0x4b0505[_0x8eca('0x28')]['channel']=_0x4b0505[_0x8eca('0x76')];_0x4b0505['message'][_0x8eca('0x77')]=_0x4b0505[_0x8eca('0x76')];_0x4b0505[_0x8eca('0x28')][_0x8eca('0x78')]=_0x8eca('0x5b');return respondWithRpcPromise(_0x8eca('0x79'),'EventManager',{'event':_0x8eca('0x7a'),'message':_0x4b0505[_0x8eca('0x28')]},client9002)['then'](function(){return _0x4b0505;});}return _0x4b0505;}return null;})[_0x8eca('0x37')](respondWithResult(_0x3f5274,null))[_0x8eca('0x52')](handleError(_0x3f5274,null));};var interaction_log=require(_0x8eca('0x17'))(_0x8eca('0x5a'));exports['reject']=function(_0x35f8fc,_0x1ffa2e,_0x2db2ae){var _0x13a4d4={'agent':{},'channel':_0x8eca('0x5c')};if(_0x35f8fc[_0x8eca('0x57')]['id']){delete _0x35f8fc[_0x8eca('0x57')]['id'];}_0x35f8fc[_0x8eca('0x57')][_0x8eca('0x5f')]=_0x35f8fc[_0x8eca('0x57')][_0x8eca('0x5f')]||_0x35f8fc['user']['id'];_0x13a4d4[_0x8eca('0x61')]['id']=_0x35f8fc['body'][_0x8eca('0x5f')];return db[_0x8eca('0x3c')][_0x8eca('0x58')]({'where':{'id':_0x35f8fc[_0x8eca('0x54')]['id'],'UserId':null}})[_0x8eca('0x37')](handleEntityNotFound(_0x1ffa2e,null))[_0x8eca('0x37')](function(_0x21dfd0){if(_0x21dfd0){_0x13a4d4[_0x8eca('0x28')]=_0x21dfd0[_0x8eca('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x8eca('0x58')]({'where':{'id':_0x21dfd0[_0x8eca('0x63')]}});}return null;})[_0x8eca('0x37')](handleEntityNotFound(_0x1ffa2e,null))[_0x8eca('0x37')](function(_0x1c1ab5){if(_0x1c1ab5){_0x13a4d4[_0x8eca('0x65')]=_0x1c1ab5['get']({'plain':!![]});interaction_log['info'](_0x8eca('0x7b'),_0x35f8fc['user']['id'],_0x35f8fc[_0x8eca('0x60')]['name'],_0x35f8fc[_0x8eca('0x60')]['role'],_0x13a4d4[_0x8eca('0x65')]['id'],_0x35f8fc[_0x8eca('0x57')]?JSON['stringify'](_0x35f8fc[_0x8eca('0x57')]):_0x8eca('0x68'));return respondWithRpcPromise(_0x8eca('0x7c'),_0x8eca('0x7d'),_0x13a4d4);}return null;})[_0x8eca('0x37')](function(_0x5bea92){var _0x5671ae=_0x8eca('0x6b')+_0x5bea92['message'][_0x8eca('0x7e')];return db[_0x8eca('0x6c')][_0x8eca('0x42')](_0x5671ae,{'type':db[_0x8eca('0x6d')][_0x8eca('0x7f')]['SELECT'],'raw':!![]})[_0x8eca('0x37')](function(_0x26099d){return _0x26099d;});})[_0x8eca('0x37')](function(_0x563326){if(_0x563326){_0x13a4d4['message'][_0x8eca('0x80')]=_0x563326[0x0];if(!_0x35f8fc[_0x8eca('0x57')]['UserId'])return;return db[_0x8eca('0x81')][_0x8eca('0x58')]({'where':{'id':_0x35f8fc[_0x8eca('0x57')][_0x8eca('0x5f')],'role':_0x8eca('0x61')},'attributes':['id',_0x8eca('0x39'),_0x8eca('0x6f'),_0x8eca('0x70'),_0x8eca('0x71')],'raw':!![]});}return null;})['then'](function(_0x3e07dd){if(!_0x3e07dd)return null;_0x13a4d4[_0x8eca('0x28')][_0x8eca('0x61')]=_0x3e07dd;return _0x13a4d4;})[_0x8eca('0x37')](function(_0x5e33ac){if(_0x5e33ac){_0x5e33ac[_0x8eca('0x28')]['interface']=util[_0x8eca('0x74')](_0x8eca('0x75'),_0x35f8fc[_0x8eca('0x60')][_0x8eca('0x39')]);_0x5e33ac[_0x8eca('0x28')][_0x8eca('0x76')]=_0x13a4d4[_0x8eca('0x76')];_0x5e33ac['message'][_0x8eca('0x77')]=_0x13a4d4[_0x8eca('0x76')];_0x5e33ac[_0x8eca('0x28')][_0x8eca('0x78')]='reject';respondWithRpcPromise(_0x8eca('0x79'),'EventManager',{'event':'rejectmessage','message':_0x5e33ac[_0x8eca('0x28')]},client9002);return _0x13a4d4;}return null;})[_0x8eca('0x37')](respondWithResult(_0x1ffa2e,null))[_0x8eca('0x52')](handleError(_0x1ffa2e,null));};exports['status']=function(_0x918fae,_0x1a64e3,_0x2f261f){if(_0x918fae['body']['id']){delete _0x918fae[_0x8eca('0x57')]['id'];}var _0x4cc0f2;return db[_0x8eca('0x3c')][_0x8eca('0x58')]({'where':{'id':_0x918fae[_0x8eca('0x54')]['id']}})['then'](handleEntityNotFound(_0x1a64e3,null))[_0x8eca('0x37')](function(_0x183ba5){if(_0x183ba5){_0x4cc0f2=_0x183ba5;return db['SmsAccount'][_0x8eca('0x58')]({'where':{'id':_0x183ba5[_0x8eca('0x82')]}});}})['then'](handleEntityNotFound(_0x1a64e3,null))['then'](function(_0x55a7fb){if(_0x55a7fb){logger[_0x8eca('0x24')](_0x8eca('0x25'),_0x8eca('0x2b'),_0x8eca('0x83'),_0x55a7fb['type'],util[_0x8eca('0x84')](_0x918fae[_0x8eca('0x57')],{'showHidden':![],'depth':null}));switch(_0x55a7fb[_0x8eca('0x3f')]){case _0x8eca('0x85'):if(_0x918fae[_0x8eca('0x57')][_0x8eca('0x86')]&&_0x918fae[_0x8eca('0x57')]['MessageSid']===_0x4cc0f2['messageId']){return _0x4cc0f2['update']({'read':!![]});}else{logger[_0x8eca('0x27')](_0x8eca('0x87'),'status','twilio',util[_0x8eca('0x84')](_0x918fae[_0x8eca('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x918fae[_0x8eca('0x57')]['MessageUUID']&&_0x918fae['body'][_0x8eca('0x88')]===_0x4cc0f2[_0x8eca('0x89')]&&_[_0x8eca('0x8a')]([_0x8eca('0x8b'),'delivered'],_0x918fae[_0x8eca('0x57')][_0x8eca('0x8c')])>=0x0){return _0x4cc0f2['update']({'read':!![]});}else{logger[_0x8eca('0x27')](_0x8eca('0x87'),'status',_0x8eca('0x8d'),util['inspect'](_0x918fae['body'],{'showHidden':![],'depth':null}));}break;case _0x8eca('0x8e'):var _0x3dace3=_0x918fae[_0x8eca('0x57')]['results'][0x0];if(_0x3dace3[_0x8eca('0x2b')][_0x8eca('0x8f')]==='DELIVERED'){return _0x4cc0f2['update']({'read':!![]});}else{logger[_0x8eca('0x27')](_0x8eca('0x87'),_0x8eca('0x2b'),_0x8eca('0x8e'),util[_0x8eca('0x84')](_0x918fae['body'],{'showHidden':![],'depth':null}));}break;}return _0x4cc0f2;}})[_0x8eca('0x37')](respondWithResult(_0x1a64e3,null))[_0x8eca('0x52')](handleError(_0x1a64e3,null));}; \ No newline at end of file +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(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x66fa,0x117));var _0xa66f=function(_0x598a75,_0x1776ff){_0x598a75=_0x598a75-0x0;var _0xce8613=_0x66fa[_0x598a75];return _0xce8613;};'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 diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5c9c808..fa87717 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 _0xc221=['emit','hasOwnProperty','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xc221,0x183));var _0x1c22=function(_0x2e894a,_0x4803c1){_0x2e894a=_0x2e894a-0x0;var _0x181ef0=_0xc221[_0x2e894a];return _0x181ef0;};'use strict';var EventEmitter=require(_0x1c22('0x0'));var SmsMessage=require(_0x1c22('0x1'))['db'][_0x1c22('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1c22('0x3')](0x0);var events={'afterCreate':_0x1c22('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x438f25){return function(_0x3872a5,_0x3b010e,_0x37c008){SmsMessageEvents[_0x1c22('0x5')](_0x438f25+':'+_0x3872a5['id'],_0x3872a5);SmsMessageEvents['emit'](_0x438f25,_0x3872a5);_0x37c008(null);};}for(var e in events){if(events[_0x1c22('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xebe0=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x22c04b,_0x47650f){var _0x3e8699=function(_0x176b20){while(--_0x176b20){_0x22c04b['push'](_0x22c04b['shift']());}};_0x3e8699(++_0x47650f);}(_0xebe0,0x181));var _0x0ebe=function(_0x3135f8,_0x4a29cd){_0x3135f8=_0x3135f8-0x0;var _0x1cbdb9=_0xebe0[_0x3135f8];return _0x1cbdb9;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x0ebe('0x0'))['db'][_0x0ebe('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ebe('0x2')](0x0);var events={'afterCreate':_0x0ebe('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31ed8e){return function(_0x5278d2,_0x167206,_0x2fd669){SmsMessageEvents[_0x0ebe('0x4')](_0x31ed8e+':'+_0x5278d2['id'],_0x5278d2);SmsMessageEvents['emit'](_0x31ed8e,_0x5278d2);_0x2fd669(null);};}for(var e in events){if(events[_0x0ebe('0x5')](e)){var event=events[e];SmsMessage[_0x0ebe('0x6')](e,emitEvent(event));}}module[_0x0ebe('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7631d17..fb0c670 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 _0x2b84=['signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','toString','intelepeer','Bearer\x20','code','message','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','error','secret','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','internal_order_id','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2b84,0x105));var _0x42b8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2b84[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x42b8('0x0'));var util=require('util');var logger=require(_0x42b8('0x1'))(_0x42b8('0x2'));var moment=require(_0x42b8('0x3'));var BPromise=require(_0x42b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b8('0x5'));var rimraf=require(_0x42b8('0x6'));var config=require(_0x42b8('0x7'));var attributes=require(_0x42b8('0x8'));module[_0x42b8('0x9')]=function(_0x396739,_0x25b33e){return _0x396739[_0x42b8('0xa')]('SmsMessage',attributes,{'tableName':_0x42b8('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x42b8('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x42b8('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x10bf92,_0x2e59e8,_0x17b384){var _0x1ce7ee=_0x396739['models'];var _0xb735d4=_0x10bf92[_0x42b8('0xe')]({'plain':!![]});if(_0xb735d4[_0x42b8('0xf')]['toLowerCase']()==='in'||_0xb735d4[_0x42b8('0xf')][_0x42b8('0x10')]()===_0x42b8('0x11')&&!_0xb735d4['secret']&&!_[_0x42b8('0x12')](_0xb735d4[_0x42b8('0x13')])){_0x1ce7ee['SmsInteraction'][_0x42b8('0x14')]({'where':{'id':_0xb735d4[_0x42b8('0x15')]}})[_0x42b8('0x16')](function(_0xe8c8fd){if(_0xe8c8fd){_0xe8c8fd[_0x42b8('0x17')]({'lastMsgAt':_0xb735d4[_0x42b8('0x18')],'lastMsgDirection':_0xb735d4[_0x42b8('0xf')]['toLowerCase']()});}})['catch'](function(_0x276222){console[_0x42b8('0x19')](_0x276222);});}if(_0xb735d4[_0x42b8('0xf')]==='out'&&!_0xb735d4[_0x42b8('0x1a')]){var _0x4201f4;_0x1ce7ee['SmsAccount'][_0x42b8('0x1b')]({'where':{'id':_0xb735d4[_0x42b8('0x1c')]},'raw':!![]})[_0x42b8('0x16')](function(_0xb943df){_0x4201f4=_0xb943df;if(_0x4201f4&&_0x4201f4[_0x42b8('0x1d')]){switch(_0x4201f4[_0x42b8('0x1d')]){case _0x42b8('0x1e'):var _0x33ae87=require(_0x42b8('0x1e'));if(_0x4201f4['accountSid']&&_0x4201f4[_0x42b8('0x1f')]&&_0x4201f4[_0x42b8('0x20')]){var _0x561568=new _0x33ae87(_0x4201f4[_0x42b8('0x21')],_0x4201f4[_0x42b8('0x1f')]);_0x561568[_0x42b8('0x22')][_0x42b8('0x23')]({'body':_0xb735d4[_0x42b8('0x24')],'to':_0xb735d4[_0x42b8('0x20')],'from':_0x4201f4[_0x42b8('0x20')],'statusCallback':_0x4201f4[_0x42b8('0x25')]+_0x42b8('0x26')+_0xb735d4['id']+_0x42b8('0x27')+_0x4201f4[_0x42b8('0x28')]})[_0x42b8('0x16')](function(_0x41f708){if(_0x41f708[_0x42b8('0x29')]){return _0x10bf92[_0x42b8('0x17')]({'messageId':_0x41f708['sid']});}})[_0x42b8('0x2a')](function(_0x316c98){logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x1e'),util[_0x42b8('0x2d')](_0x316c98,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x3e503d=_0x42b8('0x2e');if(_0x4201f4[_0x42b8('0x2f')]&&_0x4201f4['password']){var _0x559e98={'recipient':[_0xb735d4[_0x42b8('0x20')]],'message':_0xb735d4[_0x42b8('0x24')],'message_type':_0x4201f4[_0x42b8('0x30')]};if(_0x4201f4['smsMethod']&&_0x4201f4[_0x42b8('0x30')]!=='SI'){_0x559e98[_0x42b8('0x31')]=_0x4201f4[_0x42b8('0x20')];}var _0x4469ce={'url':_0x3e503d+_0x42b8('0x32')+_0x4201f4[_0x42b8('0x2f')]+_0x42b8('0x33')+_0x4201f4[_0x42b8('0x34')],'method':_0x42b8('0x35')};rp(_0x4469ce)['then'](function(_0x325e20){var _0xa419e5=_0x325e20[_0x42b8('0x36')](';');var _0x19308a={'user_key':_0xa419e5[0x0],'session_key':_0xa419e5[0x1]};_0x4469ce={'url':_0x3e503d+_0x42b8('0x37'),'method':_0x42b8('0x38'),'headers':{'user_key':_0x19308a[_0x42b8('0x39')],'Session_key':_0x19308a['session_key']},'json':!![],'body':_0x559e98};return rp(_0x4469ce);})[_0x42b8('0x16')](function(_0x3006ff){if(_0x3006ff[_0x42b8('0x3a')]>=0x1){var _0x55de8a={'messageId':_0x3006ff[_0x42b8('0x3b')]};if(_0x4201f4['smsMethod']!=='GP'||!_0x4201f4['deliveryReport']){_0x55de8a['read']=!![];}return _0x10bf92[_0x42b8('0x17')](_0x55de8a);}else{return logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x3c'),util[_0x42b8('0x2d')](_0x3006ff,{'showHidden':![],'depth':null}));}})[_0x42b8('0x2a')](function(_0x518711){return logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),'skebby',util[_0x42b8('0x2d')](_0x518711,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42b8('0x3c'),_0x42b8('0x3d'));}break;case _0x42b8('0x3e'):if(_0x4201f4[_0x42b8('0x1f')]){var _0x3bfee7={'recipient':_0xb735d4[_0x42b8('0x20')],'message':_0xb735d4['body'],'sender':_0x4201f4['senderString']||_0x4201f4[_0x42b8('0x20')],'authorization':_0x4201f4[_0x42b8('0x1f')]};var _0x2e59e8={'method':_0x42b8('0x38'),'uri':_0x42b8('0x3f'),'body':_0x3bfee7,'json':!![]};rp(_0x2e59e8)[_0x42b8('0x16')](function(_0x4c4534){var _0x1d0548={'messageId':_0x4c4534[_0x42b8('0x40')]};if(!_0x4201f4[_0x42b8('0x41')]){_0x1d0548[_0x42b8('0x42')]=!![];}return _0x10bf92[_0x42b8('0x17')](_0x1d0548);})['catch'](function(_0x3a17b1){logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42b8('0x2c'),'connectel',util[_0x42b8('0x2d')](_0x3a17b1,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),'afterCreate',_0x42b8('0x3e'),_0x42b8('0x43'));}break;case'clicksend':if(_0x4201f4[_0x42b8('0x2f')]&&_0x4201f4['password']){var _0x3bfee7={'messages':[{'source':_0x42b8('0x44'),'to':_0xb735d4['phone'],'body':_0xb735d4[_0x42b8('0x24')],'from':_0x4201f4[_0x42b8('0x45')]||_0x4201f4[_0x42b8('0x20')]}]};var _0x162deb=util[_0x42b8('0x46')](_0x42b8('0x47'),_0x4201f4[_0x42b8('0x2f')],_0x4201f4[_0x42b8('0x34')]);var _0x2e59e8={'method':_0x42b8('0x38'),'uri':_0x42b8('0x48'),'body':_0x3bfee7,'headers':{'Authorization':util[_0x42b8('0x46')](_0x42b8('0x49'),new Buffer(_0x162deb)['toString'](_0x42b8('0x4a')))},'json':!![]};rp(_0x2e59e8)['then'](function(_0x1e3ea4){if(_0x1e3ea4[_0x42b8('0x4b')]>=0xc8&&_0x1e3ea4[_0x42b8('0x4b')]<=0xce){if(_0x1e3ea4[_0x42b8('0x4c')]&&_0x1e3ea4[_0x42b8('0x4c')]['queued_count']>0x0){var _0x58c047=_[_0x42b8('0x4d')](_0x1e3ea4['data'][_0x42b8('0x22')]);var _0x2e882b={'messageId':_0x58c047['message_id']};if(!_0x4201f4[_0x42b8('0x41')]){_0x2e882b[_0x42b8('0x42')]=!![];}return _0x10bf92[_0x42b8('0x17')](_0x2e882b);}else{logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x42b8('0x2d')](_0x1e3ea4,{'showHidden':![],'depth':null}));}}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x4e'),util[_0x42b8('0x2d')](_0x1e3ea4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1d20bc){logger[_0x42b8('0x19')](_0x42b8('0x2b'),'afterCreate',_0x42b8('0x4e'),util[_0x42b8('0x2d')](_0x1d20bc,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),'afterCreate',_0x42b8('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x42b8('0x4f'):if(_0x4201f4[_0x42b8('0x50')]&&_0x4201f4['authToken']){var _0x3bfee7={'dst':_0xb735d4[_0x42b8('0x20')],'text':_0xb735d4[_0x42b8('0x24')],'src':_0x4201f4[_0x42b8('0x45')]||_0x4201f4[_0x42b8('0x20')],'url':_0x4201f4[_0x42b8('0x25')]+'/api/sms/messages/'+_0xb735d4['id']+'/status?token='+_0x4201f4[_0x42b8('0x28')]};var _0x162deb=util[_0x42b8('0x46')](_0x42b8('0x47'),_0x4201f4[_0x42b8('0x50')],_0x4201f4[_0x42b8('0x1f')]);var _0x2e59e8={'method':_0x42b8('0x38'),'uri':util[_0x42b8('0x46')](_0x42b8('0x51'),_0x4201f4[_0x42b8('0x50')]),'body':_0x3bfee7,'headers':{'Authorization':util[_0x42b8('0x46')](_0x42b8('0x49'),new Buffer(_0x162deb)['toString']('base64'))},'json':!![]};rp(_0x2e59e8)['then'](function(_0x5efe01){var _0x169db6={'messageId':_0x5efe01[_0x42b8('0x52')][0x0]};return _0x10bf92[_0x42b8('0x17')](_0x169db6);})['catch'](function(_0x5ed1de){logger['error'](_0x42b8('0x2b'),'afterCreate',_0x42b8('0x4f'),util[_0x42b8('0x2d')](_0x5ed1de,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42b8('0x2c'),_0x42b8('0x4f'),_0x42b8('0x53'));}break;case _0x42b8('0x54'):if(_0x4201f4[_0x42b8('0x2f')]&&_0x4201f4[_0x42b8('0x34')]){if(_0x4201f4[_0x42b8('0x55')]){var _0x326524={'method':'POST','uri':_0x4201f4[_0x42b8('0x55')]+_0x42b8('0x56'),'body':{'username':_0x4201f4['username'],'password':_0x4201f4[_0x42b8('0x34')]},'json':!![]};return rp(_0x326524)[_0x42b8('0x16')](function(_0x493c95){var _0x19b918={'method':'POST','uri':_0x4201f4['baseUrl']+_0x42b8('0x57'),'body':{'messages':[{'from':_0x4201f4[_0x42b8('0x20')],'destinations':[{'to':_0xb735d4[_0x42b8('0x20')]}],'text':_0xb735d4[_0x42b8('0x24')],'notifyUrl':_0x4201f4['remote']+'/api/sms/messages/'+_0xb735d4['id']+_0x42b8('0x27')+_0x4201f4[_0x42b8('0x28')],'notifyContentType':_0x42b8('0x58'),'callbackData':_0x4201f4[_0x42b8('0x20')]+';'+_0xb735d4['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x493c95[_0x42b8('0x28')]},'json':!![]};return rp(_0x19b918)[_0x42b8('0x16')](function(_0x3c2e96){if(_0x3c2e96[_0x42b8('0x22')]){var _0x1eacec={'messageId':_0x3c2e96['messages'][0x0][_0x42b8('0xc')]};if(!_0x4201f4['deliveryReport']){_0x1eacec[_0x42b8('0x42')]=!![];}return _0x10bf92['update'](_0x1eacec);}else{return logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),'infobip',util[_0x42b8('0x2d')](_0x3c2e96,{'showHidden':![],'depth':null}));}});})[_0x42b8('0x2a')](function(_0x259d82){return logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),'infobip',util[_0x42b8('0x2d')](_0x259d82,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x54'),_0x42b8('0x59'));}}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x54'),_0x42b8('0x3d'));}break;case _0x42b8('0x5a'):var _0x36023f=require('crypto');if(_0x4201f4[_0x42b8('0x5b')]){var _0x21fc85={};_0x21fc85[_0x42b8('0x5c')]=_0x4201f4['username'];_0x21fc85[_0x42b8('0x20')]=_0xb735d4[_0x42b8('0x20')];_0x21fc85['sender']=_0x4201f4[_0x42b8('0x20')];_0x21fc85[_0x42b8('0x5d')]=_0xb735d4[_0x42b8('0x24')];_0x21fc85[_0x42b8('0x5e')]=+new Date();var _0x2dd99d='';var _0x419a0f='';var _0xe6881e=Object[_0x42b8('0x5f')](_0x21fc85);_0xe6881e[_0x42b8('0x60')]();for(var _0x28c0eb=0x0;_0x28c0eb<_0xe6881e[_0x42b8('0x61')];_0x28c0eb++){if(_0x2dd99d!=''){_0x2dd99d+='&';}_0x2dd99d+=_0xe6881e[_0x28c0eb]+'='+encodeURIComponent(_0x21fc85[_0xe6881e[_0x28c0eb]]);_0x419a0f+=_0x21fc85[_0xe6881e[_0x28c0eb]];}_0x419a0f+=_0x4201f4[_0x42b8('0x5b')];_0x419a0f=_0x36023f[_0x42b8('0x62')](_0x42b8('0x63'))[_0x42b8('0x17')](_0x419a0f)[_0x42b8('0x64')](_0x42b8('0x65'));if(_0x2dd99d!==''){_0x2dd99d+='&';}_0x2dd99d+=_0x42b8('0x66')+_0x419a0f;var _0x4469ce={'method':_0x42b8('0x35'),'uri':_0x4201f4[_0x42b8('0x55')]+_0x42b8('0x67')+_0x2dd99d,'json':!![]};return rp(_0x4469ce)[_0x42b8('0x16')](function(_0x1ade51){var _0x2335d6=Object[_0x42b8('0x5f')](_0x1ade51);if(_0x1ade51[_0x2335d6[0x0]][_0x42b8('0x19')]&&parseInt(_0x1ade51[_0x2335d6[0x0]][_0x42b8('0x19')])===0x0){var _0x1a6402={'messageId':_0x1ade51[_0x2335d6[0x0]][_0x42b8('0x68')]};if(!_0x4201f4['deliveryReport']){_0x1a6402[_0x42b8('0x42')]=!![];}return _0x10bf92[_0x42b8('0x17')](_0x1a6402);}else{return logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x5a'),util[_0x42b8('0x2d')](_0x1ade51[_0x42b8('0x19')],{'showHidden':![],'depth':null}));}})[_0x42b8('0x2a')](function(_0x169985){return logger['error'](_0x42b8('0x2b'),_0x42b8('0x2c'),'csc',util[_0x42b8('0x2d')](_0x169985,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42b8('0x2c'),_0x42b8('0x5a'),_0x42b8('0x69'));}break;case _0x42b8('0x6a'):if(_0x4201f4[_0x42b8('0x5b')]){var _0x135436={'method':'POST','uri':_0x42b8('0x6b'),'headers':{'Authorization':_0x4201f4[_0x42b8('0x5b')]},'body':{'content':_0xb735d4[_0x42b8('0x24')],'to':[_0xb735d4[_0x42b8('0x20')]],'from':_0x4201f4[_0x42b8('0x20')],'binary':![],'clientMessageId':_0x42b8('0x6c'),'charset':_0x42b8('0x6d')},'json':!![]};rp(_0x135436)[_0x42b8('0x16')](function(_0x57b57d){if(!_0x57b57d[_0x42b8('0x19')]){var _0x157087={'messageId':_0x57b57d[_0x42b8('0x22')][0x0]['apiMessageId']};if(!_0x4201f4[_0x42b8('0x41')]){_0x157087[_0x42b8('0x42')]=!![];}return _0x10bf92[_0x42b8('0x17')](_0x157087);}else{return logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42b8('0x6a'),util[_0x42b8('0x2d')](_0x57b57d[_0x42b8('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x43b23c){return logger[_0x42b8('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42b8('0x2c'),'clickatell',util['inspect'](_0x43b23c,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x6a'),_0x42b8('0x69'));}break;case _0x42b8('0x6e'):if(_0x4201f4[_0x42b8('0x2f')]&&_0x4201f4['password']){var _0x162deb=util[_0x42b8('0x46')]('%s:%s',_0x4201f4['username'],_0x4201f4[_0x42b8('0x34')]);var _0x2e59e8={'method':_0x42b8('0x38'),'uri':_0x42b8('0x6f')+_0x4201f4['accountId']+'/messages','body':{'to':[_0xb735d4[_0x42b8('0x20')]],'text':_0xb735d4[_0x42b8('0x24')],'from':_0x4201f4[_0x42b8('0x20')],'applicationId':_0x4201f4['applicationId']},'headers':{'Authorization':util[_0x42b8('0x46')]('Basic\x20%s',new Buffer(_0x162deb)[_0x42b8('0x70')]('base64'))},'json':!![]};rp(_0x2e59e8)[_0x42b8('0x16')](function(_0x5bd8c7){if(_0x5bd8c7['id']){var _0x58519e={'messageId':_0x5bd8c7['id']};return _0x10bf92[_0x42b8('0x17')](_0x58519e);}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),'afterCreate',_0x42b8('0x6e'),util['inspect'](_0x5bd8c7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x22fcbf){logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),'bandwidth',util[_0x42b8('0x2d')](_0x22fcbf,{'showHidden':![],'depth':null}));});}else{logger[_0x42b8('0x19')](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x6e'),_0x42b8('0x3d'));}break;case _0x42b8('0x71'):if(_0x4201f4['apiKey']){var _0x2d6e69={};var _0x4469ce={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x42b8('0x72')+_0x4201f4['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x4201f4[_0x42b8('0x20')],'to':_0xb735d4['phone'],'text':_0xb735d4[_0x42b8('0x24')]},'json':!![]};return rp(_0x4469ce)[_0x42b8('0x16')](function(_0x2e59ae){if(_0x2e59ae[_0x42b8('0x73')]==0xca){_0x2d6e69[_0x42b8('0x74')]=_0x2e59ae;var _0x5441c2={'method':_0x42b8('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x42b8('0x72')+_0x4201f4[_0x42b8('0x5b')],'Content-Type':_0x42b8('0x58')},'body':{'refid':_0x2d6e69[_0x42b8('0x74')]['refid']},'json':!![]};return rp(_0x5441c2)[_0x42b8('0x16')](function(_0x2b8c2c){_0x2d6e69[_0x42b8('0x75')]=_0x2b8c2c;var _0x380a74={'messageId':_0x2d6e69[_0x42b8('0x74')]['refid'],'read':!![]};return _0x10bf92[_0x42b8('0x17')](_0x380a74);});}else{return logger['error'](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x71'),util[_0x42b8('0x2d')](_0x2e59ae,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2caf72){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42b8('0x2c'),_0x42b8('0x71'),util[_0x42b8('0x2d')](_0x2caf72,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x42b8('0x2b'),_0x42b8('0x2c'),_0x42b8('0x71'),'Token\x20not\x20received');}break;}}})[_0x42b8('0x76')](function(){_0x17b384();});}else{_0x17b384();}}},'charset':_0x42b8('0x77'),'collate':_0x42b8('0x78')});}; \ No newline at end of file +var _0xfbb4=['bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsMessage.attributes','exports','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','split','POST','session_key','total_sent','internal_order_id','read','afterCreate','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','authId','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbb4,0x186));var _0x4fbb=function(_0x2f27e4,_0x333da7){_0x2f27e4=_0x2f27e4-0x0;var _0x523116=_0xfbb4[_0x2f27e4];return _0x523116;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var logger=require(_0x4fbb('0x2'))(_0x4fbb('0x3'));var moment=require(_0x4fbb('0x4'));var BPromise=require(_0x4fbb('0x5'));var rp=require(_0x4fbb('0x6'));var fs=require('fs');var path=require(_0x4fbb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fbb('0x8'));module[_0x4fbb('0x9')]=function(_0x2b5756,_0x306f07){return _0x2b5756['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4fbb('0xa')]},{'name':_0x4fbb('0xb'),'fields':['body'],'type':_0x4fbb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc3ed78,_0x4cac34,_0x360c27){var _0x208526=_0x2b5756[_0x4fbb('0xd')];var _0x35185e=_0xc3ed78[_0x4fbb('0xe')]({'plain':!![]});if(_0x35185e['direction'][_0x4fbb('0xf')]()==='in'||_0x35185e[_0x4fbb('0x10')][_0x4fbb('0xf')]()===_0x4fbb('0x11')&&!_0x35185e[_0x4fbb('0x12')]&&!_['isNil'](_0x35185e['UserId'])){_0x208526[_0x4fbb('0x13')][_0x4fbb('0x14')]({'where':{'id':_0x35185e[_0x4fbb('0x15')]}})[_0x4fbb('0x16')](function(_0x4c180c){if(_0x4c180c){_0x4c180c[_0x4fbb('0x17')]({'lastMsgAt':_0x35185e['createdAt'],'lastMsgDirection':_0x35185e['direction'][_0x4fbb('0xf')]()});}})[_0x4fbb('0x18')](function(_0x4c47ff){console[_0x4fbb('0x19')](_0x4c47ff);});}if(_0x35185e[_0x4fbb('0x10')]==='out'&&!_0x35185e['secret']){var _0x3dd52a;_0x208526[_0x4fbb('0x1a')][_0x4fbb('0x1b')]({'where':{'id':_0x35185e[_0x4fbb('0x1c')]},'raw':!![]})[_0x4fbb('0x16')](function(_0x6647c3){_0x3dd52a=_0x6647c3;if(_0x3dd52a&&_0x3dd52a[_0x4fbb('0x1d')]){switch(_0x3dd52a[_0x4fbb('0x1d')]){case _0x4fbb('0x1e'):var _0x37088b=require(_0x4fbb('0x1e'));if(_0x3dd52a[_0x4fbb('0x1f')]&&_0x3dd52a[_0x4fbb('0x20')]&&_0x3dd52a[_0x4fbb('0x21')]){var _0x1b2f36=new _0x37088b(_0x3dd52a[_0x4fbb('0x1f')],_0x3dd52a[_0x4fbb('0x20')]);_0x1b2f36[_0x4fbb('0x22')][_0x4fbb('0x23')]({'body':_0x35185e[_0x4fbb('0x24')],'to':_0x35185e[_0x4fbb('0x21')],'from':_0x3dd52a[_0x4fbb('0x21')],'statusCallback':_0x3dd52a[_0x4fbb('0x25')]+_0x4fbb('0x26')+_0x35185e['id']+'/status?token='+_0x3dd52a['token']})[_0x4fbb('0x16')](function(_0x3d1a01){if(_0x3d1a01[_0x4fbb('0x27')]){return _0xc3ed78[_0x4fbb('0x17')]({'messageId':_0x3d1a01['sid']});}})[_0x4fbb('0x18')](function(_0x11ddd3){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fbb('0x1e'),util[_0x4fbb('0x28')](_0x11ddd3,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x1e'),_0x4fbb('0x2a'));}break;case _0x4fbb('0x2b'):var _0x48a189=_0x4fbb('0x2c');if(_0x3dd52a[_0x4fbb('0x2d')]&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x25d66a={'recipient':[_0x35185e[_0x4fbb('0x21')]],'message':_0x35185e[_0x4fbb('0x24')],'message_type':_0x3dd52a[_0x4fbb('0x2f')]};if(_0x3dd52a['smsMethod']&&_0x3dd52a[_0x4fbb('0x2f')]!=='SI'){_0x25d66a['sender']=_0x3dd52a[_0x4fbb('0x21')];}var _0x31fae9={'url':_0x48a189+_0x4fbb('0x30')+_0x3dd52a[_0x4fbb('0x2d')]+'&password='+_0x3dd52a[_0x4fbb('0x2e')],'method':_0x4fbb('0x31')};rp(_0x31fae9)['then'](function(_0x4bccdf){var _0x19660f=_0x4bccdf[_0x4fbb('0x32')](';');var _0x126247={'user_key':_0x19660f[0x0],'session_key':_0x19660f[0x1]};_0x31fae9={'url':_0x48a189+'sms','method':_0x4fbb('0x33'),'headers':{'user_key':_0x126247['user_key'],'Session_key':_0x126247[_0x4fbb('0x34')]},'json':!![],'body':_0x25d66a};return rp(_0x31fae9);})[_0x4fbb('0x16')](function(_0x354488){if(_0x354488[_0x4fbb('0x35')]>=0x1){var _0x50ac50={'messageId':_0x354488[_0x4fbb('0x36')]};if(_0x3dd52a['smsMethod']!=='GP'||!_0x3dd52a['deliveryReport']){_0x50ac50[_0x4fbb('0x37')]=!![];}return _0xc3ed78['update'](_0x50ac50);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x2b'),util[_0x4fbb('0x28')](_0x354488,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x176010){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x2b'),util[_0x4fbb('0x28')](_0x176010,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'skebby',_0x4fbb('0x39'));}break;case'connectel':if(_0x3dd52a[_0x4fbb('0x20')]){var _0x1af8da={'recipient':_0x35185e['phone'],'message':_0x35185e[_0x4fbb('0x24')],'sender':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a[_0x4fbb('0x21')],'authorization':_0x3dd52a['authToken']};var _0x4cac34={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x3b'),'body':_0x1af8da,'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x22b84f){var _0x39b5e8={'messageId':_0x22b84f[_0x4fbb('0x3c')]};if(!_0x3dd52a['deliveryReport']){_0x39b5e8[_0x4fbb('0x37')]=!![];}return _0xc3ed78['update'](_0x39b5e8);})[_0x4fbb('0x18')](function(_0x4fe898){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate','connectel',util['inspect'](_0x4fe898,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x3d'),_0x4fbb('0x3e'));}break;case _0x4fbb('0x3f'):if(_0x3dd52a['username']&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x1af8da={'messages':[{'source':_0x4fbb('0x40'),'to':_0x35185e[_0x4fbb('0x21')],'body':_0x35185e[_0x4fbb('0x24')],'from':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a[_0x4fbb('0x21')]}]};var _0x16f7c4=util[_0x4fbb('0x41')](_0x4fbb('0x42'),_0x3dd52a[_0x4fbb('0x2d')],_0x3dd52a[_0x4fbb('0x2e')]);var _0x4cac34={'method':'POST','uri':_0x4fbb('0x43'),'body':_0x1af8da,'headers':{'Authorization':util[_0x4fbb('0x41')](_0x4fbb('0x44'),new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x5bbd77){if(_0x5bbd77[_0x4fbb('0x47')]>=0xc8&&_0x5bbd77[_0x4fbb('0x47')]<=0xce){if(_0x5bbd77['data']&&_0x5bbd77[_0x4fbb('0x48')][_0x4fbb('0x49')]>0x0){var _0x581cc4=_[_0x4fbb('0x4a')](_0x5bbd77[_0x4fbb('0x48')]['messages']);var _0x12bd71={'messageId':_0x581cc4[_0x4fbb('0x4b')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x12bd71[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x12bd71);}else{logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fbb('0x4d'),util['inspect'](_0x5bbd77,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),'clickSend',util[_0x4fbb('0x28')](_0x5bbd77,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0xf7f063){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x4d'),util[_0x4fbb('0x28')](_0xf7f063,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x4d'),_0x4fbb('0x39'));}break;case'plivo':if(_0x3dd52a[_0x4fbb('0x4e')]&&_0x3dd52a[_0x4fbb('0x20')]){var _0x1af8da={'dst':_0x35185e['phone'],'text':_0x35185e[_0x4fbb('0x24')],'src':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a['phone'],'url':_0x3dd52a[_0x4fbb('0x25')]+_0x4fbb('0x26')+_0x35185e['id']+_0x4fbb('0x4f')+_0x3dd52a[_0x4fbb('0x50')]};var _0x16f7c4=util[_0x4fbb('0x41')]('%s:%s',_0x3dd52a[_0x4fbb('0x4e')],_0x3dd52a['authToken']);var _0x4cac34={'method':_0x4fbb('0x33'),'uri':util['format'](_0x4fbb('0x51'),_0x3dd52a[_0x4fbb('0x4e')]),'body':_0x1af8da,'headers':{'Authorization':util[_0x4fbb('0x41')]('Basic\x20%s',new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)['then'](function(_0x1b5e35){var _0x10557a={'messageId':_0x1b5e35['message_uuid'][0x0]};return _0xc3ed78[_0x4fbb('0x17')](_0x10557a);})['catch'](function(_0x200c52){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'plivo',util['inspect'](_0x200c52,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4fbb('0x52'):if(_0x3dd52a['username']&&_0x3dd52a[_0x4fbb('0x2e')]){if(_0x3dd52a[_0x4fbb('0x53')]){var _0x371a37={'method':_0x4fbb('0x33'),'uri':_0x3dd52a[_0x4fbb('0x53')]+_0x4fbb('0x54'),'body':{'username':_0x3dd52a['username'],'password':_0x3dd52a['password']},'json':!![]};return rp(_0x371a37)[_0x4fbb('0x16')](function(_0x3f5247){var _0x2bb13b={'method':_0x4fbb('0x33'),'uri':_0x3dd52a['baseUrl']+_0x4fbb('0x55'),'body':{'messages':[{'from':_0x3dd52a[_0x4fbb('0x21')],'destinations':[{'to':_0x35185e['phone']}],'text':_0x35185e[_0x4fbb('0x24')],'notifyUrl':_0x3dd52a[_0x4fbb('0x25')]+'/api/sms/messages/'+_0x35185e['id']+_0x4fbb('0x4f')+_0x3dd52a[_0x4fbb('0x50')],'notifyContentType':_0x4fbb('0x56'),'callbackData':_0x3dd52a[_0x4fbb('0x21')]+';'+_0x35185e['body']}]},'headers':{'Authorization':_0x4fbb('0x57')+_0x3f5247['token']},'json':!![]};return rp(_0x2bb13b)[_0x4fbb('0x16')](function(_0x100fcf){if(_0x100fcf['messages']){var _0x51f1c7={'messageId':_0x100fcf['messages'][0x0][_0x4fbb('0xa')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x51f1c7['read']=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x51f1c7);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x52'),util[_0x4fbb('0x28')](_0x100fcf,{'showHidden':![],'depth':null}));}});})[_0x4fbb('0x18')](function(_0x5ac919){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x52'),util[_0x4fbb('0x28')](_0x5ac919,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x52'),_0x4fbb('0x58'));}}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x52'),_0x4fbb('0x39'));}break;case _0x4fbb('0x59'):var _0x38c475=require(_0x4fbb('0x5a'));if(_0x3dd52a[_0x4fbb('0x5b')]){var _0xe3ebcf={};_0xe3ebcf[_0x4fbb('0x5c')]=_0x3dd52a['username'];_0xe3ebcf[_0x4fbb('0x21')]=_0x35185e['phone'];_0xe3ebcf[_0x4fbb('0x5d')]=_0x3dd52a[_0x4fbb('0x21')];_0xe3ebcf['text']=_0x35185e[_0x4fbb('0x24')];_0xe3ebcf[_0x4fbb('0x5e')]=+new Date();var _0x5090af='';var _0x56cd52='';var _0x97312e=Object[_0x4fbb('0x5f')](_0xe3ebcf);_0x97312e[_0x4fbb('0x60')]();for(var _0x4cbbf5=0x0;_0x4cbbf5<_0x97312e[_0x4fbb('0x61')];_0x4cbbf5++){if(_0x5090af!=''){_0x5090af+='&';}_0x5090af+=_0x97312e[_0x4cbbf5]+'='+encodeURIComponent(_0xe3ebcf[_0x97312e[_0x4cbbf5]]);_0x56cd52+=_0xe3ebcf[_0x97312e[_0x4cbbf5]];}_0x56cd52+=_0x3dd52a[_0x4fbb('0x5b')];_0x56cd52=_0x38c475[_0x4fbb('0x62')](_0x4fbb('0x63'))[_0x4fbb('0x17')](_0x56cd52)[_0x4fbb('0x64')](_0x4fbb('0x65'));if(_0x5090af!==''){_0x5090af+='&';}_0x5090af+=_0x4fbb('0x66')+_0x56cd52;var _0x31fae9={'method':_0x4fbb('0x31'),'uri':_0x3dd52a['baseUrl']+_0x4fbb('0x67')+_0x5090af,'json':!![]};return rp(_0x31fae9)[_0x4fbb('0x16')](function(_0x3bb761){var _0x336bcc=Object[_0x4fbb('0x5f')](_0x3bb761);if(_0x3bb761[_0x336bcc[0x0]][_0x4fbb('0x19')]&&parseInt(_0x3bb761[_0x336bcc[0x0]]['error'])===0x0){var _0x5d0299={'messageId':_0x3bb761[_0x336bcc[0x0]][_0x4fbb('0x68')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x5d0299[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x5d0299);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x59'),util[_0x4fbb('0x28')](_0x3bb761[_0x4fbb('0x19')],{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x2a0ba3){return logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x59'),util[_0x4fbb('0x28')](_0x2a0ba3,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate','csc',_0x4fbb('0x69'));}break;case _0x4fbb('0x6a'):if(_0x3dd52a[_0x4fbb('0x5b')]){var _0x424742={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x6b'),'headers':{'Authorization':_0x3dd52a[_0x4fbb('0x5b')]},'body':{'content':_0x35185e['body'],'to':[_0x35185e[_0x4fbb('0x21')]],'from':_0x3dd52a[_0x4fbb('0x21')],'binary':![],'clientMessageId':_0x4fbb('0x6c'),'charset':_0x4fbb('0x6d')},'json':!![]};rp(_0x424742)[_0x4fbb('0x16')](function(_0x5da541){if(!_0x5da541[_0x4fbb('0x19')]){var _0x3fad74={'messageId':_0x5da541[_0x4fbb('0x22')][0x0][_0x4fbb('0x6e')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x3fad74[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x3fad74);}else{return logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x6a'),util[_0x4fbb('0x28')](_0x5da541['error'],{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x149e5c){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x6a'),util[_0x4fbb('0x28')](_0x149e5c,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x6a'),_0x4fbb('0x69'));}break;case'bandwidth':if(_0x3dd52a[_0x4fbb('0x2d')]&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x16f7c4=util[_0x4fbb('0x41')](_0x4fbb('0x42'),_0x3dd52a[_0x4fbb('0x2d')],_0x3dd52a[_0x4fbb('0x2e')]);var _0x4cac34={'method':'POST','uri':_0x4fbb('0x6f')+_0x3dd52a['accountId']+_0x4fbb('0x70'),'body':{'to':[_0x35185e[_0x4fbb('0x21')]],'text':_0x35185e['body'],'from':_0x3dd52a[_0x4fbb('0x21')],'applicationId':_0x3dd52a[_0x4fbb('0x71')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x274e8a){if(_0x274e8a['id']){var _0x16de5e={'messageId':_0x274e8a['id']};return _0xc3ed78['update'](_0x16de5e);}else{logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),util[_0x4fbb('0x28')](_0x274e8a,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x4c3be3){logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),util[_0x4fbb('0x28')](_0x4c3be3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4fbb('0x73'):if(_0x3dd52a[_0x4fbb('0x5b')]){var _0x38cc62={};var _0x31fae9={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x74'),'headers':{'Authorization':_0x4fbb('0x75')+_0x3dd52a[_0x4fbb('0x5b')],'Content-Type':_0x4fbb('0x56')},'body':{'from':_0x3dd52a['phone'],'to':_0x35185e['phone'],'text':_0x35185e[_0x4fbb('0x24')]},'json':!![]};return rp(_0x31fae9)['then'](function(_0x4fb052){if(_0x4fb052['code']==0xca){_0x38cc62[_0x4fbb('0x76')]=_0x4fb052;var _0x10b363={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x77'),'headers':{'Authorization':_0x4fbb('0x75')+_0x3dd52a[_0x4fbb('0x5b')],'Content-Type':_0x4fbb('0x56')},'body':{'refid':_0x38cc62[_0x4fbb('0x76')][_0x4fbb('0x78')]},'json':!![]};return rp(_0x10b363)[_0x4fbb('0x16')](function(_0x1ec8e8){_0x38cc62[_0x4fbb('0x79')]=_0x1ec8e8;var _0x3d2d4e={'messageId':_0x38cc62[_0x4fbb('0x76')][_0x4fbb('0x78')],'read':!![]};return _0xc3ed78[_0x4fbb('0x17')](_0x3d2d4e);});}else{return logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),'intelepeer',util[_0x4fbb('0x28')](_0x4fb052,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2e8b98){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x73'),util['inspect'](_0x2e8b98,{'showHidden':![],'depth':null}));});}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'intelepeer',_0x4fbb('0x7a'));}break;}}})[_0x4fbb('0x7b')](function(){_0x360c27();});}else{_0x360c27();}}},'charset':_0x4fbb('0x7c'),'collate':_0x4fbb('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2aebafa..7ee8665 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 _0x9740=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','catch','CreateSmsMessage','SmsMessage','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x420e53,_0x12cefd){var _0x49634e=function(_0xfcefc6){while(--_0xfcefc6){_0x420e53['push'](_0x420e53['shift']());}};_0x49634e(++_0x12cefd);}(_0x9740,0x1be));var _0x0974=function(_0x57ffa3,_0x4674fd){_0x57ffa3=_0x57ffa3-0x0;var _0xcb184b=_0x9740[_0x57ffa3];return _0xcb184b;};'use strict';var _=require(_0x0974('0x0'));var util=require(_0x0974('0x1'));var moment=require(_0x0974('0x2'));var BPromise=require('bluebird');var rs=require(_0x0974('0x3'));var fs=require('fs');var Redis=require(_0x0974('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0974('0x5'))(_0x0974('0x6'));var config=require(_0x0974('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0974('0x8')][_0x0974('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0974('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0974('0xb'))(new Redis(config[_0x0974('0xa')]));require(_0x0974('0xc'))[_0x0974('0xd')](socket);function respondWithRpcPromise(_0x4b9b0e,_0x4ac5ab,_0x8e0ecc){return new BPromise(function(_0x31d067,_0x325a74){return client[_0x0974('0xe')](_0x4b9b0e,_0x8e0ecc)['then'](function(_0x573bf1){logger[_0x0974('0xf')](_0x0974('0x10'),_0x4ac5ab,_0x0974('0x11'));logger[_0x0974('0x12')](_0x0974('0x13'),_0x4ac5ab,_0x0974('0x11'),JSON['stringify'](_0x573bf1));if(_0x573bf1[_0x0974('0x14')]){if(_0x573bf1[_0x0974('0x14')]['code']===0x1f4){logger[_0x0974('0x14')]('SmsMessage,\x20%s,\x20%s',_0x4ac5ab,_0x573bf1[_0x0974('0x14')][_0x0974('0x15')]);return _0x325a74(_0x573bf1[_0x0974('0x14')][_0x0974('0x15')]);}logger[_0x0974('0x14')]('SmsMessage,\x20%s,\x20%s',_0x4ac5ab,_0x573bf1['error'][_0x0974('0x15')]);return _0x31d067(_0x573bf1[_0x0974('0x14')][_0x0974('0x15')]);}else{logger['info'](_0x0974('0x10'),_0x4ac5ab,_0x0974('0x11'));_0x31d067(_0x573bf1['result'][_0x0974('0x15')]);}})[_0x0974('0x16')](function(_0xc8e757){logger[_0x0974('0x14')](_0x0974('0x10'),_0x4ac5ab,_0xc8e757);_0x325a74(_0xc8e757);});});}exports[_0x0974('0x17')]=function(_0x1c7563){var _0x3cdbdf=this;return new Promise(function(_0x47110e,_0x4031a4){return db[_0x0974('0x18')]['create'](_0x1c7563[_0x0974('0x19')],{'raw':_0x1c7563[_0x0974('0x1a')]?_0x1c7563['options'][_0x0974('0x1b')]===undefined?!![]:![]:!![]})[_0x0974('0x1c')](function(_0x1e9a96){logger['info']('CreateSmsMessage',_0x1c7563);logger[_0x0974('0x12')](_0x0974('0x17'),_0x1c7563,JSON['stringify'](_0x1e9a96));_0x47110e(_0x1e9a96);})[_0x0974('0x16')](function(_0x63f4dc){logger[_0x0974('0x14')](_0x0974('0x17'),_0x63f4dc[_0x0974('0x15')],_0x1c7563);_0x4031a4(_0x3cdbdf['error'](0x1f4,_0x63f4dc['message']));});});}; \ No newline at end of file +var _0xfaec=['raw','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsMessage.socket','register','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options'];(function(_0xf17ae7,_0x3b7448){var _0x2d46b2=function(_0x458a4b){while(--_0x458a4b){_0xf17ae7['push'](_0xf17ae7['shift']());}};_0x2d46b2(++_0x3b7448);}(_0xfaec,0x156));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcfae('0x0'));var moment=require(_0xcfae('0x1'));var BPromise=require(_0xcfae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfae('0x3'))['db'];var utils=require(_0xcfae('0x4'));var logger=require(_0xcfae('0x5'))(_0xcfae('0x6'));var config=require(_0xcfae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcfae('0x8')][_0xcfae('0x9')]({'port':0x232a});config[_0xcfae('0xa')]=_['defaults'](config[_0xcfae('0xa')],{'host':_0xcfae('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfae('0xa')]));require(_0xcfae('0xc'))[_0xcfae('0xd')](socket);function respondWithRpcPromise(_0x4b1922,_0xb2fc31,_0x334625){return new BPromise(function(_0x5c1285,_0x1e0187){return client['request'](_0x4b1922,_0x334625)[_0xcfae('0xe')](function(_0x8c56cd){logger[_0xcfae('0xf')]('SmsMessage,\x20%s,\x20%s',_0xb2fc31,'request\x20sent');logger[_0xcfae('0x10')](_0xcfae('0x11'),_0xb2fc31,_0xcfae('0x12'),JSON[_0xcfae('0x13')](_0x8c56cd));if(_0x8c56cd['error']){if(_0x8c56cd[_0xcfae('0x14')]['code']===0x1f4){logger['error'](_0xcfae('0x15'),_0xb2fc31,_0x8c56cd[_0xcfae('0x14')]['message']);return _0x1e0187(_0x8c56cd[_0xcfae('0x14')][_0xcfae('0x16')]);}logger[_0xcfae('0x14')](_0xcfae('0x15'),_0xb2fc31,_0x8c56cd[_0xcfae('0x14')][_0xcfae('0x16')]);return _0x5c1285(_0x8c56cd[_0xcfae('0x14')]['message']);}else{logger['info'](_0xcfae('0x15'),_0xb2fc31,_0xcfae('0x12'));_0x5c1285(_0x8c56cd[_0xcfae('0x17')][_0xcfae('0x16')]);}})[_0xcfae('0x18')](function(_0x3b2f93){logger[_0xcfae('0x14')](_0xcfae('0x15'),_0xb2fc31,_0x3b2f93);_0x1e0187(_0x3b2f93);});});}exports[_0xcfae('0x19')]=function(_0x393f98){var _0x304436=this;return new Promise(function(_0x245b0d,_0x14b5e5){return db[_0xcfae('0x1a')][_0xcfae('0x1b')](_0x393f98[_0xcfae('0x1c')],{'raw':_0x393f98[_0xcfae('0x1d')]?_0x393f98[_0xcfae('0x1d')][_0xcfae('0x1e')]===undefined?!![]:![]:!![]})[_0xcfae('0xe')](function(_0x1a3906){logger[_0xcfae('0xf')]('CreateSmsMessage',_0x393f98);logger[_0xcfae('0x10')](_0xcfae('0x19'),_0x393f98,JSON[_0xcfae('0x13')](_0x1a3906));_0x245b0d(_0x1a3906);})[_0xcfae('0x18')](function(_0x445be3){logger[_0xcfae('0x14')](_0xcfae('0x19'),_0x445be3[_0xcfae('0x16')],_0x393f98);_0x14b5e5(_0x304436['error'](0x1f4,_0x445be3[_0xcfae('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index ebc16a4..6540d4c 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 _0x3405=['./smsMessage.events','save','remove','emit','register','length','smsMessage:'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x3405,0x1c7));var _0x5340=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x3405[_0x3e44fa];return _0x2a0aba;};'use strict';var SmsMessageEvents=require(_0x5340('0x0'));var events=[_0x5340('0x1'),_0x5340('0x2'),'update'];function createListener(_0x407ea9,_0x482a36){return function(_0x1dcd3a){_0x482a36[_0x5340('0x3')](_0x407ea9,_0x1dcd3a);};}function removeListener(_0x217c44,_0x46a919){return function(){SmsMessageEvents['removeListener'](_0x217c44,_0x46a919);};}exports[_0x5340('0x4')]=function(_0x4e0bd4){for(var _0x3c8a8e=0x0,_0x422a5f=events[_0x5340('0x5')];_0x3c8a8e<_0x422a5f;_0x3c8a8e++){var _0x106875=events[_0x3c8a8e];var _0x99bd8b=createListener(_0x5340('0x6')+_0x106875,_0x4e0bd4);SmsMessageEvents['on'](_0x106875,_0x99bd8b);}}; \ No newline at end of file +var _0x17a2=['smsMessage:','./smsMessage.events','save','remove','update','emit','register','length'];(function(_0xffdd99,_0x3c3c45){var _0x2189ff=function(_0x24f59e){while(--_0x24f59e){_0xffdd99['push'](_0xffdd99['shift']());}};_0x2189ff(++_0x3c3c45);}(_0x17a2,0xd1));var _0x217a=function(_0xb5d559,_0x1269f0){_0xb5d559=_0xb5d559-0x0;var _0x7d3995=_0x17a2[_0xb5d559];return _0x7d3995;};'use strict';var SmsMessageEvents=require(_0x217a('0x0'));var events=[_0x217a('0x1'),_0x217a('0x2'),_0x217a('0x3')];function createListener(_0x36daf9,_0x53d5e2){return function(_0x3195d9){_0x53d5e2[_0x217a('0x4')](_0x36daf9,_0x3195d9);};}function removeListener(_0x3b66ac,_0x32f800){return function(){SmsMessageEvents['removeListener'](_0x3b66ac,_0x32f800);};}exports[_0x217a('0x5')]=function(_0x5dd4f9){for(var _0x31fc86=0x0,_0x4e5b75=events[_0x217a('0x6')];_0x31fc86<_0x4e5b75;_0x31fc86++){var _0x6d9efd=events[_0x31fc86];var _0x4aa778=createListener(_0x217a('0x7')+_0x6d9efd,_0x5dd4f9);SmsMessageEvents['on'](_0x6d9efd,_0x4aa778);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c844899..4067531 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 _0x3786=['express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','isAuthenticated','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','removeTeams','delete','removeAgents','exports','util','connect-timeout'];(function(_0x5eb597,_0x22c2f1){var _0x2be095=function(_0x1a648a){while(--_0x1a648a){_0x5eb597['push'](_0x5eb597['shift']());}};_0x2be095(++_0x22c2f1);}(_0x3786,0x14e));var _0x6378=function(_0x22c76a,_0x1bdd97){_0x22c76a=_0x22c76a-0x0;var _0x17ef9a=_0x3786[_0x22c76a];return _0x17ef9a;};'use strict';var multer=require('multer');var util=require(_0x6378('0x0'));var path=require('path');var timeout=require(_0x6378('0x1'));var express=require(_0x6378('0x2'));var router=express['Router']();var fs_extra=require(_0x6378('0x3'));var auth=require(_0x6378('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6378('0x5'));var controller=require(_0x6378('0x6'));router[_0x6378('0x7')]('/',auth['isAuthenticated'](),controller[_0x6378('0x8')]);router[_0x6378('0x7')](_0x6378('0x9'),auth['isAuthenticated'](),controller[_0x6378('0xa')]);router[_0x6378('0x7')](_0x6378('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6378('0xc'),auth['isAuthenticated'](),controller[_0x6378('0xd')]);router[_0x6378('0x7')](_0x6378('0xe'),auth[_0x6378('0xf')](),controller[_0x6378('0x10')]);router['get'](_0x6378('0x11'),auth[_0x6378('0xf')](),controller[_0x6378('0x12')]);router['post']('/',auth[_0x6378('0xf')](),controller['create']);router[_0x6378('0x13')](_0x6378('0xe'),auth[_0x6378('0xf')](),controller[_0x6378('0x14')]);router[_0x6378('0x13')](_0x6378('0x11'),auth[_0x6378('0xf')](),controller[_0x6378('0x15')]);router[_0x6378('0x16')](_0x6378('0xb'),auth[_0x6378('0xf')](),controller[_0x6378('0x17')]);router['delete'](_0x6378('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x6378('0xe'),auth[_0x6378('0xf')](),controller[_0x6378('0x18')]);router[_0x6378('0x19')](_0x6378('0x11'),auth[_0x6378('0xf')](),controller[_0x6378('0x1a')]);module[_0x6378('0x1b')]=router; \ No newline at end of file +var _0xcfd2=['addTeams','/:id/users','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsQueue.controller','isAuthenticated','get','/describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams'];(function(_0x2adbb0,_0x21029d){var _0x469709=function(_0xaa8a27){while(--_0xaa8a27){_0x2adbb0['push'](_0x2adbb0['shift']());}};_0x469709(++_0x21029d);}(_0xcfd2,0x8e));var _0x2cfd=function(_0x47e1e7,_0x1a447d){_0x47e1e7=_0x47e1e7-0x0;var _0x299dfd=_0xcfd2[_0x47e1e7];return _0x299dfd;};'use strict';var multer=require('multer');var util=require(_0x2cfd('0x0'));var path=require(_0x2cfd('0x1'));var timeout=require(_0x2cfd('0x2'));var express=require(_0x2cfd('0x3'));var router=express[_0x2cfd('0x4')]();var fs_extra=require(_0x2cfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2cfd('0x6'));var config=require('../../config/environment');var controller=require(_0x2cfd('0x7'));router['get']('/',auth[_0x2cfd('0x8')](),controller['index']);router[_0x2cfd('0x9')](_0x2cfd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2cfd('0x9')](_0x2cfd('0xb'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xc')]);router['get'](_0x2cfd('0xd'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xe')]);router[_0x2cfd('0x9')]('/:id/teams',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xf')]);router['get']('/:id/users',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x10')]);router[_0x2cfd('0x11')]('/',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x12')]);router[_0x2cfd('0x11')](_0x2cfd('0x13'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x14')]);router['post'](_0x2cfd('0x15'),auth[_0x2cfd('0x8')](),controller['addAgents']);router['put'](_0x2cfd('0xb'),auth['isAuthenticated'](),controller[_0x2cfd('0x16')]);router[_0x2cfd('0x17')](_0x2cfd('0xb'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x18')]);router[_0x2cfd('0x17')](_0x2cfd('0x13'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x19')]);router['delete'](_0x2cfd('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2cfd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d9cc09e..817f406 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 _0x423e=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x423e,0x1f4));var _0xe423=function(_0x11da92,_0x3387b7){_0x11da92=_0x11da92-0x0;var _0x626bff=_0x423e[_0x11da92];return _0x626bff;};'use strict';var Sequelize=require(_0xe423('0x0'));module[_0xe423('0x1')]={'name':{'type':Sequelize[_0xe423('0x2')],'unique':_0xe423('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe423('0x2')]},'timeout':{'type':Sequelize[_0xe423('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe423('0x5')]('rrmemory',_0xe423('0x6'),_0xe423('0x7'))}}; \ No newline at end of file +var _0xb521=['INTEGER','beepall','roundrobin','exports','STRING'];(function(_0x562fdb,_0x5684bb){var _0x318876=function(_0xcd34d9){while(--_0xcd34d9){_0x562fdb['push'](_0x562fdb['shift']());}};_0x318876(++_0x5684bb);}(_0xb521,0xb7));var _0x1b52=function(_0xfe9f6b,_0x2204cc){_0xfe9f6b=_0xfe9f6b-0x0;var _0x54a503=_0xb521[_0xfe9f6b];return _0x54a503;};'use strict';var Sequelize=require('sequelize');module[_0x1b52('0x0')]={'name':{'type':Sequelize[_0x1b52('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1b52('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1b52('0x3'),_0x1b52('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b3b6e11..ef17cde 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 _0x4be1=['../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis','localhost','./smsQueue.socket','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','send','index','map','SmsQueue','type','name','keys','filters','intersection','model','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','Team','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','userSmsQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','emit','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x498ab9,_0x300881){var _0x5bf853=function(_0xa6118e){while(--_0xa6118e){_0x498ab9['push'](_0x498ab9['shift']());}};_0x5bf853(++_0x300881);}(_0x4be1,0x10a));var _0x14be=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x4be1[_0x48b5e0];return _0x4287ea;};'use strict';var emlformat=require(_0x14be('0x0'));var rimraf=require(_0x14be('0x1'));var zipdir=require(_0x14be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14be('0x3'));var moment=require('moment');var BPromise=require(_0x14be('0x4'));var Mustache=require('mustache');var util=require(_0x14be('0x5'));var path=require('path');var sox=require(_0x14be('0x6'));var csv=require(_0x14be('0x7'));var ejs=require(_0x14be('0x8'));var fs=require('fs');var fs_extra=require(_0x14be('0x9'));var _=require(_0x14be('0xa'));var squel=require('squel');var crypto=require(_0x14be('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x14be('0xc'));var toCsv=require(_0x14be('0x7'));var querystring=require('querystring');var Papa=require(_0x14be('0xd'));var Redis=require(_0x14be('0xe'));var authService=require(_0x14be('0xf'));var qs=require(_0x14be('0x10'));var as=require(_0x14be('0x11'));var hardwareService=require(_0x14be('0x12'));var logger=require(_0x14be('0x13'))(_0x14be('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14be('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x14be('0x16')](config[_0x14be('0x17')],{'host':_0x14be('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14be('0x17')]));require(_0x14be('0x19'))['register'](socket);function respondWithStatusCode(_0x26956d,_0x2b83e9){_0x2b83e9=_0x2b83e9||0xcc;return function(_0x5eb35a){if(_0x5eb35a){return _0x26956d[_0x14be('0x1a')](_0x2b83e9);}return _0x26956d['status'](_0x2b83e9)[_0x14be('0x1b')]();};}function respondWithResult(_0x1d911d,_0x4ca51f){_0x4ca51f=_0x4ca51f||0xc8;return function(_0x3c7722){if(_0x3c7722){return _0x1d911d[_0x14be('0x1c')](_0x4ca51f)['json'](_0x3c7722);}};}function respondWithFilteredResult(_0x4d27ab,_0x3b06e7){return function(_0x56334b){if(_0x56334b){var _0x1ce586=typeof _0x3b06e7[_0x14be('0x1d')]==='undefined'&&typeof _0x3b06e7['limit']===_0x14be('0x1e');var _0x50186b=_0x56334b['count'];var _0x3a90e4=_0x1ce586?0x0:_0x3b06e7['offset'];var _0x1958fa=_0x1ce586?_0x56334b[_0x14be('0x1f')]:_0x3b06e7[_0x14be('0x1d')]+_0x3b06e7['limit'];var _0x6f598c;if(_0x1958fa>=_0x50186b){_0x1958fa=_0x50186b;_0x6f598c=0xc8;}else{_0x6f598c=0xce;}_0x4d27ab['status'](_0x6f598c);return _0x4d27ab[_0x14be('0x20')]('Content-Range',_0x3a90e4+'-'+_0x1958fa+'/'+_0x50186b)[_0x14be('0x21')](_0x56334b);}return null;};}function patchUpdates(_0x511710){return function(_0x5e0e75){try{jsonpatch[_0x14be('0x22')](_0x5e0e75,_0x511710,!![]);}catch(_0x17d517){return BPromise[_0x14be('0x23')](_0x17d517);}return _0x5e0e75[_0x14be('0x24')]();};}function saveUpdates(_0x494e54,_0x50c9d9){return function(_0x324b67){if(_0x324b67){return _0x324b67[_0x14be('0x25')](_0x494e54)[_0x14be('0x26')](function(_0x326289){return _0x326289;});}return null;};}function removeEntity(_0x271c6c,_0x4ddd19){return function(_0x23a338){if(_0x23a338){return _0x23a338[_0x14be('0x27')]()[_0x14be('0x26')](function(){var _0x56e105=_0x23a338[_0x14be('0x28')]({'plain':!![]});var _0x374856=_0x14be('0x29');return db[_0x14be('0x2a')][_0x14be('0x27')]({'where':{'type':_0x374856,'resourceId':_0x56e105['id']}})[_0x14be('0x26')](function(){return _0x23a338;});})[_0x14be('0x26')](function(){_0x271c6c['status'](0xcc)[_0x14be('0x1b')]();});}};}function handleEntityNotFound(_0x3dede9,_0x4e6b13){return function(_0x437ebe){if(!_0x437ebe){_0x3dede9[_0x14be('0x1a')](0x194);}return _0x437ebe;};}function handleError(_0x54a9d8,_0x3f2c6b){_0x3f2c6b=_0x3f2c6b||0x1f4;return function(_0x1a872d){logger['error'](_0x1a872d[_0x14be('0x2b')]);if(_0x1a872d['name']){delete _0x1a872d['name'];}_0x54a9d8['status'](_0x3f2c6b)[_0x14be('0x2c')](_0x1a872d);};}exports[_0x14be('0x2d')]=function(_0x4d223b,_0x470bbe){var _0x54ba5f={},_0x593670={},_0x162174={'count':0x0,'rows':[]};var _0x344a5c=_[_0x14be('0x2e')](db[_0x14be('0x2f')]['rawAttributes'],function(_0xe2e2a1){return{'name':_0xe2e2a1['fieldName'],'type':_0xe2e2a1[_0x14be('0x30')]['key']};});_0x593670['model']=_['map'](_0x344a5c,_0x14be('0x31'));_0x593670['query']=_[_0x14be('0x32')](_0x4d223b['query']);_0x593670[_0x14be('0x33')]=_[_0x14be('0x34')](_0x593670[_0x14be('0x35')],_0x593670[_0x14be('0x36')]);_0x54ba5f[_0x14be('0x37')]=_[_0x14be('0x34')](_0x593670['model'],qs[_0x14be('0x38')](_0x4d223b[_0x14be('0x36')][_0x14be('0x38')]));_0x54ba5f['attributes']=_0x54ba5f[_0x14be('0x37')][_0x14be('0x39')]?_0x54ba5f[_0x14be('0x37')]:_0x593670[_0x14be('0x35')];if(!_0x4d223b['query']['hasOwnProperty'](_0x14be('0x3a'))){_0x54ba5f[_0x14be('0x3b')]=qs[_0x14be('0x3b')](_0x4d223b['query']['limit']);_0x54ba5f[_0x14be('0x1d')]=qs[_0x14be('0x1d')](_0x4d223b[_0x14be('0x36')][_0x14be('0x1d')]);}_0x54ba5f[_0x14be('0x3c')]=qs[_0x14be('0x3d')](_0x4d223b['query']['sort']);_0x54ba5f[_0x14be('0x3e')]=qs[_0x14be('0x33')](_[_0x14be('0x3f')](_0x4d223b[_0x14be('0x36')],_0x593670['filters']),_0x344a5c);if(_0x4d223b[_0x14be('0x36')][_0x14be('0x40')]){_0x54ba5f[_0x14be('0x3e')]=_['merge'](_0x54ba5f[_0x14be('0x3e')],{'$or':_['map'](_0x344a5c,function(_0x901ef3){if(_0x901ef3['type']!==_0x14be('0x41')){var _0x31c9e5={};_0x31c9e5[_0x901ef3[_0x14be('0x31')]]={'$like':'%'+_0x4d223b[_0x14be('0x36')][_0x14be('0x40')]+'%'};return _0x31c9e5;}})});}_0x54ba5f=_['merge']({},_0x54ba5f,_0x4d223b[_0x14be('0x42')]);var _0x1bd61f={'where':_0x54ba5f[_0x14be('0x3e')]};return db['SmsQueue'][_0x14be('0x1f')](_0x1bd61f)['then'](function(_0x183a41){_0x162174[_0x14be('0x1f')]=_0x183a41;if(_0x4d223b[_0x14be('0x36')]['includeAll']){_0x54ba5f[_0x14be('0x43')]=[{'all':!![]}];}return db[_0x14be('0x2f')][_0x14be('0x44')](_0x54ba5f);})[_0x14be('0x26')](function(_0x6d7493){_0x162174[_0x14be('0x45')]=_0x6d7493;return _0x162174;})[_0x14be('0x26')](respondWithFilteredResult(_0x470bbe,_0x54ba5f))[_0x14be('0x46')](handleError(_0x470bbe,null));};exports[_0x14be('0x47')]=function(_0x362686,_0x27c4fa){var _0x5b2959={'raw':!![],'where':{'id':_0x362686[_0x14be('0x48')]['id']}},_0x23f26c={};_0x23f26c[_0x14be('0x35')]=_[_0x14be('0x32')](db[_0x14be('0x2f')][_0x14be('0x49')]);_0x23f26c[_0x14be('0x36')]=_[_0x14be('0x32')](_0x362686[_0x14be('0x36')]);_0x23f26c[_0x14be('0x33')]=_[_0x14be('0x34')](_0x23f26c[_0x14be('0x35')],_0x23f26c[_0x14be('0x36')]);_0x5b2959[_0x14be('0x37')]=_[_0x14be('0x34')](_0x23f26c['model'],qs[_0x14be('0x38')](_0x362686[_0x14be('0x36')][_0x14be('0x38')]));_0x5b2959[_0x14be('0x37')]=_0x5b2959['attributes'][_0x14be('0x39')]?_0x5b2959[_0x14be('0x37')]:_0x23f26c[_0x14be('0x35')];if(_0x362686['query'][_0x14be('0x4a')]){_0x5b2959[_0x14be('0x43')]=[{'all':!![]}];}_0x5b2959=_[_0x14be('0x4b')]({},_0x5b2959,_0x362686[_0x14be('0x42')]);return db['SmsQueue'][_0x14be('0x4c')](_0x5b2959)[_0x14be('0x26')](handleEntityNotFound(_0x27c4fa,null))[_0x14be('0x26')](respondWithResult(_0x27c4fa,null))[_0x14be('0x46')](handleError(_0x27c4fa,null));};exports[_0x14be('0x4d')]=function(_0xd0e9bb,_0x220522){return db[_0x14be('0x2f')][_0x14be('0x4d')](_0xd0e9bb[_0x14be('0x4e')],{})[_0x14be('0x26')](function(_0x4b19b2){var _0x4f598f=_0xd0e9bb[_0x14be('0x4f')]['get']({'plain':!![]});if(!_0x4f598f)throw new Error(_0x14be('0x50'));if(_0x4f598f[_0x14be('0x51')]===_0x14be('0x4f')){var _0x5e65dc=_0x4b19b2[_0x14be('0x28')]({'plain':!![]});var _0xc11d5b=_0x14be('0x29');return db[_0x14be('0x52')]['find']({'where':{'name':_0xc11d5b,'userProfileId':_0x4f598f[_0x14be('0x53')]},'raw':!![]})['then'](function(_0x48686c){if(_0x48686c&&_0x48686c[_0x14be('0x54')]===0x0){return db[_0x14be('0x2a')][_0x14be('0x4d')]({'name':_0x5e65dc['name'],'resourceId':_0x5e65dc['id'],'type':_0x48686c[_0x14be('0x31')],'sectionId':_0x48686c['id']},{})[_0x14be('0x26')](function(){return _0x4b19b2;});}else{return _0x4b19b2;}})[_0x14be('0x46')](function(_0x285c42){logger[_0x14be('0x55')](_0x14be('0x56'),_0x285c42);throw _0x285c42;});}return _0x4b19b2;})[_0x14be('0x26')](respondWithResult(_0x220522,0xc9))['catch'](handleError(_0x220522,null));};exports['update']=function(_0x51a8e1,_0x4d3779){if(_0x51a8e1[_0x14be('0x4e')]['id']){delete _0x51a8e1[_0x14be('0x4e')]['id'];}return db[_0x14be('0x2f')][_0x14be('0x4c')]({'where':{'id':_0x51a8e1['params']['id']}})[_0x14be('0x26')](handleEntityNotFound(_0x4d3779,null))[_0x14be('0x26')](saveUpdates(_0x51a8e1[_0x14be('0x4e')],null))[_0x14be('0x26')](respondWithResult(_0x4d3779,null))[_0x14be('0x46')](handleError(_0x4d3779,null));};exports['destroy']=function(_0x97d97,_0xe2436b){return db[_0x14be('0x2f')][_0x14be('0x4c')]({'where':{'id':_0x97d97[_0x14be('0x48')]['id']}})[_0x14be('0x26')](handleEntityNotFound(_0xe2436b,null))[_0x14be('0x26')](removeEntity(_0xe2436b,null))[_0x14be('0x46')](handleError(_0xe2436b,null));};exports[_0x14be('0x57')]=function(_0x5de97b,_0x22bb4a){return db[_0x14be('0x2f')]['describe']()[_0x14be('0x26')](respondWithResult(_0x22bb4a,null))[_0x14be('0x46')](handleError(_0x22bb4a,null));};exports[_0x14be('0x58')]=function(_0x2199a4,_0x426701,_0x22aa15){var _0x1a8503={'raw':!![],'where':{}},_0x27fd78={},_0x2a8716;return db[_0x14be('0x2f')][_0x14be('0x59')]({'where':{'id':_0x2199a4[_0x14be('0x48')]['id']}})['then'](handleEntityNotFound(_0x426701,null))[_0x14be('0x26')](function(_0x566aa6){if(_0x566aa6){_0x2a8716=_0x566aa6['get']({'plain':!![]});_0x27fd78['model']=_[_0x14be('0x32')](db[_0x14be('0x5a')]['rawAttributes']);_0x27fd78[_0x14be('0x36')]=_[_0x14be('0x32')](_0x2199a4[_0x14be('0x36')]);_0x27fd78[_0x14be('0x33')]=_[_0x14be('0x34')](_0x27fd78[_0x14be('0x35')],_0x27fd78['query']);_0x1a8503[_0x14be('0x37')]=_['intersection'](_0x27fd78['model'],qs[_0x14be('0x38')](_0x2199a4['query'][_0x14be('0x38')]));_0x1a8503[_0x14be('0x37')]=_0x1a8503['attributes'][_0x14be('0x39')]?_0x1a8503[_0x14be('0x37')]:_0x27fd78[_0x14be('0x35')];if(!_0x2199a4[_0x14be('0x36')]['hasOwnProperty'](_0x14be('0x3a'))){_0x1a8503[_0x14be('0x3b')]=qs[_0x14be('0x3b')](_0x2199a4[_0x14be('0x36')][_0x14be('0x3b')]);_0x1a8503[_0x14be('0x1d')]=qs[_0x14be('0x1d')](_0x2199a4[_0x14be('0x36')][_0x14be('0x1d')]);}_0x1a8503['order']=qs[_0x14be('0x3d')](_0x2199a4[_0x14be('0x36')][_0x14be('0x3d')]);_0x1a8503['where']=qs[_0x14be('0x33')](_[_0x14be('0x3f')](_0x2199a4[_0x14be('0x36')],_0x27fd78[_0x14be('0x33')]));_0x1a8503[_0x14be('0x3e')][_0x14be('0x5b')]=_0x566aa6['id'];if(_0x2199a4[_0x14be('0x36')]['filter']){_0x1a8503[_0x14be('0x3e')]=_[_0x14be('0x4b')](_0x1a8503[_0x14be('0x3e')],{'$or':_[_0x14be('0x2e')](_0x1a8503['attributes'],function(_0x5e6045){var _0x4a9b0f={};_0x4a9b0f[_0x5e6045]={'$like':'%'+_0x2199a4[_0x14be('0x36')]['filter']+'%'};return _0x4a9b0f;})});}_0x1a8503=_['merge']({},_0x1a8503,_0x2199a4['options']);return db[_0x14be('0x5a')][_0x14be('0x44')](_0x1a8503);}})['then'](function(_0x4903b0){if(_0x4903b0){return db['User'][_0x14be('0x5c')]({'where':{'id':_[_0x14be('0x2e')](_0x4903b0,_0x14be('0x5d')),'role':'agent'},'attributes':['id',_0x14be('0x31'),_0x14be('0x5e'),_0x14be('0x5f'),_0x14be('0x60')]});}})['then'](function(_0x302db3){if(_0x302db3){return{'count':_0x302db3[_0x14be('0x1f')],'rows':_['map'](_0x302db3[_0x14be('0x45')],function(_0x1ddb77){return{'membername':_0x1ddb77['name'],'UserId':_0x1ddb77['id'],'queue_name':_0x2a8716[_0x14be('0x31')],'SmsQueueId':_0x2a8716['id'],'interface':util[_0x14be('0x61')]('%s/%s',_0x14be('0x62'),_0x1ddb77[_0x14be('0x31')]),'penalty':0x0,'paused':_0x1ddb77['smsPause'],'createdAt':_0x1ddb77[_0x14be('0x60')],'updatedAt':_0x1ddb77[_0x14be('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x14be('0x26')](respondWithFilteredResult(_0x426701,_0x1a8503))[_0x14be('0x46')](handleError(_0x426701,null));};exports['getTeams']=function(_0x481a9f,_0x2ddceb,_0x2f3b58){var _0x152b16={};var _0x217794={};var _0xd091e2;var _0x2977b3;return db[_0x14be('0x2f')]['findOne']({'where':{'id':_0x481a9f['params']['id']}})[_0x14be('0x26')](handleEntityNotFound(_0x2ddceb,null))[_0x14be('0x26')](function(_0x5493bd){if(_0x5493bd){_0xd091e2=_0x5493bd;_0x217794[_0x14be('0x35')]=_[_0x14be('0x32')](db['Team'][_0x14be('0x49')]);_0x217794[_0x14be('0x36')]=_[_0x14be('0x32')](_0x481a9f[_0x14be('0x36')]);_0x217794[_0x14be('0x33')]=_[_0x14be('0x34')](_0x217794[_0x14be('0x35')],_0x217794[_0x14be('0x36')]);_0x152b16[_0x14be('0x37')]=_[_0x14be('0x34')](_0x217794[_0x14be('0x35')],qs[_0x14be('0x38')](_0x481a9f[_0x14be('0x36')][_0x14be('0x38')]));_0x152b16['attributes']=_0x152b16[_0x14be('0x37')]['length']?_0x152b16[_0x14be('0x37')]:_0x217794[_0x14be('0x35')];_0x152b16['order']=qs[_0x14be('0x3d')](_0x481a9f[_0x14be('0x36')][_0x14be('0x3d')]);_0x152b16['where']=qs['filters'](_[_0x14be('0x3f')](_0x481a9f[_0x14be('0x36')],_0x217794[_0x14be('0x33')]));if(_0x481a9f[_0x14be('0x36')]['filter']){_0x152b16[_0x14be('0x3e')]=_[_0x14be('0x4b')](_0x152b16[_0x14be('0x3e')],{'$or':_[_0x14be('0x2e')](_0x152b16['attributes'],function(_0xf3a581){var _0x589c62={};_0x589c62[_0xf3a581]={'$like':'%'+_0x481a9f[_0x14be('0x36')][_0x14be('0x40')]+'%'};return _0x589c62;})});}_0x152b16=_['merge']({},_0x152b16,_0x481a9f['options']);return _0xd091e2[_0x14be('0x63')](_0x152b16);}})['then'](function(_0x4302c8){if(_0x4302c8){_0x2977b3=_0x4302c8['length'];if(!_0x481a9f[_0x14be('0x36')]['hasOwnProperty'](_0x14be('0x3a'))){_0x152b16[_0x14be('0x3b')]=qs[_0x14be('0x3b')](_0x481a9f[_0x14be('0x36')]['limit']);_0x152b16[_0x14be('0x1d')]=qs[_0x14be('0x1d')](_0x481a9f[_0x14be('0x36')][_0x14be('0x1d')]);}return _0xd091e2['getTeams'](_0x152b16);}})[_0x14be('0x26')](function(_0x49e64a){if(_0x49e64a){return _0x49e64a?{'count':_0x2977b3,'rows':_0x49e64a}:null;}})['then'](respondWithResult(_0x2ddceb,null))[_0x14be('0x46')](handleError(_0x2ddceb,null));};exports[_0x14be('0x64')]=function(_0x1be4e1,_0x22da47,_0x2f5cba){var _0x42c7f7=_0x1be4e1[_0x14be('0x4e')]['ids'];return db[_0x14be('0x65')][_0x14be('0x44')]({'where':{'id':_0x42c7f7},'attributes':['id'],'include':[{'model':db[_0x14be('0x66')],'as':_0x14be('0x67'),'attributes':['id',_0x14be('0x31'),_0x14be('0x68'),_0x14be('0x69'),'interface'],'raw':!![]}]})[_0x14be('0x26')](function(_0x576a54){if(_0x576a54){var _0x53054a=_[_0x14be('0x6a')](_0x576a54,function(_0xb58ad1){var _0x230a47=_0xb58ad1[_0x14be('0x28')]({'plain':!![]});return _0x230a47[_0x14be('0x67')];});return db[_0x14be('0x2f')]['find']({'where':{'id':_0x1be4e1[_0x14be('0x48')]['id']}})[_0x14be('0x26')](function(_0x502fb9){return db['sequelize'][_0x14be('0x6b')](function(_0x4dc527){return _0x502fb9[_0x14be('0x64')](_0x42c7f7,{'transaction':_0x4dc527})[_0x14be('0x26')](function(){return BPromise[_0x14be('0x6c')](_0x53054a,function(_0x322ac7){return db[_0x14be('0x5a')][_0x14be('0x6d')]({'where':{'UserId':_0x322ac7['id'],'SmsQueueId':_0x1be4e1['params']['id']},'transaction':_0x4dc527});});})[_0x14be('0x26')](function(){_0x53054a['forEach'](function(_0x473083){socket['emit'](_0x14be('0x6e'),{'UserId':_0x473083['id'],'SmsQueueId':_0x502fb9['id']});});});});});}})[_0x14be('0x26')](respondWithStatusCode(_0x22da47,null))[_0x14be('0x46')](handleError(_0x22da47,null));};exports[_0x14be('0x6f')]=function(_0x1162fa,_0x185971,_0x763920){return db[_0x14be('0x65')]['findAll']({'where':{'id':_0x1162fa[_0x14be('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x14be('0x66')],'as':_0x14be('0x67'),'attributes':['id'],'raw':!![]}]})[_0x14be('0x26')](handleEntityNotFound(_0x185971,null))['then'](function(_0x46f28f){var _0x3d15ae=_[_0x14be('0x2e')](_0x46f28f,'id');var _0x28d907=[];var _0x4093fc=[];var _0xcbd5d2=squel[_0x14be('0x70')]();_0xcbd5d2[_0x14be('0x71')]('tq.TeamId')[_0x14be('0x72')]('team_has_sms_queues','tq')[_0x14be('0x73')](_0x14be('0x74'),'ut',_0x14be('0x75'))[_0x14be('0x3e')](_0x14be('0x76'),_0x1162fa[_0x14be('0x48')]['id']);for(var _0x1b46ea=0x0;_0x1b46ea<_0x46f28f[_0x14be('0x39')];_0x1b46ea+=0x1){let _0x1a8092=_0x46f28f[_0x1b46ea];for(var _0xc6e78d=0x0;_0xc6e78d<_0x1a8092['Agents'][_0x14be('0x39')];_0xc6e78d+=0x1){let _0x361b6c=_0x1a8092[_0x14be('0x67')][_0xc6e78d];var _0x9eb13e=_0xcbd5d2[_0x14be('0x77')]();_0x9eb13e['where'](_0x14be('0x78'),_0x361b6c['id']);_0x4093fc[_0x14be('0x79')](db[_0x14be('0x7a')][_0x14be('0x36')](_0x9eb13e[_0x14be('0x7b')](),{'type':db[_0x14be('0x7a')][_0x14be('0x7c')][_0x14be('0x7d')]})[_0x14be('0x26')](function(_0x548ba6){if(_0x548ba6[_0x14be('0x39')]===0x1){return _0x361b6c['id'];}else{var _0x5c6ca7=_[_0x14be('0x7e')](_[_0x14be('0x2e')](_0x548ba6,_0x14be('0x7f')),function(_0xd6af87){return _[_0x14be('0x80')](_0x3d15ae,_0xd6af87);});if(_0x5c6ca7){return _0x361b6c['id'];}}}));}}return BPromise[_0x14be('0x81')](_0x4093fc)['then'](function(_0x2e8e6f){_0x28d907=_(_0x28d907)[_0x14be('0x82')](_0x2e8e6f)[_0x14be('0x83')]()[_0x14be('0x84')]();return db['SmsQueue'][_0x14be('0x4c')]({'where':{'id':_0x1162fa[_0x14be('0x48')]['id']}})['then'](function(_0xc7b46b){return db['sequelize'][_0x14be('0x6b')](function(_0x534ce6){return _0xc7b46b[_0x14be('0x6f')](_0x1162fa[_0x14be('0x36')][_0x14be('0x85')],{'transaction':_0x534ce6})[_0x14be('0x26')](function(){if(!_[_0x14be('0x86')](_0x28d907)){return _0xc7b46b[_0x14be('0x87')](_0x28d907,{'transaction':_0x534ce6});}})[_0x14be('0x26')](function(){_0x28d907[_0x14be('0x88')](function(_0x2e4254){socket['emit'](_0x14be('0x89'),{'UserId':_0x2e4254,'SmsQueueId':_0xc7b46b['id']});});});});});});})[_0x14be('0x26')](respondWithStatusCode(_0x185971,null))['catch'](handleError(_0x185971,null));};exports[_0x14be('0x8a')]=function(_0x1d7387,_0x416359,_0x5edb0b){return db[_0x14be('0x2f')][_0x14be('0x4c')]({'where':{'id':_0x1d7387[_0x14be('0x48')]['id']}})[_0x14be('0x26')](handleEntityNotFound(_0x416359,null))[_0x14be('0x26')](function(_0x12a25e){if(_0x12a25e){return _0x12a25e['addAgents'](_0x1d7387['body'][_0x14be('0x85')],_['omit'](_0x1d7387['body'],[_0x14be('0x85'),'id'])||{})['spread'](function(_0x4ffb14){for(var _0x256fcf=0x0;_0x256fcf<_0x1d7387[_0x14be('0x4e')]['ids']['length'];_0x256fcf+=0x1){socket[_0x14be('0x8b')](_0x14be('0x6e'),{'UserId':Number(_0x1d7387[_0x14be('0x4e')]['ids'][_0x256fcf]),'SmsQueueId':Number(_0x1d7387[_0x14be('0x48')]['id'])});}return _0x4ffb14;});}})[_0x14be('0x26')](respondWithResult(_0x416359,null))[_0x14be('0x46')](handleError(_0x416359,null));};exports['removeAgents']=function(_0x9d2106,_0x2d153f,_0x4e7e4c){return db['SmsQueue'][_0x14be('0x4c')]({'where':{'id':_0x9d2106['params']['id']}})[_0x14be('0x26')](handleEntityNotFound(_0x2d153f,null))[_0x14be('0x26')](function(_0x49f294){if(_0x49f294){return _0x49f294[_0x14be('0x87')](_0x9d2106[_0x14be('0x36')][_0x14be('0x85')])[_0x14be('0x26')](function(){if(_['isArray'](_0x9d2106[_0x14be('0x36')][_0x14be('0x85')])){for(var _0x49c707=0x0;_0x49c707<_0x9d2106[_0x14be('0x36')][_0x14be('0x85')][_0x14be('0x39')];_0x49c707+=0x1){socket['emit'](_0x14be('0x89'),{'UserId':Number(_0x9d2106['query'][_0x14be('0x85')][_0x49c707]),'SmsQueueId':Number(_0x9d2106[_0x14be('0x48')]['id'])});}}else{socket[_0x14be('0x8b')]('userSmsQueue:remove',{'UserId':Number(_0x9d2106[_0x14be('0x36')]['ids']),'SmsQueueId':Number(_0x9d2106[_0x14be('0x48')]['id'])});}});}})[_0x14be('0x26')](respondWithStatusCode(_0x2d153f,null))[_0x14be('0x46')](handleError(_0x2d153f,null));};exports[_0x14be('0x8c')]=function(_0x2189d7,_0x550674,_0x52133f){var _0x1941c4={};var _0x3c3d1e={};var _0x43061d;var _0x1c59be;return db[_0x14be('0x2f')][_0x14be('0x59')]({'where':{'id':_0x2189d7[_0x14be('0x48')]['id']}})['then'](handleEntityNotFound(_0x550674,null))['then'](function(_0x55e01c){if(_0x55e01c){_0x43061d=_0x55e01c;_0x3c3d1e[_0x14be('0x35')]=_[_0x14be('0x32')](db[_0x14be('0x66')][_0x14be('0x49')]);_0x3c3d1e['query']=_[_0x14be('0x32')](_0x2189d7[_0x14be('0x36')]);_0x3c3d1e[_0x14be('0x33')]=_['intersection'](_0x3c3d1e[_0x14be('0x35')],_0x3c3d1e[_0x14be('0x36')]);_0x1941c4[_0x14be('0x37')]=_[_0x14be('0x34')](_0x3c3d1e[_0x14be('0x35')],qs[_0x14be('0x38')](_0x2189d7[_0x14be('0x36')]['fields']));_0x1941c4[_0x14be('0x37')]=_0x1941c4[_0x14be('0x37')][_0x14be('0x39')]?_0x1941c4['attributes']:_0x3c3d1e[_0x14be('0x35')];_0x1941c4['order']=qs['sort'](_0x2189d7[_0x14be('0x36')][_0x14be('0x3d')]);_0x1941c4[_0x14be('0x3e')]=qs[_0x14be('0x33')](_['pick'](_0x2189d7['query'],_0x3c3d1e['filters']));if(_0x2189d7[_0x14be('0x36')][_0x14be('0x40')]){_0x1941c4[_0x14be('0x3e')]=_[_0x14be('0x4b')](_0x1941c4[_0x14be('0x3e')],{'$or':_[_0x14be('0x2e')](_0x1941c4[_0x14be('0x37')],function(_0xcbbea){var _0x141aba={};_0x141aba[_0xcbbea]={'$like':'%'+_0x2189d7['query']['filter']+'%'};return _0x141aba;})});}_0x1941c4=_[_0x14be('0x4b')]({},_0x1941c4,_0x2189d7['options']);return _0x43061d[_0x14be('0x8c')](_0x1941c4);}})[_0x14be('0x26')](function(_0x2fe0e6){if(_0x2fe0e6){_0x1c59be=_0x2fe0e6['length'];if(!_0x2189d7['query'][_0x14be('0x8d')]('nolimit')){_0x1941c4['limit']=qs[_0x14be('0x3b')](_0x2189d7[_0x14be('0x36')][_0x14be('0x3b')]);_0x1941c4['offset']=qs[_0x14be('0x1d')](_0x2189d7[_0x14be('0x36')][_0x14be('0x1d')]);}return _0x43061d['getAgents'](_0x1941c4);}})[_0x14be('0x26')](function(_0x2e65e2){if(_0x2e65e2){return _0x2e65e2?{'count':_0x1c59be,'rows':_0x2e65e2}:null;}})['then'](respondWithResult(_0x550674,null))[_0x14be('0x46')](handleError(_0x550674,null));}; \ No newline at end of file +var _0x806d=['ids','Team','Agents','online','interface','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','get','SmsQueues','error','stack','name','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','describe','getMembers','UserSmsQueue','hasOwnProperty','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','pick','addTeams'];(function(_0x5699eb,_0x59b821){var _0x5c8c85=function(_0x2ae249){while(--_0x2ae249){_0x5699eb['push'](_0x5699eb['shift']());}};_0x5c8c85(++_0x59b821);}(_0x806d,0x131));var _0xd806=function(_0x2f767f,_0x436c7c){_0x2f767f=_0x2f767f-0x0;var _0x14a53b=_0x806d[_0x2f767f];return _0x14a53b;};'use strict';var emlformat=require(_0xd806('0x0'));var rimraf=require(_0xd806('0x1'));var zipdir=require(_0xd806('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd806('0x3'));var Mustache=require(_0xd806('0x4'));var util=require('util');var path=require(_0xd806('0x5'));var sox=require('sox');var csv=require(_0xd806('0x6'));var ejs=require(_0xd806('0x7'));var fs=require('fs');var fs_extra=require(_0xd806('0x8'));var _=require(_0xd806('0x9'));var squel=require(_0xd806('0xa'));var crypto=require(_0xd806('0xb'));var jsforce=require(_0xd806('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd806('0x6'));var querystring=require(_0xd806('0xd'));var Papa=require(_0xd806('0xe'));var Redis=require(_0xd806('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd806('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd806('0x11'));var logger=require(_0xd806('0x12'))('api');var utils=require(_0xd806('0x13'));var config=require(_0xd806('0x14'));var licenseUtil=require(_0xd806('0x15'));var db=require(_0xd806('0x16'))['db'];config[_0xd806('0x17')]=_[_0xd806('0x18')](config[_0xd806('0x17')],{'host':_0xd806('0x19'),'port':0x18eb});var socket=require(_0xd806('0x1a'))(new Redis(config[_0xd806('0x17')]));require(_0xd806('0x1b'))['register'](socket);function respondWithStatusCode(_0x17d8bc,_0x359bfa){_0x359bfa=_0x359bfa||0xcc;return function(_0x69dd14){if(_0x69dd14){return _0x17d8bc['sendStatus'](_0x359bfa);}return _0x17d8bc[_0xd806('0x1c')](_0x359bfa)['end']();};}function respondWithResult(_0x33127f,_0x1195c4){_0x1195c4=_0x1195c4||0xc8;return function(_0x47f679){if(_0x47f679){return _0x33127f[_0xd806('0x1c')](_0x1195c4)[_0xd806('0x1d')](_0x47f679);}};}function respondWithFilteredResult(_0x1e7f7f,_0x3407f9){return function(_0x332eec){if(_0x332eec){var _0x1c9ce4=typeof _0x3407f9['offset']===_0xd806('0x1e')&&typeof _0x3407f9[_0xd806('0x1f')]===_0xd806('0x1e');var _0x5a3781=_0x332eec[_0xd806('0x20')];var _0x5f5b46=_0x1c9ce4?0x0:_0x3407f9[_0xd806('0x21')];var _0x1954f8=_0x1c9ce4?_0x332eec[_0xd806('0x20')]:_0x3407f9[_0xd806('0x21')]+_0x3407f9[_0xd806('0x1f')];var _0x58c632;if(_0x1954f8>=_0x5a3781){_0x1954f8=_0x5a3781;_0x58c632=0xc8;}else{_0x58c632=0xce;}_0x1e7f7f['status'](_0x58c632);return _0x1e7f7f[_0xd806('0x22')](_0xd806('0x23'),_0x5f5b46+'-'+_0x1954f8+'/'+_0x5a3781)[_0xd806('0x1d')](_0x332eec);}return null;};}function patchUpdates(_0x95450b){return function(_0x33b87a){try{jsonpatch['apply'](_0x33b87a,_0x95450b,!![]);}catch(_0x500f9d){return BPromise[_0xd806('0x24')](_0x500f9d);}return _0x33b87a[_0xd806('0x25')]();};}function saveUpdates(_0x17aa45,_0x36721b){return function(_0x3a4934){if(_0x3a4934){return _0x3a4934['update'](_0x17aa45)[_0xd806('0x26')](function(_0xf8df1e){return _0xf8df1e;});}return null;};}function removeEntity(_0x53782d,_0x479744){return function(_0x2fd73d){if(_0x2fd73d){return _0x2fd73d['destroy']()[_0xd806('0x26')](function(){var _0xe9664e=_0x2fd73d[_0xd806('0x27')]({'plain':!![]});var _0x3a4435=_0xd806('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a4435,'resourceId':_0xe9664e['id']}})[_0xd806('0x26')](function(){return _0x2fd73d;});})[_0xd806('0x26')](function(){_0x53782d[_0xd806('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6b4d,_0x25a2f0){return function(_0x358ae2){if(!_0x358ae2){_0x2b6b4d['sendStatus'](0x194);}return _0x358ae2;};}function handleError(_0x47dc87,_0x552487){_0x552487=_0x552487||0x1f4;return function(_0x2d46d1){logger[_0xd806('0x29')](_0x2d46d1[_0xd806('0x2a')]);if(_0x2d46d1[_0xd806('0x2b')]){delete _0x2d46d1['name'];}_0x47dc87['status'](_0x552487)['send'](_0x2d46d1);};}exports['index']=function(_0x3e467e,_0x435d94){var _0x14ba23={},_0x1b6215={},_0x3b231c={'count':0x0,'rows':[]};var _0x135704=_[_0xd806('0x2c')](db[_0xd806('0x2d')][_0xd806('0x2e')],function(_0x52a1ae){return{'name':_0x52a1ae[_0xd806('0x2f')],'type':_0x52a1ae[_0xd806('0x30')][_0xd806('0x31')]};});_0x1b6215[_0xd806('0x32')]=_['map'](_0x135704,_0xd806('0x2b'));_0x1b6215['query']=_[_0xd806('0x33')](_0x3e467e['query']);_0x1b6215['filters']=_[_0xd806('0x34')](_0x1b6215[_0xd806('0x32')],_0x1b6215['query']);_0x14ba23[_0xd806('0x35')]=_[_0xd806('0x34')](_0x1b6215['model'],qs[_0xd806('0x36')](_0x3e467e[_0xd806('0x37')]['fields']));_0x14ba23[_0xd806('0x35')]=_0x14ba23[_0xd806('0x35')]['length']?_0x14ba23['attributes']:_0x1b6215[_0xd806('0x32')];if(!_0x3e467e[_0xd806('0x37')]['hasOwnProperty'](_0xd806('0x38'))){_0x14ba23[_0xd806('0x1f')]=qs['limit'](_0x3e467e['query']['limit']);_0x14ba23[_0xd806('0x21')]=qs[_0xd806('0x21')](_0x3e467e[_0xd806('0x37')][_0xd806('0x21')]);}_0x14ba23[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0x3e467e[_0xd806('0x37')][_0xd806('0x3a')]);_0x14ba23[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_['pick'](_0x3e467e[_0xd806('0x37')],_0x1b6215['filters']),_0x135704);if(_0x3e467e[_0xd806('0x37')][_0xd806('0x3d')]){_0x14ba23['where']=_[_0xd806('0x3e')](_0x14ba23['where'],{'$or':_[_0xd806('0x2c')](_0x135704,function(_0x4a30e4){if(_0x4a30e4['type']!=='VIRTUAL'){var _0x73e3fe={};_0x73e3fe[_0x4a30e4['name']]={'$like':'%'+_0x3e467e[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x73e3fe;}})});}_0x14ba23=_[_0xd806('0x3e')]({},_0x14ba23,_0x3e467e[_0xd806('0x3f')]);var _0xc395ce={'where':_0x14ba23['where']};return db['SmsQueue'][_0xd806('0x20')](_0xc395ce)['then'](function(_0x1c4191){_0x3b231c[_0xd806('0x20')]=_0x1c4191;if(_0x3e467e[_0xd806('0x37')]['includeAll']){_0x14ba23[_0xd806('0x40')]=[{'all':!![]}];}return db['SmsQueue'][_0xd806('0x41')](_0x14ba23);})[_0xd806('0x26')](function(_0xdc7ad){_0x3b231c[_0xd806('0x42')]=_0xdc7ad;return _0x3b231c;})['then'](respondWithFilteredResult(_0x435d94,_0x14ba23))[_0xd806('0x43')](handleError(_0x435d94,null));};exports[_0xd806('0x44')]=function(_0x2d686f,_0x5a6511){var _0x3d0c27={'raw':!![],'where':{'id':_0x2d686f[_0xd806('0x45')]['id']}},_0x557ee3={};_0x557ee3[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x2d')]['rawAttributes']);_0x557ee3['query']=_[_0xd806('0x33')](_0x2d686f[_0xd806('0x37')]);_0x557ee3['filters']=_['intersection'](_0x557ee3[_0xd806('0x32')],_0x557ee3[_0xd806('0x37')]);_0x3d0c27[_0xd806('0x35')]=_[_0xd806('0x34')](_0x557ee3[_0xd806('0x32')],qs['fields'](_0x2d686f['query'][_0xd806('0x36')]));_0x3d0c27['attributes']=_0x3d0c27['attributes'][_0xd806('0x46')]?_0x3d0c27[_0xd806('0x35')]:_0x557ee3[_0xd806('0x32')];if(_0x2d686f['query'][_0xd806('0x47')]){_0x3d0c27['include']=[{'all':!![]}];}_0x3d0c27=_[_0xd806('0x3e')]({},_0x3d0c27,_0x2d686f[_0xd806('0x3f')]);return db[_0xd806('0x2d')][_0xd806('0x48')](_0x3d0c27)[_0xd806('0x26')](handleEntityNotFound(_0x5a6511,null))['then'](respondWithResult(_0x5a6511,null))['catch'](handleError(_0x5a6511,null));};exports['create']=function(_0x1badb8,_0x2ddedc){return db['SmsQueue']['create'](_0x1badb8[_0xd806('0x49')],{})[_0xd806('0x26')](function(_0x527dcb){var _0x1abead=_0x1badb8['user'][_0xd806('0x27')]({'plain':!![]});if(!_0x1abead)throw new Error(_0xd806('0x4a'));if(_0x1abead['role']===_0xd806('0x4b')){var _0x51b7e1=_0x527dcb[_0xd806('0x27')]({'plain':!![]});var _0x48201f=_0xd806('0x28');return db[_0xd806('0x4c')]['find']({'where':{'name':_0x48201f,'userProfileId':_0x1abead['userProfileId']},'raw':!![]})['then'](function(_0x3e1191){if(_0x3e1191&&_0x3e1191['autoAssociation']===0x0){return db[_0xd806('0x4d')]['create']({'name':_0x51b7e1['name'],'resourceId':_0x51b7e1['id'],'type':_0x3e1191[_0xd806('0x2b')],'sectionId':_0x3e1191['id']},{})[_0xd806('0x26')](function(){return _0x527dcb;});}else{return _0x527dcb;}})[_0xd806('0x43')](function(_0x56ca6b){logger[_0xd806('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56ca6b);throw _0x56ca6b;});}return _0x527dcb;})[_0xd806('0x26')](respondWithResult(_0x2ddedc,0xc9))['catch'](handleError(_0x2ddedc,null));};exports['update']=function(_0x4c384b,_0x404c1c){if(_0x4c384b[_0xd806('0x49')]['id']){delete _0x4c384b['body']['id'];}return db[_0xd806('0x2d')][_0xd806('0x48')]({'where':{'id':_0x4c384b[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x404c1c,null))[_0xd806('0x26')](saveUpdates(_0x4c384b['body'],null))[_0xd806('0x26')](respondWithResult(_0x404c1c,null))[_0xd806('0x43')](handleError(_0x404c1c,null));};exports['destroy']=function(_0xd9b253,_0x45a34b){return db['SmsQueue'][_0xd806('0x48')]({'where':{'id':_0xd9b253['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x45a34b,null))[_0xd806('0x26')](removeEntity(_0x45a34b,null))[_0xd806('0x43')](handleError(_0x45a34b,null));};exports['describe']=function(_0x9a7211,_0x57cb59){return db[_0xd806('0x2d')][_0xd806('0x4e')]()[_0xd806('0x26')](respondWithResult(_0x57cb59,null))[_0xd806('0x43')](handleError(_0x57cb59,null));};exports[_0xd806('0x4f')]=function(_0x49b364,_0x2d817f,_0xba795){var _0x29afa9={'raw':!![],'where':{}},_0x231fd3={},_0x3b4298;return db['SmsQueue']['findOne']({'where':{'id':_0x49b364['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x2d817f,null))['then'](function(_0x505857){if(_0x505857){_0x3b4298=_0x505857[_0xd806('0x27')]({'plain':!![]});_0x231fd3[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x50')]['rawAttributes']);_0x231fd3['query']=_['keys'](_0x49b364[_0xd806('0x37')]);_0x231fd3[_0xd806('0x3c')]=_['intersection'](_0x231fd3[_0xd806('0x32')],_0x231fd3[_0xd806('0x37')]);_0x29afa9[_0xd806('0x35')]=_['intersection'](_0x231fd3[_0xd806('0x32')],qs[_0xd806('0x36')](_0x49b364[_0xd806('0x37')]['fields']));_0x29afa9['attributes']=_0x29afa9[_0xd806('0x35')][_0xd806('0x46')]?_0x29afa9[_0xd806('0x35')]:_0x231fd3[_0xd806('0x32')];if(!_0x49b364[_0xd806('0x37')][_0xd806('0x51')]('nolimit')){_0x29afa9[_0xd806('0x1f')]=qs['limit'](_0x49b364[_0xd806('0x37')]['limit']);_0x29afa9[_0xd806('0x21')]=qs['offset'](_0x49b364[_0xd806('0x37')][_0xd806('0x21')]);}_0x29afa9[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0x49b364[_0xd806('0x37')]['sort']);_0x29afa9[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_['pick'](_0x49b364[_0xd806('0x37')],_0x231fd3[_0xd806('0x3c')]));_0x29afa9['where'][_0xd806('0x52')]=_0x505857['id'];if(_0x49b364[_0xd806('0x37')][_0xd806('0x3d')]){_0x29afa9[_0xd806('0x3b')]=_['merge'](_0x29afa9[_0xd806('0x3b')],{'$or':_[_0xd806('0x2c')](_0x29afa9['attributes'],function(_0x4fb4fd){var _0x26ad79={};_0x26ad79[_0x4fb4fd]={'$like':'%'+_0x49b364[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x26ad79;})});}_0x29afa9=_[_0xd806('0x3e')]({},_0x29afa9,_0x49b364['options']);return db[_0xd806('0x50')]['findAll'](_0x29afa9);}})[_0xd806('0x26')](function(_0x53b810){if(_0x53b810){return db[_0xd806('0x53')][_0xd806('0x54')]({'where':{'id':_[_0xd806('0x2c')](_0x53b810,_0xd806('0x55')),'role':_0xd806('0x56')},'attributes':['id',_0xd806('0x2b'),_0xd806('0x57'),_0xd806('0x58'),_0xd806('0x59')]});}})[_0xd806('0x26')](function(_0x14803c){if(_0x14803c){return{'count':_0x14803c[_0xd806('0x20')],'rows':_[_0xd806('0x2c')](_0x14803c['rows'],function(_0x3a014f){return{'membername':_0x3a014f[_0xd806('0x2b')],'UserId':_0x3a014f['id'],'queue_name':_0x3b4298['name'],'SmsQueueId':_0x3b4298['id'],'interface':util[_0xd806('0x5a')](_0xd806('0x5b'),_0xd806('0x5c'),_0x3a014f[_0xd806('0x2b')]),'penalty':0x0,'paused':_0x3a014f[_0xd806('0x57')],'createdAt':_0x3a014f[_0xd806('0x59')],'updatedAt':_0x3a014f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d817f,_0x29afa9))['catch'](handleError(_0x2d817f,null));};exports[_0xd806('0x5d')]=function(_0x7a31ed,_0x149d13,_0x4a603c){var _0x16c83e={};var _0x587c69={};var _0x560d83;var _0x5f3938;return db[_0xd806('0x2d')][_0xd806('0x5e')]({'where':{'id':_0x7a31ed[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x149d13,null))[_0xd806('0x26')](function(_0x3263bf){if(_0x3263bf){_0x560d83=_0x3263bf;_0x587c69[_0xd806('0x32')]=_[_0xd806('0x33')](db['Team'][_0xd806('0x2e')]);_0x587c69[_0xd806('0x37')]=_['keys'](_0x7a31ed[_0xd806('0x37')]);_0x587c69[_0xd806('0x3c')]=_[_0xd806('0x34')](_0x587c69[_0xd806('0x32')],_0x587c69[_0xd806('0x37')]);_0x16c83e[_0xd806('0x35')]=_[_0xd806('0x34')](_0x587c69['model'],qs[_0xd806('0x36')](_0x7a31ed[_0xd806('0x37')][_0xd806('0x36')]));_0x16c83e[_0xd806('0x35')]=_0x16c83e[_0xd806('0x35')][_0xd806('0x46')]?_0x16c83e[_0xd806('0x35')]:_0x587c69[_0xd806('0x32')];_0x16c83e[_0xd806('0x39')]=qs['sort'](_0x7a31ed['query'][_0xd806('0x3a')]);_0x16c83e[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_[_0xd806('0x5f')](_0x7a31ed['query'],_0x587c69[_0xd806('0x3c')]));if(_0x7a31ed[_0xd806('0x37')][_0xd806('0x3d')]){_0x16c83e[_0xd806('0x3b')]=_[_0xd806('0x3e')](_0x16c83e[_0xd806('0x3b')],{'$or':_[_0xd806('0x2c')](_0x16c83e[_0xd806('0x35')],function(_0x3be72f){var _0x4ae142={};_0x4ae142[_0x3be72f]={'$like':'%'+_0x7a31ed[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x4ae142;})});}_0x16c83e=_['merge']({},_0x16c83e,_0x7a31ed[_0xd806('0x3f')]);return _0x560d83[_0xd806('0x5d')](_0x16c83e);}})[_0xd806('0x26')](function(_0x10a412){if(_0x10a412){_0x5f3938=_0x10a412['length'];if(!_0x7a31ed['query'][_0xd806('0x51')](_0xd806('0x38'))){_0x16c83e[_0xd806('0x1f')]=qs[_0xd806('0x1f')](_0x7a31ed[_0xd806('0x37')]['limit']);_0x16c83e[_0xd806('0x21')]=qs['offset'](_0x7a31ed[_0xd806('0x37')][_0xd806('0x21')]);}return _0x560d83[_0xd806('0x5d')](_0x16c83e);}})[_0xd806('0x26')](function(_0x558974){if(_0x558974){return _0x558974?{'count':_0x5f3938,'rows':_0x558974}:null;}})[_0xd806('0x26')](respondWithResult(_0x149d13,null))[_0xd806('0x43')](handleError(_0x149d13,null));};exports[_0xd806('0x60')]=function(_0x56f596,_0x579ab8,_0x4723f3){var _0x467667=_0x56f596['body'][_0xd806('0x61')];return db[_0xd806('0x62')][_0xd806('0x41')]({'where':{'id':_0x467667},'attributes':['id'],'include':[{'model':db[_0xd806('0x53')],'as':_0xd806('0x63'),'attributes':['id',_0xd806('0x2b'),_0xd806('0x64'),'voicePause',_0xd806('0x65')],'raw':!![]}]})[_0xd806('0x26')](function(_0x38d70b){if(_0x38d70b){var _0x11b58a=_['flatMap'](_0x38d70b,function(_0xb38f72){var _0xf4f992=_0xb38f72[_0xd806('0x27')]({'plain':!![]});return _0xf4f992[_0xd806('0x63')];});return db['SmsQueue'][_0xd806('0x48')]({'where':{'id':_0x56f596[_0xd806('0x45')]['id']}})[_0xd806('0x26')](function(_0x4651bf){return db['sequelize']['transaction'](function(_0x4bde73){return _0x4651bf[_0xd806('0x60')](_0x467667,{'transaction':_0x4bde73})['then'](function(){return BPromise[_0xd806('0x66')](_0x11b58a,function(_0x25842a){return db[_0xd806('0x50')][_0xd806('0x67')]({'where':{'UserId':_0x25842a['id'],'SmsQueueId':_0x56f596[_0xd806('0x45')]['id']},'transaction':_0x4bde73});});})[_0xd806('0x26')](function(){_0x11b58a[_0xd806('0x68')](function(_0x592079){socket[_0xd806('0x69')](_0xd806('0x6a'),{'UserId':_0x592079['id'],'SmsQueueId':_0x4651bf['id']});});});});});}})[_0xd806('0x26')](respondWithStatusCode(_0x579ab8,null))['catch'](handleError(_0x579ab8,null));};exports['removeTeams']=function(_0x22fd06,_0x49c8cc,_0x8cc1d4){return db[_0xd806('0x62')][_0xd806('0x41')]({'where':{'id':_0x22fd06[_0xd806('0x37')][_0xd806('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd806('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x49c8cc,null))[_0xd806('0x26')](function(_0x3dfbf3){var _0x1b48e0=_[_0xd806('0x2c')](_0x3dfbf3,'id');var _0x40274b=[];var _0x3e9037=[];var _0x23da5e=squel[_0xd806('0x6b')]();_0x23da5e[_0xd806('0x6c')](_0xd806('0x6d'))['from'](_0xd806('0x6e'),'tq')[_0xd806('0x6f')](_0xd806('0x70'),'ut',_0xd806('0x71'))['where'](_0xd806('0x72'),_0x22fd06[_0xd806('0x45')]['id']);for(var _0x3b8a6a=0x0;_0x3b8a6a<_0x3dfbf3[_0xd806('0x46')];_0x3b8a6a+=0x1){let _0x29869b=_0x3dfbf3[_0x3b8a6a];for(var _0x4c50a9=0x0;_0x4c50a9<_0x29869b['Agents'][_0xd806('0x46')];_0x4c50a9+=0x1){let _0x1d3f48=_0x29869b[_0xd806('0x63')][_0x4c50a9];var _0x199dad=_0x23da5e[_0xd806('0x73')]();_0x199dad['where'](_0xd806('0x74'),_0x1d3f48['id']);_0x3e9037['push'](db[_0xd806('0x75')]['query'](_0x199dad['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd806('0x76')]})[_0xd806('0x26')](function(_0x21f060){if(_0x21f060[_0xd806('0x46')]===0x1){return _0x1d3f48['id'];}else{var _0x598fef=_[_0xd806('0x77')](_[_0xd806('0x2c')](_0x21f060,_0xd806('0x78')),function(_0x35eca7){return _[_0xd806('0x79')](_0x1b48e0,_0x35eca7);});if(_0x598fef){return _0x1d3f48['id'];}}}));}}return BPromise[_0xd806('0x7a')](_0x3e9037)[_0xd806('0x26')](function(_0x623c9c){_0x40274b=_(_0x40274b)[_0xd806('0x7b')](_0x623c9c)[_0xd806('0x7c')]()[_0xd806('0x7d')]();return db[_0xd806('0x2d')]['find']({'where':{'id':_0x22fd06['params']['id']}})[_0xd806('0x26')](function(_0x4edb16){return db[_0xd806('0x75')][_0xd806('0x7e')](function(_0x29a898){return _0x4edb16[_0xd806('0x7f')](_0x22fd06['query']['ids'],{'transaction':_0x29a898})[_0xd806('0x26')](function(){if(!_[_0xd806('0x80')](_0x40274b)){return _0x4edb16[_0xd806('0x81')](_0x40274b,{'transaction':_0x29a898});}})['then'](function(){_0x40274b[_0xd806('0x68')](function(_0x201e97){socket['emit']('userSmsQueue:remove',{'UserId':_0x201e97,'SmsQueueId':_0x4edb16['id']});});});});});});})[_0xd806('0x26')](respondWithStatusCode(_0x49c8cc,null))[_0xd806('0x43')](handleError(_0x49c8cc,null));};exports['addAgents']=function(_0x4ce4ea,_0x5dfd7e,_0x3ee1f8){return db[_0xd806('0x2d')]['find']({'where':{'id':_0x4ce4ea[_0xd806('0x45')]['id']}})['then'](handleEntityNotFound(_0x5dfd7e,null))[_0xd806('0x26')](function(_0x27e9c5){if(_0x27e9c5){return _0x27e9c5[_0xd806('0x82')](_0x4ce4ea[_0xd806('0x49')]['ids'],_['omit'](_0x4ce4ea['body'],[_0xd806('0x61'),'id'])||{})[_0xd806('0x83')](function(_0x1b771b){for(var _0x162b4e=0x0;_0x162b4e<_0x4ce4ea[_0xd806('0x49')][_0xd806('0x61')][_0xd806('0x46')];_0x162b4e+=0x1){socket[_0xd806('0x69')](_0xd806('0x6a'),{'UserId':Number(_0x4ce4ea['body'][_0xd806('0x61')][_0x162b4e]),'SmsQueueId':Number(_0x4ce4ea[_0xd806('0x45')]['id'])});}return _0x1b771b;});}})[_0xd806('0x26')](respondWithResult(_0x5dfd7e,null))[_0xd806('0x43')](handleError(_0x5dfd7e,null));};exports['removeAgents']=function(_0x11896,_0xba8db4,_0x13e387){return db[_0xd806('0x2d')][_0xd806('0x48')]({'where':{'id':_0x11896[_0xd806('0x45')]['id']}})['then'](handleEntityNotFound(_0xba8db4,null))[_0xd806('0x26')](function(_0x2da638){if(_0x2da638){return _0x2da638[_0xd806('0x81')](_0x11896[_0xd806('0x37')][_0xd806('0x61')])[_0xd806('0x26')](function(){if(_[_0xd806('0x84')](_0x11896[_0xd806('0x37')][_0xd806('0x61')])){for(var _0x224bc6=0x0;_0x224bc6<_0x11896[_0xd806('0x37')][_0xd806('0x61')][_0xd806('0x46')];_0x224bc6+=0x1){socket[_0xd806('0x69')]('userSmsQueue:remove',{'UserId':Number(_0x11896[_0xd806('0x37')][_0xd806('0x61')][_0x224bc6]),'SmsQueueId':Number(_0x11896['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x11896[_0xd806('0x37')][_0xd806('0x61')]),'SmsQueueId':Number(_0x11896[_0xd806('0x45')]['id'])});}});}})[_0xd806('0x26')](respondWithStatusCode(_0xba8db4,null))[_0xd806('0x43')](handleError(_0xba8db4,null));};exports[_0xd806('0x85')]=function(_0xa0f47b,_0x4cf1fd,_0x3a1876){var _0x447875={};var _0x5e4c23={};var _0x170b30;var _0x47a677;return db[_0xd806('0x2d')][_0xd806('0x5e')]({'where':{'id':_0xa0f47b[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x4cf1fd,null))[_0xd806('0x26')](function(_0x2ca88b){if(_0x2ca88b){_0x170b30=_0x2ca88b;_0x5e4c23[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x53')][_0xd806('0x2e')]);_0x5e4c23['query']=_[_0xd806('0x33')](_0xa0f47b[_0xd806('0x37')]);_0x5e4c23[_0xd806('0x3c')]=_['intersection'](_0x5e4c23[_0xd806('0x32')],_0x5e4c23['query']);_0x447875['attributes']=_[_0xd806('0x34')](_0x5e4c23[_0xd806('0x32')],qs[_0xd806('0x36')](_0xa0f47b[_0xd806('0x37')][_0xd806('0x36')]));_0x447875[_0xd806('0x35')]=_0x447875[_0xd806('0x35')]['length']?_0x447875[_0xd806('0x35')]:_0x5e4c23[_0xd806('0x32')];_0x447875[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0xa0f47b[_0xd806('0x37')][_0xd806('0x3a')]);_0x447875[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_[_0xd806('0x5f')](_0xa0f47b[_0xd806('0x37')],_0x5e4c23['filters']));if(_0xa0f47b['query']['filter']){_0x447875[_0xd806('0x3b')]=_[_0xd806('0x3e')](_0x447875['where'],{'$or':_['map'](_0x447875[_0xd806('0x35')],function(_0x422059){var _0x243c17={};_0x243c17[_0x422059]={'$like':'%'+_0xa0f47b[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x243c17;})});}_0x447875=_['merge']({},_0x447875,_0xa0f47b['options']);return _0x170b30[_0xd806('0x85')](_0x447875);}})['then'](function(_0x1d6a06){if(_0x1d6a06){_0x47a677=_0x1d6a06[_0xd806('0x46')];if(!_0xa0f47b[_0xd806('0x37')][_0xd806('0x51')](_0xd806('0x38'))){_0x447875[_0xd806('0x1f')]=qs['limit'](_0xa0f47b['query'][_0xd806('0x1f')]);_0x447875[_0xd806('0x21')]=qs[_0xd806('0x21')](_0xa0f47b[_0xd806('0x37')]['offset']);}return _0x170b30[_0xd806('0x85')](_0x447875);}})[_0xd806('0x26')](function(_0x14fe71){if(_0x14fe71){return _0x14fe71?{'count':_0x47a677,'rows':_0x14fe71}:null;}})['then'](respondWithResult(_0x4cf1fd,null))['catch'](handleError(_0x4cf1fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index dc42d2e..619e476 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 _0xc03d=['exports','events','remove','emit','hook'];(function(_0x1519de,_0x1a6f96){var _0xf1086e=function(_0x856831){while(--_0x856831){_0x1519de['push'](_0x1519de['shift']());}};_0xf1086e(++_0x1a6f96);}(_0xc03d,0x132));var _0xdc03=function(_0x715ee,_0x394f82){_0x715ee=_0x715ee-0x0;var _0x34ef29=_0xc03d[_0x715ee];return _0x34ef29;};'use strict';var EventEmitter=require(_0xdc03('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdc03('0x1')};function emitEvent(_0x5eac66){return function(_0x5f4fd6,_0x5aa7ab,_0x15bdcb){SmsQueueEvents[_0xdc03('0x2')](_0x5eac66+':'+_0x5f4fd6['id'],_0x5f4fd6);SmsQueueEvents['emit'](_0x5eac66,_0x5f4fd6);_0x15bdcb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xdc03('0x3')](e,emitEvent(event));}}module[_0xdc03('0x4')]=SmsQueueEvents; \ No newline at end of file +var _0x7867=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','update','remove'];(function(_0x37f810,_0x5d4e5c){var _0x4365f7=function(_0x1b886a){while(--_0x1b886a){_0x37f810['push'](_0x37f810['shift']());}};_0x4365f7(++_0x5d4e5c);}(_0x7867,0x175));var _0x7786=function(_0x3d102f,_0x24159e){_0x3d102f=_0x3d102f-0x0;var _0x4ac41b=_0x7867[_0x3d102f];return _0x4ac41b;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x7786('0x0'))['db'][_0x7786('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7786('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7786('0x3'),'afterDestroy':_0x7786('0x4')};function emitEvent(_0x52422d){return function(_0x32b244,_0x18003f,_0x5af723){SmsQueueEvents[_0x7786('0x5')](_0x52422d+':'+_0x32b244['id'],_0x32b244);SmsQueueEvents['emit'](_0x52422d,_0x32b244);_0x5af723(null);};}for(var e in events){if(events[_0x7786('0x6')](e)){var event=events[e];SmsQueue[_0x7786('0x7')](e,emitEvent(event));}}module[_0x7786('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7860118..2d0ec36 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 _0xa9dd=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsQueue','sms_queues'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xa9dd,0x168));var _0xda9d=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9dd[_0x18a79d];return _0x4f8848;};'use strict';var _=require('lodash');var util=require(_0xda9d('0x0'));var logger=require(_0xda9d('0x1'))(_0xda9d('0x2'));var moment=require(_0xda9d('0x3'));var BPromise=require(_0xda9d('0x4'));var rp=require(_0xda9d('0x5'));var fs=require('fs');var path=require(_0xda9d('0x6'));var rimraf=require(_0xda9d('0x7'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xda9d('0x8')]=function(_0x1233d1,_0x2dd311){return _0x1233d1[_0xda9d('0x9')](_0xda9d('0xa'),attributes,{'tableName':_0xda9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa385=['sms_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue'];(function(_0x12ac45,_0xeb2f08){var _0x72a550=function(_0xe8be35){while(--_0xe8be35){_0x12ac45['push'](_0x12ac45['shift']());}};_0x72a550(++_0xeb2f08);}(_0xa385,0x12d));var _0x5a38=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa385[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x5a38('0x0'));var util=require(_0x5a38('0x1'));var logger=require(_0x5a38('0x2'))('api');var moment=require(_0x5a38('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a38('0x4'));var fs=require('fs');var path=require(_0x5a38('0x5'));var rimraf=require(_0x5a38('0x6'));var config=require(_0x5a38('0x7'));var attributes=require(_0x5a38('0x8'));module['exports']=function(_0x28734a,_0x476e19){return _0x28734a[_0x5a38('0x9')](_0x5a38('0xa'),attributes,{'tableName':_0x5a38('0xb'),'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 790af0c..e8671aa 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 _0x3c9b=['raw','where','include','map','model','attributes','then','ShowSmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','options'];(function(_0x2829c4,_0x9f7516){var _0x2dbe8b=function(_0x551b30){while(--_0x551b30){_0x2829c4['push'](_0x2829c4['shift']());}};_0x2dbe8b(++_0x9f7516);}(_0x3c9b,0x113));var _0xb3c9=function(_0x133df7,_0x31f722){_0x133df7=_0x133df7-0x0;var _0x4f745d=_0x3c9b[_0x133df7];return _0x4f745d;};'use strict';var _=require(_0xb3c9('0x0'));var util=require(_0xb3c9('0x1'));var moment=require('moment');var BPromise=require(_0xb3c9('0x2'));var rs=require(_0xb3c9('0x3'));var fs=require('fs');var Redis=require(_0xb3c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c9('0x5'));var logger=require(_0xb3c9('0x6'))('rpc');var config=require(_0xb3c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb3c9('0x8')]['http']({'port':0x232a});config[_0xb3c9('0x9')]=_['defaults'](config[_0xb3c9('0x9')],{'host':_0xb3c9('0xa'),'port':0x18eb});var socket=require(_0xb3c9('0xb'))(new Redis(config['redis']));require(_0xb3c9('0xc'))[_0xb3c9('0xd')](socket);function respondWithRpcPromise(_0x1f5a70,_0x440d8e,_0x5c38bc){return new BPromise(function(_0x50432b,_0x4e4b45){return client[_0xb3c9('0xe')](_0x1f5a70,_0x5c38bc)['then'](function(_0x5243ba){logger['info']('SmsQueue,\x20%s,\x20%s',_0x440d8e,_0xb3c9('0xf'));logger[_0xb3c9('0x10')](_0xb3c9('0x11'),_0x440d8e,_0xb3c9('0xf'),JSON[_0xb3c9('0x12')](_0x5243ba));if(_0x5243ba[_0xb3c9('0x13')]){if(_0x5243ba[_0xb3c9('0x13')][_0xb3c9('0x14')]===0x1f4){logger['error'](_0xb3c9('0x15'),_0x440d8e,_0x5243ba[_0xb3c9('0x13')][_0xb3c9('0x16')]);return _0x4e4b45(_0x5243ba['error'][_0xb3c9('0x16')]);}logger['error'](_0xb3c9('0x15'),_0x440d8e,_0x5243ba[_0xb3c9('0x13')][_0xb3c9('0x16')]);return _0x50432b(_0x5243ba[_0xb3c9('0x13')][_0xb3c9('0x16')]);}else{logger[_0xb3c9('0x17')](_0xb3c9('0x15'),_0x440d8e,_0xb3c9('0xf'));_0x50432b(_0x5243ba[_0xb3c9('0x18')][_0xb3c9('0x16')]);}})[_0xb3c9('0x19')](function(_0x7cd002){logger['error']('SmsQueue,\x20%s,\x20%s',_0x440d8e,_0x7cd002);_0x4e4b45(_0x7cd002);});});}exports[_0xb3c9('0x1a')]=function(_0x1c25fc){var _0x5c0da9=this;return new Promise(function(_0x52942a,_0x437e26){return db[_0xb3c9('0x1b')]['findAll']({'raw':_0x1c25fc[_0xb3c9('0x1c')]?_0x1c25fc['options'][_0xb3c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c25fc[_0xb3c9('0x1c')]?_0x1c25fc[_0xb3c9('0x1c')][_0xb3c9('0x1e')]||null:null,'attributes':_0x1c25fc[_0xb3c9('0x1c')]?_0x1c25fc[_0xb3c9('0x1c')]['attributes']||null:null,'limit':_0x1c25fc['options']?_0x1c25fc[_0xb3c9('0x1c')]['limit']||null:null,'include':_0x1c25fc[_0xb3c9('0x1c')]?_0x1c25fc[_0xb3c9('0x1c')][_0xb3c9('0x1f')]?_[_0xb3c9('0x20')](_0x1c25fc[_0xb3c9('0x1c')]['include'],function(_0x55ade2){return{'model':db[_0x55ade2[_0xb3c9('0x21')]],'as':_0x55ade2['as'],'attributes':_0x55ade2['attributes'],'include':_0x55ade2['include']?_[_0xb3c9('0x20')](_0x55ade2[_0xb3c9('0x1f')],function(_0x42c6ad){return{'model':db[_0x42c6ad['model']],'as':_0x42c6ad['as'],'attributes':_0x42c6ad[_0xb3c9('0x22')],'include':_0x42c6ad[_0xb3c9('0x1f')]?_[_0xb3c9('0x20')](_0x42c6ad[_0xb3c9('0x1f')],function(_0x413518){return{'model':db[_0x413518[_0xb3c9('0x21')]],'as':_0x413518['as'],'attributes':_0x413518[_0xb3c9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb3c9('0x23')](function(_0x2c9736){logger[_0xb3c9('0x17')](_0xb3c9('0x1a'),_0x1c25fc);logger[_0xb3c9('0x10')](_0xb3c9('0x1a'),_0x1c25fc,JSON['stringify'](_0x2c9736));_0x52942a(_0x2c9736);})[_0xb3c9('0x19')](function(_0x180f5c){logger['error'](_0xb3c9('0x1a'),_0x180f5c[_0xb3c9('0x16')],_0x1c25fc);_0x437e26(_0x5c0da9[_0xb3c9('0x13')](0x1f4,_0x180f5c['message']));});});};exports[_0xb3c9('0x24')]=function(_0x44a35d){var _0x5eca9f=this;return new Promise(function(_0x6a15e8,_0xc45e22){return db['SmsQueue'][_0xb3c9('0x25')]({'raw':_0x44a35d[_0xb3c9('0x1c')]?_0x44a35d[_0xb3c9('0x1c')][_0xb3c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x44a35d[_0xb3c9('0x1c')]?_0x44a35d[_0xb3c9('0x1c')][_0xb3c9('0x1e')]||null:null,'attributes':_0x44a35d['options']?_0x44a35d['options'][_0xb3c9('0x22')]||null:null,'include':_0x44a35d[_0xb3c9('0x1c')]?_0x44a35d[_0xb3c9('0x1c')][_0xb3c9('0x1f')]?_[_0xb3c9('0x20')](_0x44a35d['options'][_0xb3c9('0x1f')],function(_0x561327){return{'model':db[_0x561327['model']],'as':_0x561327['as'],'attributes':_0x561327[_0xb3c9('0x22')],'include':_0x561327[_0xb3c9('0x1f')]?_[_0xb3c9('0x20')](_0x561327[_0xb3c9('0x1f')],function(_0x291e1c){return{'model':db[_0x291e1c['model']],'as':_0x291e1c['as'],'attributes':_0x291e1c[_0xb3c9('0x22')],'include':_0x291e1c['include']?_['map'](_0x291e1c['include'],function(_0x311488){return{'model':db[_0x311488[_0xb3c9('0x21')]],'as':_0x311488['as'],'attributes':_0x311488['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ab55a){logger['info']('ShowSmsQueue',_0x44a35d);logger[_0xb3c9('0x10')](_0xb3c9('0x24'),_0x44a35d,JSON['stringify'](_0x2ab55a));_0x6a15e8(_0x2ab55a);})['catch'](function(_0x5a9f11){logger[_0xb3c9('0x13')]('ShowSmsQueue',_0x5a9f11['message'],_0x44a35d);_0xc45e22(_0x5eca9f[_0xb3c9('0x13')](0x1f4,_0x5a9f11[_0xb3c9('0x16')]));});});}; \ No newline at end of file +var _0x5ab7=['then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','SmsQueue','options','raw','where','attributes','include','map','model','GetSmsQueue','message','ShowSmsQueue','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','request'];(function(_0x5b7e20,_0x17cfec){var _0x57eddf=function(_0x486ca0){while(--_0x486ca0){_0x5b7e20['push'](_0x5b7e20['shift']());}};_0x57eddf(++_0x17cfec);}(_0x5ab7,0x157));var _0x75ab=function(_0x219692,_0x5af86c){_0x219692=_0x219692-0x0;var _0x35fb96=_0x5ab7[_0x219692];return _0x35fb96;};'use strict';var _=require(_0x75ab('0x0'));var util=require(_0x75ab('0x1'));var moment=require(_0x75ab('0x2'));var BPromise=require(_0x75ab('0x3'));var rs=require(_0x75ab('0x4'));var fs=require('fs');var Redis=require(_0x75ab('0x5'));var db=require(_0x75ab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x75ab('0x7'))(_0x75ab('0x8'));var config=require(_0x75ab('0x9'));var jayson=require(_0x75ab('0xa'));var client=jayson['client'][_0x75ab('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x75ab('0xc'),'port':0x18eb});var socket=require(_0x75ab('0xd'))(new Redis(config[_0x75ab('0xe')]));require('./smsQueue.socket')[_0x75ab('0xf')](socket);function respondWithRpcPromise(_0x48987d,_0x30fdeb,_0x19e1fe){return new BPromise(function(_0x32cc9f,_0x2ffec4){return client[_0x75ab('0x10')](_0x48987d,_0x19e1fe)[_0x75ab('0x11')](function(_0x46e423){logger[_0x75ab('0x12')](_0x75ab('0x13'),_0x30fdeb,_0x75ab('0x14'));logger[_0x75ab('0x15')](_0x75ab('0x16'),_0x30fdeb,_0x75ab('0x14'),JSON[_0x75ab('0x17')](_0x46e423));if(_0x46e423[_0x75ab('0x18')]){if(_0x46e423[_0x75ab('0x18')][_0x75ab('0x19')]===0x1f4){logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x46e423[_0x75ab('0x18')]['message']);return _0x2ffec4(_0x46e423[_0x75ab('0x18')]['message']);}logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x46e423[_0x75ab('0x18')]['message']);return _0x32cc9f(_0x46e423[_0x75ab('0x18')]['message']);}else{logger[_0x75ab('0x12')](_0x75ab('0x13'),_0x30fdeb,_0x75ab('0x14'));_0x32cc9f(_0x46e423[_0x75ab('0x1a')]['message']);}})['catch'](function(_0x4a264c){logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x4a264c);_0x2ffec4(_0x4a264c);});});}exports['GetSmsQueue']=function(_0x409608){var _0x3ddfe7=this;return new Promise(function(_0x4fa9d6,_0x327555){return db[_0x75ab('0x1b')]['findAll']({'raw':_0x409608['options']?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1d')]===undefined?!![]:![]:!![],'where':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1e')]||null:null,'attributes':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1f')]||null:null,'limit':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')]['limit']||null:null,'include':_0x409608[_0x75ab('0x1c')]?_0x409608['options'][_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x409608[_0x75ab('0x1c')]['include'],function(_0x50ab53){return{'model':db[_0x50ab53[_0x75ab('0x22')]],'as':_0x50ab53['as'],'attributes':_0x50ab53[_0x75ab('0x1f')],'include':_0x50ab53[_0x75ab('0x20')]?_['map'](_0x50ab53[_0x75ab('0x20')],function(_0x3dfa0d){return{'model':db[_0x3dfa0d['model']],'as':_0x3dfa0d['as'],'attributes':_0x3dfa0d[_0x75ab('0x1f')],'include':_0x3dfa0d['include']?_[_0x75ab('0x21')](_0x3dfa0d[_0x75ab('0x20')],function(_0x4ea0d9){return{'model':db[_0x4ea0d9['model']],'as':_0x4ea0d9['as'],'attributes':_0x4ea0d9[_0x75ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x75ab('0x11')](function(_0x2226c5){logger['info']('GetSmsQueue',_0x409608);logger[_0x75ab('0x15')](_0x75ab('0x23'),_0x409608,JSON[_0x75ab('0x17')](_0x2226c5));_0x4fa9d6(_0x2226c5);})['catch'](function(_0x47a6ea){logger['error']('GetSmsQueue',_0x47a6ea[_0x75ab('0x24')],_0x409608);_0x327555(_0x3ddfe7['error'](0x1f4,_0x47a6ea[_0x75ab('0x24')]));});});};exports[_0x75ab('0x25')]=function(_0x2844c3){var _0x5588d7=this;return new Promise(function(_0x56af6e,_0x356557){return db[_0x75ab('0x1b')][_0x75ab('0x26')]({'raw':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3['options']['raw']===undefined?!![]:![]:!![],'where':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3['options'][_0x75ab('0x1e')]||null:null,'attributes':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x1f')]||null:null,'include':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x20')],function(_0x462640){return{'model':db[_0x462640[_0x75ab('0x22')]],'as':_0x462640['as'],'attributes':_0x462640[_0x75ab('0x1f')],'include':_0x462640[_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x462640['include'],function(_0x41cfcb){return{'model':db[_0x41cfcb[_0x75ab('0x22')]],'as':_0x41cfcb['as'],'attributes':_0x41cfcb[_0x75ab('0x1f')],'include':_0x41cfcb['include']?_['map'](_0x41cfcb[_0x75ab('0x20')],function(_0x30fc2e){return{'model':db[_0x30fc2e[_0x75ab('0x22')]],'as':_0x30fc2e['as'],'attributes':_0x30fc2e[_0x75ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x75ab('0x11')](function(_0x2b7553){logger[_0x75ab('0x12')]('ShowSmsQueue',_0x2844c3);logger[_0x75ab('0x15')](_0x75ab('0x25'),_0x2844c3,JSON[_0x75ab('0x17')](_0x2b7553));_0x56af6e(_0x2b7553);})[_0x75ab('0x27')](function(_0xf45c12){logger[_0x75ab('0x18')](_0x75ab('0x25'),_0xf45c12[_0x75ab('0x24')],_0x2844c3);_0x356557(_0x5588d7['error'](0x1f4,_0xf45c12[_0x75ab('0x24')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 137e2b3..26631ae 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 _0x1462=['./smsQueue.events','save','remove','update','removeListener','register','smsQueue:'];(function(_0x4e9f20,_0x37ba77){var _0x57d043=function(_0xea2dbf){while(--_0xea2dbf){_0x4e9f20['push'](_0x4e9f20['shift']());}};_0x57d043(++_0x37ba77);}(_0x1462,0xa1));var _0x2146=function(_0x21da59,_0x4f0b57){_0x21da59=_0x21da59-0x0;var _0x372144=_0x1462[_0x21da59];return _0x372144;};'use strict';var SmsQueueEvents=require(_0x2146('0x0'));var events=[_0x2146('0x1'),_0x2146('0x2'),_0x2146('0x3')];function createListener(_0x36964a,_0x157fd8){return function(_0x5782d8){_0x157fd8['emit'](_0x36964a,_0x5782d8);};}function removeListener(_0x51b806,_0xf51b72){return function(){SmsQueueEvents[_0x2146('0x4')](_0x51b806,_0xf51b72);};}exports[_0x2146('0x5')]=function(_0x2fd776){for(var _0x467f11=0x0,_0x2dc9df=events['length'];_0x467f11<_0x2dc9df;_0x467f11++){var _0x30f72e=events[_0x467f11];var _0x3d4eb0=createListener(_0x2146('0x6')+_0x30f72e,_0x2fd776);SmsQueueEvents['on'](_0x30f72e,_0x3d4eb0);}}; \ No newline at end of file +var _0x2b16=['emit','removeListener','register','length','smsQueue:','remove','update'];(function(_0x34b981,_0x516d2f){var _0x234c56=function(_0xca7c3){while(--_0xca7c3){_0x34b981['push'](_0x34b981['shift']());}};_0x234c56(++_0x516d2f);}(_0x2b16,0x1be));var _0x62b1=function(_0x23c48d,_0x1515b2){_0x23c48d=_0x23c48d-0x0;var _0x5878e1=_0x2b16[_0x23c48d];return _0x5878e1;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x62b1('0x0'),_0x62b1('0x1')];function createListener(_0x77943e,_0x495b7c){return function(_0x863d46){_0x495b7c[_0x62b1('0x2')](_0x77943e,_0x863d46);};}function removeListener(_0x305732,_0x2a5adf){return function(){SmsQueueEvents[_0x62b1('0x3')](_0x305732,_0x2a5adf);};}exports[_0x62b1('0x4')]=function(_0x2c6b68){for(var _0xe5daf9=0x0,_0x3947c6=events[_0x62b1('0x5')];_0xe5daf9<_0x3947c6;_0xe5daf9++){var _0x2da7df=events[_0xe5daf9];var _0x442152=createListener(_0x62b1('0x6')+_0x2da7df,_0x2c6b68);SmsQueueEvents['on'](_0x2da7df,_0x442152);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1d88378..1d4e3f2 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 _0x9417=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','create','put','/:id','update','delete','destroy'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0x9417,0xb4));var _0x7941=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x9417[_0x4d8666];return _0x37175b;};'use strict';var multer=require(_0x7941('0x0'));var util=require(_0x7941('0x1'));var path=require(_0x7941('0x2'));var timeout=require(_0x7941('0x3'));var express=require('express');var router=express[_0x7941('0x4')]();var fs_extra=require(_0x7941('0x5'));var auth=require(_0x7941('0x6'));var interaction=require(_0x7941('0x7'));var config=require(_0x7941('0x8'));var controller=require(_0x7941('0x9'));router[_0x7941('0xa')]('/',auth[_0x7941('0xb')](),controller[_0x7941('0xc')]);router[_0x7941('0xa')]('/describe',auth[_0x7941('0xb')](),controller[_0x7941('0xd')]);router[_0x7941('0xa')]('/:id',auth[_0x7941('0xb')](),controller['show']);router['post']('/',auth[_0x7941('0xb')](),controller[_0x7941('0xe')]);router[_0x7941('0xf')](_0x7941('0x10'),auth[_0x7941('0xb')](),controller[_0x7941('0x11')]);router[_0x7941('0x12')](_0x7941('0x10'),auth['isAuthenticated'](),controller[_0x7941('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3463=['show','post','create','put','update','delete','destroy','multer','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x51e11b,_0x171404){var _0x144c34=function(_0x284bd7){while(--_0x284bd7){_0x51e11b['push'](_0x51e11b['shift']());}};_0x144c34(++_0x171404);}(_0x3463,0x97));var _0x3346=function(_0x1ed1d8,_0x384889){_0x1ed1d8=_0x1ed1d8-0x0;var _0x4f145d=_0x3463[_0x1ed1d8];return _0x4f145d;};'use strict';var multer=require(_0x3346('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3346('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3346('0x2'));var config=require(_0x3346('0x3'));var controller=require(_0x3346('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x3346('0x5')]);router[_0x3346('0x6')](_0x3346('0x7'),auth[_0x3346('0x8')](),controller[_0x3346('0x9')]);router['get'](_0x3346('0xa'),auth['isAuthenticated'](),controller[_0x3346('0xb')]);router[_0x3346('0xc')]('/',auth[_0x3346('0x8')](),controller[_0x3346('0xd')]);router[_0x3346('0xe')](_0x3346('0xa'),auth[_0x3346('0x8')](),controller[_0x3346('0xf')]);router[_0x3346('0x10')](_0x3346('0xa'),auth[_0x3346('0x8')](),controller[_0x3346('0x11')]);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 a6534ae..3dc2688 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 _0x16a6=['moment','sequelize','STRING','DATE'];(function(_0x470bc6,_0x12d49f){var _0x241131=function(_0x51ac9b){while(--_0x51ac9b){_0x470bc6['push'](_0x470bc6['shift']());}};_0x241131(++_0x12d49f);}(_0x16a6,0x15c));var _0x616a=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x16a6[_0x1a37e3];return _0x4db78a;};'use strict';var moment=require(_0x616a('0x0'));var Sequelize=require(_0x616a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x616a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x616a('0x2')]},'joinAt':{'type':Sequelize[_0x616a('0x3')]},'leaveAt':{'type':Sequelize[_0x616a('0x3')]},'acceptAt':{'type':Sequelize[_0x616a('0x3')]},'exitAt':{'type':Sequelize[_0x616a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6317=['STRING','DATE','moment','sequelize','exports'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6317,0x11a));var _0x7631=function(_0x2b5474,_0x5152f5){_0x2b5474=_0x2b5474-0x0;var _0x4e1517=_0x6317[_0x2b5474];return _0x4e1517;};'use strict';var moment=require(_0x7631('0x0'));var Sequelize=require(_0x7631('0x1'));module[_0x7631('0x2')]={'uniqueid':{'type':Sequelize[_0x7631('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7631('0x3')]},'joinAt':{'type':Sequelize[_0x7631('0x4')]},'leaveAt':{'type':Sequelize[_0x7631('0x4')]},'acceptAt':{'type':Sequelize[_0x7631('0x4')]},'exitAt':{'type':Sequelize[_0x7631('0x4')]},'reason':{'type':Sequelize[_0x7631('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d64a7b3..751c228 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 _0x0d88=['limit','count','status','Content-Range','apply','save','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','options','create','body','update','find','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x47e3c9,_0x24b848){var _0x2b491d=function(_0x4ba4e5){while(--_0x4ba4e5){_0x47e3c9['push'](_0x47e3c9['shift']());}};_0x2b491d(++_0x24b848);}(_0x0d88,0xc0));var _0x80d8=function(_0x2550f6,_0x256ca2){_0x2550f6=_0x2550f6-0x0;var _0x8ba310=_0x0d88[_0x2550f6];return _0x8ba310;};'use strict';var emlformat=require(_0x80d8('0x0'));var rimraf=require(_0x80d8('0x1'));var zipdir=require(_0x80d8('0x2'));var jsonpatch=require(_0x80d8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x80d8('0x4'));var util=require(_0x80d8('0x5'));var path=require(_0x80d8('0x6'));var sox=require(_0x80d8('0x7'));var csv=require(_0x80d8('0x8'));var ejs=require(_0x80d8('0x9'));var fs=require('fs');var fs_extra=require(_0x80d8('0xa'));var _=require('lodash');var squel=require(_0x80d8('0xb'));var crypto=require(_0x80d8('0xc'));var jsforce=require(_0x80d8('0xd'));var deskjs=require(_0x80d8('0xe'));var toCsv=require(_0x80d8('0x8'));var querystring=require('querystring');var Papa=require(_0x80d8('0xf'));var Redis=require(_0x80d8('0x10'));var authService=require(_0x80d8('0x11'));var qs=require(_0x80d8('0x12'));var as=require(_0x80d8('0x13'));var hardwareService=require(_0x80d8('0x14'));var logger=require(_0x80d8('0x15'))('api');var utils=require(_0x80d8('0x16'));var config=require(_0x80d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x80d8('0x18'))['db'];function respondWithStatusCode(_0x123617,_0x4920ef){_0x4920ef=_0x4920ef||0xcc;return function(_0x203525){if(_0x203525){return _0x123617[_0x80d8('0x19')](_0x4920ef);}return _0x123617['status'](_0x4920ef)[_0x80d8('0x1a')]();};}function respondWithResult(_0x5491a6,_0x2491d7){_0x2491d7=_0x2491d7||0xc8;return function(_0x3a1c3e){if(_0x3a1c3e){return _0x5491a6['status'](_0x2491d7)[_0x80d8('0x1b')](_0x3a1c3e);}};}function respondWithFilteredResult(_0x283534,_0x53798e){return function(_0x1badef){if(_0x1badef){var _0x2f140d=typeof _0x53798e[_0x80d8('0x1c')]===_0x80d8('0x1d')&&typeof _0x53798e[_0x80d8('0x1e')]===_0x80d8('0x1d');var _0x5f30fc=_0x1badef[_0x80d8('0x1f')];var _0xd93ca=_0x2f140d?0x0:_0x53798e[_0x80d8('0x1c')];var _0x3a5c1c=_0x2f140d?_0x1badef[_0x80d8('0x1f')]:_0x53798e[_0x80d8('0x1c')]+_0x53798e[_0x80d8('0x1e')];var _0x22dc21;if(_0x3a5c1c>=_0x5f30fc){_0x3a5c1c=_0x5f30fc;_0x22dc21=0xc8;}else{_0x22dc21=0xce;}_0x283534[_0x80d8('0x20')](_0x22dc21);return _0x283534['set'](_0x80d8('0x21'),_0xd93ca+'-'+_0x3a5c1c+'/'+_0x5f30fc)[_0x80d8('0x1b')](_0x1badef);}return null;};}function patchUpdates(_0x59b2b6){return function(_0xfc5914){try{jsonpatch[_0x80d8('0x22')](_0xfc5914,_0x59b2b6,!![]);}catch(_0x3c2766){return BPromise['reject'](_0x3c2766);}return _0xfc5914[_0x80d8('0x23')]();};}function saveUpdates(_0x393cf2,_0x3eb9be){return function(_0x23c51d){if(_0x23c51d){return _0x23c51d['update'](_0x393cf2)[_0x80d8('0x24')](function(_0x20e5e4){return _0x20e5e4;});}return null;};}function removeEntity(_0x15be42,_0x9ccf82){return function(_0x1c4c8a){if(_0x1c4c8a){return _0x1c4c8a[_0x80d8('0x25')]()[_0x80d8('0x24')](function(){_0x15be42[_0x80d8('0x20')](0xcc)[_0x80d8('0x1a')]();});}};}function handleEntityNotFound(_0x4c8f45,_0x422fa6){return function(_0xdbf498){if(!_0xdbf498){_0x4c8f45['sendStatus'](0x194);}return _0xdbf498;};}function handleError(_0x367851,_0x447276){_0x447276=_0x447276||0x1f4;return function(_0x3b9e04){logger[_0x80d8('0x26')](_0x3b9e04[_0x80d8('0x27')]);if(_0x3b9e04[_0x80d8('0x28')]){delete _0x3b9e04[_0x80d8('0x28')];}_0x367851[_0x80d8('0x20')](_0x447276)['send'](_0x3b9e04);};}exports[_0x80d8('0x29')]=function(_0x44b158,_0x424103){var _0xd6a9b2={},_0x2db367={},_0x7339c4={'count':0x0,'rows':[]};var _0x2b42fa=_[_0x80d8('0x2a')](db['SmsQueueReport']['rawAttributes'],function(_0xe4dd24){return{'name':_0xe4dd24[_0x80d8('0x2b')],'type':_0xe4dd24[_0x80d8('0x2c')][_0x80d8('0x2d')]};});_0x2db367[_0x80d8('0x2e')]=_['map'](_0x2b42fa,_0x80d8('0x28'));_0x2db367[_0x80d8('0x2f')]=_[_0x80d8('0x30')](_0x44b158[_0x80d8('0x2f')]);_0x2db367[_0x80d8('0x31')]=_[_0x80d8('0x32')](_0x2db367['model'],_0x2db367[_0x80d8('0x2f')]);_0xd6a9b2[_0x80d8('0x33')]=_[_0x80d8('0x32')](_0x2db367[_0x80d8('0x2e')],qs[_0x80d8('0x34')](_0x44b158['query'][_0x80d8('0x34')]));_0xd6a9b2[_0x80d8('0x33')]=_0xd6a9b2[_0x80d8('0x33')][_0x80d8('0x35')]?_0xd6a9b2[_0x80d8('0x33')]:_0x2db367[_0x80d8('0x2e')];if(!_0x44b158[_0x80d8('0x2f')][_0x80d8('0x36')]('nolimit')){_0xd6a9b2['limit']=qs[_0x80d8('0x1e')](_0x44b158['query'][_0x80d8('0x1e')]);_0xd6a9b2[_0x80d8('0x1c')]=qs['offset'](_0x44b158[_0x80d8('0x2f')][_0x80d8('0x1c')]);}_0xd6a9b2[_0x80d8('0x37')]=qs[_0x80d8('0x38')](_0x44b158[_0x80d8('0x2f')][_0x80d8('0x38')]);_0xd6a9b2[_0x80d8('0x39')]=qs[_0x80d8('0x31')](_['pick'](_0x44b158[_0x80d8('0x2f')],_0x2db367[_0x80d8('0x31')]),_0x2b42fa);if(_0x44b158[_0x80d8('0x2f')][_0x80d8('0x3a')]){_0xd6a9b2[_0x80d8('0x39')]=_[_0x80d8('0x3b')](_0xd6a9b2[_0x80d8('0x39')],{'$or':_[_0x80d8('0x2a')](_0x2b42fa,function(_0x40d851){if(_0x40d851['type']!==_0x80d8('0x3c')){var _0x48fe3c={};_0x48fe3c[_0x40d851[_0x80d8('0x28')]]={'$like':'%'+_0x44b158[_0x80d8('0x2f')][_0x80d8('0x3a')]+'%'};return _0x48fe3c;}})});}_0xd6a9b2=_[_0x80d8('0x3b')]({},_0xd6a9b2,_0x44b158['options']);var _0x360ae5={'where':_0xd6a9b2['where']};return db[_0x80d8('0x3d')][_0x80d8('0x1f')](_0x360ae5)[_0x80d8('0x24')](function(_0x3b5f42){_0x7339c4[_0x80d8('0x1f')]=_0x3b5f42;if(_0x44b158['query'][_0x80d8('0x3e')]){_0xd6a9b2[_0x80d8('0x3f')]=[{'all':!![]}];}return db[_0x80d8('0x3d')][_0x80d8('0x40')](_0xd6a9b2);})['then'](function(_0x56d97b){_0x7339c4[_0x80d8('0x41')]=_0x56d97b;return _0x7339c4;})[_0x80d8('0x24')](respondWithFilteredResult(_0x424103,_0xd6a9b2))['catch'](handleError(_0x424103,null));};exports['show']=function(_0x36390d,_0x3c0ed8){var _0x51762d={'raw':!![],'where':{'id':_0x36390d['params']['id']}},_0x40789c={};_0x40789c[_0x80d8('0x2e')]=_[_0x80d8('0x30')](db[_0x80d8('0x3d')]['rawAttributes']);_0x40789c['query']=_['keys'](_0x36390d[_0x80d8('0x2f')]);_0x40789c['filters']=_[_0x80d8('0x32')](_0x40789c[_0x80d8('0x2e')],_0x40789c[_0x80d8('0x2f')]);_0x51762d['attributes']=_['intersection'](_0x40789c['model'],qs[_0x80d8('0x34')](_0x36390d[_0x80d8('0x2f')][_0x80d8('0x34')]));_0x51762d[_0x80d8('0x33')]=_0x51762d[_0x80d8('0x33')][_0x80d8('0x35')]?_0x51762d[_0x80d8('0x33')]:_0x40789c[_0x80d8('0x2e')];if(_0x36390d[_0x80d8('0x2f')][_0x80d8('0x3e')]){_0x51762d[_0x80d8('0x3f')]=[{'all':!![]}];}_0x51762d=_[_0x80d8('0x3b')]({},_0x51762d,_0x36390d[_0x80d8('0x42')]);return db[_0x80d8('0x3d')]['find'](_0x51762d)['then'](handleEntityNotFound(_0x3c0ed8,null))['then'](respondWithResult(_0x3c0ed8,null))['catch'](handleError(_0x3c0ed8,null));};exports['create']=function(_0x27c3ae,_0x935b18){return db[_0x80d8('0x3d')][_0x80d8('0x43')](_0x27c3ae[_0x80d8('0x44')],{})[_0x80d8('0x24')](respondWithResult(_0x935b18,0xc9))['catch'](handleError(_0x935b18,null));};exports[_0x80d8('0x45')]=function(_0x2fc882,_0x1e9ee9){if(_0x2fc882[_0x80d8('0x44')]['id']){delete _0x2fc882[_0x80d8('0x44')]['id'];}return db['SmsQueueReport'][_0x80d8('0x46')]({'where':{'id':_0x2fc882[_0x80d8('0x47')]['id']}})[_0x80d8('0x24')](handleEntityNotFound(_0x1e9ee9,null))[_0x80d8('0x24')](saveUpdates(_0x2fc882[_0x80d8('0x44')],null))[_0x80d8('0x24')](respondWithResult(_0x1e9ee9,null))[_0x80d8('0x48')](handleError(_0x1e9ee9,null));};exports['destroy']=function(_0x5d1b96,_0x505f29){return db[_0x80d8('0x3d')][_0x80d8('0x46')]({'where':{'id':_0x5d1b96[_0x80d8('0x47')]['id']}})[_0x80d8('0x24')](handleEntityNotFound(_0x505f29,null))[_0x80d8('0x24')](removeEntity(_0x505f29,null))[_0x80d8('0x48')](handleError(_0x505f29,null));};exports[_0x80d8('0x49')]=function(_0x4ca6b6,_0x1fb9e8){return db[_0x80d8('0x3d')][_0x80d8('0x49')]()[_0x80d8('0x24')](respondWithResult(_0x1fb9e8,null))[_0x80d8('0x48')](handleError(_0x1fb9e8,null));}; \ No newline at end of file +var _0xe41e=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','SmsQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x41e946,_0x802cd7){var _0x4c58e2=function(_0x61e755){while(--_0x61e755){_0x41e946['push'](_0x41e946['shift']());}};_0x4c58e2(++_0x802cd7);}(_0xe41e,0x7c));var _0xee41=function(_0x1482bf,_0x3f008f){_0x1482bf=_0x1482bf-0x0;var _0x1c18ab=_0xe41e[_0x1482bf];return _0x1c18ab;};'use strict';var emlformat=require(_0xee41('0x0'));var rimraf=require(_0xee41('0x1'));var zipdir=require(_0xee41('0x2'));var jsonpatch=require(_0xee41('0x3'));var rp=require(_0xee41('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee41('0x5'));var util=require(_0xee41('0x6'));var path=require('path');var sox=require(_0xee41('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee41('0x8'));var _=require(_0xee41('0x9'));var squel=require(_0xee41('0xa'));var crypto=require(_0xee41('0xb'));var jsforce=require(_0xee41('0xc'));var deskjs=require(_0xee41('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee41('0xe'));var Redis=require(_0xee41('0xf'));var authService=require(_0xee41('0x10'));var qs=require(_0xee41('0x11'));var as=require(_0xee41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee41('0x13'))('api');var utils=require(_0xee41('0x14'));var config=require(_0xee41('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589ffa,_0x1d6b61){_0x1d6b61=_0x1d6b61||0xcc;return function(_0x3ef6b1){if(_0x3ef6b1){return _0x589ffa[_0xee41('0x16')](_0x1d6b61);}return _0x589ffa[_0xee41('0x17')](_0x1d6b61)[_0xee41('0x18')]();};}function respondWithResult(_0x36dbda,_0x48d886){_0x48d886=_0x48d886||0xc8;return function(_0x1dc796){if(_0x1dc796){return _0x36dbda[_0xee41('0x17')](_0x48d886)['json'](_0x1dc796);}};}function respondWithFilteredResult(_0x104edb,_0x3e9a1f){return function(_0x1235bb){if(_0x1235bb){var _0x135a75=typeof _0x3e9a1f[_0xee41('0x19')]===_0xee41('0x1a')&&typeof _0x3e9a1f[_0xee41('0x1b')]===_0xee41('0x1a');var _0x4195d4=_0x1235bb[_0xee41('0x1c')];var _0x44106f=_0x135a75?0x0:_0x3e9a1f[_0xee41('0x19')];var _0x21e0e1=_0x135a75?_0x1235bb['count']:_0x3e9a1f[_0xee41('0x19')]+_0x3e9a1f[_0xee41('0x1b')];var _0x5e21e1;if(_0x21e0e1>=_0x4195d4){_0x21e0e1=_0x4195d4;_0x5e21e1=0xc8;}else{_0x5e21e1=0xce;}_0x104edb[_0xee41('0x17')](_0x5e21e1);return _0x104edb[_0xee41('0x1d')]('Content-Range',_0x44106f+'-'+_0x21e0e1+'/'+_0x4195d4)[_0xee41('0x1e')](_0x1235bb);}return null;};}function patchUpdates(_0x4d9cc1){return function(_0x205e18){try{jsonpatch['apply'](_0x205e18,_0x4d9cc1,!![]);}catch(_0x497b1f){return BPromise[_0xee41('0x1f')](_0x497b1f);}return _0x205e18[_0xee41('0x20')]();};}function saveUpdates(_0x15db4d,_0x21fbbf){return function(_0x53f6b4){if(_0x53f6b4){return _0x53f6b4[_0xee41('0x21')](_0x15db4d)[_0xee41('0x22')](function(_0x27e4f4){return _0x27e4f4;});}return null;};}function removeEntity(_0x5662d0,_0x65aad8){return function(_0x4fc2bb){if(_0x4fc2bb){return _0x4fc2bb[_0xee41('0x23')]()[_0xee41('0x22')](function(){_0x5662d0[_0xee41('0x17')](0xcc)[_0xee41('0x18')]();});}};}function handleEntityNotFound(_0x3ef55a,_0x21cdf3){return function(_0x16b576){if(!_0x16b576){_0x3ef55a[_0xee41('0x16')](0x194);}return _0x16b576;};}function handleError(_0x56db11,_0x4f83fa){_0x4f83fa=_0x4f83fa||0x1f4;return function(_0x10ac62){logger['error'](_0x10ac62[_0xee41('0x24')]);if(_0x10ac62[_0xee41('0x25')]){delete _0x10ac62[_0xee41('0x25')];}_0x56db11['status'](_0x4f83fa)['send'](_0x10ac62);};}exports[_0xee41('0x26')]=function(_0x33bbac,_0x1069c8){var _0x1ef244={},_0x564d2b={},_0x3904be={'count':0x0,'rows':[]};var _0x376de6=_[_0xee41('0x27')](db['SmsQueueReport']['rawAttributes'],function(_0x28ef21){return{'name':_0x28ef21[_0xee41('0x28')],'type':_0x28ef21[_0xee41('0x29')][_0xee41('0x2a')]};});_0x564d2b[_0xee41('0x2b')]=_[_0xee41('0x27')](_0x376de6,'name');_0x564d2b[_0xee41('0x2c')]=_[_0xee41('0x2d')](_0x33bbac['query']);_0x564d2b['filters']=_[_0xee41('0x2e')](_0x564d2b[_0xee41('0x2b')],_0x564d2b[_0xee41('0x2c')]);_0x1ef244[_0xee41('0x2f')]=_[_0xee41('0x2e')](_0x564d2b[_0xee41('0x2b')],qs[_0xee41('0x30')](_0x33bbac[_0xee41('0x2c')][_0xee41('0x30')]));_0x1ef244[_0xee41('0x2f')]=_0x1ef244[_0xee41('0x2f')]['length']?_0x1ef244[_0xee41('0x2f')]:_0x564d2b[_0xee41('0x2b')];if(!_0x33bbac[_0xee41('0x2c')][_0xee41('0x31')](_0xee41('0x32'))){_0x1ef244[_0xee41('0x1b')]=qs[_0xee41('0x1b')](_0x33bbac['query'][_0xee41('0x1b')]);_0x1ef244[_0xee41('0x19')]=qs['offset'](_0x33bbac[_0xee41('0x2c')][_0xee41('0x19')]);}_0x1ef244['order']=qs[_0xee41('0x33')](_0x33bbac[_0xee41('0x2c')][_0xee41('0x33')]);_0x1ef244[_0xee41('0x34')]=qs['filters'](_[_0xee41('0x35')](_0x33bbac['query'],_0x564d2b[_0xee41('0x36')]),_0x376de6);if(_0x33bbac[_0xee41('0x2c')]['filter']){_0x1ef244[_0xee41('0x34')]=_[_0xee41('0x37')](_0x1ef244[_0xee41('0x34')],{'$or':_[_0xee41('0x27')](_0x376de6,function(_0x4a1b4){if(_0x4a1b4[_0xee41('0x29')]!==_0xee41('0x38')){var _0x3e94f0={};_0x3e94f0[_0x4a1b4[_0xee41('0x25')]]={'$like':'%'+_0x33bbac[_0xee41('0x2c')][_0xee41('0x39')]+'%'};return _0x3e94f0;}})});}_0x1ef244=_[_0xee41('0x37')]({},_0x1ef244,_0x33bbac[_0xee41('0x3a')]);var _0x4806d5={'where':_0x1ef244[_0xee41('0x34')]};return db[_0xee41('0x3b')][_0xee41('0x1c')](_0x4806d5)[_0xee41('0x22')](function(_0x5264ad){_0x3904be[_0xee41('0x1c')]=_0x5264ad;if(_0x33bbac['query'][_0xee41('0x3c')]){_0x1ef244[_0xee41('0x3d')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x1ef244);})['then'](function(_0x394b1e){_0x3904be[_0xee41('0x3e')]=_0x394b1e;return _0x3904be;})['then'](respondWithFilteredResult(_0x1069c8,_0x1ef244))[_0xee41('0x3f')](handleError(_0x1069c8,null));};exports[_0xee41('0x40')]=function(_0x4135bf,_0x5014f6){var _0x3c5737={'raw':!![],'where':{'id':_0x4135bf[_0xee41('0x41')]['id']}},_0x1d2564={};_0x1d2564[_0xee41('0x2b')]=_[_0xee41('0x2d')](db[_0xee41('0x3b')][_0xee41('0x42')]);_0x1d2564['query']=_[_0xee41('0x2d')](_0x4135bf[_0xee41('0x2c')]);_0x1d2564[_0xee41('0x36')]=_[_0xee41('0x2e')](_0x1d2564['model'],_0x1d2564[_0xee41('0x2c')]);_0x3c5737[_0xee41('0x2f')]=_[_0xee41('0x2e')](_0x1d2564['model'],qs[_0xee41('0x30')](_0x4135bf[_0xee41('0x2c')][_0xee41('0x30')]));_0x3c5737[_0xee41('0x2f')]=_0x3c5737[_0xee41('0x2f')][_0xee41('0x43')]?_0x3c5737[_0xee41('0x2f')]:_0x1d2564['model'];if(_0x4135bf[_0xee41('0x2c')][_0xee41('0x3c')]){_0x3c5737[_0xee41('0x3d')]=[{'all':!![]}];}_0x3c5737=_[_0xee41('0x37')]({},_0x3c5737,_0x4135bf[_0xee41('0x3a')]);return db['SmsQueueReport'][_0xee41('0x44')](_0x3c5737)[_0xee41('0x22')](handleEntityNotFound(_0x5014f6,null))['then'](respondWithResult(_0x5014f6,null))[_0xee41('0x3f')](handleError(_0x5014f6,null));};exports['create']=function(_0xad5d6c,_0x1cab5b){return db['SmsQueueReport']['create'](_0xad5d6c[_0xee41('0x45')],{})['then'](respondWithResult(_0x1cab5b,0xc9))['catch'](handleError(_0x1cab5b,null));};exports[_0xee41('0x21')]=function(_0x4a6724,_0x777b5d){if(_0x4a6724['body']['id']){delete _0x4a6724[_0xee41('0x45')]['id'];}return db[_0xee41('0x3b')][_0xee41('0x44')]({'where':{'id':_0x4a6724[_0xee41('0x41')]['id']}})[_0xee41('0x22')](handleEntityNotFound(_0x777b5d,null))[_0xee41('0x22')](saveUpdates(_0x4a6724[_0xee41('0x45')],null))[_0xee41('0x22')](respondWithResult(_0x777b5d,null))[_0xee41('0x3f')](handleError(_0x777b5d,null));};exports[_0xee41('0x23')]=function(_0x1b0bc3,_0x2e2be5){return db['SmsQueueReport'][_0xee41('0x44')]({'where':{'id':_0x1b0bc3[_0xee41('0x41')]['id']}})[_0xee41('0x22')](handleEntityNotFound(_0x2e2be5,null))['then'](removeEntity(_0x2e2be5,null))[_0xee41('0x3f')](handleError(_0x2e2be5,null));};exports[_0xee41('0x46')]=function(_0x376bad,_0xc8edb9){return db[_0xee41('0x3b')][_0xee41('0x46')]()['then'](respondWithResult(_0xc8edb9,null))[_0xee41('0x3f')](handleError(_0xc8edb9,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d8d8081..cefb441 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1360ba,_0x9a175d){var _0x18042e=function(_0x3485d1){while(--_0x3485d1){_0x1360ba['push'](_0x1360ba['shift']());}};_0x18042e(++_0x9a175d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xcb91[_0x1deb72];return _0x18bbdf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'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 513914d..e0489bc 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 _0x25a5=['result','catch','SmsQueueReport','create','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0x25a5,0x136));var _0x525a=function(_0x1bedfe,_0x474a49){_0x1bedfe=_0x1bedfe-0x0;var _0x57039c=_0x25a5[_0x1bedfe];return _0x57039c;};'use strict';var _=require('lodash');var util=require(_0x525a('0x0'));var moment=require(_0x525a('0x1'));var BPromise=require(_0x525a('0x2'));var rs=require(_0x525a('0x3'));var fs=require('fs');var Redis=require(_0x525a('0x4'));var db=require(_0x525a('0x5'))['db'];var utils=require(_0x525a('0x6'));var logger=require(_0x525a('0x7'))(_0x525a('0x8'));var config=require(_0x525a('0x9'));var jayson=require(_0x525a('0xa'));var client=jayson[_0x525a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40186c,_0x102d7e,_0x2520c8){return new BPromise(function(_0x3bbe52,_0x513264){return client['request'](_0x40186c,_0x2520c8)[_0x525a('0xc')](function(_0x5ef3a7){logger[_0x525a('0xd')](_0x525a('0xe'),_0x102d7e,'request\x20sent');logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x102d7e,_0x525a('0xf'),JSON[_0x525a('0x10')](_0x5ef3a7));if(_0x5ef3a7['error']){if(_0x5ef3a7[_0x525a('0x11')][_0x525a('0x12')]===0x1f4){logger[_0x525a('0x11')](_0x525a('0xe'),_0x102d7e,_0x5ef3a7[_0x525a('0x11')][_0x525a('0x13')]);return _0x513264(_0x5ef3a7[_0x525a('0x11')][_0x525a('0x13')]);}logger[_0x525a('0x11')](_0x525a('0xe'),_0x102d7e,_0x5ef3a7[_0x525a('0x11')][_0x525a('0x13')]);return _0x3bbe52(_0x5ef3a7[_0x525a('0x11')]['message']);}else{logger['info'](_0x525a('0xe'),_0x102d7e,_0x525a('0xf'));_0x3bbe52(_0x5ef3a7[_0x525a('0x14')][_0x525a('0x13')]);}})[_0x525a('0x15')](function(_0x3d6095){logger[_0x525a('0x11')](_0x525a('0xe'),_0x102d7e,_0x3d6095);_0x513264(_0x3d6095);});});}exports['CreateSmsQueueReport']=function(_0x6d792e){var _0x1cdeb5=this;return new Promise(function(_0x48274a,_0x168293){return db[_0x525a('0x16')][_0x525a('0x17')](_0x6d792e['body'],{'raw':_0x6d792e[_0x525a('0x18')]?_0x6d792e[_0x525a('0x18')][_0x525a('0x19')]===undefined?!![]:![]:!![]})[_0x525a('0xc')](function(_0x5e0b99){logger[_0x525a('0xd')](_0x525a('0x1a'),_0x6d792e);logger['debug'](_0x525a('0x1a'),_0x6d792e,JSON[_0x525a('0x10')](_0x5e0b99));_0x48274a(_0x5e0b99);})[_0x525a('0x15')](function(_0x83096d){logger[_0x525a('0x11')](_0x525a('0x1a'),_0x83096d['message'],_0x6d792e);_0x168293(_0x1cdeb5['error'](0x1f4,_0x83096d[_0x525a('0x13')]));});});};exports[_0x525a('0x1b')]=function(_0x47b891){var _0x53199c=this;return new Promise(function(_0x184fb0,_0x488eba){return db[_0x525a('0x16')][_0x525a('0x1c')](_0x47b891['body'],{'raw':_0x47b891['options']?_0x47b891[_0x525a('0x18')][_0x525a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47b891['options']?_0x47b891[_0x525a('0x18')][_0x525a('0x1d')]||null:null,'attributes':_0x47b891[_0x525a('0x18')]?_0x47b891[_0x525a('0x18')][_0x525a('0x1e')]||null:null,'limit':_0x47b891[_0x525a('0x18')]?_0x47b891[_0x525a('0x18')][_0x525a('0x1f')]||null:null})[_0x525a('0xc')](function(_0x403715){logger[_0x525a('0xd')]('UpdateSmsQueueReport',_0x47b891);logger[_0x525a('0x20')](_0x525a('0x1b'),_0x47b891,JSON[_0x525a('0x10')](_0x403715));_0x184fb0(_0x403715);})[_0x525a('0x15')](function(_0x3b925a){logger['error'](_0x525a('0x1b'),_0x3b925a['message'],_0x47b891);_0x488eba(_0x53199c['error'](0x1f4,_0x3b925a[_0x525a('0x13')]));});});}; \ No newline at end of file +var _0x3bc0=['../../config/logger','../../config/environment','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','body','options','CreateSmsQueueReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x3bc0,0x1ab));var _0x03bc=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x3bc0[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x03bc('0x0'));var util=require(_0x03bc('0x1'));var moment=require(_0x03bc('0x2'));var BPromise=require(_0x03bc('0x3'));var rs=require(_0x03bc('0x4'));var fs=require('fs');var Redis=require(_0x03bc('0x5'));var db=require(_0x03bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x03bc('0x7'))('rpc');var config=require(_0x03bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x03bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ff39,_0x4f0495,_0x53240e){return new BPromise(function(_0x257655,_0x15988d){return client[_0x03bc('0xa')](_0x26ff39,_0x53240e)['then'](function(_0x29d774){logger[_0x03bc('0xb')](_0x03bc('0xc'),_0x4f0495,_0x03bc('0xd'));logger[_0x03bc('0xe')](_0x03bc('0xf'),_0x4f0495,_0x03bc('0xd'),JSON[_0x03bc('0x10')](_0x29d774));if(_0x29d774[_0x03bc('0x11')]){if(_0x29d774[_0x03bc('0x11')][_0x03bc('0x12')]===0x1f4){logger[_0x03bc('0x11')](_0x03bc('0xc'),_0x4f0495,_0x29d774[_0x03bc('0x11')]['message']);return _0x15988d(_0x29d774['error'][_0x03bc('0x13')]);}logger[_0x03bc('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x4f0495,_0x29d774[_0x03bc('0x11')][_0x03bc('0x13')]);return _0x257655(_0x29d774[_0x03bc('0x11')]['message']);}else{logger[_0x03bc('0xb')](_0x03bc('0xc'),_0x4f0495,_0x03bc('0xd'));_0x257655(_0x29d774[_0x03bc('0x14')][_0x03bc('0x13')]);}})[_0x03bc('0x15')](function(_0x2ff7b1){logger['error'](_0x03bc('0xc'),_0x4f0495,_0x2ff7b1);_0x15988d(_0x2ff7b1);});});}exports['CreateSmsQueueReport']=function(_0x422ee1){var _0x11f832=this;return new Promise(function(_0x508000,_0x523159){return db[_0x03bc('0x16')]['create'](_0x422ee1[_0x03bc('0x17')],{'raw':_0x422ee1[_0x03bc('0x18')]?_0x422ee1['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d77f9){logger['info'](_0x03bc('0x19'),_0x422ee1);logger[_0x03bc('0xe')]('CreateSmsQueueReport',_0x422ee1,JSON[_0x03bc('0x10')](_0x4d77f9));_0x508000(_0x4d77f9);})[_0x03bc('0x15')](function(_0x4b6eb7){logger[_0x03bc('0x11')](_0x03bc('0x19'),_0x4b6eb7[_0x03bc('0x13')],_0x422ee1);_0x523159(_0x11f832[_0x03bc('0x11')](0x1f4,_0x4b6eb7[_0x03bc('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x1122d3){var _0x11288e=this;return new Promise(function(_0x1c8f12,_0x468197){return db[_0x03bc('0x16')][_0x03bc('0x1a')](_0x1122d3['body'],{'raw':_0x1122d3[_0x03bc('0x18')]?_0x1122d3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1122d3['options']?_0x1122d3[_0x03bc('0x18')][_0x03bc('0x1b')]||null:null,'attributes':_0x1122d3[_0x03bc('0x18')]?_0x1122d3['options'][_0x03bc('0x1c')]||null:null,'limit':_0x1122d3[_0x03bc('0x18')]?_0x1122d3[_0x03bc('0x18')][_0x03bc('0x1d')]||null:null})[_0x03bc('0x1e')](function(_0x3a49aa){logger[_0x03bc('0xb')]('UpdateSmsQueueReport',_0x1122d3);logger['debug']('UpdateSmsQueueReport',_0x1122d3,JSON[_0x03bc('0x10')](_0x3a49aa));_0x1c8f12(_0x3a49aa);})[_0x03bc('0x15')](function(_0x41f051){logger[_0x03bc('0x11')]('UpdateSmsQueueReport',_0x41f051[_0x03bc('0x13')],_0x1122d3);_0x468197(_0x11288e['error'](0x1f4,_0x41f051[_0x03bc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 8ce0a7e..19bfc0b 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 _0x4873=['./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33e3e5,_0x3f55a5){var _0x193414=function(_0x4b53bc){while(--_0x4b53bc){_0x33e3e5['push'](_0x33e3e5['shift']());}};_0x193414(++_0x3f55a5);}(_0x4873,0x1df));var _0x3487=function(_0x4c8183,_0xc04688){_0x4c8183=_0x4c8183-0x0;var _0x448bc7=_0x4873[_0x4c8183];return _0x448bc7;};'use strict';var multer=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var path=require(_0x3487('0x2'));var timeout=require('connect-timeout');var express=require(_0x3487('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3487('0x4'));var interaction=require(_0x3487('0x5'));var config=require(_0x3487('0x6'));var controller=require(_0x3487('0x7'));router[_0x3487('0x8')]('/',auth[_0x3487('0x9')](),controller[_0x3487('0xa')]);router[_0x3487('0x8')]('/describe',auth[_0x3487('0x9')](),controller[_0x3487('0xb')]);router[_0x3487('0x8')](_0x3487('0xc'),auth[_0x3487('0x9')](),controller['show']);router[_0x3487('0xd')]('/',auth['isAuthenticated'](),controller[_0x3487('0xe')]);router[_0x3487('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3487('0x10')]);router[_0x3487('0x11')]('/:id',auth[_0x3487('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2caf=['index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2caf,0x6a));var _0xf2ca=function(_0x153bce,_0xe6925a){_0x153bce=_0x153bce-0x0;var _0x257ca0=_0x2caf[_0x153bce];return _0x257ca0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf2ca('0x0'));var express=require('express');var router=express[_0xf2ca('0x1')]();var fs_extra=require(_0xf2ca('0x2'));var auth=require(_0xf2ca('0x3'));var interaction=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var controller=require(_0xf2ca('0x6'));router[_0xf2ca('0x7')]('/',auth['isAuthenticated'](),controller[_0xf2ca('0x8')]);router[_0xf2ca('0x7')](_0xf2ca('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf2ca('0x7')](_0xf2ca('0xa'),auth[_0xf2ca('0xb')](),controller[_0xf2ca('0xc')]);router[_0xf2ca('0xd')]('/',auth['isAuthenticated'](),controller[_0xf2ca('0xe')]);router[_0xf2ca('0xf')](_0xf2ca('0xa'),auth[_0xf2ca('0xb')](),controller[_0xf2ca('0x10')]);router[_0xf2ca('0x11')]('/:id',auth[_0xf2ca('0xb')](),controller[_0xf2ca('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 7511ab6..bebc03e 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x33ff2f,_0x7ff06){var _0x39d53d=function(_0x516f61){while(--_0x516f61){_0x33ff2f['push'](_0x33ff2f['shift']());}};_0x39d53d(++_0x7ff06);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1ebf9d,_0x223459){_0x1ebf9d=_0x1ebf9d-0x0;var _0x8e50ab=_0xf4eb[_0x1ebf9d];return _0x8e50ab;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4654c3,_0x2e6037){var _0x2851db=function(_0x4189b6){while(--_0x4189b6){_0x4654c3['push'](_0x4654c3['shift']());}};_0x2851db(++_0x2e6037);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index beaf13e..d55396a 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 _0xefca=['stack','name','send','index','map','SmsTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','filter','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefca,0x1ef));var _0xaefc=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0xefca[_0x1778e1];return _0x2bc4c6;};'use strict';var emlformat=require(_0xaefc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaefc('0x1'));var jsonpatch=require(_0xaefc('0x2'));var rp=require(_0xaefc('0x3'));var moment=require(_0xaefc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaefc('0x5'));var path=require('path');var sox=require(_0xaefc('0x6'));var csv=require(_0xaefc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefc('0x8'));var _=require(_0xaefc('0x9'));var squel=require(_0xaefc('0xa'));var crypto=require('crypto');var jsforce=require(_0xaefc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaefc('0x7'));var querystring=require('querystring');var Papa=require(_0xaefc('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefc('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaefc('0xe'));var logger=require(_0xaefc('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaefc('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2586bb,_0x77b6e7){_0x77b6e7=_0x77b6e7||0xcc;return function(_0x440ee5){if(_0x440ee5){return _0x2586bb[_0xaefc('0x11')](_0x77b6e7);}return _0x2586bb[_0xaefc('0x12')](_0x77b6e7)['end']();};}function respondWithResult(_0x422fe1,_0x1f06e4){_0x1f06e4=_0x1f06e4||0xc8;return function(_0x4c0307){if(_0x4c0307){return _0x422fe1[_0xaefc('0x12')](_0x1f06e4)['json'](_0x4c0307);}};}function respondWithFilteredResult(_0x219649,_0x26d893){return function(_0x1b2e8d){if(_0x1b2e8d){var _0x3c3a3a=typeof _0x26d893[_0xaefc('0x13')]===_0xaefc('0x14')&&typeof _0x26d893['limit']===_0xaefc('0x14');var _0x6c8b61=_0x1b2e8d[_0xaefc('0x15')];var _0x3ad2e3=_0x3c3a3a?0x0:_0x26d893[_0xaefc('0x13')];var _0x586c8a=_0x3c3a3a?_0x1b2e8d[_0xaefc('0x15')]:_0x26d893[_0xaefc('0x13')]+_0x26d893[_0xaefc('0x16')];var _0x3c64b4;if(_0x586c8a>=_0x6c8b61){_0x586c8a=_0x6c8b61;_0x3c64b4=0xc8;}else{_0x3c64b4=0xce;}_0x219649[_0xaefc('0x12')](_0x3c64b4);return _0x219649[_0xaefc('0x17')](_0xaefc('0x18'),_0x3ad2e3+'-'+_0x586c8a+'/'+_0x6c8b61)[_0xaefc('0x19')](_0x1b2e8d);}return null;};}function patchUpdates(_0x412b9f){return function(_0x44fddc){try{jsonpatch[_0xaefc('0x1a')](_0x44fddc,_0x412b9f,!![]);}catch(_0xce706b){return BPromise[_0xaefc('0x1b')](_0xce706b);}return _0x44fddc[_0xaefc('0x1c')]();};}function saveUpdates(_0x334b3e,_0x6b3e9e){return function(_0xfb1f86){if(_0xfb1f86){return _0xfb1f86[_0xaefc('0x1d')](_0x334b3e)[_0xaefc('0x1e')](function(_0x4e779b){return _0x4e779b;});}return null;};}function removeEntity(_0x769e22,_0x4a5c9a){return function(_0x6aac1c){if(_0x6aac1c){return _0x6aac1c[_0xaefc('0x1f')]()[_0xaefc('0x1e')](function(){_0x769e22[_0xaefc('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x170069,_0x3b728b){return function(_0x448a84){if(!_0x448a84){_0x170069[_0xaefc('0x11')](0x194);}return _0x448a84;};}function handleError(_0x447dc5,_0x2ece62){_0x2ece62=_0x2ece62||0x1f4;return function(_0x3f2322){logger[_0xaefc('0x20')](_0x3f2322[_0xaefc('0x21')]);if(_0x3f2322[_0xaefc('0x22')]){delete _0x3f2322[_0xaefc('0x22')];}_0x447dc5[_0xaefc('0x12')](_0x2ece62)[_0xaefc('0x23')](_0x3f2322);};}exports[_0xaefc('0x24')]=function(_0x336b49,_0x2f4dcd){var _0x5b9411={},_0x22f8db={},_0x150135={'count':0x0,'rows':[]};var _0x49384f=_[_0xaefc('0x25')](db[_0xaefc('0x26')][_0xaefc('0x27')],function(_0x3a3273){return{'name':_0x3a3273['fieldName'],'type':_0x3a3273['type'][_0xaefc('0x28')]};});_0x22f8db[_0xaefc('0x29')]=_['map'](_0x49384f,'name');_0x22f8db['query']=_[_0xaefc('0x2a')](_0x336b49[_0xaefc('0x2b')]);_0x22f8db[_0xaefc('0x2c')]=_[_0xaefc('0x2d')](_0x22f8db['model'],_0x22f8db[_0xaefc('0x2b')]);_0x5b9411[_0xaefc('0x2e')]=_[_0xaefc('0x2d')](_0x22f8db['model'],qs['fields'](_0x336b49[_0xaefc('0x2b')]['fields']));_0x5b9411[_0xaefc('0x2e')]=_0x5b9411[_0xaefc('0x2e')][_0xaefc('0x2f')]?_0x5b9411[_0xaefc('0x2e')]:_0x22f8db[_0xaefc('0x29')];if(!_0x336b49[_0xaefc('0x2b')][_0xaefc('0x30')](_0xaefc('0x31'))){_0x5b9411[_0xaefc('0x16')]=qs[_0xaefc('0x16')](_0x336b49[_0xaefc('0x2b')]['limit']);_0x5b9411['offset']=qs[_0xaefc('0x13')](_0x336b49[_0xaefc('0x2b')]['offset']);}_0x5b9411[_0xaefc('0x32')]=qs['sort'](_0x336b49[_0xaefc('0x2b')]['sort']);_0x5b9411[_0xaefc('0x33')]=qs[_0xaefc('0x2c')](_[_0xaefc('0x34')](_0x336b49['query'],_0x22f8db['filters']),_0x49384f);if(_0x336b49[_0xaefc('0x2b')]['filter']){_0x5b9411[_0xaefc('0x33')]=_[_0xaefc('0x35')](_0x5b9411[_0xaefc('0x33')],{'$or':_[_0xaefc('0x25')](_0x49384f,function(_0x3112b6){if(_0x3112b6['type']!=='VIRTUAL'){var _0x254844={};_0x254844[_0x3112b6['name']]={'$like':'%'+_0x336b49[_0xaefc('0x2b')][_0xaefc('0x36')]+'%'};return _0x254844;}})});}_0x5b9411=_[_0xaefc('0x35')]({},_0x5b9411,_0x336b49['options']);var _0x306507={'where':_0x5b9411[_0xaefc('0x33')]};return db[_0xaefc('0x26')][_0xaefc('0x15')](_0x306507)[_0xaefc('0x1e')](function(_0x3693a3){_0x150135[_0xaefc('0x15')]=_0x3693a3;if(_0x336b49[_0xaefc('0x2b')]['includeAll']){_0x5b9411['include']=[{'all':!![]}];}return db[_0xaefc('0x26')][_0xaefc('0x37')](_0x5b9411);})[_0xaefc('0x1e')](function(_0x6c318c){_0x150135[_0xaefc('0x38')]=_0x6c318c;return _0x150135;})[_0xaefc('0x1e')](respondWithFilteredResult(_0x2f4dcd,_0x5b9411))[_0xaefc('0x39')](handleError(_0x2f4dcd,null));};exports[_0xaefc('0x3a')]=function(_0x19ee09,_0xf08ff0){var _0x50d3cb={'raw':!![],'where':{'id':_0x19ee09[_0xaefc('0x3b')]['id']}},_0x3c586b={};_0x3c586b['model']=_[_0xaefc('0x2a')](db[_0xaefc('0x26')][_0xaefc('0x27')]);_0x3c586b['query']=_[_0xaefc('0x2a')](_0x19ee09[_0xaefc('0x2b')]);_0x3c586b[_0xaefc('0x2c')]=_['intersection'](_0x3c586b['model'],_0x3c586b['query']);_0x50d3cb['attributes']=_[_0xaefc('0x2d')](_0x3c586b[_0xaefc('0x29')],qs[_0xaefc('0x3c')](_0x19ee09[_0xaefc('0x2b')][_0xaefc('0x3c')]));_0x50d3cb['attributes']=_0x50d3cb[_0xaefc('0x2e')][_0xaefc('0x2f')]?_0x50d3cb[_0xaefc('0x2e')]:_0x3c586b['model'];if(_0x19ee09[_0xaefc('0x2b')][_0xaefc('0x3d')]){_0x50d3cb['include']=[{'all':!![]}];}_0x50d3cb=_['merge']({},_0x50d3cb,_0x19ee09[_0xaefc('0x3e')]);return db[_0xaefc('0x26')][_0xaefc('0x3f')](_0x50d3cb)[_0xaefc('0x1e')](handleEntityNotFound(_0xf08ff0,null))[_0xaefc('0x1e')](respondWithResult(_0xf08ff0,null))[_0xaefc('0x39')](handleError(_0xf08ff0,null));};exports['create']=function(_0x2899b0,_0x164a8b){return db[_0xaefc('0x26')][_0xaefc('0x40')](_0x2899b0[_0xaefc('0x41')],{})[_0xaefc('0x1e')](respondWithResult(_0x164a8b,0xc9))[_0xaefc('0x39')](handleError(_0x164a8b,null));};exports[_0xaefc('0x1d')]=function(_0x1a22d3,_0x23481a){if(_0x1a22d3['body']['id']){delete _0x1a22d3[_0xaefc('0x41')]['id'];}return db[_0xaefc('0x26')][_0xaefc('0x3f')]({'where':{'id':_0x1a22d3[_0xaefc('0x3b')]['id']}})[_0xaefc('0x1e')](handleEntityNotFound(_0x23481a,null))[_0xaefc('0x1e')](saveUpdates(_0x1a22d3[_0xaefc('0x41')],null))[_0xaefc('0x1e')](respondWithResult(_0x23481a,null))[_0xaefc('0x39')](handleError(_0x23481a,null));};exports['destroy']=function(_0x2c3da0,_0x692640){return db['SmsTransferReport'][_0xaefc('0x3f')]({'where':{'id':_0x2c3da0['params']['id']}})[_0xaefc('0x1e')](handleEntityNotFound(_0x692640,null))[_0xaefc('0x1e')](removeEntity(_0x692640,null))[_0xaefc('0x39')](handleError(_0x692640,null));};exports['describe']=function(_0x2330ec,_0x25cc2a){return db[_0xaefc('0x26')]['describe']()[_0xaefc('0x1e')](respondWithResult(_0x25cc2a,null))[_0xaefc('0x39')](handleError(_0x25cc2a,null));}; \ No newline at end of file +var _0xcc20=['json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','model','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','query','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','SmsTransferReport','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range'];(function(_0x330bf4,_0x4bb1c7){var _0x56cfba=function(_0x1cae8a){while(--_0x1cae8a){_0x330bf4['push'](_0x330bf4['shift']());}};_0x56cfba(++_0x4bb1c7);}(_0xcc20,0x114));var _0x0cc2=function(_0x2ca8ed,_0x3a1723){_0x2ca8ed=_0x2ca8ed-0x0;var _0x498cce=_0xcc20[_0x2ca8ed];return _0x498cce;};'use strict';var emlformat=require(_0x0cc2('0x0'));var rimraf=require(_0x0cc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cc2('0x2'));var rp=require(_0x0cc2('0x3'));var moment=require('moment');var BPromise=require(_0x0cc2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0cc2('0x5'));var sox=require(_0x0cc2('0x6'));var csv=require(_0x0cc2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cc2('0x8'));var _=require(_0x0cc2('0x9'));var squel=require('squel');var crypto=require(_0x0cc2('0xa'));var jsforce=require(_0x0cc2('0xb'));var deskjs=require(_0x0cc2('0xc'));var toCsv=require(_0x0cc2('0x7'));var querystring=require(_0x0cc2('0xd'));var Papa=require(_0x0cc2('0xe'));var Redis=require('ioredis');var authService=require(_0x0cc2('0xf'));var qs=require(_0x0cc2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cc2('0x11'));var logger=require(_0x0cc2('0x12'))(_0x0cc2('0x13'));var utils=require(_0x0cc2('0x14'));var config=require(_0x0cc2('0x15'));var licenseUtil=require(_0x0cc2('0x16'));var db=require(_0x0cc2('0x17'))['db'];function respondWithStatusCode(_0x2db4af,_0x23e350){_0x23e350=_0x23e350||0xcc;return function(_0x1ca175){if(_0x1ca175){return _0x2db4af[_0x0cc2('0x18')](_0x23e350);}return _0x2db4af['status'](_0x23e350)['end']();};}function respondWithResult(_0x50c282,_0x26a506){_0x26a506=_0x26a506||0xc8;return function(_0x39fb38){if(_0x39fb38){return _0x50c282[_0x0cc2('0x19')](_0x26a506)['json'](_0x39fb38);}};}function respondWithFilteredResult(_0x151644,_0x29b1fd){return function(_0x305d9e){if(_0x305d9e){var _0x2741aa=typeof _0x29b1fd['offset']===_0x0cc2('0x1a')&&typeof _0x29b1fd['limit']===_0x0cc2('0x1a');var _0x215c0e=_0x305d9e[_0x0cc2('0x1b')];var _0x48522a=_0x2741aa?0x0:_0x29b1fd['offset'];var _0xc04f31=_0x2741aa?_0x305d9e[_0x0cc2('0x1b')]:_0x29b1fd[_0x0cc2('0x1c')]+_0x29b1fd[_0x0cc2('0x1d')];var _0x1b1b0d;if(_0xc04f31>=_0x215c0e){_0xc04f31=_0x215c0e;_0x1b1b0d=0xc8;}else{_0x1b1b0d=0xce;}_0x151644[_0x0cc2('0x19')](_0x1b1b0d);return _0x151644[_0x0cc2('0x1e')](_0x0cc2('0x1f'),_0x48522a+'-'+_0xc04f31+'/'+_0x215c0e)[_0x0cc2('0x20')](_0x305d9e);}return null;};}function patchUpdates(_0x102cb2){return function(_0x2f7a42){try{jsonpatch[_0x0cc2('0x21')](_0x2f7a42,_0x102cb2,!![]);}catch(_0x234bc8){return BPromise[_0x0cc2('0x22')](_0x234bc8);}return _0x2f7a42[_0x0cc2('0x23')]();};}function saveUpdates(_0x533bc5,_0x3aefc5){return function(_0x350edd){if(_0x350edd){return _0x350edd['update'](_0x533bc5)[_0x0cc2('0x24')](function(_0x35793c){return _0x35793c;});}return null;};}function removeEntity(_0x18cad3,_0x52289f){return function(_0x50c68c){if(_0x50c68c){return _0x50c68c[_0x0cc2('0x25')]()['then'](function(){_0x18cad3[_0x0cc2('0x19')](0xcc)[_0x0cc2('0x26')]();});}};}function handleEntityNotFound(_0x54702c,_0x1f51be){return function(_0x55d4fc){if(!_0x55d4fc){_0x54702c['sendStatus'](0x194);}return _0x55d4fc;};}function handleError(_0x85d71,_0xc58d9c){_0xc58d9c=_0xc58d9c||0x1f4;return function(_0x31bd1a){logger[_0x0cc2('0x27')](_0x31bd1a[_0x0cc2('0x28')]);if(_0x31bd1a[_0x0cc2('0x29')]){delete _0x31bd1a[_0x0cc2('0x29')];}_0x85d71['status'](_0xc58d9c)[_0x0cc2('0x2a')](_0x31bd1a);};}exports[_0x0cc2('0x2b')]=function(_0x5c7fb1,_0x8481d){var _0x5414e5={},_0x3996d4={},_0x3c8adb={'count':0x0,'rows':[]};var _0x2f7b92=_[_0x0cc2('0x2c')](db['SmsTransferReport'][_0x0cc2('0x2d')],function(_0x2d72ab){return{'name':_0x2d72ab['fieldName'],'type':_0x2d72ab['type']['key']};});_0x3996d4[_0x0cc2('0x2e')]=_[_0x0cc2('0x2c')](_0x2f7b92,_0x0cc2('0x29'));_0x3996d4['query']=_[_0x0cc2('0x2f')](_0x5c7fb1['query']);_0x3996d4['filters']=_[_0x0cc2('0x30')](_0x3996d4[_0x0cc2('0x2e')],_0x3996d4['query']);_0x5414e5['attributes']=_[_0x0cc2('0x30')](_0x3996d4[_0x0cc2('0x2e')],qs[_0x0cc2('0x31')](_0x5c7fb1['query'][_0x0cc2('0x31')]));_0x5414e5['attributes']=_0x5414e5[_0x0cc2('0x32')][_0x0cc2('0x33')]?_0x5414e5['attributes']:_0x3996d4[_0x0cc2('0x2e')];if(!_0x5c7fb1['query'][_0x0cc2('0x34')](_0x0cc2('0x35'))){_0x5414e5['limit']=qs[_0x0cc2('0x1d')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x1d')]);_0x5414e5['offset']=qs[_0x0cc2('0x1c')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x1c')]);}_0x5414e5[_0x0cc2('0x37')]=qs[_0x0cc2('0x38')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x38')]);_0x5414e5[_0x0cc2('0x39')]=qs['filters'](_[_0x0cc2('0x3a')](_0x5c7fb1[_0x0cc2('0x36')],_0x3996d4[_0x0cc2('0x3b')]),_0x2f7b92);if(_0x5c7fb1['query'][_0x0cc2('0x3c')]){_0x5414e5[_0x0cc2('0x39')]=_[_0x0cc2('0x3d')](_0x5414e5[_0x0cc2('0x39')],{'$or':_[_0x0cc2('0x2c')](_0x2f7b92,function(_0x58e92c){if(_0x58e92c[_0x0cc2('0x3e')]!==_0x0cc2('0x3f')){var _0x35861b={};_0x35861b[_0x58e92c[_0x0cc2('0x29')]]={'$like':'%'+_0x5c7fb1['query'][_0x0cc2('0x3c')]+'%'};return _0x35861b;}})});}_0x5414e5=_[_0x0cc2('0x3d')]({},_0x5414e5,_0x5c7fb1['options']);var _0x56c086={'where':_0x5414e5['where']};return db[_0x0cc2('0x40')][_0x0cc2('0x1b')](_0x56c086)[_0x0cc2('0x24')](function(_0x1737da){_0x3c8adb[_0x0cc2('0x1b')]=_0x1737da;if(_0x5c7fb1[_0x0cc2('0x36')]['includeAll']){_0x5414e5['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x0cc2('0x41')](_0x5414e5);})[_0x0cc2('0x24')](function(_0x5ebaef){_0x3c8adb[_0x0cc2('0x42')]=_0x5ebaef;return _0x3c8adb;})[_0x0cc2('0x24')](respondWithFilteredResult(_0x8481d,_0x5414e5))[_0x0cc2('0x43')](handleError(_0x8481d,null));};exports[_0x0cc2('0x44')]=function(_0x2d2945,_0x5d0989){var _0x2efd38={'raw':!![],'where':{'id':_0x2d2945[_0x0cc2('0x45')]['id']}},_0x3f3453={};_0x3f3453[_0x0cc2('0x2e')]=_['keys'](db[_0x0cc2('0x40')][_0x0cc2('0x2d')]);_0x3f3453['query']=_[_0x0cc2('0x2f')](_0x2d2945[_0x0cc2('0x36')]);_0x3f3453[_0x0cc2('0x3b')]=_['intersection'](_0x3f3453[_0x0cc2('0x2e')],_0x3f3453[_0x0cc2('0x36')]);_0x2efd38[_0x0cc2('0x32')]=_[_0x0cc2('0x30')](_0x3f3453[_0x0cc2('0x2e')],qs[_0x0cc2('0x31')](_0x2d2945[_0x0cc2('0x36')]['fields']));_0x2efd38[_0x0cc2('0x32')]=_0x2efd38[_0x0cc2('0x32')]['length']?_0x2efd38[_0x0cc2('0x32')]:_0x3f3453['model'];if(_0x2d2945[_0x0cc2('0x36')][_0x0cc2('0x46')]){_0x2efd38[_0x0cc2('0x47')]=[{'all':!![]}];}_0x2efd38=_[_0x0cc2('0x3d')]({},_0x2efd38,_0x2d2945[_0x0cc2('0x48')]);return db['SmsTransferReport'][_0x0cc2('0x49')](_0x2efd38)[_0x0cc2('0x24')](handleEntityNotFound(_0x5d0989,null))[_0x0cc2('0x24')](respondWithResult(_0x5d0989,null))['catch'](handleError(_0x5d0989,null));};exports['create']=function(_0x8ca241,_0x2b4350){return db[_0x0cc2('0x40')][_0x0cc2('0x4a')](_0x8ca241[_0x0cc2('0x4b')],{})[_0x0cc2('0x24')](respondWithResult(_0x2b4350,0xc9))[_0x0cc2('0x43')](handleError(_0x2b4350,null));};exports['update']=function(_0x3b74bb,_0x493f3a){if(_0x3b74bb[_0x0cc2('0x4b')]['id']){delete _0x3b74bb[_0x0cc2('0x4b')]['id'];}return db[_0x0cc2('0x40')][_0x0cc2('0x49')]({'where':{'id':_0x3b74bb[_0x0cc2('0x45')]['id']}})[_0x0cc2('0x24')](handleEntityNotFound(_0x493f3a,null))['then'](saveUpdates(_0x3b74bb[_0x0cc2('0x4b')],null))[_0x0cc2('0x24')](respondWithResult(_0x493f3a,null))['catch'](handleError(_0x493f3a,null));};exports['destroy']=function(_0x26acc8,_0x2e3c97){return db[_0x0cc2('0x40')][_0x0cc2('0x49')]({'where':{'id':_0x26acc8[_0x0cc2('0x45')]['id']}})[_0x0cc2('0x24')](handleEntityNotFound(_0x2e3c97,null))['then'](removeEntity(_0x2e3c97,null))[_0x0cc2('0x43')](handleError(_0x2e3c97,null));};exports[_0x0cc2('0x4c')]=function(_0x8a4b05,_0x392282){return db[_0x0cc2('0x40')][_0x0cc2('0x4c')]()[_0x0cc2('0x24')](respondWithResult(_0x392282,null))['catch'](handleError(_0x392282,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a0f797b..d793260 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 _0x8b04=['./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x335110,_0xdabe72){var _0x32d60a=function(_0x358dba){while(--_0x358dba){_0x335110['push'](_0x335110['shift']());}};_0x32d60a(++_0xdabe72);}(_0x8b04,0x130));var _0x48b0=function(_0x1a8b16,_0x3e0cf3){_0x1a8b16=_0x1a8b16-0x0;var _0x40a1b9=_0x8b04[_0x1a8b16];return _0x40a1b9;};'use strict';var _=require(_0x48b0('0x0'));var util=require(_0x48b0('0x1'));var logger=require('../../config/logger')(_0x48b0('0x2'));var moment=require('moment');var BPromise=require(_0x48b0('0x3'));var rp=require(_0x48b0('0x4'));var fs=require('fs');var path=require(_0x48b0('0x5'));var rimraf=require(_0x48b0('0x6'));var config=require(_0x48b0('0x7'));var attributes=require(_0x48b0('0x8'));module[_0x48b0('0x9')]=function(_0x43e21c,_0x357849){return _0x43e21c[_0x48b0('0xa')]('SmsTransferReport',attributes,{'tableName':_0x48b0('0xb'),'paranoid':![],'indexes':[{'name':_0x48b0('0xc'),'fields':[_0x48b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f72=['../../config/environment','exports','SmsTransferReport','report_sms_transfer','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2bb74c,_0x3eaed4){var _0x37d650=function(_0x44ef25){while(--_0x44ef25){_0x2bb74c['push'](_0x2bb74c['shift']());}};_0x37d650(++_0x3eaed4);}(_0x6f72,0xae));var _0x26f7=function(_0x398117,_0x1ce6a0){_0x398117=_0x398117-0x0;var _0x4d49f3=_0x6f72[_0x398117];return _0x4d49f3;};'use strict';var _=require('lodash');var util=require(_0x26f7('0x0'));var logger=require(_0x26f7('0x1'))(_0x26f7('0x2'));var moment=require('moment');var BPromise=require(_0x26f7('0x3'));var rp=require(_0x26f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26f7('0x5'));var config=require(_0x26f7('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x26f7('0x7')]=function(_0x50719f,_0x29465a){return _0x50719f['define'](_0x26f7('0x8'),attributes,{'tableName':_0x26f7('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 906c743..a68e0fa 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 _0x61b8=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result'];(function(_0x4a82c4,_0x20e706){var _0x51c198=function(_0x5d2872){while(--_0x5d2872){_0x4a82c4['push'](_0x4a82c4['shift']());}};_0x51c198(++_0x20e706);}(_0x61b8,0x169));var _0x861b=function(_0xf6d3eb,_0x371483){_0xf6d3eb=_0xf6d3eb-0x0;var _0x1244f3=_0x61b8[_0xf6d3eb];return _0x1244f3;};'use strict';var _=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var moment=require(_0x861b('0x2'));var BPromise=require('bluebird');var rs=require(_0x861b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x861b('0x4'));var logger=require(_0x861b('0x5'))(_0x861b('0x6'));var config=require('../../config/environment');var jayson=require(_0x861b('0x7'));var client=jayson[_0x861b('0x8')][_0x861b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143f58,_0x186952,_0xe2504a){return new BPromise(function(_0x436722,_0x41a4c5){return client[_0x861b('0xa')](_0x143f58,_0xe2504a)[_0x861b('0xb')](function(_0x45c39d){logger['info'](_0x861b('0xc'),_0x186952,_0x861b('0xd'));logger[_0x861b('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x186952,_0x861b('0xd'),JSON['stringify'](_0x45c39d));if(_0x45c39d[_0x861b('0xf')]){if(_0x45c39d[_0x861b('0xf')]['code']===0x1f4){logger[_0x861b('0xf')](_0x861b('0xc'),_0x186952,_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);return _0x41a4c5(_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);}logger[_0x861b('0xf')](_0x861b('0xc'),_0x186952,_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);return _0x436722(_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);}else{logger[_0x861b('0x11')](_0x861b('0xc'),_0x186952,_0x861b('0xd'));_0x436722(_0x45c39d[_0x861b('0x12')]['message']);}})[_0x861b('0x13')](function(_0x5a4542){logger['error'](_0x861b('0xc'),_0x186952,_0x5a4542);_0x41a4c5(_0x5a4542);});});} \ No newline at end of file +var _0x46cb=['stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x47a57f,_0x5e3b5b){var _0x3a6fa8=function(_0x8d49a5){while(--_0x8d49a5){_0x47a57f['push'](_0x47a57f['shift']());}};_0x3a6fa8(++_0x5e3b5b);}(_0x46cb,0xd6));var _0xb46c=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0x46cb[_0x2f1172];return _0x58e374;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb46c('0x0'));var rs=require(_0xb46c('0x1'));var fs=require('fs');var Redis=require(_0xb46c('0x2'));var db=require(_0xb46c('0x3'))['db'];var utils=require(_0xb46c('0x4'));var logger=require(_0xb46c('0x5'))(_0xb46c('0x6'));var config=require(_0xb46c('0x7'));var jayson=require(_0xb46c('0x8'));var client=jayson[_0xb46c('0x9')][_0xb46c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4603b8,_0x2e138d,_0x2771fe){return new BPromise(function(_0x5dfe97,_0x1c58e2){return client[_0xb46c('0xb')](_0x4603b8,_0x2771fe)[_0xb46c('0xc')](function(_0x19a47e){logger[_0xb46c('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2e138d,'request\x20sent');logger['debug'](_0xb46c('0xe'),_0x2e138d,_0xb46c('0xf'),JSON[_0xb46c('0x10')](_0x19a47e));if(_0x19a47e[_0xb46c('0x11')]){if(_0x19a47e[_0xb46c('0x11')][_0xb46c('0x12')]===0x1f4){logger['error'](_0xb46c('0x13'),_0x2e138d,_0x19a47e['error'][_0xb46c('0x14')]);return _0x1c58e2(_0x19a47e[_0xb46c('0x11')]['message']);}logger[_0xb46c('0x11')](_0xb46c('0x13'),_0x2e138d,_0x19a47e[_0xb46c('0x11')]['message']);return _0x5dfe97(_0x19a47e[_0xb46c('0x11')][_0xb46c('0x14')]);}else{logger['info'](_0xb46c('0x13'),_0x2e138d,_0xb46c('0xf'));_0x5dfe97(_0x19a47e[_0xb46c('0x15')][_0xb46c('0x14')]);}})[_0xb46c('0x16')](function(_0x41f6b4){logger[_0xb46c('0x11')](_0xb46c('0x13'),_0x2e138d,_0x41f6b4);_0x1c58e2(_0x41f6b4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f222e09..1e4ce83 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 _0x5941=['%s-%s%s','extname','now','post','file','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','server/files/sounds/original/','originalname','replace','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5941,0x149));var _0x1594=function(_0xe757b4,_0x327087){_0xe757b4=_0xe757b4-0x0;var _0x691b8c=_0x5941[_0xe757b4];return _0x691b8c;};'use strict';var multer=require(_0x1594('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1594('0x1'));var express=require(_0x1594('0x2'));var router=express['Router']();var fs_extra=require(_0x1594('0x3'));var auth=require(_0x1594('0x4'));var interaction=require(_0x1594('0x5'));var config=require(_0x1594('0x6'));var controller=require(_0x1594('0x7'));router[_0x1594('0x8')]('/',auth[_0x1594('0x9')](),controller[_0x1594('0xa')]);router['get'](_0x1594('0xb'),auth[_0x1594('0x9')](),controller[_0x1594('0xc')]);router[_0x1594('0x8')]('/:id/download',auth[_0x1594('0x9')](),controller[_0x1594('0xd')]);var upload=multer({'storage':multer[_0x1594('0xe')]({'destination':function(_0xf1e82a,_0x412682,_0x412631){_0x412631(null,path['join'](config['root'],_0x1594('0xf')));},'filename':function(_0x2c6755,_0x23db50,_0x4347d1){_0x23db50[_0x1594('0x10')]=_0x23db50['originalname'][_0x1594('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4347d1(null,util[_0x1594('0x12')](_0x1594('0x13'),path['basename'](_0x23db50[_0x1594('0x10')],path[_0x1594('0x14')](_0x23db50[_0x1594('0x10')])),Date[_0x1594('0x15')](),path['extname'](_0x23db50[_0x1594('0x10')])));}})});router[_0x1594('0x16')]('/',upload['single'](_0x1594('0x17')),controller[_0x1594('0x18')]);router[_0x1594('0x19')](_0x1594('0xb'),auth[_0x1594('0x9')](),controller[_0x1594('0x1a')]);router[_0x1594('0x1b')](_0x1594('0xb'),auth['isAuthenticated'](),controller[_0x1594('0x1b')]);module[_0x1594('0x1c')]=router; \ No newline at end of file +var _0xe239=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','extname','single','file','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x13bdb8,_0x288e1d){var _0x1c5ad5=function(_0x40af78){while(--_0x40af78){_0x13bdb8['push'](_0x13bdb8['shift']());}};_0x1c5ad5(++_0x288e1d);}(_0xe239,0x145));var _0x9e23=function(_0x3d6d87,_0x93d79){_0x3d6d87=_0x3d6d87-0x0;var _0x26ac8a=_0xe239[_0x3d6d87];return _0x26ac8a;};'use strict';var multer=require(_0x9e23('0x0'));var util=require('util');var path=require(_0x9e23('0x1'));var timeout=require(_0x9e23('0x2'));var express=require(_0x9e23('0x3'));var router=express[_0x9e23('0x4')]();var fs_extra=require(_0x9e23('0x5'));var auth=require(_0x9e23('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e23('0x7'));var controller=require(_0x9e23('0x8'));router[_0x9e23('0x9')]('/',auth[_0x9e23('0xa')](),controller[_0x9e23('0xb')]);router[_0x9e23('0x9')](_0x9e23('0xc'),auth[_0x9e23('0xa')](),controller[_0x9e23('0xd')]);router[_0x9e23('0x9')](_0x9e23('0xe'),auth['isAuthenticated'](),controller[_0x9e23('0xf')]);var upload=multer({'storage':multer[_0x9e23('0x10')]({'destination':function(_0x1fe64b,_0x4b8465,_0x5ac607){_0x5ac607(null,path[_0x9e23('0x11')](config[_0x9e23('0x12')],_0x9e23('0x13')));},'filename':function(_0x2938d5,_0x9e2e0a,_0x276d6a){_0x9e2e0a[_0x9e23('0x14')]=_0x9e2e0a[_0x9e23('0x14')][_0x9e23('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x276d6a(null,util[_0x9e23('0x16')](_0x9e23('0x17'),path[_0x9e23('0x18')](_0x9e2e0a[_0x9e23('0x14')],path['extname'](_0x9e2e0a[_0x9e23('0x14')])),Date[_0x9e23('0x19')](),path[_0x9e23('0x1a')](_0x9e2e0a[_0x9e23('0x14')])));}})});router['post']('/',upload[_0x9e23('0x1b')](_0x9e23('0x1c')),controller[_0x9e23('0x1d')]);router[_0x9e23('0x1e')](_0x9e23('0xc'),auth['isAuthenticated'](),controller[_0x9e23('0x1f')]);router[_0x9e23('0x20')](_0x9e23('0xc'),auth[_0x9e23('0xa')](),controller[_0x9e23('0x20')]);module[_0x9e23('0x21')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3aa8d98..0a8cd79 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 _0x893f=['name','STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x3c0de2,_0x58056f){var _0x3c2f31=function(_0x30469d){while(--_0x30469d){_0x3c0de2['push'](_0x3c0de2['shift']());}};_0x3c2f31(++_0x58056f);}(_0x893f,0x173));var _0xf893=function(_0xcd0c0b,_0x134809){_0xcd0c0b=_0xcd0c0b-0x0;var _0x2e2123=_0x893f[_0xcd0c0b];return _0x2e2123;};'use strict';var Sequelize=require('sequelize');module[_0xf893('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf893('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf893('0x2')]},'display_name':{'type':Sequelize[_0xf893('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf893('0x2')]},'original_format':{'type':Sequelize[_0xf893('0x2')]},'original_duration':{'type':Sequelize[_0xf893('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf893('0x4')]},'original_bitRate':{'type':Sequelize[_0xf893('0x5')]},'original_sampleRate':{'type':Sequelize[_0xf893('0x4')]},'converted_format':{'type':Sequelize[_0xf893('0x2')]},'converted_duration':{'type':Sequelize[_0xf893('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xf893('0x5')]},'converted_channelCount':{'type':Sequelize[_0xf893('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf893('0x4')]}}; \ No newline at end of file +var _0xb310=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x197c1e,_0x507a50){var _0x207bec=function(_0x560a19){while(--_0x560a19){_0x197c1e['push'](_0x197c1e['shift']());}};_0x207bec(++_0x507a50);}(_0xb310,0x1bf));var _0x0b31=function(_0x15b0dd,_0x2778ca){_0x15b0dd=_0x15b0dd-0x0;var _0x74ee95=_0xb310[_0x15b0dd];return _0x74ee95;};'use strict';var Sequelize=require(_0x0b31('0x0'));module[_0x0b31('0x1')]={'name':{'type':Sequelize[_0x0b31('0x2')],'unique':_0x0b31('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0b31('0x2')]},'display_name':{'type':Sequelize[_0x0b31('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0b31('0x2')]},'original_format':{'type':Sequelize[_0x0b31('0x2')]},'original_duration':{'type':Sequelize[_0x0b31('0x4')]},'original_sampleCount':{'type':Sequelize[_0x0b31('0x5')]},'original_channelCount':{'type':Sequelize[_0x0b31('0x6')]},'original_bitRate':{'type':Sequelize[_0x0b31('0x5')]},'original_sampleRate':{'type':Sequelize[_0x0b31('0x6')]},'converted_format':{'type':Sequelize[_0x0b31('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0b31('0x5')]},'converted_channelCount':{'type':Sequelize[_0x0b31('0x6')]},'converted_bitRate':{'type':Sequelize[_0x0b31('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x0b31('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7f74d3b..e6f712a 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 _0x22ae=['order','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','includeAll','include','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','download','format','%s.%s','originalname','extname','file','basename','filename','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','user','UserProfileSection','userProfileId','autoAssociation','start','description','server/files/sounds/original','original_format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x22ae,0x135));var _0xe22a=function(_0x11a45,_0x1e40c3){_0x11a45=_0x11a45-0x0;var _0x48d1e6=_0x22ae[_0x11a45];return _0x48d1e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe22a('0x0'));var zipdir=require(_0xe22a('0x1'));var jsonpatch=require(_0xe22a('0x2'));var rp=require(_0xe22a('0x3'));var moment=require('moment');var BPromise=require(_0xe22a('0x4'));var Mustache=require(_0xe22a('0x5'));var util=require('util');var path=require(_0xe22a('0x6'));var sox=require('sox');var csv=require(_0xe22a('0x7'));var ejs=require(_0xe22a('0x8'));var fs=require('fs');var fs_extra=require(_0xe22a('0x9'));var _=require(_0xe22a('0xa'));var squel=require(_0xe22a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe22a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe22a('0xd'));var Papa=require(_0xe22a('0xe'));var Redis=require(_0xe22a('0xf'));var authService=require(_0xe22a('0x10'));var qs=require(_0xe22a('0x11'));var as=require(_0xe22a('0x12'));var hardwareService=require(_0xe22a('0x13'));var logger=require(_0xe22a('0x14'))(_0xe22a('0x15'));var utils=require('../../config/utils');var config=require(_0xe22a('0x16'));var licenseUtil=require(_0xe22a('0x17'));var db=require(_0xe22a('0x18'))['db'];function respondWithStatusCode(_0x633f51,_0x559401){_0x559401=_0x559401||0xcc;return function(_0x15945d){if(_0x15945d){return _0x633f51[_0xe22a('0x19')](_0x559401);}return _0x633f51['status'](_0x559401)[_0xe22a('0x1a')]();};}function respondWithResult(_0xdebcbf,_0x339393){_0x339393=_0x339393||0xc8;return function(_0x161b8d){if(_0x161b8d){return _0xdebcbf[_0xe22a('0x1b')](_0x339393)['json'](_0x161b8d);}};}function respondWithFilteredResult(_0x223979,_0x2492a2){return function(_0x3359bf){if(_0x3359bf){var _0x1b8373=typeof _0x2492a2[_0xe22a('0x1c')]==='undefined'&&typeof _0x2492a2[_0xe22a('0x1d')]===_0xe22a('0x1e');var _0xdcd434=_0x3359bf[_0xe22a('0x1f')];var _0x1f106a=_0x1b8373?0x0:_0x2492a2[_0xe22a('0x1c')];var _0x1cbf63=_0x1b8373?_0x3359bf[_0xe22a('0x1f')]:_0x2492a2['offset']+_0x2492a2[_0xe22a('0x1d')];var _0x439c05;if(_0x1cbf63>=_0xdcd434){_0x1cbf63=_0xdcd434;_0x439c05=0xc8;}else{_0x439c05=0xce;}_0x223979[_0xe22a('0x1b')](_0x439c05);return _0x223979[_0xe22a('0x20')](_0xe22a('0x21'),_0x1f106a+'-'+_0x1cbf63+'/'+_0xdcd434)['json'](_0x3359bf);}return null;};}function patchUpdates(_0xb352f2){return function(_0x400833){try{jsonpatch[_0xe22a('0x22')](_0x400833,_0xb352f2,!![]);}catch(_0x23de54){return BPromise[_0xe22a('0x23')](_0x23de54);}return _0x400833['save']();};}function saveUpdates(_0x1a8751,_0x38659d){return function(_0x264906){if(_0x264906){return _0x264906[_0xe22a('0x24')](_0x1a8751)[_0xe22a('0x25')](function(_0x248cce){return _0x248cce;});}return null;};}function removeEntity(_0x2553c4,_0xad1097){return function(_0x866db5){if(_0x866db5){return _0x866db5['destroy']()[_0xe22a('0x25')](function(){var _0x5096fe=_0x866db5[_0xe22a('0x26')]({'plain':!![]});var _0x2a55e9='Sounds';return db[_0xe22a('0x27')][_0xe22a('0x28')]({'where':{'type':_0x2a55e9,'resourceId':_0x5096fe['id']}})[_0xe22a('0x25')](function(){return _0x866db5;});})[_0xe22a('0x25')](function(){_0x2553c4[_0xe22a('0x1b')](0xcc)[_0xe22a('0x1a')]();});}};}function handleEntityNotFound(_0x2b4745,_0x14f9f1){return function(_0x409d6a){if(!_0x409d6a){_0x2b4745[_0xe22a('0x19')](0x194);}return _0x409d6a;};}function handleError(_0x353127,_0x44bd57){_0x44bd57=_0x44bd57||0x1f4;return function(_0x4c40bf){logger[_0xe22a('0x29')](_0x4c40bf[_0xe22a('0x2a')]);if(_0x4c40bf[_0xe22a('0x2b')]){delete _0x4c40bf[_0xe22a('0x2b')];}_0x353127[_0xe22a('0x1b')](_0x44bd57)[_0xe22a('0x2c')](_0x4c40bf);};}exports[_0xe22a('0x2d')]=function(_0x40402b,_0x57c654){var _0x5e2716={},_0x337f8e={},_0x504afd={'count':0x0,'rows':[]};var _0x2032f1=_[_0xe22a('0x2e')](db[_0xe22a('0x2f')][_0xe22a('0x30')],function(_0x525099){return{'name':_0x525099[_0xe22a('0x31')],'type':_0x525099[_0xe22a('0x32')][_0xe22a('0x33')]};});_0x337f8e[_0xe22a('0x34')]=_['map'](_0x2032f1,_0xe22a('0x2b'));_0x337f8e[_0xe22a('0x35')]=_['keys'](_0x40402b[_0xe22a('0x35')]);_0x337f8e[_0xe22a('0x36')]=_[_0xe22a('0x37')](_0x337f8e[_0xe22a('0x34')],_0x337f8e['query']);_0x5e2716['attributes']=_[_0xe22a('0x37')](_0x337f8e[_0xe22a('0x34')],qs[_0xe22a('0x38')](_0x40402b[_0xe22a('0x35')][_0xe22a('0x38')]));_0x5e2716[_0xe22a('0x39')]=_0x5e2716[_0xe22a('0x39')][_0xe22a('0x3a')]?_0x5e2716[_0xe22a('0x39')]:_0x337f8e[_0xe22a('0x34')];if(!_0x40402b['query']['hasOwnProperty'](_0xe22a('0x3b'))){_0x5e2716[_0xe22a('0x1d')]=qs[_0xe22a('0x1d')](_0x40402b[_0xe22a('0x35')][_0xe22a('0x1d')]);_0x5e2716[_0xe22a('0x1c')]=qs['offset'](_0x40402b[_0xe22a('0x35')][_0xe22a('0x1c')]);}_0x5e2716[_0xe22a('0x3c')]=qs['sort'](_0x40402b[_0xe22a('0x35')][_0xe22a('0x3d')]);_0x5e2716[_0xe22a('0x3e')]=qs[_0xe22a('0x36')](_[_0xe22a('0x3f')](_0x40402b[_0xe22a('0x35')],_0x337f8e[_0xe22a('0x36')]),_0x2032f1);if(_0x40402b[_0xe22a('0x35')][_0xe22a('0x40')]){_0x5e2716['where']=_['merge'](_0x5e2716['where'],{'$or':_[_0xe22a('0x2e')](_0x2032f1,function(_0xaa17f0){if(_0xaa17f0[_0xe22a('0x32')]!==_0xe22a('0x41')){var _0x4409f3={};_0x4409f3[_0xaa17f0[_0xe22a('0x2b')]]={'$like':'%'+_0x40402b[_0xe22a('0x35')][_0xe22a('0x40')]+'%'};return _0x4409f3;}})});}_0x5e2716=_[_0xe22a('0x42')]({},_0x5e2716,_0x40402b[_0xe22a('0x43')]);var _0x294275={'where':_0x5e2716[_0xe22a('0x3e')]};return db[_0xe22a('0x2f')]['count'](_0x294275)[_0xe22a('0x25')](function(_0x264776){_0x504afd[_0xe22a('0x1f')]=_0x264776;if(_0x40402b[_0xe22a('0x35')]['includeAll']){_0x5e2716['include']=[{'all':!![]}];}return db[_0xe22a('0x2f')]['findAll'](_0x5e2716);})['then'](function(_0x3de93b){_0x504afd[_0xe22a('0x44')]=_0x3de93b;return _0x504afd;})[_0xe22a('0x25')](respondWithFilteredResult(_0x57c654,_0x5e2716))[_0xe22a('0x45')](handleError(_0x57c654,null));};exports[_0xe22a('0x46')]=function(_0x44bcc3,_0x249352){var _0x4bea3a={'raw':!![],'where':{'id':_0x44bcc3[_0xe22a('0x47')]['id']}},_0x3240a5={};_0x3240a5[_0xe22a('0x34')]=_['keys'](db[_0xe22a('0x2f')][_0xe22a('0x30')]);_0x3240a5['query']=_['keys'](_0x44bcc3[_0xe22a('0x35')]);_0x3240a5[_0xe22a('0x36')]=_[_0xe22a('0x37')](_0x3240a5[_0xe22a('0x34')],_0x3240a5[_0xe22a('0x35')]);_0x4bea3a[_0xe22a('0x39')]=_[_0xe22a('0x37')](_0x3240a5[_0xe22a('0x34')],qs[_0xe22a('0x38')](_0x44bcc3[_0xe22a('0x35')][_0xe22a('0x38')]));_0x4bea3a[_0xe22a('0x39')]=_0x4bea3a[_0xe22a('0x39')]['length']?_0x4bea3a[_0xe22a('0x39')]:_0x3240a5[_0xe22a('0x34')];if(_0x44bcc3['query'][_0xe22a('0x48')]){_0x4bea3a[_0xe22a('0x49')]=[{'all':!![]}];}_0x4bea3a=_[_0xe22a('0x42')]({},_0x4bea3a,_0x44bcc3[_0xe22a('0x43')]);return db['Sound'][_0xe22a('0x4a')](_0x4bea3a)[_0xe22a('0x25')](handleEntityNotFound(_0x249352,null))[_0xe22a('0x25')](respondWithResult(_0x249352,null))[_0xe22a('0x45')](handleError(_0x249352,null));};exports['download']=function(_0x439bab,_0x496695,_0x5cf127){return db[_0xe22a('0x2f')][_0xe22a('0x4a')]({'where':{'id':_0x439bab[_0xe22a('0x47')]['id']},'attributes':['name',_0xe22a('0x4b'),_0xe22a('0x4c')],'raw':!![]})[_0xe22a('0x25')](handleEntityNotFound(_0x496695,null))[_0xe22a('0x25')](function(_0x3cc69e){if(_0x3cc69e){if(!fs[_0xe22a('0x4d')](path[_0xe22a('0x4e')](config[_0xe22a('0x4f')],_0xe22a('0x50'),_0x3cc69e[_0xe22a('0x4b')]+'.'+_0x3cc69e[_0xe22a('0x4c')]))){throw new db[(_0xe22a('0x51'))]['ValidationError'](_0xe22a('0x52'));}return _0x496695[_0xe22a('0x53')](path[_0xe22a('0x4e')](config[_0xe22a('0x4f')],_0xe22a('0x50'),util[_0xe22a('0x54')](_0xe22a('0x55'),_0x3cc69e[_0xe22a('0x4b')],_0x3cc69e[_0xe22a('0x4c')])),util[_0xe22a('0x54')](_0xe22a('0x55'),_0x3cc69e[_0xe22a('0x2b')],_0x3cc69e['converted_format']));}return null;})[_0xe22a('0x45')](handleError(_0x496695,null));};exports['create']=function(_0x16da90,_0x37adfb,_0x120173){var _0x592c38={'name':path['basename'](_0x16da90['file'][_0xe22a('0x56')],path[_0xe22a('0x57')](_0x16da90[_0xe22a('0x58')][_0xe22a('0x56')])),'save_name':path[_0xe22a('0x59')](_0x16da90[_0xe22a('0x58')]['filename'],path[_0xe22a('0x57')](_0x16da90['file'][_0xe22a('0x5a')])),'original_format':path['extname'](_0x16da90[_0xe22a('0x58')][_0xe22a('0x56')])[_0xe22a('0x5b')](0x1),'converted_format':'wav'};var _0x398b71=path[_0xe22a('0x4e')](config[_0xe22a('0x4f')],'server/files/sounds/original',_0x16da90[_0xe22a('0x58')][_0xe22a('0x5a')]);var _0x3ebc8d=path[_0xe22a('0x4e')](config['root'],_0xe22a('0x50'),util[_0xe22a('0x54')](_0xe22a('0x55'),path['basename'](_0x16da90[_0xe22a('0x58')]['filename'],path['extname'](_0x16da90['file']['filename'])),_0x592c38[_0xe22a('0x4c')]));logger[_0xe22a('0x5c')](_0xe22a('0x5d'),_0x398b71);logger[_0xe22a('0x5c')](_0xe22a('0x5e'),_0x3ebc8d);try{fs[_0xe22a('0x5f')](_0x398b71,parseInt(_0xe22a('0x60'),0x8));var _0xbd0b6b=sox[_0xe22a('0x61')](_0x398b71,_0x3ebc8d,{'sampleRate':0x1f40,'format':_0xe22a('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbd0b6b['on'](_0xe22a('0x29'),function(_0x2080b0){fs[_0xe22a('0x63')](_0x398b71);_0x37adfb[_0xe22a('0x1b')](0x1f4)['send'](_0x2080b0);});_0xbd0b6b['on']('src',function(_0x40ca17){_0x592c38[_0xe22a('0x64')]=isNaN(_0x40ca17['duration'])?null:_0x40ca17[_0xe22a('0x65')]*0x3e8;_0x592c38['original_sampleCount']=isNaN(_0x40ca17[_0xe22a('0x66')])?null:_0x40ca17[_0xe22a('0x66')];_0x592c38['original_channelCount']=isNaN(_0x40ca17[_0xe22a('0x67')])?null:_0x40ca17[_0xe22a('0x67')];_0x592c38[_0xe22a('0x68')]=isNaN(_0x40ca17[_0xe22a('0x69')])?null:_0x40ca17['bitRate'];_0x592c38[_0xe22a('0x6a')]=isNaN(_0x40ca17[_0xe22a('0x6b')])?null:_0x40ca17[_0xe22a('0x6b')];});_0xbd0b6b['on'](_0xe22a('0x6c'),function(_0x36c28b){_0x592c38[_0xe22a('0x6d')]=isNaN(_0x36c28b['duration'])?null:_0x36c28b[_0xe22a('0x65')]*0x3e8;_0x592c38['converted_sampleCount']=isNaN(_0x36c28b[_0xe22a('0x66')])?null:_0x36c28b[_0xe22a('0x66')];_0x592c38[_0xe22a('0x6e')]=isNaN(_0x36c28b[_0xe22a('0x67')])?null:_0x36c28b[_0xe22a('0x67')];_0x592c38[_0xe22a('0x6f')]=isNaN(_0x36c28b[_0xe22a('0x69')])?null:_0x36c28b[_0xe22a('0x69')];_0x592c38[_0xe22a('0x70')]=isNaN(_0x36c28b[_0xe22a('0x6b')])?null:_0x36c28b[_0xe22a('0x6b')];});_0xbd0b6b['on'](_0xe22a('0x1a'),function(){fs['chmodSync'](_0x3ebc8d,parseInt(_0xe22a('0x60'),0x8));return db['Sound'][_0xe22a('0x71')](_0x592c38)['then'](function(_0x1efb1f){var _0xbf30={'role':_0x16da90[_0xe22a('0x72')]['role'],'userProfileId':_0x16da90['body']['userProfileId']};if(!_0xbf30)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbf30['role']===_0xe22a('0x73')){var _0x1d4994=_0x1efb1f[_0xe22a('0x26')]({'plain':!![]});return db[_0xe22a('0x74')][_0xe22a('0x4a')]({'where':{'name':'Sounds','userProfileId':_0xbf30[_0xe22a('0x75')]},'raw':!![]})['then'](function(_0x3c2eea){if(_0x3c2eea&&_0x3c2eea[_0xe22a('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d4994[_0xe22a('0x2b')],'resourceId':_0x1d4994['id'],'type':_0x3c2eea['name'],'sectionId':_0x3c2eea['id']},{})[_0xe22a('0x25')](function(){return _0x1efb1f;});}else{return _0x1efb1f;}})[_0xe22a('0x45')](function(_0x5c9414){logger[_0xe22a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c9414);throw _0x5c9414;});}return _0x1efb1f;})[_0xe22a('0x25')](respondWithResult(_0x37adfb,null))['catch'](handleError(_0x37adfb,null));});_0xbd0b6b[_0xe22a('0x77')]();}catch(_0x15c22e){_0x37adfb[_0xe22a('0x1b')](0x1f4)['send'](_0x15c22e);}};exports[_0xe22a('0x24')]=function(_0x4e278c,_0xc0482c,_0x3115c3){return db[_0xe22a('0x2f')][_0xe22a('0x4a')]({'where':{'id':_0x4e278c[_0xe22a('0x47')]['id']}})['then'](handleEntityNotFound(_0xc0482c,null))[_0xe22a('0x25')](saveUpdates(_[_0xe22a('0x3f')](_0x4e278c[_0xe22a('0x72')],[_0xe22a('0x2b'),_0xe22a('0x78')]),null))['then'](respondWithResult(_0xc0482c,null))[_0xe22a('0x45')](handleError(_0xc0482c,null));};exports['delete']=function(_0x33d855,_0x4219fa,_0x4407b8){return db[_0xe22a('0x2f')][_0xe22a('0x4a')]({'where':{'id':_0x33d855[_0xe22a('0x47')]['id']}})['then'](function(_0x27c0d9){if(_0x27c0d9){return _0x27c0d9[_0xe22a('0x28')]();}})[_0xe22a('0x25')](function(_0x1045b3){var _0x17cbf0=path[_0xe22a('0x4e')](config[_0xe22a('0x4f')],_0xe22a('0x79'),util['format']('%s.%s',_0x1045b3['save_name'],_0x1045b3[_0xe22a('0x7a')]));var _0x5db18c=path['join'](config['root'],_0xe22a('0x50'),util['format']('%s.%s',_0x1045b3[_0xe22a('0x4b')],_0x1045b3[_0xe22a('0x4c')]));fs[_0xe22a('0x63')](_0x17cbf0);fs['unlinkSync'](_0x5db18c);return _0x1045b3;})[_0xe22a('0x25')](function(_0x3670ce){if(_0x3670ce){return _0x4219fa[_0xe22a('0x1b')](0xcc)[_0xe22a('0x1a')]();}})[_0xe22a('0x25')](handleEntityNotFound(_0x4219fa,null))[_0xe22a('0x45')](handleError(_0x4219fa,null));}; \ No newline at end of file +var _0x6390=['request-promise','bluebird','util','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','Sounds','destroy','name','send','index','Sound','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','params','save_name','converted_format','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','basename','file','originalname','filename','extname','wav','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x6390,0x171));var _0x0639=function(_0x17f122,_0xbc796f){_0x17f122=_0x17f122-0x0;var _0x431bd8=_0x6390[_0x17f122];return _0x431bd8;};'use strict';var emlformat=require(_0x0639('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0639('0x1'));var jsonpatch=require(_0x0639('0x2'));var rp=require(_0x0639('0x3'));var moment=require('moment');var BPromise=require(_0x0639('0x4'));var Mustache=require('mustache');var util=require(_0x0639('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0639('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0639('0x7'));var squel=require('squel');var crypto=require(_0x0639('0x8'));var jsforce=require(_0x0639('0x9'));var deskjs=require(_0x0639('0xa'));var toCsv=require(_0x0639('0xb'));var querystring=require(_0x0639('0xc'));var Papa=require(_0x0639('0xd'));var Redis=require('ioredis');var authService=require(_0x0639('0xe'));var qs=require(_0x0639('0xf'));var as=require(_0x0639('0x10'));var hardwareService=require(_0x0639('0x11'));var logger=require(_0x0639('0x12'))(_0x0639('0x13'));var utils=require('../../config/utils');var config=require(_0x0639('0x14'));var licenseUtil=require(_0x0639('0x15'));var db=require(_0x0639('0x16'))['db'];function respondWithStatusCode(_0x46590b,_0x10b1b9){_0x10b1b9=_0x10b1b9||0xcc;return function(_0x176318){if(_0x176318){return _0x46590b[_0x0639('0x17')](_0x10b1b9);}return _0x46590b['status'](_0x10b1b9)[_0x0639('0x18')]();};}function respondWithResult(_0x2b73b3,_0xedf765){_0xedf765=_0xedf765||0xc8;return function(_0x3779c5){if(_0x3779c5){return _0x2b73b3[_0x0639('0x19')](_0xedf765)[_0x0639('0x1a')](_0x3779c5);}};}function respondWithFilteredResult(_0x22d6be,_0x46a973){return function(_0x2264ef){if(_0x2264ef){var _0x3cf374=typeof _0x46a973[_0x0639('0x1b')]==='undefined'&&typeof _0x46a973[_0x0639('0x1c')]===_0x0639('0x1d');var _0x348047=_0x2264ef[_0x0639('0x1e')];var _0x1ddeb8=_0x3cf374?0x0:_0x46a973['offset'];var _0x429b39=_0x3cf374?_0x2264ef['count']:_0x46a973['offset']+_0x46a973['limit'];var _0x20cc8b;if(_0x429b39>=_0x348047){_0x429b39=_0x348047;_0x20cc8b=0xc8;}else{_0x20cc8b=0xce;}_0x22d6be[_0x0639('0x19')](_0x20cc8b);return _0x22d6be[_0x0639('0x1f')](_0x0639('0x20'),_0x1ddeb8+'-'+_0x429b39+'/'+_0x348047)[_0x0639('0x1a')](_0x2264ef);}return null;};}function patchUpdates(_0x52bfaf){return function(_0x3b652b){try{jsonpatch[_0x0639('0x21')](_0x3b652b,_0x52bfaf,!![]);}catch(_0x27eb0b){return BPromise['reject'](_0x27eb0b);}return _0x3b652b[_0x0639('0x22')]();};}function saveUpdates(_0x381c91,_0x4b27a2){return function(_0x58d4f7){if(_0x58d4f7){return _0x58d4f7['update'](_0x381c91)[_0x0639('0x23')](function(_0x4c6330){return _0x4c6330;});}return null;};}function removeEntity(_0x565a39,_0x5402cd){return function(_0x29fabb){if(_0x29fabb){return _0x29fabb['destroy']()[_0x0639('0x23')](function(){var _0x30d2e2=_0x29fabb['get']({'plain':!![]});var _0x5e17a5=_0x0639('0x24');return db['UserProfileResource'][_0x0639('0x25')]({'where':{'type':_0x5e17a5,'resourceId':_0x30d2e2['id']}})[_0x0639('0x23')](function(){return _0x29fabb;});})['then'](function(){_0x565a39[_0x0639('0x19')](0xcc)[_0x0639('0x18')]();});}};}function handleEntityNotFound(_0x4c6bc9,_0x35411b){return function(_0x31e5de){if(!_0x31e5de){_0x4c6bc9[_0x0639('0x17')](0x194);}return _0x31e5de;};}function handleError(_0x42de8b,_0x19a89d){_0x19a89d=_0x19a89d||0x1f4;return function(_0x234944){logger['error'](_0x234944['stack']);if(_0x234944[_0x0639('0x26')]){delete _0x234944['name'];}_0x42de8b['status'](_0x19a89d)[_0x0639('0x27')](_0x234944);};}exports[_0x0639('0x28')]=function(_0x317283,_0xadef48){var _0x169b8a={},_0x14d84c={},_0x28fdea={'count':0x0,'rows':[]};var _0x525799=_['map'](db[_0x0639('0x29')][_0x0639('0x2a')],function(_0x3e0b62){return{'name':_0x3e0b62[_0x0639('0x2b')],'type':_0x3e0b62[_0x0639('0x2c')]['key']};});_0x14d84c[_0x0639('0x2d')]=_[_0x0639('0x2e')](_0x525799,_0x0639('0x26'));_0x14d84c[_0x0639('0x2f')]=_[_0x0639('0x30')](_0x317283['query']);_0x14d84c[_0x0639('0x31')]=_['intersection'](_0x14d84c[_0x0639('0x2d')],_0x14d84c['query']);_0x169b8a[_0x0639('0x32')]=_[_0x0639('0x33')](_0x14d84c[_0x0639('0x2d')],qs[_0x0639('0x34')](_0x317283[_0x0639('0x2f')][_0x0639('0x34')]));_0x169b8a['attributes']=_0x169b8a[_0x0639('0x32')][_0x0639('0x35')]?_0x169b8a[_0x0639('0x32')]:_0x14d84c[_0x0639('0x2d')];if(!_0x317283[_0x0639('0x2f')][_0x0639('0x36')]('nolimit')){_0x169b8a[_0x0639('0x1c')]=qs[_0x0639('0x1c')](_0x317283[_0x0639('0x2f')]['limit']);_0x169b8a[_0x0639('0x1b')]=qs[_0x0639('0x1b')](_0x317283[_0x0639('0x2f')][_0x0639('0x1b')]);}_0x169b8a[_0x0639('0x37')]=qs[_0x0639('0x38')](_0x317283[_0x0639('0x2f')][_0x0639('0x38')]);_0x169b8a[_0x0639('0x39')]=qs[_0x0639('0x31')](_['pick'](_0x317283[_0x0639('0x2f')],_0x14d84c[_0x0639('0x31')]),_0x525799);if(_0x317283[_0x0639('0x2f')][_0x0639('0x3a')]){_0x169b8a[_0x0639('0x39')]=_[_0x0639('0x3b')](_0x169b8a[_0x0639('0x39')],{'$or':_[_0x0639('0x2e')](_0x525799,function(_0x41bfab){if(_0x41bfab['type']!==_0x0639('0x3c')){var _0x3061ff={};_0x3061ff[_0x41bfab[_0x0639('0x26')]]={'$like':'%'+_0x317283['query'][_0x0639('0x3a')]+'%'};return _0x3061ff;}})});}_0x169b8a=_['merge']({},_0x169b8a,_0x317283[_0x0639('0x3d')]);var _0x32c745={'where':_0x169b8a[_0x0639('0x39')]};return db['Sound']['count'](_0x32c745)[_0x0639('0x23')](function(_0x5830e4){_0x28fdea['count']=_0x5830e4;if(_0x317283[_0x0639('0x2f')][_0x0639('0x3e')]){_0x169b8a['include']=[{'all':!![]}];}return db[_0x0639('0x29')][_0x0639('0x3f')](_0x169b8a);})[_0x0639('0x23')](function(_0x590f6d){_0x28fdea[_0x0639('0x40')]=_0x590f6d;return _0x28fdea;})[_0x0639('0x23')](respondWithFilteredResult(_0xadef48,_0x169b8a))[_0x0639('0x41')](handleError(_0xadef48,null));};exports['show']=function(_0x176243,_0x355939){var _0x5eeff2={'raw':!![],'where':{'id':_0x176243['params']['id']}},_0x31e00d={};_0x31e00d[_0x0639('0x2d')]=_[_0x0639('0x30')](db[_0x0639('0x29')][_0x0639('0x2a')]);_0x31e00d[_0x0639('0x2f')]=_[_0x0639('0x30')](_0x176243['query']);_0x31e00d[_0x0639('0x31')]=_[_0x0639('0x33')](_0x31e00d[_0x0639('0x2d')],_0x31e00d[_0x0639('0x2f')]);_0x5eeff2[_0x0639('0x32')]=_[_0x0639('0x33')](_0x31e00d[_0x0639('0x2d')],qs['fields'](_0x176243[_0x0639('0x2f')][_0x0639('0x34')]));_0x5eeff2[_0x0639('0x32')]=_0x5eeff2[_0x0639('0x32')][_0x0639('0x35')]?_0x5eeff2[_0x0639('0x32')]:_0x31e00d[_0x0639('0x2d')];if(_0x176243['query'][_0x0639('0x3e')]){_0x5eeff2[_0x0639('0x42')]=[{'all':!![]}];}_0x5eeff2=_['merge']({},_0x5eeff2,_0x176243['options']);return db[_0x0639('0x29')][_0x0639('0x43')](_0x5eeff2)['then'](handleEntityNotFound(_0x355939,null))['then'](respondWithResult(_0x355939,null))[_0x0639('0x41')](handleError(_0x355939,null));};exports['download']=function(_0x47659e,_0xc77383,_0x344126){return db[_0x0639('0x29')]['find']({'where':{'id':_0x47659e[_0x0639('0x44')]['id']},'attributes':[_0x0639('0x26'),_0x0639('0x45'),_0x0639('0x46')],'raw':!![]})[_0x0639('0x23')](handleEntityNotFound(_0xc77383,null))[_0x0639('0x23')](function(_0xf35dd9){if(_0xf35dd9){if(!fs['existsSync'](path[_0x0639('0x47')](config['root'],_0x0639('0x48'),_0xf35dd9[_0x0639('0x45')]+'.'+_0xf35dd9[_0x0639('0x46')]))){throw new db['Sequelize'][(_0x0639('0x49'))](_0x0639('0x4a'));}return _0xc77383[_0x0639('0x4b')](path[_0x0639('0x47')](config[_0x0639('0x4c')],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),_0xf35dd9[_0x0639('0x45')],_0xf35dd9[_0x0639('0x46')])),util[_0x0639('0x4d')](_0x0639('0x4e'),_0xf35dd9[_0x0639('0x26')],_0xf35dd9[_0x0639('0x46')]));}return null;})[_0x0639('0x41')](handleError(_0xc77383,null));};exports[_0x0639('0x4f')]=function(_0x4c54b4,_0x367e8f,_0x499af8){var _0x4de965={'name':path[_0x0639('0x50')](_0x4c54b4[_0x0639('0x51')]['originalname'],path['extname'](_0x4c54b4[_0x0639('0x51')][_0x0639('0x52')])),'save_name':path['basename'](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')],path[_0x0639('0x54')](_0x4c54b4['file'][_0x0639('0x53')])),'original_format':path['extname'](_0x4c54b4['file']['originalname'])['substring'](0x1),'converted_format':_0x0639('0x55')};var _0x39a7c7=path[_0x0639('0x47')](config[_0x0639('0x4c')],'server/files/sounds/original',_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')]);var _0x301623=path[_0x0639('0x47')](config[_0x0639('0x4c')],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),path[_0x0639('0x50')](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')],path[_0x0639('0x54')](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')])),_0x4de965[_0x0639('0x46')]));logger['info'](_0x0639('0x56'),_0x39a7c7);logger[_0x0639('0x57')](_0x0639('0x58'),_0x301623);try{fs[_0x0639('0x59')](_0x39a7c7,parseInt(_0x0639('0x5a'),0x8));var _0x67a5ce=sox[_0x0639('0x5b')](_0x39a7c7,_0x301623,{'sampleRate':0x1f40,'format':_0x0639('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x67a5ce['on'](_0x0639('0x5c'),function(_0x1eade7){fs[_0x0639('0x5d')](_0x39a7c7);_0x367e8f[_0x0639('0x19')](0x1f4)[_0x0639('0x27')](_0x1eade7);});_0x67a5ce['on'](_0x0639('0x5e'),function(_0x41f67e){_0x4de965[_0x0639('0x5f')]=isNaN(_0x41f67e[_0x0639('0x60')])?null:_0x41f67e[_0x0639('0x60')]*0x3e8;_0x4de965[_0x0639('0x61')]=isNaN(_0x41f67e[_0x0639('0x62')])?null:_0x41f67e[_0x0639('0x62')];_0x4de965[_0x0639('0x63')]=isNaN(_0x41f67e[_0x0639('0x64')])?null:_0x41f67e[_0x0639('0x64')];_0x4de965[_0x0639('0x65')]=isNaN(_0x41f67e[_0x0639('0x66')])?null:_0x41f67e[_0x0639('0x66')];_0x4de965[_0x0639('0x67')]=isNaN(_0x41f67e[_0x0639('0x68')])?null:_0x41f67e[_0x0639('0x68')];});_0x67a5ce['on'](_0x0639('0x69'),function(_0x1522eb){_0x4de965[_0x0639('0x6a')]=isNaN(_0x1522eb[_0x0639('0x60')])?null:_0x1522eb['duration']*0x3e8;_0x4de965[_0x0639('0x6b')]=isNaN(_0x1522eb[_0x0639('0x62')])?null:_0x1522eb[_0x0639('0x62')];_0x4de965[_0x0639('0x6c')]=isNaN(_0x1522eb[_0x0639('0x64')])?null:_0x1522eb[_0x0639('0x64')];_0x4de965[_0x0639('0x6d')]=isNaN(_0x1522eb[_0x0639('0x66')])?null:_0x1522eb[_0x0639('0x66')];_0x4de965[_0x0639('0x6e')]=isNaN(_0x1522eb[_0x0639('0x68')])?null:_0x1522eb[_0x0639('0x68')];});_0x67a5ce['on']('end',function(){fs[_0x0639('0x59')](_0x301623,parseInt(_0x0639('0x5a'),0x8));return db['Sound'][_0x0639('0x4f')](_0x4de965)[_0x0639('0x23')](function(_0x4230e5){var _0x5dbea1={'role':_0x4c54b4[_0x0639('0x6f')][_0x0639('0x70')],'userProfileId':_0x4c54b4[_0x0639('0x6f')][_0x0639('0x71')]};if(!_0x5dbea1)throw new Error(_0x0639('0x72'));if(_0x5dbea1[_0x0639('0x70')]==='user'){var _0x2c2b7b=_0x4230e5[_0x0639('0x73')]({'plain':!![]});return db['UserProfileSection'][_0x0639('0x43')]({'where':{'name':_0x0639('0x24'),'userProfileId':_0x5dbea1[_0x0639('0x71')]},'raw':!![]})[_0x0639('0x23')](function(_0x4741be){if(_0x4741be&&_0x4741be[_0x0639('0x74')]===0x0){return db[_0x0639('0x75')][_0x0639('0x4f')]({'name':_0x2c2b7b[_0x0639('0x26')],'resourceId':_0x2c2b7b['id'],'type':_0x4741be[_0x0639('0x26')],'sectionId':_0x4741be['id']},{})['then'](function(){return _0x4230e5;});}else{return _0x4230e5;}})[_0x0639('0x41')](function(_0x29544f){logger['error'](_0x0639('0x76'),_0x29544f);throw _0x29544f;});}return _0x4230e5;})[_0x0639('0x23')](respondWithResult(_0x367e8f,null))['catch'](handleError(_0x367e8f,null));});_0x67a5ce['start']();}catch(_0x47f529){_0x367e8f['status'](0x1f4)[_0x0639('0x27')](_0x47f529);}};exports[_0x0639('0x77')]=function(_0x2dc981,_0x3c33d4,_0x18a170){return db[_0x0639('0x29')][_0x0639('0x43')]({'where':{'id':_0x2dc981[_0x0639('0x44')]['id']}})[_0x0639('0x23')](handleEntityNotFound(_0x3c33d4,null))[_0x0639('0x23')](saveUpdates(_[_0x0639('0x78')](_0x2dc981[_0x0639('0x6f')],[_0x0639('0x26'),'description']),null))[_0x0639('0x23')](respondWithResult(_0x3c33d4,null))[_0x0639('0x41')](handleError(_0x3c33d4,null));};exports[_0x0639('0x79')]=function(_0x5e1046,_0x4c303c,_0x1ce20c){return db[_0x0639('0x29')][_0x0639('0x43')]({'where':{'id':_0x5e1046[_0x0639('0x44')]['id']}})[_0x0639('0x23')](function(_0x2b2749){if(_0x2b2749){return _0x2b2749[_0x0639('0x25')]();}})['then'](function(_0x34e43c){var _0x232327=path[_0x0639('0x47')](config['root'],_0x0639('0x7a'),util['format']('%s.%s',_0x34e43c[_0x0639('0x45')],_0x34e43c[_0x0639('0x7b')]));var _0x4c6bb4=path[_0x0639('0x47')](config['root'],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),_0x34e43c[_0x0639('0x45')],_0x34e43c[_0x0639('0x46')]));fs[_0x0639('0x5d')](_0x232327);fs[_0x0639('0x5d')](_0x4c6bb4);return _0x34e43c;})['then'](function(_0x1a3d08){if(_0x1a3d08){return _0x4c303c[_0x0639('0x19')](0xcc)['end']();}})[_0x0639('0x23')](handleEntityNotFound(_0x4c303c,null))[_0x0639('0x41')](handleError(_0x4c303c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index afa195d..c013543 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 _0x8484=['path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','api','bluebird'];(function(_0x24fe03,_0x336b5d){var _0x3a0796=function(_0x43b1bb){while(--_0x43b1bb){_0x24fe03['push'](_0x24fe03['shift']());}};_0x3a0796(++_0x336b5d);}(_0x8484,0x10f));var _0x4848=function(_0x3c7d67,_0x23ebb5){_0x3c7d67=_0x3c7d67-0x0;var _0x18ece1=_0x8484[_0x3c7d67];return _0x18ece1;};'use strict';var _=require(_0x4848('0x0'));var util=require(_0x4848('0x1'));var logger=require('../../config/logger')(_0x4848('0x2'));var moment=require('moment');var BPromise=require(_0x4848('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4848('0x4'));var rimraf=require(_0x4848('0x5'));var config=require(_0x4848('0x6'));var attributes=require(_0x4848('0x7'));module[_0x4848('0x8')]=function(_0xf42cb5,_0x40403e){return _0xf42cb5[_0x4848('0x9')](_0x4848('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x415a=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment'];(function(_0xfe1e45,_0x5d1e81){var _0x57a0f2=function(_0x581c89){while(--_0x581c89){_0xfe1e45['push'](_0xfe1e45['shift']());}};_0x57a0f2(++_0x5d1e81);}(_0x415a,0x19f));var _0xa415=function(_0x774a73,_0x2891fe){_0x774a73=_0x774a73-0x0;var _0x2b4bb1=_0x415a[_0x774a73];return _0x2b4bb1;};'use strict';var _=require(_0xa415('0x0'));var util=require(_0xa415('0x1'));var logger=require(_0xa415('0x2'))(_0xa415('0x3'));var moment=require(_0xa415('0x4'));var BPromise=require(_0xa415('0x5'));var rp=require(_0xa415('0x6'));var fs=require('fs');var path=require(_0xa415('0x7'));var rimraf=require(_0xa415('0x8'));var config=require(_0xa415('0x9'));var attributes=require(_0xa415('0xa'));module['exports']=function(_0x384922,_0x4e0933){return _0x384922[_0xa415('0xb')](_0xa415('0xc'),attributes,{'tableName':_0xa415('0xd'),'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 9383842..5043953 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 _0x2408=['request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info'];(function(_0x3bcb39,_0x2e1bd0){var _0x158bc4=function(_0x5570d3){while(--_0x5570d3){_0x3bcb39['push'](_0x3bcb39['shift']());}};_0x158bc4(++_0x2e1bd0);}(_0x2408,0x10a));var _0x8240=function(_0xb754df,_0x14432a){_0xb754df=_0xb754df-0x0;var _0x165d0c=_0x2408[_0xb754df];return _0x165d0c;};'use strict';var _=require(_0x8240('0x0'));var util=require('util');var moment=require(_0x8240('0x1'));var BPromise=require(_0x8240('0x2'));var rs=require(_0x8240('0x3'));var fs=require('fs');var Redis=require(_0x8240('0x4'));var db=require(_0x8240('0x5'))['db'];var utils=require(_0x8240('0x6'));var logger=require('../../config/logger')(_0x8240('0x7'));var config=require('../../config/environment');var jayson=require(_0x8240('0x8'));var client=jayson[_0x8240('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36542c,_0x229df7,_0x17f513){return new BPromise(function(_0x5f31a9,_0xe33379){return client[_0x8240('0xa')](_0x36542c,_0x17f513)[_0x8240('0xb')](function(_0x113bf0){logger[_0x8240('0xc')]('Sound,\x20%s,\x20%s',_0x229df7,_0x8240('0xd'));logger['debug'](_0x8240('0xe'),_0x229df7,_0x8240('0xd'),JSON[_0x8240('0xf')](_0x113bf0));if(_0x113bf0[_0x8240('0x10')]){if(_0x113bf0[_0x8240('0x10')]['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x229df7,_0x113bf0[_0x8240('0x10')]['message']);return _0xe33379(_0x113bf0[_0x8240('0x10')][_0x8240('0x11')]);}logger[_0x8240('0x10')](_0x8240('0x12'),_0x229df7,_0x113bf0[_0x8240('0x10')][_0x8240('0x11')]);return _0x5f31a9(_0x113bf0['error']['message']);}else{logger[_0x8240('0xc')]('Sound,\x20%s,\x20%s',_0x229df7,'request\x20sent');_0x5f31a9(_0x113bf0[_0x8240('0x13')][_0x8240('0x11')]);}})['catch'](function(_0x260717){logger['error'](_0x8240('0x12'),_0x229df7,_0x260717);_0xe33379(_0x260717);});});}exports[_0x8240('0x14')]=function(_0x5af8a5){var _0x288727=this;return new Promise(function(_0x53be36,_0x22e5c0){return db[_0x8240('0x15')][_0x8240('0x16')]({'raw':_0x5af8a5['options']?_0x5af8a5[_0x8240('0x17')][_0x8240('0x18')]===undefined?!![]:![]:!![],'where':_0x5af8a5[_0x8240('0x17')]?_0x5af8a5['options'][_0x8240('0x19')]||null:null,'attributes':_0x5af8a5[_0x8240('0x17')]?_0x5af8a5[_0x8240('0x17')][_0x8240('0x1a')]||null:null,'include':_0x5af8a5[_0x8240('0x17')]?_0x5af8a5['options'][_0x8240('0x1b')]?_[_0x8240('0x1c')](_0x5af8a5[_0x8240('0x17')]['include'],function(_0x33aba1){return{'model':db[_0x33aba1[_0x8240('0x1d')]],'as':_0x33aba1['as'],'attributes':_0x33aba1[_0x8240('0x1a')],'include':_0x33aba1[_0x8240('0x1b')]?_[_0x8240('0x1c')](_0x33aba1['include'],function(_0x38a892){return{'model':db[_0x38a892['model']],'as':_0x38a892['as'],'attributes':_0x38a892[_0x8240('0x1a')],'include':_0x38a892[_0x8240('0x1b')]?_[_0x8240('0x1c')](_0x38a892[_0x8240('0x1b')],function(_0x28e938){return{'model':db[_0x28e938[_0x8240('0x1d')]],'as':_0x28e938['as'],'attributes':_0x28e938['attributes']};}):[]};}):[]};}):[]:[]})[_0x8240('0xb')](function(_0x3ab0c7){logger['info'](_0x8240('0x14'),_0x5af8a5);logger['debug'](_0x8240('0x14'),_0x5af8a5,JSON['stringify'](_0x3ab0c7));_0x53be36(_0x3ab0c7);})[_0x8240('0x1e')](function(_0x3f5ec8){logger[_0x8240('0x10')](_0x8240('0x14'),_0x3f5ec8[_0x8240('0x11')],_0x5af8a5);_0x22e5c0(_0x288727['error'](0x1f4,_0x3f5ec8[_0x8240('0x11')]));});});}; \ No newline at end of file +var _0xd1cd=['include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Sound,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','ShowSound','Sound','find','options','where','attributes'];(function(_0x39b171,_0x2db684){var _0x1fd234=function(_0x3cfb03){while(--_0x3cfb03){_0x39b171['push'](_0x39b171['shift']());}};_0x1fd234(++_0x2db684);}(_0xd1cd,0xbe));var _0xdd1c=function(_0x5546a4,_0x251c3b){_0x5546a4=_0x5546a4-0x0;var _0x572076=_0xd1cd[_0x5546a4];return _0x572076;};'use strict';var _=require(_0xdd1c('0x0'));var util=require(_0xdd1c('0x1'));var moment=require(_0xdd1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd1c('0x3'));var fs=require('fs');var Redis=require(_0xdd1c('0x4'));var db=require(_0xdd1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd1c('0x6'))('rpc');var config=require(_0xdd1c('0x7'));var jayson=require(_0xdd1c('0x8'));var client=jayson[_0xdd1c('0x9')][_0xdd1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ae25,_0x11c861,_0x144dc7){return new BPromise(function(_0x4bad4e,_0x5bdf7f){return client['request'](_0x59ae25,_0x144dc7)[_0xdd1c('0xb')](function(_0x506439){logger['info'](_0xdd1c('0xc'),_0x11c861,_0xdd1c('0xd'));logger[_0xdd1c('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x11c861,_0xdd1c('0xd'),JSON['stringify'](_0x506439));if(_0x506439['error']){if(_0x506439['error'][_0xdd1c('0xf')]===0x1f4){logger[_0xdd1c('0x10')](_0xdd1c('0xc'),_0x11c861,_0x506439['error']['message']);return _0x5bdf7f(_0x506439[_0xdd1c('0x10')][_0xdd1c('0x11')]);}logger['error'](_0xdd1c('0xc'),_0x11c861,_0x506439[_0xdd1c('0x10')][_0xdd1c('0x11')]);return _0x4bad4e(_0x506439[_0xdd1c('0x10')]['message']);}else{logger[_0xdd1c('0x12')]('Sound,\x20%s,\x20%s',_0x11c861,_0xdd1c('0xd'));_0x4bad4e(_0x506439[_0xdd1c('0x13')][_0xdd1c('0x11')]);}})[_0xdd1c('0x14')](function(_0x33f15b){logger['error'](_0xdd1c('0xc'),_0x11c861,_0x33f15b);_0x5bdf7f(_0x33f15b);});});}exports[_0xdd1c('0x15')]=function(_0xf825c7){var _0x2d2bfc=this;return new Promise(function(_0x303bb0,_0x136130){return db[_0xdd1c('0x16')][_0xdd1c('0x17')]({'raw':_0xf825c7['options']?_0xf825c7[_0xdd1c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x19')]||null:null,'attributes':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x1a')]||null:null,'include':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7['options'][_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x1b')],function(_0x25b65e){return{'model':db[_0x25b65e[_0xdd1c('0x1d')]],'as':_0x25b65e['as'],'attributes':_0x25b65e[_0xdd1c('0x1a')],'include':_0x25b65e[_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0x25b65e[_0xdd1c('0x1b')],function(_0x442884){return{'model':db[_0x442884[_0xdd1c('0x1d')]],'as':_0x442884['as'],'attributes':_0x442884[_0xdd1c('0x1a')],'include':_0x442884[_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0x442884[_0xdd1c('0x1b')],function(_0x400fe6){return{'model':db[_0x400fe6[_0xdd1c('0x1d')]],'as':_0x400fe6['as'],'attributes':_0x400fe6['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd1c('0xb')](function(_0x32cb51){logger['info'](_0xdd1c('0x15'),_0xf825c7);logger['debug']('ShowSound',_0xf825c7,JSON[_0xdd1c('0x1e')](_0x32cb51));_0x303bb0(_0x32cb51);})['catch'](function(_0x700864){logger['error'](_0xdd1c('0x15'),_0x700864[_0xdd1c('0x11')],_0xf825c7);_0x136130(_0x2d2bfc['error'](0x1f4,_0x700864[_0xdd1c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e58560c..5574523 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x5811e5,_0x946ee2){var _0x1642da=function(_0x52d73d){while(--_0x52d73d){_0x5811e5['push'](_0x5811e5['shift']());}};_0x1642da(++_0x946ee2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);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(_0xd9ad81,_0x511fdf){var _0x4ba037=function(_0x4a65af){while(--_0x4a65af){_0xd9ad81['push'](_0xd9ad81['shift']());}};_0x4ba037(++_0x511fdf);}(_0x2032,0xd9));var _0x2203=function(_0x39b27b,_0x25eaf1){_0x39b27b=_0x39b27b-0x0;var _0xae5ba5=_0x2032[_0x39b27b];return _0xae5ba5;};'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 e8996fa..0fa0c45 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 _0x19b7=['sequelize','exports','STRING','TEXT','ENUM','out'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x19b7,0x12c));var _0x719b=function(_0x5817c0,_0x2d40d3){_0x5817c0=_0x5817c0-0x0;var _0x1fd667=_0x19b7[_0x5817c0];return _0x1fd667;};'use strict';var Sequelize=require(_0x719b('0x0'));module[_0x719b('0x1')]={'uniqueid':{'type':Sequelize[_0x719b('0x2')]},'body':{'type':Sequelize[_0x719b('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x719b('0x4')]('in',_0x719b('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x088f=['exports','TEXT','medium','ENUM','STRING'];(function(_0x65410f,_0xb68be6){var _0x16a74c=function(_0x2bdec2){while(--_0x2bdec2){_0x65410f['push'](_0x65410f['shift']());}};_0x16a74c(++_0xb68be6);}(_0x088f,0x69));var _0xf088=function(_0x59d553,_0x31b885){_0x59d553=_0x59d553-0x0;var _0x495cea=_0x088f[_0x59d553];return _0x495cea;};'use strict';var Sequelize=require('sequelize');module[_0xf088('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xf088('0x1')](_0xf088('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xf088('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xf088('0x4')]},'providerResponse':{'type':Sequelize[_0xf088('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0ad590a..7022c6a 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 _0x9480=['update','destroy','then','sendStatus','error','send','index','map','SquareMessage','fieldName','type','key','name','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','model','rawAttributes','fields','options','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save'];(function(_0x337055,_0x515cb8){var _0x5efa45=function(_0x525d2a){while(--_0x525d2a){_0x337055['push'](_0x337055['shift']());}};_0x5efa45(++_0x515cb8);}(_0x9480,0x77));var _0x0948=function(_0x532a2c,_0xba730e){_0x532a2c=_0x532a2c-0x0;var _0x125d20=_0x9480[_0x532a2c];return _0x125d20;};'use strict';var emlformat=require(_0x0948('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0948('0x1'));var rp=require(_0x0948('0x2'));var moment=require(_0x0948('0x3'));var BPromise=require(_0x0948('0x4'));var Mustache=require(_0x0948('0x5'));var util=require(_0x0948('0x6'));var path=require(_0x0948('0x7'));var sox=require(_0x0948('0x8'));var csv=require(_0x0948('0x9'));var ejs=require(_0x0948('0xa'));var fs=require('fs');var fs_extra=require(_0x0948('0xb'));var _=require(_0x0948('0xc'));var squel=require(_0x0948('0xd'));var crypto=require(_0x0948('0xe'));var jsforce=require(_0x0948('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0948('0x9'));var querystring=require(_0x0948('0x10'));var Papa=require(_0x0948('0x11'));var Redis=require(_0x0948('0x12'));var authService=require(_0x0948('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0948('0x14'));var hardwareService=require(_0x0948('0x15'));var logger=require(_0x0948('0x16'))(_0x0948('0x17'));var utils=require(_0x0948('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0948('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371024,_0x355178){_0x355178=_0x355178||0xcc;return function(_0x205f26){if(_0x205f26){return _0x371024['sendStatus'](_0x355178);}return _0x371024[_0x0948('0x1a')](_0x355178)[_0x0948('0x1b')]();};}function respondWithResult(_0x19b23d,_0x4876da){_0x4876da=_0x4876da||0xc8;return function(_0x37ad07){if(_0x37ad07){return _0x19b23d[_0x0948('0x1a')](_0x4876da)[_0x0948('0x1c')](_0x37ad07);}};}function respondWithFilteredResult(_0x2f925b,_0x3421d1){return function(_0x2bd568){if(_0x2bd568){var _0x399693=typeof _0x3421d1['offset']==='undefined'&&typeof _0x3421d1['limit']===_0x0948('0x1d');var _0x1149f3=_0x2bd568[_0x0948('0x1e')];var _0x4a4248=_0x399693?0x0:_0x3421d1[_0x0948('0x1f')];var _0x2fdbb7=_0x399693?_0x2bd568[_0x0948('0x1e')]:_0x3421d1[_0x0948('0x1f')]+_0x3421d1[_0x0948('0x20')];var _0x51e486;if(_0x2fdbb7>=_0x1149f3){_0x2fdbb7=_0x1149f3;_0x51e486=0xc8;}else{_0x51e486=0xce;}_0x2f925b['status'](_0x51e486);return _0x2f925b[_0x0948('0x21')](_0x0948('0x22'),_0x4a4248+'-'+_0x2fdbb7+'/'+_0x1149f3)['json'](_0x2bd568);}return null;};}function patchUpdates(_0x2bc899){return function(_0x3fea1a){try{jsonpatch['apply'](_0x3fea1a,_0x2bc899,!![]);}catch(_0x5a69df){return BPromise[_0x0948('0x23')](_0x5a69df);}return _0x3fea1a[_0x0948('0x24')]();};}function saveUpdates(_0x41be1c,_0x20d354){return function(_0xd2c311){if(_0xd2c311){return _0xd2c311[_0x0948('0x25')](_0x41be1c)['then'](function(_0x343bce){return _0x343bce;});}return null;};}function removeEntity(_0x1b2d52,_0xa0243a){return function(_0x4d4994){if(_0x4d4994){return _0x4d4994[_0x0948('0x26')]()[_0x0948('0x27')](function(){_0x1b2d52[_0x0948('0x1a')](0xcc)[_0x0948('0x1b')]();});}};}function handleEntityNotFound(_0x43c44e,_0x2da202){return function(_0x26ebd7){if(!_0x26ebd7){_0x43c44e[_0x0948('0x28')](0x194);}return _0x26ebd7;};}function handleError(_0x59eead,_0x27a40d){_0x27a40d=_0x27a40d||0x1f4;return function(_0x41b3d7){logger[_0x0948('0x29')](_0x41b3d7['stack']);if(_0x41b3d7['name']){delete _0x41b3d7['name'];}_0x59eead[_0x0948('0x1a')](_0x27a40d)[_0x0948('0x2a')](_0x41b3d7);};}exports[_0x0948('0x2b')]=function(_0x375e20,_0x2a3d90){var _0xf8ceaf={},_0x2bed1e={},_0x3083a9={'count':0x0,'rows':[]};var _0x10349d=_[_0x0948('0x2c')](db[_0x0948('0x2d')]['rawAttributes'],function(_0x4b2263){return{'name':_0x4b2263[_0x0948('0x2e')],'type':_0x4b2263[_0x0948('0x2f')][_0x0948('0x30')]};});_0x2bed1e['model']=_[_0x0948('0x2c')](_0x10349d,_0x0948('0x31'));_0x2bed1e[_0x0948('0x32')]=_[_0x0948('0x33')](_0x375e20[_0x0948('0x32')]);_0x2bed1e['filters']=_['intersection'](_0x2bed1e['model'],_0x2bed1e[_0x0948('0x32')]);_0xf8ceaf[_0x0948('0x34')]=_[_0x0948('0x35')](_0x2bed1e['model'],qs['fields'](_0x375e20[_0x0948('0x32')]['fields']));_0xf8ceaf[_0x0948('0x34')]=_0xf8ceaf[_0x0948('0x34')][_0x0948('0x36')]?_0xf8ceaf['attributes']:_0x2bed1e['model'];if(!_0x375e20['query'][_0x0948('0x37')](_0x0948('0x38'))){_0xf8ceaf[_0x0948('0x20')]=qs[_0x0948('0x20')](_0x375e20[_0x0948('0x32')]['limit']);_0xf8ceaf[_0x0948('0x1f')]=qs[_0x0948('0x1f')](_0x375e20['query'][_0x0948('0x1f')]);}_0xf8ceaf[_0x0948('0x39')]=qs[_0x0948('0x3a')](_0x375e20[_0x0948('0x32')][_0x0948('0x3a')]);_0xf8ceaf[_0x0948('0x3b')]=qs['filters'](_['pick'](_0x375e20['query'],_0x2bed1e[_0x0948('0x3c')]),_0x10349d);if(_0x375e20[_0x0948('0x32')]['filter']){_0xf8ceaf['where']=_[_0x0948('0x3d')](_0xf8ceaf[_0x0948('0x3b')],{'$or':_[_0x0948('0x2c')](_0x10349d,function(_0x2a6d2e){if(_0x2a6d2e[_0x0948('0x2f')]!==_0x0948('0x3e')){var _0x5a6219={};_0x5a6219[_0x2a6d2e[_0x0948('0x31')]]={'$like':'%'+_0x375e20['query'][_0x0948('0x3f')]+'%'};return _0x5a6219;}})});}_0xf8ceaf=_[_0x0948('0x3d')]({},_0xf8ceaf,_0x375e20['options']);var _0x39a37e={'where':_0xf8ceaf['where']};return db[_0x0948('0x2d')][_0x0948('0x1e')](_0x39a37e)['then'](function(_0x695a42){_0x3083a9[_0x0948('0x1e')]=_0x695a42;if(_0x375e20[_0x0948('0x32')][_0x0948('0x40')]){_0xf8ceaf[_0x0948('0x41')]=[{'all':!![]}];}return db[_0x0948('0x2d')][_0x0948('0x42')](_0xf8ceaf);})[_0x0948('0x27')](function(_0x4e5534){_0x3083a9[_0x0948('0x43')]=_0x4e5534;return _0x3083a9;})[_0x0948('0x27')](respondWithFilteredResult(_0x2a3d90,_0xf8ceaf))[_0x0948('0x44')](handleError(_0x2a3d90,null));};exports[_0x0948('0x45')]=function(_0x5a104f,_0x48e036){var _0xfec9f7={'raw':!![],'where':{'id':_0x5a104f[_0x0948('0x46')]['id']}},_0xc1b38={};_0xc1b38[_0x0948('0x47')]=_['keys'](db[_0x0948('0x2d')][_0x0948('0x48')]);_0xc1b38[_0x0948('0x32')]=_[_0x0948('0x33')](_0x5a104f['query']);_0xc1b38['filters']=_['intersection'](_0xc1b38['model'],_0xc1b38[_0x0948('0x32')]);_0xfec9f7['attributes']=_[_0x0948('0x35')](_0xc1b38[_0x0948('0x47')],qs[_0x0948('0x49')](_0x5a104f[_0x0948('0x32')][_0x0948('0x49')]));_0xfec9f7[_0x0948('0x34')]=_0xfec9f7['attributes']['length']?_0xfec9f7[_0x0948('0x34')]:_0xc1b38['model'];if(_0x5a104f[_0x0948('0x32')]['includeAll']){_0xfec9f7[_0x0948('0x41')]=[{'all':!![]}];}_0xfec9f7=_[_0x0948('0x3d')]({},_0xfec9f7,_0x5a104f[_0x0948('0x4a')]);return db[_0x0948('0x2d')][_0x0948('0x4b')](_0xfec9f7)['then'](handleEntityNotFound(_0x48e036,null))['then'](respondWithResult(_0x48e036,null))[_0x0948('0x44')](handleError(_0x48e036,null));};exports[_0x0948('0x4c')]=function(_0xfa43b3,_0x6d6624){return db['SquareMessage'][_0x0948('0x4c')](_0xfa43b3[_0x0948('0x4d')],{})[_0x0948('0x27')](respondWithResult(_0x6d6624,0xc9))['catch'](handleError(_0x6d6624,null));};exports[_0x0948('0x25')]=function(_0x3fdf53,_0x2a0795){if(_0x3fdf53[_0x0948('0x4d')]['id']){delete _0x3fdf53[_0x0948('0x4d')]['id'];}return db['SquareMessage'][_0x0948('0x4b')]({'where':{'id':_0x3fdf53['params']['id']}})['then'](handleEntityNotFound(_0x2a0795,null))['then'](saveUpdates(_0x3fdf53[_0x0948('0x4d')],null))[_0x0948('0x27')](respondWithResult(_0x2a0795,null))[_0x0948('0x44')](handleError(_0x2a0795,null));};exports[_0x0948('0x26')]=function(_0x115220,_0x22f6e3){return db['SquareMessage'][_0x0948('0x4b')]({'where':{'id':_0x115220[_0x0948('0x46')]['id']}})[_0x0948('0x27')](handleEntityNotFound(_0x22f6e3,null))[_0x0948('0x27')](removeEntity(_0x22f6e3,null))[_0x0948('0x44')](handleError(_0x22f6e3,null));}; \ No newline at end of file +var _0xd945=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0xd945,0x84));var _0x5d94=function(_0x4d2353,_0x3c8161){_0x4d2353=_0x4d2353-0x0;var _0x1a455b=_0xd945[_0x4d2353];return _0x1a455b;};'use strict';var emlformat=require(_0x5d94('0x0'));var rimraf=require(_0x5d94('0x1'));var zipdir=require(_0x5d94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d94('0x3'));var moment=require(_0x5d94('0x4'));var BPromise=require(_0x5d94('0x5'));var Mustache=require(_0x5d94('0x6'));var util=require(_0x5d94('0x7'));var path=require('path');var sox=require(_0x5d94('0x8'));var csv=require(_0x5d94('0x9'));var ejs=require(_0x5d94('0xa'));var fs=require('fs');var fs_extra=require(_0x5d94('0xb'));var _=require(_0x5d94('0xc'));var squel=require('squel');var crypto=require(_0x5d94('0xd'));var jsforce=require(_0x5d94('0xe'));var deskjs=require(_0x5d94('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d94('0x10'));var Papa=require(_0x5d94('0x11'));var Redis=require(_0x5d94('0x12'));var authService=require(_0x5d94('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d94('0x15'))(_0x5d94('0x16'));var utils=require(_0x5d94('0x17'));var config=require(_0x5d94('0x18'));var licenseUtil=require(_0x5d94('0x19'));var db=require(_0x5d94('0x1a'))['db'];function respondWithStatusCode(_0x3451fc,_0x42641b){_0x42641b=_0x42641b||0xcc;return function(_0x1aed99){if(_0x1aed99){return _0x3451fc[_0x5d94('0x1b')](_0x42641b);}return _0x3451fc['status'](_0x42641b)[_0x5d94('0x1c')]();};}function respondWithResult(_0x47616b,_0x592b93){_0x592b93=_0x592b93||0xc8;return function(_0x1d8291){if(_0x1d8291){return _0x47616b[_0x5d94('0x1d')](_0x592b93)[_0x5d94('0x1e')](_0x1d8291);}};}function respondWithFilteredResult(_0x10867c,_0x1a0011){return function(_0x452a88){if(_0x452a88){var _0x5c4d65=typeof _0x1a0011['offset']==='undefined'&&typeof _0x1a0011[_0x5d94('0x1f')]===_0x5d94('0x20');var _0x1ef529=_0x452a88[_0x5d94('0x21')];var _0x12c238=_0x5c4d65?0x0:_0x1a0011['offset'];var _0x322380=_0x5c4d65?_0x452a88[_0x5d94('0x21')]:_0x1a0011[_0x5d94('0x22')]+_0x1a0011[_0x5d94('0x1f')];var _0x176f5c;if(_0x322380>=_0x1ef529){_0x322380=_0x1ef529;_0x176f5c=0xc8;}else{_0x176f5c=0xce;}_0x10867c[_0x5d94('0x1d')](_0x176f5c);return _0x10867c[_0x5d94('0x23')](_0x5d94('0x24'),_0x12c238+'-'+_0x322380+'/'+_0x1ef529)[_0x5d94('0x1e')](_0x452a88);}return null;};}function patchUpdates(_0x141783){return function(_0x1e9524){try{jsonpatch[_0x5d94('0x25')](_0x1e9524,_0x141783,!![]);}catch(_0xe21853){return BPromise['reject'](_0xe21853);}return _0x1e9524[_0x5d94('0x26')]();};}function saveUpdates(_0x255e3f,_0x15f9b4){return function(_0x2a643f){if(_0x2a643f){return _0x2a643f[_0x5d94('0x27')](_0x255e3f)[_0x5d94('0x28')](function(_0xd0fbf0){return _0xd0fbf0;});}return null;};}function removeEntity(_0x100832,_0x2f12d9){return function(_0x40c0a6){if(_0x40c0a6){return _0x40c0a6[_0x5d94('0x29')]()[_0x5d94('0x28')](function(){_0x100832[_0x5d94('0x1d')](0xcc)[_0x5d94('0x1c')]();});}};}function handleEntityNotFound(_0x1c1344,_0x478c39){return function(_0x374c3f){if(!_0x374c3f){_0x1c1344[_0x5d94('0x1b')](0x194);}return _0x374c3f;};}function handleError(_0x3c8cc2,_0x390e01){_0x390e01=_0x390e01||0x1f4;return function(_0x3241a7){logger[_0x5d94('0x2a')](_0x3241a7[_0x5d94('0x2b')]);if(_0x3241a7[_0x5d94('0x2c')]){delete _0x3241a7[_0x5d94('0x2c')];}_0x3c8cc2[_0x5d94('0x1d')](_0x390e01)[_0x5d94('0x2d')](_0x3241a7);};}exports['index']=function(_0x5a117f,_0xbf0bc6){var _0x54d4df={},_0x19ef72={},_0x43ef7f={'count':0x0,'rows':[]};var _0x1bdfc5=_[_0x5d94('0x2e')](db[_0x5d94('0x2f')][_0x5d94('0x30')],function(_0x124b59){return{'name':_0x124b59[_0x5d94('0x31')],'type':_0x124b59[_0x5d94('0x32')][_0x5d94('0x33')]};});_0x19ef72['model']=_['map'](_0x1bdfc5,_0x5d94('0x2c'));_0x19ef72[_0x5d94('0x34')]=_[_0x5d94('0x35')](_0x5a117f['query']);_0x19ef72['filters']=_['intersection'](_0x19ef72[_0x5d94('0x36')],_0x19ef72['query']);_0x54d4df[_0x5d94('0x37')]=_[_0x5d94('0x38')](_0x19ef72[_0x5d94('0x36')],qs[_0x5d94('0x39')](_0x5a117f[_0x5d94('0x34')][_0x5d94('0x39')]));_0x54d4df[_0x5d94('0x37')]=_0x54d4df[_0x5d94('0x37')]['length']?_0x54d4df[_0x5d94('0x37')]:_0x19ef72[_0x5d94('0x36')];if(!_0x5a117f[_0x5d94('0x34')][_0x5d94('0x3a')]('nolimit')){_0x54d4df['limit']=qs[_0x5d94('0x1f')](_0x5a117f['query']['limit']);_0x54d4df[_0x5d94('0x22')]=qs[_0x5d94('0x22')](_0x5a117f['query']['offset']);}_0x54d4df[_0x5d94('0x3b')]=qs[_0x5d94('0x3c')](_0x5a117f['query'][_0x5d94('0x3c')]);_0x54d4df[_0x5d94('0x3d')]=qs[_0x5d94('0x3e')](_[_0x5d94('0x3f')](_0x5a117f[_0x5d94('0x34')],_0x19ef72[_0x5d94('0x3e')]),_0x1bdfc5);if(_0x5a117f[_0x5d94('0x34')][_0x5d94('0x40')]){_0x54d4df[_0x5d94('0x3d')]=_[_0x5d94('0x41')](_0x54d4df['where'],{'$or':_[_0x5d94('0x2e')](_0x1bdfc5,function(_0x26614b){if(_0x26614b[_0x5d94('0x32')]!==_0x5d94('0x42')){var _0x4aa034={};_0x4aa034[_0x26614b[_0x5d94('0x2c')]]={'$like':'%'+_0x5a117f[_0x5d94('0x34')]['filter']+'%'};return _0x4aa034;}})});}_0x54d4df=_['merge']({},_0x54d4df,_0x5a117f[_0x5d94('0x43')]);var _0x36747e={'where':_0x54d4df[_0x5d94('0x3d')]};return db[_0x5d94('0x2f')][_0x5d94('0x21')](_0x36747e)['then'](function(_0x3798ce){_0x43ef7f[_0x5d94('0x21')]=_0x3798ce;if(_0x5a117f[_0x5d94('0x34')][_0x5d94('0x44')]){_0x54d4df['include']=[{'all':!![]}];}return db[_0x5d94('0x2f')][_0x5d94('0x45')](_0x54d4df);})[_0x5d94('0x28')](function(_0x4b9b02){_0x43ef7f[_0x5d94('0x46')]=_0x4b9b02;return _0x43ef7f;})['then'](respondWithFilteredResult(_0xbf0bc6,_0x54d4df))['catch'](handleError(_0xbf0bc6,null));};exports['show']=function(_0x21e186,_0x2bfb5d){var _0x11203e={'raw':!![],'where':{'id':_0x21e186['params']['id']}},_0x1822ad={};_0x1822ad[_0x5d94('0x36')]=_[_0x5d94('0x35')](db['SquareMessage']['rawAttributes']);_0x1822ad[_0x5d94('0x34')]=_[_0x5d94('0x35')](_0x21e186['query']);_0x1822ad[_0x5d94('0x3e')]=_['intersection'](_0x1822ad[_0x5d94('0x36')],_0x1822ad['query']);_0x11203e[_0x5d94('0x37')]=_[_0x5d94('0x38')](_0x1822ad[_0x5d94('0x36')],qs[_0x5d94('0x39')](_0x21e186[_0x5d94('0x34')][_0x5d94('0x39')]));_0x11203e['attributes']=_0x11203e[_0x5d94('0x37')][_0x5d94('0x47')]?_0x11203e[_0x5d94('0x37')]:_0x1822ad[_0x5d94('0x36')];if(_0x21e186['query'][_0x5d94('0x44')]){_0x11203e['include']=[{'all':!![]}];}_0x11203e=_['merge']({},_0x11203e,_0x21e186[_0x5d94('0x43')]);return db[_0x5d94('0x2f')][_0x5d94('0x48')](_0x11203e)[_0x5d94('0x28')](handleEntityNotFound(_0x2bfb5d,null))[_0x5d94('0x28')](respondWithResult(_0x2bfb5d,null))[_0x5d94('0x49')](handleError(_0x2bfb5d,null));};exports['create']=function(_0x486e1a,_0x25d315){return db[_0x5d94('0x2f')][_0x5d94('0x4a')](_0x486e1a[_0x5d94('0x4b')],{})[_0x5d94('0x28')](respondWithResult(_0x25d315,0xc9))[_0x5d94('0x49')](handleError(_0x25d315,null));};exports[_0x5d94('0x27')]=function(_0x5ce78c,_0x45a6c9){if(_0x5ce78c[_0x5d94('0x4b')]['id']){delete _0x5ce78c['body']['id'];}return db[_0x5d94('0x2f')][_0x5d94('0x48')]({'where':{'id':_0x5ce78c[_0x5d94('0x4c')]['id']}})[_0x5d94('0x28')](handleEntityNotFound(_0x45a6c9,null))[_0x5d94('0x28')](saveUpdates(_0x5ce78c[_0x5d94('0x4b')],null))[_0x5d94('0x28')](respondWithResult(_0x45a6c9,null))[_0x5d94('0x49')](handleError(_0x45a6c9,null));};exports['destroy']=function(_0x4f851b,_0x1ffcdf){return db[_0x5d94('0x2f')][_0x5d94('0x48')]({'where':{'id':_0x4f851b[_0x5d94('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ffcdf,null))[_0x5d94('0x28')](removeEntity(_0x1ffcdf,null))[_0x5d94('0x49')](handleError(_0x1ffcdf,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 276cca2..a03e127 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 _0x03c1=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes','define','SquareMessage'];(function(_0x56a38a,_0x2fa55f){var _0x38855b=function(_0x57e360){while(--_0x57e360){_0x56a38a['push'](_0x56a38a['shift']());}};_0x38855b(++_0x2fa55f);}(_0x03c1,0x1f4));var _0x103c=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x03c1[_0x4b91c4];return _0x25cb80;};'use strict';var _=require(_0x103c('0x0'));var util=require(_0x103c('0x1'));var logger=require('../../config/logger')(_0x103c('0x2'));var moment=require(_0x103c('0x3'));var BPromise=require(_0x103c('0x4'));var rp=require(_0x103c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x103c('0x6'));var attributes=require(_0x103c('0x7'));module['exports']=function(_0x363c5e,_0x45ecb0){return _0x363c5e[_0x103c('0x8')](_0x103c('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ea1=['lodash','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5ea1,0xa8));var _0x15ea=function(_0xb07ee3,_0x1229e1){_0xb07ee3=_0xb07ee3-0x0;var _0x3b9903=_0x5ea1[_0xb07ee3];return _0x3b9903;};'use strict';var _=require(_0x15ea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x15ea('0x1'));var rp=require(_0x15ea('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15ea('0x3'));var config=require(_0x15ea('0x4'));var attributes=require(_0x15ea('0x5'));module[_0x15ea('0x6')]=function(_0x5b3658,_0x1f5430){return _0x5b3658['define']('SquareMessage',attributes,{'tableName':_0x15ea('0x7'),'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 4aa31d6..f6fe969 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 _0x88da=['request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateSquareMessage','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x3400bf,_0x4ca761){var _0x3f7e52=function(_0x2f1769){while(--_0x2f1769){_0x3400bf['push'](_0x3400bf['shift']());}};_0x3f7e52(++_0x4ca761);}(_0x88da,0xce));var _0xa88d=function(_0x55c835,_0x585f5e){_0x55c835=_0x55c835-0x0;var _0xfccf2=_0x88da[_0x55c835];return _0xfccf2;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var moment=require(_0xa88d('0x2'));var BPromise=require(_0xa88d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa88d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa88d('0x5'));var logger=require(_0xa88d('0x6'))('rpc');var config=require(_0xa88d('0x7'));var jayson=require(_0xa88d('0x8'));var client=jayson['client'][_0xa88d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x585359,_0x298edd,_0x32b6b5){return new BPromise(function(_0x1a51d7,_0xe978cf){return client[_0xa88d('0xa')](_0x585359,_0x32b6b5)[_0xa88d('0xb')](function(_0x2c7a5d){logger[_0xa88d('0xc')](_0xa88d('0xd'),_0x298edd,_0xa88d('0xe'));logger[_0xa88d('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x298edd,_0xa88d('0xe'),JSON[_0xa88d('0x10')](_0x2c7a5d));if(_0x2c7a5d['error']){if(_0x2c7a5d[_0xa88d('0x11')][_0xa88d('0x12')]===0x1f4){logger[_0xa88d('0x11')](_0xa88d('0xd'),_0x298edd,_0x2c7a5d[_0xa88d('0x11')][_0xa88d('0x13')]);return _0xe978cf(_0x2c7a5d[_0xa88d('0x11')]['message']);}logger[_0xa88d('0x11')](_0xa88d('0xd'),_0x298edd,_0x2c7a5d[_0xa88d('0x11')]['message']);return _0x1a51d7(_0x2c7a5d[_0xa88d('0x11')]['message']);}else{logger[_0xa88d('0xc')](_0xa88d('0xd'),_0x298edd,_0xa88d('0xe'));_0x1a51d7(_0x2c7a5d['result']['message']);}})['catch'](function(_0x471b7f){logger[_0xa88d('0x11')](_0xa88d('0xd'),_0x298edd,_0x471b7f);_0xe978cf(_0x471b7f);});});}exports[_0xa88d('0x14')]=function(_0xf52829){var _0x188fab=this;return new Promise(function(_0x32b98e,_0x4188fd){return db['SquareMessage']['create'](_0xf52829[_0xa88d('0x15')],{'raw':_0xf52829['options']?_0xf52829[_0xa88d('0x16')][_0xa88d('0x17')]===undefined?!![]:![]:!![]})[_0xa88d('0xb')](function(_0x59468e){logger[_0xa88d('0xc')](_0xa88d('0x14'),_0xf52829);logger[_0xa88d('0xf')](_0xa88d('0x14'),_0xf52829,JSON[_0xa88d('0x10')](_0x59468e));_0x32b98e(_0x59468e);})['catch'](function(_0xfe20c9){logger[_0xa88d('0x11')](_0xa88d('0x14'),_0xfe20c9[_0xa88d('0x13')],_0xf52829);_0x4188fd(_0x188fab[_0xa88d('0x11')](0x1f4,_0xfe20c9[_0xa88d('0x13')]));});});}; \ No newline at end of file +var _0x8d4c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','debug','CreateSquareMessage','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4efc72,_0x43c8a3){var _0x88ffb9=function(_0x4994da){while(--_0x4994da){_0x4efc72['push'](_0x4efc72['shift']());}};_0x88ffb9(++_0x43c8a3);}(_0x8d4c,0x1e6));var _0xc8d4=function(_0x16d24f,_0x4686a5){_0x16d24f=_0x16d24f-0x0;var _0x3beec6=_0x8d4c[_0x16d24f];return _0x3beec6;};'use strict';var _=require(_0xc8d4('0x0'));var util=require(_0xc8d4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc8d4('0x2'));var fs=require('fs');var Redis=require(_0xc8d4('0x3'));var db=require(_0xc8d4('0x4'))['db'];var utils=require(_0xc8d4('0x5'));var logger=require(_0xc8d4('0x6'))(_0xc8d4('0x7'));var config=require(_0xc8d4('0x8'));var jayson=require(_0xc8d4('0x9'));var client=jayson[_0xc8d4('0xa')][_0xc8d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25e004,_0x14d240,_0x42631d){return new BPromise(function(_0x3dc022,_0x4f5bc4){return client[_0xc8d4('0xc')](_0x25e004,_0x42631d)[_0xc8d4('0xd')](function(_0x30f107){logger[_0xc8d4('0xe')](_0xc8d4('0xf'),_0x14d240,_0xc8d4('0x10'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x14d240,_0xc8d4('0x10'),JSON[_0xc8d4('0x11')](_0x30f107));if(_0x30f107[_0xc8d4('0x12')]){if(_0x30f107[_0xc8d4('0x12')]['code']===0x1f4){logger['error'](_0xc8d4('0xf'),_0x14d240,_0x30f107[_0xc8d4('0x12')]['message']);return _0x4f5bc4(_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);}logger['error'](_0xc8d4('0xf'),_0x14d240,_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);return _0x3dc022(_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);}else{logger[_0xc8d4('0xe')](_0xc8d4('0xf'),_0x14d240,'request\x20sent');_0x3dc022(_0x30f107[_0xc8d4('0x14')]['message']);}})[_0xc8d4('0x15')](function(_0x419b68){logger[_0xc8d4('0x12')](_0xc8d4('0xf'),_0x14d240,_0x419b68);_0x4f5bc4(_0x419b68);});});}exports['CreateSquareMessage']=function(_0x18f0f3){var _0x4b68b4=this;return new Promise(function(_0x2a3706,_0x2df86a){return db[_0xc8d4('0x16')][_0xc8d4('0x17')](_0x18f0f3[_0xc8d4('0x18')],{'raw':_0x18f0f3[_0xc8d4('0x19')]?_0x18f0f3[_0xc8d4('0x19')][_0xc8d4('0x1a')]===undefined?!![]:![]:!![]})[_0xc8d4('0xd')](function(_0x757b4c){logger['info']('CreateSquareMessage',_0x18f0f3);logger[_0xc8d4('0x1b')](_0xc8d4('0x1c'),_0x18f0f3,JSON['stringify'](_0x757b4c));_0x2a3706(_0x757b4c);})['catch'](function(_0xb82a45){logger[_0xc8d4('0x12')]('CreateSquareMessage',_0xb82a45[_0xc8d4('0x13')],_0x18f0f3);_0x2df86a(_0x4b68b4[_0xc8d4('0x12')](0x1f4,_0xb82a45['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e40c7cc..6c634b7 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 _0xa848=['fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x52f738,_0x37c2b1){var _0x220e64=function(_0x26a897){while(--_0x26a897){_0x52f738['push'](_0x52f738['shift']());}};_0x220e64(++_0x37c2b1);}(_0xa848,0x110));var _0x8a84=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa848[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var path=require('path');var timeout=require(_0x8a84('0x2'));var express=require(_0x8a84('0x3'));var router=express['Router']();var fs_extra=require(_0x8a84('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a84('0x5'));var config=require(_0x8a84('0x6'));var controller=require(_0x8a84('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a84('0x8')]);router[_0x8a84('0x9')](_0x8a84('0xa'),auth[_0x8a84('0xb')](),controller[_0x8a84('0xc')]);router[_0x8a84('0x9')](_0x8a84('0xd'),auth[_0x8a84('0xb')](),timeout(_0x8a84('0xe')),controller[_0x8a84('0xf')]);router[_0x8a84('0x10')]('/',auth[_0x8a84('0xb')](),controller[_0x8a84('0x11')]);router[_0x8a84('0x12')](_0x8a84('0xa'),auth[_0x8a84('0xb')](),controller[_0x8a84('0x13')]);router[_0x8a84('0x14')](_0x8a84('0xa'),auth['isAuthenticated'](),controller[_0x8a84('0x15')]);module[_0x8a84('0x16')]=router; \ No newline at end of file +var _0xa4a2=['show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5519cb,_0x2706bc){var _0xdfc901=function(_0x3a42fa){while(--_0x3a42fa){_0x5519cb['push'](_0x5519cb['shift']());}};_0xdfc901(++_0x2706bc);}(_0xa4a2,0x1a3));var _0x2a4a=function(_0xa929c8,_0x25a5c2){_0xa929c8=_0xa929c8-0x0;var _0x1b527c=_0xa4a2[_0xa929c8];return _0x1b527c;};'use strict';var multer=require('multer');var util=require(_0x2a4a('0x0'));var path=require(_0x2a4a('0x1'));var timeout=require(_0x2a4a('0x2'));var express=require(_0x2a4a('0x3'));var router=express[_0x2a4a('0x4')]();var fs_extra=require(_0x2a4a('0x5'));var auth=require(_0x2a4a('0x6'));var interaction=require(_0x2a4a('0x7'));var config=require(_0x2a4a('0x8'));var controller=require('./squareOdbc.controller');router[_0x2a4a('0x9')]('/',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0xb')]);router['get'](_0x2a4a('0xc'),auth[_0x2a4a('0xa')](),controller[_0x2a4a('0xd')]);router[_0x2a4a('0x9')](_0x2a4a('0xe'),auth[_0x2a4a('0xa')](),timeout(_0x2a4a('0xf')),controller[_0x2a4a('0x10')]);router[_0x2a4a('0x11')]('/',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x12')]);router[_0x2a4a('0x13')](_0x2a4a('0xc'),auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x14')]);router[_0x2a4a('0x15')]('/:id',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x16')]);module[_0x2a4a('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c381e1e..02e6b20 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 _0x087e=['sequelize','exports','STRING','name'];(function(_0x3c538b,_0x14cb10){var _0x4b8542=function(_0xb54272){while(--_0xb54272){_0x3c538b['push'](_0x3c538b['shift']());}};_0x4b8542(++_0x14cb10);}(_0x087e,0x7c));var _0xe087=function(_0x4f7fe2,_0x4d2ab6){_0x4f7fe2=_0x4f7fe2-0x0;var _0x3e8382=_0x087e[_0x4f7fe2];return _0x3e8382;};'use strict';var Sequelize=require(_0xe087('0x0'));module[_0xe087('0x1')]={'name':{'type':Sequelize[_0xe087('0x2')],'unique':_0xe087('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe087('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6092=['sequelize','exports','STRING','name'];(function(_0x5578a,_0x34a644){var _0xbc231a=function(_0x58cc0b){while(--_0x58cc0b){_0x5578a['push'](_0x5578a['shift']());}};_0xbc231a(++_0x34a644);}(_0x6092,0x1e8));var _0x2609=function(_0x37b318,_0x562b3d){_0x37b318=_0x37b318-0x0;var _0x46eac4=_0x6092[_0x37b318];return _0x46eac4;};'use strict';var Sequelize=require(_0x2609('0x0'));module[_0x2609('0x1')]={'name':{'type':Sequelize[_0x2609('0x2')],'unique':_0x2609('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2609('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 0ad406f..5b25b3f 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 _0xc396=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','name','send','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId'];(function(_0x4bbbef,_0x1d39fa){var _0x237551=function(_0x1aa714){while(--_0x1aa714){_0x4bbbef['push'](_0x4bbbef['shift']());}};_0x237551(++_0x1d39fa);}(_0xc396,0x109));var _0x6c39=function(_0x443851,_0x24bcf6){_0x443851=_0x443851-0x0;var _0xa0ffc2=_0xc396[_0x443851];return _0xa0ffc2;};'use strict';var emlformat=require(_0x6c39('0x0'));var rimraf=require(_0x6c39('0x1'));var zipdir=require(_0x6c39('0x2'));var jsonpatch=require(_0x6c39('0x3'));var rp=require(_0x6c39('0x4'));var moment=require(_0x6c39('0x5'));var BPromise=require(_0x6c39('0x6'));var Mustache=require('mustache');var util=require(_0x6c39('0x7'));var path=require(_0x6c39('0x8'));var sox=require('sox');var csv=require(_0x6c39('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c39('0xa'));var crypto=require(_0x6c39('0xb'));var jsforce=require(_0x6c39('0xc'));var deskjs=require(_0x6c39('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c39('0xe'));var Papa=require(_0x6c39('0xf'));var Redis=require('ioredis');var authService=require(_0x6c39('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6c39('0x11'));var hardwareService=require(_0x6c39('0x12'));var logger=require(_0x6c39('0x13'))(_0x6c39('0x14'));var utils=require(_0x6c39('0x15'));var config=require(_0x6c39('0x16'));var licenseUtil=require(_0x6c39('0x17'));var db=require(_0x6c39('0x18'))['db'];function respondWithStatusCode(_0x5276e7,_0x40ba5d){_0x40ba5d=_0x40ba5d||0xcc;return function(_0x2e5233){if(_0x2e5233){return _0x5276e7[_0x6c39('0x19')](_0x40ba5d);}return _0x5276e7[_0x6c39('0x1a')](_0x40ba5d)[_0x6c39('0x1b')]();};}function respondWithResult(_0x2cf23e,_0x393cb4){_0x393cb4=_0x393cb4||0xc8;return function(_0x43b14f){if(_0x43b14f){return _0x2cf23e[_0x6c39('0x1a')](_0x393cb4)['json'](_0x43b14f);}};}function respondWithFilteredResult(_0x50b32d,_0x4ce196){return function(_0x51c9d1){if(_0x51c9d1){var _0x5dcc2c=typeof _0x4ce196[_0x6c39('0x1c')]===_0x6c39('0x1d')&&typeof _0x4ce196['limit']===_0x6c39('0x1d');var _0x5bfee8=_0x51c9d1[_0x6c39('0x1e')];var _0x450669=_0x5dcc2c?0x0:_0x4ce196[_0x6c39('0x1c')];var _0xf82b8b=_0x5dcc2c?_0x51c9d1[_0x6c39('0x1e')]:_0x4ce196['offset']+_0x4ce196['limit'];var _0x52c0fa;if(_0xf82b8b>=_0x5bfee8){_0xf82b8b=_0x5bfee8;_0x52c0fa=0xc8;}else{_0x52c0fa=0xce;}_0x50b32d[_0x6c39('0x1a')](_0x52c0fa);return _0x50b32d['set'](_0x6c39('0x1f'),_0x450669+'-'+_0xf82b8b+'/'+_0x5bfee8)['json'](_0x51c9d1);}return null;};}function patchUpdates(_0x354107){return function(_0x244f56){try{jsonpatch[_0x6c39('0x20')](_0x244f56,_0x354107,!![]);}catch(_0x1900c8){return BPromise[_0x6c39('0x21')](_0x1900c8);}return _0x244f56[_0x6c39('0x22')]();};}function saveUpdates(_0x31e363,_0x4e6791){return function(_0x9e370){if(_0x9e370){return _0x9e370[_0x6c39('0x23')](_0x31e363)[_0x6c39('0x24')](function(_0x8dd99){return _0x8dd99;});}return null;};}function removeEntity(_0x4b213c,_0x316f1c){return function(_0x48422c){if(_0x48422c){return _0x48422c['destroy']()['then'](function(){var _0x4f5321=_0x48422c[_0x6c39('0x25')]({'plain':!![]});var _0x338cd7=_0x6c39('0x26');return db[_0x6c39('0x27')][_0x6c39('0x28')]({'where':{'type':_0x338cd7,'resourceId':_0x4f5321['id']}})['then'](function(){return _0x48422c;});})[_0x6c39('0x24')](function(){_0x4b213c[_0x6c39('0x1a')](0xcc)[_0x6c39('0x1b')]();});}};}function handleEntityNotFound(_0x32d76e,_0x3355b2){return function(_0x158fbe){if(!_0x158fbe){_0x32d76e[_0x6c39('0x19')](0x194);}return _0x158fbe;};}function handleError(_0x5d3530,_0x3cb669){_0x3cb669=_0x3cb669||0x1f4;return function(_0x2ed1fb){logger['error'](_0x2ed1fb['stack']);if(_0x2ed1fb[_0x6c39('0x29')]){delete _0x2ed1fb[_0x6c39('0x29')];}_0x5d3530[_0x6c39('0x1a')](_0x3cb669)[_0x6c39('0x2a')](_0x2ed1fb);};}exports['index']=function(_0x194556,_0x7c345d){var _0x530679={},_0x16cbb9={},_0x216d4={'count':0x0,'rows':[]};var _0x30de7e=_['map'](db[_0x6c39('0x2b')][_0x6c39('0x2c')],function(_0x5474dc){return{'name':_0x5474dc[_0x6c39('0x2d')],'type':_0x5474dc['type'][_0x6c39('0x2e')]};});_0x16cbb9[_0x6c39('0x2f')]=_['map'](_0x30de7e,_0x6c39('0x29'));_0x16cbb9['query']=_[_0x6c39('0x30')](_0x194556[_0x6c39('0x31')]);_0x16cbb9[_0x6c39('0x32')]=_[_0x6c39('0x33')](_0x16cbb9[_0x6c39('0x2f')],_0x16cbb9[_0x6c39('0x31')]);_0x530679[_0x6c39('0x34')]=_[_0x6c39('0x33')](_0x16cbb9[_0x6c39('0x2f')],qs['fields'](_0x194556[_0x6c39('0x31')][_0x6c39('0x35')]));_0x530679[_0x6c39('0x34')]=_0x530679[_0x6c39('0x34')]['length']?_0x530679['attributes']:_0x16cbb9[_0x6c39('0x2f')];if(!_0x194556[_0x6c39('0x31')][_0x6c39('0x36')](_0x6c39('0x37'))){_0x530679['limit']=qs[_0x6c39('0x38')](_0x194556[_0x6c39('0x31')][_0x6c39('0x38')]);_0x530679[_0x6c39('0x1c')]=qs['offset'](_0x194556[_0x6c39('0x31')][_0x6c39('0x1c')]);}_0x530679[_0x6c39('0x39')]=qs[_0x6c39('0x3a')](_0x194556[_0x6c39('0x31')]['sort']);_0x530679[_0x6c39('0x3b')]=qs[_0x6c39('0x32')](_[_0x6c39('0x3c')](_0x194556['query'],_0x16cbb9[_0x6c39('0x32')]),_0x30de7e);if(_0x194556[_0x6c39('0x31')][_0x6c39('0x3d')]){_0x530679[_0x6c39('0x3b')]=_['merge'](_0x530679[_0x6c39('0x3b')],{'$or':_[_0x6c39('0x3e')](_0x30de7e,function(_0x27b4f7){if(_0x27b4f7[_0x6c39('0x3f')]!==_0x6c39('0x40')){var _0x47348b={};_0x47348b[_0x27b4f7[_0x6c39('0x29')]]={'$like':'%'+_0x194556[_0x6c39('0x31')][_0x6c39('0x3d')]+'%'};return _0x47348b;}})});}_0x530679=_[_0x6c39('0x41')]({},_0x530679,_0x194556[_0x6c39('0x42')]);var _0x4f74f7={'where':_0x530679[_0x6c39('0x3b')]};return db[_0x6c39('0x2b')]['count'](_0x4f74f7)['then'](function(_0x5241d5){_0x216d4['count']=_0x5241d5;if(_0x194556[_0x6c39('0x31')][_0x6c39('0x43')]){_0x530679[_0x6c39('0x44')]=[{'all':!![]}];}return db[_0x6c39('0x2b')]['findAll'](_0x530679);})[_0x6c39('0x24')](function(_0x2cde50){_0x216d4[_0x6c39('0x45')]=_0x2cde50;return _0x216d4;})[_0x6c39('0x24')](respondWithFilteredResult(_0x7c345d,_0x530679))[_0x6c39('0x46')](handleError(_0x7c345d,null));};exports[_0x6c39('0x47')]=function(_0x39d08a,_0x3bb99c){var _0x4b6348={'raw':!![],'where':{'id':_0x39d08a['params']['id']}},_0x1307e3={};_0x1307e3[_0x6c39('0x2f')]=_[_0x6c39('0x30')](db[_0x6c39('0x2b')][_0x6c39('0x2c')]);_0x1307e3[_0x6c39('0x31')]=_[_0x6c39('0x30')](_0x39d08a[_0x6c39('0x31')]);_0x1307e3[_0x6c39('0x32')]=_['intersection'](_0x1307e3[_0x6c39('0x2f')],_0x1307e3[_0x6c39('0x31')]);_0x4b6348[_0x6c39('0x34')]=_[_0x6c39('0x33')](_0x1307e3['model'],qs['fields'](_0x39d08a[_0x6c39('0x31')]['fields']));_0x4b6348['attributes']=_0x4b6348[_0x6c39('0x34')][_0x6c39('0x48')]?_0x4b6348['attributes']:_0x1307e3[_0x6c39('0x2f')];if(_0x39d08a[_0x6c39('0x31')][_0x6c39('0x43')]){_0x4b6348[_0x6c39('0x44')]=[{'all':!![]}];}_0x4b6348=_[_0x6c39('0x41')]({},_0x4b6348,_0x39d08a['options']);return db['SquareOdbc'][_0x6c39('0x49')](_0x4b6348)['then'](handleEntityNotFound(_0x3bb99c,null))[_0x6c39('0x24')](respondWithResult(_0x3bb99c,null))[_0x6c39('0x46')](handleError(_0x3bb99c,null));};exports[_0x6c39('0x4a')]=function(_0x4d4829,_0x19ec7c){return db['SquareOdbc'][_0x6c39('0x4a')](_0x4d4829[_0x6c39('0x4b')],{})['then'](function(_0x5028d4){var _0x1543da=_0x4d4829[_0x6c39('0x4c')][_0x6c39('0x25')]({'plain':!![]});if(!_0x1543da)throw new Error(_0x6c39('0x4d'));if(_0x1543da['role']===_0x6c39('0x4c')){var _0x5849ae=_0x5028d4[_0x6c39('0x25')]({'plain':!![]});var _0x4c5684=_0x6c39('0x26');return db['UserProfileSection'][_0x6c39('0x49')]({'where':{'name':_0x4c5684,'userProfileId':_0x1543da[_0x6c39('0x4e')]},'raw':!![]})[_0x6c39('0x24')](function(_0x4419bc){if(_0x4419bc&&_0x4419bc[_0x6c39('0x4f')]===0x0){return db[_0x6c39('0x27')][_0x6c39('0x4a')]({'name':_0x5849ae[_0x6c39('0x29')],'resourceId':_0x5849ae['id'],'type':_0x4419bc['name'],'sectionId':_0x4419bc['id']},{})['then'](function(){return _0x5028d4;});}else{return _0x5028d4;}})[_0x6c39('0x46')](function(_0x2ccd9a){logger['error'](_0x6c39('0x50'),_0x2ccd9a);throw _0x2ccd9a;});}return _0x5028d4;})['then'](respondWithResult(_0x19ec7c,0xc9))['catch'](handleError(_0x19ec7c,null));};exports[_0x6c39('0x23')]=function(_0x56b12e,_0x334f01){if(_0x56b12e[_0x6c39('0x4b')]['id']){delete _0x56b12e[_0x6c39('0x4b')]['id'];}return db['SquareOdbc'][_0x6c39('0x49')]({'where':{'id':_0x56b12e[_0x6c39('0x51')]['id']}})[_0x6c39('0x24')](handleEntityNotFound(_0x334f01,null))[_0x6c39('0x24')](saveUpdates(_0x56b12e[_0x6c39('0x4b')],null))['then'](respondWithResult(_0x334f01,null))[_0x6c39('0x46')](handleError(_0x334f01,null));};exports[_0x6c39('0x28')]=function(_0x329f8e,_0x12fe5d){return db['SquareOdbc']['find']({'where':{'id':_0x329f8e[_0x6c39('0x51')]['id']}})[_0x6c39('0x24')](handleEntityNotFound(_0x12fe5d,null))[_0x6c39('0x24')](removeEntity(_0x12fe5d,null))[_0x6c39('0x46')](handleError(_0x12fe5d,null));};exports[_0x6c39('0x52')]=function(_0x295aac,_0x4dda07,_0x1edc86){var _0x237ea5;return db[_0x6c39('0x2b')]['find']({'where':{'id':_0x295aac[_0x6c39('0x51')]['id']},'attributes':['id',_0x6c39('0x53')]})['then'](handleEntityNotFound(_0x4dda07,null))[_0x6c39('0x24')](function(_0x58f805){if(_0x58f805){var _0x25695e=require(_0x6c39('0x54'))();_0x25695e['openSync'](_0x58f805[_0x6c39('0x53')]);_0x25695e[_0x6c39('0x55')]();return _0x58f805;}})['then'](respondWithResult(_0x4dda07,null))['catch'](handleError(_0x4dda07,null));}; \ No newline at end of file +var _0x8d54=['order','sort','filter','where','merge','type','VIRTUAL','include','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','dsn','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','save','update','then','get','destroy','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8d54,0x73));var _0x48d5=function(_0xfafe54,_0x23c9a6){_0xfafe54=_0xfafe54-0x0;var _0x4ab8e6=_0x8d54[_0xfafe54];return _0x4ab8e6;};'use strict';var emlformat=require(_0x48d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d5('0x1'));var jsonpatch=require(_0x48d5('0x2'));var rp=require(_0x48d5('0x3'));var moment=require(_0x48d5('0x4'));var BPromise=require(_0x48d5('0x5'));var Mustache=require(_0x48d5('0x6'));var util=require(_0x48d5('0x7'));var path=require('path');var sox=require(_0x48d5('0x8'));var csv=require(_0x48d5('0x9'));var ejs=require(_0x48d5('0xa'));var fs=require('fs');var fs_extra=require(_0x48d5('0xb'));var _=require(_0x48d5('0xc'));var squel=require(_0x48d5('0xd'));var crypto=require('crypto');var jsforce=require(_0x48d5('0xe'));var deskjs=require(_0x48d5('0xf'));var toCsv=require(_0x48d5('0x9'));var querystring=require(_0x48d5('0x10'));var Papa=require(_0x48d5('0x11'));var Redis=require(_0x48d5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x48d5('0x13'));var as=require(_0x48d5('0x14'));var hardwareService=require(_0x48d5('0x15'));var logger=require(_0x48d5('0x16'))(_0x48d5('0x17'));var utils=require(_0x48d5('0x18'));var config=require(_0x48d5('0x19'));var licenseUtil=require(_0x48d5('0x1a'));var db=require(_0x48d5('0x1b'))['db'];function respondWithStatusCode(_0x792e78,_0x39eea7){_0x39eea7=_0x39eea7||0xcc;return function(_0x1bb4ed){if(_0x1bb4ed){return _0x792e78[_0x48d5('0x1c')](_0x39eea7);}return _0x792e78[_0x48d5('0x1d')](_0x39eea7)[_0x48d5('0x1e')]();};}function respondWithResult(_0x260662,_0x379536){_0x379536=_0x379536||0xc8;return function(_0x2463d6){if(_0x2463d6){return _0x260662[_0x48d5('0x1d')](_0x379536)['json'](_0x2463d6);}};}function respondWithFilteredResult(_0xbfb053,_0x7ba073){return function(_0x2a08ef){if(_0x2a08ef){var _0x2b0142=typeof _0x7ba073['offset']==='undefined'&&typeof _0x7ba073['limit']===_0x48d5('0x1f');var _0x44b484=_0x2a08ef[_0x48d5('0x20')];var _0x234821=_0x2b0142?0x0:_0x7ba073[_0x48d5('0x21')];var _0x5b354c=_0x2b0142?_0x2a08ef[_0x48d5('0x20')]:_0x7ba073[_0x48d5('0x21')]+_0x7ba073[_0x48d5('0x22')];var _0x238d28;if(_0x5b354c>=_0x44b484){_0x5b354c=_0x44b484;_0x238d28=0xc8;}else{_0x238d28=0xce;}_0xbfb053['status'](_0x238d28);return _0xbfb053[_0x48d5('0x23')]('Content-Range',_0x234821+'-'+_0x5b354c+'/'+_0x44b484)['json'](_0x2a08ef);}return null;};}function patchUpdates(_0x184954){return function(_0x4eb68b){try{jsonpatch[_0x48d5('0x24')](_0x4eb68b,_0x184954,!![]);}catch(_0x4abc9e){return BPromise['reject'](_0x4abc9e);}return _0x4eb68b[_0x48d5('0x25')]();};}function saveUpdates(_0x88a8aa,_0x47306a){return function(_0x360926){if(_0x360926){return _0x360926[_0x48d5('0x26')](_0x88a8aa)[_0x48d5('0x27')](function(_0x1fe27b){return _0x1fe27b;});}return null;};}function removeEntity(_0x4146a1,_0x33aef9){return function(_0x4b0d3c){if(_0x4b0d3c){return _0x4b0d3c['destroy']()[_0x48d5('0x27')](function(){var _0x581841=_0x4b0d3c[_0x48d5('0x28')]({'plain':!![]});var _0x2195a8='ODBC';return db['UserProfileResource'][_0x48d5('0x29')]({'where':{'type':_0x2195a8,'resourceId':_0x581841['id']}})[_0x48d5('0x27')](function(){return _0x4b0d3c;});})['then'](function(){_0x4146a1[_0x48d5('0x1d')](0xcc)[_0x48d5('0x1e')]();});}};}function handleEntityNotFound(_0x4fc9a7,_0x282f0f){return function(_0x346cb8){if(!_0x346cb8){_0x4fc9a7[_0x48d5('0x1c')](0x194);}return _0x346cb8;};}function handleError(_0x45e497,_0x5cb55b){_0x5cb55b=_0x5cb55b||0x1f4;return function(_0x13b22d){logger[_0x48d5('0x2a')](_0x13b22d[_0x48d5('0x2b')]);if(_0x13b22d[_0x48d5('0x2c')]){delete _0x13b22d[_0x48d5('0x2c')];}_0x45e497['status'](_0x5cb55b)[_0x48d5('0x2d')](_0x13b22d);};}exports['index']=function(_0x3a99a4,_0x79bb06){var _0x396076={},_0x386f9a={},_0xaecc83={'count':0x0,'rows':[]};var _0x1739b2=_[_0x48d5('0x2e')](db[_0x48d5('0x2f')][_0x48d5('0x30')],function(_0x5ba6be){return{'name':_0x5ba6be[_0x48d5('0x31')],'type':_0x5ba6be['type'][_0x48d5('0x32')]};});_0x386f9a[_0x48d5('0x33')]=_[_0x48d5('0x2e')](_0x1739b2,'name');_0x386f9a['query']=_[_0x48d5('0x34')](_0x3a99a4[_0x48d5('0x35')]);_0x386f9a[_0x48d5('0x36')]=_[_0x48d5('0x37')](_0x386f9a[_0x48d5('0x33')],_0x386f9a[_0x48d5('0x35')]);_0x396076['attributes']=_[_0x48d5('0x37')](_0x386f9a['model'],qs[_0x48d5('0x38')](_0x3a99a4[_0x48d5('0x35')]['fields']));_0x396076[_0x48d5('0x39')]=_0x396076['attributes'][_0x48d5('0x3a')]?_0x396076['attributes']:_0x386f9a[_0x48d5('0x33')];if(!_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3b')](_0x48d5('0x3c'))){_0x396076[_0x48d5('0x22')]=qs[_0x48d5('0x22')](_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x22')]);_0x396076[_0x48d5('0x21')]=qs['offset'](_0x3a99a4[_0x48d5('0x35')]['offset']);}_0x396076[_0x48d5('0x3d')]=qs['sort'](_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3e')]);_0x396076['where']=qs[_0x48d5('0x36')](_['pick'](_0x3a99a4[_0x48d5('0x35')],_0x386f9a[_0x48d5('0x36')]),_0x1739b2);if(_0x3a99a4['query'][_0x48d5('0x3f')]){_0x396076[_0x48d5('0x40')]=_[_0x48d5('0x41')](_0x396076[_0x48d5('0x40')],{'$or':_[_0x48d5('0x2e')](_0x1739b2,function(_0x53162e){if(_0x53162e[_0x48d5('0x42')]!==_0x48d5('0x43')){var _0x89b6ca={};_0x89b6ca[_0x53162e[_0x48d5('0x2c')]]={'$like':'%'+_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3f')]+'%'};return _0x89b6ca;}})});}_0x396076=_['merge']({},_0x396076,_0x3a99a4['options']);var _0x2bffa4={'where':_0x396076[_0x48d5('0x40')]};return db['SquareOdbc'][_0x48d5('0x20')](_0x2bffa4)[_0x48d5('0x27')](function(_0x413083){_0xaecc83[_0x48d5('0x20')]=_0x413083;if(_0x3a99a4['query']['includeAll']){_0x396076[_0x48d5('0x44')]=[{'all':!![]}];}return db[_0x48d5('0x2f')]['findAll'](_0x396076);})[_0x48d5('0x27')](function(_0x2a26a0){_0xaecc83[_0x48d5('0x45')]=_0x2a26a0;return _0xaecc83;})[_0x48d5('0x27')](respondWithFilteredResult(_0x79bb06,_0x396076))[_0x48d5('0x46')](handleError(_0x79bb06,null));};exports[_0x48d5('0x47')]=function(_0x361bb5,_0x4e3651){var _0x29588a={'raw':!![],'where':{'id':_0x361bb5[_0x48d5('0x48')]['id']}},_0x170671={};_0x170671[_0x48d5('0x33')]=_[_0x48d5('0x34')](db[_0x48d5('0x2f')][_0x48d5('0x30')]);_0x170671[_0x48d5('0x35')]=_[_0x48d5('0x34')](_0x361bb5['query']);_0x170671['filters']=_[_0x48d5('0x37')](_0x170671[_0x48d5('0x33')],_0x170671[_0x48d5('0x35')]);_0x29588a[_0x48d5('0x39')]=_[_0x48d5('0x37')](_0x170671[_0x48d5('0x33')],qs[_0x48d5('0x38')](_0x361bb5['query'][_0x48d5('0x38')]));_0x29588a[_0x48d5('0x39')]=_0x29588a[_0x48d5('0x39')]['length']?_0x29588a[_0x48d5('0x39')]:_0x170671[_0x48d5('0x33')];if(_0x361bb5['query']['includeAll']){_0x29588a[_0x48d5('0x44')]=[{'all':!![]}];}_0x29588a=_['merge']({},_0x29588a,_0x361bb5[_0x48d5('0x49')]);return db['SquareOdbc'][_0x48d5('0x4a')](_0x29588a)[_0x48d5('0x27')](handleEntityNotFound(_0x4e3651,null))[_0x48d5('0x27')](respondWithResult(_0x4e3651,null))['catch'](handleError(_0x4e3651,null));};exports['create']=function(_0x5be59d,_0x3f2a39){return db[_0x48d5('0x2f')][_0x48d5('0x4b')](_0x5be59d['body'],{})[_0x48d5('0x27')](function(_0x3a9a17){var _0x4d9151=_0x5be59d[_0x48d5('0x4c')][_0x48d5('0x28')]({'plain':!![]});if(!_0x4d9151)throw new Error(_0x48d5('0x4d'));if(_0x4d9151[_0x48d5('0x4e')]==='user'){var _0x2c1f7d=_0x3a9a17[_0x48d5('0x28')]({'plain':!![]});var _0x4e9eba=_0x48d5('0x4f');return db[_0x48d5('0x50')][_0x48d5('0x4a')]({'where':{'name':_0x4e9eba,'userProfileId':_0x4d9151[_0x48d5('0x51')]},'raw':!![]})[_0x48d5('0x27')](function(_0x19d512){if(_0x19d512&&_0x19d512[_0x48d5('0x52')]===0x0){return db[_0x48d5('0x53')]['create']({'name':_0x2c1f7d[_0x48d5('0x2c')],'resourceId':_0x2c1f7d['id'],'type':_0x19d512[_0x48d5('0x2c')],'sectionId':_0x19d512['id']},{})[_0x48d5('0x27')](function(){return _0x3a9a17;});}else{return _0x3a9a17;}})[_0x48d5('0x46')](function(_0x26250a){logger[_0x48d5('0x2a')](_0x48d5('0x54'),_0x26250a);throw _0x26250a;});}return _0x3a9a17;})[_0x48d5('0x27')](respondWithResult(_0x3f2a39,0xc9))[_0x48d5('0x46')](handleError(_0x3f2a39,null));};exports['update']=function(_0x27e4b3,_0x3fb51f){if(_0x27e4b3['body']['id']){delete _0x27e4b3[_0x48d5('0x55')]['id'];}return db[_0x48d5('0x2f')][_0x48d5('0x4a')]({'where':{'id':_0x27e4b3[_0x48d5('0x48')]['id']}})[_0x48d5('0x27')](handleEntityNotFound(_0x3fb51f,null))[_0x48d5('0x27')](saveUpdates(_0x27e4b3[_0x48d5('0x55')],null))[_0x48d5('0x27')](respondWithResult(_0x3fb51f,null))[_0x48d5('0x46')](handleError(_0x3fb51f,null));};exports[_0x48d5('0x29')]=function(_0x3c652d,_0x4ca4cd){return db['SquareOdbc']['find']({'where':{'id':_0x3c652d[_0x48d5('0x48')]['id']}})[_0x48d5('0x27')](handleEntityNotFound(_0x4ca4cd,null))[_0x48d5('0x27')](removeEntity(_0x4ca4cd,null))[_0x48d5('0x46')](handleError(_0x4ca4cd,null));};exports['test']=function(_0x6db36c,_0x169a45,_0x495406){var _0x3f40ca;return db[_0x48d5('0x2f')][_0x48d5('0x4a')]({'where':{'id':_0x6db36c[_0x48d5('0x48')]['id']},'attributes':['id',_0x48d5('0x56')]})[_0x48d5('0x27')](handleEntityNotFound(_0x169a45,null))[_0x48d5('0x27')](function(_0x55e289){if(_0x55e289){var _0x263c71=require('odbc')();_0x263c71[_0x48d5('0x57')](_0x55e289[_0x48d5('0x56')]);_0x263c71['closeSync']();return _0x55e289;}})[_0x48d5('0x27')](respondWithResult(_0x169a45,null))[_0x48d5('0x46')](handleError(_0x169a45,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 93609a8..461edb0 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 _0xa8c5=['rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4556c2,_0x2a5c19){var _0x543cb4=function(_0x49f0ac){while(--_0x49f0ac){_0x4556c2['push'](_0x4556c2['shift']());}};_0x543cb4(++_0x2a5c19);}(_0xa8c5,0xf0));var _0x5a8c=function(_0x5c6cff,_0xc126cd){_0x5c6cff=_0x5c6cff-0x0;var _0x2d7544=_0xa8c5[_0x5c6cff];return _0x2d7544;};'use strict';var _=require(_0x5a8c('0x0'));var util=require('util');var logger=require(_0x5a8c('0x1'))(_0x5a8c('0x2'));var moment=require(_0x5a8c('0x3'));var BPromise=require(_0x5a8c('0x4'));var rp=require(_0x5a8c('0x5'));var fs=require('fs');var path=require(_0x5a8c('0x6'));var rimraf=require(_0x5a8c('0x7'));var config=require(_0x5a8c('0x8'));var attributes=require(_0x5a8c('0x9'));module['exports']=function(_0x2d1f54,_0x170e4c){return _0x2d1f54[_0x5a8c('0xa')](_0x5a8c('0xb'),attributes,{'tableName':_0x5a8c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6003=['../../config/environment','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x6003,0x72));var _0x3600=function(_0x3a4ace,_0x2b7b0a){_0x3a4ace=_0x3a4ace-0x0;var _0x1939ae=_0x6003[_0x3a4ace];return _0x1939ae;};'use strict';var _=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var logger=require(_0x3600('0x2'))('api');var moment=require(_0x3600('0x3'));var BPromise=require(_0x3600('0x4'));var rp=require(_0x3600('0x5'));var fs=require('fs');var path=require(_0x3600('0x6'));var rimraf=require('rimraf');var config=require(_0x3600('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x25a266,_0x2b9e06){return _0x25a266[_0x3600('0x8')](_0x3600('0x9'),attributes,{'tableName':_0x3600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 52e621d..9d6dc72 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 _0x9b3d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','map','model','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x40d7af,_0x25d19d){var _0x4ddd1c=function(_0x23cae9){while(--_0x23cae9){_0x40d7af['push'](_0x40d7af['shift']());}};_0x4ddd1c(++_0x25d19d);}(_0x9b3d,0x77));var _0xd9b3=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x9b3d[_0x2ff4bd];return _0x28edc6;};'use strict';var _=require('lodash');var util=require(_0xd9b3('0x0'));var moment=require(_0xd9b3('0x1'));var BPromise=require(_0xd9b3('0x2'));var rs=require(_0xd9b3('0x3'));var fs=require('fs');var Redis=require(_0xd9b3('0x4'));var db=require(_0xd9b3('0x5'))['db'];var utils=require(_0xd9b3('0x6'));var logger=require('../../config/logger')(_0xd9b3('0x7'));var config=require(_0xd9b3('0x8'));var jayson=require(_0xd9b3('0x9'));var client=jayson[_0xd9b3('0xa')][_0xd9b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36c752,_0x2c675f,_0x50db68){return new BPromise(function(_0x13ee25,_0x57086c){return client[_0xd9b3('0xc')](_0x36c752,_0x50db68)[_0xd9b3('0xd')](function(_0x346c2f){logger[_0xd9b3('0xe')](_0xd9b3('0xf'),_0x2c675f,_0xd9b3('0x10'));logger['debug'](_0xd9b3('0x11'),_0x2c675f,_0xd9b3('0x10'),JSON['stringify'](_0x346c2f));if(_0x346c2f[_0xd9b3('0x12')]){if(_0x346c2f[_0xd9b3('0x12')]['code']===0x1f4){logger['error'](_0xd9b3('0xf'),_0x2c675f,_0x346c2f[_0xd9b3('0x12')]['message']);return _0x57086c(_0x346c2f[_0xd9b3('0x12')]['message']);}logger[_0xd9b3('0x12')](_0xd9b3('0xf'),_0x2c675f,_0x346c2f[_0xd9b3('0x12')][_0xd9b3('0x13')]);return _0x13ee25(_0x346c2f[_0xd9b3('0x12')][_0xd9b3('0x13')]);}else{logger[_0xd9b3('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x2c675f,'request\x20sent');_0x13ee25(_0x346c2f['result']['message']);}})[_0xd9b3('0x14')](function(_0x20766d){logger[_0xd9b3('0x12')](_0xd9b3('0xf'),_0x2c675f,_0x20766d);_0x57086c(_0x20766d);});});}exports[_0xd9b3('0x15')]=function(_0x25bd78){var _0x8af296=this;return new Promise(function(_0x3d8e67,_0x227e57){return db[_0xd9b3('0x16')][_0xd9b3('0x17')]({'raw':_0x25bd78[_0xd9b3('0x18')]?_0x25bd78[_0xd9b3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x25bd78[_0xd9b3('0x18')]?_0x25bd78[_0xd9b3('0x18')][_0xd9b3('0x19')]||null:null,'attributes':_0x25bd78['options']?_0x25bd78[_0xd9b3('0x18')][_0xd9b3('0x1a')]||null:null,'include':_0x25bd78['options']?_0x25bd78[_0xd9b3('0x18')][_0xd9b3('0x1b')]?_[_0xd9b3('0x1c')](_0x25bd78['options']['include'],function(_0x3f845d){return{'model':db[_0x3f845d['model']],'as':_0x3f845d['as'],'attributes':_0x3f845d[_0xd9b3('0x1a')],'include':_0x3f845d['include']?_[_0xd9b3('0x1c')](_0x3f845d['include'],function(_0x27fd73){return{'model':db[_0x27fd73[_0xd9b3('0x1d')]],'as':_0x27fd73['as'],'attributes':_0x27fd73[_0xd9b3('0x1a')],'include':_0x27fd73[_0xd9b3('0x1b')]?_[_0xd9b3('0x1c')](_0x27fd73['include'],function(_0x1f5c91){return{'model':db[_0x1f5c91[_0xd9b3('0x1d')]],'as':_0x1f5c91['as'],'attributes':_0x1f5c91[_0xd9b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9b3('0xd')](function(_0x38d1cd){logger[_0xd9b3('0xe')](_0xd9b3('0x15'),_0x25bd78);logger['debug'](_0xd9b3('0x15'),_0x25bd78,JSON[_0xd9b3('0x1e')](_0x38d1cd));_0x3d8e67(_0x38d1cd);})[_0xd9b3('0x14')](function(_0x346254){logger[_0xd9b3('0x12')](_0xd9b3('0x15'),_0x346254[_0xd9b3('0x13')],_0x25bd78);_0x227e57(_0x8af296[_0xd9b3('0x12')](0x1f4,_0x346254[_0xd9b3('0x13')]));});});}; \ No newline at end of file +var _0x48ae=['find','options','where','attributes','map','include','model','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','ShowSquareOdbc','SquareOdbc'];(function(_0x11ea6a,_0xc19308){var _0x3ba5c2=function(_0x152eef){while(--_0x152eef){_0x11ea6a['push'](_0x11ea6a['shift']());}};_0x3ba5c2(++_0xc19308);}(_0x48ae,0x147));var _0xe48a=function(_0x37be08,_0x1185ab){_0x37be08=_0x37be08-0x0;var _0xde1424=_0x48ae[_0x37be08];return _0xde1424;};'use strict';var _=require(_0xe48a('0x0'));var util=require('util');var moment=require(_0xe48a('0x1'));var BPromise=require(_0xe48a('0x2'));var rs=require(_0xe48a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe48a('0x4'));var logger=require('../../config/logger')(_0xe48a('0x5'));var config=require('../../config/environment');var jayson=require(_0xe48a('0x6'));var client=jayson['client'][_0xe48a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c2bf2,_0x2e4179,_0x5b173e){return new BPromise(function(_0x458a1c,_0x4ae12f){return client[_0xe48a('0x8')](_0x1c2bf2,_0x5b173e)['then'](function(_0x40d29a){logger[_0xe48a('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0xe48a('0xa'));logger[_0xe48a('0xb')](_0xe48a('0xc'),_0x2e4179,_0xe48a('0xa'),JSON[_0xe48a('0xd')](_0x40d29a));if(_0x40d29a[_0xe48a('0xe')]){if(_0x40d29a[_0xe48a('0xe')][_0xe48a('0xf')]===0x1f4){logger[_0xe48a('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);return _0x4ae12f(_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);}logger[_0xe48a('0xe')](_0xe48a('0x11'),_0x2e4179,_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);return _0x458a1c(_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);}else{logger[_0xe48a('0x9')](_0xe48a('0x11'),_0x2e4179,'request\x20sent');_0x458a1c(_0x40d29a[_0xe48a('0x12')][_0xe48a('0x10')]);}})['catch'](function(_0x4b76fe){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0x4b76fe);_0x4ae12f(_0x4b76fe);});});}exports[_0xe48a('0x13')]=function(_0x32a9e6){var _0x233263=this;return new Promise(function(_0xb69424,_0x18171b){return db[_0xe48a('0x14')][_0xe48a('0x15')]({'raw':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6[_0xe48a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x17')]||null:null,'attributes':_0x32a9e6['options']?_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x18')]||null:null,'include':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6['options']['include']?_[_0xe48a('0x19')](_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x1a')],function(_0x294669){return{'model':db[_0x294669[_0xe48a('0x1b')]],'as':_0x294669['as'],'attributes':_0x294669['attributes'],'include':_0x294669[_0xe48a('0x1a')]?_[_0xe48a('0x19')](_0x294669['include'],function(_0x2aea5e){return{'model':db[_0x2aea5e[_0xe48a('0x1b')]],'as':_0x2aea5e['as'],'attributes':_0x2aea5e[_0xe48a('0x18')],'include':_0x2aea5e['include']?_[_0xe48a('0x19')](_0x2aea5e['include'],function(_0x3f1619){return{'model':db[_0x3f1619[_0xe48a('0x1b')]],'as':_0x3f1619['as'],'attributes':_0x3f1619[_0xe48a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38baf2){logger[_0xe48a('0x9')](_0xe48a('0x13'),_0x32a9e6);logger[_0xe48a('0xb')](_0xe48a('0x13'),_0x32a9e6,JSON[_0xe48a('0xd')](_0x38baf2));_0xb69424(_0x38baf2);})[_0xe48a('0x1c')](function(_0x206ed8){logger['error'](_0xe48a('0x13'),_0x206ed8[_0xe48a('0x10')],_0x32a9e6);_0x18171b(_0x233263[_0xe48a('0xe')](0x1f4,_0x206ed8[_0xe48a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index d3b8837..a304230 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 _0x2fc9=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','/:id/users','getUsers','create','post','addUsers','put','update','delete'];(function(_0x440acb,_0x5dee65){var _0x4b04ab=function(_0x3da7e6){while(--_0x3da7e6){_0x440acb['push'](_0x440acb['shift']());}};_0x4b04ab(++_0x5dee65);}(_0x2fc9,0xc2));var _0x92fc=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x2fc9[_0x4cc492];return _0x1f36b9;};'use strict';var multer=require('multer');var util=require(_0x92fc('0x0'));var path=require(_0x92fc('0x1'));var timeout=require(_0x92fc('0x2'));var express=require(_0x92fc('0x3'));var router=express[_0x92fc('0x4')]();var fs_extra=require(_0x92fc('0x5'));var auth=require(_0x92fc('0x6'));var interaction=require(_0x92fc('0x7'));var config=require(_0x92fc('0x8'));var controller=require(_0x92fc('0x9'));router[_0x92fc('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x92fc('0xb'),auth[_0x92fc('0xc')](),controller[_0x92fc('0xd')]);router[_0x92fc('0xa')](_0x92fc('0xe'),auth[_0x92fc('0xc')](),controller[_0x92fc('0xf')]);router['post']('/',auth[_0x92fc('0xc')](),controller[_0x92fc('0x10')]);router[_0x92fc('0x11')]('/:id/users',auth[_0x92fc('0xc')](),controller[_0x92fc('0x12')]);router[_0x92fc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x92fc('0x14')]);router[_0x92fc('0x15')]('/:id',auth[_0x92fc('0xc')](),controller[_0x92fc('0x16')]);router[_0x92fc('0x15')](_0x92fc('0xe'),auth[_0x92fc('0xc')](),controller['removeUsers']);module[_0x92fc('0x17')]=router; \ No newline at end of file +var _0xaf30=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x1a82a4,_0x242160){var _0x4613a4=function(_0x4bdc1a){while(--_0x4bdc1a){_0x1a82a4['push'](_0x1a82a4['shift']());}};_0x4613a4(++_0x242160);}(_0xaf30,0xd0));var _0x0af3=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xaf30[_0x2605dc];return _0x4568c9;};'use strict';var multer=require('multer');var util=require(_0x0af3('0x0'));var path=require('path');var timeout=require(_0x0af3('0x1'));var express=require(_0x0af3('0x2'));var router=express[_0x0af3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0af3('0x4'));var interaction=require(_0x0af3('0x5'));var config=require(_0x0af3('0x6'));var controller=require(_0x0af3('0x7'));router[_0x0af3('0x8')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xa')]);router[_0x0af3('0x8')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xc')]);router[_0x0af3('0x8')](_0x0af3('0xd'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xe')]);router[_0x0af3('0xf')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0x10')]);router[_0x0af3('0xf')](_0x0af3('0xd'),auth['isAuthenticated'](),controller['addUsers']);router['put'](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0x11')]);router[_0x0af3('0x12')](_0x0af3('0xb'),auth['isAuthenticated'](),controller[_0x0af3('0x13')]);router[_0x0af3('0x12')](_0x0af3('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x0af3('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 81432ea..9306da1 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 _0x66c7=['sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x46e8b0,_0x4ba162){var _0x50089a=function(_0x417864){while(--_0x417864){_0x46e8b0['push'](_0x46e8b0['shift']());}};_0x50089a(++_0x4ba162);}(_0x66c7,0x15c));var _0x766c=function(_0x3b8c86,_0x1793bf){_0x3b8c86=_0x3b8c86-0x0;var _0x41a654=_0x66c7[_0x3b8c86];return _0x41a654;};'use strict';var Sequelize=require(_0x766c('0x0'));module[_0x766c('0x1')]={'name':{'type':Sequelize[_0x766c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x766c('0x2')]},'notes':{'type':Sequelize[_0x766c('0x3')]},'preproduction':{'type':Sequelize[_0x766c('0x4')](_0x766c('0x5')),'get':function(){if(this[_0x766c('0x6')](_0x766c('0x7'))){return this['getDataValue'](_0x766c('0x7'))[_0x766c('0x8')](_0x766c('0x9'));}}},'production':{'type':Sequelize[_0x766c('0x4')](_0x766c('0x5')),'get':function(){if(this[_0x766c('0x6')](_0x766c('0xa'))){return this[_0x766c('0x6')]('production')['toString'](_0x766c('0x9'));}}},'savedAt':{'type':Sequelize[_0x766c('0xb')]},'publishedAt':{'type':Sequelize[_0x766c('0xb')]}}; \ No newline at end of file +var _0x74d3=['getDataValue','toString','utf8','production','DATE','sequelize','exports','STRING','BLOB','long'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x74d3,0x159));var _0x374d=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x74d3[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x374d('0x0'));module[_0x374d('0x1')]={'name':{'type':Sequelize[_0x374d('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x374d('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x374d('0x3')](_0x374d('0x4')),'get':function(){if(this[_0x374d('0x5')]('preproduction')){return this[_0x374d('0x5')]('preproduction')[_0x374d('0x6')](_0x374d('0x7'));}}},'production':{'type':Sequelize[_0x374d('0x3')]('long'),'get':function(){if(this[_0x374d('0x5')](_0x374d('0x8'))){return this[_0x374d('0x5')]('production')['toString'](_0x374d('0x7'));}}},'savedAt':{'type':Sequelize[_0x374d('0x9')]},'publishedAt':{'type':Sequelize[_0x374d('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 560d1d2..7312eb1 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 _0x0fac=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','filter','options','include','SquareProject','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis'];(function(_0x3d043f,_0x3096ba){var _0x39537e=function(_0x130ad8){while(--_0x130ad8){_0x3d043f['push'](_0x3d043f['shift']());}};_0x39537e(++_0x3096ba);}(_0x0fac,0xa9));var _0xc0fa=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0fac[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0fa('0x0'));var zipdir=require(_0xc0fa('0x1'));var jsonpatch=require(_0xc0fa('0x2'));var rp=require(_0xc0fa('0x3'));var moment=require(_0xc0fa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc0fa('0x5'));var util=require(_0xc0fa('0x6'));var path=require('path');var sox=require(_0xc0fa('0x7'));var csv=require(_0xc0fa('0x8'));var ejs=require(_0xc0fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc0fa('0xa'));var crypto=require(_0xc0fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc0fa('0xc'));var toCsv=require(_0xc0fa('0x8'));var querystring=require(_0xc0fa('0xd'));var Papa=require('papaparse');var Redis=require(_0xc0fa('0xe'));var authService=require(_0xc0fa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc0fa('0x10'));var hardwareService=require(_0xc0fa('0x11'));var logger=require(_0xc0fa('0x12'))(_0xc0fa('0x13'));var utils=require('../../config/utils');var config=require(_0xc0fa('0x14'));var licenseUtil=require(_0xc0fa('0x15'));var db=require(_0xc0fa('0x16'))['db'];config[_0xc0fa('0x17')]=_['defaults'](config[_0xc0fa('0x17')],{'host':_0xc0fa('0x18'),'port':0x18eb});var socket=require(_0xc0fa('0x19'))(new Redis(config[_0xc0fa('0x17')]));require('./squareProject.socket')[_0xc0fa('0x1a')](socket);function respondWithStatusCode(_0x1ef6e5,_0x25b8bd){_0x25b8bd=_0x25b8bd||0xcc;return function(_0xc32e5d){if(_0xc32e5d){return _0x1ef6e5['sendStatus'](_0x25b8bd);}return _0x1ef6e5[_0xc0fa('0x1b')](_0x25b8bd)[_0xc0fa('0x1c')]();};}function respondWithResult(_0x31130a,_0x13af86){_0x13af86=_0x13af86||0xc8;return function(_0x31d5ac){if(_0x31d5ac){return _0x31130a[_0xc0fa('0x1b')](_0x13af86)[_0xc0fa('0x1d')](_0x31d5ac);}};}function respondWithFilteredResult(_0x394caa,_0x501cec){return function(_0xc88952){if(_0xc88952){var _0x2ac692=typeof _0x501cec[_0xc0fa('0x1e')]===_0xc0fa('0x1f')&&typeof _0x501cec[_0xc0fa('0x20')]==='undefined';var _0x13bd47=_0xc88952['count'];var _0x22f186=_0x2ac692?0x0:_0x501cec[_0xc0fa('0x1e')];var _0x9bc40b=_0x2ac692?_0xc88952[_0xc0fa('0x21')]:_0x501cec[_0xc0fa('0x1e')]+_0x501cec['limit'];var _0x56b89b;if(_0x9bc40b>=_0x13bd47){_0x9bc40b=_0x13bd47;_0x56b89b=0xc8;}else{_0x56b89b=0xce;}_0x394caa['status'](_0x56b89b);return _0x394caa[_0xc0fa('0x22')]('Content-Range',_0x22f186+'-'+_0x9bc40b+'/'+_0x13bd47)[_0xc0fa('0x1d')](_0xc88952);}return null;};}function patchUpdates(_0x256c4d){return function(_0x4c5dbc){try{jsonpatch['apply'](_0x4c5dbc,_0x256c4d,!![]);}catch(_0x243833){return BPromise[_0xc0fa('0x23')](_0x243833);}return _0x4c5dbc[_0xc0fa('0x24')]();};}function saveUpdates(_0x21650f,_0x7de310){return function(_0x4cc485){if(_0x4cc485){return _0x4cc485[_0xc0fa('0x25')](_0x21650f)[_0xc0fa('0x26')](function(_0x276e7f){return _0x276e7f;});}return null;};}function removeEntity(_0x320f0b,_0x291df6){return function(_0x3dd955){if(_0x3dd955){return _0x3dd955[_0xc0fa('0x27')]()[_0xc0fa('0x26')](function(){var _0x528512=_0x3dd955[_0xc0fa('0x28')]({'plain':!![]});var _0x3d3194='SquareProjects';return db['UserProfileResource'][_0xc0fa('0x27')]({'where':{'type':_0x3d3194,'resourceId':_0x528512['id']}})[_0xc0fa('0x26')](function(){return _0x3dd955;});})[_0xc0fa('0x26')](function(){_0x320f0b[_0xc0fa('0x1b')](0xcc)[_0xc0fa('0x1c')]();});}};}function handleEntityNotFound(_0x163b3c,_0x5f7ccf){return function(_0x265b05){if(!_0x265b05){_0x163b3c[_0xc0fa('0x29')](0x194);}return _0x265b05;};}function handleError(_0x108ecc,_0x818a0d){_0x818a0d=_0x818a0d||0x1f4;return function(_0x29490e){logger[_0xc0fa('0x2a')](_0x29490e[_0xc0fa('0x2b')]);if(_0x29490e[_0xc0fa('0x2c')]){delete _0x29490e[_0xc0fa('0x2c')];}_0x108ecc['status'](_0x818a0d)[_0xc0fa('0x2d')](_0x29490e);};}exports['index']=function(_0x7a751c,_0x4969a3){var _0x1623d8={},_0x15d2f4={},_0x5ba6ae={'count':0x0,'rows':[]};var _0xaa75f1=_[_0xc0fa('0x2e')](db['SquareProject'][_0xc0fa('0x2f')],function(_0x2dd3f0){return{'name':_0x2dd3f0[_0xc0fa('0x30')],'type':_0x2dd3f0[_0xc0fa('0x31')]['key']};});_0x15d2f4['model']=_[_0xc0fa('0x2e')](_0xaa75f1,_0xc0fa('0x2c'));_0x15d2f4[_0xc0fa('0x32')]=_[_0xc0fa('0x33')](_0x7a751c[_0xc0fa('0x32')]);_0x15d2f4['filters']=_[_0xc0fa('0x34')](_0x15d2f4[_0xc0fa('0x35')],_0x15d2f4['query']);_0x1623d8[_0xc0fa('0x36')]=_[_0xc0fa('0x34')](_0x15d2f4[_0xc0fa('0x35')],qs['fields'](_0x7a751c[_0xc0fa('0x32')][_0xc0fa('0x37')]));_0x1623d8[_0xc0fa('0x36')]=_0x1623d8[_0xc0fa('0x36')][_0xc0fa('0x38')]?_0x1623d8['attributes']:_0x15d2f4[_0xc0fa('0x35')];if(!_0x7a751c[_0xc0fa('0x32')]['hasOwnProperty'](_0xc0fa('0x39'))){_0x1623d8[_0xc0fa('0x20')]=qs['limit'](_0x7a751c[_0xc0fa('0x32')]['limit']);_0x1623d8['offset']=qs['offset'](_0x7a751c[_0xc0fa('0x32')][_0xc0fa('0x1e')]);}_0x1623d8[_0xc0fa('0x3a')]=qs[_0xc0fa('0x3b')](_0x7a751c[_0xc0fa('0x32')]['sort']);_0x1623d8['where']=qs[_0xc0fa('0x3c')](_[_0xc0fa('0x3d')](_0x7a751c[_0xc0fa('0x32')],_0x15d2f4[_0xc0fa('0x3c')]),_0xaa75f1);if(_0x7a751c[_0xc0fa('0x32')]['filter']){_0x1623d8[_0xc0fa('0x3e')]=_[_0xc0fa('0x3f')](_0x1623d8[_0xc0fa('0x3e')],{'$or':_[_0xc0fa('0x2e')](_0xaa75f1,function(_0x5af82d){if(_0x5af82d['type']!=='VIRTUAL'){var _0x301747={};_0x301747[_0x5af82d[_0xc0fa('0x2c')]]={'$like':'%'+_0x7a751c['query'][_0xc0fa('0x40')]+'%'};return _0x301747;}})});}_0x1623d8=_['merge']({},_0x1623d8,_0x7a751c[_0xc0fa('0x41')]);var _0x50315c={'where':_0x1623d8[_0xc0fa('0x3e')]};return db['SquareProject']['count'](_0x50315c)[_0xc0fa('0x26')](function(_0x112ee4){_0x5ba6ae[_0xc0fa('0x21')]=_0x112ee4;if(_0x7a751c[_0xc0fa('0x32')]['includeAll']){_0x1623d8[_0xc0fa('0x42')]=[{'all':!![]}];}return db[_0xc0fa('0x43')]['findAll'](_0x1623d8);})[_0xc0fa('0x26')](function(_0x1c8727){_0x5ba6ae[_0xc0fa('0x44')]=_0x1c8727;return _0x5ba6ae;})[_0xc0fa('0x26')](respondWithFilteredResult(_0x4969a3,_0x1623d8))['catch'](handleError(_0x4969a3,null));};exports[_0xc0fa('0x45')]=function(_0x42b971,_0x31708a){var _0x1054df={'raw':![],'where':{'id':_0x42b971[_0xc0fa('0x46')]['id']}},_0x5e99f0={};_0x5e99f0[_0xc0fa('0x35')]=_[_0xc0fa('0x33')](db[_0xc0fa('0x43')][_0xc0fa('0x2f')]);_0x5e99f0[_0xc0fa('0x32')]=_[_0xc0fa('0x33')](_0x42b971['query']);_0x5e99f0['filters']=_['intersection'](_0x5e99f0['model'],_0x5e99f0[_0xc0fa('0x32')]);_0x1054df['attributes']=_[_0xc0fa('0x34')](_0x5e99f0[_0xc0fa('0x35')],qs[_0xc0fa('0x37')](_0x42b971[_0xc0fa('0x32')][_0xc0fa('0x37')]));_0x1054df[_0xc0fa('0x36')]=_0x1054df[_0xc0fa('0x36')][_0xc0fa('0x38')]?_0x1054df[_0xc0fa('0x36')]:_0x5e99f0['model'];if(_0x42b971[_0xc0fa('0x32')]['includeAll']){_0x1054df[_0xc0fa('0x42')]=[{'all':!![]}];}_0x1054df=_[_0xc0fa('0x3f')]({},_0x1054df,_0x42b971[_0xc0fa('0x41')]);return db[_0xc0fa('0x43')][_0xc0fa('0x47')](_0x1054df)['then'](handleEntityNotFound(_0x31708a,null))[_0xc0fa('0x26')](respondWithResult(_0x31708a,null))['catch'](handleError(_0x31708a,null));};exports[_0xc0fa('0x48')]=function(_0x2e6128,_0x5f83c2){return db[_0xc0fa('0x43')][_0xc0fa('0x48')](_0x2e6128['body'],{})[_0xc0fa('0x26')](function(_0x3772f9){var _0x53d55a=_0x2e6128[_0xc0fa('0x49')][_0xc0fa('0x28')]({'plain':!![]});if(!_0x53d55a)throw new Error(_0xc0fa('0x4a'));if(_0x53d55a[_0xc0fa('0x4b')]===_0xc0fa('0x49')){var _0x1bb5ce=_0x3772f9[_0xc0fa('0x28')]({'plain':!![]});var _0x71814=_0xc0fa('0x4c');return db[_0xc0fa('0x4d')][_0xc0fa('0x47')]({'where':{'name':_0x71814,'userProfileId':_0x53d55a[_0xc0fa('0x4e')]},'raw':!![]})[_0xc0fa('0x26')](function(_0x1e92f9){if(_0x1e92f9&&_0x1e92f9[_0xc0fa('0x4f')]===0x0){return db['UserProfileResource'][_0xc0fa('0x48')]({'name':_0x1bb5ce['name'],'resourceId':_0x1bb5ce['id'],'type':_0x1e92f9['name'],'sectionId':_0x1e92f9['id']},{})['then'](function(){return _0x3772f9;});}else{return _0x3772f9;}})[_0xc0fa('0x50')](function(_0x5c1e57){logger[_0xc0fa('0x2a')](_0xc0fa('0x51'),_0x5c1e57);throw _0x5c1e57;});}return _0x3772f9;})['then'](respondWithResult(_0x5f83c2,0xc9))[_0xc0fa('0x50')](handleError(_0x5f83c2,null));};exports[_0xc0fa('0x25')]=function(_0x56ef96,_0x5f1fa8){if(_0x56ef96[_0xc0fa('0x52')]['id']){delete _0x56ef96[_0xc0fa('0x52')]['id'];}return db['SquareProject'][_0xc0fa('0x47')]({'where':{'id':_0x56ef96[_0xc0fa('0x46')]['id']}})[_0xc0fa('0x26')](handleEntityNotFound(_0x5f1fa8,null))['then'](saveUpdates(_0x56ef96['body'],null))[_0xc0fa('0x26')](respondWithResult(_0x5f1fa8,null))[_0xc0fa('0x50')](handleError(_0x5f1fa8,null));};exports['destroy']=function(_0x3d347d,_0x180203){return db[_0xc0fa('0x43')][_0xc0fa('0x47')]({'where':{'id':_0x3d347d['params']['id']}})['then'](handleEntityNotFound(_0x180203,null))[_0xc0fa('0x26')](removeEntity(_0x180203,null))['catch'](handleError(_0x180203,null));};exports[_0xc0fa('0x53')]=function(_0x19e337,_0x4ef56f,_0x3a2e4b){return db['SquareProject']['find']({'where':{'id':_0x19e337[_0xc0fa('0x46')]['id']}})[_0xc0fa('0x26')](handleEntityNotFound(_0x4ef56f,null))[_0xc0fa('0x26')](function(_0x329af9){if(_0x329af9){return _0x329af9[_0xc0fa('0x53')](_0x19e337[_0xc0fa('0x52')][_0xc0fa('0x54')],_[_0xc0fa('0x55')](_0x19e337[_0xc0fa('0x52')],[_0xc0fa('0x54'),'id'])||{});}})[_0xc0fa('0x26')](respondWithResult(_0x4ef56f,null))['catch'](handleError(_0x4ef56f,null));};exports['removeUsers']=function(_0xcd0c5a,_0x38c14c,_0x4e8963){return db[_0xc0fa('0x43')][_0xc0fa('0x47')]({'where':{'id':_0xcd0c5a[_0xc0fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x38c14c,null))['then'](function(_0x136fa4){if(_0x136fa4){return _0x136fa4[_0xc0fa('0x56')](_0xcd0c5a[_0xc0fa('0x32')][_0xc0fa('0x54')])['then'](function(){if(_['isArray'](_0xcd0c5a[_0xc0fa('0x32')][_0xc0fa('0x54')])){for(var _0xcf5c60=0x0;_0xcf5c60<_0xcd0c5a[_0xc0fa('0x32')][_0xc0fa('0x54')]['length'];_0xcf5c60+=0x1){socket[_0xc0fa('0x57')](_0xc0fa('0x58'),{'UserId':Number(_0xcd0c5a[_0xc0fa('0x32')][_0xc0fa('0x54')][_0xcf5c60]),'SquareProjectId':Number(_0xcd0c5a['params']['id'])});}}else{socket[_0xc0fa('0x57')](_0xc0fa('0x58'),{'UserId':Number(_0xcd0c5a[_0xc0fa('0x32')][_0xc0fa('0x54')]),'SquareProjectId':Number(_0xcd0c5a[_0xc0fa('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x38c14c,null))[_0xc0fa('0x50')](handleError(_0x38c14c,null));};exports[_0xc0fa('0x59')]=function(_0x2722ed,_0x58206e,_0x618082){var _0xcfb2a={};var _0x86e4e1={};var _0x3a14aa;var _0x5e3fb6;return db[_0xc0fa('0x43')]['findOne']({'where':{'id':_0x2722ed[_0xc0fa('0x46')]['id']}})[_0xc0fa('0x26')](handleEntityNotFound(_0x58206e,null))[_0xc0fa('0x26')](function(_0x872473){if(_0x872473){_0x3a14aa=_0x872473;_0x86e4e1[_0xc0fa('0x35')]=_[_0xc0fa('0x33')](db[_0xc0fa('0x5a')][_0xc0fa('0x2f')]);_0x86e4e1[_0xc0fa('0x32')]=_[_0xc0fa('0x33')](_0x2722ed['query']);_0x86e4e1['filters']=_['intersection'](_0x86e4e1[_0xc0fa('0x35')],_0x86e4e1[_0xc0fa('0x32')]);_0xcfb2a[_0xc0fa('0x36')]=_[_0xc0fa('0x34')](_0x86e4e1[_0xc0fa('0x35')],qs['fields'](_0x2722ed['query'][_0xc0fa('0x37')]));_0xcfb2a[_0xc0fa('0x36')]=_0xcfb2a[_0xc0fa('0x36')][_0xc0fa('0x38')]?_0xcfb2a[_0xc0fa('0x36')]:_0x86e4e1[_0xc0fa('0x35')];_0xcfb2a[_0xc0fa('0x3a')]=qs['sort'](_0x2722ed['query']['sort']);_0xcfb2a[_0xc0fa('0x3e')]=qs[_0xc0fa('0x3c')](_[_0xc0fa('0x3d')](_0x2722ed[_0xc0fa('0x32')],_0x86e4e1[_0xc0fa('0x3c')]));if(_0x2722ed[_0xc0fa('0x32')]['filter']){_0xcfb2a[_0xc0fa('0x3e')]=_[_0xc0fa('0x3f')](_0xcfb2a[_0xc0fa('0x3e')],{'$or':_[_0xc0fa('0x2e')](_0xcfb2a[_0xc0fa('0x36')],function(_0x3f1984){var _0x1b05a7={};_0x1b05a7[_0x3f1984]={'$like':'%'+_0x2722ed[_0xc0fa('0x32')]['filter']+'%'};return _0x1b05a7;})});}_0xcfb2a=_[_0xc0fa('0x3f')]({},_0xcfb2a,_0x2722ed[_0xc0fa('0x41')]);return _0x3a14aa[_0xc0fa('0x59')](_0xcfb2a);}})['then'](function(_0x1f4927){if(_0x1f4927){_0x5e3fb6=_0x1f4927['length'];if(!_0x2722ed[_0xc0fa('0x32')][_0xc0fa('0x5b')](_0xc0fa('0x39'))){_0xcfb2a[_0xc0fa('0x20')]=qs[_0xc0fa('0x20')](_0x2722ed[_0xc0fa('0x32')][_0xc0fa('0x20')]);_0xcfb2a['offset']=qs[_0xc0fa('0x1e')](_0x2722ed[_0xc0fa('0x32')][_0xc0fa('0x1e')]);}return _0x3a14aa['getUsers'](_0xcfb2a);}})[_0xc0fa('0x26')](function(_0x349897){if(_0x349897){return _0x349897?{'count':_0x5e3fb6,'rows':_0x349897}:null;}})['then'](respondWithResult(_0x58206e,null))['catch'](handleError(_0x58206e,null));}; \ No newline at end of file +var _0xf27b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','getUsers','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','SquareProjects','UserProfileResource','then','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','user'];(function(_0x431979,_0x2b3eb6){var _0x731032=function(_0x5929a8){while(--_0x5929a8){_0x431979['push'](_0x431979['shift']());}};_0x731032(++_0x2b3eb6);}(_0xf27b,0x19c));var _0xbf27=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0xf27b[_0x56a871];return _0x124954;};'use strict';var emlformat=require(_0xbf27('0x0'));var rimraf=require(_0xbf27('0x1'));var zipdir=require(_0xbf27('0x2'));var jsonpatch=require(_0xbf27('0x3'));var rp=require(_0xbf27('0x4'));var moment=require(_0xbf27('0x5'));var BPromise=require(_0xbf27('0x6'));var Mustache=require(_0xbf27('0x7'));var util=require(_0xbf27('0x8'));var path=require(_0xbf27('0x9'));var sox=require(_0xbf27('0xa'));var csv=require(_0xbf27('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf27('0xc'));var squel=require(_0xbf27('0xd'));var crypto=require(_0xbf27('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbf27('0xf'));var toCsv=require(_0xbf27('0xb'));var querystring=require(_0xbf27('0x10'));var Papa=require(_0xbf27('0x11'));var Redis=require(_0xbf27('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbf27('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbf27('0x14'));var config=require(_0xbf27('0x15'));var licenseUtil=require(_0xbf27('0x16'));var db=require('../../mysqldb')['db'];config[_0xbf27('0x17')]=_[_0xbf27('0x18')](config['redis'],{'host':_0xbf27('0x19'),'port':0x18eb});var socket=require(_0xbf27('0x1a'))(new Redis(config[_0xbf27('0x17')]));require(_0xbf27('0x1b'))[_0xbf27('0x1c')](socket);function respondWithStatusCode(_0x4fcc0d,_0x15e1a3){_0x15e1a3=_0x15e1a3||0xcc;return function(_0x2c3481){if(_0x2c3481){return _0x4fcc0d[_0xbf27('0x1d')](_0x15e1a3);}return _0x4fcc0d['status'](_0x15e1a3)[_0xbf27('0x1e')]();};}function respondWithResult(_0x4c4ee1,_0x347f6e){_0x347f6e=_0x347f6e||0xc8;return function(_0x2de75f){if(_0x2de75f){return _0x4c4ee1[_0xbf27('0x1f')](_0x347f6e)[_0xbf27('0x20')](_0x2de75f);}};}function respondWithFilteredResult(_0x41dfac,_0x6bf1e6){return function(_0xd06853){if(_0xd06853){var _0x3825e5=typeof _0x6bf1e6[_0xbf27('0x21')]===_0xbf27('0x22')&&typeof _0x6bf1e6[_0xbf27('0x23')]===_0xbf27('0x22');var _0x2afcd1=_0xd06853[_0xbf27('0x24')];var _0x1ccfde=_0x3825e5?0x0:_0x6bf1e6[_0xbf27('0x21')];var _0x79220f=_0x3825e5?_0xd06853[_0xbf27('0x24')]:_0x6bf1e6[_0xbf27('0x21')]+_0x6bf1e6[_0xbf27('0x23')];var _0xdf02d3;if(_0x79220f>=_0x2afcd1){_0x79220f=_0x2afcd1;_0xdf02d3=0xc8;}else{_0xdf02d3=0xce;}_0x41dfac['status'](_0xdf02d3);return _0x41dfac[_0xbf27('0x25')](_0xbf27('0x26'),_0x1ccfde+'-'+_0x79220f+'/'+_0x2afcd1)[_0xbf27('0x20')](_0xd06853);}return null;};}function patchUpdates(_0x205f79){return function(_0x536ec8){try{jsonpatch['apply'](_0x536ec8,_0x205f79,!![]);}catch(_0x3eb177){return BPromise[_0xbf27('0x27')](_0x3eb177);}return _0x536ec8[_0xbf27('0x28')]();};}function saveUpdates(_0x551076,_0x55fa9b){return function(_0x4ce198){if(_0x4ce198){return _0x4ce198['update'](_0x551076)['then'](function(_0x23b85b){return _0x23b85b;});}return null;};}function removeEntity(_0x4d8c6a,_0x982a39){return function(_0x237a6f){if(_0x237a6f){return _0x237a6f[_0xbf27('0x29')]()['then'](function(){var _0x9018fa=_0x237a6f['get']({'plain':!![]});var _0x32451f=_0xbf27('0x2a');return db[_0xbf27('0x2b')][_0xbf27('0x29')]({'where':{'type':_0x32451f,'resourceId':_0x9018fa['id']}})['then'](function(){return _0x237a6f;});})[_0xbf27('0x2c')](function(){_0x4d8c6a[_0xbf27('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x391514,_0x401ae4){return function(_0x2159c4){if(!_0x2159c4){_0x391514[_0xbf27('0x1d')](0x194);}return _0x2159c4;};}function handleError(_0x1fe74c,_0x4badd1){_0x4badd1=_0x4badd1||0x1f4;return function(_0x59731a){logger[_0xbf27('0x2d')](_0x59731a[_0xbf27('0x2e')]);if(_0x59731a[_0xbf27('0x2f')]){delete _0x59731a[_0xbf27('0x2f')];}_0x1fe74c['status'](_0x4badd1)[_0xbf27('0x30')](_0x59731a);};}exports[_0xbf27('0x31')]=function(_0x38e168,_0x2c63a0){var _0x8b6d9f={},_0x22030d={},_0x1e2280={'count':0x0,'rows':[]};var _0x362f05=_[_0xbf27('0x32')](db[_0xbf27('0x33')][_0xbf27('0x34')],function(_0x5a960f){return{'name':_0x5a960f[_0xbf27('0x35')],'type':_0x5a960f[_0xbf27('0x36')][_0xbf27('0x37')]};});_0x22030d[_0xbf27('0x38')]=_[_0xbf27('0x32')](_0x362f05,_0xbf27('0x2f'));_0x22030d[_0xbf27('0x39')]=_[_0xbf27('0x3a')](_0x38e168[_0xbf27('0x39')]);_0x22030d[_0xbf27('0x3b')]=_[_0xbf27('0x3c')](_0x22030d[_0xbf27('0x38')],_0x22030d[_0xbf27('0x39')]);_0x8b6d9f['attributes']=_[_0xbf27('0x3c')](_0x22030d[_0xbf27('0x38')],qs['fields'](_0x38e168[_0xbf27('0x39')][_0xbf27('0x3d')]));_0x8b6d9f[_0xbf27('0x3e')]=_0x8b6d9f[_0xbf27('0x3e')]['length']?_0x8b6d9f[_0xbf27('0x3e')]:_0x22030d['model'];if(!_0x38e168['query'][_0xbf27('0x3f')](_0xbf27('0x40'))){_0x8b6d9f[_0xbf27('0x23')]=qs[_0xbf27('0x23')](_0x38e168[_0xbf27('0x39')]['limit']);_0x8b6d9f[_0xbf27('0x21')]=qs[_0xbf27('0x21')](_0x38e168[_0xbf27('0x39')]['offset']);}_0x8b6d9f[_0xbf27('0x41')]=qs[_0xbf27('0x42')](_0x38e168[_0xbf27('0x39')][_0xbf27('0x42')]);_0x8b6d9f[_0xbf27('0x43')]=qs['filters'](_[_0xbf27('0x44')](_0x38e168[_0xbf27('0x39')],_0x22030d[_0xbf27('0x3b')]),_0x362f05);if(_0x38e168[_0xbf27('0x39')][_0xbf27('0x45')]){_0x8b6d9f[_0xbf27('0x43')]=_[_0xbf27('0x46')](_0x8b6d9f['where'],{'$or':_['map'](_0x362f05,function(_0x539f0c){if(_0x539f0c[_0xbf27('0x36')]!==_0xbf27('0x47')){var _0xb2194={};_0xb2194[_0x539f0c['name']]={'$like':'%'+_0x38e168[_0xbf27('0x39')]['filter']+'%'};return _0xb2194;}})});}_0x8b6d9f=_[_0xbf27('0x46')]({},_0x8b6d9f,_0x38e168[_0xbf27('0x48')]);var _0x34460c={'where':_0x8b6d9f[_0xbf27('0x43')]};return db[_0xbf27('0x33')][_0xbf27('0x24')](_0x34460c)[_0xbf27('0x2c')](function(_0x168ae6){_0x1e2280[_0xbf27('0x24')]=_0x168ae6;if(_0x38e168['query'][_0xbf27('0x49')]){_0x8b6d9f[_0xbf27('0x4a')]=[{'all':!![]}];}return db[_0xbf27('0x33')][_0xbf27('0x4b')](_0x8b6d9f);})['then'](function(_0x524593){_0x1e2280['rows']=_0x524593;return _0x1e2280;})[_0xbf27('0x2c')](respondWithFilteredResult(_0x2c63a0,_0x8b6d9f))[_0xbf27('0x4c')](handleError(_0x2c63a0,null));};exports[_0xbf27('0x4d')]=function(_0x2d6c33,_0x9d4773){var _0x267dee={'raw':![],'where':{'id':_0x2d6c33[_0xbf27('0x4e')]['id']}},_0xe76b4d={};_0xe76b4d[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x33')][_0xbf27('0x34')]);_0xe76b4d[_0xbf27('0x39')]=_[_0xbf27('0x3a')](_0x2d6c33[_0xbf27('0x39')]);_0xe76b4d['filters']=_[_0xbf27('0x3c')](_0xe76b4d['model'],_0xe76b4d[_0xbf27('0x39')]);_0x267dee[_0xbf27('0x3e')]=_['intersection'](_0xe76b4d[_0xbf27('0x38')],qs[_0xbf27('0x3d')](_0x2d6c33[_0xbf27('0x39')][_0xbf27('0x3d')]));_0x267dee['attributes']=_0x267dee[_0xbf27('0x3e')][_0xbf27('0x4f')]?_0x267dee[_0xbf27('0x3e')]:_0xe76b4d['model'];if(_0x2d6c33[_0xbf27('0x39')][_0xbf27('0x49')]){_0x267dee[_0xbf27('0x4a')]=[{'all':!![]}];}_0x267dee=_[_0xbf27('0x46')]({},_0x267dee,_0x2d6c33[_0xbf27('0x48')]);return db[_0xbf27('0x33')][_0xbf27('0x50')](_0x267dee)['then'](handleEntityNotFound(_0x9d4773,null))['then'](respondWithResult(_0x9d4773,null))[_0xbf27('0x4c')](handleError(_0x9d4773,null));};exports[_0xbf27('0x51')]=function(_0x925288,_0x3d6c34){return db[_0xbf27('0x33')][_0xbf27('0x51')](_0x925288['body'],{})[_0xbf27('0x2c')](function(_0x4f9bf2){var _0x9781a0=_0x925288[_0xbf27('0x52')]['get']({'plain':!![]});if(!_0x9781a0)throw new Error(_0xbf27('0x53'));if(_0x9781a0['role']==='user'){var _0x4c57c7=_0x4f9bf2[_0xbf27('0x54')]({'plain':!![]});var _0xaf6348=_0xbf27('0x2a');return db[_0xbf27('0x55')][_0xbf27('0x50')]({'where':{'name':_0xaf6348,'userProfileId':_0x9781a0[_0xbf27('0x56')]},'raw':!![]})['then'](function(_0x1ecffb){if(_0x1ecffb&&_0x1ecffb[_0xbf27('0x57')]===0x0){return db[_0xbf27('0x2b')][_0xbf27('0x51')]({'name':_0x4c57c7[_0xbf27('0x2f')],'resourceId':_0x4c57c7['id'],'type':_0x1ecffb['name'],'sectionId':_0x1ecffb['id']},{})[_0xbf27('0x2c')](function(){return _0x4f9bf2;});}else{return _0x4f9bf2;}})[_0xbf27('0x4c')](function(_0x1e0f83){logger[_0xbf27('0x2d')](_0xbf27('0x58'),_0x1e0f83);throw _0x1e0f83;});}return _0x4f9bf2;})[_0xbf27('0x2c')](respondWithResult(_0x3d6c34,0xc9))[_0xbf27('0x4c')](handleError(_0x3d6c34,null));};exports[_0xbf27('0x59')]=function(_0x10fd06,_0x2e1ba3){if(_0x10fd06[_0xbf27('0x5a')]['id']){delete _0x10fd06[_0xbf27('0x5a')]['id'];}return db['SquareProject'][_0xbf27('0x50')]({'where':{'id':_0x10fd06[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x2e1ba3,null))['then'](saveUpdates(_0x10fd06['body'],null))[_0xbf27('0x2c')](respondWithResult(_0x2e1ba3,null))[_0xbf27('0x4c')](handleError(_0x2e1ba3,null));};exports[_0xbf27('0x29')]=function(_0x11c0d3,_0x579ddb){return db[_0xbf27('0x33')][_0xbf27('0x50')]({'where':{'id':_0x11c0d3[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x579ddb,null))[_0xbf27('0x2c')](removeEntity(_0x579ddb,null))[_0xbf27('0x4c')](handleError(_0x579ddb,null));};exports[_0xbf27('0x5b')]=function(_0xca092a,_0x2b9dcb,_0x388b85){return db['SquareProject'][_0xbf27('0x50')]({'where':{'id':_0xca092a[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x2b9dcb,null))[_0xbf27('0x2c')](function(_0x2f30a1){if(_0x2f30a1){return _0x2f30a1['addUsers'](_0xca092a[_0xbf27('0x5a')][_0xbf27('0x5c')],_[_0xbf27('0x5d')](_0xca092a[_0xbf27('0x5a')],[_0xbf27('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x2b9dcb,null))['catch'](handleError(_0x2b9dcb,null));};exports[_0xbf27('0x5e')]=function(_0x3b3df7,_0x1c0db2,_0x2f0f5a){return db[_0xbf27('0x33')][_0xbf27('0x50')]({'where':{'id':_0x3b3df7[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x1c0db2,null))[_0xbf27('0x2c')](function(_0x3babae){if(_0x3babae){return _0x3babae[_0xbf27('0x5e')](_0x3b3df7['query']['ids'])['then'](function(){if(_['isArray'](_0x3b3df7['query'][_0xbf27('0x5c')])){for(var _0x2c1aeb=0x0;_0x2c1aeb<_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')]['length'];_0x2c1aeb+=0x1){socket['emit'](_0xbf27('0x5f'),{'UserId':Number(_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')][_0x2c1aeb]),'SquareProjectId':Number(_0x3b3df7[_0xbf27('0x4e')]['id'])});}}else{socket[_0xbf27('0x60')](_0xbf27('0x5f'),{'UserId':Number(_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')]),'SquareProjectId':Number(_0x3b3df7['params']['id'])});}});}})[_0xbf27('0x2c')](respondWithStatusCode(_0x1c0db2,null))[_0xbf27('0x4c')](handleError(_0x1c0db2,null));};exports[_0xbf27('0x61')]=function(_0x5a5772,_0x5a73ad,_0xfcd544){var _0x5839bf={};var _0x5b9efb={};var _0x400054;var _0x5334bb;return db['SquareProject']['findOne']({'where':{'id':_0x5a5772['params']['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x5a73ad,null))[_0xbf27('0x2c')](function(_0x5cd48c){if(_0x5cd48c){_0x400054=_0x5cd48c;_0x5b9efb[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x62')]['rawAttributes']);_0x5b9efb['query']=_[_0xbf27('0x3a')](_0x5a5772[_0xbf27('0x39')]);_0x5b9efb[_0xbf27('0x3b')]=_[_0xbf27('0x3c')](_0x5b9efb[_0xbf27('0x38')],_0x5b9efb[_0xbf27('0x39')]);_0x5839bf[_0xbf27('0x3e')]=_[_0xbf27('0x3c')](_0x5b9efb[_0xbf27('0x38')],qs[_0xbf27('0x3d')](_0x5a5772[_0xbf27('0x39')]['fields']));_0x5839bf[_0xbf27('0x3e')]=_0x5839bf['attributes'][_0xbf27('0x4f')]?_0x5839bf[_0xbf27('0x3e')]:_0x5b9efb[_0xbf27('0x38')];_0x5839bf[_0xbf27('0x41')]=qs[_0xbf27('0x42')](_0x5a5772[_0xbf27('0x39')][_0xbf27('0x42')]);_0x5839bf[_0xbf27('0x43')]=qs[_0xbf27('0x3b')](_['pick'](_0x5a5772[_0xbf27('0x39')],_0x5b9efb[_0xbf27('0x3b')]));if(_0x5a5772[_0xbf27('0x39')][_0xbf27('0x45')]){_0x5839bf[_0xbf27('0x43')]=_['merge'](_0x5839bf[_0xbf27('0x43')],{'$or':_['map'](_0x5839bf[_0xbf27('0x3e')],function(_0x391329){var _0x4fd9c0={};_0x4fd9c0[_0x391329]={'$like':'%'+_0x5a5772[_0xbf27('0x39')][_0xbf27('0x45')]+'%'};return _0x4fd9c0;})});}_0x5839bf=_[_0xbf27('0x46')]({},_0x5839bf,_0x5a5772['options']);return _0x400054[_0xbf27('0x61')](_0x5839bf);}})[_0xbf27('0x2c')](function(_0x578f5a){if(_0x578f5a){_0x5334bb=_0x578f5a[_0xbf27('0x4f')];if(!_0x5a5772[_0xbf27('0x39')][_0xbf27('0x3f')](_0xbf27('0x40'))){_0x5839bf[_0xbf27('0x23')]=qs[_0xbf27('0x23')](_0x5a5772[_0xbf27('0x39')][_0xbf27('0x23')]);_0x5839bf[_0xbf27('0x21')]=qs[_0xbf27('0x21')](_0x5a5772[_0xbf27('0x39')]['offset']);}return _0x400054[_0xbf27('0x61')](_0x5839bf);}})['then'](function(_0x2ad43d){if(_0x2ad43d){return _0x2ad43d?{'count':_0x5334bb,'rows':_0x2ad43d}:null;}})[_0xbf27('0x2c')](respondWithResult(_0x5a73ad,null))[_0xbf27('0x4c')](handleError(_0x5a73ad,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 01e2cdb..7e6cf45 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 _0x502d=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xd85e0d,_0x3de3de){var _0x3cd371=function(_0x44b5bd){while(--_0x44b5bd){_0xd85e0d['push'](_0xd85e0d['shift']());}};_0x3cd371(++_0x3de3de);}(_0x502d,0xd8));var _0xd502=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x502d[_0x4206f5];return _0xa29cf3;};'use strict';var EventEmitter=require(_0xd502('0x0'));var SquareProject=require(_0xd502('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd502('0x2')](0x0);var events={'afterCreate':_0xd502('0x3'),'afterUpdate':_0xd502('0x4'),'afterDestroy':_0xd502('0x5')};function emitEvent(_0x2bdc4f){return function(_0x4605fa,_0x46701e,_0x2183be){SquareProjectEvents[_0xd502('0x6')](_0x2bdc4f+':'+_0x4605fa['id'],_0x4605fa);SquareProjectEvents[_0xd502('0x6')](_0x2bdc4f,_0x4605fa);_0x2183be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xd502('0x7')](e,emitEvent(event));}}module[_0xd502('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x6688=['SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x584928,_0x1ce73f){var _0x4811c9=function(_0x114fe5){while(--_0x114fe5){_0x584928['push'](_0x584928['shift']());}};_0x4811c9(++_0x1ce73f);}(_0x6688,0xe7));var _0x8668=function(_0x222667,_0xe1696a){_0x222667=_0x222667-0x0;var _0x1dd77e=_0x6688[_0x222667];return _0x1dd77e;};'use strict';var EventEmitter=require(_0x8668('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x8668('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8668('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8668('0x3'),'afterDestroy':_0x8668('0x4')};function emitEvent(_0x5a1845){return function(_0x224313,_0x56594f,_0x290a30){SquareProjectEvents[_0x8668('0x5')](_0x5a1845+':'+_0x224313['id'],_0x224313);SquareProjectEvents[_0x8668('0x5')](_0x5a1845,_0x224313);_0x290a30(null);};}for(var e in events){if(events[_0x8668('0x6')](e)){var event=events[e];SquareProject[_0x8668('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index b75daf6..d505d84 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 _0xf1b3=['request-promise','path','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf1b3,0xb0));var _0x3f1b=function(_0x2b90af,_0x1ec669){_0x2b90af=_0x2b90af-0x0;var _0xcb18a2=_0xf1b3[_0x2b90af];return _0xcb18a2;};'use strict';var _=require('lodash');var util=require(_0x3f1b('0x0'));var logger=require(_0x3f1b('0x1'))('api');var moment=require(_0x3f1b('0x2'));var BPromise=require(_0x3f1b('0x3'));var rp=require(_0x3f1b('0x4'));var fs=require('fs');var path=require(_0x3f1b('0x5'));var rimraf=require('rimraf');var config=require(_0x3f1b('0x6'));var attributes=require(_0x3f1b('0x7'));module[_0x3f1b('0x8')]=function(_0x4ca38c,_0x3a4efc){return _0x4ca38c['define'](_0x3f1b('0x9'),attributes,{'tableName':_0x3f1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x915373,_0x184873,_0x17d6b1){if(_0x915373[_0x3f1b('0xb')](_0x3f1b('0xc'))){_0x915373[_0x3f1b('0xd')]=moment()[_0x3f1b('0xe')](_0x3f1b('0xf'));}if(_0x915373[_0x3f1b('0xb')](_0x3f1b('0x10'))){_0x915373[_0x3f1b('0x11')]=moment()[_0x3f1b('0xe')](_0x3f1b('0xf'));}_0x17d6b1(null,_0x915373);}}});}; \ No newline at end of file +var _0xa75a=['exports','SquareProject','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./squareProject.attributes'];(function(_0x347a6f,_0x23557d){var _0x1f5bb0=function(_0x113763){while(--_0x113763){_0x347a6f['push'](_0x347a6f['shift']());}};_0x1f5bb0(++_0x23557d);}(_0xa75a,0xe9));var _0xaa75=function(_0x15294d,_0x4f6a0d){_0x15294d=_0x15294d-0x0;var _0x4f6dab=_0xa75a[_0x15294d];return _0x4f6dab;};'use strict';var _=require('lodash');var util=require(_0xaa75('0x0'));var logger=require(_0xaa75('0x1'))(_0xaa75('0x2'));var moment=require('moment');var BPromise=require(_0xaa75('0x3'));var rp=require(_0xaa75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa75('0x5'));var attributes=require(_0xaa75('0x6'));module[_0xaa75('0x7')]=function(_0x308351,_0x776d26){return _0x308351['define'](_0xaa75('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x417c81,_0xe4fd55,_0x2f2fa0){if(_0x417c81[_0xaa75('0x9')](_0xaa75('0xa'))){_0x417c81['savedAt']=moment()[_0xaa75('0xb')](_0xaa75('0xc'));}if(_0x417c81[_0xaa75('0x9')](_0xaa75('0xd'))){_0x417c81[_0xaa75('0xe')]=moment()[_0xaa75('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2f2fa0(null,_0x417c81);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index be63988..1f066e3 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 _0x9999=['error','code','message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x9999,0xbd));var _0x9999=function(_0x2b2ff6,_0xa68f1){_0x2b2ff6=_0x2b2ff6-0x0;var _0x1b233c=_0x9999[_0x2b2ff6];return _0x1b233c;};'use strict';var _=require(_0x9999('0x0'));var util=require(_0x9999('0x1'));var moment=require(_0x9999('0x2'));var BPromise=require(_0x9999('0x3'));var rs=require(_0x9999('0x4'));var fs=require('fs');var Redis=require(_0x9999('0x5'));var db=require(_0x9999('0x6'))['db'];var utils=require(_0x9999('0x7'));var logger=require(_0x9999('0x8'))(_0x9999('0x9'));var config=require('../../config/environment');var jayson=require(_0x9999('0xa'));var client=jayson[_0x9999('0xb')]['http']({'port':0x232a});config[_0x9999('0xc')]=_['defaults'](config[_0x9999('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9999('0xd'))(new Redis(config[_0x9999('0xc')]));require(_0x9999('0xe'))[_0x9999('0xf')](socket);function respondWithRpcPromise(_0x5362a3,_0x4f0662,_0x398922){return new BPromise(function(_0x5ec041,_0x31e1d7){return client['request'](_0x5362a3,_0x398922)[_0x9999('0x10')](function(_0x192191){logger[_0x9999('0x11')](_0x9999('0x12'),_0x4f0662,_0x9999('0x13'));logger[_0x9999('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x4f0662,'request\x20sent',JSON['stringify'](_0x192191));if(_0x192191[_0x9999('0x15')]){if(_0x192191['error'][_0x9999('0x16')]===0x1f4){logger[_0x9999('0x15')]('SquareProject,\x20%s,\x20%s',_0x4f0662,_0x192191[_0x9999('0x15')]['message']);return _0x31e1d7(_0x192191[_0x9999('0x15')][_0x9999('0x17')]);}logger[_0x9999('0x15')](_0x9999('0x12'),_0x4f0662,_0x192191[_0x9999('0x15')][_0x9999('0x17')]);return _0x5ec041(_0x192191[_0x9999('0x15')]['message']);}else{logger[_0x9999('0x11')](_0x9999('0x12'),_0x4f0662,_0x9999('0x13'));_0x5ec041(_0x192191[_0x9999('0x18')][_0x9999('0x17')]);}})[_0x9999('0x19')](function(_0x50d263){logger[_0x9999('0x15')]('SquareProject,\x20%s,\x20%s',_0x4f0662,_0x50d263);_0x31e1d7(_0x50d263);});});}exports[_0x9999('0x1a')]=function(_0x356b6f){var _0x14b86f=this;return new Promise(function(_0x12ddbb,_0x3c2368){return db['SquareProject'][_0x9999('0x1b')]({'raw':_0x356b6f[_0x9999('0x1c')]?_0x356b6f['options'][_0x9999('0x1d')]===undefined?!![]:![]:!![],'where':_0x356b6f['options']?_0x356b6f['options'][_0x9999('0x1e')]||null:null,'attributes':_0x356b6f[_0x9999('0x1c')]?_0x356b6f[_0x9999('0x1c')][_0x9999('0x1f')]||null:null,'include':_0x356b6f[_0x9999('0x1c')]?_0x356b6f[_0x9999('0x1c')][_0x9999('0x20')]?_['map'](_0x356b6f['options'][_0x9999('0x20')],function(_0x498b09){return{'model':db[_0x498b09[_0x9999('0x21')]],'as':_0x498b09['as'],'attributes':_0x498b09[_0x9999('0x1f')],'include':_0x498b09['include']?_[_0x9999('0x22')](_0x498b09[_0x9999('0x20')],function(_0x375850){return{'model':db[_0x375850['model']],'as':_0x375850['as'],'attributes':_0x375850[_0x9999('0x1f')],'include':_0x375850[_0x9999('0x20')]?_[_0x9999('0x22')](_0x375850[_0x9999('0x20')],function(_0x285638){return{'model':db[_0x285638['model']],'as':_0x285638['as'],'attributes':_0x285638[_0x9999('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9999('0x10')](function(_0x519a30){logger[_0x9999('0x11')](_0x9999('0x1a'),_0x356b6f);logger[_0x9999('0x14')]('ShowSquareProject',_0x356b6f,JSON['stringify'](_0x519a30));_0x12ddbb(_0x519a30);})[_0x9999('0x19')](function(_0x208763){logger['error'](_0x9999('0x1a'),_0x208763[_0x9999('0x17')],_0x356b6f);_0x3c2368(_0x14b86f[_0x9999('0x15')](0x1f4,_0x208763[_0x9999('0x17')]));});});}; \ No newline at end of file +var _0xf77c=['options','raw','where','attributes','include','model','map','ShowSquareProject','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','then','info','request\x20sent','debug','stringify','error','SquareProject,\x20%s,\x20%s','message','result','catch'];(function(_0x19721a,_0x42e5cc){var _0x8b58e8=function(_0x9554b6){while(--_0x9554b6){_0x19721a['push'](_0x19721a['shift']());}};_0x8b58e8(++_0x42e5cc);}(_0xf77c,0x1a0));var _0xcf77=function(_0x18cf50,_0x3d88f9){_0x18cf50=_0x18cf50-0x0;var _0x408c31=_0xf77c[_0x18cf50];return _0x408c31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcf77('0x0'));var BPromise=require(_0xcf77('0x1'));var rs=require(_0xcf77('0x2'));var fs=require('fs');var Redis=require(_0xcf77('0x3'));var db=require(_0xcf77('0x4'))['db'];var utils=require(_0xcf77('0x5'));var logger=require(_0xcf77('0x6'))(_0xcf77('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf77('0x8'));var client=jayson[_0xcf77('0x9')][_0xcf77('0xa')]({'port':0x232a});config[_0xcf77('0xb')]=_[_0xcf77('0xc')](config[_0xcf77('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf77('0xd'))(new Redis(config[_0xcf77('0xb')]));require(_0xcf77('0xe'))[_0xcf77('0xf')](socket);function respondWithRpcPromise(_0x305d14,_0x251ea8,_0x17f47f){return new BPromise(function(_0x33d533,_0x3b585a){return client['request'](_0x305d14,_0x17f47f)[_0xcf77('0x10')](function(_0x370d1f){logger[_0xcf77('0x11')]('SquareProject,\x20%s,\x20%s',_0x251ea8,_0xcf77('0x12'));logger[_0xcf77('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x251ea8,_0xcf77('0x12'),JSON[_0xcf77('0x14')](_0x370d1f));if(_0x370d1f[_0xcf77('0x15')]){if(_0x370d1f[_0xcf77('0x15')]['code']===0x1f4){logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);return _0x3b585a(_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);}logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x370d1f['error'][_0xcf77('0x17')]);return _0x33d533(_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);}else{logger[_0xcf77('0x11')](_0xcf77('0x16'),_0x251ea8,'request\x20sent');_0x33d533(_0x370d1f[_0xcf77('0x18')][_0xcf77('0x17')]);}})[_0xcf77('0x19')](function(_0x526d26){logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x526d26);_0x3b585a(_0x526d26);});});}exports['ShowSquareProject']=function(_0x1c69c7){var _0x466c6c=this;return new Promise(function(_0x39d81c,_0x39980d){return db['SquareProject']['find']({'raw':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7['options'][_0xcf77('0x1c')]||null:null,'attributes':_0x1c69c7['options']?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1d')]||null:null,'include':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1e')]?_['map'](_0x1c69c7[_0xcf77('0x1a')]['include'],function(_0x5ebb69){return{'model':db[_0x5ebb69[_0xcf77('0x1f')]],'as':_0x5ebb69['as'],'attributes':_0x5ebb69[_0xcf77('0x1d')],'include':_0x5ebb69['include']?_[_0xcf77('0x20')](_0x5ebb69['include'],function(_0x25209d){return{'model':db[_0x25209d['model']],'as':_0x25209d['as'],'attributes':_0x25209d[_0xcf77('0x1d')],'include':_0x25209d['include']?_[_0xcf77('0x20')](_0x25209d[_0xcf77('0x1e')],function(_0x18c5f3){return{'model':db[_0x18c5f3[_0xcf77('0x1f')]],'as':_0x18c5f3['as'],'attributes':_0x18c5f3[_0xcf77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf77('0x10')](function(_0x6c85f2){logger[_0xcf77('0x11')]('ShowSquareProject',_0x1c69c7);logger[_0xcf77('0x13')](_0xcf77('0x21'),_0x1c69c7,JSON[_0xcf77('0x14')](_0x6c85f2));_0x39d81c(_0x6c85f2);})[_0xcf77('0x19')](function(_0x2fc6ec){logger['error'](_0xcf77('0x21'),_0x2fc6ec['message'],_0x1c69c7);_0x39980d(_0x466c6c[_0xcf77('0x15')](0x1f4,_0x2fc6ec[_0xcf77('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f0757b6..7e4ef99 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 _0xfcad=['./squareProject.events','save','remove','update','register','squareProject:'];(function(_0x53c6af,_0x1659bc){var _0x45f07d=function(_0x4943d4){while(--_0x4943d4){_0x53c6af['push'](_0x53c6af['shift']());}};_0x45f07d(++_0x1659bc);}(_0xfcad,0x192));var _0xdfca=function(_0x30db21,_0x403909){_0x30db21=_0x30db21-0x0;var _0x57e02b=_0xfcad[_0x30db21];return _0x57e02b;};'use strict';var SquareProjectEvents=require(_0xdfca('0x0'));var events=[_0xdfca('0x1'),_0xdfca('0x2'),_0xdfca('0x3')];function createListener(_0x292ed4,_0x5bc944){return function(_0x2b9459){_0x5bc944['emit'](_0x292ed4,_0x2b9459);};}function removeListener(_0x248474,_0x4669dd){return function(){SquareProjectEvents['removeListener'](_0x248474,_0x4669dd);};}exports[_0xdfca('0x4')]=function(_0x5c5f2f){for(var _0x5d9cf3=0x0,_0x217ef8=events['length'];_0x5d9cf3<_0x217ef8;_0x5d9cf3++){var _0x273321=events[_0x5d9cf3];var _0x290b85=createListener(_0xdfca('0x5')+_0x273321,_0x5c5f2f);SquareProjectEvents['on'](_0x273321,_0x290b85);}}; \ No newline at end of file +var _0x48e1=['remove','update','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0x9a29ea,_0x5b8b29){var _0x11f261=function(_0x397dea){while(--_0x397dea){_0x9a29ea['push'](_0x9a29ea['shift']());}};_0x11f261(++_0x5b8b29);}(_0x48e1,0x1de));var _0x148e=function(_0x1021ac,_0x59704f){_0x1021ac=_0x1021ac-0x0;var _0x3d0289=_0x48e1[_0x1021ac];return _0x3d0289;};'use strict';var SquareProjectEvents=require(_0x148e('0x0'));var events=[_0x148e('0x1'),_0x148e('0x2'),_0x148e('0x3')];function createListener(_0x59f1dc,_0x36d34d){return function(_0x1ac099){_0x36d34d['emit'](_0x59f1dc,_0x1ac099);};}function removeListener(_0x50d515,_0x1f80e){return function(){SquareProjectEvents[_0x148e('0x4')](_0x50d515,_0x1f80e);};}exports[_0x148e('0x5')]=function(_0x31a95d){for(var _0x5935ef=0x0,_0x59381e=events[_0x148e('0x6')];_0x5935ef<_0x59381e;_0x5935ef++){var _0x45c27f=events[_0x5935ef];var _0x824dc1=createListener(_0x148e('0x7')+_0x45c27f,_0x31a95d);SquareProjectEvents['on'](_0x45c27f,_0x824dc1);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b3debdd..939059b 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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x3991db,_0x3f3e28){var _0x31c36d=function(_0x435d5a){while(--_0x435d5a){_0x3991db['push'](_0x3991db['shift']());}};_0x31c36d(++_0x3f3e28);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x151f72,_0x3117de){_0x151f72=_0x151f72-0x0;var _0x3ee71b=_0x7fbe[_0x151f72];return _0x3ee71b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x233f8d,_0x2bbfc4){var _0x5d08f3=function(_0x236564){while(--_0x236564){_0x233f8d['push'](_0x233f8d['shift']());}};_0x5d08f3(++_0x2bbfc4);}(_0x326f,0xd1));var _0xf326=function(_0x183129,_0x2786be){_0x183129=_0x183129-0x0;var _0x23aed7=_0x326f[_0x183129];return _0x23aed7;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e230b5f..9ac27ec 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 _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0xfc61c6,_0x50fa12){var _0x1589be=function(_0x5a04fe){while(--_0x5a04fe){_0xfc61c6['push'](_0xfc61c6['shift']());}};_0x1589be(++_0x50fa12);}(_0xa41a,0x6b));var _0xaa41=function(_0x10046f,_0x1c18ba){_0x10046f=_0x10046f-0x0;var _0x5ec071=_0xa41a[_0x10046f];return _0x5ec071;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0x326f,0xd1));var _0xf326=function(_0x4dccbf,_0xe67667){_0x4dccbf=_0x4dccbf-0x0;var _0xbf83f6=_0x326f[_0x4dccbf];return _0xbf83f6;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index cfc4bd8..3e445ff 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 _0x695a=['intersection','includeAll','include','merge','find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params'];(function(_0xc14cd0,_0xd925c9){var _0x169cdd=function(_0x2e810f){while(--_0x2e810f){_0xc14cd0['push'](_0xc14cd0['shift']());}};_0x169cdd(++_0xd925c9);}(_0x695a,0x1a4));var _0xa695=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x695a[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa695('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa695('0x1'));var jsonpatch=require(_0xa695('0x2'));var rp=require(_0xa695('0x3'));var moment=require(_0xa695('0x4'));var BPromise=require(_0xa695('0x5'));var Mustache=require(_0xa695('0x6'));var util=require(_0xa695('0x7'));var path=require(_0xa695('0x8'));var sox=require(_0xa695('0x9'));var csv=require('to-csv');var ejs=require(_0xa695('0xa'));var fs=require('fs');var fs_extra=require(_0xa695('0xb'));var _=require('lodash');var squel=require(_0xa695('0xc'));var crypto=require('crypto');var jsforce=require(_0xa695('0xd'));var deskjs=require(_0xa695('0xe'));var toCsv=require(_0xa695('0xf'));var querystring=require(_0xa695('0x10'));var Papa=require(_0xa695('0x11'));var Redis=require('ioredis');var authService=require(_0xa695('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa695('0x13'));var hardwareService=require(_0xa695('0x14'));var logger=require(_0xa695('0x15'))('api');var utils=require(_0xa695('0x16'));var config=require(_0xa695('0x17'));var licenseUtil=require(_0xa695('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32cef0,_0x57bc17){_0x57bc17=_0x57bc17||0xcc;return function(_0x37b325){if(_0x37b325){return _0x32cef0[_0xa695('0x19')](_0x57bc17);}return _0x32cef0[_0xa695('0x1a')](_0x57bc17)[_0xa695('0x1b')]();};}function respondWithResult(_0x2e2d7b,_0x140276){_0x140276=_0x140276||0xc8;return function(_0x499476){if(_0x499476){return _0x2e2d7b['status'](_0x140276)[_0xa695('0x1c')](_0x499476);}};}function respondWithFilteredResult(_0x3e8c0b,_0x2d61a9){return function(_0x558a8d){if(_0x558a8d){var _0x306fe7=typeof _0x2d61a9[_0xa695('0x1d')]===_0xa695('0x1e')&&typeof _0x2d61a9[_0xa695('0x1f')]===_0xa695('0x1e');var _0x1a7315=_0x558a8d[_0xa695('0x20')];var _0x5a4d2a=_0x306fe7?0x0:_0x2d61a9[_0xa695('0x1d')];var _0xe44bdb=_0x306fe7?_0x558a8d[_0xa695('0x20')]:_0x2d61a9[_0xa695('0x1d')]+_0x2d61a9[_0xa695('0x1f')];var _0x3b48be;if(_0xe44bdb>=_0x1a7315){_0xe44bdb=_0x1a7315;_0x3b48be=0xc8;}else{_0x3b48be=0xce;}_0x3e8c0b[_0xa695('0x1a')](_0x3b48be);return _0x3e8c0b[_0xa695('0x21')](_0xa695('0x22'),_0x5a4d2a+'-'+_0xe44bdb+'/'+_0x1a7315)[_0xa695('0x1c')](_0x558a8d);}return null;};}function patchUpdates(_0x391a65){return function(_0x43a9e7){try{jsonpatch[_0xa695('0x23')](_0x43a9e7,_0x391a65,!![]);}catch(_0x477e52){return BPromise[_0xa695('0x24')](_0x477e52);}return _0x43a9e7[_0xa695('0x25')]();};}function saveUpdates(_0x155361,_0x19886a){return function(_0x585723){if(_0x585723){return _0x585723[_0xa695('0x26')](_0x155361)[_0xa695('0x27')](function(_0x5739c3){return _0x5739c3;});}return null;};}function removeEntity(_0x405a16,_0x21fa21){return function(_0xba2824){if(_0xba2824){return _0xba2824[_0xa695('0x28')]()[_0xa695('0x27')](function(){_0x405a16['status'](0xcc)[_0xa695('0x1b')]();});}};}function handleEntityNotFound(_0x5cce7e,_0x117081){return function(_0x1183f6){if(!_0x1183f6){_0x5cce7e[_0xa695('0x19')](0x194);}return _0x1183f6;};}function handleError(_0x5d8f06,_0x31c17f){_0x31c17f=_0x31c17f||0x1f4;return function(_0x1f2db8){logger['error'](_0x1f2db8[_0xa695('0x29')]);if(_0x1f2db8[_0xa695('0x2a')]){delete _0x1f2db8[_0xa695('0x2a')];}_0x5d8f06['status'](_0x31c17f)[_0xa695('0x2b')](_0x1f2db8);};}exports[_0xa695('0x2c')]=function(_0x1a99bc,_0x273cb1){var _0x5a0c05={},_0x8d2ddc={},_0x142b0e={'count':0x0,'rows':[]};var _0xeec1ec=_[_0xa695('0x2d')](db[_0xa695('0x2e')][_0xa695('0x2f')],function(_0x176c38){return{'name':_0x176c38[_0xa695('0x30')],'type':_0x176c38[_0xa695('0x31')][_0xa695('0x32')]};});_0x8d2ddc[_0xa695('0x33')]=_[_0xa695('0x2d')](_0xeec1ec,_0xa695('0x2a'));_0x8d2ddc[_0xa695('0x34')]=_[_0xa695('0x35')](_0x1a99bc[_0xa695('0x34')]);_0x8d2ddc[_0xa695('0x36')]=_['intersection'](_0x8d2ddc[_0xa695('0x33')],_0x8d2ddc[_0xa695('0x34')]);_0x5a0c05[_0xa695('0x37')]=_['intersection'](_0x8d2ddc['model'],qs[_0xa695('0x38')](_0x1a99bc[_0xa695('0x34')]['fields']));_0x5a0c05[_0xa695('0x37')]=_0x5a0c05[_0xa695('0x37')][_0xa695('0x39')]?_0x5a0c05[_0xa695('0x37')]:_0x8d2ddc[_0xa695('0x33')];if(!_0x1a99bc[_0xa695('0x34')][_0xa695('0x3a')](_0xa695('0x3b'))){_0x5a0c05[_0xa695('0x1f')]=qs[_0xa695('0x1f')](_0x1a99bc[_0xa695('0x34')][_0xa695('0x1f')]);_0x5a0c05[_0xa695('0x1d')]=qs[_0xa695('0x1d')](_0x1a99bc[_0xa695('0x34')][_0xa695('0x1d')]);}_0x5a0c05[_0xa695('0x3c')]=qs[_0xa695('0x3d')](_0x1a99bc['query']['sort']);_0x5a0c05[_0xa695('0x3e')]=qs[_0xa695('0x36')](_[_0xa695('0x3f')](_0x1a99bc['query'],_0x8d2ddc['filters']),_0xeec1ec);if(_0x1a99bc[_0xa695('0x34')]['filter']){_0x5a0c05[_0xa695('0x3e')]=_['merge'](_0x5a0c05[_0xa695('0x3e')],{'$or':_[_0xa695('0x2d')](_0xeec1ec,function(_0x8d1f6b){if(_0x8d1f6b[_0xa695('0x31')]!==_0xa695('0x40')){var _0x5d3660={};_0x5d3660[_0x8d1f6b[_0xa695('0x2a')]]={'$like':'%'+_0x1a99bc['query'][_0xa695('0x41')]+'%'};return _0x5d3660;}})});}_0x5a0c05=_['merge']({},_0x5a0c05,_0x1a99bc[_0xa695('0x42')]);var _0x3bb5bd={'where':_0x5a0c05['where']};return db[_0xa695('0x2e')][_0xa695('0x20')](_0x3bb5bd)[_0xa695('0x27')](function(_0x10c97f){_0x142b0e[_0xa695('0x20')]=_0x10c97f;if(_0x1a99bc[_0xa695('0x34')]['includeAll']){_0x5a0c05['include']=[{'all':!![]}];}return db['SquareRecording'][_0xa695('0x43')](_0x5a0c05);})[_0xa695('0x27')](function(_0x2921a0){_0x142b0e['rows']=_0x2921a0;return _0x142b0e;})[_0xa695('0x27')](respondWithFilteredResult(_0x273cb1,_0x5a0c05))[_0xa695('0x44')](handleError(_0x273cb1,null));};exports['show']=function(_0x280bf2,_0x5ce44d){var _0x3e5ae6={'raw':!![],'where':{'id':_0x280bf2[_0xa695('0x45')]['id']}},_0x29c309={};_0x29c309['model']=_[_0xa695('0x35')](db[_0xa695('0x2e')][_0xa695('0x2f')]);_0x29c309[_0xa695('0x34')]=_[_0xa695('0x35')](_0x280bf2[_0xa695('0x34')]);_0x29c309[_0xa695('0x36')]=_[_0xa695('0x46')](_0x29c309[_0xa695('0x33')],_0x29c309['query']);_0x3e5ae6['attributes']=_[_0xa695('0x46')](_0x29c309['model'],qs[_0xa695('0x38')](_0x280bf2[_0xa695('0x34')][_0xa695('0x38')]));_0x3e5ae6[_0xa695('0x37')]=_0x3e5ae6['attributes'][_0xa695('0x39')]?_0x3e5ae6['attributes']:_0x29c309[_0xa695('0x33')];if(_0x280bf2[_0xa695('0x34')][_0xa695('0x47')]){_0x3e5ae6[_0xa695('0x48')]=[{'all':!![]}];}_0x3e5ae6=_[_0xa695('0x49')]({},_0x3e5ae6,_0x280bf2['options']);return db['SquareRecording'][_0xa695('0x4a')](_0x3e5ae6)['then'](handleEntityNotFound(_0x5ce44d,null))['then'](respondWithResult(_0x5ce44d,null))[_0xa695('0x44')](handleError(_0x5ce44d,null));};exports[_0xa695('0x4b')]=function(_0x4cf8de,_0x47e621){return db['SquareRecording'][_0xa695('0x4b')](_0x4cf8de[_0xa695('0x4c')],{})[_0xa695('0x27')](respondWithResult(_0x47e621,0xc9))['catch'](handleError(_0x47e621,null));};exports[_0xa695('0x26')]=function(_0x262c3d,_0x5665b0){if(_0x262c3d['body']['id']){delete _0x262c3d['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x262c3d['params']['id']}})[_0xa695('0x27')](handleEntityNotFound(_0x5665b0,null))[_0xa695('0x27')](saveUpdates(_0x262c3d[_0xa695('0x4c')],null))[_0xa695('0x27')](respondWithResult(_0x5665b0,null))[_0xa695('0x44')](handleError(_0x5665b0,null));};exports[_0xa695('0x4d')]=function(_0x434f82,_0xa1da05,_0x1309ed){var _0x23da59=require(_0xa695('0x4e'));var _0x1f67ab=![];var _0x123c6f={};if(_0x434f82[_0xa695('0x34')][_0xa695('0x31')]&&_0x434f82[_0xa695('0x34')][_0xa695('0x31')]==='uniqueid'){_0x123c6f[_0xa695('0x4f')]=_0x434f82[_0xa695('0x45')]['id'];}else{_0x123c6f['id']=_0x434f82[_0xa695('0x45')]['id'];}return db[_0xa695('0x2e')][_0xa695('0x4a')]({'where':_0x123c6f,'attributes':['id','savePath',_0xa695('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0xa1da05,null))[_0xa695('0x27')](function(_0x4db218){if(_0x4db218){var _0x33a1df=_0x4db218[_0xa695('0x51')];var _0x43915d=util[_0xa695('0x52')]('%s.cypher',_0x33a1df);if(fs[_0xa695('0x53')](_0x43915d)){_0x1f67ab=!![];return _0x23da59[_0xa695('0x54')](_0x43915d,_0x33a1df,config[_0xa695('0x55')]['recording'])[_0xa695('0x27')](function(){return _0x4db218;});}return _0x4db218;}})[_0xa695('0x27')](function(_0x565759){if(_0x565759){var _0x1c8f45=_0x565759['savePath'];if(!fs[_0xa695('0x53')](_0x1c8f45)){throw new db[(_0xa695('0x56'))][(_0xa695('0x57'))](_0xa695('0x58'));}if(_0x565759[_0xa695('0x50')]){return _0xa1da05[_0xa695('0x4d')](_0x1c8f45,_0x565759[_0xa695('0x50')]+path['extname'](_0x1c8f45),function(){if(_0x1f67ab){fs[_0xa695('0x59')](_0x1c8f45);}});}else{return _0xa1da05[_0xa695('0x4d')](_0x1c8f45,function(_0x3de882){if(_0x1f67ab){fs[_0xa695('0x59')](_0x1c8f45);}});}}})['catch'](function(_0x143fb1){if(_0x143fb1[_0xa695('0x5a')]===_0xa695('0x58')){_0xa1da05[_0xa695('0x1a')](0x194)[_0xa695('0x2b')]('Not\x20found');}else{return handleError(_0xa1da05,null);}});};exports[_0xa695('0x28')]=function(_0x2c8426,_0x24e7a6){return db['SquareRecording'][_0xa695('0x4a')]({'where':{'id':_0x2c8426[_0xa695('0x45')]['id']}})[_0xa695('0x27')](function(_0x4ebce7){if(_['isNil'](_0x4ebce7)){throw new ReferenceError(_0xa695('0x5b'));}return _0x4ebce7;})[_0xa695('0x27')](function(_0xe8d0f){var _0x30deb8=_0xe8d0f[_0xa695('0x51')];logger[_0xa695('0x5c')](_0xa695('0x5d'),_0x30deb8);if(!_[_0xa695('0x5e')](_0xe8d0f[_0xa695('0x51')])&&fs[_0xa695('0x53')](_0x30deb8)){logger[_0xa695('0x5c')](_0xa695('0x5f')+_0x30deb8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa695('0x60')](_0x30deb8);}_0x30deb8=_0x30deb8+'.cypher';if(!_[_0xa695('0x5e')](_0xe8d0f[_0xa695('0x51')])&&fs[_0xa695('0x53')](_0x30deb8)){logger['info'](_0xa695('0x5f')+_0x30deb8+_0xa695('0x61'));fs[_0xa695('0x60')](_0x30deb8);}return _0xe8d0f;})['then'](function(_0x4284bf){if(!_0x4284bf)throw new InternalError();return _0x4284bf[_0xa695('0x28')]();})[_0xa695('0x27')](function(){_0x24e7a6[_0xa695('0x1a')](0xcc)[_0xa695('0x1b')]();})[_0xa695('0x44')](handleError(_0x24e7a6,null));}; \ No newline at end of file +var _0x9caa=['VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','params','keys','find','catch','create','body','update','download','../../components/encryptor','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x5edc5d,_0x127a44){var _0x41333d=function(_0x42aca6){while(--_0x42aca6){_0x5edc5d['push'](_0x5edc5d['shift']());}};_0x41333d(++_0x127a44);}(_0x9caa,0xe4));var _0xa9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9caa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9ca('0x0'));var zipdir=require(_0xa9ca('0x1'));var jsonpatch=require(_0xa9ca('0x2'));var rp=require(_0xa9ca('0x3'));var moment=require(_0xa9ca('0x4'));var BPromise=require(_0xa9ca('0x5'));var Mustache=require('mustache');var util=require(_0xa9ca('0x6'));var path=require(_0xa9ca('0x7'));var sox=require('sox');var csv=require(_0xa9ca('0x8'));var ejs=require(_0xa9ca('0x9'));var fs=require('fs');var fs_extra=require(_0xa9ca('0xa'));var _=require(_0xa9ca('0xb'));var squel=require(_0xa9ca('0xc'));var crypto=require(_0xa9ca('0xd'));var jsforce=require(_0xa9ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa9ca('0x8'));var querystring=require('querystring');var Papa=require(_0xa9ca('0xf'));var Redis=require(_0xa9ca('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9ca('0x11'));var hardwareService=require(_0xa9ca('0x12'));var logger=require(_0xa9ca('0x13'))('api');var utils=require(_0xa9ca('0x14'));var config=require(_0xa9ca('0x15'));var licenseUtil=require(_0xa9ca('0x16'));var db=require(_0xa9ca('0x17'))['db'];function respondWithStatusCode(_0x198f8d,_0xf9a9f2){_0xf9a9f2=_0xf9a9f2||0xcc;return function(_0x48d72e){if(_0x48d72e){return _0x198f8d['sendStatus'](_0xf9a9f2);}return _0x198f8d[_0xa9ca('0x18')](_0xf9a9f2)[_0xa9ca('0x19')]();};}function respondWithResult(_0x5c3500,_0x26b13b){_0x26b13b=_0x26b13b||0xc8;return function(_0xd047ad){if(_0xd047ad){return _0x5c3500['status'](_0x26b13b)[_0xa9ca('0x1a')](_0xd047ad);}};}function respondWithFilteredResult(_0x43a41f,_0x53d276){return function(_0x1c5f19){if(_0x1c5f19){var _0x316b92=typeof _0x53d276[_0xa9ca('0x1b')]===_0xa9ca('0x1c')&&typeof _0x53d276[_0xa9ca('0x1d')]===_0xa9ca('0x1c');var _0x24041d=_0x1c5f19[_0xa9ca('0x1e')];var _0xd2c573=_0x316b92?0x0:_0x53d276['offset'];var _0x1d0576=_0x316b92?_0x1c5f19['count']:_0x53d276['offset']+_0x53d276[_0xa9ca('0x1d')];var _0x1efd9c;if(_0x1d0576>=_0x24041d){_0x1d0576=_0x24041d;_0x1efd9c=0xc8;}else{_0x1efd9c=0xce;}_0x43a41f[_0xa9ca('0x18')](_0x1efd9c);return _0x43a41f[_0xa9ca('0x1f')](_0xa9ca('0x20'),_0xd2c573+'-'+_0x1d0576+'/'+_0x24041d)[_0xa9ca('0x1a')](_0x1c5f19);}return null;};}function patchUpdates(_0x2a3a4c){return function(_0x27d5d7){try{jsonpatch[_0xa9ca('0x21')](_0x27d5d7,_0x2a3a4c,!![]);}catch(_0x516874){return BPromise[_0xa9ca('0x22')](_0x516874);}return _0x27d5d7[_0xa9ca('0x23')]();};}function saveUpdates(_0x5927dc,_0x5b1ac9){return function(_0x59d865){if(_0x59d865){return _0x59d865['update'](_0x5927dc)[_0xa9ca('0x24')](function(_0x97059f){return _0x97059f;});}return null;};}function removeEntity(_0x149705,_0x204934){return function(_0x56ef1d){if(_0x56ef1d){return _0x56ef1d[_0xa9ca('0x25')]()[_0xa9ca('0x24')](function(){_0x149705[_0xa9ca('0x18')](0xcc)[_0xa9ca('0x19')]();});}};}function handleEntityNotFound(_0xac1636,_0x3a76f3){return function(_0x3c0f9d){if(!_0x3c0f9d){_0xac1636[_0xa9ca('0x26')](0x194);}return _0x3c0f9d;};}function handleError(_0x5d6d99,_0xdf500d){_0xdf500d=_0xdf500d||0x1f4;return function(_0x24ee19){logger[_0xa9ca('0x27')](_0x24ee19[_0xa9ca('0x28')]);if(_0x24ee19['name']){delete _0x24ee19[_0xa9ca('0x29')];}_0x5d6d99['status'](_0xdf500d)[_0xa9ca('0x2a')](_0x24ee19);};}exports['index']=function(_0x6ad711,_0x43e3d1){var _0x15fa67={},_0x91e4c8={},_0x25c935={'count':0x0,'rows':[]};var _0x241695=_['map'](db['SquareRecording']['rawAttributes'],function(_0x370a2e){return{'name':_0x370a2e[_0xa9ca('0x2b')],'type':_0x370a2e[_0xa9ca('0x2c')]['key']};});_0x91e4c8['model']=_['map'](_0x241695,_0xa9ca('0x29'));_0x91e4c8[_0xa9ca('0x2d')]=_['keys'](_0x6ad711[_0xa9ca('0x2d')]);_0x91e4c8[_0xa9ca('0x2e')]=_[_0xa9ca('0x2f')](_0x91e4c8[_0xa9ca('0x30')],_0x91e4c8[_0xa9ca('0x2d')]);_0x15fa67[_0xa9ca('0x31')]=_[_0xa9ca('0x2f')](_0x91e4c8[_0xa9ca('0x30')],qs['fields'](_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x32')]));_0x15fa67[_0xa9ca('0x31')]=_0x15fa67['attributes'][_0xa9ca('0x33')]?_0x15fa67[_0xa9ca('0x31')]:_0x91e4c8['model'];if(!_0x6ad711[_0xa9ca('0x2d')]['hasOwnProperty'](_0xa9ca('0x34'))){_0x15fa67['limit']=qs[_0xa9ca('0x1d')](_0x6ad711[_0xa9ca('0x2d')]['limit']);_0x15fa67[_0xa9ca('0x1b')]=qs['offset'](_0x6ad711['query'][_0xa9ca('0x1b')]);}_0x15fa67[_0xa9ca('0x35')]=qs[_0xa9ca('0x36')](_0x6ad711[_0xa9ca('0x2d')]['sort']);_0x15fa67[_0xa9ca('0x37')]=qs[_0xa9ca('0x2e')](_[_0xa9ca('0x38')](_0x6ad711[_0xa9ca('0x2d')],_0x91e4c8[_0xa9ca('0x2e')]),_0x241695);if(_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x39')]){_0x15fa67['where']=_[_0xa9ca('0x3a')](_0x15fa67['where'],{'$or':_[_0xa9ca('0x3b')](_0x241695,function(_0x388683){if(_0x388683[_0xa9ca('0x2c')]!==_0xa9ca('0x3c')){var _0x535b11={};_0x535b11[_0x388683['name']]={'$like':'%'+_0x6ad711['query']['filter']+'%'};return _0x535b11;}})});}_0x15fa67=_['merge']({},_0x15fa67,_0x6ad711[_0xa9ca('0x3d')]);var _0x202911={'where':_0x15fa67[_0xa9ca('0x37')]};return db['SquareRecording'][_0xa9ca('0x1e')](_0x202911)['then'](function(_0x34fab3){_0x25c935[_0xa9ca('0x1e')]=_0x34fab3;if(_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x3e')]){_0x15fa67[_0xa9ca('0x3f')]=[{'all':!![]}];}return db[_0xa9ca('0x40')][_0xa9ca('0x41')](_0x15fa67);})[_0xa9ca('0x24')](function(_0x1516ac){_0x25c935[_0xa9ca('0x42')]=_0x1516ac;return _0x25c935;})[_0xa9ca('0x24')](respondWithFilteredResult(_0x43e3d1,_0x15fa67))['catch'](handleError(_0x43e3d1,null));};exports['show']=function(_0x3dda05,_0x554adb){var _0x1e4a2a={'raw':!![],'where':{'id':_0x3dda05[_0xa9ca('0x43')]['id']}},_0x482a19={};_0x482a19[_0xa9ca('0x30')]=_[_0xa9ca('0x44')](db[_0xa9ca('0x40')]['rawAttributes']);_0x482a19[_0xa9ca('0x2d')]=_[_0xa9ca('0x44')](_0x3dda05['query']);_0x482a19[_0xa9ca('0x2e')]=_[_0xa9ca('0x2f')](_0x482a19[_0xa9ca('0x30')],_0x482a19['query']);_0x1e4a2a[_0xa9ca('0x31')]=_['intersection'](_0x482a19[_0xa9ca('0x30')],qs[_0xa9ca('0x32')](_0x3dda05[_0xa9ca('0x2d')]['fields']));_0x1e4a2a['attributes']=_0x1e4a2a[_0xa9ca('0x31')][_0xa9ca('0x33')]?_0x1e4a2a[_0xa9ca('0x31')]:_0x482a19[_0xa9ca('0x30')];if(_0x3dda05[_0xa9ca('0x2d')][_0xa9ca('0x3e')]){_0x1e4a2a[_0xa9ca('0x3f')]=[{'all':!![]}];}_0x1e4a2a=_[_0xa9ca('0x3a')]({},_0x1e4a2a,_0x3dda05[_0xa9ca('0x3d')]);return db[_0xa9ca('0x40')][_0xa9ca('0x45')](_0x1e4a2a)[_0xa9ca('0x24')](handleEntityNotFound(_0x554adb,null))[_0xa9ca('0x24')](respondWithResult(_0x554adb,null))[_0xa9ca('0x46')](handleError(_0x554adb,null));};exports[_0xa9ca('0x47')]=function(_0x487684,_0x216bab){return db[_0xa9ca('0x40')][_0xa9ca('0x47')](_0x487684[_0xa9ca('0x48')],{})['then'](respondWithResult(_0x216bab,0xc9))[_0xa9ca('0x46')](handleError(_0x216bab,null));};exports[_0xa9ca('0x49')]=function(_0x18475b,_0x281386){if(_0x18475b[_0xa9ca('0x48')]['id']){delete _0x18475b['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x18475b[_0xa9ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x281386,null))[_0xa9ca('0x24')](saveUpdates(_0x18475b['body'],null))[_0xa9ca('0x24')](respondWithResult(_0x281386,null))[_0xa9ca('0x46')](handleError(_0x281386,null));};exports[_0xa9ca('0x4a')]=function(_0x3c3c52,_0x34d1fc,_0x11dd00){var _0x1919b5=require(_0xa9ca('0x4b'));var _0x476494=![];var _0x9a7c5b={};if(_0x3c3c52[_0xa9ca('0x2d')][_0xa9ca('0x2c')]&&_0x3c3c52['query'][_0xa9ca('0x2c')]==='uniqueid'){_0x9a7c5b['uniqueid']=_0x3c3c52[_0xa9ca('0x43')]['id'];}else{_0x9a7c5b['id']=_0x3c3c52[_0xa9ca('0x43')]['id'];}return db[_0xa9ca('0x40')][_0xa9ca('0x45')]({'where':_0x9a7c5b,'attributes':['id',_0xa9ca('0x4c'),'filename'],'raw':!![]})[_0xa9ca('0x24')](handleEntityNotFound(_0x34d1fc,null))[_0xa9ca('0x24')](function(_0x2d97b6){if(_0x2d97b6){var _0x1c84ec=_0x2d97b6[_0xa9ca('0x4c')];var _0xa89d9d=util['format'](_0xa9ca('0x4d'),_0x1c84ec);if(fs['existsSync'](_0xa89d9d)){_0x476494=!![];return _0x1919b5[_0xa9ca('0x4e')](_0xa89d9d,_0x1c84ec,config[_0xa9ca('0x4f')][_0xa9ca('0x50')])[_0xa9ca('0x24')](function(){return _0x2d97b6;});}return _0x2d97b6;}})['then'](function(_0x38e64f){if(_0x38e64f){var _0x3f19dc=_0x38e64f['savePath'];if(!fs[_0xa9ca('0x51')](_0x3f19dc)){throw new db[(_0xa9ca('0x52'))][(_0xa9ca('0x53'))](_0xa9ca('0x54'));}if(_0x38e64f['filename']){return _0x34d1fc[_0xa9ca('0x4a')](_0x3f19dc,_0x38e64f['filename']+path['extname'](_0x3f19dc),function(){if(_0x476494){fs[_0xa9ca('0x55')](_0x3f19dc);}});}else{return _0x34d1fc[_0xa9ca('0x4a')](_0x3f19dc,function(_0x4fa778){if(_0x476494){fs[_0xa9ca('0x55')](_0x3f19dc);}});}}})[_0xa9ca('0x46')](function(_0x43a17d){if(_0x43a17d[_0xa9ca('0x56')]===_0xa9ca('0x54')){_0x34d1fc['status'](0x194)[_0xa9ca('0x2a')](_0xa9ca('0x57'));}else{return handleError(_0x34d1fc,null);}});};exports[_0xa9ca('0x25')]=function(_0x4e697d,_0x557d54){return db[_0xa9ca('0x40')][_0xa9ca('0x45')]({'where':{'id':_0x4e697d[_0xa9ca('0x43')]['id']}})['then'](function(_0x232870){if(_[_0xa9ca('0x58')](_0x232870)){throw new ReferenceError(_0xa9ca('0x59'));}return _0x232870;})[_0xa9ca('0x24')](function(_0x2405b3){var _0x5f26f4=_0x2405b3[_0xa9ca('0x4c')];logger['info'](_0xa9ca('0x5a'),_0x5f26f4);if(!_[_0xa9ca('0x58')](_0x2405b3[_0xa9ca('0x4c')])&&fs[_0xa9ca('0x51')](_0x5f26f4)){logger['info'](_0xa9ca('0x5b')+_0x5f26f4+_0xa9ca('0x5c'));fs['unlinkSync'](_0x5f26f4);}_0x5f26f4=_0x5f26f4+_0xa9ca('0x5d');if(!_[_0xa9ca('0x58')](_0x2405b3['savePath'])&&fs[_0xa9ca('0x51')](_0x5f26f4)){logger[_0xa9ca('0x5e')](_0xa9ca('0x5b')+_0x5f26f4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa9ca('0x5f')](_0x5f26f4);}return _0x2405b3;})[_0xa9ca('0x24')](function(_0x5f150f){if(!_0x5f150f)throw new InternalError();return _0x5f150f[_0xa9ca('0x25')]();})['then'](function(){_0x557d54[_0xa9ca('0x18')](0xcc)[_0xa9ca('0x19')]();})[_0xa9ca('0x46')](handleError(_0x557d54,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 761d2c6..3d2fd03 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 _0x5324=['./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x54dadc,_0x3a849d){var _0xccb3c8=function(_0x160e02){while(--_0x160e02){_0x54dadc['push'](_0x54dadc['shift']());}};_0xccb3c8(++_0x3a849d);}(_0x5324,0x154));var _0x4532=function(_0x44a270,_0x67c506){_0x44a270=_0x44a270-0x0;var _0x22491=_0x5324[_0x44a270];return _0x22491;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var logger=require(_0x4532('0x2'))(_0x4532('0x3'));var moment=require('moment');var BPromise=require(_0x4532('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4532('0x5'));var rimraf=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var attributes=require(_0x4532('0x8'));module[_0x4532('0x9')]=function(_0x3f68e2,_0x2672ec){return _0x3f68e2[_0x4532('0xa')]('SquareRecording',attributes,{'tableName':_0x4532('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7409=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x460d45,_0x14a515){var _0x1694da=function(_0x3831c7){while(--_0x3831c7){_0x460d45['push'](_0x460d45['shift']());}};_0x1694da(++_0x14a515);}(_0x7409,0x6e));var _0x9740=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x7409[_0xd050c6];return _0x7278a;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var logger=require('../../config/logger')(_0x9740('0x2'));var moment=require(_0x9740('0x3'));var BPromise=require(_0x9740('0x4'));var rp=require(_0x9740('0x5'));var fs=require('fs');var path=require(_0x9740('0x6'));var rimraf=require(_0x9740('0x7'));var config=require(_0x9740('0x8'));var attributes=require(_0x9740('0x9'));module[_0x9740('0xa')]=function(_0x547490,_0x19865c){return _0x547490[_0x9740('0xb')](_0x9740('0xc'),attributes,{'tableName':'square_recordings','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 bf3791a..2a293b6 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 _0xd1a1=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareRecording','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x3476e5,_0x16d931){var _0x2f75e7=function(_0x55ccf8){while(--_0x55ccf8){_0x3476e5['push'](_0x3476e5['shift']());}};_0x2f75e7(++_0x16d931);}(_0xd1a1,0x129));var _0x1d1a=function(_0x4279f2,_0x613d14){_0x4279f2=_0x4279f2-0x0;var _0x118d8f=_0xd1a1[_0x4279f2];return _0x118d8f;};'use strict';var _=require('lodash');var util=require(_0x1d1a('0x0'));var moment=require(_0x1d1a('0x1'));var BPromise=require(_0x1d1a('0x2'));var rs=require(_0x1d1a('0x3'));var fs=require('fs');var Redis=require(_0x1d1a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d1a('0x5'));var logger=require(_0x1d1a('0x6'))(_0x1d1a('0x7'));var config=require(_0x1d1a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d1a('0x9')][_0x1d1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43e0fe,_0x59a903,_0x485a63){return new BPromise(function(_0x37f1e6,_0x2338ae){return client['request'](_0x43e0fe,_0x485a63)[_0x1d1a('0xb')](function(_0x372002){logger[_0x1d1a('0xc')](_0x1d1a('0xd'),_0x59a903,_0x1d1a('0xe'));logger[_0x1d1a('0xf')](_0x1d1a('0x10'),_0x59a903,'request\x20sent',JSON['stringify'](_0x372002));if(_0x372002['error']){if(_0x372002[_0x1d1a('0x11')]['code']===0x1f4){logger[_0x1d1a('0x11')](_0x1d1a('0xd'),_0x59a903,_0x372002[_0x1d1a('0x11')][_0x1d1a('0x12')]);return _0x2338ae(_0x372002[_0x1d1a('0x11')][_0x1d1a('0x12')]);}logger[_0x1d1a('0x11')]('SquareRecording,\x20%s,\x20%s',_0x59a903,_0x372002['error'][_0x1d1a('0x12')]);return _0x37f1e6(_0x372002['error'][_0x1d1a('0x12')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x59a903,'request\x20sent');_0x37f1e6(_0x372002[_0x1d1a('0x13')]['message']);}})[_0x1d1a('0x14')](function(_0x496bb1){logger['error']('SquareRecording,\x20%s,\x20%s',_0x59a903,_0x496bb1);_0x2338ae(_0x496bb1);});});}exports[_0x1d1a('0x15')]=function(_0x54fc21){var _0x4212c7=this;return new Promise(function(_0x5e8095,_0x4429ec){return db['SquareRecording'][_0x1d1a('0x16')](_0x54fc21[_0x1d1a('0x17')],{'raw':_0x54fc21[_0x1d1a('0x18')]?_0x54fc21['options'][_0x1d1a('0x19')]===undefined?!![]:![]:!![]})[_0x1d1a('0xb')](function(_0xaa871d){logger[_0x1d1a('0xc')](_0x1d1a('0x15'),_0x54fc21);logger[_0x1d1a('0xf')]('CreateSquareRecording',_0x54fc21,JSON['stringify'](_0xaa871d));_0x5e8095(_0xaa871d);})[_0x1d1a('0x14')](function(_0x507fdd){logger['error'](_0x1d1a('0x15'),_0x507fdd['message'],_0x54fc21);_0x4429ec(_0x4212c7[_0x1d1a('0x11')](0x1f4,_0x507fdd[_0x1d1a('0x12')]));});});}; \ No newline at end of file +var _0x88ad=['error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','stringify'];(function(_0x30e167,_0x24d5a7){var _0x54a401=function(_0x4737d5){while(--_0x4737d5){_0x30e167['push'](_0x30e167['shift']());}};_0x54a401(++_0x24d5a7);}(_0x88ad,0x137));var _0xd88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88ad[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd88a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd88a('0x1'));var fs=require('fs');var Redis=require(_0xd88a('0x2'));var db=require(_0xd88a('0x3'))['db'];var utils=require(_0xd88a('0x4'));var logger=require(_0xd88a('0x5'))(_0xd88a('0x6'));var config=require(_0xd88a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x279d3f,_0x3fb1af,_0x1598b1){return new BPromise(function(_0x35b4fd,_0x598b03){return client[_0xd88a('0x8')](_0x279d3f,_0x1598b1)[_0xd88a('0x9')](function(_0x3b560b){logger[_0xd88a('0xa')]('SquareRecording,\x20%s,\x20%s',_0x3fb1af,_0xd88a('0xb'));logger[_0xd88a('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3fb1af,'request\x20sent',JSON[_0xd88a('0xd')](_0x3b560b));if(_0x3b560b['error']){if(_0x3b560b[_0xd88a('0xe')][_0xd88a('0xf')]===0x1f4){logger['error'](_0xd88a('0x10'),_0x3fb1af,_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);return _0x598b03(_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);}logger[_0xd88a('0xe')](_0xd88a('0x10'),_0x3fb1af,_0x3b560b[_0xd88a('0xe')]['message']);return _0x35b4fd(_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);}else{logger[_0xd88a('0xa')](_0xd88a('0x10'),_0x3fb1af,_0xd88a('0xb'));_0x35b4fd(_0x3b560b[_0xd88a('0x12')][_0xd88a('0x11')]);}})[_0xd88a('0x13')](function(_0x5138ab){logger[_0xd88a('0xe')](_0xd88a('0x10'),_0x3fb1af,_0x5138ab);_0x598b03(_0x5138ab);});});}exports[_0xd88a('0x14')]=function(_0x588713){var _0x15f7fd=this;return new Promise(function(_0x17413a,_0x4761c5){return db[_0xd88a('0x15')][_0xd88a('0x16')](_0x588713['body'],{'raw':_0x588713[_0xd88a('0x17')]?_0x588713['options'][_0xd88a('0x18')]===undefined?!![]:![]:!![]})[_0xd88a('0x9')](function(_0x145e4f){logger[_0xd88a('0xa')](_0xd88a('0x14'),_0x588713);logger[_0xd88a('0xc')]('CreateSquareRecording',_0x588713,JSON[_0xd88a('0xd')](_0x145e4f));_0x17413a(_0x145e4f);})[_0xd88a('0x13')](function(_0x102679){logger['error']('CreateSquareRecording',_0x102679[_0xd88a('0x11')],_0x588713);_0x4761c5(_0x15f7fd['error'](0x1f4,_0x102679[_0xd88a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3dc9b04..65475ea 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x567b1e,_0x5c5f62){var _0x30a32d=function(_0x3ab6e9){while(--_0x3ab6e9){_0x567b1e['push'](_0x567b1e['shift']());}};_0x30a32d(++_0x5c5f62);}(_0xe706,0xa3));var _0x6e70=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xe706[_0xcfc44];return _0x307a25;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x536755,_0x3bfa50){var _0x2b9dde=function(_0xe1efcc){while(--_0xe1efcc){_0x536755['push'](_0x536755['shift']());}};_0x2b9dde(++_0x3bfa50);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 859aa61..2c5428a 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 _0x152e=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x45a73d,_0x5000aa){var _0x3b7492=function(_0x5ee5fb){while(--_0x5ee5fb){_0x45a73d['push'](_0x45a73d['shift']());}};_0x3b7492(++_0x5000aa);}(_0x152e,0x10e));var _0xe152=function(_0x4009ae,_0x24e376){_0x4009ae=_0x4009ae-0x0;var _0x31275a=_0x152e[_0x4009ae];return _0x31275a;};'use strict';var Sequelize=require(_0xe152('0x0'));module[_0xe152('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xe152('0x2')]},'request':{'type':Sequelize[_0xe152('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe152('0x2')]},'type':{'type':Sequelize[_0xe152('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xe152('0x2')]},'callerid':{'type':Sequelize[_0xe152('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xe152('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xe152('0x2')]},'dnid':{'type':Sequelize[_0xe152('0x2')]},'rdnis':{'type':Sequelize[_0xe152('0x2')]},'context':{'type':Sequelize[_0xe152('0x2')]},'extension':{'type':Sequelize[_0xe152('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe152('0x2')]},'threadid':{'type':Sequelize[_0xe152('0x2')]},'project_name':{'type':Sequelize[_0xe152('0x2')]},'joinAt':{'type':Sequelize[_0xe152('0x3')]},'leaveAt':{'type':Sequelize[_0xe152('0x3')]},'bot':{'type':Sequelize[_0xe152('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8149=['DATE','sequelize','exports','STRING'];(function(_0x399178,_0x3ecc26){var _0x4ccc64=function(_0x3f97df){while(--_0x3f97df){_0x399178['push'](_0x399178['shift']());}};_0x4ccc64(++_0x3ecc26);}(_0x8149,0x149));var _0x9814=function(_0x48d26a,_0x2487be){_0x48d26a=_0x48d26a-0x0;var _0x52087c=_0x8149[_0x48d26a];return _0x52087c;};'use strict';var Sequelize=require(_0x9814('0x0'));module[_0x9814('0x1')]={'network':{'type':Sequelize[_0x9814('0x2')]},'network_script':{'type':Sequelize[_0x9814('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9814('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9814('0x2')]},'uniqueid':{'type':Sequelize[_0x9814('0x2')]},'version':{'type':Sequelize[_0x9814('0x2')]},'callerid':{'type':Sequelize[_0x9814('0x2')]},'calleridname':{'type':Sequelize[_0x9814('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x9814('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x9814('0x2')]},'rdnis':{'type':Sequelize[_0x9814('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9814('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9814('0x2')]},'threadid':{'type':Sequelize[_0x9814('0x2')]},'project_name':{'type':Sequelize[_0x9814('0x2')]},'joinAt':{'type':Sequelize[_0x9814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 172c683..ee60212 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 _0x4fd2=['moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','include','rows','catch','show','keys','intersection','includeAll','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5c1c46,_0x3e2217){var _0x1b38c3=function(_0x204068){while(--_0x204068){_0x5c1c46['push'](_0x5c1c46['shift']());}};_0x1b38c3(++_0x3e2217);}(_0x4fd2,0x17d));var _0x24fd=function(_0xbfbbf8,_0x9de942){_0xbfbbf8=_0xbfbbf8-0x0;var _0x47094d=_0x4fd2[_0xbfbbf8];return _0x47094d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24fd('0x0'));var zipdir=require(_0x24fd('0x1'));var jsonpatch=require(_0x24fd('0x2'));var rp=require(_0x24fd('0x3'));var moment=require(_0x24fd('0x4'));var BPromise=require(_0x24fd('0x5'));var Mustache=require(_0x24fd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x24fd('0x7'));var csv=require('to-csv');var ejs=require(_0x24fd('0x8'));var fs=require('fs');var fs_extra=require(_0x24fd('0x9'));var _=require('lodash');var squel=require(_0x24fd('0xa'));var crypto=require(_0x24fd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x24fd('0xc'));var toCsv=require(_0x24fd('0xd'));var querystring=require(_0x24fd('0xe'));var Papa=require(_0x24fd('0xf'));var Redis=require(_0x24fd('0x10'));var authService=require(_0x24fd('0x11'));var qs=require(_0x24fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24fd('0x13'))(_0x24fd('0x14'));var utils=require(_0x24fd('0x15'));var config=require(_0x24fd('0x16'));var licenseUtil=require(_0x24fd('0x17'));var db=require(_0x24fd('0x18'))['db'];function respondWithStatusCode(_0x445000,_0x9b96e4){_0x9b96e4=_0x9b96e4||0xcc;return function(_0x465cd4){if(_0x465cd4){return _0x445000[_0x24fd('0x19')](_0x9b96e4);}return _0x445000[_0x24fd('0x1a')](_0x9b96e4)[_0x24fd('0x1b')]();};}function respondWithResult(_0xfb49ce,_0x3a22d9){_0x3a22d9=_0x3a22d9||0xc8;return function(_0x546ba0){if(_0x546ba0){return _0xfb49ce['status'](_0x3a22d9)['json'](_0x546ba0);}};}function respondWithFilteredResult(_0x4d04f0,_0x1234da){return function(_0x4ba93a){if(_0x4ba93a){var _0x4cf117=typeof _0x1234da[_0x24fd('0x1c')]===_0x24fd('0x1d')&&typeof _0x1234da[_0x24fd('0x1e')]===_0x24fd('0x1d');var _0x48f3e2=_0x4ba93a[_0x24fd('0x1f')];var _0x1b774b=_0x4cf117?0x0:_0x1234da[_0x24fd('0x1c')];var _0x13171f=_0x4cf117?_0x4ba93a[_0x24fd('0x1f')]:_0x1234da[_0x24fd('0x1c')]+_0x1234da[_0x24fd('0x1e')];var _0x2a75b6;if(_0x13171f>=_0x48f3e2){_0x13171f=_0x48f3e2;_0x2a75b6=0xc8;}else{_0x2a75b6=0xce;}_0x4d04f0[_0x24fd('0x1a')](_0x2a75b6);return _0x4d04f0[_0x24fd('0x20')](_0x24fd('0x21'),_0x1b774b+'-'+_0x13171f+'/'+_0x48f3e2)['json'](_0x4ba93a);}return null;};}function patchUpdates(_0x5188a8){return function(_0x29df6c){try{jsonpatch[_0x24fd('0x22')](_0x29df6c,_0x5188a8,!![]);}catch(_0x4bb755){return BPromise[_0x24fd('0x23')](_0x4bb755);}return _0x29df6c['save']();};}function saveUpdates(_0x2601a3,_0x1bec4b){return function(_0x7fd09a){if(_0x7fd09a){return _0x7fd09a['update'](_0x2601a3)[_0x24fd('0x24')](function(_0x4aa43d){return _0x4aa43d;});}return null;};}function removeEntity(_0x21a83c,_0x2569db){return function(_0xb7f296){if(_0xb7f296){return _0xb7f296[_0x24fd('0x25')]()[_0x24fd('0x24')](function(){_0x21a83c[_0x24fd('0x1a')](0xcc)[_0x24fd('0x1b')]();});}};}function handleEntityNotFound(_0x9f3f1d,_0x2c5064){return function(_0x227591){if(!_0x227591){_0x9f3f1d[_0x24fd('0x19')](0x194);}return _0x227591;};}function handleError(_0x537ac7,_0x479b36){_0x479b36=_0x479b36||0x1f4;return function(_0x3a2def){logger[_0x24fd('0x26')](_0x3a2def[_0x24fd('0x27')]);if(_0x3a2def[_0x24fd('0x28')]){delete _0x3a2def[_0x24fd('0x28')];}_0x537ac7[_0x24fd('0x1a')](_0x479b36)[_0x24fd('0x29')](_0x3a2def);};}exports[_0x24fd('0x2a')]=function(_0x41529e,_0x2279df){var _0xaa8cfb={},_0x27c8ee={},_0x395ff4={'count':0x0,'rows':[]};var _0x435458=_['map'](db[_0x24fd('0x2b')][_0x24fd('0x2c')],function(_0x530bfc){return{'name':_0x530bfc['fieldName'],'type':_0x530bfc[_0x24fd('0x2d')][_0x24fd('0x2e')]};});_0x27c8ee[_0x24fd('0x2f')]=_['map'](_0x435458,_0x24fd('0x28'));_0x27c8ee['query']=_['keys'](_0x41529e[_0x24fd('0x30')]);_0x27c8ee[_0x24fd('0x31')]=_['intersection'](_0x27c8ee[_0x24fd('0x2f')],_0x27c8ee[_0x24fd('0x30')]);_0xaa8cfb[_0x24fd('0x32')]=_['intersection'](_0x27c8ee[_0x24fd('0x2f')],qs[_0x24fd('0x33')](_0x41529e['query'][_0x24fd('0x33')]));_0xaa8cfb['attributes']=_0xaa8cfb[_0x24fd('0x32')][_0x24fd('0x34')]?_0xaa8cfb[_0x24fd('0x32')]:_0x27c8ee['model'];if(!_0x41529e[_0x24fd('0x30')][_0x24fd('0x35')](_0x24fd('0x36'))){_0xaa8cfb[_0x24fd('0x1e')]=qs[_0x24fd('0x1e')](_0x41529e[_0x24fd('0x30')]['limit']);_0xaa8cfb[_0x24fd('0x1c')]=qs['offset'](_0x41529e['query'][_0x24fd('0x1c')]);}_0xaa8cfb[_0x24fd('0x37')]=qs[_0x24fd('0x38')](_0x41529e[_0x24fd('0x30')][_0x24fd('0x38')]);_0xaa8cfb[_0x24fd('0x39')]=qs[_0x24fd('0x31')](_[_0x24fd('0x3a')](_0x41529e['query'],_0x27c8ee[_0x24fd('0x31')]),_0x435458);if(_0x41529e[_0x24fd('0x30')]['filter']){_0xaa8cfb[_0x24fd('0x39')]=_['merge'](_0xaa8cfb[_0x24fd('0x39')],{'$or':_[_0x24fd('0x3b')](_0x435458,function(_0x40a5e3){if(_0x40a5e3['type']!==_0x24fd('0x3c')){var _0x228639={};_0x228639[_0x40a5e3[_0x24fd('0x28')]]={'$like':'%'+_0x41529e[_0x24fd('0x30')][_0x24fd('0x3d')]+'%'};return _0x228639;}})});}_0xaa8cfb=_[_0x24fd('0x3e')]({},_0xaa8cfb,_0x41529e[_0x24fd('0x3f')]);var _0x26f09a={'where':_0xaa8cfb[_0x24fd('0x39')]};return db[_0x24fd('0x2b')][_0x24fd('0x1f')](_0x26f09a)[_0x24fd('0x24')](function(_0x4482a9){_0x395ff4[_0x24fd('0x1f')]=_0x4482a9;if(_0x41529e['query']['includeAll']){_0xaa8cfb[_0x24fd('0x40')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xaa8cfb);})[_0x24fd('0x24')](function(_0x3285c5){_0x395ff4[_0x24fd('0x41')]=_0x3285c5;return _0x395ff4;})['then'](respondWithFilteredResult(_0x2279df,_0xaa8cfb))[_0x24fd('0x42')](handleError(_0x2279df,null));};exports[_0x24fd('0x43')]=function(_0x4d76c3,_0x88f329){var _0xcd4741={'raw':!![],'where':{'id':_0x4d76c3['params']['id']}},_0x4b498d={};_0x4b498d[_0x24fd('0x2f')]=_[_0x24fd('0x44')](db[_0x24fd('0x2b')][_0x24fd('0x2c')]);_0x4b498d[_0x24fd('0x30')]=_['keys'](_0x4d76c3['query']);_0x4b498d[_0x24fd('0x31')]=_[_0x24fd('0x45')](_0x4b498d[_0x24fd('0x2f')],_0x4b498d[_0x24fd('0x30')]);_0xcd4741['attributes']=_[_0x24fd('0x45')](_0x4b498d['model'],qs[_0x24fd('0x33')](_0x4d76c3[_0x24fd('0x30')][_0x24fd('0x33')]));_0xcd4741[_0x24fd('0x32')]=_0xcd4741['attributes'][_0x24fd('0x34')]?_0xcd4741[_0x24fd('0x32')]:_0x4b498d[_0x24fd('0x2f')];if(_0x4d76c3['query'][_0x24fd('0x46')]){_0xcd4741[_0x24fd('0x40')]=[{'all':!![]}];}_0xcd4741=_[_0x24fd('0x3e')]({},_0xcd4741,_0x4d76c3[_0x24fd('0x3f')]);return db[_0x24fd('0x2b')]['find'](_0xcd4741)['then'](handleEntityNotFound(_0x88f329,null))[_0x24fd('0x24')](respondWithResult(_0x88f329,null))[_0x24fd('0x42')](handleError(_0x88f329,null));};exports[_0x24fd('0x47')]=function(_0x3acfaf,_0x2012a3){return db[_0x24fd('0x2b')][_0x24fd('0x47')](_0x3acfaf['body'],{})[_0x24fd('0x24')](respondWithResult(_0x2012a3,0xc9))[_0x24fd('0x42')](handleError(_0x2012a3,null));};exports[_0x24fd('0x48')]=function(_0x2b0fb1,_0x418fc1){if(_0x2b0fb1[_0x24fd('0x49')]['id']){delete _0x2b0fb1[_0x24fd('0x49')]['id'];}return db[_0x24fd('0x2b')][_0x24fd('0x4a')]({'where':{'id':_0x2b0fb1[_0x24fd('0x4b')]['id']}})[_0x24fd('0x24')](handleEntityNotFound(_0x418fc1,null))[_0x24fd('0x24')](saveUpdates(_0x2b0fb1[_0x24fd('0x49')],null))[_0x24fd('0x24')](respondWithResult(_0x418fc1,null))[_0x24fd('0x42')](handleError(_0x418fc1,null));};exports[_0x24fd('0x25')]=function(_0x10d36f,_0x3c1d80){return db[_0x24fd('0x2b')][_0x24fd('0x4a')]({'where':{'id':_0x10d36f['params']['id']}})[_0x24fd('0x24')](handleEntityNotFound(_0x3c1d80,null))[_0x24fd('0x24')](removeEntity(_0x3c1d80,null))[_0x24fd('0x42')](handleError(_0x3c1d80,null));};exports[_0x24fd('0x4c')]=function(_0x2a132b,_0xd2e246){return db[_0x24fd('0x2b')][_0x24fd('0x4c')]()[_0x24fd('0x24')](respondWithResult(_0xd2e246,null))[_0x24fd('0x42')](handleError(_0xd2e246,null));}; \ No newline at end of file +var _0x7fcf=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','create','body','find','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x557dc4,_0x2c86c6){var _0x51e824=function(_0x2a13f9){while(--_0x2a13f9){_0x557dc4['push'](_0x557dc4['shift']());}};_0x51e824(++_0x2c86c6);}(_0x7fcf,0x16e));var _0xf7fc=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7fcf[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0xf7fc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf7fc('0x1'));var rp=require('request-promise');var moment=require(_0xf7fc('0x2'));var BPromise=require(_0xf7fc('0x3'));var Mustache=require(_0xf7fc('0x4'));var util=require(_0xf7fc('0x5'));var path=require(_0xf7fc('0x6'));var sox=require(_0xf7fc('0x7'));var csv=require(_0xf7fc('0x8'));var ejs=require(_0xf7fc('0x9'));var fs=require('fs');var fs_extra=require(_0xf7fc('0xa'));var _=require('lodash');var squel=require(_0xf7fc('0xb'));var crypto=require(_0xf7fc('0xc'));var jsforce=require(_0xf7fc('0xd'));var deskjs=require(_0xf7fc('0xe'));var toCsv=require(_0xf7fc('0x8'));var querystring=require('querystring');var Papa=require(_0xf7fc('0xf'));var Redis=require('ioredis');var authService=require(_0xf7fc('0x10'));var qs=require(_0xf7fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7fc('0x12'));var logger=require('../../config/logger')(_0xf7fc('0x13'));var utils=require(_0xf7fc('0x14'));var config=require(_0xf7fc('0x15'));var licenseUtil=require(_0xf7fc('0x16'));var db=require(_0xf7fc('0x17'))['db'];function respondWithStatusCode(_0x14e577,_0x258341){_0x258341=_0x258341||0xcc;return function(_0x42f368){if(_0x42f368){return _0x14e577[_0xf7fc('0x18')](_0x258341);}return _0x14e577[_0xf7fc('0x19')](_0x258341)[_0xf7fc('0x1a')]();};}function respondWithResult(_0x3200c0,_0x212846){_0x212846=_0x212846||0xc8;return function(_0x31232f){if(_0x31232f){return _0x3200c0['status'](_0x212846)[_0xf7fc('0x1b')](_0x31232f);}};}function respondWithFilteredResult(_0x4a6436,_0x105e89){return function(_0x40bc70){if(_0x40bc70){var _0x54f0ac=typeof _0x105e89[_0xf7fc('0x1c')]===_0xf7fc('0x1d')&&typeof _0x105e89[_0xf7fc('0x1e')]===_0xf7fc('0x1d');var _0x1c0efd=_0x40bc70['count'];var _0x43b30f=_0x54f0ac?0x0:_0x105e89['offset'];var _0x1ba3a2=_0x54f0ac?_0x40bc70[_0xf7fc('0x1f')]:_0x105e89[_0xf7fc('0x1c')]+_0x105e89[_0xf7fc('0x1e')];var _0x360fe3;if(_0x1ba3a2>=_0x1c0efd){_0x1ba3a2=_0x1c0efd;_0x360fe3=0xc8;}else{_0x360fe3=0xce;}_0x4a6436['status'](_0x360fe3);return _0x4a6436['set'](_0xf7fc('0x20'),_0x43b30f+'-'+_0x1ba3a2+'/'+_0x1c0efd)[_0xf7fc('0x1b')](_0x40bc70);}return null;};}function patchUpdates(_0x1ed0da){return function(_0x3b5ca7){try{jsonpatch[_0xf7fc('0x21')](_0x3b5ca7,_0x1ed0da,!![]);}catch(_0x27281e){return BPromise[_0xf7fc('0x22')](_0x27281e);}return _0x3b5ca7[_0xf7fc('0x23')]();};}function saveUpdates(_0xbcb77,_0x155add){return function(_0x5692b7){if(_0x5692b7){return _0x5692b7[_0xf7fc('0x24')](_0xbcb77)[_0xf7fc('0x25')](function(_0x242c45){return _0x242c45;});}return null;};}function removeEntity(_0x216306,_0x276d6c){return function(_0x17d381){if(_0x17d381){return _0x17d381[_0xf7fc('0x26')]()[_0xf7fc('0x25')](function(){_0x216306[_0xf7fc('0x19')](0xcc)[_0xf7fc('0x1a')]();});}};}function handleEntityNotFound(_0x4a6768,_0x58366c){return function(_0x31d6fb){if(!_0x31d6fb){_0x4a6768['sendStatus'](0x194);}return _0x31d6fb;};}function handleError(_0x68c5af,_0x8b1f23){_0x8b1f23=_0x8b1f23||0x1f4;return function(_0x28c3cc){logger[_0xf7fc('0x27')](_0x28c3cc[_0xf7fc('0x28')]);if(_0x28c3cc[_0xf7fc('0x29')]){delete _0x28c3cc['name'];}_0x68c5af[_0xf7fc('0x19')](_0x8b1f23)[_0xf7fc('0x2a')](_0x28c3cc);};}exports['index']=function(_0x2fb919,_0x62a9f){var _0x83e2df={},_0x5e4a9c={},_0x545d5d={'count':0x0,'rows':[]};var _0x428af1=_[_0xf7fc('0x2b')](db[_0xf7fc('0x2c')][_0xf7fc('0x2d')],function(_0x1663b1){return{'name':_0x1663b1['fieldName'],'type':_0x1663b1[_0xf7fc('0x2e')][_0xf7fc('0x2f')]};});_0x5e4a9c[_0xf7fc('0x30')]=_['map'](_0x428af1,_0xf7fc('0x29'));_0x5e4a9c[_0xf7fc('0x31')]=_[_0xf7fc('0x32')](_0x2fb919[_0xf7fc('0x31')]);_0x5e4a9c[_0xf7fc('0x33')]=_[_0xf7fc('0x34')](_0x5e4a9c[_0xf7fc('0x30')],_0x5e4a9c[_0xf7fc('0x31')]);_0x83e2df[_0xf7fc('0x35')]=_[_0xf7fc('0x34')](_0x5e4a9c[_0xf7fc('0x30')],qs[_0xf7fc('0x36')](_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x36')]));_0x83e2df[_0xf7fc('0x35')]=_0x83e2df['attributes']['length']?_0x83e2df['attributes']:_0x5e4a9c[_0xf7fc('0x30')];if(!_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x37')](_0xf7fc('0x38'))){_0x83e2df['limit']=qs[_0xf7fc('0x1e')](_0x2fb919['query'][_0xf7fc('0x1e')]);_0x83e2df[_0xf7fc('0x1c')]=qs['offset'](_0x2fb919['query'][_0xf7fc('0x1c')]);}_0x83e2df[_0xf7fc('0x39')]=qs[_0xf7fc('0x3a')](_0x2fb919[_0xf7fc('0x31')]['sort']);_0x83e2df[_0xf7fc('0x3b')]=qs[_0xf7fc('0x33')](_[_0xf7fc('0x3c')](_0x2fb919[_0xf7fc('0x31')],_0x5e4a9c[_0xf7fc('0x33')]),_0x428af1);if(_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x3d')]){_0x83e2df[_0xf7fc('0x3b')]=_[_0xf7fc('0x3e')](_0x83e2df[_0xf7fc('0x3b')],{'$or':_[_0xf7fc('0x2b')](_0x428af1,function(_0x2dd97d){if(_0x2dd97d[_0xf7fc('0x2e')]!==_0xf7fc('0x3f')){var _0x39670d={};_0x39670d[_0x2dd97d[_0xf7fc('0x29')]]={'$like':'%'+_0x2fb919['query']['filter']+'%'};return _0x39670d;}})});}_0x83e2df=_[_0xf7fc('0x3e')]({},_0x83e2df,_0x2fb919[_0xf7fc('0x40')]);var _0x436c65={'where':_0x83e2df[_0xf7fc('0x3b')]};return db[_0xf7fc('0x2c')]['count'](_0x436c65)['then'](function(_0x1f5e75){_0x545d5d[_0xf7fc('0x1f')]=_0x1f5e75;if(_0x2fb919['query']['includeAll']){_0x83e2df[_0xf7fc('0x41')]=[{'all':!![]}];}return db[_0xf7fc('0x2c')][_0xf7fc('0x42')](_0x83e2df);})[_0xf7fc('0x25')](function(_0x28023a){_0x545d5d[_0xf7fc('0x43')]=_0x28023a;return _0x545d5d;})['then'](respondWithFilteredResult(_0x62a9f,_0x83e2df))[_0xf7fc('0x44')](handleError(_0x62a9f,null));};exports[_0xf7fc('0x45')]=function(_0x5de1fa,_0x646615){var _0x392009={'raw':!![],'where':{'id':_0x5de1fa['params']['id']}},_0x35dc18={};_0x35dc18[_0xf7fc('0x30')]=_[_0xf7fc('0x32')](db[_0xf7fc('0x2c')][_0xf7fc('0x2d')]);_0x35dc18[_0xf7fc('0x31')]=_[_0xf7fc('0x32')](_0x5de1fa[_0xf7fc('0x31')]);_0x35dc18['filters']=_[_0xf7fc('0x34')](_0x35dc18[_0xf7fc('0x30')],_0x35dc18['query']);_0x392009[_0xf7fc('0x35')]=_[_0xf7fc('0x34')](_0x35dc18[_0xf7fc('0x30')],qs['fields'](_0x5de1fa[_0xf7fc('0x31')][_0xf7fc('0x36')]));_0x392009[_0xf7fc('0x35')]=_0x392009['attributes'][_0xf7fc('0x46')]?_0x392009['attributes']:_0x35dc18[_0xf7fc('0x30')];if(_0x5de1fa[_0xf7fc('0x31')][_0xf7fc('0x47')]){_0x392009['include']=[{'all':!![]}];}_0x392009=_[_0xf7fc('0x3e')]({},_0x392009,_0x5de1fa['options']);return db[_0xf7fc('0x2c')]['find'](_0x392009)[_0xf7fc('0x25')](handleEntityNotFound(_0x646615,null))[_0xf7fc('0x25')](respondWithResult(_0x646615,null))['catch'](handleError(_0x646615,null));};exports[_0xf7fc('0x48')]=function(_0x4f0f64,_0x1522df){return db['SquareReport'][_0xf7fc('0x48')](_0x4f0f64['body'],{})[_0xf7fc('0x25')](respondWithResult(_0x1522df,0xc9))[_0xf7fc('0x44')](handleError(_0x1522df,null));};exports[_0xf7fc('0x24')]=function(_0x4455cb,_0x20ff06){if(_0x4455cb[_0xf7fc('0x49')]['id']){delete _0x4455cb[_0xf7fc('0x49')]['id'];}return db[_0xf7fc('0x2c')][_0xf7fc('0x4a')]({'where':{'id':_0x4455cb[_0xf7fc('0x4b')]['id']}})[_0xf7fc('0x25')](handleEntityNotFound(_0x20ff06,null))[_0xf7fc('0x25')](saveUpdates(_0x4455cb[_0xf7fc('0x49')],null))[_0xf7fc('0x25')](respondWithResult(_0x20ff06,null))[_0xf7fc('0x44')](handleError(_0x20ff06,null));};exports[_0xf7fc('0x26')]=function(_0xaae22e,_0x3cc675){return db[_0xf7fc('0x2c')]['find']({'where':{'id':_0xaae22e[_0xf7fc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3cc675,null))[_0xf7fc('0x25')](removeEntity(_0x3cc675,null))[_0xf7fc('0x44')](handleError(_0x3cc675,null));};exports[_0xf7fc('0x4c')]=function(_0x3a1765,_0x5f5b16){return db[_0xf7fc('0x2c')][_0xf7fc('0x4c')]()['then'](respondWithResult(_0x5f5b16,null))[_0xf7fc('0x44')](handleError(_0x5f5b16,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9f25409..3499957 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 _0xd5e8=['api','bluebird','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','../../config/logger'];(function(_0xb9e58,_0x17986f){var _0x4f8ff3=function(_0x405a49){while(--_0x405a49){_0xb9e58['push'](_0xb9e58['shift']());}};_0x4f8ff3(++_0x17986f);}(_0xd5e8,0x144));var _0x8d5e=function(_0x4821f4,_0x8bc36b){_0x4821f4=_0x4821f4-0x0;var _0x32140f=_0xd5e8[_0x4821f4];return _0x32140f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d5e('0x0'))(_0x8d5e('0x1'));var moment=require('moment');var BPromise=require(_0x8d5e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d5e('0x3'));var config=require(_0x8d5e('0x4'));var attributes=require(_0x8d5e('0x5'));module[_0x8d5e('0x6')]=function(_0x2669bc,_0x52b41f){return _0x2669bc[_0x8d5e('0x7')](_0x8d5e('0x8'),attributes,{'tableName':_0x8d5e('0x9'),'paranoid':![],'indexes':[{'name':_0x8d5e('0xa'),'fields':['uniqueid',_0x8d5e('0xb')]},{'name':_0x8d5e('0xc'),'fields':[_0x8d5e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae52=['uniqueid','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xae52,0x14c));var _0x2ae5=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0xae52[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x2ae5('0x0'));var util=require('util');var logger=require(_0x2ae5('0x1'))(_0x2ae5('0x2'));var moment=require(_0x2ae5('0x3'));var BPromise=require(_0x2ae5('0x4'));var rp=require(_0x2ae5('0x5'));var fs=require('fs');var path=require(_0x2ae5('0x6'));var rimraf=require('rimraf');var config=require(_0x2ae5('0x7'));var attributes=require(_0x2ae5('0x8'));module[_0x2ae5('0x9')]=function(_0x5748ee,_0x18de56){return _0x5748ee['define'](_0x2ae5('0xa'),attributes,{'tableName':_0x2ae5('0xb'),'paranoid':![],'indexes':[{'name':_0x2ae5('0xc'),'fields':[_0x2ae5('0xd'),'project_name']},{'name':_0x2ae5('0xe'),'fields':[_0x2ae5('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 803bce6..e114188 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 _0xb622=['then','info','request\x20sent','debug','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','SquareReport','body','options','raw','catch','UpdateSquareReport','update','attributes','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb622,0x10c));var _0x2b62=function(_0xac370b,_0x18941c){_0xac370b=_0xac370b-0x0;var _0xda26a1=_0xb622[_0xac370b];return _0xda26a1;};'use strict';var _=require(_0x2b62('0x0'));var util=require('util');var moment=require(_0x2b62('0x1'));var BPromise=require(_0x2b62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b62('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b62('0x4'));var logger=require(_0x2b62('0x5'))(_0x2b62('0x6'));var config=require(_0x2b62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b62('0x8')][_0x2b62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23ec0e,_0x7982b2,_0x36eb1e){return new BPromise(function(_0x18d173,_0x8266c1){return client[_0x2b62('0xa')](_0x23ec0e,_0x36eb1e)[_0x2b62('0xb')](function(_0x1a8c6a){logger[_0x2b62('0xc')]('SquareReport,\x20%s,\x20%s',_0x7982b2,_0x2b62('0xd'));logger[_0x2b62('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x7982b2,_0x2b62('0xd'),JSON[_0x2b62('0xf')](_0x1a8c6a));if(_0x1a8c6a['error']){if(_0x1a8c6a[_0x2b62('0x10')][_0x2b62('0x11')]===0x1f4){logger[_0x2b62('0x10')](_0x2b62('0x12'),_0x7982b2,_0x1a8c6a['error'][_0x2b62('0x13')]);return _0x8266c1(_0x1a8c6a[_0x2b62('0x10')][_0x2b62('0x13')]);}logger[_0x2b62('0x10')]('SquareReport,\x20%s,\x20%s',_0x7982b2,_0x1a8c6a[_0x2b62('0x10')]['message']);return _0x18d173(_0x1a8c6a[_0x2b62('0x10')][_0x2b62('0x13')]);}else{logger[_0x2b62('0xc')](_0x2b62('0x12'),_0x7982b2,_0x2b62('0xd'));_0x18d173(_0x1a8c6a[_0x2b62('0x14')][_0x2b62('0x13')]);}})['catch'](function(_0x5af870){logger[_0x2b62('0x10')]('SquareReport,\x20%s,\x20%s',_0x7982b2,_0x5af870);_0x8266c1(_0x5af870);});});}exports[_0x2b62('0x15')]=function(_0x4f69e7){var _0x200b80=this;return new Promise(function(_0xf35baf,_0x1d133c){return db[_0x2b62('0x16')]['create'](_0x4f69e7[_0x2b62('0x17')],{'raw':_0x4f69e7[_0x2b62('0x18')]?_0x4f69e7[_0x2b62('0x18')][_0x2b62('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x133902){logger[_0x2b62('0xc')](_0x2b62('0x15'),_0x4f69e7);logger[_0x2b62('0xe')](_0x2b62('0x15'),_0x4f69e7,JSON[_0x2b62('0xf')](_0x133902));_0xf35baf(_0x133902);})[_0x2b62('0x1a')](function(_0x24ab62){logger['error']('CreateSquareReport',_0x24ab62[_0x2b62('0x13')],_0x4f69e7);_0x1d133c(_0x200b80['error'](0x1f4,_0x24ab62[_0x2b62('0x13')]));});});};exports[_0x2b62('0x1b')]=function(_0x537f69){var _0xef4add=this;return new Promise(function(_0x1a6e5c,_0x451cbd){return db[_0x2b62('0x16')][_0x2b62('0x1c')](_0x537f69['body'],{'raw':_0x537f69[_0x2b62('0x18')]?_0x537f69[_0x2b62('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537f69[_0x2b62('0x18')]?_0x537f69[_0x2b62('0x18')]['where']||null:null,'attributes':_0x537f69[_0x2b62('0x18')]?_0x537f69['options'][_0x2b62('0x1d')]||null:null,'limit':_0x537f69[_0x2b62('0x18')]?_0x537f69[_0x2b62('0x18')][_0x2b62('0x1e')]||null:null})[_0x2b62('0xb')](function(_0x30bcb4){logger[_0x2b62('0xc')](_0x2b62('0x1b'),_0x537f69);logger[_0x2b62('0xe')](_0x2b62('0x1b'),_0x537f69,JSON[_0x2b62('0xf')](_0x30bcb4));_0x1a6e5c(_0x30bcb4);})[_0x2b62('0x1a')](function(_0x3293b9){logger[_0x2b62('0x10')]('UpdateSquareReport',_0x3293b9[_0x2b62('0x13')],_0x537f69);_0x451cbd(_0xef4add['error'](0x1f4,_0x3293b9[_0x2b62('0x13')]));});});}; \ No newline at end of file +var _0x7974=['catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','attributes','limit','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1d5804,_0x3c49ea){var _0x482044=function(_0x43ec36){while(--_0x43ec36){_0x1d5804['push'](_0x1d5804['shift']());}};_0x482044(++_0x3c49ea);}(_0x7974,0x14c));var _0x4797=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7974[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4797('0x0'));var BPromise=require(_0x4797('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4797('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4797('0x3'));var logger=require(_0x4797('0x4'))(_0x4797('0x5'));var config=require(_0x4797('0x6'));var jayson=require(_0x4797('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32b80d,_0x33efc3,_0x253ad7){return new BPromise(function(_0x249c1e,_0x51a1a9){return client[_0x4797('0x8')](_0x32b80d,_0x253ad7)[_0x4797('0x9')](function(_0x447adc){logger[_0x4797('0xa')](_0x4797('0xb'),_0x33efc3,_0x4797('0xc'));logger[_0x4797('0xd')](_0x4797('0xe'),_0x33efc3,'request\x20sent',JSON[_0x4797('0xf')](_0x447adc));if(_0x447adc[_0x4797('0x10')]){if(_0x447adc[_0x4797('0x10')][_0x4797('0x11')]===0x1f4){logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x447adc[_0x4797('0x10')][_0x4797('0x12')]);return _0x51a1a9(_0x447adc[_0x4797('0x10')]['message']);}logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x447adc['error'][_0x4797('0x12')]);return _0x249c1e(_0x447adc['error'][_0x4797('0x12')]);}else{logger[_0x4797('0xa')]('SquareReport,\x20%s,\x20%s',_0x33efc3,_0x4797('0xc'));_0x249c1e(_0x447adc[_0x4797('0x13')][_0x4797('0x12')]);}})[_0x4797('0x14')](function(_0x1697fc){logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x1697fc);_0x51a1a9(_0x1697fc);});});}exports[_0x4797('0x15')]=function(_0x23808c){var _0x320173=this;return new Promise(function(_0x363c0f,_0x2a6eba){return db['SquareReport'][_0x4797('0x16')](_0x23808c[_0x4797('0x17')],{'raw':_0x23808c['options']?_0x23808c[_0x4797('0x18')][_0x4797('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x455f2c){logger['info']('CreateSquareReport',_0x23808c);logger[_0x4797('0xd')](_0x4797('0x15'),_0x23808c,JSON[_0x4797('0xf')](_0x455f2c));_0x363c0f(_0x455f2c);})[_0x4797('0x14')](function(_0x4a24c6){logger['error']('CreateSquareReport',_0x4a24c6[_0x4797('0x12')],_0x23808c);_0x2a6eba(_0x320173['error'](0x1f4,_0x4a24c6[_0x4797('0x12')]));});});};exports[_0x4797('0x1a')]=function(_0x488067){var _0x4a4da6=this;return new Promise(function(_0x3d1e37,_0xc9fb22){return db[_0x4797('0x1b')][_0x4797('0x1c')](_0x488067[_0x4797('0x17')],{'raw':_0x488067[_0x4797('0x18')]?_0x488067['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488067['options']?_0x488067[_0x4797('0x18')][_0x4797('0x1d')]||null:null,'attributes':_0x488067[_0x4797('0x18')]?_0x488067[_0x4797('0x18')][_0x4797('0x1e')]||null:null,'limit':_0x488067['options']?_0x488067[_0x4797('0x18')][_0x4797('0x1f')]||null:null})['then'](function(_0x2f198a){logger[_0x4797('0xa')](_0x4797('0x1a'),_0x488067);logger[_0x4797('0xd')](_0x4797('0x1a'),_0x488067,JSON[_0x4797('0xf')](_0x2f198a));_0x3d1e37(_0x2f198a);})[_0x4797('0x14')](function(_0x3d8474){logger['error'](_0x4797('0x1a'),_0x3d8474[_0x4797('0x12')],_0x488067);_0xc9fb22(_0x4a4da6['error'](0x1f4,_0x3d8474[_0x4797('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9bd2a03..3f83350 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 _0x4777=['isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x4d74e5,_0x48b33c){var _0x42ffe5=function(_0x2d8e6e){while(--_0x2d8e6e){_0x4d74e5['push'](_0x4d74e5['shift']());}};_0x42ffe5(++_0x48b33c);}(_0x4777,0x186));var _0x7477=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x4777[_0x2ec2bf];return _0x2c279c;};'use strict';var multer=require('multer');var util=require(_0x7477('0x0'));var path=require(_0x7477('0x1'));var timeout=require(_0x7477('0x2'));var express=require('express');var router=express[_0x7477('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7477('0x4'));var interaction=require(_0x7477('0x5'));var config=require(_0x7477('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7477('0x7')](_0x7477('0x8'),auth[_0x7477('0x9')](),controller[_0x7477('0xa')]);router['get'](_0x7477('0xb'),auth['isAuthenticated'](),controller[_0x7477('0xc')]);router[_0x7477('0xd')]('/',auth['isAuthenticated'](),controller[_0x7477('0xe')]);router[_0x7477('0xf')](_0x7477('0xb'),auth[_0x7477('0x9')](),controller[_0x7477('0x10')]);router[_0x7477('0x11')](_0x7477('0xb'),auth[_0x7477('0x9')](),controller[_0x7477('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0418=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x0418,0x8c));var _0x8041=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0418[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8041('0x0'));var util=require(_0x8041('0x1'));var path=require(_0x8041('0x2'));var timeout=require(_0x8041('0x3'));var express=require(_0x8041('0x4'));var router=express[_0x8041('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8041('0x6'));var controller=require('./squareReportDetail.controller');router[_0x8041('0x7')]('/',auth[_0x8041('0x8')](),controller[_0x8041('0x9')]);router[_0x8041('0x7')](_0x8041('0xa'),auth[_0x8041('0x8')](),controller['describe']);router[_0x8041('0x7')](_0x8041('0xb'),auth[_0x8041('0x8')](),controller[_0x8041('0xc')]);router[_0x8041('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8041('0xe')]('/:id',auth[_0x8041('0x8')](),controller[_0x8041('0xf')]);router[_0x8041('0x10')](_0x8041('0xb'),auth[_0x8041('0x8')](),controller[_0x8041('0x11')]);module[_0x8041('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 92a000e..ddb0b3a 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 _0x6377=['STRING','TEXT','sequelize','exports'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x6377,0xf6));var _0x7637=function(_0x3295e1,_0x2d74e0){_0x3295e1=_0x3295e1-0x0;var _0x4c6008=_0x6377[_0x3295e1];return _0x4c6008;};'use strict';var Sequelize=require(_0x7637('0x0'));module[_0x7637('0x1')]={'uniqueid':{'type':Sequelize[_0x7637('0x2')]},'node':{'type':Sequelize[_0x7637('0x2')]},'application':{'type':Sequelize[_0x7637('0x2')]},'data':{'type':Sequelize[_0x7637('0x3')]},'project_name':{'type':Sequelize[_0x7637('0x2')]},'callerid':{'type':Sequelize[_0x7637('0x2')]}}; \ No newline at end of file +var _0x96eb=['STRING','TEXT'];(function(_0xdcef9f,_0x5e9723){var _0x2f6a0f=function(_0x2be681){while(--_0x2be681){_0xdcef9f['push'](_0xdcef9f['shift']());}};_0x2f6a0f(++_0x5e9723);}(_0x96eb,0x1c4));var _0xb96e=function(_0x22990a,_0x1e1aaf){_0x22990a=_0x22990a-0x0;var _0x32c420=_0x96eb[_0x22990a];return _0x32c420;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb96e('0x0')]},'node':{'type':Sequelize[_0xb96e('0x0')]},'application':{'type':Sequelize[_0xb96e('0x0')]},'data':{'type':Sequelize[_0xb96e('0x1')]},'project_name':{'type':Sequelize[_0xb96e('0x0')]},'callerid':{'type':Sequelize[_0xb96e('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e4fe054..1a9e17a 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 _0xb48e=['intersection','attributes','fields','nolimit','sort','where','merge','VIRTUAL','filter','options','count','includeAll','rawAttributes','length','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','json','reject','save','update','then','destroy','error','name','send','map','SquareDetailsReport','type','key','model','keys','query','filters'];(function(_0x5b1a4b,_0x2b6e44){var _0x2a9c0d=function(_0x5b5947){while(--_0x5b5947){_0x5b1a4b['push'](_0x5b1a4b['shift']());}};_0x2a9c0d(++_0x2b6e44);}(_0xb48e,0x128));var _0xeb48=function(_0x9274cd,_0x11cb8c){_0x9274cd=_0x9274cd-0x0;var _0x5b07df=_0xb48e[_0x9274cd];return _0x5b07df;};'use strict';var emlformat=require(_0xeb48('0x0'));var rimraf=require(_0xeb48('0x1'));var zipdir=require(_0xeb48('0x2'));var jsonpatch=require(_0xeb48('0x3'));var rp=require('request-promise');var moment=require(_0xeb48('0x4'));var BPromise=require(_0xeb48('0x5'));var Mustache=require(_0xeb48('0x6'));var util=require(_0xeb48('0x7'));var path=require('path');var sox=require(_0xeb48('0x8'));var csv=require(_0xeb48('0x9'));var ejs=require(_0xeb48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb48('0xb'));var crypto=require(_0xeb48('0xc'));var jsforce=require(_0xeb48('0xd'));var deskjs=require(_0xeb48('0xe'));var toCsv=require(_0xeb48('0x9'));var querystring=require(_0xeb48('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb48('0x10'));var authService=require(_0xeb48('0x11'));var qs=require(_0xeb48('0x12'));var as=require(_0xeb48('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb48('0x14'))(_0xeb48('0x15'));var utils=require(_0xeb48('0x16'));var config=require(_0xeb48('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb48('0x18'))['db'];function respondWithStatusCode(_0x1d3f25,_0x5e873c){_0x5e873c=_0x5e873c||0xcc;return function(_0xaf5a96){if(_0xaf5a96){return _0x1d3f25[_0xeb48('0x19')](_0x5e873c);}return _0x1d3f25[_0xeb48('0x1a')](_0x5e873c)[_0xeb48('0x1b')]();};}function respondWithResult(_0x4c546b,_0x469998){_0x469998=_0x469998||0xc8;return function(_0x1ee192){if(_0x1ee192){return _0x4c546b[_0xeb48('0x1a')](_0x469998)['json'](_0x1ee192);}};}function respondWithFilteredResult(_0x428c57,_0x544176){return function(_0x2386f3){if(_0x2386f3){var _0x1f516f=typeof _0x544176['offset']===_0xeb48('0x1c')&&typeof _0x544176[_0xeb48('0x1d')]===_0xeb48('0x1c');var _0x31a5cc=_0x2386f3['count'];var _0x3ad1f4=_0x1f516f?0x0:_0x544176[_0xeb48('0x1e')];var _0xd16f2b=_0x1f516f?_0x2386f3['count']:_0x544176['offset']+_0x544176[_0xeb48('0x1d')];var _0xa61a56;if(_0xd16f2b>=_0x31a5cc){_0xd16f2b=_0x31a5cc;_0xa61a56=0xc8;}else{_0xa61a56=0xce;}_0x428c57[_0xeb48('0x1a')](_0xa61a56);return _0x428c57[_0xeb48('0x1f')]('Content-Range',_0x3ad1f4+'-'+_0xd16f2b+'/'+_0x31a5cc)[_0xeb48('0x20')](_0x2386f3);}return null;};}function patchUpdates(_0xbd74ef){return function(_0x57cc6f){try{jsonpatch['apply'](_0x57cc6f,_0xbd74ef,!![]);}catch(_0x24575b){return BPromise[_0xeb48('0x21')](_0x24575b);}return _0x57cc6f[_0xeb48('0x22')]();};}function saveUpdates(_0x37828b,_0x366ca4){return function(_0x185c90){if(_0x185c90){return _0x185c90[_0xeb48('0x23')](_0x37828b)[_0xeb48('0x24')](function(_0x1f1afb){return _0x1f1afb;});}return null;};}function removeEntity(_0x5af450,_0x18c3ad){return function(_0x310111){if(_0x310111){return _0x310111[_0xeb48('0x25')]()[_0xeb48('0x24')](function(){_0x5af450[_0xeb48('0x1a')](0xcc)[_0xeb48('0x1b')]();});}};}function handleEntityNotFound(_0x57ea4c,_0x4300c0){return function(_0x684fa5){if(!_0x684fa5){_0x57ea4c[_0xeb48('0x19')](0x194);}return _0x684fa5;};}function handleError(_0x30691f,_0x28048c){_0x28048c=_0x28048c||0x1f4;return function(_0x29aaff){logger[_0xeb48('0x26')](_0x29aaff['stack']);if(_0x29aaff[_0xeb48('0x27')]){delete _0x29aaff[_0xeb48('0x27')];}_0x30691f['status'](_0x28048c)[_0xeb48('0x28')](_0x29aaff);};}exports['index']=function(_0x11771d,_0x29ba06){var _0x1f3e04={},_0x2a36b8={},_0x3d5f21={'count':0x0,'rows':[]};var _0x454d7f=_[_0xeb48('0x29')](db[_0xeb48('0x2a')]['rawAttributes'],function(_0xe0fc6e){return{'name':_0xe0fc6e['fieldName'],'type':_0xe0fc6e[_0xeb48('0x2b')][_0xeb48('0x2c')]};});_0x2a36b8[_0xeb48('0x2d')]=_[_0xeb48('0x29')](_0x454d7f,_0xeb48('0x27'));_0x2a36b8['query']=_[_0xeb48('0x2e')](_0x11771d[_0xeb48('0x2f')]);_0x2a36b8[_0xeb48('0x30')]=_[_0xeb48('0x31')](_0x2a36b8['model'],_0x2a36b8[_0xeb48('0x2f')]);_0x1f3e04[_0xeb48('0x32')]=_[_0xeb48('0x31')](_0x2a36b8['model'],qs[_0xeb48('0x33')](_0x11771d[_0xeb48('0x2f')][_0xeb48('0x33')]));_0x1f3e04['attributes']=_0x1f3e04[_0xeb48('0x32')]['length']?_0x1f3e04[_0xeb48('0x32')]:_0x2a36b8[_0xeb48('0x2d')];if(!_0x11771d[_0xeb48('0x2f')]['hasOwnProperty'](_0xeb48('0x34'))){_0x1f3e04[_0xeb48('0x1d')]=qs[_0xeb48('0x1d')](_0x11771d[_0xeb48('0x2f')][_0xeb48('0x1d')]);_0x1f3e04['offset']=qs[_0xeb48('0x1e')](_0x11771d[_0xeb48('0x2f')][_0xeb48('0x1e')]);}_0x1f3e04['order']=qs['sort'](_0x11771d[_0xeb48('0x2f')][_0xeb48('0x35')]);_0x1f3e04[_0xeb48('0x36')]=qs['filters'](_['pick'](_0x11771d[_0xeb48('0x2f')],_0x2a36b8[_0xeb48('0x30')]),_0x454d7f);if(_0x11771d[_0xeb48('0x2f')]['filter']){_0x1f3e04[_0xeb48('0x36')]=_[_0xeb48('0x37')](_0x1f3e04[_0xeb48('0x36')],{'$or':_[_0xeb48('0x29')](_0x454d7f,function(_0x10c7bd){if(_0x10c7bd[_0xeb48('0x2b')]!==_0xeb48('0x38')){var _0x3b4ac6={};_0x3b4ac6[_0x10c7bd['name']]={'$like':'%'+_0x11771d[_0xeb48('0x2f')][_0xeb48('0x39')]+'%'};return _0x3b4ac6;}})});}_0x1f3e04=_[_0xeb48('0x37')]({},_0x1f3e04,_0x11771d[_0xeb48('0x3a')]);var _0x526185={'where':_0x1f3e04[_0xeb48('0x36')]};return db[_0xeb48('0x2a')][_0xeb48('0x3b')](_0x526185)[_0xeb48('0x24')](function(_0xa34f73){_0x3d5f21[_0xeb48('0x3b')]=_0xa34f73;if(_0x11771d[_0xeb48('0x2f')][_0xeb48('0x3c')]){_0x1f3e04['include']=[{'all':!![]}];}return db[_0xeb48('0x2a')]['findAll'](_0x1f3e04);})['then'](function(_0x292580){_0x3d5f21['rows']=_0x292580;return _0x3d5f21;})[_0xeb48('0x24')](respondWithFilteredResult(_0x29ba06,_0x1f3e04))['catch'](handleError(_0x29ba06,null));};exports['show']=function(_0x3776b9,_0x4bfb7a){var _0x1473a9={'raw':!![],'where':{'id':_0x3776b9['params']['id']}},_0x1672b9={};_0x1672b9[_0xeb48('0x2d')]=_['keys'](db[_0xeb48('0x2a')][_0xeb48('0x3d')]);_0x1672b9[_0xeb48('0x2f')]=_[_0xeb48('0x2e')](_0x3776b9[_0xeb48('0x2f')]);_0x1672b9[_0xeb48('0x30')]=_[_0xeb48('0x31')](_0x1672b9[_0xeb48('0x2d')],_0x1672b9['query']);_0x1473a9[_0xeb48('0x32')]=_[_0xeb48('0x31')](_0x1672b9[_0xeb48('0x2d')],qs[_0xeb48('0x33')](_0x3776b9[_0xeb48('0x2f')]['fields']));_0x1473a9[_0xeb48('0x32')]=_0x1473a9[_0xeb48('0x32')][_0xeb48('0x3e')]?_0x1473a9[_0xeb48('0x32')]:_0x1672b9[_0xeb48('0x2d')];if(_0x3776b9[_0xeb48('0x2f')]['includeAll']){_0x1473a9[_0xeb48('0x3f')]=[{'all':!![]}];}_0x1473a9=_['merge']({},_0x1473a9,_0x3776b9[_0xeb48('0x3a')]);return db['SquareDetailsReport'][_0xeb48('0x40')](_0x1473a9)[_0xeb48('0x24')](handleEntityNotFound(_0x4bfb7a,null))[_0xeb48('0x24')](respondWithResult(_0x4bfb7a,null))[_0xeb48('0x41')](handleError(_0x4bfb7a,null));};exports[_0xeb48('0x42')]=function(_0x5717b4,_0x47cfe5){return db[_0xeb48('0x2a')]['create'](_0x5717b4[_0xeb48('0x43')],{})['then'](respondWithResult(_0x47cfe5,0xc9))['catch'](handleError(_0x47cfe5,null));};exports[_0xeb48('0x23')]=function(_0x58dbda,_0x424f3c){if(_0x58dbda[_0xeb48('0x43')]['id']){delete _0x58dbda[_0xeb48('0x43')]['id'];}return db['SquareDetailsReport'][_0xeb48('0x40')]({'where':{'id':_0x58dbda['params']['id']}})['then'](handleEntityNotFound(_0x424f3c,null))[_0xeb48('0x24')](saveUpdates(_0x58dbda['body'],null))['then'](respondWithResult(_0x424f3c,null))[_0xeb48('0x41')](handleError(_0x424f3c,null));};exports[_0xeb48('0x25')]=function(_0xd8d30a,_0x548391){return db[_0xeb48('0x2a')]['find']({'where':{'id':_0xd8d30a['params']['id']}})['then'](handleEntityNotFound(_0x548391,null))['then'](removeEntity(_0x548391,null))[_0xeb48('0x41')](handleError(_0x548391,null));};exports[_0xeb48('0x44')]=function(_0x3b193c,_0x2e713f){return db[_0xeb48('0x2a')][_0xeb48('0x44')]()['then'](respondWithResult(_0x2e713f,null))[_0xeb48('0x41')](handleError(_0x2e713f,null));}; \ No newline at end of file +var _0x8e29=['json','offset','count','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0x8e29,0x10d));var _0x98e2=function(_0x29e16e,_0x28959a){_0x29e16e=_0x29e16e-0x0;var _0x52b749=_0x8e29[_0x29e16e];return _0x52b749;};'use strict';var emlformat=require(_0x98e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98e2('0x2'));var BPromise=require(_0x98e2('0x3'));var Mustache=require(_0x98e2('0x4'));var util=require(_0x98e2('0x5'));var path=require(_0x98e2('0x6'));var sox=require(_0x98e2('0x7'));var csv=require(_0x98e2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98e2('0x9'));var _=require(_0x98e2('0xa'));var squel=require(_0x98e2('0xb'));var crypto=require(_0x98e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x98e2('0xe'));var Papa=require('papaparse');var Redis=require(_0x98e2('0xf'));var authService=require(_0x98e2('0x10'));var qs=require(_0x98e2('0x11'));var as=require(_0x98e2('0x12'));var hardwareService=require(_0x98e2('0x13'));var logger=require(_0x98e2('0x14'))('api');var utils=require(_0x98e2('0x15'));var config=require(_0x98e2('0x16'));var licenseUtil=require(_0x98e2('0x17'));var db=require(_0x98e2('0x18'))['db'];function respondWithStatusCode(_0x339eb1,_0x2db7ba){_0x2db7ba=_0x2db7ba||0xcc;return function(_0x198d1e){if(_0x198d1e){return _0x339eb1[_0x98e2('0x19')](_0x2db7ba);}return _0x339eb1[_0x98e2('0x1a')](_0x2db7ba)['end']();};}function respondWithResult(_0x29e583,_0x296615){_0x296615=_0x296615||0xc8;return function(_0xb161cb){if(_0xb161cb){return _0x29e583['status'](_0x296615)[_0x98e2('0x1b')](_0xb161cb);}};}function respondWithFilteredResult(_0x2d1569,_0x16f02b){return function(_0x4dcd13){if(_0x4dcd13){var _0x183ea6=typeof _0x16f02b[_0x98e2('0x1c')]==='undefined'&&typeof _0x16f02b['limit']==='undefined';var _0x48fff3=_0x4dcd13['count'];var _0x40f46c=_0x183ea6?0x0:_0x16f02b[_0x98e2('0x1c')];var _0x30507=_0x183ea6?_0x4dcd13[_0x98e2('0x1d')]:_0x16f02b[_0x98e2('0x1c')]+_0x16f02b[_0x98e2('0x1e')];var _0x181fc8;if(_0x30507>=_0x48fff3){_0x30507=_0x48fff3;_0x181fc8=0xc8;}else{_0x181fc8=0xce;}_0x2d1569[_0x98e2('0x1a')](_0x181fc8);return _0x2d1569[_0x98e2('0x1f')]('Content-Range',_0x40f46c+'-'+_0x30507+'/'+_0x48fff3)['json'](_0x4dcd13);}return null;};}function patchUpdates(_0x3b12fa){return function(_0x42567f){try{jsonpatch[_0x98e2('0x20')](_0x42567f,_0x3b12fa,!![]);}catch(_0x49e8a2){return BPromise[_0x98e2('0x21')](_0x49e8a2);}return _0x42567f['save']();};}function saveUpdates(_0x454c29,_0x536ae1){return function(_0xa30bf7){if(_0xa30bf7){return _0xa30bf7[_0x98e2('0x22')](_0x454c29)[_0x98e2('0x23')](function(_0x227570){return _0x227570;});}return null;};}function removeEntity(_0x5e8077,_0x3c0414){return function(_0xbd909a){if(_0xbd909a){return _0xbd909a[_0x98e2('0x24')]()['then'](function(){_0x5e8077[_0x98e2('0x1a')](0xcc)[_0x98e2('0x25')]();});}};}function handleEntityNotFound(_0x2f6377,_0x334447){return function(_0x472e49){if(!_0x472e49){_0x2f6377['sendStatus'](0x194);}return _0x472e49;};}function handleError(_0x1bc3be,_0x540cbe){_0x540cbe=_0x540cbe||0x1f4;return function(_0x12f70c){logger[_0x98e2('0x26')](_0x12f70c[_0x98e2('0x27')]);if(_0x12f70c[_0x98e2('0x28')]){delete _0x12f70c[_0x98e2('0x28')];}_0x1bc3be['status'](_0x540cbe)[_0x98e2('0x29')](_0x12f70c);};}exports['index']=function(_0x40afaf,_0x42a150){var _0x471101={},_0x47d6df={},_0x8407e4={'count':0x0,'rows':[]};var _0x48fd4d=_['map'](db[_0x98e2('0x2a')][_0x98e2('0x2b')],function(_0x450821){return{'name':_0x450821[_0x98e2('0x2c')],'type':_0x450821['type'][_0x98e2('0x2d')]};});_0x47d6df[_0x98e2('0x2e')]=_['map'](_0x48fd4d,_0x98e2('0x28'));_0x47d6df['query']=_[_0x98e2('0x2f')](_0x40afaf[_0x98e2('0x30')]);_0x47d6df[_0x98e2('0x31')]=_['intersection'](_0x47d6df[_0x98e2('0x2e')],_0x47d6df['query']);_0x471101[_0x98e2('0x32')]=_['intersection'](_0x47d6df[_0x98e2('0x2e')],qs[_0x98e2('0x33')](_0x40afaf[_0x98e2('0x30')]['fields']));_0x471101[_0x98e2('0x32')]=_0x471101['attributes'][_0x98e2('0x34')]?_0x471101[_0x98e2('0x32')]:_0x47d6df[_0x98e2('0x2e')];if(!_0x40afaf[_0x98e2('0x30')][_0x98e2('0x35')]('nolimit')){_0x471101[_0x98e2('0x1e')]=qs[_0x98e2('0x1e')](_0x40afaf[_0x98e2('0x30')][_0x98e2('0x1e')]);_0x471101[_0x98e2('0x1c')]=qs[_0x98e2('0x1c')](_0x40afaf[_0x98e2('0x30')][_0x98e2('0x1c')]);}_0x471101['order']=qs[_0x98e2('0x36')](_0x40afaf['query'][_0x98e2('0x36')]);_0x471101[_0x98e2('0x37')]=qs[_0x98e2('0x31')](_[_0x98e2('0x38')](_0x40afaf['query'],_0x47d6df[_0x98e2('0x31')]),_0x48fd4d);if(_0x40afaf[_0x98e2('0x30')]['filter']){_0x471101[_0x98e2('0x37')]=_[_0x98e2('0x39')](_0x471101['where'],{'$or':_[_0x98e2('0x3a')](_0x48fd4d,function(_0x1bed45){if(_0x1bed45[_0x98e2('0x3b')]!==_0x98e2('0x3c')){var _0x4e8021={};_0x4e8021[_0x1bed45[_0x98e2('0x28')]]={'$like':'%'+_0x40afaf[_0x98e2('0x30')][_0x98e2('0x3d')]+'%'};return _0x4e8021;}})});}_0x471101=_['merge']({},_0x471101,_0x40afaf[_0x98e2('0x3e')]);var _0x56e40f={'where':_0x471101['where']};return db[_0x98e2('0x2a')][_0x98e2('0x1d')](_0x56e40f)[_0x98e2('0x23')](function(_0x436570){_0x8407e4['count']=_0x436570;if(_0x40afaf[_0x98e2('0x30')]['includeAll']){_0x471101[_0x98e2('0x3f')]=[{'all':!![]}];}return db[_0x98e2('0x2a')][_0x98e2('0x40')](_0x471101);})[_0x98e2('0x23')](function(_0x3fd3cd){_0x8407e4[_0x98e2('0x41')]=_0x3fd3cd;return _0x8407e4;})[_0x98e2('0x23')](respondWithFilteredResult(_0x42a150,_0x471101))[_0x98e2('0x42')](handleError(_0x42a150,null));};exports[_0x98e2('0x43')]=function(_0x39c47d,_0x12d7b2){var _0x5befa2={'raw':!![],'where':{'id':_0x39c47d[_0x98e2('0x44')]['id']}},_0xdbc8dc={};_0xdbc8dc['model']=_[_0x98e2('0x2f')](db[_0x98e2('0x2a')][_0x98e2('0x2b')]);_0xdbc8dc[_0x98e2('0x30')]=_['keys'](_0x39c47d[_0x98e2('0x30')]);_0xdbc8dc['filters']=_[_0x98e2('0x45')](_0xdbc8dc[_0x98e2('0x2e')],_0xdbc8dc[_0x98e2('0x30')]);_0x5befa2[_0x98e2('0x32')]=_[_0x98e2('0x45')](_0xdbc8dc[_0x98e2('0x2e')],qs['fields'](_0x39c47d[_0x98e2('0x30')][_0x98e2('0x33')]));_0x5befa2[_0x98e2('0x32')]=_0x5befa2[_0x98e2('0x32')][_0x98e2('0x34')]?_0x5befa2[_0x98e2('0x32')]:_0xdbc8dc['model'];if(_0x39c47d['query']['includeAll']){_0x5befa2[_0x98e2('0x3f')]=[{'all':!![]}];}_0x5befa2=_[_0x98e2('0x39')]({},_0x5befa2,_0x39c47d[_0x98e2('0x3e')]);return db[_0x98e2('0x2a')][_0x98e2('0x46')](_0x5befa2)[_0x98e2('0x23')](handleEntityNotFound(_0x12d7b2,null))[_0x98e2('0x23')](respondWithResult(_0x12d7b2,null))[_0x98e2('0x42')](handleError(_0x12d7b2,null));};exports[_0x98e2('0x47')]=function(_0x2c613a,_0x44e7a9){return db[_0x98e2('0x2a')][_0x98e2('0x47')](_0x2c613a['body'],{})[_0x98e2('0x23')](respondWithResult(_0x44e7a9,0xc9))['catch'](handleError(_0x44e7a9,null));};exports[_0x98e2('0x22')]=function(_0x1bf0ed,_0x1009f2){if(_0x1bf0ed[_0x98e2('0x48')]['id']){delete _0x1bf0ed[_0x98e2('0x48')]['id'];}return db[_0x98e2('0x2a')][_0x98e2('0x46')]({'where':{'id':_0x1bf0ed[_0x98e2('0x44')]['id']}})[_0x98e2('0x23')](handleEntityNotFound(_0x1009f2,null))[_0x98e2('0x23')](saveUpdates(_0x1bf0ed[_0x98e2('0x48')],null))[_0x98e2('0x23')](respondWithResult(_0x1009f2,null))[_0x98e2('0x42')](handleError(_0x1009f2,null));};exports['destroy']=function(_0x4db04a,_0x544366){return db[_0x98e2('0x2a')][_0x98e2('0x46')]({'where':{'id':_0x4db04a[_0x98e2('0x44')]['id']}})[_0x98e2('0x23')](handleEntityNotFound(_0x544366,null))[_0x98e2('0x23')](removeEntity(_0x544366,null))[_0x98e2('0x42')](handleError(_0x544366,null));};exports['describe']=function(_0x55749d,_0xa68d94){return db[_0x98e2('0x2a')][_0x98e2('0x49')]()[_0x98e2('0x23')](respondWithResult(_0xa68d94,null))[_0x98e2('0x42')](handleError(_0xa68d94,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 7a34ab2..8a63fb4 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 _0xac9f=['bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment'];(function(_0x40ad51,_0x9f82c1){var _0x173c15=function(_0x96e1a0){while(--_0x96e1a0){_0x40ad51['push'](_0x40ad51['shift']());}};_0x173c15(++_0x9f82c1);}(_0xac9f,0x158));var _0xfac9=function(_0x566474,_0x46db89){_0x566474=_0x566474-0x0;var _0x5803b6=_0xac9f[_0x566474];return _0x5803b6;};'use strict';var _=require('lodash');var util=require(_0xfac9('0x0'));var logger=require(_0xfac9('0x1'))(_0xfac9('0x2'));var moment=require(_0xfac9('0x3'));var BPromise=require(_0xfac9('0x4'));var rp=require(_0xfac9('0x5'));var fs=require('fs');var path=require(_0xfac9('0x6'));var rimraf=require(_0xfac9('0x7'));var config=require('../../config/environment');var attributes=require(_0xfac9('0x8'));module[_0xfac9('0x9')]=function(_0x407f91,_0x3f56ae){return _0x407f91['define'](_0xfac9('0xa'),attributes,{'tableName':_0xfac9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e66=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5e66,0x1b0));var _0x65e6=function(_0x5b93aa,_0x10b918){_0x5b93aa=_0x5b93aa-0x0;var _0x425bbf=_0x5e66[_0x5b93aa];return _0x425bbf;};'use strict';var _=require(_0x65e6('0x0'));var util=require(_0x65e6('0x1'));var logger=require(_0x65e6('0x2'))(_0x65e6('0x3'));var moment=require(_0x65e6('0x4'));var BPromise=require(_0x65e6('0x5'));var rp=require(_0x65e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x65e6('0x7'));var attributes=require(_0x65e6('0x8'));module[_0x65e6('0x9')]=function(_0x43baa9,_0x562827){return _0x43baa9[_0x65e6('0xa')](_0x65e6('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index bcc58b6..7aa031f 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 _0x3f8c=['code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','catch','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x425ecd,_0x1e1bed){var _0xddc406=function(_0x179638){while(--_0x179638){_0x425ecd['push'](_0x425ecd['shift']());}};_0xddc406(++_0x1e1bed);}(_0x3f8c,0x104));var _0xc3f8=function(_0x58e1ee,_0x41415e){_0x58e1ee=_0x58e1ee-0x0;var _0x2186de=_0x3f8c[_0x58e1ee];return _0x2186de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}exports[_0xc3f8('0x12')]=function(_0x2e7c0f){var _0x35500f=this;return new Promise(function(_0xb4ab67,_0x47a185){return db[_0xc3f8('0x13')][_0xc3f8('0x14')](_0x2e7c0f['body'],{'raw':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f['options'][_0xc3f8('0x16')]===undefined?!![]:![]:!![]})[_0xc3f8('0x8')](function(_0x3b2e98){logger['info']('CreateSquareDetailsReport',_0x2e7c0f);logger[_0xc3f8('0x17')](_0xc3f8('0x12'),_0x2e7c0f,JSON[_0xc3f8('0xd')](_0x3b2e98));_0xb4ab67(_0x3b2e98);})[_0xc3f8('0x18')](function(_0x6522e9){logger[_0xc3f8('0xe')](_0xc3f8('0x12'),_0x6522e9[_0xc3f8('0x10')],_0x2e7c0f);_0x47a185(_0x35500f['error'](0x1f4,_0x6522e9['message']));});});}; \ No newline at end of file +var _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2e4c40,_0x50219a){var _0xe0743=function(_0xcec537){while(--_0xcec537){_0x2e4c40['push'](_0x2e4c40['shift']());}};_0xe0743(++_0x50219a);}(_0x5b12,0xa3));var _0x25b1=function(_0x348b07,_0x419704){_0x348b07=_0x348b07-0x0;var _0x20ac52=_0x5b12[_0x348b07];return _0x20ac52;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9deb14e..5ea76f9 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 _0xf6dc=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x5a5f47,_0x42ea38){var _0xb679af=function(_0x136ff4){while(--_0x136ff4){_0x5a5f47['push'](_0x5a5f47['shift']());}};_0xb679af(++_0x42ea38);}(_0xf6dc,0x140));var _0xcf6d=function(_0x275eda,_0x3d9b0f){_0x275eda=_0x275eda-0x0;var _0x4cae81=_0xf6dc[_0x275eda];return _0x4cae81;};'use strict';var express=require(_0xcf6d('0x0'));var router=express[_0xcf6d('0x1')]();var auth=require(_0xcf6d('0x2'));var controller=require(_0xcf6d('0x3'));router[_0xcf6d('0x4')]('/',auth[_0xcf6d('0x5')](),controller[_0xcf6d('0x6')]);router['get'](_0xcf6d('0x7'),auth[_0xcf6d('0x5')](),controller[_0xcf6d('0x8')]);module[_0xcf6d('0x9')]=router; \ No newline at end of file +var _0x0dd8=['index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x220b7e,_0x2eed81){var _0x4ac073=function(_0x2d1cdc){while(--_0x2d1cdc){_0x220b7e['push'](_0x220b7e['shift']());}};_0x4ac073(++_0x2eed81);}(_0x0dd8,0x73));var _0x80dd=function(_0x492202,_0x2528f2){_0x492202=_0x492202-0x0;var _0x34fed5=_0x0dd8[_0x492202];return _0x34fed5;};'use strict';var express=require(_0x80dd('0x0'));var router=express[_0x80dd('0x1')]();var auth=require(_0x80dd('0x2'));var controller=require(_0x80dd('0x3'));router[_0x80dd('0x4')]('/',auth['isAuthenticated'](),controller[_0x80dd('0x5')]);router['get'](_0x80dd('0x6'),auth[_0x80dd('0x7')](),controller[_0x80dd('0x8')]);module[_0x80dd('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 1812859..2b0d5f8 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 _0x110e=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','util','bluebird','inspect','name','status','send','index','getAllData','killProcess','components/import/cm','format','params','pid','then','split','length','indexOf'];(function(_0x390744,_0x4561d2){var _0x3e34c5=function(_0x18061c){while(--_0x18061c){_0x390744['push'](_0x390744['shift']());}};_0x3e34c5(++_0x4561d2);}(_0x110e,0x157));var _0xe110=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x110e[_0x29d915];return _0x160f86;};'use strict';var info=require(_0xe110('0x0'));var exec=require(_0xe110('0x1'))[_0xe110('0x2')];var logger=require(_0xe110('0x3'))('api');var util=require(_0xe110('0x4'));var BPromise=require(_0xe110('0x5'));var _=require('lodash');function handleError(_0x3ae7f0,_0x5a124f,_0xec5a7e){_0x5a124f=_0x5a124f||0x1f4;return function(_0x6db8c7){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0xec5a7e,_0x5a124f,util[_0xe110('0x6')](_0x6db8c7,{'showHidden':![],'depth':null}));delete _0x6db8c7[_0xe110('0x7')];_0x3ae7f0[_0xe110('0x8')](_0x5a124f)[_0xe110('0x9')](_0x6db8c7);};}exports[_0xe110('0xa')]=function(_0xe7cd57,_0x200d77){return info[_0xe110('0xb')]()['then'](function(_0x34074c){return _0x200d77['status'](0xc8)['json'](_0x34074c);})['catch'](function(_0x50a4b5){return _0x200d77['status'](0x1f4)['json'](_0x50a4b5);});};exports[_0xe110('0xc')]=function(_0x3e4771,_0x164340){var _0x519ec5=[_0xe110('0xd')];return new BPromise(function(_0x37e5ab,_0x45ff9e){return exec(util[_0xe110('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3e4771[_0xe110('0xf')][_0xe110('0x10')]),function(_0x510d2d,_0x57d125,_0x2f44ff){if(_0x510d2d){return _0x45ff9e(_0x510d2d);}return _0x37e5ab(_0x57d125);});})[_0xe110('0x11')](function(_0x4a38ef){var _0x4ef00c=![];var _0x2c0a90=_0x4a38ef[_0xe110('0x12')](/\n/);for(var _0x5c05f6=0x0,_0x2fca03=_0x519ec5[_0xe110('0x13')];_0x5c05f6<_0x2fca03,_0x4ef00c===![];_0x5c05f6+=0x1){if(_0x4a38ef[_0xe110('0x14')](_0x519ec5[_0x5c05f6])>=0x0){_0x4ef00c=!![];}}if(!_0x4ef00c){throw new Error(util['format'](_0xe110('0x15'),_0x3e4771[_0xe110('0xf')]['pid']));}process[_0xe110('0x16')](_0x3e4771[_0xe110('0xf')][_0xe110('0x10')],'SIGINT');return _0x164340[_0xe110('0x8')](0xc8)[_0xe110('0x17')]({'message':util[_0xe110('0xe')](_0xe110('0x18'),_0x3e4771[_0xe110('0xf')][_0xe110('0x10')])});})[_0xe110('0x19')](handleError(_0x164340,null,_0xe110('0xc')));}; \ No newline at end of file +var _0xd06f=['killProcess','systeminformation','child_process','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','format'];(function(_0x46022d,_0x121f32){var _0xbfa35a=function(_0x4a27a8){while(--_0x4a27a8){_0x46022d['push'](_0x46022d['shift']());}};_0xbfa35a(++_0x121f32);}(_0xd06f,0x15f));var _0xfd06=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xd06f[_0x323419];return _0x4c0be7;};'use strict';var info=require(_0xfd06('0x0'));var exec=require(_0xfd06('0x1'))['exec'];var logger=require('../../config/logger')(_0xfd06('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0xfd06('0x3'));function handleError(_0x288497,_0x4f350e,_0x40d5f5){_0x4f350e=_0x4f350e||0x1f4;return function(_0x53cc78){logger[_0xfd06('0x4')](_0xfd06('0x5'),_0x40d5f5,_0x4f350e,util[_0xfd06('0x6')](_0x53cc78,{'showHidden':![],'depth':null}));delete _0x53cc78[_0xfd06('0x7')];_0x288497[_0xfd06('0x8')](_0x4f350e)[_0xfd06('0x9')](_0x53cc78);};}exports[_0xfd06('0xa')]=function(_0x435118,_0x4ef86c){return info['getAllData']()[_0xfd06('0xb')](function(_0x2f475f){return _0x4ef86c[_0xfd06('0x8')](0xc8)[_0xfd06('0xc')](_0x2f475f);})[_0xfd06('0xd')](function(_0x142e6c){return _0x4ef86c[_0xfd06('0x8')](0x1f4)[_0xfd06('0xc')](_0x142e6c);});};exports['killProcess']=function(_0x27b9dc,_0x2692bd){var _0x2b211c=[_0xfd06('0xe')];return new BPromise(function(_0x2bcffd,_0x5ca079){return exec(util['format'](_0xfd06('0xf'),_0x27b9dc[_0xfd06('0x10')]['pid']),function(_0x1cf64a,_0xf9cf82,_0x211540){if(_0x1cf64a){return _0x5ca079(_0x1cf64a);}return _0x2bcffd(_0xf9cf82);});})[_0xfd06('0xb')](function(_0x12a325){var _0xfb8832=![];var _0x1145dd=_0x12a325[_0xfd06('0x11')](/\n/);for(var _0x5cd1bb=0x0,_0x3184a5=_0x2b211c[_0xfd06('0x12')];_0x5cd1bb<_0x3184a5,_0xfb8832===![];_0x5cd1bb+=0x1){if(_0x12a325[_0xfd06('0x13')](_0x2b211c[_0x5cd1bb])>=0x0){_0xfb8832=!![];}}if(!_0xfb8832){throw new Error(util['format'](_0xfd06('0x14'),_0x27b9dc['params'][_0xfd06('0x15')]));}process['kill'](_0x27b9dc[_0xfd06('0x10')][_0xfd06('0x15')],_0xfd06('0x16'));return _0x2692bd[_0xfd06('0x8')](0xc8)['json']({'message':util[_0xfd06('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27b9dc[_0xfd06('0x10')][_0xfd06('0x15')])});})['catch'](handleError(_0x2692bd,null,_0xfd06('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a642e00..1fedc36 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 _0x9ccf=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x9ccf,0x10f));var _0xf9cc=function(_0x2680e3,_0x243387){_0x2680e3=_0x2680e3-0x0;var _0x3e789f=_0x9ccf[_0x2680e3];return _0x3e789f;};'use strict';var multer=require(_0xf9cc('0x0'));var util=require('util');var path=require(_0xf9cc('0x1'));var timeout=require(_0xf9cc('0x2'));var express=require(_0xf9cc('0x3'));var router=express['Router']();var fs_extra=require(_0xf9cc('0x4'));var auth=require(_0xf9cc('0x5'));var interaction=require(_0xf9cc('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xf9cc('0x7')]('/',auth['isAuthenticated'](),controller[_0xf9cc('0x8')]);router[_0xf9cc('0x7')](_0xf9cc('0x9'),auth[_0xf9cc('0xa')](),controller[_0xf9cc('0xb')]);router[_0xf9cc('0xc')]('/',auth['isAuthenticated'](),controller[_0xf9cc('0xd')]);router[_0xf9cc('0xe')](_0xf9cc('0x9'),auth[_0xf9cc('0xa')](),controller[_0xf9cc('0xf')]);router[_0xf9cc('0x10')]('/:id',auth[_0xf9cc('0xa')](),controller['destroy']);module[_0xf9cc('0x11')]=router; \ No newline at end of file +var _0x251f=['isAuthenticated','get','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x1ca4cc,_0x402c23){var _0x108010=function(_0x4c5082){while(--_0x4c5082){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x108010(++_0x402c23);}(_0x251f,0xbe));var _0xf251=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x251f[_0x96f74c];return _0x379222;};'use strict';var multer=require(_0xf251('0x0'));var util=require(_0xf251('0x1'));var path=require(_0xf251('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf251('0x3')]();var fs_extra=require(_0xf251('0x4'));var auth=require(_0xf251('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf251('0x6'));var controller=require(_0xf251('0x7'));router['get']('/',auth[_0xf251('0x8')](),controller['index']);router[_0xf251('0x9')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0xa')]);router[_0xf251('0xb')]('/',auth[_0xf251('0x8')](),controller[_0xf251('0xc')]);router[_0xf251('0xd')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0xe')]);router[_0xf251('0xf')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0x10')]);module[_0xf251('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3a57f0c..a36afcf 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 _0x9b00=['sequelize','exports','STRING','#0091EA'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x9b00,0xcc));var _0x09b0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9b00[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x09b0('0x0'));module[_0x09b0('0x1')]={'name':{'type':Sequelize[_0x09b0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x09b0('0x2')],'defaultValue':_0x09b0('0x3')},'description':{'type':Sequelize[_0x09b0('0x2')]}}; \ No newline at end of file +var _0x85f8=['sequelize','exports','STRING','name','#0091EA'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x85f8,0xd7));var _0x885f=function(_0x21a59c,_0x103ebe){_0x21a59c=_0x21a59c-0x0;var _0x1f39da=_0x85f8[_0x21a59c];return _0x1f39da;};'use strict';var Sequelize=require(_0x885f('0x0'));module[_0x885f('0x1')]={'name':{'type':Sequelize[_0x885f('0x2')],'unique':_0x885f('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x885f('0x2')],'defaultValue':_0x885f('0x4')},'description':{'type':Sequelize[_0x885f('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 5eba3b5..58d84ff 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 _0x0e9f=['stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','Tag','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Tags','UserProfileResource','then','error'];(function(_0x93c709,_0x442178){var _0x9491cb=function(_0x2c70ea){while(--_0x2c70ea){_0x93c709['push'](_0x93c709['shift']());}};_0x9491cb(++_0x442178);}(_0x0e9f,0x116));var _0xf0e9=function(_0x2e08bb,_0x40b30a){_0x2e08bb=_0x2e08bb-0x0;var _0x130cf8=_0x0e9f[_0x2e08bb];return _0x130cf8;};'use strict';var emlformat=require(_0xf0e9('0x0'));var rimraf=require(_0xf0e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0e9('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf0e9('0x4'));var csv=require(_0xf0e9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0e9('0x6'));var _=require('lodash');var squel=require(_0xf0e9('0x7'));var crypto=require(_0xf0e9('0x8'));var jsforce=require(_0xf0e9('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf0e9('0xa'));var Papa=require(_0xf0e9('0xb'));var Redis=require(_0xf0e9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf0e9('0xd'));var as=require(_0xf0e9('0xe'));var hardwareService=require(_0xf0e9('0xf'));var logger=require('../../config/logger')(_0xf0e9('0x10'));var utils=require(_0xf0e9('0x11'));var config=require(_0xf0e9('0x12'));var licenseUtil=require(_0xf0e9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa9d7e3,_0x541cd6){_0x541cd6=_0x541cd6||0xcc;return function(_0x1461af){if(_0x1461af){return _0xa9d7e3[_0xf0e9('0x14')](_0x541cd6);}return _0xa9d7e3['status'](_0x541cd6)[_0xf0e9('0x15')]();};}function respondWithResult(_0x34ebf1,_0x261100){_0x261100=_0x261100||0xc8;return function(_0x1b87cf){if(_0x1b87cf){return _0x34ebf1[_0xf0e9('0x16')](_0x261100)[_0xf0e9('0x17')](_0x1b87cf);}};}function respondWithFilteredResult(_0x5c7787,_0x933fea){return function(_0x1eb36f){if(_0x1eb36f){var _0x4f37b5=typeof _0x933fea[_0xf0e9('0x18')]===_0xf0e9('0x19')&&typeof _0x933fea[_0xf0e9('0x1a')]===_0xf0e9('0x19');var _0x5cf302=_0x1eb36f[_0xf0e9('0x1b')];var _0x2f4ee3=_0x4f37b5?0x0:_0x933fea[_0xf0e9('0x18')];var _0x2987a1=_0x4f37b5?_0x1eb36f['count']:_0x933fea['offset']+_0x933fea[_0xf0e9('0x1a')];var _0x98bb88;if(_0x2987a1>=_0x5cf302){_0x2987a1=_0x5cf302;_0x98bb88=0xc8;}else{_0x98bb88=0xce;}_0x5c7787[_0xf0e9('0x16')](_0x98bb88);return _0x5c7787['set']('Content-Range',_0x2f4ee3+'-'+_0x2987a1+'/'+_0x5cf302)[_0xf0e9('0x17')](_0x1eb36f);}return null;};}function patchUpdates(_0x1ac91f){return function(_0x4992c5){try{jsonpatch[_0xf0e9('0x1c')](_0x4992c5,_0x1ac91f,!![]);}catch(_0x51f313){return BPromise[_0xf0e9('0x1d')](_0x51f313);}return _0x4992c5[_0xf0e9('0x1e')]();};}function saveUpdates(_0x4afcff,_0x5dd652){return function(_0x186fa5){if(_0x186fa5){return _0x186fa5[_0xf0e9('0x1f')](_0x4afcff)['then'](function(_0x1cd143){return _0x1cd143;});}return null;};}function removeEntity(_0x257acb,_0x52612e){return function(_0x2f44ee){if(_0x2f44ee){return _0x2f44ee[_0xf0e9('0x20')]()['then'](function(){var _0x297936=_0x2f44ee[_0xf0e9('0x21')]({'plain':!![]});var _0x9acc21=_0xf0e9('0x22');return db[_0xf0e9('0x23')][_0xf0e9('0x20')]({'where':{'type':_0x9acc21,'resourceId':_0x297936['id']}})[_0xf0e9('0x24')](function(){return _0x2f44ee;});})['then'](function(){_0x257acb['status'](0xcc)[_0xf0e9('0x15')]();});}};}function handleEntityNotFound(_0x4f9e96,_0x553788){return function(_0x5aac7f){if(!_0x5aac7f){_0x4f9e96[_0xf0e9('0x14')](0x194);}return _0x5aac7f;};}function handleError(_0x8fd443,_0x5620a5){_0x5620a5=_0x5620a5||0x1f4;return function(_0x258927){logger[_0xf0e9('0x25')](_0x258927[_0xf0e9('0x26')]);if(_0x258927['name']){delete _0x258927[_0xf0e9('0x27')];}_0x8fd443[_0xf0e9('0x16')](_0x5620a5)[_0xf0e9('0x28')](_0x258927);};}exports[_0xf0e9('0x29')]=function(_0x435252,_0xf90eea){var _0x15603d={},_0x1cd461={},_0x4957df={'count':0x0,'rows':[]};var _0x334be1=_[_0xf0e9('0x2a')](db['Tag']['rawAttributes'],function(_0x25452f){return{'name':_0x25452f[_0xf0e9('0x2b')],'type':_0x25452f['type'][_0xf0e9('0x2c')]};});_0x1cd461[_0xf0e9('0x2d')]=_[_0xf0e9('0x2a')](_0x334be1,_0xf0e9('0x27'));_0x1cd461[_0xf0e9('0x2e')]=_[_0xf0e9('0x2f')](_0x435252[_0xf0e9('0x2e')]);_0x1cd461[_0xf0e9('0x30')]=_['intersection'](_0x1cd461[_0xf0e9('0x2d')],_0x1cd461[_0xf0e9('0x2e')]);_0x15603d['attributes']=_[_0xf0e9('0x31')](_0x1cd461['model'],qs[_0xf0e9('0x32')](_0x435252['query']['fields']));_0x15603d[_0xf0e9('0x33')]=_0x15603d[_0xf0e9('0x33')][_0xf0e9('0x34')]?_0x15603d[_0xf0e9('0x33')]:_0x1cd461[_0xf0e9('0x2d')];if(!_0x435252[_0xf0e9('0x2e')]['hasOwnProperty'](_0xf0e9('0x35'))){_0x15603d[_0xf0e9('0x1a')]=qs[_0xf0e9('0x1a')](_0x435252['query'][_0xf0e9('0x1a')]);_0x15603d[_0xf0e9('0x18')]=qs[_0xf0e9('0x18')](_0x435252[_0xf0e9('0x2e')][_0xf0e9('0x18')]);}_0x15603d[_0xf0e9('0x36')]=qs[_0xf0e9('0x37')](_0x435252[_0xf0e9('0x2e')][_0xf0e9('0x37')]);_0x15603d[_0xf0e9('0x38')]=qs['filters'](_[_0xf0e9('0x39')](_0x435252[_0xf0e9('0x2e')],_0x1cd461['filters']),_0x334be1);if(_0x435252[_0xf0e9('0x2e')][_0xf0e9('0x3a')]){_0x15603d[_0xf0e9('0x38')]=_[_0xf0e9('0x3b')](_0x15603d[_0xf0e9('0x38')],{'$or':_['map'](_0x334be1,function(_0xc5ab58){if(_0xc5ab58[_0xf0e9('0x3c')]!=='VIRTUAL'){var _0x27173f={};_0x27173f[_0xc5ab58['name']]={'$like':'%'+_0x435252[_0xf0e9('0x2e')]['filter']+'%'};return _0x27173f;}})});}_0x15603d=_[_0xf0e9('0x3b')]({},_0x15603d,_0x435252[_0xf0e9('0x3d')]);var _0x53f906={'where':_0x15603d[_0xf0e9('0x38')]};return db['Tag']['count'](_0x53f906)['then'](function(_0x3935d8){_0x4957df[_0xf0e9('0x1b')]=_0x3935d8;if(_0x435252[_0xf0e9('0x2e')][_0xf0e9('0x3e')]){_0x15603d['include']=[{'all':!![]}];}return db[_0xf0e9('0x3f')][_0xf0e9('0x40')](_0x15603d);})['then'](function(_0x587259){_0x4957df[_0xf0e9('0x41')]=_0x587259;return _0x4957df;})[_0xf0e9('0x24')](respondWithFilteredResult(_0xf90eea,_0x15603d))[_0xf0e9('0x42')](handleError(_0xf90eea,null));};exports[_0xf0e9('0x43')]=function(_0x1e9c7e,_0x4973e4){var _0xeca5ad={'raw':!![],'where':{'id':_0x1e9c7e[_0xf0e9('0x44')]['id']}},_0x75c120={};_0x75c120[_0xf0e9('0x2d')]=_[_0xf0e9('0x2f')](db[_0xf0e9('0x3f')][_0xf0e9('0x45')]);_0x75c120['query']=_[_0xf0e9('0x2f')](_0x1e9c7e[_0xf0e9('0x2e')]);_0x75c120[_0xf0e9('0x30')]=_[_0xf0e9('0x31')](_0x75c120['model'],_0x75c120[_0xf0e9('0x2e')]);_0xeca5ad[_0xf0e9('0x33')]=_[_0xf0e9('0x31')](_0x75c120['model'],qs[_0xf0e9('0x32')](_0x1e9c7e[_0xf0e9('0x2e')][_0xf0e9('0x32')]));_0xeca5ad[_0xf0e9('0x33')]=_0xeca5ad[_0xf0e9('0x33')][_0xf0e9('0x34')]?_0xeca5ad[_0xf0e9('0x33')]:_0x75c120[_0xf0e9('0x2d')];if(_0x1e9c7e[_0xf0e9('0x2e')][_0xf0e9('0x3e')]){_0xeca5ad[_0xf0e9('0x46')]=[{'all':!![]}];}_0xeca5ad=_[_0xf0e9('0x3b')]({},_0xeca5ad,_0x1e9c7e[_0xf0e9('0x3d')]);return db[_0xf0e9('0x3f')][_0xf0e9('0x47')](_0xeca5ad)[_0xf0e9('0x24')](handleEntityNotFound(_0x4973e4,null))[_0xf0e9('0x24')](respondWithResult(_0x4973e4,null))[_0xf0e9('0x42')](handleError(_0x4973e4,null));};exports[_0xf0e9('0x48')]=function(_0x39def0,_0x3250d7){return db[_0xf0e9('0x3f')][_0xf0e9('0x48')](_0x39def0[_0xf0e9('0x49')],{})[_0xf0e9('0x24')](function(_0x1dd435){var _0x54bd5d=_0x39def0[_0xf0e9('0x4a')][_0xf0e9('0x21')]({'plain':!![]});if(!_0x54bd5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54bd5d[_0xf0e9('0x4b')]===_0xf0e9('0x4a')){var _0x26789c=_0x1dd435[_0xf0e9('0x21')]({'plain':!![]});var _0x13b750='Tags';return db[_0xf0e9('0x4c')]['find']({'where':{'name':_0x13b750,'userProfileId':_0x54bd5d[_0xf0e9('0x4d')]},'raw':!![]})['then'](function(_0x41fba9){if(_0x41fba9&&_0x41fba9[_0xf0e9('0x4e')]===0x0){return db[_0xf0e9('0x23')][_0xf0e9('0x48')]({'name':_0x26789c['name'],'resourceId':_0x26789c['id'],'type':_0x41fba9['name'],'sectionId':_0x41fba9['id']},{})[_0xf0e9('0x24')](function(){return _0x1dd435;});}else{return _0x1dd435;}})['catch'](function(_0x4301c9){logger[_0xf0e9('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4301c9);throw _0x4301c9;});}return _0x1dd435;})[_0xf0e9('0x24')](respondWithResult(_0x3250d7,0xc9))['catch'](handleError(_0x3250d7,null));};exports[_0xf0e9('0x1f')]=function(_0x53ffe0,_0x210445){if(_0x53ffe0['body']['id']){delete _0x53ffe0[_0xf0e9('0x49')]['id'];}return db[_0xf0e9('0x3f')][_0xf0e9('0x47')]({'where':{'id':_0x53ffe0[_0xf0e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x210445,null))[_0xf0e9('0x24')](saveUpdates(_0x53ffe0['body'],null))[_0xf0e9('0x24')](respondWithResult(_0x210445,null))['catch'](handleError(_0x210445,null));};exports[_0xf0e9('0x20')]=function(_0xdf199b,_0x43fdc5){return db[_0xf0e9('0x3f')]['find']({'where':{'id':_0xdf199b[_0xf0e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x43fdc5,null))[_0xf0e9('0x24')](removeEntity(_0x43fdc5,null))['catch'](handleError(_0x43fdc5,null));}; \ No newline at end of file +var _0x4d9e=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Tag','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5d384b,_0x4fccf3){_0x5d384b=_0x5d384b-0x0;var _0xea82ac=_0x4d9e[_0x5d384b];return _0xea82ac;};'use strict';var emlformat=require(_0xe4d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe4d9('0x1'));var rp=require('request-promise');var moment=require(_0xe4d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe4d9('0x3'));var util=require(_0xe4d9('0x4'));var path=require('path');var sox=require(_0xe4d9('0x5'));var csv=require(_0xe4d9('0x6'));var ejs=require(_0xe4d9('0x7'));var fs=require('fs');var fs_extra=require(_0xe4d9('0x8'));var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x6'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var as=require(_0xe4d9('0x11'));var hardwareService=require(_0xe4d9('0x12'));var logger=require(_0xe4d9('0x13'))(_0xe4d9('0x14'));var utils=require(_0xe4d9('0x15'));var config=require(_0xe4d9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x580c50,_0x4e0d15){_0x4e0d15=_0x4e0d15||0xcc;return function(_0x564383){if(_0x564383){return _0x580c50['sendStatus'](_0x4e0d15);}return _0x580c50['status'](_0x4e0d15)['end']();};}function respondWithResult(_0x15c0eb,_0x3238d4){_0x3238d4=_0x3238d4||0xc8;return function(_0x3f884c){if(_0x3f884c){return _0x15c0eb['status'](_0x3238d4)[_0xe4d9('0x17')](_0x3f884c);}};}function respondWithFilteredResult(_0x3f6ce4,_0xe4f133){return function(_0x4283f7){if(_0x4283f7){var _0x58d0cf=typeof _0xe4f133[_0xe4d9('0x18')]===_0xe4d9('0x19')&&typeof _0xe4f133[_0xe4d9('0x1a')]==='undefined';var _0x4d2afd=_0x4283f7[_0xe4d9('0x1b')];var _0x112315=_0x58d0cf?0x0:_0xe4f133['offset'];var _0x2e1490=_0x58d0cf?_0x4283f7['count']:_0xe4f133[_0xe4d9('0x18')]+_0xe4f133[_0xe4d9('0x1a')];var _0x1ea096;if(_0x2e1490>=_0x4d2afd){_0x2e1490=_0x4d2afd;_0x1ea096=0xc8;}else{_0x1ea096=0xce;}_0x3f6ce4[_0xe4d9('0x1c')](_0x1ea096);return _0x3f6ce4['set'](_0xe4d9('0x1d'),_0x112315+'-'+_0x2e1490+'/'+_0x4d2afd)[_0xe4d9('0x17')](_0x4283f7);}return null;};}function patchUpdates(_0x151220){return function(_0x171224){try{jsonpatch[_0xe4d9('0x1e')](_0x171224,_0x151220,!![]);}catch(_0x1146fc){return BPromise[_0xe4d9('0x1f')](_0x1146fc);}return _0x171224[_0xe4d9('0x20')]();};}function saveUpdates(_0x562bab,_0x4fed7f){return function(_0x44f1aa){if(_0x44f1aa){return _0x44f1aa[_0xe4d9('0x21')](_0x562bab)['then'](function(_0x189dad){return _0x189dad;});}return null;};}function removeEntity(_0x50d377,_0x14f3d7){return function(_0x125320){if(_0x125320){return _0x125320['destroy']()[_0xe4d9('0x22')](function(){var _0x32e7da=_0x125320['get']({'plain':!![]});var _0xc5be1b=_0xe4d9('0x23');return db[_0xe4d9('0x24')]['destroy']({'where':{'type':_0xc5be1b,'resourceId':_0x32e7da['id']}})['then'](function(){return _0x125320;});})[_0xe4d9('0x22')](function(){_0x50d377[_0xe4d9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dddd2,_0x4954b5){return function(_0x529e2b){if(!_0x529e2b){_0x5dddd2[_0xe4d9('0x25')](0x194);}return _0x529e2b;};}function handleError(_0x48d481,_0x40ffd0){_0x40ffd0=_0x40ffd0||0x1f4;return function(_0x1f3d90){logger[_0xe4d9('0x26')](_0x1f3d90['stack']);if(_0x1f3d90[_0xe4d9('0x27')]){delete _0x1f3d90[_0xe4d9('0x27')];}_0x48d481[_0xe4d9('0x1c')](_0x40ffd0)[_0xe4d9('0x28')](_0x1f3d90);};}exports[_0xe4d9('0x29')]=function(_0x1904d1,_0x21b7a9){var _0x449cb8={},_0x1fb637={},_0x3e6ea7={'count':0x0,'rows':[]};var _0x519c18=_[_0xe4d9('0x2a')](db['Tag'][_0xe4d9('0x2b')],function(_0x349be3){return{'name':_0x349be3[_0xe4d9('0x2c')],'type':_0x349be3[_0xe4d9('0x2d')][_0xe4d9('0x2e')]};});_0x1fb637[_0xe4d9('0x2f')]=_['map'](_0x519c18,'name');_0x1fb637['query']=_[_0xe4d9('0x30')](_0x1904d1[_0xe4d9('0x31')]);_0x1fb637[_0xe4d9('0x32')]=_['intersection'](_0x1fb637['model'],_0x1fb637['query']);_0x449cb8['attributes']=_[_0xe4d9('0x33')](_0x1fb637[_0xe4d9('0x2f')],qs['fields'](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x34')]));_0x449cb8['attributes']=_0x449cb8[_0xe4d9('0x35')][_0xe4d9('0x36')]?_0x449cb8[_0xe4d9('0x35')]:_0x1fb637[_0xe4d9('0x2f')];if(!_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x37')](_0xe4d9('0x38'))){_0x449cb8[_0xe4d9('0x1a')]=qs[_0xe4d9('0x1a')](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x1a')]);_0x449cb8[_0xe4d9('0x18')]=qs[_0xe4d9('0x18')](_0x1904d1[_0xe4d9('0x31')]['offset']);}_0x449cb8[_0xe4d9('0x39')]=qs[_0xe4d9('0x3a')](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x3a')]);_0x449cb8[_0xe4d9('0x3b')]=qs[_0xe4d9('0x32')](_[_0xe4d9('0x3c')](_0x1904d1[_0xe4d9('0x31')],_0x1fb637[_0xe4d9('0x32')]),_0x519c18);if(_0x1904d1['query']['filter']){_0x449cb8['where']=_[_0xe4d9('0x3d')](_0x449cb8[_0xe4d9('0x3b')],{'$or':_[_0xe4d9('0x2a')](_0x519c18,function(_0x2770a2){if(_0x2770a2[_0xe4d9('0x2d')]!==_0xe4d9('0x3e')){var _0x392cdd={};_0x392cdd[_0x2770a2['name']]={'$like':'%'+_0x1904d1['query']['filter']+'%'};return _0x392cdd;}})});}_0x449cb8=_[_0xe4d9('0x3d')]({},_0x449cb8,_0x1904d1[_0xe4d9('0x3f')]);var _0x5a908b={'where':_0x449cb8[_0xe4d9('0x3b')]};return db[_0xe4d9('0x40')][_0xe4d9('0x1b')](_0x5a908b)[_0xe4d9('0x22')](function(_0x5d0476){_0x3e6ea7[_0xe4d9('0x1b')]=_0x5d0476;if(_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x41')]){_0x449cb8[_0xe4d9('0x42')]=[{'all':!![]}];}return db[_0xe4d9('0x40')][_0xe4d9('0x43')](_0x449cb8);})[_0xe4d9('0x22')](function(_0x3e9653){_0x3e6ea7[_0xe4d9('0x44')]=_0x3e9653;return _0x3e6ea7;})[_0xe4d9('0x22')](respondWithFilteredResult(_0x21b7a9,_0x449cb8))[_0xe4d9('0x45')](handleError(_0x21b7a9,null));};exports['show']=function(_0x429be,_0x449230){var _0x4857fe={'raw':!![],'where':{'id':_0x429be[_0xe4d9('0x46')]['id']}},_0x2b7e25={};_0x2b7e25['model']=_[_0xe4d9('0x30')](db[_0xe4d9('0x40')][_0xe4d9('0x2b')]);_0x2b7e25[_0xe4d9('0x31')]=_[_0xe4d9('0x30')](_0x429be[_0xe4d9('0x31')]);_0x2b7e25[_0xe4d9('0x32')]=_[_0xe4d9('0x33')](_0x2b7e25[_0xe4d9('0x2f')],_0x2b7e25[_0xe4d9('0x31')]);_0x4857fe['attributes']=_[_0xe4d9('0x33')](_0x2b7e25[_0xe4d9('0x2f')],qs[_0xe4d9('0x34')](_0x429be['query'][_0xe4d9('0x34')]));_0x4857fe[_0xe4d9('0x35')]=_0x4857fe[_0xe4d9('0x35')][_0xe4d9('0x36')]?_0x4857fe[_0xe4d9('0x35')]:_0x2b7e25[_0xe4d9('0x2f')];if(_0x429be[_0xe4d9('0x31')]['includeAll']){_0x4857fe[_0xe4d9('0x42')]=[{'all':!![]}];}_0x4857fe=_[_0xe4d9('0x3d')]({},_0x4857fe,_0x429be[_0xe4d9('0x3f')]);return db[_0xe4d9('0x40')][_0xe4d9('0x47')](_0x4857fe)[_0xe4d9('0x22')](handleEntityNotFound(_0x449230,null))['then'](respondWithResult(_0x449230,null))[_0xe4d9('0x45')](handleError(_0x449230,null));};exports[_0xe4d9('0x48')]=function(_0x87f230,_0x38468c){return db[_0xe4d9('0x40')][_0xe4d9('0x48')](_0x87f230['body'],{})[_0xe4d9('0x22')](function(_0x29e038){var _0x53e7c4=_0x87f230[_0xe4d9('0x49')]['get']({'plain':!![]});if(!_0x53e7c4)throw new Error(_0xe4d9('0x4a'));if(_0x53e7c4[_0xe4d9('0x4b')]==='user'){var _0x657961=_0x29e038['get']({'plain':!![]});var _0x27a5e4=_0xe4d9('0x23');return db[_0xe4d9('0x4c')]['find']({'where':{'name':_0x27a5e4,'userProfileId':_0x53e7c4[_0xe4d9('0x4d')]},'raw':!![]})[_0xe4d9('0x22')](function(_0x4d5ff9){if(_0x4d5ff9&&_0x4d5ff9[_0xe4d9('0x4e')]===0x0){return db[_0xe4d9('0x24')][_0xe4d9('0x48')]({'name':_0x657961[_0xe4d9('0x27')],'resourceId':_0x657961['id'],'type':_0x4d5ff9['name'],'sectionId':_0x4d5ff9['id']},{})['then'](function(){return _0x29e038;});}else{return _0x29e038;}})[_0xe4d9('0x45')](function(_0x40674d){logger[_0xe4d9('0x26')](_0xe4d9('0x4f'),_0x40674d);throw _0x40674d;});}return _0x29e038;})[_0xe4d9('0x22')](respondWithResult(_0x38468c,0xc9))[_0xe4d9('0x45')](handleError(_0x38468c,null));};exports['update']=function(_0x5a57ad,_0x2c5500){if(_0x5a57ad[_0xe4d9('0x50')]['id']){delete _0x5a57ad[_0xe4d9('0x50')]['id'];}return db[_0xe4d9('0x40')][_0xe4d9('0x47')]({'where':{'id':_0x5a57ad[_0xe4d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c5500,null))[_0xe4d9('0x22')](saveUpdates(_0x5a57ad[_0xe4d9('0x50')],null))[_0xe4d9('0x22')](respondWithResult(_0x2c5500,null))['catch'](handleError(_0x2c5500,null));};exports[_0xe4d9('0x51')]=function(_0x2b6d70,_0x281fda){return db['Tag'][_0xe4d9('0x47')]({'where':{'id':_0x2b6d70['params']['id']}})[_0xe4d9('0x22')](handleEntityNotFound(_0x281fda,null))[_0xe4d9('0x22')](removeEntity(_0x281fda,null))[_0xe4d9('0x45')](handleError(_0x281fda,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 8d9e24d..516bc8d 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 _0x8d12=['bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','util'];(function(_0x28ca89,_0x241c99){var _0x16c11d=function(_0x4133f4){while(--_0x4133f4){_0x28ca89['push'](_0x28ca89['shift']());}};_0x16c11d(++_0x241c99);}(_0x8d12,0x8a));var _0x28d1=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x8d12[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x28d1('0x0'));var util=require(_0x28d1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x28d1('0x2'));var rp=require(_0x28d1('0x3'));var fs=require('fs');var path=require(_0x28d1('0x4'));var rimraf=require('rimraf');var config=require(_0x28d1('0x5'));var attributes=require(_0x28d1('0x6'));module[_0x28d1('0x7')]=function(_0x69ff99,_0x21e0ee){return _0x69ff99[_0x28d1('0x8')]('Tag',attributes,{'tableName':_0x28d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe29d=['./tag.attributes','Tag','tools_tags','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xe29d,0x66));var _0xde29=function(_0x22ea23,_0x5ac0a8){_0x22ea23=_0x22ea23-0x0;var _0x3c7450=_0xe29d[_0x22ea23];return _0x3c7450;};'use strict';var _=require(_0xde29('0x0'));var util=require('util');var logger=require(_0xde29('0x1'))(_0xde29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde29('0x4'));var config=require(_0xde29('0x5'));var attributes=require(_0xde29('0x6'));module['exports']=function(_0x151eb8,_0x17cc46){return _0x151eb8['define'](_0xde29('0x7'),attributes,{'tableName':_0xde29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 65d5b6b..a7c6372 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 _0xae79=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x9f7aec,_0x4e11e3){var _0x5b2ef4=function(_0x587e26){while(--_0x587e26){_0x9f7aec['push'](_0x9f7aec['shift']());}};_0x5b2ef4(++_0x4e11e3);}(_0xae79,0x1d3));var _0x9ae7=function(_0x4ebd91,_0xfadd84){_0x4ebd91=_0x4ebd91-0x0;var _0x12e4e6=_0xae79[_0x4ebd91];return _0x12e4e6;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var moment=require(_0x9ae7('0x2'));var BPromise=require(_0x9ae7('0x3'));var rs=require(_0x9ae7('0x4'));var fs=require('fs');var Redis=require(_0x9ae7('0x5'));var db=require(_0x9ae7('0x6'))['db'];var utils=require(_0x9ae7('0x7'));var logger=require(_0x9ae7('0x8'))(_0x9ae7('0x9'));var config=require(_0x9ae7('0xa'));var jayson=require(_0x9ae7('0xb'));var client=jayson[_0x9ae7('0xc')][_0x9ae7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x57114d,_0x2761c2){return new BPromise(function(_0x47774e,_0x3c7738){return client[_0x9ae7('0xe')](_0x409d34,_0x2761c2)[_0x9ae7('0xf')](function(_0xc023d2){logger['info'](_0x9ae7('0x10'),_0x57114d,'request\x20sent');logger[_0x9ae7('0x11')](_0x9ae7('0x12'),_0x57114d,_0x9ae7('0x13'),JSON[_0x9ae7('0x14')](_0xc023d2));if(_0xc023d2[_0x9ae7('0x15')]){if(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x16')]===0x1f4){logger['error'](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')]['message']);return _0x3c7738(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);}logger[_0x9ae7('0x15')](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);return _0x47774e(_0xc023d2[_0x9ae7('0x15')]['message']);}else{logger[_0x9ae7('0x18')](_0x9ae7('0x10'),_0x57114d,_0x9ae7('0x13'));_0x47774e(_0xc023d2[_0x9ae7('0x19')]['message']);}})[_0x9ae7('0x1a')](function(_0xe1a2d1){logger[_0x9ae7('0x15')]('Tag,\x20%s,\x20%s',_0x57114d,_0xe1a2d1);_0x3c7738(_0xe1a2d1);});});} \ No newline at end of file +var _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x5840dd,_0x3436a6){var _0x6fa495=function(_0x35fc3b){while(--_0x35fc3b){_0x5840dd['push'](_0x5840dd['shift']());}};_0x6fa495(++_0x3436a6);}(_0x2dae,0xc3));var _0xe2da=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x2dae[_0x231dda];return _0x3f88cb;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('Tag,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 608b2f6..2b6708e 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 9490d59..1ecb18e 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(_0x401fd8,_0x5938a2){var _0x4ee28c=function(_0x345f7a){while(--_0x345f7a){_0x401fd8['push'](_0x401fd8['shift']());}};_0x4ee28c(++_0x5938a2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x55e916,_0x30fe3e){var _0x471762=function(_0x11c061){while(--_0x11c061){_0x55e916['push'](_0x55e916['shift']());}};_0x471762(++_0x30fe3e);}(_0x2032,0xd9));var _0x2203=function(_0x5e92ec,_0x150a90){_0x5e92ec=_0x5e92ec-0x0;var _0x5670cd=_0x2032[_0x5e92ec];return _0x5670cd;};'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/team/team.controller.js b/server/api/team/team.controller.js index 7c3faac..bdd7a0e 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 _0xf13e=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','Teams','destroy','end','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','keys','filters','attributes','intersection','fields','query','length','nolimit','sort','pick','VIRTUAL','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','user','UserProfileSection','autoAssociation','UserProfileResource','getQueues','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','order','findOne','isValidChannel','ValidationError','add','Queues','ids','remove','addAgents','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','User','online','UserVoiceQueueRt','isNil','SIP/%s','interface','voicePause','all','TeamVoicePrefix','UserVoicePrefix','upsert','VoicePrefixId','removeAgents','Mail','Queue:remove','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel'];(function(_0x1b51d2,_0x578adc){var _0x18061f=function(_0x381ebd){while(--_0x381ebd){_0x1b51d2['push'](_0x1b51d2['shift']());}};_0x18061f(++_0x578adc);}(_0xf13e,0xf8));var _0xef13=function(_0x3d9565,_0x5db973){_0x3d9565=_0x3d9565-0x0;var _0x546f66=_0xf13e[_0x3d9565];return _0x546f66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef13('0x0'));var zipdir=require(_0xef13('0x1'));var jsonpatch=require(_0xef13('0x2'));var rp=require(_0xef13('0x3'));var moment=require(_0xef13('0x4'));var BPromise=require(_0xef13('0x5'));var Mustache=require('mustache');var util=require(_0xef13('0x6'));var path=require('path');var sox=require(_0xef13('0x7'));var csv=require(_0xef13('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef13('0x9'));var _=require(_0xef13('0xa'));var squel=require(_0xef13('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xef13('0xc'));var Papa=require(_0xef13('0xd'));var Redis=require('ioredis');var authService=require(_0xef13('0xe'));var qs=require(_0xef13('0xf'));var as=require(_0xef13('0x10'));var hardwareService=require(_0xef13('0x11'));var logger=require(_0xef13('0x12'))(_0xef13('0x13'));var utils=require(_0xef13('0x14'));var config=require(_0xef13('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xef13('0x16'))['db'];config[_0xef13('0x17')]=_[_0xef13('0x18')](config[_0xef13('0x17')],{'host':_0xef13('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef13('0x17')]));require(_0xef13('0x1a'))[_0xef13('0x1b')](socket);function respondWithStatusCode(_0x3d1add,_0x1ae5c3){_0x1ae5c3=_0x1ae5c3||0xcc;return function(_0x24fbf5){if(_0x24fbf5){return _0x3d1add[_0xef13('0x1c')](_0x1ae5c3);}return _0x3d1add[_0xef13('0x1d')](_0x1ae5c3)['end']();};}function respondWithResult(_0xc3ee39,_0x5ed1eb){_0x5ed1eb=_0x5ed1eb||0xc8;return function(_0x3bf6ed){if(_0x3bf6ed){return _0xc3ee39[_0xef13('0x1d')](_0x5ed1eb)[_0xef13('0x1e')](_0x3bf6ed);}};}function respondWithFilteredResult(_0x32fa59,_0x3d74cc){return function(_0x3130dc){if(_0x3130dc){var _0x34228d=typeof _0x3d74cc[_0xef13('0x1f')]===_0xef13('0x20')&&typeof _0x3d74cc[_0xef13('0x21')]===_0xef13('0x20');var _0x3f64b5=_0x3130dc[_0xef13('0x22')];var _0x175ba8=_0x34228d?0x0:_0x3d74cc[_0xef13('0x1f')];var _0x26c7cf=_0x34228d?_0x3130dc[_0xef13('0x22')]:_0x3d74cc[_0xef13('0x1f')]+_0x3d74cc[_0xef13('0x21')];var _0x1120c0;if(_0x26c7cf>=_0x3f64b5){_0x26c7cf=_0x3f64b5;_0x1120c0=0xc8;}else{_0x1120c0=0xce;}_0x32fa59[_0xef13('0x1d')](_0x1120c0);return _0x32fa59[_0xef13('0x23')](_0xef13('0x24'),_0x175ba8+'-'+_0x26c7cf+'/'+_0x3f64b5)[_0xef13('0x1e')](_0x3130dc);}return null;};}function patchUpdates(_0x2eb36e){return function(_0x45cc77){try{jsonpatch[_0xef13('0x25')](_0x45cc77,_0x2eb36e,!![]);}catch(_0x386856){return BPromise['reject'](_0x386856);}return _0x45cc77[_0xef13('0x26')]();};}function saveUpdates(_0x25172b,_0x15e6a8){return function(_0x8e9a64){if(_0x8e9a64){return _0x8e9a64[_0xef13('0x27')](_0x25172b)['then'](function(_0x57ab98){return _0x57ab98;});}return null;};}function removeEntity(_0x60a255,_0x1e1a63){return function(_0x59fa40){if(_0x59fa40){return _0x59fa40['destroy']()[_0xef13('0x28')](function(){var _0x21ca5c=_0x59fa40['get']({'plain':!![]});var _0x3e848c=_0xef13('0x29');return db['UserProfileResource'][_0xef13('0x2a')]({'where':{'type':_0x3e848c,'resourceId':_0x21ca5c['id']}})['then'](function(){return _0x59fa40;});})[_0xef13('0x28')](function(){_0x60a255[_0xef13('0x1d')](0xcc)[_0xef13('0x2b')]();});}};}function handleEntityNotFound(_0x595229,_0x416fb9){return function(_0x14884a){if(!_0x14884a){_0x595229['sendStatus'](0x194);}return _0x14884a;};}function handleError(_0x57070f,_0x11b5cd){_0x11b5cd=_0x11b5cd||0x1f4;return function(_0x2f7f1d){logger[_0xef13('0x2c')](_0x2f7f1d[_0xef13('0x2d')]);if(_0x2f7f1d[_0xef13('0x2e')]){delete _0x2f7f1d[_0xef13('0x2e')];}_0x57070f[_0xef13('0x1d')](_0x11b5cd)[_0xef13('0x2f')](_0x2f7f1d);};}exports[_0xef13('0x30')]=function(_0x23dba4,_0x43691a){var _0x5d8b99={},_0x4b4660={},_0x22ab9f={'count':0x0,'rows':[]};var _0x19dd63=_[_0xef13('0x31')](db[_0xef13('0x32')][_0xef13('0x33')],function(_0x1be47e){return{'name':_0x1be47e[_0xef13('0x34')],'type':_0x1be47e[_0xef13('0x35')]['key']};});_0x4b4660[_0xef13('0x36')]=_['map'](_0x19dd63,_0xef13('0x2e'));_0x4b4660['query']=_[_0xef13('0x37')](_0x23dba4['query']);_0x4b4660[_0xef13('0x38')]=_['intersection'](_0x4b4660[_0xef13('0x36')],_0x4b4660['query']);_0x5d8b99[_0xef13('0x39')]=_[_0xef13('0x3a')](_0x4b4660[_0xef13('0x36')],qs[_0xef13('0x3b')](_0x23dba4[_0xef13('0x3c')][_0xef13('0x3b')]));_0x5d8b99['attributes']=_0x5d8b99[_0xef13('0x39')][_0xef13('0x3d')]?_0x5d8b99[_0xef13('0x39')]:_0x4b4660[_0xef13('0x36')];if(!_0x23dba4[_0xef13('0x3c')]['hasOwnProperty'](_0xef13('0x3e'))){_0x5d8b99['limit']=qs[_0xef13('0x21')](_0x23dba4[_0xef13('0x3c')][_0xef13('0x21')]);_0x5d8b99[_0xef13('0x1f')]=qs[_0xef13('0x1f')](_0x23dba4['query'][_0xef13('0x1f')]);}_0x5d8b99['order']=qs[_0xef13('0x3f')](_0x23dba4['query'][_0xef13('0x3f')]);_0x5d8b99['where']=qs['filters'](_[_0xef13('0x40')](_0x23dba4['query'],_0x4b4660[_0xef13('0x38')]),_0x19dd63);if(_0x23dba4[_0xef13('0x3c')]['filter']){_0x5d8b99['where']=_['merge'](_0x5d8b99['where'],{'$or':_[_0xef13('0x31')](_0x19dd63,function(_0x313fa2){if(_0x313fa2[_0xef13('0x35')]!==_0xef13('0x41')){var _0x4a40ed={};_0x4a40ed[_0x313fa2[_0xef13('0x2e')]]={'$like':'%'+_0x23dba4[_0xef13('0x3c')][_0xef13('0x42')]+'%'};return _0x4a40ed;}})});}_0x5d8b99=_[_0xef13('0x43')]({},_0x5d8b99,_0x23dba4[_0xef13('0x44')]);var _0x268915={'where':_0x5d8b99[_0xef13('0x45')]};return db[_0xef13('0x32')][_0xef13('0x22')](_0x268915)[_0xef13('0x28')](function(_0x301350){_0x22ab9f[_0xef13('0x22')]=_0x301350;if(_0x23dba4[_0xef13('0x3c')][_0xef13('0x46')]){_0x5d8b99[_0xef13('0x47')]=[{'all':!![]}];}return db[_0xef13('0x32')][_0xef13('0x48')](_0x5d8b99);})[_0xef13('0x28')](function(_0xa7df1e){_0x22ab9f[_0xef13('0x49')]=_0xa7df1e;return _0x22ab9f;})[_0xef13('0x28')](respondWithFilteredResult(_0x43691a,_0x5d8b99))[_0xef13('0x4a')](handleError(_0x43691a,null));};exports[_0xef13('0x4b')]=function(_0x3fe923,_0x16734e){var _0x3e2117={'raw':![],'where':{'id':_0x3fe923[_0xef13('0x4c')]['id']}},_0x3f4de6={};_0x3f4de6[_0xef13('0x36')]=_[_0xef13('0x37')](db[_0xef13('0x32')]['rawAttributes']);_0x3f4de6[_0xef13('0x3c')]=_[_0xef13('0x37')](_0x3fe923[_0xef13('0x3c')]);_0x3f4de6['filters']=_['intersection'](_0x3f4de6['model'],_0x3f4de6[_0xef13('0x3c')]);_0x3e2117['attributes']=_[_0xef13('0x3a')](_0x3f4de6['model'],qs['fields'](_0x3fe923[_0xef13('0x3c')][_0xef13('0x3b')]));_0x3e2117[_0xef13('0x39')]=_0x3e2117['attributes'][_0xef13('0x3d')]?_0x3e2117[_0xef13('0x39')]:_0x3f4de6[_0xef13('0x36')];if(_0x3fe923[_0xef13('0x3c')][_0xef13('0x46')]){_0x3e2117[_0xef13('0x47')]=[{'all':!![]}];}_0x3e2117=_[_0xef13('0x43')]({},_0x3e2117,_0x3fe923['options']);return db[_0xef13('0x32')][_0xef13('0x4d')](_0x3e2117)[_0xef13('0x28')](handleEntityNotFound(_0x16734e,null))[_0xef13('0x28')](respondWithResult(_0x16734e,null))['catch'](handleError(_0x16734e,null));};exports[_0xef13('0x4e')]=function(_0xf9a394,_0x520710){return db[_0xef13('0x32')]['create'](_0xf9a394[_0xef13('0x4f')],{})['then'](function(_0xc32d33){var _0x311735=_0xf9a394['user'][_0xef13('0x50')]({'plain':!![]});if(!_0x311735)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x311735['role']===_0xef13('0x51')){var _0x1fcb43=_0xc32d33['get']({'plain':!![]});var _0x3fd572='Teams';return db[_0xef13('0x52')]['find']({'where':{'name':_0x3fd572,'userProfileId':_0x311735['userProfileId']},'raw':!![]})[_0xef13('0x28')](function(_0x12ec77){if(_0x12ec77&&_0x12ec77[_0xef13('0x53')]===0x0){return db[_0xef13('0x54')]['create']({'name':_0x1fcb43[_0xef13('0x2e')],'resourceId':_0x1fcb43['id'],'type':_0x12ec77['name'],'sectionId':_0x12ec77['id']},{})[_0xef13('0x28')](function(){return _0xc32d33;});}else{return _0xc32d33;}})['catch'](function(_0x4e2984){logger[_0xef13('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e2984);throw _0x4e2984;});}return _0xc32d33;})['then'](respondWithResult(_0x520710,0xc9))[_0xef13('0x4a')](handleError(_0x520710,null));};exports[_0xef13('0x27')]=function(_0x3e01c8,_0x393a80){if(_0x3e01c8[_0xef13('0x4f')]['id']){delete _0x3e01c8[_0xef13('0x4f')]['id'];}return db[_0xef13('0x32')]['find']({'where':{'id':_0x3e01c8[_0xef13('0x4c')]['id']}})[_0xef13('0x28')](handleEntityNotFound(_0x393a80,null))[_0xef13('0x28')](saveUpdates(_0x3e01c8[_0xef13('0x4f')],null))[_0xef13('0x28')](respondWithResult(_0x393a80,null))[_0xef13('0x4a')](handleError(_0x393a80,null));};exports[_0xef13('0x2a')]=function(_0x255b0f,_0x214c39){return db[_0xef13('0x32')][_0xef13('0x4d')]({'where':{'id':_0x255b0f[_0xef13('0x4c')]['id']}})['then'](handleEntityNotFound(_0x214c39,null))[_0xef13('0x28')](removeEntity(_0x214c39,null))['catch'](handleError(_0x214c39,null));};exports[_0xef13('0x55')]=function(_0x3769af,_0x2c4655,_0x3c81e8){return db[_0xef13('0x32')]['findOne']({'where':{'id':_0x3769af['params']['id']}})[_0xef13('0x28')](handleEntityNotFound(_0x2c4655,null))[_0xef13('0x28')](function(_0x4efeb2){if(!_0x3769af['query']['channel']||!utils['isValidChannel'](_0x3769af[_0xef13('0x3c')][_0xef13('0x56')])){throw new db['Sequelize']['ValidationError'](_0xef13('0x57'));}var _0x578570={};var _0x1a8298={};_0x1a8298[_0xef13('0x36')]=_[_0xef13('0x37')](db[_[_0xef13('0x58')](_0x3769af['query']['channel'][_0xef13('0x59')]())+_0xef13('0x5a')][_0xef13('0x33')]);_0x1a8298[_0xef13('0x3c')]=_[_0xef13('0x37')](_0x3769af['query']);_0x1a8298[_0xef13('0x38')]=_['intersection'](_0x1a8298[_0xef13('0x36')],_0x1a8298[_0xef13('0x3c')]);_0x578570[_0xef13('0x39')]=_[_0xef13('0x3a')](_0x1a8298[_0xef13('0x36')],qs['fields'](_0x3769af[_0xef13('0x3c')][_0xef13('0x3b')]));_0x578570[_0xef13('0x39')]=_0x578570[_0xef13('0x39')][_0xef13('0x3d')]?_0x578570[_0xef13('0x39')]:_0x1a8298['model'];_0x578570[_0xef13('0x21')]=qs[_0xef13('0x21')](_0x3769af['query'][_0xef13('0x21')]);_0x578570[_0xef13('0x1f')]=qs['offset'](_0x3769af['query'][_0xef13('0x1f')]);_0x578570[_0xef13('0x5b')]=qs[_0xef13('0x3f')](_0x3769af[_0xef13('0x3c')][_0xef13('0x3f')]);_0x578570[_0xef13('0x45')]=qs[_0xef13('0x38')](_[_0xef13('0x40')](_0x3769af[_0xef13('0x3c')],_0x1a8298['filters']));_0x578570=_[_0xef13('0x43')]({},_0x578570,_0x3769af['options']);return _0x4efeb2[_0xef13('0x50')+_[_0xef13('0x58')](_0x3769af[_0xef13('0x3c')][_0xef13('0x56')][_0xef13('0x59')]())+'Queues'](_0x578570);})['then'](respondWithResult(_0x2c4655,null))[_0xef13('0x4a')](handleError(_0x2c4655,null));};exports['addQueues']=function(_0x64b900,_0x27f7ae,_0x1bc4f5){return db[_0xef13('0x32')][_0xef13('0x5c')]({'where':{'id':_0x64b900[_0xef13('0x4c')]['id']}})[_0xef13('0x28')](function(_0x5db5e1){if(_0x5db5e1){if(!_0x64b900[_0xef13('0x4f')][_0xef13('0x56')]||!utils[_0xef13('0x5d')](_0x64b900[_0xef13('0x4f')][_0xef13('0x56')])){throw new db['Sequelize'][(_0xef13('0x5e'))](_0xef13('0x57'));}return _0x5db5e1[_0xef13('0x5f')+_['capitalize'](_0x64b900['body']['channel'][_0xef13('0x59')]())+_0xef13('0x60')](_0x64b900[_0xef13('0x4f')][_0xef13('0x61')]);}return null;})[_0xef13('0x28')](handleEntityNotFound(_0x27f7ae,null))[_0xef13('0x28')](respondWithStatusCode(_0x27f7ae,null))['catch'](handleError(_0x27f7ae,null));};exports['removeQueues']=function(_0x5f2828,_0x25db1e,_0x14f3a2){return db['Team'][_0xef13('0x5c')]({'where':{'id':_0x5f2828['params']['id']}})[_0xef13('0x28')](function(_0x580f28){if(_0x580f28){if(!_0x5f2828[_0xef13('0x3c')][_0xef13('0x56')]||!utils[_0xef13('0x5d')](_0x5f2828[_0xef13('0x3c')][_0xef13('0x56')])){throw new db['Sequelize']['ValidationError'](_0xef13('0x57'));}return _0x580f28[_0xef13('0x62')+_[_0xef13('0x58')](_0x5f2828[_0xef13('0x3c')][_0xef13('0x56')]['toLowerCase']())+'Queues'](_0x5f2828[_0xef13('0x3c')][_0xef13('0x61')]);}return null;})['then'](handleEntityNotFound(_0x25db1e,null))[_0xef13('0x28')](respondWithStatusCode(_0x25db1e,null))[_0xef13('0x4a')](handleError(_0x25db1e,null));};exports[_0xef13('0x63')]=function(_0x3c5831,_0x3f561b){return db[_0xef13('0x32')][_0xef13('0x4d')]({'where':{'id':_0x3c5831['params']['id']}})['then'](handleEntityNotFound(_0x3f561b,null))['then'](function(_0x3f5f68){if(_0x3f5f68){var _0x49e3d2=[_0xef13('0x64'),_0xef13('0x65'),'Mail',_0xef13('0x66'),_0xef13('0x67'),_0xef13('0x68'),_0xef13('0x69')];return db[_0xef13('0x6a')][_0xef13('0x6b')](function(_0x421fbf){var _0x34590b=_[_0xef13('0x31')](_0x49e3d2,function(_0x46715a){var _0xdeea18={'attributes':['id','name']};if(_0x46715a===_0xef13('0x64')){_0xdeea18['through']={'attributes':[_0xef13('0x6c')]};}return _0x3f5f68['get'+_0x46715a+_0xef13('0x60')](_0xdeea18)[_0xef13('0x28')](function(_0x5652a0){var _0x2a882f=_[_0xef13('0x31')](_0x5652a0,function(_0x572154){var _0x289a77=_[_0xef13('0x31')](_0x3c5831['body'][_0xef13('0x61')],function(_0x421eb6){var _0x38c5e4={'where':{'UserId':_0x421eb6,[_0x46715a+_0xef13('0x6d')]:_0x572154['id']},'transaction':_0x421fbf};if(_0x46715a===_0xef13('0x64')){_0x38c5e4[_0xef13('0x18')]={'penalty':_0x572154[_0xef13('0x6e')][_0xef13('0x6c')]};}return db['User'+_0x46715a+_0xef13('0x5a')][_0xef13('0x6f')](_0x38c5e4)[_0xef13('0x28')](function(){socket[_0xef13('0x70')]('user'+_0x46715a+'Queue:save',{'UserId':_0x421eb6,[_0x46715a+_0xef13('0x6d')]:_0x572154['id']});if(_0x46715a!=='Voice')return;return db[_0xef13('0x71')]['findAll']({'where':{'id':_0x3c5831[_0xef13('0x4f')][_0xef13('0x61')],'online':0x1},'attributes':['id',_0xef13('0x2e'),_0xef13('0x72'),'voicePause','interface'],'raw':!![]})[_0xef13('0x28')](function(_0xbba02c){var _0x1b7455=_[_0xef13('0x31')](_0xbba02c,function(_0x1a91a8){return db[_0xef13('0x73')]['upsert']({'membername':_0x1a91a8[_0xef13('0x2e')],'UserId':_0x1a91a8['id'],'queue_name':_0x572154[_0xef13('0x2e')],'VoiceQueueId':_0x572154['id'],'interface':_[_0xef13('0x74')](_0x1a91a8['interface'])?util['format'](_0xef13('0x75'),_0x1a91a8[_0xef13('0x2e')]):_0x1a91a8[_0xef13('0x76')],'paused':_0x1a91a8[_0xef13('0x77')]||![],'penalty':_0x572154['TeamVoiceQueue'][_0xef13('0x6c')]},{'transaction':_0x421fbf});});return Promise[_0xef13('0x78')](_0x1b7455);});});});return Promise[_0xef13('0x78')](_0x289a77);});return Promise[_0xef13('0x78')](_0x2a882f);})['then'](function(){var _0x250c68=JSON['parse']('['+_0x3c5831[_0xef13('0x4f')][_0xef13('0x61')]+']');db[_0xef13('0x79')][_0xef13('0x5c')]({'where':{'teamId':_0x3c5831[_0xef13('0x4c')]['id']}})[_0xef13('0x28')](function(_0x5930a5){if(_0x5930a5){for(var _0x1b8d82=0x0;_0x1b8d82<_0x250c68[_0xef13('0x3d')];_0x1b8d82++){var _0x410eec=_0x250c68[_0x1b8d82];db[_0xef13('0x7a')][_0xef13('0x7b')]({'UserId':_0x410eec,'VoicePrefixId':_0x5930a5[_0xef13('0x7c')]});}}});});});return Promise[_0xef13('0x78')](_0x34590b)['then'](function(){return _0x3f5f68[_0xef13('0x63')](_0x3c5831[_0xef13('0x4f')][_0xef13('0x61')],{'transaction':_0x421fbf})['spread'](function(_0x92f517){return _0x92f517;});});});}})[_0xef13('0x28')](respondWithResult(_0x3f561b,null))[_0xef13('0x4a')](handleError(_0x3f561b,null));};exports[_0xef13('0x7d')]=function(_0x3e2055,_0x33c125){return db['Team'][_0xef13('0x4d')]({'where':{'id':_0x3e2055['params']['id']}})['then'](handleEntityNotFound(_0x33c125,null))[_0xef13('0x28')](function(_0x35b3d0){if(_0x35b3d0){var _0x4bd0d0=[_0xef13('0x64'),'Chat',_0xef13('0x7e'),'Sms',_0xef13('0x67'),'Openchannel','Whatsapp'];return db['sequelize'][_0xef13('0x6b')](function(_0x5c6629){var _0x5dbc9b=_[_0xef13('0x31')](_0x4bd0d0,function(_0x1b290d){var _0xc7b807={'attributes':['id',_0xef13('0x2e')]};return _0x35b3d0[_0xef13('0x50')+_0x1b290d+_0xef13('0x60')](_0xc7b807)['then'](function(_0x2d02d6){var _0x55eb8a=_['map'](_0x2d02d6,function(_0x38b967){return _0x38b967['removeAgents'](_0x3e2055[_0xef13('0x3c')][_0xef13('0x61')],{'transaction':_0x5c6629})['then'](function(){var _0x472490=JSON['parse']('['+_0x3e2055[_0xef13('0x3c')][_0xef13('0x61')]+']');var _0x38eee1=_[_0xef13('0x31')](_0x472490,function(_0x247dca){socket['emit'](_0xef13('0x51')+_0x1b290d+_0xef13('0x7f'),{'UserId':Number(_0x247dca),[_0x1b290d+_0xef13('0x6d')]:_0x38b967['id']});if(_0x1b290d!==_0xef13('0x64'))return;return db[_0xef13('0x73')][_0xef13('0x2a')]({'where':{'VoiceQueueId':_0x38b967['id'],'UserId':_0x247dca},'transaction':_0x5c6629});});return Promise[_0xef13('0x78')](_0x38eee1);});});return Promise[_0xef13('0x78')](_0x55eb8a);});});return Promise[_0xef13('0x78')](_0x5dbc9b)['then'](function(){return _0x35b3d0['removeAgents'](_0x3e2055[_0xef13('0x3c')]['ids'],{'transaction':_0x5c6629});})[_0xef13('0x28')](function(){var _0x4c906d=JSON['parse']('['+_0x3e2055[_0xef13('0x3c')][_0xef13('0x61')]+']');db[_0xef13('0x79')][_0xef13('0x5c')]({'where':{'teamId':_0x3e2055[_0xef13('0x4c')]['id']}})[_0xef13('0x28')](function(_0x242fb4){if(_0x242fb4){for(var _0x2c0cbf=0x0;_0x2c0cbf<_0x4c906d[_0xef13('0x3d')];_0x2c0cbf++){var _0x2883cc=_0x4c906d[_0x2c0cbf];db[_0xef13('0x7a')]['destroy']({'where':{'UserId':_0x2883cc,'VoicePrefixId':_0x242fb4[_0xef13('0x7c')]}});}}});});});}})['then'](respondWithStatusCode(_0x33c125,null))[_0xef13('0x4a')](handleError(_0x33c125,null));};exports[_0xef13('0x80')]=function(_0x388c4a,_0x37b583,_0x286efe){var _0x334985={};var _0x1acd8a={};var _0x1d69a9;var _0x3e95e0;return db['Team'][_0xef13('0x5c')]({'where':{'id':_0x388c4a[_0xef13('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37b583,null))['then'](function(_0x27b6f2){if(_0x27b6f2){_0x1d69a9=_0x27b6f2;_0x1acd8a[_0xef13('0x36')]=_[_0xef13('0x37')](db['User']['rawAttributes']);_0x1acd8a[_0xef13('0x3c')]=_[_0xef13('0x37')](_0x388c4a[_0xef13('0x3c')]);_0x1acd8a[_0xef13('0x38')]=_[_0xef13('0x3a')](_0x1acd8a[_0xef13('0x36')],_0x1acd8a[_0xef13('0x3c')]);_0x334985[_0xef13('0x39')]=_['intersection'](_0x1acd8a[_0xef13('0x36')],qs[_0xef13('0x3b')](_0x388c4a[_0xef13('0x3c')][_0xef13('0x3b')]));_0x334985[_0xef13('0x39')]=_0x334985[_0xef13('0x39')]['length']?_0x334985['attributes']:_0x1acd8a[_0xef13('0x36')];_0x334985[_0xef13('0x5b')]=qs['sort'](_0x388c4a[_0xef13('0x3c')][_0xef13('0x3f')]);_0x334985['where']=qs[_0xef13('0x38')](_[_0xef13('0x40')](_0x388c4a[_0xef13('0x3c')],_0x1acd8a[_0xef13('0x38')]));if(_0x388c4a[_0xef13('0x3c')][_0xef13('0x42')]){_0x334985['where']=_['merge'](_0x334985['where'],{'$or':_['map'](_0x334985[_0xef13('0x39')],function(_0x40a85e){var _0x5ab702={};_0x5ab702[_0x40a85e]={'$like':'%'+_0x388c4a['query'][_0xef13('0x42')]+'%'};return _0x5ab702;})});}_0x334985=_['merge']({},_0x334985,_0x388c4a[_0xef13('0x44')]);return _0x1d69a9[_0xef13('0x80')](_0x334985);}})[_0xef13('0x28')](function(_0x15fb0f){if(_0x15fb0f){_0x3e95e0=_0x15fb0f['length'];if(!_0x388c4a[_0xef13('0x3c')][_0xef13('0x81')](_0xef13('0x3e'))){_0x334985['limit']=qs[_0xef13('0x21')](_0x388c4a['query']['limit']);_0x334985[_0xef13('0x1f')]=qs['offset'](_0x388c4a[_0xef13('0x3c')][_0xef13('0x1f')]);}return _0x1d69a9[_0xef13('0x80')](_0x334985);}})[_0xef13('0x28')](function(_0x4c13aa){if(_0x4c13aa){return _0x4c13aa?{'count':_0x3e95e0,'rows':_0x4c13aa}:null;}})[_0xef13('0x28')](respondWithResult(_0x37b583,null))[_0xef13('0x4a')](handleError(_0x37b583,null));}; \ No newline at end of file +var _0xc689=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./team.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Teams','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','Sequelize','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','TeamVoiceQueue','findOrCreate','Queue:save','QueueId','User','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','TeamVoicePrefix','VoicePrefixId','spread','removeAgents','parse','emit','Queue:remove','UserVoicePrefix','getAgents','filter','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc689,0x195));var _0x9c68=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xc689[_0x34f545];return _0x1ff6b8;};'use strict';var emlformat=require(_0x9c68('0x0'));var rimraf=require(_0x9c68('0x1'));var zipdir=require(_0x9c68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c68('0x3'));var moment=require('moment');var BPromise=require(_0x9c68('0x4'));var Mustache=require(_0x9c68('0x5'));var util=require(_0x9c68('0x6'));var path=require(_0x9c68('0x7'));var sox=require(_0x9c68('0x8'));var csv=require(_0x9c68('0x9'));var ejs=require(_0x9c68('0xa'));var fs=require('fs');var fs_extra=require(_0x9c68('0xb'));var _=require('lodash');var squel=require(_0x9c68('0xc'));var crypto=require(_0x9c68('0xd'));var jsforce=require(_0x9c68('0xe'));var deskjs=require(_0x9c68('0xf'));var toCsv=require(_0x9c68('0x9'));var querystring=require(_0x9c68('0x10'));var Papa=require(_0x9c68('0x11'));var Redis=require('ioredis');var authService=require(_0x9c68('0x12'));var qs=require(_0x9c68('0x13'));var as=require(_0x9c68('0x14'));var hardwareService=require(_0x9c68('0x15'));var logger=require(_0x9c68('0x16'))(_0x9c68('0x17'));var utils=require(_0x9c68('0x18'));var config=require(_0x9c68('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c68('0x1a'))['db'];config['redis']=_[_0x9c68('0x1b')](config[_0x9c68('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c68('0x1c')]));require(_0x9c68('0x1d'))[_0x9c68('0x1e')](socket);function respondWithStatusCode(_0x94bbef,_0x513329){_0x513329=_0x513329||0xcc;return function(_0x22cc5a){if(_0x22cc5a){return _0x94bbef['sendStatus'](_0x513329);}return _0x94bbef[_0x9c68('0x1f')](_0x513329)[_0x9c68('0x20')]();};}function respondWithResult(_0x4efef2,_0x4416cd){_0x4416cd=_0x4416cd||0xc8;return function(_0x4fefea){if(_0x4fefea){return _0x4efef2[_0x9c68('0x1f')](_0x4416cd)[_0x9c68('0x21')](_0x4fefea);}};}function respondWithFilteredResult(_0x3f8744,_0x5490c7){return function(_0x232a1c){if(_0x232a1c){var _0x1b223c=typeof _0x5490c7[_0x9c68('0x22')]===_0x9c68('0x23')&&typeof _0x5490c7[_0x9c68('0x24')]===_0x9c68('0x23');var _0x244046=_0x232a1c['count'];var _0x42cbfd=_0x1b223c?0x0:_0x5490c7[_0x9c68('0x22')];var _0x291f63=_0x1b223c?_0x232a1c[_0x9c68('0x25')]:_0x5490c7['offset']+_0x5490c7['limit'];var _0x2786dc;if(_0x291f63>=_0x244046){_0x291f63=_0x244046;_0x2786dc=0xc8;}else{_0x2786dc=0xce;}_0x3f8744[_0x9c68('0x1f')](_0x2786dc);return _0x3f8744[_0x9c68('0x26')](_0x9c68('0x27'),_0x42cbfd+'-'+_0x291f63+'/'+_0x244046)[_0x9c68('0x21')](_0x232a1c);}return null;};}function patchUpdates(_0xebdd2e){return function(_0x36db76){try{jsonpatch[_0x9c68('0x28')](_0x36db76,_0xebdd2e,!![]);}catch(_0x14a229){return BPromise['reject'](_0x14a229);}return _0x36db76['save']();};}function saveUpdates(_0x5c3973,_0x49e96c){return function(_0xab66b6){if(_0xab66b6){return _0xab66b6[_0x9c68('0x29')](_0x5c3973)[_0x9c68('0x2a')](function(_0x2ba3f4){return _0x2ba3f4;});}return null;};}function removeEntity(_0x2d4780,_0x12534c){return function(_0x19d5a1){if(_0x19d5a1){return _0x19d5a1['destroy']()[_0x9c68('0x2a')](function(){var _0x2bcb71=_0x19d5a1[_0x9c68('0x2b')]({'plain':!![]});var _0x240dc8=_0x9c68('0x2c');return db[_0x9c68('0x2d')][_0x9c68('0x2e')]({'where':{'type':_0x240dc8,'resourceId':_0x2bcb71['id']}})[_0x9c68('0x2a')](function(){return _0x19d5a1;});})[_0x9c68('0x2a')](function(){_0x2d4780[_0x9c68('0x1f')](0xcc)[_0x9c68('0x20')]();});}};}function handleEntityNotFound(_0x5c8c58,_0x52463b){return function(_0x3f6167){if(!_0x3f6167){_0x5c8c58[_0x9c68('0x2f')](0x194);}return _0x3f6167;};}function handleError(_0x21fe41,_0x5ee246){_0x5ee246=_0x5ee246||0x1f4;return function(_0x5a5377){logger[_0x9c68('0x30')](_0x5a5377[_0x9c68('0x31')]);if(_0x5a5377[_0x9c68('0x32')]){delete _0x5a5377['name'];}_0x21fe41[_0x9c68('0x1f')](_0x5ee246)[_0x9c68('0x33')](_0x5a5377);};}exports[_0x9c68('0x34')]=function(_0x100d8c,_0x1e8d53){var _0x5c99e1={},_0xb31ca2={},_0x5e8f4b={'count':0x0,'rows':[]};var _0x3e8690=_[_0x9c68('0x35')](db[_0x9c68('0x36')][_0x9c68('0x37')],function(_0x31ad46){return{'name':_0x31ad46[_0x9c68('0x38')],'type':_0x31ad46[_0x9c68('0x39')]['key']};});_0xb31ca2['model']=_[_0x9c68('0x35')](_0x3e8690,_0x9c68('0x32'));_0xb31ca2[_0x9c68('0x3a')]=_[_0x9c68('0x3b')](_0x100d8c['query']);_0xb31ca2['filters']=_[_0x9c68('0x3c')](_0xb31ca2[_0x9c68('0x3d')],_0xb31ca2[_0x9c68('0x3a')]);_0x5c99e1[_0x9c68('0x3e')]=_['intersection'](_0xb31ca2['model'],qs[_0x9c68('0x3f')](_0x100d8c[_0x9c68('0x3a')]['fields']));_0x5c99e1[_0x9c68('0x3e')]=_0x5c99e1[_0x9c68('0x3e')][_0x9c68('0x40')]?_0x5c99e1['attributes']:_0xb31ca2[_0x9c68('0x3d')];if(!_0x100d8c[_0x9c68('0x3a')]['hasOwnProperty'](_0x9c68('0x41'))){_0x5c99e1[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x24')]);_0x5c99e1[_0x9c68('0x22')]=qs[_0x9c68('0x22')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x22')]);}_0x5c99e1[_0x9c68('0x42')]=qs[_0x9c68('0x43')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x5c99e1['where']=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x100d8c[_0x9c68('0x3a')],_0xb31ca2['filters']),_0x3e8690);if(_0x100d8c[_0x9c68('0x3a')]['filter']){_0x5c99e1[_0x9c68('0x46')]=_['merge'](_0x5c99e1[_0x9c68('0x46')],{'$or':_['map'](_0x3e8690,function(_0x527569){if(_0x527569[_0x9c68('0x39')]!==_0x9c68('0x47')){var _0x5a731e={};_0x5a731e[_0x527569['name']]={'$like':'%'+_0x100d8c[_0x9c68('0x3a')]['filter']+'%'};return _0x5a731e;}})});}_0x5c99e1=_[_0x9c68('0x48')]({},_0x5c99e1,_0x100d8c[_0x9c68('0x49')]);var _0x599f6a={'where':_0x5c99e1['where']};return db['Team'][_0x9c68('0x25')](_0x599f6a)[_0x9c68('0x2a')](function(_0x1c2ec2){_0x5e8f4b['count']=_0x1c2ec2;if(_0x100d8c[_0x9c68('0x3a')]['includeAll']){_0x5c99e1['include']=[{'all':!![]}];}return db[_0x9c68('0x36')][_0x9c68('0x4a')](_0x5c99e1);})[_0x9c68('0x2a')](function(_0x5932c0){_0x5e8f4b[_0x9c68('0x4b')]=_0x5932c0;return _0x5e8f4b;})[_0x9c68('0x2a')](respondWithFilteredResult(_0x1e8d53,_0x5c99e1))[_0x9c68('0x4c')](handleError(_0x1e8d53,null));};exports[_0x9c68('0x4d')]=function(_0x1f26ca,_0x1d5376){var _0x2719d7={'raw':![],'where':{'id':_0x1f26ca[_0x9c68('0x4e')]['id']}},_0x1d7be8={};_0x1d7be8['model']=_[_0x9c68('0x3b')](db[_0x9c68('0x36')][_0x9c68('0x37')]);_0x1d7be8[_0x9c68('0x3a')]=_['keys'](_0x1f26ca['query']);_0x1d7be8['filters']=_[_0x9c68('0x3c')](_0x1d7be8[_0x9c68('0x3d')],_0x1d7be8[_0x9c68('0x3a')]);_0x2719d7[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x1d7be8[_0x9c68('0x3d')],qs['fields'](_0x1f26ca[_0x9c68('0x3a')][_0x9c68('0x3f')]));_0x2719d7[_0x9c68('0x3e')]=_0x2719d7[_0x9c68('0x3e')][_0x9c68('0x40')]?_0x2719d7[_0x9c68('0x3e')]:_0x1d7be8['model'];if(_0x1f26ca[_0x9c68('0x3a')][_0x9c68('0x4f')]){_0x2719d7['include']=[{'all':!![]}];}_0x2719d7=_[_0x9c68('0x48')]({},_0x2719d7,_0x1f26ca[_0x9c68('0x49')]);return db[_0x9c68('0x36')][_0x9c68('0x50')](_0x2719d7)[_0x9c68('0x2a')](handleEntityNotFound(_0x1d5376,null))[_0x9c68('0x2a')](respondWithResult(_0x1d5376,null))['catch'](handleError(_0x1d5376,null));};exports[_0x9c68('0x51')]=function(_0x41ab76,_0x3f2dbe){return db['Team'][_0x9c68('0x51')](_0x41ab76[_0x9c68('0x52')],{})[_0x9c68('0x2a')](function(_0x1259a8){var _0xdf7859=_0x41ab76[_0x9c68('0x53')][_0x9c68('0x2b')]({'plain':!![]});if(!_0xdf7859)throw new Error(_0x9c68('0x54'));if(_0xdf7859[_0x9c68('0x55')]==='user'){var _0x1432ce=_0x1259a8['get']({'plain':!![]});var _0x5ce0b9=_0x9c68('0x2c');return db[_0x9c68('0x56')]['find']({'where':{'name':_0x5ce0b9,'userProfileId':_0xdf7859[_0x9c68('0x57')]},'raw':!![]})[_0x9c68('0x2a')](function(_0x133ea8){if(_0x133ea8&&_0x133ea8[_0x9c68('0x58')]===0x0){return db[_0x9c68('0x2d')][_0x9c68('0x51')]({'name':_0x1432ce[_0x9c68('0x32')],'resourceId':_0x1432ce['id'],'type':_0x133ea8[_0x9c68('0x32')],'sectionId':_0x133ea8['id']},{})[_0x9c68('0x2a')](function(){return _0x1259a8;});}else{return _0x1259a8;}})[_0x9c68('0x4c')](function(_0x2e5a1f){logger[_0x9c68('0x30')](_0x9c68('0x59'),_0x2e5a1f);throw _0x2e5a1f;});}return _0x1259a8;})[_0x9c68('0x2a')](respondWithResult(_0x3f2dbe,0xc9))[_0x9c68('0x4c')](handleError(_0x3f2dbe,null));};exports[_0x9c68('0x29')]=function(_0x6d6874,_0x28438e){if(_0x6d6874[_0x9c68('0x52')]['id']){delete _0x6d6874[_0x9c68('0x52')]['id'];}return db[_0x9c68('0x36')][_0x9c68('0x50')]({'where':{'id':_0x6d6874[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x28438e,null))[_0x9c68('0x2a')](saveUpdates(_0x6d6874[_0x9c68('0x52')],null))['then'](respondWithResult(_0x28438e,null))['catch'](handleError(_0x28438e,null));};exports[_0x9c68('0x2e')]=function(_0xcccdb8,_0x2a396b){return db['Team']['find']({'where':{'id':_0xcccdb8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x2a396b,null))[_0x9c68('0x2a')](removeEntity(_0x2a396b,null))[_0x9c68('0x4c')](handleError(_0x2a396b,null));};exports[_0x9c68('0x5a')]=function(_0x511e6b,_0x4348d2,_0x2558f7){return db['Team'][_0x9c68('0x5b')]({'where':{'id':_0x511e6b[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x4348d2,null))[_0x9c68('0x2a')](function(_0x4dd20a){if(!_0x511e6b[_0x9c68('0x3a')]['channel']||!utils[_0x9c68('0x5c')](_0x511e6b[_0x9c68('0x3a')]['channel'])){throw new db['Sequelize'][(_0x9c68('0x5d'))](_0x9c68('0x5e'));}var _0x58b441={};var _0x5c854f={};_0x5c854f[_0x9c68('0x3d')]=_[_0x9c68('0x3b')](db[_[_0x9c68('0x5f')](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x62')][_0x9c68('0x37')]);_0x5c854f[_0x9c68('0x3a')]=_['keys'](_0x511e6b['query']);_0x5c854f[_0x9c68('0x44')]=_[_0x9c68('0x3c')](_0x5c854f['model'],_0x5c854f[_0x9c68('0x3a')]);_0x58b441[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x5c854f[_0x9c68('0x3d')],qs[_0x9c68('0x3f')](_0x511e6b['query']['fields']));_0x58b441['attributes']=_0x58b441[_0x9c68('0x3e')]['length']?_0x58b441['attributes']:_0x5c854f[_0x9c68('0x3d')];_0x58b441[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x511e6b['query']['limit']);_0x58b441[_0x9c68('0x22')]=qs['offset'](_0x511e6b['query'][_0x9c68('0x22')]);_0x58b441[_0x9c68('0x42')]=qs['sort'](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x58b441[_0x9c68('0x46')]=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x511e6b['query'],_0x5c854f[_0x9c68('0x44')]));_0x58b441=_[_0x9c68('0x48')]({},_0x58b441,_0x511e6b[_0x9c68('0x49')]);return _0x4dd20a[_0x9c68('0x2b')+_[_0x9c68('0x5f')](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x58b441);})[_0x9c68('0x2a')](respondWithResult(_0x4348d2,null))['catch'](handleError(_0x4348d2,null));};exports[_0x9c68('0x64')]=function(_0x14cd4c,_0x5b27b1,_0x35bc76){return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x14cd4c['params']['id']}})[_0x9c68('0x2a')](function(_0x1c1c25){if(_0x1c1c25){if(!_0x14cd4c['body'][_0x9c68('0x60')]||!utils[_0x9c68('0x5c')](_0x14cd4c['body']['channel'])){throw new db['Sequelize']['ValidationError'](_0x9c68('0x5e'));}return _0x1c1c25[_0x9c68('0x65')+_['capitalize'](_0x14cd4c[_0x9c68('0x52')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x14cd4c[_0x9c68('0x52')][_0x9c68('0x66')]);}return null;})['then'](handleEntityNotFound(_0x5b27b1,null))[_0x9c68('0x2a')](respondWithStatusCode(_0x5b27b1,null))[_0x9c68('0x4c')](handleError(_0x5b27b1,null));};exports[_0x9c68('0x67')]=function(_0x49ba37,_0x3ac3ff,_0x3b92df){return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x49ba37[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](function(_0x46e20d){if(_0x46e20d){if(!_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')]||!utils[_0x9c68('0x5c')](_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')])){throw new db[(_0x9c68('0x68'))][(_0x9c68('0x5d'))](_0x9c68('0x5e'));}return _0x46e20d[_0x9c68('0x69')+_[_0x9c68('0x5f')](_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x49ba37['query'][_0x9c68('0x66')]);}return null;})[_0x9c68('0x2a')](handleEntityNotFound(_0x3ac3ff,null))['then'](respondWithStatusCode(_0x3ac3ff,null))['catch'](handleError(_0x3ac3ff,null));};exports[_0x9c68('0x6a')]=function(_0x91f7e8,_0x491c17){return db[_0x9c68('0x36')][_0x9c68('0x50')]({'where':{'id':_0x91f7e8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x491c17,null))[_0x9c68('0x2a')](function(_0x3e5fb3){if(_0x3e5fb3){var _0x27ce5c=[_0x9c68('0x6b'),_0x9c68('0x6c'),_0x9c68('0x6d'),_0x9c68('0x6e'),_0x9c68('0x6f'),_0x9c68('0x70'),_0x9c68('0x71')];return db[_0x9c68('0x72')][_0x9c68('0x73')](function(_0x13222f){var _0x31ca03=_['map'](_0x27ce5c,function(_0x41b32c){var _0x1ae23d={'attributes':['id',_0x9c68('0x32')]};if(_0x41b32c==='Voice'){_0x1ae23d[_0x9c68('0x74')]={'attributes':[_0x9c68('0x75')]};}return _0x3e5fb3[_0x9c68('0x2b')+_0x41b32c+_0x9c68('0x63')](_0x1ae23d)[_0x9c68('0x2a')](function(_0x2318cb){var _0x452e6c=_[_0x9c68('0x35')](_0x2318cb,function(_0x134c66){var _0x3ac2f5=_[_0x9c68('0x35')](_0x91f7e8['body'][_0x9c68('0x66')],function(_0x53a71b){var _0x47923d={'where':{'UserId':_0x53a71b,[_0x41b32c+'QueueId']:_0x134c66['id']},'transaction':_0x13222f};if(_0x41b32c===_0x9c68('0x6b')){_0x47923d[_0x9c68('0x1b')]={'penalty':_0x134c66[_0x9c68('0x76')][_0x9c68('0x75')]};}return db['User'+_0x41b32c+_0x9c68('0x62')][_0x9c68('0x77')](_0x47923d)[_0x9c68('0x2a')](function(){socket['emit'](_0x9c68('0x53')+_0x41b32c+_0x9c68('0x78'),{'UserId':_0x53a71b,[_0x41b32c+_0x9c68('0x79')]:_0x134c66['id']});if(_0x41b32c!==_0x9c68('0x6b'))return;return db[_0x9c68('0x7a')]['findAll']({'where':{'id':_0x91f7e8[_0x9c68('0x52')][_0x9c68('0x66')],'online':0x1},'attributes':['id',_0x9c68('0x32'),'online','voicePause',_0x9c68('0x7b')],'raw':!![]})['then'](function(_0x2388d2){var _0xce6d05=_[_0x9c68('0x35')](_0x2388d2,function(_0xf7cfe4){return db[_0x9c68('0x7c')][_0x9c68('0x7d')]({'membername':_0xf7cfe4['name'],'UserId':_0xf7cfe4['id'],'queue_name':_0x134c66[_0x9c68('0x32')],'VoiceQueueId':_0x134c66['id'],'interface':_[_0x9c68('0x7e')](_0xf7cfe4[_0x9c68('0x7b')])?util['format'](_0x9c68('0x7f'),_0xf7cfe4[_0x9c68('0x32')]):_0xf7cfe4[_0x9c68('0x7b')],'paused':_0xf7cfe4[_0x9c68('0x80')]||![],'penalty':_0x134c66[_0x9c68('0x76')][_0x9c68('0x75')]},{'transaction':_0x13222f});});return Promise[_0x9c68('0x81')](_0xce6d05);});});});return Promise[_0x9c68('0x81')](_0x3ac2f5);});return Promise[_0x9c68('0x81')](_0x452e6c);})[_0x9c68('0x2a')](function(){var _0x18d5d6=JSON['parse']('['+_0x91f7e8[_0x9c68('0x52')]['ids']+']');db[_0x9c68('0x82')][_0x9c68('0x5b')]({'where':{'teamId':_0x91f7e8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](function(_0x1d77b5){if(_0x1d77b5){for(var _0x57a35f=0x0;_0x57a35f<_0x18d5d6[_0x9c68('0x40')];_0x57a35f++){var _0x3c82e7=_0x18d5d6[_0x57a35f];db['UserVoicePrefix'][_0x9c68('0x7d')]({'UserId':_0x3c82e7,'VoicePrefixId':_0x1d77b5[_0x9c68('0x83')]});}}});});});return Promise[_0x9c68('0x81')](_0x31ca03)[_0x9c68('0x2a')](function(){return _0x3e5fb3[_0x9c68('0x6a')](_0x91f7e8[_0x9c68('0x52')]['ids'],{'transaction':_0x13222f})[_0x9c68('0x84')](function(_0x18b006){return _0x18b006;});});});}})[_0x9c68('0x2a')](respondWithResult(_0x491c17,null))['catch'](handleError(_0x491c17,null));};exports[_0x9c68('0x85')]=function(_0x1aebc7,_0x24a14f){return db['Team'][_0x9c68('0x50')]({'where':{'id':_0x1aebc7[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x24a14f,null))[_0x9c68('0x2a')](function(_0x3d895e){if(_0x3d895e){var _0x48252f=['Voice','Chat',_0x9c68('0x6d'),_0x9c68('0x6e'),_0x9c68('0x6f'),'Openchannel','Whatsapp'];return db[_0x9c68('0x72')][_0x9c68('0x73')](function(_0x3ab630){var _0x429711=_[_0x9c68('0x35')](_0x48252f,function(_0x18a0dc){var _0x3cf09e={'attributes':['id',_0x9c68('0x32')]};return _0x3d895e[_0x9c68('0x2b')+_0x18a0dc+_0x9c68('0x63')](_0x3cf09e)['then'](function(_0x350511){var _0x25f625=_[_0x9c68('0x35')](_0x350511,function(_0x4a85b5){return _0x4a85b5[_0x9c68('0x85')](_0x1aebc7['query'][_0x9c68('0x66')],{'transaction':_0x3ab630})[_0x9c68('0x2a')](function(){var _0x92b8f6=JSON[_0x9c68('0x86')]('['+_0x1aebc7['query'][_0x9c68('0x66')]+']');var _0x543f3c=_[_0x9c68('0x35')](_0x92b8f6,function(_0x276178){socket[_0x9c68('0x87')]('user'+_0x18a0dc+_0x9c68('0x88'),{'UserId':Number(_0x276178),[_0x18a0dc+_0x9c68('0x79')]:_0x4a85b5['id']});if(_0x18a0dc!==_0x9c68('0x6b'))return;return db[_0x9c68('0x7c')][_0x9c68('0x2e')]({'where':{'VoiceQueueId':_0x4a85b5['id'],'UserId':_0x276178},'transaction':_0x3ab630});});return Promise[_0x9c68('0x81')](_0x543f3c);});});return Promise['all'](_0x25f625);});});return Promise['all'](_0x429711)[_0x9c68('0x2a')](function(){return _0x3d895e[_0x9c68('0x85')](_0x1aebc7[_0x9c68('0x3a')][_0x9c68('0x66')],{'transaction':_0x3ab630});})[_0x9c68('0x2a')](function(){var _0x5563b5=JSON[_0x9c68('0x86')]('['+_0x1aebc7[_0x9c68('0x3a')][_0x9c68('0x66')]+']');db[_0x9c68('0x82')][_0x9c68('0x5b')]({'where':{'teamId':_0x1aebc7[_0x9c68('0x4e')]['id']}})['then'](function(_0x38d0ee){if(_0x38d0ee){for(var _0x52078e=0x0;_0x52078e<_0x5563b5['length'];_0x52078e++){var _0x192425=_0x5563b5[_0x52078e];db[_0x9c68('0x89')][_0x9c68('0x2e')]({'where':{'UserId':_0x192425,'VoicePrefixId':_0x38d0ee[_0x9c68('0x83')]}});}}});});});}})[_0x9c68('0x2a')](respondWithStatusCode(_0x24a14f,null))[_0x9c68('0x4c')](handleError(_0x24a14f,null));};exports[_0x9c68('0x8a')]=function(_0x457e29,_0x4ab75f,_0x23fa41){var _0x5433c9={};var _0x183c05={};var _0x220e58;var _0x4db8c6;return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x457e29[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x4ab75f,null))[_0x9c68('0x2a')](function(_0x5cbafa){if(_0x5cbafa){_0x220e58=_0x5cbafa;_0x183c05[_0x9c68('0x3d')]=_['keys'](db[_0x9c68('0x7a')][_0x9c68('0x37')]);_0x183c05[_0x9c68('0x3a')]=_[_0x9c68('0x3b')](_0x457e29[_0x9c68('0x3a')]);_0x183c05['filters']=_[_0x9c68('0x3c')](_0x183c05[_0x9c68('0x3d')],_0x183c05[_0x9c68('0x3a')]);_0x5433c9[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x183c05[_0x9c68('0x3d')],qs[_0x9c68('0x3f')](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x3f')]));_0x5433c9[_0x9c68('0x3e')]=_0x5433c9['attributes']['length']?_0x5433c9[_0x9c68('0x3e')]:_0x183c05[_0x9c68('0x3d')];_0x5433c9[_0x9c68('0x42')]=qs['sort'](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x5433c9[_0x9c68('0x46')]=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x457e29[_0x9c68('0x3a')],_0x183c05[_0x9c68('0x44')]));if(_0x457e29[_0x9c68('0x3a')]['filter']){_0x5433c9[_0x9c68('0x46')]=_[_0x9c68('0x48')](_0x5433c9[_0x9c68('0x46')],{'$or':_[_0x9c68('0x35')](_0x5433c9[_0x9c68('0x3e')],function(_0x5caef7){var _0xcc81b7={};_0xcc81b7[_0x5caef7]={'$like':'%'+_0x457e29[_0x9c68('0x3a')][_0x9c68('0x8b')]+'%'};return _0xcc81b7;})});}_0x5433c9=_['merge']({},_0x5433c9,_0x457e29['options']);return _0x220e58[_0x9c68('0x8a')](_0x5433c9);}})[_0x9c68('0x2a')](function(_0x4fc470){if(_0x4fc470){_0x4db8c6=_0x4fc470[_0x9c68('0x40')];if(!_0x457e29[_0x9c68('0x3a')]['hasOwnProperty']('nolimit')){_0x5433c9[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x24')]);_0x5433c9['offset']=qs['offset'](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x22')]);}return _0x220e58[_0x9c68('0x8a')](_0x5433c9);}})[_0x9c68('0x2a')](function(_0x4b0b45){if(_0x4b0b45){return _0x4b0b45?{'count':_0x4db8c6,'rows':_0x4b0b45}:null;}})['then'](respondWithResult(_0x4ab75f,null))[_0x9c68('0x4c')](handleError(_0x4ab75f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c4eb7c5..c79bb1f 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 _0xfc34=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xfc34,0x9b));var _0x4fc3=function(_0x573eae,_0x5f103f){_0x573eae=_0x573eae-0x0;var _0x2be09c=_0xfc34[_0x573eae];return _0x2be09c;};'use strict';var EventEmitter=require(_0x4fc3('0x0'));var Team=require(_0x4fc3('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fc3('0x2'),'afterUpdate':_0x4fc3('0x3'),'afterDestroy':_0x4fc3('0x4')};function emitEvent(_0x5adce6){return function(_0x19f362,_0x5eb4d5,_0x56538f){TeamEvents[_0x4fc3('0x5')](_0x5adce6+':'+_0x19f362['id'],_0x19f362);TeamEvents[_0x4fc3('0x5')](_0x5adce6,_0x19f362);_0x56538f(null);};}for(var e in events){if(events[_0x4fc3('0x6')](e)){var event=events[e];Team[_0x4fc3('0x7')](e,emitEvent(event));}}module[_0x4fc3('0x8')]=TeamEvents; \ No newline at end of file +var _0x0de2=['hook','exports','events','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0de2,0x13d));var _0x20de=function(_0x49e0e5,_0x1f1f6b){_0x49e0e5=_0x49e0e5-0x0;var _0x249c90=_0x0de2[_0x49e0e5];return _0x249c90;};'use strict';var EventEmitter=require(_0x20de('0x0'));var Team=require('../../mysqldb')['db'][_0x20de('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x20de('0x2')](0x0);var events={'afterCreate':_0x20de('0x3'),'afterUpdate':'update','afterDestroy':_0x20de('0x4')};function emitEvent(_0x26f4e5){return function(_0x410d39,_0x40b658,_0x567602){TeamEvents[_0x20de('0x5')](_0x26f4e5+':'+_0x410d39['id'],_0x410d39);TeamEvents[_0x20de('0x5')](_0x26f4e5,_0x410d39);_0x567602(null);};}for(var e in events){if(events[_0x20de('0x6')](e)){var event=events[e];Team[_0x20de('0x7')](e,emitEvent(event));}}module[_0x20de('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a237a18..39ddd05 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 _0x7fea=['exports','Team','teams','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./team.attributes'];(function(_0x27f0b1,_0x27deeb){var _0x4086ef=function(_0x4bc92a){while(--_0x4bc92a){_0x27f0b1['push'](_0x27f0b1['shift']());}};_0x4086ef(++_0x27deeb);}(_0x7fea,0x137));var _0xa7fe=function(_0x43628a,_0x15b693){_0x43628a=_0x43628a-0x0;var _0x5e8aac=_0x7fea[_0x43628a];return _0x5e8aac;};'use strict';var _=require(_0xa7fe('0x0'));var util=require(_0xa7fe('0x1'));var logger=require(_0xa7fe('0x2'))('api');var moment=require(_0xa7fe('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7fe('0x4'));var fs=require('fs');var path=require(_0xa7fe('0x5'));var rimraf=require('rimraf');var config=require(_0xa7fe('0x6'));var attributes=require(_0xa7fe('0x7'));module[_0xa7fe('0x8')]=function(_0x56d6fe,_0x1a6d54){return _0x56d6fe['define'](_0xa7fe('0x9'),attributes,{'tableName':_0xa7fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41f2=['lodash','api','moment','bluebird','request-promise','path','rimraf','./team.attributes','exports','Team'];(function(_0x4c3b11,_0x1c2581){var _0x17dbbd=function(_0x144f8b){while(--_0x144f8b){_0x4c3b11['push'](_0x4c3b11['shift']());}};_0x17dbbd(++_0x1c2581);}(_0x41f2,0x186));var _0x241f=function(_0x34335b,_0x4e0088){_0x34335b=_0x34335b-0x0;var _0x51c066=_0x41f2[_0x34335b];return _0x51c066;};'use strict';var _=require(_0x241f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x241f('0x1'));var moment=require(_0x241f('0x2'));var BPromise=require(_0x241f('0x3'));var rp=require(_0x241f('0x4'));var fs=require('fs');var path=require(_0x241f('0x5'));var rimraf=require(_0x241f('0x6'));var config=require('../../config/environment');var attributes=require(_0x241f('0x7'));module[_0x241f('0x8')]=function(_0x4547b9,_0x451516){return _0x4547b9['define'](_0x241f('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a5333eb..46693d9 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 _0xcc7b=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x55e693,_0x22b0cd){var _0x253c44=function(_0x3ac4dc){while(--_0x3ac4dc){_0x55e693['push'](_0x55e693['shift']());}};_0x253c44(++_0x22b0cd);}(_0xcc7b,0x77));var _0xbcc7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc7b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbcc7('0x0'));var util=require(_0xbcc7('0x1'));var moment=require('moment');var BPromise=require(_0xbcc7('0x2'));var rs=require(_0xbcc7('0x3'));var fs=require('fs');var Redis=require(_0xbcc7('0x4'));var db=require(_0xbcc7('0x5'))['db'];var utils=require(_0xbcc7('0x6'));var logger=require('../../config/logger')(_0xbcc7('0x7'));var config=require('../../config/environment');var jayson=require(_0xbcc7('0x8'));var client=jayson[_0xbcc7('0x9')][_0xbcc7('0xa')]({'port':0x232a});config[_0xbcc7('0xb')]=_[_0xbcc7('0xc')](config[_0xbcc7('0xb')],{'host':_0xbcc7('0xd'),'port':0x18eb});var socket=require(_0xbcc7('0xe'))(new Redis(config[_0xbcc7('0xb')]));require(_0xbcc7('0xf'))[_0xbcc7('0x10')](socket);function respondWithRpcPromise(_0x20ea32,_0x213b6c,_0x2f3f51){return new BPromise(function(_0x2a4ccd,_0x1e5445){return client[_0xbcc7('0x11')](_0x20ea32,_0x2f3f51)['then'](function(_0x198f81){logger[_0xbcc7('0x12')](_0xbcc7('0x13'),_0x213b6c,_0xbcc7('0x14'));logger[_0xbcc7('0x15')](_0xbcc7('0x16'),_0x213b6c,_0xbcc7('0x14'),JSON[_0xbcc7('0x17')](_0x198f81));if(_0x198f81['error']){if(_0x198f81['error'][_0xbcc7('0x18')]===0x1f4){logger['error'](_0xbcc7('0x13'),_0x213b6c,_0x198f81[_0xbcc7('0x19')][_0xbcc7('0x1a')]);return _0x1e5445(_0x198f81[_0xbcc7('0x19')][_0xbcc7('0x1a')]);}logger['error'](_0xbcc7('0x13'),_0x213b6c,_0x198f81[_0xbcc7('0x19')]['message']);return _0x2a4ccd(_0x198f81[_0xbcc7('0x19')][_0xbcc7('0x1a')]);}else{logger[_0xbcc7('0x12')](_0xbcc7('0x13'),_0x213b6c,_0xbcc7('0x14'));_0x2a4ccd(_0x198f81[_0xbcc7('0x1b')]['message']);}})[_0xbcc7('0x1c')](function(_0x39cc95){logger['error'](_0xbcc7('0x13'),_0x213b6c,_0x39cc95);_0x1e5445(_0x39cc95);});});} \ No newline at end of file +var _0x0682=['socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0682,0x10a));var _0x2068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0682[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2068('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2068('0x1'));var fs=require('fs');var Redis=require(_0x2068('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2068('0x3'));var jayson=require(_0x2068('0x4'));var client=jayson[_0x2068('0x5')][_0x2068('0x6')]({'port':0x232a});config['redis']=_[_0x2068('0x7')](config[_0x2068('0x8')],{'host':_0x2068('0x9'),'port':0x18eb});var socket=require(_0x2068('0xa'))(new Redis(config['redis']));require(_0x2068('0xb'))[_0x2068('0xc')](socket);function respondWithRpcPromise(_0x35ec97,_0x2c64da,_0x70b4cb){return new BPromise(function(_0x1b3836,_0x420ff8){return client['request'](_0x35ec97,_0x70b4cb)[_0x2068('0xd')](function(_0xf28911){logger[_0x2068('0xe')]('Team,\x20%s,\x20%s',_0x2c64da,_0x2068('0xf'));logger[_0x2068('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x2c64da,'request\x20sent',JSON['stringify'](_0xf28911));if(_0xf28911[_0x2068('0x11')]){if(_0xf28911[_0x2068('0x11')][_0x2068('0x12')]===0x1f4){logger[_0x2068('0x11')](_0x2068('0x13'),_0x2c64da,_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);return _0x420ff8(_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);}logger[_0x2068('0x11')](_0x2068('0x13'),_0x2c64da,_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);return _0x1b3836(_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);}else{logger[_0x2068('0xe')](_0x2068('0x13'),_0x2c64da,_0x2068('0xf'));_0x1b3836(_0xf28911[_0x2068('0x15')][_0x2068('0x14')]);}})[_0x2068('0x16')](function(_0x25c7a4){logger['error'](_0x2068('0x13'),_0x2c64da,_0x25c7a4);_0x420ff8(_0x25c7a4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bfb9f98..7bb9e18 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 _0xb09d=['register','length','team:','./team.events','save','remove','update','emit','removeListener'];(function(_0x3f5520,_0x1a780f){var _0x49692c=function(_0x5dd95c){while(--_0x5dd95c){_0x3f5520['push'](_0x3f5520['shift']());}};_0x49692c(++_0x1a780f);}(_0xb09d,0xed));var _0xdb09=function(_0xdf92da,_0x3ead4d){_0xdf92da=_0xdf92da-0x0;var _0x2b0f45=_0xb09d[_0xdf92da];return _0x2b0f45;};'use strict';var TeamEvents=require(_0xdb09('0x0'));var events=[_0xdb09('0x1'),_0xdb09('0x2'),_0xdb09('0x3')];function createListener(_0x1311ee,_0x3bf74b){return function(_0x2388f0){_0x3bf74b[_0xdb09('0x4')](_0x1311ee,_0x2388f0);};}function removeListener(_0x478db4,_0x3e2b9e){return function(){TeamEvents[_0xdb09('0x5')](_0x478db4,_0x3e2b9e);};}exports[_0xdb09('0x6')]=function(_0xd2e98f){for(var _0x181d74=0x0,_0x20a6ef=events[_0xdb09('0x7')];_0x181d74<_0x20a6ef;_0x181d74++){var _0x332ab2=events[_0x181d74];var _0x3bbf9b=createListener(_0xdb09('0x8')+_0x332ab2,_0xd2e98f);TeamEvents['on'](_0x332ab2,_0x3bbf9b);}}; \ No newline at end of file +var _0x1120=['./team.events','save','remove','emit','removeListener','register','length','team:'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x1120,0x140));var _0x0112=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x1120[_0x3e7e96];return _0x13f6f0;};'use strict';var TeamEvents=require(_0x0112('0x0'));var events=[_0x0112('0x1'),_0x0112('0x2'),'update'];function createListener(_0x5dd0ed,_0x5190bd){return function(_0x54a1d2){_0x5190bd[_0x0112('0x3')](_0x5dd0ed,_0x54a1d2);};}function removeListener(_0x395145,_0x1d9e34){return function(){TeamEvents[_0x0112('0x4')](_0x395145,_0x1d9e34);};}exports[_0x0112('0x5')]=function(_0x10fdca){for(var _0x408230=0x0,_0x40ad0d=events[_0x0112('0x6')];_0x408230<_0x40ad0d;_0x408230++){var _0x444422=events[_0x408230];var _0x2fd18c=createListener(_0x0112('0x7')+_0x444422,_0x10fdca);TeamEvents['on'](_0x444422,_0x2fd18c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/index.js b/server/api/teamVoicePrefix/index.js index e5a444e..3b0d63a 100644 --- a/server/api/teamVoicePrefix/index.js +++ b/server/api/teamVoicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c5a6c,_0x7c7c6f){var _0x5e0e23=function(_0x2b7948){while(--_0x2b7948){_0x4c5a6c['push'](_0x4c5a6c['shift']());}};_0x5e0e23(++_0x7c7c6f);}(_0xe706,0xa3));var _0x6e70=function(_0x4651bd,_0x12a42f){_0x4651bd=_0x4651bd-0x0;var _0xdf510d=_0xe706[_0x4651bd];return _0xdf510d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5dea52,_0x95e1b8){var _0x4e07ad=function(_0x50264b){while(--_0x50264b){_0x5dea52['push'](_0x5dea52['shift']());}};_0x4e07ad(++_0x95e1b8);}(_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 diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1c6015c..7174248 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 _0x5cfa=['INTEGER','sequelize'];(function(_0xa6cdf0,_0x34997d){var _0x29a6f0=function(_0x14d018){while(--_0x14d018){_0xa6cdf0['push'](_0xa6cdf0['shift']());}};_0x29a6f0(++_0x34997d);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x438919,_0x528e4f){_0x438919=_0x438919-0x0;var _0xa1427a=_0x5cfa[_0x438919];return _0xa1427a;};'use strict';var Sequelize=require(_0xa5cf('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xa5cf('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb701=['exports','INTEGER'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb701,0x144));var _0x1b70=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb701[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x1b70('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x1b70('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 454bfd1..2fea540 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 _0x76d2=['bluebird','request-promise','path','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x20fe84,_0x4d3f3f){var _0x146634=function(_0x3d6923){while(--_0x3d6923){_0x20fe84['push'](_0x20fe84['shift']());}};_0x146634(++_0x4d3f3f);}(_0x76d2,0xf8));var _0x276d=function(_0x3ea5e4,_0x3bf110){_0x3ea5e4=_0x3ea5e4-0x0;var _0x4aee9d=_0x76d2[_0x3ea5e4];return _0x4aee9d;};'use strict';var _=require(_0x276d('0x0'));var util=require(_0x276d('0x1'));var logger=require(_0x276d('0x2'))('api');var moment=require(_0x276d('0x3'));var BPromise=require(_0x276d('0x4'));var rp=require(_0x276d('0x5'));var fs=require('fs');var path=require(_0x276d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x276d('0x7'));module[_0x276d('0x8')]=function(_0x27729d,_0x1904bf){return _0x27729d[_0x276d('0x9')](_0x276d('0xa'),attributes,{'tableName':_0x276d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39aa=['moment','bluebird','request-promise','path','rimraf','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api'];(function(_0xef21fc,_0x5d7b70){var _0x56365b=function(_0x16af01){while(--_0x16af01){_0xef21fc['push'](_0xef21fc['shift']());}};_0x56365b(++_0x5d7b70);}(_0x39aa,0x11b));var _0xa39a=function(_0x13647c,_0x4822a7){_0x13647c=_0x13647c-0x0;var _0x341ecb=_0x39aa[_0x13647c];return _0x341ecb;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js b/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js index a5dab40..06fa97e 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8da4=['result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','TeamVoicePrefix,\x20%s,\x20%s','request\x20sent','debug','TeamVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x67ef3d,_0x50f0bd){var _0x2ef03e=function(_0x44e463){while(--_0x44e463){_0x67ef3d['push'](_0x67ef3d['shift']());}};_0x2ef03e(++_0x50f0bd);}(_0x8da4,0xb1));var _0x48da=function(_0x4a29d5,_0x5ee8ff){_0x4a29d5=_0x4a29d5-0x0;var _0x4b36dc=_0x8da4[_0x4a29d5];return _0x4b36dc;};'use strict';var _=require(_0x48da('0x0'));var util=require('util');var moment=require(_0x48da('0x1'));var BPromise=require(_0x48da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48da('0x3'));var db=require(_0x48da('0x4'))['db'];var utils=require(_0x48da('0x5'));var logger=require(_0x48da('0x6'))(_0x48da('0x7'));var config=require('../../config/environment');var jayson=require(_0x48da('0x8'));var client=jayson[_0x48da('0x9')][_0x48da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x100c96,_0x59f896,_0x1e962b){return new BPromise(function(_0x5d3b85,_0x1603d1){return client['request'](_0x100c96,_0x1e962b)[_0x48da('0xb')](function(_0x237a96){logger[_0x48da('0xc')](_0x48da('0xd'),_0x59f896,_0x48da('0xe'));logger[_0x48da('0xf')](_0x48da('0x10'),_0x59f896,_0x48da('0xe'),JSON[_0x48da('0x11')](_0x237a96));if(_0x237a96[_0x48da('0x12')]){if(_0x237a96[_0x48da('0x12')][_0x48da('0x13')]===0x1f4){logger[_0x48da('0x12')](_0x48da('0xd'),_0x59f896,_0x237a96[_0x48da('0x12')]['message']);return _0x1603d1(_0x237a96['error'][_0x48da('0x14')]);}logger[_0x48da('0x12')](_0x48da('0xd'),_0x59f896,_0x237a96[_0x48da('0x12')][_0x48da('0x14')]);return _0x5d3b85(_0x237a96[_0x48da('0x12')]['message']);}else{logger[_0x48da('0xc')](_0x48da('0xd'),_0x59f896,_0x48da('0xe'));_0x5d3b85(_0x237a96[_0x48da('0x15')][_0x48da('0x14')]);}})['catch'](function(_0x3ce838){logger[_0x48da('0x12')](_0x48da('0xd'),_0x59f896,_0x3ce838);_0x1603d1(_0x3ce838);});});} \ No newline at end of file +var _0x73df=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','TeamVoicePrefix,\x20%s,\x20%s','request\x20sent','debug','TeamVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x73df,0x154));var _0xf73d=function(_0x4cb6c9,_0x35808c){_0x4cb6c9=_0x4cb6c9-0x0;var _0x1fe48c=_0x73df[_0x4cb6c9];return _0x1fe48c;};'use strict';var _=require('lodash');var util=require(_0xf73d('0x0'));var moment=require('moment');var BPromise=require(_0xf73d('0x1'));var rs=require(_0xf73d('0x2'));var fs=require('fs');var Redis=require(_0xf73d('0x3'));var db=require(_0xf73d('0x4'))['db'];var utils=require(_0xf73d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf73d('0x6'));var jayson=require(_0xf73d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2292e7,_0x3c5613,_0x498fab){return new BPromise(function(_0x3c8ddb,_0x1aba95){return client[_0xf73d('0x8')](_0x2292e7,_0x498fab)[_0xf73d('0x9')](function(_0x3fbd5e){logger['info'](_0xf73d('0xa'),_0x3c5613,_0xf73d('0xb'));logger[_0xf73d('0xc')](_0xf73d('0xd'),_0x3c5613,_0xf73d('0xb'),JSON[_0xf73d('0xe')](_0x3fbd5e));if(_0x3fbd5e[_0xf73d('0xf')]){if(_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x10')]===0x1f4){logger['error']('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);return _0x1aba95(_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);}logger[_0xf73d('0xf')]('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);return _0x3c8ddb(_0x3fbd5e['error']['message']);}else{logger[_0xf73d('0x12')](_0xf73d('0xa'),_0x3c5613,_0xf73d('0xb'));_0x3c8ddb(_0x3fbd5e[_0xf73d('0x13')][_0xf73d('0x11')]);}})['catch'](function(_0x6b0c17){logger['error']('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x6b0c17);_0x1aba95(_0x6b0c17);});});} \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 840a49c..be48d5f 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x241c21,_0x11b64b){var _0x1ffb9e=function(_0x5e3509){while(--_0x5e3509){_0x241c21['push'](_0x241c21['shift']());}};_0x1ffb9e(++_0x11b64b);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf1d26c,_0x1463d0){var _0x11c159=function(_0x3f71e8){while(--_0x3f71e8){_0xf1d26c['push'](_0xf1d26c['shift']());}};_0x11c159(++_0x1463d0);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 3f7a2aa..4a99497 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 _0xceee=['exports','sequelize'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xceee,0xbb));var _0xecee=function(_0x3a3a06,_0x24b0c4){_0x3a3a06=_0x3a3a06-0x0;var _0x4d7004=_0xceee[_0x3a3a06];return _0x4d7004;};'use strict';var Sequelize=require(_0xecee('0x0'));module[_0xecee('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2f45=['sequelize','exports','INTEGER'];(function(_0x4ea444,_0x56dde4){var _0x52b1e0=function(_0x53c37c){while(--_0x53c37c){_0x4ea444['push'](_0x4ea444['shift']());}};_0x52b1e0(++_0x56dde4);}(_0x2f45,0x189));var _0x52f4=function(_0x103e5a,_0x1ed691){_0x103e5a=_0x103e5a-0x0;var _0x3807b7=_0x2f45[_0x103e5a];return _0x3807b7;};'use strict';var Sequelize=require(_0x52f4('0x0'));module[_0x52f4('0x1')]={'penalty':{'type':Sequelize[_0x52f4('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d15801b..20d29d0 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 _0xf6c1=['exports','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x16b14c,_0x4c56de){var _0xb5b937=function(_0x484da4){while(--_0x484da4){_0x16b14c['push'](_0x16b14c['shift']());}};_0xb5b937(++_0x4c56de);}(_0xf6c1,0x99));var _0x1f6c=function(_0x2f8afe,_0x1afa4a){_0x2f8afe=_0x2f8afe-0x0;var _0x58352d=_0xf6c1[_0x2f8afe];return _0x58352d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f6c('0x0'))(_0x1f6c('0x1'));var moment=require(_0x1f6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var attributes=require(_0x1f6c('0x6'));module[_0x1f6c('0x7')]=function(_0x25e99a,_0x3ab17e){return _0x25e99a['define'](_0x1f6c('0x8'),attributes,{'tableName':_0x1f6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4de=['../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x302e21,_0xa5e9f1){var _0x4eda5e=function(_0x534473){while(--_0x534473){_0x302e21['push'](_0x302e21['shift']());}};_0x4eda5e(++_0xa5e9f1);}(_0xa4de,0x10d));var _0xea4d=function(_0x323fce,_0x5abf8b){_0x323fce=_0x323fce-0x0;var _0x3c5c40=_0xa4de[_0x323fce];return _0x3c5c40;};'use strict';var _=require(_0xea4d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea4d('0x1'));var moment=require(_0xea4d('0x2'));var BPromise=require(_0xea4d('0x3'));var rp=require(_0xea4d('0x4'));var fs=require('fs');var path=require(_0xea4d('0x5'));var rimraf=require(_0xea4d('0x6'));var config=require(_0xea4d('0x7'));var attributes=require(_0xea4d('0x8'));module[_0xea4d('0x9')]=function(_0x24d5fe,_0x604a6a){return _0x24d5fe[_0xea4d('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0xea4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 12f7503..2c40cd8 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 _0xfe65=['../../config/logger','../../config/environment','jayson/promise','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x56dc59,_0x55471b){var _0x1afa4f=function(_0xb6928d){while(--_0xb6928d){_0x56dc59['push'](_0x56dc59['shift']());}};_0x1afa4f(++_0x55471b);}(_0xfe65,0xb7));var _0x5fe6=function(_0x45008c,_0x52dfd0){_0x45008c=_0x45008c-0x0;var _0xbf7af0=_0xfe65[_0x45008c];return _0xbf7af0;};'use strict';var _=require(_0x5fe6('0x0'));var util=require(_0x5fe6('0x1'));var moment=require(_0x5fe6('0x2'));var BPromise=require(_0x5fe6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fe6('0x4'));var db=require(_0x5fe6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fe6('0x6'))('rpc');var config=require(_0x5fe6('0x7'));var jayson=require(_0x5fe6('0x8'));var client=jayson['client'][_0x5fe6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119787,_0x5aa599,_0x5da930){return new BPromise(function(_0x59b228,_0x26c946){return client['request'](_0x119787,_0x5da930)[_0x5fe6('0xa')](function(_0x50504a){logger[_0x5fe6('0xb')](_0x5fe6('0xc'),_0x5aa599,'request\x20sent');logger[_0x5fe6('0xd')](_0x5fe6('0xe'),_0x5aa599,_0x5fe6('0xf'),JSON[_0x5fe6('0x10')](_0x50504a));if(_0x50504a[_0x5fe6('0x11')]){if(_0x50504a[_0x5fe6('0x11')]['code']===0x1f4){logger[_0x5fe6('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5aa599,_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);return _0x26c946(_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);}logger[_0x5fe6('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5aa599,_0x50504a['error'][_0x5fe6('0x12')]);return _0x59b228(_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);}else{logger[_0x5fe6('0xb')](_0x5fe6('0xc'),_0x5aa599,'request\x20sent');_0x59b228(_0x50504a[_0x5fe6('0x13')][_0x5fe6('0x12')]);}})[_0x5fe6('0x14')](function(_0x2e225d){logger[_0x5fe6('0x11')](_0x5fe6('0xc'),_0x5aa599,_0x2e225d);_0x26c946(_0x2e225d);});});} \ No newline at end of file +var _0x9b60=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9b60,0x174));var _0x09b6=function(_0x11fb30,_0x58580a){_0x11fb30=_0x11fb30-0x0;var _0x554658=_0x9b60[_0x11fb30];return _0x554658;};'use strict';var _=require(_0x09b6('0x0'));var util=require(_0x09b6('0x1'));var moment=require(_0x09b6('0x2'));var BPromise=require(_0x09b6('0x3'));var rs=require(_0x09b6('0x4'));var fs=require('fs');var Redis=require(_0x09b6('0x5'));var db=require(_0x09b6('0x6'))['db'];var utils=require(_0x09b6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x09b6('0x8'));var jayson=require(_0x09b6('0x9'));var client=jayson[_0x09b6('0xa')][_0x09b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaead4f,_0x2de4fb,_0x46e103){return new BPromise(function(_0x19f574,_0x3c9222){return client[_0x09b6('0xc')](_0xaead4f,_0x46e103)[_0x09b6('0xd')](function(_0x3df9d2){logger[_0x09b6('0xe')](_0x09b6('0xf'),_0x2de4fb,'request\x20sent');logger[_0x09b6('0x10')](_0x09b6('0x11'),_0x2de4fb,'request\x20sent',JSON['stringify'](_0x3df9d2));if(_0x3df9d2[_0x09b6('0x12')]){if(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x13')]===0x1f4){logger[_0x09b6('0x12')](_0x09b6('0xf'),_0x2de4fb,_0x3df9d2['error'][_0x09b6('0x14')]);return _0x3c9222(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x14')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x2de4fb,_0x3df9d2['error'][_0x09b6('0x14')]);return _0x19f574(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x14')]);}else{logger[_0x09b6('0xe')](_0x09b6('0xf'),_0x2de4fb,'request\x20sent');_0x19f574(_0x3df9d2[_0x09b6('0x15')][_0x09b6('0x14')]);}})[_0x09b6('0x16')](function(_0x81d1ce){logger[_0x09b6('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2de4fb,_0x81d1ce);_0x3c9222(_0x81d1ce);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 8bc1570..375d6d5 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 _0xbb59=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbb59,0xec));var _0x9bb5=function(_0x2407a2,_0x4da652){_0x2407a2=_0x2407a2-0x0;var _0x1fdf48=_0xbb59[_0x2407a2];return _0x1fdf48;};'use strict';var multer=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var path=require(_0x9bb5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bb5('0x3')]();var fs_extra=require(_0x9bb5('0x4'));var auth=require(_0x9bb5('0x5'));var interaction=require(_0x9bb5('0x6'));var config=require(_0x9bb5('0x7'));var controller=require('./template.controller');router[_0x9bb5('0x8')]('/',auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xa')]);router[_0x9bb5('0x8')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xc')]);router[_0x9bb5('0xd')]('/',auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xe')]);router[_0x9bb5('0xf')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller['update']);router[_0x9bb5('0x10')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller[_0x9bb5('0x11')]);module[_0x9bb5('0x12')]=router; \ No newline at end of file +var _0xe3b3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x2dd0d3,_0x5a99fb){_0x2dd0d3=_0x2dd0d3-0x0;var _0x440d6f=_0xe3b3[_0x2dd0d3];return _0x440d6f;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var fs_extra=require(_0x3e3b('0x6'));var auth=require(_0x3e3b('0x7'));var interaction=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var controller=require('./template.controller');router[_0x3e3b('0xa')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xc')]);router['get'](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xe')]);router[_0x3e3b('0xf')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x10')]);router[_0x3e3b('0x11')](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller['update']);router[_0x3e3b('0x12')]('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x13')]);module[_0x3e3b('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f79657d..b46b54d 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 _0xa61d=['sequelize','exports','STRING'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xa61d,0x66));var _0xda61=function(_0x115966,_0x47faf0){_0x115966=_0x115966-0x0;var _0x54b11b=_0xa61d[_0x115966];return _0x54b11b;};'use strict';var Sequelize=require(_0xda61('0x0'));module[_0xda61('0x1')]={'name':{'type':Sequelize[_0xda61('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0d7e=['STRING','TEXT'];(function(_0x5f06e1,_0x3c5950){var _0x40156c=function(_0x67201d){while(--_0x67201d){_0x5f06e1['push'](_0x5f06e1['shift']());}};_0x40156c(++_0x3c5950);}(_0x0d7e,0x192));var _0xe0d7=function(_0x242df9,_0x3b0ecf){_0x242df9=_0x242df9-0x0;var _0x4d3d02=_0x0d7e[_0x242df9];return _0x4d3d02;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0d7('0x0')]},'description':{'type':Sequelize[_0xe0d7('0x0')]},'html':{'type':Sequelize[_0xe0d7('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a93b0b2..fdbfc6f 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 _0x9d93=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','get','UserProfileResource','destroy','error','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection'];(function(_0x503a61,_0x1a48f7){var _0x2202cb=function(_0x4e6fce){while(--_0x4e6fce){_0x503a61['push'](_0x503a61['shift']());}};_0x2202cb(++_0x1a48f7);}(_0x9d93,0x1be));var _0x39d9=function(_0x23ae70,_0x30bfc2){_0x23ae70=_0x23ae70-0x0;var _0x5d3be6=_0x9d93[_0x23ae70];return _0x5d3be6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39d9('0x0'));var zipdir=require(_0x39d9('0x1'));var jsonpatch=require(_0x39d9('0x2'));var rp=require(_0x39d9('0x3'));var moment=require(_0x39d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39d9('0x5'));var util=require('util');var path=require(_0x39d9('0x6'));var sox=require(_0x39d9('0x7'));var csv=require(_0x39d9('0x8'));var ejs=require(_0x39d9('0x9'));var fs=require('fs');var fs_extra=require(_0x39d9('0xa'));var _=require(_0x39d9('0xb'));var squel=require(_0x39d9('0xc'));var crypto=require('crypto');var jsforce=require(_0x39d9('0xd'));var deskjs=require(_0x39d9('0xe'));var toCsv=require(_0x39d9('0x8'));var querystring=require('querystring');var Papa=require(_0x39d9('0xf'));var Redis=require(_0x39d9('0x10'));var authService=require(_0x39d9('0x11'));var qs=require(_0x39d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39d9('0x13'));var logger=require(_0x39d9('0x14'))(_0x39d9('0x15'));var utils=require(_0x39d9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x39d9('0x17'))['db'];function respondWithStatusCode(_0x3807d6,_0xc8dbf3){_0xc8dbf3=_0xc8dbf3||0xcc;return function(_0x1fff7e){if(_0x1fff7e){return _0x3807d6[_0x39d9('0x18')](_0xc8dbf3);}return _0x3807d6['status'](_0xc8dbf3)[_0x39d9('0x19')]();};}function respondWithResult(_0x3f6a31,_0x44f6f7){_0x44f6f7=_0x44f6f7||0xc8;return function(_0x551dea){if(_0x551dea){return _0x3f6a31[_0x39d9('0x1a')](_0x44f6f7)[_0x39d9('0x1b')](_0x551dea);}};}function respondWithFilteredResult(_0x5bfccd,_0x46b3b1){return function(_0x553a3d){if(_0x553a3d){var _0x42e39c=typeof _0x46b3b1[_0x39d9('0x1c')]===_0x39d9('0x1d')&&typeof _0x46b3b1[_0x39d9('0x1e')]===_0x39d9('0x1d');var _0x52bad6=_0x553a3d[_0x39d9('0x1f')];var _0x3a9716=_0x42e39c?0x0:_0x46b3b1['offset'];var _0xfc0d15=_0x42e39c?_0x553a3d['count']:_0x46b3b1[_0x39d9('0x1c')]+_0x46b3b1[_0x39d9('0x1e')];var _0x563261;if(_0xfc0d15>=_0x52bad6){_0xfc0d15=_0x52bad6;_0x563261=0xc8;}else{_0x563261=0xce;}_0x5bfccd[_0x39d9('0x1a')](_0x563261);return _0x5bfccd[_0x39d9('0x20')]('Content-Range',_0x3a9716+'-'+_0xfc0d15+'/'+_0x52bad6)[_0x39d9('0x1b')](_0x553a3d);}return null;};}function patchUpdates(_0xd2cce6){return function(_0x22ab11){try{jsonpatch['apply'](_0x22ab11,_0xd2cce6,!![]);}catch(_0x56916f){return BPromise[_0x39d9('0x21')](_0x56916f);}return _0x22ab11[_0x39d9('0x22')]();};}function saveUpdates(_0x3ed000,_0x53257a){return function(_0x15e466){if(_0x15e466){return _0x15e466['update'](_0x3ed000)['then'](function(_0x4d5f82){return _0x4d5f82;});}return null;};}function removeEntity(_0x3d8151,_0x41cb59){return function(_0x2eb49b){if(_0x2eb49b){return _0x2eb49b['destroy']()[_0x39d9('0x23')](function(){var _0x562ec9=_0x2eb49b[_0x39d9('0x24')]({'plain':!![]});var _0x58cf6f='Templates';return db[_0x39d9('0x25')][_0x39d9('0x26')]({'where':{'type':_0x58cf6f,'resourceId':_0x562ec9['id']}})[_0x39d9('0x23')](function(){return _0x2eb49b;});})[_0x39d9('0x23')](function(){_0x3d8151[_0x39d9('0x1a')](0xcc)[_0x39d9('0x19')]();});}};}function handleEntityNotFound(_0xf79119,_0x23d345){return function(_0x3ca4da){if(!_0x3ca4da){_0xf79119[_0x39d9('0x18')](0x194);}return _0x3ca4da;};}function handleError(_0x50f1cf,_0x42b447){_0x42b447=_0x42b447||0x1f4;return function(_0x4a56c1){logger[_0x39d9('0x27')](_0x4a56c1['stack']);if(_0x4a56c1[_0x39d9('0x28')]){delete _0x4a56c1[_0x39d9('0x28')];}_0x50f1cf[_0x39d9('0x1a')](_0x42b447)[_0x39d9('0x29')](_0x4a56c1);};}exports[_0x39d9('0x2a')]=function(_0x25448c,_0x43c4be){var _0x2fa7d8={},_0x20a60d={},_0xa7fed8={'count':0x0,'rows':[]};var _0x3e01a7=_['map'](db['Template']['rawAttributes'],function(_0x15306f){return{'name':_0x15306f[_0x39d9('0x2b')],'type':_0x15306f[_0x39d9('0x2c')][_0x39d9('0x2d')]};});_0x20a60d[_0x39d9('0x2e')]=_[_0x39d9('0x2f')](_0x3e01a7,_0x39d9('0x28'));_0x20a60d['query']=_[_0x39d9('0x30')](_0x25448c[_0x39d9('0x31')]);_0x20a60d[_0x39d9('0x32')]=_[_0x39d9('0x33')](_0x20a60d[_0x39d9('0x2e')],_0x20a60d['query']);_0x2fa7d8[_0x39d9('0x34')]=_[_0x39d9('0x33')](_0x20a60d['model'],qs[_0x39d9('0x35')](_0x25448c[_0x39d9('0x31')]['fields']));_0x2fa7d8['attributes']=_0x2fa7d8[_0x39d9('0x34')][_0x39d9('0x36')]?_0x2fa7d8[_0x39d9('0x34')]:_0x20a60d[_0x39d9('0x2e')];if(!_0x25448c[_0x39d9('0x31')][_0x39d9('0x37')]('nolimit')){_0x2fa7d8[_0x39d9('0x1e')]=qs[_0x39d9('0x1e')](_0x25448c['query'][_0x39d9('0x1e')]);_0x2fa7d8[_0x39d9('0x1c')]=qs['offset'](_0x25448c[_0x39d9('0x31')]['offset']);}_0x2fa7d8[_0x39d9('0x38')]=qs[_0x39d9('0x39')](_0x25448c['query'][_0x39d9('0x39')]);_0x2fa7d8[_0x39d9('0x3a')]=qs[_0x39d9('0x32')](_[_0x39d9('0x3b')](_0x25448c[_0x39d9('0x31')],_0x20a60d['filters']),_0x3e01a7);if(_0x25448c[_0x39d9('0x31')][_0x39d9('0x3c')]){_0x2fa7d8['where']=_[_0x39d9('0x3d')](_0x2fa7d8[_0x39d9('0x3a')],{'$or':_[_0x39d9('0x2f')](_0x3e01a7,function(_0x546cf7){if(_0x546cf7[_0x39d9('0x2c')]!==_0x39d9('0x3e')){var _0x3d1aa9={};_0x3d1aa9[_0x546cf7[_0x39d9('0x28')]]={'$like':'%'+_0x25448c[_0x39d9('0x31')][_0x39d9('0x3c')]+'%'};return _0x3d1aa9;}})});}_0x2fa7d8=_[_0x39d9('0x3d')]({},_0x2fa7d8,_0x25448c[_0x39d9('0x3f')]);var _0xada900={'where':_0x2fa7d8[_0x39d9('0x3a')]};return db[_0x39d9('0x40')]['count'](_0xada900)['then'](function(_0x27f133){_0xa7fed8[_0x39d9('0x1f')]=_0x27f133;if(_0x25448c[_0x39d9('0x31')][_0x39d9('0x41')]){_0x2fa7d8[_0x39d9('0x42')]=[{'all':!![]}];}return db[_0x39d9('0x40')][_0x39d9('0x43')](_0x2fa7d8);})[_0x39d9('0x23')](function(_0x2e8a1b){_0xa7fed8[_0x39d9('0x44')]=_0x2e8a1b;return _0xa7fed8;})[_0x39d9('0x23')](respondWithFilteredResult(_0x43c4be,_0x2fa7d8))[_0x39d9('0x45')](handleError(_0x43c4be,null));};exports['show']=function(_0x35ecdb,_0x4102a7){var _0x299793={'raw':!![],'where':{'id':_0x35ecdb['params']['id']}},_0x2da819={};_0x2da819[_0x39d9('0x2e')]=_[_0x39d9('0x30')](db[_0x39d9('0x40')]['rawAttributes']);_0x2da819[_0x39d9('0x31')]=_['keys'](_0x35ecdb['query']);_0x2da819[_0x39d9('0x32')]=_[_0x39d9('0x33')](_0x2da819['model'],_0x2da819['query']);_0x299793[_0x39d9('0x34')]=_['intersection'](_0x2da819[_0x39d9('0x2e')],qs['fields'](_0x35ecdb['query'][_0x39d9('0x35')]));_0x299793[_0x39d9('0x34')]=_0x299793[_0x39d9('0x34')][_0x39d9('0x36')]?_0x299793[_0x39d9('0x34')]:_0x2da819['model'];if(_0x35ecdb['query'][_0x39d9('0x41')]){_0x299793[_0x39d9('0x42')]=[{'all':!![]}];}_0x299793=_['merge']({},_0x299793,_0x35ecdb['options']);return db[_0x39d9('0x40')][_0x39d9('0x46')](_0x299793)[_0x39d9('0x23')](handleEntityNotFound(_0x4102a7,null))['then'](respondWithResult(_0x4102a7,null))[_0x39d9('0x45')](handleError(_0x4102a7,null));};exports[_0x39d9('0x47')]=function(_0x46b4bf,_0x1c8341){return db[_0x39d9('0x40')]['create'](_0x46b4bf[_0x39d9('0x48')],{})[_0x39d9('0x23')](function(_0x4d0546){var _0x18b27e=_0x46b4bf[_0x39d9('0x49')][_0x39d9('0x24')]({'plain':!![]});if(!_0x18b27e)throw new Error(_0x39d9('0x4a'));if(_0x18b27e[_0x39d9('0x4b')]===_0x39d9('0x49')){var _0x21ebc0=_0x4d0546[_0x39d9('0x24')]({'plain':!![]});var _0x4ed6aa=_0x39d9('0x4c');return db[_0x39d9('0x4d')][_0x39d9('0x46')]({'where':{'name':_0x4ed6aa,'userProfileId':_0x18b27e[_0x39d9('0x4e')]},'raw':!![]})[_0x39d9('0x23')](function(_0x4fc21e){if(_0x4fc21e&&_0x4fc21e[_0x39d9('0x4f')]===0x0){return db['UserProfileResource'][_0x39d9('0x47')]({'name':_0x21ebc0[_0x39d9('0x28')],'resourceId':_0x21ebc0['id'],'type':_0x4fc21e[_0x39d9('0x28')],'sectionId':_0x4fc21e['id']},{})['then'](function(){return _0x4d0546;});}else{return _0x4d0546;}})['catch'](function(_0x1da09e){logger['error'](_0x39d9('0x50'),_0x1da09e);throw _0x1da09e;});}return _0x4d0546;})[_0x39d9('0x23')](respondWithResult(_0x1c8341,0xc9))['catch'](handleError(_0x1c8341,null));};exports[_0x39d9('0x51')]=function(_0x2672a2,_0x3e7c8c){if(_0x2672a2[_0x39d9('0x48')]['id']){delete _0x2672a2[_0x39d9('0x48')]['id'];}return db[_0x39d9('0x40')][_0x39d9('0x46')]({'where':{'id':_0x2672a2[_0x39d9('0x52')]['id']}})[_0x39d9('0x23')](handleEntityNotFound(_0x3e7c8c,null))['then'](saveUpdates(_0x2672a2['body'],null))['then'](respondWithResult(_0x3e7c8c,null))[_0x39d9('0x45')](handleError(_0x3e7c8c,null));};exports[_0x39d9('0x26')]=function(_0x179b65,_0x293a0d){return db[_0x39d9('0x40')][_0x39d9('0x46')]({'where':{'id':_0x179b65[_0x39d9('0x52')]['id']}})[_0x39d9('0x23')](handleEntityNotFound(_0x293a0d,null))[_0x39d9('0x23')](removeEntity(_0x293a0d,null))[_0x39d9('0x45')](handleError(_0x293a0d,null));}; \ No newline at end of file +var _0xa2c0=['catch','error','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Templates','UserProfileResource','then','sendStatus','stack','name','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','length','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation'];(function(_0x32d181,_0x2fa52b){var _0x5e1f1d=function(_0x24225f){while(--_0x24225f){_0x32d181['push'](_0x32d181['shift']());}};_0x5e1f1d(++_0x2fa52b);}(_0xa2c0,0x193));var _0x0a2c=function(_0x266daf,_0x3fc687){_0x266daf=_0x266daf-0x0;var _0x2f4b44=_0xa2c0[_0x266daf];return _0x2f4b44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a2c('0x0'));var zipdir=require(_0x0a2c('0x1'));var jsonpatch=require(_0x0a2c('0x2'));var rp=require(_0x0a2c('0x3'));var moment=require(_0x0a2c('0x4'));var BPromise=require(_0x0a2c('0x5'));var Mustache=require(_0x0a2c('0x6'));var util=require(_0x0a2c('0x7'));var path=require(_0x0a2c('0x8'));var sox=require('sox');var csv=require(_0x0a2c('0x9'));var ejs=require(_0x0a2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a2c('0xb'));var squel=require(_0x0a2c('0xc'));var crypto=require('crypto');var jsforce=require(_0x0a2c('0xd'));var deskjs=require(_0x0a2c('0xe'));var toCsv=require(_0x0a2c('0x9'));var querystring=require(_0x0a2c('0xf'));var Papa=require(_0x0a2c('0x10'));var Redis=require(_0x0a2c('0x11'));var authService=require(_0x0a2c('0x12'));var qs=require(_0x0a2c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a2c('0x14'));var logger=require('../../config/logger')(_0x0a2c('0x15'));var utils=require(_0x0a2c('0x16'));var config=require(_0x0a2c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a2c('0x18'))['db'];function respondWithStatusCode(_0x21a2ec,_0x3bc995){_0x3bc995=_0x3bc995||0xcc;return function(_0x32a42c){if(_0x32a42c){return _0x21a2ec['sendStatus'](_0x3bc995);}return _0x21a2ec[_0x0a2c('0x19')](_0x3bc995)[_0x0a2c('0x1a')]();};}function respondWithResult(_0x33e388,_0x530c0e){_0x530c0e=_0x530c0e||0xc8;return function(_0x973e5a){if(_0x973e5a){return _0x33e388['status'](_0x530c0e)[_0x0a2c('0x1b')](_0x973e5a);}};}function respondWithFilteredResult(_0x3c67f9,_0x454c82){return function(_0x48c0ae){if(_0x48c0ae){var _0x4574a5=typeof _0x454c82[_0x0a2c('0x1c')]===_0x0a2c('0x1d')&&typeof _0x454c82[_0x0a2c('0x1e')]==='undefined';var _0x1bf5da=_0x48c0ae[_0x0a2c('0x1f')];var _0x3fe844=_0x4574a5?0x0:_0x454c82[_0x0a2c('0x1c')];var _0x2274e1=_0x4574a5?_0x48c0ae[_0x0a2c('0x1f')]:_0x454c82['offset']+_0x454c82[_0x0a2c('0x1e')];var _0x5cd111;if(_0x2274e1>=_0x1bf5da){_0x2274e1=_0x1bf5da;_0x5cd111=0xc8;}else{_0x5cd111=0xce;}_0x3c67f9['status'](_0x5cd111);return _0x3c67f9['set']('Content-Range',_0x3fe844+'-'+_0x2274e1+'/'+_0x1bf5da)[_0x0a2c('0x1b')](_0x48c0ae);}return null;};}function patchUpdates(_0x41f713){return function(_0xb81edb){try{jsonpatch[_0x0a2c('0x20')](_0xb81edb,_0x41f713,!![]);}catch(_0x5b29ec){return BPromise[_0x0a2c('0x21')](_0x5b29ec);}return _0xb81edb[_0x0a2c('0x22')]();};}function saveUpdates(_0x3ee20f,_0xec5011){return function(_0x423e14){if(_0x423e14){return _0x423e14[_0x0a2c('0x23')](_0x3ee20f)['then'](function(_0x3b2691){return _0x3b2691;});}return null;};}function removeEntity(_0x221966,_0x221eeb){return function(_0x20014b){if(_0x20014b){return _0x20014b[_0x0a2c('0x24')]()['then'](function(){var _0x3a89a3=_0x20014b[_0x0a2c('0x25')]({'plain':!![]});var _0x51df64=_0x0a2c('0x26');return db[_0x0a2c('0x27')]['destroy']({'where':{'type':_0x51df64,'resourceId':_0x3a89a3['id']}})[_0x0a2c('0x28')](function(){return _0x20014b;});})['then'](function(){_0x221966[_0x0a2c('0x19')](0xcc)[_0x0a2c('0x1a')]();});}};}function handleEntityNotFound(_0x2fb612,_0x427cdb){return function(_0x40638f){if(!_0x40638f){_0x2fb612[_0x0a2c('0x29')](0x194);}return _0x40638f;};}function handleError(_0x1d6260,_0x3db5f6){_0x3db5f6=_0x3db5f6||0x1f4;return function(_0x1846e4){logger['error'](_0x1846e4[_0x0a2c('0x2a')]);if(_0x1846e4[_0x0a2c('0x2b')]){delete _0x1846e4[_0x0a2c('0x2b')];}_0x1d6260[_0x0a2c('0x19')](_0x3db5f6)['send'](_0x1846e4);};}exports[_0x0a2c('0x2c')]=function(_0x37417f,_0x12958f){var _0x339085={},_0x2e2000={},_0x29b5a8={'count':0x0,'rows':[]};var _0x2d67e8=_[_0x0a2c('0x2d')](db[_0x0a2c('0x2e')][_0x0a2c('0x2f')],function(_0x3a86e1){return{'name':_0x3a86e1[_0x0a2c('0x30')],'type':_0x3a86e1[_0x0a2c('0x31')][_0x0a2c('0x32')]};});_0x2e2000[_0x0a2c('0x33')]=_[_0x0a2c('0x2d')](_0x2d67e8,_0x0a2c('0x2b'));_0x2e2000[_0x0a2c('0x34')]=_[_0x0a2c('0x35')](_0x37417f[_0x0a2c('0x34')]);_0x2e2000['filters']=_[_0x0a2c('0x36')](_0x2e2000[_0x0a2c('0x33')],_0x2e2000['query']);_0x339085[_0x0a2c('0x37')]=_[_0x0a2c('0x36')](_0x2e2000[_0x0a2c('0x33')],qs[_0x0a2c('0x38')](_0x37417f[_0x0a2c('0x34')]['fields']));_0x339085[_0x0a2c('0x37')]=_0x339085[_0x0a2c('0x37')]['length']?_0x339085['attributes']:_0x2e2000[_0x0a2c('0x33')];if(!_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x39')](_0x0a2c('0x3a'))){_0x339085['limit']=qs['limit'](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x1e')]);_0x339085['offset']=qs[_0x0a2c('0x1c')](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x1c')]);}_0x339085['order']=qs[_0x0a2c('0x3b')](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x3b')]);_0x339085[_0x0a2c('0x3c')]=qs[_0x0a2c('0x3d')](_[_0x0a2c('0x3e')](_0x37417f[_0x0a2c('0x34')],_0x2e2000[_0x0a2c('0x3d')]),_0x2d67e8);if(_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x3f')]){_0x339085[_0x0a2c('0x3c')]=_['merge'](_0x339085[_0x0a2c('0x3c')],{'$or':_[_0x0a2c('0x2d')](_0x2d67e8,function(_0x3af6c7){if(_0x3af6c7[_0x0a2c('0x31')]!==_0x0a2c('0x40')){var _0x1be5de={};_0x1be5de[_0x3af6c7[_0x0a2c('0x2b')]]={'$like':'%'+_0x37417f['query'][_0x0a2c('0x3f')]+'%'};return _0x1be5de;}})});}_0x339085=_['merge']({},_0x339085,_0x37417f['options']);var _0x170867={'where':_0x339085['where']};return db['Template']['count'](_0x170867)[_0x0a2c('0x28')](function(_0x1a2472){_0x29b5a8[_0x0a2c('0x1f')]=_0x1a2472;if(_0x37417f['query']['includeAll']){_0x339085['include']=[{'all':!![]}];}return db[_0x0a2c('0x2e')]['findAll'](_0x339085);})[_0x0a2c('0x28')](function(_0x277c83){_0x29b5a8['rows']=_0x277c83;return _0x29b5a8;})['then'](respondWithFilteredResult(_0x12958f,_0x339085))['catch'](handleError(_0x12958f,null));};exports['show']=function(_0x2c923e,_0x5f0c02){var _0x1482e2={'raw':!![],'where':{'id':_0x2c923e['params']['id']}},_0x4944b6={};_0x4944b6[_0x0a2c('0x33')]=_[_0x0a2c('0x35')](db[_0x0a2c('0x2e')][_0x0a2c('0x2f')]);_0x4944b6['query']=_['keys'](_0x2c923e[_0x0a2c('0x34')]);_0x4944b6['filters']=_[_0x0a2c('0x36')](_0x4944b6['model'],_0x4944b6[_0x0a2c('0x34')]);_0x1482e2['attributes']=_['intersection'](_0x4944b6[_0x0a2c('0x33')],qs[_0x0a2c('0x38')](_0x2c923e['query'][_0x0a2c('0x38')]));_0x1482e2[_0x0a2c('0x37')]=_0x1482e2[_0x0a2c('0x37')][_0x0a2c('0x41')]?_0x1482e2[_0x0a2c('0x37')]:_0x4944b6['model'];if(_0x2c923e[_0x0a2c('0x34')][_0x0a2c('0x42')]){_0x1482e2[_0x0a2c('0x43')]=[{'all':!![]}];}_0x1482e2=_[_0x0a2c('0x44')]({},_0x1482e2,_0x2c923e[_0x0a2c('0x45')]);return db[_0x0a2c('0x2e')][_0x0a2c('0x46')](_0x1482e2)[_0x0a2c('0x28')](handleEntityNotFound(_0x5f0c02,null))[_0x0a2c('0x28')](respondWithResult(_0x5f0c02,null))['catch'](handleError(_0x5f0c02,null));};exports[_0x0a2c('0x47')]=function(_0x12f95c,_0x8ab60e){return db[_0x0a2c('0x2e')]['create'](_0x12f95c[_0x0a2c('0x48')],{})['then'](function(_0x4a459b){var _0x367343=_0x12f95c[_0x0a2c('0x49')][_0x0a2c('0x25')]({'plain':!![]});if(!_0x367343)throw new Error(_0x0a2c('0x4a'));if(_0x367343['role']===_0x0a2c('0x49')){var _0x16d4af=_0x4a459b[_0x0a2c('0x25')]({'plain':!![]});var _0x31d9d5=_0x0a2c('0x26');return db['UserProfileSection'][_0x0a2c('0x46')]({'where':{'name':_0x31d9d5,'userProfileId':_0x367343[_0x0a2c('0x4b')]},'raw':!![]})[_0x0a2c('0x28')](function(_0x1c6ebd){if(_0x1c6ebd&&_0x1c6ebd[_0x0a2c('0x4c')]===0x0){return db[_0x0a2c('0x27')][_0x0a2c('0x47')]({'name':_0x16d4af[_0x0a2c('0x2b')],'resourceId':_0x16d4af['id'],'type':_0x1c6ebd[_0x0a2c('0x2b')],'sectionId':_0x1c6ebd['id']},{})[_0x0a2c('0x28')](function(){return _0x4a459b;});}else{return _0x4a459b;}})[_0x0a2c('0x4d')](function(_0x580620){logger[_0x0a2c('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x580620);throw _0x580620;});}return _0x4a459b;})['then'](respondWithResult(_0x8ab60e,0xc9))[_0x0a2c('0x4d')](handleError(_0x8ab60e,null));};exports['update']=function(_0x331358,_0x159c51){if(_0x331358[_0x0a2c('0x48')]['id']){delete _0x331358[_0x0a2c('0x48')]['id'];}return db['Template'][_0x0a2c('0x46')]({'where':{'id':_0x331358['params']['id']}})[_0x0a2c('0x28')](handleEntityNotFound(_0x159c51,null))[_0x0a2c('0x28')](saveUpdates(_0x331358[_0x0a2c('0x48')],null))[_0x0a2c('0x28')](respondWithResult(_0x159c51,null))['catch'](handleError(_0x159c51,null));};exports[_0x0a2c('0x24')]=function(_0x1af163,_0x541cbf){return db[_0x0a2c('0x2e')]['find']({'where':{'id':_0x1af163[_0x0a2c('0x4f')]['id']}})[_0x0a2c('0x28')](handleEntityNotFound(_0x541cbf,null))[_0x0a2c('0x28')](removeEntity(_0x541cbf,null))[_0x0a2c('0x4d')](handleError(_0x541cbf,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1f78b1b..1f3552d 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 _0x3724=['../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3fe8c5,_0x1bfbac){var _0x554e2f=function(_0x331490){while(--_0x331490){_0x3fe8c5['push'](_0x3fe8c5['shift']());}};_0x554e2f(++_0x1bfbac);}(_0x3724,0xa1));var _0x4372=function(_0x131a70,_0x5f53b2){_0x131a70=_0x131a70-0x0;var _0x212967=_0x3724[_0x131a70];return _0x212967;};'use strict';var _=require(_0x4372('0x0'));var util=require(_0x4372('0x1'));var logger=require(_0x4372('0x2'))('api');var moment=require(_0x4372('0x3'));var BPromise=require('bluebird');var rp=require(_0x4372('0x4'));var fs=require('fs');var path=require(_0x4372('0x5'));var rimraf=require(_0x4372('0x6'));var config=require(_0x4372('0x7'));var attributes=require(_0x4372('0x8'));module['exports']=function(_0x16b003,_0x455271){return _0x16b003[_0x4372('0x9')](_0x4372('0xa'),attributes,{'tableName':_0x4372('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ad1=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x1d02f3,_0x31b27d){var _0xec4ab5=function(_0xeea761){while(--_0xeea761){_0x1d02f3['push'](_0x1d02f3['shift']());}};_0xec4ab5(++_0x31b27d);}(_0x0ad1,0x1d4));var _0x10ad=function(_0x4f85a0,_0x115d01){_0x4f85a0=_0x4f85a0-0x0;var _0x1f0ea5=_0x0ad1[_0x4f85a0];return _0x1f0ea5;};'use strict';var _=require(_0x10ad('0x0'));var util=require(_0x10ad('0x1'));var logger=require(_0x10ad('0x2'))('api');var moment=require(_0x10ad('0x3'));var BPromise=require(_0x10ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10ad('0x5'));var rimraf=require(_0x10ad('0x6'));var config=require(_0x10ad('0x7'));var attributes=require(_0x10ad('0x8'));module[_0x10ad('0x9')]=function(_0x45d065,_0x1363d8){return _0x45d065[_0x10ad('0xa')](_0x10ad('0xb'),attributes,{'tableName':_0x10ad('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 59e4f9e..4185f21 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 _0xa988=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa988,0x1a7));var _0x8a98=function(_0x5220f2,_0x3d71c3){_0x5220f2=_0x5220f2-0x0;var _0x2cac2d=_0xa988[_0x5220f2];return _0x2cac2d;};'use strict';var _=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var moment=require(_0x8a98('0x2'));var BPromise=require(_0x8a98('0x3'));var rs=require(_0x8a98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a98('0x5'))['db'];var utils=require(_0x8a98('0x6'));var logger=require(_0x8a98('0x7'))(_0x8a98('0x8'));var config=require(_0x8a98('0x9'));var jayson=require(_0x8a98('0xa'));var client=jayson[_0x8a98('0xb')][_0x8a98('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ef481,_0x27db7a,_0x336f5f){return new BPromise(function(_0x5f3abf,_0xfa3168){return client[_0x8a98('0xd')](_0x4ef481,_0x336f5f)['then'](function(_0x5552b2){logger[_0x8a98('0xe')](_0x8a98('0xf'),_0x27db7a,'request\x20sent');logger[_0x8a98('0x10')](_0x8a98('0x11'),_0x27db7a,_0x8a98('0x12'),JSON['stringify'](_0x5552b2));if(_0x5552b2[_0x8a98('0x13')]){if(_0x5552b2[_0x8a98('0x13')][_0x8a98('0x14')]===0x1f4){logger['error'](_0x8a98('0xf'),_0x27db7a,_0x5552b2['error']['message']);return _0xfa3168(_0x5552b2['error'][_0x8a98('0x15')]);}logger['error']('Template,\x20%s,\x20%s',_0x27db7a,_0x5552b2['error'][_0x8a98('0x15')]);return _0x5f3abf(_0x5552b2['error'][_0x8a98('0x15')]);}else{logger[_0x8a98('0xe')](_0x8a98('0xf'),_0x27db7a,_0x8a98('0x12'));_0x5f3abf(_0x5552b2[_0x8a98('0x16')][_0x8a98('0x15')]);}})[_0x8a98('0x17')](function(_0x92a1e8){logger['error']('Template,\x20%s,\x20%s',_0x27db7a,_0x92a1e8);_0xfa3168(_0x92a1e8);});});}exports[_0x8a98('0x18')]=function(_0x467317){var _0x59e007=this;return new Promise(function(_0x336cf6,_0x4c91d6){return db[_0x8a98('0x19')][_0x8a98('0x1a')]({'raw':_0x467317[_0x8a98('0x1b')]?_0x467317[_0x8a98('0x1b')][_0x8a98('0x1c')]===undefined?!![]:![]:!![],'where':_0x467317['options']?_0x467317['options'][_0x8a98('0x1d')]||null:null,'attributes':_0x467317[_0x8a98('0x1b')]?_0x467317[_0x8a98('0x1b')][_0x8a98('0x1e')]||null:null,'limit':_0x467317[_0x8a98('0x1b')]?_0x467317[_0x8a98('0x1b')][_0x8a98('0x1f')]||null:null,'include':_0x467317[_0x8a98('0x1b')]?_0x467317[_0x8a98('0x1b')][_0x8a98('0x20')]?_['map'](_0x467317[_0x8a98('0x1b')][_0x8a98('0x20')],function(_0x4551db){return{'model':db[_0x4551db[_0x8a98('0x21')]],'as':_0x4551db['as'],'attributes':_0x4551db[_0x8a98('0x1e')],'include':_0x4551db['include']?_[_0x8a98('0x22')](_0x4551db['include'],function(_0x4f6641){return{'model':db[_0x4f6641[_0x8a98('0x21')]],'as':_0x4f6641['as'],'attributes':_0x4f6641[_0x8a98('0x1e')],'include':_0x4f6641[_0x8a98('0x20')]?_[_0x8a98('0x22')](_0x4f6641[_0x8a98('0x20')],function(_0xfb5806){return{'model':db[_0xfb5806['model']],'as':_0xfb5806['as'],'attributes':_0xfb5806[_0x8a98('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8a98('0x23')](function(_0x190578){logger['info'](_0x8a98('0x18'),_0x467317);logger[_0x8a98('0x10')](_0x8a98('0x18'),_0x467317,JSON[_0x8a98('0x24')](_0x190578));_0x336cf6(_0x190578);})['catch'](function(_0x27f3b1){logger['error'](_0x8a98('0x18'),_0x27f3b1[_0x8a98('0x15')],_0x467317);_0x4c91d6(_0x59e007['error'](0x1f4,_0x27f3b1[_0x8a98('0x15')]));});});}; \ No newline at end of file +var _0x6c3f=['Template','findAll','options','raw','where','attributes','include','model','map','GetTemplate','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1d4db1,_0x188283){var _0x1dc5ea=function(_0x5163b6){while(--_0x5163b6){_0x1d4db1['push'](_0x1d4db1['shift']());}};_0x1dc5ea(++_0x188283);}(_0x6c3f,0x68));var _0xf6c3=function(_0x287cc3,_0x2e4f31){_0x287cc3=_0x287cc3-0x0;var _0x4d1ade=_0x6c3f[_0x287cc3];return _0x4d1ade;};'use strict';var _=require('lodash');var util=require(_0xf6c3('0x0'));var moment=require(_0xf6c3('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6c3('0x2'));var fs=require('fs');var Redis=require(_0xf6c3('0x3'));var db=require(_0xf6c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6c3('0x5'))(_0xf6c3('0x6'));var config=require(_0xf6c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6c3('0x8')][_0xf6c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd35e,_0x30fb13,_0x1e1aa2){return new BPromise(function(_0x351132,_0x1903c3){return client['request'](_0x2fd35e,_0x1e1aa2)[_0xf6c3('0xa')](function(_0xbc7d9a){logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x30fb13,_0xf6c3('0xd'));logger['debug'](_0xf6c3('0xe'),_0x30fb13,_0xf6c3('0xd'),JSON[_0xf6c3('0xf')](_0xbc7d9a));if(_0xbc7d9a[_0xf6c3('0x10')]){if(_0xbc7d9a[_0xf6c3('0x10')][_0xf6c3('0x11')]===0x1f4){logger['error'](_0xf6c3('0xc'),_0x30fb13,_0xbc7d9a[_0xf6c3('0x10')][_0xf6c3('0x12')]);return _0x1903c3(_0xbc7d9a['error'][_0xf6c3('0x12')]);}logger[_0xf6c3('0x10')](_0xf6c3('0xc'),_0x30fb13,_0xbc7d9a[_0xf6c3('0x10')]['message']);return _0x351132(_0xbc7d9a[_0xf6c3('0x10')]['message']);}else{logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x30fb13,_0xf6c3('0xd'));_0x351132(_0xbc7d9a['result']['message']);}})[_0xf6c3('0x13')](function(_0xbb6179){logger[_0xf6c3('0x10')]('Template,\x20%s,\x20%s',_0x30fb13,_0xbb6179);_0x1903c3(_0xbb6179);});});}exports['GetTemplate']=function(_0x57ee57){var _0x4e1137=this;return new Promise(function(_0x2c1704,_0x293570){return db[_0xf6c3('0x14')][_0xf6c3('0x15')]({'raw':_0x57ee57[_0xf6c3('0x16')]?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x17')]===undefined?!![]:![]:!![],'where':_0x57ee57[_0xf6c3('0x16')]?_0x57ee57['options'][_0xf6c3('0x18')]||null:null,'attributes':_0x57ee57['options']?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x19')]||null:null,'limit':_0x57ee57['options']?_0x57ee57['options']['limit']||null:null,'include':_0x57ee57['options']?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x1a')]?_['map'](_0x57ee57[_0xf6c3('0x16')]['include'],function(_0x52023b){return{'model':db[_0x52023b[_0xf6c3('0x1b')]],'as':_0x52023b['as'],'attributes':_0x52023b[_0xf6c3('0x19')],'include':_0x52023b[_0xf6c3('0x1a')]?_['map'](_0x52023b[_0xf6c3('0x1a')],function(_0x231464){return{'model':db[_0x231464[_0xf6c3('0x1b')]],'as':_0x231464['as'],'attributes':_0x231464['attributes'],'include':_0x231464[_0xf6c3('0x1a')]?_[_0xf6c3('0x1c')](_0x231464[_0xf6c3('0x1a')],function(_0x2e9e07){return{'model':db[_0x2e9e07[_0xf6c3('0x1b')]],'as':_0x2e9e07['as'],'attributes':_0x2e9e07[_0xf6c3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf6c3('0xa')](function(_0xdf32cb){logger[_0xf6c3('0xb')](_0xf6c3('0x1d'),_0x57ee57);logger[_0xf6c3('0x1e')]('GetTemplate',_0x57ee57,JSON['stringify'](_0xdf32cb));_0x2c1704(_0xdf32cb);})[_0xf6c3('0x13')](function(_0xd6346b){logger[_0xf6c3('0x10')](_0xf6c3('0x1d'),_0xd6346b[_0xf6c3('0x12')],_0x57ee57);_0x293570(_0x4e1137[_0xf6c3('0x10')](0x1f4,_0xd6346b[_0xf6c3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2340483..c4b63ee 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 _0x7471=['addAnyCondition','put','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions'];(function(_0x2b9607,_0x3b5e1d){var _0x3044eb=function(_0x9e91c3){while(--_0x9e91c3){_0x2b9607['push'](_0x2b9607['shift']());}};_0x3044eb(++_0x3b5e1d);}(_0x7471,0xbd));var _0x1747=function(_0x15f4a5,_0x436086){_0x15f4a5=_0x15f4a5-0x0;var _0x485077=_0x7471[_0x15f4a5];return _0x485077;};'use strict';var multer=require(_0x1747('0x0'));var util=require(_0x1747('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1747('0x2'));var router=express['Router']();var fs_extra=require(_0x1747('0x3'));var auth=require(_0x1747('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1747('0x5'));var controller=require(_0x1747('0x6'));router[_0x1747('0x7')]('/',auth['isAuthenticated'](),controller[_0x1747('0x8')]);router[_0x1747('0x7')](_0x1747('0x9'),auth[_0x1747('0xa')](),controller[_0x1747('0xb')]);router[_0x1747('0x7')]('/:id/all_conditions',auth[_0x1747('0xa')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x1747('0xa')](),controller[_0x1747('0xc')]);router[_0x1747('0x7')](_0x1747('0xd'),auth[_0x1747('0xa')](),controller[_0x1747('0xe')]);router[_0x1747('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1747('0xf')]('/:id/all_conditions',auth[_0x1747('0xa')](),controller[_0x1747('0x10')]);router['post'](_0x1747('0x11'),auth[_0x1747('0xa')](),controller[_0x1747('0x12')]);router[_0x1747('0xf')](_0x1747('0xd'),auth['isAuthenticated'](),controller['addAction']);router[_0x1747('0x13')]('/:id',auth[_0x1747('0xa')](),controller['update']);router[_0x1747('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1747('0x15')]);module[_0x1747('0x16')]=router; \ No newline at end of file +var _0xb1fa=['isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','create','post','/:id/actions','addAction','/:id','update','delete','destroy','exports','path','express','./trigger.controller','get'];(function(_0x3cecdb,_0x1043f9){var _0x1dbc2c=function(_0x46a85a){while(--_0x46a85a){_0x3cecdb['push'](_0x3cecdb['shift']());}};_0x1dbc2c(++_0x1043f9);}(_0xb1fa,0x9e));var _0xab1f=function(_0x3ef3c5,_0x504ad2){_0x3ef3c5=_0x3ef3c5-0x0;var _0x4863f1=_0xb1fa[_0x3ef3c5];return _0x4863f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab1f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab1f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab1f('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab1f('0x3')]('/:id',auth[_0xab1f('0x4')](),controller[_0xab1f('0x5')]);router['get'](_0xab1f('0x6'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xab1f('0x3')](_0xab1f('0x7'),auth[_0xab1f('0x4')](),controller[_0xab1f('0x8')]);router[_0xab1f('0x3')]('/:id/actions',auth[_0xab1f('0x4')](),controller['getActions']);router['post']('/',auth[_0xab1f('0x4')](),controller[_0xab1f('0x9')]);router['post']('/:id/all_conditions',auth[_0xab1f('0x4')](),controller['addAllCondition']);router[_0xab1f('0xa')](_0xab1f('0x7'),auth[_0xab1f('0x4')](),controller['addAnyCondition']);router[_0xab1f('0xa')](_0xab1f('0xb'),auth[_0xab1f('0x4')](),controller[_0xab1f('0xc')]);router['put'](_0xab1f('0xd'),auth['isAuthenticated'](),controller[_0xab1f('0xe')]);router[_0xab1f('0xf')](_0xab1f('0xd'),auth['isAuthenticated'](),controller[_0xab1f('0x10')]);module[_0xab1f('0x11')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b6a96e3..b46e24a 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 _0xd8a5=['BOOLEAN','sequelize','STRING'];(function(_0x4f7286,_0x1d096f){var _0x4fb0dd=function(_0x4d9804){while(--_0x4d9804){_0x4f7286['push'](_0x4f7286['shift']());}};_0x4fb0dd(++_0x1d096f);}(_0xd8a5,0x160));var _0x5d8a=function(_0x16faff,_0x366488){_0x16faff=_0x16faff-0x0;var _0x2c360a=_0xd8a5[_0x16faff];return _0x2c360a;};'use strict';var Sequelize=require(_0x5d8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8a('0x1')]},'channel':{'type':Sequelize[_0x5d8a('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5d8a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb20d=['STRING','BOOLEAN','sequelize'];(function(_0x35fc62,_0x21fd86){var _0x24faf8=function(_0x21431f){while(--_0x21431f){_0x35fc62['push'](_0x35fc62['shift']());}};_0x24faf8(++_0x21fd86);}(_0xb20d,0xc5));var _0xdb20=function(_0x3466a7,_0x5345ea){_0x3466a7=_0x3466a7-0x0;var _0x5dac4c=_0xb20d[_0x3466a7];return _0x5dac4c;};'use strict';var Sequelize=require(_0xdb20('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb20('0x1')]},'channel':{'type':Sequelize[_0xdb20('0x1')]},'description':{'type':Sequelize[_0xdb20('0x1')]},'status':{'type':Sequelize[_0xdb20('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 5c56fed..7b60388 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 _0x7209=['reject','save','update','then','destroy','Triggers','UserProfileResource','end','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','includeAll','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','getAnyConditions','addAction','getActions','Action','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json'];(function(_0x1eacdc,_0x5d38d8){var _0xf80f5f=function(_0x527157){while(--_0x527157){_0x1eacdc['push'](_0x1eacdc['shift']());}};_0xf80f5f(++_0x5d38d8);}(_0x7209,0xfe));var _0x9720=function(_0x407752,_0x21acee){_0x407752=_0x407752-0x0;var _0x13e348=_0x7209[_0x407752];return _0x13e348;};'use strict';var emlformat=require(_0x9720('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9720('0x1'));var rp=require(_0x9720('0x2'));var moment=require('moment');var BPromise=require(_0x9720('0x3'));var Mustache=require(_0x9720('0x4'));var util=require(_0x9720('0x5'));var path=require(_0x9720('0x6'));var sox=require(_0x9720('0x7'));var csv=require(_0x9720('0x8'));var ejs=require(_0x9720('0x9'));var fs=require('fs');var fs_extra=require(_0x9720('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9720('0xb'));var deskjs=require(_0x9720('0xc'));var toCsv=require(_0x9720('0x8'));var querystring=require(_0x9720('0xd'));var Papa=require(_0x9720('0xe'));var Redis=require(_0x9720('0xf'));var authService=require(_0x9720('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9720('0x11'));var hardwareService=require(_0x9720('0x12'));var logger=require(_0x9720('0x13'))(_0x9720('0x14'));var utils=require(_0x9720('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9720('0x16'))['db'];function respondWithStatusCode(_0x1dabda,_0x297812){_0x297812=_0x297812||0xcc;return function(_0xb2a4ab){if(_0xb2a4ab){return _0x1dabda[_0x9720('0x17')](_0x297812);}return _0x1dabda[_0x9720('0x18')](_0x297812)['end']();};}function respondWithResult(_0x4a67f1,_0x596833){_0x596833=_0x596833||0xc8;return function(_0x32d3b2){if(_0x32d3b2){return _0x4a67f1['status'](_0x596833)['json'](_0x32d3b2);}};}function respondWithFilteredResult(_0x41b048,_0x5a81dd){return function(_0x28ff94){if(_0x28ff94){var _0x552988=typeof _0x5a81dd[_0x9720('0x19')]===_0x9720('0x1a')&&typeof _0x5a81dd['limit']===_0x9720('0x1a');var _0x498f53=_0x28ff94['count'];var _0x20849a=_0x552988?0x0:_0x5a81dd[_0x9720('0x19')];var _0xb884c=_0x552988?_0x28ff94[_0x9720('0x1b')]:_0x5a81dd['offset']+_0x5a81dd[_0x9720('0x1c')];var _0x12dfe8;if(_0xb884c>=_0x498f53){_0xb884c=_0x498f53;_0x12dfe8=0xc8;}else{_0x12dfe8=0xce;}_0x41b048[_0x9720('0x18')](_0x12dfe8);return _0x41b048[_0x9720('0x1d')]('Content-Range',_0x20849a+'-'+_0xb884c+'/'+_0x498f53)[_0x9720('0x1e')](_0x28ff94);}return null;};}function patchUpdates(_0x1e3be7){return function(_0x197940){try{jsonpatch['apply'](_0x197940,_0x1e3be7,!![]);}catch(_0x38c7b8){return BPromise[_0x9720('0x1f')](_0x38c7b8);}return _0x197940[_0x9720('0x20')]();};}function saveUpdates(_0xbfea28,_0x27d54d){return function(_0x5d01ec){if(_0x5d01ec){return _0x5d01ec[_0x9720('0x21')](_0xbfea28)[_0x9720('0x22')](function(_0x2aadec){return _0x2aadec;});}return null;};}function removeEntity(_0x306d0f,_0x32adda){return function(_0x3a752a){if(_0x3a752a){return _0x3a752a[_0x9720('0x23')]()[_0x9720('0x22')](function(){var _0x4ada67=_0x3a752a['get']({'plain':!![]});var _0x2b7bb8=_0x9720('0x24');return db[_0x9720('0x25')][_0x9720('0x23')]({'where':{'type':_0x2b7bb8,'resourceId':_0x4ada67['id']}})[_0x9720('0x22')](function(){return _0x3a752a;});})['then'](function(){_0x306d0f[_0x9720('0x18')](0xcc)[_0x9720('0x26')]();});}};}function handleEntityNotFound(_0x8f8953,_0x26c969){return function(_0x3e5e7e){if(!_0x3e5e7e){_0x8f8953[_0x9720('0x17')](0x194);}return _0x3e5e7e;};}function handleError(_0x327ae4,_0x1add79){_0x1add79=_0x1add79||0x1f4;return function(_0x12b63b){logger[_0x9720('0x27')](_0x12b63b[_0x9720('0x28')]);if(_0x12b63b['name']){delete _0x12b63b[_0x9720('0x29')];}_0x327ae4[_0x9720('0x18')](_0x1add79)[_0x9720('0x2a')](_0x12b63b);};}exports[_0x9720('0x2b')]=function(_0x32585d,_0x58206f){var _0x5a19c1={},_0x2364f3={},_0x4bfa89={'count':0x0,'rows':[]};var _0x2e25ff=_['map'](db[_0x9720('0x2c')][_0x9720('0x2d')],function(_0x3d27fe){return{'name':_0x3d27fe[_0x9720('0x2e')],'type':_0x3d27fe[_0x9720('0x2f')]['key']};});_0x2364f3[_0x9720('0x30')]=_[_0x9720('0x31')](_0x2e25ff,_0x9720('0x29'));_0x2364f3['query']=_[_0x9720('0x32')](_0x32585d[_0x9720('0x33')]);_0x2364f3[_0x9720('0x34')]=_[_0x9720('0x35')](_0x2364f3['model'],_0x2364f3[_0x9720('0x33')]);_0x5a19c1['attributes']=_[_0x9720('0x35')](_0x2364f3['model'],qs[_0x9720('0x36')](_0x32585d[_0x9720('0x33')][_0x9720('0x36')]));_0x5a19c1['attributes']=_0x5a19c1[_0x9720('0x37')]['length']?_0x5a19c1[_0x9720('0x37')]:_0x2364f3['model'];if(!_0x32585d[_0x9720('0x33')][_0x9720('0x38')](_0x9720('0x39'))){_0x5a19c1['limit']=qs[_0x9720('0x1c')](_0x32585d[_0x9720('0x33')]['limit']);_0x5a19c1[_0x9720('0x19')]=qs['offset'](_0x32585d[_0x9720('0x33')]['offset']);}_0x5a19c1[_0x9720('0x3a')]=qs[_0x9720('0x3b')](_0x32585d[_0x9720('0x33')][_0x9720('0x3b')]);_0x5a19c1['where']=qs[_0x9720('0x34')](_[_0x9720('0x3c')](_0x32585d[_0x9720('0x33')],_0x2364f3[_0x9720('0x34')]),_0x2e25ff);if(_0x32585d[_0x9720('0x33')][_0x9720('0x3d')]){_0x5a19c1[_0x9720('0x3e')]=_[_0x9720('0x3f')](_0x5a19c1[_0x9720('0x3e')],{'$or':_[_0x9720('0x31')](_0x2e25ff,function(_0x523535){if(_0x523535[_0x9720('0x2f')]!==_0x9720('0x40')){var _0x2aeddd={};_0x2aeddd[_0x523535[_0x9720('0x29')]]={'$like':'%'+_0x32585d[_0x9720('0x33')][_0x9720('0x3d')]+'%'};return _0x2aeddd;}})});}_0x5a19c1=_[_0x9720('0x3f')]({},_0x5a19c1,_0x32585d['options']);var _0x5d1df6={'where':_0x5a19c1['where']};return db['Trigger'][_0x9720('0x1b')](_0x5d1df6)[_0x9720('0x22')](function(_0x5d123b){_0x4bfa89[_0x9720('0x1b')]=_0x5d123b;if(_0x32585d[_0x9720('0x33')]['includeAll']){_0x5a19c1[_0x9720('0x41')]=[{'all':!![]}];}return db['Trigger'][_0x9720('0x42')](_0x5a19c1);})[_0x9720('0x22')](function(_0x8c88de){_0x4bfa89[_0x9720('0x43')]=_0x8c88de;return _0x4bfa89;})['then'](respondWithFilteredResult(_0x58206f,_0x5a19c1))['catch'](handleError(_0x58206f,null));};exports[_0x9720('0x44')]=function(_0x5a6532,_0x2a8b55){var _0x1d5201={'raw':![],'where':{'id':_0x5a6532['params']['id']}},_0x4c4c5d={};_0x4c4c5d[_0x9720('0x30')]=_['keys'](db[_0x9720('0x2c')][_0x9720('0x2d')]);_0x4c4c5d[_0x9720('0x33')]=_['keys'](_0x5a6532[_0x9720('0x33')]);_0x4c4c5d[_0x9720('0x34')]=_[_0x9720('0x35')](_0x4c4c5d[_0x9720('0x30')],_0x4c4c5d[_0x9720('0x33')]);_0x1d5201['attributes']=_[_0x9720('0x35')](_0x4c4c5d['model'],qs[_0x9720('0x36')](_0x5a6532['query']['fields']));_0x1d5201[_0x9720('0x37')]=_0x1d5201[_0x9720('0x37')]['length']?_0x1d5201['attributes']:_0x4c4c5d[_0x9720('0x30')];if(_0x5a6532[_0x9720('0x33')][_0x9720('0x45')]){_0x1d5201[_0x9720('0x41')]=[{'all':!![]}];}_0x1d5201=_[_0x9720('0x3f')]({},_0x1d5201,_0x5a6532[_0x9720('0x46')]);return db[_0x9720('0x2c')][_0x9720('0x47')](_0x1d5201)[_0x9720('0x22')](handleEntityNotFound(_0x2a8b55,null))[_0x9720('0x22')](respondWithResult(_0x2a8b55,null))[_0x9720('0x48')](handleError(_0x2a8b55,null));};exports[_0x9720('0x49')]=function(_0x7d7ca2,_0x311160){return db[_0x9720('0x2c')]['create'](_0x7d7ca2[_0x9720('0x4a')],{})['then'](function(_0x1b100f){var _0x556915=_0x7d7ca2[_0x9720('0x4b')][_0x9720('0x4c')]({'plain':!![]});if(!_0x556915)throw new Error(_0x9720('0x4d'));if(_0x556915[_0x9720('0x4e')]===_0x9720('0x4b')){var _0x3d7641=_0x1b100f[_0x9720('0x4c')]({'plain':!![]});var _0x2f8d58=_0x9720('0x24');return db[_0x9720('0x4f')]['find']({'where':{'name':_0x2f8d58,'userProfileId':_0x556915[_0x9720('0x50')]},'raw':!![]})[_0x9720('0x22')](function(_0x3b4e90){if(_0x3b4e90&&_0x3b4e90[_0x9720('0x51')]===0x0){return db[_0x9720('0x25')][_0x9720('0x49')]({'name':_0x3d7641[_0x9720('0x29')],'resourceId':_0x3d7641['id'],'type':_0x3b4e90['name'],'sectionId':_0x3b4e90['id']},{})[_0x9720('0x22')](function(){return _0x1b100f;});}else{return _0x1b100f;}})['catch'](function(_0x3f40a0){logger[_0x9720('0x27')](_0x9720('0x52'),_0x3f40a0);throw _0x3f40a0;});}return _0x1b100f;})[_0x9720('0x22')](respondWithResult(_0x311160,0xc9))[_0x9720('0x48')](handleError(_0x311160,null));};exports[_0x9720('0x21')]=function(_0x28f441,_0x126a30){if(_0x28f441[_0x9720('0x4a')]['id']){delete _0x28f441[_0x9720('0x4a')]['id'];}return db[_0x9720('0x2c')]['find']({'where':{'id':_0x28f441[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x126a30,null))[_0x9720('0x22')](saveUpdates(_0x28f441['body'],null))[_0x9720('0x22')](respondWithResult(_0x126a30,null))[_0x9720('0x48')](handleError(_0x126a30,null));};exports[_0x9720('0x23')]=function(_0x127109,_0x1a701d){return db[_0x9720('0x2c')]['find']({'where':{'id':_0x127109[_0x9720('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a701d,null))[_0x9720('0x22')](removeEntity(_0x1a701d,null))[_0x9720('0x48')](handleError(_0x1a701d,null));};exports['addAllCondition']=function(_0x1f3593,_0x356984,_0x4c447e){if(_0x1f3593[_0x9720('0x4a')]['id']){delete _0x1f3593[_0x9720('0x4a')]['id'];}return db[_0x9720('0x2c')][_0x9720('0x47')]({'where':{'id':_0x1f3593[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x356984,null))[_0x9720('0x22')](function(_0x2e8f7a){if(_0x2e8f7a){_0x1f3593['body'][_0x9720('0x54')]=_0x2e8f7a['id'];return db['Condition'][_0x9720('0x49')](_0x1f3593[_0x9720('0x4a')]);}})['then'](respondWithResult(_0x356984,null))['catch'](handleError(_0x356984,null));};exports[_0x9720('0x55')]=function(_0x2f5358,_0x179b28,_0x38d71c){if(_0x2f5358['body']['id']){delete _0x2f5358['body']['id'];}return db[_0x9720('0x2c')]['find']({'where':{'id':_0x2f5358[_0x9720('0x53')]['id']}})['then'](handleEntityNotFound(_0x179b28,null))[_0x9720('0x22')](function(_0x398ed6){if(_0x398ed6){_0x2f5358['body'][_0x9720('0x56')]=_0x398ed6['id'];return db[_0x9720('0x57')]['create'](_0x2f5358[_0x9720('0x4a')]);}})[_0x9720('0x22')](respondWithResult(_0x179b28,null))[_0x9720('0x48')](handleError(_0x179b28,null));};exports[_0x9720('0x58')]=function(_0x19276e,_0x1c5f32,_0x2ee4c4){var _0x5df369={};var _0x3f7dce={};var _0x2c4973;var _0x1ff066;return db[_0x9720('0x2c')][_0x9720('0x59')]({'where':{'id':_0x19276e[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x1c5f32,null))[_0x9720('0x22')](function(_0x52361d){if(_0x52361d){_0x2c4973=_0x52361d;_0x3f7dce[_0x9720('0x30')]=_[_0x9720('0x32')](db[_0x9720('0x57')][_0x9720('0x2d')]);_0x3f7dce[_0x9720('0x33')]=_[_0x9720('0x32')](_0x19276e['query']);_0x3f7dce[_0x9720('0x34')]=_['intersection'](_0x3f7dce[_0x9720('0x30')],_0x3f7dce['query']);_0x5df369[_0x9720('0x37')]=_[_0x9720('0x35')](_0x3f7dce[_0x9720('0x30')],qs[_0x9720('0x36')](_0x19276e[_0x9720('0x33')][_0x9720('0x36')]));_0x5df369[_0x9720('0x37')]=_0x5df369['attributes'][_0x9720('0x5a')]?_0x5df369[_0x9720('0x37')]:_0x3f7dce[_0x9720('0x30')];_0x5df369[_0x9720('0x3a')]=qs[_0x9720('0x3b')](_0x19276e[_0x9720('0x33')][_0x9720('0x3b')]);_0x5df369['where']=qs[_0x9720('0x34')](_[_0x9720('0x3c')](_0x19276e[_0x9720('0x33')],_0x3f7dce[_0x9720('0x34')]));if(_0x19276e['query']['filter']){_0x5df369[_0x9720('0x3e')]=_[_0x9720('0x3f')](_0x5df369[_0x9720('0x3e')],{'$or':_['map'](_0x5df369['attributes'],function(_0x393411){var _0x109e12={};_0x109e12[_0x393411]={'$like':'%'+_0x19276e[_0x9720('0x33')][_0x9720('0x3d')]+'%'};return _0x109e12;})});}_0x5df369=_[_0x9720('0x3f')]({},_0x5df369,_0x19276e[_0x9720('0x46')]);return _0x2c4973[_0x9720('0x58')](_0x5df369);}})[_0x9720('0x22')](function(_0x1265ad){if(_0x1265ad){_0x1ff066=_0x1265ad[_0x9720('0x5a')];if(!_0x19276e[_0x9720('0x33')]['hasOwnProperty']('nolimit')){_0x5df369[_0x9720('0x1c')]=qs['limit'](_0x19276e[_0x9720('0x33')][_0x9720('0x1c')]);_0x5df369[_0x9720('0x19')]=qs[_0x9720('0x19')](_0x19276e[_0x9720('0x33')][_0x9720('0x19')]);}return _0x2c4973[_0x9720('0x58')](_0x5df369);}})[_0x9720('0x22')](function(_0x26a278){if(_0x26a278){return _0x26a278?{'count':_0x1ff066,'rows':_0x26a278}:null;}})[_0x9720('0x22')](respondWithResult(_0x1c5f32,null))[_0x9720('0x48')](handleError(_0x1c5f32,null));};exports['getAnyConditions']=function(_0x18675f,_0x2dcecd,_0xfc7900){var _0x56f680={};var _0x185a43={};var _0x213af0;var _0x2cb29e;return db[_0x9720('0x2c')][_0x9720('0x59')]({'where':{'id':_0x18675f[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x2dcecd,null))['then'](function(_0x3366c3){if(_0x3366c3){_0x213af0=_0x3366c3;_0x185a43[_0x9720('0x30')]=_[_0x9720('0x32')](db[_0x9720('0x57')][_0x9720('0x2d')]);_0x185a43[_0x9720('0x33')]=_[_0x9720('0x32')](_0x18675f[_0x9720('0x33')]);_0x185a43['filters']=_[_0x9720('0x35')](_0x185a43['model'],_0x185a43[_0x9720('0x33')]);_0x56f680[_0x9720('0x37')]=_[_0x9720('0x35')](_0x185a43[_0x9720('0x30')],qs[_0x9720('0x36')](_0x18675f['query'][_0x9720('0x36')]));_0x56f680[_0x9720('0x37')]=_0x56f680[_0x9720('0x37')][_0x9720('0x5a')]?_0x56f680[_0x9720('0x37')]:_0x185a43[_0x9720('0x30')];_0x56f680[_0x9720('0x3a')]=qs[_0x9720('0x3b')](_0x18675f[_0x9720('0x33')][_0x9720('0x3b')]);_0x56f680[_0x9720('0x3e')]=qs['filters'](_[_0x9720('0x3c')](_0x18675f['query'],_0x185a43[_0x9720('0x34')]));if(_0x18675f[_0x9720('0x33')][_0x9720('0x3d')]){_0x56f680['where']=_[_0x9720('0x3f')](_0x56f680[_0x9720('0x3e')],{'$or':_['map'](_0x56f680['attributes'],function(_0x1126c5){var _0x331b3f={};_0x331b3f[_0x1126c5]={'$like':'%'+_0x18675f[_0x9720('0x33')][_0x9720('0x3d')]+'%'};return _0x331b3f;})});}_0x56f680=_[_0x9720('0x3f')]({},_0x56f680,_0x18675f['options']);return _0x213af0['getAnyConditions'](_0x56f680);}})[_0x9720('0x22')](function(_0x940e77){if(_0x940e77){_0x2cb29e=_0x940e77[_0x9720('0x5a')];if(!_0x18675f[_0x9720('0x33')][_0x9720('0x38')](_0x9720('0x39'))){_0x56f680[_0x9720('0x1c')]=qs[_0x9720('0x1c')](_0x18675f[_0x9720('0x33')]['limit']);_0x56f680[_0x9720('0x19')]=qs['offset'](_0x18675f[_0x9720('0x33')][_0x9720('0x19')]);}return _0x213af0[_0x9720('0x5b')](_0x56f680);}})[_0x9720('0x22')](function(_0x245085){if(_0x245085){return _0x245085?{'count':_0x2cb29e,'rows':_0x245085}:null;}})['then'](respondWithResult(_0x2dcecd,null))[_0x9720('0x48')](handleError(_0x2dcecd,null));};exports[_0x9720('0x5c')]=function(_0x3568c4,_0x80f9e0,_0x46caac){if(_0x3568c4[_0x9720('0x4a')]['id']){delete _0x3568c4[_0x9720('0x4a')]['id'];}return db[_0x9720('0x2c')][_0x9720('0x47')]({'where':{'id':_0x3568c4[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x80f9e0,null))['then'](function(_0x39334e){if(_0x39334e){_0x3568c4[_0x9720('0x4a')]['TriggerId']=_0x39334e['id'];return db['Action'][_0x9720('0x49')](_0x3568c4[_0x9720('0x4a')]);}})[_0x9720('0x22')](respondWithResult(_0x80f9e0,null))[_0x9720('0x48')](handleError(_0x80f9e0,null));};exports[_0x9720('0x5d')]=function(_0x2ba133,_0x2fd757,_0x80b053){var _0x54b1c5={};var _0x14f38e={};var _0x158f1e;var _0x7e9385;return db[_0x9720('0x2c')]['findOne']({'where':{'id':_0x2ba133[_0x9720('0x53')]['id']}})[_0x9720('0x22')](handleEntityNotFound(_0x2fd757,null))['then'](function(_0x15c956){if(_0x15c956){_0x158f1e=_0x15c956;_0x14f38e['model']=_[_0x9720('0x32')](db[_0x9720('0x5e')]['rawAttributes']);_0x14f38e[_0x9720('0x33')]=_[_0x9720('0x32')](_0x2ba133[_0x9720('0x33')]);_0x14f38e['filters']=_[_0x9720('0x35')](_0x14f38e[_0x9720('0x30')],_0x14f38e[_0x9720('0x33')]);_0x54b1c5['attributes']=_[_0x9720('0x35')](_0x14f38e[_0x9720('0x30')],qs[_0x9720('0x36')](_0x2ba133[_0x9720('0x33')][_0x9720('0x36')]));_0x54b1c5['attributes']=_0x54b1c5[_0x9720('0x37')][_0x9720('0x5a')]?_0x54b1c5[_0x9720('0x37')]:_0x14f38e[_0x9720('0x30')];_0x54b1c5[_0x9720('0x3a')]=qs[_0x9720('0x3b')](_0x2ba133['query']['sort']);_0x54b1c5[_0x9720('0x3e')]=qs[_0x9720('0x34')](_['pick'](_0x2ba133['query'],_0x14f38e[_0x9720('0x34')]));if(_0x2ba133[_0x9720('0x33')][_0x9720('0x3d')]){_0x54b1c5[_0x9720('0x3e')]=_[_0x9720('0x3f')](_0x54b1c5[_0x9720('0x3e')],{'$or':_[_0x9720('0x31')](_0x54b1c5[_0x9720('0x37')],function(_0x38c03c){var _0x347a95={};_0x347a95[_0x38c03c]={'$like':'%'+_0x2ba133[_0x9720('0x33')][_0x9720('0x3d')]+'%'};return _0x347a95;})});}_0x54b1c5=_[_0x9720('0x3f')]({},_0x54b1c5,_0x2ba133[_0x9720('0x46')]);return _0x158f1e[_0x9720('0x5d')](_0x54b1c5);}})[_0x9720('0x22')](function(_0x393eaf){if(_0x393eaf){_0x7e9385=_0x393eaf[_0x9720('0x5a')];if(!_0x2ba133[_0x9720('0x33')][_0x9720('0x38')](_0x9720('0x39'))){_0x54b1c5[_0x9720('0x1c')]=qs['limit'](_0x2ba133[_0x9720('0x33')][_0x9720('0x1c')]);_0x54b1c5[_0x9720('0x19')]=qs[_0x9720('0x19')](_0x2ba133[_0x9720('0x33')][_0x9720('0x19')]);}return _0x158f1e[_0x9720('0x5d')](_0x54b1c5);}})[_0x9720('0x22')](function(_0x1307ef){if(_0x1307ef){return _0x1307ef?{'count':_0x7e9385,'rows':_0x1307ef}:null;}})[_0x9720('0x22')](respondWithResult(_0x2fd757,null))[_0x9720('0x48')](handleError(_0x2fd757,null));}; \ No newline at end of file +var _0xd53d=['body','user','role','Triggers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','order','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','type','VIRTUAL','filter','merge','options','Trigger','count','includeAll','include','rows','catch','show','params','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd53d,0xd2));var _0xdd53=function(_0x111c83,_0x279c44){_0x111c83=_0x111c83-0x0;var _0x4a5c7d=_0xd53d[_0x111c83];return _0x4a5c7d;};'use strict';var emlformat=require(_0xdd53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd53('0x1'));var jsonpatch=require(_0xdd53('0x2'));var rp=require(_0xdd53('0x3'));var moment=require(_0xdd53('0x4'));var BPromise=require(_0xdd53('0x5'));var Mustache=require(_0xdd53('0x6'));var util=require(_0xdd53('0x7'));var path=require(_0xdd53('0x8'));var sox=require(_0xdd53('0x9'));var csv=require(_0xdd53('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd53('0xb'));var _=require(_0xdd53('0xc'));var squel=require(_0xdd53('0xd'));var crypto=require(_0xdd53('0xe'));var jsforce=require(_0xdd53('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdd53('0xa'));var querystring=require(_0xdd53('0x10'));var Papa=require('papaparse');var Redis=require(_0xdd53('0x11'));var authService=require(_0xdd53('0x12'));var qs=require(_0xdd53('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd53('0x14'))('api');var utils=require(_0xdd53('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6526,_0x49f20d){_0x49f20d=_0x49f20d||0xcc;return function(_0xf5ecd7){if(_0xf5ecd7){return _0x4f6526[_0xdd53('0x16')](_0x49f20d);}return _0x4f6526[_0xdd53('0x17')](_0x49f20d)[_0xdd53('0x18')]();};}function respondWithResult(_0x2f70ce,_0x4a5c55){_0x4a5c55=_0x4a5c55||0xc8;return function(_0x540051){if(_0x540051){return _0x2f70ce['status'](_0x4a5c55)[_0xdd53('0x19')](_0x540051);}};}function respondWithFilteredResult(_0x448d5d,_0x257535){return function(_0x2d90dd){if(_0x2d90dd){var _0x234642=typeof _0x257535['offset']===_0xdd53('0x1a')&&typeof _0x257535['limit']===_0xdd53('0x1a');var _0xc4bcac=_0x2d90dd['count'];var _0xee86d8=_0x234642?0x0:_0x257535[_0xdd53('0x1b')];var _0x2cfa36=_0x234642?_0x2d90dd['count']:_0x257535[_0xdd53('0x1b')]+_0x257535['limit'];var _0x4e9a1c;if(_0x2cfa36>=_0xc4bcac){_0x2cfa36=_0xc4bcac;_0x4e9a1c=0xc8;}else{_0x4e9a1c=0xce;}_0x448d5d[_0xdd53('0x17')](_0x4e9a1c);return _0x448d5d[_0xdd53('0x1c')](_0xdd53('0x1d'),_0xee86d8+'-'+_0x2cfa36+'/'+_0xc4bcac)['json'](_0x2d90dd);}return null;};}function patchUpdates(_0x192698){return function(_0x25da0f){try{jsonpatch[_0xdd53('0x1e')](_0x25da0f,_0x192698,!![]);}catch(_0x5b9f95){return BPromise[_0xdd53('0x1f')](_0x5b9f95);}return _0x25da0f[_0xdd53('0x20')]();};}function saveUpdates(_0xa843cb,_0x454818){return function(_0x25019c){if(_0x25019c){return _0x25019c[_0xdd53('0x21')](_0xa843cb)[_0xdd53('0x22')](function(_0x5b3f3d){return _0x5b3f3d;});}return null;};}function removeEntity(_0x48d95c,_0x3f9115){return function(_0x310175){if(_0x310175){return _0x310175[_0xdd53('0x23')]()[_0xdd53('0x22')](function(){var _0xcbaf7c=_0x310175[_0xdd53('0x24')]({'plain':!![]});var _0x330a5b='Triggers';return db['UserProfileResource'][_0xdd53('0x23')]({'where':{'type':_0x330a5b,'resourceId':_0xcbaf7c['id']}})[_0xdd53('0x22')](function(){return _0x310175;});})[_0xdd53('0x22')](function(){_0x48d95c[_0xdd53('0x17')](0xcc)[_0xdd53('0x18')]();});}};}function handleEntityNotFound(_0x29405d,_0x2b77f4){return function(_0x3fac43){if(!_0x3fac43){_0x29405d[_0xdd53('0x16')](0x194);}return _0x3fac43;};}function handleError(_0x4ebdb2,_0x54223d){_0x54223d=_0x54223d||0x1f4;return function(_0x1e7f97){logger[_0xdd53('0x25')](_0x1e7f97[_0xdd53('0x26')]);if(_0x1e7f97[_0xdd53('0x27')]){delete _0x1e7f97[_0xdd53('0x27')];}_0x4ebdb2[_0xdd53('0x17')](_0x54223d)[_0xdd53('0x28')](_0x1e7f97);};}exports[_0xdd53('0x29')]=function(_0x299ebc,_0xae3b7){var _0x420638={},_0x231540={},_0x420c5c={'count':0x0,'rows':[]};var _0x2ac553=_['map'](db['Trigger'][_0xdd53('0x2a')],function(_0x4dcbac){return{'name':_0x4dcbac[_0xdd53('0x2b')],'type':_0x4dcbac['type'][_0xdd53('0x2c')]};});_0x231540[_0xdd53('0x2d')]=_[_0xdd53('0x2e')](_0x2ac553,_0xdd53('0x27'));_0x231540[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x299ebc[_0xdd53('0x2f')]);_0x231540[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x231540['model'],_0x231540['query']);_0x420638[_0xdd53('0x33')]=_['intersection'](_0x231540[_0xdd53('0x2d')],qs[_0xdd53('0x34')](_0x299ebc[_0xdd53('0x2f')]['fields']));_0x420638['attributes']=_0x420638[_0xdd53('0x33')][_0xdd53('0x35')]?_0x420638['attributes']:_0x231540[_0xdd53('0x2d')];if(!_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x36')](_0xdd53('0x37'))){_0x420638[_0xdd53('0x38')]=qs['limit'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x420638[_0xdd53('0x1b')]=qs['offset'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x1b')]);}_0x420638['order']=qs['sort'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x420638[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_[_0xdd53('0x3b')](_0x299ebc['query'],_0x231540[_0xdd53('0x31')]),_0x2ac553);if(_0x299ebc['query']['filter']){_0x420638[_0xdd53('0x3a')]=_['merge'](_0x420638[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x2ac553,function(_0x18061a){if(_0x18061a[_0xdd53('0x3c')]!==_0xdd53('0x3d')){var _0x2c0b23={};_0x2c0b23[_0x18061a[_0xdd53('0x27')]]={'$like':'%'+_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x3e')]+'%'};return _0x2c0b23;}})});}_0x420638=_[_0xdd53('0x3f')]({},_0x420638,_0x299ebc[_0xdd53('0x40')]);var _0x2c37cb={'where':_0x420638[_0xdd53('0x3a')]};return db[_0xdd53('0x41')][_0xdd53('0x42')](_0x2c37cb)[_0xdd53('0x22')](function(_0x4b7c58){_0x420c5c[_0xdd53('0x42')]=_0x4b7c58;if(_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x43')]){_0x420638[_0xdd53('0x44')]=[{'all':!![]}];}return db[_0xdd53('0x41')]['findAll'](_0x420638);})[_0xdd53('0x22')](function(_0x1c3556){_0x420c5c[_0xdd53('0x45')]=_0x1c3556;return _0x420c5c;})[_0xdd53('0x22')](respondWithFilteredResult(_0xae3b7,_0x420638))[_0xdd53('0x46')](handleError(_0xae3b7,null));};exports[_0xdd53('0x47')]=function(_0x515af9,_0xd01183){var _0x2f8b10={'raw':![],'where':{'id':_0x515af9[_0xdd53('0x48')]['id']}},_0x4ce1ed={};_0x4ce1ed['model']=_['keys'](db[_0xdd53('0x41')][_0xdd53('0x2a')]);_0x4ce1ed['query']=_[_0xdd53('0x30')](_0x515af9[_0xdd53('0x2f')]);_0x4ce1ed['filters']=_[_0xdd53('0x32')](_0x4ce1ed['model'],_0x4ce1ed[_0xdd53('0x2f')]);_0x2f8b10[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x4ce1ed['model'],qs[_0xdd53('0x34')](_0x515af9[_0xdd53('0x2f')]['fields']));_0x2f8b10[_0xdd53('0x33')]=_0x2f8b10[_0xdd53('0x33')][_0xdd53('0x35')]?_0x2f8b10[_0xdd53('0x33')]:_0x4ce1ed[_0xdd53('0x2d')];if(_0x515af9[_0xdd53('0x2f')]['includeAll']){_0x2f8b10[_0xdd53('0x44')]=[{'all':!![]}];}_0x2f8b10=_[_0xdd53('0x3f')]({},_0x2f8b10,_0x515af9[_0xdd53('0x40')]);return db[_0xdd53('0x41')][_0xdd53('0x49')](_0x2f8b10)[_0xdd53('0x22')](handleEntityNotFound(_0xd01183,null))['then'](respondWithResult(_0xd01183,null))[_0xdd53('0x46')](handleError(_0xd01183,null));};exports[_0xdd53('0x4a')]=function(_0x3de265,_0x1ea3ff){return db[_0xdd53('0x41')][_0xdd53('0x4a')](_0x3de265[_0xdd53('0x4b')],{})[_0xdd53('0x22')](function(_0x2e0b0d){var _0x86cb48=_0x3de265[_0xdd53('0x4c')][_0xdd53('0x24')]({'plain':!![]});if(!_0x86cb48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x86cb48[_0xdd53('0x4d')]===_0xdd53('0x4c')){var _0x1a1c56=_0x2e0b0d[_0xdd53('0x24')]({'plain':!![]});var _0x378eb7=_0xdd53('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x378eb7,'userProfileId':_0x86cb48[_0xdd53('0x4f')]},'raw':!![]})[_0xdd53('0x22')](function(_0x498eab){if(_0x498eab&&_0x498eab[_0xdd53('0x50')]===0x0){return db[_0xdd53('0x51')][_0xdd53('0x4a')]({'name':_0x1a1c56[_0xdd53('0x27')],'resourceId':_0x1a1c56['id'],'type':_0x498eab[_0xdd53('0x27')],'sectionId':_0x498eab['id']},{})[_0xdd53('0x22')](function(){return _0x2e0b0d;});}else{return _0x2e0b0d;}})[_0xdd53('0x46')](function(_0x82569){logger[_0xdd53('0x25')](_0xdd53('0x52'),_0x82569);throw _0x82569;});}return _0x2e0b0d;})[_0xdd53('0x22')](respondWithResult(_0x1ea3ff,0xc9))[_0xdd53('0x46')](handleError(_0x1ea3ff,null));};exports['update']=function(_0x19a881,_0x24e663){if(_0x19a881[_0xdd53('0x4b')]['id']){delete _0x19a881[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')]['find']({'where':{'id':_0x19a881[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x24e663,null))[_0xdd53('0x22')](saveUpdates(_0x19a881['body'],null))[_0xdd53('0x22')](respondWithResult(_0x24e663,null))[_0xdd53('0x46')](handleError(_0x24e663,null));};exports[_0xdd53('0x23')]=function(_0x22dd9d,_0x3556f0){return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x22dd9d[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x3556f0,null))['then'](removeEntity(_0x3556f0,null))[_0xdd53('0x46')](handleError(_0x3556f0,null));};exports[_0xdd53('0x53')]=function(_0x4f6909,_0x14c1d6,_0x41f99c){if(_0x4f6909[_0xdd53('0x4b')]['id']){delete _0x4f6909[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x4f6909[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x14c1d6,null))[_0xdd53('0x22')](function(_0x461271){if(_0x461271){_0x4f6909[_0xdd53('0x4b')]['TriggerAllId']=_0x461271['id'];return db['Condition']['create'](_0x4f6909['body']);}})[_0xdd53('0x22')](respondWithResult(_0x14c1d6,null))[_0xdd53('0x46')](handleError(_0x14c1d6,null));};exports[_0xdd53('0x54')]=function(_0x1815fd,_0x1c12c8,_0x2c02c5){if(_0x1815fd[_0xdd53('0x4b')]['id']){delete _0x1815fd[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x1815fd[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x1c12c8,null))['then'](function(_0x503df8){if(_0x503df8){_0x1815fd[_0xdd53('0x4b')][_0xdd53('0x55')]=_0x503df8['id'];return db[_0xdd53('0x56')][_0xdd53('0x4a')](_0x1815fd[_0xdd53('0x4b')]);}})[_0xdd53('0x22')](respondWithResult(_0x1c12c8,null))[_0xdd53('0x46')](handleError(_0x1c12c8,null));};exports[_0xdd53('0x57')]=function(_0x434f3b,_0x47e7c2,_0x5962f5){var _0x1dcc5e={};var _0x5887a2={};var _0xde6ecd;var _0x1336d3;return db['Trigger']['findOne']({'where':{'id':_0x434f3b[_0xdd53('0x48')]['id']}})['then'](handleEntityNotFound(_0x47e7c2,null))[_0xdd53('0x22')](function(_0x1d3820){if(_0x1d3820){_0xde6ecd=_0x1d3820;_0x5887a2[_0xdd53('0x2d')]=_[_0xdd53('0x30')](db[_0xdd53('0x56')][_0xdd53('0x2a')]);_0x5887a2[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x434f3b['query']);_0x5887a2[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x5887a2[_0xdd53('0x2d')],_0x5887a2[_0xdd53('0x2f')]);_0x1dcc5e[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x5887a2[_0xdd53('0x2d')],qs[_0xdd53('0x34')](_0x434f3b[_0xdd53('0x2f')]['fields']));_0x1dcc5e['attributes']=_0x1dcc5e[_0xdd53('0x33')]['length']?_0x1dcc5e[_0xdd53('0x33')]:_0x5887a2[_0xdd53('0x2d')];_0x1dcc5e[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x1dcc5e[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_[_0xdd53('0x3b')](_0x434f3b[_0xdd53('0x2f')],_0x5887a2[_0xdd53('0x31')]));if(_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x3e')]){_0x1dcc5e[_0xdd53('0x3a')]=_[_0xdd53('0x3f')](_0x1dcc5e[_0xdd53('0x3a')],{'$or':_['map'](_0x1dcc5e[_0xdd53('0x33')],function(_0x2673f8){var _0x9ce47a={};_0x9ce47a[_0x2673f8]={'$like':'%'+_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x3e')]+'%'};return _0x9ce47a;})});}_0x1dcc5e=_[_0xdd53('0x3f')]({},_0x1dcc5e,_0x434f3b[_0xdd53('0x40')]);return _0xde6ecd['getAllConditions'](_0x1dcc5e);}})[_0xdd53('0x22')](function(_0x26aa3d){if(_0x26aa3d){_0x1336d3=_0x26aa3d[_0xdd53('0x35')];if(!_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x36')](_0xdd53('0x37'))){_0x1dcc5e[_0xdd53('0x38')]=qs[_0xdd53('0x38')](_0x434f3b[_0xdd53('0x2f')]['limit']);_0x1dcc5e[_0xdd53('0x1b')]=qs[_0xdd53('0x1b')](_0x434f3b[_0xdd53('0x2f')]['offset']);}return _0xde6ecd[_0xdd53('0x57')](_0x1dcc5e);}})[_0xdd53('0x22')](function(_0x305426){if(_0x305426){return _0x305426?{'count':_0x1336d3,'rows':_0x305426}:null;}})['then'](respondWithResult(_0x47e7c2,null))['catch'](handleError(_0x47e7c2,null));};exports[_0xdd53('0x59')]=function(_0x22e13d,_0x521be1,_0x5714cb){var _0x2c5904={};var _0x270cca={};var _0x47883f;var _0x254c3a;return db[_0xdd53('0x41')][_0xdd53('0x5a')]({'where':{'id':_0x22e13d[_0xdd53('0x48')]['id']}})['then'](handleEntityNotFound(_0x521be1,null))['then'](function(_0x100d0c){if(_0x100d0c){_0x47883f=_0x100d0c;_0x270cca['model']=_[_0xdd53('0x30')](db[_0xdd53('0x56')][_0xdd53('0x2a')]);_0x270cca[_0xdd53('0x2f')]=_['keys'](_0x22e13d[_0xdd53('0x2f')]);_0x270cca[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x270cca[_0xdd53('0x2d')],_0x270cca[_0xdd53('0x2f')]);_0x2c5904[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x270cca['model'],qs['fields'](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x34')]));_0x2c5904[_0xdd53('0x33')]=_0x2c5904[_0xdd53('0x33')][_0xdd53('0x35')]?_0x2c5904[_0xdd53('0x33')]:_0x270cca[_0xdd53('0x2d')];_0x2c5904[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x22e13d['query'][_0xdd53('0x39')]);_0x2c5904[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_['pick'](_0x22e13d[_0xdd53('0x2f')],_0x270cca[_0xdd53('0x31')]));if(_0x22e13d[_0xdd53('0x2f')]['filter']){_0x2c5904[_0xdd53('0x3a')]=_[_0xdd53('0x3f')](_0x2c5904[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x2c5904['attributes'],function(_0x195e6a){var _0x1df4ab={};_0x1df4ab[_0x195e6a]={'$like':'%'+_0x22e13d[_0xdd53('0x2f')]['filter']+'%'};return _0x1df4ab;})});}_0x2c5904=_[_0xdd53('0x3f')]({},_0x2c5904,_0x22e13d['options']);return _0x47883f[_0xdd53('0x59')](_0x2c5904);}})[_0xdd53('0x22')](function(_0x2c92ad){if(_0x2c92ad){_0x254c3a=_0x2c92ad[_0xdd53('0x35')];if(!_0x22e13d['query'][_0xdd53('0x36')]('nolimit')){_0x2c5904[_0xdd53('0x38')]=qs['limit'](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x2c5904[_0xdd53('0x1b')]=qs[_0xdd53('0x1b')](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x1b')]);}return _0x47883f['getAnyConditions'](_0x2c5904);}})[_0xdd53('0x22')](function(_0x531b53){if(_0x531b53){return _0x531b53?{'count':_0x254c3a,'rows':_0x531b53}:null;}})[_0xdd53('0x22')](respondWithResult(_0x521be1,null))[_0xdd53('0x46')](handleError(_0x521be1,null));};exports[_0xdd53('0x5b')]=function(_0x384eff,_0x1a4533,_0xd737e7){if(_0x384eff[_0xdd53('0x4b')]['id']){delete _0x384eff[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')]['find']({'where':{'id':_0x384eff['params']['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x1a4533,null))['then'](function(_0x219722){if(_0x219722){_0x384eff[_0xdd53('0x4b')][_0xdd53('0x5c')]=_0x219722['id'];return db[_0xdd53('0x5d')][_0xdd53('0x4a')](_0x384eff[_0xdd53('0x4b')]);}})['then'](respondWithResult(_0x1a4533,null))['catch'](handleError(_0x1a4533,null));};exports[_0xdd53('0x5e')]=function(_0x399d32,_0x754085,_0x56081f){var _0x524030={};var _0x199a96={};var _0x5d0b72;var _0x3c57d7;return db[_0xdd53('0x41')]['findOne']({'where':{'id':_0x399d32[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x754085,null))['then'](function(_0x237384){if(_0x237384){_0x5d0b72=_0x237384;_0x199a96['model']=_['keys'](db['Action'][_0xdd53('0x2a')]);_0x199a96[_0xdd53('0x2f')]=_['keys'](_0x399d32[_0xdd53('0x2f')]);_0x199a96[_0xdd53('0x31')]=_['intersection'](_0x199a96['model'],_0x199a96['query']);_0x524030[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x199a96[_0xdd53('0x2d')],qs['fields'](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x34')]));_0x524030['attributes']=_0x524030[_0xdd53('0x33')][_0xdd53('0x35')]?_0x524030[_0xdd53('0x33')]:_0x199a96['model'];_0x524030[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x524030[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_['pick'](_0x399d32['query'],_0x199a96['filters']));if(_0x399d32[_0xdd53('0x2f')]['filter']){_0x524030['where']=_[_0xdd53('0x3f')](_0x524030[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x524030['attributes'],function(_0x4d3b84){var _0x396d7b={};_0x396d7b[_0x4d3b84]={'$like':'%'+_0x399d32['query'][_0xdd53('0x3e')]+'%'};return _0x396d7b;})});}_0x524030=_[_0xdd53('0x3f')]({},_0x524030,_0x399d32[_0xdd53('0x40')]);return _0x5d0b72[_0xdd53('0x5e')](_0x524030);}})[_0xdd53('0x22')](function(_0x3b1894){if(_0x3b1894){_0x3c57d7=_0x3b1894[_0xdd53('0x35')];if(!_0x399d32['query'][_0xdd53('0x36')](_0xdd53('0x37'))){_0x524030[_0xdd53('0x38')]=qs[_0xdd53('0x38')](_0x399d32['query'][_0xdd53('0x38')]);_0x524030['offset']=qs[_0xdd53('0x1b')](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x1b')]);}return _0x5d0b72[_0xdd53('0x5e')](_0x524030);}})['then'](function(_0x5a2fb7){if(_0x5a2fb7){return _0x5a2fb7?{'count':_0x3c57d7,'rows':_0x5a2fb7}:null;}})[_0xdd53('0x22')](respondWithResult(_0x754085,null))[_0xdd53('0x46')](handleError(_0x754085,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f07abd5..7792129 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 _0xe9e8=['rimraf','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x203f28,_0x96efa1){var _0x14fa4b=function(_0x158738){while(--_0x158738){_0x203f28['push'](_0x203f28['shift']());}};_0x14fa4b(++_0x96efa1);}(_0xe9e8,0x179));var _0x8e9e=function(_0x2bba4d,_0x14dfe2){_0x2bba4d=_0x2bba4d-0x0;var _0xc2fcc6=_0xe9e8[_0x2bba4d];return _0xc2fcc6;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x3b5e8d,_0x5de00e){return _0x3b5e8d['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74a=['path','rimraf','../../config/environment','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5179d3,_0x6e0e2){var _0x3401a4=function(_0x5ba281){while(--_0x5ba281){_0x5179d3['push'](_0x5179d3['shift']());}};_0x3401a4(++_0x6e0e2);}(_0xa74a,0x66));var _0xaa74=function(_0x2f6e43,_0x1f9724){_0x2f6e43=_0x2f6e43-0x0;var _0x4baf0d=_0xa74a[_0x2f6e43];return _0x4baf0d;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var logger=require(_0xaa74('0x2'))(_0xaa74('0x3'));var moment=require(_0xaa74('0x4'));var BPromise=require(_0xaa74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa74('0x6'));var rimraf=require(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var attributes=require('./trigger.attributes');module['exports']=function(_0x24eee1,_0x44250c){return _0x24eee1[_0xaa74('0x9')](_0xaa74('0xa'),attributes,{'tableName':_0xaa74('0xb'),'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 dc3ea77..0b88575 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 _0x5551=['where','attributes','limit','include','map','model','ShowTrigger','Trigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','findAll','options','raw'];(function(_0x1632ee,_0x11afd0){var _0x430f9c=function(_0xbaf4e2){while(--_0xbaf4e2){_0x1632ee['push'](_0x1632ee['shift']());}};_0x430f9c(++_0x11afd0);}(_0x5551,0x1ab));var _0x1555=function(_0x32a3a3,_0x2c2b98){_0x32a3a3=_0x32a3a3-0x0;var _0x4636f4=_0x5551[_0x32a3a3];return _0x4636f4;};'use strict';var _=require(_0x1555('0x0'));var util=require(_0x1555('0x1'));var moment=require(_0x1555('0x2'));var BPromise=require(_0x1555('0x3'));var rs=require(_0x1555('0x4'));var fs=require('fs');var Redis=require(_0x1555('0x5'));var db=require(_0x1555('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1555('0x7'))(_0x1555('0x8'));var config=require(_0x1555('0x9'));var jayson=require(_0x1555('0xa'));var client=jayson[_0x1555('0xb')][_0x1555('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e7e7b,_0x5d78f0,_0x25c458){return new BPromise(function(_0x2304ab,_0x8e2817){return client[_0x1555('0xd')](_0x4e7e7b,_0x25c458)[_0x1555('0xe')](function(_0x2630a1){logger[_0x1555('0xf')](_0x1555('0x10'),_0x5d78f0,_0x1555('0x11'));logger[_0x1555('0x12')](_0x1555('0x13'),_0x5d78f0,'request\x20sent',JSON[_0x1555('0x14')](_0x2630a1));if(_0x2630a1[_0x1555('0x15')]){if(_0x2630a1[_0x1555('0x15')]['code']===0x1f4){logger[_0x1555('0x15')]('Trigger,\x20%s,\x20%s',_0x5d78f0,_0x2630a1[_0x1555('0x15')][_0x1555('0x16')]);return _0x8e2817(_0x2630a1['error'][_0x1555('0x16')]);}logger[_0x1555('0x15')]('Trigger,\x20%s,\x20%s',_0x5d78f0,_0x2630a1[_0x1555('0x15')][_0x1555('0x16')]);return _0x2304ab(_0x2630a1['error'][_0x1555('0x16')]);}else{logger['info'](_0x1555('0x10'),_0x5d78f0,_0x1555('0x11'));_0x2304ab(_0x2630a1[_0x1555('0x17')][_0x1555('0x16')]);}})[_0x1555('0x18')](function(_0x593bbf){logger[_0x1555('0x15')]('Trigger,\x20%s,\x20%s',_0x5d78f0,_0x593bbf);_0x8e2817(_0x593bbf);});});}exports[_0x1555('0x19')]=function(_0x331abd){var _0x412fe6=this;return new Promise(function(_0x272e44,_0x59c48e){return db['Trigger'][_0x1555('0x1a')]({'raw':_0x331abd[_0x1555('0x1b')]?_0x331abd[_0x1555('0x1b')][_0x1555('0x1c')]===undefined?!![]:![]:!![],'where':_0x331abd['options']?_0x331abd[_0x1555('0x1b')][_0x1555('0x1d')]||null:null,'attributes':_0x331abd[_0x1555('0x1b')]?_0x331abd['options'][_0x1555('0x1e')]||null:null,'limit':_0x331abd[_0x1555('0x1b')]?_0x331abd[_0x1555('0x1b')][_0x1555('0x1f')]||null:null,'include':_0x331abd[_0x1555('0x1b')]?_0x331abd[_0x1555('0x1b')][_0x1555('0x20')]?_[_0x1555('0x21')](_0x331abd['options'][_0x1555('0x20')],function(_0x1e28e7){return{'model':db[_0x1e28e7[_0x1555('0x22')]],'as':_0x1e28e7['as'],'attributes':_0x1e28e7[_0x1555('0x1e')],'include':_0x1e28e7[_0x1555('0x20')]?_[_0x1555('0x21')](_0x1e28e7['include'],function(_0xc33426){return{'model':db[_0xc33426[_0x1555('0x22')]],'as':_0xc33426['as'],'attributes':_0xc33426[_0x1555('0x1e')],'include':_0xc33426[_0x1555('0x20')]?_['map'](_0xc33426['include'],function(_0x4400d9){return{'model':db[_0x4400d9[_0x1555('0x22')]],'as':_0x4400d9['as'],'attributes':_0x4400d9[_0x1555('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1555('0xe')](function(_0x2d4e33){logger[_0x1555('0xf')](_0x1555('0x19'),_0x331abd);logger[_0x1555('0x12')](_0x1555('0x19'),_0x331abd,JSON['stringify'](_0x2d4e33));_0x272e44(_0x2d4e33);})[_0x1555('0x18')](function(_0x256714){logger['error'](_0x1555('0x19'),_0x256714['message'],_0x331abd);_0x59c48e(_0x412fe6[_0x1555('0x15')](0x1f4,_0x256714[_0x1555('0x16')]));});});};exports[_0x1555('0x23')]=function(_0x4a6bef){var _0x35d626=this;return new Promise(function(_0x530ac4,_0x36c402){return db[_0x1555('0x24')][_0x1555('0x25')]({'raw':_0x4a6bef[_0x1555('0x1b')]?_0x4a6bef[_0x1555('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4a6bef[_0x1555('0x1b')]?_0x4a6bef[_0x1555('0x1b')][_0x1555('0x1d')]||null:null,'attributes':_0x4a6bef[_0x1555('0x1b')]?_0x4a6bef[_0x1555('0x1b')]['attributes']||null:null,'include':_0x4a6bef[_0x1555('0x1b')]?_0x4a6bef[_0x1555('0x1b')][_0x1555('0x20')]?_[_0x1555('0x21')](_0x4a6bef[_0x1555('0x1b')][_0x1555('0x20')],function(_0x1e5094){return{'model':db[_0x1e5094[_0x1555('0x22')]],'as':_0x1e5094['as'],'attributes':_0x1e5094['attributes'],'include':_0x1e5094[_0x1555('0x20')]?_[_0x1555('0x21')](_0x1e5094[_0x1555('0x20')],function(_0x1190c4){return{'model':db[_0x1190c4['model']],'as':_0x1190c4['as'],'attributes':_0x1190c4[_0x1555('0x1e')],'include':_0x1190c4['include']?_[_0x1555('0x21')](_0x1190c4['include'],function(_0x352256){return{'model':db[_0x352256[_0x1555('0x22')]],'as':_0x352256['as'],'attributes':_0x352256['attributes']};}):[]};}):[]};}):[]:[]})[_0x1555('0xe')](function(_0x4e74a1){logger[_0x1555('0xf')](_0x1555('0x23'),_0x4a6bef);logger[_0x1555('0x12')](_0x1555('0x23'),_0x4a6bef,JSON[_0x1555('0x14')](_0x4e74a1));_0x530ac4(_0x4e74a1);})['catch'](function(_0x3a35cc){logger[_0x1555('0x15')](_0x1555('0x23'),_0x3a35cc['message'],_0x4a6bef);_0x36c402(_0x35d626[_0x1555('0x15')](0x1f4,_0x3a35cc[_0x1555('0x16')]));});});}; \ No newline at end of file +var _0x2256=['include','model','then','info','find','ShowTrigger','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','map'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0x2256,0x166));var _0x6225=function(_0x1ffba8,_0x228e72){_0x1ffba8=_0x1ffba8-0x0;var _0x285818=_0x2256[_0x1ffba8];return _0x285818;};'use strict';var _=require(_0x6225('0x0'));var util=require('util');var moment=require(_0x6225('0x1'));var BPromise=require(_0x6225('0x2'));var rs=require(_0x6225('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6225('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6225('0x5'));var config=require(_0x6225('0x6'));var jayson=require(_0x6225('0x7'));var client=jayson[_0x6225('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0fe4,_0x48cada,_0x131ff8){return new BPromise(function(_0x42336e,_0x21949e){return client['request'](_0x5e0fe4,_0x131ff8)['then'](function(_0x2fe29e){logger['info']('Trigger,\x20%s,\x20%s',_0x48cada,_0x6225('0x9'));logger[_0x6225('0xa')]('Trigger,\x20%s,\x20%s,\x20%s',_0x48cada,_0x6225('0x9'),JSON[_0x6225('0xb')](_0x2fe29e));if(_0x2fe29e[_0x6225('0xc')]){if(_0x2fe29e[_0x6225('0xc')][_0x6225('0xd')]===0x1f4){logger['error'](_0x6225('0xe'),_0x48cada,_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);return _0x21949e(_0x2fe29e[_0x6225('0xc')]['message']);}logger[_0x6225('0xc')](_0x6225('0xe'),_0x48cada,_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);return _0x42336e(_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);}else{logger['info'](_0x6225('0xe'),_0x48cada,_0x6225('0x9'));_0x42336e(_0x2fe29e[_0x6225('0x10')][_0x6225('0xf')]);}})[_0x6225('0x11')](function(_0x3dca74){logger['error']('Trigger,\x20%s,\x20%s',_0x48cada,_0x3dca74);_0x21949e(_0x3dca74);});});}exports[_0x6225('0x12')]=function(_0x3a53ba){var _0x1518a9=this;return new Promise(function(_0x4f3b12,_0x1edaf8){return db[_0x6225('0x13')][_0x6225('0x14')]({'raw':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba[_0x6225('0x15')][_0x6225('0x16')]===undefined?!![]:![]:!![],'where':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba['options'][_0x6225('0x17')]||null:null,'attributes':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba['options'][_0x6225('0x18')]||null:null,'limit':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba[_0x6225('0x15')]['limit']||null:null,'include':_0x3a53ba['options']?_0x3a53ba[_0x6225('0x15')]['include']?_[_0x6225('0x19')](_0x3a53ba['options'][_0x6225('0x1a')],function(_0x58f3fa){return{'model':db[_0x58f3fa['model']],'as':_0x58f3fa['as'],'attributes':_0x58f3fa['attributes'],'include':_0x58f3fa[_0x6225('0x1a')]?_[_0x6225('0x19')](_0x58f3fa[_0x6225('0x1a')],function(_0x4568c1){return{'model':db[_0x4568c1[_0x6225('0x1b')]],'as':_0x4568c1['as'],'attributes':_0x4568c1['attributes'],'include':_0x4568c1[_0x6225('0x1a')]?_['map'](_0x4568c1[_0x6225('0x1a')],function(_0x2e1c0e){return{'model':db[_0x2e1c0e[_0x6225('0x1b')]],'as':_0x2e1c0e['as'],'attributes':_0x2e1c0e[_0x6225('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6225('0x1c')](function(_0x1372f3){logger[_0x6225('0x1d')]('GetTrigger',_0x3a53ba);logger[_0x6225('0xa')](_0x6225('0x12'),_0x3a53ba,JSON['stringify'](_0x1372f3));_0x4f3b12(_0x1372f3);})[_0x6225('0x11')](function(_0x28ea8c){logger['error']('GetTrigger',_0x28ea8c[_0x6225('0xf')],_0x3a53ba);_0x1edaf8(_0x1518a9[_0x6225('0xc')](0x1f4,_0x28ea8c['message']));});});};exports['ShowTrigger']=function(_0x5078a0){var _0x410291=this;return new Promise(function(_0xe9ecbe,_0x156f59){return db[_0x6225('0x13')][_0x6225('0x1e')]({'raw':_0x5078a0[_0x6225('0x15')]?_0x5078a0[_0x6225('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5078a0[_0x6225('0x15')]?_0x5078a0[_0x6225('0x15')][_0x6225('0x17')]||null:null,'attributes':_0x5078a0[_0x6225('0x15')]?_0x5078a0['options'][_0x6225('0x18')]||null:null,'include':_0x5078a0['options']?_0x5078a0[_0x6225('0x15')][_0x6225('0x1a')]?_[_0x6225('0x19')](_0x5078a0[_0x6225('0x15')][_0x6225('0x1a')],function(_0x2d66d4){return{'model':db[_0x2d66d4[_0x6225('0x1b')]],'as':_0x2d66d4['as'],'attributes':_0x2d66d4[_0x6225('0x18')],'include':_0x2d66d4[_0x6225('0x1a')]?_[_0x6225('0x19')](_0x2d66d4[_0x6225('0x1a')],function(_0x50d0fe){return{'model':db[_0x50d0fe[_0x6225('0x1b')]],'as':_0x50d0fe['as'],'attributes':_0x50d0fe[_0x6225('0x18')],'include':_0x50d0fe['include']?_[_0x6225('0x19')](_0x50d0fe['include'],function(_0x5a50bf){return{'model':db[_0x5a50bf[_0x6225('0x1b')]],'as':_0x5a50bf['as'],'attributes':_0x5a50bf[_0x6225('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6225('0x1c')](function(_0x54e02f){logger['info']('ShowTrigger',_0x5078a0);logger[_0x6225('0xa')](_0x6225('0x1f'),_0x5078a0,JSON['stringify'](_0x54e02f));_0xe9ecbe(_0x54e02f);})[_0x6225('0x11')](function(_0x1bfd36){logger[_0x6225('0xc')](_0x6225('0x1f'),_0x1bfd36[_0x6225('0xf')],_0x5078a0);_0x156f59(_0x410291[_0x6225('0xc')](0x1f4,_0x1bfd36['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 1b429f0..4f579ec 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 _0x8a10=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone','create','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x2601c2,_0x16bec){var _0x499fcb=function(_0x509d39){while(--_0x509d39){_0x2601c2['push'](_0x2601c2['shift']());}};_0x499fcb(++_0x16bec);}(_0x8a10,0x13b));var _0x08a1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8a10[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0x08a1('0x0'));var path=require('path');var timeout=require(_0x08a1('0x1'));var express=require(_0x08a1('0x2'));var router=express[_0x08a1('0x3')]();var fs_extra=require(_0x08a1('0x4'));var auth=require(_0x08a1('0x5'));var interaction=require(_0x08a1('0x6'));var config=require(_0x08a1('0x7'));var controller=require(_0x08a1('0x8'));router[_0x08a1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x08a1('0x9')]('/:id',auth[_0x08a1('0xa')](),controller[_0x08a1('0xb')]);router[_0x08a1('0xc')](_0x08a1('0xd'),auth['isAuthenticated'](),controller[_0x08a1('0xe')]);router[_0x08a1('0xc')]('/',auth[_0x08a1('0xa')](),controller[_0x08a1('0xf')]);router['put'](_0x08a1('0x10'),auth['isAuthenticated'](),controller[_0x08a1('0x11')]);router['delete'](_0x08a1('0x10'),auth[_0x08a1('0xa')](),controller[_0x08a1('0x12')]);module[_0x08a1('0x13')]=router; \ No newline at end of file +var _0xa4fe=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','index','/:id','isAuthenticated','show','post','/:id/clone','clone','put','update','delete','exports','util'];(function(_0x159dde,_0x5c7c54){var _0x906871=function(_0x380b46){while(--_0x380b46){_0x159dde['push'](_0x159dde['shift']());}};_0x906871(++_0x5c7c54);}(_0xa4fe,0xc5));var _0xea4f=function(_0x5bfaf0,_0x2b69e1){_0x5bfaf0=_0x5bfaf0-0x0;var _0x2253a3=_0xa4fe[_0x5bfaf0];return _0x2253a3;};'use strict';var multer=require('multer');var util=require(_0xea4f('0x0'));var path=require('path');var timeout=require(_0xea4f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xea4f('0x2'));var auth=require(_0xea4f('0x3'));var interaction=require(_0xea4f('0x4'));var config=require(_0xea4f('0x5'));var controller=require(_0xea4f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xea4f('0x7')]);router['get'](_0xea4f('0x8'),auth[_0xea4f('0x9')](),controller[_0xea4f('0xa')]);router[_0xea4f('0xb')](_0xea4f('0xc'),auth[_0xea4f('0x9')](),controller[_0xea4f('0xd')]);router[_0xea4f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea4f('0xe')]('/:id',auth[_0xea4f('0x9')](),controller[_0xea4f('0xf')]);router[_0xea4f('0x10')](_0xea4f('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xea4f('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ef3f5ba..fbd3b99 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 _0xadb1=['STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','update','force_rport,comedia','setDataValue','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','BOOLEAN','exports'];(function(_0x60ccc0,_0x48df3c){var _0x2c5cbb=function(_0x3ffe9e){while(--_0x3ffe9e){_0x60ccc0['push'](_0x60ccc0['shift']());}};_0x2c5cbb(++_0x48df3c);}(_0xadb1,0x67));var _0x1adb=function(_0x2fed6d,_0x3ac940){_0x2fed6d=_0x2fed6d-0x0;var _0x1d570a=_0xadb1[_0x2fed6d];return _0x1d570a;};'use strict';var Sequelize=require('sequelize');module[_0x1adb('0x0')]={'name':{'type':Sequelize[_0x1adb('0x1')],'allowNull':![],'unique':_0x1adb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x4'),_0x1adb('0x5'),_0x1adb('0x6')),'allowNull':![],'defaultValue':_0x1adb('0x4')},'context':{'type':Sequelize[_0x1adb('0x1')],'allowNull':![],'defaultValue':_0x1adb('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x1adb('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x1adb('0x9'),_0x1adb('0xa'),_0x1adb('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x1adb('0x1')]},'permit':{'type':Sequelize[_0x1adb('0x1')]},'secret':{'type':Sequelize[_0x1adb('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x1adb('0x1')]},'transport':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':_0x1adb('0xc'),'set':function(_0x527647){this['setDataValue']('transport',_0x527647?_0x527647[_0x1adb('0xd')](','):null);},'get':function(){return this[_0x1adb('0xe')](_0x1adb('0xf'))?this[_0x1adb('0xe')](_0x1adb('0xf'))[_0x1adb('0x10')](','):null;},'comment':_0x1adb('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x1adb('0x12'),_0x1adb('0x13'),_0x1adb('0x14'),_0x1adb('0x15'),'auto'),'defaultValue':_0x1adb('0x12')},'directmedia':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no','nonat',_0x1adb('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1adb('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1adb('0x1')]},'directmediadeny':{'type':Sequelize[_0x1adb('0x1')]},'nat':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':_0x1adb('0x18'),'set':function(_0x52e733){this[_0x1adb('0x19')](_0x1adb('0x1a'),_0x52e733?_0x52e733[_0x1adb('0xd')](','):null);},'get':function(){return this['getDataValue'](_0x1adb('0x1a'))?this[_0x1adb('0xe')]('nat')['split'](','):null;},'comment':_0x1adb('0x1b')},'callgroup':{'type':Sequelize[_0x1adb('0x1')]},'namedcallgroup':{'type':Sequelize[_0x1adb('0x1')]},'pickupgroup':{'type':Sequelize[_0x1adb('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x1adb('0x1')]},'language':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1adb('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x1adb('0x1')],'allowNull':![],'defaultValue':_0x1adb('0x1c'),'set':function(_0x292f35){this[_0x1adb('0x19')](_0x1adb('0x1d'),_0x292f35?_0x292f35[_0x1adb('0xd')](';'):_0x1adb('0x1c'));},'get':function(){return this[_0x1adb('0xe')](_0x1adb('0x1d'))?this[_0x1adb('0xe')]('allow')[_0x1adb('0x10')](';'):null;},'comment':_0x1adb('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x1adb('0x1f'),'set':function(_0x23b84f){this[_0x1adb('0x19')]('insecure',_0x23b84f?_0x23b84f[_0x1adb('0xd')](','):null);},'get':function(){return this[_0x1adb('0xe')](_0x1adb('0x20'))?this[_0x1adb('0xe')]('insecure')[_0x1adb('0x10')](','):null;},'comment':_0x1adb('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no',_0x1adb('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no')},'accountcode':{'type':Sequelize[_0x1adb('0x23')](0xb)},'setvar':{'type':Sequelize[_0x1adb('0x1')]},'callerid':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':_0x1adb('0x24')},'amaflags':{'type':Sequelize[_0x1adb('0x1')]},'callcounter':{'type':Sequelize[_0x1adb('0x3')]('yes','no'),'defaultValue':_0x1adb('0x16')},'busylevel':{'type':Sequelize[_0x1adb('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x1adb('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x1adb('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x1adb('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x1adb('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no',_0x1adb('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1adb('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'mailbox':{'type':Sequelize[_0x1adb('0x1')]},'session_timers':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x26'),_0x1adb('0x27'),_0x1adb('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x1adb('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x29'),_0x1adb('0x2a')),'defaultValue':_0x1adb('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x1adb('0x1')]},'regexten':{'type':Sequelize[_0x1adb('0x1')]},'fromdomain':{'type':Sequelize[_0x1adb('0x1')]},'fromuser':{'type':Sequelize[_0x1adb('0x1')]},'port':{'type':Sequelize[_0x1adb('0x23')](0x5)},'qualify':{'type':Sequelize[_0x1adb('0x3')]('yes','no'),'defaultValue':_0x1adb('0x16')},'keepalive':{'type':Sequelize[_0x1adb('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x1adb('0x1')]},'defaultuser':{'type':Sequelize[_0x1adb('0x1')]},'rtptimeout':{'type':Sequelize[_0x1adb('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1adb('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1adb('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no',_0x1adb('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1adb('0x1')]},'callbackextension':{'type':Sequelize[_0x1adb('0x1')]},'timert1':{'type':Sequelize[_0x1adb('0x23')](0xb)},'timerb':{'type':Sequelize[_0x1adb('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1adb('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x1adb('0x1')]},'contactdeny':{'type':Sequelize[_0x1adb('0x1')]},'contactacl':{'type':Sequelize[_0x1adb('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x1adb('0x1')]},'use_q850_reason':{'type':Sequelize[_0x1adb('0x1')]},'maxforwards':{'type':Sequelize[_0x1adb('0x23')](0xb)},'encryption':{'type':Sequelize[_0x1adb('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'force_avp':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no',_0x1adb('0x2c'),_0x1adb('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x1adb('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1adb('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x1adb('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1adb('0x1')]},'dtlscapath':{'type':Sequelize[_0x1adb('0x1')]},'dtlssetup':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x2e'),_0x1adb('0x2f'),_0x1adb('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x1adb('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1adb('0x1')]},'recordofffeature':{'type':Sequelize[_0x1adb('0x1')]},'call_limit':{'type':Sequelize[_0x1adb('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x1adb('0x3')](_0x1adb('0x16'),'no')},'vmexten':{'type':Sequelize[_0x1adb('0x1')]},'mohinterpret':{'type':Sequelize[_0x1adb('0x1')]},'mohsuggest':{'type':Sequelize[_0x1adb('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1adb('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x1adb('0x31'),_0x1adb('0x17'),_0x1adb('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x1adb('0x1')]},'active':{'type':Sequelize[_0x1adb('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb4e0=['peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','setDataValue','transport','join','getDataValue','split','rfc2833','info','inband','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','actpass','dynamic','update,nonat','BOOLEAN','exports','name','ENUM','friend','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4e0,0x1bd));var _0x0b4e=function(_0x562209,_0x53da55){_0x562209=_0x562209-0x0;var _0x4308f9=_0xb4e0[_0x562209];return _0x4308f9;};'use strict';var Sequelize=require('sequelize');module[_0x0b4e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0b4e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x3'),_0x0b4e('0x4'),_0x0b4e('0x5')),'allowNull':![],'defaultValue':_0x0b4e('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x0b4e('0x2')]('ALLOWED_NOT_SCREENED',_0x0b4e('0x6'),_0x0b4e('0x7'),_0x0b4e('0x8'),_0x0b4e('0x9'),_0x0b4e('0xa'),_0x0b4e('0xb'),_0x0b4e('0xc'))},'deny':{'type':Sequelize[_0x0b4e('0xd')]},'permit':{'type':Sequelize[_0x0b4e('0xd')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x0b4e('0xd')]},'transport':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'udp','set':function(_0x8abd95){this[_0x0b4e('0xe')](_0x0b4e('0xf'),_0x8abd95?_0x8abd95[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0xf'))?this['getDataValue'](_0x0b4e('0xf'))[_0x0b4e('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x0b4e('0x13'),_0x0b4e('0x14'),'shortinfo',_0x0b4e('0x15'),'auto'),'defaultValue':_0x0b4e('0x13')},'directmedia':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x17'),_0x0b4e('0x18'),_0x0b4e('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0b4e('0xd')]},'directmediadeny':{'type':Sequelize[_0x0b4e('0xd')]},'nat':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'force_rport,comedia','set':function(_0x189d77){this[_0x0b4e('0xe')]('nat',_0x189d77?_0x189d77[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x1a'))?this[_0x0b4e('0x11')](_0x0b4e('0x1a'))[_0x0b4e('0x12')](','):null;},'comment':_0x0b4e('0x1b')},'callgroup':{'type':Sequelize[_0x0b4e('0xd')]},'namedcallgroup':{'type':Sequelize[_0x0b4e('0xd')]},'pickupgroup':{'type':Sequelize[_0x0b4e('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x0b4e('0xd')]},'language':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0b4e('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0b4e('0x1d'),'set':function(_0x1032af){this['setDataValue'](_0x0b4e('0x1e'),_0x1032af?_0x1032af[_0x0b4e('0x10')](';'):_0x0b4e('0x1d'));},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x1e'))?this['getDataValue'](_0x0b4e('0x1e'))['split'](';'):null;},'comment':_0x0b4e('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0b4e('0x20'),'set':function(_0x254f9c){this['setDataValue']('insecure',_0x254f9c?_0x254f9c[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x21'))?this[_0x0b4e('0x11')](_0x0b4e('0x21'))[_0x0b4e('0x12')](','):null;},'comment':_0x0b4e('0x22')},'trustrpid':{'type':Sequelize[_0x0b4e('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x23'))},'promiscredir':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0b4e('0xd')]},'callerid':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x24')},'amaflags':{'type':Sequelize[_0x0b4e('0xd')]},'callcounter':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x0b4e('0xd')]},'template':{'type':Sequelize[_0x0b4e('0xd')]},'videosupport':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x0b4e('0xd')]},'session_timers':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x27'),_0x0b4e('0x28'),_0x0b4e('0x29'))},'session_expires':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x0b4e('0x2a')),'defaultValue':_0x0b4e('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x0b4e('0xd')]},'regexten':{'type':Sequelize[_0x0b4e('0xd')]},'fromdomain':{'type':Sequelize[_0x0b4e('0xd')]},'fromuser':{'type':Sequelize[_0x0b4e('0xd')]},'port':{'type':Sequelize[_0x0b4e('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no'),'defaultValue':_0x0b4e('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x0b4e('0xd')]},'defaultuser':{'type':Sequelize[_0x0b4e('0xd')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no',_0x0b4e('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0b4e('0xd')]},'callbackextension':{'type':Sequelize[_0x0b4e('0xd')]},'timert1':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0b4e('0xd')]},'contactdeny':{'type':Sequelize[_0x0b4e('0xd')]},'contactacl':{'type':Sequelize[_0x0b4e('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0x0b4e('0xd')]},'use_q850_reason':{'type':Sequelize[_0x0b4e('0xd')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0b4e('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x2c'),_0x0b4e('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0b4e('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x0b4e('0xd')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0b4e('0xd')]},'dtlscapath':{'type':Sequelize[_0x0b4e('0xd')]},'dtlssetup':{'type':Sequelize[_0x0b4e('0x2')]('active','passive',_0x0b4e('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0b4e('0xd')]},'usereqphone':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0b4e('0xd')]},'recordofffeature':{'type':Sequelize[_0x0b4e('0xd')]},'call_limit':{'type':Sequelize[_0x0b4e('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x0b4e('0xd')]},'mohinterpret':{'type':Sequelize[_0x0b4e('0xd')]},'mohsuggest':{'type':Sequelize[_0x0b4e('0xd')]},'parkinglot':{'type':Sequelize[_0x0b4e('0xd')]},'description':{'type':Sequelize[_0x0b4e('0xd')]},'host':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x2f')},'canreinvite':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x17'),_0x0b4e('0x18'),_0x0b4e('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x0b4e('0xd')]},'active':{'type':Sequelize[_0x0b4e('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0b4e('0xd')],'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 dbc5bc3..d22bde8 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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x30f19b,_0x341864){var _0x35d7a5=function(_0x26fc9f){while(--_0x26fc9f){_0x30f19b['push'](_0x30f19b['shift']());}};_0x35d7a5(++_0x341864);}(_0x98a8,0x12c));var _0x898a=function(_0x1107e8,_0x1fb97a){_0x1107e8=_0x1107e8-0x0;var _0x45e03d=_0x98a8[_0x1107e8];return _0x45e03d;};'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'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file +var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x72fefb,_0x37ab29){var _0x166cb1=function(_0x493636){while(--_0x493636){_0x72fefb['push'](_0x72fefb['shift']());}};_0x166cb1(++_0x37ab29);}(_0x6aa7,0x178));var _0x76aa=function(_0x159a42,_0x5e3877){_0x159a42=_0x159a42-0x0;var _0x58838f=_0x6aa7[_0x159a42];return _0x58838f;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e82ac50..ac2d5fd 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 _0x5698=['api','moment','request-promise','rimraf','../../config/environment','exports','define','Trunk','tools_trunks','util','../../config/logger'];(function(_0x44f81a,_0x2b75fa){var _0x4332d7=function(_0x3e234a){while(--_0x3e234a){_0x44f81a['push'](_0x44f81a['shift']());}};_0x4332d7(++_0x2b75fa);}(_0x5698,0xae));var _0x8569=function(_0x3d33fb,_0x5c577a){_0x3d33fb=_0x3d33fb-0x0;var _0x5cafdb=_0x5698[_0x3d33fb];return _0x5cafdb;};'use strict';var _=require('lodash');var util=require(_0x8569('0x0'));var logger=require(_0x8569('0x1'))(_0x8569('0x2'));var moment=require(_0x8569('0x3'));var BPromise=require('bluebird');var rp=require(_0x8569('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8569('0x5'));var config=require(_0x8569('0x6'));var attributes=require('./trunk.attributes');module[_0x8569('0x7')]=function(_0x588bbb,_0x5992f6){return _0x588bbb[_0x8569('0x8')](_0x8569('0x9'),attributes,{'tableName':_0x8569('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32fb=['path','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x253e1f,_0xd247f0){var _0x1adb58=function(_0x523236){while(--_0x523236){_0x253e1f['push'](_0x253e1f['shift']());}};_0x1adb58(++_0xd247f0);}(_0x32fb,0xfe));var _0xb32f=function(_0x1801b0,_0x387cbe){_0x1801b0=_0x1801b0-0x0;var _0x21a7a2=_0x32fb[_0x1801b0];return _0x21a7a2;};'use strict';var _=require(_0xb32f('0x0'));var util=require(_0xb32f('0x1'));var logger=require(_0xb32f('0x2'))(_0xb32f('0x3'));var moment=require(_0xb32f('0x4'));var BPromise=require(_0xb32f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb32f('0x6'));var rimraf=require(_0xb32f('0x7'));var config=require(_0xb32f('0x8'));var attributes=require(_0xb32f('0x9'));module[_0xb32f('0xa')]=function(_0x443b4d,_0x49dd83){return _0x443b4d[_0xb32f('0xb')]('Trunk',attributes,{'tableName':_0xb32f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 5b5d669..b1418bf 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 _0x7d03=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','GetTrunk','stringify','ShowTrunk','find','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x120e8b,_0x26d422){var _0x36791d=function(_0x254c9f){while(--_0x254c9f){_0x120e8b['push'](_0x120e8b['shift']());}};_0x36791d(++_0x26d422);}(_0x7d03,0x180));var _0x37d0=function(_0x21c0d9,_0x4576b2){_0x21c0d9=_0x21c0d9-0x0;var _0x33750b=_0x7d03[_0x21c0d9];return _0x33750b;};'use strict';var _=require(_0x37d0('0x0'));var util=require(_0x37d0('0x1'));var moment=require(_0x37d0('0x2'));var BPromise=require(_0x37d0('0x3'));var rs=require(_0x37d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37d0('0x5'))['db'];var utils=require(_0x37d0('0x6'));var logger=require('../../config/logger')(_0x37d0('0x7'));var config=require(_0x37d0('0x8'));var jayson=require(_0x37d0('0x9'));var client=jayson['client'][_0x37d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4827a0,_0x5348e5,_0x3ea8a0){return new BPromise(function(_0x14b537,_0x20cdbb){return client[_0x37d0('0xb')](_0x4827a0,_0x3ea8a0)['then'](function(_0x292f75){logger[_0x37d0('0xc')](_0x37d0('0xd'),_0x5348e5,_0x37d0('0xe'));logger[_0x37d0('0xf')](_0x37d0('0x10'),_0x5348e5,_0x37d0('0xe'),JSON['stringify'](_0x292f75));if(_0x292f75[_0x37d0('0x11')]){if(_0x292f75[_0x37d0('0x11')][_0x37d0('0x12')]===0x1f4){logger[_0x37d0('0x11')](_0x37d0('0xd'),_0x5348e5,_0x292f75[_0x37d0('0x11')][_0x37d0('0x13')]);return _0x20cdbb(_0x292f75[_0x37d0('0x11')][_0x37d0('0x13')]);}logger[_0x37d0('0x11')]('Trunk,\x20%s,\x20%s',_0x5348e5,_0x292f75[_0x37d0('0x11')][_0x37d0('0x13')]);return _0x14b537(_0x292f75[_0x37d0('0x11')][_0x37d0('0x13')]);}else{logger[_0x37d0('0xc')](_0x37d0('0xd'),_0x5348e5,_0x37d0('0xe'));_0x14b537(_0x292f75['result'][_0x37d0('0x13')]);}})[_0x37d0('0x14')](function(_0x19af37){logger[_0x37d0('0x11')]('Trunk,\x20%s,\x20%s',_0x5348e5,_0x19af37);_0x20cdbb(_0x19af37);});});}exports['GetTrunk']=function(_0x259465){var _0x5a9044=this;return new Promise(function(_0x2df134,_0x424d96){return db[_0x37d0('0x15')][_0x37d0('0x16')]({'raw':_0x259465[_0x37d0('0x17')]?_0x259465[_0x37d0('0x17')][_0x37d0('0x18')]===undefined?!![]:![]:!![],'where':_0x259465[_0x37d0('0x17')]?_0x259465['options'][_0x37d0('0x19')]||null:null,'attributes':_0x259465['options']?_0x259465[_0x37d0('0x17')][_0x37d0('0x1a')]||null:null,'limit':_0x259465['options']?_0x259465[_0x37d0('0x17')][_0x37d0('0x1b')]||null:null,'include':_0x259465[_0x37d0('0x17')]?_0x259465['options'][_0x37d0('0x1c')]?_[_0x37d0('0x1d')](_0x259465['options'][_0x37d0('0x1c')],function(_0x482130){return{'model':db[_0x482130[_0x37d0('0x1e')]],'as':_0x482130['as'],'attributes':_0x482130['attributes'],'include':_0x482130[_0x37d0('0x1c')]?_[_0x37d0('0x1d')](_0x482130[_0x37d0('0x1c')],function(_0x2f8fce){return{'model':db[_0x2f8fce[_0x37d0('0x1e')]],'as':_0x2f8fce['as'],'attributes':_0x2f8fce[_0x37d0('0x1a')],'include':_0x2f8fce[_0x37d0('0x1c')]?_[_0x37d0('0x1d')](_0x2f8fce[_0x37d0('0x1c')],function(_0x48daa5){return{'model':db[_0x48daa5['model']],'as':_0x48daa5['as'],'attributes':_0x48daa5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a11dc){logger[_0x37d0('0xc')](_0x37d0('0x1f'),_0x259465);logger['debug'](_0x37d0('0x1f'),_0x259465,JSON[_0x37d0('0x20')](_0x2a11dc));_0x2df134(_0x2a11dc);})[_0x37d0('0x14')](function(_0x46701e){logger[_0x37d0('0x11')](_0x37d0('0x1f'),_0x46701e['message'],_0x259465);_0x424d96(_0x5a9044[_0x37d0('0x11')](0x1f4,_0x46701e[_0x37d0('0x13')]));});});};exports[_0x37d0('0x21')]=function(_0x187449){var _0x20d269=this;return new Promise(function(_0x174818,_0x2a68b9){return db['Trunk'][_0x37d0('0x22')]({'raw':_0x187449[_0x37d0('0x17')]?_0x187449[_0x37d0('0x17')][_0x37d0('0x18')]===undefined?!![]:![]:!![],'where':_0x187449['options']?_0x187449['options'][_0x37d0('0x19')]||null:null,'attributes':_0x187449['options']?_0x187449[_0x37d0('0x17')][_0x37d0('0x1a')]||null:null,'include':_0x187449['options']?_0x187449['options']['include']?_[_0x37d0('0x1d')](_0x187449[_0x37d0('0x17')][_0x37d0('0x1c')],function(_0x1dbe2c){return{'model':db[_0x1dbe2c[_0x37d0('0x1e')]],'as':_0x1dbe2c['as'],'attributes':_0x1dbe2c['attributes'],'include':_0x1dbe2c[_0x37d0('0x1c')]?_['map'](_0x1dbe2c['include'],function(_0x19da73){return{'model':db[_0x19da73[_0x37d0('0x1e')]],'as':_0x19da73['as'],'attributes':_0x19da73[_0x37d0('0x1a')],'include':_0x19da73[_0x37d0('0x1c')]?_[_0x37d0('0x1d')](_0x19da73['include'],function(_0x20c166){return{'model':db[_0x20c166[_0x37d0('0x1e')]],'as':_0x20c166['as'],'attributes':_0x20c166['attributes']};}):[]};}):[]};}):[]:[]})[_0x37d0('0x23')](function(_0x1d5495){logger['info'](_0x37d0('0x21'),_0x187449);logger[_0x37d0('0xf')](_0x37d0('0x21'),_0x187449,JSON[_0x37d0('0x20')](_0x1d5495));_0x174818(_0x1d5495);})[_0x37d0('0x14')](function(_0x18c9f3){logger[_0x37d0('0x11')](_0x37d0('0x21'),_0x18c9f3[_0x37d0('0x13')],_0x187449);_0x2a68b9(_0x20d269[_0x37d0('0x11')](0x1f4,_0x18c9f3[_0x37d0('0x13')]));});});}; \ No newline at end of file +var _0x70aa=['code','Trunk,\x20%s,\x20%s','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4847cf,_0x3616b5){var _0x375aad=function(_0x3a6ce8){while(--_0x3a6ce8){_0x4847cf['push'](_0x4847cf['shift']());}};_0x375aad(++_0x3616b5);}(_0x70aa,0xce));var _0xa70a=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x70aa[_0x4c05da];return _0x1614db;};'use strict';var _=require('lodash');var util=require(_0xa70a('0x0'));var moment=require(_0xa70a('0x1'));var BPromise=require(_0xa70a('0x2'));var rs=require(_0xa70a('0x3'));var fs=require('fs');var Redis=require(_0xa70a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa70a('0x5'))(_0xa70a('0x6'));var config=require(_0xa70a('0x7'));var jayson=require(_0xa70a('0x8'));var client=jayson[_0xa70a('0x9')][_0xa70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a3b,_0x4a6b26,_0x113e87){return new BPromise(function(_0x5daf08,_0x571285){return client[_0xa70a('0xb')](_0x222a3b,_0x113e87)['then'](function(_0xc2df0f){logger[_0xa70a('0xc')]('Trunk,\x20%s,\x20%s',_0x4a6b26,'request\x20sent');logger['debug'](_0xa70a('0xd'),_0x4a6b26,'request\x20sent',JSON[_0xa70a('0xe')](_0xc2df0f));if(_0xc2df0f[_0xa70a('0xf')]){if(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x10')]===0x1f4){logger[_0xa70a('0xf')](_0xa70a('0x11'),_0x4a6b26,_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);return _0x571285(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);}logger[_0xa70a('0xf')](_0xa70a('0x11'),_0x4a6b26,_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);return _0x5daf08(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);}else{logger['info'](_0xa70a('0x11'),_0x4a6b26,_0xa70a('0x13'));_0x5daf08(_0xc2df0f[_0xa70a('0x14')][_0xa70a('0x12')]);}})[_0xa70a('0x15')](function(_0x49bcfe){logger[_0xa70a('0xf')]('Trunk,\x20%s,\x20%s',_0x4a6b26,_0x49bcfe);_0x571285(_0x49bcfe);});});}exports[_0xa70a('0x16')]=function(_0x590702){var _0x4471e7=this;return new Promise(function(_0x102e16,_0x3065fb){return db[_0xa70a('0x17')][_0xa70a('0x18')]({'raw':_0x590702[_0xa70a('0x19')]?_0x590702['options'][_0xa70a('0x1a')]===undefined?!![]:![]:!![],'where':_0x590702[_0xa70a('0x19')]?_0x590702['options'][_0xa70a('0x1b')]||null:null,'attributes':_0x590702[_0xa70a('0x19')]?_0x590702[_0xa70a('0x19')]['attributes']||null:null,'limit':_0x590702['options']?_0x590702[_0xa70a('0x19')][_0xa70a('0x1c')]||null:null,'include':_0x590702[_0xa70a('0x19')]?_0x590702[_0xa70a('0x19')]['include']?_[_0xa70a('0x1d')](_0x590702['options'][_0xa70a('0x1e')],function(_0x411b4d){return{'model':db[_0x411b4d[_0xa70a('0x1f')]],'as':_0x411b4d['as'],'attributes':_0x411b4d[_0xa70a('0x20')],'include':_0x411b4d[_0xa70a('0x1e')]?_[_0xa70a('0x1d')](_0x411b4d['include'],function(_0x19a02a){return{'model':db[_0x19a02a[_0xa70a('0x1f')]],'as':_0x19a02a['as'],'attributes':_0x19a02a[_0xa70a('0x20')],'include':_0x19a02a['include']?_[_0xa70a('0x1d')](_0x19a02a[_0xa70a('0x1e')],function(_0x534aeb){return{'model':db[_0x534aeb[_0xa70a('0x1f')]],'as':_0x534aeb['as'],'attributes':_0x534aeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa70a('0x21')](function(_0x36930d){logger[_0xa70a('0xc')](_0xa70a('0x16'),_0x590702);logger[_0xa70a('0x22')](_0xa70a('0x16'),_0x590702,JSON[_0xa70a('0xe')](_0x36930d));_0x102e16(_0x36930d);})[_0xa70a('0x15')](function(_0x52e886){logger[_0xa70a('0xf')]('GetTrunk',_0x52e886['message'],_0x590702);_0x3065fb(_0x4471e7[_0xa70a('0xf')](0x1f4,_0x52e886[_0xa70a('0x12')]));});});};exports['ShowTrunk']=function(_0x45a442){var _0xa9c01e=this;return new Promise(function(_0x570ed8,_0x2426cf){return db[_0xa70a('0x17')][_0xa70a('0x23')]({'raw':_0x45a442[_0xa70a('0x19')]?_0x45a442[_0xa70a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x45a442['options']?_0x45a442['options'][_0xa70a('0x1b')]||null:null,'attributes':_0x45a442['options']?_0x45a442[_0xa70a('0x19')][_0xa70a('0x20')]||null:null,'include':_0x45a442[_0xa70a('0x19')]?_0x45a442[_0xa70a('0x19')][_0xa70a('0x1e')]?_['map'](_0x45a442[_0xa70a('0x19')][_0xa70a('0x1e')],function(_0x166f78){return{'model':db[_0x166f78[_0xa70a('0x1f')]],'as':_0x166f78['as'],'attributes':_0x166f78[_0xa70a('0x20')],'include':_0x166f78['include']?_[_0xa70a('0x1d')](_0x166f78[_0xa70a('0x1e')],function(_0x675346){return{'model':db[_0x675346['model']],'as':_0x675346['as'],'attributes':_0x675346['attributes'],'include':_0x675346[_0xa70a('0x1e')]?_['map'](_0x675346[_0xa70a('0x1e')],function(_0x4df703){return{'model':db[_0x4df703['model']],'as':_0x4df703['as'],'attributes':_0x4df703[_0xa70a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa70a('0x21')](function(_0x811360){logger['info'](_0xa70a('0x24'),_0x45a442);logger[_0xa70a('0x22')]('ShowTrunk',_0x45a442,JSON[_0xa70a('0xe')](_0x811360));_0x570ed8(_0x811360);})[_0xa70a('0x15')](function(_0x570424){logger[_0xa70a('0xf')](_0xa70a('0x24'),_0x570424['message'],_0x45a442);_0x2426cf(_0xa9c01e[_0xa70a('0xf')](0x1f4,_0x570424['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 53eacd3..a1f19ce 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 _0x0185=['getApiKey','post','/create_many','bulkCreate','/:id/queues','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','file','/:id/login','login','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/mail_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/mail/interactions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0185,0x168));var _0x5018=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x0185[_0x10df18];return _0x1f9a1d;};'use strict';var multer=require(_0x5018('0x0'));var util=require(_0x5018('0x1'));var path=require('path');var timeout=require(_0x5018('0x2'));var express=require(_0x5018('0x3'));var router=express[_0x5018('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5018('0x5'));var interaction=require(_0x5018('0x6'));var config=require('../../config/environment');var controller=require(_0x5018('0x7'));router[_0x5018('0x8')]('/',auth[_0x5018('0x9')](),controller['index']);router[_0x5018('0x8')](_0x5018('0xa'),auth['isAuthenticated'](),controller[_0x5018('0xb')]);router[_0x5018('0x8')](_0x5018('0xc'),auth['isAuthenticated'](),controller[_0x5018('0xd')]);router[_0x5018('0x8')](_0x5018('0xe'),auth[_0x5018('0x9')](),controller[_0x5018('0xf')]);router['get'](_0x5018('0x10'),auth['isAuthenticated'](),controller[_0x5018('0x11')]);router[_0x5018('0x8')]('/:id/avatar',controller[_0x5018('0x12')]);router[_0x5018('0x8')](_0x5018('0x13'),auth[_0x5018('0x9')](),controller[_0x5018('0x14')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x5018('0x15')]);router[_0x5018('0x8')]('/:id/queues',auth[_0x5018('0x9')](),controller[_0x5018('0x16')]);router[_0x5018('0x8')](_0x5018('0x17'),auth[_0x5018('0x9')](),controller[_0x5018('0x18')]);router[_0x5018('0x8')](_0x5018('0x19'),auth['isAuthenticated'](),controller['getGroups']);router[_0x5018('0x8')](_0x5018('0x1a'),auth[_0x5018('0x9')](),controller['getRecordings']);router[_0x5018('0x8')](_0x5018('0x1b'),auth[_0x5018('0x9')](),controller[_0x5018('0x1c')]);router[_0x5018('0x8')]('/:id/chat/interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x1d')]);router[_0x5018('0x8')]('/:id/openchannel/interactions',auth[_0x5018('0x9')](),controller['getOpenchannelInteractions']);router['get'](_0x5018('0x1e'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x5018('0x8')]('/:id/sms/interactions',auth[_0x5018('0x9')](),controller['getSmsInteractions']);router[_0x5018('0x8')]('/:id/fax/interactions',auth[_0x5018('0x9')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get'](_0x5018('0x1f'),auth[_0x5018('0x9')](),controller[_0x5018('0x20')]);router[_0x5018('0x8')]('/:id/lists',auth[_0x5018('0x9')](),controller[_0x5018('0x21')]);router[_0x5018('0x8')](_0x5018('0x22'),auth[_0x5018('0x9')](),controller[_0x5018('0x23')]);router[_0x5018('0x8')]('/:id/prefixes',auth[_0x5018('0x9')](),controller[_0x5018('0x24')]);router[_0x5018('0x8')]('/:id/fax_accounts',auth[_0x5018('0x9')](),controller[_0x5018('0x25')]);router[_0x5018('0x8')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x5018('0x26')]);router[_0x5018('0x8')](_0x5018('0x27'),auth[_0x5018('0x9')](),controller[_0x5018('0x28')]);router[_0x5018('0x8')](_0x5018('0x29'),auth[_0x5018('0x9')](),controller[_0x5018('0x2a')]);router[_0x5018('0x8')](_0x5018('0x2b'),auth[_0x5018('0x9')](),controller[_0x5018('0x2c')]);router[_0x5018('0x8')](_0x5018('0x2d'),auth['isAuthenticated'](),controller[_0x5018('0x2e')]);router[_0x5018('0x8')](_0x5018('0x2f'),auth[_0x5018('0x9')](),controller[_0x5018('0x30')]);router['get'](_0x5018('0x31'),auth[_0x5018('0x9')](),controller[_0x5018('0x32')]);router[_0x5018('0x8')](_0x5018('0x33'),auth['isAuthenticated'](),controller[_0x5018('0x34')]);router[_0x5018('0x35')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x5018('0x35')]('/',auth[_0x5018('0x9')](),controller['create']);router[_0x5018('0x35')](_0x5018('0x36'),auth[_0x5018('0x9')](),controller[_0x5018('0x37')]);router[_0x5018('0x35')](_0x5018('0x38'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x198f42,_0x191773,_0x56d803){_0x56d803(null,path['join'](config[_0x5018('0x39')],_0x5018('0x3a')));},'filename':function(_0x25af62,_0x24d214,_0x369b73){_0x369b73(null,util['format'](_0x5018('0x3b'),Date[_0x5018('0x3c')](),_0x24d214[_0x5018('0x3d')]));}})});router['post'](_0x5018('0x3e'),upload['single'](_0x5018('0x3f')),controller['addAvatar']);router[_0x5018('0x35')](_0x5018('0x40'),auth['isAuthenticated'](),controller[_0x5018('0x41')]);router[_0x5018('0x35')]('/:id/logout',auth[_0x5018('0x9')](),controller['logout']);router[_0x5018('0x35')](_0x5018('0x42'),auth[_0x5018('0x9')](),controller['pause']);router[_0x5018('0x35')](_0x5018('0x43'),auth[_0x5018('0x9')](),controller['unpause']);router['post'](_0x5018('0x1f'),auth[_0x5018('0x9')](),controller[_0x5018('0x44')]);router[_0x5018('0x35')](_0x5018('0x45'),auth['isAuthenticated'](),controller[_0x5018('0x46')]);router['post']('/:id/mail_interactions',auth[_0x5018('0x9')](),controller['addMailInteractions']);router[_0x5018('0x35')](_0x5018('0x47'),auth['isAuthenticated'](),controller[_0x5018('0x48')]);router[_0x5018('0x35')](_0x5018('0x49'),auth[_0x5018('0x9')](),controller[_0x5018('0x4a')]);router[_0x5018('0x35')]('/:id/openchannel_interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x4b')]);router[_0x5018('0x35')](_0x5018('0x4c'),auth[_0x5018('0x9')](),controller[_0x5018('0x4d')]);router[_0x5018('0x35')](_0x5018('0x4e'),auth[_0x5018('0x9')](),controller[_0x5018('0x4f')]);router[_0x5018('0x35')]('/:id/mail_accounts',auth[_0x5018('0x9')](),controller[_0x5018('0x50')]);router['post']('/:id/openchannel_accounts',auth[_0x5018('0x9')](),controller[_0x5018('0x51')]);router[_0x5018('0x35')](_0x5018('0x29'),auth[_0x5018('0x9')](),controller['addSmsAccounts']);router[_0x5018('0x35')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x5018('0x52')]);router[_0x5018('0x35')](_0x5018('0x2d'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x5018('0x35')](_0x5018('0x2f'),auth[_0x5018('0x9')](),controller[_0x5018('0x53')]);router[_0x5018('0x35')](_0x5018('0x33'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x5018('0x54')](_0x5018('0x10'),auth['isAuthenticated'](),controller[_0x5018('0x55')]);router[_0x5018('0x54')](_0x5018('0x56'),auth[_0x5018('0x9')](),controller['changePassword']);router[_0x5018('0x57')]('/:id/queues',auth[_0x5018('0x9')](),controller[_0x5018('0x58')]);router['delete']('/:id/teams',auth[_0x5018('0x9')](),controller[_0x5018('0x59')]);router[_0x5018('0x57')](_0x5018('0x10'),auth[_0x5018('0x9')](),controller[_0x5018('0x5a')]);router[_0x5018('0x57')](_0x5018('0x45'),auth['isAuthenticated'](),controller[_0x5018('0x5b')]);router[_0x5018('0x57')]('/:id/mail_interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x5c')]);router[_0x5018('0x57')]('/:id/fax_interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x5d')]);router[_0x5018('0x57')](_0x5018('0x49'),auth[_0x5018('0x9')](),controller[_0x5018('0x5e')]);router[_0x5018('0x57')]('/:id/openchannel_interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x5f')]);router[_0x5018('0x57')]('/:id/whatsapp_interactions',auth[_0x5018('0x9')](),controller[_0x5018('0x60')]);router[_0x5018('0x57')](_0x5018('0x4e'),auth[_0x5018('0x9')](),controller['removeFaxAccounts']);router[_0x5018('0x57')](_0x5018('0x61'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x5018('0x57')](_0x5018('0x27'),auth['isAuthenticated'](),controller[_0x5018('0x62')]);router[_0x5018('0x57')](_0x5018('0x29'),auth[_0x5018('0x9')](),controller[_0x5018('0x63')]);router[_0x5018('0x57')](_0x5018('0x2b'),auth[_0x5018('0x9')](),controller['removeChatWebsites']);router[_0x5018('0x57')](_0x5018('0x2d'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x5018('0x64')]);router[_0x5018('0x57')](_0x5018('0x33'),auth[_0x5018('0x9')](),controller[_0x5018('0x65')]);module[_0x5018('0x66')]=router; \ No newline at end of file +var _0x2360=['addAvatar','/:id/login','/:id/logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/open_tabs','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','/:id/queues','diskStorage','join','root','%s-%s','now','originalname','/:id/avatar','single'];(function(_0x50e8ae,_0x39549c){var _0x3e6c4c=function(_0x53cb29){while(--_0x53cb29){_0x50e8ae['push'](_0x50e8ae['shift']());}};_0x3e6c4c(++_0x39549c);}(_0x2360,0x16d));var _0x0236=function(_0x4778d5,_0x46e8e7){_0x4778d5=_0x4778d5-0x0;var _0x5337cf=_0x2360[_0x4778d5];return _0x5337cf;};'use strict';var multer=require(_0x0236('0x0'));var util=require(_0x0236('0x1'));var path=require(_0x0236('0x2'));var timeout=require('connect-timeout');var express=require(_0x0236('0x3'));var router=express[_0x0236('0x4')]();var fs_extra=require(_0x0236('0x5'));var auth=require(_0x0236('0x6'));var interaction=require(_0x0236('0x7'));var config=require('../../config/environment');var controller=require(_0x0236('0x8'));router['get']('/',auth[_0x0236('0x9')](),controller[_0x0236('0xa')]);router[_0x0236('0xb')](_0x0236('0xc'),auth[_0x0236('0x9')](),controller[_0x0236('0xd')]);router[_0x0236('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0x0236('0xb')]('/presence',auth[_0x0236('0x9')](),controller['getPresence']);router[_0x0236('0xb')](_0x0236('0xe'),auth[_0x0236('0x9')](),controller[_0x0236('0xf')]);router[_0x0236('0xb')]('/:id/avatar',controller['getAvatar']);router[_0x0236('0xb')](_0x0236('0x10'),auth[_0x0236('0x9')](),controller['getOpenTabs']);router[_0x0236('0xb')]('/:id/contacts',auth[_0x0236('0x9')](),controller['getContacts']);router[_0x0236('0xb')]('/:id/queues',auth[_0x0236('0x9')](),controller['getQueues']);router[_0x0236('0xb')]('/:id/queues_rt',auth[_0x0236('0x9')](),controller[_0x0236('0x11')]);router[_0x0236('0xb')]('/:id/groups',auth[_0x0236('0x9')](),controller[_0x0236('0x12')]);router['get'](_0x0236('0x13'),auth[_0x0236('0x9')](),controller[_0x0236('0x14')]);router[_0x0236('0xb')](_0x0236('0x15'),auth[_0x0236('0x9')](),controller[_0x0236('0x16')]);router[_0x0236('0xb')](_0x0236('0x17'),auth[_0x0236('0x9')](),controller[_0x0236('0x18')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x0236('0x19')]);router['get'](_0x0236('0x1a'),auth[_0x0236('0x9')](),controller[_0x0236('0x1b')]);router[_0x0236('0xb')](_0x0236('0x1c'),auth[_0x0236('0x9')](),controller['getSmsInteractions']);router[_0x0236('0xb')](_0x0236('0x1d'),auth[_0x0236('0x9')](),controller[_0x0236('0x1e')]);router['get'](_0x0236('0x1f'),auth[_0x0236('0x9')](),controller['getWhatsappInteractions']);router[_0x0236('0xb')](_0x0236('0x20'),auth[_0x0236('0x9')](),controller['getTeams']);router[_0x0236('0xb')](_0x0236('0x21'),auth['isAuthenticated'](),controller[_0x0236('0x22')]);router['get'](_0x0236('0x23'),auth[_0x0236('0x9')](),controller[_0x0236('0x24')]);router[_0x0236('0xb')]('/:id/prefixes',auth[_0x0236('0x9')](),controller[_0x0236('0x25')]);router[_0x0236('0xb')](_0x0236('0x26'),auth[_0x0236('0x9')](),controller['getFaxAccounts']);router[_0x0236('0xb')](_0x0236('0x27'),auth[_0x0236('0x9')](),controller[_0x0236('0x28')]);router[_0x0236('0xb')](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x2a')]);router[_0x0236('0xb')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller['getSmsAccounts']);router[_0x0236('0xb')](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x2d')]);router[_0x0236('0xb')](_0x0236('0x2e'),auth['isAuthenticated'](),controller[_0x0236('0x2f')]);router[_0x0236('0xb')](_0x0236('0x30'),auth[_0x0236('0x9')](),controller['getSquareProjects']);router[_0x0236('0xb')](_0x0236('0x31'),auth[_0x0236('0x9')](),controller[_0x0236('0x32')]);router[_0x0236('0xb')](_0x0236('0x33'),auth[_0x0236('0x9')](),controller[_0x0236('0x34')]);router[_0x0236('0x35')](_0x0236('0x36'),auth[_0x0236('0x9')](),controller[_0x0236('0x37')]);router[_0x0236('0x35')]('/',auth[_0x0236('0x9')](),controller[_0x0236('0x38')]);router[_0x0236('0x35')](_0x0236('0x39'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x0236('0x35')](_0x0236('0x3a'),auth[_0x0236('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x0236('0x3b')]({'destination':function(_0x3cde48,_0x4bf7ee,_0x5d280d){_0x5d280d(null,path[_0x0236('0x3c')](config[_0x0236('0x3d')],'server/files/images/'));},'filename':function(_0x187503,_0x215e97,_0x48cf2b){_0x48cf2b(null,util['format'](_0x0236('0x3e'),Date[_0x0236('0x3f')](),_0x215e97[_0x0236('0x40')]));}})});router[_0x0236('0x35')](_0x0236('0x41'),upload[_0x0236('0x42')]('file'),controller[_0x0236('0x43')]);router[_0x0236('0x35')](_0x0236('0x44'),auth[_0x0236('0x9')](),controller['login']);router[_0x0236('0x35')](_0x0236('0x45'),auth['isAuthenticated'](),controller['logout']);router['post']('/:id/pause',auth[_0x0236('0x9')](),controller[_0x0236('0x46')]);router[_0x0236('0x35')](_0x0236('0x47'),auth['isAuthenticated'](),controller[_0x0236('0x48')]);router['post']('/:id/teams',auth[_0x0236('0x9')](),controller[_0x0236('0x49')]);router[_0x0236('0x35')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x0236('0x4a')]);router[_0x0236('0x35')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x0236('0x4b')]);router[_0x0236('0x35')](_0x0236('0x4c'),auth[_0x0236('0x9')](),controller['addFaxInteractions']);router[_0x0236('0x35')]('/:id/sms_interactions',auth[_0x0236('0x9')](),controller['addSmsInteractions']);router[_0x0236('0x35')](_0x0236('0x4d'),auth[_0x0236('0x9')](),controller[_0x0236('0x4e')]);router[_0x0236('0x35')](_0x0236('0x4f'),auth[_0x0236('0x9')](),controller['addWhatsappInteractions']);router[_0x0236('0x35')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0236('0x50')]);router[_0x0236('0x35')]('/:id/mail_accounts',auth[_0x0236('0x9')](),controller[_0x0236('0x51')]);router[_0x0236('0x35')](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x52')]);router[_0x0236('0x35')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller[_0x0236('0x53')]);router['post'](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x54')]);router[_0x0236('0x35')](_0x0236('0x2e'),auth[_0x0236('0x9')](),controller[_0x0236('0x55')]);router[_0x0236('0x35')](_0x0236('0x30'),auth['isAuthenticated'](),controller[_0x0236('0x56')]);router[_0x0236('0x35')]('/:id/api_key',auth[_0x0236('0x9')](),controller[_0x0236('0x57')]);router['put'](_0x0236('0xe'),auth['isAuthenticated'](),controller[_0x0236('0x58')]);router[_0x0236('0x59')](_0x0236('0x5a'),auth['isAuthenticated'](),controller[_0x0236('0x5b')]);router[_0x0236('0x5c')](_0x0236('0x3a'),auth[_0x0236('0x9')](),controller[_0x0236('0x5d')]);router[_0x0236('0x5c')](_0x0236('0x20'),auth[_0x0236('0x9')](),controller[_0x0236('0x5e')]);router[_0x0236('0x5c')](_0x0236('0xe'),auth[_0x0236('0x9')](),controller[_0x0236('0x5f')]);router[_0x0236('0x5c')](_0x0236('0x60'),auth[_0x0236('0x9')](),controller['removeChatInteractions']);router[_0x0236('0x5c')]('/:id/mail_interactions',auth[_0x0236('0x9')](),controller[_0x0236('0x61')]);router[_0x0236('0x5c')](_0x0236('0x4c'),auth[_0x0236('0x9')](),controller[_0x0236('0x62')]);router['delete'](_0x0236('0x63'),auth[_0x0236('0x9')](),controller['removeSmsInteractions']);router['delete'](_0x0236('0x4d'),auth['isAuthenticated'](),controller[_0x0236('0x64')]);router[_0x0236('0x5c')](_0x0236('0x4f'),auth['isAuthenticated'](),controller[_0x0236('0x65')]);router[_0x0236('0x5c')](_0x0236('0x26'),auth['isAuthenticated'](),controller[_0x0236('0x66')]);router[_0x0236('0x5c')](_0x0236('0x27'),auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x67')]);router[_0x0236('0x5c')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller[_0x0236('0x68')]);router[_0x0236('0x5c')](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x69')]);router[_0x0236('0x5c')](_0x0236('0x2e'),auth[_0x0236('0x9')](),controller[_0x0236('0x6a')]);router[_0x0236('0x5c')](_0x0236('0x30'),auth['isAuthenticated'](),controller[_0x0236('0x6b')]);router[_0x0236('0x5c')](_0x0236('0x33'),auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 3810ead..c3ce4ce 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 _0x002d=['dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','join','transport','split','info','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]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','originate','uac','uas','fingerprint','passive','update,nonat','showWebBar','get','isArray','encryption','avpf','force_avp','icesupport'];(function(_0x21132b,_0x22be81){var _0x2cda23=function(_0xbbb2ef){while(--_0xbbb2ef){_0x21132b['push'](_0x21132b['shift']());}};_0x2cda23(++_0x22be81);}(_0x002d,0xca));var _0xd002=function(_0x5d4532,_0x37eb99){_0x5d4532=_0x5d4532-0x0;var _0x3f19f7=_0x002d[_0x5d4532];return _0x3f19f7;};'use strict';var Sequelize=require(_0xd002('0x0'));var moment=require(_0xd002('0x1'));var util=require(_0xd002('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'unique':_0xd002('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1c0d0a){this[_0xd002('0x5')](_0xd002('0x4'),_0x1c0d0a);this[_0xd002('0x5')](_0xd002('0x6'),_0x1c0d0a);},'comment':_0xd002('0x7')},'fullname':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'set':function(_0x3711b0){this[_0xd002('0x5')](_0xd002('0x8'),_0x3711b0);this[_0xd002('0x5')](_0xd002('0x9'),util[_0xd002('0xa')](_0xd002('0xb'),_0x3711b0,this[_0xd002('0xc')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'unique':_0xd002('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2be09b){if(_0x2be09b){this['setDataValue'](_0xd002('0xd'),_0x2be09b[_0xd002('0xe')]());}}},'role':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x10'),_0xd002('0x11'),_0xd002('0x12'),_0xd002('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd002('0x3')],'defaultValue':_0xd002('0x14')},'internal':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':![],'unique':_0xd002('0x16'),'set':function(_0x3cbe14){this[_0xd002('0x5')]('internal',_0x3cbe14);this['setDataValue']('accountcode',_0x3cbe14);this[_0xd002('0x5')]('callerid',util[_0xd002('0xa')](_0xd002('0xb'),this[_0xd002('0xc')](_0xd002('0x8')),_0x3cbe14));}},'salt':{'type':Sequelize[_0xd002('0x3')]},'phone':{'type':Sequelize[_0xd002('0x3')]},'mobile':{'type':Sequelize[_0xd002('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xd002('0x3')]},'userpic':{'type':Sequelize[_0xd002('0x3')]},'city':{'type':Sequelize[_0xd002('0x3')]},'country':{'type':Sequelize[_0xd002('0x3')]},'online':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xd002('0x18')},'lastPauseAt':{'type':Sequelize[_0xd002('0x19')]},'chatCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd002('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd002('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x1a'),_0xd002('0x11'),_0xd002('0x1b')),'allowNull':!![],'defaultValue':_0xd002('0x1a')},'context':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![],'defaultValue':_0xd002('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0xd002('0x1d'),_0xd002('0x1e'),_0xd002('0x1f'),_0xd002('0x20'),'PROHIB_NOT_SCREENED',_0xd002('0x21'),'PROHIB_FAILED_SCREEN',_0xd002('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![],'defaultValue':_0xd002('0x23'),'set':function(_0x160d12){this[_0xd002('0x5')]('transport',_0x160d12?_0x160d12[_0xd002('0x24')](','):null);},'get':function(){return this[_0xd002('0xc')](_0xd002('0x25'))?this[_0xd002('0xc')](_0xd002('0x25'))[_0xd002('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xd002('0x27'),'shortinfo',_0xd002('0x28'),_0xd002('0x29')),'allowNull':!![],'defaultValue':_0xd002('0x2a')},'directmedia':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no',_0xd002('0x2c'),_0xd002('0x2d'),_0xd002('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd002('0x2f'),'set':function(_0x21911b){this[_0xd002('0x5')](_0xd002('0x30'),_0x21911b?_0x21911b['join'](','):null);},'get':function(){return this[_0xd002('0xc')]('nat')?this[_0xd002('0xc')](_0xd002('0x30'))[_0xd002('0x26')](','):null;},'comment':_0xd002('0x31')},'callgroup':{'type':Sequelize[_0xd002('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xd002('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xd002('0x3')]},'language':{'type':Sequelize[_0xd002('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd002('0x3')]},'disallow':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'defaultValue':_0xd002('0x32')},'allow':{'type':Sequelize[_0xd002('0x3')],'allowNull':![],'defaultValue':_0xd002('0x33'),'set':function(_0x2693a9){this[_0xd002('0x5')](_0xd002('0x34'),_0x2693a9?_0x2693a9[_0xd002('0x24')](';'):_0xd002('0x33'));},'get':function(){return this[_0xd002('0xc')](_0xd002('0x34'))?this[_0xd002('0xc')]('allow')[_0xd002('0x26')](';'):null;},'comment':_0xd002('0x35')},'autoframing':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2f31eb){this[_0xd002('0x5')]('insecure',_0x2f31eb?_0x2f31eb['join'](','):null);},'get':function(){return this[_0xd002('0xc')](_0xd002('0x36'))?this[_0xd002('0xc')]('insecure')[_0xd002('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd002('0xf')]('yes','no',_0xd002('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd002('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd002('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no',_0xd002('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x39'),'refuse',_0xd002('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x3b'),_0xd002('0x3c')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xd002('0x2b')},'keepalive':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd002('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no',_0xd002('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd002('0xf')]('active',_0xd002('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd002('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xd002('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no',_0xd002('0x2c'),_0xd002('0x2d'),_0xd002('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd002('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xd002('0x19')]},'passwordResetAt':{'type':Sequelize[_0xd002('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0,'set':function(_0x2d01f5){this['setDataValue'](_0xd002('0x40'),_0x2d01f5);var _0x1941b4=this[_0xd002('0x41')]({'plain':!![]});switch(_0x2d01f5){case 0x0:case 0x1:var _0x98996c=_0x1941b4['transport']?_[_0xd002('0x42')](_0x1941b4[_0xd002('0x25')])?_0x1941b4[_0xd002('0x25')]['join']():_0x1941b4[_0xd002('0x25')]:_0xd002('0x23');if(_0x98996c==='wss'){_0x98996c='udp';}this[_0xd002('0x5')]('transport',_0x98996c);this[_0xd002('0x5')](_0xd002('0x43'),'no');this[_0xd002('0x5')](_0xd002('0x44'),null);this['setDataValue'](_0xd002('0x45'),null);this[_0xd002('0x5')](_0xd002('0x46'),null);this['setDataValue'](_0xd002('0x47'),null);this[_0xd002('0x5')](_0xd002('0x48'),null);this['setDataValue'](_0xd002('0x49'),null);this['setDataValue'](_0xd002('0x4a'),null);this[_0xd002('0x5')]('dtlsprivatekey',null);this['setDataValue'](_0xd002('0x4b'),'no');break;case 0x2:this['setDataValue'](_0xd002('0x25'),'wss');this[_0xd002('0x5')](_0xd002('0x43'),_0xd002('0x2b'));this['setDataValue'](_0xd002('0x44'),'yes');this[_0xd002('0x5')](_0xd002('0x45'),_0xd002('0x2b'));this[_0xd002('0x5')]('icesupport',_0xd002('0x2b'));this[_0xd002('0x5')]('dtlsenable',_0xd002('0x2b'));this['setDataValue']('dtlsverify','no');this['setDataValue'](_0xd002('0x49'),_0xd002('0x4c'));this[_0xd002('0x5')]('dtlscertfile',_0x1941b4[_0xd002('0x4a')]||_0xd002('0x4d'));this[_0xd002('0x5')](_0xd002('0x4e'),_0x1941b4[_0xd002('0x4e')]||_0xd002('0x4f'));this[_0xd002('0x5')]('rtcp_mux',_0xd002('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xd002('0x50')],'set':function(_0x1fda85){this[_0xd002('0x5')](_0xd002('0x51'),_0x1fda85?_0x1fda85[_0xd002('0x24')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0xd002('0xc')]('permissions')[_0xd002('0x26')](','),function(_0x539b75){return parseInt(_0x539b75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd002('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xd002('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd002('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd002('0xf')](_0xd002('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd002('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd002('0x52')],'get':function(){return this[_0xd002('0xc')](_0xd002('0x53'))?this[_0xd002('0xc')](_0xd002('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd002('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd002('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![],'set':function(_0x38581b){if(typeof _0x38581b===_0xd002('0x54')){var _0x324bee=_0x38581b==='1'?!![]:_0x38581b==='0'?![]:_0x38581b===_0xd002('0x55')?!![]:_0x38581b===_0xd002('0x56')?![]:![];this[_0xd002('0x5')](_0xd002('0x57'),_0x324bee);}else{this[_0xd002('0x5')](_0xd002('0x57'),_0x38581b);}}},'blocked':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![],'set':function(_0x3b632f){this[_0xd002('0x5')]('blocked',_0x3b632f);if(_0x3b632f===!![]){this[_0xd002('0x5')](_0xd002('0x58'),moment());this[_0xd002('0x5')](_0xd002('0x59'),0x0);}else{this[_0xd002('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd002('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd002('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd002('0x15')](0x5)[_0xd002('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd002('0x17')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcaaf=['permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','insecure','never','\x22\x22\x20<>','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','isArray','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','icesupport','/etc/pki/tls/private/motion.key'];(function(_0x259654,_0x179858){var _0x1b1411=function(_0x43e05f){while(--_0x43e05f){_0x259654['push'](_0x259654['shift']());}};_0x1b1411(++_0x179858);}(_0xcaaf,0x66));var _0xfcaa=function(_0x3db4e9,_0x47e6ec){_0x3db4e9=_0x3db4e9-0x0;var _0x18601c=_0xcaaf[_0x3db4e9];return _0x18601c;};'use strict';var Sequelize=require(_0xfcaa('0x0'));var moment=require('moment');var util=require(_0xfcaa('0x1'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'unique':_0xfcaa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4b8844){this[_0xfcaa('0x4')]('name',_0x4b8844);this['setDataValue'](_0xfcaa('0x5'),_0x4b8844);},'comment':_0xfcaa('0x6')},'fullname':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'set':function(_0x28a6b6){this[_0xfcaa('0x4')](_0xfcaa('0x7'),_0x28a6b6);this[_0xfcaa('0x4')]('callerid',util[_0xfcaa('0x8')]('\x22%s\x22\x20<%s>',_0x28a6b6,this[_0xfcaa('0x9')]('internal')));}},'alias':{'type':Sequelize[_0xfcaa('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x345e39){if(_0x345e39){this['setDataValue'](_0xfcaa('0xa'),_0x345e39[_0xfcaa('0xb')]());}}},'role':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0xd'),_0xfcaa('0xe'),_0xfcaa('0xf'),_0xfcaa('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xfcaa('0x11')},'internal':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':![],'unique':_0xfcaa('0x13'),'set':function(_0x46181e){this['setDataValue'](_0xfcaa('0x13'),_0x46181e);this[_0xfcaa('0x4')](_0xfcaa('0x14'),_0x46181e);this[_0xfcaa('0x4')]('callerid',util[_0xfcaa('0x8')](_0xfcaa('0x15'),this[_0xfcaa('0x9')]('fullname'),_0x46181e));}},'salt':{'type':Sequelize[_0xfcaa('0x2')]},'phone':{'type':Sequelize[_0xfcaa('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xfcaa('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfcaa('0x2')]},'country':{'type':Sequelize[_0xfcaa('0x2')]},'online':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfcaa('0x17')]},'voicePause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':_0xfcaa('0x18')},'lastPauseAt':{'type':Sequelize[_0xfcaa('0x17')]},'chatCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfcaa('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfcaa('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x19')},'ipaddr':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0xfcaa('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xfcaa('0x1a'),_0xfcaa('0xe'),'peer'),'allowNull':!![],'defaultValue':_0xfcaa('0x1a')},'context':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xfcaa('0xc')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xfcaa('0x1b'),_0xfcaa('0x1c'),_0xfcaa('0x1d'),_0xfcaa('0x1e'),'PROHIB_FAILED_SCREEN',_0xfcaa('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x20'),'set':function(_0x2b2a2d){this['setDataValue'](_0xfcaa('0x21'),_0x2b2a2d?_0x2b2a2d[_0xfcaa('0x22')](','):null);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x21'))?this['getDataValue'](_0xfcaa('0x21'))['split'](','):null;},'comment':_0xfcaa('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0xfcaa('0x24'),_0xfcaa('0x25'),_0xfcaa('0x26'),_0xfcaa('0x27'),_0xfcaa('0x28')),'allowNull':!![],'defaultValue':_0xfcaa('0x24')},'directmedia':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no',_0xfcaa('0x2a'),_0xfcaa('0x2b'),_0xfcaa('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x2d'),'set':function(_0x37b7b4){this[_0xfcaa('0x4')](_0xfcaa('0x2e'),_0x37b7b4?_0x37b7b4[_0xfcaa('0x22')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xfcaa('0x9')]('nat')[_0xfcaa('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xfcaa('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfcaa('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xfcaa('0x2')]},'language':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfcaa('0x2')]},'disallow':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':_0xfcaa('0x30')},'allow':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':_0xfcaa('0x31'),'set':function(_0x572ae3){this[_0xfcaa('0x4')](_0xfcaa('0x32'),_0x572ae3?_0x572ae3[_0xfcaa('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x32'))?this[_0xfcaa('0x9')](_0xfcaa('0x32'))[_0xfcaa('0x2f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'set':function(_0x3c7424){this[_0xfcaa('0x4')]('insecure',_0x3c7424?_0x3c7424['join'](','):null);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x33'))?this['getDataValue'](_0xfcaa('0x33'))[_0xfcaa('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no',_0xfcaa('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfcaa('0x35')},'amaflags':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfcaa('0x29')},'busylevel':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfcaa('0xc')]('accept',_0xfcaa('0x36'),_0xfcaa('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x38'),_0xfcaa('0x39')),'allowNull':!![],'defaultValue':_0xfcaa('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfcaa('0x29')},'keepalive':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no',_0xfcaa('0x3a'),_0xfcaa('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfcaa('0xc')]('active',_0xfcaa('0x3c'),_0xfcaa('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no',_0xfcaa('0x2a'),_0xfcaa('0x2b'),_0xfcaa('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xfcaa('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfcaa('0x3f')]},'showWebBar':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0,'set':function(_0x30beba){this[_0xfcaa('0x4')](_0xfcaa('0x40'),_0x30beba);var _0x8b1f43=this['get']({'plain':!![]});switch(_0x30beba){case 0x0:case 0x1:var _0x4f324b=_0x8b1f43[_0xfcaa('0x21')]?_[_0xfcaa('0x41')](_0x8b1f43['transport'])?_0x8b1f43[_0xfcaa('0x21')]['join']():_0x8b1f43[_0xfcaa('0x21')]:_0xfcaa('0x20');if(_0x4f324b==='wss'){_0x4f324b=_0xfcaa('0x20');}this[_0xfcaa('0x4')]('transport',_0x4f324b);this[_0xfcaa('0x4')]('encryption','no');this[_0xfcaa('0x4')](_0xfcaa('0x42'),null);this['setDataValue'](_0xfcaa('0x43'),null);this[_0xfcaa('0x4')]('icesupport',null);this[_0xfcaa('0x4')](_0xfcaa('0x44'),null);this[_0xfcaa('0x4')](_0xfcaa('0x45'),null);this[_0xfcaa('0x4')](_0xfcaa('0x46'),null);this[_0xfcaa('0x4')](_0xfcaa('0x47'),null);this[_0xfcaa('0x4')](_0xfcaa('0x48'),null);this['setDataValue'](_0xfcaa('0x49'),'no');break;case 0x2:this[_0xfcaa('0x4')](_0xfcaa('0x21'),_0xfcaa('0x4a'));this[_0xfcaa('0x4')](_0xfcaa('0x4b'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x42'),_0xfcaa('0x29'));this['setDataValue'](_0xfcaa('0x43'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x4c'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x44'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x45'),'no');this[_0xfcaa('0x4')]('dtlssetup','actpass');this[_0xfcaa('0x4')](_0xfcaa('0x47'),_0x8b1f43[_0xfcaa('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0xfcaa('0x4')](_0xfcaa('0x48'),_0x8b1f43[_0xfcaa('0x48')]||_0xfcaa('0x4d'));this[_0xfcaa('0x4')](_0xfcaa('0x49'),_0xfcaa('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xfcaa('0x3f')],'set':function(_0x21d202){this[_0xfcaa('0x4')](_0xfcaa('0x4e'),_0x21d202?_0x21d202['join'](','):[]);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x4e'))?_[_0xfcaa('0x4f')](this[_0xfcaa('0x9')](_0xfcaa('0x4e'))[_0xfcaa('0x2f')](','),function(_0x235f91){return parseInt(_0x235f91,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfcaa('0x50')],'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x51'))?this[_0xfcaa('0x9')](_0xfcaa('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![],'set':function(_0x434cbf){if(typeof _0x434cbf===_0xfcaa('0x52')){var _0x204fe4=_0x434cbf==='1'?!![]:_0x434cbf==='0'?![]:_0x434cbf===_0xfcaa('0x53')?!![]:_0x434cbf===_0xfcaa('0x54')?![]:![];this[_0xfcaa('0x4')](_0xfcaa('0x55'),_0x204fe4);}else{this[_0xfcaa('0x4')](_0xfcaa('0x55'),_0x434cbf);}}},'blocked':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![],'set':function(_0x51747a){this[_0xfcaa('0x4')](_0xfcaa('0x56'),_0x51747a);if(_0x51747a===!![]){this[_0xfcaa('0x4')](_0xfcaa('0x57'),moment());this[_0xfcaa('0x4')](_0xfcaa('0x58'),0x0);}else{this[_0xfcaa('0x4')](_0xfcaa('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xfcaa('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfcaa('0x12')](0x5)[_0xfcaa('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 86b9ea3..90c07eb 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 _0xbcf1=['resolve','pause','PAUSE','updateAttributes','getChannels','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','QueuePause','unpause','manual','set','Pause','Team','addTeams','setDataValue','Voice','Mail','getSmsQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','getChatQueues','Chat','Sms','flatten','removeAgent','VoicePrefixId','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','lastName','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','getPresence','teams','isEmpty','queues','inbound','lower','col','toString','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','voiceStatus','busy','toUpperCase','slice','SELECT','select','field','ui.','ui.createdAt','user_has_','_interactions','moment','util','path','lodash','squel','jayson/promise','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','defaults','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','Content-Range','json','update','destroy','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','map','value','includes','find','stack','name','send','index','User','rawAttributes','type','key','password','salt','getOptions','query','includeAll','include','attributes','push','findAll','rows','openTabs','true','length','chat','dataValues','sms','fax','mail','whatsapp','all','show','params','keys','filters','intersection','model','fields','options','openchannel','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','fullname','email','permissions','101','102','103','113','110','104','106','107','109','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','VoiceMail','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','compact','changePassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','oldPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','get','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','sort','where','pick','merge','hasOwnProperty','List','Tags','color','tag','nolimit','limit','getQueues','Queue','order','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','LOCAL/%s@from-sip/n','intrf','user:%s','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','LOGIN','LOGININPAUSE','bulkCreate','concat','YYYY-MM-DD\x20HH:mm:ss','isMiddleware'];(function(_0x4f0dca,_0x291bdf){var _0x333166=function(_0x136403){while(--_0x136403){_0x4f0dca['push'](_0x4f0dca['shift']());}};_0x333166(++_0x291bdf);}(_0xbcf1,0x97));var _0x1bcf=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xbcf1[_0x11a220];return _0x20d8fe;};'use strict';var moment=require(_0x1bcf('0x0'));var BPromise=require('bluebird');var util=require(_0x1bcf('0x1'));var path=require(_0x1bcf('0x2'));var fs=require('fs');var _=require(_0x1bcf('0x3'));var squel=require(_0x1bcf('0x4'));var jayson=require(_0x1bcf('0x5'));var Redis=require('ioredis');var authService=require(_0x1bcf('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1bcf('0x7'));var utils=require(_0x1bcf('0x8'));var config=require(_0x1bcf('0x9'));var licenseUtil=require(_0x1bcf('0xa'));var db=require(_0x1bcf('0xb'))['db'];var socket=require(_0x1bcf('0xc'))(new Redis(config[_0x1bcf('0xd')]));require('./user.socket')[_0x1bcf('0xe')](socket);config['redis']=_[_0x1bcf('0xf')](config[_0x1bcf('0xd')],{'host':'localhost','port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x33fbf2,_0x33bd5c,_0x3b22bc,_0xb28b8c){return new BPromise(function(_0x28f8ef,_0x2b4cce){var _0x3c4e99=_0xb28b8c||client;return _0x3c4e99[_0x1bcf('0x10')](_0x33fbf2,_0x3b22bc)[_0x1bcf('0x11')](function(_0x11dcb3){logger[_0x1bcf('0x12')](_0x1bcf('0x13'),_0x33bd5c,'request\x20sent');logger['debug'](_0x1bcf('0x14'),_0x33bd5c,_0x1bcf('0x15'),JSON[_0x1bcf('0x16')](_0x11dcb3));if(_0x11dcb3['error']){if(_0x11dcb3[_0x1bcf('0x17')][_0x1bcf('0x18')]===0x1f4){logger[_0x1bcf('0x17')](_0x1bcf('0x13'),_0x33bd5c,_0x11dcb3[_0x1bcf('0x17')][_0x1bcf('0x19')]);return _0x2b4cce(_0x11dcb3[_0x1bcf('0x17')]['message']);}logger[_0x1bcf('0x17')]('User,\x20%s,\x20%s',_0x33bd5c,_0x11dcb3[_0x1bcf('0x17')][_0x1bcf('0x19')]);return _0x28f8ef(_0x11dcb3[_0x1bcf('0x17')][_0x1bcf('0x19')]);}else{logger[_0x1bcf('0x12')]('User,\x20%s,\x20%s',_0x33bd5c,'request\x20sent');_0x28f8ef(_0x11dcb3[_0x1bcf('0x1a')]['message']);}})[_0x1bcf('0x1b')](function(_0x447b28){logger[_0x1bcf('0x17')](_0x1bcf('0x13'),_0x33bd5c,_0x447b28);_0x2b4cce(_0x447b28);});});}function respondWithStatusCode(_0x14b976,_0x2783e6){_0x2783e6=_0x2783e6||0xcc;return function(_0x3a6400){if(_0x3a6400){return _0x14b976[_0x1bcf('0x1c')](_0x2783e6);}return _0x14b976[_0x1bcf('0x1d')](_0x2783e6)[_0x1bcf('0x1e')]();};}function respondWithResult(_0x5d5a91,_0x1f65e9){_0x1f65e9=_0x1f65e9||0xc8;return function(_0x462c45){if(_0x462c45){return _0x5d5a91['status'](_0x1f65e9)['json'](_0x462c45);}};}function respondWithFilteredResult(_0x11f22c,_0x313b5c){return function(_0x1a8aff){if(_0x1a8aff){var _0x306db6=typeof _0x313b5c[_0x1bcf('0x1f')]===_0x1bcf('0x20')&&typeof _0x313b5c['limit']===_0x1bcf('0x20');var _0x38eea5=_0x1a8aff[_0x1bcf('0x21')];var _0x543196=_0x306db6?0x0:_0x313b5c[_0x1bcf('0x1f')];var _0x539882=_0x306db6?_0x1a8aff[_0x1bcf('0x21')]:_0x313b5c[_0x1bcf('0x1f')]+_0x313b5c['limit'];var _0x331192;if(_0x539882>=_0x38eea5){_0x539882=_0x38eea5;_0x331192=0xc8;}else{_0x331192=0xce;}_0x11f22c[_0x1bcf('0x1d')](_0x331192);return _0x11f22c['set'](_0x1bcf('0x22'),_0x543196+'-'+_0x539882+'/'+_0x38eea5)[_0x1bcf('0x23')](_0x1a8aff);}return null;};}function saveUpdates(_0x32e5d5){return function(_0xd0e5eb){if(_0xd0e5eb){return _0xd0e5eb[_0x1bcf('0x24')](_0x32e5d5)[_0x1bcf('0x11')](function(_0x24e869){return _0x24e869;});}return null;};}function removeEntity(_0x3d40e0){return function(_0x28d2ed){if(_0x28d2ed){return _0x28d2ed[_0x1bcf('0x25')]()['then'](function(){var _0x35fa4c=_0x28d2ed['get']({'plain':!![]});if(_0x35fa4c[_0x1bcf('0x26')]===_0x1bcf('0x27'))return;var _0x27070f=[{'name':_0x1bcf('0x28'),'value':_0x1bcf('0x29'),'ignore':!![]},{'name':_0x1bcf('0x2a'),'value':_0x1bcf('0x2b'),'ignore':![]},{'name':_0x1bcf('0x2c'),'value':_0x1bcf('0x2d'),'ignore':![]}];var _0x4a8906=_(_0x27070f)[_0x1bcf('0x2e')]('ignore')[_0x1bcf('0x2f')](_0x1bcf('0x30'))[_0x1bcf('0x30')]();if(_[_0x1bcf('0x31')](_0x4a8906,_0x35fa4c['role'])){return;}var _0x1d0ba1=_[_0x1bcf('0x32')](_0x27070f,[_0x1bcf('0x30'),_0x35fa4c['role']])['name'];return db['UserProfileResource'][_0x1bcf('0x25')]({'where':{'type':_0x1d0ba1,'resourceId':_0x35fa4c['id']}})['then'](function(){return _0x28d2ed;});})[_0x1bcf('0x11')](function(){_0x3d40e0[_0x1bcf('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b31c3){return function(_0x3e4f2b){if(!_0x3e4f2b){_0x1b31c3[_0x1bcf('0x1c')](0x194);}return _0x3e4f2b;};}function handleError(_0x4f62dd,_0x51a0f7){_0x51a0f7=_0x51a0f7||0x1f4;return function(_0x44a3df){logger[_0x1bcf('0x17')](_0x44a3df[_0x1bcf('0x33')]);if(_0x44a3df[_0x1bcf('0x34')]){delete _0x44a3df[_0x1bcf('0x34')];}_0x4f62dd[_0x1bcf('0x1d')](_0x51a0f7)[_0x1bcf('0x35')](_0x44a3df);};}exports[_0x1bcf('0x36')]=function(_0x29e6b2,_0x4ace48){var _0x1567f5={},_0x371854={'count':0x0,'rows':[]};var _0x2b7216=_(db[_0x1bcf('0x37')][_0x1bcf('0x38')])[_0x1bcf('0x2f')](function(_0x4a33a5){return{'name':_0x4a33a5['fieldName'],'type':_0x4a33a5[_0x1bcf('0x39')][_0x1bcf('0x3a')]};})[_0x1bcf('0x2e')](function(_0x1b3755){return!_[_0x1bcf('0x31')]([_0x1bcf('0x3b'),_0x1bcf('0x3c')],_0x1b3755['name']);})[_0x1bcf('0x30')]();_0x1567f5=qs[_0x1bcf('0x3d')](_0x2b7216,_0x29e6b2);var _0x140488={'where':_0x1567f5['where']};return db[_0x1bcf('0x37')][_0x1bcf('0x21')](_0x140488)['then'](function(_0x36d4cf){_0x371854[_0x1bcf('0x21')]=_0x36d4cf;if(_0x29e6b2[_0x1bcf('0x3e')][_0x1bcf('0x3f')]){_0x1567f5[_0x1bcf('0x40')]=[{'all':!![]}];}if(!_[_0x1bcf('0x31')](_0x1567f5[_0x1bcf('0x41')],'id')){_0x1567f5[_0x1bcf('0x41')][_0x1bcf('0x42')]('id');}return db['User'][_0x1bcf('0x43')](_0x1567f5);})[_0x1bcf('0x11')](function(_0x494738){_0x371854[_0x1bcf('0x44')]=_0x494738;if(_0x29e6b2[_0x1bcf('0x3e')][_0x1bcf('0x45')]===_0x1bcf('0x46')){var _0x4beb69=[];for(var _0x1fdd4b=0x0;_0x1fdd4b<_0x371854[_0x1bcf('0x44')][_0x1bcf('0x47')];_0x1fdd4b++){_0x4beb69[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x48'),_0x371854[_0x1bcf('0x44')][_0x1fdd4b][_0x1bcf('0x49')]));_0x4beb69[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4a'),_0x371854['rows'][_0x1fdd4b][_0x1bcf('0x49')]));_0x4beb69['push'](get_open_tabs(_0x1bcf('0x4b'),_0x371854[_0x1bcf('0x44')][_0x1fdd4b][_0x1bcf('0x49')]));_0x4beb69[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4c'),_0x371854[_0x1bcf('0x44')][_0x1fdd4b][_0x1bcf('0x49')]));_0x4beb69['push'](get_open_tabs('openchannel',_0x371854[_0x1bcf('0x44')][_0x1fdd4b][_0x1bcf('0x49')]));_0x4beb69[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4d'),_0x371854[_0x1bcf('0x44')][_0x1fdd4b][_0x1bcf('0x49')]));}return BPromise[_0x1bcf('0x4e')](_0x4beb69)[_0x1bcf('0x11')](function(_0x52270d){return _0x371854;});}else{return _0x371854;}})[_0x1bcf('0x11')](respondWithFilteredResult(_0x4ace48,_0x1567f5))[_0x1bcf('0x1b')](handleError(_0x4ace48,null));};exports[_0x1bcf('0x4f')]=function(_0x2e43c8,_0x34308c){var _0x102ef9={'raw':![],'where':{'id':_0x2e43c8[_0x1bcf('0x50')]['id']}},_0x33aedb={};_0x33aedb['model']=_['differenceBy'](_[_0x1bcf('0x51')](db[_0x1bcf('0x37')][_0x1bcf('0x38')]),[_0x1bcf('0x3b'),_0x1bcf('0x3c')]);_0x33aedb['query']=_[_0x1bcf('0x51')](_0x2e43c8[_0x1bcf('0x3e')]);_0x33aedb[_0x1bcf('0x52')]=_[_0x1bcf('0x53')](_0x33aedb[_0x1bcf('0x54')],_0x33aedb[_0x1bcf('0x3e')]);_0x102ef9[_0x1bcf('0x41')]=_[_0x1bcf('0x53')](_0x33aedb[_0x1bcf('0x54')],qs[_0x1bcf('0x55')](_0x2e43c8[_0x1bcf('0x3e')]['fields']));_0x102ef9['attributes']=_0x102ef9[_0x1bcf('0x41')][_0x1bcf('0x47')]?_0x102ef9[_0x1bcf('0x41')]:_0x33aedb['model'];if(_0x2e43c8[_0x1bcf('0x3e')][_0x1bcf('0x3f')]){_0x102ef9[_0x1bcf('0x40')]=[{'all':!![]}];}_0x102ef9=_['merge']({},_0x102ef9,_0x2e43c8[_0x1bcf('0x56')]);if(!_[_0x1bcf('0x31')](_0x102ef9[_0x1bcf('0x41')],'id')){_0x102ef9[_0x1bcf('0x41')][_0x1bcf('0x42')]('id');}return db[_0x1bcf('0x37')][_0x1bcf('0x32')](_0x102ef9)[_0x1bcf('0x11')](handleEntityNotFound(_0x34308c,null))[_0x1bcf('0x11')](function(_0x25f129){var _0x2036e9=[];values=_0x25f129;if(_0x2e43c8[_0x1bcf('0x3e')][_0x1bcf('0x45')]==='true'){_0x2036e9['push'](get_open_tabs(_0x1bcf('0x48'),_0x25f129[_0x1bcf('0x49')]));_0x2036e9[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4a'),_0x25f129[_0x1bcf('0x49')]));_0x2036e9[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x57'),_0x25f129[_0x1bcf('0x49')]));_0x2036e9[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4d'),_0x25f129[_0x1bcf('0x49')]));_0x2036e9['push'](get_open_tabs('fax',_0x25f129[_0x1bcf('0x49')]));_0x2036e9['push'](get_open_tabs(_0x1bcf('0x4c'),_0x25f129['dataValues']));return BPromise[_0x1bcf('0x4e')](_0x2036e9);}else{return values;}})[_0x1bcf('0x11')](function(_0x74bed6){return values;})[_0x1bcf('0x11')](respondWithResult(_0x34308c,null))['catch'](handleError(_0x34308c,null));};exports['update']=function(_0x233595,_0x37f3cc){if(_0x233595[_0x1bcf('0x58')]['id']){delete _0x233595[_0x1bcf('0x58')]['id'];}delete _0x233595[_0x1bcf('0x58')][_0x1bcf('0x26')];return db[_0x1bcf('0x37')][_0x1bcf('0x32')]({'where':{'id':_0x233595[_0x1bcf('0x50')]['id']}})[_0x1bcf('0x11')](handleEntityNotFound(_0x37f3cc,null))[_0x1bcf('0x11')](saveUpdates(_0x233595[_0x1bcf('0x58')],null))[_0x1bcf('0x11')](respondWithResult(_0x37f3cc,null))[_0x1bcf('0x1b')](handleError(_0x37f3cc,null));};exports['describe']=function(_0x100d3f,_0x29d7be){return db[_0x1bcf('0x37')][_0x1bcf('0x59')]()['then'](respondWithResult(_0x29d7be,null))[_0x1bcf('0x1b')](handleError(_0x29d7be,null));};exports[_0x1bcf('0x5a')]=function(_0x437424,_0x519c77){return db[_0x1bcf('0x37')][_0x1bcf('0x32')]({'where':{'id':_0x437424[_0x1bcf('0x50')]['id']}})[_0x1bcf('0x11')](handleEntityNotFound(_0x519c77,null))[_0x1bcf('0x11')](function(_0x463301){if(_0x463301){return _0x463301[_0x1bcf('0x5a')](_0x437424[_0x1bcf('0x58')][_0x1bcf('0x5b')],_[_0x1bcf('0x5c')](_0x437424[_0x1bcf('0x58')],[_0x1bcf('0x5b'),'id'])||{});}})[_0x1bcf('0x11')](respondWithResult(_0x519c77,null))[_0x1bcf('0x1b')](handleError(_0x519c77,null));};function validateUser(_0x337464){return new BPromise(function(_0x48d0ec,_0x477f1e){if(_0x337464[_0x1bcf('0x5d')])return _0x48d0ec(_0x337464);return db['Setting'][_0x1bcf('0x5e')](0x1)[_0x1bcf('0x11')](function(_0x24475a){if(_0x24475a[_0x1bcf('0x5f')])authService[_0x1bcf('0x60')](_0x337464[_0x1bcf('0x3b')]);db[_0x1bcf('0x37')][_0x1bcf('0x61')]('internal')[_0x1bcf('0x11')](function(_0x5bb88c){if(_[_0x1bcf('0x62')](_0x5bb88c)){_0x337464[_0x1bcf('0x5d')]=_0x24475a[_0x1bcf('0x63')]||0x1;return;}if(_[_0x1bcf('0x62')](_0x24475a[_0x1bcf('0x63')])||_0x24475a[_0x1bcf('0x63')]===_0x5bb88c){_0x337464[_0x1bcf('0x5d')]=_0x5bb88c+0x1;return;}if(_0x24475a[_0x1bcf('0x63')]>_0x5bb88c){_0x337464[_0x1bcf('0x5d')]=_0x24475a['min_internal'];return;}return db[_0x1bcf('0x64')][_0x1bcf('0x3e')](_0x1bcf('0x65'),{'type':db['sequelize'][_0x1bcf('0x66')]['SELECT']})['then'](function(_0x1f452c){if(_0x1f452c&&_0x1f452c[_0x1bcf('0x47')]){for(var _0x4e1410=0x0,_0x1854d4=_0x1f452c[_0x1bcf('0x47')];_0x4e1410<_0x1854d4&&_[_0x1bcf('0x62')](_0x337464[_0x1bcf('0x5d')]);_0x4e1410++){if(_0x24475a[_0x1bcf('0x63')]<=_0x1f452c[_0x4e1410][_0x1bcf('0x67')]){_0x337464['internal']=_0x1f452c[_0x4e1410][_0x1bcf('0x67')];}else if(_0x24475a['min_internal']>_0x1f452c[_0x4e1410][_0x1bcf('0x67')]&&_0x24475a[_0x1bcf('0x63')]<=_0x1f452c[_0x4e1410]['to']){_0x337464[_0x1bcf('0x5d')]=_0x24475a['min_internal'];}}}if(_[_0x1bcf('0x62')](_0x337464[_0x1bcf('0x5d')])){_0x337464['internal']=_0x5bb88c+0x1;}return _0x48d0ec(_0x337464);});});})[_0x1bcf('0x1b')](function(_0x2008f3){_0x477f1e(_0x2008f3);});});}function updateUser(_0x4a0c6f){return new BPromise(function(_0x9d0a7f,_0x19f80c){try{if(_0x4a0c6f['voicemail']){_0x4a0c6f['mailbox']=_0x4a0c6f[_0x1bcf('0x5d')];_0x4a0c6f['VoiceMail']={'mailbox':_0x4a0c6f[_0x1bcf('0x5d')],'password':_0x4a0c6f[_0x1bcf('0x3b')],'fullname':_0x4a0c6f[_0x1bcf('0x68')],'email':_0x4a0c6f[_0x1bcf('0x69')]};}if(_0x4a0c6f[_0x1bcf('0x26')]===_0x1bcf('0x2b')){if(!_0x4a0c6f[_0x1bcf('0x6a')])_0x4a0c6f[_0x1bcf('0x6a')]=[_0x1bcf('0x6b'),_0x1bcf('0x6c'),_0x1bcf('0x6d'),_0x1bcf('0x6e'),_0x1bcf('0x6f'),_0x1bcf('0x70'),'105',_0x1bcf('0x71'),_0x1bcf('0x72'),'108',_0x1bcf('0x73'),'100','111',_0x1bcf('0x74'),_0x1bcf('0x75')];}_0x9d0a7f(_0x4a0c6f);}catch(_0x56c350){_0x19f80c(_0x56c350);}});}exports['create']=function(_0x157cf8,_0x510afc){if(_0x157cf8[_0x1bcf('0x29')][_0x1bcf('0x26')]===_0x1bcf('0x2b'))throw new Error(_0x1bcf('0x76'));if(_0x157cf8[_0x1bcf('0x58')]['role']===_0x1bcf('0x29')&&_0x157cf8['user'][_0x1bcf('0x26')]!==_0x1bcf('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x157cf8[_0x1bcf('0x58')][_0x1bcf('0x26')]===_0x1bcf('0x27')&&_0x157cf8[_0x1bcf('0x29')][_0x1bcf('0x26')]!==_0x1bcf('0x27')){throw new Error(_0x1bcf('0x77'));}return licenseUtil[_0x1bcf('0x78')]([_0x157cf8[_0x1bcf('0x58')]])['then'](function(){return validateUser(_0x157cf8[_0x1bcf('0x58')]);})[_0x1bcf('0x11')](function(_0x460ce8){return updateUser(_0x460ce8)[_0x1bcf('0x11')](function(_0x176053){if(_0x176053[_0x1bcf('0x26')]===_0x1bcf('0x27')){_0x176053[_0x1bcf('0x79')]=_0x157cf8[_0x1bcf('0x29')][_0x1bcf('0x79')];delete _0x176053[_0x1bcf('0x7a')];}return _0x176053;});})[_0x1bcf('0x11')](function(_0x317ae4){return db[_0x1bcf('0x37')][_0x1bcf('0x7b')](_0x317ae4,{'include':[{'model':db[_0x1bcf('0x7c')],'as':_0x1bcf('0x7c')}]});})[_0x1bcf('0x11')](function(_0x548b5c){if(_0x157cf8[_0x1bcf('0x58')][_0x1bcf('0x26')]===_0x1bcf('0x29'))return _0x548b5c;if(_0x157cf8[_0x1bcf('0x29')]['role']!=='user')return _0x548b5c;return db['UserProfileSection']['find']({'where':{'name':_0x548b5c[_0x1bcf('0x26')]===_0x1bcf('0x2b')?_0x1bcf('0x2a'):'Telephones','userProfileId':_0x157cf8[_0x1bcf('0x29')][_0x1bcf('0x7a')]},'raw':!![]})[_0x1bcf('0x11')](function(_0x2bbc7d){if(!_0x2bbc7d||_0x2bbc7d[_0x1bcf('0x7d')]!=0x0)return _0x548b5c;return db[_0x1bcf('0x7e')][_0x1bcf('0x7b')]({'name':_0x548b5c['name'],'resourceId':_0x548b5c['id'],'type':_0x2bbc7d['name'],'sectionId':_0x2bbc7d['id']},{})[_0x1bcf('0x11')](function(){return _0x548b5c;});})[_0x1bcf('0x1b')](function(_0x3ac083){logger['error'](_0x1bcf('0x7f'),_0x3ac083);throw _0x3ac083;});})[_0x1bcf('0x11')](respondWithResult(_0x510afc,0xc9))[_0x1bcf('0x1b')](handleError(_0x510afc,null));};exports['bulkCreate']=function(_0x1f61e9,_0x3d128a){var _0x29c7ec=_0x1f61e9[_0x1bcf('0x58')];var _0x36300d=[];if(_0x1f61e9[_0x1bcf('0x29')][_0x1bcf('0x26')]===_0x1bcf('0x2b'))throw new Error(_0x1bcf('0x76'));if(_[_0x1bcf('0x80')](_0x29c7ec,[_0x1bcf('0x26'),_0x1bcf('0x29')])&&_0x1f61e9[_0x1bcf('0x29')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x1bcf('0x80')](_0x29c7ec,[_0x1bcf('0x26'),'admin'])&&_0x1f61e9['user'][_0x1bcf('0x26')]!==_0x1bcf('0x27')){throw new Error(_0x1bcf('0x81'));}return licenseUtil[_0x1bcf('0x78')](_0x29c7ec)[_0x1bcf('0x11')](function(){return validateUser(_0x29c7ec[0x0]);})['then'](function(){for(var _0x5f30de=0x1;_0x5f30de<_0x29c7ec[_0x1bcf('0x47')];_0x5f30de++){var _0x4562e0=_0x29c7ec[_0x5f30de-0x1][_0x1bcf('0x5d')];if(!_0x29c7ec[_0x5f30de][_0x1bcf('0x5d')])_0x29c7ec[_0x5f30de][_0x1bcf('0x5d')]=_0x4562e0+0x1;_0x36300d[_0x1bcf('0x42')](validateUser(_0x29c7ec[_0x5f30de]));}return BPromise[_0x1bcf('0x4e')](_0x36300d);})[_0x1bcf('0x11')](function(){_0x36300d=[];for(var _0x578427=0x0;_0x578427<_0x29c7ec[_0x1bcf('0x47')];_0x578427++){_0x36300d[_0x1bcf('0x42')](updateUser(_0x29c7ec[_0x578427]));}return BPromise[_0x1bcf('0x4e')](_0x36300d);})['then'](function(){return BPromise[_0x1bcf('0x82')](_0x29c7ec,function(_0x3165ed){return db[_0x1bcf('0x37')][_0x1bcf('0x7b')](_0x3165ed,{'include':[{'model':db[_0x1bcf('0x7c')],'as':_0x1bcf('0x7c')}]})[_0x1bcf('0x11')](function(_0x182184){_0x3165ed['id']=_0x182184['id'];return _0x3165ed;});});})['then'](function(_0x1cb852){if(_0x1f61e9[_0x1bcf('0x58')][_0x1bcf('0x26')]===_0x1bcf('0x29'))return _0x1cb852;if(_0x1f61e9[_0x1bcf('0x29')]['role']!=='user')return _0x1cb852;var _0x4eb9eb=_[_0x1bcf('0x80')](_0x1cb852,function(_0x4271e5){return _0x4271e5['role']===_0x1bcf('0x2b')||_0x4271e5[_0x1bcf('0x26')]===_0x1bcf('0x2d');});if(!_0x4eb9eb)return _0x1cb852;return db[_0x1bcf('0x83')]['findAll']({'where':{'name':{'$or':[_0x1bcf('0x2a'),_0x1bcf('0x2c')]},'userProfileId':_0x1f61e9[_0x1bcf('0x29')]['userProfileId']},'raw':!![]})[_0x1bcf('0x11')](function(_0x1723b1){if(_['isEmpty'](_0x1723b1)||!_[_0x1bcf('0x80')](_0x1723b1,[_0x1bcf('0x7d'),0x0]))return _0x1cb852;_0x36300d=[];var _0x4903c4=_(_0x1723b1)[_0x1bcf('0x2f')](function(_0x295c92){if(_0x295c92['autoAssociation']===0x1)return;return _0x295c92[_0x1bcf('0x34')]===_0x1bcf('0x2a')?_0x1bcf('0x2b'):_0x1bcf('0x2d');})[_0x1bcf('0x84')]()[_0x1bcf('0x30')]();for(var _0x1eec41=0x0;_0x1eec41<_0x1cb852['length'];_0x1eec41++){if(!_[_0x1bcf('0x31')](_0x4903c4,_0x1cb852[_0x1eec41][_0x1bcf('0x26')]))return;var _0x17c9c=_0x1cb852[_0x1eec41][_0x1bcf('0x26')]==='agent'?_0x1bcf('0x2a'):_0x1bcf('0x2c');_0x36300d['push'](db[_0x1bcf('0x7e')][_0x1bcf('0x7b')]({'name':_0x1cb852[_0x1eec41][_0x1bcf('0x34')],'resourceId':_0x1cb852[_0x1eec41]['id'],'type':_0x17c9c,'sectionId':_[_0x1bcf('0x32')](_0x1723b1,[_0x1bcf('0x34'),_0x17c9c])['id']},{}));}return BPromise[_0x1bcf('0x4e')](_0x36300d);});})['then'](respondWithResult(_0x3d128a,0xc9))[_0x1bcf('0x1b')](handleError(_0x3d128a,null));};exports[_0x1bcf('0x85')]=function(_0x544121,_0x16548f){if(_0x544121[_0x1bcf('0x58')]['id']){delete _0x544121[_0x1bcf('0x58')]['id'];}return db[_0x1bcf('0x37')][_0x1bcf('0x32')]({'where':{'id':_0x544121[_0x1bcf('0x50')]['id']}})['then'](function(_0x5ab4a4){if(!_0x5ab4a4)return null;if(_0x5ab4a4['id']===_0x544121[_0x1bcf('0x29')]['id']){if(!_0x544121['body']['oldPassword']||!_0x544121[_0x1bcf('0x58')][_0x1bcf('0x86')]){throw new db['Sequelize'][(_0x1bcf('0x87'))](_0x1bcf('0x88'));}if(!_0x5ab4a4[_0x1bcf('0x89')](_0x544121['body']['oldPassword'])){throw new db[(_0x1bcf('0x8a'))]['ValidationError'](_0x1bcf('0x8b'));}if(_0x544121['body'][_0x1bcf('0x8c')]===_0x544121[_0x1bcf('0x58')][_0x1bcf('0x86')]){throw new db[(_0x1bcf('0x8a'))][(_0x1bcf('0x87'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x544121[_0x1bcf('0x29')][_0x1bcf('0x26')]===_0x1bcf('0x27')){if(!_0x544121['body']['newPassword']){throw new db[(_0x1bcf('0x8a'))]['ValidationError'](_0x1bcf('0x8d'));}}else if(_0x544121[_0x1bcf('0x29')]['role']===_0x1bcf('0x29')){if(!_0x544121[_0x1bcf('0x58')]['newPassword']){throw new db[(_0x1bcf('0x8a'))][(_0x1bcf('0x87'))](_0x1bcf('0x8d'));}if(_0x5ab4a4[_0x1bcf('0x26')]!==_0x1bcf('0x2b')){throw new db[(_0x1bcf('0x8a'))][(_0x1bcf('0x87'))](_0x1bcf('0x76'));}}else{throw new db[(_0x1bcf('0x8a'))]['ValidationError'](_0x1bcf('0x76'));}return _0x5ab4a4;})[_0x1bcf('0x11')](handleEntityNotFound(_0x16548f,null))[_0x1bcf('0x11')](function(_0x44eff7){return db['Setting'][_0x1bcf('0x8e')]({'attributes':['id','securePassword',_0x1bcf('0x8f'),'passwordHistoryLimit']})[_0x1bcf('0x11')](function(_0x3a0a24){if(_0x3a0a24[_0x1bcf('0x5f')])authService[_0x1bcf('0x60')](_0x544121[_0x1bcf('0x58')][_0x1bcf('0x86')]);if(!_0x3a0a24[_0x1bcf('0x8f')]||!_0x44eff7[_0x1bcf('0x90')])return _0x44eff7;authService[_0x1bcf('0x91')](_0x544121[_0x1bcf('0x58')]['newPassword'],_0x44eff7[_0x1bcf('0x90')],_0x3a0a24[_0x1bcf('0x92')]);return _0x44eff7;})[_0x1bcf('0x11')](saveUpdates({'password':_0x544121[_0x1bcf('0x58')][_0x1bcf('0x86')],'passwordResetAt':_0x544121[_0x1bcf('0x29')]['id']==_0x544121[_0x1bcf('0x50')]['id']?moment():null,'previousPasswords':authService[_0x1bcf('0x93')](_0x544121[_0x1bcf('0x58')]['newPassword'],_0x44eff7['previousPasswords'])},null));})[_0x1bcf('0x11')](respondWithResult(_0x16548f,null))[_0x1bcf('0x1b')](handleError(_0x16548f,null));};exports[_0x1bcf('0x94')]=function(_0x30e727,_0x9a5a09){var _0x23d865=_0x30e727[_0x1bcf('0x58')][_0x1bcf('0x95')];return db['User'][_0x1bcf('0x32')]({'where':{'id':_0x30e727[_0x1bcf('0x50')]['id']},'attributes':['id',_0x1bcf('0x34'),_0x1bcf('0x26'),_0x1bcf('0x96'),_0x1bcf('0x97'),_0x1bcf('0x98'),_0x1bcf('0x99')]})[_0x1bcf('0x11')](handleEntityNotFound(_0x9a5a09,null))[_0x1bcf('0x11')](function(_0x163177){if(_0x163177){if(!utils[_0x1bcf('0x9a')](_0x23d865)){throw new db[(_0x1bcf('0x8a'))][(_0x1bcf('0x87'))](_0x1bcf('0x9b'));}return _0x163177[_0x1bcf('0x9c')+_[_0x1bcf('0x9d')](_0x23d865['toLowerCase']())+_0x1bcf('0x9e')](_0x30e727['body'][_0x1bcf('0x5b')],{'penalty':_0x30e727[_0x1bcf('0x58')][_0x1bcf('0x9f')]||0x0})[_0x1bcf('0xa0')](function(_0x389145){for(var _0x1f6637=0x0;_0x1f6637<_0x30e727[_0x1bcf('0x58')][_0x1bcf('0x5b')][_0x1bcf('0x47')];_0x1f6637+=0x1){var _0x3d0db8={'UserId':Number(_0x30e727[_0x1bcf('0x50')]['id'])};_0x3d0db8[_[_0x1bcf('0x9d')](_0x23d865[_0x1bcf('0xa1')]())+_0x1bcf('0xa2')]=Number(_0x30e727['body'][_0x1bcf('0x5b')][_0x1f6637]);socket[_0x1bcf('0xa3')](_0x1bcf('0x29')+_['capitalize'](_0x23d865[_0x1bcf('0xa1')]())+_0x1bcf('0xa4'),_0x3d0db8);}return _0x389145;})[_0x1bcf('0x11')](function(){if(_0x23d865===_0x1bcf('0xa5')){return db[_0x1bcf('0xa6')][_0x1bcf('0x43')]({'where':{'id':_0x30e727[_0x1bcf('0x58')][_0x1bcf('0x5b')]||[]},'raw':!![],'attributes':['id',_0x1bcf('0x34')]});}})[_0x1bcf('0x11')](function(_0x4bad6d){var _0x103a83=_0x163177[_0x1bcf('0xa7')]({'plain':!![]});var _0x56b250=[];if(_0x23d865===_0x1bcf('0xa5')&&_0x103a83[_0x1bcf('0x26')]===_0x1bcf('0x2b')&&_0x103a83[_0x1bcf('0x96')]){for(var _0x4bde77=0x0;_0x4bde77<_0x4bad6d[_0x1bcf('0x47')];_0x4bde77+=0x1){_0x56b250[_0x1bcf('0x42')]({'membername':_0x103a83['name'],'UserId':_0x103a83['id'],'queue_name':_0x4bad6d[_0x4bde77][_0x1bcf('0x34')],'VoiceQueueId':_0x4bad6d[_0x4bde77]['id'],'interface':_[_0x1bcf('0x62')](_0x103a83[_0x1bcf('0x99')])?util[_0x1bcf('0xa8')](_0x1bcf('0xa9'),_0x103a83['name']):_0x103a83[_0x1bcf('0x99')],'paused':_0x103a83[_0x1bcf('0x98')]||![],'penalty':_0x30e727[_0x1bcf('0x58')][_0x1bcf('0x9f')]||0x0});}return BPromise['each'](_0x56b250,function(_0x3c1619){return db[_0x1bcf('0xaa')][_0x1bcf('0xab')](_0x3c1619);});}return _0x163177;});}})[_0x1bcf('0x11')](respondWithStatusCode(_0x9a5a09,null))[_0x1bcf('0x1b')](handleError(_0x9a5a09,null));};exports[_0x1bcf('0xac')]=function(_0x476a31,_0x35528f){var _0x6ca31a;return db[_0x1bcf('0x37')]['find']({'where':{'id':_0x476a31[_0x1bcf('0x50')]['id']},'attributes':['id',_0x1bcf('0x34'),_0x1bcf('0x26')]})['then'](handleEntityNotFound(_0x35528f,null))[_0x1bcf('0x11')](function(_0x5a442f){if(_0x5a442f){_0x6ca31a=_0x5a442f;if(!_0x476a31[_0x1bcf('0x3e')]['channel']||!utils[_0x1bcf('0x9a')](_0x476a31['query'][_0x1bcf('0x95')])){throw new db[(_0x1bcf('0x8a'))][(_0x1bcf('0x87'))](_0x1bcf('0x9b'));}return _0x5a442f[_0x1bcf('0xad')+_[_0x1bcf('0x9d')](_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x95')]['toLowerCase']())+_0x1bcf('0x9e')](_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x5b')]);}})[_0x1bcf('0x11')](function(_0x4e7276){if(_[_0x1bcf('0xae')](_0x476a31['query'][_0x1bcf('0x5b')])){for(var _0x1b0a79=0x0;_0x1b0a79<_0x476a31[_0x1bcf('0x3e')]['ids'][_0x1bcf('0x47')];_0x1b0a79+=0x1){var _0x30b678={'UserId':Number(_0x476a31[_0x1bcf('0x50')]['id'])};_0x30b678[_[_0x1bcf('0x9d')](_0x476a31['query']['channel']['toLowerCase']())+_0x1bcf('0xa2')]=Number(_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x5b')][_0x1b0a79]);socket[_0x1bcf('0xa3')]('user'+_[_0x1bcf('0x9d')](_0x476a31[_0x1bcf('0x3e')]['channel'][_0x1bcf('0xa1')]())+'Queue:remove',_0x30b678);}}else{var _0x30b678={'UserId':Number(_0x476a31[_0x1bcf('0x50')]['id'])};_0x30b678[_[_0x1bcf('0x9d')](_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x95')][_0x1bcf('0xa1')]())+_0x1bcf('0xa2')]=Number(_0x476a31[_0x1bcf('0x3e')]['ids']);socket[_0x1bcf('0xa3')](_0x1bcf('0x29')+_[_0x1bcf('0x9d')](_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x95')][_0x1bcf('0xa1')]())+_0x1bcf('0xaf'),_0x30b678);}return _0x4e7276;})[_0x1bcf('0x11')](function(){if(_0x476a31[_0x1bcf('0x3e')][_0x1bcf('0x95')]===_0x1bcf('0xa5')){return db[_0x1bcf('0xaa')][_0x1bcf('0x25')]({'where':{'UserId':_0x476a31[_0x1bcf('0x50')]['id'],'VoiceQueueId':_0x476a31[_0x1bcf('0x3e')]['ids']},'individualHooks':!![]})[_0x1bcf('0x11')](function(){return _0x6ca31a;});}return _0x6ca31a;})[_0x1bcf('0x11')](respondWithStatusCode(_0x35528f,null))[_0x1bcf('0x1b')](handleError(_0x35528f,null));};exports[_0x1bcf('0xb0')]=function(_0x5ccce7,_0xf5704b){_0x5ccce7[_0x1bcf('0x58')][_0x1bcf('0xb1')]=_0x5ccce7[_0x1bcf('0xb2')]['filename'];return db[_0x1bcf('0x37')]['find']({'where':{'id':_0x5ccce7['params']['id']}})[_0x1bcf('0x11')](handleEntityNotFound(_0xf5704b,null))[_0x1bcf('0x11')](saveUpdates(_0x5ccce7['body'],null))[_0x1bcf('0x11')](respondWithResult(_0xf5704b,null))[_0x1bcf('0x1b')](handleError(_0xf5704b,null));};exports[_0x1bcf('0xb3')]=function(_0x5ebb48,_0x2a45cf){var _0x2b7276=path[_0x1bcf('0xb4')](config[_0x1bcf('0xb5')],_0x1bcf('0xb6'));return db[_0x1bcf('0x37')]['find']({'where':{'id':_0x5ebb48[_0x1bcf('0x50')]['id']},'attributes':['id',_0x1bcf('0xb1')],'raw':!![]})[_0x1bcf('0x11')](handleEntityNotFound(_0x2a45cf,null))['then'](function(_0x4ad77f){if(_0x4ad77f){if(_[_0x1bcf('0x62')](_0x4ad77f[_0x1bcf('0xb1')])){return _0x2a45cf[_0x1bcf('0xb7')](_0x2b7276);}else{if(!fs[_0x1bcf('0xb8')](path[_0x1bcf('0xb4')](config['root'],_0x1bcf('0xb9'),_0x4ad77f[_0x1bcf('0xb1')]))){return _0x2a45cf[_0x1bcf('0xb7')](_0x2b7276);}return _0x2a45cf[_0x1bcf('0xb7')](path['join'](config[_0x1bcf('0xb5')],'server/files/images/',_0x4ad77f[_0x1bcf('0xb1')]));}}})[_0x1bcf('0x1b')](handleError(_0x2a45cf,null));};exports['getOpenTabs']=function(_0x801fa2,_0x1bfbb2){return db[_0x1bcf('0x37')]['find']({'where':{'id':_0x801fa2[_0x1bcf('0x50')]['id']},'attributes':['id']})[_0x1bcf('0x11')](handleEntityNotFound(_0x1bfbb2,null))[_0x1bcf('0x11')](function(_0xc4e34d){var _0x4a01c6=[];values=_0xc4e34d[_0x1bcf('0x49')];_0x4a01c6[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x48'),_0xc4e34d[_0x1bcf('0x49')]));_0x4a01c6[_0x1bcf('0x42')](get_open_tabs('sms',_0xc4e34d[_0x1bcf('0x49')]));_0x4a01c6[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x57'),_0xc4e34d['dataValues']));_0x4a01c6[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4d'),_0xc4e34d['dataValues']));_0x4a01c6[_0x1bcf('0x42')](get_open_tabs(_0x1bcf('0x4b'),_0xc4e34d[_0x1bcf('0x49')]));_0x4a01c6['push'](get_open_tabs('mail',_0xc4e34d[_0x1bcf('0x49')]));return BPromise[_0x1bcf('0x4e')](_0x4a01c6);})['then'](function(_0x522792){var _0x862ce0=[];if(_0x522792){for(var _0x1b9244=0x0;_0x1b9244=_0x76b919){_0x376f09=_0x76b919;_0x540e74=0xc8;}else{_0x540e74=0xce;}_0x3ebe7e[_0xcf23('0x1f')](_0x540e74);return _0x3ebe7e[_0xcf23('0x25')]('Content-Range',_0x13aa31+'-'+_0x376f09+'/'+_0x76b919)[_0xcf23('0x26')](_0x25a660);}return null;};}function saveUpdates(_0x7ab256){return function(_0x545396){if(_0x545396){return _0x545396[_0xcf23('0x27')](_0x7ab256)[_0xcf23('0x15')](function(_0x37f7c0){return _0x37f7c0;});}return null;};}function removeEntity(_0x40984e){return function(_0x1dcfe3){if(_0x1dcfe3){return _0x1dcfe3['destroy']()[_0xcf23('0x15')](function(){var _0x2b9882=_0x1dcfe3['get']({'plain':!![]});if(_0x2b9882[_0xcf23('0x28')]===_0xcf23('0x29'))return;var _0x152c2=[{'name':_0xcf23('0x2a'),'value':_0xcf23('0x2b'),'ignore':!![]},{'name':_0xcf23('0x2c'),'value':_0xcf23('0x2d'),'ignore':![]},{'name':_0xcf23('0x2e'),'value':_0xcf23('0x2f'),'ignore':![]}];var _0x80ce31=_(_0x152c2)[_0xcf23('0x30')](_0xcf23('0x31'))[_0xcf23('0x32')]('value')[_0xcf23('0x33')]();if(_[_0xcf23('0x34')](_0x80ce31,_0x2b9882[_0xcf23('0x28')])){return;}var _0x391177=_[_0xcf23('0x35')](_0x152c2,[_0xcf23('0x33'),_0x2b9882['role']])[_0xcf23('0x36')];return db[_0xcf23('0x37')][_0xcf23('0x38')]({'where':{'type':_0x391177,'resourceId':_0x2b9882['id']}})[_0xcf23('0x15')](function(){return _0x1dcfe3;});})[_0xcf23('0x15')](function(){_0x40984e[_0xcf23('0x1f')](0xcc)[_0xcf23('0x20')]();});}};}function handleEntityNotFound(_0x51bac1){return function(_0x2dfea7){if(!_0x2dfea7){_0x51bac1[_0xcf23('0x39')](0x194);}return _0x2dfea7;};}function handleError(_0x438bab,_0x2eaadb){_0x2eaadb=_0x2eaadb||0x1f4;return function(_0x1e6f6b){logger[_0xcf23('0x1b')](_0x1e6f6b[_0xcf23('0x3a')]);if(_0x1e6f6b[_0xcf23('0x36')]){delete _0x1e6f6b[_0xcf23('0x36')];}_0x438bab['status'](_0x2eaadb)['send'](_0x1e6f6b);};}exports[_0xcf23('0x3b')]=function(_0x4b7d39,_0x5cb5bd){var _0x5b7830={},_0x535b30={'count':0x0,'rows':[]};var _0x5115e0=_(db[_0xcf23('0x3c')]['rawAttributes'])[_0xcf23('0x32')](function(_0x2f8e60){return{'name':_0x2f8e60['fieldName'],'type':_0x2f8e60[_0xcf23('0x3d')][_0xcf23('0x3e')]};})['filter'](function(_0x5541b0){return!_['includes'](['password',_0xcf23('0x3f')],_0x5541b0['name']);})[_0xcf23('0x33')]();_0x5b7830=qs['getOptions'](_0x5115e0,_0x4b7d39);var _0x3a1a7c={'where':_0x5b7830[_0xcf23('0x40')]};return db[_0xcf23('0x3c')][_0xcf23('0x24')](_0x3a1a7c)['then'](function(_0x319bdc){_0x535b30[_0xcf23('0x24')]=_0x319bdc;if(_0x4b7d39[_0xcf23('0x41')][_0xcf23('0x42')]){_0x5b7830[_0xcf23('0x43')]=[{'all':!![]}];}if(!_[_0xcf23('0x34')](_0x5b7830[_0xcf23('0x44')],'id')){_0x5b7830[_0xcf23('0x44')]['push']('id');}return db[_0xcf23('0x3c')][_0xcf23('0x45')](_0x5b7830);})[_0xcf23('0x15')](function(_0x563235){_0x535b30[_0xcf23('0x46')]=_0x563235;if(_0x4b7d39[_0xcf23('0x41')][_0xcf23('0x47')]==='true'){var _0x3caa08=[];for(var _0x33662b=0x0;_0x33662b<_0x535b30[_0xcf23('0x46')]['length'];_0x33662b++){_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x49'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4b'),_0x535b30[_0xcf23('0x46')][_0x33662b]['dataValues']));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4c'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4d'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs('openchannel',_0x535b30[_0xcf23('0x46')][_0x33662b]['dataValues']));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4e'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));}return BPromise['all'](_0x3caa08)[_0xcf23('0x15')](function(_0x3e8a9b){return _0x535b30;});}else{return _0x535b30;}})['then'](respondWithFilteredResult(_0x5cb5bd,_0x5b7830))[_0xcf23('0x4f')](handleError(_0x5cb5bd,null));};exports[_0xcf23('0x50')]=function(_0x19189d,_0x5a38f1){var _0x15865b={'raw':![],'where':{'id':_0x19189d[_0xcf23('0x51')]['id']}},_0x26a414={};_0x26a414[_0xcf23('0x52')]=_['differenceBy'](_[_0xcf23('0x53')](db['User'][_0xcf23('0x54')]),['password',_0xcf23('0x3f')]);_0x26a414['query']=_[_0xcf23('0x53')](_0x19189d['query']);_0x26a414[_0xcf23('0x55')]=_[_0xcf23('0x56')](_0x26a414[_0xcf23('0x52')],_0x26a414['query']);_0x15865b['attributes']=_[_0xcf23('0x56')](_0x26a414[_0xcf23('0x52')],qs[_0xcf23('0x57')](_0x19189d[_0xcf23('0x41')][_0xcf23('0x57')]));_0x15865b[_0xcf23('0x44')]=_0x15865b[_0xcf23('0x44')][_0xcf23('0x58')]?_0x15865b[_0xcf23('0x44')]:_0x26a414[_0xcf23('0x52')];if(_0x19189d[_0xcf23('0x41')][_0xcf23('0x42')]){_0x15865b['include']=[{'all':!![]}];}_0x15865b=_[_0xcf23('0x59')]({},_0x15865b,_0x19189d[_0xcf23('0x5a')]);if(!_[_0xcf23('0x34')](_0x15865b[_0xcf23('0x44')],'id')){_0x15865b['attributes'][_0xcf23('0x48')]('id');}return db[_0xcf23('0x3c')][_0xcf23('0x35')](_0x15865b)[_0xcf23('0x15')](handleEntityNotFound(_0x5a38f1,null))[_0xcf23('0x15')](function(_0x3c2bd5){var _0x1217ec=[];values=_0x3c2bd5;if(_0x19189d[_0xcf23('0x41')][_0xcf23('0x47')]==='true'){_0x1217ec[_0xcf23('0x48')](get_open_tabs('chat',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('sms',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x5b'),_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('whatsapp',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec[_0xcf23('0x48')](get_open_tabs('fax',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('mail',_0x3c2bd5[_0xcf23('0x4a')]));return BPromise[_0xcf23('0x5c')](_0x1217ec);}else{return values;}})[_0xcf23('0x15')](function(_0x4c71fa){return values;})[_0xcf23('0x15')](respondWithResult(_0x5a38f1,null))[_0xcf23('0x4f')](handleError(_0x5a38f1,null));};exports[_0xcf23('0x27')]=function(_0x1c88c4,_0x17b869){if(_0x1c88c4['body']['id']){delete _0x1c88c4[_0xcf23('0x5d')]['id'];}delete _0x1c88c4[_0xcf23('0x5d')][_0xcf23('0x28')];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x1c88c4[_0xcf23('0x51')]['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x17b869,null))['then'](saveUpdates(_0x1c88c4[_0xcf23('0x5d')],null))[_0xcf23('0x15')](respondWithResult(_0x17b869,null))[_0xcf23('0x4f')](handleError(_0x17b869,null));};exports['describe']=function(_0x24315a,_0xaa5dc4){return db[_0xcf23('0x3c')][_0xcf23('0x5e')]()[_0xcf23('0x15')](respondWithResult(_0xaa5dc4,null))[_0xcf23('0x4f')](handleError(_0xaa5dc4,null));};exports[_0xcf23('0x5f')]=function(_0x449e46,_0x2a0f0a){return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x449e46[_0xcf23('0x51')]['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x2a0f0a,null))['then'](function(_0x58ba36){if(_0x58ba36){return _0x58ba36[_0xcf23('0x5f')](_0x449e46[_0xcf23('0x5d')]['ids'],_[_0xcf23('0x60')](_0x449e46[_0xcf23('0x5d')],[_0xcf23('0x61'),'id'])||{});}})[_0xcf23('0x15')](respondWithResult(_0x2a0f0a,null))[_0xcf23('0x4f')](handleError(_0x2a0f0a,null));};function validateUser(_0x22a81e){return new BPromise(function(_0x3c8551,_0x5b24bb){if(_0x22a81e['internal'])return _0x3c8551(_0x22a81e);return db[_0xcf23('0x62')][_0xcf23('0x63')](0x1)[_0xcf23('0x15')](function(_0x4560a3){if(_0x4560a3[_0xcf23('0x64')])authService[_0xcf23('0x65')](_0x22a81e[_0xcf23('0x66')]);db[_0xcf23('0x3c')][_0xcf23('0x67')](_0xcf23('0x68'))[_0xcf23('0x15')](function(_0x589158){if(_[_0xcf23('0x69')](_0x589158)){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')]||0x1;return;}if(_[_0xcf23('0x69')](_0x4560a3['min_internal'])||_0x4560a3['min_internal']===_0x589158){_0x22a81e[_0xcf23('0x68')]=_0x589158+0x1;return;}if(_0x4560a3['min_internal']>_0x589158){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')];return;}return db[_0xcf23('0x6b')][_0xcf23('0x41')](_0xcf23('0x6c'),{'type':db[_0xcf23('0x6b')][_0xcf23('0x6d')]['SELECT']})[_0xcf23('0x15')](function(_0xd94e58){if(_0xd94e58&&_0xd94e58[_0xcf23('0x58')]){for(var _0x387734=0x0,_0x32525f=_0xd94e58[_0xcf23('0x58')];_0x387734<_0x32525f&&_[_0xcf23('0x69')](_0x22a81e[_0xcf23('0x68')]);_0x387734++){if(_0x4560a3['min_internal']<=_0xd94e58[_0x387734]['from']){_0x22a81e[_0xcf23('0x68')]=_0xd94e58[_0x387734][_0xcf23('0x6e')];}else if(_0x4560a3[_0xcf23('0x6a')]>_0xd94e58[_0x387734][_0xcf23('0x6e')]&&_0x4560a3[_0xcf23('0x6a')]<=_0xd94e58[_0x387734]['to']){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')];}}}if(_[_0xcf23('0x69')](_0x22a81e[_0xcf23('0x68')])){_0x22a81e[_0xcf23('0x68')]=_0x589158+0x1;}return _0x3c8551(_0x22a81e);});});})[_0xcf23('0x4f')](function(_0x1b09a2){_0x5b24bb(_0x1b09a2);});});}function updateUser(_0x5ad70f){return new BPromise(function(_0x1a5078,_0xb4a276){try{if(_0x5ad70f['voicemail']){_0x5ad70f['mailbox']=_0x5ad70f[_0xcf23('0x68')];_0x5ad70f[_0xcf23('0x6f')]={'mailbox':_0x5ad70f[_0xcf23('0x68')],'password':_0x5ad70f[_0xcf23('0x66')],'fullname':_0x5ad70f[_0xcf23('0x70')],'email':_0x5ad70f[_0xcf23('0x71')]};}if(_0x5ad70f[_0xcf23('0x28')]==='agent'){if(!_0x5ad70f[_0xcf23('0x72')])_0x5ad70f['permissions']=[_0xcf23('0x73'),_0xcf23('0x74'),_0xcf23('0x75'),_0xcf23('0x76'),'110',_0xcf23('0x77'),_0xcf23('0x78'),_0xcf23('0x79'),_0xcf23('0x7a'),'108',_0xcf23('0x7b'),_0xcf23('0x7c'),_0xcf23('0x7d'),_0xcf23('0x7e'),_0xcf23('0x7f')];}_0x1a5078(_0x5ad70f);}catch(_0x48480d){_0xb4a276(_0x48480d);}});}exports[_0xcf23('0x80')]=function(_0x49a09b,_0x309d21){if(_0x49a09b['user'][_0xcf23('0x28')]===_0xcf23('0x2d'))throw new Error(_0xcf23('0x81'));if(_0x49a09b[_0xcf23('0x5d')][_0xcf23('0x28')]===_0xcf23('0x2b')&&_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x28')]!=='admin'){throw new Error(_0xcf23('0x82'));}if(_0x49a09b[_0xcf23('0x5d')]['role']===_0xcf23('0x29')&&_0x49a09b['user'][_0xcf23('0x28')]!=='admin'){throw new Error(_0xcf23('0x83'));}return licenseUtil[_0xcf23('0x84')]([_0x49a09b[_0xcf23('0x5d')]])[_0xcf23('0x15')](function(){return validateUser(_0x49a09b[_0xcf23('0x5d')]);})[_0xcf23('0x15')](function(_0x5c33c4){return updateUser(_0x5c33c4)[_0xcf23('0x15')](function(_0x359f43){if(_0x359f43[_0xcf23('0x28')]===_0xcf23('0x29')){_0x359f43[_0xcf23('0x85')]=_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x85')];delete _0x359f43[_0xcf23('0x86')];}return _0x359f43;});})[_0xcf23('0x15')](function(_0x3a0470){return db['User']['create'](_0x3a0470,{'include':[{'model':db[_0xcf23('0x6f')],'as':_0xcf23('0x6f')}]});})[_0xcf23('0x15')](function(_0xe27dd8){if(_0x49a09b[_0xcf23('0x5d')][_0xcf23('0x28')]===_0xcf23('0x2b'))return _0xe27dd8;if(_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x28')]!==_0xcf23('0x2b'))return _0xe27dd8;return db[_0xcf23('0x87')]['find']({'where':{'name':_0xe27dd8[_0xcf23('0x28')]===_0xcf23('0x2d')?_0xcf23('0x2c'):_0xcf23('0x2e'),'userProfileId':_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x86')]},'raw':!![]})['then'](function(_0x10e3b0){if(!_0x10e3b0||_0x10e3b0[_0xcf23('0x88')]!=0x0)return _0xe27dd8;return db[_0xcf23('0x37')][_0xcf23('0x80')]({'name':_0xe27dd8[_0xcf23('0x36')],'resourceId':_0xe27dd8['id'],'type':_0x10e3b0[_0xcf23('0x36')],'sectionId':_0x10e3b0['id']},{})[_0xcf23('0x15')](function(){return _0xe27dd8;});})[_0xcf23('0x4f')](function(_0x2b218e){logger[_0xcf23('0x1b')](_0xcf23('0x89'),_0x2b218e);throw _0x2b218e;});})[_0xcf23('0x15')](respondWithResult(_0x309d21,0xc9))[_0xcf23('0x4f')](handleError(_0x309d21,null));};exports['bulkCreate']=function(_0x450757,_0x9a2a17){var _0xef5d95=_0x450757[_0xcf23('0x5d')];var _0x181db3=[];if(_0x450757['user']['role']==='agent')throw new Error('Unauthorized');if(_[_0xcf23('0x8a')](_0xef5d95,[_0xcf23('0x28'),_0xcf23('0x2b')])&&_0x450757['user'][_0xcf23('0x28')]!==_0xcf23('0x29')){throw new Error(_0xcf23('0x82'));}if(_['some'](_0xef5d95,[_0xcf23('0x28'),_0xcf23('0x29')])&&_0x450757['user'][_0xcf23('0x28')]!==_0xcf23('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xcf23('0x84')](_0xef5d95)[_0xcf23('0x15')](function(){return validateUser(_0xef5d95[0x0]);})[_0xcf23('0x15')](function(){for(var _0x23fdd9=0x1;_0x23fdd9<_0xef5d95[_0xcf23('0x58')];_0x23fdd9++){var _0x366e77=_0xef5d95[_0x23fdd9-0x1][_0xcf23('0x68')];if(!_0xef5d95[_0x23fdd9][_0xcf23('0x68')])_0xef5d95[_0x23fdd9][_0xcf23('0x68')]=_0x366e77+0x1;_0x181db3['push'](validateUser(_0xef5d95[_0x23fdd9]));}return BPromise[_0xcf23('0x5c')](_0x181db3);})[_0xcf23('0x15')](function(){_0x181db3=[];for(var _0x2ee917=0x0;_0x2ee917<_0xef5d95['length'];_0x2ee917++){_0x181db3[_0xcf23('0x48')](updateUser(_0xef5d95[_0x2ee917]));}return BPromise[_0xcf23('0x5c')](_0x181db3);})['then'](function(){return BPromise[_0xcf23('0x8b')](_0xef5d95,function(_0x2e89e8){return db[_0xcf23('0x3c')][_0xcf23('0x80')](_0x2e89e8,{'include':[{'model':db[_0xcf23('0x6f')],'as':'VoiceMail'}]})['then'](function(_0x1185c8){_0x2e89e8['id']=_0x1185c8['id'];return _0x2e89e8;});});})[_0xcf23('0x15')](function(_0x4873ec){if(_0x450757[_0xcf23('0x5d')][_0xcf23('0x28')]==='user')return _0x4873ec;if(_0x450757[_0xcf23('0x2b')][_0xcf23('0x28')]!==_0xcf23('0x2b'))return _0x4873ec;var _0xe1c784=_[_0xcf23('0x8a')](_0x4873ec,function(_0xd05752){return _0xd05752[_0xcf23('0x28')]===_0xcf23('0x2d')||_0xd05752[_0xcf23('0x28')]===_0xcf23('0x2f');});if(!_0xe1c784)return _0x4873ec;return db['UserProfileSection'][_0xcf23('0x45')]({'where':{'name':{'$or':[_0xcf23('0x2c'),_0xcf23('0x2e')]},'userProfileId':_0x450757[_0xcf23('0x2b')][_0xcf23('0x86')]},'raw':!![]})['then'](function(_0x2953c5){if(_[_0xcf23('0x8c')](_0x2953c5)||!_[_0xcf23('0x8a')](_0x2953c5,['autoAssociation',0x0]))return _0x4873ec;_0x181db3=[];var _0x120b8a=_(_0x2953c5)[_0xcf23('0x32')](function(_0x36ab03){if(_0x36ab03[_0xcf23('0x88')]===0x1)return;return _0x36ab03[_0xcf23('0x36')]===_0xcf23('0x2c')?_0xcf23('0x2d'):_0xcf23('0x2f');})[_0xcf23('0x8d')]()['value']();for(var _0x210593=0x0;_0x210593<_0x4873ec[_0xcf23('0x58')];_0x210593++){if(!_[_0xcf23('0x34')](_0x120b8a,_0x4873ec[_0x210593]['role']))return;var _0x1583d0=_0x4873ec[_0x210593][_0xcf23('0x28')]===_0xcf23('0x2d')?'Agents':_0xcf23('0x2e');_0x181db3[_0xcf23('0x48')](db[_0xcf23('0x37')][_0xcf23('0x80')]({'name':_0x4873ec[_0x210593][_0xcf23('0x36')],'resourceId':_0x4873ec[_0x210593]['id'],'type':_0x1583d0,'sectionId':_[_0xcf23('0x35')](_0x2953c5,[_0xcf23('0x36'),_0x1583d0])['id']},{}));}return BPromise[_0xcf23('0x5c')](_0x181db3);});})[_0xcf23('0x15')](respondWithResult(_0x9a2a17,0xc9))[_0xcf23('0x4f')](handleError(_0x9a2a17,null));};exports['changePassword']=function(_0xcdc55c,_0x17e054){if(_0xcdc55c[_0xcf23('0x5d')]['id']){delete _0xcdc55c[_0xcf23('0x5d')]['id'];}return db['User'][_0xcf23('0x35')]({'where':{'id':_0xcdc55c['params']['id']}})[_0xcf23('0x15')](function(_0x5e5709){if(!_0x5e5709)return null;if(_0x5e5709['id']===_0xcdc55c[_0xcf23('0x2b')]['id']){if(!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')]||!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db['Sequelize'][(_0xcf23('0x90'))](_0xcf23('0x91'));}if(!_0x5e5709[_0xcf23('0x92')](_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')])){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))]('Wrong\x20credentials');}if(_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')]===_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))]['ValidationError'](_0xcf23('0x94'));}}else if(_0xcdc55c[_0xcf23('0x2b')][_0xcf23('0x28')]===_0xcf23('0x29')){if(!_0xcdc55c['body'][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xcdc55c['user']['role']===_0xcf23('0x2b')){if(!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x95'));}if(_0x5e5709['role']!==_0xcf23('0x2d')){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x81'));}}else{throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x81'));}return _0x5e5709;})[_0xcf23('0x15')](handleEntityNotFound(_0x17e054,null))[_0xcf23('0x15')](function(_0x3a902f){return db[_0xcf23('0x62')]['findOne']({'attributes':['id',_0xcf23('0x64'),_0xcf23('0x96'),_0xcf23('0x97')]})[_0xcf23('0x15')](function(_0x1aaf29){if(_0x1aaf29[_0xcf23('0x64')])authService[_0xcf23('0x65')](_0xcdc55c['body'][_0xcf23('0x8f')]);if(!_0x1aaf29[_0xcf23('0x96')]||!_0x3a902f['previousPasswords'])return _0x3a902f;authService[_0xcf23('0x98')](_0xcdc55c['body'][_0xcf23('0x8f')],_0x3a902f[_0xcf23('0x99')],_0x1aaf29[_0xcf23('0x97')]);return _0x3a902f;})[_0xcf23('0x15')](saveUpdates({'password':_0xcdc55c['body']['newPassword'],'passwordResetAt':_0xcdc55c[_0xcf23('0x2b')]['id']==_0xcdc55c[_0xcf23('0x51')]['id']?moment():null,'previousPasswords':authService[_0xcf23('0x9a')](_0xcdc55c['body']['newPassword'],_0x3a902f[_0xcf23('0x99')])},null));})[_0xcf23('0x15')](respondWithResult(_0x17e054,null))[_0xcf23('0x4f')](handleError(_0x17e054,null));};exports[_0xcf23('0x9b')]=function(_0x2ddfa4,_0xf30170){var _0x317f8a=_0x2ddfa4[_0xcf23('0x5d')]['channel'];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x2ddfa4[_0xcf23('0x51')]['id']},'attributes':['id',_0xcf23('0x36'),_0xcf23('0x28'),_0xcf23('0x9c'),_0xcf23('0x9d'),_0xcf23('0x9e'),_0xcf23('0x9f')]})[_0xcf23('0x15')](handleEntityNotFound(_0xf30170,null))[_0xcf23('0x15')](function(_0x5174d4){if(_0x5174d4){if(!utils[_0xcf23('0xa0')](_0x317f8a)){throw new db['Sequelize'][(_0xcf23('0x90'))]('Unknown\x20channel');}return _0x5174d4['add'+_[_0xcf23('0xa1')](_0x317f8a['toLowerCase']())+_0xcf23('0xa2')](_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')],{'penalty':_0x2ddfa4[_0xcf23('0x5d')]['penalty']||0x0})[_0xcf23('0xa3')](function(_0x43da70){for(var _0x5cb9d9=0x0;_0x5cb9d9<_0x2ddfa4[_0xcf23('0x5d')]['ids'][_0xcf23('0x58')];_0x5cb9d9+=0x1){var _0x115448={'UserId':Number(_0x2ddfa4[_0xcf23('0x51')]['id'])};_0x115448[_[_0xcf23('0xa1')](_0x317f8a[_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')][_0x5cb9d9]);socket[_0xcf23('0xa6')](_0xcf23('0x2b')+_[_0xcf23('0xa1')](_0x317f8a[_0xcf23('0xa4')]())+_0xcf23('0xa7'),_0x115448);}return _0x43da70;})[_0xcf23('0x15')](function(){if(_0x317f8a===_0xcf23('0xa8')){return db[_0xcf23('0xa9')][_0xcf23('0x45')]({'where':{'id':_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xcf23('0x15')](function(_0x1f765e){var _0x3f83ff=_0x5174d4[_0xcf23('0xaa')]({'plain':!![]});var _0x1cf39e=[];if(_0x317f8a===_0xcf23('0xa8')&&_0x3f83ff['role']===_0xcf23('0x2d')&&_0x3f83ff[_0xcf23('0x9c')]){for(var _0x69d467=0x0;_0x69d467<_0x1f765e[_0xcf23('0x58')];_0x69d467+=0x1){_0x1cf39e[_0xcf23('0x48')]({'membername':_0x3f83ff[_0xcf23('0x36')],'UserId':_0x3f83ff['id'],'queue_name':_0x1f765e[_0x69d467]['name'],'VoiceQueueId':_0x1f765e[_0x69d467]['id'],'interface':_[_0xcf23('0x69')](_0x3f83ff[_0xcf23('0x9f')])?util['format'](_0xcf23('0xab'),_0x3f83ff[_0xcf23('0x36')]):_0x3f83ff['interface'],'paused':_0x3f83ff[_0xcf23('0x9e')]||![],'penalty':_0x2ddfa4[_0xcf23('0x5d')]['penalty']||0x0});}return BPromise['each'](_0x1cf39e,function(_0x47de81){return db[_0xcf23('0xac')]['upsert'](_0x47de81);});}return _0x5174d4;});}})[_0xcf23('0x15')](respondWithStatusCode(_0xf30170,null))['catch'](handleError(_0xf30170,null));};exports['removeQueues']=function(_0x2b9085,_0x1e1dd1){var _0x2936d6;return db[_0xcf23('0x3c')]['find']({'where':{'id':_0x2b9085[_0xcf23('0x51')]['id']},'attributes':['id',_0xcf23('0x36'),_0xcf23('0x28')]})[_0xcf23('0x15')](handleEntityNotFound(_0x1e1dd1,null))['then'](function(_0x345e62){if(_0x345e62){_0x2936d6=_0x345e62;if(!_0x2b9085['query']['channel']||!utils[_0xcf23('0xa0')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')])){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0xae'));}return _0x345e62[_0xcf23('0xaf')+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')][_0xcf23('0xa4')]())+_0xcf23('0xa2')](_0x2b9085[_0xcf23('0x41')]['ids']);}})[_0xcf23('0x15')](function(_0x37f045){if(_['isArray'](_0x2b9085[_0xcf23('0x41')]['ids'])){for(var _0x1db1f3=0x0;_0x1db1f3<_0x2b9085['query'][_0xcf23('0x61')][_0xcf23('0x58')];_0x1db1f3+=0x1){var _0x856e76={'UserId':Number(_0x2b9085[_0xcf23('0x51')]['id'])};_0x856e76[_[_0xcf23('0xa1')](_0x2b9085['query'][_0xcf23('0xad')][_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2b9085['query'][_0xcf23('0x61')][_0x1db1f3]);socket[_0xcf23('0xa6')]('user'+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')][_0xcf23('0xa4')]())+'Queue:remove',_0x856e76);}}else{var _0x856e76={'UserId':Number(_0x2b9085[_0xcf23('0x51')]['id'])};_0x856e76[_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')]['channel'][_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2b9085[_0xcf23('0x41')][_0xcf23('0x61')]);socket[_0xcf23('0xa6')]('user'+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')]['toLowerCase']())+_0xcf23('0xb0'),_0x856e76);}return _0x37f045;})['then'](function(){if(_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')]===_0xcf23('0xa8')){return db[_0xcf23('0xac')][_0xcf23('0x38')]({'where':{'UserId':_0x2b9085[_0xcf23('0x51')]['id'],'VoiceQueueId':_0x2b9085['query']['ids']},'individualHooks':!![]})[_0xcf23('0x15')](function(){return _0x2936d6;});}return _0x2936d6;})['then'](respondWithStatusCode(_0x1e1dd1,null))[_0xcf23('0x4f')](handleError(_0x1e1dd1,null));};exports[_0xcf23('0xb1')]=function(_0x71b321,_0x53ab9a){_0x71b321['body'][_0xcf23('0xb2')]=_0x71b321[_0xcf23('0xb3')][_0xcf23('0xb4')];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x71b321['params']['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x53ab9a,null))[_0xcf23('0x15')](saveUpdates(_0x71b321[_0xcf23('0x5d')],null))[_0xcf23('0x15')](respondWithResult(_0x53ab9a,null))['catch'](handleError(_0x53ab9a,null));};exports[_0xcf23('0xb5')]=function(_0x2942ae,_0x17332a){var _0x739c83=path[_0xcf23('0xb6')](config[_0xcf23('0xb7')],_0xcf23('0xb8'));return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x2942ae['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x17332a,null))[_0xcf23('0x15')](function(_0x372c89){if(_0x372c89){if(_['isNil'](_0x372c89[_0xcf23('0xb2')])){return _0x17332a[_0xcf23('0xb9')](_0x739c83);}else{if(!fs[_0xcf23('0xba')](path['join'](config[_0xcf23('0xb7')],'server/files/images/',_0x372c89[_0xcf23('0xb2')]))){return _0x17332a['download'](_0x739c83);}return _0x17332a[_0xcf23('0xb9')](path['join'](config[_0xcf23('0xb7')],_0xcf23('0xbb'),_0x372c89['userpic']));}}})[_0xcf23('0x4f')](handleError(_0x17332a,null));};exports[_0xcf23('0xbc')]=function(_0x15cde3,_0x377882){return db['User'][_0xcf23('0x35')]({'where':{'id':_0x15cde3[_0xcf23('0x51')]['id']},'attributes':['id']})[_0xcf23('0x15')](handleEntityNotFound(_0x377882,null))['then'](function(_0x54a59a){var _0x1e2bb3=[];values=_0x54a59a[_0xcf23('0x4a')];_0x1e2bb3['push'](get_open_tabs(_0xcf23('0x49'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4b'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x5b'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3['push'](get_open_tabs('whatsapp',_0x54a59a['dataValues']));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4c'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3['push'](get_open_tabs(_0xcf23('0x4d'),_0x54a59a[_0xcf23('0x4a')]));return BPromise[_0xcf23('0x5c')](_0x1e2bb3);})[_0xcf23('0x15')](function(_0x1752cc){var _0x2cdac9=[];if(_0x1752cc){for(var _0x3b6588=0x0;_0x3b6588=_0x21367c['agents']){throw new Error(_0x5b79('0x57'));}})[_0x5b79('0x11')](function(){if(_0x151195){return db[_0x5b79('0x4d')][_0x5b79('0x4e')]({'where':{'membername':_0x151195[_0x5b79('0x28')]},'individualHooks':!![]});}})[_0x5b79('0x11')](function(){if(_0x151195){return _0x151195[_0x5b79('0x58')]({'raw':!![]});}})['then'](function(_0x482fe1){if(_0x151195){if(_0x482fe1){var _0x15e468=[];_0x51540f=_0x482fe1;if(_0x51540f['length']){for(var _0x584f47=0x0;_0x584f47<_0x51540f['length'];_0x584f47++){_0x15e468[_0x5b79('0x4a')](db[_0x5b79('0x4d')][_0x5b79('0x59')]({'membername':_0x151195[_0x5b79('0x28')],'UserId':_0x151195['id'],'queue_name':_0x51540f[_0x584f47][_0x5b79('0x28')],'VoiceQueueId':_0x51540f[_0x584f47]['id'],'interface':_0x2aa56f,'paused':_0x151195['loginInPause']||![],'penalty':_0x51540f[_0x584f47]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x5b79('0x4b')](_0x15e468);}}}})['then'](function(){if(_0x151195){return db[_0x5b79('0x37')][_0x5b79('0x48')]({'where':{'membername':_0x151195[_0x5b79('0x28')],'exitAt':null}});}})['then'](function(_0x8cb773){if(_0x151195){if(_0x8cb773&&_0x8cb773[_0x5b79('0x2d')]){var _0x5a6f3c=[];_0x8cb773[_0x5b79('0x49')](function(_0x468876){_0x5a6f3c[_0x5b79('0x4a')](_0x468876[_0x5b79('0x39')]({'exitAt':moment()['format'](_0x5b79('0x2f'))}));});return BPromise[_0x5b79('0x4b')](_0x5a6f3c);}}})['then'](function(_0x2d7fe3){if(_0x151195){var _0x3d577b=[];var _0x259806=[];var _0x309a7d=utils[_0x5b79('0x31')]();var _0x1b64f6={'membername':_0x151195[_0x5b79('0x28')],'interface':_0x2aa56f,'enterAt':moment()['format'](_0x5b79('0x2f')),'role':_0x151195['role'],'internal':_0x151195[_0x5b79('0x2a')]};_0x309a7d[_0x5b79('0x49')](function(_0x397f8f){_0x3d577b[_0x5b79('0x4a')](_[_0x5b79('0x5a')]({'channel':_0x397f8f,'type':'LOGIN','data1':'callysquare','data2':_0x2aa56f},_0x1b64f6));if(_0x151195[_0x5b79('0x51')]){_0x259806[_0x5b79('0x4a')](_[_0x5b79('0x5a')]({'channel':_0x397f8f,'type':_0x5b79('0x2c'),'data1':'LOGININPAUSE'},_0x1b64f6));}});return db[_0x5b79('0x37')][_0x5b79('0x38')](_0x3d577b[_0x5b79('0x5b')](_0x259806),{'individualHooks':!![]});}})[_0x5b79('0x11')](function(){if(_0x151195){return _0x151195[_0x5b79('0x39')]({'online':!![],'lastLoginAt':moment()[_0x5b79('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x151195['loginInPause']||![],'mailPause':_0x151195[_0x5b79('0x51')]||![],'chatPause':_0x151195['loginInPause']||![],'faxPause':_0x151195[_0x5b79('0x51')]||![],'smsPause':_0x151195[_0x5b79('0x51')]||![],'openchannelPause':_0x151195[_0x5b79('0x51')]||![],'pauseType':_0x151195[_0x5b79('0x51')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x5b79('0x2e')](_0x5b79('0x2f')),'interface':_0x2aa56f});}})[_0x5b79('0x11')](function(_0x1e7bad){_0x11aceb(_0x1e7bad);})[_0x5b79('0x23')](function(_0x351176){_0x58a429(_0xdfdfb9[_0x5b79('0x16')](0x1f4,_0x351176['message']));});});}; \ No newline at end of file +var _0x8add=['mobile','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','concat','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','code','error','User,\x20%s,\x20%s','message','info','result','catch','GetUser','User','options','raw','attributes','limit','include','map','model','stringify','find','where','ShowUser','PauseUser','role','internal','interface','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','getChannels','forEach','push','name','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','update','findOne','isValidChannel','channel','Unknown\x20channel','voice','UserVoiceQueueRt','MemberReport','system','mail','chat','sms','openchannel','whatsapp','set','Pause','all','LoginUser'];(function(_0x29821d,_0x28edd2){var _0xc5ffe9=function(_0x1f7349){while(--_0x1f7349){_0x29821d['push'](_0x29821d['shift']());}};_0xc5ffe9(++_0x28edd2);}(_0x8add,0x176));var _0xd8ad=function(_0x3dea6,_0x2048ce){_0x3dea6=_0x3dea6-0x0;var _0x1ab3af=_0x8add[_0x3dea6];return _0x1ab3af;};'use strict';var _=require('lodash');var util=require(_0xd8ad('0x0'));var moment=require(_0xd8ad('0x1'));var BPromise=require(_0xd8ad('0x2'));var rs=require(_0xd8ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd8ad('0x4'));var logger=require(_0xd8ad('0x5'))(_0xd8ad('0x6'));var config=require(_0xd8ad('0x7'));var jayson=require(_0xd8ad('0x8'));var client=jayson[_0xd8ad('0x9')]['http']({'port':0x232a});config[_0xd8ad('0xa')]=_['defaults'](config[_0xd8ad('0xa')],{'host':_0xd8ad('0xb'),'port':0x18eb});var socket=require(_0xd8ad('0xc'))(new Redis(config[_0xd8ad('0xa')]));require('./user.socket')[_0xd8ad('0xd')](socket);function respondWithRpcPromise(_0x37dbe2,_0xf2941,_0x355ea8){return new BPromise(function(_0x1b5496,_0x5667b2){return client[_0xd8ad('0xe')](_0x37dbe2,_0x355ea8)[_0xd8ad('0xf')](function(_0x47a7eb){logger['info']('User,\x20%s,\x20%s',_0xf2941,_0xd8ad('0x10'));logger[_0xd8ad('0x11')](_0xd8ad('0x12'),_0xf2941,_0xd8ad('0x10'),JSON['stringify'](_0x47a7eb));if(_0x47a7eb['error']){if(_0x47a7eb['error'][_0xd8ad('0x13')]===0x1f4){logger[_0xd8ad('0x14')](_0xd8ad('0x15'),_0xf2941,_0x47a7eb[_0xd8ad('0x14')]['message']);return _0x5667b2(_0x47a7eb[_0xd8ad('0x14')][_0xd8ad('0x16')]);}logger[_0xd8ad('0x14')](_0xd8ad('0x15'),_0xf2941,_0x47a7eb[_0xd8ad('0x14')]['message']);return _0x1b5496(_0x47a7eb[_0xd8ad('0x14')]['message']);}else{logger[_0xd8ad('0x17')](_0xd8ad('0x15'),_0xf2941,_0xd8ad('0x10'));_0x1b5496(_0x47a7eb[_0xd8ad('0x18')]['message']);}})[_0xd8ad('0x19')](function(_0x3da417){logger[_0xd8ad('0x14')](_0xd8ad('0x15'),_0xf2941,_0x3da417);_0x5667b2(_0x3da417);});});}exports[_0xd8ad('0x1a')]=function(_0x8a7d5e){var _0x5d3124=this;return new Promise(function(_0xbf488d,_0x6c8b18){return db[_0xd8ad('0x1b')]['findAll']({'raw':_0x8a7d5e[_0xd8ad('0x1c')]?_0x8a7d5e[_0xd8ad('0x1c')][_0xd8ad('0x1d')]===undefined?!![]:![]:!![],'where':_0x8a7d5e[_0xd8ad('0x1c')]?_0x8a7d5e[_0xd8ad('0x1c')]['where']||null:null,'attributes':_0x8a7d5e['options']?_0x8a7d5e[_0xd8ad('0x1c')][_0xd8ad('0x1e')]||null:null,'limit':_0x8a7d5e[_0xd8ad('0x1c')]?_0x8a7d5e[_0xd8ad('0x1c')][_0xd8ad('0x1f')]||null:null,'include':_0x8a7d5e['options']?_0x8a7d5e['options'][_0xd8ad('0x20')]?_[_0xd8ad('0x21')](_0x8a7d5e['options'][_0xd8ad('0x20')],function(_0x553f77){return{'model':db[_0x553f77[_0xd8ad('0x22')]],'as':_0x553f77['as'],'attributes':_0x553f77[_0xd8ad('0x1e')],'include':_0x553f77['include']?_[_0xd8ad('0x21')](_0x553f77['include'],function(_0x5a4d4b){return{'model':db[_0x5a4d4b[_0xd8ad('0x22')]],'as':_0x5a4d4b['as'],'attributes':_0x5a4d4b[_0xd8ad('0x1e')],'include':_0x5a4d4b[_0xd8ad('0x20')]?_[_0xd8ad('0x21')](_0x5a4d4b[_0xd8ad('0x20')],function(_0x551eeb){return{'model':db[_0x551eeb['model']],'as':_0x551eeb['as'],'attributes':_0x551eeb[_0xd8ad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd8ad('0xf')](function(_0xf2a7bd){logger['info'](_0xd8ad('0x1a'),_0x8a7d5e);logger['debug'](_0xd8ad('0x1a'),_0x8a7d5e,JSON[_0xd8ad('0x23')](_0xf2a7bd));_0xbf488d(_0xf2a7bd);})[_0xd8ad('0x19')](function(_0x44d757){logger[_0xd8ad('0x14')](_0xd8ad('0x1a'),_0x44d757['message'],_0x8a7d5e);_0x6c8b18(_0x5d3124[_0xd8ad('0x14')](0x1f4,_0x44d757[_0xd8ad('0x16')]));});});};exports['ShowUser']=function(_0x6ded66){var _0x3a843b=this;return new Promise(function(_0x554bf8,_0x1ebd7f){return db[_0xd8ad('0x1b')][_0xd8ad('0x24')]({'raw':_0x6ded66[_0xd8ad('0x1c')]?_0x6ded66[_0xd8ad('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x6ded66[_0xd8ad('0x1c')]?_0x6ded66[_0xd8ad('0x1c')][_0xd8ad('0x25')]||null:null,'attributes':_0x6ded66[_0xd8ad('0x1c')]?_0x6ded66[_0xd8ad('0x1c')][_0xd8ad('0x1e')]||null:null,'include':_0x6ded66[_0xd8ad('0x1c')]?_0x6ded66['options'][_0xd8ad('0x20')]?_[_0xd8ad('0x21')](_0x6ded66['options'][_0xd8ad('0x20')],function(_0x3170a5){return{'model':db[_0x3170a5[_0xd8ad('0x22')]],'as':_0x3170a5['as'],'attributes':_0x3170a5[_0xd8ad('0x1e')],'include':_0x3170a5['include']?_[_0xd8ad('0x21')](_0x3170a5[_0xd8ad('0x20')],function(_0x5601c7){return{'model':db[_0x5601c7[_0xd8ad('0x22')]],'as':_0x5601c7['as'],'attributes':_0x5601c7[_0xd8ad('0x1e')],'include':_0x5601c7[_0xd8ad('0x20')]?_[_0xd8ad('0x21')](_0x5601c7[_0xd8ad('0x20')],function(_0x536485){return{'model':db[_0x536485[_0xd8ad('0x22')]],'as':_0x536485['as'],'attributes':_0x536485[_0xd8ad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd8ad('0xf')](function(_0x2f71ad){logger[_0xd8ad('0x17')]('ShowUser',_0x6ded66);logger[_0xd8ad('0x11')](_0xd8ad('0x26'),_0x6ded66,JSON[_0xd8ad('0x23')](_0x2f71ad));_0x554bf8(_0x2f71ad);})[_0xd8ad('0x19')](function(_0x1a5522){logger['error'](_0xd8ad('0x26'),_0x1a5522[_0xd8ad('0x16')],_0x6ded66);_0x1ebd7f(_0x3a843b[_0xd8ad('0x14')](0x1f4,_0x1a5522[_0xd8ad('0x16')]));});});};exports[_0xd8ad('0x27')]=function(_0x37ad40){var _0x339934=this;return new Promise(function(_0x50f70f,_0x33b520){var _0x3ff02;return db[_0xd8ad('0x1b')][_0xd8ad('0x24')]({'where':_0x37ad40['options'][_0xd8ad('0x25')]||{},'attributes':['id','name',_0xd8ad('0x28'),_0xd8ad('0x29'),_0xd8ad('0x2a')]})[_0xd8ad('0xf')](function(_0x390ca3){if(_0x390ca3){_0x3ff02=_0x390ca3;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3ff02['id']},'individualHooks':!![]});}})[_0xd8ad('0xf')](function(){if(_0x3ff02){return db['MemberReport'][_0xd8ad('0x2b')]({'where':{'membername':_0x3ff02['name'],'type':_0xd8ad('0x2c'),'exitAt':null}});}})[_0xd8ad('0xf')](function(_0x2dc7cd){if(_0x3ff02){if(_0x2dc7cd&&_0x2dc7cd['length']){var _0x2cadc1=moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e'));for(var _0x4e6027=0x0,_0x2d77fe=_0x2dc7cd[_0xd8ad('0x2f')];_0x4e6027<_0x2d77fe;_0x4e6027++){_0x2dc7cd[_0x4e6027]['updateAttributes']({'exitAt':_0x2cadc1});}}}})[_0xd8ad('0xf')](function(){if(_0x3ff02){var _0x1d1618=[];var _0x39f1f9=utils[_0xd8ad('0x30')]();_0x39f1f9[_0xd8ad('0x31')](function(_0x1c924c){_0x1d1618[_0xd8ad('0x32')]({'channel':_0x1c924c,'membername':_0x3ff02[_0xd8ad('0x33')],'interface':_[_0xd8ad('0x34')](_0x3ff02[_0xd8ad('0x2a')])?util[_0xd8ad('0x2d')](_0xd8ad('0x35'),_0x3ff02[_0xd8ad('0x33')]):_0x3ff02[_0xd8ad('0x2a')],'type':_0xd8ad('0x2c'),'enterAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e')),'data1':_0x37ad40[_0xd8ad('0x36')][_0xd8ad('0x37')]||_0xd8ad('0x38'),'role':_0x3ff02['role'],'internal':_0x3ff02[_0xd8ad('0x29')],'uniqueid':_0x37ad40[_0xd8ad('0x36')]['uniqueid']||null});});return db['MemberReport'][_0xd8ad('0x39')](_0x1d1618,{'individualHooks':!![]});}})[_0xd8ad('0xf')](function(){if(_0x3ff02){return _0x3ff02[_0xd8ad('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x37ad40[_0xd8ad('0x36')][_0xd8ad('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e'))});}})[_0xd8ad('0xf')](function(_0x2208ad){_0x50f70f(_0x2208ad);})[_0xd8ad('0x19')](function(_0x1e36eb){_0x33b520(_0x339934[_0xd8ad('0x14')](0x1f4,_0x1e36eb[_0xd8ad('0x16')]));});});};exports['UnpauseUser']=function(_0x4d3c8d){var _0x2a9337=this;return new Promise(function(_0x43a032,_0xf8a790){var _0x3c7fc5;return db[_0xd8ad('0x1b')][_0xd8ad('0x3b')]({'where':_0x4d3c8d[_0xd8ad('0x1c')][_0xd8ad('0x25')]||{},'attributes':['id',_0xd8ad('0x33')]})[_0xd8ad('0xf')](function(_0x201c52){if(_0x201c52){_0x3c7fc5=_0x201c52;if(_0x4d3c8d[_0xd8ad('0x36')]['channel']&&!utils[_0xd8ad('0x3c')](_0x4d3c8d[_0xd8ad('0x36')][_0xd8ad('0x3d')])){throw new Error(_0xd8ad('0x3e'));}switch(_0x4d3c8d[_0xd8ad('0x36')][_0xd8ad('0x3d')]){case _0xd8ad('0x3f'):return db[_0xd8ad('0x40')][_0xd8ad('0x3a')]({'paused':0x0},{'where':{'UserId':_0x3c7fc5['id']}})['then'](function(){return db[_0xd8ad('0x41')][_0xd8ad('0x24')]({'where':{'channel':_0x4d3c8d[_0xd8ad('0x36')][_0xd8ad('0x3d')],'membername':_0x3c7fc5[_0xd8ad('0x33')],'type':_0xd8ad('0x2c'),'exitAt':null}});})[_0xd8ad('0xf')](function(_0x2bc72d){if(_0x2bc72d){return _0x2bc72d[_0xd8ad('0x3a')]({'exitAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e')),'data2':_0xd8ad('0x42')},{'individualHooks':!![]});}return null;})[_0xd8ad('0xf')](function(){return _0x3c7fc5[_0xd8ad('0x3a')]({'voicePause':![]});});case _0xd8ad('0x43'):case _0xd8ad('0x44'):case'fax':case _0xd8ad('0x45'):case _0xd8ad('0x46'):case _0xd8ad('0x47'):return db['MemberReport'][_0xd8ad('0x24')]({'where':{'channel':_0x4d3c8d[_0xd8ad('0x36')][_0xd8ad('0x3d')],'membername':_0x3c7fc5[_0xd8ad('0x33')],'type':_0xd8ad('0x2c'),'exitAt':null}})[_0xd8ad('0xf')](function(_0x3682b2){return _0x3682b2['update']({'exitAt':moment()['format'](_0xd8ad('0x2e')),'data2':_0xd8ad('0x42')},{'individualHooks':!![]});})['then'](function(){var _0xf716bd={};_[_0xd8ad('0x48')](_0xf716bd,util[_0xd8ad('0x2d')]('%s%s',_0x4d3c8d[_0xd8ad('0x36')][_0xd8ad('0x3d')],_0xd8ad('0x49')),![]);return _0x3c7fc5[_0xd8ad('0x3a')](_0xf716bd);});default:return db['UserVoiceQueueRt'][_0xd8ad('0x3a')]({'paused':0x0},{'where':{'UserId':_0x3c7fc5['id']}})[_0xd8ad('0xf')](function(){return db['MemberReport'][_0xd8ad('0x2b')]({'where':{'membername':_0x3c7fc5[_0xd8ad('0x33')],'type':_0xd8ad('0x2c'),'exitAt':null}});})[_0xd8ad('0xf')](function(_0xbcd885){var _0x2e2153=[];_0xbcd885[_0xd8ad('0x31')](function(_0x5066b4){_0x2e2153[_0xd8ad('0x32')](_0x5066b4[_0xd8ad('0x3a')]({'exitAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e')),'data2':_0xd8ad('0x42')}));});return BPromise['all'](_0x2e2153);})[_0xd8ad('0xf')](function(){return _0x3c7fc5['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd8ad('0xf')](function(_0x119d8e){_0x43a032(_0x119d8e);})[_0xd8ad('0x19')](function(_0x1f8052){_0xf8a790(_0x2a9337[_0xd8ad('0x14')](0x1f4,_0x1f8052[_0xd8ad('0x16')]));});});};exports['LogoutUser']=function(_0x25eed3){var _0x58b112=this;return new Promise(function(_0x2e62f2,_0x2044cb){var _0x4892a9;return db[_0xd8ad('0x1b')]['findOne']({'where':_0x25eed3[_0xd8ad('0x1c')][_0xd8ad('0x25')]||{},'attributes':['id',_0xd8ad('0x33')]})[_0xd8ad('0xf')](function(_0x2601bb){if(_0x2601bb){_0x4892a9=_0x2601bb;return db[_0xd8ad('0x40')]['destroy']({'where':{'membername':_0x4892a9[_0xd8ad('0x33')]},'individualHooks':!![]});}})['then'](function(){if(_0x4892a9){return db[_0xd8ad('0x41')]['findAll']({'where':{'membername':_0x4892a9[_0xd8ad('0x33')],'exitAt':null}});}})[_0xd8ad('0xf')](function(_0x17343e){if(_0x4892a9){if(_0x17343e&&_0x17343e[_0xd8ad('0x2f')]){var _0x34d764=[];_0x17343e[_0xd8ad('0x31')](function(_0x7ce6e0){_0x34d764[_0xd8ad('0x32')](_0x7ce6e0[_0xd8ad('0x3a')]({'exitAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e'))}));});return BPromise[_0xd8ad('0x4a')](_0x34d764);}}})[_0xd8ad('0xf')](function(){if(_0x4892a9){return _0x4892a9[_0xd8ad('0x3a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd8ad('0xf')](function(_0x3f4a98){_0x2e62f2(_0x3f4a98);})[_0xd8ad('0x19')](function(_0x140e97){_0x2044cb(_0x58b112[_0xd8ad('0x14')](0x1f4,_0x140e97['message']));});});};exports[_0xd8ad('0x4b')]=function(_0x375d09){var _0x4743ad=this;return new Promise(function(_0x3fe942,_0x400a3a){var _0x12baf0;var _0x3294a0;var _0x4f7b51;var _0x58b7f1;return db[_0xd8ad('0x1b')][_0xd8ad('0x3b')]({'where':_0x375d09['options'][_0xd8ad('0x25')]||{},'attributes':['id',_0xd8ad('0x33'),_0xd8ad('0x28'),_0xd8ad('0x4c'),'phone','internal','loginInPause',_0xd8ad('0x2a')]})[_0xd8ad('0xf')](function(_0x2bcb75){if(_0x2bcb75){_0x12baf0=_0x2bcb75;_0x58b7f1=_0x375d09['body'][_0xd8ad('0x2a')]?_0x375d09[_0xd8ad('0x36')]['interface']:util[_0xd8ad('0x2d')](_0xd8ad('0x35'),_0x12baf0[_0xd8ad('0x33')]);return db[_0xd8ad('0x1b')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x12baf0['id']}}});}})['then'](function(_0x2bdf58){if(_0x2bdf58){_0x4f7b51=_0x2bdf58;return require(_0xd8ad('0x4d'))[_0xd8ad('0x4e')]();}})[_0xd8ad('0xf')](function(_0x57630b){if(_0x57630b&&_0x57630b[_0xd8ad('0x4f')]&&_0x4f7b51>=_0x57630b[_0xd8ad('0x4f')]){throw new Error(_0xd8ad('0x50'));}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return db[_0xd8ad('0x40')]['destroy']({'where':{'membername':_0x12baf0[_0xd8ad('0x33')]},'individualHooks':!![]});}})['then'](function(){if(_0x12baf0){return _0x12baf0[_0xd8ad('0x51')]({'raw':!![]});}})['then'](function(_0x1fe36b){if(_0x12baf0){if(_0x1fe36b){var _0x5906d3=[];_0x3294a0=_0x1fe36b;if(_0x3294a0[_0xd8ad('0x2f')]){for(var _0x25e713=0x0;_0x25e713<_0x3294a0[_0xd8ad('0x2f')];_0x25e713++){_0x5906d3[_0xd8ad('0x32')](db[_0xd8ad('0x40')][_0xd8ad('0x52')]({'membername':_0x12baf0[_0xd8ad('0x33')],'UserId':_0x12baf0['id'],'queue_name':_0x3294a0[_0x25e713][_0xd8ad('0x33')],'VoiceQueueId':_0x3294a0[_0x25e713]['id'],'interface':_0x58b7f1,'paused':_0x12baf0['loginInPause']||![],'penalty':_0x3294a0[_0x25e713][_0xd8ad('0x53')]||0x0}));}return BPromise[_0xd8ad('0x4a')](_0x5906d3);}}}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return db[_0xd8ad('0x41')][_0xd8ad('0x2b')]({'where':{'membername':_0x12baf0[_0xd8ad('0x33')],'exitAt':null}});}})[_0xd8ad('0xf')](function(_0xd9ec46){if(_0x12baf0){if(_0xd9ec46&&_0xd9ec46[_0xd8ad('0x2f')]){var _0x2925b8=[];_0xd9ec46[_0xd8ad('0x31')](function(_0x5931e6){_0x2925b8[_0xd8ad('0x32')](_0x5931e6[_0xd8ad('0x3a')]({'exitAt':moment()['format'](_0xd8ad('0x2e'))}));});return BPromise['all'](_0x2925b8);}}})['then'](function(_0x298f14){if(_0x12baf0){var _0xa93204=[];var _0x4c3e3a=[];var _0x275fd6=utils[_0xd8ad('0x30')]();var _0xb0f1d5={'membername':_0x12baf0[_0xd8ad('0x33')],'interface':_0x58b7f1,'enterAt':moment()['format'](_0xd8ad('0x2e')),'role':_0x12baf0[_0xd8ad('0x28')],'internal':_0x12baf0[_0xd8ad('0x29')]};_0x275fd6[_0xd8ad('0x31')](function(_0x158a74){_0xa93204['push'](_[_0xd8ad('0x54')]({'channel':_0x158a74,'type':_0xd8ad('0x55'),'data1':_0xd8ad('0x56'),'data2':_0x58b7f1},_0xb0f1d5));if(_0x12baf0[_0xd8ad('0x57')]){_0x4c3e3a[_0xd8ad('0x32')](_[_0xd8ad('0x54')]({'channel':_0x158a74,'type':_0xd8ad('0x2c'),'data1':_0xd8ad('0x58')},_0xb0f1d5));}});return db[_0xd8ad('0x41')][_0xd8ad('0x39')](_0xa93204[_0xd8ad('0x59')](_0x4c3e3a),{'individualHooks':!![]});}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return _0x12baf0['update']({'online':!![],'lastLoginAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e')),'voicePause':_0x12baf0[_0xd8ad('0x57')]||![],'mailPause':_0x12baf0[_0xd8ad('0x57')]||![],'chatPause':_0x12baf0[_0xd8ad('0x57')]||![],'faxPause':_0x12baf0['loginInPause']||![],'smsPause':_0x12baf0[_0xd8ad('0x57')]||![],'openchannelPause':_0x12baf0['loginInPause']||![],'pauseType':_0x12baf0[_0xd8ad('0x57')]?_0xd8ad('0x58'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x58b7f1});}})[_0xd8ad('0xf')](function(_0x2ba899){_0x3fe942(_0x2ba899);})[_0xd8ad('0x19')](function(_0x4ac604){_0x400a3a(_0x4743ad['error'](0x1f4,_0x4ac604['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a0ea84c..4df591f 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 _0x1ffb=['length','user:','./user.events','remove','update','emit','removeListener'];(function(_0x3481aa,_0x12a65d){var _0x1ce7f3=function(_0x196d71){while(--_0x196d71){_0x3481aa['push'](_0x3481aa['shift']());}};_0x1ce7f3(++_0x12a65d);}(_0x1ffb,0x160));var _0xb1ff=function(_0x5f3223,_0x3de789){_0x5f3223=_0x5f3223-0x0;var _0x52367d=_0x1ffb[_0x5f3223];return _0x52367d;};'use strict';var UserEvents=require(_0xb1ff('0x0'));var events=['save',_0xb1ff('0x1'),_0xb1ff('0x2')];function createListener(_0x55c215,_0x1f316d){return function(_0x2d0959){_0x1f316d[_0xb1ff('0x3')](_0x55c215,_0x2d0959);};}function removeListener(_0x2de506,_0xabeeac){return function(){UserEvents[_0xb1ff('0x4')](_0x2de506,_0xabeeac);};}exports['register']=function(_0x1e8557){for(var _0x44db59=0x0,_0x37a2a1=events[_0xb1ff('0x5')];_0x44db59<_0x37a2a1;_0x44db59++){var _0x598979=events[_0x44db59];var _0x41e069=createListener(_0xb1ff('0x6')+_0x598979,_0x1e8557);UserEvents['on'](_0x598979,_0x41e069);}}; \ No newline at end of file +var _0x163b=['emit','length','save','update'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x163b,0x136));var _0xb163=function(_0x1edc53,_0x4c096c){_0x1edc53=_0x1edc53-0x0;var _0x4cfe99=_0x163b[_0x1edc53];return _0x4cfe99;};'use strict';var UserEvents=require('./user.events');var events=[_0xb163('0x0'),'remove',_0xb163('0x1')];function createListener(_0x5b00ef,_0x471b4a){return function(_0x5efe0b){_0x471b4a[_0xb163('0x2')](_0x5b00ef,_0x5efe0b);};}function removeListener(_0x3418b7,_0x37e161){return function(){UserEvents['removeListener'](_0x3418b7,_0x37e161);};}exports['register']=function(_0x4959bb){for(var _0x32cb1a=0x0,_0x1a5c8b=events[_0xb163('0x3')];_0x32cb1a<_0x1a5c8b;_0x32cb1a++){var _0x466046=events[_0x32cb1a];var _0x782446=createListener('user:'+_0x466046,_0x4959bb);UserEvents['on'](_0x466046,_0x782446);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index fc0a7fc..cbb0d2a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x94b394,_0x3a714e){var _0x487784=function(_0x2bde57){while(--_0x2bde57){_0x94b394['push'](_0x94b394['shift']());}};_0x487784(++_0x3a714e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xcb91[_0x168127];return _0x4c99ad;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f4c65,_0x586cce){var _0x11b5c1=function(_0x2d904d){while(--_0x2d904d){_0x2f4c65['push'](_0x2f4c65['shift']());}};_0x11b5c1(++_0x586cce);}(_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 36132e9..2b9cb0a 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 _0xe3ab=['INTEGER','sequelize'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x20013a,_0x4d3cb6){_0x20013a=_0x20013a-0x0;var _0x39a7f6=_0xe3ab[_0x20013a];return _0x39a7f6;};'use strict';var Sequelize=require(_0xbe3a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbe3a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5e0=['sequelize','exports','INTEGER'];(function(_0x4acd4c,_0x4fd04d){var _0x2d5582=function(_0x50aebe){while(--_0x50aebe){_0x4acd4c['push'](_0x4acd4c['shift']());}};_0x2d5582(++_0x4fd04d);}(_0xe5e0,0x123));var _0x0e5e=function(_0x2baf68,_0x103dcb){_0x2baf68=_0x2baf68-0x0;var _0xe67f70=_0xe5e0[_0x2baf68];return _0xe67f70;};'use strict';var Sequelize=require(_0x0e5e('0x0'));module[_0x0e5e('0x1')]={'penalty':{'type':Sequelize[_0x0e5e('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 1832c3f..7216610 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 _0xee40=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x193c23,_0x314d5c){var _0x7b3170=function(_0x392461){while(--_0x392461){_0x193c23['push'](_0x193c23['shift']());}};_0x7b3170(++_0x314d5c);}(_0xee40,0x90));var _0x0ee4=function(_0x179194,_0xb7d58){_0x179194=_0x179194-0x0;var _0xeb37ba=_0xee40[_0x179194];return _0xeb37ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ee4('0x0'))(_0x0ee4('0x1'));var moment=require('moment');var BPromise=require(_0x0ee4('0x2'));var rp=require(_0x0ee4('0x3'));var fs=require('fs');var path=require(_0x0ee4('0x4'));var rimraf=require('rimraf');var config=require(_0x0ee4('0x5'));var attributes=require(_0x0ee4('0x6'));module[_0x0ee4('0x7')]=function(_0x78f0ca,_0x4fe5e0){return _0x78f0ca['define'](_0x0ee4('0x8'),attributes,{'tableName':_0x0ee4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7aa=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserChatQueue'];(function(_0x34c25f,_0x251723){var _0x69717c=function(_0x2ae2e6){while(--_0x2ae2e6){_0x34c25f['push'](_0x34c25f['shift']());}};_0x69717c(++_0x251723);}(_0xb7aa,0xf1));var _0xab7a=function(_0x10ad76,_0x4fc94a){_0x10ad76=_0x10ad76-0x0;var _0x1ced1a=_0xb7aa[_0x10ad76];return _0x1ced1a;};'use strict';var _=require(_0xab7a('0x0'));var util=require(_0xab7a('0x1'));var logger=require(_0xab7a('0x2'))(_0xab7a('0x3'));var moment=require(_0xab7a('0x4'));var BPromise=require(_0xab7a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab7a('0x6'));var rimraf=require('rimraf');var config=require(_0xab7a('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xab7a('0x8')]=function(_0x4b5487,_0x50b83e){return _0x4b5487[_0xab7a('0x9')](_0xab7a('0xa'),attributes,{'tableName':_0xab7a('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 1b13a9f..745462a 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 _0x5338=['then','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x20f3bc,_0x34c2fd){var _0x2e0502=function(_0x14dd1a){while(--_0x14dd1a){_0x20f3bc['push'](_0x20f3bc['shift']());}};_0x2e0502(++_0x34c2fd);}(_0x5338,0xc4));var _0x8533=function(_0x1a9080,_0x4aedc1){_0x1a9080=_0x1a9080-0x0;var _0x3bd76b=_0x5338[_0x1a9080];return _0x3bd76b;};'use strict';var _=require('lodash');var util=require(_0x8533('0x0'));var moment=require(_0x8533('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8533('0x2'));var db=require(_0x8533('0x3'))['db'];var utils=require(_0x8533('0x4'));var logger=require('../../config/logger')(_0x8533('0x5'));var config=require(_0x8533('0x6'));var jayson=require(_0x8533('0x7'));var client=jayson[_0x8533('0x8')][_0x8533('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db6cf,_0x2b4811,_0x339e0e){return new BPromise(function(_0x3583d1,_0x1996de){return client[_0x8533('0xa')](_0x3db6cf,_0x339e0e)[_0x8533('0xb')](function(_0x2716c0){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x2b4811,'request\x20sent');logger[_0x8533('0xc')](_0x8533('0xd'),_0x2b4811,_0x8533('0xe'),JSON[_0x8533('0xf')](_0x2716c0));if(_0x2716c0[_0x8533('0x10')]){if(_0x2716c0[_0x8533('0x10')][_0x8533('0x11')]===0x1f4){logger['error'](_0x8533('0x12'),_0x2b4811,_0x2716c0[_0x8533('0x10')][_0x8533('0x13')]);return _0x1996de(_0x2716c0[_0x8533('0x10')][_0x8533('0x13')]);}logger['error'](_0x8533('0x12'),_0x2b4811,_0x2716c0[_0x8533('0x10')][_0x8533('0x13')]);return _0x3583d1(_0x2716c0[_0x8533('0x10')]['message']);}else{logger[_0x8533('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x2b4811,'request\x20sent');_0x3583d1(_0x2716c0[_0x8533('0x15')]['message']);}})[_0x8533('0x16')](function(_0x270174){logger[_0x8533('0x10')](_0x8533('0x12'),_0x2b4811,_0x270174);_0x1996de(_0x270174);});});} \ No newline at end of file +var _0x6673=['info','result','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0x6673,0x1c4));var _0x3667=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6673[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x3667('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3667('0x1'));var rs=require(_0x3667('0x2'));var fs=require('fs');var Redis=require(_0x3667('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3667('0x4'))(_0x3667('0x5'));var config=require(_0x3667('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3667('0x7')][_0x3667('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a27f2,_0x5871e8,_0x2b2697){return new BPromise(function(_0x3aeb1a,_0x5d534e){return client[_0x3667('0x9')](_0x1a27f2,_0x2b2697)[_0x3667('0xa')](function(_0x4b620f){logger['info'](_0x3667('0xb'),_0x5871e8,_0x3667('0xc'));logger['debug'](_0x3667('0xd'),_0x5871e8,_0x3667('0xc'),JSON['stringify'](_0x4b620f));if(_0x4b620f[_0x3667('0xe')]){if(_0x4b620f[_0x3667('0xe')]['code']===0x1f4){logger['error'](_0x3667('0xb'),_0x5871e8,_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);return _0x5d534e(_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);}logger['error'](_0x3667('0xb'),_0x5871e8,_0x4b620f[_0x3667('0xe')]['message']);return _0x3aeb1a(_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);}else{logger[_0x3667('0x10')](_0x3667('0xb'),_0x5871e8,'request\x20sent');_0x3aeb1a(_0x4b620f[_0x3667('0x11')]['message']);}})['catch'](function(_0x12570d){logger[_0x3667('0xe')](_0x3667('0xb'),_0x5871e8,_0x12570d);_0x5d534e(_0x12570d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index fab8359..d383db3 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(_0x1cf313,_0x76dda2){var _0xde7899=function(_0x9f04d4){while(--_0x9f04d4){_0x1cf313['push'](_0x1cf313['shift']());}};_0xde7899(++_0x76dda2);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f9d1f,_0x19595b){var _0x8d6f77=function(_0x12ba31){while(--_0x12ba31){_0x1f9d1f['push'](_0x1f9d1f['shift']());}};_0x8d6f77(++_0x19595b);}(_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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 561099e..0581012 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 _0xbe3e=['INTEGER','STRING','sequelize','exports'];(function(_0x1bd6a3,_0x205fa4){var _0x373be8=function(_0x5bf092){while(--_0x5bf092){_0x1bd6a3['push'](_0x1bd6a3['shift']());}};_0x373be8(++_0x205fa4);}(_0xbe3e,0xb2));var _0xebe3=function(_0x38300b,_0x21c200){_0x38300b=_0x38300b-0x0;var _0x2e0e18=_0xbe3e[_0x38300b];return _0x2e0e18;};'use strict';var Sequelize=require(_0xebe3('0x0'));module[_0xebe3('0x1')]={'penalty':{'type':Sequelize[_0xebe3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xebe3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xebe3('0x3')]}}; \ No newline at end of file +var _0xeeee=['STRING','sequelize','INTEGER'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xeeee,0x190));var _0xeeee=function(_0x439649,_0x146aa5){_0x439649=_0x439649-0x0;var _0xdabc09=_0xeeee[_0x439649];return _0xdabc09;};'use strict';var Sequelize=require(_0xeeee('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xeeee('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeeee('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeeee('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1629419..a2365c0 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 _0xd1a7=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x1398b1,_0x5e0318){var _0x3ee504=function(_0x163c9e){while(--_0x163c9e){_0x1398b1['push'](_0x1398b1['shift']());}};_0x3ee504(++_0x5e0318);}(_0xd1a7,0x16b));var _0x7d1a=function(_0x3846a4,_0x77681d){_0x3846a4=_0x3846a4-0x0;var _0x14b44f=_0xd1a7[_0x3846a4];return _0x14b44f;};'use strict';var _=require(_0x7d1a('0x0'));var util=require('util');var logger=require(_0x7d1a('0x1'))(_0x7d1a('0x2'));var moment=require('moment');var BPromise=require(_0x7d1a('0x3'));var rp=require(_0x7d1a('0x4'));var fs=require('fs');var path=require(_0x7d1a('0x5'));var rimraf=require(_0x7d1a('0x6'));var config=require(_0x7d1a('0x7'));var attributes=require(_0x7d1a('0x8'));module['exports']=function(_0x19c91d,_0x5cc818){return _0x19c91d['define'](_0x7d1a('0x9'),attributes,{'tableName':_0x7d1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0af=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xb0af,0xc2));var _0xfb0a=function(_0x657ba0,_0x793539){_0x657ba0=_0x657ba0-0x0;var _0x141b6e=_0xb0af[_0x657ba0];return _0x141b6e;};'use strict';var _=require(_0xfb0a('0x0'));var util=require(_0xfb0a('0x1'));var logger=require(_0xfb0a('0x2'))(_0xfb0a('0x3'));var moment=require(_0xfb0a('0x4'));var BPromise=require(_0xfb0a('0x5'));var rp=require(_0xfb0a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb0a('0x7'));var config=require(_0xfb0a('0x8'));var attributes=require(_0xfb0a('0x9'));module[_0xfb0a('0xa')]=function(_0x2ebe23,_0x41c75e){return _0x2ebe23['define'](_0xfb0a('0xb'),attributes,{'tableName':_0xfb0a('0xc'),'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 700e653..bfcdc24 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 _0x8045=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8045,0x1bb));var _0x5804=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x8045[_0x15b380];return _0x232c5c;};'use strict';var _=require('lodash');var util=require(_0x5804('0x0'));var moment=require('moment');var BPromise=require(_0x5804('0x1'));var rs=require(_0x5804('0x2'));var fs=require('fs');var Redis=require(_0x5804('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5804('0x4'));var logger=require(_0x5804('0x5'))(_0x5804('0x6'));var config=require(_0x5804('0x7'));var jayson=require(_0x5804('0x8'));var client=jayson['client'][_0x5804('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3671bf,_0x1593e5,_0x23213b){return new BPromise(function(_0x59c2c9,_0x3bd608){return client[_0x5804('0xa')](_0x3671bf,_0x23213b)['then'](function(_0xa0877d){logger['info'](_0x5804('0xb'),_0x1593e5,_0x5804('0xc'));logger[_0x5804('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1593e5,_0x5804('0xc'),JSON[_0x5804('0xe')](_0xa0877d));if(_0xa0877d[_0x5804('0xf')]){if(_0xa0877d[_0x5804('0xf')][_0x5804('0x10')]===0x1f4){logger[_0x5804('0xf')](_0x5804('0xb'),_0x1593e5,_0xa0877d[_0x5804('0xf')]['message']);return _0x3bd608(_0xa0877d[_0x5804('0xf')][_0x5804('0x11')]);}logger[_0x5804('0xf')](_0x5804('0xb'),_0x1593e5,_0xa0877d['error'][_0x5804('0x11')]);return _0x59c2c9(_0xa0877d['error'][_0x5804('0x11')]);}else{logger[_0x5804('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x1593e5,_0x5804('0xc'));_0x59c2c9(_0xa0877d[_0x5804('0x13')][_0x5804('0x11')]);}})[_0x5804('0x14')](function(_0x4d1103){logger[_0x5804('0xf')](_0x5804('0xb'),_0x1593e5,_0x4d1103);_0x3bd608(_0x4d1103);});});} \ No newline at end of file +var _0x9795=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x68918f,_0x530067){var _0x3b8f6b=function(_0x59045c){while(--_0x59045c){_0x68918f['push'](_0x68918f['shift']());}};_0x3b8f6b(++_0x530067);}(_0x9795,0x1e8));var _0x5979=function(_0x31bc26,_0xd78fcd){_0x31bc26=_0x31bc26-0x0;var _0x27b72c=_0x9795[_0x31bc26];return _0x27b72c;};'use strict';var _=require(_0x5979('0x0'));var util=require(_0x5979('0x1'));var moment=require(_0x5979('0x2'));var BPromise=require(_0x5979('0x3'));var rs=require(_0x5979('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5979('0x5'))['db'];var utils=require(_0x5979('0x6'));var logger=require(_0x5979('0x7'))(_0x5979('0x8'));var config=require('../../config/environment');var jayson=require(_0x5979('0x9'));var client=jayson['client'][_0x5979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49d560,_0x4dfe6c,_0x33369e){return new BPromise(function(_0x101807,_0x40e29b){return client[_0x5979('0xb')](_0x49d560,_0x33369e)[_0x5979('0xc')](function(_0x207ea5){logger[_0x5979('0xd')](_0x5979('0xe'),_0x4dfe6c,'request\x20sent');logger['debug'](_0x5979('0xf'),_0x4dfe6c,_0x5979('0x10'),JSON['stringify'](_0x207ea5));if(_0x207ea5[_0x5979('0x11')]){if(_0x207ea5['error'][_0x5979('0x12')]===0x1f4){logger[_0x5979('0x11')](_0x5979('0xe'),_0x4dfe6c,_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);return _0x40e29b(_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);}logger[_0x5979('0x11')](_0x5979('0xe'),_0x4dfe6c,_0x207ea5[_0x5979('0x11')]['message']);return _0x101807(_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);}else{logger[_0x5979('0xd')](_0x5979('0xe'),_0x4dfe6c,_0x5979('0x10'));_0x101807(_0x207ea5[_0x5979('0x14')][_0x5979('0x13')]);}})[_0x5979('0x15')](function(_0x336d07){logger[_0x5979('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x4dfe6c,_0x336d07);_0x40e29b(_0x336d07);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7ccf37f..4852839 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3a41e2,_0xed4bdb){var _0x2237c6=function(_0x477fa1){while(--_0x477fa1){_0x3a41e2['push'](_0x3a41e2['shift']());}};_0x2237c6(++_0xed4bdb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5290ac,_0xeb37c6){var _0x9346ae=function(_0x37a945){while(--_0x37a945){_0x5290ac['push'](_0x5290ac['shift']());}};_0x9346ae(++_0xeb37c6);}(_0xe706,0xa3));var _0x6e70=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0xe706[_0x536755];return _0x2b9dde;};'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 44892c9..22e2f21 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 _0xe856=['INTEGER','sequelize'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xe856,0x6f));var _0x6e85=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe856[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x6e85('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6e85('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb57=['exports','sequelize'];(function(_0x4c3a36,_0xdba60f){var _0x40f945=function(_0x4efdb2){while(--_0x4efdb2){_0x4c3a36['push'](_0x4c3a36['shift']());}};_0x40f945(++_0xdba60f);}(_0xcb57,0xa1));var _0x7cb5=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xcb57[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x7cb5('0x0'));module[_0x7cb5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 6e52ae4..cfe1a8a 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 _0x6bf5=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues'];(function(_0x56ed55,_0x487396){var _0xabf00b=function(_0x381d19){while(--_0x381d19){_0x56ed55['push'](_0x56ed55['shift']());}};_0xabf00b(++_0x487396);}(_0x6bf5,0x1c7));var _0x56bf=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x6bf5[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x56bf('0x0'));var util=require('util');var logger=require(_0x56bf('0x1'))(_0x56bf('0x2'));var moment=require(_0x56bf('0x3'));var BPromise=require(_0x56bf('0x4'));var rp=require(_0x56bf('0x5'));var fs=require('fs');var path=require(_0x56bf('0x6'));var rimraf=require(_0x56bf('0x7'));var config=require(_0x56bf('0x8'));var attributes=require(_0x56bf('0x9'));module['exports']=function(_0x24deb4,_0x344e4b){return _0x24deb4[_0x56bf('0xa')](_0x56bf('0xb'),attributes,{'tableName':_0x56bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dee=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','user_has_mail_queues'];(function(_0x5683b0,_0x4233ea){var _0x2757e8=function(_0x1ef768){while(--_0x1ef768){_0x5683b0['push'](_0x5683b0['shift']());}};_0x2757e8(++_0x4233ea);}(_0x7dee,0x118));var _0xe7de=function(_0x4023d9,_0x2986bb){_0x4023d9=_0x4023d9-0x0;var _0x526cb2=_0x7dee[_0x4023d9];return _0x526cb2;};'use strict';var _=require(_0xe7de('0x0'));var util=require(_0xe7de('0x1'));var logger=require(_0xe7de('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe7de('0x3'));var fs=require('fs');var path=require(_0xe7de('0x4'));var rimraf=require(_0xe7de('0x5'));var config=require(_0xe7de('0x6'));var attributes=require(_0xe7de('0x7'));module[_0xe7de('0x8')]=function(_0x3ca425,_0x45f11c){return _0x3ca425['define']('UserMailQueue',attributes,{'tableName':_0xe7de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 73e142c..3bf42be 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xe6c38b,_0x3d6e8d){var _0x4fdc8e=function(_0x661116){while(--_0x661116){_0xe6c38b['push'](_0xe6c38b['shift']());}};_0x4fdc8e(++_0x3d6e8d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2c60d1,_0x5b778f){_0x2c60d1=_0x2c60d1-0x0;var _0xdf6e43=_0x7fbe[_0x2c60d1];return _0xdf6e43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x585199,_0x10d223){_0x585199=_0x585199-0x0;var _0x4f5eaf=_0x008c[_0x585199];return _0x4f5eaf;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6b5155e..19f2a31 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 _0xc1cd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util'];(function(_0x1eacfb,_0x42e533){var _0x2e49db=function(_0x1417cc){while(--_0x1417cc){_0x1eacfb['push'](_0x1eacfb['shift']());}};_0x2e49db(++_0x42e533);}(_0xc1cd,0x151));var _0xdc1c=function(_0x578c98,_0x29e5e4){_0x578c98=_0x578c98-0x0;var _0x507f59=_0xc1cd[_0x578c98];return _0x507f59;};'use strict';var multer=require('multer');var util=require(_0xdc1c('0x0'));var path=require('path');var timeout=require(_0xdc1c('0x1'));var express=require(_0xdc1c('0x2'));var router=express[_0xdc1c('0x3')]();var fs_extra=require(_0xdc1c('0x4'));var auth=require(_0xdc1c('0x5'));var interaction=require(_0xdc1c('0x6'));var config=require(_0xdc1c('0x7'));var controller=require(_0xdc1c('0x8'));router[_0xdc1c('0x9')]('/',auth[_0xdc1c('0xa')](),controller[_0xdc1c('0xb')]);module[_0xdc1c('0xc')]=router; \ No newline at end of file +var _0x50e2=['../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d79e9,_0xf787e1){var _0xd0befa=function(_0x26acb9){while(--_0x26acb9){_0x2d79e9['push'](_0x2d79e9['shift']());}};_0xd0befa(++_0xf787e1);}(_0x50e2,0x1d9));var _0x250e=function(_0x1e0d60,_0x503460){_0x1e0d60=_0x1e0d60-0x0;var _0x5b9564=_0x50e2[_0x1e0d60];return _0x5b9564;};'use strict';var multer=require(_0x250e('0x0'));var util=require(_0x250e('0x1'));var path=require('path');var timeout=require(_0x250e('0x2'));var express=require(_0x250e('0x3'));var router=express[_0x250e('0x4')]();var fs_extra=require(_0x250e('0x5'));var auth=require(_0x250e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x250e('0x7'));var controller=require(_0x250e('0x8'));router[_0x250e('0x9')]('/',auth[_0x250e('0xa')](),controller[_0x250e('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7920dca..4b743c7 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 _0x8503=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x5c693b,_0x19502d){var _0x4fd6f4=function(_0x433f9b){while(--_0x433f9b){_0x5c693b['push'](_0x5c693b['shift']());}};_0x4fd6f4(++_0x19502d);}(_0x8503,0x1eb));var _0x3850=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x8503[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x3850('0x0'));module[_0x3850('0x1')]={'body':{'type':Sequelize[_0x3850('0x2')]},'senderName':{'type':Sequelize[_0x3850('0x3')]},'recipientsId':{'type':Sequelize[_0x3850('0x2')]},'recipientsDescription':{'type':Sequelize[_0x3850('0x3')]},'beep':{'type':Sequelize[_0x3850('0x4')]}}; \ No newline at end of file +var _0x3060=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1943d2,_0x586cc8){var _0x3f4100=function(_0x4d0ead){while(--_0x4d0ead){_0x1943d2['push'](_0x1943d2['shift']());}};_0x3f4100(++_0x586cc8);}(_0x3060,0xfc));var _0x0306=function(_0x51a0a9,_0x569499){_0x51a0a9=_0x51a0a9-0x0;var _0x4bd20c=_0x3060[_0x51a0a9];return _0x4bd20c;};'use strict';var Sequelize=require('sequelize');module[_0x0306('0x0')]={'body':{'type':Sequelize[_0x0306('0x1')]},'senderName':{'type':Sequelize[_0x0306('0x2')]},'recipientsId':{'type':Sequelize[_0x0306('0x1')]},'recipientsDescription':{'type':Sequelize[_0x0306('0x2')]},'beep':{'type':Sequelize[_0x0306('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 0368d55..f5c0156 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 _0x9ddf=['flatten','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','User','ids','replace','queue','all','union'];(function(_0x147cf3,_0x115faf){var _0x34e398=function(_0x4f2ad0){while(--_0x4f2ad0){_0x147cf3['push'](_0x147cf3['shift']());}};_0x34e398(++_0x115faf);}(_0x9ddf,0x12e));var _0xf9dd=function(_0x457015,_0x9e9222){_0x457015=_0x457015-0x0;var _0x2ea118=_0x9ddf[_0x457015];return _0x2ea118;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf9dd('0x0'));var jsonpatch=require(_0xf9dd('0x1'));var rp=require(_0xf9dd('0x2'));var moment=require(_0xf9dd('0x3'));var BPromise=require(_0xf9dd('0x4'));var Mustache=require(_0xf9dd('0x5'));var util=require(_0xf9dd('0x6'));var path=require(_0xf9dd('0x7'));var sox=require(_0xf9dd('0x8'));var csv=require(_0xf9dd('0x9'));var ejs=require(_0xf9dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9dd('0xb'));var squel=require(_0xf9dd('0xc'));var crypto=require('crypto');var jsforce=require(_0xf9dd('0xd'));var deskjs=require(_0xf9dd('0xe'));var toCsv=require(_0xf9dd('0x9'));var querystring=require('querystring');var Papa=require(_0xf9dd('0xf'));var Redis=require(_0xf9dd('0x10'));var authService=require(_0xf9dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf9dd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9dd('0x13'))(_0xf9dd('0x14'));var utils=require(_0xf9dd('0x15'));var config=require(_0xf9dd('0x16'));var licenseUtil=require(_0xf9dd('0x17'));var db=require(_0xf9dd('0x18'))['db'];config[_0xf9dd('0x19')]=_[_0xf9dd('0x1a')](config[_0xf9dd('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9dd('0x19')]));require(_0xf9dd('0x1b'))[_0xf9dd('0x1c')](socket);function respondWithStatusCode(_0x154d5f,_0x1179e0){_0x1179e0=_0x1179e0||0xcc;return function(_0x3137ca){if(_0x3137ca){return _0x154d5f[_0xf9dd('0x1d')](_0x1179e0);}return _0x154d5f[_0xf9dd('0x1e')](_0x1179e0)[_0xf9dd('0x1f')]();};}function respondWithResult(_0x1906c6,_0x40b947){_0x40b947=_0x40b947||0xc8;return function(_0x1b3edb){if(_0x1b3edb){return _0x1906c6[_0xf9dd('0x1e')](_0x40b947)[_0xf9dd('0x20')](_0x1b3edb);}};}function respondWithFilteredResult(_0x1799df,_0x226328){return function(_0x488c6f){if(_0x488c6f){var _0x497592=typeof _0x226328[_0xf9dd('0x21')]==='undefined'&&typeof _0x226328[_0xf9dd('0x22')]===_0xf9dd('0x23');var _0x7c3544=_0x488c6f['count'];var _0x206112=_0x497592?0x0:_0x226328[_0xf9dd('0x21')];var _0x276216=_0x497592?_0x488c6f[_0xf9dd('0x24')]:_0x226328['offset']+_0x226328[_0xf9dd('0x22')];var _0x1ce88a;if(_0x276216>=_0x7c3544){_0x276216=_0x7c3544;_0x1ce88a=0xc8;}else{_0x1ce88a=0xce;}_0x1799df[_0xf9dd('0x1e')](_0x1ce88a);return _0x1799df[_0xf9dd('0x25')](_0xf9dd('0x26'),_0x206112+'-'+_0x276216+'/'+_0x7c3544)[_0xf9dd('0x20')](_0x488c6f);}return null;};}function patchUpdates(_0x17dd9d){return function(_0x4f1827){try{jsonpatch['apply'](_0x4f1827,_0x17dd9d,!![]);}catch(_0x5308a8){return BPromise[_0xf9dd('0x27')](_0x5308a8);}return _0x4f1827['save']();};}function saveUpdates(_0x356d7e,_0x97a510){return function(_0x1f8be5){if(_0x1f8be5){return _0x1f8be5[_0xf9dd('0x28')](_0x356d7e)[_0xf9dd('0x29')](function(_0x309eee){return _0x309eee;});}return null;};}function removeEntity(_0x7af24d,_0x1cabd6){return function(_0x1a8e66){if(_0x1a8e66){return _0x1a8e66[_0xf9dd('0x2a')]()[_0xf9dd('0x29')](function(){_0x7af24d[_0xf9dd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x344369,_0x5ec918){return function(_0x21e97f){if(!_0x21e97f){_0x344369[_0xf9dd('0x1d')](0x194);}return _0x21e97f;};}function handleError(_0x5a8d9f,_0x2906a5){_0x2906a5=_0x2906a5||0x1f4;return function(_0x164e8f){logger[_0xf9dd('0x2b')](_0x164e8f[_0xf9dd('0x2c')]);if(_0x164e8f[_0xf9dd('0x2d')]){delete _0x164e8f['name'];}_0x5a8d9f[_0xf9dd('0x1e')](_0x2906a5)['send'](_0x164e8f);};}exports[_0xf9dd('0x2e')]=function(_0x44b629,_0x471309,_0x25303c){if(!_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x30')](_0xf9dd('0x31'))&&!_0x44b629[_0xf9dd('0x2f')]['hasOwnProperty'](_0xf9dd('0x32'))){throw new db[(_0xf9dd('0x33'))][(_0xf9dd('0x34'))](_0xf9dd('0x35'));}else{if(_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x30')](_0xf9dd('0x32'))&&!_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x30')](_0xf9dd('0x36'))){throw new db['Sequelize'][(_0xf9dd('0x34'))](_0xf9dd('0x37'));}if(!_0x44b629[_0xf9dd('0x2f')]['hasOwnProperty'](_0xf9dd('0x38'))){throw new db['Sequelize'][(_0xf9dd('0x34'))](_0xf9dd('0x39'));}else{try{var _0x38d005=JSON[_0xf9dd('0x3a')](_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x38')]);}catch(_0x76f7c3){logger[_0xf9dd('0x2b')](_0x76f7c3);throw new db[(_0xf9dd('0x33'))][(_0xf9dd('0x34'))](_0xf9dd('0x3b'));}var _0x44ac94=[_0xf9dd('0x3c'),_0xf9dd('0x3d'),_0xf9dd('0x3e'),_0xf9dd('0x3f'),_0xf9dd('0x40'),_0xf9dd('0x41'),'whatsappqueue',_0xf9dd('0x42'),_0xf9dd('0x43')];if(_['some'](_0x38d005,function(_0x15db52){return!_[_0xf9dd('0x44')](_0x44ac94,_0x15db52[_0xf9dd('0x45')][_0xf9dd('0x46')]());})){throw new db[(_0xf9dd('0x33'))][(_0xf9dd('0x34'))](_0xf9dd('0x47'));}}}var _0x4cf8bc={};_0x4cf8bc['senderName']=_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x30')](_0xf9dd('0x48'))?_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x48')]:_0x44b629[_0xf9dd('0x43')][_0xf9dd('0x49')];_0x4cf8bc[_0xf9dd('0x4a')]=_['isEmpty'](_0x44b629[_0xf9dd('0x2f')][_0xf9dd('0x4a')])?null:_0x44b629[_0xf9dd('0x2f')]['recipientsDescription'];_0x4cf8bc[_0xf9dd('0x4b')]=_0x44b629['body'][_0xf9dd('0x4b')]||![];_0x4cf8bc[_0xf9dd('0x4c')]=_0x44b629[_0xf9dd('0x43')]['id'];return getContent(_0x44b629['body'])[_0xf9dd('0x29')](function(_0x2ecc6d){_0x4cf8bc[_0xf9dd('0x2f')]=_0x2ecc6d;return getRecipients(_0x38d005);})[_0xf9dd('0x29')](function(_0xd6af5){_0x4cf8bc[_0xf9dd('0x4d')]=_['sortBy'](_0xd6af5)[_0xf9dd('0x4e')](',');return db[_0xf9dd('0x4f')]['transaction'](function(_0x614449){return db[_0xf9dd('0x50')][_0xf9dd('0x51')](_0x4cf8bc,{'raw':!![],'transaction':_0x614449})[_0xf9dd('0x29')](function(_0x4b086f){var _0x1c88e3={'sender':_0x4cf8bc[_0xf9dd('0x48')],'description':_0x4cf8bc[_0xf9dd('0x4a')],'content':_0x4cf8bc[_0xf9dd('0x2f')],'beep':_0x4cf8bc['beep']};_0xd6af5[_0xf9dd('0x52')](function(_0x16985b){_0x1c88e3[_0xf9dd('0x53')]=_0x16985b;socket[_0xf9dd('0x54')](_0xf9dd('0x55'),_0x1c88e3);});return _0x4b086f;});});})[_0xf9dd('0x29')](respondWithResult(_0x471309,0xc9))['catch'](handleError(_0x471309,null));};function getContent(_0x46ef9){return new BPromise(function(_0x2b7e09,_0x40e850){if(_0x46ef9[_0xf9dd('0x31')]){_0x2b7e09(_0x46ef9['text']);return;}return db[_0xf9dd('0x56')][_0xf9dd('0x57')]({'attributes':[_0xf9dd('0x58')],'where':{'id':_0x46ef9[_0xf9dd('0x32')]},'raw':!![]})[_0xf9dd('0x29')](function(_0x300756){if(!_0x300756)throw new db[(_0xf9dd('0x33'))][(_0xf9dd('0x34'))](_0xf9dd('0x59'));var _0x52e710=Mustache[_0xf9dd('0x5a')](_0x300756[_0xf9dd('0x58')],_0x46ef9['view']);_0x2b7e09(_0x52e710);})[_0xf9dd('0x5b')](function(_0x503d26){_0x40e850(_0x503d26);});});}function getRecipients(_0x383035){return new BPromise(function(_0x236c82,_0x4c2c66){var _0x235226=[];var _0x1e5004=[];_0x383035[_0xf9dd('0x52')](function(_0x408a07){var _0x23dad9=_['startCase'](_0x408a07[_0xf9dd('0x45')]['toLowerCase']());if(_0x23dad9===_0xf9dd('0x5c')){_0x235226=_['union'](_0x235226,_0x408a07[_0xf9dd('0x5d')]);}else{if(_[_0xf9dd('0x44')](_0x23dad9,'queue'))_0x23dad9=_0x23dad9[_0xf9dd('0x5e')](_0xf9dd('0x5f'),'Queue');_0x408a07[_0xf9dd('0x5d')]['forEach'](function(_0x2eccf4){_0x1e5004['push'](getAgents(_0x23dad9,_0x2eccf4));});}});return BPromise[_0xf9dd('0x60')](_0x1e5004)['then'](function(_0x2e6bb6){_0x235226=_[_0xf9dd('0x61')](_0x235226,_[_0xf9dd('0x62')](_0x2e6bb6));_0x236c82(_0x235226);})[_0xf9dd('0x5b')](function(_0x5a8ecf){_0x4c2c66(_0x5a8ecf);});});}function getAgents(_0x3729e4,_0x4a3a99){return new BPromise(function(_0x113edf,_0x446158){return db[_0x3729e4][_0xf9dd('0x57')]({'where':{'id':_0x4a3a99}})[_0xf9dd('0x29')](function(_0x5b4b01){return _0x5b4b01[_0xf9dd('0x63')]({'attributes':['id'],'raw':!![]})[_0xf9dd('0x29')](function(_0x36e1b1){var _0x43f588=_['map'](_0x36e1b1,'id');_0x113edf(_0x43f588);});})[_0xf9dd('0x5b')](function(_0x3fa970){_0x446158(_0x3fa970);});});} \ No newline at end of file +var _0xcf68=['includes','queue','replace','forEach','push','all','union','getAgents','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','error','name','send','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','voicequeue','team','user','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','Template','findOne','html','render','startCase','model','User','ids'];(function(_0x34560d,_0x65474c){var _0x69891=function(_0x4e7b09){while(--_0x4e7b09){_0x34560d['push'](_0x34560d['shift']());}};_0x69891(++_0x65474c);}(_0xcf68,0xc2));var _0x8cf6=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcf68[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cf6('0x0'));var zipdir=require(_0x8cf6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cf6('0x2'));var util=require(_0x8cf6('0x3'));var path=require(_0x8cf6('0x4'));var sox=require('sox');var csv=require(_0x8cf6('0x5'));var ejs=require(_0x8cf6('0x6'));var fs=require('fs');var fs_extra=require(_0x8cf6('0x7'));var _=require('lodash');var squel=require(_0x8cf6('0x8'));var crypto=require('crypto');var jsforce=require(_0x8cf6('0x9'));var deskjs=require(_0x8cf6('0xa'));var toCsv=require(_0x8cf6('0x5'));var querystring=require('querystring');var Papa=require(_0x8cf6('0xb'));var Redis=require(_0x8cf6('0xc'));var authService=require(_0x8cf6('0xd'));var qs=require(_0x8cf6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cf6('0xf'))(_0x8cf6('0x10'));var utils=require('../../config/utils');var config=require(_0x8cf6('0x11'));var licenseUtil=require(_0x8cf6('0x12'));var db=require('../../mysqldb')['db'];config[_0x8cf6('0x13')]=_[_0x8cf6('0x14')](config[_0x8cf6('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cf6('0x15'))(new Redis(config[_0x8cf6('0x13')]));require('./userNotification.socket')[_0x8cf6('0x16')](socket);function respondWithStatusCode(_0xa780c2,_0x25c577){_0x25c577=_0x25c577||0xcc;return function(_0x23b8ad){if(_0x23b8ad){return _0xa780c2[_0x8cf6('0x17')](_0x25c577);}return _0xa780c2[_0x8cf6('0x18')](_0x25c577)[_0x8cf6('0x19')]();};}function respondWithResult(_0x58a996,_0x30e2b4){_0x30e2b4=_0x30e2b4||0xc8;return function(_0x32b6e2){if(_0x32b6e2){return _0x58a996[_0x8cf6('0x18')](_0x30e2b4)[_0x8cf6('0x1a')](_0x32b6e2);}};}function respondWithFilteredResult(_0x1ad598,_0x3de35f){return function(_0x228bce){if(_0x228bce){var _0x3f67d8=typeof _0x3de35f['offset']==='undefined'&&typeof _0x3de35f[_0x8cf6('0x1b')]===_0x8cf6('0x1c');var _0x1fbd0e=_0x228bce[_0x8cf6('0x1d')];var _0x2e5a2e=_0x3f67d8?0x0:_0x3de35f[_0x8cf6('0x1e')];var _0x4e5b8c=_0x3f67d8?_0x228bce[_0x8cf6('0x1d')]:_0x3de35f[_0x8cf6('0x1e')]+_0x3de35f[_0x8cf6('0x1b')];var _0x1ee6ac;if(_0x4e5b8c>=_0x1fbd0e){_0x4e5b8c=_0x1fbd0e;_0x1ee6ac=0xc8;}else{_0x1ee6ac=0xce;}_0x1ad598['status'](_0x1ee6ac);return _0x1ad598[_0x8cf6('0x1f')](_0x8cf6('0x20'),_0x2e5a2e+'-'+_0x4e5b8c+'/'+_0x1fbd0e)[_0x8cf6('0x1a')](_0x228bce);}return null;};}function patchUpdates(_0x5eb698){return function(_0x312bfa){try{jsonpatch[_0x8cf6('0x21')](_0x312bfa,_0x5eb698,!![]);}catch(_0x850a10){return BPromise['reject'](_0x850a10);}return _0x312bfa['save']();};}function saveUpdates(_0x3c2794,_0x2f3c84){return function(_0x5e8a98){if(_0x5e8a98){return _0x5e8a98[_0x8cf6('0x22')](_0x3c2794)[_0x8cf6('0x23')](function(_0x35bd71){return _0x35bd71;});}return null;};}function removeEntity(_0x5b7f15,_0x313367){return function(_0x249084){if(_0x249084){return _0x249084[_0x8cf6('0x24')]()['then'](function(){_0x5b7f15['status'](0xcc)[_0x8cf6('0x19')]();});}};}function handleEntityNotFound(_0x234ed7,_0x2eb058){return function(_0x385df9){if(!_0x385df9){_0x234ed7['sendStatus'](0x194);}return _0x385df9;};}function handleError(_0x5e0481,_0xad2e33){_0xad2e33=_0xad2e33||0x1f4;return function(_0x5976ff){logger[_0x8cf6('0x25')](_0x5976ff['stack']);if(_0x5976ff[_0x8cf6('0x26')]){delete _0x5976ff[_0x8cf6('0x26')];}_0x5e0481[_0x8cf6('0x18')](_0xad2e33)[_0x8cf6('0x27')](_0x5976ff);};}exports['sendUserNotification']=function(_0x27c46a,_0x29f80c,_0x150c52){if(!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2a'))&&!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')]('TemplateId')){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x2d'));}else{if(_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2e'))&&!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2f'))){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x30'));}if(!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x31'))){throw new db[(_0x8cf6('0x2b'))]['ValidationError'](_0x8cf6('0x32'));}else{try{var _0x1ecf14=JSON[_0x8cf6('0x33')](_0x27c46a['body']['recipients']);}catch(_0x1f6556){logger[_0x8cf6('0x25')](_0x1f6556);throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x34'));}var _0xa05594=[_0x8cf6('0x35'),_0x8cf6('0x36'),_0x8cf6('0x37'),'openchannelqueue','smsqueue',_0x8cf6('0x38'),'whatsappqueue',_0x8cf6('0x39'),_0x8cf6('0x3a')];if(_['some'](_0x1ecf14,function(_0x227082){return!_['includes'](_0xa05594,_0x227082['model'][_0x8cf6('0x3b')]());})){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x3c'));}}}var _0x163a20={};_0x163a20[_0x8cf6('0x3d')]=_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x3d'))?_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x3d')]:_0x27c46a[_0x8cf6('0x3a')][_0x8cf6('0x3e')];_0x163a20[_0x8cf6('0x3f')]=_[_0x8cf6('0x40')](_0x27c46a[_0x8cf6('0x28')]['recipientsDescription'])?null:_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x3f')];_0x163a20[_0x8cf6('0x41')]=_0x27c46a['body'][_0x8cf6('0x41')]||![];_0x163a20[_0x8cf6('0x42')]=_0x27c46a[_0x8cf6('0x3a')]['id'];return getContent(_0x27c46a[_0x8cf6('0x28')])[_0x8cf6('0x23')](function(_0x4b9e6c){_0x163a20[_0x8cf6('0x28')]=_0x4b9e6c;return getRecipients(_0x1ecf14);})[_0x8cf6('0x23')](function(_0xe480e4){_0x163a20[_0x8cf6('0x43')]=_[_0x8cf6('0x44')](_0xe480e4)[_0x8cf6('0x45')](',');return db['sequelize'][_0x8cf6('0x46')](function(_0x4e76d7){return db[_0x8cf6('0x47')][_0x8cf6('0x48')](_0x163a20,{'raw':!![],'transaction':_0x4e76d7})[_0x8cf6('0x23')](function(_0x1ff58f){var _0x4a8f2b={'sender':_0x163a20[_0x8cf6('0x3d')],'description':_0x163a20['recipientsDescription'],'content':_0x163a20['body'],'beep':_0x163a20[_0x8cf6('0x41')]};_0xe480e4['forEach'](function(_0x25ce8e){_0x4a8f2b[_0x8cf6('0x49')]=_0x25ce8e;socket[_0x8cf6('0x4a')](_0x8cf6('0x4b'),_0x4a8f2b);});return _0x1ff58f;});});})[_0x8cf6('0x23')](respondWithResult(_0x29f80c,0xc9))[_0x8cf6('0x4c')](handleError(_0x29f80c,null));};function getContent(_0x2b4bde){return new BPromise(function(_0xaa0d6,_0x35572d){if(_0x2b4bde['text']){_0xaa0d6(_0x2b4bde[_0x8cf6('0x2a')]);return;}return db[_0x8cf6('0x4d')][_0x8cf6('0x4e')]({'attributes':[_0x8cf6('0x4f')],'where':{'id':_0x2b4bde[_0x8cf6('0x2e')]},'raw':!![]})[_0x8cf6('0x23')](function(_0x58dc59){if(!_0x58dc59)throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2f2a24=Mustache[_0x8cf6('0x50')](_0x58dc59['html'],_0x2b4bde[_0x8cf6('0x2f')]);_0xaa0d6(_0x2f2a24);})[_0x8cf6('0x4c')](function(_0x2d9d23){_0x35572d(_0x2d9d23);});});}function getRecipients(_0x33d698){return new BPromise(function(_0xe034aa,_0x25e56e){var _0x9985d8=[];var _0x178690=[];_0x33d698['forEach'](function(_0x4c4d84){var _0x25a0a3=_[_0x8cf6('0x51')](_0x4c4d84[_0x8cf6('0x52')][_0x8cf6('0x3b')]());if(_0x25a0a3===_0x8cf6('0x53')){_0x9985d8=_['union'](_0x9985d8,_0x4c4d84[_0x8cf6('0x54')]);}else{if(_[_0x8cf6('0x55')](_0x25a0a3,_0x8cf6('0x56')))_0x25a0a3=_0x25a0a3[_0x8cf6('0x57')](_0x8cf6('0x56'),'Queue');_0x4c4d84[_0x8cf6('0x54')][_0x8cf6('0x58')](function(_0x6be1b7){_0x178690[_0x8cf6('0x59')](getAgents(_0x25a0a3,_0x6be1b7));});}});return BPromise[_0x8cf6('0x5a')](_0x178690)['then'](function(_0x4ac3fb){_0x9985d8=_[_0x8cf6('0x5b')](_0x9985d8,_['flatten'](_0x4ac3fb));_0xe034aa(_0x9985d8);})['catch'](function(_0x18c1ed){_0x25e56e(_0x18c1ed);});});}function getAgents(_0x4821cc,_0x5eed35){return new BPromise(function(_0x492d76,_0x5a6a29){return db[_0x4821cc]['findOne']({'where':{'id':_0x5eed35}})[_0x8cf6('0x23')](function(_0x5a9baf){return _0x5a9baf[_0x8cf6('0x5c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36f408){var _0xc36e5=_['map'](_0x36f408,'id');_0x492d76(_0xc36e5);});})[_0x8cf6('0x4c')](function(_0x462346){_0x5a6a29(_0x462346);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bbfa099..aab4bc9 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 _0x2caa=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x911aa,_0x5cb8b5){var _0x327202=function(_0x52308e){while(--_0x52308e){_0x911aa['push'](_0x911aa['shift']());}};_0x327202(++_0x5cb8b5);}(_0x2caa,0x183));var _0xa2ca=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x2caa[_0x2053ea];return _0x2232c4;};'use strict';var EventEmitter=require(_0xa2ca('0x0'));var UserNotification=require(_0xa2ca('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa2ca('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2ca('0x3'),'afterDestroy':_0xa2ca('0x4')};function emitEvent(_0x5948b7){return function(_0x1e228b,_0x13f690,_0x424f6e){UserNotificationEvents[_0xa2ca('0x5')](_0x5948b7+':'+_0x1e228b['id'],_0x1e228b);UserNotificationEvents[_0xa2ca('0x5')](_0x5948b7,_0x1e228b);_0x424f6e(null);};}for(var e in events){if(events[_0xa2ca('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xa2ca('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xbaec=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xadd417,_0x207028){var _0x5c79e7=function(_0xa07df0){while(--_0xa07df0){_0xadd417['push'](_0xadd417['shift']());}};_0x5c79e7(++_0x207028);}(_0xbaec,0x122));var _0xcbae=function(_0x24c135,_0xdb4450){_0x24c135=_0x24c135-0x0;var _0x290c66=_0xbaec[_0x24c135];return _0x290c66;};'use strict';var EventEmitter=require(_0xcbae('0x0'));var UserNotification=require(_0xcbae('0x1'))['db'][_0xcbae('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcbae('0x3')](0x0);var events={'afterCreate':_0xcbae('0x4'),'afterUpdate':_0xcbae('0x5'),'afterDestroy':'remove'};function emitEvent(_0x33eddf){return function(_0x41c4b2,_0x115fc2,_0x5278fc){UserNotificationEvents['emit'](_0x33eddf+':'+_0x41c4b2['id'],_0x41c4b2);UserNotificationEvents[_0xcbae('0x6')](_0x33eddf,_0x41c4b2);_0x5278fc(null);};}for(var e in events){if(events[_0xcbae('0x7')](e)){var event=events[e];UserNotification[_0xcbae('0x8')](e,emitEvent(event));}}module[_0xcbae('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 b2f9bc7..0243501 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 _0x7141=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','UserNotification'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7141,0x187));var _0x1714=function(_0x5e8ce1,_0x4beb7c){_0x5e8ce1=_0x5e8ce1-0x0;var _0xe90f50=_0x7141[_0x5e8ce1];return _0xe90f50;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1714('0x0'))(_0x1714('0x1'));var moment=require(_0x1714('0x2'));var BPromise=require(_0x1714('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1714('0x4'));var rimraf=require(_0x1714('0x5'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x1714('0x6')]=function(_0x4ddcdc,_0x4cd1e3){return _0x4ddcdc[_0x1714('0x7')](_0x1714('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1714('0x9')});}; \ No newline at end of file +var _0x131e=['request-promise','path','rimraf','./userNotification.attributes','exports','define','api','moment','bluebird'];(function(_0x30bf70,_0xa26b27){var _0x1cb57e=function(_0x3c1f62){while(--_0x3c1f62){_0x30bf70['push'](_0x30bf70['shift']());}};_0x1cb57e(++_0xa26b27);}(_0x131e,0x1ec));var _0xe131=function(_0xadc531,_0x3ea75a){_0xadc531=_0xadc531-0x0;var _0x5f06bc=_0x131e[_0xadc531];return _0x5f06bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var rp=require(_0xe131('0x3'));var fs=require('fs');var path=require(_0xe131('0x4'));var rimraf=require(_0xe131('0x5'));var config=require('../../config/environment');var attributes=require(_0xe131('0x6'));module[_0xe131('0x7')]=function(_0x2de969,_0x1eb0df){return _0x2de969[_0xe131('0x8')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f5b4c53..e9631e6 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 _0xe211=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x513afe,_0x1bbdd2){var _0x4dea6b=function(_0x270699){while(--_0x270699){_0x513afe['push'](_0x513afe['shift']());}};_0x4dea6b(++_0x1bbdd2);}(_0xe211,0x1e9));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e21('0x0'));var util=require(_0x1e21('0x1'));var moment=require(_0x1e21('0x2'));var BPromise=require(_0x1e21('0x3'));var rs=require(_0x1e21('0x4'));var fs=require('fs');var Redis=require(_0x1e21('0x5'));var db=require(_0x1e21('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e21('0x7'))(_0x1e21('0x8'));var config=require(_0x1e21('0x9'));var jayson=require(_0x1e21('0xa'));var client=jayson[_0x1e21('0xb')]['http']({'port':0x232a});config[_0x1e21('0xc')]=_[_0x1e21('0xd')](config[_0x1e21('0xc')],{'host':_0x1e21('0xe'),'port':0x18eb});var socket=require(_0x1e21('0xf'))(new Redis(config[_0x1e21('0xc')]));require(_0x1e21('0x10'))['register'](socket);function respondWithRpcPromise(_0xfeefa3,_0x2e2a01,_0x530b88){return new BPromise(function(_0xe7cc74,_0x2a98c6){return client[_0x1e21('0x11')](_0xfeefa3,_0x530b88)['then'](function(_0x1be9ab){logger[_0x1e21('0x12')](_0x1e21('0x13'),_0x2e2a01,_0x1e21('0x14'));logger[_0x1e21('0x15')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2e2a01,_0x1e21('0x14'),JSON['stringify'](_0x1be9ab));if(_0x1be9ab[_0x1e21('0x16')]){if(_0x1be9ab[_0x1e21('0x16')][_0x1e21('0x17')]===0x1f4){logger[_0x1e21('0x16')](_0x1e21('0x13'),_0x2e2a01,_0x1be9ab['error'][_0x1e21('0x18')]);return _0x2a98c6(_0x1be9ab[_0x1e21('0x16')][_0x1e21('0x18')]);}logger[_0x1e21('0x16')]('UserNotification,\x20%s,\x20%s',_0x2e2a01,_0x1be9ab[_0x1e21('0x16')][_0x1e21('0x18')]);return _0xe7cc74(_0x1be9ab['error'][_0x1e21('0x18')]);}else{logger[_0x1e21('0x12')](_0x1e21('0x13'),_0x2e2a01,_0x1e21('0x14'));_0xe7cc74(_0x1be9ab[_0x1e21('0x19')][_0x1e21('0x18')]);}})[_0x1e21('0x1a')](function(_0x2399dc){logger[_0x1e21('0x16')](_0x1e21('0x13'),_0x2e2a01,_0x2399dc);_0x2a98c6(_0x2399dc);});});} \ No newline at end of file +var _0x1a64=['socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x1a64,0x1df));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41a6('0x0'));var util=require(_0x41a6('0x1'));var moment=require(_0x41a6('0x2'));var BPromise=require(_0x41a6('0x3'));var rs=require(_0x41a6('0x4'));var fs=require('fs');var Redis=require(_0x41a6('0x5'));var db=require(_0x41a6('0x6'))['db'];var utils=require(_0x41a6('0x7'));var logger=require(_0x41a6('0x8'))(_0x41a6('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x41a6('0xa')]({'port':0x232a});config[_0x41a6('0xb')]=_[_0x41a6('0xc')](config[_0x41a6('0xb')],{'host':_0x41a6('0xd'),'port':0x18eb});var socket=require(_0x41a6('0xe'))(new Redis(config[_0x41a6('0xb')]));require(_0x41a6('0xf'))[_0x41a6('0x10')](socket);function respondWithRpcPromise(_0x293a6e,_0x5bc5f6,_0x59d2d7){return new BPromise(function(_0x2617b2,_0x7a1fbb){return client[_0x41a6('0x11')](_0x293a6e,_0x59d2d7)['then'](function(_0x32716e){logger['info'](_0x41a6('0x12'),_0x5bc5f6,_0x41a6('0x13'));logger[_0x41a6('0x14')](_0x41a6('0x15'),_0x5bc5f6,_0x41a6('0x13'),JSON[_0x41a6('0x16')](_0x32716e));if(_0x32716e[_0x41a6('0x17')]){if(_0x32716e[_0x41a6('0x17')][_0x41a6('0x18')]===0x1f4){logger[_0x41a6('0x17')]('UserNotification,\x20%s,\x20%s',_0x5bc5f6,_0x32716e[_0x41a6('0x17')][_0x41a6('0x19')]);return _0x7a1fbb(_0x32716e[_0x41a6('0x17')]['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0x5bc5f6,_0x32716e[_0x41a6('0x17')][_0x41a6('0x19')]);return _0x2617b2(_0x32716e['error'][_0x41a6('0x19')]);}else{logger[_0x41a6('0x1a')](_0x41a6('0x12'),_0x5bc5f6,_0x41a6('0x13'));_0x2617b2(_0x32716e[_0x41a6('0x1b')][_0x41a6('0x19')]);}})[_0x41a6('0x1c')](function(_0x2a2464){logger[_0x41a6('0x17')](_0x41a6('0x12'),_0x5bc5f6,_0x2a2464);_0x7a1fbb(_0x2a2464);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 187d63e..f946644 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 _0x5de6=['./userNotification.events','update','emit','removeListener','register','length'];(function(_0xbf629b,_0x5b8be1){var _0x1678da=function(_0x13bd1f){while(--_0x13bd1f){_0xbf629b['push'](_0xbf629b['shift']());}};_0x1678da(++_0x5b8be1);}(_0x5de6,0x126));var _0x65de=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5de6[_0x4a9fb1];return _0x348672;};'use strict';var UserNotificationEvents=require(_0x65de('0x0'));var events=['save','remove',_0x65de('0x1')];function createListener(_0x777340,_0x522c23){return function(_0x34b0b8){_0x522c23[_0x65de('0x2')](_0x777340,_0x34b0b8);};}function removeListener(_0x58c065,_0x372da4){return function(){UserNotificationEvents[_0x65de('0x3')](_0x58c065,_0x372da4);};}exports[_0x65de('0x4')]=function(_0x4c2a1d){for(var _0x631e1a=0x0,_0x26143b=events[_0x65de('0x5')];_0x631e1a<_0x26143b;_0x631e1a++){var _0x49bdf7=events[_0x631e1a];var _0xc088ce=createListener('userNotification:'+_0x49bdf7,_0x4c2a1d);UserNotificationEvents['on'](_0x49bdf7,_0xc088ce);}}; \ No newline at end of file +var _0x5c9c=['save','remove','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5c9c,0x1e7));var _0xc5c9=function(_0x34cb0c,_0x151c10){_0x34cb0c=_0x34cb0c-0x0;var _0x35a815=_0x5c9c[_0x34cb0c];return _0x35a815;};'use strict';var UserNotificationEvents=require(_0xc5c9('0x0'));var events=[_0xc5c9('0x1'),_0xc5c9('0x2'),'update'];function createListener(_0x4c23e1,_0x1778a0){return function(_0x253d1c){_0x1778a0[_0xc5c9('0x3')](_0x4c23e1,_0x253d1c);};}function removeListener(_0x3f7049,_0x35a832){return function(){UserNotificationEvents[_0xc5c9('0x4')](_0x3f7049,_0x35a832);};}exports[_0xc5c9('0x5')]=function(_0x2c6e1b){for(var _0x5a8280=0x0,_0x48b98c=events[_0xc5c9('0x6')];_0x5a8280<_0x48b98c;_0x5a8280++){var _0x557d70=events[_0x5a8280];var _0x41ea88=createListener(_0xc5c9('0x7')+_0x557d70,_0x2c6e1b);UserNotificationEvents['on'](_0x557d70,_0x41ea88);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 41a203a..33bf04e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x103e92,_0xc5d445){var _0x3cab64=function(_0x1eee30){while(--_0x1eee30){_0x103e92['push'](_0x103e92['shift']());}};_0x3cab64(++_0xc5d445);}(_0x70e0,0x17b));var _0x070e=function(_0x57dc23,_0x4e7fd2){_0x57dc23=_0x57dc23-0x0;var _0x19a57c=_0x70e0[_0x57dc23];return _0x19a57c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index ce31331..158cabb 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 _0xecd9=['INTEGER','sequelize','exports'];(function(_0xb6516e,_0x2c0401){var _0x575bed=function(_0x2ff90a){while(--_0x2ff90a){_0xb6516e['push'](_0xb6516e['shift']());}};_0x575bed(++_0x2c0401);}(_0xecd9,0x13f));var _0x9ecd=function(_0x4f92b0,_0x2501cb){_0x4f92b0=_0x4f92b0-0x0;var _0x75cf4c=_0xecd9[_0x4f92b0];return _0x75cf4c;};'use strict';var Sequelize=require(_0x9ecd('0x0'));module[_0x9ecd('0x1')]={'penalty':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x90ae=['INTEGER','sequelize'];(function(_0x149378,_0x35d644){var _0x3e4df6=function(_0x4363e8){while(--_0x4363e8){_0x149378['push'](_0x149378['shift']());}};_0x3e4df6(++_0x35d644);}(_0x90ae,0x13f));var _0xe90a=function(_0x3872e1,_0x129f95){_0x3872e1=_0x3872e1-0x0;var _0x434ba8=_0x90ae[_0x3872e1];return _0x434ba8;};'use strict';var Sequelize=require(_0xe90a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe90a('0x1')],'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 97ef10e..5285c52 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 _0xbada=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2f4bb7,_0x1b7598){var _0x23ab5a=function(_0x3aa376){while(--_0x3aa376){_0x2f4bb7['push'](_0x2f4bb7['shift']());}};_0x23ab5a(++_0x1b7598);}(_0xbada,0x176));var _0xabad=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xbada[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xabad('0x0'));var util=require(_0xabad('0x1'));var logger=require(_0xabad('0x2'))(_0xabad('0x3'));var moment=require('moment');var BPromise=require(_0xabad('0x4'));var rp=require(_0xabad('0x5'));var fs=require('fs');var path=require(_0xabad('0x6'));var rimraf=require(_0xabad('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0xabad('0x8')]=function(_0xb98f22,_0xf0d5f0){return _0xb98f22[_0xabad('0x9')](_0xabad('0xa'),attributes,{'tableName':_0xabad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf353=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x32f376,_0x2c8523){var _0x55ba12=function(_0x271438){while(--_0x271438){_0x32f376['push'](_0x32f376['shift']());}};_0x55ba12(++_0x2c8523);}(_0xf353,0x183));var _0x3f35=function(_0x1bffb1,_0x33de07){_0x1bffb1=_0x1bffb1-0x0;var _0x14aace=_0xf353[_0x1bffb1];return _0x14aace;};'use strict';var _=require(_0x3f35('0x0'));var util=require(_0x3f35('0x1'));var logger=require('../../config/logger')(_0x3f35('0x2'));var moment=require('moment');var BPromise=require(_0x3f35('0x3'));var rp=require(_0x3f35('0x4'));var fs=require('fs');var path=require(_0x3f35('0x5'));var rimraf=require('rimraf');var config=require(_0x3f35('0x6'));var attributes=require(_0x3f35('0x7'));module[_0x3f35('0x8')]=function(_0x19ed15,_0x106251){return _0x19ed15[_0x3f35('0x9')](_0x3f35('0xa'),attributes,{'tableName':_0x3f35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 3f69d54..c82a151 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 _0x6839=['UserOpenchannelQueue,\x20%s,\x20%s','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6839,0x143));var _0x9683=function(_0xc1a4cf,_0x17141b){_0xc1a4cf=_0xc1a4cf-0x0;var _0x2930d1=_0x6839[_0xc1a4cf];return _0x2930d1;};'use strict';var _=require('lodash');var util=require(_0x9683('0x0'));var moment=require('moment');var BPromise=require(_0x9683('0x1'));var rs=require(_0x9683('0x2'));var fs=require('fs');var Redis=require(_0x9683('0x3'));var db=require(_0x9683('0x4'))['db'];var utils=require(_0x9683('0x5'));var logger=require(_0x9683('0x6'))('rpc');var config=require(_0x9683('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9683('0x8')][_0x9683('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2762,_0x17ab42,_0x786142){return new BPromise(function(_0x10f482,_0x11dd9c){return client['request'](_0x5d2762,_0x786142)[_0x9683('0xa')](function(_0x200a82){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x17ab42,_0x9683('0xb'));logger[_0x9683('0xc')](_0x9683('0xd'),_0x17ab42,_0x9683('0xb'),JSON['stringify'](_0x200a82));if(_0x200a82[_0x9683('0xe')]){if(_0x200a82[_0x9683('0xe')][_0x9683('0xf')]===0x1f4){logger[_0x9683('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x17ab42,_0x200a82[_0x9683('0xe')][_0x9683('0x10')]);return _0x11dd9c(_0x200a82['error'][_0x9683('0x10')]);}logger[_0x9683('0xe')](_0x9683('0x11'),_0x17ab42,_0x200a82[_0x9683('0xe')][_0x9683('0x10')]);return _0x10f482(_0x200a82['error']['message']);}else{logger[_0x9683('0x12')](_0x9683('0x11'),_0x17ab42,_0x9683('0xb'));_0x10f482(_0x200a82['result'][_0x9683('0x10')]);}})[_0x9683('0x13')](function(_0x490711){logger[_0x9683('0xe')](_0x9683('0x11'),_0x17ab42,_0x490711);_0x11dd9c(_0x490711);});});} \ No newline at end of file +var _0x917e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x917e,0xce));var _0xe917=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x917e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe917('0x0'));var util=require(_0xe917('0x1'));var moment=require(_0xe917('0x2'));var BPromise=require(_0xe917('0x3'));var rs=require(_0xe917('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe917('0x5'))['db'];var utils=require(_0xe917('0x6'));var logger=require(_0xe917('0x7'))(_0xe917('0x8'));var config=require(_0xe917('0x9'));var jayson=require(_0xe917('0xa'));var client=jayson[_0xe917('0xb')][_0xe917('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6cef7c,_0x378df6,_0x135c84){return new BPromise(function(_0x33f221,_0x530ee2){return client['request'](_0x6cef7c,_0x135c84)['then'](function(_0x2c74d8){logger[_0xe917('0xd')](_0xe917('0xe'),_0x378df6,_0xe917('0xf'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x378df6,_0xe917('0xf'),JSON[_0xe917('0x10')](_0x2c74d8));if(_0x2c74d8[_0xe917('0x11')]){if(_0x2c74d8[_0xe917('0x11')][_0xe917('0x12')]===0x1f4){logger['error'](_0xe917('0xe'),_0x378df6,_0x2c74d8[_0xe917('0x11')][_0xe917('0x13')]);return _0x530ee2(_0x2c74d8['error'][_0xe917('0x13')]);}logger[_0xe917('0x11')](_0xe917('0xe'),_0x378df6,_0x2c74d8['error'][_0xe917('0x13')]);return _0x33f221(_0x2c74d8[_0xe917('0x11')][_0xe917('0x13')]);}else{logger[_0xe917('0xd')](_0xe917('0xe'),_0x378df6,_0xe917('0xf'));_0x33f221(_0x2c74d8[_0xe917('0x14')][_0xe917('0x13')]);}})['catch'](function(_0x3c6c74){logger['error'](_0xe917('0xe'),_0x378df6,_0x3c6c74);_0x530ee2(_0x3c6c74);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 79c3b8f..ccaf21e 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 _0x771e=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','getSections','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','update','delete','exports','multer'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x771e,0xa7));var _0xe771=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x771e[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xe771('0x0'));var util=require(_0xe771('0x1'));var path=require(_0xe771('0x2'));var timeout=require(_0xe771('0x3'));var express=require(_0xe771('0x4'));var router=express[_0xe771('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe771('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe771('0x7'));var controller=require(_0xe771('0x8'));router[_0xe771('0x9')]('/',auth[_0xe771('0xa')](),controller['index']);router[_0xe771('0x9')](_0xe771('0xb'),auth['isAuthenticated'](),controller[_0xe771('0xc')]);router[_0xe771('0x9')](_0xe771('0xd'),auth[_0xe771('0xa')](),controller[_0xe771('0xe')]);router[_0xe771('0x9')]('/:id/sections',auth['isAuthenticated'](),controller[_0xe771('0xf')]);router[_0xe771('0x9')]('/:id/resources',auth[_0xe771('0xa')](),controller[_0xe771('0x10')]);router[_0xe771('0x11')]('/',auth[_0xe771('0xa')](),controller[_0xe771('0x12')]);router[_0xe771('0x11')](_0xe771('0x13'),auth[_0xe771('0xa')](),controller[_0xe771('0x14')]);router[_0xe771('0x11')](_0xe771('0x15'),auth[_0xe771('0xa')](),controller[_0xe771('0x16')]);router[_0xe771('0x11')](_0xe771('0x17'),auth[_0xe771('0xa')](),controller[_0xe771('0x18')]);router['put'](_0xe771('0xd'),auth[_0xe771('0xa')](),controller[_0xe771('0x19')]);router[_0xe771('0x1a')](_0xe771('0xd'),auth[_0xe771('0xa')](),controller['destroy']);router[_0xe771('0x1a')](_0xe771('0x15'),auth[_0xe771('0xa')](),controller['removeSections']);router[_0xe771('0x1a')](_0xe771('0x17'),auth[_0xe771('0xa')](),controller['removeResources']);module[_0xe771('0x1b')]=router; \ No newline at end of file +var _0x045f=['/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','destroy','removeSections','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x045f,0x1d2));var _0xf045=function(_0x4e1ef7,_0x349fa5){_0x4e1ef7=_0x4e1ef7-0x0;var _0x20f191=_0x045f[_0x4e1ef7];return _0x20f191;};'use strict';var multer=require(_0xf045('0x0'));var util=require(_0xf045('0x1'));var path=require(_0xf045('0x2'));var timeout=require(_0xf045('0x3'));var express=require(_0xf045('0x4'));var router=express[_0xf045('0x5')]();var fs_extra=require(_0xf045('0x6'));var auth=require(_0xf045('0x7'));var interaction=require(_0xf045('0x8'));var config=require('../../config/environment');var controller=require(_0xf045('0x9'));router[_0xf045('0xa')]('/',auth[_0xf045('0xb')](),controller['index']);router['get'](_0xf045('0xc'),auth[_0xf045('0xb')](),controller[_0xf045('0xd')]);router[_0xf045('0xa')](_0xf045('0xe'),auth[_0xf045('0xb')](),controller[_0xf045('0xf')]);router[_0xf045('0xa')](_0xf045('0x10'),auth['isAuthenticated'](),controller[_0xf045('0x11')]);router['get'](_0xf045('0x12'),auth[_0xf045('0xb')](),controller[_0xf045('0x13')]);router[_0xf045('0x14')]('/',auth[_0xf045('0xb')](),controller[_0xf045('0x15')]);router[_0xf045('0x14')](_0xf045('0x16'),auth[_0xf045('0xb')](),controller[_0xf045('0x17')]);router['post']('/:id/sections',auth[_0xf045('0xb')](),controller['addSections']);router[_0xf045('0x14')](_0xf045('0x12'),auth[_0xf045('0xb')](),controller[_0xf045('0x18')]);router['put'](_0xf045('0xe'),auth[_0xf045('0xb')](),controller['update']);router['delete']('/:id',auth[_0xf045('0xb')](),controller[_0xf045('0x19')]);router['delete'](_0xf045('0x10'),auth['isAuthenticated'](),controller[_0xf045('0x1a')]);router[_0xf045('0x1b')](_0xf045('0x12'),auth['isAuthenticated'](),controller[_0xf045('0x1c')]);module[_0xf045('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 186c3f9..9ef1ac7 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 _0x3438=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3438,0x14b));var _0x8343=function(_0x27933e,_0x2ea30b){_0x27933e=_0x27933e-0x0;var _0x34ca6b=_0x3438[_0x27933e];return _0x34ca6b;};'use strict';var Sequelize=require(_0x8343('0x0'));module[_0x8343('0x1')]={'name':{'type':Sequelize[_0x8343('0x2')],'allowNull':![],'unique':_0x8343('0x3')},'crudPermissions':{'type':Sequelize[_0x8343('0x2')],'set':function(_0x499920){this[_0x8343('0x4')](_0x8343('0x5'),_0x499920?_0x499920[_0x8343('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8343('0x5'))?this[_0x8343('0x7')](_0x8343('0x5'))[_0x8343('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8343('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8343('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8343('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8343('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8343('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8343('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8343('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x459d=['BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x460877,_0xb97270){var _0x299be0=function(_0x321cca){while(--_0x321cca){_0x460877['push'](_0x460877['shift']());}};_0x299be0(++_0xb97270);}(_0x459d,0xfd));var _0xd459=function(_0xb5b44,_0x228f44){_0xb5b44=_0xb5b44-0x0;var _0x12c297=_0x459d[_0xb5b44];return _0x12c297;};'use strict';var Sequelize=require(_0xd459('0x0'));module[_0xd459('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd459('0x2')],'set':function(_0x2ba4ac){this[_0xd459('0x3')](_0xd459('0x4'),_0x2ba4ac?_0x2ba4ac[_0xd459('0x5')](''):[]);},'get':function(){return this[_0xd459('0x6')](_0xd459('0x4'))?this[_0xd459('0x6')](_0xd459('0x4'))[_0xd459('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd459('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd459('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 82c03bb..2cdeb8e 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 _0x2faf=['where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','fields','include','create','body','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','UserProfileResource','sectionId','catch','userProfileId','Resources','describe','addSections','sequelize','destroy','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x27ac32,_0x42771f){var _0x20c811=function(_0x12d837){while(--_0x12d837){_0x27ac32['push'](_0x27ac32['shift']());}};_0x20c811(++_0x42771f);}(_0x2faf,0xb0));var _0xf2fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2faf[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf2fa('0x0'));var rimraf=require(_0xf2fa('0x1'));var zipdir=require(_0xf2fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2fa('0x3'));var moment=require(_0xf2fa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf2fa('0x5'));var util=require(_0xf2fa('0x6'));var path=require(_0xf2fa('0x7'));var sox=require(_0xf2fa('0x8'));var csv=require(_0xf2fa('0x9'));var ejs=require(_0xf2fa('0xa'));var fs=require('fs');var fs_extra=require(_0xf2fa('0xb'));var _=require('lodash');var squel=require(_0xf2fa('0xc'));var crypto=require(_0xf2fa('0xd'));var jsforce=require(_0xf2fa('0xe'));var deskjs=require(_0xf2fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf2fa('0x10'));var Papa=require('papaparse');var Redis=require(_0xf2fa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf2fa('0x12'));var as=require(_0xf2fa('0x13'));var hardwareService=require(_0xf2fa('0x14'));var logger=require(_0xf2fa('0x15'))(_0xf2fa('0x16'));var utils=require(_0xf2fa('0x17'));var config=require(_0xf2fa('0x18'));var licenseUtil=require(_0xf2fa('0x19'));var db=require(_0xf2fa('0x1a'))['db'];config[_0xf2fa('0x1b')]=_['defaults'](config[_0xf2fa('0x1b')],{'host':_0xf2fa('0x1c'),'port':0x18eb});var socket=require(_0xf2fa('0x1d'))(new Redis(config[_0xf2fa('0x1b')]));require(_0xf2fa('0x1e'))[_0xf2fa('0x1f')](socket);function respondWithStatusCode(_0x30a8b1,_0x263472){_0x263472=_0x263472||0xcc;return function(_0x559eb5){if(_0x559eb5){return _0x30a8b1[_0xf2fa('0x20')](_0x263472);}return _0x30a8b1['status'](_0x263472)[_0xf2fa('0x21')]();};}function respondWithResult(_0x9e3bc8,_0x4c3d81){_0x4c3d81=_0x4c3d81||0xc8;return function(_0x4ded9a){if(_0x4ded9a){return _0x9e3bc8[_0xf2fa('0x22')](_0x4c3d81)[_0xf2fa('0x23')](_0x4ded9a);}};}function respondWithFilteredResult(_0xd9c050,_0xc09891){return function(_0x2b8f69){if(_0x2b8f69){var _0x2d0d36=typeof _0xc09891['offset']===_0xf2fa('0x24')&&typeof _0xc09891[_0xf2fa('0x25')]===_0xf2fa('0x24');var _0x57bca1=_0x2b8f69[_0xf2fa('0x26')];var _0x1b2b4d=_0x2d0d36?0x0:_0xc09891[_0xf2fa('0x27')];var _0x4170b1=_0x2d0d36?_0x2b8f69[_0xf2fa('0x26')]:_0xc09891['offset']+_0xc09891['limit'];var _0x568448;if(_0x4170b1>=_0x57bca1){_0x4170b1=_0x57bca1;_0x568448=0xc8;}else{_0x568448=0xce;}_0xd9c050[_0xf2fa('0x22')](_0x568448);return _0xd9c050['set'](_0xf2fa('0x28'),_0x1b2b4d+'-'+_0x4170b1+'/'+_0x57bca1)[_0xf2fa('0x23')](_0x2b8f69);}return null;};}function patchUpdates(_0x599c7b){return function(_0x4fafc5){try{jsonpatch['apply'](_0x4fafc5,_0x599c7b,!![]);}catch(_0x453c9d){return BPromise[_0xf2fa('0x29')](_0x453c9d);}return _0x4fafc5[_0xf2fa('0x2a')]();};}function saveUpdates(_0x2e809d,_0x484e33){return function(_0x5f3f83){if(_0x5f3f83){return _0x5f3f83[_0xf2fa('0x2b')](_0x2e809d)['then'](function(_0x557631){return _0x557631;});}return null;};}function removeEntity(_0x4ab17d,_0x319b68){return function(_0x49368e){if(_0x49368e){return _0x49368e['destroy']()[_0xf2fa('0x2c')](function(){_0x4ab17d['status'](0xcc)[_0xf2fa('0x21')]();});}};}function handleEntityNotFound(_0x26c9f1,_0x24287a){return function(_0x47d295){if(!_0x47d295){_0x26c9f1['sendStatus'](0x194);}return _0x47d295;};}function handleError(_0x2e145e,_0x5e14e0){_0x5e14e0=_0x5e14e0||0x1f4;return function(_0x1b8532){logger[_0xf2fa('0x2d')](_0x1b8532[_0xf2fa('0x2e')]);if(_0x1b8532[_0xf2fa('0x2f')]){delete _0x1b8532['name'];}_0x2e145e[_0xf2fa('0x22')](_0x5e14e0)[_0xf2fa('0x30')](_0x1b8532);};}exports[_0xf2fa('0x31')]=function(_0x5014e0,_0xd01492){var _0x44075f={},_0x3b29ee={},_0x41b057={'count':0x0,'rows':[]};var _0x3a8c3a=_[_0xf2fa('0x32')](db[_0xf2fa('0x33')][_0xf2fa('0x34')],function(_0x7c224){return{'name':_0x7c224[_0xf2fa('0x35')],'type':_0x7c224['type']['key']};});_0x3b29ee[_0xf2fa('0x36')]=_[_0xf2fa('0x32')](_0x3a8c3a,_0xf2fa('0x2f'));_0x3b29ee[_0xf2fa('0x37')]=_[_0xf2fa('0x38')](_0x5014e0['query']);_0x3b29ee['filters']=_[_0xf2fa('0x39')](_0x3b29ee[_0xf2fa('0x36')],_0x3b29ee[_0xf2fa('0x37')]);_0x44075f[_0xf2fa('0x3a')]=_[_0xf2fa('0x39')](_0x3b29ee[_0xf2fa('0x36')],qs['fields'](_0x5014e0[_0xf2fa('0x37')]['fields']));_0x44075f[_0xf2fa('0x3a')]=_0x44075f[_0xf2fa('0x3a')][_0xf2fa('0x3b')]?_0x44075f[_0xf2fa('0x3a')]:_0x3b29ee[_0xf2fa('0x36')];if(!_0x5014e0[_0xf2fa('0x37')][_0xf2fa('0x3c')](_0xf2fa('0x3d'))){_0x44075f['limit']=qs[_0xf2fa('0x25')](_0x5014e0['query'][_0xf2fa('0x25')]);_0x44075f[_0xf2fa('0x27')]=qs[_0xf2fa('0x27')](_0x5014e0['query']['offset']);}_0x44075f[_0xf2fa('0x3e')]=qs['sort'](_0x5014e0[_0xf2fa('0x37')][_0xf2fa('0x3f')]);_0x44075f[_0xf2fa('0x40')]=qs[_0xf2fa('0x41')](_[_0xf2fa('0x42')](_0x5014e0[_0xf2fa('0x37')],_0x3b29ee[_0xf2fa('0x41')]),_0x3a8c3a);if(_0x5014e0['query']['filter']){_0x44075f['where']=_[_0xf2fa('0x43')](_0x44075f[_0xf2fa('0x40')],{'$or':_[_0xf2fa('0x32')](_0x3a8c3a,function(_0x14c6c8){if(_0x14c6c8[_0xf2fa('0x44')]!==_0xf2fa('0x45')){var _0x12b7d9={};_0x12b7d9[_0x14c6c8[_0xf2fa('0x2f')]]={'$like':'%'+_0x5014e0[_0xf2fa('0x37')][_0xf2fa('0x46')]+'%'};return _0x12b7d9;}})});}_0x44075f=_[_0xf2fa('0x43')]({},_0x44075f,_0x5014e0[_0xf2fa('0x47')]);var _0x3f9094={'where':_0x44075f[_0xf2fa('0x40')]};return db[_0xf2fa('0x33')][_0xf2fa('0x26')](_0x3f9094)['then'](function(_0x4dc672){_0x41b057[_0xf2fa('0x26')]=_0x4dc672;if(_0x5014e0['query'][_0xf2fa('0x48')]){_0x44075f['include']=[{'all':!![]}];}return db[_0xf2fa('0x33')][_0xf2fa('0x49')](_0x44075f);})[_0xf2fa('0x2c')](function(_0x44c14d){_0x41b057[_0xf2fa('0x4a')]=_0x44c14d;return _0x41b057;})[_0xf2fa('0x2c')](respondWithFilteredResult(_0xd01492,_0x44075f))['catch'](handleError(_0xd01492,null));};exports['show']=function(_0x464ff1,_0x181b90){var _0x1a512a={'raw':![],'where':{'id':_0x464ff1['params']['id']}},_0x2ebcbc={};_0x2ebcbc[_0xf2fa('0x36')]=_[_0xf2fa('0x38')](db[_0xf2fa('0x33')]['rawAttributes']);_0x2ebcbc[_0xf2fa('0x37')]=_['keys'](_0x464ff1[_0xf2fa('0x37')]);_0x2ebcbc[_0xf2fa('0x41')]=_[_0xf2fa('0x39')](_0x2ebcbc[_0xf2fa('0x36')],_0x2ebcbc[_0xf2fa('0x37')]);_0x1a512a[_0xf2fa('0x3a')]=_[_0xf2fa('0x39')](_0x2ebcbc[_0xf2fa('0x36')],qs[_0xf2fa('0x4b')](_0x464ff1[_0xf2fa('0x37')][_0xf2fa('0x4b')]));_0x1a512a[_0xf2fa('0x3a')]=_0x1a512a['attributes']['length']?_0x1a512a['attributes']:_0x2ebcbc[_0xf2fa('0x36')];if(_0x464ff1[_0xf2fa('0x37')]['includeAll']){_0x1a512a[_0xf2fa('0x4c')]=[{'all':!![]}];}_0x1a512a=_[_0xf2fa('0x43')]({},_0x1a512a,_0x464ff1[_0xf2fa('0x47')]);return db[_0xf2fa('0x33')]['find'](_0x1a512a)['then'](handleEntityNotFound(_0x181b90,null))[_0xf2fa('0x2c')](respondWithResult(_0x181b90,null))['catch'](handleError(_0x181b90,null));};exports[_0xf2fa('0x4d')]=function(_0x534c5f,_0x5b62a3){return db['UserProfile'][_0xf2fa('0x4d')](_0x534c5f[_0xf2fa('0x4e')],{})['then'](respondWithResult(_0x5b62a3,0xc9))['catch'](handleError(_0x5b62a3,null));};exports[_0xf2fa('0x4f')]=function(_0x5afd11,_0x45e409){var _0x155a79={'where':{'id':_0x5afd11[_0xf2fa('0x50')]['id']}},_0x44ac9e={};_0x44ac9e[_0xf2fa('0x36')]=_[_0xf2fa('0x38')](db[_0xf2fa('0x33')][_0xf2fa('0x34')]);_0x155a79[_0xf2fa('0x3a')]=_[_0xf2fa('0x39')](_0x44ac9e[_0xf2fa('0x36')],qs[_0xf2fa('0x4b')](_0x5afd11[_0xf2fa('0x37')]['fields']));_0x155a79[_0xf2fa('0x3a')]=_0x155a79[_0xf2fa('0x3a')]['length']?_0x155a79[_0xf2fa('0x3a')]:_0x44ac9e[_0xf2fa('0x36')];if(_0x5afd11[_0xf2fa('0x37')][_0xf2fa('0x48')]){_0x155a79['include']=[{'all':!![]}];}_0x155a79=_['merge']({},_0x155a79,_0x5afd11[_0xf2fa('0x47')]);return db[_0xf2fa('0x33')][_0xf2fa('0x51')](_0x155a79)['then'](handleEntityNotFound(_0x45e409,null))['then'](function(_0x37ae96){if(_0x37ae96){var _0x530938=_0x37ae96[_0xf2fa('0x52')]({'plain':!![]});_0x530938=qs[_0xf2fa('0x53')](_0x530938,['id',_0xf2fa('0x54'),_0xf2fa('0x55'),_0xf2fa('0x56')]);_0x5afd11[_0xf2fa('0x4e')]=_[_0xf2fa('0x53')](_0x5afd11[_0xf2fa('0x4e')],['id',_0xf2fa('0x54'),_0xf2fa('0x55')]);return db['sequelize'][_0xf2fa('0x57')](function(_0x530433){return db[_0xf2fa('0x33')][_0xf2fa('0x4d')](_[_0xf2fa('0x43')](_0x530938,_0x5afd11[_0xf2fa('0x4e')]),{'include':_0x5afd11[_0xf2fa('0x37')][_0xf2fa('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x530433})[_0xf2fa('0x2c')](function(_0x3df069){var _0x2796ab=_0x3df069['get']({'plain':!![]});return db[_0xf2fa('0x58')][_0xf2fa('0x49')]({'where':{'userProfileId':_0x5afd11[_0xf2fa('0x50')]['id']},'raw':!![]})[_0xf2fa('0x2c')](function(_0x857215){if(_0x857215){return BPromise[_0xf2fa('0x59')](_0x857215,function(_0x446eff){return new BPromise(function(_0xd94534,_0x4e96a9){if(_0x446eff['autoAssociation']===null||_0x446eff['autoAssociation']===0x1)_0xd94534(null);return db[_0xf2fa('0x5a')]['findAll']({'where':{'sectionId':_0x446eff['id']},'raw':!![]})[_0xf2fa('0x2c')](function(_0x141f04){var _0x2a170b=_[_0xf2fa('0x32')](_0x141f04,function(_0x411567){return qs['omit'](_0x411567,['id',_0xf2fa('0x54'),_0xf2fa('0x55'),_0xf2fa('0x5b')]);});_0xd94534(_0x2a170b);})[_0xf2fa('0x5c')](function(_0x296d32){_0x4e96a9(_0x296d32);});})[_0xf2fa('0x2c')](function(_0x159f12){var _0x21e407=qs[_0xf2fa('0x53')](_0x446eff,['id',_0xf2fa('0x54'),_0xf2fa('0x55')]);_0x21e407[_0xf2fa('0x5d')]=_0x2796ab['id'];if(_0x159f12)_0x21e407[_0xf2fa('0x5e')]=_0x159f12;return _0x21e407;})['then'](function(_0x5f2d81){return db[_0xf2fa('0x58')][_0xf2fa('0x4d')](_0x5f2d81,{'include':[{'model':db[_0xf2fa('0x5a')],'as':_0xf2fa('0x5e')}],'raw':!![],'transaction':_0x530433});});})['then'](function(){return _0x2796ab;});}});});});}})['then'](respondWithResult(_0x45e409,0xc9))[_0xf2fa('0x5c')](handleError(_0x45e409,null));};exports[_0xf2fa('0x2b')]=function(_0x10e154,_0x532e62){if(_0x10e154[_0xf2fa('0x4e')]['id']){delete _0x10e154[_0xf2fa('0x4e')]['id'];}return db[_0xf2fa('0x33')][_0xf2fa('0x51')]({'where':{'id':_0x10e154[_0xf2fa('0x50')]['id']}})[_0xf2fa('0x2c')](handleEntityNotFound(_0x532e62,null))[_0xf2fa('0x2c')](saveUpdates(_0x10e154[_0xf2fa('0x4e')],null))[_0xf2fa('0x2c')](respondWithResult(_0x532e62,null))[_0xf2fa('0x5c')](handleError(_0x532e62,null));};exports['destroy']=function(_0x56972f,_0x41bebf){return db['UserProfile'][_0xf2fa('0x51')]({'where':{'id':_0x56972f[_0xf2fa('0x50')]['id']}})[_0xf2fa('0x2c')](handleEntityNotFound(_0x41bebf,null))[_0xf2fa('0x2c')](removeEntity(_0x41bebf,null))[_0xf2fa('0x5c')](handleError(_0x41bebf,null));};exports['describe']=function(_0x3b6e9f,_0x3a42e6){return db[_0xf2fa('0x33')][_0xf2fa('0x5f')]()[_0xf2fa('0x2c')](respondWithResult(_0x3a42e6,null))[_0xf2fa('0x5c')](handleError(_0x3a42e6,null));};exports[_0xf2fa('0x60')]=function(_0x1304fd,_0x11d233){var _0x2ce9c8=_0x1304fd['body'];return db[_0xf2fa('0x33')]['find']({'where':{'id':_0x1304fd[_0xf2fa('0x50')]['id']}})[_0xf2fa('0x2c')](handleEntityNotFound(_0x11d233,null))[_0xf2fa('0x2c')](function(_0x4c413e){if(_0x4c413e){return db[_0xf2fa('0x61')]['transaction'](function(_0x392e0f){return db[_0xf2fa('0x58')][_0xf2fa('0x62')]({'where':{'userProfileId':_0x1304fd[_0xf2fa('0x50')]['id'],'sectionId':_[_0xf2fa('0x32')](_0x2ce9c8,function(_0x245851){return _0x245851[_0xf2fa('0x5b')];})},'transaction':_0x392e0f})['then'](function(){var _0x4341e6=_[_0xf2fa('0x32')](_0x2ce9c8,function(_0x13219c){_0x13219c[_0xf2fa('0x5d')]=_0x1304fd['params']['id'];return _0x13219c;});var _0xf0abff=[];return BPromise[_0xf2fa('0x59')](_0x4341e6,function(_0x3bb102){return db[_0xf2fa('0x58')][_0xf2fa('0x4d')](_0x3bb102,{'include':[{'model':db['UserProfileResource'],'as':_0xf2fa('0x5e')}],'raw':!![],'transaction':_0x392e0f})['then'](function(_0x11d452){_0xf0abff[_0xf2fa('0x63')](_0x11d452[_0xf2fa('0x52')]({'plain':!![]}));});})['then'](function(){return _0xf0abff;});});});}})[_0xf2fa('0x2c')](function(_0x5730ee){return _0x5730ee;})['then'](respondWithResult(_0x11d233,null))[_0xf2fa('0x5c')](handleError(_0x11d233,null));};exports[_0xf2fa('0x64')]=function(_0x48a455,_0x1f5047){var _0x4d3646;return db[_0xf2fa('0x33')]['find']({'where':{'id':_0x48a455[_0xf2fa('0x50')]['id']},'attributes':['id',_0xf2fa('0x2f')]})[_0xf2fa('0x2c')](handleEntityNotFound(_0x1f5047,null))['then'](function(_0x3ed045){if(_0x3ed045){_0x4d3646=_0x3ed045;return db[_0xf2fa('0x58')][_0xf2fa('0x62')]({'where':{'userProfileId':_0x48a455[_0xf2fa('0x50')]['id'],'sectionId':_0x48a455[_0xf2fa('0x37')][_0xf2fa('0x65')]}});}})[_0xf2fa('0x2c')](function(){return _0x4d3646;})[_0xf2fa('0x2c')](respondWithStatusCode(_0x1f5047,null))['catch'](handleError(_0x1f5047,null));};exports[_0xf2fa('0x66')]=function(_0x119850,_0x2c1b8f){var _0x5e90a9=[];var _0x2cfd3f=[];return db['UserProfileSection'][_0xf2fa('0x49')]({'where':{'userProfileId':_0x119850['params']['id']},'raw':!![]})[_0xf2fa('0x2c')](function(_0x743dd8){_0x5e90a9=_[_0xf2fa('0x46')](_0x743dd8,function(_0x5bbbd9){return _0x5bbbd9['enabled']===0x1||_[_0xf2fa('0x67')]([0x3eb,0x709],_0x5bbbd9[_0xf2fa('0x5b')]);});if(!_[_0xf2fa('0x68')](_0x5e90a9)){return _[_0xf2fa('0x32')](_0x5e90a9,function(_0x3e8534){return _0x3e8534[_0xf2fa('0x5b')];});}else{return;}})[_0xf2fa('0x2c')](function(_0xb249a5){if(_0xb249a5)_0x2cfd3f=_0xb249a5;if(_[_0xf2fa('0x67')](_0x2cfd3f,0x64)){var _0x39da87=_['find'](_0x5e90a9,{'sectionId':0x64});return hasDefaultDashboard(_0x39da87)[_0xf2fa('0x2c')](function(_0x43b1ed){return _[_0xf2fa('0x32')](_0x5e90a9,function(_0x50ba47){if(_0x50ba47['sectionId']===0x64){_0x50ba47[_0xf2fa('0x69')]=_0x43b1ed;}return _0x50ba47;});});}else{return;}})[_0xf2fa('0x2c')](function(_0x29a640){if(_0x29a640)_0x5e90a9=_0x29a640;if(_[_0xf2fa('0x67')](_0x2cfd3f,0x3eb)){var _0x18baea=_[_0xf2fa('0x51')](_0x5e90a9,{'sectionId':0x3eb});return getCustomDashboards(_0x18baea)[_0xf2fa('0x2c')](function(_0x331feb){return _[_0xf2fa('0x32')](_0x5e90a9,function(_0x50d17c){if(_0x18baea[_0xf2fa('0x6a')]){if(_0x50d17c[_0xf2fa('0x5b')]===0x3eb){_0x50d17c[_0xf2fa('0x69')]=_0x331feb;}}else{if(_0x50d17c[_0xf2fa('0x5b')]===0x64){_0x50d17c[_0xf2fa('0x69')]=_0x331feb;}}return _0x50d17c;});});}else{return;}})[_0xf2fa('0x2c')](function(_0x139b99){if(_0x139b99)_0x5e90a9=_0x139b99;if(_[_0xf2fa('0x67')](_0x2cfd3f,0x709)){var _0x4de610=_['find'](_0x5e90a9,{'sectionId':0x709});return getPlugins(_0x4de610)[_0xf2fa('0x2c')](function(_0x21d113){if(_0x4de610[_0xf2fa('0x6a')]){return _[_0xf2fa('0x32')](_0x5e90a9,function(_0x506aa5){if(_0x506aa5['sectionId']===0x709){_0x506aa5[_0xf2fa('0x69')]=_0x21d113;}return _0x506aa5;});}else{var _0xb8df8e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x21d113};var _0x482c9a=_[_0xf2fa('0x32')](_0x5e90a9);_0x482c9a['push'](_0xb8df8e);return _0x482c9a;}});}else{return;}})[_0xf2fa('0x2c')](function(_0x5176d6){if(_0x5176d6)_0x5e90a9=_0x5176d6;return _[_0xf2fa('0x46')](_0x5e90a9,[_0xf2fa('0x6a'),0x1]);})[_0xf2fa('0x2c')](respondWithResult(_0x2c1b8f,null))[_0xf2fa('0x5c')](handleError(_0x2c1b8f,null));};function hasDefaultDashboard(_0x2fb892){var _0x287652=[0x65];return new BPromise(function(_0x5bf1fb,_0x101daa){try{if(_0x2fb892[_0xf2fa('0x6b')]){_0x5bf1fb(_0x287652);}else{return db['UserProfileResource'][_0xf2fa('0x6c')]({'where':{'sectionId':_0x2fb892['id']},'raw':!![]})[_0xf2fa('0x2c')](function(_0x5ece0e){_0x5ece0e?_0x5bf1fb(_0x287652):_0x5bf1fb();});}}catch(_0x57df26){_0x101daa(_0x57df26);}});}function getCustomDashboards(_0xdb2e10){var _0x380ab3=[];return new BPromise(function(_0xb3a24f,_0x534757){try{if(_0xdb2e10[_0xf2fa('0x6b')]){return db[_0xf2fa('0x6d')][_0xf2fa('0x49')]({'raw':!![]})['then'](function(_0x293e69){_0x293e69[_0xf2fa('0x6e')](function(_0x2dba40){_0x380ab3[_0xf2fa('0x63')](_0x2dba40['id']+0x1869f);});_0xb3a24f(_0x380ab3);});}else{return db['UserProfileResource'][_0xf2fa('0x49')]({'where':{'sectionId':_0xdb2e10['id']},'raw':!![]})[_0xf2fa('0x2c')](function(_0x20227a){_0x20227a[_0xf2fa('0x6e')](function(_0x1cd203){_0x380ab3[_0xf2fa('0x63')](_0x1cd203[_0xf2fa('0x6f')]+0x1869f);});_0xb3a24f(_0x380ab3);});}}catch(_0x5b5e3f){_0x534757(_0x5b5e3f);}});}function getPlugins(_0x19e637){var _0x218c29=[];return new BPromise(function(_0x3ed613,_0x1c978e){try{if(_0x19e637[_0xf2fa('0x6b')]){return db[_0xf2fa('0x70')]['findAll']({'raw':!![]})[_0xf2fa('0x2c')](function(_0x430c7b){_0x430c7b[_0xf2fa('0x6e')](function(_0xe466b3){_0x218c29[_0xf2fa('0x63')](_0xe466b3['id']+0x15b38);});_0x3ed613(_0x218c29);});}else{return db[_0xf2fa('0x5a')][_0xf2fa('0x49')]({'where':{'sectionId':_0x19e637['id']},'raw':!![]})['then'](function(_0x1decb){_0x1decb[_0xf2fa('0x6e')](function(_0x378868){_0x218c29['push'](_0x378868[_0xf2fa('0x6f')]+0x15b38);});_0x3ed613(_0x218c29);});}}catch(_0x102bd5){_0x1c978e(_0x102bd5);}});}exports[_0xf2fa('0x71')]=function(_0x44dd1e,_0x4119a6){return db[_0xf2fa('0x33')][_0xf2fa('0x51')]({'where':{'id':_0x44dd1e[_0xf2fa('0x50')]['id']}})['then'](handleEntityNotFound(_0x4119a6,null))[_0xf2fa('0x2c')](function(_0x3fe346){if(_0x3fe346){return db[_0xf2fa('0x61')]['transaction'](function(_0x2a262c){return db[_0xf2fa('0x58')][_0xf2fa('0x49')]({'where':{'userProfileId':_0x44dd1e['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4b776e){if(_0x4b776e){return db['UserProfileSection'][_0xf2fa('0x62')]({'where':{'userProfileId':_0x44dd1e[_0xf2fa('0x50')]['id'],'id':_[_0xf2fa('0x32')](_0x4b776e,function(_0x3872e2){return _0x3872e2['id'];})},'transaction':_0x2a262c});}})['then'](function(_0x3524c1){var _0x2b9c38=_[_0xf2fa('0x32')](_0x44dd1e[_0xf2fa('0x4e')],function(_0x2f4f76){_0x2f4f76[_0xf2fa('0x5d')]=_0x44dd1e[_0xf2fa('0x50')]['id'];return _0x2f4f76;});return db[_0xf2fa('0x58')][_0xf2fa('0x72')](_0x2b9c38,{'raw':!![],'transaction':_0x2a262c});})[_0xf2fa('0x2c')](function(_0x3ab8b8){var _0x410365=_['filter'](_[_0xf2fa('0x32')](_0x3ab8b8,function(_0x687027){return _0x687027['get']({'plain':!![]});}),{'includeAll':![]});if(_0x410365){return db['UserProfileSection'][_0xf2fa('0x49')]({'where':{'userProfileId':_0x44dd1e[_0xf2fa('0x50')]['id'],'sectionId':_[_0xf2fa('0x32')](_0x410365,function(_0x116e89){return _0x116e89['sectionId'];})},'attributes':['id',_0xf2fa('0x5b')],'raw':!![]})[_0xf2fa('0x2c')](function(_0x202a39){var _0x47f774=_[_0xf2fa('0x32')](_0x44dd1e[_0xf2fa('0x4e')],function(_0x13216f){_0x13216f[_0xf2fa('0x5d')]=_0x44dd1e[_0xf2fa('0x50')]['id'];return _0x13216f;});return db[_0xf2fa('0x5a')]['bulkCreate'](_0x47f774,{'raw':!![],'transaction':_0x2a262c});});}})['catch'](handleError(_0x4119a6,null));});}})[_0xf2fa('0x2c')](function(_0x1ae20e){var _0x289c45=_[_0xf2fa('0x32')](_0x1ae20e,function(_0x63a24d){return _0x63a24d[_0xf2fa('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x4119a6,null))[_0xf2fa('0x5c')](handleError(_0x4119a6,null));};exports[_0xf2fa('0x73')]=function(_0xf9066e,_0x7b186a,_0xbdf9ae){return db['UserProfile'][_0xf2fa('0x51')]({'where':{'id':_0xf9066e[_0xf2fa('0x50')]['id']}})[_0xf2fa('0x2c')](handleEntityNotFound(_0x7b186a,null))[_0xf2fa('0x2c')](function(_0x1b7491){if(_0x1b7491){return _0x1b7491['removeResources'](_0xf9066e['query'][_0xf2fa('0x65')]);}})[_0xf2fa('0x2c')](respondWithStatusCode(_0x7b186a,null))[_0xf2fa('0x5c')](handleError(_0x7b186a,null));};exports[_0xf2fa('0x74')]=function(_0x1dad9f,_0x1114fe){var _0x28d182={};if(!_0x1dad9f[_0xf2fa('0x37')][_0xf2fa('0x75')])throw new Error(_0xf2fa('0x76'));if(!_0x1dad9f[_0xf2fa('0x37')][_0xf2fa('0x3c')]('nolimit')){_0x28d182[_0xf2fa('0x25')]=qs['limit'](_0x1dad9f[_0xf2fa('0x37')][_0xf2fa('0x25')]);_0x28d182[_0xf2fa('0x27')]=qs[_0xf2fa('0x27')](_0x1dad9f['query'][_0xf2fa('0x27')]);}return db[_0xf2fa('0x33')][_0xf2fa('0x51')]({'where':{'id':_0x1dad9f['params']['id']}})[_0xf2fa('0x2c')](function(_0x5169ba){if(!_0x5169ba)throw new Error(_0xf2fa('0x77')+_0x1dad9f[_0xf2fa('0x50')]['id']);return db['UserProfile'][_0xf2fa('0x74')](_0x1dad9f);})[_0xf2fa('0x2c')](respondWithFilteredResult(_0x1114fe,_0x28d182))[_0xf2fa('0x5c')](handleError(_0x1114fe,null));}; \ No newline at end of file +var _0x94d4=['filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','options','find','create','body','clone','get','createdAt','updatedAt','omit','transaction','includeAll','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','ids','includes','isEmpty','subsections','enabled','push','findOne','Dashboard','findAll','forEach','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','model','keys'];(function(_0x1d5ccd,_0x1f7b5c){var _0x3130dc=function(_0x5b24a9){while(--_0x5b24a9){_0x1d5ccd['push'](_0x1d5ccd['shift']());}};_0x3130dc(++_0x1f7b5c);}(_0x94d4,0xa5));var _0x494d=function(_0x24a233,_0x5bcca4){_0x24a233=_0x24a233-0x0;var _0x4a577f=_0x94d4[_0x24a233];return _0x4a577f;};'use strict';var emlformat=require(_0x494d('0x0'));var rimraf=require(_0x494d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x494d('0x2'));var rp=require(_0x494d('0x3'));var moment=require(_0x494d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x494d('0x5'));var util=require(_0x494d('0x6'));var path=require(_0x494d('0x7'));var sox=require(_0x494d('0x8'));var csv=require(_0x494d('0x9'));var ejs=require(_0x494d('0xa'));var fs=require('fs');var fs_extra=require(_0x494d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x494d('0xc'));var deskjs=require(_0x494d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x494d('0xe'));var Redis=require(_0x494d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x494d('0x10'));var as=require(_0x494d('0x11'));var hardwareService=require(_0x494d('0x12'));var logger=require(_0x494d('0x13'))('api');var utils=require(_0x494d('0x14'));var config=require(_0x494d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x494d('0x16')](config[_0x494d('0x17')],{'host':_0x494d('0x18'),'port':0x18eb});var socket=require(_0x494d('0x19'))(new Redis(config[_0x494d('0x17')]));require(_0x494d('0x1a'))[_0x494d('0x1b')](socket);function respondWithStatusCode(_0x1529ca,_0x2fe493){_0x2fe493=_0x2fe493||0xcc;return function(_0x441d77){if(_0x441d77){return _0x1529ca[_0x494d('0x1c')](_0x2fe493);}return _0x1529ca['status'](_0x2fe493)[_0x494d('0x1d')]();};}function respondWithResult(_0x215a65,_0x2a2917){_0x2a2917=_0x2a2917||0xc8;return function(_0x3012e3){if(_0x3012e3){return _0x215a65[_0x494d('0x1e')](_0x2a2917)[_0x494d('0x1f')](_0x3012e3);}};}function respondWithFilteredResult(_0x15c2d9,_0x43f41b){return function(_0x4301fc){if(_0x4301fc){var _0x1552bb=typeof _0x43f41b[_0x494d('0x20')]===_0x494d('0x21')&&typeof _0x43f41b[_0x494d('0x22')]===_0x494d('0x21');var _0x20dd3d=_0x4301fc[_0x494d('0x23')];var _0x134632=_0x1552bb?0x0:_0x43f41b['offset'];var _0x2be3b5=_0x1552bb?_0x4301fc[_0x494d('0x23')]:_0x43f41b[_0x494d('0x20')]+_0x43f41b[_0x494d('0x22')];var _0x4c2731;if(_0x2be3b5>=_0x20dd3d){_0x2be3b5=_0x20dd3d;_0x4c2731=0xc8;}else{_0x4c2731=0xce;}_0x15c2d9['status'](_0x4c2731);return _0x15c2d9[_0x494d('0x24')](_0x494d('0x25'),_0x134632+'-'+_0x2be3b5+'/'+_0x20dd3d)['json'](_0x4301fc);}return null;};}function patchUpdates(_0x5703f5){return function(_0x1b029b){try{jsonpatch['apply'](_0x1b029b,_0x5703f5,!![]);}catch(_0x1dec57){return BPromise['reject'](_0x1dec57);}return _0x1b029b[_0x494d('0x26')]();};}function saveUpdates(_0x29220e,_0x49120d){return function(_0x2fdb5b){if(_0x2fdb5b){return _0x2fdb5b[_0x494d('0x27')](_0x29220e)[_0x494d('0x28')](function(_0x2ab88b){return _0x2ab88b;});}return null;};}function removeEntity(_0x1120c9,_0x575f07){return function(_0x17d65a){if(_0x17d65a){return _0x17d65a[_0x494d('0x29')]()['then'](function(){_0x1120c9['status'](0xcc)[_0x494d('0x1d')]();});}};}function handleEntityNotFound(_0x43a3a5,_0x37253a){return function(_0x2c025d){if(!_0x2c025d){_0x43a3a5[_0x494d('0x1c')](0x194);}return _0x2c025d;};}function handleError(_0x3a181b,_0x1a2ccd){_0x1a2ccd=_0x1a2ccd||0x1f4;return function(_0x347c58){logger[_0x494d('0x2a')](_0x347c58[_0x494d('0x2b')]);if(_0x347c58[_0x494d('0x2c')]){delete _0x347c58[_0x494d('0x2c')];}_0x3a181b[_0x494d('0x1e')](_0x1a2ccd)['send'](_0x347c58);};}exports[_0x494d('0x2d')]=function(_0xa78384,_0x3606c9){var _0x18dfae={},_0x2636ce={},_0x25328a={'count':0x0,'rows':[]};var _0x29ccfd=_[_0x494d('0x2e')](db[_0x494d('0x2f')][_0x494d('0x30')],function(_0x4ceaf6){return{'name':_0x4ceaf6[_0x494d('0x31')],'type':_0x4ceaf6[_0x494d('0x32')]['key']};});_0x2636ce[_0x494d('0x33')]=_[_0x494d('0x2e')](_0x29ccfd,'name');_0x2636ce['query']=_[_0x494d('0x34')](_0xa78384['query']);_0x2636ce[_0x494d('0x35')]=_[_0x494d('0x36')](_0x2636ce[_0x494d('0x33')],_0x2636ce[_0x494d('0x37')]);_0x18dfae['attributes']=_['intersection'](_0x2636ce[_0x494d('0x33')],qs[_0x494d('0x38')](_0xa78384[_0x494d('0x37')]['fields']));_0x18dfae['attributes']=_0x18dfae[_0x494d('0x39')][_0x494d('0x3a')]?_0x18dfae['attributes']:_0x2636ce[_0x494d('0x33')];if(!_0xa78384[_0x494d('0x37')][_0x494d('0x3b')]('nolimit')){_0x18dfae['limit']=qs['limit'](_0xa78384[_0x494d('0x37')]['limit']);_0x18dfae['offset']=qs[_0x494d('0x20')](_0xa78384[_0x494d('0x37')][_0x494d('0x20')]);}_0x18dfae[_0x494d('0x3c')]=qs[_0x494d('0x3d')](_0xa78384['query'][_0x494d('0x3d')]);_0x18dfae[_0x494d('0x3e')]=qs[_0x494d('0x35')](_[_0x494d('0x3f')](_0xa78384[_0x494d('0x37')],_0x2636ce['filters']),_0x29ccfd);if(_0xa78384[_0x494d('0x37')][_0x494d('0x40')]){_0x18dfae['where']=_[_0x494d('0x41')](_0x18dfae[_0x494d('0x3e')],{'$or':_[_0x494d('0x2e')](_0x29ccfd,function(_0x4b89b1){if(_0x4b89b1[_0x494d('0x32')]!==_0x494d('0x42')){var _0x58eade={};_0x58eade[_0x4b89b1[_0x494d('0x2c')]]={'$like':'%'+_0xa78384[_0x494d('0x37')][_0x494d('0x40')]+'%'};return _0x58eade;}})});}_0x18dfae=_['merge']({},_0x18dfae,_0xa78384['options']);var _0x2e4454={'where':_0x18dfae['where']};return db[_0x494d('0x2f')][_0x494d('0x23')](_0x2e4454)[_0x494d('0x28')](function(_0x5ce269){_0x25328a[_0x494d('0x23')]=_0x5ce269;if(_0xa78384[_0x494d('0x37')]['includeAll']){_0x18dfae[_0x494d('0x43')]=[{'all':!![]}];}return db[_0x494d('0x2f')]['findAll'](_0x18dfae);})[_0x494d('0x28')](function(_0x410b46){_0x25328a['rows']=_0x410b46;return _0x25328a;})[_0x494d('0x28')](respondWithFilteredResult(_0x3606c9,_0x18dfae))[_0x494d('0x44')](handleError(_0x3606c9,null));};exports[_0x494d('0x45')]=function(_0x368d18,_0x5dddf2){var _0x20d92f={'raw':![],'where':{'id':_0x368d18[_0x494d('0x46')]['id']}},_0x22898f={};_0x22898f[_0x494d('0x33')]=_['keys'](db['UserProfile'][_0x494d('0x30')]);_0x22898f[_0x494d('0x37')]=_['keys'](_0x368d18[_0x494d('0x37')]);_0x22898f[_0x494d('0x35')]=_[_0x494d('0x36')](_0x22898f['model'],_0x22898f['query']);_0x20d92f[_0x494d('0x39')]=_[_0x494d('0x36')](_0x22898f[_0x494d('0x33')],qs[_0x494d('0x38')](_0x368d18[_0x494d('0x37')][_0x494d('0x38')]));_0x20d92f[_0x494d('0x39')]=_0x20d92f[_0x494d('0x39')][_0x494d('0x3a')]?_0x20d92f[_0x494d('0x39')]:_0x22898f[_0x494d('0x33')];if(_0x368d18[_0x494d('0x37')]['includeAll']){_0x20d92f[_0x494d('0x43')]=[{'all':!![]}];}_0x20d92f=_[_0x494d('0x41')]({},_0x20d92f,_0x368d18[_0x494d('0x47')]);return db[_0x494d('0x2f')][_0x494d('0x48')](_0x20d92f)[_0x494d('0x28')](handleEntityNotFound(_0x5dddf2,null))[_0x494d('0x28')](respondWithResult(_0x5dddf2,null))[_0x494d('0x44')](handleError(_0x5dddf2,null));};exports['create']=function(_0x20170d,_0x3149d1){return db[_0x494d('0x2f')][_0x494d('0x49')](_0x20170d[_0x494d('0x4a')],{})['then'](respondWithResult(_0x3149d1,0xc9))['catch'](handleError(_0x3149d1,null));};exports[_0x494d('0x4b')]=function(_0x57f392,_0x3d7bf3){var _0x44b2ea={'where':{'id':_0x57f392[_0x494d('0x46')]['id']}},_0x287209={};_0x287209['model']=_[_0x494d('0x34')](db[_0x494d('0x2f')]['rawAttributes']);_0x44b2ea[_0x494d('0x39')]=_[_0x494d('0x36')](_0x287209[_0x494d('0x33')],qs[_0x494d('0x38')](_0x57f392[_0x494d('0x37')][_0x494d('0x38')]));_0x44b2ea[_0x494d('0x39')]=_0x44b2ea[_0x494d('0x39')]['length']?_0x44b2ea['attributes']:_0x287209[_0x494d('0x33')];if(_0x57f392['query']['includeAll']){_0x44b2ea[_0x494d('0x43')]=[{'all':!![]}];}_0x44b2ea=_[_0x494d('0x41')]({},_0x44b2ea,_0x57f392[_0x494d('0x47')]);return db[_0x494d('0x2f')][_0x494d('0x48')](_0x44b2ea)[_0x494d('0x28')](handleEntityNotFound(_0x3d7bf3,null))['then'](function(_0xdd869e){if(_0xdd869e){var _0x215880=_0xdd869e[_0x494d('0x4c')]({'plain':!![]});_0x215880=qs['omit'](_0x215880,['id',_0x494d('0x4d'),_0x494d('0x4e'),'crudPermissions']);_0x57f392[_0x494d('0x4a')]=_[_0x494d('0x4f')](_0x57f392[_0x494d('0x4a')],['id',_0x494d('0x4d'),'updatedAt']);return db['sequelize'][_0x494d('0x50')](function(_0x37e7a5){return db[_0x494d('0x2f')][_0x494d('0x49')](_['merge'](_0x215880,_0x57f392[_0x494d('0x4a')]),{'include':_0x57f392[_0x494d('0x37')][_0x494d('0x51')]?[{'all':!![]}]:undefined,'transaction':_0x37e7a5})['then'](function(_0x421198){var _0x4a7b05=_0x421198[_0x494d('0x4c')]({'plain':!![]});return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x57f392[_0x494d('0x46')]['id']},'raw':!![]})[_0x494d('0x28')](function(_0x429aaf){if(_0x429aaf){return BPromise[_0x494d('0x53')](_0x429aaf,function(_0x4ce59d){return new BPromise(function(_0x58e128,_0x3beb37){if(_0x4ce59d[_0x494d('0x54')]===null||_0x4ce59d[_0x494d('0x54')]===0x1)_0x58e128(null);return db[_0x494d('0x55')]['findAll']({'where':{'sectionId':_0x4ce59d['id']},'raw':!![]})[_0x494d('0x28')](function(_0x8304b5){var _0x3c9edf=_[_0x494d('0x2e')](_0x8304b5,function(_0x19e952){return qs[_0x494d('0x4f')](_0x19e952,['id',_0x494d('0x4d'),_0x494d('0x4e'),_0x494d('0x56')]);});_0x58e128(_0x3c9edf);})[_0x494d('0x44')](function(_0x459f56){_0x3beb37(_0x459f56);});})[_0x494d('0x28')](function(_0x285b2d){var _0x30f2a0=qs[_0x494d('0x4f')](_0x4ce59d,['id',_0x494d('0x4d'),'updatedAt']);_0x30f2a0[_0x494d('0x57')]=_0x4a7b05['id'];if(_0x285b2d)_0x30f2a0[_0x494d('0x58')]=_0x285b2d;return _0x30f2a0;})[_0x494d('0x28')](function(_0x1658c2){return db[_0x494d('0x52')]['create'](_0x1658c2,{'include':[{'model':db['UserProfileResource'],'as':_0x494d('0x58')}],'raw':!![],'transaction':_0x37e7a5});});})[_0x494d('0x28')](function(){return _0x4a7b05;});}});});});}})['then'](respondWithResult(_0x3d7bf3,0xc9))[_0x494d('0x44')](handleError(_0x3d7bf3,null));};exports['update']=function(_0x553fcf,_0x3ac507){if(_0x553fcf[_0x494d('0x4a')]['id']){delete _0x553fcf[_0x494d('0x4a')]['id'];}return db[_0x494d('0x2f')]['find']({'where':{'id':_0x553fcf['params']['id']}})['then'](handleEntityNotFound(_0x3ac507,null))['then'](saveUpdates(_0x553fcf[_0x494d('0x4a')],null))['then'](respondWithResult(_0x3ac507,null))[_0x494d('0x44')](handleError(_0x3ac507,null));};exports[_0x494d('0x29')]=function(_0x28b296,_0xc7ab69){return db[_0x494d('0x2f')]['find']({'where':{'id':_0x28b296[_0x494d('0x46')]['id']}})[_0x494d('0x28')](handleEntityNotFound(_0xc7ab69,null))[_0x494d('0x28')](removeEntity(_0xc7ab69,null))['catch'](handleError(_0xc7ab69,null));};exports[_0x494d('0x59')]=function(_0x526a0f,_0x253149){return db['UserProfile'][_0x494d('0x59')]()['then'](respondWithResult(_0x253149,null))[_0x494d('0x44')](handleError(_0x253149,null));};exports[_0x494d('0x5a')]=function(_0x2fb5b8,_0x41085c){var _0xdfa927=_0x2fb5b8[_0x494d('0x4a')];return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x2fb5b8['params']['id']}})['then'](handleEntityNotFound(_0x41085c,null))[_0x494d('0x28')](function(_0x17129e){if(_0x17129e){return db[_0x494d('0x5b')][_0x494d('0x50')](function(_0x198cb0){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2fb5b8[_0x494d('0x46')]['id'],'sectionId':_['map'](_0xdfa927,function(_0x4da065){return _0x4da065['sectionId'];})},'transaction':_0x198cb0})[_0x494d('0x28')](function(){var _0x16acbc=_[_0x494d('0x2e')](_0xdfa927,function(_0x1fbd44){_0x1fbd44[_0x494d('0x57')]=_0x2fb5b8[_0x494d('0x46')]['id'];return _0x1fbd44;});var _0x119a06=[];return BPromise[_0x494d('0x53')](_0x16acbc,function(_0xc1c7a1){return db[_0x494d('0x52')][_0x494d('0x49')](_0xc1c7a1,{'include':[{'model':db[_0x494d('0x55')],'as':_0x494d('0x58')}],'raw':!![],'transaction':_0x198cb0})[_0x494d('0x28')](function(_0x3c890d){_0x119a06['push'](_0x3c890d[_0x494d('0x4c')]({'plain':!![]}));});})[_0x494d('0x28')](function(){return _0x119a06;});});});}})[_0x494d('0x28')](function(_0x509d6c){return _0x509d6c;})[_0x494d('0x28')](respondWithResult(_0x41085c,null))[_0x494d('0x44')](handleError(_0x41085c,null));};exports['removeSections']=function(_0x12437,_0x423852){var _0x1898c8;return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x12437[_0x494d('0x46')]['id']},'attributes':['id','name']})[_0x494d('0x28')](handleEntityNotFound(_0x423852,null))[_0x494d('0x28')](function(_0x2fa6fb){if(_0x2fa6fb){_0x1898c8=_0x2fa6fb;return db[_0x494d('0x52')]['destroy']({'where':{'userProfileId':_0x12437['params']['id'],'sectionId':_0x12437[_0x494d('0x37')][_0x494d('0x5c')]}});}})[_0x494d('0x28')](function(){return _0x1898c8;})[_0x494d('0x28')](respondWithStatusCode(_0x423852,null))[_0x494d('0x44')](handleError(_0x423852,null));};exports['getSections']=function(_0x46a1c0,_0x55e16b){var _0x2f71ec=[];var _0x1b0234=[];return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x46a1c0[_0x494d('0x46')]['id']},'raw':!![]})[_0x494d('0x28')](function(_0x348e5e){_0x2f71ec=_['filter'](_0x348e5e,function(_0xebd321){return _0xebd321['enabled']===0x1||_[_0x494d('0x5d')]([0x3eb,0x709],_0xebd321['sectionId']);});if(!_[_0x494d('0x5e')](_0x2f71ec)){return _[_0x494d('0x2e')](_0x2f71ec,function(_0xf2ad4b){return _0xf2ad4b[_0x494d('0x56')];});}else{return;}})[_0x494d('0x28')](function(_0xb02d9e){if(_0xb02d9e)_0x1b0234=_0xb02d9e;if(_['includes'](_0x1b0234,0x64)){var _0xc95605=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x64});return hasDefaultDashboard(_0xc95605)[_0x494d('0x28')](function(_0x31c1db){return _[_0x494d('0x2e')](_0x2f71ec,function(_0x49231f){if(_0x49231f[_0x494d('0x56')]===0x64){_0x49231f[_0x494d('0x5f')]=_0x31c1db;}return _0x49231f;});});}else{return;}})[_0x494d('0x28')](function(_0x358645){if(_0x358645)_0x2f71ec=_0x358645;if(_[_0x494d('0x5d')](_0x1b0234,0x3eb)){var _0xae8cfe=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x3eb});return getCustomDashboards(_0xae8cfe)[_0x494d('0x28')](function(_0x12d588){return _[_0x494d('0x2e')](_0x2f71ec,function(_0x30b982){if(_0xae8cfe[_0x494d('0x60')]){if(_0x30b982[_0x494d('0x56')]===0x3eb){_0x30b982[_0x494d('0x5f')]=_0x12d588;}}else{if(_0x30b982[_0x494d('0x56')]===0x64){_0x30b982[_0x494d('0x5f')]=_0x12d588;}}return _0x30b982;});});}else{return;}})['then'](function(_0x4e7be5){if(_0x4e7be5)_0x2f71ec=_0x4e7be5;if(_[_0x494d('0x5d')](_0x1b0234,0x709)){var _0x4bb4ed=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x709});return getPlugins(_0x4bb4ed)[_0x494d('0x28')](function(_0x50b979){if(_0x4bb4ed[_0x494d('0x60')]){return _['map'](_0x2f71ec,function(_0x3c8d25){if(_0x3c8d25[_0x494d('0x56')]===0x709){_0x3c8d25[_0x494d('0x5f')]=_0x50b979;}return _0x3c8d25;});}else{var _0x13872c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x50b979};var _0x2abd98=_[_0x494d('0x2e')](_0x2f71ec);_0x2abd98[_0x494d('0x61')](_0x13872c);return _0x2abd98;}});}else{return;}})[_0x494d('0x28')](function(_0x454910){if(_0x454910)_0x2f71ec=_0x454910;return _['filter'](_0x2f71ec,['enabled',0x1]);})[_0x494d('0x28')](respondWithResult(_0x55e16b,null))[_0x494d('0x44')](handleError(_0x55e16b,null));};function hasDefaultDashboard(_0x577be6){var _0x3b47d5=[0x65];return new BPromise(function(_0x3ff3a3,_0x9961d8){try{if(_0x577be6[_0x494d('0x54')]){_0x3ff3a3(_0x3b47d5);}else{return db[_0x494d('0x55')][_0x494d('0x62')]({'where':{'sectionId':_0x577be6['id']},'raw':!![]})['then'](function(_0x217d4a){_0x217d4a?_0x3ff3a3(_0x3b47d5):_0x3ff3a3();});}}catch(_0x23a2a4){_0x9961d8(_0x23a2a4);}});}function getCustomDashboards(_0x216a91){var _0x33f6f0=[];return new BPromise(function(_0x147282,_0x29561b){try{if(_0x216a91['autoAssociation']){return db[_0x494d('0x63')][_0x494d('0x64')]({'raw':!![]})[_0x494d('0x28')](function(_0x24cda3){_0x24cda3[_0x494d('0x65')](function(_0x270994){_0x33f6f0['push'](_0x270994['id']+0x1869f);});_0x147282(_0x33f6f0);});}else{return db[_0x494d('0x55')][_0x494d('0x64')]({'where':{'sectionId':_0x216a91['id']},'raw':!![]})[_0x494d('0x28')](function(_0x3e5e42){_0x3e5e42[_0x494d('0x65')](function(_0x5cdefc){_0x33f6f0[_0x494d('0x61')](_0x5cdefc[_0x494d('0x66')]+0x1869f);});_0x147282(_0x33f6f0);});}}catch(_0x225298){_0x29561b(_0x225298);}});}function getPlugins(_0x3b9bcb){var _0x49e82e=[];return new BPromise(function(_0x3a21b8,_0x4d69a7){try{if(_0x3b9bcb[_0x494d('0x54')]){return db['Plugin']['findAll']({'raw':!![]})[_0x494d('0x28')](function(_0x484818){_0x484818[_0x494d('0x65')](function(_0x5eb6f6){_0x49e82e['push'](_0x5eb6f6['id']+0x15b38);});_0x3a21b8(_0x49e82e);});}else{return db[_0x494d('0x55')][_0x494d('0x64')]({'where':{'sectionId':_0x3b9bcb['id']},'raw':!![]})[_0x494d('0x28')](function(_0x1a8578){_0x1a8578[_0x494d('0x65')](function(_0x39b01d){_0x49e82e[_0x494d('0x61')](_0x39b01d['resourceId']+0x15b38);});_0x3a21b8(_0x49e82e);});}}catch(_0x514b2f){_0x4d69a7(_0x514b2f);}});}exports['addResources']=function(_0x1d11fb,_0x16cf49){return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x1d11fb[_0x494d('0x46')]['id']}})[_0x494d('0x28')](handleEntityNotFound(_0x16cf49,null))[_0x494d('0x28')](function(_0x3cb70e){if(_0x3cb70e){return db[_0x494d('0x5b')][_0x494d('0x50')](function(_0x19b1b0){return db[_0x494d('0x52')][_0x494d('0x64')]({'where':{'userProfileId':_0x1d11fb[_0x494d('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x494d('0x28')](function(_0x5c05aa){if(_0x5c05aa){return db['UserProfileSection'][_0x494d('0x29')]({'where':{'userProfileId':_0x1d11fb[_0x494d('0x46')]['id'],'id':_[_0x494d('0x2e')](_0x5c05aa,function(_0x179d7b){return _0x179d7b['id'];})},'transaction':_0x19b1b0});}})[_0x494d('0x28')](function(_0x44ac65){var _0x12a8dc=_[_0x494d('0x2e')](_0x1d11fb['body'],function(_0x2b3e8f){_0x2b3e8f['userProfileId']=_0x1d11fb[_0x494d('0x46')]['id'];return _0x2b3e8f;});return db[_0x494d('0x52')]['bulkCreate'](_0x12a8dc,{'raw':!![],'transaction':_0x19b1b0});})['then'](function(_0x37f457){var _0x405bbb=_[_0x494d('0x40')](_['map'](_0x37f457,function(_0x52d84f){return _0x52d84f['get']({'plain':!![]});}),{'includeAll':![]});if(_0x405bbb){return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x1d11fb['params']['id'],'sectionId':_[_0x494d('0x2e')](_0x405bbb,function(_0x494214){return _0x494214[_0x494d('0x56')];})},'attributes':['id',_0x494d('0x56')],'raw':!![]})[_0x494d('0x28')](function(_0x54b907){var _0x323f95=_[_0x494d('0x2e')](_0x1d11fb[_0x494d('0x4a')],function(_0xc65657){_0xc65657[_0x494d('0x57')]=_0x1d11fb[_0x494d('0x46')]['id'];return _0xc65657;});return db['UserProfileResource'][_0x494d('0x67')](_0x323f95,{'raw':!![],'transaction':_0x19b1b0});});}})[_0x494d('0x44')](handleError(_0x16cf49,null));});}})[_0x494d('0x28')](function(_0x38d807){var _0x1bf142=_['map'](_0x38d807,function(_0x3aa0d9){return _0x3aa0d9[_0x494d('0x4c')]({'plain':!![]});});})[_0x494d('0x28')](respondWithResult(_0x16cf49,null))[_0x494d('0x44')](handleError(_0x16cf49,null));};exports[_0x494d('0x68')]=function(_0x1cfffc,_0xbb2a53,_0x859443){return db['UserProfile'][_0x494d('0x48')]({'where':{'id':_0x1cfffc['params']['id']}})[_0x494d('0x28')](handleEntityNotFound(_0xbb2a53,null))['then'](function(_0x5c5a1b){if(_0x5c5a1b){return _0x5c5a1b[_0x494d('0x68')](_0x1cfffc[_0x494d('0x37')][_0x494d('0x5c')]);}})[_0x494d('0x28')](respondWithStatusCode(_0xbb2a53,null))[_0x494d('0x44')](handleError(_0xbb2a53,null));};exports[_0x494d('0x69')]=function(_0x23a0b7,_0x4a628f){var _0xe2d013={};if(!_0x23a0b7['query'][_0x494d('0x6a')])throw new Error(_0x494d('0x6b'));if(!_0x23a0b7['query']['hasOwnProperty']('nolimit')){_0xe2d013[_0x494d('0x22')]=qs[_0x494d('0x22')](_0x23a0b7[_0x494d('0x37')][_0x494d('0x22')]);_0xe2d013[_0x494d('0x20')]=qs[_0x494d('0x20')](_0x23a0b7[_0x494d('0x37')][_0x494d('0x20')]);}return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x23a0b7[_0x494d('0x46')]['id']}})[_0x494d('0x28')](function(_0x1c6397){if(!_0x1c6397)throw new Error(_0x494d('0x6c')+_0x23a0b7['params']['id']);return db[_0x494d('0x2f')]['getResources'](_0x23a0b7);})[_0x494d('0x28')](respondWithFilteredResult(_0x4a628f,_0xe2d013))[_0x494d('0x44')](handleError(_0x4a628f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bd35af8..2bb23d1 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xadb5,0xad));var _0x5adb=function(_0x485e71,_0x5e98ec){_0x485e71=_0x485e71-0x0;var _0x2a4fcf=_0xadb5[_0x485e71];return _0x2a4fcf;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x5adb('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){UserProfileEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);UserProfileEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];UserProfile[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1b65=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x54535a,_0x52b3b3){var _0x3201b6=function(_0x567b58){while(--_0x567b58){_0x54535a['push'](_0x54535a['shift']());}};_0x3201b6(++_0x52b3b3);}(_0x1b65,0x1b4));var _0x51b6=function(_0x46b966,_0x4a484f){_0x46b966=_0x46b966-0x0;var _0x22cf2d=_0x1b65[_0x46b966];return _0x22cf2d;};'use strict';var EventEmitter=require(_0x51b6('0x0'));var UserProfile=require(_0x51b6('0x1'))['db'][_0x51b6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x51b6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51b6('0x4'),'afterDestroy':_0x51b6('0x5')};function emitEvent(_0x3c6f36){return function(_0x2d5762,_0x1a1c26,_0x1ba2e9){UserProfileEvents[_0x51b6('0x6')](_0x3c6f36+':'+_0x2d5762['id'],_0x2d5762);UserProfileEvents['emit'](_0x3c6f36,_0x2d5762);_0x1ba2e9(null);};}for(var e in events){if(events[_0x51b6('0x7')](e)){var event=events[e];UserProfile[_0x51b6('0x8')](e,emitEvent(event));}}module[_0x51b6('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8426ff3..9aa1a61 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 _0x187d=['chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','membername','Telephones','User','telephone','queue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','VoiceQueue','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','union','ignore','push','rawAttributes','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','DefaultReports','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue'];(function(_0x4b8fbf,_0x4f2180){var _0x5ad59f=function(_0x52870c){while(--_0x52870c){_0x4b8fbf['push'](_0x4b8fbf['shift']());}};_0x5ad59f(++_0x4f2180);}(_0x187d,0x93));var _0xd187=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x187d[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xd187('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd187('0x1'));var squel=require(_0xd187('0x2'));module[_0xd187('0x3')]=function(_0x1cb41f){var _0x18498b=_0x1cb41f[_0xd187('0x4')];function _0x58622a(_0x28fa0b,_0x163807){return new Promise(function(_0x4ebc8d,_0x1d2533){if(!_0x163807)return _0x4ebc8d(null);var _0x58ee7=_0x163807[_0xd187('0x5')]?{[_0x163807[_0xd187('0x5')][_0xd187('0x6')]]:_0x163807[_0xd187('0x5')][_0xd187('0x7')]}:undefined;return _0x18498b[_0x28fa0b][_0xd187('0x8')]({'where':_0x58ee7,'raw':!![]})['then'](function(_0x342539){_0x163807[_0xd187('0x9')]=_[_0xd187('0xa')](_0x342539,'id');_0x4ebc8d(_0x163807);})[_0xd187('0xb')](function(_0x33ca45){_0x1d2533(_0x33ca45);});});}function _0x2a61a4(_0x59c194,_0x10d467){return new Promise(function(_0x412ccf,_0x18237b){var _0x5e6180=_0x59c194[_0xd187('0x5')]?{[_0x59c194[_0xd187('0x5')][_0xd187('0x6')]]:_0x59c194['filter'][_0xd187('0x7')]}:undefined;return _0x18498b[_0x59c194[_0xd187('0xc')]][_0xd187('0x8')]({'where':_0x5e6180,'raw':!![]})[_0xd187('0xd')](function(_0x517b25){_0x10d467[_0xd187('0x9')]=_[_0xd187('0xa')](_0x517b25,function(_0x45ab10){return _0x45ab10[_0xd187('0xe')];});_0x412ccf(_0x10d467);})['catch'](function(_0x245d3e){_0x18237b(_0x245d3e);});});}function _0x52a208(_0x5cf218,_0x40ed84,_0x5a4986){if(!_0x40ed84)return Promise['resolve'](null);return new Promise(function(_0x207b36,_0x2b3290){return _0x18498b[_0xd187('0xf')][_0xd187('0x8')]({'where':{'sectionId':_0x40ed84['id']},'raw':!![]})[_0xd187('0xd')](function(_0x253a7e){if(_0x5cf218[_0xd187('0x6')]&&_0x5cf218[_0xd187('0x6')]!=='id'){_0x40ed84[_0xd187('0x9')]=_[_0xd187('0xa')](_0x253a7e,function(_0x170d5c){return _0x170d5c[_0x5cf218[_0xd187('0x6')]];});}else{if(_0x5a4986===_0xd187('0x10')){_0x40ed84['associatedResources']=_[_0xd187('0xa')](_0x253a7e,function(_0x81b988){return{'id':_0x81b988[_0xd187('0x11')],'type':_0x81b988['type']};});}else{_0x40ed84['associatedResources']=_['map'](_0x253a7e,function(_0x435d94){return _0x435d94[_0xd187('0x11')];});}}_0x207b36(_0x40ed84);})[_0xd187('0xb')](function(_0x4f62c8){_0x2b3290(_0x4f62c8);});});}function _0x2c07c8(_0x57186b,_0x145771){var _0x5a7a23={'parentSections':[]};switch(_0x57186b[_0xd187('0x12')]()){case'squareprojects':_0x5a7a23['childModel']=_0xd187('0x13');break;case'odbc':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x15');break;case'squarerecordings':_0x5a7a23['childModel']=_0xd187('0x16');_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x18'),'field':_0xd187('0xe'),'foreignKey':'projectName'}];break;case _0xd187('0x19'):_0x5a7a23[_0xd187('0x14')]='JscriptyProject';break;case _0xd187('0x1a'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1b');_0x5a7a23['parentSections']=[{'name':_0xd187('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd187('0x1d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1e');break;case _0xd187('0x1f'):_0x5a7a23['childModel']=_0xd187('0x20');break;case _0xd187('0x21'):_0x5a7a23['childModel']='CmCustomField';break;case _0xd187('0x22'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x23');break;case _0xd187('0x24'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x25');break;case _0xd187('0x26'):_0x5a7a23[_0xd187('0x14')]='FaxQueue';break;case _0xd187('0x27'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x28');break;case'inboundroutes':case _0xd187('0x29'):case'outboundroutes':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2a');break;case _0xd187('0x2b'):_0x5a7a23['childModel']='VoiceContext';break;case _0xd187('0x2c'):_0x5a7a23[_0xd187('0x14')]='VoiceMail';break;case _0xd187('0x2d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2e');_0x5a7a23['parentSections']=[{'name':'Agents','field':_0xd187('0xe'),'foreignKey':_0xd187('0x2f'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xd187('0x30'),'field':'name','foreignKey':_0xd187('0x2f'),'model':_0xd187('0x31'),'filter':{'field':'role','value':[_0xd187('0x32')]}},{'name':'VoiceQueues','field':_0xd187('0xe'),'foreignKey':_0xd187('0x33'),'model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x35')]}},{'name':'QueueCampaigns','field':_0xd187('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x36')]}}];break;case _0xd187('0x37'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x38');break;case'chanspies':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x39');break;case _0xd187('0x3a'):_0x5a7a23['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5a7a23['childModel']=_0xd187('0x3b');break;case _0xd187('0x3c'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3d');break;case _0xd187('0x3e'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3f');break;case _0xd187('0x40'):_0x5a7a23['childModel']=_0xd187('0x41');break;case _0xd187('0x42'):_0x5a7a23[_0xd187('0x14')]='OpenchannelQueue';break;case _0xd187('0x43'):_0x5a7a23['childModel']=_0xd187('0x44');break;case _0xd187('0x45'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x46');break;case _0xd187('0x47'):_0x5a7a23['childModel']=_0xd187('0x48');break;case _0xd187('0x49'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4a');break;case'whatsappaccounts':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4b');break;case'teams':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4c');break;case'voicequeues':case'queuecampaigns':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4d');if(_0x145771){_0x5a7a23['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xd187('0x4e'):case _0xd187('0x4f'):case _0xd187('0x50'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x31');if(_0x145771){_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x51'),'filter':{'field':'role','value':[_0xd187('0x52'),_0xd187('0x53')]},'ignore':!![]},{'name':_0xd187('0x54')},{'name':_0xd187('0x30')}];}break;case _0xd187('0x55'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x56');break;case _0xd187('0x57'):_0x5a7a23['childModel']=_0xd187('0x58');break;case _0xd187('0x59'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x5a');break;case _0xd187('0x5b'):_0x5a7a23['childModel']=_0xd187('0x5c');break;case _0xd187('0x5d'):_0x5a7a23['childModel']=_0xd187('0x5e');break;case _0xd187('0x5f'):_0x5a7a23['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x5a7a23['childModel']=_0xd187('0x31');break;case _0xd187('0x60'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x61');break;case _0xd187('0x62'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x63');break;case'customdashboards':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x64');break;case _0xd187('0x65'):_0x5a7a23[_0xd187('0x14')]='Interval';break;case _0xd187('0x66'):_0x5a7a23['childModel']='Pause';break;case _0xd187('0x67'):_0x5a7a23['childModel']=_0xd187('0x68');break;case _0xd187('0x69'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6a');break;case _0xd187('0x6b'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6c');break;case _0xd187('0x6d'):_0x5a7a23[_0xd187('0x14')]='Template';break;case _0xd187('0x6e'):_0x5a7a23[_0xd187('0x14')]='Trigger';break;case _0xd187('0x6f'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x70');break;case'variables':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x71');break;case'plugins':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x72');break;case'extractedreports':_0x5a7a23[_0xd187('0x14')]='AnalyticExtractedReport';_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x73'),'field':'id','foreignKey':_0xd187('0x74')}];break;case _0xd187('0x75'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x76');break;}return _0x5a7a23;}function _0x1675d9(_0x4eddd5,_0xcef6ca){var _0x298b46=_0x4eddd5[_0xd187('0x77')](0x0)['toUpperCase']()+_0x4eddd5[_0xd187('0x78')](0x1);var _0x23428f={'type':_0x18498b[_0xd187('0x79')][_0xd187('0x7a')][_0xd187('0x7b')],'raw':!![]};return new Promise(function(_0x2c4f4d,_0x10ebf4){var _0x202f73=squel[_0xd187('0x7c')]()[_0xd187('0x6')](_0xd187('0x7d')+_0x298b46+_0xd187('0x7e'),'id')[_0xd187('0x6')](_0xd187('0x7f'))[_0xd187('0x80')](_0xd187('0x81')+_0x4eddd5+_0xd187('0x82'),'ui')[_0xd187('0x83')](_0xd187('0x84'),_0xcef6ca['id']);return _0x18498b[_0xd187('0x85')]['query'](_0x202f73[_0xd187('0x86')](),_0x23428f)['then'](function(_0x13d118){_0xcef6ca[_0x298b46+_0xd187('0x87')]=_0x13d118;_0x2c4f4d(_0x13d118);})[_0xd187('0xb')](function(_0x4225e6){_0x10ebf4(_0x4225e6);});});}return _0x1cb41f['define'](_0xd187('0x88'),attributes,{'tableName':_0xd187('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f89a6){var _0x509815={'raw':![],'where':{}};var _0x3613ee={};var _0x2c2a62={'count':0x0,'rows':[]};var _0x2870ad=_0x4f89a6[_0xd187('0x8a')]['section'];var _0x2c1df4=_0x4f89a6['query'][_0xd187('0x8b')]||![];var _0x2f6a72=_0x2c07c8(_0x2870ad,_0x2c1df4);if(!_0x2f6a72[_0xd187('0x14')])throw new Error(_0xd187('0x8c')+_0x2870ad+'\x27');var _0x57cad7=[{'name':_0x2870ad}];if(!_[_0xd187('0x8d')](_0x2f6a72[_0xd187('0x17')]))_0x57cad7=_0x2f6a72[_0xd187('0x17')];var _0x9e82c=[];for(var _0x151f3c=0x0;_0x151f3c<_0x57cad7['length'];_0x151f3c++){_0x9e82c['push'](_0x18498b[_0xd187('0x8e')][_0xd187('0x8f')]({'where':{'userProfileId':_0x4f89a6[_0xd187('0x90')]['id'],'name':_0x57cad7[_0x151f3c][_0xd187('0xe')]},'raw':!![]}));}return Promise[_0xd187('0x91')](_0x9e82c)[_0xd187('0xd')](function(_0x2dccff){var _0x1291cc=_[_0xd187('0x5')](_0x2dccff,function(_0x3765b0){return _0x3765b0?_0x3765b0:undefined;});var _0x379e89=_[_0xd187('0x5')](_0x57cad7,['ignore',!![]]);var _0x35df1e=_[_0xd187('0x8d')](_0x1291cc)&&_['isEmpty'](_0x379e89)?null:_[_0xd187('0x92')](_0x379e89,_0x1291cc);if(!_0x35df1e)return null;var _0x1a9979=[];for(var _0x4bec3e=0x0;_0x4bec3e<_0x35df1e['length'];_0x4bec3e++){var _0x32ba2a=_[_0xd187('0x8f')](_0x57cad7,function(_0x2ac56f){return _0x35df1e[_0x4bec3e]?_0x2ac56f[_0xd187('0xe')]===_0x35df1e[_0x4bec3e]['name']:null;});if(_0x32ba2a){if(_0x35df1e[_0x4bec3e][_0xd187('0x93')]){_0x1a9979[_0xd187('0x94')](_0x58622a(_0x2f6a72['childModel'],_0x35df1e[_0x4bec3e]));}else{if(!_0x35df1e[_0x4bec3e]['autoAssociation']){_0x1a9979[_0xd187('0x94')](_0x52a208(_0x32ba2a,_0x35df1e[_0x4bec3e],_0x2f6a72['childModel']));}else{if(_0x32ba2a[_0xd187('0xc')]){_0x1a9979[_0xd187('0x94')](_0x2a61a4(_0x32ba2a,_0x35df1e[_0x4bec3e]));}}}}}return Promise['all'](_0x1a9979);})[_0xd187('0xd')](function(_0x570c1c){var _0x317bc3=_0x570c1c;var _0x4f2875=null;if(_0x317bc3){_0x4f2875=_0x317bc3['length']===0x1?_0x317bc3[0x0]:null;}if(!_0x4f2875&&!_0x317bc3)return _0x2c2a62;var _0x4a1988=_0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x95')];_0x3613ee[_0xd187('0xc')]=_[_0xd187('0x96')](_0x4a1988);_0x3613ee[_0xd187('0x8a')]=_[_0xd187('0x96')](_0x4f89a6[_0xd187('0x8a')]);_0x3613ee[_0xd187('0x97')]=_['intersection'](_0x3613ee[_0xd187('0xc')],_0x3613ee[_0xd187('0x8a')]);_0x509815[_0xd187('0x98')]=_['intersection'](_0x3613ee[_0xd187('0xc')],qs[_0xd187('0x99')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0x99')]));_0x509815['attributes']=_0x509815[_0xd187('0x98')][_0xd187('0x9a')]?_0x509815['attributes']:_0x3613ee[_0xd187('0xc')];if(!_0x4f89a6[_0xd187('0x8a')][_0xd187('0x9b')](_0xd187('0x9c'))){_0x509815['limit']=qs[_0xd187('0x9d')](_0x4f89a6[_0xd187('0x8a')]['limit']);_0x509815[_0xd187('0x9e')]=qs['offset'](_0x4f89a6['query']['offset']);}_0x509815[_0xd187('0x9f')]=qs[_0xd187('0xa0')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0xa0')]);_0x509815[_0xd187('0x83')]=qs[_0xd187('0x97')](_['pick'](_0x4f89a6[_0xd187('0x8a')],_0x3613ee[_0xd187('0x97')]));if(_0x4f89a6['query']['filter']){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$or':_[_0xd187('0xa')](_0x4a1988,function(_0x3fe450){if(_0x3fe450[_0xd187('0x34')]['key']!==_0xd187('0xa2')){var _0x134cc2={};_0x134cc2[_0x3fe450[_0xd187('0x6')]]={'$like':'%'+_0x4f89a6[_0xd187('0x8a')][_0xd187('0x5')]+'%'};return _0x134cc2;}})});}var _0x2879ff=[];var _0x1982cd=null;var _0x1e58d4={};if(_0x4f2875){_0x1982cd=_[_0xd187('0x8f')](_0x57cad7,[_0xd187('0xe'),_0x4f2875[_0xd187('0xe')]]);if(_0x1982cd[_0xd187('0x6')]){_0x1e58d4={};if(_0x2f6a72['childModel']==='AnalyticExtractedReport'){_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_[_0xd187('0xa')](_0x4f2875[_0xd187('0x9')],'id');}else{_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x4f2875[_0xd187('0x9')];}_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{_0x509815['where']['id']=_0x4f2875[_0xd187('0x9')];}}else{for(var _0x5541ef=0x0;_0x5541ef<_0x317bc3[_0xd187('0x9a')];_0x5541ef++){_0x1982cd=_['find'](_0x57cad7,['name',_0x317bc3[_0x5541ef][_0xd187('0xe')]]);if(_0x1982cd['field']){_0x1e58d4={};_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x317bc3[_0x5541ef][_0xd187('0x9')];_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{if(!_0x509815[_0xd187('0x83')]['id'])_0x509815[_0xd187('0x83')]['id']=[];_0x317bc3[_0x5541ef][_0xd187('0x9')][_0xd187('0xa4')](function(_0x37fd5a){_0x509815[_0xd187('0x83')]['id'][_0xd187('0x94')](_0x37fd5a);});}}}if(!_[_0xd187('0x8d')](_0x2879ff)){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$and':{'$or':_0x2879ff}});}_0x509815=_[_0xd187('0xa1')]({},_0x509815,_0x4f89a6['options']);if(_0x4f2875&&!_0x4f2875[_0xd187('0xa5')]&&_0x2f6a72[_0xd187('0x14')]===_0xd187('0x10')){if(_0x4f89a6[_0xd187('0x8a')]['includeAll']){_0x509815[_0xd187('0xa6')]=[{'all':!![]}];}return _0x18498b[_0x2f6a72[_0xd187('0x14')]]['findAll'](_0x509815)['then'](function(_0x20b680){var _0x3c993a=[];_0x20b680[_0xd187('0xa4')](function(_0x435fe8){var _0x371869;switch(_0x435fe8[_0xd187('0xa7')]){case'default':_0x371869=_[_0xd187('0x8f')](_0x4f2875[_0xd187('0x9')],function(_0x5b7870){return _0x5b7870['id']===_0x435fe8[_0xd187('0x74')]&&_0x5b7870[_0xd187('0x34')]===_0xd187('0xa8');});break;case _0xd187('0xa9'):_0x371869=_['find'](_0x4f2875['associatedResources'],function(_0x18d48d){return _0x18d48d['id']===_0x435fe8[_0xd187('0x74')]&&_0x18d48d[_0xd187('0x34')]==='CustomReports';});break;}if(_0x371869)_0x3c993a[_0xd187('0x94')](_0x435fe8);});_0x2c2a62[_0xd187('0xaa')]=_0x3c993a[_0xd187('0x9a')];_0x2c2a62[_0xd187('0xab')]=_0x3c993a;return _0x2c2a62;});}else{return _0x18498b[_0x2f6a72['childModel']][_0xd187('0xaa')]({'where':_0x509815['where']})['then'](function(_0x4a9310){_0x2c2a62['count']=_0x4a9310;if(_0x4f89a6['query']['includeAll']){if(_0x2f6a72['childModel']===_0xd187('0x1b')){_0x509815[_0xd187('0xa6')]=[{'model':_0x18498b['Tag'],'as':_0xd187('0xac'),'attributes':['id',_0xd187('0xe'),_0xd187('0xad')],'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]},{'model':_0x18498b['Tag'],'as':_0xd187('0xaf'),'attributes':['id','name',_0xd187('0xad')],'through':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?{'attributes':[],'where':{'TagId':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]||undefined}}:{},'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]}];}else{_0x509815['include']=[{'all':!![]}];}}return _0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x8')](_0x509815);})['then'](function(_0x2afb14){_0x2c2a62[_0xd187('0xab')]=_0x2afb14;if(_0x2870ad==='Agents'&&_0x4f89a6[_0xd187('0x8a')][_0xd187('0xb0')]===_0xd187('0xb1')){var _0x45b522=[];for(var _0x78604d=0x0;_0x78604d<_0x2c2a62[_0xd187('0xab')][_0xd187('0x9a')];_0x78604d++){_0x45b522[_0xd187('0x94')](_0x1675d9('chat',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb3'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9('fax',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9(_0xd187('0xb4'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb5'),_0x2c2a62[_0xd187('0xab')][_0x78604d]['dataValues']));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb6'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));}return Promise[_0xd187('0x91')](_0x45b522)[_0xd187('0xd')](function(){return _0x2c2a62;});}return _0x2c2a62;});}});}}});}; \ No newline at end of file +var _0x7ee1=['User','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','Interval','Pause','scheduler','Schedule','sounds','tags','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','include','default','reportId','DefaultReports','custom','rows','count','includeAll','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','openchannel','whatsapp','lodash','exports','filter','field','value','findAll','then','catch','model','associatedResources','map','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','CmContact','ListId','lists','CmList','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','role','agent'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x7ee1,0x8d));var _0x17ee=function(_0x16bb3d,_0x449b71){_0x16bb3d=_0x16bb3d-0x0;var _0x28de6d=_0x7ee1[_0x16bb3d];return _0x28de6d;};'use strict';var _=require(_0x17ee('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x17ee('0x1')]=function(_0x31a2fe){var _0x1790ff=_0x31a2fe['models'];function _0x1602fd(_0x1811e4,_0x10f7a8){return new Promise(function(_0x2f9ebc,_0x5c0617){if(!_0x10f7a8)return _0x2f9ebc(null);var _0x52b1db=_0x10f7a8[_0x17ee('0x2')]?{[_0x10f7a8['filter'][_0x17ee('0x3')]]:_0x10f7a8['filter'][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x1811e4][_0x17ee('0x5')]({'where':_0x52b1db,'raw':!![]})[_0x17ee('0x6')](function(_0x4af369){_0x10f7a8['associatedResources']=_['map'](_0x4af369,'id');_0x2f9ebc(_0x10f7a8);})[_0x17ee('0x7')](function(_0x4ee1e0){_0x5c0617(_0x4ee1e0);});});}function _0x155964(_0x378a78,_0x3068b2){return new Promise(function(_0x3d4f0f,_0x57fae0){var _0x1acde5=_0x378a78['filter']?{[_0x378a78[_0x17ee('0x2')][_0x17ee('0x3')]]:_0x378a78[_0x17ee('0x2')][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x378a78[_0x17ee('0x8')]][_0x17ee('0x5')]({'where':_0x1acde5,'raw':!![]})[_0x17ee('0x6')](function(_0x54434e){_0x3068b2[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x54434e,function(_0x329af2){return _0x329af2['name'];});_0x3d4f0f(_0x3068b2);})['catch'](function(_0x551c5f){_0x57fae0(_0x551c5f);});});}function _0x4d4593(_0x2fe0ac,_0x2382ce,_0x1b87c3){if(!_0x2382ce)return Promise[_0x17ee('0xb')](null);return new Promise(function(_0x443f81,_0x236d18){return _0x1790ff[_0x17ee('0xc')]['findAll']({'where':{'sectionId':_0x2382ce['id']},'raw':!![]})[_0x17ee('0x6')](function(_0x1118a3){if(_0x2fe0ac[_0x17ee('0x3')]&&_0x2fe0ac[_0x17ee('0x3')]!=='id'){_0x2382ce[_0x17ee('0x9')]=_['map'](_0x1118a3,function(_0x393720){return _0x393720[_0x2fe0ac['field']];});}else{if(_0x1b87c3===_0x17ee('0xd')){_0x2382ce['associatedResources']=_[_0x17ee('0xa')](_0x1118a3,function(_0x343f1b){return{'id':_0x343f1b[_0x17ee('0xe')],'type':_0x343f1b[_0x17ee('0xf')]};});}else{_0x2382ce[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x1118a3,function(_0x44548f){return _0x44548f[_0x17ee('0xe')];});}}_0x443f81(_0x2382ce);})[_0x17ee('0x7')](function(_0x1f3d6d){_0x236d18(_0x1f3d6d);});});}function _0x37fe4e(_0x4d2d91,_0x4b7bfe){var _0x2118a6={'parentSections':[]};switch(_0x4d2d91[_0x17ee('0x10')]()){case _0x17ee('0x11'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x13');break;case _0x17ee('0x14'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x15');break;case _0x17ee('0x16'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x17');_0x2118a6[_0x17ee('0x18')]=[{'name':'SquareProjects','field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x1a')}];break;case _0x17ee('0x1b'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1c');break;case'contacts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1d');_0x2118a6[_0x17ee('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x17ee('0x1e')}];break;case _0x17ee('0x1f'):_0x2118a6['childModel']=_0x17ee('0x20');break;case'companies':_0x2118a6[_0x17ee('0x12')]='CmCompany';break;case _0x17ee('0x21'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x22');break;case'chatqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x23');break;case'chatwebsites':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x24');break;case _0x17ee('0x25'):_0x2118a6['childModel']='FaxQueue';break;case _0x17ee('0x26'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x27');break;case _0x17ee('0x28'):case'internalroutes':case'outboundroutes':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x29');break;case _0x17ee('0x2a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x2b');break;case _0x17ee('0x2c'):_0x2118a6[_0x17ee('0x12')]='VoiceMail';break;case'voicerecordings':_0x2118a6['childModel']=_0x17ee('0x2d');_0x2118a6['parentSections']=[{'name':_0x17ee('0x2e'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x2f'),'model':'User','filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x31')]}},{'name':'Telephones','field':'name','foreignKey':_0x17ee('0x2f'),'model':_0x17ee('0x32'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x33')]}},{'name':_0x17ee('0x34'),'field':'name','foreignKey':'queue','model':_0x17ee('0x35'),'filter':{'field':_0x17ee('0xf'),'value':[_0x17ee('0x36')]}},{'name':_0x17ee('0x37'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x17ee('0x39')]}}];break;case _0x17ee('0x3a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3b');break;case _0x17ee('0x3c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3d');break;case _0x17ee('0x3e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3f');break;case'ivrcampaigns':_0x2118a6['childModel']='Campaign';break;case _0x17ee('0x40'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x41');break;case _0x17ee('0x42'):_0x2118a6['childModel']=_0x17ee('0x43');break;case _0x17ee('0x44'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x45');break;case'openchannelqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x46');break;case _0x17ee('0x47'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x48');break;case _0x17ee('0x49'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4a');break;case'smsaccounts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4b');break;case _0x17ee('0x4c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4d');break;case _0x17ee('0x4e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4f');break;case _0x17ee('0x50'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x51');break;case _0x17ee('0x52'):case'queuecampaigns':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x35');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x17ee('0x53'):case _0x17ee('0x54'):case _0x17ee('0x55'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':_0x17ee('0x56'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x57'),_0x17ee('0x58')]},'ignore':!![]},{'name':_0x17ee('0x2e')},{'name':_0x17ee('0x59')}];}break;case _0x17ee('0x5a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5b');break;case _0x17ee('0x5c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5d');break;case'freshdeskaccounts':_0x2118a6['childModel']=_0x17ee('0x5e');break;case _0x17ee('0x5f'):_0x2118a6['childModel']='SugarcrmAccount';break;case _0x17ee('0x60'):_0x2118a6['childModel']=_0x17ee('0x61');break;case _0x17ee('0x62'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x63');break;case _0x17ee('0x64'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');break;case _0x17ee('0x65'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x66');break;case _0x17ee('0x67'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x68');break;case'customdashboards':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x69');break;case'intervals':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6a');break;case'pauses':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6b');break;case _0x17ee('0x6c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6d');break;case _0x17ee('0x6e'):_0x2118a6[_0x17ee('0x12')]='Sound';break;case _0x17ee('0x6f'):_0x2118a6['childModel']='Tag';break;case _0x17ee('0x70'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x71');break;case'triggers':_0x2118a6['childModel']=_0x17ee('0x72');break;case _0x17ee('0x73'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x74');break;case _0x17ee('0x75'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x76');break;case _0x17ee('0x77'):_0x2118a6['childModel']=_0x17ee('0x78');break;case _0x17ee('0x79'):_0x2118a6['childModel']='AnalyticExtractedReport';_0x2118a6[_0x17ee('0x18')]=[{'name':_0x17ee('0x7a'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x2118a6['childModel']=_0x17ee('0x7b');break;}return _0x2118a6;}function _0x1f860d(_0x1fbaec,_0x4a00db){var _0x3b5284=_0x1fbaec[_0x17ee('0x7c')](0x0)[_0x17ee('0x7d')]()+_0x1fbaec[_0x17ee('0x7e')](0x1);var _0x499e21={'type':_0x1790ff[_0x17ee('0x7f')][_0x17ee('0x80')]['SELECT'],'raw':!![]};return new Promise(function(_0x431b6a,_0x13e9e3){var _0x280036=squel[_0x17ee('0x81')]()[_0x17ee('0x3')](_0x17ee('0x82')+_0x3b5284+_0x17ee('0x83'),'id')[_0x17ee('0x3')](_0x17ee('0x84'))[_0x17ee('0x85')](_0x17ee('0x86')+_0x1fbaec+'_interactions','ui')[_0x17ee('0x87')](_0x17ee('0x88'),_0x4a00db['id']);return _0x1790ff['sequelize'][_0x17ee('0x89')](_0x280036[_0x17ee('0x8a')](),_0x499e21)[_0x17ee('0x6')](function(_0x5c2658){_0x4a00db[_0x3b5284+_0x17ee('0x8b')]=_0x5c2658;_0x431b6a(_0x5c2658);})[_0x17ee('0x7')](function(_0x2d72c2){_0x13e9e3(_0x2d72c2);});});}return _0x31a2fe[_0x17ee('0x8c')]('UserProfile',attributes,{'tableName':_0x17ee('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42a6b4){var _0x59d907={'raw':![],'where':{}};var _0xc0a30f={};var _0x135c29={'count':0x0,'rows':[]};var _0x16cd1b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8e')];var _0x13d99b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8f')]||![];var _0x38087a=_0x37fe4e(_0x16cd1b,_0x13d99b);if(!_0x38087a[_0x17ee('0x12')])throw new Error(_0x17ee('0x90')+_0x16cd1b+'\x27');var _0x5f35b6=[{'name':_0x16cd1b}];if(!_[_0x17ee('0x91')](_0x38087a['parentSections']))_0x5f35b6=_0x38087a[_0x17ee('0x18')];var _0x38fd73=[];for(var _0x97b640=0x0;_0x97b640<_0x5f35b6['length'];_0x97b640++){_0x38fd73['push'](_0x1790ff[_0x17ee('0x92')][_0x17ee('0x93')]({'where':{'userProfileId':_0x42a6b4[_0x17ee('0x94')]['id'],'name':_0x5f35b6[_0x97b640][_0x17ee('0x19')]},'raw':!![]}));}return Promise['all'](_0x38fd73)[_0x17ee('0x6')](function(_0x597697){var _0x5b2baa=_[_0x17ee('0x2')](_0x597697,function(_0x3f3b42){return _0x3f3b42?_0x3f3b42:undefined;});var _0x49cc91=_['filter'](_0x5f35b6,[_0x17ee('0x95'),!![]]);var _0x32ac7a=_['isEmpty'](_0x5b2baa)&&_[_0x17ee('0x91')](_0x49cc91)?null:_[_0x17ee('0x96')](_0x49cc91,_0x5b2baa);if(!_0x32ac7a)return null;var _0x1477ef=[];for(var _0x442d0f=0x0;_0x442d0f<_0x32ac7a[_0x17ee('0x97')];_0x442d0f++){var _0x57e7e7=_[_0x17ee('0x93')](_0x5f35b6,function(_0x504467){return _0x32ac7a[_0x442d0f]?_0x504467[_0x17ee('0x19')]===_0x32ac7a[_0x442d0f][_0x17ee('0x19')]:null;});if(_0x57e7e7){if(_0x32ac7a[_0x442d0f][_0x17ee('0x95')]){_0x1477ef[_0x17ee('0x98')](_0x1602fd(_0x38087a[_0x17ee('0x12')],_0x32ac7a[_0x442d0f]));}else{if(!_0x32ac7a[_0x442d0f][_0x17ee('0x99')]){_0x1477ef[_0x17ee('0x98')](_0x4d4593(_0x57e7e7,_0x32ac7a[_0x442d0f],_0x38087a[_0x17ee('0x12')]));}else{if(_0x57e7e7[_0x17ee('0x8')]){_0x1477ef[_0x17ee('0x98')](_0x155964(_0x57e7e7,_0x32ac7a[_0x442d0f]));}}}}}return Promise[_0x17ee('0x9a')](_0x1477ef);})['then'](function(_0x457d01){var _0x402e70=_0x457d01;var _0x1600c7=null;if(_0x402e70){_0x1600c7=_0x402e70[_0x17ee('0x97')]===0x1?_0x402e70[0x0]:null;}if(!_0x1600c7&&!_0x402e70)return _0x135c29;var _0x24ce05=_0x1790ff[_0x38087a[_0x17ee('0x12')]]['rawAttributes'];_0xc0a30f[_0x17ee('0x8')]=_[_0x17ee('0x9b')](_0x24ce05);_0xc0a30f['query']=_[_0x17ee('0x9b')](_0x42a6b4[_0x17ee('0x89')]);_0xc0a30f[_0x17ee('0x9c')]=_[_0x17ee('0x9d')](_0xc0a30f[_0x17ee('0x8')],_0xc0a30f[_0x17ee('0x89')]);_0x59d907['attributes']=_['intersection'](_0xc0a30f[_0x17ee('0x8')],qs['fields'](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x9e')]));_0x59d907['attributes']=_0x59d907['attributes'][_0x17ee('0x97')]?_0x59d907[_0x17ee('0x9f')]:_0xc0a30f[_0x17ee('0x8')];if(!_0x42a6b4['query'][_0x17ee('0xa0')](_0x17ee('0xa1'))){_0x59d907[_0x17ee('0xa2')]=qs[_0x17ee('0xa2')](_0x42a6b4['query'][_0x17ee('0xa2')]);_0x59d907[_0x17ee('0xa3')]=qs[_0x17ee('0xa3')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa3')]);}_0x59d907[_0x17ee('0xa4')]=qs[_0x17ee('0xa5')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa5')]);_0x59d907[_0x17ee('0x87')]=qs[_0x17ee('0x9c')](_['pick'](_0x42a6b4[_0x17ee('0x89')],_0xc0a30f[_0x17ee('0x9c')]));if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x2')]){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$or':_['map'](_0x24ce05,function(_0x1bfe00){if(_0x1bfe00[_0x17ee('0xf')][_0x17ee('0xa7')]!==_0x17ee('0xa8')){var _0x212fdf={};_0x212fdf[_0x1bfe00[_0x17ee('0x3')]]={'$like':'%'+_0x42a6b4['query'][_0x17ee('0x2')]+'%'};return _0x212fdf;}})});}var _0x3c6536=[];var _0x40f002=null;var _0x1acd22={};if(_0x1600c7){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x1600c7['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_[_0x17ee('0xa')](_0x1600c7[_0x17ee('0x9')],'id');}else{_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x1600c7[_0x17ee('0x9')];}_0x3c6536[_0x17ee('0x98')](_0x1acd22);}else{_0x59d907[_0x17ee('0x87')]['id']=_0x1600c7[_0x17ee('0x9')];}}else{for(var _0xedd714=0x0;_0xedd714<_0x402e70['length'];_0xedd714++){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x402e70[_0xedd714]['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x402e70[_0xedd714][_0x17ee('0x9')];_0x3c6536['push'](_0x1acd22);}else{if(!_0x59d907[_0x17ee('0x87')]['id'])_0x59d907[_0x17ee('0x87')]['id']=[];_0x402e70[_0xedd714][_0x17ee('0x9')][_0x17ee('0xaa')](function(_0x1012b6){_0x59d907[_0x17ee('0x87')]['id'][_0x17ee('0x98')](_0x1012b6);});}}}if(!_['isEmpty'](_0x3c6536)){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$and':{'$or':_0x3c6536}});}_0x59d907=_['merge']({},_0x59d907,_0x42a6b4[_0x17ee('0xab')]);if(_0x1600c7&&!_0x1600c7[_0x17ee('0x99')]&&_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){if(_0x42a6b4[_0x17ee('0x89')]['includeAll']){_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}return _0x1790ff[_0x38087a['childModel']][_0x17ee('0x5')](_0x59d907)[_0x17ee('0x6')](function(_0x3571a8){var _0x17e2f3=[];_0x3571a8[_0x17ee('0xaa')](function(_0x26d5ba){var _0x26ef1f;switch(_0x26d5ba['reportType']){case _0x17ee('0xad'):_0x26ef1f=_[_0x17ee('0x93')](_0x1600c7[_0x17ee('0x9')],function(_0x14a66f){return _0x14a66f['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x14a66f['type']===_0x17ee('0xaf');});break;case _0x17ee('0xb0'):_0x26ef1f=_['find'](_0x1600c7[_0x17ee('0x9')],function(_0x25a4b9){return _0x25a4b9['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x25a4b9[_0x17ee('0xf')]==='CustomReports';});break;}if(_0x26ef1f)_0x17e2f3[_0x17ee('0x98')](_0x26d5ba);});_0x135c29['count']=_0x17e2f3[_0x17ee('0x97')];_0x135c29[_0x17ee('0xb1')]=_0x17e2f3;return _0x135c29;});}else{return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0xb2')]({'where':_0x59d907[_0x17ee('0x87')]})[_0x17ee('0x6')](function(_0x4e89ee){_0x135c29[_0x17ee('0xb2')]=_0x4e89ee;if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb3')]){if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0x1d')){_0x59d907[_0x17ee('0xac')]=[{'model':_0x1790ff[_0x17ee('0xb4')],'as':_0x17ee('0xb5'),'attributes':['id',_0x17ee('0x19'),_0x17ee('0xb6')],'required':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?!![]:![]},{'model':_0x1790ff[_0x17ee('0xb4')],'as':'ThroughTags','attributes':['id','name',_0x17ee('0xb6')],'through':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?{'attributes':[],'where':{'TagId':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]||undefined}}:{},'required':_0x42a6b4['query'][_0x17ee('0xb7')]?!![]:![]}];}else{_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}}return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0x5')](_0x59d907);})[_0x17ee('0x6')](function(_0x2bdf47){_0x135c29[_0x17ee('0xb1')]=_0x2bdf47;if(_0x16cd1b===_0x17ee('0x2e')&&_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb8')]===_0x17ee('0xb9')){var _0x50daad=[];for(var _0x3801b6=0x0;_0x3801b6<_0x135c29[_0x17ee('0xb1')]['length'];_0x3801b6++){_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xba'),_0x135c29['rows'][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbc'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('fax',_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('mail',_0x135c29[_0x17ee('0xb1')][_0x3801b6]['dataValues']));_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xbd'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbe'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));}return Promise[_0x17ee('0x9a')](_0x50daad)[_0x17ee('0x6')](function(){return _0x135c29;});}return _0x135c29;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 9750848..3fc89de 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 _0x38b8=['result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','client','http','defaults','redis','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x24eaa2,_0x43147b){var _0x22c28d=function(_0x5d5d2e){while(--_0x5d5d2e){_0x24eaa2['push'](_0x24eaa2['shift']());}};_0x22c28d(++_0x43147b);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});config['redis']=_[_0x838b('0x8')](config[_0x838b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x838b('0x9')]));require(_0x838b('0xa'))[_0x838b('0xb')](socket);function respondWithRpcPromise(_0x552a0f,_0x22cda4,_0x51cf71){return new BPromise(function(_0x3884e3,_0x24ce13){return client[_0x838b('0xc')](_0x552a0f,_0x51cf71)[_0x838b('0xd')](function(_0x241e6a){logger[_0x838b('0xe')]('UserProfile,\x20%s,\x20%s',_0x22cda4,_0x838b('0xf'));logger[_0x838b('0x10')](_0x838b('0x11'),_0x22cda4,_0x838b('0xf'),JSON[_0x838b('0x12')](_0x241e6a));if(_0x241e6a[_0x838b('0x13')]){if(_0x241e6a[_0x838b('0x13')][_0x838b('0x14')]===0x1f4){logger[_0x838b('0x13')]('UserProfile,\x20%s,\x20%s',_0x22cda4,_0x241e6a[_0x838b('0x13')]['message']);return _0x24ce13(_0x241e6a['error']['message']);}logger[_0x838b('0x13')](_0x838b('0x15'),_0x22cda4,_0x241e6a[_0x838b('0x13')][_0x838b('0x16')]);return _0x3884e3(_0x241e6a[_0x838b('0x13')]['message']);}else{logger[_0x838b('0xe')](_0x838b('0x15'),_0x22cda4,_0x838b('0xf'));_0x3884e3(_0x241e6a[_0x838b('0x17')]['message']);}})[_0x838b('0x18')](function(_0x2e606b){logger['error'](_0x838b('0x15'),_0x22cda4,_0x2e606b);_0x24ce13(_0x2e606b);});});} \ No newline at end of file +var _0x2d72=['stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x4df9e5,_0x4a2442){var _0x36167a=function(_0x426b11){while(--_0x426b11){_0x4df9e5['push'](_0x4df9e5['shift']());}};_0x36167a(++_0x4a2442);}(_0x2d72,0xa8));var _0x22d7=function(_0x435723,_0x5b7d82){_0x435723=_0x435723-0x0;var _0x318b18=_0x2d72[_0x435723];return _0x318b18;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});config['redis']=_[_0x22d7('0xe')](config[_0x22d7('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x22d7('0x10'))(new Redis(config[_0x22d7('0xf')]));require(_0x22d7('0x11'))[_0x22d7('0x12')](socket);function respondWithRpcPromise(_0x49f7e1,_0x5f56eb,_0x1810b8){return new BPromise(function(_0x257c85,_0x233c0b){return client[_0x22d7('0x13')](_0x49f7e1,_0x1810b8)[_0x22d7('0x14')](function(_0x4db5dd){logger['info'](_0x22d7('0x15'),_0x5f56eb,'request\x20sent');logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x5f56eb,'request\x20sent',JSON[_0x22d7('0x18')](_0x4db5dd));if(_0x4db5dd[_0x22d7('0x19')]){if(_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1a')]===0x1f4){logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1b')]);return _0x233c0b(_0x4db5dd['error'][_0x22d7('0x1b')]);}logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd['error']['message']);return _0x257c85(_0x4db5dd['error'][_0x22d7('0x1b')]);}else{logger[_0x22d7('0x1c')](_0x22d7('0x15'),_0x5f56eb,_0x22d7('0x1d'));_0x257c85(_0x4db5dd[_0x22d7('0x1e')]['message']);}})[_0x22d7('0x1f')](function(_0x75affd){logger[_0x22d7('0x19')]('UserProfile,\x20%s,\x20%s',_0x5f56eb,_0x75affd);_0x233c0b(_0x75affd);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index bd9f7c9..00c033d 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 _0xe8c0=['update','emit','removeListener','register','length','userProfile:','save','remove'];(function(_0x53ab34,_0x17ac07){var _0x4f6d9f=function(_0x1ac3b7){while(--_0x1ac3b7){_0x53ab34['push'](_0x53ab34['shift']());}};_0x4f6d9f(++_0x17ac07);}(_0xe8c0,0x8e));var _0x0e8c=function(_0x5d1b8b,_0x2c40a6){_0x5d1b8b=_0x5d1b8b-0x0;var _0xa20aa5=_0xe8c0[_0x5d1b8b];return _0xa20aa5;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x0e8c('0x0'),_0x0e8c('0x1'),_0x0e8c('0x2')];function createListener(_0xedf43d,_0x371a39){return function(_0x415f04){_0x371a39[_0x0e8c('0x3')](_0xedf43d,_0x415f04);};}function removeListener(_0x3b2e47,_0x57dd47){return function(){UserProfileEvents[_0x0e8c('0x4')](_0x3b2e47,_0x57dd47);};}exports[_0x0e8c('0x5')]=function(_0x169e4c){for(var _0x34b5c7=0x0,_0xeb604c=events[_0x0e8c('0x6')];_0x34b5c7<_0xeb604c;_0x34b5c7++){var _0x38e9bd=events[_0x34b5c7];var _0x395cc1=createListener(_0x0e8c('0x7')+_0x38e9bd,_0x169e4c);UserProfileEvents['on'](_0x38e9bd,_0x395cc1);}}; \ No newline at end of file +var _0x7e2b=['removeListener','register','length','userProfile:','save','remove','update','emit'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x7e2b,0x15c));var _0xb7e2=function(_0x509d2e,_0x307fde){_0x509d2e=_0x509d2e-0x0;var _0x292a85=_0x7e2b[_0x509d2e];return _0x292a85;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xb7e2('0x0'),_0xb7e2('0x1'),_0xb7e2('0x2')];function createListener(_0x373610,_0x8dba09){return function(_0x2bc37e){_0x8dba09[_0xb7e2('0x3')](_0x373610,_0x2bc37e);};}function removeListener(_0x19207d,_0x42dfaf){return function(){UserProfileEvents[_0xb7e2('0x4')](_0x19207d,_0x42dfaf);};}exports[_0xb7e2('0x5')]=function(_0x4ea9a2){for(var _0x1ae8da=0x0,_0xf3f94f=events[_0xb7e2('0x6')];_0x1ae8da<_0xf3f94f;_0x1ae8da++){var _0x1fdd87=events[_0x1ae8da];var _0x56fe3d=createListener(_0xb7e2('0x7')+_0x1fdd87,_0x4ea9a2);UserProfileEvents['on'](_0x1fdd87,_0x56fe3d);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0738d11..d5f9feb 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 _0xadd7=['exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','show','post','create','put','update','delete','destroy'];(function(_0x33d83d,_0x27f940){var _0x2141a0=function(_0x2770f4){while(--_0x2770f4){_0x33d83d['push'](_0x33d83d['shift']());}};_0x2141a0(++_0x27f940);}(_0xadd7,0x1b9));var _0x7add=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xadd7[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x7add('0x0'));var path=require(_0x7add('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7add('0x2')]();var fs_extra=require(_0x7add('0x3'));var auth=require(_0x7add('0x4'));var interaction=require(_0x7add('0x5'));var config=require(_0x7add('0x6'));var controller=require(_0x7add('0x7'));router['get']('/',auth[_0x7add('0x8')](),controller[_0x7add('0x9')]);router[_0x7add('0xa')](_0x7add('0xb'),auth[_0x7add('0x8')](),controller['describe']);router[_0x7add('0xa')]('/:id',auth[_0x7add('0x8')](),controller[_0x7add('0xc')]);router[_0x7add('0xd')]('/',auth['isAuthenticated'](),controller[_0x7add('0xe')]);router[_0x7add('0xf')]('/:id',auth[_0x7add('0x8')](),controller[_0x7add('0x10')]);router[_0x7add('0x11')]('/:id',auth[_0x7add('0x8')](),controller[_0x7add('0x12')]);module[_0x7add('0x13')]=router; \ No newline at end of file +var _0x4c19=['/:id','show','post','create','put','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2e750b,_0x466bbb){var _0xf09152=function(_0x20c8ec){while(--_0x20c8ec){_0x2e750b['push'](_0x2e750b['shift']());}};_0xf09152(++_0x466bbb);}(_0x4c19,0x1e1));var _0x94c1=function(_0x284cae,_0x740c45){_0x284cae=_0x284cae-0x0;var _0x15c5b7=_0x4c19[_0x284cae];return _0x15c5b7;};'use strict';var multer=require(_0x94c1('0x0'));var util=require('util');var path=require(_0x94c1('0x1'));var timeout=require(_0x94c1('0x2'));var express=require(_0x94c1('0x3'));var router=express[_0x94c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x94c1('0x6'));var controller=require(_0x94c1('0x7'));router[_0x94c1('0x8')]('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0xa')]);router[_0x94c1('0x8')](_0x94c1('0xb'),auth[_0x94c1('0x9')](),controller[_0x94c1('0xc')]);router['get'](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller[_0x94c1('0xe')]);router[_0x94c1('0xf')]('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0x10')]);router[_0x94c1('0x11')](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller['update']);router[_0x94c1('0x12')](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index fe1877b..914da62 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 _0xd609=['exports','STRING','sequelize'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0xd609,0x1dc));var _0x9d60=function(_0x2c08c2,_0x42b9e5){_0x2c08c2=_0x2c08c2-0x0;var _0x3cee82=_0xd609[_0x2c08c2];return _0x3cee82;};'use strict';var Sequelize=require(_0x9d60('0x0'));module[_0x9d60('0x1')]={'name':{'type':Sequelize[_0x9d60('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x9d60('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd460=['STRING','INTEGER','sequelize'];(function(_0x24e9fc,_0x443210){var _0x3df5fc=function(_0x381bc0){while(--_0x381bc0){_0x24e9fc['push'](_0x24e9fc['shift']());}};_0x3df5fc(++_0x443210);}(_0xd460,0xbf));var _0x0d46=function(_0x45cb89,_0x99520e){_0x45cb89=_0x45cb89-0x0;var _0x5948c1=_0xd460[_0x45cb89];return _0x5948c1;};'use strict';var Sequelize=require(_0x0d46('0x0'));module['exports']={'name':{'type':Sequelize[_0x0d46('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0d46('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0d46('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 d3cb9f7..012a14b 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','UserProfileResource','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3b0cd4,_0x5d8f66){var _0x18548c=function(_0x2b4309){while(--_0x2b4309){_0x3b0cd4['push'](_0x3b0cd4['shift']());}};_0x18548c(++_0x5d8f66);}(_0xd117,0x182));var _0x7d11=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0xd117[_0x597e38];return _0x5305d2;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['UserProfileResource'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file +var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['UserProfileResource'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 36e81c4..2b490c7 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 _0xcdff=['UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x390af7,_0x4fc933){var _0x5c231c=function(_0x3c7388){while(--_0x3c7388){_0x390af7['push'](_0x390af7['shift']());}};_0x5c231c(++_0x4fc933);}(_0xcdff,0xe5));var _0xfcdf=function(_0x3902ab,_0x1b347b){_0x3902ab=_0x3902ab-0x0;var _0x302472=_0xcdff[_0x3902ab];return _0x302472;};'use strict';var _=require(_0xfcdf('0x0'));var util=require('util');var logger=require(_0xfcdf('0x1'))(_0xfcdf('0x2'));var moment=require(_0xfcdf('0x3'));var BPromise=require(_0xfcdf('0x4'));var rp=require(_0xfcdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcdf('0x6'));var config=require(_0xfcdf('0x7'));var attributes=require(_0xfcdf('0x8'));module[_0xfcdf('0x9')]=function(_0x55b65c,_0x3d9164){return _0x55b65c[_0xfcdf('0xa')](_0xfcdf('0xb'),attributes,{'tableName':_0xfcdf('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xfcdf('0xd'),_0xfcdf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56b9=['rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xe5b8ad,_0x4eb804){var _0x4c9ee4=function(_0x2ff588){while(--_0x2ff588){_0xe5b8ad['push'](_0xe5b8ad['shift']());}};_0x4c9ee4(++_0x4eb804);}(_0x56b9,0xf9));var _0x956b=function(_0x542a9b,_0x351513){_0x542a9b=_0x542a9b-0x0;var _0x4d5032=_0x56b9[_0x542a9b];return _0x4d5032;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var logger=require(_0x956b('0x2'))(_0x956b('0x3'));var moment=require(_0x956b('0x4'));var BPromise=require(_0x956b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x956b('0x6'));var rimraf=require(_0x956b('0x7'));var config=require(_0x956b('0x8'));var attributes=require(_0x956b('0x9'));module[_0x956b('0xa')]=function(_0x47418b,_0x50af2f){return _0x47418b[_0x956b('0xb')](_0x956b('0xc'),attributes,{'tableName':_0x956b('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x956b('0xe'),_0x956b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e4f165c..4463e4c 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 _0x946e=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x8810bc,_0x96bbdc){var _0x3e4680=function(_0x5902a2){while(--_0x5902a2){_0x8810bc['push'](_0x8810bc['shift']());}};_0x3e4680(++_0x96bbdc);}(_0x946e,0x154));var _0xe946=function(_0x1c883a,_0x36ff38){_0x1c883a=_0x1c883a-0x0;var _0xbb8ec0=_0x946e[_0x1c883a];return _0xbb8ec0;};'use strict';var _=require(_0xe946('0x0'));var util=require(_0xe946('0x1'));var moment=require('moment');var BPromise=require(_0xe946('0x2'));var rs=require(_0xe946('0x3'));var fs=require('fs');var Redis=require(_0xe946('0x4'));var db=require(_0xe946('0x5'))['db'];var utils=require(_0xe946('0x6'));var logger=require(_0xe946('0x7'))(_0xe946('0x8'));var config=require('../../config/environment');var jayson=require(_0xe946('0x9'));var client=jayson[_0xe946('0xa')][_0xe946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b6eef,_0x5e8ca7,_0x15d660){return new BPromise(function(_0x3fd249,_0x4c8c83){return client['request'](_0x4b6eef,_0x15d660)[_0xe946('0xc')](function(_0x5d51d6){logger[_0xe946('0xd')](_0xe946('0xe'),_0x5e8ca7,_0xe946('0xf'));logger[_0xe946('0x10')](_0xe946('0x11'),_0x5e8ca7,_0xe946('0xf'),JSON['stringify'](_0x5d51d6));if(_0x5d51d6[_0xe946('0x12')]){if(_0x5d51d6[_0xe946('0x12')]['code']===0x1f4){logger[_0xe946('0x12')](_0xe946('0xe'),_0x5e8ca7,_0x5d51d6[_0xe946('0x12')][_0xe946('0x13')]);return _0x4c8c83(_0x5d51d6['error'][_0xe946('0x13')]);}logger[_0xe946('0x12')](_0xe946('0xe'),_0x5e8ca7,_0x5d51d6[_0xe946('0x12')][_0xe946('0x13')]);return _0x3fd249(_0x5d51d6['error']['message']);}else{logger[_0xe946('0xd')](_0xe946('0xe'),_0x5e8ca7,'request\x20sent');_0x3fd249(_0x5d51d6[_0xe946('0x14')][_0xe946('0x13')]);}})[_0xe946('0x15')](function(_0x515e78){logger[_0xe946('0x12')](_0xe946('0xe'),_0x5e8ca7,_0x515e78);_0x4c8c83(_0x515e78);});});} \ No newline at end of file +var _0xfd4d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','request\x20sent','debug','error','UserProfileResource,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xfd4d,0x18c));var _0xdfd4=function(_0x5e7ace,_0x43eefa){_0x5e7ace=_0x5e7ace-0x0;var _0x1e9f5c=_0xfd4d[_0x5e7ace];return _0x1e9f5c;};'use strict';var _=require(_0xdfd4('0x0'));var util=require('util');var moment=require(_0xdfd4('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfd4('0x2'));var fs=require('fs');var Redis=require(_0xdfd4('0x3'));var db=require(_0xdfd4('0x4'))['db'];var utils=require(_0xdfd4('0x5'));var logger=require(_0xdfd4('0x6'))('rpc');var config=require(_0xdfd4('0x7'));var jayson=require(_0xdfd4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c571e,_0xc9fdb3,_0xd5d591){return new BPromise(function(_0x5d2820,_0x4a5bb6){return client['request'](_0x2c571e,_0xd5d591)['then'](function(_0x4140b9){logger[_0xdfd4('0x9')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'));logger[_0xdfd4('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'),JSON['stringify'](_0x4140b9));if(_0x4140b9[_0xdfd4('0xc')]){if(_0x4140b9[_0xdfd4('0xc')]['code']===0x1f4){logger[_0xdfd4('0xc')](_0xdfd4('0xd'),_0xc9fdb3,_0x4140b9['error']['message']);return _0x4a5bb6(_0x4140b9['error'][_0xdfd4('0xe')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0x4140b9[_0xdfd4('0xc')][_0xdfd4('0xe')]);return _0x5d2820(_0x4140b9[_0xdfd4('0xc')][_0xdfd4('0xe')]);}else{logger[_0xdfd4('0x9')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'));_0x5d2820(_0x4140b9[_0xdfd4('0xf')][_0xdfd4('0xe')]);}})['catch'](function(_0x3dfdf5){logger[_0xdfd4('0xc')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0x3dfdf5);_0x4a5bb6(_0x3dfdf5);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 561d2f4..c46c783 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 _0x8aca=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x2b7afe,_0x55a26a){var _0x3f665c=function(_0x33f78a){while(--_0x33f78a){_0x2b7afe['push'](_0x2b7afe['shift']());}};_0x3f665c(++_0x55a26a);}(_0x8aca,0x182));var _0xa8ac=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x8aca[_0x215dc8];return _0x583ea3;};'use strict';var multer=require('multer');var util=require(_0xa8ac('0x0'));var path=require(_0xa8ac('0x1'));var timeout=require(_0xa8ac('0x2'));var express=require(_0xa8ac('0x3'));var router=express[_0xa8ac('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8ac('0x5'));var config=require(_0xa8ac('0x6'));var controller=require(_0xa8ac('0x7'));router[_0xa8ac('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8ac('0x9')]);router['get'](_0xa8ac('0xa'),auth[_0xa8ac('0xb')](),controller[_0xa8ac('0xc')]);router[_0xa8ac('0x8')]('/:id',auth[_0xa8ac('0xb')](),controller[_0xa8ac('0xd')]);router['post']('/',auth[_0xa8ac('0xb')](),controller[_0xa8ac('0xe')]);router[_0xa8ac('0xf')](_0xa8ac('0x10'),auth['isAuthenticated'](),controller[_0xa8ac('0x11')]);router[_0xa8ac('0x12')](_0xa8ac('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbfcf=['../../config/environment','get','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service'];(function(_0x5ac5fa,_0x5ef3f7){var _0x45049e=function(_0x10efca){while(--_0x10efca){_0x5ac5fa['push'](_0x5ac5fa['shift']());}};_0x45049e(++_0x5ef3f7);}(_0xbfcf,0x18b));var _0xfbfc=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xbfcf[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require('multer');var util=require(_0xfbfc('0x0'));var path=require(_0xfbfc('0x1'));var timeout=require('connect-timeout');var express=require(_0xfbfc('0x2'));var router=express['Router']();var fs_extra=require(_0xfbfc('0x3'));var auth=require(_0xfbfc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbfc('0x5'));var controller=require('./userProfileSection.controller');router[_0xfbfc('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0x8')]);router['get']('/:id',auth[_0xfbfc('0x7')](),controller['show']);router[_0xfbfc('0x9')]('/',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xa')]);router[_0xfbfc('0xb')](_0xfbfc('0xc'),auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xd')]);router[_0xfbfc('0xe')]('/:id',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 49743bc..6481ba8 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 _0xe820=['sequelize','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x372c56,_0x9b31bd){var _0x48fc0c=function(_0x4b12fa){while(--_0x4b12fa){_0x372c56['push'](_0x372c56['shift']());}};_0x48fc0c(++_0x9b31bd);}(_0xe820,0xd2));var _0x0e82=function(_0x525049,_0x3e1581){_0x525049=_0x525049-0x0;var _0x200cb4=_0xe820[_0x525049];return _0x200cb4;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0e82('0x1')],'set':function(_0x59b28d){this[_0x0e82('0x3')]('crudPermissions',_0x59b28d?_0x59b28d[_0x0e82('0x4')](''):[]);},'get':function(){return this[_0x0e82('0x5')](_0x0e82('0x6'))?this[_0x0e82('0x5')](_0x0e82('0x6'))['split'](''):[];}}}; \ No newline at end of file +var _0xb62e=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb62e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'name':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb62('0x2')],'set':function(_0x929329){this[_0xeb62('0x4')](_0xeb62('0x5'),_0x929329?_0x929329['join'](''):[]);},'get':function(){return this[_0xeb62('0x6')](_0xeb62('0x5'))?this[_0xeb62('0x6')]('crudPermissions')[_0xeb62('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c8dd79b..dbd0e41 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 _0x4394=['map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','UserProfileSection','findAll','rows','catch','show','params','length','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index'];(function(_0x34a3b6,_0x40995f){var _0x413cd4=function(_0x14058a){while(--_0x14058a){_0x34a3b6['push'](_0x34a3b6['shift']());}};_0x413cd4(++_0x40995f);}(_0x4394,0x119));var _0x4439=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x4394[_0x35e92e];return _0x1205a8;};'use strict';var emlformat=require(_0x4439('0x0'));var rimraf=require(_0x4439('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4439('0x2'));var rp=require(_0x4439('0x3'));var moment=require(_0x4439('0x4'));var BPromise=require(_0x4439('0x5'));var Mustache=require(_0x4439('0x6'));var util=require(_0x4439('0x7'));var path=require(_0x4439('0x8'));var sox=require(_0x4439('0x9'));var csv=require(_0x4439('0xa'));var ejs=require(_0x4439('0xb'));var fs=require('fs');var fs_extra=require(_0x4439('0xc'));var _=require(_0x4439('0xd'));var squel=require(_0x4439('0xe'));var crypto=require(_0x4439('0xf'));var jsforce=require(_0x4439('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4439('0xa'));var querystring=require(_0x4439('0x11'));var Papa=require(_0x4439('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4439('0x13'));var as=require(_0x4439('0x14'));var hardwareService=require(_0x4439('0x15'));var logger=require(_0x4439('0x16'))(_0x4439('0x17'));var utils=require(_0x4439('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4439('0x19'));var db=require(_0x4439('0x1a'))['db'];function respondWithStatusCode(_0x1564e8,_0x3ac717){_0x3ac717=_0x3ac717||0xcc;return function(_0x1f54bc){if(_0x1f54bc){return _0x1564e8[_0x4439('0x1b')](_0x3ac717);}return _0x1564e8[_0x4439('0x1c')](_0x3ac717)['end']();};}function respondWithResult(_0x518448,_0x4fa4bf){_0x4fa4bf=_0x4fa4bf||0xc8;return function(_0xfbb612){if(_0xfbb612){return _0x518448[_0x4439('0x1c')](_0x4fa4bf)[_0x4439('0x1d')](_0xfbb612);}};}function respondWithFilteredResult(_0x5c8aee,_0x46f3cc){return function(_0x10b38a){if(_0x10b38a){var _0x480ece=typeof _0x46f3cc[_0x4439('0x1e')]===_0x4439('0x1f')&&typeof _0x46f3cc[_0x4439('0x20')]===_0x4439('0x1f');var _0x38647d=_0x10b38a[_0x4439('0x21')];var _0x829843=_0x480ece?0x0:_0x46f3cc[_0x4439('0x1e')];var _0xe9269e=_0x480ece?_0x10b38a['count']:_0x46f3cc['offset']+_0x46f3cc['limit'];var _0xafd90d;if(_0xe9269e>=_0x38647d){_0xe9269e=_0x38647d;_0xafd90d=0xc8;}else{_0xafd90d=0xce;}_0x5c8aee[_0x4439('0x1c')](_0xafd90d);return _0x5c8aee['set'](_0x4439('0x22'),_0x829843+'-'+_0xe9269e+'/'+_0x38647d)[_0x4439('0x1d')](_0x10b38a);}return null;};}function patchUpdates(_0x217263){return function(_0x514a27){try{jsonpatch[_0x4439('0x23')](_0x514a27,_0x217263,!![]);}catch(_0x34c62e){return BPromise[_0x4439('0x24')](_0x34c62e);}return _0x514a27[_0x4439('0x25')]();};}function saveUpdates(_0x30cd29,_0x3941d7){return function(_0x1f6bd3){if(_0x1f6bd3){return _0x1f6bd3[_0x4439('0x26')](_0x30cd29)[_0x4439('0x27')](function(_0x5f5354){return _0x5f5354;});}return null;};}function removeEntity(_0x3f7511,_0x3431c4){return function(_0x39ff75){if(_0x39ff75){return _0x39ff75[_0x4439('0x28')]()[_0x4439('0x27')](function(){_0x3f7511[_0x4439('0x1c')](0xcc)[_0x4439('0x29')]();});}};}function handleEntityNotFound(_0x51758b,_0x458465){return function(_0x70cd4b){if(!_0x70cd4b){_0x51758b[_0x4439('0x1b')](0x194);}return _0x70cd4b;};}function handleError(_0x227aba,_0xec3714){_0xec3714=_0xec3714||0x1f4;return function(_0x4c6b63){logger[_0x4439('0x2a')](_0x4c6b63[_0x4439('0x2b')]);if(_0x4c6b63[_0x4439('0x2c')]){delete _0x4c6b63['name'];}_0x227aba[_0x4439('0x1c')](_0xec3714)[_0x4439('0x2d')](_0x4c6b63);};}exports[_0x4439('0x2e')]=function(_0x47dadc,_0x2403a2){var _0x1f69c2={},_0x3bae33={},_0x3a384b={'count':0x0,'rows':[]};var _0x171575=_[_0x4439('0x2f')](db['UserProfileSection'][_0x4439('0x30')],function(_0x5937f8){return{'name':_0x5937f8[_0x4439('0x31')],'type':_0x5937f8['type'][_0x4439('0x32')]};});_0x3bae33[_0x4439('0x33')]=_['map'](_0x171575,_0x4439('0x2c'));_0x3bae33[_0x4439('0x34')]=_[_0x4439('0x35')](_0x47dadc[_0x4439('0x34')]);_0x3bae33[_0x4439('0x36')]=_['intersection'](_0x3bae33['model'],_0x3bae33[_0x4439('0x34')]);_0x1f69c2[_0x4439('0x37')]=_[_0x4439('0x38')](_0x3bae33[_0x4439('0x33')],qs['fields'](_0x47dadc['query'][_0x4439('0x39')]));_0x1f69c2['attributes']=_0x1f69c2['attributes']['length']?_0x1f69c2[_0x4439('0x37')]:_0x3bae33['model'];if(!_0x47dadc[_0x4439('0x34')][_0x4439('0x3a')](_0x4439('0x3b'))){_0x1f69c2['limit']=qs[_0x4439('0x20')](_0x47dadc[_0x4439('0x34')][_0x4439('0x20')]);_0x1f69c2[_0x4439('0x1e')]=qs[_0x4439('0x1e')](_0x47dadc[_0x4439('0x34')][_0x4439('0x1e')]);}_0x1f69c2[_0x4439('0x3c')]=qs['sort'](_0x47dadc[_0x4439('0x34')][_0x4439('0x3d')]);_0x1f69c2[_0x4439('0x3e')]=qs[_0x4439('0x36')](_[_0x4439('0x3f')](_0x47dadc[_0x4439('0x34')],_0x3bae33[_0x4439('0x36')]),_0x171575);if(_0x47dadc['query'][_0x4439('0x40')]){_0x1f69c2[_0x4439('0x3e')]=_[_0x4439('0x41')](_0x1f69c2[_0x4439('0x3e')],{'$or':_['map'](_0x171575,function(_0x3141c2){if(_0x3141c2[_0x4439('0x42')]!==_0x4439('0x43')){var _0x50e4ca={};_0x50e4ca[_0x3141c2[_0x4439('0x2c')]]={'$like':'%'+_0x47dadc['query']['filter']+'%'};return _0x50e4ca;}})});}_0x1f69c2=_[_0x4439('0x41')]({},_0x1f69c2,_0x47dadc['options']);var _0x3f1105={'where':_0x1f69c2['where']};return db['UserProfileSection'][_0x4439('0x21')](_0x3f1105)[_0x4439('0x27')](function(_0x447c05){_0x3a384b['count']=_0x447c05;if(_0x47dadc[_0x4439('0x34')][_0x4439('0x44')]){_0x1f69c2[_0x4439('0x45')]=[{'all':!![]}];}return db[_0x4439('0x46')][_0x4439('0x47')](_0x1f69c2);})[_0x4439('0x27')](function(_0x196e2e){_0x3a384b[_0x4439('0x48')]=_0x196e2e;return _0x3a384b;})[_0x4439('0x27')](respondWithFilteredResult(_0x2403a2,_0x1f69c2))[_0x4439('0x49')](handleError(_0x2403a2,null));};exports[_0x4439('0x4a')]=function(_0xfe2fce,_0x34cc8d){var _0x328acd={'raw':![],'where':{'id':_0xfe2fce[_0x4439('0x4b')]['id']}},_0x4e7861={};_0x4e7861['model']=_[_0x4439('0x35')](db[_0x4439('0x46')][_0x4439('0x30')]);_0x4e7861[_0x4439('0x34')]=_['keys'](_0xfe2fce[_0x4439('0x34')]);_0x4e7861[_0x4439('0x36')]=_[_0x4439('0x38')](_0x4e7861['model'],_0x4e7861[_0x4439('0x34')]);_0x328acd['attributes']=_[_0x4439('0x38')](_0x4e7861[_0x4439('0x33')],qs['fields'](_0xfe2fce[_0x4439('0x34')][_0x4439('0x39')]));_0x328acd[_0x4439('0x37')]=_0x328acd[_0x4439('0x37')][_0x4439('0x4c')]?_0x328acd[_0x4439('0x37')]:_0x4e7861[_0x4439('0x33')];if(_0xfe2fce['query'][_0x4439('0x44')]){_0x328acd['include']=[{'all':!![]}];}_0x328acd=_[_0x4439('0x41')]({},_0x328acd,_0xfe2fce[_0x4439('0x4d')]);return db[_0x4439('0x46')]['find'](_0x328acd)[_0x4439('0x27')](handleEntityNotFound(_0x34cc8d,null))[_0x4439('0x27')](respondWithResult(_0x34cc8d,null))[_0x4439('0x49')](handleError(_0x34cc8d,null));};exports[_0x4439('0x4e')]=function(_0x1425e4,_0x1c5482){return db['UserProfileSection']['create'](_0x1425e4[_0x4439('0x4f')],{})[_0x4439('0x27')](respondWithResult(_0x1c5482,0xc9))['catch'](handleError(_0x1c5482,null));};exports[_0x4439('0x26')]=function(_0x3d8602,_0x41d327){if(_0x3d8602[_0x4439('0x4f')]['id']){delete _0x3d8602[_0x4439('0x4f')]['id'];}return db['UserProfileSection'][_0x4439('0x50')]({'where':{'id':_0x3d8602[_0x4439('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41d327,null))[_0x4439('0x27')](saveUpdates(_0x3d8602[_0x4439('0x4f')],null))[_0x4439('0x27')](respondWithResult(_0x41d327,null))[_0x4439('0x49')](handleError(_0x41d327,null));};exports[_0x4439('0x28')]=function(_0x59de1e,_0xc12fff){return db[_0x4439('0x46')][_0x4439('0x50')]({'where':{'id':_0x59de1e[_0x4439('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc12fff,null))[_0x4439('0x27')](removeEntity(_0xc12fff,null))[_0x4439('0x49')](handleError(_0xc12fff,null));};exports['describe']=function(_0x39c4c4,_0x263e2c){return db[_0x4439('0x46')][_0x4439('0x51')]()['then'](respondWithResult(_0x263e2c,null))[_0x4439('0x49')](handleError(_0x263e2c,null));}; \ No newline at end of file +var _0x1fa1=['count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','findAll','then','rows','params','length','include','options','create','body','find','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x407883,_0xb548f){var _0x183ca2=function(_0x48f454){while(--_0x48f454){_0x407883['push'](_0x407883['shift']());}};_0x183ca2(++_0xb548f);}(_0x1fa1,0x10a));var _0x11fa=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x1fa1[_0x919bbb];return _0x40971a;};'use strict';var emlformat=require(_0x11fa('0x0'));var rimraf=require(_0x11fa('0x1'));var zipdir=require(_0x11fa('0x2'));var jsonpatch=require(_0x11fa('0x3'));var rp=require(_0x11fa('0x4'));var moment=require('moment');var BPromise=require(_0x11fa('0x5'));var Mustache=require(_0x11fa('0x6'));var util=require(_0x11fa('0x7'));var path=require('path');var sox=require(_0x11fa('0x8'));var csv=require(_0x11fa('0x9'));var ejs=require(_0x11fa('0xa'));var fs=require('fs');var fs_extra=require(_0x11fa('0xb'));var _=require(_0x11fa('0xc'));var squel=require('squel');var crypto=require(_0x11fa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x11fa('0xe'));var Papa=require(_0x11fa('0xf'));var Redis=require(_0x11fa('0x10'));var authService=require(_0x11fa('0x11'));var qs=require(_0x11fa('0x12'));var as=require(_0x11fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11fa('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x11fa('0x15'));var licenseUtil=require(_0x11fa('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x985803,_0x115e47){_0x115e47=_0x115e47||0xcc;return function(_0x31ada8){if(_0x31ada8){return _0x985803[_0x11fa('0x17')](_0x115e47);}return _0x985803[_0x11fa('0x18')](_0x115e47)[_0x11fa('0x19')]();};}function respondWithResult(_0xaa880f,_0x3c0577){_0x3c0577=_0x3c0577||0xc8;return function(_0x20d606){if(_0x20d606){return _0xaa880f[_0x11fa('0x18')](_0x3c0577)[_0x11fa('0x1a')](_0x20d606);}};}function respondWithFilteredResult(_0x283552,_0x4825a6){return function(_0x5033a7){if(_0x5033a7){var _0xbeb381=typeof _0x4825a6[_0x11fa('0x1b')]==='undefined'&&typeof _0x4825a6[_0x11fa('0x1c')]===_0x11fa('0x1d');var _0x2f6dd5=_0x5033a7['count'];var _0x354121=_0xbeb381?0x0:_0x4825a6[_0x11fa('0x1b')];var _0x403c76=_0xbeb381?_0x5033a7[_0x11fa('0x1e')]:_0x4825a6[_0x11fa('0x1b')]+_0x4825a6[_0x11fa('0x1c')];var _0x27d985;if(_0x403c76>=_0x2f6dd5){_0x403c76=_0x2f6dd5;_0x27d985=0xc8;}else{_0x27d985=0xce;}_0x283552[_0x11fa('0x18')](_0x27d985);return _0x283552[_0x11fa('0x1f')](_0x11fa('0x20'),_0x354121+'-'+_0x403c76+'/'+_0x2f6dd5)[_0x11fa('0x1a')](_0x5033a7);}return null;};}function patchUpdates(_0x2548ee){return function(_0x43f3ef){try{jsonpatch[_0x11fa('0x21')](_0x43f3ef,_0x2548ee,!![]);}catch(_0x344ca3){return BPromise['reject'](_0x344ca3);}return _0x43f3ef[_0x11fa('0x22')]();};}function saveUpdates(_0x58510a,_0x4786d6){return function(_0x128017){if(_0x128017){return _0x128017[_0x11fa('0x23')](_0x58510a)['then'](function(_0x53618a){return _0x53618a;});}return null;};}function removeEntity(_0x34fcf3,_0x18f711){return function(_0x6a7513){if(_0x6a7513){return _0x6a7513[_0x11fa('0x24')]()['then'](function(){_0x34fcf3[_0x11fa('0x18')](0xcc)[_0x11fa('0x19')]();});}};}function handleEntityNotFound(_0x55a84b,_0x6b453b){return function(_0x100a7c){if(!_0x100a7c){_0x55a84b[_0x11fa('0x17')](0x194);}return _0x100a7c;};}function handleError(_0x31347e,_0x349bee){_0x349bee=_0x349bee||0x1f4;return function(_0x7d3b71){logger[_0x11fa('0x25')](_0x7d3b71[_0x11fa('0x26')]);if(_0x7d3b71[_0x11fa('0x27')]){delete _0x7d3b71[_0x11fa('0x27')];}_0x31347e[_0x11fa('0x18')](_0x349bee)[_0x11fa('0x28')](_0x7d3b71);};}exports[_0x11fa('0x29')]=function(_0x4e6edc,_0x2adc85){var _0x10873f={},_0x1f063a={},_0x2fc701={'count':0x0,'rows':[]};var _0x427eb5=_[_0x11fa('0x2a')](db[_0x11fa('0x2b')][_0x11fa('0x2c')],function(_0x3eaef6){return{'name':_0x3eaef6['fieldName'],'type':_0x3eaef6[_0x11fa('0x2d')]['key']};});_0x1f063a[_0x11fa('0x2e')]=_['map'](_0x427eb5,_0x11fa('0x27'));_0x1f063a[_0x11fa('0x2f')]=_[_0x11fa('0x30')](_0x4e6edc[_0x11fa('0x2f')]);_0x1f063a[_0x11fa('0x31')]=_[_0x11fa('0x32')](_0x1f063a[_0x11fa('0x2e')],_0x1f063a[_0x11fa('0x2f')]);_0x10873f[_0x11fa('0x33')]=_[_0x11fa('0x32')](_0x1f063a['model'],qs['fields'](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x34')]));_0x10873f['attributes']=_0x10873f[_0x11fa('0x33')]['length']?_0x10873f['attributes']:_0x1f063a['model'];if(!_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x35')](_0x11fa('0x36'))){_0x10873f['limit']=qs[_0x11fa('0x1c')](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x1c')]);_0x10873f[_0x11fa('0x1b')]=qs[_0x11fa('0x1b')](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x1b')]);}_0x10873f[_0x11fa('0x37')]=qs[_0x11fa('0x38')](_0x4e6edc['query']['sort']);_0x10873f['where']=qs[_0x11fa('0x31')](_[_0x11fa('0x39')](_0x4e6edc['query'],_0x1f063a[_0x11fa('0x31')]),_0x427eb5);if(_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x3a')]){_0x10873f['where']=_[_0x11fa('0x3b')](_0x10873f[_0x11fa('0x3c')],{'$or':_[_0x11fa('0x2a')](_0x427eb5,function(_0x2f6160){if(_0x2f6160['type']!==_0x11fa('0x3d')){var _0x5629c3={};_0x5629c3[_0x2f6160[_0x11fa('0x27')]]={'$like':'%'+_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x3a')]+'%'};return _0x5629c3;}})});}_0x10873f=_[_0x11fa('0x3b')]({},_0x10873f,_0x4e6edc['options']);var _0x4402df={'where':_0x10873f[_0x11fa('0x3c')]};return db[_0x11fa('0x2b')][_0x11fa('0x1e')](_0x4402df)['then'](function(_0x2b7f92){_0x2fc701[_0x11fa('0x1e')]=_0x2b7f92;if(_0x4e6edc[_0x11fa('0x2f')]['includeAll']){_0x10873f['include']=[{'all':!![]}];}return db[_0x11fa('0x2b')][_0x11fa('0x3e')](_0x10873f);})[_0x11fa('0x3f')](function(_0x361cc6){_0x2fc701[_0x11fa('0x40')]=_0x361cc6;return _0x2fc701;})[_0x11fa('0x3f')](respondWithFilteredResult(_0x2adc85,_0x10873f))['catch'](handleError(_0x2adc85,null));};exports['show']=function(_0x11e74b,_0x4bbae4){var _0x36260f={'raw':![],'where':{'id':_0x11e74b[_0x11fa('0x41')]['id']}},_0x42efbb={};_0x42efbb['model']=_[_0x11fa('0x30')](db['UserProfileSection']['rawAttributes']);_0x42efbb[_0x11fa('0x2f')]=_[_0x11fa('0x30')](_0x11e74b['query']);_0x42efbb[_0x11fa('0x31')]=_['intersection'](_0x42efbb['model'],_0x42efbb[_0x11fa('0x2f')]);_0x36260f[_0x11fa('0x33')]=_['intersection'](_0x42efbb['model'],qs[_0x11fa('0x34')](_0x11e74b[_0x11fa('0x2f')][_0x11fa('0x34')]));_0x36260f[_0x11fa('0x33')]=_0x36260f[_0x11fa('0x33')][_0x11fa('0x42')]?_0x36260f[_0x11fa('0x33')]:_0x42efbb[_0x11fa('0x2e')];if(_0x11e74b[_0x11fa('0x2f')]['includeAll']){_0x36260f[_0x11fa('0x43')]=[{'all':!![]}];}_0x36260f=_[_0x11fa('0x3b')]({},_0x36260f,_0x11e74b[_0x11fa('0x44')]);return db['UserProfileSection']['find'](_0x36260f)[_0x11fa('0x3f')](handleEntityNotFound(_0x4bbae4,null))['then'](respondWithResult(_0x4bbae4,null))['catch'](handleError(_0x4bbae4,null));};exports[_0x11fa('0x45')]=function(_0x2d5d96,_0x47384b){return db[_0x11fa('0x2b')][_0x11fa('0x45')](_0x2d5d96[_0x11fa('0x46')],{})[_0x11fa('0x3f')](respondWithResult(_0x47384b,0xc9))['catch'](handleError(_0x47384b,null));};exports['update']=function(_0x1b58b0,_0x5de03b){if(_0x1b58b0[_0x11fa('0x46')]['id']){delete _0x1b58b0[_0x11fa('0x46')]['id'];}return db[_0x11fa('0x2b')][_0x11fa('0x47')]({'where':{'id':_0x1b58b0[_0x11fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x5de03b,null))[_0x11fa('0x3f')](saveUpdates(_0x1b58b0[_0x11fa('0x46')],null))[_0x11fa('0x3f')](respondWithResult(_0x5de03b,null))[_0x11fa('0x48')](handleError(_0x5de03b,null));};exports[_0x11fa('0x24')]=function(_0x4c9d37,_0xc979e8){return db[_0x11fa('0x2b')][_0x11fa('0x47')]({'where':{'id':_0x4c9d37[_0x11fa('0x41')]['id']}})[_0x11fa('0x3f')](handleEntityNotFound(_0xc979e8,null))[_0x11fa('0x3f')](removeEntity(_0xc979e8,null))['catch'](handleError(_0xc979e8,null));};exports[_0x11fa('0x49')]=function(_0x361fe4,_0x1349c4){return db[_0x11fa('0x2b')]['describe']()[_0x11fa('0x3f')](respondWithResult(_0x1349c4,null))['catch'](handleError(_0x1349c4,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a4139fc..d03836d 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 _0x68ee=['api','moment','bluebird','path','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','userProfileId','lodash','util','../../config/logger'];(function(_0x591f61,_0x412b35){var _0x557bb2=function(_0x43c38b){while(--_0x43c38b){_0x591f61['push'](_0x591f61['shift']());}};_0x557bb2(++_0x412b35);}(_0x68ee,0x1eb));var _0xe68e=function(_0x9b2658,_0x490b4b){_0x9b2658=_0x9b2658-0x0;var _0x3d2315=_0x68ee[_0x9b2658];return _0x3d2315;};'use strict';var _=require(_0xe68e('0x0'));var util=require(_0xe68e('0x1'));var logger=require(_0xe68e('0x2'))(_0xe68e('0x3'));var moment=require(_0xe68e('0x4'));var BPromise=require(_0xe68e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe68e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe68e('0x7'));module[_0xe68e('0x8')]=function(_0x21cfcd,_0x51d94a){return _0x21cfcd[_0xe68e('0x9')](_0xe68e('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xe68e('0xb'),'fields':['sectionId',_0xe68e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeaf5=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','userProfileId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0xeaf5,0x19e));var _0x5eaf=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0xeaf5[_0x47643e];return _0x2aa5db;};'use strict';var _=require(_0x5eaf('0x0'));var util=require('util');var logger=require(_0x5eaf('0x1'))(_0x5eaf('0x2'));var moment=require('moment');var BPromise=require(_0x5eaf('0x3'));var rp=require(_0x5eaf('0x4'));var fs=require('fs');var path=require(_0x5eaf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5eaf('0x6'));module[_0x5eaf('0x7')]=function(_0x1fdbea,_0x5924a9){return _0x1fdbea[_0x5eaf('0x8')](_0x5eaf('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x5eaf('0xa'),'fields':['sectionId',_0x5eaf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ed1b37e..d127ba7 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 _0x21f2=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x15cd3a,_0x575854){var _0x3c67a8=function(_0x361e5b){while(--_0x361e5b){_0x15cd3a['push'](_0x15cd3a['shift']());}};_0x3c67a8(++_0x575854);}(_0x21f2,0x158));var _0x221f=function(_0x59fcb7,_0x3adb8b){_0x59fcb7=_0x59fcb7-0x0;var _0x471e1d=_0x21f2[_0x59fcb7];return _0x471e1d;};'use strict';var _=require('lodash');var util=require(_0x221f('0x0'));var moment=require(_0x221f('0x1'));var BPromise=require(_0x221f('0x2'));var rs=require(_0x221f('0x3'));var fs=require('fs');var Redis=require(_0x221f('0x4'));var db=require(_0x221f('0x5'))['db'];var utils=require(_0x221f('0x6'));var logger=require(_0x221f('0x7'))(_0x221f('0x8'));var config=require(_0x221f('0x9'));var jayson=require(_0x221f('0xa'));var client=jayson['client'][_0x221f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc069ff,_0x182a72,_0x28768d){return new BPromise(function(_0x116c6c,_0x4a27d0){return client[_0x221f('0xc')](_0xc069ff,_0x28768d)[_0x221f('0xd')](function(_0x3d1cb0){logger[_0x221f('0xe')](_0x221f('0xf'),_0x182a72,_0x221f('0x10'));logger[_0x221f('0x11')](_0x221f('0x12'),_0x182a72,_0x221f('0x10'),JSON[_0x221f('0x13')](_0x3d1cb0));if(_0x3d1cb0[_0x221f('0x14')]){if(_0x3d1cb0[_0x221f('0x14')][_0x221f('0x15')]===0x1f4){logger[_0x221f('0x14')](_0x221f('0xf'),_0x182a72,_0x3d1cb0[_0x221f('0x14')][_0x221f('0x16')]);return _0x4a27d0(_0x3d1cb0[_0x221f('0x14')][_0x221f('0x16')]);}logger[_0x221f('0x14')](_0x221f('0xf'),_0x182a72,_0x3d1cb0[_0x221f('0x14')][_0x221f('0x16')]);return _0x116c6c(_0x3d1cb0[_0x221f('0x14')][_0x221f('0x16')]);}else{logger['info'](_0x221f('0xf'),_0x182a72,_0x221f('0x10'));_0x116c6c(_0x3d1cb0[_0x221f('0x17')]['message']);}})['catch'](function(_0x301444){logger['error'](_0x221f('0xf'),_0x182a72,_0x301444);_0x4a27d0(_0x301444);});});} \ No newline at end of file +var _0x1a3f=['message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28a4b8,_0x48eb0f){var _0x21c4b6=function(_0xd36144){while(--_0xd36144){_0x28a4b8['push'](_0x28a4b8['shift']());}};_0x21c4b6(++_0x48eb0f);}(_0x1a3f,0x100));var _0xf1a3=function(_0x3e3a9a,_0x130a99){_0x3e3a9a=_0x3e3a9a-0x0;var _0x14d76a=_0x1a3f[_0x3e3a9a];return _0x14d76a;};'use strict';var _=require(_0xf1a3('0x0'));var util=require('util');var moment=require(_0xf1a3('0x1'));var BPromise=require(_0xf1a3('0x2'));var rs=require(_0xf1a3('0x3'));var fs=require('fs');var Redis=require(_0xf1a3('0x4'));var db=require(_0xf1a3('0x5'))['db'];var utils=require(_0xf1a3('0x6'));var logger=require(_0xf1a3('0x7'))(_0xf1a3('0x8'));var config=require(_0xf1a3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf1a3('0xa')][_0xf1a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fbec8,_0x522b9d,_0x1822b9){return new BPromise(function(_0x62543f,_0x9943b5){return client['request'](_0x1fbec8,_0x1822b9)[_0xf1a3('0xc')](function(_0x40206c){logger['info'](_0xf1a3('0xd'),_0x522b9d,_0xf1a3('0xe'));logger[_0xf1a3('0xf')](_0xf1a3('0x10'),_0x522b9d,'request\x20sent',JSON[_0xf1a3('0x11')](_0x40206c));if(_0x40206c[_0xf1a3('0x12')]){if(_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x13')]===0x1f4){logger[_0xf1a3('0x12')](_0xf1a3('0xd'),_0x522b9d,_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x14')]);return _0x9943b5(_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x14')]);}logger[_0xf1a3('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x522b9d,_0x40206c[_0xf1a3('0x12')]['message']);return _0x62543f(_0x40206c[_0xf1a3('0x12')]['message']);}else{logger[_0xf1a3('0x15')](_0xf1a3('0xd'),_0x522b9d,_0xf1a3('0xe'));_0x62543f(_0x40206c['result'][_0xf1a3('0x14')]);}})[_0xf1a3('0x16')](function(_0x2ff964){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x522b9d,_0x2ff964);_0x9943b5(_0x2ff964);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 97be375..282c74b 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4fe5d3,_0x1bc54f){var _0x254c45=function(_0x5496b2){while(--_0x5496b2){_0x4fe5d3['push'](_0x4fe5d3['shift']());}};_0x254c45(++_0x1bc54f);}(_0x70e0,0x17b));var _0x070e=function(_0x282195,_0x4b49d9){_0x282195=_0x282195-0x0;var _0x1e9aa2=_0x70e0[_0x282195];return _0x1e9aa2;};'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 b8ed501..163fe7a 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 _0x562f=['exports','INTEGER','sequelize'];(function(_0x46e5fc,_0x5db9aa){var _0x52f4e6=function(_0x51a00){while(--_0x51a00){_0x46e5fc['push'](_0x46e5fc['shift']());}};_0x52f4e6(++_0x5db9aa);}(_0x562f,0x1d6));var _0xf562=function(_0x2a5755,_0x17f587){_0x2a5755=_0x2a5755-0x0;var _0x1700da=_0x562f[_0x2a5755];return _0x1700da;};'use strict';var Sequelize=require(_0xf562('0x0'));module[_0xf562('0x1')]={'penalty':{'type':Sequelize[_0xf562('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2eb=['INTEGER','sequelize'];(function(_0x4dc8da,_0x5b3d42){var _0x59d829=function(_0x1af72e){while(--_0x1af72e){_0x4dc8da['push'](_0x4dc8da['shift']());}};_0x59d829(++_0x5b3d42);}(_0xd2eb,0x1b5));var _0xbd2e=function(_0x5bed83,_0x28927e){_0x5bed83=_0x5bed83-0x0;var _0x3d28d3=_0xd2eb[_0x5bed83];return _0x3d28d3;};'use strict';var Sequelize=require(_0xbd2e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbd2e('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 58a419e..b29ad6c 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 _0x81c6=['UserSmsQueue','util','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0xe65fbc,_0x65ba14){var _0x4ce2f2=function(_0x551b04){while(--_0x551b04){_0xe65fbc['push'](_0xe65fbc['shift']());}};_0x4ce2f2(++_0x65ba14);}(_0x81c6,0x1d5));var _0x681c=function(_0x5ecd9f,_0x5451fa){_0x5ecd9f=_0x5ecd9f-0x0;var _0x2e6980=_0x81c6[_0x5ecd9f];return _0x2e6980;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf40b=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x1d3d9b,_0x4cd482){var _0x138fad=function(_0x496bdc){while(--_0x496bdc){_0x1d3d9b['push'](_0x1d3d9b['shift']());}};_0x138fad(++_0x4cd482);}(_0xf40b,0xb0));var _0xbf40=function(_0x2ff75c,_0x2d7c8c){_0x2ff75c=_0x2ff75c-0x0;var _0x41b448=_0xf40b[_0x2ff75c];return _0x41b448;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf40('0x4'));var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module['exports']=function(_0x2e74b5,_0xbe1c47){return _0x2e74b5[_0xbf40('0x9')](_0xbf40('0xa'),attributes,{'tableName':_0xbf40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index b9e0db7..c50ef01 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 _0xce24=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x126115,_0x3bbbc5){var _0x8ef1e3=function(_0x376e33){while(--_0x376e33){_0x126115['push'](_0x126115['shift']());}};_0x8ef1e3(++_0x3bbbc5);}(_0xce24,0x165));var _0x4ce2=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xce24[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x4ce2('0x0'));var util=require(_0x4ce2('0x1'));var moment=require(_0x4ce2('0x2'));var BPromise=require(_0x4ce2('0x3'));var rs=require(_0x4ce2('0x4'));var fs=require('fs');var Redis=require(_0x4ce2('0x5'));var db=require(_0x4ce2('0x6'))['db'];var utils=require(_0x4ce2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ce2('0x8'));var jayson=require(_0x4ce2('0x9'));var client=jayson[_0x4ce2('0xa')][_0x4ce2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f86c2,_0x315784,_0xc8bc2){return new BPromise(function(_0x2f1fdc,_0x55420c){return client[_0x4ce2('0xc')](_0x2f86c2,_0xc8bc2)[_0x4ce2('0xd')](function(_0x2823e2){logger[_0x4ce2('0xe')](_0x4ce2('0xf'),_0x315784,_0x4ce2('0x10'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x315784,_0x4ce2('0x10'),JSON[_0x4ce2('0x11')](_0x2823e2));if(_0x2823e2[_0x4ce2('0x12')]){if(_0x2823e2['error']['code']===0x1f4){logger[_0x4ce2('0x12')](_0x4ce2('0xf'),_0x315784,_0x2823e2['error'][_0x4ce2('0x13')]);return _0x55420c(_0x2823e2[_0x4ce2('0x12')][_0x4ce2('0x13')]);}logger[_0x4ce2('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x315784,_0x2823e2[_0x4ce2('0x12')][_0x4ce2('0x13')]);return _0x2f1fdc(_0x2823e2['error'][_0x4ce2('0x13')]);}else{logger['info'](_0x4ce2('0xf'),_0x315784,'request\x20sent');_0x2f1fdc(_0x2823e2[_0x4ce2('0x14')][_0x4ce2('0x13')]);}})[_0x4ce2('0x15')](function(_0x1854e7){logger[_0x4ce2('0x12')](_0x4ce2('0xf'),_0x315784,_0x1854e7);_0x55420c(_0x1854e7);});});} \ No newline at end of file +var _0xb7db=['error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x541c3b,_0x1019c6){var _0x2ab34b=function(_0x42b30e){while(--_0x42b30e){_0x541c3b['push'](_0x541c3b['shift']());}};_0x2ab34b(++_0x1019c6);}(_0xb7db,0x114));var _0xbb7d=function(_0x125526,_0x4e8254){_0x125526=_0x125526-0x0;var _0x81a07e=_0xb7db[_0x125526];return _0x81a07e;};'use strict';var _=require(_0xbb7d('0x0'));var util=require(_0xbb7d('0x1'));var moment=require(_0xbb7d('0x2'));var BPromise=require(_0xbb7d('0x3'));var rs=require(_0xbb7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb7d('0x5'))['db'];var utils=require(_0xbb7d('0x6'));var logger=require(_0xbb7d('0x7'))(_0xbb7d('0x8'));var config=require(_0xbb7d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbb7d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f29b6,_0x28b414,_0x2903ca){return new BPromise(function(_0x4ad3fb,_0x46ffdf){return client[_0xbb7d('0xb')](_0x3f29b6,_0x2903ca)[_0xbb7d('0xc')](function(_0x5b9e44){logger[_0xbb7d('0xd')](_0xbb7d('0xe'),_0x28b414,_0xbb7d('0xf'));logger[_0xbb7d('0x10')](_0xbb7d('0x11'),_0x28b414,_0xbb7d('0xf'),JSON['stringify'](_0x5b9e44));if(_0x5b9e44[_0xbb7d('0x12')]){if(_0x5b9e44[_0xbb7d('0x12')]['code']===0x1f4){logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x5b9e44[_0xbb7d('0x12')]['message']);return _0x46ffdf(_0x5b9e44[_0xbb7d('0x12')][_0xbb7d('0x13')]);}logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x5b9e44[_0xbb7d('0x12')]['message']);return _0x4ad3fb(_0x5b9e44['error'][_0xbb7d('0x13')]);}else{logger[_0xbb7d('0xd')](_0xbb7d('0xe'),_0x28b414,_0xbb7d('0xf'));_0x4ad3fb(_0x5b9e44[_0xbb7d('0x14')]['message']);}})['catch'](function(_0x33661d){logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x33661d);_0x46ffdf(_0x33661d);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/index.js b/server/api/userVoicePrefix/index.js index eb255cd..4552e97 100644 --- a/server/api/userVoicePrefix/index.js +++ b/server/api/userVoicePrefix/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(_0x266b0c,_0x4fb269){var _0xd1bfa7=function(_0x36c2d2){while(--_0x36c2d2){_0x266b0c['push'](_0x266b0c['shift']());}};_0xd1bfa7(++_0x4fb269);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e7aa0,_0x58b6e6){var _0x51345e=function(_0x1a0df7){while(--_0x1a0df7){_0x3e7aa0['push'](_0x3e7aa0['shift']());}};_0x51345e(++_0x58b6e6);}(_0xe706,0xa3));var _0x6e70=function(_0x32b30c,_0x4c5567){_0x32b30c=_0x32b30c-0x0;var _0x59bc79=_0xe706[_0x32b30c];return _0x59bc79;};'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/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 7ad20dd..932f31c 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 _0xade9=['INTEGER','sequelize'];(function(_0x22edac,_0x3927b8){var _0x492ef4=function(_0x38a882){while(--_0x38a882){_0x22edac['push'](_0x22edac['shift']());}};_0x492ef4(++_0x3927b8);}(_0xade9,0x1e5));var _0x9ade=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0xade9[_0x12c34e];return _0x244e88;};'use strict';var Sequelize=require(_0x9ade('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9ade('0x1')]}}; \ No newline at end of file +var _0x0083=['INTEGER','sequelize','exports'];(function(_0x34cc9f,_0x4d891a){var _0x1991d3=function(_0x47284b){while(--_0x47284b){_0x34cc9f['push'](_0x34cc9f['shift']());}};_0x1991d3(++_0x4d891a);}(_0x0083,0x91));var _0x3008=function(_0x5bac50,_0x540d00){_0x5bac50=_0x5bac50-0x0;var _0x28afd5=_0x0083[_0x5bac50];return _0x28afd5;};'use strict';var Sequelize=require(_0x3008('0x0'));module[_0x3008('0x1')]={'UserId':{'type':Sequelize[_0x3008('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x3008('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b2d8c9a..e697bf3 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(_0x765a38,_0x4fc989){var _0x5207b4=function(_0x56bbaa){while(--_0x56bbaa){_0x765a38['push'](_0x765a38['shift']());}};_0x5207b4(++_0x4fc989);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3c2c39,_0x1f3aac){var _0x1ad730=function(_0x169396){while(--_0x169396){_0x3c2c39['push'](_0x3c2c39['shift']());}};_0x1ad730(++_0x1f3aac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.rpc.js b/server/api/userVoicePrefix/userVoicePrefix.rpc.js index a96f1b3..ea50006 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.rpc.js +++ b/server/api/userVoicePrefix/userVoicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebd7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','UserVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','error','UserVoicePrefix,\x20%s,\x20%s','message','result'];(function(_0x136199,_0x3beb39){var _0x44ec86=function(_0x58bf80){while(--_0x58bf80){_0x136199['push'](_0x136199['shift']());}};_0x44ec86(++_0x3beb39);}(_0xebd7,0x180));var _0x7ebd=function(_0x47a8e3,_0x2e3a0b){_0x47a8e3=_0x47a8e3-0x0;var _0x4d2d03=_0xebd7[_0x47a8e3];return _0x4d2d03;};'use strict';var _=require(_0x7ebd('0x0'));var util=require(_0x7ebd('0x1'));var moment=require(_0x7ebd('0x2'));var BPromise=require(_0x7ebd('0x3'));var rs=require(_0x7ebd('0x4'));var fs=require('fs');var Redis=require(_0x7ebd('0x5'));var db=require(_0x7ebd('0x6'))['db'];var utils=require(_0x7ebd('0x7'));var logger=require(_0x7ebd('0x8'))(_0x7ebd('0x9'));var config=require(_0x7ebd('0xa'));var jayson=require(_0x7ebd('0xb'));var client=jayson[_0x7ebd('0xc')][_0x7ebd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5746a0,_0x5838eb,_0x18d2b4){return new BPromise(function(_0x1531d9,_0x218fb0){return client['request'](_0x5746a0,_0x18d2b4)[_0x7ebd('0xe')](function(_0x271cab){logger[_0x7ebd('0xf')]('UserVoicePrefix,\x20%s,\x20%s',_0x5838eb,_0x7ebd('0x10'));logger['debug'](_0x7ebd('0x11'),_0x5838eb,'request\x20sent',JSON[_0x7ebd('0x12')](_0x271cab));if(_0x271cab['error']){if(_0x271cab['error'][_0x7ebd('0x13')]===0x1f4){logger[_0x7ebd('0x14')](_0x7ebd('0x15'),_0x5838eb,_0x271cab['error'][_0x7ebd('0x16')]);return _0x218fb0(_0x271cab['error'][_0x7ebd('0x16')]);}logger['error'](_0x7ebd('0x15'),_0x5838eb,_0x271cab[_0x7ebd('0x14')][_0x7ebd('0x16')]);return _0x1531d9(_0x271cab['error'][_0x7ebd('0x16')]);}else{logger[_0x7ebd('0xf')]('UserVoicePrefix,\x20%s,\x20%s',_0x5838eb,_0x7ebd('0x10'));_0x1531d9(_0x271cab[_0x7ebd('0x17')][_0x7ebd('0x16')]);}})['catch'](function(_0x5f4d94){logger['error'](_0x7ebd('0x15'),_0x5838eb,_0x5f4d94);_0x218fb0(_0x5f4d94);});});} \ No newline at end of file +var _0x11a4=['request\x20sent','debug','UserVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','UserVoicePrefix,\x20%s,\x20%s'];(function(_0x5f0c76,_0x44b266){var _0x308606=function(_0x14bc96){while(--_0x14bc96){_0x5f0c76['push'](_0x5f0c76['shift']());}};_0x308606(++_0x44b266);}(_0x11a4,0x1d7));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x411a('0x0'));var util=require(_0x411a('0x1'));var moment=require(_0x411a('0x2'));var BPromise=require(_0x411a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x411a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x411a('0x5'));var logger=require('../../config/logger')(_0x411a('0x6'));var config=require(_0x411a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x411a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacad10,_0x3f5968,_0x1ec106){return new BPromise(function(_0x259dac,_0x1530d1){return client[_0x411a('0x9')](_0xacad10,_0x1ec106)[_0x411a('0xa')](function(_0xcdc0ed){logger[_0x411a('0xb')](_0x411a('0xc'),_0x3f5968,_0x411a('0xd'));logger[_0x411a('0xe')](_0x411a('0xf'),_0x3f5968,'request\x20sent',JSON[_0x411a('0x10')](_0xcdc0ed));if(_0xcdc0ed[_0x411a('0x11')]){if(_0xcdc0ed[_0x411a('0x11')][_0x411a('0x12')]===0x1f4){logger[_0x411a('0x11')](_0x411a('0xc'),_0x3f5968,_0xcdc0ed['error'][_0x411a('0x13')]);return _0x1530d1(_0xcdc0ed[_0x411a('0x11')][_0x411a('0x13')]);}logger['error']('UserVoicePrefix,\x20%s,\x20%s',_0x3f5968,_0xcdc0ed[_0x411a('0x11')][_0x411a('0x13')]);return _0x259dac(_0xcdc0ed[_0x411a('0x11')]['message']);}else{logger[_0x411a('0xb')](_0x411a('0xc'),_0x3f5968,'request\x20sent');_0x259dac(_0xcdc0ed[_0x411a('0x14')][_0x411a('0x13')]);}})[_0x411a('0x15')](function(_0x59df42){logger[_0x411a('0x11')](_0x411a('0xc'),_0x3f5968,_0x59df42);_0x1530d1(_0x59df42);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index f00d523..06bda3b 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(_0x153099,_0x24cc13){var _0x4a8c61=function(_0x15f5fd){while(--_0x15f5fd){_0x153099['push'](_0x153099['shift']());}};_0x4a8c61(++_0x24cc13);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2eefdc,_0x331c51){var _0x501d09=function(_0x52bef4){while(--_0x52bef4){_0x2eefdc['push'](_0x2eefdc['shift']());}};_0x501d09(++_0x331c51);}(_0x70e0,0x17b));var _0x070e=function(_0x18f1af,_0x49bcae){_0x18f1af=_0x18f1af-0x0;var _0x319901=_0x70e0[_0x18f1af];return _0x319901;};'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 33003cb..d8b5a0a 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 _0x5495=['INTEGER','exports'];(function(_0x3968a8,_0x4f7815){var _0x10fa30=function(_0x4e965d){while(--_0x4e965d){_0x3968a8['push'](_0x3968a8['shift']());}};_0x10fa30(++_0x4f7815);}(_0x5495,0x6d));var _0x5549=function(_0x32ef57,_0x4e2263){_0x32ef57=_0x32ef57-0x0;var _0xc937e5=_0x5495[_0x32ef57];return _0xc937e5;};'use strict';var Sequelize=require('sequelize');module[_0x5549('0x0')]={'penalty':{'type':Sequelize[_0x5549('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x824b=['INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x824b,0x10e));var _0xb824=function(_0x1a1d54,_0x4f60b1){_0x1a1d54=_0x1a1d54-0x0;var _0x593ddf=_0x824b[_0x1a1d54];return _0x593ddf;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb824('0x0')],'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 44c7486..483fddc 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 _0x94b1=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3fd4f7,_0x33d29f){var _0x5131a9=function(_0xe865d7){while(--_0xe865d7){_0x3fd4f7['push'](_0x3fd4f7['shift']());}};_0x5131a9(++_0x33d29f);}(_0x94b1,0xf5));var _0x194b=function(_0x1fb01a,_0x5a3b15){_0x1fb01a=_0x1fb01a-0x0;var _0x5d625a=_0x94b1[_0x1fb01a];return _0x5d625a;};'use strict';var _=require(_0x194b('0x0'));var util=require(_0x194b('0x1'));var logger=require(_0x194b('0x2'))(_0x194b('0x3'));var moment=require('moment');var BPromise=require(_0x194b('0x4'));var rp=require(_0x194b('0x5'));var fs=require('fs');var path=require(_0x194b('0x6'));var rimraf=require(_0x194b('0x7'));var config=require(_0x194b('0x8'));var attributes=require(_0x194b('0x9'));module[_0x194b('0xa')]=function(_0x501b31,_0x4c16ef){return _0x501b31[_0x194b('0xb')](_0x194b('0xc'),attributes,{'tableName':_0x194b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96ee=['api','moment','path','rimraf','../../config/environment','exports','user_has_voice_queues','../../config/logger'];(function(_0x24930c,_0xf01ff1){var _0x3ff362=function(_0x36f83b){while(--_0x36f83b){_0x24930c['push'](_0x24930c['shift']());}};_0x3ff362(++_0xf01ff1);}(_0x96ee,0x177));var _0xe96e=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0x96ee[_0x2deac4];return _0x1c0bda;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe96e('0x0'))(_0xe96e('0x1'));var moment=require(_0xe96e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe96e('0x3'));var rimraf=require(_0xe96e('0x4'));var config=require(_0xe96e('0x5'));var attributes=require('./userVoiceQueue.attributes');module[_0xe96e('0x6')]=function(_0x383de3,_0x4b9128){return _0x383de3['define']('UserVoiceQueue',attributes,{'tableName':_0xe96e('0x7'),'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 3b5d22a..7336142 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 _0x6860=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http'];(function(_0x3383f8,_0xb284cd){var _0x294be5=function(_0x19494d){while(--_0x19494d){_0x3383f8['push'](_0x3383f8['shift']());}};_0x294be5(++_0xb284cd);}(_0x6860,0x1ac));var _0x0686=function(_0x1d24d3,_0x4d71e9){_0x1d24d3=_0x1d24d3-0x0;var _0x4c0a01=_0x6860[_0x1d24d3];return _0x4c0a01;};'use strict';var _=require(_0x0686('0x0'));var util=require(_0x0686('0x1'));var moment=require(_0x0686('0x2'));var BPromise=require(_0x0686('0x3'));var rs=require(_0x0686('0x4'));var fs=require('fs');var Redis=require(_0x0686('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0686('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0686('0x7'));var client=jayson['client'][_0x0686('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a65d3,_0x2b1428,_0x22f3af){return new BPromise(function(_0x386add,_0x42ca72){return client['request'](_0x4a65d3,_0x22f3af)[_0x0686('0x9')](function(_0x563528){logger[_0x0686('0xa')](_0x0686('0xb'),_0x2b1428,_0x0686('0xc'));logger[_0x0686('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2b1428,_0x0686('0xc'),JSON[_0x0686('0xe')](_0x563528));if(_0x563528[_0x0686('0xf')]){if(_0x563528[_0x0686('0xf')][_0x0686('0x10')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2b1428,_0x563528[_0x0686('0xf')][_0x0686('0x11')]);return _0x42ca72(_0x563528[_0x0686('0xf')]['message']);}logger[_0x0686('0xf')](_0x0686('0xb'),_0x2b1428,_0x563528[_0x0686('0xf')][_0x0686('0x11')]);return _0x386add(_0x563528['error'][_0x0686('0x11')]);}else{logger['info'](_0x0686('0xb'),_0x2b1428,_0x0686('0xc'));_0x386add(_0x563528['result']['message']);}})[_0x0686('0x12')](function(_0x18637e){logger['error'](_0x0686('0xb'),_0x2b1428,_0x18637e);_0x42ca72(_0x18637e);});});} \ No newline at end of file +var _0x7448=['message','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','catch','util','moment','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c3978,_0xbfd82d){var _0x31bfee=function(_0x336c34){while(--_0x336c34){_0x3c3978['push'](_0x3c3978['shift']());}};_0x31bfee(++_0xbfd82d);}(_0x7448,0x7b));var _0x8744=function(_0x2aead8,_0x13bd4a){_0x2aead8=_0x2aead8-0x0;var _0x291f35=_0x7448[_0x2aead8];return _0x291f35;};'use strict';var _=require('lodash');var util=require(_0x8744('0x0'));var moment=require(_0x8744('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8744('0x2'));var logger=require(_0x8744('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8744('0x4'));var client=jayson['client'][_0x8744('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2a39a4,_0x49a619,_0x1869cb){return new BPromise(function(_0xa06c98,_0x401e35){return client[_0x8744('0x6')](_0x2a39a4,_0x1869cb)['then'](function(_0xfc32fb){logger[_0x8744('0x7')]('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,'request\x20sent');logger[_0x8744('0x8')](_0x8744('0x9'),_0x49a619,'request\x20sent',JSON[_0x8744('0xa')](_0xfc32fb));if(_0xfc32fb['error']){if(_0xfc32fb[_0x8744('0xb')][_0x8744('0xc')]===0x1f4){logger[_0x8744('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);return _0x401e35(_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);}logger['error'](_0x8744('0xe'),_0x49a619,_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);return _0xa06c98(_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);}else{logger[_0x8744('0x7')](_0x8744('0xe'),_0x49a619,_0x8744('0xf'));_0xa06c98(_0xfc32fb['result'][_0x8744('0xd')]);}})[_0x8744('0x10')](function(_0x44fb9c){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,_0x44fb9c);_0x401e35(_0x44fb9c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 1590b15..3252c4e 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(_0x23a580,_0x21f094){var _0x574f1d=function(_0x2af19b){while(--_0x2af19b){_0x23a580['push'](_0x23a580['shift']());}};_0x574f1d(++_0x21f094);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x193a6e,_0x45dd00){var _0x599a9b=function(_0x37a9e2){while(--_0x37a9e2){_0x193a6e['push'](_0x193a6e['shift']());}};_0x599a9b(++_0x45dd00);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8174ecb..ec9d658 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 _0xe288=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x431230,_0x303f6a){var _0x435ee1=function(_0x2d8c7f){while(--_0x2d8c7f){_0x431230['push'](_0x431230['shift']());}};_0x435ee1(++_0x303f6a);}(_0xe288,0x104));var _0x8e28=function(_0x35213d,_0x5a5f7b){_0x35213d=_0x35213d-0x0;var _0x4559eb=_0xe288[_0x35213d];return _0x4559eb;};'use strict';var Sequelize=require(_0x8e28('0x0'));module[_0x8e28('0x1')]={'uniqueid':{'type':Sequelize[_0x8e28('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8e28('0x3')},'membername':{'type':Sequelize[_0x8e28('0x4')],'allowNull':![],'comment':_0x8e28('0x3')},'UserId':{'type':Sequelize[_0x8e28('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8e28('0x4')],'allowNull':![],'unique':_0x8e28('0x5'),'comment':_0x8e28('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x8e28('0x4')],'allowNull':![],'unique':_0x8e28('0x5'),'comment':_0x8e28('0x3')},'penalty':{'type':Sequelize[_0x8e28('0x2')](0xb),'defaultValue':0x0,'comment':_0x8e28('0x3')},'paused':{'type':Sequelize[_0x8e28('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xe4bd=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x45e4fc,_0x514e62){var _0x593204=function(_0x4e2d70){while(--_0x4e2d70){_0x45e4fc['push'](_0x45e4fc['shift']());}};_0x593204(++_0x514e62);}(_0xe4bd,0x89));var _0xde4b=function(_0x408963,_0x38dd19){_0x408963=_0x408963-0x0;var _0x3162e2=_0xe4bd[_0x408963];return _0x3162e2;};'use strict';var Sequelize=require(_0xde4b('0x0'));module[_0xde4b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xde4b('0x2')},'membername':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xde4b('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde4b('0x5'),'comment':_0xde4b('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xde4b('0x2')},'paused':{'type':Sequelize[_0xde4b('0x4')](0xb),'defaultValue':0x0,'comment':_0xde4b('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9777b55..b51f5f2 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 _0x6ed3=['../../mysqldb','UserVoiceQueueRt','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x48073d,_0x52f81d){var _0x1aaea2=function(_0x51bc72){while(--_0x51bc72){_0x48073d['push'](_0x48073d['shift']());}};_0x1aaea2(++_0x52f81d);}(_0x6ed3,0xdf));var _0x36ed=function(_0x2ed3a2,_0x5cc62a){_0x2ed3a2=_0x2ed3a2-0x0;var _0xf11bbc=_0x6ed3[_0x2ed3a2];return _0xf11bbc;};'use strict';var EventEmitter=require(_0x36ed('0x0'));var UserVoiceQueueRt=require(_0x36ed('0x1'))['db'][_0x36ed('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x36ed('0x3')};function emitEvent(_0x24e2ca){return function(_0xd6b267,_0x48feb0,_0x15a7f9){UserVoiceQueueRtEvents[_0x36ed('0x4')](_0x24e2ca+':'+_0xd6b267['id'],_0xd6b267);UserVoiceQueueRtEvents[_0x36ed('0x4')](_0x24e2ca,_0xd6b267);_0x15a7f9(null);};}for(var e in events){if(events[_0x36ed('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x36ed('0x6')](e,emitEvent(event));}}module[_0x36ed('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xe347=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3fa787,_0x42e177){var _0x38aebe=function(_0x490b12){while(--_0x490b12){_0x3fa787['push'](_0x3fa787['shift']());}};_0x38aebe(++_0x42e177);}(_0xe347,0x1a0));var _0x7e34=function(_0x560485,_0x244601){_0x560485=_0x560485-0x0;var _0x3e7f69=_0xe347[_0x560485];return _0x3e7f69;};'use strict';var EventEmitter=require(_0x7e34('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7e34('0x1')](0x0);var events={'afterCreate':_0x7e34('0x2'),'afterUpdate':_0x7e34('0x3'),'afterDestroy':'remove'};function emitEvent(_0x59254f){return function(_0x38d949,_0x3cd627,_0x761ab4){UserVoiceQueueRtEvents[_0x7e34('0x4')](_0x59254f+':'+_0x38d949['id'],_0x38d949);UserVoiceQueueRtEvents[_0x7e34('0x4')](_0x59254f,_0x38d949);_0x761ab4(null);};}for(var e in events){if(events[_0x7e34('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x7e34('0x6')](e,emitEvent(event));}}module[_0x7e34('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index e490af6..5feb13b 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 _0xf8a0=['bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf8a0,0x74));var _0x0f8a=function(_0x2f3ca5,_0x3ba4ac){_0x2f3ca5=_0x2f3ca5-0x0;var _0x11cc85=_0xf8a0[_0x2f3ca5];return _0x11cc85;};'use strict';var _=require('lodash');var util=require(_0x0f8a('0x0'));var logger=require(_0x0f8a('0x1'))(_0x0f8a('0x2'));var moment=require(_0x0f8a('0x3'));var BPromise=require(_0x0f8a('0x4'));var rp=require(_0x0f8a('0x5'));var fs=require('fs');var path=require(_0x0f8a('0x6'));var rimraf=require('rimraf');var config=require(_0x0f8a('0x7'));var attributes=require(_0x0f8a('0x8'));module['exports']=function(_0x24899b,_0x3f4e65){return _0x24899b[_0x0f8a('0x9')](_0x0f8a('0xa'),attributes,{'tableName':_0x0f8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52f4=['UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x32c5bc,_0x2afe0c){var _0x8c5cf6=function(_0xc89ba8){while(--_0xc89ba8){_0x32c5bc['push'](_0x32c5bc['shift']());}};_0x8c5cf6(++_0x2afe0c);}(_0x52f4,0x1b2));var _0x452f=function(_0x270157,_0x49598e){_0x270157=_0x270157-0x0;var _0x4323cf=_0x52f4[_0x270157];return _0x4323cf;};'use strict';var _=require('lodash');var util=require(_0x452f('0x0'));var logger=require(_0x452f('0x1'))('api');var moment=require(_0x452f('0x2'));var BPromise=require(_0x452f('0x3'));var rp=require(_0x452f('0x4'));var fs=require('fs');var path=require(_0x452f('0x5'));var rimraf=require('rimraf');var config=require(_0x452f('0x6'));var attributes=require(_0x452f('0x7'));module[_0x452f('0x8')]=function(_0x3e4737,_0x481f2e){return _0x3e4737[_0x452f('0x9')](_0x452f('0xa'),attributes,{'tableName':_0x452f('0xb'),'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 c00ad02..0122f04 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 _0x27e1=['info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','request','then'];(function(_0x472386,_0x3c6cfe){var _0x44f57a=function(_0x54c08d){while(--_0x54c08d){_0x472386['push'](_0x472386['shift']());}};_0x44f57a(++_0x3c6cfe);}(_0x27e1,0xcd));var _0x127e=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x27e1[_0xd578cb];return _0x775533;};'use strict';var _=require(_0x127e('0x0'));var util=require(_0x127e('0x1'));var moment=require(_0x127e('0x2'));var BPromise=require(_0x127e('0x3'));var rs=require(_0x127e('0x4'));var fs=require('fs');var Redis=require(_0x127e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x127e('0x6'));var logger=require(_0x127e('0x7'))('rpc');var config=require(_0x127e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x127e('0x9')][_0x127e('0xa')]({'port':0x232a});config[_0x127e('0xb')]=_[_0x127e('0xc')](config[_0x127e('0xb')],{'host':_0x127e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x127e('0xe'))['register'](socket);function respondWithRpcPromise(_0xabb1ca,_0x16a7b0,_0x4f385a){return new BPromise(function(_0x2a1787,_0x4dfef7){return client[_0x127e('0xf')](_0xabb1ca,_0x4f385a)[_0x127e('0x10')](function(_0x2d72ce){logger[_0x127e('0x11')](_0x127e('0x12'),_0x16a7b0,_0x127e('0x13'));logger[_0x127e('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x16a7b0,_0x127e('0x13'),JSON['stringify'](_0x2d72ce));if(_0x2d72ce[_0x127e('0x15')]){if(_0x2d72ce[_0x127e('0x15')][_0x127e('0x16')]===0x1f4){logger[_0x127e('0x15')](_0x127e('0x12'),_0x16a7b0,_0x2d72ce['error'][_0x127e('0x17')]);return _0x4dfef7(_0x2d72ce[_0x127e('0x15')][_0x127e('0x17')]);}logger[_0x127e('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x16a7b0,_0x2d72ce[_0x127e('0x15')]['message']);return _0x2a1787(_0x2d72ce['error'][_0x127e('0x17')]);}else{logger[_0x127e('0x11')](_0x127e('0x12'),_0x16a7b0,'request\x20sent');_0x2a1787(_0x2d72ce[_0x127e('0x18')][_0x127e('0x17')]);}})[_0x127e('0x19')](function(_0x36cdd0){logger['error'](_0x127e('0x12'),_0x16a7b0,_0x36cdd0);_0x4dfef7(_0x36cdd0);});});}exports['GetVoiceQueueRtPauses']=function(_0x466b0b){var _0x103772=this;return new Promise(function(_0x20a267,_0x42765d){return db[_0x127e('0x1a')][_0x127e('0x1b')]({'raw':_0x466b0b[_0x127e('0x1c')]?_0x466b0b[_0x127e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x466b0b[_0x127e('0x1c')]?_0x466b0b[_0x127e('0x1c')][_0x127e('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x127e('0x1e'),db[_0x127e('0x1f')]['fn']('IF',db[_0x127e('0x1f')][_0x127e('0x20')](_0x127e('0x21')))),_0x127e('0x22')]]})[_0x127e('0x10')](function(_0x542293){logger['info'](_0x127e('0x23'),_0x466b0b);logger[_0x127e('0x14')](_0x127e('0x23'),_0x466b0b,JSON[_0x127e('0x24')](_0x542293));_0x20a267(_0x542293);})[_0x127e('0x19')](function(_0x57566b){logger['error'](_0x127e('0x23'),_0x57566b[_0x127e('0x17')],_0x466b0b);_0x42765d(_0x103772[_0x127e('0x15')](0x1f4,_0x57566b[_0x127e('0x17')]));});});}; \ No newline at end of file +var _0x1085=['GetVoiceQueueRtPauses','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x293fd,_0x32d447){var _0x5329bb=function(_0x204352){while(--_0x204352){_0x293fd['push'](_0x293fd['shift']());}};_0x5329bb(++_0x32d447);}(_0x1085,0x131));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5108('0x0'));var moment=require(_0x5108('0x1'));var BPromise=require(_0x5108('0x2'));var rs=require(_0x5108('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5108('0x4'))['db'];var utils=require(_0x5108('0x5'));var logger=require(_0x5108('0x6'))(_0x5108('0x7'));var config=require(_0x5108('0x8'));var jayson=require(_0x5108('0x9'));var client=jayson[_0x5108('0xa')][_0x5108('0xb')]({'port':0x232a});config[_0x5108('0xc')]=_['defaults'](config[_0x5108('0xc')],{'host':_0x5108('0xd'),'port':0x18eb});var socket=require(_0x5108('0xe'))(new Redis(config[_0x5108('0xc')]));require(_0x5108('0xf'))[_0x5108('0x10')](socket);function respondWithRpcPromise(_0x3c1da9,_0x2726ba,_0x5082cf){return new BPromise(function(_0x58d945,_0x5b5ba1){return client[_0x5108('0x11')](_0x3c1da9,_0x5082cf)[_0x5108('0x12')](function(_0x2d4bf2){logger['info'](_0x5108('0x13'),_0x2726ba,_0x5108('0x14'));logger[_0x5108('0x15')](_0x5108('0x16'),_0x2726ba,_0x5108('0x14'),JSON[_0x5108('0x17')](_0x2d4bf2));if(_0x2d4bf2[_0x5108('0x18')]){if(_0x2d4bf2[_0x5108('0x18')]['code']===0x1f4){logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);return _0x5b5ba1(_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);}logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x2d4bf2['error'][_0x5108('0x19')]);return _0x58d945(_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);}else{logger[_0x5108('0x1a')](_0x5108('0x13'),_0x2726ba,_0x5108('0x14'));_0x58d945(_0x2d4bf2[_0x5108('0x1b')][_0x5108('0x19')]);}})[_0x5108('0x1c')](function(_0x29e791){logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x29e791);_0x5b5ba1(_0x29e791);});});}exports['GetVoiceQueueRtPauses']=function(_0xc665ef){var _0x3fd698=this;return new Promise(function(_0x33dcd4,_0x28714d){return db['UserVoiceQueueRt'][_0x5108('0x1d')]({'raw':_0xc665ef['options']?_0xc665ef[_0x5108('0x1e')][_0x5108('0x1f')]===undefined?!![]:![]:!![],'where':_0xc665ef['options']?_0xc665ef['options'][_0x5108('0x20')]||null:null,'attributes':[[db[_0x5108('0x21')]['fn'](_0x5108('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x5108('0x23')](_0x5108('0x24')))),'outboundQueuePauses']]})[_0x5108('0x12')](function(_0x597e95){logger[_0x5108('0x1a')]('GetVoiceQueueRtPauses',_0xc665ef);logger[_0x5108('0x15')](_0x5108('0x25'),_0xc665ef,JSON[_0x5108('0x17')](_0x597e95));_0x33dcd4(_0x597e95);})[_0x5108('0x1c')](function(_0x2f2558){logger[_0x5108('0x18')]('GetVoiceQueueRtPauses',_0x2f2558[_0x5108('0x19')],_0xc665ef);_0x28714d(_0x3fd698[_0x5108('0x18')](0x1f4,_0x2f2558[_0x5108('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d7a577d..c4b4a59 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 _0x4c60=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','removeListener','register','length'];(function(_0x2ee939,_0x4cb75e){var _0x296eb4=function(_0x2376fc){while(--_0x2376fc){_0x2ee939['push'](_0x2ee939['shift']());}};_0x296eb4(++_0x4cb75e);}(_0x4c60,0xc1));var _0x04c6=function(_0xea7242,_0xab51f8){_0xea7242=_0xea7242-0x0;var _0x3ee2e4=_0x4c60[_0xea7242];return _0x3ee2e4;};'use strict';var UserVoiceQueueRtEvents=require(_0x04c6('0x0'));var events=[_0x04c6('0x1'),_0x04c6('0x2'),_0x04c6('0x3')];function createListener(_0x5ba768,_0x2a1d36){return function(_0x5d9fa3){_0x2a1d36['emit'](_0x5ba768,_0x5d9fa3);};}function removeListener(_0x4ad4f1,_0x53ca7a){return function(){UserVoiceQueueRtEvents[_0x04c6('0x4')](_0x4ad4f1,_0x53ca7a);};}exports[_0x04c6('0x5')]=function(_0x2054da){for(var _0x12bd5d=0x0,_0x2b9041=events[_0x04c6('0x6')];_0x12bd5d<_0x2b9041;_0x12bd5d++){var _0x8f9b13=events[_0x12bd5d];var _0x530a48=createListener(_0x04c6('0x7')+_0x8f9b13,_0x2054da);UserVoiceQueueRtEvents['on'](_0x8f9b13,_0x530a48);}}; \ No newline at end of file +var _0xa786=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener','register','length'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0xa786,0x71));var _0x6a78=function(_0x49cdfa,_0x5441bd){_0x49cdfa=_0x49cdfa-0x0;var _0x568128=_0xa786[_0x49cdfa];return _0x568128;};'use strict';var UserVoiceQueueRtEvents=require(_0x6a78('0x0'));var events=[_0x6a78('0x1'),_0x6a78('0x2'),'update'];function createListener(_0x30bd42,_0x49c803){return function(_0x5edaa9){_0x49c803[_0x6a78('0x3')](_0x30bd42,_0x5edaa9);};}function removeListener(_0x2b0fed,_0x3b3608){return function(){UserVoiceQueueRtEvents[_0x6a78('0x4')](_0x2b0fed,_0x3b3608);};}exports[_0x6a78('0x5')]=function(_0x112e35){for(var _0x386861=0x0,_0x4dd11b=events[_0x6a78('0x6')];_0x386861<_0x4dd11b;_0x386861++){var _0x103f4a=events[_0x386861];var _0x23ebbd=createListener(_0x6a78('0x7')+_0x103f4a,_0x112e35);UserVoiceQueueRtEvents['on'](_0x103f4a,_0x23ebbd);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 007c975..73146b2 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x44d4db,_0x5a1467){var _0x514651=function(_0x420aa7){while(--_0x420aa7){_0x44d4db['push'](_0x44d4db['shift']());}};_0x514651(++_0x5a1467);}(_0x70e0,0x17b));var _0x070e=function(_0x2b28cf,_0x1a5947){_0x2b28cf=_0x2b28cf-0x0;var _0x46468b=_0x70e0[_0x2b28cf];return _0x46468b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ddc8c61..30262b0 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 _0x3a83=['exports'];(function(_0x382353,_0x1ece1e){var _0xf42fa9=function(_0x399b28){while(--_0x399b28){_0x382353['push'](_0x382353['shift']());}};_0xf42fa9(++_0x1ece1e);}(_0x3a83,0x7f));var _0x33a8=function(_0x1bf432,_0x2637b9){_0x1bf432=_0x1bf432-0x0;var _0x10e9c6=_0x3a83[_0x1bf432];return _0x10e9c6;};'use strict';var Sequelize=require('sequelize');module[_0x33a8('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeff9=['sequelize'];(function(_0x515be2,_0x51b3ff){var _0x514679=function(_0x562c51){while(--_0x562c51){_0x515be2['push'](_0x515be2['shift']());}};_0x514679(++_0x51b3ff);}(_0xeff9,0x9c));var _0x9eff=function(_0x425c30,_0x4c6c0a){_0x425c30=_0x425c30-0x0;var _0x5a2ef6=_0xeff9[_0x425c30];return _0x5a2ef6;};'use strict';var Sequelize=require(_0x9eff('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 050d606..c529947 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 _0xbc8c=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x598aaf,_0xb2b2c1){var _0x592139=function(_0x4eab4e){while(--_0x4eab4e){_0x598aaf['push'](_0x598aaf['shift']());}};_0x592139(++_0xb2b2c1);}(_0xbc8c,0x144));var _0xcbc8=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xbc8c[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0xcbc8('0x0'));var util=require('util');var logger=require(_0xcbc8('0x1'))(_0xcbc8('0x2'));var moment=require(_0xcbc8('0x3'));var BPromise=require(_0xcbc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbc8('0x5'));var rimraf=require(_0xcbc8('0x6'));var config=require(_0xcbc8('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xcbc8('0x8')]=function(_0x53dc87,_0xc9e31b){return _0x53dc87[_0xcbc8('0x9')](_0xcbc8('0xa'),attributes,{'tableName':_0xcbc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20db=['api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','user_has_whatsapp_queues','lodash'];(function(_0x4da733,_0x498bfe){var _0x29c9b9=function(_0x3e12b5){while(--_0x3e12b5){_0x4da733['push'](_0x4da733['shift']());}};_0x29c9b9(++_0x498bfe);}(_0x20db,0x6b));var _0xb20d=function(_0x476918,_0x2ce58b){_0x476918=_0x476918-0x0;var _0x45472c=_0x20db[_0x476918];return _0x45472c;};'use strict';var _=require(_0xb20d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb20d('0x1'));var moment=require(_0xb20d('0x2'));var BPromise=require(_0xb20d('0x3'));var rp=require(_0xb20d('0x4'));var fs=require('fs');var path=require(_0xb20d('0x5'));var rimraf=require('rimraf');var config=require(_0xb20d('0x6'));var attributes=require(_0xb20d('0x7'));module['exports']=function(_0x59265b,_0x4ae546){return _0x59265b['define']('UserWhatsappQueue',attributes,{'tableName':_0xb20d('0x8'),'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 38c002f..e96ba87 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 _0x9463=['error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24696b,_0x12de19){var _0x3f86b0=function(_0x11f2eb){while(--_0x11f2eb){_0x24696b['push'](_0x24696b['shift']());}};_0x3f86b0(++_0x12de19);}(_0x9463,0x76));var _0x3946=function(_0x583e2a,_0xa8310f){_0x583e2a=_0x583e2a-0x0;var _0x3d8cb9=_0x9463[_0x583e2a];return _0x3d8cb9;};'use strict';var _=require(_0x3946('0x0'));var util=require(_0x3946('0x1'));var moment=require('moment');var BPromise=require(_0x3946('0x2'));var rs=require(_0x3946('0x3'));var fs=require('fs');var Redis=require(_0x3946('0x4'));var db=require(_0x3946('0x5'))['db'];var utils=require(_0x3946('0x6'));var logger=require(_0x3946('0x7'))(_0x3946('0x8'));var config=require('../../config/environment');var jayson=require(_0x3946('0x9'));var client=jayson[_0x3946('0xa')][_0x3946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d3052,_0x24b14e,_0xdba4d2){return new BPromise(function(_0x33c46b,_0x58dbcd){return client[_0x3946('0xc')](_0x3d3052,_0xdba4d2)[_0x3946('0xd')](function(_0x460a24){logger[_0x3946('0xe')](_0x3946('0xf'),_0x24b14e,_0x3946('0x10'));logger[_0x3946('0x11')](_0x3946('0x12'),_0x24b14e,'request\x20sent',JSON[_0x3946('0x13')](_0x460a24));if(_0x460a24[_0x3946('0x14')]){if(_0x460a24[_0x3946('0x14')][_0x3946('0x15')]===0x1f4){logger[_0x3946('0x14')](_0x3946('0xf'),_0x24b14e,_0x460a24['error']['message']);return _0x58dbcd(_0x460a24[_0x3946('0x14')]['message']);}logger[_0x3946('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x24b14e,_0x460a24[_0x3946('0x14')][_0x3946('0x16')]);return _0x33c46b(_0x460a24[_0x3946('0x14')][_0x3946('0x16')]);}else{logger['info'](_0x3946('0xf'),_0x24b14e,_0x3946('0x10'));_0x33c46b(_0x460a24['result'][_0x3946('0x16')]);}})['catch'](function(_0x3056c2){logger[_0x3946('0x14')](_0x3946('0xf'),_0x24b14e,_0x3056c2);_0x58dbcd(_0x3056c2);});});} \ No newline at end of file +var _0x9025=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x40adf5,_0x341a98){var _0x249f13=function(_0x39baa0){while(--_0x39baa0){_0x40adf5['push'](_0x40adf5['shift']());}};_0x249f13(++_0x341a98);}(_0x9025,0x1c8));var _0x5902=function(_0x1b61ec,_0xd28837){_0x1b61ec=_0x1b61ec-0x0;var _0x997d8a=_0x9025[_0x1b61ec];return _0x997d8a;};'use strict';var _=require(_0x5902('0x0'));var util=require(_0x5902('0x1'));var moment=require(_0x5902('0x2'));var BPromise=require(_0x5902('0x3'));var rs=require(_0x5902('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5902('0x5'))['db'];var utils=require(_0x5902('0x6'));var logger=require(_0x5902('0x7'))('rpc');var config=require(_0x5902('0x8'));var jayson=require(_0x5902('0x9'));var client=jayson[_0x5902('0xa')][_0x5902('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219036,_0x4ec8e3,_0x2bbdc8){return new BPromise(function(_0x52e2f7,_0x549dfb){return client[_0x5902('0xc')](_0x219036,_0x2bbdc8)[_0x5902('0xd')](function(_0x2d5b7d){logger['info'](_0x5902('0xe'),_0x4ec8e3,_0x5902('0xf'));logger[_0x5902('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4ec8e3,_0x5902('0xf'),JSON[_0x5902('0x11')](_0x2d5b7d));if(_0x2d5b7d[_0x5902('0x12')]){if(_0x2d5b7d[_0x5902('0x12')][_0x5902('0x13')]===0x1f4){logger[_0x5902('0x12')](_0x5902('0xe'),_0x4ec8e3,_0x2d5b7d[_0x5902('0x12')]['message']);return _0x549dfb(_0x2d5b7d[_0x5902('0x12')][_0x5902('0x14')]);}logger[_0x5902('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ec8e3,_0x2d5b7d[_0x5902('0x12')]['message']);return _0x52e2f7(_0x2d5b7d['error']['message']);}else{logger[_0x5902('0x15')](_0x5902('0xe'),_0x4ec8e3,'request\x20sent');_0x52e2f7(_0x2d5b7d[_0x5902('0x16')]['message']);}})[_0x5902('0x17')](function(_0x1a663d){logger[_0x5902('0x12')](_0x5902('0xe'),_0x4ec8e3,_0x1a663d);_0x549dfb(_0x1a663d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 60c763f..ab33ce6 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 _0x818f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1a69e4,_0x122eb4){var _0x4ae79e=function(_0x47f391){while(--_0x47f391){_0x1a69e4['push'](_0x1a69e4['shift']());}};_0x4ae79e(++_0x122eb4);}(_0x818f,0x1da));var _0xf818=function(_0x39e29e,_0x59aabb){_0x39e29e=_0x39e29e-0x0;var _0x12ad4c=_0x818f[_0x39e29e];return _0x12ad4c;};'use strict';var multer=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var path=require(_0xf818('0x2'));var timeout=require(_0xf818('0x3'));var express=require(_0xf818('0x4'));var router=express[_0xf818('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf818('0x6'));var interaction=require(_0xf818('0x7'));var config=require(_0xf818('0x8'));var controller=require(_0xf818('0x9'));router[_0xf818('0xa')]('/',auth[_0xf818('0xb')](),controller[_0xf818('0xc')]);router[_0xf818('0xa')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0xe')]);router[_0xf818('0xf')]('/',auth[_0xf818('0xb')](),controller['create']);router['put'](_0xf818('0xd'),auth[_0xf818('0xb')](),controller[_0xf818('0x10')]);router[_0xf818('0x11')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0x12')]);module[_0xf818('0x13')]=router; \ No newline at end of file +var _0xb332=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x5a4670,_0x26110d){var _0x332b26=function(_0xaf9f30){while(--_0xaf9f30){_0x5a4670['push'](_0x5a4670['shift']());}};_0x332b26(++_0x26110d);}(_0xb332,0xd9));var _0x2b33=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xb332[_0x183256];return _0x5394a2;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./variable.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2b33('0x9')]);router['post']('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0xa')]);router[_0x2b33('0xb')](_0x2b33('0xc'),auth['isAuthenticated'](),controller[_0x2b33('0xd')]);router[_0x2b33('0xe')](_0x2b33('0xc'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xf')]);module[_0x2b33('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 9721107..8b119bb 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 _0x47cf=['STRING','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x47cf,0x189));var _0xf47c=function(_0x5a132f,_0x3556a1){_0x5a132f=_0x5a132f-0x0;var _0x33f069=_0x47cf[_0x5a132f];return _0x33f069;};'use strict';var Sequelize=require('sequelize');module[_0xf47c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf47c('0x1')]}}; \ No newline at end of file +var _0x7412=['STRING','sequelize','exports'];(function(_0x2d8e1e,_0x50ab38){var _0x534e88=function(_0x36ed7a){while(--_0x36ed7a){_0x2d8e1e['push'](_0x2d8e1e['shift']());}};_0x534e88(++_0x50ab38);}(_0x7412,0x73));var _0x2741=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x7412[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0x2741('0x0'));module[_0x2741('0x1')]={'name':{'type':Sequelize[_0x2741('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2741('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9bb5fc7..4d21713 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 _0xfea1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','map','Variable','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x2de7da,_0xf83c1f){var _0x69a360=function(_0xe9806c){while(--_0xe9806c){_0x2de7da['push'](_0x2de7da['shift']());}};_0x69a360(++_0xf83c1f);}(_0xfea1,0x1df));var _0x1fea=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xfea1[_0x36bf88];return _0x332914;};'use strict';var emlformat=require(_0x1fea('0x0'));var rimraf=require(_0x1fea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fea('0x2'));var rp=require(_0x1fea('0x3'));var moment=require(_0x1fea('0x4'));var BPromise=require(_0x1fea('0x5'));var Mustache=require('mustache');var util=require(_0x1fea('0x6'));var path=require(_0x1fea('0x7'));var sox=require(_0x1fea('0x8'));var csv=require(_0x1fea('0x9'));var ejs=require(_0x1fea('0xa'));var fs=require('fs');var fs_extra=require(_0x1fea('0xb'));var _=require(_0x1fea('0xc'));var squel=require('squel');var crypto=require(_0x1fea('0xd'));var jsforce=require(_0x1fea('0xe'));var deskjs=require(_0x1fea('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1fea('0x10'));var Papa=require('papaparse');var Redis=require(_0x1fea('0x11'));var authService=require(_0x1fea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1fea('0x13'));var hardwareService=require(_0x1fea('0x14'));var logger=require(_0x1fea('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1fea('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fea('0x17'))['db'];function respondWithStatusCode(_0xafc37c,_0x4b28ca){_0x4b28ca=_0x4b28ca||0xcc;return function(_0x395b0c){if(_0x395b0c){return _0xafc37c['sendStatus'](_0x4b28ca);}return _0xafc37c['status'](_0x4b28ca)[_0x1fea('0x18')]();};}function respondWithResult(_0x5b9c20,_0x4f97c6){_0x4f97c6=_0x4f97c6||0xc8;return function(_0x1c8c02){if(_0x1c8c02){return _0x5b9c20[_0x1fea('0x19')](_0x4f97c6)[_0x1fea('0x1a')](_0x1c8c02);}};}function respondWithFilteredResult(_0x2b150e,_0x1ad95b){return function(_0x97b6d9){if(_0x97b6d9){var _0x126f1c=typeof _0x1ad95b[_0x1fea('0x1b')]===_0x1fea('0x1c')&&typeof _0x1ad95b[_0x1fea('0x1d')]==='undefined';var _0x5d9ac0=_0x97b6d9[_0x1fea('0x1e')];var _0x22b3d9=_0x126f1c?0x0:_0x1ad95b['offset'];var _0x3ba086=_0x126f1c?_0x97b6d9[_0x1fea('0x1e')]:_0x1ad95b['offset']+_0x1ad95b['limit'];var _0x2cc632;if(_0x3ba086>=_0x5d9ac0){_0x3ba086=_0x5d9ac0;_0x2cc632=0xc8;}else{_0x2cc632=0xce;}_0x2b150e[_0x1fea('0x19')](_0x2cc632);return _0x2b150e[_0x1fea('0x1f')](_0x1fea('0x20'),_0x22b3d9+'-'+_0x3ba086+'/'+_0x5d9ac0)['json'](_0x97b6d9);}return null;};}function patchUpdates(_0x5b1512){return function(_0x16df75){try{jsonpatch['apply'](_0x16df75,_0x5b1512,!![]);}catch(_0x1fe1ee){return BPromise['reject'](_0x1fe1ee);}return _0x16df75[_0x1fea('0x21')]();};}function saveUpdates(_0x485fe3,_0x2b9292){return function(_0x4f6873){if(_0x4f6873){return _0x4f6873['update'](_0x485fe3)[_0x1fea('0x22')](function(_0x28beb0){return _0x28beb0;});}return null;};}function removeEntity(_0x1186af,_0x4557e6){return function(_0x3e05a6){if(_0x3e05a6){return _0x3e05a6[_0x1fea('0x23')]()[_0x1fea('0x22')](function(){var _0x2740a3=_0x3e05a6[_0x1fea('0x24')]({'plain':!![]});var _0x457e4f=_0x1fea('0x25');return db[_0x1fea('0x26')][_0x1fea('0x23')]({'where':{'type':_0x457e4f,'resourceId':_0x2740a3['id']}})[_0x1fea('0x22')](function(){return _0x3e05a6;});})[_0x1fea('0x22')](function(){_0x1186af[_0x1fea('0x19')](0xcc)[_0x1fea('0x18')]();});}};}function handleEntityNotFound(_0x362d98,_0x33174e){return function(_0x14da24){if(!_0x14da24){_0x362d98[_0x1fea('0x27')](0x194);}return _0x14da24;};}function handleError(_0x12fa5b,_0xa481a0){_0xa481a0=_0xa481a0||0x1f4;return function(_0x279992){logger[_0x1fea('0x28')](_0x279992[_0x1fea('0x29')]);if(_0x279992[_0x1fea('0x2a')]){delete _0x279992[_0x1fea('0x2a')];}_0x12fa5b[_0x1fea('0x19')](_0xa481a0)['send'](_0x279992);};}exports['index']=function(_0x5bdc56,_0x3db7ad){var _0x92d9e5={},_0x1bfc8a={},_0x544d84={'count':0x0,'rows':[]};var _0x49aba6=_[_0x1fea('0x2b')](db[_0x1fea('0x2c')][_0x1fea('0x2d')],function(_0x24570f){return{'name':_0x24570f['fieldName'],'type':_0x24570f[_0x1fea('0x2e')][_0x1fea('0x2f')]};});_0x1bfc8a[_0x1fea('0x30')]=_['map'](_0x49aba6,_0x1fea('0x2a'));_0x1bfc8a[_0x1fea('0x31')]=_[_0x1fea('0x32')](_0x5bdc56[_0x1fea('0x31')]);_0x1bfc8a['filters']=_[_0x1fea('0x33')](_0x1bfc8a[_0x1fea('0x30')],_0x1bfc8a[_0x1fea('0x31')]);_0x92d9e5[_0x1fea('0x34')]=_['intersection'](_0x1bfc8a[_0x1fea('0x30')],qs[_0x1fea('0x35')](_0x5bdc56['query'][_0x1fea('0x35')]));_0x92d9e5[_0x1fea('0x34')]=_0x92d9e5[_0x1fea('0x34')]['length']?_0x92d9e5[_0x1fea('0x34')]:_0x1bfc8a['model'];if(!_0x5bdc56[_0x1fea('0x31')][_0x1fea('0x36')](_0x1fea('0x37'))){_0x92d9e5['limit']=qs[_0x1fea('0x1d')](_0x5bdc56['query'][_0x1fea('0x1d')]);_0x92d9e5[_0x1fea('0x1b')]=qs[_0x1fea('0x1b')](_0x5bdc56[_0x1fea('0x31')][_0x1fea('0x1b')]);}_0x92d9e5['order']=qs[_0x1fea('0x38')](_0x5bdc56[_0x1fea('0x31')]['sort']);_0x92d9e5[_0x1fea('0x39')]=qs[_0x1fea('0x3a')](_[_0x1fea('0x3b')](_0x5bdc56[_0x1fea('0x31')],_0x1bfc8a['filters']),_0x49aba6);if(_0x5bdc56[_0x1fea('0x31')][_0x1fea('0x3c')]){_0x92d9e5['where']=_[_0x1fea('0x3d')](_0x92d9e5[_0x1fea('0x39')],{'$or':_['map'](_0x49aba6,function(_0x14b29f){if(_0x14b29f[_0x1fea('0x2e')]!==_0x1fea('0x3e')){var _0x45b4b7={};_0x45b4b7[_0x14b29f[_0x1fea('0x2a')]]={'$like':'%'+_0x5bdc56[_0x1fea('0x31')][_0x1fea('0x3c')]+'%'};return _0x45b4b7;}})});}_0x92d9e5=_[_0x1fea('0x3d')]({},_0x92d9e5,_0x5bdc56['options']);var _0x47747e={'where':_0x92d9e5['where']};return db[_0x1fea('0x2c')][_0x1fea('0x1e')](_0x47747e)['then'](function(_0x1e9085){_0x544d84['count']=_0x1e9085;if(_0x5bdc56['query'][_0x1fea('0x3f')]){_0x92d9e5[_0x1fea('0x40')]=[{'all':!![]}];}return db['Variable'][_0x1fea('0x41')](_0x92d9e5);})['then'](function(_0x246161){_0x544d84[_0x1fea('0x42')]=_0x246161;return _0x544d84;})[_0x1fea('0x22')](respondWithFilteredResult(_0x3db7ad,_0x92d9e5))[_0x1fea('0x43')](handleError(_0x3db7ad,null));};exports[_0x1fea('0x44')]=function(_0xd82607,_0x2f1432){var _0x569321={'raw':!![],'where':{'id':_0xd82607['params']['id']}},_0x31903f={};_0x31903f[_0x1fea('0x30')]=_['keys'](db[_0x1fea('0x2c')]['rawAttributes']);_0x31903f[_0x1fea('0x31')]=_[_0x1fea('0x32')](_0xd82607[_0x1fea('0x31')]);_0x31903f[_0x1fea('0x3a')]=_[_0x1fea('0x33')](_0x31903f[_0x1fea('0x30')],_0x31903f['query']);_0x569321['attributes']=_[_0x1fea('0x33')](_0x31903f[_0x1fea('0x30')],qs[_0x1fea('0x35')](_0xd82607[_0x1fea('0x31')][_0x1fea('0x35')]));_0x569321[_0x1fea('0x34')]=_0x569321['attributes'][_0x1fea('0x45')]?_0x569321[_0x1fea('0x34')]:_0x31903f[_0x1fea('0x30')];if(_0xd82607[_0x1fea('0x31')]['includeAll']){_0x569321[_0x1fea('0x40')]=[{'all':!![]}];}_0x569321=_[_0x1fea('0x3d')]({},_0x569321,_0xd82607[_0x1fea('0x46')]);return db[_0x1fea('0x2c')][_0x1fea('0x47')](_0x569321)['then'](handleEntityNotFound(_0x2f1432,null))[_0x1fea('0x22')](respondWithResult(_0x2f1432,null))[_0x1fea('0x43')](handleError(_0x2f1432,null));};exports[_0x1fea('0x48')]=function(_0x44cefb,_0x226a97){return db['Variable']['create'](_0x44cefb[_0x1fea('0x49')],{})['then'](function(_0x966dc0){var _0x58fc4e=_0x44cefb[_0x1fea('0x4a')]['get']({'plain':!![]});if(!_0x58fc4e)throw new Error(_0x1fea('0x4b'));if(_0x58fc4e[_0x1fea('0x4c')]===_0x1fea('0x4a')){var _0x23cd87=_0x966dc0[_0x1fea('0x24')]({'plain':!![]});var _0x524ace=_0x1fea('0x25');return db[_0x1fea('0x4d')]['find']({'where':{'name':_0x524ace,'userProfileId':_0x58fc4e[_0x1fea('0x4e')]},'raw':!![]})[_0x1fea('0x22')](function(_0xbf3d7e){if(_0xbf3d7e&&_0xbf3d7e[_0x1fea('0x4f')]===0x0){return db[_0x1fea('0x26')][_0x1fea('0x48')]({'name':_0x23cd87[_0x1fea('0x2a')],'resourceId':_0x23cd87['id'],'type':_0xbf3d7e[_0x1fea('0x2a')],'sectionId':_0xbf3d7e['id']},{})['then'](function(){return _0x966dc0;});}else{return _0x966dc0;}})[_0x1fea('0x43')](function(_0x10d51a){logger[_0x1fea('0x28')](_0x1fea('0x50'),_0x10d51a);throw _0x10d51a;});}return _0x966dc0;})[_0x1fea('0x22')](respondWithResult(_0x226a97,0xc9))[_0x1fea('0x43')](handleError(_0x226a97,null));};exports[_0x1fea('0x51')]=function(_0x599ad9,_0x5a7abd){if(_0x599ad9[_0x1fea('0x49')]['id']){delete _0x599ad9[_0x1fea('0x49')]['id'];}return db[_0x1fea('0x2c')][_0x1fea('0x47')]({'where':{'id':_0x599ad9[_0x1fea('0x52')]['id']}})[_0x1fea('0x22')](handleEntityNotFound(_0x5a7abd,null))[_0x1fea('0x22')](saveUpdates(_0x599ad9[_0x1fea('0x49')],null))[_0x1fea('0x22')](respondWithResult(_0x5a7abd,null))['catch'](handleError(_0x5a7abd,null));};exports['destroy']=function(_0x509b2f,_0x115082){return db[_0x1fea('0x2c')][_0x1fea('0x47')]({'where':{'id':_0x509b2f[_0x1fea('0x52')]['id']}})[_0x1fea('0x22')](handleEntityNotFound(_0x115082,null))['then'](removeEntity(_0x115082,null))[_0x1fea('0x43')](handleError(_0x115082,null));}; \ No newline at end of file +var _0x870f=['offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','Variable','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x870f,0xcf));var _0xf870=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x870f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf870('0x0'));var rimraf=require(_0xf870('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf870('0x2'));var rp=require(_0xf870('0x3'));var moment=require('moment');var BPromise=require(_0xf870('0x4'));var Mustache=require(_0xf870('0x5'));var util=require(_0xf870('0x6'));var path=require('path');var sox=require(_0xf870('0x7'));var csv=require(_0xf870('0x8'));var ejs=require(_0xf870('0x9'));var fs=require('fs');var fs_extra=require(_0xf870('0xa'));var _=require(_0xf870('0xb'));var squel=require('squel');var crypto=require(_0xf870('0xc'));var jsforce=require(_0xf870('0xd'));var deskjs=require(_0xf870('0xe'));var toCsv=require(_0xf870('0x8'));var querystring=require('querystring');var Papa=require(_0xf870('0xf'));var Redis=require(_0xf870('0x10'));var authService=require(_0xf870('0x11'));var qs=require(_0xf870('0x12'));var as=require(_0xf870('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf870('0x14'))(_0xf870('0x15'));var utils=require(_0xf870('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e6405,_0xeccbab){_0xeccbab=_0xeccbab||0xcc;return function(_0x2afe43){if(_0x2afe43){return _0x2e6405[_0xf870('0x17')](_0xeccbab);}return _0x2e6405['status'](_0xeccbab)[_0xf870('0x18')]();};}function respondWithResult(_0x4fb340,_0x1c06b3){_0x1c06b3=_0x1c06b3||0xc8;return function(_0x1937ed){if(_0x1937ed){return _0x4fb340[_0xf870('0x19')](_0x1c06b3)[_0xf870('0x1a')](_0x1937ed);}};}function respondWithFilteredResult(_0x1a2bab,_0xdfe1f1){return function(_0x441550){if(_0x441550){var _0x6ffd60=typeof _0xdfe1f1[_0xf870('0x1b')]===_0xf870('0x1c')&&typeof _0xdfe1f1['limit']===_0xf870('0x1c');var _0x4d9495=_0x441550[_0xf870('0x1d')];var _0x2d427d=_0x6ffd60?0x0:_0xdfe1f1[_0xf870('0x1b')];var _0x40274f=_0x6ffd60?_0x441550[_0xf870('0x1d')]:_0xdfe1f1[_0xf870('0x1b')]+_0xdfe1f1[_0xf870('0x1e')];var _0xb9234c;if(_0x40274f>=_0x4d9495){_0x40274f=_0x4d9495;_0xb9234c=0xc8;}else{_0xb9234c=0xce;}_0x1a2bab[_0xf870('0x19')](_0xb9234c);return _0x1a2bab['set'](_0xf870('0x1f'),_0x2d427d+'-'+_0x40274f+'/'+_0x4d9495)[_0xf870('0x1a')](_0x441550);}return null;};}function patchUpdates(_0x2af458){return function(_0x419c5e){try{jsonpatch[_0xf870('0x20')](_0x419c5e,_0x2af458,!![]);}catch(_0x2210c4){return BPromise[_0xf870('0x21')](_0x2210c4);}return _0x419c5e['save']();};}function saveUpdates(_0xe2ad3f,_0x58bae1){return function(_0x373117){if(_0x373117){return _0x373117['update'](_0xe2ad3f)[_0xf870('0x22')](function(_0x564cc8){return _0x564cc8;});}return null;};}function removeEntity(_0x36110b,_0x2cb569){return function(_0x3bcfc7){if(_0x3bcfc7){return _0x3bcfc7[_0xf870('0x23')]()[_0xf870('0x22')](function(){var _0x531d0d=_0x3bcfc7[_0xf870('0x24')]({'plain':!![]});var _0x1a94c1=_0xf870('0x25');return db[_0xf870('0x26')][_0xf870('0x23')]({'where':{'type':_0x1a94c1,'resourceId':_0x531d0d['id']}})[_0xf870('0x22')](function(){return _0x3bcfc7;});})[_0xf870('0x22')](function(){_0x36110b[_0xf870('0x19')](0xcc)[_0xf870('0x18')]();});}};}function handleEntityNotFound(_0x5aac14,_0xbf2193){return function(_0x18c876){if(!_0x18c876){_0x5aac14[_0xf870('0x17')](0x194);}return _0x18c876;};}function handleError(_0x24d3ff,_0x3a935d){_0x3a935d=_0x3a935d||0x1f4;return function(_0x544440){logger[_0xf870('0x27')](_0x544440[_0xf870('0x28')]);if(_0x544440[_0xf870('0x29')]){delete _0x544440[_0xf870('0x29')];}_0x24d3ff[_0xf870('0x19')](_0x3a935d)[_0xf870('0x2a')](_0x544440);};}exports[_0xf870('0x2b')]=function(_0x53e74a,_0x46d03b){var _0x2ff682={},_0x26b39e={},_0x4c74ca={'count':0x0,'rows':[]};var _0x57f6d2=_['map'](db[_0xf870('0x2c')][_0xf870('0x2d')],function(_0x147a60){return{'name':_0x147a60[_0xf870('0x2e')],'type':_0x147a60['type'][_0xf870('0x2f')]};});_0x26b39e[_0xf870('0x30')]=_[_0xf870('0x31')](_0x57f6d2,_0xf870('0x29'));_0x26b39e['query']=_[_0xf870('0x32')](_0x53e74a[_0xf870('0x33')]);_0x26b39e[_0xf870('0x34')]=_[_0xf870('0x35')](_0x26b39e['model'],_0x26b39e[_0xf870('0x33')]);_0x2ff682[_0xf870('0x36')]=_[_0xf870('0x35')](_0x26b39e[_0xf870('0x30')],qs[_0xf870('0x37')](_0x53e74a[_0xf870('0x33')]['fields']));_0x2ff682[_0xf870('0x36')]=_0x2ff682[_0xf870('0x36')][_0xf870('0x38')]?_0x2ff682[_0xf870('0x36')]:_0x26b39e[_0xf870('0x30')];if(!_0x53e74a[_0xf870('0x33')]['hasOwnProperty'](_0xf870('0x39'))){_0x2ff682[_0xf870('0x1e')]=qs[_0xf870('0x1e')](_0x53e74a['query'][_0xf870('0x1e')]);_0x2ff682['offset']=qs[_0xf870('0x1b')](_0x53e74a[_0xf870('0x33')][_0xf870('0x1b')]);}_0x2ff682['order']=qs[_0xf870('0x3a')](_0x53e74a[_0xf870('0x33')][_0xf870('0x3a')]);_0x2ff682[_0xf870('0x3b')]=qs[_0xf870('0x34')](_['pick'](_0x53e74a[_0xf870('0x33')],_0x26b39e['filters']),_0x57f6d2);if(_0x53e74a[_0xf870('0x33')][_0xf870('0x3c')]){_0x2ff682['where']=_[_0xf870('0x3d')](_0x2ff682[_0xf870('0x3b')],{'$or':_[_0xf870('0x31')](_0x57f6d2,function(_0x173806){if(_0x173806[_0xf870('0x3e')]!=='VIRTUAL'){var _0x36e144={};_0x36e144[_0x173806['name']]={'$like':'%'+_0x53e74a[_0xf870('0x33')][_0xf870('0x3c')]+'%'};return _0x36e144;}})});}_0x2ff682=_[_0xf870('0x3d')]({},_0x2ff682,_0x53e74a[_0xf870('0x3f')]);var _0x52e677={'where':_0x2ff682[_0xf870('0x3b')]};return db['Variable'][_0xf870('0x1d')](_0x52e677)[_0xf870('0x22')](function(_0x5d82c3){_0x4c74ca[_0xf870('0x1d')]=_0x5d82c3;if(_0x53e74a['query'][_0xf870('0x40')]){_0x2ff682[_0xf870('0x41')]=[{'all':!![]}];}return db[_0xf870('0x2c')][_0xf870('0x42')](_0x2ff682);})[_0xf870('0x22')](function(_0x3ba0e8){_0x4c74ca[_0xf870('0x43')]=_0x3ba0e8;return _0x4c74ca;})['then'](respondWithFilteredResult(_0x46d03b,_0x2ff682))[_0xf870('0x44')](handleError(_0x46d03b,null));};exports[_0xf870('0x45')]=function(_0x166141,_0x497840){var _0x38d029={'raw':!![],'where':{'id':_0x166141[_0xf870('0x46')]['id']}},_0x2ab829={};_0x2ab829['model']=_[_0xf870('0x32')](db[_0xf870('0x2c')]['rawAttributes']);_0x2ab829['query']=_[_0xf870('0x32')](_0x166141[_0xf870('0x33')]);_0x2ab829[_0xf870('0x34')]=_['intersection'](_0x2ab829['model'],_0x2ab829[_0xf870('0x33')]);_0x38d029[_0xf870('0x36')]=_[_0xf870('0x35')](_0x2ab829[_0xf870('0x30')],qs[_0xf870('0x37')](_0x166141['query']['fields']));_0x38d029[_0xf870('0x36')]=_0x38d029[_0xf870('0x36')][_0xf870('0x38')]?_0x38d029['attributes']:_0x2ab829['model'];if(_0x166141['query'][_0xf870('0x40')]){_0x38d029[_0xf870('0x41')]=[{'all':!![]}];}_0x38d029=_['merge']({},_0x38d029,_0x166141[_0xf870('0x3f')]);return db[_0xf870('0x2c')][_0xf870('0x47')](_0x38d029)[_0xf870('0x22')](handleEntityNotFound(_0x497840,null))['then'](respondWithResult(_0x497840,null))[_0xf870('0x44')](handleError(_0x497840,null));};exports[_0xf870('0x48')]=function(_0x2ea51c,_0x54ffac){return db[_0xf870('0x2c')][_0xf870('0x48')](_0x2ea51c[_0xf870('0x49')],{})[_0xf870('0x22')](function(_0x3727bb){var _0x1569b9=_0x2ea51c['user'][_0xf870('0x24')]({'plain':!![]});if(!_0x1569b9)throw new Error(_0xf870('0x4a'));if(_0x1569b9[_0xf870('0x4b')]==='user'){var _0xeef87b=_0x3727bb[_0xf870('0x24')]({'plain':!![]});var _0x19e7bf='Variables';return db['UserProfileSection']['find']({'where':{'name':_0x19e7bf,'userProfileId':_0x1569b9[_0xf870('0x4c')]},'raw':!![]})['then'](function(_0x482d75){if(_0x482d75&&_0x482d75[_0xf870('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0xeef87b[_0xf870('0x29')],'resourceId':_0xeef87b['id'],'type':_0x482d75['name'],'sectionId':_0x482d75['id']},{})[_0xf870('0x22')](function(){return _0x3727bb;});}else{return _0x3727bb;}})[_0xf870('0x44')](function(_0x441b7b){logger[_0xf870('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x441b7b);throw _0x441b7b;});}return _0x3727bb;})[_0xf870('0x22')](respondWithResult(_0x54ffac,0xc9))['catch'](handleError(_0x54ffac,null));};exports['update']=function(_0x29c2df,_0x476222){if(_0x29c2df[_0xf870('0x49')]['id']){delete _0x29c2df['body']['id'];}return db['Variable'][_0xf870('0x47')]({'where':{'id':_0x29c2df[_0xf870('0x46')]['id']}})[_0xf870('0x22')](handleEntityNotFound(_0x476222,null))[_0xf870('0x22')](saveUpdates(_0x29c2df[_0xf870('0x49')],null))[_0xf870('0x22')](respondWithResult(_0x476222,null))[_0xf870('0x44')](handleError(_0x476222,null));};exports['destroy']=function(_0x22912b,_0x16a8fc){return db[_0xf870('0x2c')][_0xf870('0x47')]({'where':{'id':_0x22912b[_0xf870('0x46')]['id']}})[_0xf870('0x22')](handleEntityNotFound(_0x16a8fc,null))[_0xf870('0x22')](removeEntity(_0x16a8fc,null))[_0xf870('0x44')](handleError(_0x16a8fc,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index aac889c..706f3b3 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 _0x5be2=['moment','bluebird','path','./variable.attributes','exports','define','tools_variables','lodash','api'];(function(_0x1a8caa,_0x195483){var _0x9021fe=function(_0x2eef64){while(--_0x2eef64){_0x1a8caa['push'](_0x1a8caa['shift']());}};_0x9021fe(++_0x195483);}(_0x5be2,0x1db));var _0x25be=function(_0x5daa2c,_0x4246f9){_0x5daa2c=_0x5daa2c-0x0;var _0x15a18b=_0x5be2[_0x5daa2c];return _0x15a18b;};'use strict';var _=require(_0x25be('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25be('0x1'));var moment=require(_0x25be('0x2'));var BPromise=require(_0x25be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25be('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x25be('0x5'));module[_0x25be('0x6')]=function(_0x1eacbf,_0x59d6e6){return _0x1eacbf[_0x25be('0x7')]('Variable',attributes,{'tableName':_0x25be('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd640=['bluebird','path','rimraf','./variable.attributes','exports','define','Variable','util','../../config/logger','api'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xd640,0x13d));var _0x0d64=function(_0x1921b5,_0x37d78b){_0x1921b5=_0x1921b5-0x0;var _0x1a7a24=_0xd640[_0x1921b5];return _0x1a7a24;};'use strict';var _=require('lodash');var util=require(_0x0d64('0x0'));var logger=require(_0x0d64('0x1'))(_0x0d64('0x2'));var moment=require('moment');var BPromise=require(_0x0d64('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d64('0x4'));var rimraf=require(_0x0d64('0x5'));var config=require('../../config/environment');var attributes=require(_0x0d64('0x6'));module[_0x0d64('0x7')]=function(_0x1e15aa,_0x3037e3){return _0x1e15aa[_0x0d64('0x8')](_0x0d64('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 5d03606..9a4dbdb 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x1bc8f8,_0x15e32c){var _0x36b858=function(_0x37a319){while(--_0x37a319){_0x1bc8f8['push'](_0x1bc8f8['shift']());}};_0x36b858(++_0x15e32c);}(_0x7217,0x19e));var _0x7721=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7217[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ 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(_0x1951de,_0x173387){var _0x418584=function(_0xfaf379){while(--_0xfaf379){_0x1951de['push'](_0x1951de['shift']());}};_0x418584(++_0x173387);}(_0x55ca,0x126));var _0xa55c=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0x55ca[_0x305c8f];return _0x5ddc30;};'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 bb4c7c9..a986e7b 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 _0x828e=['pull','/restart','restart','/migrations','migrations','exports','express','Router','get','isAuthenticated','canUpdate','fetch','/reset','/pull'];(function(_0x54c5a3,_0x328cd1){var _0x711bf=function(_0x249be6){while(--_0x249be6){_0x54c5a3['push'](_0x54c5a3['shift']());}};_0x711bf(++_0x328cd1);}(_0x828e,0xd8));var _0xe828=function(_0xcbb25c,_0x356176){_0xcbb25c=_0xcbb25c-0x0;var _0x60338a=_0x828e[_0xcbb25c];return _0x60338a;};'use strict';var express=require(_0xe828('0x0'));var router=express[_0xe828('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xe828('0x2')]('/',controller['index']);router['get']('/fetch',auth[_0xe828('0x3')](),auth[_0xe828('0x4')](),controller[_0xe828('0x5')]);router[_0xe828('0x2')](_0xe828('0x6'),auth[_0xe828('0x3')](),auth[_0xe828('0x4')](),controller['reset']);router['get'](_0xe828('0x7'),auth[_0xe828('0x3')](),auth[_0xe828('0x4')](),controller[_0xe828('0x8')]);router[_0xe828('0x2')](_0xe828('0x9'),auth['isAuthenticated'](),controller[_0xe828('0xa')]);router[_0xe828('0x2')](_0xe828('0xb'),controller[_0xe828('0xc')]);module[_0xe828('0xd')]=router; \ No newline at end of file +var _0x33a1=['migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','/restart','restart','/migrations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33a1,0x1f1));var _0x133a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x33a1[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x133a('0x0'));var router=express[_0x133a('0x1')]();var auth=require(_0x133a('0x2'));var controller=require(_0x133a('0x3'));router[_0x133a('0x4')]('/',controller[_0x133a('0x5')]);router[_0x133a('0x4')](_0x133a('0x6'),auth[_0x133a('0x7')](),auth[_0x133a('0x8')](),controller['fetch']);router[_0x133a('0x4')](_0x133a('0x9'),auth[_0x133a('0x7')](),auth[_0x133a('0x8')](),controller[_0x133a('0xa')]);router[_0x133a('0x4')]('/pull',auth[_0x133a('0x7')](),auth['canUpdate'](),controller[_0x133a('0xb')]);router[_0x133a('0x4')](_0x133a('0xc'),auth[_0x133a('0x7')](),controller[_0x133a('0xd')]);router['get'](_0x133a('0xe'),controller[_0x133a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index c9fd8c1..9c84846 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 _0xd29f=['readdirSync','join','replace','.js','push','length','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','latest','fetch','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations'];(function(_0x2a40b3,_0xe1c253){var _0x4ac6cb=function(_0x5083fe){while(--_0x5083fe){_0x2a40b3['push'](_0x2a40b3['shift']());}};_0x4ac6cb(++_0xe1c253);}(_0xd29f,0x7e));var _0xfd29=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0xd29f[_0x250071];return _0x34e574;};'use strict';var Umzug=require(_0xfd29('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xfd29('0x1'))(module,_0xfd29('0x2'));var compareVersions=require(_0xfd29('0x3'));var exec=require(_0xfd29('0x4'))[_0xfd29('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xfd29('0x6'));var pm2=require(_0xfd29('0x7'));var logger=require(_0xfd29('0x8'))(_0xfd29('0x9'));var git=require(_0xfd29('0xa'))(config[_0xfd29('0xb')]);exports['index']=function(_0x1bde79,_0x1ba5c8){var _0x12a839={'current':module[_0xfd29('0xc')][_0xfd29('0x2')],'phonebar':0x2};if(_0x1bde79[_0xfd29('0xd')]&&_0x1bde79[_0xfd29('0xd')][_0xfd29('0xe')]){return git[_0xfd29('0xf')]()['tags'](function(_0x2ea68d,_0x41bf7e){_0x12a839[_0xfd29('0xe')]=(_0x2ea68d?module[_0xfd29('0xc')][_0xfd29('0x2')]:_0x41bf7e['latest'])||'2.0.0';return _0x1ba5c8[_0xfd29('0x10')](0xc8)[_0xfd29('0x11')](_0x12a839);});}else{return _0x1ba5c8[_0xfd29('0x10')](0xc8)['json'](_0x12a839);}};exports[_0xfd29('0xf')]=function(_0x9cb6b0,_0xd6bf5a){return git['fetch']([_0xfd29('0x12'),_0xfd29('0x13')],function(_0x1251da){if(_0x1251da){logger[_0xfd29('0x14')](_0x1251da);return _0xd6bf5a[_0xfd29('0x10')](0x1f4)[_0xfd29('0x11')](_0x1251da);}logger[_0xfd29('0x15')](_0xfd29('0x16'));return _0xd6bf5a['status'](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x17')});});};exports['reset']=function(_0x17bf4f,_0xecbcec){return git['reset']([_0xfd29('0x18'),'FETCH_HEAD'],function(_0x3c36d6){if(_0x3c36d6){logger[_0xfd29('0x14')](_0x3c36d6);return _0xecbcec[_0xfd29('0x10')](0x1f4)[_0xfd29('0x11')](_0x3c36d6);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xecbcec['status'](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x19')});});};exports[_0xfd29('0x1a')]=function(_0x13ce52,_0x3c446a){exec(_0xfd29('0x1b'),function(_0x5cb42b,_0x35cb9b,_0xeaa08d){logger[_0xfd29('0x15')](_0x35cb9b);logger[_0xfd29('0x15')](_0xeaa08d);if(_0x5cb42b){logger['error'](_0x5cb42b);return _0x3c446a[_0xfd29('0x10')](0x1f4)['json'](_0x5cb42b);}return _0x3c446a['status'](0xc8)[_0xfd29('0x11')]({'output':_0x35cb9b});});};exports[_0xfd29('0x1c')]=function(_0xcda60a,_0x2275cb){return pm2[_0xfd29('0x1c')]('motion2')['then'](function(_0xc7a9d2){logger[_0xfd29('0x15')](_0xfd29('0x1d'),_0xc7a9d2);return _0x2275cb[_0xfd29('0x10')](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x1e')});})[_0xfd29('0x1f')](function(_0x4ac564){logger[_0xfd29('0x14')](_0x4ac564);return _0x2275cb['status'](0x1f4)[_0xfd29('0x11')](_0x4ac564);});};exports[_0xfd29('0x20')]=function(_0x31b2f3,_0x10e53c){var _0x5dccf7=fs[_0xfd29('0x21')](path[_0xfd29('0x22')](config[_0xfd29('0xb')],'server','migrations'));var _0x305d87=[];for(var _0x27f988=0x0;_0x27f988<_0x5dccf7['length'];_0x27f988++){var _0x3bc403=_0x5dccf7[_0x27f988][_0xfd29('0x23')](_0xfd29('0x24'),'');if(compareVersions(module[_0xfd29('0xc')][_0xfd29('0x2')],_0x3bc403)===-0x1){_0x305d87[_0xfd29('0x25')](_0x3bc403);}}if(_0x305d87[_0xfd29('0x26')]){var _0x14ea23=_0x305d87[_0xfd29('0x27')](compareVersions);var _0xc53fa8=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0xfd29('0x28'),'columnName':'version'},'migrations':{'params':[db[_0xfd29('0x29')][_0xfd29('0x2a')](),db[_0xfd29('0x29')][_0xfd29('0x2b')],function(){throw new Error(_0xfd29('0x2c'));}],'path':path['join'](config['root'],_0xfd29('0x2d'),_0xfd29('0x20')),'pattern':/\.js$/}});_0xc53fa8['up']({'migrations':_[_0xfd29('0x2e')](_0x14ea23,function(_0x478f0a){return _0x478f0a+_0xfd29('0x24');})})[_0xfd29('0x2f')](function(){return _0x10e53c[_0xfd29('0x10')](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x30')+module[_0xfd29('0xc')]['version']+_0xfd29('0x31')+_[_0xfd29('0x32')](_0x14ea23),'migrations':_[_0xfd29('0x22')](_0x14ea23)});})[_0xfd29('0x1f')](function(_0x426b9f){if(_0x426b9f instanceof db[_0xfd29('0x29')][_0xfd29('0x33')]){return _0x10e53c[_0xfd29('0x10')](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x34')});}else{return _0x10e53c['status'](0x1f4)[_0xfd29('0x11')](_0x426b9f);}});}else{return _0x10e53c[_0xfd29('0x10')](0xc8)[_0xfd29('0x11')]({'output':_0xfd29('0x34')});}}; \ No newline at end of file +var _0x78ef=['reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','replace','.js','length','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.','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','update','root','index','version','query','latest','tags','exports','2.0.0','json','status','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x78ef,0x79));var _0xf78e=function(_0xa16f5e,_0x54b144){_0xa16f5e=_0xa16f5e-0x0;var _0x2c9964=_0x78ef[_0xa16f5e];return _0x2c9964;};'use strict';var Umzug=require(_0xf78e('0x0'));var path=require(_0xf78e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xf78e('0x2'))(module,'version');var compareVersions=require(_0xf78e('0x3'));var exec=require(_0xf78e('0x4'))[_0xf78e('0x5')];var db=require(_0xf78e('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xf78e('0x7'));var logger=require('../../config/logger')(_0xf78e('0x8'));var git=require('simple-git')(config[_0xf78e('0x9')]);exports[_0xf78e('0xa')]=function(_0x203b4a,_0x566eac){var _0x41d4ea={'current':module['exports'][_0xf78e('0xb')],'phonebar':0x2};if(_0x203b4a[_0xf78e('0xc')]&&_0x203b4a[_0xf78e('0xc')][_0xf78e('0xd')]){return git['fetch']()[_0xf78e('0xe')](function(_0x4acbd2,_0x3701fa){_0x41d4ea[_0xf78e('0xd')]=(_0x4acbd2?module[_0xf78e('0xf')][_0xf78e('0xb')]:_0x3701fa[_0xf78e('0xd')])||_0xf78e('0x10');return _0x566eac['status'](0xc8)[_0xf78e('0x11')](_0x41d4ea);});}else{return _0x566eac[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')](_0x41d4ea);}};exports[_0xf78e('0x13')]=function(_0x3f7de1,_0x41e8ff){return git[_0xf78e('0x13')]([_0xf78e('0x14'),_0xf78e('0x15')],function(_0x3731fc){if(_0x3731fc){logger[_0xf78e('0x16')](_0x3731fc);return _0x41e8ff[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x3731fc);}logger[_0xf78e('0x17')](_0xf78e('0x18'));return _0x41e8ff['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x19')});});};exports[_0xf78e('0x1a')]=function(_0x15d27b,_0x4624cd){return git[_0xf78e('0x1a')](['--hard','FETCH_HEAD'],function(_0x1ddfe2){if(_0x1ddfe2){logger[_0xf78e('0x16')](_0x1ddfe2);return _0x4624cd[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x1ddfe2);}logger[_0xf78e('0x17')](_0xf78e('0x1b'));return _0x4624cd['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x1c')});});};exports[_0xf78e('0x1d')]=function(_0x5e0a4d,_0x55fb4b){exec(_0xf78e('0x1e'),function(_0x107492,_0x4acf5e,_0x36594b){logger[_0xf78e('0x17')](_0x4acf5e);logger[_0xf78e('0x17')](_0x36594b);if(_0x107492){logger[_0xf78e('0x16')](_0x107492);return _0x55fb4b[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x107492);}return _0x55fb4b[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':_0x4acf5e});});};exports[_0xf78e('0x1f')]=function(_0x24c279,_0x44b3c8){return pm2[_0xf78e('0x1f')](_0xf78e('0x20'))['then'](function(_0x5bc73){logger[_0xf78e('0x17')](_0xf78e('0x21'),_0x5bc73);return _0x44b3c8['status'](0xc8)['json']({'output':_0xf78e('0x22')});})[_0xf78e('0x23')](function(_0x573a12){logger[_0xf78e('0x16')](_0x573a12);return _0x44b3c8[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x573a12);});};exports[_0xf78e('0x24')]=function(_0xb5dc11,_0x295277){var _0x517a29=fs[_0xf78e('0x25')](path['join'](config[_0xf78e('0x9')],'server',_0xf78e('0x24')));var _0x4741e0=[];for(var _0x20d41f=0x0;_0x20d41f<_0x517a29['length'];_0x20d41f++){var _0x45c144=_0x517a29[_0x20d41f][_0xf78e('0x26')](_0xf78e('0x27'),'');if(compareVersions(module[_0xf78e('0xf')][_0xf78e('0xb')],_0x45c144)===-0x1){_0x4741e0['push'](_0x45c144);}}if(_0x4741e0[_0xf78e('0x28')]){var _0xba5eb9=_0x4741e0['sort'](compareVersions);var _0x470c45=new Umzug({'storage':_0xf78e('0x29'),'storageOptions':{'model':db[_0xf78e('0x2a')],'modelName':'Migration','columnName':_0xf78e('0xb')},'migrations':{'params':[db['sequelize'][_0xf78e('0x2b')](),db[_0xf78e('0x29')][_0xf78e('0x2c')],function(){throw new Error(_0xf78e('0x2d'));}],'path':path[_0xf78e('0x2e')](config[_0xf78e('0x9')],'server',_0xf78e('0x24')),'pattern':/\.js$/}});_0x470c45['up']({'migrations':_['map'](_0xba5eb9,function(_0x5e60f9){return _0x5e60f9+'.js';})})['then'](function(){return _0x295277[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf78e('0xf')]['version']+'\x20to\x20'+_['last'](_0xba5eb9),'migrations':_[_0xf78e('0x2e')](_0xba5eb9)});})[_0xf78e('0x23')](function(_0x4d6986){if(_0x4d6986 instanceof db[_0xf78e('0x29')][_0xf78e('0x2f')]){return _0x295277[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x30')});}else{return _0x295277[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x4d6986);}});}else{return _0x295277['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 18c44fb..36bbd2c 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 _0x9b87=['util','express','Router','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x9b87,0x7f));var _0x79b8=function(_0xacd3b0,_0x5855be){_0xacd3b0=_0xacd3b0-0x0;var _0x5a5bd5=_0x9b87[_0xacd3b0];return _0x5a5bd5;};'use strict';var multer=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x79b8('0x2'));var router=express[_0x79b8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x79b8('0x4'));var controller=require('./voiceAgentReport.controller');router[_0x79b8('0x5')]('/',auth[_0x79b8('0x6')](),controller['index']);router[_0x79b8('0x5')]('/describe',auth[_0x79b8('0x6')](),controller['describe']);router['get'](_0x79b8('0x7'),auth['isAuthenticated'](),controller[_0x79b8('0x8')]);router[_0x79b8('0x9')]('/',auth[_0x79b8('0x6')](),controller[_0x79b8('0xa')]);router[_0x79b8('0xb')](_0x79b8('0x7'),auth[_0x79b8('0x6')](),controller[_0x79b8('0xc')]);router[_0x79b8('0xd')](_0x79b8('0x7'),auth[_0x79b8('0x6')](),controller[_0x79b8('0xe')]);module[_0x79b8('0xf')]=router; \ No newline at end of file +var _0x39be=['isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./voiceAgentReport.controller','get','/describe'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x39be,0x19a));var _0xe39b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x39be[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var path=require(_0xe39b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe39b('0x3'));var router=express[_0xe39b('0x4')]();var fs_extra=require(_0xe39b('0x5'));var auth=require(_0xe39b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe39b('0x7'));router[_0xe39b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe39b('0x8')](_0xe39b('0x9'),auth[_0xe39b('0xa')](),controller[_0xe39b('0xb')]);router['get']('/:id',auth[_0xe39b('0xa')](),controller[_0xe39b('0xc')]);router[_0xe39b('0xd')]('/',auth[_0xe39b('0xa')](),controller[_0xe39b('0xe')]);router[_0xe39b('0xf')](_0xe39b('0x10'),auth[_0xe39b('0xa')](),controller[_0xe39b('0x11')]);router[_0xe39b('0x12')](_0xe39b('0x10'),auth[_0xe39b('0xa')](),controller[_0xe39b('0x13')]);module[_0xe39b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 524e3af..3cadc3f 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 _0x1c7c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x435680,_0x4e364c){var _0x1641b3=function(_0x4e23bc){while(--_0x4e23bc){_0x435680['push'](_0x435680['shift']());}};_0x1641b3(++_0x4e364c);}(_0x1c7c,0x164));var _0xc1c7=function(_0x292ba2,_0x3808ba){_0x292ba2=_0x292ba2-0x0;var _0x202320=_0x1c7c[_0x292ba2];return _0x202320;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'type':{'type':Sequelize[_0xc1c7('0x2')]},'uniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc1c7('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc1c7('0x2')]},'membername':{'type':Sequelize[_0xc1c7('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc1c7('0x3')]},'holdtime':{'type':Sequelize[_0xc1c7('0x4')]},'agentcomplete':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc1c7('0x4')]},'agentacw':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc1c7('0x4')]},'reason':{'type':Sequelize[_0xc1c7('0x2')]},'lastevent':{'type':Sequelize[_0xc1c7('0x2')]},'channel':{'type':Sequelize[_0xc1c7('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc1c7('0x2')]},'accountcode':{'type':Sequelize[_0xc1c7('0x2')]},'context':{'type':Sequelize[_0xc1c7('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc1c7('0x2')]},'destchannel':{'type':Sequelize[_0xc1c7('0x2')]},'destchannelstate':{'type':Sequelize[_0xc1c7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridname':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc1c7('0x2')]},'destlanguage':{'type':Sequelize[_0xc1c7('0x2')]},'destaccountcode':{'type':Sequelize[_0xc1c7('0x2')]},'destcontext':{'type':Sequelize[_0xc1c7('0x2')]},'destexten':{'type':Sequelize[_0xc1c7('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xc1c7('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc1c7('0x2')],'comment':_0xc1c7('0x6')},'transferexten':{'type':Sequelize[_0xc1c7('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'agententerreason':{'type':Sequelize[_0xc1c7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa478=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x1e36a8,_0x2a4821){var _0x167625=function(_0x16898a){while(--_0x16898a){_0x1e36a8['push'](_0x1e36a8['shift']());}};_0x167625(++_0x2a4821);}(_0xa478,0x136));var _0x8a47=function(_0x3c9e74,_0x4334c5){_0x3c9e74=_0x3c9e74-0x0;var _0x4fea21=_0xa478[_0x3c9e74];return _0x4fea21;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'type':{'type':Sequelize[_0x8a47('0x2')]},'uniqueid':{'type':Sequelize[_0x8a47('0x2')]},'calleridnum':{'type':Sequelize[_0x8a47('0x2')]},'calleridname':{'type':Sequelize[_0x8a47('0x2')]},'queue':{'type':Sequelize[_0x8a47('0x2')]},'interface':{'type':Sequelize[_0x8a47('0x2')]},'membername':{'type':Sequelize[_0x8a47('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8a47('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8a47('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8a47('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x8a47('0x3')]},'holdtime':{'type':Sequelize[_0x8a47('0x4')]},'agentcomplete':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8a47('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8a47('0x4')]},'reason':{'type':Sequelize[_0x8a47('0x2')]},'lastevent':{'type':Sequelize[_0x8a47('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8a47('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8a47('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8a47('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8a47('0x2')]},'context':{'type':Sequelize[_0x8a47('0x2')]},'exten':{'type':Sequelize[_0x8a47('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8a47('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8a47('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8a47('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8a47('0x2')]},'destlanguage':{'type':Sequelize[_0x8a47('0x2')]},'destaccountcode':{'type':Sequelize[_0x8a47('0x2')]},'destcontext':{'type':Sequelize[_0x8a47('0x2')]},'destexten':{'type':Sequelize[_0x8a47('0x2')]},'destpriority':{'type':Sequelize[_0x8a47('0x2')]},'destuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8a47('0x2')]},'transfer':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8a47('0x2')],'comment':_0x8a47('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'agententerreason':{'type':Sequelize[_0x8a47('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 41f9a30..21dc326 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 3137d69..5bfccdb 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 _0xdb70=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x8d1b7b,_0x1338aa){var _0x275211=function(_0x48959b){while(--_0x48959b){_0x8d1b7b['push'](_0x8d1b7b['shift']());}};_0x275211(++_0x1338aa);}(_0xdb70,0xa0));var _0x0db7=function(_0x5949a9,_0x54f4f8){_0x5949a9=_0x5949a9-0x0;var _0x4cace0=_0xdb70[_0x5949a9];return _0x4cace0;};'use strict';var _=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var logger=require(_0x0db7('0x2'))('api');var moment=require(_0x0db7('0x3'));var BPromise=require(_0x0db7('0x4'));var rp=require(_0x0db7('0x5'));var fs=require('fs');var path=require(_0x0db7('0x6'));var rimraf=require(_0x0db7('0x7'));var config=require(_0x0db7('0x8'));var attributes=require(_0x0db7('0x9'));module[_0x0db7('0xa')]=function(_0x13fcf7,_0xbefc2a){return _0x13fcf7[_0x0db7('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x0db7('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0db7('0xd'),_0x0db7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56a4=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','path'];(function(_0x3b0319,_0x4b163e){var _0xca86b4=function(_0x59e59d){while(--_0x59e59d){_0x3b0319['push'](_0x3b0319['shift']());}};_0xca86b4(++_0x4b163e);}(_0x56a4,0x11b));var _0x456a=function(_0x4a2266,_0x53e92f){_0x4a2266=_0x4a2266-0x0;var _0x1d7b9f=_0x56a4[_0x4a2266];return _0x1d7b9f;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('VoiceAgentReport',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x456a('0xa'),_0x456a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 4879d68..609b316 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 _0x0857=['UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options'];(function(_0x90e575,_0x48c2ec){var _0x1aae60=function(_0x4e40cf){while(--_0x4e40cf){_0x90e575['push'](_0x90e575['shift']());}};_0x1aae60(++_0x48c2ec);}(_0x0857,0x1a6));var _0x7085=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0857[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7085('0x0'));var util=require(_0x7085('0x1'));var moment=require('moment');var BPromise=require(_0x7085('0x2'));var rs=require(_0x7085('0x3'));var fs=require('fs');var Redis=require(_0x7085('0x4'));var db=require(_0x7085('0x5'))['db'];var utils=require(_0x7085('0x6'));var logger=require(_0x7085('0x7'))('rpc');var config=require(_0x7085('0x8'));var jayson=require(_0x7085('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56d0a9,_0x2d4330,_0x2663b8){return new BPromise(function(_0x52d055,_0x39877d){return client[_0x7085('0xa')](_0x56d0a9,_0x2663b8)[_0x7085('0xb')](function(_0x228c67){logger[_0x7085('0xc')](_0x7085('0xd'),_0x2d4330,_0x7085('0xe'));logger[_0x7085('0xf')](_0x7085('0x10'),_0x2d4330,'request\x20sent',JSON[_0x7085('0x11')](_0x228c67));if(_0x228c67[_0x7085('0x12')]){if(_0x228c67[_0x7085('0x12')]['code']===0x1f4){logger[_0x7085('0x12')](_0x7085('0xd'),_0x2d4330,_0x228c67[_0x7085('0x12')][_0x7085('0x13')]);return _0x39877d(_0x228c67[_0x7085('0x12')]['message']);}logger[_0x7085('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d4330,_0x228c67[_0x7085('0x12')]['message']);return _0x52d055(_0x228c67['error'][_0x7085('0x13')]);}else{logger[_0x7085('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d4330,_0x7085('0xe'));_0x52d055(_0x228c67[_0x7085('0x14')][_0x7085('0x13')]);}})[_0x7085('0x15')](function(_0x5be2bd){logger[_0x7085('0x12')](_0x7085('0xd'),_0x2d4330,_0x5be2bd);_0x39877d(_0x5be2bd);});});}exports[_0x7085('0x16')]=function(_0x3af291){var _0x1ff06c=this;return new Promise(function(_0x233368,_0x5d5515){return db[_0x7085('0x17')]['create'](_0x3af291[_0x7085('0x18')],{'raw':_0x3af291[_0x7085('0x19')]?_0x3af291['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x533fd1){logger['info'](_0x7085('0x16'),_0x3af291);logger[_0x7085('0xf')](_0x7085('0x16'),_0x3af291,JSON[_0x7085('0x11')](_0x533fd1));_0x233368(_0x533fd1);})[_0x7085('0x15')](function(_0x34aa79){logger['error'](_0x7085('0x16'),_0x34aa79[_0x7085('0x13')],_0x3af291);_0x5d5515(_0x1ff06c[_0x7085('0x12')](0x1f4,_0x34aa79['message']));});});};exports[_0x7085('0x1a')]=function(_0x174265){var _0x43c7c0=this;return new Promise(function(_0x5496b5,_0x4b083e){return db[_0x7085('0x17')][_0x7085('0x1b')](_0x174265[_0x7085('0x18')],{'raw':_0x174265[_0x7085('0x19')]?_0x174265[_0x7085('0x19')][_0x7085('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x174265['options']?_0x174265[_0x7085('0x19')][_0x7085('0x1d')]||null:null,'attributes':_0x174265[_0x7085('0x19')]?_0x174265[_0x7085('0x19')][_0x7085('0x1e')]||null:null,'limit':_0x174265[_0x7085('0x19')]?_0x174265[_0x7085('0x19')][_0x7085('0x1f')]||null:null})[_0x7085('0xb')](function(_0x4ed0c5){logger['info'](_0x7085('0x1a'),_0x174265);logger['debug'](_0x7085('0x1a'),_0x174265,JSON[_0x7085('0x11')](_0x4ed0c5));_0x5496b5(_0x4ed0c5);})['catch'](function(_0x473eff){logger['error'](_0x7085('0x1a'),_0x473eff[_0x7085('0x13')],_0x174265);_0x4b083e(_0x43c7c0[_0x7085('0x12')](0x1f4,_0x473eff['message']));});});}; \ No newline at end of file +var _0x019d=['info','CreateVoiceAgentReport','debug','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','body','options','raw'];(function(_0x5234cd,_0x30a04d){var _0x4e77df=function(_0x431bf3){while(--_0x431bf3){_0x5234cd['push'](_0x5234cd['shift']());}};_0x4e77df(++_0x30a04d);}(_0x019d,0x1c2));var _0xd019=function(_0x1b2564,_0x309b72){_0x1b2564=_0x1b2564-0x0;var _0x4c543e=_0x019d[_0x1b2564];return _0x4c543e;};'use strict';var _=require(_0xd019('0x0'));var util=require('util');var moment=require(_0xd019('0x1'));var BPromise=require('bluebird');var rs=require(_0xd019('0x2'));var fs=require('fs');var Redis=require(_0xd019('0x3'));var db=require(_0xd019('0x4'))['db'];var utils=require(_0xd019('0x5'));var logger=require('../../config/logger')(_0xd019('0x6'));var config=require(_0xd019('0x7'));var jayson=require(_0xd019('0x8'));var client=jayson[_0xd019('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7c3b4a,_0x3f1b2f,_0x3314d7){return new BPromise(function(_0x16ee31,_0x5cfc2c){return client[_0xd019('0xa')](_0x7c3b4a,_0x3314d7)[_0xd019('0xb')](function(_0x46fbfd){logger['info'](_0xd019('0xc'),_0x3f1b2f,_0xd019('0xd'));logger['debug'](_0xd019('0xe'),_0x3f1b2f,_0xd019('0xd'),JSON[_0xd019('0xf')](_0x46fbfd));if(_0x46fbfd[_0xd019('0x10')]){if(_0x46fbfd[_0xd019('0x10')][_0xd019('0x11')]===0x1f4){logger['error'](_0xd019('0xc'),_0x3f1b2f,_0x46fbfd[_0xd019('0x10')]['message']);return _0x5cfc2c(_0x46fbfd['error'][_0xd019('0x12')]);}logger[_0xd019('0x10')](_0xd019('0xc'),_0x3f1b2f,_0x46fbfd[_0xd019('0x10')][_0xd019('0x12')]);return _0x16ee31(_0x46fbfd[_0xd019('0x10')][_0xd019('0x12')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3f1b2f,'request\x20sent');_0x16ee31(_0x46fbfd[_0xd019('0x13')][_0xd019('0x12')]);}})[_0xd019('0x14')](function(_0x1f208a){logger['error'](_0xd019('0xc'),_0x3f1b2f,_0x1f208a);_0x5cfc2c(_0x1f208a);});});}exports['CreateVoiceAgentReport']=function(_0x1595a1){var _0x4bb876=this;return new Promise(function(_0x1117de,_0x4a4115){return db[_0xd019('0x15')][_0xd019('0x16')](_0x1595a1[_0xd019('0x17')],{'raw':_0x1595a1[_0xd019('0x18')]?_0x1595a1[_0xd019('0x18')][_0xd019('0x19')]===undefined?!![]:![]:!![]})[_0xd019('0xb')](function(_0x5bcefc){logger[_0xd019('0x1a')](_0xd019('0x1b'),_0x1595a1);logger[_0xd019('0x1c')](_0xd019('0x1b'),_0x1595a1,JSON['stringify'](_0x5bcefc));_0x1117de(_0x5bcefc);})['catch'](function(_0x2372a4){logger[_0xd019('0x10')]('CreateVoiceAgentReport',_0x2372a4[_0xd019('0x12')],_0x1595a1);_0x4a4115(_0x4bb876['error'](0x1f4,_0x2372a4[_0xd019('0x12')]));});});};exports[_0xd019('0x1d')]=function(_0x4d2284){var _0x42cc58=this;return new Promise(function(_0x19500d,_0x40a082){return db[_0xd019('0x15')][_0xd019('0x1e')](_0x4d2284[_0xd019('0x17')],{'raw':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x1f')]||null:null,'attributes':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x20')]||null:null,'limit':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x21')]||null:null})['then'](function(_0x36e848){logger[_0xd019('0x1a')](_0xd019('0x1d'),_0x4d2284);logger[_0xd019('0x1c')](_0xd019('0x1d'),_0x4d2284,JSON['stringify'](_0x36e848));_0x19500d(_0x36e848);})[_0xd019('0x14')](function(_0x36d5b6){logger[_0xd019('0x10')](_0xd019('0x1d'),_0x36d5b6[_0xd019('0x12')],_0x4d2284);_0x40a082(_0x42cc58[_0xd019('0x10')](0x1f4,_0x36d5b6[_0xd019('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0f972da..028bf3f 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 _0xed1f=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x4efb56,_0x1ef9b0){var _0x4daf4e=function(_0x34681f){while(--_0x34681f){_0x4efb56['push'](_0x4efb56['shift']());}};_0x4daf4e(++_0x1ef9b0);}(_0xed1f,0x6a));var _0xfed1=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xed1f[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xc')](),controller['show']);router[_0xfed1('0x11')]('/',auth[_0xfed1('0xc')](),controller['create']);router[_0xfed1('0x12')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x13')]);router['delete']('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xf006,0x146));var _0x6f00=function(_0x4194c1,_0xd86227){_0x4194c1=_0x4194c1-0x0;var _0x71ed3a=_0xf006[_0x4194c1];return _0x71ed3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index c9cdea3..ef2779d 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 _0xd232=['internal','outbound','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound'];(function(_0x12ce07,_0xd4c26e){var _0x1f8f6e=function(_0x216181){while(--_0x216181){_0x12ce07['push'](_0x12ce07['shift']());}};_0x1f8f6e(++_0xd4c26e);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2d23('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2d23('0x1')]},'type':{'type':Sequelize[_0x2d23('0x2')](_0x2d23('0x3'),_0x2d23('0x4'),_0x2d23('0x5'),'inbound-fax','outbound-fax',_0x2d23('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x2d23('0x1')]},'destination':{'type':Sequelize[_0x2d23('0x1')]},'destinationcontext':{'type':Sequelize[_0x2d23('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2d23('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x2d23('0x1')]},'lastdata':{'type':Sequelize[_0x2d23('0x7')]},'starttime':{'type':Sequelize[_0x2d23('0x8')]},'systemanswertime':{'type':Sequelize[_0x2d23('0x8')]},'answertime':{'type':Sequelize[_0x2d23('0x8')]},'endtime':{'type':Sequelize[_0x2d23('0x8')]},'duration':{'type':Sequelize[_0x2d23('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2d23('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2d23('0x1')]},'amaflags':{'type':Sequelize[_0x2d23('0x1')]},'userfield':{'type':Sequelize[_0x2d23('0x1')]},'userDisposition':{'type':Sequelize[_0x2d23('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x2d23('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x2d23('0x1')]},'note':{'type':Sequelize[_0x2d23('0x1')]},'prefix':{'type':Sequelize[_0x2d23('0x1')]},'routeid':{'type':Sequelize[_0x2d23('0x9')]},'sipcallid':{'type':Sequelize[_0x2d23('0x1')]}}; \ No newline at end of file +var _0x4628=['STRING','TEXT','DATE','INTEGER','exports','inbound','outbound','outbound-fax','dialer'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x4628,0x70));var _0x8462=function(_0x4f56c1,_0x28bd7d){_0x4f56c1=_0x4f56c1-0x0;var _0x4503e4=_0x4628[_0x4f56c1];return _0x4503e4;};'use strict';var Sequelize=require('sequelize');module[_0x8462('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8462('0x1'),'internal',_0x8462('0x2'),'inbound-fax',_0x8462('0x3'),_0x8462('0x4'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x8462('0x5')]},'destination':{'type':Sequelize[_0x8462('0x5')]},'destinationcontext':{'type':Sequelize[_0x8462('0x5')]},'callerid':{'type':Sequelize[_0x8462('0x5')]},'channel':{'type':Sequelize[_0x8462('0x5')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x8462('0x5')]},'lastdata':{'type':Sequelize[_0x8462('0x6')]},'starttime':{'type':Sequelize[_0x8462('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8462('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8462('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8462('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x8462('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x8462('0x5')]},'note':{'type':Sequelize[_0x8462('0x5')]},'prefix':{'type':Sequelize[_0x8462('0x5')]},'routeid':{'type':Sequelize[_0x8462('0x8')]},'sipcallid':{'type':Sequelize[_0x8462('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ee46abd..32a2c5a 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x4b709c,_0x5ccfcc){var _0x43bb92=function(_0x5f417d){while(--_0x5f417d){_0x4b709c['push'](_0x4b709c['shift']());}};_0x43bb92(++_0x5ccfcc);}(_0xb10b,0x12a));var _0xbb10=function(_0x52e77f,_0x368694){_0x52e77f=_0x52e77f-0x0;var _0x3aad87=_0xb10b[_0x52e77f];return _0x3aad87;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f0484,_0x41fd24){_0x1f0484=_0x1f0484-0x0;var _0x445d6b=_0x2ef3[_0x1f0484];return _0x445d6b;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 55a415e..112b778 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 _0xb81d=['moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','api'];(function(_0x4b34f6,_0x35c958){var _0x2b8281=function(_0x5ec682){while(--_0x5ec682){_0x4b34f6['push'](_0x4b34f6['shift']());}};_0x2b8281(++_0x35c958);}(_0xb81d,0xb4));var _0xdb81=function(_0x3dd9c5,_0x5800a9){_0x3dd9c5=_0x3dd9c5-0x0;var _0x502397=_0xb81d[_0x3dd9c5];return _0x502397;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb81('0x0'))(_0xdb81('0x1'));var moment=require(_0xdb81('0x2'));var BPromise=require('bluebird');var rp=require(_0xdb81('0x3'));var fs=require('fs');var path=require(_0xdb81('0x4'));var rimraf=require(_0xdb81('0x5'));var config=require(_0xdb81('0x6'));var attributes=require(_0xdb81('0x7'));module[_0xdb81('0x8')]=function(_0x10296c,_0x571b41){return _0x10296c[_0xdb81('0x9')](_0xdb81('0xa'),attributes,{'tableName':_0xdb81('0xb'),'paranoid':![],'indexes':[{'fields':[_0xdb81('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea8=['api','moment','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x424678,_0x117a3e){var _0x227c46=function(_0x1c5092){while(--_0x1c5092){_0x424678['push'](_0x424678['shift']());}};_0x227c46(++_0x117a3e);}(_0x7ea8,0x1d1));var _0x87ea=function(_0x1abfed,_0x41b1f4){_0x1abfed=_0x1abfed-0x0;var _0x474770=_0x7ea8[_0x1abfed];return _0x474770;};'use strict';var _=require(_0x87ea('0x0'));var util=require(_0x87ea('0x1'));var logger=require(_0x87ea('0x2'))(_0x87ea('0x3'));var moment=require(_0x87ea('0x4'));var BPromise=require('bluebird');var rp=require(_0x87ea('0x5'));var fs=require('fs');var path=require(_0x87ea('0x6'));var rimraf=require(_0x87ea('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x87ea('0x8')]=function(_0x1927e0,_0x70dccf){return _0x1927e0[_0x87ea('0x9')](_0x87ea('0xa'),attributes,{'tableName':_0x87ea('0xb'),'paranoid':![],'indexes':[{'fields':[_0x87ea('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 8febca2..bfe9457 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 _0xbea5=['GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch'];(function(_0x2a3be6,_0x43b3aa){var _0x2f65a6=function(_0x3bd822){while(--_0x3bd822){_0x2a3be6['push'](_0x2a3be6['shift']());}};_0x2f65a6(++_0x43b3aa);}(_0xbea5,0x177));var _0x5bea=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0xbea5[_0x5093e9];return _0x4c9a22;};'use strict';var _=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var moment=require('moment');var BPromise=require(_0x5bea('0x2'));var rs=require(_0x5bea('0x3'));var fs=require('fs');var Redis=require(_0x5bea('0x4'));var db=require(_0x5bea('0x5'))['db'];var utils=require(_0x5bea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5bea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x487888,_0x40bb15,_0x581c55){return new BPromise(function(_0x4b204d,_0x1acc0f){return client[_0x5bea('0x9')](_0x487888,_0x581c55)[_0x5bea('0xa')](function(_0x4d5fd6){logger[_0x5bea('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x40bb15,'request\x20sent');logger[_0x5bea('0xc')](_0x5bea('0xd'),_0x40bb15,_0x5bea('0xe'),JSON[_0x5bea('0xf')](_0x4d5fd6));if(_0x4d5fd6[_0x5bea('0x10')]){if(_0x4d5fd6[_0x5bea('0x10')]['code']===0x1f4){logger[_0x5bea('0x10')](_0x5bea('0x11'),_0x40bb15,_0x4d5fd6['error'][_0x5bea('0x12')]);return _0x1acc0f(_0x4d5fd6[_0x5bea('0x10')]['message']);}logger[_0x5bea('0x10')](_0x5bea('0x11'),_0x40bb15,_0x4d5fd6[_0x5bea('0x10')][_0x5bea('0x12')]);return _0x4b204d(_0x4d5fd6[_0x5bea('0x10')][_0x5bea('0x12')]);}else{logger[_0x5bea('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x40bb15,'request\x20sent');_0x4b204d(_0x4d5fd6[_0x5bea('0x13')][_0x5bea('0x12')]);}})[_0x5bea('0x14')](function(_0x50758b){logger[_0x5bea('0x10')](_0x5bea('0x11'),_0x40bb15,_0x50758b);_0x1acc0f(_0x50758b);});});}exports[_0x5bea('0x15')]=function(_0x49ba83){var _0x1bf374=this;return new Promise(function(_0x23fa96,_0x5f12a7){return db[_0x5bea('0x16')]['findAll']({'raw':_0x49ba83[_0x5bea('0x17')]?_0x49ba83[_0x5bea('0x17')][_0x5bea('0x18')]===undefined?!![]:![]:!![],'where':_0x49ba83['options']?_0x49ba83['options'][_0x5bea('0x19')]||null:null,'attributes':_0x49ba83[_0x5bea('0x17')]?_0x49ba83[_0x5bea('0x17')]['attributes']||null:null,'limit':_0x49ba83[_0x5bea('0x17')]?_0x49ba83[_0x5bea('0x17')][_0x5bea('0x1a')]||null:null,'include':_0x49ba83[_0x5bea('0x17')]?_0x49ba83['options'][_0x5bea('0x1b')]?_[_0x5bea('0x1c')](_0x49ba83[_0x5bea('0x17')][_0x5bea('0x1b')],function(_0x5984f8){return{'model':db[_0x5984f8[_0x5bea('0x1d')]],'as':_0x5984f8['as'],'attributes':_0x5984f8['attributes'],'include':_0x5984f8[_0x5bea('0x1b')]?_['map'](_0x5984f8[_0x5bea('0x1b')],function(_0x10282f){return{'model':db[_0x10282f[_0x5bea('0x1d')]],'as':_0x10282f['as'],'attributes':_0x10282f[_0x5bea('0x1e')],'include':_0x10282f['include']?_['map'](_0x10282f['include'],function(_0x4c0821){return{'model':db[_0x4c0821[_0x5bea('0x1d')]],'as':_0x4c0821['as'],'attributes':_0x4c0821['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35059f){logger[_0x5bea('0xb')]('GetVoiceCallReport',_0x49ba83);logger[_0x5bea('0xc')]('GetVoiceCallReport',_0x49ba83,JSON['stringify'](_0x35059f));_0x23fa96(_0x35059f);})[_0x5bea('0x14')](function(_0x2e773a){logger[_0x5bea('0x10')](_0x5bea('0x15'),_0x2e773a[_0x5bea('0x12')],_0x49ba83);_0x5f12a7(_0x1bf374[_0x5bea('0x10')](0x1f4,_0x2e773a[_0x5bea('0x12')]));});});};exports[_0x5bea('0x1f')]=function(_0x34ae3b){var _0x4c023f=this;return new Promise(function(_0x4d4cdb,_0x201c38){return db[_0x5bea('0x16')][_0x5bea('0x20')](_0x34ae3b[_0x5bea('0x21')],{'raw':_0x34ae3b['options']?_0x34ae3b[_0x5bea('0x17')][_0x5bea('0x18')]===undefined?!![]:![]:!![]})[_0x5bea('0xa')](function(_0x1df4aa){logger['info'](_0x5bea('0x1f'),_0x34ae3b);logger[_0x5bea('0xc')](_0x5bea('0x1f'),_0x34ae3b,JSON['stringify'](_0x1df4aa));_0x4d4cdb(_0x1df4aa);})[_0x5bea('0x14')](function(_0x10f226){logger[_0x5bea('0x10')](_0x5bea('0x1f'),_0x10f226[_0x5bea('0x12')],_0x34ae3b);_0x201c38(_0x4c023f[_0x5bea('0x10')](0x1f4,_0x10f226['message']));});});};exports['UpdateVoiceCallReport']=function(_0x52b050){var _0x208c99=this;return new Promise(function(_0x4ef755,_0x3495ad){return db['VoiceCallReport'][_0x5bea('0x22')](_0x52b050[_0x5bea('0x21')],{'raw':_0x52b050['options']?_0x52b050[_0x5bea('0x17')][_0x5bea('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52b050[_0x5bea('0x17')]?_0x52b050['options']['where']||null:null,'attributes':_0x52b050[_0x5bea('0x17')]?_0x52b050[_0x5bea('0x17')][_0x5bea('0x1e')]||null:null,'limit':_0x52b050[_0x5bea('0x17')]?_0x52b050[_0x5bea('0x17')]['limit']||null:null})[_0x5bea('0xa')](function(_0x4c2fa1){logger[_0x5bea('0xb')](_0x5bea('0x23'),_0x52b050);logger[_0x5bea('0xc')](_0x5bea('0x23'),_0x52b050,JSON[_0x5bea('0xf')](_0x4c2fa1));_0x4ef755(_0x4c2fa1);})['catch'](function(_0x232c43){logger[_0x5bea('0x10')](_0x5bea('0x23'),_0x232c43[_0x5bea('0x12')],_0x52b050);_0x3495ad(_0x208c99['error'](0x1f4,_0x232c43[_0x5bea('0x12')]));});});}; \ No newline at end of file +var _0xe23c=['model','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe23c,0x1c3));var _0xce23=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xe23c[_0x1d8119];return _0x3e30f6;};'use strict';var _=require(_0xce23('0x0'));var util=require(_0xce23('0x1'));var moment=require(_0xce23('0x2'));var BPromise=require(_0xce23('0x3'));var rs=require(_0xce23('0x4'));var fs=require('fs');var Redis=require(_0xce23('0x5'));var db=require(_0xce23('0x6'))['db'];var utils=require(_0xce23('0x7'));var logger=require(_0xce23('0x8'))(_0xce23('0x9'));var config=require('../../config/environment');var jayson=require(_0xce23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52b01d,_0x1e8042,_0x215a7d){return new BPromise(function(_0x13f1b4,_0x55358b){return client['request'](_0x52b01d,_0x215a7d)[_0xce23('0xb')](function(_0x2870b5){logger[_0xce23('0xc')](_0xce23('0xd'),_0x1e8042,'request\x20sent');logger[_0xce23('0xe')](_0xce23('0xf'),_0x1e8042,_0xce23('0x10'),JSON['stringify'](_0x2870b5));if(_0x2870b5['error']){if(_0x2870b5[_0xce23('0x11')][_0xce23('0x12')]===0x1f4){logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x2870b5[_0xce23('0x11')]['message']);return _0x55358b(_0x2870b5[_0xce23('0x11')][_0xce23('0x13')]);}logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x2870b5['error']['message']);return _0x13f1b4(_0x2870b5[_0xce23('0x11')][_0xce23('0x13')]);}else{logger[_0xce23('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1e8042,_0xce23('0x10'));_0x13f1b4(_0x2870b5['result']['message']);}})[_0xce23('0x14')](function(_0x25fb5a){logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x25fb5a);_0x55358b(_0x25fb5a);});});}exports[_0xce23('0x15')]=function(_0x2aeb31){var _0x4caefd=this;return new Promise(function(_0x4a0779,_0x508110){return db[_0xce23('0x16')]['findAll']({'raw':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x18')]===undefined?!![]:![]:!![],'where':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31['options'][_0xce23('0x19')]||null:null,'attributes':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31['options'][_0xce23('0x1a')]||null:null,'limit':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x1b')]||null:null,'include':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x2aeb31[_0xce23('0x17')]['include'],function(_0x285b28){return{'model':db[_0x285b28[_0xce23('0x1e')]],'as':_0x285b28['as'],'attributes':_0x285b28[_0xce23('0x1a')],'include':_0x285b28[_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x285b28[_0xce23('0x1c')],function(_0x4032ef){return{'model':db[_0x4032ef['model']],'as':_0x4032ef['as'],'attributes':_0x4032ef[_0xce23('0x1a')],'include':_0x4032ef[_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x4032ef[_0xce23('0x1c')],function(_0x4c0be0){return{'model':db[_0x4c0be0[_0xce23('0x1e')]],'as':_0x4c0be0['as'],'attributes':_0x4c0be0[_0xce23('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52b892){logger[_0xce23('0xc')](_0xce23('0x15'),_0x2aeb31);logger[_0xce23('0xe')](_0xce23('0x15'),_0x2aeb31,JSON[_0xce23('0x1f')](_0x52b892));_0x4a0779(_0x52b892);})[_0xce23('0x14')](function(_0x80f4d7){logger[_0xce23('0x11')]('GetVoiceCallReport',_0x80f4d7['message'],_0x2aeb31);_0x508110(_0x4caefd[_0xce23('0x11')](0x1f4,_0x80f4d7[_0xce23('0x13')]));});});};exports[_0xce23('0x20')]=function(_0x1f7e1d){var _0x55d987=this;return new Promise(function(_0x306278,_0x259c04){return db[_0xce23('0x16')][_0xce23('0x21')](_0x1f7e1d['body'],{'raw':_0x1f7e1d['options']?_0x1f7e1d['options'][_0xce23('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x111847){logger['info'](_0xce23('0x20'),_0x1f7e1d);logger['debug'](_0xce23('0x20'),_0x1f7e1d,JSON['stringify'](_0x111847));_0x306278(_0x111847);})['catch'](function(_0x36f795){logger[_0xce23('0x11')](_0xce23('0x20'),_0x36f795[_0xce23('0x13')],_0x1f7e1d);_0x259c04(_0x55d987[_0xce23('0x11')](0x1f4,_0x36f795[_0xce23('0x13')]));});});};exports[_0xce23('0x22')]=function(_0x58149e){var _0x3a7d31=this;return new Promise(function(_0x1b570f,_0x18cc29){return db['VoiceCallReport'][_0xce23('0x23')](_0x58149e[_0xce23('0x24')],{'raw':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')][_0xce23('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')]['where']||null:null,'attributes':_0x58149e['options']?_0x58149e['options']['attributes']||null:null,'limit':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')][_0xce23('0x1b')]||null:null})['then'](function(_0x4b6460){logger[_0xce23('0xc')]('UpdateVoiceCallReport',_0x58149e);logger[_0xce23('0xe')](_0xce23('0x22'),_0x58149e,JSON[_0xce23('0x1f')](_0x4b6460));_0x1b570f(_0x4b6460);})[_0xce23('0x14')](function(_0x16c80e){logger['error']('UpdateVoiceCallReport',_0x16c80e[_0xce23('0x13')],_0x58149e);_0x18cc29(_0x3a7d31[_0xce23('0x11')](0x1f4,_0x16c80e[_0xce23('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d91b0a7..ffbb7f0 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 _0x3e93=['./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e93,0xdd));var _0x33e9=function(_0x4e5564,_0x8c8c66){_0x4e5564=_0x4e5564-0x0;var _0x5ed04b=_0x3e93[_0x4e5564];return _0x5ed04b;};'use strict';var multer=require(_0x33e9('0x0'));var util=require(_0x33e9('0x1'));var path=require(_0x33e9('0x2'));var timeout=require(_0x33e9('0x3'));var express=require(_0x33e9('0x4'));var router=express[_0x33e9('0x5')]();var fs_extra=require(_0x33e9('0x6'));var auth=require(_0x33e9('0x7'));var interaction=require(_0x33e9('0x8'));var config=require(_0x33e9('0x9'));var controller=require(_0x33e9('0xa'));router[_0x33e9('0xb')]('/',auth[_0x33e9('0xc')](),controller[_0x33e9('0xd')]);router[_0x33e9('0xb')]('/:id',auth[_0x33e9('0xc')](),controller[_0x33e9('0xe')]);router[_0x33e9('0xf')]('/',auth['isAuthenticated'](),controller[_0x33e9('0x10')]);router[_0x33e9('0x11')](_0x33e9('0x12'),auth[_0x33e9('0xc')](),controller['update']);router[_0x33e9('0x13')](_0x33e9('0x12'),auth[_0x33e9('0xc')](),controller['destroy']);module[_0x33e9('0x14')]=router; \ No newline at end of file +var _0x8237=['show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x8237,0x127));var _0x7823=function(_0x44d057,_0x26a1eb){_0x44d057=_0x44d057-0x0;var _0x54fe4f=_0x8237[_0x44d057];return _0x54fe4f;};'use strict';var multer=require(_0x7823('0x0'));var util=require('util');var path=require(_0x7823('0x1'));var timeout=require(_0x7823('0x2'));var express=require(_0x7823('0x3'));var router=express[_0x7823('0x4')]();var fs_extra=require(_0x7823('0x5'));var auth=require(_0x7823('0x6'));var interaction=require(_0x7823('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x7823('0x8')]('/',auth[_0x7823('0x9')](),controller['index']);router[_0x7823('0x8')](_0x7823('0xa'),auth[_0x7823('0x9')](),controller[_0x7823('0xb')]);router[_0x7823('0xc')]('/',auth[_0x7823('0x9')](),controller[_0x7823('0xd')]);router[_0x7823('0xe')](_0x7823('0xa'),auth[_0x7823('0x9')](),controller[_0x7823('0xf')]);router[_0x7823('0x10')]('/:id',auth[_0x7823('0x9')](),controller['destroy']);module[_0x7823('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 49defe4..741b972 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 _0xee3c=['join','getDataValue','options','split','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x1336e7,_0x51dfdd){var _0x3be3da=function(_0x58c6d0){while(--_0x58c6d0){_0x1336e7['push'](_0x1336e7['shift']());}};_0x3be3da(++_0x51dfdd);}(_0xee3c,0x11c));var _0xcee3=function(_0x1c0ce8,_0x483b65){_0x1c0ce8=_0x1c0ce8-0x0;var _0x33bd9b=_0xee3c[_0x1c0ce8];return _0x33bd9b;};'use strict';var Sequelize=require(_0xcee3('0x0'));module['exports']={'name':{'type':Sequelize[_0xcee3('0x1')]},'prefix':{'type':Sequelize[_0xcee3('0x1')],'unique':_0xcee3('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x3505fe){this[_0xcee3('0x3')]('options',_0x3505fe?_0x3505fe[_0xcee3('0x4')](''):[]);},'get':function(){return this[_0xcee3('0x5')]('options')?this[_0xcee3('0x5')](_0xcee3('0x6'))[_0xcee3('0x7')](''):[];}},'auth':{'type':Sequelize[_0xcee3('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xcee3('0x1')]},'record':{'type':Sequelize[_0xcee3('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xcee3('0x1')]},'description':{'type':Sequelize[_0xcee3('0x1')]}}; \ No newline at end of file +var _0x54a9=['STRING','name','options','join','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x54a9,0x136));var _0x954a=function(_0x144945,_0xd1d8e9){_0x144945=_0x144945-0x0;var _0x58f717=_0x54a9[_0x144945];return _0x58f717;};'use strict';var Sequelize=require(_0x954a('0x0'));module[_0x954a('0x1')]={'name':{'type':Sequelize[_0x954a('0x2')]},'prefix':{'type':Sequelize[_0x954a('0x2')],'unique':_0x954a('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1cacce){this['setDataValue'](_0x954a('0x4'),_0x1cacce?_0x1cacce[_0x954a('0x5')](''):[]);},'get':function(){return this[_0x954a('0x6')](_0x954a('0x4'))?this['getDataValue'](_0x954a('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x954a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x954a('0x2')]},'record':{'type':Sequelize[_0x954a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x954a('0x2')]},'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 942e883..0d4af46 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 _0x1da6=['sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x1da6,0x7c));var _0x61da=function(_0x20ae3b,_0x23a21c){_0x20ae3b=_0x20ae3b-0x0;var _0x391475=_0x1da6[_0x20ae3b];return _0x391475;};'use strict';var emlformat=require(_0x61da('0x0'));var rimraf=require(_0x61da('0x1'));var zipdir=require(_0x61da('0x2'));var jsonpatch=require(_0x61da('0x3'));var rp=require(_0x61da('0x4'));var moment=require(_0x61da('0x5'));var BPromise=require(_0x61da('0x6'));var Mustache=require(_0x61da('0x7'));var util=require(_0x61da('0x8'));var path=require(_0x61da('0x9'));var sox=require(_0x61da('0xa'));var csv=require(_0x61da('0xb'));var ejs=require(_0x61da('0xc'));var fs=require('fs');var fs_extra=require(_0x61da('0xd'));var _=require(_0x61da('0xe'));var squel=require(_0x61da('0xf'));var crypto=require(_0x61da('0x10'));var jsforce=require(_0x61da('0x11'));var deskjs=require(_0x61da('0x12'));var toCsv=require(_0x61da('0xb'));var querystring=require('querystring');var Papa=require(_0x61da('0x13'));var Redis=require(_0x61da('0x14'));var authService=require(_0x61da('0x15'));var qs=require(_0x61da('0x16'));var as=require(_0x61da('0x17'));var hardwareService=require(_0x61da('0x18'));var logger=require(_0x61da('0x19'))(_0x61da('0x1a'));var utils=require(_0x61da('0x1b'));var config=require(_0x61da('0x1c'));var licenseUtil=require(_0x61da('0x1d'));var db=require(_0x61da('0x1e'))['db'];function respondWithStatusCode(_0x1eb368,_0x1036e4){_0x1036e4=_0x1036e4||0xcc;return function(_0x43ec70){if(_0x43ec70){return _0x1eb368['sendStatus'](_0x1036e4);}return _0x1eb368[_0x61da('0x1f')](_0x1036e4)[_0x61da('0x20')]();};}function respondWithResult(_0x191033,_0x472abc){_0x472abc=_0x472abc||0xc8;return function(_0x55eef1){if(_0x55eef1){return _0x191033[_0x61da('0x1f')](_0x472abc)['json'](_0x55eef1);}};}function respondWithFilteredResult(_0x21a5fc,_0x6d24b7){return function(_0x4a0aea){if(_0x4a0aea){var _0x53f3a4=typeof _0x6d24b7[_0x61da('0x21')]===_0x61da('0x22')&&typeof _0x6d24b7[_0x61da('0x23')]===_0x61da('0x22');var _0x2ac3aa=_0x4a0aea[_0x61da('0x24')];var _0x505b1c=_0x53f3a4?0x0:_0x6d24b7[_0x61da('0x21')];var _0x34a678=_0x53f3a4?_0x4a0aea[_0x61da('0x24')]:_0x6d24b7[_0x61da('0x21')]+_0x6d24b7['limit'];var _0x1a0e6e;if(_0x34a678>=_0x2ac3aa){_0x34a678=_0x2ac3aa;_0x1a0e6e=0xc8;}else{_0x1a0e6e=0xce;}_0x21a5fc[_0x61da('0x1f')](_0x1a0e6e);return _0x21a5fc[_0x61da('0x25')](_0x61da('0x26'),_0x505b1c+'-'+_0x34a678+'/'+_0x2ac3aa)['json'](_0x4a0aea);}return null;};}function patchUpdates(_0x22b8bc){return function(_0x5c0363){try{jsonpatch[_0x61da('0x27')](_0x5c0363,_0x22b8bc,!![]);}catch(_0x172066){return BPromise[_0x61da('0x28')](_0x172066);}return _0x5c0363[_0x61da('0x29')]();};}function saveUpdates(_0x1868af,_0x129bb0){return function(_0x30c6f8){if(_0x30c6f8){return _0x30c6f8[_0x61da('0x2a')](_0x1868af)[_0x61da('0x2b')](function(_0x325e28){return _0x325e28;});}return null;};}function removeEntity(_0x56f5d2,_0x2c9e83){return function(_0x35550a){if(_0x35550a){return _0x35550a[_0x61da('0x2c')]()[_0x61da('0x2b')](function(){var _0x254d81=_0x35550a[_0x61da('0x2d')]({'plain':!![]});var _0x4860d4=_0x61da('0x2e');return db[_0x61da('0x2f')][_0x61da('0x2c')]({'where':{'type':_0x4860d4,'resourceId':_0x254d81['id']}})[_0x61da('0x2b')](function(){return _0x35550a;});})[_0x61da('0x2b')](function(){_0x56f5d2[_0x61da('0x1f')](0xcc)[_0x61da('0x20')]();});}};}function handleEntityNotFound(_0x29b642,_0x4c1bf4){return function(_0x2746a6){if(!_0x2746a6){_0x29b642[_0x61da('0x30')](0x194);}return _0x2746a6;};}function handleError(_0x450a97,_0x13339f){_0x13339f=_0x13339f||0x1f4;return function(_0x52f486){logger[_0x61da('0x31')](_0x52f486['stack']);if(_0x52f486[_0x61da('0x32')]){delete _0x52f486[_0x61da('0x32')];}_0x450a97[_0x61da('0x1f')](_0x13339f)[_0x61da('0x33')](_0x52f486);};}exports[_0x61da('0x34')]=function(_0x3166be,_0xb97400){var _0x52d93d={},_0x46b77b={},_0x511ec7={'count':0x0,'rows':[]};var _0x5ba1ad=_[_0x61da('0x35')](db[_0x61da('0x36')][_0x61da('0x37')],function(_0x2338dd){return{'name':_0x2338dd[_0x61da('0x38')],'type':_0x2338dd['type'][_0x61da('0x39')]};});_0x46b77b[_0x61da('0x3a')]=_[_0x61da('0x35')](_0x5ba1ad,_0x61da('0x32'));_0x46b77b['query']=_[_0x61da('0x3b')](_0x3166be[_0x61da('0x3c')]);_0x46b77b['filters']=_[_0x61da('0x3d')](_0x46b77b['model'],_0x46b77b['query']);_0x52d93d['attributes']=_['intersection'](_0x46b77b['model'],qs[_0x61da('0x3e')](_0x3166be[_0x61da('0x3c')][_0x61da('0x3e')]));_0x52d93d[_0x61da('0x3f')]=_0x52d93d[_0x61da('0x3f')]['length']?_0x52d93d[_0x61da('0x3f')]:_0x46b77b[_0x61da('0x3a')];if(!_0x3166be[_0x61da('0x3c')]['hasOwnProperty'](_0x61da('0x40'))){_0x52d93d[_0x61da('0x23')]=qs[_0x61da('0x23')](_0x3166be['query'][_0x61da('0x23')]);_0x52d93d[_0x61da('0x21')]=qs[_0x61da('0x21')](_0x3166be[_0x61da('0x3c')][_0x61da('0x21')]);}_0x52d93d['order']=qs[_0x61da('0x41')](_0x3166be[_0x61da('0x3c')][_0x61da('0x41')]);_0x52d93d[_0x61da('0x42')]=qs[_0x61da('0x43')](_['pick'](_0x3166be['query'],_0x46b77b['filters']),_0x5ba1ad);if(_0x3166be[_0x61da('0x3c')][_0x61da('0x44')]){_0x52d93d[_0x61da('0x42')]=_[_0x61da('0x45')](_0x52d93d[_0x61da('0x42')],{'$or':_[_0x61da('0x35')](_0x5ba1ad,function(_0x349da8){if(_0x349da8['type']!==_0x61da('0x46')){var _0x669497={};_0x669497[_0x349da8['name']]={'$like':'%'+_0x3166be[_0x61da('0x3c')][_0x61da('0x44')]+'%'};return _0x669497;}})});}_0x52d93d=_[_0x61da('0x45')]({},_0x52d93d,_0x3166be['options']);var _0x397fc1={'where':_0x52d93d['where']};return db[_0x61da('0x36')][_0x61da('0x24')](_0x397fc1)[_0x61da('0x2b')](function(_0x40d4a2){_0x511ec7['count']=_0x40d4a2;if(_0x3166be[_0x61da('0x3c')][_0x61da('0x47')]){_0x52d93d[_0x61da('0x48')]=[{'all':!![]}];}return db[_0x61da('0x36')][_0x61da('0x49')](_0x52d93d);})[_0x61da('0x2b')](function(_0x1dd879){_0x511ec7[_0x61da('0x4a')]=_0x1dd879;return _0x511ec7;})[_0x61da('0x2b')](respondWithFilteredResult(_0xb97400,_0x52d93d))[_0x61da('0x4b')](handleError(_0xb97400,null));};exports['show']=function(_0x3032eb,_0x3799a8){var _0x5af6fb={'raw':![],'where':{'id':_0x3032eb[_0x61da('0x4c')]['id']}},_0x46e899={};_0x46e899[_0x61da('0x3a')]=_[_0x61da('0x3b')](db[_0x61da('0x36')]['rawAttributes']);_0x46e899['query']=_[_0x61da('0x3b')](_0x3032eb[_0x61da('0x3c')]);_0x46e899[_0x61da('0x43')]=_[_0x61da('0x3d')](_0x46e899[_0x61da('0x3a')],_0x46e899['query']);_0x5af6fb[_0x61da('0x3f')]=_[_0x61da('0x3d')](_0x46e899[_0x61da('0x3a')],qs[_0x61da('0x3e')](_0x3032eb[_0x61da('0x3c')][_0x61da('0x3e')]));_0x5af6fb[_0x61da('0x3f')]=_0x5af6fb[_0x61da('0x3f')][_0x61da('0x4d')]?_0x5af6fb['attributes']:_0x46e899[_0x61da('0x3a')];if(_0x3032eb[_0x61da('0x3c')][_0x61da('0x47')]){_0x5af6fb[_0x61da('0x48')]=[{'all':!![]}];}_0x5af6fb=_['merge']({},_0x5af6fb,_0x3032eb[_0x61da('0x4e')]);return db[_0x61da('0x36')][_0x61da('0x4f')](_0x5af6fb)[_0x61da('0x2b')](handleEntityNotFound(_0x3799a8,null))[_0x61da('0x2b')](respondWithResult(_0x3799a8,null))['catch'](handleError(_0x3799a8,null));};exports[_0x61da('0x50')]=function(_0x5b3dee,_0x584ddd){return db[_0x61da('0x36')][_0x61da('0x50')](_0x5b3dee['body'],{})[_0x61da('0x2b')](function(_0x1c2ed5){var _0x30f4a3=_0x5b3dee['user'][_0x61da('0x2d')]({'plain':!![]});if(!_0x30f4a3)throw new Error(_0x61da('0x51'));if(_0x30f4a3[_0x61da('0x52')]===_0x61da('0x53')){var _0x4dd6fb=_0x1c2ed5[_0x61da('0x2d')]({'plain':!![]});var _0x537ded=_0x61da('0x2e');return db['UserProfileSection'][_0x61da('0x4f')]({'where':{'name':_0x537ded,'userProfileId':_0x30f4a3[_0x61da('0x54')]},'raw':!![]})[_0x61da('0x2b')](function(_0x14313e){if(_0x14313e&&_0x14313e['autoAssociation']===0x0){return db[_0x61da('0x2f')][_0x61da('0x50')]({'name':_0x4dd6fb[_0x61da('0x32')],'resourceId':_0x4dd6fb['id'],'type':_0x14313e[_0x61da('0x32')],'sectionId':_0x14313e['id']},{})[_0x61da('0x2b')](function(){return _0x1c2ed5;});}else{return _0x1c2ed5;}})[_0x61da('0x4b')](function(_0x184038){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x184038);throw _0x184038;});}return _0x1c2ed5;})['then'](respondWithResult(_0x584ddd,0xc9))[_0x61da('0x4b')](handleError(_0x584ddd,null));};exports[_0x61da('0x2a')]=function(_0x569b93,_0x531562){if(_0x569b93[_0x61da('0x55')]['id']){delete _0x569b93[_0x61da('0x55')]['id'];}return db[_0x61da('0x36')][_0x61da('0x4f')]({'where':{'id':_0x569b93[_0x61da('0x4c')]['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x531562,null))[_0x61da('0x2b')](saveUpdates(_0x569b93['body'],null))['then'](respondWithResult(_0x531562,null))[_0x61da('0x4b')](handleError(_0x531562,null));};exports[_0x61da('0x2c')]=function(_0x10e125,_0x3a5361){return db[_0x61da('0x36')][_0x61da('0x4f')]({'where':{'id':_0x10e125[_0x61da('0x4c')]['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x3a5361,null))[_0x61da('0x2b')](removeEntity(_0x3a5361,null))[_0x61da('0x4b')](handleError(_0x3a5361,null));}; \ No newline at end of file +var _0xbdb7=['../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','include','find','create','body','role','user','get','ChanSpies','UserProfileSection','userProfileId','autoAssociation','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x517a99,_0x381cdc){var _0x3a106b=function(_0x51c64f){while(--_0x51c64f){_0x517a99['push'](_0x517a99['shift']());}};_0x3a106b(++_0x381cdc);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4766f2,_0x38b8a1){_0x4766f2=_0x4766f2-0x0;var _0xe746c2=_0xbdb7[_0x4766f2];return _0xe746c2;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){var _0x3c423f=_0x3a456f['get']({'plain':!![]});var _0x47abaf='ChanSpies';return db[_0x7bdb('0x23')]['destroy']({'where':{'type':_0x47abaf,'resourceId':_0x3c423f['id']}})[_0x7bdb('0x24')](function(){return _0x3a456f;});})[_0x7bdb('0x24')](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)[_0x7bdb('0x17')]();});}};}function handleEntityNotFound(_0x2a494e,_0x523869){return function(_0x10e818){if(!_0x10e818){_0x2a494e[_0x7bdb('0x25')](0x194);}return _0x10e818;};}function handleError(_0x399b62,_0xe1141d){_0xe1141d=_0xe1141d||0x1f4;return function(_0x371e8a){logger[_0x7bdb('0x26')](_0x371e8a[_0x7bdb('0x27')]);if(_0x371e8a[_0x7bdb('0x28')]){delete _0x371e8a[_0x7bdb('0x28')];}_0x399b62[_0x7bdb('0x1d')](_0xe1141d)[_0x7bdb('0x29')](_0x371e8a);};}exports[_0x7bdb('0x2a')]=function(_0x5b386d,_0x388a45){var _0x23fc3a={},_0x8f7672={},_0x9f5c1={'count':0x0,'rows':[]};var _0x29eac5=_['map'](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')],function(_0x9ac56){return{'name':_0x9ac56[_0x7bdb('0x2d')],'type':_0x9ac56['type']['key']};});_0x8f7672['model']=_[_0x7bdb('0x2e')](_0x29eac5,'name');_0x8f7672[_0x7bdb('0x2f')]=_['keys'](_0x5b386d[_0x7bdb('0x2f')]);_0x8f7672[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x8f7672['model'],_0x8f7672[_0x7bdb('0x2f')]);_0x23fc3a['attributes']=_['intersection'](_0x8f7672[_0x7bdb('0x32')],qs['fields'](_0x5b386d[_0x7bdb('0x2f')]['fields']));_0x23fc3a['attributes']=_0x23fc3a[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x23fc3a[_0x7bdb('0x33')]:_0x8f7672[_0x7bdb('0x32')];if(!_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x35')]('nolimit')){_0x23fc3a[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);_0x23fc3a[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x19')]);}_0x23fc3a[_0x7bdb('0x36')]=qs['sort'](_0x5b386d['query'][_0x7bdb('0x37')]);_0x23fc3a[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x5b386d[_0x7bdb('0x2f')],_0x8f7672['filters']),_0x29eac5);if(_0x5b386d['query'][_0x7bdb('0x3a')]){_0x23fc3a['where']=_[_0x7bdb('0x3b')](_0x23fc3a['where'],{'$or':_[_0x7bdb('0x2e')](_0x29eac5,function(_0x5d1826){if(_0x5d1826['type']!==_0x7bdb('0x3c')){var _0x2d578e={};_0x2d578e[_0x5d1826[_0x7bdb('0x28')]]={'$like':'%'+_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x2d578e;}})});}_0x23fc3a=_[_0x7bdb('0x3b')]({},_0x23fc3a,_0x5b386d[_0x7bdb('0x3d')]);var _0x501aff={'where':_0x23fc3a['where']};return db[_0x7bdb('0x2b')][_0x7bdb('0x1c')](_0x501aff)[_0x7bdb('0x24')](function(_0x3509e4){_0x9f5c1[_0x7bdb('0x1c')]=_0x3509e4;if(_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x23fc3a['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x7bdb('0x3f')](_0x23fc3a);})[_0x7bdb('0x24')](function(_0x4636f8){_0x9f5c1[_0x7bdb('0x40')]=_0x4636f8;return _0x9f5c1;})['then'](respondWithFilteredResult(_0x388a45,_0x23fc3a))[_0x7bdb('0x41')](handleError(_0x388a45,null));};exports['show']=function(_0x37029b,_0x27de25){var _0x218361={'raw':![],'where':{'id':_0x37029b[_0x7bdb('0x42')]['id']}},_0x264f3a={};_0x264f3a[_0x7bdb('0x32')]=_[_0x7bdb('0x43')](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')]);_0x264f3a['query']=_[_0x7bdb('0x43')](_0x37029b[_0x7bdb('0x2f')]);_0x264f3a['filters']=_[_0x7bdb('0x31')](_0x264f3a['model'],_0x264f3a[_0x7bdb('0x2f')]);_0x218361[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x264f3a[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x37029b['query'][_0x7bdb('0x44')]));_0x218361[_0x7bdb('0x33')]=_0x218361[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x218361[_0x7bdb('0x33')]:_0x264f3a['model'];if(_0x37029b[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x218361[_0x7bdb('0x45')]=[{'all':!![]}];}_0x218361=_[_0x7bdb('0x3b')]({},_0x218361,_0x37029b[_0x7bdb('0x3d')]);return db[_0x7bdb('0x2b')][_0x7bdb('0x46')](_0x218361)[_0x7bdb('0x24')](handleEntityNotFound(_0x27de25,null))[_0x7bdb('0x24')](respondWithResult(_0x27de25,null))[_0x7bdb('0x41')](handleError(_0x27de25,null));};exports['create']=function(_0x189cf8,_0x58c4bc){return db['VoiceChanSpy'][_0x7bdb('0x47')](_0x189cf8[_0x7bdb('0x48')],{})['then'](function(_0x37780a){var _0x186809=_0x189cf8['user']['get']({'plain':!![]});if(!_0x186809)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186809[_0x7bdb('0x49')]===_0x7bdb('0x4a')){var _0x2fab74=_0x37780a[_0x7bdb('0x4b')]({'plain':!![]});var _0x33687b=_0x7bdb('0x4c');return db[_0x7bdb('0x4d')][_0x7bdb('0x46')]({'where':{'name':_0x33687b,'userProfileId':_0x186809[_0x7bdb('0x4e')]},'raw':!![]})[_0x7bdb('0x24')](function(_0x5a8d4a){if(_0x5a8d4a&&_0x5a8d4a[_0x7bdb('0x4f')]===0x0){return db['UserProfileResource'][_0x7bdb('0x47')]({'name':_0x2fab74[_0x7bdb('0x28')],'resourceId':_0x2fab74['id'],'type':_0x5a8d4a[_0x7bdb('0x28')],'sectionId':_0x5a8d4a['id']},{})[_0x7bdb('0x24')](function(){return _0x37780a;});}else{return _0x37780a;}})['catch'](function(_0x258f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258f29);throw _0x258f29;});}return _0x37780a;})[_0x7bdb('0x24')](respondWithResult(_0x58c4bc,0xc9))[_0x7bdb('0x41')](handleError(_0x58c4bc,null));};exports['update']=function(_0x4e17f3,_0x49bb3f){if(_0x4e17f3[_0x7bdb('0x48')]['id']){delete _0x4e17f3['body']['id'];}return db['VoiceChanSpy'][_0x7bdb('0x46')]({'where':{'id':_0x4e17f3[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x49bb3f,null))[_0x7bdb('0x24')](saveUpdates(_0x4e17f3['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x49bb3f,null))['catch'](handleError(_0x49bb3f,null));};exports[_0x7bdb('0x50')]=function(_0x7f2d89,_0x82f990){return db[_0x7bdb('0x2b')][_0x7bdb('0x46')]({'where':{'id':_0x7f2d89[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x82f990,null))[_0x7bdb('0x24')](removeEntity(_0x82f990,null))[_0x7bdb('0x41')](handleError(_0x82f990,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a4a50be..7cfbfb6 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 _0x3af2=['agent','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','CDR(type)=%s','record','${UNIQUEID}.%s,a','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','options','length','concat','internal','name','User','findAll'];(function(_0x48e903,_0x33ac6f){var _0x42d1d3=function(_0x56f235){while(--_0x56f235){_0x48e903['push'](_0x48e903['shift']());}};_0x42d1d3(++_0x33ac6f);}(_0x3af2,0xb9));var _0x23af=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3af2[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x23af('0x0'));var BPromise=require(_0x23af('0x1'));var attributes=require(_0x23af('0x2'));var getUserApplications=function(_0x5e56e2,_0x39d3e7,_0x2b169b){var _0x7744ac=0x1;var _0x30f87c=[];var _0x235d77={'context':_0x39d3e7[_0x23af('0x3')]||_0x23af('0x4'),'exten':util[_0x23af('0x5')](_0x23af('0x6'),_0x5e56e2['prefix'],_0x2b169b),'type':_0x23af('0x7'),'isApp':![],'ChanSpyId':_0x5e56e2['id'],'UserId':_0x39d3e7['id']};_0x30f87c[_0x23af('0x8')](_['merge']({'app':'Set','appdata':util[_0x23af('0x5')](_0x23af('0x9'),'chanspy'),'priority':_0x7744ac++},_0x235d77));if(_0x5e56e2[_0x23af('0xa')]){_0x30f87c[_0x23af('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0x23af('0x5')](_0x23af('0xb'),_0x5e56e2['recordingFormat']),'priority':_0x7744ac++},_0x235d77));}if(_0x5e56e2[_0x23af('0xc')]){_0x30f87c[_0x23af('0x8')](_[_0x23af('0xd')]({'app':_0x23af('0xe'),'appdata':_0x5e56e2[_0x23af('0xf')],'priority':_0x7744ac++},_0x235d77));}_0x30f87c['push'](_[_0x23af('0xd')]({'app':_0x23af('0x10'),'appdata':util[_0x23af('0x5')](_0x23af('0x11'),_0x39d3e7['name'],_0x5e56e2['options']?_0x5e56e2[_0x23af('0x12')]['join'](''):''),'priority':_0x7744ac++},_0x235d77));if(_0x5e56e2[_0x23af('0xa')]){_0x30f87c[_0x23af('0x8')](_[_0x23af('0xd')]({'app':'StopMixMonitor','priority':_0x7744ac++},_0x235d77));}return _0x30f87c;};var getChanSpyApplications=function(_0x58c894,_0x4eef16){var _0x2570cc=[];for(var _0x325a52=0x0,_0x57bdb2=0x1;_0x325a52<_0x4eef16[_0x23af('0x13')];_0x325a52++,_0x57bdb2=0x1){_0x2570cc=_0x2570cc[_0x23af('0x14')](getUserApplications(_0x58c894,_0x4eef16[_0x325a52],_0x4eef16[_0x325a52][_0x23af('0x15')]));if(_0x4eef16[_0x325a52]['internal']!=_0x4eef16[_0x325a52][_0x23af('0x16')]){_0x2570cc=_0x2570cc[_0x23af('0x14')](getUserApplications(_0x58c894,_0x4eef16[_0x325a52],_0x4eef16[_0x325a52][_0x23af('0x16')]));}}return _0x2570cc;};var getChanSpyPromise=function(_0x23a258,_0x1c9b1a){return new BPromise(function(_0x2da171,_0x46651d){return _0x23a258[_0x23af('0x17')][_0x23af('0x18')]({'attributes':['id','name',_0x23af('0x15')],'where':{'role':_0x23af('0x19'),'chanspy':!![]},'raw':!![]})[_0x23af('0x1a')](function(_0x300b60){if(_0x300b60){return _0x2da171(getChanSpyApplications(_0x1c9b1a,_0x300b60));}return _0x2da171([]);})[_0x23af('0x1b')](function(_0x46d831){_0x46651d(_0x46d831);});});};module[_0x23af('0x1c')]=function(_0x5c6351,_0x2f2320){var _0x425ba1=_0x5c6351[_0x23af('0x1d')];return _0x5c6351[_0x23af('0x1e')](_0x23af('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x493129,_0x25d14e,_0x24b413){return getChanSpyPromise(_0x425ba1,_0x493129)[_0x23af('0x1a')](function(_0x3e2a51){if(_0x3e2a51&&_0x3e2a51[_0x23af('0x13')]){return _0x425ba1[_0x23af('0x20')][_0x23af('0x21')](_0x3e2a51);}})[_0x23af('0x1a')](function(){_0x24b413();})[_0x23af('0x1b')](function(_0x379f8b){_0x24b413(_0x379f8b);});},'afterUpdate':function(_0x1523e2,_0x3b2914,_0x25e998){return _0x425ba1[_0x23af('0x20')][_0x23af('0x22')]({'where':{'ChanSpyId':_0x1523e2['id']}})['then'](function(){return getChanSpyPromise(_0x425ba1,_0x1523e2);})[_0x23af('0x1a')](function(_0x489045){if(_0x489045&&_0x489045[_0x23af('0x13')]){return _0x425ba1[_0x23af('0x20')][_0x23af('0x21')](_0x489045);}})[_0x23af('0x1a')](function(){_0x25e998();})[_0x23af('0x1b')](function(_0x3cf8cc){_0x25e998(_0x3cf8cc);});},'afterDestroy':function(_0x54bb39,_0x540d0d,_0x1c98f9){return _0x425ba1['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x54bb39['id']}})[_0x23af('0x1a')](function(){_0x1c98f9();})['catch'](function(_0xb21df9){_0x1c98f9(_0xb21df9);});}}});}; \ No newline at end of file +var _0x5512=['define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','context','format','%s%s','prefix','system','Set','CDR(type)=%s','chanspy','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','push','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','models'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x5512,0xf1));var _0x2551=function(_0x1a7085,_0x5da85f){_0x1a7085=_0x1a7085-0x0;var _0x390d7d=_0x5512[_0x1a7085];return _0x390d7d;};'use strict';var _=require('lodash');var util=require(_0x2551('0x0'));var BPromise=require(_0x2551('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x10b999,_0x2a7415,_0x16391c){var _0x338609=0x1;var _0x168105=[];var _0x2c338a={'context':_0x2a7415[_0x2551('0x2')]||'from-sip','exten':util[_0x2551('0x3')](_0x2551('0x4'),_0x10b999[_0x2551('0x5')],_0x16391c),'type':_0x2551('0x6'),'isApp':![],'ChanSpyId':_0x10b999['id'],'UserId':_0x2a7415['id']};_0x168105['push'](_['merge']({'app':_0x2551('0x7'),'appdata':util[_0x2551('0x3')](_0x2551('0x8'),_0x2551('0x9')),'priority':_0x338609++},_0x2c338a));if(_0x10b999['record']){_0x168105['push'](_[_0x2551('0xa')]({'app':'MixMonitor','appdata':util[_0x2551('0x3')](_0x2551('0xb'),_0x10b999[_0x2551('0xc')]),'priority':_0x338609++},_0x2c338a));}if(_0x10b999[_0x2551('0xd')]){_0x168105['push'](_[_0x2551('0xa')]({'app':_0x2551('0xe'),'appdata':_0x10b999[_0x2551('0xf')],'priority':_0x338609++},_0x2c338a));}_0x168105[_0x2551('0x10')](_[_0x2551('0xa')]({'app':'ChanSpy','appdata':util[_0x2551('0x3')](_0x2551('0x11'),_0x2a7415[_0x2551('0x12')],_0x10b999[_0x2551('0x13')]?_0x10b999[_0x2551('0x13')][_0x2551('0x14')](''):''),'priority':_0x338609++},_0x2c338a));if(_0x10b999[_0x2551('0x15')]){_0x168105[_0x2551('0x10')](_[_0x2551('0xa')]({'app':_0x2551('0x16'),'priority':_0x338609++},_0x2c338a));}return _0x168105;};var getChanSpyApplications=function(_0x5a998b,_0x296dcc){var _0xe9be4b=[];for(var _0x5c03e0=0x0,_0x160b38=0x1;_0x5c03e0<_0x296dcc[_0x2551('0x17')];_0x5c03e0++,_0x160b38=0x1){_0xe9be4b=_0xe9be4b[_0x2551('0x18')](getUserApplications(_0x5a998b,_0x296dcc[_0x5c03e0],_0x296dcc[_0x5c03e0][_0x2551('0x19')]));if(_0x296dcc[_0x5c03e0][_0x2551('0x19')]!=_0x296dcc[_0x5c03e0][_0x2551('0x12')]){_0xe9be4b=_0xe9be4b[_0x2551('0x18')](getUserApplications(_0x5a998b,_0x296dcc[_0x5c03e0],_0x296dcc[_0x5c03e0]['name']));}}return _0xe9be4b;};var getChanSpyPromise=function(_0x31a740,_0x2c5107){return new BPromise(function(_0x577294,_0x39c9dd){return _0x31a740[_0x2551('0x1a')][_0x2551('0x1b')]({'attributes':['id',_0x2551('0x12'),_0x2551('0x19')],'where':{'role':_0x2551('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5625f8){if(_0x5625f8){return _0x577294(getChanSpyApplications(_0x2c5107,_0x5625f8));}return _0x577294([]);})[_0x2551('0x1d')](function(_0xd482ba){_0x39c9dd(_0xd482ba);});});};module[_0x2551('0x1e')]=function(_0x2a6534,_0x5d4054){var _0x2bb394=_0x2a6534[_0x2551('0x1f')];return _0x2a6534[_0x2551('0x20')](_0x2551('0x21'),attributes,{'tableName':_0x2551('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x149cea,_0x1b00cf,_0x381142){return getChanSpyPromise(_0x2bb394,_0x149cea)[_0x2551('0x23')](function(_0x35938e){if(_0x35938e&&_0x35938e['length']){return _0x2bb394[_0x2551('0x24')][_0x2551('0x25')](_0x35938e);}})[_0x2551('0x23')](function(){_0x381142();})[_0x2551('0x1d')](function(_0x31a31d){_0x381142(_0x31a31d);});},'afterUpdate':function(_0x36a2f4,_0x12c3d2,_0xdb6e89){return _0x2bb394[_0x2551('0x24')][_0x2551('0x26')]({'where':{'ChanSpyId':_0x36a2f4['id']}})[_0x2551('0x23')](function(){return getChanSpyPromise(_0x2bb394,_0x36a2f4);})[_0x2551('0x23')](function(_0x30c4c7){if(_0x30c4c7&&_0x30c4c7[_0x2551('0x17')]){return _0x2bb394[_0x2551('0x24')]['bulkCreate'](_0x30c4c7);}})[_0x2551('0x23')](function(){_0xdb6e89();})['catch'](function(_0x13b94c){_0xdb6e89(_0x13b94c);});},'afterDestroy':function(_0xc93f6d,_0x41133b,_0x385232){return _0x2bb394[_0x2551('0x24')][_0x2551('0x26')]({'where':{'ChanSpyId':_0xc93f6d['id']}})[_0x2551('0x23')](function(){_0x385232();})[_0x2551('0x1d')](function(_0x2ec5e0){_0x385232(_0x2ec5e0);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ea44307..c749fa5 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9aea=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x429a56,_0x24fcb6){var _0x2a4091=function(_0x5d4df6){while(--_0x5d4df6){_0x429a56['push'](_0x429a56['shift']());}};_0x2a4091(++_0x24fcb6);}(_0x9aea,0xdd));var _0xa9ae=function(_0x38ef83,_0x38caa8){_0x38ef83=_0x38ef83-0x0;var _0x1a8b24=_0x9aea[_0x38ef83];return _0x1a8b24;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});} \ No newline at end of file +var _0xb688=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x245fa6,_0x2f7ff8){var _0x225660=function(_0x48cf4b){while(--_0x48cf4b){_0x245fa6['push'](_0x245fa6['shift']());}};_0x225660(++_0x2f7ff8);}(_0xb688,0xcf));var _0x8b68=function(_0x495034,_0x480d0d){_0x495034=_0x495034-0x0;var _0x22b228=_0xb688[_0x495034];return _0x22b228;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4ad8723..0cc457a 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 _0x9bc2=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./voiceContext.controller','get'];(function(_0x5632e1,_0x310c28){var _0x4f5b42=function(_0xebc4f1){while(--_0xebc4f1){_0x5632e1['push'](_0x5632e1['shift']());}};_0x4f5b42(++_0x310c28);}(_0x9bc2,0x76));var _0x29bc=function(_0x2570fa,_0x2c1d5c){_0x2570fa=_0x2570fa-0x0;var _0x4d6a70=_0x9bc2[_0x2570fa];return _0x4d6a70;};'use strict';var multer=require(_0x29bc('0x0'));var util=require(_0x29bc('0x1'));var path=require(_0x29bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x29bc('0x3'));var router=express['Router']();var fs_extra=require(_0x29bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x29bc('0x5'));var config=require('../../config/environment');var controller=require(_0x29bc('0x6'));router[_0x29bc('0x7')]('/',auth[_0x29bc('0x8')](),controller[_0x29bc('0x9')]);router['get'](_0x29bc('0xa'),auth[_0x29bc('0x8')](),controller[_0x29bc('0xb')]);router[_0x29bc('0xc')]('/',auth[_0x29bc('0x8')](),controller[_0x29bc('0xd')]);router[_0x29bc('0xe')]('/:id',auth[_0x29bc('0x8')](),controller[_0x29bc('0xf')]);router[_0x29bc('0x10')]('/:id',auth[_0x29bc('0x8')](),controller['destroy']);module[_0x29bc('0x11')]=router; \ No newline at end of file +var _0x8388=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8388,0x10a));var _0x8838=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x8388[_0x764874];return _0x29f9d5;};'use strict';var multer=require('multer');var util=require(_0x8838('0x0'));var path=require(_0x8838('0x1'));var timeout=require('connect-timeout');var express=require(_0x8838('0x2'));var router=express[_0x8838('0x3')]();var fs_extra=require(_0x8838('0x4'));var auth=require(_0x8838('0x5'));var interaction=require(_0x8838('0x6'));var config=require(_0x8838('0x7'));var controller=require('./voiceContext.controller');router[_0x8838('0x8')]('/',auth[_0x8838('0x9')](),controller[_0x8838('0xa')]);router[_0x8838('0x8')]('/:id',auth[_0x8838('0x9')](),controller[_0x8838('0xb')]);router['post']('/',auth[_0x8838('0x9')](),controller[_0x8838('0xc')]);router[_0x8838('0xd')](_0x8838('0xe'),auth[_0x8838('0x9')](),controller[_0x8838('0xf')]);router[_0x8838('0x10')](_0x8838('0xe'),auth['isAuthenticated'](),controller[_0x8838('0x11')]);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 9e33e45..f9d4bde 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 _0x8098=['name','BOOLEAN','exports'];(function(_0x140a04,_0x57431d){var _0x203b10=function(_0x5b86a7){while(--_0x5b86a7){_0x140a04['push'](_0x140a04['shift']());}};_0x203b10(++_0x57431d);}(_0x8098,0x17c));var _0x8809=function(_0x53144f,_0x536f37){_0x53144f=_0x53144f-0x0;var _0x19b52b=_0x8098[_0x53144f];return _0x19b52b;};'use strict';var Sequelize=require('sequelize');module[_0x8809('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8809('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8809('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ce4=['STRING','exports','name'];(function(_0x1ffdd3,_0x7b3e5a){var _0x2d145f=function(_0x3d80ff){while(--_0x3d80ff){_0x1ffdd3['push'](_0x1ffdd3['shift']());}};_0x2d145f(++_0x7b3e5a);}(_0x4ce4,0x1de));var _0x44ce=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x4ce4[_0x3d1244];return _0x5d6372;};'use strict';var Sequelize=require('sequelize');module[_0x44ce('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x44ce('0x1')},'description':{'type':Sequelize[_0x44ce('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index f042f47..02b8fb5 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 _0xec52=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','writeFileSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','offset','limit','undefined','count','Content-Range','json','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','VoiceContext','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','show','params','keys','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','Contexts'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0xec52,0x6b));var _0x2ec5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xec52[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ec5('0x0'));var zipdir=require(_0x2ec5('0x1'));var jsonpatch=require(_0x2ec5('0x2'));var rp=require(_0x2ec5('0x3'));var moment=require(_0x2ec5('0x4'));var BPromise=require(_0x2ec5('0x5'));var Mustache=require(_0x2ec5('0x6'));var util=require(_0x2ec5('0x7'));var path=require(_0x2ec5('0x8'));var sox=require(_0x2ec5('0x9'));var csv=require('to-csv');var ejs=require(_0x2ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x2ec5('0xb'));var _=require(_0x2ec5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ec5('0xd'));var querystring=require(_0x2ec5('0xe'));var Papa=require('papaparse');var Redis=require(_0x2ec5('0xf'));var authService=require(_0x2ec5('0x10'));var qs=require(_0x2ec5('0x11'));var as=require(_0x2ec5('0x12'));var hardwareService=require(_0x2ec5('0x13'));var logger=require(_0x2ec5('0x14'))(_0x2ec5('0x15'));var utils=require('../../config/utils');var config=require(_0x2ec5('0x16'));var licenseUtil=require(_0x2ec5('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2ec5('0x18'));var client=jayson[_0x2ec5('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47ce04,_0x31c55b,_0x4afb62,_0x4d97fc){return new BPromise(function(_0x185606,_0x341d09){var _0x52e1f6=_0x4d97fc||client;return _0x52e1f6[_0x2ec5('0x1a')](_0x47ce04,_0x4afb62)[_0x2ec5('0x1b')](function(_0x50ce41){logger[_0x2ec5('0x1c')](_0x2ec5('0x1d'),_0x31c55b,_0x2ec5('0x1e'));logger[_0x2ec5('0x1f')](_0x2ec5('0x20'),_0x31c55b,_0x2ec5('0x1e'),JSON[_0x2ec5('0x21')](_0x50ce41));if(_0x50ce41['error']){if(_0x50ce41[_0x2ec5('0x22')]['code']===0x1f4){logger[_0x2ec5('0x22')](_0x2ec5('0x1d'),_0x31c55b,_0x50ce41[_0x2ec5('0x22')][_0x2ec5('0x23')]);return _0x341d09(_0x50ce41[_0x2ec5('0x22')][_0x2ec5('0x23')]);}logger[_0x2ec5('0x22')]('VoiceContext,\x20%s,\x20%s',_0x31c55b,_0x50ce41[_0x2ec5('0x22')][_0x2ec5('0x23')]);return _0x185606(_0x50ce41[_0x2ec5('0x22')][_0x2ec5('0x23')]);}else{logger[_0x2ec5('0x1c')](_0x2ec5('0x1d'),_0x31c55b,'request\x20sent');_0x185606(_0x50ce41[_0x2ec5('0x24')]['message']);}})[_0x2ec5('0x25')](function(_0x327020){logger['error']('VoiceContext,\x20%s,\x20%s',_0x31c55b,_0x327020);_0x341d09(_0x327020);});});}function respondWithStatusCode(_0x2ea17e,_0x1d0890){_0x1d0890=_0x1d0890||0xcc;return function(_0x33c2f4){if(_0x33c2f4){return _0x2ea17e['sendStatus'](_0x1d0890);}return _0x2ea17e[_0x2ec5('0x26')](_0x1d0890)['end']();};}function respondWithResult(_0x3f6167,_0x3c12c2){_0x3c12c2=_0x3c12c2||0xc8;return function(_0xe1cf8){if(_0xe1cf8){return _0x3f6167['status'](_0x3c12c2)['json'](_0xe1cf8);}};}function respondWithFilteredResult(_0x157eed,_0xbea3d4){return function(_0x3a6d94){if(_0x3a6d94){var _0xdf619d=typeof _0xbea3d4[_0x2ec5('0x27')]==='undefined'&&typeof _0xbea3d4[_0x2ec5('0x28')]===_0x2ec5('0x29');var _0x6dd34=_0x3a6d94[_0x2ec5('0x2a')];var _0x4a5743=_0xdf619d?0x0:_0xbea3d4[_0x2ec5('0x27')];var _0x4d6f8d=_0xdf619d?_0x3a6d94[_0x2ec5('0x2a')]:_0xbea3d4['offset']+_0xbea3d4['limit'];var _0x3e65d8;if(_0x4d6f8d>=_0x6dd34){_0x4d6f8d=_0x6dd34;_0x3e65d8=0xc8;}else{_0x3e65d8=0xce;}_0x157eed[_0x2ec5('0x26')](_0x3e65d8);return _0x157eed['set'](_0x2ec5('0x2b'),_0x4a5743+'-'+_0x4d6f8d+'/'+_0x6dd34)[_0x2ec5('0x2c')](_0x3a6d94);}return null;};}function patchUpdates(_0x31ee2d){return function(_0x247d2e){try{jsonpatch['apply'](_0x247d2e,_0x31ee2d,!![]);}catch(_0x45178e){return BPromise['reject'](_0x45178e);}return _0x247d2e[_0x2ec5('0x2d')]();};}function saveUpdates(_0x30b887,_0x28384d){return function(_0x150327){if(_0x150327){return _0x150327[_0x2ec5('0x2e')](_0x30b887)[_0x2ec5('0x1b')](function(_0x5e302f){return _0x5e302f;});}return null;};}function removeEntity(_0x5a0ed8,_0xd3167a){return function(_0x178987){if(_0x178987){return _0x178987[_0x2ec5('0x2f')]()[_0x2ec5('0x1b')](function(){var _0x49dc62=_0x178987[_0x2ec5('0x30')]({'plain':!![]});var _0x322de5='Contexts';return db[_0x2ec5('0x31')][_0x2ec5('0x2f')]({'where':{'type':_0x322de5,'resourceId':_0x49dc62['id']}})['then'](function(){return _0x178987;});})[_0x2ec5('0x1b')](function(){_0x5a0ed8[_0x2ec5('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd5e7,_0x178515){return function(_0x13af2e){if(!_0x13af2e){_0x4bd5e7[_0x2ec5('0x32')](0x194);}return _0x13af2e;};}function handleError(_0x103476,_0x322483){_0x322483=_0x322483||0x1f4;return function(_0x4a92f3){logger[_0x2ec5('0x22')](_0x4a92f3[_0x2ec5('0x33')]);if(_0x4a92f3['name']){delete _0x4a92f3[_0x2ec5('0x34')];}_0x103476[_0x2ec5('0x26')](_0x322483)[_0x2ec5('0x35')](_0x4a92f3);};}exports['index']=function(_0x221e39,_0x43a042){var _0x5da345={},_0x1ec3fd={},_0x1b04ab={'count':0x0,'rows':[]};var _0x539feb=_['map'](db[_0x2ec5('0x36')][_0x2ec5('0x37')],function(_0xcde29b){return{'name':_0xcde29b[_0x2ec5('0x38')],'type':_0xcde29b['type'][_0x2ec5('0x39')]};});_0x1ec3fd[_0x2ec5('0x3a')]=_['map'](_0x539feb,_0x2ec5('0x34'));_0x1ec3fd['query']=_['keys'](_0x221e39[_0x2ec5('0x3b')]);_0x1ec3fd[_0x2ec5('0x3c')]=_[_0x2ec5('0x3d')](_0x1ec3fd[_0x2ec5('0x3a')],_0x1ec3fd[_0x2ec5('0x3b')]);_0x5da345[_0x2ec5('0x3e')]=_['intersection'](_0x1ec3fd[_0x2ec5('0x3a')],qs['fields'](_0x221e39[_0x2ec5('0x3b')][_0x2ec5('0x3f')]));_0x5da345[_0x2ec5('0x3e')]=_0x5da345[_0x2ec5('0x3e')][_0x2ec5('0x40')]?_0x5da345[_0x2ec5('0x3e')]:_0x1ec3fd[_0x2ec5('0x3a')];if(!_0x221e39[_0x2ec5('0x3b')][_0x2ec5('0x41')](_0x2ec5('0x42'))){_0x5da345[_0x2ec5('0x28')]=qs[_0x2ec5('0x28')](_0x221e39[_0x2ec5('0x3b')]['limit']);_0x5da345[_0x2ec5('0x27')]=qs[_0x2ec5('0x27')](_0x221e39[_0x2ec5('0x3b')]['offset']);}_0x5da345[_0x2ec5('0x43')]=qs[_0x2ec5('0x44')](_0x221e39[_0x2ec5('0x3b')][_0x2ec5('0x44')]);_0x5da345[_0x2ec5('0x45')]=qs[_0x2ec5('0x3c')](_['pick'](_0x221e39[_0x2ec5('0x3b')],_0x1ec3fd[_0x2ec5('0x3c')]),_0x539feb);if(_0x221e39['query'][_0x2ec5('0x46')]){_0x5da345[_0x2ec5('0x45')]=_[_0x2ec5('0x47')](_0x5da345['where'],{'$or':_[_0x2ec5('0x48')](_0x539feb,function(_0x9aed36){if(_0x9aed36[_0x2ec5('0x49')]!==_0x2ec5('0x4a')){var _0x2d8185={};_0x2d8185[_0x9aed36[_0x2ec5('0x34')]]={'$like':'%'+_0x221e39[_0x2ec5('0x3b')][_0x2ec5('0x46')]+'%'};return _0x2d8185;}})});}_0x5da345=_[_0x2ec5('0x47')]({},_0x5da345,_0x221e39['options']);var _0x1353b6={'where':_0x5da345[_0x2ec5('0x45')]};return db[_0x2ec5('0x36')][_0x2ec5('0x2a')](_0x1353b6)[_0x2ec5('0x1b')](function(_0x5c0428){_0x1b04ab[_0x2ec5('0x2a')]=_0x5c0428;if(_0x221e39[_0x2ec5('0x3b')][_0x2ec5('0x4b')]){_0x5da345[_0x2ec5('0x4c')]=[{'all':!![]}];}return db[_0x2ec5('0x36')][_0x2ec5('0x4d')](_0x5da345);})[_0x2ec5('0x1b')](function(_0x2ac7c1){_0x1b04ab['rows']=_0x2ac7c1;return _0x1b04ab;})[_0x2ec5('0x1b')](respondWithFilteredResult(_0x43a042,_0x5da345))[_0x2ec5('0x25')](handleError(_0x43a042,null));};exports[_0x2ec5('0x4e')]=function(_0x599b88,_0x421f0f){var _0x4fe254={'raw':![],'where':{'id':_0x599b88[_0x2ec5('0x4f')]['id']}},_0x32da9={};_0x32da9[_0x2ec5('0x3a')]=_['keys'](db['VoiceContext'][_0x2ec5('0x37')]);_0x32da9[_0x2ec5('0x3b')]=_[_0x2ec5('0x50')](_0x599b88[_0x2ec5('0x3b')]);_0x32da9['filters']=_[_0x2ec5('0x3d')](_0x32da9[_0x2ec5('0x3a')],_0x32da9[_0x2ec5('0x3b')]);_0x4fe254['attributes']=_[_0x2ec5('0x3d')](_0x32da9['model'],qs['fields'](_0x599b88[_0x2ec5('0x3b')][_0x2ec5('0x3f')]));_0x4fe254[_0x2ec5('0x3e')]=_0x4fe254[_0x2ec5('0x3e')][_0x2ec5('0x40')]?_0x4fe254[_0x2ec5('0x3e')]:_0x32da9[_0x2ec5('0x3a')];if(_0x599b88[_0x2ec5('0x3b')][_0x2ec5('0x4b')]){_0x4fe254['include']=[{'all':!![]}];}_0x4fe254=_[_0x2ec5('0x47')]({},_0x4fe254,_0x599b88[_0x2ec5('0x51')]);return db[_0x2ec5('0x36')][_0x2ec5('0x52')](_0x4fe254)['then'](handleEntityNotFound(_0x421f0f,null))[_0x2ec5('0x1b')](respondWithResult(_0x421f0f,null))[_0x2ec5('0x25')](handleError(_0x421f0f,null));};exports[_0x2ec5('0x53')]=function(_0x481022,_0x11f50d,_0x4a9a11){var _0x5961cc;return db['VoiceContext'][_0x2ec5('0x53')](_0x481022[_0x2ec5('0x54')],{'raw':!![]})['then'](function(_0x33c069){_0x5961cc=_0x33c069;return db[_0x2ec5('0x36')]['findAll']({'raw':!![]});})[_0x2ec5('0x1b')](function(_0x1ac5c3){var _0x51260e=fs[_0x2ec5('0x55')](path[_0x2ec5('0x56')](config[_0x2ec5('0x57')],_0x2ec5('0x58')),_0x2ec5('0x59'));var _0x100714=ejs['render'](_0x51260e,{'contexts':_0x1ac5c3||[]});fs['writeFileSync'](_0x2ec5('0x5a'),_0x100714);})[_0x2ec5('0x1b')](function(){return respondWithRpcPromise(_0x2ec5('0x5b'),_0x2ec5('0x53'),{'module':_0x2ec5('0x5c')});})[_0x2ec5('0x1b')](function(){var _0x589b28=_0x481022[_0x2ec5('0x5d')][_0x2ec5('0x30')]({'plain':!![]});if(!_0x589b28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x589b28[_0x2ec5('0x5e')]===_0x2ec5('0x5d')){var _0x474532=_0x5961cc[_0x2ec5('0x30')]({'plain':!![]});return db[_0x2ec5('0x5f')][_0x2ec5('0x52')]({'where':{'name':_0x2ec5('0x60'),'userProfileId':_0x589b28[_0x2ec5('0x61')]},'raw':!![]})[_0x2ec5('0x1b')](function(_0x1b6b73){if(_0x1b6b73&&_0x1b6b73[_0x2ec5('0x62')]===0x0){return db['UserProfileResource'][_0x2ec5('0x53')]({'name':_0x474532['name'],'resourceId':_0x474532['id'],'type':_0x1b6b73['name'],'sectionId':_0x1b6b73['id']},{})[_0x2ec5('0x1b')](function(){return _0x5961cc;});}else{return _0x5961cc;}})[_0x2ec5('0x25')](function(_0x39ed8c){logger[_0x2ec5('0x22')](_0x2ec5('0x63'),_0x39ed8c);throw _0x39ed8c;});}return _0x5961cc;})['then'](respondWithResult(_0x11f50d,0xc9))[_0x2ec5('0x25')](handleError(_0x11f50d,null));};exports[_0x2ec5('0x2e')]=function(_0x30115a,_0x2ffb9b,_0x3b2aa0){var _0xa11cf5;return db[_0x2ec5('0x36')]['find']({'where':{'id':_0x30115a[_0x2ec5('0x4f')]['id']}})[_0x2ec5('0x1b')](handleEntityNotFound(_0x2ffb9b,null))[_0x2ec5('0x1b')](saveUpdates(_0x30115a[_0x2ec5('0x54')],null))[_0x2ec5('0x1b')](function(_0x4f5c5e){if(_0x4f5c5e){_0xa11cf5=_0x4f5c5e;return db[_0x2ec5('0x36')][_0x2ec5('0x4d')]({'raw':!![]});}})[_0x2ec5('0x1b')](function(_0x5d8334){var _0x285fa2=fs[_0x2ec5('0x55')](path[_0x2ec5('0x56')](config[_0x2ec5('0x57')],_0x2ec5('0x58')),_0x2ec5('0x59'));var _0x10b07f=ejs[_0x2ec5('0x64')](_0x285fa2,{'contexts':_0x5d8334||[]});fs[_0x2ec5('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x10b07f);})['then'](function(){return respondWithRpcPromise(_0x2ec5('0x5b'),_0x2ec5('0x2e'),{'module':_0x2ec5('0x5c')});})[_0x2ec5('0x1b')](function(){return _0xa11cf5;})['then'](respondWithResult(_0x2ffb9b,null))[_0x2ec5('0x25')](handleError(_0x2ffb9b,null));};exports[_0x2ec5('0x2f')]=function(_0x3245dd,_0x569f5c,_0x40a8c1){var _0x365585;return db[_0x2ec5('0x36')][_0x2ec5('0x52')]({'where':{'id':_0x3245dd[_0x2ec5('0x4f')]['id']}})[_0x2ec5('0x1b')](handleEntityNotFound(_0x569f5c,null))['then'](removeEntity(_0x569f5c,null))[_0x2ec5('0x1b')](function(){return db[_0x2ec5('0x36')][_0x2ec5('0x4d')]({'raw':!![]});})[_0x2ec5('0x1b')](function(_0x3aedfd){var _0x5a58c5=fs[_0x2ec5('0x55')](path[_0x2ec5('0x56')](config[_0x2ec5('0x57')],_0x2ec5('0x58')),_0x2ec5('0x59'));var _0x2bf78d=ejs[_0x2ec5('0x64')](_0x5a58c5,{'contexts':_0x3aedfd});fs['writeFileSync'](_0x2ec5('0x5a'),_0x2bf78d);return respondWithRpcPromise(_0x2ec5('0x5b'),'destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x569f5c,null));}; \ No newline at end of file +var _0x49bf=['to-csv','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','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','Contexts','UserProfileResource','stack','name','send','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','show','params','create','body','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','render','Reload','readFileSync','chan_sip.so','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49bf,0xbc));var _0xf49b=function(_0xdfa9ee,_0x1f718f){_0xdfa9ee=_0xdfa9ee-0x0;var _0x47fe79=_0x49bf[_0xdfa9ee];return _0x47fe79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf49b('0x0'));var zipdir=require(_0xf49b('0x1'));var jsonpatch=require(_0xf49b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf49b('0x3'));var Mustache=require(_0xf49b('0x4'));var util=require(_0xf49b('0x5'));var path=require(_0xf49b('0x6'));var sox=require(_0xf49b('0x7'));var csv=require(_0xf49b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf49b('0x9'));var _=require('lodash');var squel=require(_0xf49b('0xa'));var crypto=require(_0xf49b('0xb'));var jsforce=require(_0xf49b('0xc'));var deskjs=require(_0xf49b('0xd'));var toCsv=require(_0xf49b('0x8'));var querystring=require('querystring');var Papa=require(_0xf49b('0xe'));var Redis=require('ioredis');var authService=require(_0xf49b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf49b('0x10'));var hardwareService=require(_0xf49b('0x11'));var logger=require('../../config/logger')(_0xf49b('0x12'));var utils=require(_0xf49b('0x13'));var config=require(_0xf49b('0x14'));var licenseUtil=require(_0xf49b('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf49b('0x16'));var client=jayson[_0xf49b('0x17')][_0xf49b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x224d70,_0x31dfca,_0x509ff3,_0xbc305){return new BPromise(function(_0x2db6f5,_0x1972ca){var _0x3bb7b9=_0xbc305||client;return _0x3bb7b9['request'](_0x224d70,_0x509ff3)[_0xf49b('0x19')](function(_0x80d758){logger[_0xf49b('0x1a')](_0xf49b('0x1b'),_0x31dfca,_0xf49b('0x1c'));logger['debug'](_0xf49b('0x1d'),_0x31dfca,_0xf49b('0x1c'),JSON['stringify'](_0x80d758));if(_0x80d758[_0xf49b('0x1e')]){if(_0x80d758['error'][_0xf49b('0x1f')]===0x1f4){logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x80d758[_0xf49b('0x1e')]['message']);return _0x1972ca(_0x80d758['error'][_0xf49b('0x20')]);}logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x80d758['error'][_0xf49b('0x20')]);return _0x2db6f5(_0x80d758[_0xf49b('0x1e')]['message']);}else{logger[_0xf49b('0x1a')](_0xf49b('0x1b'),_0x31dfca,_0xf49b('0x1c'));_0x2db6f5(_0x80d758['result']['message']);}})[_0xf49b('0x21')](function(_0x38246c){logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x38246c);_0x1972ca(_0x38246c);});});}function respondWithStatusCode(_0x4f12a7,_0x5d43d0){_0x5d43d0=_0x5d43d0||0xcc;return function(_0x276e53){if(_0x276e53){return _0x4f12a7[_0xf49b('0x22')](_0x5d43d0);}return _0x4f12a7[_0xf49b('0x23')](_0x5d43d0)[_0xf49b('0x24')]();};}function respondWithResult(_0x2da350,_0x3c2eb6){_0x3c2eb6=_0x3c2eb6||0xc8;return function(_0x1860f3){if(_0x1860f3){return _0x2da350[_0xf49b('0x23')](_0x3c2eb6)[_0xf49b('0x25')](_0x1860f3);}};}function respondWithFilteredResult(_0x76aad2,_0x4f3a72){return function(_0x24c75e){if(_0x24c75e){var _0x5579ab=typeof _0x4f3a72[_0xf49b('0x26')]===_0xf49b('0x27')&&typeof _0x4f3a72[_0xf49b('0x28')]===_0xf49b('0x27');var _0x3ee62a=_0x24c75e[_0xf49b('0x29')];var _0x380afc=_0x5579ab?0x0:_0x4f3a72['offset'];var _0x4c23ef=_0x5579ab?_0x24c75e[_0xf49b('0x29')]:_0x4f3a72[_0xf49b('0x26')]+_0x4f3a72[_0xf49b('0x28')];var _0x24052e;if(_0x4c23ef>=_0x3ee62a){_0x4c23ef=_0x3ee62a;_0x24052e=0xc8;}else{_0x24052e=0xce;}_0x76aad2[_0xf49b('0x23')](_0x24052e);return _0x76aad2[_0xf49b('0x2a')]('Content-Range',_0x380afc+'-'+_0x4c23ef+'/'+_0x3ee62a)['json'](_0x24c75e);}return null;};}function patchUpdates(_0x33cd98){return function(_0x38922e){try{jsonpatch[_0xf49b('0x2b')](_0x38922e,_0x33cd98,!![]);}catch(_0x12989e){return BPromise[_0xf49b('0x2c')](_0x12989e);}return _0x38922e['save']();};}function saveUpdates(_0x50b4a5,_0x9df3c3){return function(_0x1ee916){if(_0x1ee916){return _0x1ee916[_0xf49b('0x2d')](_0x50b4a5)[_0xf49b('0x19')](function(_0x52bf7e){return _0x52bf7e;});}return null;};}function removeEntity(_0x5c1613,_0x401e42){return function(_0x1d7f8e){if(_0x1d7f8e){return _0x1d7f8e[_0xf49b('0x2e')]()[_0xf49b('0x19')](function(){var _0x3ad60c=_0x1d7f8e[_0xf49b('0x2f')]({'plain':!![]});var _0x2cb9ab=_0xf49b('0x30');return db[_0xf49b('0x31')]['destroy']({'where':{'type':_0x2cb9ab,'resourceId':_0x3ad60c['id']}})['then'](function(){return _0x1d7f8e;});})[_0xf49b('0x19')](function(){_0x5c1613[_0xf49b('0x23')](0xcc)[_0xf49b('0x24')]();});}};}function handleEntityNotFound(_0x22c2b2,_0x52f054){return function(_0x545373){if(!_0x545373){_0x22c2b2[_0xf49b('0x22')](0x194);}return _0x545373;};}function handleError(_0x12b2e8,_0x2691bb){_0x2691bb=_0x2691bb||0x1f4;return function(_0xba3dc9){logger[_0xf49b('0x1e')](_0xba3dc9[_0xf49b('0x32')]);if(_0xba3dc9[_0xf49b('0x33')]){delete _0xba3dc9['name'];}_0x12b2e8[_0xf49b('0x23')](_0x2691bb)[_0xf49b('0x34')](_0xba3dc9);};}exports['index']=function(_0x17942e,_0x3815fe){var _0x49c592={},_0x29a6b6={},_0x4762ba={'count':0x0,'rows':[]};var _0x214f8e=_['map'](db[_0xf49b('0x35')][_0xf49b('0x36')],function(_0x1d9ca8){return{'name':_0x1d9ca8[_0xf49b('0x37')],'type':_0x1d9ca8[_0xf49b('0x38')][_0xf49b('0x39')]};});_0x29a6b6[_0xf49b('0x3a')]=_[_0xf49b('0x3b')](_0x214f8e,_0xf49b('0x33'));_0x29a6b6[_0xf49b('0x3c')]=_[_0xf49b('0x3d')](_0x17942e[_0xf49b('0x3c')]);_0x29a6b6[_0xf49b('0x3e')]=_[_0xf49b('0x3f')](_0x29a6b6[_0xf49b('0x3a')],_0x29a6b6[_0xf49b('0x3c')]);_0x49c592[_0xf49b('0x40')]=_[_0xf49b('0x3f')](_0x29a6b6['model'],qs[_0xf49b('0x41')](_0x17942e[_0xf49b('0x3c')][_0xf49b('0x41')]));_0x49c592[_0xf49b('0x40')]=_0x49c592[_0xf49b('0x40')][_0xf49b('0x42')]?_0x49c592['attributes']:_0x29a6b6[_0xf49b('0x3a')];if(!_0x17942e[_0xf49b('0x3c')][_0xf49b('0x43')](_0xf49b('0x44'))){_0x49c592['limit']=qs[_0xf49b('0x28')](_0x17942e[_0xf49b('0x3c')][_0xf49b('0x28')]);_0x49c592['offset']=qs[_0xf49b('0x26')](_0x17942e[_0xf49b('0x3c')]['offset']);}_0x49c592['order']=qs[_0xf49b('0x45')](_0x17942e['query'][_0xf49b('0x45')]);_0x49c592[_0xf49b('0x46')]=qs['filters'](_['pick'](_0x17942e[_0xf49b('0x3c')],_0x29a6b6[_0xf49b('0x3e')]),_0x214f8e);if(_0x17942e[_0xf49b('0x3c')][_0xf49b('0x47')]){_0x49c592[_0xf49b('0x46')]=_[_0xf49b('0x48')](_0x49c592[_0xf49b('0x46')],{'$or':_[_0xf49b('0x3b')](_0x214f8e,function(_0x4959a3){if(_0x4959a3[_0xf49b('0x38')]!=='VIRTUAL'){var _0x408767={};_0x408767[_0x4959a3[_0xf49b('0x33')]]={'$like':'%'+_0x17942e[_0xf49b('0x3c')][_0xf49b('0x47')]+'%'};return _0x408767;}})});}_0x49c592=_[_0xf49b('0x48')]({},_0x49c592,_0x17942e[_0xf49b('0x49')]);var _0x34af08={'where':_0x49c592[_0xf49b('0x46')]};return db['VoiceContext'][_0xf49b('0x29')](_0x34af08)[_0xf49b('0x19')](function(_0x31f561){_0x4762ba[_0xf49b('0x29')]=_0x31f561;if(_0x17942e['query']['includeAll']){_0x49c592[_0xf49b('0x4a')]=[{'all':!![]}];}return db[_0xf49b('0x35')][_0xf49b('0x4b')](_0x49c592);})[_0xf49b('0x19')](function(_0x151c02){_0x4762ba[_0xf49b('0x4c')]=_0x151c02;return _0x4762ba;})['then'](respondWithFilteredResult(_0x3815fe,_0x49c592))[_0xf49b('0x21')](handleError(_0x3815fe,null));};exports[_0xf49b('0x4d')]=function(_0x421d05,_0x589548){var _0x177ab0={'raw':![],'where':{'id':_0x421d05[_0xf49b('0x4e')]['id']}},_0x223cbf={};_0x223cbf[_0xf49b('0x3a')]=_[_0xf49b('0x3d')](db['VoiceContext']['rawAttributes']);_0x223cbf[_0xf49b('0x3c')]=_['keys'](_0x421d05[_0xf49b('0x3c')]);_0x223cbf[_0xf49b('0x3e')]=_['intersection'](_0x223cbf[_0xf49b('0x3a')],_0x223cbf[_0xf49b('0x3c')]);_0x177ab0[_0xf49b('0x40')]=_[_0xf49b('0x3f')](_0x223cbf[_0xf49b('0x3a')],qs[_0xf49b('0x41')](_0x421d05[_0xf49b('0x3c')]['fields']));_0x177ab0['attributes']=_0x177ab0[_0xf49b('0x40')][_0xf49b('0x42')]?_0x177ab0['attributes']:_0x223cbf[_0xf49b('0x3a')];if(_0x421d05[_0xf49b('0x3c')]['includeAll']){_0x177ab0[_0xf49b('0x4a')]=[{'all':!![]}];}_0x177ab0=_['merge']({},_0x177ab0,_0x421d05[_0xf49b('0x49')]);return db[_0xf49b('0x35')]['find'](_0x177ab0)[_0xf49b('0x19')](handleEntityNotFound(_0x589548,null))[_0xf49b('0x19')](respondWithResult(_0x589548,null))['catch'](handleError(_0x589548,null));};exports['create']=function(_0x1608a2,_0x28bfcb,_0x190eaa){var _0x47a9cf;return db[_0xf49b('0x35')][_0xf49b('0x4f')](_0x1608a2[_0xf49b('0x50')],{'raw':!![]})['then'](function(_0x178022){_0x47a9cf=_0x178022;return db[_0xf49b('0x35')][_0xf49b('0x4b')]({'raw':!![]});})[_0xf49b('0x19')](function(_0xf22a76){var _0x15f842=fs['readFileSync'](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),'utf8');var _0x27c96e=ejs['render'](_0x15f842,{'contexts':_0xf22a76||[]});fs[_0xf49b('0x54')](_0xf49b('0x55'),_0x27c96e);})[_0xf49b('0x19')](function(){return respondWithRpcPromise('Reload',_0xf49b('0x4f'),{'module':'chan_sip.so'});})['then'](function(){var _0xdb4d8b=_0x1608a2[_0xf49b('0x56')]['get']({'plain':!![]});if(!_0xdb4d8b)throw new Error(_0xf49b('0x57'));if(_0xdb4d8b['role']==='user'){var _0x3a628d=_0x47a9cf[_0xf49b('0x2f')]({'plain':!![]});return db[_0xf49b('0x58')][_0xf49b('0x59')]({'where':{'name':_0xf49b('0x30'),'userProfileId':_0xdb4d8b[_0xf49b('0x5a')]},'raw':!![]})['then'](function(_0x30a2b0){if(_0x30a2b0&&_0x30a2b0[_0xf49b('0x5b')]===0x0){return db[_0xf49b('0x31')][_0xf49b('0x4f')]({'name':_0x3a628d[_0xf49b('0x33')],'resourceId':_0x3a628d['id'],'type':_0x30a2b0['name'],'sectionId':_0x30a2b0['id']},{})[_0xf49b('0x19')](function(){return _0x47a9cf;});}else{return _0x47a9cf;}})[_0xf49b('0x21')](function(_0x40c4d4){logger[_0xf49b('0x1e')](_0xf49b('0x5c'),_0x40c4d4);throw _0x40c4d4;});}return _0x47a9cf;})[_0xf49b('0x19')](respondWithResult(_0x28bfcb,0xc9))[_0xf49b('0x21')](handleError(_0x28bfcb,null));};exports[_0xf49b('0x2d')]=function(_0x1fc01d,_0x5d58fb,_0x56481f){var _0x562522;return db[_0xf49b('0x35')][_0xf49b('0x59')]({'where':{'id':_0x1fc01d[_0xf49b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5d58fb,null))[_0xf49b('0x19')](saveUpdates(_0x1fc01d[_0xf49b('0x50')],null))[_0xf49b('0x19')](function(_0x4446d9){if(_0x4446d9){_0x562522=_0x4446d9;return db[_0xf49b('0x35')]['findAll']({'raw':!![]});}})[_0xf49b('0x19')](function(_0x4b4fa7){var _0x49e2f2=fs['readFileSync'](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),_0xf49b('0x5d'));var _0x33fc0b=ejs[_0xf49b('0x5e')](_0x49e2f2,{'contexts':_0x4b4fa7||[]});fs[_0xf49b('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x33fc0b);})[_0xf49b('0x19')](function(){return respondWithRpcPromise(_0xf49b('0x5f'),_0xf49b('0x2d'),{'module':'chan_sip.so'});})[_0xf49b('0x19')](function(){return _0x562522;})[_0xf49b('0x19')](respondWithResult(_0x5d58fb,null))[_0xf49b('0x21')](handleError(_0x5d58fb,null));};exports[_0xf49b('0x2e')]=function(_0x950bbe,_0x2be198,_0x49fd35){var _0x131f57;return db[_0xf49b('0x35')]['find']({'where':{'id':_0x950bbe['params']['id']}})[_0xf49b('0x19')](handleEntityNotFound(_0x2be198,null))[_0xf49b('0x19')](removeEntity(_0x2be198,null))['then'](function(){return db['VoiceContext'][_0xf49b('0x4b')]({'raw':!![]});})[_0xf49b('0x19')](function(_0x2020ac){var _0x3fa4de=fs[_0xf49b('0x60')](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),'utf8');var _0x2fcd52=ejs[_0xf49b('0x5e')](_0x3fa4de,{'contexts':_0x2020ac});fs[_0xf49b('0x54')](_0xf49b('0x55'),_0x2fcd52);return respondWithRpcPromise(_0xf49b('0x5f'),'destroy',{'module':_0xf49b('0x61')});})[_0xf49b('0x21')](handleError(_0x2be198,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 602b30f..1d377be 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 _0x862b=['api','request-promise','path','rimraf','exports','define','util','../../config/logger'];(function(_0x52fb3c,_0x2cf66e){var _0x5c9223=function(_0x56511c){while(--_0x56511c){_0x52fb3c['push'](_0x52fb3c['shift']());}};_0x5c9223(++_0x2cf66e);}(_0x862b,0x13e));var _0xb862=function(_0x4acc42,_0x589ef4){_0x4acc42=_0x4acc42-0x0;var _0x46dfde=_0x862b[_0x4acc42];return _0x46dfde;};'use strict';var _=require('lodash');var util=require(_0xb862('0x0'));var logger=require(_0xb862('0x1'))(_0xb862('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb862('0x3'));var fs=require('fs');var path=require(_0xb862('0x4'));var rimraf=require(_0xb862('0x5'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xb862('0x6')]=function(_0x3d0092,_0x118fce){return _0x3d0092[_0xb862('0x7')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7896=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x4c5c43,_0x5d90f0){var _0x55c60d=function(_0x49cff8){while(--_0x49cff8){_0x4c5c43['push'](_0x4c5c43['shift']());}};_0x55c60d(++_0x5d90f0);}(_0x7896,0x127));var _0x6789=function(_0x552804,_0x3c3d1e){_0x552804=_0x552804-0x0;var _0x32be66=_0x7896[_0x552804];return _0x32be66;};'use strict';var _=require(_0x6789('0x0'));var util=require(_0x6789('0x1'));var logger=require(_0x6789('0x2'))(_0x6789('0x3'));var moment=require(_0x6789('0x4'));var BPromise=require(_0x6789('0x5'));var rp=require(_0x6789('0x6'));var fs=require('fs');var path=require(_0x6789('0x7'));var rimraf=require(_0x6789('0x8'));var config=require(_0x6789('0x9'));var attributes=require(_0x6789('0xa'));module[_0x6789('0xb')]=function(_0x571fb4,_0x407ef2){return _0x571fb4[_0x6789('0xc')](_0x6789('0xd'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index b80d936..3d3c88f 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 _0x2572=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x458e33,_0x4f8045){var _0x5109b0=function(_0x3fdf6f){while(--_0x3fdf6f){_0x458e33['push'](_0x458e33['shift']());}};_0x5109b0(++_0x4f8045);}(_0x2572,0x110));var _0x2257=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x2572[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x2257('0x0'));var util=require(_0x2257('0x1'));var moment=require(_0x2257('0x2'));var BPromise=require(_0x2257('0x3'));var rs=require(_0x2257('0x4'));var fs=require('fs');var Redis=require(_0x2257('0x5'));var db=require(_0x2257('0x6'))['db'];var utils=require(_0x2257('0x7'));var logger=require(_0x2257('0x8'))('rpc');var config=require(_0x2257('0x9'));var jayson=require(_0x2257('0xa'));var client=jayson[_0x2257('0xb')][_0x2257('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26b2c6,_0x339619,_0x74aec6){return new BPromise(function(_0x380460,_0xee7249){return client['request'](_0x26b2c6,_0x74aec6)[_0x2257('0xd')](function(_0x3e088a){logger['info'](_0x2257('0xe'),_0x339619,_0x2257('0xf'));logger[_0x2257('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x339619,_0x2257('0xf'),JSON[_0x2257('0x11')](_0x3e088a));if(_0x3e088a[_0x2257('0x12')]){if(_0x3e088a[_0x2257('0x12')]['code']===0x1f4){logger[_0x2257('0x12')]('VoiceContext,\x20%s,\x20%s',_0x339619,_0x3e088a['error'][_0x2257('0x13')]);return _0xee7249(_0x3e088a[_0x2257('0x12')][_0x2257('0x13')]);}logger[_0x2257('0x12')](_0x2257('0xe'),_0x339619,_0x3e088a[_0x2257('0x12')][_0x2257('0x13')]);return _0x380460(_0x3e088a['error']['message']);}else{logger[_0x2257('0x14')](_0x2257('0xe'),_0x339619,_0x2257('0xf'));_0x380460(_0x3e088a[_0x2257('0x15')]['message']);}})['catch'](function(_0x330216){logger['error']('VoiceContext,\x20%s,\x20%s',_0x339619,_0x330216);_0xee7249(_0x330216);});});} \ No newline at end of file +var _0xdc91=['client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x14c552,_0x3e74a3){var _0x44f347=function(_0x423fe3){while(--_0x423fe3){_0x14c552['push'](_0x14c552['shift']());}};_0x44f347(++_0x3e74a3);}(_0xdc91,0x8b));var _0x1dc9=function(_0x4dda9c,_0x34c3c2){_0x4dda9c=_0x4dda9c-0x0;var _0x4f27c3=_0xdc91[_0x4dda9c];return _0x4f27c3;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c72bd7a..705db09 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 _0x93ac=['Router','fs-extra','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','describe','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5bba89,_0x45092a){var _0x24ac04=function(_0x350e9a){while(--_0x350e9a){_0x5bba89['push'](_0x5bba89['shift']());}};_0x24ac04(++_0x45092a);}(_0x93ac,0x9e));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc93a('0x0'));var util=require(_0xc93a('0x1'));var path=require(_0xc93a('0x2'));var timeout=require(_0xc93a('0x3'));var express=require('express');var router=express[_0xc93a('0x4')]();var fs_extra=require(_0xc93a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc93a('0x6'));var controller=require(_0xc93a('0x7'));router[_0xc93a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc93a('0x8')](_0xc93a('0x9'),auth[_0xc93a('0xa')](),controller[_0xc93a('0xb')]);router[_0xc93a('0x8')](_0xc93a('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc93a('0xa')](),controller[_0xc93a('0xd')]);router[_0xc93a('0xe')](_0xc93a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc93a('0xf')](_0xc93a('0xc'),auth[_0xc93a('0xa')](),controller[_0xc93a('0x10')]);module[_0xc93a('0x11')]=router; \ No newline at end of file +var _0xcb6a=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','post','update'];(function(_0x4f1f72,_0x299df8){var _0x5a084e=function(_0x3d3cf3){while(--_0x3d3cf3){_0x4f1f72['push'](_0x4f1f72['shift']());}};_0x5a084e(++_0x299df8);}(_0xcb6a,0x16a));var _0xacb6=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xcb6a[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0xacb6('0x0'));var util=require(_0xacb6('0x1'));var path=require(_0xacb6('0x2'));var timeout=require(_0xacb6('0x3'));var express=require('express');var router=express[_0xacb6('0x4')]();var fs_extra=require(_0xacb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacb6('0x6'));var config=require(_0xacb6('0x7'));var controller=require(_0xacb6('0x8'));router['get']('/',auth[_0xacb6('0x9')](),controller['index']);router[_0xacb6('0xa')](_0xacb6('0xb'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xc')]);router[_0xacb6('0xa')](_0xacb6('0xd'),auth[_0xacb6('0x9')](),controller['show']);router[_0xacb6('0xe')]('/',auth[_0xacb6('0x9')](),controller['create']);router['put'](_0xacb6('0xd'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xf')]);router[_0xacb6('0x10')](_0xacb6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xacb6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a1f4cfc..6918fc5 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x50f476,_0x477175){var _0x1eff39=function(_0x195297){while(--_0x195297){_0x50f476['push'](_0x50f476['shift']());}};_0x1eff39(++_0x477175);}(_0x008c,0x188));var _0xc008=function(_0x4bd385,_0x3a3e0a){_0x4bd385=_0x4bd385-0x0;var _0x3bbd36=_0x008c[_0x4bd385];return _0x3bbd36;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0xfeb90d,_0x35ae46){var _0x4666ab=function(_0x3b4cf7){while(--_0x3b4cf7){_0xfeb90d['push'](_0xfeb90d['shift']());}};_0x4666ab(++_0x35ae46);}(_0x008c,0x188));var _0xc008=function(_0x5c27b6,_0x4a3c28){_0x5c27b6=_0x5c27b6-0x0;var _0x284ce4=_0x008c[_0x5c27b6];return _0x284ce4;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 7f7be77..c2e9172 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 _0xdb6c=['create','body','find','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','VoiceDialReport','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','catch'];(function(_0x1a4d43,_0x28b32c){var _0x3650e0=function(_0x4b2dbc){while(--_0x4b2dbc){_0x1a4d43['push'](_0x1a4d43['shift']());}};_0x3650e0(++_0x28b32c);}(_0xdb6c,0x124));var _0xcdb6=function(_0x4745a4,_0x4001a2){_0x4745a4=_0x4745a4-0x0;var _0x245097=_0xdb6c[_0x4745a4];return _0x245097;};'use strict';var emlformat=require(_0xcdb6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdb6('0x1'));var rp=require(_0xcdb6('0x2'));var moment=require('moment');var BPromise=require(_0xcdb6('0x3'));var Mustache=require(_0xcdb6('0x4'));var util=require(_0xcdb6('0x5'));var path=require(_0xcdb6('0x6'));var sox=require(_0xcdb6('0x7'));var csv=require(_0xcdb6('0x8'));var ejs=require(_0xcdb6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdb6('0xa'));var squel=require(_0xcdb6('0xb'));var crypto=require('crypto');var jsforce=require(_0xcdb6('0xc'));var deskjs=require(_0xcdb6('0xd'));var toCsv=require(_0xcdb6('0x8'));var querystring=require(_0xcdb6('0xe'));var Papa=require(_0xcdb6('0xf'));var Redis=require(_0xcdb6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcdb6('0x11'));var as=require(_0xcdb6('0x12'));var hardwareService=require(_0xcdb6('0x13'));var logger=require('../../config/logger')(_0xcdb6('0x14'));var utils=require(_0xcdb6('0x15'));var config=require(_0xcdb6('0x16'));var licenseUtil=require(_0xcdb6('0x17'));var db=require(_0xcdb6('0x18'))['db'];function respondWithStatusCode(_0x16dac8,_0x4287aa){_0x4287aa=_0x4287aa||0xcc;return function(_0x23ec5a){if(_0x23ec5a){return _0x16dac8[_0xcdb6('0x19')](_0x4287aa);}return _0x16dac8[_0xcdb6('0x1a')](_0x4287aa)['end']();};}function respondWithResult(_0x4106ef,_0x262e2a){_0x262e2a=_0x262e2a||0xc8;return function(_0x5f4b15){if(_0x5f4b15){return _0x4106ef[_0xcdb6('0x1a')](_0x262e2a)['json'](_0x5f4b15);}};}function respondWithFilteredResult(_0x113be3,_0x108e92){return function(_0x12f283){if(_0x12f283){var _0x1f3d34=typeof _0x108e92[_0xcdb6('0x1b')]==='undefined'&&typeof _0x108e92['limit']===_0xcdb6('0x1c');var _0x3fcccc=_0x12f283[_0xcdb6('0x1d')];var _0x179589=_0x1f3d34?0x0:_0x108e92[_0xcdb6('0x1b')];var _0x4ec4d9=_0x1f3d34?_0x12f283[_0xcdb6('0x1d')]:_0x108e92[_0xcdb6('0x1b')]+_0x108e92['limit'];var _0x9d7e60;if(_0x4ec4d9>=_0x3fcccc){_0x4ec4d9=_0x3fcccc;_0x9d7e60=0xc8;}else{_0x9d7e60=0xce;}_0x113be3['status'](_0x9d7e60);return _0x113be3['set'](_0xcdb6('0x1e'),_0x179589+'-'+_0x4ec4d9+'/'+_0x3fcccc)[_0xcdb6('0x1f')](_0x12f283);}return null;};}function patchUpdates(_0x1b2318){return function(_0x5754c0){try{jsonpatch[_0xcdb6('0x20')](_0x5754c0,_0x1b2318,!![]);}catch(_0xb04b96){return BPromise[_0xcdb6('0x21')](_0xb04b96);}return _0x5754c0['save']();};}function saveUpdates(_0x1b6f93,_0x3a430a){return function(_0x58062e){if(_0x58062e){return _0x58062e[_0xcdb6('0x22')](_0x1b6f93)[_0xcdb6('0x23')](function(_0x159c60){return _0x159c60;});}return null;};}function removeEntity(_0x212f0e,_0x1179eb){return function(_0x12ca4f){if(_0x12ca4f){return _0x12ca4f[_0xcdb6('0x24')]()[_0xcdb6('0x23')](function(){_0x212f0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2461,_0xc43e5b){return function(_0xb6dc28){if(!_0xb6dc28){_0x3a2461['sendStatus'](0x194);}return _0xb6dc28;};}function handleError(_0x4fd583,_0x1432ad){_0x1432ad=_0x1432ad||0x1f4;return function(_0x28aea5){logger['error'](_0x28aea5[_0xcdb6('0x25')]);if(_0x28aea5[_0xcdb6('0x26')]){delete _0x28aea5['name'];}_0x4fd583[_0xcdb6('0x1a')](_0x1432ad)[_0xcdb6('0x27')](_0x28aea5);};}exports[_0xcdb6('0x28')]=function(_0x1f1803,_0xa772c0){var _0x1caca3={},_0x5d712f={},_0x2f9fcb={'count':0x0,'rows':[]};var _0xf7461a=_['map'](db[_0xcdb6('0x29')]['rawAttributes'],function(_0x4462b2){return{'name':_0x4462b2[_0xcdb6('0x2a')],'type':_0x4462b2[_0xcdb6('0x2b')]['key']};});_0x5d712f[_0xcdb6('0x2c')]=_[_0xcdb6('0x2d')](_0xf7461a,_0xcdb6('0x26'));_0x5d712f[_0xcdb6('0x2e')]=_[_0xcdb6('0x2f')](_0x1f1803[_0xcdb6('0x2e')]);_0x5d712f[_0xcdb6('0x30')]=_['intersection'](_0x5d712f['model'],_0x5d712f[_0xcdb6('0x2e')]);_0x1caca3['attributes']=_[_0xcdb6('0x31')](_0x5d712f[_0xcdb6('0x2c')],qs[_0xcdb6('0x32')](_0x1f1803[_0xcdb6('0x2e')]['fields']));_0x1caca3[_0xcdb6('0x33')]=_0x1caca3['attributes'][_0xcdb6('0x34')]?_0x1caca3[_0xcdb6('0x33')]:_0x5d712f[_0xcdb6('0x2c')];if(!_0x1f1803[_0xcdb6('0x2e')]['hasOwnProperty'](_0xcdb6('0x35'))){_0x1caca3[_0xcdb6('0x36')]=qs[_0xcdb6('0x36')](_0x1f1803[_0xcdb6('0x2e')][_0xcdb6('0x36')]);_0x1caca3[_0xcdb6('0x1b')]=qs['offset'](_0x1f1803[_0xcdb6('0x2e')][_0xcdb6('0x1b')]);}_0x1caca3['order']=qs[_0xcdb6('0x37')](_0x1f1803[_0xcdb6('0x2e')][_0xcdb6('0x37')]);_0x1caca3[_0xcdb6('0x38')]=qs['filters'](_[_0xcdb6('0x39')](_0x1f1803[_0xcdb6('0x2e')],_0x5d712f[_0xcdb6('0x30')]),_0xf7461a);if(_0x1f1803['query'][_0xcdb6('0x3a')]){_0x1caca3['where']=_[_0xcdb6('0x3b')](_0x1caca3['where'],{'$or':_[_0xcdb6('0x2d')](_0xf7461a,function(_0x55ae6c){if(_0x55ae6c['type']!==_0xcdb6('0x3c')){var _0x594095={};_0x594095[_0x55ae6c[_0xcdb6('0x26')]]={'$like':'%'+_0x1f1803[_0xcdb6('0x2e')]['filter']+'%'};return _0x594095;}})});}_0x1caca3=_['merge']({},_0x1caca3,_0x1f1803['options']);var _0x45db87={'where':_0x1caca3[_0xcdb6('0x38')]};return db[_0xcdb6('0x29')][_0xcdb6('0x1d')](_0x45db87)['then'](function(_0x630caa){_0x2f9fcb[_0xcdb6('0x1d')]=_0x630caa;if(_0x1f1803[_0xcdb6('0x2e')][_0xcdb6('0x3d')]){_0x1caca3[_0xcdb6('0x3e')]=[{'all':!![]}];}return db[_0xcdb6('0x29')][_0xcdb6('0x3f')](_0x1caca3);})[_0xcdb6('0x23')](function(_0x3354ff){_0x2f9fcb[_0xcdb6('0x40')]=_0x3354ff;return _0x2f9fcb;})['then'](respondWithFilteredResult(_0xa772c0,_0x1caca3))['catch'](handleError(_0xa772c0,null));};exports[_0xcdb6('0x41')]=function(_0x14917f,_0xa43857){var _0x482f9d={'raw':!![],'where':{'id':_0x14917f[_0xcdb6('0x42')]['id']}},_0x504ecd={};_0x504ecd['model']=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x504ecd['query']=_['keys'](_0x14917f[_0xcdb6('0x2e')]);_0x504ecd[_0xcdb6('0x30')]=_[_0xcdb6('0x31')](_0x504ecd['model'],_0x504ecd[_0xcdb6('0x2e')]);_0x482f9d[_0xcdb6('0x33')]=_[_0xcdb6('0x31')](_0x504ecd[_0xcdb6('0x2c')],qs[_0xcdb6('0x32')](_0x14917f['query'][_0xcdb6('0x32')]));_0x482f9d[_0xcdb6('0x33')]=_0x482f9d['attributes']['length']?_0x482f9d[_0xcdb6('0x33')]:_0x504ecd[_0xcdb6('0x2c')];if(_0x14917f[_0xcdb6('0x2e')]['includeAll']){_0x482f9d[_0xcdb6('0x3e')]=[{'all':!![]}];}_0x482f9d=_[_0xcdb6('0x3b')]({},_0x482f9d,_0x14917f['options']);return db['VoiceDialReport']['find'](_0x482f9d)[_0xcdb6('0x23')](handleEntityNotFound(_0xa43857,null))['then'](respondWithResult(_0xa43857,null))[_0xcdb6('0x43')](handleError(_0xa43857,null));};exports[_0xcdb6('0x44')]=function(_0x598897,_0x1b767b){return db[_0xcdb6('0x29')][_0xcdb6('0x44')](_0x598897[_0xcdb6('0x45')],{})[_0xcdb6('0x23')](respondWithResult(_0x1b767b,0xc9))[_0xcdb6('0x43')](handleError(_0x1b767b,null));};exports[_0xcdb6('0x22')]=function(_0x480b0b,_0x5323d7){if(_0x480b0b['body']['id']){delete _0x480b0b['body']['id'];}return db[_0xcdb6('0x29')]['find']({'where':{'id':_0x480b0b['params']['id']}})[_0xcdb6('0x23')](handleEntityNotFound(_0x5323d7,null))['then'](saveUpdates(_0x480b0b[_0xcdb6('0x45')],null))['then'](respondWithResult(_0x5323d7,null))['catch'](handleError(_0x5323d7,null));};exports['destroy']=function(_0x3c414d,_0x25ff37){return db[_0xcdb6('0x29')][_0xcdb6('0x46')]({'where':{'id':_0x3c414d[_0xcdb6('0x42')]['id']}})[_0xcdb6('0x23')](handleEntityNotFound(_0x25ff37,null))['then'](removeEntity(_0x25ff37,null))[_0xcdb6('0x43')](handleError(_0x25ff37,null));};exports[_0xcdb6('0x47')]=function(_0x5082cf,_0x55d1e8){return db[_0xcdb6('0x29')][_0xcdb6('0x47')]()['then'](respondWithResult(_0x55d1e8,null))[_0xcdb6('0x43')](handleError(_0x55d1e8,null));}; \ No newline at end of file +var _0x7086=['key','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','VoiceDialReport','fieldName','type'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0x7086,0x102));var _0x6708=function(_0x20e26d,_0x25e45d){_0x20e26d=_0x20e26d-0x0;var _0x1d7173=_0x7086[_0x20e26d];return _0x1d7173;};'use strict';var emlformat=require(_0x6708('0x0'));var rimraf=require(_0x6708('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6708('0x2'));var rp=require(_0x6708('0x3'));var moment=require(_0x6708('0x4'));var BPromise=require(_0x6708('0x5'));var Mustache=require(_0x6708('0x6'));var util=require(_0x6708('0x7'));var path=require(_0x6708('0x8'));var sox=require(_0x6708('0x9'));var csv=require('to-csv');var ejs=require(_0x6708('0xa'));var fs=require('fs');var fs_extra=require(_0x6708('0xb'));var _=require(_0x6708('0xc'));var squel=require(_0x6708('0xd'));var crypto=require('crypto');var jsforce=require(_0x6708('0xe'));var deskjs=require(_0x6708('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6708('0x10'));var Papa=require(_0x6708('0x11'));var Redis=require(_0x6708('0x12'));var authService=require(_0x6708('0x13'));var qs=require(_0x6708('0x14'));var as=require(_0x6708('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6708('0x16'))(_0x6708('0x17'));var utils=require(_0x6708('0x18'));var config=require(_0x6708('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6708('0x1a'))['db'];function respondWithStatusCode(_0x168e8c,_0x2b42bc){_0x2b42bc=_0x2b42bc||0xcc;return function(_0x74e8d){if(_0x74e8d){return _0x168e8c[_0x6708('0x1b')](_0x2b42bc);}return _0x168e8c['status'](_0x2b42bc)['end']();};}function respondWithResult(_0x166e55,_0xd4a569){_0xd4a569=_0xd4a569||0xc8;return function(_0x22bb07){if(_0x22bb07){return _0x166e55[_0x6708('0x1c')](_0xd4a569)[_0x6708('0x1d')](_0x22bb07);}};}function respondWithFilteredResult(_0x17c145,_0x5efc6f){return function(_0x487d51){if(_0x487d51){var _0x5d8939=typeof _0x5efc6f[_0x6708('0x1e')]==='undefined'&&typeof _0x5efc6f['limit']===_0x6708('0x1f');var _0x2d4633=_0x487d51[_0x6708('0x20')];var _0x4328ed=_0x5d8939?0x0:_0x5efc6f['offset'];var _0x5a13e2=_0x5d8939?_0x487d51[_0x6708('0x20')]:_0x5efc6f[_0x6708('0x1e')]+_0x5efc6f[_0x6708('0x21')];var _0x483eb3;if(_0x5a13e2>=_0x2d4633){_0x5a13e2=_0x2d4633;_0x483eb3=0xc8;}else{_0x483eb3=0xce;}_0x17c145[_0x6708('0x1c')](_0x483eb3);return _0x17c145[_0x6708('0x22')](_0x6708('0x23'),_0x4328ed+'-'+_0x5a13e2+'/'+_0x2d4633)['json'](_0x487d51);}return null;};}function patchUpdates(_0x11b3f3){return function(_0x1408d1){try{jsonpatch[_0x6708('0x24')](_0x1408d1,_0x11b3f3,!![]);}catch(_0x29aa06){return BPromise[_0x6708('0x25')](_0x29aa06);}return _0x1408d1['save']();};}function saveUpdates(_0x2fc690,_0xcbe622){return function(_0x687ea2){if(_0x687ea2){return _0x687ea2[_0x6708('0x26')](_0x2fc690)[_0x6708('0x27')](function(_0xf42c19){return _0xf42c19;});}return null;};}function removeEntity(_0x5a1142,_0x55399f){return function(_0x39c398){if(_0x39c398){return _0x39c398['destroy']()['then'](function(){_0x5a1142[_0x6708('0x1c')](0xcc)[_0x6708('0x28')]();});}};}function handleEntityNotFound(_0x2335b3,_0x731706){return function(_0x3939b3){if(!_0x3939b3){_0x2335b3[_0x6708('0x1b')](0x194);}return _0x3939b3;};}function handleError(_0x236378,_0x1eb7bb){_0x1eb7bb=_0x1eb7bb||0x1f4;return function(_0x433138){logger[_0x6708('0x29')](_0x433138[_0x6708('0x2a')]);if(_0x433138[_0x6708('0x2b')]){delete _0x433138[_0x6708('0x2b')];}_0x236378['status'](_0x1eb7bb)[_0x6708('0x2c')](_0x433138);};}exports[_0x6708('0x2d')]=function(_0x3c410b,_0x13cf41){var _0x3c509b={},_0x49246d={},_0x430d52={'count':0x0,'rows':[]};var _0x254f25=_[_0x6708('0x2e')](db[_0x6708('0x2f')]['rawAttributes'],function(_0x1a4689){return{'name':_0x1a4689[_0x6708('0x30')],'type':_0x1a4689[_0x6708('0x31')][_0x6708('0x32')]};});_0x49246d['model']=_[_0x6708('0x2e')](_0x254f25,_0x6708('0x2b'));_0x49246d[_0x6708('0x33')]=_['keys'](_0x3c410b[_0x6708('0x33')]);_0x49246d[_0x6708('0x34')]=_['intersection'](_0x49246d['model'],_0x49246d[_0x6708('0x33')]);_0x3c509b[_0x6708('0x35')]=_[_0x6708('0x36')](_0x49246d[_0x6708('0x37')],qs['fields'](_0x3c410b[_0x6708('0x33')][_0x6708('0x38')]));_0x3c509b['attributes']=_0x3c509b['attributes']['length']?_0x3c509b['attributes']:_0x49246d[_0x6708('0x37')];if(!_0x3c410b[_0x6708('0x33')][_0x6708('0x39')]('nolimit')){_0x3c509b['limit']=qs['limit'](_0x3c410b['query'][_0x6708('0x21')]);_0x3c509b[_0x6708('0x1e')]=qs['offset'](_0x3c410b[_0x6708('0x33')][_0x6708('0x1e')]);}_0x3c509b[_0x6708('0x3a')]=qs['sort'](_0x3c410b['query'][_0x6708('0x3b')]);_0x3c509b[_0x6708('0x3c')]=qs[_0x6708('0x34')](_[_0x6708('0x3d')](_0x3c410b[_0x6708('0x33')],_0x49246d[_0x6708('0x34')]),_0x254f25);if(_0x3c410b[_0x6708('0x33')]['filter']){_0x3c509b[_0x6708('0x3c')]=_['merge'](_0x3c509b[_0x6708('0x3c')],{'$or':_['map'](_0x254f25,function(_0x4fe278){if(_0x4fe278['type']!=='VIRTUAL'){var _0x2ca233={};_0x2ca233[_0x4fe278[_0x6708('0x2b')]]={'$like':'%'+_0x3c410b[_0x6708('0x33')]['filter']+'%'};return _0x2ca233;}})});}_0x3c509b=_[_0x6708('0x3e')]({},_0x3c509b,_0x3c410b[_0x6708('0x3f')]);var _0x9ca96f={'where':_0x3c509b[_0x6708('0x3c')]};return db['VoiceDialReport'][_0x6708('0x20')](_0x9ca96f)[_0x6708('0x27')](function(_0x3d82e5){_0x430d52['count']=_0x3d82e5;if(_0x3c410b['query'][_0x6708('0x40')]){_0x3c509b[_0x6708('0x41')]=[{'all':!![]}];}return db[_0x6708('0x2f')][_0x6708('0x42')](_0x3c509b);})[_0x6708('0x27')](function(_0x888d1a){_0x430d52['rows']=_0x888d1a;return _0x430d52;})[_0x6708('0x27')](respondWithFilteredResult(_0x13cf41,_0x3c509b))[_0x6708('0x43')](handleError(_0x13cf41,null));};exports[_0x6708('0x44')]=function(_0x1928c2,_0x31543e){var _0x30710d={'raw':!![],'where':{'id':_0x1928c2['params']['id']}},_0x28e147={};_0x28e147[_0x6708('0x37')]=_[_0x6708('0x45')](db[_0x6708('0x2f')]['rawAttributes']);_0x28e147['query']=_[_0x6708('0x45')](_0x1928c2[_0x6708('0x33')]);_0x28e147['filters']=_[_0x6708('0x36')](_0x28e147['model'],_0x28e147['query']);_0x30710d[_0x6708('0x35')]=_[_0x6708('0x36')](_0x28e147[_0x6708('0x37')],qs[_0x6708('0x38')](_0x1928c2[_0x6708('0x33')][_0x6708('0x38')]));_0x30710d['attributes']=_0x30710d[_0x6708('0x35')][_0x6708('0x46')]?_0x30710d['attributes']:_0x28e147[_0x6708('0x37')];if(_0x1928c2[_0x6708('0x33')]['includeAll']){_0x30710d[_0x6708('0x41')]=[{'all':!![]}];}_0x30710d=_[_0x6708('0x3e')]({},_0x30710d,_0x1928c2['options']);return db[_0x6708('0x2f')][_0x6708('0x47')](_0x30710d)[_0x6708('0x27')](handleEntityNotFound(_0x31543e,null))[_0x6708('0x27')](respondWithResult(_0x31543e,null))[_0x6708('0x43')](handleError(_0x31543e,null));};exports[_0x6708('0x48')]=function(_0xd5f68c,_0xbd0fc8){return db[_0x6708('0x2f')]['create'](_0xd5f68c['body'],{})['then'](respondWithResult(_0xbd0fc8,0xc9))[_0x6708('0x43')](handleError(_0xbd0fc8,null));};exports[_0x6708('0x26')]=function(_0x18a289,_0x3a4534){if(_0x18a289[_0x6708('0x49')]['id']){delete _0x18a289['body']['id'];}return db['VoiceDialReport'][_0x6708('0x47')]({'where':{'id':_0x18a289['params']['id']}})['then'](handleEntityNotFound(_0x3a4534,null))[_0x6708('0x27')](saveUpdates(_0x18a289[_0x6708('0x49')],null))[_0x6708('0x27')](respondWithResult(_0x3a4534,null))[_0x6708('0x43')](handleError(_0x3a4534,null));};exports[_0x6708('0x4a')]=function(_0x4d9965,_0x5ceb52){return db[_0x6708('0x2f')][_0x6708('0x47')]({'where':{'id':_0x4d9965[_0x6708('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ceb52,null))[_0x6708('0x27')](removeEntity(_0x5ceb52,null))[_0x6708('0x43')](handleError(_0x5ceb52,null));};exports[_0x6708('0x4c')]=function(_0x4fa3b6,_0x359387){return db[_0x6708('0x2f')][_0x6708('0x4c')]()[_0x6708('0x27')](respondWithResult(_0x359387,null))['catch'](handleError(_0x359387,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 81aa049..469a7d3 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 _0xd088=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial'];(function(_0x10356a,_0x526f4a){var _0x38d1e8=function(_0xcf1c17){while(--_0xcf1c17){_0x10356a['push'](_0x10356a['shift']());}};_0x38d1e8(++_0x526f4a);}(_0xd088,0x160));var _0x8d08=function(_0x26ba1e,_0x30d06a){_0x26ba1e=_0x26ba1e-0x0;var _0x1eb274=_0xd088[_0x26ba1e];return _0x1eb274;};'use strict';var _=require(_0x8d08('0x0'));var util=require(_0x8d08('0x1'));var logger=require(_0x8d08('0x2'))(_0x8d08('0x3'));var moment=require(_0x8d08('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d08('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d08('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d08('0x7'));module[_0x8d08('0x8')]=function(_0x14e0c2,_0x6890bd){return _0x14e0c2['define'](_0x8d08('0x9'),attributes,{'tableName':_0x8d08('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3967=['api','moment','bluebird','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','../../config/logger'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x3967,0x159));var _0x7396=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x3967[_0x4f34d8];return _0xc97536;};'use strict';var _=require(_0x7396('0x0'));var util=require(_0x7396('0x1'));var logger=require(_0x7396('0x2'))(_0x7396('0x3'));var moment=require(_0x7396('0x4'));var BPromise=require(_0x7396('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7396('0x6'));var rimraf=require('rimraf');var config=require(_0x7396('0x7'));var attributes=require(_0x7396('0x8'));module[_0x7396('0x9')]=function(_0x353883,_0x57085a){return _0x353883[_0x7396('0xa')](_0x7396('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 9ebadf3..1d0cf92 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 _0x63a7=['update','attributes','limit','UpdateVoiceDialReport','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify'];(function(_0x55bd75,_0x217e97){var _0x315d1d=function(_0x1b2f7c){while(--_0x1b2f7c){_0x55bd75['push'](_0x55bd75['shift']());}};_0x315d1d(++_0x217e97);}(_0x63a7,0x165));var _0x763a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x63a7[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x763a('0x0'));var util=require('util');var moment=require(_0x763a('0x1'));var BPromise=require(_0x763a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x763a('0x3'));var db=require(_0x763a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x763a('0x5'))(_0x763a('0x6'));var config=require(_0x763a('0x7'));var jayson=require(_0x763a('0x8'));var client=jayson[_0x763a('0x9')][_0x763a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2711ab,_0x47f297,_0x2f40ec){return new BPromise(function(_0x1e47a7,_0x16daf3){return client[_0x763a('0xb')](_0x2711ab,_0x2f40ec)[_0x763a('0xc')](function(_0x45eec1){logger[_0x763a('0xd')](_0x763a('0xe'),_0x47f297,_0x763a('0xf'));logger['debug'](_0x763a('0x10'),_0x47f297,'request\x20sent',JSON['stringify'](_0x45eec1));if(_0x45eec1[_0x763a('0x11')]){if(_0x45eec1[_0x763a('0x11')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x47f297,_0x45eec1[_0x763a('0x11')]['message']);return _0x16daf3(_0x45eec1[_0x763a('0x11')][_0x763a('0x12')]);}logger[_0x763a('0x11')](_0x763a('0xe'),_0x47f297,_0x45eec1[_0x763a('0x11')]['message']);return _0x1e47a7(_0x45eec1[_0x763a('0x11')]['message']);}else{logger[_0x763a('0xd')](_0x763a('0xe'),_0x47f297,_0x763a('0xf'));_0x1e47a7(_0x45eec1['result'][_0x763a('0x12')]);}})[_0x763a('0x13')](function(_0x3330ef){logger[_0x763a('0x11')](_0x763a('0xe'),_0x47f297,_0x3330ef);_0x16daf3(_0x3330ef);});});}exports[_0x763a('0x14')]=function(_0x28fb5e){var _0x1af1bf=this;return new Promise(function(_0x3d1bc1,_0x47a702){return db[_0x763a('0x15')][_0x763a('0x16')](_0x28fb5e[_0x763a('0x17')],{'raw':_0x28fb5e[_0x763a('0x18')]?_0x28fb5e['options'][_0x763a('0x19')]===undefined?!![]:![]:!![]})[_0x763a('0xc')](function(_0xdb480e){logger[_0x763a('0xd')](_0x763a('0x14'),_0x28fb5e);logger['debug'](_0x763a('0x14'),_0x28fb5e,JSON[_0x763a('0x1a')](_0xdb480e));_0x3d1bc1(_0xdb480e);})['catch'](function(_0x2df9bc){logger[_0x763a('0x11')](_0x763a('0x14'),_0x2df9bc['message'],_0x28fb5e);_0x47a702(_0x1af1bf[_0x763a('0x11')](0x1f4,_0x2df9bc['message']));});});};exports['UpdateVoiceDialReport']=function(_0x38086e){var _0x68b2db=this;return new Promise(function(_0x2af5f6,_0x183c90){return db[_0x763a('0x15')][_0x763a('0x1b')](_0x38086e[_0x763a('0x17')],{'raw':_0x38086e[_0x763a('0x18')]?_0x38086e[_0x763a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38086e[_0x763a('0x18')]?_0x38086e['options']['where']||null:null,'attributes':_0x38086e[_0x763a('0x18')]?_0x38086e[_0x763a('0x18')][_0x763a('0x1c')]||null:null,'limit':_0x38086e[_0x763a('0x18')]?_0x38086e[_0x763a('0x18')][_0x763a('0x1d')]||null:null})[_0x763a('0xc')](function(_0x14dc47){logger[_0x763a('0xd')](_0x763a('0x1e'),_0x38086e);logger[_0x763a('0x1f')](_0x763a('0x1e'),_0x38086e,JSON[_0x763a('0x1a')](_0x14dc47));_0x2af5f6(_0x14dc47);})[_0x763a('0x13')](function(_0x543179){logger[_0x763a('0x11')](_0x763a('0x1e'),_0x543179['message'],_0x38086e);_0x183c90(_0x68b2db[_0x763a('0x11')](0x1f4,_0x543179[_0x763a('0x12')]));});});}; \ No newline at end of file +var _0x8fe6=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','options','UpdateVoiceDialReport','update','body','raw','attributes','limit','catch','lodash','util','bluebird','randomstring'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8fe6,0x113));var _0x68fe=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x8fe6[_0x5224b9];return _0x363bcc;};'use strict';var _=require(_0x68fe('0x0'));var util=require(_0x68fe('0x1'));var moment=require('moment');var BPromise=require(_0x68fe('0x2'));var rs=require(_0x68fe('0x3'));var fs=require('fs');var Redis=require(_0x68fe('0x4'));var db=require(_0x68fe('0x5'))['db'];var utils=require(_0x68fe('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x68fe('0x7'));var jayson=require(_0x68fe('0x8'));var client=jayson[_0x68fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x401323,_0x5f5b92,_0x14ffa9){return new BPromise(function(_0x54ebee,_0x8123f3){return client['request'](_0x401323,_0x14ffa9)[_0x68fe('0xa')](function(_0x328cd0){logger[_0x68fe('0xb')](_0x68fe('0xc'),_0x5f5b92,_0x68fe('0xd'));logger[_0x68fe('0xe')](_0x68fe('0xf'),_0x5f5b92,_0x68fe('0xd'),JSON[_0x68fe('0x10')](_0x328cd0));if(_0x328cd0[_0x68fe('0x11')]){if(_0x328cd0['error'][_0x68fe('0x12')]===0x1f4){logger[_0x68fe('0x11')](_0x68fe('0xc'),_0x5f5b92,_0x328cd0[_0x68fe('0x11')]['message']);return _0x8123f3(_0x328cd0[_0x68fe('0x11')][_0x68fe('0x13')]);}logger['error'](_0x68fe('0xc'),_0x5f5b92,_0x328cd0[_0x68fe('0x11')][_0x68fe('0x13')]);return _0x54ebee(_0x328cd0[_0x68fe('0x11')]['message']);}else{logger[_0x68fe('0xb')](_0x68fe('0xc'),_0x5f5b92,_0x68fe('0xd'));_0x54ebee(_0x328cd0[_0x68fe('0x14')][_0x68fe('0x13')]);}})['catch'](function(_0x12a631){logger[_0x68fe('0x11')](_0x68fe('0xc'),_0x5f5b92,_0x12a631);_0x8123f3(_0x12a631);});});}exports[_0x68fe('0x15')]=function(_0x2e6c98){var _0x527ed0=this;return new Promise(function(_0x36e1e7,_0x32df63){return db[_0x68fe('0x16')]['create'](_0x2e6c98['body'],{'raw':_0x2e6c98[_0x68fe('0x17')]?_0x2e6c98[_0x68fe('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x68fe('0xa')](function(_0x3a6172){logger['info'](_0x68fe('0x15'),_0x2e6c98);logger[_0x68fe('0xe')](_0x68fe('0x15'),_0x2e6c98,JSON[_0x68fe('0x10')](_0x3a6172));_0x36e1e7(_0x3a6172);})['catch'](function(_0x36f788){logger['error']('CreateVoiceDialReport',_0x36f788['message'],_0x2e6c98);_0x32df63(_0x527ed0[_0x68fe('0x11')](0x1f4,_0x36f788[_0x68fe('0x13')]));});});};exports[_0x68fe('0x18')]=function(_0x727d1){var _0x1b89a3=this;return new Promise(function(_0x28e354,_0x24619a){return db[_0x68fe('0x16')][_0x68fe('0x19')](_0x727d1[_0x68fe('0x1a')],{'raw':_0x727d1[_0x68fe('0x17')]?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x727d1[_0x68fe('0x17')]?_0x727d1['options']['where']||null:null,'attributes':_0x727d1['options']?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1c')]||null:null,'limit':_0x727d1['options']?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1d')]||null:null})[_0x68fe('0xa')](function(_0x3a7b0e){logger[_0x68fe('0xb')](_0x68fe('0x18'),_0x727d1);logger[_0x68fe('0xe')]('UpdateVoiceDialReport',_0x727d1,JSON[_0x68fe('0x10')](_0x3a7b0e));_0x28e354(_0x3a7b0e);})[_0x68fe('0x1e')](function(_0x4ac1eb){logger[_0x68fe('0x11')](_0x68fe('0x18'),_0x4ac1eb[_0x68fe('0x13')],_0x727d1);_0x24619a(_0x1b89a3['error'](0x1f4,_0x4ac1eb[_0x68fe('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index d1be8ad..926acb3 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 _0xeba9=['post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5ecf6c,_0x365570){var _0x12b872=function(_0xaeb63b){while(--_0xaeb63b){_0x5ecf6c['push'](_0x5ecf6c['shift']());}};_0x12b872(++_0x365570);}(_0xeba9,0x77));var _0x9eba=function(_0x43d751,_0x1f3d94){_0x43d751=_0x43d751-0x0;var _0x1c1560=_0xeba9[_0x43d751];return _0x1c1560;};'use strict';var multer=require(_0x9eba('0x0'));var util=require(_0x9eba('0x1'));var path=require(_0x9eba('0x2'));var timeout=require(_0x9eba('0x3'));var express=require(_0x9eba('0x4'));var router=express['Router']();var fs_extra=require(_0x9eba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9eba('0x6'));var controller=require(_0x9eba('0x7'));router[_0x9eba('0x8')]('/',auth[_0x9eba('0x9')](),controller[_0x9eba('0xa')]);router[_0x9eba('0x8')](_0x9eba('0xb'),auth[_0x9eba('0x9')](),controller[_0x9eba('0xc')]);router[_0x9eba('0xd')]('/',auth['isAuthenticated'](),controller[_0x9eba('0xe')]);router[_0x9eba('0xd')](_0x9eba('0xf'),auth[_0x9eba('0x9')](),controller[_0x9eba('0x10')]);router[_0x9eba('0x11')](_0x9eba('0xb'),auth[_0x9eba('0x9')](),controller[_0x9eba('0x12')]);router[_0x9eba('0x13')]('/:id',auth[_0x9eba('0x9')](),controller[_0x9eba('0x14')]);module[_0x9eba('0x15')]=router; \ No newline at end of file +var _0x92d2=['get','isAuthenticated','show','create','post','addApplications','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36c0bc,_0x599030){var _0x44f6c8=function(_0x5796c1){while(--_0x5796c1){_0x36c0bc['push'](_0x36c0bc['shift']());}};_0x44f6c8(++_0x599030);}(_0x92d2,0xf4));var _0x292d=function(_0x200b5e,_0x45a8a7){_0x200b5e=_0x200b5e-0x0;var _0x10a69b=_0x92d2[_0x200b5e];return _0x10a69b;};'use strict';var multer=require(_0x292d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x292d('0x1'));var express=require(_0x292d('0x2'));var router=express[_0x292d('0x3')]();var fs_extra=require(_0x292d('0x4'));var auth=require(_0x292d('0x5'));var interaction=require(_0x292d('0x6'));var config=require(_0x292d('0x7'));var controller=require('./voiceExtension.controller');router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller['index']);router['get']('/:id',auth[_0x292d('0x9')](),controller[_0x292d('0xa')]);router['post']('/',auth[_0x292d('0x9')](),controller[_0x292d('0xb')]);router[_0x292d('0xc')]('/:id/applications',auth[_0x292d('0x9')](),controller[_0x292d('0xd')]);router[_0x292d('0xe')]('/:id',auth[_0x292d('0x9')](),controller['update']);router[_0x292d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x292d('0x10')]);module[_0x292d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4eee772..4506190 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 _0xa319=['inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal'];(function(_0x3c8b9c,_0x154674){var _0x4b23c7=function(_0x4aafb5){while(--_0x4aafb5){_0x3c8b9c['push'](_0x3c8b9c['shift']());}};_0x4b23c7(++_0x154674);}(_0xa319,0x14e));var _0x9a31=function(_0x2ca9e2,_0xaa61b0){_0x2ca9e2=_0x2ca9e2-0x0;var _0x414368=_0xa319[_0x2ca9e2];return _0x414368;};'use strict';var Sequelize=require(_0x9a31('0x0'));module[_0x9a31('0x1')]={'context':{'type':Sequelize[_0x9a31('0x2')],'allowNull':![],'unique':_0x9a31('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x9a31('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x9a31('0x3')},'tag':{'type':Sequelize[_0x9a31('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9a31('0x2')],'allowNull':![],'defaultValue':_0x9a31('0x4')},'appdata':{'type':Sequelize[_0x9a31('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9a31('0x5')]('inbound',_0x9a31('0x6'),_0x9a31('0x7'),_0x9a31('0x8'),_0x9a31('0x9'),_0x9a31('0xa'),_0x9a31('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x9a31('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9a31('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x9a31('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9a31('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9a31('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x9a31('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x9a31('0x2')],'defaultValue':_0x9a31('0xe')},'answer':{'type':Sequelize[_0x9a31('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x9a31('0xf')],'get':function(_0x2a276b){return this[_0x9a31('0x10')](_0x9a31('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xf31e=['ENUM','inbound','outbound','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','sequelize','exports','compositeIndex','STRING','NoOp'];(function(_0x38e442,_0x13d85e){var _0x450a29=function(_0x3aa7b7){while(--_0x3aa7b7){_0x38e442['push'](_0x38e442['shift']());}};_0x450a29(++_0x13d85e);}(_0xf31e,0x17b));var _0xef31=function(_0x4f3a01,_0xcc5226){_0x4f3a01=_0x4f3a01-0x0;var _0x21f1c2=_0xf31e[_0x4f3a01];return _0x21f1c2;};'use strict';var Sequelize=require(_0xef31('0x0'));module[_0xef31('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef31('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef31('0x2')},'priority':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xef31('0x2')},'tag':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':_0xef31('0x4')},'appdata':{'type':Sequelize[_0xef31('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xef31('0x5')](_0xef31('0x6'),_0xef31('0x7'),'internal',_0xef31('0x8'),_0xef31('0x9'),_0xef31('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xef31('0x3')]},'interval':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':_0xef31('0xb')},'IntervalId':{'type':Sequelize[_0xef31('0xc')]},'isApp':{'type':Sequelize[_0xef31('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xef31('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xef31('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xef31('0xc')]},'recordingFormat':{'type':Sequelize[_0xef31('0x3')],'defaultValue':_0xef31('0xe')},'answer':{'type':Sequelize[_0xef31('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x409564){return this[_0xef31('0xf')]('exten');}},'alias':{'type':Sequelize[_0xef31('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 7b3d2cc..c09d5f7 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 _0xced5=['apply','reject','save','then','destroy','get','InboundRoutes','internal','ignore','value','includes','type','find','name','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','OutboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','catch','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x3ee61d,_0x4320c7){var _0x4346b2=function(_0x2b22c9){while(--_0x2b22c9){_0x3ee61d['push'](_0x3ee61d['shift']());}};_0x4346b2(++_0x4320c7);}(_0xced5,0x12f));var _0x5ced=function(_0x2f048a,_0x255812){_0x2f048a=_0x2f048a-0x0;var _0x2442c9=_0xced5[_0x2f048a];return _0x2442c9;};'use strict';var emlformat=require(_0x5ced('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ced('0x1'));var rp=require(_0x5ced('0x2'));var moment=require('moment');var BPromise=require(_0x5ced('0x3'));var Mustache=require(_0x5ced('0x4'));var util=require(_0x5ced('0x5'));var path=require(_0x5ced('0x6'));var sox=require(_0x5ced('0x7'));var csv=require(_0x5ced('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ced('0x9'));var crypto=require(_0x5ced('0xa'));var jsforce=require(_0x5ced('0xb'));var deskjs=require(_0x5ced('0xc'));var toCsv=require(_0x5ced('0x8'));var querystring=require(_0x5ced('0xd'));var Papa=require('papaparse');var Redis=require(_0x5ced('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5ced('0xf'));var as=require(_0x5ced('0x10'));var hardwareService=require(_0x5ced('0x11'));var logger=require(_0x5ced('0x12'))(_0x5ced('0x13'));var utils=require(_0x5ced('0x14'));var config=require(_0x5ced('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ced('0x16'))['db'];config[_0x5ced('0x17')]=_[_0x5ced('0x18')](config['redis'],{'host':_0x5ced('0x19'),'port':0x18eb});var socket=require(_0x5ced('0x1a'))(new Redis(config[_0x5ced('0x17')]));require(_0x5ced('0x1b'))[_0x5ced('0x1c')](socket);function respondWithStatusCode(_0x95ab41,_0x12549e){_0x12549e=_0x12549e||0xcc;return function(_0x32d423){if(_0x32d423){return _0x95ab41[_0x5ced('0x1d')](_0x12549e);}return _0x95ab41[_0x5ced('0x1e')](_0x12549e)[_0x5ced('0x1f')]();};}function respondWithResult(_0x1aa968,_0x49a665){_0x49a665=_0x49a665||0xc8;return function(_0x2a7686){if(_0x2a7686){return _0x1aa968[_0x5ced('0x1e')](_0x49a665)['json'](_0x2a7686);}};}function respondWithFilteredResult(_0x4a6342,_0x4f6b22){return function(_0x3fcbe5){if(_0x3fcbe5){var _0x21e205=typeof _0x4f6b22[_0x5ced('0x20')]===_0x5ced('0x21')&&typeof _0x4f6b22[_0x5ced('0x22')]===_0x5ced('0x21');var _0x38efeb=_0x3fcbe5[_0x5ced('0x23')];var _0x447dfa=_0x21e205?0x0:_0x4f6b22[_0x5ced('0x20')];var _0x5ecc69=_0x21e205?_0x3fcbe5[_0x5ced('0x23')]:_0x4f6b22[_0x5ced('0x20')]+_0x4f6b22[_0x5ced('0x22')];var _0xd0bbf7;if(_0x5ecc69>=_0x38efeb){_0x5ecc69=_0x38efeb;_0xd0bbf7=0xc8;}else{_0xd0bbf7=0xce;}_0x4a6342[_0x5ced('0x1e')](_0xd0bbf7);return _0x4a6342[_0x5ced('0x24')](_0x5ced('0x25'),_0x447dfa+'-'+_0x5ecc69+'/'+_0x38efeb)[_0x5ced('0x26')](_0x3fcbe5);}return null;};}function patchUpdates(_0x28659f){return function(_0x279a29){try{jsonpatch[_0x5ced('0x27')](_0x279a29,_0x28659f,!![]);}catch(_0x508c12){return BPromise[_0x5ced('0x28')](_0x508c12);}return _0x279a29[_0x5ced('0x29')]();};}function saveUpdates(_0x4c66ca,_0x2f2285){return function(_0xe4ef5d){if(_0xe4ef5d){return _0xe4ef5d['update'](_0x4c66ca)[_0x5ced('0x2a')](function(_0x4975e4){return _0x4975e4;});}return null;};}function removeEntity(_0x1ea509,_0x14cf15){return function(_0x431e64){if(_0x431e64){return _0x431e64[_0x5ced('0x2b')]()[_0x5ced('0x2a')](function(){var _0x2da3bc=_0x431e64[_0x5ced('0x2c')]({'plain':!![]});var _0x39923b=[{'name':_0x5ced('0x2d'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x5ced('0x2e'),'ignore':![]}];var _0x29b0c8=_(_0x39923b)['filter'](_0x5ced('0x2f'))['map'](_0x5ced('0x30'))[_0x5ced('0x30')]();if(_[_0x5ced('0x31')](_0x29b0c8,_0x2da3bc[_0x5ced('0x32')])){return;}var _0x3ede16=_[_0x5ced('0x33')](_0x39923b,[_0x5ced('0x30'),_0x2da3bc[_0x5ced('0x32')]])[_0x5ced('0x34')];return db['UserProfileResource'][_0x5ced('0x2b')]({'where':{'type':_0x3ede16,'resourceId':_0x2da3bc['id']}})[_0x5ced('0x2a')](function(){return _0x431e64;});})[_0x5ced('0x2a')](function(){_0x1ea509[_0x5ced('0x1e')](0xcc)[_0x5ced('0x1f')]();});}};}function handleEntityNotFound(_0x25712d,_0x47e73a){return function(_0x4538b1){if(!_0x4538b1){_0x25712d[_0x5ced('0x1d')](0x194);}return _0x4538b1;};}function handleError(_0x5661a8,_0x3f16c4){_0x3f16c4=_0x3f16c4||0x1f4;return function(_0x29a2bc){logger[_0x5ced('0x35')](_0x29a2bc[_0x5ced('0x36')]);if(_0x29a2bc[_0x5ced('0x34')]){delete _0x29a2bc[_0x5ced('0x34')];}_0x5661a8[_0x5ced('0x1e')](_0x3f16c4)[_0x5ced('0x37')](_0x29a2bc);};}exports['index']=function(_0x223080,_0x450c3b){var _0x4dcaf3={},_0x478ee7={},_0x47839d={'count':0x0,'rows':[]};var _0x483924=_['map'](db[_0x5ced('0x38')][_0x5ced('0x39')],function(_0x171b6c){return{'name':_0x171b6c[_0x5ced('0x3a')],'type':_0x171b6c[_0x5ced('0x32')][_0x5ced('0x3b')]};});_0x478ee7[_0x5ced('0x3c')]=_[_0x5ced('0x3d')](_0x483924,'name');_0x478ee7[_0x5ced('0x3e')]=_['keys'](_0x223080['query']);_0x478ee7[_0x5ced('0x3f')]=_[_0x5ced('0x40')](_0x478ee7[_0x5ced('0x3c')],_0x478ee7[_0x5ced('0x3e')]);_0x4dcaf3[_0x5ced('0x41')]=_['intersection'](_0x478ee7[_0x5ced('0x3c')],qs[_0x5ced('0x42')](_0x223080['query']['fields']));_0x4dcaf3[_0x5ced('0x41')]=_0x4dcaf3[_0x5ced('0x41')][_0x5ced('0x43')]?_0x4dcaf3['attributes']:_0x478ee7[_0x5ced('0x3c')];if(!_0x223080[_0x5ced('0x3e')]['hasOwnProperty']('nolimit')){_0x4dcaf3['limit']=qs[_0x5ced('0x22')](_0x223080['query'][_0x5ced('0x22')]);_0x4dcaf3['offset']=qs[_0x5ced('0x20')](_0x223080[_0x5ced('0x3e')]['offset']);}_0x4dcaf3[_0x5ced('0x44')]=qs[_0x5ced('0x45')](_0x223080['query'][_0x5ced('0x45')]);_0x4dcaf3[_0x5ced('0x46')]=qs['filters'](_[_0x5ced('0x47')](_0x223080['query'],_0x478ee7[_0x5ced('0x3f')]),_0x483924);if(_0x223080[_0x5ced('0x3e')][_0x5ced('0x48')]){_0x4dcaf3[_0x5ced('0x46')]=_[_0x5ced('0x49')](_0x4dcaf3[_0x5ced('0x46')],{'$or':_[_0x5ced('0x3d')](_0x483924,function(_0x42aee1){if(_0x42aee1[_0x5ced('0x32')]!==_0x5ced('0x4a')){var _0x4f5209={};_0x4f5209[_0x42aee1[_0x5ced('0x34')]]={'$like':'%'+_0x223080['query'][_0x5ced('0x48')]+'%'};return _0x4f5209;}})});}_0x4dcaf3=_[_0x5ced('0x49')]({},_0x4dcaf3,_0x223080[_0x5ced('0x4b')]);var _0x40b099={'where':_0x4dcaf3[_0x5ced('0x46')]};return db[_0x5ced('0x38')]['count'](_0x40b099)[_0x5ced('0x2a')](function(_0x564476){_0x47839d[_0x5ced('0x23')]=_0x564476;if(_0x223080[_0x5ced('0x3e')][_0x5ced('0x4c')]){_0x4dcaf3[_0x5ced('0x4d')]=[{'all':!![]}];}return db[_0x5ced('0x38')]['findAll'](_0x4dcaf3);})[_0x5ced('0x2a')](function(_0x2939d5){_0x47839d[_0x5ced('0x4e')]=_0x2939d5;return _0x47839d;})['then'](respondWithFilteredResult(_0x450c3b,_0x4dcaf3))['catch'](handleError(_0x450c3b,null));};exports[_0x5ced('0x4f')]=function(_0x3291d0,_0x2d692e){var _0x44d2f6={'raw':![],'where':{'id':_0x3291d0[_0x5ced('0x50')]['id']}},_0x5c2167={};_0x5c2167['model']=_['keys'](db[_0x5ced('0x38')][_0x5ced('0x39')]);_0x5c2167['query']=_[_0x5ced('0x51')](_0x3291d0[_0x5ced('0x3e')]);_0x5c2167[_0x5ced('0x3f')]=_[_0x5ced('0x40')](_0x5c2167['model'],_0x5c2167[_0x5ced('0x3e')]);_0x44d2f6['attributes']=_[_0x5ced('0x40')](_0x5c2167[_0x5ced('0x3c')],qs[_0x5ced('0x42')](_0x3291d0[_0x5ced('0x3e')][_0x5ced('0x42')]));_0x44d2f6[_0x5ced('0x41')]=_0x44d2f6[_0x5ced('0x41')][_0x5ced('0x43')]?_0x44d2f6[_0x5ced('0x41')]:_0x5c2167[_0x5ced('0x3c')];if(_0x3291d0['query'][_0x5ced('0x4c')]){_0x44d2f6['include']=[{'all':!![]}];}_0x44d2f6=_[_0x5ced('0x49')]({},_0x44d2f6,_0x3291d0[_0x5ced('0x4b')]);return db[_0x5ced('0x38')][_0x5ced('0x33')](_0x44d2f6)[_0x5ced('0x2a')](handleEntityNotFound(_0x2d692e,null))[_0x5ced('0x2a')](respondWithResult(_0x2d692e,null))['catch'](handleError(_0x2d692e,null));};exports[_0x5ced('0x2b')]=function(_0x13ea0f,_0x3ce05c){return db[_0x5ced('0x38')][_0x5ced('0x33')]({'where':{'id':_0x13ea0f['params']['id']}})[_0x5ced('0x2a')](handleEntityNotFound(_0x3ce05c,null))[_0x5ced('0x2a')](removeEntity(_0x3ce05c,null))['catch'](handleError(_0x3ce05c,null));};exports[_0x5ced('0x52')]=function(_0x25eefd,_0x52bc53){if(_0x25eefd[_0x5ced('0x53')][_0x5ced('0x32')]===_0x5ced('0x54')&&!_[_0x5ced('0x55')](_0x25eefd[_0x5ced('0x53')]['exten'],'_')){_0x25eefd[_0x5ced('0x53')][_0x5ced('0x56')]='_'[_0x5ced('0x57')](_0x25eefd[_0x5ced('0x53')]['exten']);}return db[_0x5ced('0x38')]['create'](_0x25eefd['body'],{'raw':![]})[_0x5ced('0x2a')](function(_0x5f423a){var _0x48b810=_0x25eefd[_0x5ced('0x58')][_0x5ced('0x2c')]({'plain':!![]});if(!_0x48b810)throw new Error(_0x5ced('0x59'));if(_0x48b810[_0x5ced('0x5a')]==='user'){var _0x6327d1=_0x5f423a['get']({'plain':!![]});var _0x3da09d=[{'name':'InboundRoutes','value':_0x5ced('0x5b')},{'name':_0x5ced('0x5c'),'value':_0x5ced('0x54')},{'name':_0x5ced('0x5d'),'value':_0x5ced('0x2e')}];var _0x30ea85=_[_0x5ced('0x33')](_0x3da09d,['value',_0x6327d1[_0x5ced('0x32')]])[_0x5ced('0x34')];return db[_0x5ced('0x5e')][_0x5ced('0x33')]({'where':{'name':_0x30ea85,'userProfileId':_0x48b810['userProfileId']},'raw':!![]})[_0x5ced('0x2a')](function(_0x13c32e){if(_0x13c32e&&_0x13c32e[_0x5ced('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x6327d1[_0x5ced('0x34')],'resourceId':_0x6327d1['id'],'type':_0x13c32e[_0x5ced('0x34')],'sectionId':_0x13c32e['id']},{})[_0x5ced('0x2a')](function(){return _0x5f423a;});}else{return _0x5f423a;}})[_0x5ced('0x60')](function(_0x2d7c43){logger[_0x5ced('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d7c43);throw _0x2d7c43;});}return _0x5f423a;})[_0x5ced('0x2a')](respondWithResult(_0x52bc53,0xc9))[_0x5ced('0x60')](handleError(_0x52bc53,null));};exports['update']=function(_0x191140,_0x29ef66){if(_0x191140[_0x5ced('0x53')]['id']){delete _0x191140[_0x5ced('0x53')]['id'];}return db[_0x5ced('0x38')]['find']({'where':{'id':_0x191140[_0x5ced('0x50')]['id']}})[_0x5ced('0x2a')](handleEntityNotFound(_0x29ef66,null))['then'](function(_0x30e8d4){if(_0x30e8d4){return db[_0x5ced('0x38')][_0x5ced('0x61')](_[_0x5ced('0x47')](_0x191140[_0x5ced('0x53')],[_0x5ced('0x56'),_0x5ced('0x62'),_0x5ced('0x63'),_0x5ced('0x64'),_0x5ced('0x65'),_0x5ced('0x66'),_0x5ced('0x67')]),{'where':{'context':_0x30e8d4['context'],'exten':_0x30e8d4[_0x5ced('0x56')]},'individualHooks':!![]})[_0x5ced('0x2a')](function(_0xb1d8d5){return _0xb1d8d5;});}return null;})['then'](respondWithStatusCode(_0x29ef66,null))[_0x5ced('0x60')](handleError(_0x29ef66,null));};exports[_0x5ced('0x68')]=function(_0x549c2f,_0x3a13d3){return db['VoiceExtension']['findOne']({'where':{'id':_0x549c2f[_0x5ced('0x50')]['id']}})[_0x5ced('0x2a')](function(_0x33409d){if(_0x33409d){return db[_0x5ced('0x69')][_0x5ced('0x6a')](function(_0x476023){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x549c2f['params']['id']},'transaction':_0x476023})[_0x5ced('0x2a')](function(){var _0x50d477=_['map'](_0x549c2f[_0x5ced('0x53')],function(_0x152dde){_0x152dde[_0x5ced('0x6b')]=_0x549c2f['params']['id'];_0x152dde[_0x5ced('0x6c')]=!![];return _0x152dde;});var _0x5955b8=_0x549c2f['query'][_0x5ced('0x6d')]&&_0x549c2f[_0x5ced('0x3e')][_0x5ced('0x6d')][_0x5ced('0x6e')]()===_0x5ced('0x6f')?!![]:![];return _0x33409d[_0x5ced('0x70')](_0x50d477,_0x5955b8);})[_0x5ced('0x2a')](function(_0x377631){return db[_0x5ced('0x38')][_0x5ced('0x71')](_0x377631,{'transaction':_0x476023});});})[_0x5ced('0x2a')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x549c2f['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x5ced('0x2a')](respondWithResult(_0x3a13d3,null))[_0x5ced('0x60')](handleError(_0x3a13d3,null));}; \ No newline at end of file +var _0x9b99=['transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','value','type','find','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x9b99,0xf5));var _0x99b9=function(_0x4eb677,_0x2845a3){_0x4eb677=_0x4eb677-0x0;var _0x35e7bc=_0x9b99[_0x4eb677];return _0x35e7bc;};'use strict';var emlformat=require(_0x99b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99b9('0x2'));var moment=require(_0x99b9('0x3'));var BPromise=require(_0x99b9('0x4'));var Mustache=require(_0x99b9('0x5'));var util=require(_0x99b9('0x6'));var path=require(_0x99b9('0x7'));var sox=require(_0x99b9('0x8'));var csv=require('to-csv');var ejs=require(_0x99b9('0x9'));var fs=require('fs');var fs_extra=require(_0x99b9('0xa'));var _=require(_0x99b9('0xb'));var squel=require(_0x99b9('0xc'));var crypto=require(_0x99b9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x99b9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x99b9('0xf'));var Redis=require(_0x99b9('0x10'));var authService=require(_0x99b9('0x11'));var qs=require(_0x99b9('0x12'));var as=require(_0x99b9('0x13'));var hardwareService=require(_0x99b9('0x14'));var logger=require('../../config/logger')(_0x99b9('0x15'));var utils=require(_0x99b9('0x16'));var config=require(_0x99b9('0x17'));var licenseUtil=require(_0x99b9('0x18'));var db=require(_0x99b9('0x19'))['db'];config['redis']=_[_0x99b9('0x1a')](config[_0x99b9('0x1b')],{'host':_0x99b9('0x1c'),'port':0x18eb});var socket=require(_0x99b9('0x1d'))(new Redis(config[_0x99b9('0x1b')]));require(_0x99b9('0x1e'))[_0x99b9('0x1f')](socket);function respondWithStatusCode(_0x4f316a,_0x829a47){_0x829a47=_0x829a47||0xcc;return function(_0x2db51c){if(_0x2db51c){return _0x4f316a[_0x99b9('0x20')](_0x829a47);}return _0x4f316a[_0x99b9('0x21')](_0x829a47)['end']();};}function respondWithResult(_0x1df3e4,_0x14ccbe){_0x14ccbe=_0x14ccbe||0xc8;return function(_0x2c35a6){if(_0x2c35a6){return _0x1df3e4['status'](_0x14ccbe)[_0x99b9('0x22')](_0x2c35a6);}};}function respondWithFilteredResult(_0x1b7de6,_0x4b2346){return function(_0x4b9d09){if(_0x4b9d09){var _0x1289ea=typeof _0x4b2346[_0x99b9('0x23')]==='undefined'&&typeof _0x4b2346[_0x99b9('0x24')]===_0x99b9('0x25');var _0x10e31a=_0x4b9d09[_0x99b9('0x26')];var _0x39fccf=_0x1289ea?0x0:_0x4b2346[_0x99b9('0x23')];var _0x3084c1=_0x1289ea?_0x4b9d09['count']:_0x4b2346['offset']+_0x4b2346['limit'];var _0x3ab4da;if(_0x3084c1>=_0x10e31a){_0x3084c1=_0x10e31a;_0x3ab4da=0xc8;}else{_0x3ab4da=0xce;}_0x1b7de6[_0x99b9('0x21')](_0x3ab4da);return _0x1b7de6[_0x99b9('0x27')](_0x99b9('0x28'),_0x39fccf+'-'+_0x3084c1+'/'+_0x10e31a)[_0x99b9('0x22')](_0x4b9d09);}return null;};}function patchUpdates(_0x57f92d){return function(_0x4a830e){try{jsonpatch[_0x99b9('0x29')](_0x4a830e,_0x57f92d,!![]);}catch(_0x2b55e8){return BPromise[_0x99b9('0x2a')](_0x2b55e8);}return _0x4a830e['save']();};}function saveUpdates(_0x3af63a,_0x270833){return function(_0xae2f48){if(_0xae2f48){return _0xae2f48[_0x99b9('0x2b')](_0x3af63a)['then'](function(_0x15f51c){return _0x15f51c;});}return null;};}function removeEntity(_0x17672f,_0x565ae6){return function(_0x15726c){if(_0x15726c){return _0x15726c['destroy']()[_0x99b9('0x2c')](function(){var _0x491e8b=_0x15726c[_0x99b9('0x2d')]({'plain':!![]});var _0x519ef0=[{'name':_0x99b9('0x2e'),'value':'inbound','ignore':![]},{'name':_0x99b9('0x2f'),'value':_0x99b9('0x30'),'ignore':![]},{'name':'InternalRoutes','value':_0x99b9('0x31'),'ignore':![]}];var _0x422a2c=_(_0x519ef0)[_0x99b9('0x32')](_0x99b9('0x33'))['map'](_0x99b9('0x34'))[_0x99b9('0x34')]();if(_['includes'](_0x422a2c,_0x491e8b[_0x99b9('0x35')])){return;}var _0x457c35=_[_0x99b9('0x36')](_0x519ef0,['value',_0x491e8b[_0x99b9('0x35')]])['name'];return db[_0x99b9('0x37')][_0x99b9('0x38')]({'where':{'type':_0x457c35,'resourceId':_0x491e8b['id']}})['then'](function(){return _0x15726c;});})[_0x99b9('0x2c')](function(){_0x17672f[_0x99b9('0x21')](0xcc)[_0x99b9('0x39')]();});}};}function handleEntityNotFound(_0x37efb7,_0x5766dc){return function(_0x132f95){if(!_0x132f95){_0x37efb7[_0x99b9('0x20')](0x194);}return _0x132f95;};}function handleError(_0x46fa88,_0x1a2165){_0x1a2165=_0x1a2165||0x1f4;return function(_0x2a8ead){logger[_0x99b9('0x3a')](_0x2a8ead[_0x99b9('0x3b')]);if(_0x2a8ead[_0x99b9('0x3c')]){delete _0x2a8ead[_0x99b9('0x3c')];}_0x46fa88[_0x99b9('0x21')](_0x1a2165)[_0x99b9('0x3d')](_0x2a8ead);};}exports[_0x99b9('0x3e')]=function(_0x20e31c,_0x262333){var _0x260654={},_0x264cb4={},_0x85516c={'count':0x0,'rows':[]};var _0x4b1123=_['map'](db['VoiceExtension'][_0x99b9('0x3f')],function(_0x11e229){return{'name':_0x11e229['fieldName'],'type':_0x11e229[_0x99b9('0x35')][_0x99b9('0x40')]};});_0x264cb4[_0x99b9('0x41')]=_[_0x99b9('0x42')](_0x4b1123,'name');_0x264cb4[_0x99b9('0x43')]=_[_0x99b9('0x44')](_0x20e31c[_0x99b9('0x43')]);_0x264cb4[_0x99b9('0x45')]=_[_0x99b9('0x46')](_0x264cb4['model'],_0x264cb4['query']);_0x260654['attributes']=_[_0x99b9('0x46')](_0x264cb4[_0x99b9('0x41')],qs[_0x99b9('0x47')](_0x20e31c['query'][_0x99b9('0x47')]));_0x260654['attributes']=_0x260654[_0x99b9('0x48')][_0x99b9('0x49')]?_0x260654['attributes']:_0x264cb4['model'];if(!_0x20e31c['query'][_0x99b9('0x4a')](_0x99b9('0x4b'))){_0x260654[_0x99b9('0x24')]=qs[_0x99b9('0x24')](_0x20e31c['query'][_0x99b9('0x24')]);_0x260654[_0x99b9('0x23')]=qs['offset'](_0x20e31c[_0x99b9('0x43')][_0x99b9('0x23')]);}_0x260654[_0x99b9('0x4c')]=qs[_0x99b9('0x4d')](_0x20e31c[_0x99b9('0x43')]['sort']);_0x260654[_0x99b9('0x4e')]=qs[_0x99b9('0x45')](_[_0x99b9('0x4f')](_0x20e31c[_0x99b9('0x43')],_0x264cb4['filters']),_0x4b1123);if(_0x20e31c['query'][_0x99b9('0x32')]){_0x260654['where']=_[_0x99b9('0x50')](_0x260654['where'],{'$or':_[_0x99b9('0x42')](_0x4b1123,function(_0x1e5f18){if(_0x1e5f18['type']!==_0x99b9('0x51')){var _0x1bc7a8={};_0x1bc7a8[_0x1e5f18[_0x99b9('0x3c')]]={'$like':'%'+_0x20e31c[_0x99b9('0x43')]['filter']+'%'};return _0x1bc7a8;}})});}_0x260654=_[_0x99b9('0x50')]({},_0x260654,_0x20e31c[_0x99b9('0x52')]);var _0x2abf1b={'where':_0x260654[_0x99b9('0x4e')]};return db[_0x99b9('0x53')][_0x99b9('0x26')](_0x2abf1b)[_0x99b9('0x2c')](function(_0x3e46f8){_0x85516c[_0x99b9('0x26')]=_0x3e46f8;if(_0x20e31c[_0x99b9('0x43')][_0x99b9('0x54')]){_0x260654[_0x99b9('0x55')]=[{'all':!![]}];}return db[_0x99b9('0x53')][_0x99b9('0x56')](_0x260654);})[_0x99b9('0x2c')](function(_0x3e106e){_0x85516c[_0x99b9('0x57')]=_0x3e106e;return _0x85516c;})['then'](respondWithFilteredResult(_0x262333,_0x260654))[_0x99b9('0x58')](handleError(_0x262333,null));};exports[_0x99b9('0x59')]=function(_0x4b0447,_0x2498fc){var _0x1c4a33={'raw':![],'where':{'id':_0x4b0447[_0x99b9('0x5a')]['id']}},_0x130d48={};_0x130d48[_0x99b9('0x41')]=_['keys'](db[_0x99b9('0x53')][_0x99b9('0x3f')]);_0x130d48[_0x99b9('0x43')]=_[_0x99b9('0x44')](_0x4b0447['query']);_0x130d48['filters']=_['intersection'](_0x130d48[_0x99b9('0x41')],_0x130d48[_0x99b9('0x43')]);_0x1c4a33[_0x99b9('0x48')]=_[_0x99b9('0x46')](_0x130d48[_0x99b9('0x41')],qs[_0x99b9('0x47')](_0x4b0447['query'][_0x99b9('0x47')]));_0x1c4a33['attributes']=_0x1c4a33[_0x99b9('0x48')][_0x99b9('0x49')]?_0x1c4a33[_0x99b9('0x48')]:_0x130d48[_0x99b9('0x41')];if(_0x4b0447[_0x99b9('0x43')][_0x99b9('0x54')]){_0x1c4a33[_0x99b9('0x55')]=[{'all':!![]}];}_0x1c4a33=_['merge']({},_0x1c4a33,_0x4b0447[_0x99b9('0x52')]);return db[_0x99b9('0x53')][_0x99b9('0x36')](_0x1c4a33)[_0x99b9('0x2c')](handleEntityNotFound(_0x2498fc,null))[_0x99b9('0x2c')](respondWithResult(_0x2498fc,null))['catch'](handleError(_0x2498fc,null));};exports[_0x99b9('0x38')]=function(_0x1f5dc6,_0x1264f1){return db[_0x99b9('0x53')]['find']({'where':{'id':_0x1f5dc6[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](handleEntityNotFound(_0x1264f1,null))['then'](removeEntity(_0x1264f1,null))[_0x99b9('0x58')](handleError(_0x1264f1,null));};exports[_0x99b9('0x5b')]=function(_0xa8d3f5,_0x403fb6){if(_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x35')]===_0x99b9('0x30')&&!_[_0x99b9('0x5d')](_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x5e')],'_')){_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x5e')]='_'['concat'](_0xa8d3f5[_0x99b9('0x5c')]['exten']);}return db['VoiceExtension'][_0x99b9('0x5b')](_0xa8d3f5[_0x99b9('0x5c')],{'raw':![]})[_0x99b9('0x2c')](function(_0x2ded25){var _0x2676ca=_0xa8d3f5['user'][_0x99b9('0x2d')]({'plain':!![]});if(!_0x2676ca)throw new Error(_0x99b9('0x5f'));if(_0x2676ca[_0x99b9('0x60')]==='user'){var _0x3d886f=_0x2ded25[_0x99b9('0x2d')]({'plain':!![]});var _0x8a061a=[{'name':'InboundRoutes','value':_0x99b9('0x61')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x1bccd3=_[_0x99b9('0x36')](_0x8a061a,['value',_0x3d886f['type']])[_0x99b9('0x3c')];return db[_0x99b9('0x62')][_0x99b9('0x36')]({'where':{'name':_0x1bccd3,'userProfileId':_0x2676ca[_0x99b9('0x63')]},'raw':!![]})['then'](function(_0x571bf0){if(_0x571bf0&&_0x571bf0[_0x99b9('0x64')]===0x0){return db['UserProfileResource'][_0x99b9('0x5b')]({'name':_0x3d886f[_0x99b9('0x3c')],'resourceId':_0x3d886f['id'],'type':_0x571bf0[_0x99b9('0x3c')],'sectionId':_0x571bf0['id']},{})[_0x99b9('0x2c')](function(){return _0x2ded25;});}else{return _0x2ded25;}})[_0x99b9('0x58')](function(_0x3bdda3){logger[_0x99b9('0x3a')](_0x99b9('0x65'),_0x3bdda3);throw _0x3bdda3;});}return _0x2ded25;})[_0x99b9('0x2c')](respondWithResult(_0x403fb6,0xc9))[_0x99b9('0x58')](handleError(_0x403fb6,null));};exports[_0x99b9('0x2b')]=function(_0x50afb0,_0x52de7e){if(_0x50afb0[_0x99b9('0x5c')]['id']){delete _0x50afb0[_0x99b9('0x5c')]['id'];}return db[_0x99b9('0x53')][_0x99b9('0x36')]({'where':{'id':_0x50afb0[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](handleEntityNotFound(_0x52de7e,null))['then'](function(_0x57c567){if(_0x57c567){return db[_0x99b9('0x53')][_0x99b9('0x2b')](_['pick'](_0x50afb0[_0x99b9('0x5c')],[_0x99b9('0x5e'),_0x99b9('0x66'),_0x99b9('0x67'),'recordingFormat',_0x99b9('0x68'),_0x99b9('0x69'),'alias']),{'where':{'context':_0x57c567[_0x99b9('0x66')],'exten':_0x57c567[_0x99b9('0x5e')]},'individualHooks':!![]})[_0x99b9('0x2c')](function(_0x4784dc){return _0x4784dc;});}return null;})[_0x99b9('0x2c')](respondWithStatusCode(_0x52de7e,null))[_0x99b9('0x58')](handleError(_0x52de7e,null));};exports[_0x99b9('0x6a')]=function(_0x3b1cc1,_0x5bd77a){return db[_0x99b9('0x53')][_0x99b9('0x6b')]({'where':{'id':_0x3b1cc1[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](function(_0x15ca61){if(_0x15ca61){return db[_0x99b9('0x6c')][_0x99b9('0x6d')](function(_0x5ced22){return db[_0x99b9('0x53')][_0x99b9('0x38')]({'where':{'VoiceExtensionId':_0x3b1cc1[_0x99b9('0x5a')]['id']},'transaction':_0x5ced22})['then'](function(){var _0x2e5f4a=_[_0x99b9('0x42')](_0x3b1cc1[_0x99b9('0x5c')],function(_0x1456da){_0x1456da[_0x99b9('0x6e')]=_0x3b1cc1[_0x99b9('0x5a')]['id'];_0x1456da[_0x99b9('0x6f')]=!![];return _0x1456da;});var _0x130767=_0x3b1cc1['query']['rewriteDial']&&_0x3b1cc1[_0x99b9('0x43')][_0x99b9('0x70')][_0x99b9('0x71')]()==='true'?!![]:![];return _0x15ca61[_0x99b9('0x72')](_0x2e5f4a,_0x130767);})[_0x99b9('0x2c')](function(_0x11eb46){return db[_0x99b9('0x53')][_0x99b9('0x73')](_0x11eb46,{'transaction':_0x5ced22});});})[_0x99b9('0x2c')](function(){return db[_0x99b9('0x53')][_0x99b9('0x74')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3b1cc1[_0x99b9('0x5a')]['id']},'order':_0x99b9('0x75')});});}})[_0x99b9('0x2c')](respondWithResult(_0x5bd77a,null))[_0x99b9('0x58')](handleError(_0x5bd77a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 571e746..a06fc55 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 _0xa6d9=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa6d9,0x1ab));var _0x9a6d=function(_0xbeca06,_0x5dd47e){_0xbeca06=_0xbeca06-0x0;var _0x2e13d3=_0xa6d9[_0xbeca06];return _0x2e13d3;};'use strict';var EventEmitter=require(_0x9a6d('0x0'));var VoiceExtension=require(_0x9a6d('0x1'))['db'][_0x9a6d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9a6d('0x3')](0x0);var events={'afterCreate':_0x9a6d('0x4'),'afterUpdate':_0x9a6d('0x5'),'afterDestroy':_0x9a6d('0x6')};function emitEvent(_0x18ee15){return function(_0x1af9f1,_0x1c2b7f,_0x51bb01){VoiceExtensionEvents[_0x9a6d('0x7')](_0x18ee15+':'+_0x1af9f1['id'],_0x1af9f1);VoiceExtensionEvents[_0x9a6d('0x7')](_0x18ee15,_0x1af9f1);_0x51bb01(null);};}for(var e in events){if(events[_0x9a6d('0x8')](e)){var event=events[e];VoiceExtension[_0x9a6d('0x9')](e,emitEvent(event));}}module[_0x9a6d('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x219c=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x4ced92,_0x3c8d70){var _0x2beb57=function(_0x5e4e39){while(--_0x5e4e39){_0x4ced92['push'](_0x4ced92['shift']());}};_0x2beb57(++_0x3c8d70);}(_0x219c,0x17f));var _0xc219=function(_0x353bef,_0x49fa1d){_0x353bef=_0x353bef-0x0;var _0x5c2da7=_0x219c[_0x353bef];return _0x5c2da7;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xc219('0x0'))['db'][_0xc219('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc219('0x2')](0x0);var events={'afterCreate':_0xc219('0x3'),'afterUpdate':_0xc219('0x4'),'afterDestroy':_0xc219('0x5')};function emitEvent(_0x3a2ccc){return function(_0x38be2c,_0x1a5bfa,_0x2cc184){VoiceExtensionEvents[_0xc219('0x6')](_0x3a2ccc+':'+_0x38be2c['id'],_0x38be2c);VoiceExtensionEvents['emit'](_0x3a2ccc,_0x38be2c);_0x2cc184(null);};}for(var e in events){if(events[_0xc219('0x7')](e)){var event=events[e];VoiceExtension[_0xc219('0x8')](e,emitEvent(event));}}module[_0xc219('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 4e43a1b..936a239 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 _0x1111=['queue','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','options','split','length','name','trunk','param','phone','prefix','join','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x1111,0x1db));var _0x1111=function(_0x2141c5,_0x3a7273){_0x2141c5=_0x2141c5-0x0;var _0x9251ca=_0x1111[_0x2141c5];return _0x9251ca;};'use strict';var util=require(_0x1111('0x0'));var _=require(_0x1111('0x1'));var attributes=require(_0x1111('0x2'));module['exports']=function(_0x5b61c1){var _0x39ecd9=_0x5b61c1[_0x1111('0x3')];function _0x32db6d(_0x55a505){var _0x291d78=0x2;var _0x220186=[{'type':_0x55a505[_0x1111('0x4')],'app':_0x1111('0x5'),'appdata':_0x1111('0x6')+_0x55a505[_0x1111('0x4')],'context':_0x55a505[_0x1111('0x7')],'exten':_0x55a505[_0x1111('0x8')],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']},{'type':_0x55a505[_0x1111('0x4')],'app':_0x55a505[_0x1111('0x9')]?_0x1111('0x5'):_0x1111('0xa'),'appdata':_0x55a505[_0x1111('0x9')]?_0x1111('0xb')+_0x55a505['alias']:_0x1111('0xc'),'context':_0x55a505['context'],'exten':_0x55a505[_0x1111('0x8')],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']}];if(_0x55a505['type']===_0x1111('0xd')){_0x220186[_0x1111('0xe')]({'type':_0x1111('0xd'),'app':_0x1111('0x5'),'appdata':_0x1111('0xf')+_0x55a505['id'],'context':_0x55a505[_0x1111('0x7')],'exten':_0x55a505['exten'],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']});}_0x220186[_0x1111('0xe')]({'type':_0x55a505[_0x1111('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x55a505['context'],'exten':_0x55a505['exten'],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']},{'type':_0x55a505[_0x1111('0x4')],'app':_0x1111('0x5'),'appdata':_0x1111('0x10'),'context':_0x55a505[_0x1111('0x7')],'exten':_0x55a505['exten'],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']},{'type':_0x55a505['type'],'app':_0x1111('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x55a505[_0x1111('0x7')],'exten':_0x55a505[_0x1111('0x8')],'priority':_0x291d78++,'VoiceExtensionId':_0x55a505['id']});return _0x220186;}function _0x48b265(_0x3dc7fc){var _0x30323a=0x2;var _0x4d0160=[{'type':'outbound','app':_0x1111('0x5'),'appdata':'CDR(type)=outbound','context':_0x3dc7fc['context'],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':'outbound','app':_0x3dc7fc[_0x1111('0x9')]?_0x1111('0x5'):_0x1111('0xa'),'appdata':_0x3dc7fc[_0x1111('0x9')]?_0x1111('0xb')+_0x3dc7fc['alias']:'No\x20alias\x20set','context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc['exten'],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':_0x1111('0x11'),'app':'Set','appdata':_0x1111('0x12')+(_0x3dc7fc[_0x1111('0x13')]?_0x1111('0x14')+_0x3dc7fc[_0x1111('0x13')]+'}':_0x1111('0x15')),'context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':'outbound','app':_0x1111('0x5'),'appdata':'CDR(routeid)='+_0x3dc7fc['id'],'context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':'outbound','app':'ExecIf','appdata':_0x1111('0x16')+(_0x30323a+0x2)+_0x1111('0x17')+(_0x30323a+0x1)+')','context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':'outbound','app':_0x1111('0x5'),'appdata':_0x3dc7fc[_0x1111('0x13')]?_0x1111('0x18')+_0x3dc7fc[_0x1111('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x3dc7fc['context'],'exten':_0x3dc7fc['exten'],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':_0x1111('0x11'),'app':_0x1111('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':_0x1111('0x11'),'app':_0x1111('0x5'),'appdata':_0x1111('0x10'),'context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':'outbound','app':_0x1111('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':_0x1111('0x11'),'app':_0x1111('0x5'),'appdata':_0x1111('0x19')+_0x3dc7fc['id'],'context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']}];if(_0x3dc7fc[_0x1111('0x1a')](_0x1111('0x1b'))&&_0x3dc7fc[_0x1111('0x1b')]!==_0x1111('0x1c')){_0x4d0160[_0x1111('0xe')]({'type':'outbound','app':_0x1111('0x5'),'appdata':_0x1111('0x1d'),'context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc[_0x1111('0x8')],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']},{'type':_0x1111('0x11'),'app':_0x1111('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3dc7fc['recordingFormat']||'wav','context':_0x3dc7fc[_0x1111('0x7')],'exten':_0x3dc7fc['exten'],'priority':_0x30323a++,'VoiceExtensionId':_0x3dc7fc['id']});}return _0x4d0160;}function _0x34493e(_0x2257e9){var _0x1b0ac1=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x1111('0x1e'),'param':0x2},{'name':'url','param':0x3}];var _0x31ccea={};var _0x2deb8d=_0x2257e9[_0x1111('0x1f')](',');var _0x2d21c3=[];for(var _0x598507=0x0;_0x598507<_0x1b0ac1[_0x1111('0x20')];_0x598507++){switch(_0x1b0ac1[_0x598507][_0x1111('0x21')]){case _0x1111('0x22'):_0x31ccea['trunk']=_0x2deb8d[_0x1b0ac1[_0x598507][_0x1111('0x23')]][_0x1111('0x1f')]('/')[0x1];_0x31ccea[_0x1111('0x24')]=_0x2deb8d[_0x1b0ac1[_0x598507][_0x1111('0x23')]][_0x1111('0x1f')]('/')[0x2];_0x31ccea[_0x1111('0x25')]=_0x31ccea[_0x1111('0x24')]?_0x31ccea['phone'][_0x1111('0x1f')]('$')[0x0]:undefined;_0x31ccea['phone']=route[_0x1111('0x13')]?(_0x31ccea[_0x1111('0x25')]||'')+_0x1111('0x14')+route[_0x1111('0x13')]+'}':(_0x31ccea[_0x1111('0x25')]||'')+_0x1111('0x15');_0x2d21c3[_0x1b0ac1[_0x598507][_0x1111('0x23')]]=['SIP',_0x31ccea[_0x1111('0x22')],_0x31ccea[_0x1111('0x24')]][_0x1111('0x26')]('/');break;case _0x1111('0x1e'):_0x31ccea[_0x1111('0x1e')]=_0x2deb8d[_0x1b0ac1[_0x598507][_0x1111('0x23')]];if(route[_0x1111('0x1b')]!==_0x1111('0x1c')){if(_0x31ccea['options']['indexOf'](_0x1111('0x27'))<0x0){_0x31ccea['options']+='U(xcally-mixmonitor-context)';}}else{_0x31ccea[_0x1111('0x1e')]=_0x31ccea['options']['replace'](_0x1111('0x27'),'');}_0x2d21c3[_0x1b0ac1[_0x598507]['param']]=_0x31ccea[_0x1111('0x1e')];break;default:_0x2d21c3[_0x1b0ac1[_0x598507][_0x1111('0x23')]]=_0x2deb8d[_0x1b0ac1[_0x598507]['param']];}}return _0x2d21c3[_0x1111('0x26')](',');}function _0xdb1f16(_0x3b069a,_0x1e3b6c,_0x56dcf6,_0x2e14e2){return new Promise(function(_0x438d6a,_0x69d442){var _0xcd6bbf=[];if(_[_0x1111('0x28')](_0x1e3b6c))return _0x438d6a(_0xcd6bbf);_0x39ecd9[_0x1111('0x29')][_0x1111('0x2a')]({'attributes':['id',_0x1111('0x2b'),_0x1111('0x2c')],'raw':!![]})[_0x1111('0x2d')](function(_0x297d93){for(var _0x545394=0x0,_0x2520d3=0x0;_0x545394<_0x1e3b6c[_0x1111('0x20')];_0x545394++,_0x2520d3=0x0){var _0x346cf8=_0x1e3b6c[_0x545394];var _0x19ddb5=[];var _0x42a9ad=[];if(_0x346cf8['interval']!==_0x1111('0x2e')){_0x346cf8['intervals']=[_0x346cf8['interval']];}else{_0x346cf8[_0x1111('0x2f')]=_0x346cf8['IntervalId']?_['map'](_[_0x1111('0x30')](_0x297d93,{'IntervalId':_0x346cf8[_0x1111('0x2c')]}),'interval'):[];}_0x346cf8[_0x1111('0x7')]=_0x3b069a[_0x1111('0x7')];_0x346cf8[_0x1111('0x8')]=_0x3b069a['exten'];if(_0x346cf8[_0x1111('0x4')])_0x346cf8[_0x1111('0x4')]=_0x346cf8[_0x1111('0x4')][_0x1111('0x31')]();if(_0x3b069a[_0x1111('0x4')]===_0x1111('0x11')){if(_0x346cf8[_0x1111('0x1a')](_0x1111('0x32'))&&_0x346cf8[_0x1111('0x32')]&&_0x346cf8['tag']!=='--'){_0x19ddb5[_0x1111('0xe')]({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':_0x1111('0x5'),'appdata':_0x1111('0x33')+_0x346cf8['tag'],'context':_0x3b069a[_0x1111('0x7')],'exten':_0x3b069a[_0x1111('0x8')],'priority':_0x346cf8['intervals']['length']+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});}_0x19ddb5['push']({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':_0x1111('0x34'),'appdata':_0x1111('0x35')+(_0x346cf8['callerID']?_0x1111('0x36')+_0x346cf8[_0x1111('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3b069a['context'],'exten':_0x3b069a['exten'],'priority':_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')]+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});}else{if(_0x346cf8[_0x1111('0x1a')](_0x1111('0x38'))){if([_0x1111('0x39'),'playback'][_0x1111('0x3a')](_0x346cf8['app'][_0x1111('0x31')]())&&_0x346cf8[_0x1111('0x3b')]!==_0x1111('0x3c')){if(_0x346cf8[_0x1111('0x38')]){_0x19ddb5[_0x1111('0xe')]({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':_0x1111('0x34'),'appdata':_0x1111('0x3d'),'context':_0x3b069a[_0x1111('0x7')],'exten':_0x3b069a[_0x1111('0x8')],'priority':_0x346cf8['intervals']['length']+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});_0x19ddb5[_0x1111('0xe')]({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':'Set','appdata':_0x1111('0x3e'),'context':_0x3b069a[_0x1111('0x7')],'exten':_0x3b069a[_0x1111('0x8')],'priority':_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')]+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});}else{_0x19ddb5[_0x1111('0xe')]({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':_0x1111('0x34'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3b069a[_0x1111('0x7')],'exten':_0x3b069a[_0x1111('0x8')],'priority':_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')]+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});_0x19ddb5['push']({'type':_0x346cf8[_0x1111('0x4')][_0x1111('0x31')](),'app':_0x1111('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3b069a[_0x1111('0x7')],'exten':_0x3b069a[_0x1111('0x8')],'priority':_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')]+_0x56dcf6+_0x2520d3++,'VoiceExtensionId':_0x3b069a['id']});}}}}for(var _0x4ed420=0x0;_0x4ed420<_0x346cf8['intervals'][_0x1111('0x20')];_0x4ed420++){var _0xc77340=_0x56dcf6+_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')];var _0x500953=_0x4ed420===_0x346cf8[_0x1111('0x2f')][_0x1111('0x20')]-0x1?_0x56dcf6+_0x19ddb5[_0x1111('0x20')]+_0x42a9ad[_0x1111('0x20')]+0x2:_0x56dcf6+_0x4ed420+0x1;_0x19ddb5[_0x1111('0x3f')](_0x4ed420,0x0,{'type':_0x3b069a[_0x1111('0x4')],'app':_0x1111('0x40'),'appdata':_0x346cf8[_0x1111('0x2f')][_0x4ed420]+'?'+_0x3b069a[_0x1111('0x7')]+_0x1111('0x41')+_0xc77340+':'+_0x3b069a[_0x1111('0x7')]+_0x1111('0x41')+_0x500953,'exten':_0x3b069a[_0x1111('0x8')],'context':_0x3b069a['context'],'priority':_0x56dcf6+_0x4ed420,'VoiceExtensionId':_0x3b069a['id']});}if(_0x2e14e2&&_0x346cf8[_0x1111('0x3b')]===_0x1111('0x42'))_0x346cf8[_0x1111('0x43')]=_0x34493e(_0x346cf8[_0x1111('0x43')]);_0x346cf8[_0x1111('0x44')]=_0x19ddb5['length']?_[_0x1111('0x45')](_0x19ddb5)[_0x1111('0x44')]+0x1:_0x56dcf6;_0xcd6bbf=_[_0x1111('0x46')](_0xcd6bbf,_0x19ddb5,[_0x346cf8],_0x42a9ad);_0x56dcf6=_[_0x1111('0x45')](_0xcd6bbf)[_0x1111('0x44')]+0x1;}return _0x438d6a(_0xcd6bbf);})[_0x1111('0x47')](function(_0x5da7fa){_0x69d442(_0x5da7fa);});});}return _0x5b61c1[_0x1111('0x48')](_0x1111('0x49'),attributes,{'tableName':_0x1111('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xc625b,_0x37a02f){var _0x538e5a=this;var _0x19320d=_0x538e5a[_0x1111('0x4')]===_0x1111('0x11')?_0x48b265(_0x538e5a):_0x32db6d(_0x538e5a);return _0xdb1f16(_0x538e5a,_0xc625b,_[_0x1111('0x45')](_0x19320d)[_0x1111('0x44')]+0x1,_0x37a02f)['then'](function(_0x11c438){var _0x9a790=_['concat'](_0x19320d,_0x11c438);_0x9a790['push']({'type':_0x538e5a['type'],'app':_0x1111('0x4b'),'exten':_0x538e5a[_0x1111('0x8')],'context':_0x538e5a[_0x1111('0x7')],'priority':_[_0x1111('0x45')](_0x9a790)[_0x1111('0x44')]+0x1,'VoiceExtensionId':_0x538e5a['id']});return _0x9a790;});}}});}; \ No newline at end of file +var _0x4a1e=['appdata','priority','last','catch','voice_extensions','then','concat','Hangup','util','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x4a1e,0x150));var _0xe4a1=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x4a1e[_0x49fcfb];return _0x964926;};'use strict';var util=require(_0xe4a1('0x0'));var _=require(_0xe4a1('0x1'));var attributes=require(_0xe4a1('0x2'));module['exports']=function(_0x45ea04){var _0x1db28c=_0x45ea04[_0xe4a1('0x3')];function _0x24e3ab(_0x28f648){var _0xe8b181=0x2;var _0x3bd8b0=[{'type':_0x28f648['type'],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x5')+_0x28f648[_0xe4a1('0x6')],'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0x28f648['alias']?_0xe4a1('0x4'):_0xe4a1('0x9'),'appdata':_0x28f648['alias']?_0xe4a1('0xa')+_0x28f648[_0xe4a1('0xb')]:'No\x20alias\x20set','context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']}];if(_0x28f648[_0xe4a1('0x6')]===_0xe4a1('0xc')){_0x3bd8b0['push']({'type':_0xe4a1('0xc'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xd')+_0x28f648['id'],'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']});}_0x3bd8b0[_0xe4a1('0xe')]({'type':_0x28f648[_0xe4a1('0x6')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xf'),'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x10'),'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648['exten'],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']});return _0x3bd8b0;}function _0x129c89(_0x3f35b7){var _0x327742=0x2;var _0x3aa8c1=[{'type':'outbound','app':_0xe4a1('0x4'),'appdata':'CDR(type)=outbound','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0x3f35b7[_0xe4a1('0xb')]?_0xe4a1('0x4'):_0xe4a1('0x9'),'appdata':_0x3f35b7['alias']?_0xe4a1('0xa')+_0x3f35b7['alias']:_0xe4a1('0x12'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x13')+(_0x3f35b7[_0xe4a1('0x14')]?'${EXTEN:'+_0x3f35b7['cutdigits']+'}':_0xe4a1('0x15')),'context':_0x3f35b7['context'],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xd')+_0x3f35b7['id'],'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':'outbound','app':_0xe4a1('0x16'),'appdata':_0xe4a1('0x17')+(_0x327742+0x2)+_0xe4a1('0x18')+(_0x327742+0x1)+')','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':'outbound','app':'Set','appdata':_0x3f35b7[_0xe4a1('0x14')]?_0xe4a1('0x19')+_0x3f35b7['cutdigits']+'}':_0xe4a1('0x1a'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x1b'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xf'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x1c')+_0x3f35b7['id'],'context':_0x3f35b7['context'],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']}];if(_0x3f35b7[_0xe4a1('0x1d')](_0xe4a1('0x1e'))&&_0x3f35b7['recordingFormat']!==_0xe4a1('0x1f')){_0x3aa8c1[_0xe4a1('0xe')]({'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x20'),'context':_0x3f35b7['context'],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x21')+_0x3f35b7[_0xe4a1('0x1e')]||'wav','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']});}return _0x3aa8c1;}function _0xa4da1d(_0x1b4909){var _0x5fa5f9=[{'name':_0xe4a1('0x22'),'param':0x0},{'name':_0xe4a1('0x23'),'param':0x1},{'name':_0xe4a1('0x24'),'param':0x2},{'name':_0xe4a1('0x25'),'param':0x3}];var _0x58d836={};var _0x4ca725=_0x1b4909[_0xe4a1('0x26')](',');var _0x156901=[];for(var _0x454186=0x0;_0x454186<_0x5fa5f9[_0xe4a1('0x27')];_0x454186++){switch(_0x5fa5f9[_0x454186][_0xe4a1('0x28')]){case'trunk':_0x58d836[_0xe4a1('0x22')]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]][_0xe4a1('0x26')]('/')[0x1];_0x58d836[_0xe4a1('0x2a')]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]][_0xe4a1('0x26')]('/')[0x2];_0x58d836[_0xe4a1('0x2b')]=_0x58d836[_0xe4a1('0x2a')]?_0x58d836[_0xe4a1('0x2a')][_0xe4a1('0x26')]('$')[0x0]:undefined;_0x58d836[_0xe4a1('0x2a')]=route[_0xe4a1('0x14')]?(_0x58d836[_0xe4a1('0x2b')]||'')+_0xe4a1('0x2c')+route[_0xe4a1('0x14')]+'}':(_0x58d836['prefix']||'')+_0xe4a1('0x15');_0x156901[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]]=[_0xe4a1('0x2d'),_0x58d836[_0xe4a1('0x22')],_0x58d836[_0xe4a1('0x2a')]]['join']('/');break;case _0xe4a1('0x24'):_0x58d836['options']=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]];if(route[_0xe4a1('0x1e')]!==_0xe4a1('0x1f')){if(_0x58d836[_0xe4a1('0x24')]['indexOf'](_0xe4a1('0x2e'))<0x0){_0x58d836[_0xe4a1('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x58d836['options']=_0x58d836[_0xe4a1('0x24')][_0xe4a1('0x2f')](_0xe4a1('0x2e'),'');}_0x156901[_0x5fa5f9[_0x454186]['param']]=_0x58d836[_0xe4a1('0x24')];break;default:_0x156901[_0x5fa5f9[_0x454186]['param']]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]];}}return _0x156901[_0xe4a1('0x30')](',');}function _0x4cb81e(_0x36426f,_0x141ced,_0x32daff,_0x2a491d){return new Promise(function(_0x4f56ef,_0x34c93f){var _0x51c0fe=[];if(_[_0xe4a1('0x31')](_0x141ced))return _0x4f56ef(_0x51c0fe);_0x1db28c[_0xe4a1('0x32')][_0xe4a1('0x33')]({'attributes':['id',_0xe4a1('0x34'),_0xe4a1('0x35')],'raw':!![]})['then'](function(_0x120958){for(var _0x36cd2a=0x0,_0x5e4b10=0x0;_0x36cd2a<_0x141ced[_0xe4a1('0x27')];_0x36cd2a++,_0x5e4b10=0x0){var _0x1f9b98=_0x141ced[_0x36cd2a];var _0x349fb5=[];var _0x399f98=[];if(_0x1f9b98[_0xe4a1('0x34')]!==_0xe4a1('0x36')){_0x1f9b98['intervals']=[_0x1f9b98[_0xe4a1('0x34')]];}else{_0x1f9b98[_0xe4a1('0x37')]=_0x1f9b98[_0xe4a1('0x35')]?_['map'](_[_0xe4a1('0x38')](_0x120958,{'IntervalId':_0x1f9b98[_0xe4a1('0x35')]}),_0xe4a1('0x34')):[];}_0x1f9b98[_0xe4a1('0x7')]=_0x36426f[_0xe4a1('0x7')];_0x1f9b98[_0xe4a1('0x8')]=_0x36426f[_0xe4a1('0x8')];if(_0x1f9b98[_0xe4a1('0x6')])_0x1f9b98[_0xe4a1('0x6')]=_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')]();if(_0x36426f[_0xe4a1('0x6')]===_0xe4a1('0x11')){if(_0x1f9b98[_0xe4a1('0x1d')](_0xe4a1('0x3a'))&&_0x1f9b98[_0xe4a1('0x3a')]&&_0x1f9b98[_0xe4a1('0x3a')]!=='--'){_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x3b')+_0x1f9b98[_0xe4a1('0x3a')],'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1f9b98[_0xe4a1('0x3c')]?'Set(CALLERID(all)='+_0x1f9b98['callerID']+')':_0xe4a1('0x3d')),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98['intervals'][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}else{if(_0x1f9b98['hasOwnProperty'](_0xe4a1('0x3e'))){if(['queue',_0xe4a1('0x3f')][_0xe4a1('0x40')](_0x1f9b98[_0xe4a1('0x41')][_0xe4a1('0x39')]())&&_0x1f9b98[_0xe4a1('0x42')]!=='custom'){if(_0x1f9b98['answer']){_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x16'),'appdata':_0xe4a1('0x43'),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':'Set','appdata':_0xe4a1('0x44'),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}else{_0x349fb5['push']({'type':_0x1f9b98['type'][_0xe4a1('0x39')](),'app':'ExecIf','appdata':_0xe4a1('0x45'),'context':_0x36426f['context'],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}}}}for(var _0x2995d1=0x0;_0x2995d1<_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')];_0x2995d1++){var _0x78445e=_0x32daff+_0x1f9b98['intervals']['length'];var _0x39158d=_0x2995d1===_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]-0x1?_0x32daff+_0x349fb5[_0xe4a1('0x27')]+_0x399f98['length']+0x2:_0x32daff+_0x2995d1+0x1;_0x349fb5[_0xe4a1('0x46')](_0x2995d1,0x0,{'type':_0x36426f[_0xe4a1('0x6')],'app':_0xe4a1('0x47'),'appdata':_0x1f9b98[_0xe4a1('0x37')][_0x2995d1]+'?'+_0x36426f['context']+_0xe4a1('0x48')+_0x78445e+':'+_0x36426f['context']+_0xe4a1('0x48')+_0x39158d,'exten':_0x36426f[_0xe4a1('0x8')],'context':_0x36426f[_0xe4a1('0x7')],'priority':_0x32daff+_0x2995d1,'VoiceExtensionId':_0x36426f['id']});}if(_0x2a491d&&_0x1f9b98['appType']===_0xe4a1('0x49'))_0x1f9b98['appdata']=_0xa4da1d(_0x1f9b98[_0xe4a1('0x4a')]);_0x1f9b98[_0xe4a1('0x4b')]=_0x349fb5[_0xe4a1('0x27')]?_[_0xe4a1('0x4c')](_0x349fb5)['priority']+0x1:_0x32daff;_0x51c0fe=_['concat'](_0x51c0fe,_0x349fb5,[_0x1f9b98],_0x399f98);_0x32daff=_[_0xe4a1('0x4c')](_0x51c0fe)[_0xe4a1('0x4b')]+0x1;}return _0x4f56ef(_0x51c0fe);})[_0xe4a1('0x4d')](function(_0x2e94a2){_0x34c93f(_0x2e94a2);});});}return _0x45ea04['define']('VoiceExtension',attributes,{'tableName':_0xe4a1('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x401cfd,_0xf9b01a){var _0x39ad2f=this;var _0x5efa2f=_0x39ad2f[_0xe4a1('0x6')]===_0xe4a1('0x11')?_0x129c89(_0x39ad2f):_0x24e3ab(_0x39ad2f);return _0x4cb81e(_0x39ad2f,_0x401cfd,_['last'](_0x5efa2f)[_0xe4a1('0x4b')]+0x1,_0xf9b01a)[_0xe4a1('0x4f')](function(_0x3bbd01){var _0x3f6602=_[_0xe4a1('0x50')](_0x5efa2f,_0x3bbd01);_0x3f6602[_0xe4a1('0xe')]({'type':_0x39ad2f[_0xe4a1('0x6')],'app':_0xe4a1('0x51'),'exten':_0x39ad2f[_0xe4a1('0x8')],'context':_0x39ad2f[_0xe4a1('0x7')],'priority':_[_0xe4a1('0x4c')](_0x3f6602)['priority']+0x1,'VoiceExtensionId':_0x39ad2f['id']});return _0x3f6602;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 35f560c..f64eff3 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 _0x814b=['include','map','model','attributes','then','info','GetVoiceExtension','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','limit'];(function(_0x8c2c37,_0x4b377e){var _0x1245da=function(_0x5004a5){while(--_0x5004a5){_0x8c2c37['push'](_0x8c2c37['shift']());}};_0x1245da(++_0x4b377e);}(_0x814b,0x1a2));var _0xb814=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x814b[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});}exports['GetVoiceExtension']=function(_0x57c128){var _0xb684ea=this;return new Promise(function(_0x24211d,_0x25b6b6){return db['VoiceExtension'][_0xb814('0x1c')]({'raw':_0x57c128['options']?_0x57c128[_0xb814('0x1d')][_0xb814('0x1e')]===undefined?!![]:![]:!![],'where':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')][_0xb814('0x1f')]||null:null,'attributes':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')]['attributes']||null:null,'limit':_0x57c128[_0xb814('0x1d')]?_0x57c128['options'][_0xb814('0x20')]||null:null,'include':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')][_0xb814('0x21')]?_[_0xb814('0x22')](_0x57c128[_0xb814('0x1d')][_0xb814('0x21')],function(_0x5755ea){return{'model':db[_0x5755ea[_0xb814('0x23')]],'as':_0x5755ea['as'],'attributes':_0x5755ea[_0xb814('0x24')],'include':_0x5755ea[_0xb814('0x21')]?_[_0xb814('0x22')](_0x5755ea[_0xb814('0x21')],function(_0x1d5965){return{'model':db[_0x1d5965[_0xb814('0x23')]],'as':_0x1d5965['as'],'attributes':_0x1d5965[_0xb814('0x24')],'include':_0x1d5965['include']?_[_0xb814('0x22')](_0x1d5965[_0xb814('0x21')],function(_0x52ed64){return{'model':db[_0x52ed64[_0xb814('0x23')]],'as':_0x52ed64['as'],'attributes':_0x52ed64[_0xb814('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb814('0x25')](function(_0x499f22){logger[_0xb814('0x26')](_0xb814('0x27'),_0x57c128);logger['debug'](_0xb814('0x27'),_0x57c128,JSON['stringify'](_0x499f22));_0x24211d(_0x499f22);})[_0xb814('0x28')](function(_0x5f3e9b){logger['error'](_0xb814('0x27'),_0x5f3e9b['message'],_0x57c128);_0x25b6b6(_0xb684ea[_0xb814('0x18')](0x1f4,_0x5f3e9b[_0xb814('0x1a')]));});});}; \ No newline at end of file +var _0xc92f=['then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','socket.io-emitter','./voiceExtension.socket','request'];(function(_0x2063ef,_0x3fbc1b){var _0x2f69d8=function(_0x282672){while(--_0x282672){_0x2063ef['push'](_0x2063ef['shift']());}};_0x2f69d8(++_0x3fbc1b);}(_0xc92f,0xf3));var _0xfc92=function(_0x6dc196,_0x5b921c){_0x6dc196=_0x6dc196-0x0;var _0x2972dd=_0xc92f[_0x6dc196];return _0x2972dd;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require('moment');var BPromise=require(_0xfc92('0x2'));var rs=require(_0xfc92('0x3'));var fs=require('fs');var Redis=require(_0xfc92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x5'));var logger=require(_0xfc92('0x6'))(_0xfc92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')]['http']({'port':0x232a});config[_0xfc92('0x9')]=_['defaults'](config[_0xfc92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc92('0xa'))(new Redis(config[_0xfc92('0x9')]));require(_0xfc92('0xb'))['register'](socket);function respondWithRpcPromise(_0x18a53b,_0x379756,_0x213ed0){return new BPromise(function(_0x552eab,_0x66d993){return client[_0xfc92('0xc')](_0x18a53b,_0x213ed0)[_0xfc92('0xd')](function(_0x5dee97){logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));logger[_0xfc92('0x11')](_0xfc92('0x12'),_0x379756,_0xfc92('0x10'),JSON[_0xfc92('0x13')](_0x5dee97));if(_0x5dee97[_0xfc92('0x14')]){if(_0x5dee97['error']['code']===0x1f4){logger['error'](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')]['message']);return _0x66d993(_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);}logger[_0xfc92('0x14')](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);return _0x552eab(_0x5dee97['error'][_0xfc92('0x15')]);}else{logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));_0x552eab(_0x5dee97['result']['message']);}})[_0xfc92('0x16')](function(_0x328345){logger['error'](_0xfc92('0xf'),_0x379756,_0x328345);_0x66d993(_0x328345);});});}exports[_0xfc92('0x17')]=function(_0x597ea2){var _0x1f0b90=this;return new Promise(function(_0x5ec474,_0x376551){return db[_0xfc92('0x18')][_0xfc92('0x19')]({'raw':_0x597ea2[_0xfc92('0x1a')]?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1b')]===undefined?!![]:![]:!![],'where':_0x597ea2['options']?_0x597ea2[_0xfc92('0x1a')]['where']||null:null,'attributes':_0x597ea2[_0xfc92('0x1a')]?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1c')]||null:null,'limit':_0x597ea2['options']?_0x597ea2['options']['limit']||null:null,'include':_0x597ea2['options']?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1d')]?_[_0xfc92('0x1e')](_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1d')],function(_0xa43f14){return{'model':db[_0xa43f14[_0xfc92('0x1f')]],'as':_0xa43f14['as'],'attributes':_0xa43f14[_0xfc92('0x1c')],'include':_0xa43f14['include']?_[_0xfc92('0x1e')](_0xa43f14[_0xfc92('0x1d')],function(_0x35cea1){return{'model':db[_0x35cea1['model']],'as':_0x35cea1['as'],'attributes':_0x35cea1[_0xfc92('0x1c')],'include':_0x35cea1[_0xfc92('0x1d')]?_['map'](_0x35cea1['include'],function(_0x25de92){return{'model':db[_0x25de92[_0xfc92('0x1f')]],'as':_0x25de92['as'],'attributes':_0x25de92['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc92('0xd')](function(_0x4d62fe){logger[_0xfc92('0xe')](_0xfc92('0x17'),_0x597ea2);logger['debug'](_0xfc92('0x17'),_0x597ea2,JSON[_0xfc92('0x13')](_0x4d62fe));_0x5ec474(_0x4d62fe);})[_0xfc92('0x16')](function(_0x3adb82){logger[_0xfc92('0x14')](_0xfc92('0x17'),_0x3adb82[_0xfc92('0x15')],_0x597ea2);_0x376551(_0x1f0b90[_0xfc92('0x14')](0x1f4,_0x3adb82[_0xfc92('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4944d6d..cbb6741 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x814b,0x1a2));var _0xb814=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x814b[_0x53fe97];return _0x5c49a2;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x4b1b32,_0x9d0982){var _0x218dc1=function(_0x4d16f7){while(--_0x4d16f7){_0x4b1b32['push'](_0x4b1b32['shift']());}};_0x218dc1(++_0x9d0982);}(_0x326f,0xd1));var _0xf326=function(_0x48d669,_0x5a1b87){_0x48d669=_0x48d669-0x0;var _0xdaaaeb=_0x326f[_0x48d669];return _0xdaaaeb;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ce2a30f..2735dd6 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xadb5,0xad));var _0x5adb=function(_0x15ca7c,_0x4c7295){_0x15ca7c=_0x15ca7c-0x0;var _0x370f35=_0xadb5[_0x15ca7c];return _0x370f35;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./voiceMail.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0x6d11,0xbf));var _0x16d1=function(_0x1744d1,_0xb5208d){_0x1744d1=_0x1744d1-0x0;var _0x30b57d=_0x6d11[_0x1744d1];return _0x30b57d;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6ab6e48..a41db20 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 _0xe9d2=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','sequelize','STRING'];(function(_0x2c7ee0,_0x3cda66){var _0x1a845b=function(_0x21c217){while(--_0x21c217){_0x2c7ee0['push'](_0x2c7ee0['shift']());}};_0x1a845b(++_0x3cda66);}(_0xe9d2,0x1c9));var _0x2e9d=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe9d2[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x2e9d('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x2e9d('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x2e9d('0x2'),'unique':_0x2e9d('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x2e9d('0x3')},'password':{'type':Sequelize[_0x2e9d('0x1')]},'fullname':{'type':Sequelize[_0x2e9d('0x1')]},'email':{'type':Sequelize[_0x2e9d('0x1')],'validate':{'isEmail':!![]},'set':function(_0x57a53c){this[_0x2e9d('0x4')](_0x2e9d('0x5'),typeof _0x57a53c===_0x2e9d('0x6')&&_0x57a53c[_0x2e9d('0x7')]()?_0x57a53c[_0x2e9d('0x7')]():null);}},'pager':{'type':Sequelize[_0x2e9d('0x1')]},'tz':{'type':Sequelize[_0x2e9d('0x1')],'defaultValue':_0x2e9d('0x8')},'attach':{'type':Sequelize['ENUM'](_0x2e9d('0x9'),'no'),'defaultValue':_0x2e9d('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x2e9d('0x9'),'no'),'defaultValue':_0x2e9d('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x2e9d('0x1')]},'callback':{'type':Sequelize[_0x2e9d('0x1')]},'review':{'type':Sequelize[_0x2e9d('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2e9d('0xa')](_0x2e9d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2e9d('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2e9d('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x2e9d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2e9d('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2e9d('0xa')](_0x2e9d('0x9'),'no'),'defaultValue':_0x2e9d('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2e9d('0xa')](_0x2e9d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x2e9d('0x9'),'no'),'defaultValue':_0x2e9d('0x9'),'allowNull':![]},'stamp':{'type':_0x2e9d('0xc')},'emailsubject':{'type':Sequelize[_0x2e9d('0x1')]},'emailbody':{'type':Sequelize[_0x2e9d('0x1')]},'maxsecs':{'type':Sequelize[_0x2e9d('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2e9d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2e9d('0xe')],'get':function(){return this[_0x2e9d('0xf')](_0x2e9d('0x10'))+'\x20-\x20'+this[_0x2e9d('0xf')]('mailbox');}}}; \ No newline at end of file +var _0xd553=['from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING'];(function(_0x37ee83,_0x331b5e){var _0x3aa1f4=function(_0x5ac27d){while(--_0x5ac27d){_0x37ee83['push'](_0x37ee83['shift']());}};_0x3aa1f4(++_0x331b5e);}(_0xd553,0x8d));var _0x3d55=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0xd553[_0x434804];return _0x573fc8;};'use strict';var Sequelize=require(_0x3d55('0x0'));module[_0x3d55('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':_0x3d55('0x3'),'unique':_0x3d55('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3d55('0x4')},'password':{'type':Sequelize[_0x3d55('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3d55('0x2')],'validate':{'isEmail':!![]},'set':function(_0xd103ad){this['setDataValue'](_0x3d55('0x5'),typeof _0xd103ad==='string'&&_0xd103ad[_0x3d55('0x6')]()?_0xd103ad[_0x3d55('0x6')]():null);}},'pager':{'type':Sequelize[_0x3d55('0x2')]},'tz':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':_0x3d55('0x7')},'attach':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3d55('0x2')]},'callback':{'type':Sequelize[_0x3d55('0x2')]},'review':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3d55('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'stamp':{'type':_0x3d55('0xb')},'emailsubject':{'type':Sequelize[_0x3d55('0x2')]},'emailbody':{'type':Sequelize[_0x3d55('0x2')]},'maxsecs':{'type':Sequelize[_0x3d55('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3d55('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3d55('0xd')](_0x3d55('0xe'))+'\x20-\x20'+this['getDataValue'](_0x3d55('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ae68403..8bc8bf8 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 _0x34b7=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','VoiceMailMessage','nolimit','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','end','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys'];(function(_0x703a74,_0x395fb8){var _0x5f54c1=function(_0x3fba8f){while(--_0x3fba8f){_0x703a74['push'](_0x703a74['shift']());}};_0x5f54c1(++_0x395fb8);}(_0x34b7,0x196));var _0x734b=function(_0x366ae5,_0x2aebf3){_0x366ae5=_0x366ae5-0x0;var _0x546e69=_0x34b7[_0x366ae5];return _0x546e69;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){var _0x104fff=_0x46d432[_0x734b('0x26')]({'plain':!![]});var _0x3abbe6=_0x734b('0x27');return db[_0x734b('0x28')][_0x734b('0x25')]({'where':{'type':_0x3abbe6,'resourceId':_0x104fff['id']}})['then'](function(){return _0x46d432;});})['then'](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x29')]();});}};}function handleEntityNotFound(_0x47a0a9,_0x32ea00){return function(_0x2dd51a){if(!_0x2dd51a){_0x47a0a9[_0x734b('0x18')](0x194);}return _0x2dd51a;};}function handleError(_0x41b501,_0x43edea){_0x43edea=_0x43edea||0x1f4;return function(_0x1b8295){logger[_0x734b('0x2a')](_0x1b8295['stack']);if(_0x1b8295[_0x734b('0x2b')]){delete _0x1b8295[_0x734b('0x2b')];}_0x41b501[_0x734b('0x19')](_0x43edea)[_0x734b('0x2c')](_0x1b8295);};}exports[_0x734b('0x2d')]=function(_0x427c36,_0x1fed72){var _0x21ed3c={},_0x371ead={},_0x3065b0={'count':0x0,'rows':[]};var _0x5dcabf=_[_0x734b('0x2e')](db[_0x734b('0x2f')]['rawAttributes'],function(_0xbbe037){return{'name':_0xbbe037[_0x734b('0x30')],'type':_0xbbe037[_0x734b('0x31')][_0x734b('0x32')]};});_0x371ead[_0x734b('0x33')]=_[_0x734b('0x2e')](_0x5dcabf,_0x734b('0x2b'));_0x371ead[_0x734b('0x34')]=_[_0x734b('0x35')](_0x427c36[_0x734b('0x34')]);_0x371ead[_0x734b('0x36')]=_[_0x734b('0x37')](_0x371ead[_0x734b('0x33')],_0x371ead[_0x734b('0x34')]);_0x21ed3c[_0x734b('0x38')]=_['intersection'](_0x371ead[_0x734b('0x33')],qs['fields'](_0x427c36[_0x734b('0x34')][_0x734b('0x39')]));_0x21ed3c[_0x734b('0x38')]=_0x21ed3c[_0x734b('0x38')][_0x734b('0x3a')]?_0x21ed3c[_0x734b('0x38')]:_0x371ead['model'];if(!_0x427c36['query'][_0x734b('0x3b')]('nolimit')){_0x21ed3c[_0x734b('0x1e')]=qs['limit'](_0x427c36[_0x734b('0x34')]['limit']);_0x21ed3c[_0x734b('0x1b')]=qs['offset'](_0x427c36[_0x734b('0x34')][_0x734b('0x1b')]);}_0x21ed3c[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x427c36[_0x734b('0x34')][_0x734b('0x3d')]);_0x21ed3c[_0x734b('0x3e')]=qs['filters'](_[_0x734b('0x3f')](_0x427c36[_0x734b('0x34')],_0x371ead['filters']),_0x5dcabf);if(_0x427c36[_0x734b('0x34')][_0x734b('0x40')]){_0x21ed3c[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x21ed3c['where'],{'$or':_[_0x734b('0x2e')](_0x5dcabf,function(_0x352d28){if(_0x352d28['type']!==_0x734b('0x42')){var _0x1e1689={};_0x1e1689[_0x352d28['name']]={'$like':'%'+_0x427c36[_0x734b('0x34')][_0x734b('0x40')]+'%'};return _0x1e1689;}})});}_0x21ed3c=_[_0x734b('0x41')]({},_0x21ed3c,_0x427c36[_0x734b('0x43')]);var _0x56eb35={'where':_0x21ed3c['where']};return db[_0x734b('0x2f')]['count'](_0x56eb35)['then'](function(_0x121a00){_0x3065b0['count']=_0x121a00;if(_0x427c36[_0x734b('0x34')]['includeAll']){_0x21ed3c[_0x734b('0x44')]=[{'all':!![]}];}return db[_0x734b('0x2f')][_0x734b('0x45')](_0x21ed3c);})['then'](function(_0x5cf3a0){_0x3065b0[_0x734b('0x46')]=_0x5cf3a0;return _0x3065b0;})['then'](respondWithFilteredResult(_0x1fed72,_0x21ed3c))['catch'](handleError(_0x1fed72,null));};exports[_0x734b('0x47')]=function(_0x159db9,_0x58f78a){var _0x2e789e={'raw':!![],'where':{'id':_0x159db9[_0x734b('0x48')]['id']}},_0x513f07={};_0x513f07[_0x734b('0x33')]=_[_0x734b('0x35')](db['VoiceMail'][_0x734b('0x49')]);_0x513f07[_0x734b('0x34')]=_[_0x734b('0x35')](_0x159db9[_0x734b('0x34')]);_0x513f07['filters']=_['intersection'](_0x513f07['model'],_0x513f07[_0x734b('0x34')]);_0x2e789e['attributes']=_['intersection'](_0x513f07[_0x734b('0x33')],qs['fields'](_0x159db9[_0x734b('0x34')][_0x734b('0x39')]));_0x2e789e[_0x734b('0x38')]=_0x2e789e[_0x734b('0x38')]['length']?_0x2e789e[_0x734b('0x38')]:_0x513f07['model'];if(_0x159db9[_0x734b('0x34')][_0x734b('0x4a')]){_0x2e789e[_0x734b('0x44')]=[{'all':!![]}];}_0x2e789e=_['merge']({},_0x2e789e,_0x159db9[_0x734b('0x43')]);return db['VoiceMail'][_0x734b('0x4b')](_0x2e789e)[_0x734b('0x24')](handleEntityNotFound(_0x58f78a,null))['then'](respondWithResult(_0x58f78a,null))[_0x734b('0x4c')](handleError(_0x58f78a,null));};exports[_0x734b('0x4d')]=function(_0x145ced,_0x38125a){return db[_0x734b('0x2f')]['create'](_0x145ced[_0x734b('0x4e')],{})['then'](function(_0x171575){var _0x5de7b7=_0x145ced[_0x734b('0x4f')][_0x734b('0x26')]({'plain':!![]});if(!_0x5de7b7)throw new Error(_0x734b('0x50'));if(_0x5de7b7[_0x734b('0x51')]===_0x734b('0x4f')){var _0x4b70f2=_0x171575['get']({'plain':!![]});var _0x484156=_0x734b('0x27');return db[_0x734b('0x52')]['find']({'where':{'name':_0x484156,'userProfileId':_0x5de7b7[_0x734b('0x53')]},'raw':!![]})[_0x734b('0x24')](function(_0x588ceb){if(_0x588ceb&&_0x588ceb[_0x734b('0x54')]===0x0){return db[_0x734b('0x28')][_0x734b('0x4d')]({'name':_0x4b70f2['name'],'resourceId':_0x4b70f2['id'],'type':_0x588ceb[_0x734b('0x2b')],'sectionId':_0x588ceb['id']},{})[_0x734b('0x24')](function(){return _0x171575;});}else{return _0x171575;}})[_0x734b('0x4c')](function(_0xe605be){logger['error'](_0x734b('0x55'),_0xe605be);throw _0xe605be;});}return _0x171575;})[_0x734b('0x24')](respondWithResult(_0x38125a,0xc9))[_0x734b('0x4c')](handleError(_0x38125a,null));};exports[_0x734b('0x56')]=function(_0x4b65bf,_0x27f0ff){if(_0x4b65bf['body']['id']){delete _0x4b65bf[_0x734b('0x4e')]['id'];}return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x4b65bf[_0x734b('0x48')]['id']}})['then'](handleEntityNotFound(_0x27f0ff,null))[_0x734b('0x24')](saveUpdates(_0x4b65bf[_0x734b('0x4e')],null))['then'](respondWithResult(_0x27f0ff,null))['catch'](handleError(_0x27f0ff,null));};exports[_0x734b('0x25')]=function(_0x577735,_0x16b461){return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x577735['params']['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x16b461,null))['then'](removeEntity(_0x16b461,null))[_0x734b('0x4c')](handleError(_0x16b461,null));};exports[_0x734b('0x57')]=function(_0x3c3359,_0x10660d,_0x49a43b){return db[_0x734b('0x2f')]['findOne']({'where':{'id':_0x3c3359[_0x734b('0x48')]['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x10660d,null))[_0x734b('0x24')](function(_0x59b7d8){var _0x18e187;var _0x55c699={},_0x2c81a1={};_0x2c81a1[_0x734b('0x33')]=_[_0x734b('0x35')](db[_0x734b('0x58')]['rawAttributes']);_0x2c81a1[_0x734b('0x34')]=_['keys'](_0x3c3359[_0x734b('0x34')]);_0x2c81a1[_0x734b('0x36')]=_[_0x734b('0x37')](_0x2c81a1['model'],_0x2c81a1[_0x734b('0x34')]);_0x55c699[_0x734b('0x38')]=_[_0x734b('0x37')](_0x2c81a1[_0x734b('0x33')],qs[_0x734b('0x39')](_0x3c3359[_0x734b('0x34')][_0x734b('0x39')]));_0x55c699['attributes']=_0x55c699[_0x734b('0x38')][_0x734b('0x3a')]?_0x55c699[_0x734b('0x38')]:_0x2c81a1['model'];if(!_0x3c3359['query'][_0x734b('0x3b')](_0x734b('0x59'))){_0x55c699[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x3c3359['query']['limit']);_0x55c699['offset']=qs[_0x734b('0x1b')](_0x3c3359[_0x734b('0x34')][_0x734b('0x1b')]);}_0x55c699[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x3c3359[_0x734b('0x34')][_0x734b('0x3d')]);_0x55c699[_0x734b('0x3e')]=qs[_0x734b('0x36')](_[_0x734b('0x3f')](_0x3c3359[_0x734b('0x34')],_0x2c81a1[_0x734b('0x36')]));if(_0x3c3359[_0x734b('0x34')][_0x734b('0x40')]){_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'$or':_[_0x734b('0x2e')](_0x55c699[_0x734b('0x38')],function(_0x39d4e7){var _0x379a33={};_0x379a33[_0x39d4e7]={'$like':'%'+_0x3c3359['query'][_0x734b('0x40')]+'%'};return _0x379a33;})});}_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'mailboxuser':_0x59b7d8[_0x734b('0x5a')]});_0x55c699=_['merge']({},_0x55c699,_0x3c3359[_0x734b('0x43')]);return db[_0x734b('0x58')][_0x734b('0x5b')](_0x55c699)[_0x734b('0x24')](respondWithFilteredResult(_0x10660d,_0x55c699));})[_0x734b('0x4c')](handleError(_0x10660d,null));}; \ No newline at end of file +var _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','mustache','util','path','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x691d5a,_0x85170f){var _0x3ab17b=function(_0x46f9c6){while(--_0x46f9c6){_0x691d5a['push'](_0x691d5a['shift']());}};_0x3ab17b(++_0x85170f);}(_0xbee3,0xd5));var _0x3bee=function(_0x4215d3,_0x5b5586){_0x4215d3=_0x4215d3-0x0;var _0x29873e=_0xbee3[_0x4215d3];return _0x29873e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index d2e77ec..c4aa045 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 _0xb8db=['./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8db,0x11e));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbb8d('0x0'));var util=require(_0xbb8d('0x1'));var logger=require(_0xbb8d('0x2'))(_0xbb8d('0x3'));var moment=require(_0xbb8d('0x4'));var BPromise=require(_0xbb8d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb8d('0x6'));var rimraf=require('rimraf');var config=require(_0xbb8d('0x7'));var attributes=require(_0xbb8d('0x8'));module['exports']=function(_0x352b02,_0x5b03f0){return _0x352b02[_0xbb8d('0x9')](_0xbb8d('0xa'),attributes,{'tableName':_0xbb8d('0xb'),'paranoid':![],'indexes':[{'name':_0xbb8d('0xc'),'fields':[_0xbb8d('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa593=['rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','api','moment','request-promise','path'];(function(_0x20e9f6,_0x289e34){var _0x436892=function(_0x183951){while(--_0x183951){_0x20e9f6['push'](_0x20e9f6['shift']());}};_0x436892(++_0x289e34);}(_0xa593,0x175));var _0x3a59=function(_0x332f1f,_0xf3c368){_0x332f1f=_0x332f1f-0x0;var _0x285c90=_0xa593[_0x332f1f];return _0x285c90;};'use strict';var _=require(_0x3a59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3a59('0x1'));var moment=require(_0x3a59('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a59('0x3'));var fs=require('fs');var path=require(_0x3a59('0x4'));var rimraf=require(_0x3a59('0x5'));var config=require(_0x3a59('0x6'));var attributes=require('./voiceMail.attributes');module[_0x3a59('0x7')]=function(_0x342ec9,_0x45248b){return _0x342ec9[_0x3a59('0x8')](_0x3a59('0x9'),attributes,{'tableName':_0x3a59('0xa'),'paranoid':![],'indexes':[{'name':_0x3a59('0xb'),'fields':[_0x3a59('0xc'),_0x3a59('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 84ad83a..e2952b3 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 _0xc8a2=['code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24bcf5,_0x2a1b91){var _0x4ce493=function(_0x21d258){while(--_0x21d258){_0x24bcf5['push'](_0x24bcf5['shift']());}};_0x4ce493(++_0x2a1b91);}(_0xc8a2,0x17a));var _0x2c8a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc8a2[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2c8a('0x0'));var BPromise=require(_0x2c8a('0x1'));var rs=require(_0x2c8a('0x2'));var fs=require('fs');var Redis=require(_0x2c8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c8a('0x4'));var logger=require(_0x2c8a('0x5'))(_0x2c8a('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c8a('0x7'));var client=jayson[_0x2c8a('0x8')][_0x2c8a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d0ca,_0x29511c,_0x49bf8b){return new BPromise(function(_0x5738d0,_0x2dc2b0){return client['request'](_0x20d0ca,_0x49bf8b)[_0x2c8a('0xa')](function(_0x551ce9){logger[_0x2c8a('0xb')](_0x2c8a('0xc'),_0x29511c,_0x2c8a('0xd'));logger[_0x2c8a('0xe')](_0x2c8a('0xf'),_0x29511c,'request\x20sent',JSON[_0x2c8a('0x10')](_0x551ce9));if(_0x551ce9[_0x2c8a('0x11')]){if(_0x551ce9[_0x2c8a('0x11')][_0x2c8a('0x12')]===0x1f4){logger[_0x2c8a('0x11')]('VoiceMail,\x20%s,\x20%s',_0x29511c,_0x551ce9[_0x2c8a('0x11')][_0x2c8a('0x13')]);return _0x2dc2b0(_0x551ce9['error']['message']);}logger[_0x2c8a('0x11')](_0x2c8a('0xc'),_0x29511c,_0x551ce9[_0x2c8a('0x11')][_0x2c8a('0x13')]);return _0x5738d0(_0x551ce9[_0x2c8a('0x11')][_0x2c8a('0x13')]);}else{logger[_0x2c8a('0xb')](_0x2c8a('0xc'),_0x29511c,_0x2c8a('0xd'));_0x5738d0(_0x551ce9[_0x2c8a('0x14')][_0x2c8a('0x13')]);}})[_0x2c8a('0x15')](function(_0x265e41){logger[_0x2c8a('0x11')](_0x2c8a('0xc'),_0x29511c,_0x265e41);_0x2dc2b0(_0x265e41);});});} \ No newline at end of file +var _0xafb6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4f7aa9,_0x9a1220){var _0x9a3936=function(_0xca32e0){while(--_0xca32e0){_0x4f7aa9['push'](_0x4f7aa9['shift']());}};_0x9a3936(++_0x9a1220);}(_0xafb6,0xcb));var _0x6afb=function(_0xf83277,_0x55487e){_0xf83277=_0xf83277-0x0;var _0x361e0e=_0xafb6[_0xf83277];return _0x361e0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6afb('0x0'));var BPromise=require(_0x6afb('0x1'));var rs=require(_0x6afb('0x2'));var fs=require('fs');var Redis=require(_0x6afb('0x3'));var db=require(_0x6afb('0x4'))['db'];var utils=require(_0x6afb('0x5'));var logger=require(_0x6afb('0x6'))('rpc');var config=require(_0x6afb('0x7'));var jayson=require(_0x6afb('0x8'));var client=jayson[_0x6afb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa104,_0x2e707d,_0x51ff3b){return new BPromise(function(_0x5cb9b8,_0x2e108d){return client[_0x6afb('0xa')](_0x2fa104,_0x51ff3b)[_0x6afb('0xb')](function(_0x773f65){logger[_0x6afb('0xc')](_0x6afb('0xd'),_0x2e707d,_0x6afb('0xe'));logger[_0x6afb('0xf')](_0x6afb('0x10'),_0x2e707d,_0x6afb('0xe'),JSON[_0x6afb('0x11')](_0x773f65));if(_0x773f65['error']){if(_0x773f65[_0x6afb('0x12')][_0x6afb('0x13')]===0x1f4){logger[_0x6afb('0x12')](_0x6afb('0xd'),_0x2e707d,_0x773f65[_0x6afb('0x12')][_0x6afb('0x14')]);return _0x2e108d(_0x773f65[_0x6afb('0x12')][_0x6afb('0x14')]);}logger[_0x6afb('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2e707d,_0x773f65['error'][_0x6afb('0x14')]);return _0x5cb9b8(_0x773f65['error']['message']);}else{logger[_0x6afb('0xc')](_0x6afb('0xd'),_0x2e707d,_0x6afb('0xe'));_0x5cb9b8(_0x773f65[_0x6afb('0x15')][_0x6afb('0x14')]);}})[_0x6afb('0x16')](function(_0x3b9047){logger[_0x6afb('0x12')](_0x6afb('0xd'),_0x2e707d,_0x3b9047);_0x2e108d(_0x3b9047);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0c0a7c8..ffef918 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 _0xf4f5=['isAuthenticated','show','/:id/download','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','index'];(function(_0x184a77,_0x15ea55){var _0x1c3dc9=function(_0x34bcee){while(--_0x34bcee){_0x184a77['push'](_0x184a77['shift']());}};_0x1c3dc9(++_0x15ea55);}(_0xf4f5,0x145));var _0x5f4f=function(_0x292e3c,_0x1dc8d6){_0x292e3c=_0x292e3c-0x0;var _0x259a1b=_0xf4f5[_0x292e3c];return _0x259a1b;};'use strict';var multer=require(_0x5f4f('0x0'));var util=require('util');var path=require(_0x5f4f('0x1'));var timeout=require(_0x5f4f('0x2'));var express=require(_0x5f4f('0x3'));var router=express[_0x5f4f('0x4')]();var fs_extra=require(_0x5f4f('0x5'));var auth=require(_0x5f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f4f('0x7'));var controller=require(_0x5f4f('0x8'));router[_0x5f4f('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f4f('0xa')]);router[_0x5f4f('0x9')]('/:id',auth[_0x5f4f('0xb')](),controller[_0x5f4f('0xc')]);router[_0x5f4f('0x9')](_0x5f4f('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x5f4f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f4f('0xf')](_0x5f4f('0x10'),auth[_0x5f4f('0xb')](),controller[_0x5f4f('0x11')]);router[_0x5f4f('0x12')](_0x5f4f('0x10'),auth[_0x5f4f('0xb')](),controller[_0x5f4f('0x13')]);module[_0x5f4f('0x14')]=router; \ No newline at end of file +var _0x87be=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','download','post','create','put'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x87be,0x11a));var _0xe87b=function(_0x544123,_0x48d2c9){_0x544123=_0x544123-0x0;var _0x34dcd4=_0x87be[_0x544123];return _0x34dcd4;};'use strict';var multer=require(_0xe87b('0x0'));var util=require(_0xe87b('0x1'));var path=require(_0xe87b('0x2'));var timeout=require(_0xe87b('0x3'));var express=require(_0xe87b('0x4'));var router=express[_0xe87b('0x5')]();var fs_extra=require(_0xe87b('0x6'));var auth=require(_0xe87b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe87b('0x8'));var controller=require(_0xe87b('0x9'));router[_0xe87b('0xa')]('/',auth[_0xe87b('0xb')](),controller[_0xe87b('0xc')]);router[_0xe87b('0xa')](_0xe87b('0xd'),auth[_0xe87b('0xb')](),controller['show']);router[_0xe87b('0xa')]('/:id/download',auth[_0xe87b('0xb')](),controller[_0xe87b('0xe')]);router[_0xe87b('0xf')]('/',auth['isAuthenticated'](),controller[_0xe87b('0x10')]);router[_0xe87b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe87b('0x12')]);router[_0xe87b('0x13')](_0xe87b('0xd'),auth[_0xe87b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 5e93488..2be6040 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 _0xcb4d=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcb4d,0x166));var _0xdcb4=function(_0x34f501,_0x21f9fe){_0x34f501=_0x34f501-0x0;var _0x21d84e=_0xcb4d[_0x34f501];return _0x21d84e;};'use strict';var Sequelize=require(_0xdcb4('0x0'));module[_0xdcb4('0x1')]={'name':{'type':Sequelize[_0xdcb4('0x2')],'get':function(_0x416f37){return this[_0xdcb4('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xdcb4('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xdcb4('0x6')](_0xdcb4('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xdcb4('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0xdcb4('0x8'))}}; \ No newline at end of file +var _0xe4c5=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x190ab6,_0x24a680){var _0x5ccdef=function(_0x5b33b2){while(--_0x5b33b2){_0x190ab6['push'](_0x190ab6['shift']());}};_0x5ccdef(++_0x24a680);}(_0xe4c5,0xbf));var _0x5e4c=function(_0x39ab2c,_0x50e361){_0x39ab2c=_0x39ab2c-0x0;var _0x25cb13=_0xe4c5[_0x39ab2c];return _0x25cb13;};'use strict';var Sequelize=require(_0x5e4c('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x56414e){return this[_0x5e4c('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5e4c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x5e4c('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'stamp':{'type':_0x5e4c('0x5'),'defaultValue':Sequelize[_0x5e4c('0x6')](_0x5e4c('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a051e24..db049f0 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 _0xff0a=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','catch','show','options','create','body','find','params','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','model','differenceBy','keys','query'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xff0a,0x16f));var _0xaff0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xff0a[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xaff0('0x0'));var rimraf=require(_0xaff0('0x1'));var zipdir=require(_0xaff0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaff0('0x3'));var BPromise=require(_0xaff0('0x4'));var Mustache=require(_0xaff0('0x5'));var util=require(_0xaff0('0x6'));var path=require('path');var sox=require(_0xaff0('0x7'));var csv=require(_0xaff0('0x8'));var ejs=require(_0xaff0('0x9'));var fs=require('fs');var fs_extra=require(_0xaff0('0xa'));var _=require(_0xaff0('0xb'));var squel=require(_0xaff0('0xc'));var crypto=require('crypto');var jsforce=require(_0xaff0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaff0('0x8'));var querystring=require(_0xaff0('0xe'));var Papa=require(_0xaff0('0xf'));var Redis=require(_0xaff0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaff0('0x11'));var as=require(_0xaff0('0x12'));var hardwareService=require(_0xaff0('0x13'));var logger=require(_0xaff0('0x14'))(_0xaff0('0x15'));var utils=require(_0xaff0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaff0('0x17'));var db=require(_0xaff0('0x18'))['db'];function respondWithStatusCode(_0x398eaf,_0x1fd191){_0x1fd191=_0x1fd191||0xcc;return function(_0x2a0680){if(_0x2a0680){return _0x398eaf[_0xaff0('0x19')](_0x1fd191);}return _0x398eaf[_0xaff0('0x1a')](_0x1fd191)[_0xaff0('0x1b')]();};}function respondWithResult(_0x5860e9,_0xdb29f9){_0xdb29f9=_0xdb29f9||0xc8;return function(_0xd269d6){if(_0xd269d6){return _0x5860e9[_0xaff0('0x1a')](_0xdb29f9)['json'](_0xd269d6);}};}function respondWithFilteredResult(_0x3a13b1,_0x15b836){return function(_0x8e5607){if(_0x8e5607){var _0x9a3f4=typeof _0x15b836[_0xaff0('0x1c')]===_0xaff0('0x1d')&&typeof _0x15b836[_0xaff0('0x1e')]===_0xaff0('0x1d');var _0x3bb794=_0x8e5607['count'];var _0x18b178=_0x9a3f4?0x0:_0x15b836[_0xaff0('0x1c')];var _0x119fee=_0x9a3f4?_0x8e5607[_0xaff0('0x1f')]:_0x15b836[_0xaff0('0x1c')]+_0x15b836[_0xaff0('0x1e')];var _0x3d7a16;if(_0x119fee>=_0x3bb794){_0x119fee=_0x3bb794;_0x3d7a16=0xc8;}else{_0x3d7a16=0xce;}_0x3a13b1[_0xaff0('0x1a')](_0x3d7a16);return _0x3a13b1[_0xaff0('0x20')](_0xaff0('0x21'),_0x18b178+'-'+_0x119fee+'/'+_0x3bb794)[_0xaff0('0x22')](_0x8e5607);}return null;};}function patchUpdates(_0x501407){return function(_0x20e1e7){try{jsonpatch[_0xaff0('0x23')](_0x20e1e7,_0x501407,!![]);}catch(_0x35953c){return BPromise[_0xaff0('0x24')](_0x35953c);}return _0x20e1e7['save']();};}function saveUpdates(_0x228156,_0x310366){return function(_0x12e727){if(_0x12e727){return _0x12e727[_0xaff0('0x25')](_0x228156)[_0xaff0('0x26')](function(_0x30c1b2){return _0x30c1b2;});}return null;};}function removeEntity(_0x589f85,_0x13968a){return function(_0x42e4e1){if(_0x42e4e1){return _0x42e4e1[_0xaff0('0x27')]()[_0xaff0('0x26')](function(){_0x589f85[_0xaff0('0x1a')](0xcc)[_0xaff0('0x1b')]();});}};}function handleEntityNotFound(_0x3391d6,_0x4f5849){return function(_0x2c3b10){if(!_0x2c3b10){_0x3391d6[_0xaff0('0x19')](0x194);}return _0x2c3b10;};}function handleError(_0x4c0e3b,_0x2cbc92){_0x2cbc92=_0x2cbc92||0x1f4;return function(_0x314af5){logger[_0xaff0('0x28')](_0x314af5[_0xaff0('0x29')]);if(_0x314af5[_0xaff0('0x2a')]){delete _0x314af5['name'];}_0x4c0e3b['status'](_0x2cbc92)[_0xaff0('0x2b')](_0x314af5);};}exports[_0xaff0('0x2c')]=function(_0x3085a5,_0x4018ee){var _0xaf13c7={},_0x307aa7={},_0x32f795={'count':0x0,'rows':[]};var _0x26438c=_[_0xaff0('0x2d')](db[_0xaff0('0x2e')][_0xaff0('0x2f')],function(_0x265942){return{'name':_0x265942['fieldName'],'type':_0x265942['type'][_0xaff0('0x30')]};});_0x307aa7[_0xaff0('0x31')]=_[_0xaff0('0x32')](_[_0xaff0('0x2d')](_0x26438c,_0xaff0('0x2a')),[_0xaff0('0x2a')]);_0x307aa7['query']=_[_0xaff0('0x33')](_0x3085a5[_0xaff0('0x34')]);_0x307aa7[_0xaff0('0x35')]=_[_0xaff0('0x36')](_0x307aa7['model'],_0x307aa7[_0xaff0('0x34')]);_0xaf13c7[_0xaff0('0x37')]=_[_0xaff0('0x36')](_0x307aa7[_0xaff0('0x31')],qs[_0xaff0('0x38')](_0x3085a5[_0xaff0('0x34')][_0xaff0('0x38')]));_0xaf13c7['attributes']=_0xaf13c7[_0xaff0('0x37')][_0xaff0('0x39')]?_0xaf13c7[_0xaff0('0x37')]:_0x307aa7[_0xaff0('0x31')];if(!_0x3085a5[_0xaff0('0x34')][_0xaff0('0x3a')](_0xaff0('0x3b'))){_0xaf13c7[_0xaff0('0x1e')]=qs[_0xaff0('0x1e')](_0x3085a5[_0xaff0('0x34')][_0xaff0('0x1e')]);_0xaf13c7[_0xaff0('0x1c')]=qs[_0xaff0('0x1c')](_0x3085a5[_0xaff0('0x34')]['offset']);}_0xaf13c7[_0xaff0('0x3c')]=qs[_0xaff0('0x3d')](_0x3085a5[_0xaff0('0x34')][_0xaff0('0x3d')]);_0xaf13c7[_0xaff0('0x3e')]=qs[_0xaff0('0x35')](_['pick'](_0x3085a5['query'],_0x307aa7[_0xaff0('0x35')]),_0x26438c);if(_0x3085a5[_0xaff0('0x34')][_0xaff0('0x3f')]){_0xaf13c7[_0xaff0('0x3e')]=_[_0xaff0('0x40')](_0xaf13c7['where'],{'$or':_[_0xaff0('0x2d')](_0x26438c,function(_0x5a7f17){if(_0x5a7f17[_0xaff0('0x41')]!==_0xaff0('0x42')){var _0x97923b={};_0x97923b[_0x5a7f17[_0xaff0('0x2a')]]={'$like':'%'+_0x3085a5['query']['filter']+'%'};return _0x97923b;}})});}_0xaf13c7=_[_0xaff0('0x40')]({},_0xaf13c7,_0x3085a5['options']);var _0x2ed2ee={'where':_0xaf13c7[_0xaff0('0x3e')]};return db[_0xaff0('0x2e')][_0xaff0('0x1f')](_0x2ed2ee)[_0xaff0('0x26')](function(_0x538430){_0x32f795['count']=_0x538430;if(_0x3085a5[_0xaff0('0x34')]['includeAll']){_0xaf13c7[_0xaff0('0x43')]=[{'all':!![]}];}return db[_0xaff0('0x2e')][_0xaff0('0x44')](_0xaf13c7);})[_0xaff0('0x26')](function(_0x1a827b){_0x32f795['rows']=_0x1a827b;return _0x32f795;})[_0xaff0('0x26')](respondWithFilteredResult(_0x4018ee,_0xaf13c7))[_0xaff0('0x45')](handleError(_0x4018ee,null));};exports[_0xaff0('0x46')]=function(_0x4e93e4,_0xc697b4){var _0x22595f={'raw':!![],'where':{'id':_0x4e93e4['params']['id']}},_0x2413a6={};_0x2413a6[_0xaff0('0x31')]=_[_0xaff0('0x33')](db[_0xaff0('0x2e')]['rawAttributes']);_0x2413a6[_0xaff0('0x34')]=_[_0xaff0('0x33')](_0x4e93e4[_0xaff0('0x34')]);_0x2413a6[_0xaff0('0x35')]=_[_0xaff0('0x36')](_0x2413a6[_0xaff0('0x31')],_0x2413a6['query']);_0x22595f[_0xaff0('0x37')]=_['intersection'](_0x2413a6[_0xaff0('0x31')],qs['fields'](_0x4e93e4[_0xaff0('0x34')][_0xaff0('0x38')]));_0x22595f[_0xaff0('0x37')]=_0x22595f['attributes'][_0xaff0('0x39')]?_0x22595f['attributes']:_0x2413a6[_0xaff0('0x31')];if(_0x4e93e4[_0xaff0('0x34')]['includeAll']){_0x22595f[_0xaff0('0x43')]=[{'all':!![]}];}_0x22595f=_[_0xaff0('0x40')]({},_0x22595f,_0x4e93e4[_0xaff0('0x47')]);return db['VoiceMailMessage']['find'](_0x22595f)[_0xaff0('0x26')](handleEntityNotFound(_0xc697b4,null))[_0xaff0('0x26')](respondWithResult(_0xc697b4,null))[_0xaff0('0x45')](handleError(_0xc697b4,null));};exports[_0xaff0('0x48')]=function(_0x108248,_0x4d1e01){return db['VoiceMailMessage'][_0xaff0('0x48')](_0x108248['body'],{})[_0xaff0('0x26')](respondWithResult(_0x4d1e01,0xc9))['catch'](handleError(_0x4d1e01,null));};exports[_0xaff0('0x25')]=function(_0xefd423,_0x359976){if(_0xefd423[_0xaff0('0x49')]['id']){delete _0xefd423[_0xaff0('0x49')]['id'];}return db[_0xaff0('0x2e')][_0xaff0('0x4a')]({'where':{'id':_0xefd423[_0xaff0('0x4b')]['id']}})[_0xaff0('0x26')](handleEntityNotFound(_0x359976,null))[_0xaff0('0x26')](saveUpdates(_0xefd423['body'],null))[_0xaff0('0x26')](respondWithResult(_0x359976,null))['catch'](handleError(_0x359976,null));};exports[_0xaff0('0x27')]=function(_0x40959f,_0x277e32){return db[_0xaff0('0x2e')][_0xaff0('0x4a')]({'where':{'id':_0x40959f[_0xaff0('0x4b')]['id']}})[_0xaff0('0x26')](handleEntityNotFound(_0x277e32,null))[_0xaff0('0x26')](removeEntity(_0x277e32,null))[_0xaff0('0x45')](handleError(_0x277e32,null));};exports['download']=function(_0x54253c,_0x1605de,_0x566af2){return db[_0xaff0('0x2e')]['find']({'where':{'id':_0x54253c[_0xaff0('0x4b')]['id']},'attributes':['id',_0xaff0('0x4c'),_0xaff0('0x4d')]})['then'](handleEntityNotFound(_0x1605de,null))[_0xaff0('0x26')](function(_0xab3a0e){if(_0xab3a0e){if(!_0xab3a0e[_0xaff0('0x4c')]){throw new db[(_0xaff0('0x4e'))][(_0xaff0('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x5acef9={'Content-Type':_0xaff0('0x50'),'Content-Disposition':_0xaff0('0x51')};if(_0xab3a0e['msg_id']){_0x5acef9[_0xaff0('0x52')]='attachment;\x20filename=\x22'+_0xab3a0e[_0xaff0('0x4d')]+_0xaff0('0x53');}_0x1605de['set'](_0x5acef9);return _0x1605de[_0xaff0('0x2b')](new Buffer(_0xab3a0e[_0xaff0('0x4c')]));}})[_0xaff0('0x45')](handleError(_0x1605de,null));}; \ No newline at end of file +var _0x2312=['../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','type','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','update','body','params','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5bc4e2,_0x427ff9){var _0x4c93f9=function(_0x1e8546){while(--_0x1e8546){_0x5bc4e2['push'](_0x5bc4e2['shift']());}};_0x4c93f9(++_0x427ff9);}(_0x2312,0x199));var _0x2231=function(_0x4d0405,_0x249611){_0x4d0405=_0x4d0405-0x0;var _0x558715=_0x2312[_0x4d0405];return _0x558715;};'use strict';var emlformat=require(_0x2231('0x0'));var rimraf=require(_0x2231('0x1'));var zipdir=require(_0x2231('0x2'));var jsonpatch=require(_0x2231('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2231('0x4'));var Mustache=require('mustache');var util=require(_0x2231('0x5'));var path=require(_0x2231('0x6'));var sox=require(_0x2231('0x7'));var csv=require(_0x2231('0x8'));var ejs=require(_0x2231('0x9'));var fs=require('fs');var fs_extra=require(_0x2231('0xa'));var _=require(_0x2231('0xb'));var squel=require(_0x2231('0xc'));var crypto=require(_0x2231('0xd'));var jsforce=require(_0x2231('0xe'));var deskjs=require(_0x2231('0xf'));var toCsv=require(_0x2231('0x8'));var querystring=require(_0x2231('0x10'));var Papa=require(_0x2231('0x11'));var Redis=require(_0x2231('0x12'));var authService=require(_0x2231('0x13'));var qs=require(_0x2231('0x14'));var as=require(_0x2231('0x15'));var hardwareService=require(_0x2231('0x16'));var logger=require(_0x2231('0x17'))('api');var utils=require(_0x2231('0x18'));var config=require(_0x2231('0x19'));var licenseUtil=require(_0x2231('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17589a,_0x194a1d){_0x194a1d=_0x194a1d||0xcc;return function(_0x1db33c){if(_0x1db33c){return _0x17589a[_0x2231('0x1b')](_0x194a1d);}return _0x17589a[_0x2231('0x1c')](_0x194a1d)[_0x2231('0x1d')]();};}function respondWithResult(_0x38a5c7,_0x32ec91){_0x32ec91=_0x32ec91||0xc8;return function(_0x50da87){if(_0x50da87){return _0x38a5c7['status'](_0x32ec91)['json'](_0x50da87);}};}function respondWithFilteredResult(_0x5c89aa,_0x2da0db){return function(_0x101ad6){if(_0x101ad6){var _0x26f155=typeof _0x2da0db[_0x2231('0x1e')]===_0x2231('0x1f')&&typeof _0x2da0db['limit']===_0x2231('0x1f');var _0x52641d=_0x101ad6[_0x2231('0x20')];var _0x5ac0ba=_0x26f155?0x0:_0x2da0db[_0x2231('0x1e')];var _0x3c48d3=_0x26f155?_0x101ad6[_0x2231('0x20')]:_0x2da0db['offset']+_0x2da0db['limit'];var _0x2514fa;if(_0x3c48d3>=_0x52641d){_0x3c48d3=_0x52641d;_0x2514fa=0xc8;}else{_0x2514fa=0xce;}_0x5c89aa['status'](_0x2514fa);return _0x5c89aa[_0x2231('0x21')](_0x2231('0x22'),_0x5ac0ba+'-'+_0x3c48d3+'/'+_0x52641d)[_0x2231('0x23')](_0x101ad6);}return null;};}function patchUpdates(_0x1dd5d8){return function(_0x162aba){try{jsonpatch['apply'](_0x162aba,_0x1dd5d8,!![]);}catch(_0x224320){return BPromise[_0x2231('0x24')](_0x224320);}return _0x162aba[_0x2231('0x25')]();};}function saveUpdates(_0x574d91,_0x2f2fdb){return function(_0x2a6385){if(_0x2a6385){return _0x2a6385['update'](_0x574d91)[_0x2231('0x26')](function(_0x5369be){return _0x5369be;});}return null;};}function removeEntity(_0x2ca8a6,_0x5c49c1){return function(_0x369f4c){if(_0x369f4c){return _0x369f4c[_0x2231('0x27')]()[_0x2231('0x26')](function(){_0x2ca8a6['status'](0xcc)[_0x2231('0x1d')]();});}};}function handleEntityNotFound(_0x582797,_0x5aa150){return function(_0x52ebb9){if(!_0x52ebb9){_0x582797['sendStatus'](0x194);}return _0x52ebb9;};}function handleError(_0xc4ecc7,_0x45b071){_0x45b071=_0x45b071||0x1f4;return function(_0x33be7c){logger[_0x2231('0x28')](_0x33be7c[_0x2231('0x29')]);if(_0x33be7c[_0x2231('0x2a')]){delete _0x33be7c[_0x2231('0x2a')];}_0xc4ecc7[_0x2231('0x1c')](_0x45b071)[_0x2231('0x2b')](_0x33be7c);};}exports[_0x2231('0x2c')]=function(_0x4d1cd7,_0x4a2537){var _0x24644d={},_0x50226d={},_0x45177e={'count':0x0,'rows':[]};var _0x430f47=_['map'](db[_0x2231('0x2d')][_0x2231('0x2e')],function(_0x12c292){return{'name':_0x12c292['fieldName'],'type':_0x12c292[_0x2231('0x2f')]['key']};});_0x50226d[_0x2231('0x30')]=_[_0x2231('0x31')](_[_0x2231('0x32')](_0x430f47,_0x2231('0x2a')),['name']);_0x50226d[_0x2231('0x33')]=_[_0x2231('0x34')](_0x4d1cd7[_0x2231('0x33')]);_0x50226d[_0x2231('0x35')]=_[_0x2231('0x36')](_0x50226d['model'],_0x50226d[_0x2231('0x33')]);_0x24644d[_0x2231('0x37')]=_[_0x2231('0x36')](_0x50226d[_0x2231('0x30')],qs[_0x2231('0x38')](_0x4d1cd7[_0x2231('0x33')][_0x2231('0x38')]));_0x24644d[_0x2231('0x37')]=_0x24644d[_0x2231('0x37')][_0x2231('0x39')]?_0x24644d[_0x2231('0x37')]:_0x50226d[_0x2231('0x30')];if(!_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3a')](_0x2231('0x3b'))){_0x24644d[_0x2231('0x3c')]=qs[_0x2231('0x3c')](_0x4d1cd7['query'][_0x2231('0x3c')]);_0x24644d[_0x2231('0x1e')]=qs[_0x2231('0x1e')](_0x4d1cd7['query'][_0x2231('0x1e')]);}_0x24644d['order']=qs[_0x2231('0x3d')](_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3d')]);_0x24644d[_0x2231('0x3e')]=qs['filters'](_['pick'](_0x4d1cd7[_0x2231('0x33')],_0x50226d[_0x2231('0x35')]),_0x430f47);if(_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3f')]){_0x24644d[_0x2231('0x3e')]=_[_0x2231('0x40')](_0x24644d[_0x2231('0x3e')],{'$or':_[_0x2231('0x32')](_0x430f47,function(_0x208005){if(_0x208005[_0x2231('0x2f')]!==_0x2231('0x41')){var _0x5aa6af={};_0x5aa6af[_0x208005['name']]={'$like':'%'+_0x4d1cd7[_0x2231('0x33')]['filter']+'%'};return _0x5aa6af;}})});}_0x24644d=_['merge']({},_0x24644d,_0x4d1cd7[_0x2231('0x42')]);var _0x21f0c7={'where':_0x24644d[_0x2231('0x3e')]};return db[_0x2231('0x2d')]['count'](_0x21f0c7)['then'](function(_0x44dc39){_0x45177e['count']=_0x44dc39;if(_0x4d1cd7[_0x2231('0x33')][_0x2231('0x43')]){_0x24644d['include']=[{'all':!![]}];}return db[_0x2231('0x2d')][_0x2231('0x44')](_0x24644d);})[_0x2231('0x26')](function(_0x509c26){_0x45177e[_0x2231('0x45')]=_0x509c26;return _0x45177e;})[_0x2231('0x26')](respondWithFilteredResult(_0x4a2537,_0x24644d))[_0x2231('0x46')](handleError(_0x4a2537,null));};exports[_0x2231('0x47')]=function(_0x19fb42,_0x360c36){var _0x4737fc={'raw':!![],'where':{'id':_0x19fb42['params']['id']}},_0x10e3f2={};_0x10e3f2[_0x2231('0x30')]=_[_0x2231('0x34')](db[_0x2231('0x2d')][_0x2231('0x2e')]);_0x10e3f2[_0x2231('0x33')]=_['keys'](_0x19fb42[_0x2231('0x33')]);_0x10e3f2['filters']=_['intersection'](_0x10e3f2[_0x2231('0x30')],_0x10e3f2[_0x2231('0x33')]);_0x4737fc[_0x2231('0x37')]=_[_0x2231('0x36')](_0x10e3f2[_0x2231('0x30')],qs['fields'](_0x19fb42[_0x2231('0x33')]['fields']));_0x4737fc[_0x2231('0x37')]=_0x4737fc['attributes'][_0x2231('0x39')]?_0x4737fc[_0x2231('0x37')]:_0x10e3f2[_0x2231('0x30')];if(_0x19fb42[_0x2231('0x33')][_0x2231('0x43')]){_0x4737fc[_0x2231('0x48')]=[{'all':!![]}];}_0x4737fc=_[_0x2231('0x40')]({},_0x4737fc,_0x19fb42[_0x2231('0x42')]);return db[_0x2231('0x2d')][_0x2231('0x49')](_0x4737fc)[_0x2231('0x26')](handleEntityNotFound(_0x360c36,null))[_0x2231('0x26')](respondWithResult(_0x360c36,null))[_0x2231('0x46')](handleError(_0x360c36,null));};exports['create']=function(_0x2daf65,_0x34e527){return db['VoiceMailMessage'][_0x2231('0x4a')](_0x2daf65['body'],{})['then'](respondWithResult(_0x34e527,0xc9))[_0x2231('0x46')](handleError(_0x34e527,null));};exports[_0x2231('0x4b')]=function(_0x58955d,_0x2b4e6f){if(_0x58955d[_0x2231('0x4c')]['id']){delete _0x58955d[_0x2231('0x4c')]['id'];}return db[_0x2231('0x2d')][_0x2231('0x49')]({'where':{'id':_0x58955d[_0x2231('0x4d')]['id']}})[_0x2231('0x26')](handleEntityNotFound(_0x2b4e6f,null))[_0x2231('0x26')](saveUpdates(_0x58955d[_0x2231('0x4c')],null))[_0x2231('0x26')](respondWithResult(_0x2b4e6f,null))[_0x2231('0x46')](handleError(_0x2b4e6f,null));};exports[_0x2231('0x27')]=function(_0xb8911b,_0x5dad06){return db[_0x2231('0x2d')]['find']({'where':{'id':_0xb8911b['params']['id']}})['then'](handleEntityNotFound(_0x5dad06,null))[_0x2231('0x26')](removeEntity(_0x5dad06,null))[_0x2231('0x46')](handleError(_0x5dad06,null));};exports[_0x2231('0x4e')]=function(_0x24a4f9,_0x4555ba,_0x4c23cb){return db['VoiceMailMessage'][_0x2231('0x49')]({'where':{'id':_0x24a4f9['params']['id']},'attributes':['id',_0x2231('0x4f'),_0x2231('0x50')]})[_0x2231('0x26')](handleEntityNotFound(_0x4555ba,null))[_0x2231('0x26')](function(_0x2081a7){if(_0x2081a7){if(!_0x2081a7['recording']){throw new db['Sequelize'][(_0x2231('0x51'))](_0x2231('0x52'));}var _0x47fc3a={'Content-Type':_0x2231('0x53'),'Content-Disposition':_0x2231('0x54')};if(_0x2081a7[_0x2231('0x50')]){_0x47fc3a[_0x2231('0x55')]=_0x2231('0x56')+_0x2081a7[_0x2231('0x50')]+'.wav\x22';}_0x4555ba['set'](_0x47fc3a);return _0x4555ba[_0x2231('0x2b')](new Buffer(_0x2081a7[_0x2231('0x4f')]));}})[_0x2231('0x46')](handleError(_0x4555ba,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index baefb05..57ce888 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 _0xe766=['moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','dir','lodash','util','../../config/logger','api'];(function(_0xf744fb,_0x4863d2){var _0x126be4=function(_0x16a3f8){while(--_0x16a3f8){_0xf744fb['push'](_0xf744fb['shift']());}};_0x126be4(++_0x4863d2);}(_0xe766,0x1e8));var _0x6e76=function(_0x20522a,_0x11bb0){_0x20522a=_0x20522a-0x0;var _0x3105e0=_0xe766[_0x20522a];return _0x3105e0;};'use strict';var _=require(_0x6e76('0x0'));var util=require(_0x6e76('0x1'));var logger=require(_0x6e76('0x2'))(_0x6e76('0x3'));var moment=require(_0x6e76('0x4'));var BPromise=require(_0x6e76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e76('0x6'));var rimraf=require(_0x6e76('0x7'));var config=require(_0x6e76('0x8'));var attributes=require(_0x6e76('0x9'));module['exports']=function(_0x5074d5,_0x351155){return _0x5074d5['define'](_0x6e76('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x6e76('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x987e=['voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x987e,0x188));var _0xe987=function(_0x1738d6,_0x5de579){_0x1738d6=_0x1738d6-0x0;var _0x1a1187=_0x987e[_0x1738d6];return _0x1a1187;};'use strict';var _=require(_0xe987('0x0'));var util=require('util');var logger=require(_0xe987('0x1'))(_0xe987('0x2'));var moment=require(_0xe987('0x3'));var BPromise=require('bluebird');var rp=require(_0xe987('0x4'));var fs=require('fs');var path=require(_0xe987('0x5'));var rimraf=require(_0xe987('0x6'));var config=require(_0xe987('0x7'));var attributes=require(_0xe987('0x8'));module[_0xe987('0x9')]=function(_0x3c23c4,_0x5aa71c){return _0x3c23c4[_0xe987('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xe987('0xb'),'paranoid':![],'indexes':[{'name':_0xe987('0xc'),'fields':[_0xe987('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 666fc03..c5e8447 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 _0x2caf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x2caf,0x18e));var _0xf2ca=function(_0x4f23bd,_0x160dba){_0x4f23bd=_0x4f23bd-0x0;var _0x2d9036=_0x2caf[_0x4f23bd];return _0x2d9036;};'use strict';var _=require(_0xf2ca('0x0'));var util=require(_0xf2ca('0x1'));var moment=require(_0xf2ca('0x2'));var BPromise=require(_0xf2ca('0x3'));var rs=require(_0xf2ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2ca('0x6'))(_0xf2ca('0x7'));var config=require(_0xf2ca('0x8'));var jayson=require(_0xf2ca('0x9'));var client=jayson['client'][_0xf2ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x581a07,_0x946db7,_0x1f09c4){return new BPromise(function(_0x58add,_0x588a3c){return client[_0xf2ca('0xb')](_0x581a07,_0x1f09c4)['then'](function(_0x5d627f){logger[_0xf2ca('0xc')](_0xf2ca('0xd'),_0x946db7,_0xf2ca('0xe'));logger[_0xf2ca('0xf')](_0xf2ca('0x10'),_0x946db7,'request\x20sent',JSON[_0xf2ca('0x11')](_0x5d627f));if(_0x5d627f[_0xf2ca('0x12')]){if(_0x5d627f['error'][_0xf2ca('0x13')]===0x1f4){logger['error'](_0xf2ca('0xd'),_0x946db7,_0x5d627f[_0xf2ca('0x12')][_0xf2ca('0x14')]);return _0x588a3c(_0x5d627f[_0xf2ca('0x12')][_0xf2ca('0x14')]);}logger[_0xf2ca('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x946db7,_0x5d627f[_0xf2ca('0x12')][_0xf2ca('0x14')]);return _0x58add(_0x5d627f[_0xf2ca('0x12')][_0xf2ca('0x14')]);}else{logger[_0xf2ca('0xc')](_0xf2ca('0xd'),_0x946db7,'request\x20sent');_0x58add(_0x5d627f['result'][_0xf2ca('0x14')]);}})['catch'](function(_0x81529){logger[_0xf2ca('0x12')](_0xf2ca('0xd'),_0x946db7,_0x81529);_0x588a3c(_0x81529);});});} \ No newline at end of file +var _0x4424=['then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','client','http','request'];(function(_0xfd0305,_0x30ea99){var _0x3abc6f=function(_0x5afaf9){while(--_0x5afaf9){_0xfd0305['push'](_0xfd0305['shift']());}};_0x3abc6f(++_0x30ea99);}(_0x4424,0x19b));var _0x4442=function(_0x22d50a,_0x45a4f5){_0x22d50a=_0x22d50a-0x0;var _0x2bc774=_0x4424[_0x22d50a];return _0x2bc774;};'use strict';var _=require(_0x4442('0x0'));var util=require(_0x4442('0x1'));var moment=require(_0x4442('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4442('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4442('0x4'));var logger=require(_0x4442('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4442('0x6')][_0x4442('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8f47b3,_0x15c7e7,_0x4ad63f){return new BPromise(function(_0x400f0e,_0x21ed97){return client[_0x4442('0x8')](_0x8f47b3,_0x4ad63f)[_0x4442('0x9')](function(_0x509431){logger[_0x4442('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x15c7e7,'request\x20sent');logger[_0x4442('0xb')](_0x4442('0xc'),_0x15c7e7,_0x4442('0xd'),JSON[_0x4442('0xe')](_0x509431));if(_0x509431[_0x4442('0xf')]){if(_0x509431['error'][_0x4442('0x10')]===0x1f4){logger[_0x4442('0xf')](_0x4442('0x11'),_0x15c7e7,_0x509431[_0x4442('0xf')][_0x4442('0x12')]);return _0x21ed97(_0x509431[_0x4442('0xf')]['message']);}logger[_0x4442('0xf')](_0x4442('0x11'),_0x15c7e7,_0x509431[_0x4442('0xf')][_0x4442('0x12')]);return _0x400f0e(_0x509431[_0x4442('0xf')][_0x4442('0x12')]);}else{logger[_0x4442('0xa')](_0x4442('0x11'),_0x15c7e7,'request\x20sent');_0x400f0e(_0x509431[_0x4442('0x13')][_0x4442('0x12')]);}})[_0x4442('0x14')](function(_0x58d7a5){logger[_0x4442('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x15c7e7,_0x58d7a5);_0x21ed97(_0x58d7a5);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c49e515..f278af8 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 _0x3c21=['destroy','delete','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create','put','update'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x3c21,0x1c6));var _0x13c2=function(_0x370049,_0x56f938){_0x370049=_0x370049-0x0;var _0x3bc655=_0x3c21[_0x370049];return _0x3bc655;};'use strict';var multer=require(_0x13c2('0x0'));var util=require(_0x13c2('0x1'));var path=require(_0x13c2('0x2'));var timeout=require(_0x13c2('0x3'));var express=require(_0x13c2('0x4'));var router=express[_0x13c2('0x5')]();var fs_extra=require(_0x13c2('0x6'));var auth=require(_0x13c2('0x7'));var interaction=require(_0x13c2('0x8'));var config=require('../../config/environment');var controller=require(_0x13c2('0x9'));router['get']('/',auth[_0x13c2('0xa')](),controller[_0x13c2('0xb')]);router[_0x13c2('0xc')](_0x13c2('0xd'),auth[_0x13c2('0xa')](),controller[_0x13c2('0xe')]);router['get'](_0x13c2('0xf'),auth['isAuthenticated'](),controller[_0x13c2('0x10')]);router[_0x13c2('0x11')]('/',auth[_0x13c2('0xa')](),controller[_0x13c2('0x12')]);router['post']('/:id/sounds',auth[_0x13c2('0xa')](),controller['addSound']);router[_0x13c2('0x13')](_0x13c2('0xd'),auth['isAuthenticated'](),controller[_0x13c2('0x14')]);router['delete'](_0x13c2('0xd'),auth[_0x13c2('0xa')](),controller[_0x13c2('0x15')]);router[_0x13c2('0x16')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x13c2('0x17')]);module[_0x13c2('0x18')]=router; \ No newline at end of file +var _0x02af=['post','create','addSound','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds'];(function(_0x49a661,_0x26a4ab){var _0x45cfb1=function(_0x56b6d1){while(--_0x56b6d1){_0x49a661['push'](_0x49a661['shift']());}};_0x45cfb1(++_0x26a4ab);}(_0x02af,0xf8));var _0xf02a=function(_0x56eb56,_0x262b73){_0x56eb56=_0x56eb56-0x0;var _0x39b485=_0x02af[_0x56eb56];return _0x39b485;};'use strict';var multer=require(_0xf02a('0x0'));var util=require(_0xf02a('0x1'));var path=require(_0xf02a('0x2'));var timeout=require(_0xf02a('0x3'));var express=require(_0xf02a('0x4'));var router=express['Router']();var fs_extra=require(_0xf02a('0x5'));var auth=require(_0xf02a('0x6'));var interaction=require(_0xf02a('0x7'));var config=require('../../config/environment');var controller=require(_0xf02a('0x8'));router[_0xf02a('0x9')]('/',auth[_0xf02a('0xa')](),controller[_0xf02a('0xb')]);router['get'](_0xf02a('0xc'),auth[_0xf02a('0xa')](),controller[_0xf02a('0xd')]);router[_0xf02a('0x9')](_0xf02a('0xe'),auth[_0xf02a('0xa')](),controller[_0xf02a('0xf')]);router[_0xf02a('0x10')]('/',auth[_0xf02a('0xa')](),controller[_0xf02a('0x11')]);router['post'](_0xf02a('0xe'),auth[_0xf02a('0xa')](),controller[_0xf02a('0x12')]);router['put']('/:id',auth[_0xf02a('0xa')](),controller['update']);router[_0xf02a('0x13')](_0xf02a('0xc'),auth[_0xf02a('0xa')](),controller['destroy']);router['delete'](_0xf02a('0x14'),auth['isAuthenticated'](),controller[_0xf02a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1fa95f9..938c648 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 _0xbedb=['exports','name','ENUM','files','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbedb,0x175));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbbed('0x0'));module[_0xbbed('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbed('0x2')},'mode':{'type':Sequelize[_0xbbed('0x3')]('custom',_0xbbed('0x4'),'mp3nb','quietmp3nb',_0xbbed('0x5'),_0xbbed('0x6')),'allowNull':!![],'defaultValue':_0xbbed('0x4')},'directory':{'type':Sequelize[_0xbbed('0x7')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbbed('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xbbed('0x9')},'defaultEntry':{'type':Sequelize[_0xbbed('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4528=['alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3'];(function(_0x378692,_0x1a78e2){var _0x51f225=function(_0x3859ad){while(--_0x3859ad){_0x378692['push'](_0x378692['shift']());}};_0x51f225(++_0x1a78e2);}(_0x4528,0x1c5));var _0x8452=function(_0x1a3a2d,_0x42f18e){_0x1a3a2d=_0x1a3a2d-0x0;var _0xa58e4a=_0x4528[_0x1a3a2d];return _0xa58e4a;};'use strict';var Sequelize=require(_0x8452('0x0'));module[_0x8452('0x1')]={'name':{'type':Sequelize[_0x8452('0x2')],'allowNull':![],'unique':_0x8452('0x3')},'mode':{'type':Sequelize[_0x8452('0x4')](_0x8452('0x5'),_0x8452('0x6'),_0x8452('0x7'),'quietmp3nb',_0x8452('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x8452('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8452('0x9')},'format':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'stamp':{'type':_0x8452('0xa')},'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 caf2e56..88ff6fc 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 _0x7779=['directory','join','root','server/files/moh','files','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','getSounds','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','options','where','include','findAll','rows','show','params','length','includeAll','merge','find','catch','body','sequelize','transaction','mode'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x7779,0x1d2));var _0x9777=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0x7779[_0x2577f7];return _0x55d372;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9777('0x0'));var jsonpatch=require(_0x9777('0x1'));var rp=require('request-promise');var moment=require(_0x9777('0x2'));var BPromise=require(_0x9777('0x3'));var Mustache=require(_0x9777('0x4'));var util=require('util');var path=require(_0x9777('0x5'));var sox=require(_0x9777('0x6'));var csv=require(_0x9777('0x7'));var ejs=require(_0x9777('0x8'));var fs=require('fs');var fs_extra=require(_0x9777('0x9'));var _=require(_0x9777('0xa'));var squel=require(_0x9777('0xb'));var crypto=require('crypto');var jsforce=require(_0x9777('0xc'));var deskjs=require(_0x9777('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9777('0xe'));var Papa=require(_0x9777('0xf'));var Redis=require(_0x9777('0x10'));var authService=require(_0x9777('0x11'));var qs=require(_0x9777('0x12'));var as=require(_0x9777('0x13'));var hardwareService=require(_0x9777('0x14'));var logger=require('../../config/logger')(_0x9777('0x15'));var utils=require(_0x9777('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9777('0x17'));var db=require(_0x9777('0x18'))['db'];function respondWithStatusCode(_0x515656,_0x86f14d){_0x86f14d=_0x86f14d||0xcc;return function(_0xd27cdf){if(_0xd27cdf){return _0x515656[_0x9777('0x19')](_0x86f14d);}return _0x515656[_0x9777('0x1a')](_0x86f14d)[_0x9777('0x1b')]();};}function respondWithResult(_0x59b5e6,_0x51f991){_0x51f991=_0x51f991||0xc8;return function(_0x540164){if(_0x540164){return _0x59b5e6[_0x9777('0x1a')](_0x51f991)[_0x9777('0x1c')](_0x540164);}};}function respondWithFilteredResult(_0x459a0f,_0x158a8c){return function(_0x192f75){if(_0x192f75){var _0x2c7b04=typeof _0x158a8c[_0x9777('0x1d')]===_0x9777('0x1e')&&typeof _0x158a8c['limit']===_0x9777('0x1e');var _0x27d8c8=_0x192f75['count'];var _0x2657a2=_0x2c7b04?0x0:_0x158a8c[_0x9777('0x1d')];var _0x84dfb6=_0x2c7b04?_0x192f75[_0x9777('0x1f')]:_0x158a8c[_0x9777('0x1d')]+_0x158a8c[_0x9777('0x20')];var _0x52d8e0;if(_0x84dfb6>=_0x27d8c8){_0x84dfb6=_0x27d8c8;_0x52d8e0=0xc8;}else{_0x52d8e0=0xce;}_0x459a0f[_0x9777('0x1a')](_0x52d8e0);return _0x459a0f['set']('Content-Range',_0x2657a2+'-'+_0x84dfb6+'/'+_0x27d8c8)['json'](_0x192f75);}return null;};}function patchUpdates(_0x968c2f){return function(_0x50032e){try{jsonpatch[_0x9777('0x21')](_0x50032e,_0x968c2f,!![]);}catch(_0x23ed77){return BPromise[_0x9777('0x22')](_0x23ed77);}return _0x50032e[_0x9777('0x23')]();};}function saveUpdates(_0x59203c,_0x50c9dd){return function(_0xea7cda){if(_0xea7cda){return _0xea7cda[_0x9777('0x24')](_0x59203c)[_0x9777('0x25')](function(_0x559182){return _0x559182;});}return null;};}function removeEntity(_0x430300,_0x5afbb2){return function(_0x40da09){if(_0x40da09){return _0x40da09[_0x9777('0x26')]()[_0x9777('0x25')](function(){var _0x5cf1e1=_0x40da09[_0x9777('0x27')]({'plain':!![]});var _0x576441=_0x9777('0x28');return db[_0x9777('0x29')][_0x9777('0x26')]({'where':{'type':_0x576441,'resourceId':_0x5cf1e1['id']}})[_0x9777('0x25')](function(){return _0x40da09;});})[_0x9777('0x25')](function(){_0x430300['status'](0xcc)[_0x9777('0x1b')]();});}};}function handleEntityNotFound(_0x3dfd13,_0x1ecdfd){return function(_0x2e54fe){if(!_0x2e54fe){_0x3dfd13['sendStatus'](0x194);}return _0x2e54fe;};}function handleError(_0x5eb246,_0x598ae4){_0x598ae4=_0x598ae4||0x1f4;return function(_0xf580ca){logger[_0x9777('0x2a')](_0xf580ca['stack']);if(_0xf580ca[_0x9777('0x2b')]){delete _0xf580ca[_0x9777('0x2b')];}_0x5eb246[_0x9777('0x1a')](_0x598ae4)[_0x9777('0x2c')](_0xf580ca);};}exports[_0x9777('0x2d')]=function(_0x50f718,_0xf4c68e){var _0xbdcc9={},_0x2b636f={},_0x29498f={'count':0x0,'rows':[]};var _0x376157=_[_0x9777('0x2e')](db[_0x9777('0x2f')][_0x9777('0x30')],function(_0x535179){return{'name':_0x535179[_0x9777('0x31')],'type':_0x535179[_0x9777('0x32')]['key']};});_0x2b636f[_0x9777('0x33')]=_[_0x9777('0x2e')](_0x376157,_0x9777('0x2b'));_0x2b636f[_0x9777('0x34')]=_[_0x9777('0x35')](_0x50f718[_0x9777('0x34')]);_0x2b636f[_0x9777('0x36')]=_[_0x9777('0x37')](_0x2b636f[_0x9777('0x33')],_0x2b636f[_0x9777('0x34')]);_0xbdcc9[_0x9777('0x38')]=_[_0x9777('0x37')](_0x2b636f[_0x9777('0x33')],qs[_0x9777('0x39')](_0x50f718[_0x9777('0x34')]['fields']));_0xbdcc9[_0x9777('0x38')]=_0xbdcc9['attributes']['length']?_0xbdcc9[_0x9777('0x38')]:_0x2b636f[_0x9777('0x33')];if(!_0x50f718[_0x9777('0x34')]['hasOwnProperty'](_0x9777('0x3a'))){_0xbdcc9[_0x9777('0x20')]=qs[_0x9777('0x20')](_0x50f718[_0x9777('0x34')][_0x9777('0x20')]);_0xbdcc9['offset']=qs['offset'](_0x50f718[_0x9777('0x34')][_0x9777('0x1d')]);}_0xbdcc9[_0x9777('0x3b')]=qs['sort'](_0x50f718['query'][_0x9777('0x3c')]);delete _0x50f718[_0x9777('0x34')][_0x9777('0x3c')];_0xbdcc9['where']=qs[_0x9777('0x36')](_[_0x9777('0x3d')](_0x50f718[_0x9777('0x34')],_0x2b636f['filters']),_0x376157);if(_0x50f718[_0x9777('0x34')][_0x9777('0x3e')]){_0xbdcc9['where']=_['merge'](_0xbdcc9['where'],{'$or':_[_0x9777('0x2e')](_0x376157,function(_0x484aee){if(_0x484aee[_0x9777('0x32')]!=='VIRTUAL'){var _0x9c4320={};_0x9c4320[_0x484aee[_0x9777('0x2b')]]={'$like':'%'+_0x50f718[_0x9777('0x34')]['filter']+'%'};return _0x9c4320;}})});}_0xbdcc9=_['merge']({},_0xbdcc9,_0x50f718[_0x9777('0x3f')]);var _0x3ae3d3={'where':_0xbdcc9[_0x9777('0x40')]};return db[_0x9777('0x2f')][_0x9777('0x1f')](_0x3ae3d3)[_0x9777('0x25')](function(_0x18f385){_0x29498f['count']=_0x18f385;if(_0x50f718[_0x9777('0x34')]['includeAll']){_0xbdcc9[_0x9777('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x9777('0x42')](_0xbdcc9);})[_0x9777('0x25')](function(_0x5b8603){_0x29498f[_0x9777('0x43')]=_0x5b8603;return _0x29498f;})[_0x9777('0x25')](respondWithFilteredResult(_0xf4c68e,_0xbdcc9))['catch'](handleError(_0xf4c68e,null));};exports[_0x9777('0x44')]=function(_0x2dba33,_0x5e6e5f){var _0xadedc4={'raw':![],'where':{'id':_0x2dba33[_0x9777('0x45')]['id']}},_0x1fc2ce={};_0x1fc2ce[_0x9777('0x33')]=_[_0x9777('0x35')](db[_0x9777('0x2f')][_0x9777('0x30')]);_0x1fc2ce[_0x9777('0x34')]=_[_0x9777('0x35')](_0x2dba33[_0x9777('0x34')]);_0x1fc2ce[_0x9777('0x36')]=_[_0x9777('0x37')](_0x1fc2ce[_0x9777('0x33')],_0x1fc2ce['query']);_0xadedc4['attributes']=_[_0x9777('0x37')](_0x1fc2ce['model'],qs['fields'](_0x2dba33[_0x9777('0x34')][_0x9777('0x39')]));_0xadedc4[_0x9777('0x38')]=_0xadedc4[_0x9777('0x38')][_0x9777('0x46')]?_0xadedc4['attributes']:_0x1fc2ce[_0x9777('0x33')];if(_0x2dba33[_0x9777('0x34')][_0x9777('0x47')]){_0xadedc4['include']=[{'all':!![]}];}_0xadedc4=_[_0x9777('0x48')]({},_0xadedc4,_0x2dba33[_0x9777('0x3f')]);return db['VoiceMusicOnHold'][_0x9777('0x49')](_0xadedc4)[_0x9777('0x25')](handleEntityNotFound(_0x5e6e5f,null))[_0x9777('0x25')](respondWithResult(_0x5e6e5f,null))[_0x9777('0x4a')](handleError(_0x5e6e5f,null));};exports[_0x9777('0x24')]=function(_0x5bc618,_0x38f0f4){if(_0x5bc618['body']['id']){delete _0x5bc618[_0x9777('0x4b')]['id'];}return db['VoiceMusicOnHold'][_0x9777('0x49')]({'where':{'id':_0x5bc618[_0x9777('0x45')]['id']}})[_0x9777('0x25')](handleEntityNotFound(_0x38f0f4,null))['then'](saveUpdates(_0x5bc618['body'],null))['then'](respondWithResult(_0x38f0f4,null))[_0x9777('0x4a')](handleError(_0x38f0f4,null));};exports['create']=function(_0xe5c338,_0x2a5073,_0xf9f6cb){return db[_0x9777('0x4c')][_0x9777('0x4d')](function(_0x175409){if(_0xe5c338[_0x9777('0x4b')][_0x9777('0x4e')]==='files'){_0xe5c338[_0x9777('0x4b')][_0x9777('0x4f')]=path[_0x9777('0x50')](config[_0x9777('0x51')],_0x9777('0x52'),_0xe5c338['body'][_0x9777('0x2b')]);}return db[_0x9777('0x2f')]['create'](_0xe5c338['body'],{'transaction':_0x175409})[_0x9777('0x25')](function(_0x49afa2){if(_0xe5c338['body'][_0x9777('0x4e')]===_0x9777('0x53')){fs[_0x9777('0x54')](_0x49afa2['directory'],parseInt('0777',0x8));}var _0x3d87a5=_0xe5c338['user'][_0x9777('0x27')]({'plain':!![]});if(!_0x3d87a5)throw new Error(_0x9777('0x55'));if(_0x3d87a5['role']==='user'){var _0x40705c=_0x49afa2['get']({'plain':!![]});return db[_0x9777('0x56')][_0x9777('0x49')]({'where':{'name':_0x9777('0x28'),'userProfileId':_0x3d87a5[_0x9777('0x57')]},'raw':!![]})[_0x9777('0x25')](function(_0x52e6dc){if(_0x52e6dc&&_0x52e6dc[_0x9777('0x58')]===0x0){return db[_0x9777('0x29')]['create']({'name':_0x40705c[_0x9777('0x2b')],'resourceId':_0x40705c['id'],'type':_0x52e6dc[_0x9777('0x2b')],'sectionId':_0x52e6dc['id']},{})[_0x9777('0x25')](function(){return _0x49afa2;});}else{return _0x49afa2;}})[_0x9777('0x4a')](function(_0x3cb130){logger[_0x9777('0x2a')](_0x9777('0x59'),_0x3cb130);});}return _0x49afa2;});})[_0x9777('0x25')](respondWithResult(_0x2a5073,0xc9))[_0x9777('0x4a')](handleError(_0x2a5073,null));};exports[_0x9777('0x26')]=function(_0x3655af,_0x2ab274,_0x8d7bb5){var _0x3eb2c2;return db[_0x9777('0x2f')]['find']({'where':{'id':_0x3655af[_0x9777('0x45')]['id']}})[_0x9777('0x25')](function(_0x4d45d2){if(_0x4d45d2){return db['sequelize']['transaction'](function(_0x1bf81c){return _0x4d45d2[_0x9777('0x26')]({'transaction':_0x1bf81c,'raw':!![]})[_0x9777('0x25')](function(_0x3b6299){if(_0x3b6299['directory']){fs['readdirSync'](_0x3b6299[_0x9777('0x4f')])['forEach'](function(_0x1eeaeb){fs[_0x9777('0x5a')](path[_0x9777('0x50')](_0x3b6299[_0x9777('0x4f')],_0x1eeaeb));});fs['rmdirSync'](_0x3b6299[_0x9777('0x4f')]);}return _0x3b6299;});})['catch'](function(_0x52a74f){throw new db[(_0x9777('0x5b'))][(_0x9777('0x5c'))](_0x52a74f[_0x9777('0x5d')]);});}})[_0x9777('0x25')](handleEntityNotFound(_0x2ab274,null))[_0x9777('0x25')](removeEntity(_0x2ab274,null))[_0x9777('0x4a')](handleError(_0x2ab274,null));};exports[_0x9777('0x5e')]=function(_0x508687,_0x5de199,_0x2b3a00){return db[_0x9777('0x4c')][_0x9777('0x4d')](function(_0xaab7ce){var _0x54ea64;return db['VoiceMusicOnHold'][_0x9777('0x49')]({'where':{'id':_0x508687[_0x9777('0x45')]['id']}})[_0x9777('0x25')](function(_0x598689){if(_0x598689){_0x54ea64=_0x598689;return _0x598689[_0x9777('0x5e')](_0x508687[_0x9777('0x4b')]['id'],{'transaction':_0xaab7ce});}})[_0x9777('0x25')](function(_0x5b2033){if(_0x5b2033){return db[_0x9777('0x5f')][_0x9777('0x60')]({'where':{'id':_0x508687[_0x9777('0x4b')]['id']},'attributes':['id',_0x9777('0x2b'),_0x9777('0x61'),_0x9777('0x62'),_0x9777('0x63')],'raw':!![]});}})['then'](function(_0xbc2a88){if(_0xbc2a88){var _0x3439c2=path['join'](config['root'],_0x9777('0x64'),util[_0x9777('0x65')]('%s.%s',path[_0x9777('0x66')](_0xbc2a88[_0x9777('0x61')],path[_0x9777('0x67')](_0xbc2a88[_0x9777('0x61')])),_0xbc2a88[_0x9777('0x62')]));var _0x135c32=path['join'](config[_0x9777('0x51')],_0x9777('0x52'),_0x54ea64[_0x9777('0x2b')],util[_0x9777('0x65')](_0x9777('0x68'),_0xbc2a88['name'],_0xbc2a88[_0x9777('0x62')]));fs[_0x9777('0x69')](_0x3439c2,_0x135c32);return _0xbc2a88;}})[_0x9777('0x4a')](function(_0x22b6d5){throw new db['Sequelize'][(_0x9777('0x5c'))](_0x22b6d5[_0x9777('0x5d')]);});})[_0x9777('0x25')](handleEntityNotFound(_0x5de199,null))[_0x9777('0x25')](respondWithResult(_0x5de199,0xc9))[_0x9777('0x4a')](handleError(_0x5de199,null));};exports[_0x9777('0x6a')]=function(_0x3bd8ce,_0x414a64,_0x4a56b6){return db[_0x9777('0x4c')][_0x9777('0x4d')](function(_0x3862a0){var _0x40c0f0;return db[_0x9777('0x2f')][_0x9777('0x60')]({'where':{'id':_0x3bd8ce['params']['id']}})[_0x9777('0x25')](handleEntityNotFound(_0x414a64,null))['then'](function(_0x337f83){if(_0x337f83){_0x40c0f0=_0x337f83;return _0x337f83[_0x9777('0x6a')](_0x3bd8ce[_0x9777('0x45')][_0x9777('0x6b')]);}})[_0x9777('0x25')](function(_0x5d044f){if(_0x5d044f){return db['Sound'][_0x9777('0x60')]({'where':{'id':_0x3bd8ce['params'][_0x9777('0x6b')]},'attributes':['id',_0x9777('0x2b'),_0x9777('0x61'),'converted_format',_0x9777('0x63')],'raw':!![]});}})[_0x9777('0x25')](function(_0x6acc50){if(_0x6acc50){fs[_0x9777('0x5a')](path['join'](_0x40c0f0['directory'],util['format'](_0x9777('0x68'),_0x6acc50['name'],_0x6acc50[_0x9777('0x62')])));return _0x6acc50;}})[_0x9777('0x4a')](function(_0x4615de){throw new db[(_0x9777('0x5b'))][(_0x9777('0x5c'))](_0x4615de[_0x9777('0x5d')]);});})['then'](handleEntityNotFound(_0x414a64,null))[_0x9777('0x25')](respondWithStatusCode(_0x414a64,0xcc))[_0x9777('0x4a')](handleError(_0x414a64,null));};exports[_0x9777('0x6c')]=function(_0x24f907,_0x226edc,_0x330520){var _0x580f13={};var _0x278585={};var _0x1ef566;var _0x4e5434;return db[_0x9777('0x2f')][_0x9777('0x60')]({'where':{'id':_0x24f907['params']['id']}})[_0x9777('0x25')](handleEntityNotFound(_0x226edc,null))[_0x9777('0x25')](function(_0x2f5260){if(_0x2f5260){_0x1ef566=_0x2f5260;_0x278585[_0x9777('0x33')]=_['keys'](db['Sound'][_0x9777('0x30')]);_0x278585[_0x9777('0x34')]=_[_0x9777('0x35')](_0x24f907[_0x9777('0x34')]);_0x278585[_0x9777('0x36')]=_[_0x9777('0x37')](_0x278585[_0x9777('0x33')],_0x278585['query']);_0x580f13[_0x9777('0x38')]=_[_0x9777('0x37')](_0x278585[_0x9777('0x33')],qs[_0x9777('0x39')](_0x24f907[_0x9777('0x34')]['fields']));_0x580f13[_0x9777('0x38')]=_0x580f13[_0x9777('0x38')]['length']?_0x580f13[_0x9777('0x38')]:_0x278585[_0x9777('0x33')];_0x580f13['order']=qs['sort'](_0x24f907[_0x9777('0x34')][_0x9777('0x3c')]);_0x580f13[_0x9777('0x40')]=qs[_0x9777('0x36')](_['pick'](_0x24f907['query'],_0x278585['filters']));if(_0x24f907[_0x9777('0x34')][_0x9777('0x3e')]){_0x580f13[_0x9777('0x40')]=_['merge'](_0x580f13['where'],{'$or':_[_0x9777('0x2e')](_0x580f13[_0x9777('0x38')],function(_0xdd8280){var _0x2d17a4={};_0x2d17a4[_0xdd8280]={'$like':'%'+_0x24f907['query'][_0x9777('0x3e')]+'%'};return _0x2d17a4;})});}_0x580f13=_[_0x9777('0x48')]({},_0x580f13,_0x24f907[_0x9777('0x3f')]);return _0x1ef566[_0x9777('0x6c')](_0x580f13);}})[_0x9777('0x25')](function(_0xbd3bb9){if(_0xbd3bb9){_0x4e5434=_0xbd3bb9['length'];if(!_0x24f907['query']['hasOwnProperty'](_0x9777('0x3a'))){_0x580f13[_0x9777('0x20')]=qs[_0x9777('0x20')](_0x24f907['query']['limit']);_0x580f13[_0x9777('0x1d')]=qs['offset'](_0x24f907[_0x9777('0x34')]['offset']);}return _0x1ef566['getSounds'](_0x580f13);}})['then'](function(_0xbfb17){if(_0xbfb17){return _0xbfb17?{'count':_0x4e5434,'rows':_0xbfb17}:null;}})[_0x9777('0x25')](respondWithResult(_0x226edc,null))[_0x9777('0x4a')](handleError(_0x226edc,null));}; \ No newline at end of file +var _0xbd29=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','keys','body','find','create','sequelize','mode','files','join','root','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','rmdirSync','Sequelize','ValidationError','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','server/files/moh','symlinkSync','removeSound','findOne','id2','Sound','unlinkSync','%s.%s','message','getSounds','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2eb79e,_0x112902){var _0x3929d7=function(_0x16da18){while(--_0x16da18){_0x2eb79e['push'](_0x2eb79e['shift']());}};_0x3929d7(++_0x112902);}(_0xbd29,0x1c1));var _0x9bd2=function(_0x1ea1fd,_0x5b9453){_0x1ea1fd=_0x1ea1fd-0x0;var _0x561c3a=_0xbd29[_0x1ea1fd];return _0x561c3a;};'use strict';var emlformat=require(_0x9bd2('0x0'));var rimraf=require(_0x9bd2('0x1'));var zipdir=require(_0x9bd2('0x2'));var jsonpatch=require(_0x9bd2('0x3'));var rp=require(_0x9bd2('0x4'));var moment=require(_0x9bd2('0x5'));var BPromise=require(_0x9bd2('0x6'));var Mustache=require(_0x9bd2('0x7'));var util=require('util');var path=require(_0x9bd2('0x8'));var sox=require(_0x9bd2('0x9'));var csv=require('to-csv');var ejs=require(_0x9bd2('0xa'));var fs=require('fs');var fs_extra=require(_0x9bd2('0xb'));var _=require(_0x9bd2('0xc'));var squel=require('squel');var crypto=require(_0x9bd2('0xd'));var jsforce=require(_0x9bd2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9bd2('0xf'));var querystring=require(_0x9bd2('0x10'));var Papa=require(_0x9bd2('0x11'));var Redis=require(_0x9bd2('0x12'));var authService=require(_0x9bd2('0x13'));var qs=require(_0x9bd2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bd2('0x15'));var logger=require(_0x9bd2('0x16'))(_0x9bd2('0x17'));var utils=require(_0x9bd2('0x18'));var config=require(_0x9bd2('0x19'));var licenseUtil=require(_0x9bd2('0x1a'));var db=require(_0x9bd2('0x1b'))['db'];function respondWithStatusCode(_0x25fdc1,_0x490e3d){_0x490e3d=_0x490e3d||0xcc;return function(_0x2a3db4){if(_0x2a3db4){return _0x25fdc1[_0x9bd2('0x1c')](_0x490e3d);}return _0x25fdc1[_0x9bd2('0x1d')](_0x490e3d)['end']();};}function respondWithResult(_0x127a4b,_0x53cd54){_0x53cd54=_0x53cd54||0xc8;return function(_0x4d426f){if(_0x4d426f){return _0x127a4b[_0x9bd2('0x1d')](_0x53cd54)[_0x9bd2('0x1e')](_0x4d426f);}};}function respondWithFilteredResult(_0x4d2133,_0x240409){return function(_0x569a0e){if(_0x569a0e){var _0x4188a9=typeof _0x240409[_0x9bd2('0x1f')]===_0x9bd2('0x20')&&typeof _0x240409[_0x9bd2('0x21')]===_0x9bd2('0x20');var _0x2b3509=_0x569a0e[_0x9bd2('0x22')];var _0x35a75a=_0x4188a9?0x0:_0x240409[_0x9bd2('0x1f')];var _0x1eb278=_0x4188a9?_0x569a0e['count']:_0x240409[_0x9bd2('0x1f')]+_0x240409[_0x9bd2('0x21')];var _0x2b27dd;if(_0x1eb278>=_0x2b3509){_0x1eb278=_0x2b3509;_0x2b27dd=0xc8;}else{_0x2b27dd=0xce;}_0x4d2133[_0x9bd2('0x1d')](_0x2b27dd);return _0x4d2133['set']('Content-Range',_0x35a75a+'-'+_0x1eb278+'/'+_0x2b3509)[_0x9bd2('0x1e')](_0x569a0e);}return null;};}function patchUpdates(_0xd391f2){return function(_0x2d8008){try{jsonpatch[_0x9bd2('0x23')](_0x2d8008,_0xd391f2,!![]);}catch(_0x828236){return BPromise[_0x9bd2('0x24')](_0x828236);}return _0x2d8008[_0x9bd2('0x25')]();};}function saveUpdates(_0x3c46be,_0x27b3fd){return function(_0x17d1ab){if(_0x17d1ab){return _0x17d1ab[_0x9bd2('0x26')](_0x3c46be)[_0x9bd2('0x27')](function(_0x1fb5d4){return _0x1fb5d4;});}return null;};}function removeEntity(_0x2ba5de,_0x64200f){return function(_0x29c339){if(_0x29c339){return _0x29c339['destroy']()[_0x9bd2('0x27')](function(){var _0x52ce56=_0x29c339[_0x9bd2('0x28')]({'plain':!![]});var _0xa1f12d='MusicOnHolds';return db[_0x9bd2('0x29')][_0x9bd2('0x2a')]({'where':{'type':_0xa1f12d,'resourceId':_0x52ce56['id']}})[_0x9bd2('0x27')](function(){return _0x29c339;});})[_0x9bd2('0x27')](function(){_0x2ba5de['status'](0xcc)[_0x9bd2('0x2b')]();});}};}function handleEntityNotFound(_0x1cbe7f,_0x132ec9){return function(_0x56b1e3){if(!_0x56b1e3){_0x1cbe7f[_0x9bd2('0x1c')](0x194);}return _0x56b1e3;};}function handleError(_0x4afc6c,_0x5b06b3){_0x5b06b3=_0x5b06b3||0x1f4;return function(_0xd73407){logger[_0x9bd2('0x2c')](_0xd73407[_0x9bd2('0x2d')]);if(_0xd73407[_0x9bd2('0x2e')]){delete _0xd73407['name'];}_0x4afc6c[_0x9bd2('0x1d')](_0x5b06b3)[_0x9bd2('0x2f')](_0xd73407);};}exports['index']=function(_0x24d7c4,_0x17e780){var _0x46b643={},_0x454e8e={},_0x544ffd={'count':0x0,'rows':[]};var _0x19fed0=_[_0x9bd2('0x30')](db['VoiceMusicOnHold'][_0x9bd2('0x31')],function(_0x4420c4){return{'name':_0x4420c4[_0x9bd2('0x32')],'type':_0x4420c4[_0x9bd2('0x33')]['key']};});_0x454e8e[_0x9bd2('0x34')]=_['map'](_0x19fed0,_0x9bd2('0x2e'));_0x454e8e[_0x9bd2('0x35')]=_['keys'](_0x24d7c4[_0x9bd2('0x35')]);_0x454e8e[_0x9bd2('0x36')]=_[_0x9bd2('0x37')](_0x454e8e['model'],_0x454e8e['query']);_0x46b643['attributes']=_[_0x9bd2('0x37')](_0x454e8e[_0x9bd2('0x34')],qs[_0x9bd2('0x38')](_0x24d7c4[_0x9bd2('0x35')]['fields']));_0x46b643[_0x9bd2('0x39')]=_0x46b643['attributes'][_0x9bd2('0x3a')]?_0x46b643[_0x9bd2('0x39')]:_0x454e8e['model'];if(!_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3b')]('nolimit')){_0x46b643[_0x9bd2('0x21')]=qs['limit'](_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x21')]);_0x46b643['offset']=qs['offset'](_0x24d7c4[_0x9bd2('0x35')]['offset']);}_0x46b643['order']=qs[_0x9bd2('0x3c')](_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3c')]);delete _0x24d7c4[_0x9bd2('0x35')]['sort'];_0x46b643[_0x9bd2('0x3d')]=qs['filters'](_[_0x9bd2('0x3e')](_0x24d7c4[_0x9bd2('0x35')],_0x454e8e[_0x9bd2('0x36')]),_0x19fed0);if(_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3f')]){_0x46b643['where']=_[_0x9bd2('0x40')](_0x46b643['where'],{'$or':_['map'](_0x19fed0,function(_0x589ea5){if(_0x589ea5[_0x9bd2('0x33')]!==_0x9bd2('0x41')){var _0x3e4d5b={};_0x3e4d5b[_0x589ea5[_0x9bd2('0x2e')]]={'$like':'%'+_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3f')]+'%'};return _0x3e4d5b;}})});}_0x46b643=_['merge']({},_0x46b643,_0x24d7c4[_0x9bd2('0x42')]);var _0x4752a7={'where':_0x46b643['where']};return db[_0x9bd2('0x43')]['count'](_0x4752a7)['then'](function(_0x50b385){_0x544ffd[_0x9bd2('0x22')]=_0x50b385;if(_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x44')]){_0x46b643[_0x9bd2('0x45')]=[{'all':!![]}];}return db[_0x9bd2('0x43')][_0x9bd2('0x46')](_0x46b643);})['then'](function(_0x592475){_0x544ffd['rows']=_0x592475;return _0x544ffd;})['then'](respondWithFilteredResult(_0x17e780,_0x46b643))[_0x9bd2('0x47')](handleError(_0x17e780,null));};exports[_0x9bd2('0x48')]=function(_0x1af66f,_0x340ba4){var _0x13dcef={'raw':![],'where':{'id':_0x1af66f[_0x9bd2('0x49')]['id']}},_0x1568f5={};_0x1568f5[_0x9bd2('0x34')]=_['keys'](db[_0x9bd2('0x43')][_0x9bd2('0x31')]);_0x1568f5[_0x9bd2('0x35')]=_[_0x9bd2('0x4a')](_0x1af66f[_0x9bd2('0x35')]);_0x1568f5['filters']=_[_0x9bd2('0x37')](_0x1568f5[_0x9bd2('0x34')],_0x1568f5[_0x9bd2('0x35')]);_0x13dcef['attributes']=_['intersection'](_0x1568f5['model'],qs[_0x9bd2('0x38')](_0x1af66f['query'][_0x9bd2('0x38')]));_0x13dcef['attributes']=_0x13dcef['attributes'][_0x9bd2('0x3a')]?_0x13dcef[_0x9bd2('0x39')]:_0x1568f5[_0x9bd2('0x34')];if(_0x1af66f[_0x9bd2('0x35')]['includeAll']){_0x13dcef['include']=[{'all':!![]}];}_0x13dcef=_[_0x9bd2('0x40')]({},_0x13dcef,_0x1af66f['options']);return db[_0x9bd2('0x43')]['find'](_0x13dcef)[_0x9bd2('0x27')](handleEntityNotFound(_0x340ba4,null))[_0x9bd2('0x27')](respondWithResult(_0x340ba4,null))['catch'](handleError(_0x340ba4,null));};exports[_0x9bd2('0x26')]=function(_0xcdd530,_0x5be82b){if(_0xcdd530[_0x9bd2('0x4b')]['id']){delete _0xcdd530[_0x9bd2('0x4b')]['id'];}return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0xcdd530[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](handleEntityNotFound(_0x5be82b,null))[_0x9bd2('0x27')](saveUpdates(_0xcdd530[_0x9bd2('0x4b')],null))[_0x9bd2('0x27')](respondWithResult(_0x5be82b,null))[_0x9bd2('0x47')](handleError(_0x5be82b,null));};exports[_0x9bd2('0x4d')]=function(_0x2bbcd8,_0x12f622,_0x273155){return db[_0x9bd2('0x4e')]['transaction'](function(_0x15b119){if(_0x2bbcd8[_0x9bd2('0x4b')][_0x9bd2('0x4f')]===_0x9bd2('0x50')){_0x2bbcd8[_0x9bd2('0x4b')]['directory']=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],'server/files/moh',_0x2bbcd8[_0x9bd2('0x4b')][_0x9bd2('0x2e')]);}return db[_0x9bd2('0x43')][_0x9bd2('0x4d')](_0x2bbcd8[_0x9bd2('0x4b')],{'transaction':_0x15b119})[_0x9bd2('0x27')](function(_0x545dde){if(_0x2bbcd8['body']['mode']===_0x9bd2('0x50')){fs[_0x9bd2('0x53')](_0x545dde[_0x9bd2('0x54')],parseInt(_0x9bd2('0x55'),0x8));}var _0x528c24=_0x2bbcd8[_0x9bd2('0x56')]['get']({'plain':!![]});if(!_0x528c24)throw new Error(_0x9bd2('0x57'));if(_0x528c24[_0x9bd2('0x58')]==='user'){var _0xc54afa=_0x545dde[_0x9bd2('0x28')]({'plain':!![]});return db[_0x9bd2('0x59')][_0x9bd2('0x4c')]({'where':{'name':_0x9bd2('0x5a'),'userProfileId':_0x528c24[_0x9bd2('0x5b')]},'raw':!![]})[_0x9bd2('0x27')](function(_0x3ebffd){if(_0x3ebffd&&_0x3ebffd[_0x9bd2('0x5c')]===0x0){return db['UserProfileResource'][_0x9bd2('0x4d')]({'name':_0xc54afa[_0x9bd2('0x2e')],'resourceId':_0xc54afa['id'],'type':_0x3ebffd['name'],'sectionId':_0x3ebffd['id']},{})[_0x9bd2('0x27')](function(){return _0x545dde;});}else{return _0x545dde;}})[_0x9bd2('0x47')](function(_0x488551){logger[_0x9bd2('0x2c')](_0x9bd2('0x5d'),_0x488551);});}return _0x545dde;});})['then'](respondWithResult(_0x12f622,0xc9))['catch'](handleError(_0x12f622,null));};exports['destroy']=function(_0x828fc7,_0x17e4d2,_0x42e9f4){var _0x3e4eab;return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0x828fc7[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](function(_0x5d394c){if(_0x5d394c){return db['sequelize'][_0x9bd2('0x5e')](function(_0x29ed7b){return _0x5d394c[_0x9bd2('0x2a')]({'transaction':_0x29ed7b,'raw':!![]})['then'](function(_0x3a1968){if(_0x3a1968[_0x9bd2('0x54')]){fs['readdirSync'](_0x3a1968[_0x9bd2('0x54')])['forEach'](function(_0x566118){fs['unlinkSync'](path['join'](_0x3a1968['directory'],_0x566118));});fs[_0x9bd2('0x5f')](_0x3a1968[_0x9bd2('0x54')]);}return _0x3a1968;});})[_0x9bd2('0x47')](function(_0x54176d){throw new db[(_0x9bd2('0x60'))][(_0x9bd2('0x61'))](_0x54176d['message']);});}})[_0x9bd2('0x27')](handleEntityNotFound(_0x17e4d2,null))[_0x9bd2('0x27')](removeEntity(_0x17e4d2,null))[_0x9bd2('0x47')](handleError(_0x17e4d2,null));};exports[_0x9bd2('0x62')]=function(_0x23e685,_0x4803c2,_0x1791be){return db[_0x9bd2('0x4e')][_0x9bd2('0x5e')](function(_0x239d2e){var _0x5a1ceb;return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0x23e685[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](function(_0x5e0756){if(_0x5e0756){_0x5a1ceb=_0x5e0756;return _0x5e0756[_0x9bd2('0x62')](_0x23e685[_0x9bd2('0x4b')]['id'],{'transaction':_0x239d2e});}})[_0x9bd2('0x27')](function(_0x47848c){if(_0x47848c){return db['Sound']['findOne']({'where':{'id':_0x23e685[_0x9bd2('0x4b')]['id']},'attributes':['id',_0x9bd2('0x2e'),_0x9bd2('0x63'),_0x9bd2('0x64'),_0x9bd2('0x65')],'raw':!![]});}})[_0x9bd2('0x27')](function(_0xfb1908){if(_0xfb1908){var _0x5cc7b2=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],_0x9bd2('0x66'),util[_0x9bd2('0x67')]('%s.%s',path[_0x9bd2('0x68')](_0xfb1908['save_name'],path[_0x9bd2('0x69')](_0xfb1908['save_name'])),_0xfb1908[_0x9bd2('0x64')]));var _0xb25dce=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],_0x9bd2('0x6a'),_0x5a1ceb[_0x9bd2('0x2e')],util[_0x9bd2('0x67')]('%s.%s',_0xfb1908['name'],_0xfb1908[_0x9bd2('0x64')]));fs[_0x9bd2('0x6b')](_0x5cc7b2,_0xb25dce);return _0xfb1908;}})['catch'](function(_0x3bcfa7){throw new db[(_0x9bd2('0x60'))][(_0x9bd2('0x61'))](_0x3bcfa7['message']);});})['then'](handleEntityNotFound(_0x4803c2,null))['then'](respondWithResult(_0x4803c2,0xc9))[_0x9bd2('0x47')](handleError(_0x4803c2,null));};exports[_0x9bd2('0x6c')]=function(_0x4cc3c7,_0x1f021b,_0x544792){return db['sequelize']['transaction'](function(_0x3e9702){var _0x387232;return db[_0x9bd2('0x43')][_0x9bd2('0x6d')]({'where':{'id':_0x4cc3c7[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](handleEntityNotFound(_0x1f021b,null))[_0x9bd2('0x27')](function(_0x428651){if(_0x428651){_0x387232=_0x428651;return _0x428651[_0x9bd2('0x6c')](_0x4cc3c7['params'][_0x9bd2('0x6e')]);}})[_0x9bd2('0x27')](function(_0xb5686d){if(_0xb5686d){return db[_0x9bd2('0x6f')]['findOne']({'where':{'id':_0x4cc3c7['params'][_0x9bd2('0x6e')]},'attributes':['id','name',_0x9bd2('0x63'),_0x9bd2('0x64'),_0x9bd2('0x65')],'raw':!![]});}})[_0x9bd2('0x27')](function(_0x55427f){if(_0x55427f){fs[_0x9bd2('0x70')](path[_0x9bd2('0x51')](_0x387232[_0x9bd2('0x54')],util[_0x9bd2('0x67')](_0x9bd2('0x71'),_0x55427f[_0x9bd2('0x2e')],_0x55427f[_0x9bd2('0x64')])));return _0x55427f;}})[_0x9bd2('0x47')](function(_0x36294a){throw new db['Sequelize'][(_0x9bd2('0x61'))](_0x36294a[_0x9bd2('0x72')]);});})[_0x9bd2('0x27')](handleEntityNotFound(_0x1f021b,null))['then'](respondWithStatusCode(_0x1f021b,0xcc))['catch'](handleError(_0x1f021b,null));};exports[_0x9bd2('0x73')]=function(_0x122844,_0x33e572,_0x366f9a){var _0x1775af={};var _0x3a1b70={};var _0xe9ffdf;var _0x508c59;return db['VoiceMusicOnHold'][_0x9bd2('0x6d')]({'where':{'id':_0x122844[_0x9bd2('0x49')]['id']}})['then'](handleEntityNotFound(_0x33e572,null))[_0x9bd2('0x27')](function(_0x25b63a){if(_0x25b63a){_0xe9ffdf=_0x25b63a;_0x3a1b70['model']=_[_0x9bd2('0x4a')](db[_0x9bd2('0x6f')][_0x9bd2('0x31')]);_0x3a1b70[_0x9bd2('0x35')]=_[_0x9bd2('0x4a')](_0x122844[_0x9bd2('0x35')]);_0x3a1b70[_0x9bd2('0x36')]=_[_0x9bd2('0x37')](_0x3a1b70[_0x9bd2('0x34')],_0x3a1b70['query']);_0x1775af[_0x9bd2('0x39')]=_[_0x9bd2('0x37')](_0x3a1b70['model'],qs['fields'](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x38')]));_0x1775af[_0x9bd2('0x39')]=_0x1775af[_0x9bd2('0x39')][_0x9bd2('0x3a')]?_0x1775af[_0x9bd2('0x39')]:_0x3a1b70[_0x9bd2('0x34')];_0x1775af[_0x9bd2('0x74')]=qs['sort'](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3c')]);_0x1775af[_0x9bd2('0x3d')]=qs[_0x9bd2('0x36')](_[_0x9bd2('0x3e')](_0x122844[_0x9bd2('0x35')],_0x3a1b70[_0x9bd2('0x36')]));if(_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3f')]){_0x1775af['where']=_['merge'](_0x1775af[_0x9bd2('0x3d')],{'$or':_[_0x9bd2('0x30')](_0x1775af[_0x9bd2('0x39')],function(_0x354bac){var _0x20132e={};_0x20132e[_0x354bac]={'$like':'%'+_0x122844[_0x9bd2('0x35')]['filter']+'%'};return _0x20132e;})});}_0x1775af=_[_0x9bd2('0x40')]({},_0x1775af,_0x122844[_0x9bd2('0x42')]);return _0xe9ffdf[_0x9bd2('0x73')](_0x1775af);}})[_0x9bd2('0x27')](function(_0x2902fb){if(_0x2902fb){_0x508c59=_0x2902fb[_0x9bd2('0x3a')];if(!_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3b')](_0x9bd2('0x75'))){_0x1775af[_0x9bd2('0x21')]=qs[_0x9bd2('0x21')](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x21')]);_0x1775af[_0x9bd2('0x1f')]=qs[_0x9bd2('0x1f')](_0x122844['query'][_0x9bd2('0x1f')]);}return _0xe9ffdf[_0x9bd2('0x73')](_0x1775af);}})['then'](function(_0x386de0){if(_0x386de0){return _0x386de0?{'count':_0x508c59,'rows':_0x386de0}:null;}})[_0x9bd2('0x27')](respondWithResult(_0x33e572,null))[_0x9bd2('0x47')](handleError(_0x33e572,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 655c4ce..d6927d0 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 _0x27eb=['api','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x527000,_0x17d95d){var _0x184e5b=function(_0x170e5d){while(--_0x170e5d){_0x527000['push'](_0x527000['shift']());}};_0x184e5b(++_0x17d95d);}(_0x27eb,0x69));var _0xb27e=function(_0x11bd71,_0x27129a){_0x11bd71=_0x11bd71-0x0;var _0x111b09=_0x27eb[_0x11bd71];return _0x111b09;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var logger=require(_0xb27e('0x2'))(_0xb27e('0x3'));var moment=require('moment');var BPromise=require(_0xb27e('0x4'));var rp=require(_0xb27e('0x5'));var fs=require('fs');var path=require(_0xb27e('0x6'));var rimraf=require(_0xb27e('0x7'));var config=require('../../config/environment');var attributes=require(_0xb27e('0x8'));module[_0xb27e('0x9')]=function(_0x5c491a,_0x9e33fc){return _0x5c491a[_0xb27e('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0xb27e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc72c=['voice_musiconhold','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0xe37727,_0x54ffae){var _0x295c23=function(_0x4ed0bf){while(--_0x4ed0bf){_0xe37727['push'](_0xe37727['shift']());}};_0x295c23(++_0x54ffae);}(_0xc72c,0xfb));var _0xcc72=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc72c[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc72('0x0'))(_0xcc72('0x1'));var moment=require('moment');var BPromise=require(_0xcc72('0x2'));var rp=require(_0xcc72('0x3'));var fs=require('fs');var path=require(_0xcc72('0x4'));var rimraf=require(_0xcc72('0x5'));var config=require('../../config/environment');var attributes=require(_0xcc72('0x6'));module['exports']=function(_0x192800,_0x14c052){return _0x192800[_0xcc72('0x7')](_0xcc72('0x8'),attributes,{'tableName':_0xcc72('0x9'),'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 f2899f8..f2fb4ea 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2ae362,_0x101abb){var _0x2d8613=function(_0x196f64){while(--_0x196f64){_0x2ae362['push'](_0x2ae362['shift']());}};_0x2d8613(++_0x101abb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x158637,_0x202b9b){var _0x309c6b=function(_0x1a359f){while(--_0x1a359f){_0x158637['push'](_0x158637['shift']());}};_0x309c6b(++_0x202b9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 287c53f..20c0b86 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 _0xe81d=['describe','/:id/users','getAgents','getTeams','post','addAgents','/:id/teams','addTeams','put','/:id','update','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x5096f5,_0xf0d22a){var _0x3a656d=function(_0x5bc773){while(--_0x5bc773){_0x5096f5['push'](_0x5096f5['shift']());}};_0x3a656d(++_0xf0d22a);}(_0xe81d,0xc4));var _0xde81=function(_0x2bc8f9,_0x155115){_0x2bc8f9=_0x2bc8f9-0x0;var _0x93d4a8=_0xe81d[_0x2bc8f9];return _0x93d4a8;};'use strict';var multer=require(_0xde81('0x0'));var util=require(_0xde81('0x1'));var path=require(_0xde81('0x2'));var timeout=require(_0xde81('0x3'));var express=require(_0xde81('0x4'));var router=express[_0xde81('0x5')]();var fs_extra=require(_0xde81('0x6'));var auth=require(_0xde81('0x7'));var interaction=require(_0xde81('0x8'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xde81('0x9')]('/',auth[_0xde81('0xa')](),controller['index']);router[_0xde81('0x9')](_0xde81('0xb'),auth[_0xde81('0xa')](),controller[_0xde81('0xc')]);router[_0xde81('0x9')]('/:id',auth[_0xde81('0xa')](),controller['show']);router[_0xde81('0x9')](_0xde81('0xd'),auth[_0xde81('0xa')](),controller[_0xde81('0xe')]);router['get']('/:id/teams',auth[_0xde81('0xa')](),controller[_0xde81('0xf')]);router[_0xde81('0x10')]('/',auth[_0xde81('0xa')](),controller['create']);router[_0xde81('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xde81('0x11')]);router[_0xde81('0x10')](_0xde81('0x12'),auth['isAuthenticated'](),controller[_0xde81('0x13')]);router[_0xde81('0x14')](_0xde81('0x15'),auth['isAuthenticated'](),controller[_0xde81('0x16')]);router[_0xde81('0x17')](_0xde81('0x15'),auth[_0xde81('0xa')](),controller['destroy']);router[_0xde81('0x17')]('/:id/users',auth[_0xde81('0xa')](),controller[_0xde81('0x18')]);router[_0xde81('0x17')](_0xde81('0x12'),auth[_0xde81('0xa')](),controller[_0xde81('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6a88=['post','create','update','/:id','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','show','getAgents','/:id/teams','getTeams'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x6a88,0xa9));var _0x86a8=function(_0x2b7f56,_0x41bc7d){_0x2b7f56=_0x2b7f56-0x0;var _0x36896d=_0x6a88[_0x2b7f56];return _0x36896d;};'use strict';var multer=require(_0x86a8('0x0'));var util=require(_0x86a8('0x1'));var path=require(_0x86a8('0x2'));var timeout=require(_0x86a8('0x3'));var express=require(_0x86a8('0x4'));var router=express[_0x86a8('0x5')]();var fs_extra=require(_0x86a8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x86a8('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x86a8('0x8')]('/',auth[_0x86a8('0x9')](),controller['index']);router[_0x86a8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x86a8('0xa')]);router[_0x86a8('0x8')]('/:id',auth[_0x86a8('0x9')](),controller[_0x86a8('0xb')]);router['get']('/:id/users',auth[_0x86a8('0x9')](),controller[_0x86a8('0xc')]);router[_0x86a8('0x8')](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller[_0x86a8('0xe')]);router[_0x86a8('0xf')]('/',auth[_0x86a8('0x9')](),controller[_0x86a8('0x10')]);router[_0x86a8('0xf')]('/:id/users',auth[_0x86a8('0x9')](),controller['addAgents']);router['post'](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller['addTeams']);router['put']('/:id',auth[_0x86a8('0x9')](),controller[_0x86a8('0x11')]);router['delete'](_0x86a8('0x12'),auth[_0x86a8('0x9')](),controller[_0x86a8('0x13')]);router[_0x86a8('0x14')]('/:id/users',auth[_0x86a8('0x9')](),controller['removeAgents']);router[_0x86a8('0x14')](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller[_0x86a8('0x15')]);module[_0x86a8('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 0bab867..17f2129 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 _0x57d2=['exports','STRING','VIRTUAL','system-','INTEGER'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x57d2,0xe6));var _0x257d=function(_0x28c030,_0x2be170){_0x28c030=_0x28c030-0x0;var _0xafbb4e=_0x57d2[_0x28c030];return _0xafbb4e;};'use strict';var Sequelize=require('sequelize');module[_0x257d('0x0')]={'name':{'type':Sequelize[_0x257d('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x257d('0x2')],'get':function(_0x479f3d){return _0x257d('0x3')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x257d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x257d('0x4')]}}; \ No newline at end of file +var _0xccc5=['VIRTUAL','system-','getDataValue','name','INTEGER','sequelize','exports','STRING'];(function(_0x5c3242,_0x3ce7a2){var _0x15d9f3=function(_0x26c242){while(--_0x26c242){_0x5c3242['push'](_0x5c3242['shift']());}};_0x15d9f3(++_0x3ce7a2);}(_0xccc5,0x1ad));var _0x5ccc=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xccc5[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x5ccc('0x0'));module[_0x5ccc('0x1')]={'name':{'type':Sequelize[_0x5ccc('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x5ccc('0x3')],'get':function(_0x5e52fe){return _0x5ccc('0x4')+this[_0x5ccc('0x5')](_0x5ccc('0x6'))+'-';}},'description':{'type':Sequelize[_0x5ccc('0x2')]},'callerIdAll':{'type':Sequelize[_0x5ccc('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x5ccc('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2ed1fcb..edd9fdc 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 _0xf4f4=['role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','context','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','User','order','findOne','Team','getTeams','addTeams','findAll','Agents','online','voicePause','interface','each','upsert','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','VoicePrefixes','destroy','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','keys','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4d9b23,_0x37c4bd){var _0x22626a=function(_0x2cc8d8){while(--_0x2cc8d8){_0x4d9b23['push'](_0x4d9b23['shift']());}};_0x22626a(++_0x37c4bd);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1013f6,_0xc31dde){_0x1013f6=_0x1013f6-0x0;var _0x1faf53=_0xf4f4[_0x1013f6];return _0x1faf53;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];config[_0x4f4f('0x1b')]=_[_0x4f4f('0x1c')](config[_0x4f4f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f4f('0x1d'))(new Redis(config['redis']));require(_0x4f4f('0x1e'))[_0x4f4f('0x1f')](socket);function respondWithStatusCode(_0x3e16e9,_0x38535d){_0x38535d=_0x38535d||0xcc;return function(_0x4c849f){if(_0x4c849f){return _0x3e16e9[_0x4f4f('0x20')](_0x38535d);}return _0x3e16e9['status'](_0x38535d)['end']();};}function respondWithResult(_0x58de77,_0x422894){_0x422894=_0x422894||0xc8;return function(_0x8d65a2){if(_0x8d65a2){return _0x58de77[_0x4f4f('0x21')](_0x422894)[_0x4f4f('0x22')](_0x8d65a2);}};}function respondWithFilteredResult(_0x2d5e5d,_0x1777eb){return function(_0x1245c4){if(_0x1245c4){var _0x60ce2=typeof _0x1777eb[_0x4f4f('0x23')]===_0x4f4f('0x24')&&typeof _0x1777eb[_0x4f4f('0x25')]===_0x4f4f('0x24');var _0x499277=_0x1245c4[_0x4f4f('0x26')];var _0x4622c2=_0x60ce2?0x0:_0x1777eb[_0x4f4f('0x23')];var _0x201c60=_0x60ce2?_0x1245c4[_0x4f4f('0x26')]:_0x1777eb[_0x4f4f('0x23')]+_0x1777eb[_0x4f4f('0x25')];var _0x3e33d5;if(_0x201c60>=_0x499277){_0x201c60=_0x499277;_0x3e33d5=0xc8;}else{_0x3e33d5=0xce;}_0x2d5e5d[_0x4f4f('0x21')](_0x3e33d5);return _0x2d5e5d[_0x4f4f('0x27')](_0x4f4f('0x28'),_0x4622c2+'-'+_0x201c60+'/'+_0x499277)[_0x4f4f('0x22')](_0x1245c4);}return null;};}function patchUpdates(_0x17984d){return function(_0xc78135){try{jsonpatch['apply'](_0xc78135,_0x17984d,!![]);}catch(_0x4f7261){return BPromise['reject'](_0x4f7261);}return _0xc78135[_0x4f4f('0x29')]();};}function saveUpdates(_0x43e661,_0x5186ac){return function(_0x3960ae){if(_0x3960ae){return _0x3960ae[_0x4f4f('0x2a')](_0x43e661)[_0x4f4f('0x2b')](function(_0x2ec92a){return _0x2ec92a;});}return null;};}function removeEntity(_0x113ff7,_0x31b30e){return function(_0xa6371b){if(_0xa6371b){return _0xa6371b['destroy']()[_0x4f4f('0x2b')](function(){var _0x237cf9=_0xa6371b[_0x4f4f('0x2c')]({'plain':!![]});var _0x15c79c=_0x4f4f('0x2d');return db['UserProfileResource'][_0x4f4f('0x2e')]({'where':{'type':_0x15c79c,'resourceId':_0x237cf9['id']}})[_0x4f4f('0x2b')](function(){return _0xa6371b;});})[_0x4f4f('0x2b')](function(){_0x113ff7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2490,_0x73b8bb){return function(_0x5b4f6a){if(!_0x5b4f6a){_0x4c2490[_0x4f4f('0x20')](0x194);}return _0x5b4f6a;};}function handleError(_0x39c1a8,_0x2e688a){_0x2e688a=_0x2e688a||0x1f4;return function(_0x5eb7c9){logger[_0x4f4f('0x2f')](_0x5eb7c9[_0x4f4f('0x30')]);if(_0x5eb7c9['name']){delete _0x5eb7c9[_0x4f4f('0x31')];}_0x39c1a8[_0x4f4f('0x21')](_0x2e688a)[_0x4f4f('0x32')](_0x5eb7c9);};}exports['index']=function(_0x6bdf15,_0x343c75){var _0x59bdb0={},_0x5517d7={},_0x465a36={'count':0x0,'rows':[]};var _0x305bf7=_[_0x4f4f('0x33')](db[_0x4f4f('0x34')][_0x4f4f('0x35')],function(_0x8d0f53){return{'name':_0x8d0f53[_0x4f4f('0x36')],'type':_0x8d0f53[_0x4f4f('0x37')][_0x4f4f('0x38')]};});_0x5517d7[_0x4f4f('0x39')]=_['map'](_0x305bf7,'name');_0x5517d7[_0x4f4f('0x3a')]=_['keys'](_0x6bdf15[_0x4f4f('0x3a')]);_0x5517d7[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],_0x5517d7[_0x4f4f('0x3a')]);_0x59bdb0[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x59bdb0[_0x4f4f('0x3d')]=_0x59bdb0['attributes'][_0x4f4f('0x3f')]?_0x59bdb0[_0x4f4f('0x3d')]:_0x5517d7[_0x4f4f('0x39')];if(!_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x59bdb0[_0x4f4f('0x25')]=qs[_0x4f4f('0x25')](_0x6bdf15[_0x4f4f('0x3a')]['limit']);_0x59bdb0[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x6bdf15[_0x4f4f('0x3a')]['offset']);}_0x59bdb0['order']=qs[_0x4f4f('0x42')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x59bdb0[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x6bdf15[_0x4f4f('0x3a')],_0x5517d7[_0x4f4f('0x3b')]),_0x305bf7);if(_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x45')]){_0x59bdb0[_0x4f4f('0x43')]=_[_0x4f4f('0x46')](_0x59bdb0['where'],{'$or':_[_0x4f4f('0x33')](_0x305bf7,function(_0x1b031e){if(_0x1b031e[_0x4f4f('0x37')]!==_0x4f4f('0x47')){var _0x18e805={};_0x18e805[_0x1b031e['name']]={'$like':'%'+_0x6bdf15['query'][_0x4f4f('0x45')]+'%'};return _0x18e805;}})});}_0x59bdb0=_[_0x4f4f('0x46')]({},_0x59bdb0,_0x6bdf15[_0x4f4f('0x48')]);var _0xa8f1a5={'where':_0x59bdb0['where']};return db[_0x4f4f('0x34')]['count'](_0xa8f1a5)[_0x4f4f('0x2b')](function(_0x5a7c94){_0x465a36['count']=_0x5a7c94;if(_0x6bdf15[_0x4f4f('0x3a')]['includeAll']){_0x59bdb0[_0x4f4f('0x49')]=[{'all':!![]}];}return db[_0x4f4f('0x34')]['findAll'](_0x59bdb0);})[_0x4f4f('0x2b')](function(_0x2d8ff6){_0x465a36['rows']=_0x2d8ff6;return _0x465a36;})[_0x4f4f('0x2b')](respondWithFilteredResult(_0x343c75,_0x59bdb0))[_0x4f4f('0x4a')](handleError(_0x343c75,null));};exports[_0x4f4f('0x4b')]=function(_0x3defd0,_0x162674){var _0x62b468={'raw':![],'where':{'id':_0x3defd0[_0x4f4f('0x4c')]['id']}},_0xb0d1b2={};_0xb0d1b2[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x34')][_0x4f4f('0x35')]);_0xb0d1b2[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x3defd0[_0x4f4f('0x3a')]);_0xb0d1b2['filters']=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],_0xb0d1b2['query']);_0x62b468[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],qs[_0x4f4f('0x3e')](_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x62b468[_0x4f4f('0x3d')]=_0x62b468[_0x4f4f('0x3d')]['length']?_0x62b468[_0x4f4f('0x3d')]:_0xb0d1b2[_0x4f4f('0x39')];if(_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x4e')]){_0x62b468[_0x4f4f('0x49')]=[{'all':!![]}];}_0x62b468=_[_0x4f4f('0x46')]({},_0x62b468,_0x3defd0[_0x4f4f('0x48')]);return db[_0x4f4f('0x34')][_0x4f4f('0x4f')](_0x62b468)['then'](handleEntityNotFound(_0x162674,null))[_0x4f4f('0x2b')](respondWithResult(_0x162674,null))[_0x4f4f('0x4a')](handleError(_0x162674,null));};exports['destroy']=function(_0x5ac4df,_0x5941ac){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x5ac4df[_0x4f4f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5941ac,null))[_0x4f4f('0x2b')](removeEntity(_0x5941ac,null))['catch'](handleError(_0x5941ac,null));};exports[_0x4f4f('0x50')]=function(_0x1c181e,_0x3c0d7b){return db[_0x4f4f('0x34')][_0x4f4f('0x50')]()[_0x4f4f('0x2b')](respondWithResult(_0x3c0d7b,null))[_0x4f4f('0x4a')](handleError(_0x3c0d7b,null));};exports[_0x4f4f('0x51')]=function(_0x17f6fb,_0x4dbce2){var _0x59e207;return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x4c04eb){return db['VoicePrefix'][_0x4f4f('0x51')](_0x17f6fb[_0x4f4f('0x54')],{'transaction':_0x4c04eb})[_0x4f4f('0x2b')](function(_0x55a5e4){_0x59e207=_0x55a5e4['get']({'plain':!![]});return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x59e207[_0x4f4f('0x56')]},'raw':!![]})[_0x4f4f('0x2b')](function(_0x37cf8e){return createVoicePrefixExtensions(_0x59e207,_0x37cf8e,_0x4c04eb);});});})[_0x4f4f('0x2b')](function(){var _0xe66fc=_0x17f6fb[_0x4f4f('0x57')][_0x4f4f('0x2c')]({'plain':!![]});if(!_0xe66fc)throw new Error(_0x4f4f('0x58'));if(_0xe66fc[_0x4f4f('0x59')]==='user'){var _0x585c06=_0x59e207;return db[_0x4f4f('0x5a')][_0x4f4f('0x4f')]({'where':{'name':_0x4f4f('0x2d'),'userProfileId':_0xe66fc[_0x4f4f('0x5b')]},'raw':!![]})['then'](function(_0x1bef77){if(_0x1bef77&&_0x1bef77['autoAssociation']===0x0){return db[_0x4f4f('0x5c')][_0x4f4f('0x51')]({'name':_0x585c06[_0x4f4f('0x31')],'resourceId':_0x585c06['id'],'type':_0x1bef77['name'],'sectionId':_0x1bef77['id']},{})[_0x4f4f('0x2b')](function(){return _0x59e207;});}else{return _0x59e207;}})[_0x4f4f('0x4a')](function(_0x23e9a9){logger['error'](_0x4f4f('0x5d'),_0x23e9a9);throw _0x23e9a9;});}return _0x59e207;})[_0x4f4f('0x2b')](respondWithResult(_0x4dbce2,null))[_0x4f4f('0x4a')](handleError(_0x4dbce2,null));};function Extension(_0x58a5dd,_0x2b01da,_0x16f162,_0x3fedae){this['context']=_0x4f4f('0x5e');this['exten']=_0x58a5dd;this[_0x4f4f('0x5f')]=_0x16f162;this[_0x4f4f('0x37')]=_0x4f4f('0x60');this[_0x4f4f('0x61')]=_0x4f4f('0x62');this[_0x4f4f('0x63')]=_0x2b01da;this[_0x4f4f('0x64')]=_0x3fedae;}function createVoicePrefixExtensions(_0xb2dfda,_0x40dffa,_0x36f369){return new BPromise(function(_0x269e0d,_0x5ba1e2){var _0x4794fe=new Extension(formatPrefixName(_0xb2dfda[_0x4f4f('0x65')]),0x1,_0x4f4f('0x66'),'Voice\x20Prefix');_0x4794fe[_0x4f4f('0x67')]=_0xb2dfda['id'];return db[_0x4f4f('0x55')][_0x4f4f('0x51')](_0x4794fe,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x561411){var _0x28f9e1=_0x561411[_0x4f4f('0x2c')]({'plain':!![]});var _0xc9a47a=_[_0x4f4f('0x33')](addVoicePrefixExtensions(_0xb2dfda,_0x40dffa),function(_0x157af6){_0x157af6['VoiceExtensionId']=_0x28f9e1['id'];_0x157af6[_0x4f4f('0x67')]=_0xb2dfda['id'];return _0x157af6;});return db['VoiceExtension'][_0x4f4f('0x68')](_0xc9a47a,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x2da4ea){if(!_0x2da4ea){return _0x5ba1e2(_0x4f4f('0x69'));}else{return _0x269e0d(_0x2da4ea);}})[_0x4f4f('0x4a')](function(_0x23366b){return _0x5ba1e2(_0x23366b);});});;});};function addVoicePrefixExtensions(_0x4bbbf6,_0x50590c){var _0x15c86f=[];var _0x4c42fd=formatPrefixName(_0x4bbbf6[_0x4f4f('0x65')]);_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x2,_0x4f4f('0x6b'),_0x4f4f('0x6c')+_0x4bbbf6[_0x4f4f('0x31')]));if(_0x4bbbf6[_0x4f4f('0x6d')]){_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,_0x4f4f('0x6b'),_0x4f4f('0x6e')+_0x4bbbf6[_0x4f4f('0x6d')]));}else{_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,'NoOp','No\x20callerid\x20available'));}_0x15c86f['push'](new Extension(_0x4c42fd,0x4,_0x4f4f('0x6f'),_0x50590c[_0x4f4f('0x70')]+','+'${EXTEN:'+(0x8+_0x4bbbf6[_0x4f4f('0x31')][_0x4f4f('0x3f')])+'}'+','+0x1));return _0x15c86f;}function formatPrefixName(_0x43d6c0){var _0x3007ff='_';for(var _0x12523f=0x0;_0x12523f<_0x43d6c0[_0x4f4f('0x3f')];_0x12523f++){if(_0x43d6c0['charAt'](_0x12523f)=='-'){_0x3007ff+=_0x43d6c0[_0x4f4f('0x71')](_0x12523f);}else{_0x3007ff+='['+_0x43d6c0[_0x4f4f('0x71')](_0x12523f)+']';}}_0x3007ff+='.';return _0x3007ff;}exports[_0x4f4f('0x2a')]=function(_0x24ed71,_0x33f4fd,_0x36299e){var _0x1d756b=_0x24ed71[_0x4f4f('0x54')];_0x1d756b['prefix']=_0x4f4f('0x72')+_0x1d756b[_0x4f4f('0x31')]+'-';return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x5f0efc){return db[_0x4f4f('0x34')]['update'](_0x1d756b,{'where':{'id':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x1d756b[_0x4f4f('0x56')]},'raw':!![]})['then'](function(_0x90813f){return createVoicePrefixExtensions(_0x1d756b,_0x90813f,_0x5f0efc);});});});})['then'](function(){return db[_0x4f4f('0x34')]['findById'](_0x1d756b['id']);})[_0x4f4f('0x2b')](respondWithResult(_0x33f4fd,null))[_0x4f4f('0x4a')](handleError(_0x33f4fd,null));};exports[_0x4f4f('0x73')]=function(_0x577fd9,_0x41c31c,_0x4b0ab5){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x577fd9[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x41c31c,null))[_0x4f4f('0x2b')](function(_0x4511c6){if(_0x4511c6){return _0x4511c6[_0x4f4f('0x73')](_0x577fd9[_0x4f4f('0x54')][_0x4f4f('0x74')],_['omit'](_0x577fd9[_0x4f4f('0x54')],[_0x4f4f('0x74'),'id'])||{})[_0x4f4f('0x75')](function(_0x14e4f3){for(var _0x42c638=0x0;_0x42c638<_0x577fd9[_0x4f4f('0x54')]['ids'][_0x4f4f('0x3f')];_0x42c638+=0x1){socket[_0x4f4f('0x76')](_0x4f4f('0x77'),{'UserId':Number(_0x577fd9[_0x4f4f('0x54')]['ids'][_0x42c638]),'VoicePrefixId':Number(_0x577fd9[_0x4f4f('0x4c')]['id'])});}return _0x14e4f3;});}})[_0x4f4f('0x2b')](respondWithResult(_0x41c31c,null))[_0x4f4f('0x4a')](handleError(_0x41c31c,null));};exports['removeAgents']=function(_0x838d05,_0x40bab8,_0x5ae1b6){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x838d05[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x40bab8,null))[_0x4f4f('0x2b')](function(_0x25cd1c){if(_0x25cd1c){return _0x25cd1c['removeAgents'](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])[_0x4f4f('0x2b')](function(){if(_[_0x4f4f('0x78')](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])){for(var _0x5b6633=0x0;_0x5b6633<_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x4f4f('0x3f')];_0x5b6633+=0x1){socket['emit'](_0x4f4f('0x79'),{'UserId':Number(_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x5b6633]),'VoicePrefixId':Number(_0x838d05[_0x4f4f('0x4c')]['id'])});}}else{socket[_0x4f4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x838d05[_0x4f4f('0x3a')]['ids']),'VoicePrefixId':Number(_0x838d05['params']['id'])});}});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x40bab8,null))[_0x4f4f('0x4a')](handleError(_0x40bab8,null));};exports[_0x4f4f('0x7a')]=function(_0x33c295,_0x762acd,_0x362c6d){var _0x1d1f5f={};var _0x19e743={};var _0x167c43;var _0x50058d;return db[_0x4f4f('0x34')]['findOne']({'where':{'id':_0x33c295[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x762acd,null))['then'](function(_0x3286b1){if(_0x3286b1){_0x167c43=_0x3286b1;_0x19e743[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7b')][_0x4f4f('0x35')]);_0x19e743[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x33c295[_0x4f4f('0x3a')]);_0x19e743['filters']=_[_0x4f4f('0x3c')](_0x19e743[_0x4f4f('0x39')],_0x19e743[_0x4f4f('0x3a')]);_0x1d1f5f['attributes']=_[_0x4f4f('0x3c')](_0x19e743['model'],qs['fields'](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x1d1f5f[_0x4f4f('0x3d')]=_0x1d1f5f[_0x4f4f('0x3d')]['length']?_0x1d1f5f[_0x4f4f('0x3d')]:_0x19e743['model'];_0x1d1f5f[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x1d1f5f[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x33c295[_0x4f4f('0x3a')],_0x19e743[_0x4f4f('0x3b')]));if(_0x33c295[_0x4f4f('0x3a')]['filter']){_0x1d1f5f['where']=_[_0x4f4f('0x46')](_0x1d1f5f[_0x4f4f('0x43')],{'$or':_[_0x4f4f('0x33')](_0x1d1f5f[_0x4f4f('0x3d')],function(_0x515d05){var _0x485129={};_0x485129[_0x515d05]={'$like':'%'+_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x45')]+'%'};return _0x485129;})});}_0x1d1f5f=_[_0x4f4f('0x46')]({},_0x1d1f5f,_0x33c295[_0x4f4f('0x48')]);return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})['then'](function(_0x10fa9e){if(_0x10fa9e){_0x50058d=_0x10fa9e[_0x4f4f('0x3f')];if(!_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x1d1f5f['limit']=qs[_0x4f4f('0x25')](_0x33c295['query']['limit']);_0x1d1f5f[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x33c295[_0x4f4f('0x3a')]['offset']);}return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})[_0x4f4f('0x2b')](function(_0x56015c){if(_0x56015c){return _0x56015c?{'count':_0x50058d,'rows':_0x56015c}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x762acd,null))[_0x4f4f('0x4a')](handleError(_0x762acd,null));};exports['getTeams']=function(_0xaa0e50,_0x23e8bd,_0x3b5214){var _0x38ea5d={};var _0x4632c0={};var _0x6ec076;var _0x56f2c5;return db[_0x4f4f('0x34')][_0x4f4f('0x7d')]({'where':{'id':_0xaa0e50[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x23e8bd,null))[_0x4f4f('0x2b')](function(_0x3d0e57){if(_0x3d0e57){_0x6ec076=_0x3d0e57;_0x4632c0[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7e')][_0x4f4f('0x35')]);_0x4632c0[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0xaa0e50[_0x4f4f('0x3a')]);_0x4632c0[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x4632c0['model'],_0x4632c0[_0x4f4f('0x3a')]);_0x38ea5d['attributes']=_[_0x4f4f('0x3c')](_0x4632c0[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0xaa0e50['query'][_0x4f4f('0x3e')]));_0x38ea5d[_0x4f4f('0x3d')]=_0x38ea5d[_0x4f4f('0x3d')][_0x4f4f('0x3f')]?_0x38ea5d[_0x4f4f('0x3d')]:_0x4632c0['model'];_0x38ea5d[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0xaa0e50[_0x4f4f('0x3a')]['sort']);_0x38ea5d[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0xaa0e50['query'],_0x4632c0[_0x4f4f('0x3b')]));if(_0xaa0e50['query'][_0x4f4f('0x45')]){_0x38ea5d['where']=_['merge'](_0x38ea5d['where'],{'$or':_['map'](_0x38ea5d['attributes'],function(_0x446cbd){var _0x2f2cb9={};_0x2f2cb9[_0x446cbd]={'$like':'%'+_0xaa0e50['query']['filter']+'%'};return _0x2f2cb9;})});}_0x38ea5d=_[_0x4f4f('0x46')]({},_0x38ea5d,_0xaa0e50[_0x4f4f('0x48')]);return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})['then'](function(_0x5ad9f6){if(_0x5ad9f6){_0x56f2c5=_0x5ad9f6['length'];if(!_0xaa0e50[_0x4f4f('0x3a')]['hasOwnProperty']('nolimit')){_0x38ea5d[_0x4f4f('0x25')]=qs['limit'](_0xaa0e50[_0x4f4f('0x3a')][_0x4f4f('0x25')]);_0x38ea5d['offset']=qs[_0x4f4f('0x23')](_0xaa0e50[_0x4f4f('0x3a')]['offset']);}return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})[_0x4f4f('0x2b')](function(_0x3be76f){if(_0x3be76f){return _0x3be76f?{'count':_0x56f2c5,'rows':_0x3be76f}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x23e8bd,null))['catch'](handleError(_0x23e8bd,null));};exports[_0x4f4f('0x80')]=function(_0x349e9c,_0x2fc478,_0x3a745a){var _0x53c962=_0x349e9c[_0x4f4f('0x54')][_0x4f4f('0x74')];var _0x27b573;return db[_0x4f4f('0x7e')][_0x4f4f('0x81')]({'where':{'id':_0x53c962},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id',_0x4f4f('0x31'),_0x4f4f('0x83'),_0x4f4f('0x84'),_0x4f4f('0x85')],'raw':!![]}]})[_0x4f4f('0x2b')](function(_0x3f87c8){if(_0x3f87c8){_0x27b573=_0x3f87c8;var _0x22e619=_['flatMap'](_0x3f87c8,function(_0x3bfc19){var _0x150474=_0x3bfc19[_0x4f4f('0x2c')]({'plain':!![]});return _0x150474[_0x4f4f('0x82')];});return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x349e9c['params']['id']}})[_0x4f4f('0x2b')](function(_0x5a4d26){return db[_0x4f4f('0x52')]['transaction'](function(_0x2d1cc1){return _0x5a4d26['addTeams'](_0x53c962,{'transaction':_0x2d1cc1})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x27b573,function(_0x2b6319){return db['TeamVoicePrefix'][_0x4f4f('0x87')]({'TeamId':_0x2b6319['id'],'VoicePrefixId':_0x349e9c[_0x4f4f('0x4c')]['id']},{'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x22e619,function(_0xbe8586){return db['UserVoicePrefix'][_0x4f4f('0x88')]({'where':{'UserId':_0xbe8586['id'],'VoicePrefixId':_0x349e9c['params']['id']},'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){_0x22e619[_0x4f4f('0x89')](function(_0x4bb547){socket['emit']('userVoicePrefix:save',{'UserId':_0x4bb547['id'],'VoicePrefixId':_0x5a4d26['id']});});});});});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2fc478,null))[_0x4f4f('0x4a')](handleError(_0x2fc478,null));};exports[_0x4f4f('0x8a')]=function(_0x4c178d,_0x2cf10a,_0x53a849){return db[_0x4f4f('0x7e')]['findAll']({'where':{'id':_0x4c178d[_0x4f4f('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id'],'raw':!![]}]})[_0x4f4f('0x2b')](handleEntityNotFound(_0x2cf10a,null))[_0x4f4f('0x2b')](function(_0x5063a6){var _0x1ce179=_[_0x4f4f('0x33')](_0x5063a6,'id');var _0x3f2b27=[];var _0x28049b=[];var _0x13418d=squel[_0x4f4f('0x8b')]();_0x13418d[_0x4f4f('0x8c')](_0x4f4f('0x8d'))[_0x4f4f('0x8e')](_0x4f4f('0x8f'),'tq')[_0x4f4f('0x90')]('user_has_teams','ut',_0x4f4f('0x91'))[_0x4f4f('0x43')](_0x4f4f('0x92'),_0x4c178d[_0x4f4f('0x4c')]['id']);for(var _0x223179=0x0;_0x223179<_0x5063a6['length'];_0x223179+=0x1){let _0x373ead=_0x5063a6[_0x223179];for(var _0x53dfb2=0x0;_0x53dfb2<_0x373ead[_0x4f4f('0x82')][_0x4f4f('0x3f')];_0x53dfb2+=0x1){let _0x3fcb64=_0x373ead[_0x4f4f('0x82')][_0x53dfb2];var _0x57405d=_0x13418d[_0x4f4f('0x93')]();_0x57405d['where'](_0x4f4f('0x94'),_0x3fcb64['id']);_0x28049b[_0x4f4f('0x6a')](db[_0x4f4f('0x52')][_0x4f4f('0x3a')](_0x57405d[_0x4f4f('0x95')](),{'type':db[_0x4f4f('0x52')][_0x4f4f('0x96')][_0x4f4f('0x97')]})[_0x4f4f('0x2b')](function(_0x3ce86c){if(_0x3ce86c['length']===0x1){return _0x3fcb64['id'];}else{var _0xe830ee=_['every'](_[_0x4f4f('0x33')](_0x3ce86c,'TeamId'),function(_0x277c96){return _[_0x4f4f('0x98')](_0x1ce179,_0x277c96);});if(_0xe830ee){return _0x3fcb64['id'];}}}));}}return BPromise[_0x4f4f('0x99')](_0x28049b)[_0x4f4f('0x2b')](function(_0x3a0382){_0x3f2b27=_(_0x3f2b27)[_0x4f4f('0x9a')](_0x3a0382)[_0x4f4f('0x9b')]()[_0x4f4f('0x9c')]();return db['VoicePrefix'][_0x4f4f('0x4f')]({'where':{'id':_0x4c178d[_0x4f4f('0x4c')]['id']}})['then'](function(_0x379a2e){return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x35e9e7){return _0x379a2e['removeTeams'](_0x4c178d[_0x4f4f('0x3a')]['ids'],{'transaction':_0x35e9e7})[_0x4f4f('0x2b')](function(){if(!_['isEmpty'](_0x3f2b27)){return _0x379a2e[_0x4f4f('0x9d')](_0x3f2b27,{'transaction':_0x35e9e7});}})['then'](function(){_0x3f2b27['forEach'](function(_0x3f2df9){socket[_0x4f4f('0x76')](_0x4f4f('0x79'),{'UserId':_0x3f2df9,'VoicePrefixId':_0x379a2e['id']});});});});});});})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2cf10a,null))['catch'](handleError(_0x2cf10a,null));}; \ No newline at end of file +var _0xfff0=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','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','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch'];(function(_0x2eae90,_0x3b09f2){var _0x27fce6=function(_0x30c5c7){while(--_0x30c5c7){_0x2eae90['push'](_0x2eae90['shift']());}};_0x27fce6(++_0x3b09f2);}(_0xfff0,0x139));var _0x0fff=function(_0x2dcdba,_0x32dbfd){_0x2dcdba=_0x2dcdba-0x0;var _0x67968c=_0xfff0[_0x2dcdba];return _0x67968c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];config[_0x0fff('0x19')]=_['defaults'](config[_0x0fff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0x1a'))(new Redis(config[_0x0fff('0x19')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x55e5fa,_0x53bde9){_0x53bde9=_0x53bde9||0xcc;return function(_0x1daf30){if(_0x1daf30){return _0x55e5fa['sendStatus'](_0x53bde9);}return _0x55e5fa['status'](_0x53bde9)['end']();};}function respondWithResult(_0x1fb430,_0x41e2e7){_0x41e2e7=_0x41e2e7||0xc8;return function(_0x5eab2e){if(_0x5eab2e){return _0x1fb430[_0x0fff('0x1d')](_0x41e2e7)[_0x0fff('0x1e')](_0x5eab2e);}};}function respondWithFilteredResult(_0x540a67,_0x528071){return function(_0x48f36d){if(_0x48f36d){var _0x2337f=typeof _0x528071[_0x0fff('0x1f')]===_0x0fff('0x20')&&typeof _0x528071[_0x0fff('0x21')]===_0x0fff('0x20');var _0xe89b4a=_0x48f36d['count'];var _0x44a54a=_0x2337f?0x0:_0x528071[_0x0fff('0x1f')];var _0x48e6f9=_0x2337f?_0x48f36d['count']:_0x528071['offset']+_0x528071[_0x0fff('0x21')];var _0x330e29;if(_0x48e6f9>=_0xe89b4a){_0x48e6f9=_0xe89b4a;_0x330e29=0xc8;}else{_0x330e29=0xce;}_0x540a67[_0x0fff('0x1d')](_0x330e29);return _0x540a67[_0x0fff('0x22')]('Content-Range',_0x44a54a+'-'+_0x48e6f9+'/'+_0xe89b4a)[_0x0fff('0x1e')](_0x48f36d);}return null;};}function patchUpdates(_0x2f8665){return function(_0x29d703){try{jsonpatch[_0x0fff('0x23')](_0x29d703,_0x2f8665,!![]);}catch(_0x16e7f4){return BPromise[_0x0fff('0x24')](_0x16e7f4);}return _0x29d703['save']();};}function saveUpdates(_0x6a116c,_0x29f702){return function(_0x37e090){if(_0x37e090){return _0x37e090[_0x0fff('0x25')](_0x6a116c)[_0x0fff('0x26')](function(_0x23d9f8){return _0x23d9f8;});}return null;};}function removeEntity(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(_0x87b3a6){return _0x87b3a6[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){var _0x36d268=_0x87b3a6[_0x0fff('0x28')]({'plain':!![]});var _0x27bd76=_0x0fff('0x29');return db[_0x0fff('0x2a')][_0x0fff('0x27')]({'where':{'type':_0x27bd76,'resourceId':_0x36d268['id']}})[_0x0fff('0x26')](function(){return _0x87b3a6;});})[_0x0fff('0x26')](function(){_0x482e1e['status'](0xcc)[_0x0fff('0x2b')]();});}};}function handleEntityNotFound(_0x2d1800,_0x17ab6f){return function(_0x42441e){if(!_0x42441e){_0x2d1800[_0x0fff('0x2c')](0x194);}return _0x42441e;};}function handleError(_0x125844,_0x47dde0){_0x47dde0=_0x47dde0||0x1f4;return function(_0x31f9a4){logger[_0x0fff('0x2d')](_0x31f9a4[_0x0fff('0x2e')]);if(_0x31f9a4['name']){delete _0x31f9a4[_0x0fff('0x2f')];}_0x125844[_0x0fff('0x1d')](_0x47dde0)['send'](_0x31f9a4);};}exports[_0x0fff('0x30')]=function(_0x433de6,_0x15bb46){var _0x15ae24={},_0x25ab2a={},_0x263e9e={'count':0x0,'rows':[]};var _0x1da352=_[_0x0fff('0x31')](db[_0x0fff('0x32')][_0x0fff('0x33')],function(_0x58469b){return{'name':_0x58469b[_0x0fff('0x34')],'type':_0x58469b[_0x0fff('0x35')][_0x0fff('0x36')]};});_0x25ab2a[_0x0fff('0x37')]=_[_0x0fff('0x31')](_0x1da352,'name');_0x25ab2a['query']=_[_0x0fff('0x38')](_0x433de6[_0x0fff('0x39')]);_0x25ab2a[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x25ab2a['model'],_0x25ab2a[_0x0fff('0x39')]);_0x15ae24[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x25ab2a[_0x0fff('0x37')],qs['fields'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x15ae24[_0x0fff('0x3c')]=_0x15ae24[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x15ae24[_0x0fff('0x3c')]:_0x25ab2a[_0x0fff('0x37')];if(!_0x433de6[_0x0fff('0x39')][_0x0fff('0x3f')](_0x0fff('0x40'))){_0x15ae24[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x433de6['query'][_0x0fff('0x21')]);_0x15ae24[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x433de6[_0x0fff('0x39')][_0x0fff('0x1f')]);}_0x15ae24[_0x0fff('0x41')]=qs['sort'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x42')]);_0x15ae24[_0x0fff('0x43')]=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x433de6[_0x0fff('0x39')],_0x25ab2a[_0x0fff('0x3a')]),_0x1da352);if(_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]){_0x15ae24['where']=_[_0x0fff('0x46')](_0x15ae24['where'],{'$or':_[_0x0fff('0x31')](_0x1da352,function(_0x30f329){if(_0x30f329[_0x0fff('0x35')]!=='VIRTUAL'){var _0x5d4c24={};_0x5d4c24[_0x30f329[_0x0fff('0x2f')]]={'$like':'%'+_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]+'%'};return _0x5d4c24;}})});}_0x15ae24=_['merge']({},_0x15ae24,_0x433de6['options']);var _0x4668b3={'where':_0x15ae24['where']};return db[_0x0fff('0x32')][_0x0fff('0x47')](_0x4668b3)[_0x0fff('0x26')](function(_0x309d75){_0x263e9e[_0x0fff('0x47')]=_0x309d75;if(_0x433de6[_0x0fff('0x39')]['includeAll']){_0x15ae24[_0x0fff('0x48')]=[{'all':!![]}];}return db[_0x0fff('0x32')][_0x0fff('0x49')](_0x15ae24);})[_0x0fff('0x26')](function(_0x7157e5){_0x263e9e[_0x0fff('0x4a')]=_0x7157e5;return _0x263e9e;})[_0x0fff('0x26')](respondWithFilteredResult(_0x15bb46,_0x15ae24))['catch'](handleError(_0x15bb46,null));};exports[_0x0fff('0x4b')]=function(_0x244a27,_0x101b3a){var _0x56a121={'raw':![],'where':{'id':_0x244a27[_0x0fff('0x4c')]['id']}},_0x2de540={};_0x2de540[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x32')][_0x0fff('0x33')]);_0x2de540[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x244a27[_0x0fff('0x39')]);_0x2de540[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x2de540['model'],_0x2de540[_0x0fff('0x39')]);_0x56a121[_0x0fff('0x3c')]=_['intersection'](_0x2de540[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x244a27[_0x0fff('0x39')]['fields']));_0x56a121['attributes']=_0x56a121[_0x0fff('0x3c')]['length']?_0x56a121['attributes']:_0x2de540[_0x0fff('0x37')];if(_0x244a27[_0x0fff('0x39')][_0x0fff('0x4d')]){_0x56a121[_0x0fff('0x48')]=[{'all':!![]}];}_0x56a121=_[_0x0fff('0x46')]({},_0x56a121,_0x244a27[_0x0fff('0x4e')]);return db['VoicePrefix'][_0x0fff('0x4f')](_0x56a121)[_0x0fff('0x26')](handleEntityNotFound(_0x101b3a,null))[_0x0fff('0x26')](respondWithResult(_0x101b3a,null))[_0x0fff('0x50')](handleError(_0x101b3a,null));};exports[_0x0fff('0x27')]=function(_0x2c725c,_0x5d1739){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x2c725c['params']['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5d1739,null))['then'](removeEntity(_0x5d1739,null))['catch'](handleError(_0x5d1739,null));};exports['describe']=function(_0x218e1c,_0x30967c){return db[_0x0fff('0x32')][_0x0fff('0x51')]()[_0x0fff('0x26')](respondWithResult(_0x30967c,null))['catch'](handleError(_0x30967c,null));};exports[_0x0fff('0x52')]=function(_0x2c765f,_0x2cbe43){var _0x3b6c98;return db[_0x0fff('0x53')]['transaction'](function(_0x3b401c){return db[_0x0fff('0x32')][_0x0fff('0x52')](_0x2c765f[_0x0fff('0x54')],{'transaction':_0x3b401c})[_0x0fff('0x26')](function(_0x2e8242){_0x3b6c98=_0x2e8242[_0x0fff('0x28')]({'plain':!![]});return db[_0x0fff('0x55')][_0x0fff('0x4f')]({'where':{'id':_0x3b6c98[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x38168e){return createVoicePrefixExtensions(_0x3b6c98,_0x38168e,_0x3b401c);});});})[_0x0fff('0x26')](function(){var _0x2608be=_0x2c765f[_0x0fff('0x57')][_0x0fff('0x28')]({'plain':!![]});if(!_0x2608be)throw new Error(_0x0fff('0x58'));if(_0x2608be[_0x0fff('0x59')]===_0x0fff('0x57')){var _0x398513=_0x3b6c98;return db[_0x0fff('0x5a')]['find']({'where':{'name':_0x0fff('0x29'),'userProfileId':_0x2608be[_0x0fff('0x5b')]},'raw':!![]})[_0x0fff('0x26')](function(_0x2744b4){if(_0x2744b4&&_0x2744b4['autoAssociation']===0x0){return db[_0x0fff('0x2a')]['create']({'name':_0x398513[_0x0fff('0x2f')],'resourceId':_0x398513['id'],'type':_0x2744b4[_0x0fff('0x2f')],'sectionId':_0x2744b4['id']},{})[_0x0fff('0x26')](function(){return _0x3b6c98;});}else{return _0x3b6c98;}})[_0x0fff('0x50')](function(_0x4bf865){logger[_0x0fff('0x2d')](_0x0fff('0x5c'),_0x4bf865);throw _0x4bf865;});}return _0x3b6c98;})[_0x0fff('0x26')](respondWithResult(_0x2cbe43,null))[_0x0fff('0x50')](handleError(_0x2cbe43,null));};function Extension(_0x4cf619,_0x5ba7e7,_0x449da4,_0x40b8f0){this[_0x0fff('0x5d')]=_0x0fff('0x5e');this[_0x0fff('0x5f')]=_0x4cf619;this[_0x0fff('0x60')]=_0x449da4;this['type']='system';this[_0x0fff('0x61')]=_0x0fff('0x62');this[_0x0fff('0x63')]=_0x5ba7e7;this[_0x0fff('0x64')]=_0x40b8f0;}function createVoicePrefixExtensions(_0x28403f,_0x6a37c9,_0x33eb07){return new BPromise(function(_0x40e5ec,_0x5f2fcc){var _0x12fe95=new Extension(formatPrefixName(_0x28403f['prefix']),0x1,_0x0fff('0x65'),_0x0fff('0x66'));_0x12fe95[_0x0fff('0x67')]=_0x28403f['id'];return db['VoiceExtension']['create'](_0x12fe95,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x504212){var _0x140a35=_0x504212[_0x0fff('0x28')]({'plain':!![]});var _0x452160=_[_0x0fff('0x31')](addVoicePrefixExtensions(_0x28403f,_0x6a37c9),function(_0x4e3a31){_0x4e3a31[_0x0fff('0x56')]=_0x140a35['id'];_0x4e3a31[_0x0fff('0x67')]=_0x28403f['id'];return _0x4e3a31;});return db['VoiceExtension'][_0x0fff('0x68')](_0x452160,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x1111c8){if(!_0x1111c8){return _0x5f2fcc('Extensions\x20creation\x20failed');}else{return _0x40e5ec(_0x1111c8);}})[_0x0fff('0x50')](function(_0x1dc3d6){return _0x5f2fcc(_0x1dc3d6);});});;});};function addVoicePrefixExtensions(_0x1414af,_0x383d78){var _0x3bb183=[];var _0xf4fb1e=formatPrefixName(_0x1414af[_0x0fff('0x69')]);_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x2,_0x0fff('0x6b'),_0x0fff('0x6c')+_0x1414af[_0x0fff('0x2f')]));if(_0x1414af[_0x0fff('0x6d')]){_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,'Set',_0x0fff('0x6e')+_0x1414af['callerIdAll']));}else{_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,_0x0fff('0x65'),_0x0fff('0x6f')));}_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x4,'goto',_0x383d78['context']+','+_0x0fff('0x70')+(0x8+_0x1414af[_0x0fff('0x2f')][_0x0fff('0x3e')])+'}'+','+0x1));return _0x3bb183;}function formatPrefixName(_0x2586c6){var _0x5af278='_';for(var _0x2f865a=0x0;_0x2f865a<_0x2586c6[_0x0fff('0x3e')];_0x2f865a++){if(_0x2586c6[_0x0fff('0x71')](_0x2f865a)=='-'){_0x5af278+=_0x2586c6[_0x0fff('0x71')](_0x2f865a);}else{_0x5af278+='['+_0x2586c6['charAt'](_0x2f865a)+']';}}_0x5af278+='.';return _0x5af278;}exports[_0x0fff('0x25')]=function(_0x1858fb,_0x4c08c3,_0x51fbf5){var _0x33ed23=_0x1858fb[_0x0fff('0x54')];_0x33ed23[_0x0fff('0x69')]=_0x0fff('0x72')+_0x33ed23[_0x0fff('0x2f')]+'-';return db['sequelize'][_0x0fff('0x73')](function(_0x7b040){return db[_0x0fff('0x32')][_0x0fff('0x25')](_0x33ed23,{'where':{'id':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension'][_0x0fff('0x4f')]({'where':{'id':_0x33ed23[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x712db4){return createVoicePrefixExtensions(_0x33ed23,_0x712db4,_0x7b040);});});});})[_0x0fff('0x26')](function(){return db['VoicePrefix'][_0x0fff('0x74')](_0x33ed23['id']);})[_0x0fff('0x26')](respondWithResult(_0x4c08c3,null))[_0x0fff('0x50')](handleError(_0x4c08c3,null));};exports[_0x0fff('0x75')]=function(_0x31ff4e,_0x15ab8e,_0x38e2e9){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x31ff4e[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x15ab8e,null))['then'](function(_0x134012){if(_0x134012){return _0x134012[_0x0fff('0x75')](_0x31ff4e['body'][_0x0fff('0x76')],_['omit'](_0x31ff4e[_0x0fff('0x54')],[_0x0fff('0x76'),'id'])||{})[_0x0fff('0x77')](function(_0x8799c2){for(var _0x13d90e=0x0;_0x13d90e<_0x31ff4e['body'][_0x0fff('0x76')][_0x0fff('0x3e')];_0x13d90e+=0x1){socket['emit'](_0x0fff('0x78'),{'UserId':Number(_0x31ff4e[_0x0fff('0x54')][_0x0fff('0x76')][_0x13d90e]),'VoicePrefixId':Number(_0x31ff4e['params']['id'])});}return _0x8799c2;});}})[_0x0fff('0x26')](respondWithResult(_0x15ab8e,null))[_0x0fff('0x50')](handleError(_0x15ab8e,null));};exports['removeAgents']=function(_0x567544,_0x404b97,_0x49711a){return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x567544[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x404b97,null))['then'](function(_0x4f7282){if(_0x4f7282){return _0x4f7282[_0x0fff('0x79')](_0x567544['query'][_0x0fff('0x76')])[_0x0fff('0x26')](function(){if(_[_0x0fff('0x7a')](_0x567544[_0x0fff('0x39')][_0x0fff('0x76')])){for(var _0x1e940c=0x0;_0x1e940c<_0x567544[_0x0fff('0x39')]['ids'][_0x0fff('0x3e')];_0x1e940c+=0x1){socket[_0x0fff('0x7b')](_0x0fff('0x7c'),{'UserId':Number(_0x567544[_0x0fff('0x39')][_0x0fff('0x76')][_0x1e940c]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}}else{socket['emit'](_0x0fff('0x7c'),{'UserId':Number(_0x567544['query'][_0x0fff('0x76')]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}});}})[_0x0fff('0x26')](respondWithStatusCode(_0x404b97,null))[_0x0fff('0x50')](handleError(_0x404b97,null));};exports['getAgents']=function(_0x4fc7c7,_0x34dd99,_0x5baf7f){var _0x3d820e={};var _0x125b12={};var _0x5093fc;var _0x5b04f2;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x4fc7c7[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x34dd99,null))['then'](function(_0x407f0a){if(_0x407f0a){_0x5093fc=_0x407f0a;_0x125b12['model']=_[_0x0fff('0x38')](db[_0x0fff('0x7e')][_0x0fff('0x33')]);_0x125b12['query']=_['keys'](_0x4fc7c7['query']);_0x125b12[_0x0fff('0x3a')]=_['intersection'](_0x125b12[_0x0fff('0x37')],_0x125b12[_0x0fff('0x39')]);_0x3d820e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x125b12[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x3d820e[_0x0fff('0x3c')]=_0x3d820e[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x3d820e['attributes']:_0x125b12[_0x0fff('0x37')];_0x3d820e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x42')]);_0x3d820e['where']=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x4fc7c7['query'],_0x125b12[_0x0fff('0x3a')]));if(_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x45')]){_0x3d820e[_0x0fff('0x43')]=_[_0x0fff('0x46')](_0x3d820e[_0x0fff('0x43')],{'$or':_[_0x0fff('0x31')](_0x3d820e[_0x0fff('0x3c')],function(_0x40c4f3){var _0x1c059b={};_0x1c059b[_0x40c4f3]={'$like':'%'+_0x4fc7c7['query'][_0x0fff('0x45')]+'%'};return _0x1c059b;})});}_0x3d820e=_[_0x0fff('0x46')]({},_0x3d820e,_0x4fc7c7[_0x0fff('0x4e')]);return _0x5093fc[_0x0fff('0x7f')](_0x3d820e);}})[_0x0fff('0x26')](function(_0x2fdf96){if(_0x2fdf96){_0x5b04f2=_0x2fdf96[_0x0fff('0x3e')];if(!_0x4fc7c7['query'][_0x0fff('0x3f')]('nolimit')){_0x3d820e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x21')]);_0x3d820e[_0x0fff('0x1f')]=qs['offset'](_0x4fc7c7[_0x0fff('0x39')]['offset']);}return _0x5093fc['getAgents'](_0x3d820e);}})[_0x0fff('0x26')](function(_0x173b44){if(_0x173b44){return _0x173b44?{'count':_0x5b04f2,'rows':_0x173b44}:null;}})[_0x0fff('0x26')](respondWithResult(_0x34dd99,null))[_0x0fff('0x50')](handleError(_0x34dd99,null));};exports[_0x0fff('0x80')]=function(_0x3995b9,_0x5bc4e1,_0x50f95c){var _0x5b637e={};var _0x1bd02a={};var _0x41b755;var _0x4012aa;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x3995b9[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5bc4e1,null))[_0x0fff('0x26')](function(_0xed7e93){if(_0xed7e93){_0x41b755=_0xed7e93;_0x1bd02a[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x81')][_0x0fff('0x33')]);_0x1bd02a[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x3995b9[_0x0fff('0x39')]);_0x1bd02a[_0x0fff('0x3a')]=_['intersection'](_0x1bd02a[_0x0fff('0x37')],_0x1bd02a[_0x0fff('0x39')]);_0x5b637e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x1bd02a[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x3995b9[_0x0fff('0x39')]['fields']));_0x5b637e[_0x0fff('0x3c')]=_0x5b637e[_0x0fff('0x3c')]['length']?_0x5b637e[_0x0fff('0x3c')]:_0x1bd02a['model'];_0x5b637e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x3995b9['query']['sort']);_0x5b637e['where']=qs[_0x0fff('0x3a')](_['pick'](_0x3995b9['query'],_0x1bd02a['filters']));if(_0x3995b9['query'][_0x0fff('0x45')]){_0x5b637e['where']=_[_0x0fff('0x46')](_0x5b637e['where'],{'$or':_[_0x0fff('0x31')](_0x5b637e['attributes'],function(_0x465dde){var _0x9ca531={};_0x9ca531[_0x465dde]={'$like':'%'+_0x3995b9['query']['filter']+'%'};return _0x9ca531;})});}_0x5b637e=_[_0x0fff('0x46')]({},_0x5b637e,_0x3995b9[_0x0fff('0x4e')]);return _0x41b755[_0x0fff('0x80')](_0x5b637e);}})[_0x0fff('0x26')](function(_0x675250){if(_0x675250){_0x4012aa=_0x675250[_0x0fff('0x3e')];if(!_0x3995b9[_0x0fff('0x39')]['hasOwnProperty'](_0x0fff('0x40'))){_0x5b637e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x3995b9[_0x0fff('0x39')]['limit']);_0x5b637e[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x3995b9[_0x0fff('0x39')]['offset']);}return _0x41b755['getTeams'](_0x5b637e);}})[_0x0fff('0x26')](function(_0x37b5b4){if(_0x37b5b4){return _0x37b5b4?{'count':_0x4012aa,'rows':_0x37b5b4}:null;}})['then'](respondWithResult(_0x5bc4e1,null))[_0x0fff('0x50')](handleError(_0x5bc4e1,null));};exports[_0x0fff('0x82')]=function(_0x4ab665,_0x2ab827,_0x2a2af9){var _0x2ca40b=_0x4ab665['body']['ids'];var _0x2eeee9;return db[_0x0fff('0x81')]['findAll']({'where':{'id':_0x2ca40b},'attributes':['id'],'include':[{'model':db[_0x0fff('0x7e')],'as':_0x0fff('0x83'),'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x84'),_0x0fff('0x85'),_0x0fff('0x86')],'raw':!![]}]})[_0x0fff('0x26')](function(_0x1b500a){if(_0x1b500a){_0x2eeee9=_0x1b500a;var _0x327b5=_[_0x0fff('0x87')](_0x1b500a,function(_0x10aa61){var _0xc99224=_0x10aa61['get']({'plain':!![]});return _0xc99224[_0x0fff('0x83')];});return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x4ab665['params']['id']}})[_0x0fff('0x26')](function(_0x5336){return db[_0x0fff('0x53')][_0x0fff('0x73')](function(_0x42fbff){return _0x5336[_0x0fff('0x82')](_0x2ca40b,{'transaction':_0x42fbff})['then'](function(){return BPromise[_0x0fff('0x88')](_0x2eeee9,function(_0x39565f){return db['TeamVoicePrefix'][_0x0fff('0x89')]({'TeamId':_0x39565f['id'],'VoicePrefixId':_0x4ab665['params']['id']},{'transaction':_0x42fbff});});})['then'](function(){return BPromise[_0x0fff('0x88')](_0x327b5,function(_0x2e38c3){return db[_0x0fff('0x8a')][_0x0fff('0x8b')]({'where':{'UserId':_0x2e38c3['id'],'VoicePrefixId':_0x4ab665[_0x0fff('0x4c')]['id']},'transaction':_0x42fbff});});})[_0x0fff('0x26')](function(){_0x327b5['forEach'](function(_0xe02ca6){socket[_0x0fff('0x7b')](_0x0fff('0x78'),{'UserId':_0xe02ca6['id'],'VoicePrefixId':_0x5336['id']});});});});});}})[_0x0fff('0x26')](respondWithStatusCode(_0x2ab827,null))[_0x0fff('0x50')](handleError(_0x2ab827,null));};exports['removeTeams']=function(_0x25e9f2,_0xf73eb6,_0x87df03){return db[_0x0fff('0x81')][_0x0fff('0x49')]({'where':{'id':_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fff('0x26')](handleEntityNotFound(_0xf73eb6,null))['then'](function(_0x2d206c){var _0x5ed120=_['map'](_0x2d206c,'id');var _0x592341=[];var _0x2e1625=[];var _0x128fe1=squel[_0x0fff('0x8c')]();_0x128fe1[_0x0fff('0x8d')](_0x0fff('0x8e'))['from'](_0x0fff('0x8f'),'tq')[_0x0fff('0x90')](_0x0fff('0x91'),'ut',_0x0fff('0x92'))[_0x0fff('0x43')](_0x0fff('0x93'),_0x25e9f2[_0x0fff('0x4c')]['id']);for(var _0x115445=0x0;_0x115445<_0x2d206c['length'];_0x115445+=0x1){let _0x596074=_0x2d206c[_0x115445];for(var _0x1f1946=0x0;_0x1f1946<_0x596074[_0x0fff('0x83')][_0x0fff('0x3e')];_0x1f1946+=0x1){let _0x47ff09=_0x596074[_0x0fff('0x83')][_0x1f1946];var _0x2ae986=_0x128fe1[_0x0fff('0x94')]();_0x2ae986['where'](_0x0fff('0x95'),_0x47ff09['id']);_0x2e1625[_0x0fff('0x6a')](db[_0x0fff('0x53')][_0x0fff('0x39')](_0x2ae986[_0x0fff('0x96')](),{'type':db[_0x0fff('0x53')][_0x0fff('0x97')]['SELECT']})['then'](function(_0x4a70ee){if(_0x4a70ee[_0x0fff('0x3e')]===0x1){return _0x47ff09['id'];}else{var _0x425412=_[_0x0fff('0x98')](_[_0x0fff('0x31')](_0x4a70ee,_0x0fff('0x99')),function(_0x41afce){return _['includes'](_0x5ed120,_0x41afce);});if(_0x425412){return _0x47ff09['id'];}}}));}}return BPromise[_0x0fff('0x9a')](_0x2e1625)[_0x0fff('0x26')](function(_0x7928f7){_0x592341=_(_0x592341)['union'](_0x7928f7)['compact']()[_0x0fff('0x9b')]();return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x25e9f2[_0x0fff('0x4c')]['id']}})['then'](function(_0x1bf39f){return db[_0x0fff('0x53')]['transaction'](function(_0xb6faf){return _0x1bf39f[_0x0fff('0x9c')](_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')],{'transaction':_0xb6faf})[_0x0fff('0x26')](function(){if(!_[_0x0fff('0x9d')](_0x592341)){return _0x1bf39f['removeAgents'](_0x592341,{'transaction':_0xb6faf});}})[_0x0fff('0x26')](function(){_0x592341['forEach'](function(_0xf72b2b){socket['emit'](_0x0fff('0x7c'),{'UserId':_0xf72b2b,'VoicePrefixId':_0x1bf39f['id']});});});});});});})['then'](respondWithStatusCode(_0xf73eb6,null))[_0x0fff('0x50')](handleError(_0xf73eb6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3b0e3c1..626c4af 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 _0x876f=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x644ecd,_0x397f36){var _0x1c66ce=function(_0x4cf42b){while(--_0x4cf42b){_0x644ecd['push'](_0x644ecd['shift']());}};_0x1c66ce(++_0x397f36);}(_0x876f,0x190));var _0xf876=function(_0x2c4547,_0x5ce883){_0x2c4547=_0x2c4547-0x0;var _0x34c666=_0x876f[_0x2c4547];return _0x34c666;};'use strict';var EventEmitter=require(_0xf876('0x0'));var VoicePrefix=require(_0xf876('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf876('0x2'),'afterDestroy':_0xf876('0x3')};function emitEvent(_0x29b49f){return function(_0x1ee654,_0x561a1c,_0x4e841e){VoicePrefixEvents[_0xf876('0x4')](_0x29b49f+':'+_0x1ee654['id'],_0x1ee654);VoicePrefixEvents[_0xf876('0x4')](_0x29b49f,_0x1ee654);_0x4e841e(null);};}for(var e in events){if(events[_0xf876('0x5')](e)){var event=events[e];VoicePrefix[_0xf876('0x6')](e,emitEvent(event));}}module[_0xf876('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x5aed=['save','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x397776,_0x247746){var _0x3b45d3=function(_0x2920fd){while(--_0x2920fd){_0x397776['push'](_0x397776['shift']());}};_0x3b45d3(++_0x247746);}(_0x5aed,0x7b));var _0xd5ae=function(_0x4e17d2,_0x1626e6){_0x4e17d2=_0x4e17d2-0x0;var _0x35724d=_0x5aed[_0x4e17d2];return _0x35724d;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xd5ae('0x0'))['db'][_0xd5ae('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd5ae('0x2')](0x0);var events={'afterCreate':_0xd5ae('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4faee6){return function(_0x14457b,_0x44b601,_0x1e275d){VoicePrefixEvents[_0xd5ae('0x4')](_0x4faee6+':'+_0x14457b['id'],_0x14457b);VoicePrefixEvents[_0xd5ae('0x4')](_0x4faee6,_0x14457b);_0x1e275d(null);};}for(var e in events){if(events[_0xd5ae('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xd5ae('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 532670c..4a9d6ac 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 _0x9914=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes','lodash','util'];(function(_0x332dd6,_0x134b68){var _0x5a6449=function(_0x12576f){while(--_0x12576f){_0x332dd6['push'](_0x332dd6['shift']());}};_0x5a6449(++_0x134b68);}(_0x9914,0x111));var _0x4991=function(_0x401232,_0x53f836){_0x401232=_0x401232-0x0;var _0x29e2f1=_0x9914[_0x401232];return _0x29e2f1;};'use strict';var _=require(_0x4991('0x0'));var util=require(_0x4991('0x1'));var logger=require(_0x4991('0x2'))(_0x4991('0x3'));var moment=require(_0x4991('0x4'));var BPromise=require('bluebird');var rp=require(_0x4991('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4991('0x6'));var config=require(_0x4991('0x7'));var attributes=require(_0x4991('0x8'));module[_0x4991('0x9')]=function(_0x36f7b1,_0x497a31){return _0x36f7b1['define']('VoicePrefix',attributes,{'tableName':_0x4991('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84c3=['moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','../../config/logger','api'];(function(_0x5187d3,_0x26314a){var _0x17ebe8=function(_0x472234){while(--_0x472234){_0x5187d3['push'](_0x5187d3['shift']());}};_0x17ebe8(++_0x26314a);}(_0x84c3,0x1dd));var _0x384c=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x84c3[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x384c('0x0'));var util=require('util');var logger=require(_0x384c('0x1'))(_0x384c('0x2'));var moment=require(_0x384c('0x3'));var BPromise=require(_0x384c('0x4'));var rp=require(_0x384c('0x5'));var fs=require('fs');var path=require(_0x384c('0x6'));var rimraf=require(_0x384c('0x7'));var config=require('../../config/environment');var attributes=require(_0x384c('0x8'));module[_0x384c('0x9')]=function(_0x2c69fd,_0x1d81d3){return _0x2c69fd['define'](_0x384c('0xa'),attributes,{'tableName':_0x384c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 5323e35..fe756f2 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 _0x9d56=['client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x9d56,0x122));var _0x69d5=function(_0x1c9569,_0x2ab123){_0x1c9569=_0x1c9569-0x0;var _0x4dab42=_0x9d56[_0x1c9569];return _0x4dab42;};'use strict';var _=require(_0x69d5('0x0'));var util=require(_0x69d5('0x1'));var moment=require(_0x69d5('0x2'));var BPromise=require(_0x69d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69d5('0x4'));var db=require(_0x69d5('0x5'))['db'];var utils=require(_0x69d5('0x6'));var logger=require(_0x69d5('0x7'))(_0x69d5('0x8'));var config=require('../../config/environment');var jayson=require(_0x69d5('0x9'));var client=jayson[_0x69d5('0xa')][_0x69d5('0xb')]({'port':0x232a});config[_0x69d5('0xc')]=_[_0x69d5('0xd')](config[_0x69d5('0xc')],{'host':_0x69d5('0xe'),'port':0x18eb});var socket=require(_0x69d5('0xf'))(new Redis(config[_0x69d5('0xc')]));require(_0x69d5('0x10'))[_0x69d5('0x11')](socket);function respondWithRpcPromise(_0x3ab86b,_0x5fd33e,_0x3f7383){return new BPromise(function(_0x26783d,_0x1174c0){return client[_0x69d5('0x12')](_0x3ab86b,_0x3f7383)[_0x69d5('0x13')](function(_0x301c5e){logger['info'](_0x69d5('0x14'),_0x5fd33e,_0x69d5('0x15'));logger[_0x69d5('0x16')](_0x69d5('0x17'),_0x5fd33e,_0x69d5('0x15'),JSON['stringify'](_0x301c5e));if(_0x301c5e[_0x69d5('0x18')]){if(_0x301c5e[_0x69d5('0x18')][_0x69d5('0x19')]===0x1f4){logger[_0x69d5('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x5fd33e,_0x301c5e['error']['message']);return _0x1174c0(_0x301c5e[_0x69d5('0x18')][_0x69d5('0x1a')]);}logger[_0x69d5('0x18')](_0x69d5('0x14'),_0x5fd33e,_0x301c5e[_0x69d5('0x18')]['message']);return _0x26783d(_0x301c5e[_0x69d5('0x18')][_0x69d5('0x1a')]);}else{logger[_0x69d5('0x1b')](_0x69d5('0x14'),_0x5fd33e,_0x69d5('0x15'));_0x26783d(_0x301c5e[_0x69d5('0x1c')][_0x69d5('0x1a')]);}})[_0x69d5('0x1d')](function(_0x54c2a3){logger[_0x69d5('0x18')](_0x69d5('0x14'),_0x5fd33e,_0x54c2a3);_0x1174c0(_0x54c2a3);});});} \ No newline at end of file +var _0xaaee=['redis','defaults','localhost','./voicePrefix.socket','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa20764,_0x2a9180){var _0x2db9e6=function(_0x5b30e1){while(--_0x5b30e1){_0xa20764['push'](_0xa20764['shift']());}};_0x2db9e6(++_0x2a9180);}(_0xaaee,0x132));var _0xeaae=function(_0xd1fb6,_0x34f64c){_0xd1fb6=_0xd1fb6-0x0;var _0x4eebc0=_0xaaee[_0xd1fb6];return _0x4eebc0;};'use strict';var _=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var moment=require(_0xeaae('0x2'));var BPromise=require(_0xeaae('0x3'));var rs=require(_0xeaae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaae('0x5'))['db'];var utils=require(_0xeaae('0x6'));var logger=require(_0xeaae('0x7'))(_0xeaae('0x8'));var config=require(_0xeaae('0x9'));var jayson=require(_0xeaae('0xa'));var client=jayson[_0xeaae('0xb')][_0xeaae('0xc')]({'port':0x232a});config[_0xeaae('0xd')]=_[_0xeaae('0xe')](config[_0xeaae('0xd')],{'host':_0xeaae('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaae('0xd')]));require(_0xeaae('0x10'))['register'](socket);function respondWithRpcPromise(_0x149943,_0x295a9a,_0xc3570c){return new BPromise(function(_0x435340,_0x484be3){return client['request'](_0x149943,_0xc3570c)[_0xeaae('0x11')](function(_0x465002){logger['info'](_0xeaae('0x12'),_0x295a9a,_0xeaae('0x13'));logger[_0xeaae('0x14')](_0xeaae('0x15'),_0x295a9a,'request\x20sent',JSON[_0xeaae('0x16')](_0x465002));if(_0x465002['error']){if(_0x465002[_0xeaae('0x17')][_0xeaae('0x18')]===0x1f4){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x484be3(_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);}logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x435340(_0x465002[_0xeaae('0x17')]['message']);}else{logger[_0xeaae('0x1a')]('VoicePrefix,\x20%s,\x20%s',_0x295a9a,_0xeaae('0x13'));_0x435340(_0x465002[_0xeaae('0x1b')][_0xeaae('0x19')]);}})[_0xeaae('0x1c')](function(_0x5ec06e){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x5ec06e);_0x484be3(_0x5ec06e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index bfbdcc2..35b00f2 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 _0x4e65=['update','removeListener','register','voicePrefix:','save','remove'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x4e65,0xc4));var _0x54e6=function(_0x56a1f2,_0x1d3f0e){_0x56a1f2=_0x56a1f2-0x0;var _0x171706=_0x4e65[_0x56a1f2];return _0x171706;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x54e6('0x0'),_0x54e6('0x1'),_0x54e6('0x2')];function createListener(_0x2fd593,_0x336ebf){return function(_0x4f3288){_0x336ebf['emit'](_0x2fd593,_0x4f3288);};}function removeListener(_0x1bf294,_0x337956){return function(){VoicePrefixEvents[_0x54e6('0x3')](_0x1bf294,_0x337956);};}exports[_0x54e6('0x4')]=function(_0x23b09a){for(var _0x5d1ffc=0x0,_0x3c9f97=events['length'];_0x5d1ffc<_0x3c9f97;_0x5d1ffc++){var _0x256560=events[_0x5d1ffc];var _0x1a2191=createListener(_0x54e6('0x5')+_0x256560,_0x23b09a);VoicePrefixEvents['on'](_0x256560,_0x1a2191);}}; \ No newline at end of file +var _0x902b=['register','./voicePrefix.events','remove','update','emit'];(function(_0x4dae94,_0x577429){var _0x10504f=function(_0x206a65){while(--_0x206a65){_0x4dae94['push'](_0x4dae94['shift']());}};_0x10504f(++_0x577429);}(_0x902b,0x6a));var _0xb902=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x902b[_0x2aec52];return _0x3b8835;};'use strict';var VoicePrefixEvents=require(_0xb902('0x0'));var events=['save',_0xb902('0x1'),_0xb902('0x2')];function createListener(_0x26d7c7,_0x20a412){return function(_0xa2acb9){_0x20a412[_0xb902('0x3')](_0x26d7c7,_0xa2acb9);};}function removeListener(_0x492bd4,_0x1af7b5){return function(){VoicePrefixEvents['removeListener'](_0x492bd4,_0x1af7b5);};}exports[_0xb902('0x4')]=function(_0x5d38bb){for(var _0x157e14=0x0,_0x5e7240=events['length'];_0x157e14<_0x5e7240;_0x157e14++){var _0x5b0b74=events[_0x157e14];var _0x55331d=createListener('voicePrefix:'+_0x5b0b74,_0x5d38bb);VoicePrefixEvents['on'](_0x5b0b74,_0x55331d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 8e9f0d9..280567a 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 _0x843f=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','clone','addTeams','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeLists','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x843f,0x1b8));var _0xf843=function(_0x2d895a,_0x2781e9){_0x2d895a=_0x2d895a-0x0;var _0x405d04=_0x843f[_0x2d895a];return _0x405d04;};'use strict';var multer=require('multer');var util=require(_0xf843('0x0'));var path=require(_0xf843('0x1'));var timeout=require(_0xf843('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf843('0x3'));var auth=require(_0xf843('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf843('0x5'));var controller=require(_0xf843('0x6'));router[_0xf843('0x7')]('/',auth[_0xf843('0x8')](),controller[_0xf843('0x9')]);router['get'](_0xf843('0xa'),auth[_0xf843('0x8')](),controller[_0xf843('0xb')]);router[_0xf843('0x7')](_0xf843('0xc'),auth[_0xf843('0x8')](),controller[_0xf843('0xd')]);router[_0xf843('0x7')](_0xf843('0xe'),auth[_0xf843('0x8')](),controller[_0xf843('0xf')]);router[_0xf843('0x7')]('/:id/hopper_finals',auth[_0xf843('0x8')](),controller[_0xf843('0x10')]);router[_0xf843('0x7')](_0xf843('0x11'),auth[_0xf843('0x8')](),controller[_0xf843('0x12')]);router[_0xf843('0x7')](_0xf843('0x13'),auth['isAuthenticated'](),controller[_0xf843('0x14')]);router[_0xf843('0x7')]('/:id/users',auth[_0xf843('0x8')](),controller[_0xf843('0x15')]);router[_0xf843('0x7')](_0xf843('0x16'),auth[_0xf843('0x8')](),controller[_0xf843('0x17')]);router[_0xf843('0x7')](_0xf843('0x18'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0xf843('0x19'),auth[_0xf843('0x8')](),controller[_0xf843('0x1a')]);router[_0xf843('0x1b')]('/',auth[_0xf843('0x8')](),controller['create']);router[_0xf843('0x1b')]('/:id/clone',auth[_0xf843('0x8')](),controller[_0xf843('0x1c')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xf843('0x1d')]);router['post']('/:id/users',auth[_0xf843('0x8')](),controller[_0xf843('0x1e')]);router[_0xf843('0x1b')](_0xf843('0x18'),auth['isAuthenticated'](),controller[_0xf843('0x1f')]);router[_0xf843('0x1b')](_0xf843('0x19'),auth[_0xf843('0x8')](),controller[_0xf843('0x20')]);router[_0xf843('0x21')]('/:id',auth['isAuthenticated'](),controller[_0xf843('0x22')]);router['delete']('/:id',auth[_0xf843('0x8')](),controller[_0xf843('0x23')]);router[_0xf843('0x24')](_0xf843('0x13'),auth[_0xf843('0x8')](),controller[_0xf843('0x25')]);router[_0xf843('0x24')]('/:id/users',auth[_0xf843('0x8')](),controller[_0xf843('0x26')]);router[_0xf843('0x24')](_0xf843('0x18'),auth[_0xf843('0x8')](),controller[_0xf843('0x27')]);router[_0xf843('0x24')](_0xf843('0x19'),auth[_0xf843('0x8')](),controller['removeBlackLists']);module[_0xf843('0x28')]=router; \ No newline at end of file +var _0x23e5=['/:id/lists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','/:id/blacklists','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers'];(function(_0x252140,_0x2bf6cb){var _0x3889b0=function(_0x4ae3c5){while(--_0x4ae3c5){_0x252140['push'](_0x252140['shift']());}};_0x3889b0(++_0x2bf6cb);}(_0x23e5,0x1d6));var _0x523e=function(_0x877ea5,_0x4f9928){_0x877ea5=_0x877ea5-0x0;var _0x772191=_0x23e5[_0x877ea5];return _0x772191;};'use strict';var multer=require(_0x523e('0x0'));var util=require(_0x523e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x523e('0x2'));var router=express[_0x523e('0x3')]();var fs_extra=require(_0x523e('0x4'));var auth=require(_0x523e('0x5'));var interaction=require(_0x523e('0x6'));var config=require('../../config/environment');var controller=require(_0x523e('0x7'));router[_0x523e('0x8')]('/',auth[_0x523e('0x9')](),controller[_0x523e('0xa')]);router['get']('/:id',auth[_0x523e('0x9')](),controller[_0x523e('0xb')]);router['get']('/:id/hoppers',auth[_0x523e('0x9')](),controller[_0x523e('0xc')]);router[_0x523e('0x8')](_0x523e('0xd'),auth[_0x523e('0x9')](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth[_0x523e('0x9')](),controller[_0x523e('0xe')]);router[_0x523e('0x8')](_0x523e('0xf'),auth[_0x523e('0x9')](),controller[_0x523e('0x10')]);router[_0x523e('0x8')](_0x523e('0x11'),auth[_0x523e('0x9')](),controller[_0x523e('0x12')]);router[_0x523e('0x8')](_0x523e('0x13'),auth[_0x523e('0x9')](),controller['getAgents']);router[_0x523e('0x8')](_0x523e('0x14'),auth[_0x523e('0x9')](),controller[_0x523e('0x15')]);router['get'](_0x523e('0x16'),auth[_0x523e('0x9')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x523e('0x9')](),controller[_0x523e('0x17')]);router[_0x523e('0x18')]('/',auth['isAuthenticated'](),controller[_0x523e('0x19')]);router[_0x523e('0x18')](_0x523e('0x1a'),auth[_0x523e('0x9')](),controller[_0x523e('0x1b')]);router[_0x523e('0x18')](_0x523e('0x11'),auth['isAuthenticated'](),controller[_0x523e('0x1c')]);router[_0x523e('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x523e('0x1d')]);router[_0x523e('0x18')](_0x523e('0x16'),auth[_0x523e('0x9')](),controller[_0x523e('0x1e')]);router['post'](_0x523e('0x1f'),auth[_0x523e('0x9')](),controller['addBlackLists']);router['put'](_0x523e('0x20'),auth[_0x523e('0x9')](),controller[_0x523e('0x21')]);router[_0x523e('0x22')](_0x523e('0x20'),auth[_0x523e('0x9')](),controller[_0x523e('0x23')]);router[_0x523e('0x22')]('/:id/teams',auth[_0x523e('0x9')](),controller[_0x523e('0x24')]);router[_0x523e('0x22')]('/:id/users',auth[_0x523e('0x9')](),controller[_0x523e('0x25')]);router[_0x523e('0x22')](_0x523e('0x16'),auth['isAuthenticated'](),controller[_0x523e('0x26')]);router[_0x523e('0x22')](_0x523e('0x1f'),auth[_0x523e('0x9')](),controller[_0x523e('0x27')]);module[_0x523e('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 63fbb7c..fe7b70f 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 _0x25f0=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','inbound','default','ENUM','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','STRING','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x25f0,0x10c));var _0x025f=function(_0xd05b16,_0x18a897){_0xd05b16=_0xd05b16-0x0;var _0xf130f1=_0x25f0[_0xd05b16];return _0xf130f1;};'use strict';var Sequelize=require(_0x025f('0x0'));module[_0x025f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x025f('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x025f('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x025f('0x3')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x025f('0x4')]('rr','ringall',_0x025f('0x5'),'fewestcalls','random',_0x025f('0x6'),_0x025f('0x7'),_0x025f('0x8'),_0x025f('0x9')),'allowNull':![],'defaultValue':'ringall','set':function(_0x381185){this[_0x025f('0xa')](_0x025f('0xb'),_0x381185?_0x381185:'rrmemory');},'get':function(){var _0x4bceae=this[_0x025f('0xc')]('type');var _0x588a20=this[_0x025f('0xc')](_0x025f('0xd'));var _0x46b24e=this[_0x025f('0xc')](_0x025f('0xb'));if(_0x4bceae===_0x025f('0x2')){return _0x46b24e;}if(_0x588a20===_0x025f('0xe')&&_0x46b24e===_0x025f('0x6')||_0x588a20===_0x025f('0xe')&&_0x46b24e===_0x025f('0xf')){return _0x46b24e;}if(_0x588a20==='progressive'||_0x588a20===_0x025f('0x10')||_0x588a20===_0x025f('0x11')){return _0x46b24e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x025f('0x13')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x025f('0x14'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no',_0x025f('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x025f('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x025f('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x025f('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x025f('0x13')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x025f('0x13')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x025f('0x4')]('yes','no'),'defaultValue':_0x025f('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x025f('0x14'),'no',_0x025f('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x025f('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x025f('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x025f('0x13')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x025f('0x13')]},'queue_youarenext':{'type':Sequelize[_0x025f('0x13')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x025f('0x13')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x025f('0x13')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x025f('0x13')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x025f('0x13')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x025f('0x13')]},'queue_quantity1':{'type':Sequelize[_0x025f('0x13')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x025f('0x13')]},'periodic_announce':{'type':Sequelize[_0x025f('0x17')],'set':function(_0x167296){this[_0x025f('0xa')]('periodic_announce',_0x167296?_0x167296['join'](','):[]);},'get':function(){return this[_0x025f('0xc')](_0x025f('0x18'))?this['getDataValue'](_0x025f('0x18'))[_0x025f('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x025f('0x13')],'defaultValue':'yes','set':function(_0x3c08ea){this[_0x025f('0xa')](_0x025f('0x1a'),_0x3c08ea?_0x3c08ea[_0x025f('0x1b')](','):undefined);},'get':function(){return this[_0x025f('0xc')](_0x025f('0x1a'))?this['getDataValue']('joinempty')[_0x025f('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1bc52f){this[_0x025f('0xa')](_0x025f('0x1c'),_0x1bc52f?_0x1bc52f['join'](','):undefined);},'get':function(){return this[_0x025f('0xc')](_0x025f('0x1c'))?this['getDataValue'](_0x025f('0x1c'))[_0x025f('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x025f('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x025f('0x13')]},'acw':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':0x0,'set':function(_0x371cbc){this['setDataValue'](_0x025f('0x1e'),_0x371cbc);if(_0x371cbc){if(this['getDataValue'](_0x025f('0x1f'))<0x2){this[_0x025f('0xa')](_0x025f('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x025f('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':0x0,'comment':_0x025f('0x20')},'dialMethod':{'type':Sequelize[_0x025f('0x4')]('preview',_0x025f('0x21'),_0x025f('0x11'),_0x025f('0x10'),_0x025f('0xe')),'defaultValue':'progressive','comment':_0x025f('0x22')},'dialLimitChannel':{'type':Sequelize[_0x025f('0x12')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x025f('0x23')},'dialLimitQueue':{'type':Sequelize[_0x025f('0x12')](0x4)[_0x025f('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x025f('0x25')](0x2)[_0x025f('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x025f('0x4')]('agentBusyFactor',_0x025f('0x26')),'defaultValue':_0x025f('0x26'),'comment':_0x025f('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x025f('0x25')](0x2)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x025f('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x025f('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x025f('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x025f('0x13')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x025f('0x13')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x025f('0x13')],'defaultValue':_0x025f('0x2b'),'comment':_0x025f('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x2d')},'dialQueueProject':{'type':Sequelize[_0x025f('0x13')],'comment':_0x025f('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'comment':_0x025f('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x025f('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x025f('0x13')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x35'),'never',_0x025f('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':0x0,'comment':_0x025f('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x025f('0x12')](0x9)[_0x025f('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x025f('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x025f('0x12')](0x9)[_0x025f('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x025f('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x025f('0x12')](0x9)[_0x025f('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x025f('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x025f('0x12')](0x9)[_0x025f('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x025f('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x025f('0x12')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x025f('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x025f('0x12')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x025f('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x025f('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x025f('0x12')](0x9)[_0x025f('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x025f('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x025f('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':0x0,'comment':_0x025f('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x025f('0x4')](_0x025f('0x41'),'ASC'),'defaultValue':_0x025f('0x41')},'dialQueueProject2':{'type':Sequelize[_0x025f('0x13')],'comment':_0x025f('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x025f('0x42')},'dialCutDigit':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x025f('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x025f('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x025f('0x12')](0x3)[_0x025f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x025f('0x12')](0x5)[_0x025f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x025f('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x025f('0x12')],'allowNull':!![],'comment':_0x025f('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x025f('0x1d')],'defaultValue':![],'comment':_0x025f('0x4e'),'set':function(_0x14dcfe){if(!_0x14dcfe)this[_0x025f('0xa')](_0x025f('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x14dcfe);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x025f('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xb6a6=['tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','progressive','power','INTEGER','yes','all','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x3120b0,_0x5e67fe){_0x3120b0=_0x3120b0-0x0;var _0x1b368a=_0xb6a6[_0x3120b0];return _0x1b368a;};'use strict';var Sequelize=require('sequelize');module[_0x6b6a('0x0')]={'name':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':![],'unique':_0x6b6a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6b6a('0x3')]('inbound',_0x6b6a('0x4')),'allowNull':![],'defaultValue':_0x6b6a('0x5')},'musiconhold':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x6b6a('0x7'),_0x6b6a('0x8'),_0x6b6a('0x9'),_0x6b6a('0xa'),_0x6b6a('0xb'),_0x6b6a('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x6b6a('0x7'),'set':function(_0x23f217){this[_0x6b6a('0xd')]('strategy',_0x23f217?_0x23f217:_0x6b6a('0xb'));},'get':function(){var _0x4fb0ee=this[_0x6b6a('0xe')](_0x6b6a('0xf'));var _0x25a90f=this[_0x6b6a('0xe')](_0x6b6a('0x10'));var _0x4458ea=this[_0x6b6a('0xe')](_0x6b6a('0x11'));if(_0x4fb0ee==='inbound'){return _0x4458ea;}if(_0x25a90f===_0x6b6a('0x12')&&_0x4458ea===_0x6b6a('0xb')||_0x25a90f===_0x6b6a('0x12')&&_0x4458ea===_0x6b6a('0x13')){return _0x4458ea;}if(_0x25a90f===_0x6b6a('0x14')||_0x25a90f==='predictive'||_0x25a90f===_0x6b6a('0x15')){return _0x4458ea;}return null;}},'servicelevel':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'timeout':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6b6a('0x1')]},'weight':{'type':Sequelize[_0x6b6a('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no',_0x6b6a('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x6b6a('0x3')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6b6a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6b6a('0x1')]},'queue_youarenext':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x6b6a('0x1')]},'queue_quantity2':{'type':Sequelize[_0x6b6a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x6b6a('0x1')]},'queue_less_than':{'type':Sequelize[_0x6b6a('0x1')]},'periodic_announce':{'type':Sequelize[_0x6b6a('0x19')],'set':function(_0x4e1ed6){this['setDataValue']('periodic_announce',_0x4e1ed6?_0x4e1ed6[_0x6b6a('0x1a')](','):[]);},'get':function(){return this[_0x6b6a('0xe')](_0x6b6a('0x1b'))?this[_0x6b6a('0xe')](_0x6b6a('0x1b'))[_0x6b6a('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x17'),'set':function(_0x5cbabb){this['setDataValue'](_0x6b6a('0x1d'),_0x5cbabb?_0x5cbabb[_0x6b6a('0x1a')](','):undefined);},'get':function(){return this[_0x6b6a('0xe')](_0x6b6a('0x1d'))?this[_0x6b6a('0xe')](_0x6b6a('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':'no','set':function(_0xebb758){this[_0x6b6a('0xd')](_0x6b6a('0x1e'),_0xebb758?_0xebb758[_0x6b6a('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x6b6a('0x1e'))?this['getDataValue'](_0x6b6a('0x1e'))[_0x6b6a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'set':function(_0x2d3aeb){this[_0x6b6a('0xd')]('acw',_0x2d3aeb);if(_0x2d3aeb){if(this[_0x6b6a('0xe')](_0x6b6a('0x20'))<0x2){this[_0x6b6a('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x21'),'progressive',_0x6b6a('0x15'),_0x6b6a('0x22'),_0x6b6a('0x12')),'defaultValue':_0x6b6a('0x14'),'comment':_0x6b6a('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b6a('0x24')},'dialLimitQueue':{'type':Sequelize[_0x6b6a('0x16')](0x4)[_0x6b6a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x6b6a('0x26')](0x2)[_0x6b6a('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6b6a('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x6b6a('0x28'),_0x6b6a('0x29')),'defaultValue':_0x6b6a('0x29'),'comment':_0x6b6a('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6b6a('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6b6a('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6b6a('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6b6a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x2e'),'comment':_0x6b6a('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x6b6a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6b6a('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6b6a('0x34')},'dialTimezone':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x35'),_0x6b6a('0x36'),_0x6b6a('0x37')),'defaultValue':_0x6b6a('0x35')},'dialAMDActive':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'comment':_0x6b6a('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x6b6a('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6b6a('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6b6a('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6b6a('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6b6a('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b6a('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x6b6a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6b6a('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'comment':_0x6b6a('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x40'),_0x6b6a('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6b6a('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b6a('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':![],'comment':_0x6b6a('0x4b'),'set':function(_0x525d1e){if(!_0x525d1e)this[_0x6b6a('0xd')]('mandatoryDispositionPauseId',null);this[_0x6b6a('0xd')](_0x6b6a('0x4c'),_0x525d1e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 4584205..15e701f 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 _0x627d=['Content-Range','apply','save','update','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','UserProfileResource','then','error','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getTeams','Team','addTeams','Agents','online','voicePause','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','format','emit','userVoiceQueue:save','ids','User','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','SIP/%s','all','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','into','fromQuery','phone','ListId','field','NOW()','scheduledAt','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','removeLists','getBlackLists','addBlackLists','removeBlackLists','CmHopperBlack','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x48e5d9,_0x322960){var _0x57e44b=function(_0xae03af){while(--_0xae03af){_0x48e5d9['push'](_0x48e5d9['shift']());}};_0x57e44b(++_0x322960);}(_0x627d,0x146));var _0xd627=function(_0x56153c,_0xc3d136){_0x56153c=_0x56153c-0x0;var _0x9aa8d9=_0x627d[_0x56153c];return _0x9aa8d9;};'use strict';var emlformat=require(_0xd627('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd627('0x1'));var jsonpatch=require(_0xd627('0x2'));var rp=require(_0xd627('0x3'));var moment=require(_0xd627('0x4'));var BPromise=require(_0xd627('0x5'));var Mustache=require(_0xd627('0x6'));var util=require(_0xd627('0x7'));var path=require(_0xd627('0x8'));var sox=require(_0xd627('0x9'));var csv=require('to-csv');var ejs=require(_0xd627('0xa'));var fs=require('fs');var fs_extra=require(_0xd627('0xb'));var _=require('lodash');var squel=require(_0xd627('0xc'));var crypto=require(_0xd627('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd627('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd627('0xf'));var Papa=require('papaparse');var Redis=require(_0xd627('0x10'));var authService=require(_0xd627('0x11'));var qs=require(_0xd627('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd627('0x13'))(_0xd627('0x14'));var utils=require(_0xd627('0x15'));var config=require(_0xd627('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd627('0x17'))['db'];config[_0xd627('0x18')]=_[_0xd627('0x19')](config[_0xd627('0x18')],{'host':_0xd627('0x1a'),'port':0x18eb});var socket=require(_0xd627('0x1b'))(new Redis(config[_0xd627('0x18')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x548195,_0x5cb5de){_0x5cb5de=_0x5cb5de||0xcc;return function(_0x277678){if(_0x277678){return _0x548195[_0xd627('0x1c')](_0x5cb5de);}return _0x548195[_0xd627('0x1d')](_0x5cb5de)[_0xd627('0x1e')]();};}function respondWithResult(_0x191367,_0x22f618){_0x22f618=_0x22f618||0xc8;return function(_0x27c257){if(_0x27c257){return _0x191367[_0xd627('0x1d')](_0x22f618)['json'](_0x27c257);}};}function respondWithFilteredResult(_0x287aaa,_0x4fda35){return function(_0x37eb4c){if(_0x37eb4c){var _0x1701cf=typeof _0x4fda35[_0xd627('0x1f')]===_0xd627('0x20')&&typeof _0x4fda35[_0xd627('0x21')]===_0xd627('0x20');var _0x2c7bbf=_0x37eb4c[_0xd627('0x22')];var _0x1ae53a=_0x1701cf?0x0:_0x4fda35[_0xd627('0x1f')];var _0x56b59a=_0x1701cf?_0x37eb4c[_0xd627('0x22')]:_0x4fda35[_0xd627('0x1f')]+_0x4fda35[_0xd627('0x21')];var _0x23469a;if(_0x56b59a>=_0x2c7bbf){_0x56b59a=_0x2c7bbf;_0x23469a=0xc8;}else{_0x23469a=0xce;}_0x287aaa[_0xd627('0x1d')](_0x23469a);return _0x287aaa[_0xd627('0x23')](_0xd627('0x24'),_0x1ae53a+'-'+_0x56b59a+'/'+_0x2c7bbf)['json'](_0x37eb4c);}return null;};}function patchUpdates(_0x5efe85){return function(_0x39ef9d){try{jsonpatch[_0xd627('0x25')](_0x39ef9d,_0x5efe85,!![]);}catch(_0x2cac87){return BPromise['reject'](_0x2cac87);}return _0x39ef9d[_0xd627('0x26')]();};}function saveUpdates(_0x5d7f82,_0x4085da){return function(_0x561804){if(_0x561804){return _0x561804[_0xd627('0x27')](_0x5d7f82)['then'](function(_0x167db1){return _0x167db1;});}return null;};}function removeEntity(_0x74b2e0,_0x31fc7b){return function(_0x185678){if(_0x185678){return _0x185678[_0xd627('0x28')]()['then'](function(){var _0x3ef56a=_0x185678[_0xd627('0x29')]({'plain':!![]});var _0x5a2a85=[{'name':_0xd627('0x2a'),'value':_0xd627('0x2b'),'ignore':![]},{'name':_0xd627('0x2c'),'value':_0xd627('0x2d'),'ignore':![]}];var _0x2d8ef9=_(_0x5a2a85)[_0xd627('0x2e')]('ignore')[_0xd627('0x2f')](_0xd627('0x30'))[_0xd627('0x30')]();if(_[_0xd627('0x31')](_0x2d8ef9,_0x3ef56a[_0xd627('0x32')])){return;}var _0x4f7d87=_['find'](_0x5a2a85,[_0xd627('0x30'),_0x3ef56a[_0xd627('0x32')]])['name'];return db[_0xd627('0x33')][_0xd627('0x28')]({'where':{'type':_0x4f7d87,'resourceId':_0x3ef56a['id']}})[_0xd627('0x34')](function(){return _0x185678;});})['then'](function(){_0x74b2e0[_0xd627('0x1d')](0xcc)[_0xd627('0x1e')]();});}};}function handleEntityNotFound(_0x4fe8ce,_0x515d9c){return function(_0x177bb3){if(!_0x177bb3){_0x4fe8ce['sendStatus'](0x194);}return _0x177bb3;};}function handleError(_0x524623,_0x4e7a1e){_0x4e7a1e=_0x4e7a1e||0x1f4;return function(_0x1a0aa9){logger[_0xd627('0x35')](_0x1a0aa9['stack']);if(_0x1a0aa9[_0xd627('0x36')]){delete _0x1a0aa9[_0xd627('0x36')];}_0x524623[_0xd627('0x1d')](_0x4e7a1e)[_0xd627('0x37')](_0x1a0aa9);};}exports[_0xd627('0x38')]=function(_0x15ccec,_0x421868){var _0x2a4a7e={},_0x44d3a9={},_0x147806={'count':0x0,'rows':[]};var _0x274ed5=_['map'](db[_0xd627('0x39')][_0xd627('0x3a')],function(_0x117351){return{'name':_0x117351[_0xd627('0x3b')],'type':_0x117351[_0xd627('0x32')][_0xd627('0x3c')]};});_0x44d3a9[_0xd627('0x3d')]=_[_0xd627('0x2f')](_0x274ed5,'name');_0x44d3a9['query']=_['keys'](_0x15ccec['query']);_0x44d3a9[_0xd627('0x3e')]=_[_0xd627('0x3f')](_0x44d3a9[_0xd627('0x3d')],_0x44d3a9[_0xd627('0x40')]);_0x2a4a7e[_0xd627('0x41')]=_['intersection'](_0x44d3a9[_0xd627('0x3d')],qs['fields'](_0x15ccec[_0xd627('0x40')]['fields']));_0x2a4a7e[_0xd627('0x41')]=_0x2a4a7e[_0xd627('0x41')][_0xd627('0x42')]?_0x2a4a7e[_0xd627('0x41')]:_0x44d3a9[_0xd627('0x3d')];if(!_0x15ccec['query'][_0xd627('0x43')]('nolimit')){_0x2a4a7e[_0xd627('0x21')]=qs[_0xd627('0x21')](_0x15ccec[_0xd627('0x40')][_0xd627('0x21')]);_0x2a4a7e['offset']=qs[_0xd627('0x1f')](_0x15ccec['query'][_0xd627('0x1f')]);}_0x2a4a7e[_0xd627('0x44')]=qs[_0xd627('0x45')](_0x15ccec[_0xd627('0x40')]['sort']);_0x2a4a7e['where']=qs['filters'](_[_0xd627('0x46')](_0x15ccec['query'],_0x44d3a9['filters']),_0x274ed5);if(_0x15ccec[_0xd627('0x40')][_0xd627('0x2e')]){_0x2a4a7e['where']=_[_0xd627('0x47')](_0x2a4a7e[_0xd627('0x48')],{'$or':_[_0xd627('0x2f')](_0x274ed5,function(_0x160838){if(_0x160838[_0xd627('0x32')]!==_0xd627('0x49')){var _0x22aa7b={};_0x22aa7b[_0x160838['name']]={'$like':'%'+_0x15ccec[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x22aa7b;}})});}_0x2a4a7e=_[_0xd627('0x47')]({},_0x2a4a7e,_0x15ccec[_0xd627('0x4a')]);var _0x1c8dfb={'where':_0x2a4a7e[_0xd627('0x48')]};return db[_0xd627('0x39')][_0xd627('0x22')](_0x1c8dfb)[_0xd627('0x34')](function(_0x5a3b04){_0x147806['count']=_0x5a3b04;if(_0x15ccec['query'][_0xd627('0x4b')]){_0x2a4a7e[_0xd627('0x4c')]=[{'all':!![]}];}return db[_0xd627('0x39')][_0xd627('0x4d')](_0x2a4a7e);})[_0xd627('0x34')](function(_0x124861){_0x147806[_0xd627('0x4e')]=_0x124861;return _0x147806;})['then'](respondWithFilteredResult(_0x421868,_0x2a4a7e))[_0xd627('0x4f')](handleError(_0x421868,null));};exports[_0xd627('0x50')]=function(_0x1f8748,_0x1fc465){var _0x2f866e={'raw':![],'where':{'id':_0x1f8748['params']['id']}},_0xd08466={};_0xd08466[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x39')][_0xd627('0x3a')]);_0xd08466[_0xd627('0x40')]=_[_0xd627('0x51')](_0x1f8748['query']);_0xd08466[_0xd627('0x3e')]=_['intersection'](_0xd08466[_0xd627('0x3d')],_0xd08466[_0xd627('0x40')]);_0x2f866e['attributes']=_[_0xd627('0x3f')](_0xd08466[_0xd627('0x3d')],qs['fields'](_0x1f8748['query'][_0xd627('0x52')]));_0x2f866e[_0xd627('0x41')]=_0x2f866e['attributes'][_0xd627('0x42')]?_0x2f866e[_0xd627('0x41')]:_0xd08466[_0xd627('0x3d')];if(_0x1f8748[_0xd627('0x40')][_0xd627('0x4b')]){_0x2f866e[_0xd627('0x4c')]=[{'all':!![]}];}_0x2f866e=_[_0xd627('0x47')]({},_0x2f866e,_0x1f8748[_0xd627('0x4a')]);return db[_0xd627('0x39')][_0xd627('0x53')](_0x2f866e)[_0xd627('0x34')](handleEntityNotFound(_0x1fc465,null))[_0xd627('0x34')](respondWithResult(_0x1fc465,null))[_0xd627('0x4f')](handleError(_0x1fc465,null));};exports[_0xd627('0x54')]=function(_0x297af8,_0x3d12cb){return db[_0xd627('0x39')][_0xd627('0x54')](_0x297af8[_0xd627('0x55')],{})['then'](function(_0x664b69){var _0x3da746=_0x297af8[_0xd627('0x56')]['get']({'plain':!![]});if(!_0x3da746)throw new Error(_0xd627('0x57'));if(_0x3da746[_0xd627('0x58')]==='user'){var _0x541e24=_0x664b69[_0xd627('0x29')]({'plain':!![]});var _0xe87940=[{'name':_0xd627('0x2a'),'value':'inbound'},{'name':_0xd627('0x2c'),'value':_0xd627('0x2d')}];var _0x4d12ef=_['find'](_0xe87940,[_0xd627('0x30'),_0x541e24['type']])[_0xd627('0x36')];return db['UserProfileSection'][_0xd627('0x53')]({'where':{'name':_0x4d12ef,'userProfileId':_0x3da746['userProfileId']},'raw':!![]})[_0xd627('0x34')](function(_0x49901f){if(_0x49901f&&_0x49901f['autoAssociation']===0x0){return db[_0xd627('0x33')][_0xd627('0x54')]({'name':_0x541e24[_0xd627('0x36')],'resourceId':_0x541e24['id'],'type':_0x49901f[_0xd627('0x36')],'sectionId':_0x49901f['id']},{})[_0xd627('0x34')](function(){return _0x664b69;});}else{return _0x664b69;}})[_0xd627('0x4f')](function(_0x992c78){logger['error'](_0xd627('0x59'),_0x992c78);throw _0x992c78;});}return _0x664b69;})['then'](respondWithResult(_0x3d12cb,0xc9))['catch'](handleError(_0x3d12cb,null));};exports[_0xd627('0x5a')]=function(_0x19e330,_0x4f5e5a){var _0x30a723={'where':{'id':_0x19e330[_0xd627('0x5b')]['id']}},_0x1c1131={};_0x1c1131[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x39')]['rawAttributes']);_0x30a723['attributes']=_['intersection'](_0x1c1131[_0xd627('0x3d')],qs['fields'](_0x19e330[_0xd627('0x40')]['fields']));_0x30a723[_0xd627('0x41')]=_0x30a723[_0xd627('0x41')][_0xd627('0x42')]?_0x30a723[_0xd627('0x41')]:_0x1c1131[_0xd627('0x3d')];if(_0x19e330[_0xd627('0x40')][_0xd627('0x4b')]){_0x30a723['include']=[{'all':!![]}];}_0x30a723=_['merge']({},_0x30a723,_0x19e330[_0xd627('0x4a')]);return db[_0xd627('0x39')][_0xd627('0x53')](_0x30a723)[_0xd627('0x34')](handleEntityNotFound(_0x4f5e5a,null))['then'](function(_0x30c093){if(_0x30c093){var _0x28ae4d=_0x30c093[_0xd627('0x29')]({'plain':!![]});_0x28ae4d=qs[_0xd627('0x5c')](_0x28ae4d,['id',_0xd627('0x5d'),_0xd627('0x5e')]);_0x19e330['body']=_[_0xd627('0x5c')](_0x19e330[_0xd627('0x55')],['id',_0xd627('0x5d'),_0xd627('0x5e')]);return db[_0xd627('0x39')][_0xd627('0x54')](_[_0xd627('0x47')](_0x28ae4d,_0x19e330[_0xd627('0x55')]),{'include':_0x19e330['query'][_0xd627('0x4b')]?[{'all':!![]}]:undefined})[_0xd627('0x34')](function(_0xd6c238){var _0x1b505c=_0x19e330['user'][_0xd627('0x29')]({'plain':!![]});if(!_0x1b505c)throw new Error(_0xd627('0x57'));if(_0x1b505c[_0xd627('0x58')]===_0xd627('0x56')){var _0x1107eb=_0xd6c238[_0xd627('0x29')]({'plain':!![]});var _0x35c29c=[{'name':_0xd627('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xd627('0x2d')}];var _0x20107c=_[_0xd627('0x53')](_0x35c29c,[_0xd627('0x30'),_0x1107eb[_0xd627('0x32')]])[_0xd627('0x36')];return db[_0xd627('0x5f')][_0xd627('0x53')]({'where':{'name':_0x20107c,'userProfileId':_0x1b505c['userProfileId']},'raw':!![]})['then'](function(_0x7dcd67){if(_0x7dcd67&&_0x7dcd67['autoAssociation']===0x0){return db[_0xd627('0x33')]['create']({'name':_0x1107eb[_0xd627('0x36')],'resourceId':_0x1107eb['id'],'type':_0x7dcd67[_0xd627('0x36')],'sectionId':_0x7dcd67['id']},{})[_0xd627('0x34')](function(){return _0xd6c238;});}else{return _0xd6c238;}})[_0xd627('0x4f')](function(_0x3e7ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e7ef);throw _0x3e7ef;});}return _0xd6c238;});}})[_0xd627('0x34')](respondWithResult(_0x4f5e5a,0xc9))[_0xd627('0x4f')](handleError(_0x4f5e5a,null));};exports[_0xd627('0x27')]=function(_0x138a6d,_0x3c26b8){if(_0x138a6d[_0xd627('0x55')]['id']){delete _0x138a6d['body']['id'];}return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x138a6d[_0xd627('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3c26b8,null))[_0xd627('0x34')](saveUpdates(_0x138a6d[_0xd627('0x55')],null))['then'](respondWithResult(_0x3c26b8,null))['catch'](handleError(_0x3c26b8,null));};exports[_0xd627('0x28')]=function(_0x13d79e,_0x2d3978){return db[_0xd627('0x39')]['find']({'where':{'id':_0x13d79e[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x2d3978,null))[_0xd627('0x34')](removeEntity(_0x2d3978,null))[_0xd627('0x4f')](handleError(_0x2d3978,null));};exports[_0xd627('0x60')]=function(_0x1f153d,_0x3c0cc7,_0x4a4f40){var _0x1b57e6={'raw':![],'where':{}};var _0x3b51ad={};var _0x4f4b31={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd627('0x61')]({'where':{'id':_0x1f153d[_0xd627('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3c0cc7,null))[_0xd627('0x34')](function(_0x44e284){if(_0x44e284){_0x3b51ad[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x62')]['rawAttributes']);_0x3b51ad['query']=_['keys'](_0x1f153d[_0xd627('0x40')]);_0x3b51ad[_0xd627('0x3e')]=_['intersection'](_0x3b51ad['model'],_0x3b51ad[_0xd627('0x40')]);_0x1b57e6[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x3b51ad['model'],qs['fields'](_0x1f153d[_0xd627('0x40')][_0xd627('0x52')]));_0x1b57e6[_0xd627('0x41')]=_0x1b57e6[_0xd627('0x41')][_0xd627('0x42')]?_0x1b57e6[_0xd627('0x41')]:_0x3b51ad['model'];if(!_0x1f153d['query'][_0xd627('0x43')](_0xd627('0x63'))){_0x1b57e6['limit']=qs[_0xd627('0x21')](_0x1f153d[_0xd627('0x40')][_0xd627('0x21')]);_0x1b57e6['offset']=qs[_0xd627('0x1f')](_0x1f153d[_0xd627('0x40')]['offset']);}_0x1b57e6[_0xd627('0x44')]=qs['sort'](_0x1f153d[_0xd627('0x40')]['sort']);_0x1b57e6[_0xd627('0x48')]=qs[_0xd627('0x3e')](_['pick'](_0x1f153d[_0xd627('0x40')],_0x3b51ad[_0xd627('0x3e')]));_0x1b57e6[_0xd627('0x48')][_0xd627('0x64')]=_0x44e284['id'];if(_0x1f153d['query']['filter']){_0x1b57e6['where']=_['merge'](_0x1b57e6[_0xd627('0x48')],{'$or':_['map'](_0x1b57e6[_0xd627('0x41')],function(_0x81b845){var _0x281e58={};_0x281e58[_0x81b845]={'$like':'%'+_0x1f153d[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x281e58;})});}_0x1b57e6=_[_0xd627('0x47')]({},_0x1b57e6,_0x1f153d[_0xd627('0x4a')]);return db[_0xd627('0x62')]['count']({'where':_0x1b57e6[_0xd627('0x48')]})[_0xd627('0x34')](function(_0x27dee1){_0x4f4b31[_0xd627('0x22')]=_0x27dee1;if(_0x1f153d[_0xd627('0x40')][_0xd627('0x4b')]){_0x1b57e6['include']=[{'all':!![]}];}return db[_0xd627('0x62')][_0xd627('0x4d')](_0x1b57e6);})['then'](function(_0x2a0667){_0x4f4b31['rows']=_0x2a0667;return _0x4f4b31;});}})[_0xd627('0x34')](respondWithFilteredResult(_0x3c0cc7,_0x1b57e6))[_0xd627('0x4f')](handleError(_0x3c0cc7,null));};exports[_0xd627('0x65')]=function(_0x1e0b64,_0x421ce8,_0x5181d5){var _0x1ed634={'raw':!![],'where':{}};var _0x173c0c={};var _0x2b87a9={'count':0x0,'rows':[]};return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x1e0b64[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x421ce8,null))[_0xd627('0x34')](function(_0x10eb67){if(_0x10eb67){_0x173c0c[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x66')][_0xd627('0x3a')]);_0x173c0c[_0xd627('0x40')]=_['keys'](_0x1e0b64['query']);_0x173c0c['filters']=_[_0xd627('0x3f')](_0x173c0c['model'],_0x173c0c['query']);_0x1ed634['attributes']=_['intersection'](_0x173c0c[_0xd627('0x3d')],qs['fields'](_0x1e0b64['query']['fields']));_0x1ed634[_0xd627('0x41')]=_0x1ed634[_0xd627('0x41')][_0xd627('0x42')]?_0x1ed634[_0xd627('0x41')]:_0x173c0c[_0xd627('0x3d')];if(!_0x1e0b64[_0xd627('0x40')][_0xd627('0x43')](_0xd627('0x63'))){_0x1ed634[_0xd627('0x21')]=qs[_0xd627('0x21')](_0x1e0b64[_0xd627('0x40')][_0xd627('0x21')]);_0x1ed634['offset']=qs['offset'](_0x1e0b64[_0xd627('0x40')][_0xd627('0x1f')]);}_0x1ed634['order']=qs['sort'](_0x1e0b64[_0xd627('0x40')][_0xd627('0x45')]);_0x1ed634[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x1e0b64['query'],_0x173c0c[_0xd627('0x3e')]));_0x1ed634[_0xd627('0x48')]['VoiceQueueId']=_0x10eb67['id'];if(_0x1e0b64[_0xd627('0x40')]['filter']){_0x1ed634[_0xd627('0x48')]=_[_0xd627('0x47')](_0x1ed634['where'],{'$or':_[_0xd627('0x2f')](_0x1ed634['attributes'],function(_0x2df06c){var _0x2be1c0={};_0x2be1c0[_0x2df06c]={'$like':'%'+_0x1e0b64[_0xd627('0x40')]['filter']+'%'};return _0x2be1c0;})});}_0x1ed634=_[_0xd627('0x47')]({},_0x1ed634,_0x1e0b64[_0xd627('0x4a')]);return db[_0xd627('0x66')][_0xd627('0x22')]({'where':_0x1ed634[_0xd627('0x48')]})[_0xd627('0x34')](function(_0x16a78d){_0x2b87a9[_0xd627('0x22')]=_0x16a78d;if(_0x1e0b64[_0xd627('0x40')][_0xd627('0x4b')]){_0x1ed634['include']=[{'all':!![]}];}return db[_0xd627('0x66')][_0xd627('0x4d')](_0x1ed634);})[_0xd627('0x34')](function(_0x404089){_0x2b87a9[_0xd627('0x4e')]=_0x404089;return _0x2b87a9;});}})[_0xd627('0x34')](respondWithFilteredResult(_0x421ce8,_0x1ed634))[_0xd627('0x4f')](handleError(_0x421ce8,null));};exports[_0xd627('0x67')]=function(_0x5d6a44,_0x314daa,_0x4a2ad4){var _0x25111c={'raw':!![],'where':{}};var _0x592d66={};var _0x472aa0={'count':0x0,'rows':[]};return db[_0xd627('0x39')]['findOne']({'where':{'id':_0x5d6a44[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x314daa,null))[_0xd627('0x34')](function(_0x48126b){if(_0x48126b){_0x592d66[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x68')]['rawAttributes']);_0x592d66[_0xd627('0x40')]=_[_0xd627('0x51')](_0x5d6a44[_0xd627('0x40')]);_0x592d66[_0xd627('0x3e')]=_[_0xd627('0x3f')](_0x592d66[_0xd627('0x3d')],_0x592d66['query']);_0x25111c[_0xd627('0x41')]=_['intersection'](_0x592d66[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x5d6a44[_0xd627('0x40')]['fields']));_0x25111c[_0xd627('0x41')]=_0x25111c['attributes'][_0xd627('0x42')]?_0x25111c[_0xd627('0x41')]:_0x592d66[_0xd627('0x3d')];if(!_0x5d6a44['query'][_0xd627('0x43')]('nolimit')){_0x25111c[_0xd627('0x21')]=qs['limit'](_0x5d6a44[_0xd627('0x40')]['limit']);_0x25111c[_0xd627('0x1f')]=qs[_0xd627('0x1f')](_0x5d6a44[_0xd627('0x40')][_0xd627('0x1f')]);}_0x25111c[_0xd627('0x44')]=qs['sort'](_0x5d6a44[_0xd627('0x40')][_0xd627('0x45')]);_0x25111c[_0xd627('0x48')]=qs['filters'](_[_0xd627('0x46')](_0x5d6a44[_0xd627('0x40')],_0x592d66[_0xd627('0x3e')]));_0x25111c['where']['VoiceQueueId']=_0x48126b['id'];if(_0x5d6a44[_0xd627('0x40')][_0xd627('0x2e')]){_0x25111c[_0xd627('0x48')]=_[_0xd627('0x47')](_0x25111c[_0xd627('0x48')],{'$or':_['map'](_0x25111c[_0xd627('0x41')],function(_0x34b388){var _0x383ce1={};_0x383ce1[_0x34b388]={'$like':'%'+_0x5d6a44[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x383ce1;})});}_0x25111c=_[_0xd627('0x47')]({},_0x25111c,_0x5d6a44[_0xd627('0x4a')]);return db[_0xd627('0x68')][_0xd627('0x22')]({'where':_0x25111c[_0xd627('0x48')]})[_0xd627('0x34')](function(_0x1b267e){_0x472aa0['count']=_0x1b267e;if(_0x5d6a44[_0xd627('0x40')][_0xd627('0x4b')]){_0x25111c[_0xd627('0x4c')]=[{'all':!![]}];}return db[_0xd627('0x68')][_0xd627('0x4d')](_0x25111c);})[_0xd627('0x34')](function(_0x1944f4){_0x472aa0[_0xd627('0x4e')]=_0x1944f4;return _0x472aa0;});}})[_0xd627('0x34')](respondWithFilteredResult(_0x314daa,_0x25111c))[_0xd627('0x4f')](handleError(_0x314daa,null));};exports['getHopperBlacks']=function(_0x244a54,_0x250f46,_0x35f732){var _0x22d5cc={'raw':!![],'where':{}};var _0x549219={};var _0x307232={'count':0x0,'rows':[]};return db[_0xd627('0x39')]['findOne']({'where':{'id':_0x244a54['params']['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x250f46,null))[_0xd627('0x34')](function(_0x1c4486){if(_0x1c4486){_0x549219[_0xd627('0x3d')]=_[_0xd627('0x51')](db['CmHopperBlack'][_0xd627('0x3a')]);_0x549219[_0xd627('0x40')]=_[_0xd627('0x51')](_0x244a54['query']);_0x549219[_0xd627('0x3e')]=_['intersection'](_0x549219[_0xd627('0x3d')],_0x549219[_0xd627('0x40')]);_0x22d5cc[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x549219[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x244a54[_0xd627('0x40')][_0xd627('0x52')]));_0x22d5cc[_0xd627('0x41')]=_0x22d5cc[_0xd627('0x41')][_0xd627('0x42')]?_0x22d5cc[_0xd627('0x41')]:_0x549219[_0xd627('0x3d')];if(!_0x244a54[_0xd627('0x40')][_0xd627('0x43')](_0xd627('0x63'))){_0x22d5cc['limit']=qs[_0xd627('0x21')](_0x244a54[_0xd627('0x40')][_0xd627('0x21')]);_0x22d5cc[_0xd627('0x1f')]=qs['offset'](_0x244a54[_0xd627('0x40')]['offset']);}_0x22d5cc['order']=qs[_0xd627('0x45')](_0x244a54['query'][_0xd627('0x45')]);_0x22d5cc[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x244a54[_0xd627('0x40')],_0x549219[_0xd627('0x3e')]));_0x22d5cc[_0xd627('0x48')][_0xd627('0x64')]=_0x1c4486['id'];if(_0x244a54[_0xd627('0x40')][_0xd627('0x2e')]){_0x22d5cc[_0xd627('0x48')]=_['merge'](_0x22d5cc['where'],{'$or':_['map'](_0x22d5cc[_0xd627('0x41')],function(_0xe4b38e){var _0x2af59b={};_0x2af59b[_0xe4b38e]={'$like':'%'+_0x244a54[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x2af59b;})});}_0x22d5cc=_[_0xd627('0x47')]({},_0x22d5cc,_0x244a54[_0xd627('0x4a')]);return db['CmHopperBlack'][_0xd627('0x22')]({'where':_0x22d5cc[_0xd627('0x48')]})[_0xd627('0x34')](function(_0xc3f5dd){_0x307232[_0xd627('0x22')]=_0xc3f5dd;if(_0x244a54[_0xd627('0x40')][_0xd627('0x4b')]){_0x22d5cc['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xd627('0x4d')](_0x22d5cc);})[_0xd627('0x34')](function(_0x2e7099){_0x307232[_0xd627('0x4e')]=_0x2e7099;return _0x307232;});}})[_0xd627('0x34')](respondWithFilteredResult(_0x250f46,_0x22d5cc))['catch'](handleError(_0x250f46,null));};exports[_0xd627('0x69')]=function(_0x5a6f04,_0x17c3e5,_0x8b2a3f){var _0x5660cb={};var _0x46cc6e={};var _0x37c0dd;var _0x3f2901;return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x5a6f04['params']['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x17c3e5,null))[_0xd627('0x34')](function(_0x145757){if(_0x145757){_0x37c0dd=_0x145757;_0x46cc6e['model']=_[_0xd627('0x51')](db[_0xd627('0x6a')][_0xd627('0x3a')]);_0x46cc6e[_0xd627('0x40')]=_[_0xd627('0x51')](_0x5a6f04[_0xd627('0x40')]);_0x46cc6e[_0xd627('0x3e')]=_[_0xd627('0x3f')](_0x46cc6e[_0xd627('0x3d')],_0x46cc6e['query']);_0x5660cb[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x46cc6e[_0xd627('0x3d')],qs['fields'](_0x5a6f04[_0xd627('0x40')][_0xd627('0x52')]));_0x5660cb[_0xd627('0x41')]=_0x5660cb[_0xd627('0x41')][_0xd627('0x42')]?_0x5660cb[_0xd627('0x41')]:_0x46cc6e[_0xd627('0x3d')];_0x5660cb[_0xd627('0x44')]=qs[_0xd627('0x45')](_0x5a6f04['query'][_0xd627('0x45')]);_0x5660cb[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x5a6f04[_0xd627('0x40')],_0x46cc6e[_0xd627('0x3e')]));if(_0x5a6f04[_0xd627('0x40')][_0xd627('0x2e')]){_0x5660cb['where']=_[_0xd627('0x47')](_0x5660cb[_0xd627('0x48')],{'$or':_[_0xd627('0x2f')](_0x5660cb[_0xd627('0x41')],function(_0x4daaa1){var _0x4f5488={};_0x4f5488[_0x4daaa1]={'$like':'%'+_0x5a6f04['query']['filter']+'%'};return _0x4f5488;})});}_0x5660cb=_[_0xd627('0x47')]({},_0x5660cb,_0x5a6f04['options']);return _0x37c0dd[_0xd627('0x69')](_0x5660cb);}})['then'](function(_0x5bed8a){if(_0x5bed8a){_0x3f2901=_0x5bed8a['length'];if(!_0x5a6f04[_0xd627('0x40')][_0xd627('0x43')](_0xd627('0x63'))){_0x5660cb[_0xd627('0x21')]=qs[_0xd627('0x21')](_0x5a6f04[_0xd627('0x40')][_0xd627('0x21')]);_0x5660cb['offset']=qs[_0xd627('0x1f')](_0x5a6f04['query'][_0xd627('0x1f')]);}return _0x37c0dd[_0xd627('0x69')](_0x5660cb);}})[_0xd627('0x34')](function(_0x1933cb){if(_0x1933cb){return _0x1933cb?{'count':_0x3f2901,'rows':_0x1933cb}:null;}})['then'](respondWithResult(_0x17c3e5,null))[_0xd627('0x4f')](handleError(_0x17c3e5,null));};exports[_0xd627('0x6b')]=function(_0x32a5f7,_0x4214ff,_0x5b4baa){var _0x157048=_0x32a5f7['body']['teams'];var _0x547368=_[_0xd627('0x2f')](_0x157048,'id');return db[_0xd627('0x6a')][_0xd627('0x4d')]({'where':{'id':_0x547368},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd627('0x6c'),'attributes':['id',_0xd627('0x36'),_0xd627('0x6d'),_0xd627('0x6e'),'interface'],'raw':!![]}]})['then'](function(_0x21ee6e){if(_0x21ee6e){var _0x184773=_['flatMap'](_0x21ee6e,function(_0x4bfbe5){var _0x2f8933=_0x4bfbe5[_0xd627('0x29')]({'plain':!![]});_0x2f8933[_0xd627('0x6c')][_0xd627('0x6f')](function(_0x3d6f6f){_0x3d6f6f[_0xd627('0x70')]=_['find'](_0x157048,{'id':_0x2f8933['id']})['penalty'];});return _0x2f8933[_0xd627('0x6c')];});return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x32a5f7['params']['id']}})['then'](function(_0x24ab36){return db[_0xd627('0x71')][_0xd627('0x72')](function(_0x5e5d0b){return _0x24ab36['addTeams'](_0x547368,{'transaction':_0x5e5d0b})[_0xd627('0x34')](function(){return BPromise[_0xd627('0x73')](_0x157048,function(_0x6c052b){return db['TeamVoiceQueue'][_0xd627('0x74')]({'TeamId':_0x6c052b['id'],'VoiceQueueId':_0x32a5f7[_0xd627('0x5b')]['id'],'penalty':_0x6c052b['penalty']},{'transaction':_0x5e5d0b});});})['then'](function(){return BPromise[_0xd627('0x73')](_0x184773,function(_0xcafc1d){return db[_0xd627('0x75')][_0xd627('0x76')]({'where':{'UserId':_0xcafc1d['id'],'VoiceQueueId':_0x32a5f7[_0xd627('0x5b')]['id']},'defaults':{'penalty':_0xcafc1d['penalty']},'transaction':_0x5e5d0b});});})[_0xd627('0x34')](function(){return BPromise[_0xd627('0x73')](_[_0xd627('0x2e')](_0x184773,{'online':!![]}),function(_0x3c6a39){return db[_0xd627('0x77')][_0xd627('0x74')]({'membername':_0x3c6a39[_0xd627('0x36')],'UserId':_0x3c6a39['id'],'queue_name':_0x24ab36[_0xd627('0x36')],'VoiceQueueId':_0x24ab36['id'],'interface':_[_0xd627('0x78')](_0x3c6a39[_0xd627('0x79')])?util[_0xd627('0x7a')]('SIP/%s',_0x3c6a39['name']):_0x3c6a39[_0xd627('0x79')],'paused':_0x3c6a39['voicePause']||![],'penalty':_0x3c6a39[_0xd627('0x70')]},{'transaction':_0x5e5d0b});});})[_0xd627('0x34')](function(){_0x184773[_0xd627('0x6f')](function(_0x7b707c){socket[_0xd627('0x7b')](_0xd627('0x7c'),{'UserId':_0x7b707c['id'],'VoiceQueueId':_0x24ab36['id']});});});});});}})[_0xd627('0x34')](respondWithStatusCode(_0x4214ff,null))[_0xd627('0x4f')](handleError(_0x4214ff,null));};exports['removeTeams']=function(_0x2a3a8b,_0x500884,_0x5d7c66){return db[_0xd627('0x6a')]['findAll']({'where':{'id':_0x2a3a8b[_0xd627('0x40')][_0xd627('0x7d')]},'attributes':['id'],'include':[{'model':db[_0xd627('0x7e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd627('0x34')](handleEntityNotFound(_0x500884,null))[_0xd627('0x34')](function(_0x3c681f){var _0x38ba32=_[_0xd627('0x2f')](_0x3c681f,'id');var _0x216b05=[];var _0x396f45=[];var _0x431c4e=squel['select']();_0x431c4e['field'](_0xd627('0x7f'))['from'](_0xd627('0x80'),'tq')['join'](_0xd627('0x81'),'ut',_0xd627('0x82'))['where']('VoiceQueueId\x20=\x20?',_0x2a3a8b[_0xd627('0x5b')]['id']);for(var _0x47f5ad=0x0;_0x47f5ad<_0x3c681f[_0xd627('0x42')];_0x47f5ad+=0x1){let _0xeabd4=_0x3c681f[_0x47f5ad];for(var _0x4b5e4d=0x0;_0x4b5e4d<_0xeabd4['Agents'][_0xd627('0x42')];_0x4b5e4d+=0x1){let _0x1bd135=_0xeabd4[_0xd627('0x6c')][_0x4b5e4d];var _0x3a4eb6=_0x431c4e[_0xd627('0x5a')]();_0x3a4eb6[_0xd627('0x48')](_0xd627('0x83'),_0x1bd135['id']);_0x396f45[_0xd627('0x84')](db[_0xd627('0x71')]['query'](_0x3a4eb6[_0xd627('0x85')](),{'type':db['sequelize'][_0xd627('0x86')][_0xd627('0x87')]})[_0xd627('0x34')](function(_0x4905bc){if(_0x4905bc[_0xd627('0x42')]===0x1){return _0x1bd135['id'];}else{var _0x21528d=_[_0xd627('0x88')](_['map'](_0x4905bc,_0xd627('0x89')),function(_0x2fb9db){return _['includes'](_0x38ba32,_0x2fb9db);});if(_0x21528d){return _0x1bd135['id'];}}}));}}return BPromise['all'](_0x396f45)[_0xd627('0x34')](function(_0x292b03){_0x216b05=_(_0x216b05)[_0xd627('0x8a')](_0x292b03)[_0xd627('0x8b')]()[_0xd627('0x30')]();return db['VoiceQueue']['find']({'where':{'id':_0x2a3a8b[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](function(_0x419c12){return db['sequelize'][_0xd627('0x72')](function(_0xe8f0eb){return _0x419c12[_0xd627('0x8c')](_0x2a3a8b[_0xd627('0x40')][_0xd627('0x7d')],{'transaction':_0xe8f0eb})[_0xd627('0x34')](function(){if(!_[_0xd627('0x8d')](_0x216b05)){return _0x419c12['removeAgents'](_0x216b05,{'transaction':_0xe8f0eb})[_0xd627('0x34')](function(){return db[_0xd627('0x77')][_0xd627('0x28')]({'where':{'VoiceQueueId':_0x2a3a8b['params']['id'],'UserId':_0x216b05},'transaction':_0xe8f0eb});});}})[_0xd627('0x34')](function(){_0x216b05[_0xd627('0x6f')](function(_0x377f77){socket[_0xd627('0x7b')](_0xd627('0x8e'),{'UserId':_0x377f77,'VoiceQueueId':_0x419c12['id']});});});});});});})['then'](respondWithStatusCode(_0x500884,null))[_0xd627('0x4f')](handleError(_0x500884,null));};exports[_0xd627('0x8f')]=function(_0x439af5,_0x2a4e91,_0x237f36){var _0x512674,_0x1021ea;return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x439af5[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x2a4e91,null))[_0xd627('0x34')](function(_0x4ff7fa){if(_0x4ff7fa){_0x1021ea=_0x4ff7fa;return _0x4ff7fa['addAgents'](_0x439af5[_0xd627('0x55')]['ids'],_[_0xd627('0x5c')](_0x439af5[_0xd627('0x55')],['ids','id'])||{})['spread'](function(_0x1b978f){for(var _0xe53d4a=0x0;_0xe53d4a<_0x439af5[_0xd627('0x55')]['ids'][_0xd627('0x42')];_0xe53d4a+=0x1){socket[_0xd627('0x7b')](_0xd627('0x7c'),{'UserId':Number(_0x439af5[_0xd627('0x55')][_0xd627('0x7d')][_0xe53d4a]),'VoiceQueueId':Number(_0x439af5[_0xd627('0x5b')]['id'])});}return _0x1b978f;});}})[_0xd627('0x34')](function(_0x450089){_0x512674=_0x450089||[];if(_0x1021ea){return db[_0xd627('0x7e')][_0xd627('0x4d')]({'where':{'id':_0x439af5[_0xd627('0x55')][_0xd627('0x7d')]},'attributes':['id',_0xd627('0x36'),_0xd627('0x6d'),_0xd627('0x6e'),_0xd627('0x79')],'raw':!![]});}})['then'](function(_0x489001){if(!_[_0xd627('0x8d')](_0x489001)){var _0x5578a1=[];for(var _0x1258b2=0x0;_0x1258b2<_0x489001[_0xd627('0x42')];_0x1258b2++){if(_0x489001[_0x1258b2][_0xd627('0x6d')]){_0x5578a1[_0xd627('0x84')](db[_0xd627('0x77')][_0xd627('0x74')]({'membername':_0x489001[_0x1258b2]['name'],'UserId':_0x489001[_0x1258b2]['id'],'queue_name':_0x1021ea[_0xd627('0x36')],'VoiceQueueId':_0x1021ea['id'],'interface':_[_0xd627('0x78')](_0x489001[_0x1258b2][_0xd627('0x79')])?util[_0xd627('0x7a')](_0xd627('0x90'),_0x489001[_0x1258b2]['name']):_0x489001[_0x1258b2]['interface'],'paused':_0x489001[_0x1258b2][_0xd627('0x6e')]||![],'penalty':_0x439af5[_0xd627('0x55')][_0xd627('0x70')]||0x0}));}}return BPromise[_0xd627('0x91')](_0x5578a1);}})['then'](function(){return _0x512674;})[_0xd627('0x34')](respondWithResult(_0x2a4e91,null))[_0xd627('0x4f')](handleError(_0x2a4e91,null));};exports[_0xd627('0x92')]=function(_0x1efeec,_0x5b2d2e,_0x8136d7){return db[_0xd627('0x39')]['find']({'where':{'id':_0x1efeec[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x5b2d2e,null))[_0xd627('0x34')](function(_0x4806ba){if(_0x4806ba){return _0x4806ba[_0xd627('0x92')](_0x1efeec[_0xd627('0x40')]['ids'])[_0xd627('0x34')](function(){if(_[_0xd627('0x93')](_0x1efeec[_0xd627('0x40')][_0xd627('0x7d')])){for(var _0x3f8c8e=0x0;_0x3f8c8e<_0x1efeec[_0xd627('0x40')]['ids'][_0xd627('0x42')];_0x3f8c8e+=0x1){socket[_0xd627('0x7b')](_0xd627('0x8e'),{'UserId':Number(_0x1efeec['query'][_0xd627('0x7d')][_0x3f8c8e]),'VoiceQueueId':Number(_0x1efeec['params']['id'])});}}else{socket[_0xd627('0x7b')](_0xd627('0x8e'),{'UserId':Number(_0x1efeec['query'][_0xd627('0x7d')]),'VoiceQueueId':Number(_0x1efeec[_0xd627('0x5b')]['id'])});}});}})[_0xd627('0x34')](function(_0x56ced4){return db[_0xd627('0x77')][_0xd627('0x28')]({'where':{'VoiceQueueId':_0x1efeec[_0xd627('0x5b')]['id'],'UserId':_0x1efeec[_0xd627('0x40')][_0xd627('0x7d')]}})[_0xd627('0x34')](function(){return _0x56ced4;});})[_0xd627('0x34')](respondWithStatusCode(_0x5b2d2e,null))[_0xd627('0x4f')](handleError(_0x5b2d2e,null));};exports[_0xd627('0x94')]=function(_0x21251e,_0x12a69e,_0x67e63c){var _0x377bb8={};var _0x264d4c={};var _0x325a66;var _0x495f18;return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x21251e[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x12a69e,null))[_0xd627('0x34')](function(_0x43669d){if(_0x43669d){_0x325a66=_0x43669d;_0x264d4c[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x7e')][_0xd627('0x3a')]);_0x264d4c[_0xd627('0x40')]=_['keys'](_0x21251e[_0xd627('0x40')]);_0x264d4c['filters']=_[_0xd627('0x3f')](_0x264d4c['model'],_0x264d4c[_0xd627('0x40')]);_0x377bb8[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x264d4c[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x21251e[_0xd627('0x40')]['fields']));_0x377bb8[_0xd627('0x41')]=_0x377bb8[_0xd627('0x41')][_0xd627('0x42')]?_0x377bb8[_0xd627('0x41')]:_0x264d4c[_0xd627('0x3d')];_0x377bb8[_0xd627('0x44')]=qs['sort'](_0x21251e[_0xd627('0x40')][_0xd627('0x45')]);_0x377bb8[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x21251e[_0xd627('0x40')],_0x264d4c['filters']));if(_0x21251e[_0xd627('0x40')][_0xd627('0x2e')]){_0x377bb8['where']=_[_0xd627('0x47')](_0x377bb8[_0xd627('0x48')],{'$or':_['map'](_0x377bb8['attributes'],function(_0x237240){var _0x3b78a3={};_0x3b78a3[_0x237240]={'$like':'%'+_0x21251e[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x3b78a3;})});}_0x377bb8=_[_0xd627('0x47')]({},_0x377bb8,_0x21251e['options']);return _0x325a66[_0xd627('0x94')](_0x377bb8);}})[_0xd627('0x34')](function(_0xfef092){if(_0xfef092){_0x495f18=_0xfef092[_0xd627('0x42')];if(!_0x21251e[_0xd627('0x40')][_0xd627('0x43')](_0xd627('0x63'))){_0x377bb8['limit']=qs[_0xd627('0x21')](_0x21251e[_0xd627('0x40')][_0xd627('0x21')]);_0x377bb8[_0xd627('0x1f')]=qs[_0xd627('0x1f')](_0x21251e['query'][_0xd627('0x1f')]);}return _0x325a66['getAgents'](_0x377bb8);}})[_0xd627('0x34')](function(_0xa70f88){if(_0xa70f88){return _0xa70f88?{'count':_0x495f18,'rows':_0xa70f88}:null;}})[_0xd627('0x34')](respondWithResult(_0x12a69e,null))['catch'](handleError(_0x12a69e,null));};exports['getMembers']=function(_0x37d1cf,_0x16eb0e,_0x21965b){var _0xced862={};var _0x3f208b={};var _0x7ca518;var _0x48b090;return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x37d1cf[_0xd627('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16eb0e,null))[_0xd627('0x34')](function(_0x3c736a){if(_0x3c736a){_0x7ca518=_0x3c736a;_0x3f208b[_0xd627('0x3d')]=_[_0xd627('0x51')](db['UserVoiceQueueRt']['rawAttributes']);_0x3f208b['query']=_[_0xd627('0x51')](_0x37d1cf[_0xd627('0x40')]);_0x3f208b[_0xd627('0x3e')]=_[_0xd627('0x3f')](_0x3f208b[_0xd627('0x3d')],_0x3f208b[_0xd627('0x40')]);_0xced862['attributes']=_['intersection'](_0x3f208b[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x37d1cf['query'][_0xd627('0x52')]));_0xced862['attributes']=_0xced862[_0xd627('0x41')][_0xd627('0x42')]?_0xced862[_0xd627('0x41')]:_0x3f208b[_0xd627('0x3d')];_0xced862[_0xd627('0x44')]=qs['sort'](_0x37d1cf[_0xd627('0x40')][_0xd627('0x45')]);_0xced862['where']=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x37d1cf[_0xd627('0x40')],_0x3f208b[_0xd627('0x3e')]));if(_0x37d1cf[_0xd627('0x40')][_0xd627('0x2e')]){_0xced862[_0xd627('0x48')]=_[_0xd627('0x47')](_0xced862[_0xd627('0x48')],{'$or':_[_0xd627('0x2f')](_0xced862[_0xd627('0x41')],function(_0x389d2b){var _0x536f40={};_0x536f40[_0x389d2b]={'$like':'%'+_0x37d1cf[_0xd627('0x40')]['filter']+'%'};return _0x536f40;})});}_0xced862=_[_0xd627('0x47')]({},_0xced862,_0x37d1cf['options']);return _0x7ca518[_0xd627('0x95')](_0xced862);}})[_0xd627('0x34')](function(_0x38a452){if(_0x38a452){_0x48b090=_0x38a452[_0xd627('0x42')];if(!_0x37d1cf['query'][_0xd627('0x43')]('nolimit')){_0xced862[_0xd627('0x21')]=qs[_0xd627('0x21')](_0x37d1cf[_0xd627('0x40')]['limit']);_0xced862['offset']=qs[_0xd627('0x1f')](_0x37d1cf[_0xd627('0x40')]['offset']);}return _0x7ca518['getMembers'](_0xced862);}})[_0xd627('0x34')](function(_0x486087){return _0x486087?{'count':_0x48b090,'rows':_0x486087}:null;})[_0xd627('0x34')](respondWithResult(_0x16eb0e,null))[_0xd627('0x4f')](handleError(_0x16eb0e,null));};exports['getLists']=function(_0x142265,_0x5a8421,_0x211858){var _0x365df3={};var _0x2a4393={};var _0x1de62a;var _0xa3344b;return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x142265['params']['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x5a8421,null))[_0xd627('0x34')](function(_0x4489fc){if(_0x4489fc){_0x1de62a=_0x4489fc;_0x2a4393[_0xd627('0x3d')]=_[_0xd627('0x51')](db[_0xd627('0x96')][_0xd627('0x3a')]);_0x2a4393[_0xd627('0x40')]=_[_0xd627('0x51')](_0x142265['query']);_0x2a4393[_0xd627('0x3e')]=_[_0xd627('0x3f')](_0x2a4393[_0xd627('0x3d')],_0x2a4393[_0xd627('0x40')]);_0x365df3[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x2a4393[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x142265['query'][_0xd627('0x52')]));_0x365df3[_0xd627('0x41')]=_0x365df3[_0xd627('0x41')][_0xd627('0x42')]?_0x365df3[_0xd627('0x41')]:_0x2a4393['model'];_0x365df3['order']=qs[_0xd627('0x45')](_0x142265[_0xd627('0x40')][_0xd627('0x45')]);_0x365df3[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x142265[_0xd627('0x40')],_0x2a4393[_0xd627('0x3e')]));if(_0x142265[_0xd627('0x40')][_0xd627('0x2e')]){_0x365df3['where']=_['merge'](_0x365df3['where'],{'$or':_['map'](_0x365df3[_0xd627('0x41')],function(_0x2f5f7f){var _0x22e4a4={};_0x22e4a4[_0x2f5f7f]={'$like':'%'+_0x142265[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x22e4a4;})});}_0x365df3=_[_0xd627('0x47')]({},_0x365df3,_0x142265['options']);return _0x1de62a[_0xd627('0x97')](_0x365df3);}})[_0xd627('0x34')](function(_0x264839){if(_0x264839){_0xa3344b=_0x264839[_0xd627('0x42')];if(!_0x142265[_0xd627('0x40')][_0xd627('0x43')](_0xd627('0x63'))){_0x365df3['limit']=qs[_0xd627('0x21')](_0x142265[_0xd627('0x40')]['limit']);_0x365df3['offset']=qs[_0xd627('0x1f')](_0x142265[_0xd627('0x40')][_0xd627('0x1f')]);}return _0x1de62a[_0xd627('0x97')](_0x365df3);}})['then'](function(_0x2d04ff){if(_0x2d04ff){return _0x2d04ff?{'count':_0xa3344b,'rows':_0x2d04ff}:null;}})['then'](respondWithResult(_0x5a8421,null))['catch'](handleError(_0x5a8421,null));};exports[_0xd627('0x98')]=function(_0x51e8a4,_0x36f098,_0x2c5f62){var _0x264d02,_0x5ebad6;return db['VoiceQueue'][_0xd627('0x53')]({'where':{'id':_0x51e8a4[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x36f098,null))[_0xd627('0x34')](function(_0x1fe970){if(_0x1fe970){_0x5ebad6=_0x1fe970;return _0x1fe970[_0xd627('0x98')](_0x51e8a4['body'][_0xd627('0x7d')],_[_0xd627('0x5c')](_0x51e8a4['body'],[_0xd627('0x7d'),'id'])||{});}return null;})[_0xd627('0x99')](function(_0x2e61f0){var _0x4fc733;_0x264d02=_0x2e61f0||[];var _0x4d0dd2=[];if(_0x2e61f0){for(var _0x11e6b1=0x0;_0x11e6b1<_0x2e61f0[_0xd627('0x42')];_0x11e6b1+=0x1){var _0x2715ba=_0x2e61f0[_0x11e6b1]['get']({'plain':!![]});_0x5ebad6[_0xd627('0x9a')]=_0x51e8a4[_0xd627('0x55')][_0xd627('0x9a')]?_0x51e8a4[_0xd627('0x55')][_0xd627('0x9a')]:_0x5ebad6['dialCheckDuplicateType'];switch(_0x5ebad6['dialCheckDuplicateType']){case'always':_0x4fc733=squel['insert']()[_0xd627('0x9b')]('cm_hopper')[_0xd627('0x9c')]([_0xd627('0x9d'),'scheduledAt','ContactId',_0xd627('0x9e'),_0xd627('0x64'),_0xd627('0x5d'),_0xd627('0x5e')],squel['select']()[_0xd627('0x9f')](_0xd627('0x9d'),_0xd627('0x9d'))[_0xd627('0x9f')](_0xd627('0xa0'),_0xd627('0xa1'))[_0xd627('0x9f')]('id',_0xd627('0xa2'))[_0xd627('0x9f')](_0x2715ba[_0xd627('0xa3')]['toString'](),_0xd627('0x9e'))[_0xd627('0x9f')](_0x51e8a4[_0xd627('0x5b')]['id'][_0xd627('0x85')](),_0xd627('0x64'))[_0xd627('0x9f')](_0xd627('0xa0'),_0xd627('0x5d'))['field'](_0xd627('0xa0'),_0xd627('0x5e'))[_0xd627('0xa4')](_0xd627('0xa5'))['where'](_0xd627('0xa6'))['where'](_0xd627('0xa7'),_0x2715ba[_0xd627('0xa3')][_0xd627('0x85')]())[_0xd627('0x48')](_0xd627('0xa8'))[_0xd627('0x48')](_0xd627('0xa9'),squel[_0xd627('0xaa')]()[_0xd627('0x9f')](_0xd627('0xab'))['from']('cm_hopper_final')['where'](_0xd627('0xac'),_0x51e8a4[_0xd627('0x5b')]['id'][_0xd627('0x85')]()))[_0xd627('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd627('0xaa')]()[_0xd627('0x9f')](_0xd627('0xad'))[_0xd627('0xa4')](_0xd627('0xae'))[_0xd627('0x48')](_0xd627('0xac'),_0x51e8a4['params']['id'][_0xd627('0x85')]())))[_0xd627('0x85')]();break;case'onlyIfOpen':_0x4fc733=squel['insert']()['into']('cm_hopper')[_0xd627('0x9c')]([_0xd627('0x9d'),_0xd627('0xa1'),_0xd627('0xa2'),_0xd627('0x9e'),_0xd627('0x64'),_0xd627('0x5d'),_0xd627('0x5e')],squel[_0xd627('0xaa')]()[_0xd627('0x9f')](_0xd627('0x9d'),_0xd627('0x9d'))[_0xd627('0x9f')](_0xd627('0xa0'),_0xd627('0xa1'))[_0xd627('0x9f')]('id',_0xd627('0xa2'))[_0xd627('0x9f')](_0x2715ba[_0xd627('0xa3')][_0xd627('0x85')](),_0xd627('0x9e'))[_0xd627('0x9f')](_0x51e8a4[_0xd627('0x5b')]['id'][_0xd627('0x85')](),_0xd627('0x64'))[_0xd627('0x9f')]('NOW()',_0xd627('0x5d'))[_0xd627('0x9f')]('NOW()',_0xd627('0x5e'))[_0xd627('0xa4')](_0xd627('0xa5'))['where']('deletedAt\x20IS\x20NULL')[_0xd627('0x48')](_0xd627('0xa7'),_0x2715ba[_0xd627('0xa3')][_0xd627('0x85')]())[_0xd627('0x48')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd627('0xa9'),squel['select']()[_0xd627('0x9f')]('COALESCE(phone,\x27\x27)')['from'](_0xd627('0xae'))['where'](_0xd627('0xac'),_0x51e8a4[_0xd627('0x5b')]['id'][_0xd627('0x85')]())))[_0xd627('0x85')]();break;default:_0x4fc733=squel[_0xd627('0xaf')]()[_0xd627('0x9b')]('cm_hopper')['fromQuery']([_0xd627('0x9d'),'scheduledAt',_0xd627('0xa2'),_0xd627('0x9e'),_0xd627('0x64'),_0xd627('0x5d'),_0xd627('0x5e')],squel[_0xd627('0xaa')]()[_0xd627('0x9f')](_0xd627('0x9d'),'phone')[_0xd627('0x9f')]('NOW()',_0xd627('0xa1'))['field']('id','ContactId')[_0xd627('0x9f')](_0x2715ba['CmListId'][_0xd627('0x85')](),'ListId')[_0xd627('0x9f')](_0x51e8a4['params']['id'][_0xd627('0x85')](),_0xd627('0x64'))[_0xd627('0x9f')](_0xd627('0xa0'),'createdAt')[_0xd627('0x9f')](_0xd627('0xa0'),'updatedAt')[_0xd627('0xa4')](_0xd627('0xa5'))[_0xd627('0x48')](_0xd627('0xa6'))[_0xd627('0x48')](_0xd627('0xa7'),_0x2715ba[_0xd627('0xa3')][_0xd627('0x85')]())['where'](_0xd627('0xa8')))[_0xd627('0x85')]();}_0x4d0dd2[_0xd627('0x84')](db['sequelize'][_0xd627('0x40')](_0x4fc733));}return BPromise['all'](_0x4d0dd2);}})[_0xd627('0x34')](function(){return _0x264d02;})[_0xd627('0x34')](respondWithResult(_0x36f098,null))[_0xd627('0x4f')](handleError(_0x36f098,null));};exports['removeLists']=function(_0x1680c9,_0x46725a,_0x2f6227){return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x1680c9['params']['id']}})['then'](handleEntityNotFound(_0x46725a,null))['then'](function(_0xc57479){if(_0xc57479){return _0xc57479[_0xd627('0xb0')](_0x1680c9['query']['ids']);}})[_0xd627('0x34')](function(_0xb7a2c){if(_0xb7a2c){return db[_0xd627('0x62')][_0xd627('0x28')]({'where':{'ListId':_0x1680c9[_0xd627('0x40')]['ids'],'VoiceQueueId':_0x1680c9[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](function(){return _0xb7a2c;});}})[_0xd627('0x34')](respondWithStatusCode(_0x46725a,null))[_0xd627('0x4f')](handleError(_0x46725a,null));};exports[_0xd627('0xb1')]=function(_0x20b041,_0x5adfcc,_0x25cb91){var _0x4f5d9e={};var _0x5e4566={};var _0xc90360;var _0x221567;return db[_0xd627('0x39')][_0xd627('0x61')]({'where':{'id':_0x20b041[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x5adfcc,null))[_0xd627('0x34')](function(_0x56531e){if(_0x56531e){_0xc90360=_0x56531e;_0x5e4566['model']=_[_0xd627('0x51')](db[_0xd627('0x96')]['rawAttributes']);_0x5e4566[_0xd627('0x40')]=_['keys'](_0x20b041[_0xd627('0x40')]);_0x5e4566['filters']=_[_0xd627('0x3f')](_0x5e4566['model'],_0x5e4566[_0xd627('0x40')]);_0x4f5d9e[_0xd627('0x41')]=_[_0xd627('0x3f')](_0x5e4566[_0xd627('0x3d')],qs[_0xd627('0x52')](_0x20b041[_0xd627('0x40')]['fields']));_0x4f5d9e[_0xd627('0x41')]=_0x4f5d9e[_0xd627('0x41')][_0xd627('0x42')]?_0x4f5d9e['attributes']:_0x5e4566[_0xd627('0x3d')];_0x4f5d9e[_0xd627('0x44')]=qs['sort'](_0x20b041[_0xd627('0x40')][_0xd627('0x45')]);_0x4f5d9e[_0xd627('0x48')]=qs[_0xd627('0x3e')](_[_0xd627('0x46')](_0x20b041[_0xd627('0x40')],_0x5e4566[_0xd627('0x3e')]));if(_0x20b041['query'][_0xd627('0x2e')]){_0x4f5d9e['where']=_['merge'](_0x4f5d9e[_0xd627('0x48')],{'$or':_[_0xd627('0x2f')](_0x4f5d9e[_0xd627('0x41')],function(_0x3acacb){var _0x4c0362={};_0x4c0362[_0x3acacb]={'$like':'%'+_0x20b041[_0xd627('0x40')][_0xd627('0x2e')]+'%'};return _0x4c0362;})});}_0x4f5d9e=_[_0xd627('0x47')]({},_0x4f5d9e,_0x20b041[_0xd627('0x4a')]);return _0xc90360[_0xd627('0xb1')](_0x4f5d9e);}})[_0xd627('0x34')](function(_0x2a7cb4){if(_0x2a7cb4){_0x221567=_0x2a7cb4[_0xd627('0x42')];if(!_0x20b041['query'][_0xd627('0x43')]('nolimit')){_0x4f5d9e['limit']=qs[_0xd627('0x21')](_0x20b041['query'][_0xd627('0x21')]);_0x4f5d9e[_0xd627('0x1f')]=qs[_0xd627('0x1f')](_0x20b041['query']['offset']);}return _0xc90360[_0xd627('0xb1')](_0x4f5d9e);}})[_0xd627('0x34')](function(_0x5c0430){if(_0x5c0430){return _0x5c0430?{'count':_0x221567,'rows':_0x5c0430}:null;}})[_0xd627('0x34')](respondWithResult(_0x5adfcc,null))[_0xd627('0x4f')](handleError(_0x5adfcc,null));};exports[_0xd627('0xb2')]=function(_0x314d47,_0x2e86bb,_0x3e9dc7){var _0x366582,_0x55c3b9;return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x314d47[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x2e86bb,null))[_0xd627('0x34')](function(_0x201bc3){if(_0x201bc3){_0x55c3b9=_0x201bc3;return _0x201bc3[_0xd627('0xb2')](_0x314d47[_0xd627('0x55')][_0xd627('0x7d')],_[_0xd627('0x5c')](_0x314d47['body'],[_0xd627('0x7d'),'id'])||{});}return null;})[_0xd627('0x99')](function(_0x286ba1){var _0x479852;_0x366582=_0x286ba1||[];var _0x2dd8f2=[];if(_0x286ba1){for(var _0x2368b9=0x0;_0x2368b9<_0x286ba1['length'];_0x2368b9+=0x1){var _0x188ca5=_0x286ba1[_0x2368b9]['get']({'plain':!![]});_0x479852=squel[_0xd627('0xaf')]()[_0xd627('0x9b')]('cm_hopper_black')['fromQuery'](['phone',_0xd627('0xa2'),_0xd627('0x9e'),'VoiceQueueId','createdAt',_0xd627('0x5e')],squel[_0xd627('0xaa')]()[_0xd627('0x9f')]('phone',_0xd627('0x9d'))[_0xd627('0x9f')]('id',_0xd627('0xa2'))[_0xd627('0x9f')](_0x188ca5[_0xd627('0xa3')][_0xd627('0x85')](),_0xd627('0x9e'))['field'](_0x314d47[_0xd627('0x5b')]['id'][_0xd627('0x85')](),_0xd627('0x64'))[_0xd627('0x9f')](_0xd627('0xa0'),_0xd627('0x5d'))[_0xd627('0x9f')](_0xd627('0xa0'),'updatedAt')[_0xd627('0xa4')](_0xd627('0xa5'))[_0xd627('0x48')]('deletedAt\x20IS\x20NULL')[_0xd627('0x48')](_0xd627('0xa7'),_0x188ca5[_0xd627('0xa3')][_0xd627('0x85')]())[_0xd627('0x48')](_0xd627('0xa8')))[_0xd627('0x85')]();_0x2dd8f2[_0xd627('0x84')](db['sequelize'][_0xd627('0x40')](_0x479852));}return BPromise[_0xd627('0x91')](_0x2dd8f2);}})[_0xd627('0x34')](function(){return _0x366582;})[_0xd627('0x34')](respondWithResult(_0x2e86bb,null))[_0xd627('0x4f')](handleError(_0x2e86bb,null));};exports['removeBlackLists']=function(_0x188d40,_0x1a7ed3,_0x1adca4){return db[_0xd627('0x39')][_0xd627('0x53')]({'where':{'id':_0x188d40['params']['id']}})[_0xd627('0x34')](handleEntityNotFound(_0x1a7ed3,null))['then'](function(_0x4232c1){if(_0x4232c1){return _0x4232c1[_0xd627('0xb3')](_0x188d40[_0xd627('0x40')][_0xd627('0x7d')]);}})['then'](function(_0x29da64){if(_0x29da64){return db[_0xd627('0xb4')][_0xd627('0x28')]({'where':{'ListId':_0x188d40[_0xd627('0x40')][_0xd627('0x7d')],'VoiceQueueId':_0x188d40[_0xd627('0x5b')]['id']}})[_0xd627('0x34')](function(){return _0x29da64;});}})[_0xd627('0x34')](respondWithStatusCode(_0x1a7ed3,null))[_0xd627('0x4f')](handleError(_0x1a7ed3,null));}; \ No newline at end of file +var _0x9c74=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','includes','type','value','name','UserProfileResource','error','stack','index','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','options','where','VoiceQueue','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','createdAt','findOne','nolimit','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','isNil','emit','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','removeAgents','forEach','addAgents','omit','spread','userVoiceQueue:save','online','isEmpty','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','ContactId','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','mustache'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x9c74,0x16b));var _0x49c7=function(_0x36b5be,_0x25cbb9){_0x36b5be=_0x36b5be-0x0;var _0x186b09=_0x9c74[_0x36b5be];return _0x186b09;};'use strict';var emlformat=require(_0x49c7('0x0'));var rimraf=require(_0x49c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49c7('0x2'));var rp=require(_0x49c7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49c7('0x4'));var util=require('util');var path=require(_0x49c7('0x5'));var sox=require('sox');var csv=require(_0x49c7('0x6'));var ejs=require(_0x49c7('0x7'));var fs=require('fs');var fs_extra=require(_0x49c7('0x8'));var _=require(_0x49c7('0x9'));var squel=require('squel');var crypto=require(_0x49c7('0xa'));var jsforce=require(_0x49c7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x49c7('0x6'));var querystring=require(_0x49c7('0xc'));var Papa=require(_0x49c7('0xd'));var Redis=require(_0x49c7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x49c7('0xf'));var as=require(_0x49c7('0x10'));var hardwareService=require(_0x49c7('0x11'));var logger=require('../../config/logger')(_0x49c7('0x12'));var utils=require(_0x49c7('0x13'));var config=require(_0x49c7('0x14'));var licenseUtil=require(_0x49c7('0x15'));var db=require(_0x49c7('0x16'))['db'];config[_0x49c7('0x17')]=_[_0x49c7('0x18')](config[_0x49c7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c7('0x19'))(new Redis(config[_0x49c7('0x17')]));require(_0x49c7('0x1a'))['register'](socket);function respondWithStatusCode(_0x437cca,_0x3a529c){_0x3a529c=_0x3a529c||0xcc;return function(_0x2cd517){if(_0x2cd517){return _0x437cca[_0x49c7('0x1b')](_0x3a529c);}return _0x437cca['status'](_0x3a529c)[_0x49c7('0x1c')]();};}function respondWithResult(_0x3467ff,_0x5b9d9a){_0x5b9d9a=_0x5b9d9a||0xc8;return function(_0x49b765){if(_0x49b765){return _0x3467ff[_0x49c7('0x1d')](_0x5b9d9a)[_0x49c7('0x1e')](_0x49b765);}};}function respondWithFilteredResult(_0x42d2c1,_0x536cdd){return function(_0x9dcff2){if(_0x9dcff2){var _0x1adb0e=typeof _0x536cdd[_0x49c7('0x1f')]===_0x49c7('0x20')&&typeof _0x536cdd['limit']===_0x49c7('0x20');var _0x4adf2a=_0x9dcff2[_0x49c7('0x21')];var _0x4e5d0c=_0x1adb0e?0x0:_0x536cdd[_0x49c7('0x1f')];var _0x4f555c=_0x1adb0e?_0x9dcff2[_0x49c7('0x21')]:_0x536cdd[_0x49c7('0x1f')]+_0x536cdd[_0x49c7('0x22')];var _0x448ac3;if(_0x4f555c>=_0x4adf2a){_0x4f555c=_0x4adf2a;_0x448ac3=0xc8;}else{_0x448ac3=0xce;}_0x42d2c1[_0x49c7('0x1d')](_0x448ac3);return _0x42d2c1[_0x49c7('0x23')](_0x49c7('0x24'),_0x4e5d0c+'-'+_0x4f555c+'/'+_0x4adf2a)[_0x49c7('0x1e')](_0x9dcff2);}return null;};}function patchUpdates(_0x4b2713){return function(_0x5c9281){try{jsonpatch['apply'](_0x5c9281,_0x4b2713,!![]);}catch(_0x995e71){return BPromise[_0x49c7('0x25')](_0x995e71);}return _0x5c9281[_0x49c7('0x26')]();};}function saveUpdates(_0x358bee,_0x271682){return function(_0x3d1590){if(_0x3d1590){return _0x3d1590[_0x49c7('0x27')](_0x358bee)[_0x49c7('0x28')](function(_0x1612b0){return _0x1612b0;});}return null;};}function removeEntity(_0xe3f8a6,_0x3c1785){return function(_0x5967c6){if(_0x5967c6){return _0x5967c6[_0x49c7('0x29')]()[_0x49c7('0x28')](function(){var _0x228ebf=_0x5967c6[_0x49c7('0x2a')]({'plain':!![]});var _0x275c06=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c'),'ignore':![]},{'name':_0x49c7('0x2d'),'value':_0x49c7('0x2e'),'ignore':![]}];var _0x62d1e6=_(_0x275c06)[_0x49c7('0x2f')](_0x49c7('0x30'))[_0x49c7('0x31')]('value')['value']();if(_[_0x49c7('0x32')](_0x62d1e6,_0x228ebf[_0x49c7('0x33')])){return;}var _0xba6903=_['find'](_0x275c06,[_0x49c7('0x34'),_0x228ebf[_0x49c7('0x33')]])[_0x49c7('0x35')];return db[_0x49c7('0x36')][_0x49c7('0x29')]({'where':{'type':_0xba6903,'resourceId':_0x228ebf['id']}})[_0x49c7('0x28')](function(){return _0x5967c6;});})[_0x49c7('0x28')](function(){_0xe3f8a6[_0x49c7('0x1d')](0xcc)[_0x49c7('0x1c')]();});}};}function handleEntityNotFound(_0xbb779f,_0x579346){return function(_0x55b68d){if(!_0x55b68d){_0xbb779f[_0x49c7('0x1b')](0x194);}return _0x55b68d;};}function handleError(_0x15aac4,_0x5b8d33){_0x5b8d33=_0x5b8d33||0x1f4;return function(_0xb2961f){logger[_0x49c7('0x37')](_0xb2961f[_0x49c7('0x38')]);if(_0xb2961f['name']){delete _0xb2961f[_0x49c7('0x35')];}_0x15aac4[_0x49c7('0x1d')](_0x5b8d33)['send'](_0xb2961f);};}exports[_0x49c7('0x39')]=function(_0x22e276,_0x54edb1){var _0x5c21e5={},_0x4129db={},_0x3ed28c={'count':0x0,'rows':[]};var _0x49b016=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x1d086e){return{'name':_0x1d086e[_0x49c7('0x3a')],'type':_0x1d086e[_0x49c7('0x33')][_0x49c7('0x3b')]};});_0x4129db[_0x49c7('0x3c')]=_[_0x49c7('0x31')](_0x49b016,_0x49c7('0x35'));_0x4129db[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x22e276[_0x49c7('0x3d')]);_0x4129db[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x4129db[_0x49c7('0x3c')],_0x4129db[_0x49c7('0x3d')]);_0x5c21e5[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x4129db[_0x49c7('0x3c')],qs['fields'](_0x22e276[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x5c21e5[_0x49c7('0x41')]=_0x5c21e5[_0x49c7('0x41')][_0x49c7('0x43')]?_0x5c21e5[_0x49c7('0x41')]:_0x4129db[_0x49c7('0x3c')];if(!_0x22e276[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x5c21e5[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x22e276[_0x49c7('0x3d')]['limit']);_0x5c21e5[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x22e276[_0x49c7('0x3d')]['offset']);}_0x5c21e5[_0x49c7('0x45')]=qs['sort'](_0x22e276[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x5c21e5['where']=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x22e276['query'],_0x4129db[_0x49c7('0x3f')]),_0x49b016);if(_0x22e276['query'][_0x49c7('0x2f')]){_0x5c21e5['where']=_[_0x49c7('0x48')](_0x5c21e5['where'],{'$or':_[_0x49c7('0x31')](_0x49b016,function(_0xfebd4c){if(_0xfebd4c[_0x49c7('0x33')]!==_0x49c7('0x49')){var _0x5824f2={};_0x5824f2[_0xfebd4c[_0x49c7('0x35')]]={'$like':'%'+_0x22e276[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x5824f2;}})});}_0x5c21e5=_[_0x49c7('0x48')]({},_0x5c21e5,_0x22e276[_0x49c7('0x4a')]);var _0x18a540={'where':_0x5c21e5[_0x49c7('0x4b')]};return db[_0x49c7('0x4c')][_0x49c7('0x21')](_0x18a540)[_0x49c7('0x28')](function(_0x2e69b6){_0x3ed28c['count']=_0x2e69b6;if(_0x22e276[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x5c21e5[_0x49c7('0x4e')]=[{'all':!![]}];}return db['VoiceQueue'][_0x49c7('0x4f')](_0x5c21e5);})['then'](function(_0x1b9ab8){_0x3ed28c[_0x49c7('0x50')]=_0x1b9ab8;return _0x3ed28c;})[_0x49c7('0x28')](respondWithFilteredResult(_0x54edb1,_0x5c21e5))[_0x49c7('0x51')](handleError(_0x54edb1,null));};exports[_0x49c7('0x52')]=function(_0x32f1b4,_0x188699){var _0x3660f9={'raw':![],'where':{'id':_0x32f1b4['params']['id']}},_0x599061={};_0x599061[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x4c')][_0x49c7('0x53')]);_0x599061['query']=_[_0x49c7('0x3e')](_0x32f1b4[_0x49c7('0x3d')]);_0x599061[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x599061[_0x49c7('0x3c')],_0x599061[_0x49c7('0x3d')]);_0x3660f9['attributes']=_[_0x49c7('0x40')](_0x599061[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x32f1b4[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3660f9[_0x49c7('0x41')]=_0x3660f9[_0x49c7('0x41')]['length']?_0x3660f9[_0x49c7('0x41')]:_0x599061[_0x49c7('0x3c')];if(_0x32f1b4[_0x49c7('0x3d')]['includeAll']){_0x3660f9[_0x49c7('0x4e')]=[{'all':!![]}];}_0x3660f9=_[_0x49c7('0x48')]({},_0x3660f9,_0x32f1b4['options']);return db[_0x49c7('0x4c')]['find'](_0x3660f9)[_0x49c7('0x28')](handleEntityNotFound(_0x188699,null))[_0x49c7('0x28')](respondWithResult(_0x188699,null))[_0x49c7('0x51')](handleError(_0x188699,null));};exports['create']=function(_0x471546,_0x56ba24){return db[_0x49c7('0x4c')][_0x49c7('0x54')](_0x471546[_0x49c7('0x55')],{})['then'](function(_0x47145e){var _0x380532=_0x471546['user'][_0x49c7('0x2a')]({'plain':!![]});if(!_0x380532)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x380532[_0x49c7('0x56')]===_0x49c7('0x57')){var _0x2f4732=_0x47145e[_0x49c7('0x2a')]({'plain':!![]});var _0x152658=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c')},{'name':_0x49c7('0x2d'),'value':_0x49c7('0x2e')}];var _0x3e2cd3=_['find'](_0x152658,[_0x49c7('0x34'),_0x2f4732[_0x49c7('0x33')]])[_0x49c7('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x3e2cd3,'userProfileId':_0x380532[_0x49c7('0x58')]},'raw':!![]})[_0x49c7('0x28')](function(_0x1e8cca){if(_0x1e8cca&&_0x1e8cca[_0x49c7('0x59')]===0x0){return db[_0x49c7('0x36')][_0x49c7('0x54')]({'name':_0x2f4732[_0x49c7('0x35')],'resourceId':_0x2f4732['id'],'type':_0x1e8cca[_0x49c7('0x35')],'sectionId':_0x1e8cca['id']},{})['then'](function(){return _0x47145e;});}else{return _0x47145e;}})['catch'](function(_0x586c21){logger['error'](_0x49c7('0x5a'),_0x586c21);throw _0x586c21;});}return _0x47145e;})[_0x49c7('0x28')](respondWithResult(_0x56ba24,0xc9))[_0x49c7('0x51')](handleError(_0x56ba24,null));};exports[_0x49c7('0x5b')]=function(_0x251f5f,_0x5c7b08){var _0x5f0c5c={'where':{'id':_0x251f5f[_0x49c7('0x5c')]['id']}},_0x129ecb={};_0x129ecb[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['VoiceQueue'][_0x49c7('0x53')]);_0x5f0c5c['attributes']=_['intersection'](_0x129ecb[_0x49c7('0x3c')],qs['fields'](_0x251f5f[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x5f0c5c[_0x49c7('0x41')]=_0x5f0c5c['attributes']['length']?_0x5f0c5c[_0x49c7('0x41')]:_0x129ecb[_0x49c7('0x3c')];if(_0x251f5f[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x5f0c5c[_0x49c7('0x4e')]=[{'all':!![]}];}_0x5f0c5c=_['merge']({},_0x5f0c5c,_0x251f5f[_0x49c7('0x4a')]);return db[_0x49c7('0x4c')][_0x49c7('0x5d')](_0x5f0c5c)[_0x49c7('0x28')](handleEntityNotFound(_0x5c7b08,null))[_0x49c7('0x28')](function(_0x417184){if(_0x417184){var _0x584cbb=_0x417184[_0x49c7('0x2a')]({'plain':!![]});_0x584cbb=qs['omit'](_0x584cbb,['id',_0x49c7('0x5e'),'updatedAt']);_0x251f5f[_0x49c7('0x55')]=_['omit'](_0x251f5f[_0x49c7('0x55')],['id',_0x49c7('0x5e'),'updatedAt']);return db[_0x49c7('0x4c')][_0x49c7('0x54')](_[_0x49c7('0x48')](_0x584cbb,_0x251f5f[_0x49c7('0x55')]),{'include':_0x251f5f['query']['includeAll']?[{'all':!![]}]:undefined})[_0x49c7('0x28')](function(_0x34bdf3){var _0x207cee=_0x251f5f[_0x49c7('0x57')][_0x49c7('0x2a')]({'plain':!![]});if(!_0x207cee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x207cee[_0x49c7('0x56')]===_0x49c7('0x57')){var _0xb44630=_0x34bdf3[_0x49c7('0x2a')]({'plain':!![]});var _0x5e5ba7=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c')},{'name':'QueueCampaigns','value':_0x49c7('0x2e')}];var _0x5f7d12=_[_0x49c7('0x5d')](_0x5e5ba7,[_0x49c7('0x34'),_0xb44630[_0x49c7('0x33')]])[_0x49c7('0x35')];return db['UserProfileSection'][_0x49c7('0x5d')]({'where':{'name':_0x5f7d12,'userProfileId':_0x207cee[_0x49c7('0x58')]},'raw':!![]})[_0x49c7('0x28')](function(_0x41af3e){if(_0x41af3e&&_0x41af3e[_0x49c7('0x59')]===0x0){return db[_0x49c7('0x36')][_0x49c7('0x54')]({'name':_0xb44630['name'],'resourceId':_0xb44630['id'],'type':_0x41af3e[_0x49c7('0x35')],'sectionId':_0x41af3e['id']},{})[_0x49c7('0x28')](function(){return _0x34bdf3;});}else{return _0x34bdf3;}})['catch'](function(_0x3e0e0b){logger[_0x49c7('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e0e0b);throw _0x3e0e0b;});}return _0x34bdf3;});}})[_0x49c7('0x28')](respondWithResult(_0x5c7b08,0xc9))[_0x49c7('0x51')](handleError(_0x5c7b08,null));};exports[_0x49c7('0x27')]=function(_0x146d30,_0x21f202){if(_0x146d30[_0x49c7('0x55')]['id']){delete _0x146d30[_0x49c7('0x55')]['id'];}return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x146d30[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x21f202,null))[_0x49c7('0x28')](saveUpdates(_0x146d30[_0x49c7('0x55')],null))[_0x49c7('0x28')](respondWithResult(_0x21f202,null))[_0x49c7('0x51')](handleError(_0x21f202,null));};exports[_0x49c7('0x29')]=function(_0x308d9c,_0x27a013){return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x308d9c[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x27a013,null))[_0x49c7('0x28')](removeEntity(_0x27a013,null))[_0x49c7('0x51')](handleError(_0x27a013,null));};exports['getHoppers']=function(_0xb256e2,_0x52816b,_0x26374d){var _0x3fcb02={'raw':![],'where':{}};var _0x335913={};var _0x39ed90={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0xb256e2['params']['id']}})['then'](handleEntityNotFound(_0x52816b,null))[_0x49c7('0x28')](function(_0x27f641){if(_0x27f641){_0x335913[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['CmHopper'][_0x49c7('0x53')]);_0x335913['query']=_['keys'](_0xb256e2[_0x49c7('0x3d')]);_0x335913[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x335913[_0x49c7('0x3c')],_0x335913[_0x49c7('0x3d')]);_0x3fcb02[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x335913[_0x49c7('0x3c')],qs['fields'](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3fcb02['attributes']=_0x3fcb02[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3fcb02[_0x49c7('0x41')]:_0x335913['model'];if(!_0xb256e2[_0x49c7('0x3d')]['hasOwnProperty'](_0x49c7('0x60'))){_0x3fcb02['limit']=qs['limit'](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3fcb02[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0xb256e2['query'][_0x49c7('0x1f')]);}_0x3fcb02['order']=qs[_0x49c7('0x46')](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3fcb02['where']=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0xb256e2[_0x49c7('0x3d')],_0x335913['filters']));_0x3fcb02[_0x49c7('0x4b')][_0x49c7('0x61')]=_0x27f641['id'];if(_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3fcb02[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3fcb02[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x3fcb02[_0x49c7('0x41')],function(_0x2f0596){var _0x23e2d={};_0x23e2d[_0x2f0596]={'$like':'%'+_0xb256e2[_0x49c7('0x3d')]['filter']+'%'};return _0x23e2d;})});}_0x3fcb02=_[_0x49c7('0x48')]({},_0x3fcb02,_0xb256e2[_0x49c7('0x4a')]);return db[_0x49c7('0x62')][_0x49c7('0x21')]({'where':_0x3fcb02['where']})[_0x49c7('0x28')](function(_0x323a1b){_0x39ed90['count']=_0x323a1b;if(_0xb256e2['query']['includeAll']){_0x3fcb02['include']=[{'all':!![]}];}return db[_0x49c7('0x62')]['findAll'](_0x3fcb02);})['then'](function(_0x4e13e5){_0x39ed90[_0x49c7('0x50')]=_0x4e13e5;return _0x39ed90;});}})['then'](respondWithFilteredResult(_0x52816b,_0x3fcb02))[_0x49c7('0x51')](handleError(_0x52816b,null));};exports[_0x49c7('0x63')]=function(_0x31a8b7,_0x49f0a2,_0x2ebe8d){var _0x3f80ad={'raw':!![],'where':{}};var _0x545b0c={};var _0xd14a46={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x31a8b7[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x49f0a2,null))['then'](function(_0x2c584a){if(_0x2c584a){_0x545b0c[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x64')]['rawAttributes']);_0x545b0c[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x31a8b7['query']);_0x545b0c['filters']=_['intersection'](_0x545b0c[_0x49c7('0x3c')],_0x545b0c[_0x49c7('0x3d')]);_0x3f80ad[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x545b0c['model'],qs['fields'](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3f80ad['attributes']=_0x3f80ad[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3f80ad[_0x49c7('0x41')]:_0x545b0c['model'];if(!_0x31a8b7['query']['hasOwnProperty'](_0x49c7('0x60'))){_0x3f80ad[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3f80ad[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x1f')]);}_0x3f80ad[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3f80ad[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x31a8b7[_0x49c7('0x3d')],_0x545b0c[_0x49c7('0x3f')]));_0x3f80ad[_0x49c7('0x4b')][_0x49c7('0x61')]=_0x2c584a['id'];if(_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3f80ad[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3f80ad['where'],{'$or':_[_0x49c7('0x31')](_0x3f80ad['attributes'],function(_0x478518){var _0x452fcc={};_0x452fcc[_0x478518]={'$like':'%'+_0x31a8b7[_0x49c7('0x3d')]['filter']+'%'};return _0x452fcc;})});}_0x3f80ad=_[_0x49c7('0x48')]({},_0x3f80ad,_0x31a8b7[_0x49c7('0x4a')]);return db[_0x49c7('0x64')][_0x49c7('0x21')]({'where':_0x3f80ad[_0x49c7('0x4b')]})[_0x49c7('0x28')](function(_0x492a6a){_0xd14a46[_0x49c7('0x21')]=_0x492a6a;if(_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x3f80ad[_0x49c7('0x4e')]=[{'all':!![]}];}return db[_0x49c7('0x64')][_0x49c7('0x4f')](_0x3f80ad);})[_0x49c7('0x28')](function(_0x4a363e){_0xd14a46[_0x49c7('0x50')]=_0x4a363e;return _0xd14a46;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x49f0a2,_0x3f80ad))[_0x49c7('0x51')](handleError(_0x49f0a2,null));};exports['getHopperFinals']=function(_0x57b99e,_0x2f43be,_0x5c1a1b){var _0x9e3166={'raw':!![],'where':{}};var _0x1d72e2={};var _0x422d89={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')]['findOne']({'where':{'id':_0x57b99e[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x2f43be,null))[_0x49c7('0x28')](function(_0x28aa2f){if(_0x28aa2f){_0x1d72e2['model']=_['keys'](db[_0x49c7('0x65')][_0x49c7('0x53')]);_0x1d72e2[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x57b99e['query']);_0x1d72e2[_0x49c7('0x3f')]=_['intersection'](_0x1d72e2['model'],_0x1d72e2[_0x49c7('0x3d')]);_0x9e3166[_0x49c7('0x41')]=_['intersection'](_0x1d72e2[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x9e3166[_0x49c7('0x41')]=_0x9e3166[_0x49c7('0x41')]['length']?_0x9e3166[_0x49c7('0x41')]:_0x1d72e2[_0x49c7('0x3c')];if(!_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x9e3166[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x57b99e['query'][_0x49c7('0x22')]);_0x9e3166[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x57b99e['query']['offset']);}_0x9e3166[_0x49c7('0x45')]=qs['sort'](_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x9e3166[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x57b99e[_0x49c7('0x3d')],_0x1d72e2['filters']));_0x9e3166[_0x49c7('0x4b')]['VoiceQueueId']=_0x28aa2f['id'];if(_0x57b99e['query'][_0x49c7('0x2f')]){_0x9e3166['where']=_['merge'](_0x9e3166[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x9e3166[_0x49c7('0x41')],function(_0x1f77c0){var _0x46b434={};_0x46b434[_0x1f77c0]={'$like':'%'+_0x57b99e['query'][_0x49c7('0x2f')]+'%'};return _0x46b434;})});}_0x9e3166=_[_0x49c7('0x48')]({},_0x9e3166,_0x57b99e[_0x49c7('0x4a')]);return db[_0x49c7('0x65')][_0x49c7('0x21')]({'where':_0x9e3166[_0x49c7('0x4b')]})[_0x49c7('0x28')](function(_0x2f5d13){_0x422d89[_0x49c7('0x21')]=_0x2f5d13;if(_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x9e3166[_0x49c7('0x4e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x49c7('0x4f')](_0x9e3166);})[_0x49c7('0x28')](function(_0x5b0e44){_0x422d89[_0x49c7('0x50')]=_0x5b0e44;return _0x422d89;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x2f43be,_0x9e3166))[_0x49c7('0x51')](handleError(_0x2f43be,null));};exports[_0x49c7('0x66')]=function(_0x3de67a,_0x589805,_0x21c602){var _0x3081be={'raw':!![],'where':{}};var _0x1380a9={};var _0x1972bd={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x3de67a[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x589805,null))[_0x49c7('0x28')](function(_0x12745a){if(_0x12745a){_0x1380a9[_0x49c7('0x3c')]=_['keys'](db['CmHopperBlack'][_0x49c7('0x53')]);_0x1380a9[_0x49c7('0x3d')]=_['keys'](_0x3de67a['query']);_0x1380a9[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x1380a9['model'],_0x1380a9[_0x49c7('0x3d')]);_0x3081be[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x1380a9[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x3de67a['query'][_0x49c7('0x42')]));_0x3081be[_0x49c7('0x41')]=_0x3081be[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3081be['attributes']:_0x1380a9['model'];if(!_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x3081be['limit']=qs[_0x49c7('0x22')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3081be[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x1f')]);}_0x3081be['order']=qs[_0x49c7('0x46')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3081be[_0x49c7('0x4b')]=qs['filters'](_['pick'](_0x3de67a[_0x49c7('0x3d')],_0x1380a9['filters']));_0x3081be['where'][_0x49c7('0x61')]=_0x12745a['id'];if(_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3081be['where']=_[_0x49c7('0x48')](_0x3081be[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x3081be[_0x49c7('0x41')],function(_0x4a8a2e){var _0x43b303={};_0x43b303[_0x4a8a2e]={'$like':'%'+_0x3de67a['query']['filter']+'%'};return _0x43b303;})});}_0x3081be=_['merge']({},_0x3081be,_0x3de67a[_0x49c7('0x4a')]);return db[_0x49c7('0x67')][_0x49c7('0x21')]({'where':_0x3081be[_0x49c7('0x4b')]})['then'](function(_0x108710){_0x1972bd['count']=_0x108710;if(_0x3de67a[_0x49c7('0x3d')]['includeAll']){_0x3081be[_0x49c7('0x4e')]=[{'all':!![]}];}return db[_0x49c7('0x67')][_0x49c7('0x4f')](_0x3081be);})['then'](function(_0x11380c){_0x1972bd[_0x49c7('0x50')]=_0x11380c;return _0x1972bd;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x589805,_0x3081be))['catch'](handleError(_0x589805,null));};exports[_0x49c7('0x68')]=function(_0x22f337,_0x2995d1,_0x32e19c){var _0x47a093={};var _0x23e313={};var _0x2c74d5;var _0x4486f5;return db['VoiceQueue'][_0x49c7('0x5f')]({'where':{'id':_0x22f337[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2995d1,null))['then'](function(_0x113c9c){if(_0x113c9c){_0x2c74d5=_0x113c9c;_0x23e313[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x69')][_0x49c7('0x53')]);_0x23e313['query']=_[_0x49c7('0x3e')](_0x22f337[_0x49c7('0x3d')]);_0x23e313[_0x49c7('0x3f')]=_['intersection'](_0x23e313['model'],_0x23e313[_0x49c7('0x3d')]);_0x47a093['attributes']=_[_0x49c7('0x40')](_0x23e313[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x22f337[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x47a093[_0x49c7('0x41')]=_0x47a093[_0x49c7('0x41')][_0x49c7('0x43')]?_0x47a093['attributes']:_0x23e313[_0x49c7('0x3c')];_0x47a093[_0x49c7('0x45')]=qs['sort'](_0x22f337['query'][_0x49c7('0x46')]);_0x47a093[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_['pick'](_0x22f337[_0x49c7('0x3d')],_0x23e313['filters']));if(_0x22f337[_0x49c7('0x3d')]['filter']){_0x47a093['where']=_['merge'](_0x47a093[_0x49c7('0x4b')],{'$or':_['map'](_0x47a093['attributes'],function(_0xfcce1d){var _0x3f46d6={};_0x3f46d6[_0xfcce1d]={'$like':'%'+_0x22f337[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x3f46d6;})});}_0x47a093=_[_0x49c7('0x48')]({},_0x47a093,_0x22f337[_0x49c7('0x4a')]);return _0x2c74d5[_0x49c7('0x68')](_0x47a093);}})['then'](function(_0x18c1a2){if(_0x18c1a2){_0x4486f5=_0x18c1a2['length'];if(!_0x22f337[_0x49c7('0x3d')]['hasOwnProperty'](_0x49c7('0x60'))){_0x47a093[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x22f337[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x47a093[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x22f337[_0x49c7('0x3d')]['offset']);}return _0x2c74d5[_0x49c7('0x68')](_0x47a093);}})['then'](function(_0x1941ac){if(_0x1941ac){return _0x1941ac?{'count':_0x4486f5,'rows':_0x1941ac}:null;}})[_0x49c7('0x28')](respondWithResult(_0x2995d1,null))[_0x49c7('0x51')](handleError(_0x2995d1,null));};exports[_0x49c7('0x6a')]=function(_0xb7d008,_0x596a06,_0x2ab32b){var _0x14061a=_0xb7d008[_0x49c7('0x55')][_0x49c7('0x6b')];var _0x393d3f=_[_0x49c7('0x31')](_0x14061a,'id');return db['Team']['findAll']({'where':{'id':_0x393d3f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0x49c7('0x6c'),_0x49c7('0x6d')],'raw':!![]}]})['then'](function(_0x4c045d){if(_0x4c045d){var _0x5d6a71=_[_0x49c7('0x6e')](_0x4c045d,function(_0x26e69d){var _0x458fd7=_0x26e69d[_0x49c7('0x2a')]({'plain':!![]});_0x458fd7[_0x49c7('0x6f')]['forEach'](function(_0xa2e841){_0xa2e841[_0x49c7('0x70')]=_[_0x49c7('0x5d')](_0x14061a,{'id':_0x458fd7['id']})[_0x49c7('0x70')];});return _0x458fd7[_0x49c7('0x6f')];});return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0xb7d008[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(_0x47f7b3){return db[_0x49c7('0x71')][_0x49c7('0x72')](function(_0x3a12e8){return _0x47f7b3[_0x49c7('0x6a')](_0x393d3f,{'transaction':_0x3a12e8})[_0x49c7('0x28')](function(){return BPromise['each'](_0x14061a,function(_0x15a9f2){return db[_0x49c7('0x73')][_0x49c7('0x74')]({'TeamId':_0x15a9f2['id'],'VoiceQueueId':_0xb7d008[_0x49c7('0x5c')]['id'],'penalty':_0x15a9f2[_0x49c7('0x70')]},{'transaction':_0x3a12e8});});})['then'](function(){return BPromise['each'](_0x5d6a71,function(_0x2240e8){return db[_0x49c7('0x75')][_0x49c7('0x76')]({'where':{'UserId':_0x2240e8['id'],'VoiceQueueId':_0xb7d008[_0x49c7('0x5c')]['id']},'defaults':{'penalty':_0x2240e8[_0x49c7('0x70')]},'transaction':_0x3a12e8});});})['then'](function(){return BPromise[_0x49c7('0x77')](_[_0x49c7('0x2f')](_0x5d6a71,{'online':!![]}),function(_0x1e5bc5){return db[_0x49c7('0x78')][_0x49c7('0x74')]({'membername':_0x1e5bc5[_0x49c7('0x35')],'UserId':_0x1e5bc5['id'],'queue_name':_0x47f7b3[_0x49c7('0x35')],'VoiceQueueId':_0x47f7b3['id'],'interface':_[_0x49c7('0x79')](_0x1e5bc5['interface'])?util['format']('SIP/%s',_0x1e5bc5['name']):_0x1e5bc5['interface'],'paused':_0x1e5bc5[_0x49c7('0x6c')]||![],'penalty':_0x1e5bc5[_0x49c7('0x70')]},{'transaction':_0x3a12e8});});})[_0x49c7('0x28')](function(){_0x5d6a71['forEach'](function(_0x8fc33a){socket[_0x49c7('0x7a')]('userVoiceQueue:save',{'UserId':_0x8fc33a['id'],'VoiceQueueId':_0x47f7b3['id']});});});});});}})[_0x49c7('0x28')](respondWithStatusCode(_0x596a06,null))[_0x49c7('0x51')](handleError(_0x596a06,null));};exports[_0x49c7('0x7b')]=function(_0x5c3419,_0x3282d,_0x3e6bd8){return db[_0x49c7('0x69')][_0x49c7('0x4f')]({'where':{'id':_0x5c3419[_0x49c7('0x3d')][_0x49c7('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x49c7('0x7d')],'as':_0x49c7('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x49c7('0x28')](handleEntityNotFound(_0x3282d,null))[_0x49c7('0x28')](function(_0x1446e1){var _0x567bd5=_['map'](_0x1446e1,'id');var _0x5de837=[];var _0x1f5a65=[];var _0x5f9881=squel[_0x49c7('0x7e')]();_0x5f9881[_0x49c7('0x7f')]('tq.TeamId')[_0x49c7('0x80')](_0x49c7('0x81'),'tq')[_0x49c7('0x82')](_0x49c7('0x83'),'ut',_0x49c7('0x84'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x5c3419[_0x49c7('0x5c')]['id']);for(var _0xeaa4f1=0x0;_0xeaa4f1<_0x1446e1[_0x49c7('0x43')];_0xeaa4f1+=0x1){let _0x28e4f8=_0x1446e1[_0xeaa4f1];for(var _0x2ccb93=0x0;_0x2ccb93<_0x28e4f8['Agents'][_0x49c7('0x43')];_0x2ccb93+=0x1){let _0x391bd3=_0x28e4f8['Agents'][_0x2ccb93];var _0x318ad0=_0x5f9881[_0x49c7('0x5b')]();_0x318ad0['where'](_0x49c7('0x86'),_0x391bd3['id']);_0x1f5a65[_0x49c7('0x87')](db[_0x49c7('0x71')][_0x49c7('0x3d')](_0x318ad0[_0x49c7('0x88')](),{'type':db[_0x49c7('0x71')][_0x49c7('0x89')][_0x49c7('0x8a')]})[_0x49c7('0x28')](function(_0x25bb7b){if(_0x25bb7b[_0x49c7('0x43')]===0x1){return _0x391bd3['id'];}else{var _0x489a5e=_[_0x49c7('0x8b')](_[_0x49c7('0x31')](_0x25bb7b,_0x49c7('0x8c')),function(_0xe2717d){return _[_0x49c7('0x32')](_0x567bd5,_0xe2717d);});if(_0x489a5e){return _0x391bd3['id'];}}}));}}return BPromise[_0x49c7('0x8d')](_0x1f5a65)[_0x49c7('0x28')](function(_0x2a9667){_0x5de837=_(_0x5de837)[_0x49c7('0x8e')](_0x2a9667)['compact']()[_0x49c7('0x34')]();return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x5c3419[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(_0x47fd16){return db[_0x49c7('0x71')][_0x49c7('0x72')](function(_0x40e34c){return _0x47fd16[_0x49c7('0x7b')](_0x5c3419[_0x49c7('0x3d')][_0x49c7('0x7c')],{'transaction':_0x40e34c})[_0x49c7('0x28')](function(){if(!_['isEmpty'](_0x5de837)){return _0x47fd16[_0x49c7('0x8f')](_0x5de837,{'transaction':_0x40e34c})[_0x49c7('0x28')](function(){return db[_0x49c7('0x78')][_0x49c7('0x29')]({'where':{'VoiceQueueId':_0x5c3419[_0x49c7('0x5c')]['id'],'UserId':_0x5de837},'transaction':_0x40e34c});});}})[_0x49c7('0x28')](function(){_0x5de837[_0x49c7('0x90')](function(_0x518f37){socket[_0x49c7('0x7a')]('userVoiceQueue:remove',{'UserId':_0x518f37,'VoiceQueueId':_0x47fd16['id']});});});});});});})[_0x49c7('0x28')](respondWithStatusCode(_0x3282d,null))['catch'](handleError(_0x3282d,null));};exports[_0x49c7('0x91')]=function(_0x3f6d53,_0x5448c4,_0x43b590){var _0x473ee0,_0x41cc00;return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x3f6d53[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x5448c4,null))[_0x49c7('0x28')](function(_0x44e245){if(_0x44e245){_0x41cc00=_0x44e245;return _0x44e245['addAgents'](_0x3f6d53['body'][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x3f6d53[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{})[_0x49c7('0x93')](function(_0x230d10){for(var _0x76e069=0x0;_0x76e069<_0x3f6d53[_0x49c7('0x55')][_0x49c7('0x7c')]['length'];_0x76e069+=0x1){socket[_0x49c7('0x7a')](_0x49c7('0x94'),{'UserId':Number(_0x3f6d53[_0x49c7('0x55')]['ids'][_0x76e069]),'VoiceQueueId':Number(_0x3f6d53[_0x49c7('0x5c')]['id'])});}return _0x230d10;});}})[_0x49c7('0x28')](function(_0x323775){_0x473ee0=_0x323775||[];if(_0x41cc00){return db[_0x49c7('0x7d')]['findAll']({'where':{'id':_0x3f6d53['body'][_0x49c7('0x7c')]},'attributes':['id',_0x49c7('0x35'),_0x49c7('0x95'),_0x49c7('0x6c'),_0x49c7('0x6d')],'raw':!![]});}})[_0x49c7('0x28')](function(_0x506b87){if(!_[_0x49c7('0x96')](_0x506b87)){var _0x5f50e4=[];for(var _0x81f165=0x0;_0x81f165<_0x506b87[_0x49c7('0x43')];_0x81f165++){if(_0x506b87[_0x81f165][_0x49c7('0x95')]){_0x5f50e4[_0x49c7('0x87')](db[_0x49c7('0x78')]['upsert']({'membername':_0x506b87[_0x81f165]['name'],'UserId':_0x506b87[_0x81f165]['id'],'queue_name':_0x41cc00[_0x49c7('0x35')],'VoiceQueueId':_0x41cc00['id'],'interface':_[_0x49c7('0x79')](_0x506b87[_0x81f165][_0x49c7('0x6d')])?util['format'](_0x49c7('0x97'),_0x506b87[_0x81f165][_0x49c7('0x35')]):_0x506b87[_0x81f165][_0x49c7('0x6d')],'paused':_0x506b87[_0x81f165][_0x49c7('0x6c')]||![],'penalty':_0x3f6d53[_0x49c7('0x55')][_0x49c7('0x70')]||0x0}));}}return BPromise[_0x49c7('0x8d')](_0x5f50e4);}})[_0x49c7('0x28')](function(){return _0x473ee0;})[_0x49c7('0x28')](respondWithResult(_0x5448c4,null))['catch'](handleError(_0x5448c4,null));};exports['removeAgents']=function(_0x262bf8,_0x2b69f1,_0x57c1bb){return db['VoiceQueue'][_0x49c7('0x5d')]({'where':{'id':_0x262bf8[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x2b69f1,null))[_0x49c7('0x28')](function(_0x163b19){if(_0x163b19){return _0x163b19[_0x49c7('0x8f')](_0x262bf8[_0x49c7('0x3d')]['ids'])[_0x49c7('0x28')](function(){if(_[_0x49c7('0x98')](_0x262bf8['query'][_0x49c7('0x7c')])){for(var _0x3fde54=0x0;_0x3fde54<_0x262bf8['query'][_0x49c7('0x7c')]['length'];_0x3fde54+=0x1){socket[_0x49c7('0x7a')](_0x49c7('0x99'),{'UserId':Number(_0x262bf8[_0x49c7('0x3d')][_0x49c7('0x7c')][_0x3fde54]),'VoiceQueueId':Number(_0x262bf8[_0x49c7('0x5c')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x262bf8[_0x49c7('0x3d')]['ids']),'VoiceQueueId':Number(_0x262bf8[_0x49c7('0x5c')]['id'])});}});}})[_0x49c7('0x28')](function(_0x4dbc8d){return db['UserVoiceQueueRt'][_0x49c7('0x29')]({'where':{'VoiceQueueId':_0x262bf8[_0x49c7('0x5c')]['id'],'UserId':_0x262bf8[_0x49c7('0x3d')][_0x49c7('0x7c')]}})[_0x49c7('0x28')](function(){return _0x4dbc8d;});})['then'](respondWithStatusCode(_0x2b69f1,null))['catch'](handleError(_0x2b69f1,null));};exports[_0x49c7('0x9a')]=function(_0x520975,_0x4b6d4b,_0x27879a){var _0x2f3d85={};var _0x69118b={};var _0x1eebcb;var _0x36ad0f;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x520975[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x4b6d4b,null))[_0x49c7('0x28')](function(_0x50c4e2){if(_0x50c4e2){_0x1eebcb=_0x50c4e2;_0x69118b[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['User'][_0x49c7('0x53')]);_0x69118b[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x520975[_0x49c7('0x3d')]);_0x69118b['filters']=_[_0x49c7('0x40')](_0x69118b[_0x49c7('0x3c')],_0x69118b[_0x49c7('0x3d')]);_0x2f3d85[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x69118b['model'],qs[_0x49c7('0x42')](_0x520975['query'][_0x49c7('0x42')]));_0x2f3d85[_0x49c7('0x41')]=_0x2f3d85[_0x49c7('0x41')][_0x49c7('0x43')]?_0x2f3d85['attributes']:_0x69118b[_0x49c7('0x3c')];_0x2f3d85[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x520975[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x2f3d85[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x520975[_0x49c7('0x3d')],_0x69118b[_0x49c7('0x3f')]));if(_0x520975[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x2f3d85[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x2f3d85[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x2f3d85[_0x49c7('0x41')],function(_0x388df4){var _0x21a425={};_0x21a425[_0x388df4]={'$like':'%'+_0x520975[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x21a425;})});}_0x2f3d85=_[_0x49c7('0x48')]({},_0x2f3d85,_0x520975['options']);return _0x1eebcb[_0x49c7('0x9a')](_0x2f3d85);}})[_0x49c7('0x28')](function(_0x1e0112){if(_0x1e0112){_0x36ad0f=_0x1e0112[_0x49c7('0x43')];if(!_0x520975[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x2f3d85[_0x49c7('0x22')]=qs['limit'](_0x520975[_0x49c7('0x3d')]['limit']);_0x2f3d85[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x520975[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0x1eebcb[_0x49c7('0x9a')](_0x2f3d85);}})['then'](function(_0x492657){if(_0x492657){return _0x492657?{'count':_0x36ad0f,'rows':_0x492657}:null;}})[_0x49c7('0x28')](respondWithResult(_0x4b6d4b,null))['catch'](handleError(_0x4b6d4b,null));};exports[_0x49c7('0x9b')]=function(_0x2af302,_0x40ce41,_0xee7bef){var _0x3ad329={};var _0x1085ff={};var _0xef0321;var _0x5bae62;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x2af302['params']['id']}})['then'](handleEntityNotFound(_0x40ce41,null))[_0x49c7('0x28')](function(_0x5c813d){if(_0x5c813d){_0xef0321=_0x5c813d;_0x1085ff['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x78')][_0x49c7('0x53')]);_0x1085ff['query']=_[_0x49c7('0x3e')](_0x2af302[_0x49c7('0x3d')]);_0x1085ff[_0x49c7('0x3f')]=_['intersection'](_0x1085ff['model'],_0x1085ff[_0x49c7('0x3d')]);_0x3ad329[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x1085ff['model'],qs[_0x49c7('0x42')](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3ad329[_0x49c7('0x41')]=_0x3ad329[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3ad329[_0x49c7('0x41')]:_0x1085ff['model'];_0x3ad329[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3ad329[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x2af302[_0x49c7('0x3d')],_0x1085ff[_0x49c7('0x3f')]));if(_0x2af302[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3ad329[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3ad329[_0x49c7('0x4b')],{'$or':_['map'](_0x3ad329[_0x49c7('0x41')],function(_0xadf684){var _0x3c597a={};_0x3c597a[_0xadf684]={'$like':'%'+_0x2af302[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x3c597a;})});}_0x3ad329=_[_0x49c7('0x48')]({},_0x3ad329,_0x2af302[_0x49c7('0x4a')]);return _0xef0321[_0x49c7('0x9b')](_0x3ad329);}})[_0x49c7('0x28')](function(_0x1b4887){if(_0x1b4887){_0x5bae62=_0x1b4887[_0x49c7('0x43')];if(!_0x2af302[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x3ad329[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x2af302[_0x49c7('0x3d')]['limit']);_0x3ad329[_0x49c7('0x1f')]=qs['offset'](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0xef0321[_0x49c7('0x9b')](_0x3ad329);}})[_0x49c7('0x28')](function(_0x50e9db){return _0x50e9db?{'count':_0x5bae62,'rows':_0x50e9db}:null;})['then'](respondWithResult(_0x40ce41,null))[_0x49c7('0x51')](handleError(_0x40ce41,null));};exports[_0x49c7('0x9c')]=function(_0x5f5882,_0x36c27b,_0xb030f6){var _0x1a5bd5={};var _0x5cd97f={};var _0x4fbb95;var _0x1a4f95;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x5f5882[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x36c27b,null))[_0x49c7('0x28')](function(_0x12a198){if(_0x12a198){_0x4fbb95=_0x12a198;_0x5cd97f['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x9d')]['rawAttributes']);_0x5cd97f['query']=_[_0x49c7('0x3e')](_0x5f5882[_0x49c7('0x3d')]);_0x5cd97f['filters']=_[_0x49c7('0x40')](_0x5cd97f[_0x49c7('0x3c')],_0x5cd97f[_0x49c7('0x3d')]);_0x1a5bd5[_0x49c7('0x41')]=_['intersection'](_0x5cd97f['model'],qs[_0x49c7('0x42')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x1a5bd5[_0x49c7('0x41')]=_0x1a5bd5[_0x49c7('0x41')][_0x49c7('0x43')]?_0x1a5bd5[_0x49c7('0x41')]:_0x5cd97f[_0x49c7('0x3c')];_0x1a5bd5[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x1a5bd5[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_['pick'](_0x5f5882[_0x49c7('0x3d')],_0x5cd97f[_0x49c7('0x3f')]));if(_0x5f5882['query'][_0x49c7('0x2f')]){_0x1a5bd5[_0x49c7('0x4b')]=_['merge'](_0x1a5bd5[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x1a5bd5['attributes'],function(_0x562c06){var _0x5923a9={};_0x5923a9[_0x562c06]={'$like':'%'+_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x5923a9;})});}_0x1a5bd5=_[_0x49c7('0x48')]({},_0x1a5bd5,_0x5f5882[_0x49c7('0x4a')]);return _0x4fbb95[_0x49c7('0x9c')](_0x1a5bd5);}})['then'](function(_0x746fa5){if(_0x746fa5){_0x1a4f95=_0x746fa5[_0x49c7('0x43')];if(!_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x1a5bd5[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x1a5bd5[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0x4fbb95[_0x49c7('0x9c')](_0x1a5bd5);}})[_0x49c7('0x28')](function(_0x5cd0c1){if(_0x5cd0c1){return _0x5cd0c1?{'count':_0x1a4f95,'rows':_0x5cd0c1}:null;}})['then'](respondWithResult(_0x36c27b,null))[_0x49c7('0x51')](handleError(_0x36c27b,null));};exports[_0x49c7('0x9e')]=function(_0x3a165e,_0x53331a,_0x51e9f1){var _0x527d40,_0x924aab;return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x3a165e[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x53331a,null))[_0x49c7('0x28')](function(_0x1b213b){if(_0x1b213b){_0x924aab=_0x1b213b;return _0x1b213b['addLists'](_0x3a165e[_0x49c7('0x55')][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x3a165e[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{});}return null;})[_0x49c7('0x93')](function(_0x56decb){var _0x4f9b65;_0x527d40=_0x56decb||[];var _0xa29122=[];if(_0x56decb){for(var _0x3f0cef=0x0;_0x3f0cef<_0x56decb[_0x49c7('0x43')];_0x3f0cef+=0x1){var _0x5df559=_0x56decb[_0x3f0cef][_0x49c7('0x2a')]({'plain':!![]});_0x924aab[_0x49c7('0x9f')]=_0x3a165e[_0x49c7('0x55')][_0x49c7('0x9f')]?_0x3a165e[_0x49c7('0x55')][_0x49c7('0x9f')]:_0x924aab[_0x49c7('0x9f')];switch(_0x924aab[_0x49c7('0x9f')]){case _0x49c7('0xa0'):_0x4f9b65=squel[_0x49c7('0xa1')]()[_0x49c7('0xa2')](_0x49c7('0xa3'))[_0x49c7('0xa4')]([_0x49c7('0xa5'),_0x49c7('0xa6'),'ContactId',_0x49c7('0xa7'),'VoiceQueueId',_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')]('phone',_0x49c7('0xa5'))[_0x49c7('0x7f')](_0x49c7('0xa9'),'scheduledAt')[_0x49c7('0x7f')]('id','ContactId')[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),_0x49c7('0xa7'))[_0x49c7('0x7f')](_0x3a165e[_0x49c7('0x5c')]['id'][_0x49c7('0x88')](),_0x49c7('0x61'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()','updatedAt')[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))['where'](_0x49c7('0xad'),_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')]())[_0x49c7('0x4b')](_0x49c7('0xae'))[_0x49c7('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x49c7('0xaf'))[_0x49c7('0x80')](_0x49c7('0xb0'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x3a165e['params']['id'][_0x49c7('0x88')]()))[_0x49c7('0x4b')](_0x49c7('0xb1'),squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xb2'))['from'](_0x49c7('0xa3'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x3a165e[_0x49c7('0x5c')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x4f9b65=squel[_0x49c7('0xa1')]()['into'](_0x49c7('0xa3'))['fromQuery']([_0x49c7('0xa5'),_0x49c7('0xa6'),_0x49c7('0xb3'),_0x49c7('0xa7'),_0x49c7('0x61'),_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa6'))[_0x49c7('0x7f')]('id','ContactId')[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),'ListId')[_0x49c7('0x7f')](_0x3a165e[_0x49c7('0x5c')]['id'][_0x49c7('0x88')](),_0x49c7('0x61'))['field']('NOW()',_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa8'))['from'](_0x49c7('0xab'))['where']('deletedAt\x20IS\x20NULL')[_0x49c7('0x4b')](_0x49c7('0xad'),_0x5df559['CmListId'][_0x49c7('0x88')]())['where'](_0x49c7('0xae'))[_0x49c7('0x4b')](_0x49c7('0xb1'),squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xb2'))[_0x49c7('0x80')](_0x49c7('0xa3'))[_0x49c7('0x4b')]('VoiceQueueId\x20=\x20?',_0x3a165e['params']['id'][_0x49c7('0x88')]())))[_0x49c7('0x88')]();break;default:_0x4f9b65=squel['insert']()[_0x49c7('0xa2')](_0x49c7('0xa3'))[_0x49c7('0xa4')]([_0x49c7('0xa5'),_0x49c7('0xa6'),_0x49c7('0xb3'),'ListId',_0x49c7('0x61'),_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')](_0x49c7('0xa9'),'scheduledAt')['field']('id',_0x49c7('0xb3'))[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),'ListId')[_0x49c7('0x7f')](_0x3a165e['params']['id'][_0x49c7('0x88')](),'VoiceQueueId')[_0x49c7('0x7f')](_0x49c7('0xa9'),_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa8'))[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))[_0x49c7('0x4b')](_0x49c7('0xad'),_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')]())[_0x49c7('0x4b')](_0x49c7('0xae')))[_0x49c7('0x88')]();}_0xa29122[_0x49c7('0x87')](db['sequelize'][_0x49c7('0x3d')](_0x4f9b65));}return BPromise[_0x49c7('0x8d')](_0xa29122);}})['then'](function(){return _0x527d40;})['then'](respondWithResult(_0x53331a,null))[_0x49c7('0x51')](handleError(_0x53331a,null));};exports['removeLists']=function(_0x5a4a35,_0x804b0a,_0xd2cef4){return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x5a4a35[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x804b0a,null))[_0x49c7('0x28')](function(_0x1f6e85){if(_0x1f6e85){return _0x1f6e85[_0x49c7('0xb4')](_0x5a4a35[_0x49c7('0x3d')][_0x49c7('0x7c')]);}})[_0x49c7('0x28')](function(_0x2213a6){if(_0x2213a6){return db['CmHopper'][_0x49c7('0x29')]({'where':{'ListId':_0x5a4a35[_0x49c7('0x3d')][_0x49c7('0x7c')],'VoiceQueueId':_0x5a4a35['params']['id']}})[_0x49c7('0x28')](function(){return _0x2213a6;});}})[_0x49c7('0x28')](respondWithStatusCode(_0x804b0a,null))[_0x49c7('0x51')](handleError(_0x804b0a,null));};exports['getBlackLists']=function(_0x3844e4,_0x269933,_0x5c5145){var _0x1115bb={};var _0x37d2c9={};var _0x17574e;var _0x313d97;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x3844e4[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x269933,null))[_0x49c7('0x28')](function(_0x2360b6){if(_0x2360b6){_0x17574e=_0x2360b6;_0x37d2c9['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x9d')][_0x49c7('0x53')]);_0x37d2c9[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x3844e4[_0x49c7('0x3d')]);_0x37d2c9['filters']=_[_0x49c7('0x40')](_0x37d2c9[_0x49c7('0x3c')],_0x37d2c9[_0x49c7('0x3d')]);_0x1115bb[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x37d2c9['model'],qs[_0x49c7('0x42')](_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x1115bb[_0x49c7('0x41')]=_0x1115bb[_0x49c7('0x41')][_0x49c7('0x43')]?_0x1115bb[_0x49c7('0x41')]:_0x37d2c9[_0x49c7('0x3c')];_0x1115bb[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x3844e4[_0x49c7('0x3d')]['sort']);_0x1115bb[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x3844e4['query'],_0x37d2c9[_0x49c7('0x3f')]));if(_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x1115bb[_0x49c7('0x4b')]=_['merge'](_0x1115bb[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x1115bb[_0x49c7('0x41')],function(_0x575ead){var _0x5c3376={};_0x5c3376[_0x575ead]={'$like':'%'+_0x3844e4['query'][_0x49c7('0x2f')]+'%'};return _0x5c3376;})});}_0x1115bb=_[_0x49c7('0x48')]({},_0x1115bb,_0x3844e4[_0x49c7('0x4a')]);return _0x17574e['getBlackLists'](_0x1115bb);}})[_0x49c7('0x28')](function(_0x3b5bc2){if(_0x3b5bc2){_0x313d97=_0x3b5bc2[_0x49c7('0x43')];if(!_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x1115bb[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x3844e4['query']['limit']);_0x1115bb[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x3844e4['query'][_0x49c7('0x1f')]);}return _0x17574e[_0x49c7('0xb5')](_0x1115bb);}})[_0x49c7('0x28')](function(_0x502bae){if(_0x502bae){return _0x502bae?{'count':_0x313d97,'rows':_0x502bae}:null;}})[_0x49c7('0x28')](respondWithResult(_0x269933,null))[_0x49c7('0x51')](handleError(_0x269933,null));};exports[_0x49c7('0xb6')]=function(_0x28aafd,_0x48304d,_0x56766e){var _0x53351f,_0x3a3540;return db['VoiceQueue']['find']({'where':{'id':_0x28aafd[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x48304d,null))[_0x49c7('0x28')](function(_0xf3eab4){if(_0xf3eab4){_0x3a3540=_0xf3eab4;return _0xf3eab4[_0x49c7('0xb6')](_0x28aafd[_0x49c7('0x55')][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x28aafd[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{});}return null;})[_0x49c7('0x93')](function(_0x35c1af){var _0x36f336;_0x53351f=_0x35c1af||[];var _0x20b2d0=[];if(_0x35c1af){for(var _0x5e723e=0x0;_0x5e723e<_0x35c1af[_0x49c7('0x43')];_0x5e723e+=0x1){var _0x51fd4e=_0x35c1af[_0x5e723e][_0x49c7('0x2a')]({'plain':!![]});_0x36f336=squel[_0x49c7('0xa1')]()[_0x49c7('0xa2')]('cm_hopper_black')['fromQuery']([_0x49c7('0xa5'),_0x49c7('0xb3'),_0x49c7('0xa7'),_0x49c7('0x61'),'createdAt',_0x49c7('0xa8')],squel['select']()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')]('id',_0x49c7('0xb3'))[_0x49c7('0x7f')](_0x51fd4e['CmListId'][_0x49c7('0x88')](),_0x49c7('0xa7'))[_0x49c7('0x7f')](_0x28aafd['params']['id'][_0x49c7('0x88')](),_0x49c7('0x61'))[_0x49c7('0x7f')](_0x49c7('0xa9'),_0x49c7('0x5e'))['field'](_0x49c7('0xa9'),_0x49c7('0xa8'))[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))[_0x49c7('0x4b')](_0x49c7('0xad'),_0x51fd4e[_0x49c7('0xaa')]['toString']())[_0x49c7('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x49c7('0x88')]();_0x20b2d0[_0x49c7('0x87')](db['sequelize']['query'](_0x36f336));}return BPromise['all'](_0x20b2d0);}})[_0x49c7('0x28')](function(){return _0x53351f;})[_0x49c7('0x28')](respondWithResult(_0x48304d,null))[_0x49c7('0x51')](handleError(_0x48304d,null));};exports[_0x49c7('0xb7')]=function(_0x20a891,_0x46de12,_0x2e8339){return db['VoiceQueue'][_0x49c7('0x5d')]({'where':{'id':_0x20a891[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x46de12,null))['then'](function(_0x3481dd){if(_0x3481dd){return _0x3481dd[_0x49c7('0xb7')](_0x20a891['query'][_0x49c7('0x7c')]);}})[_0x49c7('0x28')](function(_0x12f1f4){if(_0x12f1f4){return db[_0x49c7('0x67')]['destroy']({'where':{'ListId':_0x20a891[_0x49c7('0x3d')][_0x49c7('0x7c')],'VoiceQueueId':_0x20a891[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(){return _0x12f1f4;});}})[_0x49c7('0x28')](respondWithStatusCode(_0x46de12,null))[_0x49c7('0x51')](handleError(_0x46de12,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b1a7ffa..d5e7a86 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 _0xf73f=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x17afca,_0x5d6455){var _0x4691c9=function(_0x218099){while(--_0x218099){_0x17afca['push'](_0x17afca['shift']());}};_0x4691c9(++_0x5d6455);}(_0xf73f,0x1c8));var _0xff73=function(_0x244c58,_0x5084ba){_0x244c58=_0x244c58-0x0;var _0x563fcf=_0xf73f[_0x244c58];return _0x563fcf;};'use strict';var EventEmitter=require(_0xff73('0x0'));var VoiceQueue=require(_0xff73('0x1'))['db'][_0xff73('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xff73('0x3')](0x0);var events={'afterCreate':_0xff73('0x4'),'afterUpdate':_0xff73('0x5'),'afterDestroy':_0xff73('0x6')};function emitEvent(_0x26cab8){return function(_0x8d97ed,_0x22c9be,_0x4bcefa){VoiceQueueEvents[_0xff73('0x7')](_0x26cab8+':'+_0x8d97ed['id'],_0x8d97ed);VoiceQueueEvents[_0xff73('0x7')](_0x26cab8,_0x8d97ed);_0x4bcefa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xff73('0x8')](e,emitEvent(event));}}module[_0xff73('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x0ea4=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x4b1c2d,_0x573b7c){var _0x4c3d88=function(_0x43c984){while(--_0x43c984){_0x4b1c2d['push'](_0x4b1c2d['shift']());}};_0x4c3d88(++_0x573b7c);}(_0x0ea4,0x178));var _0x40ea=function(_0x4317b3,_0x4c636b){_0x4317b3=_0x4317b3-0x0;var _0x22d01a=_0x0ea4[_0x4317b3];return _0x22d01a;};'use strict';var EventEmitter=require(_0x40ea('0x0'));var VoiceQueue=require(_0x40ea('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40ea('0x2'),'afterUpdate':_0x40ea('0x3'),'afterDestroy':_0x40ea('0x4')};function emitEvent(_0x34bbb5){return function(_0x1dd3f9,_0x4e6d9c,_0x261ffe){VoiceQueueEvents[_0x40ea('0x5')](_0x34bbb5+':'+_0x1dd3f9['id'],_0x1dd3f9);VoiceQueueEvents[_0x40ea('0x5')](_0x34bbb5,_0x1dd3f9);_0x261ffe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x40ea('0x6')](e,emitEvent(event));}}module[_0x40ea('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 ac2838e..e2b641d 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x3e74,0x175));var _0x43e7=function(_0x560381,_0x18583c){_0x560381=_0x560381-0x0;var _0x497b7b=_0x3e74[_0x560381];return _0x497b7b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2bf689,_0x423eeb){var _0xaa44e0=function(_0x188003){while(--_0x188003){_0x2bf689['push'](_0x2bf689['shift']());}};_0xaa44e0(++_0x423eeb);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c6dbe,_0x21ccab){_0x1c6dbe=_0x1c6dbe-0x0;var _0xa2d66=_0xedd9[_0x1c6dbe];return _0xa2d66;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 590d088..dd778a1 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 _0x3a5e=['findAll','options','raw','attributes','limit','map','include','model','debug','ShowVoiceQueue','VoiceQueue','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x3a5e,0x1ae));var _0xe3a5=function(_0x3e863a,_0x40fac9){_0x3e863a=_0x3e863a-0x0;var _0x36f05e=_0x3a5e[_0x3e863a];return _0x36f05e;};'use strict';var _=require(_0xe3a5('0x0'));var util=require('util');var moment=require(_0xe3a5('0x1'));var BPromise=require(_0xe3a5('0x2'));var rs=require(_0xe3a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3a5('0x4'))['db'];var utils=require(_0xe3a5('0x5'));var logger=require(_0xe3a5('0x6'))(_0xe3a5('0x7'));var config=require('../../config/environment');var jayson=require(_0xe3a5('0x8'));var client=jayson[_0xe3a5('0x9')][_0xe3a5('0xa')]({'port':0x232a});config[_0xe3a5('0xb')]=_[_0xe3a5('0xc')](config[_0xe3a5('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3a5('0xb')]));require(_0xe3a5('0xd'))[_0xe3a5('0xe')](socket);function respondWithRpcPromise(_0x5e6808,_0x49d72f,_0x868d83){return new BPromise(function(_0x154f17,_0x2ba328){return client[_0xe3a5('0xf')](_0x5e6808,_0x868d83)[_0xe3a5('0x10')](function(_0x1614ef){logger[_0xe3a5('0x11')](_0xe3a5('0x12'),_0x49d72f,'request\x20sent');logger['debug'](_0xe3a5('0x13'),_0x49d72f,'request\x20sent',JSON[_0xe3a5('0x14')](_0x1614ef));if(_0x1614ef['error']){if(_0x1614ef['error']['code']===0x1f4){logger[_0xe3a5('0x15')](_0xe3a5('0x12'),_0x49d72f,_0x1614ef[_0xe3a5('0x15')][_0xe3a5('0x16')]);return _0x2ba328(_0x1614ef[_0xe3a5('0x15')]['message']);}logger[_0xe3a5('0x15')](_0xe3a5('0x12'),_0x49d72f,_0x1614ef[_0xe3a5('0x15')]['message']);return _0x154f17(_0x1614ef[_0xe3a5('0x15')][_0xe3a5('0x16')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x49d72f,'request\x20sent');_0x154f17(_0x1614ef[_0xe3a5('0x17')]['message']);}})[_0xe3a5('0x18')](function(_0x18c148){logger['error'](_0xe3a5('0x12'),_0x49d72f,_0x18c148);_0x2ba328(_0x18c148);});});}exports[_0xe3a5('0x19')]=function(_0x4c93c8){var _0x1a95ef=this;return new Promise(function(_0x57fb6b,_0x5dbcf1){return db['VoiceQueue'][_0xe3a5('0x1a')]({'raw':_0x4c93c8[_0xe3a5('0x1b')]?_0x4c93c8[_0xe3a5('0x1b')][_0xe3a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c93c8['options']?_0x4c93c8[_0xe3a5('0x1b')]['where']||null:null,'attributes':_0x4c93c8['options']?_0x4c93c8['options'][_0xe3a5('0x1d')]||null:null,'limit':_0x4c93c8[_0xe3a5('0x1b')]?_0x4c93c8[_0xe3a5('0x1b')][_0xe3a5('0x1e')]||null:null,'include':_0x4c93c8['options']?_0x4c93c8['options']['include']?_[_0xe3a5('0x1f')](_0x4c93c8[_0xe3a5('0x1b')][_0xe3a5('0x20')],function(_0x55cee2){return{'model':db[_0x55cee2[_0xe3a5('0x21')]],'as':_0x55cee2['as'],'attributes':_0x55cee2[_0xe3a5('0x1d')],'include':_0x55cee2[_0xe3a5('0x20')]?_['map'](_0x55cee2[_0xe3a5('0x20')],function(_0x4f98ca){return{'model':db[_0x4f98ca[_0xe3a5('0x21')]],'as':_0x4f98ca['as'],'attributes':_0x4f98ca[_0xe3a5('0x1d')],'include':_0x4f98ca[_0xe3a5('0x20')]?_['map'](_0x4f98ca[_0xe3a5('0x20')],function(_0x14a6f7){return{'model':db[_0x14a6f7[_0xe3a5('0x21')]],'as':_0x14a6f7['as'],'attributes':_0x14a6f7[_0xe3a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3a5('0x10')](function(_0x1955b9){logger['info']('GetVoiceQueue',_0x4c93c8);logger[_0xe3a5('0x22')](_0xe3a5('0x19'),_0x4c93c8,JSON[_0xe3a5('0x14')](_0x1955b9));_0x57fb6b(_0x1955b9);})[_0xe3a5('0x18')](function(_0x13a4e1){logger[_0xe3a5('0x15')](_0xe3a5('0x19'),_0x13a4e1[_0xe3a5('0x16')],_0x4c93c8);_0x5dbcf1(_0x1a95ef[_0xe3a5('0x15')](0x1f4,_0x13a4e1[_0xe3a5('0x16')]));});});};exports[_0xe3a5('0x23')]=function(_0x2747f9){var _0x1eedbc=this;return new Promise(function(_0xca2bd7,_0x20986a){return db[_0xe3a5('0x24')]['find']({'raw':_0x2747f9['options']?_0x2747f9['options'][_0xe3a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x2747f9['options']?_0x2747f9[_0xe3a5('0x1b')][_0xe3a5('0x25')]||null:null,'attributes':_0x2747f9[_0xe3a5('0x1b')]?_0x2747f9[_0xe3a5('0x1b')]['attributes']||null:null,'include':_0x2747f9['options']?_0x2747f9[_0xe3a5('0x1b')][_0xe3a5('0x20')]?_['map'](_0x2747f9[_0xe3a5('0x1b')]['include'],function(_0x303ab4){return{'model':db[_0x303ab4[_0xe3a5('0x21')]],'as':_0x303ab4['as'],'attributes':_0x303ab4['attributes'],'include':_0x303ab4['include']?_['map'](_0x303ab4[_0xe3a5('0x20')],function(_0x3960f1){return{'model':db[_0x3960f1['model']],'as':_0x3960f1['as'],'attributes':_0x3960f1[_0xe3a5('0x1d')],'include':_0x3960f1[_0xe3a5('0x20')]?_[_0xe3a5('0x1f')](_0x3960f1[_0xe3a5('0x20')],function(_0x9f614d){return{'model':db[_0x9f614d[_0xe3a5('0x21')]],'as':_0x9f614d['as'],'attributes':_0x9f614d[_0xe3a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3a5('0x10')](function(_0x3c6dcf){logger[_0xe3a5('0x11')](_0xe3a5('0x23'),_0x2747f9);logger['debug'](_0xe3a5('0x23'),_0x2747f9,JSON[_0xe3a5('0x14')](_0x3c6dcf));_0xca2bd7(_0x3c6dcf);})[_0xe3a5('0x18')](function(_0x350daf){logger[_0xe3a5('0x15')]('ShowVoiceQueue',_0x350daf['message'],_0x2747f9);_0x20986a(_0x1eedbc[_0xe3a5('0x15')](0x1f4,_0x350daf['message']));});});}; \ No newline at end of file +var _0x45eb=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','model','attributes','info','ShowVoiceQueue','find','raw','lodash','util','moment','bluebird'];(function(_0x224519,_0x12da79){var _0x52dc95=function(_0x44ad52){while(--_0x44ad52){_0x224519['push'](_0x224519['shift']());}};_0x52dc95(++_0x12da79);}(_0x45eb,0xd3));var _0xb45e=function(_0x583c10,_0x220d88){_0x583c10=_0x583c10-0x0;var _0x40553d=_0x45eb[_0x583c10];return _0x40553d;};'use strict';var _=require(_0xb45e('0x0'));var util=require(_0xb45e('0x1'));var moment=require(_0xb45e('0x2'));var BPromise=require(_0xb45e('0x3'));var rs=require(_0xb45e('0x4'));var fs=require('fs');var Redis=require(_0xb45e('0x5'));var db=require(_0xb45e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb45e('0x7'))(_0xb45e('0x8'));var config=require(_0xb45e('0x9'));var jayson=require(_0xb45e('0xa'));var client=jayson['client'][_0xb45e('0xb')]({'port':0x232a});config['redis']=_[_0xb45e('0xc')](config[_0xb45e('0xd')],{'host':_0xb45e('0xe'),'port':0x18eb});var socket=require(_0xb45e('0xf'))(new Redis(config['redis']));require(_0xb45e('0x10'))[_0xb45e('0x11')](socket);function respondWithRpcPromise(_0x2058c3,_0x209f0f,_0x1b3981){return new BPromise(function(_0x50776b,_0x381651){return client[_0xb45e('0x12')](_0x2058c3,_0x1b3981)[_0xb45e('0x13')](function(_0x336c1d){logger['info'](_0xb45e('0x14'),_0x209f0f,'request\x20sent');logger[_0xb45e('0x15')](_0xb45e('0x16'),_0x209f0f,_0xb45e('0x17'),JSON[_0xb45e('0x18')](_0x336c1d));if(_0x336c1d['error']){if(_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1a')]===0x1f4){logger[_0xb45e('0x19')](_0xb45e('0x14'),_0x209f0f,_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1b')]);return _0x381651(_0x336c1d['error'][_0xb45e('0x1b')]);}logger['error'](_0xb45e('0x14'),_0x209f0f,_0x336c1d['error'][_0xb45e('0x1b')]);return _0x50776b(_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1b')]);}else{logger['info'](_0xb45e('0x14'),_0x209f0f,_0xb45e('0x17'));_0x50776b(_0x336c1d[_0xb45e('0x1c')][_0xb45e('0x1b')]);}})[_0xb45e('0x1d')](function(_0x1105a6){logger[_0xb45e('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x209f0f,_0x1105a6);_0x381651(_0x1105a6);});});}exports[_0xb45e('0x1e')]=function(_0x41e738){var _0x44ef15=this;return new Promise(function(_0x23118d,_0x4dbfd0){return db[_0xb45e('0x1f')]['findAll']({'raw':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x41e738['options']?_0x41e738[_0xb45e('0x20')][_0xb45e('0x21')]||null:null,'attributes':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')]['attributes']||null:null,'limit':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')][_0xb45e('0x22')]||null:null,'include':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')][_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x41e738['options'][_0xb45e('0x23')],function(_0x307bcd){return{'model':db[_0x307bcd[_0xb45e('0x25')]],'as':_0x307bcd['as'],'attributes':_0x307bcd[_0xb45e('0x26')],'include':_0x307bcd['include']?_[_0xb45e('0x24')](_0x307bcd[_0xb45e('0x23')],function(_0x29a188){return{'model':db[_0x29a188[_0xb45e('0x25')]],'as':_0x29a188['as'],'attributes':_0x29a188[_0xb45e('0x26')],'include':_0x29a188[_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x29a188[_0xb45e('0x23')],function(_0x2ca95f){return{'model':db[_0x2ca95f[_0xb45e('0x25')]],'as':_0x2ca95f['as'],'attributes':_0x2ca95f[_0xb45e('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42e4e1){logger[_0xb45e('0x27')]('GetVoiceQueue',_0x41e738);logger[_0xb45e('0x15')](_0xb45e('0x1e'),_0x41e738,JSON[_0xb45e('0x18')](_0x42e4e1));_0x23118d(_0x42e4e1);})[_0xb45e('0x1d')](function(_0x389bd1){logger[_0xb45e('0x19')]('GetVoiceQueue',_0x389bd1[_0xb45e('0x1b')],_0x41e738);_0x4dbfd0(_0x44ef15[_0xb45e('0x19')](0x1f4,_0x389bd1[_0xb45e('0x1b')]));});});};exports[_0xb45e('0x28')]=function(_0x56dde1){var _0x56f0b9=this;return new Promise(function(_0x2ca6d1,_0x526587){return db['VoiceQueue'][_0xb45e('0x29')]({'raw':_0x56dde1['options']?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x2a')]===undefined?!![]:![]:!![],'where':_0x56dde1[_0xb45e('0x20')]?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x21')]||null:null,'attributes':_0x56dde1[_0xb45e('0x20')]?_0x56dde1['options']['attributes']||null:null,'include':_0x56dde1['options']?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x56dde1[_0xb45e('0x20')]['include'],function(_0x559bb0){return{'model':db[_0x559bb0[_0xb45e('0x25')]],'as':_0x559bb0['as'],'attributes':_0x559bb0[_0xb45e('0x26')],'include':_0x559bb0[_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x559bb0[_0xb45e('0x23')],function(_0x12a79c){return{'model':db[_0x12a79c[_0xb45e('0x25')]],'as':_0x12a79c['as'],'attributes':_0x12a79c[_0xb45e('0x26')],'include':_0x12a79c['include']?_['map'](_0x12a79c['include'],function(_0x5bf040){return{'model':db[_0x5bf040[_0xb45e('0x25')]],'as':_0x5bf040['as'],'attributes':_0x5bf040['attributes']};}):[]};}):[]};}):[]:[]})[_0xb45e('0x13')](function(_0x7582fb){logger[_0xb45e('0x27')]('ShowVoiceQueue',_0x56dde1);logger['debug'](_0xb45e('0x28'),_0x56dde1,JSON['stringify'](_0x7582fb));_0x2ca6d1(_0x7582fb);})[_0xb45e('0x1d')](function(_0x2d5568){logger[_0xb45e('0x19')]('ShowVoiceQueue',_0x2d5568['message'],_0x56dde1);_0x526587(_0x56f0b9[_0xb45e('0x19')](0x1f4,_0x2d5568[_0xb45e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 87297f5..8904cd4 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 _0x48c0=['removeListener','register','length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x1a1f8f,_0x5b8ffa){var _0xd750cf=function(_0x4c84ec){while(--_0x4c84ec){_0x1a1f8f['push'](_0x1a1f8f['shift']());}};_0xd750cf(++_0x5b8ffa);}(_0x48c0,0x94));var _0x048c=function(_0xae9ac6,_0x671ba3){_0xae9ac6=_0xae9ac6-0x0;var _0x139f34=_0x48c0[_0xae9ac6];return _0x139f34;};'use strict';var VoiceQueueEvents=require(_0x048c('0x0'));var events=['save',_0x048c('0x1'),_0x048c('0x2')];function createListener(_0x2ae84f,_0x3fd42b){return function(_0x24dc67){_0x3fd42b[_0x048c('0x3')](_0x2ae84f,_0x24dc67);};}function removeListener(_0x59325e,_0x42abba){return function(){VoiceQueueEvents[_0x048c('0x4')](_0x59325e,_0x42abba);};}exports[_0x048c('0x5')]=function(_0x32a12f){for(var _0x4bcf1c=0x0,_0x3eee4d=events[_0x048c('0x6')];_0x4bcf1c<_0x3eee4d;_0x4bcf1c++){var _0x36f992=events[_0x4bcf1c];var _0x415216=createListener(_0x048c('0x7')+_0x36f992,_0x32a12f);VoiceQueueEvents['on'](_0x36f992,_0x415216);}}; \ No newline at end of file +var _0x16fa=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16fa,0x138));var _0xa16f=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x16fa[_0x1fc18b];return _0x16a351;};'use strict';var VoiceQueueEvents=require(_0xa16f('0x0'));var events=[_0xa16f('0x1'),_0xa16f('0x2'),_0xa16f('0x3')];function createListener(_0x2d6433,_0x578aef){return function(_0x3a0159){_0x578aef[_0xa16f('0x4')](_0x2d6433,_0x3a0159);};}function removeListener(_0x580da2,_0x25f3e3){return function(){VoiceQueueEvents[_0xa16f('0x5')](_0x580da2,_0x25f3e3);};}exports[_0xa16f('0x6')]=function(_0x17ee4f){for(var _0x434be2=0x0,_0x13cb42=events[_0xa16f('0x7')];_0x434be2<_0x13cb42;_0x434be2++){var _0x2a5f53=events[_0x434be2];var _0x28a46b=createListener(_0xa16f('0x8')+_0x2a5f53,_0x17ee4f);VoiceQueueEvents['on'](_0x2a5f53,_0x28a46b);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 77b0788..b083b7f 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 _0x486a=['/describe','describe','/index','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index'];(function(_0x367eb3,_0x1da777){var _0x13d9c4=function(_0x4af613){while(--_0x4af613){_0x367eb3['push'](_0x367eb3['shift']());}};_0x13d9c4(++_0x1da777);}(_0x486a,0x1d5));var _0xa486=function(_0x3700fd,_0x5bd346){_0x3700fd=_0x3700fd-0x0;var _0x4ffb6c=_0x486a[_0x3700fd];return _0x4ffb6c;};'use strict';var multer=require('multer');var util=require(_0xa486('0x0'));var path=require(_0xa486('0x1'));var timeout=require(_0xa486('0x2'));var express=require(_0xa486('0x3'));var router=express['Router']();var fs_extra=require(_0xa486('0x4'));var auth=require(_0xa486('0x5'));var interaction=require(_0xa486('0x6'));var config=require('../../config/environment');var controller=require(_0xa486('0x7'));router[_0xa486('0x8')]('/',auth[_0xa486('0x9')](),controller[_0xa486('0xa')]);router[_0xa486('0x8')](_0xa486('0xb'),auth[_0xa486('0x9')](),controller[_0xa486('0xc')]);router[_0xa486('0x8')](_0xa486('0xd'),auth[_0xa486('0x9')](),controller['getVoiceQueuesReport']);router[_0xa486('0x8')](_0xa486('0xe'),auth['isAuthenticated'](),controller[_0xa486('0xf')]);router[_0xa486('0x10')]('/',auth[_0xa486('0x9')](),controller[_0xa486('0x11')]);router['put'](_0xa486('0xe'),auth['isAuthenticated'](),controller[_0xa486('0x12')]);router['delete'](_0xa486('0xe'),auth[_0xa486('0x9')](),controller[_0xa486('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9211=['/describe','isAuthenticated','getVoiceQueuesReport','show','post','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get'];(function(_0x5a5de4,_0x39a14d){var _0x4d631e=function(_0x47dc5a){while(--_0x47dc5a){_0x5a5de4['push'](_0x5a5de4['shift']());}};_0x4d631e(++_0x39a14d);}(_0x9211,0x149));var _0x1921=function(_0x198541,_0x2e1dea){_0x198541=_0x198541-0x0;var _0x24c19a=_0x9211[_0x198541];return _0x24c19a;};'use strict';var multer=require(_0x1921('0x0'));var util=require(_0x1921('0x1'));var path=require(_0x1921('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1921('0x3')]();var fs_extra=require(_0x1921('0x4'));var auth=require(_0x1921('0x5'));var interaction=require(_0x1921('0x6'));var config=require(_0x1921('0x7'));var controller=require(_0x1921('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1921('0x9')]);router[_0x1921('0xa')](_0x1921('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1921('0xa')]('/index',auth[_0x1921('0xc')](),controller[_0x1921('0xd')]);router[_0x1921('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1921('0xe')]);router[_0x1921('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1921('0x10'),auth[_0x1921('0xc')](),controller[_0x1921('0x11')]);router['delete'](_0x1921('0x10'),auth[_0x1921('0xc')](),controller[_0x1921('0x12')]);module[_0x1921('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index efe582d..d379cdb 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 _0x7002=['diff','setDataValue','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x7002,0x11a));var _0x2700=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7002[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2700('0x0'));module[_0x2700('0x1')]={'type':{'type':Sequelize[_0x2700('0x2')]},'uniqueid':{'type':Sequelize[_0x2700('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2700('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x2700('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x2700('0x3')],'set':function(_0x594e6f){var _0x41699f=moment(_0x594e6f);var _0x486f37=moment(this[_0x2700('0x4')](_0x2700('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xe592=_0x41699f[_0x2700('0x6')](_0x486f37,'seconds');this[_0x2700('0x7')]('queuecallerleaveAt',_0x594e6f);this[_0x2700('0x7')](_0x2700('0x8'),_0xe592||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x2700('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2700('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x2700('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2700('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x2700('0x2')],'comment':_0x2700('0xa')},'originalposition':{'type':Sequelize[_0x2700('0xb')]},'channel':{'type':Sequelize[_0x2700('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2700('0x2')]},'connectedlinename':{'type':Sequelize[_0x2700('0x2')]},'accountcode':{'type':Sequelize[_0x2700('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x2700('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2700('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2700('0x2')]},'transfer':{'type':Sequelize[_0x2700('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2700('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x2700('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2700('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2700('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2700('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x2700('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe353=['diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x35acf3,_0x1f383b){var _0x3d024d=function(_0x3839a9){while(--_0x3839a9){_0x35acf3['push'](_0x35acf3['shift']());}};_0x3d024d(++_0x1f383b);}(_0xe353,0xd7));var _0x3e35=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe353[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x3e35('0x0'));var moment=require(_0x3e35('0x1'));module[_0x3e35('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3e35('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e35('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1d59a1){var _0x198322=moment(_0x1d59a1);var _0x4c6eb3=moment(this[_0x3e35('0x5')](_0x3e35('0x6')))[_0x3e35('0x7')](_0x3e35('0x8'));var _0x5c50f2=_0x198322[_0x3e35('0x9')](_0x4c6eb3,_0x3e35('0xa'));this[_0x3e35('0xb')](_0x3e35('0xc'),_0x1d59a1);this['setDataValue']('holdtime',_0x5c50f2||null);}},'position':{'type':Sequelize[_0x3e35('0xd')]},'count':{'type':Sequelize[_0x3e35('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerexit':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x3e35('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3e35('0xd')]},'channel':{'type':Sequelize[_0x3e35('0x3')]},'connectedlinenum':{'type':Sequelize[_0x3e35('0x3')]},'connectedlinename':{'type':Sequelize[_0x3e35('0x3')]},'accountcode':{'type':Sequelize[_0x3e35('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x3e35('0xd')]},'mohtime':{'type':Sequelize[_0x3e35('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3e35('0x3')],'comment':_0x3e35('0xf')},'transferexten':{'type':Sequelize[_0x3e35('0x3')]},'transferuniqueid':{'type':Sequelize[_0x3e35('0x3')]},'disposition':{'type':Sequelize[_0x3e35('0x3')]},'secondDisposition':{'type':Sequelize[_0x3e35('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3e35('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x3e35('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 87fa0ce..48c0cdf 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 _0x5e04=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','name','index','map','rawAttributes','fieldName','model'];(function(_0x5e4cdb,_0x57c17c){var _0x31ebf0=function(_0x2b8483){while(--_0x2b8483){_0x5e4cdb['push'](_0x5e4cdb['shift']());}};_0x31ebf0(++_0x57c17c);}(_0x5e04,0xc6));var _0x45e0=function(_0xd0448e,_0x2d3d92){_0xd0448e=_0xd0448e-0x0;var _0x3563cb=_0x5e04[_0xd0448e];return _0x3563cb;};'use strict';var emlformat=require(_0x45e0('0x0'));var rimraf=require(_0x45e0('0x1'));var zipdir=require(_0x45e0('0x2'));var jsonpatch=require(_0x45e0('0x3'));var rp=require(_0x45e0('0x4'));var moment=require(_0x45e0('0x5'));var BPromise=require(_0x45e0('0x6'));var Mustache=require(_0x45e0('0x7'));var util=require(_0x45e0('0x8'));var path=require(_0x45e0('0x9'));var sox=require(_0x45e0('0xa'));var csv=require(_0x45e0('0xb'));var ejs=require(_0x45e0('0xc'));var fs=require('fs');var fs_extra=require(_0x45e0('0xd'));var _=require(_0x45e0('0xe'));var squel=require(_0x45e0('0xf'));var crypto=require('crypto');var jsforce=require(_0x45e0('0x10'));var deskjs=require(_0x45e0('0x11'));var toCsv=require(_0x45e0('0xb'));var querystring=require(_0x45e0('0x12'));var Papa=require(_0x45e0('0x13'));var Redis=require('ioredis');var authService=require(_0x45e0('0x14'));var qs=require(_0x45e0('0x15'));var as=require(_0x45e0('0x16'));var hardwareService=require(_0x45e0('0x17'));var logger=require(_0x45e0('0x18'))(_0x45e0('0x19'));var utils=require(_0x45e0('0x1a'));var config=require(_0x45e0('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x45e0('0x1c'))['db'];config['redis']=_[_0x45e0('0x1d')](config['redis'],{'host':_0x45e0('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45e0('0x1f')]));require(_0x45e0('0x20'))[_0x45e0('0x21')](socket);function respondWithStatusCode(_0x4e3f71,_0x210157){_0x210157=_0x210157||0xcc;return function(_0x3ef0ea){if(_0x3ef0ea){return _0x4e3f71[_0x45e0('0x22')](_0x210157);}return _0x4e3f71[_0x45e0('0x23')](_0x210157)[_0x45e0('0x24')]();};}function respondWithResult(_0x33c37d,_0x13168b){_0x13168b=_0x13168b||0xc8;return function(_0x5de7c4){if(_0x5de7c4){return _0x33c37d[_0x45e0('0x23')](_0x13168b)[_0x45e0('0x25')](_0x5de7c4);}};}function respondWithFilteredResult(_0x55c3b3,_0x13fc32){return function(_0x2a1ddf){if(_0x2a1ddf){var _0x3ce949=typeof _0x13fc32[_0x45e0('0x26')]===_0x45e0('0x27')&&typeof _0x13fc32[_0x45e0('0x28')]===_0x45e0('0x27');var _0x48769c=_0x2a1ddf[_0x45e0('0x29')];var _0x5f3500=_0x3ce949?0x0:_0x13fc32['offset'];var _0x1a2b44=_0x3ce949?_0x2a1ddf[_0x45e0('0x29')]:_0x13fc32[_0x45e0('0x26')]+_0x13fc32[_0x45e0('0x28')];var _0x39523e;if(_0x1a2b44>=_0x48769c){_0x1a2b44=_0x48769c;_0x39523e=0xc8;}else{_0x39523e=0xce;}_0x55c3b3[_0x45e0('0x23')](_0x39523e);return _0x55c3b3[_0x45e0('0x2a')](_0x45e0('0x2b'),_0x5f3500+'-'+_0x1a2b44+'/'+_0x48769c)[_0x45e0('0x25')](_0x2a1ddf);}return null;};}function patchUpdates(_0x588336){return function(_0x2a3a61){try{jsonpatch['apply'](_0x2a3a61,_0x588336,!![]);}catch(_0x3f768f){return BPromise[_0x45e0('0x2c')](_0x3f768f);}return _0x2a3a61[_0x45e0('0x2d')]();};}function saveUpdates(_0x5b3367,_0x5bb0c2){return function(_0x5c8b26){if(_0x5c8b26){return _0x5c8b26['update'](_0x5b3367)[_0x45e0('0x2e')](function(_0x17ebb4){return _0x17ebb4;});}return null;};}function removeEntity(_0x629ad3,_0x119c9a){return function(_0x10cd59){if(_0x10cd59){return _0x10cd59[_0x45e0('0x2f')]()[_0x45e0('0x2e')](function(){_0x629ad3[_0x45e0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51db6f,_0x4c56be){return function(_0x580a8d){if(!_0x580a8d){_0x51db6f[_0x45e0('0x22')](0x194);}return _0x580a8d;};}function handleError(_0x8c21ce,_0xdc23d5){_0xdc23d5=_0xdc23d5||0x1f4;return function(_0x2652aa){logger['error'](_0x2652aa['stack']);if(_0x2652aa[_0x45e0('0x30')]){delete _0x2652aa[_0x45e0('0x30')];}_0x8c21ce[_0x45e0('0x23')](_0xdc23d5)['send'](_0x2652aa);};}exports[_0x45e0('0x31')]=function(_0x36b6ae,_0x5159e5){var _0x4539b2={},_0x3e1984={},_0x4d57e7={'count':0x0,'rows':[]};var _0x5e0c49=_[_0x45e0('0x32')](db['VoiceQueueReport'][_0x45e0('0x33')],function(_0x512ed7){return{'name':_0x512ed7[_0x45e0('0x34')],'type':_0x512ed7['type']['key']};});_0x3e1984[_0x45e0('0x35')]=_[_0x45e0('0x32')](_0x5e0c49,_0x45e0('0x30'));_0x3e1984[_0x45e0('0x36')]=_['keys'](_0x36b6ae[_0x45e0('0x36')]);_0x3e1984[_0x45e0('0x37')]=_[_0x45e0('0x38')](_0x3e1984['model'],_0x3e1984['query']);_0x4539b2[_0x45e0('0x39')]=_[_0x45e0('0x38')](_0x3e1984[_0x45e0('0x35')],qs[_0x45e0('0x3a')](_0x36b6ae[_0x45e0('0x36')]['fields']));_0x4539b2['attributes']=_0x4539b2[_0x45e0('0x39')][_0x45e0('0x3b')]?_0x4539b2[_0x45e0('0x39')]:_0x3e1984[_0x45e0('0x35')];if(!_0x36b6ae['query'][_0x45e0('0x3c')](_0x45e0('0x3d'))){_0x4539b2[_0x45e0('0x28')]=qs[_0x45e0('0x28')](_0x36b6ae[_0x45e0('0x36')][_0x45e0('0x28')]);_0x4539b2[_0x45e0('0x26')]=qs[_0x45e0('0x26')](_0x36b6ae[_0x45e0('0x36')][_0x45e0('0x26')]);}_0x4539b2[_0x45e0('0x3e')]=qs[_0x45e0('0x3f')](_0x36b6ae[_0x45e0('0x36')][_0x45e0('0x3f')]);_0x4539b2['where']=qs[_0x45e0('0x37')](_[_0x45e0('0x40')](_0x36b6ae['query'],_0x3e1984[_0x45e0('0x37')]),_0x5e0c49);if(_0x36b6ae['query'][_0x45e0('0x41')]){_0x4539b2[_0x45e0('0x42')]=_[_0x45e0('0x43')](_0x4539b2['where'],{'$or':_[_0x45e0('0x32')](_0x5e0c49,function(_0x44b08a){if(_0x44b08a[_0x45e0('0x44')]!=='VIRTUAL'){var _0x101b84={};_0x101b84[_0x44b08a['name']]={'$like':'%'+_0x36b6ae[_0x45e0('0x36')][_0x45e0('0x41')]+'%'};return _0x101b84;}})});}_0x4539b2=_[_0x45e0('0x43')]({},_0x4539b2,_0x36b6ae[_0x45e0('0x45')]);var _0x22fab7={'where':_0x4539b2[_0x45e0('0x42')]};return db[_0x45e0('0x46')][_0x45e0('0x29')](_0x22fab7)['then'](function(_0xca14ce){_0x4d57e7['count']=_0xca14ce;if(_0x36b6ae[_0x45e0('0x36')][_0x45e0('0x47')]){_0x4539b2[_0x45e0('0x48')]=[{'all':!![]}];}return db[_0x45e0('0x46')][_0x45e0('0x49')](_0x4539b2);})[_0x45e0('0x2e')](function(_0xf79c14){_0x4d57e7[_0x45e0('0x4a')]=_0xf79c14;return _0x4d57e7;})['then'](respondWithFilteredResult(_0x5159e5,_0x4539b2))[_0x45e0('0x4b')](handleError(_0x5159e5,null));};exports[_0x45e0('0x4c')]=function(_0x33a2ef,_0x35ea22){var _0x1eca48={'raw':![],'where':{'id':_0x33a2ef[_0x45e0('0x4d')]['id']}},_0xf6e34a={};_0xf6e34a[_0x45e0('0x35')]=_[_0x45e0('0x4e')](db[_0x45e0('0x46')][_0x45e0('0x33')]);_0xf6e34a['query']=_[_0x45e0('0x4e')](_0x33a2ef[_0x45e0('0x36')]);_0xf6e34a['filters']=_[_0x45e0('0x38')](_0xf6e34a[_0x45e0('0x35')],_0xf6e34a['query']);_0x1eca48['attributes']=_[_0x45e0('0x38')](_0xf6e34a[_0x45e0('0x35')],qs[_0x45e0('0x3a')](_0x33a2ef[_0x45e0('0x36')][_0x45e0('0x3a')]));_0x1eca48[_0x45e0('0x39')]=_0x1eca48[_0x45e0('0x39')][_0x45e0('0x3b')]?_0x1eca48[_0x45e0('0x39')]:_0xf6e34a[_0x45e0('0x35')];if(_0x33a2ef['query'][_0x45e0('0x47')]){_0x1eca48[_0x45e0('0x48')]=[{'all':!![]}];}_0x1eca48=_['merge']({},_0x1eca48,_0x33a2ef[_0x45e0('0x45')]);return db[_0x45e0('0x46')][_0x45e0('0x4f')](_0x1eca48)[_0x45e0('0x2e')](handleEntityNotFound(_0x35ea22,null))['then'](respondWithResult(_0x35ea22,null))[_0x45e0('0x4b')](handleError(_0x35ea22,null));};exports['create']=function(_0x528152,_0x2896f5){return db[_0x45e0('0x46')][_0x45e0('0x50')](_0x528152[_0x45e0('0x51')],{})['then'](respondWithResult(_0x2896f5,0xc9))[_0x45e0('0x4b')](handleError(_0x2896f5,null));};exports['update']=function(_0xd710af,_0x4f1d05){if(_0xd710af['body']['id']){delete _0xd710af[_0x45e0('0x51')]['id'];}return db[_0x45e0('0x46')][_0x45e0('0x4f')]({'where':{'id':_0xd710af[_0x45e0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f1d05,null))[_0x45e0('0x2e')](saveUpdates(_0xd710af[_0x45e0('0x51')],null))[_0x45e0('0x2e')](respondWithResult(_0x4f1d05,null))[_0x45e0('0x4b')](handleError(_0x4f1d05,null));};exports[_0x45e0('0x2f')]=function(_0x534bf4,_0x1d822c){return db[_0x45e0('0x46')][_0x45e0('0x4f')]({'where':{'id':_0x534bf4[_0x45e0('0x4d')]['id']}})[_0x45e0('0x2e')](handleEntityNotFound(_0x1d822c,null))['then'](removeEntity(_0x1d822c,null))[_0x45e0('0x4b')](handleError(_0x1d822c,null));};exports[_0x45e0('0x52')]=function(_0x1af2dd,_0x3ae6bd){return db['VoiceQueueReport']['describe']()[_0x45e0('0x2e')](respondWithResult(_0x3ae6bd,null))[_0x45e0('0x4b')](handleError(_0x3ae6bd,null));};exports[_0x45e0('0x53')]=function(_0x455144,_0x2d6072){var _0x2df77c={},_0xa4c601={},_0x440dc8={'count':0x0,'rows':[]};_0xa4c601[_0x45e0('0x35')]=_[_0x45e0('0x4e')](db[_0x45e0('0x46')][_0x45e0('0x33')]);_0xa4c601[_0x45e0('0x36')]=_[_0x45e0('0x4e')](_0x455144[_0x45e0('0x36')]);_0xa4c601[_0x45e0('0x37')]=_['intersection'](_0xa4c601['model'],_0xa4c601[_0x45e0('0x36')]);_0x2df77c[_0x45e0('0x39')]=_[_0x45e0('0x38')](_0xa4c601[_0x45e0('0x35')],qs[_0x45e0('0x3a')](_0x455144[_0x45e0('0x36')][_0x45e0('0x3a')]));_0x2df77c[_0x45e0('0x39')]=_0x2df77c['attributes']['length']?_0x2df77c[_0x45e0('0x39')]:_0xa4c601['model'];if(!_0x455144['query'][_0x45e0('0x3c')](_0x45e0('0x3d'))){_0x2df77c[_0x45e0('0x28')]=qs[_0x45e0('0x28')](_0x455144[_0x45e0('0x36')][_0x45e0('0x28')]);_0x2df77c['offset']=qs['offset'](_0x455144[_0x45e0('0x36')][_0x45e0('0x26')]);}_0x2df77c['order']=qs[_0x45e0('0x3f')](_0x455144[_0x45e0('0x36')][_0x45e0('0x3f')]);_0x2df77c['where']=qs[_0x45e0('0x37')](_['pick'](_0x455144[_0x45e0('0x36')],_0xa4c601[_0x45e0('0x37')]));if(_0x455144[_0x45e0('0x36')][_0x45e0('0x41')]){_0x2df77c[_0x45e0('0x42')]=_['merge'](_0x2df77c['where'],{'$or':_[_0x45e0('0x32')](_0x2df77c['attributes'],function(_0x34c456){var _0x2113ad={};_0x2113ad[_0x34c456]={'$like':'%'+_0x455144[_0x45e0('0x36')][_0x45e0('0x41')]+'%'};return _0x2113ad;})});}_0x2df77c=_['merge']({},_0x2df77c,_0x455144[_0x45e0('0x45')]);var _0x149a23={'where':_0x2df77c[_0x45e0('0x42')]};return db[_0x45e0('0x46')][_0x45e0('0x29')](_0x149a23)[_0x45e0('0x2e')](function(_0x3e8e13){_0x440dc8['count']=_0x3e8e13;if(_0x455144['query'][_0x45e0('0x47')]){_0x2df77c[_0x45e0('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x45e0('0x49')](_0x2df77c);})[_0x45e0('0x2e')](function(_0x35c705){_0x440dc8[_0x45e0('0x4a')]=_0x35c705;return _0x440dc8;})['then'](respondWithFilteredResult(_0x2d6072,_0x2df77c,_0x45e0('0x53')))[_0x45e0('0x4b')](handleError(_0x2d6072,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x6923=['length','includeAll','find','create','body','params','describe','hasOwnProperty','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','VoiceQueueReport','include','findAll','rows','catch'];(function(_0x234219,_0x4780e1){var _0x48c92a=function(_0x6c67d0){while(--_0x6c67d0){_0x234219['push'](_0x234219['shift']());}};_0x48c92a(++_0x4780e1);}(_0x6923,0x1b3));var _0x3692=function(_0x2f27c0,_0x1bd063){_0x2f27c0=_0x2f27c0-0x0;var _0x1b95ae=_0x6923[_0x2f27c0];return _0x1b95ae;};'use strict';var emlformat=require(_0x3692('0x0'));var rimraf=require(_0x3692('0x1'));var zipdir=require(_0x3692('0x2'));var jsonpatch=require(_0x3692('0x3'));var rp=require(_0x3692('0x4'));var moment=require('moment');var BPromise=require(_0x3692('0x5'));var Mustache=require(_0x3692('0x6'));var util=require(_0x3692('0x7'));var path=require('path');var sox=require(_0x3692('0x8'));var csv=require(_0x3692('0x9'));var ejs=require(_0x3692('0xa'));var fs=require('fs');var fs_extra=require(_0x3692('0xb'));var _=require(_0x3692('0xc'));var squel=require(_0x3692('0xd'));var crypto=require(_0x3692('0xe'));var jsforce=require(_0x3692('0xf'));var deskjs=require(_0x3692('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3692('0x11'));var Redis=require(_0x3692('0x12'));var authService=require(_0x3692('0x13'));var qs=require(_0x3692('0x14'));var as=require(_0x3692('0x15'));var hardwareService=require(_0x3692('0x16'));var logger=require(_0x3692('0x17'))('api');var utils=require(_0x3692('0x18'));var config=require(_0x3692('0x19'));var licenseUtil=require(_0x3692('0x1a'));var db=require(_0x3692('0x1b'))['db'];config['redis']=_[_0x3692('0x1c')](config[_0x3692('0x1d')],{'host':_0x3692('0x1e'),'port':0x18eb});var socket=require(_0x3692('0x1f'))(new Redis(config[_0x3692('0x1d')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x45a4ba,_0x591540){_0x591540=_0x591540||0xcc;return function(_0x3487ad){if(_0x3487ad){return _0x45a4ba[_0x3692('0x20')](_0x591540);}return _0x45a4ba[_0x3692('0x21')](_0x591540)[_0x3692('0x22')]();};}function respondWithResult(_0x18fe37,_0x21a059){_0x21a059=_0x21a059||0xc8;return function(_0x49bc38){if(_0x49bc38){return _0x18fe37['status'](_0x21a059)['json'](_0x49bc38);}};}function respondWithFilteredResult(_0x1029cc,_0x27bda9){return function(_0x505b6f){if(_0x505b6f){var _0x474b2a=typeof _0x27bda9[_0x3692('0x23')]===_0x3692('0x24')&&typeof _0x27bda9['limit']===_0x3692('0x24');var _0x1eb92d=_0x505b6f[_0x3692('0x25')];var _0xe1a4b3=_0x474b2a?0x0:_0x27bda9['offset'];var _0x5f5f0b=_0x474b2a?_0x505b6f[_0x3692('0x25')]:_0x27bda9['offset']+_0x27bda9[_0x3692('0x26')];var _0x2d3d33;if(_0x5f5f0b>=_0x1eb92d){_0x5f5f0b=_0x1eb92d;_0x2d3d33=0xc8;}else{_0x2d3d33=0xce;}_0x1029cc[_0x3692('0x21')](_0x2d3d33);return _0x1029cc[_0x3692('0x27')](_0x3692('0x28'),_0xe1a4b3+'-'+_0x5f5f0b+'/'+_0x1eb92d)['json'](_0x505b6f);}return null;};}function patchUpdates(_0x586f7d){return function(_0xcd426d){try{jsonpatch[_0x3692('0x29')](_0xcd426d,_0x586f7d,!![]);}catch(_0x95e8a){return BPromise[_0x3692('0x2a')](_0x95e8a);}return _0xcd426d[_0x3692('0x2b')]();};}function saveUpdates(_0x454add,_0x36d78b){return function(_0x21f26c){if(_0x21f26c){return _0x21f26c[_0x3692('0x2c')](_0x454add)['then'](function(_0x5cbdbb){return _0x5cbdbb;});}return null;};}function removeEntity(_0x5efc46,_0x2203ab){return function(_0x1ba7b5){if(_0x1ba7b5){return _0x1ba7b5[_0x3692('0x2d')]()[_0x3692('0x2e')](function(){_0x5efc46['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6aef,_0x5e2e14){return function(_0x59437f){if(!_0x59437f){_0x1c6aef[_0x3692('0x20')](0x194);}return _0x59437f;};}function handleError(_0x6cab72,_0x48c4ea){_0x48c4ea=_0x48c4ea||0x1f4;return function(_0x323786){logger['error'](_0x323786[_0x3692('0x2f')]);if(_0x323786['name']){delete _0x323786[_0x3692('0x30')];}_0x6cab72[_0x3692('0x21')](_0x48c4ea)[_0x3692('0x31')](_0x323786);};}exports[_0x3692('0x32')]=function(_0x243df6,_0x172143){var _0x4e698b={},_0x19602e={},_0x478ceb={'count':0x0,'rows':[]};var _0x263691=_[_0x3692('0x33')](db['VoiceQueueReport'][_0x3692('0x34')],function(_0x1575ac){return{'name':_0x1575ac['fieldName'],'type':_0x1575ac[_0x3692('0x35')][_0x3692('0x36')]};});_0x19602e[_0x3692('0x37')]=_[_0x3692('0x33')](_0x263691,_0x3692('0x30'));_0x19602e[_0x3692('0x38')]=_[_0x3692('0x39')](_0x243df6[_0x3692('0x38')]);_0x19602e[_0x3692('0x3a')]=_[_0x3692('0x3b')](_0x19602e['model'],_0x19602e['query']);_0x4e698b[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x19602e[_0x3692('0x37')],qs[_0x3692('0x3d')](_0x243df6[_0x3692('0x38')][_0x3692('0x3d')]));_0x4e698b[_0x3692('0x3c')]=_0x4e698b[_0x3692('0x3c')]['length']?_0x4e698b[_0x3692('0x3c')]:_0x19602e[_0x3692('0x37')];if(!_0x243df6[_0x3692('0x38')]['hasOwnProperty'](_0x3692('0x3e'))){_0x4e698b[_0x3692('0x26')]=qs[_0x3692('0x26')](_0x243df6[_0x3692('0x38')][_0x3692('0x26')]);_0x4e698b[_0x3692('0x23')]=qs[_0x3692('0x23')](_0x243df6[_0x3692('0x38')][_0x3692('0x23')]);}_0x4e698b['order']=qs[_0x3692('0x3f')](_0x243df6[_0x3692('0x38')][_0x3692('0x3f')]);_0x4e698b['where']=qs[_0x3692('0x3a')](_[_0x3692('0x40')](_0x243df6[_0x3692('0x38')],_0x19602e[_0x3692('0x3a')]),_0x263691);if(_0x243df6[_0x3692('0x38')][_0x3692('0x41')]){_0x4e698b['where']=_[_0x3692('0x42')](_0x4e698b['where'],{'$or':_[_0x3692('0x33')](_0x263691,function(_0x1243ea){if(_0x1243ea[_0x3692('0x35')]!==_0x3692('0x43')){var _0x522cc2={};_0x522cc2[_0x1243ea[_0x3692('0x30')]]={'$like':'%'+_0x243df6[_0x3692('0x38')]['filter']+'%'};return _0x522cc2;}})});}_0x4e698b=_[_0x3692('0x42')]({},_0x4e698b,_0x243df6[_0x3692('0x44')]);var _0x1729fe={'where':_0x4e698b[_0x3692('0x45')]};return db[_0x3692('0x46')][_0x3692('0x25')](_0x1729fe)[_0x3692('0x2e')](function(_0x10564b){_0x478ceb['count']=_0x10564b;if(_0x243df6[_0x3692('0x38')]['includeAll']){_0x4e698b[_0x3692('0x47')]=[{'all':!![]}];}return db[_0x3692('0x46')][_0x3692('0x48')](_0x4e698b);})[_0x3692('0x2e')](function(_0x5e4644){_0x478ceb[_0x3692('0x49')]=_0x5e4644;return _0x478ceb;})[_0x3692('0x2e')](respondWithFilteredResult(_0x172143,_0x4e698b))[_0x3692('0x4a')](handleError(_0x172143,null));};exports['show']=function(_0x31bd5b,_0x381ef6){var _0x59a933={'raw':![],'where':{'id':_0x31bd5b['params']['id']}},_0x1bbbc6={};_0x1bbbc6[_0x3692('0x37')]=_['keys'](db[_0x3692('0x46')][_0x3692('0x34')]);_0x1bbbc6[_0x3692('0x38')]=_['keys'](_0x31bd5b[_0x3692('0x38')]);_0x1bbbc6[_0x3692('0x3a')]=_[_0x3692('0x3b')](_0x1bbbc6['model'],_0x1bbbc6[_0x3692('0x38')]);_0x59a933[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x1bbbc6[_0x3692('0x37')],qs['fields'](_0x31bd5b[_0x3692('0x38')]['fields']));_0x59a933['attributes']=_0x59a933['attributes'][_0x3692('0x4b')]?_0x59a933[_0x3692('0x3c')]:_0x1bbbc6['model'];if(_0x31bd5b[_0x3692('0x38')][_0x3692('0x4c')]){_0x59a933['include']=[{'all':!![]}];}_0x59a933=_[_0x3692('0x42')]({},_0x59a933,_0x31bd5b['options']);return db[_0x3692('0x46')][_0x3692('0x4d')](_0x59a933)[_0x3692('0x2e')](handleEntityNotFound(_0x381ef6,null))[_0x3692('0x2e')](respondWithResult(_0x381ef6,null))[_0x3692('0x4a')](handleError(_0x381ef6,null));};exports[_0x3692('0x4e')]=function(_0x2a36d7,_0x40ba4e){return db[_0x3692('0x46')][_0x3692('0x4e')](_0x2a36d7[_0x3692('0x4f')],{})['then'](respondWithResult(_0x40ba4e,0xc9))[_0x3692('0x4a')](handleError(_0x40ba4e,null));};exports[_0x3692('0x2c')]=function(_0x1c2c39,_0x56d11e){if(_0x1c2c39['body']['id']){delete _0x1c2c39[_0x3692('0x4f')]['id'];}return db['VoiceQueueReport'][_0x3692('0x4d')]({'where':{'id':_0x1c2c39[_0x3692('0x50')]['id']}})[_0x3692('0x2e')](handleEntityNotFound(_0x56d11e,null))[_0x3692('0x2e')](saveUpdates(_0x1c2c39[_0x3692('0x4f')],null))['then'](respondWithResult(_0x56d11e,null))[_0x3692('0x4a')](handleError(_0x56d11e,null));};exports[_0x3692('0x2d')]=function(_0x4301c9,_0x4eab31){return db['VoiceQueueReport'][_0x3692('0x4d')]({'where':{'id':_0x4301c9[_0x3692('0x50')]['id']}})[_0x3692('0x2e')](handleEntityNotFound(_0x4eab31,null))['then'](removeEntity(_0x4eab31,null))['catch'](handleError(_0x4eab31,null));};exports[_0x3692('0x51')]=function(_0x12d383,_0x5162e9){return db[_0x3692('0x46')][_0x3692('0x51')]()['then'](respondWithResult(_0x5162e9,null))[_0x3692('0x4a')](handleError(_0x5162e9,null));};exports['getVoiceQueuesReport']=function(_0x31dd95,_0x43df25){var _0x3874d5={},_0x31d5ce={},_0x5b14dd={'count':0x0,'rows':[]};_0x31d5ce['model']=_[_0x3692('0x39')](db[_0x3692('0x46')]['rawAttributes']);_0x31d5ce[_0x3692('0x38')]=_['keys'](_0x31dd95[_0x3692('0x38')]);_0x31d5ce[_0x3692('0x3a')]=_['intersection'](_0x31d5ce[_0x3692('0x37')],_0x31d5ce['query']);_0x3874d5[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x31d5ce[_0x3692('0x37')],qs[_0x3692('0x3d')](_0x31dd95[_0x3692('0x38')][_0x3692('0x3d')]));_0x3874d5[_0x3692('0x3c')]=_0x3874d5[_0x3692('0x3c')][_0x3692('0x4b')]?_0x3874d5[_0x3692('0x3c')]:_0x31d5ce[_0x3692('0x37')];if(!_0x31dd95[_0x3692('0x38')][_0x3692('0x52')](_0x3692('0x3e'))){_0x3874d5[_0x3692('0x26')]=qs[_0x3692('0x26')](_0x31dd95[_0x3692('0x38')]['limit']);_0x3874d5[_0x3692('0x23')]=qs[_0x3692('0x23')](_0x31dd95[_0x3692('0x38')][_0x3692('0x23')]);}_0x3874d5[_0x3692('0x53')]=qs['sort'](_0x31dd95['query']['sort']);_0x3874d5[_0x3692('0x45')]=qs[_0x3692('0x3a')](_[_0x3692('0x40')](_0x31dd95['query'],_0x31d5ce['filters']));if(_0x31dd95[_0x3692('0x38')][_0x3692('0x41')]){_0x3874d5['where']=_['merge'](_0x3874d5['where'],{'$or':_[_0x3692('0x33')](_0x3874d5[_0x3692('0x3c')],function(_0x328894){var _0x5c66d3={};_0x5c66d3[_0x328894]={'$like':'%'+_0x31dd95[_0x3692('0x38')]['filter']+'%'};return _0x5c66d3;})});}_0x3874d5=_['merge']({},_0x3874d5,_0x31dd95[_0x3692('0x44')]);var _0x5e6560={'where':_0x3874d5[_0x3692('0x45')]};return db['VoiceQueueReport'][_0x3692('0x25')](_0x5e6560)[_0x3692('0x2e')](function(_0x3f8fd4){_0x5b14dd[_0x3692('0x25')]=_0x3f8fd4;if(_0x31dd95[_0x3692('0x38')][_0x3692('0x4c')]){_0x3874d5[_0x3692('0x47')]=[{'all':!![]}];}return db[_0x3692('0x46')]['findAll'](_0x3874d5);})[_0x3692('0x2e')](function(_0x44d29e){_0x5b14dd[_0x3692('0x49')]=_0x44d29e;return _0x5b14dd;})[_0x3692('0x2e')](respondWithFilteredResult(_0x43df25,_0x3874d5,_0x3692('0x54')))['catch'](handleError(_0x43df25,null,_0x3692('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 49b3211..905ad6d 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 _0x7950=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x43900d,_0x2913fe){var _0x943ec7=function(_0x415221){while(--_0x415221){_0x43900d['push'](_0x43900d['shift']());}};_0x943ec7(++_0x2913fe);}(_0x7950,0x1c1));var _0x0795=function(_0x3551c9,_0x3df29c){_0x3551c9=_0x3551c9-0x0;var _0x41875d=_0x7950[_0x3551c9];return _0x41875d;};'use strict';var EventEmitter=require(_0x0795('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x0795('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0795('0x2')](0x0);var events={'afterCreate':_0x0795('0x3'),'afterUpdate':_0x0795('0x4'),'afterDestroy':_0x0795('0x5')};function emitEvent(_0x34e72f){return function(_0x5e71fa,_0x3bdd6c,_0x8bc93b){VoiceQueueReportEvents[_0x0795('0x6')](_0x34e72f+':'+_0x5e71fa['id'],_0x5e71fa);VoiceQueueReportEvents['emit'](_0x34e72f,_0x5e71fa);_0x8bc93b(null);};}for(var e in events){if(events[_0x0795('0x7')](e)){var event=events[e];VoiceQueueReport[_0x0795('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x628c=['events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x628c,0x10e));var _0xc628=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x628c[_0x5d72da];return _0x43ebe7;};'use strict';var EventEmitter=require(_0xc628('0x0'));var VoiceQueueReport=require(_0xc628('0x1'))['db'][_0xc628('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc628('0x3'),'afterUpdate':_0xc628('0x4'),'afterDestroy':_0xc628('0x5')};function emitEvent(_0x265a78){return function(_0x26d0c4,_0x4a994c,_0x44f098){VoiceQueueReportEvents[_0xc628('0x6')](_0x265a78+':'+_0x26d0c4['id'],_0x26d0c4);VoiceQueueReportEvents['emit'](_0x265a78,_0x26d0c4);_0x44f098(null);};}for(var e in events){if(events[_0xc628('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xc628('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index de1e0be..5ce66b6 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 _0x692b=['report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x53b6b8,_0x3b888d){var _0x3875b0=function(_0x289bbd){while(--_0x289bbd){_0x53b6b8['push'](_0x53b6b8['shift']());}};_0x3875b0(++_0x3b888d);}(_0x692b,0x179));var _0xb692=function(_0x1580ec,_0x9438fa){_0x1580ec=_0x1580ec-0x0;var _0x5ca286=_0x692b[_0x1580ec];return _0x5ca286;};'use strict';var _=require(_0xb692('0x0'));var util=require('util');var logger=require(_0xb692('0x1'))(_0xb692('0x2'));var moment=require(_0xb692('0x3'));var BPromise=require(_0xb692('0x4'));var rp=require(_0xb692('0x5'));var fs=require('fs');var path=require(_0xb692('0x6'));var rimraf=require(_0xb692('0x7'));var config=require(_0xb692('0x8'));var attributes=require(_0xb692('0x9'));module[_0xb692('0xa')]=function(_0x9a86b1,_0x1e0929){return _0x9a86b1[_0xb692('0xb')](_0xb692('0xc'),attributes,{'tableName':_0xb692('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xb692('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf41a=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','lodash','../../config/logger','api','moment','request-promise'];(function(_0x246ec8,_0x52a0df){var _0x441003=function(_0x18d070){while(--_0x18d070){_0x246ec8['push'](_0x246ec8['shift']());}};_0x441003(++_0x52a0df);}(_0xf41a,0x14d));var _0xaf41=function(_0x42cf3b,_0x3bb5d7){_0x42cf3b=_0x42cf3b-0x0;var _0x416c2d=_0xf41a[_0x42cf3b];return _0x416c2d;};'use strict';var _=require(_0xaf41('0x0'));var util=require('util');var logger=require(_0xaf41('0x1'))(_0xaf41('0x2'));var moment=require(_0xaf41('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf41('0x4'));var fs=require('fs');var path=require(_0xaf41('0x5'));var rimraf=require(_0xaf41('0x6'));var config=require(_0xaf41('0x7'));var attributes=require(_0xaf41('0x8'));module[_0xaf41('0x9')]=function(_0x3855b3,_0x1374a3){return _0x3855b3[_0xaf41('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xaf41('0xb'),'paranoid':![],'indexes':[{'fields':[_0xaf41('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e49bfde..3dd3370 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 _0xcd40=['map','attributes','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','model','include'];(function(_0x28f2e6,_0x1d1fb7){var _0x2e16f6=function(_0x230ea4){while(--_0x230ea4){_0x28f2e6['push'](_0x28f2e6['shift']());}};_0x2e16f6(++_0x1d1fb7);}(_0xcd40,0xae));var _0x0cd4=function(_0x374459,_0x49ea0a){_0x374459=_0x374459-0x0;var _0x3da4ab=_0xcd40[_0x374459];return _0x3da4ab;};'use strict';var _=require(_0x0cd4('0x0'));var util=require(_0x0cd4('0x1'));var moment=require(_0x0cd4('0x2'));var BPromise=require('bluebird');var rs=require(_0x0cd4('0x3'));var fs=require('fs');var Redis=require(_0x0cd4('0x4'));var db=require(_0x0cd4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cd4('0x6'))(_0x0cd4('0x7'));var config=require(_0x0cd4('0x8'));var jayson=require(_0x0cd4('0x9'));var client=jayson[_0x0cd4('0xa')]['http']({'port':0x232a});config[_0x0cd4('0xb')]=_[_0x0cd4('0xc')](config[_0x0cd4('0xb')],{'host':_0x0cd4('0xd'),'port':0x18eb});var socket=require(_0x0cd4('0xe'))(new Redis(config['redis']));require(_0x0cd4('0xf'))[_0x0cd4('0x10')](socket);function respondWithRpcPromise(_0x4b8442,_0x34e57f,_0x12a194){return new BPromise(function(_0x233e8f,_0x143eb9){return client[_0x0cd4('0x11')](_0x4b8442,_0x12a194)[_0x0cd4('0x12')](function(_0x10eba9){logger['info'](_0x0cd4('0x13'),_0x34e57f,'request\x20sent');logger[_0x0cd4('0x14')](_0x0cd4('0x15'),_0x34e57f,'request\x20sent',JSON[_0x0cd4('0x16')](_0x10eba9));if(_0x10eba9[_0x0cd4('0x17')]){if(_0x10eba9[_0x0cd4('0x17')][_0x0cd4('0x18')]===0x1f4){logger[_0x0cd4('0x17')](_0x0cd4('0x13'),_0x34e57f,_0x10eba9[_0x0cd4('0x17')]['message']);return _0x143eb9(_0x10eba9['error']['message']);}logger[_0x0cd4('0x17')](_0x0cd4('0x13'),_0x34e57f,_0x10eba9[_0x0cd4('0x17')]['message']);return _0x233e8f(_0x10eba9[_0x0cd4('0x17')][_0x0cd4('0x19')]);}else{logger[_0x0cd4('0x1a')](_0x0cd4('0x13'),_0x34e57f,_0x0cd4('0x1b'));_0x233e8f(_0x10eba9[_0x0cd4('0x1c')]['message']);}})[_0x0cd4('0x1d')](function(_0x154816){logger[_0x0cd4('0x17')](_0x0cd4('0x13'),_0x34e57f,_0x154816);_0x143eb9(_0x154816);});});}exports[_0x0cd4('0x1e')]=function(_0x2f5efb){var _0x3ec89f=this;return new Promise(function(_0x2b7532,_0x533970){return db[_0x0cd4('0x1f')]['findAll']({'raw':_0x2f5efb[_0x0cd4('0x20')]?_0x2f5efb['options'][_0x0cd4('0x21')]===undefined?!![]:![]:!![],'where':_0x2f5efb['options']?_0x2f5efb[_0x0cd4('0x20')]['where']||null:null,'attributes':_0x2f5efb[_0x0cd4('0x20')]?_0x2f5efb[_0x0cd4('0x20')]['attributes']||null:null,'limit':_0x2f5efb[_0x0cd4('0x20')]?_0x2f5efb[_0x0cd4('0x20')]['limit']||null:null,'include':_0x2f5efb['options']?_0x2f5efb[_0x0cd4('0x20')]['include']?_['map'](_0x2f5efb[_0x0cd4('0x20')]['include'],function(_0x2793aa){return{'model':db[_0x2793aa[_0x0cd4('0x22')]],'as':_0x2793aa['as'],'attributes':_0x2793aa['attributes'],'include':_0x2793aa[_0x0cd4('0x23')]?_[_0x0cd4('0x24')](_0x2793aa[_0x0cd4('0x23')],function(_0x49ca4f){return{'model':db[_0x49ca4f['model']],'as':_0x49ca4f['as'],'attributes':_0x49ca4f[_0x0cd4('0x25')],'include':_0x49ca4f[_0x0cd4('0x23')]?_[_0x0cd4('0x24')](_0x49ca4f[_0x0cd4('0x23')],function(_0x5ea34a){return{'model':db[_0x5ea34a[_0x0cd4('0x22')]],'as':_0x5ea34a['as'],'attributes':_0x5ea34a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x209a9f){logger[_0x0cd4('0x1a')](_0x0cd4('0x1e'),_0x2f5efb);logger['debug'](_0x0cd4('0x1e'),_0x2f5efb,JSON[_0x0cd4('0x16')](_0x209a9f));_0x2b7532(_0x209a9f);})[_0x0cd4('0x1d')](function(_0x1c6444){logger[_0x0cd4('0x17')](_0x0cd4('0x1e'),_0x1c6444['message'],_0x2f5efb);_0x533970(_0x3ec89f[_0x0cd4('0x17')](0x1f4,_0x1c6444[_0x0cd4('0x19')]));});});};exports[_0x0cd4('0x26')]=function(_0x307496){var _0x49bb6a=this;return new Promise(function(_0x10076c,_0x42a92b){return db['VoiceQueueReport']['create'](_0x307496[_0x0cd4('0x27')],{'raw':_0x307496[_0x0cd4('0x20')]?_0x307496[_0x0cd4('0x20')][_0x0cd4('0x21')]===undefined?!![]:![]:!![]})[_0x0cd4('0x12')](function(_0x3c4593){logger['info'](_0x0cd4('0x26'),_0x307496);logger['debug'](_0x0cd4('0x26'),_0x307496,JSON['stringify'](_0x3c4593));_0x10076c(_0x3c4593);})[_0x0cd4('0x1d')](function(_0x4fac7c){logger[_0x0cd4('0x17')](_0x0cd4('0x26'),_0x4fac7c[_0x0cd4('0x19')],_0x307496);_0x42a92b(_0x49bb6a[_0x0cd4('0x17')](0x1f4,_0x4fac7c[_0x0cd4('0x19')]));});});};exports[_0x0cd4('0x28')]=function(_0x48ecd2){var _0x16931c=this;return new Promise(function(_0x59733f,_0x478aa8){return db[_0x0cd4('0x1f')]['update'](_0x48ecd2[_0x0cd4('0x27')],{'raw':_0x48ecd2[_0x0cd4('0x20')]?_0x48ecd2[_0x0cd4('0x20')][_0x0cd4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48ecd2['options']?_0x48ecd2[_0x0cd4('0x20')]['where']||null:null,'attributes':_0x48ecd2[_0x0cd4('0x20')]?_0x48ecd2[_0x0cd4('0x20')][_0x0cd4('0x25')]||null:null,'limit':_0x48ecd2['options']?_0x48ecd2['options'][_0x0cd4('0x29')]||null:null})['then'](function(_0x3d9fde){logger[_0x0cd4('0x1a')](_0x0cd4('0x28'),_0x48ecd2);logger[_0x0cd4('0x14')](_0x0cd4('0x28'),_0x48ecd2,JSON['stringify'](_0x3d9fde));_0x59733f(_0x3d9fde);})[_0x0cd4('0x1d')](function(_0x3539e2){logger[_0x0cd4('0x17')](_0x0cd4('0x28'),_0x3539e2[_0x0cd4('0x19')],_0x48ecd2);_0x478aa8(_0x16931c[_0x0cd4('0x17')](0x1f4,_0x3539e2[_0x0cd4('0x19')]));});});}; \ No newline at end of file +var _0x6940=['error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e00e2,_0x53ef11){var _0x343019=function(_0x28b313){while(--_0x28b313){_0x1e00e2['push'](_0x1e00e2['shift']());}};_0x343019(++_0x53ef11);}(_0x6940,0x6c));var _0x0694=function(_0x5e7ecd,_0x216998){_0x5e7ecd=_0x5e7ecd-0x0;var _0x3afb7d=_0x6940[_0x5e7ecd];return _0x3afb7d;};'use strict';var _=require('lodash');var util=require(_0x0694('0x0'));var moment=require('moment');var BPromise=require(_0x0694('0x1'));var rs=require(_0x0694('0x2'));var fs=require('fs');var Redis=require(_0x0694('0x3'));var db=require(_0x0694('0x4'))['db'];var utils=require(_0x0694('0x5'));var logger=require(_0x0694('0x6'))(_0x0694('0x7'));var config=require('../../config/environment');var jayson=require(_0x0694('0x8'));var client=jayson[_0x0694('0x9')][_0x0694('0xa')]({'port':0x232a});config['redis']=_[_0x0694('0xb')](config[_0x0694('0xc')],{'host':_0x0694('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0694('0xc')]));require(_0x0694('0xe'))[_0x0694('0xf')](socket);function respondWithRpcPromise(_0x28662e,_0x35a1f4,_0x18ea77){return new BPromise(function(_0x2669b4,_0x5de7b6){return client[_0x0694('0x10')](_0x28662e,_0x18ea77)[_0x0694('0x11')](function(_0x47d9dc){logger[_0x0694('0x12')](_0x0694('0x13'),_0x35a1f4,_0x0694('0x14'));logger[_0x0694('0x15')](_0x0694('0x16'),_0x35a1f4,_0x0694('0x14'),JSON[_0x0694('0x17')](_0x47d9dc));if(_0x47d9dc[_0x0694('0x18')]){if(_0x47d9dc[_0x0694('0x18')][_0x0694('0x19')]===0x1f4){logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);return _0x5de7b6(_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);}logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);return _0x2669b4(_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);}else{logger[_0x0694('0x12')](_0x0694('0x13'),_0x35a1f4,'request\x20sent');_0x2669b4(_0x47d9dc[_0x0694('0x1b')]['message']);}})['catch'](function(_0x55f88d){logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x55f88d);_0x5de7b6(_0x55f88d);});});}exports[_0x0694('0x1c')]=function(_0x344ad5){var _0x3117bf=this;return new Promise(function(_0x4595af,_0x1bfcb1){return db[_0x0694('0x1d')][_0x0694('0x1e')]({'raw':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x20')]===undefined?!![]:![]:!![],'where':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x21')]||null:null,'attributes':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x22')]||null:null,'limit':_0x344ad5['options']?_0x344ad5[_0x0694('0x1f')][_0x0694('0x23')]||null:null,'include':_0x344ad5['options']?_0x344ad5[_0x0694('0x1f')][_0x0694('0x24')]?_['map'](_0x344ad5[_0x0694('0x1f')][_0x0694('0x24')],function(_0x2bebfa){return{'model':db[_0x2bebfa[_0x0694('0x25')]],'as':_0x2bebfa['as'],'attributes':_0x2bebfa[_0x0694('0x22')],'include':_0x2bebfa[_0x0694('0x24')]?_[_0x0694('0x26')](_0x2bebfa[_0x0694('0x24')],function(_0x53bb5b){return{'model':db[_0x53bb5b[_0x0694('0x25')]],'as':_0x53bb5b['as'],'attributes':_0x53bb5b[_0x0694('0x22')],'include':_0x53bb5b['include']?_[_0x0694('0x26')](_0x53bb5b['include'],function(_0x32e2f5){return{'model':db[_0x32e2f5[_0x0694('0x25')]],'as':_0x32e2f5['as'],'attributes':_0x32e2f5[_0x0694('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ac128){logger['info'](_0x0694('0x1c'),_0x344ad5);logger[_0x0694('0x15')](_0x0694('0x1c'),_0x344ad5,JSON['stringify'](_0x2ac128));_0x4595af(_0x2ac128);})[_0x0694('0x27')](function(_0x14d602){logger['error'](_0x0694('0x1c'),_0x14d602[_0x0694('0x1a')],_0x344ad5);_0x1bfcb1(_0x3117bf[_0x0694('0x18')](0x1f4,_0x14d602[_0x0694('0x1a')]));});});};exports[_0x0694('0x28')]=function(_0x1a99b0){var _0x1e10f9=this;return new Promise(function(_0x34bfa1,_0x29912a){return db[_0x0694('0x1d')][_0x0694('0x29')](_0x1a99b0[_0x0694('0x2a')],{'raw':_0x1a99b0[_0x0694('0x1f')]?_0x1a99b0['options'][_0x0694('0x20')]===undefined?!![]:![]:!![]})[_0x0694('0x11')](function(_0x5eb83a){logger['info']('CreateVoiceQueueReport',_0x1a99b0);logger['debug'](_0x0694('0x28'),_0x1a99b0,JSON['stringify'](_0x5eb83a));_0x34bfa1(_0x5eb83a);})[_0x0694('0x27')](function(_0x377770){logger[_0x0694('0x18')]('CreateVoiceQueueReport',_0x377770['message'],_0x1a99b0);_0x29912a(_0x1e10f9[_0x0694('0x18')](0x1f4,_0x377770[_0x0694('0x1a')]));});});};exports[_0x0694('0x2b')]=function(_0x2b375d){var _0x2a417b=this;return new Promise(function(_0x4a58df,_0x4a4f74){return db['VoiceQueueReport']['update'](_0x2b375d[_0x0694('0x2a')],{'raw':_0x2b375d['options']?_0x2b375d['options'][_0x0694('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b375d[_0x0694('0x1f')]?_0x2b375d['options']['where']||null:null,'attributes':_0x2b375d[_0x0694('0x1f')]?_0x2b375d[_0x0694('0x1f')][_0x0694('0x22')]||null:null,'limit':_0x2b375d[_0x0694('0x1f')]?_0x2b375d[_0x0694('0x1f')]['limit']||null:null})['then'](function(_0x587631){logger[_0x0694('0x12')](_0x0694('0x2b'),_0x2b375d);logger[_0x0694('0x15')]('UpdateVoiceQueueReport',_0x2b375d,JSON[_0x0694('0x17')](_0x587631));_0x4a58df(_0x587631);})[_0x0694('0x27')](function(_0xa2039f){logger[_0x0694('0x18')]('UpdateVoiceQueueReport',_0xa2039f[_0x0694('0x1a')],_0x2b375d);_0x4a4f74(_0x2a417b[_0x0694('0x18')](0x1f4,_0xa2039f[_0x0694('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1023d04..2bb0a66 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 _0x135c=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','removeListener','register'];(function(_0x1bcbaf,_0x27c9f2){var _0xeb05e1=function(_0x4e58cb){while(--_0x4e58cb){_0x1bcbaf['push'](_0x1bcbaf['shift']());}};_0xeb05e1(++_0x27c9f2);}(_0x135c,0xda));var _0xc135=function(_0x5a94ea,_0x22ca6d){_0x5a94ea=_0x5a94ea-0x0;var _0x4bcdcf=_0x135c[_0x5a94ea];return _0x4bcdcf;};'use strict';var VoiceQueueReportEvents=require(_0xc135('0x0'));var events=[_0xc135('0x1'),'remove',_0xc135('0x2')];function createListener(_0x59bb32,_0x4d91af){return function(_0xfed959){_0x4d91af[_0xc135('0x3')](_0x59bb32,_0xfed959);};}function removeListener(_0x1d62b8,_0x4fea6a){return function(){VoiceQueueReportEvents[_0xc135('0x4')](_0x1d62b8,_0x4fea6a);};}exports[_0xc135('0x5')]=function(_0x14317c){for(var _0x42cf72=0x0,_0x2467ba=events[_0xc135('0x6')];_0x42cf72<_0x2467ba;_0x42cf72++){var _0x120204=events[_0x42cf72];var _0x2b20a4=createListener(_0xc135('0x7')+_0x120204,_0x14317c);VoiceQueueReportEvents['on'](_0x120204,_0x2b20a4);}}; \ No newline at end of file +var _0x45c9=['save','update','emit','register','length'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x45c9,0x96));var _0x945c=function(_0x268876,_0x36ae04){_0x268876=_0x268876-0x0;var _0x18d29b=_0x45c9[_0x268876];return _0x18d29b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x945c('0x0'),'remove',_0x945c('0x1')];function createListener(_0x10b538,_0x236555){return function(_0xeb0fa7){_0x236555[_0x945c('0x2')](_0x10b538,_0xeb0fa7);};}function removeListener(_0x4fe60a,_0x2dc67c){return function(){VoiceQueueReportEvents['removeListener'](_0x4fe60a,_0x2dc67c);};}exports[_0x945c('0x3')]=function(_0x2e1a4f){for(var _0x46a887=0x0,_0x3c5c07=events[_0x945c('0x4')];_0x46a887<_0x3c5c07;_0x46a887++){var _0x9a988b=events[_0x46a887];var _0x4253bf=createListener('voiceQueueReport:'+_0x9a988b,_0x2e1a4f);VoiceQueueReportEvents['on'](_0x9a988b,_0x4253bf);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index e3023b2..5c2c18f 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 _0x1868=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','/:id','update','destroy','exports','multer','util','express'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x1868,0x1a6));var _0x8186=function(_0x538592,_0x37b96c){_0x538592=_0x538592-0x0;var _0x1df769=_0x1868[_0x538592];return _0x1df769;};'use strict';var multer=require(_0x8186('0x0'));var util=require(_0x8186('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8186('0x2'));var router=express[_0x8186('0x3')]();var fs_extra=require(_0x8186('0x4'));var auth=require(_0x8186('0x5'));var interaction=require(_0x8186('0x6'));var config=require('../../config/environment');var controller=require(_0x8186('0x7'));router[_0x8186('0x8')]('/',auth[_0x8186('0x9')](),controller[_0x8186('0xa')]);router['get']('/:id',auth[_0x8186('0x9')](),controller[_0x8186('0xb')]);router[_0x8186('0xc')]('/',auth[_0x8186('0x9')](),controller['create']);router['put'](_0x8186('0xd'),auth[_0x8186('0x9')](),controller[_0x8186('0xe')]);router['delete'](_0x8186('0xd'),auth[_0x8186('0x9')](),controller[_0x8186('0xf')]);module[_0x8186('0x10')]=router; \ No newline at end of file +var _0x674a=['index','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0x674a,0x1a0));var _0xa674=function(_0x575a54,_0x457ab0){_0x575a54=_0x575a54-0x0;var _0x55c768=_0x674a[_0x575a54];return _0x55c768;};'use strict';var multer=require(_0xa674('0x0'));var util=require('util');var path=require(_0xa674('0x1'));var timeout=require(_0xa674('0x2'));var express=require(_0xa674('0x3'));var router=express['Router']();var fs_extra=require(_0xa674('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa674('0x5'));var config=require(_0xa674('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xa674('0x7')]('/',auth[_0xa674('0x8')](),controller[_0xa674('0x9')]);router[_0xa674('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa674('0xa')]);router[_0xa674('0xb')]('/',auth[_0xa674('0x8')](),controller['create']);router[_0xa674('0xc')](_0xa674('0xd'),auth[_0xa674('0x8')](),controller[_0xa674('0xe')]);router[_0xa674('0xf')](_0xa674('0xd'),auth[_0xa674('0x8')](),controller[_0xa674('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index d838e84..4b9586a 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 _0x6b1d=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x468403,_0x503cea){var _0x231ccb=function(_0xe74d2a){while(--_0xe74d2a){_0x468403['push'](_0x468403['shift']());}};_0x231ccb(++_0x503cea);}(_0x6b1d,0x16b));var _0xd6b1=function(_0x91ff52,_0x2cde3c){_0x91ff52=_0x91ff52-0x0;var _0x37d193=_0x6b1d[_0x91ff52];return _0x37d193;};'use strict';var Sequelize=require(_0xd6b1('0x0'));var moment=require(_0xd6b1('0x1'));module['exports']={'time':{'type':Sequelize[_0xd6b1('0x2')]},'callid':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd6b1('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd6b1('0x3')],'allowNull':![],'defaultValue':moment()[_0xd6b1('0x4')](_0xd6b1('0x5'))}}; \ No newline at end of file +var _0xc4bd=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x435095,_0x498dd7){var _0x1d2e49=function(_0x54b02e){while(--_0x54b02e){_0x435095['push'](_0x435095['shift']());}};_0x1d2e49(++_0x498dd7);}(_0xc4bd,0x75));var _0xdc4b=function(_0x39bbe5,_0x317585){_0x39bbe5=_0x39bbe5-0x0;var _0x255bee=_0xc4bd[_0x39bbe5];return _0x255bee;};'use strict';var Sequelize=require(_0xdc4b('0x0'));var moment=require(_0xdc4b('0x1'));module[_0xdc4b('0x2')]={'time':{'type':Sequelize[_0xdc4b('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdc4b('0x4')],'allowNull':![],'defaultValue':moment()[_0xdc4b('0x5')](_0xdc4b('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 12cccdf..a122fa4 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 _0xf368=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf368,0xc9));var _0x8f36=function(_0x47772a,_0x144404){_0x47772a=_0x47772a-0x0;var _0x398a73=_0xf368[_0x47772a];return _0x398a73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f36('0x0'));var jsonpatch=require(_0x8f36('0x1'));var rp=require(_0x8f36('0x2'));var moment=require(_0x8f36('0x3'));var BPromise=require(_0x8f36('0x4'));var Mustache=require(_0x8f36('0x5'));var util=require(_0x8f36('0x6'));var path=require('path');var sox=require(_0x8f36('0x7'));var csv=require(_0x8f36('0x8'));var ejs=require(_0x8f36('0x9'));var fs=require('fs');var fs_extra=require(_0x8f36('0xa'));var _=require(_0x8f36('0xb'));var squel=require(_0x8f36('0xc'));var crypto=require(_0x8f36('0xd'));var jsforce=require(_0x8f36('0xe'));var deskjs=require(_0x8f36('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8f36('0x10'));var Papa=require('papaparse');var Redis=require(_0x8f36('0x11'));var authService=require(_0x8f36('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8f36('0x13'));var hardwareService=require(_0x8f36('0x14'));var logger=require('../../config/logger')(_0x8f36('0x15'));var utils=require(_0x8f36('0x16'));var config=require(_0x8f36('0x17'));var licenseUtil=require(_0x8f36('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1723,_0x418924){_0x418924=_0x418924||0xcc;return function(_0x2036ba){if(_0x2036ba){return _0x2b1723[_0x8f36('0x19')](_0x418924);}return _0x2b1723['status'](_0x418924)[_0x8f36('0x1a')]();};}function respondWithResult(_0x2baa4e,_0xe6505d){_0xe6505d=_0xe6505d||0xc8;return function(_0x3aea12){if(_0x3aea12){return _0x2baa4e[_0x8f36('0x1b')](_0xe6505d)[_0x8f36('0x1c')](_0x3aea12);}};}function respondWithFilteredResult(_0x3ac362,_0x214af5){return function(_0x9e29e1){if(_0x9e29e1){var _0xc217b1=typeof _0x214af5[_0x8f36('0x1d')]===_0x8f36('0x1e')&&typeof _0x214af5['limit']==='undefined';var _0x7cf3b7=_0x9e29e1[_0x8f36('0x1f')];var _0x577b03=_0xc217b1?0x0:_0x214af5[_0x8f36('0x1d')];var _0x318b84=_0xc217b1?_0x9e29e1[_0x8f36('0x1f')]:_0x214af5[_0x8f36('0x1d')]+_0x214af5[_0x8f36('0x20')];var _0x428591;if(_0x318b84>=_0x7cf3b7){_0x318b84=_0x7cf3b7;_0x428591=0xc8;}else{_0x428591=0xce;}_0x3ac362[_0x8f36('0x1b')](_0x428591);return _0x3ac362[_0x8f36('0x21')](_0x8f36('0x22'),_0x577b03+'-'+_0x318b84+'/'+_0x7cf3b7)['json'](_0x9e29e1);}return null;};}function patchUpdates(_0x6aa0af){return function(_0x2d857d){try{jsonpatch[_0x8f36('0x23')](_0x2d857d,_0x6aa0af,!![]);}catch(_0x3abefd){return BPromise[_0x8f36('0x24')](_0x3abefd);}return _0x2d857d['save']();};}function saveUpdates(_0xd74ab2,_0x1abb15){return function(_0x128a0c){if(_0x128a0c){return _0x128a0c[_0x8f36('0x25')](_0xd74ab2)['then'](function(_0x375f56){return _0x375f56;});}return null;};}function removeEntity(_0x2145e9,_0x7243fa){return function(_0x410d08){if(_0x410d08){return _0x410d08[_0x8f36('0x26')]()[_0x8f36('0x27')](function(){_0x2145e9['status'](0xcc)[_0x8f36('0x1a')]();});}};}function handleEntityNotFound(_0x2b2a1b,_0x5b136d){return function(_0x217af5){if(!_0x217af5){_0x2b2a1b[_0x8f36('0x19')](0x194);}return _0x217af5;};}function handleError(_0x181958,_0x2fe0bb){_0x2fe0bb=_0x2fe0bb||0x1f4;return function(_0x5eeb06){logger[_0x8f36('0x28')](_0x5eeb06[_0x8f36('0x29')]);if(_0x5eeb06[_0x8f36('0x2a')]){delete _0x5eeb06[_0x8f36('0x2a')];}_0x181958['status'](_0x2fe0bb)[_0x8f36('0x2b')](_0x5eeb06);};}exports[_0x8f36('0x2c')]=function(_0x535666,_0x15fa39){var _0x53da19={},_0x24a5fa={},_0x4e7ee8={'count':0x0,'rows':[]};var _0x17ded5=_[_0x8f36('0x2d')](db[_0x8f36('0x2e')][_0x8f36('0x2f')],function(_0x36ce89){return{'name':_0x36ce89[_0x8f36('0x30')],'type':_0x36ce89[_0x8f36('0x31')][_0x8f36('0x32')]};});_0x24a5fa['model']=_[_0x8f36('0x2d')](_0x17ded5,_0x8f36('0x2a'));_0x24a5fa[_0x8f36('0x33')]=_[_0x8f36('0x34')](_0x535666[_0x8f36('0x33')]);_0x24a5fa[_0x8f36('0x35')]=_[_0x8f36('0x36')](_0x24a5fa['model'],_0x24a5fa[_0x8f36('0x33')]);_0x53da19[_0x8f36('0x37')]=_['intersection'](_0x24a5fa[_0x8f36('0x38')],qs[_0x8f36('0x39')](_0x535666[_0x8f36('0x33')][_0x8f36('0x39')]));_0x53da19[_0x8f36('0x37')]=_0x53da19[_0x8f36('0x37')][_0x8f36('0x3a')]?_0x53da19[_0x8f36('0x37')]:_0x24a5fa[_0x8f36('0x38')];if(!_0x535666[_0x8f36('0x33')][_0x8f36('0x3b')](_0x8f36('0x3c'))){_0x53da19['limit']=qs[_0x8f36('0x20')](_0x535666['query'][_0x8f36('0x20')]);_0x53da19[_0x8f36('0x1d')]=qs[_0x8f36('0x1d')](_0x535666['query'][_0x8f36('0x1d')]);}_0x53da19['order']=qs['sort'](_0x535666[_0x8f36('0x33')]['sort']);_0x53da19['where']=qs[_0x8f36('0x35')](_[_0x8f36('0x3d')](_0x535666[_0x8f36('0x33')],_0x24a5fa[_0x8f36('0x35')]),_0x17ded5);if(_0x535666[_0x8f36('0x33')][_0x8f36('0x3e')]){_0x53da19['where']=_[_0x8f36('0x3f')](_0x53da19['where'],{'$or':_[_0x8f36('0x2d')](_0x17ded5,function(_0xc66b59){if(_0xc66b59['type']!=='VIRTUAL'){var _0x22c3e8={};_0x22c3e8[_0xc66b59['name']]={'$like':'%'+_0x535666[_0x8f36('0x33')][_0x8f36('0x3e')]+'%'};return _0x22c3e8;}})});}_0x53da19=_['merge']({},_0x53da19,_0x535666[_0x8f36('0x40')]);var _0x19cb82={'where':_0x53da19['where']};return db[_0x8f36('0x2e')][_0x8f36('0x1f')](_0x19cb82)['then'](function(_0x302bbc){_0x4e7ee8['count']=_0x302bbc;if(_0x535666['query'][_0x8f36('0x41')]){_0x53da19[_0x8f36('0x42')]=[{'all':!![]}];}return db[_0x8f36('0x2e')][_0x8f36('0x43')](_0x53da19);})[_0x8f36('0x27')](function(_0x16c36d){_0x4e7ee8[_0x8f36('0x44')]=_0x16c36d;return _0x4e7ee8;})['then'](respondWithFilteredResult(_0x15fa39,_0x53da19))[_0x8f36('0x45')](handleError(_0x15fa39,null));};exports['show']=function(_0x26afd5,_0x75bc45){var _0x28feba={'raw':!![],'where':{'id':_0x26afd5[_0x8f36('0x46')]['id']}},_0x5ae995={};_0x5ae995[_0x8f36('0x38')]=_[_0x8f36('0x34')](db[_0x8f36('0x2e')][_0x8f36('0x2f')]);_0x5ae995['query']=_[_0x8f36('0x34')](_0x26afd5[_0x8f36('0x33')]);_0x5ae995[_0x8f36('0x35')]=_[_0x8f36('0x36')](_0x5ae995['model'],_0x5ae995[_0x8f36('0x33')]);_0x28feba['attributes']=_[_0x8f36('0x36')](_0x5ae995[_0x8f36('0x38')],qs[_0x8f36('0x39')](_0x26afd5[_0x8f36('0x33')]['fields']));_0x28feba[_0x8f36('0x37')]=_0x28feba[_0x8f36('0x37')][_0x8f36('0x3a')]?_0x28feba[_0x8f36('0x37')]:_0x5ae995[_0x8f36('0x38')];if(_0x26afd5[_0x8f36('0x33')][_0x8f36('0x41')]){_0x28feba['include']=[{'all':!![]}];}_0x28feba=_['merge']({},_0x28feba,_0x26afd5[_0x8f36('0x40')]);return db[_0x8f36('0x2e')][_0x8f36('0x47')](_0x28feba)[_0x8f36('0x27')](handleEntityNotFound(_0x75bc45,null))[_0x8f36('0x27')](respondWithResult(_0x75bc45,null))[_0x8f36('0x45')](handleError(_0x75bc45,null));};exports[_0x8f36('0x48')]=function(_0xb98144,_0x5bba45){return db['VoiceQueuesLog'][_0x8f36('0x48')](_0xb98144[_0x8f36('0x49')],{})[_0x8f36('0x27')](respondWithResult(_0x5bba45,0xc9))[_0x8f36('0x45')](handleError(_0x5bba45,null));};exports['update']=function(_0x5e9669,_0x47dff0){if(_0x5e9669[_0x8f36('0x49')]['id']){delete _0x5e9669[_0x8f36('0x49')]['id'];}return db[_0x8f36('0x2e')][_0x8f36('0x47')]({'where':{'id':_0x5e9669[_0x8f36('0x46')]['id']}})['then'](handleEntityNotFound(_0x47dff0,null))['then'](saveUpdates(_0x5e9669[_0x8f36('0x49')],null))[_0x8f36('0x27')](respondWithResult(_0x47dff0,null))[_0x8f36('0x45')](handleError(_0x47dff0,null));};exports[_0x8f36('0x26')]=function(_0x576289,_0x5aadbd){return db[_0x8f36('0x2e')][_0x8f36('0x47')]({'where':{'id':_0x576289[_0x8f36('0x46')]['id']}})[_0x8f36('0x27')](handleEntityNotFound(_0x5aadbd,null))[_0x8f36('0x27')](removeEntity(_0x5aadbd,null))['catch'](handleError(_0x5aadbd,null));}; \ No newline at end of file +var _0x0d67=['filter','merge','options','includeAll','include','show','params','find','create','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL'];(function(_0x4f3ea9,_0x1508b4){var _0xa26803=function(_0x14aff0){while(--_0x14aff0){_0x4f3ea9['push'](_0x4f3ea9['shift']());}};_0xa26803(++_0x1508b4);}(_0x0d67,0x145));var _0x70d6=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x0d67[_0x313df3];return _0x241d59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70d6('0x0'));var zipdir=require(_0x70d6('0x1'));var jsonpatch=require(_0x70d6('0x2'));var rp=require(_0x70d6('0x3'));var moment=require(_0x70d6('0x4'));var BPromise=require(_0x70d6('0x5'));var Mustache=require('mustache');var util=require(_0x70d6('0x6'));var path=require(_0x70d6('0x7'));var sox=require(_0x70d6('0x8'));var csv=require('to-csv');var ejs=require(_0x70d6('0x9'));var fs=require('fs');var fs_extra=require(_0x70d6('0xa'));var _=require(_0x70d6('0xb'));var squel=require(_0x70d6('0xc'));var crypto=require(_0x70d6('0xd'));var jsforce=require(_0x70d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x70d6('0xf'));var querystring=require(_0x70d6('0x10'));var Papa=require(_0x70d6('0x11'));var Redis=require(_0x70d6('0x12'));var authService=require(_0x70d6('0x13'));var qs=require(_0x70d6('0x14'));var as=require(_0x70d6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70d6('0x16'))(_0x70d6('0x17'));var utils=require(_0x70d6('0x18'));var config=require(_0x70d6('0x19'));var licenseUtil=require(_0x70d6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f28d4,_0x23fd22){_0x23fd22=_0x23fd22||0xcc;return function(_0x557885){if(_0x557885){return _0x4f28d4[_0x70d6('0x1b')](_0x23fd22);}return _0x4f28d4['status'](_0x23fd22)[_0x70d6('0x1c')]();};}function respondWithResult(_0x53063d,_0x326c0e){_0x326c0e=_0x326c0e||0xc8;return function(_0x2b1a9c){if(_0x2b1a9c){return _0x53063d[_0x70d6('0x1d')](_0x326c0e)['json'](_0x2b1a9c);}};}function respondWithFilteredResult(_0xbc926a,_0x5a8dee){return function(_0xd0d863){if(_0xd0d863){var _0x57b534=typeof _0x5a8dee['offset']==='undefined'&&typeof _0x5a8dee[_0x70d6('0x1e')]==='undefined';var _0x16b2f8=_0xd0d863[_0x70d6('0x1f')];var _0x390a0b=_0x57b534?0x0:_0x5a8dee[_0x70d6('0x20')];var _0x3c1673=_0x57b534?_0xd0d863[_0x70d6('0x1f')]:_0x5a8dee[_0x70d6('0x20')]+_0x5a8dee['limit'];var _0x37f7f4;if(_0x3c1673>=_0x16b2f8){_0x3c1673=_0x16b2f8;_0x37f7f4=0xc8;}else{_0x37f7f4=0xce;}_0xbc926a[_0x70d6('0x1d')](_0x37f7f4);return _0xbc926a[_0x70d6('0x21')](_0x70d6('0x22'),_0x390a0b+'-'+_0x3c1673+'/'+_0x16b2f8)[_0x70d6('0x23')](_0xd0d863);}return null;};}function patchUpdates(_0x412f19){return function(_0x33ce74){try{jsonpatch[_0x70d6('0x24')](_0x33ce74,_0x412f19,!![]);}catch(_0x593743){return BPromise[_0x70d6('0x25')](_0x593743);}return _0x33ce74[_0x70d6('0x26')]();};}function saveUpdates(_0x406fcb,_0x5ecc53){return function(_0x1c8eec){if(_0x1c8eec){return _0x1c8eec['update'](_0x406fcb)[_0x70d6('0x27')](function(_0x358da0){return _0x358da0;});}return null;};}function removeEntity(_0x2947f2,_0x438187){return function(_0x2ed685){if(_0x2ed685){return _0x2ed685['destroy']()[_0x70d6('0x27')](function(){_0x2947f2[_0x70d6('0x1d')](0xcc)[_0x70d6('0x1c')]();});}};}function handleEntityNotFound(_0x54df1b,_0x43d18a){return function(_0x1a4341){if(!_0x1a4341){_0x54df1b['sendStatus'](0x194);}return _0x1a4341;};}function handleError(_0x216ded,_0x4fa6cd){_0x4fa6cd=_0x4fa6cd||0x1f4;return function(_0x139fc4){logger[_0x70d6('0x28')](_0x139fc4[_0x70d6('0x29')]);if(_0x139fc4[_0x70d6('0x2a')]){delete _0x139fc4[_0x70d6('0x2a')];}_0x216ded['status'](_0x4fa6cd)[_0x70d6('0x2b')](_0x139fc4);};}exports[_0x70d6('0x2c')]=function(_0x825fd2,_0x1f9bf7){var _0x5797f1={},_0x5e15b6={},_0x23d9f5={'count':0x0,'rows':[]};var _0xdb6240=_[_0x70d6('0x2d')](db[_0x70d6('0x2e')][_0x70d6('0x2f')],function(_0x3afa4b){return{'name':_0x3afa4b[_0x70d6('0x30')],'type':_0x3afa4b['type'][_0x70d6('0x31')]};});_0x5e15b6[_0x70d6('0x32')]=_['map'](_0xdb6240,_0x70d6('0x2a'));_0x5e15b6[_0x70d6('0x33')]=_[_0x70d6('0x34')](_0x825fd2['query']);_0x5e15b6[_0x70d6('0x35')]=_[_0x70d6('0x36')](_0x5e15b6['model'],_0x5e15b6[_0x70d6('0x33')]);_0x5797f1[_0x70d6('0x37')]=_[_0x70d6('0x36')](_0x5e15b6['model'],qs['fields'](_0x825fd2['query'][_0x70d6('0x38')]));_0x5797f1[_0x70d6('0x37')]=_0x5797f1[_0x70d6('0x37')][_0x70d6('0x39')]?_0x5797f1[_0x70d6('0x37')]:_0x5e15b6['model'];if(!_0x825fd2[_0x70d6('0x33')][_0x70d6('0x3a')](_0x70d6('0x3b'))){_0x5797f1['limit']=qs[_0x70d6('0x1e')](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x1e')]);_0x5797f1[_0x70d6('0x20')]=qs['offset'](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x20')]);}_0x5797f1['order']=qs[_0x70d6('0x3c')](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x3c')]);_0x5797f1[_0x70d6('0x3d')]=qs[_0x70d6('0x35')](_[_0x70d6('0x3e')](_0x825fd2[_0x70d6('0x33')],_0x5e15b6[_0x70d6('0x35')]),_0xdb6240);if(_0x825fd2['query']['filter']){_0x5797f1[_0x70d6('0x3d')]=_['merge'](_0x5797f1[_0x70d6('0x3d')],{'$or':_[_0x70d6('0x2d')](_0xdb6240,function(_0x111e69){if(_0x111e69[_0x70d6('0x3f')]!==_0x70d6('0x40')){var _0x583d86={};_0x583d86[_0x111e69[_0x70d6('0x2a')]]={'$like':'%'+_0x825fd2[_0x70d6('0x33')][_0x70d6('0x41')]+'%'};return _0x583d86;}})});}_0x5797f1=_[_0x70d6('0x42')]({},_0x5797f1,_0x825fd2[_0x70d6('0x43')]);var _0x2c99f4={'where':_0x5797f1['where']};return db[_0x70d6('0x2e')][_0x70d6('0x1f')](_0x2c99f4)[_0x70d6('0x27')](function(_0x23158e){_0x23d9f5[_0x70d6('0x1f')]=_0x23158e;if(_0x825fd2[_0x70d6('0x33')][_0x70d6('0x44')]){_0x5797f1[_0x70d6('0x45')]=[{'all':!![]}];}return db[_0x70d6('0x2e')]['findAll'](_0x5797f1);})[_0x70d6('0x27')](function(_0x3518bc){_0x23d9f5['rows']=_0x3518bc;return _0x23d9f5;})['then'](respondWithFilteredResult(_0x1f9bf7,_0x5797f1))['catch'](handleError(_0x1f9bf7,null));};exports[_0x70d6('0x46')]=function(_0x3205ec,_0x35565f){var _0x25d5eb={'raw':!![],'where':{'id':_0x3205ec[_0x70d6('0x47')]['id']}},_0x4fc38c={};_0x4fc38c['model']=_[_0x70d6('0x34')](db['VoiceQueuesLog']['rawAttributes']);_0x4fc38c[_0x70d6('0x33')]=_[_0x70d6('0x34')](_0x3205ec[_0x70d6('0x33')]);_0x4fc38c['filters']=_['intersection'](_0x4fc38c[_0x70d6('0x32')],_0x4fc38c['query']);_0x25d5eb[_0x70d6('0x37')]=_['intersection'](_0x4fc38c[_0x70d6('0x32')],qs[_0x70d6('0x38')](_0x3205ec[_0x70d6('0x33')][_0x70d6('0x38')]));_0x25d5eb['attributes']=_0x25d5eb[_0x70d6('0x37')]['length']?_0x25d5eb[_0x70d6('0x37')]:_0x4fc38c['model'];if(_0x3205ec[_0x70d6('0x33')][_0x70d6('0x44')]){_0x25d5eb[_0x70d6('0x45')]=[{'all':!![]}];}_0x25d5eb=_[_0x70d6('0x42')]({},_0x25d5eb,_0x3205ec['options']);return db['VoiceQueuesLog'][_0x70d6('0x48')](_0x25d5eb)['then'](handleEntityNotFound(_0x35565f,null))['then'](respondWithResult(_0x35565f,null))['catch'](handleError(_0x35565f,null));};exports[_0x70d6('0x49')]=function(_0x2fcfba,_0x3e4f4b){return db[_0x70d6('0x2e')][_0x70d6('0x49')](_0x2fcfba['body'],{})[_0x70d6('0x27')](respondWithResult(_0x3e4f4b,0xc9))[_0x70d6('0x4a')](handleError(_0x3e4f4b,null));};exports[_0x70d6('0x4b')]=function(_0x1e8434,_0x5aaaca){if(_0x1e8434['body']['id']){delete _0x1e8434[_0x70d6('0x4c')]['id'];}return db[_0x70d6('0x2e')][_0x70d6('0x48')]({'where':{'id':_0x1e8434[_0x70d6('0x47')]['id']}})['then'](handleEntityNotFound(_0x5aaaca,null))[_0x70d6('0x27')](saveUpdates(_0x1e8434[_0x70d6('0x4c')],null))['then'](respondWithResult(_0x5aaaca,null))[_0x70d6('0x4a')](handleError(_0x5aaaca,null));};exports[_0x70d6('0x4d')]=function(_0x3a7159,_0x181f1c){return db[_0x70d6('0x2e')]['find']({'where':{'id':_0x3a7159[_0x70d6('0x47')]['id']}})[_0x70d6('0x27')](handleEntityNotFound(_0x181f1c,null))['then'](removeEntity(_0x181f1c,null))['catch'](handleError(_0x181f1c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 611abbc..a565f92 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 _0x4f45=['moment','bluebird','request-promise','rimraf','define','event','dtm','lodash','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4f45,0x147));var _0x54f4=function(_0xf0816,_0xe8aa79){_0xf0816=_0xf0816-0x0;var _0x589c89=_0x4f45[_0xf0816];return _0x589c89;};'use strict';var _=require(_0x54f4('0x0'));var util=require(_0x54f4('0x1'));var logger=require(_0x54f4('0x2'))('api');var moment=require(_0x54f4('0x3'));var BPromise=require(_0x54f4('0x4'));var rp=require(_0x54f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54f4('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5dfd91,_0x3e2e27){return _0x5dfd91[_0x54f4('0x7')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x54f4('0x8'),_0x54f4('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x393e=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x2a4a1c,_0x5e944d){var _0x454433=function(_0x3d88ec){while(--_0x3d88ec){_0x2a4a1c['push'](_0x2a4a1c['shift']());}};_0x454433(++_0x5e944d);}(_0x393e,0x105));var _0xe393=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x393e[_0x35885a];return _0xe86249;};'use strict';var _=require(_0xe393('0x0'));var util=require(_0xe393('0x1'));var logger=require(_0xe393('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe393('0x3'));var rp=require(_0xe393('0x4'));var fs=require('fs');var path=require(_0xe393('0x5'));var rimraf=require(_0xe393('0x6'));var config=require(_0xe393('0x7'));var attributes=require(_0xe393('0x8'));module[_0xe393('0x9')]=function(_0x5a5dde,_0xb59a16){return _0x5a5dde[_0xe393('0xa')](_0xe393('0xb'),attributes,{'tableName':_0xe393('0xc'),'paranoid':![],'indexes':[{'name':_0xe393('0xd'),'fields':[_0xe393('0xe'),_0xe393('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b1f913e..09077aa 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 _0x90ae=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x90ae,0x195));var _0xe90a=function(_0x389f43,_0x5b878d){_0x389f43=_0x389f43-0x0;var _0x458068=_0x90ae[_0x389f43];return _0x458068;};'use strict';var _=require(_0xe90a('0x0'));var util=require(_0xe90a('0x1'));var moment=require(_0xe90a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe90a('0x3'));var fs=require('fs');var Redis=require(_0xe90a('0x4'));var db=require(_0xe90a('0x5'))['db'];var utils=require(_0xe90a('0x6'));var logger=require(_0xe90a('0x7'))(_0xe90a('0x8'));var config=require(_0xe90a('0x9'));var jayson=require(_0xe90a('0xa'));var client=jayson[_0xe90a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x203575,_0x280721,_0x24b470){return new BPromise(function(_0x42fb64,_0x11cd54){return client[_0xe90a('0xc')](_0x203575,_0x24b470)['then'](function(_0x24c73f){logger[_0xe90a('0xd')](_0xe90a('0xe'),_0x280721,_0xe90a('0xf'));logger[_0xe90a('0x10')](_0xe90a('0x11'),_0x280721,_0xe90a('0xf'),JSON['stringify'](_0x24c73f));if(_0x24c73f[_0xe90a('0x12')]){if(_0x24c73f[_0xe90a('0x12')]['code']===0x1f4){logger['error'](_0xe90a('0xe'),_0x280721,_0x24c73f[_0xe90a('0x12')]['message']);return _0x11cd54(_0x24c73f[_0xe90a('0x12')][_0xe90a('0x13')]);}logger[_0xe90a('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x280721,_0x24c73f[_0xe90a('0x12')][_0xe90a('0x13')]);return _0x42fb64(_0x24c73f['error'][_0xe90a('0x13')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x280721,'request\x20sent');_0x42fb64(_0x24c73f[_0xe90a('0x14')][_0xe90a('0x13')]);}})[_0xe90a('0x15')](function(_0x22602f){logger[_0xe90a('0x12')](_0xe90a('0xe'),_0x280721,_0x22602f);_0x11cd54(_0x22602f);});});} \ No newline at end of file +var _0x345e=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x345e,0x168));var _0xe345=function(_0x505099,_0xb10ee1){_0x505099=_0x505099-0x0;var _0x577eba=_0x345e[_0x505099];return _0x577eba;};'use strict';var _=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var moment=require('moment');var BPromise=require(_0xe345('0x2'));var rs=require(_0xe345('0x3'));var fs=require('fs');var Redis=require(_0xe345('0x4'));var db=require(_0xe345('0x5'))['db'];var utils=require(_0xe345('0x6'));var logger=require(_0xe345('0x7'))(_0xe345('0x8'));var config=require(_0xe345('0x9'));var jayson=require(_0xe345('0xa'));var client=jayson['client'][_0xe345('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38cc87,_0x27fc55,_0x246b2f){return new BPromise(function(_0x24f14f,_0x18f9a3){return client['request'](_0x38cc87,_0x246b2f)['then'](function(_0x41bd55){logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));logger[_0xe345('0xf')](_0xe345('0x10'),_0x27fc55,_0xe345('0xe'),JSON[_0xe345('0x11')](_0x41bd55));if(_0x41bd55[_0xe345('0x12')]){if(_0x41bd55[_0xe345('0x12')]['code']===0x1f4){logger[_0xe345('0x12')](_0xe345('0xd'),_0x27fc55,_0x41bd55['error']['message']);return _0x18f9a3(_0x41bd55[_0xe345('0x12')]['message']);}logger[_0xe345('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x27fc55,_0x41bd55['error'][_0xe345('0x13')]);return _0x24f14f(_0x41bd55[_0xe345('0x12')][_0xe345('0x13')]);}else{logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));_0x24f14f(_0x41bd55[_0xe345('0x14')][_0xe345('0x13')]);}})[_0xe345('0x15')](function(_0x1f983c){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x27fc55,_0x1f983c);_0x18f9a3(_0x1f983c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6e08043..f92d40b 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 _0x9e5b=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','describe','/:id','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe','put'];(function(_0x37c8fe,_0x1fec6d){var _0x5c40d4=function(_0x20cf68){while(--_0x20cf68){_0x37c8fe['push'](_0x37c8fe['shift']());}};_0x5c40d4(++_0x1fec6d);}(_0x9e5b,0x19a));var _0xb9e5=function(_0x512725,_0x3d343d){_0x512725=_0x512725-0x0;var _0xb579a3=_0x9e5b[_0x512725];return _0xb579a3;};'use strict';var multer=require(_0xb9e5('0x0'));var util=require(_0xb9e5('0x1'));var path=require(_0xb9e5('0x2'));var timeout=require(_0xb9e5('0x3'));var express=require('express');var router=express[_0xb9e5('0x4')]();var fs_extra=require(_0xb9e5('0x5'));var auth=require(_0xb9e5('0x6'));var interaction=require(_0xb9e5('0x7'));var config=require(_0xb9e5('0x8'));var controller=require(_0xb9e5('0x9'));router['get']('/',auth[_0xb9e5('0xa')](),controller['index']);router[_0xb9e5('0xb')](_0xb9e5('0xc'),auth[_0xb9e5('0xa')](),controller[_0xb9e5('0xd')]);router[_0xb9e5('0xb')](_0xb9e5('0xe'),auth[_0xb9e5('0xa')](),controller['show']);router['get'](_0xb9e5('0xf'),auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x10')]);router['get'](_0xb9e5('0x11'),controller[_0xb9e5('0x12')]);router[_0xb9e5('0xb')]('/:id/transcribe',auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x13')]);router['post']('/',auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x14')]);router[_0xb9e5('0x15')](_0xb9e5('0x16'),auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x17')]);router[_0xb9e5('0x18')](_0xb9e5('0xe'),auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x19')]);router[_0xb9e5('0x1a')](_0xb9e5('0xe'),auth[_0xb9e5('0xa')](),controller[_0xb9e5('0x1b')]);module[_0xb9e5('0x1c')]=router; \ No newline at end of file +var _0x03e0=['isAuthenticated','index','get','/describe','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x29d6e4,_0x409686){var _0x1cf540=function(_0x4eff2c){while(--_0x4eff2c){_0x29d6e4['push'](_0x29d6e4['shift']());}};_0x1cf540(++_0x409686);}(_0x03e0,0x1bf));var _0x003e=function(_0x1fb3f2,_0x1eacf4){_0x1fb3f2=_0x1fb3f2-0x0;var _0x220105=_0x03e0[_0x1fb3f2];return _0x220105;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x003e('0x0'));var timeout=require(_0x003e('0x1'));var express=require(_0x003e('0x2'));var router=express[_0x003e('0x3')]();var fs_extra=require(_0x003e('0x4'));var auth=require(_0x003e('0x5'));var interaction=require(_0x003e('0x6'));var config=require(_0x003e('0x7'));var controller=require(_0x003e('0x8'));router['get']('/',auth[_0x003e('0x9')](),controller[_0x003e('0xa')]);router[_0x003e('0xb')](_0x003e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x003e('0xb')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller['show']);router[_0x003e('0xb')](_0x003e('0xe'),auth[_0x003e('0x9')](),controller['download']);router['get'](_0x003e('0xf'),controller[_0x003e('0x10')]);router['get'](_0x003e('0x11'),auth[_0x003e('0x9')](),controller['downloadTranscribe']);router[_0x003e('0x12')]('/',auth[_0x003e('0x9')](),controller[_0x003e('0x13')]);router[_0x003e('0x12')](_0x003e('0x11'),auth[_0x003e('0x9')](),controller[_0x003e('0x14')]);router[_0x003e('0x15')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller['update']);router[_0x003e('0x16')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller[_0x003e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index db89848..5d6cdfd 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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 70e5556..4d8bd12 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 _0x3831=['request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','reject','then','error','stack','name','send','map','VoiceRecording','type','key','model','format','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','$and','push','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','end','listBuckets','createBucket','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','runSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x27ed9b,_0x3a45b3){var _0x2bb21f=function(_0x340693){while(--_0x340693){_0x27ed9b['push'](_0x27ed9b['shift']());}};_0x2bb21f(++_0x3a45b3);}(_0x3831,0x8d));var _0x1383=function(_0x352fbf,_0x5d417d){_0x352fbf=_0x352fbf-0x0;var _0x45784a=_0x3831[_0x352fbf];return _0x45784a;};'use strict';var emlformat=require(_0x1383('0x0'));var rimraf=require(_0x1383('0x1'));var zipdir=require(_0x1383('0x2'));var jsonpatch=require(_0x1383('0x3'));var rp=require(_0x1383('0x4'));var moment=require(_0x1383('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1383('0x6'));var util=require(_0x1383('0x7'));var path=require(_0x1383('0x8'));var sox=require(_0x1383('0x9'));var csv=require('to-csv');var ejs=require(_0x1383('0xa'));var fs=require('fs');var fs_extra=require(_0x1383('0xb'));var _=require(_0x1383('0xc'));var squel=require(_0x1383('0xd'));var crypto=require(_0x1383('0xe'));var jsforce=require(_0x1383('0xf'));var deskjs=require(_0x1383('0x10'));var toCsv=require(_0x1383('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x1383('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0x1383('0x13'));var authService=require(_0x1383('0x14'));var qs=require(_0x1383('0x15'));var as=require(_0x1383('0x16'));var hardwareService=require(_0x1383('0x17'));var logger=require(_0x1383('0x18'))(_0x1383('0x19'));var utils=require(_0x1383('0x1a'));var config=require(_0x1383('0x1b'));var licenseUtil=require(_0x1383('0x1c'));var db=require(_0x1383('0x1d'))['db'];function respondWithStatusCode(_0x15bfe6,_0x152722){_0x152722=_0x152722||0xcc;return function(_0x2870d5){if(_0x2870d5){return _0x15bfe6['sendStatus'](_0x152722);}return _0x15bfe6[_0x1383('0x1e')](_0x152722)['end']();};}function respondWithResult(_0x2d0ea1,_0x44a51a){_0x44a51a=_0x44a51a||0xc8;return function(_0x4c6293){if(_0x4c6293){return _0x2d0ea1[_0x1383('0x1e')](_0x44a51a)[_0x1383('0x1f')](_0x4c6293);}};}function respondWithFilteredResult(_0x574edd,_0x28353e){return function(_0x847ca9){if(_0x847ca9){var _0x473a08=typeof _0x28353e[_0x1383('0x20')]==='undefined'&&typeof _0x28353e[_0x1383('0x21')]===_0x1383('0x22');var _0x2d4e86=_0x847ca9[_0x1383('0x23')];var _0x4ff372=_0x473a08?0x0:_0x28353e['offset'];var _0x54766b=_0x473a08?_0x847ca9[_0x1383('0x23')]:_0x28353e[_0x1383('0x20')]+_0x28353e[_0x1383('0x21')];var _0x27c57;if(_0x54766b>=_0x2d4e86){_0x54766b=_0x2d4e86;_0x27c57=0xc8;}else{_0x27c57=0xce;}_0x574edd[_0x1383('0x1e')](_0x27c57);return _0x574edd[_0x1383('0x24')]('Content-Range',_0x4ff372+'-'+_0x54766b+'/'+_0x2d4e86)['json'](_0x847ca9);}return null;};}function patchUpdates(_0x377c46){return function(_0x12fa73){try{jsonpatch['apply'](_0x12fa73,_0x377c46,!![]);}catch(_0x5465a1){return BPromise[_0x1383('0x25')](_0x5465a1);}return _0x12fa73['save']();};}function saveUpdates(_0xa2d394,_0x42c8d4){return function(_0x36d3ee){if(_0x36d3ee){return _0x36d3ee['update'](_0xa2d394)[_0x1383('0x26')](function(_0x255acb){return _0x255acb;});}return null;};}function removeEntity(_0x117071,_0x238df2){return function(_0xa80155){if(_0xa80155){return _0xa80155['destroy']()[_0x1383('0x26')](function(){_0x117071['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17c1fa,_0x5adb66){return function(_0x556b95){if(!_0x556b95){_0x17c1fa['sendStatus'](0x194);}return _0x556b95;};}function handleError(_0x7f26be,_0x355a1c){_0x355a1c=_0x355a1c||0x1f4;return function(_0x3891a8){logger[_0x1383('0x27')](_0x3891a8[_0x1383('0x28')]);if(_0x3891a8['name']){delete _0x3891a8[_0x1383('0x29')];}_0x7f26be[_0x1383('0x1e')](_0x355a1c)[_0x1383('0x2a')](_0x3891a8);};}exports['index']=function(_0x137e88,_0x486cb6){var _0xa46c39={},_0x5a0a7a={},_0x3f4900={'count':0x0,'rows':[]};var _0x5a2d68=_[_0x1383('0x2b')](db[_0x1383('0x2c')]['rawAttributes'],function(_0x2d96da){return{'name':_0x2d96da['fieldName'],'type':_0x2d96da[_0x1383('0x2d')][_0x1383('0x2e')]};});_0x5a0a7a[_0x1383('0x2f')]=_['differenceBy'](_[_0x1383('0x2b')](_0x5a2d68,_0x1383('0x29')),[_0x1383('0x30')]);_0x5a0a7a[_0x1383('0x31')]=_['keys'](_0x137e88[_0x1383('0x31')]);_0x5a0a7a['filters']=_[_0x1383('0x32')](_0x5a0a7a[_0x1383('0x2f')],_0x5a0a7a['query']);_0xa46c39[_0x1383('0x33')]=_[_0x1383('0x32')](_0x5a0a7a[_0x1383('0x2f')],qs[_0x1383('0x34')](_0x137e88[_0x1383('0x31')][_0x1383('0x34')]));_0xa46c39[_0x1383('0x33')]=_0xa46c39[_0x1383('0x33')][_0x1383('0x35')]?_0xa46c39[_0x1383('0x33')]:_0x5a0a7a[_0x1383('0x2f')];if(!_0x137e88[_0x1383('0x31')]['hasOwnProperty'](_0x1383('0x36'))){_0xa46c39[_0x1383('0x21')]=qs[_0x1383('0x21')](_0x137e88[_0x1383('0x31')][_0x1383('0x21')]);_0xa46c39[_0x1383('0x20')]=qs[_0x1383('0x20')](_0x137e88[_0x1383('0x31')][_0x1383('0x20')]);}_0xa46c39[_0x1383('0x37')]=qs[_0x1383('0x38')](_0x137e88[_0x1383('0x31')][_0x1383('0x38')]);_0xa46c39[_0x1383('0x39')]=qs[_0x1383('0x3a')](_[_0x1383('0x3b')](_0x137e88[_0x1383('0x31')],_0x5a0a7a[_0x1383('0x3a')]),_0x5a2d68);if(_0x137e88[_0x1383('0x31')]['filter']){_0xa46c39[_0x1383('0x39')]=_[_0x1383('0x3c')](_0xa46c39[_0x1383('0x39')],{'$or':_[_0x1383('0x2b')](_0x5a2d68,function(_0x1c901e){if(_0x1c901e[_0x1383('0x2d')]!=='VIRTUAL'){var _0xde3f8e={};_0xde3f8e[_0x1c901e['name']]={'$like':'%'+_0x137e88[_0x1383('0x31')][_0x1383('0x3d')]+'%'};return _0xde3f8e;}})});}_0xa46c39=_['merge']({},_0xa46c39,_0x137e88[_0x1383('0x3e')]);var _0x4ec867={'where':_0xa46c39[_0x1383('0x39')]};return db[_0x1383('0x2c')]['count'](_0x4ec867)[_0x1383('0x26')](function(_0x14e273){_0x3f4900[_0x1383('0x23')]=_0x14e273;if(_0x137e88[_0x1383('0x31')]['includeAll']){_0xa46c39[_0x1383('0x3f')]=[{'all':!![]}];}return db[_0x1383('0x2c')][_0x1383('0x40')](_0xa46c39);})[_0x1383('0x26')](function(_0x3bd5d7){_0x3f4900[_0x1383('0x41')]=_0x3bd5d7;return _0x3f4900;})[_0x1383('0x26')](respondWithFilteredResult(_0x486cb6,_0xa46c39))[_0x1383('0x42')](handleError(_0x486cb6,null));};exports['show']=function(_0x117e6f,_0x2fdbea){var _0x3c47e4={'raw':![],'where':{'id':_0x117e6f[_0x1383('0x43')]['id']}},_0xea319e={};_0xea319e[_0x1383('0x2f')]=_[_0x1383('0x44')](db[_0x1383('0x2c')][_0x1383('0x45')]);_0xea319e[_0x1383('0x31')]=_['keys'](_0x117e6f[_0x1383('0x31')]);_0xea319e[_0x1383('0x3a')]=_[_0x1383('0x32')](_0xea319e[_0x1383('0x2f')],_0xea319e[_0x1383('0x31')]);_0x3c47e4[_0x1383('0x33')]=_[_0x1383('0x32')](_0xea319e['model'],qs['fields'](_0x117e6f[_0x1383('0x31')][_0x1383('0x34')]));_0x3c47e4['attributes']=_0x3c47e4[_0x1383('0x33')][_0x1383('0x35')]?_0x3c47e4['attributes']:_0xea319e[_0x1383('0x2f')];if(_0x117e6f[_0x1383('0x31')][_0x1383('0x46')]){_0x3c47e4[_0x1383('0x3f')]=[{'all':!![]}];}_0x3c47e4=_[_0x1383('0x3c')]({},_0x3c47e4,_0x117e6f[_0x1383('0x3e')]);return db[_0x1383('0x2c')][_0x1383('0x47')](_0x3c47e4)[_0x1383('0x26')](handleEntityNotFound(_0x2fdbea,null))[_0x1383('0x26')](respondWithResult(_0x2fdbea,null))['catch'](handleError(_0x2fdbea,null));};exports[_0x1383('0x48')]=function(_0x2f44ce,_0x2b8a4d){return db['VoiceRecording']['create'](_0x2f44ce[_0x1383('0x49')],{})['then'](respondWithResult(_0x2b8a4d,0xc9))[_0x1383('0x42')](handleError(_0x2b8a4d,null));};exports['update']=function(_0x2706a1,_0x4d4fa5){if(_0x2706a1[_0x1383('0x49')]['id']){delete _0x2706a1['body']['id'];}return db[_0x1383('0x2c')]['find']({'where':{'id':_0x2706a1[_0x1383('0x43')]['id']}})[_0x1383('0x26')](handleEntityNotFound(_0x4d4fa5,null))[_0x1383('0x26')](saveUpdates(_0x2706a1[_0x1383('0x49')],null))[_0x1383('0x26')](respondWithResult(_0x4d4fa5,null))['catch'](handleError(_0x4d4fa5,null));};exports['describe']=function(_0x256d2a,_0x42cf13){return db[_0x1383('0x2c')]['describe']()[_0x1383('0x26')](respondWithResult(_0x42cf13,null))[_0x1383('0x42')](handleError(_0x42cf13,null));};exports[_0x1383('0x4a')]=function(_0x262da8,_0x1c9757,_0x3356fb){var _0x449700=require(_0x1383('0x4b'));var _0x2dced8=![];var _0x20ff62={};if(_0x262da8['query'][_0x1383('0x2d')]&&_0x262da8[_0x1383('0x31')][_0x1383('0x2d')]===_0x1383('0x4c')){_0x20ff62[_0x1383('0x4c')]=_0x262da8[_0x1383('0x43')]['id'];}else{_0x20ff62['id']=_0x262da8[_0x1383('0x43')]['id'];}return db[_0x1383('0x2c')][_0x1383('0x47')]({'where':_0x20ff62,'attributes':['id','value'],'raw':!![]})[_0x1383('0x26')](handleEntityNotFound(_0x1c9757,null))[_0x1383('0x26')](function(_0x5447a6){if(_0x5447a6){var _0x448f2e=_0x5447a6[_0x1383('0x4d')];var _0x28a8bd=util[_0x1383('0x30')]('%s.cypher',_0x448f2e);if(fs[_0x1383('0x4e')](_0x28a8bd)){_0x2dced8=!![];return _0x449700[_0x1383('0x4f')](_0x28a8bd,_0x448f2e,config['secrets']['recording'])[_0x1383('0x26')](function(){return _0x5447a6;});}return _0x5447a6;}})['then'](function(_0x18c2b2){if(_0x18c2b2){var _0x9274e5=_0x18c2b2[_0x1383('0x4d')];if(!fs['existsSync'](_0x9274e5)){throw new db[(_0x1383('0x50'))][(_0x1383('0x51'))](_0x1383('0x52'));}if(_0x18c2b2['filename']){return _0x1c9757[_0x1383('0x4a')](_0x9274e5,_0x18c2b2[_0x1383('0x53')]+path[_0x1383('0x54')](_0x9274e5),function(){if(_0x2dced8){fs[_0x1383('0x55')](_0x9274e5);}});}else{return _0x1c9757[_0x1383('0x4a')](_0x9274e5,function(_0x4c2551){if(_0x2dced8){fs[_0x1383('0x55')](_0x9274e5);}});}}})['catch'](function(_0x5168e8){if(_0x5168e8[_0x1383('0x56')]===_0x1383('0x52')){_0x1c9757[_0x1383('0x1e')](0x194)[_0x1383('0x2a')](_0x1383('0x57'));}else{return handleError(_0x1c9757,null);}});};exports['downloads']=function(_0x59c9d7,_0x20e318,_0x4f1699){var _0xaa6da6=require(_0x1383('0x4b'));var _0x435635=![];var _0x2e22f5={'$and':[db[_0x1383('0x58')]['where'](db[_0x1383('0x58')]['fn'](_0x1383('0x59'),db['sequelize'][_0x1383('0x5a')](_0x1383('0x4c'))),_0x59c9d7[_0x1383('0x31')]['token'])]};if(_0x59c9d7[_0x1383('0x31')][_0x1383('0x2d')]&&_0x59c9d7[_0x1383('0x31')][_0x1383('0x2d')]==='uniqueid'){_0x2e22f5[_0x1383('0x5b')][_0x1383('0x5c')]({'uniqueid':_0x59c9d7[_0x1383('0x43')]['id']});}else{_0x2e22f5[_0x1383('0x5b')]['push']({'id':_0x59c9d7[_0x1383('0x43')]['id']});}return db[_0x1383('0x2c')]['find']({'where':_0x2e22f5,'attributes':['id',_0x1383('0x4d')],'raw':!![]})[_0x1383('0x26')](handleEntityNotFound(_0x20e318,null))[_0x1383('0x26')](function(_0x2f4efc){if(_0x2f4efc){var _0x1a7ba8=util[_0x1383('0x30')]('%s.cypher',_0x2f4efc[_0x1383('0x4d')]);if(fs[_0x1383('0x4e')](_0x1a7ba8)){_0x435635=!![];return _0xaa6da6[_0x1383('0x4f')](_0x1a7ba8,_0x2f4efc[_0x1383('0x4d')],config[_0x1383('0x5d')]['recording'])[_0x1383('0x26')](function(){return _0x2f4efc;});}return _0x2f4efc;}})[_0x1383('0x26')](function(_0x112f41){if(_0x112f41){if(!fs[_0x1383('0x4e')](_0x112f41[_0x1383('0x4d')])){throw new db[(_0x1383('0x50'))][(_0x1383('0x51'))](_0x1383('0x52'));}if(_0x112f41[_0x1383('0x53')]){return _0x20e318[_0x1383('0x4a')](_0x112f41[_0x1383('0x4d')],_0x112f41[_0x1383('0x53')]+path[_0x1383('0x54')](_0x112f41[_0x1383('0x4d')]),function(){if(_0x435635){fs[_0x1383('0x55')](_0x112f41[_0x1383('0x4d')]);}});}else{return _0x20e318[_0x1383('0x4a')](_0x112f41['value'],function(_0x23a321){if(_0x435635){fs[_0x1383('0x55')](_0x112f41[_0x1383('0x4d')]);}});}}})[_0x1383('0x42')](handleError(_0x20e318,null));};exports['destroy']=function(_0x11cf52,_0x4bdc47){return db[_0x1383('0x2c')][_0x1383('0x47')]({'where':{'id':_0x11cf52['params']['id']}})['then'](function(_0x5a3ef1){if(_[_0x1383('0x5e')](_0x5a3ef1)){throw new ReferenceError(_0x1383('0x5f'));}return _0x5a3ef1;})[_0x1383('0x26')](function(_0xb5b21a){var _0x1baf44=_0xb5b21a[_0x1383('0x4d')];logger[_0x1383('0x60')](_0x1383('0x61'),_0x1baf44);if(!_[_0x1383('0x5e')](_0xb5b21a[_0x1383('0x4d')])&&fs[_0x1383('0x4e')](_0x1baf44)){logger[_0x1383('0x60')](_0x1383('0x62')+_0x1baf44+_0x1383('0x63'));fs['unlinkSync'](_0x1baf44);}_0x1baf44=_0x1baf44+_0x1383('0x64');if(!_[_0x1383('0x5e')](_0xb5b21a[_0x1383('0x4d')])&&fs[_0x1383('0x4e')](_0x1baf44)){logger[_0x1383('0x60')]('File:\x20\x22'+_0x1baf44+_0x1383('0x63'));fs[_0x1383('0x65')](_0x1baf44);}return _0xb5b21a;})[_0x1383('0x26')](function(_0x2546a5){if(!_0x2546a5)throw new InternalError();return _0x2546a5[_0x1383('0x66')]();})[_0x1383('0x26')](function(){_0x4bdc47[_0x1383('0x1e')](0xcc)[_0x1383('0x67')]();})['catch'](handleError(_0x4bdc47,null));};function getBucketslist(_0x1c2885,_0x29d499,_0x506e40){return new Promise(function(_0x4ec498,_0x47a763){var _0x68443f=new AWS['S3']({'accessKeyId':_0x29d499,'secretAccessKey':_0x1c2885,'region':_0x506e40});_0x68443f[_0x1383('0x68')]({},function(_0x45ba46,_0x4e53ca){if(_0x45ba46){return _0x47a763(_0x45ba46);}else{return _0x4ec498(_0x4e53ca);}});});}function createBucket(_0x2bb3f8,_0x3d3d74,_0x20f84d,_0x516dbb){return new Promise(function(_0xecc10,_0x50acf5){var _0x199769=new AWS['S3']({'accessKeyId':_0x3d3d74,'secretAccessKey':_0x2bb3f8,'region':_0x20f84d});_0x199769[_0x1383('0x69')]({'Bucket':_0x516dbb},function(_0x5d9629,_0x3cf477){if(_0x5d9629){return _0x50acf5(_0x5d9629);}else{return _0xecc10(_0x3cf477);}});});}function uploadFile(_0x23c4ac,_0x5d79cd,_0x5981c8,_0x146208,_0x2f60e4,_0x1c92d4){return new Promise(function(_0x5b2e10,_0x509764){var _0x1242fc=new AWS['S3']({'accessKeyId':_0x5d79cd,'secretAccessKey':_0x23c4ac,'region':_0x5981c8});_0x1242fc['upload']({'Bucket':_0x146208,'Key':_0x2f60e4,'Body':_0x1c92d4},function(_0xd3ca99,_0xf7908a){if(_0xd3ca99){return _0x509764(_0xd3ca99);}else{return _0x5b2e10(_0xf7908a);}});});}function startTranscribe(_0x9f02f4,_0x1f8381,_0x43ccc4,_0x5c924b,_0x339587,_0x59cd58){return new Promise(function(_0x37d522,_0x143b49){var _0x113ad3=new AWS['TranscribeService']({'accessKeyId':_0x1f8381,'secretAccessKey':_0x9f02f4,'region':_0x43ccc4});_0x113ad3['startTranscriptionJob']({'TranscriptionJobName':_0x5c924b,'LanguageCode':_0x339587,'Media':{'MediaFileUri':_0x59cd58}},function(_0x38eb64,_0x59a8b2){if(_0x38eb64){return _0x143b49(_0x38eb64);}else{return _0x37d522(_0x59a8b2);}});});}function transcribe(_0x240cbf,_0x2d0a9b,_0x1ead25,_0x57e297,_0x5b9fa9,_0x1eaacf,_0x497251){return new Promise(function(_0x362a00,_0x35885c){var _0x1ad7b5={};logger[_0x1383('0x60')](util[_0x1383('0x30')](_0x1383('0x6a'),_0x240cbf,_0x5b9fa9));return uploadFile(_0x2d0a9b,_0x1ead25,_0x57e297,_0x5b9fa9,path[_0x1383('0x6b')](_0x1eaacf),fs['readFileSync'](_0x1eaacf))['then'](function(_0x530549){logger[_0x1383('0x60')](util[_0x1383('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x240cbf,_0x5b9fa9,_0x530549[_0x1383('0x6c')]));_0x1ad7b5[_0x1383('0x6d')]=_0x530549[_0x1383('0x6e')];_0x1ad7b5[_0x1383('0x6f')]=_0x530549[_0x1383('0x6c')];logger[_0x1383('0x60')](util[_0x1383('0x30')](_0x1383('0x70'),_0x240cbf));return startTranscribe(_0x2d0a9b,_0x1ead25,_0x57e297,uuidv4(),_0x497251,_0x530549['Location']);})[_0x1383('0x26')](function(_0x18f693){logger['info'](util[_0x1383('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x240cbf,_0x18f693['TranscriptionJob'][_0x1383('0x71')]));_0x1ad7b5['transcribeName']=_0x18f693['TranscriptionJob'][_0x1383('0x71')];_0x1ad7b5[_0x1383('0x72')]=_0x18f693['TranscriptionJob'][_0x1383('0x73')];return _0x362a00(_0x1ad7b5);})[_0x1383('0x42')](function(_0x36d171){return _0x35885c(_0x36d171);});});}exports['runTranscribe']=function(_0x4fe683,_0x3d0012,_0x1d6dc1){var _0x261cc5;var _0x4ce265;var _0x304523;var _0x51293e=require(_0x1383('0x4b'));return db[_0x1383('0x2c')][_0x1383('0x74')]({'where':{'id':_0x4fe683[_0x1383('0x43')]['id']}})[_0x1383('0x26')](function(_0x179c26){if(_0x179c26){var _0x2a1c8b=util[_0x1383('0x30')](_0x1383('0x75'),_0x179c26['value']);if(fs[_0x1383('0x4e')](_0x2a1c8b)){cypher=!![];return _0x51293e['decryptFile'](_0x2a1c8b,_0x179c26['value'],config[_0x1383('0x5d')]['recording'])[_0x1383('0x26')](function(){return _0x179c26;});}return _0x179c26;}})[_0x1383('0x26')](function(_0x58ca9d){if(!_0x58ca9d){throw new db['Sequelize'][(_0x1383('0x51'))](_0x1383('0x76'));}_0x4ce265=_0x58ca9d;return db['Setting'][_0x1383('0x74')]({'where':{'id':0x1}});})[_0x1383('0x26')](handleEntityNotFound(_0x3d0012,null))[_0x1383('0x26')](function(_0x222568){if(_0x222568){_0x261cc5=_0x222568;if(!_0x261cc5[_0x1383('0x77')]||!_0x261cc5[_0x1383('0x78')]||!_0x261cc5[_0x1383('0x79')]||!_0x261cc5[_0x1383('0x7a')]||!_0x261cc5[_0x1383('0x6d')]){throw new db[(_0x1383('0x50'))][(_0x1383('0x51'))](_0x1383('0x7b'));}if(_0x4fe683[_0x1383('0x49')]['runSentiment']&&(!_0x261cc5[_0x1383('0x7c')]||!_0x261cc5['sentimentAccountId']||!_0x261cc5[_0x1383('0x7d')]||!_0x261cc5[_0x1383('0x7a')]||!_0x261cc5[_0x1383('0x6d')])){throw new db[(_0x1383('0x50'))][(_0x1383('0x51'))](_0x1383('0x7e'));}return db[_0x1383('0x7f')][_0x1383('0x74')]({'where':{'id':_0x261cc5[_0x1383('0x78')]}});}})[_0x1383('0x26')](function(_0x36ecf2){if(!_0x36ecf2){throw new db[(_0x1383('0x50'))][(_0x1383('0x51'))](_0x1383('0x80'));}if(!_0x36ecf2[_0x1383('0x81')]||!_0x36ecf2[_0x1383('0x82')]){throw new db[(_0x1383('0x50'))]['ValidationError'](_0x1383('0x83'));}_0x304523=_0x36ecf2;return getBucketslist(_0x304523['data1'],_0x304523[_0x1383('0x82')],_0x261cc5[_0x1383('0x79')]);})[_0x1383('0x26')](function(_0x5194b1){if(_0x5194b1&&_0x5194b1[_0x1383('0x84')]){var _0x499723=_[_0x1383('0x47')](_0x5194b1[_0x1383('0x84')],function(_0x4e558d){return _0x4e558d['Name']===_0x261cc5[_0x1383('0x6d')];});if(!_0x499723){logger[_0x1383('0x60')](util[_0x1383('0x30')](_0x1383('0x85'),_0x4fe683[_0x1383('0x43')]['id'],_0x261cc5['bucket']));return createBucket(_0x304523[_0x1383('0x81')],_0x304523['data2'],_0x261cc5[_0x1383('0x79')],_0x261cc5[_0x1383('0x6d')]);}logger[_0x1383('0x60')](util['format'](_0x1383('0x86'),_0x4fe683['params']['id'],_0x261cc5[_0x1383('0x6d')]));return;}})[_0x1383('0x26')](function(_0x2a1af3){if(_0x4ce265[_0x1383('0x72')]===_0x1383('0x87')){return transcribe(_0x4fe683[_0x1383('0x43')]['id'],_0x304523[_0x1383('0x81')],_0x304523['data2'],_0x261cc5['transcribeRegion'],_0x261cc5['bucket'],_0x4ce265[_0x1383('0x4d')],_0x261cc5[_0x1383('0x7a')]);}else{logger[_0x1383('0x60')](util[_0x1383('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4fe683[_0x1383('0x43')]['id']));return{'transcribeStatus':_0x1383('0x88')};}})[_0x1383('0x26')](function(_0x79157d){if(_0x79157d){_0x79157d['tempSentiment']=_0x4fe683['body'][_0x1383('0x89')];return _0x4ce265[_0x1383('0x8a')](_0x79157d);}})['then'](respondWithResult(_0x3d0012,null))[_0x1383('0x42')](handleError(_0x3d0012,null));};function writeFile(_0x4b9dfc,_0x2e1f56){return new Promise(function(_0x52e828,_0x34a45f){fs['writeFile'](_0x2e1f56,_0x4b9dfc,function(_0xe0e895,_0xa30c13){if(_0xe0e895){return _0x34a45f(_0xe0e895);}else{return _0x52e828(_0xa30c13);}});});}exports[_0x1383('0x8b')]=function(_0x272738,_0x10bc2d,_0xc16ae2){return db[_0x1383('0x2c')]['findOne']({'where':{'id':_0x272738[_0x1383('0x43')]['id']}})[_0x1383('0x26')](handleEntityNotFound(_0x10bc2d))[_0x1383('0x26')](function(_0x42a9c1){if(_0x42a9c1&&_0x42a9c1['fileText']){var _0x43bfea=_0x42a9c1[_0x1383('0x8c')];var _0x365f4c=config[_0x1383('0x8d')]+_0x1383('0x8e')+_0x42a9c1['id']+_0x1383('0x8f');if(fs['existsSync'](_0x365f4c)){return _0x365f4c;}return writeFile(_0x43bfea,_0x365f4c)[_0x1383('0x26')](function(){return _0x365f4c;});}else{throw new db['Sequelize'][(_0x1383('0x51'))](_0x1383('0x90'));}})[_0x1383('0x26')](function(_0x29e686){return _0x10bc2d[_0x1383('0x4a')](_0x29e686);})[_0x1383('0x42')](handleError(_0x10bc2d));}; \ No newline at end of file +var _0x855e=['reject','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','filter','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','update','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','Sequelize','filename','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','findOne','%s.cypher','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x3ed127,_0x21cd4b){var _0x36b744=function(_0x146d60){while(--_0x146d60){_0x3ed127['push'](_0x3ed127['shift']());}};_0x36b744(++_0x21cd4b);}(_0x855e,0x78));var _0xe855=function(_0x203c05,_0x584521){_0x203c05=_0x203c05-0x0;var _0x43a504=_0x855e[_0x203c05];return _0x43a504;};'use strict';var emlformat=require(_0xe855('0x0'));var rimraf=require(_0xe855('0x1'));var zipdir=require(_0xe855('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe855('0x3'));var moment=require(_0xe855('0x4'));var BPromise=require(_0xe855('0x5'));var Mustache=require(_0xe855('0x6'));var util=require(_0xe855('0x7'));var path=require('path');var sox=require(_0xe855('0x8'));var csv=require(_0xe855('0x9'));var ejs=require(_0xe855('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe855('0xb'));var crypto=require(_0xe855('0xc'));var jsforce=require(_0xe855('0xd'));var deskjs=require(_0xe855('0xe'));var toCsv=require(_0xe855('0x9'));var querystring=require(_0xe855('0xf'));var Papa=require(_0xe855('0x10'));var AWS=require(_0xe855('0x11'));var uuidv4=require(_0xe855('0x12'));var Redis=require(_0xe855('0x13'));var authService=require(_0xe855('0x14'));var qs=require(_0xe855('0x15'));var as=require(_0xe855('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe855('0x17'))(_0xe855('0x18'));var utils=require('../../config/utils');var config=require(_0xe855('0x19'));var licenseUtil=require(_0xe855('0x1a'));var db=require(_0xe855('0x1b'))['db'];function respondWithStatusCode(_0x140b2b,_0x5f4725){_0x5f4725=_0x5f4725||0xcc;return function(_0x28432d){if(_0x28432d){return _0x140b2b['sendStatus'](_0x5f4725);}return _0x140b2b[_0xe855('0x1c')](_0x5f4725)[_0xe855('0x1d')]();};}function respondWithResult(_0x25263c,_0x5c38db){_0x5c38db=_0x5c38db||0xc8;return function(_0x4c0a54){if(_0x4c0a54){return _0x25263c[_0xe855('0x1c')](_0x5c38db)[_0xe855('0x1e')](_0x4c0a54);}};}function respondWithFilteredResult(_0x5b09f9,_0x37a866){return function(_0x9c12f8){if(_0x9c12f8){var _0x45a0b9=typeof _0x37a866[_0xe855('0x1f')]==='undefined'&&typeof _0x37a866[_0xe855('0x20')]===_0xe855('0x21');var _0x1e0b6f=_0x9c12f8['count'];var _0x4d98c1=_0x45a0b9?0x0:_0x37a866[_0xe855('0x1f')];var _0x385564=_0x45a0b9?_0x9c12f8[_0xe855('0x22')]:_0x37a866[_0xe855('0x1f')]+_0x37a866[_0xe855('0x20')];var _0x591677;if(_0x385564>=_0x1e0b6f){_0x385564=_0x1e0b6f;_0x591677=0xc8;}else{_0x591677=0xce;}_0x5b09f9['status'](_0x591677);return _0x5b09f9[_0xe855('0x23')](_0xe855('0x24'),_0x4d98c1+'-'+_0x385564+'/'+_0x1e0b6f)[_0xe855('0x1e')](_0x9c12f8);}return null;};}function patchUpdates(_0x935741){return function(_0x92e805){try{jsonpatch[_0xe855('0x25')](_0x92e805,_0x935741,!![]);}catch(_0x24d34f){return BPromise[_0xe855('0x26')](_0x24d34f);}return _0x92e805['save']();};}function saveUpdates(_0x1b0000,_0x12cb09){return function(_0x419025){if(_0x419025){return _0x419025['update'](_0x1b0000)[_0xe855('0x27')](function(_0x48a8ac){return _0x48a8ac;});}return null;};}function removeEntity(_0x29f00e,_0x134c3f){return function(_0x5dee59){if(_0x5dee59){return _0x5dee59[_0xe855('0x28')]()[_0xe855('0x27')](function(){_0x29f00e[_0xe855('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482ef4,_0x1ad1f5){return function(_0x17d729){if(!_0x17d729){_0x482ef4[_0xe855('0x29')](0x194);}return _0x17d729;};}function handleError(_0x3b0211,_0x3cf077){_0x3cf077=_0x3cf077||0x1f4;return function(_0x3fcd2c){logger[_0xe855('0x2a')](_0x3fcd2c[_0xe855('0x2b')]);if(_0x3fcd2c['name']){delete _0x3fcd2c[_0xe855('0x2c')];}_0x3b0211[_0xe855('0x1c')](_0x3cf077)[_0xe855('0x2d')](_0x3fcd2c);};}exports[_0xe855('0x2e')]=function(_0x369844,_0x4b0a62){var _0x3c1418={},_0x449957={},_0x10aeaf={'count':0x0,'rows':[]};var _0x280bcd=_[_0xe855('0x2f')](db[_0xe855('0x30')][_0xe855('0x31')],function(_0x9eb663){return{'name':_0x9eb663[_0xe855('0x32')],'type':_0x9eb663['type'][_0xe855('0x33')]};});_0x449957[_0xe855('0x34')]=_[_0xe855('0x35')](_[_0xe855('0x2f')](_0x280bcd,'name'),[_0xe855('0x36')]);_0x449957[_0xe855('0x37')]=_[_0xe855('0x38')](_0x369844[_0xe855('0x37')]);_0x449957[_0xe855('0x39')]=_[_0xe855('0x3a')](_0x449957['model'],_0x449957[_0xe855('0x37')]);_0x3c1418[_0xe855('0x3b')]=_['intersection'](_0x449957[_0xe855('0x34')],qs[_0xe855('0x3c')](_0x369844[_0xe855('0x37')][_0xe855('0x3c')]));_0x3c1418[_0xe855('0x3b')]=_0x3c1418[_0xe855('0x3b')][_0xe855('0x3d')]?_0x3c1418[_0xe855('0x3b')]:_0x449957[_0xe855('0x34')];if(!_0x369844[_0xe855('0x37')][_0xe855('0x3e')](_0xe855('0x3f'))){_0x3c1418['limit']=qs[_0xe855('0x20')](_0x369844['query']['limit']);_0x3c1418['offset']=qs[_0xe855('0x1f')](_0x369844[_0xe855('0x37')][_0xe855('0x1f')]);}_0x3c1418[_0xe855('0x40')]=qs[_0xe855('0x41')](_0x369844['query'][_0xe855('0x41')]);_0x3c1418['where']=qs[_0xe855('0x39')](_['pick'](_0x369844[_0xe855('0x37')],_0x449957[_0xe855('0x39')]),_0x280bcd);if(_0x369844[_0xe855('0x37')]['filter']){_0x3c1418[_0xe855('0x42')]=_['merge'](_0x3c1418[_0xe855('0x42')],{'$or':_[_0xe855('0x2f')](_0x280bcd,function(_0x4fcf82){if(_0x4fcf82[_0xe855('0x43')]!=='VIRTUAL'){var _0x38001a={};_0x38001a[_0x4fcf82['name']]={'$like':'%'+_0x369844[_0xe855('0x37')][_0xe855('0x44')]+'%'};return _0x38001a;}})});}_0x3c1418=_['merge']({},_0x3c1418,_0x369844[_0xe855('0x45')]);var _0x2f1887={'where':_0x3c1418[_0xe855('0x42')]};return db[_0xe855('0x30')][_0xe855('0x22')](_0x2f1887)[_0xe855('0x27')](function(_0x42c410){_0x10aeaf[_0xe855('0x22')]=_0x42c410;if(_0x369844[_0xe855('0x37')][_0xe855('0x46')]){_0x3c1418[_0xe855('0x47')]=[{'all':!![]}];}return db[_0xe855('0x30')][_0xe855('0x48')](_0x3c1418);})[_0xe855('0x27')](function(_0x271780){_0x10aeaf['rows']=_0x271780;return _0x10aeaf;})[_0xe855('0x27')](respondWithFilteredResult(_0x4b0a62,_0x3c1418))[_0xe855('0x49')](handleError(_0x4b0a62,null));};exports[_0xe855('0x4a')]=function(_0x2a3797,_0x3e2fb0){var _0x16a24c={'raw':![],'where':{'id':_0x2a3797[_0xe855('0x4b')]['id']}},_0xc30ea6={};_0xc30ea6[_0xe855('0x34')]=_[_0xe855('0x38')](db[_0xe855('0x30')][_0xe855('0x31')]);_0xc30ea6[_0xe855('0x37')]=_[_0xe855('0x38')](_0x2a3797['query']);_0xc30ea6[_0xe855('0x39')]=_['intersection'](_0xc30ea6[_0xe855('0x34')],_0xc30ea6[_0xe855('0x37')]);_0x16a24c[_0xe855('0x3b')]=_['intersection'](_0xc30ea6[_0xe855('0x34')],qs[_0xe855('0x3c')](_0x2a3797[_0xe855('0x37')]['fields']));_0x16a24c['attributes']=_0x16a24c[_0xe855('0x3b')][_0xe855('0x3d')]?_0x16a24c[_0xe855('0x3b')]:_0xc30ea6[_0xe855('0x34')];if(_0x2a3797[_0xe855('0x37')][_0xe855('0x46')]){_0x16a24c[_0xe855('0x47')]=[{'all':!![]}];}_0x16a24c=_[_0xe855('0x4c')]({},_0x16a24c,_0x2a3797[_0xe855('0x45')]);return db[_0xe855('0x30')][_0xe855('0x4d')](_0x16a24c)[_0xe855('0x27')](handleEntityNotFound(_0x3e2fb0,null))[_0xe855('0x27')](respondWithResult(_0x3e2fb0,null))[_0xe855('0x49')](handleError(_0x3e2fb0,null));};exports[_0xe855('0x4e')]=function(_0x3003e0,_0x29beee){return db[_0xe855('0x30')]['create'](_0x3003e0[_0xe855('0x4f')],{})[_0xe855('0x27')](respondWithResult(_0x29beee,0xc9))['catch'](handleError(_0x29beee,null));};exports[_0xe855('0x50')]=function(_0xb0a368,_0x5a3301){if(_0xb0a368[_0xe855('0x4f')]['id']){delete _0xb0a368[_0xe855('0x4f')]['id'];}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':{'id':_0xb0a368[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](handleEntityNotFound(_0x5a3301,null))['then'](saveUpdates(_0xb0a368[_0xe855('0x4f')],null))['then'](respondWithResult(_0x5a3301,null))['catch'](handleError(_0x5a3301,null));};exports['describe']=function(_0x4c3270,_0x3529f0){return db[_0xe855('0x30')]['describe']()[_0xe855('0x27')](respondWithResult(_0x3529f0,null))['catch'](handleError(_0x3529f0,null));};exports[_0xe855('0x51')]=function(_0x53bc51,_0x439a02,_0x5c5d51){var _0x294834=require(_0xe855('0x52'));var _0x257e51=![];var _0x5c8f98={};if(_0x53bc51[_0xe855('0x37')]['type']&&_0x53bc51[_0xe855('0x37')]['type']===_0xe855('0x53')){_0x5c8f98[_0xe855('0x53')]=_0x53bc51[_0xe855('0x4b')]['id'];}else{_0x5c8f98['id']=_0x53bc51[_0xe855('0x4b')]['id'];}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':_0x5c8f98,'attributes':['id',_0xe855('0x54')],'raw':!![]})[_0xe855('0x27')](handleEntityNotFound(_0x439a02,null))['then'](function(_0x1cbe58){if(_0x1cbe58){var _0x2dcb30=_0x1cbe58[_0xe855('0x54')];var _0x798ae8=util[_0xe855('0x36')]('%s.cypher',_0x2dcb30);if(fs[_0xe855('0x55')](_0x798ae8)){_0x257e51=!![];return _0x294834[_0xe855('0x56')](_0x798ae8,_0x2dcb30,config[_0xe855('0x57')][_0xe855('0x58')])[_0xe855('0x27')](function(){return _0x1cbe58;});}return _0x1cbe58;}})['then'](function(_0x65cedf){if(_0x65cedf){var _0x6b1731=_0x65cedf[_0xe855('0x54')];if(!fs[_0xe855('0x55')](_0x6b1731)){throw new db['Sequelize']['ValidationError'](_0xe855('0x59'));}if(_0x65cedf['filename']){return _0x439a02[_0xe855('0x51')](_0x6b1731,_0x65cedf['filename']+path[_0xe855('0x5a')](_0x6b1731),function(){if(_0x257e51){fs[_0xe855('0x5b')](_0x6b1731);}});}else{return _0x439a02[_0xe855('0x51')](_0x6b1731,function(_0x1ff7b4){if(_0x257e51){fs['unlink'](_0x6b1731);}});}}})[_0xe855('0x49')](function(_0x2dbfb7){if(_0x2dbfb7[_0xe855('0x5c')]===_0xe855('0x59')){_0x439a02[_0xe855('0x1c')](0x194)[_0xe855('0x2d')](_0xe855('0x5d'));}else{return handleError(_0x439a02,null);}});};exports[_0xe855('0x5e')]=function(_0x47aa11,_0x50d060,_0x783867){var _0xf721ec=require('../../components/encryptor');var _0x7d63e=![];var _0x4eba43={'$and':[db[_0xe855('0x5f')][_0xe855('0x42')](db['sequelize']['fn'](_0xe855('0x60'),db['sequelize']['col'](_0xe855('0x53'))),_0x47aa11[_0xe855('0x37')]['token'])]};if(_0x47aa11[_0xe855('0x37')][_0xe855('0x43')]&&_0x47aa11[_0xe855('0x37')][_0xe855('0x43')]===_0xe855('0x53')){_0x4eba43[_0xe855('0x61')]['push']({'uniqueid':_0x47aa11['params']['id']});}else{_0x4eba43[_0xe855('0x61')][_0xe855('0x62')]({'id':_0x47aa11[_0xe855('0x4b')]['id']});}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':_0x4eba43,'attributes':['id','value'],'raw':!![]})[_0xe855('0x27')](handleEntityNotFound(_0x50d060,null))[_0xe855('0x27')](function(_0x1f735f){if(_0x1f735f){var _0x2004ef=util[_0xe855('0x36')]('%s.cypher',_0x1f735f[_0xe855('0x54')]);if(fs[_0xe855('0x55')](_0x2004ef)){_0x7d63e=!![];return _0xf721ec[_0xe855('0x56')](_0x2004ef,_0x1f735f['value'],config[_0xe855('0x57')]['recording'])[_0xe855('0x27')](function(){return _0x1f735f;});}return _0x1f735f;}})['then'](function(_0x570bfc){if(_0x570bfc){if(!fs[_0xe855('0x55')](_0x570bfc['value'])){throw new db[(_0xe855('0x63'))]['ValidationError'](_0xe855('0x59'));}if(_0x570bfc[_0xe855('0x64')]){return _0x50d060['download'](_0x570bfc[_0xe855('0x54')],_0x570bfc['filename']+path['extname'](_0x570bfc[_0xe855('0x54')]),function(){if(_0x7d63e){fs[_0xe855('0x5b')](_0x570bfc[_0xe855('0x54')]);}});}else{return _0x50d060[_0xe855('0x51')](_0x570bfc[_0xe855('0x54')],function(_0x23e8de){if(_0x7d63e){fs[_0xe855('0x5b')](_0x570bfc[_0xe855('0x54')]);}});}}})[_0xe855('0x49')](handleError(_0x50d060,null));};exports[_0xe855('0x28')]=function(_0x35b936,_0x468556){return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':{'id':_0x35b936[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](function(_0x3e6a5b){if(_[_0xe855('0x65')](_0x3e6a5b)){throw new ReferenceError(_0xe855('0x66'));}return _0x3e6a5b;})[_0xe855('0x27')](function(_0x228ed7){var _0x74fed3=_0x228ed7[_0xe855('0x54')];logger[_0xe855('0x67')](_0xe855('0x68'),_0x74fed3);if(!_['isNil'](_0x228ed7['value'])&&fs[_0xe855('0x55')](_0x74fed3)){logger[_0xe855('0x67')](_0xe855('0x69')+_0x74fed3+_0xe855('0x6a'));fs['unlinkSync'](_0x74fed3);}_0x74fed3=_0x74fed3+_0xe855('0x6b');if(!_['isNil'](_0x228ed7['value'])&&fs[_0xe855('0x55')](_0x74fed3)){logger[_0xe855('0x67')](_0xe855('0x69')+_0x74fed3+_0xe855('0x6a'));fs[_0xe855('0x6c')](_0x74fed3);}return _0x228ed7;})[_0xe855('0x27')](function(_0x1d3d27){if(!_0x1d3d27)throw new InternalError();return _0x1d3d27[_0xe855('0x28')]();})['then'](function(){_0x468556[_0xe855('0x1c')](0xcc)['end']();})[_0xe855('0x49')](handleError(_0x468556,null));};function getBucketslist(_0x4091d0,_0x4e803a,_0x561c68){return new Promise(function(_0x41a4bf,_0x39ea87){var _0x658b0d=new AWS['S3']({'accessKeyId':_0x4e803a,'secretAccessKey':_0x4091d0,'region':_0x561c68});_0x658b0d[_0xe855('0x6d')]({},function(_0x183718,_0x328cb0){if(_0x183718){return _0x39ea87(_0x183718);}else{return _0x41a4bf(_0x328cb0);}});});}function createBucket(_0x5987cd,_0x43d54f,_0x524ec6,_0x2aa2f8){return new Promise(function(_0x1aa154,_0x485363){var _0x50c13b=new AWS['S3']({'accessKeyId':_0x43d54f,'secretAccessKey':_0x5987cd,'region':_0x524ec6});_0x50c13b[_0xe855('0x6e')]({'Bucket':_0x2aa2f8},function(_0x20241b,_0x24eba8){if(_0x20241b){return _0x485363(_0x20241b);}else{return _0x1aa154(_0x24eba8);}});});}function uploadFile(_0x2430ba,_0x5d0b22,_0x1ff3e2,_0x32e71d,_0x2ac3a4,_0x3b65aa){return new Promise(function(_0x69de53,_0x17ba20){var _0x47155e=new AWS['S3']({'accessKeyId':_0x5d0b22,'secretAccessKey':_0x2430ba,'region':_0x1ff3e2});_0x47155e[_0xe855('0x6f')]({'Bucket':_0x32e71d,'Key':_0x2ac3a4,'Body':_0x3b65aa},function(_0x3a64db,_0x86b3d6){if(_0x3a64db){return _0x17ba20(_0x3a64db);}else{return _0x69de53(_0x86b3d6);}});});}function startTranscribe(_0x763309,_0x53e7a6,_0x3a48cc,_0x4f4b5f,_0x37914a,_0x4db09f){return new Promise(function(_0x521e71,_0x51e606){var _0x31167b=new AWS['TranscribeService']({'accessKeyId':_0x53e7a6,'secretAccessKey':_0x763309,'region':_0x3a48cc});_0x31167b[_0xe855('0x70')]({'TranscriptionJobName':_0x4f4b5f,'LanguageCode':_0x37914a,'Media':{'MediaFileUri':_0x4db09f}},function(_0x26f586,_0x3b5308){if(_0x26f586){return _0x51e606(_0x26f586);}else{return _0x521e71(_0x3b5308);}});});}function transcribe(_0x4e2582,_0x290dc1,_0x4579fb,_0x4a5fd6,_0x2cbd32,_0xc4a564,_0x4ec205){return new Promise(function(_0x8ad7a3,_0x4e9838){var _0x12d410={};logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x71'),_0x4e2582,_0x2cbd32));return uploadFile(_0x290dc1,_0x4579fb,_0x4a5fd6,_0x2cbd32,path[_0xe855('0x72')](_0xc4a564),fs['readFileSync'](_0xc4a564))['then'](function(_0x469702){logger['info'](util[_0xe855('0x36')](_0xe855('0x73'),_0x4e2582,_0x2cbd32,_0x469702[_0xe855('0x74')]));_0x12d410[_0xe855('0x75')]=_0x469702[_0xe855('0x76')];_0x12d410[_0xe855('0x77')]=_0x469702[_0xe855('0x74')];logger['info'](util[_0xe855('0x36')](_0xe855('0x78'),_0x4e2582));return startTranscribe(_0x290dc1,_0x4579fb,_0x4a5fd6,uuidv4(),_0x4ec205,_0x469702[_0xe855('0x74')]);})[_0xe855('0x27')](function(_0x4c04b0){logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x79'),_0x4e2582,_0x4c04b0['TranscriptionJob'][_0xe855('0x7a')]));_0x12d410[_0xe855('0x7b')]=_0x4c04b0[_0xe855('0x7c')][_0xe855('0x7a')];_0x12d410[_0xe855('0x7d')]=_0x4c04b0[_0xe855('0x7c')]['TranscriptionJobStatus'];return _0x8ad7a3(_0x12d410);})[_0xe855('0x49')](function(_0x511420){return _0x4e9838(_0x511420);});});}exports[_0xe855('0x7e')]=function(_0x356d8e,_0x17a51d,_0x357212){var _0x13d89b;var _0x54c200;var _0x3cfc0a;var _0x42993f=require('../../components/encryptor');return db['VoiceRecording'][_0xe855('0x7f')]({'where':{'id':_0x356d8e[_0xe855('0x4b')]['id']}})['then'](function(_0x137296){if(_0x137296){var _0x2ac1fa=util[_0xe855('0x36')](_0xe855('0x80'),_0x137296['value']);if(fs[_0xe855('0x55')](_0x2ac1fa)){cypher=!![];return _0x42993f[_0xe855('0x56')](_0x2ac1fa,_0x137296[_0xe855('0x54')],config[_0xe855('0x57')][_0xe855('0x58')])[_0xe855('0x27')](function(){return _0x137296;});}return _0x137296;}})[_0xe855('0x27')](function(_0x58613b){if(!_0x58613b){throw new db['Sequelize'][(_0xe855('0x81'))](_0xe855('0x82'));}_0x54c200=_0x58613b;return db[_0xe855('0x83')]['findOne']({'where':{'id':0x1}});})[_0xe855('0x27')](handleEntityNotFound(_0x17a51d,null))[_0xe855('0x27')](function(_0x112745){if(_0x112745){_0x13d89b=_0x112745;if(!_0x13d89b[_0xe855('0x84')]||!_0x13d89b[_0xe855('0x85')]||!_0x13d89b[_0xe855('0x86')]||!_0x13d89b[_0xe855('0x87')]||!_0x13d89b[_0xe855('0x75')]){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x88'));}if(_0x356d8e['body'][_0xe855('0x89')]&&(!_0x13d89b['sentiment']||!_0x13d89b[_0xe855('0x8a')]||!_0x13d89b[_0xe855('0x8b')]||!_0x13d89b['language']||!_0x13d89b[_0xe855('0x75')])){throw new db[(_0xe855('0x63'))]['ValidationError'](_0xe855('0x8c'));}return db[_0xe855('0x8d')][_0xe855('0x7f')]({'where':{'id':_0x13d89b['transcribeAccountId']}});}})[_0xe855('0x27')](function(_0x2833ec){if(!_0x2833ec){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2833ec[_0xe855('0x8e')]||!_0x2833ec[_0xe855('0x8f')]){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x90'));}_0x3cfc0a=_0x2833ec;return getBucketslist(_0x3cfc0a[_0xe855('0x8e')],_0x3cfc0a[_0xe855('0x8f')],_0x13d89b[_0xe855('0x86')]);})[_0xe855('0x27')](function(_0x394984){if(_0x394984&&_0x394984[_0xe855('0x91')]){var _0x54e8fe=_['find'](_0x394984['Buckets'],function(_0x55d999){return _0x55d999[_0xe855('0x92')]===_0x13d89b['bucket'];});if(!_0x54e8fe){logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x93'),_0x356d8e['params']['id'],_0x13d89b[_0xe855('0x75')]));return createBucket(_0x3cfc0a['data1'],_0x3cfc0a[_0xe855('0x8f')],_0x13d89b[_0xe855('0x86')],_0x13d89b['bucket']);}logger['info'](util[_0xe855('0x36')](_0xe855('0x94'),_0x356d8e[_0xe855('0x4b')]['id'],_0x13d89b[_0xe855('0x75')]));return;}})['then'](function(_0x33ffba){if(_0x54c200[_0xe855('0x7d')]===_0xe855('0x95')){return transcribe(_0x356d8e[_0xe855('0x4b')]['id'],_0x3cfc0a[_0xe855('0x8e')],_0x3cfc0a['data2'],_0x13d89b[_0xe855('0x86')],_0x13d89b[_0xe855('0x75')],_0x54c200[_0xe855('0x54')],_0x13d89b[_0xe855('0x87')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x356d8e[_0xe855('0x4b')]['id']));return{'transcribeStatus':_0xe855('0x96')};}})[_0xe855('0x27')](function(_0x122376){if(_0x122376){_0x122376[_0xe855('0x97')]=_0x356d8e[_0xe855('0x4f')]['runSentiment'];return _0x54c200[_0xe855('0x98')](_0x122376);}})[_0xe855('0x27')](respondWithResult(_0x17a51d,null))[_0xe855('0x49')](handleError(_0x17a51d,null));};function writeFile(_0x2298f7,_0x53d719){return new Promise(function(_0x38640b,_0x5c8edc){fs[_0xe855('0x99')](_0x53d719,_0x2298f7,function(_0x5932aa,_0x39b737){if(_0x5932aa){return _0x5c8edc(_0x5932aa);}else{return _0x38640b(_0x39b737);}});});}exports['downloadTranscribe']=function(_0x946f6e,_0x20c7e1,_0x326646){return db['VoiceRecording']['findOne']({'where':{'id':_0x946f6e[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](handleEntityNotFound(_0x20c7e1))[_0xe855('0x27')](function(_0x22dcdb){if(_0x22dcdb&&_0x22dcdb[_0xe855('0x9a')]){var _0x4b97c7=_0x22dcdb[_0xe855('0x9a')];var _0xbf79=config[_0xe855('0x9b')]+_0xe855('0x9c')+_0x22dcdb['id']+'.txt';if(fs[_0xe855('0x55')](_0xbf79)){return _0xbf79;}return writeFile(_0x4b97c7,_0xbf79)[_0xe855('0x27')](function(){return _0xbf79;});}else{throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x9d'));}})[_0xe855('0x27')](function(_0x4c962c){return _0x20c7e1[_0xe855('0x51')](_0x4c962c);})[_0xe855('0x49')](handleError(_0x20c7e1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 858b31c..c6db6e6 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 _0xeeff=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x5e5658,_0x5ceb37){var _0x501ff8=function(_0x359ef1){while(--_0x359ef1){_0x5e5658['push'](_0x5e5658['shift']());}};_0x501ff8(++_0x5ceb37);}(_0xeeff,0x12b));var _0xfeef=function(_0x214648,_0x16265d){_0x214648=_0x214648-0x0;var _0x520e6f=_0xeeff[_0x214648];return _0x520e6f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfeef('0x0'))(_0xfeef('0x1'));var moment=require(_0xfeef('0x2'));var BPromise=require(_0xfeef('0x3'));var rp=require(_0xfeef('0x4'));var fs=require('fs');var path=require(_0xfeef('0x5'));var rimraf=require(_0xfeef('0x6'));var config=require(_0xfeef('0x7'));var attributes=require(_0xfeef('0x8'));module['exports']=function(_0x5af32d,_0x22f3c5){return _0x5af32d[_0xfeef('0x9')](_0xfeef('0xa'),attributes,{'tableName':_0xfeef('0xb'),'paranoid':![],'indexes':[{'name':_0xfeef('0xc'),'fields':[_0xfeef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf609=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x61151d,_0x1eaadf){var _0x57752d=function(_0x1ac48a){while(--_0x1ac48a){_0x61151d['push'](_0x61151d['shift']());}};_0x57752d(++_0x1eaadf);}(_0xf609,0x1c2));var _0x9f60=function(_0x9971b3,_0x5c8ec1){_0x9971b3=_0x9971b3-0x0;var _0x48199a=_0xf609[_0x9971b3];return _0x48199a;};'use strict';var _=require('lodash');var util=require(_0x9f60('0x0'));var logger=require(_0x9f60('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9f60('0x2'));var rp=require(_0x9f60('0x3'));var fs=require('fs');var path=require(_0x9f60('0x4'));var rimraf=require(_0x9f60('0x5'));var config=require(_0x9f60('0x6'));var attributes=require(_0x9f60('0x7'));module['exports']=function(_0x5a3c6f,_0x4ec770){return _0x5a3c6f[_0x9f60('0x8')](_0x9f60('0x9'),attributes,{'tableName':_0x9f60('0xa'),'paranoid':![],'indexes':[{'name':_0x9f60('0xb'),'fields':[_0x9f60('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b41a094..eb582a1 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 _0x9f0e=['format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1a87f0,_0x460900){_0x1a87f0=_0x1a87f0-0x0;var _0x1e0bd3=_0x9f0e[_0x1a87f0];return _0x1e0bd3;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0x2ab12b['body'],{'raw':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options']['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0xb')](function(_0x316cdf){logger[_0xe9f0('0xc')]('UpdateVoiceRecording',_0x2ab12b);logger[_0xe9f0('0xf')](_0xe9f0('0x16'),_0x2ab12b,JSON[_0xe9f0('0x11')](_0x316cdf));_0x59bf5a(_0x316cdf);})[_0xe9f0('0x15')](function(_0x3ca991){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x3ca991[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x3ca991[_0xe9f0('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x371095){var _0x27541f=this;return new Promise(function(_0x2ddfba,_0x1a8478){var _0x4cf1b1=require(_0xe9f0('0x1d'));var _0x2613fd;return db[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'attributes':['id',_0xe9f0('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x130f96){_0x2613fd=_0x130f96;return db[_0xe9f0('0x17')][_0xe9f0('0x21')](_0x371095[_0xe9f0('0x22')]);})[_0xe9f0('0xb')](function(_0xd19788){if(_0x2613fd[_0xe9f0('0x20')]&&fs[_0xe9f0('0x23')](_0xd19788[_0xe9f0('0x24')])){var _0x3dbe49=util[_0xe9f0('0x25')](_0xe9f0('0x26'),_0xd19788[_0xe9f0('0x24')]);return _0x4cf1b1[_0xe9f0('0x27')](_0xd19788[_0xe9f0('0x24')],_0x3dbe49,config[_0xe9f0('0x28')][_0xe9f0('0x29')])[_0xe9f0('0xb')](function(){fs[_0xe9f0('0x2a')](_0xd19788[_0xe9f0('0x24')]);logger[_0xe9f0('0xc')](_0xe9f0('0x2b'));return _0xd19788;});}return _0xd19788;})[_0xe9f0('0xb')](function(_0x3611c0){logger['info']('CreateVoiceRecording',_0x371095);logger['debug'](_0xe9f0('0x2c'),_0x371095,JSON['stringify'](_0x3611c0));_0x2ddfba(_0x3611c0);})[_0xe9f0('0x15')](function(_0xc5fa13){logger['error'](_0xe9f0('0x2c'),_0xc5fa13['message'],_0x371095);_0x1a8478(_0x27541f['error'](0x1f4,_0xc5fa13['message']));});});}; \ No newline at end of file +var _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x11732d,_0x4c580c){var _0x4e3e46=function(_0x571fe1){while(--_0x571fe1){_0x11732d['push'](_0x11732d['shift']());}};_0x4e3e46(++_0x4c580c);}(_0xacf4,0xe7));var _0x4acf=function(_0xca5dcc,_0x31af8e){_0xca5dcc=_0xca5dcc-0x0;var _0xcb17f9=_0xacf4[_0xca5dcc];return _0xcb17f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6ff651a..fa9504e 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 _0x7176=['describe','show','post','put','update','delete','/:id','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x1fa9c6,_0x4756ee){var _0x3460c7=function(_0x14266d){while(--_0x14266d){_0x1fa9c6['push'](_0x1fa9c6['shift']());}};_0x3460c7(++_0x4756ee);}(_0x7176,0x6e));var _0x6717=function(_0x4e64a4,_0x58055f){_0x4e64a4=_0x4e64a4-0x0;var _0x3824e7=_0x7176[_0x4e64a4];return _0x3824e7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6717('0x0'));var timeout=require(_0x6717('0x1'));var express=require(_0x6717('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6717('0x3'));var interaction=require(_0x6717('0x4'));var config=require(_0x6717('0x5'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x6717('0x6')](),controller[_0x6717('0x7')]);router[_0x6717('0x8')]('/describe',auth[_0x6717('0x6')](),controller[_0x6717('0x9')]);router['get']('/:id',auth[_0x6717('0x6')](),controller[_0x6717('0xa')]);router[_0x6717('0xb')]('/',auth[_0x6717('0x6')](),controller['create']);router[_0x6717('0xc')]('/:id',auth[_0x6717('0x6')](),controller[_0x6717('0xd')]);router[_0x6717('0xe')](_0x6717('0xf'),auth[_0x6717('0x6')](),controller[_0x6717('0x10')]);module['exports']=router; \ No newline at end of file +var _0x20bd=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0x153153,_0xe72b25){var _0x22241e=function(_0xadf4f7){while(--_0xadf4f7){_0x153153['push'](_0x153153['shift']());}};_0x22241e(++_0xe72b25);}(_0x20bd,0x133));var _0xd20b=function(_0x127ce8,_0x203388){_0x127ce8=_0x127ce8-0x0;var _0x35738e=_0x20bd[_0x127ce8];return _0x35738e;};'use strict';var multer=require(_0xd20b('0x0'));var util=require('util');var path=require(_0xd20b('0x1'));var timeout=require(_0xd20b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd20b('0x3'));var auth=require(_0xd20b('0x4'));var interaction=require(_0xd20b('0x5'));var config=require(_0xd20b('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd20b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd20b('0x7')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0x9')]);router['post']('/',auth[_0xd20b('0x8')](),controller[_0xd20b('0xa')]);router[_0xd20b('0xb')](_0xd20b('0xc'),auth['isAuthenticated'](),controller[_0xd20b('0xd')]);router[_0xd20b('0xe')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0xf')]);module[_0xd20b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 660f98c..9be11a1 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 _0xa961=['Yes','sequelize','exports','attended','STRING','ENUM'];(function(_0x526379,_0x3bbaca){var _0x3dd3f5=function(_0x2df25b){while(--_0x2df25b){_0x526379['push'](_0x526379['shift']());}};_0x3dd3f5(++_0x3bbaca);}(_0xa961,0x13f));var _0x1a96=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa961[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x1a96('0x0'));var moment=require('moment');module[_0x1a96('0x1')]={'type':{'type':Sequelize['ENUM']('blind',_0x1a96('0x2'))},'result':{'type':Sequelize[_0x1a96('0x3')]},'transfererchannel':{'type':Sequelize[_0x1a96('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x1a96('0x3')]},'transferercalleridname':{'type':Sequelize[_0x1a96('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1a96('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1a96('0x3')]},'transfereechannel':{'type':Sequelize[_0x1a96('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x1a96('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x1a96('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1a96('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1a96('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x1a96('0x3')]},'transfereeexten':{'type':Sequelize[_0x1a96('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x1a96('0x3')]},'isexternal':{'type':Sequelize[_0x1a96('0x4')](_0x1a96('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1a96('0x3')]}}; \ No newline at end of file +var _0x20bd=['STRING','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20bd,0x1b3));var _0xd20b=function(_0x4258ad,_0x59ba32){_0x4258ad=_0x4258ad-0x0;var _0x52267a=_0x20bd[_0x4258ad];return _0x52267a;};'use strict';var Sequelize=require(_0xd20b('0x0'));var moment=require(_0xd20b('0x1'));module[_0xd20b('0x2')]={'type':{'type':Sequelize[_0xd20b('0x3')](_0xd20b('0x4'),_0xd20b('0x5'))},'result':{'type':Sequelize[_0xd20b('0x6')]},'transfererchannel':{'type':Sequelize[_0xd20b('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xd20b('0x6')]},'transferercalleridname':{'type':Sequelize[_0xd20b('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd20b('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xd20b('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xd20b('0x6')]},'transferercontext':{'type':Sequelize[_0xd20b('0x6')]},'transfererexten':{'type':Sequelize[_0xd20b('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd20b('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xd20b('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xd20b('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xd20b('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xd20b('0x6')]},'isexternal':{'type':Sequelize[_0xd20b('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xd20b('0x6')]},'extension':{'type':Sequelize[_0xd20b('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b93c6f3..e8e1c89 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 _0x4bb4=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x4bb4,0x84));var _0x44bb=function(_0x379b68,_0x3102ab){_0x379b68=_0x379b68-0x0;var _0x2a7935=_0x4bb4[_0x379b68];return _0x2a7935;};'use strict';var emlformat=require(_0x44bb('0x0'));var rimraf=require(_0x44bb('0x1'));var zipdir=require(_0x44bb('0x2'));var jsonpatch=require(_0x44bb('0x3'));var rp=require(_0x44bb('0x4'));var moment=require(_0x44bb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x44bb('0x6'));var util=require(_0x44bb('0x7'));var path=require(_0x44bb('0x8'));var sox=require(_0x44bb('0x9'));var csv=require(_0x44bb('0xa'));var ejs=require(_0x44bb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44bb('0xc'));var squel=require(_0x44bb('0xd'));var crypto=require(_0x44bb('0xe'));var jsforce=require(_0x44bb('0xf'));var deskjs=require(_0x44bb('0x10'));var toCsv=require(_0x44bb('0xa'));var querystring=require(_0x44bb('0x11'));var Papa=require(_0x44bb('0x12'));var Redis=require(_0x44bb('0x13'));var authService=require(_0x44bb('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44bb('0x15'));var logger=require(_0x44bb('0x16'))(_0x44bb('0x17'));var utils=require(_0x44bb('0x18'));var config=require(_0x44bb('0x19'));var licenseUtil=require(_0x44bb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ca752,_0x3c166a){_0x3c166a=_0x3c166a||0xcc;return function(_0x22c7b2){if(_0x22c7b2){return _0x4ca752[_0x44bb('0x1b')](_0x3c166a);}return _0x4ca752['status'](_0x3c166a)[_0x44bb('0x1c')]();};}function respondWithResult(_0x1b0c50,_0x2cbce2){_0x2cbce2=_0x2cbce2||0xc8;return function(_0x5881b2){if(_0x5881b2){return _0x1b0c50[_0x44bb('0x1d')](_0x2cbce2)['json'](_0x5881b2);}};}function respondWithFilteredResult(_0x281109,_0x2d1046){return function(_0x8ebdb3){if(_0x8ebdb3){var _0x3c5cf6=typeof _0x2d1046[_0x44bb('0x1e')]===_0x44bb('0x1f')&&typeof _0x2d1046[_0x44bb('0x20')]===_0x44bb('0x1f');var _0x2143ec=_0x8ebdb3['count'];var _0x45c298=_0x3c5cf6?0x0:_0x2d1046[_0x44bb('0x1e')];var _0x39cb2f=_0x3c5cf6?_0x8ebdb3['count']:_0x2d1046[_0x44bb('0x1e')]+_0x2d1046[_0x44bb('0x20')];var _0x256a32;if(_0x39cb2f>=_0x2143ec){_0x39cb2f=_0x2143ec;_0x256a32=0xc8;}else{_0x256a32=0xce;}_0x281109[_0x44bb('0x1d')](_0x256a32);return _0x281109[_0x44bb('0x21')](_0x44bb('0x22'),_0x45c298+'-'+_0x39cb2f+'/'+_0x2143ec)[_0x44bb('0x23')](_0x8ebdb3);}return null;};}function patchUpdates(_0x1c8834){return function(_0x119412){try{jsonpatch['apply'](_0x119412,_0x1c8834,!![]);}catch(_0x51640c){return BPromise['reject'](_0x51640c);}return _0x119412[_0x44bb('0x24')]();};}function saveUpdates(_0x1e4b10,_0x5dfa5e){return function(_0x3e0a23){if(_0x3e0a23){return _0x3e0a23[_0x44bb('0x25')](_0x1e4b10)[_0x44bb('0x26')](function(_0x3cdefa){return _0x3cdefa;});}return null;};}function removeEntity(_0x26b071,_0x1aefa6){return function(_0x12dea0){if(_0x12dea0){return _0x12dea0[_0x44bb('0x27')]()[_0x44bb('0x26')](function(){_0x26b071[_0x44bb('0x1d')](0xcc)[_0x44bb('0x1c')]();});}};}function handleEntityNotFound(_0x2ac21e,_0x20e58c){return function(_0x41bee9){if(!_0x41bee9){_0x2ac21e[_0x44bb('0x1b')](0x194);}return _0x41bee9;};}function handleError(_0x48d926,_0x5da5c6){_0x5da5c6=_0x5da5c6||0x1f4;return function(_0x844b16){logger['error'](_0x844b16[_0x44bb('0x28')]);if(_0x844b16[_0x44bb('0x29')]){delete _0x844b16[_0x44bb('0x29')];}_0x48d926[_0x44bb('0x1d')](_0x5da5c6)[_0x44bb('0x2a')](_0x844b16);};}exports[_0x44bb('0x2b')]=function(_0x5876fe,_0xef5a65){var _0x32522={},_0xae865b={},_0x442d81={'count':0x0,'rows':[]};var _0x19eac7=_['map'](db[_0x44bb('0x2c')][_0x44bb('0x2d')],function(_0x110136){return{'name':_0x110136[_0x44bb('0x2e')],'type':_0x110136[_0x44bb('0x2f')][_0x44bb('0x30')]};});_0xae865b[_0x44bb('0x31')]=_[_0x44bb('0x32')](_0x19eac7,_0x44bb('0x29'));_0xae865b[_0x44bb('0x33')]=_[_0x44bb('0x34')](_0x5876fe[_0x44bb('0x33')]);_0xae865b[_0x44bb('0x35')]=_['intersection'](_0xae865b['model'],_0xae865b[_0x44bb('0x33')]);_0x32522[_0x44bb('0x36')]=_[_0x44bb('0x37')](_0xae865b[_0x44bb('0x31')],qs[_0x44bb('0x38')](_0x5876fe['query']['fields']));_0x32522[_0x44bb('0x36')]=_0x32522[_0x44bb('0x36')][_0x44bb('0x39')]?_0x32522[_0x44bb('0x36')]:_0xae865b['model'];if(!_0x5876fe[_0x44bb('0x33')]['hasOwnProperty'](_0x44bb('0x3a'))){_0x32522[_0x44bb('0x20')]=qs['limit'](_0x5876fe[_0x44bb('0x33')][_0x44bb('0x20')]);_0x32522[_0x44bb('0x1e')]=qs[_0x44bb('0x1e')](_0x5876fe[_0x44bb('0x33')]['offset']);}_0x32522['order']=qs[_0x44bb('0x3b')](_0x5876fe['query'][_0x44bb('0x3b')]);_0x32522['where']=qs[_0x44bb('0x35')](_[_0x44bb('0x3c')](_0x5876fe[_0x44bb('0x33')],_0xae865b[_0x44bb('0x35')]),_0x19eac7);if(_0x5876fe[_0x44bb('0x33')]['filter']){_0x32522[_0x44bb('0x3d')]=_[_0x44bb('0x3e')](_0x32522[_0x44bb('0x3d')],{'$or':_[_0x44bb('0x32')](_0x19eac7,function(_0x4dabcb){if(_0x4dabcb[_0x44bb('0x2f')]!==_0x44bb('0x3f')){var _0x4a5f5e={};_0x4a5f5e[_0x4dabcb[_0x44bb('0x29')]]={'$like':'%'+_0x5876fe[_0x44bb('0x33')][_0x44bb('0x40')]+'%'};return _0x4a5f5e;}})});}_0x32522=_['merge']({},_0x32522,_0x5876fe[_0x44bb('0x41')]);var _0x1756a0={'where':_0x32522[_0x44bb('0x3d')]};return db[_0x44bb('0x2c')][_0x44bb('0x42')](_0x1756a0)[_0x44bb('0x26')](function(_0x2e6754){_0x442d81[_0x44bb('0x42')]=_0x2e6754;if(_0x5876fe[_0x44bb('0x33')]['includeAll']){_0x32522[_0x44bb('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x44bb('0x44')](_0x32522);})[_0x44bb('0x26')](function(_0x7e54b5){_0x442d81[_0x44bb('0x45')]=_0x7e54b5;return _0x442d81;})['then'](respondWithFilteredResult(_0xef5a65,_0x32522))[_0x44bb('0x46')](handleError(_0xef5a65,null));};exports['show']=function(_0x357582,_0x36ad7d){var _0xee5db4={'raw':!![],'where':{'id':_0x357582['params']['id']}},_0x5797f6={};_0x5797f6[_0x44bb('0x31')]=_['keys'](db[_0x44bb('0x2c')][_0x44bb('0x2d')]);_0x5797f6[_0x44bb('0x33')]=_[_0x44bb('0x34')](_0x357582[_0x44bb('0x33')]);_0x5797f6[_0x44bb('0x35')]=_['intersection'](_0x5797f6[_0x44bb('0x31')],_0x5797f6[_0x44bb('0x33')]);_0xee5db4['attributes']=_[_0x44bb('0x37')](_0x5797f6[_0x44bb('0x31')],qs['fields'](_0x357582[_0x44bb('0x33')][_0x44bb('0x38')]));_0xee5db4[_0x44bb('0x36')]=_0xee5db4[_0x44bb('0x36')][_0x44bb('0x39')]?_0xee5db4[_0x44bb('0x36')]:_0x5797f6[_0x44bb('0x31')];if(_0x357582['query']['includeAll']){_0xee5db4['include']=[{'all':!![]}];}_0xee5db4=_[_0x44bb('0x3e')]({},_0xee5db4,_0x357582[_0x44bb('0x41')]);return db[_0x44bb('0x2c')][_0x44bb('0x47')](_0xee5db4)['then'](handleEntityNotFound(_0x36ad7d,null))[_0x44bb('0x26')](respondWithResult(_0x36ad7d,null))[_0x44bb('0x46')](handleError(_0x36ad7d,null));};exports['create']=function(_0x593e23,_0x2a5726){return db[_0x44bb('0x2c')][_0x44bb('0x48')](_0x593e23[_0x44bb('0x49')],{})[_0x44bb('0x26')](respondWithResult(_0x2a5726,0xc9))[_0x44bb('0x46')](handleError(_0x2a5726,null));};exports['update']=function(_0x1ee777,_0x3fdcfc){if(_0x1ee777[_0x44bb('0x49')]['id']){delete _0x1ee777[_0x44bb('0x49')]['id'];}return db[_0x44bb('0x2c')][_0x44bb('0x47')]({'where':{'id':_0x1ee777[_0x44bb('0x4a')]['id']}})[_0x44bb('0x26')](handleEntityNotFound(_0x3fdcfc,null))['then'](saveUpdates(_0x1ee777[_0x44bb('0x49')],null))[_0x44bb('0x26')](respondWithResult(_0x3fdcfc,null))['catch'](handleError(_0x3fdcfc,null));};exports['destroy']=function(_0x3d617a,_0x22117e){return db['VoiceTransferReport'][_0x44bb('0x47')]({'where':{'id':_0x3d617a[_0x44bb('0x4a')]['id']}})[_0x44bb('0x26')](handleEntityNotFound(_0x22117e,null))[_0x44bb('0x26')](removeEntity(_0x22117e,null))[_0x44bb('0x46')](handleError(_0x22117e,null));};exports[_0x44bb('0x4b')]=function(_0x54bbde,_0x5c24dd){return db[_0x44bb('0x2c')]['describe']()[_0x44bb('0x26')](respondWithResult(_0x5c24dd,null))[_0x44bb('0x46')](handleError(_0x5c24dd,null));}; \ No newline at end of file +var _0x13e6=['../../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','reject','save','update','then','destroy','error','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x13e6,0x11c));var _0x613e=function(_0x1946f6,_0x3d23c0){_0x1946f6=_0x1946f6-0x0;var _0x22e9cb=_0x13e6[_0x1946f6];return _0x22e9cb;};'use strict';var emlformat=require(_0x613e('0x0'));var rimraf=require(_0x613e('0x1'));var zipdir=require(_0x613e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x613e('0x3'));var BPromise=require(_0x613e('0x4'));var Mustache=require(_0x613e('0x5'));var util=require(_0x613e('0x6'));var path=require(_0x613e('0x7'));var sox=require(_0x613e('0x8'));var csv=require(_0x613e('0x9'));var ejs=require(_0x613e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x613e('0xb'));var squel=require(_0x613e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613e('0xd'));var toCsv=require(_0x613e('0x9'));var querystring=require('querystring');var Papa=require(_0x613e('0xe'));var Redis=require(_0x613e('0xf'));var authService=require(_0x613e('0x10'));var qs=require(_0x613e('0x11'));var as=require(_0x613e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613e('0x13'))(_0x613e('0x14'));var utils=require(_0x613e('0x15'));var config=require(_0x613e('0x16'));var licenseUtil=require(_0x613e('0x17'));var db=require(_0x613e('0x18'))['db'];function respondWithStatusCode(_0x2fb831,_0x387a63){_0x387a63=_0x387a63||0xcc;return function(_0xb8ec0e){if(_0xb8ec0e){return _0x2fb831[_0x613e('0x19')](_0x387a63);}return _0x2fb831[_0x613e('0x1a')](_0x387a63)[_0x613e('0x1b')]();};}function respondWithResult(_0x216c07,_0x4eae49){_0x4eae49=_0x4eae49||0xc8;return function(_0xc5f3b6){if(_0xc5f3b6){return _0x216c07[_0x613e('0x1a')](_0x4eae49)[_0x613e('0x1c')](_0xc5f3b6);}};}function respondWithFilteredResult(_0x23c60e,_0x9f3414){return function(_0x3fd6d7){if(_0x3fd6d7){var _0x4d3cd7=typeof _0x9f3414[_0x613e('0x1d')]===_0x613e('0x1e')&&typeof _0x9f3414[_0x613e('0x1f')]===_0x613e('0x1e');var _0x6a580d=_0x3fd6d7['count'];var _0x1db96b=_0x4d3cd7?0x0:_0x9f3414[_0x613e('0x1d')];var _0x12cc8b=_0x4d3cd7?_0x3fd6d7[_0x613e('0x20')]:_0x9f3414[_0x613e('0x1d')]+_0x9f3414['limit'];var _0x27e518;if(_0x12cc8b>=_0x6a580d){_0x12cc8b=_0x6a580d;_0x27e518=0xc8;}else{_0x27e518=0xce;}_0x23c60e[_0x613e('0x1a')](_0x27e518);return _0x23c60e[_0x613e('0x21')]('Content-Range',_0x1db96b+'-'+_0x12cc8b+'/'+_0x6a580d)[_0x613e('0x1c')](_0x3fd6d7);}return null;};}function patchUpdates(_0x34a783){return function(_0x25a346){try{jsonpatch['apply'](_0x25a346,_0x34a783,!![]);}catch(_0x24c27c){return BPromise[_0x613e('0x22')](_0x24c27c);}return _0x25a346[_0x613e('0x23')]();};}function saveUpdates(_0xa60502,_0x5294c0){return function(_0x3cc3ea){if(_0x3cc3ea){return _0x3cc3ea[_0x613e('0x24')](_0xa60502)[_0x613e('0x25')](function(_0x39d07b){return _0x39d07b;});}return null;};}function removeEntity(_0x185c18,_0x402d0e){return function(_0xf2d6dd){if(_0xf2d6dd){return _0xf2d6dd[_0x613e('0x26')]()[_0x613e('0x25')](function(){_0x185c18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15d1cd,_0x386bcc){return function(_0x307674){if(!_0x307674){_0x15d1cd['sendStatus'](0x194);}return _0x307674;};}function handleError(_0x5d966d,_0x3a88d6){_0x3a88d6=_0x3a88d6||0x1f4;return function(_0x48f79b){logger[_0x613e('0x27')](_0x48f79b['stack']);if(_0x48f79b['name']){delete _0x48f79b[_0x613e('0x28')];}_0x5d966d[_0x613e('0x1a')](_0x3a88d6)['send'](_0x48f79b);};}exports[_0x613e('0x29')]=function(_0x3d7f9d,_0x40a105){var _0x476072={},_0x536365={},_0x490f53={'count':0x0,'rows':[]};var _0x2e56bf=_[_0x613e('0x2a')](db[_0x613e('0x2b')][_0x613e('0x2c')],function(_0x24723d){return{'name':_0x24723d[_0x613e('0x2d')],'type':_0x24723d[_0x613e('0x2e')][_0x613e('0x2f')]};});_0x536365['model']=_[_0x613e('0x2a')](_0x2e56bf,_0x613e('0x28'));_0x536365[_0x613e('0x30')]=_[_0x613e('0x31')](_0x3d7f9d['query']);_0x536365[_0x613e('0x32')]=_[_0x613e('0x33')](_0x536365['model'],_0x536365['query']);_0x476072[_0x613e('0x34')]=_[_0x613e('0x33')](_0x536365[_0x613e('0x35')],qs['fields'](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x36')]));_0x476072[_0x613e('0x34')]=_0x476072[_0x613e('0x34')][_0x613e('0x37')]?_0x476072[_0x613e('0x34')]:_0x536365[_0x613e('0x35')];if(!_0x3d7f9d['query'][_0x613e('0x38')]('nolimit')){_0x476072['limit']=qs[_0x613e('0x1f')](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x1f')]);_0x476072[_0x613e('0x1d')]=qs['offset'](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x1d')]);}_0x476072[_0x613e('0x39')]=qs['sort'](_0x3d7f9d['query'][_0x613e('0x3a')]);_0x476072['where']=qs[_0x613e('0x32')](_['pick'](_0x3d7f9d[_0x613e('0x30')],_0x536365['filters']),_0x2e56bf);if(_0x3d7f9d[_0x613e('0x30')]['filter']){_0x476072[_0x613e('0x3b')]=_[_0x613e('0x3c')](_0x476072[_0x613e('0x3b')],{'$or':_[_0x613e('0x2a')](_0x2e56bf,function(_0x3968fa){if(_0x3968fa[_0x613e('0x2e')]!==_0x613e('0x3d')){var _0x271aeb={};_0x271aeb[_0x3968fa[_0x613e('0x28')]]={'$like':'%'+_0x3d7f9d[_0x613e('0x30')][_0x613e('0x3e')]+'%'};return _0x271aeb;}})});}_0x476072=_['merge']({},_0x476072,_0x3d7f9d[_0x613e('0x3f')]);var _0x128a3b={'where':_0x476072[_0x613e('0x3b')]};return db[_0x613e('0x2b')][_0x613e('0x20')](_0x128a3b)['then'](function(_0x40144f){_0x490f53[_0x613e('0x20')]=_0x40144f;if(_0x3d7f9d['query'][_0x613e('0x40')]){_0x476072[_0x613e('0x41')]=[{'all':!![]}];}return db[_0x613e('0x2b')][_0x613e('0x42')](_0x476072);})[_0x613e('0x25')](function(_0x30af44){_0x490f53[_0x613e('0x43')]=_0x30af44;return _0x490f53;})['then'](respondWithFilteredResult(_0x40a105,_0x476072))[_0x613e('0x44')](handleError(_0x40a105,null));};exports[_0x613e('0x45')]=function(_0x53251f,_0x930105){var _0x3c12da={'raw':!![],'where':{'id':_0x53251f[_0x613e('0x46')]['id']}},_0x32ee73={};_0x32ee73[_0x613e('0x35')]=_[_0x613e('0x31')](db[_0x613e('0x2b')][_0x613e('0x2c')]);_0x32ee73[_0x613e('0x30')]=_['keys'](_0x53251f['query']);_0x32ee73[_0x613e('0x32')]=_[_0x613e('0x33')](_0x32ee73[_0x613e('0x35')],_0x32ee73[_0x613e('0x30')]);_0x3c12da[_0x613e('0x34')]=_['intersection'](_0x32ee73[_0x613e('0x35')],qs[_0x613e('0x36')](_0x53251f['query'][_0x613e('0x36')]));_0x3c12da[_0x613e('0x34')]=_0x3c12da[_0x613e('0x34')][_0x613e('0x37')]?_0x3c12da[_0x613e('0x34')]:_0x32ee73[_0x613e('0x35')];if(_0x53251f[_0x613e('0x30')][_0x613e('0x40')]){_0x3c12da[_0x613e('0x41')]=[{'all':!![]}];}_0x3c12da=_['merge']({},_0x3c12da,_0x53251f[_0x613e('0x3f')]);return db[_0x613e('0x2b')][_0x613e('0x47')](_0x3c12da)[_0x613e('0x25')](handleEntityNotFound(_0x930105,null))[_0x613e('0x25')](respondWithResult(_0x930105,null))['catch'](handleError(_0x930105,null));};exports[_0x613e('0x48')]=function(_0x4e1af4,_0x279fe3){return db[_0x613e('0x2b')]['create'](_0x4e1af4[_0x613e('0x49')],{})[_0x613e('0x25')](respondWithResult(_0x279fe3,0xc9))['catch'](handleError(_0x279fe3,null));};exports['update']=function(_0x25a01b,_0x41b647){if(_0x25a01b[_0x613e('0x49')]['id']){delete _0x25a01b[_0x613e('0x49')]['id'];}return db[_0x613e('0x2b')][_0x613e('0x47')]({'where':{'id':_0x25a01b['params']['id']}})[_0x613e('0x25')](handleEntityNotFound(_0x41b647,null))['then'](saveUpdates(_0x25a01b[_0x613e('0x49')],null))[_0x613e('0x25')](respondWithResult(_0x41b647,null))[_0x613e('0x44')](handleError(_0x41b647,null));};exports[_0x613e('0x26')]=function(_0x20c2f9,_0x39872a){return db[_0x613e('0x2b')][_0x613e('0x47')]({'where':{'id':_0x20c2f9[_0x613e('0x46')]['id']}})['then'](handleEntityNotFound(_0x39872a,null))[_0x613e('0x25')](removeEntity(_0x39872a,null))[_0x613e('0x44')](handleError(_0x39872a,null));};exports['describe']=function(_0x2109ee,_0x1196f5){return db[_0x613e('0x2b')][_0x613e('0x4a')]()[_0x613e('0x25')](respondWithResult(_0x1196f5,null))['catch'](handleError(_0x1196f5,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c9eedf0..4a6929f 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 _0xe816=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x24fa1e,_0x2ae2f0){var _0x287126=function(_0x3bf0b5){while(--_0x3bf0b5){_0x24fa1e['push'](_0x24fa1e['shift']());}};_0x287126(++_0x2ae2f0);}(_0xe816,0x1c5));var _0x6e81=function(_0xeb644f,_0x15158c){_0xeb644f=_0xeb644f-0x0;var _0x4a9a37=_0xe816[_0xeb644f];return _0x4a9a37;};'use strict';var _=require(_0x6e81('0x0'));var util=require(_0x6e81('0x1'));var logger=require(_0x6e81('0x2'))(_0x6e81('0x3'));var moment=require(_0x6e81('0x4'));var BPromise=require('bluebird');var rp=require(_0x6e81('0x5'));var fs=require('fs');var path=require(_0x6e81('0x6'));var rimraf=require(_0x6e81('0x7'));var config=require(_0x6e81('0x8'));var attributes=require(_0x6e81('0x9'));module[_0x6e81('0xa')]=function(_0x43c242,_0x1dad1c){return _0x43c242[_0x6e81('0xb')](_0x6e81('0xc'),attributes,{'tableName':_0x6e81('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1419=['VoiceTransferReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x439f72,_0x135301){var _0x32008c=function(_0x5afc04){while(--_0x5afc04){_0x439f72['push'](_0x439f72['shift']());}};_0x32008c(++_0x135301);}(_0x1419,0x182));var _0x9141=function(_0x24bf46,_0x265c00){_0x24bf46=_0x24bf46-0x0;var _0x3dcdca=_0x1419[_0x24bf46];return _0x3dcdca;};'use strict';var _=require('lodash');var util=require(_0x9141('0x0'));var logger=require(_0x9141('0x1'))('api');var moment=require(_0x9141('0x2'));var BPromise=require(_0x9141('0x3'));var rp=require(_0x9141('0x4'));var fs=require('fs');var path=require(_0x9141('0x5'));var rimraf=require(_0x9141('0x6'));var config=require(_0x9141('0x7'));var attributes=require(_0x9141('0x8'));module[_0x9141('0x9')]=function(_0x37e112,_0x34a54d){return _0x37e112['define'](_0x9141('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 07696dc..147a475 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 _0x92a9=['VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x388ca6,_0x2ee46f){var _0x31cf96=function(_0x188246){while(--_0x188246){_0x388ca6['push'](_0x388ca6['shift']());}};_0x31cf96(++_0x2ee46f);}(_0x92a9,0xc6));var _0x992a=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x92a9[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x992a('0x0'));var util=require(_0x992a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x992a('0x2'));var fs=require('fs');var Redis=require(_0x992a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x992a('0x4'));var logger=require(_0x992a('0x5'))(_0x992a('0x6'));var config=require(_0x992a('0x7'));var jayson=require(_0x992a('0x8'));var client=jayson[_0x992a('0x9')][_0x992a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x462a77,_0x13d526,_0x43a67d){return new BPromise(function(_0x3772e8,_0x136765){return client[_0x992a('0xb')](_0x462a77,_0x43a67d)[_0x992a('0xc')](function(_0x33606b){logger[_0x992a('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x13d526,_0x992a('0xe'));logger[_0x992a('0xf')](_0x992a('0x10'),_0x13d526,'request\x20sent',JSON['stringify'](_0x33606b));if(_0x33606b[_0x992a('0x11')]){if(_0x33606b['error']['code']===0x1f4){logger['error'](_0x992a('0x12'),_0x13d526,_0x33606b[_0x992a('0x11')][_0x992a('0x13')]);return _0x136765(_0x33606b['error'][_0x992a('0x13')]);}logger[_0x992a('0x11')](_0x992a('0x12'),_0x13d526,_0x33606b[_0x992a('0x11')][_0x992a('0x13')]);return _0x3772e8(_0x33606b[_0x992a('0x11')][_0x992a('0x13')]);}else{logger[_0x992a('0xd')](_0x992a('0x12'),_0x13d526,_0x992a('0xe'));_0x3772e8(_0x33606b[_0x992a('0x14')][_0x992a('0x13')]);}})[_0x992a('0x15')](function(_0x4100b7){logger['error'](_0x992a('0x12'),_0x13d526,_0x4100b7);_0x136765(_0x4100b7);});});}exports[_0x992a('0x16')]=function(_0x5e7e41){var _0x1d9ebf=this;return new Promise(function(_0x492877,_0x4ced17){return db['VoiceTransferReport'][_0x992a('0x17')](_0x5e7e41[_0x992a('0x18')],{'raw':_0x5e7e41['options']?_0x5e7e41[_0x992a('0x19')][_0x992a('0x1a')]===undefined?!![]:![]:!![]})[_0x992a('0xc')](function(_0x594bdb){logger[_0x992a('0xd')](_0x992a('0x16'),_0x5e7e41);logger[_0x992a('0xf')]('CreateVoiceTransferReport',_0x5e7e41,JSON['stringify'](_0x594bdb));_0x492877(_0x594bdb);})[_0x992a('0x15')](function(_0x2f4358){logger['error'](_0x992a('0x16'),_0x2f4358[_0x992a('0x13')],_0x5e7e41);_0x4ced17(_0x1d9ebf['error'](0x1f4,_0x2f4358['message']));});});}; \ No newline at end of file +var _0xbd52=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbd52,0x15b));var _0x2bd5=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0xbd52[_0x256b67];return _0x3e2d99;};'use strict';var _=require(_0x2bd5('0x0'));var util=require(_0x2bd5('0x1'));var moment=require(_0x2bd5('0x2'));var BPromise=require(_0x2bd5('0x3'));var rs=require(_0x2bd5('0x4'));var fs=require('fs');var Redis=require(_0x2bd5('0x5'));var db=require(_0x2bd5('0x6'))['db'];var utils=require(_0x2bd5('0x7'));var logger=require('../../config/logger')(_0x2bd5('0x8'));var config=require('../../config/environment');var jayson=require(_0x2bd5('0x9'));var client=jayson[_0x2bd5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1646b8,_0x4ca19c,_0x4b9728){return new BPromise(function(_0x547201,_0x2d9927){return client[_0x2bd5('0xb')](_0x1646b8,_0x4b9728)[_0x2bd5('0xc')](function(_0x275f88){logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x4ca19c,_0x2bd5('0xf'));logger[_0x2bd5('0x10')](_0x2bd5('0x11'),_0x4ca19c,_0x2bd5('0xf'),JSON[_0x2bd5('0x12')](_0x275f88));if(_0x275f88['error']){if(_0x275f88[_0x2bd5('0x13')]['code']===0x1f4){logger[_0x2bd5('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ca19c,_0x275f88[_0x2bd5('0x13')]['message']);return _0x2d9927(_0x275f88[_0x2bd5('0x13')]['message']);}logger[_0x2bd5('0x13')](_0x2bd5('0xe'),_0x4ca19c,_0x275f88[_0x2bd5('0x13')][_0x2bd5('0x14')]);return _0x547201(_0x275f88[_0x2bd5('0x13')][_0x2bd5('0x14')]);}else{logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x4ca19c,'request\x20sent');_0x547201(_0x275f88[_0x2bd5('0x15')][_0x2bd5('0x14')]);}})[_0x2bd5('0x16')](function(_0x1e1624){logger['error'](_0x2bd5('0xe'),_0x4ca19c,_0x1e1624);_0x2d9927(_0x1e1624);});});}exports[_0x2bd5('0x17')]=function(_0xbfe321){var _0x58d7ba=this;return new Promise(function(_0x7fd31b,_0xe4cb28){return db[_0x2bd5('0x18')][_0x2bd5('0x19')](_0xbfe321['body'],{'raw':_0xbfe321[_0x2bd5('0x1a')]?_0xbfe321[_0x2bd5('0x1a')][_0x2bd5('0x1b')]===undefined?!![]:![]:!![]})[_0x2bd5('0xc')](function(_0xf48d2){logger['info'](_0x2bd5('0x17'),_0xbfe321);logger[_0x2bd5('0x10')](_0x2bd5('0x17'),_0xbfe321,JSON[_0x2bd5('0x12')](_0xf48d2));_0x7fd31b(_0xf48d2);})['catch'](function(_0x1eb49b){logger[_0x2bd5('0x13')]('CreateVoiceTransferReport',_0x1eb49b[_0x2bd5('0x14')],_0xbfe321);_0xe4cb28(_0x58d7ba[_0x2bd5('0x13')](0x1f4,_0x1eb49b[_0x2bd5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d075578..43e3d50 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 _0x0f4f=['hangup','/answer','answer','hold','/unhold','unhold','/calls','calls','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate'];(function(_0x20aa33,_0xfb4b67){var _0x3a6e53=function(_0x5a41d5){while(--_0x5a41d5){_0x20aa33['push'](_0x20aa33['shift']());}};_0x3a6e53(++_0xfb4b67);}(_0x0f4f,0x14c));var _0xf0f4=function(_0x427f6a,_0x2a5c59){_0x427f6a=_0x427f6a-0x0;var _0x5b161a=_0x0f4f[_0x427f6a];return _0x5b161a;};'use strict';var express=require(_0xf0f4('0x0'));var router=express[_0xf0f4('0x1')]();var auth=require(_0xf0f4('0x2'));var controller=require('./webbar.controller');router[_0xf0f4('0x3')](_0xf0f4('0x4'),auth[_0xf0f4('0x5')](),auth[_0xf0f4('0x6')](),controller[_0xf0f4('0x7')]);router[_0xf0f4('0x3')]('/hangup',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf0f4('0x8')]);router[_0xf0f4('0x3')](_0xf0f4('0x9'),auth[_0xf0f4('0x5')](),auth[_0xf0f4('0x6')](),controller[_0xf0f4('0xa')]);router['post']('/hold',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf0f4('0xb')]);router[_0xf0f4('0x3')](_0xf0f4('0xc'),auth[_0xf0f4('0x5')](),auth['canUpdate'](),controller[_0xf0f4('0xd')]);router['post'](_0xf0f4('0xe'),auth[_0xf0f4('0x5')](),auth['canUpdate'](),controller[_0xf0f4('0xf')]);router[_0xf0f4('0x3')]('/transfer',auth[_0xf0f4('0x5')](),auth[_0xf0f4('0x6')](),controller['transfer']);module[_0xf0f4('0x10')]=router; \ No newline at end of file +var _0x9d33=['canUpdate','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','hangup','/answer'];(function(_0x15cda6,_0x264c74){var _0x369d55=function(_0x2a5c92){while(--_0x2a5c92){_0x15cda6['push'](_0x15cda6['shift']());}};_0x369d55(++_0x264c74);}(_0x9d33,0xfa));var _0x39d3=function(_0x44efb7,_0x5eb1e0){_0x44efb7=_0x44efb7-0x0;var _0x5e9880=_0x9d33[_0x44efb7];return _0x5e9880;};'use strict';var express=require('express');var router=express[_0x39d3('0x0')]();var auth=require(_0x39d3('0x1'));var controller=require(_0x39d3('0x2'));router[_0x39d3('0x3')](_0x39d3('0x4'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x6')]);router[_0x39d3('0x3')](_0x39d3('0x7'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x8')]);router[_0x39d3('0x3')](_0x39d3('0x9'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0xb')]);router[_0x39d3('0x3')]('/hold',auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0xc')]);router[_0x39d3('0x3')](_0x39d3('0xd'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0xe')]);router[_0x39d3('0x3')](_0x39d3('0xf'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x10')]);router['post'](_0x39d3('0x11'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0x12')]);module[_0x39d3('0x13')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 7fba447..e6c4c7c 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 _0x70e0=['rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','webbarapi','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','catch','User','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','length','\x20not\x20found!','originate','body','userId','callNumber','callerId','info','entityFound:','user:%s','json','hangup\x20fired:','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:'];(function(_0x5deac4,_0x4273b6){var _0x319b1e=function(_0x51ce6c){while(--_0x51ce6c){_0x5deac4['push'](_0x5deac4['shift']());}};_0x319b1e(++_0x4273b6);}(_0x70e0,0x17b));var _0x070e=function(_0x554bcf,_0x182551){_0x554bcf=_0x554bcf-0x0;var _0xcfb800=_0x70e0[_0x554bcf];return _0xcfb800;};'use strict';var path=require(_0x070e('0x0'));var fs=require('fs');var _=require(_0x070e('0x1'));var db=require(_0x070e('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x070e('0x3'));var jayson=require(_0x070e('0x4'));var amiClient=jayson[_0x070e('0x5')][_0x070e('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x070e('0x7'));var Redis=require('ioredis');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));var Schema=require(_0x070e('0xa'));var originateValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'callNumber':{'type':_0x070e('0xd'),'required':[!![],_0x070e('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':[!![],_0x070e('0xf')]},'transferNumber':{'type':_0x070e('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x070e('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x070e('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x070e('0xc')]}});function emit(_0xeae1a5,_0x180897,_0x19d9da){logger['info'](_0xeae1a5,_0x180897,JSON['stringify'](_0x19d9da));io['to'](_0xeae1a5)[_0x070e('0x10')](_0x180897,_0x19d9da);}function handleError(_0x2bd937){return function(_0x38f6e6){console[_0x070e('0x11')](_0x070e('0x12'),_0x38f6e6,_0x38f6e6 instanceof RangeError);logger['error'](_0x38f6e6[_0x070e('0x13')]);if(_0x38f6e6 instanceof RangeError){if(_0x38f6e6[_0x070e('0x14')]){delete _0x38f6e6[_0x070e('0x14')];}_0x2bd937[_0x070e('0x15')](0x194)[_0x070e('0x16')](_0x38f6e6);}else{if(_0x38f6e6['name']){delete _0x38f6e6['name'];}_0x2bd937['status'](0x1f4)[_0x070e('0x16')](_0x38f6e6);}};}function checkError(){return function(_0x3004f0){if(!_0x3004f0){throw new RangeError(_0x070e('0x17'));}return _0x3004f0;};}function respondWithRpcPromise(_0x4be0d7,_0x5b184){return new BPromise(function(_0x5dc5d2,_0xf8dd5d){var _0x3f6985=amiClient;return _0x3f6985[_0x070e('0x18')](_0x4be0d7,_0x5b184)[_0x070e('0x19')](function(_0x28a1c3){if(_0x28a1c3[_0x070e('0x1a')]){if(_0x28a1c3[_0x070e('0x1a')][_0x070e('0x1b')]===0x1f4){return _0xf8dd5d(_0x28a1c3['error'][_0x070e('0x1c')]);}return _0x5dc5d2(_0x28a1c3[_0x070e('0x1a')][_0x070e('0x1c')]);}else{_0x5dc5d2(_0x28a1c3['result']);}})[_0x070e('0x1d')](function(_0x5f3e9d){_0xf8dd5d(_0x5f3e9d);});});}function getAgent(_0x4a2dbd){return db[_0x070e('0x1e')][_0x070e('0x1f')]({'where':{'id':_0x4a2dbd,'role':_0x070e('0x20')}})[_0x070e('0x19')](checkError());}function getAgentCheckSession(_0x4763c6,_0x497f58){return new BPromise(function(_0x374c54,_0x219e48){var _0x1d72d6=respondWithRpcPromise(_0x070e('0x21'));var _0x43dd96=getAgent(_0x4763c6);Promise[_0x070e('0x22')]([_0x1d72d6,_0x43dd96])[_0x070e('0x19')](function(_0x26373b){var _0x5e8326=_0x26373b[0x0];var _0x282344=_0x26373b[0x1];var _0x351641=_[_0x070e('0x23')](_0x5e8326['rows'],function(_0x5c5f0d){return _0x5c5f0d[_0x070e('0x24')]==_0x282344['id']&&_0x5c5f0d[_0x070e('0x25')]==_0x497f58;});if(_0x351641[_0x070e('0x26')]==0x1){_0x374c54(_0x282344);}else{_0x219e48(new RangeError('sessionId\x20'+_0x497f58+_0x070e('0x27')));}});});}exports[_0x070e('0x28')]=function(_0x3a9425,_0x5f2bee){logger['info']('originate\x20fired:',_0x3a9425['body']);var _0x59c5b4=originateValidation[_0x070e('0xa')](_0x3a9425['body']);if(_0x59c5b4[_0x070e('0x26')]>0x0){return _0x5f2bee[_0x070e('0x15')](0x190)['json'](_0x59c5b4);}var _0x47a739=_0x3a9425[_0x070e('0x29')][_0x070e('0x2a')];var _0x55288a=_0x3a9425['body'][_0x070e('0x2b')];var _0x27dd1f=_0x3a9425[_0x070e('0x29')][_0x070e('0x2c')];var _0x18f0ad=_0x3a9425['body']['callbackUrl'];return getAgent(_0x47a739)[_0x070e('0x19')](function(_0x3011c4){logger[_0x070e('0x2d')](_0x070e('0x2e'),_0x3011c4[_0x070e('0x14')]);emit(util['format'](_0x070e('0x2f'),_0x3011c4[_0x070e('0x14')]),'webbar:originate',{'callNumber':_0x55288a,'callerId':_0x27dd1f,'callbackUrl':_0x18f0ad});return _0x5f2bee[_0x070e('0x15')](0xc8)[_0x070e('0x30')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5f2bee));};exports['hangup']=function(_0x363bff,_0x3dfbf7){logger[_0x070e('0x2d')](_0x070e('0x31'),_0x363bff[_0x070e('0x29')]);var _0x5e3827=hangupValidation[_0x070e('0xa')](_0x363bff[_0x070e('0x29')]);if(_0x5e3827[_0x070e('0x26')]>0x0){return _0x3dfbf7['status'](0x190)[_0x070e('0x30')](_0x5e3827);}var _0x72cbc7=_0x363bff[_0x070e('0x29')]['userId'];var _0x13982f=_0x363bff[_0x070e('0x29')]['sessionId'];return getAgent(_0x72cbc7)[_0x070e('0x19')](function(_0x5d689b){logger[_0x070e('0x2d')](_0x070e('0x2e'),_0x5d689b[_0x070e('0x14')]);emit(util[_0x070e('0x32')](_0x070e('0x2f'),_0x5d689b['name']),_0x070e('0x33'),{'sessionId':_0x13982f});return _0x3dfbf7['status'](0xc8)['json']({'error':![],'message':_0x070e('0x34')});})[_0x070e('0x1d')](handleError(_0x3dfbf7));};exports[_0x070e('0x35')]=function(_0x4d52ff,_0x2ad56c){logger[_0x070e('0x2d')](_0x070e('0x36'),_0x4d52ff[_0x070e('0x29')]);var _0x4a4ee3=answerValidation[_0x070e('0xa')](_0x4d52ff['body']);if(_0x4a4ee3['length']>0x0){return _0x2ad56c['status'](0x190)[_0x070e('0x30')](_0x4a4ee3);}var _0x926533=_0x4d52ff[_0x070e('0x29')][_0x070e('0x2a')];var _0x34f23e=_0x4d52ff['body'][_0x070e('0x25')];return getAgent(_0x926533)['then'](function(_0x23dac5){logger[_0x070e('0x2d')](_0x070e('0x2e'),_0x23dac5['name']);emit(util['format'](_0x070e('0x2f'),_0x23dac5['name']),_0x070e('0x37'),{'sessionId':_0x34f23e});return _0x2ad56c[_0x070e('0x15')](0xc8)[_0x070e('0x30')]({'error':![],'message':'answer\x20executed!'});})[_0x070e('0x1d')](handleError(_0x2ad56c));};exports[_0x070e('0x38')]=function(_0x48d836,_0x589b97){logger[_0x070e('0x2d')](_0x070e('0x39'),_0x48d836[_0x070e('0x29')]);var _0x1fc7c4=holdValidation[_0x070e('0xa')](_0x48d836['body']);if(_0x1fc7c4[_0x070e('0x26')]>0x0){return _0x589b97[_0x070e('0x15')](0x190)[_0x070e('0x30')](_0x1fc7c4);}var _0x391dee=_0x48d836[_0x070e('0x29')][_0x070e('0x2a')];var _0x1f54d5=_0x48d836[_0x070e('0x29')][_0x070e('0x25')];return getAgent(_0x391dee)[_0x070e('0x19')](function(_0x210c4d){logger[_0x070e('0x2d')](_0x070e('0x2e'),_0x210c4d[_0x070e('0x14')]);emit(util[_0x070e('0x32')]('user:%s',_0x210c4d[_0x070e('0x14')]),_0x070e('0x3a'),{'sessionId':_0x1f54d5});return _0x589b97[_0x070e('0x15')](0xc8)[_0x070e('0x30')]({'error':![],'message':_0x070e('0x3b')});})[_0x070e('0x1d')](handleError(_0x589b97));};exports[_0x070e('0x3c')]=function(_0x35dbaf,_0x1c64d2){logger['info'](_0x070e('0x3d'),_0x35dbaf['body']);var _0x1acddb=unholdValidation[_0x070e('0xa')](_0x35dbaf['body']);if(_0x1acddb[_0x070e('0x26')]>0x0){return _0x1c64d2[_0x070e('0x15')](0x190)[_0x070e('0x30')](_0x1acddb);}var _0xa74805=_0x35dbaf[_0x070e('0x29')][_0x070e('0x2a')];var _0x83f21e=_0x35dbaf['body'][_0x070e('0x25')];return getAgent(_0xa74805)['then'](function(_0x516161){logger[_0x070e('0x2d')](_0x070e('0x2e'),_0x516161[_0x070e('0x14')]);emit(util[_0x070e('0x32')](_0x070e('0x2f'),_0x516161[_0x070e('0x14')]),_0x070e('0x3e'),{'sessionId':_0x83f21e});return _0x1c64d2[_0x070e('0x15')](0xc8)['json']({'error':![],'message':_0x070e('0x3f')});})['catch'](handleError(_0x1c64d2));};exports['calls']=function(_0x3a76e2,_0x20acc6){logger['info'](_0x070e('0x40'),_0x20acc6[_0x070e('0x29')]);var _0x210f4a=callsValidation[_0x070e('0xa')](_0x3a76e2[_0x070e('0x29')]);if(_0x210f4a[_0x070e('0x26')]>0x0){return _0x20acc6[_0x070e('0x15')](0x190)['json'](_0x210f4a);}var _0x5874cd=_0x3a76e2['body'][_0x070e('0x2a')];var _0x1948a5=respondWithRpcPromise(_0x070e('0x21'));var _0x2f8fcb=getAgent(_0x5874cd);return Promise['all']([_0x1948a5,_0x2f8fcb])[_0x070e('0x19')](function(_0x5d3c3a){var _0x212710=_0x5d3c3a[0x0];var _0x1cbb7e=_0x5d3c3a[0x1];var _0x476804=_[_0x070e('0x23')](_0x212710[_0x070e('0x41')],function(_0x15dbc4){return _0x15dbc4['UserId']==_0x1cbb7e['id'];});return _0x20acc6[_0x070e('0x15')](0xc8)[_0x070e('0x30')]({'count':_0x476804[_0x070e('0x26')],'rows':_0x476804});})['catch'](handleError(_0x20acc6));};exports[_0x070e('0x42')]=function(_0x1da803,_0x5cd534){logger[_0x070e('0x2d')]('conference\x20fired:',_0x1da803[_0x070e('0x29')]);var _0x569f92=conferenceValidation['validate'](_0x1da803['body']);if(_0x569f92[_0x070e('0x26')]>0x0){return _0x5cd534[_0x070e('0x15')](0x190)[_0x070e('0x30')](_0x569f92);}var _0x122198=_0x1da803[_0x070e('0x29')][_0x070e('0x2a')];return getAgent(_0x122198)['then'](function(_0x841c89){logger['info'](_0x070e('0x2e'),_0x841c89['name']);emit(util[_0x070e('0x32')](_0x070e('0x2f'),_0x841c89['name']),_0x070e('0x43'));return _0x5cd534['status'](0xc8)[_0x070e('0x30')]({'error':![],'message':_0x070e('0x44')});})[_0x070e('0x1d')](handleError(_0x5cd534));};exports[_0x070e('0x45')]=function(_0x764b06,_0x20c772){logger[_0x070e('0x2d')](_0x070e('0x46'),_0x764b06[_0x070e('0x29')]);var _0x3332d0=transferValidation[_0x070e('0xa')](_0x764b06[_0x070e('0x29')]);if(_0x3332d0[_0x070e('0x26')]>0x0){return _0x20c772[_0x070e('0x15')](0x190)['json'](_0x3332d0);}var _0x45bf20=_0x764b06[_0x070e('0x29')][_0x070e('0x2a')];var _0x93301a=_0x764b06['body'][_0x070e('0x25')];var _0x4e8e58=_0x764b06[_0x070e('0x29')][_0x070e('0x47')];return getAgent(_0x45bf20)[_0x070e('0x19')](function(_0x12a58f){logger['info'](_0x070e('0x2e'),_0x12a58f[_0x070e('0x14')]);emit(util[_0x070e('0x32')](_0x070e('0x2f'),_0x12a58f['name']),_0x070e('0x48'),{'sessionId':_0x93301a,'transferNumber':_0x4e8e58});return _0x20c772['status'](0xc8)[_0x070e('0x30')]({'error':![],'message':_0x070e('0x49')});})[_0x070e('0x1d')](handleError(_0x20c772));}; \ No newline at end of file +var _0xcffe=['transfer','transfer\x20fired:','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','catch','User','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all'];(function(_0x290490,_0x2e9ccf){var _0xb3ebf9=function(_0x558f39){while(--_0x558f39){_0x290490['push'](_0x290490['shift']());}};_0xb3ebf9(++_0x2e9ccf);}(_0xcffe,0x1a1));var _0xecff=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0xcffe[_0x1ae78f];return _0x5baf80;};'use strict';var path=require(_0xecff('0x0'));var fs=require('fs');var _=require(_0xecff('0x1'));var db=require(_0xecff('0x2'))['db'];var config=require(_0xecff('0x3'));var util=require(_0xecff('0x4'));var BPromise=require(_0xecff('0x5'));var jayson=require(_0xecff('0x6'));var amiClient=jayson[_0xecff('0x7')][_0xecff('0x8')]({'port':0x232a});var logger=require(_0xecff('0x9'))('webbarapi');var Redis=require('ioredis');config[_0xecff('0xa')]=_[_0xecff('0xb')](config[_0xecff('0xa')],{'host':_0xecff('0xc'),'port':0x18eb});var io=require(_0xecff('0xd'))(new Redis(config[_0xecff('0xa')]));var Schema=require(_0xecff('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'callNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x11')]},'callerId':{'type':_0xecff('0x10')},'callbackUrl':{'type':_0xecff('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x13')]},'transferNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]}});function emit(_0x3a7623,_0x596b09,_0x52b62f){logger[_0xecff('0x15')](_0x3a7623,_0x596b09,JSON[_0xecff('0x16')](_0x52b62f));io['to'](_0x3a7623)['emit'](_0x596b09,_0x52b62f);}function handleError(_0x42d6c1){return function(_0x3adc81){console[_0xecff('0x17')](_0xecff('0x18'),_0x3adc81,_0x3adc81 instanceof RangeError);logger[_0xecff('0x19')](_0x3adc81[_0xecff('0x1a')]);if(_0x3adc81 instanceof RangeError){if(_0x3adc81['name']){delete _0x3adc81[_0xecff('0x1b')];}_0x42d6c1[_0xecff('0x1c')](0x194)[_0xecff('0x1d')](_0x3adc81);}else{if(_0x3adc81[_0xecff('0x1b')]){delete _0x3adc81['name'];}_0x42d6c1[_0xecff('0x1c')](0x1f4)[_0xecff('0x1d')](_0x3adc81);}};}function checkError(){return function(_0x393acf){if(!_0x393acf){throw new RangeError(_0xecff('0x1e'));}return _0x393acf;};}function respondWithRpcPromise(_0x284458,_0x2402e0){return new BPromise(function(_0x494754,_0x14378d){var _0x520d6d=amiClient;return _0x520d6d['request'](_0x284458,_0x2402e0)[_0xecff('0x1f')](function(_0x4fdc8e){if(_0x4fdc8e[_0xecff('0x19')]){if(_0x4fdc8e['error'][_0xecff('0x20')]===0x1f4){return _0x14378d(_0x4fdc8e['error'][_0xecff('0x21')]);}return _0x494754(_0x4fdc8e[_0xecff('0x19')]['message']);}else{_0x494754(_0x4fdc8e[_0xecff('0x22')]);}})[_0xecff('0x23')](function(_0x393312){_0x14378d(_0x393312);});});}function getAgent(_0x3cadb9){return db[_0xecff('0x24')]['findOne']({'where':{'id':_0x3cadb9,'role':'agent'}})[_0xecff('0x1f')](checkError());}function getAgentCheckSession(_0x484415,_0x1281d8){return new BPromise(function(_0x3ef198,_0x49a224){var _0x1dfeb6=respondWithRpcPromise('VoiceChannels');var _0x4e7afa=getAgent(_0x484415);Promise['all']([_0x1dfeb6,_0x4e7afa])[_0xecff('0x1f')](function(_0xabe5da){var _0x230d04=_0xabe5da[0x0];var _0x1e3175=_0xabe5da[0x1];var _0x5e70f3=_[_0xecff('0x25')](_0x230d04[_0xecff('0x26')],function(_0x1926a5){return _0x1926a5['UserId']==_0x1e3175['id']&&_0x1926a5[_0xecff('0x27')]==_0x1281d8;});if(_0x5e70f3[_0xecff('0x28')]==0x1){_0x3ef198(_0x1e3175);}else{_0x49a224(new RangeError(_0xecff('0x29')+_0x1281d8+_0xecff('0x2a')));}});});}exports['originate']=function(_0x7e7a6c,_0x350297){logger['info'](_0xecff('0x2b'),_0x7e7a6c[_0xecff('0x2c')]);var _0xaa3c9a=originateValidation[_0xecff('0xe')](_0x7e7a6c['body']);if(_0xaa3c9a[_0xecff('0x28')]>0x0){return _0x350297[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0xaa3c9a);}var _0x55c232=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2e')];var _0x16ef80=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2f')];var _0x20db12=_0x7e7a6c['body']['callerId'];var _0x4dd43c=_0x7e7a6c[_0xecff('0x2c')]['callbackUrl'];return getAgent(_0x55c232)[_0xecff('0x1f')](function(_0x21411b){logger['info'](_0xecff('0x30'),_0x21411b[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x21411b[_0xecff('0x1b')]),_0xecff('0x32'),{'callNumber':_0x16ef80,'callerId':_0x20db12,'callbackUrl':_0x4dd43c});return _0x350297[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x33')});})[_0xecff('0x23')](handleError(_0x350297));};exports[_0xecff('0x34')]=function(_0x13a525,_0x317037){logger[_0xecff('0x15')](_0xecff('0x35'),_0x13a525[_0xecff('0x2c')]);var _0x6d3916=hangupValidation[_0xecff('0xe')](_0x13a525[_0xecff('0x2c')]);if(_0x6d3916['length']>0x0){return _0x317037[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x6d3916);}var _0x199019=_0x13a525[_0xecff('0x2c')][_0xecff('0x2e')];var _0x19626e=_0x13a525[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x199019)['then'](function(_0x28141f){logger['info'](_0xecff('0x30'),_0x28141f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x28141f[_0xecff('0x1b')]),_0xecff('0x37'),{'sessionId':_0x19626e});return _0x317037[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x38')});})[_0xecff('0x23')](handleError(_0x317037));};exports['answer']=function(_0x4d4c7b,_0x3a7ebc){logger[_0xecff('0x15')](_0xecff('0x39'),_0x4d4c7b[_0xecff('0x2c')]);var _0x47084b=answerValidation[_0xecff('0xe')](_0x4d4c7b['body']);if(_0x47084b[_0xecff('0x28')]>0x0){return _0x3a7ebc[_0xecff('0x1c')](0x190)['json'](_0x47084b);}var _0x8b0f59=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4402a0=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x8b0f59)['then'](function(_0x310593){logger[_0xecff('0x15')](_0xecff('0x30'),_0x310593['name']);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x310593[_0xecff('0x1b')]),_0xecff('0x3a'),{'sessionId':_0x4402a0});return _0x3a7ebc['status'](0xc8)[_0xecff('0x2d')]({'error':![],'message':_0xecff('0x3b')});})['catch'](handleError(_0x3a7ebc));};exports[_0xecff('0x3c')]=function(_0x1d2ac3,_0x4ba9e3){logger[_0xecff('0x15')]('hold\x20fired:',_0x1d2ac3[_0xecff('0x2c')]);var _0x3692c9=holdValidation[_0xecff('0xe')](_0x1d2ac3[_0xecff('0x2c')]);if(_0x3692c9[_0xecff('0x28')]>0x0){return _0x4ba9e3[_0xecff('0x1c')](0x190)['json'](_0x3692c9);}var _0x596eb8=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x2e')];var _0x1aae95=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x596eb8)[_0xecff('0x1f')](function(_0x36c50f){logger[_0xecff('0x15')]('entityFound:',_0x36c50f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x36c50f[_0xecff('0x1b')]),'webbar:hold',{'sessionId':_0x1aae95});return _0x4ba9e3[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xecff('0x23')](handleError(_0x4ba9e3));};exports[_0xecff('0x3d')]=function(_0x3e79f9,_0x188d08){logger[_0xecff('0x15')]('unhold\x20fired:',_0x3e79f9['body']);var _0x198ad6=unholdValidation[_0xecff('0xe')](_0x3e79f9[_0xecff('0x2c')]);if(_0x198ad6[_0xecff('0x28')]>0x0){return _0x188d08[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x198ad6);}var _0x339d3d=_0x3e79f9[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4f9060=_0x3e79f9[_0xecff('0x2c')]['sessionId'];return getAgent(_0x339d3d)[_0xecff('0x1f')](function(_0x1ae9e3){logger[_0xecff('0x15')]('entityFound:',_0x1ae9e3[_0xecff('0x1b')]);emit(util['format'](_0xecff('0x36'),_0x1ae9e3['name']),'webbar:unhold',{'sessionId':_0x4f9060});return _0x188d08[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x3e')});})[_0xecff('0x23')](handleError(_0x188d08));};exports['calls']=function(_0x2d0ed7,_0x3bdf47){logger[_0xecff('0x15')](_0xecff('0x3f'),_0x3bdf47[_0xecff('0x2c')]);var _0x162938=callsValidation[_0xecff('0xe')](_0x2d0ed7[_0xecff('0x2c')]);if(_0x162938['length']>0x0){return _0x3bdf47[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x162938);}var _0x18ead4=_0x2d0ed7[_0xecff('0x2c')][_0xecff('0x2e')];var _0x12d549=respondWithRpcPromise(_0xecff('0x40'));var _0x33bcb1=getAgent(_0x18ead4);return Promise[_0xecff('0x41')]([_0x12d549,_0x33bcb1])[_0xecff('0x1f')](function(_0xa48ffb){var _0x10939a=_0xa48ffb[0x0];var _0x3f8e22=_0xa48ffb[0x1];var _0x88882b=_['filter'](_0x10939a['rows'],function(_0x13ec0f){return _0x13ec0f['UserId']==_0x3f8e22['id'];});return _0x3bdf47['status'](0xc8)[_0xecff('0x2d')]({'count':_0x88882b[_0xecff('0x28')],'rows':_0x88882b});})[_0xecff('0x23')](handleError(_0x3bdf47));};exports['conference']=function(_0x161190,_0x1eabd0){logger[_0xecff('0x15')]('conference\x20fired:',_0x161190[_0xecff('0x2c')]);var _0x56eefb=conferenceValidation['validate'](_0x161190[_0xecff('0x2c')]);if(_0x56eefb[_0xecff('0x28')]>0x0){return _0x1eabd0[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x56eefb);}var _0x303a=_0x161190[_0xecff('0x2c')][_0xecff('0x2e')];return getAgent(_0x303a)[_0xecff('0x1f')](function(_0x345ceb){logger[_0xecff('0x15')](_0xecff('0x30'),_0x345ceb[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x345ceb['name']),'webbar:conference');return _0x1eabd0[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0xecff('0x23')](handleError(_0x1eabd0));};exports[_0xecff('0x42')]=function(_0x59857d,_0x148c69){logger[_0xecff('0x15')](_0xecff('0x43'),_0x59857d[_0xecff('0x2c')]);var _0x20e8ab=transferValidation[_0xecff('0xe')](_0x59857d['body']);if(_0x20e8ab[_0xecff('0x28')]>0x0){return _0x148c69[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x20e8ab);}var _0x3c333c=_0x59857d[_0xecff('0x2c')]['userId'];var _0x31cd2d=_0x59857d[_0xecff('0x2c')][_0xecff('0x27')];var _0x3e54b8=_0x59857d['body']['transferNumber'];return getAgent(_0x3c333c)['then'](function(_0x3882cf){logger[_0xecff('0x15')](_0xecff('0x30'),_0x3882cf['name']);emit(util[_0xecff('0x31')]('user:%s',_0x3882cf[_0xecff('0x1b')]),_0xecff('0x44'),{'sessionId':_0x31cd2d,'transferNumber':_0x3e54b8});return _0x148c69[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'transfer\x20executed!'});})[_0xecff('0x23')](handleError(_0x148c69));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 83e62ef..3fc351f 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 _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x99993b,_0x3c295){var _0xb6a02f=function(_0x3abf69){while(--_0x3abf69){_0x99993b['push'](_0x99993b['shift']());}};_0xb6a02f(++_0x3c295);}(_0xda2d,0x102));var _0xdda2=function(_0x2ec719,_0x41ea61){_0x2ec719=_0x2ec719-0x0;var _0x3f8f64=_0xda2d[_0x2ec719];return _0x3f8f64;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file +var _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x3dbccb,_0x126d36){var _0x3e90e7=function(_0x43298f){while(--_0x43298f){_0x3dbccb['push'](_0x3dbccb['shift']());}};_0x3e90e7(++_0x126d36);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x36bb09,_0x4ca925){_0x36bb09=_0x36bb09-0x0;var _0x5799de=_0xc6ac[_0x36bb09];return _0x5799de;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 50061de..a346920 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 _0xd47c=['exports','name','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xd47c,0x1cd));var _0xcd47=function(_0x1ccb1a,_0x3e787e){_0x1ccb1a=_0x1ccb1a-0x0;var _0x8956da=_0xd47c[_0x1ccb1a];return _0x8956da;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xcd47('0x0'));module[_0xcd47('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcd47('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xcd47('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xcd47('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcd47('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xcd47('0x3')]},'type':{'type':Sequelize['ENUM']('twilio')},'accountSid':{'type':Sequelize[_0xcd47('0x3')]},'authToken':{'type':Sequelize[_0xcd47('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcd47('0x4')],'defaultValue':function(){return _0xcd47('0x5');}},'notificationSound':{'type':Sequelize[_0xcd47('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcd47('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcd47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd47('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcd47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd47('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcd47('0x8'),'set':function(_0x534d8a){if(!_0x534d8a){this[_0xcd47('0x9')]('mandatoryDispositionPauseId',null);}this[_0xcd47('0x9')](_0xcd47('0xa'),_0x534d8a);}},'description':{'type':Sequelize[_0xcd47('0x3')]}}; \ No newline at end of file +var _0x367a=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','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'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x367a,0x74));var _0xa367=function(_0x4e39b2,_0x59fc8d){_0x4e39b2=_0x4e39b2-0x0;var _0x426c75=_0x367a[_0x4e39b2];return _0x426c75;};'use strict';var Sequelize=require(_0xa367('0x0'));var rs=require(_0xa367('0x1'));module[_0xa367('0x2')]={'name':{'type':Sequelize[_0xa367('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa367('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa367('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa367('0x4')]();}},'phone':{'type':Sequelize[_0xa367('0x3')]},'type':{'type':Sequelize[_0xa367('0x5')](_0xa367('0x6'))},'accountSid':{'type':Sequelize[_0xa367('0x3')]},'authToken':{'type':Sequelize[_0xa367('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa367('0x7')],'defaultValue':function(){return _0xa367('0x8');}},'notificationSound':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa367('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa367('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa367('0xa')],'comment':_0xa367('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![],'comment':_0xa367('0xc'),'set':function(_0x4d8517){if(!_0x4d8517){this[_0xa367('0xd')](_0xa367('0xe'),null);}this[_0xa367('0xd')](_0xa367('0xf'),_0x4d8517);}},'description':{'type':Sequelize[_0xa367('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 8c6cf63..a0f4542 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 _0xae63=['show','params','Pause','includeAll','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','destroy','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','order','filter','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','pick','removeAnswers','addAgents','ids','omit','spread','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','emit','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','type','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','defaults','contact','WhatsappInteraction','created','autoclose','push','close','unmanaged','*,*,*,*','interaction','WhatsappMessage','ContactId','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','twilio','Content-Type','text/xml','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','client','http','request','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','options','WhatsappAccount','findAll','rows'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0xae63,0x1e7));var _0x3ae6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae63[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ae6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3ae6('0x1'));var moment=require(_0x3ae6('0x2'));var BPromise=require(_0x3ae6('0x3'));var Mustache=require('mustache');var util=require(_0x3ae6('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x3ae6('0x5'));var ejs=require(_0x3ae6('0x6'));var fs=require('fs');var fs_extra=require(_0x3ae6('0x7'));var _=require(_0x3ae6('0x8'));var squel=require(_0x3ae6('0x9'));var crypto=require(_0x3ae6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3ae6('0xb'));var toCsv=require(_0x3ae6('0x5'));var querystring=require('querystring');var Papa=require(_0x3ae6('0xc'));var Redis=require(_0x3ae6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3ae6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ae6('0xf'));var logger=require(_0x3ae6('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x3ae6('0x11'));var licenseUtil=require(_0x3ae6('0x12'));var db=require(_0x3ae6('0x13'))['db'];config[_0x3ae6('0x14')]=_['defaults'](config[_0x3ae6('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ae6('0x15'))(new Redis(config[_0x3ae6('0x14')]));require(_0x3ae6('0x16'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3ae6('0x17')][_0x3ae6('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x3df67c,_0x128d20,_0x4399b5,_0x201597){return new BPromise(function(_0x1d6e27,_0x119706){var _0x4dfa51=_0x201597||client;return _0x4dfa51[_0x3ae6('0x19')](_0x3df67c,_0x4399b5)['then'](function(_0x9b982e){logger['info'](_0x3ae6('0x1a'),_0x128d20,'request\x20sent');logger[_0x3ae6('0x1b')](_0x3ae6('0x1c'),_0x128d20,_0x3ae6('0x1d'),JSON[_0x3ae6('0x1e')](_0x9b982e));if(_0x9b982e['error']){if(_0x9b982e['error'][_0x3ae6('0x1f')]===0x1f4){logger[_0x3ae6('0x20')](_0x3ae6('0x1a'),_0x128d20,_0x9b982e['error'][_0x3ae6('0x21')]);return _0x119706(_0x9b982e[_0x3ae6('0x20')]['message']);}logger[_0x3ae6('0x20')](_0x3ae6('0x1a'),_0x128d20,_0x9b982e['error'][_0x3ae6('0x21')]);return _0x1d6e27(_0x9b982e['error'][_0x3ae6('0x21')]);}else{logger[_0x3ae6('0x22')](_0x3ae6('0x1a'),_0x128d20,_0x3ae6('0x1d'));_0x1d6e27(_0x9b982e['result']['message']);}})[_0x3ae6('0x23')](function(_0x373376){logger['error'](_0x3ae6('0x1a'),_0x128d20,_0x373376);_0x119706(_0x373376);});});}function respondWithStatusCode(_0x2f2778,_0x780bb8){_0x780bb8=_0x780bb8||0xcc;return function(_0x40777c){if(_0x40777c){return _0x2f2778['sendStatus'](_0x780bb8);}return _0x2f2778['status'](_0x780bb8)[_0x3ae6('0x24')]();};}function respondWithResult(_0xcd3a4a,_0x197be0){_0x197be0=_0x197be0||0xc8;return function(_0x5c3094){if(_0x5c3094){return _0xcd3a4a[_0x3ae6('0x25')](_0x197be0)[_0x3ae6('0x26')](_0x5c3094);}};}function respondWithFilteredResult(_0x5892d7,_0x3e48a4){return function(_0x2f7466){if(_0x2f7466){var _0x256a7f=typeof _0x3e48a4[_0x3ae6('0x27')]===_0x3ae6('0x28')&&typeof _0x3e48a4[_0x3ae6('0x29')]===_0x3ae6('0x28');var _0x3a23dd=_0x2f7466[_0x3ae6('0x2a')];var _0x211adf=_0x256a7f?0x0:_0x3e48a4[_0x3ae6('0x27')];var _0x26f709=_0x256a7f?_0x2f7466[_0x3ae6('0x2a')]:_0x3e48a4[_0x3ae6('0x27')]+_0x3e48a4['limit'];var _0x500d26;if(_0x26f709>=_0x3a23dd){_0x26f709=_0x3a23dd;_0x500d26=0xc8;}else{_0x500d26=0xce;}_0x5892d7['status'](_0x500d26);return _0x5892d7[_0x3ae6('0x2b')](_0x3ae6('0x2c'),_0x211adf+'-'+_0x26f709+'/'+_0x3a23dd)['json'](_0x2f7466);}return null;};}function patchUpdates(_0x4dfa87){return function(_0x4cdcce){try{jsonpatch[_0x3ae6('0x2d')](_0x4cdcce,_0x4dfa87,!![]);}catch(_0x1b9cb4){return BPromise[_0x3ae6('0x2e')](_0x1b9cb4);}return _0x4cdcce[_0x3ae6('0x2f')]();};}function saveUpdates(_0x104312,_0x5cea44){return function(_0x18fe07){if(_0x18fe07){return _0x18fe07['update'](_0x104312)[_0x3ae6('0x30')](function(_0x1ce9c2){return _0x1ce9c2;});}return null;};}function removeEntity(_0x4d5a7f,_0x90fa3d){return function(_0x373b58){if(_0x373b58){return _0x373b58['destroy']()[_0x3ae6('0x30')](function(){var _0x131b9b=_0x373b58[_0x3ae6('0x31')]({'plain':!![]});var _0x5e65cd=_0x3ae6('0x32');return db[_0x3ae6('0x33')]['destroy']({'where':{'type':_0x5e65cd,'resourceId':_0x131b9b['id']}})[_0x3ae6('0x30')](function(){return _0x373b58;});})[_0x3ae6('0x30')](function(){_0x4d5a7f[_0x3ae6('0x25')](0xcc)[_0x3ae6('0x24')]();});}};}function handleEntityNotFound(_0x1e8d7,_0x2d7291){return function(_0x2b237f){if(!_0x2b237f){_0x1e8d7['sendStatus'](0x194);}return _0x2b237f;};}function handleError(_0x41ec51,_0x28e10f){_0x28e10f=_0x28e10f||0x1f4;return function(_0x34c873){logger['error'](_0x34c873[_0x3ae6('0x34')]);if(_0x34c873[_0x3ae6('0x35')]){delete _0x34c873[_0x3ae6('0x35')];}_0x41ec51[_0x3ae6('0x25')](_0x28e10f)[_0x3ae6('0x36')](_0x34c873);};}exports[_0x3ae6('0x37')]=function(_0x4e7e33,_0x1b0758){var _0x43848b={'include':[{'model':db['Pause'],'as':_0x3ae6('0x38')}]},_0xc2cccb={},_0x15c2bd={'count':0x0,'rows':[]};var _0x2b089d=_[_0x3ae6('0x39')](db['WhatsappAccount'][_0x3ae6('0x3a')],function(_0x16a1ab){return{'name':_0x16a1ab['fieldName'],'type':_0x16a1ab['type'][_0x3ae6('0x3b')]};});_0xc2cccb['model']=_['map'](_0x2b089d,'name');_0xc2cccb['query']=_[_0x3ae6('0x3c')](_0x4e7e33[_0x3ae6('0x3d')]);_0xc2cccb[_0x3ae6('0x3e')]=_[_0x3ae6('0x3f')](_0xc2cccb[_0x3ae6('0x40')],_0xc2cccb['query']);_0x43848b[_0x3ae6('0x41')]=_[_0x3ae6('0x3f')](_0xc2cccb[_0x3ae6('0x40')],qs[_0x3ae6('0x42')](_0x4e7e33['query'][_0x3ae6('0x42')]));_0x43848b[_0x3ae6('0x41')]=_0x43848b[_0x3ae6('0x41')][_0x3ae6('0x43')]?_0x43848b[_0x3ae6('0x41')]:_0xc2cccb[_0x3ae6('0x40')];if(!_0x4e7e33['query'][_0x3ae6('0x44')](_0x3ae6('0x45'))){_0x43848b[_0x3ae6('0x29')]=qs[_0x3ae6('0x29')](_0x4e7e33['query'][_0x3ae6('0x29')]);_0x43848b['offset']=qs['offset'](_0x4e7e33['query'][_0x3ae6('0x27')]);}_0x43848b['order']=qs['sort'](_0x4e7e33[_0x3ae6('0x3d')][_0x3ae6('0x46')]);_0x43848b[_0x3ae6('0x47')]=qs[_0x3ae6('0x3e')](_['pick'](_0x4e7e33['query'],_0xc2cccb['filters']),_0x2b089d);if(_0x4e7e33[_0x3ae6('0x3d')]['filter']){_0x43848b['where']=_[_0x3ae6('0x48')](_0x43848b[_0x3ae6('0x47')],{'$or':_[_0x3ae6('0x39')](_0x2b089d,function(_0x556e1f){if(_0x556e1f['type']!=='VIRTUAL'){var _0xf48df2={};_0xf48df2[_0x556e1f[_0x3ae6('0x35')]]={'$like':'%'+_0x4e7e33[_0x3ae6('0x3d')]['filter']+'%'};return _0xf48df2;}})});}_0x43848b=_[_0x3ae6('0x48')]({},_0x43848b,_0x4e7e33[_0x3ae6('0x49')]);var _0x4ad868={'where':_0x43848b['where']};return db['WhatsappAccount']['count'](_0x4ad868)['then'](function(_0x241809){_0x15c2bd[_0x3ae6('0x2a')]=_0x241809;if(_0x4e7e33[_0x3ae6('0x3d')]['includeAll']){_0x43848b['include']=[{'all':!![]}];}return db[_0x3ae6('0x4a')][_0x3ae6('0x4b')](_0x43848b);})[_0x3ae6('0x30')](function(_0x2e5c03){_0x15c2bd[_0x3ae6('0x4c')]=_0x2e5c03;return _0x15c2bd;})[_0x3ae6('0x30')](respondWithFilteredResult(_0x1b0758,_0x43848b))['catch'](handleError(_0x1b0758,null));};exports[_0x3ae6('0x4d')]=function(_0x2b152f,_0x1f6725){var _0x3396f6={'raw':![],'where':{'id':_0x2b152f[_0x3ae6('0x4e')]['id']},'include':[{'model':db[_0x3ae6('0x4f')],'as':_0x3ae6('0x38')}]},_0x104935={};_0x104935[_0x3ae6('0x40')]=_[_0x3ae6('0x3c')](db[_0x3ae6('0x4a')]['rawAttributes']);_0x104935[_0x3ae6('0x3d')]=_['keys'](_0x2b152f['query']);_0x104935[_0x3ae6('0x3e')]=_[_0x3ae6('0x3f')](_0x104935[_0x3ae6('0x40')],_0x104935[_0x3ae6('0x3d')]);_0x3396f6[_0x3ae6('0x41')]=_[_0x3ae6('0x3f')](_0x104935['model'],qs[_0x3ae6('0x42')](_0x2b152f[_0x3ae6('0x3d')][_0x3ae6('0x42')]));_0x3396f6[_0x3ae6('0x41')]=_0x3396f6[_0x3ae6('0x41')][_0x3ae6('0x43')]?_0x3396f6['attributes']:_0x104935['model'];if(_0x2b152f[_0x3ae6('0x3d')][_0x3ae6('0x50')]){_0x3396f6[_0x3ae6('0x51')]=[{'all':!![]}];}_0x3396f6=_['merge']({},_0x3396f6,_0x2b152f[_0x3ae6('0x49')]);return db[_0x3ae6('0x4a')][_0x3ae6('0x52')](_0x3396f6)[_0x3ae6('0x30')](handleEntityNotFound(_0x1f6725,null))['then'](respondWithResult(_0x1f6725,null))[_0x3ae6('0x23')](handleError(_0x1f6725,null));};exports[_0x3ae6('0x53')]=function(_0x2e213a,_0x1e7546){return db[_0x3ae6('0x4a')][_0x3ae6('0x53')](_0x2e213a[_0x3ae6('0x54')],{})[_0x3ae6('0x30')](function(_0x399304){var _0x1d1107=_0x2e213a[_0x3ae6('0x55')][_0x3ae6('0x31')]({'plain':!![]});if(!_0x1d1107)throw new Error(_0x3ae6('0x56'));if(_0x1d1107[_0x3ae6('0x57')]==='user'){var _0x1970aa=_0x399304[_0x3ae6('0x31')]({'plain':!![]});var _0x21d4b2='WhatsappAccounts';return db[_0x3ae6('0x58')][_0x3ae6('0x52')]({'where':{'name':_0x21d4b2,'userProfileId':_0x1d1107[_0x3ae6('0x59')]},'raw':!![]})[_0x3ae6('0x30')](function(_0x1705d1){if(_0x1705d1&&_0x1705d1[_0x3ae6('0x5a')]===0x0){return db[_0x3ae6('0x33')]['create']({'name':_0x1970aa['name'],'resourceId':_0x1970aa['id'],'type':_0x1705d1['name'],'sectionId':_0x1705d1['id']},{})['then'](function(){return _0x399304;});}else{return _0x399304;}})[_0x3ae6('0x23')](function(_0x2389f8){logger[_0x3ae6('0x20')](_0x3ae6('0x5b'),_0x2389f8);throw _0x2389f8;});}return _0x399304;})[_0x3ae6('0x30')](respondWithResult(_0x1e7546,0xc9))[_0x3ae6('0x23')](handleError(_0x1e7546,null));};exports[_0x3ae6('0x5c')]=function(_0xce5f2c,_0x3335a2){if(_0xce5f2c[_0x3ae6('0x54')]['id']){delete _0xce5f2c[_0x3ae6('0x54')]['id'];}return db[_0x3ae6('0x4a')][_0x3ae6('0x52')]({'where':{'id':_0xce5f2c[_0x3ae6('0x4e')]['id']},'include':[{'model':db[_0x3ae6('0x4f')],'as':_0x3ae6('0x38')}]})[_0x3ae6('0x30')](handleEntityNotFound(_0x3335a2,null))[_0x3ae6('0x30')](saveUpdates(_0xce5f2c[_0x3ae6('0x54')],null))[_0x3ae6('0x30')](respondWithResult(_0x3335a2,null))['catch'](handleError(_0x3335a2,null));};exports[_0x3ae6('0x5d')]=function(_0x375dea,_0x16e80b){return db['WhatsappAccount'][_0x3ae6('0x52')]({'where':{'id':_0x375dea[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x16e80b,null))[_0x3ae6('0x30')](removeEntity(_0x16e80b,null))[_0x3ae6('0x23')](handleError(_0x16e80b,null));};exports[_0x3ae6('0x5e')]=function(_0x41d82e,_0x431aba){return db[_0x3ae6('0x4a')][_0x3ae6('0x5e')]()[_0x3ae6('0x30')](respondWithResult(_0x431aba,null))[_0x3ae6('0x23')](handleError(_0x431aba,null));};exports[_0x3ae6('0x5f')]=function(_0x5af5f8,_0x19d226,_0x375e85){if(_0x5af5f8[_0x3ae6('0x54')]['id']){delete _0x5af5f8[_0x3ae6('0x54')]['id'];}return db['WhatsappAccount'][_0x3ae6('0x52')]({'where':{'id':_0x5af5f8[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x19d226,null))[_0x3ae6('0x30')](function(_0x271b86){if(_0x271b86){_0x5af5f8[_0x3ae6('0x54')][_0x3ae6('0x60')]=_0x271b86['id'];return db[_0x3ae6('0x61')][_0x3ae6('0x53')](_0x5af5f8['body']);}})[_0x3ae6('0x30')](respondWithResult(_0x19d226,null))[_0x3ae6('0x23')](handleError(_0x19d226,null));};exports[_0x3ae6('0x62')]=function(_0xc66906,_0x3d0490,_0x430fa7){var _0x3f495b={'raw':![],'where':{}};var _0x12b973={};var _0x8f31f0={'count':0x0,'rows':[]};return db[_0x3ae6('0x4a')]['findOne']({'where':{'id':_0xc66906[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x3d0490,null))[_0x3ae6('0x30')](function(_0x1a5c71){if(_0x1a5c71){_0x12b973['model']=_[_0x3ae6('0x3c')](db[_0x3ae6('0x61')][_0x3ae6('0x3a')]);_0x12b973[_0x3ae6('0x3d')]=_[_0x3ae6('0x3c')](_0xc66906[_0x3ae6('0x3d')]);_0x12b973[_0x3ae6('0x3e')]=_[_0x3ae6('0x3f')](_0x12b973['model'],_0x12b973[_0x3ae6('0x3d')]);_0x3f495b[_0x3ae6('0x41')]=_['intersection'](_0x12b973[_0x3ae6('0x40')],qs[_0x3ae6('0x42')](_0xc66906['query'][_0x3ae6('0x42')]));_0x3f495b[_0x3ae6('0x41')]=_0x3f495b[_0x3ae6('0x41')][_0x3ae6('0x43')]?_0x3f495b[_0x3ae6('0x41')]:_0x12b973['model'];if(!_0xc66906['query'][_0x3ae6('0x44')](_0x3ae6('0x45'))){_0x3f495b[_0x3ae6('0x29')]=qs[_0x3ae6('0x29')](_0xc66906['query']['limit']);_0x3f495b['offset']=qs['offset'](_0xc66906['query'][_0x3ae6('0x27')]);}_0x3f495b[_0x3ae6('0x63')]=qs['sort'](_0xc66906['query'][_0x3ae6('0x46')]);_0x3f495b[_0x3ae6('0x47')]=qs[_0x3ae6('0x3e')](_['pick'](_0xc66906[_0x3ae6('0x3d')],_0x12b973[_0x3ae6('0x3e')]));_0x3f495b[_0x3ae6('0x47')][_0x3ae6('0x60')]=_0x1a5c71['id'];if(_0xc66906[_0x3ae6('0x3d')][_0x3ae6('0x64')]){_0x3f495b[_0x3ae6('0x47')]=_[_0x3ae6('0x48')](_0x3f495b[_0x3ae6('0x47')],{'$or':_[_0x3ae6('0x39')](_0x3f495b[_0x3ae6('0x41')],function(_0x2e9ac8){var _0x54aee9={};_0x54aee9[_0x2e9ac8]={'$like':'%'+_0xc66906[_0x3ae6('0x3d')][_0x3ae6('0x64')]+'%'};return _0x54aee9;})});}_0x3f495b=_[_0x3ae6('0x48')]({},_0x3f495b,_0xc66906[_0x3ae6('0x49')]);return db['Disposition'][_0x3ae6('0x2a')]({'where':_0x3f495b[_0x3ae6('0x47')]})[_0x3ae6('0x30')](function(_0xe3ac18){_0x8f31f0[_0x3ae6('0x2a')]=_0xe3ac18;if(_0xc66906[_0x3ae6('0x3d')][_0x3ae6('0x50')]){_0x3f495b[_0x3ae6('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x3ae6('0x4b')](_0x3f495b);})[_0x3ae6('0x30')](function(_0x681249){_0x8f31f0[_0x3ae6('0x4c')]=_0x681249;return _0x8f31f0;});}})[_0x3ae6('0x30')](respondWithFilteredResult(_0x3d0490,_0x3f495b))[_0x3ae6('0x23')](handleError(_0x3d0490,null));};exports[_0x3ae6('0x65')]=function(_0x446335,_0x1bb663,_0x8b7c3a){return db[_0x3ae6('0x4a')]['find']({'where':{'id':_0x446335[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x1bb663,null))[_0x3ae6('0x30')](function(_0x140d54){if(_0x140d54){return _0x140d54['removeDispositions'](_0x446335['query']['ids']);}})[_0x3ae6('0x30')](respondWithStatusCode(_0x1bb663,null))[_0x3ae6('0x23')](handleError(_0x1bb663,null));};exports[_0x3ae6('0x66')]=function(_0x28b075,_0x1ab7d8,_0x3d821a){if(_0x28b075[_0x3ae6('0x54')]['id']){delete _0x28b075[_0x3ae6('0x54')]['id'];}return db[_0x3ae6('0x4a')][_0x3ae6('0x52')]({'where':{'id':_0x28b075[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x1ab7d8,null))[_0x3ae6('0x30')](function(_0x54fbdd){if(_0x54fbdd){_0x28b075[_0x3ae6('0x54')][_0x3ae6('0x60')]=_0x54fbdd['id'];return db['CannedAnswer'][_0x3ae6('0x53')](_0x28b075[_0x3ae6('0x54')]);}})[_0x3ae6('0x30')](respondWithResult(_0x1ab7d8,null))['catch'](handleError(_0x1ab7d8,null));};exports[_0x3ae6('0x67')]=function(_0x5142b5,_0x336730,_0x48bbd3){var _0x1d30ad={'raw':![],'where':{}};var _0x52e35d={};var _0x195dda={'count':0x0,'rows':[]};return db[_0x3ae6('0x4a')][_0x3ae6('0x68')]({'where':{'id':_0x5142b5[_0x3ae6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x336730,null))[_0x3ae6('0x30')](function(_0x4d5f2f){if(_0x4d5f2f){_0x52e35d[_0x3ae6('0x40')]=_[_0x3ae6('0x3c')](db[_0x3ae6('0x69')][_0x3ae6('0x3a')]);_0x52e35d[_0x3ae6('0x3d')]=_[_0x3ae6('0x3c')](_0x5142b5[_0x3ae6('0x3d')]);_0x52e35d[_0x3ae6('0x3e')]=_['intersection'](_0x52e35d[_0x3ae6('0x40')],_0x52e35d['query']);_0x1d30ad[_0x3ae6('0x41')]=_[_0x3ae6('0x3f')](_0x52e35d['model'],qs[_0x3ae6('0x42')](_0x5142b5[_0x3ae6('0x3d')][_0x3ae6('0x42')]));_0x1d30ad[_0x3ae6('0x41')]=_0x1d30ad['attributes'][_0x3ae6('0x43')]?_0x1d30ad[_0x3ae6('0x41')]:_0x52e35d[_0x3ae6('0x40')];if(!_0x5142b5['query'][_0x3ae6('0x44')](_0x3ae6('0x45'))){_0x1d30ad['limit']=qs[_0x3ae6('0x29')](_0x5142b5[_0x3ae6('0x3d')][_0x3ae6('0x29')]);_0x1d30ad[_0x3ae6('0x27')]=qs[_0x3ae6('0x27')](_0x5142b5['query'][_0x3ae6('0x27')]);}_0x1d30ad['order']=qs[_0x3ae6('0x46')](_0x5142b5['query'][_0x3ae6('0x46')]);_0x1d30ad[_0x3ae6('0x47')]=qs[_0x3ae6('0x3e')](_[_0x3ae6('0x6a')](_0x5142b5[_0x3ae6('0x3d')],_0x52e35d['filters']));_0x1d30ad[_0x3ae6('0x47')][_0x3ae6('0x60')]=_0x4d5f2f['id'];if(_0x5142b5[_0x3ae6('0x3d')]['filter']){_0x1d30ad[_0x3ae6('0x47')]=_[_0x3ae6('0x48')](_0x1d30ad['where'],{'$or':_[_0x3ae6('0x39')](_0x1d30ad['attributes'],function(_0x46e7ef){var _0x3e285c={};_0x3e285c[_0x46e7ef]={'$like':'%'+_0x5142b5[_0x3ae6('0x3d')][_0x3ae6('0x64')]+'%'};return _0x3e285c;})});}_0x1d30ad=_[_0x3ae6('0x48')]({},_0x1d30ad,_0x5142b5[_0x3ae6('0x49')]);return db['CannedAnswer'][_0x3ae6('0x2a')]({'where':_0x1d30ad[_0x3ae6('0x47')]})['then'](function(_0x20d096){_0x195dda['count']=_0x20d096;if(_0x5142b5[_0x3ae6('0x3d')][_0x3ae6('0x50')]){_0x1d30ad['include']=[{'all':!![]}];}return db[_0x3ae6('0x69')][_0x3ae6('0x4b')](_0x1d30ad);})[_0x3ae6('0x30')](function(_0x3fa2bd){_0x195dda[_0x3ae6('0x4c')]=_0x3fa2bd;return _0x195dda;});}})['then'](respondWithFilteredResult(_0x336730,_0x1d30ad))[_0x3ae6('0x23')](handleError(_0x336730,null));};exports[_0x3ae6('0x6b')]=function(_0x519920,_0x4ae032,_0x245c21){return db[_0x3ae6('0x4a')][_0x3ae6('0x52')]({'where':{'id':_0x519920[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x4ae032,null))[_0x3ae6('0x30')](function(_0x73f076){if(_0x73f076){return _0x73f076[_0x3ae6('0x6b')](_0x519920[_0x3ae6('0x3d')]['ids']);}})[_0x3ae6('0x30')](respondWithStatusCode(_0x4ae032,null))['catch'](handleError(_0x4ae032,null));};exports[_0x3ae6('0x6c')]=function(_0x50ab61,_0x145639,_0x2bf262){return db[_0x3ae6('0x4a')][_0x3ae6('0x52')]({'where':{'id':_0x50ab61[_0x3ae6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x145639,null))['then'](function(_0x1df4cc){if(_0x1df4cc){return _0x1df4cc[_0x3ae6('0x6c')](_0x50ab61[_0x3ae6('0x54')][_0x3ae6('0x6d')],_[_0x3ae6('0x6e')](_0x50ab61[_0x3ae6('0x54')],['ids','id'])||{})[_0x3ae6('0x6f')](function(_0xafd08f){for(var _0x4692eb=0x0;_0x4692eb<_0x50ab61[_0x3ae6('0x54')]['ids'][_0x3ae6('0x43')];_0x4692eb+=0x1){socket['emit'](_0x3ae6('0x70'),{'UserId':Number(_0x50ab61['body'][_0x3ae6('0x6d')][_0x4692eb]),'WhatsappAccountId':Number(_0x50ab61[_0x3ae6('0x4e')]['id'])});}return _0xafd08f;});}})[_0x3ae6('0x30')](respondWithResult(_0x145639,null))['catch'](handleError(_0x145639,null));};exports[_0x3ae6('0x71')]=function(_0xc6a2d1,_0x2e918b,_0x34e014){return db['WhatsappAccount']['find']({'where':{'id':_0xc6a2d1[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x2e918b,null))[_0x3ae6('0x30')](function(_0x4582fa){if(_0x4582fa){return _0x4582fa[_0x3ae6('0x71')](_0xc6a2d1[_0x3ae6('0x3d')][_0x3ae6('0x6d')])['then'](function(){if(_[_0x3ae6('0x72')](_0xc6a2d1[_0x3ae6('0x3d')]['ids'])){for(var _0x46a62e=0x0;_0x46a62e<_0xc6a2d1[_0x3ae6('0x3d')]['ids']['length'];_0x46a62e+=0x1){socket['emit'](_0x3ae6('0x73'),{'UserId':Number(_0xc6a2d1[_0x3ae6('0x3d')][_0x3ae6('0x6d')][_0x46a62e]),'WhatsappAccountId':Number(_0xc6a2d1['params']['id'])});}}else{socket[_0x3ae6('0x74')](_0x3ae6('0x73'),{'UserId':Number(_0xc6a2d1[_0x3ae6('0x3d')][_0x3ae6('0x6d')]),'WhatsappAccountId':Number(_0xc6a2d1[_0x3ae6('0x4e')]['id'])});}});}})[_0x3ae6('0x30')](respondWithStatusCode(_0x2e918b,null))['catch'](handleError(_0x2e918b,null));};exports[_0x3ae6('0x75')]=function(_0x5dc5c0,_0x147ad9,_0x222191){var _0x146bb7={};var _0x72d84b={};var _0x149b9e;var _0x1731de;return db[_0x3ae6('0x4a')][_0x3ae6('0x68')]({'where':{'id':_0x5dc5c0[_0x3ae6('0x4e')]['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x147ad9,null))[_0x3ae6('0x30')](function(_0x4ace4d){if(_0x4ace4d){_0x149b9e=_0x4ace4d;_0x72d84b['model']=_[_0x3ae6('0x3c')](db['User'][_0x3ae6('0x3a')]);_0x72d84b[_0x3ae6('0x3d')]=_[_0x3ae6('0x3c')](_0x5dc5c0[_0x3ae6('0x3d')]);_0x72d84b[_0x3ae6('0x3e')]=_['intersection'](_0x72d84b[_0x3ae6('0x40')],_0x72d84b['query']);_0x146bb7[_0x3ae6('0x41')]=_['intersection'](_0x72d84b['model'],qs['fields'](_0x5dc5c0[_0x3ae6('0x3d')]['fields']));_0x146bb7[_0x3ae6('0x41')]=_0x146bb7[_0x3ae6('0x41')][_0x3ae6('0x43')]?_0x146bb7[_0x3ae6('0x41')]:_0x72d84b['model'];_0x146bb7[_0x3ae6('0x63')]=qs[_0x3ae6('0x46')](_0x5dc5c0['query'][_0x3ae6('0x46')]);_0x146bb7['where']=qs['filters'](_[_0x3ae6('0x6a')](_0x5dc5c0[_0x3ae6('0x3d')],_0x72d84b[_0x3ae6('0x3e')]));if(_0x5dc5c0['query'][_0x3ae6('0x64')]){_0x146bb7[_0x3ae6('0x47')]=_[_0x3ae6('0x48')](_0x146bb7['where'],{'$or':_[_0x3ae6('0x39')](_0x146bb7[_0x3ae6('0x41')],function(_0x353e6b){var _0x259874={};_0x259874[_0x353e6b]={'$like':'%'+_0x5dc5c0[_0x3ae6('0x3d')][_0x3ae6('0x64')]+'%'};return _0x259874;})});}_0x146bb7=_['merge']({},_0x146bb7,_0x5dc5c0[_0x3ae6('0x49')]);return _0x149b9e[_0x3ae6('0x75')](_0x146bb7);}})[_0x3ae6('0x30')](function(_0x3f5d59){if(_0x3f5d59){_0x1731de=_0x3f5d59['length'];if(!_0x5dc5c0[_0x3ae6('0x3d')]['hasOwnProperty'](_0x3ae6('0x45'))){_0x146bb7[_0x3ae6('0x29')]=qs[_0x3ae6('0x29')](_0x5dc5c0[_0x3ae6('0x3d')][_0x3ae6('0x29')]);_0x146bb7[_0x3ae6('0x27')]=qs[_0x3ae6('0x27')](_0x5dc5c0[_0x3ae6('0x3d')][_0x3ae6('0x27')]);}return _0x149b9e[_0x3ae6('0x75')](_0x146bb7);}})[_0x3ae6('0x30')](function(_0x50b0b7){if(_0x50b0b7){return _0x50b0b7?{'count':_0x1731de,'rows':_0x50b0b7}:null;}})[_0x3ae6('0x30')](respondWithResult(_0x147ad9,null))[_0x3ae6('0x23')](handleError(_0x147ad9,null));};exports[_0x3ae6('0x76')]=function(_0x5ad804,_0x2a391f,_0x176346){return db[_0x3ae6('0x4a')][_0x3ae6('0x68')]({'where':{'id':_0x5ad804['params']['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x2a391f,null))[_0x3ae6('0x30')](function(_0x346d5b){if(_0x346d5b){return db[_0x3ae6('0x77')][_0x3ae6('0x78')](function(_0xb07aa7){return db[_0x3ae6('0x79')]['destroy']({'where':{'WhatsappAccountId':_0x5ad804[_0x3ae6('0x4e')]['id']},'transaction':_0xb07aa7})[_0x3ae6('0x30')](function(_0x2a86bd){var _0x2587a9=_[_0x3ae6('0x39')](_0x5ad804[_0x3ae6('0x54')],function(_0x84e080){_0x84e080['WhatsappAccountId']=_0x5ad804[_0x3ae6('0x4e')]['id'];return _0x84e080;});return db[_0x3ae6('0x79')][_0x3ae6('0x7a')](_0x2587a9,{'transaction':_0xb07aa7});});})[_0x3ae6('0x30')](function(){return db['WhatsappApplication'][_0x3ae6('0x7b')]({'where':{'WhatsappAccountId':_0x5ad804[_0x3ae6('0x4e')]['id']},'order':_0x3ae6('0x7c')});});}})['then'](respondWithResult(_0x2a391f,null))[_0x3ae6('0x23')](handleError(_0x2a391f,null));};exports[_0x3ae6('0x7d')]=function(_0x378490,_0x3c1526,_0x16b65c){var _0x2a3ee8={};var _0x4fd5f8={};var _0x1ec003;var _0x553b18;return db[_0x3ae6('0x4a')][_0x3ae6('0x68')]({'where':{'id':_0x378490['params']['id']}})[_0x3ae6('0x30')](handleEntityNotFound(_0x3c1526,null))['then'](function(_0x55378f){if(_0x55378f){_0x1ec003=_0x55378f;_0x4fd5f8[_0x3ae6('0x40')]=_[_0x3ae6('0x3c')](db[_0x3ae6('0x79')][_0x3ae6('0x3a')]);_0x4fd5f8['query']=_[_0x3ae6('0x3c')](_0x378490['query']);_0x4fd5f8[_0x3ae6('0x3e')]=_[_0x3ae6('0x3f')](_0x4fd5f8['model'],_0x4fd5f8[_0x3ae6('0x3d')]);_0x2a3ee8[_0x3ae6('0x41')]=_['intersection'](_0x4fd5f8[_0x3ae6('0x40')],qs['fields'](_0x378490[_0x3ae6('0x3d')][_0x3ae6('0x42')]));_0x2a3ee8['attributes']=_0x2a3ee8[_0x3ae6('0x41')][_0x3ae6('0x43')]?_0x2a3ee8[_0x3ae6('0x41')]:_0x4fd5f8[_0x3ae6('0x40')];_0x2a3ee8[_0x3ae6('0x63')]=qs['sort'](_0x378490[_0x3ae6('0x3d')][_0x3ae6('0x46')]);_0x2a3ee8['where']=qs[_0x3ae6('0x3e')](_[_0x3ae6('0x6a')](_0x378490[_0x3ae6('0x3d')],_0x4fd5f8[_0x3ae6('0x3e')]));if(_0x378490['query'][_0x3ae6('0x64')]){_0x2a3ee8[_0x3ae6('0x47')]=_['merge'](_0x2a3ee8[_0x3ae6('0x47')],{'$or':_[_0x3ae6('0x39')](_0x2a3ee8[_0x3ae6('0x41')],function(_0x293dcf){var _0x1c26e0={};_0x1c26e0[_0x293dcf]={'$like':'%'+_0x378490[_0x3ae6('0x3d')][_0x3ae6('0x64')]+'%'};return _0x1c26e0;})});}_0x2a3ee8=_['merge']({},_0x2a3ee8,_0x378490[_0x3ae6('0x49')]);return _0x1ec003['getApplications'](_0x2a3ee8);}})[_0x3ae6('0x30')](function(_0x4c5b9b){if(_0x4c5b9b){_0x553b18=_0x4c5b9b[_0x3ae6('0x43')];if(!_0x378490['query']['hasOwnProperty'](_0x3ae6('0x45'))){_0x2a3ee8['limit']=qs['limit'](_0x378490['query'][_0x3ae6('0x29')]);_0x2a3ee8[_0x3ae6('0x27')]=qs[_0x3ae6('0x27')](_0x378490[_0x3ae6('0x3d')][_0x3ae6('0x27')]);}return _0x1ec003['getApplications'](_0x2a3ee8);}})[_0x3ae6('0x30')](function(_0x1a80c3){if(_0x1a80c3){return _0x1a80c3?{'count':_0x553b18,'rows':_0x1a80c3}:null;}})[_0x3ae6('0x30')](respondWithResult(_0x3c1526,null))[_0x3ae6('0x23')](handleError(_0x3c1526,null));};exports[_0x3ae6('0x7e')]=function(_0x49a059,_0x5cdcb4,_0x14e685){var _0x4b0b39={'channel':'whatsapp'};var _0x44263e=[];var _0x1cd3a6=[];var _0x2ea64d={};return db['WhatsappAccount'][_0x3ae6('0x52')]({'where':{'id':_0x49a059['params']['id']},'include':[{'model':db[_0x3ae6('0x79')],'as':_0x3ae6('0x7f')}]})[_0x3ae6('0x30')](handleEntityNotFound(_0x5cdcb4,null))[_0x3ae6('0x30')](function(_0x2c92ae){_0x4b0b39['account']=_0x2c92ae;_0x4b0b39['applications']=_[_0x3ae6('0x80')](_0x2c92ae['Applications'],[_0x3ae6('0x7c')],[_0x3ae6('0x81')]);if(_0x4b0b39['account'][_0x3ae6('0x7f')]){delete _0x4b0b39[_0x3ae6('0x82')][_0x3ae6('0x7f')];}return db[_0x3ae6('0x83')][_0x3ae6('0x5e')]();})[_0x3ae6('0x30')](function(_0x212dc5){if(!_0x212dc5){throw new db[(_0x3ae6('0x84'))][(_0x3ae6('0x85'))](_0x3ae6('0x86'));}_0x44263e=_['difference'](_[_0x3ae6('0x3c')](_0x212dc5),[_0x3ae6('0x87'),_0x3ae6('0x88')]);_0x1cd3a6=_[_0x3ae6('0x89')](_['keys'](_0x212dc5),['createdAt',_0x3ae6('0x88'),_0x3ae6('0x8a'),_0x3ae6('0x8b')]);_0x4b0b39[_0x3ae6('0x54')]={'mapKey':_0x3ae6('0x8c')};if(_0x4b0b39[_0x3ae6('0x82')][_0x3ae6('0x8d')]&&_0x4b0b39[_0x3ae6('0x82')][_0x3ae6('0x8d')]==='twilio'){_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x8e')]=_0x49a059[_0x3ae6('0x54')][_0x3ae6('0x8f')][_0x3ae6('0x90')](_0x3ae6('0x91'),'');_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x54')]=_0x49a059[_0x3ae6('0x54')][_0x3ae6('0x92')];_0x4b0b39['body'][_0x3ae6('0x93')]=_0x49a059[_0x3ae6('0x54')][_0x3ae6('0x94')];}if(_0x4b0b39[_0x3ae6('0x54')]['id']){delete _0x4b0b39['body']['id'];}if(_[_0x3ae6('0x95')](_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x8e')])){throw new db['Sequelize'][(_0x3ae6('0x85'))](_0x3ae6('0x96'));}if(_[_0x3ae6('0x95')](_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x54')])||_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x54')]===''){throw new db[(_0x3ae6('0x84'))][(_0x3ae6('0x85'))](_0x3ae6('0x97'));}if(_['isNil'](_0x4b0b39['body'][_0x3ae6('0x98')])){throw new db['Sequelize']['ValidationError'](_0x3ae6('0x99')+_0x1cd3a6);}if(!_[_0x3ae6('0x9a')](_0x1cd3a6,_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x98')])){throw new db[(_0x3ae6('0x84'))][(_0x3ae6('0x85'))](_0x3ae6('0x9b')+_0x1cd3a6);}_0x2ea64d[_0x4b0b39['body'][_0x3ae6('0x98')]]=_0x4b0b39[_0x3ae6('0x54')]['from'];return db['CmList'][_0x3ae6('0x52')]({'where':{'id':_0x4b0b39['account']['ListId']},'include':[{'model':db[_0x3ae6('0x83')],'as':_0x3ae6('0x9c'),'where':_0x2ea64d,'limit':0x1,'order':[[_0x3ae6('0x88'),_0x3ae6('0x9d')]]}]});})[_0x3ae6('0x30')](handleEntityNotFound(_0x5cdcb4,null))['then'](function(_0x351d30){if(_0x351d30){_0x4b0b39[_0x3ae6('0x9e')]=_['omit'](_0x351d30,['Contacts']);if(_0x351d30[_0x3ae6('0x9c')]['length']){return _0x351d30[_0x3ae6('0x9c')][0x0];}var _0x31f036=_[_0x3ae6('0x9f')](_0x4b0b39[_0x3ae6('0x54')],{'firstName':_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x8e')],'ListId':_0x351d30['id']});_0x31f036[_0x4b0b39['body'][_0x3ae6('0x98')]]=_0x4b0b39[_0x3ae6('0x54')]['from'];return db['CmContact']['create'](_0x31f036,{'fields':_0x44263e,'raw':!![]});}})[_0x3ae6('0x30')](handleEntityNotFound(_0x5cdcb4,null))[_0x3ae6('0x30')](function(_0x538ae2){if(_0x538ae2){_0x4b0b39[_0x3ae6('0xa0')]=_0x538ae2;var _0x374c2a={'ContactId':_0x538ae2['id'],'phone':_0x4b0b39[_0x3ae6('0x54')]['from'],'WhatsappAccountId':_0x49a059[_0x3ae6('0x4e')]['id']};var _0x55f8be={'ContactId':_0x538ae2['id'],'WhatsappAccountId':_0x49a059['params']['id'],'closed':![]};return db[_0x3ae6('0xa1')][_0x3ae6('0x52')]({'where':_0x55f8be})[_0x3ae6('0x30')](function(_0x55f303){if(_0x55f303){return[_0x55f303,![]];}return db['WhatsappInteraction'][_0x3ae6('0x53')](_0x374c2a)[_0x3ae6('0x30')](function(_0x82ae45){return[_0x82ae45,!![]];});});}})['spread'](function(_0x356d52,_0x73905){_0x4b0b39['interaction']=_0x356d52[_0x3ae6('0x31')]({'plain':!![]});_0x4b0b39['interaction'][_0x3ae6('0xa2')]=![];if(_0x73905){if(_0x4b0b39[_0x3ae6('0x82')][_0x3ae6('0xa3')]){_0x4b0b39['applications'][_0x3ae6('0xa4')]({'id':0x0,'priority':_0x4b0b39['applications']['length']+0x1,'app':_0x3ae6('0xa5'),'appdata':_0x3ae6('0xa6'),'interval':_0x3ae6('0xa7')});}_0x4b0b39[_0x3ae6('0xa8')][_0x3ae6('0xa2')]=!![];}return db[_0x3ae6('0xa9')]['create']({'phone':_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x8e')],'messageId':_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x93')],'body':_0x4b0b39[_0x3ae6('0x54')][_0x3ae6('0x54')],'WhatsappAccountId':_0x49a059[_0x3ae6('0x4e')]['id'],'WhatsappInteractionId':_0x356d52['id'],'direction':'in','ContactId':_0x356d52[_0x3ae6('0xaa')],'AttachmentId':_0x4b0b39['body'][_0x3ae6('0xab')]});})[_0x3ae6('0x30')](function(_0x47a814){_0x4b0b39[_0x3ae6('0x21')]=_0x47a814;if(_0x4b0b39['interaction']['UserId']){return db[_0x3ae6('0xac')][_0x3ae6('0x52')]({'attributes':['id','name'],'where':{'id':_0x4b0b39[_0x3ae6('0xa8')][_0x3ae6('0xad')]}})[_0x3ae6('0x30')](function(_0x59ee1e){if(_0x59ee1e){_0x4b0b39['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3ae6('0xae'),'appdata':_0x59ee1e[_0x3ae6('0x35')]+','+(_0x4b0b39['account'][_0x3ae6('0xaf')]||0xa),'interval':_0x3ae6('0xa7')});}return respondWithRpcPromise(_0x3ae6('0xb0'),'startRouting',_0x4b0b39);});}return respondWithRpcPromise(_0x3ae6('0xb0'),_0x3ae6('0xb1'),_0x4b0b39);})[_0x3ae6('0x30')](function(_0x2040b2){if(_0x2040b2){var _0x1e5eed=0xc8;var _0x4934b8='receiveMessage';logger[_0x3ae6('0x22')](_0x3ae6('0x1c'),_0x4934b8,_0x1e5eed,_0x3ae6('0xb2'));logger[_0x3ae6('0x1b')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4934b8,_0x1e5eed,'entity\x20found',JSON[_0x3ae6('0x1e')](_0x2040b2));if(_0x4b0b39['account'][_0x3ae6('0x8d')]===_0x3ae6('0xb3')){return _0x5cdcb4[_0x3ae6('0x25')](_0x1e5eed)[_0x3ae6('0x2b')](_0x3ae6('0xb4'),_0x3ae6('0xb5'))[_0x3ae6('0x36')]('\x0a');}else{return _0x5cdcb4[_0x3ae6('0x25')](_0x1e5eed)[_0x3ae6('0x26')](_0x2040b2);}}})[_0x3ae6('0x23')](handleError(_0x5cdcb4,null));};exports[_0x3ae6('0x36')]=function(_0x4d7d45,_0x200c1e,_0x4cea49){var _0x1ff357,_0x3ce1c1,_0x14bbf7;if(_[_0x3ae6('0x95')](_0x4d7d45['body'][_0x3ae6('0x54')])||_0x4d7d45[_0x3ae6('0x54')][_0x3ae6('0x54')]===''){throw new db[(_0x3ae6('0x84'))][(_0x3ae6('0x85'))](_0x3ae6('0x97'));}if(_['isNil'](_0x4d7d45[_0x3ae6('0x54')]['to'])){throw new db[(_0x3ae6('0x84'))][(_0x3ae6('0x85'))](_0x3ae6('0xb6'));}_0x1ff357=_0x4d7d45['body']['to'];return db[_0x3ae6('0x4a')][_0x3ae6('0x52')]({'where':{'id':_0x4d7d45[_0x3ae6('0x4e')]['id']},'include':[{'model':db[_0x3ae6('0xb7')],'as':_0x3ae6('0xb8'),'include':[{'model':db[_0x3ae6('0x83')],'as':_0x3ae6('0x9c'),'where':{'mobile':_0x1ff357},'limit':0x1,'order':[['updatedAt',_0x3ae6('0x9d')]]}]}]})[_0x3ae6('0x30')](handleEntityNotFound(_0x200c1e,null))[_0x3ae6('0x30')](function(_0x235275){if(_0x235275&&_0x235275[_0x3ae6('0xb8')]){_0x3ce1c1=_0x235275[_0x3ae6('0x31')]({'plain':!![]});if(_0x3ce1c1[_0x3ae6('0xb8')]&&_0x3ce1c1[_0x3ae6('0xb8')]['Contacts'][_0x3ae6('0x43')]){return _0x3ce1c1[_0x3ae6('0xb8')][_0x3ae6('0x9c')][0x0];}return db[_0x3ae6('0x83')]['create'](_[_0x3ae6('0x9f')](_0x4d7d45['body'],{'firstName':_0x1ff357,'mobile':_0x1ff357,'phone':_0x1ff357,'ListId':_0x3ce1c1[_0x3ae6('0x8b')]}));}})['then'](handleEntityNotFound(_0x200c1e,null))[_0x3ae6('0x30')](function(_0x3b9138){if(_0x3b9138){_0x14bbf7=_0x3b9138;return db[_0x3ae6('0xa1')]['find']({'where':{'ContactId':_0x14bbf7['id'],'closed':![],'WhatsappAccountId':_0x3ce1c1['id']}})[_0x3ae6('0x30')](function(_0x3a5477){if(_0x3a5477){return[_0x3a5477,![]];}return db[_0x3ae6('0xa1')][_0x3ae6('0x53')]({'UserId':_0x4d7d45[_0x3ae6('0x55')]['id'],'ContactId':_0x14bbf7['id'],'WhatsappAccountId':_0x3ce1c1['id'],'phone':_0x1ff357,'firstMsgDirection':_0x3ae6('0xb9'),'Messages':[_[_0x3ae6('0x48')](_0x4d7d45[_0x3ae6('0x54')],{'read':![],'body':_0x4d7d45[_0x3ae6('0x54')][_0x3ae6('0x54')],'phone':_0x1ff357,'WhatsappAccountId':_0x3ce1c1['id'],'UserId':_0x4d7d45['user']['id'],'ContactId':_0x14bbf7['id']})]},{'include':[{'model':db[_0x3ae6('0xa9')],'as':_0x3ae6('0xba')}]})['then'](function(_0x4ae13a){return[_0x4ae13a,!![]];});});}})[_0x3ae6('0x6f')](function(_0x584903,_0x5b53e5){if(_0x5b53e5){return _0x584903;}return db[_0x3ae6('0xa9')][_0x3ae6('0x53')](_['merge'](_0x4d7d45[_0x3ae6('0x54')],{'read':![],'body':_0x4d7d45[_0x3ae6('0x54')][_0x3ae6('0x54')],'phone':_0x1ff357,'WhatsappAccountId':_0x3ce1c1['id'],'WhatsappInteractionId':_0x584903['id'],'UserId':_0x4d7d45['user']['id'],'ContactId':_0x14bbf7['id']}))[_0x3ae6('0x30')](function(_0x705fa2){_0x584903[_0x3ae6('0xbb')][_0x3ae6('0xba')]=[];_0x584903[_0x3ae6('0xbb')][_0x3ae6('0xba')][_0x3ae6('0xa4')](_0x705fa2['dataValues']);return _0x584903;});})['then'](respondWithResult(_0x200c1e,null))['catch'](handleError(_0x200c1e,null));}; \ No newline at end of file +var _0x068d=['rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','name','index','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','map','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','where','includeAll','findAll','rows','show','params','Pause','keys','fields','include','find','create','body','user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','rawAttributes','options','removeAnswers','addAgents','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','getApplications','whatsapp','Applications','account','applications','orderBy','asc','CmContact','describe','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','WhatsappInteraction','interaction','autoclose','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','send','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','spread','dataValues'];(function(_0x443e0c,_0x51ca0e){var _0x963c7e=function(_0x1e1b9f){while(--_0x1e1b9f){_0x443e0c['push'](_0x443e0c['shift']());}};_0x963c7e(++_0x51ca0e);}(_0x068d,0x166));var _0xd068=function(_0x552a31,_0x2283ca){_0x552a31=_0x552a31-0x0;var _0x1e2940=_0x068d[_0x552a31];return _0x1e2940;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd068('0x0'));var zipdir=require(_0xd068('0x1'));var jsonpatch=require(_0xd068('0x2'));var rp=require('request-promise');var moment=require(_0xd068('0x3'));var BPromise=require(_0xd068('0x4'));var Mustache=require(_0xd068('0x5'));var util=require(_0xd068('0x6'));var path=require(_0xd068('0x7'));var sox=require(_0xd068('0x8'));var csv=require(_0xd068('0x9'));var ejs=require(_0xd068('0xa'));var fs=require('fs');var fs_extra=require(_0xd068('0xb'));var _=require(_0xd068('0xc'));var squel=require(_0xd068('0xd'));var crypto=require('crypto');var jsforce=require(_0xd068('0xe'));var deskjs=require(_0xd068('0xf'));var toCsv=require(_0xd068('0x9'));var querystring=require(_0xd068('0x10'));var Papa=require(_0xd068('0x11'));var Redis=require(_0xd068('0x12'));var authService=require(_0xd068('0x13'));var qs=require(_0xd068('0x14'));var as=require(_0xd068('0x15'));var hardwareService=require(_0xd068('0x16'));var logger=require('../../config/logger')(_0xd068('0x17'));var utils=require(_0xd068('0x18'));var config=require(_0xd068('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd068('0x1a')]=_[_0xd068('0x1b')](config[_0xd068('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd068('0x1c'))(new Redis(config[_0xd068('0x1a')]));require(_0xd068('0x1d'))[_0xd068('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd068('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x53ece2,_0x5e2df4,_0x2afda6,_0xcbbeaa){return new BPromise(function(_0x268394,_0x58f4b8){var _0x666e97=_0xcbbeaa||client;return _0x666e97[_0xd068('0x20')](_0x53ece2,_0x2afda6)[_0xd068('0x21')](function(_0x1b2062){logger[_0xd068('0x22')](_0xd068('0x23'),_0x5e2df4,_0xd068('0x24'));logger[_0xd068('0x25')](_0xd068('0x26'),_0x5e2df4,'request\x20sent',JSON['stringify'](_0x1b2062));if(_0x1b2062[_0xd068('0x27')]){if(_0x1b2062[_0xd068('0x27')][_0xd068('0x28')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x1b2062[_0xd068('0x27')]['message']);return _0x58f4b8(_0x1b2062[_0xd068('0x27')][_0xd068('0x29')]);}logger[_0xd068('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x1b2062[_0xd068('0x27')][_0xd068('0x29')]);return _0x268394(_0x1b2062[_0xd068('0x27')]['message']);}else{logger[_0xd068('0x22')](_0xd068('0x23'),_0x5e2df4,_0xd068('0x24'));_0x268394(_0x1b2062[_0xd068('0x2a')][_0xd068('0x29')]);}})[_0xd068('0x2b')](function(_0x5ed0ab){logger[_0xd068('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x5ed0ab);_0x58f4b8(_0x5ed0ab);});});}function respondWithStatusCode(_0x51fd55,_0x10b129){_0x10b129=_0x10b129||0xcc;return function(_0x5ca05a){if(_0x5ca05a){return _0x51fd55[_0xd068('0x2c')](_0x10b129);}return _0x51fd55[_0xd068('0x2d')](_0x10b129)[_0xd068('0x2e')]();};}function respondWithResult(_0x459ed4,_0x4eb958){_0x4eb958=_0x4eb958||0xc8;return function(_0x3784de){if(_0x3784de){return _0x459ed4[_0xd068('0x2d')](_0x4eb958)[_0xd068('0x2f')](_0x3784de);}};}function respondWithFilteredResult(_0x3958f6,_0x544b29){return function(_0x16c213){if(_0x16c213){var _0x545479=typeof _0x544b29['offset']==='undefined'&&typeof _0x544b29[_0xd068('0x30')]==='undefined';var _0x271453=_0x16c213[_0xd068('0x31')];var _0x128887=_0x545479?0x0:_0x544b29[_0xd068('0x32')];var _0x118707=_0x545479?_0x16c213['count']:_0x544b29[_0xd068('0x32')]+_0x544b29[_0xd068('0x30')];var _0x571dfa;if(_0x118707>=_0x271453){_0x118707=_0x271453;_0x571dfa=0xc8;}else{_0x571dfa=0xce;}_0x3958f6[_0xd068('0x2d')](_0x571dfa);return _0x3958f6[_0xd068('0x33')](_0xd068('0x34'),_0x128887+'-'+_0x118707+'/'+_0x271453)[_0xd068('0x2f')](_0x16c213);}return null;};}function patchUpdates(_0x345ed8){return function(_0x12e390){try{jsonpatch[_0xd068('0x35')](_0x12e390,_0x345ed8,!![]);}catch(_0x5cba9f){return BPromise[_0xd068('0x36')](_0x5cba9f);}return _0x12e390[_0xd068('0x37')]();};}function saveUpdates(_0x2cab2d,_0x579a25){return function(_0x1a4961){if(_0x1a4961){return _0x1a4961['update'](_0x2cab2d)['then'](function(_0x33d9c1){return _0x33d9c1;});}return null;};}function removeEntity(_0x39c087,_0x20576c){return function(_0x59d36c){if(_0x59d36c){return _0x59d36c[_0xd068('0x38')]()['then'](function(){var _0x56d8fb=_0x59d36c[_0xd068('0x39')]({'plain':!![]});var _0x4bcf6b='WhatsappAccounts';return db[_0xd068('0x3a')][_0xd068('0x38')]({'where':{'type':_0x4bcf6b,'resourceId':_0x56d8fb['id']}})['then'](function(){return _0x59d36c;});})[_0xd068('0x21')](function(){_0x39c087[_0xd068('0x2d')](0xcc)[_0xd068('0x2e')]();});}};}function handleEntityNotFound(_0x3722c2,_0x382726){return function(_0x5a0ec0){if(!_0x5a0ec0){_0x3722c2[_0xd068('0x2c')](0x194);}return _0x5a0ec0;};}function handleError(_0x4b161d,_0x5a8403){_0x5a8403=_0x5a8403||0x1f4;return function(_0x19dfbb){logger[_0xd068('0x27')](_0x19dfbb['stack']);if(_0x19dfbb['name']){delete _0x19dfbb[_0xd068('0x3b')];}_0x4b161d['status'](_0x5a8403)['send'](_0x19dfbb);};}exports[_0xd068('0x3c')]=function(_0x22369e,_0x3db80b){var _0x5dfe6c={'include':[{'model':db['Pause'],'as':_0xd068('0x3d')}]},_0x209ec3={},_0x13fac6={'count':0x0,'rows':[]};var _0x456021=_['map'](db[_0xd068('0x3e')]['rawAttributes'],function(_0x561658){return{'name':_0x561658[_0xd068('0x3f')],'type':_0x561658[_0xd068('0x40')][_0xd068('0x41')]};});_0x209ec3[_0xd068('0x42')]=_[_0xd068('0x43')](_0x456021,_0xd068('0x3b'));_0x209ec3[_0xd068('0x44')]=_['keys'](_0x22369e['query']);_0x209ec3[_0xd068('0x45')]=_['intersection'](_0x209ec3[_0xd068('0x42')],_0x209ec3[_0xd068('0x44')]);_0x5dfe6c[_0xd068('0x46')]=_[_0xd068('0x47')](_0x209ec3['model'],qs['fields'](_0x22369e[_0xd068('0x44')]['fields']));_0x5dfe6c[_0xd068('0x46')]=_0x5dfe6c['attributes'][_0xd068('0x48')]?_0x5dfe6c[_0xd068('0x46')]:_0x209ec3[_0xd068('0x42')];if(!_0x22369e['query'][_0xd068('0x49')](_0xd068('0x4a'))){_0x5dfe6c['limit']=qs['limit'](_0x22369e[_0xd068('0x44')][_0xd068('0x30')]);_0x5dfe6c[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x22369e[_0xd068('0x44')][_0xd068('0x32')]);}_0x5dfe6c[_0xd068('0x4b')]=qs['sort'](_0x22369e[_0xd068('0x44')][_0xd068('0x4c')]);_0x5dfe6c['where']=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0x22369e[_0xd068('0x44')],_0x209ec3[_0xd068('0x45')]),_0x456021);if(_0x22369e[_0xd068('0x44')][_0xd068('0x4e')]){_0x5dfe6c['where']=_['merge'](_0x5dfe6c['where'],{'$or':_[_0xd068('0x43')](_0x456021,function(_0x1d638d){if(_0x1d638d[_0xd068('0x40')]!==_0xd068('0x4f')){var _0x4dbfa9={};_0x4dbfa9[_0x1d638d[_0xd068('0x3b')]]={'$like':'%'+_0x22369e[_0xd068('0x44')]['filter']+'%'};return _0x4dbfa9;}})});}_0x5dfe6c=_[_0xd068('0x50')]({},_0x5dfe6c,_0x22369e['options']);var _0x72f2cd={'where':_0x5dfe6c[_0xd068('0x51')]};return db[_0xd068('0x3e')][_0xd068('0x31')](_0x72f2cd)[_0xd068('0x21')](function(_0x317069){_0x13fac6[_0xd068('0x31')]=_0x317069;if(_0x22369e[_0xd068('0x44')][_0xd068('0x52')]){_0x5dfe6c['include']=[{'all':!![]}];}return db[_0xd068('0x3e')][_0xd068('0x53')](_0x5dfe6c);})[_0xd068('0x21')](function(_0xca222){_0x13fac6[_0xd068('0x54')]=_0xca222;return _0x13fac6;})['then'](respondWithFilteredResult(_0x3db80b,_0x5dfe6c))[_0xd068('0x2b')](handleError(_0x3db80b,null));};exports[_0xd068('0x55')]=function(_0x2d6878,_0x1150e9){var _0x270131={'raw':![],'where':{'id':_0x2d6878[_0xd068('0x56')]['id']},'include':[{'model':db[_0xd068('0x57')],'as':_0xd068('0x3d')}]},_0x57a81a={};_0x57a81a[_0xd068('0x42')]=_[_0xd068('0x58')](db['WhatsappAccount']['rawAttributes']);_0x57a81a[_0xd068('0x44')]=_['keys'](_0x2d6878[_0xd068('0x44')]);_0x57a81a[_0xd068('0x45')]=_[_0xd068('0x47')](_0x57a81a[_0xd068('0x42')],_0x57a81a['query']);_0x270131['attributes']=_[_0xd068('0x47')](_0x57a81a['model'],qs[_0xd068('0x59')](_0x2d6878[_0xd068('0x44')][_0xd068('0x59')]));_0x270131['attributes']=_0x270131['attributes']['length']?_0x270131['attributes']:_0x57a81a[_0xd068('0x42')];if(_0x2d6878[_0xd068('0x44')]['includeAll']){_0x270131[_0xd068('0x5a')]=[{'all':!![]}];}_0x270131=_[_0xd068('0x50')]({},_0x270131,_0x2d6878['options']);return db[_0xd068('0x3e')][_0xd068('0x5b')](_0x270131)[_0xd068('0x21')](handleEntityNotFound(_0x1150e9,null))[_0xd068('0x21')](respondWithResult(_0x1150e9,null))[_0xd068('0x2b')](handleError(_0x1150e9,null));};exports[_0xd068('0x5c')]=function(_0x2d08b6,_0x4f5a41){return db['WhatsappAccount'][_0xd068('0x5c')](_0x2d08b6[_0xd068('0x5d')],{})[_0xd068('0x21')](function(_0x401a23){var _0x3f0e24=_0x2d08b6[_0xd068('0x5e')][_0xd068('0x39')]({'plain':!![]});if(!_0x3f0e24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f0e24[_0xd068('0x5f')]===_0xd068('0x5e')){var _0x582a7d=_0x401a23[_0xd068('0x39')]({'plain':!![]});var _0x2ce50b=_0xd068('0x60');return db[_0xd068('0x61')][_0xd068('0x5b')]({'where':{'name':_0x2ce50b,'userProfileId':_0x3f0e24[_0xd068('0x62')]},'raw':!![]})[_0xd068('0x21')](function(_0x5617a9){if(_0x5617a9&&_0x5617a9[_0xd068('0x63')]===0x0){return db['UserProfileResource'][_0xd068('0x5c')]({'name':_0x582a7d[_0xd068('0x3b')],'resourceId':_0x582a7d['id'],'type':_0x5617a9['name'],'sectionId':_0x5617a9['id']},{})['then'](function(){return _0x401a23;});}else{return _0x401a23;}})[_0xd068('0x2b')](function(_0x1bacfd){logger[_0xd068('0x27')](_0xd068('0x64'),_0x1bacfd);throw _0x1bacfd;});}return _0x401a23;})[_0xd068('0x21')](respondWithResult(_0x4f5a41,0xc9))[_0xd068('0x2b')](handleError(_0x4f5a41,null));};exports['update']=function(_0x215f6c,_0x4b08b2){if(_0x215f6c[_0xd068('0x5d')]['id']){delete _0x215f6c[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x215f6c[_0xd068('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xd068('0x3d')}]})[_0xd068('0x21')](handleEntityNotFound(_0x4b08b2,null))[_0xd068('0x21')](saveUpdates(_0x215f6c[_0xd068('0x5d')],null))[_0xd068('0x21')](respondWithResult(_0x4b08b2,null))['catch'](handleError(_0x4b08b2,null));};exports[_0xd068('0x38')]=function(_0x27dd64,_0x56db83){return db['WhatsappAccount'][_0xd068('0x5b')]({'where':{'id':_0x27dd64[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x56db83,null))[_0xd068('0x21')](removeEntity(_0x56db83,null))[_0xd068('0x2b')](handleError(_0x56db83,null));};exports['describe']=function(_0x1df435,_0x5b92c0){return db[_0xd068('0x3e')]['describe']()[_0xd068('0x21')](respondWithResult(_0x5b92c0,null))[_0xd068('0x2b')](handleError(_0x5b92c0,null));};exports['addDisposition']=function(_0x4001ed,_0x320d1b,_0x4898cd){if(_0x4001ed['body']['id']){delete _0x4001ed[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x4001ed[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x320d1b,null))[_0xd068('0x21')](function(_0x599def){if(_0x599def){_0x4001ed[_0xd068('0x5d')][_0xd068('0x65')]=_0x599def['id'];return db['Disposition'][_0xd068('0x5c')](_0x4001ed[_0xd068('0x5d')]);}})['then'](respondWithResult(_0x320d1b,null))[_0xd068('0x2b')](handleError(_0x320d1b,null));};exports[_0xd068('0x66')]=function(_0x8fb13,_0x2c9950,_0xe508bf){var _0x34d6d4={'raw':![],'where':{}};var _0x3bffd3={};var _0x12b41e={'count':0x0,'rows':[]};return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0x8fb13['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x2c9950,null))['then'](function(_0x506ac0){if(_0x506ac0){_0x3bffd3['model']=_[_0xd068('0x58')](db[_0xd068('0x68')]['rawAttributes']);_0x3bffd3[_0xd068('0x44')]=_['keys'](_0x8fb13[_0xd068('0x44')]);_0x3bffd3[_0xd068('0x45')]=_[_0xd068('0x47')](_0x3bffd3['model'],_0x3bffd3[_0xd068('0x44')]);_0x34d6d4[_0xd068('0x46')]=_[_0xd068('0x47')](_0x3bffd3[_0xd068('0x42')],qs[_0xd068('0x59')](_0x8fb13['query'][_0xd068('0x59')]));_0x34d6d4[_0xd068('0x46')]=_0x34d6d4['attributes']['length']?_0x34d6d4[_0xd068('0x46')]:_0x3bffd3[_0xd068('0x42')];if(!_0x8fb13[_0xd068('0x44')][_0xd068('0x49')](_0xd068('0x4a'))){_0x34d6d4['limit']=qs[_0xd068('0x30')](_0x8fb13[_0xd068('0x44')][_0xd068('0x30')]);_0x34d6d4[_0xd068('0x32')]=qs['offset'](_0x8fb13[_0xd068('0x44')]['offset']);}_0x34d6d4[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x8fb13['query'][_0xd068('0x4c')]);_0x34d6d4[_0xd068('0x51')]=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0x8fb13['query'],_0x3bffd3['filters']));_0x34d6d4['where'][_0xd068('0x65')]=_0x506ac0['id'];if(_0x8fb13[_0xd068('0x44')][_0xd068('0x4e')]){_0x34d6d4[_0xd068('0x51')]=_['merge'](_0x34d6d4[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x34d6d4['attributes'],function(_0x598d3b){var _0x10dd7d={};_0x10dd7d[_0x598d3b]={'$like':'%'+_0x8fb13[_0xd068('0x44')]['filter']+'%'};return _0x10dd7d;})});}_0x34d6d4=_[_0xd068('0x50')]({},_0x34d6d4,_0x8fb13['options']);return db[_0xd068('0x68')][_0xd068('0x31')]({'where':_0x34d6d4[_0xd068('0x51')]})[_0xd068('0x21')](function(_0x582268){_0x12b41e[_0xd068('0x31')]=_0x582268;if(_0x8fb13[_0xd068('0x44')][_0xd068('0x52')]){_0x34d6d4[_0xd068('0x5a')]=[{'all':!![]}];}return db[_0xd068('0x68')]['findAll'](_0x34d6d4);})['then'](function(_0x2eda80){_0x12b41e[_0xd068('0x54')]=_0x2eda80;return _0x12b41e;});}})[_0xd068('0x21')](respondWithFilteredResult(_0x2c9950,_0x34d6d4))[_0xd068('0x2b')](handleError(_0x2c9950,null));};exports[_0xd068('0x69')]=function(_0x49b7a7,_0xf22914,_0x16249c){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x49b7a7[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0xf22914,null))[_0xd068('0x21')](function(_0x209fff){if(_0x209fff){return _0x209fff[_0xd068('0x69')](_0x49b7a7[_0xd068('0x44')][_0xd068('0x6a')]);}})['then'](respondWithStatusCode(_0xf22914,null))[_0xd068('0x2b')](handleError(_0xf22914,null));};exports['addAnswer']=function(_0x24cf70,_0x5c707,_0x5dfccd){if(_0x24cf70['body']['id']){delete _0x24cf70[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')]['find']({'where':{'id':_0x24cf70[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x5c707,null))[_0xd068('0x21')](function(_0x2a84c6){if(_0x2a84c6){_0x24cf70[_0xd068('0x5d')][_0xd068('0x65')]=_0x2a84c6['id'];return db[_0xd068('0x6b')][_0xd068('0x5c')](_0x24cf70[_0xd068('0x5d')]);}})[_0xd068('0x21')](respondWithResult(_0x5c707,null))[_0xd068('0x2b')](handleError(_0x5c707,null));};exports['getAnswers']=function(_0x323d02,_0xe329a4,_0x4540c4){var _0x12593d={'raw':![],'where':{}};var _0x3ccc09={};var _0x23c5b1={'count':0x0,'rows':[]};return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0x323d02[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0xe329a4,null))['then'](function(_0x5069aa){if(_0x5069aa){_0x3ccc09['model']=_[_0xd068('0x58')](db['CannedAnswer'][_0xd068('0x6c')]);_0x3ccc09[_0xd068('0x44')]=_[_0xd068('0x58')](_0x323d02[_0xd068('0x44')]);_0x3ccc09[_0xd068('0x45')]=_[_0xd068('0x47')](_0x3ccc09[_0xd068('0x42')],_0x3ccc09['query']);_0x12593d[_0xd068('0x46')]=_[_0xd068('0x47')](_0x3ccc09['model'],qs[_0xd068('0x59')](_0x323d02['query'][_0xd068('0x59')]));_0x12593d[_0xd068('0x46')]=_0x12593d[_0xd068('0x46')][_0xd068('0x48')]?_0x12593d[_0xd068('0x46')]:_0x3ccc09['model'];if(!_0x323d02[_0xd068('0x44')]['hasOwnProperty'](_0xd068('0x4a'))){_0x12593d['limit']=qs[_0xd068('0x30')](_0x323d02['query']['limit']);_0x12593d[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x323d02['query'][_0xd068('0x32')]);}_0x12593d[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x323d02[_0xd068('0x44')][_0xd068('0x4c')]);_0x12593d[_0xd068('0x51')]=qs['filters'](_['pick'](_0x323d02[_0xd068('0x44')],_0x3ccc09[_0xd068('0x45')]));_0x12593d[_0xd068('0x51')][_0xd068('0x65')]=_0x5069aa['id'];if(_0x323d02[_0xd068('0x44')]['filter']){_0x12593d['where']=_['merge'](_0x12593d[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x12593d[_0xd068('0x46')],function(_0x28ea44){var _0x392fa2={};_0x392fa2[_0x28ea44]={'$like':'%'+_0x323d02['query']['filter']+'%'};return _0x392fa2;})});}_0x12593d=_['merge']({},_0x12593d,_0x323d02[_0xd068('0x6d')]);return db[_0xd068('0x6b')][_0xd068('0x31')]({'where':_0x12593d[_0xd068('0x51')]})[_0xd068('0x21')](function(_0x9dc0c4){_0x23c5b1[_0xd068('0x31')]=_0x9dc0c4;if(_0x323d02[_0xd068('0x44')]['includeAll']){_0x12593d[_0xd068('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd068('0x53')](_0x12593d);})[_0xd068('0x21')](function(_0xc6419a){_0x23c5b1['rows']=_0xc6419a;return _0x23c5b1;});}})[_0xd068('0x21')](respondWithFilteredResult(_0xe329a4,_0x12593d))[_0xd068('0x2b')](handleError(_0xe329a4,null));};exports[_0xd068('0x6e')]=function(_0x4f70f5,_0x4f3edc,_0x12b671){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x4f70f5['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x4f3edc,null))['then'](function(_0x1d58f3){if(_0x1d58f3){return _0x1d58f3[_0xd068('0x6e')](_0x4f70f5[_0xd068('0x44')][_0xd068('0x6a')]);}})[_0xd068('0x21')](respondWithStatusCode(_0x4f3edc,null))[_0xd068('0x2b')](handleError(_0x4f3edc,null));};exports[_0xd068('0x6f')]=function(_0x5e5f58,_0x460d99,_0x25e7a2){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x5e5f58['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x460d99,null))['then'](function(_0x3a5c31){if(_0x3a5c31){return _0x3a5c31[_0xd068('0x6f')](_0x5e5f58[_0xd068('0x5d')][_0xd068('0x6a')],_['omit'](_0x5e5f58[_0xd068('0x5d')],[_0xd068('0x6a'),'id'])||{})['spread'](function(_0xe0114){for(var _0x2c55bc=0x0;_0x2c55bc<_0x5e5f58[_0xd068('0x5d')]['ids']['length'];_0x2c55bc+=0x1){socket['emit'](_0xd068('0x70'),{'UserId':Number(_0x5e5f58[_0xd068('0x5d')]['ids'][_0x2c55bc]),'WhatsappAccountId':Number(_0x5e5f58[_0xd068('0x56')]['id'])});}return _0xe0114;});}})[_0xd068('0x21')](respondWithResult(_0x460d99,null))['catch'](handleError(_0x460d99,null));};exports[_0xd068('0x71')]=function(_0x9c9e83,_0x2ac527,_0x461661){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x9c9e83[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x2ac527,null))[_0xd068('0x21')](function(_0x76cb30){if(_0x76cb30){return _0x76cb30[_0xd068('0x71')](_0x9c9e83[_0xd068('0x44')][_0xd068('0x6a')])['then'](function(){if(_[_0xd068('0x72')](_0x9c9e83[_0xd068('0x44')]['ids'])){for(var _0x2017be=0x0;_0x2017be<_0x9c9e83['query'][_0xd068('0x6a')][_0xd068('0x48')];_0x2017be+=0x1){socket[_0xd068('0x73')](_0xd068('0x74'),{'UserId':Number(_0x9c9e83['query']['ids'][_0x2017be]),'WhatsappAccountId':Number(_0x9c9e83[_0xd068('0x56')]['id'])});}}else{socket[_0xd068('0x73')](_0xd068('0x74'),{'UserId':Number(_0x9c9e83[_0xd068('0x44')][_0xd068('0x6a')]),'WhatsappAccountId':Number(_0x9c9e83[_0xd068('0x56')]['id'])});}});}})[_0xd068('0x21')](respondWithStatusCode(_0x2ac527,null))['catch'](handleError(_0x2ac527,null));};exports[_0xd068('0x75')]=function(_0x1fc6ad,_0x276051,_0x15d19d){var _0xb04ec1={};var _0x43292b={};var _0x39a40d;var _0x5dbaf9;return db['WhatsappAccount']['findOne']({'where':{'id':_0x1fc6ad[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x276051,null))[_0xd068('0x21')](function(_0x112a64){if(_0x112a64){_0x39a40d=_0x112a64;_0x43292b['model']=_[_0xd068('0x58')](db[_0xd068('0x76')][_0xd068('0x6c')]);_0x43292b[_0xd068('0x44')]=_[_0xd068('0x58')](_0x1fc6ad[_0xd068('0x44')]);_0x43292b[_0xd068('0x45')]=_[_0xd068('0x47')](_0x43292b[_0xd068('0x42')],_0x43292b[_0xd068('0x44')]);_0xb04ec1[_0xd068('0x46')]=_['intersection'](_0x43292b[_0xd068('0x42')],qs[_0xd068('0x59')](_0x1fc6ad[_0xd068('0x44')][_0xd068('0x59')]));_0xb04ec1[_0xd068('0x46')]=_0xb04ec1['attributes']['length']?_0xb04ec1[_0xd068('0x46')]:_0x43292b[_0xd068('0x42')];_0xb04ec1[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x1fc6ad[_0xd068('0x44')][_0xd068('0x4c')]);_0xb04ec1[_0xd068('0x51')]=qs['filters'](_[_0xd068('0x4d')](_0x1fc6ad[_0xd068('0x44')],_0x43292b[_0xd068('0x45')]));if(_0x1fc6ad[_0xd068('0x44')][_0xd068('0x4e')]){_0xb04ec1[_0xd068('0x51')]=_[_0xd068('0x50')](_0xb04ec1[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0xb04ec1[_0xd068('0x46')],function(_0x13a0d5){var _0x35894b={};_0x35894b[_0x13a0d5]={'$like':'%'+_0x1fc6ad['query']['filter']+'%'};return _0x35894b;})});}_0xb04ec1=_[_0xd068('0x50')]({},_0xb04ec1,_0x1fc6ad[_0xd068('0x6d')]);return _0x39a40d[_0xd068('0x75')](_0xb04ec1);}})[_0xd068('0x21')](function(_0x22b0f2){if(_0x22b0f2){_0x5dbaf9=_0x22b0f2[_0xd068('0x48')];if(!_0x1fc6ad[_0xd068('0x44')][_0xd068('0x49')]('nolimit')){_0xb04ec1[_0xd068('0x30')]=qs[_0xd068('0x30')](_0x1fc6ad['query'][_0xd068('0x30')]);_0xb04ec1[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x1fc6ad[_0xd068('0x44')]['offset']);}return _0x39a40d[_0xd068('0x75')](_0xb04ec1);}})[_0xd068('0x21')](function(_0x371645){if(_0x371645){return _0x371645?{'count':_0x5dbaf9,'rows':_0x371645}:null;}})[_0xd068('0x21')](respondWithResult(_0x276051,null))[_0xd068('0x2b')](handleError(_0x276051,null));};exports['addApplications']=function(_0xb605d,_0x11516d,_0x5f105a){return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0xb605d[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x11516d,null))[_0xd068('0x21')](function(_0x39797c){if(_0x39797c){return db[_0xd068('0x77')][_0xd068('0x78')](function(_0x2e1ab3){return db[_0xd068('0x79')][_0xd068('0x38')]({'where':{'WhatsappAccountId':_0xb605d['params']['id']},'transaction':_0x2e1ab3})[_0xd068('0x21')](function(_0x1817c6){var _0x1d54ee=_[_0xd068('0x43')](_0xb605d[_0xd068('0x5d')],function(_0x39d308){_0x39d308['WhatsappAccountId']=_0xb605d['params']['id'];return _0x39d308;});return db[_0xd068('0x79')]['bulkCreate'](_0x1d54ee,{'transaction':_0x2e1ab3});});})['then'](function(){return db[_0xd068('0x79')]['findAndCountAll']({'where':{'WhatsappAccountId':_0xb605d[_0xd068('0x56')]['id']},'order':'priority'});});}})[_0xd068('0x21')](respondWithResult(_0x11516d,null))[_0xd068('0x2b')](handleError(_0x11516d,null));};exports[_0xd068('0x7a')]=function(_0xe24be0,_0x132545,_0x3868bc){var _0x3ce4b2={};var _0x432143={};var _0xbefdd7;var _0x456a6c;return db[_0xd068('0x3e')]['findOne']({'where':{'id':_0xe24be0['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x132545,null))[_0xd068('0x21')](function(_0x18d564){if(_0x18d564){_0xbefdd7=_0x18d564;_0x432143['model']=_[_0xd068('0x58')](db[_0xd068('0x79')][_0xd068('0x6c')]);_0x432143[_0xd068('0x44')]=_[_0xd068('0x58')](_0xe24be0[_0xd068('0x44')]);_0x432143[_0xd068('0x45')]=_[_0xd068('0x47')](_0x432143[_0xd068('0x42')],_0x432143['query']);_0x3ce4b2['attributes']=_[_0xd068('0x47')](_0x432143[_0xd068('0x42')],qs['fields'](_0xe24be0[_0xd068('0x44')][_0xd068('0x59')]));_0x3ce4b2['attributes']=_0x3ce4b2[_0xd068('0x46')][_0xd068('0x48')]?_0x3ce4b2['attributes']:_0x432143[_0xd068('0x42')];_0x3ce4b2[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0xe24be0[_0xd068('0x44')][_0xd068('0x4c')]);_0x3ce4b2[_0xd068('0x51')]=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0xe24be0['query'],_0x432143[_0xd068('0x45')]));if(_0xe24be0['query'][_0xd068('0x4e')]){_0x3ce4b2[_0xd068('0x51')]=_[_0xd068('0x50')](_0x3ce4b2[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x3ce4b2[_0xd068('0x46')],function(_0x11d823){var _0x249ff9={};_0x249ff9[_0x11d823]={'$like':'%'+_0xe24be0[_0xd068('0x44')][_0xd068('0x4e')]+'%'};return _0x249ff9;})});}_0x3ce4b2=_[_0xd068('0x50')]({},_0x3ce4b2,_0xe24be0[_0xd068('0x6d')]);return _0xbefdd7[_0xd068('0x7a')](_0x3ce4b2);}})[_0xd068('0x21')](function(_0x50c9fc){if(_0x50c9fc){_0x456a6c=_0x50c9fc[_0xd068('0x48')];if(!_0xe24be0[_0xd068('0x44')][_0xd068('0x49')](_0xd068('0x4a'))){_0x3ce4b2['limit']=qs[_0xd068('0x30')](_0xe24be0[_0xd068('0x44')][_0xd068('0x30')]);_0x3ce4b2['offset']=qs['offset'](_0xe24be0[_0xd068('0x44')][_0xd068('0x32')]);}return _0xbefdd7['getApplications'](_0x3ce4b2);}})['then'](function(_0x11de22){if(_0x11de22){return _0x11de22?{'count':_0x456a6c,'rows':_0x11de22}:null;}})[_0xd068('0x21')](respondWithResult(_0x132545,null))['catch'](handleError(_0x132545,null));};exports['notify']=function(_0x281eb8,_0x511a42,_0x321ea0){var _0x2d8ab0={'channel':_0xd068('0x7b')};var _0x2baf31=[];var _0x3e982b=[];var _0x3d8d14={};return db['WhatsappAccount']['find']({'where':{'id':_0x281eb8[_0xd068('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xd068('0x7c')}]})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x17c5cf){_0x2d8ab0[_0xd068('0x7d')]=_0x17c5cf;_0x2d8ab0[_0xd068('0x7e')]=_[_0xd068('0x7f')](_0x17c5cf[_0xd068('0x7c')],['priority'],[_0xd068('0x80')]);if(_0x2d8ab0[_0xd068('0x7d')][_0xd068('0x7c')]){delete _0x2d8ab0[_0xd068('0x7d')][_0xd068('0x7c')];}return db[_0xd068('0x81')][_0xd068('0x82')]();})[_0xd068('0x21')](function(_0x3ff966){if(!_0x3ff966){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))]('no\x20available\x20attributes');}_0x2baf31=_['difference'](_[_0xd068('0x58')](_0x3ff966),['createdAt',_0xd068('0x85')]);_0x3e982b=_[_0xd068('0x86')](_[_0xd068('0x58')](_0x3ff966),[_0xd068('0x87'),_0xd068('0x85'),_0xd068('0x88'),_0xd068('0x89')]);_0x2d8ab0[_0xd068('0x5d')]={'mapKey':_0xd068('0x8a')};if(_0x2d8ab0['account']['type']&&_0x2d8ab0['account'][_0xd068('0x40')]===_0xd068('0x8b')){_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')]=_0x281eb8[_0xd068('0x5d')][_0xd068('0x8d')][_0xd068('0x8e')](_0xd068('0x8f'),'');_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x5d')]=_0x281eb8[_0xd068('0x5d')][_0xd068('0x90')];_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x91')]=_0x281eb8['body'][_0xd068('0x92')];}if(_0x2d8ab0[_0xd068('0x5d')]['id']){delete _0x2d8ab0[_0xd068('0x5d')]['id'];}if(_[_0xd068('0x93')](_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x94'));}if(_[_0xd068('0x93')](_0x2d8ab0['body']['body'])||_0x2d8ab0['body'][_0xd068('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0xd068('0x95'));}if(_['isNil'](_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x97')+_0x3e982b);}if(!_[_0xd068('0x98')](_0x3e982b,_0x2d8ab0[_0xd068('0x5d')]['mapKey'])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e982b);}_0x3d8d14[_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')]]=_0x2d8ab0[_0xd068('0x5d')]['from'];return db[_0xd068('0x99')]['find']({'where':{'id':_0x2d8ab0['account']['ListId']},'include':[{'model':db[_0xd068('0x81')],'as':_0xd068('0x9a'),'where':_0x3d8d14,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x2f4351){if(_0x2f4351){_0x2d8ab0['list']=_['omit'](_0x2f4351,[_0xd068('0x9a')]);if(_0x2f4351[_0xd068('0x9a')]['length']){return _0x2f4351[_0xd068('0x9a')][0x0];}var _0xcdf26e=_[_0xd068('0x1b')](_0x2d8ab0[_0xd068('0x5d')],{'firstName':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'ListId':_0x2f4351['id']});_0xcdf26e[_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')]]=_0x2d8ab0[_0xd068('0x5d')]['from'];return db[_0xd068('0x81')][_0xd068('0x5c')](_0xcdf26e,{'fields':_0x2baf31,'raw':!![]});}})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x5bcaa2){if(_0x5bcaa2){_0x2d8ab0['contact']=_0x5bcaa2;var _0x34610a={'ContactId':_0x5bcaa2['id'],'phone':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id']};var _0x4ce929={'ContactId':_0x5bcaa2['id'],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id'],'closed':![]};return db[_0xd068('0x9b')][_0xd068('0x5b')]({'where':_0x4ce929})[_0xd068('0x21')](function(_0x599cb2){if(_0x599cb2){return[_0x599cb2,![]];}return db['WhatsappInteraction'][_0xd068('0x5c')](_0x34610a)[_0xd068('0x21')](function(_0x45dc9c){return[_0x45dc9c,!![]];});});}})['spread'](function(_0x3207d6,_0x55e68b){_0x2d8ab0[_0xd068('0x9c')]=_0x3207d6['get']({'plain':!![]});_0x2d8ab0[_0xd068('0x9c')]['created']=![];if(_0x55e68b){if(_0x2d8ab0[_0xd068('0x7d')][_0xd068('0x9d')]){_0x2d8ab0[_0xd068('0x7e')]['push']({'id':0x0,'priority':_0x2d8ab0[_0xd068('0x7e')][_0xd068('0x48')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xd068('0x9e')});}_0x2d8ab0['interaction'][_0xd068('0x9f')]=!![];}return db[_0xd068('0xa0')][_0xd068('0x5c')]({'phone':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'messageId':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x91')],'body':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x5d')],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id'],'WhatsappInteractionId':_0x3207d6['id'],'direction':'in','ContactId':_0x3207d6[_0xd068('0xa1')],'AttachmentId':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0xa2')]});})[_0xd068('0x21')](function(_0x5ecd78){_0x2d8ab0[_0xd068('0x29')]=_0x5ecd78;if(_0x2d8ab0[_0xd068('0x9c')]['UserId']){return db['User'][_0xd068('0x5b')]({'attributes':['id',_0xd068('0x3b')],'where':{'id':_0x2d8ab0[_0xd068('0x9c')][_0xd068('0xa3')]}})['then'](function(_0x207b0c){if(_0x207b0c){_0x2d8ab0['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd068('0xa4'),'appdata':_0x207b0c['name']+','+(_0x2d8ab0[_0xd068('0x7d')]['waitForTheAssignedAgent']||0xa),'interval':_0xd068('0x9e')});}return respondWithRpcPromise(_0xd068('0xa5'),_0xd068('0xa6'),_0x2d8ab0);});}return respondWithRpcPromise(_0xd068('0xa5'),'startRouting',_0x2d8ab0);})['then'](function(_0x1f7088){if(_0x1f7088){var _0x2fd44c=0xc8;var _0xffdfe1='receiveMessage';logger['info'](_0xd068('0x26'),_0xffdfe1,_0x2fd44c,'entity\x20found');logger[_0xd068('0x25')](_0xd068('0xa7'),_0xffdfe1,_0x2fd44c,_0xd068('0xa8'),JSON['stringify'](_0x1f7088));if(_0x2d8ab0['account']['type']==='twilio'){return _0x511a42[_0xd068('0x2d')](_0x2fd44c)[_0xd068('0x33')](_0xd068('0xa9'),'text/xml')[_0xd068('0xaa')](_0xd068('0xab'));}else{return _0x511a42[_0xd068('0x2d')](_0x2fd44c)[_0xd068('0x2f')](_0x1f7088);}}})[_0xd068('0x2b')](handleError(_0x511a42,null));};exports[_0xd068('0xaa')]=function(_0x2c6ae2,_0x5f40a4,_0xead275){var _0x5a9648,_0x1222c1,_0x4b1272;if(_['isNil'](_0x2c6ae2[_0xd068('0x5d')][_0xd068('0x5d')])||_0x2c6ae2[_0xd068('0x5d')][_0xd068('0x5d')]===''){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x95'));}if(_[_0xd068('0x93')](_0x2c6ae2[_0xd068('0x5d')]['to'])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0xac'));}_0x5a9648=_0x2c6ae2[_0xd068('0x5d')]['to'];return db['WhatsappAccount'][_0xd068('0x5b')]({'where':{'id':_0x2c6ae2[_0xd068('0x56')]['id']},'include':[{'model':db[_0xd068('0x99')],'as':_0xd068('0xad'),'include':[{'model':db[_0xd068('0x81')],'as':_0xd068('0x9a'),'where':{'mobile':_0x5a9648},'limit':0x1,'order':[[_0xd068('0x85'),_0xd068('0xae')]]}]}]})['then'](handleEntityNotFound(_0x5f40a4,null))[_0xd068('0x21')](function(_0xc92b5a){if(_0xc92b5a&&_0xc92b5a[_0xd068('0xad')]){_0x1222c1=_0xc92b5a[_0xd068('0x39')]({'plain':!![]});if(_0x1222c1[_0xd068('0xad')]&&_0x1222c1[_0xd068('0xad')][_0xd068('0x9a')][_0xd068('0x48')]){return _0x1222c1[_0xd068('0xad')][_0xd068('0x9a')][0x0];}return db[_0xd068('0x81')][_0xd068('0x5c')](_[_0xd068('0x1b')](_0x2c6ae2[_0xd068('0x5d')],{'firstName':_0x5a9648,'mobile':_0x5a9648,'phone':_0x5a9648,'ListId':_0x1222c1[_0xd068('0x89')]}));}})[_0xd068('0x21')](handleEntityNotFound(_0x5f40a4,null))[_0xd068('0x21')](function(_0x5af1ff){if(_0x5af1ff){_0x4b1272=_0x5af1ff;return db[_0xd068('0x9b')][_0xd068('0x5b')]({'where':{'ContactId':_0x4b1272['id'],'closed':![],'WhatsappAccountId':_0x1222c1['id']}})[_0xd068('0x21')](function(_0x3c1056){if(_0x3c1056){return[_0x3c1056,![]];}return db[_0xd068('0x9b')]['create']({'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id'],'WhatsappAccountId':_0x1222c1['id'],'phone':_0x5a9648,'firstMsgDirection':_0xd068('0xaf'),'Messages':[_[_0xd068('0x50')](_0x2c6ae2[_0xd068('0x5d')],{'read':![],'body':_0x2c6ae2['body']['body'],'phone':_0x5a9648,'WhatsappAccountId':_0x1222c1['id'],'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id']})]},{'include':[{'model':db[_0xd068('0xa0')],'as':_0xd068('0xb0')}]})[_0xd068('0x21')](function(_0xe373dd){return[_0xe373dd,!![]];});});}})[_0xd068('0xb1')](function(_0x356545,_0x279131){if(_0x279131){return _0x356545;}return db[_0xd068('0xa0')][_0xd068('0x5c')](_['merge'](_0x2c6ae2['body'],{'read':![],'body':_0x2c6ae2['body'][_0xd068('0x5d')],'phone':_0x5a9648,'WhatsappAccountId':_0x1222c1['id'],'WhatsappInteractionId':_0x356545['id'],'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id']}))[_0xd068('0x21')](function(_0x56d0c6){_0x356545[_0xd068('0xb2')][_0xd068('0xb0')]=[];_0x356545[_0xd068('0xb2')][_0xd068('0xb0')]['push'](_0x56d0c6[_0xd068('0xb2')]);return _0x356545;});})[_0xd068('0x21')](respondWithResult(_0x5f40a4,null))[_0xd068('0x2b')](handleError(_0x5f40a4,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6b99550..4e779ad 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 _0x04ea=['save','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04ea,0x131));var _0xa04e=function(_0x85fcc7,_0x4960ee){_0x85fcc7=_0x85fcc7-0x0;var _0x6aeafb=_0x04ea[_0x85fcc7];return _0x6aeafb;};'use strict';var EventEmitter=require(_0xa04e('0x0'));var WhatsappAccount=require(_0xa04e('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa04e('0x2')](0x0);var events={'afterCreate':_0xa04e('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c8f41){return function(_0x24f56e,_0x1ce651,_0x3647c1){WhatsappAccountEvents[_0xa04e('0x4')](_0x1c8f41+':'+_0x24f56e['id'],_0x24f56e);WhatsappAccountEvents['emit'](_0x1c8f41,_0x24f56e);_0x3647c1(null);};}for(var e in events){if(events[_0xa04e('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xa04e('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd58b=['../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0xd58b,0x183));var _0xbd58=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd58b[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xbd58('0x0'))['db'][_0xbd58('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbd58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd58('0x3'),'afterDestroy':_0xbd58('0x4')};function emitEvent(_0x4b19c1){return function(_0xcbe7aa,_0x1eb28b,_0x25a067){WhatsappAccountEvents[_0xbd58('0x5')](_0x4b19c1+':'+_0xcbe7aa['id'],_0xcbe7aa);WhatsappAccountEvents[_0xbd58('0x5')](_0x4b19c1,_0xcbe7aa);_0x25a067(null);};}for(var e in events){if(events[_0xbd58('0x6')](e)){var event=events[e];WhatsappAccount[_0xbd58('0x7')](e,emitEvent(event));}}module[_0xbd58('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 48c82cf..ddec996 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 _0x6e54=['lodash','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x59a5b5,_0x4c6a53){var _0x10e854=function(_0x468f9a){while(--_0x468f9a){_0x59a5b5['push'](_0x59a5b5['shift']());}};_0x10e854(++_0x4c6a53);}(_0x6e54,0xcc));var _0x46e5=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x6e54[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x46e5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x46e5('0x1'));var moment=require(_0x46e5('0x2'));var BPromise=require(_0x46e5('0x3'));var rp=require(_0x46e5('0x4'));var fs=require('fs');var path=require(_0x46e5('0x5'));var rimraf=require(_0x46e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x46e5('0x7'));module[_0x46e5('0x8')]=function(_0x7aa621,_0x42c45c){return _0x7aa621[_0x46e5('0x9')](_0x46e5('0xa'),attributes,{'tableName':_0x46e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f62=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','exports','define','whatsapp_accounts','util','../../config/logger','api'];(function(_0x2ac701,_0x561e2a){var _0x2bcda8=function(_0x2d4764){while(--_0x2d4764){_0x2ac701['push'](_0x2ac701['shift']());}};_0x2bcda8(++_0x561e2a);}(_0x0f62,0x81));var _0x20f6=function(_0x4f34d1,_0x15d0b8){_0x4f34d1=_0x4f34d1-0x0;var _0x3106a4=_0x0f62[_0x4f34d1];return _0x3106a4;};'use strict';var _=require('lodash');var util=require(_0x20f6('0x0'));var logger=require(_0x20f6('0x1'))(_0x20f6('0x2'));var moment=require(_0x20f6('0x3'));var BPromise=require(_0x20f6('0x4'));var rp=require(_0x20f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20f6('0x6'));var config=require('../../config/environment');var attributes=require(_0x20f6('0x7'));module[_0x20f6('0x8')]=function(_0x19aa73,_0x235485){return _0x19aa73[_0x20f6('0x9')]('WhatsappAccount',attributes,{'tableName':_0x20f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 6d7ba63..1bad9af 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 _0xb396=['request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowWhatsappAccount','find','options','raw','where','include','map','attributes','then','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xb396,0x1e8));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6b39('0x0'));var util=require(_0x6b39('0x1'));var moment=require(_0x6b39('0x2'));var BPromise=require(_0x6b39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b39('0x4'));var db=require(_0x6b39('0x5'))['db'];var utils=require(_0x6b39('0x6'));var logger=require(_0x6b39('0x7'))(_0x6b39('0x8'));var config=require(_0x6b39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6b39('0xa')]['http']({'port':0x232a});config[_0x6b39('0xb')]=_['defaults'](config['redis'],{'host':_0x6b39('0xc'),'port':0x18eb});var socket=require(_0x6b39('0xd'))(new Redis(config[_0x6b39('0xb')]));require(_0x6b39('0xe'))[_0x6b39('0xf')](socket);function respondWithRpcPromise(_0x36606d,_0x32c7b2,_0x5adff6){return new BPromise(function(_0x4a1b39,_0x5c098a){return client[_0x6b39('0x10')](_0x36606d,_0x5adff6)['then'](function(_0x5ba3af){logger['info'](_0x6b39('0x11'),_0x32c7b2,_0x6b39('0x12'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x32c7b2,_0x6b39('0x12'),JSON[_0x6b39('0x13')](_0x5ba3af));if(_0x5ba3af[_0x6b39('0x14')]){if(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x15')]===0x1f4){logger['error'](_0x6b39('0x11'),_0x32c7b2,_0x5ba3af['error'][_0x6b39('0x16')]);return _0x5c098a(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x16')]);}logger['error'](_0x6b39('0x11'),_0x32c7b2,_0x5ba3af['error'][_0x6b39('0x16')]);return _0x4a1b39(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x16')]);}else{logger[_0x6b39('0x17')](_0x6b39('0x11'),_0x32c7b2,_0x6b39('0x12'));_0x4a1b39(_0x5ba3af[_0x6b39('0x18')][_0x6b39('0x16')]);}})['catch'](function(_0x51a7dc){logger[_0x6b39('0x14')](_0x6b39('0x11'),_0x32c7b2,_0x51a7dc);_0x5c098a(_0x51a7dc);});});}exports[_0x6b39('0x19')]=function(_0x3a8b5b){var _0x1893ad=this;return new Promise(function(_0x299538,_0x458e7d){return db['WhatsappAccount'][_0x6b39('0x1a')]({'raw':_0x3a8b5b[_0x6b39('0x1b')]?_0x3a8b5b['options'][_0x6b39('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a8b5b[_0x6b39('0x1b')]?_0x3a8b5b[_0x6b39('0x1b')][_0x6b39('0x1d')]||null:null,'attributes':_0x3a8b5b['options']?_0x3a8b5b[_0x6b39('0x1b')]['attributes']||null:null,'include':_0x3a8b5b['options']?_0x3a8b5b[_0x6b39('0x1b')][_0x6b39('0x1e')]?_[_0x6b39('0x1f')](_0x3a8b5b['options']['include'],function(_0x503d6f){return{'model':db[_0x503d6f['model']],'as':_0x503d6f['as'],'attributes':_0x503d6f[_0x6b39('0x20')],'include':_0x503d6f[_0x6b39('0x1e')]?_[_0x6b39('0x1f')](_0x503d6f['include'],function(_0x8a5812){return{'model':db[_0x8a5812['model']],'as':_0x8a5812['as'],'attributes':_0x8a5812[_0x6b39('0x20')],'include':_0x8a5812['include']?_[_0x6b39('0x1f')](_0x8a5812[_0x6b39('0x1e')],function(_0x19f53b){return{'model':db[_0x19f53b['model']],'as':_0x19f53b['as'],'attributes':_0x19f53b[_0x6b39('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6b39('0x21')](function(_0x2e2e8d){logger['info'](_0x6b39('0x19'),_0x3a8b5b);logger[_0x6b39('0x22')](_0x6b39('0x19'),_0x3a8b5b,JSON['stringify'](_0x2e2e8d));_0x299538(_0x2e2e8d);})[_0x6b39('0x23')](function(_0x2b708d){logger[_0x6b39('0x14')]('ShowWhatsappAccount',_0x2b708d[_0x6b39('0x16')],_0x3a8b5b);_0x458e7d(_0x1893ad[_0x6b39('0x14')](0x1f4,_0x2b708d[_0x6b39('0x16')]));});});}; \ No newline at end of file +var _0x0ed8=['map','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','where','include','model','attributes'];(function(_0x4a2186,_0xcfd40f){var _0x1b8999=function(_0x89f53a){while(--_0x89f53a){_0x4a2186['push'](_0x4a2186['shift']());}};_0x1b8999(++_0xcfd40f);}(_0x0ed8,0x11a));var _0x80ed=function(_0x15e048,_0x585cec){_0x15e048=_0x15e048-0x0;var _0x30b8be=_0x0ed8[_0x15e048];return _0x30b8be;};'use strict';var _=require('lodash');var util=require(_0x80ed('0x0'));var moment=require(_0x80ed('0x1'));var BPromise=require(_0x80ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80ed('0x3'));var db=require(_0x80ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ed('0x5'))(_0x80ed('0x6'));var config=require(_0x80ed('0x7'));var jayson=require(_0x80ed('0x8'));var client=jayson[_0x80ed('0x9')][_0x80ed('0xa')]({'port':0x232a});config[_0x80ed('0xb')]=_[_0x80ed('0xc')](config[_0x80ed('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x80ed('0xd')](socket);function respondWithRpcPromise(_0x219abb,_0x5cee66,_0x5b29cc){return new BPromise(function(_0x422031,_0x52b7f2){return client[_0x80ed('0xe')](_0x219abb,_0x5b29cc)[_0x80ed('0xf')](function(_0x2ec2ac){logger[_0x80ed('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,'request\x20sent');logger[_0x80ed('0x11')](_0x80ed('0x12'),_0x5cee66,_0x80ed('0x13'),JSON['stringify'](_0x2ec2ac));if(_0x2ec2ac[_0x80ed('0x14')]){if(_0x2ec2ac[_0x80ed('0x14')][_0x80ed('0x15')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,_0x2ec2ac[_0x80ed('0x14')]['message']);return _0x52b7f2(_0x2ec2ac['error'][_0x80ed('0x16')]);}logger[_0x80ed('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,_0x2ec2ac['error']['message']);return _0x422031(_0x2ec2ac['error'][_0x80ed('0x16')]);}else{logger[_0x80ed('0x10')](_0x80ed('0x17'),_0x5cee66,'request\x20sent');_0x422031(_0x2ec2ac[_0x80ed('0x18')]['message']);}})[_0x80ed('0x19')](function(_0x386f5c){logger[_0x80ed('0x14')](_0x80ed('0x17'),_0x5cee66,_0x386f5c);_0x52b7f2(_0x386f5c);});});}exports[_0x80ed('0x1a')]=function(_0x39ce64){var _0x379db2=this;return new Promise(function(_0x4b676c,_0x4a678e){return db[_0x80ed('0x1b')]['find']({'raw':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64['options'][_0x80ed('0x1d')]||null:null,'attributes':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['attributes']||null:null,'include':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['include']?_['map'](_0x39ce64[_0x80ed('0x1c')][_0x80ed('0x1e')],function(_0x4c6c0d){return{'model':db[_0x4c6c0d[_0x80ed('0x1f')]],'as':_0x4c6c0d['as'],'attributes':_0x4c6c0d[_0x80ed('0x20')],'include':_0x4c6c0d['include']?_[_0x80ed('0x21')](_0x4c6c0d[_0x80ed('0x1e')],function(_0x80655f){return{'model':db[_0x80655f['model']],'as':_0x80655f['as'],'attributes':_0x80655f[_0x80ed('0x20')],'include':_0x80655f[_0x80ed('0x1e')]?_['map'](_0x80655f['include'],function(_0x44217e){return{'model':db[_0x44217e[_0x80ed('0x1f')]],'as':_0x44217e['as'],'attributes':_0x44217e[_0x80ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x80ed('0xf')](function(_0xa89957){logger[_0x80ed('0x10')](_0x80ed('0x1a'),_0x39ce64);logger[_0x80ed('0x11')](_0x80ed('0x1a'),_0x39ce64,JSON[_0x80ed('0x22')](_0xa89957));_0x4b676c(_0xa89957);})[_0x80ed('0x19')](function(_0x5851bb){logger[_0x80ed('0x14')](_0x80ed('0x1a'),_0x5851bb[_0x80ed('0x16')],_0x39ce64);_0x4a678e(_0x379db2[_0x80ed('0x14')](0x1f4,_0x5851bb['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index eaa0508..01f0359 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 _0x2656=['save','remove','update','emit','removeListener','register','./whatsappAccount.events'];(function(_0x5d1c9c,_0x539b2f){var _0xb9f28a=function(_0x5647f9){while(--_0x5647f9){_0x5d1c9c['push'](_0x5d1c9c['shift']());}};_0xb9f28a(++_0x539b2f);}(_0x2656,0x8b));var _0x6265=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x2656[_0x5a2285];return _0x48f6ed;};'use strict';var WhatsappAccountEvents=require(_0x6265('0x0'));var events=[_0x6265('0x1'),_0x6265('0x2'),_0x6265('0x3')];function createListener(_0x240d52,_0x1648af){return function(_0x4617a7){_0x1648af[_0x6265('0x4')](_0x240d52,_0x4617a7);};}function removeListener(_0x35de4b,_0x180493){return function(){WhatsappAccountEvents[_0x6265('0x5')](_0x35de4b,_0x180493);};}exports[_0x6265('0x6')]=function(_0x383639){for(var _0xa5bf25=0x0,_0x3b73c6=events['length'];_0xa5bf25<_0x3b73c6;_0xa5bf25++){var _0x1d600b=events[_0xa5bf25];var _0x3c022c=createListener('whatsappAccount:'+_0x1d600b,_0x383639);WhatsappAccountEvents['on'](_0x1d600b,_0x3c022c);}}; \ No newline at end of file +var _0xb928=['removeListener','register','length','save','remove','update','emit'];(function(_0x41d548,_0x2804b2){var _0xe4620f=function(_0x2b076e){while(--_0x2b076e){_0x41d548['push'](_0x41d548['shift']());}};_0xe4620f(++_0x2804b2);}(_0xb928,0x192));var _0x8b92=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xb928[_0x24875d];return _0x181471;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x8b92('0x0'),_0x8b92('0x1'),_0x8b92('0x2')];function createListener(_0x197e28,_0x3ad4c5){return function(_0x4c619e){_0x3ad4c5[_0x8b92('0x3')](_0x197e28,_0x4c619e);};}function removeListener(_0x5e4fa8,_0x4cf32d){return function(){WhatsappAccountEvents[_0x8b92('0x4')](_0x5e4fa8,_0x4cf32d);};}exports[_0x8b92('0x5')]=function(_0xd0e670){for(var _0x40742c=0x0,_0x1837ce=events[_0x8b92('0x6')];_0x40742c<_0x1837ce;_0x40742c++){var _0x29287e=events[_0x40742c];var _0x2f3a67=createListener('whatsappAccount:'+_0x29287e,_0xd0e670);WhatsappAccountEvents['on'](_0x29287e,_0x2f3a67);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3200463..d704648 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 _0x5505=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x6921e6,_0x482572){var _0x1af760=function(_0xd04d2c){while(--_0xd04d2c){_0x6921e6['push'](_0x6921e6['shift']());}};_0x1af760(++_0x482572);}(_0x5505,0x10d));var _0x5550=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5505[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x5550('0x0'));var util=require(_0x5550('0x1'));var path=require('path');var timeout=require(_0x5550('0x2'));var express=require(_0x5550('0x3'));var router=express['Router']();var fs_extra=require(_0x5550('0x4'));var auth=require(_0x5550('0x5'));var interaction=require(_0x5550('0x6'));var config=require(_0x5550('0x7'));var controller=require(_0x5550('0x8'));router[_0x5550('0x9')]('/',auth[_0x5550('0xa')](),controller['index']);router[_0x5550('0x9')]('/:id',auth[_0x5550('0xa')](),controller[_0x5550('0xb')]);router[_0x5550('0xc')]('/',auth[_0x5550('0xa')](),controller[_0x5550('0xd')]);router[_0x5550('0xe')](_0x5550('0xf'),auth[_0x5550('0xa')](),controller[_0x5550('0x10')]);router[_0x5550('0x11')](_0x5550('0xf'),auth[_0x5550('0xa')](),controller[_0x5550('0x12')]);module[_0x5550('0x13')]=router; \ No newline at end of file +var _0x783e=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','update','delete','destroy'];(function(_0x32c96e,_0x360866){var _0x45b218=function(_0x3d8003){while(--_0x3d8003){_0x32c96e['push'](_0x32c96e['shift']());}};_0x45b218(++_0x360866);}(_0x783e,0x140));var _0xe783=function(_0x331578,_0x4fa307){_0x331578=_0x331578-0x0;var _0x30c0ec=_0x783e[_0x331578];return _0x30c0ec;};'use strict';var multer=require(_0xe783('0x0'));var util=require(_0xe783('0x1'));var path=require(_0xe783('0x2'));var timeout=require(_0xe783('0x3'));var express=require(_0xe783('0x4'));var router=express['Router']();var fs_extra=require(_0xe783('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe783('0x6'));var config=require(_0xe783('0x7'));var controller=require('./whatsappApplication.controller');router[_0xe783('0x8')]('/',auth['isAuthenticated'](),controller[_0xe783('0x9')]);router[_0xe783('0x8')](_0xe783('0xa'),auth[_0xe783('0xb')](),controller['show']);router['post']('/',auth[_0xe783('0xb')](),controller[_0xe783('0xc')]);router['put']('/:id',auth[_0xe783('0xb')](),controller[_0xe783('0xd')]);router[_0xe783('0xe')](_0xe783('0xa'),auth[_0xe783('0xb')](),controller[_0xe783('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index eeca0ec..d83e067 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 _0xe029=['noop','TEXT','STRING'];(function(_0x3dac93,_0x1f8fa5){var _0x5c2bbe=function(_0x1f2c02){while(--_0x1f2c02){_0x3dac93['push'](_0x3dac93['shift']());}};_0x5c2bbe(++_0x1f8fa5);}(_0xe029,0x11f));var _0x9e02=function(_0x399bb9,_0x3aafa8){_0x399bb9=_0x399bb9-0x0;var _0x2c53be=_0xe029[_0x399bb9];return _0x2c53be;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9e02('0x0')],'allowNull':![],'defaultValue':_0x9e02('0x1')},'appdata':{'type':Sequelize[_0x9e02('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9e02('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x576b=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5f571a,_0x438086){var _0x31a570=function(_0x5dd4e3){while(--_0x5dd4e3){_0x5f571a['push'](_0x5f571a['shift']());}};_0x31a570(++_0x438086);}(_0x576b,0xdb));var _0xb576=function(_0x4d2658,_0x376562){_0x4d2658=_0x4d2658-0x0;var _0x5a5f39=_0x576b[_0x4d2658];return _0x5a5f39;};'use strict';var Sequelize=require('sequelize');module[_0xb576('0x0')]={'priority':{'type':Sequelize[_0xb576('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb576('0x2')],'allowNull':![],'defaultValue':_0xb576('0x3')},'appdata':{'type':Sequelize[_0xb576('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb576('0x2')],'defaultValue':_0xb576('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 1ec4653..5517759 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 _0xf417=['rows','catch','show','params','intersection','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','util','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','error','stack','send','map','rawAttributes','fieldName','name','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappApplication','includeAll','include','findAll'];(function(_0x2b9157,_0x141439){var _0x27b0de=function(_0x470ceb){while(--_0x470ceb){_0x2b9157['push'](_0x2b9157['shift']());}};_0x27b0de(++_0x141439);}(_0xf417,0x8f));var _0x7f41=function(_0x4adad3,_0x202bba){_0x4adad3=_0x4adad3-0x0;var _0x52dae4=_0xf417[_0x4adad3];return _0x52dae4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f41('0x0'));var zipdir=require(_0x7f41('0x1'));var jsonpatch=require(_0x7f41('0x2'));var rp=require('request-promise');var moment=require(_0x7f41('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f41('0x4'));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(_0x7f41('0x5'));var _=require('lodash');var squel=require(_0x7f41('0x6'));var crypto=require(_0x7f41('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7f41('0x8'));var toCsv=require('to-csv');var querystring=require(_0x7f41('0x9'));var Papa=require('papaparse');var Redis=require(_0x7f41('0xa'));var authService=require(_0x7f41('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f41('0xc'));var logger=require('../../config/logger')('api');var utils=require(_0x7f41('0xd'));var config=require(_0x7f41('0xe'));var licenseUtil=require(_0x7f41('0xf'));var db=require(_0x7f41('0x10'))['db'];function respondWithStatusCode(_0x637b2d,_0x46dcfe){_0x46dcfe=_0x46dcfe||0xcc;return function(_0xf2f383){if(_0xf2f383){return _0x637b2d['sendStatus'](_0x46dcfe);}return _0x637b2d['status'](_0x46dcfe)[_0x7f41('0x11')]();};}function respondWithResult(_0x4f5b74,_0x568eea){_0x568eea=_0x568eea||0xc8;return function(_0x466907){if(_0x466907){return _0x4f5b74[_0x7f41('0x12')](_0x568eea)[_0x7f41('0x13')](_0x466907);}};}function respondWithFilteredResult(_0x5a517f,_0x212b28){return function(_0x5ef6a7){if(_0x5ef6a7){var _0x27c0f6=typeof _0x212b28[_0x7f41('0x14')]===_0x7f41('0x15')&&typeof _0x212b28['limit']===_0x7f41('0x15');var _0x1ae462=_0x5ef6a7[_0x7f41('0x16')];var _0x5434d2=_0x27c0f6?0x0:_0x212b28[_0x7f41('0x14')];var _0x26580c=_0x27c0f6?_0x5ef6a7['count']:_0x212b28[_0x7f41('0x14')]+_0x212b28[_0x7f41('0x17')];var _0x1f4af0;if(_0x26580c>=_0x1ae462){_0x26580c=_0x1ae462;_0x1f4af0=0xc8;}else{_0x1f4af0=0xce;}_0x5a517f['status'](_0x1f4af0);return _0x5a517f[_0x7f41('0x18')]('Content-Range',_0x5434d2+'-'+_0x26580c+'/'+_0x1ae462)['json'](_0x5ef6a7);}return null;};}function patchUpdates(_0x3fe620){return function(_0x7de9c2){try{jsonpatch[_0x7f41('0x19')](_0x7de9c2,_0x3fe620,!![]);}catch(_0x21660b){return BPromise[_0x7f41('0x1a')](_0x21660b);}return _0x7de9c2[_0x7f41('0x1b')]();};}function saveUpdates(_0x5e0f8b,_0x5e568d){return function(_0x3e8000){if(_0x3e8000){return _0x3e8000['update'](_0x5e0f8b)['then'](function(_0xb27d9c){return _0xb27d9c;});}return null;};}function removeEntity(_0x388946,_0x4fdd78){return function(_0x3f3ee0){if(_0x3f3ee0){return _0x3f3ee0[_0x7f41('0x1c')]()[_0x7f41('0x1d')](function(){_0x388946[_0x7f41('0x12')](0xcc)[_0x7f41('0x11')]();});}};}function handleEntityNotFound(_0x4cbee7,_0x57a302){return function(_0x4dbed0){if(!_0x4dbed0){_0x4cbee7['sendStatus'](0x194);}return _0x4dbed0;};}function handleError(_0x16b410,_0x183ac7){_0x183ac7=_0x183ac7||0x1f4;return function(_0x55a32a){logger[_0x7f41('0x1e')](_0x55a32a[_0x7f41('0x1f')]);if(_0x55a32a['name']){delete _0x55a32a['name'];}_0x16b410['status'](_0x183ac7)[_0x7f41('0x20')](_0x55a32a);};}exports['index']=function(_0x4ee09e,_0x501076){var _0x3889b1={},_0x379dbe={},_0x4fa7e8={'count':0x0,'rows':[]};var _0x2b93e4=_[_0x7f41('0x21')](db['WhatsappApplication'][_0x7f41('0x22')],function(_0x1c33fb){return{'name':_0x1c33fb[_0x7f41('0x23')],'type':_0x1c33fb['type']['key']};});_0x379dbe['model']=_[_0x7f41('0x21')](_0x2b93e4,_0x7f41('0x24'));_0x379dbe[_0x7f41('0x25')]=_[_0x7f41('0x26')](_0x4ee09e[_0x7f41('0x25')]);_0x379dbe[_0x7f41('0x27')]=_['intersection'](_0x379dbe[_0x7f41('0x28')],_0x379dbe[_0x7f41('0x25')]);_0x3889b1[_0x7f41('0x29')]=_['intersection'](_0x379dbe[_0x7f41('0x28')],qs['fields'](_0x4ee09e[_0x7f41('0x25')][_0x7f41('0x2a')]));_0x3889b1[_0x7f41('0x29')]=_0x3889b1['attributes'][_0x7f41('0x2b')]?_0x3889b1[_0x7f41('0x29')]:_0x379dbe[_0x7f41('0x28')];if(!_0x4ee09e[_0x7f41('0x25')][_0x7f41('0x2c')](_0x7f41('0x2d'))){_0x3889b1[_0x7f41('0x17')]=qs[_0x7f41('0x17')](_0x4ee09e['query'][_0x7f41('0x17')]);_0x3889b1[_0x7f41('0x14')]=qs[_0x7f41('0x14')](_0x4ee09e[_0x7f41('0x25')][_0x7f41('0x14')]);}_0x3889b1[_0x7f41('0x2e')]=qs[_0x7f41('0x2f')](_0x4ee09e[_0x7f41('0x25')][_0x7f41('0x2f')]);_0x3889b1[_0x7f41('0x30')]=qs[_0x7f41('0x27')](_[_0x7f41('0x31')](_0x4ee09e['query'],_0x379dbe[_0x7f41('0x27')]),_0x2b93e4);if(_0x4ee09e[_0x7f41('0x25')]['filter']){_0x3889b1[_0x7f41('0x30')]=_['merge'](_0x3889b1[_0x7f41('0x30')],{'$or':_[_0x7f41('0x21')](_0x2b93e4,function(_0x2d2c62){if(_0x2d2c62['type']!==_0x7f41('0x32')){var _0x18ed9a={};_0x18ed9a[_0x2d2c62['name']]={'$like':'%'+_0x4ee09e['query'][_0x7f41('0x33')]+'%'};return _0x18ed9a;}})});}_0x3889b1=_[_0x7f41('0x34')]({},_0x3889b1,_0x4ee09e[_0x7f41('0x35')]);var _0x33f9d5={'where':_0x3889b1[_0x7f41('0x30')]};return db[_0x7f41('0x36')][_0x7f41('0x16')](_0x33f9d5)[_0x7f41('0x1d')](function(_0x2ea20d){_0x4fa7e8['count']=_0x2ea20d;if(_0x4ee09e[_0x7f41('0x25')][_0x7f41('0x37')]){_0x3889b1[_0x7f41('0x38')]=[{'all':!![]}];}return db[_0x7f41('0x36')][_0x7f41('0x39')](_0x3889b1);})[_0x7f41('0x1d')](function(_0x5a2d93){_0x4fa7e8[_0x7f41('0x3a')]=_0x5a2d93;return _0x4fa7e8;})[_0x7f41('0x1d')](respondWithFilteredResult(_0x501076,_0x3889b1))[_0x7f41('0x3b')](handleError(_0x501076,null));};exports[_0x7f41('0x3c')]=function(_0x58235e,_0x51067c){var _0xd4d821={'raw':!![],'where':{'id':_0x58235e[_0x7f41('0x3d')]['id']}},_0x3a87a0={};_0x3a87a0['model']=_[_0x7f41('0x26')](db[_0x7f41('0x36')]['rawAttributes']);_0x3a87a0[_0x7f41('0x25')]=_[_0x7f41('0x26')](_0x58235e[_0x7f41('0x25')]);_0x3a87a0[_0x7f41('0x27')]=_['intersection'](_0x3a87a0[_0x7f41('0x28')],_0x3a87a0['query']);_0xd4d821[_0x7f41('0x29')]=_[_0x7f41('0x3e')](_0x3a87a0[_0x7f41('0x28')],qs[_0x7f41('0x2a')](_0x58235e['query'][_0x7f41('0x2a')]));_0xd4d821[_0x7f41('0x29')]=_0xd4d821[_0x7f41('0x29')]['length']?_0xd4d821[_0x7f41('0x29')]:_0x3a87a0['model'];if(_0x58235e['query'][_0x7f41('0x37')]){_0xd4d821[_0x7f41('0x38')]=[{'all':!![]}];}_0xd4d821=_[_0x7f41('0x34')]({},_0xd4d821,_0x58235e[_0x7f41('0x35')]);return db[_0x7f41('0x36')][_0x7f41('0x3f')](_0xd4d821)[_0x7f41('0x1d')](handleEntityNotFound(_0x51067c,null))[_0x7f41('0x1d')](respondWithResult(_0x51067c,null))[_0x7f41('0x3b')](handleError(_0x51067c,null));};exports[_0x7f41('0x40')]=function(_0x319a90,_0x12d73f){return db['WhatsappApplication'][_0x7f41('0x40')](_0x319a90[_0x7f41('0x41')],{})[_0x7f41('0x1d')](respondWithResult(_0x12d73f,0xc9))[_0x7f41('0x3b')](handleError(_0x12d73f,null));};exports[_0x7f41('0x42')]=function(_0x3a0b0a,_0x12ac2d){if(_0x3a0b0a[_0x7f41('0x41')]['id']){delete _0x3a0b0a[_0x7f41('0x41')]['id'];}return db['WhatsappApplication'][_0x7f41('0x3f')]({'where':{'id':_0x3a0b0a['params']['id']}})['then'](handleEntityNotFound(_0x12ac2d,null))[_0x7f41('0x1d')](saveUpdates(_0x3a0b0a[_0x7f41('0x41')],null))[_0x7f41('0x1d')](respondWithResult(_0x12ac2d,null))['catch'](handleError(_0x12ac2d,null));};exports[_0x7f41('0x1c')]=function(_0x2d20b2,_0x398e57){return db[_0x7f41('0x36')]['find']({'where':{'id':_0x2d20b2[_0x7f41('0x3d')]['id']}})['then'](handleEntityNotFound(_0x398e57,null))[_0x7f41('0x1d')](removeEntity(_0x398e57,null))[_0x7f41('0x3b')](handleError(_0x398e57,null));}; \ No newline at end of file +var _0x6050=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','WhatsappApplication'];(function(_0x4bf6d5,_0x5368a4){var _0x4f08d8=function(_0x41417a){while(--_0x41417a){_0x4bf6d5['push'](_0x4bf6d5['shift']());}};_0x4f08d8(++_0x5368a4);}(_0x6050,0x196));var _0x0605=function(_0x345e1b,_0x309fb8){_0x345e1b=_0x345e1b-0x0;var _0x256c78=_0x6050[_0x345e1b];return _0x256c78;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['WhatsappApplication'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['WhatsappApplication'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5c9c81f..00726c1 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 _0x3561=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x47e8bb,_0xb69893){var _0x923a4e=function(_0x55a1cd){while(--_0x55a1cd){_0x47e8bb['push'](_0x47e8bb['shift']());}};_0x923a4e(++_0xb69893);}(_0x3561,0x94));var _0x1356=function(_0x3b3d19,_0x140025){_0x3b3d19=_0x3b3d19-0x0;var _0x47369a=_0x3561[_0x3b3d19];return _0x47369a;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var logger=require(_0x1356('0x1'))(_0x1356('0x2'));var moment=require(_0x1356('0x3'));var BPromise=require(_0x1356('0x4'));var rp=require(_0x1356('0x5'));var fs=require('fs');var path=require(_0x1356('0x6'));var rimraf=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var attributes=require(_0x1356('0x9'));module[_0x1356('0xa')]=function(_0x417d11,_0x36e81f){return _0x417d11[_0x1356('0xb')]('WhatsappApplication',attributes,{'tableName':_0x1356('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1356('0xd'),'collate':_0x1356('0xe')});}; \ No newline at end of file +var _0xed1f=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xed1f,0x6a));var _0xfed1=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xed1f[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfed1('0xf'),'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 877920b..3d5b432 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 _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0x99e9,0xb4));var _0x999e=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x99e9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0xaa5994,_0x382c42){var _0x171099=function(_0x2969af){while(--_0x2969af){_0xaa5994['push'](_0xaa5994['shift']());}};_0x171099(++_0x382c42);}(_0x55ca,0x126));var _0xa55c=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x55ca[_0xfd5f37];return _0x11bd01;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5774748..edb1ddc 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 _0x90b5=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x24053a,_0xaf8a42){var _0x56aff8=function(_0x3efe93){while(--_0x3efe93){_0x24053a['push'](_0x24053a['shift']());}};_0x56aff8(++_0xaf8a42);}(_0x90b5,0x139));var _0x590b=function(_0x24b22f,_0x1ea6d7){_0x24b22f=_0x24b22f-0x0;var _0x3e138d=_0x90b5[_0x24b22f];return _0x3e138d;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0x7')](_0x590b('0xe'),auth['isAuthenticated'](),controller[_0x590b('0xf')]);router[_0x590b('0x7')]('/:id/download',auth[_0x590b('0x8')](),controller['download']);router[_0x590b('0x10')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);router[_0x590b('0x10')]('/:id/messages',auth[_0x590b('0x8')](),controller[_0x590b('0x12')]);router[_0x590b('0x10')](_0x590b('0x13'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x16')),controller[_0x590b('0x17')]);router[_0x590b('0x18')](_0x590b('0xc'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x19')),controller['update']);router[_0x590b('0x1a')]('/:id',auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x590b('0x1a')]('/:id/tags',auth[_0x590b('0x8')](),controller[_0x590b('0x1b')]);module[_0x590b('0x1c')]=router; \ No newline at end of file +var _0x4351=['whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','download','post','/:id/tags','whatsappinteraction:addtags','put','tracked','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x5e90d4,_0x4c5748){var _0x117c7e=function(_0x4afd35){while(--_0x4afd35){_0x5e90d4['push'](_0x5e90d4['shift']());}};_0x117c7e(++_0x4c5748);}(_0x4351,0x1b5));var _0x1435=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4351[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var fs_extra=require(_0x1435('0x6'));var auth=require(_0x1435('0x7'));var interaction=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var controller=require(_0x1435('0xa'));router[_0x1435('0xb')]('/',auth[_0x1435('0xc')](),controller[_0x1435('0xd')]);router[_0x1435('0xb')]('/describe',auth[_0x1435('0xc')](),controller['describe']);router['get'](_0x1435('0xe'),auth[_0x1435('0xc')](),controller[_0x1435('0xf')]);router[_0x1435('0xb')](_0x1435('0x10'),auth['isAuthenticated'](),controller[_0x1435('0x11')]);router[_0x1435('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x1435('0x12')]);router['post']('/',auth[_0x1435('0xc')](),controller['create']);router[_0x1435('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1435('0x13')](_0x1435('0x14'),auth[_0x1435('0xc')](),interaction['tracked']('whatsapp',_0x1435('0x15')),controller['addTags']);router[_0x1435('0x16')](_0x1435('0xe'),auth[_0x1435('0xc')](),interaction[_0x1435('0x17')](_0x1435('0x18'),_0x1435('0x19')),controller[_0x1435('0x1a')]);router[_0x1435('0x1b')](_0x1435('0xe'),auth[_0x1435('0xc')](),interaction[_0x1435('0x17')](_0x1435('0x18'),_0x1435('0x1c')),controller[_0x1435('0x1d')]);router[_0x1435('0x1b')]('/:id/tags',auth[_0x1435('0xc')](),controller[_0x1435('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 14fe577..790e601 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 _0x2087=['ENUM','DATE','out','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x49743a,_0x292eec){var _0x4c32ad=function(_0x58835f){while(--_0x58835f){_0x49743a['push'](_0x49743a['shift']());}};_0x4c32ad(++_0x292eec);}(_0x2087,0xf3));var _0x7208=function(_0x443f10,_0x5ce66f){_0x443f10=_0x443f10-0x0;var _0x495478=_0x2087[_0x443f10];return _0x495478;};'use strict';var Sequelize=require(_0x7208('0x0'));var moment=require(_0x7208('0x1'));module[_0x7208('0x2')]={'closed':{'type':Sequelize[_0x7208('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7208('0x4')]},'secondDisposition':{'type':Sequelize[_0x7208('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7208('0x4')]},'note':{'type':Sequelize[_0x7208('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7208('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7208('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7208('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7208('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1561=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xb4f45e,_0x12a099){var _0x4795cd=function(_0x4dfd66){while(--_0x4dfd66){_0xb4f45e['push'](_0xb4f45e['shift']());}};_0x4795cd(++_0x12a099);}(_0x1561,0x1bd));var _0x1156=function(_0x4af285,_0x22dd16){_0x4af285=_0x4af285-0x0;var _0x1939ff=_0x1561[_0x4af285];return _0x1939ff;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1156('0x0')]={'closed':{'type':Sequelize[_0x1156('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1156('0x2')]},'disposition':{'type':Sequelize[_0x1156('0x3')]},'secondDisposition':{'type':Sequelize[_0x1156('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1156('0x3')]},'phone':{'type':Sequelize[_0x1156('0x3')]},'read1stAt':{'type':Sequelize[_0x1156('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1156('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1156('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1156('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1156('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 8ca9f37..a74092e 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 _0xd82a=['Users','map','fullname','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','User','UserId','body','start','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','params','WhatsappInteraction','create','update','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','nolimit','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','removeTags','join','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','mkdirSync','Owner','N.A.','closed','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','root','views','transcript-','Whatsapp','download','log','err','unlinkSync','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send'];(function(_0x460c38,_0x257274){var _0x1486b8=function(_0x40d2c1){while(--_0x40d2c1){_0x460c38['push'](_0x460c38['shift']());}};_0x1486b8(++_0x257274);}(_0xd82a,0xbd));var _0xad82=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xd82a[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xad82('0x0'));var rimraf=require(_0xad82('0x1'));var zipdir=require(_0xad82('0x2'));var jsonpatch=require(_0xad82('0x3'));var rp=require('request-promise');var moment=require(_0xad82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad82('0x5'));var util=require(_0xad82('0x6'));var path=require(_0xad82('0x7'));var sox=require(_0xad82('0x8'));var csv=require(_0xad82('0x9'));var ejs=require(_0xad82('0xa'));var fs=require('fs');var fs_extra=require(_0xad82('0xb'));var _=require(_0xad82('0xc'));var squel=require(_0xad82('0xd'));var crypto=require(_0xad82('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad82('0xf'));var toCsv=require(_0xad82('0x9'));var querystring=require(_0xad82('0x10'));var Papa=require(_0xad82('0x11'));var Redis=require(_0xad82('0x12'));var authService=require(_0xad82('0x13'));var qs=require(_0xad82('0x14'));var as=require(_0xad82('0x15'));var pdf=require(_0xad82('0x16'));var hardwareService=require(_0xad82('0x17'));var logger=require(_0xad82('0x18'))(_0xad82('0x19'));var utils=require(_0xad82('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xad82('0x1b'));var db=require('../../mysqldb')['db'];config[_0xad82('0x1c')]=_['defaults'](config[_0xad82('0x1c')],{'host':_0xad82('0x1d'),'port':0x18eb});var socket=require(_0xad82('0x1e'))(new Redis(config[_0xad82('0x1c')]));require(_0xad82('0x1f'))[_0xad82('0x20')](socket);function respondWithStatusCode(_0x4c59de,_0x403079){_0x403079=_0x403079||0xcc;return function(_0x4cc267){if(_0x4cc267){return _0x4c59de[_0xad82('0x21')](_0x403079);}return _0x4c59de[_0xad82('0x22')](_0x403079)[_0xad82('0x23')]();};}function respondWithResult(_0x2f4e1b,_0x2535e8){_0x2535e8=_0x2535e8||0xc8;return function(_0x298948){if(_0x298948){return _0x2f4e1b[_0xad82('0x22')](_0x2535e8)[_0xad82('0x24')](_0x298948);}};}function respondWithFilteredResult(_0x176baa,_0x3c95d8){return function(_0xcd4d7b){if(_0xcd4d7b){var _0x130aa3=typeof _0x3c95d8[_0xad82('0x25')]===_0xad82('0x26')&&typeof _0x3c95d8[_0xad82('0x27')]===_0xad82('0x26');var _0x54eaf4=_0xcd4d7b[_0xad82('0x28')];var _0x32c9b7=_0x130aa3?0x0:_0x3c95d8['offset'];var _0x43c86e=_0x130aa3?_0xcd4d7b['count']:_0x3c95d8[_0xad82('0x25')]+_0x3c95d8[_0xad82('0x27')];var _0x4808e4;if(_0x43c86e>=_0x54eaf4){_0x43c86e=_0x54eaf4;_0x4808e4=0xc8;}else{_0x4808e4=0xce;}_0x176baa[_0xad82('0x22')](_0x4808e4);return _0x176baa[_0xad82('0x29')](_0xad82('0x2a'),_0x32c9b7+'-'+_0x43c86e+'/'+_0x54eaf4)[_0xad82('0x24')](_0xcd4d7b);}return null;};}function patchUpdates(_0x47b32c){return function(_0xe5b49e){try{jsonpatch[_0xad82('0x2b')](_0xe5b49e,_0x47b32c,!![]);}catch(_0x4be179){return BPromise[_0xad82('0x2c')](_0x4be179);}return _0xe5b49e[_0xad82('0x2d')]();};}function saveUpdates(_0x42e9bc,_0x330874){return function(_0x538b03){if(_0x538b03){return _0x538b03['update'](_0x42e9bc)[_0xad82('0x2e')](function(_0x1630a7){return _0x1630a7;});}return null;};}function removeEntity(_0x4157d5,_0x4398a3){return function(_0xad7f3b){if(_0xad7f3b){return _0xad7f3b[_0xad82('0x2f')]()[_0xad82('0x2e')](function(){_0x4157d5[_0xad82('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339572,_0x5bb973){return function(_0x10be48){if(!_0x10be48){_0x339572['sendStatus'](0x194);}return _0x10be48;};}function handleError(_0x3fa18a,_0x3443f4){_0x3443f4=_0x3443f4||0x1f4;return function(_0x9ddc72){logger[_0xad82('0x30')](_0x9ddc72['stack']);if(_0x9ddc72[_0xad82('0x31')]){delete _0x9ddc72['name'];}_0x3fa18a[_0xad82('0x22')](_0x3443f4)[_0xad82('0x32')](_0x9ddc72);};}function getInteractionUsers(_0x338e0f,_0x858e8){return new BPromise(function(_0x54e9f0,_0x18ad17){try{if(_0x858e8[_0x338e0f['id']]){_0x338e0f[_0xad82('0x33')]=_[_0xad82('0x34')](_0x858e8[_0x338e0f['id']],function(_0x39d410){return{'id':_0x39d410['id'],'fullname':_0x39d410[_0xad82('0x35')]};});}}catch(_0x27ffc7){_0x18ad17(_0x27ffc7);}_0x54e9f0(_0x338e0f);});}function getInteractionTags(_0x4c01c1,_0x300141){return new BPromise(function(_0x1491fd,_0x538a66){try{if(_0x4c01c1[_0xad82('0x36')]){_0x4c01c1['Tags']=[];_0x4c01c1['TagIds'][_0xad82('0x37')](',')[_0xad82('0x38')](function(_0x3882c8){_0x4c01c1['Tags'][_0xad82('0x39')](_0x300141[_0x3882c8]);});}delete _0x4c01c1[_0xad82('0x36')];}catch(_0x3d55fe){_0x538a66(_0x3d55fe);}_0x1491fd(_0x4c01c1);});}function updateWhatsappInteraction(_0x5b5981,_0x53dd73,_0x7e0919){return new BPromise(function(_0x140e84,_0x1bb55c){return getInteractionUsers(_0x5b5981,_0x7e0919)['then'](function(_0x4178f1){return getInteractionTags(_0x4178f1,_0x53dd73);})['then'](function(_0x323f98){_0x140e84(_0x323f98);})[_0xad82('0x3a')](function(_0x3990cb){_0x1bb55c(_0x3990cb);});});}exports['index']=function(_0x4c6092,_0x1c5053){var _0x35466f={},_0x4c99b4={},_0x330352={'count':0x0,'rows':[]};var _0x54483b=_[_0xad82('0x34')](db['WhatsappInteraction'][_0xad82('0x3b')],function(_0x3f6ba9){return{'name':_0x3f6ba9[_0xad82('0x3c')],'type':_0x3f6ba9[_0xad82('0x3d')]['key']};});_0x4c99b4['model']=_[_0xad82('0x34')](_0x54483b,_0xad82('0x31'));_0x4c99b4[_0xad82('0x3e')]=_[_0xad82('0x3f')](_0x4c6092[_0xad82('0x3e')]);_0x4c99b4[_0xad82('0x40')]=_[_0xad82('0x41')](_0x4c99b4[_0xad82('0x42')],_0x4c99b4[_0xad82('0x3e')]);_0x35466f[_0xad82('0x43')]=_['intersection'](_0x4c99b4['model'],qs['fields'](_0x4c6092['query']['fields']));_0x35466f[_0xad82('0x43')]=_0x35466f[_0xad82('0x43')][_0xad82('0x44')]?_0x35466f[_0xad82('0x43')]:_0x4c99b4[_0xad82('0x42')];if(!_0x4c6092[_0xad82('0x3e')][_0xad82('0x45')]('nolimit')){_0x35466f['limit']=qs[_0xad82('0x27')](_0x4c6092['query'][_0xad82('0x27')]);_0x35466f[_0xad82('0x25')]=qs[_0xad82('0x25')](_0x4c6092[_0xad82('0x3e')]['offset']);}_0x35466f[_0xad82('0x46')]=qs[_0xad82('0x47')](_0x4c6092[_0xad82('0x3e')][_0xad82('0x47')]);_0x35466f['where']=qs['filters'](_[_0xad82('0x48')](_0x4c6092['query'],_0x4c99b4[_0xad82('0x40')]),_0x54483b);var _0x461bf9=[];var _0xf5243c=squel['select']()['field']('id')[_0xad82('0x49')](_0xad82('0x31'))['field'](_0xad82('0x4a'))[_0xad82('0x4b')](_0xad82('0x4c'));var _0x4b221a=squel['select']()['field'](_0xad82('0x4d'))[_0xad82('0x49')]('u.fullname')[_0xad82('0x49')](_0xad82('0x4e'))[_0xad82('0x4b')](_0xad82('0x4f'),'ui')['left_join'](_0xad82('0x50'),'u',_0xad82('0x51'));var _0x1519a6=squel['select']()[_0xad82('0x4b')](_0xad82('0x52'),'i')[_0xad82('0x53')](_0xad82('0x54'),'c',_0xad82('0x55'))[_0xad82('0x53')]('users','o',_0xad82('0x56'))[_0xad82('0x53')](_0xad82('0x57'),'a',_0xad82('0x58'))['left_join'](_0xad82('0x59'),'me',_0xad82('0x5a'))[_0xad82('0x53')](_0xad82('0x5b'),'it',_0xad82('0x5c'))[_0xad82('0x53')](_0xad82('0x4c'),'t',_0xad82('0x5d'));var _0x4c789c=squel[_0xad82('0x5e')]();var _0x3749c2=[];var _0x3e9cf3=squel[_0xad82('0x5e')]();var _0x360407;if(_0x4c6092[_0xad82('0x3e')][_0xad82('0x5f')]){_0x360407=as[_0xad82('0x60')](_0x4c6092['query']['search']);var _0x13d3d1=_0x360407[_0xad82('0x61')];for(var _0x251455=0x0;_0x251455<_0x360407['conditions'][_0xad82('0x44')];_0x251455++){var _0x58b7c3=_0x360407[_0xad82('0x62')][_0x251455];var _0x3ca594='i';var _0xae8a3a=_[_0xad82('0x63')](_0x54483b,[_0xad82('0x31'),_0x58b7c3['field']]);if(!_0xae8a3a){switch(_0x58b7c3['field']){case _0xad82('0x64'):if(_0x58b7c3[_0xad82('0x65')]==0x1){_0x1519a6[_0xad82('0x66')]('`'+_0x58b7c3['field']+_0xad82('0x67'));}else{_0x1519a6['having']('`'+_0x58b7c3['field']+_0xad82('0x68'));}break;case _0xad82('0x69'):if(_0x58b7c3[_0xad82('0x6a')]===_0xad82('0x6b')){if(_0x58b7c3['value']['split']('\x20')['length']>0x1){_0x4c789c[_0x13d3d1](_0xad82('0x6c'),qs[_0xad82('0x6d')](_0x58b7c3[_0xad82('0x65')]),null);}else{var _0x2361fd='%'+_0x58b7c3[_0xad82('0x65')]+'%';_0x4c789c[_0x13d3d1](_0xad82('0x6e'),_0x2361fd,_0x2361fd,_0x2361fd);}}else{_0xae8a3a=_[_0xad82('0x63')](_0x54483b,['name',_0xad82('0x6f')]);_0x58b7c3['field']='ContactId';_0x4135ff=as[_0xad82('0x70')](_0x3ca594,_0xae8a3a[_0xad82('0x3d')],_0x58b7c3);_0x4c789c[_0x13d3d1](_0x4135ff[_0xad82('0x71')],_0x4135ff[_0xad82('0x65')]['start'],_0x4135ff[_0xad82('0x65')][_0xad82('0x23')]);}break;case _0xad82('0x72'):var _0xa6a666=_0x58b7c3[_0xad82('0x65')][_0xad82('0x37')](',')[_0xad82('0x34')](function(_0x104916){return Number(_0x104916);});_0xa6a666['forEach'](function(_0x227ae7){_0x3e9cf3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x227ae7+',%');});_0x3749c2=_['union'](_0x3749c2,_0xa6a666);break;case _0xad82('0x73'):if(_0x58b7c3[_0xad82('0x6a')]===_0xad82('0x6b')){_0x4c789c[_0x13d3d1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x58b7c3['value']+'%',null);}else{_0xae8a3a=_[_0xad82('0x63')](_0x54483b,['name',_0xad82('0x74')]);_0x58b7c3[_0xad82('0x49')]=_0xad82('0x74');_0x4135ff=as['buildExpression'](_0x3ca594,_0xae8a3a[_0xad82('0x3d')],_0x58b7c3);_0x4c789c[_0x13d3d1](_0x4135ff[_0xad82('0x71')],_0x4135ff['value']['start'],_0x4135ff[_0xad82('0x65')][_0xad82('0x23')]);}break;case _0xad82('0x75'):_0x4135ff=as[_0xad82('0x70')]('me',null,_0x58b7c3);_0x4c789c[_0x13d3d1](_0x4135ff[_0xad82('0x71')],_0x4135ff[_0xad82('0x65')][_0xad82('0x76')],_0x4135ff[_0xad82('0x65')][_0xad82('0x23')]);break;}}else{var _0x4135ff=as[_0xad82('0x70')](_0x3ca594,_0xae8a3a[_0xad82('0x3d')],_0x58b7c3);_0x4c789c[_0x13d3d1](_0x4135ff[_0xad82('0x71')],_0x4135ff[_0xad82('0x65')][_0xad82('0x76')],_0x4135ff['value'][_0xad82('0x23')]);}}}else{var _0x39134d=_(_0x4c6092[_0xad82('0x3e')])['keys']()[_0xad82('0x34')](function(_0x58d243){return _['some'](_0x54483b,[_0xad82('0x31'),_0x58d243])?_0x58d243:undefined;})[_0xad82('0x77')]()[_0xad82('0x65')]();if(!_[_0xad82('0x78')](_0x39134d)){_0x39134d[_0xad82('0x38')](function(_0x1c1579){if(_0x1c1579===_0xad82('0x79')){_0x1519a6[_0xad82('0x7a')](_0xad82('0x7b'),[][_0xad82('0x7c')](_0x4c6092[_0xad82('0x3e')][_0x1c1579]));}else if(_0x1c1579===_0xad82('0x7d')){var _0x2cedae=JSON[_0xad82('0x7e')](_0x4c6092['query'][_0x1c1579])['$gte'];var _0x56ec51=JSON[_0xad82('0x7e')](_0x4c6092[_0xad82('0x3e')][_0x1c1579])[_0xad82('0x7f')];_0x1519a6['where'](_0xad82('0x80'),_0x2cedae,_0x56ec51);}else{if(_0x4c6092[_0xad82('0x3e')][_0x1c1579]===_0xad82('0x81')){_0x1519a6['where']('i.'+_0x1c1579+_0xad82('0x82'));}else{_0x1519a6['where']('i.'+_0x1c1579+_0xad82('0x83'),_0x4c6092[_0xad82('0x3e')][_0x1c1579]);}}});}if(_0x4c6092['query'][_0xad82('0x84')]){if(_0x4c6092['query'][_0xad82('0x84')]==0x1){_0x1519a6[_0xad82('0x66')](_0xad82('0x85'));}else{_0x1519a6[_0xad82('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x4c6092[_0xad82('0x3e')][_0xad82('0x86')]){_0x3749c2=_[_0xad82('0x87')](_0x4c6092['query'][_0xad82('0x86')])?_0x4c6092[_0xad82('0x3e')]['tag']:new Array(_0x4c6092[_0xad82('0x3e')][_0xad82('0x86')]);_0x3749c2[_0xad82('0x38')](function(_0x2ab03a){_0x3e9cf3['or'](_0xad82('0x88'),'%,'+_0x2ab03a+',%');});}if(_0x4c6092[_0xad82('0x3e')][_0xad82('0x89')]){var _0x45aa3a=_0x4c6092[_0xad82('0x3e')]['filter'][_0xad82('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xad82('0x8b')](_0x45aa3a)){_0x4c789c['or'](_0xad82('0x8c'),_0x45aa3a+'%')['or']('i.phone\x20LIKE\x20?',_0x45aa3a+'%');}else{_0x4c789c['or'](_0xad82('0x8d'),qs['getFullTextValue'](_0x45aa3a))['or'](_0xad82('0x8e'),_0x45aa3a+'%');}}}_0x1519a6['where'](_0x4c789c);_0x1519a6[_0xad82('0x8f')](_0xad82('0x90'));var _0x3ecee3={'type':db['Sequelize'][_0xad82('0x91')][_0xad82('0x92')],'raw':!![]};var _0x570fae=_0x1519a6['clone']();_0x570fae[_0xad82('0x49')](_0xad82('0x90'));_0x570fae['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xad82('0x64'));if(_0x35466f[_0xad82('0x46')]){_0x35466f[_0xad82('0x46')]['forEach'](function(_0x56165a){var _0xeaec9=_0x56165a[0x0]===_0xad82('0x93')?_0x56165a[0x0]:'i.'+_0x56165a[0x0];_0x1519a6['order'](_0xeaec9,_0x56165a[0x1]===_0xad82('0x94')?![]:!![]);});}if(!_[_0xad82('0x78')](_0x3749c2)){_0x1519a6[_0xad82('0x66')](_0x3e9cf3);_0x570fae[_0xad82('0x7a')](_0xad82('0x95'),_0x3749c2);}BPromise[_0xad82('0x96')]()[_0xad82('0x2e')](function(){if(!_0x360407){if(_0x4c6092[_0xad82('0x3e')][_0xad82('0x79')])return;_0x570fae[_0xad82('0x7a')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1519a6[_0xad82('0x7a')](_0xad82('0x97'));return;}if(_0x4c6092[_0xad82('0x98')][_0xad82('0x99')]!==_0xad82('0x9a'))return;return _0x4c6092[_0xad82('0x98')][_0xad82('0x9b')]({'attributes':['id'],'raw':!![]})[_0xad82('0x2e')](function(_0x359823){if(_[_0xad82('0x78')](_0x359823)){_0x570fae[_0xad82('0x7a')](_0xad82('0x9c'));_0x1519a6[_0xad82('0x7a')](_0xad82('0x9c'));}else{_0x570fae[_0xad82('0x7a')](_0xad82('0x7b'),_[_0xad82('0x34')](_0x359823,'id'));_0x1519a6[_0xad82('0x7a')](_0xad82('0x7b'),_['map'](_0x359823,'id'));}});})[_0xad82('0x2e')](function(){if(_0x4c6092[_0xad82('0x98')]['role']===_0xad82('0x9a')&&!_0x360407&&!_0x4c6092[_0xad82('0x3e')][_0xad82('0x79')])return[];return db[_0xad82('0x9d')]['query'](_0x570fae[_0xad82('0x9e')](),_0x3ecee3);})[_0xad82('0x2e')](function(_0x237115){_0x330352[_0xad82('0x28')]=_0x237115['length'];if(_0x330352[_0xad82('0x28')]===0x0)return[];return db[_0xad82('0x9d')]['query'](_0xf5243c[_0xad82('0x9e')](),_0x3ecee3)[_0xad82('0x2e')](function(_0x833d45){_0x461bf9=_[_0xad82('0x9f')](_0x833d45,'id');_0x3ecee3=_[_0xad82('0xa0')](_0x3ecee3,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c6092['query'][_0xad82('0xa1')]){_0x35466f[_0xad82('0x43')][_0xad82('0x38')](function(_0x46f1dd){_0x1519a6[_0xad82('0x49')]('i.'+_0x46f1dd);});}else{_0x1519a6[_0xad82('0x49')](_0xad82('0xa2'),_0xad82('0x64'));_0x1519a6[_0xad82('0x49')](_0xad82('0xa3'),_0xad82('0xa4'));_0x1519a6['field'](_0xad82('0xa5'),_0xad82('0xa6'));_0x1519a6[_0xad82('0x49')](_0xad82('0xa7'),'contactName');_0x1519a6[_0xad82('0x49')]('i.*');_0x1519a6[_0xad82('0x49')](_0xad82('0xa8'),_0xad82('0xa9'));_0x1519a6['field'](_0xad82('0xaa'),_0xad82('0xab'));_0x1519a6[_0xad82('0x49')](_0xad82('0xac'),_0xad82('0xad'));_0x1519a6['field']('c.phone',_0xad82('0xae'));_0x1519a6[_0xad82('0x49')](_0xad82('0xaf'),_0xad82('0xb0'));_0x1519a6['field'](_0xad82('0xb1'),'Contact.fax');_0x1519a6['field'](_0xad82('0xb2'),'Owner.fullname');_0x1519a6['field']('o.internal','Owner.internal');_0x1519a6[_0xad82('0x49')](_0xad82('0xb3'),_0xad82('0x36'));}if(_0x35466f['limit'])_0x1519a6['limit'](_0x35466f[_0xad82('0x27')]);if(_0x35466f['offset'])_0x1519a6[_0xad82('0x25')](_0x35466f[_0xad82('0x25')]);return db[_0xad82('0x9d')][_0xad82('0x3e')](_0x1519a6['toString'](),_0x3ecee3);})[_0xad82('0x2e')](function(_0xbf0ac0){if(_0xbf0ac0[_0xad82('0x44')]>0x0)_0x4b221a[_0xad82('0x7a')](_0xad82('0xb4'),_['map'](_0xbf0ac0,'id'));return db[_0xad82('0x9d')][_0xad82('0x3e')](_0x4b221a['toString'](),_0x3ecee3)[_0xad82('0x2e')](function(_0x13c9b7){var _0x18fdce=_[_0xad82('0xb5')](_0x13c9b7,'WhatsappInteractionId');var _0x4ba021=[];_0xbf0ac0[_0xad82('0x38')](function(_0x51b0fd){_0x4ba021[_0xad82('0x39')](updateWhatsappInteraction(_0x51b0fd,_0x461bf9,_0x18fdce));});return BPromise['all'](_0x4ba021);});});})[_0xad82('0x2e')](function(_0x432b93){_0x330352['rows']=_0x432b93;return _0x330352;})[_0xad82('0x2e')](respondWithFilteredResult(_0x1c5053,_0x35466f))['catch'](handleError(_0x1c5053,null));};exports['show']=function(_0xf8c4dc,_0x20f4db){var _0x47a1e9={'raw':![],'where':{'id':_0xf8c4dc[_0xad82('0xb6')]['id']}},_0xe94b89={};_0xe94b89[_0xad82('0x42')]=_[_0xad82('0x3f')](db[_0xad82('0xb7')][_0xad82('0x3b')]);_0xe94b89[_0xad82('0x3e')]=_[_0xad82('0x3f')](_0xf8c4dc[_0xad82('0x3e')]);_0xe94b89[_0xad82('0x40')]=_[_0xad82('0x41')](_0xe94b89['model'],_0xe94b89[_0xad82('0x3e')]);_0x47a1e9['attributes']=_[_0xad82('0x41')](_0xe94b89[_0xad82('0x42')],qs[_0xad82('0xa1')](_0xf8c4dc[_0xad82('0x3e')][_0xad82('0xa1')]));_0x47a1e9[_0xad82('0x43')]=_0x47a1e9['attributes']['length']?_0x47a1e9['attributes']:_0xe94b89[_0xad82('0x42')];if(_0xf8c4dc['query']['includeAll']){_0x47a1e9['include']=[{'all':!![]}];}_0x47a1e9=_[_0xad82('0xa0')]({},_0x47a1e9,_0xf8c4dc['options']);return db[_0xad82('0xb7')][_0xad82('0x63')](_0x47a1e9)[_0xad82('0x2e')](handleEntityNotFound(_0x20f4db,null))[_0xad82('0x2e')](respondWithResult(_0x20f4db,null))[_0xad82('0x3a')](handleError(_0x20f4db,null));};exports[_0xad82('0xb8')]=function(_0x4962cb,_0x556382){return db[_0xad82('0xb7')][_0xad82('0xb8')](_0x4962cb[_0xad82('0x75')],{})[_0xad82('0x2e')](respondWithResult(_0x556382,0xc9))[_0xad82('0x3a')](handleError(_0x556382,null));};exports[_0xad82('0xb9')]=function(_0x21464d,_0x39d7b0){if(_0x21464d['body']['id']){delete _0x21464d['body']['id'];}return db['WhatsappInteraction'][_0xad82('0x63')]({'where':{'id':_0x21464d[_0xad82('0xb6')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x39d7b0,null))[_0xad82('0x2e')](saveUpdates(_0x21464d['body'],null))[_0xad82('0x2e')](respondWithResult(_0x39d7b0,null))[_0xad82('0x3a')](handleError(_0x39d7b0,null));};exports[_0xad82('0x2f')]=function(_0xe1ea00,_0x3bc066){return db['WhatsappInteraction']['find']({'where':{'id':_0xe1ea00[_0xad82('0xb6')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x3bc066,null))[_0xad82('0x2e')](removeEntity(_0x3bc066,null))[_0xad82('0x3a')](handleError(_0x3bc066,null));};exports['describe']=function(_0x37ac39,_0x1fb7a9){return db[_0xad82('0xb7')][_0xad82('0xba')]()[_0xad82('0x2e')](respondWithResult(_0x1fb7a9,null))[_0xad82('0x3a')](handleError(_0x1fb7a9,null));};exports[_0xad82('0xbb')]=function(_0x12d13c,_0x272903,_0x263e94){return db[_0xad82('0xbc')][_0xad82('0x63')]({'where':{'id':_0x12d13c['params']['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x272903,null))['then'](function(_0x554f71){if(_0x554f71){return _0x554f71[_0xad82('0xbb')](_0x12d13c['body']['ids'],_[_0xad82('0xbd')](_0x12d13c[_0xad82('0x75')],[_0xad82('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x272903,null))[_0xad82('0x3a')](handleError(_0x272903,null));};exports[_0xad82('0xbf')]=function(_0x10defb,_0x1a70a4,_0x299f35){var _0x58e12c={'raw':![],'where':{}};var _0x2002df={};var _0x5d48ee={'count':0x0,'rows':[]};return db[_0xad82('0xb7')][_0xad82('0xc0')]({'where':{'id':_0x10defb['params']['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x1a70a4,null))[_0xad82('0x2e')](function(_0x5cf80a){if(_0x5cf80a){_0x2002df[_0xad82('0x42')]=_[_0xad82('0x3f')](db[_0xad82('0xbc')]['rawAttributes']);_0x2002df[_0xad82('0x3e')]=_[_0xad82('0x3f')](_0x10defb['query']);_0x2002df[_0xad82('0x40')]=_[_0xad82('0x41')](_0x2002df[_0xad82('0x42')],_0x2002df['query']);_0x58e12c[_0xad82('0x43')]=_[_0xad82('0x41')](_0x2002df[_0xad82('0x42')],qs['fields'](_0x10defb[_0xad82('0x3e')][_0xad82('0xa1')]));_0x58e12c[_0xad82('0x43')]=_0x58e12c[_0xad82('0x43')][_0xad82('0x44')]?_0x58e12c[_0xad82('0x43')]:_0x2002df['model'];if(!_0x10defb[_0xad82('0x3e')]['hasOwnProperty'](_0xad82('0xc1'))){_0x58e12c[_0xad82('0x27')]=qs[_0xad82('0x27')](_0x10defb['query']['limit']);_0x58e12c[_0xad82('0x25')]=qs[_0xad82('0x25')](_0x10defb[_0xad82('0x3e')]['offset']);}_0x58e12c[_0xad82('0x46')]=qs[_0xad82('0x47')](_0x10defb[_0xad82('0x3e')][_0xad82('0x47')]);_0x58e12c[_0xad82('0x7a')]=qs[_0xad82('0x40')](_[_0xad82('0x48')](_0x10defb[_0xad82('0x3e')],_0x2002df[_0xad82('0x40')]));_0x58e12c[_0xad82('0x7a')][_0xad82('0xc2')]=_0x5cf80a['id'];if(_0x10defb['query']['filter']){_0x58e12c[_0xad82('0x7a')]=_[_0xad82('0xa0')](_0x58e12c[_0xad82('0x7a')],{'$or':_[_0xad82('0x34')](_0x58e12c[_0xad82('0x43')],function(_0x504360){var _0x1823b5={};_0x1823b5[_0x504360]={'$like':'%'+_0x10defb[_0xad82('0x3e')]['filter']+'%'};return _0x1823b5;})});}if(_0x10defb['query'][_0xad82('0xc3')]){var _0x1dd35f=_0x10defb[_0xad82('0x3e')][_0xad82('0xc3')]['split'](',');var _0x204253={};_0x204253[_0x1dd35f[0x0]]={'$gte':moment(_0x1dd35f[0x1])[_0xad82('0xc4')](_0xad82('0xc5'))};_0x58e12c[_0xad82('0x7a')]=_[_0xad82('0xa0')](_0x58e12c[_0xad82('0x7a')],_0x204253);}_0x58e12c=_[_0xad82('0xa0')]({},_0x58e12c,_0x10defb['options']);return db[_0xad82('0xbc')]['count']({'where':_0x58e12c[_0xad82('0x7a')]})[_0xad82('0x2e')](function(_0x42fafa){_0x5d48ee[_0xad82('0x28')]=_0x42fafa;if(_0x10defb[_0xad82('0x3e')]['includeAll']){_0x58e12c['include']=[{'all':!![]}];}return db[_0xad82('0xbc')][_0xad82('0xc6')](_0x58e12c);})['then'](function(_0x45feaf){_0x5d48ee[_0xad82('0xc7')]=_0x45feaf;return _0x5d48ee;});}})[_0xad82('0x2e')](respondWithFilteredResult(_0x1a70a4,_0x58e12c))[_0xad82('0x3a')](handleError(_0x1a70a4,null));};exports[_0xad82('0xc8')]=function(_0x2ced59,_0x36bf29,_0x4573a8){return db[_0xad82('0xb7')][_0xad82('0x63')]({'where':{'id':_0x2ced59[_0xad82('0xb6')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x36bf29,null))[_0xad82('0x2e')](function(_0x1512ce){if(_0x1512ce){return _0x1512ce[_0xad82('0xc9')](_0x2ced59[_0xad82('0x75')][_0xad82('0xbe')],_['omit'](_0x2ced59['body'],[_0xad82('0xbe'),'id'])||{})[_0xad82('0xca')](function(){return db[_0xad82('0x72')]['findAll']({'attributes':['id','name',_0xad82('0x4a')],'where':{'id':_0x2ced59[_0xad82('0x75')][_0xad82('0xbe')]}});})[_0xad82('0x2e')](function(_0x20f49f){socket[_0xad82('0xcb')]('whatsappInteractionTags:save',{'id':Number(_0x2ced59[_0xad82('0xb6')]['id']),'tags':_0x20f49f||[]});return{'id':Number(_0x2ced59[_0xad82('0xb6')]['id']),'tags':_0x20f49f||[]};});}})[_0xad82('0x2e')](respondWithResult(_0x36bf29,null))[_0xad82('0x3a')](handleError(_0x36bf29,null));};exports['removeTags']=function(_0x328db8,_0xe681f0,_0x1b0e72){return db[_0xad82('0xb7')][_0xad82('0x63')]({'where':{'id':_0x328db8[_0xad82('0xb6')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0xe681f0,null))[_0xad82('0x2e')](function(_0x48a179){if(_0x48a179){return _0x48a179[_0xad82('0xcc')](_0x328db8[_0xad82('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0xe681f0,null))['catch'](handleError(_0xe681f0,null));};exports['download']=function(_0x51d6f6,_0x43f8d4){var _0x26c569=moment()['unix']()[_0xad82('0x9e')]();var _0x2a7fc4=path[_0xad82('0xcd')](config['root'],_0xad82('0xce'),'files',_0xad82('0xcf'));var _0x281af8=path['join'](config['root'],_0xad82('0xce'),_0xad82('0xd0'),_0xad82('0xd1'));var _0x3c6ba1=path[_0xad82('0xcd')](_0x2a7fc4,_0x26c569);var _0x227c1b=util[_0xad82('0xc4')](_0xad82('0xd2'),_0x51d6f6[_0xad82('0xb6')]['id'],_0x26c569);var _0x3fcabe=path[_0xad82('0xcd')](_0x2a7fc4,_0x227c1b);var _0x541ff4=[];_0x541ff4[_0xad82('0x39')]({'model':db['User'],'as':_0xad82('0x73'),'attributes':['id',_0xad82('0x35')],'raw':!![]});_0x541ff4['push']({'model':db[_0xad82('0xd3')],'as':_0xad82('0x69'),'attributes':['id',_0xad82('0xd4'),_0xad82('0xd5')],'raw':!![]});if(_0x51d6f6['query'][_0xad82('0xd1')]){_0x541ff4[_0xad82('0x39')]({'model':db[_0xad82('0xd6')],'as':_0xad82('0xd6'),'raw':!![]});}var _0x19676d=[{'model':db[_0xad82('0xbc')],'as':_0xad82('0xd7'),'attributes':['id',_0xad82('0x75'),_0xad82('0x7d'),_0xad82('0xd8'),_0xad82('0xd9'),_0xad82('0x84')],'include':_0x541ff4}];_0x19676d[_0xad82('0x39')]({'model':db[_0xad82('0xda')],'as':_0xad82('0xdb'),'attributes':['id','name']});_0x19676d['push']({'model':db[_0xad82('0x73')],'as':'Owner','attributes':['id',_0xad82('0x35')]});return db['WhatsappInteraction'][_0xad82('0x63')]({'where':{'id':_0x51d6f6[_0xad82('0xb6')]['id']},'include':_0x19676d})[_0xad82('0x2e')](handleEntityNotFound(_0x43f8d4,null))[_0xad82('0x2e')](function(_0x180af4){if(_0x180af4){var _0xd81339=_0x180af4['get']({'plain':!![]});fs[_0xad82('0xdc')](_0x3c6ba1);var _0x2529bb={'channel':'Whatsapp','account':_0xd81339[_0xad82('0xdb')][_0xad82('0x31')],'agent':_0xd81339[_0xad82('0xdd')]?_0xd81339['Owner']['fullname']:_0xad82('0xde'),'createdAt':moment(_0xd81339[_0xad82('0x7d')])[_0xad82('0xc4')](_0xad82('0xc5'))['toString'](),'closedAt':_0xd81339[_0xad82('0xdf')]?moment(_0xd81339['closedAt'])[_0xad82('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0xd81339[_0xad82('0xe0')],'messages':_(_0xd81339[_0xad82('0xd7')])[_0xad82('0x89')]({'secret':![]})[_0xad82('0x34')](function(_0x4a278a){if(_0x4a278a['Attachment']){var _0x4c8773=path[_0xad82('0xcd')](_0x281af8,_0x4a278a[_0xad82('0xd6')][_0xad82('0xe1')]);if(fs[_0xad82('0xe2')](_0x4c8773)){fs[_0xad82('0xe3')](_0x4c8773)[_0xad82('0xe4')](fs[_0xad82('0xe5')](path[_0xad82('0xcd')](_0x3c6ba1,_0x4a278a[_0xad82('0xd6')][_0xad82('0xe1')])));}}return{'date':moment(_0x4a278a[_0xad82('0x7d')])[_0xad82('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xad82('0x9e')](),'sender':_0x4a278a['direction']===_0xad82('0xe6')?_0x4a278a['User']?_0x4a278a[_0xad82('0x73')][_0xad82('0x35')]:'System':_0x4a278a[_0xad82('0x69')][_0xad82('0xd4')]+(_0x4a278a[_0xad82('0x69')]['lastName']?'\x20'+_0x4a278a['Contact'][_0xad82('0xd5')]:''),'body':_0x4a278a[_0xad82('0xd6')]?_0x4a278a[_0xad82('0xd6')]['basename']:_0x4a278a[_0xad82('0x75')],'direction':_0x4a278a[_0xad82('0xd8')]==='out'?'A':'C','secret':_0x4a278a[_0xad82('0xd9')],'read':_0x4a278a[_0xad82('0x84')],'attachment':_0x4a278a[_0xad82('0xd6')]};})[_0xad82('0x65')]()};return ejs[_0xad82('0xe7')](path[_0xad82('0xcd')](config[_0xad82('0xe8')],'server',_0xad82('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x2529bb})[_0xad82('0x2e')](function(_0x57e587){var _0x3390e3=path[_0xad82('0xcd')](_0x3c6ba1,_0xad82('0xea')+_0xd81339['id']+'-'+_0x26c569+'.pdf');var _0x3dc81c={'path':_0x3390e3,'channel':_0xad82('0xeb'),'interactionId':_0xd81339['id']};return pdf['createPdfFromHTML'](_0x57e587,_0x3dc81c);})['then'](function(){return new BPromise(function(_0x28e2e2,_0x1ad066){zipdir(_0x3c6ba1,{'saveTo':_0x3fcabe},function(_0x360f6a,_0x58e11e){if(_0x360f6a)return _0x1ad066(_0x360f6a);return _0x28e2e2(_0x58e11e);});})['then'](function(){return new BPromise(function(_0x17afb1,_0x42f3dd){rimraf(_0x3c6ba1,function(_0x499661){if(_0x499661)_0x42f3dd(_0x499661);return _0x17afb1();});});})[_0xad82('0x2e')](function(){return _0x43f8d4[_0xad82('0xec')](_0x3fcabe,_0x227c1b,function(_0x43f539){if(_0x43f539){console[_0xad82('0xed')](_0xad82('0xee'),_0x43f539);}else{fs[_0xad82('0xef')](_0x3fcabe);}});});});}else{return _0x43f8d4[_0xad82('0x21')](0xc8);}})[_0xad82('0x3a')](handleError(_0x43f8d4,null));}; \ No newline at end of file +var _0xf185=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','stack','send','Users','map','fullname','TagIds','Tags','split','push','index','WhatsappInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','order','sort','where','pick','select','field','name','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','start','body','type','keys','some','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','merge','options','create','update','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','omit','spread','emit','removeTags','download','unix','join','server','files','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','Messages','Attachment','basename','existsSync','createWriteStream','direction','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment'];(function(_0x39f97c,_0x1afe73){var _0x4342e3=function(_0x51d771){while(--_0x51d771){_0x39f97c['push'](_0x39f97c['shift']());}};_0x4342e3(++_0x1afe73);}(_0xf185,0x1be));var _0x5f18=function(_0x5e6f46,_0x5de343){_0x5e6f46=_0x5e6f46-0x0;var _0x2c86f6=_0xf185[_0x5e6f46];return _0x2c86f6;};'use strict';var emlformat=require(_0x5f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f18('0x1'));var jsonpatch=require(_0x5f18('0x2'));var rp=require(_0x5f18('0x3'));var moment=require(_0x5f18('0x4'));var BPromise=require(_0x5f18('0x5'));var Mustache=require(_0x5f18('0x6'));var util=require('util');var path=require(_0x5f18('0x7'));var sox=require(_0x5f18('0x8'));var csv=require(_0x5f18('0x9'));var ejs=require(_0x5f18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f18('0xb'));var squel=require(_0x5f18('0xc'));var crypto=require('crypto');var jsforce=require(_0x5f18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5f18('0x9'));var querystring=require(_0x5f18('0xe'));var Papa=require('papaparse');var Redis=require(_0x5f18('0xf'));var authService=require(_0x5f18('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5f18('0x11'));var pdf=require(_0x5f18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f18('0x13'));var utils=require(_0x5f18('0x14'));var config=require(_0x5f18('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f18('0x16'))['db'];config[_0x5f18('0x17')]=_[_0x5f18('0x18')](config[_0x5f18('0x17')],{'host':_0x5f18('0x19'),'port':0x18eb});var socket=require(_0x5f18('0x1a'))(new Redis(config[_0x5f18('0x17')]));require(_0x5f18('0x1b'))[_0x5f18('0x1c')](socket);function respondWithStatusCode(_0x4a8150,_0x28e6ad){_0x28e6ad=_0x28e6ad||0xcc;return function(_0x51dbc3){if(_0x51dbc3){return _0x4a8150['sendStatus'](_0x28e6ad);}return _0x4a8150[_0x5f18('0x1d')](_0x28e6ad)[_0x5f18('0x1e')]();};}function respondWithResult(_0x12b0c1,_0x418048){_0x418048=_0x418048||0xc8;return function(_0x337ec1){if(_0x337ec1){return _0x12b0c1['status'](_0x418048)[_0x5f18('0x1f')](_0x337ec1);}};}function respondWithFilteredResult(_0x45cc93,_0x110916){return function(_0x2a0bb2){if(_0x2a0bb2){var _0x1d3aac=typeof _0x110916['offset']===_0x5f18('0x20')&&typeof _0x110916[_0x5f18('0x21')]===_0x5f18('0x20');var _0x53d6a4=_0x2a0bb2[_0x5f18('0x22')];var _0x14a1c2=_0x1d3aac?0x0:_0x110916['offset'];var _0x5f1562=_0x1d3aac?_0x2a0bb2[_0x5f18('0x22')]:_0x110916[_0x5f18('0x23')]+_0x110916[_0x5f18('0x21')];var _0x265093;if(_0x5f1562>=_0x53d6a4){_0x5f1562=_0x53d6a4;_0x265093=0xc8;}else{_0x265093=0xce;}_0x45cc93[_0x5f18('0x1d')](_0x265093);return _0x45cc93[_0x5f18('0x24')]('Content-Range',_0x14a1c2+'-'+_0x5f1562+'/'+_0x53d6a4)['json'](_0x2a0bb2);}return null;};}function patchUpdates(_0x36509a){return function(_0x8b8dad){try{jsonpatch['apply'](_0x8b8dad,_0x36509a,!![]);}catch(_0x29552c){return BPromise['reject'](_0x29552c);}return _0x8b8dad[_0x5f18('0x25')]();};}function saveUpdates(_0x50519a,_0x531821){return function(_0x384f55){if(_0x384f55){return _0x384f55['update'](_0x50519a)[_0x5f18('0x26')](function(_0x4a2357){return _0x4a2357;});}return null;};}function removeEntity(_0x394161,_0x463710){return function(_0x34b180){if(_0x34b180){return _0x34b180[_0x5f18('0x27')]()['then'](function(){_0x394161[_0x5f18('0x1d')](0xcc)[_0x5f18('0x1e')]();});}};}function handleEntityNotFound(_0xbbdb71,_0x20c580){return function(_0xd1340b){if(!_0xd1340b){_0xbbdb71[_0x5f18('0x28')](0x194);}return _0xd1340b;};}function handleError(_0x195f55,_0x15f5d8){_0x15f5d8=_0x15f5d8||0x1f4;return function(_0x37e766){logger['error'](_0x37e766[_0x5f18('0x29')]);if(_0x37e766['name']){delete _0x37e766['name'];}_0x195f55[_0x5f18('0x1d')](_0x15f5d8)[_0x5f18('0x2a')](_0x37e766);};}function getInteractionUsers(_0x172a4d,_0x5a4078){return new BPromise(function(_0x56617c,_0x14b545){try{if(_0x5a4078[_0x172a4d['id']]){_0x172a4d[_0x5f18('0x2b')]=_[_0x5f18('0x2c')](_0x5a4078[_0x172a4d['id']],function(_0x487b0e){return{'id':_0x487b0e['id'],'fullname':_0x487b0e[_0x5f18('0x2d')]};});}}catch(_0x262dbb){_0x14b545(_0x262dbb);}_0x56617c(_0x172a4d);});}function getInteractionTags(_0x449616,_0x5c7014){return new BPromise(function(_0x357954,_0x1d72a7){try{if(_0x449616[_0x5f18('0x2e')]){_0x449616[_0x5f18('0x2f')]=[];_0x449616['TagIds'][_0x5f18('0x30')](',')['forEach'](function(_0x2ac062){_0x449616[_0x5f18('0x2f')][_0x5f18('0x31')](_0x5c7014[_0x2ac062]);});}delete _0x449616[_0x5f18('0x2e')];}catch(_0x22afbb){_0x1d72a7(_0x22afbb);}_0x357954(_0x449616);});}function updateWhatsappInteraction(_0x6ff34e,_0x3d1083,_0x15962e){return new BPromise(function(_0x5b6aaa,_0x276548){return getInteractionUsers(_0x6ff34e,_0x15962e)['then'](function(_0x186e65){return getInteractionTags(_0x186e65,_0x3d1083);})[_0x5f18('0x26')](function(_0x224b45){_0x5b6aaa(_0x224b45);})['catch'](function(_0x52d55d){_0x276548(_0x52d55d);});});}exports[_0x5f18('0x32')]=function(_0x2dc1ef,_0x24fa0f){var _0x34a15b={},_0xece6e8={},_0x2fd94a={'count':0x0,'rows':[]};var _0x483217=_[_0x5f18('0x2c')](db[_0x5f18('0x33')][_0x5f18('0x34')],function(_0x501b28){return{'name':_0x501b28[_0x5f18('0x35')],'type':_0x501b28['type']['key']};});_0xece6e8[_0x5f18('0x36')]=_[_0x5f18('0x2c')](_0x483217,'name');_0xece6e8[_0x5f18('0x37')]=_['keys'](_0x2dc1ef[_0x5f18('0x37')]);_0xece6e8[_0x5f18('0x38')]=_[_0x5f18('0x39')](_0xece6e8[_0x5f18('0x36')],_0xece6e8['query']);_0x34a15b[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0xece6e8[_0x5f18('0x36')],qs['fields'](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x3b')]));_0x34a15b[_0x5f18('0x3a')]=_0x34a15b[_0x5f18('0x3a')]['length']?_0x34a15b[_0x5f18('0x3a')]:_0xece6e8[_0x5f18('0x36')];if(!_0x2dc1ef[_0x5f18('0x37')]['hasOwnProperty']('nolimit')){_0x34a15b[_0x5f18('0x21')]=qs[_0x5f18('0x21')](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x21')]);_0x34a15b[_0x5f18('0x23')]=qs['offset'](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x23')]);}_0x34a15b[_0x5f18('0x3c')]=qs[_0x5f18('0x3d')](_0x2dc1ef['query'][_0x5f18('0x3d')]);_0x34a15b[_0x5f18('0x3e')]=qs[_0x5f18('0x38')](_[_0x5f18('0x3f')](_0x2dc1ef[_0x5f18('0x37')],_0xece6e8[_0x5f18('0x38')]),_0x483217);var _0x4bd555=[];var _0xf468cf=squel[_0x5f18('0x40')]()[_0x5f18('0x41')]('id')[_0x5f18('0x41')](_0x5f18('0x42'))[_0x5f18('0x41')](_0x5f18('0x43'))[_0x5f18('0x44')](_0x5f18('0x45'));var _0x364455=squel[_0x5f18('0x40')]()['field']('u.id')[_0x5f18('0x41')](_0x5f18('0x46'))[_0x5f18('0x41')](_0x5f18('0x47'))['from'](_0x5f18('0x48'),'ui')['left_join'](_0x5f18('0x49'),'u',_0x5f18('0x4a'));var _0x4869b7=squel[_0x5f18('0x40')]()[_0x5f18('0x44')](_0x5f18('0x4b'),'i')[_0x5f18('0x4c')](_0x5f18('0x4d'),'c',_0x5f18('0x4e'))[_0x5f18('0x4c')]('users','o',_0x5f18('0x4f'))[_0x5f18('0x4c')](_0x5f18('0x50'),'a',_0x5f18('0x51'))[_0x5f18('0x4c')](_0x5f18('0x52'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x5f18('0x53'),'it',_0x5f18('0x54'))[_0x5f18('0x4c')](_0x5f18('0x45'),'t','t.id\x20=\x20it.TagId');var _0x129e6b=squel[_0x5f18('0x55')]();var _0x173e70=[];var _0xac94f=squel[_0x5f18('0x55')]();var _0x3ff73d;if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x56')]){_0x3ff73d=as[_0x5f18('0x57')](_0x2dc1ef[_0x5f18('0x37')]['search']);var _0x1f45b3=_0x3ff73d[_0x5f18('0x58')];for(var _0x31b989=0x0;_0x31b989<_0x3ff73d['conditions'][_0x5f18('0x59')];_0x31b989++){var _0x5381b9=_0x3ff73d[_0x5f18('0x5a')][_0x31b989];var _0x154cbd='i';var _0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5381b9[_0x5f18('0x41')]]);if(!_0x4b12a0){switch(_0x5381b9[_0x5f18('0x41')]){case _0x5f18('0x5c'):if(_0x5381b9[_0x5f18('0x5d')]==0x1){_0x4869b7[_0x5f18('0x5e')]('`'+_0x5381b9['field']+'`\x20=\x200');}else{_0x4869b7[_0x5f18('0x5e')]('`'+_0x5381b9[_0x5f18('0x41')]+_0x5f18('0x5f'));}break;case _0x5f18('0x60'):if(_0x5381b9['operator']===_0x5f18('0x61')){if(_0x5381b9[_0x5f18('0x5d')][_0x5f18('0x30')]('\x20')[_0x5f18('0x59')]>0x1){_0x129e6b[_0x1f45b3](_0x5f18('0x62'),qs['getFullTextValue'](_0x5381b9[_0x5f18('0x5d')]),null);}else{var _0x1e792d='%'+_0x5381b9['value']+'%';_0x129e6b[_0x1f45b3](_0x5f18('0x63'),_0x1e792d,_0x1e792d,_0x1e792d);}}else{_0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5f18('0x64')]);_0x5381b9[_0x5f18('0x41')]=_0x5f18('0x64');_0x34f2ff=as['buildExpression'](_0x154cbd,_0x4b12a0['type'],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff['text'],_0x34f2ff['value']['start'],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);}break;case _0x5f18('0x65'):var _0x1a8d76=_0x5381b9[_0x5f18('0x5d')][_0x5f18('0x30')](',')[_0x5f18('0x2c')](function(_0x68555f){return Number(_0x68555f);});_0x1a8d76[_0x5f18('0x66')](function(_0x56ae82){_0xac94f['or'](_0x5f18('0x67'),'%,'+_0x56ae82+',%');});_0x173e70=_[_0x5f18('0x68')](_0x173e70,_0x1a8d76);break;case _0x5f18('0x69'):if(_0x5381b9['operator']===_0x5f18('0x61')){_0x129e6b[_0x1f45b3](_0x5f18('0x6a'),'%'+_0x5381b9[_0x5f18('0x5d')]+'%',null);}else{_0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5f18('0x6b')]);_0x5381b9[_0x5f18('0x41')]=_0x5f18('0x6b');_0x34f2ff=as[_0x5f18('0x6c')](_0x154cbd,_0x4b12a0['type'],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff['value'][_0x5f18('0x1e')]);}break;case _0x5f18('0x6f'):_0x34f2ff=as['buildExpression']('me',null,_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);break;}}else{var _0x34f2ff=as[_0x5f18('0x6c')](_0x154cbd,_0x4b12a0[_0x5f18('0x70')],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);}}}else{var _0x2394e1=_(_0x2dc1ef[_0x5f18('0x37')])[_0x5f18('0x71')]()['map'](function(_0x48536b){return _[_0x5f18('0x72')](_0x483217,[_0x5f18('0x42'),_0x48536b])?_0x48536b:undefined;})['compact']()[_0x5f18('0x5d')]();if(!_['isEmpty'](_0x2394e1)){_0x2394e1['forEach'](function(_0x289215){if(_0x289215==='WhatsappAccountId'){_0x4869b7['where'](_0x5f18('0x73'),[][_0x5f18('0x74')](_0x2dc1ef[_0x5f18('0x37')][_0x289215]));}else if(_0x289215===_0x5f18('0x75')){var _0x3f696b=JSON[_0x5f18('0x76')](_0x2dc1ef['query'][_0x289215])[_0x5f18('0x77')];var _0xf8fdf8=JSON[_0x5f18('0x76')](_0x2dc1ef[_0x5f18('0x37')][_0x289215])[_0x5f18('0x78')];_0x4869b7[_0x5f18('0x3e')](_0x5f18('0x79'),_0x3f696b,_0xf8fdf8);}else{if(_0x2dc1ef[_0x5f18('0x37')][_0x289215]==='null'){_0x4869b7[_0x5f18('0x3e')]('i.'+_0x289215+_0x5f18('0x7a'));}else{_0x4869b7[_0x5f18('0x3e')]('i.'+_0x289215+_0x5f18('0x7b'),_0x2dc1ef[_0x5f18('0x37')][_0x289215]);}}});}if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7c')]){if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7c')]==0x1){_0x4869b7['having'](_0x5f18('0x7d'));}else{_0x4869b7[_0x5f18('0x5e')](_0x5f18('0x7e'));}}if(_0x2dc1ef['query'][_0x5f18('0x7f')]){_0x173e70=_[_0x5f18('0x80')](_0x2dc1ef[_0x5f18('0x37')]['tag'])?_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7f')]:new Array(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7f')]);_0x173e70[_0x5f18('0x66')](function(_0x2e3025){_0xac94f['or'](_0x5f18('0x67'),'%,'+_0x2e3025+',%');});}if(_0x2dc1ef[_0x5f18('0x37')]['filter']){var _0x31c1e9=_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x81')]['replace']('\x5c','\x5c\x5c')[_0x5f18('0x82')](/'/g,'\x27\x27');if(qs[_0x5f18('0x83')](_0x31c1e9)){_0x129e6b['or']('i.id\x20LIKE\x20?',_0x31c1e9+'%')['or'](_0x5f18('0x84'),_0x31c1e9+'%');}else{_0x129e6b['or'](_0x5f18('0x85'),qs['getFullTextValue'](_0x31c1e9))['or'](_0x5f18('0x86'),_0x31c1e9+'%');}}}_0x4869b7[_0x5f18('0x3e')](_0x129e6b);_0x4869b7[_0x5f18('0x87')](_0x5f18('0x88'));var _0x483d03={'type':db['Sequelize'][_0x5f18('0x89')][_0x5f18('0x8a')],'raw':!![]};var _0x3132f8=_0x4869b7[_0x5f18('0x8b')]();_0x3132f8[_0x5f18('0x41')](_0x5f18('0x88'));_0x3132f8[_0x5f18('0x41')](_0x5f18('0x8c'),_0x5f18('0x5c'));if(_0x34a15b[_0x5f18('0x3c')]){_0x34a15b[_0x5f18('0x3c')][_0x5f18('0x66')](function(_0x2c7966){var _0x472188=_0x2c7966[0x0]===_0x5f18('0x8d')?_0x2c7966[0x0]:'i.'+_0x2c7966[0x0];_0x4869b7[_0x5f18('0x3c')](_0x472188,_0x2c7966[0x1]===_0x5f18('0x8e')?![]:!![]);});}if(!_[_0x5f18('0x8f')](_0x173e70)){_0x4869b7['having'](_0xac94f);_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x90'),_0x173e70);}BPromise[_0x5f18('0x91')]()[_0x5f18('0x26')](function(){if(!_0x3ff73d){if(_0x2dc1ef['query']['WhatsappAccountId'])return;_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x92'));_0x4869b7['where'](_0x5f18('0x92'));return;}if(_0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x94')]!==_0x5f18('0x95'))return;return _0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d5766){if(_[_0x5f18('0x8f')](_0x4d5766)){_0x3132f8['where'](_0x5f18('0x97'));_0x4869b7['where'](_0x5f18('0x97'));}else{_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x73'),_[_0x5f18('0x2c')](_0x4d5766,'id'));_0x4869b7[_0x5f18('0x3e')]('i.WhatsappAccountId\x20IN\x20?',_[_0x5f18('0x2c')](_0x4d5766,'id'));}});})[_0x5f18('0x26')](function(){if(_0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x94')]===_0x5f18('0x95')&&!_0x3ff73d&&!_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x98')])return[];return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x3132f8[_0x5f18('0x9a')](),_0x483d03);})[_0x5f18('0x26')](function(_0x4c59c4){_0x2fd94a[_0x5f18('0x22')]=_0x4c59c4[_0x5f18('0x59')];if(_0x2fd94a['count']===0x0)return[];return db['sequelize'][_0x5f18('0x37')](_0xf468cf[_0x5f18('0x9a')](),_0x483d03)[_0x5f18('0x26')](function(_0x557e17){_0x4bd555=_[_0x5f18('0x9b')](_0x557e17,'id');_0x483d03=_['merge'](_0x483d03,{'model':db[_0x5f18('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x3b')]){_0x34a15b['attributes'][_0x5f18('0x66')](function(_0x18376e){_0x4869b7[_0x5f18('0x41')]('i.'+_0x18376e);});}else{_0x4869b7[_0x5f18('0x41')](_0x5f18('0x8c'),_0x5f18('0x5c'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0x9c'),_0x5f18('0x9d'));_0x4869b7[_0x5f18('0x41')]('a.mandatoryDisposition',_0x5f18('0x9e'));_0x4869b7['field'](_0x5f18('0x9f'),_0x5f18('0x8d'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa0'));_0x4869b7[_0x5f18('0x41')]('c.firstName','Contact.firstName');_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa1'),'Contact.lastName');_0x4869b7[_0x5f18('0x41')]('c.email',_0x5f18('0xa2'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa3'),'Contact.phone');_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa4'),_0x5f18('0xa5'));_0x4869b7[_0x5f18('0x41')]('c.fax',_0x5f18('0xa6'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa7'),_0x5f18('0xa8'));_0x4869b7[_0x5f18('0x41')]('o.internal',_0x5f18('0xa9'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xaa'),'TagIds');}if(_0x34a15b[_0x5f18('0x21')])_0x4869b7[_0x5f18('0x21')](_0x34a15b[_0x5f18('0x21')]);if(_0x34a15b[_0x5f18('0x23')])_0x4869b7[_0x5f18('0x23')](_0x34a15b[_0x5f18('0x23')]);return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x4869b7[_0x5f18('0x9a')](),_0x483d03);})[_0x5f18('0x26')](function(_0x36911d){if(_0x36911d[_0x5f18('0x59')]>0x0)_0x364455[_0x5f18('0x3e')](_0x5f18('0xab'),_['map'](_0x36911d,'id'));return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x364455[_0x5f18('0x9a')](),_0x483d03)[_0x5f18('0x26')](function(_0x51937d){var _0x2a958c=_[_0x5f18('0xac')](_0x51937d,_0x5f18('0xad'));var _0x3471ac=[];_0x36911d[_0x5f18('0x66')](function(_0xd25cd0){_0x3471ac['push'](updateWhatsappInteraction(_0xd25cd0,_0x4bd555,_0x2a958c));});return BPromise[_0x5f18('0xae')](_0x3471ac);});});})[_0x5f18('0x26')](function(_0x55feec){_0x2fd94a[_0x5f18('0xaf')]=_0x55feec;return _0x2fd94a;})[_0x5f18('0x26')](respondWithFilteredResult(_0x24fa0f,_0x34a15b))[_0x5f18('0xb0')](handleError(_0x24fa0f,null));};exports[_0x5f18('0xb1')]=function(_0x4c8186,_0x18487f){var _0xc212e7={'raw':![],'where':{'id':_0x4c8186[_0x5f18('0xb2')]['id']}},_0x59b1ba={};_0x59b1ba[_0x5f18('0x36')]=_[_0x5f18('0x71')](db[_0x5f18('0x33')]['rawAttributes']);_0x59b1ba[_0x5f18('0x37')]=_[_0x5f18('0x71')](_0x4c8186['query']);_0x59b1ba['filters']=_['intersection'](_0x59b1ba[_0x5f18('0x36')],_0x59b1ba['query']);_0xc212e7[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0x59b1ba[_0x5f18('0x36')],qs[_0x5f18('0x3b')](_0x4c8186[_0x5f18('0x37')]['fields']));_0xc212e7[_0x5f18('0x3a')]=_0xc212e7[_0x5f18('0x3a')][_0x5f18('0x59')]?_0xc212e7[_0x5f18('0x3a')]:_0x59b1ba['model'];if(_0x4c8186['query'][_0x5f18('0xb3')]){_0xc212e7['include']=[{'all':!![]}];}_0xc212e7=_[_0x5f18('0xb4')]({},_0xc212e7,_0x4c8186[_0x5f18('0xb5')]);return db[_0x5f18('0x33')][_0x5f18('0x5b')](_0xc212e7)['then'](handleEntityNotFound(_0x18487f,null))[_0x5f18('0x26')](respondWithResult(_0x18487f,null))[_0x5f18('0xb0')](handleError(_0x18487f,null));};exports[_0x5f18('0xb6')]=function(_0x2ca02d,_0x4c1616){return db[_0x5f18('0x33')]['create'](_0x2ca02d[_0x5f18('0x6f')],{})['then'](respondWithResult(_0x4c1616,0xc9))['catch'](handleError(_0x4c1616,null));};exports[_0x5f18('0xb7')]=function(_0x336ab0,_0x56154f){if(_0x336ab0[_0x5f18('0x6f')]['id']){delete _0x336ab0[_0x5f18('0x6f')]['id'];}return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x336ab0[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x56154f,null))[_0x5f18('0x26')](saveUpdates(_0x336ab0[_0x5f18('0x6f')],null))[_0x5f18('0x26')](respondWithResult(_0x56154f,null))[_0x5f18('0xb0')](handleError(_0x56154f,null));};exports['destroy']=function(_0x180945,_0x41032d){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x180945[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x41032d,null))[_0x5f18('0x26')](removeEntity(_0x41032d,null))['catch'](handleError(_0x41032d,null));};exports[_0x5f18('0xb8')]=function(_0xf51216,_0x5e9765){return db[_0x5f18('0x33')][_0x5f18('0xb8')]()['then'](respondWithResult(_0x5e9765,null))[_0x5f18('0xb0')](handleError(_0x5e9765,null));};exports['addMessage']=function(_0x319c4e,_0x2b4e5b,_0x36904c){return db[_0x5f18('0xb9')][_0x5f18('0x5b')]({'where':{'id':_0x319c4e['params']['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x2b4e5b,null))[_0x5f18('0x26')](function(_0x467e18){if(_0x467e18){return _0x467e18[_0x5f18('0xba')](_0x319c4e['body'][_0x5f18('0xbb')],_['omit'](_0x319c4e[_0x5f18('0x6f')],['ids','id'])||{});}})[_0x5f18('0x26')](respondWithResult(_0x2b4e5b,null))['catch'](handleError(_0x2b4e5b,null));};exports[_0x5f18('0xbc')]=function(_0x4e21b2,_0x4a0cb0,_0x6d129a){var _0x119000={'raw':![],'where':{}};var _0x9e3ed3={};var _0x1080b3={'count':0x0,'rows':[]};return db[_0x5f18('0x33')][_0x5f18('0xbd')]({'where':{'id':_0x4e21b2[_0x5f18('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4a0cb0,null))[_0x5f18('0x26')](function(_0x2518bf){if(_0x2518bf){_0x9e3ed3[_0x5f18('0x36')]=_[_0x5f18('0x71')](db[_0x5f18('0xb9')][_0x5f18('0x34')]);_0x9e3ed3[_0x5f18('0x37')]=_[_0x5f18('0x71')](_0x4e21b2[_0x5f18('0x37')]);_0x9e3ed3['filters']=_['intersection'](_0x9e3ed3[_0x5f18('0x36')],_0x9e3ed3[_0x5f18('0x37')]);_0x119000[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0x9e3ed3[_0x5f18('0x36')],qs['fields'](_0x4e21b2['query'][_0x5f18('0x3b')]));_0x119000[_0x5f18('0x3a')]=_0x119000[_0x5f18('0x3a')][_0x5f18('0x59')]?_0x119000['attributes']:_0x9e3ed3['model'];if(!_0x4e21b2[_0x5f18('0x37')][_0x5f18('0xbe')](_0x5f18('0xbf'))){_0x119000[_0x5f18('0x21')]=qs['limit'](_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x21')]);_0x119000[_0x5f18('0x23')]=qs['offset'](_0x4e21b2['query'][_0x5f18('0x23')]);}_0x119000[_0x5f18('0x3c')]=qs['sort'](_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x3d')]);_0x119000[_0x5f18('0x3e')]=qs[_0x5f18('0x38')](_[_0x5f18('0x3f')](_0x4e21b2[_0x5f18('0x37')],_0x9e3ed3['filters']));_0x119000['where'][_0x5f18('0xad')]=_0x2518bf['id'];if(_0x4e21b2['query'][_0x5f18('0x81')]){_0x119000[_0x5f18('0x3e')]=_['merge'](_0x119000[_0x5f18('0x3e')],{'$or':_[_0x5f18('0x2c')](_0x119000[_0x5f18('0x3a')],function(_0x5efc1c){var _0x58e0dc={};_0x58e0dc[_0x5efc1c]={'$like':'%'+_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x81')]+'%'};return _0x58e0dc;})});}if(_0x4e21b2['query']['$gte']){var _0x16f810=_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x77')]['split'](',');var _0x489656={};_0x489656[_0x16f810[0x0]]={'$gte':moment(_0x16f810[0x1])[_0x5f18('0xc0')](_0x5f18('0xc1'))};_0x119000['where']=_[_0x5f18('0xb4')](_0x119000['where'],_0x489656);}_0x119000=_['merge']({},_0x119000,_0x4e21b2[_0x5f18('0xb5')]);return db[_0x5f18('0xb9')][_0x5f18('0x22')]({'where':_0x119000[_0x5f18('0x3e')]})[_0x5f18('0x26')](function(_0x356296){_0x1080b3[_0x5f18('0x22')]=_0x356296;if(_0x4e21b2[_0x5f18('0x37')][_0x5f18('0xb3')]){_0x119000[_0x5f18('0xc2')]=[{'all':!![]}];}return db[_0x5f18('0xb9')][_0x5f18('0xc3')](_0x119000);})[_0x5f18('0x26')](function(_0x35b218){_0x1080b3[_0x5f18('0xaf')]=_0x35b218;return _0x1080b3;});}})[_0x5f18('0x26')](respondWithFilteredResult(_0x4a0cb0,_0x119000))['catch'](handleError(_0x4a0cb0,null));};exports[_0x5f18('0xc4')]=function(_0x1eb032,_0x28704d,_0x43db6e){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x1eb032[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x28704d,null))['then'](function(_0x1eabd5){if(_0x1eabd5){return _0x1eabd5['setTags'](_0x1eb032[_0x5f18('0x6f')][_0x5f18('0xbb')],_[_0x5f18('0xc5')](_0x1eb032[_0x5f18('0x6f')],['ids','id'])||{})[_0x5f18('0xc6')](function(){return db[_0x5f18('0x65')][_0x5f18('0xc3')]({'attributes':['id',_0x5f18('0x42'),'color'],'where':{'id':_0x1eb032[_0x5f18('0x6f')][_0x5f18('0xbb')]}});})[_0x5f18('0x26')](function(_0x397d2d){socket[_0x5f18('0xc7')]('whatsappInteractionTags:save',{'id':Number(_0x1eb032[_0x5f18('0xb2')]['id']),'tags':_0x397d2d||[]});return{'id':Number(_0x1eb032[_0x5f18('0xb2')]['id']),'tags':_0x397d2d||[]};});}})[_0x5f18('0x26')](respondWithResult(_0x28704d,null))[_0x5f18('0xb0')](handleError(_0x28704d,null));};exports['removeTags']=function(_0x5e7b92,_0x369340,_0x3d02b3){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x5e7b92[_0x5f18('0xb2')]['id']}})['then'](handleEntityNotFound(_0x369340,null))[_0x5f18('0x26')](function(_0xd57bb5){if(_0xd57bb5){return _0xd57bb5[_0x5f18('0xc8')](_0x5e7b92[_0x5f18('0x37')][_0x5f18('0xbb')]);}})[_0x5f18('0x26')](respondWithStatusCode(_0x369340,null))['catch'](handleError(_0x369340,null));};exports[_0x5f18('0xc9')]=function(_0x1126ce,_0x37cb4c){var _0x3c82d6=moment()[_0x5f18('0xca')]()[_0x5f18('0x9a')]();var _0x52d20f=path[_0x5f18('0xcb')](config['root'],_0x5f18('0xcc'),_0x5f18('0xcd'),'tmp');var _0x351cca=path[_0x5f18('0xcb')](config[_0x5f18('0xce')],_0x5f18('0xcc'),'files',_0x5f18('0xcf'));var _0x4db7f1=path[_0x5f18('0xcb')](_0x52d20f,_0x3c82d6);var _0x24c39f=util[_0x5f18('0xc0')](_0x5f18('0xd0'),_0x1126ce[_0x5f18('0xb2')]['id'],_0x3c82d6);var _0x45dcc0=path[_0x5f18('0xcb')](_0x52d20f,_0x24c39f);var _0x446dc7=[];_0x446dc7[_0x5f18('0x31')]({'model':db[_0x5f18('0x69')],'as':_0x5f18('0x69'),'attributes':['id',_0x5f18('0x2d')],'raw':!![]});_0x446dc7[_0x5f18('0x31')]({'model':db[_0x5f18('0xd1')],'as':'Contact','attributes':['id',_0x5f18('0xd2'),_0x5f18('0xd3')],'raw':!![]});if(_0x1126ce['query']['attachments']){_0x446dc7[_0x5f18('0x31')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1d5414=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x5f18('0x6f'),'createdAt','direction',_0x5f18('0xd4'),_0x5f18('0x7c')],'include':_0x446dc7}];_0x1d5414['push']({'model':db[_0x5f18('0xd5')],'as':_0x5f18('0xd6'),'attributes':['id',_0x5f18('0x42')]});_0x1d5414[_0x5f18('0x31')]({'model':db[_0x5f18('0x69')],'as':_0x5f18('0xd7'),'attributes':['id',_0x5f18('0x2d')]});return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x1126ce[_0x5f18('0xb2')]['id']},'include':_0x1d5414})[_0x5f18('0x26')](handleEntityNotFound(_0x37cb4c,null))['then'](function(_0x19e834){if(_0x19e834){var _0x371748=_0x19e834['get']({'plain':!![]});fs[_0x5f18('0xd8')](_0x4db7f1);var _0x5bd2e2={'channel':_0x5f18('0xd9'),'account':_0x371748['Account'][_0x5f18('0x42')],'agent':_0x371748[_0x5f18('0xd7')]?_0x371748[_0x5f18('0xd7')][_0x5f18('0x2d')]:_0x5f18('0xda'),'createdAt':moment(_0x371748['createdAt'])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')](),'closedAt':_0x371748[_0x5f18('0xdb')]?moment(_0x371748['closedAt'])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')]():'','disposition':_0x371748['disposition'],'messages':_(_0x371748[_0x5f18('0xdc')])['filter']({'secret':![]})[_0x5f18('0x2c')](function(_0x4346e4){if(_0x4346e4[_0x5f18('0xdd')]){var _0x1f0095=path[_0x5f18('0xcb')](_0x351cca,_0x4346e4[_0x5f18('0xdd')][_0x5f18('0xde')]);if(fs[_0x5f18('0xdf')](_0x1f0095)){fs['createReadStream'](_0x1f0095)['pipe'](fs[_0x5f18('0xe0')](path[_0x5f18('0xcb')](_0x4db7f1,_0x4346e4['Attachment'][_0x5f18('0xde')])));}}return{'date':moment(_0x4346e4[_0x5f18('0x75')])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')](),'sender':_0x4346e4[_0x5f18('0xe1')]==='out'?_0x4346e4[_0x5f18('0x69')]?_0x4346e4['User'][_0x5f18('0x2d')]:'System':_0x4346e4[_0x5f18('0x60')][_0x5f18('0xd2')]+(_0x4346e4['Contact'][_0x5f18('0xd3')]?'\x20'+_0x4346e4['Contact']['lastName']:''),'body':_0x4346e4['Attachment']?_0x4346e4[_0x5f18('0xdd')][_0x5f18('0xde')]:_0x4346e4['body'],'direction':_0x4346e4[_0x5f18('0xe1')]===_0x5f18('0xe2')?'A':'C','secret':_0x4346e4[_0x5f18('0xd4')],'read':_0x4346e4[_0x5f18('0x7c')],'attachment':_0x4346e4[_0x5f18('0xdd')]};})[_0x5f18('0x5d')]()};return ejs[_0x5f18('0xe3')](path['join'](config['root'],_0x5f18('0xcc'),_0x5f18('0xe4'),_0x5f18('0xe5')),{'interaction':_0x5bd2e2})[_0x5f18('0x26')](function(_0x30e69d){var _0x43ede0=path[_0x5f18('0xcb')](_0x4db7f1,_0x5f18('0xe6')+_0x371748['id']+'-'+_0x3c82d6+_0x5f18('0xe7'));var _0x1f0f8b={'path':_0x43ede0,'channel':_0x5f18('0xd9'),'interactionId':_0x371748['id']};return pdf[_0x5f18('0xe8')](_0x30e69d,_0x1f0f8b);})['then'](function(){return new BPromise(function(_0x388463,_0x522d05){zipdir(_0x4db7f1,{'saveTo':_0x45dcc0},function(_0x3cfad3,_0x2c2a6f){if(_0x3cfad3)return _0x522d05(_0x3cfad3);return _0x388463(_0x2c2a6f);});})['then'](function(){return new BPromise(function(_0xc33ae5,_0x278617){rimraf(_0x4db7f1,function(_0x239af3){if(_0x239af3)_0x278617(_0x239af3);return _0xc33ae5();});});})[_0x5f18('0x26')](function(){return _0x37cb4c[_0x5f18('0xc9')](_0x45dcc0,_0x24c39f,function(_0x4e0538){if(_0x4e0538){console[_0x5f18('0xe9')]('err',_0x4e0538);}else{fs['unlinkSync'](_0x45dcc0);}});});});}else{return _0x37cb4c[_0x5f18('0x28')](0xc8);}})['catch'](handleError(_0x37cb4c,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 9acd3d8..7683038 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 _0x8d37=['findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','getUsers','setDataValue','Users','map'];(function(_0x3d27d3,_0x2e6b8c){var _0x3ae275=function(_0xb827cc){while(--_0xb827cc){_0x3d27d3['push'](_0x3d27d3['shift']());}};_0x3ae275(++_0x2e6b8c);}(_0x8d37,0x1d5));var _0x78d3=function(_0x2ed9f5,_0x71f1a){_0x2ed9f5=_0x2ed9f5-0x0;var _0x34478d=_0x8d37[_0x2ed9f5];return _0x34478d;};'use strict';var EventEmitter=require(_0x78d3('0x0'));var WhatsappInteraction=require(_0x78d3('0x1'))['db'][_0x78d3('0x2')];var WhatsappMessage=require(_0x78d3('0x1'))['db'][_0x78d3('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x78d3('0x4'),'afterUpdate':_0x78d3('0x5'),'afterDestroy':_0x78d3('0x6')};function emitEvent(_0x2f6a55){return function(_0x1b704f,_0x1faa74,_0xe9d481){_0x1b704f[_0x78d3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8cfd85){_0x1b704f[_0x78d3('0x8')](_0x78d3('0x9'),_0x8cfd85[_0x78d3('0xa')](function(_0x3e7db0){return{'id':_0x3e7db0['id']};}));return WhatsappMessage[_0x78d3('0xb')]({'where':{'WhatsappInteractionId':_0x1b704f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x78d3('0xc')](function(_0x2a11b5){_0x1b704f[_0x78d3('0x8')](_0x78d3('0xd'),_0x2a11b5[_0x78d3('0xe')]);WhatsappInteractionEvents[_0x78d3('0xf')](_0x2f6a55+':'+_0x1b704f['id'],_0x1b704f);WhatsappInteractionEvents[_0x78d3('0xf')](_0x2f6a55,_0x1b704f);_0xe9d481(null);})[_0x78d3('0x10')](_0xe9d481(null));};}for(var e in events){if(events[_0x78d3('0x11')](e)){var event=events[e];WhatsappInteraction[_0x78d3('0x12')](e,emitEvent(event));}}module[_0x78d3('0x13')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x2e21=['remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x2e21,0xba));var _0x12e2=function(_0x4d5250,_0x2a8c80){_0x4d5250=_0x4d5250-0x0;var _0x547f14=_0x2e21[_0x4d5250];return _0x547f14;};'use strict';var EventEmitter=require(_0x12e2('0x0'));var WhatsappInteraction=require(_0x12e2('0x1'))['db'][_0x12e2('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x12e2('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x12e2('0x4'),'afterUpdate':_0x12e2('0x5'),'afterDestroy':_0x12e2('0x6')};function emitEvent(_0x1f77c5){return function(_0x359ce9,_0x46287a,_0x1f4783){_0x359ce9[_0x12e2('0x7')]({'attributes':['id'],'raw':!![]})[_0x12e2('0x8')](function(_0x2a7059){_0x359ce9[_0x12e2('0x9')](_0x12e2('0xa'),_0x2a7059['map'](function(_0x26abc1){return{'id':_0x26abc1['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x359ce9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12e2('0x8')](function(_0x57c018){_0x359ce9[_0x12e2('0x9')](_0x12e2('0xb'),_0x57c018[_0x12e2('0xc')]);WhatsappInteractionEvents['emit'](_0x1f77c5+':'+_0x359ce9['id'],_0x359ce9);WhatsappInteractionEvents[_0x12e2('0xd')](_0x1f77c5,_0x359ce9);_0x1f4783(null);})[_0x12e2('0xe')](_0x1f4783(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x12e2('0xf')](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 c51d852..874d0e6 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 _0x758c=['bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment'];(function(_0x2a098b,_0x1c5ac9){var _0xede0f9=function(_0x35ebf4){while(--_0x35ebf4){_0x2a098b['push'](_0x2a098b['shift']());}};_0xede0f9(++_0x1c5ac9);}(_0x758c,0xac));var _0xc758=function(_0x158d10,_0x1d2d17){_0x158d10=_0x158d10-0x0;var _0xfe35fb=_0x758c[_0x158d10];return _0xfe35fb;};'use strict';var _=require(_0xc758('0x0'));var util=require('util');var logger=require(_0xc758('0x1'))(_0xc758('0x2'));var moment=require(_0xc758('0x3'));var BPromise=require(_0xc758('0x4'));var rp=require(_0xc758('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc758('0x6'));var config=require(_0xc758('0x7'));var attributes=require(_0xc758('0x8'));module['exports']=function(_0x21ba40,_0x5ed6f7){return _0x21ba40['define'](_0xc758('0x9'),attributes,{'tableName':_0xc758('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x112235,_0x830591,_0x451590){if(_0x112235[_0xc758('0xb')](_0xc758('0xc'))){_0x112235[_0xc758('0xd')]=moment()[_0xc758('0xe')](_0xc758('0xf'));}_0x451590(null,_0x112235);}}});}; \ No newline at end of file +var _0x50bf=['moment','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x2a183,_0x30f0f1){var _0x37da6f=function(_0x46625f){while(--_0x46625f){_0x2a183['push'](_0x2a183['shift']());}};_0x37da6f(++_0x30f0f1);}(_0x50bf,0x106));var _0xf50b=function(_0x156703,_0x39c77f){_0x156703=_0x156703-0x0;var _0x4c5c3f=_0x50bf[_0x156703];return _0x4c5c3f;};'use strict';var _=require('lodash');var util=require(_0xf50b('0x0'));var logger=require('../../config/logger')(_0xf50b('0x1'));var moment=require(_0xf50b('0x2'));var BPromise=require('bluebird');var rp=require(_0xf50b('0x3'));var fs=require('fs');var path=require(_0xf50b('0x4'));var rimraf=require('rimraf');var config=require(_0xf50b('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xf50b('0x6')]=function(_0x5e2290,_0x455b74){return _0x5e2290[_0xf50b('0x7')](_0xf50b('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13d59c,_0x155d4d,_0x49ea71){if(_0x13d59c['changed']('closed')){_0x13d59c['closedAt']=moment()[_0xf50b('0x9')](_0xf50b('0xa'));}_0x49ea71(null,_0x13d59c);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a08d54f..d5c44a0 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 _0x62a3=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','WhatsappInteraction,\x20%s,\x20%s','message'];(function(_0x5bbe0e,_0x18c0ce){var _0x556ee6=function(_0x51e78e){while(--_0x51e78e){_0x5bbe0e['push'](_0x5bbe0e['shift']());}};_0x556ee6(++_0x18c0ce);}(_0x62a3,0xdf));var _0x362a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x62a3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x362a('0x0'));var BPromise=require(_0x362a('0x1'));var rs=require(_0x362a('0x2'));var fs=require('fs');var Redis=require(_0x362a('0x3'));var db=require(_0x362a('0x4'))['db'];var utils=require(_0x362a('0x5'));var logger=require(_0x362a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x362a('0x7'));var client=jayson[_0x362a('0x8')]['http']({'port':0x232a});config['redis']=_[_0x362a('0x9')](config[_0x362a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x362a('0xb'))(new Redis(config[_0x362a('0xa')]));require(_0x362a('0xc'))[_0x362a('0xd')](socket);function respondWithRpcPromise(_0x2cc6a6,_0x2bc875,_0x3c3eb8){return new BPromise(function(_0x54daff,_0x454197){return client['request'](_0x2cc6a6,_0x3c3eb8)[_0x362a('0xe')](function(_0x3a0a1a){logger[_0x362a('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x2bc875,_0x362a('0x10'));logger[_0x362a('0x11')](_0x362a('0x12'),_0x2bc875,'request\x20sent',JSON['stringify'](_0x3a0a1a));if(_0x3a0a1a[_0x362a('0x13')]){if(_0x3a0a1a[_0x362a('0x13')][_0x362a('0x14')]===0x1f4){logger[_0x362a('0x13')](_0x362a('0x15'),_0x2bc875,_0x3a0a1a[_0x362a('0x13')][_0x362a('0x16')]);return _0x454197(_0x3a0a1a[_0x362a('0x13')][_0x362a('0x16')]);}logger[_0x362a('0x13')](_0x362a('0x15'),_0x2bc875,_0x3a0a1a[_0x362a('0x13')][_0x362a('0x16')]);return _0x54daff(_0x3a0a1a[_0x362a('0x13')][_0x362a('0x16')]);}else{logger[_0x362a('0xf')](_0x362a('0x15'),_0x2bc875,_0x362a('0x10'));_0x54daff(_0x3a0a1a[_0x362a('0x17')][_0x362a('0x16')]);}})[_0x362a('0x18')](function(_0x229550){logger[_0x362a('0x13')](_0x362a('0x15'),_0x2bc875,_0x229550);_0x454197(_0x229550);});});}exports[_0x362a('0x19')]=function(_0x538c9c){var _0x12f2cc=this;return new Promise(function(_0xeb5e6a,_0x45a14c){return db[_0x362a('0x1a')][_0x362a('0x1b')](_0x538c9c[_0x362a('0x1c')],{'raw':_0x538c9c[_0x362a('0x1d')]?_0x538c9c[_0x362a('0x1d')][_0x362a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x538c9c[_0x362a('0x1d')]?_0x538c9c[_0x362a('0x1d')][_0x362a('0x1f')]||null:null,'attributes':_0x538c9c[_0x362a('0x1d')]?_0x538c9c[_0x362a('0x1d')][_0x362a('0x20')]||null:null,'limit':_0x538c9c[_0x362a('0x1d')]?_0x538c9c[_0x362a('0x1d')][_0x362a('0x21')]||null:null})[_0x362a('0xe')](function(_0x4b6f28){logger[_0x362a('0xf')](_0x362a('0x19'),_0x538c9c);logger['debug'](_0x362a('0x19'),_0x538c9c,JSON[_0x362a('0x22')](_0x4b6f28));_0xeb5e6a(_0x4b6f28);})['catch'](function(_0x1fd7e1){logger[_0x362a('0x13')](_0x362a('0x19'),_0x1fd7e1[_0x362a('0x16')],_0x538c9c);_0x45a14c(_0x12f2cc[_0x362a('0x13')](0x1f4,_0x1fd7e1[_0x362a('0x16')]));});});};exports[_0x362a('0x23')]=function(_0x55301c){return new Promise(function(_0x1ea62c,_0x29329f){return db['WhatsappInteraction'][_0x362a('0x24')]({'where':_0x55301c[_0x362a('0x1d')]?_0x55301c['options'][_0x362a('0x1f')]||null:null})[_0x362a('0xe')](function(_0x161fd4){if(_0x161fd4){return _0x161fd4[_0x362a('0x25')](_0x55301c['body']['ids'],_['omit'](_0x55301c[_0x362a('0x1c')],[_0x362a('0x26'),'id'])||{});}})[_0x362a('0x27')](function(_0x29f411){logger[_0x362a('0xf')](_0x362a('0x28'),_0x55301c);logger[_0x362a('0x11')](_0x362a('0x28'),_0x55301c,JSON['stringify'](_0x29f411));_0x1ea62c(_0x29f411);})[_0x362a('0x18')](function(_0x188242){logger[_0x362a('0x13')](_0x362a('0x28'),_0x188242[_0x362a('0x16')],_0x55301c);_0x29329f(_this[_0x362a('0x13')](0x1f4,_0x188242[_0x362a('0x16')]));});});}; \ No newline at end of file +var _0x41f1=['where','addTags','omit','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','defaults','redis','localhost','./whatsappInteraction.socket','register','then','info','debug','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','body','options','raw','attributes','limit','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find'];(function(_0x316d2a,_0x1ab4f3){var _0x2941c8=function(_0x2d1f75){while(--_0x2d1f75){_0x316d2a['push'](_0x316d2a['shift']());}};_0x2941c8(++_0x1ab4f3);}(_0x41f1,0x1d8));var _0x141f=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0x41f1[_0x2ecd91];return _0x3bf737;};'use strict';var _=require('lodash');var util=require(_0x141f('0x0'));var moment=require('moment');var BPromise=require(_0x141f('0x1'));var rs=require(_0x141f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x141f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x141f('0x4'))('rpc');var config=require(_0x141f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x141f('0x6')]({'port':0x232a});config['redis']=_[_0x141f('0x7')](config[_0x141f('0x8')],{'host':_0x141f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x141f('0x8')]));require(_0x141f('0xa'))[_0x141f('0xb')](socket);function respondWithRpcPromise(_0x837e4d,_0x322cd5,_0x3b927c){return new BPromise(function(_0x17b3db,_0x3c168e){return client['request'](_0x837e4d,_0x3b927c)[_0x141f('0xc')](function(_0x5e2b22){logger[_0x141f('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x322cd5,'request\x20sent');logger[_0x141f('0xe')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x322cd5,_0x141f('0xf'),JSON[_0x141f('0x10')](_0x5e2b22));if(_0x5e2b22['error']){if(_0x5e2b22[_0x141f('0x11')][_0x141f('0x12')]===0x1f4){logger[_0x141f('0x11')](_0x141f('0x13'),_0x322cd5,_0x5e2b22['error'][_0x141f('0x14')]);return _0x3c168e(_0x5e2b22['error'][_0x141f('0x14')]);}logger[_0x141f('0x11')](_0x141f('0x13'),_0x322cd5,_0x5e2b22[_0x141f('0x11')][_0x141f('0x14')]);return _0x17b3db(_0x5e2b22[_0x141f('0x11')][_0x141f('0x14')]);}else{logger['info'](_0x141f('0x13'),_0x322cd5,_0x141f('0xf'));_0x17b3db(_0x5e2b22[_0x141f('0x15')][_0x141f('0x14')]);}})['catch'](function(_0x1b30f9){logger['error'](_0x141f('0x13'),_0x322cd5,_0x1b30f9);_0x3c168e(_0x1b30f9);});});}exports[_0x141f('0x16')]=function(_0x5e610d){var _0x5c7202=this;return new Promise(function(_0x5afdc5,_0x1161f3){return db['WhatsappInteraction']['update'](_0x5e610d[_0x141f('0x17')],{'raw':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')][_0x141f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')]['where']||null:null,'attributes':_0x5e610d['options']?_0x5e610d[_0x141f('0x18')][_0x141f('0x1a')]||null:null,'limit':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')][_0x141f('0x1b')]||null:null})[_0x141f('0xc')](function(_0x2ac8e2){logger['info'](_0x141f('0x16'),_0x5e610d);logger['debug'](_0x141f('0x16'),_0x5e610d,JSON[_0x141f('0x10')](_0x2ac8e2));_0x5afdc5(_0x2ac8e2);})[_0x141f('0x1c')](function(_0x1f4c4f){logger[_0x141f('0x11')](_0x141f('0x16'),_0x1f4c4f[_0x141f('0x14')],_0x5e610d);_0x1161f3(_0x5c7202[_0x141f('0x11')](0x1f4,_0x1f4c4f[_0x141f('0x14')]));});});};exports[_0x141f('0x1d')]=function(_0x1ae163){return new Promise(function(_0x37c8ba,_0x244f25){return db[_0x141f('0x1e')][_0x141f('0x1f')]({'where':_0x1ae163[_0x141f('0x18')]?_0x1ae163[_0x141f('0x18')][_0x141f('0x20')]||null:null})['then'](function(_0xd61f1e){if(_0xd61f1e){return _0xd61f1e[_0x141f('0x21')](_0x1ae163[_0x141f('0x17')]['ids'],_[_0x141f('0x22')](_0x1ae163[_0x141f('0x17')],['ids','id'])||{});}})['spread'](function(_0x14dd77){logger['info'](_0x141f('0x23'),_0x1ae163);logger[_0x141f('0xe')]('AddTags',_0x1ae163,JSON[_0x141f('0x10')](_0x14dd77));_0x37c8ba(_0x14dd77);})[_0x141f('0x1c')](function(_0x570fa7){logger[_0x141f('0x11')](_0x141f('0x23'),_0x570fa7[_0x141f('0x14')],_0x1ae163);_0x244f25(_this[_0x141f('0x11')](0x1f4,_0x570fa7[_0x141f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 5cd7d31..3eae2bb 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 _0x7c83=['./whatsappInteraction.events','save','emit','removeListener','register','length'];(function(_0x137514,_0x2bcca1){var _0x445f59=function(_0x48b34a){while(--_0x48b34a){_0x137514['push'](_0x137514['shift']());}};_0x445f59(++_0x2bcca1);}(_0x7c83,0x120));var _0x37c8=function(_0x25ffe2,_0x189f28){_0x25ffe2=_0x25ffe2-0x0;var _0x2acc4d=_0x7c83[_0x25ffe2];return _0x2acc4d;};'use strict';var WhatsappInteractionEvents=require(_0x37c8('0x0'));var events=[_0x37c8('0x1'),'remove','update'];function createListener(_0x326f5b,_0xe2111c){return function(_0x557a77){_0xe2111c[_0x37c8('0x2')](_0x326f5b,_0x557a77);};}function removeListener(_0x545e1d,_0x5c2ca4){return function(){WhatsappInteractionEvents[_0x37c8('0x3')](_0x545e1d,_0x5c2ca4);};}exports[_0x37c8('0x4')]=function(_0x54e99f){for(var _0x4248df=0x0,_0x239e30=events[_0x37c8('0x5')];_0x4248df<_0x239e30;_0x4248df++){var _0x508a04=events[_0x4248df];var _0x5c049f=createListener('whatsappInteraction:'+_0x508a04,_0x54e99f);WhatsappInteractionEvents['on'](_0x508a04,_0x5c049f);}}; \ No newline at end of file +var _0x05d0=['removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x51f900,_0x5d309f){var _0x24d395=function(_0x44b664){while(--_0x44b664){_0x51f900['push'](_0x51f900['shift']());}};_0x24d395(++_0x5d309f);}(_0x05d0,0x13e));var _0x005d=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0x05d0[_0x26e0d9];return _0x3ed4bb;};'use strict';var WhatsappInteractionEvents=require(_0x005d('0x0'));var events=[_0x005d('0x1'),_0x005d('0x2'),_0x005d('0x3')];function createListener(_0x1adfac,_0x5cea6d){return function(_0x1fd255){_0x5cea6d['emit'](_0x1adfac,_0x1fd255);};}function removeListener(_0x1dc9e6,_0x29c0c4){return function(){WhatsappInteractionEvents[_0x005d('0x4')](_0x1dc9e6,_0x29c0c4);};}exports['register']=function(_0x239efa){for(var _0x20203d=0x0,_0xbb7bd0=events[_0x005d('0x5')];_0x20203d<_0xbb7bd0;_0x20203d++){var _0x10feea=events[_0x20203d];var _0x4ba251=createListener(_0x005d('0x6')+_0x10feea,_0x239efa);WhatsappInteractionEvents['on'](_0x10feea,_0x4ba251);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d27d5cf..caa857b 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 _0x3d65=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','show','post','tracked','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','/:id/reject','delete','destroy'];(function(_0x3bd8bb,_0xfa89cd){var _0x6e5d67=function(_0x58553d){while(--_0x58553d){_0x3bd8bb['push'](_0x3bd8bb['shift']());}};_0x6e5d67(++_0xfa89cd);}(_0x3d65,0x1dd));var _0x53d6=function(_0x2f2c2c,_0x17692d){_0x2f2c2c=_0x2f2c2c-0x0;var _0x4c325b=_0x3d65[_0x2f2c2c];return _0x4c325b;};'use strict';var multer=require(_0x53d6('0x0'));var util=require('util');var path=require(_0x53d6('0x1'));var timeout=require(_0x53d6('0x2'));var express=require(_0x53d6('0x3'));var router=express[_0x53d6('0x4')]();var fs_extra=require(_0x53d6('0x5'));var auth=require(_0x53d6('0x6'));var interaction=require(_0x53d6('0x7'));var config=require(_0x53d6('0x8'));var controller=require(_0x53d6('0x9'));router[_0x53d6('0xa')]('/',auth[_0x53d6('0xb')](),controller[_0x53d6('0xc')]);router[_0x53d6('0xa')]('/describe',auth[_0x53d6('0xb')](),controller[_0x53d6('0xd')]);router[_0x53d6('0xa')]('/:id',auth[_0x53d6('0xb')](),controller[_0x53d6('0xe')]);router[_0x53d6('0xf')]('/',auth[_0x53d6('0xb')](),interaction[_0x53d6('0x10')]('whatsapp',_0x53d6('0x11')),controller[_0x53d6('0x12')]);router[_0x53d6('0xf')]('/:id/status',controller[_0x53d6('0x13')]);router[_0x53d6('0x14')](_0x53d6('0x15'),auth['isAuthenticated'](),controller[_0x53d6('0x16')]);router[_0x53d6('0x14')](_0x53d6('0x17'),auth[_0x53d6('0xb')](),controller['accept']);router[_0x53d6('0x14')](_0x53d6('0x18'),auth[_0x53d6('0xb')](),controller['reject']);router[_0x53d6('0x19')]('/:id',auth[_0x53d6('0xb')](),controller[_0x53d6('0x1a')]);module[_0x53d6('0x1b')]=router; \ No newline at end of file +var _0x9913=['/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get'];(function(_0x53a58a,_0x474bd3){var _0x2df429=function(_0x44de92){while(--_0x44de92){_0x53a58a['push'](_0x53a58a['shift']());}};_0x2df429(++_0x474bd3);}(_0x9913,0x127));var _0x3991=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0x9913[_0x514260];return _0x4ac81b;};'use strict';var multer=require(_0x3991('0x0'));var util=require(_0x3991('0x1'));var path=require(_0x3991('0x2'));var timeout=require(_0x3991('0x3'));var express=require(_0x3991('0x4'));var router=express[_0x3991('0x5')]();var fs_extra=require(_0x3991('0x6'));var auth=require(_0x3991('0x7'));var interaction=require(_0x3991('0x8'));var config=require('../../config/environment');var controller=require(_0x3991('0x9'));router['get']('/',auth[_0x3991('0xa')](),controller[_0x3991('0xb')]);router[_0x3991('0xc')](_0x3991('0xd'),auth[_0x3991('0xa')](),controller['describe']);router[_0x3991('0xc')](_0x3991('0xe'),auth[_0x3991('0xa')](),controller[_0x3991('0xf')]);router[_0x3991('0x10')]('/',auth[_0x3991('0xa')](),interaction[_0x3991('0x11')](_0x3991('0x12'),_0x3991('0x13')),controller[_0x3991('0x14')]);router['post'](_0x3991('0x15'),controller[_0x3991('0x16')]);router[_0x3991('0x17')](_0x3991('0xe'),auth[_0x3991('0xa')](),controller['update']);router[_0x3991('0x17')]('/:id/accept',auth[_0x3991('0xa')](),controller['accept']);router[_0x3991('0x17')](_0x3991('0x18'),auth[_0x3991('0xa')](),controller['reject']);router[_0x3991('0x19')](_0x3991('0xe'),auth['isAuthenticated'](),controller[_0x3991('0x1a')]);module[_0x3991('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index c496b83..053fbe6 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 _0x444a=['BOOLEAN','ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0xe47217,_0x3a35db){var _0x3dc84c=function(_0x2b5480){while(--_0x2b5480){_0xe47217['push'](_0xe47217['shift']());}};_0x3dc84c(++_0x3a35db);}(_0x444a,0x170));var _0xa444=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x444a[_0x80544e];return _0x4f9b90;};'use strict';var Sequelize=require(_0xa444('0x0'));module['exports']={'body':{'type':Sequelize[_0xa444('0x1')](_0xa444('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa444('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa444('0x4')]('in',_0xa444('0x5')),'defaultValue':_0xa444('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa444('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa444('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa444('0x1')]}}; \ No newline at end of file +var _0xe5e7=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4cccd5,_0x2c1054){var _0x5f62b9=function(_0x37310e){while(--_0x37310e){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0x5f62b9(++_0x2c1054);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x2f0340,_0x506e25){_0x2f0340=_0x2f0340-0x0;var _0xe5a7c0=_0xe5e7[_0x2f0340];return _0xe5a7c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7e5e('0x0')](_0x7e5e('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7e5e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7e5e('0x3')]('in',_0x7e5e('0x4')),'defaultValue':_0x7e5e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7e5e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7e5e('0x5')]},'readAt':{'type':Sequelize[_0x7e5e('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7e5e('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 93bfd48..ae20625 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 _0x2560=['util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','client','http','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','show','params','rawAttributes','include','find','update','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','sequelize','User','fullname','manual','interface','SIP/%s','motionChannel','event','EventManager','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','email','channel','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2560,0x103));var _0x0256=function(_0x17c436,_0x2bc32d){_0x17c436=_0x17c436-0x0;var _0x37cd10=_0x2560[_0x17c436];return _0x37cd10;};'use strict';var emlformat=require(_0x0256('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0256('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0256('0x2'));var moment=require(_0x0256('0x3'));var BPromise=require(_0x0256('0x4'));var Mustache=require('mustache');var util=require(_0x0256('0x5'));var path=require(_0x0256('0x6'));var sox=require('sox');var csv=require(_0x0256('0x7'));var ejs=require(_0x0256('0x8'));var fs=require('fs');var fs_extra=require(_0x0256('0x9'));var _=require(_0x0256('0xa'));var squel=require(_0x0256('0xb'));var crypto=require('crypto');var jsforce=require(_0x0256('0xc'));var deskjs=require(_0x0256('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0256('0xe'));var Papa=require('papaparse');var Redis=require(_0x0256('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0256('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0256('0x11'));var logger=require(_0x0256('0x12'))(_0x0256('0x13'));var utils=require(_0x0256('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0256('0x15'));var db=require(_0x0256('0x16'))['db'];config[_0x0256('0x17')]=_[_0x0256('0x18')](config[_0x0256('0x17')],{'host':_0x0256('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0256('0x17')]));require(_0x0256('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0256('0x1b')][_0x0256('0x1c')]({'port':0x232c});var client9002=jayson[_0x0256('0x1b')][_0x0256('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5f25bd,_0xca828d,_0x20fc28,_0x2a4a65){return new BPromise(function(_0x37dfe0,_0xbc77c7){var _0x1d6ba4=_0x2a4a65||client;return _0x1d6ba4['request'](_0x5f25bd,_0x20fc28)[_0x0256('0x1d')](function(_0x2787d2){logger[_0x0256('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0xca828d,'request\x20sent');logger['debug'](_0x0256('0x1f'),_0xca828d,_0x0256('0x20'),JSON[_0x0256('0x21')](_0x2787d2));if(_0x2787d2[_0x0256('0x22')]){if(_0x2787d2[_0x0256('0x22')][_0x0256('0x23')]===0x1f4){logger[_0x0256('0x22')](_0x0256('0x24'),_0xca828d,_0x2787d2[_0x0256('0x22')][_0x0256('0x25')]);return _0xbc77c7(_0x2787d2[_0x0256('0x22')][_0x0256('0x25')]);}logger[_0x0256('0x22')](_0x0256('0x24'),_0xca828d,_0x2787d2[_0x0256('0x22')][_0x0256('0x25')]);return _0x37dfe0(_0x2787d2[_0x0256('0x22')]['message']);}else{logger[_0x0256('0x1e')](_0x0256('0x24'),_0xca828d,_0x0256('0x20'));_0x37dfe0(_0x2787d2[_0x0256('0x26')]['message']);}})[_0x0256('0x27')](function(_0xc1b3f0){logger[_0x0256('0x22')](_0x0256('0x24'),_0xca828d,_0xc1b3f0);_0xbc77c7(_0xc1b3f0);});});}function respondWithStatusCode(_0x1bc939,_0x3399ce){_0x3399ce=_0x3399ce||0xcc;return function(_0x66c1b2){if(_0x66c1b2){return _0x1bc939[_0x0256('0x28')](_0x3399ce);}return _0x1bc939[_0x0256('0x29')](_0x3399ce)[_0x0256('0x2a')]();};}function respondWithResult(_0x5a8833,_0x42ce2f){_0x42ce2f=_0x42ce2f||0xc8;return function(_0x431598){if(_0x431598){return _0x5a8833[_0x0256('0x29')](_0x42ce2f)[_0x0256('0x2b')](_0x431598);}};}function respondWithFilteredResult(_0x160066,_0x583d4e){return function(_0x528c4e){if(_0x528c4e){var _0x2281ec=typeof _0x583d4e['offset']===_0x0256('0x2c')&&typeof _0x583d4e[_0x0256('0x2d')]===_0x0256('0x2c');var _0xa68ba2=_0x528c4e[_0x0256('0x2e')];var _0x2d3334=_0x2281ec?0x0:_0x583d4e['offset'];var _0x36caf7=_0x2281ec?_0x528c4e[_0x0256('0x2e')]:_0x583d4e[_0x0256('0x2f')]+_0x583d4e[_0x0256('0x2d')];var _0xd59bf6;if(_0x36caf7>=_0xa68ba2){_0x36caf7=_0xa68ba2;_0xd59bf6=0xc8;}else{_0xd59bf6=0xce;}_0x160066[_0x0256('0x29')](_0xd59bf6);return _0x160066[_0x0256('0x30')](_0x0256('0x31'),_0x2d3334+'-'+_0x36caf7+'/'+_0xa68ba2)[_0x0256('0x2b')](_0x528c4e);}return null;};}function patchUpdates(_0x1fabf5){return function(_0x26fb6b){try{jsonpatch[_0x0256('0x32')](_0x26fb6b,_0x1fabf5,!![]);}catch(_0xa1eae1){return BPromise[_0x0256('0x33')](_0xa1eae1);}return _0x26fb6b[_0x0256('0x34')]();};}function saveUpdates(_0x395e08,_0x5bf34c){return function(_0x392247){if(_0x392247){return _0x392247['update'](_0x395e08)[_0x0256('0x1d')](function(_0x2b12b3){return _0x2b12b3;});}return null;};}function removeEntity(_0xfe07ad,_0x49d50b){return function(_0x4487d8){if(_0x4487d8){return _0x4487d8[_0x0256('0x35')]()['then'](function(){_0xfe07ad[_0x0256('0x29')](0xcc)[_0x0256('0x2a')]();});}};}function handleEntityNotFound(_0x15d54b,_0x2a66b7){return function(_0x2fb100){if(!_0x2fb100){_0x15d54b['sendStatus'](0x194);}return _0x2fb100;};}function handleError(_0xb80181,_0x4b52f4){_0x4b52f4=_0x4b52f4||0x1f4;return function(_0x13d48d){logger[_0x0256('0x22')](_0x13d48d[_0x0256('0x36')]);if(_0x13d48d[_0x0256('0x37')]){delete _0x13d48d[_0x0256('0x37')];}_0xb80181['status'](_0x4b52f4)[_0x0256('0x38')](_0x13d48d);};}exports[_0x0256('0x39')]=function(_0x36f0de,_0x53b9b4){var _0x80fe62={},_0x25cfdc={},_0x5c6e11={'count':0x0,'rows':[]};var _0x5bf520=_[_0x0256('0x3a')](db[_0x0256('0x3b')]['rawAttributes'],function(_0x50a1d6){return{'name':_0x50a1d6[_0x0256('0x3c')],'type':_0x50a1d6[_0x0256('0x3d')][_0x0256('0x3e')]};});_0x25cfdc['model']=_[_0x0256('0x3a')](_0x5bf520,_0x0256('0x37'));_0x25cfdc[_0x0256('0x3f')]=_[_0x0256('0x40')](_0x36f0de[_0x0256('0x3f')]);_0x25cfdc[_0x0256('0x41')]=_[_0x0256('0x42')](_0x25cfdc[_0x0256('0x43')],_0x25cfdc[_0x0256('0x3f')]);_0x80fe62['attributes']=_[_0x0256('0x42')](_0x25cfdc['model'],qs[_0x0256('0x44')](_0x36f0de[_0x0256('0x3f')][_0x0256('0x44')]));_0x80fe62[_0x0256('0x45')]=_0x80fe62['attributes']['length']?_0x80fe62['attributes']:_0x25cfdc['model'];if(!_0x36f0de[_0x0256('0x3f')]['hasOwnProperty'](_0x0256('0x46'))){_0x80fe62[_0x0256('0x2d')]=qs[_0x0256('0x2d')](_0x36f0de['query']['limit']);_0x80fe62[_0x0256('0x2f')]=qs[_0x0256('0x2f')](_0x36f0de['query'][_0x0256('0x2f')]);}_0x80fe62[_0x0256('0x47')]=qs['sort'](_0x36f0de[_0x0256('0x3f')][_0x0256('0x48')]);_0x80fe62[_0x0256('0x49')]=qs[_0x0256('0x41')](_[_0x0256('0x4a')](_0x36f0de['query'],_0x25cfdc[_0x0256('0x41')]),_0x5bf520);if(_0x36f0de[_0x0256('0x3f')][_0x0256('0x4b')]){_0x80fe62[_0x0256('0x49')]=_[_0x0256('0x4c')](_0x80fe62['where'],{'$or':_[_0x0256('0x3a')](_0x5bf520,function(_0x37ae08){if(_0x37ae08['type']!==_0x0256('0x4d')){var _0x52f814={};_0x52f814[_0x37ae08[_0x0256('0x37')]]={'$like':'%'+_0x36f0de[_0x0256('0x3f')][_0x0256('0x4b')]+'%'};return _0x52f814;}})});}_0x80fe62=_['merge']({},_0x80fe62,_0x36f0de[_0x0256('0x4e')]);var _0x16485f={'where':_0x80fe62[_0x0256('0x49')]};return db[_0x0256('0x3b')]['count'](_0x16485f)[_0x0256('0x1d')](function(_0x47d3e9){_0x5c6e11[_0x0256('0x2e')]=_0x47d3e9;if(_0x36f0de['query'][_0x0256('0x4f')]){_0x80fe62['include']=[{'all':!![]}];}return db[_0x0256('0x3b')]['findAll'](_0x80fe62);})[_0x0256('0x1d')](function(_0x5355f2){_0x5c6e11['rows']=_0x5355f2;return _0x5c6e11;})[_0x0256('0x1d')](respondWithFilteredResult(_0x53b9b4,_0x80fe62))[_0x0256('0x27')](handleError(_0x53b9b4,null));};exports[_0x0256('0x50')]=function(_0xd7f6fc,_0x1e60ad){var _0x5ec320={'raw':!![],'where':{'id':_0xd7f6fc[_0x0256('0x51')]['id']}},_0x304a28={};_0x304a28['model']=_[_0x0256('0x40')](db[_0x0256('0x3b')][_0x0256('0x52')]);_0x304a28['query']=_['keys'](_0xd7f6fc[_0x0256('0x3f')]);_0x304a28[_0x0256('0x41')]=_['intersection'](_0x304a28[_0x0256('0x43')],_0x304a28[_0x0256('0x3f')]);_0x5ec320[_0x0256('0x45')]=_[_0x0256('0x42')](_0x304a28[_0x0256('0x43')],qs[_0x0256('0x44')](_0xd7f6fc[_0x0256('0x3f')]['fields']));_0x5ec320['attributes']=_0x5ec320[_0x0256('0x45')]['length']?_0x5ec320[_0x0256('0x45')]:_0x304a28[_0x0256('0x43')];if(_0xd7f6fc['query'][_0x0256('0x4f')]){_0x5ec320[_0x0256('0x53')]=[{'all':!![]}];}_0x5ec320=_[_0x0256('0x4c')]({},_0x5ec320,_0xd7f6fc[_0x0256('0x4e')]);return db[_0x0256('0x3b')][_0x0256('0x54')](_0x5ec320)['then'](handleEntityNotFound(_0x1e60ad,null))['then'](respondWithResult(_0x1e60ad,null))[_0x0256('0x27')](handleError(_0x1e60ad,null));};exports['create']=function(_0x5025cb,_0x176d52){return db['WhatsappMessage']['create'](_0x5025cb['body'],{})[_0x0256('0x1d')](respondWithResult(_0x176d52,0xc9))[_0x0256('0x27')](handleError(_0x176d52,null));};exports[_0x0256('0x55')]=function(_0x55d335,_0x3f3e60){if(_0x55d335[_0x0256('0x56')]['id']){delete _0x55d335[_0x0256('0x56')]['id'];}return db[_0x0256('0x3b')][_0x0256('0x54')]({'where':{'id':_0x55d335[_0x0256('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f3e60,null))[_0x0256('0x1d')](saveUpdates(_0x55d335[_0x0256('0x56')],null))[_0x0256('0x1d')](respondWithResult(_0x3f3e60,null))[_0x0256('0x27')](handleError(_0x3f3e60,null));};exports[_0x0256('0x35')]=function(_0x3ae658,_0xe3afaf){return db[_0x0256('0x3b')][_0x0256('0x54')]({'where':{'id':_0x3ae658[_0x0256('0x51')]['id']}})[_0x0256('0x1d')](handleEntityNotFound(_0xe3afaf,null))[_0x0256('0x1d')](removeEntity(_0xe3afaf,null))[_0x0256('0x27')](handleError(_0xe3afaf,null));};exports[_0x0256('0x57')]=function(_0x148612,_0x297431){return db[_0x0256('0x3b')][_0x0256('0x57')]()[_0x0256('0x1d')](respondWithResult(_0x297431,null))[_0x0256('0x27')](handleError(_0x297431,null));};var interaction_log=require(_0x0256('0x12'))(_0x0256('0x58'));exports[_0x0256('0x59')]=function(_0x3b38b6,_0x4194fc,_0x30b752){var _0x4e2adb={'agent':{},'channel':_0x0256('0x5a')};if(_0x3b38b6[_0x0256('0x56')]['id']){delete _0x3b38b6['body']['id'];}_0x3b38b6[_0x0256('0x56')][_0x0256('0x5b')]=!![];_0x3b38b6[_0x0256('0x56')][_0x0256('0x5c')]=moment()[_0x0256('0x5d')](_0x0256('0x5e'));_0x3b38b6['body'][_0x0256('0x5f')]=_0x3b38b6[_0x0256('0x56')]['UserId']||_0x3b38b6[_0x0256('0x60')]['id'];_0x4e2adb[_0x0256('0x61')]['id']=_0x3b38b6[_0x0256('0x56')][_0x0256('0x5f')];return db['WhatsappMessage']['find']({'where':{'id':_0x3b38b6[_0x0256('0x51')]['id'],'UserId':null}})[_0x0256('0x1d')](handleEntityNotFound(_0x4194fc,null))[_0x0256('0x1d')](saveUpdates(_0x3b38b6['body'],null))[_0x0256('0x1d')](function(_0x326a4c){if(_0x326a4c){_0x4e2adb[_0x0256('0x25')]=_0x326a4c[_0x0256('0x62')]({'plain':!![]});return db[_0x0256('0x63')]['find']({'where':{'id':_0x326a4c[_0x0256('0x64')]}});}return null;})[_0x0256('0x1d')](handleEntityNotFound(_0x4194fc,null))[_0x0256('0x1d')](function(_0x1b17a0){if(_0x1b17a0){return _0x1b17a0['update']({'UserId':_0x3b38b6[_0x0256('0x56')][_0x0256('0x5f')],'read1stAt':_['isNil'](_0x1b17a0[_0x0256('0x65')])?moment()['format'](_0x0256('0x5e')):undefined});}return null;})[_0x0256('0x1d')](function(_0x24b688){if(_0x24b688){_0x4e2adb[_0x0256('0x66')]=_0x24b688['get']({'plain':!![]});interaction_log[_0x0256('0x1e')](_0x0256('0x67'),_0x3b38b6[_0x0256('0x60')]['id'],_0x3b38b6[_0x0256('0x60')][_0x0256('0x37')],_0x3b38b6['user']['role'],_0x4e2adb[_0x0256('0x66')]['id'],_0x3b38b6['body']?JSON[_0x0256('0x21')](_0x3b38b6[_0x0256('0x56')]):_0x0256('0x68'));return respondWithRpcPromise('AcceptMessage',_0x0256('0x69'),_0x4e2adb);}return null;})[_0x0256('0x1d')](function(_0xfe5da7){var _0x2217dd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xfe5da7[_0x0256('0x25')][_0x0256('0x6a')];return db[_0x0256('0x6b')][_0x0256('0x3f')](_0x2217dd,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0256('0x1d')](function(_0x2234a2){return _0x2234a2;});})[_0x0256('0x1d')](function(_0x3a19c5){if(_0x3a19c5){_0x4e2adb[_0x0256('0x25')]['contact']=_0x3a19c5[0x0];if(!_0x3b38b6[_0x0256('0x56')][_0x0256('0x5f')])return;return db[_0x0256('0x6c')][_0x0256('0x54')]({'where':{'id':_0x3b38b6['body']['UserId'],'role':_0x0256('0x61')},'attributes':['id',_0x0256('0x37'),_0x0256('0x6d'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x25a1df){if(!_0x25a1df)return null;_0x4e2adb[_0x0256('0x25')]['agent']=_0x25a1df;return _0x4e2adb;})['then'](function(_0x12ce42){if(_0x12ce42){if(_0x3b38b6[_0x0256('0x56')][_0x0256('0x6e')]){_0x4e2adb[_0x0256('0x25')][_0x0256('0x6f')]=util[_0x0256('0x5d')](_0x0256('0x70'),_0x3b38b6['user']['name']);_0x4e2adb[_0x0256('0x25')]['channel']=_0x4e2adb['channel'];_0x4e2adb['message'][_0x0256('0x71')]=_0x4e2adb['channel'];_0x4e2adb['message'][_0x0256('0x72')]=_0x0256('0x59');return respondWithRpcPromise(_0x0256('0x73'),_0x0256('0x73'),{'event':'acceptmessage','message':_0x4e2adb[_0x0256('0x25')]},client9002)['then'](function(){return _0x4e2adb;});}return _0x4e2adb;}return null;})[_0x0256('0x1d')](respondWithResult(_0x4194fc,null))['catch'](handleError(_0x4194fc,null));};var interaction_log=require(_0x0256('0x12'))(_0x0256('0x58'));exports[_0x0256('0x33')]=function(_0x317a6c,_0x5b24dd,_0x3bf9dd){var _0x774269={'agent':{},'channel':_0x0256('0x5a')};if(_0x317a6c[_0x0256('0x56')]['id']){delete _0x317a6c[_0x0256('0x56')]['id'];}_0x317a6c[_0x0256('0x56')][_0x0256('0x5f')]=_0x317a6c['body'][_0x0256('0x5f')]||_0x317a6c[_0x0256('0x60')]['id'];_0x774269[_0x0256('0x61')]['id']=_0x317a6c['body'][_0x0256('0x5f')];return db[_0x0256('0x3b')][_0x0256('0x54')]({'where':{'id':_0x317a6c[_0x0256('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5b24dd,null))['then'](function(_0x197015){if(_0x197015){_0x774269['message']=_0x197015[_0x0256('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x0256('0x54')]({'where':{'id':_0x197015['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5b24dd,null))[_0x0256('0x1d')](function(_0x2557d1){if(_0x2557d1){_0x774269[_0x0256('0x66')]=_0x2557d1['get']({'plain':!![]});interaction_log[_0x0256('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x317a6c['user']['id'],_0x317a6c[_0x0256('0x60')][_0x0256('0x37')],_0x317a6c[_0x0256('0x60')][_0x0256('0x74')],_0x774269[_0x0256('0x66')]['id'],_0x317a6c['body']?JSON[_0x0256('0x21')](_0x317a6c[_0x0256('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x0256('0x75'),_0x774269);}return null;})[_0x0256('0x1d')](function(_0x233c17){var _0x7394f4=_0x0256('0x76')+_0x233c17[_0x0256('0x25')][_0x0256('0x6a')];return db[_0x0256('0x6b')][_0x0256('0x3f')](_0x7394f4,{'type':db[_0x0256('0x77')][_0x0256('0x78')]['SELECT'],'raw':!![]})[_0x0256('0x1d')](function(_0x5ad0ce){return _0x5ad0ce;});})[_0x0256('0x1d')](function(_0x36f3c3){if(_0x36f3c3){_0x774269['message'][_0x0256('0x79')]=_0x36f3c3[0x0];if(!_0x317a6c['body'][_0x0256('0x5f')])return;return db['User'][_0x0256('0x54')]({'where':{'id':_0x317a6c[_0x0256('0x56')][_0x0256('0x5f')],'role':_0x0256('0x61')},'attributes':['id',_0x0256('0x37'),_0x0256('0x6d'),_0x0256('0x7a'),'internal'],'raw':!![]});}return null;})[_0x0256('0x1d')](function(_0xaea9da){if(!_0xaea9da)return null;_0x774269['message'][_0x0256('0x61')]=_0xaea9da;return _0x774269;})[_0x0256('0x1d')](function(_0x425628){if(_0x425628){_0x425628['message']['interface']=util[_0x0256('0x5d')]('SIP/%s',_0x317a6c[_0x0256('0x60')][_0x0256('0x37')]);_0x425628[_0x0256('0x25')][_0x0256('0x7b')]=_0x774269[_0x0256('0x7b')];_0x425628[_0x0256('0x25')]['motionChannel']=_0x774269[_0x0256('0x7b')];_0x425628[_0x0256('0x25')][_0x0256('0x72')]='reject';respondWithRpcPromise(_0x0256('0x73'),_0x0256('0x73'),{'event':_0x0256('0x7c'),'message':_0x425628[_0x0256('0x25')]},client9002);return _0x774269;}return null;})[_0x0256('0x1d')](respondWithResult(_0x5b24dd,null))[_0x0256('0x27')](handleError(_0x5b24dd,null));};exports[_0x0256('0x29')]=function(_0x21ad6e,_0x2eb799,_0x44fbe6){if(_0x21ad6e[_0x0256('0x56')]['id']){delete _0x21ad6e[_0x0256('0x56')]['id'];}var _0x22243b;return db[_0x0256('0x3b')][_0x0256('0x54')]({'where':{'id':_0x21ad6e[_0x0256('0x51')]['id']}})[_0x0256('0x1d')](handleEntityNotFound(_0x2eb799,null))[_0x0256('0x1d')](function(_0xaac83c){if(_0xaac83c){_0x22243b=_0xaac83c;return db[_0x0256('0x7d')][_0x0256('0x54')]({'where':{'id':_0xaac83c['WhatsappAccountId']}});}})[_0x0256('0x1d')](handleEntityNotFound(_0x2eb799,null))[_0x0256('0x1d')](function(_0x14d66c){if(_0x14d66c){logger[_0x0256('0x7e')](_0x0256('0x7f'),'status','received\x20delivery\x20report\x20from',_0x14d66c['type'],util['inspect'](_0x21ad6e[_0x0256('0x56')],{'showHidden':![],'depth':null}));switch(_0x14d66c['type']){case _0x0256('0x80'):if(_0x21ad6e[_0x0256('0x56')][_0x0256('0x81')]&&_0x21ad6e['body']['MessageSid']===_0x22243b['messageId']&&_0x21ad6e[_0x0256('0x56')][_0x0256('0x82')]&&_0x21ad6e[_0x0256('0x56')][_0x0256('0x82')]===_0x0256('0x5b')){return _0x22243b[_0x0256('0x55')]({'read':!![]});}else{logger[_0x0256('0x22')](_0x0256('0x83'),'status',_0x0256('0x80'),util['inspect'](_0x21ad6e[_0x0256('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x22243b;}})['then'](respondWithResult(_0x2eb799,null))[_0x0256('0x27')](handleError(_0x2eb799,null));}; \ No newline at end of file +var _0xb30b=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappMessage','params','keys','rawAttributes','find','create','body','describe','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','whatsapp-interactions','WhatsappInteractionId','interaction','null','RejectMessage','rejectMessage','Sequelize','QueryTypes','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus'];(function(_0x1a0dae,_0x5a23e8){var _0x2a27d2=function(_0x4cdca5){while(--_0x4cdca5){_0x1a0dae['push'](_0x1a0dae['shift']());}};_0x2a27d2(++_0x5a23e8);}(_0xb30b,0xf4));var _0xbb30=function(_0x1d2f43,_0x4d8001){_0x1d2f43=_0x1d2f43-0x0;var _0x582740=_0xb30b[_0x1d2f43];return _0x582740;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb30('0x0'));var zipdir=require(_0xbb30('0x1'));var jsonpatch=require(_0xbb30('0x2'));var rp=require(_0xbb30('0x3'));var moment=require(_0xbb30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb30('0x5'));var util=require(_0xbb30('0x6'));var path=require(_0xbb30('0x7'));var sox=require(_0xbb30('0x8'));var csv=require(_0xbb30('0x9'));var ejs=require(_0xbb30('0xa'));var fs=require('fs');var fs_extra=require(_0xbb30('0xb'));var _=require(_0xbb30('0xc'));var squel=require(_0xbb30('0xd'));var crypto=require(_0xbb30('0xe'));var jsforce=require(_0xbb30('0xf'));var deskjs=require(_0xbb30('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbb30('0x11'));var Papa=require(_0xbb30('0x12'));var Redis=require(_0xbb30('0x13'));var authService=require(_0xbb30('0x14'));var qs=require(_0xbb30('0x15'));var as=require(_0xbb30('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb30('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb30('0x18'));var db=require('../../mysqldb')['db'];config[_0xbb30('0x19')]=_[_0xbb30('0x1a')](config[_0xbb30('0x19')],{'host':_0xbb30('0x1b'),'port':0x18eb});var socket=require(_0xbb30('0x1c'))(new Redis(config[_0xbb30('0x19')]));require(_0xbb30('0x1d'))['register'](socket);var jayson=require(_0xbb30('0x1e'));var client=jayson[_0xbb30('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xbb30('0x1f')][_0xbb30('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x237a74,_0x976ba2,_0x5d056e,_0x27ef90){return new BPromise(function(_0x1e6258,_0x562dd4){var _0x4b2957=_0x27ef90||client;return _0x4b2957[_0xbb30('0x21')](_0x237a74,_0x5d056e)[_0xbb30('0x22')](function(_0x8ab462){logger[_0xbb30('0x23')](_0xbb30('0x24'),_0x976ba2,'request\x20sent');logger[_0xbb30('0x25')](_0xbb30('0x26'),_0x976ba2,_0xbb30('0x27'),JSON[_0xbb30('0x28')](_0x8ab462));if(_0x8ab462[_0xbb30('0x29')]){if(_0x8ab462[_0xbb30('0x29')]['code']===0x1f4){logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x8ab462[_0xbb30('0x29')][_0xbb30('0x2a')]);return _0x562dd4(_0x8ab462['error'][_0xbb30('0x2a')]);}logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x8ab462[_0xbb30('0x29')]['message']);return _0x1e6258(_0x8ab462[_0xbb30('0x29')][_0xbb30('0x2a')]);}else{logger['info'](_0xbb30('0x24'),_0x976ba2,'request\x20sent');_0x1e6258(_0x8ab462[_0xbb30('0x2b')]['message']);}})[_0xbb30('0x2c')](function(_0x249827){logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x249827);_0x562dd4(_0x249827);});});}function respondWithStatusCode(_0x516558,_0x2befd9){_0x2befd9=_0x2befd9||0xcc;return function(_0x478dc4){if(_0x478dc4){return _0x516558[_0xbb30('0x2d')](_0x2befd9);}return _0x516558[_0xbb30('0x2e')](_0x2befd9)[_0xbb30('0x2f')]();};}function respondWithResult(_0x16dc60,_0x2c8aa2){_0x2c8aa2=_0x2c8aa2||0xc8;return function(_0x31e5d0){if(_0x31e5d0){return _0x16dc60[_0xbb30('0x2e')](_0x2c8aa2)[_0xbb30('0x30')](_0x31e5d0);}};}function respondWithFilteredResult(_0x29e332,_0x45d537){return function(_0x5a1c86){if(_0x5a1c86){var _0x2f3a6a=typeof _0x45d537[_0xbb30('0x31')]===_0xbb30('0x32')&&typeof _0x45d537[_0xbb30('0x33')]===_0xbb30('0x32');var _0x22e729=_0x5a1c86[_0xbb30('0x34')];var _0x2691fa=_0x2f3a6a?0x0:_0x45d537[_0xbb30('0x31')];var _0x232937=_0x2f3a6a?_0x5a1c86[_0xbb30('0x34')]:_0x45d537[_0xbb30('0x31')]+_0x45d537[_0xbb30('0x33')];var _0x33c6ad;if(_0x232937>=_0x22e729){_0x232937=_0x22e729;_0x33c6ad=0xc8;}else{_0x33c6ad=0xce;}_0x29e332[_0xbb30('0x2e')](_0x33c6ad);return _0x29e332[_0xbb30('0x35')](_0xbb30('0x36'),_0x2691fa+'-'+_0x232937+'/'+_0x22e729)[_0xbb30('0x30')](_0x5a1c86);}return null;};}function patchUpdates(_0xc56200){return function(_0x4c607d){try{jsonpatch[_0xbb30('0x37')](_0x4c607d,_0xc56200,!![]);}catch(_0x6d5ca9){return BPromise[_0xbb30('0x38')](_0x6d5ca9);}return _0x4c607d[_0xbb30('0x39')]();};}function saveUpdates(_0xb11b5b,_0x27572a){return function(_0x2cac8c){if(_0x2cac8c){return _0x2cac8c[_0xbb30('0x3a')](_0xb11b5b)['then'](function(_0x1fe0ad){return _0x1fe0ad;});}return null;};}function removeEntity(_0x24eec9,_0x2e8462){return function(_0x2c98cb){if(_0x2c98cb){return _0x2c98cb[_0xbb30('0x3b')]()[_0xbb30('0x22')](function(){_0x24eec9['status'](0xcc)[_0xbb30('0x2f')]();});}};}function handleEntityNotFound(_0x48b1bc,_0x5049ae){return function(_0x1d6f87){if(!_0x1d6f87){_0x48b1bc[_0xbb30('0x2d')](0x194);}return _0x1d6f87;};}function handleError(_0x5ad396,_0x17b4a0){_0x17b4a0=_0x17b4a0||0x1f4;return function(_0x2eafae){logger[_0xbb30('0x29')](_0x2eafae[_0xbb30('0x3c')]);if(_0x2eafae[_0xbb30('0x3d')]){delete _0x2eafae[_0xbb30('0x3d')];}_0x5ad396[_0xbb30('0x2e')](_0x17b4a0)[_0xbb30('0x3e')](_0x2eafae);};}exports[_0xbb30('0x3f')]=function(_0x3b8045,_0x153ded){var _0xeda9e={},_0xaa751b={},_0x114a2d={'count':0x0,'rows':[]};var _0x11459d=_[_0xbb30('0x40')](db['WhatsappMessage']['rawAttributes'],function(_0x4bdd1c){return{'name':_0x4bdd1c[_0xbb30('0x41')],'type':_0x4bdd1c[_0xbb30('0x42')][_0xbb30('0x43')]};});_0xaa751b[_0xbb30('0x44')]=_['map'](_0x11459d,_0xbb30('0x3d'));_0xaa751b[_0xbb30('0x45')]=_['keys'](_0x3b8045['query']);_0xaa751b[_0xbb30('0x46')]=_[_0xbb30('0x47')](_0xaa751b[_0xbb30('0x44')],_0xaa751b['query']);_0xeda9e['attributes']=_['intersection'](_0xaa751b[_0xbb30('0x44')],qs['fields'](_0x3b8045[_0xbb30('0x45')][_0xbb30('0x48')]));_0xeda9e['attributes']=_0xeda9e[_0xbb30('0x49')][_0xbb30('0x4a')]?_0xeda9e[_0xbb30('0x49')]:_0xaa751b[_0xbb30('0x44')];if(!_0x3b8045[_0xbb30('0x45')][_0xbb30('0x4b')](_0xbb30('0x4c'))){_0xeda9e[_0xbb30('0x33')]=qs[_0xbb30('0x33')](_0x3b8045['query'][_0xbb30('0x33')]);_0xeda9e[_0xbb30('0x31')]=qs[_0xbb30('0x31')](_0x3b8045[_0xbb30('0x45')][_0xbb30('0x31')]);}_0xeda9e['order']=qs[_0xbb30('0x4d')](_0x3b8045[_0xbb30('0x45')]['sort']);_0xeda9e['where']=qs[_0xbb30('0x46')](_[_0xbb30('0x4e')](_0x3b8045['query'],_0xaa751b['filters']),_0x11459d);if(_0x3b8045[_0xbb30('0x45')][_0xbb30('0x4f')]){_0xeda9e[_0xbb30('0x50')]=_[_0xbb30('0x51')](_0xeda9e['where'],{'$or':_['map'](_0x11459d,function(_0x1f8186){if(_0x1f8186[_0xbb30('0x42')]!==_0xbb30('0x52')){var _0x53f36f={};_0x53f36f[_0x1f8186[_0xbb30('0x3d')]]={'$like':'%'+_0x3b8045[_0xbb30('0x45')]['filter']+'%'};return _0x53f36f;}})});}_0xeda9e=_['merge']({},_0xeda9e,_0x3b8045[_0xbb30('0x53')]);var _0x5d8d8d={'where':_0xeda9e['where']};return db['WhatsappMessage'][_0xbb30('0x34')](_0x5d8d8d)['then'](function(_0x4eb1fe){_0x114a2d[_0xbb30('0x34')]=_0x4eb1fe;if(_0x3b8045[_0xbb30('0x45')][_0xbb30('0x54')]){_0xeda9e[_0xbb30('0x55')]=[{'all':!![]}];}return db[_0xbb30('0x56')]['findAll'](_0xeda9e);})[_0xbb30('0x22')](function(_0x28845a){_0x114a2d['rows']=_0x28845a;return _0x114a2d;})['then'](respondWithFilteredResult(_0x153ded,_0xeda9e))[_0xbb30('0x2c')](handleError(_0x153ded,null));};exports['show']=function(_0x47d3aa,_0x3b70c4){var _0x16259f={'raw':!![],'where':{'id':_0x47d3aa[_0xbb30('0x57')]['id']}},_0x114490={};_0x114490[_0xbb30('0x44')]=_[_0xbb30('0x58')](db['WhatsappMessage'][_0xbb30('0x59')]);_0x114490[_0xbb30('0x45')]=_[_0xbb30('0x58')](_0x47d3aa['query']);_0x114490[_0xbb30('0x46')]=_[_0xbb30('0x47')](_0x114490[_0xbb30('0x44')],_0x114490[_0xbb30('0x45')]);_0x16259f['attributes']=_[_0xbb30('0x47')](_0x114490['model'],qs[_0xbb30('0x48')](_0x47d3aa['query'][_0xbb30('0x48')]));_0x16259f['attributes']=_0x16259f[_0xbb30('0x49')][_0xbb30('0x4a')]?_0x16259f[_0xbb30('0x49')]:_0x114490['model'];if(_0x47d3aa[_0xbb30('0x45')][_0xbb30('0x54')]){_0x16259f['include']=[{'all':!![]}];}_0x16259f=_[_0xbb30('0x51')]({},_0x16259f,_0x47d3aa['options']);return db[_0xbb30('0x56')][_0xbb30('0x5a')](_0x16259f)[_0xbb30('0x22')](handleEntityNotFound(_0x3b70c4,null))[_0xbb30('0x22')](respondWithResult(_0x3b70c4,null))['catch'](handleError(_0x3b70c4,null));};exports[_0xbb30('0x5b')]=function(_0x35078d,_0x53a32e){return db[_0xbb30('0x56')][_0xbb30('0x5b')](_0x35078d['body'],{})[_0xbb30('0x22')](respondWithResult(_0x53a32e,0xc9))['catch'](handleError(_0x53a32e,null));};exports[_0xbb30('0x3a')]=function(_0x2b197f,_0x2d0249){if(_0x2b197f[_0xbb30('0x5c')]['id']){delete _0x2b197f[_0xbb30('0x5c')]['id'];}return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x2b197f[_0xbb30('0x57')]['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x2d0249,null))['then'](saveUpdates(_0x2b197f[_0xbb30('0x5c')],null))[_0xbb30('0x22')](respondWithResult(_0x2d0249,null))[_0xbb30('0x2c')](handleError(_0x2d0249,null));};exports['destroy']=function(_0x1286e0,_0x29d9a6){return db['WhatsappMessage'][_0xbb30('0x5a')]({'where':{'id':_0x1286e0['params']['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x29d9a6,null))['then'](removeEntity(_0x29d9a6,null))[_0xbb30('0x2c')](handleError(_0x29d9a6,null));};exports[_0xbb30('0x5d')]=function(_0x9637d,_0xc01a6e){return db[_0xbb30('0x56')][_0xbb30('0x5d')]()[_0xbb30('0x22')](respondWithResult(_0xc01a6e,null))[_0xbb30('0x2c')](handleError(_0xc01a6e,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xbb30('0x5e')]=function(_0x2f7b8e,_0xca90eb,_0x482669){var _0x4ac160={'agent':{},'channel':_0xbb30('0x5f')};if(_0x2f7b8e[_0xbb30('0x5c')]['id']){delete _0x2f7b8e[_0xbb30('0x5c')]['id'];}_0x2f7b8e['body']['read']=!![];_0x2f7b8e['body'][_0xbb30('0x60')]=moment()['format'](_0xbb30('0x61'));_0x2f7b8e['body']['UserId']=_0x2f7b8e['body'][_0xbb30('0x62')]||_0x2f7b8e[_0xbb30('0x63')]['id'];_0x4ac160['agent']['id']=_0x2f7b8e['body'][_0xbb30('0x62')];return db[_0xbb30('0x56')]['find']({'where':{'id':_0x2f7b8e[_0xbb30('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xca90eb,null))['then'](saveUpdates(_0x2f7b8e['body'],null))[_0xbb30('0x22')](function(_0x12b7e7){if(_0x12b7e7){_0x4ac160[_0xbb30('0x2a')]=_0x12b7e7[_0xbb30('0x64')]({'plain':!![]});return db[_0xbb30('0x65')][_0xbb30('0x5a')]({'where':{'id':_0x12b7e7['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xca90eb,null))['then'](function(_0x439f82){if(_0x439f82){return _0x439f82[_0xbb30('0x3a')]({'UserId':_0x2f7b8e['body'][_0xbb30('0x62')],'read1stAt':_[_0xbb30('0x66')](_0x439f82[_0xbb30('0x67')])?moment()[_0xbb30('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbb30('0x22')](function(_0x51708c){if(_0x51708c){_0x4ac160['interaction']=_0x51708c[_0xbb30('0x64')]({'plain':!![]});interaction_log['info'](_0xbb30('0x69'),_0x2f7b8e[_0xbb30('0x63')]['id'],_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x3d')],_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x6a')],_0x4ac160['interaction']['id'],_0x2f7b8e[_0xbb30('0x5c')]?JSON['stringify'](_0x2f7b8e[_0xbb30('0x5c')]):'null');return respondWithRpcPromise(_0xbb30('0x6b'),_0xbb30('0x6c'),_0x4ac160);}return null;})['then'](function(_0x955e09){var _0x25edf0=_0xbb30('0x6d')+_0x955e09['message'][_0xbb30('0x6e')];return db[_0xbb30('0x6f')][_0xbb30('0x45')](_0x25edf0,{'type':db['Sequelize']['QueryTypes'][_0xbb30('0x70')],'raw':!![]})['then'](function(_0x2125a9){return _0x2125a9;});})[_0xbb30('0x22')](function(_0x2763a9){if(_0x2763a9){_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x71')]=_0x2763a9[0x0];if(!_0x2f7b8e['body'][_0xbb30('0x62')])return;return db[_0xbb30('0x72')][_0xbb30('0x5a')]({'where':{'id':_0x2f7b8e['body']['UserId'],'role':_0xbb30('0x73')},'attributes':['id','name',_0xbb30('0x74'),_0xbb30('0x75'),_0xbb30('0x76')],'raw':!![]});}return null;})[_0xbb30('0x22')](function(_0x1d63d2){if(!_0x1d63d2)return null;_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x73')]=_0x1d63d2;return _0x4ac160;})['then'](function(_0x8cb2ca){if(_0x8cb2ca){if(_0x2f7b8e[_0xbb30('0x5c')][_0xbb30('0x77')]){_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x78')]=util[_0xbb30('0x68')](_0xbb30('0x79'),_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x3d')]);_0x4ac160[_0xbb30('0x2a')]['channel']=_0x4ac160[_0xbb30('0x7a')];_0x4ac160[_0xbb30('0x2a')]['motionChannel']=_0x4ac160[_0xbb30('0x7a')];_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x7b')]=_0xbb30('0x5e');return respondWithRpcPromise(_0xbb30('0x7c'),_0xbb30('0x7c'),{'event':_0xbb30('0x7d'),'message':_0x4ac160[_0xbb30('0x2a')]},client9002)[_0xbb30('0x22')](function(){return _0x4ac160;});}return _0x4ac160;}return null;})[_0xbb30('0x22')](respondWithResult(_0xca90eb,null))[_0xbb30('0x2c')](handleError(_0xca90eb,null));};var interaction_log=require(_0xbb30('0x7e'))(_0xbb30('0x7f'));exports[_0xbb30('0x38')]=function(_0x380498,_0x4e75a5,_0x2081ee){var _0x5d3e53={'agent':{},'channel':_0xbb30('0x5f')};if(_0x380498[_0xbb30('0x5c')]['id']){delete _0x380498['body']['id'];}_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')]=_0x380498[_0xbb30('0x5c')]['UserId']||_0x380498['user']['id'];_0x5d3e53['agent']['id']=_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')];return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x380498[_0xbb30('0x57')]['id'],'UserId':null}})[_0xbb30('0x22')](handleEntityNotFound(_0x4e75a5,null))['then'](function(_0x3a1ce2){if(_0x3a1ce2){_0x5d3e53[_0xbb30('0x2a')]=_0x3a1ce2[_0xbb30('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0xbb30('0x5a')]({'where':{'id':_0x3a1ce2[_0xbb30('0x80')]}});}return null;})[_0xbb30('0x22')](handleEntityNotFound(_0x4e75a5,null))['then'](function(_0x46b0e3){if(_0x46b0e3){_0x5d3e53[_0xbb30('0x81')]=_0x46b0e3['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x380498[_0xbb30('0x63')]['id'],_0x380498[_0xbb30('0x63')][_0xbb30('0x3d')],_0x380498[_0xbb30('0x63')][_0xbb30('0x6a')],_0x5d3e53[_0xbb30('0x81')]['id'],_0x380498[_0xbb30('0x5c')]?JSON[_0xbb30('0x28')](_0x380498['body']):_0xbb30('0x82'));return respondWithRpcPromise(_0xbb30('0x83'),_0xbb30('0x84'),_0x5d3e53);}return null;})[_0xbb30('0x22')](function(_0x4e6789){var _0x36ad43=_0xbb30('0x6d')+_0x4e6789['message'][_0xbb30('0x6e')];return db['sequelize'][_0xbb30('0x45')](_0x36ad43,{'type':db[_0xbb30('0x85')][_0xbb30('0x86')][_0xbb30('0x70')],'raw':!![]})[_0xbb30('0x22')](function(_0x1db9d8){return _0x1db9d8;});})[_0xbb30('0x22')](function(_0x4731d7){if(_0x4731d7){_0x5d3e53['message'][_0xbb30('0x71')]=_0x4731d7[0x0];if(!_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')])return;return db[_0xbb30('0x72')][_0xbb30('0x5a')]({'where':{'id':_0x380498['body'][_0xbb30('0x62')],'role':_0xbb30('0x73')},'attributes':['id',_0xbb30('0x3d'),_0xbb30('0x74'),_0xbb30('0x75'),_0xbb30('0x76')],'raw':!![]});}return null;})[_0xbb30('0x22')](function(_0x2873ea){if(!_0x2873ea)return null;_0x5d3e53[_0xbb30('0x2a')][_0xbb30('0x73')]=_0x2873ea;return _0x5d3e53;})[_0xbb30('0x22')](function(_0x59bd5f){if(_0x59bd5f){_0x59bd5f['message']['interface']=util['format']('SIP/%s',_0x380498[_0xbb30('0x63')][_0xbb30('0x3d')]);_0x59bd5f[_0xbb30('0x2a')][_0xbb30('0x7a')]=_0x5d3e53[_0xbb30('0x7a')];_0x59bd5f[_0xbb30('0x2a')]['motionChannel']=_0x5d3e53['channel'];_0x59bd5f[_0xbb30('0x2a')]['event']=_0xbb30('0x38');respondWithRpcPromise(_0xbb30('0x7c'),_0xbb30('0x7c'),{'event':'rejectmessage','message':_0x59bd5f[_0xbb30('0x2a')]},client9002);return _0x5d3e53;}return null;})[_0xbb30('0x22')](respondWithResult(_0x4e75a5,null))[_0xbb30('0x2c')](handleError(_0x4e75a5,null));};exports['status']=function(_0x418c59,_0x2c4951,_0x3b22ab){if(_0x418c59[_0xbb30('0x5c')]['id']){delete _0x418c59['body']['id'];}var _0x549bc6;return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x418c59[_0xbb30('0x57')]['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x2c4951,null))[_0xbb30('0x22')](function(_0x552427){if(_0x552427){_0x549bc6=_0x552427;return db[_0xbb30('0x87')]['find']({'where':{'id':_0x552427['WhatsappAccountId']}});}})[_0xbb30('0x22')](handleEntityNotFound(_0x2c4951,null))[_0xbb30('0x22')](function(_0x571dba){if(_0x571dba){logger[_0xbb30('0x25')](_0xbb30('0x88'),_0xbb30('0x2e'),_0xbb30('0x89'),_0x571dba['type'],util['inspect'](_0x418c59[_0xbb30('0x5c')],{'showHidden':![],'depth':null}));switch(_0x571dba[_0xbb30('0x42')]){case _0xbb30('0x8a'):if(_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8b')]&&_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8b')]===_0x549bc6[_0xbb30('0x8c')]&&_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8d')]&&_0x418c59['body'][_0xbb30('0x8d')]===_0xbb30('0x8e')){return _0x549bc6['update']({'read':!![]});}else{logger[_0xbb30('0x29')](_0xbb30('0x8f'),_0xbb30('0x2e'),'twilio',util[_0xbb30('0x90')](_0x418c59['body'],{'showHidden':![],'depth':null}));}break;}return _0x549bc6;}})['then'](respondWithResult(_0x2c4951,null))[_0xbb30('0x2c')](handleError(_0x2c4951,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9d4f6ba..48d098c 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 _0xf7b4=['hook','exports','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3792aa,_0x2313d1){var _0x19e4d0=function(_0x15ce67){while(--_0x15ce67){_0x3792aa['push'](_0x3792aa['shift']());}};_0x19e4d0(++_0x2313d1);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5c2110,_0x2b7eb9){_0x5c2110=_0x5c2110-0x0;var _0x595ee3=_0xf7b4[_0x5c2110];return _0x595ee3;};'use strict';var EventEmitter=require(_0x4f7b('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4f7b('0x1')](0x0);var events={'afterCreate':_0x4f7b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21b85f){return function(_0x3e18fd,_0x2e0e51,_0x44f991){WhatsappMessageEvents[_0x4f7b('0x3')](_0x21b85f+':'+_0x3e18fd['id'],_0x3e18fd);WhatsappMessageEvents[_0x4f7b('0x3')](_0x21b85f,_0x3e18fd);_0x44f991(null);};}for(var e in events){if(events[_0x4f7b('0x4')](e)){var event=events[e];WhatsappMessage[_0x4f7b('0x5')](e,emitEvent(event));}}module[_0x4f7b('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0xf290=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x50809f,_0x308353){var _0x59fa49=function(_0x1f24b8){while(--_0x1f24b8){_0x50809f['push'](_0x50809f['shift']());}};_0x59fa49(++_0x308353);}(_0xf290,0xde));var _0x0f29=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xf290[_0x2bcb75];return _0x175345;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0f29('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0f29('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f29('0x2'),'afterDestroy':_0x0f29('0x3')};function emitEvent(_0x38f5b5){return function(_0x28b644,_0xfdab92,_0x5984ba){WhatsappMessageEvents[_0x0f29('0x4')](_0x38f5b5+':'+_0x28b644['id'],_0x28b644);WhatsappMessageEvents['emit'](_0x38f5b5,_0x28b644);_0x5984ba(null);};}for(var e in events){if(events[_0x0f29('0x5')](e)){var event=events[e];WhatsappMessage[_0x0f29('0x6')](e,emitEvent(event));}}module[_0x0f29('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index aa954b4..ead70d5 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 _0x9bde=['FULLTEXT','models','direction','toLowerCase','secret','UserId','WhatsappInteraction','findOne','update','createdAt','catch','out','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','remote','/api/whatsapp/messages/','/status?token=','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body'];(function(_0x365fc6,_0x5eeee3){var _0x12270c=function(_0x374b36){while(--_0x374b36){_0x365fc6['push'](_0x365fc6['shift']());}};_0x12270c(++_0x5eeee3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x17e099,_0x3309eb){_0x17e099=_0x17e099-0x0;var _0x451809=_0x9bde[_0x17e099];return _0x451809;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[{'name':_0xe9bd('0xc'),'fields':[_0xe9bd('0xc')]},{'name':_0xe9bd('0xd'),'fields':[_0xe9bd('0xe')],'type':_0xe9bd('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45c7ba,_0x581602,_0x5f36c8){var _0x3c8e95=_0x4fd7b8[_0xe9bd('0x10')];var _0x2601ac=_0x45c7ba['get']({'plain':!![]});if(_0x2601ac[_0xe9bd('0x11')][_0xe9bd('0x12')]()==='in'||_0x2601ac[_0xe9bd('0x11')][_0xe9bd('0x12')]()==='out'&&!_0x2601ac[_0xe9bd('0x13')]&&!_['isNil'](_0x2601ac[_0xe9bd('0x14')])){_0x3c8e95[_0xe9bd('0x15')][_0xe9bd('0x16')]({'where':{'id':_0x2601ac['WhatsappInteractionId']}})['then'](function(_0x46a95e){if(_0x46a95e){_0x46a95e[_0xe9bd('0x17')]({'lastMsgAt':_0x2601ac[_0xe9bd('0x18')],'lastMsgDirection':_0x2601ac[_0xe9bd('0x11')][_0xe9bd('0x12')]()});}})[_0xe9bd('0x19')](function(_0x45a9f2){console['error'](_0x45a9f2);});}if(_0x2601ac[_0xe9bd('0x11')]===_0xe9bd('0x1a')&&!_0x2601ac[_0xe9bd('0x13')]){var _0x494b27;_0x3c8e95[_0xe9bd('0x1b')][_0xe9bd('0x1c')]({'where':{'id':_0x2601ac[_0xe9bd('0x1d')]},'raw':!![]})[_0xe9bd('0x1e')](function(_0x5cf674){_0x494b27=_0x5cf674;if(_0x494b27&&_0x494b27[_0xe9bd('0x1f')]){switch(_0x494b27['type']){case _0xe9bd('0x20'):var _0x55b869=require(_0xe9bd('0x20'));if(_0x494b27[_0xe9bd('0x21')]&&_0x494b27[_0xe9bd('0x22')]&&_0x494b27[_0xe9bd('0x23')]){var _0x1acb82=new _0x55b869(_0x494b27[_0xe9bd('0x21')],_0x494b27[_0xe9bd('0x22')]);_0x1acb82['messages'][_0xe9bd('0x24')]({'body':_0x2601ac[_0xe9bd('0xe')],'to':'whatsapp:'+_0x2601ac[_0xe9bd('0x23')],'from':'whatsapp:'+_0x494b27[_0xe9bd('0x23')],'statusCallback':_0x494b27[_0xe9bd('0x25')]+_0xe9bd('0x26')+_0x2601ac['id']+_0xe9bd('0x27')+_0x494b27['token']})[_0xe9bd('0x1e')](function(_0x1e3cbb){if(_0x1e3cbb[_0xe9bd('0x28')]){return _0x45c7ba[_0xe9bd('0x17')]({'messageId':_0x1e3cbb[_0xe9bd('0x28')]});}})[_0xe9bd('0x19')](function(_0x399f3c){logger[_0xe9bd('0x29')](_0xe9bd('0x2a'),'afterCreate',_0xe9bd('0x20'),util[_0xe9bd('0x2b')](_0x399f3c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe9bd('0x2a'),_0xe9bd('0x2c'),_0xe9bd('0x20'),_0xe9bd('0x2d'));}break;}}})[_0xe9bd('0x2e')](function(){_0x5f36c8();});}else{_0x5f36c8();}}},'charset':_0xe9bd('0x2f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb767=['define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','findOne','createdAt','catch','secret','WhatsappAccount','WhatsappAccountId','type','twilio','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','token','then','sid','update','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','./whatsappMessage.attributes','exports'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xb767,0x160));var _0x7b76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb767[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x7b76('0x0'));var logger=require(_0x7b76('0x1'))('api');var moment=require(_0x7b76('0x2'));var BPromise=require(_0x7b76('0x3'));var rp=require(_0x7b76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b76('0x5'));var config=require('../../config/environment');var attributes=require(_0x7b76('0x6'));module[_0x7b76('0x7')]=function(_0x355e86,_0x33c134){return _0x355e86[_0x7b76('0x8')]('WhatsappMessage',attributes,{'tableName':_0x7b76('0x9'),'paranoid':![],'indexes':[{'name':_0x7b76('0xa'),'fields':[_0x7b76('0xa')]},{'name':_0x7b76('0xb'),'fields':[_0x7b76('0xc')],'type':_0x7b76('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bccca,_0x4b55c4,_0x78dfd7){var _0x4586a5=_0x355e86['models'];var _0xd76f29=_0x5bccca['get']({'plain':!![]});if(_0xd76f29[_0x7b76('0xe')][_0x7b76('0xf')]()==='in'||_0xd76f29['direction'][_0x7b76('0xf')]()===_0x7b76('0x10')&&!_0xd76f29['secret']&&!_[_0x7b76('0x11')](_0xd76f29[_0x7b76('0x12')])){_0x4586a5['WhatsappInteraction'][_0x7b76('0x13')]({'where':{'id':_0xd76f29['WhatsappInteractionId']}})['then'](function(_0x58f88b){if(_0x58f88b){_0x58f88b['update']({'lastMsgAt':_0xd76f29[_0x7b76('0x14')],'lastMsgDirection':_0xd76f29[_0x7b76('0xe')][_0x7b76('0xf')]()});}})[_0x7b76('0x15')](function(_0x453a63){console['error'](_0x453a63);});}if(_0xd76f29[_0x7b76('0xe')]==='out'&&!_0xd76f29[_0x7b76('0x16')]){var _0xc80c82;_0x4586a5[_0x7b76('0x17')]['find']({'where':{'id':_0xd76f29[_0x7b76('0x18')]},'raw':!![]})['then'](function(_0x2ef642){_0xc80c82=_0x2ef642;if(_0xc80c82&&_0xc80c82[_0x7b76('0x19')]){switch(_0xc80c82[_0x7b76('0x19')]){case _0x7b76('0x1a'):var _0x2a6a9f=require(_0x7b76('0x1a'));if(_0xc80c82['accountSid']&&_0xc80c82['authToken']&&_0xc80c82[_0x7b76('0x1b')]){var _0x1ac11d=new _0x2a6a9f(_0xc80c82['accountSid'],_0xc80c82[_0x7b76('0x1c')]);_0x1ac11d[_0x7b76('0x1d')]['create']({'body':_0xd76f29[_0x7b76('0xc')],'to':'whatsapp:'+_0xd76f29['phone'],'from':_0x7b76('0x1e')+_0xc80c82['phone'],'statusCallback':_0xc80c82[_0x7b76('0x1f')]+_0x7b76('0x20')+_0xd76f29['id']+'/status?token='+_0xc80c82[_0x7b76('0x21')]})[_0x7b76('0x22')](function(_0x3b3757){if(_0x3b3757[_0x7b76('0x23')]){return _0x5bccca[_0x7b76('0x24')]({'messageId':_0x3b3757[_0x7b76('0x23')]});}})[_0x7b76('0x15')](function(_0x520fb4){logger[_0x7b76('0x25')](_0x7b76('0x26'),_0x7b76('0x27'),_0x7b76('0x1a'),util[_0x7b76('0x28')](_0x520fb4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7b76('0x26'),'afterCreate',_0x7b76('0x1a'),_0x7b76('0x29'));}break;}}})[_0x7b76('0x2a')](function(){_0x78dfd7();});}else{_0x78dfd7();}}},'charset':_0x7b76('0x2b'),'collate':_0x7b76('0x2c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d3aea58..2afc38d 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 _0xd3ee=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateWhatsappMessage','body','options','raw','then','lodash'];(function(_0x2383c3,_0x4fd9de){var _0x2cadbc=function(_0x2d0810){while(--_0x2d0810){_0x2383c3['push'](_0x2383c3['shift']());}};_0x2cadbc(++_0x4fd9de);}(_0xd3ee,0x13e));var _0xed3e=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xd3ee[_0x2bfd4f];return _0x341849;};'use strict';var _=require(_0xed3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xed3e('0x1'));var rs=require(_0xed3e('0x2'));var fs=require('fs');var Redis=require(_0xed3e('0x3'));var db=require(_0xed3e('0x4'))['db'];var utils=require(_0xed3e('0x5'));var logger=require(_0xed3e('0x6'))('rpc');var config=require(_0xed3e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed3e('0x8')][_0xed3e('0x9')]({'port':0x232a});config[_0xed3e('0xa')]=_[_0xed3e('0xb')](config[_0xed3e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xed3e('0xc'))(new Redis(config[_0xed3e('0xa')]));require(_0xed3e('0xd'))[_0xed3e('0xe')](socket);function respondWithRpcPromise(_0x37e010,_0x531395,_0x373280){return new BPromise(function(_0x41545f,_0x36525e){return client[_0xed3e('0xf')](_0x37e010,_0x373280)['then'](function(_0x55f003){logger[_0xed3e('0x10')](_0xed3e('0x11'),_0x531395,_0xed3e('0x12'));logger[_0xed3e('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x531395,_0xed3e('0x12'),JSON[_0xed3e('0x14')](_0x55f003));if(_0x55f003[_0xed3e('0x15')]){if(_0x55f003['error']['code']===0x1f4){logger[_0xed3e('0x15')](_0xed3e('0x11'),_0x531395,_0x55f003[_0xed3e('0x15')][_0xed3e('0x16')]);return _0x36525e(_0x55f003[_0xed3e('0x15')]['message']);}logger[_0xed3e('0x15')](_0xed3e('0x11'),_0x531395,_0x55f003[_0xed3e('0x15')][_0xed3e('0x16')]);return _0x41545f(_0x55f003[_0xed3e('0x15')][_0xed3e('0x16')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x531395,_0xed3e('0x12'));_0x41545f(_0x55f003['result'][_0xed3e('0x16')]);}})[_0xed3e('0x17')](function(_0x2d56ef){logger[_0xed3e('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x531395,_0x2d56ef);_0x36525e(_0x2d56ef);});});}exports[_0xed3e('0x18')]=function(_0x5bdddf){var _0x11d70c=this;return new Promise(function(_0x426e5e,_0x5ecee3){return db['WhatsappMessage']['create'](_0x5bdddf[_0xed3e('0x19')],{'raw':_0x5bdddf[_0xed3e('0x1a')]?_0x5bdddf[_0xed3e('0x1a')][_0xed3e('0x1b')]===undefined?!![]:![]:!![]})[_0xed3e('0x1c')](function(_0x408f90){logger[_0xed3e('0x10')](_0xed3e('0x18'),_0x5bdddf);logger[_0xed3e('0x13')](_0xed3e('0x18'),_0x5bdddf,JSON[_0xed3e('0x14')](_0x408f90));_0x426e5e(_0x408f90);})['catch'](function(_0x2a41e8){logger[_0xed3e('0x15')](_0xed3e('0x18'),_0x2a41e8[_0xed3e('0x16')],_0x5bdddf);_0x5ecee3(_0x11d70c[_0xed3e('0x15')](0x1f4,_0x2a41e8[_0xed3e('0x16')]));});});}; \ No newline at end of file +var _0xdd19=['then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./whatsappMessage.socket','register','request'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0xdd19,0x8d));var _0x9dd1=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xdd19[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x9dd1('0x0'));var util=require(_0x9dd1('0x1'));var moment=require(_0x9dd1('0x2'));var BPromise=require(_0x9dd1('0x3'));var rs=require(_0x9dd1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dd1('0x5'))['db'];var utils=require(_0x9dd1('0x6'));var logger=require('../../config/logger')(_0x9dd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9dd1('0x8')]=_[_0x9dd1('0x9')](config['redis'],{'host':_0x9dd1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9dd1('0x8')]));require(_0x9dd1('0xb'))[_0x9dd1('0xc')](socket);function respondWithRpcPromise(_0x2344a3,_0x17ce25,_0x100f69){return new BPromise(function(_0x12d239,_0x52981e){return client[_0x9dd1('0xd')](_0x2344a3,_0x100f69)[_0x9dd1('0xe')](function(_0x59cda2){logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x17ce25,'request\x20sent');logger[_0x9dd1('0x11')](_0x9dd1('0x12'),_0x17ce25,_0x9dd1('0x13'),JSON[_0x9dd1('0x14')](_0x59cda2));if(_0x59cda2['error']){if(_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x16')]===0x1f4){logger[_0x9dd1('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x17ce25,_0x59cda2[_0x9dd1('0x15')]['message']);return _0x52981e(_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x17')]);}logger['error'](_0x9dd1('0x10'),_0x17ce25,_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x17')]);return _0x12d239(_0x59cda2[_0x9dd1('0x15')]['message']);}else{logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x17ce25,_0x9dd1('0x13'));_0x12d239(_0x59cda2[_0x9dd1('0x18')][_0x9dd1('0x17')]);}})[_0x9dd1('0x19')](function(_0x28c264){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x17ce25,_0x28c264);_0x52981e(_0x28c264);});});}exports[_0x9dd1('0x1a')]=function(_0x8b126){var _0x62abbd=this;return new Promise(function(_0x51bb6d,_0x115075){return db[_0x9dd1('0x1b')][_0x9dd1('0x1c')](_0x8b126[_0x9dd1('0x1d')],{'raw':_0x8b126['options']?_0x8b126['options'][_0x9dd1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1a4d5f){logger[_0x9dd1('0xf')](_0x9dd1('0x1a'),_0x8b126);logger[_0x9dd1('0x11')]('CreateWhatsappMessage',_0x8b126,JSON[_0x9dd1('0x14')](_0x1a4d5f));_0x51bb6d(_0x1a4d5f);})[_0x9dd1('0x19')](function(_0x20362a){logger['error']('CreateWhatsappMessage',_0x20362a[_0x9dd1('0x17')],_0x8b126);_0x115075(_0x62abbd[_0x9dd1('0x15')](0x1f4,_0x20362a[_0x9dd1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d2f91c2..e6c925e 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 _0xf92d=['save','remove','update','register','length','whatsappMessage:'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xf92d,0x1ce));var _0xdf92=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0xf92d[_0x3e25c1];return _0x52e7f2;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xdf92('0x0'),_0xdf92('0x1'),_0xdf92('0x2')];function createListener(_0x27e6bd,_0x3122b0){return function(_0x7cc523){_0x3122b0['emit'](_0x27e6bd,_0x7cc523);};}function removeListener(_0x390a8a,_0x568837){return function(){WhatsappMessageEvents['removeListener'](_0x390a8a,_0x568837);};}exports[_0xdf92('0x3')]=function(_0x124537){for(var _0x46fac6=0x0,_0x579898=events[_0xdf92('0x4')];_0x46fac6<_0x579898;_0x46fac6++){var _0x44ccd9=events[_0x46fac6];var _0x34f5ef=createListener(_0xdf92('0x5')+_0x44ccd9,_0x124537);WhatsappMessageEvents['on'](_0x44ccd9,_0x34f5ef);}}; \ No newline at end of file +var _0xa4c8=['remove','update','emit','removeListener','register','length'];(function(_0x5843e2,_0x5cd708){var _0x30f818=function(_0x2b8fc4){while(--_0x2b8fc4){_0x5843e2['push'](_0x5843e2['shift']());}};_0x30f818(++_0x5cd708);}(_0xa4c8,0x1c2));var _0x8a4c=function(_0xdfa4ff,_0x4c4320){_0xdfa4ff=_0xdfa4ff-0x0;var _0x309c14=_0xa4c8[_0xdfa4ff];return _0x309c14;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8a4c('0x0'),_0x8a4c('0x1')];function createListener(_0x147e09,_0x16ea98){return function(_0x356c8c){_0x16ea98[_0x8a4c('0x2')](_0x147e09,_0x356c8c);};}function removeListener(_0x1267b2,_0x287643){return function(){WhatsappMessageEvents[_0x8a4c('0x3')](_0x1267b2,_0x287643);};}exports[_0x8a4c('0x4')]=function(_0x16441d){for(var _0x3e3f9a=0x0,_0x4c76a4=events[_0x8a4c('0x5')];_0x3e3f9a<_0x4c76a4;_0x3e3f9a++){var _0x2dd8e2=events[_0x3e3f9a];var _0x358252=createListener('whatsappMessage:'+_0x2dd8e2,_0x16441d);WhatsappMessageEvents['on'](_0x2dd8e2,_0x358252);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8c0eb8e..0fd6447 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 _0x96d6=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x96d6,0x123));var _0x696d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x96d6[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x696d('0x0'));var path=require(_0x696d('0x1'));var timeout=require(_0x696d('0x2'));var express=require('express');var router=express[_0x696d('0x3')]();var fs_extra=require(_0x696d('0x4'));var auth=require(_0x696d('0x5'));var interaction=require(_0x696d('0x6'));var config=require(_0x696d('0x7'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x696d('0x8')](_0x696d('0x9'),auth[_0x696d('0xa')](),controller[_0x696d('0xb')]);router['get'](_0x696d('0xc'),auth['isAuthenticated'](),controller[_0x696d('0xd')]);router['get'](_0x696d('0xe'),auth[_0x696d('0xa')](),controller[_0x696d('0xf')]);router[_0x696d('0x8')](_0x696d('0x10'),auth[_0x696d('0xa')](),controller[_0x696d('0x11')]);router[_0x696d('0x8')](_0x696d('0x12'),auth[_0x696d('0xa')](),controller['getAgents']);router[_0x696d('0x13')]('/',auth[_0x696d('0xa')](),controller[_0x696d('0x14')]);router[_0x696d('0x13')](_0x696d('0x10'),auth[_0x696d('0xa')](),controller[_0x696d('0x15')]);router[_0x696d('0x13')]('/:id/users',auth[_0x696d('0xa')](),controller[_0x696d('0x16')]);router[_0x696d('0x17')]('/:id',auth[_0x696d('0xa')](),controller[_0x696d('0x18')]);router['delete'](_0x696d('0xc'),auth['isAuthenticated'](),controller[_0x696d('0x19')]);router[_0x696d('0x1a')](_0x696d('0x10'),auth[_0x696d('0xa')](),controller['removeTeams']);router[_0x696d('0x1a')]('/:id/users',auth[_0x696d('0xa')](),controller[_0x696d('0x1b')]);module[_0x696d('0x1c')]=router; \ No newline at end of file +var _0xc571=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc571,0x1d9));var _0x1c57=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xc571[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x1c57('0x0'));var util=require('util');var path=require(_0x1c57('0x1'));var timeout=require(_0x1c57('0x2'));var express=require(_0x1c57('0x3'));var router=express['Router']();var fs_extra=require(_0x1c57('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c57('0x5'));var controller=require(_0x1c57('0x6'));router[_0x1c57('0x7')]('/',auth[_0x1c57('0x8')](),controller[_0x1c57('0x9')]);router[_0x1c57('0x7')](_0x1c57('0xa'),auth[_0x1c57('0x8')](),controller['describe']);router[_0x1c57('0x7')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0xc')]);router['get'](_0x1c57('0xd'),auth[_0x1c57('0x8')](),controller[_0x1c57('0xe')]);router['get']('/:id/teams',auth[_0x1c57('0x8')](),controller['getTeams']);router[_0x1c57('0x7')](_0x1c57('0xf'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x10')]);router[_0x1c57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1c57('0x12')]);router[_0x1c57('0x11')](_0x1c57('0x13'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x14')]);router['post'](_0x1c57('0xf'),auth[_0x1c57('0x8')](),controller['addAgents']);router[_0x1c57('0x15')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x16')]);router[_0x1c57('0x17')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x18')]);router[_0x1c57('0x17')](_0x1c57('0x13'),auth[_0x1c57('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1c57('0x8')](),controller['removeAgents']);module[_0x1c57('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 48fbdd4..1d7d1b3 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 _0xb16f=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2e321c,_0x3260f4){var _0x3eddc9=function(_0x1ddee1){while(--_0x1ddee1){_0x2e321c['push'](_0x2e321c['shift']());}};_0x3eddc9(++_0x3260f4);}(_0xb16f,0xf6));var _0xfb16=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0xb16f[_0x1b4c04];return _0x374f5d;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'name':{'type':Sequelize[_0xfb16('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb16('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb16('0x4')](_0xfb16('0x5'),_0xfb16('0x6'),'roundrobin')},'description':{'type':Sequelize[_0xfb16('0x2')]}}; \ No newline at end of file +var _0xbefe=['exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x37f9a5,_0x2266b0){var _0x4b081e=function(_0x496b71){while(--_0x496b71){_0x37f9a5['push'](_0x37f9a5['shift']());}};_0x4b081e(++_0x2266b0);}(_0xbefe,0x168));var _0xebef=function(_0x2bdf29,_0x40cab0){_0x2bdf29=_0x2bdf29-0x0;var _0x60cb83=_0xbefe[_0x2bdf29];return _0x60cb83;};'use strict';var Sequelize=require('sequelize');module[_0xebef('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xebef('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xebef('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xebef('0x3')](_0xebef('0x4'),_0xebef('0x5'),_0xebef('0x6'))},'description':{'type':Sequelize[_0xebef('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e6197a9..5e82e25 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 _0x83a6=['push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','include','catch','show','params','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone'];(function(_0x51d475,_0xb8d0c3){var _0x5d8d80=function(_0x580aaa){while(--_0x580aaa){_0x51d475['push'](_0x51d475['shift']());}};_0x5d8d80(++_0xb8d0c3);}(_0x83a6,0xa0));var _0x683a=function(_0x218783,_0x443aa1){_0x218783=_0x218783-0x0;var _0xe7619=_0x83a6[_0x218783];return _0xe7619;};'use strict';var emlformat=require(_0x683a('0x0'));var rimraf=require(_0x683a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x683a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x683a('0x3'));var util=require('util');var path=require(_0x683a('0x4'));var sox=require(_0x683a('0x5'));var csv=require('to-csv');var ejs=require(_0x683a('0x6'));var fs=require('fs');var fs_extra=require(_0x683a('0x7'));var _=require('lodash');var squel=require(_0x683a('0x8'));var crypto=require('crypto');var jsforce=require(_0x683a('0x9'));var deskjs=require(_0x683a('0xa'));var toCsv=require(_0x683a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x683a('0xc'));var qs=require(_0x683a('0xd'));var as=require(_0x683a('0xe'));var hardwareService=require(_0x683a('0xf'));var logger=require(_0x683a('0x10'))(_0x683a('0x11'));var utils=require('../../config/utils');var config=require(_0x683a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x683a('0x13'))['db'];config[_0x683a('0x14')]=_[_0x683a('0x15')](config[_0x683a('0x14')],{'host':_0x683a('0x16'),'port':0x18eb});var socket=require(_0x683a('0x17'))(new Redis(config[_0x683a('0x14')]));require(_0x683a('0x18'))[_0x683a('0x19')](socket);function respondWithStatusCode(_0x5cc69b,_0x379ddd){_0x379ddd=_0x379ddd||0xcc;return function(_0x2e8642){if(_0x2e8642){return _0x5cc69b['sendStatus'](_0x379ddd);}return _0x5cc69b[_0x683a('0x1a')](_0x379ddd)[_0x683a('0x1b')]();};}function respondWithResult(_0x111cf7,_0x2956a0){_0x2956a0=_0x2956a0||0xc8;return function(_0x2bc8ed){if(_0x2bc8ed){return _0x111cf7[_0x683a('0x1a')](_0x2956a0)[_0x683a('0x1c')](_0x2bc8ed);}};}function respondWithFilteredResult(_0x1dbf98,_0x59e91f){return function(_0x1e892e){if(_0x1e892e){var _0xde2933=typeof _0x59e91f[_0x683a('0x1d')]==='undefined'&&typeof _0x59e91f[_0x683a('0x1e')]==='undefined';var _0x182f08=_0x1e892e['count'];var _0x232046=_0xde2933?0x0:_0x59e91f[_0x683a('0x1d')];var _0xe8b4e2=_0xde2933?_0x1e892e[_0x683a('0x1f')]:_0x59e91f[_0x683a('0x1d')]+_0x59e91f[_0x683a('0x1e')];var _0x58085c;if(_0xe8b4e2>=_0x182f08){_0xe8b4e2=_0x182f08;_0x58085c=0xc8;}else{_0x58085c=0xce;}_0x1dbf98['status'](_0x58085c);return _0x1dbf98[_0x683a('0x20')](_0x683a('0x21'),_0x232046+'-'+_0xe8b4e2+'/'+_0x182f08)[_0x683a('0x1c')](_0x1e892e);}return null;};}function patchUpdates(_0x5b82bf){return function(_0x494d39){try{jsonpatch['apply'](_0x494d39,_0x5b82bf,!![]);}catch(_0x59dd54){return BPromise[_0x683a('0x22')](_0x59dd54);}return _0x494d39[_0x683a('0x23')]();};}function saveUpdates(_0x57dfd2,_0x27b1ee){return function(_0x457f0b){if(_0x457f0b){return _0x457f0b[_0x683a('0x24')](_0x57dfd2)['then'](function(_0x201f6){return _0x201f6;});}return null;};}function removeEntity(_0x1b7d3b,_0x1b58e3){return function(_0x427d62){if(_0x427d62){return _0x427d62['destroy']()[_0x683a('0x25')](function(){var _0x2db107=_0x427d62[_0x683a('0x26')]({'plain':!![]});var _0x58c9f6=_0x683a('0x27');return db[_0x683a('0x28')][_0x683a('0x29')]({'where':{'type':_0x58c9f6,'resourceId':_0x2db107['id']}})[_0x683a('0x25')](function(){return _0x427d62;});})[_0x683a('0x25')](function(){_0x1b7d3b[_0x683a('0x1a')](0xcc)[_0x683a('0x1b')]();});}};}function handleEntityNotFound(_0x4a4cbc,_0x106063){return function(_0x484db2){if(!_0x484db2){_0x4a4cbc[_0x683a('0x2a')](0x194);}return _0x484db2;};}function handleError(_0xf24613,_0x3479bd){_0x3479bd=_0x3479bd||0x1f4;return function(_0x23562e){logger['error'](_0x23562e[_0x683a('0x2b')]);if(_0x23562e['name']){delete _0x23562e[_0x683a('0x2c')];}_0xf24613['status'](_0x3479bd)[_0x683a('0x2d')](_0x23562e);};}exports[_0x683a('0x2e')]=function(_0x3b23ce,_0x54a15d){var _0x389c2d={},_0xb829a5={},_0x4e107b={'count':0x0,'rows':[]};var _0xd7f4b5=_[_0x683a('0x2f')](db[_0x683a('0x30')]['rawAttributes'],function(_0x394298){return{'name':_0x394298[_0x683a('0x31')],'type':_0x394298[_0x683a('0x32')][_0x683a('0x33')]};});_0xb829a5[_0x683a('0x34')]=_[_0x683a('0x2f')](_0xd7f4b5,_0x683a('0x2c'));_0xb829a5['query']=_[_0x683a('0x35')](_0x3b23ce[_0x683a('0x36')]);_0xb829a5[_0x683a('0x37')]=_[_0x683a('0x38')](_0xb829a5[_0x683a('0x34')],_0xb829a5[_0x683a('0x36')]);_0x389c2d[_0x683a('0x39')]=_[_0x683a('0x38')](_0xb829a5[_0x683a('0x34')],qs[_0x683a('0x3a')](_0x3b23ce[_0x683a('0x36')][_0x683a('0x3a')]));_0x389c2d['attributes']=_0x389c2d[_0x683a('0x39')][_0x683a('0x3b')]?_0x389c2d[_0x683a('0x39')]:_0xb829a5[_0x683a('0x34')];if(!_0x3b23ce[_0x683a('0x36')][_0x683a('0x3c')](_0x683a('0x3d'))){_0x389c2d[_0x683a('0x1e')]=qs[_0x683a('0x1e')](_0x3b23ce[_0x683a('0x36')][_0x683a('0x1e')]);_0x389c2d[_0x683a('0x1d')]=qs['offset'](_0x3b23ce[_0x683a('0x36')][_0x683a('0x1d')]);}_0x389c2d['order']=qs['sort'](_0x3b23ce[_0x683a('0x36')][_0x683a('0x3e')]);_0x389c2d['where']=qs[_0x683a('0x37')](_[_0x683a('0x3f')](_0x3b23ce['query'],_0xb829a5[_0x683a('0x37')]),_0xd7f4b5);if(_0x3b23ce[_0x683a('0x36')][_0x683a('0x40')]){_0x389c2d['where']=_[_0x683a('0x41')](_0x389c2d[_0x683a('0x42')],{'$or':_['map'](_0xd7f4b5,function(_0x4306e3){if(_0x4306e3[_0x683a('0x32')]!=='VIRTUAL'){var _0x4cb4b6={};_0x4cb4b6[_0x4306e3[_0x683a('0x2c')]]={'$like':'%'+_0x3b23ce[_0x683a('0x36')]['filter']+'%'};return _0x4cb4b6;}})});}_0x389c2d=_['merge']({},_0x389c2d,_0x3b23ce[_0x683a('0x43')]);var _0x4a6123={'where':_0x389c2d[_0x683a('0x42')]};return db[_0x683a('0x30')][_0x683a('0x1f')](_0x4a6123)['then'](function(_0x5ab690){_0x4e107b[_0x683a('0x1f')]=_0x5ab690;if(_0x3b23ce[_0x683a('0x36')][_0x683a('0x44')]){_0x389c2d[_0x683a('0x45')]=[{'all':!![]}];}return db[_0x683a('0x30')]['findAll'](_0x389c2d);})[_0x683a('0x25')](function(_0x581210){_0x4e107b['rows']=_0x581210;return _0x4e107b;})[_0x683a('0x25')](respondWithFilteredResult(_0x54a15d,_0x389c2d))[_0x683a('0x46')](handleError(_0x54a15d,null));};exports[_0x683a('0x47')]=function(_0x5e0a82,_0x27643a){var _0x3e3073={'raw':!![],'where':{'id':_0x5e0a82[_0x683a('0x48')]['id']}},_0x4a0698={};_0x4a0698[_0x683a('0x34')]=_[_0x683a('0x35')](db['WhatsappQueue'][_0x683a('0x49')]);_0x4a0698['query']=_[_0x683a('0x35')](_0x5e0a82[_0x683a('0x36')]);_0x4a0698['filters']=_[_0x683a('0x38')](_0x4a0698['model'],_0x4a0698[_0x683a('0x36')]);_0x3e3073[_0x683a('0x39')]=_[_0x683a('0x38')](_0x4a0698[_0x683a('0x34')],qs[_0x683a('0x3a')](_0x5e0a82[_0x683a('0x36')][_0x683a('0x3a')]));_0x3e3073['attributes']=_0x3e3073['attributes'][_0x683a('0x3b')]?_0x3e3073[_0x683a('0x39')]:_0x4a0698[_0x683a('0x34')];if(_0x5e0a82[_0x683a('0x36')][_0x683a('0x44')]){_0x3e3073['include']=[{'all':!![]}];}_0x3e3073=_['merge']({},_0x3e3073,_0x5e0a82[_0x683a('0x43')]);return db[_0x683a('0x30')]['find'](_0x3e3073)[_0x683a('0x25')](handleEntityNotFound(_0x27643a,null))[_0x683a('0x25')](respondWithResult(_0x27643a,null))[_0x683a('0x46')](handleError(_0x27643a,null));};exports['create']=function(_0x57f419,_0x15be01){return db[_0x683a('0x30')][_0x683a('0x4a')](_0x57f419['body'],{})[_0x683a('0x25')](function(_0x2c6f01){var _0x26b409=_0x57f419['user']['get']({'plain':!![]});if(!_0x26b409)throw new Error(_0x683a('0x4b'));if(_0x26b409[_0x683a('0x4c')]===_0x683a('0x4d')){var _0x21001b=_0x2c6f01[_0x683a('0x26')]({'plain':!![]});var _0x2f0e39=_0x683a('0x27');return db['UserProfileSection'][_0x683a('0x4e')]({'where':{'name':_0x2f0e39,'userProfileId':_0x26b409[_0x683a('0x4f')]},'raw':!![]})[_0x683a('0x25')](function(_0x3bd113){if(_0x3bd113&&_0x3bd113[_0x683a('0x50')]===0x0){return db[_0x683a('0x28')][_0x683a('0x4a')]({'name':_0x21001b[_0x683a('0x2c')],'resourceId':_0x21001b['id'],'type':_0x3bd113[_0x683a('0x2c')],'sectionId':_0x3bd113['id']},{})[_0x683a('0x25')](function(){return _0x2c6f01;});}else{return _0x2c6f01;}})['catch'](function(_0x3d8193){logger[_0x683a('0x51')](_0x683a('0x52'),_0x3d8193);throw _0x3d8193;});}return _0x2c6f01;})[_0x683a('0x25')](respondWithResult(_0x15be01,0xc9))['catch'](handleError(_0x15be01,null));};exports[_0x683a('0x24')]=function(_0x2962fa,_0x1f301c){if(_0x2962fa[_0x683a('0x53')]['id']){delete _0x2962fa['body']['id'];}return db[_0x683a('0x30')]['find']({'where':{'id':_0x2962fa[_0x683a('0x48')]['id']}})[_0x683a('0x25')](handleEntityNotFound(_0x1f301c,null))[_0x683a('0x25')](saveUpdates(_0x2962fa[_0x683a('0x53')],null))[_0x683a('0x25')](respondWithResult(_0x1f301c,null))[_0x683a('0x46')](handleError(_0x1f301c,null));};exports['destroy']=function(_0x140e62,_0xb05423){return db['WhatsappQueue']['find']({'where':{'id':_0x140e62[_0x683a('0x48')]['id']}})[_0x683a('0x25')](handleEntityNotFound(_0xb05423,null))['then'](removeEntity(_0xb05423,null))['catch'](handleError(_0xb05423,null));};exports[_0x683a('0x54')]=function(_0x566890,_0x3f8f2b){return db['WhatsappQueue']['describe']()[_0x683a('0x25')](respondWithResult(_0x3f8f2b,null))[_0x683a('0x46')](handleError(_0x3f8f2b,null));};exports[_0x683a('0x55')]=function(_0x49ea75,_0xfb28a4,_0x7709e9){var _0x195d80={'raw':!![],'where':{}},_0x274cf4={},_0x55435a;return db[_0x683a('0x30')][_0x683a('0x56')]({'where':{'id':_0x49ea75['params']['id']}})[_0x683a('0x25')](handleEntityNotFound(_0xfb28a4,null))[_0x683a('0x25')](function(_0x8877f6){if(_0x8877f6){_0x55435a=_0x8877f6[_0x683a('0x26')]({'plain':!![]});_0x274cf4[_0x683a('0x34')]=_['keys'](db[_0x683a('0x57')][_0x683a('0x49')]);_0x274cf4[_0x683a('0x36')]=_['keys'](_0x49ea75['query']);_0x274cf4[_0x683a('0x37')]=_[_0x683a('0x38')](_0x274cf4[_0x683a('0x34')],_0x274cf4[_0x683a('0x36')]);_0x195d80[_0x683a('0x39')]=_['intersection'](_0x274cf4['model'],qs[_0x683a('0x3a')](_0x49ea75['query'][_0x683a('0x3a')]));_0x195d80['attributes']=_0x195d80['attributes'][_0x683a('0x3b')]?_0x195d80[_0x683a('0x39')]:_0x274cf4['model'];if(!_0x49ea75[_0x683a('0x36')][_0x683a('0x3c')](_0x683a('0x3d'))){_0x195d80[_0x683a('0x1e')]=qs[_0x683a('0x1e')](_0x49ea75[_0x683a('0x36')]['limit']);_0x195d80['offset']=qs[_0x683a('0x1d')](_0x49ea75[_0x683a('0x36')][_0x683a('0x1d')]);}_0x195d80[_0x683a('0x58')]=qs['sort'](_0x49ea75[_0x683a('0x36')][_0x683a('0x3e')]);_0x195d80[_0x683a('0x42')]=qs[_0x683a('0x37')](_[_0x683a('0x3f')](_0x49ea75[_0x683a('0x36')],_0x274cf4[_0x683a('0x37')]));_0x195d80['where'][_0x683a('0x59')]=_0x8877f6['id'];if(_0x49ea75[_0x683a('0x36')][_0x683a('0x40')]){_0x195d80['where']=_['merge'](_0x195d80[_0x683a('0x42')],{'$or':_['map'](_0x195d80['attributes'],function(_0xe27c70){var _0x25af17={};_0x25af17[_0xe27c70]={'$like':'%'+_0x49ea75[_0x683a('0x36')][_0x683a('0x40')]+'%'};return _0x25af17;})});}_0x195d80=_[_0x683a('0x41')]({},_0x195d80,_0x49ea75[_0x683a('0x43')]);return db[_0x683a('0x57')][_0x683a('0x5a')](_0x195d80);}})[_0x683a('0x25')](function(_0x1677b6){if(_0x1677b6){return db[_0x683a('0x5b')][_0x683a('0x5c')]({'where':{'id':_[_0x683a('0x2f')](_0x1677b6,'UserId'),'role':_0x683a('0x5d')},'attributes':['id',_0x683a('0x2c'),_0x683a('0x5e'),_0x683a('0x5f'),_0x683a('0x60')]});}})[_0x683a('0x25')](function(_0x55f7af){if(_0x55f7af){return{'count':_0x55f7af[_0x683a('0x1f')],'rows':_[_0x683a('0x2f')](_0x55f7af[_0x683a('0x61')],function(_0x5cd2d0){return{'membername':_0x5cd2d0[_0x683a('0x2c')],'UserId':_0x5cd2d0['id'],'queue_name':_0x55435a['name'],'WhatsappQueueId':_0x55435a['id'],'interface':util[_0x683a('0x62')](_0x683a('0x63'),'SIP',_0x5cd2d0[_0x683a('0x2c')]),'penalty':0x0,'paused':_0x5cd2d0[_0x683a('0x5e')],'createdAt':_0x5cd2d0[_0x683a('0x60')],'updatedAt':_0x5cd2d0[_0x683a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x683a('0x25')](respondWithFilteredResult(_0xfb28a4,_0x195d80))[_0x683a('0x46')](handleError(_0xfb28a4,null));};exports[_0x683a('0x64')]=function(_0x475e79,_0x57fb92,_0x546e90){var _0x45f5b7={};var _0x95cb3b={};var _0x37e8cc;var _0x23a2b9;return db[_0x683a('0x30')][_0x683a('0x56')]({'where':{'id':_0x475e79[_0x683a('0x48')]['id']}})[_0x683a('0x25')](handleEntityNotFound(_0x57fb92,null))['then'](function(_0x4a69c9){if(_0x4a69c9){_0x37e8cc=_0x4a69c9;_0x95cb3b[_0x683a('0x34')]=_[_0x683a('0x35')](db[_0x683a('0x65')][_0x683a('0x49')]);_0x95cb3b[_0x683a('0x36')]=_['keys'](_0x475e79[_0x683a('0x36')]);_0x95cb3b[_0x683a('0x37')]=_[_0x683a('0x38')](_0x95cb3b[_0x683a('0x34')],_0x95cb3b[_0x683a('0x36')]);_0x45f5b7[_0x683a('0x39')]=_[_0x683a('0x38')](_0x95cb3b['model'],qs[_0x683a('0x3a')](_0x475e79[_0x683a('0x36')][_0x683a('0x3a')]));_0x45f5b7['attributes']=_0x45f5b7[_0x683a('0x39')][_0x683a('0x3b')]?_0x45f5b7[_0x683a('0x39')]:_0x95cb3b['model'];_0x45f5b7['order']=qs[_0x683a('0x3e')](_0x475e79[_0x683a('0x36')][_0x683a('0x3e')]);_0x45f5b7['where']=qs[_0x683a('0x37')](_[_0x683a('0x3f')](_0x475e79[_0x683a('0x36')],_0x95cb3b[_0x683a('0x37')]));if(_0x475e79[_0x683a('0x36')]['filter']){_0x45f5b7[_0x683a('0x42')]=_[_0x683a('0x41')](_0x45f5b7['where'],{'$or':_[_0x683a('0x2f')](_0x45f5b7[_0x683a('0x39')],function(_0x39ff49){var _0x476ed1={};_0x476ed1[_0x39ff49]={'$like':'%'+_0x475e79[_0x683a('0x36')][_0x683a('0x40')]+'%'};return _0x476ed1;})});}_0x45f5b7=_[_0x683a('0x41')]({},_0x45f5b7,_0x475e79[_0x683a('0x43')]);return _0x37e8cc[_0x683a('0x64')](_0x45f5b7);}})[_0x683a('0x25')](function(_0x5ed8d7){if(_0x5ed8d7){_0x23a2b9=_0x5ed8d7[_0x683a('0x3b')];if(!_0x475e79[_0x683a('0x36')][_0x683a('0x3c')](_0x683a('0x3d'))){_0x45f5b7[_0x683a('0x1e')]=qs[_0x683a('0x1e')](_0x475e79[_0x683a('0x36')][_0x683a('0x1e')]);_0x45f5b7[_0x683a('0x1d')]=qs[_0x683a('0x1d')](_0x475e79[_0x683a('0x36')][_0x683a('0x1d')]);}return _0x37e8cc['getTeams'](_0x45f5b7);}})[_0x683a('0x25')](function(_0x28a8a7){if(_0x28a8a7){return _0x28a8a7?{'count':_0x23a2b9,'rows':_0x28a8a7}:null;}})[_0x683a('0x25')](respondWithResult(_0x57fb92,null))[_0x683a('0x46')](handleError(_0x57fb92,null));};exports[_0x683a('0x66')]=function(_0x34a0db,_0x130138,_0x5ba535){var _0x4e2dbf=_0x34a0db[_0x683a('0x53')][_0x683a('0x67')];return db[_0x683a('0x65')]['findAll']({'where':{'id':_0x4e2dbf},'attributes':['id'],'include':[{'model':db[_0x683a('0x5b')],'as':_0x683a('0x68'),'attributes':['id',_0x683a('0x2c'),'online',_0x683a('0x69'),_0x683a('0x6a')],'raw':!![]}]})[_0x683a('0x25')](function(_0x10205b){if(_0x10205b){var _0x588f7b=_[_0x683a('0x6b')](_0x10205b,function(_0x332ad7){var _0x5bd411=_0x332ad7[_0x683a('0x26')]({'plain':!![]});return _0x5bd411[_0x683a('0x68')];});return db[_0x683a('0x30')]['find']({'where':{'id':_0x34a0db['params']['id']}})[_0x683a('0x25')](function(_0x3897ae){return db[_0x683a('0x6c')][_0x683a('0x6d')](function(_0x3725c5){return _0x3897ae['addTeams'](_0x4e2dbf,{'transaction':_0x3725c5})[_0x683a('0x25')](function(){return BPromise['each'](_0x588f7b,function(_0x1b3c3c){return db[_0x683a('0x57')][_0x683a('0x6e')]({'where':{'UserId':_0x1b3c3c['id'],'WhatsappQueueId':_0x34a0db['params']['id']},'transaction':_0x3725c5});});})[_0x683a('0x25')](function(){_0x588f7b['forEach'](function(_0x24d1e2){socket[_0x683a('0x6f')](_0x683a('0x70'),{'UserId':_0x24d1e2['id'],'WhatsappQueueId':_0x3897ae['id']});});});});});}})['then'](respondWithStatusCode(_0x130138,null))[_0x683a('0x46')](handleError(_0x130138,null));};exports[_0x683a('0x71')]=function(_0x2aadb0,_0x40186a,_0x1d4302){return db['Team']['findAll']({'where':{'id':_0x2aadb0[_0x683a('0x36')][_0x683a('0x67')]},'attributes':['id'],'include':[{'model':db[_0x683a('0x5b')],'as':_0x683a('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40186a,null))['then'](function(_0x35299c){var _0x2626b9=_[_0x683a('0x2f')](_0x35299c,'id');var _0x1772ad=[];var _0x4b49de=[];var _0x4f8cd9=squel[_0x683a('0x72')]();_0x4f8cd9[_0x683a('0x73')](_0x683a('0x74'))[_0x683a('0x75')](_0x683a('0x76'),'tq')[_0x683a('0x77')](_0x683a('0x78'),'ut',_0x683a('0x79'))[_0x683a('0x42')](_0x683a('0x7a'),_0x2aadb0[_0x683a('0x48')]['id']);for(var _0xdb2d64=0x0;_0xdb2d64<_0x35299c[_0x683a('0x3b')];_0xdb2d64+=0x1){let _0x477389=_0x35299c[_0xdb2d64];for(var _0x42dc2b=0x0;_0x42dc2b<_0x477389['Agents'][_0x683a('0x3b')];_0x42dc2b+=0x1){let _0x49efdf=_0x477389[_0x683a('0x68')][_0x42dc2b];var _0x2c78df=_0x4f8cd9[_0x683a('0x7b')]();_0x2c78df['where']('ut.UserId\x20=\x20?',_0x49efdf['id']);_0x4b49de[_0x683a('0x7c')](db[_0x683a('0x6c')][_0x683a('0x36')](_0x2c78df[_0x683a('0x7d')](),{'type':db[_0x683a('0x6c')][_0x683a('0x7e')]['SELECT']})[_0x683a('0x25')](function(_0x55d7f0){if(_0x55d7f0['length']===0x1){return _0x49efdf['id'];}else{var _0x14d484=_[_0x683a('0x7f')](_[_0x683a('0x2f')](_0x55d7f0,_0x683a('0x80')),function(_0x8a013b){return _[_0x683a('0x81')](_0x2626b9,_0x8a013b);});if(_0x14d484){return _0x49efdf['id'];}}}));}}return BPromise[_0x683a('0x82')](_0x4b49de)['then'](function(_0x114584){_0x1772ad=_(_0x1772ad)[_0x683a('0x83')](_0x114584)[_0x683a('0x84')]()[_0x683a('0x85')]();return db[_0x683a('0x30')]['find']({'where':{'id':_0x2aadb0['params']['id']}})[_0x683a('0x25')](function(_0x5098e0){return db['sequelize'][_0x683a('0x6d')](function(_0xed054e){return _0x5098e0['removeTeams'](_0x2aadb0[_0x683a('0x36')][_0x683a('0x67')],{'transaction':_0xed054e})['then'](function(){if(!_[_0x683a('0x86')](_0x1772ad)){return _0x5098e0[_0x683a('0x87')](_0x1772ad,{'transaction':_0xed054e});}})[_0x683a('0x25')](function(){_0x1772ad[_0x683a('0x88')](function(_0x3e28a7){socket[_0x683a('0x6f')](_0x683a('0x89'),{'UserId':_0x3e28a7,'WhatsappQueueId':_0x5098e0['id']});});});});});});})[_0x683a('0x25')](respondWithStatusCode(_0x40186a,null))[_0x683a('0x46')](handleError(_0x40186a,null));};exports[_0x683a('0x8a')]=function(_0x38f21f,_0xd634f8,_0x3143ce){return db[_0x683a('0x30')][_0x683a('0x4e')]({'where':{'id':_0x38f21f['params']['id']}})[_0x683a('0x25')](handleEntityNotFound(_0xd634f8,null))[_0x683a('0x25')](function(_0x361032){if(_0x361032){return _0x361032[_0x683a('0x8a')](_0x38f21f[_0x683a('0x53')][_0x683a('0x67')],_[_0x683a('0x8b')](_0x38f21f[_0x683a('0x53')],[_0x683a('0x67'),'id'])||{})[_0x683a('0x8c')](function(_0x359735){for(var _0x5cf0f6=0x0;_0x5cf0f6<_0x38f21f[_0x683a('0x53')][_0x683a('0x67')][_0x683a('0x3b')];_0x5cf0f6+=0x1){socket[_0x683a('0x6f')]('userWhatsappQueue:save',{'UserId':Number(_0x38f21f[_0x683a('0x53')][_0x683a('0x67')][_0x5cf0f6]),'WhatsappQueueId':Number(_0x38f21f[_0x683a('0x48')]['id'])});}return _0x359735;});}})[_0x683a('0x25')](respondWithResult(_0xd634f8,null))[_0x683a('0x46')](handleError(_0xd634f8,null));};exports[_0x683a('0x87')]=function(_0x31956b,_0xa9c942,_0x47195d){return db[_0x683a('0x30')][_0x683a('0x4e')]({'where':{'id':_0x31956b[_0x683a('0x48')]['id']}})['then'](handleEntityNotFound(_0xa9c942,null))[_0x683a('0x25')](function(_0x26434a){if(_0x26434a){return _0x26434a[_0x683a('0x87')](_0x31956b['query'][_0x683a('0x67')])['then'](function(){if(_['isArray'](_0x31956b['query'][_0x683a('0x67')])){for(var _0x546d2a=0x0;_0x546d2a<_0x31956b[_0x683a('0x36')]['ids'][_0x683a('0x3b')];_0x546d2a+=0x1){socket[_0x683a('0x6f')]('userWhatsappQueue:remove',{'UserId':Number(_0x31956b[_0x683a('0x36')][_0x683a('0x67')][_0x546d2a]),'WhatsappQueueId':Number(_0x31956b['params']['id'])});}}else{socket[_0x683a('0x6f')](_0x683a('0x89'),{'UserId':Number(_0x31956b[_0x683a('0x36')]['ids']),'WhatsappQueueId':Number(_0x31956b[_0x683a('0x48')]['id'])});}});}})[_0x683a('0x25')](respondWithStatusCode(_0xa9c942,null))[_0x683a('0x46')](handleError(_0xa9c942,null));};exports[_0x683a('0x8d')]=function(_0x15dabb,_0x5a4e5c,_0x44a024){var _0x3a271d={};var _0x3250a5={};var _0x1741dc;var _0x5101ad;return db['WhatsappQueue']['findOne']({'where':{'id':_0x15dabb[_0x683a('0x48')]['id']}})[_0x683a('0x25')](handleEntityNotFound(_0x5a4e5c,null))['then'](function(_0x1c37d8){if(_0x1c37d8){_0x1741dc=_0x1c37d8;_0x3250a5['model']=_['keys'](db[_0x683a('0x5b')][_0x683a('0x49')]);_0x3250a5['query']=_[_0x683a('0x35')](_0x15dabb[_0x683a('0x36')]);_0x3250a5[_0x683a('0x37')]=_[_0x683a('0x38')](_0x3250a5[_0x683a('0x34')],_0x3250a5[_0x683a('0x36')]);_0x3a271d[_0x683a('0x39')]=_['intersection'](_0x3250a5[_0x683a('0x34')],qs[_0x683a('0x3a')](_0x15dabb[_0x683a('0x36')][_0x683a('0x3a')]));_0x3a271d[_0x683a('0x39')]=_0x3a271d[_0x683a('0x39')][_0x683a('0x3b')]?_0x3a271d[_0x683a('0x39')]:_0x3250a5[_0x683a('0x34')];_0x3a271d[_0x683a('0x58')]=qs[_0x683a('0x3e')](_0x15dabb[_0x683a('0x36')][_0x683a('0x3e')]);_0x3a271d[_0x683a('0x42')]=qs[_0x683a('0x37')](_['pick'](_0x15dabb[_0x683a('0x36')],_0x3250a5[_0x683a('0x37')]));if(_0x15dabb[_0x683a('0x36')][_0x683a('0x40')]){_0x3a271d[_0x683a('0x42')]=_[_0x683a('0x41')](_0x3a271d[_0x683a('0x42')],{'$or':_[_0x683a('0x2f')](_0x3a271d[_0x683a('0x39')],function(_0x4907e7){var _0x2f7b35={};_0x2f7b35[_0x4907e7]={'$like':'%'+_0x15dabb[_0x683a('0x36')]['filter']+'%'};return _0x2f7b35;})});}_0x3a271d=_[_0x683a('0x41')]({},_0x3a271d,_0x15dabb[_0x683a('0x43')]);return _0x1741dc[_0x683a('0x8d')](_0x3a271d);}})[_0x683a('0x25')](function(_0x34b5e8){if(_0x34b5e8){_0x5101ad=_0x34b5e8[_0x683a('0x3b')];if(!_0x15dabb[_0x683a('0x36')][_0x683a('0x3c')](_0x683a('0x3d'))){_0x3a271d['limit']=qs[_0x683a('0x1e')](_0x15dabb[_0x683a('0x36')][_0x683a('0x1e')]);_0x3a271d[_0x683a('0x1d')]=qs[_0x683a('0x1d')](_0x15dabb[_0x683a('0x36')][_0x683a('0x1d')]);}return _0x1741dc['getAgents'](_0x3a271d);}})[_0x683a('0x25')](function(_0x4f31e5){if(_0x4f31e5){return _0x4f31e5?{'count':_0x5101ad,'rows':_0x4f31e5}:null;}})[_0x683a('0x25')](respondWithResult(_0x5a4e5c,null))[_0x683a('0x46')](handleError(_0x5a4e5c,null));}; \ No newline at end of file +var _0xfa17=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','WhatsappQueue','findAll','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','WhatsappQueueId','UserWhatsappQueue','whatsappPause','updatedAt','createdAt','rows','SIP','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','User','field','tq.TeamId','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','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/environment','../../mysqldb','redis','defaults','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x177306,_0xd1d010){var _0x328fb4=function(_0x40bd10){while(--_0x40bd10){_0x177306['push'](_0x177306['shift']());}};_0x328fb4(++_0xd1d010);}(_0xfa17,0xd0));var _0x7fa1=function(_0x2b533b,_0x1cfbf9){_0x2b533b=_0x2b533b-0x0;var _0x2098db=_0xfa17[_0x2b533b];return _0x2098db;};'use strict';var emlformat=require(_0x7fa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fa1('0x1'));var jsonpatch=require(_0x7fa1('0x2'));var rp=require('request-promise');var moment=require(_0x7fa1('0x3'));var BPromise=require(_0x7fa1('0x4'));var Mustache=require(_0x7fa1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7fa1('0x6'));var csv=require(_0x7fa1('0x7'));var ejs=require(_0x7fa1('0x8'));var fs=require('fs');var fs_extra=require(_0x7fa1('0x9'));var _=require(_0x7fa1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7fa1('0xb'));var deskjs=require(_0x7fa1('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7fa1('0xd'));var authService=require(_0x7fa1('0xe'));var qs=require(_0x7fa1('0xf'));var as=require(_0x7fa1('0x10'));var hardwareService=require(_0x7fa1('0x11'));var logger=require(_0x7fa1('0x12'))(_0x7fa1('0x13'));var utils=require('../../config/utils');var config=require(_0x7fa1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fa1('0x15'))['db'];config[_0x7fa1('0x16')]=_[_0x7fa1('0x17')](config[_0x7fa1('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fa1('0x16')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x1d60e1,_0x19083a){_0x19083a=_0x19083a||0xcc;return function(_0x3f608a){if(_0x3f608a){return _0x1d60e1[_0x7fa1('0x18')](_0x19083a);}return _0x1d60e1[_0x7fa1('0x19')](_0x19083a)['end']();};}function respondWithResult(_0x62c3bd,_0x42dd41){_0x42dd41=_0x42dd41||0xc8;return function(_0x320b38){if(_0x320b38){return _0x62c3bd[_0x7fa1('0x19')](_0x42dd41)[_0x7fa1('0x1a')](_0x320b38);}};}function respondWithFilteredResult(_0x5d9fb4,_0x2fb67e){return function(_0x52ef93){if(_0x52ef93){var _0x213754=typeof _0x2fb67e['offset']===_0x7fa1('0x1b')&&typeof _0x2fb67e[_0x7fa1('0x1c')]===_0x7fa1('0x1b');var _0x34caa4=_0x52ef93[_0x7fa1('0x1d')];var _0x3f85c5=_0x213754?0x0:_0x2fb67e[_0x7fa1('0x1e')];var _0x5c989f=_0x213754?_0x52ef93[_0x7fa1('0x1d')]:_0x2fb67e['offset']+_0x2fb67e[_0x7fa1('0x1c')];var _0x174cc0;if(_0x5c989f>=_0x34caa4){_0x5c989f=_0x34caa4;_0x174cc0=0xc8;}else{_0x174cc0=0xce;}_0x5d9fb4[_0x7fa1('0x19')](_0x174cc0);return _0x5d9fb4[_0x7fa1('0x1f')](_0x7fa1('0x20'),_0x3f85c5+'-'+_0x5c989f+'/'+_0x34caa4)[_0x7fa1('0x1a')](_0x52ef93);}return null;};}function patchUpdates(_0x3273b1){return function(_0x44c327){try{jsonpatch[_0x7fa1('0x21')](_0x44c327,_0x3273b1,!![]);}catch(_0x5ec320){return BPromise['reject'](_0x5ec320);}return _0x44c327['save']();};}function saveUpdates(_0x301243,_0x178b5d){return function(_0x20102c){if(_0x20102c){return _0x20102c[_0x7fa1('0x22')](_0x301243)[_0x7fa1('0x23')](function(_0x91b2c0){return _0x91b2c0;});}return null;};}function removeEntity(_0x296992,_0x3d9cf6){return function(_0x2c1c64){if(_0x2c1c64){return _0x2c1c64[_0x7fa1('0x24')]()[_0x7fa1('0x23')](function(){var _0x2658c9=_0x2c1c64['get']({'plain':!![]});var _0x743731='WhatsappQueues';return db[_0x7fa1('0x25')][_0x7fa1('0x24')]({'where':{'type':_0x743731,'resourceId':_0x2658c9['id']}})['then'](function(){return _0x2c1c64;});})[_0x7fa1('0x23')](function(){_0x296992[_0x7fa1('0x19')](0xcc)[_0x7fa1('0x26')]();});}};}function handleEntityNotFound(_0x521756,_0x2106c2){return function(_0x2dbde1){if(!_0x2dbde1){_0x521756[_0x7fa1('0x18')](0x194);}return _0x2dbde1;};}function handleError(_0xa896f8,_0x3f3f65){_0x3f3f65=_0x3f3f65||0x1f4;return function(_0x20ede1){logger[_0x7fa1('0x27')](_0x20ede1[_0x7fa1('0x28')]);if(_0x20ede1['name']){delete _0x20ede1[_0x7fa1('0x29')];}_0xa896f8[_0x7fa1('0x19')](_0x3f3f65)[_0x7fa1('0x2a')](_0x20ede1);};}exports[_0x7fa1('0x2b')]=function(_0x359c0c,_0x39af24){var _0x11bc83={},_0x2b048f={},_0x3dd055={'count':0x0,'rows':[]};var _0x1f90fc=_[_0x7fa1('0x2c')](db['WhatsappQueue'][_0x7fa1('0x2d')],function(_0x48eb21){return{'name':_0x48eb21[_0x7fa1('0x2e')],'type':_0x48eb21[_0x7fa1('0x2f')][_0x7fa1('0x30')]};});_0x2b048f[_0x7fa1('0x31')]=_['map'](_0x1f90fc,_0x7fa1('0x29'));_0x2b048f[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x359c0c['query']);_0x2b048f[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x2b048f[_0x7fa1('0x31')],_0x2b048f[_0x7fa1('0x32')]);_0x11bc83['attributes']=_[_0x7fa1('0x35')](_0x2b048f[_0x7fa1('0x31')],qs[_0x7fa1('0x36')](_0x359c0c['query'][_0x7fa1('0x36')]));_0x11bc83[_0x7fa1('0x37')]=_0x11bc83[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x11bc83['attributes']:_0x2b048f['model'];if(!_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x11bc83[_0x7fa1('0x1c')]=qs[_0x7fa1('0x1c')](_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x11bc83['offset']=qs['offset'](_0x359c0c[_0x7fa1('0x32')]['offset']);}_0x11bc83[_0x7fa1('0x3b')]=qs[_0x7fa1('0x3c')](_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3c')]);_0x11bc83['where']=qs['filters'](_[_0x7fa1('0x3d')](_0x359c0c[_0x7fa1('0x32')],_0x2b048f[_0x7fa1('0x34')]),_0x1f90fc);if(_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x11bc83[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x11bc83['where'],{'$or':_[_0x7fa1('0x2c')](_0x1f90fc,function(_0x59fd0c){if(_0x59fd0c[_0x7fa1('0x2f')]!=='VIRTUAL'){var _0x12ad50={};_0x12ad50[_0x59fd0c[_0x7fa1('0x29')]]={'$like':'%'+_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3e')]+'%'};return _0x12ad50;}})});}_0x11bc83=_[_0x7fa1('0x40')]({},_0x11bc83,_0x359c0c['options']);var _0x512988={'where':_0x11bc83['where']};return db['WhatsappQueue'][_0x7fa1('0x1d')](_0x512988)[_0x7fa1('0x23')](function(_0x130d88){_0x3dd055[_0x7fa1('0x1d')]=_0x130d88;if(_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x41')]){_0x11bc83[_0x7fa1('0x42')]=[{'all':!![]}];}return db[_0x7fa1('0x43')][_0x7fa1('0x44')](_0x11bc83);})['then'](function(_0x114f60){_0x3dd055['rows']=_0x114f60;return _0x3dd055;})[_0x7fa1('0x23')](respondWithFilteredResult(_0x39af24,_0x11bc83))[_0x7fa1('0x45')](handleError(_0x39af24,null));};exports['show']=function(_0x962fa7,_0x5353d8){var _0x25e476={'raw':!![],'where':{'id':_0x962fa7[_0x7fa1('0x46')]['id']}},_0x244823={};_0x244823[_0x7fa1('0x31')]=_['keys'](db['WhatsappQueue'][_0x7fa1('0x2d')]);_0x244823[_0x7fa1('0x32')]=_['keys'](_0x962fa7[_0x7fa1('0x32')]);_0x244823[_0x7fa1('0x34')]=_['intersection'](_0x244823['model'],_0x244823['query']);_0x25e476[_0x7fa1('0x37')]=_[_0x7fa1('0x35')](_0x244823[_0x7fa1('0x31')],qs['fields'](_0x962fa7[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x25e476[_0x7fa1('0x37')]=_0x25e476['attributes'][_0x7fa1('0x38')]?_0x25e476[_0x7fa1('0x37')]:_0x244823[_0x7fa1('0x31')];if(_0x962fa7[_0x7fa1('0x32')][_0x7fa1('0x41')]){_0x25e476['include']=[{'all':!![]}];}_0x25e476=_['merge']({},_0x25e476,_0x962fa7[_0x7fa1('0x47')]);return db['WhatsappQueue'][_0x7fa1('0x48')](_0x25e476)[_0x7fa1('0x23')](handleEntityNotFound(_0x5353d8,null))[_0x7fa1('0x23')](respondWithResult(_0x5353d8,null))[_0x7fa1('0x45')](handleError(_0x5353d8,null));};exports[_0x7fa1('0x49')]=function(_0xf7a3df,_0x42ba85){return db[_0x7fa1('0x43')][_0x7fa1('0x49')](_0xf7a3df[_0x7fa1('0x4a')],{})[_0x7fa1('0x23')](function(_0x301b41){var _0x3d9924=_0xf7a3df[_0x7fa1('0x4b')][_0x7fa1('0x4c')]({'plain':!![]});if(!_0x3d9924)throw new Error(_0x7fa1('0x4d'));if(_0x3d9924[_0x7fa1('0x4e')]===_0x7fa1('0x4b')){var _0x57bbc2=_0x301b41['get']({'plain':!![]});var _0x33b9b6=_0x7fa1('0x4f');return db['UserProfileSection'][_0x7fa1('0x48')]({'where':{'name':_0x33b9b6,'userProfileId':_0x3d9924[_0x7fa1('0x50')]},'raw':!![]})[_0x7fa1('0x23')](function(_0x46b4f7){if(_0x46b4f7&&_0x46b4f7[_0x7fa1('0x51')]===0x0){return db[_0x7fa1('0x25')]['create']({'name':_0x57bbc2[_0x7fa1('0x29')],'resourceId':_0x57bbc2['id'],'type':_0x46b4f7['name'],'sectionId':_0x46b4f7['id']},{})['then'](function(){return _0x301b41;});}else{return _0x301b41;}})[_0x7fa1('0x45')](function(_0x418a5d){logger['error'](_0x7fa1('0x52'),_0x418a5d);throw _0x418a5d;});}return _0x301b41;})[_0x7fa1('0x23')](respondWithResult(_0x42ba85,0xc9))[_0x7fa1('0x45')](handleError(_0x42ba85,null));};exports[_0x7fa1('0x22')]=function(_0x3a7126,_0x40bf5c){if(_0x3a7126[_0x7fa1('0x4a')]['id']){delete _0x3a7126[_0x7fa1('0x4a')]['id'];}return db['WhatsappQueue'][_0x7fa1('0x48')]({'where':{'id':_0x3a7126[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x40bf5c,null))[_0x7fa1('0x23')](saveUpdates(_0x3a7126[_0x7fa1('0x4a')],null))[_0x7fa1('0x23')](respondWithResult(_0x40bf5c,null))['catch'](handleError(_0x40bf5c,null));};exports[_0x7fa1('0x24')]=function(_0x1c3e86,_0x105e8e){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x1c3e86['params']['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x105e8e,null))[_0x7fa1('0x23')](removeEntity(_0x105e8e,null))[_0x7fa1('0x45')](handleError(_0x105e8e,null));};exports[_0x7fa1('0x53')]=function(_0x3fb297,_0x2611c3){return db['WhatsappQueue'][_0x7fa1('0x53')]()[_0x7fa1('0x23')](respondWithResult(_0x2611c3,null))['catch'](handleError(_0x2611c3,null));};exports['getMembers']=function(_0x4a543a,_0x481539,_0x39cdf2){var _0x6c0026={'raw':!![],'where':{}},_0x244b50={},_0x1625d;return db[_0x7fa1('0x43')][_0x7fa1('0x54')]({'where':{'id':_0x4a543a[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x481539,null))[_0x7fa1('0x23')](function(_0x153df7){if(_0x153df7){_0x1625d=_0x153df7[_0x7fa1('0x4c')]({'plain':!![]});_0x244b50[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db['UserWhatsappQueue'][_0x7fa1('0x2d')]);_0x244b50[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x4a543a['query']);_0x244b50[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x244b50['model'],_0x244b50[_0x7fa1('0x32')]);_0x6c0026[_0x7fa1('0x37')]=_['intersection'](_0x244b50[_0x7fa1('0x31')],qs['fields'](_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x6c0026['attributes']=_0x6c0026['attributes']['length']?_0x6c0026['attributes']:_0x244b50[_0x7fa1('0x31')];if(!_0x4a543a['query'][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x6c0026['limit']=qs['limit'](_0x4a543a['query'][_0x7fa1('0x1c')]);_0x6c0026[_0x7fa1('0x1e')]=qs[_0x7fa1('0x1e')](_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x1e')]);}_0x6c0026['order']=qs['sort'](_0x4a543a[_0x7fa1('0x32')]['sort']);_0x6c0026['where']=qs[_0x7fa1('0x34')](_['pick'](_0x4a543a['query'],_0x244b50['filters']));_0x6c0026[_0x7fa1('0x3f')][_0x7fa1('0x55')]=_0x153df7['id'];if(_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x6c0026['where']=_['merge'](_0x6c0026['where'],{'$or':_[_0x7fa1('0x2c')](_0x6c0026[_0x7fa1('0x37')],function(_0x1295f6){var _0x381ce0={};_0x381ce0[_0x1295f6]={'$like':'%'+_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x3e')]+'%'};return _0x381ce0;})});}_0x6c0026=_[_0x7fa1('0x40')]({},_0x6c0026,_0x4a543a[_0x7fa1('0x47')]);return db[_0x7fa1('0x56')][_0x7fa1('0x44')](_0x6c0026);}})[_0x7fa1('0x23')](function(_0x53ac61){if(_0x53ac61){return db['User']['findAndCountAll']({'where':{'id':_[_0x7fa1('0x2c')](_0x53ac61,'UserId'),'role':'agent'},'attributes':['id',_0x7fa1('0x29'),_0x7fa1('0x57'),_0x7fa1('0x58'),_0x7fa1('0x59')]});}})[_0x7fa1('0x23')](function(_0x7495db){if(_0x7495db){return{'count':_0x7495db[_0x7fa1('0x1d')],'rows':_[_0x7fa1('0x2c')](_0x7495db[_0x7fa1('0x5a')],function(_0x5bf325){return{'membername':_0x5bf325[_0x7fa1('0x29')],'UserId':_0x5bf325['id'],'queue_name':_0x1625d['name'],'WhatsappQueueId':_0x1625d['id'],'interface':util['format']('%s/%s',_0x7fa1('0x5b'),_0x5bf325[_0x7fa1('0x29')]),'penalty':0x0,'paused':_0x5bf325[_0x7fa1('0x57')],'createdAt':_0x5bf325[_0x7fa1('0x59')],'updatedAt':_0x5bf325[_0x7fa1('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7fa1('0x23')](respondWithFilteredResult(_0x481539,_0x6c0026))[_0x7fa1('0x45')](handleError(_0x481539,null));};exports['getTeams']=function(_0x485436,_0x50992d,_0x5cd583){var _0x4e0811={};var _0x1cfbdf={};var _0x377428;var _0x38fb86;return db[_0x7fa1('0x43')]['findOne']({'where':{'id':_0x485436['params']['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x50992d,null))[_0x7fa1('0x23')](function(_0xa58cec){if(_0xa58cec){_0x377428=_0xa58cec;_0x1cfbdf[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db[_0x7fa1('0x5c')][_0x7fa1('0x2d')]);_0x1cfbdf[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x485436[_0x7fa1('0x32')]);_0x1cfbdf[_0x7fa1('0x34')]=_['intersection'](_0x1cfbdf[_0x7fa1('0x31')],_0x1cfbdf[_0x7fa1('0x32')]);_0x4e0811[_0x7fa1('0x37')]=_['intersection'](_0x1cfbdf[_0x7fa1('0x31')],qs[_0x7fa1('0x36')](_0x485436[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x4e0811[_0x7fa1('0x37')]=_0x4e0811[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x4e0811[_0x7fa1('0x37')]:_0x1cfbdf[_0x7fa1('0x31')];_0x4e0811['order']=qs[_0x7fa1('0x3c')](_0x485436['query']['sort']);_0x4e0811[_0x7fa1('0x3f')]=qs[_0x7fa1('0x34')](_[_0x7fa1('0x3d')](_0x485436[_0x7fa1('0x32')],_0x1cfbdf[_0x7fa1('0x34')]));if(_0x485436[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x4e0811[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x4e0811[_0x7fa1('0x3f')],{'$or':_[_0x7fa1('0x2c')](_0x4e0811[_0x7fa1('0x37')],function(_0xec2f99){var _0x5c4143={};_0x5c4143[_0xec2f99]={'$like':'%'+_0x485436['query'][_0x7fa1('0x3e')]+'%'};return _0x5c4143;})});}_0x4e0811=_[_0x7fa1('0x40')]({},_0x4e0811,_0x485436[_0x7fa1('0x47')]);return _0x377428['getTeams'](_0x4e0811);}})['then'](function(_0x475bf0){if(_0x475bf0){_0x38fb86=_0x475bf0[_0x7fa1('0x38')];if(!_0x485436[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x4e0811[_0x7fa1('0x1c')]=qs['limit'](_0x485436[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x4e0811['offset']=qs['offset'](_0x485436[_0x7fa1('0x32')]['offset']);}return _0x377428[_0x7fa1('0x5d')](_0x4e0811);}})[_0x7fa1('0x23')](function(_0x17f271){if(_0x17f271){return _0x17f271?{'count':_0x38fb86,'rows':_0x17f271}:null;}})[_0x7fa1('0x23')](respondWithResult(_0x50992d,null))[_0x7fa1('0x45')](handleError(_0x50992d,null));};exports['addTeams']=function(_0x3968f0,_0x4176b7,_0x438728){var _0x5144eb=_0x3968f0['body'][_0x7fa1('0x5e')];return db[_0x7fa1('0x5c')][_0x7fa1('0x44')]({'where':{'id':_0x5144eb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7fa1('0x5f'),'attributes':['id',_0x7fa1('0x29'),_0x7fa1('0x60'),_0x7fa1('0x61'),_0x7fa1('0x62')],'raw':!![]}]})[_0x7fa1('0x23')](function(_0x303410){if(_0x303410){var _0xbb1ed2=_[_0x7fa1('0x63')](_0x303410,function(_0x59bb3e){var _0x26cc4b=_0x59bb3e[_0x7fa1('0x4c')]({'plain':!![]});return _0x26cc4b[_0x7fa1('0x5f')];});return db[_0x7fa1('0x43')]['find']({'where':{'id':_0x3968f0[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](function(_0x45adb7){return db['sequelize']['transaction'](function(_0x2e273c){return _0x45adb7['addTeams'](_0x5144eb,{'transaction':_0x2e273c})['then'](function(){return BPromise[_0x7fa1('0x64')](_0xbb1ed2,function(_0x157767){return db['UserWhatsappQueue'][_0x7fa1('0x65')]({'where':{'UserId':_0x157767['id'],'WhatsappQueueId':_0x3968f0[_0x7fa1('0x46')]['id']},'transaction':_0x2e273c});});})[_0x7fa1('0x23')](function(){_0xbb1ed2[_0x7fa1('0x66')](function(_0x1d6d45){socket[_0x7fa1('0x67')]('userWhatsappQueue:save',{'UserId':_0x1d6d45['id'],'WhatsappQueueId':_0x45adb7['id']});});});});});}})[_0x7fa1('0x23')](respondWithStatusCode(_0x4176b7,null))[_0x7fa1('0x45')](handleError(_0x4176b7,null));};exports['removeTeams']=function(_0x348f88,_0x3ef70c,_0x468813){return db[_0x7fa1('0x5c')][_0x7fa1('0x44')]({'where':{'id':_0x348f88[_0x7fa1('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7fa1('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7fa1('0x23')](handleEntityNotFound(_0x3ef70c,null))[_0x7fa1('0x23')](function(_0x572f1d){var _0x3e4d65=_[_0x7fa1('0x2c')](_0x572f1d,'id');var _0x10fada=[];var _0x2a7d9e=[];var _0x503dd6=squel['select']();_0x503dd6[_0x7fa1('0x69')](_0x7fa1('0x6a'))[_0x7fa1('0x6b')]('team_has_whatsapp_queues','tq')[_0x7fa1('0x6c')](_0x7fa1('0x6d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7fa1('0x3f')](_0x7fa1('0x6e'),_0x348f88[_0x7fa1('0x46')]['id']);for(var _0x237ead=0x0;_0x237ead<_0x572f1d[_0x7fa1('0x38')];_0x237ead+=0x1){let _0x1a5540=_0x572f1d[_0x237ead];for(var _0x19bc1d=0x0;_0x19bc1d<_0x1a5540[_0x7fa1('0x5f')]['length'];_0x19bc1d+=0x1){let _0x196cda=_0x1a5540[_0x7fa1('0x5f')][_0x19bc1d];var _0x4b964a=_0x503dd6[_0x7fa1('0x6f')]();_0x4b964a['where'](_0x7fa1('0x70'),_0x196cda['id']);_0x2a7d9e[_0x7fa1('0x71')](db['sequelize'][_0x7fa1('0x32')](_0x4b964a[_0x7fa1('0x72')](),{'type':db[_0x7fa1('0x73')][_0x7fa1('0x74')][_0x7fa1('0x75')]})[_0x7fa1('0x23')](function(_0x58dc5b){if(_0x58dc5b['length']===0x1){return _0x196cda['id'];}else{var _0x202609=_[_0x7fa1('0x76')](_[_0x7fa1('0x2c')](_0x58dc5b,_0x7fa1('0x77')),function(_0x3b41c1){return _[_0x7fa1('0x78')](_0x3e4d65,_0x3b41c1);});if(_0x202609){return _0x196cda['id'];}}}));}}return BPromise['all'](_0x2a7d9e)[_0x7fa1('0x23')](function(_0x5b32e1){_0x10fada=_(_0x10fada)['union'](_0x5b32e1)['compact']()[_0x7fa1('0x79')]();return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x348f88[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](function(_0xb7aeb1){return db['sequelize'][_0x7fa1('0x7a')](function(_0x3dd46d){return _0xb7aeb1['removeTeams'](_0x348f88[_0x7fa1('0x32')][_0x7fa1('0x5e')],{'transaction':_0x3dd46d})['then'](function(){if(!_[_0x7fa1('0x7b')](_0x10fada)){return _0xb7aeb1[_0x7fa1('0x7c')](_0x10fada,{'transaction':_0x3dd46d});}})[_0x7fa1('0x23')](function(){_0x10fada[_0x7fa1('0x66')](function(_0x372e4d){socket['emit'](_0x7fa1('0x7d'),{'UserId':_0x372e4d,'WhatsappQueueId':_0xb7aeb1['id']});});});});});});})[_0x7fa1('0x23')](respondWithStatusCode(_0x3ef70c,null))[_0x7fa1('0x45')](handleError(_0x3ef70c,null));};exports[_0x7fa1('0x7e')]=function(_0x58e6b3,_0x56bf09,_0x2a7491){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x58e6b3['params']['id']}})['then'](handleEntityNotFound(_0x56bf09,null))[_0x7fa1('0x23')](function(_0x58555d){if(_0x58555d){return _0x58555d['addAgents'](_0x58e6b3[_0x7fa1('0x4a')]['ids'],_[_0x7fa1('0x7f')](_0x58e6b3['body'],[_0x7fa1('0x5e'),'id'])||{})[_0x7fa1('0x80')](function(_0xd84fba){for(var _0x103b87=0x0;_0x103b87<_0x58e6b3[_0x7fa1('0x4a')][_0x7fa1('0x5e')][_0x7fa1('0x38')];_0x103b87+=0x1){socket[_0x7fa1('0x67')](_0x7fa1('0x81'),{'UserId':Number(_0x58e6b3[_0x7fa1('0x4a')][_0x7fa1('0x5e')][_0x103b87]),'WhatsappQueueId':Number(_0x58e6b3['params']['id'])});}return _0xd84fba;});}})[_0x7fa1('0x23')](respondWithResult(_0x56bf09,null))[_0x7fa1('0x45')](handleError(_0x56bf09,null));};exports[_0x7fa1('0x7c')]=function(_0x40bcf6,_0xbfedf6,_0x2e0ab1){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x40bcf6['params']['id']}})['then'](handleEntityNotFound(_0xbfedf6,null))[_0x7fa1('0x23')](function(_0x1f45db){if(_0x1f45db){return _0x1f45db[_0x7fa1('0x7c')](_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')])[_0x7fa1('0x23')](function(){if(_[_0x7fa1('0x82')](_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')])){for(var _0x465685=0x0;_0x465685<_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')][_0x7fa1('0x38')];_0x465685+=0x1){socket[_0x7fa1('0x67')](_0x7fa1('0x7d'),{'UserId':Number(_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')][_0x465685]),'WhatsappQueueId':Number(_0x40bcf6[_0x7fa1('0x46')]['id'])});}}else{socket[_0x7fa1('0x67')](_0x7fa1('0x7d'),{'UserId':Number(_0x40bcf6['query'][_0x7fa1('0x5e')]),'WhatsappQueueId':Number(_0x40bcf6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xbfedf6,null))[_0x7fa1('0x45')](handleError(_0xbfedf6,null));};exports['getAgents']=function(_0x4972bd,_0x12b3b4,_0x4e6654){var _0x2cd1a1={};var _0x25f920={};var _0x22084a;var _0x1bc0f;return db[_0x7fa1('0x43')][_0x7fa1('0x54')]({'where':{'id':_0x4972bd[_0x7fa1('0x46')]['id']}})['then'](handleEntityNotFound(_0x12b3b4,null))[_0x7fa1('0x23')](function(_0x57ae00){if(_0x57ae00){_0x22084a=_0x57ae00;_0x25f920[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db[_0x7fa1('0x68')][_0x7fa1('0x2d')]);_0x25f920[_0x7fa1('0x32')]=_['keys'](_0x4972bd['query']);_0x25f920[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x25f920['model'],_0x25f920[_0x7fa1('0x32')]);_0x2cd1a1[_0x7fa1('0x37')]=_[_0x7fa1('0x35')](_0x25f920['model'],qs['fields'](_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x2cd1a1[_0x7fa1('0x37')]=_0x2cd1a1[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x2cd1a1[_0x7fa1('0x37')]:_0x25f920[_0x7fa1('0x31')];_0x2cd1a1[_0x7fa1('0x3b')]=qs[_0x7fa1('0x3c')](_0x4972bd['query'][_0x7fa1('0x3c')]);_0x2cd1a1[_0x7fa1('0x3f')]=qs['filters'](_[_0x7fa1('0x3d')](_0x4972bd[_0x7fa1('0x32')],_0x25f920[_0x7fa1('0x34')]));if(_0x4972bd[_0x7fa1('0x32')]['filter']){_0x2cd1a1[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x2cd1a1[_0x7fa1('0x3f')],{'$or':_[_0x7fa1('0x2c')](_0x2cd1a1['attributes'],function(_0x3a1c11){var _0x6f41d4={};_0x6f41d4[_0x3a1c11]={'$like':'%'+_0x4972bd['query'][_0x7fa1('0x3e')]+'%'};return _0x6f41d4;})});}_0x2cd1a1=_['merge']({},_0x2cd1a1,_0x4972bd[_0x7fa1('0x47')]);return _0x22084a[_0x7fa1('0x83')](_0x2cd1a1);}})[_0x7fa1('0x23')](function(_0x43ac1){if(_0x43ac1){_0x1bc0f=_0x43ac1['length'];if(!_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x2cd1a1[_0x7fa1('0x1c')]=qs[_0x7fa1('0x1c')](_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x2cd1a1[_0x7fa1('0x1e')]=qs['offset'](_0x4972bd['query'][_0x7fa1('0x1e')]);}return _0x22084a[_0x7fa1('0x83')](_0x2cd1a1);}})[_0x7fa1('0x23')](function(_0x8be11d){if(_0x8be11d){return _0x8be11d?{'count':_0x1bc0f,'rows':_0x8be11d}:null;}})['then'](respondWithResult(_0x12b3b4,null))[_0x7fa1('0x45')](handleError(_0x12b3b4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6750489..9fde6f5 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 _0x0cc2=['hasOwnProperty','hook','exports','WhatsappQueue','setMaxListeners','update','emit'];(function(_0x57b740,_0x3a8814){var _0x576e93=function(_0x5b8041){while(--_0x5b8041){_0x57b740['push'](_0x57b740['shift']());}};_0x576e93(++_0x3a8814);}(_0x0cc2,0x184));var _0x20cc=function(_0x2ecd86,_0x17ed6f){_0x2ecd86=_0x2ecd86-0x0;var _0x5a19a9=_0x0cc2[_0x2ecd86];return _0x5a19a9;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x20cc('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x20cc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x20cc('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5444dc){return function(_0x340d95,_0x5dbc6f,_0x1286b6){WhatsappQueueEvents[_0x20cc('0x3')](_0x5444dc+':'+_0x340d95['id'],_0x340d95);WhatsappQueueEvents[_0x20cc('0x3')](_0x5444dc,_0x340d95);_0x1286b6(null);};}for(var e in events){if(events[_0x20cc('0x4')](e)){var event=events[e];WhatsappQueue[_0x20cc('0x5')](e,emitEvent(event));}}module[_0x20cc('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0xae87=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2bb551,_0x4a23ca){var _0x3fd7cc=function(_0x1d2505){while(--_0x1d2505){_0x2bb551['push'](_0x2bb551['shift']());}};_0x3fd7cc(++_0x4a23ca);}(_0xae87,0xa7));var _0x7ae8=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xae87[_0x3e961c];return _0x474f9c;};'use strict';var EventEmitter=require(_0x7ae8('0x0'));var WhatsappQueue=require(_0x7ae8('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ae8('0x2'),'afterUpdate':_0x7ae8('0x3'),'afterDestroy':_0x7ae8('0x4')};function emitEvent(_0x3f8fe3){return function(_0x1a762e,_0x5ae135,_0x487dd4){WhatsappQueueEvents['emit'](_0x3f8fe3+':'+_0x1a762e['id'],_0x1a762e);WhatsappQueueEvents[_0x7ae8('0x5')](_0x3f8fe3,_0x1a762e);_0x487dd4(null);};}for(var e in events){if(events[_0x7ae8('0x6')](e)){var event=events[e];WhatsappQueue[_0x7ae8('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 01a47e9..1aeda28 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 _0x3244=['api','moment','bluebird','request-promise','path','rimraf','exports','define','WhatsappQueue','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3244,0xf0));var _0x4324=function(_0x20fd9d,_0x425854){_0x20fd9d=_0x20fd9d-0x0;var _0x277113=_0x3244[_0x20fd9d];return _0x277113;};'use strict';var _=require('lodash');var util=require(_0x4324('0x0'));var logger=require(_0x4324('0x1'))(_0x4324('0x2'));var moment=require(_0x4324('0x3'));var BPromise=require(_0x4324('0x4'));var rp=require(_0x4324('0x5'));var fs=require('fs');var path=require(_0x4324('0x6'));var rimraf=require(_0x4324('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0x4324('0x8')]=function(_0x441dd3,_0x16f0ac){return _0x441dd3[_0x4324('0x9')](_0x4324('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec58=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','../../config/logger','moment','bluebird'];(function(_0x2f5051,_0x3ed701){var _0x2b2304=function(_0x2470f3){while(--_0x2470f3){_0x2f5051['push'](_0x2f5051['shift']());}};_0x2b2304(++_0x3ed701);}(_0xec58,0x93));var _0x8ec5=function(_0x3bca2d,_0x1af8f4){_0x3bca2d=_0x3bca2d-0x0;var _0x144a7c=_0xec58[_0x3bca2d];return _0x144a7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ec5('0x0'))('api');var moment=require(_0x8ec5('0x1'));var BPromise=require(_0x8ec5('0x2'));var rp=require(_0x8ec5('0x3'));var fs=require('fs');var path=require(_0x8ec5('0x4'));var rimraf=require('rimraf');var config=require(_0x8ec5('0x5'));var attributes=require(_0x8ec5('0x6'));module[_0x8ec5('0x7')]=function(_0x3c6538,_0x286c87){return _0x3c6538[_0x8ec5('0x8')]('WhatsappQueue',attributes,{'tableName':_0x8ec5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index b660312..e1300fd 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 _0x0dde=['find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','map','include','model','attributes','debug','ShowWhatsappQueue'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0dde,0xbf));var _0xe0dd=function(_0xf1402a,_0x187f5c){_0xf1402a=_0xf1402a-0x0;var _0x4f7ead=_0x0dde[_0xf1402a];return _0x4f7ead;};'use strict';var _=require(_0xe0dd('0x0'));var util=require(_0xe0dd('0x1'));var moment=require('moment');var BPromise=require(_0xe0dd('0x2'));var rs=require(_0xe0dd('0x3'));var fs=require('fs');var Redis=require(_0xe0dd('0x4'));var db=require(_0xe0dd('0x5'))['db'];var utils=require(_0xe0dd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe0dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0dd('0x8')]['http']({'port':0x232a});config[_0xe0dd('0x9')]=_[_0xe0dd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe0dd('0xb'))(new Redis(config[_0xe0dd('0x9')]));require(_0xe0dd('0xc'))[_0xe0dd('0xd')](socket);function respondWithRpcPromise(_0x1eb867,_0x2e0d65,_0x14f63b){return new BPromise(function(_0x5135e5,_0x411d56){return client[_0xe0dd('0xe')](_0x1eb867,_0x14f63b)[_0xe0dd('0xf')](function(_0x1cb352){logger[_0xe0dd('0x10')](_0xe0dd('0x11'),_0x2e0d65,_0xe0dd('0x12'));logger['debug'](_0xe0dd('0x13'),_0x2e0d65,_0xe0dd('0x12'),JSON[_0xe0dd('0x14')](_0x1cb352));if(_0x1cb352[_0xe0dd('0x15')]){if(_0x1cb352[_0xe0dd('0x15')]['code']===0x1f4){logger['error'](_0xe0dd('0x11'),_0x2e0d65,_0x1cb352[_0xe0dd('0x15')][_0xe0dd('0x16')]);return _0x411d56(_0x1cb352[_0xe0dd('0x15')][_0xe0dd('0x16')]);}logger[_0xe0dd('0x15')](_0xe0dd('0x11'),_0x2e0d65,_0x1cb352[_0xe0dd('0x15')][_0xe0dd('0x16')]);return _0x5135e5(_0x1cb352[_0xe0dd('0x15')][_0xe0dd('0x16')]);}else{logger[_0xe0dd('0x10')](_0xe0dd('0x11'),_0x2e0d65,'request\x20sent');_0x5135e5(_0x1cb352[_0xe0dd('0x17')][_0xe0dd('0x16')]);}})[_0xe0dd('0x18')](function(_0x3247dd){logger[_0xe0dd('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x2e0d65,_0x3247dd);_0x411d56(_0x3247dd);});});}exports[_0xe0dd('0x19')]=function(_0x5b9c05){var _0x5c2168=this;return new Promise(function(_0x31320a,_0x16b407){return db[_0xe0dd('0x1a')]['findAll']({'raw':_0x5b9c05['options']?_0x5b9c05[_0xe0dd('0x1b')][_0xe0dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b9c05[_0xe0dd('0x1b')]?_0x5b9c05[_0xe0dd('0x1b')][_0xe0dd('0x1d')]||null:null,'attributes':_0x5b9c05[_0xe0dd('0x1b')]?_0x5b9c05['options']['attributes']||null:null,'limit':_0x5b9c05[_0xe0dd('0x1b')]?_0x5b9c05[_0xe0dd('0x1b')][_0xe0dd('0x1e')]||null:null,'include':_0x5b9c05[_0xe0dd('0x1b')]?_0x5b9c05[_0xe0dd('0x1b')]['include']?_[_0xe0dd('0x1f')](_0x5b9c05['options'][_0xe0dd('0x20')],function(_0x379f8b){return{'model':db[_0x379f8b[_0xe0dd('0x21')]],'as':_0x379f8b['as'],'attributes':_0x379f8b[_0xe0dd('0x22')],'include':_0x379f8b[_0xe0dd('0x20')]?_[_0xe0dd('0x1f')](_0x379f8b[_0xe0dd('0x20')],function(_0xcc9f5d){return{'model':db[_0xcc9f5d['model']],'as':_0xcc9f5d['as'],'attributes':_0xcc9f5d[_0xe0dd('0x22')],'include':_0xcc9f5d[_0xe0dd('0x20')]?_['map'](_0xcc9f5d[_0xe0dd('0x20')],function(_0x2c6df4){return{'model':db[_0x2c6df4[_0xe0dd('0x21')]],'as':_0x2c6df4['as'],'attributes':_0x2c6df4[_0xe0dd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe0dd('0xf')](function(_0x689447){logger[_0xe0dd('0x10')](_0xe0dd('0x19'),_0x5b9c05);logger[_0xe0dd('0x23')](_0xe0dd('0x19'),_0x5b9c05,JSON[_0xe0dd('0x14')](_0x689447));_0x31320a(_0x689447);})[_0xe0dd('0x18')](function(_0xaaf144){logger['error'](_0xe0dd('0x19'),_0xaaf144[_0xe0dd('0x16')],_0x5b9c05);_0x16b407(_0x5c2168[_0xe0dd('0x15')](0x1f4,_0xaaf144[_0xe0dd('0x16')]));});});};exports[_0xe0dd('0x24')]=function(_0x5afdc2){var _0x3a1f8b=this;return new Promise(function(_0x38b14b,_0x560dba){return db[_0xe0dd('0x1a')][_0xe0dd('0x25')]({'raw':_0x5afdc2[_0xe0dd('0x1b')]?_0x5afdc2[_0xe0dd('0x1b')][_0xe0dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5afdc2['options']?_0x5afdc2[_0xe0dd('0x1b')][_0xe0dd('0x1d')]||null:null,'attributes':_0x5afdc2[_0xe0dd('0x1b')]?_0x5afdc2['options'][_0xe0dd('0x22')]||null:null,'include':_0x5afdc2[_0xe0dd('0x1b')]?_0x5afdc2[_0xe0dd('0x1b')][_0xe0dd('0x20')]?_['map'](_0x5afdc2['options'][_0xe0dd('0x20')],function(_0x5636dc){return{'model':db[_0x5636dc[_0xe0dd('0x21')]],'as':_0x5636dc['as'],'attributes':_0x5636dc[_0xe0dd('0x22')],'include':_0x5636dc['include']?_[_0xe0dd('0x1f')](_0x5636dc[_0xe0dd('0x20')],function(_0x5d8e44){return{'model':db[_0x5d8e44[_0xe0dd('0x21')]],'as':_0x5d8e44['as'],'attributes':_0x5d8e44[_0xe0dd('0x22')],'include':_0x5d8e44[_0xe0dd('0x20')]?_[_0xe0dd('0x1f')](_0x5d8e44[_0xe0dd('0x20')],function(_0x4bf8dd){return{'model':db[_0x4bf8dd[_0xe0dd('0x21')]],'as':_0x4bf8dd['as'],'attributes':_0x4bf8dd[_0xe0dd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe0dd('0xf')](function(_0x38d507){logger[_0xe0dd('0x10')](_0xe0dd('0x24'),_0x5afdc2);logger['debug'](_0xe0dd('0x24'),_0x5afdc2,JSON['stringify'](_0x38d507));_0x38b14b(_0x38d507);})[_0xe0dd('0x18')](function(_0x46a5af){logger[_0xe0dd('0x15')]('ShowWhatsappQueue',_0x46a5af[_0xe0dd('0x16')],_0x5afdc2);_0x560dba(_0x3a1f8b[_0xe0dd('0x15')](0x1f4,_0x46a5af[_0xe0dd('0x16')]));});});}; \ No newline at end of file +var _0x4602=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x35ca67,_0x5157e7){var _0x4fa154=function(_0x14d0da){while(--_0x14d0da){_0x35ca67['push'](_0x35ca67['shift']());}};_0x4fa154(++_0x5157e7);}(_0x4602,0x9b));var _0x2460=function(_0xceece3,_0x2393a4){_0xceece3=_0xceece3-0x0;var _0xb086c0=_0x4602[_0xceece3];return _0xb086c0;};'use strict';var _=require(_0x2460('0x0'));var util=require(_0x2460('0x1'));var moment=require('moment');var BPromise=require(_0x2460('0x2'));var rs=require(_0x2460('0x3'));var fs=require('fs');var Redis=require(_0x2460('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2460('0x5'))(_0x2460('0x6'));var config=require('../../config/environment');var jayson=require(_0x2460('0x7'));var client=jayson[_0x2460('0x8')][_0x2460('0x9')]({'port':0x232a});config[_0x2460('0xa')]=_[_0x2460('0xb')](config[_0x2460('0xa')],{'host':_0x2460('0xc'),'port':0x18eb});var socket=require(_0x2460('0xd'))(new Redis(config[_0x2460('0xa')]));require(_0x2460('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e09ad,_0x431107,_0x65a9d0){return new BPromise(function(_0x2e3478,_0x77997f){return client['request'](_0x5e09ad,_0x65a9d0)[_0x2460('0xf')](function(_0x44704d){logger['info'](_0x2460('0x10'),_0x431107,_0x2460('0x11'));logger['debug'](_0x2460('0x12'),_0x431107,_0x2460('0x11'),JSON['stringify'](_0x44704d));if(_0x44704d[_0x2460('0x13')]){if(_0x44704d[_0x2460('0x13')][_0x2460('0x14')]===0x1f4){logger['error'](_0x2460('0x10'),_0x431107,_0x44704d['error'][_0x2460('0x15')]);return _0x77997f(_0x44704d[_0x2460('0x13')]['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x431107,_0x44704d[_0x2460('0x13')][_0x2460('0x15')]);return _0x2e3478(_0x44704d[_0x2460('0x13')][_0x2460('0x15')]);}else{logger[_0x2460('0x16')](_0x2460('0x10'),_0x431107,'request\x20sent');_0x2e3478(_0x44704d[_0x2460('0x17')][_0x2460('0x15')]);}})['catch'](function(_0x5ae25b){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x431107,_0x5ae25b);_0x77997f(_0x5ae25b);});});}exports[_0x2460('0x18')]=function(_0x5eaae3){var _0x174c21=this;return new Promise(function(_0x139ed2,_0x4b74f1){return db['WhatsappQueue'][_0x2460('0x19')]({'raw':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3['options'][_0x2460('0x1b')]===undefined?!![]:![]:!![],'where':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1c')]||null:null,'attributes':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1d')]||null:null,'limit':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1e')]||null:null,'include':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1f')]?_[_0x2460('0x20')](_0x5eaae3['options']['include'],function(_0x87eae2){return{'model':db[_0x87eae2[_0x2460('0x21')]],'as':_0x87eae2['as'],'attributes':_0x87eae2[_0x2460('0x1d')],'include':_0x87eae2['include']?_[_0x2460('0x20')](_0x87eae2[_0x2460('0x1f')],function(_0x1d4e91){return{'model':db[_0x1d4e91[_0x2460('0x21')]],'as':_0x1d4e91['as'],'attributes':_0x1d4e91[_0x2460('0x1d')],'include':_0x1d4e91[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x1d4e91[_0x2460('0x1f')],function(_0x36f5dc){return{'model':db[_0x36f5dc[_0x2460('0x21')]],'as':_0x36f5dc['as'],'attributes':_0x36f5dc[_0x2460('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ef49){logger[_0x2460('0x16')](_0x2460('0x18'),_0x5eaae3);logger[_0x2460('0x22')](_0x2460('0x18'),_0x5eaae3,JSON[_0x2460('0x23')](_0x44ef49));_0x139ed2(_0x44ef49);})[_0x2460('0x24')](function(_0x3c151c){logger[_0x2460('0x13')](_0x2460('0x18'),_0x3c151c[_0x2460('0x15')],_0x5eaae3);_0x4b74f1(_0x174c21['error'](0x1f4,_0x3c151c[_0x2460('0x15')]));});});};exports[_0x2460('0x25')]=function(_0xbb03f8){var _0x15901e=this;return new Promise(function(_0x486962,_0x471a08){return db[_0x2460('0x26')][_0x2460('0x27')]({'raw':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1b')]===undefined?!![]:![]:!![],'where':_0xbb03f8['options']?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1c')]||null:null,'attributes':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8['options'][_0x2460('0x1d')]||null:null,'include':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1f')]?_[_0x2460('0x20')](_0xbb03f8['options'][_0x2460('0x1f')],function(_0x59e1af){return{'model':db[_0x59e1af[_0x2460('0x21')]],'as':_0x59e1af['as'],'attributes':_0x59e1af[_0x2460('0x1d')],'include':_0x59e1af[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x59e1af[_0x2460('0x1f')],function(_0x38f79b){return{'model':db[_0x38f79b[_0x2460('0x21')]],'as':_0x38f79b['as'],'attributes':_0x38f79b[_0x2460('0x1d')],'include':_0x38f79b[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x38f79b[_0x2460('0x1f')],function(_0x36225a){return{'model':db[_0x36225a[_0x2460('0x21')]],'as':_0x36225a['as'],'attributes':_0x36225a[_0x2460('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44043d){logger[_0x2460('0x16')](_0x2460('0x25'),_0xbb03f8);logger[_0x2460('0x22')](_0x2460('0x25'),_0xbb03f8,JSON[_0x2460('0x23')](_0x44043d));_0x486962(_0x44043d);})['catch'](function(_0x555c97){logger['error'](_0x2460('0x25'),_0x555c97[_0x2460('0x15')],_0xbb03f8);_0x471a08(_0x15901e['error'](0x1f4,_0x555c97['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4704be7..37cc910 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 _0xe3f2=['./whatsappQueue.events','remove','emit','removeListener','register','length','whatsappQueue:'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xe3f2,0xd9));var _0x2e3f=function(_0x4e8c56,_0x4ffa5d){_0x4e8c56=_0x4e8c56-0x0;var _0x3d07f6=_0xe3f2[_0x4e8c56];return _0x3d07f6;};'use strict';var WhatsappQueueEvents=require(_0x2e3f('0x0'));var events=['save',_0x2e3f('0x1'),'update'];function createListener(_0x333522,_0x48480d){return function(_0x2f05be){_0x48480d[_0x2e3f('0x2')](_0x333522,_0x2f05be);};}function removeListener(_0x15a29b,_0x4a1887){return function(){WhatsappQueueEvents[_0x2e3f('0x3')](_0x15a29b,_0x4a1887);};}exports[_0x2e3f('0x4')]=function(_0x4bb9e3){for(var _0xc55ef8=0x0,_0xd066fe=events[_0x2e3f('0x5')];_0xc55ef8<_0xd066fe;_0xc55ef8++){var _0x5781a2=events[_0xc55ef8];var _0x20336c=createListener(_0x2e3f('0x6')+_0x5781a2,_0x4bb9e3);WhatsappQueueEvents['on'](_0x5781a2,_0x20336c);}}; \ No newline at end of file +var _0x010c=['remove','removeListener','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x3644a1,_0x2fadd8){var _0x227348=function(_0x109594){while(--_0x109594){_0x3644a1['push'](_0x3644a1['shift']());}};_0x227348(++_0x2fadd8);}(_0x010c,0x14e));var _0xc010=function(_0x4af25b,_0x3e3ef2){_0x4af25b=_0x4af25b-0x0;var _0x157126=_0x010c[_0x4af25b];return _0x157126;};'use strict';var WhatsappQueueEvents=require(_0xc010('0x0'));var events=[_0xc010('0x1'),_0xc010('0x2'),'update'];function createListener(_0x21554a,_0xd42ed6){return function(_0x284624){_0xd42ed6['emit'](_0x21554a,_0x284624);};}function removeListener(_0x1155f5,_0x6b7aec){return function(){WhatsappQueueEvents[_0xc010('0x3')](_0x1155f5,_0x6b7aec);};}exports['register']=function(_0x28fa29){for(var _0x237fae=0x0,_0x4c1718=events[_0xc010('0x4')];_0x237fae<_0x4c1718;_0x237fae++){var _0x2105ed=events[_0x237fae];var _0x3c3fe8=createListener(_0xc010('0x5')+_0x2105ed,_0x28fa29);WhatsappQueueEvents['on'](_0x2105ed,_0x3c3fe8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 98e96a6..3ca3099 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 _0x88d5=['isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index'];(function(_0x3cbbe7,_0x14df5e){var _0x11503d=function(_0x508098){while(--_0x508098){_0x3cbbe7['push'](_0x3cbbe7['shift']());}};_0x11503d(++_0x14df5e);}(_0x88d5,0x83));var _0x588d=function(_0x3771d9,_0x2e1308){_0x3771d9=_0x3771d9-0x0;var _0x369c9c=_0x88d5[_0x3771d9];return _0x369c9c;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express[_0x588d('0x5')]();var fs_extra=require(_0x588d('0x6'));var auth=require(_0x588d('0x7'));var interaction=require(_0x588d('0x8'));var config=require(_0x588d('0x9'));var controller=require(_0x588d('0xa'));router[_0x588d('0xb')]('/',auth['isAuthenticated'](),controller[_0x588d('0xc')]);router[_0x588d('0xb')]('/describe',auth[_0x588d('0xd')](),controller[_0x588d('0xe')]);router[_0x588d('0xb')](_0x588d('0xf'),auth[_0x588d('0xd')](),controller[_0x588d('0x10')]);router[_0x588d('0x11')]('/',auth[_0x588d('0xd')](),controller[_0x588d('0x12')]);router[_0x588d('0x13')](_0x588d('0xf'),auth[_0x588d('0xd')](),controller[_0x588d('0x14')]);router[_0x588d('0x15')]('/:id',auth[_0x588d('0xd')](),controller[_0x588d('0x16')]);module[_0x588d('0x17')]=router; \ No newline at end of file +var _0x14f1=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','update'];(function(_0x11cc76,_0x22e815){var _0x30bcd2=function(_0x54a7f4){while(--_0x54a7f4){_0x11cc76['push'](_0x11cc76['shift']());}};_0x30bcd2(++_0x22e815);}(_0x14f1,0xb7));var _0x114f=function(_0x49baf0,_0x132263){_0x49baf0=_0x49baf0-0x0;var _0x28fa45=_0x14f1[_0x49baf0];return _0x28fa45;};'use strict';var multer=require(_0x114f('0x0'));var util=require(_0x114f('0x1'));var path=require('path');var timeout=require(_0x114f('0x2'));var express=require('express');var router=express[_0x114f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x114f('0x4'));var config=require(_0x114f('0x5'));var controller=require('./whatsappQueueReport.controller');router[_0x114f('0x6')]('/',auth[_0x114f('0x7')](),controller[_0x114f('0x8')]);router['get'](_0x114f('0x9'),auth['isAuthenticated'](),controller[_0x114f('0xa')]);router[_0x114f('0x6')](_0x114f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x114f('0xc')]('/',auth[_0x114f('0x7')](),controller[_0x114f('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x114f('0xe')]);router[_0x114f('0xf')](_0x114f('0xb'),auth[_0x114f('0x7')](),controller[_0x114f('0x10')]);module[_0x114f('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 52fcf09..9275a73 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(_0x5593ad,_0x2a16ad){var _0x24e7c3=function(_0x50479e){while(--_0x50479e){_0x5593ad['push'](_0x5593ad['shift']());}};_0x24e7c3(++_0x2a16ad);}(_0x7a54,0x106));var _0x47a5=function(_0x39c234,_0x28ad0f){_0x39c234=_0x39c234-0x0;var _0xed5712=_0x7a54[_0x39c234];return _0xed5712;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x222db8,_0x22511f){var _0x1e5d2d=function(_0x57e45d){while(--_0x57e45d){_0x222db8['push'](_0x222db8['shift']());}};_0x1e5d2d(++_0x22511f);}(_0x7a54,0x106));var _0x47a5=function(_0x318e08,_0x2439ab){_0x318e08=_0x318e08-0x0;var _0x5ef2e9=_0x7a54[_0x318e08];return _0x5ef2e9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 0fffe7e..545b04c 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 _0x065e=['limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','describe','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x065e,0x1a7));var _0xe065=function(_0x38e59a,_0x59f346){_0x38e59a=_0x38e59a-0x0;var _0x4410eb=_0x065e[_0x38e59a];return _0x4410eb;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){_0x5081a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164965,_0x530dc0){return function(_0x14e6b6){if(!_0x14e6b6){_0x164965[_0xe065('0x16')](0x194);}return _0x14e6b6;};}function handleError(_0x430ab9,_0x15b598){_0x15b598=_0x15b598||0x1f4;return function(_0x418731){logger[_0xe065('0x24')](_0x418731[_0xe065('0x25')]);if(_0x418731[_0xe065('0x26')]){delete _0x418731['name'];}_0x430ab9['status'](_0x15b598)[_0xe065('0x27')](_0x418731);};}exports[_0xe065('0x28')]=function(_0x23aee9,_0x441e96){var _0x5b1220={},_0x23f573={},_0x55ecaa={'count':0x0,'rows':[]};var _0x522420=_[_0xe065('0x29')](db[_0xe065('0x2a')][_0xe065('0x2b')],function(_0x5b8523){return{'name':_0x5b8523[_0xe065('0x2c')],'type':_0x5b8523['type'][_0xe065('0x2d')]};});_0x23f573[_0xe065('0x2e')]=_[_0xe065('0x29')](_0x522420,_0xe065('0x26'));_0x23f573['query']=_[_0xe065('0x2f')](_0x23aee9['query']);_0x23f573[_0xe065('0x30')]=_[_0xe065('0x31')](_0x23f573['model'],_0x23f573[_0xe065('0x32')]);_0x5b1220['attributes']=_[_0xe065('0x31')](_0x23f573['model'],qs[_0xe065('0x33')](_0x23aee9[_0xe065('0x32')][_0xe065('0x33')]));_0x5b1220[_0xe065('0x34')]=_0x5b1220['attributes'][_0xe065('0x35')]?_0x5b1220[_0xe065('0x34')]:_0x23f573[_0xe065('0x2e')];if(!_0x23aee9[_0xe065('0x32')][_0xe065('0x36')](_0xe065('0x37'))){_0x5b1220['limit']=qs[_0xe065('0x1b')](_0x23aee9[_0xe065('0x32')]['limit']);_0x5b1220[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x23aee9[_0xe065('0x32')][_0xe065('0x1a')]);}_0x5b1220[_0xe065('0x38')]=qs[_0xe065('0x39')](_0x23aee9[_0xe065('0x32')]['sort']);_0x5b1220[_0xe065('0x3a')]=qs['filters'](_[_0xe065('0x3b')](_0x23aee9[_0xe065('0x32')],_0x23f573[_0xe065('0x30')]),_0x522420);if(_0x23aee9[_0xe065('0x32')][_0xe065('0x3c')]){_0x5b1220[_0xe065('0x3a')]=_['merge'](_0x5b1220[_0xe065('0x3a')],{'$or':_[_0xe065('0x29')](_0x522420,function(_0x351ac4){if(_0x351ac4['type']!==_0xe065('0x3d')){var _0x35e4d7={};_0x35e4d7[_0x351ac4[_0xe065('0x26')]]={'$like':'%'+_0x23aee9[_0xe065('0x32')][_0xe065('0x3c')]+'%'};return _0x35e4d7;}})});}_0x5b1220=_['merge']({},_0x5b1220,_0x23aee9[_0xe065('0x3e')]);var _0x23033c={'where':_0x5b1220['where']};return db[_0xe065('0x2a')]['count'](_0x23033c)[_0xe065('0x22')](function(_0x1493a9){_0x55ecaa['count']=_0x1493a9;if(_0x23aee9[_0xe065('0x32')][_0xe065('0x3f')]){_0x5b1220['include']=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x40')](_0x5b1220);})[_0xe065('0x22')](function(_0x44a3f6){_0x55ecaa[_0xe065('0x41')]=_0x44a3f6;return _0x55ecaa;})[_0xe065('0x22')](respondWithFilteredResult(_0x441e96,_0x5b1220))[_0xe065('0x42')](handleError(_0x441e96,null));};exports[_0xe065('0x43')]=function(_0x3068f0,_0x445738){var _0x326493={'raw':!![],'where':{'id':_0x3068f0[_0xe065('0x44')]['id']}},_0x4364c3={};_0x4364c3['model']=_['keys'](db[_0xe065('0x2a')][_0xe065('0x2b')]);_0x4364c3['query']=_[_0xe065('0x2f')](_0x3068f0[_0xe065('0x32')]);_0x4364c3[_0xe065('0x30')]=_[_0xe065('0x31')](_0x4364c3[_0xe065('0x2e')],_0x4364c3[_0xe065('0x32')]);_0x326493[_0xe065('0x34')]=_[_0xe065('0x31')](_0x4364c3[_0xe065('0x2e')],qs['fields'](_0x3068f0[_0xe065('0x32')][_0xe065('0x33')]));_0x326493[_0xe065('0x34')]=_0x326493['attributes'][_0xe065('0x35')]?_0x326493[_0xe065('0x34')]:_0x4364c3[_0xe065('0x2e')];if(_0x3068f0[_0xe065('0x32')]['includeAll']){_0x326493[_0xe065('0x45')]=[{'all':!![]}];}_0x326493=_[_0xe065('0x46')]({},_0x326493,_0x3068f0[_0xe065('0x3e')]);return db[_0xe065('0x2a')][_0xe065('0x47')](_0x326493)[_0xe065('0x22')](handleEntityNotFound(_0x445738,null))[_0xe065('0x22')](respondWithResult(_0x445738,null))['catch'](handleError(_0x445738,null));};exports[_0xe065('0x48')]=function(_0x810f30,_0x335744){return db[_0xe065('0x2a')][_0xe065('0x48')](_0x810f30[_0xe065('0x49')],{})[_0xe065('0x22')](respondWithResult(_0x335744,0xc9))['catch'](handleError(_0x335744,null));};exports[_0xe065('0x21')]=function(_0x5a2360,_0x45fe1f){if(_0x5a2360[_0xe065('0x49')]['id']){delete _0x5a2360[_0xe065('0x49')]['id'];}return db['WhatsappQueueReport'][_0xe065('0x47')]({'where':{'id':_0x5a2360[_0xe065('0x44')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x45fe1f,null))[_0xe065('0x22')](saveUpdates(_0x5a2360[_0xe065('0x49')],null))[_0xe065('0x22')](respondWithResult(_0x45fe1f,null))[_0xe065('0x42')](handleError(_0x45fe1f,null));};exports[_0xe065('0x23')]=function(_0x3095c8,_0x2ca55a){return db[_0xe065('0x2a')][_0xe065('0x47')]({'where':{'id':_0x3095c8[_0xe065('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ca55a,null))['then'](removeEntity(_0x2ca55a,null))['catch'](handleError(_0x2ca55a,null));};exports[_0xe065('0x4a')]=function(_0x48ed8e,_0x105bf7){return db[_0xe065('0x2a')][_0xe065('0x4a')]()['then'](respondWithResult(_0x105bf7,null))[_0xe065('0x42')](handleError(_0x105bf7,null));}; \ No newline at end of file +var _0x5423=['params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','WhatsappQueueReport','find','create','body','update'];(function(_0x37261e,_0x26d202){var _0x2c3010=function(_0x49f5cb){while(--_0x49f5cb){_0x37261e['push'](_0x37261e['shift']());}};_0x2c3010(++_0x26d202);}(_0x5423,0xe3));var _0x3542=function(_0x369b36,_0x461c1e){_0x369b36=_0x369b36-0x0;var _0x52f32c=_0x5423[_0x369b36];return _0x52f32c;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0x1e0723,_0x2f2e63){return function(_0x298763){if(!_0x298763){_0x1e0723[_0x3542('0x18')](0x194);}return _0x298763;};}function handleError(_0x412184,_0x1e156e){_0x1e156e=_0x1e156e||0x1f4;return function(_0x18dc6c){logger[_0x3542('0x24')](_0x18dc6c[_0x3542('0x25')]);if(_0x18dc6c[_0x3542('0x26')]){delete _0x18dc6c[_0x3542('0x26')];}_0x412184[_0x3542('0x19')](_0x1e156e)[_0x3542('0x27')](_0x18dc6c);};}exports[_0x3542('0x28')]=function(_0x303412,_0x20eda1){var _0x3bd666={},_0x5590a2={},_0x31ad47={'count':0x0,'rows':[]};var _0x35bbc9=_[_0x3542('0x29')](db['WhatsappQueueReport'][_0x3542('0x2a')],function(_0xc6f23b){return{'name':_0xc6f23b[_0x3542('0x2b')],'type':_0xc6f23b[_0x3542('0x2c')]['key']};});_0x5590a2['model']=_[_0x3542('0x29')](_0x35bbc9,_0x3542('0x26'));_0x5590a2[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x303412[_0x3542('0x2d')]);_0x5590a2[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5590a2['model'],_0x5590a2['query']);_0x3bd666[_0x3542('0x31')]=_['intersection'](_0x5590a2['model'],qs[_0x3542('0x32')](_0x303412['query']['fields']));_0x3bd666[_0x3542('0x31')]=_0x3bd666[_0x3542('0x31')][_0x3542('0x33')]?_0x3bd666['attributes']:_0x5590a2[_0x3542('0x34')];if(!_0x303412['query'][_0x3542('0x35')](_0x3542('0x36'))){_0x3bd666['limit']=qs[_0x3542('0x1f')](_0x303412['query'][_0x3542('0x1f')]);_0x3bd666[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x303412['query'][_0x3542('0x1c')]);}_0x3bd666['order']=qs[_0x3542('0x37')](_0x303412[_0x3542('0x2d')][_0x3542('0x37')]);_0x3bd666[_0x3542('0x38')]=qs[_0x3542('0x2f')](_[_0x3542('0x39')](_0x303412[_0x3542('0x2d')],_0x5590a2[_0x3542('0x2f')]),_0x35bbc9);if(_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]){_0x3bd666[_0x3542('0x38')]=_[_0x3542('0x3b')](_0x3bd666[_0x3542('0x38')],{'$or':_['map'](_0x35bbc9,function(_0x62429){if(_0x62429['type']!=='VIRTUAL'){var _0x2782f2={};_0x2782f2[_0x62429[_0x3542('0x26')]]={'$like':'%'+_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]+'%'};return _0x2782f2;}})});}_0x3bd666=_[_0x3542('0x3b')]({},_0x3bd666,_0x303412[_0x3542('0x3c')]);var _0xc7f13c={'where':_0x3bd666[_0x3542('0x38')]};return db['WhatsappQueueReport'][_0x3542('0x1e')](_0xc7f13c)['then'](function(_0x1c8855){_0x31ad47[_0x3542('0x1e')]=_0x1c8855;if(_0x303412['query'][_0x3542('0x3d')]){_0x3bd666[_0x3542('0x3e')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x3542('0x3f')](_0x3bd666);})[_0x3542('0x40')](function(_0x5e1b29){_0x31ad47[_0x3542('0x41')]=_0x5e1b29;return _0x31ad47;})[_0x3542('0x40')](respondWithFilteredResult(_0x20eda1,_0x3bd666))[_0x3542('0x42')](handleError(_0x20eda1,null));};exports[_0x3542('0x43')]=function(_0x290c7c,_0xb12441){var _0x2b54b9={'raw':!![],'where':{'id':_0x290c7c['params']['id']}},_0x4bf45a={};_0x4bf45a[_0x3542('0x34')]=_[_0x3542('0x2e')](db[_0x3542('0x44')][_0x3542('0x2a')]);_0x4bf45a[_0x3542('0x2d')]=_['keys'](_0x290c7c[_0x3542('0x2d')]);_0x4bf45a['filters']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],_0x4bf45a[_0x3542('0x2d')]);_0x2b54b9['attributes']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],qs['fields'](_0x290c7c[_0x3542('0x2d')][_0x3542('0x32')]));_0x2b54b9[_0x3542('0x31')]=_0x2b54b9[_0x3542('0x31')][_0x3542('0x33')]?_0x2b54b9[_0x3542('0x31')]:_0x4bf45a[_0x3542('0x34')];if(_0x290c7c[_0x3542('0x2d')]['includeAll']){_0x2b54b9['include']=[{'all':!![]}];}_0x2b54b9=_['merge']({},_0x2b54b9,_0x290c7c[_0x3542('0x3c')]);return db[_0x3542('0x44')][_0x3542('0x45')](_0x2b54b9)[_0x3542('0x40')](handleEntityNotFound(_0xb12441,null))[_0x3542('0x40')](respondWithResult(_0xb12441,null))[_0x3542('0x42')](handleError(_0xb12441,null));};exports[_0x3542('0x46')]=function(_0x5adf34,_0x157683){return db[_0x3542('0x44')][_0x3542('0x46')](_0x5adf34[_0x3542('0x47')],{})['then'](respondWithResult(_0x157683,0xc9))[_0x3542('0x42')](handleError(_0x157683,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){if(_0x55b43a[_0x3542('0x47')]['id']){delete _0x55b43a[_0x3542('0x47')]['id'];}return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x55b43a[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x528f8c,null))[_0x3542('0x40')](saveUpdates(_0x55b43a['body'],null))[_0x3542('0x40')](respondWithResult(_0x528f8c,null))[_0x3542('0x42')](handleError(_0x528f8c,null));};exports[_0x3542('0x23')]=function(_0x392c6e,_0x1ebc82){return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x392c6e[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x1ebc82,null))['then'](removeEntity(_0x1ebc82,null))['catch'](handleError(_0x1ebc82,null));};exports[_0x3542('0x4a')]=function(_0x4b406b,_0x5a798a){return db['WhatsappQueueReport'][_0x3542('0x4a')]()[_0x3542('0x40')](respondWithResult(_0x5a798a,null))[_0x3542('0x42')](handleError(_0x5a798a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7ae91d1..9967961 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 _0xdab3=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x25c2af,_0x326fb2){var _0x252505=function(_0xa54549){while(--_0xa54549){_0x25c2af['push'](_0x25c2af['shift']());}};_0x252505(++_0x326fb2);}(_0xdab3,0xb8));var _0x3dab=function(_0x3ea4ea,_0x42f45d){_0x3ea4ea=_0x3ea4ea-0x0;var _0x2e3c90=_0xdab3[_0x3ea4ea];return _0x2e3c90;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var logger=require(_0x3dab('0x2'))('api');var moment=require(_0x3dab('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dab('0x4'));var rimraf=require(_0x3dab('0x5'));var config=require(_0x3dab('0x6'));var attributes=require(_0x3dab('0x7'));module['exports']=function(_0xcea76d,_0x28b2a6){return _0xcea76d[_0x3dab('0x8')](_0x3dab('0x9'),attributes,{'tableName':_0x3dab('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3dab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70ab=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0x70ab,0x10c));var _0xb70a=function(_0x580dfa,_0x53f1f9){_0x580dfa=_0x580dfa-0x0;var _0x31a5b6=_0x70ab[_0x580dfa];return _0x31a5b6;};'use strict';var _=require(_0xb70a('0x0'));var util=require(_0xb70a('0x1'));var logger=require(_0xb70a('0x2'))('api');var moment=require(_0xb70a('0x3'));var BPromise=require(_0xb70a('0x4'));var rp=require(_0xb70a('0x5'));var fs=require('fs');var path=require(_0xb70a('0x6'));var rimraf=require('rimraf');var config=require(_0xb70a('0x7'));var attributes=require(_0xb70a('0x8'));module[_0xb70a('0x9')]=function(_0x28f38d,_0x9d3397){return _0x28f38d[_0xb70a('0xa')](_0xb70a('0xb'),attributes,{'tableName':_0xb70a('0xc'),'paranoid':![],'indexes':[{'name':_0xb70a('0xd'),'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 22038d3..141401b 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 _0xa7eb=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x6e136c,_0x416240){var _0x169831=function(_0x59919e){while(--_0x59919e){_0x6e136c['push'](_0x6e136c['shift']());}};_0x169831(++_0x416240);}(_0xa7eb,0x1d5));var _0xba7e=function(_0x30bc58,_0x7745d4){_0x30bc58=_0x30bc58-0x0;var _0x492af0=_0xa7eb[_0x30bc58];return _0x492af0;};'use strict';var _=require(_0xba7e('0x0'));var util=require('util');var moment=require(_0xba7e('0x1'));var BPromise=require(_0xba7e('0x2'));var rs=require(_0xba7e('0x3'));var fs=require('fs');var Redis=require(_0xba7e('0x4'));var db=require(_0xba7e('0x5'))['db'];var utils=require(_0xba7e('0x6'));var logger=require(_0xba7e('0x7'))(_0xba7e('0x8'));var config=require(_0xba7e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xba7e('0xa')][_0xba7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d265b,_0x46b052,_0x380c12){return new BPromise(function(_0xf4761c,_0x2de0a3){return client[_0xba7e('0xc')](_0x4d265b,_0x380c12)[_0xba7e('0xd')](function(_0x4f59c3){logger[_0xba7e('0xe')](_0xba7e('0xf'),_0x46b052,'request\x20sent');logger[_0xba7e('0x10')](_0xba7e('0x11'),_0x46b052,_0xba7e('0x12'),JSON['stringify'](_0x4f59c3));if(_0x4f59c3[_0xba7e('0x13')]){if(_0x4f59c3[_0xba7e('0x13')]['code']===0x1f4){logger[_0xba7e('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x46b052,_0x4f59c3['error'][_0xba7e('0x14')]);return _0x2de0a3(_0x4f59c3['error'][_0xba7e('0x14')]);}logger[_0xba7e('0x13')](_0xba7e('0xf'),_0x46b052,_0x4f59c3['error'][_0xba7e('0x14')]);return _0xf4761c(_0x4f59c3['error']['message']);}else{logger[_0xba7e('0xe')](_0xba7e('0xf'),_0x46b052,_0xba7e('0x12'));_0xf4761c(_0x4f59c3[_0xba7e('0x15')][_0xba7e('0x14')]);}})[_0xba7e('0x16')](function(_0x3e77d5){logger[_0xba7e('0x13')](_0xba7e('0xf'),_0x46b052,_0x3e77d5);_0x2de0a3(_0x3e77d5);});});}exports['CreateWhatsappQueueReport']=function(_0x2e4860){var _0x2135db=this;return new Promise(function(_0x5f53df,_0x4a7361){return db[_0xba7e('0x17')][_0xba7e('0x18')](_0x2e4860[_0xba7e('0x19')],{'raw':_0x2e4860[_0xba7e('0x1a')]?_0x2e4860[_0xba7e('0x1a')][_0xba7e('0x1b')]===undefined?!![]:![]:!![]})[_0xba7e('0xd')](function(_0x3978a6){logger['info']('CreateWhatsappQueueReport',_0x2e4860);logger[_0xba7e('0x10')](_0xba7e('0x1c'),_0x2e4860,JSON[_0xba7e('0x1d')](_0x3978a6));_0x5f53df(_0x3978a6);})[_0xba7e('0x16')](function(_0x3a7271){logger[_0xba7e('0x13')](_0xba7e('0x1c'),_0x3a7271[_0xba7e('0x14')],_0x2e4860);_0x4a7361(_0x2135db[_0xba7e('0x13')](0x1f4,_0x3a7271[_0xba7e('0x14')]));});});};exports[_0xba7e('0x1e')]=function(_0x32b0a6){var _0x5c0a74=this;return new Promise(function(_0x599338,_0x2c8f92){return db[_0xba7e('0x17')][_0xba7e('0x1f')](_0x32b0a6[_0xba7e('0x19')],{'raw':_0x32b0a6[_0xba7e('0x1a')]?_0x32b0a6[_0xba7e('0x1a')][_0xba7e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32b0a6['options']?_0x32b0a6[_0xba7e('0x1a')][_0xba7e('0x20')]||null:null,'attributes':_0x32b0a6[_0xba7e('0x1a')]?_0x32b0a6[_0xba7e('0x1a')][_0xba7e('0x21')]||null:null,'limit':_0x32b0a6[_0xba7e('0x1a')]?_0x32b0a6[_0xba7e('0x1a')]['limit']||null:null})[_0xba7e('0xd')](function(_0x435133){logger[_0xba7e('0xe')](_0xba7e('0x1e'),_0x32b0a6);logger[_0xba7e('0x10')]('UpdateWhatsappQueueReport',_0x32b0a6,JSON['stringify'](_0x435133));_0x599338(_0x435133);})[_0xba7e('0x16')](function(_0x1f6ac7){logger[_0xba7e('0x13')]('UpdateWhatsappQueueReport',_0x1f6ac7['message'],_0x32b0a6);_0x2c8f92(_0x5c0a74[_0xba7e('0x13')](0x1f4,_0x1f6ac7[_0xba7e('0x14')]));});});}; \ No newline at end of file +var _0xee0f=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','body','options','raw','then','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee0f,0x1ea));var _0xfee0=function(_0x4c3851,_0xbebbfd){_0x4c3851=_0x4c3851-0x0;var _0x43a1e2=_0xee0f[_0x4c3851];return _0x43a1e2;};'use strict';var _=require(_0xfee0('0x0'));var util=require('util');var moment=require(_0xfee0('0x1'));var BPromise=require('bluebird');var rs=require(_0xfee0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfee0('0x3'))['db'];var utils=require(_0xfee0('0x4'));var logger=require(_0xfee0('0x5'))(_0xfee0('0x6'));var config=require(_0xfee0('0x7'));var jayson=require(_0xfee0('0x8'));var client=jayson[_0xfee0('0x9')][_0xfee0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c9339,_0x1f42c0,_0x12bc37){return new BPromise(function(_0x39a22e,_0x4fc185){return client[_0xfee0('0xb')](_0x8c9339,_0x12bc37)['then'](function(_0x3221aa){logger[_0xfee0('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0xfee0('0xd'));logger[_0xfee0('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1f42c0,_0xfee0('0xd'),JSON['stringify'](_0x3221aa));if(_0x3221aa[_0xfee0('0xf')]){if(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x10')]===0x1f4){logger[_0xfee0('0xf')](_0xfee0('0x11'),_0x1f42c0,_0x3221aa['error'][_0xfee0('0x12')]);return _0x4fc185(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);}logger[_0xfee0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);return _0x39a22e(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);}else{logger[_0xfee0('0xc')](_0xfee0('0x11'),_0x1f42c0,'request\x20sent');_0x39a22e(_0x3221aa['result'][_0xfee0('0x12')]);}})[_0xfee0('0x13')](function(_0x55436e){logger[_0xfee0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0x55436e);_0x4fc185(_0x55436e);});});}exports[_0xfee0('0x14')]=function(_0x2945bb){var _0x2c4645=this;return new Promise(function(_0x436364,_0x52ce60){return db['WhatsappQueueReport']['create'](_0x2945bb[_0xfee0('0x15')],{'raw':_0x2945bb['options']?_0x2945bb[_0xfee0('0x16')][_0xfee0('0x17')]===undefined?!![]:![]:!![]})[_0xfee0('0x18')](function(_0x55912a){logger[_0xfee0('0xc')](_0xfee0('0x14'),_0x2945bb);logger[_0xfee0('0xe')](_0xfee0('0x14'),_0x2945bb,JSON[_0xfee0('0x19')](_0x55912a));_0x436364(_0x55912a);})[_0xfee0('0x13')](function(_0x25a9a4){logger[_0xfee0('0xf')]('CreateWhatsappQueueReport',_0x25a9a4['message'],_0x2945bb);_0x52ce60(_0x2c4645[_0xfee0('0xf')](0x1f4,_0x25a9a4['message']));});});};exports[_0xfee0('0x1a')]=function(_0x3cddb0){var _0xd52e1d=this;return new Promise(function(_0x447bfc,_0x4d649a){return db[_0xfee0('0x1b')][_0xfee0('0x1c')](_0x3cddb0['body'],{'raw':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0[_0xfee0('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0['options']['where']||null:null,'attributes':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0[_0xfee0('0x16')][_0xfee0('0x1d')]||null:null,'limit':_0x3cddb0['options']?_0x3cddb0['options'][_0xfee0('0x1e')]||null:null})[_0xfee0('0x18')](function(_0x39f5b6){logger[_0xfee0('0xc')]('UpdateWhatsappQueueReport',_0x3cddb0);logger[_0xfee0('0xe')](_0xfee0('0x1a'),_0x3cddb0,JSON[_0xfee0('0x19')](_0x39f5b6));_0x447bfc(_0x39f5b6);})[_0xfee0('0x13')](function(_0x34128b){logger['error'](_0xfee0('0x1a'),_0x34128b[_0xfee0('0x12')],_0x3cddb0);_0x4d649a(_0xd52e1d['error'](0x1f4,_0x34128b[_0xfee0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c2dcaa6..e8f25a4 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 _0xdb71=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update'];(function(_0x5e5f5a,_0x5cb19a){var _0x4141ae=function(_0x4bb2ea){while(--_0x4bb2ea){_0x5e5f5a['push'](_0x5e5f5a['shift']());}};_0x4141ae(++_0x5cb19a);}(_0xdb71,0x193));var _0x1db7=function(_0x556b25,_0x5ef8e4){_0x556b25=_0x556b25-0x0;var _0x3311ec=_0xdb71[_0x556b25];return _0x3311ec;};'use strict';var multer=require(_0x1db7('0x0'));var util=require('util');var path=require(_0x1db7('0x1'));var timeout=require(_0x1db7('0x2'));var express=require(_0x1db7('0x3'));var router=express[_0x1db7('0x4')]();var fs_extra=require(_0x1db7('0x5'));var auth=require(_0x1db7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1db7('0x7'));router[_0x1db7('0x8')]('/',auth[_0x1db7('0x9')](),controller[_0x1db7('0xa')]);router['get']('/describe',auth[_0x1db7('0x9')](),controller[_0x1db7('0xb')]);router[_0x1db7('0x8')](_0x1db7('0xc'),auth[_0x1db7('0x9')](),controller['show']);router[_0x1db7('0xd')]('/',auth[_0x1db7('0x9')](),controller[_0x1db7('0xe')]);router[_0x1db7('0xf')]('/:id',auth[_0x1db7('0x9')](),controller[_0x1db7('0x10')]);router[_0x1db7('0x11')](_0x1db7('0xc'),auth['isAuthenticated'](),controller[_0x1db7('0x12')]);module[_0x1db7('0x13')]=router; \ No newline at end of file +var _0x0b10=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x0b10,0x152));var _0x00b1=function(_0x160004,_0x362c5c){_0x160004=_0x160004-0x0;var _0x112c20=_0x0b10[_0x160004];return _0x112c20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00b1('0x0'));var timeout=require(_0x00b1('0x1'));var express=require(_0x00b1('0x2'));var router=express[_0x00b1('0x3')]();var fs_extra=require(_0x00b1('0x4'));var auth=require(_0x00b1('0x5'));var interaction=require(_0x00b1('0x6'));var config=require(_0x00b1('0x7'));var controller=require(_0x00b1('0x8'));router[_0x00b1('0x9')]('/',auth[_0x00b1('0xa')](),controller[_0x00b1('0xb')]);router[_0x00b1('0x9')]('/describe',auth[_0x00b1('0xa')](),controller['describe']);router[_0x00b1('0x9')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0xd')]);router[_0x00b1('0xe')]('/',auth[_0x00b1('0xa')](),controller[_0x00b1('0xf')]);router[_0x00b1('0x10')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0x11')]);router[_0x00b1('0x12')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index df63e54..26b7a82 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 _0x80c4=['queue','DATE','sequelize','STRING','ENUM','account','agent'];(function(_0x5ab4e0,_0x559df9){var _0x55874c=function(_0x21a515){while(--_0x21a515){_0x5ab4e0['push'](_0x5ab4e0['shift']());}};_0x55874c(++_0x559df9);}(_0x80c4,0xa3));var _0x480c=function(_0x3e03f0,_0x6927d6){_0x3e03f0=_0x3e03f0-0x0;var _0x2c804e=_0x80c4[_0x3e03f0];return _0x2c804e;};'use strict';var Sequelize=require(_0x480c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x480c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x480c('0x2')](_0x480c('0x3'),_0x480c('0x4'),_0x480c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x480c('0x6')]}}; \ No newline at end of file +var _0x3176=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x470f67,_0x3b17f7){var _0x2848a8=function(_0x2e299f){while(--_0x2e299f){_0x470f67['push'](_0x470f67['shift']());}};_0x2848a8(++_0x3b17f7);}(_0x3176,0x1d8));var _0x6317=function(_0x422975,_0x7c3ccd){_0x422975=_0x422975-0x0;var _0x5abdb8=_0x3176[_0x422975];return _0x5abdb8;};'use strict';var Sequelize=require(_0x6317('0x0'));module[_0x6317('0x1')]={'uniqueid':{'type':Sequelize[_0x6317('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6317('0x3')](_0x6317('0x4'),_0x6317('0x5'),_0x6317('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6317('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ca97a15..fc4642c 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 _0xfdae=['create','body','params','describe','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','WhatsappTransferReport','rawAttributes','options','find','catch'];(function(_0x11261a,_0x1a2016){var _0x2ac42f=function(_0x17ebde){while(--_0x17ebde){_0x11261a['push'](_0x11261a['shift']());}};_0x2ac42f(++_0x1a2016);}(_0xfdae,0x176));var _0xefda=function(_0x8864e5,_0x2397d0){_0x8864e5=_0x8864e5-0x0;var _0x276143=_0xfdae[_0x8864e5];return _0x276143;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefda('0x0'));var zipdir=require(_0xefda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefda('0x2'));var moment=require(_0xefda('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefda('0x4'));var util=require('util');var path=require(_0xefda('0x5'));var sox=require(_0xefda('0x6'));var csv=require(_0xefda('0x7'));var ejs=require(_0xefda('0x8'));var fs=require('fs');var fs_extra=require(_0xefda('0x9'));var _=require(_0xefda('0xa'));var squel=require(_0xefda('0xb'));var crypto=require(_0xefda('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xefda('0xd'));var toCsv=require(_0xefda('0x7'));var querystring=require(_0xefda('0xe'));var Papa=require('papaparse');var Redis=require(_0xefda('0xf'));var authService=require(_0xefda('0x10'));var qs=require(_0xefda('0x11'));var as=require(_0xefda('0x12'));var hardwareService=require(_0xefda('0x13'));var logger=require(_0xefda('0x14'))('api');var utils=require(_0xefda('0x15'));var config=require(_0xefda('0x16'));var licenseUtil=require(_0xefda('0x17'));var db=require(_0xefda('0x18'))['db'];function respondWithStatusCode(_0x121cf4,_0x90f03d){_0x90f03d=_0x90f03d||0xcc;return function(_0x14752d){if(_0x14752d){return _0x121cf4[_0xefda('0x19')](_0x90f03d);}return _0x121cf4[_0xefda('0x1a')](_0x90f03d)[_0xefda('0x1b')]();};}function respondWithResult(_0x276f7e,_0x3ac588){_0x3ac588=_0x3ac588||0xc8;return function(_0x4d35e3){if(_0x4d35e3){return _0x276f7e[_0xefda('0x1a')](_0x3ac588)['json'](_0x4d35e3);}};}function respondWithFilteredResult(_0x5295b0,_0x979edc){return function(_0x309ba2){if(_0x309ba2){var _0x11b67f=typeof _0x979edc['offset']===_0xefda('0x1c')&&typeof _0x979edc[_0xefda('0x1d')]===_0xefda('0x1c');var _0x21a22c=_0x309ba2[_0xefda('0x1e')];var _0x1cda7b=_0x11b67f?0x0:_0x979edc[_0xefda('0x1f')];var _0x55c6b8=_0x11b67f?_0x309ba2[_0xefda('0x1e')]:_0x979edc[_0xefda('0x1f')]+_0x979edc[_0xefda('0x1d')];var _0x48e038;if(_0x55c6b8>=_0x21a22c){_0x55c6b8=_0x21a22c;_0x48e038=0xc8;}else{_0x48e038=0xce;}_0x5295b0[_0xefda('0x1a')](_0x48e038);return _0x5295b0[_0xefda('0x20')](_0xefda('0x21'),_0x1cda7b+'-'+_0x55c6b8+'/'+_0x21a22c)[_0xefda('0x22')](_0x309ba2);}return null;};}function patchUpdates(_0x15030b){return function(_0x2c0138){try{jsonpatch[_0xefda('0x23')](_0x2c0138,_0x15030b,!![]);}catch(_0x50b6d3){return BPromise[_0xefda('0x24')](_0x50b6d3);}return _0x2c0138[_0xefda('0x25')]();};}function saveUpdates(_0x365757,_0x52c584){return function(_0x5e91c6){if(_0x5e91c6){return _0x5e91c6[_0xefda('0x26')](_0x365757)[_0xefda('0x27')](function(_0x548ff1){return _0x548ff1;});}return null;};}function removeEntity(_0x308d96,_0x163555){return function(_0x1ea956){if(_0x1ea956){return _0x1ea956['destroy']()[_0xefda('0x27')](function(){_0x308d96[_0xefda('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49c89d,_0x31414b){return function(_0x1a0baf){if(!_0x1a0baf){_0x49c89d[_0xefda('0x19')](0x194);}return _0x1a0baf;};}function handleError(_0x38054d,_0x3a3832){_0x3a3832=_0x3a3832||0x1f4;return function(_0x4ad40c){logger['error'](_0x4ad40c['stack']);if(_0x4ad40c[_0xefda('0x28')]){delete _0x4ad40c[_0xefda('0x28')];}_0x38054d[_0xefda('0x1a')](_0x3a3832)[_0xefda('0x29')](_0x4ad40c);};}exports[_0xefda('0x2a')]=function(_0xcaef0,_0x3d5531){var _0x4a16ee={},_0x5c1b47={},_0x399a4b={'count':0x0,'rows':[]};var _0xbca746=_[_0xefda('0x2b')](db['WhatsappTransferReport']['rawAttributes'],function(_0x1ccea0){return{'name':_0x1ccea0[_0xefda('0x2c')],'type':_0x1ccea0[_0xefda('0x2d')][_0xefda('0x2e')]};});_0x5c1b47[_0xefda('0x2f')]=_[_0xefda('0x2b')](_0xbca746,_0xefda('0x28'));_0x5c1b47[_0xefda('0x30')]=_[_0xefda('0x31')](_0xcaef0[_0xefda('0x30')]);_0x5c1b47[_0xefda('0x32')]=_['intersection'](_0x5c1b47[_0xefda('0x2f')],_0x5c1b47[_0xefda('0x30')]);_0x4a16ee[_0xefda('0x33')]=_[_0xefda('0x34')](_0x5c1b47[_0xefda('0x2f')],qs[_0xefda('0x35')](_0xcaef0[_0xefda('0x30')]['fields']));_0x4a16ee['attributes']=_0x4a16ee[_0xefda('0x33')][_0xefda('0x36')]?_0x4a16ee[_0xefda('0x33')]:_0x5c1b47[_0xefda('0x2f')];if(!_0xcaef0[_0xefda('0x30')]['hasOwnProperty'](_0xefda('0x37'))){_0x4a16ee['limit']=qs[_0xefda('0x1d')](_0xcaef0['query']['limit']);_0x4a16ee[_0xefda('0x1f')]=qs[_0xefda('0x1f')](_0xcaef0[_0xefda('0x30')][_0xefda('0x1f')]);}_0x4a16ee[_0xefda('0x38')]=qs[_0xefda('0x39')](_0xcaef0['query'][_0xefda('0x39')]);_0x4a16ee[_0xefda('0x3a')]=qs[_0xefda('0x32')](_['pick'](_0xcaef0[_0xefda('0x30')],_0x5c1b47[_0xefda('0x32')]),_0xbca746);if(_0xcaef0[_0xefda('0x30')][_0xefda('0x3b')]){_0x4a16ee[_0xefda('0x3a')]=_[_0xefda('0x3c')](_0x4a16ee['where'],{'$or':_[_0xefda('0x2b')](_0xbca746,function(_0x319dae){if(_0x319dae[_0xefda('0x2d')]!==_0xefda('0x3d')){var _0x8728cc={};_0x8728cc[_0x319dae['name']]={'$like':'%'+_0xcaef0[_0xefda('0x30')][_0xefda('0x3b')]+'%'};return _0x8728cc;}})});}_0x4a16ee=_['merge']({},_0x4a16ee,_0xcaef0['options']);var _0x137f0f={'where':_0x4a16ee[_0xefda('0x3a')]};return db['WhatsappTransferReport'][_0xefda('0x1e')](_0x137f0f)['then'](function(_0x151dbd){_0x399a4b[_0xefda('0x1e')]=_0x151dbd;if(_0xcaef0[_0xefda('0x30')][_0xefda('0x3e')]){_0x4a16ee[_0xefda('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x4a16ee);})[_0xefda('0x27')](function(_0x26d7cc){_0x399a4b[_0xefda('0x40')]=_0x26d7cc;return _0x399a4b;})['then'](respondWithFilteredResult(_0x3d5531,_0x4a16ee))['catch'](handleError(_0x3d5531,null));};exports['show']=function(_0x4ca883,_0x44a65e){var _0x383a31={'raw':!![],'where':{'id':_0x4ca883['params']['id']}},_0x4d1c4c={};_0x4d1c4c[_0xefda('0x2f')]=_[_0xefda('0x31')](db[_0xefda('0x41')][_0xefda('0x42')]);_0x4d1c4c[_0xefda('0x30')]=_[_0xefda('0x31')](_0x4ca883['query']);_0x4d1c4c[_0xefda('0x32')]=_['intersection'](_0x4d1c4c[_0xefda('0x2f')],_0x4d1c4c[_0xefda('0x30')]);_0x383a31[_0xefda('0x33')]=_[_0xefda('0x34')](_0x4d1c4c['model'],qs['fields'](_0x4ca883[_0xefda('0x30')][_0xefda('0x35')]));_0x383a31[_0xefda('0x33')]=_0x383a31[_0xefda('0x33')][_0xefda('0x36')]?_0x383a31[_0xefda('0x33')]:_0x4d1c4c[_0xefda('0x2f')];if(_0x4ca883[_0xefda('0x30')]['includeAll']){_0x383a31[_0xefda('0x3f')]=[{'all':!![]}];}_0x383a31=_[_0xefda('0x3c')]({},_0x383a31,_0x4ca883[_0xefda('0x43')]);return db['WhatsappTransferReport'][_0xefda('0x44')](_0x383a31)[_0xefda('0x27')](handleEntityNotFound(_0x44a65e,null))[_0xefda('0x27')](respondWithResult(_0x44a65e,null))[_0xefda('0x45')](handleError(_0x44a65e,null));};exports['create']=function(_0x103b41,_0xccfac0){return db[_0xefda('0x41')][_0xefda('0x46')](_0x103b41[_0xefda('0x47')],{})['then'](respondWithResult(_0xccfac0,0xc9))[_0xefda('0x45')](handleError(_0xccfac0,null));};exports['update']=function(_0x117706,_0x5afc6a){if(_0x117706[_0xefda('0x47')]['id']){delete _0x117706[_0xefda('0x47')]['id'];}return db['WhatsappTransferReport'][_0xefda('0x44')]({'where':{'id':_0x117706[_0xefda('0x48')]['id']}})['then'](handleEntityNotFound(_0x5afc6a,null))[_0xefda('0x27')](saveUpdates(_0x117706[_0xefda('0x47')],null))['then'](respondWithResult(_0x5afc6a,null))['catch'](handleError(_0x5afc6a,null));};exports['destroy']=function(_0xc3f7ff,_0x4771f1){return db['WhatsappTransferReport'][_0xefda('0x44')]({'where':{'id':_0xc3f7ff['params']['id']}})['then'](handleEntityNotFound(_0x4771f1,null))[_0xefda('0x27')](removeEntity(_0x4771f1,null))[_0xefda('0x45')](handleError(_0x4771f1,null));};exports[_0xefda('0x49')]=function(_0x481e2e,_0x50728b){return db[_0xefda('0x41')][_0xefda('0x49')]()['then'](respondWithResult(_0x50728b,null))[_0xefda('0x45')](handleError(_0x50728b,null));}; \ No newline at end of file +var _0x934b=['sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','WhatsappTransferReport','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x934b,0xe4));var _0xb934=function(_0x4582a9,_0x52e47d){_0x4582a9=_0x4582a9-0x0;var _0x49c003=_0x934b[_0x4582a9];return _0x49c003;};'use strict';var emlformat=require(_0xb934('0x0'));var rimraf=require(_0xb934('0x1'));var zipdir=require(_0xb934('0x2'));var jsonpatch=require(_0xb934('0x3'));var rp=require('request-promise');var moment=require(_0xb934('0x4'));var BPromise=require(_0xb934('0x5'));var Mustache=require(_0xb934('0x6'));var util=require(_0xb934('0x7'));var path=require(_0xb934('0x8'));var sox=require(_0xb934('0x9'));var csv=require(_0xb934('0xa'));var ejs=require(_0xb934('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb934('0xc'));var squel=require('squel');var crypto=require(_0xb934('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb934('0xe'));var toCsv=require(_0xb934('0xa'));var querystring=require(_0xb934('0xf'));var Papa=require(_0xb934('0x10'));var Redis=require(_0xb934('0x11'));var authService=require(_0xb934('0x12'));var qs=require(_0xb934('0x13'));var as=require(_0xb934('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb934('0x15'))(_0xb934('0x16'));var utils=require(_0xb934('0x17'));var config=require(_0xb934('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb934('0x19'))['db'];function respondWithStatusCode(_0x36b8a2,_0x1dfdb2){_0x1dfdb2=_0x1dfdb2||0xcc;return function(_0xd5fab4){if(_0xd5fab4){return _0x36b8a2['sendStatus'](_0x1dfdb2);}return _0x36b8a2[_0xb934('0x1a')](_0x1dfdb2)[_0xb934('0x1b')]();};}function respondWithResult(_0xde6a84,_0x331c34){_0x331c34=_0x331c34||0xc8;return function(_0x1d1ce6){if(_0x1d1ce6){return _0xde6a84[_0xb934('0x1a')](_0x331c34)['json'](_0x1d1ce6);}};}function respondWithFilteredResult(_0xc6d550,_0x1ea202){return function(_0x2e99fc){if(_0x2e99fc){var _0x15f749=typeof _0x1ea202[_0xb934('0x1c')]===_0xb934('0x1d')&&typeof _0x1ea202[_0xb934('0x1e')]===_0xb934('0x1d');var _0x5b05ff=_0x2e99fc[_0xb934('0x1f')];var _0xce998c=_0x15f749?0x0:_0x1ea202[_0xb934('0x1c')];var _0x4d2de5=_0x15f749?_0x2e99fc[_0xb934('0x1f')]:_0x1ea202['offset']+_0x1ea202['limit'];var _0xde2c30;if(_0x4d2de5>=_0x5b05ff){_0x4d2de5=_0x5b05ff;_0xde2c30=0xc8;}else{_0xde2c30=0xce;}_0xc6d550[_0xb934('0x1a')](_0xde2c30);return _0xc6d550[_0xb934('0x20')](_0xb934('0x21'),_0xce998c+'-'+_0x4d2de5+'/'+_0x5b05ff)[_0xb934('0x22')](_0x2e99fc);}return null;};}function patchUpdates(_0x2ec9f9){return function(_0x34df2d){try{jsonpatch[_0xb934('0x23')](_0x34df2d,_0x2ec9f9,!![]);}catch(_0x46ff39){return BPromise[_0xb934('0x24')](_0x46ff39);}return _0x34df2d[_0xb934('0x25')]();};}function saveUpdates(_0x269644,_0x36416c){return function(_0x193f33){if(_0x193f33){return _0x193f33[_0xb934('0x26')](_0x269644)[_0xb934('0x27')](function(_0x479a81){return _0x479a81;});}return null;};}function removeEntity(_0x4063e4,_0x1acce9){return function(_0x2691ac){if(_0x2691ac){return _0x2691ac[_0xb934('0x28')]()[_0xb934('0x27')](function(){_0x4063e4[_0xb934('0x1a')](0xcc)[_0xb934('0x1b')]();});}};}function handleEntityNotFound(_0x56e862,_0x59735b){return function(_0x5dc93c){if(!_0x5dc93c){_0x56e862[_0xb934('0x29')](0x194);}return _0x5dc93c;};}function handleError(_0x4b567b,_0x2fbabd){_0x2fbabd=_0x2fbabd||0x1f4;return function(_0x11cb15){logger[_0xb934('0x2a')](_0x11cb15[_0xb934('0x2b')]);if(_0x11cb15['name']){delete _0x11cb15[_0xb934('0x2c')];}_0x4b567b[_0xb934('0x1a')](_0x2fbabd)[_0xb934('0x2d')](_0x11cb15);};}exports[_0xb934('0x2e')]=function(_0xa177e6,_0xf30b02){var _0x402e3f={},_0x50e0f5={},_0x26c32b={'count':0x0,'rows':[]};var _0x486f00=_[_0xb934('0x2f')](db['WhatsappTransferReport'][_0xb934('0x30')],function(_0x8864a6){return{'name':_0x8864a6['fieldName'],'type':_0x8864a6[_0xb934('0x31')][_0xb934('0x32')]};});_0x50e0f5[_0xb934('0x33')]=_['map'](_0x486f00,_0xb934('0x2c'));_0x50e0f5[_0xb934('0x34')]=_[_0xb934('0x35')](_0xa177e6[_0xb934('0x34')]);_0x50e0f5[_0xb934('0x36')]=_[_0xb934('0x37')](_0x50e0f5[_0xb934('0x33')],_0x50e0f5[_0xb934('0x34')]);_0x402e3f[_0xb934('0x38')]=_[_0xb934('0x37')](_0x50e0f5[_0xb934('0x33')],qs[_0xb934('0x39')](_0xa177e6[_0xb934('0x34')][_0xb934('0x39')]));_0x402e3f['attributes']=_0x402e3f[_0xb934('0x38')][_0xb934('0x3a')]?_0x402e3f[_0xb934('0x38')]:_0x50e0f5['model'];if(!_0xa177e6[_0xb934('0x34')][_0xb934('0x3b')](_0xb934('0x3c'))){_0x402e3f[_0xb934('0x1e')]=qs[_0xb934('0x1e')](_0xa177e6[_0xb934('0x34')][_0xb934('0x1e')]);_0x402e3f[_0xb934('0x1c')]=qs['offset'](_0xa177e6[_0xb934('0x34')][_0xb934('0x1c')]);}_0x402e3f[_0xb934('0x3d')]=qs[_0xb934('0x3e')](_0xa177e6[_0xb934('0x34')][_0xb934('0x3e')]);_0x402e3f[_0xb934('0x3f')]=qs['filters'](_[_0xb934('0x40')](_0xa177e6['query'],_0x50e0f5[_0xb934('0x36')]),_0x486f00);if(_0xa177e6[_0xb934('0x34')][_0xb934('0x41')]){_0x402e3f[_0xb934('0x3f')]=_[_0xb934('0x42')](_0x402e3f[_0xb934('0x3f')],{'$or':_[_0xb934('0x2f')](_0x486f00,function(_0x41fb3e){if(_0x41fb3e[_0xb934('0x31')]!==_0xb934('0x43')){var _0x500d22={};_0x500d22[_0x41fb3e[_0xb934('0x2c')]]={'$like':'%'+_0xa177e6[_0xb934('0x34')][_0xb934('0x41')]+'%'};return _0x500d22;}})});}_0x402e3f=_[_0xb934('0x42')]({},_0x402e3f,_0xa177e6[_0xb934('0x44')]);var _0xcffc90={'where':_0x402e3f[_0xb934('0x3f')]};return db['WhatsappTransferReport']['count'](_0xcffc90)[_0xb934('0x27')](function(_0x161d5d){_0x26c32b[_0xb934('0x1f')]=_0x161d5d;if(_0xa177e6[_0xb934('0x34')]['includeAll']){_0x402e3f[_0xb934('0x45')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb934('0x46')](_0x402e3f);})[_0xb934('0x27')](function(_0x24fde8){_0x26c32b[_0xb934('0x47')]=_0x24fde8;return _0x26c32b;})['then'](respondWithFilteredResult(_0xf30b02,_0x402e3f))[_0xb934('0x48')](handleError(_0xf30b02,null));};exports['show']=function(_0x389777,_0x4e3244){var _0x229bc9={'raw':!![],'where':{'id':_0x389777[_0xb934('0x49')]['id']}},_0x8ac605={};_0x8ac605[_0xb934('0x33')]=_['keys'](db[_0xb934('0x4a')][_0xb934('0x30')]);_0x8ac605[_0xb934('0x34')]=_['keys'](_0x389777[_0xb934('0x34')]);_0x8ac605[_0xb934('0x36')]=_[_0xb934('0x37')](_0x8ac605[_0xb934('0x33')],_0x8ac605[_0xb934('0x34')]);_0x229bc9[_0xb934('0x38')]=_[_0xb934('0x37')](_0x8ac605[_0xb934('0x33')],qs[_0xb934('0x39')](_0x389777['query'][_0xb934('0x39')]));_0x229bc9[_0xb934('0x38')]=_0x229bc9[_0xb934('0x38')][_0xb934('0x3a')]?_0x229bc9[_0xb934('0x38')]:_0x8ac605['model'];if(_0x389777[_0xb934('0x34')]['includeAll']){_0x229bc9[_0xb934('0x45')]=[{'all':!![]}];}_0x229bc9=_['merge']({},_0x229bc9,_0x389777[_0xb934('0x44')]);return db['WhatsappTransferReport']['find'](_0x229bc9)[_0xb934('0x27')](handleEntityNotFound(_0x4e3244,null))[_0xb934('0x27')](respondWithResult(_0x4e3244,null))[_0xb934('0x48')](handleError(_0x4e3244,null));};exports[_0xb934('0x4b')]=function(_0x1880a2,_0x3502e6){return db['WhatsappTransferReport']['create'](_0x1880a2[_0xb934('0x4c')],{})[_0xb934('0x27')](respondWithResult(_0x3502e6,0xc9))['catch'](handleError(_0x3502e6,null));};exports[_0xb934('0x26')]=function(_0x5bfbb7,_0x1764f4){if(_0x5bfbb7[_0xb934('0x4c')]['id']){delete _0x5bfbb7['body']['id'];}return db['WhatsappTransferReport'][_0xb934('0x4d')]({'where':{'id':_0x5bfbb7[_0xb934('0x49')]['id']}})[_0xb934('0x27')](handleEntityNotFound(_0x1764f4,null))[_0xb934('0x27')](saveUpdates(_0x5bfbb7[_0xb934('0x4c')],null))[_0xb934('0x27')](respondWithResult(_0x1764f4,null))[_0xb934('0x48')](handleError(_0x1764f4,null));};exports[_0xb934('0x28')]=function(_0x3e171e,_0x5a7e26){return db[_0xb934('0x4a')]['find']({'where':{'id':_0x3e171e[_0xb934('0x49')]['id']}})[_0xb934('0x27')](handleEntityNotFound(_0x5a7e26,null))[_0xb934('0x27')](removeEntity(_0x5a7e26,null))['catch'](handleError(_0x5a7e26,null));};exports[_0xb934('0x4e')]=function(_0x48ae08,_0xcfef17){return db[_0xb934('0x4a')]['describe']()['then'](respondWithResult(_0xcfef17,null))[_0xb934('0x48')](handleError(_0xcfef17,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e0e4c75..0870f9d 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 _0xd8b1=['request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','util','api','bluebird'];(function(_0x4c2921,_0x4e4cfb){var _0x230e18=function(_0x2c976c){while(--_0x2c976c){_0x4c2921['push'](_0x4c2921['shift']());}};_0x230e18(++_0x4e4cfb);}(_0xd8b1,0x1da));var _0x1d8b=function(_0x1b1887,_0x39ffff){_0x1b1887=_0x1b1887-0x0;var _0x395278=_0xd8b1[_0x1b1887];return _0x395278;};'use strict';var _=require('lodash');var util=require(_0x1d8b('0x0'));var logger=require('../../config/logger')(_0x1d8b('0x1'));var moment=require('moment');var BPromise=require(_0x1d8b('0x2'));var rp=require(_0x1d8b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d8b('0x4'));var config=require(_0x1d8b('0x5'));var attributes=require(_0x1d8b('0x6'));module[_0x1d8b('0x7')]=function(_0x5429b4,_0x4cdca5){return _0x5429b4['define']('WhatsappTransferReport',attributes,{'tableName':_0x1d8b('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa96a=['WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x1a74c8,_0x580a6e){var _0x4ec492=function(_0x27efb8){while(--_0x27efb8){_0x1a74c8['push'](_0x1a74c8['shift']());}};_0x4ec492(++_0x580a6e);}(_0xa96a,0x182));var _0xaa96=function(_0x46f21f,_0x1a06e2){_0x46f21f=_0x46f21f-0x0;var _0x1327e1=_0xa96a[_0x46f21f];return _0x1327e1;};'use strict';var _=require(_0xaa96('0x0'));var util=require(_0xaa96('0x1'));var logger=require(_0xaa96('0x2'))(_0xaa96('0x3'));var moment=require('moment');var BPromise=require(_0xaa96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa96('0x5'));var rimraf=require(_0xaa96('0x6'));var config=require(_0xaa96('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xaa96('0x8')]=function(_0x137926,_0x40cbe4){return _0x137926[_0xaa96('0x9')](_0xaa96('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xaa96('0xb'),'fields':[_0xaa96('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 45a3bf5..e2202aa 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 _0xa3d5=['request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xb57df1,_0x4a47ae){var _0x2837a4=function(_0x289ceb){while(--_0x289ceb){_0xb57df1['push'](_0xb57df1['shift']());}};_0x2837a4(++_0x4a47ae);}(_0xa3d5,0x124));var _0x5a3d=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xa3d5[_0x176329];return _0x31997c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a3d('0x0'));var BPromise=require('bluebird');var rs=require(_0x5a3d('0x1'));var fs=require('fs');var Redis=require(_0x5a3d('0x2'));var db=require(_0x5a3d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a3d('0x4'))('rpc');var config=require(_0x5a3d('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5a3d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c1864,_0x2474e8,_0x2b901d){return new BPromise(function(_0x582cbc,_0xb63482){return client['request'](_0x1c1864,_0x2b901d)[_0x5a3d('0x7')](function(_0x4acf18){logger[_0x5a3d('0x8')](_0x5a3d('0x9'),_0x2474e8,'request\x20sent');logger[_0x5a3d('0xa')](_0x5a3d('0xb'),_0x2474e8,_0x5a3d('0xc'),JSON[_0x5a3d('0xd')](_0x4acf18));if(_0x4acf18[_0x5a3d('0xe')]){if(_0x4acf18[_0x5a3d('0xe')][_0x5a3d('0xf')]===0x1f4){logger[_0x5a3d('0xe')](_0x5a3d('0x9'),_0x2474e8,_0x4acf18[_0x5a3d('0xe')][_0x5a3d('0x10')]);return _0xb63482(_0x4acf18[_0x5a3d('0xe')][_0x5a3d('0x10')]);}logger[_0x5a3d('0xe')](_0x5a3d('0x9'),_0x2474e8,_0x4acf18[_0x5a3d('0xe')][_0x5a3d('0x10')]);return _0x582cbc(_0x4acf18['error'][_0x5a3d('0x10')]);}else{logger['info'](_0x5a3d('0x9'),_0x2474e8,_0x5a3d('0xc'));_0x582cbc(_0x4acf18[_0x5a3d('0x11')]['message']);}})[_0x5a3d('0x12')](function(_0x40ed2a){logger[_0x5a3d('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2474e8,_0x40ed2a);_0xb63482(_0x40ed2a);});});} \ No newline at end of file +var _0x8482=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8482,0xe1));var _0x2848=function(_0x249043,_0xff2f31){_0x249043=_0x249043-0x0;var _0x265b0d=_0x8482[_0x249043];return _0x265b0d;};'use strict';var _=require(_0x2848('0x0'));var util=require(_0x2848('0x1'));var moment=require(_0x2848('0x2'));var BPromise=require(_0x2848('0x3'));var rs=require(_0x2848('0x4'));var fs=require('fs');var Redis=require(_0x2848('0x5'));var db=require(_0x2848('0x6'))['db'];var utils=require(_0x2848('0x7'));var logger=require(_0x2848('0x8'))(_0x2848('0x9'));var config=require('../../config/environment');var jayson=require(_0x2848('0xa'));var client=jayson['client'][_0x2848('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162283,_0x40cc88,_0x36850a){return new BPromise(function(_0x2f0627,_0x47a843){return client['request'](_0x162283,_0x36850a)[_0x2848('0xc')](function(_0x1c5710){logger[_0x2848('0xd')](_0x2848('0xe'),_0x40cc88,_0x2848('0xf'));logger['debug'](_0x2848('0x10'),_0x40cc88,_0x2848('0xf'),JSON['stringify'](_0x1c5710));if(_0x1c5710[_0x2848('0x11')]){if(_0x1c5710[_0x2848('0x11')][_0x2848('0x12')]===0x1f4){logger['error'](_0x2848('0xe'),_0x40cc88,_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);return _0x47a843(_0x1c5710[_0x2848('0x11')]['message']);}logger[_0x2848('0x11')](_0x2848('0xe'),_0x40cc88,_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);return _0x2f0627(_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);}else{logger[_0x2848('0xd')](_0x2848('0xe'),_0x40cc88,_0x2848('0xf'));_0x2f0627(_0x1c5710[_0x2848('0x14')][_0x2848('0x13')]);}})[_0x2848('0x15')](function(_0x59077e){logger[_0x2848('0x11')](_0x2848('0xe'),_0x40cc88,_0x59077e);_0x47a843(_0x59077e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 580602d..3449423 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f4c=['lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','listen','start','info','Online\x20apps:','map','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','./config/license','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0x55f249,_0x1761f2){var _0x335274=function(_0x1792d0){while(--_0x1792d0){_0x55f249['push'](_0x55f249['shift']());}};_0x335274(++_0x1761f2);}(_0x1f4c,0x78));var _0xc1f4=function(_0xae4c70,_0x41b448){_0xae4c70=_0xae4c70-0x0;var _0x3ba69e=_0x1f4c[_0xae4c70];return _0x3ba69e;};'use strict';var _=require(_0xc1f4('0x0'));var mysqldb=require(_0xc1f4('0x1'));var rpc=require(_0xc1f4('0x2'));var config=require('./config/environment');var logger=require(_0xc1f4('0x3'))(_0xc1f4('0x4'));var pm2=require(_0xc1f4('0x5'));var pm2Config=require(_0xc1f4('0x6'));var schedule=require(_0xc1f4('0x7'));var chat=require(_0xc1f4('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xc1f4('0x9'));function main(){return mysqldb['db'][_0xc1f4('0xa')][_0xc1f4('0xb')]()[_0xc1f4('0xc')](function(){return rpc[_0xc1f4('0xd')]();})[_0xc1f4('0xc')](function(_0x55acf0){logger['info'](_0x55acf0);return chat[_0xc1f4('0xe')]();})[_0xc1f4('0xc')](function(){return whatsapp[_0xc1f4('0xe')]();})['then'](function(){return schedule[_0xc1f4('0xe')]();})[_0xc1f4('0xc')](function(){return transcribe[_0xc1f4('0xe')]();})[_0xc1f4('0xc')](function(_0x3b30a7){logger[_0xc1f4('0xf')](_0x3b30a7);return pm2[_0xc1f4('0xe')](pm2Config);})['then'](function(_0x1cad52){logger[_0xc1f4('0xf')](_0xc1f4('0x10'),_[_0xc1f4('0x11')](_['filter'](_0x1cad52,{'status':_0xc1f4('0x12')}),_0xc1f4('0x13'))[_0xc1f4('0x14')]());logger['info'](_0xc1f4('0x15'),_[_0xc1f4('0x11')](_['filter'](_0x1cad52,function(_0x5843de){return _0x5843de[_0xc1f4('0x16')]!==_0xc1f4('0x12');}),_0xc1f4('0x13'))[_0xc1f4('0x14')]()||_0xc1f4('0x17'));config[_0xc1f4('0x18')]&&require(_0xc1f4('0x19'))['default']();require(_0xc1f4('0x1a'))[_0xc1f4('0x1b')]();})['catch'](function(_0xcd3e88){logger[_0xc1f4('0x1c')](_0xc1f4('0x1d'),_0xcd3e88);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x9a71=['sync','listen','then','info','start','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB','default','./config/license','catch','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize'];(function(_0x43b888,_0xe977a6){var _0x142d2a=function(_0x49970e){while(--_0x49970e){_0x43b888['push'](_0x43b888['shift']());}};_0x142d2a(++_0xe977a6);}(_0x9a71,0x1f2));var _0x19a7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a71[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x19a7('0x0'));var mysqldb=require(_0x19a7('0x1'));var rpc=require(_0x19a7('0x2'));var config=require(_0x19a7('0x3'));var logger=require(_0x19a7('0x4'))(_0x19a7('0x5'));var pm2=require(_0x19a7('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x19a7('0x7'));var chat=require(_0x19a7('0x8'));var whatsapp=require(_0x19a7('0x9'));var transcribe=require(_0x19a7('0xa'));function main(){return mysqldb['db'][_0x19a7('0xb')][_0x19a7('0xc')]()['then'](function(){return rpc[_0x19a7('0xd')]();})[_0x19a7('0xe')](function(_0x16e642){logger[_0x19a7('0xf')](_0x16e642);return chat['start']();})[_0x19a7('0xe')](function(){return whatsapp[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(){return schedule[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(){return transcribe[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(_0x40ac27){logger[_0x19a7('0xf')](_0x40ac27);return pm2['start'](pm2Config);})['then'](function(_0x176c9c){logger[_0x19a7('0xf')]('Online\x20apps:',_[_0x19a7('0x11')](_[_0x19a7('0x12')](_0x176c9c,{'status':_0x19a7('0x13')}),'name')[_0x19a7('0x14')]());logger[_0x19a7('0xf')](_0x19a7('0x15'),_[_0x19a7('0x11')](_['filter'](_0x176c9c,function(_0x397b2d){return _0x397b2d[_0x19a7('0x16')]!=='online';}),_0x19a7('0x17'))[_0x19a7('0x14')]()||_0x19a7('0x18'));config[_0x19a7('0x19')]&&require('./config/seedDB')[_0x19a7('0x1a')]();require(_0x19a7('0x1b'))['default']();})[_0x19a7('0x1c')](function(_0x2a7864){logger[_0x19a7('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2a7864);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7228ecc..74648b2 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 _0x309d=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','splice','unshift','encryptString','join','promisify','sign','options','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','basic-auth','crypto','bluebird','util','secrets','session','fullname','name','internal','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','then','closed','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','minutes','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format'];(function(_0x46baec,_0x19ddb9){var _0x41af37=function(_0x71686e){while(--_0x71686e){_0x46baec['push'](_0x46baec['shift']());}};_0x41af37(++_0x19ddb9);}(_0x309d,0x1f1));var _0xd309=function(_0x2a0615,_0x4886a9){_0x2a0615=_0x2a0615-0x0;var _0x14826c=_0x309d[_0x2a0615];return _0x14826c;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xd309('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xd309('0x1'));var encryptor=require(_0xd309('0x2'));var _=require(_0xd309('0x3'));var jwt=require(_0xd309('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xd309('0x5'));var crypto=require(_0xd309('0x6'));var BPromise=require(_0xd309('0x7'));var util=require(_0xd309('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xd309('0x9')][_0xd309('0xa')]});var userAttributes=['id','role',_0xd309('0xb'),_0xd309('0xc'),_0xd309('0xd'),'email',_0xd309('0xe'),'permissions',_0xd309('0xf'),_0xd309('0x10'),_0xd309('0x11'),_0xd309('0x12'),_0xd309('0x13'),_0xd309('0x14'),_0xd309('0x15'),_0xd309('0x16'),'showWebBar','lastLoginAt','lastPauseAt',_0xd309('0x17'),_0xd309('0x18'),_0xd309('0x19'),_0xd309('0x1a'),_0xd309('0x1b'),'phoneBarAutoAnswerDelay',_0xd309('0x1c'),'phoneBarEnableRecording',_0xd309('0x1d'),_0xd309('0x1e'),_0xd309('0x1f'),_0xd309('0x20'),'phoneBarRemoteControl',_0xd309('0x21'),_0xd309('0x22'),_0xd309('0x23'),_0xd309('0x24'),_0xd309('0x25'),_0xd309('0x26'),_0xd309('0x27'),_0xd309('0x28'),'downloadOmnichannelInteractions',_0xd309('0x29')];exports[_0xd309('0x2a')]=function(){return this[_0xd309('0x2b')](!![])[_0xd309('0x2c')](function(_0x4b6dd5,_0x167dec,_0x5933b4){if(_0x4b6dd5[_0xd309('0x2d')]){_0x5933b4();}else{return db[_0xd309('0x2e')][_0xd309('0x2f')]({'where':{'id':_0x4b6dd5[_0xd309('0x30')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xd309('0x31')](function(_0x588c91){if(_0x588c91&&_0x588c91[_0xd309('0x32')]){return _0x167dec[_0xd309('0x33')](_0x588c91[_0xd309('0x34')]===_0xd309('0x35')?0x195:0x193)[_0xd309('0x36')]({'message':_0x588c91[_0xd309('0x34')]==='unmanaged'?_0xd309('0x37'):_0xd309('0x38')});}else{_0x5933b4();}})[_0xd309('0x39')](function(_0x2e0f85){_0x5933b4(_0x2e0f85);});}});};exports[_0xd309('0x2b')]=function isAuthenticated(_0x5032ae){return compose()[_0xd309('0x2c')](function(_0x3522c0,_0x30b27e,_0x4b48c2){var _0x2d3df2;if(_0x3522c0['headers'][_0xd309('0x3a')]){if(_[_0xd309('0x3b')](_0x3522c0[_0xd309('0x3c')][_0xd309('0x3a')],'Basic')){var _0x1b045b=basicAuth(_0x3522c0);db[_0xd309('0x3d')][_0xd309('0x3e')]({'where':{'name':_0x1b045b[_0xd309('0xc')]}})[_0xd309('0x31')](function(_0x6e14c6){if(!_0x6e14c6||!_0x6e14c6[_0xd309('0x3f')](_0x1b045b[_0xd309('0x40')])){return _0x30b27e[_0xd309('0x33')](0x191)[_0xd309('0x36')]({'message':_0xd309('0x41')});}_0x3522c0[_0xd309('0x2d')]={'id':_0x6e14c6['id']};_0x4b48c2();})[_0xd309('0x39')](function(_0x320206){_0x4b48c2(_0x320206);});}else if(_[_0xd309('0x3b')](_0x3522c0['headers'][_0xd309('0x3a')],_0xd309('0x42'))){validateJwt(_0x3522c0,_0x30b27e,_0x4b48c2);}else{if(_0x5032ae){_0x4b48c2();}else{return _0x30b27e[_0xd309('0x33')](0x193)[_0xd309('0x36')]({'message':_0xd309('0x43')});}}}else if(_0x3522c0['query']['apikey']){try{var _0x24a0e5={'audience':hardwareConf[_0xd309('0x44')](),'issuer':hardwareConf[_0xd309('0x44')]()};verifyJwt(_0x3522c0[_0xd309('0x45')][_0xd309('0x46')],_0x24a0e5)[_0xd309('0x31')](function(_0x490c18){return db[_0xd309('0x3d')]['find']({'where':{'id':_0x490c18[_0xd309('0x47')]}})['then'](function(_0x14b90a){_0x2d3df2=_0x14b90a;return db[_0xd309('0x48')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd309('0x49')],'raw':!![]});})[_0xd309('0x31')](function(_0x1cd8bf){if(!_0x2d3df2||!_[_0xd309('0x4a')](_0x2d3df2[_0xd309('0x4b')],_0x490c18[_0xd309('0x4c')])){return _0x30b27e[_0xd309('0x33')](0x191)['json']({'message':_0xd309('0x4d')});}if(_0x2d3df2['disabled']){return _0x30b27e[_0xd309('0x33')](0x191)[_0xd309('0x36')]({'message':_0xd309('0x4e')});}if(_0x2d3df2['blocked']){if(_0x1cd8bf[_0xd309('0x49')]>0x0){if(moment(_0x2d3df2['blockedAt'])['add'](_0x1cd8bf[_0xd309('0x49')],_0xd309('0x4f'))>moment()){return _0x30b27e['status'](0x191)[_0xd309('0x36')]({'message':_0xd309('0x4e')});}}else{return _0x30b27e[_0xd309('0x33')](0x191)[_0xd309('0x36')]({'message':_0xd309('0x4e')});}}_0x3522c0[_0xd309('0x2d')]={'id':_0x2d3df2['id']};_0x4b48c2();});})['catch'](function(){return _0x30b27e[_0xd309('0x33')](0x191)[_0xd309('0x36')]({'message':_0xd309('0x4e')});});}catch(_0x556c0f){_0x4b48c2(_0x556c0f);}}else if(_0x5032ae){_0x4b48c2();}else{return _0x30b27e[_0xd309('0x33')](0x193)[_0xd309('0x36')]({'message':_0xd309('0x43')});}})['use'](function(_0x3b83b9,_0x4d6331,_0x58deb2){if(_0x3b83b9[_0xd309('0x2d')]){db['User'][_0xd309('0x3e')]({'where':{'id':_0x3b83b9[_0xd309('0x2d')]['id']},'attributes':userAttributes})[_0xd309('0x31')](function(_0x5e38d5){if(!_0x5e38d5){return _0x4d6331[_0xd309('0x33')](0x194)[_0xd309('0x36')]({'message':_0xd309('0x50')});}_0x3b83b9['user']=_0x5e38d5;_0x58deb2();})[_0xd309('0x39')](function(_0x21e2ba){_0x58deb2(_0x21e2ba);});}else if(_0x5032ae){_0x58deb2();}else{return _0x4d6331[_0xd309('0x33')](0x194)[_0xd309('0x36')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xd309('0x51')]=function canUpdate(){return compose()[_0xd309('0x2c')](function(_0x13e2e6,_0x34b806,_0x1514b6){return licenseUtil[_0xd309('0x52')]()['then'](function(_0x3efbf3){if(_0x3efbf3['update']){_0x1514b6();}else{return _0x34b806[_0xd309('0x33')](0x193)[_0xd309('0x36')]({'message':_0xd309('0x53')});}})[_0xd309('0x39')](function(_0xc6a48){_0x1514b6(_0xc6a48);});});};exports['isMiddleware']=function(_0x2f0553,_0x1850f5,_0x1d7e68){_0x2f0553[_0xd309('0x54')]=!![];return _0x1d7e68();};exports[_0xd309('0x55')]=function signToken(_0x5deacf){return signJwt(_0x5deacf);};exports['setTokenCookie']=function(_0x194ac4,_0x27ef47){if(!_0x194ac4[_0xd309('0x2d')]){return _0x27ef47['status'](0x194)[_0xd309('0x36')]({'message':_0xd309('0x56')});}var _0xa97b66={'payload':{'id':_0x194ac4[_0xd309('0x2d')]['id'],'role':_0x194ac4[_0xd309('0x2d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xa97b66)[_0xd309('0x31')](function(_0x268980){_0x27ef47[_0xd309('0x57')]('motion.token',_0x268980);_0x27ef47[_0xd309('0x58')](_0xd309('0x59'));})[_0xd309('0x39')](function(_0x348579){return _0x27ef47[_0xd309('0x33')](0x1f4)[_0xd309('0x5a')](_0x348579);});};exports['retrieveApiKey']=function(_0x4ddbd4){if(_[_0xd309('0x5b')](_0x4ddbd4['apiKeyNonce'])||_[_0xd309('0x5b')](_0x4ddbd4[_0xd309('0x5c')])){return null;}else{return createJwt(_0x4ddbd4);}};exports[_0xd309('0x5d')]=function(_0x22ec16){_0x22ec16[_0xd309('0x4b')]=generateNonce();_0x22ec16['apiKeyIat']=generateIssuedAt();return createJwt(_0x22ec16);};exports['regenerateApiKey']=function(_0x13135b,_0x474f69){var _0x4f9f94=_0x13135b[_0xd309('0x45')]['apikey'];if(_0x4f9f94){var _0x15aecd={'nonce':_0x474f69['apiKeyNonce'],'iat':_0x474f69[_0xd309('0x5c')],'audience':hardwareConf[_0xd309('0x44')](),'issuer':hardwareConf[_0xd309('0x44')]()};return verifyJwt(_0x4f9f94,_0x15aecd)[_0xd309('0x31')](function(){return generateApiKey(_0x474f69);});}else{throw{'message':_0xd309('0x5e')};}};exports['validatePasswordPattern']=function(_0x468bd7){var _0x3cb943=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3cb943[_0xd309('0x5f')](_0x468bd7))throw new db[(_0xd309('0x60'))]['ValidationError'](_0xd309('0x61'));return;};exports[_0xd309('0x62')]=function(_0x5022a1,_0x573bc0,_0x259219){var _0xab18c1=encryptor[_0xd309('0x63')](_0x573bc0)[_0xd309('0x64')](',');for(var _0x34f067=0x0;_0x34f067<_0x259219;_0x34f067++){if(!_0xab18c1[_0x34f067])break;if(_0x5022a1[_0xd309('0x65')]()===_0xab18c1[_0x34f067][_0xd309('0x65')]()){var _0xd3c5b8=util[_0xd309('0x66')](_0xd309('0x67'),_0x259219);if(_0x259219===0x1){_0xd3c5b8='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xd309('0x60'))][(_0xd309('0x68'))](_0xd3c5b8);}}return;};exports[_0xd309('0x69')]=function(_0x1e9ba8,_0x3b091d){var _0x2f932c=_0x3b091d?encryptor[_0xd309('0x63')](_0x3b091d)['split'](','):[];if(_0x2f932c['length']===0x5){_0x2f932c[_0xd309('0x6a')](-0x1,0x1);}_0x2f932c[_0xd309('0x6b')](_0x1e9ba8);return encryptor[_0xd309('0x6c')](_0x2f932c[_0xd309('0x6d')](','));};function signJwt(_0xe82979){var _0x12209f=BPromise[_0xd309('0x6e')](jwt[_0xd309('0x6f')],{'context':jwt});var _0x33beb8=_0xe82979['secret']||config[_0xd309('0x9')][_0xd309('0xa')];return new BPromise(function(_0xb9e601,_0x907760){_0x12209f(_0xe82979['payload'],_0x33beb8,_0xe82979[_0xd309('0x70')])[_0xd309('0x31')](function(_0x445748){_0xb9e601(_0x445748);})['catch'](function(_0x14d5a3){_0x907760(_0x14d5a3);});});}function verifyJwt(_0x5bedd8,_0x525dd0,_0x538407){var _0x23a5aa=BPromise['promisify'](jwt[_0xd309('0x71')],{'context':jwt});var _0x18d460=_0x538407||config[_0xd309('0x9')][_0xd309('0xa')];return new BPromise(function(_0x1bb03c,_0x30ce87){_0x23a5aa(_0x5bedd8,_0x18d460,_0x525dd0)[_0xd309('0x31')](function(_0x5e842e){_0x1bb03c(_0x5e842e);})[_0xd309('0x39')](function(_0x132c60){_0x30ce87(_0x132c60);});});}function generateNonce(){return crypto[_0xd309('0x72')](0x10)[_0xd309('0x73')](_0xd309('0x74'));}function generateIssuedAt(){return Math[_0xd309('0x75')](Date[_0xd309('0x76')]()/0x3e8)[_0xd309('0x73')]();}function createJwt(_0x4a4671){var _0x1d5082={'payload':{'iat':_0x4a4671[_0xd309('0x5c')],'nonce':_0x4a4671[_0xd309('0x4b')]},'options':{'algorithm':_0xd309('0x77'),'subject':_0x4a4671['id'][_0xd309('0x73')](),'issuer':hardwareConf[_0xd309('0x44')](),'audience':hardwareConf[_0xd309('0x44')]()}};return signJwt(_0x1d5082)[_0xd309('0x31')](function(_0x519e26){return{'iat':_0x4a4671[_0xd309('0x5c')],'nonce':_0x4a4671[_0xd309('0x4b')],'token':_0x519e26};});} \ No newline at end of file +var _0xc4ab=['validatePasswordHistory','decryptString','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','now','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','name','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','use','user','findOne','params','closed','then','status','unmanaged','json','disposition','Forbidden.','catch','isAuthenticated','headers','authorization','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','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~!@#$%^&-_=+[{]}.'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0xc4ab,0x8e));var _0xbc4a=function(_0x2910c8,_0x229299){_0x2910c8=_0x2910c8-0x0;var _0x3cdb11=_0xc4ab[_0x2910c8];return _0x3cdb11;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xbc4a('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbc4a('0x1'));var encryptor=require(_0xbc4a('0x2'));var _=require(_0xbc4a('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbc4a('0x4'));var compose=require(_0xbc4a('0x5'));var basicAuth=require(_0xbc4a('0x6'));var crypto=require(_0xbc4a('0x7'));var BPromise=require(_0xbc4a('0x8'));var util=require(_0xbc4a('0x9'));var moment=require(_0xbc4a('0xa'));var validateJwt=expressJwt({'secret':config[_0xbc4a('0xb')][_0xbc4a('0xc')]});var userAttributes=['id','role',_0xbc4a('0xd'),_0xbc4a('0xe'),'internal',_0xbc4a('0xf'),'userpic',_0xbc4a('0x10'),_0xbc4a('0x11'),_0xbc4a('0x12'),_0xbc4a('0x13'),'mailPause',_0xbc4a('0x14'),_0xbc4a('0x15'),_0xbc4a('0x16'),_0xbc4a('0x17'),'showWebBar',_0xbc4a('0x18'),_0xbc4a('0x19'),_0xbc4a('0x1a'),_0xbc4a('0x1b'),_0xbc4a('0x1c'),_0xbc4a('0x1d'),_0xbc4a('0x1e'),_0xbc4a('0x1f'),_0xbc4a('0x20'),_0xbc4a('0x21'),'phoneBarEnableDtmfTone',_0xbc4a('0x22'),_0xbc4a('0x23'),_0xbc4a('0x24'),_0xbc4a('0x25'),_0xbc4a('0x26'),_0xbc4a('0x27'),_0xbc4a('0x28'),_0xbc4a('0x29'),'privacyEnabled',_0xbc4a('0x2a'),_0xbc4a('0x2b'),_0xbc4a('0x2c'),_0xbc4a('0x2d'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xbc4a('0x2e')](function(_0x180058,_0x1a82c8,_0x1fe9ef){if(_0x180058[_0xbc4a('0x2f')]){_0x1fe9ef();}else{return db['ChatInteraction'][_0xbc4a('0x30')]({'where':{'id':_0x180058[_0xbc4a('0x31')]['id']},'attributes':['id',_0xbc4a('0x32'),'disposition'],'raw':!![]})[_0xbc4a('0x33')](function(_0x182942){if(_0x182942&&_0x182942[_0xbc4a('0x32')]){return _0x1a82c8[_0xbc4a('0x34')](_0x182942['disposition']===_0xbc4a('0x35')?0x195:0x193)[_0xbc4a('0x36')]({'message':_0x182942[_0xbc4a('0x37')]==='unmanaged'?'Unmanaged.':_0xbc4a('0x38')});}else{_0x1fe9ef();}})[_0xbc4a('0x39')](function(_0x5c45fd){_0x1fe9ef(_0x5c45fd);});}});};exports[_0xbc4a('0x3a')]=function isAuthenticated(_0x4122a8){return compose()[_0xbc4a('0x2e')](function(_0x3a6736,_0x5c8811,_0x36a360){var _0x5b8eba;if(_0x3a6736[_0xbc4a('0x3b')]['authorization']){if(_['startsWith'](_0x3a6736[_0xbc4a('0x3b')][_0xbc4a('0x3c')],'Basic')){var _0x3b1a11=basicAuth(_0x3a6736);db[_0xbc4a('0x3d')][_0xbc4a('0x3e')]({'where':{'name':_0x3b1a11['name']}})[_0xbc4a('0x33')](function(_0x1f4199){if(!_0x1f4199||!_0x1f4199[_0xbc4a('0x3f')](_0x3b1a11['pass'])){return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':_0xbc4a('0x40')});}_0x3a6736[_0xbc4a('0x2f')]={'id':_0x1f4199['id']};_0x36a360();})[_0xbc4a('0x39')](function(_0x183848){_0x36a360(_0x183848);});}else if(_['startsWith'](_0x3a6736['headers'][_0xbc4a('0x3c')],_0xbc4a('0x41'))){validateJwt(_0x3a6736,_0x5c8811,_0x36a360);}else{if(_0x4122a8){_0x36a360();}else{return _0x5c8811['status'](0x193)[_0xbc4a('0x36')]({'message':_0xbc4a('0x42')});}}}else if(_0x3a6736['query'][_0xbc4a('0x43')]){try{var _0x289a89={'audience':hardwareConf[_0xbc4a('0x44')](),'issuer':hardwareConf[_0xbc4a('0x44')]()};verifyJwt(_0x3a6736[_0xbc4a('0x45')]['apikey'],_0x289a89)['then'](function(_0x10c504){return db['User'][_0xbc4a('0x3e')]({'where':{'id':_0x10c504['sub']}})['then'](function(_0x1a40ca){_0x5b8eba=_0x1a40ca;return db[_0xbc4a('0x46')][_0xbc4a('0x30')]({'where':{'id':0x1},'attributes':[_0xbc4a('0x47'),_0xbc4a('0x48')],'raw':!![]});})[_0xbc4a('0x33')](function(_0x46f736){if(!_0x5b8eba||!_[_0xbc4a('0x49')](_0x5b8eba[_0xbc4a('0x4a')],_0x10c504['nonce'])){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4b')});}if(_0x5b8eba[_0xbc4a('0x4c')]){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4d')});}if(_0x5b8eba[_0xbc4a('0x4e')]){if(_0x46f736[_0xbc4a('0x48')]>0x0){if(moment(_0x5b8eba[_0xbc4a('0x4f')])[_0xbc4a('0x50')](_0x46f736[_0xbc4a('0x48')],'minutes')>moment()){return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3a6736[_0xbc4a('0x2f')]={'id':_0x5b8eba['id']};_0x36a360();});})[_0xbc4a('0x39')](function(){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4d')});});}catch(_0x61a932){_0x36a360(_0x61a932);}}else if(_0x4122a8){_0x36a360();}else{return _0x5c8811[_0xbc4a('0x34')](0x193)[_0xbc4a('0x36')]({'message':_0xbc4a('0x42')});}})[_0xbc4a('0x2e')](function(_0x427156,_0xadadeb,_0x595d2b){if(_0x427156[_0xbc4a('0x2f')]){db[_0xbc4a('0x3d')][_0xbc4a('0x3e')]({'where':{'id':_0x427156['user']['id']},'attributes':userAttributes})[_0xbc4a('0x33')](function(_0x221318){if(!_0x221318){return _0xadadeb['status'](0x194)[_0xbc4a('0x36')]({'message':'User\x20not\x20found.'});}_0x427156['user']=_0x221318;_0x595d2b();})[_0xbc4a('0x39')](function(_0x1545b6){_0x595d2b(_0x1545b6);});}else if(_0x4122a8){_0x595d2b();}else{return _0xadadeb[_0xbc4a('0x34')](0x194)['json']({'message':_0xbc4a('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x39bb97,_0x5cb60e,_0x11abec){return licenseUtil[_0xbc4a('0x52')]()['then'](function(_0x6ba24a){if(_0x6ba24a[_0xbc4a('0x53')]){_0x11abec();}else{return _0x5cb60e[_0xbc4a('0x34')](0x193)['json']({'message':_0xbc4a('0x54')});}})[_0xbc4a('0x39')](function(_0x5afec5){_0x11abec(_0x5afec5);});});};exports[_0xbc4a('0x55')]=function(_0x71d29f,_0x4f6ac0,_0x3ee8e4){_0x71d29f[_0xbc4a('0x55')]=!![];return _0x3ee8e4();};exports[_0xbc4a('0x56')]=function signToken(_0x4b9139){return signJwt(_0x4b9139);};exports[_0xbc4a('0x57')]=function(_0x5d11b1,_0x450660){if(!_0x5d11b1[_0xbc4a('0x2f')]){return _0x450660[_0xbc4a('0x34')](0x194)[_0xbc4a('0x36')]({'message':_0xbc4a('0x58')});}var _0x383f08={'payload':{'id':_0x5d11b1[_0xbc4a('0x2f')]['id'],'role':_0x5d11b1[_0xbc4a('0x2f')][_0xbc4a('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0x383f08)['then'](function(_0xed40c5){_0x450660[_0xbc4a('0x5a')](_0xbc4a('0x5b'),_0xed40c5);_0x450660[_0xbc4a('0x5c')](_0xbc4a('0x5d'));})[_0xbc4a('0x39')](function(_0x59c34a){return _0x450660[_0xbc4a('0x34')](0x1f4)['send'](_0x59c34a);});};exports[_0xbc4a('0x5e')]=function(_0x19c503){if(_[_0xbc4a('0x5f')](_0x19c503[_0xbc4a('0x4a')])||_[_0xbc4a('0x5f')](_0x19c503[_0xbc4a('0x60')])){return null;}else{return createJwt(_0x19c503);}};exports['generateApiKey']=function(_0x17fa30){_0x17fa30[_0xbc4a('0x4a')]=generateNonce();_0x17fa30['apiKeyIat']=generateIssuedAt();return createJwt(_0x17fa30);};exports[_0xbc4a('0x61')]=function(_0x1c5d68,_0x4053a7){var _0x2e6532=_0x1c5d68[_0xbc4a('0x45')][_0xbc4a('0x43')];if(_0x2e6532){var _0x450523={'nonce':_0x4053a7['apiKeyNonce'],'iat':_0x4053a7[_0xbc4a('0x60')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbc4a('0x44')]()};return verifyJwt(_0x2e6532,_0x450523)[_0xbc4a('0x33')](function(){return generateApiKey(_0x4053a7);});}else{throw{'message':_0xbc4a('0x62')};}};exports[_0xbc4a('0x63')]=function(_0x427210){var _0x52200b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x52200b[_0xbc4a('0x64')](_0x427210))throw new db[(_0xbc4a('0x65'))][(_0xbc4a('0x66'))](_0xbc4a('0x67'));return;};exports[_0xbc4a('0x68')]=function(_0x413e1e,_0x43ac2f,_0x530e71){var _0xe593c0=encryptor[_0xbc4a('0x69')](_0x43ac2f)['split'](',');for(var _0x448ccb=0x0;_0x448ccb<_0x530e71;_0x448ccb++){if(!_0xe593c0[_0x448ccb])break;if(_0x413e1e['toLowerCase']()===_0xe593c0[_0x448ccb]['toLowerCase']()){var _0x595cdb=util[_0xbc4a('0x6a')](_0xbc4a('0x6b'),_0x530e71);if(_0x530e71===0x1){_0x595cdb=_0xbc4a('0x6c');}throw new db[(_0xbc4a('0x65'))][(_0xbc4a('0x66'))](_0x595cdb);}}return;};exports[_0xbc4a('0x6d')]=function(_0x145c08,_0x55d519){var _0x352b7f=_0x55d519?encryptor[_0xbc4a('0x69')](_0x55d519)[_0xbc4a('0x6e')](','):[];if(_0x352b7f['length']===0x5){_0x352b7f['splice'](-0x1,0x1);}_0x352b7f[_0xbc4a('0x6f')](_0x145c08);return encryptor[_0xbc4a('0x70')](_0x352b7f[_0xbc4a('0x71')](','));};function signJwt(_0x5852e2){var _0x6bf4c4=BPromise[_0xbc4a('0x72')](jwt[_0xbc4a('0x73')],{'context':jwt});var _0x5ddf05=_0x5852e2[_0xbc4a('0x74')]||config[_0xbc4a('0xb')]['session'];return new BPromise(function(_0x4cd686,_0x19e0a1){_0x6bf4c4(_0x5852e2['payload'],_0x5ddf05,_0x5852e2[_0xbc4a('0x75')])[_0xbc4a('0x33')](function(_0x282261){_0x4cd686(_0x282261);})['catch'](function(_0x53abcd){_0x19e0a1(_0x53abcd);});});}function verifyJwt(_0x3b63b0,_0x2e8729,_0x1aaf8d){var _0x45603b=BPromise[_0xbc4a('0x72')](jwt[_0xbc4a('0x76')],{'context':jwt});var _0x5e4a95=_0x1aaf8d||config['secrets'][_0xbc4a('0xc')];return new BPromise(function(_0x482bdc,_0x5efcbe){_0x45603b(_0x3b63b0,_0x5e4a95,_0x2e8729)[_0xbc4a('0x33')](function(_0xb1960d){_0x482bdc(_0xb1960d);})[_0xbc4a('0x39')](function(_0x41d3cb){_0x5efcbe(_0x41d3cb);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xbc4a('0x77')](_0xbc4a('0x78'));}function generateIssuedAt(){return Math[_0xbc4a('0x79')](Date[_0xbc4a('0x7a')]()/0x3e8)[_0xbc4a('0x77')]();}function createJwt(_0x38016a){var _0x88898d={'payload':{'iat':_0x38016a['apiKeyIat'],'nonce':_0x38016a[_0xbc4a('0x4a')]},'options':{'algorithm':'HS512','subject':_0x38016a['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xbc4a('0x44')]()}};return signJwt(_0x88898d)[_0xbc4a('0x33')](function(_0x519622){return{'iat':_0x38016a['apiKeyIat'],'nonce':_0x38016a[_0xbc4a('0x4a')],'token':_0x519622};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 255ca45..1b2c73f 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 _0xf8b0=['aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','close','unlink','createDecipher','final','encryptString','secret','utf8','base64','crypto','bluebird','../../config/environment','../../config/logger','secrets','session','aes-256-ctr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8b0,0x185));var _0x0f8b=function(_0xa90930,_0x5c1dfd){_0xa90930=_0xa90930-0x0;var _0x337d8e=_0xf8b0[_0xa90930];return _0x337d8e;};'use strict';var crypto=require(_0x0f8b('0x0'));var fs=require('fs');var BPromise=require(_0x0f8b('0x1'));var _=require('lodash');var config=require(_0x0f8b('0x2'));var logger=require(_0x0f8b('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0f8b('0x4')][_0x0f8b('0x5')],'algorithm':_0x0f8b('0x6')};const fileOptions={'algorithm':_0x0f8b('0x7')};if(config[_0x0f8b('0x8')]&&config['encrypt'][_0x0f8b('0x9')]){var isSupported=isAlgorithmSupported(config[_0x0f8b('0x8')][_0x0f8b('0x9')]);if(isSupported){fileOptions[_0x0f8b('0x9')]=config['encrypt'][_0x0f8b('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0f8b('0xa')](',\x20');logger[_0x0f8b('0xb')](config['encrypt'][_0x0f8b('0x9')],_0x0f8b('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x23de74){return AES_SUPPORTED_RX[_0x0f8b('0xd')](_0x23de74);}function getSupportedCiphers(){return crypto[_0x0f8b('0xe')]()[_0x0f8b('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x167423){return getSupportedCiphers()['indexOf'](_0x167423)>-0x1;}function combineOptions(_0x58b169){var _0x2289e3={};for(var _0x4589ad in fileOptions){if(fileOptions['hasOwnProperty'](_0x4589ad)){_0x2289e3[_0x4589ad]=fileOptions[_0x4589ad];}}if(_0x58b169){for(var _0x57a486 in _0x58b169){if(_0x58b169[_0x0f8b('0x10')](_0x57a486)){_0x2289e3[_0x57a486]=_0x58b169[_0x57a486];}}}return _0x2289e3;}exports['encryptFile']=function(_0x40c4ed,_0x2b8dfa,_0x53349a,_0x122bdb){return new BPromise(function(_0x4ce03d,_0x367b47){_0x122bdb=combineOptions(_0x122bdb);var _0x2b36fd=new Buffer(_0x53349a);var _0x4edc18=fs[_0x0f8b('0x11')](_0x40c4ed);var _0x17fc49=fs[_0x0f8b('0x12')](_0x2b8dfa);var _0x23483b=crypto[_0x0f8b('0x13')](_0x122bdb[_0x0f8b('0x9')],_0x2b36fd);_0x4edc18['on'](_0x0f8b('0x14'),function(_0x3a1caa){var _0x4b4ce3=new Buffer(_0x23483b[_0x0f8b('0x15')](_0x3a1caa),_0x0f8b('0x16'));_0x17fc49[_0x0f8b('0x17')](_0x4b4ce3);});_0x4edc18['on'](_0x0f8b('0x18'),function(){try{var _0xc854fb=new Buffer(_0x23483b['final']('binary'),_0x0f8b('0x16'));_0x17fc49[_0x0f8b('0x17')](_0xc854fb);_0x17fc49[_0x0f8b('0x18')]();_0x17fc49['on'](_0x0f8b('0x19'),function(){return _0x4ce03d(_0x2b8dfa);});}catch(_0x1eb161){fs[_0x0f8b('0x1a')](_0x2b8dfa);return _0x367b47(_0x1eb161);}});});};exports['decryptFile']=function(_0x23388a,_0x12efd8,_0x358ad1,_0x1f4414){return new BPromise(function(_0x1a1a91,_0x2b9c56){_0x1f4414=combineOptions(_0x1f4414);var _0x3b8874=new Buffer(_0x358ad1);var _0x3f4de5=fs['createReadStream'](_0x23388a);var _0x43e567=fs[_0x0f8b('0x12')](_0x12efd8);var _0x504e68=crypto[_0x0f8b('0x1b')](_0x1f4414[_0x0f8b('0x9')],_0x3b8874);_0x3f4de5['on'](_0x0f8b('0x14'),function(_0x161c81){var _0x1e90c4=new Buffer(_0x504e68[_0x0f8b('0x15')](_0x161c81),_0x0f8b('0x16'));_0x43e567['write'](_0x1e90c4);});_0x3f4de5['on'](_0x0f8b('0x18'),function(){try{var _0x58f8e0=new Buffer(_0x504e68[_0x0f8b('0x1c')]('binary'),_0x0f8b('0x16'));_0x43e567[_0x0f8b('0x17')](_0x58f8e0);_0x43e567[_0x0f8b('0x18')]();_0x43e567['on']('close',function(){return _0x1a1a91(_0x12efd8);});}catch(_0x27da81){fs[_0x0f8b('0x1a')](_0x12efd8);return _0x2b9c56(_0x27da81);}});});};exports[_0x0f8b('0x1d')]=function(_0x46a1a6,_0x561927,_0x407b83){var _0x47f995=_0x407b83||stringOptions[_0x0f8b('0x9')];var _0x5183fa=_0x561927||stringOptions[_0x0f8b('0x1e')];var _0x219413=crypto[_0x0f8b('0x13')](_0x47f995,_0x5183fa);var _0x5772e0=_0x219413[_0x0f8b('0x15')](_0x46a1a6,_0x0f8b('0x1f'),'base64');_0x5772e0+=_0x219413['final'](_0x0f8b('0x20'));return _0x5772e0;};exports['decryptString']=function(_0x1d6e81,_0x30107e,_0xe3e924){var _0x3e577c=_0xe3e924||stringOptions[_0x0f8b('0x9')];var _0x681811=_0x30107e||stringOptions[_0x0f8b('0x1e')];var _0x4ee7c4=crypto[_0x0f8b('0x1b')](_0x3e577c,_0x681811);var _0xbd4bbe=_0x4ee7c4['update'](_0x1d6e81,_0x0f8b('0x20'),_0x0f8b('0x1f'));_0xbd4bbe+=_0x4ee7c4['final'](_0x0f8b('0x1f'));return _0xbd4bbe;}; \ No newline at end of file +var _0x2b46=['indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','close','unlink','decryptFile','createDecipher','encryptString','createCipher','utf8','base64','final','decryptString','secret','crypto','bluebird','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter'];(function(_0x2e63dd,_0x31651c){var _0x4fded6=function(_0x32d95d){while(--_0x32d95d){_0x2e63dd['push'](_0x2e63dd['shift']());}};_0x4fded6(++_0x31651c);}(_0x2b46,0x162));var _0x62b4=function(_0x3a09e5,_0x44f04f){_0x3a09e5=_0x3a09e5-0x0;var _0x39cbcf=_0x2b46[_0x3a09e5];return _0x39cbcf;};'use strict';var crypto=require(_0x62b4('0x0'));var fs=require('fs');var BPromise=require(_0x62b4('0x1'));var _=require('lodash');var config=require(_0x62b4('0x2'));var logger=require(_0x62b4('0x3'))(_0x62b4('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x62b4('0x5')],'algorithm':_0x62b4('0x6')};const fileOptions={'algorithm':_0x62b4('0x7')};if(config['encrypt']&&config[_0x62b4('0x8')][_0x62b4('0x9')]){var isSupported=isAlgorithmSupported(config[_0x62b4('0x8')][_0x62b4('0x9')]);if(isSupported){fileOptions[_0x62b4('0x9')]=config[_0x62b4('0x8')][_0x62b4('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x62b4('0xa')](',\x20');logger[_0x62b4('0xb')](config['encrypt'][_0x62b4('0x9')],_0x62b4('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2a68e1){return AES_SUPPORTED_RX[_0x62b4('0xd')](_0x2a68e1);}function getSupportedCiphers(){return crypto[_0x62b4('0xe')]()[_0x62b4('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x56780b){return getSupportedCiphers()[_0x62b4('0x10')](_0x56780b)>-0x1;}function combineOptions(_0x1acc0c){var _0x988a75={};for(var _0xdaddee in fileOptions){if(fileOptions[_0x62b4('0x11')](_0xdaddee)){_0x988a75[_0xdaddee]=fileOptions[_0xdaddee];}}if(_0x1acc0c){for(var _0x409c53 in _0x1acc0c){if(_0x1acc0c[_0x62b4('0x11')](_0x409c53)){_0x988a75[_0x409c53]=_0x1acc0c[_0x409c53];}}}return _0x988a75;}exports[_0x62b4('0x12')]=function(_0x14bd19,_0x36a76a,_0x2b87d2,_0xf7be73){return new BPromise(function(_0x1a274d,_0x5e73e2){_0xf7be73=combineOptions(_0xf7be73);var _0x1fa407=new Buffer(_0x2b87d2);var _0x539c3e=fs[_0x62b4('0x13')](_0x14bd19);var _0x30ab40=fs[_0x62b4('0x14')](_0x36a76a);var _0x114db8=crypto['createCipher'](_0xf7be73['algorithm'],_0x1fa407);_0x539c3e['on'](_0x62b4('0x15'),function(_0x4f52c4){var _0xbfaced=new Buffer(_0x114db8[_0x62b4('0x16')](_0x4f52c4),_0x62b4('0x17'));_0x30ab40['write'](_0xbfaced);});_0x539c3e['on']('end',function(){try{var _0x3a211e=new Buffer(_0x114db8['final'](_0x62b4('0x17')),_0x62b4('0x17'));_0x30ab40[_0x62b4('0x18')](_0x3a211e);_0x30ab40[_0x62b4('0x19')]();_0x30ab40['on'](_0x62b4('0x1a'),function(){return _0x1a274d(_0x36a76a);});}catch(_0x56b017){fs[_0x62b4('0x1b')](_0x36a76a);return _0x5e73e2(_0x56b017);}});});};exports[_0x62b4('0x1c')]=function(_0x17d395,_0x13382b,_0x4631b7,_0x2d79f6){return new BPromise(function(_0x3904d3,_0x297f0a){_0x2d79f6=combineOptions(_0x2d79f6);var _0x4f46ff=new Buffer(_0x4631b7);var _0x1bb40f=fs[_0x62b4('0x13')](_0x17d395);var _0xa69623=fs['createWriteStream'](_0x13382b);var _0x819aca=crypto[_0x62b4('0x1d')](_0x2d79f6[_0x62b4('0x9')],_0x4f46ff);_0x1bb40f['on'](_0x62b4('0x15'),function(_0x26e99d){var _0x1c6f23=new Buffer(_0x819aca[_0x62b4('0x16')](_0x26e99d),_0x62b4('0x17'));_0xa69623[_0x62b4('0x18')](_0x1c6f23);});_0x1bb40f['on'](_0x62b4('0x19'),function(){try{var _0x22b98b=new Buffer(_0x819aca['final'](_0x62b4('0x17')),_0x62b4('0x17'));_0xa69623[_0x62b4('0x18')](_0x22b98b);_0xa69623[_0x62b4('0x19')]();_0xa69623['on'](_0x62b4('0x1a'),function(){return _0x3904d3(_0x13382b);});}catch(_0xc773c1){fs['unlink'](_0x13382b);return _0x297f0a(_0xc773c1);}});});};exports[_0x62b4('0x1e')]=function(_0x46e9b3,_0x4e3deb,_0x107947){var _0x1c4972=_0x107947||stringOptions[_0x62b4('0x9')];var _0x42976f=_0x4e3deb||stringOptions['secret'];var _0x51271a=crypto[_0x62b4('0x1f')](_0x1c4972,_0x42976f);var _0x5c8ba1=_0x51271a[_0x62b4('0x16')](_0x46e9b3,_0x62b4('0x20'),_0x62b4('0x21'));_0x5c8ba1+=_0x51271a[_0x62b4('0x22')]('base64');return _0x5c8ba1;};exports[_0x62b4('0x23')]=function(_0x4a8f50,_0xec44b0,_0x633a84){var _0x3e8e4e=_0x633a84||stringOptions[_0x62b4('0x9')];var _0x59ecc5=_0xec44b0||stringOptions[_0x62b4('0x24')];var _0x4a6268=crypto['createDecipher'](_0x3e8e4e,_0x59ecc5);var _0x17ff6f=_0x4a6268[_0x62b4('0x16')](_0x4a8f50,_0x62b4('0x21'),_0x62b4('0x20'));_0x17ff6f+=_0x4a6268['final'](_0x62b4('0x20'));return _0x17ff6f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7c1578a..6832f77 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 _0x812e=['finally','exit','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','length','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x2d695a,_0x46c842){var _0x57e4ca=function(_0x291104){while(--_0x291104){_0x2d695a['push'](_0x2d695a['shift']());}};_0x57e4ca(++_0x46c842);}(_0x812e,0xce));var _0xe812=function(_0x35bc97,_0x59e26b){_0x35bc97=_0x35bc97-0x0;var _0x31f525=_0x812e[_0x35bc97];return _0x31f525;};'use strict';var util=require(_0xe812('0x0'));var path=require(_0xe812('0x1'));var _=require('lodash');var csv=require(_0xe812('0x2'));var fs=require('fs');var BPromise=require(_0xe812('0x3'));var zipdir=require(_0xe812('0x4'));var rimraf=require('rimraf');var db=require(_0xe812('0x5'))['db'];var dbH=require(_0xe812('0x5'))[_0xe812('0x6')];var logger=require(_0xe812('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe812('0x8')][0x2]);var QUERY=process[_0xe812('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x226c37,_0x57fd3e){var _0x2c4ab7={'status':_0x226c37};var _0x38d4b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57fd3e){_0x2c4ab7['savename']=_0x57fd3e;}return db[_0xe812('0x9')][_0xe812('0xa')](_0x2c4ab7,_0x38d4b7);}function main(){var _0x445bd5=0x1388;var _0x425efd;logger['info'](util['format'](_0xe812('0xb'),EXTRACTED_REPORT_ID,_0xe812('0xc')));return db[_0xe812('0xd')][_0xe812('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe812('0xf')]})[_0xe812('0x10')](function(_0x562ac2){if(_0x562ac2){_0x425efd=_0x562ac2;_0x445bd5=_0x425efd[_0xe812('0xf')]||0x1388;}})['then'](function(){return dbH[_0xe812('0x11')]['query'](util[_0xe812('0x12')](_0xe812('0x13'),QUERY),{'type':dbH['sequelize'][_0xe812('0x14')]['SELECT']});})[_0xe812('0x10')](function(_0x52561f){if(!_0x52561f[0x0][_0xe812('0x15')]){return analyticExtractedReport(_0xe812('0x16'));}var _0x3df185=[];var _0x192fc9=0x0;if(_0x425efd[_0xe812('0x17')]){if(_0x52561f&&_0x52561f['length']){var _0x1015c6=_[_0xe812('0x18')](_0x52561f[0x0]['num']/_0x445bd5);var _0x21066a=Number[_0xe812('0x19')](_0x52561f[0x0]['num']/_0x445bd5)?_0x52561f[0x0][_0xe812('0x15')]%_0x445bd5:0x0;_0x1015c6['forEach'](function(_0x27480e){if(_0x27480e>0x0){_0x192fc9+=_0x445bd5;}_0x3df185[_0xe812('0x1a')](dbH[_0xe812('0x11')][_0xe812('0x1b')](util['format'](_0xe812('0x1c'),QUERY,_0x445bd5,_0x192fc9),{'type':dbH[_0xe812('0x11')]['QueryTypes']['SELECT']}));});if(_0x21066a>0x0){_0x192fc9+=_0x445bd5;_0x3df185[_0xe812('0x1a')](dbH[_0xe812('0x11')]['query'](util[_0xe812('0x12')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x21066a,_0x192fc9),{'type':dbH[_0xe812('0x11')][_0xe812('0x14')][_0xe812('0x1d')]}));}}}else{_0x3df185[_0xe812('0x1a')](dbH[_0xe812('0x11')]['query'](QUERY,{'type':dbH[_0xe812('0x11')][_0xe812('0x14')][_0xe812('0x1d')]}));}var _0x3aea20=path[_0xe812('0x1e')](PATH);var _0x596678=path[_0xe812('0x1f')](PATH,_0xe812('0x20'));var _0x1da980=_0x425efd['split']&&_0x3df185[_0xe812('0x21')]>0x1;var _0x7750f4=[];if(!fs['existsSync'](path[_0xe812('0x22')](_0x3aea20,_0x596678))&&_0x1da980){fs[_0xe812('0x23')](path[_0xe812('0x22')](_0x3aea20,_0x596678));}return BPromise[_0xe812('0x24')](_0x3df185,function(_0x45fac6){_0x7750f4['push'](_0x45fac6);})['then'](function(){for(var _0xd133b6=0x0;_0xd133b6<_0x7750f4['length'];_0xd133b6+=0x1){var _0x568179;var _0x402889=_0x7750f4[_0xd133b6];if(_0x1da980){_0x568179=path['join'](_0x3aea20,_0x596678,util[_0xe812('0x12')](_0xe812('0x25'),_0x596678,_0xd133b6,'csv'));}else{_0x568179=path[_0xe812('0x22')](_0x3aea20,util[_0xe812('0x12')](_0xe812('0x26'),_0x596678,_0xe812('0x27')));}fs[_0xe812('0x28')](_0x568179,csv(_0x402889));}})['then'](function(){if(_0x1da980){return new Promise(function(_0xf6fd62){zipdir(path[_0xe812('0x22')](_0x3aea20,_0x596678),{'saveTo':path['join'](_0x3aea20,util[_0xe812('0x12')](_0xe812('0x26'),_0x596678,_0xe812('0x29')))},function(_0x4f73ee,_0x1fc798){rimraf(path['join'](_0x3aea20,_0x596678),function(){});_0xf6fd62(_0xe812('0x2a'));});});}})[_0xe812('0x10')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe812('0xc')));return analyticExtractedReport(_0xe812('0x2b'),_0x1da980?util[_0xe812('0x12')]('%s.%s',_0x596678,_0x1da980?'zip':_0xe812('0x27')):null);});})[_0xe812('0x2c')](function(_0x56d00b){logger[_0xe812('0x2d')](util[_0xe812('0x12')](_0xe812('0x2e'),EXTRACTED_REPORT_ID,_0xe812('0xc')),util[_0xe812('0x2f')](_0x56d00b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe812('0x30'));})[_0xe812('0x31')](function(){process[_0xe812('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1121=['Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','forEach','push','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3f3daa,_0x35ac72){var _0x3ae81d=function(_0xb8bb6f){while(--_0xb8bb6f){_0x3f3daa['push'](_0x3f3daa['shift']());}};_0x3ae81d(++_0x35ac72);}(_0x1121,0x116));var _0x1112=function(_0x70493e,_0x37fd86){_0x70493e=_0x70493e-0x0;var _0x356182=_0x1121[_0x70493e];return _0x356182;};'use strict';var util=require(_0x1112('0x0'));var path=require(_0x1112('0x1'));var _=require(_0x1112('0x2'));var csv=require(_0x1112('0x3'));var fs=require('fs');var BPromise=require(_0x1112('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1112('0x5'));var db=require(_0x1112('0x6'))['db'];var dbH=require(_0x1112('0x6'))['dbH'];var logger=require(_0x1112('0x7'))(_0x1112('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1112('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4478cc,_0x56bdf4){var _0x3b7e4b={'status':_0x4478cc};var _0x2da575={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56bdf4){_0x3b7e4b[_0x1112('0xa')]=_0x56bdf4;}return db['AnalyticExtractedReport'][_0x1112('0xb')](_0x3b7e4b,_0x2da575);}function main(){var _0x4fa544=0x1388;var _0x198123;logger['info'](util[_0x1112('0xc')](_0x1112('0xd'),EXTRACTED_REPORT_ID,_0x1112('0xe')));return db['Setting'][_0x1112('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1112('0x10'),_0x1112('0x11')]})[_0x1112('0x12')](function(_0x576e66){if(_0x576e66){_0x198123=_0x576e66;_0x4fa544=_0x198123[_0x1112('0x11')]||0x1388;}})['then'](function(){return dbH[_0x1112('0x13')][_0x1112('0x14')](util[_0x1112('0xc')](_0x1112('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x1112('0x12')](function(_0x1fcb35){if(!_0x1fcb35[0x0][_0x1112('0x16')]){return analyticExtractedReport(_0x1112('0x17'));}var _0x3a426a=[];var _0x79b23f=0x0;if(_0x198123[_0x1112('0x10')]){if(_0x1fcb35&&_0x1fcb35[_0x1112('0x18')]){var _0x349be6=_[_0x1112('0x19')](_0x1fcb35[0x0][_0x1112('0x16')]/_0x4fa544);var _0x1df03d=Number[_0x1112('0x1a')](_0x1fcb35[0x0][_0x1112('0x16')]/_0x4fa544)?_0x1fcb35[0x0][_0x1112('0x16')]%_0x4fa544:0x0;_0x349be6[_0x1112('0x1b')](function(_0x38506e){if(_0x38506e>0x0){_0x79b23f+=_0x4fa544;}_0x3a426a[_0x1112('0x1c')](dbH[_0x1112('0x13')][_0x1112('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4fa544,_0x79b23f),{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')][_0x1112('0x1e')]}));});if(_0x1df03d>0x0){_0x79b23f+=_0x4fa544;_0x3a426a[_0x1112('0x1c')](dbH['sequelize'][_0x1112('0x14')](util[_0x1112('0xc')](_0x1112('0x1f'),QUERY,_0x1df03d,_0x79b23f),{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')]['SELECT']}));}}}else{_0x3a426a[_0x1112('0x1c')](dbH[_0x1112('0x13')][_0x1112('0x14')](QUERY,{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')][_0x1112('0x1e')]}));}var _0x37886e=path[_0x1112('0x20')](PATH);var _0x289cbe=path[_0x1112('0x21')](PATH,'.csv');var _0x1e7a06=_0x198123['split']&&_0x3a426a[_0x1112('0x18')]>0x1;var _0x391f57=[];if(!fs[_0x1112('0x22')](path[_0x1112('0x23')](_0x37886e,_0x289cbe))&&_0x1e7a06){fs[_0x1112('0x24')](path[_0x1112('0x23')](_0x37886e,_0x289cbe));}return BPromise['each'](_0x3a426a,function(_0x105ef9){_0x391f57['push'](_0x105ef9);})[_0x1112('0x12')](function(){for(var _0x4f6b6a=0x0;_0x4f6b6a<_0x391f57['length'];_0x4f6b6a+=0x1){var _0x1dfda7;var _0x3801f3=_0x391f57[_0x4f6b6a];if(_0x1e7a06){_0x1dfda7=path[_0x1112('0x23')](_0x37886e,_0x289cbe,util['format'](_0x1112('0x25'),_0x289cbe,_0x4f6b6a,_0x1112('0x26')));}else{_0x1dfda7=path['join'](_0x37886e,util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1112('0x26')));}fs['writeFileSync'](_0x1dfda7,csv(_0x3801f3));}})[_0x1112('0x12')](function(){if(_0x1e7a06){return new Promise(function(_0x38b5fe){zipdir(path[_0x1112('0x23')](_0x37886e,_0x289cbe),{'saveTo':path['join'](_0x37886e,util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1112('0x28')))},function(_0x18b113,_0x30881a){rimraf(path['join'](_0x37886e,_0x289cbe),function(){});_0x38b5fe(_0x1112('0x29'));});});}})[_0x1112('0x12')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1e7a06?util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1e7a06?_0x1112('0x28'):_0x1112('0x26')):null);});})['catch'](function(_0x3490e6){logger[_0x1112('0x2a')](util['format'](_0x1112('0x2b'),EXTRACTED_REPORT_ID,_0x1112('0xe')),util['inspect'](_0x3490e6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1112('0x2c'));})[_0x1112('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 3ef3994..ccbe021 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 _0xdb2e=['analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','auto','body','push','concat','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','length','header','pageBreak','before','margin','landscape','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','forEach','sequelize','query','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','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','footer','createWriteStream','finish','error','end','createPdfFromHTML','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0xdb2e,0x1bf));var _0xedb2=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0xdb2e[_0x2f6541];return _0x4d76d8;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xedb2('0x0'));var moment=require('moment');var htmlToPdfmake=require(_0xedb2('0x1'));var PdfPrinter=require(_0xedb2('0x2'));var zipdir=require(_0xedb2('0x3'));var rimraf=require(_0xedb2('0x4'));var JSDOM=require(_0xedb2('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0xedb2('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xedb2('0x7'))['dbH'];var logger=require('../../config/logger')(_0xedb2('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xedb2('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xedb2('0x9')][0x4];var NAME=process[_0xedb2('0x9')][0x5];var FORMAT=_0xedb2('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x178b19,_0x1ba4d6){var _0x300b0c={'status':_0x178b19};var _0x33d621={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ba4d6){_0x300b0c[_0xedb2('0xb')]=_0x1ba4d6;}return db[_0xedb2('0xc')][_0xedb2('0xd')](_0x300b0c,_0x33d621);}function getHeaders(_0x225810){return _[_0xedb2('0xe')](_0x225810,function(_0x43e9b7){return{'text':_0x43e9b7,'style':_0xedb2('0xf')};});}function getRows(_0x58d393,_0x551e66){return _[_0xedb2('0xe')](_0x551e66,function(_0x2157a5){return _(_0x2157a5)['pick'](_0x58d393)[_0xedb2('0xe')](function(_0x546140){return _0x546140?_[_0xedb2('0x10')](_0x546140):'';})['value']();});}function createTable(_0x2ca6bf,_0x48d2f5){var _0x5d6fc1={'widths':_[_0xedb2('0x11')](Array(_0x2ca6bf['length']),0x91),'heights':function(_0x20ba85){return _0x20ba85===0x0?_0xedb2('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4cb2e5=getHeaders(_0x2ca6bf);_0x5d6fc1[_0xedb2('0x13')][_0xedb2('0x14')](_0x4cb2e5);var _0x20f071=getRows(_0x2ca6bf,_0x48d2f5);_0x5d6fc1[_0xedb2('0x13')]=_0x5d6fc1[_0xedb2('0x13')][_0xedb2('0x15')](_0x20f071);return _0x5d6fc1;}function createTables(_0xb4c1b0){var _0x43e25e=[];var _0x2e2d6b=_[_0xedb2('0x16')](Object[_0xedb2('0x17')](_0xb4c1b0[0x0]),0x5);_0x2e2d6b['forEach'](function(_0x383915){_0x43e25e[_0xedb2('0x14')](createTable(_0x383915,_0xb4c1b0));});return _0x43e25e;}function getPDFDocDefinition(_0x121d64){var _0x30a6e9=util['format'](_0xedb2('0x18'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xedb2('0x19')])[_0xedb2('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xedb2('0x1b')])[_0xedb2('0x1a')](FORMAT));var _0x5c6529=[];for(var _0x13f9a5=0x0;_0x13f9a5<_0x121d64[_0xedb2('0x1c')];_0x13f9a5++){var _0x590584=[];if(_0x13f9a5===0x0){_0x590584[_0xedb2('0x14')]({'text':_0x30a6e9,'style':_0xedb2('0x1d')});}var _0x4dfe09={'table':_0x121d64[_0x13f9a5]};if(_0x13f9a5>0x0){_0x4dfe09[_0xedb2('0x1e')]=_0xedb2('0x1f');_0x4dfe09[_0xedb2('0x20')]=[0x0,0x46,0x0,0x0];}_0x590584[_0xedb2('0x14')](_0x4dfe09);_0x5c6529['push'](_0x590584);}return{'pageSize':'A4','pageOrientation':_0xedb2('0x21'),'content':_0x5c6529,'footer':function(_0x2824de,_0x1b2050){return{'text':_0x2824de[_0xedb2('0x10')]()+'\x20/\x20'+_0x1b2050,'style':'footer'};},'defaultStyle':{'font':_0xedb2('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xedb2('0x23')},'footer':{'alignment':_0xedb2('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x38cd68){var _0xa8357b=0x1388;var _0x1ecc5e;if(!_0x38cd68[0x0][_0xedb2('0x25')]){return analyticExtractedReport(_0xedb2('0x26'));}return db[_0xedb2('0x27')][_0xedb2('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xedb2('0x29')]})['then'](function(_0xba4745){if(_0xba4745){_0x1ecc5e=_0xba4745;_0xa8357b=_0x1ecc5e[_0xedb2('0x29')]||0x3e8;}})[_0xedb2('0x2a')](function(){var _0x127080=[];var _0x3cfccb=0x0;if(_0x1ecc5e[_0xedb2('0x2b')]){if(_0x38cd68&&_0x38cd68['length']){var _0x2df33c=_[_0xedb2('0x2c')](_0x38cd68[0x0][_0xedb2('0x25')]/_0xa8357b);var _0x21d0e4=Number['isInteger'](_0x38cd68[0x0][_0xedb2('0x25')]/_0xa8357b)?_0x38cd68[0x0][_0xedb2('0x25')]%_0xa8357b:0x0;_0x2df33c[_0xedb2('0x2d')](function(_0x47ca60){if(_0x47ca60>0x0){_0x3cfccb+=_0xa8357b;}_0x127080[_0xedb2('0x14')](dbH[_0xedb2('0x2e')][_0xedb2('0x2f')](util[_0xedb2('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa8357b,_0x3cfccb),{'type':dbH[_0xedb2('0x2e')][_0xedb2('0x30')]['SELECT']}));});if(_0x21d0e4>0x0){_0x3cfccb+=_0xa8357b;_0x127080[_0xedb2('0x14')](dbH[_0xedb2('0x2e')]['query'](util[_0xedb2('0x1a')](_0xedb2('0x31'),QUERY,_0x21d0e4,_0x3cfccb),{'type':dbH[_0xedb2('0x2e')][_0xedb2('0x30')][_0xedb2('0x32')]}));}}}else{_0x127080['push'](dbH[_0xedb2('0x2e')]['query'](QUERY,{'type':dbH['sequelize'][_0xedb2('0x30')][_0xedb2('0x32')]}));}var _0x1c64c1=path[_0xedb2('0x33')](PATH);var _0x4bf237=path['basename'](PATH,_0xedb2('0x34'));var _0x357f11=_0x1ecc5e['split']&&_0x127080[_0xedb2('0x1c')]>0x1;var _0x5853dd=[];if(!fs[_0xedb2('0x35')](path[_0xedb2('0x36')](_0x1c64c1,_0x4bf237))&&_0x357f11){fs[_0xedb2('0x37')](path[_0xedb2('0x36')](_0x1c64c1,_0x4bf237));}return BPromise['each'](_0x127080,function(_0x30cd50){_0x5853dd[_0xedb2('0x14')](_0x30cd50);})[_0xedb2('0x2a')](function(){var _0x39356e=[];for(var _0x2f8788=0x0;_0x2f8788<_0x5853dd[_0xedb2('0x1c')];_0x2f8788+=0x1){var _0x5ab76d=_0x5853dd[_0x2f8788];var _0x4d3855=createTables(_[_0xedb2('0x38')](_0x5ab76d));var _0x5c3875;var _0x5d59a8=getPDFDocDefinition(_0x4d3855);var _0x22598f=getPDFPrinter();var _0x56af3f=_0x22598f[_0xedb2('0x39')](_0x5d59a8);if(_0x357f11){_0x5c3875=path['join'](_0x1c64c1,_0x4bf237,util['format'](_0xedb2('0x3a'),_0x4bf237,_0x2f8788,_0xedb2('0x3b')));}else{_0x5c3875=path[_0xedb2('0x36')](_0x1c64c1,util[_0xedb2('0x1a')](_0xedb2('0x3c'),_0x4bf237,_0xedb2('0x3b')));}_0x39356e['push'](writePDFDocument(_0x56af3f,_0x5c3875));}return Promise[_0xedb2('0x3d')](_0x39356e);})[_0xedb2('0x2a')](function(){if(_0x357f11){return new Promise(function(_0x4934a4){zipdir(path['join'](_0x1c64c1,_0x4bf237),{'saveTo':path[_0xedb2('0x36')](_0x1c64c1,util[_0xedb2('0x1a')](_0xedb2('0x3c'),_0x4bf237,_0xedb2('0x3e')))},function(){rimraf(path[_0xedb2('0x36')](_0x1c64c1,_0x4bf237),function(){});_0x4934a4(_0xedb2('0x3f'));});});}})['then'](function(){if(!_0x357f11)return;rimraf(path[_0xedb2('0x36')](_0x1c64c1,_0x4bf237),function(){});})[_0xedb2('0x2a')](function(){logger[_0xedb2('0x40')](util[_0xedb2('0x1a')](_0xedb2('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xedb2('0x42'),_0x357f11?util[_0xedb2('0x1a')](_0xedb2('0x3c'),_0x4bf237,_0x357f11?_0xedb2('0x3e'):_0xedb2('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xedb2('0x40')](util[_0xedb2('0x1a')](_0xedb2('0x43'),EXTRACTED_REPORT_ID,_0xedb2('0x44')));return db[_0xedb2('0xc')][_0xedb2('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xedb2('0x2a')](function(_0x121ce8){EXTRACTED_REPORT=_0x121ce8;return dbH['sequelize'][_0xedb2('0x2f')](util[_0xedb2('0x1a')](_0xedb2('0x46'),QUERY),{'type':dbH[_0xedb2('0x2e')][_0xedb2('0x30')][_0xedb2('0x32')]});})[_0xedb2('0x2a')](extractReport)[_0xedb2('0x47')](function(_0x393bf2){logger[_0xedb2('0x40')](util[_0xedb2('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xedb2('0x44')),util[_0xedb2('0x48')](_0x393bf2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xedb2('0x49'));})[_0xedb2('0x4a')](function(){process[_0xedb2('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x18d113=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xedb2('0x4c'),'italics':__dirname+_0xedb2('0x4d'),'bolditalics':__dirname+_0xedb2('0x4e')}});return _0x18d113;}function getPDFDocDefinitionFromHTML(_0x4d7b0b,_0x3af2d4){var _0x2be0b0=util[_0xedb2('0x1a')](_0xedb2('0x4f'),_0x3af2d4[_0xedb2('0x50')],_0x3af2d4[_0xedb2('0x51')]);var _0x406e6a=moment()[_0xedb2('0x1a')]('YYYY-MM-DD')[_0xedb2('0x10')]();var _0x4adcf7=htmlToPdfmake(_0x4d7b0b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4adcf7],'defaultStyle':{'font':_0xedb2('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xedb2('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xedb2('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xedb2('0x52')}},'header':function(){return[{'text':_0xedb2('0x53'),'style':'header'}];},'footer':function(_0x4ebbf9,_0x3fbf56){return[{'text':util[_0xedb2('0x1a')](_0xedb2('0x54'),_0x2be0b0,_0x4ebbf9,_0x3fbf56,_0x406e6a),'style':_0xedb2('0x55')}];}};}function writePDFDocument(_0x193545,_0x3b6f87){return new Promise(function(_0x4a6493,_0x5e8243){var _0x4be526=_0x193545['pipe'](fs[_0xedb2('0x56')](_0x3b6f87));_0x4be526['on'](_0xedb2('0x57'),function(){_0x4a6493('finish');});_0x4be526['on'](_0xedb2('0x58'),function(_0x223a71){_0x5e8243(_0x223a71);});_0x193545[_0xedb2('0x59')]();});}exports[_0xedb2('0x5a')]=function(_0x1083b9,_0x286bdc){var _0x1ef1e9=getPDFPrinter();var _0x5da60b=getPDFDocDefinitionFromHTML(_0x1083b9,_0x286bdc);var _0x3c8d07=_0x1ef1e9[_0xedb2('0x39')](_0x5da60b);return writePDFDocument(_0x3c8d07,_0x286bdc['path'])[_0xedb2('0x47')](function(_0x3ef6d3){throw _0x3ef6d3;});}; \ No newline at end of file +var _0xc4fe=['keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','length','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','Empty','Setting','find','split','splitSizePdf','then','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','catch','lodash','util','moment','pdfmake/src/printer','zip-dir','rimraf','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','auto','push','body','chunk'];(function(_0x18db7b,_0xf8828c){var _0x1d5d9b=function(_0x2bd697){while(--_0x2bd697){_0x18db7b['push'](_0x18db7b['shift']());}};_0x1d5d9b(++_0xf8828c);}(_0xc4fe,0x140));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec4f('0x0'));var fs=require('fs');var util=require(_0xec4f('0x1'));var path=require('path');var moment=require(_0xec4f('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xec4f('0x3'));var zipdir=require(_0xec4f('0x4'));var rimraf=require(_0xec4f('0x5'));var JSDOM=require('jsdom')[_0xec4f('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xec4f('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xec4f('0x8'))[_0xec4f('0x9')];var logger=require('../../config/logger')(_0xec4f('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xec4f('0xb')][0x2]);var QUERY=process[_0xec4f('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xec4f('0xb')][0x5];var FORMAT=_0xec4f('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x7457dc,_0x5324f8){var _0x33fb78={'status':_0x7457dc};var _0x51c30e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5324f8){_0x33fb78[_0xec4f('0xd')]=_0x5324f8;}return db[_0xec4f('0xe')][_0xec4f('0xf')](_0x33fb78,_0x51c30e);}function getHeaders(_0x5cda74){return _['map'](_0x5cda74,function(_0x4a0fe8){return{'text':_0x4a0fe8,'style':_0xec4f('0x10')};});}function getRows(_0x1ca7a1,_0x5b992a){return _[_0xec4f('0x11')](_0x5b992a,function(_0xc74a01){return _(_0xc74a01)['pick'](_0x1ca7a1)['map'](function(_0x335fa0){return _0x335fa0?_[_0xec4f('0x12')](_0x335fa0):'';})[_0xec4f('0x13')]();});}function createTable(_0x24e2d1,_0x3f60b4){var _0x2016e6={'widths':_['fill'](Array(_0x24e2d1['length']),0x91),'heights':function(_0x352bf6){return _0x352bf6===0x0?_0xec4f('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x43d9e2=getHeaders(_0x24e2d1);_0x2016e6['body'][_0xec4f('0x15')](_0x43d9e2);var _0x4b5c28=getRows(_0x24e2d1,_0x3f60b4);_0x2016e6['body']=_0x2016e6[_0xec4f('0x16')]['concat'](_0x4b5c28);return _0x2016e6;}function createTables(_0x3282dc){var _0x587fbf=[];var _0x1a06cd=_[_0xec4f('0x17')](Object[_0xec4f('0x18')](_0x3282dc[0x0]),0x5);_0x1a06cd[_0xec4f('0x19')](function(_0x3701d5){_0x587fbf[_0xec4f('0x15')](createTable(_0x3701d5,_0x3282dc));});return _0x587fbf;}function getPDFDocDefinition(_0x2bd276){var _0x3fbf2c=util[_0xec4f('0x1a')](_0xec4f('0x1b'),NAME,EXTRACTED_REPORT[_0xec4f('0x1c')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xec4f('0x1a')](FORMAT));var _0x364631=[];for(var _0x3b1287=0x0;_0x3b1287<_0x2bd276[_0xec4f('0x1d')];_0x3b1287++){var _0xdfe174=[];if(_0x3b1287===0x0){_0xdfe174['push']({'text':_0x3fbf2c,'style':_0xec4f('0x1e')});}var _0x67a9f9={'table':_0x2bd276[_0x3b1287]};if(_0x3b1287>0x0){_0x67a9f9[_0xec4f('0x1f')]='before';_0x67a9f9[_0xec4f('0x20')]=[0x0,0x46,0x0,0x0];}_0xdfe174['push'](_0x67a9f9);_0x364631[_0xec4f('0x15')](_0xdfe174);}return{'pageSize':'A4','pageOrientation':_0xec4f('0x21'),'content':_0x364631,'footer':function(_0x63b789,_0x46b38c){return{'text':_0x63b789[_0xec4f('0x12')]()+_0xec4f('0x22')+_0x46b38c,'style':_0xec4f('0x23')};},'defaultStyle':{'font':_0xec4f('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xec4f('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x446775){var _0x597192=0x1388;var _0x460655;if(!_0x446775[0x0]['num']){return analyticExtractedReport(_0xec4f('0x26'));}return db[_0xec4f('0x27')][_0xec4f('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec4f('0x29'),_0xec4f('0x2a')]})['then'](function(_0x302ee6){if(_0x302ee6){_0x460655=_0x302ee6;_0x597192=_0x460655[_0xec4f('0x2a')]||0x3e8;}})[_0xec4f('0x2b')](function(){var _0x22123a=[];var _0xad2dca=0x0;if(_0x460655[_0xec4f('0x29')]){if(_0x446775&&_0x446775[_0xec4f('0x1d')]){var _0x3a491c=_['range'](_0x446775[0x0][_0xec4f('0x2c')]/_0x597192);var _0x2d9fc8=Number['isInteger'](_0x446775[0x0][_0xec4f('0x2c')]/_0x597192)?_0x446775[0x0][_0xec4f('0x2c')]%_0x597192:0x0;_0x3a491c[_0xec4f('0x19')](function(_0x45c923){if(_0x45c923>0x0){_0xad2dca+=_0x597192;}_0x22123a['push'](dbH[_0xec4f('0x2d')][_0xec4f('0x2e')](util[_0xec4f('0x1a')](_0xec4f('0x2f'),QUERY,_0x597192,_0xad2dca),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));});if(_0x2d9fc8>0x0){_0xad2dca+=_0x597192;_0x22123a['push'](dbH['sequelize'][_0xec4f('0x2e')](util[_0xec4f('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2d9fc8,_0xad2dca),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));}}}else{_0x22123a[_0xec4f('0x15')](dbH[_0xec4f('0x2d')]['query'](QUERY,{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));}var _0x21e7ef=path['dirname'](PATH);var _0x76d3bb=path['basename'](PATH,_0xec4f('0x32'));var _0x5f518a=_0x460655['split']&&_0x22123a[_0xec4f('0x1d')]>0x1;var _0x3a923f=[];if(!fs['existsSync'](path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb))&&_0x5f518a){fs[_0xec4f('0x34')](path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb));}return BPromise['each'](_0x22123a,function(_0x4b366b){_0x3a923f['push'](_0x4b366b);})[_0xec4f('0x2b')](function(){var _0x4af5ce=[];for(var _0x33dad4=0x0;_0x33dad4<_0x3a923f[_0xec4f('0x1d')];_0x33dad4+=0x1){var _0xe7e94e=_0x3a923f[_0x33dad4];var _0x39f8ef=createTables(_[_0xec4f('0x35')](_0xe7e94e));var _0x5e4f4e;var _0x3b3c04=getPDFDocDefinition(_0x39f8ef);var _0x273b6f=getPDFPrinter();var _0x5af2e2=_0x273b6f[_0xec4f('0x36')](_0x3b3c04);if(_0x5f518a){_0x5e4f4e=path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb,util['format'](_0xec4f('0x37'),_0x76d3bb,_0x33dad4,_0xec4f('0x38')));}else{_0x5e4f4e=path['join'](_0x21e7ef,util[_0xec4f('0x1a')](_0xec4f('0x39'),_0x76d3bb,'pdf'));}_0x4af5ce['push'](writePDFDocument(_0x5af2e2,_0x5e4f4e));}return Promise[_0xec4f('0x3a')](_0x4af5ce);})['then'](function(){if(_0x5f518a){return new Promise(function(_0x14a611){zipdir(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),{'saveTo':path[_0xec4f('0x33')](_0x21e7ef,util['format']('%s.%s',_0x76d3bb,'zip'))},function(){rimraf(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),function(){});_0x14a611(_0xec4f('0x3b'));});});}})[_0xec4f('0x2b')](function(){if(!_0x5f518a)return;rimraf(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),function(){});})[_0xec4f('0x2b')](function(){logger[_0xec4f('0x3c')](util[_0xec4f('0x1a')](_0xec4f('0x3d'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')));return analyticExtractedReport(_0xec4f('0x3f'),_0x5f518a?util[_0xec4f('0x1a')]('%s.%s',_0x76d3bb,_0x5f518a?_0xec4f('0x40'):_0xec4f('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xec4f('0x41'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')));return db[_0xec4f('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xec4f('0x2b')](function(_0x203cef){EXTRACTED_REPORT=_0x203cef;return dbH['sequelize']['query'](util['format'](_0xec4f('0x42'),QUERY),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]});})[_0xec4f('0x2b')](extractReport)['catch'](function(_0x4f1f12){logger[_0xec4f('0x3c')](util['format'](_0xec4f('0x43'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')),util[_0xec4f('0x44')](_0x4f1f12,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xec4f('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x23e3e7=new PdfPrinter({'Arial':{'normal':__dirname+_0xec4f('0x46'),'bold':__dirname+_0xec4f('0x47'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xec4f('0x48')}});return _0x23e3e7;}function getPDFDocDefinitionFromHTML(_0x5caf87,_0x2f466b){var _0x21f319=util[_0xec4f('0x1a')]('%s\x20#%d',_0x2f466b[_0xec4f('0x49')],_0x2f466b[_0xec4f('0x4a')]);var _0x42ab20=moment()['format']('YYYY-MM-DD')[_0xec4f('0x12')]();var _0x1a9e33=htmlToPdfmake(_0x5caf87,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1a9e33],'defaultStyle':{'font':_0xec4f('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xec4f('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xec4f('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xec4f('0x4b')}},'header':function(){return[{'text':_0xec4f('0x4c'),'style':'header'}];},'footer':function(_0x4e16ba,_0x4053d2){return[{'text':util[_0xec4f('0x1a')](_0xec4f('0x4d'),_0x21f319,_0x4e16ba,_0x4053d2,_0x42ab20),'style':_0xec4f('0x23')}];}};}function writePDFDocument(_0x2a708d,_0x5458eb){return new Promise(function(_0x5af838,_0x1a3c15){var _0x592af7=_0x2a708d[_0xec4f('0x4e')](fs[_0xec4f('0x4f')](_0x5458eb));_0x592af7['on']('finish',function(){_0x5af838(_0xec4f('0x50'));});_0x592af7['on'](_0xec4f('0x51'),function(_0x1a0fd2){_0x1a3c15(_0x1a0fd2);});_0x2a708d[_0xec4f('0x52')]();});}exports[_0xec4f('0x53')]=function(_0x36f257,_0x3235d2){var _0x208f3a=getPDFPrinter();var _0x30065e=getPDFDocDefinitionFromHTML(_0x36f257,_0x3235d2);var _0x1960e1=_0x208f3a[_0xec4f('0x36')](_0x30065e);return writePDFDocument(_0x1960e1,_0x3235d2[_0xec4f('0x54')])[_0xec4f('0x55')](function(_0x8224f5){throw _0x8224f5;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 5b57e99..fafc6e7 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 _0x33a5=['Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','range','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0x33a5,0x125));var _0x533a=function(_0x4bd199,_0x43b3a5){_0x4bd199=_0x4bd199-0x0;var _0x362d9e=_0x33a5[_0x4bd199];return _0x362d9e;};'use strict';var util=require(_0x533a('0x0'));var path=require(_0x533a('0x1'));var _=require(_0x533a('0x2'));var fs=require('fs');var json2xls=require(_0x533a('0x3'));var BPromise=require(_0x533a('0x4'));var zipdir=require(_0x533a('0x5'));var rimraf=require(_0x533a('0x6'));var db=require(_0x533a('0x7'))['db'];var dbH=require(_0x533a('0x7'))[_0x533a('0x8')];var logger=require(_0x533a('0x9'))(_0x533a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x533a('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x533a('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x159a80,_0x3afe7f){var _0x4d3c5d={'status':_0x159a80};var _0x545b92={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3afe7f){_0x4d3c5d[_0x533a('0xc')]=_0x3afe7f;}return db[_0x533a('0xd')][_0x533a('0xe')](_0x4d3c5d,_0x545b92);}function main(){var _0x47a3cd=0x1388;var _0x37ea88;logger[_0x533a('0xf')](util[_0x533a('0x10')](_0x533a('0x11'),EXTRACTED_REPORT_ID,_0x533a('0x12')));return db[_0x533a('0x13')][_0x533a('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x533a('0x15'),_0x533a('0x16')]})[_0x533a('0x17')](function(_0x4cac95){if(_0x4cac95){_0x37ea88=_0x4cac95;_0x47a3cd=_0x37ea88[_0x533a('0x16')]||0x1388;}})['then'](function(){return dbH[_0x533a('0x18')]['query'](util[_0x533a('0x10')](_0x533a('0x19'),QUERY),{'type':dbH[_0x533a('0x18')][_0x533a('0x1a')]['SELECT']});})['then'](function(_0x17299a){if(!_0x17299a[0x0][_0x533a('0x1b')]){return analyticExtractedReport('Empty');}var _0x333f3e=[];var _0x289c1b=0x0;if(_0x37ea88[_0x533a('0x15')]){if(_0x17299a&&_0x17299a['length']){var _0x2738d4=_[_0x533a('0x1c')](_0x17299a[0x0][_0x533a('0x1b')]/_0x47a3cd);var _0x2cd24d=Number['isInteger'](_0x17299a[0x0][_0x533a('0x1b')]/_0x47a3cd)?_0x17299a[0x0][_0x533a('0x1b')]%_0x47a3cd:0x0;_0x2738d4[_0x533a('0x1d')](function(_0x1af90a){if(_0x1af90a>0x0){_0x289c1b+=_0x47a3cd;}_0x333f3e[_0x533a('0x1e')](dbH['sequelize'][_0x533a('0x1f')](util[_0x533a('0x10')](_0x533a('0x20'),QUERY,_0x47a3cd,_0x289c1b),{'type':dbH[_0x533a('0x18')][_0x533a('0x1a')][_0x533a('0x21')]}));});if(_0x2cd24d>0x0){_0x289c1b+=_0x47a3cd;_0x333f3e[_0x533a('0x1e')](dbH['sequelize'][_0x533a('0x1f')](util[_0x533a('0x10')](_0x533a('0x20'),QUERY,_0x2cd24d,_0x289c1b),{'type':dbH[_0x533a('0x18')][_0x533a('0x1a')][_0x533a('0x21')]}));}}}else{_0x333f3e[_0x533a('0x1e')](dbH[_0x533a('0x18')]['query'](QUERY,{'type':dbH[_0x533a('0x18')][_0x533a('0x1a')]['SELECT']}));}var _0x5ddd59=path[_0x533a('0x22')](PATH);var _0x13a7d9=path[_0x533a('0x23')](PATH,_0x533a('0x24'));var _0x3385fe=_0x37ea88[_0x533a('0x15')]&&_0x333f3e[_0x533a('0x25')]>0x1;var _0x372724=[];if(!fs[_0x533a('0x26')](path[_0x533a('0x27')](_0x5ddd59,_0x13a7d9))&&_0x3385fe){fs[_0x533a('0x28')](path[_0x533a('0x27')](_0x5ddd59,_0x13a7d9));}return BPromise[_0x533a('0x29')](_0x333f3e,function(_0x5aff69){_0x372724[_0x533a('0x1e')](_0x5aff69);})[_0x533a('0x17')](function(){for(var _0x1c5cd2=0x0;_0x1c5cd2<_0x372724[_0x533a('0x25')];_0x1c5cd2+=0x1){var _0x35d958;var _0x572d9f=_0x372724[_0x1c5cd2];if(_0x3385fe){_0x35d958=path['join'](_0x5ddd59,_0x13a7d9,util[_0x533a('0x10')](_0x533a('0x2a'),_0x13a7d9,_0x1c5cd2,_0x533a('0x2b')));}else{_0x35d958=path[_0x533a('0x27')](_0x5ddd59,util[_0x533a('0x10')](_0x533a('0x2c'),_0x13a7d9,_0x533a('0x2b')));}fs['writeFileSync'](_0x35d958,json2xls(_0x572d9f),'binary');}})['then'](function(){if(_0x3385fe){return new Promise(function(_0x257212){zipdir(path[_0x533a('0x27')](_0x5ddd59,_0x13a7d9),{'saveTo':path[_0x533a('0x27')](_0x5ddd59,util[_0x533a('0x10')](_0x533a('0x2c'),_0x13a7d9,_0x533a('0x2d')))},function(_0x13ca77,_0x11433f){rimraf(path['join'](_0x5ddd59,_0x13a7d9),function(){});_0x257212('zip\x20finished');});});}})[_0x533a('0x17')](function(){logger[_0x533a('0xf')](util[_0x533a('0x10')](_0x533a('0x2e'),EXTRACTED_REPORT_ID,_0x533a('0x12')));return analyticExtractedReport(_0x533a('0x2f'),_0x3385fe?util[_0x533a('0x10')](_0x533a('0x2c'),_0x13a7d9,_0x3385fe?'zip':_0x533a('0x2b')):null);});})[_0x533a('0x30')](function(_0x4043ea){logger['info'](util[_0x533a('0x10')](_0x533a('0x31'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x4043ea,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x533a('0x32'));})[_0x533a('0x33')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x89b9=['existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','format','push','dirname','basename','.xlsx'];(function(_0x23f83b,_0x4fd76e){var _0x36a1d3=function(_0x5c15c5){while(--_0x5c15c5){_0x23f83b['push'](_0x23f83b['shift']());}};_0x36a1d3(++_0x4fd76e);}(_0x89b9,0x9e));var _0x989b=function(_0x243bbb,_0x4bbdb4){_0x243bbb=_0x243bbb-0x0;var _0x2548ab=_0x89b9[_0x243bbb];return _0x2548ab;};'use strict';var util=require('util');var path=require(_0x989b('0x0'));var _=require(_0x989b('0x1'));var fs=require('fs');var json2xls=require(_0x989b('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x989b('0x3'))['db'];var dbH=require('../../mysqldb')[_0x989b('0x4')];var logger=require(_0x989b('0x5'))(_0x989b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x989b('0x7')][0x2]);var QUERY=process[_0x989b('0x7')][0x3];var PATH=process[_0x989b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x985822,_0x42f2bf){var _0x6ce2ea={'status':_0x985822};var _0x1ad2c9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42f2bf){_0x6ce2ea[_0x989b('0x8')]=_0x42f2bf;}return db[_0x989b('0x9')][_0x989b('0xa')](_0x6ce2ea,_0x1ad2c9);}function main(){var _0x1aa3d4=0x1388;var _0x52c7fc;logger[_0x989b('0xb')](util['format'](_0x989b('0xc'),EXTRACTED_REPORT_ID,_0x989b('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x989b('0xe'),'splitSizeXlsx']})[_0x989b('0xf')](function(_0x528316){if(_0x528316){_0x52c7fc=_0x528316;_0x1aa3d4=_0x52c7fc[_0x989b('0x10')]||0x1388;}})[_0x989b('0xf')](function(){return dbH[_0x989b('0x11')][_0x989b('0x12')](util['format'](_0x989b('0x13'),QUERY),{'type':dbH['sequelize'][_0x989b('0x14')][_0x989b('0x15')]});})[_0x989b('0xf')](function(_0x5a1d3b){if(!_0x5a1d3b[0x0][_0x989b('0x16')]){return analyticExtractedReport('Empty');}var _0xb0a2cf=[];var _0x14479f=0x0;if(_0x52c7fc[_0x989b('0xe')]){if(_0x5a1d3b&&_0x5a1d3b[_0x989b('0x17')]){var _0x15f60f=_[_0x989b('0x18')](_0x5a1d3b[0x0]['num']/_0x1aa3d4);var _0x4f59bc=Number['isInteger'](_0x5a1d3b[0x0][_0x989b('0x16')]/_0x1aa3d4)?_0x5a1d3b[0x0]['num']%_0x1aa3d4:0x0;_0x15f60f['forEach'](function(_0x13a58f){if(_0x13a58f>0x0){_0x14479f+=_0x1aa3d4;}_0xb0a2cf['push'](dbH[_0x989b('0x11')]['query'](util[_0x989b('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1aa3d4,_0x14479f),{'type':dbH[_0x989b('0x11')][_0x989b('0x14')][_0x989b('0x15')]}));});if(_0x4f59bc>0x0){_0x14479f+=_0x1aa3d4;_0xb0a2cf[_0x989b('0x1a')](dbH[_0x989b('0x11')][_0x989b('0x12')](util[_0x989b('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f59bc,_0x14479f),{'type':dbH[_0x989b('0x11')][_0x989b('0x14')]['SELECT']}));}}}else{_0xb0a2cf[_0x989b('0x1a')](dbH[_0x989b('0x11')]['query'](QUERY,{'type':dbH[_0x989b('0x11')][_0x989b('0x14')]['SELECT']}));}var _0x4e1a0c=path[_0x989b('0x1b')](PATH);var _0x585717=path[_0x989b('0x1c')](PATH,_0x989b('0x1d'));var _0x56843b=_0x52c7fc[_0x989b('0xe')]&&_0xb0a2cf[_0x989b('0x17')]>0x1;var _0x2ee84e=[];if(!fs[_0x989b('0x1e')](path[_0x989b('0x1f')](_0x4e1a0c,_0x585717))&&_0x56843b){fs[_0x989b('0x20')](path[_0x989b('0x1f')](_0x4e1a0c,_0x585717));}return BPromise[_0x989b('0x21')](_0xb0a2cf,function(_0x416ec0){_0x2ee84e[_0x989b('0x1a')](_0x416ec0);})[_0x989b('0xf')](function(){for(var _0x172f5c=0x0;_0x172f5c<_0x2ee84e['length'];_0x172f5c+=0x1){var _0x260d73;var _0x1c52de=_0x2ee84e[_0x172f5c];if(_0x56843b){_0x260d73=path[_0x989b('0x1f')](_0x4e1a0c,_0x585717,util[_0x989b('0x19')](_0x989b('0x22'),_0x585717,_0x172f5c,_0x989b('0x23')));}else{_0x260d73=path['join'](_0x4e1a0c,util[_0x989b('0x19')](_0x989b('0x24'),_0x585717,_0x989b('0x23')));}fs[_0x989b('0x25')](_0x260d73,json2xls(_0x1c52de),'binary');}})[_0x989b('0xf')](function(){if(_0x56843b){return new Promise(function(_0x308f84){zipdir(path['join'](_0x4e1a0c,_0x585717),{'saveTo':path['join'](_0x4e1a0c,util[_0x989b('0x19')]('%s.%s',_0x585717,_0x989b('0x26')))},function(_0x288c66,_0x482807){rimraf(path['join'](_0x4e1a0c,_0x585717),function(){});_0x308f84(_0x989b('0x27'));});});}})['then'](function(){logger[_0x989b('0xb')](util[_0x989b('0x19')](_0x989b('0x28'),EXTRACTED_REPORT_ID,_0x989b('0xd')));return analyticExtractedReport(_0x989b('0x29'),_0x56843b?util[_0x989b('0x19')](_0x989b('0x24'),_0x585717,_0x56843b?_0x989b('0x26'):_0x989b('0x23')):null);});})[_0x989b('0x2a')](function(_0x4347be){logger[_0x989b('0xb')](util[_0x989b('0x19')](_0x989b('0x2b'),EXTRACTED_REPORT_ID,_0x989b('0xd')),util[_0x989b('0x2c')](_0x4347be,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x989b('0x2d'));})[_0x989b('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b7bf305..e7aaf3e 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 _0xa37b=['app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','then','VoiceExtension','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extension','extensions','push','type','Set','format','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','intervals','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer'];(function(_0x510490,_0x247d3d){var _0x584d51=function(_0x2296e4){while(--_0x2296e4){_0x510490['push'](_0x510490['shift']());}};_0x584d51(++_0x247d3d);}(_0xa37b,0x120));var _0xba37=function(_0x5f3f05,_0x35820d){_0x5f3f05=_0x5f3f05-0x0;var _0x198107=_0xa37b[_0x5f3f05];return _0x198107;};'use strict';var _=require(_0xba37('0x0'));var util=require(_0xba37('0x1'));function rewrite(_0x3381d6,_0x6d9f72){var _0x1ad73e=this;return _0x3381d6[_0xba37('0x2')][_0xba37('0x3')]['findAll']({'raw':!![]})[_0xba37('0x4')](function(_0x2ff5a8){_0x1ad73e['intervals']=_0x2ff5a8;return _0x3381d6['models'][_0xba37('0x5')][_0xba37('0x6')]({'where':{'IntervalId':_0x6d9f72['IntervalId']},'raw':!![]});})[_0xba37('0x4')](function(_0x41aa2a){return _0x3381d6[_0xba37('0x2')][_0xba37('0x5')][_0xba37('0x6')]({'where':{'exten':{'$in':_[_0xba37('0x7')](_[_0xba37('0x8')](_0x41aa2a,_0xba37('0x9')))}},'order':[{'raw':_0xba37('0xa')}],'raw':!![]});})[_0xba37('0x4')](function(_0x9a27f){var _0x1d5adb=_[_0xba37('0xb')](_0x9a27f,{'priority':'1'});var _0x49b860=_['filter'](_0x9a27f,{'isApp':0x1});var _0x46c97a=_[_0xba37('0xc')](_0x49b860,_0xba37('0x9'));var _0x451988=['queue',_0xba37('0xd')];var _0x1f8f2d=[];var _0x4e1810=[];for(var _0x51e62e in _0x46c97a){if(_0x46c97a[_0xba37('0xe')](_0x51e62e)){_0x1ad73e[_0xba37('0xf')]=0x2;_0x1ad73e['extensions']=[];_0x1ad73e[_0xba37('0x10')]=_['find'](_0x1d5adb,{'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')]});_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':util[_0xba37('0x15')]('CDR(type)=%s',_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')]),'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0]['VoiceExtensionId']});if(_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')]===_0xba37('0x17')){_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0xba37('0x18')+_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')],'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0]['exten'],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});}else if(_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')]===_0xba37('0x1a')){if(_0x1ad73e[_0xba37('0x10')]){_0x1ad73e['extensions']['push']({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':'CDR(destination)='+(_0x1ad73e[_0xba37('0x10')]['cutdigits']?_0xba37('0x1b')+_0x1ad73e[_0xba37('0x10')]['cutdigits']+'}':_0xba37('0x1c')),'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e['priority']++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});}_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':'CDR(routeid)='+_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')],'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0]['exten'],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});var _0x2bf0b4=_0x1ad73e[_0xba37('0xf')]++;_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':'ExecIf','appdata':_0xba37('0x1d')+(_0x2bf0b4+0x2)+'):Goto('+(_0x2bf0b4+0x1)+')','context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x2bf0b4,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});if(_0x1ad73e[_0xba37('0x10')]){_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0x1ad73e[_0xba37('0x10')][_0xba37('0x1e')]?_0xba37('0x1f')+_0x1ad73e[_0xba37('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});}_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0xba37('0x20')+_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')],'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0]['VoiceExtensionId']});if(_0x1ad73e[_0xba37('0x10')]&&_0x1ad73e[_0xba37('0x10')][_0xba37('0xe')](_0xba37('0x21'))&&_0x1ad73e[_0xba37('0x10')][_0xba37('0x21')]!==_0xba37('0x22')){_0x1ad73e['extensions'][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0]['VoiceExtensionId']});_0x1ad73e['extensions'][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1ad73e[_0xba37('0x10')]['recordingFormat']||_0xba37('0x23'),'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});}}_0x1ad73e['extensions'][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0xba37('0x24'),'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0]['exten'],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});_0x1ad73e['extensions'][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0]['type'],'app':_0xba37('0x14'),'appdata':_0xba37('0x25'),'context':_0x46c97a[_0x51e62e][0x0]['context'],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0][_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0xba37('0x26'),'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'priority':_0x1ad73e[_0xba37('0xf')]++,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});for(var _0x2460cd=0x0,_0x3c6ab5=0x0;_0x2460cd<_0x46c97a[_0x51e62e][_0xba37('0x27')];_0x2460cd+=0x1,_0x3c6ab5=0x0){var _0x21732a=_0x46c97a[_0x51e62e][_0x2460cd];if(_0x21732a[_0xba37('0x13')]){_0x21732a['type']=_0x21732a[_0xba37('0x13')][_0xba37('0x28')]();}var _0x5c51e0=[];var _0x5ba9be=[];delete _0x21732a['id'];delete _0x21732a['createdAt'];delete _0x21732a[_0xba37('0x29')];var _0x3ac38b=_0x21732a[_0xba37('0x2a')]!==_0xba37('0x2b')?[_0x21732a[_0xba37('0x2a')]]:_0x21732a[_0xba37('0x2c')]?_['map'](_[_0xba37('0xb')](_0x1ad73e[_0xba37('0x2d')],{'IntervalId':_0x21732a[_0xba37('0x2c')]}),'interval'):[];if(_0x21732a['hasOwnProperty'](_0xba37('0x2e'))){if(_0x21732a[_0xba37('0x2e')]&&_0x21732a['tag']!=='--'){_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a[_0xba37('0x13')],'app':_0xba37('0x14'),'appdata':_0xba37('0x2f')+_0x21732a[_0xba37('0x2e')],'context':_0x21732a[_0xba37('0x16')],'exten':_0x21732a[_0xba37('0x9')],'priority':_0x3ac38b['length']+_0x1ad73e['priority']+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});}}if(_0x21732a[_0xba37('0x13')]===_0xba37('0x1a')&&_0x21732a[_0xba37('0xe')](_0xba37('0x30'))){if(_0x21732a[_0xba37('0x30')]){_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a[_0xba37('0x13')],'app':_0xba37('0x31'),'appdata':_0xba37('0x32')+_0x21732a['callerID']+')','context':_0x21732a[_0xba37('0x16')],'exten':_0x21732a[_0xba37('0x9')],'priority':_0x3ac38b['length']+_0x1ad73e[_0xba37('0xf')]+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});}else{_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a[_0xba37('0x13')],'app':_0xba37('0x31'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x21732a['context'],'exten':_0x21732a['exten'],'priority':_0x3ac38b[_0xba37('0x27')]+_0x1ad73e['priority']+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});}}if(_0x21732a['hasOwnProperty'](_0xba37('0x33'))){if(_0x451988['indexOf'](_0x21732a[_0xba37('0x34')][_0xba37('0x28')]())>=0x0&&_0x21732a[_0xba37('0x35')]!=='custom'){if(_0x21732a[_0xba37('0x33')]){_0x5c51e0['push']({'type':_0x21732a[_0xba37('0x13')],'app':_0xba37('0x31'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x21732a['context'],'exten':_0x21732a[_0xba37('0x9')],'priority':_0x3ac38b[_0xba37('0x27')]+_0x1ad73e[_0xba37('0xf')]+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a['type'],'app':_0xba37('0x14'),'appdata':_0xba37('0x36'),'context':_0x21732a['context'],'exten':_0x21732a['exten'],'priority':_0x3ac38b[_0xba37('0x27')]+_0x1ad73e[_0xba37('0xf')]+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});}else{_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a[_0xba37('0x13')],'app':_0xba37('0x31'),'appdata':_0xba37('0x37'),'context':_0x21732a[_0xba37('0x16')],'exten':_0x21732a[_0xba37('0x9')],'priority':_0x3ac38b[_0xba37('0x27')]+_0x1ad73e[_0xba37('0xf')]+_0x3c6ab5++,'VoiceExtensionId':_0x21732a[_0xba37('0x19')]});_0x5c51e0[_0xba37('0x12')]({'type':_0x21732a['type'],'app':'Set','appdata':_0xba37('0x38'),'context':_0x21732a['context'],'exten':_0x21732a[_0xba37('0x9')],'priority':_0x3ac38b['length']+_0x1ad73e['priority']+_0x3c6ab5++,'VoiceExtensionId':_0x21732a['VoiceExtensionId']});}}}for(var _0x410993=0x0;_0x410993<_0x3ac38b[_0xba37('0x27')];_0x410993+=0x1){var _0x2626f6=_0x1ad73e[_0xba37('0xf')]+_0x3ac38b[_0xba37('0x27')];var _0x3feae9=_0x410993===_0x3ac38b[_0xba37('0x27')]-0x1?_0x1ad73e[_0xba37('0xf')]+_0x5c51e0['length']+_0x5ba9be[_0xba37('0x27')]+0x2:_0x1ad73e[_0xba37('0xf')]+_0x410993+0x1;_0x5c51e0[_0xba37('0x39')](_0x410993,0x0,{'type':_0x21732a[_0xba37('0x13')],'app':'GotoIfTime','appdata':_0x3ac38b[_0x410993]+'?'+_0x21732a[_0xba37('0x16')]+_0xba37('0x3a')+_0x2626f6+':'+_0x21732a[_0xba37('0x16')]+_0xba37('0x3a')+_0x3feae9,'exten':_0x21732a[_0xba37('0x9')],'context':_0x21732a[_0xba37('0x16')],'priority':_0x1ad73e[_0xba37('0xf')]+_0x410993,'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0]['VoiceExtensionId']});}_0x21732a[_0xba37('0xf')]=_0x5c51e0[_0xba37('0x27')]?_[_0xba37('0x3b')](_0x5c51e0)[_0xba37('0xf')]+0x1:_0x1ad73e[_0xba37('0xf')];_0x1ad73e['priority']=(_0x5ba9be['length']?_[_0xba37('0x3b')](_0x5ba9be)['priority']:_0x21732a['priority'])+0x1;_0x1ad73e[_0xba37('0x11')]=_[_0xba37('0x3c')](_0x1ad73e[_0xba37('0x11')],_0x5c51e0,[_0x21732a],_0x5ba9be);}_0x1ad73e[_0xba37('0x11')][_0xba37('0x12')]({'type':_0x46c97a[_0x51e62e][0x0]['type'],'app':_0xba37('0x3d'),'exten':_0x46c97a[_0x51e62e][0x0][_0xba37('0x9')],'context':_0x46c97a[_0x51e62e][0x0][_0xba37('0x16')],'priority':_0x1ad73e[_0xba37('0xf')],'VoiceExtensionId':_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]});_0x1f8f2d[_0xba37('0x12')](_0x46c97a[_0x51e62e][0x0][_0xba37('0x19')]);_0x4e1810=_['concat'](_0x4e1810,_0x1ad73e[_0xba37('0x11')]);}}return _0x3381d6[_0xba37('0x3e')](function(_0x5a705b){return _0x3381d6[_0xba37('0x2')]['VoiceExtension'][_0xba37('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x1f8f2d}},'transaction':_0x5a705b})[_0xba37('0x4')](function(_0x37f24b){return _0x3381d6[_0xba37('0x2')][_0xba37('0x5')][_0xba37('0x40')](_[_0xba37('0x41')](_0x4e1810,'priority'),{'transaction':_0x5a705b});});});})['catch'](function(_0x8706fd){console[_0xba37('0x42')](_0x8706fd);});}exports[_0xba37('0x43')]=rewrite; \ No newline at end of file +var _0xab70=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','updatedAt','*,*,*,*','interval','map','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','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','push','type','Set','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf'];(function(_0x11d4d7,_0x2f6fcc){var _0x50ed8f=function(_0x1b261b){while(--_0x1b261b){_0x11d4d7['push'](_0x11d4d7['shift']());}};_0x50ed8f(++_0x2f6fcc);}(_0xab70,0xee));var _0x0ab7=function(_0x89080a,_0x2d2b1b){_0x89080a=_0x89080a-0x0;var _0x33a55d=_0xab70[_0x89080a];return _0x33a55d;};'use strict';var _=require(_0x0ab7('0x0'));var util=require(_0x0ab7('0x1'));function rewrite(_0x5697a9,_0x368a7e){var _0x24ec98=this;return _0x5697a9['models']['Interval'][_0x0ab7('0x2')]({'raw':!![]})[_0x0ab7('0x3')](function(_0x5eda7b){_0x24ec98[_0x0ab7('0x4')]=_0x5eda7b;return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')]['findAll']({'where':{'IntervalId':_0x368a7e[_0x0ab7('0x7')]},'raw':!![]});})[_0x0ab7('0x3')](function(_0x3c28ec){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x0ab7('0x8')](_['map'](_0x3c28ec,_0x0ab7('0x9')))}},'order':[{'raw':_0x0ab7('0xa')}],'raw':!![]});})[_0x0ab7('0x3')](function(_0x19f211){var _0x6d43b7=_[_0x0ab7('0xb')](_0x19f211,{'priority':'1'});var _0x1a0f43=_[_0x0ab7('0xb')](_0x19f211,{'isApp':0x1});var _0x4b1247=_[_0x0ab7('0xc')](_0x1a0f43,_0x0ab7('0x9'));var _0x14c899=[_0x0ab7('0xd'),_0x0ab7('0xe')];var _0x4a6caa=[];var _0x412a62=[];for(var _0x314c44 in _0x4b1247){if(_0x4b1247['hasOwnProperty'](_0x314c44)){_0x24ec98[_0x0ab7('0xf')]=0x2;_0x24ec98[_0x0ab7('0x10')]=[];_0x24ec98[_0x0ab7('0x11')]=_['find'](_0x6d43b7,{'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')]});_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':util['format']('CDR(type)=%s',_0x4b1247[_0x314c44][0x0]['type']),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});if(_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')]===_0x0ab7('0x16')){_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x17')+_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}else if(_0x4b1247[_0x314c44][0x0]['type']===_0x0ab7('0x19')){if(_0x24ec98[_0x0ab7('0x11')]){_0x24ec98[_0x0ab7('0x10')]['push']({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':_0x0ab7('0x1a')+(_0x24ec98['extension'][_0x0ab7('0x1b')]?'${EXTEN:'+_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]+'}':_0x0ab7('0x1c')),'context':_0x4b1247[_0x314c44][0x0]['context'],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x17')+_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});var _0x3ce1c6=_0x24ec98['priority']++;_0x24ec98[_0x0ab7('0x10')]['push']({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x1e')+(_0x3ce1c6+0x2)+'):Goto('+(_0x3ce1c6+0x1)+')','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x3ce1c6,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});if(_0x24ec98[_0x0ab7('0x11')]){_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x24ec98['priority']++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':_0x0ab7('0x1f')+_0x4b1247[_0x314c44][0x0]['VoiceExtensionId'],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});if(_0x24ec98[_0x0ab7('0x11')]&&_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x20')](_0x0ab7('0x21'))&&_0x24ec98[_0x0ab7('0x11')]['recordingFormat']!==_0x0ab7('0x22')){_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x23'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x24')+_0x24ec98['extension'][_0x0ab7('0x21')]||_0x0ab7('0x25'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x26'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98['priority']++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});for(var _0x31d899=0x0,_0x3aaa2e=0x0;_0x31d899<_0x4b1247[_0x314c44][_0x0ab7('0x27')];_0x31d899+=0x1,_0x3aaa2e=0x0){var _0x2ccc17=_0x4b1247[_0x314c44][_0x31d899];if(_0x2ccc17['type']){_0x2ccc17[_0x0ab7('0x13')]=_0x2ccc17[_0x0ab7('0x13')]['toLowerCase']();}var _0x514f33=[];var _0x20623f=[];delete _0x2ccc17['id'];delete _0x2ccc17['createdAt'];delete _0x2ccc17[_0x0ab7('0x28')];var _0x5151dd=_0x2ccc17['interval']!==_0x0ab7('0x29')?[_0x2ccc17[_0x0ab7('0x2a')]]:_0x2ccc17[_0x0ab7('0x7')]?_[_0x0ab7('0x2b')](_['filter'](_0x24ec98[_0x0ab7('0x4')],{'IntervalId':_0x2ccc17['IntervalId']}),_0x0ab7('0x2a')):[];if(_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x2c'))){if(_0x2ccc17[_0x0ab7('0x2c')]&&_0x2ccc17[_0x0ab7('0x2c')]!=='--'){_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x2d')+_0x2ccc17[_0x0ab7('0x2c')],'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17['exten'],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}if(_0x2ccc17['type']===_0x0ab7('0x19')&&_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x2e'))){if(_0x2ccc17[_0x0ab7('0x2e')]){_0x514f33['push']({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x2f')+_0x2ccc17['callerID']+')','context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98['priority']+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17['VoiceExtensionId']});}else{_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':'ExecIf','appdata':_0x0ab7('0x30'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98['priority']+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}if(_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x31'))){if(_0x14c899[_0x0ab7('0x32')](_0x2ccc17[_0x0ab7('0x33')][_0x0ab7('0x34')]())>=0x0&&_0x2ccc17[_0x0ab7('0x35')]!=='custom'){if(_0x2ccc17[_0x0ab7('0x31')]){_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':'ExecIf','appdata':_0x0ab7('0x36'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x37'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}else{_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x38'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17['VoiceExtensionId']});_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':_0x0ab7('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17['exten'],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}}for(var _0xd48c6d=0x0;_0xd48c6d<_0x5151dd['length'];_0xd48c6d+=0x1){var _0x37fdbc=_0x24ec98['priority']+_0x5151dd[_0x0ab7('0x27')];var _0x436a88=_0xd48c6d===_0x5151dd[_0x0ab7('0x27')]-0x1?_0x24ec98[_0x0ab7('0xf')]+_0x514f33['length']+_0x20623f[_0x0ab7('0x27')]+0x2:_0x24ec98[_0x0ab7('0xf')]+_0xd48c6d+0x1;_0x514f33[_0x0ab7('0x39')](_0xd48c6d,0x0,{'type':_0x2ccc17[_0x0ab7('0x13')],'app':'GotoIfTime','appdata':_0x5151dd[_0xd48c6d]+'?'+_0x2ccc17['context']+_0x0ab7('0x3a')+_0x37fdbc+':'+_0x2ccc17[_0x0ab7('0x15')]+',${EXTEN},'+_0x436a88,'exten':_0x2ccc17[_0x0ab7('0x9')],'context':_0x2ccc17[_0x0ab7('0x15')],'priority':_0x24ec98[_0x0ab7('0xf')]+_0xd48c6d,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x2ccc17['priority']=_0x514f33[_0x0ab7('0x27')]?_[_0x0ab7('0x3b')](_0x514f33)[_0x0ab7('0xf')]+0x1:_0x24ec98[_0x0ab7('0xf')];_0x24ec98[_0x0ab7('0xf')]=(_0x20623f[_0x0ab7('0x27')]?_[_0x0ab7('0x3b')](_0x20623f)[_0x0ab7('0xf')]:_0x2ccc17[_0x0ab7('0xf')])+0x1;_0x24ec98[_0x0ab7('0x10')]=_[_0x0ab7('0x3c')](_0x24ec98[_0x0ab7('0x10')],_0x514f33,[_0x2ccc17],_0x20623f);}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':'Hangup','exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'priority':_0x24ec98[_0x0ab7('0xf')],'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x4a6caa['push'](_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]);_0x412a62=_[_0x0ab7('0x3c')](_0x412a62,_0x24ec98[_0x0ab7('0x10')]);}}return _0x5697a9['transaction'](function(_0x5219a9){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')][_0x0ab7('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x4a6caa}},'transaction':_0x5219a9})['then'](function(_0x52313d){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')][_0x0ab7('0x3e')](_[_0x0ab7('0x3f')](_0x412a62,_0x0ab7('0xf')),{'transaction':_0x5219a9});});});})[_0x0ab7('0x40')](function(_0x150b9e){console[_0x0ab7('0x41')](_0x150b9e);});}exports[_0x0ab7('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 698d3e1..56c3440 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 _0xc5da=['../../../mysqldb','../../../config/environment','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','cm_contacts','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','CmList','Lists','get','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','outbound','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','resume','contact:csv_','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse'];(function(_0x3bf898,_0x1309a8){var _0x394c8f=function(_0xbf3669){while(--_0xbf3669){_0x3bf898['push'](_0x3bf898['shift']());}};_0x394c8f(++_0x1309a8);}(_0xc5da,0xd3));var _0xac5d=function(_0x4bf724,_0x3684c0){_0x4bf724=_0x4bf724-0x0;var _0x1dd1c6=_0xc5da[_0x4bf724];return _0x1dd1c6;};'use strict';var BPromise=require(_0xac5d('0x0'));var util=require(_0xac5d('0x1'));var _=require(_0xac5d('0x2'));var fs=require('fs');var squel=require(_0xac5d('0x3'));var Papa=require(_0xac5d('0x4'));var Redis=require('ioredis');var db=require(_0xac5d('0x5'))['db'];var config=require(_0xac5d('0x6'));var logger=require('../../../config/logger')('api');config['redis']=_[_0xac5d('0x7')](config[_0xac5d('0x8')],{'host':_0xac5d('0x9'),'port':0x18eb});var socket=require(_0xac5d('0xa'))(new Redis(config[_0xac5d('0x8')]));require(_0xac5d('0xb'))[_0xac5d('0xc')](socket);try{if(!process[_0xac5d('0xd')][0x2]||process[_0xac5d('0xd')][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xac5d('0xd')][0x2];if(!process[_0xac5d('0xd')][0x3]||process[_0xac5d('0xd')][0x3]===_0xac5d('0xe')||process[_0xac5d('0xd')][0x3]===_0xac5d('0xf')||!process[_0xac5d('0xd')][0x4]||process['argv'][0x4]===_0xac5d('0xe')||process[_0xac5d('0xd')][0x4]===_0xac5d('0xf')){throw new Error(_0xac5d('0x10'));}var FIELDS=_['zipObject'](process[_0xac5d('0xd')][0x3]['split'](','),process[_0xac5d('0xd')][0x4][_0xac5d('0x11')](','));if(!process[_0xac5d('0xd')][0x5]||process['argv'][0x5]===_0xac5d('0xe')||process['argv'][0x5]==='null'){throw new Error(_0xac5d('0x12'));}var LISTID=process[_0xac5d('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xac5d('0xd')][0x6]!==_0xac5d('0xe')&&process[_0xac5d('0xd')][0x6]!==_0xac5d('0xf')?process[_0xac5d('0xd')][0x6]:null;var DUPLICATES=process[_0xac5d('0xd')][0x7]&&process[_0xac5d('0xd')][0x7]!==_0xac5d('0xe')&&process[_0xac5d('0xd')][0x7]!==_0xac5d('0xf')?process[_0xac5d('0xd')][0x7]:null;if(!process[_0xac5d('0xd')][0x8]||process[_0xac5d('0xd')][0x8]===_0xac5d('0xe')||process[_0xac5d('0xd')][0x8]===_0xac5d('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xac5d('0xd')][0x8];}catch(_0x406f73){logger['error'](_0x406f73);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(_0x121ce1,_0x1caa4e,_0x439eb0,_0x2b8b05){var _0x3ebe59={'message':_0x1caa4e};_0x3ebe59[_0x121ce1]=!![];if(_0x439eb0){_0x3ebe59[_0xac5d('0x13')]=_0x439eb0;}if(_0x2b8b05){_0x3ebe59['index']=_0x2b8b05;}return _0x3ebe59;}function isEmail(_0x196085){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))*$/[_0xac5d('0x14')](_0x196085);}function checkRow(_0x4cc6d1,_0x28a819,_0x43fc81){return new BPromise(function(_0x28a53e,_0x3cad86){if(_[_0xac5d('0x15')](_0x4cc6d1)){return _0x3cad86(handleCheckRowError(_0xac5d('0x16'),_0xac5d('0x17'),null,_0x43fc81));}if(_0x4cc6d1[_0xac5d('0x18')]&&_0x4cc6d1[_0xac5d('0x18')]['length']){var _0x5079c5=_['map'](_0x4cc6d1['errors'],_0xac5d('0x19'))['join'](';');return _0x3cad86(handleCheckRowError('error',_0x5079c5,null,_0x43fc81));}var _0x28d9eb={};for(var _0x144d11 in FIELDS){if(FIELDS[_0xac5d('0x1a')](_0x144d11)&&FIELDS[_0x144d11]){_0x28d9eb[_0x144d11]=_0x4cc6d1['data'][0x0][FIELDS[_0x144d11]]||_0x4cc6d1[_0xac5d('0x1b')][0x0]['\ufeff'+FIELDS[_0x144d11]];}}if(!_0x28d9eb[_0xac5d('0x1c')]){return _0x3cad86(handleCheckRowError(_0xac5d('0x16'),_0xac5d('0x1d'),null,_0x43fc81));}if(!_0x28d9eb[_0xac5d('0x1e')]){return _0x3cad86(handleCheckRowError(_0xac5d('0x16'),_0xac5d('0x1f'),null,_0x43fc81));}if(_0x28d9eb['birthDate']){var _0x5918bc=moment(_0x28d9eb[_0xac5d('0x20')],_0xac5d('0x21'));if(!_0x5918bc[_0xac5d('0x22')]()){return _0x3cad86(handleCheckRowError(_0xac5d('0x16'),_0xac5d('0x23'),null,_0x43fc81));}}if(_0x28d9eb[_0xac5d('0x24')]){if(!isEmail(_0x28d9eb[_0xac5d('0x24')])){return _0x3cad86(handleCheckRowError(_0xac5d('0x16'),_0xac5d('0x25'),null,_0x43fc81));}}_0x28d9eb[_0xac5d('0x26')]=LISTID;_0x28d9eb[_0xac5d('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xac5d('0x28')]&&_0x28a819){var _0x2b0180={};for(var _0x356e6b=0x0,_0xd902d0=DUPLICATES[_0xac5d('0x28')];_0x356e6b<_0xd902d0;_0x356e6b+=0x1){_0x2b0180[DUPLICATES[_0x356e6b]]=_0x28d9eb[DUPLICATES[_0x356e6b]];}var _0x8d584c=_[_0xac5d('0x29')](_0x28a819,_0x2b0180);if(_0x8d584c){return _0x3cad86(handleCheckRowError(_0xac5d('0x2a'),'Duplicate\x20Contact',_0x8d584c,_0x43fc81));}}return db[_0xac5d('0x2b')][_0xac5d('0x2c')](_0x28d9eb,{'raw':!![],'hooks':![],'fields':_['keys'](_0x28d9eb)})[_0xac5d('0x2d')](function(_0xb9bb90){if(DUPLICATES&&DUPLICATES[_0xac5d('0x28')]&&_0x28a819){_0x28a819[_0xac5d('0x2e')](_[_0xac5d('0x2f')](_0x28d9eb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xb9bb90['id'];return _0x28a53e();})[_0xac5d('0x30')](function(_0x4a1abc){return _0x3cad86(handleCheckRowError('error',_0xac5d('0x31')+(_0x4a1abc[_0xac5d('0x19')]||JSON['stringify'](_0x4a1abc)),null,_0x43fc81));});});}function checkHopper(){function _0x3b7eeb(){return function(_0x40d62e){logger[_0xac5d('0x16')](_0xac5d('0x32'),_0xac5d('0x33'),util[_0xac5d('0x34')](_0x40d62e,{'showHidden':![],'depth':null}));};}var _0x3d825c=function(_0x4b1508,_0x11ab72){var _0x50e8eb=squel[_0xac5d('0x35')]()[_0xac5d('0x36')](_0xac5d('0x37'))[_0xac5d('0x38')](['phone',_0xac5d('0x39'),_0xac5d('0x3a'),_0xac5d('0x26'),_0x11ab72,_0xac5d('0x3b'),_0xac5d('0x3c')],squel[_0xac5d('0x3d')]()[_0xac5d('0x3e')](_0xac5d('0x1e'),_0xac5d('0x1e'))[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x39'))[_0xac5d('0x3e')]('id',_0xac5d('0x3a'))[_0xac5d('0x3e')](LISTID[_0xac5d('0x40')](),_0xac5d('0x26'))[_0xac5d('0x3e')](_0x4b1508['id'][_0xac5d('0x40')](),_0x11ab72)[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3b'))[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3c'))[_0xac5d('0x41')]('cm_contacts')[_0xac5d('0x42')](_0xac5d('0x43'))[_0xac5d('0x42')](_0xac5d('0x44'),LISTID[_0xac5d('0x40')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xac5d('0x42')](_0xac5d('0x45'),squel[_0xac5d('0x3d')]()[_0xac5d('0x3e')](_0xac5d('0x1e'))['from'](_0xac5d('0x37'))['where'](_0x11ab72+_0xac5d('0x46'),_0x4b1508['id'][_0xac5d('0x40')]())))[_0xac5d('0x40')]();return _0x50e8eb;};var _0x427e9c=function(_0x40bcd7,_0x27fabc){var _0x35ce36=squel['insert']()[_0xac5d('0x36')](_0xac5d('0x37'))[_0xac5d('0x38')]([_0xac5d('0x1e'),'scheduledAt','ContactId',_0xac5d('0x26'),_0x27fabc,_0xac5d('0x3b'),_0xac5d('0x3c')],squel[_0xac5d('0x3d')]()[_0xac5d('0x3e')](_0xac5d('0x1e'),_0xac5d('0x1e'))[_0xac5d('0x3e')](_0xac5d('0x3f'),'scheduledAt')['field']('id',_0xac5d('0x3a'))[_0xac5d('0x3e')](LISTID[_0xac5d('0x40')](),_0xac5d('0x26'))[_0xac5d('0x3e')](_0x40bcd7['id'][_0xac5d('0x40')](),_0x27fabc)['field'](_0xac5d('0x3f'),_0xac5d('0x3b'))[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3c'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xac5d('0x42')](_0xac5d('0x44'),LISTID[_0xac5d('0x40')]())[_0xac5d('0x42')]('id\x20IN\x20?',squel[_0xac5d('0x47')](hopperContacts))[_0xac5d('0x42')](_0xac5d('0x48'))[_0xac5d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xac5d('0x3d')]()[_0xac5d('0x3e')]('calleridnum')[_0xac5d('0x41')](_0xac5d('0x49'))['where'](_0x27fabc+'\x20=\x20?',_0x40bcd7['id'][_0xac5d('0x40')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xac5d('0x3e')]('phone')['from'](_0xac5d('0x37'))[_0xac5d('0x42')](_0x27fabc+_0xac5d('0x46'),_0x40bcd7['id'][_0xac5d('0x40')]())))['toString']();return _0x35ce36;};function _0x4510f5(_0x24e657,_0x1c176a){var _0x360bff=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt',_0xac5d('0x3a'),_0xac5d('0x26'),_0x1c176a,_0xac5d('0x3b'),_0xac5d('0x3c')],squel['select']()[_0xac5d('0x3e')](_0xac5d('0x1e'),_0xac5d('0x1e'))[_0xac5d('0x3e')]('NOW()','scheduledAt')[_0xac5d('0x3e')]('id',_0xac5d('0x3a'))[_0xac5d('0x3e')](LISTID[_0xac5d('0x40')](),_0xac5d('0x26'))[_0xac5d('0x3e')](_0x24e657['id'][_0xac5d('0x40')](),_0x1c176a)['field'](_0xac5d('0x3f'),_0xac5d('0x3b'))[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3c'))[_0xac5d('0x41')](_0xac5d('0x4a'))[_0xac5d('0x42')](_0xac5d('0x43'))[_0xac5d('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0xac5d('0x42')](_0xac5d('0x4b'),squel[_0xac5d('0x47')](hopperContacts))[_0xac5d('0x42')](_0xac5d('0x48')))[_0xac5d('0x40')]();return _0x360bff;}function _0x47ba8c(_0x29b680,_0xf2c013){var _0x4134f6=squel['insert']()['into'](_0xac5d('0x4c'))['fromQuery'](['phone','ContactId',_0xac5d('0x26'),_0xf2c013,_0xac5d('0x3b'),_0xac5d('0x3c')],squel['select']()[_0xac5d('0x3e')]('phone',_0xac5d('0x1e'))[_0xac5d('0x3e')]('id','ContactId')[_0xac5d('0x3e')](LISTID[_0xac5d('0x40')](),_0xac5d('0x26'))[_0xac5d('0x3e')](_0x29b680['id'][_0xac5d('0x40')](),_0xf2c013)[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3b'))[_0xac5d('0x3e')](_0xac5d('0x3f'),_0xac5d('0x3c'))[_0xac5d('0x41')](_0xac5d('0x4a'))[_0xac5d('0x42')]('deletedAt\x20IS\x20NULL')[_0xac5d('0x42')](_0xac5d('0x44'),LISTID[_0xac5d('0x40')]())[_0xac5d('0x42')](_0xac5d('0x4b'),squel[_0xac5d('0x47')](hopperContacts))[_0xac5d('0x42')](_0xac5d('0x48')))[_0xac5d('0x40')]();return _0x4134f6;}return db[_0xac5d('0x4d')][_0xac5d('0x4e')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xac5d('0x4f')],'as':_0xac5d('0x50'),'where':{'id':LISTID}}]})[_0xac5d('0x2d')](function(_0x215a62){var _0xa76b5c=[];if(_0x215a62){var _0x5e68fc;for(var _0x18ca86=0x0,_0x322772;_0x18ca86<_0x215a62[_0xac5d('0x28')];_0x18ca86+=0x1){_0x322772=_0x215a62[_0x18ca86][_0xac5d('0x51')]({'plain':!![]});switch(_0x322772[_0xac5d('0x52')]){case _0xac5d('0x53'):_0xa76b5c[_0xac5d('0x2e')](db['sequelize'][_0xac5d('0x54')](_0x427e9c(_0x322772,_0xac5d('0x55')))['then'](function(){})['catch'](_0x3b7eeb()));break;case _0xac5d('0x56'):_0xa76b5c['push'](db['sequelize'][_0xac5d('0x54')](_0x3d825c(_0x322772,_0xac5d('0x55')))[_0xac5d('0x2d')](function(){})[_0xac5d('0x30')](_0x3b7eeb()));break;default:_0xa76b5c[_0xac5d('0x2e')](db[_0xac5d('0x57')][_0xac5d('0x54')](_0x4510f5(_0x322772,_0xac5d('0x55')))[_0xac5d('0x2d')](function(){})['catch'](_0x3b7eeb()));}}}return _0xa76b5c;})[_0xac5d('0x58')]()['then'](function(){return db['VoiceQueue'][_0xac5d('0x4e')]({'where':{'type':_0xac5d('0x59')},'attributes':['id'],'include':[{'model':db[_0xac5d('0x4f')],'as':_0xac5d('0x5a'),'where':{'id':LISTID}}]})[_0xac5d('0x2d')](function(_0x2fb130){var _0x5c2a61=[];if(_0x2fb130){var _0x4f4344;for(var _0x361a92=0x0,_0x51ac15;_0x361a92<_0x2fb130[_0xac5d('0x28')];_0x361a92+=0x1){_0x51ac15=_0x2fb130[_0x361a92][_0xac5d('0x51')]({'plain':!![]});_0x5c2a61[_0xac5d('0x2e')](db[_0xac5d('0x57')]['query'](_0x47ba8c(_0x51ac15,_0xac5d('0x55')))[_0xac5d('0x2d')](function(){})[_0xac5d('0x30')](_0x3b7eeb()));}}return _0x5c2a61;})[_0xac5d('0x58')]();})[_0xac5d('0x2d')](function(){return db['Campaign'][_0xac5d('0x4e')]({'attributes':['id',_0xac5d('0x52')],'include':[{'model':db[_0xac5d('0x4f')],'as':_0xac5d('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x29298b){var _0x3ce766=[];if(_0x29298b){for(var _0x155fc7=0x0,_0x3d14c9;_0x155fc7<_0x29298b[_0xac5d('0x28')];_0x155fc7+=0x1){_0x3d14c9=_0x29298b[_0x155fc7][_0xac5d('0x51')]({'plain':!![]});switch(_0x3d14c9[_0xac5d('0x52')]){case _0xac5d('0x53'):_0x3ce766[_0xac5d('0x2e')](db[_0xac5d('0x57')][_0xac5d('0x54')](_0x427e9c(_0x3d14c9,'CampaignId'))[_0xac5d('0x2d')](function(){})[_0xac5d('0x30')](_0x3b7eeb()));break;case _0xac5d('0x56'):_0x3ce766[_0xac5d('0x2e')](db[_0xac5d('0x57')][_0xac5d('0x54')](_0x3d825c(_0x3d14c9,_0xac5d('0x5b')))[_0xac5d('0x2d')](function(){})[_0xac5d('0x30')](_0x3b7eeb()));break;default:_0x3ce766[_0xac5d('0x2e')](db['sequelize'][_0xac5d('0x54')](_0x4510f5(_0x3d14c9,_0xac5d('0x5b')))[_0xac5d('0x2d')](function(){})[_0xac5d('0x30')](_0x3b7eeb()));}}}return _0x3ce766;})[_0xac5d('0x58')]();})[_0xac5d('0x2d')](function(){return db[_0xac5d('0x5c')][_0xac5d('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xac5d('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0xad9b5c){var _0x23967b=[];if(_0xad9b5c){for(var _0x52b7b3=0x0,_0xfbb5f;_0x52b7b3<_0xad9b5c['length'];_0x52b7b3+=0x1){_0xfbb5f=_0xad9b5c[_0x52b7b3][_0xac5d('0x51')]({'plain':!![]});_0x23967b[_0xac5d('0x2e')](db[_0xac5d('0x57')][_0xac5d('0x54')](_0x47ba8c(_0xfbb5f,_0xac5d('0x5b')))['then'](function(){})[_0xac5d('0x30')](_0x3b7eeb()));}}return _0x23967b;})['all']();})[_0xac5d('0x30')](function(_0x5cc826){logger[_0xac5d('0x16')](_0xac5d('0x5d'),_0xac5d('0x5e'),_0x5cc826[_0xac5d('0x19')]);});}var processPromises=function(_0x3fca7e){return BPromise[_0xac5d('0x58')](promises)[_0xac5d('0x2d')](function(_0x53c9d6){})[_0xac5d('0x30')](function(_0x57487e){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xac5d('0x5f')](_0x57487e));})[_0xac5d('0x60')](function(){socket[_0xac5d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3fca7e){return _0x3fca7e[_0xac5d('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xac5d('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xac5d('0x2d')](function(){socket[_0xac5d('0x61')](_0xac5d('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x125547){logger[_0xac5d('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xac5d('0x5f')](_0x125547));}finally{process[_0xac5d('0x64')](0x0);}});};process['on'](_0xac5d('0x65'),function(){logger['info'](_0xac5d('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xac5d('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xac5d('0x11')](',');return db[_0xac5d('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5533f9){var _0x158bed=fs[_0xac5d('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x158bed,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bc171,_0x3e8724){total+=0x1;var _0x408f87=total;promises[_0xac5d('0x2e')](checkRow(_0x4bc171,_0x5533f9,_0x408f87)[_0xac5d('0x2d')](function(){success+=0x1;})[_0xac5d('0x30')](function(_0x568f07){if(_0x568f07[_0xac5d('0x16')]){errors+=0x1;delete _0x568f07[_0xac5d('0x16')];}else if(_0x568f07[_0xac5d('0x2a')]){duplicates+=0x1;delete _0x568f07['duplicate'];}rows[_0xac5d('0x2e')](_0x568f07);}));if(total%0xc8===0x0){_0x3e8724[_0xac5d('0x68')]();return processPromises(_0x3e8724);}},'complete':function(){return processPromises()['then'](function(){logger[_0xac5d('0x69')](_0xac5d('0x6a'));endCsv();});},'error':function(_0x89e63d,_0x375e6b){logger[_0xac5d('0x69')]('CSV\x20parse\x20error',JSON[_0xac5d('0x5f')](_0x89e63d));endCsv();}});})[_0xac5d('0x30')](function(_0x52be4f){logger[_0xac5d('0x16')](_0xac5d('0x6b'),JSON[_0xac5d('0x5f')](_0x52be4f));});}main(); \ No newline at end of file +var _0x6fb6=['message','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','updatedAt','field','NOW()','ContactId','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','createdAt','from','id\x20IN\x20?','cm_hopper_final','str','cm_hopper_black','deletedAt\x20IS\x20NULL','VoiceQueue','outbound','dialCheckDuplicateType','CmList','then','always','sequelize','query','VoiceQueueId','findAll','get','all','Campaign','Lists','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','undefined','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fb6,0x11c));var _0x66fb=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x6fb6[_0x481bf7];return _0x461787;};'use strict';var BPromise=require(_0x66fb('0x0'));var util=require('util');var _=require(_0x66fb('0x1'));var fs=require('fs');var squel=require(_0x66fb('0x2'));var Papa=require('papaparse');var Redis=require(_0x66fb('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x66fb('0x4'));var logger=require(_0x66fb('0x5'))(_0x66fb('0x6'));config[_0x66fb('0x7')]=_[_0x66fb('0x8')](config[_0x66fb('0x7')],{'host':_0x66fb('0x9'),'port':0x18eb});var socket=require(_0x66fb('0xa'))(new Redis(config['redis']));require(_0x66fb('0xb'))[_0x66fb('0xc')](socket);try{if(!process[_0x66fb('0xd')][0x2]||process['argv'][0x2]==='undefined'||process[_0x66fb('0xd')][0x2]===_0x66fb('0xe')){throw new Error(_0x66fb('0xf'));}var FILEPATH=process[_0x66fb('0xd')][0x2];if(!process[_0x66fb('0xd')][0x3]||process['argv'][0x3]==='undefined'||process[_0x66fb('0xd')][0x3]===_0x66fb('0xe')||!process[_0x66fb('0xd')][0x4]||process[_0x66fb('0xd')][0x4]==='undefined'||process[_0x66fb('0xd')][0x4]===_0x66fb('0xe')){throw new Error(_0x66fb('0x10'));}var FIELDS=_[_0x66fb('0x11')](process[_0x66fb('0xd')][0x3][_0x66fb('0x12')](','),process[_0x66fb('0xd')][0x4][_0x66fb('0x12')](','));if(!process[_0x66fb('0xd')][0x5]||process[_0x66fb('0xd')][0x5]===_0x66fb('0x13')||process[_0x66fb('0xd')][0x5]===_0x66fb('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x66fb('0xd')][0x5];var COMPANYID=process[_0x66fb('0xd')][0x6]&&process[_0x66fb('0xd')][0x6]!==_0x66fb('0x13')&&process[_0x66fb('0xd')][0x6]!==_0x66fb('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x66fb('0xd')][0x7]&&process[_0x66fb('0xd')][0x7]!==_0x66fb('0x13')&&process[_0x66fb('0xd')][0x7]!==_0x66fb('0xe')?process['argv'][0x7]:null;if(!process[_0x66fb('0xd')][0x8]||process[_0x66fb('0xd')][0x8]==='undefined'||process[_0x66fb('0xd')][0x8]===_0x66fb('0xe')){throw new Error(_0x66fb('0x14'));}var SOCKET_TIMESTAMP=process[_0x66fb('0xd')][0x8];}catch(_0x214570){logger[_0x66fb('0x15')](_0x214570);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(_0x4eb4d3,_0x275673,_0x58cbc5,_0x471f7c){var _0x401197={'message':_0x275673};_0x401197[_0x4eb4d3]=!![];if(_0x58cbc5){_0x401197['contact']=_0x58cbc5;}if(_0x471f7c){_0x401197[_0x66fb('0x16')]=_0x471f7c;}return _0x401197;}function isEmail(_0x38cae9){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))*$/[_0x66fb('0x17')](_0x38cae9);}function checkRow(_0x27963d,_0x5019e4,_0x3a0616){return new BPromise(function(_0x5377d2,_0x433ba9){if(_[_0x66fb('0x18')](_0x27963d)){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3a0616));}if(_0x27963d[_0x66fb('0x19')]&&_0x27963d[_0x66fb('0x19')]['length']){var _0x4991bb=_[_0x66fb('0x1a')](_0x27963d[_0x66fb('0x19')],'message')[_0x66fb('0x1b')](';');return _0x433ba9(handleCheckRowError('error',_0x4991bb,null,_0x3a0616));}var _0x5277e9={};for(var _0x5cded9 in FIELDS){if(FIELDS[_0x66fb('0x1c')](_0x5cded9)&&FIELDS[_0x5cded9]){_0x5277e9[_0x5cded9]=_0x27963d['data'][0x0][FIELDS[_0x5cded9]]||_0x27963d[_0x66fb('0x1d')][0x0]['\ufeff'+FIELDS[_0x5cded9]];}}if(!_0x5277e9['firstName']){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x1e'),null,_0x3a0616));}if(!_0x5277e9[_0x66fb('0x1f')]){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x20'),null,_0x3a0616));}if(_0x5277e9['birthDate']){var _0x47df90=moment(_0x5277e9[_0x66fb('0x21')],_0x66fb('0x22'));if(!_0x47df90[_0x66fb('0x23')]()){return _0x433ba9(handleCheckRowError('error',_0x66fb('0x24'),null,_0x3a0616));}}if(_0x5277e9[_0x66fb('0x25')]){if(!isEmail(_0x5277e9['email'])){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x26'),null,_0x3a0616));}}_0x5277e9['ListId']=LISTID;_0x5277e9[_0x66fb('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x5019e4){var _0x54d02c={};for(var _0x46d335=0x0,_0x576421=DUPLICATES[_0x66fb('0x28')];_0x46d335<_0x576421;_0x46d335+=0x1){_0x54d02c[DUPLICATES[_0x46d335]]=_0x5277e9[DUPLICATES[_0x46d335]];}var _0x2a2158=_[_0x66fb('0x29')](_0x5019e4,_0x54d02c);if(_0x2a2158){return _0x433ba9(handleCheckRowError(_0x66fb('0x2a'),'Duplicate\x20Contact',_0x2a2158,_0x3a0616));}}return db[_0x66fb('0x2b')][_0x66fb('0x2c')](_0x5277e9,{'raw':!![],'hooks':![],'fields':_['keys'](_0x5277e9)})['then'](function(_0x4f04b4){if(DUPLICATES&&DUPLICATES[_0x66fb('0x28')]&&_0x5019e4){_0x5019e4[_0x66fb('0x2d')](_[_0x66fb('0x2e')](_0x5277e9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4f04b4['id'];return _0x5377d2();})[_0x66fb('0x2f')](function(_0x39bc7b){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x30')+(_0x39bc7b[_0x66fb('0x31')]||JSON['stringify'](_0x39bc7b)),null,_0x3a0616));});});}function checkHopper(){function _0x27c1e3(){return function(_0x244861){logger[_0x66fb('0x15')](_0x66fb('0x32'),_0x66fb('0x33'),util[_0x66fb('0x34')](_0x244861,{'showHidden':![],'depth':null}));};}var _0xc9721e=function(_0x5adc24,_0x23d0fb){var _0x26c8e1=squel[_0x66fb('0x35')]()[_0x66fb('0x36')](_0x66fb('0x37'))[_0x66fb('0x38')]([_0x66fb('0x1f'),_0x66fb('0x39'),'ContactId',_0x66fb('0x3a'),_0x23d0fb,'createdAt',_0x66fb('0x3b')],squel['select']()['field'](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x39'))['field']('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x5adc24['id'][_0x66fb('0x3f')](),_0x23d0fb)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')]('NOW()',_0x66fb('0x3b'))['from'](_0x66fb('0x40'))[_0x66fb('0x41')]('deletedAt\x20IS\x20NULL')[_0x66fb('0x41')](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())[_0x66fb('0x41')](_0x66fb('0x43'))['where'](_0x66fb('0x44'),squel[_0x66fb('0x45')]()[_0x66fb('0x3c')]('phone')['from'](_0x66fb('0x37'))['where'](_0x23d0fb+_0x66fb('0x46'),_0x5adc24['id'][_0x66fb('0x3f')]())))[_0x66fb('0x3f')]();return _0x26c8e1;};var _0x524b18=function(_0x45d173,_0x56ef3b){var _0xe0d68d=squel[_0x66fb('0x35')]()['into'](_0x66fb('0x37'))['fromQuery']([_0x66fb('0x1f'),_0x66fb('0x39'),'ContactId',_0x66fb('0x3a'),_0x56ef3b,_0x66fb('0x47'),_0x66fb('0x3b')],squel['select']()[_0x66fb('0x3c')](_0x66fb('0x1f'),'phone')[_0x66fb('0x3c')]('NOW()',_0x66fb('0x39'))[_0x66fb('0x3c')]('id','ContactId')[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x45d173['id'][_0x66fb('0x3f')](),_0x56ef3b)[_0x66fb('0x3c')]('NOW()',_0x66fb('0x47'))[_0x66fb('0x3c')]('NOW()','updatedAt')[_0x66fb('0x48')](_0x66fb('0x40'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())['where'](_0x66fb('0x49'),squel['str'](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x66fb('0x45')]()[_0x66fb('0x3c')]('calleridnum')[_0x66fb('0x48')](_0x66fb('0x4a'))['where'](_0x56ef3b+_0x66fb('0x46'),_0x45d173['id'][_0x66fb('0x3f')]()))['where'](_0x66fb('0x44'),squel['select']()[_0x66fb('0x3c')](_0x66fb('0x1f'))['from'](_0x66fb('0x37'))[_0x66fb('0x41')](_0x56ef3b+'\x20=\x20?',_0x45d173['id']['toString']())))[_0x66fb('0x3f')]();return _0xe0d68d;};function _0x58d22a(_0x2287b8,_0x112223){var _0x212a10=squel[_0x66fb('0x35')]()[_0x66fb('0x36')]('cm_hopper')[_0x66fb('0x38')](['phone',_0x66fb('0x39'),_0x66fb('0x3e'),_0x66fb('0x3a'),_0x112223,_0x66fb('0x47'),_0x66fb('0x3b')],squel[_0x66fb('0x45')]()[_0x66fb('0x3c')](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')](_0x66fb('0x3d'),'scheduledAt')[_0x66fb('0x3c')]('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x2287b8['id'][_0x66fb('0x3f')](),_0x112223)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x3b'))[_0x66fb('0x48')]('cm_contacts')[_0x66fb('0x41')]('deletedAt\x20IS\x20NULL')[_0x66fb('0x41')](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())[_0x66fb('0x41')](_0x66fb('0x49'),squel[_0x66fb('0x4b')](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43')))[_0x66fb('0x3f')]();return _0x212a10;}function _0x35cb5a(_0x3cc49d,_0xdaea94){var _0x388b27=squel[_0x66fb('0x35')]()[_0x66fb('0x36')](_0x66fb('0x4c'))[_0x66fb('0x38')]([_0x66fb('0x1f'),_0x66fb('0x3e'),'ListId',_0xdaea94,_0x66fb('0x47'),_0x66fb('0x3b')],squel[_0x66fb('0x45')]()['field'](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')]('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x3cc49d['id'][_0x66fb('0x3f')](),_0xdaea94)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x3b'))['from'](_0x66fb('0x40'))[_0x66fb('0x41')](_0x66fb('0x4d'))[_0x66fb('0x41')](_0x66fb('0x42'),LISTID['toString']())[_0x66fb('0x41')](_0x66fb('0x49'),squel['str'](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43')))[_0x66fb('0x3f')]();return _0x388b27;}return db[_0x66fb('0x4e')]['findAll']({'where':{'type':_0x66fb('0x4f')},'attributes':['id',_0x66fb('0x50')],'include':[{'model':db[_0x66fb('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x34b551){var _0x443c9e=[];if(_0x34b551){var _0x571c88;for(var _0x202892=0x0,_0x507994;_0x202892<_0x34b551[_0x66fb('0x28')];_0x202892+=0x1){_0x507994=_0x34b551[_0x202892]['get']({'plain':!![]});switch(_0x507994[_0x66fb('0x50')]){case _0x66fb('0x53'):_0x443c9e['push'](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x524b18(_0x507994,'VoiceQueueId'))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;case'onlyIfOpen':_0x443c9e[_0x66fb('0x2d')](db['sequelize'][_0x66fb('0x55')](_0xc9721e(_0x507994,_0x66fb('0x56')))['then'](function(){})['catch'](_0x27c1e3()));break;default:_0x443c9e[_0x66fb('0x2d')](db['sequelize'][_0x66fb('0x55')](_0x58d22a(_0x507994,'VoiceQueueId'))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}}return _0x443c9e;})['all']()['then'](function(){return db['VoiceQueue'][_0x66fb('0x57')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x66fb('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x2dc4b0){var _0x5d9a53=[];if(_0x2dc4b0){var _0x3a8639;for(var _0x18db8f=0x0,_0x3efcfa;_0x18db8f<_0x2dc4b0['length'];_0x18db8f+=0x1){_0x3efcfa=_0x2dc4b0[_0x18db8f][_0x66fb('0x58')]({'plain':!![]});_0x5d9a53['push'](db[_0x66fb('0x54')]['query'](_0x35cb5a(_0x3efcfa,_0x66fb('0x56')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}return _0x5d9a53;})[_0x66fb('0x59')]();})[_0x66fb('0x52')](function(){return db[_0x66fb('0x5a')]['findAll']({'attributes':['id',_0x66fb('0x50')],'include':[{'model':db['CmList'],'as':_0x66fb('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x4c832f){var _0x1b03c0=[];if(_0x4c832f){for(var _0x54f916=0x0,_0x2d6005;_0x54f916<_0x4c832f[_0x66fb('0x28')];_0x54f916+=0x1){_0x2d6005=_0x4c832f[_0x54f916][_0x66fb('0x58')]({'plain':!![]});switch(_0x2d6005[_0x66fb('0x50')]){case'always':_0x1b03c0[_0x66fb('0x2d')](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x524b18(_0x2d6005,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;case'onlyIfOpen':_0x1b03c0['push'](db[_0x66fb('0x54')][_0x66fb('0x55')](_0xc9721e(_0x2d6005,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;default:_0x1b03c0['push'](db['sequelize'][_0x66fb('0x55')](_0x58d22a(_0x2d6005,'CampaignId'))['then'](function(){})['catch'](_0x27c1e3()));}}}return _0x1b03c0;})['all']();})[_0x66fb('0x52')](function(){return db['Campaign'][_0x66fb('0x57')]({'attributes':['id'],'include':[{'model':db[_0x66fb('0x51')],'as':_0x66fb('0x5d'),'where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x27cf78){var _0x474a16=[];if(_0x27cf78){for(var _0x164564=0x0,_0x339dd3;_0x164564<_0x27cf78[_0x66fb('0x28')];_0x164564+=0x1){_0x339dd3=_0x27cf78[_0x164564][_0x66fb('0x58')]({'plain':!![]});_0x474a16[_0x66fb('0x2d')](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x35cb5a(_0x339dd3,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}return _0x474a16;})[_0x66fb('0x59')]();})[_0x66fb('0x2f')](function(_0x50286f){logger['error']('cmContact,\x20%s,\x20%s',_0x66fb('0x5e'),_0x50286f[_0x66fb('0x31')]);});}var processPromises=function(_0x13d357){return BPromise[_0x66fb('0x59')](promises)[_0x66fb('0x52')](function(_0x115ce4){})['catch'](function(_0x4fd848){logger[_0x66fb('0x15')](_0x66fb('0x5f'),JSON['stringify'](_0x4fd848));})[_0x66fb('0x60')](function(){socket['emit'](_0x66fb('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x13d357){return _0x13d357[_0x66fb('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x66fb('0x52')](function(){socket[_0x66fb('0x63')](_0x66fb('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x66fb('0x64')](FILEPATH);}catch(_0x430186){logger['error'](_0x66fb('0x65'),JSON[_0x66fb('0x66')](_0x430186));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x66fb('0x67')](_0x66fb('0x68'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x66fb('0x12')](',');return db['CmContact'][_0x66fb('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x66fb('0x52')](function(_0x3873ca){var _0x522d56=fs[_0x66fb('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x66fb('0x6a')](_0x522d56,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1efe2f,_0x14a3b4){total+=0x1;var _0x357c11=total;promises[_0x66fb('0x2d')](checkRow(_0x1efe2f,_0x3873ca,_0x357c11)['then'](function(){success+=0x1;})[_0x66fb('0x2f')](function(_0x124d4a){if(_0x124d4a[_0x66fb('0x15')]){errors+=0x1;delete _0x124d4a['error'];}else if(_0x124d4a[_0x66fb('0x2a')]){duplicates+=0x1;delete _0x124d4a[_0x66fb('0x2a')];}rows[_0x66fb('0x2d')](_0x124d4a);}));if(total%0xc8===0x0){_0x14a3b4[_0x66fb('0x6b')]();return processPromises(_0x14a3b4);}},'complete':function(){return processPromises()[_0x66fb('0x52')](function(){logger[_0x66fb('0x67')](_0x66fb('0x6c'));endCsv();});},'error':function(_0x3e6c85,_0x203668){logger[_0x66fb('0x67')](_0x66fb('0x6d'),JSON[_0x66fb('0x66')](_0x3e6c85));endCsv();}});})[_0x66fb('0x2f')](function(_0x179849){logger[_0x66fb('0x15')](_0x66fb('0x6e'),JSON[_0x66fb('0x66')](_0x179849));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 421b201..e75e5db 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 _0x034d=['redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','data','length','errors','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x034d,0x193));var _0xd034=function(_0x5a5f28,_0x4df93b){_0x5a5f28=_0x5a5f28-0x0;var _0x49b893=_0x034d[_0x5a5f28];return _0x49b893;};'use strict';var fs=require('fs');var path=require(_0xd034('0x0'));var _=require(_0xd034('0x1'));var Papa=require('papaparse');var util=require(_0xd034('0x2'));var BPromise=require(_0xd034('0x3'));var moment=require(_0xd034('0x4'));var squel=require(_0xd034('0x5'));var Redis=require(_0xd034('0x6'));var db=require(_0xd034('0x7'))['db'];var config=require(_0xd034('0x8'));var logger=require(_0xd034('0x9'))(_0xd034('0xa'));config[_0xd034('0xb')]=_[_0xd034('0xc')](config[_0xd034('0xb')],{'host':_0xd034('0xd'),'port':0x18eb});var socket=require(_0xd034('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xd034('0xf'));function isEmail(_0x3837fb){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'](_0x3837fb);}function selectNotIn(_0x113051,_0x2927e8,_0x36fc4f,_0x224d6c,_0x51ec57){return squel[_0xd034('0x10')]()[_0xd034('0x11')]('phone')[_0xd034('0x12')](_0x224d6c)[_0xd034('0x13')](_0x2927e8,null,_0x2927e8+_0xd034('0x14')+_0x224d6c+'.'+_0x36fc4f)[_0xd034('0x15')](_0x224d6c+'.'+_0x36fc4f+_0xd034('0x16')+_0x113051+'.'+_0x36fc4f)['where'](_0x2927e8+'.dialCheckDuplicateType\x20IN\x20('+_0x51ec57[_0xd034('0x13')]()+')');}function insertCmHopper(_0x30c341,_0xfc0d58,_0x4cde45,_0x4475b6,_0x1b35b4){var _0x4bbde9=[_0xd034('0x17'),_0xd034('0x18'),_0xd034('0x19'),_0xd034('0x1a'),_0xfc0d58+'.'+_0x4475b6,'cm_contacts.createdAt',_0xd034('0x1b'),_0xd034('0x1c'),_0xd034('0x1d'),'\x22'+_0x1b35b4+'\x22'];return squel[_0xd034('0x1e')]()[_0xd034('0x1f')](_0xd034('0x20'))[_0xd034('0x21')]([_0xd034('0x22'),_0xd034('0x23'),_0xd034('0x24'),_0xd034('0x25'),_0x4475b6,_0xd034('0x26'),_0xd034('0x27'),'priority',_0xd034('0x28'),_0xd034('0x29')],squel[_0xd034('0x10')]()[_0xd034('0x2a')](_0x4bbde9)[_0xd034('0x12')](_0xfc0d58)[_0xd034('0x13')](_0xd034('0x2b'),null,_0xd034('0x2c')+_0xfc0d58+_0xd034('0x2d'))[_0xd034('0x13')](_0x4cde45,null,_0x4cde45+_0xd034('0x14')+_0xfc0d58+'.'+_0x4475b6)[_0xd034('0x15')](_0xfc0d58+_0xd034('0x2e'),_0x30c341)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd034('0x15')](_0xd034('0x2f'),selectNotIn(_0xfc0d58,_0x4cde45,_0x4475b6,_0xd034('0x20'),[_0xd034('0x30'),_0xd034('0x31')]))[_0xd034('0x15')](_0xd034('0x2f'),selectNotIn(_0xfc0d58,_0x4cde45,_0x4475b6,_0xd034('0x20'),['\x22always\x22'])))[_0xd034('0x32')]();}function insertCmHopperBlack(_0x1989ca,_0x146243,_0x350512,_0xf15c09){var _0x36c854=[_0xd034('0x17'),'cm_contacts.id',_0xd034('0x1a'),_0x146243+'.'+_0xf15c09,_0xd034('0x33'),_0xd034('0x1b')];return squel[_0xd034('0x1e')]()[_0xd034('0x1f')](_0xd034('0x34'))[_0xd034('0x21')]([_0xd034('0x22'),'ContactId',_0xd034('0x25'),_0xf15c09,_0xd034('0x26'),_0xd034('0x27')],squel[_0xd034('0x10')]()['fields'](_0x36c854)['from'](_0x146243)[_0xd034('0x13')](_0xd034('0x2b'),null,'cm_contacts.ListId\x20=\x20'+_0x146243+_0xd034('0x2d'))[_0xd034('0x13')](_0x350512,null,_0x350512+_0xd034('0x14')+_0x146243+'.'+_0xf15c09)[_0xd034('0x15')](_0x146243+_0xd034('0x2e'),_0x1989ca)['where'](_0xd034('0x35'),NOW)[_0xd034('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd034('0x10')]()['field'](_0xd034('0x22'))['from']('cm_hopper_black')[_0xd034('0x15')](_0xd034('0x36'),_0x1989ca)[_0xd034('0x15')](_0xf15c09+_0xd034('0x37'),_0x146243+'.'+_0xf15c09)))['toString']();}function insertCmContact(_0x1b1f96,_0x47dc7f,_0x19dbc1,_0x5d2de4){var _0x352164=_[_0xd034('0x38')](_['keys'](_0x5d2de4),[_0xd034('0x25'),_0xd034('0x39'),_0xd034('0x26'),_0xd034('0x27')]);return squel[_0xd034('0x1e')]()[_0xd034('0x1f')](_0xd034('0x2b'))[_0xd034('0x21')](_0x352164,squel[_0xd034('0x10')]()['fields'](_0x352164)['from'](_0x47dc7f)[_0xd034('0x15')]('('+_0x19dbc1[_0xd034('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0xd034('0x10')]()[_0xd034('0x2a')](_0x19dbc1)[_0xd034('0x12')](_0xd034('0x2b'))[_0xd034('0x15')]('ListId\x20=\x20?',_0x1b1f96)[_0xd034('0x15')](_0xd034('0x3a')))[_0xd034('0x15')](_0xd034('0x3b'),squel[_0xd034('0x10')]()[_0xd034('0x11')](_0xd034('0x3c'),_0xd034('0x3d'))[_0xd034('0x12')](_0x47dc7f)['group'](_0x19dbc1['join'](','))))[_0xd034('0x32')]();}function handleStop(){logger[_0xd034('0x3e')](_0xd034('0x3f'));stopped=!![];}function handleUncaughtException(_0x167265){logger[_0xd034('0x40')](_0x167265[_0xd034('0x41')]);process[_0xd034('0x42')](0x1);}function handleError(_0x175181,_0x56625b){stats['errors'][_0xd034('0x43')]({'name':_0x56625b[_0xd034('0x44')],'message':_0x56625b[_0xd034('0x41')],'row':_0x175181});}function handleQuery(_0x4aa718){logger[_0xd034('0x3e')](_0x4aa718);return db[_0xd034('0x45')][_0xd034('0x46')](_0x4aa718)[_0xd034('0x47')](function(_0x198a57){results[_0xd034('0x43')](_0x198a57);})[_0xd034('0x48')](function(_0x1b7c27){logger[_0xd034('0x40')](_0x1b7c27['message']);});}function main(_0x155922,_0xb3d3c4,_0x781db7,_0x163d24){logger['info'](_0xd034('0x49'),_0x155922,JSON[_0xd034('0x4a')](_0xb3d3c4));process[_0xd034('0x4b')]('start');var _0x427277=_0xb3d3c4[_0xd034('0x4c')];var _0x57d2db=_0xb3d3c4[_0xd034('0x4d')];var _0x434b78=path[_0xd034('0x13')](config[_0xd034('0x4e')],_0xd034('0x4f'),_0x57d2db+_0xd034('0x50'));var _0x1c932e=_[_0xd034('0x51')](_0x427277)[_0xd034('0x13')]();logger[_0xd034('0x3e')](_0xd034('0x52'),_0x1c932e);fs[_0xd034('0x53')](_0x434b78,_0x1c932e+'\x0a');Papa[_0xd034('0x54')](fs[_0xd034('0x55')](_0x155922),{'header':!![],'skipEmptyLines':!![],'step':function(_0x43c8bd,_0x485d7a){try{for(var _0x957e9d=0x0,_0x2a0b0f=[];_0x957e9d<_0x43c8bd[_0xd034('0x56')][_0xd034('0x57')];_0x957e9d++){stats['rows']+=0x1;if(_0x43c8bd['errors'][_0x957e9d]){handleError(_0x43c8bd[_0xd034('0x56')][_0x957e9d],_0x43c8bd[_0xd034('0x58')][_0x957e9d]);}else{var _0x558c99=[];for(var _0x11bfa6 in _0x427277){if(_0x427277[_0xd034('0x59')](_0x11bfa6)){if(_0x43c8bd['data'][_0x957e9d][_0x427277[_0x11bfa6]]){var _0x3169d5=_['trim'](_0x43c8bd[_0xd034('0x56')][_0x957e9d][_0x427277[_0x11bfa6]][_0xd034('0x5a')](/"/g,'\x27'));switch(_0x11bfa6){case _0xd034('0x23'):var _0xca52ba=moment(_0x3169d5,_0xd034('0xf'),!![]);if(_0xca52ba[_0xd034('0x5b')]()){_0x2a0b0f[_0xd034('0x43')]('\x22'+_0x3169d5+'\x22');}else{_0x558c99[_0xd034('0x43')](_0xd034('0x5c'));}break;case'priority':var _0x4c54f9=parseInt(_0x3169d5);_0x3169d5=_['isNaN'](_0x4c54f9)||_0x4c54f9<0x0||_0x4c54f9>0x4?_0x163d24?0x3:0x2:_0x4c54f9;_0x2a0b0f[_0xd034('0x43')]('\x22'+_0x3169d5+'\x22');break;case _0xd034('0x28'):var _0x6eee51=parseInt(_0x3169d5);if(_[_0xd034('0x5d')](_0x6eee51)&&_[_0xd034('0x5e')](_0x781db7,_0x6eee51)){_0x2a0b0f[_0xd034('0x43')]('\x22'+_0x6eee51+'\x22');}else{_0x558c99[_0xd034('0x43')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x3169d5)){_0x2a0b0f['push']('\x22'+_0x3169d5+'\x22');}else{_0x558c99[_0xd034('0x43')](_0xd034('0x5f'));}break;case _0xd034('0x60'):var _0x8c26b8=moment(_0x3169d5,_0xd034('0x61'),!![]);if(_0x8c26b8[_0xd034('0x5b')]()){_0x2a0b0f['push']('\x22'+_0x3169d5+'\x22');}else{_0x558c99[_0xd034('0x43')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2a0b0f[_0xd034('0x43')]('\x22'+_0x3169d5+'\x22');}}else{switch(_0x11bfa6){case _0xd034('0x62'):case _0xd034('0x22'):_0x558c99[_0xd034('0x43')](_0x11bfa6+'\x20not\x20specified');break;default:_0x2a0b0f[_0xd034('0x43')]('\x22\x22');}}}}if(_0x558c99[_0xd034('0x57')]){handleError(_0x43c8bd[_0xd034('0x56')][_0x957e9d],{'code':_0xd034('0x63'),'message':_0x558c99['join']()});}else{fs[_0xd034('0x64')](_0x434b78,_0x2a0b0f[_0xd034('0x13')]()+'\x0a');}_0x2a0b0f=[];}if(!(stats[_0xd034('0x65')]%0xc8)){socket[_0xd034('0x66')](_0xd034('0x67')+_0x57d2db,stats);stats[_0xd034('0x58')]=[];}}if(stopped){logger[_0xd034('0x3e')](_0xd034('0x68'));_0x485d7a[_0xd034('0x69')]();}}catch(_0x391bdd){handleError(_0x43c8bd[_0xd034('0x56')][_0x957e9d],{'code':'SystemError','message':_0x391bdd[_0xd034('0x41')]});logger[_0xd034('0x40')](_0xd034('0x6a'),_0x391bdd[_0xd034('0x41')]);}},'complete':function(){try{var _0x51a8c1=[];var _0xf4cd94=_0xd034('0x2b');if(_0xb3d3c4[_0xd034('0x6b')]&&_0xb3d3c4[_0xd034('0x6b')][_0xd034('0x57')]){_0xf4cd94=_0xd034('0x6c')+_0x57d2db;_0x51a8c1[_0xd034('0x43')](_0xd034('0x6d')+_0xf4cd94+'\x20LIKE\x20cm_contacts;');}var _0x382fd5=util[_0xd034('0x6e')](_0xd034('0x6f'),_0x434b78,_0xf4cd94,_0x1c932e,_0xb3d3c4['ListId'],_0xb3d3c4[_0xd034('0x39')]||null,NOW,NOW);if(_[_0xd034('0x70')](_0x427277['scheduledat'])){_0x382fd5+=_0xd034('0x71');}_0x51a8c1[_0xd034('0x43')](_0x382fd5);if(_0xb3d3c4[_0xd034('0x6b')]&&_0xb3d3c4[_0xd034('0x6b')][_0xd034('0x57')]){_0x51a8c1[_0xd034('0x43')](insertCmContact(_0xb3d3c4[_0xd034('0x25')],_0xf4cd94,_0xb3d3c4[_0xd034('0x6b')],_0x427277));_0x51a8c1[_0xd034('0x43')](_0xd034('0x72')+_0xf4cd94+';');}_0x51a8c1['push'](insertCmHopper(_0xb3d3c4[_0xd034('0x25')],_0xd034('0x73'),_0xd034('0x74'),_0xd034('0x75'),_0x163d24));_0x51a8c1['push'](insertCmHopperBlack(_0xb3d3c4['ListId'],_0xd034('0x76'),_0xd034('0x74'),_0xd034('0x75')));_0x51a8c1[_0xd034('0x43')](insertCmHopper(_0xb3d3c4[_0xd034('0x25')],'campaigns_has_cm_lists',_0xd034('0x77'),'CampaignId',_0x163d24));_0x51a8c1[_0xd034('0x43')](insertCmHopperBlack(_0xb3d3c4[_0xd034('0x25')],_0xd034('0x78'),_0xd034('0x77'),_0xd034('0x79')));BPromise[_0xd034('0x7a')](_0x51a8c1,handleQuery)[_0xd034('0x7b')](function(_0x496f6b){stats[_0xd034('0x7c')]=!![];stats[_0xd034('0x7d')]=_0xb3d3c4[_0xd034('0x6b')]&&_0xb3d3c4[_0xd034('0x6b')][_0xd034('0x57')]?results[0x2][_0xd034('0x7d')]:results[0x0][_0xd034('0x7d')];socket['emit'](_0xd034('0x67')+_0x57d2db,stats);fs[_0xd034('0x7e')](_0x155922);fs[_0xd034('0x7e')](_0x434b78);process[_0xd034('0x42')](0x0);})[_0xd034('0x48')](function(_0x1aa70e){logger[_0xd034('0x40')](_0x1aa70e[_0xd034('0x41')]);process['exit'](0x1);});}catch(_0xc286c6){logger[_0xd034('0x40')]('complete',_0xc286c6['message']);process['exit'](0x1);}},'error':function(_0x2a7fd6,_0x550b98,_0xe084a7,_0x24bf1e){throw new Error(_0x24bf1e);}});}function validate(){if(process[_0xd034('0x7f')]&&process[_0xd034('0x7f')][_0xd034('0x57')]<0x4){throw new Error(_0xd034('0x80'));}var _0x5064ef=path[_0xd034('0x13')](config[_0xd034('0x4e')],_0xd034('0x4f'),process[_0xd034('0x7f')][0x2]);if(!fs[_0xd034('0x81')](_0x5064ef)){throw new Error(_0xd034('0x82'));}var _0x1ca0f8={};try{_0x1ca0f8=JSON[_0xd034('0x54')](process[_0xd034('0x7f')][0x3]);if(!_0x1ca0f8[_0xd034('0x4c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x1ca0f8['binding'][_0xd034('0x22')]){throw new Error(_0xd034('0x83'));}if(!_0x1ca0f8[_0xd034('0x4c')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x1b9926=0x0;if(_0x1ca0f8[_0xd034('0x4c')][_0xd034('0x28')]){_0x1b9926=0x1;}if(!_0x1ca0f8[_0xd034('0x25')]){throw new Error(_0xd034('0x84'));}}catch(_0x28ed66){throw new Error(_0xd034('0x85'));}var _0x576636=[];try{_0x576636=_[_0xd034('0x86')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x3b71f3){logger[_0xd034('0x3e')](_0xd034('0x87'));}main(_0x5064ef,_0x1ca0f8,_0x576636,_0x1b9926);}validate();process['on'](_0xd034('0x88'),handleStop);process['on'](_0xd034('0x89'),handleUncaughtException); \ No newline at end of file +var _0x99e6=['socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','fields','from','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_hopper_black','cm_contacts','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','toString',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','push','code','sequelize','query','spread','catch','error','stringify','send','socket_timestamp','.csv','keys','header','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','finish','affectedRows','unlink','exit','complete','arguments\x20\x20\x20','root','server/files/tmp','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','defaults','redis','localhost'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x99e6,0x76));var _0x699e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x99e6[_0x2b4411];return _0x8e41ef;};'use strict';var fs=require('fs');var path=require(_0x699e('0x0'));var _=require('lodash');var Papa=require(_0x699e('0x1'));var util=require(_0x699e('0x2'));var BPromise=require(_0x699e('0x3'));var moment=require(_0x699e('0x4'));var squel=require(_0x699e('0x5'));var Redis=require(_0x699e('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x699e('0x7'));var logger=require(_0x699e('0x8'))(_0x699e('0x9'));config['redis']=_[_0x699e('0xa')](config[_0x699e('0xb')],{'host':_0x699e('0xc'),'port':0x18eb});var socket=require(_0x699e('0xd'))(new Redis(config[_0x699e('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x699e('0xe')](_0x699e('0xf'));function isEmail(_0x254da6){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))*$/[_0x699e('0x10')](_0x254da6);}function selectNotIn(_0x3a5590,_0x179b51,_0x5e5adc,_0x28101e,_0xfc17fe){return squel[_0x699e('0x11')]()['field'](_0x699e('0x12'))['from'](_0x28101e)[_0x699e('0x13')](_0x179b51,null,_0x179b51+'.id\x20=\x20'+_0x28101e+'.'+_0x5e5adc)[_0x699e('0x14')](_0x28101e+'.'+_0x5e5adc+'\x20=\x20'+_0x3a5590+'.'+_0x5e5adc)[_0x699e('0x14')](_0x179b51+_0x699e('0x15')+_0xfc17fe[_0x699e('0x13')]()+')');}function insertCmHopper(_0x378fb5,_0x145f36,_0x318f54,_0x3f1b9c,_0x8c1858){var _0x343f7b=[_0x699e('0x16'),_0x699e('0x17'),_0x699e('0x18'),_0x699e('0x19'),_0x145f36+'.'+_0x3f1b9c,_0x699e('0x1a'),_0x699e('0x1b'),_0x699e('0x1c'),'cm_contacts.UserId','\x22'+_0x8c1858+'\x22'];return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x1f'))[_0x699e('0x20')](['phone',_0x699e('0x21'),_0x699e('0x22'),_0x699e('0x23'),_0x3f1b9c,_0x699e('0x24'),_0x699e('0x25'),'priority','UserId','recallme'],squel['select']()[_0x699e('0x26')](_0x343f7b)[_0x699e('0x27')](_0x145f36)[_0x699e('0x13')]('cm_contacts',null,_0x699e('0x28')+_0x145f36+'.CmListId')[_0x699e('0x13')](_0x318f54,null,_0x318f54+_0x699e('0x29')+_0x145f36+'.'+_0x3f1b9c)[_0x699e('0x14')](_0x145f36+_0x699e('0x2a'),_0x378fb5)['where'](_0x699e('0x2b'),NOW)[_0x699e('0x14')](_0x699e('0x2c'),selectNotIn(_0x145f36,_0x318f54,_0x3f1b9c,_0x699e('0x1f'),['\x22always\x22',_0x699e('0x2d')]))[_0x699e('0x14')](_0x699e('0x2c'),selectNotIn(_0x145f36,_0x318f54,_0x3f1b9c,_0x699e('0x1f'),[_0x699e('0x2e')])))['toString']();}function insertCmHopperBlack(_0x272314,_0x42cd9e,_0x24899d,_0x337f53){var _0x2a7904=[_0x699e('0x16'),_0x699e('0x18'),_0x699e('0x19'),_0x42cd9e+'.'+_0x337f53,_0x699e('0x1a'),_0x699e('0x1b')];return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x2f'))[_0x699e('0x20')]([_0x699e('0x12'),_0x699e('0x22'),'ListId',_0x337f53,_0x699e('0x24'),_0x699e('0x25')],squel[_0x699e('0x11')]()['fields'](_0x2a7904)['from'](_0x42cd9e)[_0x699e('0x13')](_0x699e('0x30'),null,_0x699e('0x28')+_0x42cd9e+_0x699e('0x31'))[_0x699e('0x13')](_0x24899d,null,_0x24899d+_0x699e('0x29')+_0x42cd9e+'.'+_0x337f53)['where'](_0x42cd9e+_0x699e('0x2a'),_0x272314)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x699e('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x699e('0x11')]()[_0x699e('0x32')]('phone')[_0x699e('0x27')]('cm_hopper_black')[_0x699e('0x14')](_0x699e('0x33'),_0x272314)[_0x699e('0x14')](_0x337f53+_0x699e('0x34'),_0x42cd9e+'.'+_0x337f53)))[_0x699e('0x35')]();}function insertCmContact(_0x576556,_0x17fc33,_0x3976fc,_0x508385){var _0x38315e=_['concat'](_['keys'](_0x508385),[_0x699e('0x23'),'CompanyId','createdAt',_0x699e('0x25')]);return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x30'))[_0x699e('0x20')](_0x38315e,squel[_0x699e('0x11')]()[_0x699e('0x26')](_0x38315e)['from'](_0x17fc33)[_0x699e('0x14')]('('+_0x3976fc['join'](',')+_0x699e('0x36'),squel['select']()[_0x699e('0x26')](_0x3976fc)[_0x699e('0x27')]('cm_contacts')[_0x699e('0x14')](_0x699e('0x33'),_0x576556)[_0x699e('0x14')](_0x699e('0x37')))[_0x699e('0x14')](_0x699e('0x38'),squel[_0x699e('0x11')]()['field'](_0x699e('0x39'),_0x699e('0x3a'))[_0x699e('0x27')](_0x17fc33)[_0x699e('0x3b')](_0x3976fc[_0x699e('0x13')](','))))[_0x699e('0x35')]();}function handleStop(){logger[_0x699e('0x3c')](_0x699e('0x3d'));stopped=!![];}function handleUncaughtException(_0x2ae79f){logger['error'](_0x2ae79f[_0x699e('0x3e')]);process['exit'](0x1);}function handleError(_0x4d2887,_0x249a45){stats['errors'][_0x699e('0x3f')]({'name':_0x249a45[_0x699e('0x40')],'message':_0x249a45[_0x699e('0x3e')],'row':_0x4d2887});}function handleQuery(_0x3ce79e){logger[_0x699e('0x3c')](_0x3ce79e);return db[_0x699e('0x41')][_0x699e('0x42')](_0x3ce79e)[_0x699e('0x43')](function(_0x44b8c2){results[_0x699e('0x3f')](_0x44b8c2);})[_0x699e('0x44')](function(_0x24e638){logger[_0x699e('0x45')](_0x24e638[_0x699e('0x3e')]);});}function main(_0x5b974c,_0x1e6267,_0x3edc24,_0x2d9722){logger['info']('main',_0x5b974c,JSON[_0x699e('0x46')](_0x1e6267));process[_0x699e('0x47')]('start');var _0x46060f=_0x1e6267['binding'];var _0x24d836=_0x1e6267[_0x699e('0x48')];var _0x89f902=path[_0x699e('0x13')](config['root'],'server/files/tmp',_0x24d836+_0x699e('0x49'));var _0x5cd768=_[_0x699e('0x4a')](_0x46060f)[_0x699e('0x13')]();logger[_0x699e('0x3c')](_0x699e('0x4b'),_0x5cd768);fs['writeFileSync'](_0x89f902,_0x5cd768+'\x0a');Papa[_0x699e('0x4c')](fs[_0x699e('0x4d')](_0x5b974c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37227a,_0x53ce13){try{for(var _0x3edb48=0x0,_0x50f74c=[];_0x3edb48<_0x37227a[_0x699e('0x4e')][_0x699e('0x4f')];_0x3edb48++){stats[_0x699e('0x50')]+=0x1;if(_0x37227a[_0x699e('0x51')][_0x3edb48]){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],_0x37227a[_0x699e('0x51')][_0x3edb48]);}else{var _0x2e9b38=[];for(var _0x3b6d39 in _0x46060f){if(_0x46060f[_0x699e('0x52')](_0x3b6d39)){if(_0x37227a['data'][_0x3edb48][_0x46060f[_0x3b6d39]]){var _0x188846=_[_0x699e('0x53')](_0x37227a[_0x699e('0x4e')][_0x3edb48][_0x46060f[_0x3b6d39]]['replace'](/"/g,'\x27'));switch(_0x3b6d39){case _0x699e('0x21'):var _0x792e95=moment(_0x188846,_0x699e('0xf'),!![]);if(_0x792e95[_0x699e('0x54')]()){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38[_0x699e('0x3f')](_0x699e('0x55'));}break;case _0x699e('0x56'):var _0x28a44e=parseInt(_0x188846);_0x188846=_[_0x699e('0x57')](_0x28a44e)||_0x28a44e<0x0||_0x28a44e>0x4?_0x2d9722?0x3:0x2:_0x28a44e;_0x50f74c['push']('\x22'+_0x188846+'\x22');break;case _0x699e('0x58'):var _0x2a1ac9=parseInt(_0x188846);if(_[_0x699e('0x59')](_0x2a1ac9)&&_['includes'](_0x3edc24,_0x2a1ac9)){_0x50f74c['push']('\x22'+_0x2a1ac9+'\x22');}else{_0x2e9b38[_0x699e('0x3f')](_0x699e('0x5a'));}break;case'email':if(isEmail(_0x188846)){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38['push'](_0x699e('0x5b'));}break;case'dateOfBirth':var _0x622679=moment(_0x188846,_0x699e('0x5c'),!![]);if(_0x622679[_0x699e('0x54')]()){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38['push'](_0x699e('0x5d'));}break;default:_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}}else{switch(_0x3b6d39){case _0x699e('0x5e'):case _0x699e('0x12'):_0x2e9b38['push'](_0x3b6d39+'\x20not\x20specified');break;default:_0x50f74c[_0x699e('0x3f')]('\x22\x22');}}}}if(_0x2e9b38[_0x699e('0x4f')]){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],{'code':_0x699e('0x5f'),'message':_0x2e9b38['join']()});}else{fs[_0x699e('0x60')](_0x89f902,_0x50f74c[_0x699e('0x13')]()+'\x0a');}_0x50f74c=[];}if(!(stats[_0x699e('0x50')]%0xc8)){socket[_0x699e('0x61')](_0x699e('0x62')+_0x24d836,stats);stats[_0x699e('0x51')]=[];}}if(stopped){logger[_0x699e('0x3c')]('Abort\x20parser');_0x53ce13[_0x699e('0x63')]();}}catch(_0x3835f4){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],{'code':'SystemError','message':_0x3835f4[_0x699e('0x3e')]});logger[_0x699e('0x45')]('step',_0x3835f4[_0x699e('0x3e')]);}},'complete':function(){try{var _0x5b7c53=[];var _0x4537e6='cm_contacts';if(_0x1e6267[_0x699e('0x64')]&&_0x1e6267['duplicates'][_0x699e('0x4f')]){_0x4537e6=_0x699e('0x65')+_0x24d836;_0x5b7c53['push'](_0x699e('0x66')+_0x4537e6+_0x699e('0x67'));}var _0x3a8226=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x89f902,_0x4537e6,_0x5cd768,_0x1e6267[_0x699e('0x23')],_0x1e6267[_0x699e('0x68')]||null,NOW,NOW);if(_['isNil'](_0x46060f[_0x699e('0x21')])){_0x3a8226+=',\x20scheduledAt\x20=\x20NOW()';}_0x5b7c53['push'](_0x3a8226);if(_0x1e6267[_0x699e('0x64')]&&_0x1e6267[_0x699e('0x64')][_0x699e('0x4f')]){_0x5b7c53[_0x699e('0x3f')](insertCmContact(_0x1e6267[_0x699e('0x23')],_0x4537e6,_0x1e6267[_0x699e('0x64')],_0x46060f));_0x5b7c53['push'](_0x699e('0x69')+_0x4537e6+';');}_0x5b7c53['push'](insertCmHopper(_0x1e6267['ListId'],'voice_queues_has_cm_lists',_0x699e('0x6a'),'VoiceQueueId',_0x2d9722));_0x5b7c53[_0x699e('0x3f')](insertCmHopperBlack(_0x1e6267[_0x699e('0x23')],'voice_queues_has_cm_blacklists','voice_queues',_0x699e('0x6b')));_0x5b7c53['push'](insertCmHopper(_0x1e6267['ListId'],_0x699e('0x6c'),_0x699e('0x6d'),_0x699e('0x6e'),_0x2d9722));_0x5b7c53[_0x699e('0x3f')](insertCmHopperBlack(_0x1e6267[_0x699e('0x23')],'campaigns_has_cm_blacklists',_0x699e('0x6d'),_0x699e('0x6e')));BPromise[_0x699e('0x6f')](_0x5b7c53,handleQuery)['then'](function(_0x129c6f){stats[_0x699e('0x70')]=!![];stats['affectedRows']=_0x1e6267[_0x699e('0x64')]&&_0x1e6267[_0x699e('0x64')][_0x699e('0x4f')]?results[0x2][_0x699e('0x71')]:results[0x0][_0x699e('0x71')];socket[_0x699e('0x61')](_0x699e('0x62')+_0x24d836,stats);fs[_0x699e('0x72')](_0x5b974c);fs[_0x699e('0x72')](_0x89f902);process[_0x699e('0x73')](0x0);})['catch'](function(_0x8b92d1){logger[_0x699e('0x45')](_0x8b92d1[_0x699e('0x3e')]);process[_0x699e('0x73')](0x1);});}catch(_0x5b3c73){logger[_0x699e('0x45')](_0x699e('0x74'),_0x5b3c73[_0x699e('0x3e')]);process[_0x699e('0x73')](0x1);}},'error':function(_0x34b6d0,_0x359167,_0x4aed1b,_0x21c078){throw new Error(_0x21c078);}});}function validate(){if(process['argv']&&process['argv'][_0x699e('0x4f')]<0x4){throw new Error(_0x699e('0x75'));}var _0x2fe71e=path[_0x699e('0x13')](config[_0x699e('0x76')],_0x699e('0x77'),process[_0x699e('0x78')][0x2]);if(!fs[_0x699e('0x79')](_0x2fe71e)){throw new Error(_0x699e('0x7a'));}var _0x1ccb18={};try{_0x1ccb18=JSON[_0x699e('0x4c')](process[_0x699e('0x78')][0x3]);if(!_0x1ccb18['binding']){throw new Error(_0x699e('0x7b'));}if(!_0x1ccb18[_0x699e('0x7c')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x1ccb18[_0x699e('0x7c')]['firstName']){throw new Error(_0x699e('0x7d'));}var _0x420c59=0x0;if(_0x1ccb18[_0x699e('0x7c')][_0x699e('0x58')]){_0x420c59=0x1;}if(!_0x1ccb18[_0x699e('0x23')]){throw new Error(_0x699e('0x7e'));}}catch(_0x5e5804){throw new Error('body\x20id\x20mandatory');}var _0x2bbeef=[];try{_0x2bbeef=_[_0x699e('0x7f')](JSON[_0x699e('0x4c')](process[_0x699e('0x78')][0x4]),'id');}catch(_0x23652a){logger[_0x699e('0x3c')](_0x699e('0x80'));}main(_0x2fe71e,_0x1ccb18,_0x2bbeef,_0x420c59);}validate();process['on'](_0x699e('0x81'),handleStop);process['on'](_0x699e('0x82'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index a643cd2..08b0969 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cd0=['Agent\x20Number','Agent\x20Ring','agentcalledAt','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','***\x20Time\x20Info\x20***','answertime','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','destexten','Queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x9cd0,0xe9));var _0x09cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cd0[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0x09cd('0x0')]=function(_0x1bb551,_0x50e271){var _0x203313=[{'type':'string','content':_0x09cd('0x1'),'variableName':null}];switch(_0x1bb551['toLowerCase']()){case _0x09cd('0x2'):switch(_0x50e271[_0x09cd('0x3')]()){case _0x09cd('0x4'):_0x203313[_0x09cd('0x5')]({'type':_0x09cd('0x6'),'content':'','variableName':_0x09cd('0x7')});_0x203313['push']({'type':'variable','content':'','variableName':_0x09cd('0x8')});break;case _0x09cd('0x9'):_0x203313[_0x09cd('0x5')]({'type':_0x09cd('0xa'),'content':_0x09cd('0xb'),'variableName':null});_0x203313[_0x09cd('0x5')]({'type':'variable','content':'','variableName':_0x09cd('0xc')});break;}}return _0x203313;};exports['getDescriptions']=function(_0x475ef5,_0x4b0a0a){var _0x547d9e=[];switch(_0x475ef5[_0x09cd('0x3')]()){case _0x09cd('0x2'):switch(_0x4b0a0a[_0x09cd('0x3')]()){case'inbound':_0x547d9e=[{'type':_0x09cd('0xa'),'content':_0x09cd('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0xf'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x8')},{'type':'keyValue','content':'','key':_0x09cd('0x10'),'keyType':_0x09cd('0x6'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':'Call\x20To','keyType':'variable','variableName':_0x09cd('0x11')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x12'),'keyType':'variable','variableName':_0x09cd('0x7')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x13'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x14')},{'type':'keyValue','content':'','key':_0x09cd('0x15'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x09cd('0xa'),'content':_0x09cd('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x09cd('0x17'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x18')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x19'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0xc')},{'type':_0x09cd('0xa'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x09cd('0x1a'),'keyType':'variable','variableName':_0x09cd('0x1b')},{'type':_0x09cd('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x1c')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x1d'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x1e')},{'type':'keyValue','content':'','key':_0x09cd('0x1f'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x20')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x21'),'keyType':_0x09cd('0x6'),'variableName':_0x09cd('0x22')}];break;case _0x09cd('0x9'):_0x547d9e=[{'type':_0x09cd('0xa'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x23'),'keyType':_0x09cd('0x6'),'keyContent':'','variableName':_0x09cd('0xc')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x24'),'keyType':_0x09cd('0x6'),'keyContent':'','variableName':'membername'},{'type':_0x09cd('0xe'),'content':'','key':'UniqueId','keyType':_0x09cd('0x6'),'keyContent':'','variableName':_0x09cd('0x14')},{'type':_0x09cd('0xe'),'content':'','key':'Date','keyType':_0x09cd('0x6'),'keyContent':'','variableName':_0x09cd('0x25')},{'type':'string','content':_0x09cd('0x26')},{'type':_0x09cd('0xe'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x09cd('0x27')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x09cd('0x6'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x09cd('0x28')},{'type':_0x09cd('0xe'),'content':'','key':_0x09cd('0x29'),'keyType':_0x09cd('0x6'),'keyContent':'','variableName':_0x09cd('0x2a')}];break;}}return _0x547d9e;}; \ No newline at end of file +var _0x10be=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Member\x20Name','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0x161062,_0x457b6b){var _0x12a1b4=function(_0x505427){while(--_0x505427){_0x161062['push'](_0x161062['shift']());}};_0x12a1b4(++_0x457b6b);}(_0x10be,0x1b8));var _0xe10b=function(_0x40b950,_0x3fb9d4){_0x40b950=_0x40b950-0x0;var _0x422874=_0x10be[_0x40b950];return _0x422874;};'use strict';exports[_0xe10b('0x0')]=function(_0x1fb086,_0x9dacd7){var _0x59bdb6=[{'type':_0xe10b('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1fb086[_0xe10b('0x2')]()){case _0xe10b('0x3'):switch(_0x9dacd7[_0xe10b('0x2')]()){case _0xe10b('0x4'):_0x59bdb6[_0xe10b('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x59bdb6[_0xe10b('0x5')]({'type':_0xe10b('0x6'),'content':'','variableName':_0xe10b('0x7')});break;case'outbound':_0x59bdb6[_0xe10b('0x5')]({'type':_0xe10b('0x1'),'content':_0xe10b('0x8'),'variableName':null});_0x59bdb6[_0xe10b('0x5')]({'type':'variable','content':'','variableName':_0xe10b('0x9')});break;}}return _0x59bdb6;};exports[_0xe10b('0xa')]=function(_0x4995e0,_0x484971){var _0xa6e827=[];switch(_0x4995e0['toLowerCase']()){case _0xe10b('0x3'):switch(_0x484971[_0xe10b('0x2')]()){case _0xe10b('0x4'):_0xa6e827=[{'type':'string','content':_0xe10b('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0xd'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x7')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0xe'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xe10b('0xf'),'keyType':_0xe10b('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xe10b('0x10'),'keyType':'variable','variableName':'queue'},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x11'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x12')},{'type':_0xe10b('0xc'),'content':'','key':'Date','keyType':'variable','variableName':_0xe10b('0x13')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x15'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x16')},{'type':'keyValue','content':'','key':_0xe10b('0x17'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x9')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x13')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x19'),'keyType':_0xe10b('0x6'),'variableName':'agentconnectAt'},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1a'),'keyType':'variable','variableName':_0xe10b('0x1b')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1c'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x1d')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1e'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x1f')}];break;case _0xe10b('0x20'):_0xa6e827=[{'type':_0xe10b('0x1'),'content':_0xe10b('0xb'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x9')},{'type':'keyValue','content':'','key':_0xe10b('0x21'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xe10b('0xc'),'content':'','key':'UniqueId','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x12')},{'type':_0xe10b('0xc'),'content':'','key':'Date','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x22')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x18')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x23'),'keyType':'variable','keyContent':'','variableName':_0xe10b('0x24')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x25'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x26')},{'type':_0xe10b('0xc'),'content':'','key':'Duration','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x27')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x28'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0xa6e827;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index b1ea1ab..d3b8f18 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe90b=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','tracked','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe90b,0x12b));var _0xbe90=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xe90b[_0x143a91];return _0x1906f5;};'use strict';var _=require(_0xbe90('0x0'));var db=require(_0xbe90('0x1'))['db'];var loggers={'openchannel':require(_0xbe90('0x2'))(_0xbe90('0x3')),'mail':require('../../config/logger')(_0xbe90('0x4')),'fax':require(_0xbe90('0x2'))('fax-interactions'),'sms':require(_0xbe90('0x2'))(_0xbe90('0x5')),'chat':require(_0xbe90('0x2'))(_0xbe90('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x49d114,_0x5e9f98,_0x3adc8a){if(_0x49d114&&_0x49d114[_['upperFirst'](_0x3adc8a)+_0xbe90('0x7')]){return _0x49d114[_[_0xbe90('0x8')](_0x3adc8a)+_0xbe90('0x7')];}else if(_0x49d114&&_0x49d114['id']){return _0x49d114['id'];}else if(_0x5e9f98&&_0x5e9f98['id']){return _0x5e9f98['id'];}else{return _0xbe90('0x9');}}function log(_0x109885,_0x3196a9,_0x3ae478,_0x5a3867,_0x18644c,_0x27bcca){loggers[_0x18644c[_0xbe90('0xa')]()][_0x109885](_0xbe90('0xb'),_0x27bcca['toUpperCase'](),_0x3196a9?_0x3196a9['id']:null,_0x3196a9?_0x3196a9[_0xbe90('0xc')]:null,_0x3196a9?_0x3196a9[_0xbe90('0xd')]:null,getInteractionId(_0x3ae478,_0x5a3867,_0x18644c),_0x3ae478?JSON[_0xbe90('0xe')](_0x3ae478):_0xbe90('0xf'));}function updateUser(_0x787ae8,_0x28498f,_0x376926,_0xcdc980,_0xe00058){db[_['upperFirst'](_0xcdc980)+_0xbe90('0x10')][_0xbe90('0x11')]({'where':{'id':getInteractionId(_0x28498f,_0x376926,_0xcdc980)}})[_0xbe90('0x12')](function(_0x17de6f){if(_0x17de6f){return _0x17de6f[_0xbe90('0x13')]({'UserId':_0x787ae8?_0x787ae8['id']:null});}})['then'](function(_0x20b33d){if(_0x20b33d){log('info',_0x787ae8,_0x28498f,_0x376926,_0xcdc980,_0xe00058);}})['catch'](function(){log('error',_0x787ae8,_0x28498f,_0x376926,_0xcdc980,_0xe00058);});}exports[_0xbe90('0x14')]=function(_0x3c9fd4,_0x53b98){return function(_0x12e4f9,_0x531da8,_0x4a9f14){var _0x41b1cc=_0x12e4f9['user'];var _0x4cf394={};var _0x1df767=_0x12e4f9['query'];if(_0x4cf394){_0x4cf394=_[_0xbe90('0x15')](_0x12e4f9[_0xbe90('0x16')]);_0x4cf394=_[_0xbe90('0x17')](_0x4cf394,[_0xbe90('0x16'),_0xbe90('0x18'),_0xbe90('0x19'),_0xbe90('0x1a'),_0xbe90('0x1b')]);}updateUser(_0x41b1cc,_0x4cf394,_0x1df767,_0x3c9fd4,_0x53b98);_0x4a9f14(null);};}; \ No newline at end of file +var _0xd9bf=['update','info','catch','tracked','user','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','stringify','null','findOne','then'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd9bf,0xda));var _0xfd9b=function(_0x393f4e,_0x395f5b){_0x393f4e=_0x393f4e-0x0;var _0x23a0a3=_0xd9bf[_0x393f4e];return _0x23a0a3;};'use strict';var _=require(_0xfd9b('0x0'));var db=require(_0xfd9b('0x1'))['db'];var loggers={'openchannel':require(_0xfd9b('0x2'))('openchannel-interactions'),'mail':require(_0xfd9b('0x2'))(_0xfd9b('0x3')),'fax':require(_0xfd9b('0x2'))('fax-interactions'),'sms':require(_0xfd9b('0x2'))(_0xfd9b('0x4')),'chat':require(_0xfd9b('0x2'))(_0xfd9b('0x5')),'whatsapp':require('../../config/logger')(_0xfd9b('0x6'))};function getInteractionId(_0x63d0cf,_0x5d7622,_0x2b8634){if(_0x63d0cf&&_0x63d0cf[_[_0xfd9b('0x7')](_0x2b8634)+_0xfd9b('0x8')]){return _0x63d0cf[_[_0xfd9b('0x7')](_0x2b8634)+_0xfd9b('0x8')];}else if(_0x63d0cf&&_0x63d0cf['id']){return _0x63d0cf['id'];}else if(_0x5d7622&&_0x5d7622['id']){return _0x5d7622['id'];}else{return _0xfd9b('0x9');}}function log(_0x4e97c4,_0x22918c,_0x23cfad,_0x53f675,_0x326bc2,_0x42ae30){loggers[_0x326bc2[_0xfd9b('0xa')]()][_0x4e97c4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42ae30[_0xfd9b('0xb')](),_0x22918c?_0x22918c['id']:null,_0x22918c?_0x22918c['name']:null,_0x22918c?_0x22918c['role']:null,getInteractionId(_0x23cfad,_0x53f675,_0x326bc2),_0x23cfad?JSON[_0xfd9b('0xc')](_0x23cfad):_0xfd9b('0xd'));}function updateUser(_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0){db[_[_0xfd9b('0x7')](_0x17fd47)+'Interaction'][_0xfd9b('0xe')]({'where':{'id':getInteractionId(_0x4ee9ed,_0x8932bc,_0x17fd47)}})[_0xfd9b('0xf')](function(_0x5368ab){if(_0x5368ab){return _0x5368ab[_0xfd9b('0x10')]({'UserId':_0x36f6b0?_0x36f6b0['id']:null});}})[_0xfd9b('0xf')](function(_0x254026){if(_0x254026){log(_0xfd9b('0x11'),_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0);}})[_0xfd9b('0x12')](function(){log('error',_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0);});}exports[_0xfd9b('0x13')]=function(_0x6e95bc,_0x5ced4d){return function(_0x569329,_0x1515a8,_0x20868f){var _0x57d615=_0x569329[_0xfd9b('0x14')];var _0x4b1b28={};var _0x3e0ac1=_0x569329['query'];if(_0x4b1b28){_0x4b1b28=_['clone'](_0x569329[_0xfd9b('0x15')]);_0x4b1b28=_[_0xfd9b('0x16')](_0x4b1b28,[_0xfd9b('0x15'),_0xfd9b('0x17'),_0xfd9b('0x18'),'fax',_0xfd9b('0x19')]);}updateUser(_0x57d615,_0x4b1b28,_0x3e0ac1,_0x6e95bc,_0x5ced4d);_0x20868f(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7c0d8b7..6103fea 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 _0xb2ca=['User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x38ea5d,_0x19b205){var _0xa28c8f=function(_0x2ba0c6){while(--_0x2ba0c6){_0x38ea5d['push'](_0x38ea5d['shift']());}};_0xa28c8f(++_0x19b205);}(_0xb2ca,0x162));var _0xab2c=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xb2ca[_0x341e0f];return _0x59555a;};'use strict';var crypto=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var compose=require(_0xab2c('0x2'));var db=require(_0xab2c('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1b01ee,_0x58a19a){if(_0x1b01ee&&_0x58a19a){if(_0x58a19a[_0xab2c('0x4')]&&_0x58a19a[_0xab2c('0x5')]){var _0x79cf90=_0x58a19a[_0xab2c('0x4')];var _0x3cdfa4=_0x58a19a[_0xab2c('0x5')];var _0x3af972=_0x79cf90[_0xab2c('0x6')]('-')[0x4];var _0x293e5=_0x79cf90[_0xab2c('0x6')]('-')[0x0];var _0x5dc776=crypto[_0xab2c('0x7')]('aes-256-ctr',util[_0xab2c('0x8')](_0xab2c('0x9'),_0x3af972,_0x79cf90,_0x293e5));var _0x27e8ce=_0x5dc776[_0xab2c('0xa')](_0x3cdfa4,_0xab2c('0xb'),_0xab2c('0xc'));_0x27e8ce+=_0x5dc776[_0xab2c('0xd')](_0xab2c('0xc'));var _0x2f632b=JSON[_0xab2c('0xe')](_0x27e8ce);return _0x2f632b['hasOwnProperty'](_0x1b01ee)?_0x2f632b[_0x1b01ee]:null;}}return null;}function isLimit(_0x540738,_0x5b373e,_0xee0c25,_0x1b1605){var _0x2bb895=_0x5b373e;return compose()[_0xab2c('0xf')](function(_0x54fb44,_0x50217f,_0x549a27){return db[_0xab2c('0x10')][_0xab2c('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1c4d30){var _0x2ac01a=getValueFromLicense(_0x540738,_0x1c4d30);return _0x2ac01a?_0x2ac01a:_0x2bb895;})[_0xab2c('0x12')](function(_0x415eb9){_0x2bb895=_0x415eb9;return _0xee0c25[_0xab2c('0x13')](_0x1b1605);})[_0xab2c('0x12')](function(_0x4088d1){if(_0x4088d1>=_0x2bb895){return _0x50217f[_0xab2c('0x14')](0x193)['json']({'message':util[_0xab2c('0x8')](_0xab2c('0x15'),_0x540738)});}_0x549a27();})[_0xab2c('0x16')](function(_0x46f1e3){_0x549a27(_0x46f1e3);});});}function isUserLimit(){return isLimit(_0xab2c('0x17'),0x1,db[_0xab2c('0x18')],{'where':{'$or':[{'role':_0xab2c('0x19')},{'role':_0xab2c('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x1aba=['utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','users','User','user','isUserLimit','util','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final'];(function(_0x38623a,_0x2da80f){var _0x171b6a=function(_0xc18663){while(--_0xc18663){_0x38623a['push'](_0x38623a['shift']());}};_0x171b6a(++_0x2da80f);}(_0x1aba,0x8f));var _0xa1ab=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1aba[_0x3bf83f];return _0x22c4a9;};'use strict';var crypto=require('crypto');var util=require(_0xa1ab('0x0'));var compose=require('composable-middleware');var db=require(_0xa1ab('0x1'))['db'];var config=require(_0xa1ab('0x2'));function getValueFromLicense(_0x40accd,_0x33f92f){if(_0x40accd&&_0x33f92f){if(_0x33f92f['data1']&&_0x33f92f[_0xa1ab('0x3')]){var _0x539e28=_0x33f92f[_0xa1ab('0x4')];var _0x2a6c05=_0x33f92f[_0xa1ab('0x3')];var _0x2ce37b=_0x539e28['split']('-')[0x4];var _0x54911d=_0x539e28[_0xa1ab('0x5')]('-')[0x0];var _0x675504=crypto[_0xa1ab('0x6')](_0xa1ab('0x7'),util[_0xa1ab('0x8')](_0xa1ab('0x9'),_0x2ce37b,_0x539e28,_0x54911d));var _0x338689=_0x675504[_0xa1ab('0xa')](_0x2a6c05,_0xa1ab('0xb'),'utf8');_0x338689+=_0x675504[_0xa1ab('0xc')](_0xa1ab('0xd'));var _0x273445=JSON[_0xa1ab('0xe')](_0x338689);return _0x273445[_0xa1ab('0xf')](_0x40accd)?_0x273445[_0x40accd]:null;}}return null;}function isLimit(_0x28962c,_0x178ca8,_0x3ce7cc,_0x2ee552){var _0x12c751=_0x178ca8;return compose()[_0xa1ab('0x10')](function(_0x1094ed,_0x317cf0,_0x5e62b2){return db[_0xa1ab('0x11')][_0xa1ab('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xa1ab('0x13')](function(_0x1d2fa2){var _0x5f1c2f=getValueFromLicense(_0x28962c,_0x1d2fa2);return _0x5f1c2f?_0x5f1c2f:_0x12c751;})[_0xa1ab('0x13')](function(_0x4dd4c2){_0x12c751=_0x4dd4c2;return _0x3ce7cc[_0xa1ab('0x14')](_0x2ee552);})[_0xa1ab('0x13')](function(_0x325e79){if(_0x325e79>=_0x12c751){return _0x317cf0[_0xa1ab('0x15')](0x193)['json']({'message':util[_0xa1ab('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x28962c)});}_0x5e62b2();})['catch'](function(_0x17d17b){_0x5e62b2(_0x17d17b);});});}function isUserLimit(){return isLimit(_0xa1ab('0x16'),0x1,db[_0xa1ab('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0xa1ab('0x18')}]}});}exports[_0xa1ab('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 3087c52..8b5d0b0 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 _0x0dbb=['buildExpression','$eq','operator','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','\x20IS\x20NULL)','IN\x20?','$notIn','$ne','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','$substring','start','pop','DATE','utcOffset','hours','minutes','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','slice','forEach','shift','filter','indexOf','map','conditions','push'];(function(_0x18fb7f,_0x279b83){var _0x1a6186=function(_0x34d72c){while(--_0x34d72c){_0x18fb7f['push'](_0x18fb7f['shift']());}};_0x1a6186(++_0x279b83);}(_0x0dbb,0x1a1));var _0xb0db=function(_0x2a58bc,_0x562541){_0x2a58bc=_0x2a58bc-0x0;var _0x1db4f0=_0x0dbb[_0x2a58bc];return _0x1db4f0;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x31586c){var _0x5b4133={'conditions':[]};_0x5b4133[_0xb0db('0x0')]=_[_0xb0db('0x1')](_0x31586c,'[$or]')?'or':_0xb0db('0x2');var _0x5ba1e5=_0x31586c[_0xb0db('0x3')](_0xb0db('0x4'),'')[_0xb0db('0x3')](_0xb0db('0x5'),'')[_0xb0db('0x6')]('||');for(var _0x148002=0x0;_0x148002<_0x5ba1e5['length'];_0x148002++){var _0x314d37=_0x5ba1e5[_0x148002]['split'](':=');var _0x118e1d=_0x314d37[0x0];var _0x50cc45=_0x314d37[_0xb0db('0x7')](0x1);_0x50cc45[_0xb0db('0x8')](function(_0x4fcaaa){var _0xbdf5ea=_0x4fcaaa[_0xb0db('0x6')]('[')[_0xb0db('0x9')]();var _0x316b57=_0x4fcaaa['match'](/\[(.*?)\]/g);_0x316b57['forEach'](function(_0x460c07){var _0x39f7c1=_0x460c07[_0xb0db('0x6')]('[')[_0xb0db('0xa')](function(_0x29fcd3){return _0x29fcd3[_0xb0db('0xb')](']')>-0x1;})[_0xb0db('0xc')](function(_0x116ea4){return _0x116ea4['split'](']')[0x0];})[0x0];_0x5b4133[_0xb0db('0xd')][_0xb0db('0xe')]({'field':_0x118e1d,'operator':_0xbdf5ea,'value':_0x39f7c1});});});}return _0x5b4133;};exports[_0xb0db('0xf')]=function(_0x5d8182,_0x4eeefb,_0x1aa187){var _0x4d817f={};if(_0x4eeefb==='DATE'){if(_0x1aa187['operator']===_0xb0db('0x10')){_0x1aa187[_0xb0db('0x11')]=_0xb0db('0x12');_0x1aa187[_0xb0db('0x13')]+=','+_0x1aa187[_0xb0db('0x13')];}else if(_[_0xb0db('0x14')](['$gt',_0xb0db('0x15')],_0x1aa187['operator'])){_0x1aa187[_0xb0db('0x13')]=moment(_0x1aa187['value'])[_0xb0db('0x16')](0x1,_0xb0db('0x17'))[_0xb0db('0x18')](_0xb0db('0x19'));}}if(_0x1aa187[_0xb0db('0x1a')]){_0x4eeefb=_0x1aa187[_0xb0db('0x1a')];_0x4d817f[_0xb0db('0x1b')]=_0xb0db('0x1c')+_0x5d8182+'.'+_0x1aa187[_0xb0db('0x1d')]+_0xb0db('0x1e')+_0x1aa187['castTo']+')\x20'+parseOperator(_0x1aa187['operator']);}else{_0x4d817f[_0xb0db('0x1b')]=_0x5d8182+'.'+_0x1aa187[_0xb0db('0x1d')]+'\x20'+parseOperator(_0x1aa187[_0xb0db('0x11')]);}if(_[_0xb0db('0x14')](['$ne','$notIn'],_0x1aa187[_0xb0db('0x11')]))_0x4d817f[_0xb0db('0x1b')]='('+_0x4d817f[_0xb0db('0x1b')]+'\x20OR\x20'+_0x5d8182+'.'+_0x1aa187[_0xb0db('0x1d')]+_0xb0db('0x1f');_0x4d817f[_0xb0db('0x13')]=parseValue(_0x4eeefb,_0x1aa187[_0xb0db('0x11')],_0x1aa187[_0xb0db('0x13')]);return _0x4d817f;};function parseOperator(_0x583535){var _0xc8d9bf;switch(_0x583535){case'$in':_0xc8d9bf=_0xb0db('0x20');break;case _0xb0db('0x21'):_0xc8d9bf='NOT\x20IN\x20?';break;case _0xb0db('0x10'):_0xc8d9bf='=\x20?';break;case _0xb0db('0x22'):_0xc8d9bf=_0xb0db('0x23');break;case'$substring':case _0xb0db('0x24'):case _0xb0db('0x25'):_0xc8d9bf=_0xb0db('0x26');break;case _0xb0db('0x27'):_0xc8d9bf=_0xb0db('0x28');break;case _0xb0db('0x29'):_0xc8d9bf=_0xb0db('0x2a');break;case'$lte':_0xc8d9bf=_0xb0db('0x2b');break;case _0xb0db('0x2c'):_0xc8d9bf='>=\x20?';break;case _0xb0db('0x12'):_0xc8d9bf=_0xb0db('0x2d');break;}return _0xc8d9bf;}function parseValue(_0x2d1863,_0x243353,_0x451929){var _0x37024a={'start':undefined,'end':undefined};switch(_0x243353){case _0xb0db('0x2e'):case _0xb0db('0x21'):_0x37024a['start']=_0x451929[_0xb0db('0x6')](',');break;case _0xb0db('0x2f'):_0x37024a[_0xb0db('0x30')]='%'+_0x451929+'%';break;case _0xb0db('0x24'):_0x37024a[_0xb0db('0x30')]=_0x451929+'%';break;case _0xb0db('0x25'):_0x37024a[_0xb0db('0x30')]='%'+_0x451929;break;case _0xb0db('0x12'):var _0x1e1dab=_0x451929[_0xb0db('0x6')](',');var _0x451929=_0x1e1dab[_0xb0db('0x9')]();var _0x58da4c=_0x1e1dab[_0xb0db('0x31')]();if(_0x2d1863===_0xb0db('0x32')){_0x451929=moment(_0x451929)[_0xb0db('0x33')](0x0,!![])[_0xb0db('0x18')]();_0x58da4c=moment(_0x58da4c)[_0xb0db('0x33')](0x0,!![])['add'](0x17,_0xb0db('0x34'))[_0xb0db('0x16')](0x3b,_0xb0db('0x35'))['add'](0x3b,'seconds')['format']();}_0x37024a={'start':_0x451929,'end':_0x58da4c};break;default:_0x37024a[_0xb0db('0x30')]=_0x451929;break;}return _0x37024a;} \ No newline at end of file +var _0xe1a7=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','utcOffset','format','add','minutes','seconds','moment','sqlOperator','[$or]','and','replace','[$and]','length','split','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','$eq','operator','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe1a7,0x89));var _0x7e1a=function(_0x50a94c,_0x279837){_0x50a94c=_0x50a94c-0x0;var _0x25f4a1=_0xe1a7[_0x50a94c];return _0x25f4a1;};'use strict';var _=require('lodash');var moment=require(_0x7e1a('0x0'));exports['parseSearch']=function(_0xc8af2f){var _0x1a4819={'conditions':[]};_0x1a4819[_0x7e1a('0x1')]=_['startsWith'](_0xc8af2f,_0x7e1a('0x2'))?'or':_0x7e1a('0x3');var _0x1c3c11=_0xc8af2f[_0x7e1a('0x4')](_0x7e1a('0x5'),'')[_0x7e1a('0x4')](_0x7e1a('0x2'),'')['split']('||');for(var _0x18bab6=0x0;_0x18bab6<_0x1c3c11[_0x7e1a('0x6')];_0x18bab6++){var _0x302ecf=_0x1c3c11[_0x18bab6][_0x7e1a('0x7')](':=');var _0x421ce7=_0x302ecf[0x0];var _0x472c1f=_0x302ecf['slice'](0x1);_0x472c1f[_0x7e1a('0x8')](function(_0x502f80){var _0x3a600f=_0x502f80[_0x7e1a('0x7')]('[')[_0x7e1a('0x9')]();var _0x44d42d=_0x502f80[_0x7e1a('0xa')](/\[(.*?)\]/g);_0x44d42d['forEach'](function(_0x35b5f5){var _0x129f79=_0x35b5f5['split']('[')[_0x7e1a('0xb')](function(_0x402fbc){return _0x402fbc[_0x7e1a('0xc')](']')>-0x1;})[_0x7e1a('0xd')](function(_0x37e40d){return _0x37e40d['split'](']')[0x0];})[0x0];_0x1a4819[_0x7e1a('0xe')][_0x7e1a('0xf')]({'field':_0x421ce7,'operator':_0x3a600f,'value':_0x129f79});});});}return _0x1a4819;};exports[_0x7e1a('0x10')]=function(_0x1eb77b,_0xf54df2,_0x3404d4){var _0x1867ce={};if(_0xf54df2==='DATE'){if(_0x3404d4['operator']===_0x7e1a('0x11')){_0x3404d4[_0x7e1a('0x12')]=_0x7e1a('0x13');_0x3404d4[_0x7e1a('0x14')]+=','+_0x3404d4[_0x7e1a('0x14')];}else if(_[_0x7e1a('0x15')]([_0x7e1a('0x16'),_0x7e1a('0x17')],_0x3404d4[_0x7e1a('0x12')])){_0x3404d4[_0x7e1a('0x14')]=moment(_0x3404d4[_0x7e1a('0x14')])['add'](0x1,_0x7e1a('0x18'))['format'](_0x7e1a('0x19'));}}if(_0x3404d4['castTo']){_0xf54df2=_0x3404d4[_0x7e1a('0x1a')];_0x1867ce['text']='CAST('+_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+_0x7e1a('0x1c')+_0x3404d4[_0x7e1a('0x1a')]+')\x20'+parseOperator(_0x3404d4[_0x7e1a('0x12')]);}else{_0x1867ce[_0x7e1a('0x1d')]=_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+'\x20'+parseOperator(_0x3404d4[_0x7e1a('0x12')]);}if(_[_0x7e1a('0x15')]([_0x7e1a('0x1e'),_0x7e1a('0x1f')],_0x3404d4[_0x7e1a('0x12')]))_0x1867ce[_0x7e1a('0x1d')]='('+_0x1867ce['text']+_0x7e1a('0x20')+_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+_0x7e1a('0x21');_0x1867ce[_0x7e1a('0x14')]=parseValue(_0xf54df2,_0x3404d4[_0x7e1a('0x12')],_0x3404d4['value']);return _0x1867ce;};function parseOperator(_0x481add){var _0x440da5;switch(_0x481add){case _0x7e1a('0x22'):_0x440da5=_0x7e1a('0x23');break;case _0x7e1a('0x1f'):_0x440da5=_0x7e1a('0x24');break;case _0x7e1a('0x11'):_0x440da5=_0x7e1a('0x25');break;case'$ne':_0x440da5='<>\x20?';break;case'$substring':case _0x7e1a('0x26'):case _0x7e1a('0x27'):_0x440da5=_0x7e1a('0x28');break;case _0x7e1a('0x29'):_0x440da5=_0x7e1a('0x2a');break;case _0x7e1a('0x16'):_0x440da5=_0x7e1a('0x2b');break;case'$lte':_0x440da5=_0x7e1a('0x2c');break;case _0x7e1a('0x2d'):_0x440da5=_0x7e1a('0x2e');break;case _0x7e1a('0x13'):_0x440da5=_0x7e1a('0x2f');break;}return _0x440da5;}function parseValue(_0x44807a,_0x5aecb3,_0x20500d){var _0x473bf0={'start':undefined,'end':undefined};switch(_0x5aecb3){case _0x7e1a('0x22'):case _0x7e1a('0x1f'):_0x473bf0[_0x7e1a('0x30')]=_0x20500d['split'](',');break;case _0x7e1a('0x31'):_0x473bf0[_0x7e1a('0x30')]='%'+_0x20500d+'%';break;case'$startsWith':_0x473bf0['start']=_0x20500d+'%';break;case _0x7e1a('0x27'):_0x473bf0[_0x7e1a('0x30')]='%'+_0x20500d;break;case _0x7e1a('0x13'):var _0x25a217=_0x20500d[_0x7e1a('0x7')](',');var _0x20500d=_0x25a217[_0x7e1a('0x9')]();var _0x56457c=_0x25a217[_0x7e1a('0x32')]();if(_0x44807a===_0x7e1a('0x33')){_0x20500d=moment(_0x20500d)[_0x7e1a('0x34')](0x0,!![])[_0x7e1a('0x35')]();_0x56457c=moment(_0x56457c)[_0x7e1a('0x34')](0x0,!![])[_0x7e1a('0x36')](0x17,'hours')['add'](0x3b,_0x7e1a('0x37'))[_0x7e1a('0x36')](0x3b,_0x7e1a('0x38'))['format']();}_0x473bf0={'start':_0x20500d,'end':_0x56457c};break;default:_0x473bf0['start']=_0x20500d;break;}return _0x473bf0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d44cdb0..45fb68c 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 _0x3822=['fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','utc','format','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','length','omit','isObject','isNumeric','match','isEmail','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','order','pick','merge','VIRTUAL','where','lower','filter','options','lodash','sequelize','moment','parse','keys','includes'];(function(_0x503929,_0x777cd4){var _0x5618f9=function(_0x1d4873){while(--_0x1d4873){_0x503929['push'](_0x503929['shift']());}};_0x5618f9(++_0x777cd4);}(_0x3822,0x197));var _0x2382=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3822[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x2382('0x0'));var sequelize=require(_0x2382('0x1'));var moment=require(_0x2382('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x78657e){var _0x265692=['ne'];try{var _0x4be7ae=JSON[_0x2382('0x3')](_0x78657e);var _0xdf867d=Object[_0x2382('0x4')](_0x4be7ae)[0x0];return _0x265692[_0x2382('0x5')](_0xdf867d);}catch(_0x3705b6){return![];}}function getOperatorValue(_0x12ef98){var _0x406085=JSON[_0x2382('0x3')](_0x12ef98);var _0x3f50c1=Object['keys'](_0x406085)[0x0];var _0x2e57e2=_0x406085[_0x3f50c1];return{['$'+_0x3f50c1]:_0x2e57e2};}exports[_0x2382('0x6')]=function(_0x3cb9e3){var _0xa9720=null;if(_0x3cb9e3){_0xa9720=_0x3cb9e3[_0x2382('0x7')](',');}return _0xa9720;};exports[_0x2382('0x8')]=function(_0x497fb8,_0x1eda9f){var _0x5d3342={};if(!_[_0x2382('0x9')](_0x497fb8)){_[_0x2382('0xa')](_0x497fb8,function(_0x404a91,_0x182f75){try{if(_0x1eda9f){var _0x2c2a35=_[_0x2382('0xb')](_0x1eda9f,{'name':_0x182f75})||{};if(hasSequelizeOperator(_0x404a91)){_0x5d3342[_0x182f75]=getOperatorValue(_0x404a91);}else if(_0x2c2a35[_0x2382('0xc')]===_0x2382('0xd')&&_[_0x2382('0xe')](_0x404a91)){var _0x311687=JSON[_0x2382('0x3')](_0x404a91);var _0x58c27c={'$gte':moment(moment(_0x311687['$gte'])['format']('YYYY-MM-DD'))[_0x2382('0xf')]()[_0x2382('0x10')](),'$lte':moment(moment(_0x311687[_0x2382('0x11')])[_0x2382('0x10')](_0x2382('0x12')))['utc']()[_0x2382('0x13')](0x1,'s')[_0x2382('0x10')]()};_0x5d3342[_0x182f75]=_0x58c27c;}else if(_0x2c2a35[_0x2382('0x14')]===_0x2382('0x15')){_0x5d3342[_0x182f75]=_0x404a91;}else{_0x5d3342[_0x182f75]=_[_0x2382('0x16')](_0x404a91)?_0x404a91:JSON[_0x2382('0x3')](_0x404a91);}}else{_0x5d3342[_0x182f75]=_['isArray'](_0x404a91)?_0x404a91:JSON[_0x2382('0x3')](_0x404a91);}}catch(_0xbf46f5){_0x5d3342[_0x182f75]=_0x404a91[_0x2382('0x7')](',');}});}return _0x5d3342;};exports[_0x2382('0x17')]=function(_0x15a1bb){_0x15a1bb=parseInt(_0x15a1bb,0xa);if(!_0x15a1bb||_0x15a1bb<0x0){_0x15a1bb=LIMIT_VALUE;}return _0x15a1bb;};exports[_0x2382('0x18')]=function(_0xb088f4){_0xb088f4=parseInt(_0xb088f4,0xa);if(!_0xb088f4||_0xb088f4<0x0){_0xb088f4=0x0;}return _0xb088f4;};exports[_0x2382('0x19')]=function(_0x3cf206){var _0x499397,_0x65bbd8=null;if(_0x3cf206){_0x499397=_0x3cf206[_0x2382('0x7')](',');_0x65bbd8=_[_0x2382('0x1a')](_0x499397,function(_0x143204){if(_0x143204[_0x2382('0x1b')]('-')===0x0){return[_0x143204===_0x2382('0x1c')?sequelize[_0x2382('0x1d')](sequelize[_0x2382('0x1e')]('priority'),_0x2382('0x1f')):_0x143204['substr'](0x1),_0x2382('0x20')];}else{return[_0x143204==='priority'?sequelize['cast'](sequelize['col']('priority'),_0x2382('0x1f')):_0x143204,_0x2382('0x21')];}});}return _0x65bbd8;};exports['omit']=function(_0x346161,_0x4a8946){if(_[_0x2382('0x9')](_0x346161)){return _0x346161;}if(_[_0x2382('0x16')](_0x346161)){for(var _0x258225=0x0;_0x258225<_0x346161[_0x2382('0x22')];_0x258225+=0x1){_0x346161[_0x258225]=this[_0x2382('0x23')](_0x346161[_0x258225],_0x4a8946);}return _0x346161;}if(!_[_0x2382('0x24')](_0x346161)){return _0x346161;}if(_['isString'](_0x4a8946)){_0x4a8946=[_0x4a8946];}if(!_['isArray'](_0x4a8946)){return _0x346161;}for(var _0x1a7841=0x0;_0x1a7841<_0x4a8946[_0x2382('0x22')];_0x1a7841+=0x1){_['unset'](_0x346161,_0x4a8946[_0x1a7841]);}for(var _0x26d3a5 in _0x346161){if(_0x346161['hasOwnProperty'](_0x26d3a5)){_0x346161[_0x26d3a5]=this[_0x2382('0x23')](_0x346161[_0x26d3a5],_0x4a8946);}}return _0x346161;};exports[_0x2382('0x25')]=function(_0x30015e){return _0x30015e[_0x2382('0x26')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x2382('0x27')]=function(_0x31f729){return _0x31f729[_0x2382('0x26')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4480bd){var _0x23354e=[];_0x4480bd[_0x2382('0x7')](/[ ,]+/)[_0x2382('0x28')](function(_0x57cb6e){_0x57cb6e=_0x57cb6e[_0x2382('0x29')](/([^:]")"+/g,'$1');_0x57cb6e='+'+_0x57cb6e+'*';if(_0x57cb6e[_0x2382('0x5')]('@'))_0x57cb6e='\x22'+_0x57cb6e+'\x22';_0x23354e[_0x2382('0x2a')](_0x57cb6e);});return _0x23354e[_0x2382('0x2b')]('\x20');};exports[_0x2382('0x2c')]=function(_0x40bc59,_0x1dceb2,_0x3cc058){var _0x3414b7={},_0xf1e3f={};if(_0x1dceb2[_0x2382('0x2d')][_0x2382('0x2e')]){_0x1dceb2[_0x2382('0x2d')]['id']=_0x1dceb2[_0x2382('0x2d')][_0x2382('0x2e')];delete _0x1dceb2[_0x2382('0x2d')][_0x2382('0x2e')];}_0x3414b7[_0x2382('0x2f')]=_[_0x2382('0x1a')](_0x40bc59,'name');_0x3414b7[_0x2382('0x2d')]=_[_0x2382('0x4')](_0x1dceb2['query']);_0x3414b7['filters']=_[_0x2382('0x30')](_0x3414b7['model'],_0x3414b7['query']);_0xf1e3f['attributes']=_[_0x2382('0x30')](_0x3414b7[_0x2382('0x2f')],this[_0x2382('0x6')](_0x1dceb2[_0x2382('0x2d')][_0x2382('0x6')]));_0xf1e3f['attributes']=_0xf1e3f[_0x2382('0x31')][_0x2382('0x22')]?_0xf1e3f[_0x2382('0x31')]:_0x3414b7[_0x2382('0x2f')];if(!_0x1dceb2[_0x2382('0x2d')][_0x2382('0x32')]('nolimit')){_0xf1e3f[_0x2382('0x17')]=this[_0x2382('0x17')](_0x1dceb2[_0x2382('0x2d')][_0x2382('0x17')]);_0xf1e3f[_0x2382('0x18')]=this[_0x2382('0x18')](_0x1dceb2[_0x2382('0x2d')][_0x2382('0x18')]);}_0xf1e3f[_0x2382('0x33')]=this[_0x2382('0x19')](_0x1dceb2[_0x2382('0x2d')][_0x2382('0x19')]);_0xf1e3f['where']=this[_0x2382('0x8')](_[_0x2382('0x34')](_0x1dceb2[_0x2382('0x2d')],_0x3414b7[_0x2382('0x8')]),_0x40bc59);if(_0x1dceb2['query']['filter']){_0xf1e3f['where']=_[_0x2382('0x35')](_0xf1e3f['where'],{'$or':_[_0x2382('0x1a')](_0x40bc59,function(_0x4315fd){if(_0x4315fd[_0x2382('0xc')]!==_0x2382('0x36')){if(_0x3cc058){return sequelize[_0x2382('0x37')](sequelize['fn']('lower',sequelize['col'](_0x4315fd[_0x2382('0x14')])),{'$like':sequelize['fn'](_0x2382('0x38'),'%'+_0x1dceb2[_0x2382('0x2d')][_0x2382('0x39')]+'%')});}else{var _0x12c0eb={};_0x12c0eb[_0x4315fd[_0x2382('0x14')]]={'$like':'%'+_0x1dceb2[_0x2382('0x2d')]['filter']+'%'};return _0x12c0eb;}}})});}_0xf1e3f=_[_0x2382('0x35')]({},_0xf1e3f,_0x1dceb2[_0x2382('0x3a')]);return _0xf1e3f;}; \ No newline at end of file +var _0xfffe=['format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','includes','push','getOptions','query','$id','name','intersection','model','attributes','nolimit','order','where','pick','VIRTUAL','lower','filter','merge','options','sequelize','moment','keys','parse','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc'];(function(_0x285a14,_0x394a27){var _0x3430cc=function(_0x46d2d7){while(--_0x46d2d7){_0x285a14['push'](_0x285a14['shift']());}};_0x3430cc(++_0x394a27);}(_0xfffe,0x1c9));var _0xefff=function(_0x58e2bd,_0x3dacea){_0x58e2bd=_0x58e2bd-0x0;var _0x2d0a5b=_0xfffe[_0x58e2bd];return _0x2d0a5b;};'use strict';var _=require('lodash');var sequelize=require(_0xefff('0x0'));var moment=require(_0xefff('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x540027){var _0x28d9c2=['ne'];try{var _0x42ece6=JSON['parse'](_0x540027);var _0x126830=Object[_0xefff('0x2')](_0x42ece6)[0x0];return _0x28d9c2['includes'](_0x126830);}catch(_0x2bdb4c){return![];}}function getOperatorValue(_0x1b1142){var _0x5e324f=JSON[_0xefff('0x3')](_0x1b1142);var _0x5ce869=Object[_0xefff('0x2')](_0x5e324f)[0x0];var _0x163a5e=_0x5e324f[_0x5ce869];return{['$'+_0x5ce869]:_0x163a5e};}exports[_0xefff('0x4')]=function(_0x32f9aa){var _0x2898c7=null;if(_0x32f9aa){_0x2898c7=_0x32f9aa[_0xefff('0x5')](',');}return _0x2898c7;};exports[_0xefff('0x6')]=function(_0x2a82c0,_0x2e9df8){var _0x48cc63={};if(!_[_0xefff('0x7')](_0x2a82c0)){_[_0xefff('0x8')](_0x2a82c0,function(_0x3e0a4c,_0x82a144){try{if(_0x2e9df8){var _0x478fe2=_['find'](_0x2e9df8,{'name':_0x82a144})||{};if(hasSequelizeOperator(_0x3e0a4c)){_0x48cc63[_0x82a144]=getOperatorValue(_0x3e0a4c);}else if(_0x478fe2[_0xefff('0x9')]===_0xefff('0xa')&&_[_0xefff('0xb')](_0x3e0a4c)){var _0x542abf=JSON['parse'](_0x3e0a4c);var _0x17a30c={'$gte':moment(moment(_0x542abf[_0xefff('0xc')])['format'](_0xefff('0xd')))[_0xefff('0xe')]()[_0xefff('0xf')](),'$lte':moment(moment(_0x542abf[_0xefff('0x10')])[_0xefff('0xf')](_0xefff('0xd')))[_0xefff('0xe')]()[_0xefff('0x11')](0x1,'s')[_0xefff('0xf')]()};_0x48cc63[_0x82a144]=_0x17a30c;}else if(_0x478fe2['name']===_0xefff('0x12')){_0x48cc63[_0x82a144]=_0x3e0a4c;}else{_0x48cc63[_0x82a144]=_[_0xefff('0x13')](_0x3e0a4c)?_0x3e0a4c:JSON[_0xefff('0x3')](_0x3e0a4c);}}else{_0x48cc63[_0x82a144]=_[_0xefff('0x13')](_0x3e0a4c)?_0x3e0a4c:JSON['parse'](_0x3e0a4c);}}catch(_0x3669fe){_0x48cc63[_0x82a144]=_0x3e0a4c[_0xefff('0x5')](',');}});}return _0x48cc63;};exports[_0xefff('0x14')]=function(_0x4edf7b){_0x4edf7b=parseInt(_0x4edf7b,0xa);if(!_0x4edf7b||_0x4edf7b<0x0){_0x4edf7b=LIMIT_VALUE;}return _0x4edf7b;};exports[_0xefff('0x15')]=function(_0x5c26ca){_0x5c26ca=parseInt(_0x5c26ca,0xa);if(!_0x5c26ca||_0x5c26ca<0x0){_0x5c26ca=0x0;}return _0x5c26ca;};exports[_0xefff('0x16')]=function(_0x3117c9){var _0x1974d6,_0x5de557=null;if(_0x3117c9){_0x1974d6=_0x3117c9[_0xefff('0x5')](',');_0x5de557=_[_0xefff('0x17')](_0x1974d6,function(_0x532907){if(_0x532907['indexOf']('-')===0x0){return[_0x532907===_0xefff('0x18')?sequelize[_0xefff('0x19')](sequelize['col'](_0xefff('0x18')),_0xefff('0x1a')):_0x532907[_0xefff('0x1b')](0x1),'DESC'];}else{return[_0x532907==='priority'?sequelize['cast'](sequelize[_0xefff('0x1c')](_0xefff('0x18')),_0xefff('0x1a')):_0x532907,_0xefff('0x1d')];}});}return _0x5de557;};exports[_0xefff('0x1e')]=function(_0x2f6bf5,_0x49496d){if(_['isEmpty'](_0x2f6bf5)){return _0x2f6bf5;}if(_[_0xefff('0x13')](_0x2f6bf5)){for(var _0x32a7db=0x0;_0x32a7db<_0x2f6bf5[_0xefff('0x1f')];_0x32a7db+=0x1){_0x2f6bf5[_0x32a7db]=this['omit'](_0x2f6bf5[_0x32a7db],_0x49496d);}return _0x2f6bf5;}if(!_[_0xefff('0x20')](_0x2f6bf5)){return _0x2f6bf5;}if(_[_0xefff('0x21')](_0x49496d)){_0x49496d=[_0x49496d];}if(!_[_0xefff('0x13')](_0x49496d)){return _0x2f6bf5;}for(var _0x2dcc8f=0x0;_0x2dcc8f<_0x49496d[_0xefff('0x1f')];_0x2dcc8f+=0x1){_[_0xefff('0x22')](_0x2f6bf5,_0x49496d[_0x2dcc8f]);}for(var _0x3ba59b in _0x2f6bf5){if(_0x2f6bf5[_0xefff('0x23')](_0x3ba59b)){_0x2f6bf5[_0x3ba59b]=this[_0xefff('0x1e')](_0x2f6bf5[_0x3ba59b],_0x49496d);}}return _0x2f6bf5;};exports[_0xefff('0x24')]=function(_0x542033){return _0x542033[_0xefff('0x25')](RegExp(_0xefff('0x26')))?!![]:![];};exports[_0xefff('0x27')]=function(_0x26b152){return _0x26b152[_0xefff('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x31bb0b){var _0x598ad6=[];_0x31bb0b['split'](/[ ,]+/)[_0xefff('0x28')](function(_0x208188){_0x208188=_0x208188['replace'](/([^:]")"+/g,'$1');_0x208188='+'+_0x208188+'*';if(_0x208188[_0xefff('0x29')]('@'))_0x208188='\x22'+_0x208188+'\x22';_0x598ad6[_0xefff('0x2a')](_0x208188);});return _0x598ad6['join']('\x20');};exports[_0xefff('0x2b')]=function(_0x29b4ca,_0x28ea43,_0x367dd3){var _0x1acaef={},_0x40da32={};if(_0x28ea43[_0xefff('0x2c')][_0xefff('0x2d')]){_0x28ea43[_0xefff('0x2c')]['id']=_0x28ea43[_0xefff('0x2c')]['$id'];delete _0x28ea43['query'][_0xefff('0x2d')];}_0x1acaef['model']=_[_0xefff('0x17')](_0x29b4ca,_0xefff('0x2e'));_0x1acaef[_0xefff('0x2c')]=_['keys'](_0x28ea43[_0xefff('0x2c')]);_0x1acaef[_0xefff('0x6')]=_[_0xefff('0x2f')](_0x1acaef[_0xefff('0x30')],_0x1acaef[_0xefff('0x2c')]);_0x40da32['attributes']=_['intersection'](_0x1acaef[_0xefff('0x30')],this[_0xefff('0x4')](_0x28ea43[_0xefff('0x2c')][_0xefff('0x4')]));_0x40da32[_0xefff('0x31')]=_0x40da32[_0xefff('0x31')][_0xefff('0x1f')]?_0x40da32[_0xefff('0x31')]:_0x1acaef[_0xefff('0x30')];if(!_0x28ea43[_0xefff('0x2c')][_0xefff('0x23')](_0xefff('0x32'))){_0x40da32['limit']=this[_0xefff('0x14')](_0x28ea43[_0xefff('0x2c')]['limit']);_0x40da32[_0xefff('0x15')]=this[_0xefff('0x15')](_0x28ea43[_0xefff('0x2c')][_0xefff('0x15')]);}_0x40da32[_0xefff('0x33')]=this['sort'](_0x28ea43['query']['sort']);_0x40da32[_0xefff('0x34')]=this[_0xefff('0x6')](_[_0xefff('0x35')](_0x28ea43[_0xefff('0x2c')],_0x1acaef[_0xefff('0x6')]),_0x29b4ca);if(_0x28ea43[_0xefff('0x2c')]['filter']){_0x40da32[_0xefff('0x34')]=_['merge'](_0x40da32[_0xefff('0x34')],{'$or':_[_0xefff('0x17')](_0x29b4ca,function(_0x278713){if(_0x278713[_0xefff('0x9')]!==_0xefff('0x36')){if(_0x367dd3){return sequelize[_0xefff('0x34')](sequelize['fn'](_0xefff('0x37'),sequelize['col'](_0x278713[_0xefff('0x2e')])),{'$like':sequelize['fn']('lower','%'+_0x28ea43[_0xefff('0x2c')]['filter']+'%')});}else{var _0x5b88c7={};_0x5b88c7[_0x278713['name']]={'$like':'%'+_0x28ea43[_0xefff('0x2c')][_0xefff('0x38')]+'%'};return _0x5b88c7;}}})});}_0x40da32=_[_0xefff('0x39')]({},_0x40da32,_0x28ea43[_0xefff('0x3a')]);return _0x40da32;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d1600c4..929156c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e4=['./environment','default','get','env','production','set','appPath','join','root','public','development','test','client','toISOString','use','static','views','/server/views','engine','ejs','renderFile','html','urlencoded','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment'];(function(_0xc6365f,_0x123e8b){var _0x510616=function(_0x2eca8f){while(--_0x2eca8f){_0xc6365f['push'](_0xc6365f['shift']());}};_0x510616(++_0x123e8b);}(_0xb7e4,0x129));var _0x4b7e=function(_0x401df1,_0x457167){_0x401df1=_0x401df1-0x0;var _0x971e11=_0xb7e4[_0x401df1];return _0x971e11;};'use strict';var express=require(_0x4b7e('0x0'));var favicon=require(_0x4b7e('0x1'));var bodyParser=require(_0x4b7e('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x4b7e('0x3'));var errorHandler=require(_0x4b7e('0x4'));var path=require(_0x4b7e('0x5'));var passport=require(_0x4b7e('0x6'));var cors=require(_0x4b7e('0x7'));var moment=require(_0x4b7e('0x8'));var config=require(_0x4b7e('0x9'));var db=require('../mysqldb')['db'];exports[_0x4b7e('0xa')]=function(_0x138cd5){var _0x5503b0=_0x138cd5[_0x4b7e('0xb')](_0x4b7e('0xc'));if(_0x5503b0===_0x4b7e('0xd')){_0x138cd5[_0x4b7e('0xe')](_0x4b7e('0xf'),path[_0x4b7e('0x10')](config[_0x4b7e('0x11')],_0x4b7e('0x12')));}if(_0x5503b0===_0x4b7e('0x13')||_0x5503b0===_0x4b7e('0x14')){_0x138cd5[_0x4b7e('0xe')]('appPath',path[_0x4b7e('0x10')](config['root'],_0x4b7e('0x15')));_0x138cd5['use'](errorHandler());}_0x138cd5[_0x4b7e('0xe')]('json\x20replacer',function(_0x4f3043,_0x31eff9){if(this[_0x4f3043]instanceof Date){_0x31eff9=this[_0x4f3043][_0x4b7e('0x16')]()['split']('.')[0x0]+'Z';}return _0x31eff9;});_0x138cd5[_0x4b7e('0x17')](express[_0x4b7e('0x18')](_0x138cd5[_0x4b7e('0xb')](_0x4b7e('0xf'))));_0x138cd5[_0x4b7e('0xe')](_0x4b7e('0x19'),config['root']+_0x4b7e('0x1a'));_0x138cd5[_0x4b7e('0x1b')]('html',require(_0x4b7e('0x1c'))[_0x4b7e('0x1d')]);_0x138cd5[_0x4b7e('0xe')]('view\x20engine',_0x4b7e('0x1e'));_0x138cd5[_0x4b7e('0x17')](bodyParser[_0x4b7e('0x1f')]({'limit':_0x4b7e('0x20'),'extended':!![]}));_0x138cd5[_0x4b7e('0x17')](bodyParser['json']({'limit':_0x4b7e('0x20')}));_0x138cd5[_0x4b7e('0x17')](cors());_0x138cd5[_0x4b7e('0x17')](methodOverride());_0x138cd5['use'](cookieParser());_0x138cd5[_0x4b7e('0x17')](passport[_0x4b7e('0x21')]());}; \ No newline at end of file +var _0x2a8a=['body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','env','production','set','appPath','join','development','test','root','client','use','json\x20replacer','toISOString','static','/server/views','engine','html','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon'];(function(_0x4487d5,_0x292afb){var _0xa4dfc5=function(_0x1b7ee4){while(--_0x1b7ee4){_0x4487d5['push'](_0x4487d5['shift']());}};_0xa4dfc5(++_0x292afb);}(_0x2a8a,0x1cc));var _0xa2a8=function(_0x168fca,_0x556fa8){_0x168fca=_0x168fca-0x0;var _0x5516cf=_0x2a8a[_0x168fca];return _0x5516cf;};'use strict';var express=require(_0xa2a8('0x0'));var favicon=require(_0xa2a8('0x1'));var bodyParser=require(_0xa2a8('0x2'));var methodOverride=require(_0xa2a8('0x3'));var cookieParser=require(_0xa2a8('0x4'));var errorHandler=require(_0xa2a8('0x5'));var path=require(_0xa2a8('0x6'));var passport=require(_0xa2a8('0x7'));var cors=require(_0xa2a8('0x8'));var moment=require(_0xa2a8('0x9'));var config=require(_0xa2a8('0xa'));var db=require(_0xa2a8('0xb'))['db'];exports['default']=function(_0x3c1992){var _0x404902=_0x3c1992['get'](_0xa2a8('0xc'));if(_0x404902===_0xa2a8('0xd')){_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0xf'),path[_0xa2a8('0x10')](config['root'],'public'));}if(_0x404902===_0xa2a8('0x11')||_0x404902===_0xa2a8('0x12')){_0x3c1992['set'](_0xa2a8('0xf'),path['join'](config[_0xa2a8('0x13')],_0xa2a8('0x14')));_0x3c1992[_0xa2a8('0x15')](errorHandler());}_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0x16'),function(_0xccde5f,_0x3e6be6){if(this[_0xccde5f]instanceof Date){_0x3e6be6=this[_0xccde5f][_0xa2a8('0x17')]()['split']('.')[0x0]+'Z';}return _0x3e6be6;});_0x3c1992[_0xa2a8('0x15')](express[_0xa2a8('0x18')](_0x3c1992['get'](_0xa2a8('0xf'))));_0x3c1992[_0xa2a8('0xe')]('views',config[_0xa2a8('0x13')]+_0xa2a8('0x19'));_0x3c1992[_0xa2a8('0x1a')](_0xa2a8('0x1b'),require('ejs')[_0xa2a8('0x1c')]);_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0x1d'),_0xa2a8('0x1b'));_0x3c1992[_0xa2a8('0x15')](bodyParser[_0xa2a8('0x1e')]({'limit':_0xa2a8('0x1f'),'extended':!![]}));_0x3c1992[_0xa2a8('0x15')](bodyParser[_0xa2a8('0x20')]({'limit':_0xa2a8('0x1f')}));_0x3c1992[_0xa2a8('0x15')](cors());_0x3c1992[_0xa2a8('0x15')](methodOverride());_0x3c1992[_0xa2a8('0x15')](cookieParser());_0x3c1992[_0xa2a8('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 51b7026..1318197 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 _0x62d9=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','update','digest','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','md5','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','orderBy','keys','length','IPv4','internal'];(function(_0x42c0e1,_0x4bf58b){var _0xae5697=function(_0x555526){while(--_0x555526){_0x42c0e1['push'](_0x42c0e1['shift']());}};_0xae5697(++_0x4bf58b);}(_0x62d9,0x1d7));var _0x962d=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0x62d9[_0x3598bb];return _0x13c837;};'use strict';var _=require(_0x962d('0x0'));var os=require('os');var crypto=require(_0x962d('0x1'));var machine=require(_0x962d('0x2'));var exec=require(_0x962d('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0xcf883a=[];var _0x835e1f=os['networkInterfaces']();var _0x32dbc2=_[_0x962d('0x4')](_[_0x962d('0x5')](_0x835e1f));for(var _0x44f3ed=0x0;_0x44f3ed<_0x32dbc2[_0x962d('0x6')];_0x44f3ed++){var _0x2decec=_0x835e1f[_0x32dbc2[_0x44f3ed]]['filter'](function(_0x1f5b9a){return _0x1f5b9a['family']===_0x962d('0x7')&&_0x1f5b9a[_0x962d('0x8')]===![];});_0xcf883a=_0xcf883a['concat'](_0x2decec);}return _0xcf883a;}function getFirstInterface(){var _0x19d2e8=_['head'](getInterfaces());return{'macAddress':_0x19d2e8&&_0x19d2e8[_0x962d('0x9')]?_0x19d2e8[_0x962d('0x9')]:_0x962d('0xa'),'ipAddress':_0x19d2e8&&_0x19d2e8[_0x962d('0xb')]?_0x19d2e8['address']:_0x962d('0xc')};}exports[_0x962d('0xd')]=getFirstInterface;function getCPUhash(){var _0x43faf4=_[_0x962d('0x4')](os['cpus']()[_0x962d('0xe')](function(_0x559d8b){return _0x559d8b['model'];}))[_0x962d('0xf')](':');return crypto['createHash']('md5')[_0x962d('0x10')](_0x43faf4)[_0x962d('0x11')]('hex');}exports[_0x962d('0x12')]=function(){var _0x14a14b=os['platform']();var _0x40c65d=/[0-9a-f-]{36}/;if(config[_0x962d('0x13')]&&_0x40c65d['test'](config[_0x962d('0x13')])){return config['licenseToken'];}else if(_0x14a14b===_0x962d('0x14')){return exec(_0x962d('0x15'),{'encoding':_0x962d('0x16')})[_0x962d('0x17')]('\x0d\x0a','');}else{var _0x1457f4=getFirstInterface();var _0x17f69d=getCPUhash();var _0x4a950e=_0x17f69d+'|'+os[_0x962d('0x18')]()+'|'+_0x1457f4[_0x962d('0x19')]+'|'+_0x1457f4[_0x962d('0x1a')];var _0x3e0786=crypto['createHash'](_0x962d('0x1b'))[_0x962d('0x10')](_0x4a950e)[_0x962d('0x11')](_0x962d('0x1c'));return _0x3e0786['substring'](0x0,0x8)+'-'+_0x3e0786[_0x962d('0x1d')](0x8,0xc)+'-'+_0x3e0786[_0x962d('0x1d')](0xc,0x10)+'-'+_0x3e0786['substring'](0x10,0x14)+'-'+_0x3e0786['substring'](0x14);}}; \ No newline at end of file +var _0x36d0=['win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','md5','digest','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','update','getUuid','licenseToken','test'];(function(_0x162fd7,_0x365162){var _0x2373a0=function(_0xa983dc){while(--_0xa983dc){_0x162fd7['push'](_0x162fd7['shift']());}};_0x2373a0(++_0x365162);}(_0x36d0,0xef));var _0x036d=function(_0x47c8da,_0x464581){_0x47c8da=_0x47c8da-0x0;var _0x2f9cae=_0x36d0[_0x47c8da];return _0x2f9cae;};'use strict';var _=require(_0x036d('0x0'));var os=require('os');var crypto=require(_0x036d('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x036d('0x2'))[_0x036d('0x3')];var config=require(_0x036d('0x4'));function getInterfaces(){var _0xeb90c8=[];var _0x14449e=os[_0x036d('0x5')]();var _0x2e7929=_['orderBy'](_[_0x036d('0x6')](_0x14449e));for(var _0x7fbb03=0x0;_0x7fbb03<_0x2e7929[_0x036d('0x7')];_0x7fbb03++){var _0x19a622=_0x14449e[_0x2e7929[_0x7fbb03]][_0x036d('0x8')](function(_0x12432b){return _0x12432b[_0x036d('0x9')]===_0x036d('0xa')&&_0x12432b[_0x036d('0xb')]===![];});_0xeb90c8=_0xeb90c8[_0x036d('0xc')](_0x19a622);}return _0xeb90c8;}function getFirstInterface(){var _0x28fe4c=_['head'](getInterfaces());return{'macAddress':_0x28fe4c&&_0x28fe4c[_0x036d('0xd')]?_0x28fe4c[_0x036d('0xd')]:_0x036d('0xe'),'ipAddress':_0x28fe4c&&_0x28fe4c[_0x036d('0xf')]?_0x28fe4c[_0x036d('0xf')]:_0x036d('0x10')};}exports[_0x036d('0x11')]=getFirstInterface;function getCPUhash(){var _0x2ca7b5=_[_0x036d('0x12')](os[_0x036d('0x13')]()[_0x036d('0x14')](function(_0x174152){return _0x174152[_0x036d('0x15')];}))[_0x036d('0x16')](':');return crypto['createHash']('md5')[_0x036d('0x17')](_0x2ca7b5)['digest']('hex');}exports[_0x036d('0x18')]=function(){var _0x2fee73=os['platform']();var _0x28e62b=/[0-9a-f-]{36}/;if(config[_0x036d('0x19')]&&_0x28e62b[_0x036d('0x1a')](config[_0x036d('0x19')])){return config[_0x036d('0x19')];}else if(_0x2fee73===_0x036d('0x1b')){return exec(_0x036d('0x1c'),{'encoding':'utf8'})[_0x036d('0x1d')]('\x0d\x0a','');}else{var _0x5cb00d=getFirstInterface();var _0x2a44d2=getCPUhash();var _0x6102b2=_0x2a44d2+'|'+os[_0x036d('0x1e')]()+'|'+_0x5cb00d[_0x036d('0x1f')]+'|'+_0x5cb00d[_0x036d('0x20')];var _0x12177e=crypto[_0x036d('0x21')](_0x036d('0x22'))[_0x036d('0x17')](_0x6102b2)[_0x036d('0x23')](_0x036d('0x24'));return _0x12177e[_0x036d('0x25')](0x0,0x8)+'-'+_0x12177e[_0x036d('0x25')](0x8,0xc)+'-'+_0x12177e[_0x036d('0x25')](0xc,0x10)+'-'+_0x12177e[_0x036d('0x25')](0x10,0x14)+'-'+_0x12177e[_0x036d('0x25')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 57cda03..a8adb98 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 _0xa6d4=['%s/api/servers/%s/check?version=%s','exports','GET','then','data1','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','info','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','update','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format'];(function(_0x5b27ed,_0x25b8e1){var _0x38e8d9=function(_0x2e39d2){while(--_0x2e39d2){_0x5b27ed['push'](_0x5b27ed['shift']());}};_0x38e8d9(++_0x25b8e1);}(_0xa6d4,0x1b7));var _0x4a6d=function(_0x107120,_0x40acf9){_0x107120=_0x107120-0x0;var _0x17e468=_0xa6d4[_0x107120];return _0x17e468;};'use strict';var util=require(_0x4a6d('0x0'));var moment=require(_0x4a6d('0x1'));var rp=require(_0x4a6d('0x2'));var BPromise=require(_0x4a6d('0x3'));var pkginfo=require('pkginfo')(module,_0x4a6d('0x4'));var db=require(_0x4a6d('0x5'))['db'];var encryptor=require(_0x4a6d('0x6'));var hardware=require(_0x4a6d('0x7'));var logger=require(_0x4a6d('0x8'))(_0x4a6d('0x9'));var HOST=_0x4a6d('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x268e44){return new BPromise(function(_0x416dd4,_0x1e38d4){var _0x23e906=util[_0x4a6d('0xb')](_0x4a6d('0xc'),HOST,_0x268e44,module['exports'][_0x4a6d('0x4')]);if(oldToken){_0x23e906=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x268e44,module[_0x4a6d('0xd')][_0x4a6d('0x4')],oldToken);}var _0x46793b={'uri':_0x23e906,'method':_0x4a6d('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x46793b)[_0x4a6d('0xf')](function(_0x3d0b21){_0x416dd4(_0x3d0b21);})['catch'](function(_0x4e2128){_0x1e38d4(_0x4e2128);});});}function manageLicense(_0x3048e3,_0x35a8e2){var _0x59c19a=_0x35a8e2['get']({'plain':!![]});if(!isOldTokenSent&&_0x59c19a[_0x4a6d('0x10')]!==_0x3048e3&&!_0x59c19a['data2']){oldToken=_0x59c19a[_0x4a6d('0x10')];}httpRequest(_0x3048e3)['then'](function(_0x29cf2b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x29cf2b[_0x4a6d('0x11')]){isOldTokenSent=![];if(!_0x59c19a['license']&&_0x59c19a[_0x4a6d('0x9')]!=_0x29cf2b['license']||_0x59c19a[_0x4a6d('0x9')]&&_0x59c19a[_0x4a6d('0x12')]){logger['info'](_0x4a6d('0x13'));}if(_0x59c19a[_0x4a6d('0x9')]&&!_0x59c19a[_0x4a6d('0x12')]&&_0x59c19a[_0x4a6d('0x9')]!=_0x29cf2b[_0x4a6d('0x9')]){logger['info'](_0x4a6d('0x14'));}if(_0x59c19a[_0x4a6d('0x9')]&&!_0x59c19a['data2']&&_0x59c19a['license']==_0x29cf2b[_0x4a6d('0x9')]){return _0x35a8e2;}return _0x35a8e2['update']({'data1':_0x3048e3,'data2':null,'license':_0x29cf2b[_0x4a6d('0x9')]});}else{if(_0x29cf2b[_0x4a6d('0x9')]||_0x59c19a[_0x4a6d('0x9')]){if(!_0x59c19a[_0x4a6d('0x12')]){if(_0x59c19a[_0x4a6d('0x10')]==_0x3048e3){GRAY_PERIOD_REASON=_0x4a6d('0x15');logger[_0x4a6d('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x4a6d('0x17');logger[_0x4a6d('0x16')](_0x4a6d('0x18'),_0x59c19a[_0x4a6d('0x10')],_0x3048e3);}logger[_0x4a6d('0x16')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x4a6d('0x19')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x35a8e2[_0x4a6d('0x1a')]({'data2':encryptor['encryptString'](moment()[_0x4a6d('0xb')](_0x4a6d('0x1b')))});}else{if(moment()[_0x4a6d('0x1c')](encryptor[_0x4a6d('0x1d')](_0x59c19a['data2']),_0x4a6d('0x1e'))>DAYS){logger['info'](_0x4a6d('0x1f'),moment()[_0x4a6d('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x35a8e2['update']({'data1':_0x3048e3,'data2':null,'license':null});}}}else{if(_0x59c19a[_0x4a6d('0x10')]!=_0x3048e3){logger[_0x4a6d('0x16')](_0x4a6d('0x18'),_0x59c19a[_0x4a6d('0x10')],_0x3048e3);return _0x35a8e2['update']({'data1':_0x3048e3,'data2':null,'license':null});}}}return _0x35a8e2;})[_0x4a6d('0xf')](function(_0x621016){_0x35a8e2=_0x621016;})['catch'](function(_0x42b842){logger[_0x4a6d('0x20')](_0x42b842[_0x4a6d('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x4a6d('0x22')](),_0x35a8e2);},TIME);});}function defaultLicense(){var _0xb35162=hardware[_0x4a6d('0x22')]();if(_0xb35162){return db[_0x4a6d('0x23')][_0x4a6d('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xb35162}})[_0x4a6d('0x25')](function(_0x30a16c,_0x311e13){logger[_0x4a6d('0x16')](_0x4a6d('0x26'),_0xb35162);manageLicense(_0xb35162,_0x30a16c);})[_0x4a6d('0x27')](function(_0x392574){logger[_0x4a6d('0x20')](_0x392574[_0x4a6d('0x21')]);});}}exports[_0x4a6d('0x28')]=defaultLicense; \ No newline at end of file +var _0x34cb=['./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','days','catch','error','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor'];(function(_0x4e029d,_0x14dfde){var _0x45a9ff=function(_0x1fa9eb){while(--_0x1fa9eb){_0x4e029d['push'](_0x4e029d['shift']());}};_0x45a9ff(++_0x14dfde);}(_0x34cb,0x190));var _0xb34c=function(_0x5bc1e8,_0x26ac75){_0x5bc1e8=_0x5bc1e8-0x0;var _0xb24517=_0x34cb[_0x5bc1e8];return _0xb24517;};'use strict';var util=require(_0xb34c('0x0'));var moment=require(_0xb34c('0x1'));var rp=require(_0xb34c('0x2'));var BPromise=require(_0xb34c('0x3'));var pkginfo=require('pkginfo')(module,_0xb34c('0x4'));var db=require(_0xb34c('0x5'))['db'];var encryptor=require(_0xb34c('0x6'));var hardware=require(_0xb34c('0x7'));var logger=require('../logger')(_0xb34c('0x8'));var HOST=_0xb34c('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5aa271){return new BPromise(function(_0x581690,_0x3cc75d){var _0x89881d=util[_0xb34c('0xa')](_0xb34c('0xb'),HOST,_0x5aa271,module[_0xb34c('0xc')][_0xb34c('0x4')]);if(oldToken){_0x89881d=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5aa271,module[_0xb34c('0xc')]['version'],oldToken);}var _0x486030={'uri':_0x89881d,'method':_0xb34c('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x486030)[_0xb34c('0xe')](function(_0x364782){_0x581690(_0x364782);})['catch'](function(_0x5a226b){_0x3cc75d(_0x5a226b);});});}function manageLicense(_0x376876,_0x421069){var _0x49c916=_0x421069[_0xb34c('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x49c916[_0xb34c('0x10')]!==_0x376876&&!_0x49c916[_0xb34c('0x11')]){oldToken=_0x49c916[_0xb34c('0x10')];}httpRequest(_0x376876)[_0xb34c('0xe')](function(_0x5acb0e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5acb0e['active']){isOldTokenSent=![];if(!_0x49c916[_0xb34c('0x8')]&&_0x49c916['license']!=_0x5acb0e[_0xb34c('0x8')]||_0x49c916[_0xb34c('0x8')]&&_0x49c916['data2']){logger[_0xb34c('0x12')](_0xb34c('0x13'));}if(_0x49c916[_0xb34c('0x8')]&&!_0x49c916[_0xb34c('0x11')]&&_0x49c916[_0xb34c('0x8')]!=_0x5acb0e[_0xb34c('0x8')]){logger[_0xb34c('0x12')](_0xb34c('0x14'));}if(_0x49c916[_0xb34c('0x8')]&&!_0x49c916['data2']&&_0x49c916['license']==_0x5acb0e[_0xb34c('0x8')]){return _0x421069;}return _0x421069['update']({'data1':_0x376876,'data2':null,'license':_0x5acb0e['license']});}else{if(_0x5acb0e['license']||_0x49c916[_0xb34c('0x8')]){if(!_0x49c916[_0xb34c('0x11')]){if(_0x49c916[_0xb34c('0x10')]==_0x376876){GRAY_PERIOD_REASON=_0xb34c('0x15');logger[_0xb34c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xb34c('0x16'),_0x49c916['data1'],_0x376876);}logger[_0xb34c('0x12')](_0xb34c('0x17'),GRAY_PERIOD_REASON[_0xb34c('0x18')](),moment()[_0xb34c('0xa')](_0xb34c('0x19')));return _0x421069[_0xb34c('0x1a')]({'data2':encryptor[_0xb34c('0x1b')](moment()[_0xb34c('0xa')](_0xb34c('0x19')))});}else{if(moment()[_0xb34c('0x1c')](encryptor['decryptString'](_0x49c916[_0xb34c('0x11')]),_0xb34c('0x1d'))>DAYS){logger[_0xb34c('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb34c('0xa')](_0xb34c('0x19')));isOldTokenSent=![];return _0x421069[_0xb34c('0x1a')]({'data1':_0x376876,'data2':null,'license':null});}}}else{if(_0x49c916['data1']!=_0x376876){logger[_0xb34c('0x12')](_0xb34c('0x16'),_0x49c916['data1'],_0x376876);return _0x421069[_0xb34c('0x1a')]({'data1':_0x376876,'data2':null,'license':null});}}}return _0x421069;})[_0xb34c('0xe')](function(_0x171e4c){_0x421069=_0x171e4c;})[_0xb34c('0x1e')](function(_0x3d5d98){logger[_0xb34c('0x1f')](_0x3d5d98[_0xb34c('0x20')]);})[_0xb34c('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xb34c('0x22')](),_0x421069);},TIME);});}function defaultLicense(){var _0x210982=hardware[_0xb34c('0x22')]();if(_0x210982){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x210982}})[_0xb34c('0x23')](function(_0x4eab6c,_0x14406e){logger[_0xb34c('0x12')](_0xb34c('0x24'),_0x210982);manageLicense(_0x210982,_0x4eab6c);})['catch'](function(_0x26ce53){logger[_0xb34c('0x1f')](_0x26ce53['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e0152fc..44435bc 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 _0x732b=['../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','decryptString','format','demo','machineUuid','gray','deadline','add','days','changed','disabled','message','User','findAll','role','sequelize','col','admin','user','then','forEach','count','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','./hardware'];(function(_0x1380ba,_0x4cb763){var _0xebc68b=function(_0x3541fb){while(--_0x3541fb){_0x1380ba['push'](_0x1380ba['shift']());}};_0xebc68b(++_0x4cb763);}(_0x732b,0x12a));var _0xb732=function(_0x4fb120,_0x3bf492){_0x4fb120=_0x4fb120-0x0;var _0x501ebb=_0x732b[_0x4fb120];return _0x501ebb;};'use strict';var util=require(_0xb732('0x0'));var _=require(_0xb732('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xb732('0x2'));var encryptor=require(_0xb732('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb732('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb732('0x5'),'machineUuid':hardware[_0xb732('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb732('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb732('0x7'),'machineUuid':hardware[_0xb732('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5adb2a){return new BPromise(function(_0x5c8ebf,_0x2688c2){return db[_0xb732('0x8')][_0xb732('0x9')](_[_0xb732('0xa')](_0x5adb2a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x4215c1){return checkLicense(_0x4215c1,null);})['then'](function(_0x2062f8){_0x5c8ebf(_0x2062f8);return;})[_0xb732('0xb')](function(_0x5cbf47){_0x2688c2(_0x5cbf47);});});}function checkLicense(_0x56f633,_0x3563dd){if(!_0x56f633){demoLicense[_0xb732('0xc')]=_0x56f633[_0xb732('0xd')];return demoLicense;}try{var _0x23be91=_0x3563dd||_0x56f633[_0xb732('0xe')];if(_[_0xb732('0xf')](_0x23be91)){throw new Error(_0xb732('0x10'));}var _0x48db7f=_0x56f633['data1'];var _0x20412f=_0x56f633[_0xb732('0x11')];var _0x5010fe=_0x48db7f['split']('-')[0x4];var _0x12c1d2=_0x48db7f['split']('-')[0x0];var _0x39d7d3=encryptor[_0xb732('0x12')](_0x23be91,util[_0xb732('0x13')]('%s:%s:%s',_0x5010fe,_0x48db7f,_0x12c1d2));var _0x95d29b=JSON['parse'](_0x39d7d3);_0x95d29b[_0xb732('0x14')]=![];_0x95d29b[_0xb732('0xc')]=_0x48db7f;_0x95d29b[_0xb732('0x15')]=hardware[_0xb732('0x6')]();if(_0x20412f){var _0x38098b=encryptor['decryptString'](_0x20412f);_0x95d29b[_0xb732('0x16')]=_0x38098b;_0x95d29b[_0xb732('0x17')]=moment(_0x38098b)[_0xb732('0x18')](0x7,_0xb732('0x19'))[_0xb732('0x13')]();_0x95d29b['grayReason']=_0x95d29b[_0xb732('0xc')]!=_0x95d29b[_0xb732('0x15')]?_0xb732('0x1a'):_0xb732('0x1b');}return _0x95d29b;}catch(_0x19c12c){breakingLicense[_0xb732('0xc')]=_0x56f633['data1'];breakingLicense[_0xb732('0x1c')]=_0x19c12c[_0xb732('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x43c28f,_0x42c356){getLicense()['then'](function(_0x556632){return db[_0xb732('0x1d')][_0xb732('0x1e')]({'attributes':[_0xb732('0x1f'),[db['sequelize']['fn']('COUNT',db[_0xb732('0x20')][_0xb732('0x21')](_0xb732('0x1f'))),'count']],'group':_0xb732('0x1f'),'where':{'role':{'$or':[_0xb732('0x22'),_0xb732('0x23'),'telephone']}},'raw':!![]})[_0xb732('0x24')](function(_0x3d01af){var _0x46b0ea={'user':_0x556632['users']||0x0,'telephone':_0x556632['telephones']||0x0};_0x3d01af[_0xb732('0x25')](function(_0x12b22d){var _0x322cc5=_0x12b22d[_0xb732('0x1f')]===_0xb732('0x22')?'user':_0x12b22d[_0xb732('0x1f')];_0x46b0ea[_0x322cc5]-=_0x12b22d[_0xb732('0x26')];if(_0x46b0ea[_0x322cc5]<0x0)_0x46b0ea[_0x322cc5]=0x0;});_0x43c28f(_0x46b0ea);return;});})[_0xb732('0xb')](function(_0x4a9253){_0x42c356(_0x4a9253);});});}function checkUserLimits(_0x5c6b40){return new BPromise(function(_0x237376,_0x3af61e){getLimits()[_0xb732('0x24')](function(_0x57d936){var _0x6f3108=_['pick'](_[_0xb732('0x27')](_0x5c6b40,_0xb732('0x1f')),['admin','user','telephone']);var _0x39c94e=(_0x6f3108[_0xb732('0x22')]||0x0)+(_0x6f3108['user']||0x0);var _0x4ac30a=_0x6f3108[_0xb732('0x28')]||0x0;if(_0x39c94e>_0x57d936[_0xb732('0x23')])return _0x3af61e(_0xb732('0x29'));if(_0x4ac30a>_0x57d936[_0xb732('0x28')])return _0x3af61e(_0xb732('0x2a'));return _0x237376();})[_0xb732('0xb')](function(_0x1b8b55){_0x3af61e(_0x1b8b55);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4916=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','add','days','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','countBy'];(function(_0x326797,_0x39262a){var _0x4c2052=function(_0x5468f2){while(--_0x5468f2){_0x326797['push'](_0x326797['shift']());}};_0x4c2052(++_0x39262a);}(_0x4916,0x10a));var _0x6491=function(_0x3b02dd,_0x16847e){_0x3b02dd=_0x3b02dd-0x0;var _0x538563=_0x4916[_0x3b02dd];return _0x538563;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6491('0x0'));var BPromise=require(_0x6491('0x1'));var hardware=require(_0x6491('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x6491('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6491('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6491('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6491('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x6491('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1edab8){return new BPromise(function(_0x492a5a,_0x15cfb4){return db[_0x6491('0x7')][_0x6491('0x8')](_[_0x6491('0x9')](_0x1edab8,{'raw':!![],'where':{'id':0x1}}))[_0x6491('0xa')](function(_0x4929d5){return checkLicense(_0x4929d5,null);})[_0x6491('0xa')](function(_0x263297){_0x492a5a(_0x263297);return;})[_0x6491('0xb')](function(_0x384a34){_0x15cfb4(_0x384a34);});});}function checkLicense(_0x5944e9,_0x481e97){if(!_0x5944e9){demoLicense[_0x6491('0xc')]=_0x5944e9[_0x6491('0xd')];return demoLicense;}try{var _0x38924c=_0x481e97||_0x5944e9[_0x6491('0xe')];if(_[_0x6491('0xf')](_0x38924c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xdb242e=_0x5944e9[_0x6491('0xd')];var _0x3b3b21=_0x5944e9[_0x6491('0x10')];var _0x4ebdda=_0xdb242e[_0x6491('0x11')]('-')[0x4];var _0x50bf1e=_0xdb242e['split']('-')[0x0];var _0x1a6c65=encryptor['decryptString'](_0x38924c,util[_0x6491('0x12')](_0x6491('0x13'),_0x4ebdda,_0xdb242e,_0x50bf1e));var _0x4a765a=JSON[_0x6491('0x14')](_0x1a6c65);_0x4a765a[_0x6491('0x15')]=![];_0x4a765a[_0x6491('0xc')]=_0xdb242e;_0x4a765a[_0x6491('0x16')]=hardware[_0x6491('0x6')]();if(_0x3b3b21){var _0x27e1b7=encryptor[_0x6491('0x17')](_0x3b3b21);_0x4a765a[_0x6491('0x18')]=_0x27e1b7;_0x4a765a['deadline']=moment(_0x27e1b7)[_0x6491('0x19')](0x7,_0x6491('0x1a'))[_0x6491('0x12')]();_0x4a765a['grayReason']=_0x4a765a[_0x6491('0xc')]!=_0x4a765a[_0x6491('0x16')]?_0x6491('0x1b'):_0x6491('0x1c');}return _0x4a765a;}catch(_0x1f0814){breakingLicense['uuid']=_0x5944e9[_0x6491('0xd')];breakingLicense[_0x6491('0x1d')]=_0x1f0814[_0x6491('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x19c98e,_0xd23d93){getLicense()[_0x6491('0xa')](function(_0x24a16b){return db['User'][_0x6491('0x1e')]({'attributes':[_0x6491('0x1f'),[db[_0x6491('0x20')]['fn'](_0x6491('0x21'),db[_0x6491('0x20')][_0x6491('0x22')](_0x6491('0x1f'))),_0x6491('0x23')]],'group':_0x6491('0x1f'),'where':{'role':{'$or':[_0x6491('0x24'),_0x6491('0x25'),_0x6491('0x26')]}},'raw':!![]})[_0x6491('0xa')](function(_0x4482b6){var _0x42a9d8={'user':_0x24a16b[_0x6491('0x27')]||0x0,'telephone':_0x24a16b['telephones']||0x0};_0x4482b6[_0x6491('0x28')](function(_0x423897){var _0x421b21=_0x423897[_0x6491('0x1f')]===_0x6491('0x24')?_0x6491('0x25'):_0x423897[_0x6491('0x1f')];_0x42a9d8[_0x421b21]-=_0x423897[_0x6491('0x23')];if(_0x42a9d8[_0x421b21]<0x0)_0x42a9d8[_0x421b21]=0x0;});_0x19c98e(_0x42a9d8);return;});})['catch'](function(_0x469cbb){_0xd23d93(_0x469cbb);});});}function checkUserLimits(_0x149c93){return new BPromise(function(_0x215a47,_0x22da04){getLimits()[_0x6491('0xa')](function(_0x2702e4){var _0x4dab01=_['pick'](_[_0x6491('0x29')](_0x149c93,_0x6491('0x1f')),[_0x6491('0x24'),'user','telephone']);var _0xa7171b=(_0x4dab01[_0x6491('0x24')]||0x0)+(_0x4dab01[_0x6491('0x25')]||0x0);var _0xf6e6c1=_0x4dab01[_0x6491('0x26')]||0x0;if(_0xa7171b>_0x2702e4['user'])return _0x22da04(_0x6491('0x2a'));if(_0xf6e6c1>_0x2702e4[_0x6491('0x26')])return _0x22da04(_0x6491('0x2b'));return _0x215a47();})[_0x6491('0xb')](function(_0x139a1a){_0x22da04(_0x139a1a);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 9df3d70..5ce5e36 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 _0x02ce=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x49f4f9,_0x5571e3){var _0x42d3d0=function(_0x5babdd){while(--_0x5babdd){_0x49f4f9['push'](_0x49f4f9['shift']());}};_0x42d3d0(++_0x5571e3);}(_0x02ce,0x1ac));var _0xe02c=function(_0x114c95,_0x216df7){_0x114c95=_0x114c95-0x0;var _0x56061d=_0x02ce[_0x114c95];return _0x56061d;};'use strict';module[_0xe02c('0x0')]={'DOMAIN':_0xe02c('0x1'),'SESSION_SECRET':_0xe02c('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe02c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x5f0661,_0x482a00){var _0x216354=function(_0x2c5b0a){while(--_0x2c5b0a){_0x5f0661['push'](_0x5f0661['shift']());}};_0x216354(++_0x482a00);}(_0x1c9a,0x98));var _0xa1c9=function(_0x14b2be,_0xde05de){_0x14b2be=_0x14b2be-0x0;var _0x5ea869=_0x1c9a[_0x14b2be];return _0x5ea869;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c99773e..995828d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8ba=['info','env','debugLevel','winston','util','path','join','/var','log','xcally','format','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','level','exports','Logger','transports','File','%s-%s','error'];(function(_0x49492d,_0x1329e3){var _0x5407e4=function(_0x592b53){while(--_0x592b53){_0x49492d['push'](_0x49492d['shift']());}};_0x5407e4(++_0x1329e3);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x4e8947,_0x5ca04d){_0x4e8947=_0x4e8947-0x0;var _0x29abde=_0xf8ba[_0x4e8947];return _0x29abde;};'use strict';var moment=require('moment');var winston=require(_0xaf8b('0x0'));var util=require(_0xaf8b('0x1'));var path=require(_0xaf8b('0x2'));var debugLevel='INFO';function filename(_0x2e96f1,_0x53ffd1){return path[_0xaf8b('0x3')](_0xaf8b('0x4'),_0xaf8b('0x5'),_0xaf8b('0x6'),util[_0xaf8b('0x7')]('%s-%s.log',_0x2e96f1,_0x53ffd1));}function formatter(_0x2a2654,_0x37cbc2){_0x37cbc2[_0xaf8b('0x8')]=_0x37cbc2[_0xaf8b('0x8')]['replace'](/@@{/g,_0xaf8b('0x9'))[_0xaf8b('0xa')](/}@@/g,'}}}')[_0xaf8b('0xa')](/@{/g,'{{')[_0xaf8b('0xa')](/}@/g,'}}');return util[_0xaf8b('0x7')](_0xaf8b('0xb'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x37cbc2[_0xaf8b('0xc')]['toUpperCase'](),_0x2a2654,_0x37cbc2[_0xaf8b('0x8')]);}module[_0xaf8b('0xd')]=function(_0x1be62f){return new winston[(_0xaf8b('0xe'))]({'transports':[new winston[(_0xaf8b('0xf'))][(_0xaf8b('0x10'))]({'name':util[_0xaf8b('0x7')](_0xaf8b('0x11'),_0x1be62f,_0xaf8b('0x12')),'filename':filename(_0x1be62f,_0xaf8b('0x12')),'level':_0xaf8b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x267298){return formatter(_0x1be62f,_0x267298);}}),new winston[(_0xaf8b('0xf'))]['File']({'name':util[_0xaf8b('0x7')](_0xaf8b('0x11'),_0x1be62f,_0xaf8b('0x13')),'filename':filename(_0x1be62f,_0xaf8b('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xeee7d0){return formatter(_0x1be62f,_0xeee7d0);}}),new winston['transports']['Console']({'level':process[_0xaf8b('0x14')][_0xaf8b('0x15')]||debugLevel,'json':![],'formatter':function(_0x19420a){return formatter(_0x1be62f,_0x19420a);}})]});}; \ No newline at end of file +var _0x114c=['join','/var','log','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','INFO'];(function(_0x4ca852,_0xb69fbf){var _0xaab42c=function(_0x38787e){while(--_0x38787e){_0x4ca852['push'](_0x4ca852['shift']());}};_0xaab42c(++_0xb69fbf);}(_0x114c,0xb4));var _0xc114=function(_0x36e400,_0x54a1b9){_0x36e400=_0x36e400-0x0;var _0x4951e0=_0x114c[_0x36e400];return _0x4951e0;};'use strict';var moment=require(_0xc114('0x0'));var winston=require(_0xc114('0x1'));var util=require(_0xc114('0x2'));var path=require('path');var debugLevel=_0xc114('0x3');function filename(_0x545f77,_0x4b1a1b){return path[_0xc114('0x4')](_0xc114('0x5'),_0xc114('0x6'),'xcally',util['format']('%s-%s.log',_0x545f77,_0x4b1a1b));}function formatter(_0x47fcc5,_0x2b43bb){_0x2b43bb['message']=_0x2b43bb['message'][_0xc114('0x7')](/@@{/g,_0xc114('0x8'))[_0xc114('0x7')](/}@@/g,'}}}')[_0xc114('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xc114('0x9')](_0xc114('0xa'),moment()['format'](_0xc114('0xb')),_0x2b43bb['level'][_0xc114('0xc')](),_0x47fcc5,_0x2b43bb[_0xc114('0xd')]);}module[_0xc114('0xe')]=function(_0x714246){return new winston['Logger']({'transports':[new winston[(_0xc114('0xf'))][(_0xc114('0x10'))]({'name':util[_0xc114('0x9')](_0xc114('0x11'),_0x714246,_0xc114('0x12')),'filename':filename(_0x714246,_0xc114('0x12')),'level':_0xc114('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bd6cb){return formatter(_0x714246,_0x3bd6cb);}}),new winston[(_0xc114('0xf'))]['File']({'name':util[_0xc114('0x9')](_0xc114('0x11'),_0x714246,'info'),'filename':filename(_0x714246,_0xc114('0x13')),'level':_0xc114('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8847e0){return formatter(_0x714246,_0x8847e0);}}),new winston[(_0xc114('0xf'))][(_0xc114('0x14'))]({'level':process[_0xc114('0x15')][_0xc114('0x16')]||debugLevel,'json':![],'formatter':function(_0x26cff7){return formatter(_0x714246,_0x26cff7);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 810755d..4481fa1 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 _0x2cab=['../../services/email/index.js','routing','../../services/xdr/index.js','join','../../services/express/index.js','ami','agi','../../services/agi/index.js','email'];(function(_0x3c45f1,_0x3c0154){var _0x284da5=function(_0x24db4f){while(--_0x24db4f){_0x3c45f1['push'](_0x3c45f1['shift']());}};_0x284da5(++_0x3c0154);}(_0x2cab,0x1f2));var _0xb2ca=function(_0x448630,_0x5a831e){_0x448630=_0x448630-0x0;var _0x948b4b=_0x2cab[_0x448630];return _0x948b4b;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0xb2ca('0x0')](__dirname,_0xb2ca('0x1'))},{'name':_0xb2ca('0x2'),'script':path[_0xb2ca('0x0')](__dirname,'../../services/ami/index.js')},{'name':_0xb2ca('0x3'),'script':path[_0xb2ca('0x0')](__dirname,_0xb2ca('0x4'))},{'name':_0xb2ca('0x5'),'script':path[_0xb2ca('0x0')](__dirname,_0xb2ca('0x6'))},{'name':_0xb2ca('0x7'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xb2ca('0x0')](__dirname,_0xb2ca('0x8'))}]};module['exports']=config; \ No newline at end of file +var _0x2412=['join','../../services/ami/index.js','../../services/email/index.js','../../services/routing/index.js','exports','path','express','../../services/express/index.js','ami'];(function(_0x43b0e7,_0x84c98a){var _0x207d0f=function(_0x10c9f6){while(--_0x10c9f6){_0x43b0e7['push'](_0x43b0e7['shift']());}};_0x207d0f(++_0x84c98a);}(_0x2412,0x1a3));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x2241('0x0'));var os=require('os');var config={'apps':[{'name':_0x2241('0x1'),'script':path['join'](__dirname,_0x2241('0x2'))},{'name':_0x2241('0x3'),'script':path[_0x2241('0x4')](__dirname,_0x2241('0x5'))},{'name':'agi','script':path[_0x2241('0x4')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0x2241('0x6'))},{'name':'routing','script':path[_0x2241('0x4')](__dirname,_0x2241('0x7'))},{'name':'xdr','script':path[_0x2241('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0x2241('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 13a4192..47283d4 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 _0x85d7=['delete','dump','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe'];(function(_0x3ea202,_0x21ed8f){var _0x43aaae=function(_0x41d9c9){while(--_0x41d9c9){_0x3ea202['push'](_0x3ea202['shift']());}};_0x43aaae(++_0x21ed8f);}(_0x85d7,0x6a));var _0x785d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x85d7[_0x5bd426];return _0x23a7eb;};'use strict';var pm2=require('pm2');var BPromise=require(_0x785d('0x0'));var config=require(_0x785d('0x1'));function connect(){return new BPromise(function(_0x5d0968,_0x2c764c){return pm2[_0x785d('0x2')](function(_0x3f35a5){if(_0x3f35a5){return _0x2c764c(_0x3f35a5);}return _0x5d0968(_0x785d('0x3'));});});};exports[_0x785d('0x4')]=function(_0x125333){return connect()[_0x785d('0x5')](function(){return new BPromise(function(_0x4869c8,_0x4af9c2){return pm2[_0x785d('0x4')](_0x125333,function(_0x1d77ca,_0x40c6ee){if(_0x1d77ca){return _0x4af9c2(_0x1d77ca);}pm2[_0x785d('0x6')]();return _0x4869c8(_0x40c6ee);});});});};exports[_0x785d('0x7')]=function(_0x501bd2){return connect()[_0x785d('0x5')](function(){return new BPromise(function(_0x896c0c,_0x502aba){return pm2['stop'](_0x501bd2,function(_0x3063bc,_0x4856e4){if(_0x3063bc){return _0x502aba(_0x3063bc);}pm2['disconnect']();return _0x896c0c(_0x4856e4);});});});};exports[_0x785d('0x8')]=function(_0xad63de){return connect()[_0x785d('0x5')](function(){return new BPromise(function(_0x50ddff,_0x3c903f){return pm2[_0x785d('0x8')](_0xad63de,function(_0x87963c,_0x215067){if(_0x87963c){return _0x3c903f(_0x87963c);}pm2[_0x785d('0x6')]();return _0x50ddff(_0x215067);});});});};exports[_0x785d('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x51fe0b,_0x5bd879){return pm2['list'](function(_0x537aa2,_0x94ebb2){if(_0x537aa2){return _0x5bd879(_0x537aa2);}pm2[_0x785d('0x6')]();return _0x51fe0b(_0x94ebb2);});});});};exports[_0x785d('0xa')]=function(_0x243754){return connect()['then'](function(){return new BPromise(function(_0x4f6d98,_0x5d985a){return pm2[_0x785d('0xa')](_0x243754,function(_0x23286d,_0x292d4f){if(_0x23286d){return _0x5d985a(_0x23286d);}pm2[_0x785d('0x6')]();return _0x4f6d98(_0x292d4f);});});});};exports[_0x785d('0xb')]=function(_0x3f33aa){return connect()['then'](function(){return new BPromise(function(_0x416949,_0x2a5911){return pm2[_0x785d('0xb')](_0x3f33aa,function(_0x197df2,_0x137ad8){if(_0x197df2){return _0x2a5911(_0x197df2);}pm2[_0x785d('0x6')]();return _0x416949(_0x137ad8);});});});};exports[_0x785d('0xc')]=function(){return connect()[_0x785d('0x5')](function(){return new BPromise(function(_0x2878ac,_0x1c9f2d){return pm2['dump'](function(_0x5e198d){if(_0x5e198d){return _0x1c9f2d(_0x5e198d);}return _0x2878ac('saved');});});});}; \ No newline at end of file +var _0xd11d=['describe','delete','dump','saved','pm2','bluebird','./config','connect','then','start','disconnect','stop','restart','list'];(function(_0x171882,_0x265c97){var _0x23a210=function(_0x183bd2){while(--_0x183bd2){_0x171882['push'](_0x171882['shift']());}};_0x23a210(++_0x265c97);}(_0xd11d,0x19a));var _0xdd11=function(_0xf3f4d0,_0x1419b4){_0xf3f4d0=_0xf3f4d0-0x0;var _0x29565c=_0xd11d[_0xf3f4d0];return _0x29565c;};'use strict';var pm2=require(_0xdd11('0x0'));var BPromise=require(_0xdd11('0x1'));var config=require(_0xdd11('0x2'));function connect(){return new BPromise(function(_0x4379e9,_0x3d79ed){return pm2[_0xdd11('0x3')](function(_0x13892d){if(_0x13892d){return _0x3d79ed(_0x13892d);}return _0x4379e9('connected');});});};exports['start']=function(_0x1be615){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x487296,_0x4beec8){return pm2[_0xdd11('0x5')](_0x1be615,function(_0x5ecaca,_0xd7326e){if(_0x5ecaca){return _0x4beec8(_0x5ecaca);}pm2[_0xdd11('0x6')]();return _0x487296(_0xd7326e);});});});};exports[_0xdd11('0x7')]=function(_0xe32e80){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x475313,_0x6f5351){return pm2[_0xdd11('0x7')](_0xe32e80,function(_0x463a14,_0x924ed3){if(_0x463a14){return _0x6f5351(_0x463a14);}pm2[_0xdd11('0x6')]();return _0x475313(_0x924ed3);});});});};exports[_0xdd11('0x8')]=function(_0x138a68){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x13136d,_0x1eecc7){return pm2['restart'](_0x138a68,function(_0x2135f4,_0x5d233b){if(_0x2135f4){return _0x1eecc7(_0x2135f4);}pm2['disconnect']();return _0x13136d(_0x5d233b);});});});};exports[_0xdd11('0x9')]=function(){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x1cc07b,_0x21a5a0){return pm2['list'](function(_0x4a35dd,_0x7fcf50){if(_0x4a35dd){return _0x21a5a0(_0x4a35dd);}pm2[_0xdd11('0x6')]();return _0x1cc07b(_0x7fcf50);});});});};exports['describe']=function(_0x2dfedc){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x6d0a87,_0x4f9c1e){return pm2[_0xdd11('0xa')](_0x2dfedc,function(_0x18024d,_0xa63353){if(_0x18024d){return _0x4f9c1e(_0x18024d);}pm2['disconnect']();return _0x6d0a87(_0xa63353);});});});};exports[_0xdd11('0xb')]=function(_0x426139){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x583df9,_0x4a378a){return pm2['delete'](_0x426139,function(_0x20db3c,_0xb66210){if(_0x20db3c){return _0x4a378a(_0x20db3c);}pm2[_0xdd11('0x6')]();return _0x583df9(_0xb66210);});});});};exports[_0xdd11('0xc')]=function(){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x189aca,_0x51b593){return pm2[_0xdd11('0xc')](function(_0x5a924d){if(_0x5a924d){return _0x51b593(_0x5a924d);}return _0x189aca(_0xdd11('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2d9df28..2d022b7 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 _0x049e=['../../mysqldb','../logger','redis','socket.io-emitter','Setting','chatTimeout','then','findAll','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x049e,0x1ea));var _0xe049=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x049e[_0x2468b5];return _0x1056e4;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var config=require(_0xe049('0x2'));var db=require(_0xe049('0x3'))['db'];var logger=require(_0xe049('0x4'))('schedule');config[_0xe049('0x5')]=_['defaults'](config[_0xe049('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe049('0x6'))(new Redis(config[_0xe049('0x5')]));function closeInteractions(){var _0x1d6c49=0x0;var _0x43dfcc=[];return db[_0xe049('0x7')]['find']({'raw':!![],'attributes':['id',_0xe049('0x8')],'where':{'id':0x1}})[_0xe049('0x9')](function(_0x37ac73){_0x1d6c49=_0x37ac73['chatTimeout'];if(_0x1d6c49){return db['ChatInteraction'][_0xe049('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe049('0xb')](_0x37ac73[_0xe049('0x8')],_0xe049('0xc'))}}});}else{return[];}})[_0xe049('0x9')](function(_0x418119){if(_0x418119&&_0x418119[_0xe049('0xd')]){_0x43dfcc=_['map'](_0x418119||[],'id');logger[_0xe049('0xe')](_0xe049('0xf'),_0x43dfcc[_0xe049('0x10')]());return db[_0xe049('0x11')]['update']({'closeReason':_0xe049('0x12'),'disposition':_0xe049('0x13'),'closed':!![],'closedAt':moment()[_0xe049('0x14')](_0xe049('0x15'))},{'where':{'id':_0x43dfcc}});}})['then'](function(){if(_0x43dfcc&&_0x43dfcc['length']){logger[_0xe049('0xe')](_0xe049('0x16'),_0x43dfcc[_0xe049('0x10')]());for(var _0x1fbaee=0x0;_0x1fbaee<_0x43dfcc[_0xe049('0xd')];_0x1fbaee++){io[_0xe049('0x17')](_0xe049('0x18'),{'id':_0x43dfcc[_0x1fbaee],'closed':!![]});}}})[_0xe049('0x19')](function(_0x175668){logger['error'](_0xe049('0x1a'),_0x175668?util[_0xe049('0x1b')](_0x175668,{'showHidden':![],'depth':null}):'');});}exports[_0xe049('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x841e=['../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util'];(function(_0x3546aa,_0x478de8){var _0x52e75e=function(_0x46e023){while(--_0x46e023){_0x3546aa['push'](_0x3546aa['shift']());}};_0x52e75e(++_0x478de8);}(_0x841e,0x148));var _0xe841=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x841e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var config=require(_0xe841('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xe841('0x3'))(_0xe841('0x4'));config['redis']=_['defaults'](config[_0xe841('0x5')],{'host':_0xe841('0x6'),'port':0x18eb});var io=require(_0xe841('0x7'))(new Redis(config[_0xe841('0x5')]));function closeInteractions(){var _0x123a14=0x0;var _0x4858c8=[];return db[_0xe841('0x8')][_0xe841('0x9')]({'raw':!![],'attributes':['id',_0xe841('0xa')],'where':{'id':0x1}})[_0xe841('0xb')](function(_0x592cc8){_0x123a14=_0x592cc8[_0xe841('0xa')];if(_0x123a14){return db[_0xe841('0xc')]['findAll']({'raw':!![],'attributes':['id',_0xe841('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe841('0xe')](_0x592cc8['chatTimeout'],_0xe841('0xf'))}}});}else{return[];}})[_0xe841('0xb')](function(_0x3a07e8){if(_0x3a07e8&&_0x3a07e8[_0xe841('0x10')]){_0x4858c8=_[_0xe841('0x11')](_0x3a07e8||[],'id');logger[_0xe841('0x12')](_0xe841('0x13'),_0x4858c8[_0xe841('0x14')]());return db[_0xe841('0xc')][_0xe841('0x15')]({'closeReason':_0xe841('0x16'),'disposition':_0xe841('0x17'),'closed':!![],'closedAt':moment()[_0xe841('0x18')](_0xe841('0x19'))},{'where':{'id':_0x4858c8}});}})[_0xe841('0xb')](function(){if(_0x4858c8&&_0x4858c8[_0xe841('0x10')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4858c8[_0xe841('0x14')]());for(var _0x1ed0a5=0x0;_0x1ed0a5<_0x4858c8['length'];_0x1ed0a5++){io[_0xe841('0x1a')](_0xe841('0x1b'),{'id':_0x4858c8[_0x1ed0a5],'closed':!![]});}}})[_0xe841('0x1c')](function(_0x59ecb3){logger[_0xe841('0x1d')](_0xe841('0x1e'),_0x59ecb3?util[_0xe841('0x1f')](_0x59ecb3,{'showHidden':![],'depth':null}):'');});}exports[_0xe841('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e970559..2d21220 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 _0xda6a=['message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','no\x20report\x20id','Schedule','findAll','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','length','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','update\x20cron','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','Sent','attachments'];(function(_0x2f4bc9,_0x55eb69){var _0x5ba046=function(_0x51a5e6){while(--_0x51a5e6){_0x2f4bc9['push'](_0x2f4bc9['shift']());}};_0x5ba046(++_0x55eb69);}(_0xda6a,0x181));var _0xada6=function(_0x5ecad9,_0x5be6dd){_0x5ecad9=_0x5ecad9-0x0;var _0x2076fb=_0xda6a[_0x5ecad9];return _0x2076fb;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xada6('0x0'));var BPromise=require(_0xada6('0x1'));var logger=require(_0xada6('0x2'))('schedule');var db=require(_0xada6('0x3'))['db'];var analyticCustomReportController=require(_0xada6('0x4'));var analyticDefaultReportController=require(_0xada6('0x5'));var client=jayson[_0xada6('0x6')][_0xada6('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x123a4c,_0x227aed){return function(){logger[_0xada6('0x8')](_0xada6('0x9'),_0x123a4c[_0xada6('0xa')]);var _0x440f39=!![];var _0x173ed5={'tls':{'rejectUnauthorized':![]}};if(_0x123a4c[_0xada6('0xb')][_0xada6('0xc')][_0xada6('0xd')]){_0x173ed5[_0xada6('0xd')]=_0x123a4c[_0xada6('0xb')][_0xada6('0xc')][_0xada6('0xd')];}else{_0x173ed5[_0xada6('0xe')]=_0x123a4c[_0xada6('0xb')][_0xada6('0xc')][_0xada6('0xe')];_0x173ed5['port']=_0x123a4c[_0xada6('0xb')]['Smtp'][_0xada6('0xf')];_0x173ed5[_0xada6('0x10')]=_0x123a4c[_0xada6('0xb')][_0xada6('0xc')][_0xada6('0x10')];}if(_0x123a4c[_0xada6('0xb')][_0xada6('0xc')][_0xada6('0x11')]){_0x173ed5['auth']={'user':_0x123a4c[_0xada6('0xb')]['Smtp'][_0xada6('0x12')],'pass':_0x123a4c[_0xada6('0xb')][_0xada6('0xc')]['pass']};}var _0x5604cb={'account':_0x173ed5,'message':{'from':util[_0xada6('0x13')](_0xada6('0x14'),_0x123a4c[_0xada6('0xb')][_0xada6('0x15')],_0x123a4c[_0xada6('0xb')][_0xada6('0xa')]||_0x123a4c[_0xada6('0xb')]['Smtp'][_0xada6('0x12')]),'to':_0x123a4c[_0xada6('0xa')],'cc':_0x123a4c['cc'],'bcc':_0x123a4c[_0xada6('0x16')],'subject':util[_0xada6('0x13')](_0xada6('0x17'),_0x227aed[_0xada6('0x15')],_0x123a4c[_0xada6('0x18')],_0x123a4c[_0xada6('0x19')])}};var _0x2d9108=path[_0xada6('0x1a')](__dirname,_0xada6('0x1b'));var _0x239586=_0x227aed[_0xada6('0x1c')];var _0x4ec81e=util['format']('%s.%s',path[_0xada6('0x1d')](_0x227aed[_0xada6('0x1c')],path[_0xada6('0x1e')](_0x227aed[_0xada6('0x1c')])),_0xada6('0x1f'));var _0x1b7a9b=path['join'](_0x2d9108,_0x239586);var _0x381edc=path[_0xada6('0x1a')](_0x2d9108,_0x4ec81e);if(fs[_0xada6('0x20')](_0x1b7a9b)){_0x227aed['status']=_0xada6('0x21');_0x5604cb['message'][_0xada6('0x22')]=[{'filename':_0x239586,'path':_0x1b7a9b}];_0x5604cb[_0xada6('0x23')][_0xada6('0x24')]=util[_0xada6('0x13')](_0xada6('0x25'),JSON[_0xada6('0x26')](_0x227aed,null,0x2));}else if(fs[_0xada6('0x20')](_0x381edc)){_0x227aed['status']=_0xada6('0x21');_0x5604cb[_0xada6('0x23')]['attachments']=[{'filename':_0x4ec81e,'path':_0x381edc}];}else{_0x5604cb[_0xada6('0x23')][_0xada6('0x24')]=_0xada6('0x27');if(!_0x123a4c[_0xada6('0x28')]){_0x440f39=![];logger['info'](_0xada6('0x29'));}}if(_0x440f39){return client['request'](_0xada6('0x2a'),_0x5604cb)[_0xada6('0x2b')](function(_0x2a7434){if(_0x2a7434[_0xada6('0x2c')]){return logger[_0xada6('0x2c')]('error\x20mail',JSON['stringify'](_0x2a7434));}return logger['info']('email\x20sent');})['catch'](function(_0x4c3574){return logger[_0xada6('0x2c')](_0xada6('0x2d'),JSON[_0xada6('0x26')](_0x4c3574));});}};}function handleError(){return function(_0x4067be){return logger[_0xada6('0x2c')](JSON[_0xada6('0x26')](_0x4067be));};}function handleResult(_0x3744eb){return function(_0x184825){logger[_0xada6('0x8')](_0xada6('0x2e'),JSON[_0xada6('0x26')](_0x184825));if(_0x3744eb[_0xada6('0xb')]&&_0x3744eb[_0xada6('0xb')][_0xada6('0xc')]&&!_['isNil'](_0x3744eb[_0xada6('0xa')])){setTimeout(handleSendEmail(_0x3744eb,_0x184825),0x3c*0x3e8);}};}function handleJob(_0xe2d5d){return function(){try{if(_[_0xada6('0x2f')](_0xe2d5d[_0xada6('0x18')])){return logger[_0xada6('0x8')](_0xada6('0x30'));}if(_['isNil'](_0xe2d5d['subtractUnit'])){return logger[_0xada6('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x4fe042={'startDate':moment()[_0xada6('0x31')](_0xe2d5d['subtractNumber'],_0xe2d5d['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xada6('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xada6('0x32'),'output':_0xe2d5d[_0xada6('0x33')],'name':_0xe2d5d[_0xada6('0x15')]};if(!_[_0xada6('0x2f')](_0xe2d5d['DefaultReportId'])){logger[_0xada6('0x8')](_0xada6('0x34'),_0xe2d5d[_0xada6('0x35')]);return analyticDefaultReportController['runReport']({'id':_0xe2d5d[_0xada6('0x35')]},_0x4fe042)[_0xada6('0x2b')](handleResult(_0xe2d5d))['catch'](handleError());}if(!_[_0xada6('0x2f')](_0xe2d5d[_0xada6('0x36')])){logger[_0xada6('0x8')](_0xada6('0x37'),_0xe2d5d[_0xada6('0x36')]);return analyticCustomReportController[_0xada6('0x38')]({'id':_0xe2d5d[_0xada6('0x36')]},_0x4fe042)[_0xada6('0x2b')](handleResult(_0xe2d5d))[_0xada6('0x39')](handleError());}}catch(_0x3a452e){logger[_0xada6('0x2c')](JSON[_0xada6('0x26')](_0x3a452e));}return logger[_0xada6('0x8')](_0xada6('0x3a'));};}function getJobs(_0x1dba79){var _0x425c75={};if(_0x1dba79){_0x425c75['id']=_0x1dba79;}return db[_0xada6('0x3b')][_0xada6('0x3c')]({'where':_0x425c75,'include':[{'model':db[_0xada6('0xb')],'attributes':['id',_0xada6('0x15'),_0xada6('0xa')],'include':[{'model':db['MailServerOut'],'as':_0xada6('0xc')}]}]})[_0xada6('0x2b')](function(_0x3ec23b){var _0x18bf72=_[_0xada6('0x3d')](manager[_0xada6('0x3e')]);var _0x490c44=_[_0xada6('0x3f')](_0x3ec23b,function(_0x23b642){return _0x23b642['id'][_0xada6('0x40')]();});var _0x310af8=_[_0xada6('0x41')](_0x3ec23b,function(_0x23275e){return _0x23275e['id'][_0xada6('0x40')]();});var _0x591545=_0x1dba79?_0x490c44:_[_0xada6('0x42')](_0x490c44,_0x18bf72);var _0x40f2d0=_[_0xada6('0x43')](_0x490c44,_0x18bf72);var _0x55386f=_[_0xada6('0x42')](_0x18bf72,_0x490c44);var _0x597353;var _0x5857f6;for(_0x597353=0x0;_0x597353<_0x55386f['length']&&!_0x1dba79;_0x597353+=0x1){_0x5857f6=_0x55386f[_0x597353][_0xada6('0x40')]();if(manager[_0xada6('0x44')](_0x5857f6)){manager[_0xada6('0x45')](_0x5857f6);manager[_0xada6('0x46')](_0x5857f6);logger[_0xada6('0x8')]('delete\x20cron',_0x5857f6);}}logger[_0xada6('0x8')]('toRun',JSON[_0xada6('0x26')](_0x591545));for(_0x597353=0x0;_0x597353<_0x591545[_0xada6('0x47')];_0x597353+=0x1){_0x5857f6=_0x591545[_0x597353][_0xada6('0x40')]();logger[_0xada6('0x8')](_0xada6('0x48'),_0x5857f6);if(_0x1dba79){logger[_0xada6('0x8')]('my\x20id',_0x1dba79);logger['info'](JSON['stringify'](_0x310af8[_0x5857f6]));BPromise[_0xada6('0x49')]()[_0xada6('0x2b')](handleJob(_0x310af8[_0x5857f6]));logger['info'](_0xada6('0x4a'),_0x310af8[_0x5857f6][_0xada6('0x15')],_0x310af8[_0x5857f6][_0xada6('0x4b')]);}else if(_0x310af8[_0x5857f6]['cron']&&_0x310af8[_0x5857f6][_0xada6('0x4c')]&&moment()[_0xada6('0x4d')](_0x310af8[_0x5857f6][_0xada6('0x4e')],_0x310af8[_0x5857f6][_0xada6('0x4f')])){manager[_0xada6('0x50')](_0x5857f6,_0x310af8[_0x5857f6][_0xada6('0x4b')],handleJob(_0x310af8[_0x5857f6]));manager[_0xada6('0x51')](_0x5857f6);logger[_0xada6('0x8')]('add\x20cron',_0x310af8[_0x5857f6][_0xada6('0x15')],_0x310af8[_0x5857f6]['cron']);}else if(manager[_0xada6('0x44')](_0x5857f6)){manager[_0xada6('0x45')](_0x5857f6);manager['deleteJob'](_0x5857f6);logger[_0xada6('0x8')](_0xada6('0x52'),_0x310af8[_0x5857f6][_0xada6('0x15')],_0x310af8[_0x5857f6][_0xada6('0x4b')]);}}for(_0x597353=0x0,_0x5857f6;_0x597353<_0x40f2d0[_0xada6('0x47')]&&!_0x1dba79;_0x597353+=0x1){_0x5857f6=_0x40f2d0[_0x597353][_0xada6('0x40')]();if(manager['exists'](_0x5857f6)){if(_0x310af8[_0x5857f6][_0xada6('0x4b')]&&_0x310af8[_0x5857f6][_0xada6('0x4c')]&&moment()[_0xada6('0x4d')](_0x310af8[_0x5857f6][_0xada6('0x4e')],_0x310af8[_0x5857f6]['endAt'])){manager['update'](_0x5857f6,_0x310af8[_0x5857f6][_0xada6('0x4b')],handleJob(_0x310af8[_0x5857f6]));logger[_0xada6('0x8')](_0xada6('0x53'),_0x310af8[_0x5857f6][_0xada6('0x15')],_0x310af8[_0x5857f6][_0xada6('0x4b')]);}else{manager['stop'](_0x5857f6);manager[_0xada6('0x46')](_0x5857f6);logger[_0xada6('0x8')]('stop\x20cron',_0x310af8[_0x5857f6]['name'],_0x310af8[_0x5857f6][_0xada6('0x4b')]);}}}})['catch'](function(_0x1918f1){logger[_0xada6('0x2c')](JSON['stringify'](_0x1918f1));});}exports['run']=function(_0x2eda0a){return getJobs(_0x2eda0a);};exports[_0xada6('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x875b=['info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','Schedule','MailServerOut','jobs','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','stop\x20cron','active','update','update\x20cron','run','start','path','lodash','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x875b,0x157));var _0xb875=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x875b[_0x3b90ab];return _0x206e92;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xb875('0x0'));var _=require(_0xb875('0x1'));var moment=require('moment');var CronJobManager=require(_0xb875('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0xb875('0x3'));var logger=require('../logger')(_0xb875('0x4'));var db=require(_0xb875('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb875('0x6'));var client=jayson[_0xb875('0x7')][_0xb875('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a9e3b,_0x124346){return function(){logger[_0xb875('0x9')](_0xb875('0xa'),_0x2a9e3b[_0xb875('0xb')]);var _0x3fae82=!![];var _0x3bcaa8={'tls':{'rejectUnauthorized':![]}};if(_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0xd')]){_0x3bcaa8['service']=_0x2a9e3b[_0xb875('0xc')]['Smtp']['service'];}else{_0x3bcaa8[_0xb875('0xe')]=_0x2a9e3b['MailAccount'][_0xb875('0xf')][_0xb875('0xe')];_0x3bcaa8[_0xb875('0x10')]=_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')]['port'];_0x3bcaa8[_0xb875('0x11')]=_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0x11')];}if(_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')][_0xb875('0x12')]){_0x3bcaa8[_0xb875('0x13')]={'user':_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0x14')],'pass':_0x2a9e3b[_0xb875('0xc')]['Smtp']['pass']};}var _0x42cd81={'account':_0x3bcaa8,'message':{'from':util[_0xb875('0x15')](_0xb875('0x16'),_0x2a9e3b[_0xb875('0xc')][_0xb875('0x17')],_0x2a9e3b[_0xb875('0xc')][_0xb875('0xb')]||_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')]['user']),'to':_0x2a9e3b[_0xb875('0xb')],'cc':_0x2a9e3b['cc'],'bcc':_0x2a9e3b[_0xb875('0x18')],'subject':util[_0xb875('0x15')](_0xb875('0x19'),_0x124346[_0xb875('0x17')],_0x2a9e3b[_0xb875('0x1a')],_0x2a9e3b[_0xb875('0x1b')])}};var _0x3c8927=path[_0xb875('0x1c')](__dirname,_0xb875('0x1d'));var _0x141217=_0x124346[_0xb875('0x1e')];var _0x18a08d=util[_0xb875('0x15')]('%s.%s',path[_0xb875('0x1f')](_0x124346[_0xb875('0x1e')],path[_0xb875('0x20')](_0x124346[_0xb875('0x1e')])),_0xb875('0x21'));var _0x5ae38c=path['join'](_0x3c8927,_0x141217);var _0x8be9ac=path['join'](_0x3c8927,_0x18a08d);if(fs['existsSync'](_0x5ae38c)){_0x124346[_0xb875('0x22')]=_0xb875('0x23');_0x42cd81['message']['attachments']=[{'filename':_0x141217,'path':_0x5ae38c}];_0x42cd81[_0xb875('0x24')][_0xb875('0x25')]=util[_0xb875('0x15')](_0xb875('0x26'),JSON['stringify'](_0x124346,null,0x2));}else if(fs['existsSync'](_0x8be9ac)){_0x124346['status']=_0xb875('0x23');_0x42cd81['message']['attachments']=[{'filename':_0x18a08d,'path':_0x8be9ac}];}else{_0x42cd81[_0xb875('0x24')][_0xb875('0x25')]=_0xb875('0x27');if(!_0x2a9e3b[_0xb875('0x28')]){_0x3fae82=![];logger['info'](_0xb875('0x29'));}}if(_0x3fae82){return client[_0xb875('0x2a')](_0xb875('0x2b'),_0x42cd81)[_0xb875('0x2c')](function(_0x120f6d){if(_0x120f6d[_0xb875('0x2d')]){return logger[_0xb875('0x2d')](_0xb875('0x2e'),JSON[_0xb875('0x2f')](_0x120f6d));}return logger[_0xb875('0x9')](_0xb875('0x30'));})['catch'](function(_0x10c1b9){return logger[_0xb875('0x2d')](_0xb875('0x2e'),JSON[_0xb875('0x2f')](_0x10c1b9));});}};}function handleError(){return function(_0x1f038d){return logger[_0xb875('0x2d')](JSON['stringify'](_0x1f038d));};}function handleResult(_0x303b68){return function(_0x25d98f){logger[_0xb875('0x9')](_0xb875('0x31'),JSON[_0xb875('0x2f')](_0x25d98f));if(_0x303b68['MailAccount']&&_0x303b68['MailAccount'][_0xb875('0xf')]&&!_[_0xb875('0x32')](_0x303b68[_0xb875('0xb')])){setTimeout(handleSendEmail(_0x303b68,_0x25d98f),0x3c*0x3e8);}};}function handleJob(_0x4b2901){return function(){try{if(_[_0xb875('0x32')](_0x4b2901['subtractNumber'])){return logger[_0xb875('0x9')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb875('0x32')](_0x4b2901[_0xb875('0x1b')])){return logger[_0xb875('0x9')](_0xb875('0x33'));}var _0x2066d2={'startDate':moment()[_0xb875('0x34')](_0x4b2901[_0xb875('0x1a')],_0x4b2901['subtractUnit'])[_0xb875('0x15')](_0xb875('0x35')),'endDate':moment()['format'](_0xb875('0x35')),'type':_0xb875('0x36'),'output':_0x4b2901[_0xb875('0x37')],'name':_0x4b2901[_0xb875('0x17')]};if(!_[_0xb875('0x32')](_0x4b2901[_0xb875('0x38')])){logger[_0xb875('0x9')](_0xb875('0x39'),_0x4b2901[_0xb875('0x38')]);return analyticDefaultReportController[_0xb875('0x3a')]({'id':_0x4b2901[_0xb875('0x38')]},_0x2066d2)[_0xb875('0x2c')](handleResult(_0x4b2901))['catch'](handleError());}if(!_[_0xb875('0x32')](_0x4b2901['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4b2901[_0xb875('0x3b')]);return analyticCustomReportController[_0xb875('0x3a')]({'id':_0x4b2901[_0xb875('0x3b')]},_0x2066d2)[_0xb875('0x2c')](handleResult(_0x4b2901))[_0xb875('0x3c')](handleError());}}catch(_0x477753){logger['error'](JSON[_0xb875('0x2f')](_0x477753));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5929cd){var _0x1195cd={};if(_0x5929cd){_0x1195cd['id']=_0x5929cd;}return db[_0xb875('0x3d')]['findAll']({'where':_0x1195cd,'include':[{'model':db[_0xb875('0xc')],'attributes':['id',_0xb875('0x17'),_0xb875('0xb')],'include':[{'model':db[_0xb875('0x3e')],'as':_0xb875('0xf')}]}]})[_0xb875('0x2c')](function(_0xd791b3){var _0xa98840=_['keys'](manager[_0xb875('0x3f')]);var _0x2d3724=_[_0xb875('0x40')](_0xd791b3,function(_0x5a0c67){return _0x5a0c67['id']['toString']();});var _0x20edc1=_[_0xb875('0x41')](_0xd791b3,function(_0x1a3ba6){return _0x1a3ba6['id'][_0xb875('0x42')]();});var _0x10a77b=_0x5929cd?_0x2d3724:_[_0xb875('0x43')](_0x2d3724,_0xa98840);var _0x323ca0=_[_0xb875('0x44')](_0x2d3724,_0xa98840);var _0x46e354=_[_0xb875('0x43')](_0xa98840,_0x2d3724);var _0x4ae919;var _0x3f096b;for(_0x4ae919=0x0;_0x4ae919<_0x46e354['length']&&!_0x5929cd;_0x4ae919+=0x1){_0x3f096b=_0x46e354[_0x4ae919][_0xb875('0x42')]();if(manager[_0xb875('0x45')](_0x3f096b)){manager[_0xb875('0x46')](_0x3f096b);manager[_0xb875('0x47')](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x48'),_0x3f096b);}}logger[_0xb875('0x9')]('toRun',JSON[_0xb875('0x2f')](_0x10a77b));for(_0x4ae919=0x0;_0x4ae919<_0x10a77b[_0xb875('0x49')];_0x4ae919+=0x1){_0x3f096b=_0x10a77b[_0x4ae919][_0xb875('0x42')]();logger[_0xb875('0x9')](_0xb875('0x4a'),_0x3f096b);if(_0x5929cd){logger[_0xb875('0x9')](_0xb875('0x4b'),_0x5929cd);logger[_0xb875('0x9')](JSON[_0xb875('0x2f')](_0x20edc1[_0x3f096b]));BPromise[_0xb875('0x4c')]()['then'](handleJob(_0x20edc1[_0x3f096b]));logger[_0xb875('0x9')](_0xb875('0x4d'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}else if(_0x20edc1[_0x3f096b][_0xb875('0x4e')]&&_0x20edc1[_0x3f096b]['active']&&moment()[_0xb875('0x4f')](_0x20edc1[_0x3f096b][_0xb875('0x50')],_0x20edc1[_0x3f096b]['endAt'])){manager[_0xb875('0x51')](_0x3f096b,_0x20edc1[_0x3f096b][_0xb875('0x4e')],handleJob(_0x20edc1[_0x3f096b]));manager['start'](_0x3f096b);logger[_0xb875('0x9')]('add\x20cron',_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b]['cron']);}else if(manager[_0xb875('0x45')](_0x3f096b)){manager[_0xb875('0x46')](_0x3f096b);manager[_0xb875('0x47')](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x52'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}}for(_0x4ae919=0x0,_0x3f096b;_0x4ae919<_0x323ca0[_0xb875('0x49')]&&!_0x5929cd;_0x4ae919+=0x1){_0x3f096b=_0x323ca0[_0x4ae919][_0xb875('0x42')]();if(manager[_0xb875('0x45')](_0x3f096b)){if(_0x20edc1[_0x3f096b]['cron']&&_0x20edc1[_0x3f096b][_0xb875('0x53')]&&moment()[_0xb875('0x4f')](_0x20edc1[_0x3f096b][_0xb875('0x50')],_0x20edc1[_0x3f096b]['endAt'])){manager[_0xb875('0x54')](_0x3f096b,_0x20edc1[_0x3f096b][_0xb875('0x4e')],handleJob(_0x20edc1[_0x3f096b]));logger['info'](_0xb875('0x55'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}else{manager['stop'](_0x3f096b);manager['deleteJob'](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x52'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}}}})[_0xb875('0x3c')](function(_0xd5d743){logger[_0xb875('0x2d')](JSON['stringify'](_0xd5d743));});}exports[_0xb875('0x56')]=function(_0x3c5bec){return getJobs(_0x3c5bec);};exports[_0xb875('0x57')]=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 268421b..6038a14 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 _0x4ad3=['name','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','data2','then','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','forEach','push','all'];(function(_0xe85ddd,_0x53b73a){var _0x51ec9b=function(_0x528c20){while(--_0x528c20){_0xe85ddd['push'](_0xe85ddd['shift']());}};_0x51ec9b(++_0x53b73a);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0x4ad3[_0x272d8a];return _0x26286e;};var _=require(_0x34ad('0x0'));var AWS=require(_0x34ad('0x1'));var rp=require(_0x34ad('0x2'));var util=require(_0x34ad('0x3'));var BPromise=require(_0x34ad('0x4'));var db=require(_0x34ad('0x5'))['db'];var logger=require('../../config/logger')(_0x34ad('0x6'));function getTranscriptionJob(_0xd34b48,_0x269143,_0x2bea02,_0x116a1c){return new Promise(function(_0x42c532,_0x2d438f){var _0x3b927b=new AWS[(_0x34ad('0x7'))]({'accessKeyId':_0x269143,'secretAccessKey':_0xd34b48,'region':_0x2bea02});_0x3b927b[_0x34ad('0x8')]({'TranscriptionJobName':_0x116a1c},function(_0x4b6c38,_0x582178){if(_0x4b6c38){return _0x2d438f(_0x4b6c38);}else{return _0x42c532(_0x582178);}});});}function sentiment(_0x2eee91,_0x33718d,_0xb6c4f5,_0x1e1d8c,_0x56a16c){return new Promise(function(_0x43e756,_0x126fe0){var _0x3ba937=new AWS[(_0x34ad('0x9'))]({'accessKeyId':_0x33718d,'secretAccessKey':_0x2eee91,'region':_0xb6c4f5});_0x3ba937[_0x34ad('0xa')]({'Text':_0x1e1d8c,'LanguageCode':_0x56a16c[_0x34ad('0xb')](0x0,0x2)},function(_0x255d9d,_0x30ff6c){if(_0x255d9d){return _0x126fe0(_0x255d9d);}else{return _0x43e756(_0x30ff6c);}});});}function checkTranscribeJob(_0x3c986e,_0x377c90,_0x14c9fd){var _0x1be906;return new BPromise(function(_0x27501e,_0x35192d){logger[_0x34ad('0xc')](util[_0x34ad('0xd')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3c986e['id'],_0x3c986e[_0x34ad('0xe')]));return getTranscriptionJob(_0x14c9fd[_0x34ad('0xf')],_0x14c9fd[_0x34ad('0x10')],_0x377c90['transcribeRegion'],_0x3c986e[_0x34ad('0xe')])[_0x34ad('0x11')](function(_0x38a15e){logger[_0x34ad('0xc')](util[_0x34ad('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3c986e['id'],_0x3c986e[_0x34ad('0xe')],_0x38a15e['TranscriptionJob'][_0x34ad('0x12')]));if(!_0x3c986e[_0x34ad('0x13')]){switch(_0x38a15e[_0x34ad('0x14')][_0x34ad('0x12')]){case _0x34ad('0x15'):var _0x4b7f3e={'transcribeStatus':_0x38a15e[_0x34ad('0x14')][_0x34ad('0x12')],'fileUri':_0x38a15e[_0x34ad('0x14')][_0x34ad('0x16')][_0x34ad('0x17')]};logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x18'),_0x3c986e['id']));return rp({'uri':_0x38a15e[_0x34ad('0x14')]['Transcript'][_0x34ad('0x17')],'json':!![]})['then'](function(_0x1c2d49){logger['info'](util[_0x34ad('0xd')](_0x34ad('0x19'),_0x3c986e['id']));if(_0x1c2d49&&_0x1c2d49[_0x34ad('0x1a')]&&_0x1c2d49[_0x34ad('0x1a')][_0x34ad('0x1b')]&&_0x1c2d49[_0x34ad('0x1a')]['transcripts'][_0x34ad('0x1c')]){_0x4b7f3e['fileText']='';for(var _0x106bb9=0x0;_0x106bb9<_0x1c2d49['results']['transcripts'][_0x34ad('0x1c')];_0x106bb9++){_0x4b7f3e[_0x34ad('0x13')]+=_0x1c2d49[_0x34ad('0x1a')][_0x34ad('0x1b')][_0x106bb9][_0x34ad('0x1d')]+'';}}return _0x3c986e[_0x34ad('0x1e')](_0x4b7f3e);})[_0x34ad('0x11')](function(){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x1f'),_0x3c986e['id']));if(!_0x3c986e['tempSentiment']){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))](_0x34ad('0x22'));}if(!_0x377c90[_0x34ad('0x23')]||!_0x377c90[_0x34ad('0x24')]||!_0x377c90[_0x34ad('0x25')]||!_0x377c90[_0x34ad('0x26')]||!_0x377c90[_0x34ad('0x27')]){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))](_0x34ad('0x28'));}if(!_0x4b7f3e[_0x34ad('0x13')]){throw new Error(_0x34ad('0x29'));}if(_0x377c90[_0x34ad('0x24')]===_0x14c9fd['id']){return _0x14c9fd;}else{return db[_0x34ad('0x2a')][_0x34ad('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x34ad('0x11')](function(_0x54bf0f){if(!_0x54bf0f){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))](_0x34ad('0x2c'));}if(!_0x54bf0f[_0x34ad('0xf')]||!_0x54bf0f['data2']){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))](_0x34ad('0x2d'));}_0x1be906=_0x54bf0f;logger[_0x34ad('0xc')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3c986e['id']));return sentiment(_0x1be906['data1'],_0x1be906[_0x34ad('0x10')],_0x377c90[_0x34ad('0x25')],_0x4b7f3e[_0x34ad('0x13')],_0x377c90[_0x34ad('0x26')]);})[_0x34ad('0x11')](function(_0x4a04cd){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x2e'),_0x3c986e['id']));return _0x3c986e[_0x34ad('0x1e')]({'sentiment':_0x4a04cd[_0x34ad('0x2f')],'sPositive':_0x4a04cd[_0x34ad('0x30')][_0x34ad('0x31')],'sNegative':_0x4a04cd[_0x34ad('0x30')][_0x34ad('0x32')],'sMixed':_0x4a04cd[_0x34ad('0x30')][_0x34ad('0x33')],'sNeutral':_0x4a04cd[_0x34ad('0x30')][_0x34ad('0x34')]});})[_0x34ad('0x11')](function(){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x1f'),_0x3c986e['id']));_0x27501e();});case _0x34ad('0x35'):return _0x3c986e[_0x34ad('0x1e')]({'transcribeStatus':_0x34ad('0x35'),'failureReason':_0x38a15e['TranscriptionJob']['FailureReason']})[_0x34ad('0x11')](function(){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x1f'),_0x3c986e['id']));_0x27501e();});default:logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x36'),_0x3c986e['id']));break;}}else{return BPromise[_0x34ad('0x37')]()[_0x34ad('0x11')](function(){if(!_0x3c986e[_0x34ad('0x38')]){throw new db['Sequelize'][(_0x34ad('0x21'))](_0x34ad('0x22'));}if(!_0x377c90[_0x34ad('0x23')]||!_0x377c90[_0x34ad('0x24')]||!_0x377c90[_0x34ad('0x25')]||!_0x377c90[_0x34ad('0x26')]||!_0x377c90[_0x34ad('0x27')]){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3c986e[_0x34ad('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x377c90[_0x34ad('0x24')]===_0x14c9fd['id']){return _0x14c9fd;}else{return db[_0x34ad('0x2a')][_0x34ad('0x2b')]({'where':{'id':_settings[_0x34ad('0x24')]}});}})[_0x34ad('0x11')](function(_0x436ead){if(!_0x436ead){throw new db['Sequelize'][(_0x34ad('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x436ead[_0x34ad('0xf')]||!_0x436ead['data2']){throw new db['Sequelize'][(_0x34ad('0x21'))](_0x34ad('0x2d'));}_0x1be906=_0x436ead;logger[_0x34ad('0xc')](util['format'](_0x34ad('0x39'),_0x3c986e['id']));return sentiment(_0x1be906[_0x34ad('0xf')],_0x1be906[_0x34ad('0x10')],_0x377c90['sentimentRegion'],_0x3c986e['fileText'],_0x377c90[_0x34ad('0x26')]);})[_0x34ad('0x11')](function(_0x53e806){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x2e'),_0x3c986e['id']));return _0x3c986e['update']({'sentiment':_0x53e806[_0x34ad('0x2f')],'sPositive':_0x53e806[_0x34ad('0x30')][_0x34ad('0x31')],'sNegative':_0x53e806[_0x34ad('0x30')][_0x34ad('0x32')],'sMixed':_0x53e806[_0x34ad('0x30')][_0x34ad('0x33')],'sNeutral':_0x53e806['SentimentScore'][_0x34ad('0x34')],'transcribeStatus':_0x34ad('0x15')});})['then'](function(){logger[_0x34ad('0xc')](util[_0x34ad('0xd')](_0x34ad('0x1f'),_0x3c986e['id']));_0x27501e();});}})[_0x34ad('0x3a')](function(_0xe06cd7){if(_0xe06cd7){if(!_0xe06cd7['name']||_0xe06cd7['name']!==_0x34ad('0x3b')){logger[_0x34ad('0x3c')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3c986e['id']),util[_0x34ad('0x3d')](_0xe06cd7,{'showHidden':![],'depth':null}));}}_0x27501e();});});}function checkTranscribe(){var _0x538d11;var _0xd23555;var _0x28ca13;return db[_0x34ad('0x3e')]['findAll']({'where':{'transcribeStatus':_0x34ad('0x3f')}})[_0x34ad('0x11')](function(_0x558741){if(!_0x558741||!_0x558741['length']){throw new db['Sequelize']['ValidationError'](_0x34ad('0x40'));}_0x538d11=_0x558741;return db[_0x34ad('0x41')][_0x34ad('0x2b')]({'where':{'id':0x1}});})[_0x34ad('0x11')](function(_0x4c5843){if(!_0x4c5843){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))]('Settings\x20not\x20available');}_0xd23555=_0x4c5843;if(!_0xd23555['transcribe']||!_0xd23555[_0x34ad('0x42')]||!_0xd23555[_0x34ad('0x43')]||!_0xd23555[_0x34ad('0x26')]||!_0xd23555[_0x34ad('0x27')]){throw new db[(_0x34ad('0x20'))][(_0x34ad('0x21'))]('Transcribe\x20not\x20configured');}return db[_0x34ad('0x2a')][_0x34ad('0x2b')]({'where':{'id':_0xd23555['transcribeAccountId']}});})[_0x34ad('0x11')](function(_0x50dfb6){if(!_0x50dfb6){throw new db['Sequelize'][(_0x34ad('0x21'))](_0x34ad('0x2c'));}if(!_0x50dfb6[_0x34ad('0xf')]||!_0x50dfb6['data2']){throw new db[(_0x34ad('0x20'))]['ValidationError'](_0x34ad('0x2d'));}_0x28ca13=_0x50dfb6;var _0x22ecbd=[];_0x538d11[_0x34ad('0x44')](function(_0x549b3c){_0x22ecbd[_0x34ad('0x45')](checkTranscribeJob(_0x549b3c,_0xd23555,_0x28ca13));});return BPromise[_0x34ad('0x46')](_0x22ecbd);})[_0x34ad('0x3a')](function(_0x2f6d7f){if(_0x2f6d7f){if(!_0x2f6d7f[_0x34ad('0x47')]||_0x2f6d7f[_0x34ad('0x47')]!==_0x34ad('0x3b')){logger[_0x34ad('0x3c')](util[_0x34ad('0x3d')](_0x2f6d7f,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xaf60=['data1','data2','transcribeRegion','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','format','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','language','bucket','Cloud\x20Provider\x20not\x20configured','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','push','all','start','lodash','aws-sdk','request-promise','../../mysqldb','getTranscriptionJob','Comprehend','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)'];(function(_0x2e9ef1,_0x1b6dbc){var _0x4f294b=function(_0x4e89b6){while(--_0x4e89b6){_0x2e9ef1['push'](_0x2e9ef1['shift']());}};_0x4f294b(++_0x1b6dbc);}(_0xaf60,0x82));var _0x0af6=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xaf60[_0xbe200f];return _0x192597;};var _=require(_0x0af6('0x0'));var AWS=require(_0x0af6('0x1'));var rp=require(_0x0af6('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x0af6('0x3'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0xbb4bdd,_0x3e1023,_0x427a4c,_0x2fe667){return new Promise(function(_0x463023,_0x333ce1){var _0x2eb218=new AWS['TranscribeService']({'accessKeyId':_0x3e1023,'secretAccessKey':_0xbb4bdd,'region':_0x427a4c});_0x2eb218[_0x0af6('0x4')]({'TranscriptionJobName':_0x2fe667},function(_0x28d620,_0x525bcc){if(_0x28d620){return _0x333ce1(_0x28d620);}else{return _0x463023(_0x525bcc);}});});}function sentiment(_0xd326e7,_0x15552e,_0xe9d01a,_0x5637be,_0x5f1492){return new Promise(function(_0x5ec690,_0x185dee){var _0x48f9cf=new AWS[(_0x0af6('0x5'))]({'accessKeyId':_0x15552e,'secretAccessKey':_0xd326e7,'region':_0xe9d01a});_0x48f9cf['detectSentiment']({'Text':_0x5637be,'LanguageCode':_0x5f1492['substring'](0x0,0x2)},function(_0x191df6,_0x1155ab){if(_0x191df6){return _0x185dee(_0x191df6);}else{return _0x5ec690(_0x1155ab);}});});}function checkTranscribeJob(_0x2908f8,_0x478df5,_0x1a51ed){var _0x30a734;return new BPromise(function(_0x43a6c0,_0x563943){logger[_0x0af6('0x6')](util['format'](_0x0af6('0x7'),_0x2908f8['id'],_0x2908f8['transcribeName']));return getTranscriptionJob(_0x1a51ed[_0x0af6('0x8')],_0x1a51ed[_0x0af6('0x9')],_0x478df5[_0x0af6('0xa')],_0x2908f8[_0x0af6('0xb')])['then'](function(_0x57a725){logger['info'](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2908f8['id'],_0x2908f8[_0x0af6('0xb')],_0x57a725[_0x0af6('0xc')][_0x0af6('0xd')]));if(!_0x2908f8[_0x0af6('0xe')]){switch(_0x57a725['TranscriptionJob']['TranscriptionJobStatus']){case _0x0af6('0xf'):var _0x1b3ceb={'transcribeStatus':_0x57a725['TranscriptionJob'][_0x0af6('0xd')],'fileUri':_0x57a725[_0x0af6('0xc')]['Transcript'][_0x0af6('0x10')]};logger[_0x0af6('0x6')](util[_0x0af6('0x11')]('[RECORDING:%d]\x20Get\x20transcript',_0x2908f8['id']));return rp({'uri':_0x57a725[_0x0af6('0xc')][_0x0af6('0x12')][_0x0af6('0x10')],'json':!![]})['then'](function(_0x48a50f){logger['info'](util[_0x0af6('0x11')](_0x0af6('0x13'),_0x2908f8['id']));if(_0x48a50f&&_0x48a50f[_0x0af6('0x14')]&&_0x48a50f[_0x0af6('0x14')]['transcripts']&&_0x48a50f[_0x0af6('0x14')][_0x0af6('0x15')][_0x0af6('0x16')]){_0x1b3ceb[_0x0af6('0xe')]='';for(var _0x56df0b=0x0;_0x56df0b<_0x48a50f[_0x0af6('0x14')][_0x0af6('0x15')]['length'];_0x56df0b++){_0x1b3ceb[_0x0af6('0xe')]+=_0x48a50f['results'][_0x0af6('0x15')][_0x56df0b][_0x0af6('0x17')]+'';}}return _0x2908f8[_0x0af6('0x18')](_0x1b3ceb);})[_0x0af6('0x19')](function(){logger[_0x0af6('0x6')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2908f8['id']));if(!_0x2908f8['tempSentiment']){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x1c'));}if(!_0x478df5['sentiment']||!_0x478df5[_0x0af6('0x1d')]||!_0x478df5[_0x0af6('0x1e')]||!_0x478df5['language']||!_0x478df5['bucket']){throw new db['Sequelize'][(_0x0af6('0x1b'))](_0x0af6('0x1f'));}if(!_0x1b3ceb['fileText']){throw new Error(_0x0af6('0x20'));}if(_0x478df5[_0x0af6('0x1d')]===_0x1a51ed['id']){return _0x1a51ed;}else{return db[_0x0af6('0x21')][_0x0af6('0x22')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3f0ef7){if(!_0x3f0ef7){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3f0ef7[_0x0af6('0x8')]||!_0x3f0ef7[_0x0af6('0x9')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x30a734=_0x3f0ef7;logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x23'),_0x2908f8['id']));return sentiment(_0x30a734['data1'],_0x30a734[_0x0af6('0x9')],_0x478df5[_0x0af6('0x1e')],_0x1b3ceb['fileText'],_0x478df5['language']);})['then'](function(_0x22264d){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x24'),_0x2908f8['id']));return _0x2908f8[_0x0af6('0x18')]({'sentiment':_0x22264d['Sentiment'],'sPositive':_0x22264d[_0x0af6('0x25')][_0x0af6('0x26')],'sNegative':_0x22264d[_0x0af6('0x25')][_0x0af6('0x27')],'sMixed':_0x22264d['SentimentScore'][_0x0af6('0x28')],'sNeutral':_0x22264d['SentimentScore'][_0x0af6('0x29')]});})['then'](function(){logger['info'](util[_0x0af6('0x11')](_0x0af6('0x2a'),_0x2908f8['id']));_0x43a6c0();});case _0x0af6('0x2b'):return _0x2908f8[_0x0af6('0x18')]({'transcribeStatus':_0x0af6('0x2b'),'failureReason':_0x57a725[_0x0af6('0xc')][_0x0af6('0x2c')]})[_0x0af6('0x19')](function(){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x2a'),_0x2908f8['id']));_0x43a6c0();});default:logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x2d'),_0x2908f8['id']));break;}}else{return BPromise[_0x0af6('0x2e')]()[_0x0af6('0x19')](function(){if(!_0x2908f8[_0x0af6('0x2f')]){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x1c'));}if(!_0x478df5[_0x0af6('0x30')]||!_0x478df5[_0x0af6('0x1d')]||!_0x478df5[_0x0af6('0x1e')]||!_0x478df5[_0x0af6('0x31')]||!_0x478df5[_0x0af6('0x32')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2908f8[_0x0af6('0xe')]){throw new Error(_0x0af6('0x20'));}if(_0x478df5[_0x0af6('0x1d')]===_0x1a51ed['id']){return _0x1a51ed;}else{return db[_0x0af6('0x21')][_0x0af6('0x22')]({'where':{'id':_settings[_0x0af6('0x1d')]}});}})['then'](function(_0x12205a){if(!_0x12205a){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x12205a[_0x0af6('0x8')]||!_0x12205a[_0x0af6('0x9')]){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x33'));}_0x30a734=_0x12205a;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2908f8['id']));return sentiment(_0x30a734['data1'],_0x30a734['data2'],_0x478df5[_0x0af6('0x1e')],_0x2908f8[_0x0af6('0xe')],_0x478df5[_0x0af6('0x31')]);})[_0x0af6('0x19')](function(_0x426079){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x24'),_0x2908f8['id']));return _0x2908f8['update']({'sentiment':_0x426079[_0x0af6('0x34')],'sPositive':_0x426079[_0x0af6('0x25')][_0x0af6('0x26')],'sNegative':_0x426079[_0x0af6('0x25')][_0x0af6('0x27')],'sMixed':_0x426079[_0x0af6('0x25')]['Mixed'],'sNeutral':_0x426079[_0x0af6('0x25')][_0x0af6('0x29')],'transcribeStatus':_0x0af6('0xf')});})['then'](function(){logger[_0x0af6('0x6')](util[_0x0af6('0x11')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2908f8['id']));_0x43a6c0();});}})[_0x0af6('0x35')](function(_0x4acd94){if(_0x4acd94){if(!_0x4acd94[_0x0af6('0x36')]||_0x4acd94['name']!==_0x0af6('0x37')){logger[_0x0af6('0x38')](util[_0x0af6('0x11')](_0x0af6('0x39'),_0x2908f8['id']),util[_0x0af6('0x3a')](_0x4acd94,{'showHidden':![],'depth':null}));}}_0x43a6c0();});});}function checkTranscribe(){var _0x4827b0;var _0x216550;var _0x16d398;return db[_0x0af6('0x3b')]['findAll']({'where':{'transcribeStatus':_0x0af6('0x3c')}})['then'](function(_0x41b916){if(!_0x41b916||!_0x41b916[_0x0af6('0x16')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x4827b0=_0x41b916;return db[_0x0af6('0x3d')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x27b0a4){if(!_0x27b0a4){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x3e'));}_0x216550=_0x27b0a4;if(!_0x216550['transcribe']||!_0x216550[_0x0af6('0x3f')]||!_0x216550[_0x0af6('0xa')]||!_0x216550[_0x0af6('0x31')]||!_0x216550[_0x0af6('0x32')]){throw new db[(_0x0af6('0x1a'))]['ValidationError'](_0x0af6('0x40'));}return db[_0x0af6('0x21')]['findOne']({'where':{'id':_0x216550[_0x0af6('0x3f')]}});})[_0x0af6('0x19')](function(_0x7c2c7b){if(!_0x7c2c7b){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x41'));}if(!_0x7c2c7b[_0x0af6('0x8')]||!_0x7c2c7b['data2']){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))]('Cloud\x20Provider\x20not\x20configured');}_0x16d398=_0x7c2c7b;var _0x287269=[];_0x4827b0['forEach'](function(_0x51e0ea){_0x287269[_0x0af6('0x42')](checkTranscribeJob(_0x51e0ea,_0x216550,_0x16d398));});return BPromise[_0x0af6('0x43')](_0x287269);})[_0x0af6('0x35')](function(_0x514760){if(_0x514760){if(!_0x514760['name']||_0x514760['name']!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x514760,{'showHidden':![],'depth':null}));}}});}exports[_0x0af6('0x44')]=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 3487e08..7e6c049 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 _0xfe33=['system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','findAll','lastMsgAt','subtract','then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction'];(function(_0x17480d,_0x14949d){var _0x5c18fc=function(_0x4aad75){while(--_0x4aad75){_0x17480d['push'](_0x17480d['shift']());}};_0x5c18fc(++_0x14949d);}(_0xfe33,0x13e));var _0x3fe3=function(_0x3fea84,_0x3e832f){_0x3fea84=_0x3fea84-0x0;var _0x20778a=_0xfe33[_0x3fea84];return _0x20778a;};'use strict';var _=require(_0x3fe3('0x0'));var moment=require(_0x3fe3('0x1'));var Redis=require('ioredis');var util=require(_0x3fe3('0x2'));var config=require(_0x3fe3('0x3'));var db=require(_0x3fe3('0x4'))['db'];var logger=require(_0x3fe3('0x5'))(_0x3fe3('0x6'));config[_0x3fe3('0x7')]=_[_0x3fe3('0x8')](config[_0x3fe3('0x7')],{'host':_0x3fe3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3fe3('0x7')]));function closeInteractions(){var _0x1a6662=[];return db['WhatsappInteraction'][_0x3fe3('0xa')]({'raw':!![],'attributes':['id',_0x3fe3('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3fe3('0xc')](0x18,'hours')}}})[_0x3fe3('0xd')](function(_0x5c7c1a){if(_0x5c7c1a&&_0x5c7c1a['length']){_0x1a6662=_['map'](_0x5c7c1a||[],'id');logger[_0x3fe3('0xe')](_0x3fe3('0xf'),_0x1a6662[_0x3fe3('0x10')]());return db[_0x3fe3('0x11')]['update']({'closeReason':_0x3fe3('0x12'),'disposition':_0x3fe3('0x13'),'closed':!![],'closedAt':moment()[_0x3fe3('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1a6662}});}})[_0x3fe3('0xd')](function(){if(_0x1a6662&&_0x1a6662[_0x3fe3('0x15')]){logger[_0x3fe3('0xe')](_0x3fe3('0x16'),_0x1a6662[_0x3fe3('0x10')]());for(var _0x3ad1cc=0x0;_0x3ad1cc<_0x1a6662[_0x3fe3('0x15')];_0x3ad1cc++){io['emit'](_0x3fe3('0x17'),{'id':_0x1a6662[_0x3ad1cc],'closed':!![]});}}})['catch'](function(_0x2ea91c){logger[_0x3fe3('0x18')](_0x3fe3('0x19'),_0x2ea91c?util[_0x3fe3('0x1a')](_0x2ea91c,{'showHidden':![],'depth':null}):'');});}exports[_0x3fe3('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xff0e=['system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','defaults','socket.io-emitter','redis','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x258aca,_0x45c459){var _0x4f9944=function(_0x187626){while(--_0x187626){_0x258aca['push'](_0x258aca['shift']());}};_0x4f9944(++_0x45c459);}(_0xff0e,0x87));var _0xeff0=function(_0x53b773,_0x97444c){_0x53b773=_0x53b773-0x0;var _0x522455=_0xff0e[_0x53b773];return _0x522455;};'use strict';var _=require(_0xeff0('0x0'));var moment=require(_0xeff0('0x1'));var Redis=require(_0xeff0('0x2'));var util=require(_0xeff0('0x3'));var config=require(_0xeff0('0x4'));var db=require(_0xeff0('0x5'))['db'];var logger=require(_0xeff0('0x6'))('schedule');config['redis']=_[_0xeff0('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xeff0('0x8'))(new Redis(config[_0xeff0('0x9')]));function closeInteractions(){var _0x3a4111=[];return db[_0xeff0('0xa')][_0xeff0('0xb')]({'raw':!![],'attributes':['id',_0xeff0('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xeff0('0xd')](0x18,_0xeff0('0xe'))}}})[_0xeff0('0xf')](function(_0x264fee){if(_0x264fee&&_0x264fee[_0xeff0('0x10')]){_0x3a4111=_[_0xeff0('0x11')](_0x264fee||[],'id');logger[_0xeff0('0x12')](_0xeff0('0x13'),_0x3a4111['join']());return db[_0xeff0('0xa')]['update']({'closeReason':_0xeff0('0x14'),'disposition':_0xeff0('0x15'),'closed':!![],'closedAt':moment()['format'](_0xeff0('0x16'))},{'where':{'id':_0x3a4111}});}})[_0xeff0('0xf')](function(){if(_0x3a4111&&_0x3a4111['length']){logger[_0xeff0('0x12')](_0xeff0('0x17'),_0x3a4111['join']());for(var _0x1fa0b2=0x0;_0x1fa0b2<_0x3a4111['length'];_0x1fa0b2++){io[_0xeff0('0x18')](_0xeff0('0x19'),{'id':_0x3a4111[_0x1fa0b2],'closed':!![]});}}})[_0xeff0('0x1a')](function(_0x38a36c){logger[_0xeff0('0x1b')](_0xeff0('0x1c'),_0x38a36c?util[_0xeff0('0x1d')](_0x38a36c,{'showHidden':![],'depth':null}):'');});}exports[_0xeff0('0x1e')]=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 4cf2d97..e2026c2 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x866c=['innocenzo.biondo','@xcally.com','now','Biondo','destroy','then','CmContact','contacts1','CmHopper','bulkCreate','log','finished\x20populating','hopper1','../mysqldb','push','Innocenzo'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x866c,0x9d));var _0xc866=function(_0xfca643,_0x59d89a){_0xfca643=_0xfca643-0x0;var _0x4599a0=_0x866c[_0xfca643];return _0x4599a0;};'use strict';var util=require('util');var db=require(_0xc866('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc866('0x1')]({'id':i,'firstName':_0xc866('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc866('0x3')+i+_0xc866('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xc866('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc866('0x5')](),'updatedAt':Date[_0xc866('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xc866('0x2')+i,'lastName':_0xc866('0x6')+i,'phone':0xf879fb460+i,'email':_0xc866('0x3')+i+_0xc866('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xc866('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc866('0x5')](),'updatedAt':Date[_0xc866('0x5')]()});}db['CmContact'][_0xc866('0x7')]({'where':{}})[_0xc866('0x8')](function(){return db[_0xc866('0x9')]['bulkCreate'](contacts);})['then'](function(){console['log']('finished\x20populating',_0xc866('0xa'));return db[_0xc866('0xb')][_0xc866('0x7')]({'where':{}});})[_0xc866('0x8')](function(){return db[_0xc866('0xb')][_0xc866('0xc')](hopper);})[_0xc866('0x8')](function(){console[_0xc866('0xd')](_0xc866('0xe'),_0xc866('0xf'));return db['CmContact'][_0xc866('0xc')](contacts2);})[_0xc866('0x8')](function(){console[_0xc866('0xd')](_0xc866('0xe'),'contacts2');return db['CmHopper'][_0xc866('0xc')](hopper2);})[_0xc866('0x8')](function(){console[_0xc866('0xd')]('finished\x20populating','hopper2');})['catch'](function(_0x5edf5b){console[_0xc866('0xd')](_0x5edf5b);}); \ No newline at end of file +var _0xdf15=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x2c55b5,_0x39f9d1){var _0x1200e9=function(_0x7d856e){while(--_0x7d856e){_0x2c55b5['push'](_0x2c55b5['shift']());}};_0x1200e9(++_0x39f9d1);}(_0xdf15,0x136));var _0x5df1=function(_0x246fc1,_0x30c044){_0x246fc1=_0x246fc1-0x0;var _0x1f172c=_0xdf15[_0x246fc1];return _0x1f172c;};'use strict';var util=require(_0x5df1('0x0'));var db=require(_0x5df1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5df1('0x2')]({'id':i,'firstName':_0x5df1('0x3')+i,'lastName':_0x5df1('0x4')+i,'phone':0xf879fb460+i,'email':_0x5df1('0x5')+i+_0x5df1('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5df1('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5df1('0x7')](),'updatedAt':Date[_0x5df1('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5df1('0x2')]({'id':i,'firstName':_0x5df1('0x3')+i,'lastName':_0x5df1('0x4')+i,'phone':0xf879fb460+i,'email':_0x5df1('0x5')+i+_0x5df1('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5df1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5df1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5df1('0x7')](),'updatedAt':Date[_0x5df1('0x7')]()});}db[_0x5df1('0x8')][_0x5df1('0x9')]({'where':{}})[_0x5df1('0xa')](function(){return db['CmContact'][_0x5df1('0xb')](contacts);})[_0x5df1('0xa')](function(){console[_0x5df1('0xc')](_0x5df1('0xd'),_0x5df1('0xe'));return db[_0x5df1('0xf')]['destroy']({'where':{}});})[_0x5df1('0xa')](function(){return db[_0x5df1('0xf')][_0x5df1('0xb')](hopper);})['then'](function(){console['log'](_0x5df1('0xd'),_0x5df1('0x10'));return db[_0x5df1('0x8')][_0x5df1('0xb')](contacts2);})[_0x5df1('0xa')](function(){console[_0x5df1('0xc')]('finished\x20populating',_0x5df1('0x11'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x5df1('0xc')]('finished\x20populating',_0x5df1('0x12'));})[_0x5df1('0x13')](function(_0xc49674){console[_0x5df1('0xc')](_0xc49674);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1b2e829..32a9551 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50ed=['bulkCreate','then','log','add\x20user','util','push','format','%s%s','agent','password','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','User'];(function(_0x2a217b,_0xb039df){var _0x29a6ac=function(_0x36071f){while(--_0x36071f){_0x2a217b['push'](_0x2a217b['shift']());}};_0x29a6ac(++_0xb039df);}(_0x50ed,0xbf));var _0xd50e=function(_0x3a293e,_0x34c1ab){_0x3a293e=_0x3a293e-0x0;var _0x58949=_0x50ed[_0x3a293e];return _0x58949;};'use strict';var util=require(_0xd50e('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd50e('0x1')]({'name':util[_0xd50e('0x2')](_0xd50e('0x3'),_0xd50e('0x4'),i),'fullname':util[_0xd50e('0x2')](_0xd50e('0x3'),'agent',i),'email':util['format']('%s%s@xcally.com',_0xd50e('0x4'),i),'role':_0xd50e('0x4'),'password':_0xd50e('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xd50e('0x6'),'ws','wss'],'disallow':[_0xd50e('0x7')],'allow':[_0xd50e('0x8')],'defaultuser':util[_0xd50e('0x2')]('%s%s',_0xd50e('0x4'),i),'encryption':_0xd50e('0x9'),'avpf':_0xd50e('0x9'),'force_avp':_0xd50e('0x9'),'icesupport':_0xd50e('0x9'),'dtlsenable':_0xd50e('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd50e('0xa'),'dtlssetup':_0xd50e('0xb'),'callerid':util[_0xd50e('0x2')]('\x22%s\x22\x20<%s>',util[_0xd50e('0x2')](_0xd50e('0x3'),_0xd50e('0x4'),i),0xfa0+i)});}db[_0xd50e('0xc')][_0xd50e('0xd')](users)[_0xd50e('0xe')](function(){console[_0xd50e('0xf')](_0xd50e('0x10'));})['catch'](function(_0x4dc785){console['log'](_0x4dc785);}); \ No newline at end of file +var _0x3285=['friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','log','push','%s%s','agent','format','%s%s@xcally.com','password'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3285,0xdb));var _0x5328=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x3285[_0x38ced4];return _0x547c07;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5328('0x0')]({'name':util['format'](_0x5328('0x1'),_0x5328('0x2'),i),'fullname':util['format'](_0x5328('0x1'),_0x5328('0x2'),i),'email':util[_0x5328('0x3')](_0x5328('0x4'),'agent',i),'role':_0x5328('0x2'),'password':_0x5328('0x5'),'internal':0xfa0+i,'type':_0x5328('0x6'),'transport':['udp','ws',_0x5328('0x7')],'disallow':[_0x5328('0x8')],'allow':[_0x5328('0x9')],'defaultuser':util[_0x5328('0x3')](_0x5328('0x1'),_0x5328('0x2'),i),'encryption':'yes','avpf':_0x5328('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x5328('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x5328('0x3')](_0x5328('0xc'),util[_0x5328('0x3')](_0x5328('0x1'),_0x5328('0x2'),i),0xfa0+i)});}db[_0x5328('0xd')]['bulkCreate'](users)['then'](function(){console[_0x5328('0xe')]('add\x20user');})['catch'](function(_0x125174){console[_0x5328('0xe')](_0x125174);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 5cefc04..d3bb340 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ea9=['chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','address','request','connection','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','role','telephone','type','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','map','where','Campaign','format','%s:queue:%s','Agents','length','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','userProfileId','IvrCampaigns','agent','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x7ea9,0xec));var _0x97ea=function(_0x3bb6f7,_0x3f26da){_0x3bb6f7=_0x3bb6f7-0x0;var _0x11c740=_0x7ea9[_0x3bb6f7];return _0x11c740;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var BPromise=require(_0x97ea('0x1'));var db=require(_0x97ea('0x2'))['db'];var config=require(_0x97ea('0x3'));var queryQueues={'attributes':['id',_0x97ea('0x4')],'include':[{'as':'Agents','model':db[_0x97ea('0x5')],'attributes':['id',_0x97ea('0x4'),_0x97ea('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x97ea('0x4')],'where':{'role':_0x97ea('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x97ea('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x97ea('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x97ea('0x4'),_0x97ea('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0xdf150d,_0x5d0698,_0x179953){return db['UserProfileSection'][_0x97ea('0x9')]({'where':{'name':_0xdf150d,'userProfileId':_0x5d0698},'raw':!![]})[_0x97ea('0xa')](function(_0x5a071f){if(_0x5a071f){if(_0x5a071f[_0x97ea('0xb')]){switch(_0xdf150d){case _0x97ea('0xc'):case _0x97ea('0xd'):case _0x97ea('0xe'):case _0x97ea('0xf'):case _0x97ea('0x10'):case _0x97ea('0x11'):case _0x97ea('0x12'):return db[_0x179953][_0x97ea('0x13')](queryQueues);case _0x97ea('0x14'):return db[_0x179953]['findAll'](queryTelephones);case _0x97ea('0x15'):return db[_0x179953][_0x97ea('0x13')](queryTrunks);case'IvrCampaigns':return db[_0x179953][_0x97ea('0x13')](queryCampaigns);}}else{return db[_0x97ea('0x16')][_0x97ea('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x5a071f['id']},'raw':!![]})[_0x97ea('0xa')](function(_0x47727a){if(_0x47727a){var _0x5df49d={'where':{'id':_[_0x97ea('0x17')](_0x47727a,'resourceId')},'raw':!![]};switch(_0x179953){case _0x97ea('0x5'):_0x5df49d[_0x97ea('0x18')][_0x97ea('0x6')]=_0x97ea('0x7');break;case _0x97ea('0x19'):_0x5df49d[_0x97ea('0x18')][_0x97ea('0x8')]='ivr';break;}return db[_0x179953][_0x97ea('0x13')](_0x5df49d);}else{return[];}});}}else{return[];}})[_0x97ea('0xa')](function(_0x2a3a1d){return _0x2a3a1d;});}function joinOrLeaveQueues(_0x28149a,_0x15af20,_0x3577de,_0x11f20d){_0x28149a[_0x15af20](util[_0x97ea('0x1a')](_0x97ea('0x1b'),_0x3577de,_0x11f20d[_0x97ea('0x4')]));if(_0x11f20d[_0x97ea('0x1c')]){for(var _0x3c0c42=0x0;_0x3c0c42<_0x11f20d['Agents'][_0x97ea('0x1d')];_0x3c0c42+=0x1){_0x28149a[_0x15af20](util[_0x97ea('0x1a')]('user:%s',_0x11f20d[_0x97ea('0x1c')][_0x3c0c42][_0x97ea('0x4')]));}}}function joinOrLeave(_0x53db59,_0x5a7e85,_0x22e81e){var _0x2690ba;if(_0x53db59[_0x97ea('0x1e')][_0x97ea('0x1f')]['id']){db[_0x97ea('0x5')]['find']({'attributes':['id',_0x97ea('0x4'),_0x97ea('0x6'),'userProfileId'],'where':{'id':_0x53db59['handshake'][_0x97ea('0x1f')]['id']},'include':[{'model':db[_0x97ea('0x20')],'as':_0x97ea('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x97ea('0x22')],'as':_0x97ea('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x97ea('0x24')],'as':_0x97ea('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x97ea('0x26')],'as':_0x97ea('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x97ea('0x28')],'as':_0x97ea('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x97ea('0x2a')],'as':_0x97ea('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x334464){if(_0x334464){_0x2690ba=_0x334464;_0x53db59[_0x5a7e85](util[_0x97ea('0x1a')]('user:%s',_0x334464['name']));var _0xa2d99a=[];switch(_0x334464[_0x97ea('0x6')]){case _0x97ea('0x2c'):_0x53db59[_0x5a7e85](_0x97ea('0x2d'));_0x53db59[_0x5a7e85](_0x97ea('0x2e'));if(queryQueues[_0x97ea('0x2f')](_0x97ea('0x30'))){delete queryQueues[_0x97ea('0x30')];}_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x32')][_0x97ea('0x13')](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x33')][_0x97ea('0x13')](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x34')]['findAll'](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x35')]['findAll'](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x36')][_0x97ea('0x13')](queryQueues));_0xa2d99a[_0x97ea('0x31')](db['OpenchannelQueue']['findAll'](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x37')][_0x97ea('0x13')](queryQueues));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x5')][_0x97ea('0x13')](queryTelephones));_0xa2d99a['push'](db[_0x97ea('0x38')][_0x97ea('0x13')](queryTrunks));_0xa2d99a['push'](db[_0x97ea('0x19')][_0x97ea('0x13')](queryCampaigns));_0xa2d99a[_0x97ea('0x31')](db['User'][_0x97ea('0x13')](queryAgents));break;case _0x97ea('0x39'):_0x53db59[_0x5a7e85](_0x97ea('0x2d'));_0x53db59[_0x5a7e85]('voice:outbound');_0xa2d99a['push'](getAssociatedResources(_0x97ea('0xc'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x32')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources('ChatQueues',_0x334464[_0x97ea('0x3a')],_0x97ea('0x33')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0xe'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x34')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0xf'),_0x334464[_0x97ea('0x3a')],'SmsQueue'));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0x10'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x36')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0x11'),_0x334464[_0x97ea('0x3a')],'OpenchannelQueue'));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0x12'),_0x334464['userProfileId'],_0x97ea('0x37')));_0xa2d99a['push'](getAssociatedResources(_0x97ea('0x14'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x5')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0x15'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x38')));_0xa2d99a[_0x97ea('0x31')](getAssociatedResources(_0x97ea('0x3b'),_0x334464[_0x97ea('0x3a')],_0x97ea('0x19')));_0xa2d99a[_0x97ea('0x31')](db[_0x97ea('0x5')][_0x97ea('0x13')](queryAgents));break;case _0x97ea('0x3c'):_0x53db59[_0x5a7e85](_0x97ea('0x2d'));_0x53db59[_0x5a7e85]('voice:outbound');_0xa2d99a[_0x97ea('0x31')](_0x334464['getVoiceQueues']({'attributes':['id','name']}));_0xa2d99a[_0x97ea('0x31')](_0x334464[_0x97ea('0x3d')]({'attributes':['id',_0x97ea('0x4')]}));_0xa2d99a[_0x97ea('0x31')](_0x334464[_0x97ea('0x3e')]({'attributes':['id',_0x97ea('0x4')]}));_0xa2d99a[_0x97ea('0x31')](_0x334464[_0x97ea('0x3f')]({'attributes':['id',_0x97ea('0x4')]}));_0xa2d99a[_0x97ea('0x31')](_0x334464['getMailQueues']({'attributes':['id',_0x97ea('0x4')]}));_0xa2d99a[_0x97ea('0x31')](_0x334464[_0x97ea('0x40')]({'attributes':['id',_0x97ea('0x4')]}));_0xa2d99a[_0x97ea('0x31')](_0x334464[_0x97ea('0x41')]({'attributes':['id',_0x97ea('0x4')]}));break;}return BPromise[_0x97ea('0x42')](_0xa2d99a);}})['then'](function(_0xd2ed14){if(_0xd2ed14&&_0xd2ed14[_0x97ea('0x1d')]){for(var _0x23bf56=0x0;_0x23bf56<_0xd2ed14[_0x97ea('0x1d')];_0x23bf56+=0x1){for(var _0x1becc3=0x0;_0x1becc3<_0xd2ed14[_0x23bf56][_0x97ea('0x1d')];_0x1becc3+=0x1){switch(_0x23bf56){case 0x0:joinOrLeaveQueues(_0x53db59,_0x5a7e85,'voice',_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x1:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x43'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x2:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x44'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x3:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x45'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x4:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x46'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x5:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x47'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x6:joinOrLeaveQueues(_0x53db59,_0x5a7e85,_0x97ea('0x48'),_0xd2ed14[_0x23bf56][_0x1becc3]);break;case 0x7:if(_0x2690ba['role']!==_0x97ea('0x3c'))_0x53db59[_0x5a7e85](util[_0x97ea('0x1a')](_0x97ea('0x49'),_0xd2ed14[_0x23bf56][_0x1becc3][_0x97ea('0x4')]));break;case 0x8:if(_0x2690ba[_0x97ea('0x6')]!=='agent')_0x53db59[_0x5a7e85](util['format'](_0x97ea('0x4a'),_0xd2ed14[_0x23bf56][_0x1becc3]['name']));break;case 0x9:if(_0x2690ba[_0x97ea('0x6')]!==_0x97ea('0x3c'))_0x53db59[_0x5a7e85](util[_0x97ea('0x1a')](_0x97ea('0x4b'),_0xd2ed14[_0x23bf56][_0x1becc3][_0x97ea('0x8')],_0xd2ed14[_0x23bf56][_0x1becc3][_0x97ea('0x4')]));break;case 0xa:_0x53db59[_0x5a7e85](util[_0x97ea('0x1a')]('user:%s',_0xd2ed14[_0x23bf56][_0x1becc3][_0x97ea('0x4')]));break;}}}}})[_0x97ea('0xa')](function(){if(_0x5a7e85===_0x97ea('0x4c')){var _0x32244c=_[_0x97ea('0x17')](_0x2690ba[_0x97ea('0x21')],'id');return _0x2690ba[_0x97ea('0x4d')](_0x32244c)['then'](function(){for(var _0x5d7202=0x0;_0x5d7202<_0x32244c['length'];_0x5d7202+=0x1){_0x22e81e[_0x97ea('0x4e')](_0x97ea('0x4f'),{'ChatInteractionId':Number(_0x32244c[_0x5d7202]),'UserId':Number(_0x2690ba['id'])});}});}})[_0x97ea('0xa')](function(){if(_0x5a7e85===_0x97ea('0x4c')){var _0x194b0c=_[_0x97ea('0x17')](_0x2690ba[_0x97ea('0x23')],'id');return _0x2690ba[_0x97ea('0x50')](_0x194b0c)[_0x97ea('0xa')](function(){for(var _0x2d484e=0x0;_0x2d484e<_0x194b0c[_0x97ea('0x1d')];_0x2d484e+=0x1){_0x22e81e[_0x97ea('0x4e')](_0x97ea('0x51'),{'MailInteractionId':Number(_0x194b0c[_0x2d484e]),'UserId':Number(_0x2690ba['id'])});}});}})['then'](function(){if(_0x5a7e85===_0x97ea('0x4c')){var _0x4f2b55=_[_0x97ea('0x17')](_0x2690ba[_0x97ea('0x25')],'id');return _0x2690ba['removeFaxInteractions'](_0x4f2b55)['then'](function(){for(var _0x1be245=0x0;_0x1be245<_0x4f2b55['length'];_0x1be245+=0x1){_0x22e81e[_0x97ea('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4f2b55[_0x1be245]),'UserId':Number(_0x2690ba['id'])});}});}})[_0x97ea('0xa')](function(){if(_0x5a7e85===_0x97ea('0x4c')){var _0x46ed65=_[_0x97ea('0x17')](_0x2690ba[_0x97ea('0x27')],'id');return _0x2690ba[_0x97ea('0x52')](_0x46ed65)[_0x97ea('0xa')](function(){for(var _0x2f83d1=0x0;_0x2f83d1<_0x46ed65[_0x97ea('0x1d')];_0x2f83d1+=0x1){_0x22e81e['emit'](_0x97ea('0x53'),{'SmsInteractionId':Number(_0x46ed65[_0x2f83d1]),'UserId':Number(_0x2690ba['id'])});}});}})[_0x97ea('0xa')](function(){if(_0x5a7e85==='leave'){var _0x180286=_[_0x97ea('0x17')](_0x2690ba['OpenchannelInteractions'],'id');return _0x2690ba[_0x97ea('0x54')](_0x180286)['then'](function(){for(var _0x18b7e6=0x0;_0x18b7e6<_0x180286[_0x97ea('0x1d')];_0x18b7e6+=0x1){_0x22e81e[_0x97ea('0x4e')](_0x97ea('0x55'),{'OpenchannelInteractionId':Number(_0x180286[_0x18b7e6]),'UserId':Number(_0x2690ba['id'])});}});}})['then'](function(){if(_0x5a7e85===_0x97ea('0x4c')){var _0x2cc6f2=_['map'](_0x2690ba[_0x97ea('0x2b')],'id');return _0x2690ba[_0x97ea('0x56')](_0x2cc6f2)[_0x97ea('0xa')](function(){for(var _0x2c1806=0x0;_0x2c1806<_0x2cc6f2[_0x97ea('0x1d')];_0x2c1806+=0x1){_0x22e81e[_0x97ea('0x4e')](_0x97ea('0x57'),{'WhatsappInteractionId':Number(_0x2cc6f2[_0x2c1806]),'UserId':Number(_0x2690ba['id'])});}});}})[_0x97ea('0x58')](function(_0x2b5065){_0x53db59[_0x97ea('0x59')](_0x2b5065);});}}function onDisconnect(_0x3b8184,_0x37ab9c){joinOrLeave(_0x3b8184,'leave',_0x37ab9c);}function onConnect(_0x9da14a){joinOrLeave(_0x9da14a,_0x97ea('0x5a'));}exports[_0x97ea('0x5b')]=function(_0x1783f2){_0x1783f2['on']('connection',function(_0xb2a1cb){_0xb2a1cb['setMaxListeners'](0x0);_0xb2a1cb[_0x97ea('0x5c')]=_0xb2a1cb[_0x97ea('0x5d')][_0x97ea('0x5e')][_0x97ea('0x5f')]+':'+_0xb2a1cb['request'][_0x97ea('0x5e')]['remotePort'];_0xb2a1cb[_0x97ea('0x60')]=new Date();_0xb2a1cb[_0x97ea('0x59')]=function(_0x178d6d){console[_0x97ea('0x59')](_0x97ea('0x61')+_0xb2a1cb[_0x97ea('0x62')][_0x97ea('0x4')]+'['+_0xb2a1cb['address']+']',_0x178d6d);};_0xb2a1cb['on'](_0x97ea('0x63'),function(){onDisconnect(_0xb2a1cb,_0x1783f2);_0xb2a1cb['log']('DISCONNECTED');});onConnect(_0xb2a1cb);_0xb2a1cb['log'](_0x97ea('0x64'));});}; \ No newline at end of file +var _0x4dcb=['request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','resourceId','map','where','Campaign','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','FaxQueue','Trunk','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','catch','log','default','setMaxListeners','address'];(function(_0x1055d6,_0x2b2cf3){var _0x4dc056=function(_0xcb7d57){while(--_0xcb7d57){_0x1055d6['push'](_0x1055d6['shift']());}};_0x4dc056(++_0x2b2cf3);}(_0x4dcb,0x186));var _0xb4dc=function(_0x1c4955,_0x29d472){_0x1c4955=_0x1c4955-0x0;var _0xb31703=_0x4dcb[_0x1c4955];return _0xb31703;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var BPromise=require(_0xb4dc('0x1'));var db=require(_0xb4dc('0x2'))['db'];var config=require(_0xb4dc('0x3'));var queryQueues={'attributes':['id',_0xb4dc('0x4')],'include':[{'as':_0xb4dc('0x5'),'model':db[_0xb4dc('0x6')],'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb4dc('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb4dc('0x4')],'where':{'role':_0xb4dc('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0xa')],'where':{'type':_0xb4dc('0xb')}};function getAssociatedResources(_0x168305,_0x57d4ab,_0xa50528){return db[_0xb4dc('0xc')][_0xb4dc('0xd')]({'where':{'name':_0x168305,'userProfileId':_0x57d4ab},'raw':!![]})[_0xb4dc('0xe')](function(_0x3fd9ec){if(_0x3fd9ec){if(_0x3fd9ec[_0xb4dc('0xf')]){switch(_0x168305){case _0xb4dc('0x10'):case _0xb4dc('0x11'):case _0xb4dc('0x12'):case _0xb4dc('0x13'):case _0xb4dc('0x14'):case _0xb4dc('0x15'):case _0xb4dc('0x16'):return db[_0xa50528]['findAll'](queryQueues);case _0xb4dc('0x17'):return db[_0xa50528][_0xb4dc('0x18')](queryTelephones);case _0xb4dc('0x19'):return db[_0xa50528][_0xb4dc('0x18')](queryTrunks);case _0xb4dc('0x1a'):return db[_0xa50528]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0xb4dc('0x18')]({'attributes':[_0xb4dc('0x1b')],'where':{'sectionId':_0x3fd9ec['id']},'raw':!![]})[_0xb4dc('0xe')](function(_0x8dbc17){if(_0x8dbc17){var _0x35e5dd={'where':{'id':_[_0xb4dc('0x1c')](_0x8dbc17,'resourceId')},'raw':!![]};switch(_0xa50528){case'User':_0x35e5dd[_0xb4dc('0x1d')][_0xb4dc('0x7')]=_0xb4dc('0x8');break;case _0xb4dc('0x1e'):_0x35e5dd[_0xb4dc('0x1d')][_0xb4dc('0xa')]=_0xb4dc('0xb');break;}return db[_0xa50528][_0xb4dc('0x18')](_0x35e5dd);}else{return[];}});}}else{return[];}})[_0xb4dc('0xe')](function(_0x1d2970){return _0x1d2970;});}function joinOrLeaveQueues(_0x2386f5,_0x2a2729,_0x257443,_0x2dfc39){_0x2386f5[_0x2a2729](util['format'](_0xb4dc('0x1f'),_0x257443,_0x2dfc39['name']));if(_0x2dfc39[_0xb4dc('0x5')]){for(var _0x13666b=0x0;_0x13666b<_0x2dfc39['Agents'][_0xb4dc('0x20')];_0x13666b+=0x1){_0x2386f5[_0x2a2729](util[_0xb4dc('0x21')](_0xb4dc('0x22'),_0x2dfc39[_0xb4dc('0x5')][_0x13666b][_0xb4dc('0x4')]));}}}function joinOrLeave(_0x1783c1,_0x2d0c90,_0x2b1ee1){var _0xa2561d;if(_0x1783c1[_0xb4dc('0x23')]['query']['id']){db['User'][_0xb4dc('0x24')]({'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0x7'),_0xb4dc('0x25')],'where':{'id':_0x1783c1[_0xb4dc('0x23')][_0xb4dc('0x26')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xb4dc('0x27'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb4dc('0x28'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb4dc('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb4dc('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xb4dc('0xe')](function(_0x15642c){if(_0x15642c){_0xa2561d=_0x15642c;_0x1783c1[_0x2d0c90](util['format']('user:%s',_0x15642c[_0xb4dc('0x4')]));var _0x11d20a=[];switch(_0x15642c[_0xb4dc('0x7')]){case _0xb4dc('0x2b'):_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90](_0xb4dc('0x2d'));if(queryQueues[_0xb4dc('0x2e')](_0xb4dc('0x2f'))){delete queryQueues['include'];}_0x11d20a['push'](db[_0xb4dc('0x30')][_0xb4dc('0x18')](queryQueues));_0x11d20a['push'](db[_0xb4dc('0x31')]['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x33')][_0xb4dc('0x18')](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['SmsQueue']['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['MailQueue']['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['OpenchannelQueue'][_0xb4dc('0x18')](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['WhatsappQueue']['findAll'](queryQueues));_0x11d20a['push'](db['User']['findAll'](queryTelephones));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x34')][_0xb4dc('0x18')](queryTrunks));_0x11d20a['push'](db[_0xb4dc('0x1e')][_0xb4dc('0x18')](queryCampaigns));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x6')][_0xb4dc('0x18')](queryAgents));break;case'user':_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90](_0xb4dc('0x2d'));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x10'),_0x15642c[_0xb4dc('0x25')],'VoiceQueue'));_0x11d20a['push'](getAssociatedResources(_0xb4dc('0x11'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x31')));_0x11d20a['push'](getAssociatedResources(_0xb4dc('0x12'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x33')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('SmsQueues',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x35')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x14'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x36')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x15'),_0x15642c['userProfileId'],_0xb4dc('0x37')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('WhatsappQueues',_0x15642c['userProfileId'],_0xb4dc('0x38')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x17'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x6')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('Trunks',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x34')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('IvrCampaigns',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x1e')));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x6')][_0xb4dc('0x18')](queryAgents));break;case _0xb4dc('0x9'):_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90]('voice:outbound');_0x11d20a['push'](_0x15642c[_0xb4dc('0x39')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3a')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3b')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3c')]({'attributes':['id','name']}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3d')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3e')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3f')]({'attributes':['id',_0xb4dc('0x4')]}));break;}return BPromise[_0xb4dc('0x40')](_0x11d20a);}})['then'](function(_0x3a5291){if(_0x3a5291&&_0x3a5291[_0xb4dc('0x20')]){for(var _0x5c339d=0x0;_0x5c339d<_0x3a5291[_0xb4dc('0x20')];_0x5c339d+=0x1){for(var _0x24b151=0x0;_0x24b151<_0x3a5291[_0x5c339d][_0xb4dc('0x20')];_0x24b151+=0x1){switch(_0x5c339d){case 0x0:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x41'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x1:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x42'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x2:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x43'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x3:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x44'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x4:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x45'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x5:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x46'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x6:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,'whatsapp',_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x7:if(_0xa2561d[_0xb4dc('0x7')]!==_0xb4dc('0x9'))_0x1783c1[_0x2d0c90](util['format'](_0xb4dc('0x47'),_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0x8:if(_0xa2561d[_0xb4dc('0x7')]!==_0xb4dc('0x9'))_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')](_0xb4dc('0x48'),_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0x9:if(_0xa2561d[_0xb4dc('0x7')]!=='agent')_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')]('campaign:%s:%s',_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0xa')],_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0xa:_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')](_0xb4dc('0x22'),_0x3a5291[_0x5c339d][_0x24b151]['name']));break;}}}}})['then'](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x2512fd=_[_0xb4dc('0x1c')](_0xa2561d[_0xb4dc('0x27')],'id');return _0xa2561d[_0xb4dc('0x4a')](_0x2512fd)[_0xb4dc('0xe')](function(){for(var _0x397b7f=0x0;_0x397b7f<_0x2512fd[_0xb4dc('0x20')];_0x397b7f+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x4c'),{'ChatInteractionId':Number(_0x2512fd[_0x397b7f]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x1da38c=_['map'](_0xa2561d[_0xb4dc('0x28')],'id');return _0xa2561d[_0xb4dc('0x4d')](_0x1da38c)[_0xb4dc('0xe')](function(){for(var _0xdf6bb3=0x0;_0xdf6bb3<_0x1da38c['length'];_0xdf6bb3+=0x1){_0x2b1ee1[_0xb4dc('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1da38c[_0xdf6bb3]),'UserId':Number(_0xa2561d['id'])});}});}})['then'](function(){if(_0x2d0c90==='leave'){var _0x141fa1=_[_0xb4dc('0x1c')](_0xa2561d['FaxInteractions'],'id');return _0xa2561d['removeFaxInteractions'](_0x141fa1)[_0xb4dc('0xe')](function(){for(var _0x2c137e=0x0;_0x2c137e<_0x141fa1[_0xb4dc('0x20')];_0x2c137e+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x4e'),{'FaxInteractionId':Number(_0x141fa1[_0x2c137e]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x2983b9=_['map'](_0xa2561d[_0xb4dc('0x4f')],'id');return _0xa2561d[_0xb4dc('0x50')](_0x2983b9)[_0xb4dc('0xe')](function(){for(var _0x45a048=0x0;_0x45a048<_0x2983b9[_0xb4dc('0x20')];_0x45a048+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x51'),{'SmsInteractionId':Number(_0x2983b9[_0x45a048]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x3acb7e=_[_0xb4dc('0x1c')](_0xa2561d[_0xb4dc('0x52')],'id');return _0xa2561d[_0xb4dc('0x53')](_0x3acb7e)['then'](function(){for(var _0xc0d57c=0x0;_0xc0d57c<_0x3acb7e['length'];_0xc0d57c+=0x1){_0x2b1ee1[_0xb4dc('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3acb7e[_0xc0d57c]),'UserId':Number(_0xa2561d['id'])});}});}})['then'](function(){if(_0x2d0c90==='leave'){var _0x37da4d=_['map'](_0xa2561d['WhatsappInteractions'],'id');return _0xa2561d['removeWhatsappInteractions'](_0x37da4d)[_0xb4dc('0xe')](function(){for(var _0x3ade05=0x0;_0x3ade05<_0x37da4d[_0xb4dc('0x20')];_0x3ade05+=0x1){_0x2b1ee1['emit'](_0xb4dc('0x54'),{'WhatsappInteractionId':Number(_0x37da4d[_0x3ade05]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0x55')](function(_0x257ba0){_0x1783c1[_0xb4dc('0x56')](_0x257ba0);});}}function onDisconnect(_0x3f23dc,_0x1b4044){joinOrLeave(_0x3f23dc,_0xb4dc('0x49'),_0x1b4044);}function onConnect(_0x3588af){joinOrLeave(_0x3588af,'join');}exports[_0xb4dc('0x57')]=function(_0x50e65b){_0x50e65b['on']('connection',function(_0x3c2c50){_0x3c2c50[_0xb4dc('0x58')](0x0);_0x3c2c50[_0xb4dc('0x59')]=_0x3c2c50[_0xb4dc('0x5a')]['connection'][_0xb4dc('0x5b')]+':'+_0x3c2c50[_0xb4dc('0x5a')]['connection'][_0xb4dc('0x5c')];_0x3c2c50[_0xb4dc('0x5d')]=new Date();_0x3c2c50[_0xb4dc('0x56')]=function(_0x51bbd2){console['log'](_0xb4dc('0x5e')+_0x3c2c50[_0xb4dc('0x5f')][_0xb4dc('0x4')]+'['+_0x3c2c50['address']+']',_0x51bbd2);};_0x3c2c50['on']('disconnect',function(){onDisconnect(_0x3c2c50,_0x50e65b);_0x3c2c50[_0xb4dc('0x56')]('DISCONNECTED');});onConnect(_0x3c2c50);_0x3c2c50[_0xb4dc('0x56')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7770370..a154e26 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 _0x2783=['sequelize','changed','closed','internal','interface','agent','substatus','SIP/%s','default','length','hasOwnProperty','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','SmsInteraction','newinteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','SELECT','then','contact','UserId','User','name','fullname','email','format','outgoingmessage','event'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2783,0x1f2));var _0x3278=function(_0x420f6a,_0x537ef1){_0x420f6a=_0x420f6a-0x0;var _0x26c226=_0x2783[_0x420f6a];return _0x26c226;};'use strict';var util=require(_0x3278('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3278('0x1'));var logger=require(_0x3278('0x2'))(_0x3278('0x3'));var _=require('lodash');var client=jayson[_0x3278('0x4')][_0x3278('0x5')]({'port':0x232a});var triggers=[{'channel':_0x3278('0x6'),'model':_0x3278('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x3278('0x6'),'model':_0x3278('0x7'),'event':_0x3278('0x8'),'condition':_0x3278('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x3278('0xa'),'event':_0x3278('0xb'),'condition':_0x3278('0xc'),'callback':afterCreateMessage},{'channel':_0x3278('0xd'),'model':_0x3278('0xe'),'event':_0x3278('0xb'),'condition':_0x3278('0xf'),'callback':afterCreate},{'channel':'Sms','model':_0x3278('0xe'),'event':_0x3278('0x8'),'condition':_0x3278('0x9'),'callback':afterUpdate},{'channel':_0x3278('0xd'),'model':_0x3278('0x10'),'event':_0x3278('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x3278('0x11'),'event':_0x3278('0xb'),'condition':_0x3278('0xf'),'callback':afterCreate},{'channel':_0x3278('0x12'),'model':_0x3278('0x11'),'event':_0x3278('0x8'),'condition':_0x3278('0x9'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x3278('0x13'),'event':'afterCreate','condition':_0x3278('0xc'),'callback':afterCreateMessage},{'channel':_0x3278('0x14'),'model':_0x3278('0x15'),'event':_0x3278('0xb'),'condition':_0x3278('0xf'),'callback':afterCreate},{'channel':_0x3278('0x14'),'model':_0x3278('0x15'),'event':_0x3278('0x8'),'condition':_0x3278('0x9'),'callback':afterUpdate},{'channel':_0x3278('0x14'),'model':_0x3278('0x16'),'event':_0x3278('0xb'),'condition':_0x3278('0xc'),'callback':afterCreateMessage},{'channel':_0x3278('0x17'),'model':'MailInteraction','event':'afterCreate','condition':_0x3278('0xf'),'callback':afterCreate},{'channel':'Mail','model':_0x3278('0x18'),'event':_0x3278('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3278('0x17'),'model':_0x3278('0x18'),'event':'substatus','condition':'substatus','callback':afterUpdate},{'channel':_0x3278('0x17'),'model':_0x3278('0x19'),'event':'afterCreate','condition':_0x3278('0xc'),'callback':afterCreateMessage},{'channel':_0x3278('0x1a'),'model':_0x3278('0x1b'),'event':_0x3278('0xb'),'condition':_0x3278('0xf'),'callback':afterCreate},{'channel':'Openchannel','model':_0x3278('0x1b'),'event':_0x3278('0x8'),'condition':_0x3278('0x9'),'callback':afterUpdate},{'channel':_0x3278('0x1a'),'model':'OpenchannelMessage','event':_0x3278('0xb'),'condition':_0x3278('0xc'),'callback':afterCreateMessage}];function request(_0xf0106f){return client['request'](_0x3278('0x1c'),_0xf0106f)['then'](function(_0x1f4cb3){logger[_0x3278('0x1d')](_0x3278('0x1e'),_0x3278('0x1c'),_0x1f4cb3);if(_0x1f4cb3[_0x3278('0x1f')]){if(_0x1f4cb3[_0x3278('0x1f')][_0x3278('0x20')]===0x1f4){logger['error'](_0x3278('0x1e'),'EventManager',_0x1f4cb3['error']);}}})[_0x3278('0x21')](function(_0x5444ee){logger[_0x3278('0x1f')](_0x3278('0x1e'),'EventManager',_0x5444ee);});}function afterCreateMessage(_0x55785c,_0x10ed49){return function(_0x4d8665,_0x395442){_0x4d8665=_0x4d8665[_0x3278('0x22')]({'plain':!![]});_0x4d8665[_0x3278('0x23')]=_0x55785c;_0x4d8665[_0x3278('0x24')]=_0x55785c;_0x4d8665['event']=_0x4d8665[_0x3278('0x25')];var _0x46e995=_0x3278('0x26')+_0x4d8665[_0x3278('0x27')];return db['sequelize'][_0x3278('0x28')](_0x46e995,{'type':db[_0x3278('0x29')][_0x3278('0x2a')][_0x3278('0x2b')],'raw':!![]})[_0x3278('0x2c')](function(_0x3ee4ac){return _0x3ee4ac;})[_0x3278('0x2c')](function(_0x22a883){if(_0x22a883){_0x4d8665[_0x3278('0x2d')]=_0x22a883[0x0];}if(_0x4d8665[_0x3278('0x2e')]){return db[_0x3278('0x2f')]['find']({'where':{'id':_0x4d8665['UserId']},'attributes':['id',_0x3278('0x30'),_0x3278('0x31'),_0x3278('0x32'),'internal'],'raw':!![]})[_0x3278('0x2c')](function(_0x124e36){_0x4d8665['interface']=util[_0x3278('0x33')]('SIP/%s',_0x124e36[_0x3278('0x30')]);_0x4d8665[_0x3278('0x23')]=_0x55785c;_0x4d8665['agent']=_0x124e36;return request({'event':'incomingmessage','message':_0x4d8665});})[_0x3278('0x21')](function(_0x5d85a2){console[_0x3278('0x1f')](_0x5d85a2);});}else{return request({'event':_0x3278('0x34'),'message':_0x4d8665});}});};}function afterCreate(_0x35ab54,_0x5dc86c){return function(_0x372ec9,_0x3ebef6){_0x372ec9=_0x372ec9[_0x3278('0x22')]({'plain':!![]});_0x372ec9[_0x3278('0x23')]=_0x35ab54;_0x372ec9[_0x3278('0x24')]=_0x35ab54;_0x372ec9[_0x3278('0x35')]='opened';var _0x286578=_0x3278('0x26')+_0x372ec9[_0x3278('0x27')];return db[_0x3278('0x36')][_0x3278('0x28')](_0x286578,{'type':db[_0x3278('0x29')][_0x3278('0x2a')][_0x3278('0x2b')],'raw':!![]})[_0x3278('0x2c')](function(_0x21eddb){return _0x21eddb;})['then'](function(_0x1902fa){if(_0x1902fa){_0x372ec9[_0x3278('0x2d')]=_0x1902fa[0x0];}return request({'event':_0x5dc86c,'message':_0x372ec9});});};}function afterUpdate(_0x598284,_0x53c0e2){return function(_0x535e2e,_0x133489){if(_0x535e2e[_0x3278('0x37')]('closed')&&_0x535e2e['closed']){_0x535e2e=_0x535e2e[_0x3278('0x22')]({'plain':!![]});_0x535e2e['channel']=_0x598284;_0x535e2e[_0x3278('0x24')]=_0x598284;_0x535e2e[_0x3278('0x35')]=_0x3278('0x38');var _0x2001d=_0x3278('0x26')+_0x535e2e[_0x3278('0x27')];return db['sequelize'][_0x3278('0x28')](_0x2001d,{'type':db['Sequelize'][_0x3278('0x2a')][_0x3278('0x2b')],'raw':!![]})[_0x3278('0x2c')](function(_0x40a1ac){return _0x40a1ac;})['then'](function(_0x2c5bc7){if(_0x2c5bc7){_0x535e2e[_0x3278('0x2d')]=_0x2c5bc7[0x0];}if(_0x535e2e[_0x3278('0x2e')]){return db[_0x3278('0x2f')]['find']({'where':{'id':_0x535e2e[_0x3278('0x2e')]},'attributes':['id','name','fullname',_0x3278('0x32'),_0x3278('0x39')],'raw':!![]})['then'](function(_0x2cae98){_0x535e2e[_0x3278('0x3a')]=util['format']('SIP/%s',_0x2cae98[_0x3278('0x30')]);_0x535e2e[_0x3278('0x3b')]=_0x2cae98;return request({'event':_0x53c0e2,'message':_0x535e2e});})['catch'](function(_0xc938ec){console[_0x3278('0x1f')](_0xc938ec);});}else{return request({'event':_0x53c0e2,'message':_0x535e2e});}});}else if(_0x535e2e['changed'](_0x3278('0x3c'))){_0x535e2e=_0x535e2e[_0x3278('0x22')]({'plain':!![]});_0x535e2e[_0x3278('0x23')]=_0x598284;_0x535e2e[_0x3278('0x35')]='substatus';var _0x2001d=_0x3278('0x26')+_0x535e2e[_0x3278('0x27')];return db[_0x3278('0x36')][_0x3278('0x28')](_0x2001d,{'type':db[_0x3278('0x29')][_0x3278('0x2a')][_0x3278('0x2b')],'raw':!![]})[_0x3278('0x2c')](function(_0x2e9de3){return _0x2e9de3;})[_0x3278('0x2c')](function(_0x534c1f){if(_0x534c1f){_0x535e2e[_0x3278('0x2d')]=_0x534c1f[0x0];}if(_0x535e2e[_0x3278('0x2e')]){return db[_0x3278('0x2f')]['find']({'where':{'id':_0x535e2e[_0x3278('0x2e')]},'attributes':['id',_0x3278('0x30'),_0x3278('0x31'),_0x3278('0x32'),_0x3278('0x39')],'raw':!![]})[_0x3278('0x2c')](function(_0x4e8506){_0x535e2e[_0x3278('0x3a')]=util[_0x3278('0x33')](_0x3278('0x3d'),_0x4e8506[_0x3278('0x30')]);_0x535e2e[_0x3278('0x3b')]=_0x4e8506;return request({'event':_0x53c0e2,'message':_0x535e2e});})['catch'](function(_0x221e27){console[_0x3278('0x1f')](_0x221e27);});}else{return request({'event':_0x53c0e2,'message':_0x535e2e});}});}};}exports[_0x3278('0x3e')]=function(){for(var _0x521f8a=0x0;_0x521f8a=_0x183c44[_0xc7cd('0x16')]){throw Error(_0xc7cd('0x17'));}_0x2687af(_0x574818);})[_0xc7cd('0x18')](function(_0x27ddeb){_0x5071bb(_0x27ddeb);});});}; \ No newline at end of file +var _0xea9c=['mail','chat','fax','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt','role','agent','User','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util'];(function(_0x5ce592,_0x2caa09){var _0x5aaa5e=function(_0x224c1f){while(--_0x224c1f){_0x5ce592['push'](_0x5ce592['shift']());}};_0x5aaa5e(++_0x2caa09);}(_0xea9c,0x166));var _0xcea9=function(_0x556d69,_0xaa2dc7){_0x556d69=_0x556d69-0x0;var _0x1f2c6e=_0xea9c[_0x556d69];return _0x1f2c6e;};'use strict';var _=require(_0xcea9('0x0'));var BPromise=require(_0xcea9('0x1'));var db=require('../mysqldb')['db'];var util=require(_0xcea9('0x2'));var channels=['voice',_0xcea9('0x3'),_0xcea9('0x4'),_0xcea9('0x5'),'sms','whatsapp',_0xcea9('0x6')];exports[_0xcea9('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x1e1973){_0x1e1973=_0x1e1973['toLowerCase']();return _[_0xcea9('0x8')](channels,_0x1e1973);};exports[_0xcea9('0x9')]=function(_0x48837b,_0x84fce3,_0x225646,_0x153b46){var _0xed0b7f={'loginAttempts':_0x84fce3,'blocked':_0x225646};if(!_[_0xcea9('0xa')](_0x153b46)){_0xed0b7f[_0xcea9('0xb')]=_0x153b46;}return _0x48837b['updateAttributes'](_0xed0b7f);};exports['getLicense']=function(_0x14df9f){return new BPromise(function(_0xf4132b,_0x15f144){var _0xd87e46=0x0;if(_0x14df9f[_0xcea9('0xc')]!==_0xcea9('0xd')){_0xf4132b(_0x14df9f);}db[_0xcea9('0xe')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x14df9f['id']}}})[_0xcea9('0xf')](function(_0x3b36aa){_0xd87e46=_0x3b36aa;return util[_0xcea9('0x10')]();})['then'](function(_0x2115ef){if(_0x2115ef&&_0x2115ef[_0xcea9('0x11')]&&_0xd87e46>=_0x2115ef['agents']){throw Error(_0xcea9('0x12'));}_0xf4132b(_0x14df9f);})['catch'](function(_0x5d208a){_0x15f144(_0x5d208a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 2a31a66..6116742 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3892=['status','render','json','send','exports','404'];(function(_0x5d102d,_0x2681fc){var _0x5116e6=function(_0x4efa0e){while(--_0x4efa0e){_0x5d102d['push'](_0x5d102d['shift']());}};_0x5116e6(++_0x2681fc);}(_0x3892,0x1ba));var _0x2389=function(_0x1b5f00,_0x29f4f0){_0x1b5f00=_0x1b5f00-0x0;var _0x388e51=_0x3892[_0x1b5f00];return _0x388e51;};'use strict';module[_0x2389('0x0')][0x194]=function pageNotFound(_0x122f76,_0x3c3101){var _0x53a9f5=_0x2389('0x1');var _0x995ed1=0x194;var _0x114b00={'status':_0x995ed1};_0x3c3101[_0x2389('0x2')](_0x114b00['status']);_0x3c3101[_0x2389('0x3')](_0x53a9f5,{},function(_0x4f4f2e,_0x47a057){if(_0x4f4f2e){return _0x3c3101[_0x2389('0x2')](_0x114b00[_0x2389('0x2')])[_0x2389('0x4')](_0x114b00);}_0x3c3101[_0x2389('0x5')](_0x47a057);});}; \ No newline at end of file +var _0x8dd1=['404','status','render','json','send','exports'];(function(_0x321781,_0x585793){var _0x1eacdc=function(_0x4f1695){while(--_0x4f1695){_0x321781['push'](_0x321781['shift']());}};_0x1eacdc(++_0x585793);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x5e6e0d,_0x16ab7e){_0x5e6e0d=_0x5e6e0d-0x0;var _0x129048=_0x8dd1[_0x5e6e0d];return _0x129048;};'use strict';module[_0x18dd('0x0')][0x194]=function pageNotFound(_0x408f09,_0x555ded){var _0x55a4a2=_0x18dd('0x1');var _0x577b40=0x194;var _0x24af6c={'status':_0x577b40};_0x555ded[_0x18dd('0x2')](_0x24af6c[_0x18dd('0x2')]);_0x555ded[_0x18dd('0x3')](_0x55a4a2,{},function(_0x4c99bf,_0x1093fe){if(_0x4c99bf){return _0x555ded[_0x18dd('0x2')](_0x24af6c[_0x18dd('0x2')])[_0x18dd('0x4')](_0x24af6c);}_0x555ded[_0x18dd('0x5')](_0x1093fe);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ca3682d..c7c080c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f0=['../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../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','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','belongsToMany','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoicePrefixes','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','user_has_whatsapp_accounts','SquareProjects','ChanSpyId','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPauseId','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','mailbox','VoiceMailMessage','mailboxuser','QueueCalls','uniqueid','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','Applications','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Teams','Messages','Contact','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','MailInteractionId','Account','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','ListId','MailQueueReport','Disposition','FaxAccountId','fax_interaction_has_tags','Users','AttachmentId','Agents','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','DescriptionId','FieldId','SalesforceField','Subject','SubjectId','Description','VariableId','SugarcrmAccount','SugarcrmField','Subjects','Descriptions','Field','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Field','Dynamics365Account','FromId','ToId','SessionId','ProjectId','user_has_square_projects','VoiceQueues','SmsQueues','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','cm_user_has_lists','UserProfileSections','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','username','password','options','database','User','import','../api/user/user.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x64f0,0x19d));var _0x064f=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x64f0[_0x4d1ee9];return _0x9a5456;};'use strict';var config=require(_0x064f('0x0'));var Sequelize=require(_0x064f('0x1'));var _=require(_0x064f('0x2'));var jstz=require(_0x064f('0x3'));var timezone=jstz[_0x064f('0x4')]();config[_0x064f('0x1')]=_['defaultsDeep'](config[_0x064f('0x1')],{'database':'motion2','username':_0x064f('0x5'),'password':_0x064f('0x6'),'options':{'host':_0x064f('0x7'),'port':0xcea,'dialect':_0x064f('0x8'),'dialectOptions':{'charset':_0x064f('0x9')},'logging':![],'timezone':timezone[_0x064f('0xa')](),'define':{'charset':_0x064f('0xb'),'collate':_0x064f('0xc')}}});config[_0x064f('0xd')]=_[_0x064f('0xe')](config['sequelizeHistory'],{'database':'motion2','username':_0x064f('0x5'),'password':_0x064f('0x6'),'options':{'host':_0x064f('0x7'),'port':0xcea,'dialect':_0x064f('0x8'),'dialectOptions':{'charset':_0x064f('0x9')},'logging':![],'timezone':timezone[_0x064f('0xa')](),'define':{'charset':_0x064f('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x064f('0x1')]['database'],config[_0x064f('0x1')][_0x064f('0xf')],config['sequelize'][_0x064f('0x10')],config[_0x064f('0x1')][_0x064f('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x064f('0xd')][_0x064f('0x12')],config[_0x064f('0xd')]['username'],config[_0x064f('0xd')][_0x064f('0x10')],config['sequelizeHistory'][_0x064f('0x11')])};db[_0x064f('0x13')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x15'));db['VoiceChanSpy']=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0x064f('0x16')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x17'));db[_0x064f('0x18')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x19'));db[_0x064f('0x1a')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x1b'));db[_0x064f('0x1c')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x1d'));db[_0x064f('0x1e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x1f'));db['ScreenRecording']=db['sequelize'][_0x064f('0x14')](_0x064f('0x20'));db['VoiceMail']=db[_0x064f('0x1')]['import'](_0x064f('0x21'));db['VoiceMailMessage']=db[_0x064f('0x1')]['import'](_0x064f('0x22'));db[_0x064f('0x23')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x24'));db[_0x064f('0x25')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x26'));db[_0x064f('0x27')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x28'));db[_0x064f('0x29')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x2a'));db[_0x064f('0x2b')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x2c'));db['Trunk']=db[_0x064f('0x1')][_0x064f('0x14')]('../api/trunk/trunk.model');db[_0x064f('0x2d')]=db[_0x064f('0x1')]['import'](_0x064f('0x2e'));db[_0x064f('0x2f')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x30'));db[_0x064f('0x31')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x32'));db[_0x064f('0x33')]=db['sequelize'][_0x064f('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db['sequelize'][_0x064f('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x064f('0x34')]=db['sequelize']['import'](_0x064f('0x35'));db[_0x064f('0x36')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x064f('0x37')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x38'));db['UserWhatsappQueue']=db['sequelize'][_0x064f('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x064f('0x39')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x3a'));db[_0x064f('0x3b')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x064f('0x1')]['import'](_0x064f('0x3c'));db[_0x064f('0x3d')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/mailQueue/mailQueue.model');db[_0x064f('0x3e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x3f'));db[_0x064f('0x40')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x41'));db[_0x064f('0x42')]=db['sequelize']['import'](_0x064f('0x43'));db[_0x064f('0x44')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x45'));db['MailQueueReport']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x46'));db[_0x064f('0x47')]=db[_0x064f('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x064f('0x48')]=db[_0x064f('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x064f('0x49')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x4a'));db[_0x064f('0x4b')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/faxApplication/faxApplication.model');db[_0x064f('0x4c')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x4d'));db[_0x064f('0x4e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x4f'));db[_0x064f('0x50')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x51'));db[_0x064f('0x52')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x53'));db[_0x064f('0x54')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/smsAccount/smsAccount.model');db[_0x064f('0x55')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x56'));db[_0x064f('0x57')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x064f('0x58')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x59'));db[_0x064f('0x5a')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x5b'));db['OpenchannelAccount']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x5c'));db['OpenchannelApplication']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x5d'));db[_0x064f('0x5e')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x5f'));db[_0x064f('0x60')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x064f('0x61')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x62'));db[_0x064f('0x63')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x064f('0x64')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x65'));db[_0x064f('0x66')]=db[_0x064f('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x064f('0x67')]=db['sequelize']['import'](_0x064f('0x68'));db[_0x064f('0x69')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x6a'));db[_0x064f('0x6b')]=db[_0x064f('0x1')]['import'](_0x064f('0x6c'));db[_0x064f('0x6d')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/chatGroup/chatGroup.model');db[_0x064f('0x6e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x6f'));db[_0x064f('0x70')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x71'));db['CmContact']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x72'));db[_0x064f('0x73')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/cmHopper/cmHopper.model');db[_0x064f('0x74')]=db[_0x064f('0x1')]['import'](_0x064f('0x75'));db[_0x064f('0x76')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x77'));db[_0x064f('0x78')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x79'));db[_0x064f('0x7a')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x7b'));db['CmCustomField']=db[_0x064f('0x1')][_0x064f('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x064f('0x7c')]=db['sequelize'][_0x064f('0x14')]('../api/action/action.model');db['Automation']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x7d'));db[_0x064f('0x7e')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x7f'));db['Disposition']=db[_0x064f('0x1')]['import'](_0x064f('0x80'));db[_0x064f('0x81')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x064f('0x1')]['import']('../api/interval/interval.model');db[_0x064f('0x82')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x83'));db[_0x064f('0x84')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x85'));db[_0x064f('0x86')]=db[_0x064f('0x1')]['import'](_0x064f('0x87'));db[_0x064f('0x88')]=db[_0x064f('0x1')]['import'](_0x064f('0x89'));db[_0x064f('0x8a')]=db[_0x064f('0x1')]['import'](_0x064f('0x8b'));db['Tag']=db[_0x064f('0x1')][_0x064f('0x14')]('../api/tag/tag.model');db[_0x064f('0x8c')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x8d'));db[_0x064f('0x8e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x8f'));db[_0x064f('0x90')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x91'));db[_0x064f('0x92')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x93'));db[_0x064f('0x94')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x95'));db['AnalyticCustomReport']=db[_0x064f('0x1')]['import'](_0x064f('0x96'));db[_0x064f('0x97')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x98'));db[_0x064f('0x99')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x9a'));db['AnalyticMetric']=db['sequelize'][_0x064f('0x14')](_0x064f('0x9b'));db[_0x064f('0x9c')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x9d'));db['AnalyticTreeReport']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x9e'));db[_0x064f('0x9f')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xa0'));db[_0x064f('0xa1')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xa2'));db['SalesforceField']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xa3'));db['SugarcrmAccount']=db['sequelize'][_0x064f('0x14')](_0x064f('0xa4'));db[_0x064f('0xa5')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xa6'));db['SugarcrmField']=db['sequelize'][_0x064f('0x14')](_0x064f('0xa7'));db[_0x064f('0xa8')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xa9'));db[_0x064f('0xaa')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xab'));db[_0x064f('0xac')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xad'));db[_0x064f('0xae')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x064f('0xaf')]=db[_0x064f('0x1')]['import'](_0x064f('0xb0'));db[_0x064f('0xb1')]=db['sequelize']['import'](_0x064f('0xb2'));db[_0x064f('0xb3')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xb4'));db[_0x064f('0xb5')]=db['sequelize'][_0x064f('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x064f('0xb6')]=db['sequelize'][_0x064f('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x064f('0xb7')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xb8'));db[_0x064f('0xb9')]=db['sequelize']['import'](_0x064f('0xba'));db[_0x064f('0xbb')]=db['sequelize']['import'](_0x064f('0xbc'));db[_0x064f('0xbd')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xbe'));db[_0x064f('0xbf')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x064f('0xc0')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xc1'));db[_0x064f('0xc2')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xc3'));db[_0x064f('0xc4')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xc5'));db[_0x064f('0xc6')]=db[_0x064f('0x1')]['import'](_0x064f('0xc7'));db['Dynamics365Account']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xc8'));db[_0x064f('0xc9')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xca'));db['Dynamics365Field']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xcb'));db[_0x064f('0xcc')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xcd'));db[_0x064f('0xce')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xcf'));db[_0x064f('0xd0')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xd1'));db[_0x064f('0x92')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x93'));db[_0x064f('0xd2')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xd3'));db[_0x064f('0xd4')]=db['sequelize'][_0x064f('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x064f('0xd5')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xd6'));db[_0x064f('0xd7')]=db['sequelize'][_0x064f('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x064f('0xd8')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xd9'));db[_0x064f('0xda')]=db[_0x064f('0x1')]['import'](_0x064f('0xdb'));db[_0x064f('0xdc')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x064f('0xdd')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xde'));db[_0x064f('0xdf')]=db[_0x064f('0x1')]['import'](_0x064f('0xe0'));db[_0x064f('0xe1')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xe2'));db[_0x064f('0xe3')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xe4'));db[_0x064f('0xe5')]=db[_0x064f('0x1')]['import'](_0x064f('0xe6'));db[_0x064f('0xe7')]=db[_0x064f('0x1')]['import'](_0x064f('0xe8'));db[_0x064f('0xe9')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xea'));db[_0x064f('0xeb')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xec'));db[_0x064f('0xed')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xee'));db[_0x064f('0xef')]=db['sequelize'][_0x064f('0x14')](_0x064f('0xf0'));db[_0x064f('0xf1')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/campaign/campaign.model');db[_0x064f('0xf2')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xf3'));db[_0x064f('0xf4')]=db['sequelize']['import'](_0x064f('0xf5'));db[_0x064f('0xf6')]=db['sequelize']['import'](_0x064f('0xf7'));db[_0x064f('0xf8')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xf9'));db['ChatTransferReport']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0xfa'));db[_0x064f('0xfb')]=db[_0x064f('0x1')]['import'](_0x064f('0xfc'));db['OpenchannelTransferReport']=db['sequelize'][_0x064f('0x14')](_0x064f('0xfd'));db[_0x064f('0xfe')]=db['sequelize']['import'](_0x064f('0xff'));db[_0x064f('0x100')]=db['sequelize']['import'](_0x064f('0x101'));db[_0x064f('0x102')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x103'));db[_0x064f('0x104')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x105'));db[_0x064f('0x106')]=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0x064f('0x107')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x108'));db['UserNotification']=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x109'));db[_0x064f('0x10a')]=db[_0x064f('0x1')]['import'](_0x064f('0x10b'));db[_0x064f('0x10c')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x10d'));db[_0x064f('0x10e')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x10f'));db[_0x064f('0x110')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x111'));db[_0x064f('0x112')]=db[_0x064f('0x1')][_0x064f('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x064f('0x113')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x114'));db[_0x064f('0x115')]=db[_0x064f('0x1')][_0x064f('0x14')](_0x064f('0x116'));db[_0x064f('0x117')]=db['sequelize'][_0x064f('0x14')](_0x064f('0x118'));db[_0x064f('0x119')]=db['sequelize'][_0x064f('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x064f('0x11a')]=db[_0x064f('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x064f('0x1')]['import'](_0x064f('0x11b'));db[_0x064f('0x13')][_0x064f('0x11c')](db[_0x064f('0x11d')],{'as':_0x064f('0x11d'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x11f')});db['User'][_0x064f('0x120')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x2f')],{'as':_0x064f('0x121'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x18')],{'as':_0x064f('0x122'),'onDelete':'cascade','hooks':!![]});db['User'][_0x064f('0x120')](db[_0x064f('0x76')],{'as':_0x064f('0x123'),'foreignKey':'UserId'});db[_0x064f('0x13')]['hasMany'](db[_0x064f('0x78')],{'as':_0x064f('0x124'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x7a')],{'as':_0x064f('0x7a'),'foreignKey':'UserId'});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x5e')],{'as':_0x064f('0x125'),'foreignKey':_0x064f('0x11f')});db['User'][_0x064f('0x120')](db['ChatInteraction'],{'as':_0x064f('0x126'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x57')],{'as':_0x064f('0x127'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db[_0x064f('0x4c')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User'][_0x064f('0x120')](db[_0x064f('0x40')],{'as':'MailInteractions','foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')][_0x064f('0x120')](db['WhatsappInteraction'],{'as':_0x064f('0x128'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x13')]['hasMany'](db[_0x064f('0x129')],{'as':_0x064f('0x12a'),'foreignKey':_0x064f('0x12b')});db[_0x064f('0x13')][_0x064f('0x12c')](db[_0x064f('0x104')],{'as':_0x064f('0x104'),'foreignKey':_0x064f('0x12d')});db[_0x064f('0x13')]['belongsToMany'](db[_0x064f('0x6d')],{'as':_0x064f('0x12e'),'through':_0x064f('0x12f')});db[_0x064f('0x13')]['belongsToMany'](db[_0x064f('0x130')],{'as':'Contacts','through':_0x064f('0x131')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x100')],{'as':_0x064f('0x133'),'through':'cm_user_has_lists'});db[_0x064f('0x13')][_0x064f('0x132')](db['Team'],{'through':_0x064f('0x134')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x40')],{'as':'MailInteractions','through':_0x064f('0x135')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x66')],{'as':'ChatInteractions','through':_0x064f('0x136')});db[_0x064f('0x13')]['belongsToMany'](db['FaxInteraction'],{'as':_0x064f('0x137'),'through':_0x064f('0x138')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x57')],{'as':_0x064f('0x127'),'through':_0x064f('0x139')});db['User'][_0x064f('0x132')](db[_0x064f('0x5e')],{'as':_0x064f('0x125'),'through':_0x064f('0x13a')});db[_0x064f('0x13')][_0x064f('0x132')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x1c')],{'as':'VoiceQueues','through':_0x064f('0x31'),'required':![]});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x102')],{'as':_0x064f('0x13b'),'through':_0x064f('0x13c'),'required':![]});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x3d')],{'as':_0x064f('0x13d'),'through':_0x064f('0x13e'),'required':![]});db['User'][_0x064f('0x132')](db['ChatQueue'],{'as':_0x064f('0x13f'),'through':_0x064f('0x33'),'required':![],'hooks':!![]});db[_0x064f('0x13')][_0x064f('0x132')](db['FaxQueue'],{'as':_0x064f('0x140'),'through':_0x064f('0x34'),'required':![]});db['User'][_0x064f('0x132')](db[_0x064f('0x5a')],{'as':'SmsQueues','through':_0x064f('0x36'),'required':![]});db['User'][_0x064f('0x132')](db[_0x064f('0x60')],{'as':_0x064f('0x141'),'through':_0x064f('0x37'),'required':![]});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x115')],{'as':_0x064f('0x142'),'through':_0x064f('0x143'),'required':![]});db[_0x064f('0x13')][_0x064f('0x132')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x064f('0x13')][_0x064f('0x132')](db['VoicePrefix'],{'as':_0x064f('0x13b'),'through':_0x064f('0x144'),'required':![]});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x61')],{'as':'ChatWebsites','through':_0x064f('0x145')});db[_0x064f('0x13')][_0x064f('0x132')](db['FaxAccount'],{'as':_0x064f('0x146'),'through':_0x064f('0x147')});db[_0x064f('0x13')][_0x064f('0x132')](db['MailAccount'],{'as':_0x064f('0x148'),'through':_0x064f('0x149')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x14a')],{'as':_0x064f('0x14b'),'through':_0x064f('0x14c')});db[_0x064f('0x13')][_0x064f('0x132')](db['SmsAccount'],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0x10a')],{'as':'WhatsappAccounts','through':_0x064f('0x14d')});db[_0x064f('0x13')][_0x064f('0x132')](db[_0x064f('0xe7')],{'as':_0x064f('0x14e'),'through':'user_has_square_projects'});db['VoiceChanSpy'][_0x064f('0x120')](db[_0x064f('0x18')],{'as':'SpiedAgents','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x14f')});db['VoiceContext'][_0x064f('0x120')](db['VoiceExtension'],{'onDelete':_0x064f('0x11e')});db['VoiceExtension'][_0x064f('0x120')](db[_0x064f('0x18')],{'as':'Applications','onDelete':_0x064f('0x11e')});db[_0x064f('0x1a')][_0x064f('0x132')](db[_0x064f('0x8a')],{'as':'Sounds','through':_0x064f('0x150')});db[_0x064f('0x1c')][_0x064f('0x120')](db[_0x064f('0x2f')],{'as':_0x064f('0x151'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x064f('0x120')](db['CmHopper'],{'as':_0x064f('0x152'),'foreignKey':_0x064f('0x153')});db[_0x064f('0x1c')]['hasMany'](db[_0x064f('0x76')],{'as':_0x064f('0x123'),'foreignKey':'VoiceQueueId'});db[_0x064f('0x1c')][_0x064f('0x120')](db['CmHopperHistory'],{'as':_0x064f('0x154'),'foreignKey':_0x064f('0x153')});db['VoiceQueue'][_0x064f('0x120')](db[_0x064f('0x7a')],{'as':_0x064f('0x7a'),'foreignKey':_0x064f('0x153')});db[_0x064f('0x1c')]['hasMany'](db['CmHopperBlack'],{'as':_0x064f('0x155'),'foreignKey':_0x064f('0x153')});db[_0x064f('0x1c')][_0x064f('0x120')](db['JscriptySessionReport'],{'as':_0x064f('0x156'),'foreignKey':_0x064f('0x153')});db[_0x064f('0x1c')][_0x064f('0x12c')](db[_0x064f('0x157')],{'as':_0x064f('0x157'),'foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x064f('0x158'),'foreignKey':_0x064f('0x159')});db[_0x064f('0x1c')][_0x064f('0x12c')](db[_0x064f('0x15a')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x064f('0x1c')]['belongsTo'](db[_0x064f('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x064f('0x15b')});db['VoiceQueue'][_0x064f('0x132')](db[_0x064f('0x100')],{'as':_0x064f('0x133'),'through':'voice_queues_has_cm_lists'});db[_0x064f('0x1c')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':'Agents','through':_0x064f('0x31')});db[_0x064f('0x1c')][_0x064f('0x132')](db[_0x064f('0xed')],{'as':'Teams','through':_0x064f('0x119')});db[_0x064f('0x1c')][_0x064f('0x132')](db[_0x064f('0x100')],{'as':_0x064f('0x15c'),'through':_0x064f('0x15d')});db[_0x064f('0x1e')][_0x064f('0x12c')](db['User'],{'as':_0x064f('0x13'),'foreignKey':_0x064f('0x11f')});db[_0x064f('0x15e')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x13'),'foreignKey':'UserId'});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x064f('0x15f')});db[_0x064f('0x160')][_0x064f('0x12c')](db[_0x064f('0x11d')],{'foreignKey':_0x064f('0x161'),'targetKey':_0x064f('0x15f')});db[_0x064f('0x23')][_0x064f('0x120')](db['VoiceQueueReport'],{'as':_0x064f('0x162'),'foreignKey':_0x064f('0x163'),'constraints':![]});db[_0x064f('0x23')][_0x064f('0x120')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x064f('0x23')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':'User','foreignKey':_0x064f('0x11f')});db[_0x064f('0x23')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':'Contact','foreignKey':_0x064f('0x164')});db[_0x064f('0x39')][_0x064f('0x12c')](db['MailAccount'],{'as':_0x064f('0x165'),'foreignKey':_0x064f('0x166')});db['MailServerOut'][_0x064f('0x12c')](db[_0x064f('0x165')],{'as':_0x064f('0x165'),'foreignKey':'MailAccountId'});db[_0x064f('0x165')][_0x064f('0x11c')](db[_0x064f('0x39')],{'as':_0x064f('0x167'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x165')]['hasOne'](db[_0x064f('0x3b')],{'as':_0x064f('0x168'),'onDelete':'cascade'});db[_0x064f('0x165')][_0x064f('0x120')](db['Disposition'],{'as':_0x064f('0x169'),'foreignKey':_0x064f('0x166'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x165')][_0x064f('0x120')](db[_0x064f('0x7e')],{'as':_0x064f('0x16a'),'foreignKey':_0x064f('0x166')});db[_0x064f('0x165')]['hasMany'](db[_0x064f('0x42')],{'as':'Messages','foreignKey':_0x064f('0x166')});db['MailAccount'][_0x064f('0x120')](db[_0x064f('0x40')],{'as':_0x064f('0x16b')});db[_0x064f('0x165')][_0x064f('0x120')](db['MailApplication'],{'as':_0x064f('0x16c')});db[_0x064f('0x165')][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':'ListId'});db[_0x064f('0x165')][_0x064f('0x12c')](db[_0x064f('0x8c')],{'as':_0x064f('0x8c'),'foreignKey':_0x064f('0x16e')});db['MailAccount'][_0x064f('0x12c')](db[_0x064f('0x82')],{'as':_0x064f('0x16f'),'foreignKey':_0x064f('0x15b')});db[_0x064f('0x165')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x064f('0x3d')]['belongsToMany'](db[_0x064f('0x13')],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x064f('0x132')](db[_0x064f('0xed')],{'through':_0x064f('0x170'),'as':_0x064f('0x171')});db['MailInteraction'][_0x064f('0x120')](db[_0x064f('0x42')],{'as':_0x064f('0x172'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x064f('0x40')][_0x064f('0x12c')](db[_0x064f('0x165')],{'as':'Account','foreignKey':_0x064f('0x166')});db['MailInteraction'][_0x064f('0x12c')](db['CmContact'],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x40')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x174'),'foreignKey':'UserId'});db['MailInteraction'][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x176'),'as':_0x064f('0x177')});db[_0x064f('0x40')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x176'),'as':_0x064f('0x178')});db[_0x064f('0x40')][_0x064f('0x132')](db['User'],{'as':'Users','through':_0x064f('0x135'),'foreignKey':'MailInteractionId'});db[_0x064f('0x42')][_0x064f('0x120')](db['Attachment'],{'as':_0x064f('0x179'),'onDelete':'cascade'});db[_0x064f('0x42')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x13')});db[_0x064f('0x42')][_0x064f('0x12c')](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173')});db['MailMessage']['belongsTo'](db[_0x064f('0x40')],{'as':_0x064f('0x17a'),'foreignKey':_0x064f('0x17b')});db[_0x064f('0x42')][_0x064f('0x12c')](db[_0x064f('0x165')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x166')});db[_0x064f('0x42')][_0x064f('0x12c')](db[_0x064f('0x61')],{'as':_0x064f('0x61'),'foreignKey':_0x064f('0x17d')});db[_0x064f('0x42')][_0x064f('0x12c')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x064f('0x17e')});db['MailApplication'][_0x064f('0x12c')](db[_0x064f('0x13')],{'onDelete':'restrict'});db[_0x064f('0x44')][_0x064f('0x12c')](db[_0x064f('0x3d')],{'onDelete':_0x064f('0x17f')});db[_0x064f('0x44')]['belongsTo'](db[_0x064f('0x165')],{'onDelete':_0x064f('0x17f')});db[_0x064f('0x44')]['belongsTo'](db[_0x064f('0x15a')],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x180')});db[_0x064f('0x44')][_0x064f('0x12c')](db[_0x064f('0x175')],{'onDelete':_0x064f('0x17f'),'foreignKey':'TagId'});db['MailQueueReport'][_0x064f('0x12c')](db[_0x064f('0x165')],{});db['MailQueueReport'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x182')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':'Contact','foreignKey':'ContactId'});db[_0x064f('0x182')][_0x064f('0x12c')](db['MailInteraction'],{});db[_0x064f('0x182')][_0x064f('0x12c')](db[_0x064f('0x42')],{});db[_0x064f('0x182')][_0x064f('0x12c')](db[_0x064f('0x13')],{});db[_0x064f('0x182')]['belongsTo'](db[_0x064f('0x3d')],{});db[_0x064f('0x47')][_0x064f('0x120')](db['DashboardItem'],{'as':'Items','onDelete':_0x064f('0x11e')});db['FaxAccount']['hasMany'](db[_0x064f('0x183')],{'as':_0x064f('0x169'),'foreignKey':'FaxAccountId','onDelete':_0x064f('0x11e')});db['FaxAccount'][_0x064f('0x120')](db[_0x064f('0x7e')],{'as':_0x064f('0x16a'),'foreignKey':_0x064f('0x184')});db[_0x064f('0x49')][_0x064f('0x120')](db[_0x064f('0x4c')],{'as':_0x064f('0x16b')});db['FaxAccount']['hasMany'](db[_0x064f('0x4b')],{'as':'Applications'});db[_0x064f('0x49')][_0x064f('0x120')](db[_0x064f('0x18')],{'as':'Exntensions','onDelete':_0x064f('0x11e')});db['FaxAccount'][_0x064f('0x120')](db[_0x064f('0x4e')],{'as':_0x064f('0x172')});db[_0x064f('0x49')][_0x064f('0x12c')](db['Trunk'],{'as':'Trunk'});db[_0x064f('0x49')][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x49')]['belongsTo'](db[_0x064f('0x82')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x064f('0x49')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':'Agents','through':_0x064f('0x147')});db[_0x064f('0x4b')][_0x064f('0x12c')](db[_0x064f('0x13')],{'onDelete':'restrict'});db[_0x064f('0x4b')][_0x064f('0x12c')](db[_0x064f('0x50')],{'onDelete':'restrict'});db[_0x064f('0x4b')][_0x064f('0x12c')](db[_0x064f('0x49')],{'onDelete':'restrict'});db[_0x064f('0x4b')]['belongsTo'](db['Tag'],{'onDelete':_0x064f('0x17f'),'foreignKey':'TagId'});db['FaxInteraction'][_0x064f('0x120')](db[_0x064f('0x4e')],{'as':_0x064f('0x172'),'onDelete':_0x064f('0x11e'),'foreignKey':'FaxInteractionId'});db[_0x064f('0x4c')][_0x064f('0x12c')](db[_0x064f('0x49')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x184')});db[_0x064f('0x4c')]['belongsTo'](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db['FaxInteraction'][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x174'),'foreignKey':_0x064f('0x11f')});db['FaxInteraction'][_0x064f('0x132')](db[_0x064f('0x175')],{'through':'fax_interaction_has_tags','as':_0x064f('0x177')});db[_0x064f('0x4c')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x185'),'as':_0x064f('0x178')});db[_0x064f('0x4c')][_0x064f('0x132')](db['User'],{'as':_0x064f('0x186'),'through':_0x064f('0x138'),'foreignKey':'FaxInteractionId'});db[_0x064f('0x4e')]['belongsTo'](db[_0x064f('0x13')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x13')});db[_0x064f('0x4e')][_0x064f('0x12c')](db[_0x064f('0x4c')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x064f('0x4e')][_0x064f('0x12c')](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173')});db['FaxMessage'][_0x064f('0x12c')](db[_0x064f('0xf4')],{'as':'Attachment','foreignKey':_0x064f('0x187')});db[_0x064f('0x4e')][_0x064f('0x12c')](db['FaxAccount'],{'as':_0x064f('0x17c'),'foreignKey':'FaxAccountId'});db[_0x064f('0x50')]['belongsToMany'](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':_0x064f('0x34')});db['FaxQueue'][_0x064f('0x132')](db['Team'],{'through':_0x064f('0x189'),'as':'Teams'});db[_0x064f('0x52')][_0x064f('0x12c')](db[_0x064f('0x49')],{});db['FaxQueueReport'][_0x064f('0x12c')](db['CmList'],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x52')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x064f('0x12c')](db[_0x064f('0x4c')],{});db[_0x064f('0x52')]['belongsTo'](db[_0x064f('0x4e')],{});db[_0x064f('0x52')][_0x064f('0x12c')](db[_0x064f('0x13')],{});db[_0x064f('0x52')][_0x064f('0x12c')](db['FaxQueue'],{});db[_0x064f('0x54')]['hasMany'](db[_0x064f('0x183')],{'as':'Dispositions','foreignKey':_0x064f('0x18a'),'onDelete':_0x064f('0x11e')});db['SmsAccount']['hasMany'](db[_0x064f('0x7e')],{'as':_0x064f('0x16a'),'foreignKey':'SmsAccountId'});db[_0x064f('0x54')][_0x064f('0x120')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x064f('0x18a')});db[_0x064f('0x54')][_0x064f('0x120')](db[_0x064f('0x57')],{'as':_0x064f('0x16b')});db[_0x064f('0x54')][_0x064f('0x120')](db[_0x064f('0x55')],{'as':_0x064f('0x16c')});db[_0x064f('0x54')]['belongsTo'](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db['SmsAccount'][_0x064f('0x12c')](db[_0x064f('0x82')],{'as':_0x064f('0x16f'),'foreignKey':_0x064f('0x15b')});db[_0x064f('0x54')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':_0x064f('0x18b')});db['SmsApplication'][_0x064f('0x12c')](db['User'],{'onDelete':_0x064f('0x17f')});db[_0x064f('0x55')]['belongsTo'](db[_0x064f('0x5a')],{'onDelete':_0x064f('0x17f')});db['SmsApplication'][_0x064f('0x12c')](db[_0x064f('0x54')],{'onDelete':_0x064f('0x17f')});db['SmsApplication'][_0x064f('0x12c')](db[_0x064f('0x15a')],{'onDelete':_0x064f('0x17f'),'foreignKey':'IntervalId'});db[_0x064f('0x55')][_0x064f('0x12c')](db['Tag'],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x18c')});db[_0x064f('0x57')][_0x064f('0x120')](db[_0x064f('0x58')],{'as':'Messages','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x18d')});db[_0x064f('0x57')][_0x064f('0x12c')](db[_0x064f('0x54')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x18a')});db[_0x064f('0x57')][_0x064f('0x12c')](db['CmContact'],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db['SmsInteraction'][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x174'),'foreignKey':'UserId'});db['SmsInteraction'][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x18e'),'as':'Tags'});db[_0x064f('0x57')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x18e'),'as':_0x064f('0x178')});db[_0x064f('0x57')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x186'),'through':_0x064f('0x139'),'foreignKey':_0x064f('0x18d')});db[_0x064f('0x58')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':'User'});db['SmsMessage'][_0x064f('0x12c')](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173')});db[_0x064f('0x58')][_0x064f('0x12c')](db['SmsInteraction'],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x17a'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x064f('0x12c')](db[_0x064f('0x54')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x18a')});db[_0x064f('0x5a')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':'UserSmsQueue','foreignKey':_0x064f('0x18f')});db[_0x064f('0x5a')][_0x064f('0x132')](db[_0x064f('0xed')],{'through':_0x064f('0x190'),'as':'Teams'});db[_0x064f('0x14a')][_0x064f('0x120')](db[_0x064f('0x183')],{'as':_0x064f('0x169'),'foreignKey':_0x064f('0x191'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x14a')][_0x064f('0x120')](db[_0x064f('0x7e')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x064f('0x14a')][_0x064f('0x120')](db[_0x064f('0x5e')],{'as':'Interactions','foreignKey':_0x064f('0x191')});db[_0x064f('0x14a')]['hasMany'](db[_0x064f('0x192')],{'as':_0x064f('0x172'),'foreignKey':_0x064f('0x191')});db[_0x064f('0x14a')][_0x064f('0x120')](db['OpenchannelApplication'],{'as':_0x064f('0x16c'),'foreignKey':_0x064f('0x191')});db['OpenchannelAccount'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':'List','foreignKey':_0x064f('0x181')});db[_0x064f('0x14a')][_0x064f('0x12c')](db['Pause'],{'as':_0x064f('0x16f'),'foreignKey':_0x064f('0x15b')});db[_0x064f('0x14a')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':_0x064f('0x14c')});db[_0x064f('0x193')]['belongsTo'](db[_0x064f('0x13')],{'onDelete':_0x064f('0x17f')});db[_0x064f('0x193')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x194')});db[_0x064f('0x193')][_0x064f('0x12c')](db[_0x064f('0x14a')],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x191')});db['OpenchannelApplication'][_0x064f('0x12c')](db[_0x064f('0x15a')],{'onDelete':_0x064f('0x17f'),'foreignKey':'IntervalId'});db[_0x064f('0x193')][_0x064f('0x12c')](db[_0x064f('0x175')],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x18c')});db[_0x064f('0x5e')][_0x064f('0x120')](db[_0x064f('0x192')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x064f('0x195')});db[_0x064f('0x5e')]['belongsTo'](db[_0x064f('0x14a')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x191')});db[_0x064f('0x5e')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':'ContactId'});db[_0x064f('0x5e')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':'Owner','foreignKey':_0x064f('0x11f')});db[_0x064f('0x5e')]['belongsToMany'](db['Tag'],{'through':_0x064f('0x196'),'as':_0x064f('0x177')});db[_0x064f('0x5e')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x196'),'as':_0x064f('0x178')});db['OpenchannelInteraction'][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x186'),'through':_0x064f('0x13a'),'foreignKey':_0x064f('0x195')});db[_0x064f('0x192')]['belongsTo'](db['User'],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x13')});db['OpenchannelMessage'][_0x064f('0x12c')](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':'Contact'});db[_0x064f('0x192')][_0x064f('0x12c')](db[_0x064f('0x5e')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x17a'),'foreignKey':'OpenchannelInteractionId'});db[_0x064f('0x192')]['belongsTo'](db[_0x064f('0xf4')],{'as':_0x064f('0xf4'),'foreignKey':_0x064f('0x187')});db[_0x064f('0x192')][_0x064f('0x12c')](db[_0x064f('0x14a')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x191')});db[_0x064f('0x60')]['belongsToMany'](db[_0x064f('0x13')],{'as':'Agents','through':_0x064f('0x37'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0x064f('0xed')],{'through':_0x064f('0x197'),'as':_0x064f('0x171')});db['ChatWebsite'][_0x064f('0x120')](db[_0x064f('0x183')],{'as':_0x064f('0x169'),'foreignKey':'ChatWebsiteId','onDelete':_0x064f('0x11e')});db[_0x064f('0x61')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x064f('0x17d')});db['ChatWebsite'][_0x064f('0x120')](db[_0x064f('0x6e')],{'as':_0x064f('0x198')});db['ChatWebsite'][_0x064f('0x120')](db['ChatInteraction'],{'as':_0x064f('0x16b')});db[_0x064f('0x61')]['hasMany'](db[_0x064f('0x64')],{'as':_0x064f('0x16c')});db[_0x064f('0x61')][_0x064f('0x120')](db[_0x064f('0x67')],{'as':_0x064f('0x172')});db['ChatWebsite']['belongsTo'](db[_0x064f('0x100')],{'as':'List','foreignKey':'ListId'});db['ChatWebsite'][_0x064f('0x12c')](db[_0x064f('0x15a')],{'as':_0x064f('0x15a'),'foreignKey':_0x064f('0x180')});db['ChatWebsite']['belongsTo'](db['MailAccount'],{'as':_0x064f('0x165'),'foreignKey':_0x064f('0x166')});db[_0x064f('0x61')][_0x064f('0x12c')](db[_0x064f('0x82')],{'as':_0x064f('0x16f'),'foreignKey':_0x064f('0x15b')});db['ChatWebsite'][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':_0x064f('0x145')});db[_0x064f('0x63')]['belongsTo'](db[_0x064f('0x14a')],{});db['OpenchannelQueueReport'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x63')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x63')][_0x064f('0x12c')](db[_0x064f('0x5e')],{});db[_0x064f('0x63')][_0x064f('0x12c')](db[_0x064f('0x192')],{});db[_0x064f('0x63')][_0x064f('0x12c')](db[_0x064f('0x13')],{});db['OpenchannelQueueReport'][_0x064f('0x12c')](db[_0x064f('0x60')],{});db[_0x064f('0x64')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x199'),'foreignKey':_0x064f('0x11f'),'onDelete':_0x064f('0x17f')});db['ChatApplication'][_0x064f('0x12c')](db[_0x064f('0x6b')],{'as':_0x064f('0x19a'),'foreignKey':_0x064f('0x19b'),'onDelete':_0x064f('0x17f')});db[_0x064f('0x64')][_0x064f('0x12c')](db[_0x064f('0x61')],{'as':_0x064f('0x19c'),'foreignKey':_0x064f('0x17d'),'onDelete':_0x064f('0x17f')});db[_0x064f('0x64')][_0x064f('0x12c')](db[_0x064f('0x175')],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x18c')});db[_0x064f('0x66')][_0x064f('0x120')](db['ChatMessage'],{'as':_0x064f('0x172'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x19d')});db[_0x064f('0x66')]['belongsTo'](db['ChatWebsite'],{'as':_0x064f('0x17c'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x064f('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':_0x064f('0x164')});db[_0x064f('0x66')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':'Owner','foreignKey':_0x064f('0x11f')});db[_0x064f('0x66')][_0x064f('0x132')](db['Tag'],{'through':_0x064f('0x19e'),'as':_0x064f('0x177')});db[_0x064f('0x66')]['belongsToMany'](db['Tag'],{'through':_0x064f('0x19e'),'as':_0x064f('0x178')});db[_0x064f('0x66')][_0x064f('0x132')](db['User'],{'as':_0x064f('0x186'),'through':_0x064f('0x136'),'foreignKey':_0x064f('0x19d')});db[_0x064f('0x67')][_0x064f('0x12c')](db[_0x064f('0x13')],{'onDelete':'cascade','as':_0x064f('0x13')});db[_0x064f('0x67')][_0x064f('0x12c')](db['CmContact'],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x67')]['belongsTo'](db[_0x064f('0x66')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x17a'),'foreignKey':_0x064f('0x19d')});db[_0x064f('0x67')][_0x064f('0x12c')](db[_0x064f('0xf4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x064f('0x67')][_0x064f('0x12c')](db[_0x064f('0x61')],{'as':_0x064f('0x17c'),'foreignKey':'ChatWebsiteId'});db[_0x064f('0x69')]['hasMany'](db[_0x064f('0xf4')],{'as':_0x064f('0x179'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x064f('0x11e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db['ChatOfflineMessage'][_0x064f('0x12c')](db[_0x064f('0x61')],{'as':'Account','foreignKey':_0x064f('0x17d')});db[_0x064f('0x6b')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x064f('0x6b')][_0x064f('0x132')](db[_0x064f('0xed')],{'through':_0x064f('0x19f'),'as':_0x064f('0x171')});db[_0x064f('0x6d')][_0x064f('0x120')](db[_0x064f('0xd5')],{'as':_0x064f('0x172'),'foreignKey':_0x064f('0x1a0'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x6d')][_0x064f('0x132')](db['User'],{'as':_0x064f('0x151'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x064f('0x12c')](db[_0x064f('0x61')],{'as':_0x064f('0x19c'),'foreignKey':_0x064f('0x17d')});db[_0x064f('0x70')][_0x064f('0x120')](db[_0x064f('0x130')],{'as':_0x064f('0x1a1'),'foreignKey':'CompanyId'});db[_0x064f('0x130')][_0x064f('0x120')](db[_0x064f('0x73')],{'as':_0x064f('0x152'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x130')][_0x064f('0x120')](db[_0x064f('0x76')],{'as':_0x064f('0x123'),'foreignKey':_0x064f('0x164')});db['CmContact']['hasMany'](db[_0x064f('0x78')],{'as':_0x064f('0x154'),'foreignKey':'ContactId'});db[_0x064f('0x130')][_0x064f('0x120')](db[_0x064f('0x7a')],{'as':_0x064f('0x7a'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x130')]['hasMany'](db[_0x064f('0xda')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x064f('0x130')]['hasMany'](db[_0x064f('0x5e')],{'as':_0x064f('0x125'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x064f('0x120')](db[_0x064f('0x66')],{'as':_0x064f('0x126'),'foreignKey':_0x064f('0x164'),'onDelete':_0x064f('0x17f')});db['CmContact']['hasMany'](db[_0x064f('0x57')],{'as':_0x064f('0x127'),'foreignKey':_0x064f('0x164'),'onDelete':_0x064f('0x17f')});db['CmContact'][_0x064f('0x120')](db[_0x064f('0x4c')],{'as':_0x064f('0x137'),'foreignKey':_0x064f('0x164'),'onDelete':'restrict'});db['CmContact'][_0x064f('0x120')](db[_0x064f('0x40')],{'as':'MailInteractions','foreignKey':_0x064f('0x164'),'onDelete':_0x064f('0x17f')});db['CmContact'][_0x064f('0x12c')](db['CmCompany'],{'as':'Company','foreignKey':_0x064f('0x1a2')});db[_0x064f('0x130')][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x130')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x186'),'through':_0x064f('0x131')});db[_0x064f('0x130')][_0x064f('0x132')](db[_0x064f('0x175')],{'as':_0x064f('0x177'),'through':_0x064f('0x1a3')});db[_0x064f('0x130')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x1a3'),'as':_0x064f('0x178')});db[_0x064f('0x73')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':'Contact','foreignKey':_0x064f('0x164'),'onDelete':_0x064f('0x11e')});db['CmHopper'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x73')][_0x064f('0x12c')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x064f('0x73')][_0x064f('0x12c')](db[_0x064f('0x1c')],{'as':_0x064f('0x19a'),'foreignKey':_0x064f('0x153'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x73')]['belongsTo'](db[_0x064f('0xf1')],{'as':_0x064f('0xf1'),'foreignKey':_0x064f('0x1a4'),'onDelete':'cascade'});db[_0x064f('0x73')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':_0x064f('0x174'),'foreignKey':_0x064f('0x1a5')});db[_0x064f('0x74')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x74')][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':'ListId','onDelete':_0x064f('0x11e')});db['CmHopperBlack'][_0x064f('0x12c')](db['VoiceQueue'],{'as':_0x064f('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0x064f('0x11e')});db[_0x064f('0x74')][_0x064f('0x12c')](db[_0x064f('0xf1')],{'as':_0x064f('0xf1'),'foreignKey':'CampaignId','onDelete':_0x064f('0x11e')});db[_0x064f('0x1a6')][_0x064f('0x120')](db[_0x064f('0x81')],{'as':{'plural':_0x064f('0x1a7'),'singular':_0x064f('0x1a8')},'foreignKey':'AutomationAllId','onDelete':_0x064f('0x11e'),'hooks':!![]});db[_0x064f('0x1a6')][_0x064f('0x120')](db[_0x064f('0x81')],{'as':{'plural':_0x064f('0x1a9'),'singular':_0x064f('0x1aa')},'foreignKey':_0x064f('0x1ab'),'onDelete':_0x064f('0x11e'),'hooks':!![]});db[_0x064f('0x1a6')][_0x064f('0x120')](db['Action'],{'as':_0x064f('0x1ac'),'foreignKey':_0x064f('0x1ad'),'onDelete':_0x064f('0x11e'),'hooks':!![]});db[_0x064f('0x183')][_0x064f('0x120')](db['Disposition'],{'as':_0x064f('0x169'),'foreignKey':'ParentId','onDelete':_0x064f('0x11e')});db[_0x064f('0x15a')][_0x064f('0x120')](db[_0x064f('0x15a')],{'as':_0x064f('0x1ae'),'foreignKey':_0x064f('0x180'),'onDelete':_0x064f('0x11e'),'hooks':!![],'required':![]});db[_0x064f('0x15a')][_0x064f('0x120')](db[_0x064f('0x18')],{'as':_0x064f('0x122'),'foreignKey':_0x064f('0x180'),'onDelete':_0x064f('0x17f')});db[_0x064f('0x15a')]['hasMany'](db[_0x064f('0x44')],{'as':'MailApplications','foreignKey':_0x064f('0x180')});db['Interval'][_0x064f('0x120')](db[_0x064f('0x64')],{'as':_0x064f('0x1af'),'foreignKey':_0x064f('0x180')});db['Interval'][_0x064f('0x120')](db['FaxApplication'],{'as':_0x064f('0x1b0'),'foreignKey':_0x064f('0x180')});db[_0x064f('0x15a')][_0x064f('0x120')](db[_0x064f('0x55')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x064f('0x88')][_0x064f('0x12c')](db[_0x064f('0x165')],{});db['Schedule'][_0x064f('0x12c')](db['AnalyticDefaultReport'],{'foreignKey':_0x064f('0x1b1')});db[_0x064f('0x88')][_0x064f('0x12c')](db[_0x064f('0x1b2')],{'foreignKey':_0x064f('0x1b3')});db[_0x064f('0x8a')][_0x064f('0x132')](db['VoiceMusicOnHold'],{'as':_0x064f('0x1b4'),'through':_0x064f('0x150'),'onDelete':_0x064f('0x17f')});db['Tag'][_0x064f('0x132')](db[_0x064f('0x130')],{'through':_0x064f('0x1a3')});db[_0x064f('0x175')][_0x064f('0x132')](db[_0x064f('0x66')],{'through':_0x064f('0x19e')});db[_0x064f('0x175')][_0x064f('0x132')](db[_0x064f('0x40')],{'through':_0x064f('0x176')});db[_0x064f('0x175')][_0x064f('0x132')](db[_0x064f('0x57')],{'through':_0x064f('0x18e')});db[_0x064f('0x175')][_0x064f('0x132')](db[_0x064f('0x4c')],{'through':_0x064f('0x185')});db[_0x064f('0x175')][_0x064f('0x132')](db[_0x064f('0x5e')],{'through':_0x064f('0x196')});db['Tag'][_0x064f('0x132')](db[_0x064f('0x10e')],{'through':_0x064f('0x1b5')});db[_0x064f('0x8e')][_0x064f('0x120')](db[_0x064f('0x81')],{'as':{'plural':_0x064f('0x1b6'),'singular':_0x064f('0x1b7')},'foreignKey':_0x064f('0x1b8'),'onDelete':'cascade','hooks':!![]});db[_0x064f('0x8e')][_0x064f('0x120')](db[_0x064f('0x81')],{'as':{'plural':_0x064f('0x1b9'),'singular':_0x064f('0x1ba')},'foreignKey':_0x064f('0x1bb'),'onDelete':_0x064f('0x11e'),'hooks':!![]});db[_0x064f('0x8e')][_0x064f('0x120')](db[_0x064f('0x7c')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x064f('0x11e'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x064f('0x1bc'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1b3'),'hooks':!![]});db[_0x064f('0x97')][_0x064f('0x120')](db[_0x064f('0x9c')],{'as':_0x064f('0x1bc'),'onDelete':_0x064f('0x11e'),'foreignKey':'DefaultReportId'});db[_0x064f('0x1bd')][_0x064f('0x120')](db[_0x064f('0x9c')],{'as':_0x064f('0x1bc'),'onDelete':'cascade','foreignKey':_0x064f('0x1be')});db[_0x064f('0x9c')][_0x064f('0x12c')](db[_0x064f('0x1bd')],{'foreignKey':_0x064f('0x1be')});db['SalesforceAccount']['hasMany'](db[_0x064f('0xa1')],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db['SalesforceConfiguration'][_0x064f('0x120')](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xa1')][_0x064f('0x120')](db['SalesforceField'],{'as':'Fields','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c2')});db['SalesforceConfiguration'][_0x064f('0x12c')](db[_0x064f('0x9f')],{'as':_0x064f('0x17c'),'foreignKey':'AccountId'});db[_0x064f('0x1c3')][_0x064f('0x120')](db['SalesforceField'],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0x1c3')][_0x064f('0x120')](db['SalesforceField'],{'as':_0x064f('0x1c6'),'foreignKey':'DescriptionId'});db[_0x064f('0x1c3')][_0x064f('0x120')](db[_0x064f('0x1c3')],{'as':'Field','foreignKey':_0x064f('0x1c2')});db[_0x064f('0x1c3')][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db[_0x064f('0x1c8')][_0x064f('0x120')](db[_0x064f('0xa5')],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xa5')]['hasMany'](db[_0x064f('0x1c9')],{'as':_0x064f('0x1ca'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xa5')][_0x064f('0x120')](db[_0x064f('0x1c9')],{'as':_0x064f('0x1cb'),'onDelete':_0x064f('0x11e'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x064f('0x120')](db[_0x064f('0x1c9')],{'as':_0x064f('0x1bc'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0xa5')][_0x064f('0x12c')](db['SugarcrmAccount'],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0x1c9')]['hasMany'](db[_0x064f('0x1c9')],{'as':'Subject','foreignKey':_0x064f('0x1c5')});db[_0x064f('0x1c9')][_0x064f('0x120')](db['SugarcrmField'],{'as':_0x064f('0x1c6'),'foreignKey':'DescriptionId'});db['SugarcrmField']['hasMany'](db[_0x064f('0x1c9')],{'as':'Field','foreignKey':_0x064f('0x1c2')});db[_0x064f('0x1c9')][_0x064f('0x12c')](db['Variable'],{'as':'Variable','foreignKey':_0x064f('0x1c7')});db[_0x064f('0xa8')][_0x064f('0x120')](db[_0x064f('0xaa')],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':'AccountId'});db[_0x064f('0xaa')][_0x064f('0x120')](db[_0x064f('0xac')],{'as':_0x064f('0x1ca'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xaa')][_0x064f('0x120')](db[_0x064f('0xac')],{'as':_0x064f('0x1cb'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xaa')][_0x064f('0x120')](db[_0x064f('0xac')],{'as':_0x064f('0x1bc'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x064f('0xaa')]['belongsTo'](db[_0x064f('0xa8')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db['DeskConfiguration']['belongsToMany'](db[_0x064f('0x175')],{'through':'int_desk_configuration_has_tags'});db[_0x064f('0xac')][_0x064f('0x120')](db[_0x064f('0xac')],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db['DeskField']['hasMany'](db[_0x064f('0xac')],{'as':_0x064f('0x1c6'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xac')][_0x064f('0x120')](db[_0x064f('0xac')],{'as':_0x064f('0x1cc'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0xac')][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':'VariableId'});db[_0x064f('0xae')]['hasMany'](db[_0x064f('0xaf')],{'as':'Configurations','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xaf')][_0x064f('0x120')](db[_0x064f('0xb1')],{'as':_0x064f('0x1ca'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xaf')][_0x064f('0x120')](db[_0x064f('0xb1')],{'as':_0x064f('0x1cb'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c1')});db['ZohoConfiguration']['hasMany'](db[_0x064f('0xb1')],{'as':_0x064f('0x1bc'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0xaf')][_0x064f('0x12c')](db[_0x064f('0xae')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db['ZohoField'][_0x064f('0x120')](db[_0x064f('0xb1')],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db['ZohoField'][_0x064f('0x120')](db[_0x064f('0xb1')],{'as':_0x064f('0x1c6'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xb1')][_0x064f('0x120')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db['ZohoField'][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':'VariableId'});db[_0x064f('0xb3')][_0x064f('0x120')](db[_0x064f('0xb5')],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xb5')][_0x064f('0x120')](db[_0x064f('0xb6')],{'as':_0x064f('0x1ca'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xb5')]['hasMany'](db[_0x064f('0xb6')],{'as':_0x064f('0x1cb'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xb5')]['hasMany'](db[_0x064f('0xb6')],{'as':_0x064f('0x1bc'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x064f('0x12c')](db['ZendeskAccount'],{'as':_0x064f('0x17c'),'foreignKey':'AccountId'});db[_0x064f('0xb5')]['belongsToMany'](db['Tag'],{'through':_0x064f('0x1cd')});db[_0x064f('0xb6')][_0x064f('0x120')](db[_0x064f('0xb6')],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db['ZendeskField'][_0x064f('0x120')](db['ZendeskField'],{'as':_0x064f('0x1c6'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xb6')]['hasMany'](db[_0x064f('0xb6')],{'as':_0x064f('0x1cc'),'foreignKey':_0x064f('0x1c2')});db['ZendeskField'][_0x064f('0x12c')](db['Variable'],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db['FreshdeskAccount'][_0x064f('0x120')](db[_0x064f('0xb9')],{'as':_0x064f('0x1bf'),'onDelete':'cascade','foreignKey':_0x064f('0x1c0')});db[_0x064f('0xb9')][_0x064f('0x120')](db[_0x064f('0xbb')],{'as':_0x064f('0x1ca'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x064f('0xb9')][_0x064f('0x120')](db['FreshdeskField'],{'as':_0x064f('0x1cb'),'onDelete':'cascade','foreignKey':_0x064f('0x1c1')});db[_0x064f('0xb9')]['hasMany'](db['FreshdeskField'],{'as':_0x064f('0x1bc'),'onDelete':'cascade','foreignKey':_0x064f('0x1c2')});db[_0x064f('0xb9')][_0x064f('0x12c')](db[_0x064f('0xb7')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xb9')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x1ce')});db[_0x064f('0xbb')]['hasMany'](db[_0x064f('0xbb')],{'as':_0x064f('0x1c4'),'foreignKey':'SubjectId'});db[_0x064f('0xbb')][_0x064f('0x120')](db[_0x064f('0xbb')],{'as':_0x064f('0x1c6'),'foreignKey':'DescriptionId'});db[_0x064f('0xbb')]['hasMany'](db[_0x064f('0xbb')],{'as':_0x064f('0x1cc'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0xbb')][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db['VtigerAccount'][_0x064f('0x120')](db['VtigerConfiguration'],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xbf')][_0x064f('0x120')](db[_0x064f('0xc0')],{'as':'Subjects','foreignKey':_0x064f('0x1c5')});db[_0x064f('0xbf')]['hasMany'](db[_0x064f('0xc0')],{'as':_0x064f('0x1cb'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xbf')]['hasMany'](db['VtigerField'],{'as':_0x064f('0x1bc'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0xbf')][_0x064f('0x12c')](db['VtigerAccount'],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xc0')][_0x064f('0x120')](db[_0x064f('0xc0')],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xc0')]['hasMany'](db[_0x064f('0xc0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x064f('0xc0')][_0x064f('0x120')](db[_0x064f('0xc0')],{'as':'Field','foreignKey':_0x064f('0x1c2')});db[_0x064f('0xc0')]['belongsTo'](db['Variable'],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db[_0x064f('0xc2')][_0x064f('0x120')](db[_0x064f('0xc4')],{'as':_0x064f('0x1bf'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xc4')]['hasMany'](db[_0x064f('0xc6')],{'as':_0x064f('0x1ca'),'foreignKey':'SubjectId'});db[_0x064f('0xc4')][_0x064f('0x120')](db[_0x064f('0xc6')],{'as':_0x064f('0x1cb'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xc4')][_0x064f('0x120')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x064f('0x1c2')});db[_0x064f('0xc4')]['belongsTo'](db[_0x064f('0xc2')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xc6')][_0x064f('0x120')](db[_0x064f('0xc6')],{'as':_0x064f('0x1c4'),'foreignKey':'SubjectId'});db[_0x064f('0xc6')]['hasMany'](db[_0x064f('0xc6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x064f('0xc6')][_0x064f('0x120')](db['ServicenowField'],{'as':'Field','foreignKey':_0x064f('0x1c2')});db[_0x064f('0xc6')][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db['Dynamics365Account'][_0x064f('0x120')](db[_0x064f('0xc9')],{'as':_0x064f('0x1bf'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x064f('0xc9')][_0x064f('0x120')](db[_0x064f('0x1cf')],{'as':'Subjects','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xc9')]['hasMany'](db[_0x064f('0x1cf')],{'as':_0x064f('0x1cb'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xc9')][_0x064f('0x120')](db[_0x064f('0x1cf')],{'as':_0x064f('0x1bc'),'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c2')});db['Dynamics365Configuration'][_0x064f('0x12c')](db[_0x064f('0x1d0')],{'as':_0x064f('0x17c'),'foreignKey':'AccountId'});db[_0x064f('0x1cf')][_0x064f('0x120')](db[_0x064f('0x1cf')],{'as':'Subject','foreignKey':_0x064f('0x1c5')});db[_0x064f('0x1cf')][_0x064f('0x120')](db[_0x064f('0x1cf')],{'as':_0x064f('0x1c6'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0x1cf')][_0x064f('0x120')](db[_0x064f('0x1cf')],{'as':_0x064f('0x1cc'),'foreignKey':_0x064f('0x1c2')});db[_0x064f('0x1cf')][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':_0x064f('0x90'),'foreignKey':_0x064f('0x1c7')});db['FreshsalesAccount'][_0x064f('0x120')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1c0')});db['FreshsalesConfiguration']['hasMany'](db[_0x064f('0xd0')],{'as':_0x064f('0x1ca'),'foreignKey':'SubjectId'});db[_0x064f('0xce')][_0x064f('0x120')](db[_0x064f('0xd0')],{'as':_0x064f('0x1cb'),'foreignKey':_0x064f('0x1c1')});db[_0x064f('0xce')][_0x064f('0x120')](db[_0x064f('0xd0')],{'as':'Fields','foreignKey':_0x064f('0x1c2')});db['FreshsalesConfiguration'][_0x064f('0x12c')](db[_0x064f('0xcc')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1c0')});db[_0x064f('0xd0')][_0x064f('0x120')](db[_0x064f('0xd0')],{'as':_0x064f('0x1c4'),'foreignKey':_0x064f('0x1c5')});db[_0x064f('0xd0')][_0x064f('0x120')](db[_0x064f('0xd0')],{'as':_0x064f('0x1c6'),'foreignKey':_0x064f('0x1c1')});db['FreshsalesField'][_0x064f('0x120')](db[_0x064f('0xd0')],{'as':'Field','foreignKey':_0x064f('0x1c2')});db['FreshsalesField'][_0x064f('0x12c')](db[_0x064f('0x90')],{'as':'Variable','foreignKey':_0x064f('0x1c7')});db[_0x064f('0xd4')][_0x064f('0x12c')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db['ChatQueueReport']['belongsTo'](db['CmContact'],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db['ChatQueueReport']['belongsTo'](db['ChatInteraction'],{});db[_0x064f('0xd4')][_0x064f('0x12c')](db[_0x064f('0x67')],{});db[_0x064f('0xd4')][_0x064f('0x12c')](db[_0x064f('0x13')],{});db[_0x064f('0xd4')][_0x064f('0x12c')](db[_0x064f('0x6b')],{});db['ChatInternalMessage'][_0x064f('0x12c')](db['User'],{'onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1d1')});db[_0x064f('0xd5')][_0x064f('0x12c')](db[_0x064f('0x13')],{'onDelete':'cascade','foreignKey':_0x064f('0x1d2')});db[_0x064f('0xda')][_0x064f('0x120')](db[_0x064f('0xd8')],{'foreignKey':_0x064f('0x1d3'),'onDelete':_0x064f('0x11e')});db[_0x064f('0xda')][_0x064f('0x120')](db[_0x064f('0xd7')],{'foreignKey':_0x064f('0x1d3'),'onDelete':_0x064f('0x11e')});db['SmsQueueReport'][_0x064f('0x12c')](db[_0x064f('0x54')],{});db['SmsQueueReport'][_0x064f('0x12c')](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':_0x064f('0x181')});db['SmsQueueReport']['belongsTo'](db['CmContact'],{'as':_0x064f('0x173'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0x064f('0x12c')](db[_0x064f('0x57')],{});db['SmsQueueReport']['belongsTo'](db[_0x064f('0x58')],{});db[_0x064f('0xdc')]['belongsTo'](db[_0x064f('0x13')],{});db[_0x064f('0xdc')]['belongsTo'](db[_0x064f('0x5a')],{});db[_0x064f('0xe1')][_0x064f('0x120')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x064f('0xe1')][_0x064f('0x120')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x064f('0xe1')][_0x064f('0x120')](db[_0x064f('0xd7')],{'foreignKey':_0x064f('0x1d4')});db['SquareProject']['belongsToMany'](db[_0x064f('0x13')],{'as':_0x064f('0x186'),'through':_0x064f('0x1d5')});db['Team'][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':'user_has_teams'});db[_0x064f('0xed')][_0x064f('0x132')](db[_0x064f('0x1c')],{'through':_0x064f('0x119'),'as':_0x064f('0x1d6')});db['Team'][_0x064f('0x132')](db[_0x064f('0x3d')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x064f('0xed')]['belongsToMany'](db['ChatQueue'],{'through':_0x064f('0x19f'),'as':'ChatQueues'});db[_0x064f('0xed')][_0x064f('0x132')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x064f('0x140')});db[_0x064f('0xed')][_0x064f('0x132')](db[_0x064f('0x5a')],{'through':_0x064f('0x190'),'as':_0x064f('0x1d7')});db['Team']['belongsToMany'](db[_0x064f('0x60')],{'through':_0x064f('0x197'),'as':_0x064f('0x141')});db[_0x064f('0xed')][_0x064f('0x132')](db[_0x064f('0x115')],{'through':'team_has_whatsapp_queues','as':_0x064f('0x142')});db[_0x064f('0xed')][_0x064f('0x132')](db['VoicePrefix'],{'through':_0x064f('0x11a'),'as':_0x064f('0x13b')});db[_0x064f('0xf1')][_0x064f('0x120')](db[_0x064f('0x73')],{'as':_0x064f('0x152'),'foreignKey':_0x064f('0x1a4')});db[_0x064f('0xf1')]['hasMany'](db[_0x064f('0x76')],{'as':_0x064f('0x123'),'foreignKey':_0x064f('0x1a4')});db[_0x064f('0xf1')][_0x064f('0x120')](db[_0x064f('0x78')],{'as':'HopperHistories','foreignKey':_0x064f('0x1a4')});db['Campaign']['hasMany'](db[_0x064f('0x74')],{'as':_0x064f('0x155'),'foreignKey':_0x064f('0x1a4')});db[_0x064f('0xf1')][_0x064f('0x12c')](db[_0x064f('0x157')],{'as':'Trunk','foreignKey':_0x064f('0x1d8')});db[_0x064f('0xf1')][_0x064f('0x12c')](db[_0x064f('0x157')],{'as':_0x064f('0x158'),'foreignKey':_0x064f('0x159')});db['Campaign'][_0x064f('0x12c')](db[_0x064f('0x15a')],{'as':_0x064f('0x15a'),'foreignKey':'IntervalId'});db['Campaign'][_0x064f('0x12c')](db['SquareProject'],{'as':_0x064f('0xe7'),'foreignKey':_0x064f('0x1d9')});db[_0x064f('0xf1')][_0x064f('0x132')](db[_0x064f('0x100')],{'as':_0x064f('0x133'),'through':_0x064f('0x1da')});db[_0x064f('0xf1')]['belongsToMany'](db['CmList'],{'as':_0x064f('0x15c'),'through':_0x064f('0x1db')});db['Attachment'][_0x064f('0x12c')](db['ChatOfflineMessage'],{'as':_0x064f('0x69'),'foreignKey':_0x064f('0x17e')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db[_0x064f('0xf8')][_0x064f('0x12c')](db[_0x064f('0x40')],{});db[_0x064f('0xf8')][_0x064f('0x12c')](db['MailAccount'],{'foreignKey':_0x064f('0x1dc'),'as':_0x064f('0x1dd')});db[_0x064f('0xf8')][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1de'),'as':_0x064f('0x1df')});db[_0x064f('0xf8')]['belongsTo'](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1e0'),'as':_0x064f('0x1e1')});db[_0x064f('0xf8')][_0x064f('0x12c')](db[_0x064f('0x3d')],{'foreignKey':_0x064f('0x1e2'),'as':_0x064f('0x1e3')});db[_0x064f('0xf8')][_0x064f('0x12c')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x064f('0x1e4')});db['ChatTransferReport'][_0x064f('0x12c')](db['ChatMessage'],{});db[_0x064f('0x1e5')][_0x064f('0x12c')](db[_0x064f('0x66')],{});db['ChatTransferReport'][_0x064f('0x12c')](db[_0x064f('0x61')],{'foreignKey':_0x064f('0x1e6'),'as':'FromAccount'});db[_0x064f('0x1e5')]['belongsTo'](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1de'),'as':_0x064f('0x1df')});db[_0x064f('0x1e5')][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1e0'),'as':'ToAgent'});db[_0x064f('0x1e5')][_0x064f('0x12c')](db[_0x064f('0x6b')],{'foreignKey':'ToChatQueueId','as':_0x064f('0x1e3')});db[_0x064f('0x1e5')][_0x064f('0x12c')](db[_0x064f('0x61')],{'foreignKey':_0x064f('0x1e7'),'as':_0x064f('0x1e4')});db[_0x064f('0xfb')]['belongsTo'](db['FaxMessage'],{});db[_0x064f('0xfb')][_0x064f('0x12c')](db[_0x064f('0x4c')],{});db[_0x064f('0xfb')]['belongsTo'](db[_0x064f('0x49')],{'foreignKey':'FromFaxAccountId','as':_0x064f('0x1dd')});db[_0x064f('0xfb')][_0x064f('0x12c')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['FaxTransferReport'][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1e0'),'as':_0x064f('0x1e1')});db[_0x064f('0xfb')]['belongsTo'](db[_0x064f('0x50')],{'foreignKey':_0x064f('0x1e8'),'as':_0x064f('0x1e3')});db[_0x064f('0xfb')][_0x064f('0x12c')](db[_0x064f('0x49')],{'foreignKey':_0x064f('0x1e9'),'as':_0x064f('0x1e4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x064f('0x192')],{});db[_0x064f('0x1ea')][_0x064f('0x12c')](db[_0x064f('0x5e')],{});db[_0x064f('0x1ea')]['belongsTo'](db[_0x064f('0x14a')],{'foreignKey':_0x064f('0x1eb'),'as':_0x064f('0x1dd')});db['OpenchannelTransferReport']['belongsTo'](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1de'),'as':'FromAgent'});db[_0x064f('0x1ea')][_0x064f('0x12c')](db['User'],{'foreignKey':_0x064f('0x1e0'),'as':_0x064f('0x1e1')});db[_0x064f('0x1ea')][_0x064f('0x12c')](db[_0x064f('0x60')],{'foreignKey':_0x064f('0x1ec'),'as':_0x064f('0x1e3')});db['OpenchannelTransferReport'][_0x064f('0x12c')](db[_0x064f('0x14a')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x064f('0xfe')]['belongsTo'](db[_0x064f('0x58')],{});db[_0x064f('0xfe')][_0x064f('0x12c')](db['SmsInteraction'],{});db[_0x064f('0xfe')][_0x064f('0x12c')](db[_0x064f('0x54')],{'foreignKey':_0x064f('0x1ed'),'as':_0x064f('0x1dd')});db[_0x064f('0xfe')][_0x064f('0x12c')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x064f('0xfe')][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1e0'),'as':_0x064f('0x1e1')});db['SmsTransferReport'][_0x064f('0x12c')](db[_0x064f('0x5a')],{'foreignKey':_0x064f('0x1ee'),'as':_0x064f('0x1e3')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x064f('0x1ef'),'as':_0x064f('0x1e4')});db[_0x064f('0x100')][_0x064f('0x120')](db[_0x064f('0x183')],{'as':'Dispositions','foreignKey':_0x064f('0x181'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x100')][_0x064f('0x120')](db['CmCustomField'],{'as':_0x064f('0x1f0'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x100')][_0x064f('0x120')](db[_0x064f('0x130')],{'as':'Contacts','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x100')][_0x064f('0x120')](db[_0x064f('0x76')],{'as':_0x064f('0x123'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x064f('0x78')],{'as':_0x064f('0x124'),'foreignKey':_0x064f('0x181')});db[_0x064f('0x100')]['hasMany'](db[_0x064f('0x7a')],{'as':_0x064f('0x7a'),'foreignKey':'ListId'});db[_0x064f('0x100')][_0x064f('0x132')](db[_0x064f('0x1c')],{'as':_0x064f('0x1f1'),'through':_0x064f('0x1f2')});db[_0x064f('0x100')][_0x064f('0x132')](db['User'],{'as':_0x064f('0x188'),'through':_0x064f('0x1f3')});db['VoicePrefix']['hasMany'](db[_0x064f('0x18')],{'as':_0x064f('0x122'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x102')]['belongsToMany'](db['User'],{'as':_0x064f('0x188'),'through':_0x064f('0x13c')});db[_0x064f('0x102')]['belongsToMany'](db[_0x064f('0xed')],{'through':_0x064f('0x11a'),'as':_0x064f('0x171')});db['UserProfile'][_0x064f('0x120')](db['User'],{'as':'Users','foreignKey':_0x064f('0x12d')});db[_0x064f('0x104')][_0x064f('0x120')](db[_0x064f('0x106')],{'as':_0x064f('0x1f4'),'foreignKey':_0x064f('0x12d'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x106')][_0x064f('0x120')](db[_0x064f('0x107')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x064f('0x11e')});db[_0x064f('0x10a')]['hasMany'](db[_0x064f('0x183')],{'as':_0x064f('0x169'),'foreignKey':_0x064f('0x1f5'),'onDelete':_0x064f('0x11e')});db[_0x064f('0x10a')][_0x064f('0x120')](db[_0x064f('0x7e')],{'as':'Answers','foreignKey':_0x064f('0x1f5')});db[_0x064f('0x10a')]['hasMany'](db[_0x064f('0x110')],{'as':'Messages','foreignKey':_0x064f('0x1f5')});db[_0x064f('0x10a')][_0x064f('0x120')](db['WhatsappInteraction'],{'as':_0x064f('0x16b')});db[_0x064f('0x10a')][_0x064f('0x120')](db[_0x064f('0x10c')],{'as':_0x064f('0x16c')});db[_0x064f('0x10a')]['belongsTo'](db[_0x064f('0x100')],{'as':_0x064f('0x16d'),'foreignKey':'ListId'});db['WhatsappAccount']['belongsTo'](db[_0x064f('0x82')],{'as':_0x064f('0x16f'),'foreignKey':_0x064f('0x15b')});db[_0x064f('0x10a')]['belongsToMany'](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':'user_has_whatsapp_accounts'});db[_0x064f('0x10c')]['belongsTo'](db[_0x064f('0x13')],{'onDelete':_0x064f('0x17f')});db[_0x064f('0x10c')]['belongsTo'](db['WhatsappQueue'],{'onDelete':'restrict'});db['WhatsappApplication'][_0x064f('0x12c')](db[_0x064f('0x10a')],{'onDelete':'restrict'});db[_0x064f('0x10c')]['belongsTo'](db[_0x064f('0x15a')],{'onDelete':_0x064f('0x17f'),'foreignKey':'IntervalId'});db[_0x064f('0x10c')][_0x064f('0x12c')](db[_0x064f('0x175')],{'onDelete':_0x064f('0x17f'),'foreignKey':_0x064f('0x18c')});db['WhatsappInteraction'][_0x064f('0x120')](db[_0x064f('0x110')],{'as':'Messages','onDelete':_0x064f('0x11e'),'foreignKey':_0x064f('0x1f6')});db[_0x064f('0x10e')][_0x064f('0x12c')](db[_0x064f('0x10a')],{'as':_0x064f('0x17c'),'foreignKey':_0x064f('0x1f5')});db[_0x064f('0x10e')][_0x064f('0x12c')](db[_0x064f('0x130')],{'as':_0x064f('0x173'),'foreignKey':_0x064f('0x164')});db[_0x064f('0x10e')][_0x064f('0x12c')](db[_0x064f('0x13')],{'as':'Owner','foreignKey':_0x064f('0x11f')});db[_0x064f('0x10e')][_0x064f('0x132')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x064f('0x177')});db[_0x064f('0x10e')][_0x064f('0x132')](db[_0x064f('0x175')],{'through':_0x064f('0x1b5'),'as':_0x064f('0x178')});db['WhatsappInteraction'][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x186'),'through':'user_has_whatsapp_interactions','foreignKey':_0x064f('0x1f6')});db['WhatsappMessage']['belongsTo'](db['User'],{'as':'User'});db[_0x064f('0x110')]['belongsTo'](db[_0x064f('0x130')],{'onDelete':_0x064f('0x11e'),'as':_0x064f('0x173')});db[_0x064f('0x110')][_0x064f('0x12c')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x064f('0x17a'),'foreignKey':_0x064f('0x1f6')});db[_0x064f('0x110')][_0x064f('0x12c')](db[_0x064f('0x10a')],{'as':'Account','foreignKey':_0x064f('0x1f5')});db['WhatsappQueueReport'][_0x064f('0x12c')](db[_0x064f('0x10a')],{});db['WhatsappQueueReport'][_0x064f('0x12c')](db['CmList'],{'as':'List','foreignKey':_0x064f('0x181')});db[_0x064f('0x112')][_0x064f('0x12c')](db['CmContact'],{'as':_0x064f('0x173'),'foreignKey':'ContactId'});db[_0x064f('0x112')][_0x064f('0x12c')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x064f('0x12c')](db['WhatsappQueue'],{});db[_0x064f('0x112')][_0x064f('0x12c')](db[_0x064f('0x110')],{});db['WhatsappQueueReport'][_0x064f('0x12c')](db['User'],{});db['WhatsappTransferReport'][_0x064f('0x12c')](db[_0x064f('0x110')],{});db[_0x064f('0x113')]['belongsTo'](db[_0x064f('0x10e')],{});db[_0x064f('0x113')][_0x064f('0x12c')](db[_0x064f('0x10a')],{'foreignKey':_0x064f('0x1f7'),'as':_0x064f('0x1dd')});db['WhatsappTransferReport'][_0x064f('0x12c')](db[_0x064f('0x10a')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x064f('0x113')][_0x064f('0x12c')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x064f('0x1e3')});db['WhatsappTransferReport'][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1de'),'as':_0x064f('0x1df')});db[_0x064f('0x113')][_0x064f('0x12c')](db[_0x064f('0x13')],{'foreignKey':_0x064f('0x1e0'),'as':'ToAgent'});db[_0x064f('0x115')][_0x064f('0x132')](db[_0x064f('0x13')],{'as':_0x064f('0x188'),'through':_0x064f('0x143'),'foreignKey':_0x064f('0x1f8')});db[_0x064f('0x115')][_0x064f('0x132')](db[_0x064f('0xed')],{'through':'team_has_whatsapp_queues','as':'Teams'});module[_0x064f('0x1f9')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x2bc2=['UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','cascade','UserId','User','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','UserNotifications','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','ChatWebsites','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','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailServerIn','hasOne','Smtp','Dispositions','MailAccountId','Answers','Interactions','List','ListId','Pause','team_has_mail_queues','Account','Owner','Tag','mail_interaction_has_tags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Items','FaxAccountId','FaxMessage','fax_interaction_has_tags','Tags','ThroughTags','FaxInteractionId','AttachmentId','FaxQueue','team_has_fax_queues','Teams','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','IntervalId','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Sound','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','CustomReportId','Fields','MetricId','Configurations','Subjects','SubjectId','SalesforceField','Descriptions','AccountId','Description','DescriptionId','Field','FieldId','VariableId','SugarcrmAccount','SugarcrmConfiguration','DeskConfiguration','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Account','FreshsalesField','ToId','SessionId','SmsQueueReport','ProjectId','ChatQueues','team_has_whatsapp_queues','WhatsappQueues','CampaignId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromAccount','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','../config/environment','lodash','jstz','sequelize','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','database','username','options','password','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../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/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','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','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','CannedAnswer','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../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','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model'];(function(_0x34fdc0,_0x4a2296){var _0x1295d3=function(_0x3e17b0){while(--_0x3e17b0){_0x34fdc0['push'](_0x34fdc0['shift']());}};_0x1295d3(++_0x4a2296);}(_0x2bc2,0x108));var _0x22bc=function(_0x2ceb47,_0x5c6f60){_0x2ceb47=_0x2ceb47-0x0;var _0x4a77b0=_0x2bc2[_0x2ceb47];return _0x4a77b0;};'use strict';var config=require(_0x22bc('0x0'));var Sequelize=require('sequelize');var _=require(_0x22bc('0x1'));var jstz=require(_0x22bc('0x2'));var timezone=jstz['determine']();config[_0x22bc('0x3')]=_['defaultsDeep'](config[_0x22bc('0x3')],{'database':'motion2','username':'xcall','password':_0x22bc('0x4'),'options':{'host':_0x22bc('0x5'),'port':0xcea,'dialect':_0x22bc('0x6'),'dialectOptions':{'charset':_0x22bc('0x7')},'logging':![],'timezone':timezone[_0x22bc('0x8')](),'define':{'charset':_0x22bc('0x9'),'collate':_0x22bc('0xa')}}});config[_0x22bc('0xb')]=_[_0x22bc('0xc')](config[_0x22bc('0xb')],{'database':_0x22bc('0xd'),'username':'xcall','password':_0x22bc('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x22bc('0x7')},'logging':![],'timezone':timezone[_0x22bc('0x8')](),'define':{'charset':_0x22bc('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x22bc('0xe')],config[_0x22bc('0x3')][_0x22bc('0xf')],config[_0x22bc('0x3')]['password'],config['sequelize'][_0x22bc('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x22bc('0xb')][_0x22bc('0xe')],config[_0x22bc('0xb')][_0x22bc('0xf')],config[_0x22bc('0xb')][_0x22bc('0x11')],config['sequelizeHistory']['options'])};db['User']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/user/user.model');db[_0x22bc('0x13')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x14'));db[_0x22bc('0x15')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x16'));db[_0x22bc('0x17')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x22bc('0x18')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x19'));db[_0x22bc('0x1a')]=db['sequelize'][_0x22bc('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0x22bc('0x1b')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x22bc('0x1c')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x1d'));db[_0x22bc('0x1e')]=db['sequelize']['import']('../api/voiceMail/voiceMail.model');db[_0x22bc('0x1f')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x20'));db['VoiceCallReport']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize']['import'](_0x22bc('0x21'));db['VoiceAgentReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x22'));db[_0x22bc('0x23')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x24'));db[_0x22bc('0x25')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x26'));db[_0x22bc('0x27')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x28'));db[_0x22bc('0x29')]=db[_0x22bc('0x3')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x22bc('0x2a')]=db['sequelize'][_0x22bc('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x22bc('0x2b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x2c'));db[_0x22bc('0x2d')]=db['sequelize'][_0x22bc('0x12')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x22bc('0x2e')]=db['sequelize']['import'](_0x22bc('0x2f'));db[_0x22bc('0x30')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x31'));db['UserOpenchannelQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x32'));db[_0x22bc('0x33')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x34'));db['MailServerIn']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x35'));db[_0x22bc('0x36')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x37'));db[_0x22bc('0x38')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x39'));db[_0x22bc('0x3a')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x3b'));db[_0x22bc('0x3c')]=db['sequelize']['import'](_0x22bc('0x3d'));db[_0x22bc('0x3e')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x3f'));db[_0x22bc('0x40')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x41'));db[_0x22bc('0x42')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x43'));db['MailQueueReport']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x44'));db[_0x22bc('0x45')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x46'));db[_0x22bc('0x47')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x48'));db[_0x22bc('0x49')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x4a'));db[_0x22bc('0x4b')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x4c'));db[_0x22bc('0x4d')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x4e'));db['FaxMessage']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x4f'));db['FaxQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x50'));db[_0x22bc('0x51')]=db['sequelize'][_0x22bc('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0x22bc('0x52')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x53'));db[_0x22bc('0x54')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x55'));db['SmsInteraction']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x56'));db[_0x22bc('0x57')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x58'));db[_0x22bc('0x59')]=db['sequelize']['import'](_0x22bc('0x5a'));db[_0x22bc('0x5b')]=db['sequelize']['import'](_0x22bc('0x5c'));db[_0x22bc('0x5d')]=db['sequelize'][_0x22bc('0x12')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x5e'));db['OpenchannelMessage']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x5f'));db[_0x22bc('0x60')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x61'));db[_0x22bc('0x62')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x63'));db[_0x22bc('0x64')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x65'));db[_0x22bc('0x66')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0x22bc('0x67')]=db['sequelize'][_0x22bc('0x12')]('../api/chatMessage/chatMessage.model');db[_0x22bc('0x68')]=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x22bc('0x69')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x6a'));db[_0x22bc('0x6b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x6c'));db[_0x22bc('0x6d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x22bc('0x6e')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x6f'));db[_0x22bc('0x70')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/cmContact/cmContact.model');db[_0x22bc('0x71')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x72'));db[_0x22bc('0x73')]=db['sequelize'][_0x22bc('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x22bc('0x74')]=db['sequelize']['import'](_0x22bc('0x75'));db['CmHopperHistory']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x76'));db[_0x22bc('0x77')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x78'));db['CmCustomField']=db['sequelize'][_0x22bc('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x22bc('0x79')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x7a'));db[_0x22bc('0x7b')]=db['sequelize'][_0x22bc('0x12')]('../api/automation/automation.model');db[_0x22bc('0x7c')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x22bc('0x7d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/disposition/disposition.model');db['Condition']=db[_0x22bc('0x3')]['import'](_0x22bc('0x7e'));db[_0x22bc('0x7f')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x80'));db['Pause']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x81'));db['Cdr']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x82'));db[_0x22bc('0x83')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x84'));db['Schedule']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x85'));db['Sound']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/sound/sound.model');db['Tag']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x86'));db[_0x22bc('0x87')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x88'));db[_0x22bc('0x89')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x8a'));db[_0x22bc('0x8b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x8c'));db[_0x22bc('0x8d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/integration/integration.model');db[_0x22bc('0x8e')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x8f'));db[_0x22bc('0x90')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x91'));db[_0x22bc('0x92')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x93'));db[_0x22bc('0x94')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x95'));db[_0x22bc('0x96')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x97'));db['AnalyticFieldReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x98'));db[_0x22bc('0x99')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9a'));db[_0x22bc('0x9b')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x22bc('0x9c')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9d'));db['SalesforceField']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9e'));db['SugarcrmAccount']=db[_0x22bc('0x3')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9f'));db[_0x22bc('0xa0')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xa1'));db[_0x22bc('0xa2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xa3'));db['DeskConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xa4'));db[_0x22bc('0xa5')]=db['sequelize'][_0x22bc('0x12')]('../api/intDeskField/intDeskField.model');db[_0x22bc('0xa6')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xa7'));db[_0x22bc('0xa8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xa9'));db['ZohoField']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xaa'));db[_0x22bc('0xab')]=db['sequelize']['import'](_0x22bc('0xac'));db[_0x22bc('0xad')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xae'));db['FreshdeskConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xaf'));db['FreshdeskField']=db['sequelize'][_0x22bc('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x22bc('0xb0')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xb1'));db[_0x22bc('0xb2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb3'));db[_0x22bc('0xb4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb5'));db['ServicenowAccount']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb6'));db[_0x22bc('0xb7')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb8'));db[_0x22bc('0xb9')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xba'));db['Dynamics365Account']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xbb'));db[_0x22bc('0xbc')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xbd'));db[_0x22bc('0xbe')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x22bc('0xbf')]=db['sequelize'][_0x22bc('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x22bc('0xc0')]=db['sequelize']['import'](_0x22bc('0xc1'));db['FreshsalesField']=db[_0x22bc('0x3')]['import'](_0x22bc('0xc2'));db['Integration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc3'));db[_0x22bc('0xc4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc5'));db[_0x22bc('0xc6')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc7'));db[_0x22bc('0xc8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xc9'));db[_0x22bc('0xca')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xcb'));db[_0x22bc('0xcc')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xcd'));db[_0x22bc('0xce')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xcf'));db['SmsQueueReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd0'));db[_0x22bc('0xd1')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd2'));db[_0x22bc('0xd3')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xd4'));db['Setting']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xd5'));db[_0x22bc('0xd6')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd7'));db[_0x22bc('0xd8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xd9'));db[_0x22bc('0xda')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xdb'));db['SquareMessage']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xdc'));db[_0x22bc('0xdd')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/team/team.model');db[_0x22bc('0xde')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xdf'));db[_0x22bc('0xe0')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xe1'));db[_0x22bc('0xe2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe3'));db[_0x22bc('0xe4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe5'));db[_0x22bc('0xe6')]=db['sequelize'][_0x22bc('0x12')]('../api/plugin/plugin.model');db[_0x22bc('0xe7')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe8'));db[_0x22bc('0xe9')]=db['sequelize']['import'](_0x22bc('0xea'));db[_0x22bc('0xeb')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xec'));db[_0x22bc('0xed')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xee'));db[_0x22bc('0xef')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf0'));db['CmList']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xf1'));db['VoicePrefix']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf2'));db[_0x22bc('0xf3')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xf4'));db[_0x22bc('0xf5')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf6'));db[_0x22bc('0xf7')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xf8'));db['UserNotification']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf9'));db[_0x22bc('0xfa')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xfb'));db[_0x22bc('0xfc')]=db['sequelize'][_0x22bc('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x22bc('0xfd')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xfe'));db[_0x22bc('0xff')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x100'));db[_0x22bc('0x101')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x102'));db[_0x22bc('0x103')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x104'));db[_0x22bc('0x105')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x106'));db['CloudProvider']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x107'));db[_0x22bc('0x108')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x22bc('0x109')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x22bc('0x10a')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db['User']['hasOne'](db[_0x22bc('0x1e')],{'as':_0x22bc('0x1e'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x1b')],{'as':_0x22bc('0x10f'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x2a')],{'as':_0x22bc('0x110'),'foreignKey':'UserId'});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x111'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x10d')]['hasMany'](db['CmHopperFinal'],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x114'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x77')],{'as':_0x22bc('0x77'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')]['hasMany'](db[_0x22bc('0x115')],{'as':_0x22bc('0x116'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['ChatInteraction'],{'as':_0x22bc('0x117'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x118')],{'as':'SmsInteractions','foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x4d')],{'as':_0x22bc('0x119'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x3e')],{'as':_0x22bc('0x11a'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['UserNotification'],{'as':_0x22bc('0x11b'),'foreignKey':'SenderId'});db[_0x22bc('0x10d')][_0x22bc('0x11c')](db[_0x22bc('0xf3')],{'as':_0x22bc('0xf3'),'foreignKey':_0x22bc('0x11d')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x22bc('0x11e'),'through':_0x22bc('0x11f')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x70')],{'as':_0x22bc('0x121'),'through':'cm_user_has_contacts'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x122')],{'as':_0x22bc('0x123'),'through':_0x22bc('0x124')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['Team'],{'through':'user_has_teams'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x3e')],{'as':_0x22bc('0x11a'),'through':_0x22bc('0x125')});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x66')],{'as':_0x22bc('0x117'),'through':'user_has_chat_interactions'});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['FaxInteraction'],{'as':_0x22bc('0x119'),'through':_0x22bc('0x126')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x118')],{'as':_0x22bc('0x127'),'through':_0x22bc('0x128')});db[_0x22bc('0x10d')]['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x22bc('0x129')});db['User'][_0x22bc('0x120')](db['WhatsappInteraction'],{'as':_0x22bc('0x12a'),'through':_0x22bc('0x12b')});db[_0x22bc('0x10d')]['belongsToMany'](db['VoiceQueue'],{'as':_0x22bc('0x12c'),'through':_0x22bc('0x2b'),'required':![]});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x12d')],{'as':_0x22bc('0x12e'),'through':'UserVoicePrefix','required':![]});db[_0x22bc('0x10d')]['belongsToMany'](db['MailQueue'],{'as':_0x22bc('0x12f'),'through':_0x22bc('0x130'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x69')],{'as':'ChatQueues','through':_0x22bc('0x2d'),'required':![],'hooks':!![]});db[_0x22bc('0x10d')]['belongsToMany'](db['FaxQueue'],{'as':_0x22bc('0x131'),'through':_0x22bc('0x2e'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x59')],{'as':_0x22bc('0x132'),'through':_0x22bc('0x30'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x60')],{'as':_0x22bc('0x133'),'through':_0x22bc('0x134'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x105')],{'as':'WhatsappQueues','through':_0x22bc('0x33'),'required':![]});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'through':_0x22bc('0x124')});db['User'][_0x22bc('0x120')](db[_0x22bc('0x12d')],{'as':_0x22bc('0x12e'),'through':'user_has_voice_prefixes','required':![]});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['ChatWebsite'],{'as':_0x22bc('0x135'),'through':_0x22bc('0x136')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['FaxAccount'],{'as':_0x22bc('0x137'),'through':_0x22bc('0x138')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x38')],{'as':_0x22bc('0x139'),'through':_0x22bc('0x13a')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x5b')],{'as':_0x22bc('0x13b'),'through':_0x22bc('0x13c')});db['User'][_0x22bc('0x120')](db[_0x22bc('0x52')],{'as':_0x22bc('0x13d'),'through':_0x22bc('0x13e')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0xfa')],{'as':_0x22bc('0x13f'),'through':'user_has_whatsapp_accounts'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0xd8')],{'as':_0x22bc('0x140'),'through':_0x22bc('0x141')});db[_0x22bc('0x13')]['hasMany'](db[_0x22bc('0x17')],{'as':_0x22bc('0x142'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x143')});db[_0x22bc('0x15')]['hasMany'](db[_0x22bc('0x17')],{'onDelete':'cascade'});db[_0x22bc('0x17')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x144'),'onDelete':_0x22bc('0x10b')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x22bc('0x145'),'through':'moh_has_sounds'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x2a')],{'as':_0x22bc('0x146'),'foreignKey':'VoiceQueueId'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x71')],{'as':_0x22bc('0x147'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':'VoiceQueueId'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x77')],{'as':_0x22bc('0x77'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x22bc('0x10e')](db[_0x22bc('0x73')],{'as':_0x22bc('0x14a'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')]['hasMany'](db['JscriptySessionReport'],{'as':_0x22bc('0x14b'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')]['belongsTo'](db[_0x22bc('0x27')],{'as':'Trunk','foreignKey':_0x22bc('0x14c')});db[_0x22bc('0x1a')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':_0x22bc('0x14d'),'foreignKey':_0x22bc('0x14e')});db[_0x22bc('0x1a')][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':_0x22bc('0x7f'),'foreignKey':'IntervalId'});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'as':'Lists','through':_0x22bc('0x151')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2b')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'as':'Teams','through':_0x22bc('0x108')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db['CmList'],{'as':_0x22bc('0x153'),'through':'voice_queues_has_cm_blacklists'});db[_0x22bc('0x1b')]['belongsTo'](db[_0x22bc('0x10d')],{'as':'User','foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x1c')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x1e')]['hasMany'](db[_0x22bc('0x1f')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x155'),'sourceKey':_0x22bc('0x156')});db[_0x22bc('0x1f')][_0x22bc('0x11c')](db[_0x22bc('0x1e')],{'foreignKey':_0x22bc('0x155'),'targetKey':_0x22bc('0x156')});db[_0x22bc('0x157')][_0x22bc('0x10e')](db[_0x22bc('0x23')],{'as':_0x22bc('0x158'),'foreignKey':_0x22bc('0x159'),'constraints':![]});db[_0x22bc('0x157')][_0x22bc('0x10e')](db[_0x22bc('0x15a')],{'as':'AgentReports','foreignKey':_0x22bc('0x159'),'constraints':![]});db['VoiceCallReport'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':'User','foreignKey':_0x22bc('0x10c')});db['VoiceCallReport']['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x15d')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':_0x22bc('0x38'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x22bc('0x38')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x38')][_0x22bc('0x15e')](db['MailServerOut'],{'as':_0x22bc('0x15f'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x161'),'onDelete':_0x22bc('0x10b')});db['MailAccount']['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['MailMessage'],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x38')]['hasMany'](db[_0x22bc('0x3e')],{'as':_0x22bc('0x163')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['MailApplication'],{'as':_0x22bc('0x144')});db[_0x22bc('0x38')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x38')]['belongsTo'](db['Template'],{'as':_0x22bc('0x87'),'foreignKey':'TemplateId'});db[_0x22bc('0x38')][_0x22bc('0x11c')](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x22bc('0x38')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x22bc('0x3a')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x130')});db['MailQueue'][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x167'),'as':'Teams'});db['MailInteraction'][_0x22bc('0x10e')](db[_0x22bc('0x40')],{'as':_0x22bc('0x154'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x3e')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x22bc('0x169'),'foreignKey':'UserId'});db[_0x22bc('0x3e')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x16b'),'as':'Tags'});db['MailInteraction'][_0x22bc('0x120')](db['Tag'],{'through':_0x22bc('0x16b'),'as':'ThroughTags'});db[_0x22bc('0x3e')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x125'),'foreignKey':_0x22bc('0x16d')});db[_0x22bc('0x40')][_0x22bc('0x10e')](db['Attachment'],{'as':_0x22bc('0x16e'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db['MailMessage'][_0x22bc('0x11c')](db['CmContact'],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b')});db['MailMessage'][_0x22bc('0x11c')](db['MailInteraction'],{'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x16d')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db['MailAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x62'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db['ChatOfflineMessage'],{'as':_0x22bc('0x68'),'foreignKey':_0x22bc('0x171')});db[_0x22bc('0x42')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':'restrict'});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x3a')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x42')]['belongsTo'](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x174')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{});db[_0x22bc('0x174')][_0x22bc('0x11c')](db['CmList'],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x174')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x3e')],{});db['MailQueueReport']['belongsTo'](db[_0x22bc('0x40')],{});db[_0x22bc('0x174')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x174')]['belongsTo'](db[_0x22bc('0x3a')],{});db[_0x22bc('0x45')][_0x22bc('0x10e')](db['DashboardItem'],{'as':_0x22bc('0x175'),'onDelete':_0x22bc('0x10b')});db['FaxAccount'][_0x22bc('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x22bc('0x176'),'onDelete':_0x22bc('0x10b')});db['FaxAccount']['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x176')});db['FaxAccount']['hasMany'](db[_0x22bc('0x4d')],{'as':'Interactions'});db[_0x22bc('0x49')][_0x22bc('0x10e')](db[_0x22bc('0x4b')],{'as':_0x22bc('0x144')});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0x22bc('0x10e')](db[_0x22bc('0x177')],{'as':_0x22bc('0x154')});db['FaxAccount']['belongsTo'](db['Trunk'],{'as':_0x22bc('0x27')});db['FaxAccount'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db['FaxAccount']['belongsTo'](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x49')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x138')});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')][_0x22bc('0x11c')](db[_0x22bc('0x49')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x4d')][_0x22bc('0x10e')](db[_0x22bc('0x177')],{'as':'Messages','onDelete':_0x22bc('0x10b'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0x22bc('0x49')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x176')});db[_0x22bc('0x4d')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x4d')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x4d')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x178'),'as':_0x22bc('0x179')});db['FaxInteraction'][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x178'),'as':_0x22bc('0x17a')});db['FaxInteraction'][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x126'),'foreignKey':_0x22bc('0x17b')});db[_0x22bc('0x177')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x177')][_0x22bc('0x11c')](db['FaxInteraction'],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0x22bc('0x70')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b')});db[_0x22bc('0x177')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':'Attachment','foreignKey':_0x22bc('0x17c')});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x176')});db[_0x22bc('0x17d')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2e')});db['FaxQueue'][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x17e'),'as':_0x22bc('0x17f')});db[_0x22bc('0x51')]['belongsTo'](db[_0x22bc('0x49')],{});db['FaxQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':'ListId'});db[_0x22bc('0x51')]['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':'ContactId'});db[_0x22bc('0x51')][_0x22bc('0x11c')](db[_0x22bc('0x4d')],{});db['FaxQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x177')],{});db['FaxQueueReport']['belongsTo'](db[_0x22bc('0x10d')],{});db[_0x22bc('0x51')][_0x22bc('0x11c')](db[_0x22bc('0x17d')],{});db[_0x22bc('0x52')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x180'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x52')][_0x22bc('0x10e')](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':'SmsAccountId'});db[_0x22bc('0x52')][_0x22bc('0x10e')](db['SmsMessage'],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x180')});db[_0x22bc('0x52')][_0x22bc('0x10e')](db[_0x22bc('0x118')],{'as':_0x22bc('0x163')});db['SmsAccount'][_0x22bc('0x10e')](db[_0x22bc('0x54')],{'as':_0x22bc('0x144')});db['SmsAccount'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x52')]['belongsTo'](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x52')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x13e')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db['SmsQueue'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db['SmsAccount'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')]['belongsTo'](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x22bc('0x118')][_0x22bc('0x10e')](db[_0x22bc('0x57')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x118')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'as':'Account','foreignKey':_0x22bc('0x180')});db['SmsInteraction'][_0x22bc('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x118')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x118')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x182'),'as':_0x22bc('0x179')});db[_0x22bc('0x118')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x182'),'as':'ThroughTags'});db[_0x22bc('0x118')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x128'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x57')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db[_0x22bc('0x57')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x22bc('0x15b')});db[_0x22bc('0x57')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x57')]['belongsTo'](db[_0x22bc('0x52')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x180')});db[_0x22bc('0x59')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'UserSmsQueue','foreignKey':_0x22bc('0x183')});db[_0x22bc('0x59')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x184'),'as':_0x22bc('0x17f')});db[_0x22bc('0x5b')][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':'Dispositions','foreignKey':_0x22bc('0x185'),'onDelete':_0x22bc('0x10b')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0x22bc('0x162'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x22bc('0x10e')](db['OpenchannelInteraction'],{'as':_0x22bc('0x163'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x22bc('0x10e')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x22bc('0x185')});db[_0x22bc('0x5b')][_0x22bc('0x10e')](db[_0x22bc('0x5d')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0x22bc('0x5b')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x5b')]['belongsTo'](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x5b')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'user_has_openchannel_accounts'});db[_0x22bc('0x5d')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':'restrict'});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db[_0x22bc('0x60')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x186')});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db['Interval'],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db[_0x22bc('0x5d')]['belongsTo'](db[_0x22bc('0x16a')],{'onDelete':_0x22bc('0x172'),'foreignKey':'TagId'});db[_0x22bc('0x115')][_0x22bc('0x10e')](db[_0x22bc('0x187')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x188')});db[_0x22bc('0x115')]['belongsTo'](db[_0x22bc('0x5b')],{'as':'Account','foreignKey':_0x22bc('0x185')});db[_0x22bc('0x115')][_0x22bc('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x115')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x115')]['belongsToMany'](db['Tag'],{'through':_0x22bc('0x189'),'as':_0x22bc('0x179')});db[_0x22bc('0x115')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x189'),'as':_0x22bc('0x17a')});db[_0x22bc('0x115')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':'Users','through':_0x22bc('0x129'),'foreignKey':_0x22bc('0x188')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x187')]['belongsTo'](db[_0x22bc('0x70')],{'onDelete':_0x22bc('0x10b'),'as':'Contact'});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x115')],{'onDelete':_0x22bc('0x10b'),'as':'Interaction','foreignKey':_0x22bc('0x188')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':_0x22bc('0xe4'),'foreignKey':_0x22bc('0x17c')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{'as':'Account','foreignKey':_0x22bc('0x185')});db['OpenchannelQueue'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x134'),'foreignKey':'OpenchannelQueueId'});db[_0x22bc('0x60')][_0x22bc('0x120')](db['Team'],{'through':_0x22bc('0x18a'),'as':_0x22bc('0x17f')});db['ChatWebsite'][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':'Dispositions','foreignKey':_0x22bc('0x170'),'onDelete':'cascade'});db[_0x22bc('0x62')][_0x22bc('0x10e')](db['CannedAnswer'],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x6d')],{'as':'ProactiveActions'});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x66')],{'as':_0x22bc('0x163')});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x64')],{'as':'Applications'});db[_0x22bc('0x62')]['hasMany'](db[_0x22bc('0x67')],{'as':'Messages'});db[_0x22bc('0x62')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':_0x22bc('0x7f'),'foreignKey':_0x22bc('0x18b')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':'MailAccount','foreignKey':_0x22bc('0x161')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x22bc('0x120')](db['User'],{'as':'Agents','through':_0x22bc('0x136')});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db['CmContact'],{'as':_0x22bc('0x15b'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x187')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db['OpenchannelQueue'],{});db[_0x22bc('0x64')][_0x22bc('0x11c')](db['User'],{'as':_0x22bc('0x18d'),'foreignKey':_0x22bc('0x10c'),'onDelete':'restrict'});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x69')],{'as':_0x22bc('0x18e'),'foreignKey':_0x22bc('0x18f'),'onDelete':'restrict'});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x190'),'foreignKey':_0x22bc('0x170'),'onDelete':_0x22bc('0x172')});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x66')]['hasMany'](db[_0x22bc('0x67')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x191')});db[_0x22bc('0x66')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x66')]['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['ChatInteraction']['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x66')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':'chat_interaction_has_tags','as':_0x22bc('0x179')});db[_0x22bc('0x66')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x192'),'as':'ThroughTags'});db['ChatInteraction'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x193'),'foreignKey':'ChatInteractionId'});db[_0x22bc('0x67')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db['CmContact'],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db[_0x22bc('0x66')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x191')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':_0x22bc('0xe4'),'foreignKey':_0x22bc('0x17c')});db[_0x22bc('0x67')]['belongsTo'](db[_0x22bc('0x62')],{'as':'Account','foreignKey':_0x22bc('0x170')});db[_0x22bc('0x68')]['hasMany'](db[_0x22bc('0xe4')],{'as':_0x22bc('0x16e'),'foreignKey':_0x22bc('0x171'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x68')][_0x22bc('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x68')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x69')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2d'),'hooks':!![]});db[_0x22bc('0x69')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x194'),'as':'Teams'});db[_0x22bc('0x6b')]['hasMany'](db[_0x22bc('0xc8')],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x195'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x6b')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x146'),'through':_0x22bc('0x11f')});db[_0x22bc('0x6d')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x190'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x6e')][_0x22bc('0x10e')](db['CmContact'],{'as':_0x22bc('0x121'),'foreignKey':'CompanyId'});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x22bc('0x15c')});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':'HopperFinals','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['ReportAgentPreview'],{'as':_0x22bc('0x77'),'foreignKey':'ContactId'});db[_0x22bc('0x70')]['hasMany'](db[_0x22bc('0xce')],{'as':_0x22bc('0x14b'),'foreignKey':'ContactId'});db[_0x22bc('0x70')][_0x22bc('0x10e')](db[_0x22bc('0x115')],{'as':_0x22bc('0x116'),'foreignKey':'ContactId','onDelete':_0x22bc('0x172')});db[_0x22bc('0x70')]['hasMany'](db[_0x22bc('0x66')],{'as':_0x22bc('0x117'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x172')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['SmsInteraction'],{'as':_0x22bc('0x127'),'foreignKey':_0x22bc('0x15c'),'onDelete':'restrict'});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x4d')],{'as':_0x22bc('0x119'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x172')});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x3e')],{'as':'MailInteractions','foreignKey':_0x22bc('0x15c'),'onDelete':'restrict'});db['CmContact'][_0x22bc('0x11c')](db[_0x22bc('0x6e')],{'as':_0x22bc('0x196'),'foreignKey':_0x22bc('0x197')});db['CmContact'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':'List','foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x70')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x198')});db[_0x22bc('0x70')]['belongsToMany'](db[_0x22bc('0x16a')],{'as':'Tags','through':_0x22bc('0x199')});db['CmContact'][_0x22bc('0x120')](db['Tag'],{'through':_0x22bc('0x199'),'as':'ThroughTags'});db['CmHopper'][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x71')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165'),'onDelete':'cascade'});db['CmHopper'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x18d'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x71')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x22bc('0x148'),'onDelete':_0x22bc('0x10b')});db['CmHopper']['belongsTo'](db[_0x22bc('0xe0')],{'as':_0x22bc('0xe0'),'foreignKey':'CampaignId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x71')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x19a')});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c'),'onDelete':'cascade'});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x1a')],{'as':'Queue','foreignKey':_0x22bc('0x148'),'onDelete':'cascade'});db[_0x22bc('0x73')][_0x22bc('0x11c')](db['Campaign'],{'as':_0x22bc('0xe0'),'foreignKey':'CampaignId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x7b')][_0x22bc('0x10e')](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x19c'),'singular':_0x22bc('0x19d')},'foreignKey':_0x22bc('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x7b')]['hasMany'](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x19f'),'singular':_0x22bc('0x1a0')},'foreignKey':_0x22bc('0x1a1'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x7b')][_0x22bc('0x10e')](db[_0x22bc('0x79')],{'as':_0x22bc('0x1a2'),'foreignKey':_0x22bc('0x1a3'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x7d')][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':_0x22bc('0x160'),'foreignKey':'ParentId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x7f')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x111'),'foreignKey':_0x22bc('0x18b'),'onDelete':_0x22bc('0x172')});db['Interval'][_0x22bc('0x10e')](db[_0x22bc('0x42')],{'as':_0x22bc('0x1a4'),'foreignKey':_0x22bc('0x18b')});db['Interval']['hasMany'](db[_0x22bc('0x64')],{'as':_0x22bc('0x1a5'),'foreignKey':_0x22bc('0x18b')});db['Interval']['hasMany'](db['FaxApplication'],{'as':_0x22bc('0x1a6'),'foreignKey':_0x22bc('0x18b')});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x54')],{'as':_0x22bc('0x1a7'),'foreignKey':'IntervalId'});db['Schedule'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{});db[_0x22bc('0x1a8')][_0x22bc('0x11c')](db[_0x22bc('0x92')],{'foreignKey':_0x22bc('0x1a9')});db[_0x22bc('0x1a8')][_0x22bc('0x11c')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x22bc('0x1aa')][_0x22bc('0x120')](db[_0x22bc('0x18')],{'as':_0x22bc('0x1ab'),'through':_0x22bc('0x1ac'),'onDelete':'restrict'});db[_0x22bc('0x16a')]['belongsToMany'](db[_0x22bc('0x70')],{'through':'cm_contact_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0x66')],{'through':_0x22bc('0x192')});db[_0x22bc('0x16a')][_0x22bc('0x120')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0x118')],{'through':'sms_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db['FaxInteraction'],{'through':_0x22bc('0x178')});db[_0x22bc('0x16a')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0xfd')],{'through':_0x22bc('0x1ad')});db[_0x22bc('0x89')]['hasMany'](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x1ae'),'singular':_0x22bc('0x1af')},'foreignKey':_0x22bc('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x89')][_0x22bc('0x10e')](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x1b1'),'singular':_0x22bc('0x1b2')},'foreignKey':_0x22bc('0x1b3'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x89')][_0x22bc('0x10e')](db[_0x22bc('0x79')],{'as':_0x22bc('0x1a2'),'foreignKey':_0x22bc('0x1b4'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x90')][_0x22bc('0x10e')](db[_0x22bc('0x1b5')],{'as':'Fields','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1b6'),'hooks':!![]});db[_0x22bc('0x92')][_0x22bc('0x10e')](db[_0x22bc('0x1b5')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1a9')});db['AnalyticMetric']['hasMany'](db['AnalyticFieldReport'],{'as':_0x22bc('0x1b7'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x22bc('0x1b5')][_0x22bc('0x11c')](db[_0x22bc('0x96')],{'foreignKey':_0x22bc('0x1b8')});db[_0x22bc('0x9b')][_0x22bc('0x10e')](db['SalesforceConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x22bc('0x10e')](db['SalesforceField'],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x9c')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db[_0x22bc('0x9c')]['hasMany'](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1b7'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x22bc('0x9c')][_0x22bc('0x11c')](db[_0x22bc('0x9b')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1bc')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db['SalesforceField'][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1bc')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1bc')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1c4')][_0x22bc('0x10e')](db[_0x22bc('0x1c5')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1c5')]['hasMany'](db[_0x22bc('0xa0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c5')][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['SugarcrmConfiguration'][_0x22bc('0x11c')](db['SugarcrmAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xa0')]['hasMany'](db[_0x22bc('0xa0')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1bf'),'foreignKey':'DescriptionId'});db[_0x22bc('0xa0')][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db['SugarcrmField']['belongsTo'](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xa2')]['hasMany'](db['DeskConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db['DeskField'],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['DeskConfiguration']['belongsTo'](db[_0x22bc('0xa2')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1c6')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1c7')});db[_0x22bc('0xa5')][_0x22bc('0x10e')](db['DeskField'],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xa5')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':'Description','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xa5')]['hasMany'](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xa5')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xa6')][_0x22bc('0x10e')](db[_0x22bc('0xa8')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':'SubjectId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db['ZohoField'],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['ZohoConfiguration']['belongsTo'](db[_0x22bc('0xa6')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db['ZohoField'][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c9')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':'Description','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1c9')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1c9')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db['ZendeskAccount'][_0x22bc('0x10e')](db[_0x22bc('0xad')],{'as':'Configurations','onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0xad')][_0x22bc('0x10e')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x22bc('0xad')][_0x22bc('0x10e')](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1bd'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xad')][_0x22bc('0x10e')](db['ZendeskField'],{'as':_0x22bc('0x1b7'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x22bc('0x11c')](db['ZendeskAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xad')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1cb')});db[_0x22bc('0x1ca')]['hasMany'](db['ZendeskField'],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1ca')][_0x22bc('0x10e')](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db['ZendeskField']['hasMany'](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db['ZendeskField'][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':'VariableId'});db[_0x22bc('0x1cc')][_0x22bc('0x10e')](db['FreshdeskConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db['FreshdeskConfiguration']['hasMany'](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1ce')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1ce')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1ce')][_0x22bc('0x11c')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1ce')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1cf')});db['FreshdeskField'][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1cd')][_0x22bc('0x10e')](db['FreshdeskField'],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1cd')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1c1'),'foreignKey':'FieldId'});db[_0x22bc('0x1cd')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0x22bc('0xb0')][_0x22bc('0x10e')](db[_0x22bc('0xb2')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1ba'),'foreignKey':'SubjectId'});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db['VtigerField'],{'as':_0x22bc('0x1bd'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1b7'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0x22bc('0xb0')],{'as':_0x22bc('0x168'),'foreignKey':'AccountId'});db[_0x22bc('0xb4')]['hasMany'](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xb4')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db['VtigerField']['belongsTo'](db['Variable'],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1d0')]['hasMany'](db[_0x22bc('0xb7')],{'as':_0x22bc('0x1b9'),'onDelete':'cascade','foreignKey':_0x22bc('0x1be')});db['ServicenowConfiguration']['hasMany'](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1ba'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xb7')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1b7'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xb7')][_0x22bc('0x11c')](db[_0x22bc('0x1d0')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1c8'),'foreignKey':'SubjectId'});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db['ServicenowField'],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xb9')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1d1')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xbc')]['hasMany'](db['Dynamics365Field'],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db['Dynamics365Configuration']['hasMany'](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':_0x22bc('0x1c0')});db['Dynamics365Configuration'][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xbc')][_0x22bc('0x11c')](db[_0x22bc('0x1d1')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db['Dynamics365Field'][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xbe')][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xbe')][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db['Dynamics365Field'][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xbf')]['hasMany'](db[_0x22bc('0xc0')],{'as':'Configurations','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xc0')]['hasMany'](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x22bc('0x1bb')});db['FreshsalesConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':'Descriptions','foreignKey':_0x22bc('0x1c0')});db['FreshsalesConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1b7'),'foreignKey':_0x22bc('0x1c2')});db['FreshsalesConfiguration'][_0x22bc('0x11c')](db[_0x22bc('0xbf')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1c8'),'foreignKey':'SubjectId'});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1d2')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':'VariableId'});db[_0x22bc('0xc6')]['belongsTo'](db[_0x22bc('0x62')],{});db[_0x22bc('0xc6')][_0x22bc('0x11c')](db['CmList'],{'as':'List','foreignKey':_0x22bc('0x165')});db['ChatQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0xc6')][_0x22bc('0x11c')](db[_0x22bc('0x66')],{});db['ChatQueueReport'][_0x22bc('0x11c')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db['User'],{});db['ChatQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x69')],{});db['ChatInternalMessage'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x22bc('0xc8')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':'cascade','foreignKey':_0x22bc('0x1d3')});db[_0x22bc('0xce')][_0x22bc('0x10e')](db[_0x22bc('0xcc')],{'foreignKey':_0x22bc('0x1d4'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0xce')][_0x22bc('0x10e')](db[_0x22bc('0xca')],{'foreignKey':_0x22bc('0x1d4'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db['SmsMessage'],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x22bc('0xce')],{'foreignKey':_0x22bc('0x1d6')});db['JscriptyProject'][_0x22bc('0x10e')](db[_0x22bc('0xcc')],{'foreignKey':_0x22bc('0x1d6')});db[_0x22bc('0xd3')][_0x22bc('0x10e')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x22bc('0xd8')][_0x22bc('0x120')](db['User'],{'as':'Users','through':_0x22bc('0x141')});db[_0x22bc('0xdd')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'user_has_teams'});db['Team'][_0x22bc('0x120')](db[_0x22bc('0x1a')],{'through':_0x22bc('0x108'),'as':'VoiceQueues'});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x3a')],{'through':_0x22bc('0x167'),'as':'MailQueues'});db[_0x22bc('0xdd')][_0x22bc('0x120')](db['ChatQueue'],{'through':_0x22bc('0x194'),'as':_0x22bc('0x1d7')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x17d')],{'through':_0x22bc('0x17e'),'as':_0x22bc('0x131')});db[_0x22bc('0xdd')]['belongsToMany'](db[_0x22bc('0x59')],{'through':_0x22bc('0x184'),'as':_0x22bc('0x132')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x60')],{'through':'team_has_openchannel_queues','as':_0x22bc('0x133')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x105')],{'through':_0x22bc('0x1d8'),'as':_0x22bc('0x1d9')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x12d')],{'through':_0x22bc('0x109'),'as':_0x22bc('0x12e')});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x71')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x1da')});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':_0x22bc('0x1da')});db['Campaign'][_0x22bc('0x10e')](db['CmHopperBlack'],{'as':_0x22bc('0x14a'),'foreignKey':_0x22bc('0x1da')});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':_0x22bc('0x27'),'foreignKey':_0x22bc('0x14c')});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':'TrunkBackup','foreignKey':_0x22bc('0x14e')});db['Campaign'][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0xd8')],{'as':_0x22bc('0xd8'),'foreignKey':_0x22bc('0x1db')});db[_0x22bc('0xe0')][_0x22bc('0x120')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x22bc('0xe0')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'as':_0x22bc('0x153'),'through':_0x22bc('0x1dc')});db['Attachment'][_0x22bc('0x11c')](db[_0x22bc('0x68')],{'as':_0x22bc('0x68'),'foreignKey':_0x22bc('0x171')});db[_0x22bc('0xe7')]['belongsTo'](db[_0x22bc('0x40')],{});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x3e')],{});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'foreignKey':_0x22bc('0x1dd'),'as':'FromAccount'});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':_0x22bc('0x1e2'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'foreignKey':_0x22bc('0x1e4'),'as':'ToAccount'});db[_0x22bc('0xe9')][_0x22bc('0x11c')](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0x22bc('0xe9')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0x22bc('0x1e5')});db[_0x22bc('0xe9')]['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':_0x22bc('0x1df')});db['ChatTransferReport']['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['ChatTransferReport']['belongsTo'](db['ChatQueue'],{'foreignKey':_0x22bc('0x1e6'),'as':_0x22bc('0x1e3')});db['ChatTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'foreignKey':_0x22bc('0x1e7'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db[_0x22bc('0x177')],{});db[_0x22bc('0xeb')]['belongsTo'](db[_0x22bc('0x4d')],{});db['FaxTransferReport'][_0x22bc('0x11c')](db['FaxAccount'],{'foreignKey':_0x22bc('0x1e9'),'as':_0x22bc('0x1e5')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':_0x22bc('0x1df')});db['FaxTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0x22bc('0x11c')](db['FaxQueue'],{'foreignKey':_0x22bc('0x1ea'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db['FaxAccount'],{'foreignKey':_0x22bc('0x1eb'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xed')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x22bc('0xed')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x22bc('0x5b')],{'foreignKey':_0x22bc('0x1ec'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x22bc('0x11c')](db['User'],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db[_0x22bc('0x60')],{'foreignKey':_0x22bc('0x1ed'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db['OpenchannelAccount'],{'foreignKey':_0x22bc('0x1ee'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x57')],{});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x118')],{});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'foreignKey':'FromSmsAccountId','as':_0x22bc('0x1e5')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x59')],{'foreignKey':_0x22bc('0x1ef'),'as':_0x22bc('0x1e3')});db['SmsTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'foreignKey':_0x22bc('0x1f0'),'as':_0x22bc('0x1e8')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x1f1')],{'as':_0x22bc('0x1f2'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x70')],{'as':'Contacts','onDelete':_0x22bc('0x10b'),'foreignKey':'ListId'});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':'ListId'});db[_0x22bc('0x122')]['hasMany'](db[_0x22bc('0x113')],{'as':_0x22bc('0x114'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db['ReportAgentPreview'],{'as':_0x22bc('0x77'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x120')](db[_0x22bc('0x1a')],{'as':_0x22bc('0x1f3'),'through':_0x22bc('0x151')});db[_0x22bc('0x122')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x124')});db[_0x22bc('0x12d')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':'Extensions','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x12d')][_0x22bc('0x120')](db['User'],{'as':'Agents','through':_0x22bc('0x10a')});db['VoicePrefix']['belongsToMany'](db[_0x22bc('0xdd')],{'through':_0x22bc('0x109'),'as':'Teams'});db['UserProfile']['hasMany'](db['User'],{'as':_0x22bc('0x16c'),'foreignKey':_0x22bc('0x11d')});db[_0x22bc('0xf3')]['hasMany'](db[_0x22bc('0xf5')],{'as':'UserProfileSections','foreignKey':_0x22bc('0x11d'),'onDelete':'cascade'});db['UserProfileSection'][_0x22bc('0x10e')](db[_0x22bc('0xf7')],{'as':_0x22bc('0x1f4'),'foreignKey':_0x22bc('0x1f5'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0x22bc('0x7d')],{'as':_0x22bc('0x160'),'foreignKey':'WhatsappAccountId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0xfa')]['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x1f6')});db['WhatsappAccount'][_0x22bc('0x10e')](db[_0x22bc('0xff')],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x1f6')});db[_0x22bc('0xfa')][_0x22bc('0x10e')](db[_0x22bc('0xfd')],{'as':_0x22bc('0x163')});db[_0x22bc('0xfa')][_0x22bc('0x10e')](db[_0x22bc('0xfc')],{'as':_0x22bc('0x144')});db[_0x22bc('0xfa')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':'List','foreignKey':_0x22bc('0x165')});db['WhatsappAccount'][_0x22bc('0x11c')](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x1f7')});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0xfc')]['belongsTo'](db[_0x22bc('0x105')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x18b')});db[_0x22bc('0xfc')]['belongsTo'](db[_0x22bc('0x16a')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x173')});db[_0x22bc('0xfd')]['hasMany'](db[_0x22bc('0xff')],{'as':'Messages','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xfd')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{'as':'Account','foreignKey':_0x22bc('0x1f6')});db['WhatsappInteraction'][_0x22bc('0x11c')](db['CmContact'],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0xfd')][_0x22bc('0x11c')](db['User'],{'as':_0x22bc('0x169'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0x22bc('0x16a')],{'through':'whatsapp_interaction_has_tags','as':_0x22bc('0x179')});db['WhatsappInteraction'][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1ad'),'as':_0x22bc('0x17a')});db[_0x22bc('0xfd')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x12b'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xff')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db[_0x22bc('0xff')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x22bc('0xff')][_0x22bc('0x11c')](db[_0x22bc('0xfd')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xff')]['belongsTo'](db[_0x22bc('0xfa')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1f6')});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{});db[_0x22bc('0x101')]['belongsTo'](db[_0x22bc('0x122')],{'as':'List','foreignKey':'ListId'});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db['WhatsappQueueReport']['belongsTo'](db[_0x22bc('0xfd')],{});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0x105')],{});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0xff')],{});db[_0x22bc('0x101')]['belongsTo'](db['User'],{});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0xff')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x22bc('0xfd')],{});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{'foreignKey':_0x22bc('0x1f9'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x22bc('0x11c')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x22bc('0x1e8')});db[_0x22bc('0x103')][_0x22bc('0x11c')](db['WhatsappQueue'],{'foreignKey':_0x22bc('0x1fa'),'as':'ToQueue'});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x22bc('0x103')]['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['WhatsappQueue'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x33'),'foreignKey':'WhatsappQueueId'});db[_0x22bc('0x105')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x1d8'),'as':_0x22bc('0x17f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 08de778..f338d74 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7562=['/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/trigger','/api/variables','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/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/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./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/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','password','newPassword','firstName','lastName','phone','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','privateKey','key','pass','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./config/logger','api','auth','default','use','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','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_id','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue'];(function(_0x28c4c9,_0x539719){var _0x1dbb0b=function(_0x1ed994){while(--_0x1ed994){_0x28c4c9['push'](_0x28c4c9['shift']());}};_0x1dbb0b(++_0x539719);}(_0x7562,0xf7));var _0x2756=function(_0x4d05ea,_0x359e50){_0x4d05ea=_0x4d05ea-0x0;var _0x33b063=_0x7562[_0x4d05ea];return _0x33b063;};'use strict';var _=require(_0x2756('0x0'));var path=require(_0x2756('0x1'));var express=require(_0x2756('0x2'));var ewinston=require(_0x2756('0x3'));var util=require(_0x2756('0x4'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x2756('0x5'))(_0x2756('0x6'));var authLogger=require('./config/logger')(_0x2756('0x7'));exports[_0x2756('0x8')]=function(_0xfc694e){_0xfc694e[_0x2756('0x9')](ewinston[_0x2756('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xe093f9,_0x487f55){var _0x4955f9=_0x2756('0xb');if(!_[_0x2756('0xc')](_0xe093f9[_0x2756('0xd')])){_0x4955f9+=_0x2756('0xe');var _0x14348a=_0xe093f9[_0x2756('0xd')];maskSensitiveData(_0x14348a);}return util[_0x2756('0xf')](_0x4955f9,_0xe093f9[_0x2756('0x10')],_0xe093f9[_0x2756('0x11')][_0x2756('0x12')]?_0xe093f9['headers'][_0x2756('0x12')]:_0xe093f9[_0x2756('0x13')][_0x2756('0x14')]||_0xe093f9['ip'],_0xe093f9[_0x2756('0x15')],_0x487f55[_0x2756('0x16')],_0x487f55[_0x2756('0x17')],_0xe093f9[_0x2756('0x18')]?_0xe093f9[_0x2756('0x18')]['id']:null,_0xe093f9[_0x2756('0x18')]?_0xe093f9[_0x2756('0x18')][_0x2756('0x19')]:null,_0xe093f9[_0x2756('0x18')]?_0xe093f9[_0x2756('0x18')][_0x2756('0x1a')]:null,_0x14348a?util['inspect'](_0x14348a,![],null):'');}}));_0xfc694e[_0x2756('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2d8ef0,_0x51a4b3){var _0x352f62='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2d8ef0['body']&&_0x2d8ef0[_0x2756('0xd')]['device']&&_0x2d8ef0[_0x2756('0xd')]['agent_id']){_0x352f62=_0x2756('0x1b');}return util[_0x2756('0xf')](_0x352f62,_0x2d8ef0[_0x2756('0x10')],_0x2d8ef0[_0x2756('0x11')][_0x2756('0x12')]?_0x2d8ef0['headers'][_0x2756('0x12')]:_0x2d8ef0['connection'][_0x2756('0x14')]||_0x2d8ef0['ip'],_0x2d8ef0['url'],_0x51a4b3[_0x2756('0x16')],_0x51a4b3[_0x2756('0x17')],_0x2d8ef0['user']?_0x2d8ef0[_0x2756('0x18')]['id']:null,_0x2d8ef0[_0x2756('0x18')]?_0x2d8ef0[_0x2756('0x18')][_0x2756('0x19')]:null,_0x2d8ef0[_0x2756('0x18')]?_0x2d8ef0[_0x2756('0x18')]['role']:null,_0x2d8ef0['body']&&_0x2d8ef0[_0x2756('0xd')]['device']?_0x2d8ef0['body'][_0x2756('0x1c')]:_0x2756('0x1d'),_0x2d8ef0['body']&&_0x2d8ef0[_0x2756('0xd')][_0x2756('0x1e')]?_0x2d8ef0['body'][_0x2756('0x1e')]:'',_0x2d8ef0[_0x2756('0xd')]&&_0x2d8ef0['body'][_0x2756('0x1f')]?_0x2d8ef0[_0x2756('0xd')][_0x2756('0x1f')]:'');},'ignoreRoute':function(_0x5a8389){var _0x3ff6e9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3ff6e9[_0x2756('0x20')](_0x5a8389['url']);}}));_0xfc694e['use']('/api/users',require(_0x2756('0x21')));_0xfc694e[_0x2756('0x9')](_0x2756('0x22'),require(_0x2756('0x23')));_0xfc694e[_0x2756('0x9')]('/api/voice/contexts',require(_0x2756('0x24')));_0xfc694e[_0x2756('0x9')](_0x2756('0x25'),require(_0x2756('0x26')));_0xfc694e[_0x2756('0x9')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0xfc694e['use'](_0x2756('0x27'),require('./api/voiceQueue'));_0xfc694e[_0x2756('0x9')](_0x2756('0x28'),require(_0x2756('0x29')));_0xfc694e[_0x2756('0x9')](_0x2756('0x2a'),require(_0x2756('0x2b')));_0xfc694e['use'](_0x2756('0x2c'),require(_0x2756('0x2d')));_0xfc694e[_0x2756('0x9')](_0x2756('0x2e'),require(_0x2756('0x2f')));_0xfc694e['use'](_0x2756('0x30'),require('./api/voiceCallReport'));_0xfc694e[_0x2756('0x9')](_0x2756('0x31'),require(_0x2756('0x32')));_0xfc694e[_0x2756('0x9')](_0x2756('0x33'),require('./api/voiceAgentReport'));_0xfc694e[_0x2756('0x9')](_0x2756('0x34'),require(_0x2756('0x35')));_0xfc694e['use'](_0x2756('0x36'),require(_0x2756('0x37')));_0xfc694e[_0x2756('0x9')]('/api/trunks',require(_0x2756('0x38')));_0xfc694e[_0x2756('0x9')](_0x2756('0x39'),require(_0x2756('0x3a')));_0xfc694e[_0x2756('0x9')]('/api/mail/out_servers',require('./api/mailServerOut'));_0xfc694e[_0x2756('0x9')](_0x2756('0x3b'),require(_0x2756('0x3c')));_0xfc694e['use'](_0x2756('0x3d'),require(_0x2756('0x3e')));_0xfc694e[_0x2756('0x9')](_0x2756('0x3f'),require(_0x2756('0x40')));_0xfc694e[_0x2756('0x9')](_0x2756('0x41'),require('./api/mailInteraction'));_0xfc694e['use'](_0x2756('0x42'),require(_0x2756('0x43')));_0xfc694e[_0x2756('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0xfc694e[_0x2756('0x9')](_0x2756('0x44'),require(_0x2756('0x45')));_0xfc694e[_0x2756('0x9')](_0x2756('0x46'),require(_0x2756('0x47')));_0xfc694e[_0x2756('0x9')](_0x2756('0x48'),require(_0x2756('0x49')));_0xfc694e[_0x2756('0x9')]('/api/fax/accounts',require(_0x2756('0x4a')));_0xfc694e[_0x2756('0x9')](_0x2756('0x4b'),require(_0x2756('0x4c')));_0xfc694e[_0x2756('0x9')](_0x2756('0x4d'),require(_0x2756('0x4e')));_0xfc694e[_0x2756('0x9')](_0x2756('0x4f'),require(_0x2756('0x50')));_0xfc694e['use']('/api/fax/queues',require(_0x2756('0x51')));_0xfc694e[_0x2756('0x9')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0xfc694e['use'](_0x2756('0x52'),require('./api/smsAccount'));_0xfc694e[_0x2756('0x9')](_0x2756('0x53'),require(_0x2756('0x54')));_0xfc694e[_0x2756('0x9')](_0x2756('0x55'),require('./api/smsInteraction'));_0xfc694e[_0x2756('0x9')](_0x2756('0x56'),require(_0x2756('0x57')));_0xfc694e[_0x2756('0x9')](_0x2756('0x58'),require(_0x2756('0x59')));_0xfc694e['use'](_0x2756('0x5a'),require('./api/openchannelAccount'));_0xfc694e[_0x2756('0x9')]('/api/openchannel/applications',require(_0x2756('0x5b')));_0xfc694e['use'](_0x2756('0x5c'),require(_0x2756('0x5d')));_0xfc694e[_0x2756('0x9')](_0x2756('0x5e'),require('./api/openchannelMessage'));_0xfc694e['use'](_0x2756('0x5f'),require(_0x2756('0x60')));_0xfc694e[_0x2756('0x9')](_0x2756('0x61'),require(_0x2756('0x62')));_0xfc694e['use'](_0x2756('0x63'),require('./api/openchannelQueueReport'));_0xfc694e[_0x2756('0x9')]('/api/chat/applications',require(_0x2756('0x64')));_0xfc694e[_0x2756('0x9')](_0x2756('0x65'),require(_0x2756('0x66')));_0xfc694e['use'](_0x2756('0x67'),require(_0x2756('0x68')));_0xfc694e[_0x2756('0x9')](_0x2756('0x69'),require(_0x2756('0x6a')));_0xfc694e[_0x2756('0x9')](_0x2756('0x6b'),require(_0x2756('0x6c')));_0xfc694e['use'](_0x2756('0x6d'),require(_0x2756('0x6e')));_0xfc694e[_0x2756('0x9')](_0x2756('0x6f'),require(_0x2756('0x70')));_0xfc694e[_0x2756('0x9')]('/api/cm/companies',require(_0x2756('0x71')));_0xfc694e[_0x2756('0x9')](_0x2756('0x72'),require(_0x2756('0x73')));_0xfc694e['use'](_0x2756('0x74'),require(_0x2756('0x75')));_0xfc694e[_0x2756('0x9')](_0x2756('0x76'),require(_0x2756('0x77')));_0xfc694e[_0x2756('0x9')](_0x2756('0x78'),require(_0x2756('0x79')));_0xfc694e[_0x2756('0x9')](_0x2756('0x7a'),require('./api/cmHopperHistory'));_0xfc694e[_0x2756('0x9')](_0x2756('0x7b'),require('./api/cmCustomField'));_0xfc694e[_0x2756('0x9')](_0x2756('0x7c'),require(_0x2756('0x7d')));_0xfc694e[_0x2756('0x9')](_0x2756('0x7e'),require(_0x2756('0x7f')));_0xfc694e[_0x2756('0x9')]('/api/canned_answers',require(_0x2756('0x80')));_0xfc694e[_0x2756('0x9')](_0x2756('0x81'),require(_0x2756('0x82')));_0xfc694e[_0x2756('0x9')]('/api/conditions',require(_0x2756('0x83')));_0xfc694e[_0x2756('0x9')](_0x2756('0x84'),require(_0x2756('0x85')));_0xfc694e[_0x2756('0x9')]('/api/pauses',require(_0x2756('0x86')));_0xfc694e[_0x2756('0x9')](_0x2756('0x87'),require('./api/cdr'));_0xfc694e[_0x2756('0x9')]('/api/voiceQueuesLog',require(_0x2756('0x88')));_0xfc694e[_0x2756('0x9')](_0x2756('0x89'),require(_0x2756('0x8a')));_0xfc694e[_0x2756('0x9')](_0x2756('0x8b'),require(_0x2756('0x8c')));_0xfc694e[_0x2756('0x9')](_0x2756('0x8d'),require('./api/tag'));_0xfc694e[_0x2756('0x9')](_0x2756('0x8e'),require('./api/template'));_0xfc694e[_0x2756('0x9')]('/api/triggers',require(_0x2756('0x8f')));_0xfc694e['use'](_0x2756('0x90'),require('./api/variable'));_0xfc694e[_0x2756('0x9')](_0x2756('0x91'),require(_0x2756('0x92')));_0xfc694e['use']('/api/integrations/reports',require(_0x2756('0x93')));_0xfc694e['use'](_0x2756('0x94'),require(_0x2756('0x95')));_0xfc694e[_0x2756('0x9')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0xfc694e['use'](_0x2756('0x96'),require(_0x2756('0x97')));_0xfc694e['use'](_0x2756('0x98'),require(_0x2756('0x99')));_0xfc694e[_0x2756('0x9')](_0x2756('0x9a'),require(_0x2756('0x9b')));_0xfc694e['use'](_0x2756('0x9c'),require(_0x2756('0x9d')));_0xfc694e['use'](_0x2756('0x9e'),require('./api/intSalesforceAccount'));_0xfc694e[_0x2756('0x9')](_0x2756('0x9f'),require('./api/intSalesforceConfiguration'));_0xfc694e[_0x2756('0x9')](_0x2756('0xa0'),require(_0x2756('0xa1')));_0xfc694e[_0x2756('0x9')](_0x2756('0xa2'),require(_0x2756('0xa3')));_0xfc694e[_0x2756('0x9')](_0x2756('0xa4'),require(_0x2756('0xa5')));_0xfc694e[_0x2756('0x9')](_0x2756('0xa6'),require(_0x2756('0xa7')));_0xfc694e[_0x2756('0x9')]('/api/integrations/desk/accounts',require(_0x2756('0xa8')));_0xfc694e[_0x2756('0x9')](_0x2756('0xa9'),require(_0x2756('0xaa')));_0xfc694e[_0x2756('0x9')](_0x2756('0xab'),require(_0x2756('0xac')));_0xfc694e[_0x2756('0x9')](_0x2756('0xad'),require(_0x2756('0xae')));_0xfc694e[_0x2756('0x9')](_0x2756('0xaf'),require(_0x2756('0xb0')));_0xfc694e[_0x2756('0x9')](_0x2756('0xb1'),require(_0x2756('0xb2')));_0xfc694e[_0x2756('0x9')](_0x2756('0xb3'),require(_0x2756('0xb4')));_0xfc694e['use'](_0x2756('0xb5'),require('./api/intZendeskConfiguration'));_0xfc694e[_0x2756('0x9')](_0x2756('0xb6'),require(_0x2756('0xb7')));_0xfc694e[_0x2756('0x9')](_0x2756('0xb8'),require(_0x2756('0xb9')));_0xfc694e[_0x2756('0x9')](_0x2756('0xba'),require(_0x2756('0xbb')));_0xfc694e[_0x2756('0x9')](_0x2756('0xbc'),require(_0x2756('0xbd')));_0xfc694e[_0x2756('0x9')](_0x2756('0xbe'),require(_0x2756('0xbf')));_0xfc694e[_0x2756('0x9')](_0x2756('0xc0'),require('./api/intVtigerConfiguration'));_0xfc694e[_0x2756('0x9')]('/api/integrations/vtiger/fields',require(_0x2756('0xc1')));_0xfc694e[_0x2756('0x9')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0xfc694e[_0x2756('0x9')](_0x2756('0xc2'),require('./api/intServicenowConfiguration'));_0xfc694e['use'](_0x2756('0xc3'),require(_0x2756('0xc4')));_0xfc694e['use'](_0x2756('0xc5'),require(_0x2756('0xc6')));_0xfc694e[_0x2756('0x9')](_0x2756('0xc7'),require(_0x2756('0xc8')));_0xfc694e[_0x2756('0x9')](_0x2756('0xc9'),require(_0x2756('0xca')));_0xfc694e[_0x2756('0x9')](_0x2756('0xcb'),require(_0x2756('0xcc')));_0xfc694e['use'](_0x2756('0xcd'),require(_0x2756('0xce')));_0xfc694e[_0x2756('0x9')](_0x2756('0xcf'),require(_0x2756('0xd0')));_0xfc694e['use']('/api/networks',require(_0x2756('0xd1')));_0xfc694e['use'](_0x2756('0xd2'),require(_0x2756('0xd3')));_0xfc694e[_0x2756('0x9')](_0x2756('0xd4'),require(_0x2756('0xd5')));_0xfc694e['use'](_0x2756('0xd6'),require(_0x2756('0xd7')));_0xfc694e[_0x2756('0x9')](_0x2756('0xd8'),require(_0x2756('0xd9')));_0xfc694e[_0x2756('0x9')](_0x2756('0xda'),require(_0x2756('0xdb')));_0xfc694e['use'](_0x2756('0xdc'),require(_0x2756('0xdd')));_0xfc694e[_0x2756('0x9')](_0x2756('0xde'),require(_0x2756('0xdf')));_0xfc694e[_0x2756('0x9')](_0x2756('0xe0'),require('./api/squareReportDetail'));_0xfc694e[_0x2756('0x9')]('/api/jscripty/projects',require(_0x2756('0xe1')));_0xfc694e[_0x2756('0x9')](_0x2756('0xe2'),require(_0x2756('0xe3')));_0xfc694e[_0x2756('0x9')](_0x2756('0xe4'),require(_0x2756('0xe5')));_0xfc694e[_0x2756('0x9')](_0x2756('0xe6'),require('./api/squareProject'));_0xfc694e[_0x2756('0x9')](_0x2756('0xe7'),require(_0x2756('0xe8')));_0xfc694e[_0x2756('0x9')](_0x2756('0xe9'),require(_0x2756('0xea')));_0xfc694e[_0x2756('0x9')](_0x2756('0xeb'),require(_0x2756('0xec')));_0xfc694e[_0x2756('0x9')](_0x2756('0xed'),require(_0x2756('0xee')));_0xfc694e[_0x2756('0x9')](_0x2756('0xef'),require('./api/campaign'));_0xfc694e['use'](_0x2756('0xf0'),require(_0x2756('0xf1')));_0xfc694e[_0x2756('0x9')](_0x2756('0xf2'),require('./api/attachment'));_0xfc694e[_0x2756('0x9')]('/api/plugins',require('./api/plugin'));_0xfc694e[_0x2756('0x9')](_0x2756('0xf3'),require(_0x2756('0xf4')));_0xfc694e[_0x2756('0x9')](_0x2756('0xf5'),require(_0x2756('0xf6')));_0xfc694e[_0x2756('0x9')](_0x2756('0xf7'),require(_0x2756('0xf8')));_0xfc694e[_0x2756('0x9')]('/api/openchannel/reports/transfer',require(_0x2756('0xf9')));_0xfc694e[_0x2756('0x9')](_0x2756('0xfa'),require(_0x2756('0xfb')));_0xfc694e['use'](_0x2756('0xfc'),require(_0x2756('0xfd')));_0xfc694e[_0x2756('0x9')](_0x2756('0xfe'),require('./api/voicePrefix'));_0xfc694e[_0x2756('0x9')](_0x2756('0xff'),require(_0x2756('0x100')));_0xfc694e[_0x2756('0x9')](_0x2756('0x101'),require(_0x2756('0x102')));_0xfc694e[_0x2756('0x9')](_0x2756('0x103'),require(_0x2756('0x104')));_0xfc694e[_0x2756('0x9')]('/api/userNotifications',require(_0x2756('0x105')));_0xfc694e['use']('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0xfc694e[_0x2756('0x9')](_0x2756('0x106'),require('./api/whatsappApplication'));_0xfc694e[_0x2756('0x9')](_0x2756('0x107'),require(_0x2756('0x108')));_0xfc694e[_0x2756('0x9')](_0x2756('0x109'),require(_0x2756('0x10a')));_0xfc694e[_0x2756('0x9')]('/api/whatsapp/reports/queue',require(_0x2756('0x10b')));_0xfc694e[_0x2756('0x9')](_0x2756('0x10c'),require(_0x2756('0x10d')));_0xfc694e[_0x2756('0x9')](_0x2756('0x10e'),require('./api/whatsappQueue'));_0xfc694e['use'](_0x2756('0x10f'),require(_0x2756('0x110')));_0xfc694e[_0x2756('0x9')](_0x2756('0x111'),require(_0x2756('0x112')));_0xfc694e[_0x2756('0x9')](_0x2756('0x113'),require('./api/authLocal'));_0xfc694e[_0x2756('0x9')](_0x2756('0x114'),require(_0x2756('0x115')));_0xfc694e[_0x2756('0x9')]('/api/jira',require('./api/jira'));_0xfc694e[_0x2756('0x9')](_0x2756('0x116'),require('./api/rpc'));_0xfc694e[_0x2756('0x9')](_0x2756('0x117'),require(_0x2756('0x118')));_0xfc694e[_0x2756('0x9')](_0x2756('0x119'),require(_0x2756('0x11a')));_0xfc694e[_0x2756('0x9')](_0x2756('0x11b'),require(_0x2756('0x11c')));_0xfc694e[_0x2756('0x9')](_0x2756('0x11d'),require(_0x2756('0x11e')));_0xfc694e['use'](_0x2756('0x11f'),express[_0x2756('0x120')](path['join'](config[_0x2756('0x121')],_0x2756('0x11f'))));_0xfc694e[_0x2756('0x9')](_0x2756('0x122'),express['static'](path[_0x2756('0x123')](config[_0x2756('0x121')],'/www')));_0xfc694e[_0x2756('0x9')](_0x2756('0x124'),express[_0x2756('0x120')](path[_0x2756('0x123')](config[_0x2756('0x121')],_0x2756('0x124'))));_0xfc694e[_0x2756('0x9')](_0x2756('0x125'),express[_0x2756('0x120')](path[_0x2756('0x123')](config[_0x2756('0x121')],'snippet','3.0.0')));_0xfc694e['use'](_0x2756('0x126'),express['static'](path[_0x2756('0x123')](config[_0x2756('0x121')],'/server/files/plugins')));_0xfc694e[_0x2756('0x127')](_0x2756('0x128'))[_0x2756('0x129')](errors[0x194]);_0xfc694e[_0x2756('0x127')]('/*')[_0x2756('0x129')](function(_0x3ed91c,_0x527f3f){_0x527f3f['sendFile'](path[_0x2756('0x12a')](_0xfc694e[_0x2756('0x129')](_0x2756('0x12b'))+_0x2756('0x12c')));});};var sensitiveFields=[_0x2756('0x12d'),_0x2756('0x12e'),_0x2756('0x12f'),'apiKey',_0x2756('0x130'),_0x2756('0x131'),'street',_0x2756('0x132'),'mobile',_0x2756('0x133'),'email',_0x2756('0x134'),_0x2756('0x135'),_0x2756('0x136'),_0x2756('0x137'),_0x2756('0x138'),_0x2756('0x139'),'token',_0x2756('0x13a'),_0x2756('0x13b'),'accessTokenSecret','authToken',_0x2756('0x13c'),'consumerSecret',_0x2756('0x13d'),_0x2756('0x13e'),'calleridnum',_0x2756('0x13f'),_0x2756('0x140'),_0x2756('0x141'),_0x2756('0x142'),'accesskeyid','secretaccesskey',_0x2756('0x143'),_0x2756('0x18'),_0x2756('0x144'),_0x2756('0x145'),_0x2756('0x146'),'dsn',_0x2756('0x147'),_0x2756('0x148'),_0x2756('0x149')];function maskSensitiveData(_0x33dda7){var _0x5dfbce=/(?!^)[\s\S](?!$)/g;if(!_[_0x2756('0x14a')](_0x33dda7))return;for(var _0x3bbdd9 in _0x33dda7){if(_[_0x2756('0x14b')](_0x33dda7[_0x3bbdd9])){for(var _0x379ed1=0x0;_0x379ed1<_0x33dda7[_0x3bbdd9]['length'];_0x379ed1++){maskSensitiveData(_0x33dda7[_0x3bbdd9][_0x379ed1]);}}else if(_[_0x2756('0x14a')](_0x33dda7[_0x3bbdd9])){maskSensitiveData(_0x33dda7[_0x3bbdd9]);}else if(_[_0x2756('0x14c')](_0x33dda7[_0x3bbdd9])){_0x33dda7[_0x3bbdd9]=_0x33dda7[_0x3bbdd9][_0x2756('0x14d')](/{{{/g,_0x2756('0x14e'))[_0x2756('0x14d')](/}}}/g,_0x2756('0x14f'))[_0x2756('0x14d')](/{{/g,'@{')[_0x2756('0x14d')](/}}/g,'}@');if(_[_0x2756('0x150')](sensitiveFields,_0x3bbdd9)){_0x33dda7[_0x3bbdd9]=_0x33dda7[_0x3bbdd9][_0x2756('0x14d')](_0x5dfbce,'*');}}}} \ No newline at end of file +var _0x030f=['./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/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/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','./api/system','/api/pm2','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','username','password','street','mobile','fax','code','accessKey','channelSecret','accessToken','authToken','consumerKey','consumerSecret','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret','isPlainObject','isArray','isString','replace','includes','lodash','path','express','express-winston','util','./config/environment','api','./config/logger','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','statusCode','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs'];(function(_0x58a333,_0x2092b8){var _0x539d9a=function(_0x12dc75){while(--_0x12dc75){_0x58a333['push'](_0x58a333['shift']());}};_0x539d9a(++_0x2092b8);}(_0x030f,0x10e));var _0xf030=function(_0x3a9f3a,_0x4a06d2){_0x3a9f3a=_0x3a9f3a-0x0;var _0x18eb25=_0x030f[_0x3a9f3a];return _0x18eb25;};'use strict';var _=require(_0xf030('0x0'));var path=require(_0xf030('0x1'));var express=require(_0xf030('0x2'));var ewinston=require(_0xf030('0x3'));var util=require(_0xf030('0x4'));var errors=require('./errors');var config=require(_0xf030('0x5'));var logger=require('./config/logger')(_0xf030('0x6'));var authLogger=require(_0xf030('0x7'))(_0xf030('0x8'));exports[_0xf030('0x9')]=function(_0x4b9759){_0x4b9759[_0xf030('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xd1bca9,_0x237b60){var _0x40d066=_0xf030('0xb');if(!_['isEmpty'](_0xd1bca9[_0xf030('0xc')])){_0x40d066+=_0xf030('0xd');var _0x17a9d7=_0xd1bca9[_0xf030('0xc')];maskSensitiveData(_0x17a9d7);}return util['format'](_0x40d066,_0xd1bca9['method'],_0xd1bca9[_0xf030('0xe')][_0xf030('0xf')]?_0xd1bca9[_0xf030('0xe')]['x-forwarded-for']:_0xd1bca9[_0xf030('0x10')][_0xf030('0x11')]||_0xd1bca9['ip'],_0xd1bca9[_0xf030('0x12')],_0x237b60['statusCode'],_0x237b60[_0xf030('0x13')],_0xd1bca9[_0xf030('0x14')]?_0xd1bca9[_0xf030('0x14')]['id']:null,_0xd1bca9['user']?_0xd1bca9[_0xf030('0x14')][_0xf030('0x15')]:null,_0xd1bca9['user']?_0xd1bca9[_0xf030('0x14')][_0xf030('0x16')]:null,_0x17a9d7?util[_0xf030('0x17')](_0x17a9d7,![],null):'');}}));_0x4b9759[_0xf030('0xa')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x39bdae,_0x31deb3){var _0x3c0efe=_0xf030('0x18');if(_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body'][_0xf030('0x19')]&&_0x39bdae[_0xf030('0xc')]['agent_id']){_0x3c0efe=_0xf030('0x1a');}return util['format'](_0x3c0efe,_0x39bdae[_0xf030('0x1b')],_0x39bdae['headers'][_0xf030('0xf')]?_0x39bdae[_0xf030('0xe')]['x-forwarded-for']:_0x39bdae[_0xf030('0x10')][_0xf030('0x11')]||_0x39bdae['ip'],_0x39bdae['url'],_0x31deb3[_0xf030('0x1c')],_0x31deb3['responseTime'],_0x39bdae[_0xf030('0x14')]?_0x39bdae[_0xf030('0x14')]['id']:null,_0x39bdae['user']?_0x39bdae[_0xf030('0x14')][_0xf030('0x15')]:null,_0x39bdae[_0xf030('0x14')]?_0x39bdae[_0xf030('0x14')][_0xf030('0x16')]:null,_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body'][_0xf030('0x19')]?_0x39bdae[_0xf030('0xc')][_0xf030('0x19')]:_0xf030('0x1d'),_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body']['agent_id']?_0x39bdae[_0xf030('0xc')][_0xf030('0x1e')]:'',_0x39bdae[_0xf030('0xc')]&&_0x39bdae[_0xf030('0xc')]['agent_name']?_0x39bdae[_0xf030('0xc')][_0xf030('0x1f')]:'');},'ignoreRoute':function(_0x13b520){var _0x111b30=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x111b30['test'](_0x13b520[_0xf030('0x12')]);}}));_0x4b9759['use'](_0xf030('0x20'),require(_0xf030('0x21')));_0x4b9759['use'](_0xf030('0x22'),require(_0xf030('0x23')));_0x4b9759[_0xf030('0xa')](_0xf030('0x24'),require(_0xf030('0x25')));_0x4b9759['use']('/api/voice/extensions',require(_0xf030('0x26')));_0x4b9759[_0xf030('0xa')](_0xf030('0x27'),require(_0xf030('0x28')));_0x4b9759['use']('/api/voice/queues',require('./api/voiceQueue'));_0x4b9759['use'](_0xf030('0x29'),require(_0xf030('0x2a')));_0x4b9759[_0xf030('0xa')](_0xf030('0x2b'),require(_0xf030('0x2c')));_0x4b9759[_0xf030('0xa')]('/api/voice/mails',require(_0xf030('0x2d')));_0x4b9759[_0xf030('0xa')](_0xf030('0x2e'),require(_0xf030('0x2f')));_0x4b9759[_0xf030('0xa')](_0xf030('0x30'),require('./api/voiceCallReport'));_0x4b9759['use'](_0xf030('0x31'),require(_0xf030('0x32')));_0x4b9759['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x4b9759['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x33'),require('./api/memberReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x34'),require(_0xf030('0x35')));_0x4b9759[_0xf030('0xa')](_0xf030('0x36'),require(_0xf030('0x37')));_0x4b9759['use']('/api/mail/out_servers',require(_0xf030('0x38')));_0x4b9759['use'](_0xf030('0x39'),require(_0xf030('0x3a')));_0x4b9759['use']('/api/mail/queues',require(_0xf030('0x3b')));_0x4b9759['use'](_0xf030('0x3c'),require(_0xf030('0x3d')));_0x4b9759[_0xf030('0xa')](_0xf030('0x3e'),require(_0xf030('0x3f')));_0x4b9759[_0xf030('0xa')](_0xf030('0x40'),require(_0xf030('0x41')));_0x4b9759[_0xf030('0xa')](_0xf030('0x42'),require(_0xf030('0x43')));_0x4b9759['use'](_0xf030('0x44'),require(_0xf030('0x45')));_0x4b9759['use'](_0xf030('0x46'),require(_0xf030('0x47')));_0x4b9759[_0xf030('0xa')](_0xf030('0x48'),require(_0xf030('0x49')));_0x4b9759['use']('/api/fax/accounts',require(_0xf030('0x4a')));_0x4b9759['use'](_0xf030('0x4b'),require(_0xf030('0x4c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x4d'),require(_0xf030('0x4e')));_0x4b9759['use'](_0xf030('0x4f'),require(_0xf030('0x50')));_0x4b9759[_0xf030('0xa')](_0xf030('0x51'),require(_0xf030('0x52')));_0x4b9759[_0xf030('0xa')](_0xf030('0x53'),require('./api/faxQueueReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x54'),require('./api/smsAccount'));_0x4b9759['use'](_0xf030('0x55'),require(_0xf030('0x56')));_0x4b9759['use'](_0xf030('0x57'),require('./api/smsInteraction'));_0x4b9759[_0xf030('0xa')](_0xf030('0x58'),require(_0xf030('0x59')));_0x4b9759['use'](_0xf030('0x5a'),require(_0xf030('0x5b')));_0x4b9759[_0xf030('0xa')](_0xf030('0x5c'),require('./api/openchannelAccount'));_0x4b9759['use'](_0xf030('0x5d'),require(_0xf030('0x5e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x5f'),require(_0xf030('0x60')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/messages',require(_0xf030('0x61')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/queues',require(_0xf030('0x62')));_0x4b9759[_0xf030('0xa')](_0xf030('0x63'),require('./api/chatWebsite'));_0x4b9759[_0xf030('0xa')](_0xf030('0x64'),require('./api/openchannelQueueReport'));_0x4b9759['use'](_0xf030('0x65'),require(_0xf030('0x66')));_0x4b9759[_0xf030('0xa')]('/api/chat/interactions',require('./api/chatInteraction'));_0x4b9759['use']('/api/chat/messages',require(_0xf030('0x67')));_0x4b9759[_0xf030('0xa')](_0xf030('0x68'),require('./api/chatOfflineMessage'));_0x4b9759[_0xf030('0xa')](_0xf030('0x69'),require('./api/chatQueue'));_0x4b9759['use'](_0xf030('0x6a'),require('./api/chatGroup'));_0x4b9759[_0xf030('0xa')](_0xf030('0x6b'),require(_0xf030('0x6c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x6d'),require('./api/cmCompany'));_0x4b9759[_0xf030('0xa')](_0xf030('0x6e'),require('./api/cmContact'));_0x4b9759['use'](_0xf030('0x6f'),require('./api/cmHopper'));_0x4b9759['use'](_0xf030('0x70'),require(_0xf030('0x71')));_0x4b9759['use'](_0xf030('0x72'),require(_0xf030('0x73')));_0x4b9759[_0xf030('0xa')](_0xf030('0x74'),require('./api/cmHopperHistory'));_0x4b9759[_0xf030('0xa')](_0xf030('0x75'),require(_0xf030('0x76')));_0x4b9759[_0xf030('0xa')](_0xf030('0x77'),require('./api/action'));_0x4b9759['use'](_0xf030('0x78'),require(_0xf030('0x79')));_0x4b9759['use'](_0xf030('0x7a'),require(_0xf030('0x7b')));_0x4b9759[_0xf030('0xa')](_0xf030('0x7c'),require('./api/disposition'));_0x4b9759[_0xf030('0xa')]('/api/conditions',require('./api/condition'));_0x4b9759[_0xf030('0xa')](_0xf030('0x7d'),require(_0xf030('0x7e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x7f'),require('./api/pause'));_0x4b9759['use'](_0xf030('0x80'),require('./api/cdr'));_0x4b9759[_0xf030('0xa')](_0xf030('0x81'),require(_0xf030('0x82')));_0x4b9759[_0xf030('0xa')](_0xf030('0x83'),require(_0xf030('0x84')));_0x4b9759[_0xf030('0xa')]('/api/sounds',require(_0xf030('0x85')));_0x4b9759[_0xf030('0xa')](_0xf030('0x86'),require(_0xf030('0x87')));_0x4b9759[_0xf030('0xa')](_0xf030('0x88'),require('./api/template'));_0x4b9759[_0xf030('0xa')]('/api/triggers',require(_0xf030('0x89')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8a'),require(_0xf030('0x8b')));_0x4b9759[_0xf030('0xa')]('/api/integrations',require(_0xf030('0x8c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8d'),require(_0xf030('0x8e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8f'),require('./api/analyticCustomReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x90'),require('./api/analyticDefaultReport'));_0x4b9759['use'](_0xf030('0x91'),require(_0xf030('0x92')));_0x4b9759[_0xf030('0xa')]('/api/analytics/metrics',require(_0xf030('0x93')));_0x4b9759[_0xf030('0xa')](_0xf030('0x94'),require(_0xf030('0x95')));_0x4b9759[_0xf030('0xa')](_0xf030('0x96'),require(_0xf030('0x97')));_0x4b9759[_0xf030('0xa')](_0xf030('0x98'),require(_0xf030('0x99')));_0x4b9759[_0xf030('0xa')](_0xf030('0x9a'),require('./api/intSalesforceConfiguration'));_0x4b9759[_0xf030('0xa')](_0xf030('0x9b'),require(_0xf030('0x9c')));_0x4b9759[_0xf030('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xf030('0x9d')));_0x4b9759['use']('/api/integrations/sugarcrm/configurations',require(_0xf030('0x9e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x9f'),require(_0xf030('0xa0')));_0x4b9759[_0xf030('0xa')](_0xf030('0xa1'),require(_0xf030('0xa2')));_0x4b9759['use'](_0xf030('0xa3'),require('./api/intDeskConfiguration'));_0x4b9759['use'](_0xf030('0xa4'),require('./api/intDeskField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xa5'),require(_0xf030('0xa6')));_0x4b9759[_0xf030('0xa')]('/api/integrations/zoho/configurations',require(_0xf030('0xa7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xa8'),require(_0xf030('0xa9')));_0x4b9759[_0xf030('0xa')](_0xf030('0xaa'),require(_0xf030('0xab')));_0x4b9759[_0xf030('0xa')](_0xf030('0xac'),require(_0xf030('0xad')));_0x4b9759[_0xf030('0xa')](_0xf030('0xae'),require(_0xf030('0xaf')));_0x4b9759[_0xf030('0xa')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb0'),require(_0xf030('0xb1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xb2'),require(_0xf030('0xb3')));_0x4b9759['use'](_0xf030('0xb4'),require('./api/intVtigerAccount'));_0x4b9759[_0xf030('0xa')]('/api/integrations/vtiger/configurations',require(_0xf030('0xb5')));_0x4b9759[_0xf030('0xa')](_0xf030('0xb6'),require('./api/intVtigerField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb7'),require(_0xf030('0xb8')));_0x4b9759['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb9'),require(_0xf030('0xba')));_0x4b9759['use'](_0xf030('0xbb'),require(_0xf030('0xbc')));_0x4b9759[_0xf030('0xa')]('/api/integrations/dynamics365/configurations',require(_0xf030('0xbd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xbe'),require('./api/intDynamics365Field'));_0x4b9759[_0xf030('0xa')](_0xf030('0xbf'),require('./api/intFreshsalesAccount'));_0x4b9759['use']('/api/integrations/freshsales/configurations',require(_0xf030('0xc0')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc1'),require('./api/intFreshsalesField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xc2'),require(_0xf030('0xc3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc4'),require(_0xf030('0xc5')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc6'),require(_0xf030('0xc7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc8'),require('./api/jscriptyAnswerReport'));_0x4b9759['use'](_0xf030('0xc9'),require(_0xf030('0xca')));_0x4b9759['use']('/api/jscripty/sessions/reports',require(_0xf030('0xcb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xcc'),require('./api/smsQueueReport'));_0x4b9759['use'](_0xf030('0xcd'),require(_0xf030('0xce')));_0x4b9759['use'](_0xf030('0xcf'),require(_0xf030('0xd0')));_0x4b9759[_0xf030('0xa')]('/api/jscripty/projects',require(_0xf030('0xd1')));_0x4b9759['use'](_0xf030('0xd2'),require('./api/setting'));_0x4b9759['use'](_0xf030('0xd3'),require('./api/squareOdbc'));_0x4b9759['use'](_0xf030('0xd4'),require('./api/squareProject'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd5'),require('./api/squareRecording'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd6'),require('./api/squareMessage'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd7'),require(_0xf030('0xd8')));_0x4b9759[_0xf030('0xa')]('/api/license',require('./api/license'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd9'),require('./api/campaign'));_0x4b9759[_0xf030('0xa')](_0xf030('0xda'),require(_0xf030('0xdb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xdc'),require(_0xf030('0xdd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xde'),require(_0xf030('0xdf')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe0'),require(_0xf030('0xe1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe2'),require(_0xf030('0xe3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe4'),require(_0xf030('0xe5')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/reports/transfer',require(_0xf030('0xe6')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe7'),require(_0xf030('0xe8')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe9'),require(_0xf030('0xea')));_0x4b9759['use'](_0xf030('0xeb'),require(_0xf030('0xec')));_0x4b9759[_0xf030('0xa')](_0xf030('0xed'),require(_0xf030('0xee')));_0x4b9759[_0xf030('0xa')](_0xf030('0xef'),require(_0xf030('0xf0')));_0x4b9759[_0xf030('0xa')]('/api/userProfile/resources',require(_0xf030('0xf1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf2'),require(_0xf030('0xf3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf4'),require(_0xf030('0xf5')));_0x4b9759['use']('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x4b9759[_0xf030('0xa')](_0xf030('0xf6'),require(_0xf030('0xf7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf8'),require(_0xf030('0xf9')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfa'),require(_0xf030('0xfb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfc'),require(_0xf030('0xfd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfe'),require(_0xf030('0xff')));_0x4b9759[_0xf030('0xa')](_0xf030('0x100'),require(_0xf030('0x101')));_0x4b9759['use'](_0xf030('0x102'),require('./api/realtime'));_0x4b9759[_0xf030('0xa')](_0xf030('0x103'),require(_0xf030('0x104')));_0x4b9759[_0xf030('0xa')]('/api/auth/google',require(_0xf030('0x105')));_0x4b9759[_0xf030('0xa')](_0xf030('0x106'),require(_0xf030('0x107')));_0x4b9759['use']('/api/rpc',require('./api/rpc'));_0x4b9759['use']('/api/version',require('./api/version'));_0x4b9759[_0xf030('0xa')]('/api/system',require(_0xf030('0x108')));_0x4b9759[_0xf030('0xa')](_0xf030('0x109'),require('./api/pm2'));_0x4b9759[_0xf030('0xa')]('/api/webbar',require('./api/webbar'));_0x4b9759[_0xf030('0xa')](_0xf030('0x10a'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config['root'],'/apidoc')));_0x4b9759[_0xf030('0xa')]('/www',express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x10e'))));_0x4b9759[_0xf030('0xa')](_0xf030('0x10f'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x10f'))));_0x4b9759[_0xf030('0xa')]('/snippet',express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x110'),_0xf030('0x111'))));_0x4b9759[_0xf030('0xa')](_0xf030('0x112'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x113'))));_0x4b9759[_0xf030('0x114')](_0xf030('0x115'))[_0xf030('0x116')](errors[0x194]);_0x4b9759['route']('/*')['get'](function(_0x581909,_0x27574a){_0x27574a[_0xf030('0x117')](path[_0xf030('0x118')](_0x4b9759['get']('appPath')+'/index.html'));});};var sensitiveFields=[_0xf030('0x119'),_0xf030('0x11a'),'newPassword','apiKey','firstName','lastName',_0xf030('0x11b'),'phone',_0xf030('0x11c'),_0xf030('0x11d'),'email','clientId','clientSecret','securityToken',_0xf030('0x11e'),_0xf030('0x11f'),'tenantId','token',_0xf030('0x120'),_0xf030('0x121'),'accessTokenSecret',_0xf030('0x122'),_0xf030('0x123'),_0xf030('0x124'),'membername','calleridname',_0xf030('0x125'),_0xf030('0x126'),_0xf030('0x127'),_0xf030('0x128'),_0xf030('0x129'),_0xf030('0x12a'),_0xf030('0x12b'),_0xf030('0x12c'),_0xf030('0x14'),'pass',_0xf030('0x12d'),_0xf030('0x12e'),_0xf030('0x12f'),_0xf030('0x130'),'registry','oldPassword'];function maskSensitiveData(_0x37c3fb){var _0x8753a5=/(?!^)[\s\S](?!$)/g;if(!_[_0xf030('0x131')](_0x37c3fb))return;for(var _0x2c5d5d in _0x37c3fb){if(_[_0xf030('0x132')](_0x37c3fb[_0x2c5d5d])){for(var _0x678d1e=0x0;_0x678d1e<_0x37c3fb[_0x2c5d5d]['length'];_0x678d1e++){maskSensitiveData(_0x37c3fb[_0x2c5d5d][_0x678d1e]);}}else if(_['isPlainObject'](_0x37c3fb[_0x2c5d5d])){maskSensitiveData(_0x37c3fb[_0x2c5d5d]);}else if(_[_0xf030('0x133')](_0x37c3fb[_0x2c5d5d])){_0x37c3fb[_0x2c5d5d]=_0x37c3fb[_0x2c5d5d][_0xf030('0x134')](/{{{/g,'@@{')[_0xf030('0x134')](/}}}/g,'}@@')[_0xf030('0x134')](/{{/g,'@{')[_0xf030('0x134')](/}}/g,'}@');if(_[_0xf030('0x135')](sensitiveFields,_0x2c5d5d)){_0x37c3fb[_0x2c5d5d]=_0x37c3fb[_0x2c5d5d][_0xf030('0x134')](_0x8753a5,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d789425..c6a8582 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x898e=['../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/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.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','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x898e,0x11c));var _0xe898=function(_0x25163c,_0x2d53bc){_0x25163c=_0x25163c-0x0;var _0x389f93=_0x898e[_0x25163c];return _0x389f93;};'use strict';var jayson=require(_0xe898('0x0'));var BPromise=require('bluebird');var _=require(_0xe898('0x1'));var config=require(_0xe898('0x2'));exports[_0xe898('0x3')]=function(){return new BPromise(function(_0x53908d,_0x5bcd1b){var _0x44b2de={};_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x5')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x6')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x7')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x8')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x9')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0xa')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0xb')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0xc')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0xd')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0xe')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0xf')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x10')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x11')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x12')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x13')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x14')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x15')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x16')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x17')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x18')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x19')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/faxMessage/faxMessage.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x1a')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x1b')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x1c')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x1d')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/smsQueue/smsQueue.rpc'));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x1e')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x1f')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x20')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x21')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x22')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x23')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x24')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/chatQueue/chatQueue.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x25')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x26')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x27')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x28')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x29')));_0x44b2de=_['merge'](_0x44b2de,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/interval/interval.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2a')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2b')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2c')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2d')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/variable/variable.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2e')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x2f')));_0x44b2de=_['merge'](_0x44b2de,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x30')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x31')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x32')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x33')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x34')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x35')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x36')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x37')));_0x44b2de=_['merge'](_0x44b2de,require('../api/squareReport/squareReport.rpc'));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x38')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x39')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/squareOdbc/squareOdbc.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x3a')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x3b')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x3c')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x3d')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/attachment/attachment.rpc'));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x3e')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x3f')));_0x44b2de=_['merge'](_0x44b2de,require(_0xe898('0x40')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x41')));_0x44b2de=_[_0xe898('0x4')](_0x44b2de,require(_0xe898('0x42')));var _0x94d713=jayson[_0xe898('0x43')](_0x44b2de)[_0xe898('0x44')]();var _0x5258a7=config[_0xe898('0x45')][_0xe898('0x46')]||config[_0xe898('0x46')]+0x1;var _0xb64b9=config[_0xe898('0x45')]['ip']||'localhost';_0x94d713['on'](_0xe898('0x47'),function(_0x1d8b9d){return _0x5bcd1b(_0x1d8b9d);});_0x94d713[_0xe898('0x3')](_0x5258a7,_0xb64b9,function(){console[_0xe898('0x48')](_0xe898('0x49'),_0xb64b9,_0x5258a7);require(_0xe898('0x4a'))['default']();return _0x53908d('RPC\x20listening\x20on\x20'+_0xb64b9+':'+_0x5258a7);});});}; \ No newline at end of file +var _0xe25e=['../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.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/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/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/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x574afb,_0x36ad3b){var _0x456cc1=function(_0x5844fb){while(--_0x5844fb){_0x574afb['push'](_0x574afb['shift']());}};_0x456cc1(++_0x36ad3b);}(_0xe25e,0x84));var _0xee25=function(_0x28fcdc,_0x17e930){_0x28fcdc=_0x28fcdc-0x0;var _0x80bd4c=_0xe25e[_0x28fcdc];return _0x80bd4c;};'use strict';var jayson=require(_0xee25('0x0'));var BPromise=require(_0xee25('0x1'));var _=require(_0xee25('0x2'));var config=require(_0xee25('0x3'));exports[_0xee25('0x4')]=function(){return new BPromise(function(_0x44e74e,_0x292bce){var _0x347c26={};_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x6')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x7')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x8')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/voiceRecording/voiceRecording.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x9')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0xa')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xb')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xc')));_0x347c26=_['merge'](_0x347c26,require('../api/trunk/trunk.rpc'));_0x347c26=_['merge'](_0x347c26,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xd')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xe')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xf')));_0x347c26=_['merge'](_0x347c26,require('../api/mailQueue/mailQueue.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/mailInteraction/mailInteraction.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/mailMessage/mailMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x10')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x11')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxAccount/faxAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxApplication/faxApplication.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x12')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxMessage/faxMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x13')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x14')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/smsAccount/smsAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x15')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/smsMessage/smsMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x16')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x17')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x18')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x19')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x1a')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x347c26=_['merge'](_0x347c26,require('../api/chatInteraction/chatInteraction.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1b')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1c')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x1d')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1f')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x20')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x21')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x22')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/interval/interval.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x23')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x24')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x25')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/trigger/trigger.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x26')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x27')));_0x347c26=_['merge'](_0x347c26,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x28')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x29')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2a')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2b')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2c')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2d')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2f')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x30')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x31')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x32')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x33')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x34')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x35')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/squareProject/squareProject.rpc'));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x36')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x37')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x38')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x39')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3a')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3b')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3c')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3d')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3f')));var _0x10c92e=jayson['server'](_0x347c26)[_0xee25('0x40')]();var _0xf80790=config['rpc'][_0xee25('0x41')]||config[_0xee25('0x41')]+0x1;var _0x5a6691=config['rpc']['ip']||_0xee25('0x42');_0x10c92e['on'](_0xee25('0x43'),function(_0x1db7af){return _0x292bce(_0x1db7af);});_0x10c92e[_0xee25('0x4')](_0xf80790,_0x5a6691,function(){console[_0xee25('0x44')](_0xee25('0x45'),_0x5a6691,_0xf80790);require(_0xee25('0x46'))[_0xee25('0x47')]();return _0x44e74e(_0xee25('0x48')+_0x5a6691+':'+_0xf80790);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index dc9414f..7dc360c 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 _0xf47e=['520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substr','indexOf','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','inherits','prototype','sendRequest','command','sync','answer','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xf47e,0x1bf));var _0xef47=function(_0xadd7e9,_0x2a5a4f){_0xadd7e9=_0xadd7e9-0x0;var _0x5c8df9=_0xf47e[_0xadd7e9];return _0x5c8df9;};'use strict';var util=require(_0xef47('0x0'));var _=require(_0xef47('0x1'));var EventEmitter=require('events')[_0xef47('0x2')];var AGIReply=require(_0xef47('0x3'));var AGIError=require(_0xef47('0x4'));function AGIChannel(_0x4a28f7){var _0x7c246c=this,_0x1e5e1f=new AGIReply(),_0xfb58c5=![],_0x23b649={};EventEmitter['call'](_0x7c246c);_0x4a28f7[_0xef47('0x5')](_0xef47('0x6'));_0x4a28f7[_0xef47('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1e5e1f[_0xef47('0x5')](_0xef47('0x6'));_0x1e5e1f['on'](_0xef47('0x8'),function(_0xf7e835){for(var _0x98e8ab in _0xf7e835){_0x7c246c[_0x98e8ab]=_0xf7e835[_0x98e8ab];}_0x7c246c[_0xef47('0x9')](_0xef47('0xa'));});_0x1e5e1f['on'](_0xef47('0xb'),function(_0x25baf5){if(_0x25baf5[_0xef47('0xc')]()==_0xef47('0xd')){_0x7c246c[_0xef47('0x9')](_0xef47('0xd'));return;}if(_0x25baf5[_0xef47('0xe')](0x0,0xb)==_0xef47('0xf')){_0xfb58c5=!![];}if(_0xfb58c5){_0x23b649['rx']+=_0x25baf5+'\x0a';if(_0x25baf5[_0xef47('0x10')](_0xef47('0x11'))!=-0x1){_0xfb58c5=![];}}else{_0x23b649['rx']=_0x25baf5;}if(_0xfb58c5){return;}if(typeof _0x23b649['cb']==_0xef47('0x12')){var _0x5779c8=_0x23b649['rx']['substring'](0x0,0x3),_0x536aa8=null,_0x28666a=null;_0x5779c8=parseInt(_0x5779c8);if(isNaN(_0x5779c8)){_0x23b649['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xef47('0x13')});return;}if(_0x5779c8!=0xc8){_0x23b649['cb'](null,{'code':_0x5779c8,'result':-0x1,'extra':'KO'});return;}_0x536aa8=_0x23b649['rx']['substring'](0x4)['replace']('result=','');if(_0x536aa8['indexOf']('\x20')!=-0x1){_0x536aa8=_0x536aa8[_0xef47('0x14')](0x0,_0x536aa8[_0xef47('0x15')]('\x20'));}if(_[_0xef47('0x16')](_0x536aa8,'-1')){_0x536aa8=parseInt(_0x536aa8);}_0x28666a=_0x23b649['rx'][_0xef47('0x17')]('\x20');if(_0x28666a['length']==0x3){_0x28666a=_0x28666a[0x2][_0xef47('0xe')](0x1,_0x28666a[0x2]['length']-0x1);}else if(_0x28666a[_0xef47('0x18')]>0x3){var _0x5cda37=/\((.+)\)/;var _0x56d864=_0x23b649['rx'][_0xef47('0x19')](_0x5cda37);if(_0x56d864){_0x28666a=_0x56d864[0x1];}else{_0x28666a=null;}}else{_0x28666a=null;}_0x23b649['cb'](null,{'code':_0x5779c8,'result':_0x536aa8,'extra':_0x28666a});}});_0x4a28f7['on'](_0xef47('0x1a'),function(_0x53c355){_0x7c246c['emit'](_0xef47('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x53c355['code']));});_0x4a28f7['on'](_0xef47('0x1b'),function(){_0x7c246c['emit']('close',new AGIError(_0xef47('0x1c')));});_0x4a28f7['on'](_0xef47('0x1d'),function(){_0x7c246c[_0xef47('0x9')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4a28f7[_0xef47('0x1e')]();});_0x4a28f7[_0xef47('0x1f')](_0x1e5e1f);this['command']=function(_0x371ba1,_0x4186f0){var _0x371ba1=_0x371ba1||'',_0x4186f0=typeof _0x4186f0==_0xef47('0x12')?_0x4186f0:new Function();_0x23b649={'tx':_0x371ba1,'rx':'','cb':_0x4186f0};_0x4a28f7['write'](_0x371ba1+'\x0a');},this[_0xef47('0x1b')]=function(){_0x4a28f7['destroy']();};}util[_0xef47('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xef47('0x21')][_0xef47('0x22')]=function(_0x412cad){return this[_0xef47('0x23')][_0xef47('0x24')](this,_0x412cad);};AGIChannel['prototype'][_0xef47('0x25')]=function(){return this[_0xef47('0x22')]('ANSWER');};AGIChannel[_0xef47('0x21')]['getData']=function(_0x4c56e4,_0x50ec7e,_0x22997c){_0x4c56e4=_0x4c56e4===undefined?_0xef47('0x26'):_0x4c56e4;_0x50ec7e=_0x50ec7e===undefined?'5':_0x50ec7e;_0x22997c=_0x22997c===undefined?'1':_0x22997c;return this['sendRequest'](util['format'](_0xef47('0x27'),_0x4c56e4,_0x50ec7e*0x3e8,_0x22997c));};AGIChannel[_0xef47('0x21')][_0xef47('0x28')]=function(_0x517a54){_0x517a54=_0x517a54||_0xef47('0x29');return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x2b'),_0x517a54));};AGIChannel['prototype'][_0xef47('0x2c')]=function(_0x33ba16,_0x28ba06){if(_[_0xef47('0x2d')](_0x28ba06)){return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x2e'),_0x33ba16,_0x28ba06['join'](',')));}return this[_0xef47('0x22')](util[_0xef47('0x2a')]('EXEC\x20%s\x20%s',_0x33ba16,_0x28ba06));};AGIChannel[_0xef47('0x21')][_0xef47('0x2f')]=function(_0x4365ed){return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x30'),_0x4365ed));};AGIChannel['prototype']['setExtension']=function(_0x5dbc49){return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x31'),_0x5dbc49));};AGIChannel[_0xef47('0x21')][_0xef47('0x32')]=function(_0x1a1deb){return this['sendRequest'](util[_0xef47('0x2a')](_0xef47('0x33'),_0x1a1deb));};AGIChannel['prototype'][_0xef47('0xd')]=function(){return this[_0xef47('0x22')]('HANGUP');};AGIChannel['prototype']['setVariable']=function(_0x1557f2,_0xf5d357){var _0x11de0f=_[_0xef47('0x34')](_0xf5d357)||_[_0xef47('0x35')](_0xf5d357)?_0xf5d357[_0xef47('0x36')]():_0xf5d357;return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x37'),_0x1557f2,_0x11de0f?_0x11de0f[_0xef47('0x36')]()[_0xef47('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xef47('0x21')][_0xef47('0x39')]=function(_0x5b9f40,_0x4e5fe1){return this['sendRequest'](util[_0xef47('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x5b9f40,_0x4e5fe1));};AGIChannel[_0xef47('0x21')][_0xef47('0x3a')]=function(_0x1693e5,_0xf09f71){return this['sendRequest'](util['format'](_0xef47('0x3b'),_0x1693e5,_0xf09f71));};AGIChannel[_0xef47('0x21')][_0xef47('0x3c')]=function(_0x9a14b1,_0x56c0ce){return this[_0xef47('0x22')](util['format'](_0xef47('0x3d'),_0x9a14b1,_0x56c0ce));};AGIChannel['prototype'][_0xef47('0x3e')]=function(_0x5a0077,_0x5a3848,_0x542b4e){_0x5a3848=_0x5a3848||this[_0xef47('0x3f')];_0x542b4e=_0x542b4e||0x1;this['setContext'](_0x5a0077);this[_0xef47('0x40')](_0x5a3848);this[_0xef47('0x32')](_0x542b4e);return this[_0xef47('0x28')](util[_0xef47('0x2a')](_0xef47('0x41'),_0x5a0077,_0x5a3848,_0x542b4e));};AGIChannel[_0xef47('0x21')]['getVariable']=function(_0x5852e6){return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x42'),_0x5852e6));};AGIChannel['prototype'][_0xef47('0x43')]=function(_0x18de7d,_0x1d67a1,_0x44a212,_0x2f5fd0,_0x496ba6,_0x1195f6){_0x1d67a1=_0x1d67a1||_0xef47('0x44');_0x44a212=_0x44a212||'';_0x2f5fd0=_0x2f5fd0===undefined?-0x1:_0x2f5fd0==='-1'?-0x1:_0x2f5fd0*0x3e8;_0x496ba6=_0x496ba6===undefined?'':'s='+_0x496ba6;_0x1195f6=_0x1195f6?'BEEP':'';return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x45'),_0x18de7d,_0x1d67a1,_0x44a212,_0x2f5fd0,_0x1195f6,_0x496ba6));};AGIChannel['prototype']['streamFile']=function(_0x217b83,_0x38f373){_0x38f373=_0x38f373||'';return this[_0xef47('0x22')](util[_0xef47('0x2a')](_0xef47('0x46'),_0x217b83,_0x38f373));};AGIChannel[_0xef47('0x21')]['agi']=function(_0x42401b){return this[_0xef47('0x2c')](_0xef47('0x47'),_0x42401b);};AGIChannel[_0xef47('0x21')][_0xef47('0x48')]=function(_0x3e17c9){return this[_0xef47('0x2c')](_0xef47('0x49'),_0x3e17c9);};AGIChannel[_0xef47('0x21')][_0xef47('0x1a')]=function(_0x46b9e3,_0x1be16f){this['noop'](util['format'](_0xef47('0x4a'),_0x46b9e3['id'],_0x46b9e3[_0xef47('0x4b')],_0x1be16f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xef47('0x4c')]=AGIChannel; \ No newline at end of file +var _0xc599=['call','setEncoding','utf8','emit','ready','line','substring','search','function','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','close','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','hangup','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','EventEmitter','./reply','./error'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xc599,0x1b2));var _0x9c59=function(_0x4840f5,_0x5ebb78){_0x4840f5=_0x4840f5-0x0;var _0x2ac1b8=_0xc599[_0x4840f5];return _0x2ac1b8;};'use strict';var util=require('util');var _=require(_0x9c59('0x0'));var EventEmitter=require('events')[_0x9c59('0x1')];var AGIReply=require(_0x9c59('0x2'));var AGIError=require(_0x9c59('0x3'));function AGIChannel(_0x593f93){var _0x2fb8fa=this,_0x129a0c=new AGIReply(),_0x320cb0=![],_0x2f16df={};EventEmitter[_0x9c59('0x4')](_0x2fb8fa);_0x593f93[_0x9c59('0x5')](_0x9c59('0x6'));_0x593f93['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x129a0c['setEncoding'](_0x9c59('0x6'));_0x129a0c['on']('headers',function(_0x1220ad){for(var _0x4b87f2 in _0x1220ad){_0x2fb8fa[_0x4b87f2]=_0x1220ad[_0x4b87f2];}_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x8'));});_0x129a0c['on'](_0x9c59('0x9'),function(_0x120151){if(_0x120151['toLowerCase']()=='hangup'){_0x2fb8fa[_0x9c59('0x7')]('hangup');return;}if(_0x120151[_0x9c59('0xa')](0x0,0xb)=='520-Invalid'){_0x320cb0=!![];}if(_0x320cb0){_0x2f16df['rx']+=_0x120151+'\x0a';if(_0x120151[_0x9c59('0xb')]('520\x20End\x20of\x20proper')!=-0x1){_0x320cb0=![];}}else{_0x2f16df['rx']=_0x120151;}if(_0x320cb0){return;}if(typeof _0x2f16df['cb']==_0x9c59('0xc')){var _0x2cc4f7=_0x2f16df['rx']['substring'](0x0,0x3),_0x40216c=null,_0x5d5320=null;_0x2cc4f7=parseInt(_0x2cc4f7);if(isNaN(_0x2cc4f7)){_0x2f16df['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2cc4f7!=0xc8){_0x2f16df['cb'](null,{'code':_0x2cc4f7,'result':-0x1,'extra':'KO'});return;}_0x40216c=_0x2f16df['rx']['substring'](0x4)['replace'](_0x9c59('0xd'),'');if(_0x40216c[_0x9c59('0xe')]('\x20')!=-0x1){_0x40216c=_0x40216c[_0x9c59('0xf')](0x0,_0x40216c[_0x9c59('0xe')]('\x20'));}if(_['startsWith'](_0x40216c,'-1')){_0x40216c=parseInt(_0x40216c);}_0x5d5320=_0x2f16df['rx'][_0x9c59('0x10')]('\x20');if(_0x5d5320[_0x9c59('0x11')]==0x3){_0x5d5320=_0x5d5320[0x2][_0x9c59('0xa')](0x1,_0x5d5320[0x2]['length']-0x1);}else if(_0x5d5320['length']>0x3){var _0x4d6ca7=/\((.+)\)/;var _0x5c5a86=_0x2f16df['rx'][_0x9c59('0x12')](_0x4d6ca7);if(_0x5c5a86){_0x5d5320=_0x5c5a86[0x1];}else{_0x5d5320=null;}}else{_0x5d5320=null;}_0x2f16df['cb'](null,{'code':_0x2cc4f7,'result':_0x40216c,'extra':_0x5d5320});}});_0x593f93['on'](_0x9c59('0x13'),function(_0x19f372){_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x13'),new AGIError(_0x9c59('0x14'),_0x19f372[_0x9c59('0x15')]));});_0x593f93['on']('close',function(){_0x2fb8fa['emit']('close',new AGIError(_0x9c59('0x16')));});_0x593f93['on'](_0x9c59('0x17'),function(){_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x17'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x593f93[_0x9c59('0x18')]();});_0x593f93['pipe'](_0x129a0c);this[_0x9c59('0x19')]=function(_0x21258d,_0x4dcc88){var _0x21258d=_0x21258d||'',_0x4dcc88=typeof _0x4dcc88==_0x9c59('0xc')?_0x4dcc88:new Function();_0x2f16df={'tx':_0x21258d,'rx':'','cb':_0x4dcc88};_0x593f93[_0x9c59('0x1a')](_0x21258d+'\x0a');},this[_0x9c59('0x1b')]=function(){_0x593f93['destroy']();};}util[_0x9c59('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x9c59('0x1d')][_0x9c59('0x1e')]=function(_0x5e1146){return this[_0x9c59('0x19')][_0x9c59('0x1f')](this,_0x5e1146);};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x20')]=function(){return this['sendRequest'](_0x9c59('0x21'));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x22')]=function(_0x597ffc,_0x1d2e47,_0x27e6b2){_0x597ffc=_0x597ffc===undefined?_0x9c59('0x23'):_0x597ffc;_0x1d2e47=_0x1d2e47===undefined?'5':_0x1d2e47;_0x27e6b2=_0x27e6b2===undefined?'1':_0x27e6b2;return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x597ffc,_0x1d2e47*0x3e8,_0x27e6b2));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x25')]=function(_0x4f497d){_0x4f497d=_0x4f497d||'NO\x20MESSAGE';return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x26'),_0x4f497d));};AGIChannel[_0x9c59('0x1d')]['exec']=function(_0x10b971,_0x25c0ab){if(_[_0x9c59('0x27')](_0x25c0ab)){return this[_0x9c59('0x1e')](util['format'](_0x9c59('0x28'),_0x10b971,_0x25c0ab[_0x9c59('0x29')](',')));}return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x28'),_0x10b971,_0x25c0ab));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2a')]=function(_0x29825e){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x2b'),_0x29825e));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2c')]=function(_0x58745b){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('SET\x20EXTENSION\x20%s',_0x58745b));};AGIChannel['prototype'][_0x9c59('0x2d')]=function(_0x288f12){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('SET\x20PRIORITY\x20%s',_0x288f12));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2e')]=function(){return this['sendRequest'](_0x9c59('0x2f'));};AGIChannel[_0x9c59('0x1d')]['setVariable']=function(_0x145d4c,_0x4d24c4){var _0x2fc643=_[_0x9c59('0x30')](_0x4d24c4)||_['isNumber'](_0x4d24c4)?_0x4d24c4[_0x9c59('0x31')]():_0x4d24c4;return this['sendRequest'](util['format'](_0x9c59('0x32'),_0x145d4c,_0x2fc643?_0x2fc643['toString']()[_0x9c59('0x33')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x490f6e,_0x3c0280){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x34'),_0x490f6e,_0x3c0280));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x35')]=function(_0x493407,_0xeb9134){return this['sendRequest'](util[_0x9c59('0x24')](_0x9c59('0x36'),_0x493407,_0xeb9134));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x37')]=function(_0x2bab4f,_0x10f9fd){return this['sendRequest'](util[_0x9c59('0x24')](_0x9c59('0x38'),_0x2bab4f,_0x10f9fd));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x39')]=function(_0xdb50d8,_0x26195e,_0x550692){_0x26195e=_0x26195e||this[_0x9c59('0x3a')];_0x550692=_0x550692||0x1;this[_0x9c59('0x2a')](_0xdb50d8);this[_0x9c59('0x2c')](_0x26195e);this['setPriority'](_0x550692);return this[_0x9c59('0x25')](util[_0x9c59('0x24')](_0x9c59('0x3b'),_0xdb50d8,_0x26195e,_0x550692));};AGIChannel[_0x9c59('0x1d')]['getVariable']=function(_0x3aafc9){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x3c'),_0x3aafc9));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x3d')]=function(_0x490460,_0x593ccf,_0x4cd587,_0x54cfec,_0x1df303,_0x2c7181){_0x593ccf=_0x593ccf||_0x9c59('0x3e');_0x4cd587=_0x4cd587||'';_0x54cfec=_0x54cfec===undefined?-0x1:_0x54cfec==='-1'?-0x1:_0x54cfec*0x3e8;_0x1df303=_0x1df303===undefined?'':'s='+_0x1df303;_0x2c7181=_0x2c7181?_0x9c59('0x3f'):'';return this[_0x9c59('0x1e')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x490460,_0x593ccf,_0x4cd587,_0x54cfec,_0x2c7181,_0x1df303));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x40')]=function(_0x165a43,_0x24c71b){_0x24c71b=_0x24c71b||'';return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x41'),_0x165a43,_0x24c71b));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x42')]=function(_0x169ded){return this[_0x9c59('0x43')](_0x9c59('0x44'),_0x169ded);};AGIChannel['prototype'][_0x9c59('0x45')]=function(_0x2c10c9){return this['exec'](_0x9c59('0x46'),_0x2c10c9);};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x13')]=function(_0x10e77b,_0x170304){this[_0x9c59('0x25')](util[_0x9c59('0x24')](_0x9c59('0x47'),_0x10e77b['id'],_0x10e77b['label'],_0x170304));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9c59('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 08694ac..e6a0236 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 _0x9c48=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name'];(function(_0x1e7390,_0x32d8bd){var _0x28e546=function(_0x44938f){while(--_0x44938f){_0x1e7390['push'](_0x1e7390['shift']());}};_0x28e546(++_0x32d8bd);}(_0x9c48,0x91));var _0x89c4=function(_0x164b2b,_0x2cf355){_0x164b2b=_0x164b2b-0x0;var _0x5d58c0=_0x9c48[_0x164b2b];return _0x5d58c0;};'use strict';var util=require(_0x89c4('0x0'));var error={'E_AGI_UNDEFINED':_0x89c4('0x1'),'E_AGI_ARGUMENT_PORT':_0x89c4('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x89c4('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x89c4('0x4'),'E_AGI_SOCKET_ERROR':_0x89c4('0x5'),'E_AGI_SOCKET_CLOSE':_0x89c4('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x89c4('0x7'),'E_AGI_COMMAND_EMPTY':_0x89c4('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x89c4('0x9'),'E_AGI_IVR_ENTRY':_0x89c4('0xa')};function AGIError(_0x3e1c30){var _0x3e1c30=_0x3e1c30||null,_0x2e5a1e=_0x2e5a1e||[],_0x2a283e=0x1,_0x15e088='';if(!error[_0x3e1c30]){_0x3e1c30='E_AGI_UNDEFINED';}_0x2e5a1e[_0x89c4('0xb')](error[_0x3e1c30]);while(arguments[_0x2a283e]){_0x2e5a1e[_0x89c4('0xb')](arguments[_0x2a283e]);_0x2a283e++;}_0x15e088=util[_0x89c4('0xc')][_0x89c4('0xd')](util,_0x2e5a1e);this['message']=_0x15e088;this[_0x89c4('0xe')]=_0x3e1c30;}module[_0x89c4('0xf')]=AGIError; \ No newline at end of file +var _0x548c=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x30dea6,_0x45559f){var _0x1a70bd=function(_0x52a805){while(--_0x52a805){_0x30dea6['push'](_0x30dea6['shift']());}};_0x1a70bd(++_0x45559f);}(_0x548c,0xfb));var _0xc548=function(_0x564d43,_0xa73335){_0x564d43=_0x564d43-0x0;var _0x2286bf=_0x548c[_0x564d43];return _0x2286bf;};'use strict';var util=require(_0xc548('0x0'));var error={'E_AGI_UNDEFINED':_0xc548('0x1'),'E_AGI_ARGUMENT_PORT':_0xc548('0x2'),'E_AGI_SERVER_ERROR':_0xc548('0x3'),'E_AGI_SERVER_CLOSE':_0xc548('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xc548('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xc548('0x6'),'E_AGI_SOCKET_ERROR':_0xc548('0x7'),'E_AGI_SOCKET_CLOSE':_0xc548('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xc548('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc548('0xa'),'E_AGI_IVR_ENTRY':_0xc548('0xb')};function AGIError(_0x42a168){var _0x42a168=_0x42a168||null,_0x4b449f=_0x4b449f||[],_0x298df6=0x1,_0x56efb1='';if(!error[_0x42a168]){_0x42a168=_0xc548('0xc');}_0x4b449f[_0xc548('0xd')](error[_0x42a168]);while(arguments[_0x298df6]){_0x4b449f[_0xc548('0xd')](arguments[_0x298df6]);_0x298df6++;}_0x56efb1=util['format'][_0xc548('0xe')](util,_0x4b449f);this[_0xc548('0xf')]=_0x56efb1;this['name']=_0x42a168;}module[_0xc548('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 6afc421..acce5df 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 _0x5e43=['size','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','menu','invalid','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push'];(function(_0x35abc9,_0x44249e){var _0x5370e7=function(_0x2e7d7b){while(--_0x2e7d7b){_0x35abc9['push'](_0x35abc9['shift']());}};_0x5370e7(++_0x44249e);}(_0x5e43,0x1f2));var _0x35e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x35e4('0x0'));var logger=require(_0x35e4('0x1'))(_0x35e4('0x2'));var verticesWithRetry=['menu',_0x35e4('0x3'),_0x35e4('0x4')];var Graph=function(){this[_0x35e4('0x5')]={};this[_0x35e4('0x6')]={};this[_0x35e4('0x7')]=0x0;};Graph['prototype'][_0x35e4('0x8')]=function(_0x103f81){this[_0x35e4('0x5')][_0x103f81['id']]=_0x103f81;this[_0x35e4('0x6')][_0x103f81['id']]=[];};Graph[_0x35e4('0x9')][_0x35e4('0xa')]=function(_0x422baa,_0x2304fa,_0x193159){this[_0x35e4('0x6')][_0x422baa][_0x35e4('0xb')]({'target':_0x2304fa,'condition':_0x193159});this[_0x35e4('0x7')]+=0x1;};Graph['prototype']['size']=function(){return _[_0x35e4('0xc')](this[_0x35e4('0x5')]);};Graph['prototype']['relations']=function(){return this[_0x35e4('0x7')];};Graph['prototype'][_0x35e4('0xd')]=function(_0x42e4a1){return this['vertices'][_0x42e4a1];};Graph[_0x35e4('0x9')]['traverseBFS']=function(_0x57db50,_0x285010){if(!this['vertices'][_0x57db50]){return logger[_0x35e4('0xe')](_0x35e4('0xf'));}var _0x51dd2=_0x285010(this[_0x35e4('0x5')][_0x57db50]);if(!_0x51dd2){return logger[_0x35e4('0xe')](_0x35e4('0x10'));}if(this[_0x35e4('0x6')][_0x57db50][_0x35e4('0x11')]===0x0){return logger[_0x35e4('0xe')](_0x35e4('0x12'));}for(var _0x3d9e3a=0x0,_0x4131f4=[],_0x17cbdc=![];_0x3d9e3a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','clear','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','listening','connection','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x4dbcd6,_0x34326c){var _0x541e55=function(_0x59eb00){while(--_0x59eb00){_0x4dbcd6['push'](_0x4dbcd6['shift']());}};_0x541e55(++_0x34326c);}(_0xc24a,0xe7));var _0xac24=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc24a[_0x1035c1];return _0x308d67;};'use strict';var parser=require('xml2json');var _=require(_0xac24('0x0'));var syncho=require(_0xac24('0x1'));var util=require(_0xac24('0x2'));var moment=require(_0xac24('0x3'));var config=require('../../config/environment');var logger=require(_0xac24('0x4'))(_0xac24('0x5'));var utilLicense=require(_0xac24('0x6'));var rpc=require(_0xac24('0x7'));var mailRpc=require(_0xac24('0x8'));var Graph=require(_0xac24('0x9'));var Vertices=require(_0xac24('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xac24('0x5')]=_[_0xac24('0xb')](config[_0xac24('0x5')],{'ip':_0xac24('0xc'),'port':0x11dd});function connectionHandler(_0x307252){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x307252);agiHandler(_0x307252);}catch(_0x2293d7){logger[_0xac24('0xd')](_0x2293d7['stack']);}});});}function listeningHandler(){console['log'](_0xac24('0xe'),config['agi'][_0xac24('0xf')]);logger[_0xac24('0x10')](util[_0xac24('0x11')](_0xac24('0x12'),config[_0xac24('0x5')]['ip'],config[_0xac24('0x5')][_0xac24('0xf')]));}function errorHandler(_0x3797fd){if(_0x3797fd&&_0x3797fd['name']&&_0x3797fd[_0xac24('0x13')]){logger[_0xac24('0xd')](util[_0xac24('0x11')]('[%s]\x20%s',_0x3797fd['name'],_0x3797fd[_0xac24('0x13')]));}else{logger['error'](util['format'](_0xac24('0x14'),_0x3797fd[_0xac24('0x15')]));}}function closeHandler(){logger[_0xac24('0x10')](util['format'](_0xac24('0x16'),this[_0xac24('0x17')],this[_0xac24('0x18')],this[_0xac24('0x19')],this['dnid'],this[_0xac24('0x1a')]));try{createSquareReport(this);}catch(_0x35fe7c){logger[_0xac24('0xd')](_0x35fe7c['stack']);}}function timeoutHandler(){logger[_0xac24('0x10')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xac24('0x17')],this[_0xac24('0x18')],this[_0xac24('0x19')],this[_0xac24('0x1b')],this[_0xac24('0x1a')]));}function hangupHandler(){logger[_0xac24('0x10')](util[_0xac24('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0xac24('0x1b')],this['uniqueid']));this[_0xac24('0x1c')]=!![];}function getRoot(_0x27b154){return parser[_0xac24('0x1d')](_0x27b154,{'object':!![]})['mxGraphModel'][_0xac24('0x1e')];}function addVertex(_0x1af777,_0x152209,_0x22a1f9){_0x152209[_0xac24('0x1f')]=_0x22a1f9;if(_0x152209[_0xac24('0x20')]('retry')){_0x152209[_0xac24('0x21')]=parseInt(_0x152209[_0xac24('0x22')],0xa);}_0x1af777[_0xac24('0x23')](_[_0xac24('0x24')](_0x152209,_0xac24('0x25')));}function initGraph(_0x366184,_0x215a1e){var _0x396f43=new Graph();for(var _0x22a96d in _0x366184){if(_0x366184['hasOwnProperty'](_0x22a96d)){if(_['isArray'](_0x366184[_0x22a96d])){for(var _0x34aca9=0x0;_0x34aca9<_0x366184[_0x22a96d][_0xac24('0x26')];_0x34aca9+=0x1){addVertex(_0x396f43,_0x366184[_0x22a96d][_0x34aca9],_0x22a96d);}}else{addVertex(_0x396f43,_0x366184[_0x22a96d],_0x22a96d);}}}for(var _0x428702=0x0;_0x428702<_0x215a1e[_0xac24('0x26')];_0x428702+=0x1){if(_0x215a1e[_0x428702]['source']&&_0x215a1e[_0x428702]['target']){_0x396f43[_0xac24('0x27')](_0x215a1e[_0x428702][_0xac24('0x28')],_0x215a1e[_0x428702][_0xac24('0x29')],_0x215a1e[_0x428702]['value']);}}return _0x396f43;}function getSquareProject(_0x91ac58,_0x2f7312){rpc[_0xac24('0x2a')](_0x91ac58)['then'](function(_0x4c1b6b){_0x2f7312(null,_0x4c1b6b);})[_0xac24('0x2b')](function(_0x12dfd3){_0x2f7312(null,_0x12dfd3);});}function createSquareReport(_0x4d33ab,_0x4be2c7){rpc[_0xac24('0x2c')](_0x4d33ab)[_0xac24('0x2d')](function(_0x41ff7a){if(_0x4be2c7){_0x4be2c7(null,_0x41ff7a);}})[_0xac24('0x2b')](function(_0x48a09e){if(_0x4be2c7){_0x4be2c7(null,_0x48a09e);}});}function setChannelVariables(_0x34a56b){for(var _0xa39072 in _0x34a56b){if(_0x34a56b[_0xac24('0x20')](_0xa39072)){if(_0xa39072['indexOf'](_0xac24('0x2e'))===0x0){_0x34a56b[_0xa39072['substring'](0x4)]=_0x34a56b[_0xa39072];delete _0x34a56b[_0xa39072];}}}}function getLogFromObject(_0x42454f){return util['inspect'](_0x42454f,{'showHidden':![],'depth':null});}function agiHandler(_0x7f1222){var _0x4bd213,_0x3f3fc1,_0x1b0a34,_0x588fce,_0x11cde7;logger[_0xac24('0x2f')]('variables',JSON['stringify'](_0x7f1222,null,0x2));logger['info'](util[_0xac24('0x11')](_0xac24('0x30'),_0x7f1222['arg_1'],_0x7f1222[_0xac24('0x18')],_0x7f1222[_0xac24('0x19')],_0x7f1222['dnid'],_0x7f1222['uniqueid']));_0x7f1222['on'](_0xac24('0xd'),errorHandler);_0x7f1222['on'](_0xac24('0x31'),closeHandler);_0x7f1222['on'](_0xac24('0x32'),timeoutHandler);_0x7f1222['evtHangup']=![];_0x7f1222['on'](_0xac24('0x33'),hangupHandler);var _0x1c9148=getSquareProject[_0xac24('0x34')](null,_0x7f1222[_0xac24('0x17')]);if(_0x1c9148){if(_0x1c9148['production']){_0x4bd213=getRoot(_0x1c9148[_0xac24('0x35')]);if(_0x4bd213&&_0x4bd213[_0xac24('0x36')]){logger[_0xac24('0x2f')]('root',JSON['stringify'](_0x4bd213,null,0x2));_0x7f1222[_0xac24('0x37')]=moment()[_0xac24('0x11')](_0xac24('0x38'));_0x3f3fc1=initGraph(_[_0xac24('0x24')](_0x4bd213,'mxCell'),_0x4bd213['mxCell']);_0x1b0a34=new Vertices(_0x7f1222,rpc,mailRpc);logger[_0xac24('0x10')](util[_0xac24('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x7f1222[_0xac24('0x17')],_0x7f1222['calleridname'],_0x7f1222[_0xac24('0x19')],_0x7f1222[_0xac24('0x1b')],_0x7f1222[_0xac24('0x1a')]));_0x3f3fc1[_0xac24('0x39')](_0x4bd213['start']['id'],function(_0x31390f){try{_0x31390f=_0x1b0a34['clear'](_0x31390f);logger[_0xac24('0x2f')](_0xac24('0x3a'),JSON[_0xac24('0x3b')](_0x31390f,null,0x2));if(_0x31390f[_0xac24('0x1f')]===_0xac24('0x3c')){logger[_0xac24('0x10')](_0xac24('0x3d'));_0x7f1222[_0xac24('0x3e')]=_0x31390f['context']||_0x7f1222['context'];_0x7f1222[_0xac24('0x3f')]=_0x31390f[_0xac24('0x3f')];_0x7f1222[_0xac24('0x40')]=_0x31390f[_0xac24('0x40')]?_0x31390f[_0xac24('0x40')]-0x1:0x1;return null;}else if(_0x31390f&&_0x1b0a34[_0x31390f['agicommand']]){_0x11cde7=_0x1b0a34[_0x31390f['agicommand']](_0x31390f);logger[_0xac24('0x10')](_0xac24('0x41'),JSON[_0xac24('0x3b')](_0x11cde7,null,0x2));if(_0x11cde7&&_0x11cde7['code']===AGI_CODE_SUCCESS&&_0x11cde7[_0xac24('0x42')]!==AGI_RESULT_ERROR&&!_0x7f1222['evtHangup']){logger[_0xac24('0x2f')](_0xac24('0x41'),getLogFromObject(_0x11cde7));return _['isUndefined'](_0x11cde7[_0xac24('0x42')])?null:_0x11cde7[_0xac24('0x42')]['toString']();}else{logger[_0xac24('0xd')](_0xac24('0x41'),getLogFromObject(_0x11cde7));return null;}}else{logger[_0xac24('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x2799d4){logger['error'](_0x2799d4[_0xac24('0x15')]);return null;}});if(_0x4bd213['finally']){logger[_0xac24('0x10')](util[_0xac24('0x11')](_0xac24('0x43'),_0x7f1222[_0xac24('0x17')],_0x7f1222[_0xac24('0x18')],_0x7f1222[_0xac24('0x19')],_0x7f1222[_0xac24('0x1b')],_0x7f1222['uniqueid']));_0x3f3fc1['traverseBFS'](_0x4bd213[_0xac24('0x44')]['id'],function(_0x314b94){try{_0x314b94=_0x1b0a34[_0xac24('0x45')](_0x314b94);logger[_0xac24('0x2f')](_0xac24('0x3a'),JSON['stringify'](_0x314b94,null,0x2));if(_0x314b94&&_0x1b0a34[_0x314b94['agicommand']]){_0x11cde7=_0x1b0a34[_0x314b94[_0xac24('0x1f')]](_0x314b94);if(_0x11cde7){logger[_0xac24('0x2f')]('response',getLogFromObject(_0x11cde7));return _[_0xac24('0x46')](_0x11cde7['result'])?null:_0x11cde7[_0xac24('0x42')][_0xac24('0x47')]();}else{logger['error'](_0xac24('0x41'),getLogFromObject(_0x11cde7));return null;}}else{logger[_0xac24('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x3c4585){logger[_0xac24('0xd')](_0x3c4585[_0xac24('0x15')]);return null;}});}logger['info'](util[_0xac24('0x11')](_0xac24('0x48'),_0x7f1222[_0xac24('0x17')],_0x7f1222[_0xac24('0x18')],_0x7f1222[_0xac24('0x19')],_0x7f1222['dnid'],_0x7f1222[_0xac24('0x1a')]));logger[_0xac24('0x10')](util[_0xac24('0x11')](_0xac24('0x49'),_0x7f1222[_0xac24('0x3e')],_0x7f1222[_0xac24('0x3f')],parseInt(_0x7f1222[_0xac24('0x40')],0xa)+0x1));_0x7f1222['continueAt'](_0x7f1222[_0xac24('0x3e')],_0x7f1222[_0xac24('0x3f')],parseInt(_0x7f1222[_0xac24('0x40')],0xa)+0x1);_0x7f1222[_0xac24('0x31')]();}}else{logger[_0xac24('0xd')](util[_0xac24('0x11')](_0xac24('0x4a'),_0x7f1222[_0xac24('0x17')]));_0x7f1222['continueAt'](_0x7f1222[_0xac24('0x3e')],_0x7f1222[_0xac24('0x3f')],parseInt(_0x7f1222[_0xac24('0x40')],0xa)+0x1);_0x7f1222[_0xac24('0x31')]();}}else{logger['error'](util['format'](_0xac24('0x4b'),_0x7f1222[_0xac24('0x17')]));_0x7f1222[_0xac24('0x4c')](_0x7f1222[_0xac24('0x3e')],_0x7f1222[_0xac24('0x3f')],parseInt(_0x7f1222['priority'],0xa)+0x1);_0x7f1222['close']();}}function main(){var _0x20394;return utilLicense[_0xac24('0x4d')]()[_0xac24('0x2d')](function(_0x4766ba){if(_0x4766ba){if(_0x4766ba[_0xac24('0x4e')]){if(_0x4766ba['callysquare']&&_0x4766ba[_0xac24('0x4f')]>0x0){logger[_0xac24('0x10')](util['format'](_0xac24('0x50'),_0x4766ba[_0xac24('0x4f')]));_0x20394=_0x4766ba[_0xac24('0x4f')];}else{logger[_0xac24('0x10')](_0xac24('0x51'));}}else{logger[_0xac24('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x20394=-0x1;}}})[_0xac24('0x2b')](function(_0x338cf8){logger[_0xac24('0xd')]('[LICENSE]',_0x338cf8[_0xac24('0x15')]);})[_0xac24('0x44')](function(){var _0x382098=require(_0xac24('0x52'))(config[_0xac24('0x5')][_0xac24('0xf')],config[_0xac24('0x5')]['ip'],_0x20394);_0x382098['on'](_0xac24('0xd'),errorHandler);_0x382098['on'](_0xac24('0x53'),listeningHandler);_0x382098['on'](_0xac24('0x54'),connectionHandler);_0x382098['on'](_0xac24('0x31'),closeHandler);});}main(); \ No newline at end of file +var _0x7793=['moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','defaults','nextTick','stack','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','error','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','catch','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','listening','connection','xml2json','lodash','syncho','util'];(function(_0x3722e4,_0x237174){var _0x28b1a3=function(_0x14013d){while(--_0x14013d){_0x3722e4['push'](_0x3722e4['shift']());}};_0x28b1a3(++_0x237174);}(_0x7793,0x10a));var _0x3779=function(_0x25f06e,_0x5202c7){_0x25f06e=_0x25f06e-0x0;var _0x319fbe=_0x7793[_0x25f06e];return _0x319fbe;};'use strict';var parser=require(_0x3779('0x0'));var _=require(_0x3779('0x1'));var syncho=require(_0x3779('0x2'));var util=require(_0x3779('0x3'));var moment=require(_0x3779('0x4'));var config=require('../../config/environment');var logger=require(_0x3779('0x5'))(_0x3779('0x6'));var utilLicense=require(_0x3779('0x7'));var rpc=require(_0x3779('0x8'));var mailRpc=require(_0x3779('0x9'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x3779('0x6')]=_[_0x3779('0xa')](config[_0x3779('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x3f0d8a){process[_0x3779('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3f0d8a);agiHandler(_0x3f0d8a);}catch(_0x4e39a1){logger['error'](_0x4e39a1[_0x3779('0xc')]);}});});}function listeningHandler(){console[_0x3779('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x3779('0x6')]['port']);logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x10'),config[_0x3779('0x6')]['ip'],config['agi'][_0x3779('0x11')]));}function errorHandler(_0x297534){if(_0x297534&&_0x297534[_0x3779('0x12')]&&_0x297534[_0x3779('0x13')]){logger[_0x3779('0x14')](util[_0x3779('0xf')](_0x3779('0x15'),_0x297534[_0x3779('0x12')],_0x297534['message']));}else{logger[_0x3779('0x14')](util[_0x3779('0xf')]('[ERROR]\x20%s',_0x297534[_0x3779('0xc')]));}}function closeHandler(){logger[_0x3779('0xe')](util['format'](_0x3779('0x16'),this[_0x3779('0x17')],this[_0x3779('0x18')],this[_0x3779('0x19')],this['dnid'],this[_0x3779('0x1a')]));try{createSquareReport(this);}catch(_0x4edd5c){logger[_0x3779('0x14')](_0x4edd5c[_0x3779('0xc')]);}}function timeoutHandler(){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x1b'),this['arg_1'],this[_0x3779('0x18')],this[_0x3779('0x19')],this[_0x3779('0x1c')],this[_0x3779('0x1a')]));}function hangupHandler(){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x1d'),this['arg_1'],this[_0x3779('0x18')],this[_0x3779('0x19')],this[_0x3779('0x1c')],this[_0x3779('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x4b16a8){return parser[_0x3779('0x1e')](_0x4b16a8,{'object':!![]})[_0x3779('0x1f')][_0x3779('0x20')];}function addVertex(_0x338e87,_0x292365,_0x16b647){_0x292365[_0x3779('0x21')]=_0x16b647;if(_0x292365[_0x3779('0x22')]('retry')){_0x292365[_0x3779('0x23')]=parseInt(_0x292365['retry'],0xa);}_0x338e87[_0x3779('0x24')](_['omit'](_0x292365,_0x3779('0x25')));}function initGraph(_0xd49002,_0x538767){var _0x1e484c=new Graph();for(var _0x36866d in _0xd49002){if(_0xd49002['hasOwnProperty'](_0x36866d)){if(_[_0x3779('0x26')](_0xd49002[_0x36866d])){for(var _0x50f710=0x0;_0x50f710<_0xd49002[_0x36866d][_0x3779('0x27')];_0x50f710+=0x1){addVertex(_0x1e484c,_0xd49002[_0x36866d][_0x50f710],_0x36866d);}}else{addVertex(_0x1e484c,_0xd49002[_0x36866d],_0x36866d);}}}for(var _0x39a05b=0x0;_0x39a05b<_0x538767[_0x3779('0x27')];_0x39a05b+=0x1){if(_0x538767[_0x39a05b][_0x3779('0x28')]&&_0x538767[_0x39a05b][_0x3779('0x29')]){_0x1e484c[_0x3779('0x2a')](_0x538767[_0x39a05b][_0x3779('0x28')],_0x538767[_0x39a05b][_0x3779('0x29')],_0x538767[_0x39a05b][_0x3779('0x2b')]);}}return _0x1e484c;}function getSquareProject(_0x270ed1,_0x4f2c56){rpc[_0x3779('0x2c')](_0x270ed1)['then'](function(_0x5d0f0f){_0x4f2c56(null,_0x5d0f0f);})[_0x3779('0x2d')](function(_0x4e4538){_0x4f2c56(null,_0x4e4538);});}function createSquareReport(_0x5911b3,_0x559c3f){rpc['createSquareReport'](_0x5911b3)['then'](function(_0x4ddd34){if(_0x559c3f){_0x559c3f(null,_0x4ddd34);}})[_0x3779('0x2d')](function(_0x471c35){if(_0x559c3f){_0x559c3f(null,_0x471c35);}});}function setChannelVariables(_0x167fe2){for(var _0x21d769 in _0x167fe2){if(_0x167fe2[_0x3779('0x22')](_0x21d769)){if(_0x21d769[_0x3779('0x2e')](_0x3779('0x2f'))===0x0){_0x167fe2[_0x21d769[_0x3779('0x30')](0x4)]=_0x167fe2[_0x21d769];delete _0x167fe2[_0x21d769];}}}}function getLogFromObject(_0x2d01b3){return util[_0x3779('0x31')](_0x2d01b3,{'showHidden':![],'depth':null});}function agiHandler(_0x2048b1){var _0x3fb9a2,_0x4edda6,_0x252308,_0x2f2420,_0x465e53;logger['debug'](_0x3779('0x32'),JSON[_0x3779('0x33')](_0x2048b1,null,0x2));logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x34'),_0x2048b1['arg_1'],_0x2048b1[_0x3779('0x18')],_0x2048b1['callerid'],_0x2048b1[_0x3779('0x1c')],_0x2048b1['uniqueid']));_0x2048b1['on'](_0x3779('0x14'),errorHandler);_0x2048b1['on'](_0x3779('0x35'),closeHandler);_0x2048b1['on'](_0x3779('0x36'),timeoutHandler);_0x2048b1[_0x3779('0x37')]=![];_0x2048b1['on']('hangup',hangupHandler);var _0x10fc95=getSquareProject[_0x3779('0x38')](null,_0x2048b1[_0x3779('0x17')]);if(_0x10fc95){if(_0x10fc95[_0x3779('0x39')]){_0x3fb9a2=getRoot(_0x10fc95[_0x3779('0x39')]);if(_0x3fb9a2&&_0x3fb9a2[_0x3779('0x3a')]){logger[_0x3779('0x3b')]('root',JSON[_0x3779('0x33')](_0x3fb9a2,null,0x2));_0x2048b1[_0x3779('0x3c')]=moment()[_0x3779('0xf')](_0x3779('0x3d'));_0x4edda6=initGraph(_[_0x3779('0x3e')](_0x3fb9a2,'mxCell'),_0x3fb9a2[_0x3779('0x25')]);_0x252308=new Vertices(_0x2048b1,rpc,mailRpc);logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x3f'),_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1['uniqueid']));_0x4edda6[_0x3779('0x40')](_0x3fb9a2[_0x3779('0x3a')]['id'],function(_0x688389){try{_0x688389=_0x252308['clear'](_0x688389);logger['debug'](_0x3779('0x41'),JSON[_0x3779('0x33')](_0x688389,null,0x2));if(_0x688389[_0x3779('0x21')]===_0x3779('0x42')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2048b1[_0x3779('0x43')]=_0x688389['context']||_0x2048b1['context'];_0x2048b1[_0x3779('0x44')]=_0x688389[_0x3779('0x44')];_0x2048b1['priority']=_0x688389[_0x3779('0x45')]?_0x688389[_0x3779('0x45')]-0x1:0x1;return null;}else if(_0x688389&&_0x252308[_0x688389[_0x3779('0x21')]]){_0x465e53=_0x252308[_0x688389[_0x3779('0x21')]](_0x688389);logger[_0x3779('0xe')](_0x3779('0x46'),JSON[_0x3779('0x33')](_0x465e53,null,0x2));if(_0x465e53&&_0x465e53[_0x3779('0x47')]===AGI_CODE_SUCCESS&&_0x465e53[_0x3779('0x48')]!==AGI_RESULT_ERROR&&!_0x2048b1['evtHangup']){logger[_0x3779('0x3b')](_0x3779('0x46'),getLogFromObject(_0x465e53));return _['isUndefined'](_0x465e53[_0x3779('0x48')])?null:_0x465e53[_0x3779('0x48')]['toString']();}else{logger[_0x3779('0x14')](_0x3779('0x46'),getLogFromObject(_0x465e53));return null;}}else{logger[_0x3779('0x14')](_0x3779('0x49'));return null;}}catch(_0x158e16){logger['error'](_0x158e16['stack']);return null;}});if(_0x3fb9a2[_0x3779('0x4a')]){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x4b'),_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1[_0x3779('0x1a')]));_0x4edda6['traverseBFS'](_0x3fb9a2[_0x3779('0x4a')]['id'],function(_0x364ac4){try{_0x364ac4=_0x252308[_0x3779('0x4c')](_0x364ac4);logger[_0x3779('0x3b')]('vertex',JSON['stringify'](_0x364ac4,null,0x2));if(_0x364ac4&&_0x252308[_0x364ac4[_0x3779('0x21')]]){_0x465e53=_0x252308[_0x364ac4[_0x3779('0x21')]](_0x364ac4);if(_0x465e53){logger['debug'](_0x3779('0x46'),getLogFromObject(_0x465e53));return _[_0x3779('0x4d')](_0x465e53[_0x3779('0x48')])?null:_0x465e53[_0x3779('0x48')]['toString']();}else{logger[_0x3779('0x14')](_0x3779('0x46'),getLogFromObject(_0x465e53));return null;}}else{logger[_0x3779('0x14')](_0x3779('0x49'));return null;}}catch(_0x3cb69d){logger[_0x3779('0x14')](_0x3cb69d[_0x3779('0xc')]);return null;}});}logger[_0x3779('0xe')](util[_0x3779('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1[_0x3779('0x1a')]));logger['info'](util[_0x3779('0xf')](_0x3779('0x4e'),_0x2048b1[_0x3779('0x43')],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1));_0x2048b1['continueAt'](_0x2048b1[_0x3779('0x43')],_0x2048b1['extension'],parseInt(_0x2048b1['priority'],0xa)+0x1);_0x2048b1['close']();}}else{logger[_0x3779('0x14')](util[_0x3779('0xf')]('Project\x20%s\x20not\x20published',_0x2048b1['arg_1']));_0x2048b1[_0x3779('0x4f')](_0x2048b1[_0x3779('0x43')],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1);_0x2048b1[_0x3779('0x35')]();}}else{logger[_0x3779('0x14')](util[_0x3779('0xf')](_0x3779('0x50'),_0x2048b1['arg_1']));_0x2048b1[_0x3779('0x4f')](_0x2048b1['context'],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1);_0x2048b1[_0x3779('0x35')]();}}function main(){var _0x45c3bf;return utilLicense[_0x3779('0x51')]()[_0x3779('0x52')](function(_0x490490){if(_0x490490){if(_0x490490[_0x3779('0x53')]){if(_0x490490['callysquare']&&_0x490490[_0x3779('0x54')]>0x0){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x55'),_0x490490['callysquare']));_0x45c3bf=_0x490490[_0x3779('0x54')];}else{logger[_0x3779('0xe')](_0x3779('0x56'));}}else{logger[_0x3779('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x45c3bf=-0x1;}}})[_0x3779('0x2d')](function(_0x1f6342){logger[_0x3779('0x14')](_0x3779('0x57'),_0x1f6342[_0x3779('0xc')]);})[_0x3779('0x4a')](function(){var _0x3db68c=require('./server')(config[_0x3779('0x6')]['port'],config['agi']['ip'],_0x45c3bf);_0x3db68c['on'](_0x3779('0x14'),errorHandler);_0x3db68c['on'](_0x3779('0x58'),listeningHandler);_0x3db68c['on'](_0x3779('0x59'),connectionHandler);_0x3db68c['on'](_0x3779('0x35'),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 2c95618..1d1bae1 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 _0x1b96=['http','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x273bed,_0x47b858){var _0x26fa83=function(_0x37ebde){while(--_0x37ebde){_0x273bed['push'](_0x273bed['shift']());}};_0x26fa83(++_0x47b858);}(_0x1b96,0x1e1));var _0x61b9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1b96[_0x167cc1];return _0x10bc4b;};'use strict';var BPromise=require(_0x61b9('0x0'));var jayson=require(_0x61b9('0x1'));var client=jayson[_0x61b9('0x2')][_0x61b9('0x3')]({'port':0x232b});function request(_0x222a0c,_0x52d3eb){return new BPromise(function(_0x1589e2,_0x288d9a){return client['request'](_0x222a0c,_0x52d3eb)[_0x61b9('0x4')](function(_0x828fd3){if(_0x828fd3[_0x61b9('0x5')]){return _0x288d9a(_0x828fd3[_0x61b9('0x5')][_0x61b9('0x6')]);}else{return _0x1589e2(_0x828fd3[_0x61b9('0x7')]);}})[_0x61b9('0x8')](function(_0x1c13ac){return _0x288d9a(_0x1c13ac);});});}exports[_0x61b9('0x9')]=function(_0x18ff2d,_0x2b4277){return request(_0x61b9('0xa'),{'account':_0x18ff2d,'message':_0x2b4277});}; \ No newline at end of file +var _0xc559=['error','message','result','catch','bluebird','http','request','then'];(function(_0x210116,_0x3be802){var _0x165a9a=function(_0x324d8b){while(--_0x324d8b){_0x210116['push'](_0x210116['shift']());}};_0x165a9a(++_0x3be802);}(_0xc559,0x84));var _0x9c55=function(_0x43bef7,_0x7983f7){_0x43bef7=_0x43bef7-0x0;var _0x3c8151=_0xc559[_0x43bef7];return _0x3c8151;};'use strict';var BPromise=require(_0x9c55('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c55('0x1')]({'port':0x232b});function request(_0x1bd3ca,_0x33a5d0){return new BPromise(function(_0x3af360,_0x2440e7){return client[_0x9c55('0x2')](_0x1bd3ca,_0x33a5d0)[_0x9c55('0x3')](function(_0x1f7b92){if(_0x1f7b92[_0x9c55('0x4')]){return _0x2440e7(_0x1f7b92['error'][_0x9c55('0x5')]);}else{return _0x3af360(_0x1f7b92[_0x9c55('0x6')]);}})[_0x9c55('0x7')](function(_0x27b8c7){return _0x2440e7(_0x27b8c7);});});}exports['sendMailMessage']=function(_0x41c69e,_0x149e8f){return request('SendMail',{'account':_0x41c69e,'message':_0x149e8f});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 6669943..b8400bc 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 _0xfb9c=['indexOf','slice','trim','emit','headers','line','exports','stream','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split'];(function(_0x502dc0,_0x453077){var _0xf92904=function(_0x21d61f){while(--_0x21d61f){_0x502dc0['push'](_0x502dc0['shift']());}};_0xf92904(++_0x453077);}(_0xfb9c,0xb2));var _0xcfb9=function(_0x9d1971,_0x50b82e){_0x9d1971=_0x9d1971-0x0;var _0x203469=_0xfb9c[_0x9d1971];return _0x203469;};'use strict';var util=require('util');var Transform=require(_0xcfb9('0x0'))['Transform'];function AGIReply(_0x4fa309){Transform[_0xcfb9('0x1')](this,_0x4fa309);this[_0xcfb9('0x2')]='';this[_0xcfb9('0x3')]=![];}util[_0xcfb9('0x4')](AGIReply,Transform);AGIReply[_0xcfb9('0x5')][_0xcfb9('0x6')]=function(_0x2588da,_0x101a60,_0x5c23d9){var _0x55e5f2='\x0a',_0x21df34=['\x0a\x0a',_0xcfb9('0x7')],_0x1dca44=-0x1,_0x20cda9=-0x1,_0xa51fe0='',_0x3c4da2=0x0,_0xac455d='',_0x50f715='';this[_0xcfb9('0x2')]+=_0x2588da[_0xcfb9('0x8')]();_0xac455d=this['_localBuffer'];if(!this[_0xcfb9('0x3')]){_0x3c4da2=0x0;while(_0x21df34[_0x3c4da2]){while((_0x20cda9=_0xac455d['indexOf'](_0x21df34[_0x3c4da2]))!=-0x1){_0xa51fe0=_0x21df34[_0x3c4da2];_0x50f715=_0xac455d[_0xcfb9('0x9')](0x0,_0x20cda9);_0xac455d=_0xac455d['substring'](_0x20cda9+_0xa51fe0[_0xcfb9('0xa')]);var _0x34af5e=_0x50f715[_0xcfb9('0xb')](_0x55e5f2),_0x3442bf=0x0,_0x31d8e1={},_0x5c6686='',_0x462b2d='',_0x47e20c=-0x1;while(_0x34af5e[_0x3442bf]){_0x47e20c=_0x34af5e[_0x3442bf][_0xcfb9('0xc')](':');if(_0x47e20c!=-0x1){_0x5c6686=_0x34af5e[_0x3442bf][_0xcfb9('0xd')](0x0,_0x47e20c)[_0xcfb9('0xe')]();_0x462b2d=_0x34af5e[_0x3442bf][_0xcfb9('0xd')](_0x47e20c+0x1)[_0xcfb9('0xe')]();if(_0x5c6686['length']>0x0){_0x31d8e1[_0x5c6686]=_0x462b2d;}}else{}_0x3442bf++;}this[_0xcfb9('0xf')](_0xcfb9('0x10'),_0x31d8e1);this[_0xcfb9('0x3')]=!![];}_0x3c4da2++;}this[_0xcfb9('0x2')]=_0xac455d;}else{while((_0x1dca44=_0xac455d['indexOf'](_0x55e5f2))!=-0x1){_0x50f715=_0xac455d['substring'](0x0,_0x1dca44);this[_0xcfb9('0xf')](_0xcfb9('0x11'),_0x50f715);_0xac455d=_0xac455d[_0xcfb9('0x9')](_0x1dca44+_0x55e5f2[_0xcfb9('0xa')]);}this[_0xcfb9('0x2')]=_0xac455d;}_0x5c23d9();};module[_0xcfb9('0x12')]=AGIReply; \ No newline at end of file +var _0xd752=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','substring','length','split','slice','trim','headers','emit','exports','util','stream'];(function(_0x269410,_0x27d834){var _0x4b7e51=function(_0x5b2010){while(--_0x5b2010){_0x269410['push'](_0x269410['shift']());}};_0x4b7e51(++_0x27d834);}(_0xd752,0x7c));var _0x2d75=function(_0x1b00d0,_0x265b67){_0x1b00d0=_0x1b00d0-0x0;var _0x31446c=_0xd752[_0x1b00d0];return _0x31446c;};'use strict';var util=require(_0x2d75('0x0'));var Transform=require(_0x2d75('0x1'))[_0x2d75('0x2')];function AGIReply(_0x18b14a){Transform[_0x2d75('0x3')](this,_0x18b14a);this[_0x2d75('0x4')]='';this[_0x2d75('0x5')]=![];}util[_0x2d75('0x6')](AGIReply,Transform);AGIReply[_0x2d75('0x7')][_0x2d75('0x8')]=function(_0x89cce3,_0xb1226d,_0x529e6b){var _0x4843e7='\x0a',_0x339218=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x37070f=-0x1,_0x7eedcb=-0x1,_0x446b0c='',_0x3bacdb=0x0,_0x58ccc2='',_0x20c365='';this[_0x2d75('0x4')]+=_0x89cce3['toString']();_0x58ccc2=this['_localBuffer'];if(!this[_0x2d75('0x5')]){_0x3bacdb=0x0;while(_0x339218[_0x3bacdb]){while((_0x7eedcb=_0x58ccc2[_0x2d75('0x9')](_0x339218[_0x3bacdb]))!=-0x1){_0x446b0c=_0x339218[_0x3bacdb];_0x20c365=_0x58ccc2[_0x2d75('0xa')](0x0,_0x7eedcb);_0x58ccc2=_0x58ccc2['substring'](_0x7eedcb+_0x446b0c[_0x2d75('0xb')]);var _0x507f3e=_0x20c365[_0x2d75('0xc')](_0x4843e7),_0x3995df=0x0,_0x466eca={},_0x3fdee7='',_0x58c0dd='',_0x5ef044=-0x1;while(_0x507f3e[_0x3995df]){_0x5ef044=_0x507f3e[_0x3995df][_0x2d75('0x9')](':');if(_0x5ef044!=-0x1){_0x3fdee7=_0x507f3e[_0x3995df][_0x2d75('0xd')](0x0,_0x5ef044)[_0x2d75('0xe')]();_0x58c0dd=_0x507f3e[_0x3995df]['slice'](_0x5ef044+0x1)[_0x2d75('0xe')]();if(_0x3fdee7[_0x2d75('0xb')]>0x0){_0x466eca[_0x3fdee7]=_0x58c0dd;}}else{}_0x3995df++;}this['emit'](_0x2d75('0xf'),_0x466eca);this[_0x2d75('0x5')]=!![];}_0x3bacdb++;}this['_localBuffer']=_0x58ccc2;}else{while((_0x37070f=_0x58ccc2[_0x2d75('0x9')](_0x4843e7))!=-0x1){_0x20c365=_0x58ccc2['substring'](0x0,_0x37070f);this[_0x2d75('0x10')]('line',_0x20c365);_0x58ccc2=_0x58ccc2[_0x2d75('0xa')](_0x37070f+_0x4843e7['length']);}this[_0x2d75('0x4')]=_0x58ccc2;}_0x529e6b();};module[_0x2d75('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 d4bcebe..ab0773d 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 _0xd51e=['ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','getSoundById','ShowSound','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','error','message','result','catch','getSquareProject','ShowSquareProject','production'];(function(_0x1acdd7,_0x1b63d6){var _0x5eed04=function(_0x5d4335){while(--_0x5d4335){_0x1acdd7['push'](_0x1acdd7['shift']());}};_0x5eed04(++_0x1b63d6);}(_0xd51e,0x173));var _0xed51=function(_0x53fb63,_0x2497b0){_0x53fb63=_0x53fb63-0x0;var _0x3fd488=_0xd51e[_0x53fb63];return _0x3fd488;};'use strict';var BPromise=require(_0xed51('0x0'));var moment=require(_0xed51('0x1'));var _=require(_0xed51('0x2'));var util=require(_0xed51('0x3'));var jayson=require(_0xed51('0x4'));var client=jayson[_0xed51('0x5')][_0xed51('0x6')]({'port':0x2329});function request(_0x143675,_0x272937){return new BPromise(function(_0x56c39c,_0xefffb0){return client['request'](_0x143675,_0x272937)['then'](function(_0x57bbda){if(_0x57bbda['error']){return _0xefffb0(_0x57bbda[_0xed51('0x7')][_0xed51('0x8')]);}else{return _0x56c39c(_0x57bbda[_0xed51('0x9')]);}})[_0xed51('0xa')](function(_0x3c47e0){return _0xefffb0(_0x3c47e0);});});}exports[_0xed51('0xb')]=function(_0x14f15c){return request(_0xed51('0xc'),{'options':{'raw':![],'where':{'name':_0x14f15c},'attributes':[_0xed51('0xd')]}});};exports['getMailAccountById']=function(_0x246ee7){return request(_0xed51('0xe'),{'options':{'raw':![],'where':{'id':_0x246ee7},'include':[{'model':_0xed51('0xf'),'as':_0xed51('0x10')}],'attributes':['id',_0xed51('0x11'),_0xed51('0x12')]}});};exports[_0xed51('0x13')]=function(_0x32e3bc){return request(_0xed51('0xc'),{'options':{'where':{'id':_0x32e3bc},'attributes':[_0xed51('0x11')]}});};exports['getVoiceQueueById']=function(_0x2f4947){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2f4947},'attributes':[_0xed51('0x11')]}});};exports[_0xed51('0x14')]=function(_0x1fb25a){return request(_0xed51('0x15'),{'options':{'where':{'id':_0x1fb25a},'attributes':['name']}});};exports[_0xed51('0x16')]=function(_0x3fd610){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3fd610},'attributes':['dsn']}});};exports[_0xed51('0x17')]=function(_0x19a6a3){return request('ShowUser',{'options':{'where':{'id':_0x19a6a3},'attributes':['name']}});};exports[_0xed51('0x18')]=function(_0x325370){return request('ShowTrunk',{'options':{'where':{'id':_0x325370},'attributes':[_0xed51('0x11')]}});};exports[_0xed51('0x19')]=function(_0x529095){return request(_0xed51('0x1a'),{'options':{'where':{'id':_0x529095},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x46ba5a){return request(_0xed51('0x1b'),{'options':{'raw':![],'where':{'id':_0x46ba5a},'include':[{'model':_0xed51('0x1c'),'as':_0xed51('0x1d')}]}});};exports['getSmsAccountById']=function(_0x4f76e1){return request(_0xed51('0x1e'),{'options':{'where':{'id':_0x4f76e1},'attributes':['id','name']}});};exports[_0xed51('0x1f')]=function(_0x120811){return request(_0xed51('0x20'),{'body':_0x120811});};exports[_0xed51('0x21')]=function(_0x12b81e){return request(_0xed51('0x22'),{'body':_0x12b81e});};exports['createSquareReport']=function(_0xe5fbee){return request(_0xed51('0x23'),{'body':_['merge'](_0xe5fbee,{'project_name':_0xe5fbee['arg_1'],'prev_project_name':_0xe5fbee[_0xed51('0x24')]||'','is_subproject':_0xe5fbee[_0xed51('0x24')]?!![]:![],'leaveAt':moment()['format'](_0xed51('0x25'))})});};exports[_0xed51('0x26')]=function(_0x166a1b){return request(_0xed51('0x27'),{'body':_0x166a1b});};exports['createSquareMessage']=function(_0x5d82cc){return request(_0xed51('0x28'),{'body':_0x5d82cc});};exports[_0xed51('0x29')]=function(_0xfdb5a5){return request(_0xed51('0x2a'),{'options':{'raw':![],'where':{'phone':_0xfdb5a5[_0xed51('0x2b')],'ListId':_0xfdb5a5[_0xed51('0x2c')]}}})[_0xed51('0x2d')](function(_0x9e04f4){if(_0x9e04f4){return _0x9e04f4;}return request(_0xed51('0x2e'),{'body':_0xfdb5a5});});};exports[_0xed51('0x2f')]=function(_0x148afc){return request(_0xed51('0x30'),{'options':{'where':{'id':_0x148afc},'attributes':[_0xed51('0x11')]}});};exports[_0xed51('0x31')]=function(_0x3d9292,_0x456144){return request(_0xed51('0x32'),{'body':{'interface':_0x456144},'options':{'where':_0x3d9292}});};exports['agentPause']=function(_0x25b23e,_0x27bc1e,_0x56261e){return request(_0xed51('0x33'),{'body':{'type':_0x27bc1e,'uniqueid':_0x56261e},'options':{'where':_0x25b23e}});};exports[_0xed51('0x34')]=function(_0x3b1cd7){return request(_0xed51('0x35'),{'body':{},'options':{'where':_0x3b1cd7}});};exports[_0xed51('0x36')]=function(_0xe406f1){return request('LogoutUser',{'body':{},'options':{'where':_0xe406f1}});}; \ No newline at end of file +var _0x7607=['getTrunkById','ShowTrunk','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','catch','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x57bcc0,_0x281040){var _0x4e361f=function(_0x406ef5){while(--_0x406ef5){_0x57bcc0['push'](_0x57bcc0['shift']());}};_0x4e361f(++_0x281040);}(_0x7607,0x92));var _0x7760=function(_0xb786a3,_0x48d5b4){_0xb786a3=_0xb786a3-0x0;var _0x24d7a4=_0x7607[_0xb786a3];return _0x24d7a4;};'use strict';var BPromise=require(_0x7760('0x0'));var moment=require(_0x7760('0x1'));var _=require(_0x7760('0x2'));var util=require('util');var jayson=require(_0x7760('0x3'));var client=jayson[_0x7760('0x4')][_0x7760('0x5')]({'port':0x2329});function request(_0x45a396,_0x21730d){return new BPromise(function(_0xde117d,_0x55560c){return client[_0x7760('0x6')](_0x45a396,_0x21730d)[_0x7760('0x7')](function(_0x53dfef){if(_0x53dfef[_0x7760('0x8')]){return _0x55560c(_0x53dfef['error']['message']);}else{return _0xde117d(_0x53dfef['result']);}})[_0x7760('0x9')](function(_0x5d6798){return _0x55560c(_0x5d6798);});});}exports[_0x7760('0xa')]=function(_0x2ebc39){return request(_0x7760('0xb'),{'options':{'raw':![],'where':{'name':_0x2ebc39},'attributes':['production']}});};exports['getMailAccountById']=function(_0x59fcf5){return request(_0x7760('0xc'),{'options':{'raw':![],'where':{'id':_0x59fcf5},'include':[{'model':_0x7760('0xd'),'as':_0x7760('0xe')}],'attributes':['id',_0x7760('0xf'),'email']}});};exports[_0x7760('0x10')]=function(_0xb0634c){return request('ShowSquareProject',{'options':{'where':{'id':_0xb0634c},'attributes':['name']}});};exports[_0x7760('0x11')]=function(_0x50457e){return request(_0x7760('0x12'),{'options':{'where':{'id':_0x50457e},'attributes':['name']}});};exports[_0x7760('0x13')]=function(_0x2f2e1a){return request('ShowVariable',{'options':{'where':{'id':_0x2f2e1a},'attributes':[_0x7760('0xf')]}});};exports[_0x7760('0x14')]=function(_0x24991d){return request(_0x7760('0x15'),{'options':{'where':{'id':_0x24991d},'attributes':[_0x7760('0x16')]}});};exports[_0x7760('0x17')]=function(_0x3b58bd){return request(_0x7760('0x18'),{'options':{'where':{'id':_0x3b58bd},'attributes':['name']}});};exports[_0x7760('0x19')]=function(_0x30104b){return request(_0x7760('0x1a'),{'options':{'where':{'id':_0x30104b},'attributes':['name']}});};exports['getSoundById']=function(_0x2809ff){return request(_0x7760('0x1b'),{'options':{'where':{'id':_0x2809ff},'attributes':[_0x7760('0x1c')]}});};exports['getIntervalById']=function(_0x410115){return request(_0x7760('0x1d'),{'options':{'raw':![],'where':{'id':_0x410115},'include':[{'model':_0x7760('0x1e'),'as':_0x7760('0x1f')}]}});};exports[_0x7760('0x20')]=function(_0x16e8d6){return request(_0x7760('0x21'),{'options':{'where':{'id':_0x16e8d6},'attributes':['id','name']}});};exports[_0x7760('0x22')]=function(_0x34fbfb){return request('CreateSmsMessage',{'body':_0x34fbfb});};exports[_0x7760('0x23')]=function(_0x5ba9c4){return request(_0x7760('0x24'),{'body':_0x5ba9c4});};exports[_0x7760('0x25')]=function(_0x8dc032){return request(_0x7760('0x26'),{'body':_[_0x7760('0x27')](_0x8dc032,{'project_name':_0x8dc032['arg_1'],'prev_project_name':_0x8dc032[_0x7760('0x28')]||'','is_subproject':_0x8dc032[_0x7760('0x28')]?!![]:![],'leaveAt':moment()[_0x7760('0x29')](_0x7760('0x2a'))})});};exports[_0x7760('0x2b')]=function(_0x35866d){return request('CreateSquareRecording',{'body':_0x35866d});};exports['createSquareMessage']=function(_0x2bc907){return request(_0x7760('0x2c'),{'body':_0x2bc907});};exports[_0x7760('0x2d')]=function(_0x190059){return request(_0x7760('0x2e'),{'options':{'raw':![],'where':{'phone':_0x190059[_0x7760('0x2f')],'ListId':_0x190059[_0x7760('0x30')]}}})[_0x7760('0x7')](function(_0x4acd40){if(_0x4acd40){return _0x4acd40;}return request(_0x7760('0x31'),{'body':_0x190059});});};exports[_0x7760('0x32')]=function(_0x1ccb86){return request('ShowPause',{'options':{'where':{'id':_0x1ccb86},'attributes':[_0x7760('0xf')]}});};exports[_0x7760('0x33')]=function(_0x5a791c,_0x4c32da){return request(_0x7760('0x34'),{'body':{'interface':_0x4c32da},'options':{'where':_0x5a791c}});};exports[_0x7760('0x35')]=function(_0x281d0f,_0x2293b3,_0x1cc443){return request('PauseUser',{'body':{'type':_0x2293b3,'uniqueid':_0x1cc443},'options':{'where':_0x281d0f}});};exports['agentUnpause']=function(_0x4f25bf){return request(_0x7760('0x36'),{'body':{},'options':{'where':_0x4f25bf}});};exports[_0x7760('0x37')]=function(_0x2141e4){return request(_0x7760('0x38'),{'body':{},'options':{'where':_0x2141e4}});}; \ 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 d103f3b..9695a4a 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 _0xf446=['./polly','exports'];(function(_0x3ab816,_0x1a06b2){var _0x4ec113=function(_0x55e566){while(--_0x55e566){_0x3ab816['push'](_0x3ab816['shift']());}};_0x4ec113(++_0x1a06b2);}(_0xf446,0x1c0));var _0x6f44=function(_0x352fcb,_0xf31685){_0x352fcb=_0x352fcb-0x0;var _0x56e03e=_0xf446[_0x352fcb];return _0x56e03e;};var polly=require(_0x6f44('0x0'));var lex=require('./lex');module[_0x6f44('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4819=['exports','./lex'];(function(_0x5768d6,_0x6812cc){var _0x2f24b3=function(_0x1427ce){while(--_0x1427ce){_0x5768d6['push'](_0x5768d6['shift']());}};_0x2f24b3(++_0x6812cc);}(_0x4819,0xcd));var _0x9481=function(_0x56ab74,_0x1effda){_0x56ab74=_0x56ab74-0x0;var _0x17d8d0=_0x4819[_0x56ab74];return _0x17d8d0;};var polly=require('./polly');var lex=require(_0x9481('0x0'));module[_0x9481('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 0224136..198598e 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 _0xb4e6=['./lib/api'];(function(_0x5837d1,_0x4661e0){var _0x43b3b7=function(_0x22c638){while(--_0x22c638){_0x5837d1['push'](_0x5837d1['shift']());}};_0x43b3b7(++_0x4661e0);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0xb4e6[_0x2c0ded];return _0x4473e5;};'use strict';var lex=require(_0x6b4e('0x0'));module['exports']=function(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad){return lex(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad);}; \ No newline at end of file +var _0x2547=['exports'];(function(_0x9cd6d7,_0x453050){var _0x48e5d2=function(_0x532699){while(--_0x532699){_0x9cd6d7['push'](_0x9cd6d7['shift']());}};_0x48e5d2(++_0x453050);}(_0x2547,0x1cd));var _0x7254=function(_0x4a233c,_0x5edc48){_0x4a233c=_0x4a233c-0x0;var _0x4940c6=_0x2547[_0x4a233c];return _0x4940c6;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ 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 f88f379..91e899c 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(_0x205e9a,_0x2d8807){var _0x3b7f79=function(_0x2a5927){while(--_0x2a5927){_0x205e9a['push'](_0x205e9a['shift']());}};_0x3b7f79(++_0x2d8807);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x37fada,_0x539b8b){var _0x5329ec=function(_0x9c9950){while(--_0x9c9950){_0x37fada['push'](_0x37fada['shift']());}};_0x5329ec(++_0x539b8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 069bd9a..68c4459 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 _0x98ea=['./lib/api','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x98ea,0xbe));var _0xa98e=function(_0x76f48c,_0x4a2265){_0x76f48c=_0x76f48c-0x0;var _0x2825db=_0x98ea[_0x76f48c];return _0x2825db;};'use strict';var polly=require(_0xa98e('0x0'));module[_0xa98e('0x1')]=function(_0x17f050,_0x2ccdef,_0x42a394,_0x20b72a,_0x16b6ae,_0x37e004,_0x39ba91){return polly(_0x17f050,_0x2ccdef,_0x42a394,_0x20b72a,_0x16b6ae,_0x37e004,_0x39ba91);}; \ No newline at end of file +var _0x4a11=['./lib/api','exports'];(function(_0x5b7b24,_0x3c64f6){var _0x5511d1=function(_0x3d17a2){while(--_0x3d17a2){_0x5b7b24['push'](_0x5b7b24['shift']());}};_0x5511d1(++_0x3c64f6);}(_0x4a11,0x1ac));var _0x14a1=function(_0x3d0016,_0x4a37e0){_0x3d0016=_0x3d0016-0x0;var _0x1dcb28=_0x4a11[_0x3d0016];return _0x1dcb28;};'use strict';var polly=require(_0x14a1('0x0'));module[_0x14a1('0x1')]=function(_0x47ada3,_0x541613,_0xefb20b,_0x36ded0,_0x39b175,_0x45ecdd,_0x3d3c80){return polly(_0x47ada3,_0x541613,_0xefb20b,_0x36ded0,_0x39b175,_0x45ecdd,_0x3d3c80);}; \ 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 4eaee3e..e5c7eba 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 _0x0a25=['Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0x0a25,0x1ef));var _0x50a2=function(_0x46369a,_0x141daa){_0x46369a=_0x46369a-0x0;var _0x59e91d=_0x0a25[_0x46369a];return _0x59e91d;};'use strict';var fs=require('fs');var path=require(_0x50a2('0x0'));var BPromise=require(_0x50a2('0x1'));var rs=require(_0x50a2('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x4d9076,_0x23601d,_0x2a8160){return new BPromise(function(_0x18c793,_0x347d6c){_0x4d9076[_0x50a2('0x3')](_0x23601d,function(_0x4783e3,_0xc1435c){if(_0x4783e3){_0x347d6c(_0x4783e3);}else if(_0xc1435c){if(_0xc1435c[_0x50a2('0x4')]instanceof Buffer){fs[_0x50a2('0x5')](_0x2a8160,_0xc1435c['AudioStream'],function(_0x2a9dc1){if(_0x2a9dc1){_0x347d6c(_0x2a9dc1);}else{_0x18c793();}});}else{_0x347d6c(new Error(_0x50a2('0x6')));}}else{_0x347d6c(new Error(_0x50a2('0x7')));}});});}module[_0x50a2('0x8')]=function(_0x1f1e64,_0x21019a,_0xaa4202,_0x5a19f5,_0x258366,_0x1c2476,_0x24609c){var _0x606bb0=new AWS[(_0x50a2('0x9'))]({'accessKeyId':_0x1f1e64,'secretAccessKey':_0x21019a,'region':_0xaa4202});var _0xbbe412={'Text':_0x258366,'TextType':_0x1c2476||_0x50a2('0xa'),'OutputFormat':_0x50a2('0xb'),'VoiceId':_0x5a19f5};return pollyResult(_0x606bb0,_0xbbe412,_0x24609c);}; \ No newline at end of file +var _0x8616=['randomstring','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x20b89f,_0x5b487f){var _0x4e1a55=function(_0x10dd56){while(--_0x10dd56){_0x20b89f['push'](_0x20b89f['shift']());}};_0x4e1a55(++_0x5b487f);}(_0x8616,0x1c7));var _0x6861=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x8616[_0x96f74c];return _0x379222;};'use strict';var fs=require('fs');var path=require(_0x6861('0x0'));var BPromise=require('bluebird');var rs=require(_0x6861('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x883e9e,_0x24b3f3,_0x4622ff){return new BPromise(function(_0x32c184,_0x1e7176){_0x883e9e['synthesizeSpeech'](_0x24b3f3,function(_0x387848,_0x423c7a){if(_0x387848){_0x1e7176(_0x387848);}else if(_0x423c7a){if(_0x423c7a[_0x6861('0x2')]instanceof Buffer){fs['writeFile'](_0x4622ff,_0x423c7a[_0x6861('0x2')],function(_0x363e79){if(_0x363e79){_0x1e7176(_0x363e79);}else{_0x32c184();}});}else{_0x1e7176(new Error(_0x6861('0x3')));}}else{_0x1e7176(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x6861('0x4')]=function(_0x3991ef,_0x8d8092,_0x3ff6c5,_0xe43e23,_0x9efe0b,_0x48b1b8,_0x18bec8){var _0x40824e=new AWS[(_0x6861('0x5'))]({'accessKeyId':_0x3991ef,'secretAccessKey':_0x8d8092,'region':_0x3ff6c5});var _0xffd11a={'Text':_0x9efe0b,'TextType':_0x48b1b8||_0x6861('0x6'),'OutputFormat':_0x6861('0x7'),'VoiceId':_0xe43e23};return pollyResult(_0x40824e,_0xffd11a,_0x18bec8);}; \ 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 dd82666..85ebdc7 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x5d8864,_0x27f80d,_0x427842,_0x3e032a){return asr(_0x5d8864,_0x27f80d,_0x427842);}; \ No newline at end of file +var _0xb487=['./lib/api'];(function(_0x183d0e,_0x1f520f){var _0x278ff8=function(_0x49b6d1){while(--_0x49b6d1){_0x183d0e['push'](_0x183d0e['shift']());}};_0x278ff8(++_0x1f520f);}(_0xb487,0x159));var _0x7b48=function(_0x7d962d,_0x557a6f){_0x7d962d=_0x7d962d-0x0;var _0x22ddbc=_0xb487[_0x7d962d];return _0x22ddbc;};'use strict';var asr=require(_0x7b48('0x0'));module['exports']=function(_0x1e46ae,_0x53737e,_0x11fdeb,_0x332ce1){return asr(_0x1e46ae,_0x53737e,_0x11fdeb);}; \ 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 108e5ce..049c4f0 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 _0x2c54=['undefined','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','length','key\x20should\x20be\x20a\x20string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c54,0x136));var _0x42c5=function(_0x20c470,_0x535c5e){_0x20c470=_0x20c470-0x0;var _0x189482=_0x2c54[_0x20c470];return _0x189482;};'use strict';var url=require(_0x42c5('0x0'));var BPromise=require(_0x42c5('0x1'));var fs=require('fs');var host=_0x42c5('0x2');module['exports']=function(_0xbe3529,_0x46bcc4,_0x3d5e1d){return new BPromise(function(_0x253cc1,_0x2407d0){var _0x17924f;if(typeof _0xbe3529!=='string'||_0xbe3529[_0x42c5('0x3')]===0x0){return _0x2407d0('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x46bcc4!=='string'||_0x46bcc4[_0x42c5('0x3')]===0x0){return _0x2407d0(_0x42c5('0x4'));}if(typeof _0x3d5e1d!==_0x42c5('0x5')&&(typeof _0x3d5e1d!==_0x42c5('0x6')||_0x3d5e1d[_0x42c5('0x3')]===0x0)){return _0x2407d0(_0x42c5('0x7'));}try{_0x17924f=fs[_0x42c5('0x8')](_0xbe3529)[_0x42c5('0x9')](_0x42c5('0xa'));}catch(_0x186f79){return _0x2407d0(_0x186f79);}return _0x253cc1({'method':_0x42c5('0xb'),'uri':host+_0x42c5('0xc')+_0x46bcc4,'body':{'config':{'encoding':_0x42c5('0xd'),'sampleRateHertz':_0x42c5('0xe'),'languageCode':_0x3d5e1d},'audio':{'content':_0x17924f}},'json':!![]});});}; \ No newline at end of file +var _0x7119=['base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7119,0x1c7));var _0x9711=function(_0x5e6515,_0x2954b1){_0x5e6515=_0x5e6515-0x0;var _0xd33ce2=_0x7119[_0x5e6515];return _0xd33ce2;};'use strict';var url=require('url');var BPromise=require(_0x9711('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x9711('0x1')]=function(_0x5843e8,_0x347925,_0x443d8f){return new BPromise(function(_0x36cd4d,_0x2de7dd){var _0x47dda0;if(typeof _0x5843e8!==_0x9711('0x2')||_0x5843e8[_0x9711('0x3')]===0x0){return _0x2de7dd(_0x9711('0x4'));}if(typeof _0x347925!==_0x9711('0x2')||_0x347925[_0x9711('0x3')]===0x0){return _0x2de7dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x443d8f!==_0x9711('0x5')&&(typeof _0x443d8f!==_0x9711('0x2')||_0x443d8f[_0x9711('0x3')]===0x0)){return _0x2de7dd('lang\x20should\x20be\x20a\x20string');}try{_0x47dda0=fs[_0x9711('0x6')](_0x5843e8)['toString'](_0x9711('0x7'));}catch(_0x16e820){return _0x2de7dd(_0x16e820);}return _0x36cd4d({'method':_0x9711('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x347925,'body':{'config':{'encoding':_0x9711('0x9'),'sampleRateHertz':_0x9711('0xa'),'languageCode':_0x443d8f},'audio':{'content':_0x47dda0}},'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 113e475..3f286c7 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 _0xbc97=['exports','./asr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbc97,0x1e5));var _0x7bc9=function(_0x434e9c,_0x52245a){_0x434e9c=_0x434e9c-0x0;var _0xe6bd07=_0xbc97[_0x434e9c];return _0xe6bd07;};var asr=require(_0x7bc9('0x0'));module[_0x7bc9('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6277=['./asr','exports'];(function(_0x27b51a,_0x1ecfd7){var _0x1205e6=function(_0x5c8f8a){while(--_0x5c8f8a){_0x27b51a['push'](_0x27b51a['shift']());}};_0x1205e6(++_0x1ecfd7);}(_0x6277,0x8a));var _0x7627=function(_0xf94257,_0x28a889){_0xf94257=_0xf94257-0x0;var _0x3af135=_0x6277[_0xf94257];return _0x3af135;};var asr=require(_0x7627('0x0'));module[_0x7627('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 77e94df..97743c5 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 _0xff6b=['CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','dialogflow','http','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','chmodSync','777','split','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','MP3','text:synthesize','POST','then','.mp3','from','writeFile','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.wav','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','resolvedQuery','action','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData'];(function(_0x6672bd,_0x367417){var _0x7acf4a=function(_0x4bf70f){while(--_0x4bf70f){_0x6672bd['push'](_0x6672bd['shift']());}};_0x7acf4a(++_0x367417);}(_0xff6b,0x10b));var _0xbff6=function(_0x1c842e,_0x320f71){_0x1c842e=_0x1c842e-0x0;var _0x25321d=_0xff6b[_0x1c842e];return _0x25321d;};'use strict';var apiai=require(_0xbff6('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xbff6('0x1'));var fs=require('fs');var http=require(_0xbff6('0x2'));var https=require('https');var md5=require(_0xbff6('0x3'));var path=require(_0xbff6('0x4'));var querystring=require(_0xbff6('0x5'));var rp=require(_0xbff6('0x6'));var rs=require(_0xbff6('0x7'));var sox=require(_0xbff6('0x8'));var tts=require(_0xbff6('0x9'));var urlParse=require('url')[_0xbff6('0xa')];var util=require(_0xbff6('0xb'));var aws=require('./aws');var google=require(_0xbff6('0xc'));var sestek=require(_0xbff6('0xd'));var tilde=require('./tilde');var logger=require(_0xbff6('0xe'))(_0xbff6('0xf'));var ISPEECH_API=_0xbff6('0x10');function downloadFile(_0x33ddec,_0x51908e){return new BPromise(function(_0x3885c5,_0x356df3){var _0x4cdb12=urlParse(_0x33ddec);var _0x59ed8f=_0x4cdb12[_0xbff6('0x11')]===_0xbff6('0x12')?https:http;var _0x5a8b8f={'host':_0x4cdb12[_0xbff6('0x13')],'path':_0x4cdb12['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x59ed8f[_0xbff6('0x14')](_0x5a8b8f,function(_0x290969){if(_0x290969[_0xbff6('0x15')]!==0xc8){logger[_0xbff6('0x16')](_0xbff6('0x17')+_0x33ddec+_0xbff6('0x18')+_0x290969[_0xbff6('0x15')]+'\x20('+_0x290969[_0xbff6('0x19')]+')');_0x356df3(new Error(_0xbff6('0x17')+_0x33ddec+_0xbff6('0x18')+_0x290969[_0xbff6('0x15')]+'\x20('+_0x290969[_0xbff6('0x19')]+')'));return;}var _0x389ae7=fs[_0xbff6('0x1a')](_0x51908e);_0x389ae7['on'](_0xbff6('0x1b'),function(){logger[_0xbff6('0x1c')](_0xbff6('0x1d'));_0x389ae7[_0xbff6('0x1e')](_0x3885c5);});_0x389ae7['on'](_0xbff6('0x16'),function(_0x217d71){fs[_0xbff6('0x1f')](_0x51908e);logger[_0xbff6('0x16')](_0xbff6('0x20'),_0x217d71);_0x356df3(_0x217d71);});_0x290969['pipe'](_0x389ae7);})['on']('error',function(_0x380204){logger['error'](_0x380204);_0x356df3(_0x380204);})[_0xbff6('0x21')]();});}function uploadFile(_0x1a80dd){return new BPromise(function(_0x28ce9e,_0x21aed2){var _0x4e8017=urlParse(_0x1a80dd);var _0x291063=_0x4e8017[_0xbff6('0x11')]===_0xbff6('0x12')?https:http;var _0x33540={'host':_0x4e8017[_0xbff6('0x13')],'path':_0x4e8017[_0xbff6('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x291063[_0xbff6('0x14')](_0x33540,function(_0x1ccf08){if(_0x1ccf08[_0xbff6('0x15')]!==0xc8){_0x21aed2(new Error(_0xbff6('0x17')+_0x1a80dd+_0xbff6('0x18')+_0x1ccf08[_0xbff6('0x15')]+'\x20('+_0x1ccf08[_0xbff6('0x19')]+')'));return;}var _0x5eeba6='';_0x1ccf08['on'](_0xbff6('0x22'),function(_0x28301a){_0x5eeba6+=_0x28301a;});_0x1ccf08['on'](_0xbff6('0x21'),function(){_0x28ce9e(_0x5eeba6);});})['on'](_0xbff6('0x16'),function(_0x4cd137){_0x21aed2(_0x4cd137);})[_0xbff6('0x21')]();});}function convertFile(_0x3321c9,_0x5586f3){return new BPromise(function(_0x4fb82c,_0x4ed3bb){var _0x14ab2d=sox['transcode'](_0x3321c9,_0x5586f3,{'sampleRate':0x1f40,'format':_0xbff6('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x14ab2d['on'](_0xbff6('0x16'),function(_0xba9879){logger[_0xbff6('0x16')](_0xbff6('0x24'),_0xba9879);_0x4ed3bb(_0xba9879);});_0x14ab2d['on']('end',function(){logger[_0xbff6('0x1c')](_0xbff6('0x25'));_0x4fb82c();});_0x14ab2d[_0xbff6('0x26')]();});}function base64Decode(_0x5d4e69,_0x307cd4){var _0x5e4554=path[_0xbff6('0x27')](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+'.wav');fs[_0xbff6('0x2a')](_0x5e4554,_0x5d4e69,'base64');return convertFile(_0x5e4554,_0x307cd4)['then'](function(){try{fs[_0xbff6('0x1f')](_0x5e4554);fs[_0xbff6('0x2b')](_0x307cd4,_0xbff6('0x2c'));}catch(_0x5365ac){logger['error'](_0x5365ac);}return _0x307cd4[_0xbff6('0x2d')]('.')[0x0];});}function base64Encode(_0x185653){var _0xb820f=fs['readFileSync'](_0x185653);return new Buffer(_0xb820f)[_0xbff6('0x2e')](_0xbff6('0x2f'));}exports[_0xbff6('0x30')]=function(_0x2b2d27,_0x2afda4,_0x40907d,_0x37c149,_0x1da582,_0xa9e5af){var _0x1c4d32,_0x2ae275;var _0x430f44=_0xbff6('0x31');var _0x9b3da8='?key='+_0x2b2d27;var _0x3813ec={};if(_0x2afda4===_0xbff6('0x32')){_0x3813ec[_0xbff6('0x33')]={'ssml':_0x40907d};}else{_0x3813ec[_0xbff6('0x33')]={'text':_0x40907d};};_0x3813ec[_0xbff6('0x34')]={'languageCode':_0x37c149,'ssmlGender':_0x1da582};_0x3813ec['audioConfig']={'audioEncoding':_0xbff6('0x35'),'sampleRateHertz':0x1f40};var _0x6f74b9={'url':_0x430f44+_0xbff6('0x36')+_0x9b3da8,'method':_0xbff6('0x37'),'json':!![],'body':_0x3813ec};return rp(_0x6f74b9)[_0xbff6('0x38')](function(_0x34e520){return new BPromise(function(_0x191e79,_0x225a5c){_0x1c4d32=path[_0xbff6('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0xbff6('0x39'));var _0x5568d8=Buffer[_0xbff6('0x3a')](_0x34e520['audioContent'],_0xbff6('0x2f'));return fs[_0xbff6('0x3b')](_0x1c4d32,_0x5568d8,function(_0x5e89c0){_0x225a5c(_0x5e89c0);},function(_0x49e778){fs[_0xbff6('0x2b')](_0x1c4d32,_0xbff6('0x2c'));_0x191e79(_0x49e778);});});})[_0xbff6('0x38')](function(_0x127e36){_0x2ae275=path[_0xbff6('0x27')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x1c4d32,_0x2ae275);})['then'](function(){try{fs[_0xbff6('0x1f')](_0x1c4d32);fs[_0xbff6('0x2b')](_0x2ae275,_0xbff6('0x2c'));}catch(_0x3c7441){logger['error'](_0x3c7441);}logger['info']('googleCloudTTS\x20path',_0x2ae275[_0xbff6('0x2d')]('.')[0x0]);return _0x2ae275[_0xbff6('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x3de6da,_0x3759f5){var _0x3874f6=_0xbff6('0x3c');var _0x497095,_0x28861a;var _0x130fb0;var _0x1a88b7={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x3874f6,'headers':{'Content-Type':_0xbff6('0x3d')},'body':_0xbff6('0x3e')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x3de6da,_0x3759f5||'en',![],_0xbff6('0x3f')]),null,_0xbff6('0x40')]]]))};return rp(_0x1a88b7)[_0xbff6('0x38')](function(_0x4cbf6d){try{_0x130fb0=eval(_0x4cbf6d[_0xbff6('0x41')](0x5))[0x0][0x2];}catch(_0x2f8e25){throw new Error(_0xbff6('0x42')+_0x4cbf6d['data']);}if(!_0x130fb0){if(_0x3de6da['length']>0xc8){throw new Error(_0xbff6('0x43'));}else{throw new Error(_0xbff6('0x44')+_0x3759f5+_0xbff6('0x45'));}}try{_0x130fb0=eval(_0x130fb0)[0x0];}catch(_0x4da6d0){throw new Error(_0xbff6('0x42')+res[_0xbff6('0x22')]);}const _0x558150=_0x130fb0;_0x497095=path[_0xbff6('0x27')](__dirname,_0xbff6('0x28'),rs['generate'](0x4)+'.mp3');fs[_0xbff6('0x2a')](_0x497095,_0x130fb0,{'encoding':_0xbff6('0x2f')});_0x28861a=path[_0xbff6('0x27')](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+_0xbff6('0x46'));return convertFile(_0x497095,_0x28861a);})[_0xbff6('0x38')](function(){try{fs['unlink'](_0x497095);fs[_0xbff6('0x2b')](_0x28861a,_0xbff6('0x2c'));}catch(_0x50e5fa){logger[_0xbff6('0x16')](_0x50e5fa);}logger['info']('goggleTTS\x20path',_0x28861a[_0xbff6('0x2d')]('.')[0x0]);return _0x28861a[_0xbff6('0x2d')]('.')[0x0];});};exports['googleASR']=function(_0x102a69,_0x367821,_0x35e31e){return google[_0xbff6('0x47')](_0x102a69,_0x367821,_0x35e31e)[_0xbff6('0x38')](function(_0x8088bf){logger[_0xbff6('0x1c')](_0x8088bf[_0xbff6('0x48')]);return rp(_0x8088bf);})['then'](function(_0x3cefbd){var _0x2ed46c='';var _0x27d4e6=0x0;try{fs[_0xbff6('0x1f')](_0x102a69);}catch(_0x2875e4){logger[_0xbff6('0x16')](_0x2875e4);}if(_0x3cefbd&&_0x3cefbd[_0xbff6('0x49')]){_0x2ed46c=_0x3cefbd[_0xbff6('0x49')]['map'](function(_0x8b9c6c){return _0x8b9c6c&&_0x8b9c6c[_0xbff6('0x4a')][0x0]&&_0x8b9c6c[_0xbff6('0x4a')][0x0][_0xbff6('0x4b')]?_0x8b9c6c['alternatives'][0x0]['transcript']:'';})[_0xbff6('0x4c')]('\x0a');_0x27d4e6=_0x3cefbd[_0xbff6('0x49')][_0xbff6('0x4d')](function(_0x4176c3){return _0x4176c3&&_0x4176c3[_0xbff6('0x4a')][0x0]&&_0x4176c3['alternatives'][0x0][_0xbff6('0x4e')]?_0x4176c3['alternatives'][0x0][_0xbff6('0x4e')]:0x0;})[_0xbff6('0x4c')]('\x0a');}logger[_0xbff6('0x1c')](_0xbff6('0x4f'),_0x2ed46c);logger[_0xbff6('0x1c')](_0xbff6('0x50'),_0x27d4e6);return{'transcript':_0x2ed46c,'confidence':_0x27d4e6};})[_0xbff6('0x51')](function(_0x79847a){logger[_0xbff6('0x16')](_0xbff6('0x52'),_0x79847a[_0xbff6('0x15')],_0x79847a['name'],_0x79847a['message']);});};exports[_0xbff6('0x53')]=function(_0x4536ba,_0x40ad5b,_0x36c5e3,_0x398eb6){var _0x1a634e=apiai(_0x40ad5b,{'language':_0x398eb6||'en'});return _0x1a634e[_0xbff6('0x54')](_0x36c5e3,{'sessionId':md5(_0x4536ba)})['then'](function(_0x464b7c){logger[_0xbff6('0x1c')](JSON['stringify'](_0x464b7c));return{'source':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x56')],'resolvedQuery':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x57')],'action':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x58')],'actionIncomplete':_0x464b7c[_0xbff6('0x55')]['actionIncomplete'],'speech':_0x464b7c['result']['fulfillment'][_0xbff6('0x59')],'score':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x5a')],'statusCode':_0x464b7c[_0xbff6('0x5b')][_0xbff6('0x5c')],'endConversation':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x5d')]['endConversation']||![],'isFallbackIntent':_0x464b7c[_0xbff6('0x55')][_0xbff6('0x5d')][_0xbff6('0x5e')]};});};exports[_0xbff6('0x5f')]=function(_0x168ab0,_0xdcbec2,_0x4f3482,_0x590352,_0x449d20,_0xc8de64){var _0x3ec6a8=_0x590352['replace'](/\\n/g,'\x0a');var _0x14f7c6={'credentials':{'private_key':_0x3ec6a8,'client_email':_0x4f3482}};var _0xcd51ea=new dialogflow[(_0xbff6('0x60'))](_0x14f7c6);var _0x68dbc3=_0xcd51ea[_0xbff6('0x61')](_0xdcbec2,md5(_0x168ab0));var _0x1415e9={'session':_0x68dbc3,'queryInput':{'text':{'text':_0x449d20,'languageCode':_0xc8de64}}};return _0xcd51ea[_0xbff6('0x62')](_0x1415e9)[_0xbff6('0x38')](function(_0x5182e7){if(_0x5182e7&&_0x5182e7[_0xbff6('0x63')]){logger['info'](_0xbff6('0x64'),JSON[_0xbff6('0x65')](_0x5182e7));var _0x374d37=_0x5182e7[0x0];if(_0x374d37){var _0x580f39={'action':_0x374d37[_0xbff6('0x66')]['action'],'allRequiredParamsPresent':_0x374d37['queryResult'][_0xbff6('0x67')],'endConversation':_0x374d37[_0xbff6('0x66')][_0xbff6('0x68')]&&_0x374d37[_0xbff6('0x66')][_0xbff6('0x68')][_0xbff6('0x69')]?_0x374d37['queryResult'][_0xbff6('0x68')][_0xbff6('0x69')][_0xbff6('0x6a')][_0xbff6('0x6b')]:![],'fulfillmentText':_0x374d37['queryResult'][_0xbff6('0x6c')],'intentName':_0x374d37['queryResult'][_0xbff6('0x6d')][_0xbff6('0x6e')],'intentDisplayName':_0x374d37[_0xbff6('0x66')][_0xbff6('0x6d')][_0xbff6('0x6f')],'isFallbackIntent':_0x374d37[_0xbff6('0x66')][_0xbff6('0x6d')][_0xbff6('0x70')],'languageCode':_0x374d37[_0xbff6('0x66')]['languageCode'],'queryText':_0x374d37[_0xbff6('0x66')]['queryText'],'responseId':_0x374d37[_0xbff6('0x71')],'score':_0x374d37[_0xbff6('0x66')]['intentDetectionConfidence'],'speech':_0x374d37[_0xbff6('0x66')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x5182e7)};return _0x580f39;}}});};exports[_0xbff6('0x72')]=function(_0x5e8e6c,_0x393028,_0x12e16b,_0x253242){return tilde[_0xbff6('0x47')](_0x5e8e6c,_0x393028,_0x12e16b,_0x253242)['then'](function(_0x446756){try{fs['unlink'](_0x5e8e6c);}catch(_0x9c7128){logger['error'](_0x9c7128);}logger[_0xbff6('0x1c')](_0xbff6('0x73'),_0x446756['transcript']);logger[_0xbff6('0x1c')](_0xbff6('0x74'),_0x446756[_0xbff6('0x4e')]);return _0x446756;});};exports[_0xbff6('0x75')]=function(_0x18f4f1,_0x5ac8f7,_0x4746f4,_0x3396ed,_0xb23a75,_0xad4cfc){var _0x2acf97=path[_0xbff6('0x27')](__dirname,'tmp',rs[_0xbff6('0x29')](0x4)+_0xbff6('0x39'));var _0x19b222;return aws['polly'](_0x18f4f1,_0x5ac8f7,_0x4746f4,_0x3396ed,_0xb23a75,_0xad4cfc,_0x2acf97)[_0xbff6('0x38')](function(){_0x19b222=path['resolve'](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+_0xbff6('0x46'));return convertFile(_0x2acf97,_0x19b222);})['then'](function(){try{fs[_0xbff6('0x1f')](_0x2acf97);fs[_0xbff6('0x2b')](_0x19b222,_0xbff6('0x2c'));}catch(_0x156183){logger[_0xbff6('0x16')](_0x156183);}return _0x19b222[_0xbff6('0x2d')]('.')[0x0];});};exports[_0xbff6('0x76')]=function(_0x427e88,_0x1afc88,_0x3f7d65,_0x2fd714,_0x571f1a,_0x128a66){return aws['lex'](_0x427e88,_0x1afc88,_0x3f7d65,_0x2fd714,_0x571f1a,_0x128a66)[_0xbff6('0x38')](function(_0x49c802){logger[_0xbff6('0x1c')](JSON['stringify'](_0x49c802));return _0x49c802;});};exports['ispeechTTS']=function(_0x1282a4,_0x1caf9b,_0x43a1fb,_0x4ca93a){var _0x2b6800=util[_0xbff6('0x77')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1282a4,encodeURIComponent(_0x1caf9b),_0x43a1fb,_0x4ca93a);var _0x5d83d5=path['resolve'](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+_0xbff6('0x39'));var _0x51d3e8;return downloadFile(_0x2b6800,_0x5d83d5)['then'](function(){_0x51d3e8=path[_0xbff6('0x27')](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+_0xbff6('0x46'));return convertFile(_0x5d83d5,_0x51d3e8);})[_0xbff6('0x38')](function(){try{fs[_0xbff6('0x1f')](_0x5d83d5);fs['chmodSync'](_0x51d3e8,_0xbff6('0x2c'));}catch(_0x4a2a0b){logger[_0xbff6('0x16')](_0x4a2a0b);}return _0x51d3e8[_0xbff6('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x5d1103,_0x596da0,_0x44f26f,_0x3ee4a3){var _0x1494f0=util[_0xbff6('0x77')](_0xbff6('0x78'),ISPEECH_API,_0x596da0,_0x44f26f,base64Encode(_0x5d1103),_0x3ee4a3?util['format']('model=%s',encodeURIComponent(_0x3ee4a3)):_0xbff6('0x79'));return uploadFile(_0x1494f0)[_0xbff6('0x38')](function(_0x374c20){return querystring[_0xbff6('0xa')](_0x374c20);});};exports[_0xbff6('0x7a')]=function(_0x2e68ed,_0x2f2c83){return sestek[_0xbff6('0x7b')](_0x2e68ed,_0x2f2c83)[_0xbff6('0x38')](function(_0x101da8){logger[_0xbff6('0x1c')](JSON['stringify'](_0x101da8));var _0x525ab2={'speech':_0x101da8[_0xbff6('0x7c')],'action':_0x101da8[_0xbff6('0x7d')]?_0x101da8[_0xbff6('0x7d')][_0xbff6('0x7e')]:undefined,'actiondata':_0x101da8['channelData']?_0x101da8['channelData'][_0xbff6('0x7f')]:undefined};if(_0x101da8['channelData']&&_0x101da8['channelData'][_0xbff6('0x80')]){return base64Decode(_0x101da8[_0xbff6('0x7d')][_0xbff6('0x80')][_0xbff6('0x81')],path[_0xbff6('0x27')](__dirname,_0xbff6('0x28'),rs[_0xbff6('0x29')](0x4)+'.wav'))[_0xbff6('0x38')](function(_0x3e183d){_0x525ab2[_0xbff6('0x82')]=_0x3e183d;return _0x525ab2;});}return _0x525ab2;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x2469=['tmp','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','speech','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','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','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','request\x20to\x20','data','transcode','start','resolve','generate','.wav','writeFileSync','base64','chmodSync','777','split','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','then'];(function(_0x7773ea,_0xfe0220){var _0x2920e4=function(_0x10d228){while(--_0x10d228){_0x7773ea['push'](_0x7773ea['shift']());}};_0x2920e4(++_0xfe0220);}(_0x2469,0xd6));var _0x9246=function(_0x3ae782,_0xbc6964){_0x3ae782=_0x3ae782-0x0;var _0x57865c=_0x2469[_0x3ae782];return _0x57865c;};'use strict';var apiai=require(_0x9246('0x0'));var BPromise=require(_0x9246('0x1'));var dialogflow=require(_0x9246('0x2'));var fs=require('fs');var http=require(_0x9246('0x3'));var https=require(_0x9246('0x4'));var md5=require(_0x9246('0x5'));var path=require(_0x9246('0x6'));var querystring=require(_0x9246('0x7'));var rp=require(_0x9246('0x8'));var rs=require(_0x9246('0x9'));var sox=require(_0x9246('0xa'));var tts=require(_0x9246('0xb'));var urlParse=require('url')[_0x9246('0xc')];var util=require(_0x9246('0xd'));var aws=require(_0x9246('0xe'));var google=require(_0x9246('0xf'));var sestek=require(_0x9246('0x10'));var tilde=require(_0x9246('0x11'));var logger=require(_0x9246('0x12'))('agi');var ISPEECH_API=_0x9246('0x13');function downloadFile(_0x118923,_0x3d9e52){return new BPromise(function(_0x30aadf,_0x2b9b34){var _0x36de19=urlParse(_0x118923);var _0x33ae4d=_0x36de19['protocol']===_0x9246('0x14')?https:http;var _0x23593b={'host':_0x36de19[_0x9246('0x15')],'path':_0x36de19['path'],'headers':{'user-agent':_0x9246('0x16')}};_0x33ae4d[_0x9246('0x17')](_0x23593b,function(_0x751a54){if(_0x751a54[_0x9246('0x18')]!==0xc8){logger[_0x9246('0x19')]('request\x20to\x20'+_0x118923+_0x9246('0x1a')+_0x751a54['statusCode']+'\x20('+_0x751a54['statusMessage']+')');_0x2b9b34(new Error('request\x20to\x20'+_0x118923+_0x9246('0x1a')+_0x751a54['statusCode']+'\x20('+_0x751a54[_0x9246('0x1b')]+')'));return;}var _0x5b9fd2=fs[_0x9246('0x1c')](_0x3d9e52);_0x5b9fd2['on'](_0x9246('0x1d'),function(){logger[_0x9246('0x1e')](_0x9246('0x1f'));_0x5b9fd2[_0x9246('0x20')](_0x30aadf);});_0x5b9fd2['on']('error',function(_0x31057b){fs[_0x9246('0x21')](_0x3d9e52);logger['error'](_0x9246('0x22'),_0x31057b);_0x2b9b34(_0x31057b);});_0x751a54['pipe'](_0x5b9fd2);})['on'](_0x9246('0x19'),function(_0x26d15d){logger['error'](_0x26d15d);_0x2b9b34(_0x26d15d);})[_0x9246('0x23')]();});}function uploadFile(_0x46a3e0){return new BPromise(function(_0x2b5f47,_0x4d0037){var _0x14b639=urlParse(_0x46a3e0);var _0x3b5a1d=_0x14b639['protocol']===_0x9246('0x14')?https:http;var _0x55a33a={'host':_0x14b639['host'],'path':_0x14b639[_0x9246('0x6')],'headers':{'user-agent':_0x9246('0x16')}};_0x3b5a1d['get'](_0x55a33a,function(_0x415c43){if(_0x415c43[_0x9246('0x18')]!==0xc8){_0x4d0037(new Error(_0x9246('0x24')+_0x46a3e0+_0x9246('0x1a')+_0x415c43[_0x9246('0x18')]+'\x20('+_0x415c43[_0x9246('0x1b')]+')'));return;}var _0x1854bb='';_0x415c43['on'](_0x9246('0x25'),function(_0x422353){_0x1854bb+=_0x422353;});_0x415c43['on'](_0x9246('0x23'),function(){_0x2b5f47(_0x1854bb);});})['on'](_0x9246('0x19'),function(_0x3b54ee){_0x4d0037(_0x3b54ee);})[_0x9246('0x23')]();});}function convertFile(_0x276c10,_0x1b10b3){return new BPromise(function(_0x1b4a5e,_0x428224){var _0x5869c8=sox[_0x9246('0x26')](_0x276c10,_0x1b10b3,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5869c8['on'](_0x9246('0x19'),function(_0xac3a91){logger[_0x9246('0x19')]('error\x20convert',_0xac3a91);_0x428224(_0xac3a91);});_0x5869c8['on'](_0x9246('0x23'),function(){logger[_0x9246('0x1e')]('finish\x20to\x20convert');_0x1b4a5e();});_0x5869c8[_0x9246('0x27')]();});}function base64Decode(_0x2cb471,_0x1ff5fd){var _0x3cf3ed=path[_0x9246('0x28')](__dirname,'tmp',rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));fs[_0x9246('0x2b')](_0x3cf3ed,_0x2cb471,_0x9246('0x2c'));return convertFile(_0x3cf3ed,_0x1ff5fd)['then'](function(){try{fs[_0x9246('0x21')](_0x3cf3ed);fs[_0x9246('0x2d')](_0x1ff5fd,_0x9246('0x2e'));}catch(_0x5f79fc){logger[_0x9246('0x19')](_0x5f79fc);}return _0x1ff5fd[_0x9246('0x2f')]('.')[0x0];});}function base64Encode(_0x498c8e){var _0x459b9c=fs['readFileSync'](_0x498c8e);return new Buffer(_0x459b9c)['toString'](_0x9246('0x2c'));}exports[_0x9246('0x30')]=function(_0x5a2ab9,_0x448df8,_0x4013f4,_0x592d1f,_0x28d0a0,_0x3422d6){var _0x490fa9,_0x653d6a;var _0xf439bd=_0x9246('0x31');var _0x413f80='?key='+_0x5a2ab9;var _0x156851={};if(_0x448df8==='ssml'){_0x156851[_0x9246('0x32')]={'ssml':_0x4013f4};}else{_0x156851[_0x9246('0x32')]={'text':_0x4013f4};};_0x156851[_0x9246('0x33')]={'languageCode':_0x592d1f,'ssmlGender':_0x28d0a0};_0x156851[_0x9246('0x34')]={'audioEncoding':_0x9246('0x35'),'sampleRateHertz':0x1f40};var _0x28aaf6={'url':_0xf439bd+_0x9246('0x36')+_0x413f80,'method':'POST','json':!![],'body':_0x156851};return rp(_0x28aaf6)[_0x9246('0x37')](function(_0xd5b8a1){return new BPromise(function(_0x354307,_0x177f81){_0x490fa9=path['resolve'](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x356ba7=Buffer[_0x9246('0x3a')](_0xd5b8a1[_0x9246('0x3b')],_0x9246('0x2c'));return fs[_0x9246('0x3c')](_0x490fa9,_0x356ba7,function(_0x2b6224){_0x177f81(_0x2b6224);},function(_0x558521){fs[_0x9246('0x2d')](_0x490fa9,'777');_0x354307(_0x558521);});});})[_0x9246('0x37')](function(_0x71eeca){_0x653d6a=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x490fa9,_0x653d6a);})[_0x9246('0x37')](function(){try{fs['unlink'](_0x490fa9);fs[_0x9246('0x2d')](_0x653d6a,_0x9246('0x2e'));}catch(_0x4cc8ce){logger[_0x9246('0x19')](_0x4cc8ce);}logger[_0x9246('0x1e')](_0x9246('0x3d'),_0x653d6a[_0x9246('0x2f')]('.')[0x0]);return _0x653d6a[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x3e')]=function(_0x1c5880,_0x4e96d5){var _0x3428b4=_0x9246('0x3f');var _0x1bcb16,_0x1d51eb;var _0x5ddedf;var _0xae4798={'encoding':_0x9246('0x40'),'method':_0x9246('0x41'),'timeout':0x2710,'url':_0x3428b4,'headers':{'Content-Type':_0x9246('0x42')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x9246('0x43'),JSON[_0x9246('0x44')]([_0x1c5880,_0x4e96d5||'en',![],_0x9246('0x45')]),null,_0x9246('0x46')]]]))};return rp(_0xae4798)[_0x9246('0x37')](function(_0x365ae9){try{_0x5ddedf=eval(_0x365ae9[_0x9246('0x47')](0x5))[0x0][0x2];}catch(_0x12e9ed){throw new Error(_0x9246('0x48')+_0x365ae9[_0x9246('0x25')]);}if(!_0x5ddedf){if(_0x1c5880['length']>0xc8){throw new Error(_0x9246('0x49'));}else{throw new Error('lang\x20\x22'+_0x4e96d5+_0x9246('0x4a'));}}try{_0x5ddedf=eval(_0x5ddedf)[0x0];}catch(_0x48fbf0){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x9246('0x25')]);}const _0x41215b=_0x5ddedf;_0x1bcb16=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));fs[_0x9246('0x2b')](_0x1bcb16,_0x5ddedf,{'encoding':'base64'});_0x1d51eb=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs['generate'](0x4)+_0x9246('0x2a'));return convertFile(_0x1bcb16,_0x1d51eb);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x1bcb16);fs[_0x9246('0x2d')](_0x1d51eb,_0x9246('0x2e'));}catch(_0x1c3afb){logger['error'](_0x1c3afb);}logger['info'](_0x9246('0x4b'),_0x1d51eb[_0x9246('0x2f')]('.')[0x0]);return _0x1d51eb[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x4c')]=function(_0x3162d0,_0x2ea91f,_0x11ff49){return google['asr'](_0x3162d0,_0x2ea91f,_0x11ff49)[_0x9246('0x37')](function(_0x37a742){logger['info'](_0x37a742['uri']);return rp(_0x37a742);})[_0x9246('0x37')](function(_0x33e07d){var _0x1b6373='';var _0x2562da=0x0;try{fs[_0x9246('0x21')](_0x3162d0);}catch(_0x199f6e){logger['error'](_0x199f6e);}if(_0x33e07d&&_0x33e07d[_0x9246('0x4d')]){_0x1b6373=_0x33e07d[_0x9246('0x4d')][_0x9246('0x4e')](function(_0x27ddbf){return _0x27ddbf&&_0x27ddbf[_0x9246('0x4f')][0x0]&&_0x27ddbf[_0x9246('0x4f')][0x0][_0x9246('0x50')]?_0x27ddbf[_0x9246('0x4f')][0x0]['transcript']:'';})[_0x9246('0x51')]('\x0a');_0x2562da=_0x33e07d['results'][_0x9246('0x4e')](function(_0x18e3ba){return _0x18e3ba&&_0x18e3ba[_0x9246('0x4f')][0x0]&&_0x18e3ba['alternatives'][0x0][_0x9246('0x52')]?_0x18e3ba[_0x9246('0x4f')][0x0][_0x9246('0x52')]:0x0;})[_0x9246('0x51')]('\x0a');}logger[_0x9246('0x1e')]('googleASR\x20transcription',_0x1b6373);logger['info'](_0x9246('0x53'),_0x2562da);return{'transcript':_0x1b6373,'confidence':_0x2562da};})[_0x9246('0x54')](function(_0x201212){logger[_0x9246('0x19')]('[%s]\x20%s:%s',_0x201212[_0x9246('0x18')],_0x201212[_0x9246('0x55')],_0x201212[_0x9246('0x56')]);});};exports[_0x9246('0x57')]=function(_0x226965,_0x62952b,_0x19a3ae,_0x3e0d32){var _0x6eec58=apiai(_0x62952b,{'language':_0x3e0d32||'en'});return _0x6eec58[_0x9246('0x58')](_0x19a3ae,{'sessionId':md5(_0x226965)})['then'](function(_0x1fb215){logger['info'](JSON[_0x9246('0x44')](_0x1fb215));return{'source':_0x1fb215['result'][_0x9246('0x59')],'resolvedQuery':_0x1fb215['result'][_0x9246('0x5a')],'action':_0x1fb215[_0x9246('0x5b')][_0x9246('0x5c')],'actionIncomplete':_0x1fb215['result'][_0x9246('0x5d')],'speech':_0x1fb215[_0x9246('0x5b')]['fulfillment'][_0x9246('0x5e')],'score':_0x1fb215[_0x9246('0x5b')]['score'],'statusCode':_0x1fb215[_0x9246('0x5f')][_0x9246('0x60')],'endConversation':_0x1fb215['result'][_0x9246('0x61')][_0x9246('0x62')]||![],'isFallbackIntent':_0x1fb215[_0x9246('0x5b')][_0x9246('0x61')]['isFallbackIntent']};});};exports[_0x9246('0x63')]=function(_0x3dea28,_0x4c7cbd,_0x2d6a25,_0x971f54,_0x34e981,_0x4dbe01){var _0x23b8af=_0x971f54[_0x9246('0x64')](/\\n/g,'\x0a');var _0x5360a9={'credentials':{'private_key':_0x23b8af,'client_email':_0x2d6a25}};var _0x1baab3=new dialogflow[(_0x9246('0x65'))](_0x5360a9);var _0x5d61b7=_0x1baab3[_0x9246('0x66')](_0x4c7cbd,md5(_0x3dea28));var _0x450ba5={'session':_0x5d61b7,'queryInput':{'text':{'text':_0x34e981,'languageCode':_0x4dbe01}}};return _0x1baab3[_0x9246('0x67')](_0x450ba5)[_0x9246('0x37')](function(_0x4247d8){if(_0x4247d8&&_0x4247d8['length']){logger[_0x9246('0x1e')](_0x9246('0x68'),JSON['stringify'](_0x4247d8));var _0x5194b5=_0x4247d8[0x0];if(_0x5194b5){var _0x38aa4c={'action':_0x5194b5[_0x9246('0x69')]['action'],'allRequiredParamsPresent':_0x5194b5[_0x9246('0x69')][_0x9246('0x6a')],'endConversation':_0x5194b5['queryResult'][_0x9246('0x6b')]&&_0x5194b5[_0x9246('0x69')][_0x9246('0x6b')][_0x9246('0x6c')]?_0x5194b5[_0x9246('0x69')][_0x9246('0x6b')][_0x9246('0x6c')]['end_conversation'][_0x9246('0x6d')]:![],'fulfillmentText':_0x5194b5['queryResult']['fulfillmentText'],'intentName':_0x5194b5['queryResult'][_0x9246('0x6e')][_0x9246('0x55')],'intentDisplayName':_0x5194b5['queryResult']['intent']['displayName'],'isFallbackIntent':_0x5194b5[_0x9246('0x69')][_0x9246('0x6e')][_0x9246('0x6f')],'languageCode':_0x5194b5[_0x9246('0x69')][_0x9246('0x70')],'queryText':_0x5194b5[_0x9246('0x69')][_0x9246('0x71')],'responseId':_0x5194b5[_0x9246('0x72')],'score':_0x5194b5['queryResult'][_0x9246('0x73')],'speech':_0x5194b5[_0x9246('0x69')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x4247d8)};return _0x38aa4c;}}});};exports['tildeASR']=function(_0x10b8f8,_0x22ac2a,_0x487daf,_0x21a187){return tilde[_0x9246('0x74')](_0x10b8f8,_0x22ac2a,_0x487daf,_0x21a187)[_0x9246('0x37')](function(_0x11e10f){try{fs['unlink'](_0x10b8f8);}catch(_0x9f253b){logger[_0x9246('0x19')](_0x9f253b);}logger['info'](_0x9246('0x75'),_0x11e10f[_0x9246('0x50')]);logger['info']('Tilde\x20ASR\x20confidence',_0x11e10f[_0x9246('0x52')]);return _0x11e10f;});};exports[_0x9246('0x76')]=function(_0x47ffba,_0xc449,_0x1ca8a3,_0x5ffc1a,_0x11c110,_0x39edf5){var _0x4b8b6f=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x3fbc14;return aws[_0x9246('0x77')](_0x47ffba,_0xc449,_0x1ca8a3,_0x5ffc1a,_0x11c110,_0x39edf5,_0x4b8b6f)['then'](function(){_0x3fbc14=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x4b8b6f,_0x3fbc14);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x4b8b6f);fs['chmodSync'](_0x3fbc14,'777');}catch(_0x187fca){logger[_0x9246('0x19')](_0x187fca);}return _0x3fbc14[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x78')]=function(_0x15bb02,_0x3ea67a,_0xd602aa,_0xe0c9bc,_0x560ddf,_0x1b2283){return aws[_0x9246('0x79')](_0x15bb02,_0x3ea67a,_0xd602aa,_0xe0c9bc,_0x560ddf,_0x1b2283)[_0x9246('0x37')](function(_0x1e7f59){logger[_0x9246('0x1e')](JSON[_0x9246('0x44')](_0x1e7f59));return _0x1e7f59;});};exports[_0x9246('0x7a')]=function(_0x3d06b5,_0x32f9f7,_0x3037be,_0x524472){var _0x334387=util[_0x9246('0x7b')](_0x9246('0x7c'),ISPEECH_API,_0x3d06b5,encodeURIComponent(_0x32f9f7),_0x3037be,_0x524472);var _0x58712c=path['resolve'](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x268a65;return downloadFile(_0x334387,_0x58712c)['then'](function(){_0x268a65=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x58712c,_0x268a65);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x58712c);fs[_0x9246('0x2d')](_0x268a65,_0x9246('0x2e'));}catch(_0x19d97d){logger['error'](_0x19d97d);}return _0x268a65[_0x9246('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x1b3ac2,_0x156f85,_0x3983a1,_0x24e649){var _0x57b3f3=util[_0x9246('0x7b')](_0x9246('0x7d'),ISPEECH_API,_0x156f85,_0x3983a1,base64Encode(_0x1b3ac2),_0x24e649?util['format']('model=%s',encodeURIComponent(_0x24e649)):'freeform=3');return uploadFile(_0x57b3f3)[_0x9246('0x37')](function(_0x566278){return querystring[_0x9246('0xc')](_0x566278);});};exports[_0x9246('0x7e')]=function(_0x26e63d,_0x3f8e50){return sestek[_0x9246('0x7f')](_0x26e63d,_0x3f8e50)[_0x9246('0x37')](function(_0x1b00bd){logger[_0x9246('0x1e')](JSON['stringify'](_0x1b00bd));var _0x1bdc61={'speech':_0x1b00bd[_0x9246('0x80')],'action':_0x1b00bd[_0x9246('0x81')]?_0x1b00bd['channelData'][_0x9246('0x82')]:undefined,'actiondata':_0x1b00bd[_0x9246('0x81')]?_0x1b00bd[_0x9246('0x81')][_0x9246('0x83')]:undefined};if(_0x1b00bd[_0x9246('0x81')]&&_0x1b00bd['channelData'][_0x9246('0x84')]){return base64Decode(_0x1b00bd[_0x9246('0x81')][_0x9246('0x84')][_0x9246('0x85')],path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+'.wav'))[_0x9246('0x37')](function(_0x1e88e7){_0x1bdc61['audiofile']=_0x1e88e7;return _0x1bdc61;});}return _0x1bdc61;});};exports[_0x9246('0x86')]=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 a7f9466..25be112 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 _0x775f=['./nda','exports'];(function(_0x38deb6,_0x587445){var _0x3cf12e=function(_0x4d178b){while(--_0x4d178b){_0x38deb6['push'](_0x38deb6['shift']());}};_0x3cf12e(++_0x587445);}(_0x775f,0x176));var _0xf775=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x775f[_0x2dacca];return _0x4e8745;};var nda=require(_0xf775('0x0'));module[_0xf775('0x1')]={'nda':nda}; \ No newline at end of file +var _0x7c79=['./nda','exports'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x7c79,0x86));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};var nda=require(_0x97c7('0x0'));module[_0x97c7('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 d6dda7c..459f0d6 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 _0x7834=['request-promise','agi','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','access_token','project','channelData','ndagenerate_audio','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7834,0x13f));var _0x4783=function(_0x4b075e,_0x57874c){_0x4b075e=_0x4b075e-0x0;var _0x31385c=_0x7834[_0x4b075e];return _0x31385c;};'use strict';var rp=require(_0x4783('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x4783('0x1'));module['exports']=function(_0x15dbb4,_0x30c3ee){var _0x2d7f59={'method':_0x4783('0x2'),'uri':url[_0x4783('0x3')](_0x30c3ee[_0x4783('0x4')],_0x4783('0x5')),'form':{'grant_type':'password','username':_0x30c3ee[_0x4783('0x6')],'password':_0x30c3ee[_0x4783('0x7')]},'json':!![]};return rp(_0x2d7f59)['then'](function(_0x2dcf46){var _0x16c83e={'method':_0x4783('0x2'),'uri':url[_0x4783('0x3')](_0x30c3ee[_0x4783('0x8')],_0x4783('0x9')),'body':{'type':_0x30c3ee['ndaactivity_type']||_0x4783('0xa'),'channelId':_0x4783('0xb'),'conversation':{'id':_0x15dbb4[_0x4783('0xc')]},'from':{'id':_0x15dbb4[_0x4783('0xd')],'name':_0x15dbb4[_0x4783('0xe')]},'recipient':{'id':_0x15dbb4[_0x4783('0xf')],'name':_0x15dbb4[_0x4783('0x10')]},'text':_0x30c3ee['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2dcf46[_0x4783('0x11')]},'json':!![]};if(_0x30c3ee[_0x4783('0x12')]){_0x16c83e['body'][_0x4783('0x13')]['ProjectName']=_0x30c3ee[_0x4783('0x12')];}if(_0x30c3ee[_0x4783('0x14')]=='1'){_0x16c83e[_0x4783('0x15')][_0x4783('0x13')][_0x4783('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x30c3ee[_0x4783('0x17')]){_0x16c83e[_0x4783('0x15')][_0x4783('0x13')][_0x4783('0x18')]=_0x30c3ee[_0x4783('0x17')];if(_0x30c3ee[_0x4783('0x19')]){_0x16c83e[_0x4783('0x15')][_0x4783('0x13')][_0x4783('0x1a')]=_0x30c3ee[_0x4783('0x19')];}}logger[_0x4783('0x1b')](JSON[_0x4783('0x1c')](_0x16c83e));return rp(_0x16c83e);});}; \ No newline at end of file +var _0xb010=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x20b9fd,_0x57c229){var _0x2acabb=function(_0xb04edf){while(--_0xb04edf){_0x20b9fd['push'](_0x20b9fd['shift']());}};_0x2acabb(++_0x57c229);}(_0xb010,0x8b));var _0x0b01=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xb010[_0xa148b7];return _0x51efd3;};'use strict';var rp=require('request-promise');var url=require(_0x0b01('0x0'));var logger=require('../../../../../config/logger')(_0x0b01('0x1'));module['exports']=function(_0x5fa8df,_0x48ca42){var _0x3156db={'method':_0x0b01('0x2'),'uri':url[_0x0b01('0x3')](_0x48ca42[_0x0b01('0x4')],_0x0b01('0x5')),'form':{'grant_type':_0x0b01('0x6'),'username':_0x48ca42[_0x0b01('0x7')],'password':_0x48ca42[_0x0b01('0x6')]},'json':!![]};return rp(_0x3156db)[_0x0b01('0x8')](function(_0x33eb05){var _0xcdfdfd={'method':_0x0b01('0x2'),'uri':url[_0x0b01('0x3')](_0x48ca42['ndassistant_url'],_0x0b01('0x9')),'body':{'type':_0x48ca42[_0x0b01('0xa')]||_0x0b01('0xb'),'channelId':_0x0b01('0xc'),'conversation':{'id':_0x5fa8df[_0x0b01('0xd')]},'from':{'id':_0x5fa8df[_0x0b01('0xe')],'name':_0x5fa8df[_0x0b01('0xf')]},'recipient':{'id':_0x5fa8df[_0x0b01('0x10')],'name':_0x5fa8df[_0x0b01('0x11')]},'text':_0x48ca42[_0x0b01('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x33eb05[_0x0b01('0x13')]},'json':!![]};if(_0x48ca42[_0x0b01('0x14')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x17')]=_0x48ca42[_0x0b01('0x14')];}if(_0x48ca42[_0x0b01('0x18')]=='1'){_0xcdfdfd['body'][_0x0b01('0x16')][_0x0b01('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0b01('0x1a')};}if(_0x48ca42[_0x0b01('0x1b')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x1c')]=_0x48ca42[_0x0b01('0x1b')];if(_0x48ca42[_0x0b01('0x1d')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x1e')]=_0x48ca42['custom_action_data'];}}logger[_0x0b01('0x1f')](JSON[_0x0b01('0x20')](_0xcdfdfd));return rp(_0xcdfdfd);});}; \ 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 503c1ff..b2123a3 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 _0xabd8=['./lib/api','exports'];(function(_0x215d37,_0x98a79a){var _0x208dc7=function(_0x507e24){while(--_0x507e24){_0x215d37['push'](_0x215d37['shift']());}};_0x208dc7(++_0x98a79a);}(_0xabd8,0xa8));var _0x8abd=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xabd8[_0x4fc9e6];return _0x551d28;};'use strict';var asr=require(_0x8abd('0x0'));module[_0x8abd('0x1')]=function(_0x5ab90f,_0x1aed45,_0x3f79d6,_0x3a13be){return asr(_0x5ab90f,_0x1aed45,_0x3f79d6,_0x3a13be);}; \ No newline at end of file +var _0xf3ec=['./lib/api','exports'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xf3ec,0xf2));var _0xcf3e=function(_0x4e6169,_0x24d405){_0x4e6169=_0x4e6169-0x0;var _0x518f54=_0xf3ec[_0x4e6169];return _0x518f54;};'use strict';var asr=require(_0xcf3e('0x0'));module[_0xcf3e('0x1')]=function(_0x306085,_0xeec228,_0x548171,_0x521134){return asr(_0x306085,_0xeec228,_0x548171,_0x521134);}; \ 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 30352a0..bb92da4 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 _0x96bb=['transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','open','message','bluebird','moment','crypto','../../../../../../config/logger','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','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x96bb,0x1ba));var _0xb96b=function(_0x4811a5,_0x48fadc){_0x4811a5=_0x4811a5-0x0;var _0x1c6a8a=_0x96bb[_0x4811a5];return _0x1c6a8a;};'use strict';var BPromise=require(_0xb96b('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb96b('0x1'));var crypto=require(_0xb96b('0x2'));var logger=require(_0xb96b('0x3'))('agi');module[_0xb96b('0x4')]=function(_0x754dfe,_0x43fb96,_0x1a13f3,_0x4b7703){return new BPromise(function(_0x42e082,_0xda433d){logger[_0xb96b('0x5')]('Tilde\x20URI',_0x4b7703||_0xb96b('0x6'));var _0xe1c63b=new WebSocket(_0x4b7703||_0xb96b('0x6'),{'perMessageDeflate':![]});var _0x4bc94='';var _0x12da65='0';var _0x3becb0='1';var _0xf660ad=_0xb96b('0x7');function _0x4a2210(_0x14a829){var _0x119638=crypto[_0xb96b('0x8')](_0xb96b('0x9'));_0x119638[_0xb96b('0xa')](_0x14a829);return _0x119638[_0xb96b('0xb')]('hex');}function _0x3873eb(){try{logger[_0xb96b('0x5')](_0xb96b('0xc'));var _0x3b8ec4=moment()[_0xb96b('0xd')]();var _0x9bce6=_0x4a2210(_0x3b8ec4+_0x43fb96+_0x1a13f3);_0xe1c63b[_0xb96b('0xe')](JSON[_0xb96b('0xf')]({'appID':_0x43fb96,'timestamp':_0x3b8ec4,'appKey':_0x9bce6}));var _0x100835=fs[_0xb96b('0x10')](_0x754dfe);_0x100835['on'](_0xb96b('0x11'),function(_0x5f4eef){_0xe1c63b[_0xb96b('0xe')](_0x5f4eef);});_0x100835['on'](_0xb96b('0x12'),function(){_0xe1c63b[_0xb96b('0xe')](_0xb96b('0x13'));});}catch(_0x5971de){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0xb96b('0xf')](_0x5971de));_0xe1c63b['terminate']();}}function _0x4652b9(_0x4cc058){try{if(_0x4cc058){var _0x154a39=JSON[_0xb96b('0x14')](_0x4cc058);switch(_0x154a39[_0xb96b('0x15')]){case 0x0:if(_0x154a39[_0xb96b('0x16')]){if(_0x154a39[_0xb96b('0x16')][_0xb96b('0x17')]){logger[_0xb96b('0x5')](_0xb96b('0x18'),JSON[_0xb96b('0xf')](_0x154a39[_0xb96b('0x16')][_0xb96b('0x19')]));_0x4bc94=_0x154a39[_0xb96b('0x16')][_0xb96b('0x19')][0x0][_0xb96b('0x1a')];_0x12da65=_0x154a39[_0xb96b('0x16')][_0xb96b('0x19')][0x0][_0xb96b('0x1b')];_0x3becb0='0';_0xf660ad=_0xb96b('0x1c');_0xe1c63b['terminate']();}}break;case 0x1:logger[_0xb96b('0x5')](_0xb96b('0x7'));_0x3becb0='1';_0xf660ad='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.');_0x3becb0='2';_0xf660ad=_0xb96b('0x1d');break;case 0x9:logger[_0xb96b('0x5')](_0xb96b('0x1e'));_0x3becb0='9';_0xf660ad=_0xb96b('0x1e');break;case 0xa:logger['info'](_0xb96b('0x1f'));_0x3becb0='10';_0xf660ad='Authentication\x20failed.';break;case 0xb:logger['info'](_0xb96b('0x20'));_0x3becb0='11';_0xf660ad=_0xb96b('0x20');}}}catch(_0x3bd1d1){logger[_0xb96b('0x21')](_0xb96b('0x22'),JSON[_0xb96b('0xf')](_0x3bd1d1));_0xe1c63b[_0xb96b('0x23')]();}}function _0x19c49a(){logger['info'](_0xb96b('0x24'));_0x42e082({'transcript':_0x4bc94,'confidence':_0x12da65,'status':_0x3becb0,'status_message':_0xf660ad});}function _0x5dd75a(_0xa34db){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0xa34db)){logger['error'](_['isObject'](_0xa34db)?JSON[_0xb96b('0xf')](_0xa34db):_0xa34db);}}_0xe1c63b['on'](_0xb96b('0x25'),_0x3873eb);_0xe1c63b['on'](_0xb96b('0x26'),_0x4652b9);_0xe1c63b['on']('close',_0x19c49a);_0xe1c63b['on'](_0xb96b('0x21'),_0x5dd75a);});}; \ No newline at end of file +var _0xc282=['agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0xc282,0x182));var _0x2c28=function(_0x499eac,_0x26fe2c){_0x499eac=_0x499eac-0x0;var _0x3ba5de=_0xc282[_0x499eac];return _0x3ba5de;};'use strict';var BPromise=require(_0x2c28('0x0'));var _=require(_0x2c28('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2c28('0x2'));var crypto=require(_0x2c28('0x3'));var logger=require('../../../../../../config/logger')(_0x2c28('0x4'));module[_0x2c28('0x5')]=function(_0x35b197,_0x10fa29,_0x6318cb,_0x1a7484){return new BPromise(function(_0x1ccfd4,_0x34a71e){logger[_0x2c28('0x6')](_0x2c28('0x7'),_0x1a7484||_0x2c28('0x8'));var _0x5bfc9d=new WebSocket(_0x1a7484||_0x2c28('0x8'),{'perMessageDeflate':![]});var _0x5e0874='';var _0x4c8235='0';var _0x27ecc5='1';var _0xbcf225='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xcf0046(_0x32c500){var _0x3ae225=crypto[_0x2c28('0x9')](_0x2c28('0xa'));_0x3ae225[_0x2c28('0xb')](_0x32c500);return _0x3ae225[_0x2c28('0xc')](_0x2c28('0xd'));}function _0xaeecd9(){try{logger[_0x2c28('0x6')](_0x2c28('0xe'));var _0x57470d=moment()['unix']();var _0x31e881=_0xcf0046(_0x57470d+_0x10fa29+_0x6318cb);_0x5bfc9d[_0x2c28('0xf')](JSON[_0x2c28('0x10')]({'appID':_0x10fa29,'timestamp':_0x57470d,'appKey':_0x31e881}));var _0x137b3f=fs[_0x2c28('0x11')](_0x35b197);_0x137b3f['on'](_0x2c28('0x12'),function(_0x134aef){_0x5bfc9d[_0x2c28('0xf')](_0x134aef);});_0x137b3f['on'](_0x2c28('0x13'),function(){_0x5bfc9d[_0x2c28('0xf')]('EOS');});}catch(_0x2273d3){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x2c28('0x10')](_0x2273d3));_0x5bfc9d[_0x2c28('0x14')]();}}function _0x5d2b05(_0x19ba12){try{if(_0x19ba12){var _0x4ea880=JSON[_0x2c28('0x15')](_0x19ba12);switch(_0x4ea880['status']){case 0x0:if(_0x4ea880['result']){if(_0x4ea880[_0x2c28('0x16')][_0x2c28('0x17')]){logger[_0x2c28('0x6')](_0x2c28('0x18'),JSON[_0x2c28('0x10')](_0x4ea880[_0x2c28('0x16')][_0x2c28('0x19')]));_0x5e0874=_0x4ea880[_0x2c28('0x16')][_0x2c28('0x19')][0x0]['transcript'];_0x4c8235=_0x4ea880[_0x2c28('0x16')]['hypotheses'][0x0][_0x2c28('0x1a')];_0x27ecc5='0';_0xbcf225=_0x2c28('0x1b');_0x5bfc9d[_0x2c28('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x27ecc5='1';_0xbcf225=_0x2c28('0x1c');break;case 0x2:logger[_0x2c28('0x6')](_0x2c28('0x1d'));_0x27ecc5='2';_0xbcf225='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2c28('0x6')](_0x2c28('0x1e'));_0x27ecc5='9';_0xbcf225=_0x2c28('0x1e');break;case 0xa:logger['info']('Authentication\x20failed.');_0x27ecc5='10';_0xbcf225=_0x2c28('0x1f');break;case 0xb:logger[_0x2c28('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x27ecc5='11';_0xbcf225='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x337a4b){logger[_0x2c28('0x20')](_0x2c28('0x21'),JSON[_0x2c28('0x10')](_0x337a4b));_0x5bfc9d[_0x2c28('0x14')]();}}function _0x16a5fe(){logger['info'](_0x2c28('0x22'));_0x1ccfd4({'transcript':_0x5e0874,'confidence':_0x4c8235,'status':_0x27ecc5,'status_message':_0xbcf225});}function _0x4f95e5(_0x25c630){logger['error'](_0x2c28('0x23'));if(!_[_0x2c28('0x24')](_0x25c630)){logger[_0x2c28('0x20')](_[_0x2c28('0x25')](_0x25c630)?JSON['stringify'](_0x25c630):_0x25c630);}}_0x5bfc9d['on']('open',_0xaeecd9);_0x5bfc9d['on'](_0x2c28('0x26'),_0x5d2b05);_0x5bfc9d['on'](_0x2c28('0x13'),_0x16a5fe);_0x5bfc9d['on']('error',_0x4f95e5);});}; \ 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 38eaeb0..fd7355f 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 _0x5297=['exports','./asr'];(function(_0x259026,_0x2b01cb){var _0x5d0af3=function(_0x463748){while(--_0x463748){_0x259026['push'](_0x259026['shift']());}};_0x5d0af3(++_0x2b01cb);}(_0x5297,0x135));var _0x7529=function(_0x2e513b,_0x25fbf1){_0x2e513b=_0x2e513b-0x0;var _0x15b04c=_0x5297[_0x2e513b];return _0x15b04c;};var asr=require(_0x7529('0x0'));module[_0x7529('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd206=['exports','./asr'];(function(_0x3c0c67,_0x107b7b){var _0x8616cb=function(_0x4a4c96){while(--_0x4a4c96){_0x3c0c67['push'](_0x3c0c67['shift']());}};_0x8616cb(++_0x107b7b);}(_0xd206,0x125));var _0x6d20=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xd206[_0x87b0ff];return _0x3bc0b2;};var asr=require(_0x6d20('0x0'));module[_0x6d20('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index aa2880e..c27befe 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 _0x6e80=['listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','listen'];(function(_0x3d54b3,_0x21fbdf){var _0x129f64=function(_0x20f176){while(--_0x20f176){_0x3d54b3['push'](_0x3d54b3['shift']());}};_0x129f64(++_0x21fbdf);}(_0x6e80,0x121));var _0x06e8=function(_0x906b91,_0x2d5ab3){_0x906b91=_0x906b91-0x0;var _0x3a4455=_0x6e80[_0x906b91];return _0x3a4455;};'use strict';var util=require(_0x06e8('0x0'));var net=require(_0x06e8('0x1'));var EventEmitter=require('events')[_0x06e8('0x2')];var AGIError=require(_0x06e8('0x3'));var AGIChannel=require(_0x06e8('0x4'));var AGIServer=function(_0xc76977,_0xe6d188,_0x28209d){var _0x9852ec=this,_0xc76977=_0xc76977||0x11dd,_0xe6d188=_0xe6d188||_0x06e8('0x5'),_0x335b64=null,_0x30fb26=0x0;EventEmitter[_0x06e8('0x6')](_0x9852ec);function _0x593cb8(){if(!_0xc76977){_0x9852ec[_0x06e8('0x7')]('error',new AGIError(_0x06e8('0x8')));return![];}_0x335b64=net['createServer']();_0x335b64[_0x06e8('0x9')](_0xc76977,_0xe6d188);_0x335b64['on'](_0x06e8('0xa'),function(){_0x9852ec[_0x06e8('0x7')](_0x06e8('0xa'));});_0x335b64['on']('connection',function(_0x10af84){_0x335b64[_0x06e8('0xb')](function(_0x42e8d9,_0x271e0f){if(_0x42e8d9){_0x9852ec[_0x06e8('0x7')](_0x06e8('0xc'),new AGIError(_0x06e8('0xd'),_0x42e8d9));}else if(_0x28209d&&_0x28209d<0x0){_0x9852ec['emit']('error',new AGIError(_0x06e8('0xe')));_0x10af84['destroy']();}else if(_0x28209d&&_0x28209d>0x0&&_0x28209d<_0x271e0f){_0x30fb26+=0x1;_0x9852ec['emit'](_0x06e8('0xc'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x30fb26));_0x10af84[_0x06e8('0xf')]();}else{var _0x18f6b8=new AGIChannel(_0x10af84);_0x18f6b8['on'](_0x06e8('0x10'),function(){_0x9852ec[_0x06e8('0x7')](_0x06e8('0x11'),_0x18f6b8);});}});});_0x335b64['on'](_0x06e8('0xc'),function(_0x1ec354){_0x9852ec[_0x06e8('0x7')](_0x06e8('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x1ec354[_0x06e8('0x12')]));});_0x335b64['on'](_0x06e8('0x13'),function(){_0x9852ec['emit']('close',new AGIError(_0x06e8('0x14')));});}process[_0x06e8('0x15')](function(){_0x593cb8();});};util['inherits'](AGIServer,EventEmitter);module[_0x06e8('0x16')]=function(_0x5b2e3f,_0x12f154,_0x11f73f){return new AGIServer(_0x5b2e3f,_0x12f154,_0x11f73f);}; \ No newline at end of file +var _0x4787=['E_AGI_ARGUMENT_PORT','listening','connection','getConnections','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','EventEmitter','./channel','127.0.0.1','error'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4787,0x1dc));var _0x7478=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4787[_0x5f1391];return _0x50ebe3;};'use strict';var util=require(_0x7478('0x0'));var net=require(_0x7478('0x1'));var EventEmitter=require(_0x7478('0x2'))[_0x7478('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x7478('0x4'));var AGIServer=function(_0x5c408d,_0x36f07a,_0x5b0155){var _0x19aa22=this,_0x5c408d=_0x5c408d||0x11dd,_0x36f07a=_0x36f07a||_0x7478('0x5'),_0x12a981=null,_0x4059e5=0x0;EventEmitter['call'](_0x19aa22);function _0x34cfc5(){if(!_0x5c408d){_0x19aa22['emit'](_0x7478('0x6'),new AGIError(_0x7478('0x7')));return![];}_0x12a981=net['createServer']();_0x12a981['listen'](_0x5c408d,_0x36f07a);_0x12a981['on']('listening',function(){_0x19aa22['emit'](_0x7478('0x8'));});_0x12a981['on'](_0x7478('0x9'),function(_0x2c2c11){_0x12a981[_0x7478('0xa')](function(_0x1ebda0,_0x939104){if(_0x1ebda0){_0x19aa22[_0x7478('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1ebda0));}else if(_0x5b0155&&_0x5b0155<0x0){_0x19aa22[_0x7478('0xb')](_0x7478('0x6'),new AGIError(_0x7478('0xc')));_0x2c2c11[_0x7478('0xd')]();}else if(_0x5b0155&&_0x5b0155>0x0&&_0x5b0155<_0x939104){_0x4059e5+=0x1;_0x19aa22[_0x7478('0xb')]('error',new AGIError(_0x7478('0xe'),_0x4059e5));_0x2c2c11[_0x7478('0xd')]();}else{var _0x3867d2=new AGIChannel(_0x2c2c11);_0x3867d2['on'](_0x7478('0xf'),function(){_0x19aa22[_0x7478('0xb')](_0x7478('0x9'),_0x3867d2);});}});});_0x12a981['on'](_0x7478('0x6'),function(_0x40e463){_0x19aa22[_0x7478('0xb')](_0x7478('0x6'),new AGIError(_0x7478('0x10'),_0x40e463['code']));});_0x12a981['on']('close',function(){_0x19aa22['emit'](_0x7478('0x11'),new AGIError(_0x7478('0x12')));});}process[_0x7478('0x13')](function(){_0x34cfc5();});};util[_0x7478('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x49c9ec,_0xd8570c,_0x293b94){return new AGIServer(_0x49c9ec,_0xd8570c,_0x293b94);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4720318..fb12838 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 _0xd597=['tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','failure','math','operation','math\x20%s','variable_id','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','no\x20mail\x20account\x20found','Smtp','user','bcc','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','vswitch','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariableById','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','interval','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','split','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','callback_priority','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','url','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','toUpperCase','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','no\x20text\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd597,0x94));var _0x7d59=function(_0x5647f2,_0x326ed2){_0x5647f2=_0x5647f2-0x0;var _0x47b561=_0xd597[_0x5647f2];return _0x47b561;};'use strict';var fs=require('fs');var path=require(_0x7d59('0x0'));var util=require(_0x7d59('0x1'));var _=require(_0x7d59('0x2'));var sh=require(_0x7d59('0x3'));var odbc=require(_0x7d59('0x4'))();var rs=require(_0x7d59('0x5'));var moment=require(_0x7d59('0x6'));var Mustache=require(_0x7d59('0x7'));var rp=require(_0x7d59('0x8'));var logger=require(_0x7d59('0x9'))(_0x7d59('0xa'));var config=require(_0x7d59('0xb'));var scripts=require(_0x7d59('0xc'));var FILES_PATH=_0x7d59('0xd');var recursiveMapAttributes=[_0x7d59('0xe'),_0x7d59('0xf')];var verticesWithRetry=[_0x7d59('0x10'),_0x7d59('0x11'),_0x7d59('0x12')];var AGIVertices=function(_0x885277,_0x11e955,_0x103089){this['channel']=_0x885277;this[_0x7d59('0x13')]=_0x11e955;this[_0x7d59('0x14')]=_0x103089;};AGIVertices[_0x7d59('0x15')]['getVariable']=function(_0x4f1df6,_0xe9b8e3){this[_0x7d59('0x13')][_0x7d59('0x16')](_0x4f1df6)['then'](function(_0x5e6c20){_0xe9b8e3(null,_0x5e6c20?_0x5e6c20['name']:![]);})['catch'](function(_0x2cbb01){_0xe9b8e3(_0x2cbb01);});};AGIVertices[_0x7d59('0x15')]['getVoiceQueue']=function(_0x4ddca5,_0xe6ecf9){this[_0x7d59('0x13')][_0x7d59('0x17')](_0x4ddca5)[_0x7d59('0x18')](function(_0x260c72){_0xe6ecf9(null,_0x260c72?_0x260c72['name']:![]);})[_0x7d59('0x19')](function(_0x12853b){_0xe6ecf9(_0x12853b);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1a')]=function(_0x14bd27,_0x17aa27){this[_0x7d59('0x13')][_0x7d59('0x1b')](_0x14bd27)[_0x7d59('0x18')](function(_0xb39529){_0x17aa27(null,_0xb39529?_0xb39529[_0x7d59('0x1c')]:![]);})[_0x7d59('0x19')](function(_0x56002e){_0x17aa27(_0x56002e);});};AGIVertices['prototype'][_0x7d59('0x1d')]=function(_0x3463d7,_0xdf5b22){this[_0x7d59('0x13')][_0x7d59('0x1e')](_0x3463d7)[_0x7d59('0x18')](function(_0x467c53){_0xdf5b22(null,_0x467c53?_0x467c53['dsn']:![]);})[_0x7d59('0x19')](function(_0x15c08a){_0xdf5b22(_0x15c08a);});};AGIVertices['prototype'][_0x7d59('0x1f')]=function(_0x3e8b1a,_0x3f1ef0){this['rpc'][_0x7d59('0x20')](_0x3e8b1a)[_0x7d59('0x18')](function(_0x18f6cb){_0x3f1ef0(null,_0x18f6cb?_0x18f6cb[_0x7d59('0x1c')]:![]);})[_0x7d59('0x19')](function(_0x2e3d4a){_0x3f1ef0(_0x2e3d4a);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x21')]=function(_0x6eb4e3,_0x2705ca){this['rpc'][_0x7d59('0x22')](_0x6eb4e3)[_0x7d59('0x18')](function(_0x2430be){_0x2705ca(null,_0x2430be?_0x2430be[_0x7d59('0x1c')]:![]);})[_0x7d59('0x19')](function(_0x1b60e1){_0x2705ca(_0x1b60e1);});};AGIVertices['prototype'][_0x7d59('0x23')]=function(_0x2f294a,_0x5331cb){var _0x28d0fe=this;this[_0x7d59('0x13')][_0x7d59('0x24')](_0x2f294a)[_0x7d59('0x18')](function(_0x59e9f2){_0x5331cb(null,_0x59e9f2?_0x28d0fe[_0x7d59('0x25')](_0x59e9f2[_0x7d59('0x26')]):![]);})[_0x7d59('0x19')](function(_0x188713){_0x5331cb(_0x188713);});};AGIVertices['prototype'][_0x7d59('0x27')]=function(_0x291f15,_0x433c50){this[_0x7d59('0x13')][_0x7d59('0x28')](_0x291f15)[_0x7d59('0x18')](function(_0x36ce04){_0x433c50(null,_0x36ce04?_0x36ce04:![]);})['catch'](function(_0x4b71c7){_0x433c50(_0x4b71c7);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x29')]=function(_0x5819b0,_0x471d22,_0x30bcfa){this['mailRpc'][_0x7d59('0x29')](_0x5819b0,_0x471d22)[_0x7d59('0x18')](function(){_0x30bcfa(null);})[_0x7d59('0x19')](function(_0x38522f){_0x30bcfa(_0x38522f);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x2a')]=function(_0x5dc7f8,_0x2d680c){this['rpc'][_0x7d59('0x2b')](_0x5dc7f8)[_0x7d59('0x18')](function(_0x2bee45){if(_0x2bee45){if(_0x2bee45[_0x7d59('0x2c')]){_0x2d680c(null,[_0x2bee45['interval']]);}else{_0x2d680c(null,_[_0x7d59('0x2d')](_0x2bee45['Intervals'],_0x7d59('0x2e')));}}else{_0x2d680c(null,![]);}})[_0x7d59('0x19')](function(_0x1d24f5){_0x2d680c(_0x1d24f5);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x25')]=function(_0x46a516){return util['format'](_0x7d59('0x2f'),FILES_PATH,_0x46a516);};AGIVertices[_0x7d59('0x15')]['getQueryOdbc']=function(_0x2487d3,_0x56d99f,_0x738185){odbc[_0x7d59('0x30')](_0x2487d3,function(_0x2c5d62){if(_0x2c5d62){logger[_0x7d59('0x31')](_0x7d59('0x32'),_0x2c5d62);_0x738185(_0x2c5d62);}else{logger[_0x7d59('0x33')](_0x7d59('0x34'));odbc[_0x7d59('0x35')](_0x56d99f,function(_0x569468,_0xcb5889){if(_0x569468){logger[_0x7d59('0x33')](_0x7d59('0x36'),_0x56d99f);_0x738185(_0x569468);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x56d99f);odbc[_0x7d59('0x37')](function(_0xc44690){if(_0xc44690){logger[_0x7d59('0x31')](_0x7d59('0x38'),_0xc44690);}_0x738185(null,_0xcb5889);});}});}});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x39')]=function(_0x22eca9,_0x302571){this[_0x7d59('0x13')][_0x7d59('0x3a')](_0x22eca9)[_0x7d59('0x18')](function(_0x58ed05){_0x302571(null,_0x58ed05?_0x58ed05:![]);})[_0x7d59('0x19')](function(_0x53e4c1){_0x302571(_0x53e4c1);});};AGIVertices['prototype'][_0x7d59('0x3b')]=function(_0x461a3a,_0x235b55){this[_0x7d59('0x13')]['createSmsMessage'](_0x461a3a)[_0x7d59('0x18')](function(_0x1763e8){_0x235b55(null,_0x1763e8);})[_0x7d59('0x19')](function(_0x295dae){_0x235b55(_0x295dae);});};AGIVertices['prototype'][_0x7d59('0x3c')]=function(_0x3b4f18,_0x2769d4,_0x2b46f9){this['rpc'][_0x7d59('0x3c')]({'uniqueid':this[_0x7d59('0x3d')][_0x7d59('0x3e')],'node':_0x3b4f18['label'],'application':_0x3b4f18[_0x7d59('0x3f')],'data':_0x2769d4||null,'project_name':this[_0x7d59('0x3d')]['arg_1'],'callerid':this[_0x7d59('0x3d')][_0x7d59('0x40')]})[_0x7d59('0x18')](function(_0x504581){if(_0x2b46f9){_0x2b46f9(null,_0x504581);}})[_0x7d59('0x19')](function(_0x319f37){if(_0x2b46f9){_0x2b46f9(_0x319f37);}});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x41')]=function(_0x4d85e4,_0x4ece87,_0x14f7b2,_0x4069eb){this['rpc'][_0x7d59('0x41')]({'uniqueid':this['channel'][_0x7d59('0x3e')],'callerid':this[_0x7d59('0x3d')][_0x7d59('0x40')],'calleridname':this[_0x7d59('0x3d')][_0x7d59('0x42')],'context':this[_0x7d59('0x3d')][_0x7d59('0x43')],'extension':this[_0x7d59('0x3d')][_0x7d59('0x44')],'priority':this[_0x7d59('0x3d')][_0x7d59('0x45')],'accountcode':this['channel'][_0x7d59('0x46')],'dnid':this['channel'][_0x7d59('0x47')],'projectName':this[_0x7d59('0x3d')][_0x7d59('0x48')],'saveName':_0x4ece87,'filename':_0x4d85e4[_0x7d59('0x49')]||_0x4ece87,'savePath':_0x14f7b2})[_0x7d59('0x18')](function(_0x2d7e52){_0x4069eb(null,_0x2d7e52);})[_0x7d59('0x19')](function(_0x3eb5c3){_0x4069eb(_0x3eb5c3);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x4a')]=function(_0x5747b8,_0x2262b3,_0x460052,_0x43a678,_0x4de8ce){this[_0x7d59('0x13')][_0x7d59('0x4a')]({'uniqueid':this[_0x7d59('0x3d')][_0x7d59('0x3e')],'body':_0x5747b8,'direction':_0x2262b3,'providerName':_0x460052,'providerResponse':_0x43a678})[_0x7d59('0x18')](function(_0x428218){if(_0x4de8ce){_0x4de8ce(null,_0x428218);}})[_0x7d59('0x19')](function(_0x492d68){if(_0x4de8ce){_0x4de8ce(_0x492d68);}});};AGIVertices['prototype'][_0x7d59('0x4b')]=function(_0x4bd612,_0x338926){this['rpc']['createCmContact']({'firstName':_[_0x7d59('0x4c')](_0x4bd612[_0x7d59('0x1c')])||_[_0x7d59('0x4d')](_0x4bd612['name'])?_0x7d59('0x4e')+Math[_0x7d59('0x4f')]():_0x4bd612[_0x7d59('0x1c')],'lastName':_['isEmpty'](_0x4bd612['lastName'])||_['isNil'](_0x4bd612[_0x7d59('0x50')])?null:_0x4bd612['lastName'],'phone':_0x4bd612['phone'],'ListId':_0x4bd612['list_id'],'scheduledat':_0x4bd612[_0x7d59('0x51')],'callbackUniqueid':this[_0x7d59('0x3d')][_0x7d59('0x3e')],'tags':_0x7d59('0x52'),'description':_0x7d59('0x53')+_0x4bd612['scheduledAt'][_0x7d59('0x54')](),'priority':_0x4bd612['callback_priority']})[_0x7d59('0x18')](function(_0x294cab){_0x338926(null,_0x294cab);})['catch'](function(_0x26be7b){_0x338926(_0x26be7b);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x55')]=function(_0xda876b,_0x15d50c){this['rpc'][_0x7d59('0x56')](_0xda876b)[_0x7d59('0x18')](function(_0x3c5f36){_0x15d50c(null,_0x3c5f36?_0x3c5f36[_0x7d59('0x1c')]:![]);})[_0x7d59('0x19')](function(_0x1f496e){_0x15d50c(_0x1f496e);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x57')]=function(_0x31fff9,_0x20e537,_0x12a73a){var _0x2a3eb3={'role':'agent'};_0x2a3eb3[_0x31fff9]=this[_0x7d59('0x3d')]['callerid'];this[_0x7d59('0x13')]['agentPause'](_0x2a3eb3,_0x20e537,this[_0x7d59('0x3d')][_0x7d59('0x3e')])['then'](function(_0x2612c7){_0x12a73a(null,_[_0x7d59('0x4d')](_0x2612c7)?![]:!![]);})[_0x7d59('0x19')](function(_0x18d31a){logger[_0x7d59('0x31')](_0x18d31a);_0x12a73a(null,![]);});};AGIVertices[_0x7d59('0x15')]['agentUnpause']=function(_0x4c6c66,_0x143d5d){var _0x16fa77={'role':'agent'};_0x16fa77[_0x4c6c66]=this[_0x7d59('0x3d')][_0x7d59('0x40')];this[_0x7d59('0x13')][_0x7d59('0x58')](_0x16fa77)['then'](function(_0x1212ac){_0x143d5d(null,_[_0x7d59('0x4d')](_0x1212ac)?![]:!![]);})['catch'](function(_0x4cdaae){logger[_0x7d59('0x31')](_0x4cdaae);_0x143d5d(null,![]);});};AGIVertices[_0x7d59('0x15')]['agentLogout']=function(_0x22a85c,_0x58713b){var _0x431fe4={'role':_0x7d59('0x59')};_0x431fe4[_0x22a85c]=this['channel'][_0x7d59('0x40')];this['rpc']['agentLogout'](_0x431fe4)[_0x7d59('0x18')](function(_0x11aa60){_0x58713b(null,_[_0x7d59('0x4d')](_0x11aa60)?![]:!![]);})[_0x7d59('0x19')](function(_0x28dcb3){logger[_0x7d59('0x31')](_0x28dcb3);_0x58713b(null,![]);});};AGIVertices['prototype'][_0x7d59('0x5a')]=function(_0x5691aa,_0x4ae19e){var _0x31bfd0={'role':_0x7d59('0x59')};_0x31bfd0[_0x5691aa]=this[_0x7d59('0x3d')][_0x7d59('0x40')];var _0x5b3900=_0x5691aa!=_0x7d59('0x5b')?util[_0x7d59('0x5c')](_0x7d59('0x5d'),_0x7d59('0x5e'),this[_0x7d59('0x3d')][_0x7d59('0x40')]):undefined;this['rpc'][_0x7d59('0x5a')](_0x31bfd0,_0x5b3900)[_0x7d59('0x18')](function(_0x1ddb6a){_0x4ae19e(null,_['isNil'](_0x1ddb6a)?![]:!![]);})[_0x7d59('0x19')](function(_0x26abbb){logger['error'](_0x26abbb);_0x4ae19e(null,![]);});};AGIVertices[_0x7d59('0x15')]['shellCommand']=function(_0xb3eadb,_0x3bcf59){sh[_0x7d59('0x5f')](_[_0x7d59('0x60')](_0xb3eadb),function(_0x42b5fd,_0x6c8a46){var _0x41cd28=_0x6c8a46[_0x7d59('0x61')](/(\r\n|\n|\r)/gm,'');_0x3bcf59(null,_0x41cd28);});};AGIVertices[_0x7d59('0x15')]['googleCloudTTS']=function(_0x4cb2b5,_0x440839){scripts[_0x7d59('0x62')](_0x4cb2b5[_0x7d59('0x63')],_0x4cb2b5[_0x7d59('0x64')]||_0x7d59('0x65'),_0x4cb2b5['text'],_0x4cb2b5[_0x7d59('0x66')]||_0x7d59('0x67'),_0x4cb2b5['ssmlGender']||_0x7d59('0x68'),_0x4cb2b5['audioEncoding']||_0x7d59('0x69'))[_0x7d59('0x18')](function(_0x28e7b5){_0x440839(null,_0x28e7b5);})['catch'](function(_0x5237a1){_0x440839(_0x5237a1);});};AGIVertices['prototype'][_0x7d59('0x6a')]=function(_0x39e1b7,_0x386e1a){scripts[_0x7d59('0x6a')](_0x39e1b7['text'],_0x39e1b7[_0x7d59('0x6b')]||'en',0x1)[_0x7d59('0x18')](function(_0x5aa79c){_0x386e1a(null,_0x5aa79c);})['catch'](function(_0x174f61){_0x386e1a(_0x174f61);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x6c')]=function(_0x4aee0e,_0x2c6d24){var _0x21fff4={'uri':_0x4aee0e['url'],'method':_0x4aee0e[_0x7d59('0x6d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4aee0e[_0x7d59('0x6e')])===_0x7d59('0x6f')&&parseInt(_0x4aee0e[_0x7d59('0x6e')])>=0x1?parseInt(_0x4aee0e[_0x7d59('0x6e')])*0x3e8:0x5*0x3e8};if(_[_0x7d59('0x70')]([_0x7d59('0x71'),'PUT'],_0x21fff4[_0x7d59('0x6d')]['toUpperCase']())){try{_0x21fff4[_0x7d59('0x72')]=_0x4aee0e[_0x7d59('0xf')]?JSON[_0x7d59('0x73')](_0x4aee0e[_0x7d59('0xf')]):{};}catch(_0x7fd64c){logger[_0x7d59('0x31')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x7fd64c);}}try{_0x21fff4[_0x7d59('0x74')]=_0x4aee0e[_0x7d59('0xe')]?JSON[_0x7d59('0x73')](_0x4aee0e[_0x7d59('0xe')]):{};}catch(_0x38a41a){logger[_0x7d59('0x31')](_0x7d59('0x75'),_0x38a41a);}if(_0x4aee0e['computedVariables']){try{var _0x18c327=require(_0x4aee0e['computedVariables'])[_0x7d59('0x76')](this,_0x21fff4);_0x21fff4[_0x7d59('0x77')]=Mustache['render'](_0x4aee0e['url'],_0x18c327,{},['$$','$$']);if(_0x21fff4[_0x7d59('0x74')]){_0x21fff4[_0x7d59('0x74')]=JSON['parse'](Mustache[_0x7d59('0x78')](JSON[_0x7d59('0x79')](_0x21fff4[_0x7d59('0x74')]),_0x18c327,{},['$$','$$']));}if(_0x21fff4[_0x7d59('0x72')]){_0x21fff4[_0x7d59('0x72')]=JSON['parse'](Mustache[_0x7d59('0x78')](JSON[_0x7d59('0x79')](_0x21fff4[_0x7d59('0x72')]),_0x18c327,{},['$$','$$']));}}catch(_0x2717f5){logger[_0x7d59('0x31')](_0x7d59('0x7a'),_0x2717f5);}}rp(_0x21fff4)[_0x7d59('0x18')](function(_0x557e2d){var _0x6cc130={'statusCode':_0x557e2d[_0x7d59('0x7b')]||0xc8,'statusMessage':_0x557e2d['statusMessage']||'OK','headers':_0x557e2d['headers']||{},'body':_0x557e2d[_0x7d59('0x72')]||{}};_0x2c6d24(null,_0x6cc130);})['catch'](function(_0x52510c){var _0x3d5625={'statusCode':_0x52510c['statusCode']||0x1f4,'statusMessage':_0x52510c[_0x7d59('0x7c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x52510c[_0x7d59('0x7d')][_0x7d59('0x74')]||{},'body':_0x52510c[_0x7d59('0x7d')]['body']||{}};_0x2c6d24(null,_0x3d5625);});};AGIVertices[_0x7d59('0x15')]['googleDialogflow']=function(_0x7d170c,_0x2a08b2){scripts[_0x7d59('0x7e')](this[_0x7d59('0x3d')]['uniqueid'],_0x7d170c[_0x7d59('0x7f')],_0x7d170c[_0x7d59('0x65')],_0x7d170c[_0x7d59('0x80')]||'en')['then'](function(_0x28ff0b){_0x2a08b2(null,_0x28ff0b);})['catch'](function(_0x50d782){_0x2a08b2(_0x50d782);});};AGIVertices[_0x7d59('0x15')]['googleDialogflowV2']=function(_0x4c240e,_0x51a86a){scripts[_0x7d59('0x81')](this[_0x7d59('0x3d')]['uniqueid'],_0x4c240e[_0x7d59('0x82')],_0x4c240e['client_email'],_0x4c240e[_0x7d59('0x83')],_0x4c240e[_0x7d59('0x65')],_0x4c240e[_0x7d59('0x84')]||'en')['then'](function(_0x53bb52){_0x51a86a(null,_0x53bb52);})[_0x7d59('0x19')](function(_0x47c001){_0x51a86a(_0x47c001);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x85')]=function(_0x922985,_0xc4408e){scripts[_0x7d59('0x85')](this[_0x7d59('0x3d')],_0x922985)['then'](function(_0x12a0db){_0xc4408e(null,_0x12a0db);})[_0x7d59('0x19')](function(_0x3f293b){_0xc4408e(_0x3f293b);});};AGIVertices['prototype'][_0x7d59('0x86')]=function(_0x4ccc60,_0xf6bfb7){scripts[_0x7d59('0x86')](_0x4ccc60[_0x7d59('0x7f')],_0x4ccc60[_0x7d59('0x65')],_0x4ccc60[_0x7d59('0x87')]||_0x7d59('0x67'),_0x4ccc60[_0x7d59('0x88')])['then'](function(_0x5eff6d){_0xf6bfb7(null,_0x5eff6d);})[_0x7d59('0x19')](function(_0x46a474){_0xf6bfb7(_0x46a474);});};AGIVertices[_0x7d59('0x15')]['ispeechASR']=function(_0x3c208c,_0x5213a9,_0x56225b){scripts['ispeechASR'](_0x5213a9,_0x3c208c[_0x7d59('0x7f')],_0x3c208c['ispeech_asr_language']||'en-US',this[_0x7d59('0x89')](_0x3c208c[_0x7d59('0x8a')])?_0x3c208c[_0x7d59('0x8a')]:undefined)['then'](function(_0x12fc1c){_0x56225b(null,_0x12fc1c);})[_0x7d59('0x19')](function(_0xd5e066){_0x56225b(_0xd5e066);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x8b')]=function(_0x51ade6,_0x4c79a9){scripts[_0x7d59('0x8b')](_0x51ade6[_0x7d59('0x8c')],_0x51ade6[_0x7d59('0x8d')],_0x51ade6[_0x7d59('0x8e')],_0x51ade6[_0x7d59('0x8f')]||_0x7d59('0x90'),_0x51ade6[_0x7d59('0x65')],_0x51ade6[_0x7d59('0x91')]||_0x7d59('0x65'))[_0x7d59('0x18')](function(_0x53d851){_0x4c79a9(null,_0x53d851);})[_0x7d59('0x19')](function(_0x81c429){_0x4c79a9(_0x81c429);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x92')]=function(_0x1e7c7d,_0x2a5e70){scripts[_0x7d59('0x92')](this[_0x7d59('0x3d')][_0x7d59('0x3e')],_0x1e7c7d[_0x7d59('0x8c')],_0x1e7c7d[_0x7d59('0x8d')],_0x1e7c7d[_0x7d59('0x93')],_0x1e7c7d[_0x7d59('0x65')],_0x1e7c7d['aws_bot_name'])[_0x7d59('0x18')](function(_0x55edd4){_0x2a5e70(null,_0x55edd4);})['catch'](function(_0x5b4135){_0x2a5e70(_0x5b4135);});};AGIVertices[_0x7d59('0x15')]['googleASR']=function(_0x3863e5,_0x3e8af2,_0x3116a4){scripts['googleASR'](_0x3e8af2,_0x3863e5[_0x7d59('0x7f')],_0x3863e5[_0x7d59('0x94')]||_0x7d59('0x67'))['then'](function(_0x463f81){_0x3116a4(null,_0x463f81);})[_0x7d59('0x19')](function(_0xd672a0){_0x3116a4(_0xd672a0);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x95')]=function(_0x194f79,_0x4f2568,_0x4d3df2){scripts[_0x7d59('0x95')](_0x4f2568,_0x194f79['appid'],_0x194f79[_0x7d59('0x96')],_0x194f79[_0x7d59('0x77')])[_0x7d59('0x18')](function(_0x4b1eb3){_0x4d3df2(null,_0x4b1eb3);})[_0x7d59('0x19')](function(_0x404b58){_0x4d3df2(_0x404b58);});};AGIVertices[_0x7d59('0x15')][_0x7d59('0x97')]=function(_0x4141ac){var _0x33e5e1=_[_0x7d59('0x70')](verticesWithRetry,_0x4141ac['agicommand'])?_0x4141ac:_[_0x7d59('0x98')](_0x4141ac);for(var _0x188cdf in _0x33e5e1){if(_0x33e5e1[_0x7d59('0x99')](_0x188cdf)){if(_0x33e5e1[_0x188cdf]&&_[_0x7d59('0x9a')](_0x33e5e1[_0x188cdf])){if(_[_0x7d59('0x70')](recursiveMapAttributes,_0x188cdf)){_0x33e5e1[_0x188cdf]=this[_0x7d59('0x9b')](_0x33e5e1[_0x188cdf]);}else{_0x33e5e1[_0x188cdf]=this[_0x7d59('0x9c')](_0x33e5e1[_0x188cdf]);}}}}return _0x33e5e1;};AGIVertices[_0x7d59('0x15')][_0x7d59('0x9d')]=function(_0x2cbce6){for(var _0x23a216 in _0x2cbce6){if(_0x2cbce6['hasOwnProperty'](_0x23a216)){if(_[_0x7d59('0x9e')](_0x2cbce6[_0x23a216])){this[_0x7d59('0x9d')](_0x2cbce6[_0x23a216]);}else if(_[_0x7d59('0x9f')](_0x2cbce6[_0x23a216])){for(var _0x3db5bf=0x0;_0x3db5bf<_0x2cbce6[_0x23a216]['length'];_0x3db5bf++){this['recursiveNodeIndex'](_0x2cbce6[_0x23a216][_0x3db5bf]);}}else if(_[_0x7d59('0x9a')](_0x2cbce6[_0x23a216])){_0x2cbce6[_0x23a216]=this[_0x7d59('0x9c')](_0x2cbce6[_0x23a216]);}}}};AGIVertices[_0x7d59('0x15')][_0x7d59('0xa0')]=function(_0x506ea0,_0x27bf8f){for(var _0x17cc36 in _0x506ea0){if(_0x506ea0[_0x7d59('0x99')](_0x17cc36)){if(_[_0x7d59('0x9e')](_0x506ea0[_0x17cc36])){if(!_[_0x7d59('0x4c')](_0x506ea0[_0x17cc36])){this[_0x7d59('0xa0')](_0x506ea0[_0x17cc36],util[_0x7d59('0x5c')](_0x7d59('0xa1'),_0x27bf8f,_0x17cc36));}}else if(_[_0x7d59('0x9f')](_0x506ea0[_0x17cc36])){for(var _0x58ca77=0x0;_0x58ca77<_0x506ea0[_0x17cc36][_0x7d59('0xa2')];_0x58ca77++){this[_0x7d59('0xa0')](_0x506ea0[_0x17cc36][_0x58ca77],util[_0x7d59('0x5c')](_0x7d59('0xa1'),_0x27bf8f,_0x17cc36+'['+_0x58ca77+']'));}}else{if(!_['isNil'](_0x506ea0[_0x17cc36])){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')]('%s.%s',_0x27bf8f,_0x17cc36),_0x506ea0[_0x17cc36]);}}}}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x9b')]=function(_0xb28215){try{var _0xaca328=JSON[_0x7d59('0x73')](_0xb28215);this[_0x7d59('0x9d')](_0xaca328);return JSON[_0x7d59('0x79')](_0xaca328);}catch(_0x4b93d2){return this[_0x7d59('0x9c')](_0xb28215);}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x9c')]=function(_0x1c791b){var _0x3153b5=_0x1c791b[_0x7d59('0xa4')]('{');for(var _0x4b5a5=0x1;_0x4b5a5<_0x3153b5[_0x7d59('0xa2')];_0x4b5a5+=0x1){var _0x47ce49=_0x3153b5[_0x4b5a5][_0x7d59('0xa4')]('}');if(_0x47ce49[_0x7d59('0xa2')]>0x1){_0x1c791b=_0x1c791b['replaceAll']('{'+_0x47ce49[0x0]+'}',this[_0x7d59('0x3d')][_0x7d59('0xa5')](_0x47ce49[0x0])[_0x7d59('0xa6')]||_0x47ce49[0x0]);}}if(_0x3153b5['length']===0x1){return _0x1c791b[_0x7d59('0x54')]();}return this[_0x7d59('0x9c')](_0x1c791b);};AGIVertices['prototype'][_0x7d59('0xa7')]=function(_0x2b1f4d,_0x227150){var _0x18336d=this[_0x7d59('0x3d')][_0x7d59('0xa5')](_0x2b1f4d);if(_0x18336d[_0x7d59('0xa8')]===-0x1){return _0x18336d;}logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xa9'),_0x227150,_0x18336d['extra']));return this[_0x7d59('0x3d')][_0x7d59('0xa3')](_0x227150,_0x18336d['extra']);};AGIVertices[_0x7d59('0x15')][_0x7d59('0x89')]=function(_0x3c7b48){return _0x3c7b48&&_0x3c7b48!=='0'&&_0x3c7b48!=='-1'&&_0x3c7b48!=='';};AGIVertices[_0x7d59('0x15')]['maxRetry']=function(_0x4f8742){this[_0x7d59('0x3c')]['sync'](this,_0x4f8742,'-');_0x4f8742[_0x7d59('0xaa')]=_0x4f8742['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x7d59('0xab')]=function(_0x5051ba){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0xac'),_0x5051ba[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x5051ba[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20text\x20configured');}var _0x35adf1='\x22'+_0x5051ba[_0x7d59('0x65')]+'\x22';if(this[_0x7d59('0x89')](_0x5051ba[_0x7d59('0x7d')])){_0x35adf1+=','+_0x5051ba['options'];}var _0x2fb52c=this['channel'][_0x7d59('0x5f')](_0x7d59('0xaf'),_0x35adf1);if(_0x2fb52c[_0x7d59('0xa8')]===-0x1){return _0x2fb52c;}return this[_0x7d59('0x3d')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x35adf1));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xb0')]=function(_0x41977d){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xb1'),_0x41977d[_0x7d59('0xad')]));if(!this['isConfigured'](_0x41977d[_0x7d59('0xb2')])){return this['channel'][_0x7d59('0xae')](_0x7d59('0xb3'));}var _0xd85ca8=_0x41977d[_0x7d59('0xb2')];if(this[_0x7d59('0x89')](_0x41977d[_0x7d59('0x7d')])){_0xd85ca8+=','+_0x41977d[_0x7d59('0x7d')];}var _0x190462=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0xb4'),_0xd85ca8);if(_0x190462[_0x7d59('0xa8')]===-0x1){return _0x190462;}var _0x11021a=this[_0x7d59('0xa7')](_0x7d59('0xb5'),'MRCP_RECOG_CONFIDENCE');if(_0x11021a[_0x7d59('0xa8')]===-0x1){return _0x11021a;}var _0x166dfb=this[_0x7d59('0xa7')](_0x7d59('0xb6'),_0x7d59('0xb7'));if(_0x166dfb['result']===-0x1){return _0x166dfb;}var _0x32bcab=this[_0x7d59('0xa7')](_0x7d59('0xb8'),_0x7d59('0xb9'));if(_0x32bcab[_0x7d59('0xa8')]===-0x1){return _0x32bcab;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0xba'),_0xd85ca8));};AGIVertices[_0x7d59('0x15')]['agi']=function(_0x3ecdac){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xbb'),_0x3ecdac[_0x7d59('0xad')]));return this[_0x7d59('0x3d')][_0x7d59('0xa')]([_0x3ecdac[_0x7d59('0xbc')],_0x3ecdac[_0x7d59('0xbd')]]);};AGIVertices[_0x7d59('0x15')][_0x7d59('0xbe')]=function(_0x389d79){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0xbf'),_0x389d79[_0x7d59('0xad')]));if(this[_0x7d59('0x89')](_0x389d79[_0x7d59('0x6e')])){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0xc0'),_0x389d79[_0x7d59('0x6e')]));var _0x3e8a4c=this[_0x7d59('0x3d')]['wait'](_0x389d79[_0x7d59('0x6e')]);if(_0x3e8a4c[_0x7d59('0xa8')]===-0x1){return _0x3e8a4c;}}return this[_0x7d59('0x3d')][_0x7d59('0xbe')]();};AGIVertices[_0x7d59('0x15')][_0x7d59('0x52')]=function(_0xc416e6){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xc1'),_0xc416e6[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0xc416e6[_0x7d59('0xc2')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0xc416e6,_0x7d59('0xc3'));}_0xc416e6['scheduledAt']=moment();if(this[_0x7d59('0x89')](_0xc416e6[_0x7d59('0xc4')])){_0xc416e6[_0x7d59('0x51')]=moment()[_0x7d59('0xc5')](_0xc416e6[_0x7d59('0xc4')],'minutes');}if(!this[_0x7d59('0x89')](_0xc416e6[_0x7d59('0xc6')])){_0xc416e6[_0x7d59('0xc6')]=0x2;}this[_0x7d59('0x4b')][_0x7d59('0x76')](this,_0xc416e6);return this['channel']['noop'](util[_0x7d59('0x5c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xc416e6[_0x7d59('0xc7')],_0xc416e6[_0x7d59('0xc2')],_0xc416e6['scheduledAt']));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xc8')]=function(_0x488c4a){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xc9'),_0x488c4a[_0x7d59('0xad')]));var _0x175b6f=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x488c4a[_0x7d59('0xca')],_0x488c4a[_0x7d59('0x7d')]);if(_0x175b6f[_0x7d59('0xa8')]===-0x1){return _0x175b6f;}return this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xcb'),_0x488c4a['application'],_0x488c4a[_0x7d59('0x7d')]));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xcc')]=function(_0x185e90){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x185e90['label']));if(!this[_0x7d59('0x89')](_0x185e90[_0x7d59('0x65')])){return this[_0x7d59('0x3d')]['noop']('no\x20text\x20configured');}var _0x3c5cfa='\x22'+_0x185e90[_0x7d59('0x65')]+'\x22';if(this['isConfigured'](_0x185e90[_0x7d59('0x7d')])){_0x3c5cfa+=','+_0x185e90[_0x7d59('0x7d')];}var _0x2fd686=this[_0x7d59('0x3d')][_0x7d59('0x5f')]('MRCPSynth',_0x3c5cfa);if(_0x2fd686[_0x7d59('0xa8')]===-0x1){return _0x2fd686;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xcd'),_0x3c5cfa));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xce')]=function(_0x446474){logger['info'](util['format'](_0x7d59('0xcf'),_0x446474[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x446474[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20text\x20configured');}var _0x13d782='\x22'+_0x446474['text']+'\x22';if(this[_0x7d59('0x89')](_0x446474['options'])){_0x13d782+=','+_0x446474[_0x7d59('0x7d')];}var _0x1273b4=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0xaf'),_0x13d782);if(_0x1273b4[_0x7d59('0xa8')]===-0x1){return _0x1273b4;}return this[_0x7d59('0x3d')]['noop'](util['format'](_0x7d59('0xcd'),_0x13d782));};AGIVertices['prototype']['lumenvoxasr']=function(_0x3bfeb1){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xd0'),_0x3bfeb1[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x3bfeb1['grammar'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20grammar\x20configured');}var _0x56de12=_0x3bfeb1[_0x7d59('0xb2')];if(this[_0x7d59('0x89')](_0x3bfeb1[_0x7d59('0x7d')])){_0x56de12+=','+_0x3bfeb1[_0x7d59('0x7d')];}var _0x230944=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0xb4'),_0x56de12);if(_0x230944[_0x7d59('0xa8')]===-0x1){return _0x230944;}var _0x3a2b99=this[_0x7d59('0xa7')]('RECOG_CONFIDENCE()',_0x7d59('0xd1'));if(_0x3a2b99['result']===-0x1){return _0x3a2b99;}var _0x470588=this[_0x7d59('0xa7')](_0x7d59('0xb6'),_0x7d59('0xd2'));if(_0x470588['result']===-0x1){return _0x470588;}var _0x42632a=this[_0x7d59('0xa7')](_0x7d59('0xb8'),'LUMENVOX_ASR_INSTANCE');if(_0x42632a[_0x7d59('0xa8')]===-0x1){return _0x42632a;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xba'),_0x56de12));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xd3')]=function(_0x3df902){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0xd4'),_0x3df902[_0x7d59('0xad')]));if(!this['isConfigured'](_0x3df902['grammar'])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x21fe70=_0x3df902[_0x7d59('0xb2')];if(this[_0x7d59('0x89')](_0x3df902[_0x7d59('0x7d')])){_0x21fe70+=','+_0x3df902[_0x7d59('0x7d')];}var _0x37912b=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0xb4'),_0x21fe70);if(_0x37912b['result']===-0x1){return _0x37912b;}var _0x131feb=this[_0x7d59('0xa7')](_0x7d59('0xb5'),_0x7d59('0xd5'));if(_0x131feb[_0x7d59('0xa8')]===-0x1){return _0x131feb;}var _0x44c80b=this[_0x7d59('0xa7')](_0x7d59('0xb6'),_0x7d59('0xd6'));if(_0x44c80b[_0x7d59('0xa8')]===-0x1){return _0x44c80b;}var _0x5cc013=this['getAndSetVariable'](_0x7d59('0xb8'),_0x7d59('0xd7'));if(_0x5cc013[_0x7d59('0xa8')]===-0x1){return _0x5cc013;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0xba'),_0x21fe70));};AGIVertices[_0x7d59('0x15')]['database']=function(_0x55df6e){logger[_0x7d59('0x33')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x55df6e['label']));if(!this[_0x7d59('0x89')](_0x55df6e[_0x7d59('0xd8')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x55df6e,_0x7d59('0xd9'));}var _0x391dd8=this[_0x7d59('0x1d')][_0x7d59('0x76')](this,_0x55df6e[_0x7d59('0xd8')]);if(!_0x391dd8){return this[_0x7d59('0x3d')]['error'](_0x55df6e,_0x7d59('0xda'));}if(!this[_0x7d59('0x89')](_0x55df6e['query'])){return this['channel'][_0x7d59('0x31')](_0x55df6e,_0x7d59('0xdb'));}var _0x5eb8d9=_0x55df6e[_0x7d59('0x35')][_0x7d59('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7d59('0x3d')]['noop'](util['format'](_0x7d59('0xdc'),_0x5eb8d9));var _0x1ba6c8=this[_0x7d59('0xdd')][_0x7d59('0x76')](this,_0x391dd8,_0x5eb8d9);this['createSquareDetailsReport']['sync'](this,_0x55df6e,_0x5eb8d9);if(!this[_0x7d59('0x89')](_0x55df6e['variable_id'])){return this['channel'][_0x7d59('0xae')](_0x7d59('0xde'));}var _0x5c30ca=this['getVariable'][_0x7d59('0x76')](this,_0x55df6e['variable_id']);if(!_0x5c30ca){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x55df6e,_0x7d59('0xdf'));}var _0x41e608=this;_0x1ba6c8[_0x7d59('0xe0')](function(_0x1929c6,_0x20c358){Object[_0x7d59('0xe1')](_0x1929c6)[_0x7d59('0xe0')](function(_0x44295b){_0x41e608['channel'][_0x7d59('0xa3')](util[_0x7d59('0x5c')](_0x7d59('0xe2'),_0x5c30ca,_0x20c358,_0x44295b),_0x1929c6[_0x44295b]);});});this[_0x7d59('0x3d')][_0x7d59('0xa3')](util['format'](_0x7d59('0xe3'),_0x5c30ca),_0x1ba6c8[_0x7d59('0xa2')]);return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format']('variable\x20%s\x20set',_0x5c30ca));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xe4')]=function(_0x50b00c){logger['debug'](util[_0x7d59('0x5c')](_0x7d59('0xe5'),_0x50b00c[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x50b00c[_0x7d59('0xe6')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x50b00c,'no\x20user\x20selected');}var _0x576fcf=this['getUser'][_0x7d59('0x76')](this,_0x50b00c['sip_id']);if(!_0x576fcf){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x50b00c,_0x7d59('0xe7'));}var _0x3b8dfe=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0xe8'),[util[_0x7d59('0x5c')]('SIP/%s',_0x576fcf),_0x50b00c[_0x7d59('0x6e')],_0x50b00c[_0x7d59('0xe9')],_0x50b00c[_0x7d59('0xea')]]);if(_0x3b8dfe[_0x7d59('0xa8')]===-0x1){return _0x3b8dfe;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x3248ab){logger[_0x7d59('0x33')](util['format'](_0x7d59('0xeb'),_0x3248ab['label']));if(!this[_0x7d59('0x89')](_0x3248ab[_0x7d59('0x7f')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xec'));}if(!this[_0x7d59('0x89')](_0x3248ab['text'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20text\x20configured');}this[_0x7d59('0x3d')][_0x7d59('0xed')]=!![];this[_0x7d59('0x3c')](_0x3248ab);this[_0x7d59('0x4a')](_0x3248ab['text'],'in','','');this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xee'),_0x3248ab['text']));var _0x4a6711=this['googleDialogflow'][_0x7d59('0x76')](this,_0x3248ab);if(_0x4a6711){for(var _0x55c0da in _0x4a6711){if(_0x4a6711[_0x7d59('0x99')](_0x55c0da)){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util['format']('DIALOGFLOW_%s',_0x55c0da['toUpperCase']()),_0x4a6711[_0x55c0da]);}}this[_0x7d59('0x4a')](_0x4a6711[_0x7d59('0xef')],_0x7d59('0xf0'),'dialogflow','');return this['channel'][_0x7d59('0xae')](util['format']('Dialogflow\x20Result\x20%s',_0x4a6711['speech']));}return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x3248ab,_0x7d59('0xf1'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xf2')]=function(_0x48dd64){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0xf3'),_0x48dd64['label']));if(!this[_0x7d59('0x89')](_0x48dd64[_0x7d59('0x82')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xf4'));}if(!this['isConfigured'](_0x48dd64[_0x7d59('0xf5')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xf6'));}if(!this[_0x7d59('0x89')](_0x48dd64[_0x7d59('0x83')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xf7'));}if(!this[_0x7d59('0x89')](_0x48dd64['dialogflowV2_language'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xf8'));}if(!this['isConfigured'](_0x48dd64[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20text\x20configured');}this[_0x7d59('0x3d')][_0x7d59('0xed')]=!![];this['createSquareDetailsReport'](_0x48dd64);this[_0x7d59('0x4a')](_0x48dd64[_0x7d59('0x65')],'in','','');this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xf9'),_0x48dd64[_0x7d59('0x65')]));var _0x2a4748=this[_0x7d59('0x81')][_0x7d59('0x76')](this,_0x48dd64);if(_0x2a4748){for(var _0x31d375 in _0x2a4748){if(_0x2a4748[_0x7d59('0x99')](_0x31d375)){if(_0x31d375!==_0x7d59('0xfa')){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')]('DIALOGFLOW_%s',_0x31d375[_0x7d59('0xfb')]()),_0x2a4748[_0x31d375]);}}}this[_0x7d59('0x4a')](_0x2a4748[_0x7d59('0xef')],_0x7d59('0xf0'),_0x7d59('0xf2'),_0x2a4748[_0x7d59('0xfa')]);return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xfc'),_0x2a4748[_0x7d59('0xef')]));}return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x48dd64,_0x7d59('0xfd'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0xfe')]=function(_0x15fcc3){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0xff'),_0x15fcc3[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x15fcc3[_0x7d59('0x100')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x101'));}if(!this[_0x7d59('0x89')](_0x15fcc3[_0x7d59('0x102')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x103'));}if(!this[_0x7d59('0x89')](_0x15fcc3['password'])){return this[_0x7d59('0x3d')]['noop'](_0x7d59('0x104'));}if(!this[_0x7d59('0x89')](_0x15fcc3[_0x7d59('0x105')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x106'));}this[_0x7d59('0x3d')][_0x7d59('0xed')]=!![];this['createSquareDetailsReport'](_0x15fcc3);this[_0x7d59('0x4a')](_0x15fcc3[_0x7d59('0x65')],'in','','');this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x107'),_0x15fcc3[_0x7d59('0x65')]));var _0x4aa8ba=this[_0x7d59('0x85')][_0x7d59('0x76')](this,_0x15fcc3);if(_0x4aa8ba){for(var _0x47ea10 in _0x4aa8ba){if(_0x4aa8ba[_0x7d59('0x99')](_0x47ea10)){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util['format'](_0x7d59('0x108'),_0x47ea10[_0x7d59('0xfb')]()),_0x4aa8ba[_0x47ea10]);}}this[_0x7d59('0x4a')](_0x4aa8ba[_0x7d59('0xef')],_0x7d59('0xf0'),_0x7d59('0xfe'),'');if(_0x4aa8ba[_0x7d59('0x109')]){this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x10a'),_0x4aa8ba[_0x7d59('0x109')]));var _0x3330e7=this['channel'][_0x7d59('0x10b')](_0x4aa8ba[_0x7d59('0x109')]);try{fs[_0x7d59('0x10c')](_0x4aa8ba[_0x7d59('0x109')]+_0x7d59('0x10d'));}catch(_0x144b17){logger[_0x7d59('0x31')](_0x144b17);}return _0x3330e7;}else{return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x10e'),_0x4aa8ba[_0x7d59('0xef')]));}}return this['channel']['error'](_0x15fcc3,_0x7d59('0x10f'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x110')]=function(_0x2b113e){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x111'),_0x2b113e[_0x7d59('0xad')]));return this[_0x7d59('0x3d')]['noop'](_0x7d59('0x110'));};AGIVertices[_0x7d59('0x15')]['ext_dial']=function(_0x30396c){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x30396c[_0x7d59('0xad')]));var _0x382182='';if(_0x30396c['trunk_id']){if(!this[_0x7d59('0x89')](_0x30396c[_0x7d59('0x112')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x30396c,_0x7d59('0x113'));}else{var _0x43ba38=parseInt(_0x30396c[_0x7d59('0x112')],0xa);if(isNaN(_0x43ba38)){_0x382182=_0x30396c[_0x7d59('0x112')];}else{_0x382182=this[_0x7d59('0x21')]['sync'](this,_0x30396c[_0x7d59('0x112')]);if(!_0x382182){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x30396c,_0x7d59('0x114'));}}}}else if(_0x30396c[_0x7d59('0x115')]){_0x382182=_0x30396c['trunk_name'];}else{return this[_0x7d59('0x3d')]['error'](_0x30396c,_0x7d59('0x113'));}var _0x5afd50=this['channel'][_0x7d59('0x5f')](_0x7d59('0xe8'),[util[_0x7d59('0x5c')](_0x7d59('0x116'),_0x382182,_0x30396c[_0x7d59('0xc7')]),_0x30396c[_0x7d59('0x6e')],_0x30396c[_0x7d59('0xe9')],_0x30396c[_0x7d59('0xea')]]);if(_0x5afd50[_0x7d59('0xa8')]===-0x1){return _0x5afd50;}return this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x117'),'DIAL'));};AGIVertices[_0x7d59('0x15')]['finally']=function(_0x58aa46){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x118'),_0x58aa46[_0x7d59('0xad')]));return this[_0x7d59('0x3d')][_0x7d59('0xae')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x584617){logger[_0x7d59('0x33')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x584617[_0x7d59('0xad')]));if(_0x584617[_0x7d59('0xaa')]===0x0){return this[_0x7d59('0x119')](_0x584617);}_0x584617['retry']-=0x1;if(!this[_0x7d59('0x89')](_0x584617['file_id'])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x584617,'no\x20file\x20audio\x20selected');}var _0x34578d=this['getSound'][_0x7d59('0x76')](this,_0x584617['file_id']);if(!_0x34578d){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x584617,_0x7d59('0x11a'));}if(!this[_0x7d59('0x89')](_0x584617['variable_id'])){return this['channel']['error'](_0x7d59('0xde'));}var _0x30cda6=this[_0x7d59('0x3d')][_0x7d59('0x11b')](_0x34578d,_0x584617[_0x7d59('0x11c')],_0x584617[_0x7d59('0x11d')]);var _0x13bce1=_0x30cda6[_0x7d59('0xa8')]?_0x30cda6[_0x7d59('0xa8')][_0x7d59('0x54')]():'';logger[_0x7d59('0x33')](_0x7d59('0x11e'),JSON[_0x7d59('0x79')](_0x30cda6));if(_0x30cda6[_0x7d59('0xa8')]===-0x1){this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x584617,_0x13bce1);return _0x30cda6;}else if(_0x30cda6[_0x7d59('0xa6')]===_0x7d59('0x6e')){_0x30cda6[_0x7d59('0xa8')]=_0x13bce1[_0x7d59('0xa2')]>=parseInt(_0x584617[_0x7d59('0x11f')])?'x':'i';}else{_0x30cda6['result']=_0x13bce1[_0x7d59('0xa2')]>=parseInt(_0x584617['mindigit'])&&_0x13bce1[_0x7d59('0xa2')]<=parseInt(_0x584617[_0x7d59('0x11d')])?'x':'i';}var _0x134d9f=this['getVariable'][_0x7d59('0x76')](this,_0x584617['variable_id']);if(!_0x134d9f){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x584617,_0x7d59('0xdf'));}this[_0x7d59('0x3d')]['setVariable'](_0x134d9f,_0x13bce1);if(this[_0x7d59('0x89')](_0x584617['hiddendigitsnum'])){var _0x2c4338=parseInt(_0x584617[_0x7d59('0x120')],0xa);var _0xe9c655=rs[_0x7d59('0x121')]({'charset':'*','length':_0x2c4338});var _0x2002bb=_0x13bce1[_0x7d59('0xa2')];if(_0x2002bb>0x0){if(_0x2002bb>_0x2c4338){this['createSquareDetailsReport']['sync'](this,_0x584617,_0x584617[_0x7d59('0x122')]==='first'?_0xe9c655+_0x13bce1['substr'](_0x2c4338):_0x13bce1[_0x7d59('0x123')](0x0,_0x2002bb-_0x2c4338)+_0xe9c655);}else{this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x584617,rs['generate']({'charset':'*','length':_0x2002bb}));}}else{this['createSquareDetailsReport'][_0x7d59('0x76')](this,_0x584617,'');}}else{this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x584617,_0x13bce1);}return _0x30cda6;};AGIVertices[_0x7d59('0x15')][_0x7d59('0x12')]=function(_0x88999){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x124'),_0x88999[_0x7d59('0xad')]));return this[_0x7d59('0x11')](_0x88999);};AGIVertices[_0x7d59('0x15')][_0x7d59('0x125')]=function(_0x3f2d61){logger['info'](util[_0x7d59('0x5c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x3f2d61[_0x7d59('0xad')]));this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x3f2d61,_0x3f2d61[_0x7d59('0x126')]);return this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x127'),_0x3f2d61['goalname']));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x128')]=function(_0x2d170e){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x129'),_0x2d170e[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x2d170e['aws_access_key_id'])||!this[_0x7d59('0x89')](_0x2d170e['aws_secret_access_key'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x7d59('0x89')](_0x2d170e[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x106'));}this['channel']['noop'](util[_0x7d59('0x5c')](_0x7d59('0x12a'),_0x2d170e[_0x7d59('0x65')]));var _0x2a2a54=this[_0x7d59('0x8b')][_0x7d59('0x76')](this,_0x2d170e);if(_0x2a2a54){this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')]('aws\x20Polly\x20%s\x20file\x20created',_0x2a2a54));var _0x31e029=this['channel'][_0x7d59('0x10b')](_0x2a2a54);try{fs[_0x7d59('0x10c')](_0x2a2a54+'.wav');}catch(_0x347109){logger['error'](_0x347109);}return _0x31e029;}return this[_0x7d59('0x3d')]['error'](_0x2d170e,_0x7d59('0x12b'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x12c')]=function(_0x2ba50a){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x12d'),_0x2ba50a[_0x7d59('0xad')]));if(!this['isConfigured'](_0x2ba50a[_0x7d59('0x8c')])||!this[_0x7d59('0x89')](_0x2ba50a[_0x7d59('0x8d')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x7d59('0x89')](_0x2ba50a[_0x7d59('0x12e')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20bot\x20name\x20configured');}if(!this[_0x7d59('0x89')](_0x2ba50a[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x106'));}this[_0x7d59('0x3d')][_0x7d59('0xed')]=!![];this[_0x7d59('0x3c')](_0x2ba50a);this[_0x7d59('0x4a')](_0x2ba50a['text'],'in','','');this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x12f'),_0x2ba50a[_0x7d59('0x65')]));var _0x157496=this[_0x7d59('0x92')]['sync'](this,_0x2ba50a);if(_0x157496){for(var _0xf67f1 in _0x157496){if(_0x157496[_0x7d59('0x99')](_0xf67f1)&&_[_0x7d59('0x9a')](_0x157496[_0xf67f1])){this[_0x7d59('0x3d')]['setVariable'](util['format'](_0x7d59('0x130'),_0xf67f1[_0x7d59('0xfb')]()),_0x157496[_0xf67f1]);}}if(_[_0x7d59('0x4d')](_0x157496['message'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x131'));}else{this[_0x7d59('0x4a')](_0x157496[_0x7d59('0x7c')],_0x7d59('0xf0'),_0x7d59('0x132'),'');return this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x133'),_0x157496[_0x7d59('0x7c')]));}}return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x2ba50a,_0x7d59('0x134'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x135')]=function(_0xe603d5){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x136'),_0xe603d5[_0x7d59('0xad')],_0xe603d5['timeout']));if(!this[_0x7d59('0x89')](_0xe603d5[_0x7d59('0x7f')])){return this['channel'][_0x7d59('0xae')](_0x7d59('0xec'));}var _0x16d023=_0x7d59('0x137');var _0x8f69a1=util['format'](_0x7d59('0x138'),FILES_PATH,rs[_0x7d59('0x121')](0x4));var _0x1253d1=util[_0x7d59('0x5c')](_0x7d59('0xa1'),_0x8f69a1,_0x16d023);var _0x4d0e91=!![];if(_0xe603d5[_0x7d59('0x139')]===_0x7d59('0x13a')){_0x4d0e91=![];}var _0x5f131e=this[_0x7d59('0x3d')][_0x7d59('0x13b')](_0x8f69a1,_0x16d023,_0xe603d5[_0x7d59('0x13c')],_0xe603d5[_0x7d59('0x6e')],undefined,_0x4d0e91);if(_0x5f131e[_0x7d59('0xa8')]!==-0x1){this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x13d'),_0x1253d1));var _0x9e936e=this[_0x7d59('0x13e')][_0x7d59('0x76')](this,_0xe603d5,_0x1253d1);if(_0x9e936e){for(var _0x4b8cae in _0x9e936e){if(_0x9e936e[_0x7d59('0x99')](_0x4b8cae)){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')](_0x7d59('0x13f'),_0x4b8cae[_0x7d59('0xfb')]()),_0x9e936e[_0x4b8cae]);}}return this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x140'),JSON[_0x7d59('0x79')](_0x9e936e)));}}return _0x5f131e;};AGIVertices['prototype'][_0x7d59('0x141')]=function(_0x1855a8){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x142'),_0x1855a8[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x1855a8['appid'])){return this[_0x7d59('0x3d')]['noop']('no\x20appid\x20configured');}if(!this[_0x7d59('0x89')](_0x1855a8[_0x7d59('0x96')])){return this[_0x7d59('0x3d')]['noop']('no\x20appsecret\x20configured');}var _0x190d12=_0x7d59('0x137');var _0x3bfb7e=util[_0x7d59('0x5c')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3fa9ec=util[_0x7d59('0x5c')](_0x7d59('0xa1'),_0x3bfb7e,_0x190d12);var _0x3e5429=!![];if(_0x1855a8['beep']===_0x7d59('0x13a')){_0x3e5429=![];}var _0x22fd3b=this['channel'][_0x7d59('0x13b')](_0x3bfb7e,_0x190d12,_0x1855a8[_0x7d59('0x13c')],_0x1855a8[_0x7d59('0x6e')],undefined,_0x3e5429);if(_0x22fd3b[_0x7d59('0xa8')]!==-0x1){this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x143'),_0x3fa9ec));var _0x22afdb=this[_0x7d59('0x95')][_0x7d59('0x76')](this,_0x1855a8,_0x3fa9ec);if(_0x22afdb){for(var _0x21b619 in _0x22afdb){if(_0x22afdb['hasOwnProperty'](_0x21b619)){this['channel'][_0x7d59('0xa3')](util[_0x7d59('0x5c')]('TILDE_ASR_%s',_0x21b619[_0x7d59('0xfb')]()),_0x22afdb[_0x21b619]);}}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x144'),JSON[_0x7d59('0x79')](_0x22afdb)));}}return _0x22fd3b;};AGIVertices[_0x7d59('0x15')][_0x7d59('0x145')]=function(_0x57971f){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x146'),_0x57971f[_0x7d59('0xad')]));return this[_0x7d59('0x3d')][_0x7d59('0x147')](_0x57971f[_0x7d59('0x43')],_0x57971f[_0x7d59('0x44')],_0x57971f[_0x7d59('0x45')]);};AGIVertices[_0x7d59('0x15')]['gotoif']=function(_0x2db2bb){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2db2bb[_0x7d59('0xad')]));if(!this['isConfigured'](_0x2db2bb[_0x7d59('0x148')])){return this['channel'][_0x7d59('0x31')](_0x2db2bb,_0x7d59('0x149'));}try{var _0xea4c4b=eval(_0x2db2bb[_0x7d59('0x148')])?_0x7d59('0x14a'):_0x7d59('0x14b');this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2db2bb['condition'],_0xea4c4b));return{'code':0xc8,'result':_0xea4c4b};}catch(_0x3cde9d){return{'code':0xc8,'result':_0x7d59('0x14b')};}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x14c')]=function(_0x3001c3){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x14d'),_0x3001c3['label']));if(!this['isConfigured'](_0x3001c3[_0x7d59('0x14e')])){return this[_0x7d59('0x3d')]['error'](_0x3001c3,_0x7d59('0x14f'));}var _0x466ef3=this[_0x7d59('0x2a')][_0x7d59('0x76')](this,_0x3001c3['interval_id']);if(!_0x466ef3){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x3001c3,_0x7d59('0x150'));}for(var _0xc964e8=0x0;_0xc964e8<_0x466ef3[_0x7d59('0xa2')];_0xc964e8+=0x1){var _0x47a002=this['channel'][_0x7d59('0xa5')](util[_0x7d59('0x5c')](_0x7d59('0x151'),_0x466ef3[_0xc964e8]));if(_0x47a002[_0x7d59('0xa8')]===-0x1){return _0x47a002;}logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x152'),_0x466ef3[_0xc964e8],_0x47a002['extra']));if(_0x47a002[_0x7d59('0xa6')]===_0x7d59('0x14a')){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x152'),_0x466ef3[_0xc964e8],'true'));this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')]('IFTIME\x20%s\x20%s',_0x466ef3[_0xc964e8],_0x7d59('0x14a')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x7d59('0x5c')]('IFTIME\x20%s\x20%s',_0x466ef3[_0xc964e8],_0x7d59('0x14b')));this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x152'),_0x466ef3[_0xc964e8],_0x7d59('0x14b')));}}return{'code':0xc8,'result':_0x7d59('0x14b')};};AGIVertices[_0x7d59('0x15')][_0x7d59('0x153')]=function(_0x28012d){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x154'),_0x28012d['label']));return this['channel'][_0x7d59('0x153')]();};AGIVertices[_0x7d59('0x15')][_0x7d59('0x155')]=function(_0x3284cf){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x156'),_0x3284cf[_0x7d59('0xad')]));if(!this['isConfigured'](_0x3284cf[_0x7d59('0x7f')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xec'));}var _0x3f146c=_0x7d59('0x137');var _0x18234f=util['format'](_0x7d59('0x138'),FILES_PATH,rs[_0x7d59('0x121')](0x4));var _0x955807=util['format'](_0x7d59('0xa1'),_0x18234f,_0x3f146c);var _0x47a274=!![];if(_0x3284cf[_0x7d59('0x139')]===_0x7d59('0x13a')){_0x47a274=![];}var _0x1f6938=this['channel']['recordFile'](_0x18234f,_0x3f146c,_0x3284cf[_0x7d59('0x13c')],_0x3284cf[_0x7d59('0x6e')],undefined,_0x47a274);if(_0x1f6938[_0x7d59('0xa8')]!==-0x1){this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x157'),_0x955807));var _0x528bf6=this[_0x7d59('0x158')][_0x7d59('0x76')](this,_0x3284cf,_0x955807);if(_0x528bf6){for(var _0x2e8afd in _0x528bf6){if(_0x528bf6[_0x7d59('0x99')](_0x2e8afd)){this[_0x7d59('0x3d')][_0x7d59('0xa3')](util['format'](_0x7d59('0x159'),_0x2e8afd[_0x7d59('0xfb')]()),_0x528bf6[_0x2e8afd]);}}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x528bf6)));}}return _0x1f6938;};AGIVertices[_0x7d59('0x15')][_0x7d59('0x15a')]=function(_0x2a133b){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x15b'),_0x2a133b[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x2a133b['key'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0xec'));}if(!this['isConfigured'](_0x2a133b[_0x7d59('0x65')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20text\x20configured');}this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x15c'),_0x2a133b[_0x7d59('0x65')]));var _0x14b77e=this[_0x7d59('0x86')][_0x7d59('0x76')](this,_0x2a133b);if(_0x14b77e){this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x157'),_0x14b77e));var _0x313c63=this[_0x7d59('0x3d')]['streamFile'](_0x14b77e,_0x2a133b[_0x7d59('0x13c')]);try{fs[_0x7d59('0x10c')](_0x14b77e+_0x7d59('0x10d'));}catch(_0x2aed47){logger[_0x7d59('0x31')](_0x2aed47);}return _0x313c63;}return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x2a133b,_0x7d59('0x15d'));};AGIVertices[_0x7d59('0x15')]['login']=function(_0x3c0c16){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x15e'),_0x3c0c16[_0x7d59('0xad')]));if(!this['isConfigured'](_0x3c0c16[_0x7d59('0x15f')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x3c0c16,_0x7d59('0x160'));}logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x161'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x3c0c16[_0x7d59('0x15f')]));var _0x5d8558=this[_0x7d59('0x5a')]['sync'](this,_0x3c0c16['findBy']);if(_0x5d8558){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x3c0c16[_0x7d59('0x15f')]));this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x3c0c16[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x163')};}else{logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x164'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x3c0c16[_0x7d59('0x15f')]));this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x164'),this['channel'][_0x7d59('0x40')],_0x3c0c16[_0x7d59('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x165')]=function(_0x2fd4fc){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x166'),_0x2fd4fc[_0x7d59('0xad')]));if(!this['isConfigured'](_0x2fd4fc[_0x7d59('0x15f')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x2fd4fc,_0x7d59('0x160'));}logger[_0x7d59('0x33')](util['format'](_0x7d59('0x161'),this[_0x7d59('0x3d')]['callerid'],_0x2fd4fc[_0x7d59('0x15f')]));var _0x33b4cb=this[_0x7d59('0x167')][_0x7d59('0x76')](this,_0x2fd4fc['findBy']);if(_0x33b4cb){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x162'),this['channel'][_0x7d59('0x40')],_0x2fd4fc[_0x7d59('0x15f')]));this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x2fd4fc[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x163')};}else{logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7d59('0x3d')]['callerid'],_0x2fd4fc[_0x7d59('0x15f')]));this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0x164'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x2fd4fc[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x168')};}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x169')]=function(_0x41c56c){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x41c56c[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x41c56c[_0x7d59('0x16a')])){return this[_0x7d59('0x3d')]['error'](_0x41c56c,'no\x20operation\x20configured');}this['channel'][_0x7d59('0xae')](util['format'](_0x7d59('0x16b'),_0x41c56c[_0x7d59('0x16a')]));var _0x5be0=eval(_0x41c56c[_0x7d59('0x16a')]);if(!this['isConfigured'](_0x41c56c[_0x7d59('0x16c')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x459fea=this[_0x7d59('0xa5')][_0x7d59('0x76')](this,_0x41c56c[_0x7d59('0x16c')]);if(!_0x459fea){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x41c56c,_0x7d59('0xdf'));}if(_[_0x7d59('0x9f')](_0x5be0)){var _0x59d2b9=this;_0x5be0[_0x7d59('0xe0')](function(_0x1efe8d,_0x580068){_0x59d2b9[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')](_0x7d59('0x16d'),_0x459fea,_0x580068),_0x1efe8d);});return this['channel'][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x16e'),_0x459fea));}else{return this['channel'][_0x7d59('0xa3')](_0x459fea,_0x5be0);}};AGIVertices[_0x7d59('0x15')]['menu']=function(_0xec0274){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x16f'),_0xec0274[_0x7d59('0xad')]));if(_0xec0274['retry']===0x0){return this[_0x7d59('0x119')](_0xec0274);}_0xec0274[_0x7d59('0xaa')]-=0x1;if(!this['isConfigured'](_0xec0274[_0x7d59('0x170')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0xec0274,'no\x20file\x20audio\x20selected');}var _0x137dd0=this[_0x7d59('0x23')][_0x7d59('0x76')](this,_0xec0274[_0x7d59('0x170')]);if(!_0x137dd0){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0xec0274,_0x7d59('0x11a'));}var _0x5a4b22=this[_0x7d59('0x3d')][_0x7d59('0x11b')](_0x137dd0,_0xec0274[_0x7d59('0x11c')],_0xec0274[_0x7d59('0x171')]);var _0x4b46bc=_0x5a4b22[_0x7d59('0xa8')];if(_0x5a4b22['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0xec0274,'-1');return _0x5a4b22;}else if(_0x5a4b22['extra']===_0x7d59('0x6e')){_0x5a4b22[_0x7d59('0xa8')]=_0x5a4b22[_0x7d59('0xa8')]['length']>0x0?_0x5a4b22[_0x7d59('0xa8')]:'t';}else if(_[_0x7d59('0x4c')](_0x5a4b22[_0x7d59('0xa8')])){_0x5a4b22['result']='#';_0x4b46bc='#';}if(!this[_0x7d59('0x89')](_0xec0274[_0x7d59('0x16c')])){this[_0x7d59('0x3d')]['noop'](_0x7d59('0xde'));}else{var _0x3a592c=this[_0x7d59('0xa5')][_0x7d59('0x76')](this,_0xec0274[_0x7d59('0x16c')]);if(!_0x3a592c){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0xec0274,_0x7d59('0xdf'));}this['channel'][_0x7d59('0xa3')](_0x3a592c,_0x4b46bc);}this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0xec0274,_0x4b46bc);return _0x5a4b22;};AGIVertices[_0x7d59('0x15')][_0x7d59('0xae')]=function(_0x4f755d){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x172'),_0x4f755d['label']));return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x4f755d[_0x7d59('0x173')]||_0x4f755d[_0x7d59('0xad')]);};AGIVertices['prototype'][_0x7d59('0x174')]=function(_0x44d64a){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x175'),_0x44d64a['label']));if(!this[_0x7d59('0x89')](_0x44d64a[_0x7d59('0x15f')])){return this['channel']['error'](_0x44d64a,_0x7d59('0x160'));}logger[_0x7d59('0x33')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x7d59('0x40')],_0x44d64a[_0x7d59('0x15f')]));var _0x477be2=this['getPause'][_0x7d59('0x76')](this,_0x44d64a[_0x7d59('0x176')]);var _0x1051eb=this['agentPause']['sync'](this,_0x44d64a[_0x7d59('0x15f')],_0x477be2);if(_0x1051eb){logger['info'](util[_0x7d59('0x5c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x44d64a[_0x7d59('0x15f')]));this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')]['callerid'],_0x44d64a[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x163')};}else{logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x7d59('0x40')],_0x44d64a['findBy']));this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x44d64a[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x168')};}};AGIVertices['prototype'][_0x7d59('0x177')]=function(_0x4f5ee9){logger[_0x7d59('0x33')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4f5ee9[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x4f5ee9[_0x7d59('0x170')])){return this[_0x7d59('0x3d')]['error'](_0x4f5ee9,_0x7d59('0x178'));}var _0x430253=this['getSound'][_0x7d59('0x76')](this,_0x4f5ee9[_0x7d59('0x170')]);if(!_0x430253){return this['channel'][_0x7d59('0x31')](_0x4f5ee9,'no\x20file\x20audio\x20found');}var _0x3bb562=this['channel'][_0x7d59('0x5f')](_0x7d59('0x179'),[_0x430253,_0x4f5ee9[_0x7d59('0xe9')]]);if(_0x3bb562[_0x7d59('0xa8')]===-0x1){return _0x3bb562;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0xcb'),_0x7d59('0x179'),_0x430253));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x17a')]=function(_0x429ea5){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x429ea5['label']));if(!this[_0x7d59('0x89')](_0x429ea5['queue_id'])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x429ea5,'no\x20queue\x20selected');}var _0x2ee450='';var _0x4f96f2=parseInt(_0x429ea5['queue_id'],0xa);if(isNaN(_0x4f96f2)){_0x2ee450=_0x429ea5[_0x7d59('0x17b')];}else{_0x2ee450=this[_0x7d59('0x17c')][_0x7d59('0x76')](this,_0x429ea5[_0x7d59('0x17b')]);if(!_0x2ee450){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x429ea5,'no\x20queue\x20found');}}var _0x4968a2='';if(this['isConfigured'](_0x429ea5[_0x7d59('0x170')])){var _0x321034=this['getSound'][_0x7d59('0x76')](this,_0x429ea5['file_id']);if(_0x321034){_0x4968a2=_0x321034;}}this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x429ea5,_0x2ee450);if(_0x429ea5[_0x7d59('0xe9')][_0x7d59('0x17d')]('x')<0x0){_0x429ea5['opts']+='x';}if(_0x429ea5[_0x7d59('0xe9')][_0x7d59('0x17d')]('X')<0x0){_0x429ea5[_0x7d59('0xe9')]+='X';}this['channel'][_0x7d59('0xa3')](_0x7d59('0x17e'),_0x2ee450?_0x2ee450[_0x7d59('0x17f')]():'');var _0x76e72=this['channel'][_0x7d59('0x5f')](_0x7d59('0x180'),[_0x2ee450,_0x429ea5[_0x7d59('0xe9')],_0x429ea5[_0x7d59('0xea')],_0x4968a2,_0x429ea5[_0x7d59('0x6e')],_0x429ea5[_0x7d59('0xa')],_0x429ea5[_0x7d59('0x181')],_0x429ea5[_0x7d59('0x182')],'',_0x429ea5[_0x7d59('0x183')]]);if(_0x76e72['result']===-0x1){return _0x76e72;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0xcb'),_0x7d59('0x180'),_0x2ee450));};AGIVertices['prototype'][_0x7d59('0x184')]=function(_0x2b56e9){logger['info'](util['format'](_0x7d59('0x185'),_0x2b56e9[_0x7d59('0xad')]));var _0xc48d7e=_0x2b56e9['recordingFormat']||'wav';var _0x4047f5=util[_0x7d59('0x5c')]('%s_%s',this['channel'][_0x7d59('0x3e')],rs[_0x7d59('0x121')](0x5));var _0x33216f=util[_0x7d59('0x5c')]('%s/recordings/%s.%s',FILES_PATH,_0x4047f5,_0xc48d7e);var _0x5e225f=util[_0x7d59('0x5c')](_0x7d59('0x138'),FILES_PATH,_0x4047f5);this[_0x7d59('0x41')][_0x7d59('0x76')](this,_0x2b56e9,_0x4047f5,_0x33216f);this['channel']['setVariable']('RECORDING_SAVENAME',_0x4047f5);logger[_0x7d59('0x33')](_0x7d59('0x186'),_0x5e225f,_0xc48d7e,_0x2b56e9[_0x7d59('0x187')],_0x2b56e9[_0x7d59('0x6e')]);return this[_0x7d59('0x3d')][_0x7d59('0x13b')](_0x5e225f,_0xc48d7e,_0x2b56e9[_0x7d59('0x187')],_0x2b56e9[_0x7d59('0x6e')],undefined,!![]);};AGIVertices[_0x7d59('0x15')]['restapi']=function(_0x9819e2){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x188'),_0x9819e2[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x9819e2[_0x7d59('0xea')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x189'));}var _0x23b7c8=this[_0x7d59('0x6c')][_0x7d59('0x76')](this,_0x9819e2);logger[_0x7d59('0x33')](util['format'](_0x7d59('0x18a'),util['inspect'](_0x23b7c8,{'showHidden':![],'depth':null})));if(!this[_0x7d59('0x89')](_0x9819e2[_0x7d59('0x16c')])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x18b'));}var _0x2b4f65=this['getVariable'][_0x7d59('0x76')](this,_0x9819e2[_0x7d59('0x16c')]);if(!_0x2b4f65){return this['channel']['error'](_0x9819e2,_0x7d59('0xdf'));}this[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')](_0x7d59('0x18c'),_0x2b4f65),_0x23b7c8[_0x7d59('0x7b')]?_0x23b7c8[_0x7d59('0x7b')]:_0x7d59('0x18d'));this[_0x7d59('0x3d')][_0x7d59('0xa3')](util[_0x7d59('0x5c')]('%s_STATUS_MESSAGE',_0x2b4f65),_0x23b7c8['statusMessage']?_0x23b7c8[_0x7d59('0x18e')]:'OK');if(_0x23b7c8['body']){try{this[_0x7d59('0xa0')](_0x23b7c8['body'],_0x2b4f65);}catch(_0x5769b2){logger['error'](util[_0x7d59('0x5c')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2b4f65));}}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format']('variable\x20%s\x20set',_0x2b4f65));};AGIVertices[_0x7d59('0x15')]['saydigits']=function(_0x1d6430){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x18f'),_0x1d6430[_0x7d59('0xad')]));return this[_0x7d59('0x3d')]['sayDigits'](_0x1d6430[_0x7d59('0x190')][_0x7d59('0x61')](/\s+/g,''),_0x1d6430[_0x7d59('0x187')]);};AGIVertices['prototype'][_0x7d59('0x191')]=function(_0x30daaf){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x192'),_0x30daaf[_0x7d59('0xad')]));return this['channel']['sayNumber'](_0x30daaf[_0x7d59('0x6f')][_0x7d59('0x61')](/\s+/g,''),_0x30daaf['escape_digits']);};AGIVertices[_0x7d59('0x15')][_0x7d59('0x193')]=function(_0x350ecd){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x194'),_0x350ecd[_0x7d59('0xad')]));return this[_0x7d59('0x3d')][_0x7d59('0x195')](_0x350ecd[_0x7d59('0x65')],_0x350ecd[_0x7d59('0x187')]);};AGIVertices[_0x7d59('0x15')]['sendMail']=function(_0x149716){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x196'),_0x149716[_0x7d59('0xad')]));if(!this[_0x7d59('0x89')](_0x149716['account_id'])){return this['channel'][_0x7d59('0xae')](_0x7d59('0x197'));}var _0x3e30c6=this[_0x7d59('0x27')][_0x7d59('0x76')](this,_0x149716[_0x7d59('0x198')]);if(!_0x3e30c6||!_0x3e30c6['Smtp']){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x149716,_0x7d59('0x199'));}var _0x245a1c={'from':util[_0x7d59('0x5c')]('\x22%s\x22\x20<%s>',_0x3e30c6[_0x7d59('0x1c')],_0x3e30c6['email']||_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19b')]),'to':_0x149716['to']||'','cc':_0x149716['cc']||'','bcc':_0x149716[_0x7d59('0x19c')]||'','subject':_0x149716['subject'],'html':_0x149716[_0x7d59('0x65')],'text':_0x149716[_0x7d59('0x65')]};var _0x2dc15d={'tls':{'rejectUnauthorized':![]}};if(_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19d')]){_0x2dc15d['service']=_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19d')];}else{_0x2dc15d[_0x7d59('0x19e')]=_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19e')];_0x2dc15d['port']=_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19f')];_0x2dc15d[_0x7d59('0x1a0')]=_0x3e30c6[_0x7d59('0x19a')]['secure'];}if(_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x1a1')]){_0x2dc15d[_0x7d59('0x1a2')]={'user':_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x19b')],'pass':_0x3e30c6[_0x7d59('0x19a')][_0x7d59('0x1a3')]};}if(this[_0x7d59('0x89')](_0x149716['template_id'])){}logger['debug'](_0x7d59('0x1a4'),JSON[_0x7d59('0x79')](_0x245a1c));this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x149716,_0x149716['account_id']);this['channel']['noop'](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x3e30c6[_0x7d59('0x1c')]));this[_0x7d59('0x29')][_0x7d59('0x76')](this,_0x2dc15d,_0x245a1c);return this[_0x7d59('0x3d')]['noop'](_0x7d59('0x1a5'));};AGIVertices[_0x7d59('0x15')]['sendFax']=function(_0x5837bb){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x1a6'),_0x5837bb[_0x7d59('0xad')]));return this[_0x7d59('0x3d')][_0x7d59('0xae')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x7d59('0x1a7')]=function(_0x417fcf){logger[_0x7d59('0x33')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x417fcf['label']));if(!this[_0x7d59('0x89')](_0x417fcf['sms_account_id'])){return this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x1a8'));}var _0x13bc41=this[_0x7d59('0x39')][_0x7d59('0x76')](this,_0x417fcf[_0x7d59('0x1a9')]);if(!_0x13bc41){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x417fcf,_0x7d59('0x1aa'));}var _0x1d364d={'body':_0x417fcf[_0x7d59('0x1ab')],'phone':_0x417fcf['to']||'','SmsAccountId':_0x13bc41['id']};logger[_0x7d59('0x1ac')](_0x7d59('0x1ad'),JSON[_0x7d59('0x79')](_0x1d364d));this[_0x7d59('0x3c')][_0x7d59('0x76')](this,_0x417fcf,_0x417fcf[_0x7d59('0x1a9')]);this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x1ae'),_0x13bc41[_0x7d59('0x1c')]));this['createSmsMessage'][_0x7d59('0x76')](this,_0x1d364d);return this['channel'][_0x7d59('0xae')](_0x7d59('0x1af'));};AGIVertices[_0x7d59('0x15')]['set']=function(_0x932095){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x1b0'),_0x932095[_0x7d59('0xad')]));if(!this['isConfigured'](_0x932095[_0x7d59('0x16c')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x932095,_0x7d59('0x1b1'));}var _0x498591=this[_0x7d59('0xa5')][_0x7d59('0x76')](this,_0x932095[_0x7d59('0x16c')]);if(!_0x498591){return this['channel'][_0x7d59('0x31')](_0x932095,_0x7d59('0xdf'));}return this[_0x7d59('0x3d')][_0x7d59('0xa3')](_0x498591,_0x932095['variable_value']);};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1b2')]=function(_0x171b85){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x1b3'),_0x171b85[_0x7d59('0xad')]));this[_0x7d59('0x3d')][_0x7d59('0xae')](_0x7d59('0x1b4'));if(_0x171b85[_0x7d59('0xbe')]===_0x7d59('0x1b5')){this['channel'][_0x7d59('0xae')](_0x7d59('0x1b6'));return this[_0x7d59('0x3d')][_0x7d59('0xbe')]();}return this['channel'][_0x7d59('0xae')]('Skipped\x20Answer');};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1b7')]=function(_0x121442){logger[_0x7d59('0x33')](util['format'](_0x7d59('0x1b8'),_0x121442['label']));if(!this[_0x7d59('0x89')](_0x121442['project_id'])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x121442,_0x7d59('0x1b9'));}var _0x34a437=this[_0x7d59('0x1a')][_0x7d59('0x76')](this,_0x121442[_0x7d59('0x1ba')]);if(!this[_0x7d59('0x89')](_0x34a437)){return this[_0x7d59('0x3d')]['error'](_0x121442,util[_0x7d59('0x5c')](_0x7d59('0x1bb'),_0x121442['project_id']));}if(_0x34a437===this[_0x7d59('0x3d')][_0x7d59('0x48')]){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x121442,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7d59('0x3c')]['sync'](this,_0x121442,_0x34a437);var _0x2955f0=this[_0x7d59('0x3d')][_0x7d59('0x5f')](_0x7d59('0x1bc'),util['format'](_0x7d59('0x1bd'),config[_0x7d59('0xa')][_0x7d59('0x19e')]||_0x7d59('0x1be'),_0x34a437,this[_0x7d59('0x3d')]['arg_1']));if(_0x2955f0['result']===-0x1){return _0x2955f0;}return this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0xcb'),_0x7d59('0x1bc'),_0x34a437));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1bf')]=function(_0x40bf0c){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x1c0'),_0x40bf0c[_0x7d59('0xad')]));var _0xe2ea7=this[_0x7d59('0x1c1')][_0x7d59('0x76')](this,_0x40bf0c[_0x7d59('0xbc')]);this[_0x7d59('0x3c')]['sync'](this,_0x40bf0c,_0x40bf0c['command']);if(this[_0x7d59('0x89')](_0x40bf0c[_0x7d59('0x16c')])){var _0x4dd7de=this[_0x7d59('0xa5')][_0x7d59('0x76')](this,_0x40bf0c['variable_id']);if(_0x4dd7de){this[_0x7d59('0x3d')][_0x7d59('0xa3')](_0x4dd7de,_0xe2ea7);return this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x1c2'),_0x40bf0c[_0x7d59('0xbc')],_0x4dd7de));}}return this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x1c3'),_0x40bf0c[_0x7d59('0xbc')]));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1c4')]=function(_0x2adee3){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x1c5'),_0x2adee3['label']));_0x2adee3['text']=_0x2adee3[_0x7d59('0x65')][_0x7d59('0x61')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2adee3['apiKey'])){return this[_0x7d59('0x3d')]['noop'](_0x7d59('0x1c6'));}if(!this[_0x7d59('0x89')](_0x2adee3[_0x7d59('0x65')])){return this['channel'][_0x7d59('0xae')]('no\x20text\x20configured');}this[_0x7d59('0x3d')][_0x7d59('0xae')](util['format'](_0x7d59('0x1c7'),_0x2adee3[_0x7d59('0x65')]));var _0xee3d55=this[_0x7d59('0x62')]['sync'](this,_0x2adee3);if(_0xee3d55){this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xee3d55));var _0x6b12bc=this[_0x7d59('0x3d')]['streamFile'](_0xee3d55);try{fs[_0x7d59('0x10c')](_0xee3d55+_0x7d59('0x10d'));}catch(_0x2550d6){logger['error'](_0x2550d6);}return _0x6b12bc;}return this[_0x7d59('0x3d')]['error'](_0x2adee3,_0x7d59('0x1c8'));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1c9')]=function(_0x31bf4a){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x1ca'),_0x31bf4a[_0x7d59('0xad')]));_0x31bf4a[_0x7d59('0x65')]=_0x31bf4a['text'][_0x7d59('0x61')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x31bf4a['text'])){return this[_0x7d59('0x3d')]['noop']('no\x20text\x20configured');}this[_0x7d59('0x3d')][_0x7d59('0xae')](util[_0x7d59('0x5c')](_0x7d59('0x1cb'),_0x31bf4a['text']));var _0x34571b=this[_0x7d59('0x6a')][_0x7d59('0x76')](this,_0x31bf4a);if(_0x34571b){this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x1cc'),_0x34571b));var _0x4b695e=this[_0x7d59('0x3d')]['streamFile'](_0x34571b);try{fs['unlink'](_0x34571b+_0x7d59('0x10d'));}catch(_0x449c1b){logger[_0x7d59('0x31')](_0x449c1b);}return _0x4b695e;}return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x31bf4a,_0x7d59('0x1cd'));};AGIVertices[_0x7d59('0x15')]['unpause']=function(_0x38ef9c){logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x1ce'),_0x38ef9c[_0x7d59('0xad')]));if(!this['isConfigured'](_0x38ef9c[_0x7d59('0x15f')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x38ef9c,_0x7d59('0x160'));}logger[_0x7d59('0x33')](util[_0x7d59('0x5c')](_0x7d59('0x161'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x38ef9c[_0x7d59('0x15f')]));var _0x124985=this[_0x7d59('0x58')][_0x7d59('0x76')](this,_0x38ef9c[_0x7d59('0x15f')]);if(_0x124985){logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')]['callerid'],_0x38ef9c['findBy']));this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0x162'),this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x38ef9c[_0x7d59('0x15f')]));return{'code':0xc8,'result':_0x7d59('0x163')};}else{logger['info'](util[_0x7d59('0x5c')](_0x7d59('0x164'),this[_0x7d59('0x3d')]['callerid'],_0x38ef9c[_0x7d59('0x15f')]));this['channel'][_0x7d59('0xae')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7d59('0x3d')][_0x7d59('0x40')],_0x38ef9c[_0x7d59('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1cf')]=function(_0x4208d4){logger['info'](util[_0x7d59('0x5c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4208d4['label']));var _0x33d074=this['channel'][_0x7d59('0x5f')]('VOICEMAIL',[_0x4208d4['mailbox'],_0x4208d4['options']]);if(_0x33d074[_0x7d59('0xa8')]===-0x1){return _0x33d074;}return this[_0x7d59('0x3d')]['noop'](util[_0x7d59('0x5c')](_0x7d59('0xcb'),_0x7d59('0x1d0'),_0x4208d4['mailbox']));};AGIVertices[_0x7d59('0x15')][_0x7d59('0x1d1')]=function(_0x90d468){logger['info'](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x90d468['label']));if(!this[_0x7d59('0x89')](_0x90d468[_0x7d59('0x16c')])){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x90d468,_0x7d59('0x1b1'));}var _0x33a292=this['getVariable']['sync'](this,_0x90d468[_0x7d59('0x16c')]);if(!_0x33a292){return this[_0x7d59('0x3d')][_0x7d59('0x31')](_0x90d468,_0x7d59('0xdf'));}var _0x1514d7=this[_0x7d59('0x3d')]['getVariable'](_0x33a292);return{'code':0xc8,'result':_0x1514d7[_0x7d59('0xa6')]?_0x1514d7[_0x7d59('0xa6')]:'-'};};String[_0x7d59('0x15')][_0x7d59('0x1d2')]=function(_0x41cc5e,_0xfd15b9){return this[_0x7d59('0xa4')](_0x41cc5e)[_0x7d59('0x1d3')](_0xfd15b9);};module[_0x7d59('0x1d4')]=AGIVertices; \ No newline at end of file +var _0x2e54=['getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','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','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','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(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','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','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','catch','prototype','getVoiceQueue','getVoiceQueueById','name','getSquareProject','dsn','getUser','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','uniqueid','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','rawHeaders','parse','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','createSquareDetailsReport','retry','mrcpsynth','label','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','noop','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','minutes','callback_priority','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','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_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','out','dialogflow','Dialogflow\x20Result\x20%s','speech','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','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\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id'];(function(_0x153e27,_0x3c1a56){var _0x3ae476=function(_0x3a935c){while(--_0x3a935c){_0x153e27['push'](_0x153e27['shift']());}};_0x3ae476(++_0x3c1a56);}(_0x2e54,0xc1));var _0x42e5=function(_0x453a36,_0x11cd93){_0x453a36=_0x453a36-0x0;var _0x2f38c6=_0x2e54[_0x453a36];return _0x2f38c6;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x42e5('0x0'));var sh=require(_0x42e5('0x1'));var odbc=require(_0x42e5('0x2'))();var rs=require(_0x42e5('0x3'));var moment=require(_0x42e5('0x4'));var Mustache=require('mustache');var rp=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require(_0x42e5('0x8'));var scripts=require(_0x42e5('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x42e5('0xa')];var verticesWithRetry=[_0x42e5('0xb'),'getdigits',_0x42e5('0xc')];var AGIVertices=function(_0x3c26cd,_0x2dfd61,_0x5f0fca){this[_0x42e5('0xd')]=_0x3c26cd;this[_0x42e5('0xe')]=_0x2dfd61;this[_0x42e5('0xf')]=_0x5f0fca;};AGIVertices['prototype'][_0x42e5('0x10')]=function(_0x4e6c0f,_0x1cfc8e){this[_0x42e5('0xe')][_0x42e5('0x11')](_0x4e6c0f)[_0x42e5('0x12')](function(_0x12d4af){_0x1cfc8e(null,_0x12d4af?_0x12d4af['name']:![]);})[_0x42e5('0x13')](function(_0x244bc4){_0x1cfc8e(_0x244bc4);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x15')]=function(_0x472d0f,_0x3090aa){this[_0x42e5('0xe')][_0x42e5('0x16')](_0x472d0f)[_0x42e5('0x12')](function(_0x151173){_0x3090aa(null,_0x151173?_0x151173[_0x42e5('0x17')]:![]);})['catch'](function(_0x51dcf3){_0x3090aa(_0x51dcf3);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x18')]=function(_0x2d55c9,_0x15e8cb){this[_0x42e5('0xe')]['getSquareProjectById'](_0x2d55c9)[_0x42e5('0x12')](function(_0x143733){_0x15e8cb(null,_0x143733?_0x143733[_0x42e5('0x17')]:![]);})['catch'](function(_0x19fdf1){_0x15e8cb(_0x19fdf1);});};AGIVertices[_0x42e5('0x14')]['getSquareOdbc']=function(_0x435dfd,_0x497323){this['rpc']['getSquareOdbcById'](_0x435dfd)[_0x42e5('0x12')](function(_0x2e8502){_0x497323(null,_0x2e8502?_0x2e8502[_0x42e5('0x19')]:![]);})['catch'](function(_0xdf97f0){_0x497323(_0xdf97f0);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1a')]=function(_0x1a79e6,_0x1fc835){this['rpc']['getUserById'](_0x1a79e6)[_0x42e5('0x12')](function(_0x17b5d3){_0x1fc835(null,_0x17b5d3?_0x17b5d3['name']:![]);})[_0x42e5('0x13')](function(_0x11d530){_0x1fc835(_0x11d530);});};AGIVertices['prototype'][_0x42e5('0x1b')]=function(_0x56cf89,_0x572b17){this[_0x42e5('0xe')]['getTrunkById'](_0x56cf89)[_0x42e5('0x12')](function(_0x96e6d0){_0x572b17(null,_0x96e6d0?_0x96e6d0['name']:![]);})[_0x42e5('0x13')](function(_0x1b4c83){_0x572b17(_0x1b4c83);});};AGIVertices['prototype'][_0x42e5('0x1c')]=function(_0x10f309,_0x169772){var _0x4622a7=this;this[_0x42e5('0xe')][_0x42e5('0x1d')](_0x10f309)['then'](function(_0xf173ca){_0x169772(null,_0xf173ca?_0x4622a7[_0x42e5('0x1e')](_0xf173ca[_0x42e5('0x1f')]):![]);})[_0x42e5('0x13')](function(_0x178c03){_0x169772(_0x178c03);});};AGIVertices['prototype']['getMailAccount']=function(_0x333e6a,_0x520507){this[_0x42e5('0xe')][_0x42e5('0x20')](_0x333e6a)[_0x42e5('0x12')](function(_0x37cb43){_0x520507(null,_0x37cb43?_0x37cb43:![]);})['catch'](function(_0x176e91){_0x520507(_0x176e91);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x21')]=function(_0x52c4c6,_0x195e40,_0x3a1901){this[_0x42e5('0xf')][_0x42e5('0x21')](_0x52c4c6,_0x195e40)['then'](function(){_0x3a1901(null);})[_0x42e5('0x13')](function(_0xc8999e){_0x3a1901(_0xc8999e);});};AGIVertices[_0x42e5('0x14')]['getIntervals']=function(_0x34e613,_0x1640b9){this['rpc'][_0x42e5('0x22')](_0x34e613)[_0x42e5('0x12')](function(_0x1e9f46){if(_0x1e9f46){if(_0x1e9f46[_0x42e5('0x23')]){_0x1640b9(null,[_0x1e9f46[_0x42e5('0x24')]]);}else{_0x1640b9(null,_['map'](_0x1e9f46['Intervals'],_0x42e5('0x24')));}}else{_0x1640b9(null,![]);}})['catch'](function(_0x1a0c52){_0x1640b9(_0x1a0c52);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1e')]=function(_0x133662){return util[_0x42e5('0x25')](_0x42e5('0x26'),FILES_PATH,_0x133662);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x27')]=function(_0x54781d,_0x3817f2,_0x43afaf){odbc[_0x42e5('0x28')](_0x54781d,function(_0x5372d2){if(_0x5372d2){logger['error'](_0x42e5('0x29'),_0x5372d2);_0x43afaf(_0x5372d2);}else{logger[_0x42e5('0x2a')](_0x42e5('0x2b'));odbc[_0x42e5('0x2c')](_0x3817f2,function(_0x2f6d34,_0x25c222){if(_0x2f6d34){logger['info'](_0x42e5('0x2d'),_0x3817f2);_0x43afaf(_0x2f6d34);}else{logger['info'](_0x42e5('0x2e'),_0x3817f2);odbc[_0x42e5('0x2f')](function(_0x2d5434){if(_0x2d5434){logger[_0x42e5('0x30')](_0x42e5('0x31'),_0x2d5434);}_0x43afaf(null,_0x25c222);});}});}});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x32')]=function(_0x3e9245,_0x12296a){this[_0x42e5('0xe')][_0x42e5('0x33')](_0x3e9245)['then'](function(_0x370c4d){_0x12296a(null,_0x370c4d?_0x370c4d:![]);})[_0x42e5('0x13')](function(_0x57c86d){_0x12296a(_0x57c86d);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x34')]=function(_0x366e43,_0x3688cf){this[_0x42e5('0xe')]['createSmsMessage'](_0x366e43)[_0x42e5('0x12')](function(_0x3acbc6){_0x3688cf(null,_0x3acbc6);})[_0x42e5('0x13')](function(_0x5290a1){_0x3688cf(_0x5290a1);});};AGIVertices[_0x42e5('0x14')]['createSquareDetailsReport']=function(_0x301abe,_0x383d3c,_0x46beb9){this[_0x42e5('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x42e5('0xd')][_0x42e5('0x35')],'node':_0x301abe['label'],'application':_0x301abe[_0x42e5('0x36')],'data':_0x383d3c||null,'project_name':this[_0x42e5('0xd')]['arg_1'],'callerid':this['channel'][_0x42e5('0x37')]})[_0x42e5('0x12')](function(_0xcbc14e){if(_0x46beb9){_0x46beb9(null,_0xcbc14e);}})[_0x42e5('0x13')](function(_0x5341bc){if(_0x46beb9){_0x46beb9(_0x5341bc);}});};AGIVertices['prototype'][_0x42e5('0x38')]=function(_0x294f96,_0x2d3aa7,_0x45c9e2,_0x7a1cda){this['rpc'][_0x42e5('0x38')]({'uniqueid':this[_0x42e5('0xd')][_0x42e5('0x35')],'callerid':this['channel']['callerid'],'calleridname':this[_0x42e5('0xd')]['calleridname'],'context':this['channel'][_0x42e5('0x39')],'extension':this[_0x42e5('0xd')][_0x42e5('0x3a')],'priority':this[_0x42e5('0xd')][_0x42e5('0x3b')],'accountcode':this[_0x42e5('0xd')][_0x42e5('0x3c')],'dnid':this[_0x42e5('0xd')][_0x42e5('0x3d')],'projectName':this[_0x42e5('0xd')]['arg_1'],'saveName':_0x2d3aa7,'filename':_0x294f96['file']||_0x2d3aa7,'savePath':_0x45c9e2})[_0x42e5('0x12')](function(_0x3aca42){_0x7a1cda(null,_0x3aca42);})[_0x42e5('0x13')](function(_0x56625e){_0x7a1cda(_0x56625e);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x3e')]=function(_0x586a80,_0x2a1366,_0x369fc6,_0x5915ca,_0x483d6b){this[_0x42e5('0xe')][_0x42e5('0x3e')]({'uniqueid':this[_0x42e5('0xd')]['uniqueid'],'body':_0x586a80,'direction':_0x2a1366,'providerName':_0x369fc6,'providerResponse':_0x5915ca})[_0x42e5('0x12')](function(_0x46d2a6){if(_0x483d6b){_0x483d6b(null,_0x46d2a6);}})[_0x42e5('0x13')](function(_0x4ebbcb){if(_0x483d6b){_0x483d6b(_0x4ebbcb);}});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x3f')]=function(_0x1345c8,_0x3994de){this[_0x42e5('0xe')][_0x42e5('0x3f')]({'firstName':_['isEmpty'](_0x1345c8[_0x42e5('0x17')])||_[_0x42e5('0x40')](_0x1345c8['name'])?'callback_'+Math['random']():_0x1345c8[_0x42e5('0x17')],'lastName':_[_0x42e5('0x41')](_0x1345c8[_0x42e5('0x42')])||_[_0x42e5('0x40')](_0x1345c8[_0x42e5('0x42')])?null:_0x1345c8[_0x42e5('0x42')],'phone':_0x1345c8[_0x42e5('0x43')],'ListId':_0x1345c8[_0x42e5('0x44')],'scheduledat':_0x1345c8[_0x42e5('0x45')],'callbackUniqueid':this[_0x42e5('0xd')]['uniqueid'],'tags':'callback','description':_0x42e5('0x46')+_0x1345c8['scheduledAt'][_0x42e5('0x47')](),'priority':_0x1345c8['callback_priority']})[_0x42e5('0x12')](function(_0x51e305){_0x3994de(null,_0x51e305);})['catch'](function(_0x24d108){_0x3994de(_0x24d108);});};AGIVertices['prototype']['getPause']=function(_0x5c3de8,_0x4d8925){this['rpc'][_0x42e5('0x48')](_0x5c3de8)['then'](function(_0x1fa946){_0x4d8925(null,_0x1fa946?_0x1fa946['name']:![]);})[_0x42e5('0x13')](function(_0x15c2b7){_0x4d8925(_0x15c2b7);});};AGIVertices['prototype'][_0x42e5('0x49')]=function(_0x38f70b,_0x5670cc,_0x920ce9){var _0x51ab39={'role':_0x42e5('0x4a')};_0x51ab39[_0x38f70b]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')][_0x42e5('0x49')](_0x51ab39,_0x5670cc,this[_0x42e5('0xd')][_0x42e5('0x35')])[_0x42e5('0x12')](function(_0x362827){_0x920ce9(null,_[_0x42e5('0x40')](_0x362827)?![]:!![]);})[_0x42e5('0x13')](function(_0x340b54){logger[_0x42e5('0x30')](_0x340b54);_0x920ce9(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x4b')]=function(_0x5ecc28,_0x2acfa3){var _0x58284b={'role':_0x42e5('0x4a')};_0x58284b[_0x5ecc28]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')][_0x42e5('0x4b')](_0x58284b)[_0x42e5('0x12')](function(_0x38254f){_0x2acfa3(null,_[_0x42e5('0x40')](_0x38254f)?![]:!![]);})['catch'](function(_0x3fcd7e){logger['error'](_0x3fcd7e);_0x2acfa3(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x4c')]=function(_0x1d4d6e,_0x206d44){var _0x5c8952={'role':_0x42e5('0x4a')};_0x5c8952[_0x1d4d6e]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')]['agentLogout'](_0x5c8952)[_0x42e5('0x12')](function(_0x41ef45){_0x206d44(null,_['isNil'](_0x41ef45)?![]:!![]);})[_0x42e5('0x13')](function(_0x4ce505){logger['error'](_0x4ce505);_0x206d44(null,![]);});};AGIVertices['prototype'][_0x42e5('0x4d')]=function(_0x41cac2,_0x3ebe7d){var _0x4f8cfd={'role':_0x42e5('0x4a')};_0x4f8cfd[_0x41cac2]=this['channel']['callerid'];var _0x405838=_0x41cac2!=_0x42e5('0x4e')?util[_0x42e5('0x25')](_0x42e5('0x4f'),_0x42e5('0x50'),this[_0x42e5('0xd')]['callerid']):undefined;this[_0x42e5('0xe')][_0x42e5('0x4d')](_0x4f8cfd,_0x405838)[_0x42e5('0x12')](function(_0x332337){_0x3ebe7d(null,_['isNil'](_0x332337)?![]:!![]);})[_0x42e5('0x13')](function(_0x22c541){logger['error'](_0x22c541);_0x3ebe7d(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x51')]=function(_0x444ad8,_0x587e90){sh[_0x42e5('0x52')](_['trim'](_0x444ad8),function(_0x420171,_0x3f76e6){var _0x51a14a=_0x3f76e6[_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'');_0x587e90(null,_0x51a14a);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x54')]=function(_0x46e502,_0x5522af){scripts['googleCloudTTS'](_0x46e502['apiKey'],_0x46e502['google_cloud_tts_text_type']||_0x42e5('0x55'),_0x46e502[_0x42e5('0x55')],_0x46e502[_0x42e5('0x56')]||_0x42e5('0x57'),_0x46e502[_0x42e5('0x58')]||_0x42e5('0x59'),_0x46e502[_0x42e5('0x5a')]||'MP3')[_0x42e5('0x12')](function(_0x1b91ef){_0x5522af(null,_0x1b91ef);})[_0x42e5('0x13')](function(_0xeac110){_0x5522af(_0xeac110);});};AGIVertices[_0x42e5('0x14')]['googleTTS']=function(_0xb7e265,_0x390d45){scripts[_0x42e5('0x5b')](_0xb7e265[_0x42e5('0x55')],_0xb7e265[_0x42e5('0x5c')]||'en',0x1)['then'](function(_0x568bd6){_0x390d45(null,_0x568bd6);})['catch'](function(_0x9bc545){_0x390d45(_0x9bc545);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x5d')]=function(_0x33dc18,_0x2ab943){var _0x2f7c45={'uri':_0x33dc18[_0x42e5('0x5e')],'method':_0x33dc18[_0x42e5('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x33dc18[_0x42e5('0x60')])===_0x42e5('0x61')&&parseInt(_0x33dc18[_0x42e5('0x60')])>=0x1?parseInt(_0x33dc18[_0x42e5('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x42e5('0x62')]([_0x42e5('0x63'),_0x42e5('0x64')],_0x2f7c45['method'][_0x42e5('0x65')]())){try{_0x2f7c45[_0x42e5('0x66')]=_0x33dc18['rawBody']?JSON['parse'](_0x33dc18[_0x42e5('0xa')]):{};}catch(_0x33032e){logger[_0x42e5('0x30')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x33032e);}}try{_0x2f7c45[_0x42e5('0x67')]=_0x33dc18[_0x42e5('0x68')]?JSON[_0x42e5('0x69')](_0x33dc18['rawHeaders']):{};}catch(_0x2d1107){logger[_0x42e5('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2d1107);}if(_0x33dc18[_0x42e5('0x6a')]){try{var _0x5b6ad1=require(_0x33dc18[_0x42e5('0x6a')])[_0x42e5('0x6b')](this,_0x2f7c45);_0x2f7c45['uri']=Mustache[_0x42e5('0x6c')](_0x33dc18[_0x42e5('0x5e')],_0x5b6ad1,{},['$$','$$']);if(_0x2f7c45[_0x42e5('0x67')]){_0x2f7c45[_0x42e5('0x67')]=JSON[_0x42e5('0x69')](Mustache['render'](JSON[_0x42e5('0x6d')](_0x2f7c45[_0x42e5('0x67')]),_0x5b6ad1,{},['$$','$$']));}if(_0x2f7c45[_0x42e5('0x66')]){_0x2f7c45[_0x42e5('0x66')]=JSON[_0x42e5('0x69')](Mustache[_0x42e5('0x6c')](JSON[_0x42e5('0x6d')](_0x2f7c45[_0x42e5('0x66')]),_0x5b6ad1,{},['$$','$$']));}}catch(_0x1436d2){logger['error'](_0x42e5('0x6e'),_0x1436d2);}}rp(_0x2f7c45)[_0x42e5('0x12')](function(_0xa00cbe){var _0x2eb14a={'statusCode':_0xa00cbe[_0x42e5('0x6f')]||0xc8,'statusMessage':_0xa00cbe['statusMessage']||'OK','headers':_0xa00cbe[_0x42e5('0x67')]||{},'body':_0xa00cbe[_0x42e5('0x66')]||{}};_0x2ab943(null,_0x2eb14a);})[_0x42e5('0x13')](function(_0x49e655){var _0xf3f3ac={'statusCode':_0x49e655['statusCode']||0x1f4,'statusMessage':_0x49e655['message']||_0x42e5('0x70'),'headers':_0x49e655[_0x42e5('0x71')][_0x42e5('0x67')]||{},'body':_0x49e655[_0x42e5('0x71')][_0x42e5('0x66')]||{}};_0x2ab943(null,_0xf3f3ac);});};AGIVertices['prototype']['googleDialogflow']=function(_0xdfb887,_0x53e085){scripts[_0x42e5('0x72')](this[_0x42e5('0xd')][_0x42e5('0x35')],_0xdfb887[_0x42e5('0x73')],_0xdfb887[_0x42e5('0x55')],_0xdfb887[_0x42e5('0x74')]||'en')[_0x42e5('0x12')](function(_0x1095b2){_0x53e085(null,_0x1095b2);})[_0x42e5('0x13')](function(_0x2c991c){_0x53e085(_0x2c991c);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x75')]=function(_0x4ab176,_0x2bef76){scripts[_0x42e5('0x75')](this[_0x42e5('0xd')]['uniqueid'],_0x4ab176[_0x42e5('0x76')],_0x4ab176['client_email'],_0x4ab176['private_key'],_0x4ab176[_0x42e5('0x55')],_0x4ab176[_0x42e5('0x77')]||'en')[_0x42e5('0x12')](function(_0x5b1d30){_0x2bef76(null,_0x5b1d30);})[_0x42e5('0x13')](function(_0x3771c6){_0x2bef76(_0x3771c6);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x78')]=function(_0x2cd5b1,_0x591e85){scripts[_0x42e5('0x78')](this[_0x42e5('0xd')],_0x2cd5b1)[_0x42e5('0x12')](function(_0x311c19){_0x591e85(null,_0x311c19);})[_0x42e5('0x13')](function(_0x52c1d3){_0x591e85(_0x52c1d3);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x79')]=function(_0x488d44,_0x1e3245){scripts[_0x42e5('0x79')](_0x488d44[_0x42e5('0x73')],_0x488d44[_0x42e5('0x55')],_0x488d44['ispeech_tts_language']||_0x42e5('0x57'),_0x488d44[_0x42e5('0x7a')])[_0x42e5('0x12')](function(_0x3e3a6e){_0x1e3245(null,_0x3e3a6e);})[_0x42e5('0x13')](function(_0x42caf8){_0x1e3245(_0x42caf8);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x7b')]=function(_0x1d25b5,_0x50df63,_0x3aea01){scripts[_0x42e5('0x7b')](_0x50df63,_0x1d25b5['key'],_0x1d25b5[_0x42e5('0x7c')]||_0x42e5('0x57'),this[_0x42e5('0x7d')](_0x1d25b5[_0x42e5('0x7e')])?_0x1d25b5['model']:undefined)[_0x42e5('0x12')](function(_0x535e9c){_0x3aea01(null,_0x535e9c);})[_0x42e5('0x13')](function(_0x1dd0e8){_0x3aea01(_0x1dd0e8);});};AGIVertices['prototype'][_0x42e5('0x7f')]=function(_0x1be3d5,_0x231dd1){scripts['awsPolly'](_0x1be3d5[_0x42e5('0x80')],_0x1be3d5[_0x42e5('0x81')],_0x1be3d5['aws_polly_region'],_0x1be3d5[_0x42e5('0x82')]||_0x42e5('0x83'),_0x1be3d5[_0x42e5('0x55')],_0x1be3d5[_0x42e5('0x84')]||_0x42e5('0x55'))[_0x42e5('0x12')](function(_0x154f88){_0x231dd1(null,_0x154f88);})[_0x42e5('0x13')](function(_0x1676a0){_0x231dd1(_0x1676a0);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x85')]=function(_0x6c313c,_0x16ccd1){scripts[_0x42e5('0x85')](this[_0x42e5('0xd')][_0x42e5('0x35')],_0x6c313c[_0x42e5('0x80')],_0x6c313c[_0x42e5('0x81')],_0x6c313c[_0x42e5('0x86')],_0x6c313c['text'],_0x6c313c[_0x42e5('0x87')])[_0x42e5('0x12')](function(_0x492902){_0x16ccd1(null,_0x492902);})[_0x42e5('0x13')](function(_0x54a06c){_0x16ccd1(_0x54a06c);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x88')]=function(_0x2e98f4,_0x46cc1d,_0x9bacce){scripts[_0x42e5('0x88')](_0x46cc1d,_0x2e98f4[_0x42e5('0x73')],_0x2e98f4[_0x42e5('0x89')]||_0x42e5('0x57'))[_0x42e5('0x12')](function(_0x324bfa){_0x9bacce(null,_0x324bfa);})['catch'](function(_0x503d69){_0x9bacce(_0x503d69);});};AGIVertices['prototype'][_0x42e5('0x8a')]=function(_0x322275,_0x4d3d87,_0xf6b77f){scripts[_0x42e5('0x8a')](_0x4d3d87,_0x322275[_0x42e5('0x8b')],_0x322275['appsecret'],_0x322275['uri'])[_0x42e5('0x12')](function(_0xc30912){_0xf6b77f(null,_0xc30912);})[_0x42e5('0x13')](function(_0xea7807){_0xf6b77f(_0xea7807);});};AGIVertices['prototype']['clear']=function(_0x1ca3f2){var _0x27fad6=_['includes'](verticesWithRetry,_0x1ca3f2['agicommand'])?_0x1ca3f2:_['clone'](_0x1ca3f2);for(var _0x73ad1 in _0x27fad6){if(_0x27fad6[_0x42e5('0x8c')](_0x73ad1)){if(_0x27fad6[_0x73ad1]&&_[_0x42e5('0x8d')](_0x27fad6[_0x73ad1])){if(_[_0x42e5('0x62')](recursiveMapAttributes,_0x73ad1)){_0x27fad6[_0x73ad1]=this['replaceObjectAllVariables'](_0x27fad6[_0x73ad1]);}else{_0x27fad6[_0x73ad1]=this[_0x42e5('0x8e')](_0x27fad6[_0x73ad1]);}}}}return _0x27fad6;};AGIVertices['prototype'][_0x42e5('0x8f')]=function(_0x27c67d){for(var _0x3d1ba1 in _0x27c67d){if(_0x27c67d['hasOwnProperty'](_0x3d1ba1)){if(_[_0x42e5('0x90')](_0x27c67d[_0x3d1ba1])){this['recursiveNodeIndex'](_0x27c67d[_0x3d1ba1]);}else if(_['isArray'](_0x27c67d[_0x3d1ba1])){for(var _0x146d6c=0x0;_0x146d6c<_0x27c67d[_0x3d1ba1][_0x42e5('0x91')];_0x146d6c++){this['recursiveNodeIndex'](_0x27c67d[_0x3d1ba1][_0x146d6c]);}}else if(_[_0x42e5('0x8d')](_0x27c67d[_0x3d1ba1])){_0x27c67d[_0x3d1ba1]=this[_0x42e5('0x8e')](_0x27c67d[_0x3d1ba1]);}}}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x92')]=function(_0x33ccec,_0x28493e){for(var _0x34c86d in _0x33ccec){if(_0x33ccec[_0x42e5('0x8c')](_0x34c86d)){if(_[_0x42e5('0x90')](_0x33ccec[_0x34c86d])){if(!_[_0x42e5('0x41')](_0x33ccec[_0x34c86d])){this[_0x42e5('0x92')](_0x33ccec[_0x34c86d],util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d));}}else if(_['isArray'](_0x33ccec[_0x34c86d])){for(var _0x469b3e=0x0;_0x469b3e<_0x33ccec[_0x34c86d][_0x42e5('0x91')];_0x469b3e++){this['saveRestApiResult'](_0x33ccec[_0x34c86d][_0x469b3e],util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d+'['+_0x469b3e+']'));}}else{if(!_[_0x42e5('0x40')](_0x33ccec[_0x34c86d])){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d),_0x33ccec[_0x34c86d]);}}}}};AGIVertices[_0x42e5('0x14')]['replaceObjectAllVariables']=function(_0x208593){try{var _0x2df60f=JSON[_0x42e5('0x69')](_0x208593);this[_0x42e5('0x8f')](_0x2df60f);return JSON[_0x42e5('0x6d')](_0x2df60f);}catch(_0x4cd088){return this['replaceAllVariables'](_0x208593);}};AGIVertices['prototype'][_0x42e5('0x8e')]=function(_0x2e8c3e){var _0x4c4c0b=_0x2e8c3e[_0x42e5('0x95')]('{');for(var _0x4e22ca=0x1;_0x4e22ca<_0x4c4c0b[_0x42e5('0x91')];_0x4e22ca+=0x1){var _0x1e93bc=_0x4c4c0b[_0x4e22ca][_0x42e5('0x95')]('}');if(_0x1e93bc['length']>0x1){_0x2e8c3e=_0x2e8c3e[_0x42e5('0x96')]('{'+_0x1e93bc[0x0]+'}',this[_0x42e5('0xd')][_0x42e5('0x10')](_0x1e93bc[0x0])['extra']||_0x1e93bc[0x0]);}}if(_0x4c4c0b[_0x42e5('0x91')]===0x1){return _0x2e8c3e[_0x42e5('0x47')]();}return this[_0x42e5('0x8e')](_0x2e8c3e);};AGIVertices['prototype']['getAndSetVariable']=function(_0x4e5e65,_0x238b43){var _0x169900=this[_0x42e5('0xd')][_0x42e5('0x10')](_0x4e5e65);if(_0x169900['result']===-0x1){return _0x169900;}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x97'),_0x238b43,_0x169900[_0x42e5('0x98')]));return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x238b43,_0x169900[_0x42e5('0x98')]);};AGIVertices[_0x42e5('0x14')]['isConfigured']=function(_0x5c4b69){return _0x5c4b69&&_0x5c4b69!=='0'&&_0x5c4b69!=='-1'&&_0x5c4b69!=='';};AGIVertices['prototype'][_0x42e5('0x99')]=function(_0x3976e7){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x3976e7,'-');_0x3976e7[_0x42e5('0x9b')]=_0x3976e7[_0x42e5('0x99')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x42e5('0x14')][_0x42e5('0x9c')]=function(_0x1fb455){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x1fb455[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1fb455['text'])){return this[_0x42e5('0xd')]['noop']('no\x20text\x20configured');}var _0x29fd5b='\x22'+_0x1fb455[_0x42e5('0x55')]+'\x22';if(this[_0x42e5('0x7d')](_0x1fb455[_0x42e5('0x71')])){_0x29fd5b+=','+_0x1fb455[_0x42e5('0x71')];}var _0x2c4ccd=this[_0x42e5('0xd')]['exec'](_0x42e5('0x9e'),_0x29fd5b);if(_0x2c4ccd[_0x42e5('0x9f')]===-0x1){return _0x2c4ccd;}return this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0xa0'),_0x29fd5b));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xa1')]=function(_0xd0edc2){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xd0edc2[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xd0edc2[_0x42e5('0xa2')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x2372f5=_0xd0edc2[_0x42e5('0xa2')];if(this[_0x42e5('0x7d')](_0xd0edc2[_0x42e5('0x71')])){_0x2372f5+=','+_0xd0edc2[_0x42e5('0x71')];}var _0x6eb226=this[_0x42e5('0xd')][_0x42e5('0x52')]('MRCPRecog',_0x2372f5);if(_0x6eb226[_0x42e5('0x9f')]===-0x1){return _0x6eb226;}var _0x2516a1=this[_0x42e5('0xa5')](_0x42e5('0xa6'),'MRCP_RECOG_CONFIDENCE');if(_0x2516a1[_0x42e5('0x9f')]===-0x1){return _0x2516a1;}var _0x4ad0a1=this[_0x42e5('0xa5')](_0x42e5('0xa7'),_0x42e5('0xa8'));if(_0x4ad0a1[_0x42e5('0x9f')]===-0x1){return _0x4ad0a1;}var _0x2bf154=this[_0x42e5('0xa5')](_0x42e5('0xa9'),_0x42e5('0xaa'));if(_0x2bf154['result']===-0x1){return _0x2bf154;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0xab'),_0x2372f5));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x7')]=function(_0x166f57){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xac'),_0x166f57[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x7')]([_0x166f57[_0x42e5('0xad')],_0x166f57[_0x42e5('0xae')]]);};AGIVertices['prototype'][_0x42e5('0xaf')]=function(_0x263103){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xb0'),_0x263103[_0x42e5('0x9d')]));if(this[_0x42e5('0x7d')](_0x263103[_0x42e5('0x60')])){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xb1'),_0x263103[_0x42e5('0x60')]));var _0x1451a8=this[_0x42e5('0xd')][_0x42e5('0xb2')](_0x263103[_0x42e5('0x60')]);if(_0x1451a8[_0x42e5('0x9f')]===-0x1){return _0x1451a8;}}return this[_0x42e5('0xd')][_0x42e5('0xaf')]();};AGIVertices[_0x42e5('0x14')][_0x42e5('0xb3')]=function(_0x5b6f15){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5b6f15[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x5b6f15[_0x42e5('0x44')])){return this[_0x42e5('0xd')]['error'](_0x5b6f15,_0x42e5('0xb4'));}_0x5b6f15[_0x42e5('0x45')]=moment();if(this['isConfigured'](_0x5b6f15[_0x42e5('0xb5')])){_0x5b6f15[_0x42e5('0x45')]=moment()['add'](_0x5b6f15['delay'],_0x42e5('0xb6'));}if(!this[_0x42e5('0x7d')](_0x5b6f15[_0x42e5('0xb7')])){_0x5b6f15[_0x42e5('0xb7')]=0x2;}this[_0x42e5('0x3f')]['sync'](this,_0x5b6f15);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5b6f15['phone'],_0x5b6f15['list_id'],_0x5b6f15[_0x42e5('0x45')]));};AGIVertices['prototype'][_0x42e5('0xb8')]=function(_0x4f417b){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xb9'),_0x4f417b['label']));var _0x5b7244=this['channel'][_0x42e5('0x52')](_0x4f417b[_0x42e5('0xba')],_0x4f417b[_0x42e5('0x71')]);if(_0x5b7244[_0x42e5('0x9f')]===-0x1){return _0x5b7244;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Executed\x20command\x20%s\x20%s',_0x4f417b[_0x42e5('0xba')],_0x4f417b[_0x42e5('0x71')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xbb')]=function(_0x2bd3fc){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xbc'),_0x2bd3fc[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2bd3fc[_0x42e5('0x55')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0xbd'));}var _0x29fd40='\x22'+_0x2bd3fc['text']+'\x22';if(this[_0x42e5('0x7d')](_0x2bd3fc['options'])){_0x29fd40+=','+_0x2bd3fc[_0x42e5('0x71')];}var _0x372dc8=this[_0x42e5('0xd')]['exec'](_0x42e5('0x9e'),_0x29fd40);if(_0x372dc8['result']===-0x1){return _0x372dc8;}return this[_0x42e5('0xd')]['noop'](util['format'](_0x42e5('0xa0'),_0x29fd40));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xbe')]=function(_0x36c1fd){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xbf'),_0x36c1fd[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x36c1fd[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}var _0x55db8d='\x22'+_0x36c1fd['text']+'\x22';if(this[_0x42e5('0x7d')](_0x36c1fd[_0x42e5('0x71')])){_0x55db8d+=','+_0x36c1fd[_0x42e5('0x71')];}var _0x1a2afd=this['channel'][_0x42e5('0x52')]('MRCPSynth',_0x55db8d);if(_0x1a2afd[_0x42e5('0x9f')]===-0x1){return _0x1a2afd;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x55db8d));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xc0')]=function(_0x344871){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xc1'),_0x344871[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x344871[_0x42e5('0xa2')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x1ae1c9=_0x344871['grammar'];if(this[_0x42e5('0x7d')](_0x344871[_0x42e5('0x71')])){_0x1ae1c9+=','+_0x344871[_0x42e5('0x71')];}var _0x4785c6=this[_0x42e5('0xd')]['exec'](_0x42e5('0xc2'),_0x1ae1c9);if(_0x4785c6[_0x42e5('0x9f')]===-0x1){return _0x4785c6;}var _0x417b25=this['getAndSetVariable'](_0x42e5('0xa6'),_0x42e5('0xc3'));if(_0x417b25[_0x42e5('0x9f')]===-0x1){return _0x417b25;}var _0x3e4664=this['getAndSetVariable'](_0x42e5('0xa7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e4664['result']===-0x1){return _0x3e4664;}var _0x20b126=this['getAndSetVariable'](_0x42e5('0xa9'),_0x42e5('0xc4'));if(_0x20b126[_0x42e5('0x9f')]===-0x1){return _0x20b126;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xab'),_0x1ae1c9));};AGIVertices['prototype'][_0x42e5('0xc5')]=function(_0xe8f030){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xc6'),_0xe8f030[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xe8f030[_0x42e5('0xa2')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x43295d=_0xe8f030[_0x42e5('0xa2')];if(this[_0x42e5('0x7d')](_0xe8f030['options'])){_0x43295d+=','+_0xe8f030['options'];}var _0x1b66cf=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0xc2'),_0x43295d);if(_0x1b66cf['result']===-0x1){return _0x1b66cf;}var _0x4406ff=this[_0x42e5('0xa5')](_0x42e5('0xa6'),'SESTEK_ASR_CONFIDENCE');if(_0x4406ff[_0x42e5('0x9f')]===-0x1){return _0x4406ff;}var _0x57706e=this[_0x42e5('0xa5')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x57706e['result']===-0x1){return _0x57706e;}var _0x3fdfb8=this[_0x42e5('0xa5')]('RECOG_INSTANCE()',_0x42e5('0xc7'));if(_0x3fdfb8[_0x42e5('0x9f')]===-0x1){return _0x3fdfb8;}return this['channel'][_0x42e5('0xa3')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x43295d));};AGIVertices['prototype'][_0x42e5('0xc8')]=function(_0x5b7c48){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xc9'),_0x5b7c48['label']));if(!this['isConfigured'](_0x5b7c48['odbc_id'])){return this[_0x42e5('0xd')]['error'](_0x5b7c48,_0x42e5('0xca'));}var _0x2b81eb=this[_0x42e5('0xcb')][_0x42e5('0x6b')](this,_0x5b7c48[_0x42e5('0xcc')]);if(!_0x2b81eb){return this[_0x42e5('0xd')]['error'](_0x5b7c48,_0x42e5('0xcd'));}if(!this[_0x42e5('0x7d')](_0x5b7c48['query'])){return this['channel'][_0x42e5('0x30')](_0x5b7c48,_0x42e5('0xce'));}var _0x15ab89=_0x5b7c48[_0x42e5('0x2c')][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0xcf'),_0x15ab89));var _0x17e10c=this[_0x42e5('0x27')]['sync'](this,_0x2b81eb,_0x15ab89);this[_0x42e5('0x9a')]['sync'](this,_0x5b7c48,_0x15ab89);if(!this[_0x42e5('0x7d')](_0x5b7c48[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xd1'));}var _0x3a22b7=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x5b7c48[_0x42e5('0xd0')]);if(!_0x3a22b7){return this['channel'][_0x42e5('0x30')](_0x5b7c48,_0x42e5('0xd2'));}var _0x12b976=this;_0x17e10c[_0x42e5('0xd3')](function(_0x4b2cb8,_0x334989){Object[_0x42e5('0xd4')](_0x4b2cb8)['forEach'](function(_0x37b14f){_0x12b976[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s[%s][%s]',_0x3a22b7,_0x334989,_0x37b14f),_0x4b2cb8[_0x37b14f]);});});this[_0x42e5('0xd')]['setVariable'](util[_0x42e5('0x25')](_0x42e5('0xd5'),_0x3a22b7),_0x17e10c['length']);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xd6'),_0x3a22b7));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xd7')]=function(_0x487861){logger[_0x42e5('0xd8')](util[_0x42e5('0x25')](_0x42e5('0xd9'),_0x487861[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x487861[_0x42e5('0xda')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x487861,_0x42e5('0xdb'));}var _0x3b832f=this[_0x42e5('0x1a')][_0x42e5('0x6b')](this,_0x487861[_0x42e5('0xda')]);if(!_0x3b832f){return this['channel'][_0x42e5('0x30')](_0x487861,_0x42e5('0xdc'));}var _0x23d13a=this['channel']['exec'](_0x42e5('0xdd'),[util[_0x42e5('0x25')]('SIP/%s',_0x3b832f),_0x487861['timeout'],_0x487861[_0x42e5('0xde')],_0x487861[_0x42e5('0x5e')]]);if(_0x23d13a[_0x42e5('0x9f')]===-0x1){return _0x23d13a;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0xdf'),'DIAL'));};AGIVertices[_0x42e5('0x14')]['dialogflow']=function(_0x294019){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xe0'),_0x294019[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x294019['key'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x294019[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xe1')]=!![];this['createSquareDetailsReport'](_0x294019);this['createSquareMessage'](_0x294019[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Trying\x20Dialogflow:\x20%s',_0x294019['text']));var _0x1ed31e=this[_0x42e5('0x72')][_0x42e5('0x6b')](this,_0x294019);if(_0x1ed31e){for(var _0x4f28f7 in _0x1ed31e){if(_0x1ed31e['hasOwnProperty'](_0x4f28f7)){this['channel'][_0x42e5('0x94')](util[_0x42e5('0x25')]('DIALOGFLOW_%s',_0x4f28f7[_0x42e5('0x65')]()),_0x1ed31e[_0x4f28f7]);}}this[_0x42e5('0x3e')](_0x1ed31e['speech'],_0x42e5('0xe2'),_0x42e5('0xe3'),'');return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xe4'),_0x1ed31e[_0x42e5('0xe5')]));}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x294019,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x42e5('0x14')][_0x42e5('0xe6')]=function(_0x2e26e4){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xe7'),_0x2e26e4[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2e26e4['dialogflowV2_project_id'])){return this[_0x42e5('0xd')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0xe8')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0xe9'));}if(!this[_0x42e5('0x7d')](_0x2e26e4[_0x42e5('0xea')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0x77')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xeb'));}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this['channel'][_0x42e5('0xe1')]=!![];this[_0x42e5('0x9a')](_0x2e26e4);this[_0x42e5('0x3e')](_0x2e26e4[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xec'),_0x2e26e4['text']));var _0x5090b2=this[_0x42e5('0x75')][_0x42e5('0x6b')](this,_0x2e26e4);if(_0x5090b2){for(var _0x3e661b in _0x5090b2){if(_0x5090b2['hasOwnProperty'](_0x3e661b)){if(_0x3e661b!==_0x42e5('0xed')){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')]('DIALOGFLOW_%s',_0x3e661b[_0x42e5('0x65')]()),_0x5090b2[_0x3e661b]);}}}this[_0x42e5('0x3e')](_0x5090b2[_0x42e5('0xe5')],'out',_0x42e5('0xe6'),_0x5090b2[_0x42e5('0xed')]);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xee'),_0x5090b2[_0x42e5('0xe5')]));}return this[_0x42e5('0xd')]['error'](_0x2e26e4,_0x42e5('0xef'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xf0')]=function(_0x1fcc78){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xf1'),_0x1fcc78[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf2')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xf3'));}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf4')])){return this[_0x42e5('0xd')]['noop']('no\x20username\x20configured');}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf5')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xf6'));}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf7')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this['channel']['bot']=!![];this[_0x42e5('0x9a')](_0x1fcc78);this['createSquareMessage'](_0x1fcc78[_0x42e5('0x55')],'in','','');this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xf8'),_0x1fcc78[_0x42e5('0x55')]));var _0x8c27d5=this[_0x42e5('0x78')]['sync'](this,_0x1fcc78);if(_0x8c27d5){for(var _0x59fd8f in _0x8c27d5){if(_0x8c27d5[_0x42e5('0x8c')](_0x59fd8f)){this[_0x42e5('0xd')][_0x42e5('0x94')](util['format'](_0x42e5('0xf9'),_0x59fd8f[_0x42e5('0x65')]()),_0x8c27d5[_0x59fd8f]);}}this[_0x42e5('0x3e')](_0x8c27d5[_0x42e5('0xe5')],'out','sesteknda','');if(_0x8c27d5['audiofile']){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xfa'),_0x8c27d5[_0x42e5('0xfb')]));var _0x2fbe56=this[_0x42e5('0xd')][_0x42e5('0xfc')](_0x8c27d5[_0x42e5('0xfb')]);try{fs[_0x42e5('0xfd')](_0x8c27d5['audiofile']+_0x42e5('0xfe'));}catch(_0x49479d){logger['error'](_0x49479d);}return _0x2fbe56;}else{return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xff'),_0x8c27d5[_0x42e5('0xe5')]));}}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x1fcc78,_0x42e5('0x100'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x101')]=function(_0x46467f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x102'),_0x46467f[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x101'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x103')]=function(_0x3e144b){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x104'),_0x3e144b['label']));var _0x14310b='';if(_0x3e144b['trunk_id']){if(!this[_0x42e5('0x7d')](_0x3e144b[_0x42e5('0x105')])){return this[_0x42e5('0xd')]['error'](_0x3e144b,'no\x20trunk\x20selected');}else{var _0x49e379=parseInt(_0x3e144b[_0x42e5('0x105')],0xa);if(isNaN(_0x49e379)){_0x14310b=_0x3e144b[_0x42e5('0x105')];}else{_0x14310b=this[_0x42e5('0x1b')][_0x42e5('0x6b')](this,_0x3e144b[_0x42e5('0x105')]);if(!_0x14310b){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e144b,_0x42e5('0x106'));}}}}else if(_0x3e144b[_0x42e5('0x107')]){_0x14310b=_0x3e144b[_0x42e5('0x107')];}else{return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e144b,_0x42e5('0x108'));}var _0x163d3b=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0xdd'),[util[_0x42e5('0x25')]('SIP/%s/%s',_0x14310b,_0x3e144b[_0x42e5('0x43')]),_0x3e144b[_0x42e5('0x60')],_0x3e144b['opts'],_0x3e144b[_0x42e5('0x5e')]]);if(_0x163d3b['result']===-0x1){return _0x163d3b;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xdf'),_0x42e5('0xdd')));};AGIVertices['prototype'][_0x42e5('0x109')]=function(_0x105053){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x10a'),_0x105053[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x109'));};AGIVertices[_0x42e5('0x14')]['getdigits']=function(_0x4b6cbd){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4b6cbd['label']));if(_0x4b6cbd['retry']===0x0){return this['maxRetry'](_0x4b6cbd);}_0x4b6cbd[_0x42e5('0x9b')]-=0x1;if(!this[_0x42e5('0x7d')](_0x4b6cbd[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x4b6cbd,'no\x20file\x20audio\x20selected');}var _0x1da679=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x4b6cbd[_0x42e5('0x10b')]);if(!_0x1da679){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x4b6cbd,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4b6cbd['variable_id'])){return this[_0x42e5('0xd')]['error'](_0x42e5('0xd1'));}var _0x2f1ab6=this[_0x42e5('0xd')][_0x42e5('0x10c')](_0x1da679,_0x4b6cbd[_0x42e5('0x10d')],_0x4b6cbd[_0x42e5('0x10e')]);var _0x9a213e=_0x2f1ab6[_0x42e5('0x9f')]?_0x2f1ab6[_0x42e5('0x9f')]['toString']():'';logger['info'](_0x42e5('0x10f'),JSON['stringify'](_0x2f1ab6));if(_0x2f1ab6[_0x42e5('0x9f')]===-0x1){this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,_0x9a213e);return _0x2f1ab6;}else if(_0x2f1ab6[_0x42e5('0x98')]===_0x42e5('0x60')){_0x2f1ab6[_0x42e5('0x9f')]=_0x9a213e['length']>=parseInt(_0x4b6cbd[_0x42e5('0x110')])?'x':'i';}else{_0x2f1ab6[_0x42e5('0x9f')]=_0x9a213e[_0x42e5('0x91')]>=parseInt(_0x4b6cbd['mindigit'])&&_0x9a213e[_0x42e5('0x91')]<=parseInt(_0x4b6cbd[_0x42e5('0x10e')])?'x':'i';}var _0x609b4b=this['getVariable'][_0x42e5('0x6b')](this,_0x4b6cbd[_0x42e5('0xd0')]);if(!_0x609b4b){return this[_0x42e5('0xd')]['error'](_0x4b6cbd,_0x42e5('0xd2'));}this['channel'][_0x42e5('0x94')](_0x609b4b,_0x9a213e);if(this[_0x42e5('0x7d')](_0x4b6cbd[_0x42e5('0x111')])){var _0xfca3ed=parseInt(_0x4b6cbd[_0x42e5('0x111')],0xa);var _0x2b6efd=rs[_0x42e5('0x112')]({'charset':'*','length':_0xfca3ed});var _0x42abf4=_0x9a213e[_0x42e5('0x91')];if(_0x42abf4>0x0){if(_0x42abf4>_0xfca3ed){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x4b6cbd,_0x4b6cbd['hiddendigitspos']===_0x42e5('0x113')?_0x2b6efd+_0x9a213e[_0x42e5('0x114')](_0xfca3ed):_0x9a213e[_0x42e5('0x114')](0x0,_0x42abf4-_0xfca3ed)+_0x2b6efd);}else{this['createSquareDetailsReport'][_0x42e5('0x6b')](this,_0x4b6cbd,rs[_0x42e5('0x112')]({'charset':'*','length':_0x42abf4}));}}else{this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,'');}}else{this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,_0x9a213e);}return _0x2f1ab6;};AGIVertices[_0x42e5('0x14')][_0x42e5('0xc')]=function(_0x57fd23){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x57fd23[_0x42e5('0x9d')]));return this[_0x42e5('0x115')](_0x57fd23);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x116')]=function(_0x138067){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x117'),_0x138067['label']));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x138067,_0x138067[_0x42e5('0x118')]);return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x119'),_0x138067[_0x42e5('0x118')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x11a')]=function(_0x440d46){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x11b'),_0x440d46[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x80')])||!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x81')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0x11c'));}if(!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x55')])){return this['channel']['noop'](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x11d'),_0x440d46[_0x42e5('0x55')]));var _0x2305ec=this[_0x42e5('0x7f')]['sync'](this,_0x440d46);if(_0x2305ec){this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x11e'),_0x2305ec));var _0x38758=this[_0x42e5('0xd')][_0x42e5('0xfc')](_0x2305ec);try{fs[_0x42e5('0xfd')](_0x2305ec+'.wav');}catch(_0x1a540c){logger['error'](_0x1a540c);}return _0x38758;}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x440d46,_0x42e5('0x11f'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x120')]=function(_0x3e9552){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x121'),_0x3e9552['label']));if(!this['isConfigured'](_0x3e9552[_0x42e5('0x80')])||!this['isConfigured'](_0x3e9552[_0x42e5('0x81')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x42e5('0x7d')](_0x3e9552['aws_bot_name'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x122'));}if(!this[_0x42e5('0x7d')](_0x3e9552[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x3e9552);this[_0x42e5('0x3e')](_0x3e9552[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x3e9552[_0x42e5('0x55')]));var _0x2a0ac4=this['awsLex'][_0x42e5('0x6b')](this,_0x3e9552);if(_0x2a0ac4){for(var _0x252453 in _0x2a0ac4){if(_0x2a0ac4[_0x42e5('0x8c')](_0x252453)&&_[_0x42e5('0x8d')](_0x2a0ac4[_0x252453])){this['channel'][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x123'),_0x252453[_0x42e5('0x65')]()),_0x2a0ac4[_0x252453]);}}if(_[_0x42e5('0x40')](_0x2a0ac4['message'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x42e5('0x3e')](_0x2a0ac4[_0x42e5('0x124')],_0x42e5('0xe2'),_0x42e5('0x125'),'');return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Amazon\x20Lex\x20Result\x20%s',_0x2a0ac4[_0x42e5('0x124')]));}}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e9552,_0x42e5('0x126'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x127')]=function(_0x288f7e){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x128'),_0x288f7e[_0x42e5('0x9d')],_0x288f7e['timeout']));if(!this['isConfigured'](_0x288f7e[_0x42e5('0x73')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x129'));}var _0x45ccee=_0x42e5('0x12a');var _0x4f6503=util['format'](_0x42e5('0x12b'),FILES_PATH,rs[_0x42e5('0x112')](0x4));var _0x3b0d1c=util['format'](_0x42e5('0x93'),_0x4f6503,_0x45ccee);var _0x21728a=!![];if(_0x288f7e['beep']===_0x42e5('0x12c')){_0x21728a=![];}var _0x32ad52=this[_0x42e5('0xd')][_0x42e5('0x12d')](_0x4f6503,_0x45ccee,_0x288f7e[_0x42e5('0x12e')],_0x288f7e[_0x42e5('0x60')],undefined,_0x21728a);if(_0x32ad52['result']!==-0x1){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x12f'),_0x3b0d1c));var _0x4207f9=this[_0x42e5('0x88')][_0x42e5('0x6b')](this,_0x288f7e,_0x3b0d1c);if(_0x4207f9){for(var _0xc4874d in _0x4207f9){if(_0x4207f9[_0x42e5('0x8c')](_0xc4874d)){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x130'),_0xc4874d[_0x42e5('0x65')]()),_0x4207f9[_0xc4874d]);}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x131'),JSON[_0x42e5('0x6d')](_0x4207f9)));}}return _0x32ad52;};AGIVertices[_0x42e5('0x14')]['tildeasr']=function(_0x218cf5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x132'),_0x218cf5[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x218cf5[_0x42e5('0x8b')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0x133'));}if(!this[_0x42e5('0x7d')](_0x218cf5[_0x42e5('0x134')])){return this['channel']['noop'](_0x42e5('0x135'));}var _0xa1cde0=_0x42e5('0x12a');var _0x3c5087=util[_0x42e5('0x25')](_0x42e5('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x1e74e3=util['format']('%s.%s',_0x3c5087,_0xa1cde0);var _0x3924a2=!![];if(_0x218cf5[_0x42e5('0x136')]===_0x42e5('0x12c')){_0x3924a2=![];}var _0x3dc18c=this['channel'][_0x42e5('0x12d')](_0x3c5087,_0xa1cde0,_0x218cf5[_0x42e5('0x12e')],_0x218cf5['timeout'],undefined,_0x3924a2);if(_0x3dc18c[_0x42e5('0x9f')]!==-0x1){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x137'),_0x1e74e3));var _0x110042=this[_0x42e5('0x8a')][_0x42e5('0x6b')](this,_0x218cf5,_0x1e74e3);if(_0x110042){for(var _0x13e6a9 in _0x110042){if(_0x110042[_0x42e5('0x8c')](_0x13e6a9)){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x138'),_0x13e6a9['toUpperCase']()),_0x110042[_0x13e6a9]);}}return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x139'),JSON[_0x42e5('0x6d')](_0x110042)));}}return _0x3dc18c;};AGIVertices[_0x42e5('0x14')][_0x42e5('0x13a')]=function(_0x5e2229){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5e2229['label']));return this['channel'][_0x42e5('0x13b')](_0x5e2229[_0x42e5('0x39')],_0x5e2229['extension'],_0x5e2229[_0x42e5('0x3b')]);};AGIVertices[_0x42e5('0x14')]['gotoif']=function(_0x4bbf3d){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x13c'),_0x4bbf3d[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x4bbf3d[_0x42e5('0x13d')])){return this[_0x42e5('0xd')]['error'](_0x4bbf3d,'no\x20condition\x20configured');}try{var _0x593e9d=eval(_0x4bbf3d['condition'])?_0x42e5('0x13e'):'false';this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x13f'),_0x4bbf3d[_0x42e5('0x13d')],_0x593e9d));return{'code':0xc8,'result':_0x593e9d};}catch(_0x530514){return{'code':0xc8,'result':_0x42e5('0x140')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x141')]=function(_0x17f33f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x142'),_0x17f33f[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x17f33f[_0x42e5('0x143')])){return this[_0x42e5('0xd')]['error'](_0x17f33f,_0x42e5('0x144'));}var _0x4f0c95=this[_0x42e5('0x145')]['sync'](this,_0x17f33f['interval_id']);if(!_0x4f0c95){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x17f33f,_0x42e5('0x146'));}for(var _0x3ee75f=0x0;_0x3ee75f<_0x4f0c95[_0x42e5('0x91')];_0x3ee75f+=0x1){var _0x1a00ad=this[_0x42e5('0xd')][_0x42e5('0x10')](util[_0x42e5('0x25')](_0x42e5('0x147'),_0x4f0c95[_0x3ee75f]));if(_0x1a00ad['result']===-0x1){return _0x1a00ad;}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x1a00ad[_0x42e5('0x98')]));if(_0x1a00ad[_0x42e5('0x98')]===_0x42e5('0x13e')){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x42e5('0x13e')));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x42e5('0x13e')));return{'code':0xc8,'result':'true'};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('IFTIME\x20%s\x20%s',_0x4f0c95[_0x3ee75f],_0x42e5('0x140')));this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('IFTIME\x20%s\x20%s',_0x4f0c95[_0x3ee75f],_0x42e5('0x140')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x42e5('0x149')]=function(_0xd42d41){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x14a'),_0xd42d41[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x149')]();};AGIVertices[_0x42e5('0x14')][_0x42e5('0x14b')]=function(_0x32e541){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x14c'),_0x32e541[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x32e541[_0x42e5('0x73')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x129'));}var _0xbe2e8b=_0x42e5('0x12a');var _0x138c63=util[_0x42e5('0x25')](_0x42e5('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x56c8bc=util['format']('%s.%s',_0x138c63,_0xbe2e8b);var _0x16686a=!![];if(_0x32e541[_0x42e5('0x136')]===_0x42e5('0x12c')){_0x16686a=![];}var _0x9c7842=this[_0x42e5('0xd')][_0x42e5('0x12d')](_0x138c63,_0xbe2e8b,_0x32e541['intKey'],_0x32e541[_0x42e5('0x60')],undefined,_0x16686a);if(_0x9c7842[_0x42e5('0x9f')]!==-0x1){this['channel']['noop'](util[_0x42e5('0x25')]('ispeech\x20%s\x20file\x20created',_0x56c8bc));var _0x8bfbe2=this[_0x42e5('0x7b')]['sync'](this,_0x32e541,_0x56c8bc);if(_0x8bfbe2){for(var _0x8640df in _0x8bfbe2){if(_0x8bfbe2[_0x42e5('0x8c')](_0x8640df)){this['channel']['setVariable'](util['format']('ISPEECH_ASR_%s',_0x8640df[_0x42e5('0x65')]()),_0x8bfbe2[_0x8640df]);}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x14d'),JSON[_0x42e5('0x6d')](_0x8bfbe2)));}}return _0x9c7842;};AGIVertices[_0x42e5('0x14')]['ispeechtts']=function(_0x5e9b22){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5e9b22['label']));if(!this[_0x42e5('0x7d')](_0x5e9b22['key'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x5e9b22[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20text\x20configured');}this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x14e'),_0x5e9b22[_0x42e5('0x55')]));var _0x2d463c=this[_0x42e5('0x79')]['sync'](this,_0x5e9b22);if(_0x2d463c){this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x14f'),_0x2d463c));var _0x25ba4d=this[_0x42e5('0xd')]['streamFile'](_0x2d463c,_0x5e9b22[_0x42e5('0x12e')]);try{fs[_0x42e5('0xfd')](_0x2d463c+'.wav');}catch(_0x3d38d0){logger[_0x42e5('0x30')](_0x3d38d0);}return _0x25ba4d;}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x5e9b22,_0x42e5('0x150'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x151')]=function(_0x2aa16e){logger['info'](util['format'](_0x42e5('0x152'),_0x2aa16e[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2aa16e[_0x42e5('0x153')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x2aa16e,'no\x20find\x20by\x20configured');}logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x42e5('0xd')][_0x42e5('0x37')],_0x2aa16e[_0x42e5('0x153')]));var _0x193d77=this[_0x42e5('0x4d')][_0x42e5('0x6b')](this,_0x2aa16e[_0x42e5('0x153')]);if(_0x193d77){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x2aa16e['findBy']));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x155')};}else{logger['info'](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x158')]=function(_0x3a9eb8){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x159'),_0x3a9eb8['label']));if(!this['isConfigured'](_0x3a9eb8[_0x42e5('0x153')])){return this['channel'][_0x42e5('0x30')](_0x3a9eb8,_0x42e5('0x15a'));}logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x15b'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));var _0x2c790d=this[_0x42e5('0x4c')][_0x42e5('0x6b')](this,_0x3a9eb8[_0x42e5('0x153')]);if(_0x2c790d){logger['info'](util['format'](_0x42e5('0x154'),this[_0x42e5('0xd')]['callerid'],_0x3a9eb8[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x155')};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x3a9eb8[_0x42e5('0x153')]));this['channel'][_0x42e5('0xa3')](util['format'](_0x42e5('0x156'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices['prototype']['math']=function(_0x180b1e){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x15c'),_0x180b1e[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x180b1e[_0x42e5('0x15d')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x180b1e,_0x42e5('0x15e'));}this['channel'][_0x42e5('0xa3')](util['format']('math\x20%s',_0x180b1e['operation']));var _0x5ed97f=eval(_0x180b1e[_0x42e5('0x15d')]);if(!this[_0x42e5('0x7d')](_0x180b1e['variable_id'])){return this[_0x42e5('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1d343b=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x180b1e[_0x42e5('0xd0')]);if(!_0x1d343b){return this[_0x42e5('0xd')]['error'](_0x180b1e,_0x42e5('0xd2'));}if(_[_0x42e5('0x15f')](_0x5ed97f)){var _0x24e52d=this;_0x5ed97f[_0x42e5('0xd3')](function(_0x385711,_0x53048b){_0x24e52d[_0x42e5('0xd')]['setVariable'](util[_0x42e5('0x25')]('%s[%s]',_0x1d343b,_0x53048b),_0x385711);});return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('variable\x20%s[key]\x20set',_0x1d343b));}else{return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x1d343b,_0x5ed97f);}};AGIVertices[_0x42e5('0x14')][_0x42e5('0xb')]=function(_0x11020a){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x160'),_0x11020a[_0x42e5('0x9d')]));if(_0x11020a[_0x42e5('0x9b')]===0x0){return this[_0x42e5('0x99')](_0x11020a);}_0x11020a[_0x42e5('0x9b')]-=0x1;if(!this[_0x42e5('0x7d')](_0x11020a[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x11020a,_0x42e5('0x161'));}var _0x5e252e=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x11020a[_0x42e5('0x10b')]);if(!_0x5e252e){return this['channel'][_0x42e5('0x30')](_0x11020a,'no\x20file\x20audio\x20found');}var _0x21de31=this[_0x42e5('0xd')]['getData'](_0x5e252e,_0x11020a[_0x42e5('0x10d')],_0x11020a[_0x42e5('0x162')]);var _0x515986=_0x21de31['result'];if(_0x21de31[_0x42e5('0x9f')]===-0x1){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x11020a,'-1');return _0x21de31;}else if(_0x21de31[_0x42e5('0x98')]===_0x42e5('0x60')){_0x21de31[_0x42e5('0x9f')]=_0x21de31[_0x42e5('0x9f')][_0x42e5('0x91')]>0x0?_0x21de31[_0x42e5('0x9f')]:'t';}else if(_[_0x42e5('0x41')](_0x21de31['result'])){_0x21de31['result']='#';_0x515986='#';}if(!this[_0x42e5('0x7d')](_0x11020a['variable_id'])){this[_0x42e5('0xd')]['noop'](_0x42e5('0xd1'));}else{var _0x22719b=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x11020a[_0x42e5('0xd0')]);if(!_0x22719b){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x11020a,'no\x20variable\x20found');}this[_0x42e5('0xd')]['setVariable'](_0x22719b,_0x515986);}this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x11020a,_0x515986);return _0x21de31;};AGIVertices[_0x42e5('0x14')]['noop']=function(_0x575109){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x163'),_0x575109[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x575109[_0x42e5('0x164')]||_0x575109[_0x42e5('0x9d')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x165')]=function(_0x4e1425){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x166'),_0x4e1425[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x4e1425[_0x42e5('0x153')])){return this[_0x42e5('0xd')]['error'](_0x4e1425,_0x42e5('0x15a'));}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x15b'),this['channel']['callerid'],_0x4e1425[_0x42e5('0x153')]));var _0x5acf64=this[_0x42e5('0x167')][_0x42e5('0x6b')](this,_0x4e1425['pause_id']);var _0x25d800=this['agentPause'][_0x42e5('0x6b')](this,_0x4e1425[_0x42e5('0x153')],_0x5acf64);if(_0x25d800){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42e5('0x37')],_0x4e1425['findBy']));this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x168')]=function(_0x501c44){logger['info'](util[_0x42e5('0x25')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x501c44[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x501c44[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x501c44,'no\x20file\x20audio\x20selected');}var _0x209642=this[_0x42e5('0x1c')]['sync'](this,_0x501c44['file_id']);if(!_0x209642){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x501c44,_0x42e5('0x169'));}var _0x105195=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0x16a'),[_0x209642,_0x501c44[_0x42e5('0xde')]]);if(_0x105195['result']===-0x1){return _0x105195;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x16a'),_0x209642));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x16c')]=function(_0x514ee0){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x16d'),_0x514ee0[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x514ee0['queue_id'])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x514ee0,'no\x20queue\x20selected');}var _0x1dc57b='';var _0x423827=parseInt(_0x514ee0[_0x42e5('0x16e')],0xa);if(isNaN(_0x423827)){_0x1dc57b=_0x514ee0[_0x42e5('0x16e')];}else{_0x1dc57b=this['getVoiceQueue']['sync'](this,_0x514ee0[_0x42e5('0x16e')]);if(!_0x1dc57b){return this['channel'][_0x42e5('0x30')](_0x514ee0,_0x42e5('0x16f'));}}var _0x2a6e89='';if(this[_0x42e5('0x7d')](_0x514ee0['file_id'])){var _0x261841=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x514ee0[_0x42e5('0x10b')]);if(_0x261841){_0x2a6e89=_0x261841;}}this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x514ee0,_0x1dc57b);if(_0x514ee0[_0x42e5('0xde')][_0x42e5('0x170')]('x')<0x0){_0x514ee0[_0x42e5('0xde')]+='x';}if(_0x514ee0[_0x42e5('0xde')]['indexOf']('X')<0x0){_0x514ee0[_0x42e5('0xde')]+='X';}this['channel'][_0x42e5('0x94')](_0x42e5('0x171'),_0x1dc57b?_0x1dc57b['toLowerCase']():'');var _0x27ea3a=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0x172'),[_0x1dc57b,_0x514ee0[_0x42e5('0xde')],_0x514ee0[_0x42e5('0x5e')],_0x2a6e89,_0x514ee0[_0x42e5('0x60')],_0x514ee0[_0x42e5('0x7')],_0x514ee0[_0x42e5('0x173')],_0x514ee0[_0x42e5('0x174')],'',_0x514ee0['position']]);if(_0x27ea3a['result']===-0x1){return _0x27ea3a;}return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x172'),_0x1dc57b));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x175')]=function(_0x4c2ac8){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4c2ac8['label']));var _0x883364=_0x4c2ac8[_0x42e5('0x176')]||_0x42e5('0x12a');var _0x55ecae=util[_0x42e5('0x25')](_0x42e5('0x177'),this[_0x42e5('0xd')][_0x42e5('0x35')],rs[_0x42e5('0x112')](0x5));var _0x23114e=util[_0x42e5('0x25')](_0x42e5('0x178'),FILES_PATH,_0x55ecae,_0x883364);var _0x81c6d7=util[_0x42e5('0x25')]('%s/recordings/%s',FILES_PATH,_0x55ecae);this[_0x42e5('0x38')][_0x42e5('0x6b')](this,_0x4c2ac8,_0x55ecae,_0x23114e);this[_0x42e5('0xd')][_0x42e5('0x94')]('RECORDING_SAVENAME',_0x55ecae);logger[_0x42e5('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x81c6d7,_0x883364,_0x4c2ac8[_0x42e5('0x179')],_0x4c2ac8[_0x42e5('0x60')]);return this['channel']['recordFile'](_0x81c6d7,_0x883364,_0x4c2ac8[_0x42e5('0x179')],_0x4c2ac8[_0x42e5('0x60')],undefined,!![]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x17a')]=function(_0xa9ef5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xa9ef5[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xa9ef5[_0x42e5('0x5e')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0x17b'));}var _0x27b5b4=this['restAPI'][_0x42e5('0x6b')](this,_0xa9ef5);logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Response:',util['inspect'](_0x27b5b4,{'showHidden':![],'depth':null})));if(!this[_0x42e5('0x7d')](_0xa9ef5['variable_id'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x17c'));}var _0x1d1fa2=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0xa9ef5['variable_id']);if(!_0x1d1fa2){return this['channel']['error'](_0xa9ef5,_0x42e5('0xd2'));}this[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s_STATUS_CODE',_0x1d1fa2),_0x27b5b4[_0x42e5('0x6f')]?_0x27b5b4['statusCode']:_0x42e5('0x17d'));this[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s_STATUS_MESSAGE',_0x1d1fa2),_0x27b5b4[_0x42e5('0x17e')]?_0x27b5b4['statusMessage']:'OK');if(_0x27b5b4['body']){try{this['saveRestApiResult'](_0x27b5b4['body'],_0x1d1fa2);}catch(_0x5f41fa){logger[_0x42e5('0x30')](util[_0x42e5('0x25')](_0x42e5('0x17f'),_0x1d1fa2));}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xd6'),_0x1d1fa2));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x180')]=function(_0x45de61){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x181'),_0x45de61['label']));return this['channel'][_0x42e5('0x182')](_0x45de61[_0x42e5('0x183')]['replace'](/\s+/g,''),_0x45de61[_0x42e5('0x179')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x184')]=function(_0x5645f0){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x185'),_0x5645f0[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x186')](_0x5645f0[_0x42e5('0x61')][_0x42e5('0x53')](/\s+/g,''),_0x5645f0[_0x42e5('0x179')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x187')]=function(_0x54cad0){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x188'),_0x54cad0['label']));return this[_0x42e5('0xd')][_0x42e5('0x189')](_0x54cad0[_0x42e5('0x55')],_0x54cad0['escape_digits']);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x18a')]=function(_0x1a16d5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x18b'),_0x1a16d5[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1a16d5['account_id'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20mail\x20account\x20configured');}var _0x335e8e=this[_0x42e5('0x18c')][_0x42e5('0x6b')](this,_0x1a16d5[_0x42e5('0x18d')]);if(!_0x335e8e||!_0x335e8e[_0x42e5('0x18e')]){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x1a16d5,_0x42e5('0x18f'));}var _0xe12ecb={'from':util[_0x42e5('0x25')](_0x42e5('0x190'),_0x335e8e[_0x42e5('0x17')],_0x335e8e[_0x42e5('0x191')]||_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x192')]),'to':_0x1a16d5['to']||'','cc':_0x1a16d5['cc']||'','bcc':_0x1a16d5[_0x42e5('0x193')]||'','subject':_0x1a16d5['subject'],'html':_0x1a16d5[_0x42e5('0x55')],'text':_0x1a16d5[_0x42e5('0x55')]};var _0x456ca8={'tls':{'rejectUnauthorized':![]}};if(_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x194')]){_0x456ca8[_0x42e5('0x194')]=_0x335e8e[_0x42e5('0x18e')]['service'];}else{_0x456ca8[_0x42e5('0x195')]=_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x195')];_0x456ca8['port']=_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x196')];_0x456ca8[_0x42e5('0x197')]=_0x335e8e[_0x42e5('0x18e')]['secure'];}if(_0x335e8e['Smtp'][_0x42e5('0x198')]){_0x456ca8[_0x42e5('0x199')]={'user':_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x192')],'pass':_0x335e8e['Smtp'][_0x42e5('0x19a')]};}if(this[_0x42e5('0x7d')](_0x1a16d5[_0x42e5('0x19b')])){}logger[_0x42e5('0xd8')](_0x42e5('0x19c'),JSON[_0x42e5('0x6d')](_0xe12ecb));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x1a16d5,_0x1a16d5[_0x42e5('0x18d')]);this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x19d'),_0x335e8e['name']));this['sendMailMessage'][_0x42e5('0x6b')](this,_0x456ca8,_0xe12ecb);return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x19e'));};AGIVertices['prototype'][_0x42e5('0x19f')]=function(_0x59616f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1a0'),_0x59616f['label']));return this['channel']['noop'](_0x42e5('0x1a1'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1a2')]=function(_0x5743cc){logger['info'](util[_0x42e5('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5743cc['label']));if(!this['isConfigured'](_0x5743cc['sms_account_id'])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0x1a3'));}var _0x6dc33e=this[_0x42e5('0x32')]['sync'](this,_0x5743cc['sms_account_id']);if(!_0x6dc33e){return this['channel'][_0x42e5('0x30')](_0x5743cc,_0x42e5('0x1a4'));}var _0x31c1eb={'body':_0x5743cc['sms_text'],'phone':_0x5743cc['to']||'','SmsAccountId':_0x6dc33e['id']};logger[_0x42e5('0xd8')](_0x42e5('0x1a5'),JSON[_0x42e5('0x6d')](_0x31c1eb));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x5743cc,_0x5743cc[_0x42e5('0x1a6')]);this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0x1a7'),_0x6dc33e[_0x42e5('0x17')]));this[_0x42e5('0x34')][_0x42e5('0x6b')](this,_0x31c1eb);return this['channel'][_0x42e5('0xa3')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x42e5('0x1a8')]=function(_0x2dc2ea){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1a9'),_0x2dc2ea[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x2dc2ea[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0x30')](_0x2dc2ea,_0x42e5('0x1aa'));}var _0x55913d=this[_0x42e5('0x10')]['sync'](this,_0x2dc2ea[_0x42e5('0xd0')]);if(!_0x55913d){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x2dc2ea,'no\x20variable\x20found');}return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x55913d,_0x2dc2ea[_0x42e5('0x1ab')]);};AGIVertices['prototype'][_0x42e5('0x1ac')]=function(_0x26eedc){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1ad'),_0x26eedc['label']));this[_0x42e5('0xd')]['noop']('START\x20CALLY\x20SQUARE');if(_0x26eedc[_0x42e5('0xaf')]===_0x42e5('0x1ae')){this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x1af'));return this[_0x42e5('0xd')][_0x42e5('0xaf')]();}return this[_0x42e5('0xd')][_0x42e5('0xa3')]('Skipped\x20Answer');};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1b0')]=function(_0x3dc565){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1b1'),_0x3dc565['label']));if(!this[_0x42e5('0x7d')](_0x3dc565[_0x42e5('0x1b2')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,_0x42e5('0x1b3'));}var _0x21d571=this[_0x42e5('0x18')][_0x42e5('0x6b')](this,_0x3dc565[_0x42e5('0x1b2')]);if(!this[_0x42e5('0x7d')](_0x21d571)){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,util['format'](_0x42e5('0x1b4'),_0x3dc565[_0x42e5('0x1b2')]));}if(_0x21d571===this[_0x42e5('0xd')][_0x42e5('0x1b5')]){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x42e5('0x9a')]['sync'](this,_0x3dc565,_0x21d571);var _0x168bdf=this[_0x42e5('0xd')]['exec']('AGI',util[_0x42e5('0x25')](_0x42e5('0x1b6'),config[_0x42e5('0x7')]['host']||_0x42e5('0x1b7'),_0x21d571,this['channel']['arg_1']));if(_0x168bdf[_0x42e5('0x9f')]===-0x1){return _0x168bdf;}return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('Executed\x20command\x20%s\x20%s','AGI',_0x21d571));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1b8')]=function(_0x1f253c){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1b9'),_0x1f253c[_0x42e5('0x9d')]));var _0x515c75=this['shellCommand'][_0x42e5('0x6b')](this,_0x1f253c[_0x42e5('0xad')]);this['createSquareDetailsReport']['sync'](this,_0x1f253c,_0x1f253c[_0x42e5('0xad')]);if(this[_0x42e5('0x7d')](_0x1f253c[_0x42e5('0xd0')])){var _0x5cb7fe=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x1f253c[_0x42e5('0xd0')]);if(_0x5cb7fe){this[_0x42e5('0xd')][_0x42e5('0x94')](_0x5cb7fe,_0x515c75);return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1ba'),_0x1f253c[_0x42e5('0xad')],_0x5cb7fe));}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1bb'),_0x1f253c[_0x42e5('0xad')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1bc')]=function(_0x3346b0){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1bd'),_0x3346b0[_0x42e5('0x9d')]));_0x3346b0[_0x42e5('0x55')]=_0x3346b0[_0x42e5('0x55')][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42e5('0x7d')](_0x3346b0['apiKey'])){return this[_0x42e5('0xd')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x42e5('0x7d')](_0x3346b0[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x1be'),_0x3346b0[_0x42e5('0x55')]));var _0x76c1d4=this[_0x42e5('0x54')][_0x42e5('0x6b')](this,_0x3346b0);if(_0x76c1d4){this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1bf'),_0x76c1d4));var _0x44e47f=this[_0x42e5('0xd')]['streamFile'](_0x76c1d4);try{fs['unlink'](_0x76c1d4+'.wav');}catch(_0x16dd5d){logger[_0x42e5('0x30')](_0x16dd5d);}return _0x44e47f;}return this['channel'][_0x42e5('0x30')](_0x3346b0,_0x42e5('0x1c0'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c1')]=function(_0x4ff3d8){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4ff3d8[_0x42e5('0x9d')]));_0x4ff3d8['text']=_0x4ff3d8['text'][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42e5('0x7d')](_0x4ff3d8['text'])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x1c2'),_0x4ff3d8[_0x42e5('0x55')]));var _0x36402a=this['googleTTS']['sync'](this,_0x4ff3d8);if(_0x36402a){this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x1c3'),_0x36402a));var _0x3e8ae1=this['channel'][_0x42e5('0xfc')](_0x36402a);try{fs[_0x42e5('0xfd')](_0x36402a+_0x42e5('0xfe'));}catch(_0x55a918){logger[_0x42e5('0x30')](_0x55a918);}return _0x3e8ae1;}return this[_0x42e5('0xd')]['error'](_0x4ff3d8,_0x42e5('0x1c4'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c5')]=function(_0x16ac70){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x1c6'),_0x16ac70[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x16ac70['findBy'])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x16ac70,_0x42e5('0x15a'));}logger['info'](util[_0x42e5('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x42e5('0x37')],_0x16ac70['findBy']));var _0x710fa4=this[_0x42e5('0x4b')]['sync'](this,_0x16ac70[_0x42e5('0x153')]);if(_0x710fa4){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')]['callerid'],_0x16ac70[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x16ac70[_0x42e5('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x16ac70[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x156'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x16ac70['findBy']));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c7')]=function(_0x32363c){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1c8'),_0x32363c[_0x42e5('0x9d')]));var _0x15e77f=this['channel'][_0x42e5('0x52')](_0x42e5('0x1c9'),[_0x32363c[_0x42e5('0x1ca')],_0x32363c[_0x42e5('0x71')]]);if(_0x15e77f[_0x42e5('0x9f')]===-0x1){return _0x15e77f;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x1c9'),_0x32363c[_0x42e5('0x1ca')]));};AGIVertices[_0x42e5('0x14')]['vswitch']=function(_0x3ccaff){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x1cb'),_0x3ccaff[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x3ccaff[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0x30')](_0x3ccaff,_0x42e5('0x1aa'));}var _0x520893=this[_0x42e5('0x10')]['sync'](this,_0x3ccaff[_0x42e5('0xd0')]);if(!_0x520893){return this[_0x42e5('0xd')]['error'](_0x3ccaff,'no\x20variable\x20found');}var _0x2862be=this[_0x42e5('0xd')]['getVariable'](_0x520893);return{'code':0xc8,'result':_0x2862be[_0x42e5('0x98')]?_0x2862be[_0x42e5('0x98')]:'-'};};String['prototype'][_0x42e5('0x96')]=function(_0x568df5,_0x27e4f5){return this[_0x42e5('0x95')](_0x568df5)[_0x42e5('0x1cc')](_0x27e4f5);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 886b628..3964c45 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 _0x3be9=['message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','syncAgentConnect','interface','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','util','lodash','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s'];(function(_0x4552fe,_0x25d764){var _0x2553e0=function(_0x54626a){while(--_0x54626a){_0x4552fe['push'](_0x4552fe['shift']());}};_0x2553e0(++_0x25d764);}(_0x3be9,0x111));var _0x93be=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x3be9[_0x296897];return _0x2b44ab;};'use strict';var util=require(_0x93be('0x0'));var _=require(_0x93be('0x1'));var moment=require(_0x93be('0x2'));var ami=require(_0x93be('0x3'));var logger=require(_0x93be('0x4'))(_0x93be('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x18160a){this['voiceQueues']=_0x18160a[_0x93be('0x6')];this[_0x93be('0x7')]=_0x18160a[_0x93be('0x7')];this[_0x93be('0x8')]=_0x18160a[_0x93be('0x8')];this['channels']={};ami['on'](_0x93be('0x9'),this['syncAgentConnect'][_0x93be('0xa')](this));ami['on'](_0x93be('0xb'),this[_0x93be('0xc')][_0x93be('0xa')](this));ami['on'](_0x93be('0xd'),this[_0x93be('0xe')][_0x93be('0xa')](this));ami['on']('agentringnoanswer',this[_0x93be('0xf')][_0x93be('0xa')](this));ami['on'](_0x93be('0x10'),this['syncAttendedTransfer'][_0x93be('0xa')](this));ami['on'](_0x93be('0x11'),this[_0x93be('0x12')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x93be('0x13')]['bind'](this));}function getDiff(_0x1af400){var _0x1cab65=moment()[_0x93be('0x14')](0x0);var _0x3c20d5=moment(_0x1af400)[_0x93be('0x14')](0x0);return _0x1cab65[_0x93be('0x15')](_0x3c20d5,_0x93be('0x16'));}Acw[_0x93be('0x17')][_0x93be('0x18')]=function(_0xa725b1){try{var _0x25c85d=this;var _0x5c9513=this[_0x93be('0x19')][_0xa725b1]['interface'];var _0x852825=this[_0x93be('0x19')][_0xa725b1][_0x93be('0x1a')];var _0x325a45=this[_0x93be('0x6')][_0x852825];var _0x54b6e1=![];var _0x1b8465=_0x93be('0x1b');if(_0x325a45[_0x93be('0x1c')]){if(_0x325a45['mandatoryDispositionPause'][_0x93be('0x1d')]){_0x54b6e1=!![];_0x1b8465=_0x325a45[_0x93be('0x1e')]['name'];}}ami[_0x93be('0x1f')]({'action':_0x93be('0x20'),'interface':_0x5c9513,'paused':!![],'reason':_0x1b8465})[_0x93be('0x21')](function(_0x396581){if(_0x25c85d[_0x93be('0x7')][_0x5c9513]){return RpcUser[_0x93be('0x22')](_0x25c85d['agents'][_0x5c9513]['id'])['then'](function(_0x2925e9){if(_0x2925e9&&!_0x2925e9[_0x93be('0x23')]){logger[_0x93be('0x24')](_0x93be('0x25'),_0xa725b1,_0x5c9513,_0x852825);var _0x4f7588=_0x25c85d['channels'][_0xa725b1][_0x93be('0x26')]&&_0x25c85d['channels'][_0xa725b1][_0x93be('0x27')]?_0x25c85d[_0x93be('0x19')][_0xa725b1][_0x93be('0x27')]:_0xa725b1;return RpcUser[_0x93be('0x28')](_0x25c85d['agents'][_0x5c9513],_0x1b8465,_0x4f7588)[_0x93be('0x21')](function(_0x38ab2c){if(!_0x54b6e1){_0x25c85d[_0x93be('0x8')][_0x5c9513]={};logger[_0x93be('0x24')](_0x93be('0x29'),_0xa725b1,_0x25c85d[_0x93be('0x6')][_0x852825][_0x93be('0x2a')],_0x5c9513,_0x852825);_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2b')]=setTimeout(_0x25c85d['stopAcw'][_0x93be('0xa')](_0x25c85d,_0x5c9513),_0x25c85d[_0x93be('0x6')][_0x852825]['acwTimeout']*0x3e8);_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2c')]=moment()[_0x93be('0x2d')](_0x93be('0x2e'));_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2f')]=_0xa725b1;_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x1a')]=_0x852825;_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x30')]=function(){var _0x518039=getDiff(_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2c')]);clearTimeout(_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2b')]);_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2b')]=![];RpcVoiceAgentReport[_0x93be('0x31')]({'acwtime':_0x518039},_0x25c85d[_0x93be('0x8')][_0x5c9513][_0x93be('0x2f')],_0x5c9513)['then'](function(_0x35916a){logger[_0x93be('0x24')](_0x93be('0x32'),_0xa725b1,_0x518039,_0x35916a);})['catch'](function(_0x548bb2){logger[_0x93be('0x33')]('[%s][UPDATE][ERRORS:%s]',_0xa725b1,_0x548bb2);});delete _0x25c85d[_0x93be('0x8')][_0x5c9513];};}});}else{logger[_0x93be('0x24')](_0x93be('0x34'),_0xa725b1,_0x5c9513,_0x852825);}});}})[_0x93be('0x35')](function(_0xe3401){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xa725b1,_0x25c85d[_0x93be('0x6')][_0x852825]['acwTimeout'],_0x5c9513,_0x852825);})['finally'](function(){delete _0x25c85d['channels'][_0xa725b1];});}catch(_0x175e04){logger['error'](_0x93be('0x36'),_0x175e04[_0x93be('0x37')]);}};Acw[_0x93be('0x17')]['stopAcw']=function(_0x4ff324){try{var _0x22f04b=this;if(_0x22f04b[_0x93be('0x8')][_0x4ff324]){_0x22f04b[_0x93be('0x8')][_0x4ff324][_0x93be('0x2b')]=![];var _0x1292be=_0x22f04b[_0x93be('0x8')][_0x4ff324]['uniqueid'];var _0x4e3924=_0x22f04b[_0x93be('0x8')][_0x4ff324][_0x93be('0x1a')];var _0x445766=_0x22f04b['voiceQueues'][_0x4e3924]['acwTimeout'];logger[_0x93be('0x24')](_0x93be('0x38'),_0x1292be,_0x4ff324);RpcUser[_0x93be('0x39')](this[_0x93be('0x7')][_0x4ff324]);RpcVoiceAgentReport[_0x93be('0x31')]({'acwtime':_0x445766,'agentacw':!![]},_0x1292be,_0x4ff324)[_0x93be('0x21')](function(_0x4e09b9){logger[_0x93be('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x1292be,_0x445766,_0x4e09b9);})[_0x93be('0x35')](function(_0x276dca){logger[_0x93be('0x33')](_0x93be('0x3a'),_0x1292be,_0x276dca);});}else{logger[_0x93be('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4ff324);if(_0x22f04b[_0x93be('0x8')]){logger[_0x93be('0x24')](_0x93be('0x3b'),JSON[_0x93be('0x3c')](_0x22f04b[_0x93be('0x8')]));}}}catch(_0x15170c){logger[_0x93be('0x33')]('[ACW][STOP]\x20%s',_0x15170c[_0x93be('0x37')]);}};Acw[_0x93be('0x17')][_0x93be('0x3d')]=function(_0x120b10){try{if(this[_0x93be('0x6')][_0x120b10['queue']]&&(this[_0x93be('0x6')][_0x120b10['queue']][_0x93be('0x5')]||this[_0x93be('0x6')][_0x120b10['queue']][_0x93be('0x1c')])){if(this[_0x93be('0x7')][_0x120b10[_0x93be('0x3e')]]){this[_0x93be('0x19')][_0x120b10[_0x93be('0x2f')]]={'queue':_0x120b10[_0x93be('0x1a')],'interface':_0x120b10['interface'],'destlinkedid':_0x120b10[_0x93be('0x27')]};}}}catch(_0x3732ec){logger[_0x93be('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x3732ec[_0x93be('0x37')]);}};Acw[_0x93be('0x17')][_0x93be('0x13')]=function(_0xefabe1){try{if(this[_0x93be('0x6')][_0xefabe1['queue']]&&(this['voiceQueues'][_0xefabe1[_0x93be('0x1a')]][_0x93be('0x5')]||this[_0x93be('0x6')][_0xefabe1[_0x93be('0x1a')]]['mandatoryDisposition'])){if(this[_0x93be('0x7')][_0xefabe1[_0x93be('0x3e')]]){this[_0x93be('0x19')][_0xefabe1[_0x93be('0x2f')]]={'queue':_0xefabe1[_0x93be('0x1a')],'interface':_0xefabe1[_0x93be('0x3e')]};}}}catch(_0x33969f){logger[_0x93be('0x33')](_0x93be('0x3f'),_0x33969f[_0x93be('0x37')]);}};Acw[_0x93be('0x17')][_0x93be('0xc')]=function(_0x23a46b){try{if(this[_0x93be('0x19')][_0x23a46b[_0x93be('0x2f')]]&&_['isUndefined'](this['channels'][_0x23a46b[_0x93be('0x2f')]]['attended'])){logger[_0x93be('0x24')]('[%s][HANGUP:UNIQUEID]',_0x23a46b['uniqueid']);this[_0x93be('0x18')](_0x23a46b[_0x93be('0x2f')]);}else if(this['channels'][_0x23a46b[_0x93be('0x40')]]&&_[_0x93be('0x41')](this[_0x93be('0x19')][_0x23a46b[_0x93be('0x40')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x23a46b[_0x93be('0x40')]);this[_0x93be('0x18')](_0x23a46b[_0x93be('0x40')]);}}catch(_0x404686){logger[_0x93be('0x33')](_0x93be('0x42'),_0x404686[_0x93be('0x37')]);}};Acw[_0x93be('0x17')]['syncHangup']=function(_0x39beb5){try{if(this['channels'][_0x39beb5[_0x93be('0x2f')]]&&this['channels'][_0x39beb5[_0x93be('0x2f')]][_0x93be('0x26')]){logger['info'](_0x93be('0x43'),_0x39beb5[_0x93be('0x2f')]);this[_0x93be('0x18')](_0x39beb5[_0x93be('0x2f')]);}else if(this[_0x93be('0x19')][_0x39beb5['linkedid']]&&this['channels'][_0x39beb5[_0x93be('0x40')]][_0x93be('0x26')]){logger[_0x93be('0x24')](_0x93be('0x44'),_0x39beb5[_0x93be('0x40')]);this[_0x93be('0x18')](_0x39beb5[_0x93be('0x40')]);}}catch(_0x3ffc7f){logger[_0x93be('0x33')](_0x93be('0x45'),_0x3ffc7f[_0x93be('0x37')]);}};Acw['prototype'][_0x93be('0x46')]=function(_0x186a22){try{if(!_[_0x93be('0x47')](this['channels'][_0x186a22[_0x93be('0x48')]])){this[_0x93be('0x18')](_0x186a22['transfereeuniqueid']);if(this[_0x93be('0x19')][_0x186a22['secondtransfereruniqueid']]){this[_0x93be('0x19')][_0x186a22[_0x93be('0x49')]][_0x93be('0x26')]=!![];this[_0x93be('0x19')][_0x186a22[_0x93be('0x4a')]]=this['channels'][_0x186a22[_0x93be('0x49')]];delete this[_0x93be('0x19')][_0x186a22[_0x93be('0x49')]];}}else if(!_[_0x93be('0x47')](this['channels'][_0x186a22['transfertargetuniqueid']])){this[_0x93be('0x18')](_0x186a22[_0x93be('0x4a')]);if(this[_0x93be('0x19')][_0x186a22[_0x93be('0x4b')]]){this[_0x93be('0x19')][_0x186a22[_0x93be('0x4b')]][_0x93be('0x26')]=!![];this[_0x93be('0x19')][_0x186a22[_0x93be('0x48')]]=this['channels'][_0x186a22[_0x93be('0x4b')]];delete this[_0x93be('0x19')][_0x186a22[_0x93be('0x4b')]];}}}catch(_0x1b7ec2){logger[_0x93be('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0x1b7ec2[_0x93be('0x37')]);}};Acw['prototype'][_0x93be('0x12')]=function(_0x32f901){try{if(this[_0x93be('0x19')][_0x32f901[_0x93be('0x4c')]]){logger[_0x93be('0x24')](_0x93be('0x4d'),JSON[_0x93be('0x3c')](_0x32f901['transfereruniqueid']));this[_0x93be('0x18')](_0x32f901[_0x93be('0x4c')]);}else if(this['channels'][_0x32f901['transfererlinkedid']]){logger[_0x93be('0x24')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x93be('0x3c')](_0x32f901[_0x93be('0x4e')]));this[_0x93be('0x18')](_0x32f901['transfererlinkedid']);}}catch(_0x38b2d2){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x38b2d2[_0x93be('0x37')]);}};Acw['prototype'][_0x93be('0xf')]=function(_0x45a31d){try{if(this['voiceQueues'][_0x45a31d[_0x93be('0x1a')]]&&this[_0x93be('0x6')][_0x45a31d[_0x93be('0x1a')]][_0x93be('0x4f')]===_0x93be('0x50')){if(this['agents'][_0x45a31d[_0x93be('0x3e')]]){logger[_0x93be('0x24')](_0x93be('0x51'),_0x45a31d['uniqueid'],_0x45a31d['interface'],_0x45a31d[_0x93be('0x1a')]);return RpcUser[_0x93be('0x28')](this['agents'][_0x45a31d[_0x93be('0x3e')]],'Auto-Pause',_0x45a31d['uniqueid']);}}}catch(_0x35c7da){logger[_0x93be('0x33')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x35c7da['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x7796=['syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timer','stopAcw','lastPauseAt','format','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','finally','error','[ACW][START]\x20%s','message','saveUnpause','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0x7796,0x14a));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6779('0x0'));var _=require(_0x6779('0x1'));var moment=require(_0x6779('0x2'));var ami=require(_0x6779('0x3'));var logger=require(_0x6779('0x4'))(_0x6779('0x5'));var RpcUser=require(_0x6779('0x6'));var RpcVoiceAgentReport=require(_0x6779('0x7'));function Acw(_0x5f44a5){this[_0x6779('0x8')]=_0x5f44a5['voiceQueues'];this[_0x6779('0x9')]=_0x5f44a5[_0x6779('0x9')];this[_0x6779('0xa')]=_0x5f44a5['timers'];this[_0x6779('0xb')]={};ami['on'](_0x6779('0xc'),this['syncAgentConnect'][_0x6779('0xd')](this));ami['on']('hanguprequest',this[_0x6779('0xe')][_0x6779('0xd')](this));ami['on'](_0x6779('0xf'),this[_0x6779('0x10')][_0x6779('0xd')](this));ami['on'](_0x6779('0x11'),this[_0x6779('0x12')][_0x6779('0xd')](this));ami['on'](_0x6779('0x13'),this[_0x6779('0x14')]['bind'](this));ami['on'](_0x6779('0x15'),this[_0x6779('0x16')]['bind'](this));ami['on'](_0x6779('0x17'),this[_0x6779('0x18')][_0x6779('0xd')](this));}function getDiff(_0x483413){var _0x314ef5=moment()[_0x6779('0x19')](0x0);var _0x557a5d=moment(_0x483413)[_0x6779('0x19')](0x0);return _0x314ef5[_0x6779('0x1a')](_0x557a5d,_0x6779('0x1b'));}Acw[_0x6779('0x1c')][_0x6779('0x1d')]=function(_0x15d91b){try{var _0x2791cd=this;var _0x122234=this[_0x6779('0xb')][_0x15d91b][_0x6779('0x1e')];var _0x196ce2=this[_0x6779('0xb')][_0x15d91b][_0x6779('0x1f')];var _0x290035=this[_0x6779('0x8')][_0x196ce2];var _0x4245a9=![];var _0x214c7f='ACW';if(_0x290035[_0x6779('0x20')]){if(_0x290035[_0x6779('0x21')]['name']){_0x4245a9=!![];_0x214c7f=_0x290035['mandatoryDispositionPause'][_0x6779('0x22')];}}ami[_0x6779('0x23')]({'action':_0x6779('0x24'),'interface':_0x122234,'paused':!![],'reason':_0x214c7f})[_0x6779('0x25')](function(_0x4d3f06){if(_0x2791cd['agents'][_0x122234]){return RpcUser[_0x6779('0x26')](_0x2791cd[_0x6779('0x9')][_0x122234]['id'])[_0x6779('0x25')](function(_0x23bb08){if(_0x23bb08&&!_0x23bb08[_0x6779('0x27')]){logger[_0x6779('0x28')](_0x6779('0x29'),_0x15d91b,_0x122234,_0x196ce2);var _0x829aef=_0x2791cd['channels'][_0x15d91b][_0x6779('0x2a')]&&_0x2791cd['channels'][_0x15d91b]['destlinkedid']?_0x2791cd['channels'][_0x15d91b][_0x6779('0x2b')]:_0x15d91b;return RpcUser[_0x6779('0x2c')](_0x2791cd['agents'][_0x122234],_0x214c7f,_0x829aef)['then'](function(_0x4dbb86){if(!_0x4245a9){_0x2791cd[_0x6779('0xa')][_0x122234]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15d91b,_0x2791cd[_0x6779('0x8')][_0x196ce2]['acwTimeout'],_0x122234,_0x196ce2);_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]=setTimeout(_0x2791cd[_0x6779('0x2e')][_0x6779('0xd')](_0x2791cd,_0x122234),_0x2791cd[_0x6779('0x8')][_0x196ce2]['acwTimeout']*0x3e8);_0x2791cd['timers'][_0x122234][_0x6779('0x2f')]=moment()[_0x6779('0x30')]('YYYY-MM-DD\x20HH:mm:ss');_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x31')]=_0x15d91b;_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x1f')]=_0x196ce2;_0x2791cd[_0x6779('0xa')][_0x122234]['updateAcw']=function(){var _0x1fc135=getDiff(_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2f')]);clearTimeout(_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]);_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]=![];RpcVoiceAgentReport[_0x6779('0x32')]({'acwtime':_0x1fc135},_0x2791cd['timers'][_0x122234][_0x6779('0x31')],_0x122234)[_0x6779('0x25')](function(_0x486e85){logger[_0x6779('0x28')](_0x6779('0x33'),_0x15d91b,_0x1fc135,_0x486e85);})['catch'](function(_0x527724){logger['error'](_0x6779('0x34'),_0x15d91b,_0x527724);});delete _0x2791cd[_0x6779('0xa')][_0x122234];};}});}else{logger[_0x6779('0x28')](_0x6779('0x35'),_0x15d91b,_0x122234,_0x196ce2);}});}})['catch'](function(_0xfde3c7){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15d91b,_0x2791cd[_0x6779('0x8')][_0x196ce2][_0x6779('0x36')],_0x122234,_0x196ce2);})[_0x6779('0x37')](function(){delete _0x2791cd[_0x6779('0xb')][_0x15d91b];});}catch(_0x499d05){logger[_0x6779('0x38')](_0x6779('0x39'),_0x499d05[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x2e')]=function(_0x323a62){try{var _0xdde6c1=this;if(_0xdde6c1[_0x6779('0xa')][_0x323a62]){_0xdde6c1[_0x6779('0xa')][_0x323a62]['timer']=![];var _0x16fcd2=_0xdde6c1['timers'][_0x323a62][_0x6779('0x31')];var _0x449742=_0xdde6c1[_0x6779('0xa')][_0x323a62][_0x6779('0x1f')];var _0x4a9ec6=_0xdde6c1[_0x6779('0x8')][_0x449742]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x16fcd2,_0x323a62);RpcUser[_0x6779('0x3b')](this[_0x6779('0x9')][_0x323a62]);RpcVoiceAgentReport[_0x6779('0x32')]({'acwtime':_0x4a9ec6,'agentacw':!![]},_0x16fcd2,_0x323a62)['then'](function(_0x3685ec){logger[_0x6779('0x28')](_0x6779('0x33'),_0x16fcd2,_0x4a9ec6,_0x3685ec);})[_0x6779('0x3c')](function(_0x5f1b7d){logger[_0x6779('0x38')]('[%s][UPDATE][ERRORS:%s]',_0x16fcd2,_0x5f1b7d);});}else{logger[_0x6779('0x38')](_0x6779('0x3d'),_0x323a62);if(_0xdde6c1[_0x6779('0xa')]){logger['info'](_0x6779('0x3e'),JSON['stringify'](_0xdde6c1['timers']));}}}catch(_0x345b61){logger[_0x6779('0x38')](_0x6779('0x3f'),_0x345b61[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x40')]=function(_0x416624){try{if(this[_0x6779('0x8')][_0x416624[_0x6779('0x1f')]]&&(this[_0x6779('0x8')][_0x416624[_0x6779('0x1f')]]['acw']||this[_0x6779('0x8')][_0x416624['queue']]['mandatoryDisposition'])){if(this[_0x6779('0x9')][_0x416624[_0x6779('0x1e')]]){this[_0x6779('0xb')][_0x416624[_0x6779('0x31')]]={'queue':_0x416624['queue'],'interface':_0x416624['interface'],'destlinkedid':_0x416624[_0x6779('0x2b')]};}}}catch(_0x98da0e){logger[_0x6779('0x38')](_0x6779('0x41'),_0x98da0e[_0x6779('0x3a')]);}};Acw['prototype'][_0x6779('0x18')]=function(_0x258726){try{if(this[_0x6779('0x8')][_0x258726[_0x6779('0x1f')]]&&(this['voiceQueues'][_0x258726['queue']][_0x6779('0x5')]||this[_0x6779('0x8')][_0x258726[_0x6779('0x1f')]][_0x6779('0x20')])){if(this[_0x6779('0x9')][_0x258726[_0x6779('0x1e')]]){this[_0x6779('0xb')][_0x258726[_0x6779('0x31')]]={'queue':_0x258726[_0x6779('0x1f')],'interface':_0x258726[_0x6779('0x1e')]};}}}catch(_0x28cd9b){logger[_0x6779('0x38')]('[ACW][syncAgentConnectPreview]\x20%s',_0x28cd9b[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0xe')]=function(_0x13a803){try{if(this[_0x6779('0xb')][_0x13a803[_0x6779('0x31')]]&&_[_0x6779('0x42')](this[_0x6779('0xb')][_0x13a803[_0x6779('0x31')]][_0x6779('0x2a')])){logger[_0x6779('0x28')](_0x6779('0x43'),_0x13a803['uniqueid']);this[_0x6779('0x1d')](_0x13a803[_0x6779('0x31')]);}else if(this['channels'][_0x13a803[_0x6779('0x44')]]&&_['isUndefined'](this[_0x6779('0xb')][_0x13a803[_0x6779('0x44')]][_0x6779('0x2a')])){logger['info'](_0x6779('0x45'),_0x13a803['linkedid']);this[_0x6779('0x1d')](_0x13a803[_0x6779('0x44')]);}}catch(_0x5a0ac4){logger[_0x6779('0x38')]('[ACW][syncHangupRequest]\x20%s',_0x5a0ac4[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x10')]=function(_0x29a48e){try{if(this['channels'][_0x29a48e['uniqueid']]&&this[_0x6779('0xb')][_0x29a48e['uniqueid']][_0x6779('0x2a')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x29a48e[_0x6779('0x31')]);this[_0x6779('0x1d')](_0x29a48e[_0x6779('0x31')]);}else if(this[_0x6779('0xb')][_0x29a48e[_0x6779('0x44')]]&&this[_0x6779('0xb')][_0x29a48e[_0x6779('0x44')]][_0x6779('0x2a')]){logger[_0x6779('0x28')](_0x6779('0x46'),_0x29a48e[_0x6779('0x44')]);this[_0x6779('0x1d')](_0x29a48e[_0x6779('0x44')]);}}catch(_0xb3c5a2){logger[_0x6779('0x38')](_0x6779('0x47'),_0xb3c5a2['message']);}};Acw[_0x6779('0x1c')][_0x6779('0x14')]=function(_0x132e6b){try{if(!_[_0x6779('0x48')](this[_0x6779('0xb')][_0x132e6b[_0x6779('0x49')]])){this['startAcw'](_0x132e6b[_0x6779('0x49')]);if(this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]]){this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]][_0x6779('0x2a')]=!![];this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4b')]]=this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]];delete this['channels'][_0x132e6b['secondtransfereruniqueid']];}}else if(!_[_0x6779('0x48')](this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4b')]])){this[_0x6779('0x1d')](_0x132e6b[_0x6779('0x4b')]);if(this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]]){this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]][_0x6779('0x2a')]=!![];this[_0x6779('0xb')][_0x132e6b[_0x6779('0x49')]]=this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]];delete this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]];}}}catch(_0x2cb427){logger[_0x6779('0x38')](_0x6779('0x4d'),_0x2cb427['message']);}};Acw[_0x6779('0x1c')][_0x6779('0x16')]=function(_0x25d290){try{if(this[_0x6779('0xb')][_0x25d290[_0x6779('0x4e')]]){logger[_0x6779('0x28')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6779('0x4f')](_0x25d290[_0x6779('0x4e')]));this['startAcw'](_0x25d290[_0x6779('0x4e')]);}else if(this['channels'][_0x25d290[_0x6779('0x50')]]){logger['info'](_0x6779('0x51'),JSON[_0x6779('0x4f')](_0x25d290['transfererlinkedid']));this[_0x6779('0x1d')](_0x25d290[_0x6779('0x50')]);}}catch(_0x5551d4){logger[_0x6779('0x38')]('[ACW][syncBlindTransfer]\x20%s',_0x5551d4[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')]['syncAgentRingNoAnswer']=function(_0x5cb189){try{if(this['voiceQueues'][_0x5cb189[_0x6779('0x1f')]]&&this['voiceQueues'][_0x5cb189[_0x6779('0x1f')]][_0x6779('0x52')]===_0x6779('0x53')){if(this[_0x6779('0x9')][_0x5cb189[_0x6779('0x1e')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5cb189[_0x6779('0x31')],_0x5cb189['interface'],_0x5cb189[_0x6779('0x1f')]);return RpcUser[_0x6779('0x2c')](this[_0x6779('0x9')][_0x5cb189[_0x6779('0x1e')]],'Auto-Pause',_0x5cb189[_0x6779('0x31')]);}}}catch(_0x5ba26a){logger[_0x6779('0x38')](_0x6779('0x54'),_0x5ba26a['message']);}};module[_0x6779('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 5abd89b..95ff41b 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 _0x43d0=['actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird','moment','util','ami','port','asterisk','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry'];(function(_0x4c7d23,_0x1eed42){var _0x4bd04c=function(_0x3409cf){while(--_0x3409cf){_0x4c7d23['push'](_0x4c7d23['shift']());}};_0x4bd04c(++_0x1eed42);}(_0x43d0,0x16a));var _0x043d=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x43d0[_0x33155c];return _0x5becf7;};'use strict';var Manager=require(_0x043d('0x0'));var BPromise=require(_0x043d('0x1'));var moment=require(_0x043d('0x2'));var util=require(_0x043d('0x3'));var _=require('lodash');var logger=require('../../config/logger')(_0x043d('0x4'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x043d('0x5')],config[_0x043d('0x6')]['ip'],config[_0x043d('0x6')][_0x043d('0x7')],config[_0x043d('0x6')]['password'],!![]);ami[_0x043d('0x8')]();ami[_0x043d('0x9')]=BPromise[_0x043d('0xa')](ami[_0x043d('0xb')]);function error(_0x315d00){logger[_0x043d('0xc')](util[_0x043d('0xd')](_0x043d('0xe'),config[_0x043d('0x6')]['username'],config[_0x043d('0x6')]['ip'],config['asterisk'][_0x043d('0x5')],util[_0x043d('0xf')](_0x315d00,![],null)));}function close(){logger[_0x043d('0xc')](util[_0x043d('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x043d('0x6')][_0x043d('0x7')],config['asterisk']['ip'],config[_0x043d('0x6')][_0x043d('0x5')]));}ami[_0x043d('0x10')]=function(){return function(){return ami['Action']({'action':_0x043d('0x11')});};};ami[_0x043d('0x12')]=function(){return function(){return ami[_0x043d('0x9')]({'action':_0x043d('0x13')});};};ami[_0x043d('0x14')]=function(){return function(){return ami[_0x043d('0x9')]({'action':_0x043d('0x15')});};};ami[_0x043d('0x16')]=function(){return function(){return ami[_0x043d('0x9')]({'action':_0x043d('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x043d('0x18')});};};function connect(_0x2fc95a){logger['info'](util[_0x043d('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x043d('0x6')][_0x043d('0x7')],config[_0x043d('0x6')]['ip'],config[_0x043d('0x6')][_0x043d('0x5')]));ami[_0x043d('0x19')](_0x043d('0xc'),error);ami['once'](_0x043d('0x1a'),close);}ami['on'](_0x043d('0x1b'),connect);ami['on'](_0x043d('0x1c'),function(_0x1b60a6){logger[_0x043d('0x1d')](util[_0x043d('0xd')](_0x043d('0x1e'),config[_0x043d('0x6')][_0x043d('0x7')],config[_0x043d('0x6')]['ip'],config[_0x043d('0x6')]['port'],util[_0x043d('0xf')](_0x1b60a6,![],null)));});ami['on'](_0x043d('0x1f'),function(_0x43646a){logger[_0x043d('0x1d')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x043d('0x6')][_0x043d('0x7')],config[_0x043d('0x6')]['ip'],config['asterisk'][_0x043d('0x5')]));return BPromise[_0x043d('0x20')]()['then'](ami['actionSipShowRegistry']())[_0x043d('0x21')](ami[_0x043d('0x12')]())[_0x043d('0x21')](ami['actionSipPeerStatus']())[_0x043d('0x21')](ami[_0x043d('0x16')]())[_0x043d('0x21')](ami[_0x043d('0x22')]())[_0x043d('0x23')](function(_0x5ee065){console[_0x043d('0x24')](_0x5ee065);});});ami['once']('error',error);ami[_0x043d('0x19')](_0x043d('0x1a'),close);module[_0x043d('0x25')]=ami; \ No newline at end of file +var _0x750a=['moment','util','../../config/logger','ami','asterisk','username','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','asterisk-manager','bluebird'];(function(_0x13c9c4,_0x96ed68){var _0x30a191=function(_0x2e3d04){while(--_0x2e3d04){_0x13c9c4['push'](_0x13c9c4['shift']());}};_0x30a191(++_0x96ed68);}(_0x750a,0x1df));var _0xa750=function(_0x1974c0,_0x361d0a){_0x1974c0=_0x1974c0-0x0;var _0x24918b=_0x750a[_0x1974c0];return _0x24918b;};'use strict';var Manager=require(_0xa750('0x0'));var BPromise=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var util=require(_0xa750('0x3'));var _=require('lodash');var logger=require(_0xa750('0x4'))(_0xa750('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xa750('0x6')]['port'],config[_0xa750('0x6')]['ip'],config['asterisk'][_0xa750('0x7')],config[_0xa750('0x6')]['password'],!![]);ami[_0xa750('0x8')]();ami['Action']=BPromise[_0xa750('0x9')](ami[_0xa750('0xa')]);function error(_0x401fd6){logger[_0xa750('0xb')](util[_0xa750('0xc')](_0xa750('0xd'),config[_0xa750('0x6')][_0xa750('0x7')],config[_0xa750('0x6')]['ip'],config[_0xa750('0x6')][_0xa750('0xe')],util['inspect'](_0x401fd6,![],null)));}function close(){logger[_0xa750('0xb')](util[_0xa750('0xc')](_0xa750('0xf'),config[_0xa750('0x6')][_0xa750('0x7')],config['asterisk']['ip'],config[_0xa750('0x6')][_0xa750('0xe')]));}ami[_0xa750('0x10')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x12')});};};ami[_0xa750('0x13')]=function(){return function(){return ami[_0xa750('0x11')]({'action':'devicestatelist'});};};ami[_0xa750('0x14')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x15')});};};ami[_0xa750('0x16')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x17')});};};ami[_0xa750('0x18')]=function(){return function(){return ami['Action']({'action':_0xa750('0x19')});};};function connect(_0x5ae460){logger[_0xa750('0x1a')](util[_0xa750('0xc')](_0xa750('0x1b'),config[_0xa750('0x6')]['username'],config['asterisk']['ip'],config[_0xa750('0x6')]['port']));ami[_0xa750('0x1c')](_0xa750('0xb'),error);ami[_0xa750('0x1c')](_0xa750('0x1d'),close);}ami['on']('connect',connect);ami['on'](_0xa750('0x1e'),function(_0x1260ce){logger['info'](util['format'](_0xa750('0x1f'),config[_0xa750('0x6')]['username'],config[_0xa750('0x6')]['ip'],config[_0xa750('0x6')][_0xa750('0xe')],util['inspect'](_0x1260ce,![],null)));});ami['on'](_0xa750('0x20'),function(_0x41848a){logger[_0xa750('0x1a')](util[_0xa750('0xc')](_0xa750('0x21'),config[_0xa750('0x6')][_0xa750('0x7')],config[_0xa750('0x6')]['ip'],config['asterisk']['port']));return BPromise['resolve']()[_0xa750('0x22')](ami[_0xa750('0x10')]())[_0xa750('0x22')](ami['actionDeviceStateList']())[_0xa750('0x22')](ami[_0xa750('0x14')]())['then'](ami[_0xa750('0x16')]())['then'](ami[_0xa750('0x18')]())[_0xa750('0x23')](function(_0x21ae61){console[_0xa750('0x24')](_0x21ae61);});});ami['once'](_0xa750('0xb'),error);ami[_0xa750('0x1c')](_0xa750('0x1d'),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 cb7a214..22cf49b 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 _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x20dcbc,_0x39d7cf){var _0x5c16e4=function(_0x333467){while(--_0x333467){_0x20dcbc['push'](_0x20dcbc['shift']());}};_0x5c16e4(++_0x39d7cf);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xcb91[_0x258b93];return _0x35484b;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 44fb807..8cc5cde 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2cd=['isNil','voiceQueue','name','phone','Contact','firstName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','substring','getQueue','exports','lodash','moment','string'];(function(_0x1fe188,_0x11e1df){var _0x1b3e93=function(_0x5203a4){while(--_0x5203a4){_0x1fe188['push'](_0x1fe188['shift']());}};_0x1b3e93(++_0x11e1df);}(_0xb2cd,0x99));var _0xdb2c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb2cd[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var _=require(_0xdb2c('0x0'));var moment=require(_0xdb2c('0x1'));function checkNameSurname(_0x151c97,_0x230d90,_0x4bbcd2){var _0x1d65e0='';if(!_['isNil'](_0x230d90)&&_0xdb2c('0x2')===typeof _0x230d90){_0x1d65e0+=_0x230d90;}if(!_[_0xdb2c('0x3')](_0x4bbcd2)&&_0xdb2c('0x2')===typeof _0x4bbcd2){_0x1d65e0+='\x20'+_0x4bbcd2;}if(_0x1d65e0!==''){return _0x1d65e0;}return _0x151c97;}function Action(_0x424f6e,_0x5641ec,_0xd8bd24){this[_0xdb2c('0x4')]=_0x424f6e;this['uniqueid']=_0xd8bd24||undefined;this[_0xdb2c('0x5')]=checkNameSurname(_0x5641ec['Contact'][_0xdb2c('0x6')],_0x5641ec[_0xdb2c('0x7')][_0xdb2c('0x8')],_0x5641ec[_0xdb2c('0x7')]['lastName']);this[_0xdb2c('0x9')]=_0x5641ec['Contact'][_0xdb2c('0x6')];this[_0xdb2c('0xa')]=_0x424f6e[_0xdb2c('0x5')];this[_0xdb2c('0xb')]=_0x5641ec[_0xdb2c('0xb')]||![];this['type']=_0x424f6e[_0xdb2c('0xc')];this['dialQueueTimeout']=_0x424f6e[_0xdb2c('0xd')]||0x3;this['scheduledat']=_0x5641ec['scheduledat'];this[_0xdb2c('0xe')]=_0x5641ec[_0xdb2c('0xe')];this[_0xdb2c('0xf')]=_0x5641ec['countcongestionretry'];this[_0xdb2c('0x10')]=_0x5641ec[_0xdb2c('0x10')];this[_0xdb2c('0x11')]=_0x5641ec[_0xdb2c('0x11')];this[_0xdb2c('0x12')]=_0x5641ec[_0xdb2c('0x12')];this[_0xdb2c('0x13')]=_0x5641ec['countabandonedretry'];this[_0xdb2c('0x14')]=_0x5641ec['countmachineretry'];this[_0xdb2c('0x15')]=_0x5641ec[_0xdb2c('0x15')];this['ContactId']=_0x5641ec['ContactId'];this[_0xdb2c('0x16')]=_0x5641ec[_0xdb2c('0x16')];this[_0xdb2c('0x17')]=_0x5641ec[_0xdb2c('0x17')];this['VoiceQueueId']=_0x5641ec[_0xdb2c('0x18')];this[_0xdb2c('0x19')]=_0x5641ec[_0xdb2c('0x19')];this['idHopper']=_0x5641ec['id'];this[_0xdb2c('0x1a')]=_0x5641ec[_0xdb2c('0x7')]['firstName']||'';this['starttime']=moment()[_0xdb2c('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5641ec[_0xdb2c('0x1c')];this['callbackuniqueid']=_0x5641ec[_0xdb2c('0x1d')];this['callbackat']=_0x5641ec[_0xdb2c('0x1e')];this[_0xdb2c('0x1f')]=_0x5641ec[_0xdb2c('0x1f')];this[_0xdb2c('0x20')]='';this[_0xdb2c('0x21')]='';}Action['prototype'][_0xdb2c('0x22')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this[_0xdb2c('0x4')][_0xdb2c('0x23')]>0x0?this[_0xdb2c('0x9')][_0xdb2c('0x24')](this[_0xdb2c('0x4')]['dialCutDigit']):this[_0xdb2c('0x9')]);};Action['prototype'][_0xdb2c('0x25')]=function(){return this['queue'];};module[_0xdb2c('0x26')]=Action; \ No newline at end of file +var _0xd875=['lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xd875,0x1a6));var _0x5d87=function(_0x5bdaf0,_0x287d94){_0x5bdaf0=_0x5bdaf0-0x0;var _0x326399=_0xd875[_0x5bdaf0];return _0x326399;};'use strict';var util=require(_0x5d87('0x0'));var _=require(_0x5d87('0x1'));var moment=require(_0x5d87('0x2'));function checkNameSurname(_0x2a16c4,_0x20877d,_0x3d2c7b){var _0xb33d72='';if(!_[_0x5d87('0x3')](_0x20877d)&&_0x5d87('0x4')===typeof _0x20877d){_0xb33d72+=_0x20877d;}if(!_['isNil'](_0x3d2c7b)&&_0x5d87('0x4')===typeof _0x3d2c7b){_0xb33d72+='\x20'+_0x3d2c7b;}if(_0xb33d72!==''){return _0xb33d72;}return _0x2a16c4;}function Action(_0x3a3beb,_0x62e53,_0x162847){this[_0x5d87('0x5')]=_0x3a3beb;this[_0x5d87('0x6')]=_0x162847||undefined;this[_0x5d87('0x7')]=checkNameSurname(_0x62e53['Contact'][_0x5d87('0x8')],_0x62e53[_0x5d87('0x9')][_0x5d87('0xa')],_0x62e53['Contact'][_0x5d87('0xb')]);this[_0x5d87('0xc')]=_0x62e53[_0x5d87('0x9')][_0x5d87('0x8')];this['queue']=_0x3a3beb[_0x5d87('0x7')];this[_0x5d87('0xd')]=_0x62e53[_0x5d87('0xd')]||![];this[_0x5d87('0xe')]=_0x3a3beb['type'];this[_0x5d87('0xf')]=_0x3a3beb[_0x5d87('0xf')]||0x3;this[_0x5d87('0x10')]=_0x62e53[_0x5d87('0x10')];this[_0x5d87('0x11')]=_0x62e53[_0x5d87('0x11')];this[_0x5d87('0x12')]=_0x62e53[_0x5d87('0x12')];this['countnoanswerretry']=_0x62e53[_0x5d87('0x13')];this[_0x5d87('0x14')]=_0x62e53[_0x5d87('0x14')];this[_0x5d87('0x15')]=_0x62e53[_0x5d87('0x15')];this[_0x5d87('0x16')]=_0x62e53[_0x5d87('0x16')];this[_0x5d87('0x17')]=_0x62e53['countmachineretry'];this['countagentrejectretry']=_0x62e53['countagentrejectretry'];this[_0x5d87('0x18')]=_0x62e53['ContactId'];this[_0x5d87('0x19')]=_0x62e53[_0x5d87('0x19')];this[_0x5d87('0x1a')]=_0x62e53[_0x5d87('0x1a')];this[_0x5d87('0x1b')]=_0x62e53[_0x5d87('0x1b')];this['CampaignId']=_0x62e53[_0x5d87('0x1c')];this[_0x5d87('0x1d')]=_0x62e53['id'];this[_0x5d87('0x1e')]=_0x62e53[_0x5d87('0x9')][_0x5d87('0xa')]||'';this[_0x5d87('0x1f')]=moment()[_0x5d87('0x20')](_0x5d87('0x21'));this[_0x5d87('0x22')]=_0x62e53['callback'];this[_0x5d87('0x23')]=_0x62e53[_0x5d87('0x23')];this[_0x5d87('0x24')]=_0x62e53[_0x5d87('0x24')];this[_0x5d87('0x25')]=_0x62e53[_0x5d87('0x25')];this['originatecalleridnum']='';this[_0x5d87('0x26')]='';}Action[_0x5d87('0x27')][_0x5d87('0x28')]=function(){return util[_0x5d87('0x20')](_0x5d87('0x29'),this[_0x5d87('0x7')],this[_0x5d87('0x5')][_0x5d87('0x2a')]>0x0?this['number'][_0x5d87('0x2b')](this['voiceQueue'][_0x5d87('0x2a')]):this[_0x5d87('0xc')]);};Action[_0x5d87('0x27')][_0x5d87('0x2c')]=function(){return this[_0x5d87('0x2d')];};module[_0x5d87('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 92ccd4d..ad8e082 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7999=['countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','starttime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x26d6d9,_0xd1d2c6){var _0x288bae=function(_0x13f026){while(--_0x13f026){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x288bae(++_0xd1d2c6);}(_0x7999,0x9a));var _0x9799=function(_0x44c780,_0x5316d5){_0x44c780=_0x44c780-0x0;var _0xdd8a60=_0x7999[_0x44c780];return _0xdd8a60;};'use strict';var util=require(_0x9799('0x0'));var _=require(_0x9799('0x1'));var moment=require('moment');function getSeconds(_0x475e05,_0x5a7192){var _0x5e9f80=moment(_0x475e05)[_0x9799('0x2')](0x0);var _0x191f5f=moment(_0x5a7192)[_0x9799('0x2')](0x0);return _0x5e9f80[_0x9799('0x3')](_0x191f5f,_0x9799('0x4'));}function AgentComplete(_0x4ee024,_0x1beaa2){this['state']=0x4;this[_0x9799('0x5')]=_0x9799('0x6');this[_0x9799('0x7')]=_0x4ee024[_0x9799('0x7')];this[_0x9799('0x8')]=_0x4ee024[_0x9799('0x8')];this[_0x9799('0x9')]=_0x4ee024[_0x9799('0x8')]===_0x9799('0xa')?_0x9799('0xb'):_0x4ee024[_0x9799('0x8')];this[_0x9799('0xc')]=_0x4ee024['countbusyretry'];this[_0x9799('0xd')]=_0x4ee024[_0x9799('0xd')];this['countnoanswerretry']=_0x4ee024['countnoanswerretry'];this['countglobal']=_0x4ee024[_0x9799('0xc')]+_0x4ee024[_0x9799('0xd')]+_0x4ee024[_0x9799('0xe')]+_0x4ee024['countnosuchnumberretry']+_0x4ee024[_0x9799('0xf')]+_0x4ee024[_0x9799('0x10')]+_0x4ee024[_0x9799('0x11')]+_0x4ee024['countagentrejectretry'];this[_0x9799('0x12')]=_0x4ee024[_0x9799('0x12')];this[_0x9799('0xf')]=_0x4ee024[_0x9799('0xf')];this['countabandonedretry']=_0x4ee024[_0x9799('0x10')];this['countmachineretry']=_0x4ee024[_0x9799('0x11')];this[_0x9799('0x13')]=_0x4ee024['countagentrejectretry'];this['uniqueid']=_0x1beaa2[_0x9799('0x14')];this[_0x9799('0x15')]=_0x4ee024[_0x9799('0x16')];this[_0x9799('0x17')]=_0x4ee024['number'];this['starttime']=_0x4ee024['starttime'];this[_0x9799('0x18')]=_0x4ee024['responsetime'];this[_0x9799('0x19')]=_0x4ee024[_0x9799('0x19')];this[_0x9799('0x1a')]=moment()[_0x9799('0x1b')](_0x9799('0x1c'));this['ringtime']=getSeconds(_0x4ee024[_0x9799('0x18')],_0x4ee024[_0x9799('0x1d')]);this['holdtime']=getSeconds(_0x4ee024[_0x9799('0x19')],_0x4ee024[_0x9799('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x4ee024['answertime']);this[_0x9799('0xb')]=_0x1beaa2[_0x9799('0xb')];this[_0x9799('0x1e')]=_0x1beaa2[_0x9799('0x1e')];this[_0x9799('0x1f')]=_0x1beaa2['reason'];this[_0x9799('0x20')]=_0x4ee024['callback'];this[_0x9799('0x21')]=_0x4ee024['callbackuniqueid'];this['callbackat']=_0x4ee024[_0x9799('0x22')];this[_0x9799('0x23')]=_0x4ee024[_0x9799('0x23')];this[_0x9799('0x24')]=_0x4ee024[_0x9799('0x24')];this[_0x9799('0x25')]=_0x4ee024[_0x9799('0x25')];this[_0x9799('0x26')]=_0x4ee024[_0x9799('0x26')];this[_0x9799('0x27')]=_0x4ee024['VoiceQueueId'];this[_0x9799('0x28')]=_0x4ee024['CampaignId'];this[_0x9799('0x29')]=_0x4ee024['originatecalleridnum']||'';this['originatecalleridname']=_0x4ee024['originatecalleridname']||'';}module[_0x9799('0x2a')]=AgentComplete; \ No newline at end of file +var _0xa72c=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x133ae7,_0x31bfd9){var _0x48677e=function(_0xc8bcc){while(--_0xc8bcc){_0x133ae7['push'](_0x133ae7['shift']());}};_0x48677e(++_0x31bfd9);}(_0xa72c,0x9b));var _0xca72=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa72c[_0x565c49];return _0x20ca34;};'use strict';var util=require(_0xca72('0x0'));var _=require(_0xca72('0x1'));var moment=require('moment');function getSeconds(_0x2539d9,_0x3582af){var _0x22134=moment(_0x2539d9)['milliseconds'](0x0);var _0x219c7e=moment(_0x3582af)[_0xca72('0x2')](0x0);return _0x22134[_0xca72('0x3')](_0x219c7e,'seconds');}function AgentComplete(_0x5b480a,_0x370499){this[_0xca72('0x4')]=0x4;this[_0xca72('0x5')]='Answer';this[_0xca72('0x6')]=_0x5b480a[_0xca72('0x6')];this[_0xca72('0x7')]=_0x5b480a[_0xca72('0x7')];this[_0xca72('0x8')]=_0x5b480a['type']===_0xca72('0x9')?_0xca72('0xa'):_0x5b480a[_0xca72('0x7')];this[_0xca72('0xb')]=_0x5b480a[_0xca72('0xb')];this[_0xca72('0xc')]=_0x5b480a[_0xca72('0xc')];this[_0xca72('0xd')]=_0x5b480a[_0xca72('0xd')];this[_0xca72('0xe')]=_0x5b480a[_0xca72('0xb')]+_0x5b480a[_0xca72('0xc')]+_0x5b480a[_0xca72('0xd')]+_0x5b480a[_0xca72('0xf')]+_0x5b480a[_0xca72('0x10')]+_0x5b480a[_0xca72('0x11')]+_0x5b480a[_0xca72('0x12')]+_0x5b480a[_0xca72('0x13')];this[_0xca72('0xf')]=_0x5b480a[_0xca72('0xf')];this[_0xca72('0x10')]=_0x5b480a['countdropretry'];this[_0xca72('0x11')]=_0x5b480a['countabandonedretry'];this['countmachineretry']=_0x5b480a['countmachineretry'];this['countagentrejectretry']=_0x5b480a[_0xca72('0x13')];this[_0xca72('0x14')]=_0x370499['uniqueid'];this[_0xca72('0x15')]=_0x5b480a[_0xca72('0x16')];this['calleridnum']=_0x5b480a['number'];this['starttime']=_0x5b480a[_0xca72('0x17')];this[_0xca72('0x18')]=_0x5b480a[_0xca72('0x18')];this[_0xca72('0x19')]=_0x5b480a[_0xca72('0x19')];this[_0xca72('0x1a')]=moment()[_0xca72('0x1b')](_0xca72('0x1c'));this[_0xca72('0x1d')]=getSeconds(_0x5b480a[_0xca72('0x18')],_0x5b480a['starttime']);this[_0xca72('0x1e')]=getSeconds(_0x5b480a[_0xca72('0x19')],_0x5b480a[_0xca72('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x5b480a[_0xca72('0x19')]);this[_0xca72('0xa')]=_0x370499[_0xca72('0xa')];this[_0xca72('0x1f')]=_0x370499[_0xca72('0x1f')];this[_0xca72('0x20')]=_0x370499[_0xca72('0x20')];this['callback']=_0x5b480a['callback'];this[_0xca72('0x21')]=_0x5b480a[_0xca72('0x21')];this[_0xca72('0x22')]=_0x5b480a[_0xca72('0x22')];this[_0xca72('0x23')]=_0x5b480a[_0xca72('0x23')];this['ContactId']=_0x5b480a[_0xca72('0x24')];this[_0xca72('0x25')]=_0x5b480a[_0xca72('0x25')];this[_0xca72('0x26')]=_0x5b480a[_0xca72('0x26')];this[_0xca72('0x27')]=_0x5b480a[_0xca72('0x27')];this[_0xca72('0x28')]=_0x5b480a[_0xca72('0x28')];this['originatecalleridnum']=_0x5b480a[_0xca72('0x29')]||'';this['originatecalleridname']=_0x5b480a['originatecalleridname']||'';}module[_0xca72('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 2a30539..04f302d 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fda=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x552ba9,_0x3478e9){var _0x3e8173=function(_0x1d4118){while(--_0x1d4118){_0x552ba9['push'](_0x552ba9['shift']());}};_0x3e8173(++_0x3478e9);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x5d7ca7,_0x3fe356){_0x5d7ca7=_0x5d7ca7-0x0;var _0x582c8d=_0x0fda[_0x5d7ca7];return _0x582c8d;};'use strict';var util=require(_0xa0fd('0x0'));var _=require('lodash');var moment=require(_0xa0fd('0x1'));function getSeconds(_0x28e34c,_0x314a1a){var _0x2f71f3=moment(_0x28e34c)[_0xa0fd('0x2')](0x0);var _0xd8e73a=moment(_0x314a1a)[_0xa0fd('0x2')](0x0);return _0x2f71f3['diff'](_0xd8e73a,'seconds');}function Final(_0x65fa5d){this['uniqueid']=_0x65fa5d['uniqueid'];this[_0xa0fd('0x3')]=_0x65fa5d[_0xa0fd('0x3')];this[_0xa0fd('0x4')]=_0x65fa5d[_0xa0fd('0x4')];this['campaigntype']=_0x65fa5d[_0xa0fd('0x4')]===_0xa0fd('0x5')?_0xa0fd('0x6'):_0x65fa5d[_0xa0fd('0x4')];this['countbusyretry']=_0x65fa5d[_0xa0fd('0x7')];this[_0xa0fd('0x8')]=_0x65fa5d[_0xa0fd('0x8')];this['countnoanswerretry']=_0x65fa5d[_0xa0fd('0x9')];this[_0xa0fd('0xa')]=_0x65fa5d[_0xa0fd('0x7')]+_0x65fa5d[_0xa0fd('0x8')]+_0x65fa5d[_0xa0fd('0x9')]+_0x65fa5d['countnosuchnumberretry']+_0x65fa5d['countdropretry']+_0x65fa5d[_0xa0fd('0xb')]+_0x65fa5d[_0xa0fd('0xc')]+_0x65fa5d['countagentrejectretry'];this[_0xa0fd('0xd')]=_0x65fa5d[_0xa0fd('0xd')];this[_0xa0fd('0xe')]=_0x65fa5d[_0xa0fd('0xe')];this[_0xa0fd('0xb')]=_0x65fa5d[_0xa0fd('0xb')];this[_0xa0fd('0xc')]=_0x65fa5d['countmachineretry'];this[_0xa0fd('0xf')]=_0x65fa5d[_0xa0fd('0xf')];this['queue']=_0x65fa5d['queue'];this[_0xa0fd('0x10')]=_0x65fa5d[_0xa0fd('0x10')];this['calleridnum']=_0x65fa5d[_0xa0fd('0x11')];this[_0xa0fd('0x12')]=_0x65fa5d[_0xa0fd('0x12')];this['responsetime']=_0x65fa5d['responsetime'];this[_0xa0fd('0x13')]=_0x65fa5d['responsetime'];this[_0xa0fd('0x14')]=_0x65fa5d[_0xa0fd('0x14')]||0x0;this[_0xa0fd('0x15')]=_0x65fa5d[_0xa0fd('0x15')]||0x0;this[_0xa0fd('0x16')]=_0x65fa5d[_0xa0fd('0x16')]||0x0;this[_0xa0fd('0x17')]=_0x65fa5d['callback'];this[_0xa0fd('0x18')]=_0x65fa5d[_0xa0fd('0x18')];this[_0xa0fd('0x19')]=_0x65fa5d[_0xa0fd('0x19')];this[_0xa0fd('0x1a')]=_0x65fa5d[_0xa0fd('0x1a')];this[_0xa0fd('0x1b')]=_0x65fa5d[_0xa0fd('0x1b')];this[_0xa0fd('0x1c')]=_0x65fa5d[_0xa0fd('0x1c')];this[_0xa0fd('0x1d')]=_0x65fa5d[_0xa0fd('0x1d')];this[_0xa0fd('0x1e')]=_0x65fa5d['VoiceQueueId'];this[_0xa0fd('0x1f')]=_0x65fa5d[_0xa0fd('0x1f')];this['originatecalleridnum']=_0x65fa5d[_0xa0fd('0x20')]||'';this[_0xa0fd('0x21')]=_0x65fa5d['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x7f42=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','uniqueid'];(function(_0xeadc11,_0x27e378){var _0x4257b6=function(_0x38bb40){while(--_0x38bb40){_0xeadc11['push'](_0xeadc11['shift']());}};_0x4257b6(++_0x27e378);}(_0x7f42,0x1dd));var _0x27f4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7f42[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x27f4('0x0'));var _=require('lodash');var moment=require(_0x27f4('0x1'));function getSeconds(_0xd1035c,_0x48e553){var _0x66342a=moment(_0xd1035c)['milliseconds'](0x0);var _0x10627e=moment(_0x48e553)['milliseconds'](0x0);return _0x66342a[_0x27f4('0x2')](_0x10627e,'seconds');}function Final(_0xe8eabe){this['uniqueid']=_0xe8eabe[_0x27f4('0x3')];this[_0x27f4('0x4')]=_0xe8eabe[_0x27f4('0x4')];this[_0x27f4('0x5')]=_0xe8eabe[_0x27f4('0x5')];this[_0x27f4('0x6')]=_0xe8eabe[_0x27f4('0x5')]===_0x27f4('0x7')?_0x27f4('0x8'):_0xe8eabe[_0x27f4('0x5')];this[_0x27f4('0x9')]=_0xe8eabe[_0x27f4('0x9')];this[_0x27f4('0xa')]=_0xe8eabe[_0x27f4('0xa')];this[_0x27f4('0xb')]=_0xe8eabe[_0x27f4('0xb')];this[_0x27f4('0xc')]=_0xe8eabe[_0x27f4('0x9')]+_0xe8eabe['countcongestionretry']+_0xe8eabe['countnoanswerretry']+_0xe8eabe[_0x27f4('0xd')]+_0xe8eabe[_0x27f4('0xe')]+_0xe8eabe[_0x27f4('0xf')]+_0xe8eabe[_0x27f4('0x10')]+_0xe8eabe[_0x27f4('0x11')];this[_0x27f4('0xd')]=_0xe8eabe[_0x27f4('0xd')];this[_0x27f4('0xe')]=_0xe8eabe['countdropretry'];this['countabandonedretry']=_0xe8eabe[_0x27f4('0xf')];this[_0x27f4('0x10')]=_0xe8eabe[_0x27f4('0x10')];this[_0x27f4('0x11')]=_0xe8eabe['countagentrejectretry'];this[_0x27f4('0x8')]=_0xe8eabe[_0x27f4('0x8')];this[_0x27f4('0x12')]=_0xe8eabe['calleridname'];this[_0x27f4('0x13')]=_0xe8eabe[_0x27f4('0x13')];this[_0x27f4('0x14')]=_0xe8eabe['starttime'];this[_0x27f4('0x15')]=_0xe8eabe[_0x27f4('0x15')];this['endtime']=_0xe8eabe['responsetime'];this[_0x27f4('0x16')]=_0xe8eabe[_0x27f4('0x16')]||0x0;this[_0x27f4('0x17')]=_0xe8eabe[_0x27f4('0x17')]||0x0;this[_0x27f4('0x18')]=_0xe8eabe[_0x27f4('0x18')]||0x0;this[_0x27f4('0x19')]=_0xe8eabe[_0x27f4('0x19')];this[_0x27f4('0x1a')]=_0xe8eabe[_0x27f4('0x1a')];this[_0x27f4('0x1b')]=_0xe8eabe[_0x27f4('0x1b')];this[_0x27f4('0x1c')]=_0xe8eabe[_0x27f4('0x1c')];this[_0x27f4('0x1d')]=_0xe8eabe['ContactId'];this[_0x27f4('0x1e')]=_0xe8eabe[_0x27f4('0x1e')];this[_0x27f4('0x1f')]=_0xe8eabe[_0x27f4('0x1f')];this[_0x27f4('0x20')]=_0xe8eabe[_0x27f4('0x20')];this[_0x27f4('0x21')]=_0xe8eabe[_0x27f4('0x21')];this[_0x27f4('0x22')]=_0xe8eabe[_0x27f4('0x22')]||'';this[_0x27f4('0x23')]=_0xe8eabe[_0x27f4('0x23')]||'';}module[_0x27f4('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 72b83e4..3088538 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1234=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','state','Answer','scheduledat','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','number','starttime','responsetime'];(function(_0x58607f,_0x582474){var _0x588866=function(_0x3f8f10){while(--_0x3f8f10){_0x58607f['push'](_0x58607f['shift']());}};_0x588866(++_0x582474);}(_0x1234,0x151));var _0x4123=function(_0x53ba3e,_0x37c1a0){_0x53ba3e=_0x53ba3e-0x0;var _0x129b83=_0x1234[_0x53ba3e];return _0x129b83;};'use strict';var util=require(_0x4123('0x0'));var _=require(_0x4123('0x1'));var moment=require(_0x4123('0x2'));function getSeconds(_0x5d057d,_0x2e149a){var _0x5a59bd=moment(_0x5d057d)['milliseconds'](0x0);var _0x109499=moment(_0x2e149a)[_0x4123('0x3')](0x0);return _0x5a59bd['diff'](_0x109499,'seconds');}function Hangup(_0x20bdb6,_0xcfcb5d){this[_0x4123('0x4')]=0x4;this['statedesc']=_0x4123('0x5');this[_0x4123('0x6')]=_0x20bdb6[_0x4123('0x6')];this['type']=_0x20bdb6['type'];this['campaigntype']=_0x20bdb6['type']===_0x4123('0x7')?_0x4123('0x8'):_0x20bdb6[_0x4123('0x9')];this[_0x4123('0xa')]=_0x20bdb6[_0x4123('0xa')];this['countcongestionretry']=_0x20bdb6[_0x4123('0xb')];this['countnoanswerretry']=_0x20bdb6['countnoanswerretry'];this['countglobal']=_0x20bdb6['countbusyretry']+_0x20bdb6[_0x4123('0xb')]+_0x20bdb6[_0x4123('0xc')]+_0x20bdb6[_0x4123('0xd')]+_0x20bdb6[_0x4123('0xe')]+_0x20bdb6['countabandonedretry']+_0x20bdb6[_0x4123('0xf')]+_0x20bdb6[_0x4123('0x10')];this[_0x4123('0xd')]=_0x20bdb6[_0x4123('0xd')];this[_0x4123('0xe')]=_0x20bdb6['countdropretry'];this[_0x4123('0x11')]=_0x20bdb6[_0x4123('0x11')];this[_0x4123('0xf')]=_0x20bdb6[_0x4123('0xf')];this['countagentrejectretry']=_0x20bdb6[_0x4123('0x10')];this['uniqueid']=_0xcfcb5d[_0x4123('0x12')];this['calleridname']=_0x20bdb6[_0x4123('0x13')];this['calleridnum']=_0x20bdb6[_0x4123('0x14')];this[_0x4123('0x15')]=_0x20bdb6['starttime'];this[_0x4123('0x16')]=_0x20bdb6[_0x4123('0x16')];this[_0x4123('0x17')]=moment()[_0x4123('0x18')](_0x4123('0x19'));this[_0x4123('0x1a')]=getSeconds(_0x20bdb6[_0x4123('0x16')],_0x20bdb6['starttime']);this['holdtime']=0x0;this[_0x4123('0x1b')]=getSeconds(this[_0x4123('0x17')],_0x20bdb6[_0x4123('0x16')]);this[_0x4123('0x8')]=_0x20bdb6[_0x4123('0x8')];this['membername']=_0x4123('0x1c');this[_0x4123('0x1d')]=_0xcfcb5d[_0x4123('0x1e')];this[_0x4123('0x1f')]=_0x20bdb6[_0x4123('0x1f')];this[_0x4123('0x20')]=_0x20bdb6[_0x4123('0x20')];this[_0x4123('0x21')]=_0x20bdb6['callbackat'];this['recallme']=_0x20bdb6[_0x4123('0x22')];this['ContactId']=_0x20bdb6[_0x4123('0x23')];this['ListId']=_0x20bdb6['ListId'];this[_0x4123('0x24')]=_0x20bdb6['UserId'];this['VoiceQueueId']=_0x20bdb6[_0x4123('0x25')];this[_0x4123('0x26')]=_0x20bdb6[_0x4123('0x26')];}module[_0x4123('0x27')]=Hangup; \ No newline at end of file +var _0x10d2=['milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment'];(function(_0x51cb67,_0x377fc0){var _0x3063b5=function(_0x5ad44e){while(--_0x5ad44e){_0x51cb67['push'](_0x51cb67['shift']());}};_0x3063b5(++_0x377fc0);}(_0x10d2,0x1d7));var _0x210d=function(_0x810b62,_0x5e5413){_0x810b62=_0x810b62-0x0;var _0x58571a=_0x10d2[_0x810b62];return _0x58571a;};'use strict';var util=require(_0x210d('0x0'));var _=require('lodash');var moment=require(_0x210d('0x1'));function getSeconds(_0x3c0455,_0x29c4c2){var _0x1f2b58=moment(_0x3c0455)[_0x210d('0x2')](0x0);var _0x17f590=moment(_0x29c4c2)['milliseconds'](0x0);return _0x1f2b58[_0x210d('0x3')](_0x17f590,_0x210d('0x4'));}function Hangup(_0x50ca0b,_0x58aba4){this[_0x210d('0x5')]=0x4;this[_0x210d('0x6')]=_0x210d('0x7');this[_0x210d('0x8')]=_0x50ca0b[_0x210d('0x8')];this[_0x210d('0x9')]=_0x50ca0b[_0x210d('0x9')];this[_0x210d('0xa')]=_0x50ca0b['type']===_0x210d('0xb')?_0x210d('0xc'):_0x50ca0b[_0x210d('0x9')];this[_0x210d('0xd')]=_0x50ca0b[_0x210d('0xd')];this[_0x210d('0xe')]=_0x50ca0b[_0x210d('0xe')];this['countnoanswerretry']=_0x50ca0b['countnoanswerretry'];this['countglobal']=_0x50ca0b[_0x210d('0xd')]+_0x50ca0b[_0x210d('0xe')]+_0x50ca0b['countnoanswerretry']+_0x50ca0b['countnosuchnumberretry']+_0x50ca0b[_0x210d('0xf')]+_0x50ca0b[_0x210d('0x10')]+_0x50ca0b[_0x210d('0x11')]+_0x50ca0b[_0x210d('0x12')];this[_0x210d('0x13')]=_0x50ca0b[_0x210d('0x13')];this[_0x210d('0xf')]=_0x50ca0b[_0x210d('0xf')];this[_0x210d('0x10')]=_0x50ca0b[_0x210d('0x10')];this['countmachineretry']=_0x50ca0b[_0x210d('0x11')];this[_0x210d('0x12')]=_0x50ca0b[_0x210d('0x12')];this[_0x210d('0x14')]=_0x58aba4[_0x210d('0x14')];this[_0x210d('0x15')]=_0x50ca0b[_0x210d('0x16')];this[_0x210d('0x17')]=_0x50ca0b[_0x210d('0x18')];this[_0x210d('0x19')]=_0x50ca0b[_0x210d('0x19')];this[_0x210d('0x1a')]=_0x50ca0b[_0x210d('0x1a')];this[_0x210d('0x1b')]=moment()[_0x210d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x50ca0b[_0x210d('0x1a')],_0x50ca0b[_0x210d('0x19')]);this[_0x210d('0x1d')]=0x0;this[_0x210d('0x1e')]=getSeconds(this['endtime'],_0x50ca0b[_0x210d('0x1a')]);this[_0x210d('0xc')]=_0x50ca0b[_0x210d('0xc')];this[_0x210d('0x1f')]=_0x210d('0x20');this['reason']=_0x58aba4['cause-txt'];this[_0x210d('0x21')]=_0x50ca0b[_0x210d('0x21')];this[_0x210d('0x22')]=_0x50ca0b[_0x210d('0x22')];this[_0x210d('0x23')]=_0x50ca0b[_0x210d('0x23')];this[_0x210d('0x24')]=_0x50ca0b[_0x210d('0x24')];this[_0x210d('0x25')]=_0x50ca0b[_0x210d('0x25')];this['ListId']=_0x50ca0b[_0x210d('0x26')];this['UserId']=_0x50ca0b[_0x210d('0x27')];this[_0x210d('0x28')]=_0x50ca0b['VoiceQueueId'];this['CampaignId']=_0x50ca0b[_0x210d('0x29')];}module[_0x210d('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 7b2710e..a4285cb 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c1c=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue'];(function(_0x225227,_0x43b188){var _0x4f7809=function(_0x15ea16){while(--_0x15ea16){_0x225227['push'](_0x225227['shift']());}};_0x4f7809(++_0x43b188);}(_0x5c1c,0x10d));var _0xc5c1=function(_0xfaeb7b,_0x32c405){_0xfaeb7b=_0xfaeb7b-0x0;var _0x8b24f6=_0x5c1c[_0xfaeb7b];return _0x8b24f6;};'use strict';var util=require(_0xc5c1('0x0'));var _=require(_0xc5c1('0x1'));var moment=require(_0xc5c1('0x2'));function getSeconds(_0x4e674d,_0x3dc2f1){var _0x329112=moment(_0x4e674d)[_0xc5c1('0x3')](0x0);var _0x25cff3=moment(_0x3dc2f1)[_0xc5c1('0x3')](0x0);return _0x329112[_0xc5c1('0x4')](_0x25cff3,_0xc5c1('0x5'));}function History(_0x367f60){this[_0xc5c1('0x6')]=_0x367f60['uniqueid'];this[_0xc5c1('0x7')]=_0x367f60[_0xc5c1('0x7')]||undefined;this['type']=_0x367f60[_0xc5c1('0x8')];this[_0xc5c1('0x9')]=_0x367f60[_0xc5c1('0x8')]==='outbound'?_0xc5c1('0xa'):_0x367f60[_0xc5c1('0x8')];this[_0xc5c1('0xb')]=_0x367f60[_0xc5c1('0xb')];this[_0xc5c1('0xc')]=_0x367f60[_0xc5c1('0xc')];this[_0xc5c1('0xd')]=_0x367f60[_0xc5c1('0xd')];this['countglobal']=_0x367f60['countbusyretry']+_0x367f60[_0xc5c1('0xc')]+_0x367f60[_0xc5c1('0xd')]+_0x367f60[_0xc5c1('0xe')]+_0x367f60[_0xc5c1('0xf')]+_0x367f60['countabandonedretry']+_0x367f60[_0xc5c1('0x10')]+_0x367f60[_0xc5c1('0x11')];this[_0xc5c1('0xe')]=_0x367f60[_0xc5c1('0xe')];this[_0xc5c1('0xf')]=_0x367f60[_0xc5c1('0xf')];this[_0xc5c1('0x12')]=_0x367f60[_0xc5c1('0x12')];this[_0xc5c1('0x10')]=_0x367f60[_0xc5c1('0x10')];this[_0xc5c1('0x11')]=_0x367f60[_0xc5c1('0x11')];this[_0xc5c1('0xa')]=_0x367f60[_0xc5c1('0xa')];this[_0xc5c1('0x13')]=_0x367f60[_0xc5c1('0x14')];this['calleridnum']=_0x367f60[_0xc5c1('0x15')];this[_0xc5c1('0x16')]=_0x367f60[_0xc5c1('0x16')];this['responsetime']=_0x367f60['responsetime'];this[_0xc5c1('0x17')]=_0x367f60[_0xc5c1('0x18')];this[_0xc5c1('0x19')]=getSeconds(_0x367f60['responsetime'],_0x367f60['starttime']);this[_0xc5c1('0x1a')]=0x0;this[_0xc5c1('0x1b')]=0x0;this[_0xc5c1('0x1c')]=_0x367f60[_0xc5c1('0x1c')];this[_0xc5c1('0x1d')]=_0x367f60[_0xc5c1('0x1d')];this['callbackat']=_0x367f60[_0xc5c1('0x1e')];this[_0xc5c1('0x1f')]=_0x367f60['recallme'];this[_0xc5c1('0x20')]=_0x367f60[_0xc5c1('0x20')];this['ListId']=_0x367f60[_0xc5c1('0x21')];this[_0xc5c1('0x22')]=_0x367f60[_0xc5c1('0x22')];this[_0xc5c1('0x23')]=_0x367f60[_0xc5c1('0x23')];this[_0xc5c1('0x24')]=_0x367f60[_0xc5c1('0x24')];this[_0xc5c1('0x25')]=_0x367f60[_0xc5c1('0x25')]||'';this[_0xc5c1('0x26')]=_0x367f60['originatecalleridname']||'';}module[_0xc5c1('0x27')]=History; \ No newline at end of file +var _0x0084=['callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0084,0xa1));var _0x4008=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x0084[_0x5b2865];return _0x3cb4c6;};'use strict';var util=require(_0x4008('0x0'));var _=require(_0x4008('0x1'));var moment=require('moment');function getSeconds(_0x12e224,_0x374805){var _0x454a19=moment(_0x12e224)['milliseconds'](0x0);var _0x464c7d=moment(_0x374805)[_0x4008('0x2')](0x0);return _0x454a19[_0x4008('0x3')](_0x464c7d,_0x4008('0x4'));}function History(_0x57fd78){this['uniqueid']=_0x57fd78[_0x4008('0x5')];this[_0x4008('0x6')]=_0x57fd78['scheduledat']||undefined;this[_0x4008('0x7')]=_0x57fd78[_0x4008('0x7')];this[_0x4008('0x8')]=_0x57fd78[_0x4008('0x7')]==='outbound'?_0x4008('0x9'):_0x57fd78[_0x4008('0x7')];this[_0x4008('0xa')]=_0x57fd78[_0x4008('0xa')];this[_0x4008('0xb')]=_0x57fd78[_0x4008('0xb')];this['countnoanswerretry']=_0x57fd78[_0x4008('0xc')];this[_0x4008('0xd')]=_0x57fd78[_0x4008('0xa')]+_0x57fd78[_0x4008('0xb')]+_0x57fd78[_0x4008('0xc')]+_0x57fd78[_0x4008('0xe')]+_0x57fd78[_0x4008('0xf')]+_0x57fd78[_0x4008('0x10')]+_0x57fd78[_0x4008('0x11')]+_0x57fd78[_0x4008('0x12')];this['countnosuchnumberretry']=_0x57fd78[_0x4008('0xe')];this[_0x4008('0xf')]=_0x57fd78[_0x4008('0xf')];this[_0x4008('0x10')]=_0x57fd78[_0x4008('0x10')];this['countmachineretry']=_0x57fd78[_0x4008('0x11')];this['countagentrejectretry']=_0x57fd78[_0x4008('0x12')];this['queue']=_0x57fd78[_0x4008('0x9')];this[_0x4008('0x13')]=_0x57fd78[_0x4008('0x14')];this['calleridnum']=_0x57fd78[_0x4008('0x15')];this[_0x4008('0x16')]=_0x57fd78[_0x4008('0x16')];this[_0x4008('0x17')]=_0x57fd78[_0x4008('0x17')];this[_0x4008('0x18')]=_0x57fd78[_0x4008('0x17')];this[_0x4008('0x19')]=getSeconds(_0x57fd78[_0x4008('0x17')],_0x57fd78[_0x4008('0x16')]);this[_0x4008('0x1a')]=0x0;this[_0x4008('0x1b')]=0x0;this[_0x4008('0x1c')]=_0x57fd78[_0x4008('0x1c')];this['callbackuniqueid']=_0x57fd78[_0x4008('0x1d')];this[_0x4008('0x1e')]=_0x57fd78[_0x4008('0x1e')];this['recallme']=_0x57fd78['recallme'];this[_0x4008('0x1f')]=_0x57fd78[_0x4008('0x1f')];this[_0x4008('0x20')]=_0x57fd78[_0x4008('0x20')];this[_0x4008('0x21')]=_0x57fd78[_0x4008('0x21')];this['VoiceQueueId']=_0x57fd78[_0x4008('0x22')];this['CampaignId']=_0x57fd78[_0x4008('0x23')];this[_0x4008('0x24')]=_0x57fd78[_0x4008('0x24')]||'';this[_0x4008('0x25')]=_0x57fd78[_0x4008('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 086e366..eae4275 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 _0xd84c=['outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','stateinterface','strategy','queueBooked','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','push','Action','command','interval','timezones','content','iftime\x20%s,%s','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','syncCampaigns','[syncCampaigns]','random','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','handlePredictive','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','syncVarSet','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','available','pTalking','sumBillable','sumHoldTime','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','startProgressive','startPredictive','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','stack','inspect','length','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','isNil','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','undefined','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','reachable','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','state','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','dialAMDActive','value','[syncHangupInAMDIvr]','countdropretry','stateGlobal','reason19\x20machine....','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout'];(function(_0x147867,_0x4e22e7){var _0x3acb94=function(_0x5d8282){while(--_0x5d8282){_0x147867['push'](_0x147867['shift']());}};_0x3acb94(++_0x4e22e7);}(_0xd84c,0x102));var _0xcd84=function(_0x5a2da0,_0x10d361){_0x5a2da0=_0x5a2da0-0x0;var _0x510e2b=_0xd84c[_0x5a2da0];return _0x510e2b;};'use strict';var util=require(_0xcd84('0x0'));var _=require(_0xcd84('0x1'));var BPromise=require(_0xcd84('0x2'));var uuid=require(_0xcd84('0x3'));var moment=require(_0xcd84('0x4'));var rr=require('rr');var md5=require(_0xcd84('0x5'));var Redis=require(_0xcd84('0x6'));var ut=require(_0xcd84('0x7'));var config=require(_0xcd84('0x8'));var logger=require('../../../config/logger')(_0xcd84('0x9'));var loggerBooked=require(_0xcd84('0xa'))(_0xcd84('0xb'));var loggerPredictive=require(_0xcd84('0xa'))('predictive');var loggerPredictiveCalls=require(_0xcd84('0xa'))(_0xcd84('0xc'));var loggerSyncQueueSummary=require(_0xcd84('0xa'))('syncQueueSummary');var ami=require(_0xcd84('0xd'));config[_0xcd84('0xe')]=_[_0xcd84('0xf')](config[_0xcd84('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xcd84('0x10'))(new Redis(config[_0xcd84('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xcd84('0x11'));var cmHopperBlack=require(_0xcd84('0x12'));var voiceQueueRt=require(_0xcd84('0x13'));var Action=require('./action');var History=require(_0xcd84('0x14'));var Final=require(_0xcd84('0x15'));var AgentComplete=require(_0xcd84('0x16'));var QueueCallerAbandon=require(_0xcd84('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0xcd84('0x18')][_0xcd84('0x19')]||_0xcd84('0x1a');var strategy={'rrmemory':_0xcd84('0x1b'),'roundrobin':_0xcd84('0x1c')};var Sequence=function(){};Sequence[_0xcd84('0x1d')][_0xcd84('0x1e')]=function(_0x6bd85c){this[_0xcd84('0x1f')]=this[_0xcd84('0x1f')]?this[_0xcd84('0x1f')][_0xcd84('0x20')](_0x6bd85c):_0x6bd85c();};function Dialer(_0x1bd068,_0x1481e6){this[_0xcd84('0x21')]=new Sequence();this[_0xcd84('0x22')]=_0x1481e6;this[_0xcd84('0x23')]=_0x1bd068[_0xcd84('0x23')];this['campaigns']=_0x1bd068[_0xcd84('0x24')];this[_0xcd84('0x25')]=_0x1bd068['agents'];this[_0xcd84('0x26')]=_0x1bd068[_0xcd84('0x26')];this[_0xcd84('0x27')]=config[_0xcd84('0x27')]||0x2;this[_0xcd84('0x28')]={};this['actions']={};this[_0xcd84('0x29')]={};this[_0xcd84('0x2a')]={};this[_0xcd84('0x2b')]={};this['startPredictive']={};this['startProgressive']={};this[_0xcd84('0x2c')]={};this['queueBooked']={};this[_0xcd84('0x2d')]={};ami['on'](_0xcd84('0x2e'),this['syncAgentConnect'][_0xcd84('0x2f')](this));ami['on'](_0xcd84('0x30'),this[_0xcd84('0x31')][_0xcd84('0x2f')](this));ami['on'](_0xcd84('0x32'),this[_0xcd84('0x33')]['bind'](this));ami['on'](_0xcd84('0x34'),this[_0xcd84('0x35')][_0xcd84('0x2f')](this));ami['on'](_0xcd84('0x36'),this[_0xcd84('0x37')][_0xcd84('0x2f')](this));ami['on'](_0xcd84('0x38'),this['syncHangup']['bind'](this));ami['on'](_0xcd84('0x39'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xcd84('0x3a')][_0xcd84('0x2f')](this));ami['on']('queuemember',this[_0xcd84('0x3b')][_0xcd84('0x2f')](this));ami['on'](_0xcd84('0x3c'),this['syncQueueStatusComplete'][_0xcd84('0x2f')](this));this['loopCampaigns']();this[_0xcd84('0x3d')]();}function isNotNull(_0x71d465){return _0x71d465!==null&&!_[_0xcd84('0x3e')](_0x71d465);}function checkIsLoggedIn(_0x30ff6a,_0x42e649){return function(){if(_0x42e649<=0x0){_0x30ff6a[_0xcd84('0x3f')]=_0xcd84('0x40');throw _0x30ff6a[_0xcd84('0x41')]+_0xcd84('0x42');}};}function isActive(_0x1dd142){return _0x1dd142;}function checkIsActive(_0x3e4d13,_0xa544c3){return function(){if(!isActive(_0xa544c3)){_0x3e4d13['message']=_0xcd84('0x43');throw _0x3e4d13[_0xcd84('0x41')]+_0xcd84('0x44');}};}function checkInterval(_0x11a71e){return function(){if(!isNotNull(_0x11a71e['Interval'])){_0x11a71e[_0xcd84('0x3f')]=_0xcd84('0x45');throw _0x11a71e[_0xcd84('0x41')]+_0xcd84('0x46');}if(!isNotNull(_0x11a71e[_0xcd84('0x47')]['Intervals'])){_0x11a71e[_0xcd84('0x3f')]=_0xcd84('0x45');throw _0x11a71e[_0xcd84('0x41')]+_0xcd84('0x46');}if(!isNotNull(_[_0xcd84('0x48')](_0x11a71e[_0xcd84('0x47')][_0xcd84('0x49')]))){_0x11a71e['message']=_0xcd84('0x45');throw _0x11a71e[_0xcd84('0x41')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x112371,_0x59af28,_0x42764c){return{'action':_0x112371,'response':_0x59af28,'message':_0x42764c,'stack':_0x42764c};}function myreject(_0x3f88fe){return function(_0x8b77e4){return _0x3f88fe(msgResponse(_0xcd84('0x4a'),_0xcd84('0x4b'),JSON[_0xcd84('0x4c')](_0x8b77e4)));};}function getSeconds(_0x27d0ac,_0x83f5f4){var _0xd0fa6a=moment(_0x27d0ac)[_0xcd84('0x4d')](0x0);var _0xec4c9a=moment(_0x83f5f4)[_0xcd84('0x4d')](0x0);return _0xd0fa6a[_0xcd84('0x4e')](_0xec4c9a,_0xcd84('0x4f'));}function emit(_0x1447e0,_0x53dd22,_0x3080e1){io['to'](_0x1447e0)['emit'](_0x53dd22,_0x3080e1);}function emitVoiceQueueSummary(_0x47f1c1){if(_0x47f1c1[_0xcd84('0x50')]===_0xcd84('0x51')){var _0x1a8bbb={'id':_0x47f1c1['id'],'name':_0x47f1c1[_0xcd84('0x41')],'strategy':_0x47f1c1['strategy'],'answered':_0x47f1c1['answered'],'available':_0x47f1c1[_0xcd84('0x52')],'loggedIn':_0x47f1c1['loggedIn'],'pTalking':_0x47f1c1[_0xcd84('0x53')],'sumBillable':_0x47f1c1[_0xcd84('0x54')],'sumDuration':_0x47f1c1['sumDuration'],'sumHoldTime':_0x47f1c1[_0xcd84('0x55')]||0x0,'talking':_0x47f1c1['talking'],'total':_0x47f1c1[_0xcd84('0x56')],'type':_0x47f1c1[_0xcd84('0x50')],'unmanaged':_0x47f1c1[_0xcd84('0x57')],'abandoned':_0x47f1c1['abandoned'],'waiting':_0x47f1c1['waiting'],'loggedInDb':_0x47f1c1[_0xcd84('0x58')],'dialActive':_0x47f1c1[_0xcd84('0x59')],'dialMethod':_0x47f1c1[_0xcd84('0x5a')],'dialOriginateCallerIdName':_0x47f1c1[_0xcd84('0x5b')],'dialOriginateCallerIdNumber':_0x47f1c1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x47f1c1[_0xcd84('0x5c')],'dialPrefix':_0x47f1c1[_0xcd84('0x5d')],'outboundAnswerAgiCallsDay':_0x47f1c1[_0xcd84('0x5e')],'outboundAnswerCallsDay':_0x47f1c1[_0xcd84('0x5f')],'outboundBlacklistCallsDay':_0x47f1c1[_0xcd84('0x60')],'outboundBusyCallsDay':_0x47f1c1[_0xcd84('0x61')],'outboundCongestionCallsDay':_0x47f1c1[_0xcd84('0x62')],'outboundDropCallsDayACS':_0x47f1c1[_0xcd84('0x63')],'outboundDropCallsDayCallersExit':_0x47f1c1[_0xcd84('0x64')],'outboundDropCallsDayTimeout':_0x47f1c1['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x47f1c1[_0xcd84('0x65')],'outboundNoSuchCallsDay':_0x47f1c1['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x47f1c1[_0xcd84('0x66')],'outboundReCallsDay':_0x47f1c1['outboundReCallsDay'],'outboundRejectCallsDay':_0x47f1c1[_0xcd84('0x67')],'outboundUnknownCallsDay':_0x47f1c1[_0xcd84('0x68')],'predictiveIntervalAnsweredCalls':_0x47f1c1['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x47f1c1['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x47f1c1[_0xcd84('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x47f1c1[_0xcd84('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x47f1c1[_0xcd84('0x6b')],'predictiveIntervalErlangCalls':_0x47f1c1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x47f1c1['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x47f1c1[_0xcd84('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x47f1c1['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x47f1c1[_0xcd84('0x6d')],'predictiveIntervalAvailable':_0x47f1c1[_0xcd84('0x6e')],'predictiveIntervalTotalCalls':_0x47f1c1['predictiveIntervalTotalCalls'],'message':_0x47f1c1[_0xcd84('0x3f')],'originated':_0x47f1c1[_0xcd84('0x6f')],'erlangCalls':_0x47f1c1['erlangCalls'],'erlangCallToSecond':_0x47f1c1[_0xcd84('0x70')],'erlangAbandonmentRate':_0x47f1c1[_0xcd84('0x71')],'erlangBusyFactor':_0x47f1c1[_0xcd84('0x72')],'startPredictive':_0x47f1c1['startPredictive'],'startProgressive':_0x47f1c1['startProgressive']};if(_0x47f1c1['Trunk']){_0x1a8bbb[_0xcd84('0x73')]={'id':_0x47f1c1[_0xcd84('0x73')]['id'],'name':_0x47f1c1[_0xcd84('0x73')][_0xcd84('0x41')],'active':_0x47f1c1[_0xcd84('0x73')]['active'],'callerid':_0x47f1c1['Trunk'][_0xcd84('0x74')]};}if(_0x47f1c1[_0xcd84('0x47')]){_0x1a8bbb['Interval']={'id':_0x47f1c1['Interval']['id'],'name':_0x47f1c1[_0xcd84('0x47')][_0xcd84('0x41')]};}var _0x1b3ee1=md5(JSON[_0xcd84('0x4c')](_0x1a8bbb));if(_0x47f1c1[_0xcd84('0x5')]!==_0x1b3ee1){_0x47f1c1[_0xcd84('0x5')]=_0x1b3ee1;emit(util[_0xcd84('0x75')](_0xcd84('0x76'),_0x1a8bbb[_0xcd84('0x41')]),_0xcd84('0x77'),_0x1a8bbb);}}}function emitCampaignSummary(_0x3b2cab){if(_0x3b2cab['type']===_0xcd84('0x78')){emit(util['format'](_0xcd84('0x79'),_0x3b2cab['name']),_0xcd84('0x7a'),_0x3b2cab);}}function checkGetDataPredictive(_0x47aeb3){if(isNotNull(_0x47aeb3)&&!_[_0xcd84('0x48')](_0x47aeb3)){loggerPredictive['info'](_0xcd84('0x7b'));loggerPredictive[_0xcd84('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x47aeb3[_0xcd84('0x7d')]);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x7e'),_0x47aeb3['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xcd84('0x7f'),_0x47aeb3[_0xcd84('0x6b')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x47aeb3['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xcd84('0x80'),_0x47aeb3[_0xcd84('0x81')]);loggerPredictive[_0xcd84('0x7c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x47aeb3[_0xcd84('0x69')]);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x82'));if(_0x47aeb3[_0xcd84('0x7d')]>0x0){if(!_[_0xcd84('0x3e')](_0x47aeb3[_0xcd84('0x69')])&&_0x47aeb3[_0xcd84('0x69')]>0x0){return!![];}loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x83'));if(!_[_0xcd84('0x3e')](_0x47aeb3[_0xcd84('0x81')])&&_0x47aeb3[_0xcd84('0x81')]>0x0){return!![];}loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x84'));}else{loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x85'));}}else{loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x86'));}return![];}function mergeDataErlangB(_0x143f9a){return function(_0x5091ee){loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x87'));loggerPredictive[_0xcd84('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5091ee[_0xcd84('0x88')]);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x89'),_0x5091ee[_0xcd84('0x70')]);loggerPredictive[_0xcd84('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5091ee[_0xcd84('0x71')]);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x8a'),_0x5091ee[_0xcd84('0x72')]);loggerPredictive[_0xcd84('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5091ee[_0xcd84('0x71')]);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x82'));_['merge'](_0x143f9a,_0x5091ee);};}function getDiff(_0x11695b){var _0x6a7605=moment()[_0xcd84('0x4d')](0x0);var _0x54b575=moment(_0x11695b)[_0xcd84('0x4d')](0x0);return _0x6a7605['diff'](_0x54b575,_0xcd84('0x4f'));}function ifInterval(_0x683fb9,_0x30e8c7){if(_['isUndefined'](_0x30e8c7)){return![];}return getDiff(_0x30e8c7)<_0x683fb9*0x3c;}function freeVariablesPredictive(_0x28c14b){if(isNotNull(_0x28c14b)){if(!_[_0xcd84('0x3e')](_0x28c14b[_0xcd84('0x8b')])){_0x28c14b[_0xcd84('0x8b')]=undefined;loggerPredictive[_0xcd84('0x7c')](_0x28c14b[_0xcd84('0x41')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x28c14b['startPredictive'])){_0x28c14b[_0xcd84('0x8c')]=undefined;loggerPredictive[_0xcd84('0x7c')](_0x28c14b[_0xcd84('0x41')],_0xcd84('0x8d'));}if(!_[_0xcd84('0x3e')](_0x28c14b['handlePredictive'])){clearInterval(_0x28c14b['handlePredictive']);_0x28c14b['handlePredictive']=undefined;loggerPredictive[_0xcd84('0x7c')](_0x28c14b[_0xcd84('0x41')],_0xcd84('0x8e'));}}}function erlangb(_0x2c95af,_0x112ca5){if(_0x112ca5===0x0){return 0x0;}var _0x5bda52=0x1;for(var _0x520258=0x1;_0x520258<=_0x112ca5;_0x520258+=0x1){_0x5bda52=0x1+_0x5bda52*_0x520258/_0x2c95af;}return 0x1/_0x5bda52;}function isVoiceQueueOutbound(_0xcc39ca){return _0xcc39ca===_0xcd84('0x51');}function isNotPreview(_0x115df1){return _0x115df1!==_0xcd84('0x22');}function isCampaignIvr(_0xb4ff5c){return _0xb4ff5c===_0xcd84('0x78');}function getCallerId(_0x1b8cfb,_0x556e7e,_0x10df94){if(!_[_0xcd84('0x3e')](_0x10df94)&&typeof _0x10df94==='string'&&!_[_0xcd84('0x48')](_0x10df94)){if(!_[_0xcd84('0x3e')](_0x556e7e)&&typeof _0x556e7e==='string'&&!_[_0xcd84('0x48')](_0x556e7e)){return util[_0xcd84('0x75')](_0xcd84('0x8f'),_0x556e7e,_0x10df94);}return util[_0xcd84('0x75')](_0xcd84('0x8f'),_0x10df94,_0x10df94);}if(!_[_0xcd84('0x3e')](_0x1b8cfb)&&typeof _0x1b8cfb===_0xcd84('0x90')&&!_[_0xcd84('0x48')](_0x1b8cfb)){return _0x1b8cfb;}return _0xcd84('0x91');}function loggerCatchQueueSummary(_0x3e11fc,_0x4721f0){return function(_0x1e7944){freeVariablesPredictive(_0x4721f0);emitVoiceQueueSummary(_0x4721f0);emitCampaignSummary(_0x4721f0);loggerSyncQueueSummary[_0xcd84('0x92')](_0x3e11fc,util['inspect'](_0x1e7944,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4b476e,_0x300cf7){return function(_0x273be1){loggerPredictive['error'](_0x300cf7[_0xcd84('0x41')],_0x4b476e);loggerPredictive[_0xcd84('0x92')](_0x273be1[_0xcd84('0x93')]);freeVariablesPredictive(_0x300cf7);};}function loggerCatch(_0x5e2a2a){return function(_0x5cb450){logger['error'](_0x5e2a2a,util[_0xcd84('0x94')](_0x5cb450,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x40d242){return _0x40d242&&!_[_0xcd84('0x3e')](_0x40d242)&&_0x40d242[_0xcd84('0x95')]>0x0;}function decremetOriginate(_0x54fed4){if(!_[_0xcd84('0x3e')](_0x54fed4)&&_0x54fed4!==null){if(typeof _0x54fed4[_0xcd84('0x6f')]!=='undefined'){if(_0x54fed4['originated']>0x0){_0x54fed4['originated']-=0x1;}else{logger[_0xcd84('0x92')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xcd84('0x92')](_0xcd84('0x96'));}}function checkContactLowerLimitOriginate(_0x2db632,_0xd82a0e,_0x3d9a98){if(_0xd82a0e>_0x3d9a98){for(var _0x36a499=0x0;_0x36a499<_0xd82a0e-_0x3d9a98;_0x36a499+=0x1){decremetOriginate(_0x2db632);}}}function loggerGetContactDialer(_0xcf40cb,_0x1208d5,_0x57c747){return function(_0x1e41b0){checkContactLowerLimitOriginate(_0x1208d5,_0x57c747,0x0);logger[_0xcd84('0x92')](_0xcf40cb,util[_0xcd84('0x94')](_0x1e41b0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x202567){return function(_0x3de1f1){if(isNotNull(_0x3de1f1)&&isNotNull(_0x3de1f1[0x0])){if(_0x3de1f1[0x0][_0xcd84('0x97')]>0x0){_0x202567[_0xcd84('0x3f')]=_0xcd84('0x98');logger[_0xcd84('0x7c')](_0xcd84('0x99')+_0x202567[_0xcd84('0x41')],_0x3de1f1[0x0][_0xcd84('0x97')],_0xcd84('0x9a'));}else{_0x202567[_0xcd84('0x3f')]=_0xcd84('0x9b');logger[_0xcd84('0x7c')](_0xcd84('0x9c')+_0x202567[_0xcd84('0x41')]);}}};}function notSendMessagesQueue(_0x590a89){if(_0x590a89['sendMessageOneNotActive']){freeVariablesPredictive(_0x590a89);if(_0x590a89[_0xcd84('0x6f')]===0x0&&_0x590a89[_0xcd84('0x9d')]===0x0&&_0x590a89['waiting']===0x0&&(_0x590a89[_0xcd84('0x53')]||0x0)===0x0){_0x590a89[_0xcd84('0x9e')]=![];_0x590a89[_0xcd84('0x52')]=0x0;_0x590a89[_0xcd84('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xcd84('0x92')](_0xcd84('0x9f'),_0x590a89[_0xcd84('0x41')],_0xcd84('0xa0'));}else{_0x590a89[_0xcd84('0x3f')]=_0xcd84('0xa1');loggerSyncQueueSummary['error'](_0xcd84('0x9f'),_0x590a89['name'],_0xcd84('0xa2'));}emitVoiceQueueSummary(_0x590a89);}}function notSendMessagesCampaign(_0x29d00a){if(_0x29d00a[_0xcd84('0x9e')]){if(_0x29d00a['originated']===0x0){_0x29d00a['sendMessageOneNotActive']=![];_0x29d00a['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xcd84('0x92')](_0xcd84('0xa3'),_0x29d00a[_0xcd84('0x41')],_0xcd84('0xa0'));}else{_0x29d00a[_0xcd84('0x3f')]=_0xcd84('0xa1');loggerSyncQueueSummary[_0xcd84('0x92')](_0xcd84('0xa3'),_0x29d00a[_0xcd84('0x41')],_0xcd84('0xa2'));}emitCampaignSummary(_0x29d00a);}}function createObjHistory(_0x1c2bd8,_0x595f34,_0x2b15b4,_0x1731ce,_0x19fe02){_0x1c2bd8[_0xcd84('0x3f')]=_0x2b15b4;var _0x58dd99=new Action(_0x1c2bd8,_0x595f34);var _0x480b83=new History(_0x58dd99);_0x480b83['state']=_0x1731ce;_0x480b83[_0xcd84('0xa4')]=_0x19fe02;_0x480b83['endtime']=_0x58dd99[_0xcd84('0xa5')];return _0x480b83;}Dialer[_0xcd84('0x1d')][_0xcd84('0x3d')]=function(){var _0x51e8cc=this;setInterval(function(){_0x51e8cc['clearZombieChannels'](_0x51e8cc[_0xcd84('0x2a')],_0xcd84('0xa6'));_0x51e8cc[_0xcd84('0xa7')](_0x51e8cc[_0xcd84('0xa8')],_0xcd84('0xa9'));},0x32c8);};Dialer[_0xcd84('0x1d')][_0xcd84('0xa7')]=function(_0x15066f,_0xe5025d){var _0x3e9c46=this;for(var _0x5330c9 in _0x15066f){if(typeof _0x15066f[_0x5330c9]!=='undefined'){this['sequence'][_0xcd84('0x1e')](function(){if(!_[_0xcd84('0xaa')](_0x15066f[_0x5330c9])){return ami['Action']({'action':_0xcd84('0xab'),'channel':_0x15066f[_0x5330c9][_0xcd84('0xac')]})[_0xcd84('0xad')](function(_0x75165b){if(_0x75165b['message']===_0xcd84('0xae')){setTimeout(function(){if(_0x15066f[_0x5330c9]&&_0x15066f[_0x5330c9][_0xcd84('0x50')]!=='ivr'){_0x3e9c46['updateOriginated'](_0x3e9c46[_0xcd84('0x23')][_0x15066f[_0x5330c9][_0xcd84('0xaf')]]);logger[_0xcd84('0x92')](_0xcd84('0xb0'),_0xe5025d,_0x5330c9,_0x15066f[_0x5330c9][_0xcd84('0xaf')]);delete _0x15066f[_0x5330c9];}if(_0x15066f[_0x5330c9]&&_0x15066f[_0x5330c9]['type']===_0xcd84('0x78')){_0x3e9c46['updateOriginated'](_0x3e9c46[_0xcd84('0x24')][_0x15066f[_0x5330c9][_0xcd84('0xaf')]]);logger[_0xcd84('0x92')](_0xcd84('0xb1'),_0xe5025d,_0x5330c9,_0x15066f[_0x5330c9][_0xcd84('0xaf')]);delete _0x15066f[_0x5330c9];}},0x2328);}});}});}}};Dialer['prototype'][_0xcd84('0xb2')]=function(_0x4be9d5){return BPromise['resolve']()[_0xcd84('0xb3')](cmHopper[_0xcd84('0xb2')](_0x4be9d5))[_0xcd84('0xad')](loggerCatch(_0xcd84('0xb4')));};Dialer[_0xcd84('0x1d')]['checkIsBlackList']=function(_0x104bb5){return BPromise['resolve']()['then'](cmHopperBlack[_0xcd84('0xb5')](_0x104bb5))['catch'](loggerCatch(_0xcd84('0xb6')));};Dialer['prototype'][_0xcd84('0xb7')]=function(_0x5dcdd4){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopperBlack[_0xcd84('0xb7')](_0x5dcdd4))[_0xcd84('0xad')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0xcd84('0xb9')]=function(_0x1b89df){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopperHistory[_0xcd84('0xba')](_0x1b89df))['catch'](loggerCatch(_0xcd84('0xbb')));};Dialer[_0xcd84('0x1d')][_0xcd84('0xbc')]=function(_0x3e2ba6){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopper[_0xcd84('0xbc')](_0x3e2ba6))['catch'](loggerCatch(_0xcd84('0xbd')));};Dialer[_0xcd84('0x1d')][_0xcd84('0xbe')]=function(_0xc2200a,_0x5c8b67,_0x113755){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopper['unlockContact'](_0xc2200a,_0x5c8b67,_0x113755))[_0xcd84('0xad')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype'][_0xcd84('0xbf')]=function(_0x5754a4,_0x3a4ab8,_0x42633c,_0x135cf5,_0x55152e){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopper[_0xcd84('0xbf')](_0x5754a4,_0x3a4ab8,_0x42633c,_0x135cf5))[_0xcd84('0xad')](function(_0x26c0cd){_0x55152e[_0xcd84('0xc0')]-=_0x42633c;_0x55152e['temp']=_0x55152e[_0xcd84('0xc0')]>0x0?_0x55152e[_0xcd84('0xc0')]:0x0;loggerCatch(_0xcd84('0xc1'))(_0x26c0cd);});};Dialer[_0xcd84('0x1d')][_0xcd84('0xc2')]=function(_0x1561f2,_0xbd024a,_0x26930d,_0x5b9eec){return BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](cmHopper[_0xcd84('0xc2')](_0x1561f2,_0xbd024a,_0x26930d))[_0xcd84('0xad')](function(_0x5c76f9){_0x5b9eec[_0xcd84('0xc0')]-=_0xbd024a;_0x5b9eec[_0xcd84('0xc0')]=_0x5b9eec['temp']>0x0?_0x5b9eec[_0xcd84('0xc0')]:0x0;loggerCatch(_0xcd84('0xc3'))(_0x5c76f9);});};Dialer['prototype'][_0xcd84('0xc4')]=function(_0x5014fe){return BPromise[_0xcd84('0xb8')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5014fe))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xcd84('0xc5')]=function(_0x395472){return BPromise['resolve']()['then'](cmHopper[_0xcd84('0xc5')](_0x395472))[_0xcd84('0xad')](loggerCatch(_0xcd84('0xc6')));};Dialer[_0xcd84('0x1d')]['createHistory']=function(_0x21eba5){return BPromise['resolve']()[_0xcd84('0xb3')](cmHopperHistory[_0xcd84('0xc7')](_0x21eba5))[_0xcd84('0xad')](loggerCatch(_0xcd84('0xc8')));};Dialer['prototype'][_0xcd84('0xc9')]=function(_0x4c4a0a){if(!_['isUndefined'](_0x4c4a0a)&&_0x4c4a0a!==null){if(typeof _0x4c4a0a[_0xcd84('0x6f')]!==_0xcd84('0xca')){if(_0x4c4a0a[_0xcd84('0x6f')]>0x0){_0x4c4a0a[_0xcd84('0x6f')]-=0x1;}else{logger[_0xcd84('0x92')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xcd84('0x92')](_0xcd84('0xcb'));}};Dialer[_0xcd84('0x1d')][_0xcd84('0xcc')]=function(_0x5e0ff0,_0x4abafd){var _0x1a190f=this;return function(_0x2196d2){_0x1a190f[_0xcd84('0xc9')](_0x4abafd);logger[_0xcd84('0x92')](_0x5e0ff0,util[_0xcd84('0x94')](_0x2196d2,{'showHidden':![],'depth':null}));};};Dialer[_0xcd84('0x1d')][_0xcd84('0xcd')]=function(_0xdd8e07,_0x545b14,_0x1d5340){var _0x5d3e27={'state':0x19,'statedesc':'notFound'};this[_0xcd84('0xc9')](_0x545b14);this[_0xcd84('0xce')](_[_0xcd84('0xcf')](_0x5d3e27,_[_0xcd84('0xd0')](_0x1d5340,[_0xcd84('0xd1'),'ListId',_0xcd84('0xd2'),_0xcd84('0xd3'),_0xcd84('0xd4')])),_0xcd84('0xd5'),_0xcd84('0xd6'));logger[_0xcd84('0x92')](_0xdd8e07);};Dialer[_0xcd84('0x1d')][_0xcd84('0xd7')]=function(_0x2d796d){return _0x2d796d===_0xcd84('0xd8');};Dialer[_0xcd84('0x1d')]['isTrunkReachable']=function(_0x50bc78){return!_['isUndefined'](_0x50bc78)&&_0x50bc78&&!_['isUndefined'](_0x50bc78[_0xcd84('0x41')])&&!_['isUndefined'](_0x50bc78[_0xcd84('0xd9')])&&_0x50bc78[_0xcd84('0xd9')]&&(this[_0xcd84('0x26')][util[_0xcd84('0x75')]('SIP/%s',_0x50bc78[_0xcd84('0x41')])][_0xcd84('0xab')]===_0xcd84('0xda')||this['trunks'][util[_0xcd84('0x75')](_0xcd84('0xdb'),_0x50bc78[_0xcd84('0x41')])][_0xcd84('0xab')]==='unmonitored');};Dialer[_0xcd84('0x1d')][_0xcd84('0xce')]=function(_0x304577,_0x76f17a,_0x391edb){this[_0xcd84('0xc7')](_0x304577)[_0xcd84('0xad')](loggerCatch(_0x76f17a));this['moveContactManagedDialer'](_0x304577)['catch'](loggerCatch(_0x391edb));};Dialer[_0xcd84('0x1d')][_0xcd84('0x3a')]=function(_0x4546bc){var _0x4c6b8b=this['uniqueId'][_0x4546bc[_0xcd84('0xdc')]];var _0x286365;if(!_[_0xcd84('0xaa')](_0x4546bc)&&!_[_0xcd84('0xaa')](_0x4546bc[_0xcd84('0xdd')])&&!_[_0xcd84('0xaa')](_0x4546bc['variable'][_0xcd84('0xde')])&&_0x4546bc[_0xcd84('0xdf')]===_0xcd84('0xe0')&&_0x4c6b8b){if(_0x4c6b8b[_0xcd84('0x50')]!==_0xcd84('0x78')&&this[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]]['dialAMDActive']&&_0x4546bc['value']===_0xcd84('0xe1')){delete this[_0xcd84('0x2a')][_0x4546bc[_0xcd84('0xdc')]];this[_0xcd84('0xc9')](this[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]]);this[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]][_0xcd84('0x5f')]+=0x1;this['voiceQueues'][_0x4c6b8b['queue']][_0xcd84('0x5e')]+=0x1;_0x286365=new Hangup(_0x4c6b8b,_0x4546bc);_0x286365[_0xcd84('0xe2')]=0x12;_0x286365['statedesc']=_0xcd84('0xe3');_0x286365[_0xcd84('0xe4')]=_0xcd84('0xe5');ami[_0xcd84('0xe6')](_0xcd84('0xe7'),ut[_0xcd84('0xe8')](_0x286365,_0xcd84('0xe9')));this['saveInDb'](_0x286365,_0xcd84('0xea'),'[syncHangupInAMD]');}if(_0x4c6b8b[_0xcd84('0x50')]!==_0xcd84('0x78')&&this[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]]['dialAMDActive']&&_0x4546bc['value']===_0xcd84('0xeb')){var _0x3f7670=this;return new BPromise(function(_0x14b5fb,_0x293bf9){delete _0x3f7670[_0xcd84('0x2a')][_0x4546bc['uniqueid']];_0x3f7670[_0xcd84('0xc9')](_0x3f7670[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]]);_0x3f7670['voiceQueues'][_0x4c6b8b['queue']][_0xcd84('0x5f')]+=0x1;_0x3f7670[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x39fc72=_0x3f7670[_0xcd84('0x23')][_0x4c6b8b[_0xcd84('0xaf')]];var _0x2cd5ce=new Hangup(_0x4c6b8b,_0x4546bc);_0x2cd5ce[_0xcd84('0xe2')]=0x13;_0x2cd5ce[_0xcd84('0xa4')]=_0xcd84('0xec');_0x2cd5ce[_0xcd84('0xe4')]=_0xcd84('0xe5');_0x2cd5ce[_0xcd84('0xed')]+=0x1;_0x2cd5ce[_0xcd84('0xee')]+=0x1;_0x2cd5ce[_0xcd84('0xe9')]=!![];ami[_0xcd84('0xe6')](_0xcd84('0xe7'),ut[_0xcd84('0xe8')](_0x2cd5ce,_0xcd84('0xe9')));_0x3f7670['createHistory'](_0x2cd5ce)[_0xcd84('0xad')](loggerCatch(_0xcd84('0xef')));if(_0x2cd5ce[_0xcd84('0xf0')]+_0x2cd5ce[_0xcd84('0xf1')]+_0x2cd5ce[_0xcd84('0xf2')]+_0x2cd5ce[_0xcd84('0xf3')]+_0x2cd5ce['countdropretry']+_0x2cd5ce[_0xcd84('0xf4')]+_0x2cd5ce[_0xcd84('0xed')]+_0x2cd5ce[_0xcd84('0xf5')]>=_0x39fc72[_0xcd84('0xf6')]){_0x3f7670['stateGlobal'](_0x2cd5ce,_0x14b5fb,_0x293bf9,'reason19\x20machine....');}else{if(_0x2cd5ce[_0xcd84('0xed')]>=_0x39fc72[_0xcd84('0xf7')]){_0x3f7670['createStateFinal'](_0x2cd5ce,_0x14b5fb,_0x293bf9,_0xcd84('0xf8'));}else{_0x3f7670[_0xcd84('0xbc')]({'active':![],'countmachineretry':_0x2cd5ce[_0xcd84('0xed')],'scheduledat':moment()['add'](_0x39fc72[_0xcd84('0xf9')],_0xcd84('0xfa'))[_0xcd84('0x75')](_0xcd84('0xfb')),'ContactId':_0x2cd5ce['ContactId'],'ListId':_0x2cd5ce[_0xcd84('0xfc')],'VoiceQueueId':_0x2cd5ce[_0xcd84('0xd3')]||undefined,'CampaignId':_0x2cd5ce[_0xcd84('0xd4')]||undefined})['catch'](loggerCatch(_0xcd84('0xfd')));_0x14b5fb({'reschedule':0x1});}}});}if(_0x4c6b8b['type']===_0xcd84('0x78')&&this[_0xcd84('0x24')][_0x4c6b8b['queue']][_0xcd84('0xfe')]&&_0x4546bc[_0xcd84('0xff')]===_0xcd84('0xe1')){delete this[_0xcd84('0x2a')][_0x4546bc[_0xcd84('0xdc')]];this[_0xcd84('0xc9')](this[_0xcd84('0x24')][_0x4c6b8b[_0xcd84('0xaf')]]);_0x286365=new Hangup(_0x4c6b8b,_0x4546bc);_0x286365['state']=0x12;_0x286365[_0xcd84('0xa4')]='HangupInAMD';_0x286365['membername']=_0xcd84('0xe5');ami['emit']('custom:amd',ut['buildObj'](_0x286365,_0xcd84('0xe9')));this[_0xcd84('0xce')](_0x286365,'[syncHangupInAMDIvr][createHistory]',_0xcd84('0x100'));}if(_0x4c6b8b[_0xcd84('0x50')]==='ivr'&&this[_0xcd84('0x24')][_0x4c6b8b[_0xcd84('0xaf')]][_0xcd84('0xfe')]&&_0x4546bc[_0xcd84('0xff')]===_0xcd84('0xeb')){var _0x3f7670=this;return new BPromise(function(_0x59006a,_0x309ff8){delete _0x3f7670[_0xcd84('0x2a')][_0x4546bc[_0xcd84('0xdc')]];_0x3f7670['updateOriginated'](_0x3f7670['campaigns'][_0x4c6b8b[_0xcd84('0xaf')]]);_0x3f7670[_0xcd84('0x24')][_0x4c6b8b[_0xcd84('0xaf')]][_0xcd84('0x5f')]+=0x1;_0x3f7670['campaigns'][_0x4c6b8b[_0xcd84('0xaf')]][_0xcd84('0x5e')]+=0x1;var _0x43a0e1=_0x3f7670['campaigns'][_0x4c6b8b['queue']];var _0x392294=new Hangup(_0x4c6b8b,_0x4546bc);_0x392294[_0xcd84('0xe2')]=0x13;_0x392294[_0xcd84('0xa4')]=_0xcd84('0xec');_0x392294['membername']=_0xcd84('0xe5');_0x392294[_0xcd84('0xed')]+=0x1;_0x392294[_0xcd84('0xee')]+=0x1;_0x392294['amd']=!![];ami['emit'](_0xcd84('0xe7'),ut['buildObj'](_0x392294,'amd'));_0x3f7670[_0xcd84('0xc7')](_0x392294)[_0xcd84('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x392294[_0xcd84('0xf0')]+_0x392294[_0xcd84('0xf1')]+_0x392294[_0xcd84('0xf2')]+_0x392294[_0xcd84('0xf3')]+_0x392294[_0xcd84('0x101')]+_0x392294['countabandonedretry']+_0x392294['countmachineretry']+_0x392294[_0xcd84('0xf5')]>=_0x43a0e1['dialGlobalMaxRetry']){_0x3f7670[_0xcd84('0x102')](_0x392294,_0x59006a,_0x309ff8,_0xcd84('0x103'));}else{if(_0x392294[_0xcd84('0xed')]>=_0x43a0e1[_0xcd84('0xf7')]){_0x3f7670['createStateFinal'](_0x392294,_0x59006a,_0x309ff8,_0xcd84('0xf8'));}else{_0x3f7670[_0xcd84('0xbc')]({'active':![],'countmachineretry':_0x392294[_0xcd84('0xed')],'scheduledat':moment()[_0xcd84('0x104')](_0x43a0e1[_0xcd84('0xf9')],_0xcd84('0xfa'))['format'](_0xcd84('0xfb')),'ContactId':_0x392294[_0xcd84('0xd1')],'ListId':_0x392294[_0xcd84('0xfc')],'VoiceQueueId':_0x392294['VoiceQueueId']||undefined,'CampaignId':_0x392294[_0xcd84('0xd4')]||undefined})['catch'](loggerCatch(_0xcd84('0xfd')));_0x59006a({'reschedule':0x1});}}});}}};Dialer[_0xcd84('0x1d')]['syncHangup']=function(_0x3c3e9c){var _0x38f12a=this[_0xcd84('0x2a')][_0x3c3e9c['uniqueid']];var _0x4f58fd=this;var _0x94f0b4;if(_0x38f12a&&_0x38f12a['type']===_0xcd84('0x78')){delete this[_0xcd84('0x2a')][_0x3c3e9c[_0xcd84('0xdc')]];this['updateOriginated'](this[_0xcd84('0x24')][_0x38f12a[_0xcd84('0xaf')]]);this[_0xcd84('0x24')][_0x38f12a[_0xcd84('0xaf')]][_0xcd84('0x105')]+=0x1;_0x94f0b4=new Hangup(_0x38f12a,_0x3c3e9c);this['createHistory'](_0x94f0b4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x106')));this[_0xcd84('0xc5')](_0x94f0b4)[_0xcd84('0xad')](loggerCatch('[syncHangupIvr]'));}if(_0x38f12a&&_0x38f12a[_0xcd84('0x50')]!==_0xcd84('0x78')&&isNotNull(this['voiceQueues'][_0x38f12a['queue']][_0xcd84('0x107')])){delete this[_0xcd84('0x2a')][_0x3c3e9c[_0xcd84('0xdc')]];this[_0xcd84('0xc9')](this['voiceQueues'][_0x38f12a[_0xcd84('0xaf')]]);this[_0xcd84('0x23')][_0x38f12a['queue']][_0xcd84('0x5f')]+=0x1;this['voiceQueues'][_0x38f12a[_0xcd84('0xaf')]][_0xcd84('0x5e')]+=0x1;_0x94f0b4=new Hangup(_0x38f12a,_0x3c3e9c);_0x94f0b4[_0xcd84('0xe2')]=0x10;_0x94f0b4[_0xcd84('0xa4')]=_0xcd84('0x108');_0x94f0b4['membername']=_0xcd84('0x109');this[_0xcd84('0xc7')](_0x94f0b4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x106')));this['moveContactManagedDialer'](_0x94f0b4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x10a')));}if(_0x38f12a&&_0x38f12a[_0xcd84('0x50')]!==_0xcd84('0x78')&&!isNotNull(this[_0xcd84('0x23')][_0x38f12a[_0xcd84('0xaf')]][_0xcd84('0x107')])){delete this[_0xcd84('0x2a')][_0x3c3e9c[_0xcd84('0xdc')]];this[_0xcd84('0xc9')](this[_0xcd84('0x23')][_0x38f12a['queue']]);this[_0xcd84('0x23')][_0x38f12a[_0xcd84('0xaf')]][_0xcd84('0x68')]+=0x1;_0x94f0b4=new Hangup(_0x38f12a,_0x3c3e9c);_0x94f0b4[_0xcd84('0xe2')]=0xc;_0x94f0b4['statedesc']=_0x3c3e9c[_0xcd84('0x10b')];_0x94f0b4[_0xcd84('0xe4')]=_0xcd84('0x10c');this[_0xcd84('0xc7')](_0x94f0b4)['catch'](loggerCatch(_0xcd84('0x106')));this['moveContactManagedDialer'](_0x94f0b4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x10a')));}};Dialer[_0xcd84('0x1d')][_0xcd84('0x35')]=function(_0x4e2170){var _0x4660a2=this[_0xcd84('0x2a')][_0x4e2170[_0xcd84('0xdc')]];var _0x52c4b9=this;if(this[_0xcd84('0x23')][_0x4e2170[_0xcd84('0xaf')]]){if(_0x4660a2&&_0x4660a2['type']!==_0xcd84('0x78')){delete this[_0xcd84('0x2a')][_0x4e2170[_0xcd84('0xdc')]];this['voiceQueues'][_0x4e2170[_0xcd84('0xaf')]][_0xcd84('0x5f')]+=0x1;var _0x380cdd=new AgentComplete(_0x4660a2,_0x4e2170);if(_0x4e2170[_0xcd84('0x10d')]==='agent'){_0x380cdd['agiafterat']=this[_0xcd84('0x23')][_0x4e2170[_0xcd84('0xaf')]][_0xcd84('0x10e')]&&this[_0xcd84('0x23')][_0x4e2170['queue']][_0xcd84('0x10f')]?moment()[_0xcd84('0x75')](_0xcd84('0xfb')):undefined;}this[_0xcd84('0xc7')](_0x380cdd)['catch'](loggerCatch(_0xcd84('0x110')));this[_0xcd84('0xc5')](_0x380cdd)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x111')));}}};Dialer[_0xcd84('0x1d')][_0xcd84('0x112')]=function(_0x2b55f8){if(this[_0xcd84('0x23')][_0x2b55f8[_0xcd84('0xaf')]]){if(this[_0xcd84('0x2a')][_0x2b55f8['uniqueid']]&&this[_0xcd84('0x2a')][_0x2b55f8[_0xcd84('0xdc')]]['type']!==_0xcd84('0x78')){this[_0xcd84('0xc9')](this[_0xcd84('0x23')][_0x2b55f8[_0xcd84('0xaf')]]);this[_0xcd84('0x2a')][_0x2b55f8[_0xcd84('0xdc')]]['answertime']=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));}}};Dialer[_0xcd84('0x1d')][_0xcd84('0x113')]=function(_0x2beeef){this[_0xcd84('0xc7')](_0x2beeef)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x110')));this[_0xcd84('0xc5')](_0x2beeef)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x114')));};Dialer['prototype'][_0xcd84('0x31')]=function(_0x127867){var _0x3bef07=this['uniqueId'][_0x127867['uniqueid']];var _0x3c9256=this;if(this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]]){if(_0x3bef07&&_0x3bef07[_0xcd84('0x50')]!==_0xcd84('0x78')){delete this[_0xcd84('0x2a')][_0x127867[_0xcd84('0xdc')]];this[_0xcd84('0xc9')](this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]]);_0x3bef07[_0xcd84('0x115')]=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));var _0x2cecbe=new QueueCallerAbandon(_0x3bef07,_0x127867);if(getSeconds(_0x3bef07['droptime'],_0x3bef07[_0xcd84('0x116')])>=_0x3bef07[_0xcd84('0x117')]){this['voiceQueues'][_0x127867[_0xcd84('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]][_0xcd84('0x118')]+=0x1;this['voiceQueues'][_0x127867[_0xcd84('0xaf')]][_0xcd84('0x119')]+=0x1;_0x2cecbe[_0xcd84('0xe2')]=0xa;_0x2cecbe[_0xcd84('0xa4')]='Drop';_0x2cecbe[_0xcd84('0x11a')]=_0xcd84('0x11b');_0x2cecbe['agiafterat']=this[_0xcd84('0x23')][_0x127867['queue']][_0xcd84('0x10e')]?moment()[_0xcd84('0x75')](_0xcd84('0xfb')):undefined;_0x2cecbe[_0xcd84('0x101')]+=0x1;_0x2cecbe[_0xcd84('0xee')]+=0x1;if(_0x2cecbe['countdropretry']>=this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]][_0xcd84('0x11c')]){this['queueCallerAbandonCreateState'](_0x2cecbe);}else{this[_0xcd84('0xbc')]({'active':![],'countdropretry':_0x2cecbe['countdropretry'],'scheduledat':moment()[_0xcd84('0x104')](this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]][_0xcd84('0x11d')],_0xcd84('0xfa'))[_0xcd84('0x75')](_0xcd84('0xfb')),'ContactId':_0x3bef07[_0xcd84('0xd1')],'ListId':_0x3bef07[_0xcd84('0xfc')],'VoiceQueueId':_0x3bef07[_0xcd84('0xd3')]||undefined,'CampaignId':_0x3bef07[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x11e')));var _0x4a21e8=new History(_0x2cecbe);_0x4a21e8['state']=0xa;_0x4a21e8['statedesc']=_0xcd84('0x11f');_0x4a21e8[_0xcd84('0xa5')]=moment()[_0xcd84('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a21e8[_0xcd84('0x120')]=_0x4a21e8[_0xcd84('0xa5')];_0x4a21e8['calleridname']=_0x2cecbe[_0xcd84('0x121')];_0x4a21e8['calleridnum']=_0x2cecbe[_0xcd84('0x122')];this[_0xcd84('0xc7')](_0x4a21e8)['catch'](loggerCatch(_0xcd84('0x123')));}}else{this[_0xcd84('0x23')][_0x127867[_0xcd84('0xaf')]][_0xcd84('0x6a')]+=0x1;this[_0xcd84('0x23')][_0x127867['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x2cecbe[_0xcd84('0xe2')]=0xb;_0x2cecbe['statedesc']='Abandoned';_0x2cecbe[_0xcd84('0x11a')]=_0xcd84('0x124');_0x2cecbe[_0xcd84('0xf4')]+=0x1;_0x2cecbe[_0xcd84('0xee')]+=0x1;if(_0x2cecbe['countabandonedretry']>=this['voiceQueues'][_0x127867['queue']][_0xcd84('0x125')]){this[_0xcd84('0x113')](_0x2cecbe);}else{this[_0xcd84('0xbc')]({'active':![],'countabandonedretry':_0x2cecbe[_0xcd84('0xf4')],'scheduledat':moment()['add'](this[_0xcd84('0x23')][_0x127867['queue']][_0xcd84('0x126')],_0xcd84('0xfa'))[_0xcd84('0x75')](_0xcd84('0xfb')),'ContactId':_0x3bef07[_0xcd84('0xd1')],'ListId':_0x3bef07['ListId'],'VoiceQueueId':_0x3bef07[_0xcd84('0xd3')]||undefined,'CampaignId':_0x3bef07[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x127')));var _0x4a21e8=new History(_0x2cecbe);_0x4a21e8['state']=0xb;_0x4a21e8[_0xcd84('0xa4')]=_0xcd84('0x128');_0x4a21e8[_0xcd84('0xa5')]=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));_0x4a21e8['endtime']=_0x4a21e8['starttime'];_0x4a21e8['calleridname']=_0x2cecbe[_0xcd84('0x121')];_0x4a21e8[_0xcd84('0x122')]=_0x2cecbe[_0xcd84('0x122')];this[_0xcd84('0xc7')](_0x4a21e8)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x129')));}}}}};Dialer[_0xcd84('0x1d')][_0xcd84('0x12a')]=function(_0x2a8b41){if(this[_0xcd84('0xa8')][_0x2a8b41[_0xcd84('0xdc')]]){this['actions'][_0x2a8b41[_0xcd84('0xdc')]][_0xcd84('0xac')]=_0x2a8b41[_0xcd84('0xac')];}if(this[_0xcd84('0x2a')][_0x2a8b41[_0xcd84('0xdc')]]){this[_0xcd84('0x2a')][_0x2a8b41[_0xcd84('0xdc')]][_0xcd84('0xac')]=_0x2a8b41[_0xcd84('0xac')];}};Dialer['prototype']['syncQueueMember']=function(_0x55ea28){if(strategy[this['voiceQueues'][this[_0xcd84('0xa8')][_0x55ea28['actionid']][_0xcd84('0xaf')]]['strategy']]===_0xcd84('0x1c')){if(this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]]&&_[_0xcd84('0xaa')](this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]][_0xcd84('0x12c')])&&_0x55ea28['status']==='1'&&_0x55ea28['paused']==='0'){if(this[_0xcd84('0x25')][_0x55ea28[_0xcd84('0x12d')]]){if(!this[_0xcd84('0x25')][_0x55ea28[_0xcd84('0x12d')]][_0xcd84('0x12c')]){this[_0xcd84('0x25')][_0x55ea28[_0xcd84('0x12d')]][_0xcd84('0x12c')]=!![];this[_0xcd84('0xa8')][_0x55ea28['actionid']][_0xcd84('0x12c')]=!![];this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]]['stateinterface']=_0x55ea28[_0xcd84('0x12d')];}}}}else if((strategy[this[_0xcd84('0x23')][this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]][_0xcd84('0xaf')]][_0xcd84('0x12e')]]||_0xcd84('0x1b'))===_0xcd84('0x1b')){if(this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]]){if(this[_0xcd84('0x25')][_0x55ea28[_0xcd84('0x12d')]]){this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]]['stateinterface']=_0x55ea28[_0xcd84('0x12d')];if(_['isNil'](this['queueBooked'][this['actions'][_0x55ea28[_0xcd84('0x12b')]][_0xcd84('0xaf')]])){this[_0xcd84('0x12f')][this[_0xcd84('0xa8')][_0x55ea28[_0xcd84('0x12b')]]['queue']]=[];}this[_0xcd84('0x12f')][this['actions'][_0x55ea28[_0xcd84('0x12b')]]['queue']]['push'](_[_0xcd84('0xcf')](_[_0xcd84('0xd0')](this['actions'][_0x55ea28[_0xcd84('0x12b')]],[_0xcd84('0x130'),_0xcd84('0x12d')]),{'status':_0x55ea28[_0xcd84('0xab')],'paused':_0x55ea28[_0xcd84('0x131')]}));}}}};function unlockQueueStatus(_0x443fed,_0x67d68c){setTimeout(function(){if(_[_0xcd84('0x3e')](_0x443fed[_0xcd84('0x132')])){loggerBooked[_0xcd84('0x92')](_0xcd84('0x133'),_0x67d68c);}_0x443fed[_0xcd84('0x132')]=!![];loggerBooked[_0xcd84('0x7c')](_0xcd84('0x134'),_0x67d68c,JSON['stringify'](_['pick'](_0x443fed,[_0xcd84('0x41'),_0xcd84('0x132')])));},0x1f3);}Dialer[_0xcd84('0x1d')][_0xcd84('0x135')]=function(_0x20bbc2){var _0x334b3d=this;var _0x17669f=_0x334b3d[_0xcd84('0x23')][_0x334b3d[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]]['queue']];if(strategy[this[_0xcd84('0x23')][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]][_0xcd84('0x12e')]]==='roundrobin'){if(this['actions'][_0x20bbc2[_0xcd84('0x12b')]]&&this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]]['stateinterface']){this[_0xcd84('0x22')][_0xcd84('0x136')](this['actions'][_0x20bbc2[_0xcd84('0x12b')]]['idHopper'],this[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0x12d')])[_0xcd84('0xad')](function(_0x750bc5){logger[_0xcd84('0x92')](_0xcd84('0x137'),util['inspect'](_0x750bc5,{'showHidden':![],'depth':null}));})[_0xcd84('0x20')](function(){_0x334b3d[_0xcd84('0xc9')](_0x334b3d[_0xcd84('0x23')][_0x334b3d[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]]);_0x334b3d['agents'][_0x334b3d[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0x12d')]][_0xcd84('0x12c')]=![];delete _0x334b3d['actions'][_0x20bbc2[_0xcd84('0x12b')]];unlockQueueStatus(_0x17669f);});}else{this[_0xcd84('0xc9')](this[_0xcd84('0x23')][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]]);this[_0xcd84('0xbc')]({'active':![],'ContactId':this[_0xcd84('0xa8')][_0x20bbc2['actionid']]['ContactId'],'ListId':this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xfc')],'VoiceQueueId':this[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0xd3')]||undefined,'CampaignId':this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]]['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]];unlockQueueStatus(_0x17669f);}}else if((strategy[this[_0xcd84('0x23')][this[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0xaf')]]['strategy']]||_0xcd84('0x1b'))==='rrmemory'){var _0x3eba50;if(this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]]&&!_[_0xcd84('0x48')](this[_0xcd84('0x12f')][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]]['queue']])){if(this[_0xcd84('0x2d')][_0x334b3d[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]]){this['queueBookedRR'][_0x334b3d[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0xaf')]]=this[_0xcd84('0x2d')][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]]?this[_0xcd84('0x2d')][this[_0xcd84('0xa8')][_0x20bbc2['actionid']][_0xcd84('0xaf')]]:this[_0xcd84('0x12f')][this['actions'][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]]?this['queueBooked'][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]][_0xcd84('0x138')]||0x0:0x0;}this['queueBooked'][this[_0xcd84('0xa8')][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]][_0xcd84('0x138')]=this[_0xcd84('0x2d')][this['actions'][_0x20bbc2[_0xcd84('0x12b')]][_0xcd84('0xaf')]];for(var _0x10fc6e=0x0;_0x10fc6e=0x0;})['catch'](myreject(_0x147bbe)));}}else{_0x17fd58[_0xcd84('0x14e')](ami['Action']({'action':_0xcd84('0x150'),'command':util[_0xcd84('0x75')](_0xcd84('0x154'),_0x346380,!_['isUndefined'](config[_0xcd84('0x152')][_0x5d6862])?_0x5d6862:'')})[_0xcd84('0xb3')](function(_0xbb17a2){return _0xbb17a2['content'][_0xcd84('0x155')](_0xcd84('0x156'))>=0x0;})[_0xcd84('0xad')](myreject(_0x147bbe)));}BPromise[_0xcd84('0x157')](_0x17fd58)['then'](function(_0xe3daeb){var _0x2ce98f=_['some'](_0xe3daeb);if(_0x2ce98f){return _0x12a236(_0x2ce98f);}else{_0x2375fc['message']=_0x37f88c?_0xcd84('0x158'):_0xcd84('0x159');return _0x147bbe(msgResponse(_0xcd84('0x15a'),'Failure',_0xcd84('0x15b')+_0x37f88c+'\x20'+_0x2c273b+_0xcd84('0x15c')+util['inspect'](_0x346380,{'showHidden':![],'depth':null})+_0xcd84('0x15d')+_0x5d6862));}})[_0xcd84('0xad')](function(_0x5c895a){return _0x147bbe(msgResponse(_0xcd84('0x146'),'Failure',JSON[_0xcd84('0x4c')](_0x5c895a)));});});};Dialer['prototype'][_0xcd84('0x15e')]=function(_0x1ff93c){var _0x4f593c=this;return function(){switch(_0x1ff93c[_0xcd84('0x5a')]){case _0xcd84('0x15f'):freeVariablesPredictive(_0x1ff93c);_0x4f593c[_0xcd84('0x160')](_0x1ff93c,0x1);break;case _0xcd84('0x161'):freeVariablesPredictive(_0x1ff93c);_0x4f593c['handlePower'](_0x1ff93c,_0x1ff93c[_0xcd84('0x162')]);break;case'predictive':_0x4f593c[_0xcd84('0x163')](_0x1ff93c);break;case _0xcd84('0xb'):freeVariablesPredictive(_0x1ff93c);_0x4f593c[_0xcd84('0x160')](_0x1ff93c,0x1);break;default:freeVariablesPredictive(_0x1ff93c);logger[_0xcd84('0x92')](_0xcd84('0x164'),_0x1ff93c[_0xcd84('0x41')],_0xcd84('0x165'));}};};Dialer[_0xcd84('0x1d')][_0xcd84('0x166')]=function(_0x1c78bf){var _0x486420=this;return function(){_0x486420[_0xcd84('0x167')](_0x1c78bf);};};Dialer['prototype'][_0xcd84('0x37')]=function(_0x4e8b5c){var _0x174d73=this;if(isNotPreview(_0x4e8b5c[_0xcd84('0x5a')])){if(isVoiceQueueOutbound(_0x4e8b5c[_0xcd84('0x50')])&&isActive(_0x4e8b5c[_0xcd84('0x59')])){_0x4e8b5c[_0xcd84('0x9e')]=!![];BPromise[_0xcd84('0xb8')]()[_0xcd84('0xb3')](checkIsLoggedIn(_0x4e8b5c,_0x4e8b5c[_0xcd84('0x168')]))[_0xcd84('0xb3')](checkIsActive(_0x4e8b5c,_0x4e8b5c[_0xcd84('0x59')]))[_0xcd84('0xb3')](checkInterval(_0x4e8b5c))[_0xcd84('0xb3')](_0x174d73[_0xcd84('0x140')](_0x4e8b5c))[_0xcd84('0xb3')](_0x174d73['checkIfTime'](_0x4e8b5c[_0xcd84('0x169')],_0x4e8b5c[_0xcd84('0x16a')],_0x4e8b5c[_0xcd84('0x41')],_0x4e8b5c))[_0xcd84('0xb3')](_0x174d73[_0xcd84('0x147')](_0x4e8b5c[_0xcd84('0x47')],_0x4e8b5c['dialTimezone'],_0x4e8b5c[_0xcd84('0x41')],_0x4e8b5c))['then'](_0x174d73[_0xcd84('0x15e')](_0x4e8b5c))[_0xcd84('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4e8b5c));}else{notSendMessagesQueue(_0x4e8b5c);}}else{freeVariablesPredictive(_0x4e8b5c);}};Dialer[_0xcd84('0x1d')][_0xcd84('0x16b')]=function(){var _0x45a646=this;var _0x5cf7a6;for(var _0x4d10c5 in this['campaigns']){if(typeof this[_0xcd84('0x24')][_0x4d10c5]!==_0xcd84('0xca')){_0x5cf7a6=this[_0xcd84('0x24')][_0x4d10c5];if(isCampaignIvr(_0x5cf7a6[_0xcd84('0x50')])&&isActive(_0x5cf7a6[_0xcd84('0xd9')])){_0x5cf7a6[_0xcd84('0x9e')]=!![];BPromise['resolve']()[_0xcd84('0xb3')](checkIsActive(_0x5cf7a6,_0x5cf7a6['active']))[_0xcd84('0xb3')](checkInterval(_0x5cf7a6))[_0xcd84('0xb3')](_0x45a646[_0xcd84('0x140')](_0x5cf7a6))[_0xcd84('0xb3')](_0x45a646[_0xcd84('0x145')](_0x5cf7a6['dialGlobalInterval'],_0x5cf7a6['dialTimezone'],_0x5cf7a6[_0xcd84('0x41')],_0x5cf7a6))[_0xcd84('0xb3')](_0x45a646[_0xcd84('0x147')](_0x5cf7a6[_0xcd84('0x47')],_0x5cf7a6['dialTimezone'],_0x5cf7a6['name'],_0x5cf7a6))[_0xcd84('0xb3')](_0x45a646[_0xcd84('0x166')](_0x5cf7a6))[_0xcd84('0xad')](loggerCatchQueueSummary(_0xcd84('0x16c'),_0x5cf7a6));}else{notSendMessagesCampaign(_0x5cf7a6);}}}};function getCallerIdRandom(_0x466a88,_0x1d6e4a){var _0x5dff35;var _0x1182a6;var _0x2605e9;if(_0x1d6e4a<=0x0){_0x1d6e4a=0x1;}_0x5dff35=new RegExp('\x5cw{0,'+_0x1d6e4a+'}$');_0x1182a6=Math['pow'](0xa,_0x1d6e4a-0x1);_0x2605e9=Math['pow'](0xa,_0x1d6e4a)-0x1;return util[_0xcd84('0x75')]('%s',_['replace'](_0x466a88,_0x5dff35,_[_0xcd84('0x16d')](_0x1182a6,_0x2605e9)));}function extractCalleridName(_0x22ab38){var _0x5f4e65=_0x22ab38[_0xcd84('0x16e')](/"(.*?)"/);return _0x5f4e65?_0x5f4e65[0x1]:_0x22ab38;}function extractCalleridNumber(_0x30de26){var _0x5eb115=_0x30de26[_0xcd84('0x16e')](/<(.*?)>/);return _0x5eb115?_0x5eb115[0x1]:_0x30de26;}Dialer['prototype'][_0xcd84('0x16f')]=function(_0x1c265e,_0x296bed){var _0x5ca364=this;var _0xfa26a5=uuid['v4']();this[_0xcd84('0xa8')][_0xfa26a5]=new Action(_0x1c265e,_0x296bed,_0xfa26a5);return new BPromise(function(_0x414a09,_0x2f467e){if(_[_0xcd84('0x3e')](_0x1c265e)&&typeof _0x1c265e!==_0xcd84('0x170')){return _0x2f467e(msgResponse(_0xcd84('0x171'),_0xcd84('0x148'),'voiceQueue\x20is\x20undefine'));}if(_[_0xcd84('0x3e')](_0x296bed['Contact'][_0xcd84('0x172')])||_0x296bed[_0xcd84('0x173')][_0xcd84('0x172')]===null){return _0x2f467e(msgResponse(_0xcd84('0x171'),'Failure',_0xcd84('0x174')));}var _0x27c562={'XMD-CALLERID':_0x5ca364['actions'][_0xfa26a5][_0xcd84('0x175')](),'XMD-AGI':_0x1c265e[_0xcd84('0x107')]?util[_0xcd84('0x75')](_0xcd84('0x176'),ipAgi,_0x1c265e[_0xcd84('0x107')]):'NONE','XMD-AGIAFTER':_0x1c265e[_0xcd84('0x10e')]?util['format'](_0xcd84('0x176'),ipAgi,_0x1c265e[_0xcd84('0x10e')]):_0xcd84('0x177'),'XMD-QUEUE':_0x1c265e[_0xcd84('0x50')]==='outbound'?util[_0xcd84('0x75')](_0xcd84('0x178'),_0x1c265e[_0xcd84('0x41')],_0x1c265e['dialQueueOptions']||'',_0x1c265e['dialAgiAfterHangupAgent']?'c':'',_0x1c265e[_0xcd84('0x117')]||0x3):'NONE','XMD-CONTACTID':_0x296bed[_0xcd84('0xd1')],'XMD-CDRTYPE':_0xcd84('0x9'),'CALLERID(all)':_0x5ca364['actions'][_0xfa26a5]['getCaller'](),'XMD-AMD':_0x1c265e[_0xcd84('0xfe')]?_0xcd84('0x179'):_0xcd84('0x177'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1c265e[_0xcd84('0xfe')]){_0x27c562[_0xcd84('0x17a')]=_0x1c265e[_0xcd84('0x17b')]||0x9c4;_0x27c562['XMD-AMDGREETING']=_0x1c265e['dialAMDGreeting']||0x5dc;_0x27c562[_0xcd84('0x17c')]=_0x1c265e[_0xcd84('0x17d')]||0x320;_0x27c562[_0xcd84('0x17e')]=_0x1c265e[_0xcd84('0x17f')]||0x1388;_0x27c562['XMD-AMDMINWORDLENGTH']=_0x1c265e[_0xcd84('0x180')]||0x64;_0x27c562[_0xcd84('0x181')]=_0x1c265e[_0xcd84('0x182')]||0x32;_0x27c562[_0xcd84('0x183')]=_0x1c265e['dialAMDMaximumNumberOfWords']||0x3;_0x27c562[_0xcd84('0x184')]=_0x1c265e['dialAMDSilenceThreshold']||0x100;_0x27c562[_0xcd84('0x185')]=_0x1c265e[_0xcd84('0x186')]||0x1388;}if(_0x1c265e[_0xcd84('0x50')]==='outbound'){_0x27c562[_0xcd84('0x187')]=_0x296bed[_0xcd84('0xd3')];}else{_0x27c562[_0xcd84('0x188')]=_0x296bed['CampaignId'];}for(var _0x382ea5 in _0x296bed[_0xcd84('0x173')]){if(typeof _0x296bed[_0xcd84('0x173')][_0x382ea5]!=='undefined'){if(isNotNull(_0x296bed[_0xcd84('0x173')][_0x382ea5])&&_0x382ea5!=='id'&&_0x382ea5!==_0xcd84('0x189')&&_0x382ea5!=='createdAt'&&_0x382ea5!==_0xcd84('0x18a')){_0x27c562[util[_0xcd84('0x75')]('%s%s',_0xcd84('0x18b'),_[_0xcd84('0x18c')](_0x382ea5))]=_0x296bed[_0xcd84('0x173')][_0x382ea5];}}}var _0x2dd9d5=_0x5ca364[_0xcd84('0x141')](_0x1c265e[_0xcd84('0x73')])?getCallerId(_0x1c265e['Trunk']['callerid'],_0x1c265e[_0xcd84('0x5b')],_0x1c265e[_0xcd84('0x18d')]>0x0?getCallerIdRandom(_0x1c265e[_0xcd84('0x18e')],_0x1c265e['dialRandomLastDigitCallerIdNumber']):_0x1c265e[_0xcd84('0x18e')]):getCallerId(_[_0xcd84('0xaa')](_0x1c265e[_0xcd84('0x142')])?_0x1c265e[_0xcd84('0x73')][_0xcd84('0x74')]:_0x1c265e[_0xcd84('0x142')][_0xcd84('0x74')],_0x1c265e[_0xcd84('0x5b')],_0x1c265e[_0xcd84('0x18d')]>0x0?getCallerIdRandom(_0x1c265e[_0xcd84('0x18e')],_0x1c265e[_0xcd84('0x18d')]):_0x1c265e[_0xcd84('0x18e')]);if(_0x2dd9d5){_0x27c562[_0xcd84('0x18f')]=_0x5ca364[_0xcd84('0xa8')][_0xfa26a5][_0xcd84('0x190')]=extractCalleridName(_0x2dd9d5);_0x27c562[_0xcd84('0x191')]=_0x5ca364[_0xcd84('0xa8')][_0xfa26a5][_0xcd84('0x192')]=extractCalleridNumber(_0x2dd9d5);}return ami[_0xcd84('0x14f')]({'actionid':_0xfa26a5,'action':_0xcd84('0x171'),'channel':_0x5ca364[_0xcd84('0x141')](_0x1c265e['Trunk'])?util['format'](_0xcd84('0x193'),_0x1c265e['Trunk']['name'],isNotNull(_0x1c265e[_0xcd84('0x5d')])?_0x1c265e['dialPrefix'][_0xcd84('0x194')]()||'':'',_0x1c265e[_0xcd84('0x195')]>0x0?_0x296bed[_0xcd84('0x173')][_0xcd84('0x172')][_0xcd84('0x196')](_0x1c265e[_0xcd84('0x195')]):_0x296bed[_0xcd84('0x173')][_0xcd84('0x172')]):util['format'](_0xcd84('0x193'),_[_0xcd84('0xaa')](_0x1c265e[_0xcd84('0x142')])?_0x1c265e[_0xcd84('0x73')][_0xcd84('0x41')]:_0x1c265e[_0xcd84('0x142')][_0xcd84('0x41')],isNotNull(_0x1c265e['dialPrefix'])?_0x1c265e['dialPrefix'][_0xcd84('0x194')]()||'':'',_0x1c265e[_0xcd84('0x195')]>0x0?_0x296bed['Contact'][_0xcd84('0x172')][_0xcd84('0x196')](_0x1c265e[_0xcd84('0x195')]):_0x296bed['Contact'][_0xcd84('0x172')]),'callerid':_0x2dd9d5,'Exten':_0xcd84('0xe0'),'Context':_0xcd84('0x197'),'Priority':'1','variable':_0x27c562,'timeout':(_0x1c265e[_0xcd84('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xfa26a5})[_0xcd84('0xb3')](function(_0x3cc121){return _0x414a09(_0x3cc121);})[_0xcd84('0xad')](function(_0x44e90f){_0x1c265e[_0xcd84('0x66')]+=0x1;var _0x36f98c=new History(_0x5ca364[_0xcd84('0xa8')][_0xfa26a5]);logger[_0xcd84('0x92')](util[_0xcd84('0x75')](_0xcd84('0x198'),JSON[_0xcd84('0x4c')](_0x44e90f)));_0x36f98c[_0xcd84('0xe2')]=0xe;_0x36f98c['statedesc']=_0xcd84('0x199');_0x36f98c[_0xcd84('0xa5')]=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));_0x36f98c['endtime']=_0x36f98c[_0xcd84('0xa5')];_0x5ca364[_0xcd84('0xc7')](_0x36f98c)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x19a')));_0x5ca364[_0xcd84('0xc5')](_0x36f98c)[_0xcd84('0xad')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x5ca364[_0xcd84('0xa8')][_0xfa26a5];return _0x2f467e(msgResponse(_0xcd84('0x171'),'Error',_0xcd84('0x19b')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x112d0c){var _0x4b5e31=this[_0xcd84('0xa8')][_0x112d0c[_0xcd84('0x12b')]];if(_0x4b5e31){delete this[_0xcd84('0xa8')][_0x112d0c[_0xcd84('0x12b')]];_0x4b5e31[_0xcd84('0x116')]=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));var _0x3ed263=_0x4b5e31[_0xcd84('0x50')]===_0xcd84('0x78')?this[_0xcd84('0x24')][_0x4b5e31[_0xcd84('0xaf')]]:this['voiceQueues'][_0x4b5e31[_0xcd84('0x19c')]()];if(!this[_0xcd84('0xd7')](_0x112d0c[_0xcd84('0x19d')])){this[_0xcd84('0xc9')](_0x3ed263);return this[_0xcd84('0x19e')](_0x4b5e31,_0x3ed263,_0x112d0c)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x19f')));}this[_0xcd84('0x2a')][_0x112d0c[_0xcd84('0xdc')]]=_0x4b5e31;}};Dialer[_0xcd84('0x1d')][_0xcd84('0x1a0')]=function(_0x239cb2,_0x197f58,_0x52d161){var _0x1342ef=new History(_0x197f58);if(_0x1342ef[_0xcd84('0xf0')]+_0x1342ef['countcongestionretry']+_0x1342ef[_0xcd84('0xf2')]+_0x1342ef[_0xcd84('0xf3')]+_0x1342ef[_0xcd84('0x101')]+_0x1342ef['countabandonedretry']+_0x1342ef[_0xcd84('0xed')]+_0x1342ef[_0xcd84('0xf5')]>=_0x52d161[_0xcd84('0xf6')]-0x1){return!![];}switch(_0x239cb2){case 0x3:if(_0x1342ef['countnoanswerretry']>=_0x52d161[_0xcd84('0x1a1')]-0x1){return!![];}this[_0xcd84('0xbc')]({'active':![],'countnoanswerretry':_0x1342ef['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x52d161['dialNoAnswerRetryFrequency'],_0xcd84('0xfa'))[_0xcd84('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1342ef[_0xcd84('0xd1')],'ListId':_0x1342ef['ListId'],'VoiceQueueId':_0x1342ef[_0xcd84('0xd3')]||undefined,'CampaignId':_0x1342ef[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1342ef[_0xcd84('0xf0')]>=_0x52d161[_0xcd84('0x1a2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x1342ef[_0xcd84('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x52d161[_0xcd84('0x1a3')],_0xcd84('0xfa'))[_0xcd84('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1342ef['ContactId'],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef[_0xcd84('0xd3')]||undefined,'CampaignId':_0x1342ef['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1a4')));break;case 0x8:if(_0x1342ef[_0xcd84('0xf1')]>=_0x52d161[_0xcd84('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x1342ef['countcongestionretry']+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0x1a6')],_0xcd84('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1342ef['ContactId'],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef['VoiceQueueId']||undefined,'CampaignId':_0x1342ef[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1a7')));break;case 0x0:if(_0x1342ef[_0xcd84('0xf3')]>=_0x52d161[_0xcd84('0x1a8')]-0x1){return!![];}else{this[_0xcd84('0xbc')]({'active':![],'countnosuchnumberretry':_0x1342ef['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0x1a9')],'minutes')['format'](_0xcd84('0xfb')),'ContactId':_0x1342ef[_0xcd84('0xd1')],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef[_0xcd84('0xd3')]||undefined,'CampaignId':_0x1342ef[_0xcd84('0xd4')]||undefined})['catch'](loggerCatch(_0xcd84('0x1aa')));}break;case 0xa:if(_0x1342ef['countdropretry']>=_0x52d161[_0xcd84('0x11c')]-0x1){return!![];}this[_0xcd84('0xbc')]({'active':![],'countdropretry':_0x1342ef[_0xcd84('0x101')]+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0x11d')],'minutes')[_0xcd84('0x75')](_0xcd84('0xfb')),'ContactId':_0x1342ef[_0xcd84('0xd1')],'ListId':_0x1342ef['ListId'],'VoiceQueueId':_0x1342ef['VoiceQueueId']||undefined,'CampaignId':_0x1342ef['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x11e')));break;case 0xb:if(_0x1342ef[_0xcd84('0xf4')]>=_0x52d161['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1342ef[_0xcd84('0xf4')]+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0x126')],_0xcd84('0xfa'))['format'](_0xcd84('0xfb')),'ContactId':_0x1342ef['ContactId'],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef[_0xcd84('0xd3')]||undefined,'CampaignId':_0x1342ef['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x127')));break;case 0x13:if(_0x1342ef[_0xcd84('0xed')]>=_0x52d161[_0xcd84('0xf7')]-0x1){return!![];}this[_0xcd84('0xbc')]({'active':![],'countmachineretry':_0x1342ef[_0xcd84('0xed')]+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0xf9')],'minutes')[_0xcd84('0x75')](_0xcd84('0xfb')),'ContactId':_0x1342ef[_0xcd84('0xd1')],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef['VoiceQueueId']||undefined,'CampaignId':_0x1342ef[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0xfd')));break;case 0x14:if(_0x1342ef['countagentrejectretry']>=_0x52d161['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xcd84('0xbc')]({'active':![],'countagentrejectretry':_0x1342ef[_0xcd84('0xf5')]+=0x1,'scheduledat':moment()[_0xcd84('0x104')](_0x52d161[_0xcd84('0x1ab')],'minutes')[_0xcd84('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1342ef[_0xcd84('0xd1')],'ListId':_0x1342ef[_0xcd84('0xfc')],'VoiceQueueId':_0x1342ef[_0xcd84('0xd3')]||undefined,'CampaignId':_0x1342ef['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1ac')));break;default:return!![];}};Dialer[_0xcd84('0x1d')]['callProgressDetecting']=function(_0x19930f,_0x5c26ac,_0xfee336){var _0x539b9a=this;var _0x1dfed4=new History(_0x19930f);return new BPromise(function(_0x1237a4,_0x1c02f0){if(_[_0xcd84('0x3e')](_0x5c26ac)&&typeof _0x5c26ac!==_0xcd84('0x170')){return _0x1c02f0(msgResponse(_0xcd84('0x1ad'),_0xcd84('0x148'),_0xcd84('0x1ae')));}if(_['isUndefined'](_0xfee336)&&typeof _0xfee336!=='object'){return _0x1c02f0(msgResponse(_0xcd84('0x1ad'),'Failure','evt\x20is\x20undefine'));}switch(_0xfee336['reason']){case'0':_0x5c26ac[_0xcd84('0x1af')]+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0x0;_0x1dfed4[_0xcd84('0xa4')]=_0xcd84('0x1b0');_0x1dfed4[_0xcd84('0xf3')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;ami[_0xcd84('0xe6')]('custom:agentnosuchnumber',ut['buildObj'](_0x19930f,_0xcd84('0x1b1')));_0x539b9a['createHistory'](_0x1dfed4)['catch'](loggerCatch(_0xcd84('0xef')));if(_0x539b9a['checkRetriveMax'](0x0,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf3')]>=_0x5c26ac[_0xcd84('0x1a8')]){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,'reason\x200\x20no\x20such\x20number....');}else{_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1b3'));}}break;case'3':_0x5c26ac[_0xcd84('0x65')]+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0x3;_0x1dfed4['statedesc']=_0xcd84('0x1b4');_0x1dfed4[_0xcd84('0xf2')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;ami[_0xcd84('0xe6')](_0xcd84('0x1b5'),ut[_0xcd84('0xe8')](_0x19930f,_0xcd84('0x1b6')));_0x539b9a['createHistory'](_0x1dfed4)[_0xcd84('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x539b9a['checkRetriveMax'](0x3,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf2')]>=_0x5c26ac[_0xcd84('0x1a1')]){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1b7'));}else{_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1b7'));}}break;case'5':_0x5c26ac[_0xcd84('0x61')]+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0x5;_0x1dfed4[_0xcd84('0xa4')]='Busy';_0x1dfed4[_0xcd84('0xf0')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;ami[_0xcd84('0xe6')](_0xcd84('0x1b8'),ut[_0xcd84('0xe8')](_0x19930f,_0xcd84('0x1b9')));_0x539b9a['createHistory'](_0x1dfed4)['catch'](loggerCatch(_0xcd84('0x1ba')));if(_0x539b9a['checkRetriveMax'](0x5,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf0')]>=_0x5c26ac[_0xcd84('0x1a2')]){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1bb'));}else{_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,'reason\x205\x20busy');}}break;case'8':_0x5c26ac[_0xcd84('0x62')]+=0x1;_0x1dfed4['state']=0x8;_0x1dfed4['statedesc']='Congestion';_0x1dfed4[_0xcd84('0xf1')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;ami['emit']('custom:agentcongestion',ut[_0xcd84('0xe8')](_0x19930f,_0xcd84('0x1bc')));_0x539b9a[_0xcd84('0xc7')](_0x1dfed4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1bd')));if(_0x539b9a['checkRetriveMax'](0x8,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf1')]>=_0x5c26ac['dialCongestionMaxRetry']){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1be'));}else{_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,'reason\x208\x20congestion');}}break;case'11':_0x5c26ac['outboundAbandonedCallsDay']+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0xb;_0x1dfed4['statedesc']=_0xcd84('0x128');_0x1dfed4[_0xcd84('0xf4')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;_0x539b9a[_0xcd84('0xc7')](_0x1dfed4)[_0xcd84('0xad')](loggerCatch(_0xcd84('0x129')));if(_0x539b9a[_0xcd84('0x1a0')](0xb,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf4')]>=_0x5c26ac[_0xcd84('0x125')]){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1bf'));}else{_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1bf'));}}break;case'20':_0x5c26ac[_0xcd84('0x67')]+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0x14;_0x1dfed4['statedesc']=_0xcd84('0x1c0');_0x1dfed4[_0xcd84('0xf5')]+=0x1;_0x1dfed4[_0xcd84('0xee')]+=0x1;ami['emit']('custom:agentreject',ut['buildObj'](_0x19930f,_0xcd84('0x1c1')));_0x539b9a[_0xcd84('0xc7')](_0x1dfed4)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x539b9a[_0xcd84('0x1a0')](0x14,_0x19930f,_0x5c26ac)){if(_0x1dfed4[_0xcd84('0xf5')]>=_0x5c26ac[_0xcd84('0x1c2')]){_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1c3'));}else{_0x539b9a['stateGlobal'](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xcd84('0x1c3'));}}break;default:_0x5c26ac[_0xcd84('0x68')]+=0x1;_0x1dfed4[_0xcd84('0xe2')]=0xc;_0x1dfed4[_0xcd84('0xa4')]=_0xfee336[_0xcd84('0x10d')];_0x539b9a[_0xcd84('0xc7')](_0x1dfed4)['catch'](loggerCatch(_0xcd84('0x1c4')));if(_0x539b9a['checkRetriveMax'](_0xfee336[_0xcd84('0x10d')],_0x19930f,_0x5c26ac)){if(_0x1dfed4['countbusyretry']+_0x1dfed4[_0xcd84('0xf1')]+_0x1dfed4[_0xcd84('0xf2')]+_0x1dfed4['countnosuchnumberretry']+_0x1dfed4[_0xcd84('0x101')]+_0x1dfed4[_0xcd84('0xf4')]+_0x1dfed4['countmachineretry']+_0x1dfed4[_0xcd84('0xf5')]>=_0x5c26ac['dialGlobalMaxRetry']){_0x539b9a[_0xcd84('0x102')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xfee336['reason']);}else{_0x539b9a[_0xcd84('0x1b2')](_0x1dfed4,_0x1237a4,_0x1c02f0,_0xfee336[_0xcd84('0x10d')]);}}}});};Dialer[_0xcd84('0x1d')][_0xcd84('0x102')]=function(_0x2786de,_0x1f5098,_0x3118eb,_0x409d5b){var _0x2d5c76=new Final(_0x2786de);_0x2d5c76['state']=0xf;_0x2d5c76[_0xcd84('0xa4')]=_0xcd84('0x1c5');this[_0xcd84('0x1b2')](_0x2d5c76,_0x1f5098,_0x3118eb,_0x409d5b);};Dialer['prototype']['createStateFinal']=function(_0x129096,_0x259ff8,_0x4382a0,_0x54da2a){this['moveContactManagedDialer'](_0x129096)['then'](function(){return _0x259ff8(msgResponse(_0xcd84('0x1ad'),_0xcd84('0xd8'),_0x54da2a));})[_0xcd84('0xad')](function(){return _0x4382a0(msgResponse(_0xcd84('0x1c6'),_0xcd84('0x148'),_0xcd84('0x1c7')));});};Dialer[_0xcd84('0x1d')][_0xcd84('0x163')]=function(_0x4f3646){var _0x4451cf=_0x4f3646[_0xcd84('0x1c8')]/0x64;var _0x24f980=_0x4f3646['outboundDropCallsDayTimeout']/(_0x4f3646['outboundDropCallsDayTimeout']+_0x4f3646['outboundAnswerCallsDay']);var _0x107090=Math[_0xcd84('0x1c9')](_0x4f3646['predictiveIntervalAvailable']*(_0x4f3646[_0xcd84('0x1ca')]/0x64));var _0x26fdef=Math['round'](_0x4f3646[_0xcd84('0x6e')]*(_0x4f3646[_0xcd84('0x1cb')]/0x64));var _0x4f8a33=_0x4f3646[_0xcd84('0x52')]+_0x4f3646[_0xcd84('0x9d')];var _0x3b270b=Math[_0xcd84('0x1cc')](_0x4f3646[_0xcd84('0x88')]*_0x4f3646[_0xcd84('0x71')]*_0x4f3646[_0xcd84('0x6c')]*_0x4f3646['predictiveIntervalMultiplicativeFactor']);if(_[_0xcd84('0x3e')](_0x4f3646['startProgressive'])){if(!_[_0xcd84('0x3e')](_0x4f3646['startPredictive'])){_0x4f3646[_0xcd84('0x8c')]=undefined;loggerPredictive['error'](_0xcd84('0x1cd'),_0xcd84('0x1ce'));}if(!_[_0xcd84('0x3e')](_0x4f3646[_0xcd84('0x1cf')])){loggerPredictive[_0xcd84('0x92')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4f3646[_0xcd84('0x1cf')]);_0x4f3646[_0xcd84('0x1cf')]=undefined;}_0x4f3646[_0xcd84('0x8b')]=moment()[_0xcd84('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4f3646[_0xcd84('0x41')],_0xcd84('0x1d0'),_0x4f3646[_0xcd84('0x8b')]);this[_0xcd84('0x160')](_0x4f3646,0x1);}else if(ifInterval(_0x4f3646[_0xcd84('0x1d1')],_0x4f3646['startProgressive'])){this[_0xcd84('0x160')](_0x4f3646,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x4f3646[_0xcd84('0x8b')],_0x4f3646[_0xcd84('0x41')]);_0x4f3646[_0xcd84('0x88')]=0x0;_0x4f3646[_0xcd84('0x119')]=0x0;}else if(_0x4451cf<_0x24f980&&_0x4f3646[_0xcd84('0x1d2')]===_0xcd84('0x1d3')){freeVariablesPredictive(_0x4f3646);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x1d4'),_0xcd84('0x1d5'),_0x24f980,'startProgressive',_0x4f3646[_0xcd84('0x41')]);}else if(_0x3b270b<_0x4f3646['predictiveIntervalErlangCallsDroppedCalls']&&_0x4f3646['dialPredictiveOptimization']===_0xcd84('0x1d3')){freeVariablesPredictive(_0x4f3646);loggerPredictive[_0xcd84('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xcd84('0x1d6'),_0x3b270b,_0xcd84('0x1d7'),_0x4f3646[_0xcd84('0x119')],_0xcd84('0x8b'),_0x4f3646[_0xcd84('0x41')]);}else if(!ifInterval(_0x4f3646[_0xcd84('0x1d1')],_0x4f3646[_0xcd84('0x8b')])&&_[_0xcd84('0x3e')](_0x4f3646['startPredictive'])&&!_[_0xcd84('0x3e')](_0x4f3646[_0xcd84('0x8b')])){_0x4f3646['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4f3646['name'],_0xcd84('0x1d8'),_0x4f3646[_0xcd84('0x8c')]);this[_0xcd84('0xb9')](_0x4f3646[_0xcd84('0x1d1')])[_0xcd84('0xb3')](this[_0xcd84('0x1d9')](_0x4f3646))[_0xcd84('0xb3')](mergeDataErlangB(_0x4f3646))[_0xcd84('0xb3')](this[_0xcd84('0x1da')](_0x4f3646))['catch'](loggerCatchPredictive(_0xcd84('0x1db'),_0x4f3646));}else if(!ifInterval(_0x4f3646[_0xcd84('0x1d1')],_0x4f3646['startPredictive'])){_0x4f3646[_0xcd84('0x119')]=0x0;_0x4f3646[_0xcd84('0x8c')]=moment()[_0xcd84('0x75')](_0xcd84('0xfb'));loggerPredictive['info'](_0x4f3646[_0xcd84('0x41')],'recalculate\x20predictive\x20at',_0x4f3646['startPredictive']);clearInterval(_0x4f3646[_0xcd84('0x1cf')]);_0x4f3646[_0xcd84('0x1cf')]=undefined;this[_0xcd84('0xb9')](_0x4f3646[_0xcd84('0x1d1')])[_0xcd84('0xb3')](this['getDataPredictive'](_0x4f3646))[_0xcd84('0xb3')](mergeDataErlangB(_0x4f3646))['then'](this[_0xcd84('0x1da')](_0x4f3646))[_0xcd84('0xad')](loggerCatchPredictive(_0xcd84('0x1dc'),_0x4f3646));}else if(_0x4f3646[_0xcd84('0x6e')]&&_0x4f8a33<_0x4f3646[_0xcd84('0x6e')]-_0x26fdef){freeVariablesPredictive(_0x4f3646);loggerPredictive[_0xcd84('0x7c')](_0x4f3646[_0xcd84('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4f8a33,_0xcd84('0x1dd'),_0x4f3646[_0xcd84('0x6e')],'-',_0x26fdef,'=',_0x4f3646[_0xcd84('0x6e')]-_0x26fdef,')');}else if(_0x4f3646[_0xcd84('0x6e')]&&_0x4f8a33>_0x4f3646[_0xcd84('0x6e')]+_0x107090){freeVariablesPredictive(_0x4f3646);loggerPredictive[_0xcd84('0x7c')](_0x4f3646[_0xcd84('0x41')],_0xcd84('0x1de'),_0x4f8a33,')\x20are\x20more\x20than\x20threshold\x20(',_0x4f3646[_0xcd84('0x6e')],'+',_0x107090,'=',_0x4f3646['predictiveIntervalAvailable']+_0x107090,')');}};Dialer[_0xcd84('0x1d')][_0xcd84('0x1d9')]=function(_0x569e88){var _0x4a5965=this;return function(_0x459392){return new BPromise(function(_0x3b9ef6,_0x363cd5){_['merge'](_0x569e88,_0x459392[0x0]);if(checkGetDataPredictive(_0x459392[0x0])){var _0x94f8d8=_0x569e88['predictiveIntervalAvailable']=_0x569e88[_0xcd84('0x9d')]+_0x569e88[_0xcd84('0x52')];var _0x2d8d4b=_0x569e88[_0xcd84('0x1d1')]*0x3c;var _0x570b95=_0x459392[0x0][_0xcd84('0x69')]+_0x459392[0x0][_0xcd84('0x81')];var _0x2d10f9=(_0x459392[0x0][_0xcd84('0x1df')]+_0x459392[0x0][_0xcd84('0x6b')]+_0x459392[0x0][_0xcd84('0x6a')])/_0x459392[0x0][_0xcd84('0x7d')];_0x569e88['predictiveIntervalHitRate']=_0x2d10f9>0x0?_0x2d10f9:0x1;switch(_0x569e88[_0xcd84('0x1d2')]){case'dropRate':var _0x52c811=_0x569e88['dialPredictiveOptimizationPercentage']/0x64;return _0x4a5965[_0xcd84('0x1e0')](_0x94f8d8,_0x2d8d4b,_0x570b95,_0x2d10f9,_0x52c811)[_0xcd84('0xb3')](function(_0x20a2b7){return _0x3b9ef6(_0x20a2b7);});case _0xcd84('0x1e1'):var _0x57f8c2=_0x569e88[_0xcd84('0x1c8')]/0x64;return _0x4a5965['busyFactor'](_0x94f8d8,_0x2d8d4b,_0x570b95,_0x2d10f9,_0x57f8c2)[_0xcd84('0xb3')](function(_0x5ac017){return _0x3b9ef6(_0x5ac017);});default:return _0x363cd5(msgResponse(_0xcd84('0x1e2'),_0xcd84('0x148'),'Unknown\x20Predictive'));}}else{return _0x363cd5(msgResponse(_0xcd84('0x1e2'),_0xcd84('0x148'),_0xcd84('0x1e3')));}});};};Dialer[_0xcd84('0x1d')][_0xcd84('0x1e4')]=function(_0x202278){var _0x527982=this;return function(_0x415498){return new BPromise(function(_0x415930,_0x5e1239){_['merge'](_0x202278,_0x415498[0x0]);if(checkGetDataPredictive(_0x415498[0x0])){loggerPredictive[_0xcd84('0x7c')](JSON[_0xcd84('0x4c')](_0x415498[0x0]));if(_0x202278[_0xcd84('0x1d2')]===_0xcd84('0x1d3')){return _0x527982[_0xcd84('0xc4')](_0x202278['id'])[_0xcd84('0xb3')](function(_0x40d1ab){var _0x2273a8=_0x202278['loggedIn']-_0x40d1ab[0x0]['outboundQueuePauses'];var _0x39739c=_0x202278[_0xcd84('0x1d1')]*0x3c;var _0x2329d5=_0x415498[0x0]['predictiveIntervalAvgTalktime']+_0x415498[0x0]['predictiveIntervalAvgHoldtime'];var _0x2dd7ee=(_0x415498[0x0][_0xcd84('0x1df')]+_0x415498[0x0][_0xcd84('0x6b')]+_0x415498[0x0][_0xcd84('0x6a')])/_0x415498[0x0][_0xcd84('0x7d')];var _0x48d8a4=_0x202278[_0xcd84('0x1c8')]/0x64;_0x202278[_0xcd84('0x6d')]=_0x40d1ab[0x0][_0xcd84('0x1e5')]||0x0;_0x202278[_0xcd84('0x6c')]=_0x2dd7ee>0x0?_0x2dd7ee:0x1;return _0x527982['abandonmentRate'](_0x2273a8,_0x39739c,_0x2329d5,_0x2dd7ee,_0x48d8a4);})[_0xcd84('0xb3')](function(_0x17b62a){return _0x415930(_0x17b62a);})[_0xcd84('0xad')](function(_0x40c41c){return _0x5e1239(msgResponse(_0xcd84('0x1e6'),_0xcd84('0x148'),JSON[_0xcd84('0x4c')](_0x40c41c)));});}if(_0x202278[_0xcd84('0x1d2')]===_0xcd84('0x1e1')){return _0x527982['getVoiceQueueRtPauses'](_0x202278['id'])[_0xcd84('0xb3')](function(_0x52b22b){var _0x3ecae3=_0x202278['loggedIn']-_0x52b22b[0x0][_0xcd84('0x1e5')];var _0x462fb6=_0x202278[_0xcd84('0x1d1')]*0x3c;var _0x13a336=_0x415498[0x0][_0xcd84('0x69')]+_0x415498[0x0][_0xcd84('0x81')];var _0x2dab96=(_0x415498[0x0][_0xcd84('0x1df')]+_0x415498[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x415498[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x415498[0x0][_0xcd84('0x7d')];var _0x2a299c=_0x202278['dialPredictiveOptimizationPercentage']/0x64;_0x202278['predictiveIntervalPauses']=_0x52b22b[0x0]['outboundQueuePauses']||0x0;_0x202278[_0xcd84('0x6c')]=_0x2dab96>0x0?_0x2dab96:0x1;return _0x527982[_0xcd84('0x1e7')](_0x3ecae3,_0x462fb6,_0x13a336,_0x2dab96,_0x2a299c);})[_0xcd84('0xb3')](function(_0x58d3e2){return _0x415930(_0x58d3e2);})['catch'](function(_0x24bc9b){return _0x5e1239(msgResponse(_0xcd84('0x1e6'),_0xcd84('0x148'),JSON['stringify'](_0x24bc9b)));});}}else{return _0x5e1239(msgResponse(_0xcd84('0x1e2'),_0xcd84('0x148'),_0xcd84('0x1e3')));}});};};Dialer[_0xcd84('0x1d')]['startMethodPredictive']=function(_0x358804){var _0xda452d=this;return function(){var _0xd4473e=0x0;var _0x15e335=Math[_0xcd84('0x1cc')](_0x358804[_0xcd84('0x70')]*0x3e8);if(_0x15e335>0x0){_0x15e335=_0x15e335<0x64?0x64:_0x15e335;loggerPredictive[_0xcd84('0x7c')](_0x358804[_0xcd84('0x41')],_0xcd84('0x1e8'),_0x15e335,_0xcd84('0x4d'));_0x358804[_0xcd84('0x1cf')]=setInterval(function(){_0xda452d[_0xcd84('0x1cf')](_0x358804);loggerPredictiveCalls[_0xcd84('0x7c')]('[handlePredictive]',_0xd4473e+=0x1);},_0x15e335);}else{loggerPredictive[_0xcd84('0x7c')](_0x358804['name'],_0xcd84('0x1e9'));}};};Dialer[_0xcd84('0x1d')]['checkContactBlack']=function(_0x146833,_0x4d22b0){var _0x196185=this;return function(_0x1ef373){if(_['isEmpty'](_0x1ef373)){if(_[_0xcd84('0xaa')](_0x4d22b0[_0xcd84('0xd2')])||!_0x4d22b0[_0xcd84('0x1ea')]){if(_0x146833['dialMethod']===_0xcd84('0xb')){_0x146833[_0xcd84('0x132')]=_[_0xcd84('0x3e')](_0x146833['queueStatusComplete'])?!![]:_0x146833['queueStatusComplete'];var _0x438196=uuid['v4']();_0x196185['actions'][_0x438196]=new Action(_0x146833,_0x4d22b0,_0x438196);loggerBooked['info'](_0xcd84('0x1eb'),_0x438196,_0xcd84('0x1ec'),JSON[_0xcd84('0x4c')](_0x146833['queueStatusComplete']),_0xcd84('0x1ed'),_0x146833['name']);if(_0x146833[_0xcd84('0x132')]){_0x146833[_0xcd84('0x132')]=![];_0x196185['queueBooked'][_0x196185[_0xcd84('0xa8')][_0x438196][_0xcd84('0xaf')]]=[];ami[_0xcd84('0x14f')]({'actionid':_0x438196,'action':_0xcd84('0x1ee'),'queue':_0x146833['name']})[_0xcd84('0xad')](function(){_0x196185[_0xcd84('0xc9')](_0x146833);_0x196185['rescheduleContact']({'active':![],'ContactId':_0x196185[_0xcd84('0xa8')][_0x438196][_0xcd84('0xd1')],'ListId':_0x196185[_0xcd84('0xa8')][_0x438196][_0xcd84('0xfc')],'VoiceQueueId':_0x196185[_0xcd84('0xa8')][_0x438196][_0xcd84('0xd3')]||undefined,'CampaignId':_0x196185[_0xcd84('0xa8')][_0x438196]['CampaignId']||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1ef')));delete _0x196185[_0xcd84('0xa8')][_0x438196];});}else{loggerBooked[_0xcd84('0x7c')]('[booked][checkContactBlack][else]',JSON[_0xcd84('0x4c')](_0x146833[_0xcd84('0x132')]),_0xcd84('0x1ed'),_0x146833['name']);_0x196185[_0xcd84('0xc9')](_0x146833);_0x196185[_0xcd84('0xbc')]({'active':![],'ContactId':_0x196185[_0xcd84('0xa8')][_0x438196][_0xcd84('0xd1')],'ListId':_0x196185[_0xcd84('0xa8')][_0x438196]['ListId'],'VoiceQueueId':_0x196185[_0xcd84('0xa8')][_0x438196]['VoiceQueueId']||undefined,'CampaignId':_0x196185['actions'][_0x438196][_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1ef')));delete _0x196185['actions'][_0x438196];}}else{return _0x196185[_0xcd84('0x16f')](_0x146833,_0x4d22b0);}}else{if(getDiff(_0x4d22b0[_0xcd84('0x1f0')])<_0x146833['dialRecallMeTimeout']*0x3c){if(_0x4d22b0[_0xcd84('0x1f1')]&&!_0x4d22b0[_0xcd84('0x1f1')]['voicePause']){_0x196185[_0xcd84('0x22')][_0xcd84('0x136')](_0x4d22b0['id'])[_0xcd84('0x20')](function(){_0x196185[_0xcd84('0xc9')](_0x146833);});}else{_0x196185[_0xcd84('0xbe')]({'active':![]},_0x4d22b0['id'],0x1)[_0xcd84('0x20')](function(){_0x196185[_0xcd84('0xc9')](_0x146833);});}}else{_0x146833[_0xcd84('0x1f2')]+=0x1;_0x196185['updateOriginated'](_0x146833);if(_0x146833['dialRecallInQueue']){_0x196185[_0xcd84('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d22b0[_0xcd84('0xd1')],'ListId':_0x4d22b0[_0xcd84('0xfc')],'VoiceQueueId':_0x4d22b0[_0xcd84('0xd3')]||undefined,'CampaignId':_0x4d22b0[_0xcd84('0xd4')]||undefined})[_0xcd84('0xad')](loggerCatch(_0xcd84('0x1f3')));_0x196185[_0xcd84('0xc7')](createObjHistory(_0x146833,_0x4d22b0,_0xcd84('0x1f4'),0x17,'RecallInQueue'))[_0xcd84('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x196185[_0xcd84('0xce')](createObjHistory(_0x146833,_0x4d22b0,'RECALLFAILEDTIMEOUT',0x16,_0xcd84('0x1f5')),'[Originate][HistoryRecallClose][historyCatch]',_0xcd84('0x1f6'));}}}}else{_0x146833[_0xcd84('0x60')]+=0x1;_0x196185[_0xcd84('0xce')](createObjHistory(_0x146833,_0x4d22b0,'BLACKLIST',0xd,_0xcd84('0x1f7')),_0xcd84('0x1f8'),_0xcd84('0x1f9'));throw _0xcd84('0x1fa');}};};Dialer['prototype'][_0xcd84('0x167')]=function(_0x568292){var _0x1f2d57=this;var _0x48da92=_0x568292[_0xcd84('0x1fb')]-_0x568292['originated']-_0x568292[_0xcd84('0xc0')];emitCampaignSummary(_0x568292);if(_0x48da92>0x0){if(_0x48da92>this[_0xcd84('0x27')]){_0x48da92=this[_0xcd84('0x27')];}_0x568292['temp']+=_0x48da92;this[_0xcd84('0xc2')](_0x568292['id'],_0x48da92,_0x568292[_0xcd84('0x1fc')],_0x568292)[_0xcd84('0xb3')](function(_0x328527){_0x568292[_0xcd84('0xc0')]-=_0x48da92;_0x568292[_0xcd84('0xc0')]=_0x568292[_0xcd84('0xc0')]>0x0?_0x568292[_0xcd84('0xc0')]:0x0;if(!checkContactEmpty(_0x328527)){_0x568292['message']=_0xcd84('0x9b');logger['info'](_0xcd84('0x1fd')+_0x568292['name']);}else{_0x568292[_0xcd84('0x6f')]+=_0x328527[_0xcd84('0x95')];_0x568292[_0xcd84('0x3f')]='RUNNING';for(var _0x212e02=0x0;_0x212e02<_0x328527[_0xcd84('0x95')];_0x212e02+=0x1){_0x568292['ivrTotalCallsDays']+=0x1;if(_[_0xcd84('0xaa')](_0x328527[_0x212e02])||_[_0xcd84('0xaa')](_0x328527[_0x212e02]['Contact'])||_['isNil'](_0x328527[_0x212e02]['Contact'][_0xcd84('0x172')])){_0x1f2d57[_0xcd84('0xcd')](_0xcd84('0x1fe'),_0x568292,_0x328527[_0x212e02]);}else{_0x1f2d57[_0xcd84('0xb7')](_[_0xcd84('0xd0')](_0x328527[_0x212e02],[_0xcd84('0xd4'),_0xcd84('0x1ff')]))[_0xcd84('0xb3')](_0x1f2d57[_0xcd84('0x200')](_0x568292,_0x328527[_0x212e02]))['catch'](_0x1f2d57[_0xcd84('0xcc')](_0xcd84('0x201'),_0x568292));}}}})['catch'](loggerGetContactDialer(_0xcd84('0x202'),_0x568292,_0x48da92));}};Dialer[_0xcd84('0x1d')][_0xcd84('0x160')]=function(_0x1c9020,_0x1d8732){var _0x5d1926=this;var _0x15a123=[];var _0x1454ed=_0x1d8732>=0x1?_0x1d8732:0x1;if(_0x1c9020['dialMethod']===_0xcd84('0xb')){_0x1454ed=0x1;}var _0x9e8e06=Math['floor'](_0x1c9020[_0xcd84('0x52')]*_0x1454ed)-_0x1c9020[_0xcd84('0x6f')]-_0x1c9020['temp'];emitVoiceQueueSummary(_0x1c9020);if(_0x1c9020[_0xcd84('0x203')]>0x0){var _0x2e4da9=_0x1c9020[_0xcd84('0x203')]-_0x1c9020['originated']-_0x1c9020['talking']-_0x1c9020[_0xcd84('0xc0')]-_0x1c9020['pTalking'];if(_0x9e8e06>_0x2e4da9){_0x9e8e06=_0x2e4da9;}}if(_0x9e8e06>0x0){if(_0x1c9020[_0xcd84('0x5a')]===_0xcd84('0xb')){_0x9e8e06=0x1;}if(_0x9e8e06>this[_0xcd84('0x27')]){_0x9e8e06=this[_0xcd84('0x27')];}_0x1c9020[_0xcd84('0xc0')]+=_0x9e8e06;for(var _0x9b91e in this[_0xcd84('0x25')]){if(typeof this[_0xcd84('0x25')][_0x9b91e]!==_0xcd84('0xca')){if(this[_0xcd84('0x25')][_0x9b91e]['state']===_0xcd84('0x204')&&this[_0xcd84('0x25')][_0x9b91e][_0xcd84('0xab')]===_0xcd84('0xda')){_0x15a123[_0xcd84('0x14e')](this[_0xcd84('0x25')][_0x9b91e]['id']);}}}this[_0xcd84('0xbf')](_0x1c9020['id'],_0x15a123,_0x9e8e06,_0x1c9020[_0xcd84('0x1fc')],_0x1c9020)['then'](function(_0xb884bc){_0x1c9020['temp']-=_0x9e8e06;_0x1c9020[_0xcd84('0xc0')]=_0x1c9020[_0xcd84('0xc0')]>0x0?_0x1c9020[_0xcd84('0xc0')]:0x0;if(!checkContactEmpty(_0xb884bc)){_0x5d1926[_0xcd84('0xb2')](_0x1c9020)[_0xcd84('0xb3')](sendMessageReschedule(_0x1c9020))[_0xcd84('0xad')](loggerCatch(_0xcd84('0xb4')));}else{_0x1c9020[_0xcd84('0x6f')]+=_0xb884bc[_0xcd84('0x95')];_0x1c9020['message']=_0x1c9020[_0xcd84('0x5a')]===_0xcd84('0xb')?_0xcd84('0x179'):_0xcd84('0x205');for(var _0x5191c9=0x0;_0x5191c9<_0xb884bc['length'];_0x5191c9+=0x1){if(_[_0xcd84('0xaa')](_0xb884bc[_0x5191c9])||_[_0xcd84('0xaa')](_0xb884bc[_0x5191c9][_0xcd84('0x173')])||_[_0xcd84('0xaa')](_0xb884bc[_0x5191c9][_0xcd84('0x173')][_0xcd84('0x172')])){_0x5d1926[_0xcd84('0xcd')]('[actionOriginate]\x20',_0x1c9020,_0xb884bc[_0x5191c9]);}else{_0x5d1926[_0xcd84('0xb5')](_[_0xcd84('0xd0')](_0xb884bc[_0x5191c9],['VoiceQueueId',_0xcd84('0x1ff')]))[_0xcd84('0xb3')](_0x5d1926[_0xcd84('0x200')](_0x1c9020,_0xb884bc[_0x5191c9]))[_0xcd84('0xad')](_0x5d1926['loggerHandler'](_0xcd84('0x1fe'),_0x1c9020));}}}})[_0xcd84('0xad')](loggerGetContactDialer(_0xcd84('0x206'),_0x1c9020,_0x9e8e06));}};Dialer[_0xcd84('0x1d')][_0xcd84('0x1cf')]=function(_0x22bce2){if(_0x22bce2[_0xcd84('0x203')]>0x0){var _0x232687=_0x22bce2[_0xcd84('0x203')]-_0x22bce2['originated']-_0x22bce2[_0xcd84('0x9d')];if(_0x232687>0x0){this[_0xcd84('0x207')](_0x22bce2);}else{loggerPredictiveCalls[_0xcd84('0x7c')](_0xcd84('0x208'));}}else{this[_0xcd84('0x207')](_0x22bce2);}};Dialer['prototype'][_0xcd84('0x207')]=function(_0x17fd1e){var _0x1bbd19=this;var _0x90c1e5=[];_0x17fd1e[_0xcd84('0x6f')]+=0x1;for(var _0x57dad1 in this[_0xcd84('0x25')]){if(typeof this[_0xcd84('0x25')][_0x57dad1]!==_0xcd84('0xca')){if(this[_0xcd84('0x25')][_0x57dad1][_0xcd84('0xe2')]===_0xcd84('0x204')&&this[_0xcd84('0x25')][_0x57dad1][_0xcd84('0xab')]==='reachable'){_0x90c1e5[_0xcd84('0x14e')](this[_0xcd84('0x25')][_0x57dad1]['id']);}}}this[_0xcd84('0xbf')](_0x17fd1e['id'],_0x90c1e5,0x1,_0x17fd1e['dialOrderByScheduledAt'],_0x17fd1e)[_0xcd84('0xb3')](function(_0x5655aa){if(!checkContactEmpty(_0x5655aa)){checkContactLowerLimitOriginate(_0x17fd1e,0x1,0x0);_0x1bbd19[_0xcd84('0xb2')](_0x17fd1e)[_0xcd84('0xb3')](sendMessageReschedule(_0x17fd1e))[_0xcd84('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x17fd1e[_0xcd84('0x3f')]=_0xcd84('0x205');if(_[_0xcd84('0xaa')](_0x5655aa[0x0])||_[_0xcd84('0xaa')](_0x5655aa[0x0][_0xcd84('0x173')])||_[_0xcd84('0xaa')](_0x5655aa[0x0]['Contact'][_0xcd84('0x172')])){_0x1bbd19[_0xcd84('0xcd')]('[actionOriginate]\x20',_0x17fd1e,_0x5655aa[0x0]);}else{_0x1bbd19[_0xcd84('0xb5')](_[_0xcd84('0xd0')](_0x5655aa[0x0],['VoiceQueueId',_0xcd84('0x1ff')]))[_0xcd84('0xb3')](_0x1bbd19[_0xcd84('0x200')](_0x17fd1e,_0x5655aa[0x0]))[_0xcd84('0xad')](_0x1bbd19['loggerHandler'](_0xcd84('0x209'),_0x17fd1e));}}})[_0xcd84('0xad')](loggerGetContactDialer(_0xcd84('0x20a'),_0x17fd1e,0x1));emitVoiceQueueSummary(_0x17fd1e);};Dialer[_0xcd84('0x1d')][_0xcd84('0x1e0')]=function(_0x40caa2,_0x3bbf2a,_0x53d402,_0x7cd9e4,_0x895525,_0x356fd9){loggerPredictive[_0xcd84('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0xcd84('0x20b'),_0x40caa2);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x20c'),_0x3bbf2a);loggerPredictive['info'](_0xcd84('0x20d'),_0x53d402);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x20e'),_0x7cd9e4);loggerPredictive['info'](_0xcd84('0x20f'),_0x895525);loggerPredictive['info'](_0xcd84('0x82'));return new BPromise(function(_0xdc4d1f,_0x20e6dd){if(_0x40caa2<=0x0||isNaN(_0x40caa2)){return _0x20e6dd(msgResponse(_0xcd84('0x210'),'Error',_0xcd84('0x211')+_0x40caa2));}if(_0x53d402<=0x0||isNaN(_0x53d402)){return _0x20e6dd(msgResponse('[abandonmentRate]',_0xcd84('0x4b'),'Ts\x20=\x20'+_0x53d402));}if(_0x7cd9e4<=0x0||isNaN(_0x7cd9e4)){return _0x20e6dd(msgResponse(_0xcd84('0x210'),'Error',_0xcd84('0x212')+_0x7cd9e4));}if(_0x3bbf2a<=0x0||isNaN(_0x3bbf2a)){return _0x20e6dd(msgResponse(_0xcd84('0x210'),_0xcd84('0x4b'),_0xcd84('0x213')+_0x3bbf2a));}if(_0x895525<=0x0||isNaN(_0x895525)){return _0x20e6dd(msgResponse('[abandonmentRate]','Error',_0xcd84('0x214')+_0x895525));}_0x356fd9=_0x356fd9||0x0;var _0x4758a4=0x1/_0x53d402;var _0x37c07c=0x0;var _0x1135d0=0x0;var _0x5ea408=0x0;var _0x416f80=0x0;for(var _0x55551b=0x0;_0x5ea408<_0x895525;_0x55551b+=0x1){_0x1135d0=_0x55551b/_0x3bbf2a;_0x37c07c=(_0x7cd9e4*_0x1135d0+_0x356fd9)/_0x4758a4;_0x5ea408=erlangb(_0x37c07c,_0x40caa2);_0x416f80=_0x37c07c/_0x40caa2*(0x1-erlangb(_0x37c07c,_0x40caa2));}return _0xdc4d1f({'erlangCalls':_0x55551b,'erlangCallToSecond':_0x3bbf2a/_0x55551b,'erlangAbandonmentRate':_0x5ea408,'erlangBusyFactor':_0x416f80});});};Dialer[_0xcd84('0x1d')][_0xcd84('0x1e7')]=function(_0xde9920,_0x1e0f39,_0x16e4c9,_0x521737,_0x38aac6,_0x4d56f3){loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x215'));loggerPredictive['info'](_0xcd84('0x20b'),_0xde9920);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x20c'),_0x1e0f39);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x20d'),_0x16e4c9);loggerPredictive['info'](_0xcd84('0x20e'),_0x521737);loggerPredictive[_0xcd84('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38aac6);loggerPredictive[_0xcd84('0x7c')](_0xcd84('0x82'));return new BPromise(function(_0x48ce81,_0x4b5464){if(_0xde9920<=0x0||isNaN(_0xde9920)){return _0x4b5464(msgResponse('[busyFactor]','Error',_0xcd84('0x211')+_0xde9920));}if(_0x16e4c9<=0x0||isNaN(_0x16e4c9)){return _0x4b5464(msgResponse('[busyFactor]',_0xcd84('0x4b'),_0xcd84('0x216')+_0x16e4c9));}if(_0x521737<=0x0||isNaN(_0x521737)){return _0x4b5464(msgResponse(_0xcd84('0x217'),_0xcd84('0x4b'),_0xcd84('0x212')+_0x521737));}if(_0x1e0f39<=0x0||isNaN(_0x1e0f39)){return _0x4b5464(msgResponse(_0xcd84('0x217'),_0xcd84('0x4b'),'interval\x20=\x20'+_0x1e0f39));}if(_0x38aac6<=0x0||isNaN(_0x38aac6)){return _0x4b5464(msgResponse(_0xcd84('0x217'),_0xcd84('0x4b'),_0xcd84('0x218')+_0x38aac6));}_0x4d56f3=_0x4d56f3||0x0;var _0x38adb0=0x1/_0x16e4c9;var _0x447204=0x0;var _0x3d4b21=0x0;var _0x421978=0x0;var _0x3f01f6=0x0;for(var _0x1faf29=0x0;_0x3f01f6<_0x38aac6;_0x1faf29+=0x1){_0x3d4b21=_0x1faf29/_0x1e0f39;_0x447204=(_0x521737*_0x3d4b21+_0x4d56f3)/_0x38adb0;_0x421978=erlangb(_0x447204,_0xde9920);_0x3f01f6=_0x447204/_0xde9920*(0x1-erlangb(_0x447204,_0xde9920));}return _0x48ce81({'erlangCalls':_0x1faf29,'erlangCallToSecond':_0x1e0f39/_0x1faf29,'erlangAbandonmentRate':_0x421978,'erlangBusyFactor':_0x3f01f6});});};module[_0xcd84('0x219')]=Dialer; \ No newline at end of file +var _0x3ae9=['\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','erlangAbandonmentRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','Agent','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','available','dialLimitQueue','not_inuse','Contact.phone','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','env','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','sumDuration','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','erlangCalls','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countdropretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','agent','agiafterat','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','roundrobin','locked','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','paused','[booked][RR]','contactAgent-idHopper:\x20','unlockRR','preview','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup'];(function(_0x3b854f,_0x1d3232){var _0x12cf64=function(_0x166ffa){while(--_0x166ffa){_0x3b854f['push'](_0x3b854f['shift']());}};_0x12cf64(++_0x1d3232);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x3ae9[_0x4c12ec];return _0x3ae42c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x93ae('0x0'));var uuid=require(_0x93ae('0x1'));var moment=require(_0x93ae('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x93ae('0x3'));var ut=require(_0x93ae('0x4'));var config=require(_0x93ae('0x5'));var logger=require(_0x93ae('0x6'))('dialer');var loggerBooked=require(_0x93ae('0x6'))('booked');var loggerPredictive=require(_0x93ae('0x6'))(_0x93ae('0x7'));var loggerPredictiveCalls=require(_0x93ae('0x6'))(_0x93ae('0x8'));var loggerSyncQueueSummary=require(_0x93ae('0x6'))(_0x93ae('0x9'));var ami=require('../ami');config[_0x93ae('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x93ae('0xb'))(new Redis(config[_0x93ae('0xa')]));var cmHopper=require(_0x93ae('0xc'));var cmHopperHistory=require(_0x93ae('0xd'));var cmHopperBlack=require(_0x93ae('0xe'));var voiceQueueRt=require(_0x93ae('0xf'));var Action=require('./action');var History=require('./history');var Final=require(_0x93ae('0x10'));var AgentComplete=require(_0x93ae('0x11'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x93ae('0x12')]['XCALLY_IP_AGI']||_0x93ae('0x13');var strategy={'rrmemory':_0x93ae('0x14'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x93ae('0x15')][_0x93ae('0x16')]=function(_0x3c38b9){this[_0x93ae('0x17')]=this[_0x93ae('0x17')]?this[_0x93ae('0x17')]['finally'](_0x3c38b9):_0x3c38b9();};function Dialer(_0x11a9ce,_0x282094){this[_0x93ae('0x18')]=new Sequence();this['preview']=_0x282094;this[_0x93ae('0x19')]=_0x11a9ce['voiceQueues'];this['campaigns']=_0x11a9ce[_0x93ae('0x1a')];this['agents']=_0x11a9ce[_0x93ae('0x1b')];this[_0x93ae('0x1c')]=_0x11a9ce['trunks'];this[_0x93ae('0x1d')]=config[_0x93ae('0x1d')]||0x2;this[_0x93ae('0x1e')]={};this[_0x93ae('0x1f')]={};this['contactsId']={};this[_0x93ae('0x20')]={};this[_0x93ae('0x21')]={};this['startPredictive']={};this[_0x93ae('0x22')]={};this[_0x93ae('0x23')]={};this[_0x93ae('0x24')]={};this[_0x93ae('0x25')]={};ami['on'](_0x93ae('0x26'),this[_0x93ae('0x27')][_0x93ae('0x28')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x29'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x93ae('0x2a'),this[_0x93ae('0x2b')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2c'),this[_0x93ae('0x9')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2d'),this[_0x93ae('0x2e')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2f'),this[_0x93ae('0x30')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x31'),this[_0x93ae('0x32')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x93ae('0x33')][_0x93ae('0x28')](this));this[_0x93ae('0x34')]();this[_0x93ae('0x35')]();}function isNotNull(_0x485622){return _0x485622!==null&&!_['isUndefined'](_0x485622);}function checkIsLoggedIn(_0x554318,_0x19aaaa){return function(){if(_0x19aaaa<=0x0){_0x554318['message']=_0x93ae('0x36');throw _0x554318[_0x93ae('0x37')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4369c2){return _0x4369c2;}function checkIsActive(_0x1554cf,_0x11359d){return function(){if(!isActive(_0x11359d)){_0x1554cf[_0x93ae('0x38')]=_0x93ae('0x39');throw _0x1554cf[_0x93ae('0x37')]+_0x93ae('0x3a');}};}function checkInterval(_0x371c53){return function(){if(!isNotNull(_0x371c53['Interval'])){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53[_0x93ae('0x37')]+_0x93ae('0x3c');}if(!isNotNull(_0x371c53[_0x93ae('0x3d')][_0x93ae('0x3e')])){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53['name']+_0x93ae('0x3c');}if(!isNotNull(_['isEmpty'](_0x371c53[_0x93ae('0x3d')][_0x93ae('0x3e')]))){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53[_0x93ae('0x37')]+_0x93ae('0x3c');}};}function msgResponse(_0x47ed0b,_0x1b9777,_0x1453c0){return{'action':_0x47ed0b,'response':_0x1b9777,'message':_0x1453c0,'stack':_0x1453c0};}function myreject(_0x2aa4ae){return function(_0x4fab04){return _0x2aa4ae(msgResponse(_0x93ae('0x3f'),_0x93ae('0x40'),JSON[_0x93ae('0x41')](_0x4fab04)));};}function getSeconds(_0x4d4712,_0x588916){var _0x2e5b91=moment(_0x4d4712)[_0x93ae('0x42')](0x0);var _0x31e9b0=moment(_0x588916)[_0x93ae('0x42')](0x0);return _0x2e5b91[_0x93ae('0x43')](_0x31e9b0,_0x93ae('0x44'));}function emit(_0xc588e4,_0x4319ed,_0x174dca){io['to'](_0xc588e4)[_0x93ae('0x45')](_0x4319ed,_0x174dca);}function emitVoiceQueueSummary(_0x6ee0de){if(_0x6ee0de[_0x93ae('0x46')]===_0x93ae('0x47')){var _0x3fdf77={'id':_0x6ee0de['id'],'name':_0x6ee0de['name'],'strategy':_0x6ee0de[_0x93ae('0x48')],'answered':_0x6ee0de[_0x93ae('0x49')],'available':_0x6ee0de['available'],'loggedIn':_0x6ee0de[_0x93ae('0x4a')],'pTalking':_0x6ee0de['pTalking'],'sumBillable':_0x6ee0de['sumBillable'],'sumDuration':_0x6ee0de[_0x93ae('0x4b')],'sumHoldTime':_0x6ee0de['sumHoldTime']||0x0,'talking':_0x6ee0de[_0x93ae('0x4c')],'total':_0x6ee0de[_0x93ae('0x4d')],'type':_0x6ee0de[_0x93ae('0x46')],'unmanaged':_0x6ee0de[_0x93ae('0x4e')],'abandoned':_0x6ee0de[_0x93ae('0x4f')],'waiting':_0x6ee0de[_0x93ae('0x50')],'loggedInDb':_0x6ee0de['loggedInDb'],'dialActive':_0x6ee0de[_0x93ae('0x51')],'dialMethod':_0x6ee0de[_0x93ae('0x52')],'dialOriginateCallerIdName':_0x6ee0de[_0x93ae('0x53')],'dialOriginateCallerIdNumber':_0x6ee0de[_0x93ae('0x54')],'dialOriginateTimeout':_0x6ee0de[_0x93ae('0x55')],'dialPrefix':_0x6ee0de[_0x93ae('0x56')],'outboundAnswerAgiCallsDay':_0x6ee0de[_0x93ae('0x57')],'outboundAnswerCallsDay':_0x6ee0de[_0x93ae('0x58')],'outboundBlacklistCallsDay':_0x6ee0de[_0x93ae('0x59')],'outboundBusyCallsDay':_0x6ee0de[_0x93ae('0x5a')],'outboundCongestionCallsDay':_0x6ee0de[_0x93ae('0x5b')],'outboundDropCallsDayACS':_0x6ee0de['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x6ee0de[_0x93ae('0x5c')],'outboundDropCallsDayTimeout':_0x6ee0de[_0x93ae('0x5d')],'outboundNoAnswerCallsDay':_0x6ee0de['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x6ee0de['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x6ee0de[_0x93ae('0x5e')],'outboundReCallsDay':_0x6ee0de[_0x93ae('0x5f')],'outboundRejectCallsDay':_0x6ee0de[_0x93ae('0x60')],'outboundUnknownCallsDay':_0x6ee0de[_0x93ae('0x61')],'predictiveIntervalAnsweredCalls':_0x6ee0de[_0x93ae('0x62')],'predictiveIntervalAvgHoldtime':_0x6ee0de[_0x93ae('0x63')],'predictiveIntervalAvgTalktime':_0x6ee0de[_0x93ae('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x6ee0de[_0x93ae('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x6ee0de['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x6ee0de[_0x93ae('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x6ee0de[_0x93ae('0x67')],'predictiveIntervalHitRate':_0x6ee0de[_0x93ae('0x68')],'predictiveIntervalMultiplicativeFactor':_0x6ee0de[_0x93ae('0x69')],'predictiveIntervalPauses':_0x6ee0de[_0x93ae('0x6a')],'predictiveIntervalAvailable':_0x6ee0de['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x6ee0de['predictiveIntervalTotalCalls'],'message':_0x6ee0de[_0x93ae('0x38')],'originated':_0x6ee0de['originated'],'erlangCalls':_0x6ee0de[_0x93ae('0x6b')],'erlangCallToSecond':_0x6ee0de['erlangCallToSecond'],'erlangAbandonmentRate':_0x6ee0de['erlangAbandonmentRate'],'erlangBusyFactor':_0x6ee0de[_0x93ae('0x6c')],'startPredictive':_0x6ee0de[_0x93ae('0x6d')],'startProgressive':_0x6ee0de[_0x93ae('0x22')]};if(_0x6ee0de[_0x93ae('0x6e')]){_0x3fdf77[_0x93ae('0x6e')]={'id':_0x6ee0de[_0x93ae('0x6e')]['id'],'name':_0x6ee0de[_0x93ae('0x6e')]['name'],'active':_0x6ee0de[_0x93ae('0x6e')]['active'],'callerid':_0x6ee0de['Trunk'][_0x93ae('0x6f')]};}if(_0x6ee0de[_0x93ae('0x3d')]){_0x3fdf77[_0x93ae('0x3d')]={'id':_0x6ee0de[_0x93ae('0x3d')]['id'],'name':_0x6ee0de['Interval'][_0x93ae('0x37')]};}var _0x4e7652=md5(JSON[_0x93ae('0x41')](_0x3fdf77));if(_0x6ee0de[_0x93ae('0x70')]!==_0x4e7652){_0x6ee0de[_0x93ae('0x70')]=_0x4e7652;emit(util[_0x93ae('0x71')](_0x93ae('0x72'),_0x3fdf77[_0x93ae('0x37')]),_0x93ae('0x73'),_0x3fdf77);}}}function emitCampaignSummary(_0x411ec6){if(_0x411ec6[_0x93ae('0x46')]==='ivr'){emit(util['format']('campaign:ivr:%s',_0x411ec6['name']),'campaign:save',_0x411ec6);}}function checkGetDataPredictive(_0x2a837b){if(isNotNull(_0x2a837b)&&!_[_0x93ae('0x74')](_0x2a837b)){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x76'));loggerPredictive['info'](_0x93ae('0x77'),_0x2a837b['predictiveIntervalTotalCalls']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x78'),_0x2a837b[_0x93ae('0x62')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x79'),_0x2a837b[_0x93ae('0x7a')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7b'),_0x2a837b[_0x93ae('0x65')]);loggerPredictive['info'](_0x93ae('0x7c'),_0x2a837b['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7d'),_0x2a837b[_0x93ae('0x64')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7e'));if(_0x2a837b[_0x93ae('0x7f')]>0x0){if(!_[_0x93ae('0x80')](_0x2a837b['predictiveIntervalAvgTalktime'])&&_0x2a837b[_0x93ae('0x64')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x93ae('0x80')](_0x2a837b[_0x93ae('0x63')])&&_0x2a837b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x93ae('0x75')](_0x93ae('0x81'));}else{loggerPredictive[_0x93ae('0x75')](_0x93ae('0x82'));}}else{loggerPredictive[_0x93ae('0x75')](_0x93ae('0x83'));}return![];}function mergeDataErlangB(_0x450ec8){return function(_0x2f3e1d){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x84'));loggerPredictive[_0x93ae('0x75')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f3e1d[_0x93ae('0x6b')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x85'),_0x2f3e1d[_0x93ae('0x86')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x87'),_0x2f3e1d['erlangAbandonmentRate']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x88'),_0x2f3e1d[_0x93ae('0x6c')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x87'),_0x2f3e1d['erlangAbandonmentRate']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7e'));_[_0x93ae('0x89')](_0x450ec8,_0x2f3e1d);};}function getDiff(_0x492d93){var _0x930065=moment()[_0x93ae('0x42')](0x0);var _0x5605ca=moment(_0x492d93)[_0x93ae('0x42')](0x0);return _0x930065[_0x93ae('0x43')](_0x5605ca,_0x93ae('0x44'));}function ifInterval(_0x120e65,_0xb38655){if(_[_0x93ae('0x80')](_0xb38655)){return![];}return getDiff(_0xb38655)<_0x120e65*0x3c;}function freeVariablesPredictive(_0x339459){if(isNotNull(_0x339459)){if(!_['isUndefined'](_0x339459[_0x93ae('0x22')])){_0x339459['startProgressive']=undefined;loggerPredictive['info'](_0x339459[_0x93ae('0x37')],_0x93ae('0x8a'));}if(!_['isUndefined'](_0x339459[_0x93ae('0x6d')])){_0x339459[_0x93ae('0x6d')]=undefined;loggerPredictive[_0x93ae('0x75')](_0x339459[_0x93ae('0x37')],_0x93ae('0x8b'));}if(!_[_0x93ae('0x80')](_0x339459[_0x93ae('0x8c')])){clearInterval(_0x339459[_0x93ae('0x8c')]);_0x339459[_0x93ae('0x8c')]=undefined;loggerPredictive['info'](_0x339459['name'],_0x93ae('0x8d'));}}}function erlangb(_0xb656c9,_0xc622ff){if(_0xc622ff===0x0){return 0x0;}var _0x40a4b5=0x1;for(var _0xfe944d=0x1;_0xfe944d<=_0xc622ff;_0xfe944d+=0x1){_0x40a4b5=0x1+_0x40a4b5*_0xfe944d/_0xb656c9;}return 0x1/_0x40a4b5;}function isVoiceQueueOutbound(_0x20f2af){return _0x20f2af===_0x93ae('0x47');}function isNotPreview(_0x591020){return _0x591020!=='preview';}function isCampaignIvr(_0x12dd3c){return _0x12dd3c===_0x93ae('0x8e');}function getCallerId(_0x71867b,_0x3dd412,_0x45b6bb){if(!_[_0x93ae('0x80')](_0x45b6bb)&&typeof _0x45b6bb===_0x93ae('0x8f')&&!_[_0x93ae('0x74')](_0x45b6bb)){if(!_[_0x93ae('0x80')](_0x3dd412)&&typeof _0x3dd412==='string'&&!_[_0x93ae('0x74')](_0x3dd412)){return util['format']('\x22%s\x22\x20<%s>',_0x3dd412,_0x45b6bb);}return util[_0x93ae('0x71')](_0x93ae('0x90'),_0x45b6bb,_0x45b6bb);}if(!_[_0x93ae('0x80')](_0x71867b)&&typeof _0x71867b===_0x93ae('0x8f')&&!_[_0x93ae('0x74')](_0x71867b)){return _0x71867b;}return _0x93ae('0x91');}function loggerCatchQueueSummary(_0x1885fe,_0x44e861){return function(_0x1e0f7a){freeVariablesPredictive(_0x44e861);emitVoiceQueueSummary(_0x44e861);emitCampaignSummary(_0x44e861);loggerSyncQueueSummary[_0x93ae('0x92')](_0x1885fe,util[_0x93ae('0x93')](_0x1e0f7a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24e2d8,_0x540324){return function(_0x5b5b5a){loggerPredictive[_0x93ae('0x92')](_0x540324[_0x93ae('0x37')],_0x24e2d8);loggerPredictive[_0x93ae('0x92')](_0x5b5b5a['stack']);freeVariablesPredictive(_0x540324);};}function loggerCatch(_0x57fcc8){return function(_0x21cff4){logger[_0x93ae('0x92')](_0x57fcc8,util['inspect'](_0x21cff4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x13055a){return _0x13055a&&!_[_0x93ae('0x80')](_0x13055a)&&_0x13055a[_0x93ae('0x94')]>0x0;}function decremetOriginate(_0x2ab139){if(!_[_0x93ae('0x80')](_0x2ab139)&&_0x2ab139!==null){if(typeof _0x2ab139['originated']!==_0x93ae('0x95')){if(_0x2ab139[_0x93ae('0x96')]>0x0){_0x2ab139[_0x93ae('0x96')]-=0x1;}else{logger['error'](_0x93ae('0x97'));}}}else{logger[_0x93ae('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2ba026,_0x239921,_0x2ccb2b){if(_0x239921>_0x2ccb2b){for(var _0x974aea=0x0;_0x974aea<_0x239921-_0x2ccb2b;_0x974aea+=0x1){decremetOriginate(_0x2ba026);}}}function loggerGetContactDialer(_0x563fe6,_0x26fd6e,_0x4d3bdf){return function(_0x2d68f4){checkContactLowerLimitOriginate(_0x26fd6e,_0x4d3bdf,0x0);logger[_0x93ae('0x92')](_0x563fe6,util['inspect'](_0x2d68f4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xc344b8){return function(_0x23a3fe){if(isNotNull(_0x23a3fe)&&isNotNull(_0x23a3fe[0x0])){if(_0x23a3fe[0x0]['contactsRescheduled']>0x0){_0xc344b8[_0x93ae('0x38')]=_0x93ae('0x98');logger[_0x93ae('0x75')]('[getContactDialer2][ReScheduled]'+_0xc344b8[_0x93ae('0x37')],_0x23a3fe[0x0]['contactsRescheduled'],'contacts');}else{_0xc344b8[_0x93ae('0x38')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x93ae('0x75')](_0x93ae('0x99')+_0xc344b8[_0x93ae('0x37')]);}}};}function notSendMessagesQueue(_0x18bed6){if(_0x18bed6[_0x93ae('0x9a')]){freeVariablesPredictive(_0x18bed6);if(_0x18bed6[_0x93ae('0x96')]===0x0&&_0x18bed6[_0x93ae('0x4c')]===0x0&&_0x18bed6[_0x93ae('0x50')]===0x0&&(_0x18bed6[_0x93ae('0x9b')]||0x0)===0x0){_0x18bed6[_0x93ae('0x9a')]=![];_0x18bed6['available']=0x0;_0x18bed6['message']=_0x93ae('0x39');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9c'),_0x18bed6[_0x93ae('0x37')],_0x93ae('0x9d'));}else{_0x18bed6['message']=_0x93ae('0x9e');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9c'),_0x18bed6[_0x93ae('0x37')],'is\x20disactive');}emitVoiceQueueSummary(_0x18bed6);}}function notSendMessagesCampaign(_0x505e8f){if(_0x505e8f['sendMessageOneNotActive']){if(_0x505e8f[_0x93ae('0x96')]===0x0){_0x505e8f['sendMessageOneNotActive']=![];_0x505e8f[_0x93ae('0x38')]=_0x93ae('0x39');loggerSyncQueueSummary['error'](_0x93ae('0x9f'),_0x505e8f[_0x93ae('0x37')],_0x93ae('0x9d'));}else{_0x505e8f[_0x93ae('0x38')]=_0x93ae('0x9e');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9f'),_0x505e8f[_0x93ae('0x37')],_0x93ae('0xa0'));}emitCampaignSummary(_0x505e8f);}}function createObjHistory(_0x149814,_0xc1d90e,_0x3bfa80,_0x47eaf7,_0xc486eb){_0x149814[_0x93ae('0x38')]=_0x3bfa80;var _0x1f93b5=new Action(_0x149814,_0xc1d90e);var _0x91efd7=new History(_0x1f93b5);_0x91efd7[_0x93ae('0xa1')]=_0x47eaf7;_0x91efd7['statedesc']=_0xc486eb;_0x91efd7[_0x93ae('0xa2')]=_0x1f93b5['starttime'];return _0x91efd7;}Dialer[_0x93ae('0x15')][_0x93ae('0x35')]=function(){var _0x2445b6=this;setInterval(function(){_0x2445b6[_0x93ae('0xa3')](_0x2445b6['uniqueId'],_0x93ae('0xa4'));_0x2445b6['clearZombieChannels'](_0x2445b6[_0x93ae('0x1f')],_0x93ae('0xa5'));},0x32c8);};Dialer[_0x93ae('0x15')][_0x93ae('0xa3')]=function(_0x1c2429,_0x15d85a){var _0x4abe7b=this;for(var _0x238d88 in _0x1c2429){if(typeof _0x1c2429[_0x238d88]!==_0x93ae('0x95')){this[_0x93ae('0x18')]['enqueue'](function(){if(!_[_0x93ae('0xa6')](_0x1c2429[_0x238d88])){return ami[_0x93ae('0xa7')]({'action':_0x93ae('0xa8'),'channel':_0x1c2429[_0x238d88]['channel']})[_0x93ae('0xa9')](function(_0x5d59b0){if(_0x5d59b0[_0x93ae('0x38')]===_0x93ae('0xaa')){setTimeout(function(){if(_0x1c2429[_0x238d88]&&_0x1c2429[_0x238d88]['type']!==_0x93ae('0x8e')){_0x4abe7b[_0x93ae('0xab')](_0x4abe7b[_0x93ae('0x19')][_0x1c2429[_0x238d88][_0x93ae('0xac')]]);logger['error'](_0x93ae('0xad'),_0x15d85a,_0x238d88,_0x1c2429[_0x238d88][_0x93ae('0xac')]);delete _0x1c2429[_0x238d88];}if(_0x1c2429[_0x238d88]&&_0x1c2429[_0x238d88][_0x93ae('0x46')]==='ivr'){_0x4abe7b[_0x93ae('0xab')](_0x4abe7b[_0x93ae('0x1a')][_0x1c2429[_0x238d88][_0x93ae('0xac')]]);logger[_0x93ae('0x92')](_0x93ae('0xae'),_0x15d85a,_0x238d88,_0x1c2429[_0x238d88][_0x93ae('0xac')]);delete _0x1c2429[_0x238d88];}},0x2328);}});}});}}};Dialer[_0x93ae('0x15')]['countReScheduled']=function(_0x20827f){return BPromise[_0x93ae('0xaf')]()['then'](cmHopper[_0x93ae('0xb0')](_0x20827f))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));};Dialer['prototype'][_0x93ae('0xb2')]=function(_0x54728b){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopperBlack[_0x93ae('0xb2')](_0x54728b))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb4')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x17de69){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopperBlack[_0x93ae('0xb5')](_0x17de69))['catch'](loggerCatch(_0x93ae('0xb6')));};Dialer[_0x93ae('0x15')][_0x93ae('0xb7')]=function(_0x51af24){return BPromise['resolve']()['then'](cmHopperHistory['avgHandleTime'](_0x51af24))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb8')));};Dialer[_0x93ae('0x15')]['rescheduleContact']=function(_0x43d8d2){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xb9')](_0x43d8d2))[_0x93ae('0xa9')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x4ae222,_0x6e3646,_0x487ff0){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopper['unlockContact'](_0x4ae222,_0x6e3646,_0x487ff0))[_0x93ae('0xa9')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x93ae('0x15')][_0x93ae('0xba')]=function(_0x3c99f2,_0x42d0a5,_0x48dc1d,_0x2467d3,_0x14545c){return BPromise[_0x93ae('0xaf')]()['then'](cmHopper['getContactDialer'](_0x3c99f2,_0x42d0a5,_0x48dc1d,_0x2467d3))['catch'](function(_0x1eb18e){_0x14545c['temp']-=_0x48dc1d;_0x14545c[_0x93ae('0xbb')]=_0x14545c[_0x93ae('0xbb')]>0x0?_0x14545c[_0x93ae('0xbb')]:0x0;loggerCatch(_0x93ae('0xbc'))(_0x1eb18e);});};Dialer[_0x93ae('0x15')][_0x93ae('0xbd')]=function(_0x257bcf,_0x30d7cb,_0x1f0db0,_0x2b825e){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xbd')](_0x257bcf,_0x30d7cb,_0x1f0db0))[_0x93ae('0xa9')](function(_0x4a66c8){_0x2b825e[_0x93ae('0xbb')]-=_0x30d7cb;_0x2b825e['temp']=_0x2b825e['temp']>0x0?_0x2b825e[_0x93ae('0xbb')]:0x0;loggerCatch(_0x93ae('0xbe'))(_0x4a66c8);});};Dialer[_0x93ae('0x15')][_0x93ae('0xbf')]=function(_0x111694){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](voiceQueueRt[_0x93ae('0xbf')](_0x111694))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xc0')));};Dialer['prototype'][_0x93ae('0xc1')]=function(_0x1683fe){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xc1')](_0x1683fe))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xc2')));};Dialer[_0x93ae('0x15')][_0x93ae('0xc3')]=function(_0x4c68c9){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopperHistory['createHistory'](_0x4c68c9))['catch'](loggerCatch(_0x93ae('0xc4')));};Dialer[_0x93ae('0x15')][_0x93ae('0xab')]=function(_0xf0f1af){if(!_[_0x93ae('0x80')](_0xf0f1af)&&_0xf0f1af!==null){if(typeof _0xf0f1af['originated']!==_0x93ae('0x95')){if(_0xf0f1af[_0x93ae('0x96')]>0x0){_0xf0f1af['originated']-=0x1;}else{logger[_0x93ae('0x92')](_0x93ae('0xc5'));}}}else{logger[_0x93ae('0x92')](_0x93ae('0xc6'));}};Dialer[_0x93ae('0x15')][_0x93ae('0xc7')]=function(_0x129443,_0x5502ae){var _0x5392c1=this;return function(_0x3b85a4){_0x5392c1[_0x93ae('0xab')](_0x5502ae);logger[_0x93ae('0x92')](_0x129443,util[_0x93ae('0x93')](_0x3b85a4,{'showHidden':![],'depth':null}));};};Dialer[_0x93ae('0x15')][_0x93ae('0xc8')]=function(_0x46fdb2,_0x2f6279,_0x444318){var _0x187353={'state':0x19,'statedesc':_0x93ae('0xc9')};this[_0x93ae('0xab')](_0x2f6279);this[_0x93ae('0xca')](_[_0x93ae('0x89')](_0x187353,_['pick'](_0x444318,[_0x93ae('0xcb'),_0x93ae('0xcc'),_0x93ae('0xcd'),_0x93ae('0xce'),_0x93ae('0xcf')])),_0x93ae('0xd0'),_0x93ae('0xd1'));logger['error'](_0x46fdb2);};Dialer['prototype'][_0x93ae('0xd2')]=function(_0x21e113){return _0x21e113===_0x93ae('0xd3');};Dialer[_0x93ae('0x15')][_0x93ae('0xd4')]=function(_0x1aeb35){return!_['isUndefined'](_0x1aeb35)&&_0x1aeb35&&!_['isUndefined'](_0x1aeb35['name'])&&!_[_0x93ae('0x80')](_0x1aeb35[_0x93ae('0xd5')])&&_0x1aeb35[_0x93ae('0xd5')]&&(this[_0x93ae('0x1c')][util['format'](_0x93ae('0xd6'),_0x1aeb35['name'])]['status']===_0x93ae('0xd7')||this[_0x93ae('0x1c')][util[_0x93ae('0x71')]('SIP/%s',_0x1aeb35['name'])][_0x93ae('0xa8')]==='unmonitored');};Dialer[_0x93ae('0x15')][_0x93ae('0xca')]=function(_0xebc7ea,_0x19cc71,_0x39da90){this[_0x93ae('0xc3')](_0xebc7ea)['catch'](loggerCatch(_0x19cc71));this[_0x93ae('0xc1')](_0xebc7ea)[_0x93ae('0xa9')](loggerCatch(_0x39da90));};Dialer[_0x93ae('0x15')][_0x93ae('0x30')]=function(_0x20f753){var _0xd28ba8=this[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];var _0x57cbb3;if(!_['isNil'](_0x20f753)&&!_[_0x93ae('0xa6')](_0x20f753[_0x93ae('0xd9')])&&!_[_0x93ae('0xa6')](_0x20f753[_0x93ae('0xd9')]['amdstatus'])&&_0x20f753[_0x93ae('0xda')]===_0x93ae('0xdb')&&_0xd28ba8){if(_0xd28ba8['type']!==_0x93ae('0x8e')&&this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xde')){delete this[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]]);this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;this[_0x93ae('0x19')][_0xd28ba8['queue']][_0x93ae('0x57')]+=0x1;_0x57cbb3=new Hangup(_0xd28ba8,_0x20f753);_0x57cbb3['state']=0x12;_0x57cbb3['statedesc']=_0x93ae('0xdf');_0x57cbb3[_0x93ae('0xe0')]=_0x93ae('0xe1');ami[_0x93ae('0x45')]('custom:amd',ut[_0x93ae('0xe2')](_0x57cbb3,_0x93ae('0xe3')));this[_0x93ae('0xca')](_0x57cbb3,_0x93ae('0xe4'),_0x93ae('0xe5'));}if(_0xd28ba8[_0x93ae('0x46')]!==_0x93ae('0x8e')&&this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xe6')){var _0xc5a12=this;return new BPromise(function(_0x129dab,_0x678df5){delete _0xc5a12[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];_0xc5a12[_0x93ae('0xab')](_0xc5a12['voiceQueues'][_0xd28ba8[_0x93ae('0xac')]]);_0xc5a12['voiceQueues'][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;_0xc5a12[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x57')]+=0x1;var _0x2058e2=_0xc5a12[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]];var _0x50ecc0=new Hangup(_0xd28ba8,_0x20f753);_0x50ecc0[_0x93ae('0xa1')]=0x13;_0x50ecc0[_0x93ae('0xe7')]=_0x93ae('0xe8');_0x50ecc0[_0x93ae('0xe0')]=_0x93ae('0xe1');_0x50ecc0['countmachineretry']+=0x1;_0x50ecc0[_0x93ae('0xe9')]+=0x1;_0x50ecc0[_0x93ae('0xe3')]=!![];ami['emit'](_0x93ae('0xea'),ut[_0x93ae('0xe2')](_0x50ecc0,_0x93ae('0xe3')));_0xc5a12[_0x93ae('0xc3')](_0x50ecc0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xeb')));if(_0x50ecc0[_0x93ae('0xec')]+_0x50ecc0[_0x93ae('0xed')]+_0x50ecc0[_0x93ae('0xee')]+_0x50ecc0[_0x93ae('0xef')]+_0x50ecc0['countdropretry']+_0x50ecc0[_0x93ae('0xf0')]+_0x50ecc0[_0x93ae('0xf1')]+_0x50ecc0[_0x93ae('0xf2')]>=_0x2058e2[_0x93ae('0xf3')]){_0xc5a12[_0x93ae('0xf4')](_0x50ecc0,_0x129dab,_0x678df5,_0x93ae('0xf5'));}else{if(_0x50ecc0[_0x93ae('0xf1')]>=_0x2058e2[_0x93ae('0xf6')]){_0xc5a12[_0x93ae('0xf7')](_0x50ecc0,_0x129dab,_0x678df5,'reason\x2019\x20machine....');}else{_0xc5a12['rescheduleContact']({'active':![],'countmachineretry':_0x50ecc0[_0x93ae('0xf1')],'scheduledat':moment()[_0x93ae('0xf8')](_0x2058e2['dialMachineRetryFrequency'],_0x93ae('0xf9'))['format'](_0x93ae('0xfa')),'ContactId':_0x50ecc0[_0x93ae('0xcb')],'ListId':_0x50ecc0[_0x93ae('0xcc')],'VoiceQueueId':_0x50ecc0[_0x93ae('0xce')]||undefined,'CampaignId':_0x50ecc0['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Machine]'));_0x129dab({'reschedule':0x1});}}});}if(_0xd28ba8[_0x93ae('0x46')]===_0x93ae('0x8e')&&this[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xde')){delete this['uniqueId'][_0x20f753['uniqueid']];this['updateOriginated'](this['campaigns'][_0xd28ba8[_0x93ae('0xac')]]);_0x57cbb3=new Hangup(_0xd28ba8,_0x20f753);_0x57cbb3[_0x93ae('0xa1')]=0x12;_0x57cbb3['statedesc']='HangupInAMD';_0x57cbb3['membername']=_0x93ae('0xe1');ami[_0x93ae('0x45')]('custom:amd',ut[_0x93ae('0xe2')](_0x57cbb3,_0x93ae('0xe3')));this[_0x93ae('0xca')](_0x57cbb3,_0x93ae('0xfb'),_0x93ae('0xfc'));}if(_0xd28ba8['type']===_0x93ae('0x8e')&&this[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]==='MACHINE'){var _0xc5a12=this;return new BPromise(function(_0x17081f,_0x104a93){delete _0xc5a12[_0x93ae('0x20')][_0x20f753['uniqueid']];_0xc5a12[_0x93ae('0xab')](_0xc5a12['campaigns'][_0xd28ba8[_0x93ae('0xac')]]);_0xc5a12[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]]['outboundAnswerCallsDay']+=0x1;_0xc5a12[_0x93ae('0x1a')][_0xd28ba8['queue']][_0x93ae('0x57')]+=0x1;var _0x384d73=_0xc5a12['campaigns'][_0xd28ba8['queue']];var _0x5da0fc=new Hangup(_0xd28ba8,_0x20f753);_0x5da0fc[_0x93ae('0xa1')]=0x13;_0x5da0fc[_0x93ae('0xe7')]=_0x93ae('0xe8');_0x5da0fc[_0x93ae('0xe0')]=_0x93ae('0xe1');_0x5da0fc[_0x93ae('0xf1')]+=0x1;_0x5da0fc[_0x93ae('0xe9')]+=0x1;_0x5da0fc['amd']=!![];ami['emit'](_0x93ae('0xea'),ut['buildObj'](_0x5da0fc,'amd'));_0xc5a12[_0x93ae('0xc3')](_0x5da0fc)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xeb')));if(_0x5da0fc['countbusyretry']+_0x5da0fc[_0x93ae('0xed')]+_0x5da0fc[_0x93ae('0xee')]+_0x5da0fc[_0x93ae('0xef')]+_0x5da0fc[_0x93ae('0xfd')]+_0x5da0fc[_0x93ae('0xf0')]+_0x5da0fc['countmachineretry']+_0x5da0fc[_0x93ae('0xf2')]>=_0x384d73['dialGlobalMaxRetry']){_0xc5a12[_0x93ae('0xf4')](_0x5da0fc,_0x17081f,_0x104a93,_0x93ae('0xf5'));}else{if(_0x5da0fc['countmachineretry']>=_0x384d73[_0x93ae('0xf6')]){_0xc5a12[_0x93ae('0xf7')](_0x5da0fc,_0x17081f,_0x104a93,'reason\x2019\x20machine....');}else{_0xc5a12[_0x93ae('0xb9')]({'active':![],'countmachineretry':_0x5da0fc[_0x93ae('0xf1')],'scheduledat':moment()['add'](_0x384d73['dialMachineRetryFrequency'],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x5da0fc[_0x93ae('0xcb')],'ListId':_0x5da0fc['ListId'],'VoiceQueueId':_0x5da0fc['VoiceQueueId']||undefined,'CampaignId':_0x5da0fc[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xfe')));_0x17081f({'reschedule':0x1});}}});}}};Dialer[_0x93ae('0x15')][_0x93ae('0x2e')]=function(_0x5c8cb0){var _0x5c5937=this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];var _0xf5bb85=this;var _0x4f981a;if(_0x5c5937&&_0x5c5937[_0x93ae('0x46')]===_0x93ae('0x8e')){delete this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x1a')][_0x5c5937[_0x93ae('0xac')]]);this['campaigns'][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0xff')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);this[_0x93ae('0xc3')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4f981a)['catch'](loggerCatch(_0x93ae('0x100')));}if(_0x5c5937&&_0x5c5937[_0x93ae('0x46')]!==_0x93ae('0x8e')&&isNotNull(this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x101')])){delete this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x5c5937['queue']]);this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;this['voiceQueues'][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x57')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);_0x4f981a[_0x93ae('0xa1')]=0x10;_0x4f981a['statedesc']=_0x93ae('0x102');_0x4f981a[_0x93ae('0xe0')]=_0x93ae('0x103');this[_0x93ae('0xc3')](_0x4f981a)['catch'](loggerCatch(_0x93ae('0x104')));this[_0x93ae('0xc1')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x100')));}if(_0x5c5937&&_0x5c5937['type']!==_0x93ae('0x8e')&&!isNotNull(this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x101')])){delete this[_0x93ae('0x20')][_0x5c8cb0['uniqueid']];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]]);this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x61')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);_0x4f981a[_0x93ae('0xa1')]=0xc;_0x4f981a[_0x93ae('0xe7')]=_0x5c8cb0[_0x93ae('0x105')];_0x4f981a['membername']=_0x93ae('0x106');this[_0x93ae('0xc3')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x104')));this[_0x93ae('0xc1')](_0x4f981a)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x93ae('0x2b')]=function(_0x7b711){var _0x394db7=this[_0x93ae('0x20')][_0x7b711[_0x93ae('0xd8')]];var _0x144912=this;if(this[_0x93ae('0x19')][_0x7b711['queue']]){if(_0x394db7&&_0x394db7['type']!==_0x93ae('0x8e')){delete this['uniqueId'][_0x7b711[_0x93ae('0xd8')]];this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;var _0x1e9179=new AgentComplete(_0x394db7,_0x7b711);if(_0x7b711['reason']===_0x93ae('0x107')){_0x1e9179[_0x93ae('0x108')]=this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]]['dialQueueProject2']&&this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]]['dialAgiAfterHangupAgent']?moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x93ae('0xc3')](_0x1e9179)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x93ae('0xc1')](_0x1e9179)['catch'](loggerCatch(_0x93ae('0x109')));}}};Dialer[_0x93ae('0x15')][_0x93ae('0x27')]=function(_0x3a2956){if(this['voiceQueues'][_0x3a2956['queue']]){if(this[_0x93ae('0x20')][_0x3a2956['uniqueid']]&&this['uniqueId'][_0x3a2956[_0x93ae('0xd8')]][_0x93ae('0x46')]!=='ivr'){this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x3a2956[_0x93ae('0xac')]]);this['uniqueId'][_0x3a2956['uniqueid']][_0x93ae('0x10a')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));}}};Dialer[_0x93ae('0x15')][_0x93ae('0x10b')]=function(_0x3a6126){this[_0x93ae('0xc3')](_0x3a6126)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x10c')));this[_0x93ae('0xc1')](_0x3a6126)[_0x93ae('0xa9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x93ae('0x15')]['syncQueueCallerAbandon']=function(_0x2d9a45){var _0x277505=this['uniqueId'][_0x2d9a45[_0x93ae('0xd8')]];var _0x554c01=this;if(this['voiceQueues'][_0x2d9a45[_0x93ae('0xac')]]){if(_0x277505&&_0x277505[_0x93ae('0x46')]!==_0x93ae('0x8e')){delete this['uniqueId'][_0x2d9a45['uniqueid']];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x2d9a45['queue']]);_0x277505[_0x93ae('0x10d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3c7000=new QueueCallerAbandon(_0x277505,_0x2d9a45);if(getSeconds(_0x277505[_0x93ae('0x10d')],_0x277505[_0x93ae('0x10e')])>=_0x277505[_0x93ae('0x10f')]){this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x7a')]+=0x1;this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x5d')]+=0x1;this['voiceQueues'][_0x2d9a45['queue']][_0x93ae('0x67')]+=0x1;_0x3c7000[_0x93ae('0xa1')]=0xa;_0x3c7000[_0x93ae('0xe7')]=_0x93ae('0x110');_0x3c7000[_0x93ae('0x111')]=_0x93ae('0x112');_0x3c7000[_0x93ae('0x108')]=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x113')]?moment()[_0x93ae('0x71')](_0x93ae('0xfa')):undefined;_0x3c7000[_0x93ae('0xfd')]+=0x1;_0x3c7000[_0x93ae('0xe9')]+=0x1;if(_0x3c7000['countdropretry']>=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x114')]){this[_0x93ae('0x10b')](_0x3c7000);}else{this[_0x93ae('0xb9')]({'active':![],'countdropretry':_0x3c7000[_0x93ae('0xfd')],'scheduledat':moment()['add'](this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x115')],_0x93ae('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x277505[_0x93ae('0xcb')],'ListId':_0x277505['ListId'],'VoiceQueueId':_0x277505[_0x93ae('0xce')]||undefined,'CampaignId':_0x277505['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Drop]'));var _0x6394a2=new History(_0x3c7000);_0x6394a2[_0x93ae('0xa1')]=0xa;_0x6394a2['statedesc']=_0x93ae('0x110');_0x6394a2['starttime']=moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x6394a2[_0x93ae('0xa2')]=_0x6394a2[_0x93ae('0x116')];_0x6394a2[_0x93ae('0x117')]=_0x3c7000['calleridname'];_0x6394a2[_0x93ae('0x118')]=_0x3c7000['calleridnum'];this[_0x93ae('0xc3')](_0x6394a2)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x119')));}}else{this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x65')]+=0x1;this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x5c')]+=0x1;_0x3c7000[_0x93ae('0xa1')]=0xb;_0x3c7000[_0x93ae('0xe7')]=_0x93ae('0x11a');_0x3c7000[_0x93ae('0x111')]=_0x93ae('0x11b');_0x3c7000[_0x93ae('0xf0')]+=0x1;_0x3c7000[_0x93ae('0xe9')]+=0x1;if(_0x3c7000['countabandonedretry']>=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x11c')]){this[_0x93ae('0x10b')](_0x3c7000);}else{this[_0x93ae('0xb9')]({'active':![],'countabandonedretry':_0x3c7000[_0x93ae('0xf0')],'scheduledat':moment()[_0x93ae('0xf8')](this['voiceQueues'][_0x2d9a45['queue']][_0x93ae('0x11d')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x277505[_0x93ae('0xcb')],'ListId':_0x277505[_0x93ae('0xcc')],'VoiceQueueId':_0x277505[_0x93ae('0xce')]||undefined,'CampaignId':_0x277505['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x11e')));var _0x6394a2=new History(_0x3c7000);_0x6394a2['state']=0xb;_0x6394a2['statedesc']='Abandoned';_0x6394a2[_0x93ae('0x116')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));_0x6394a2[_0x93ae('0xa2')]=_0x6394a2[_0x93ae('0x116')];_0x6394a2['calleridname']=_0x3c7000['calleridname'];_0x6394a2['calleridnum']=_0x3c7000[_0x93ae('0x118')];this['createHistory'](_0x6394a2)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x11f')));}}}}};Dialer[_0x93ae('0x15')][_0x93ae('0x120')]=function(_0x4dfa3b){if(this[_0x93ae('0x1f')][_0x4dfa3b[_0x93ae('0xd8')]]){this[_0x93ae('0x1f')][_0x4dfa3b['uniqueid']][_0x93ae('0x121')]=_0x4dfa3b[_0x93ae('0x121')];}if(this[_0x93ae('0x20')][_0x4dfa3b[_0x93ae('0xd8')]]){this[_0x93ae('0x20')][_0x4dfa3b['uniqueid']][_0x93ae('0x121')]=_0x4dfa3b[_0x93ae('0x121')];}};Dialer[_0x93ae('0x15')][_0x93ae('0x32')]=function(_0x1e4a7a){if(strategy[this['voiceQueues'][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]===_0x93ae('0x123')){if(this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]&&_[_0x93ae('0xa6')](this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x124')])&&_0x1e4a7a[_0x93ae('0xa8')]==='1'&&_0x1e4a7a['paused']==='0'){if(this[_0x93ae('0x1b')][_0x1e4a7a['stateinterface']]){if(!this[_0x93ae('0x1b')][_0x1e4a7a[_0x93ae('0x125')]][_0x93ae('0x124')]){this[_0x93ae('0x1b')][_0x1e4a7a[_0x93ae('0x125')]][_0x93ae('0x124')]=!![];this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x124')]=!![];this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x125')]=_0x1e4a7a[_0x93ae('0x125')];}}}}else if((strategy[this[_0x93ae('0x19')][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]||'rrmemory')===_0x93ae('0x14')){if(this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]){if(this['agents'][_0x1e4a7a[_0x93ae('0x125')]]){this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]['stateinterface']=_0x1e4a7a[_0x93ae('0x125')];if(_[_0x93ae('0xa6')](this['queueBooked'][this['actions'][_0x1e4a7a['actionid']][_0x93ae('0xac')]])){this['queueBooked'][this['actions'][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]]=[];}this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x126')](_[_0x93ae('0x89')](_[_0x93ae('0x127')](this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]],[_0x93ae('0x128'),_0x93ae('0x125')]),{'status':_0x1e4a7a[_0x93ae('0xa8')],'paused':_0x1e4a7a['paused']}));}}}};function unlockQueueStatus(_0x32339f,_0x22106a){setTimeout(function(){if(_[_0x93ae('0x80')](_0x32339f[_0x93ae('0x129')])){loggerBooked[_0x93ae('0x92')](_0x93ae('0x12a'),_0x22106a);}_0x32339f[_0x93ae('0x129')]=!![];loggerBooked['info'](_0x93ae('0x12b'),_0x22106a,JSON[_0x93ae('0x41')](_['pick'](_0x32339f,[_0x93ae('0x37'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x93ae('0x15')][_0x93ae('0x33')]=function(_0x332145){var _0x52e2d1=this;var _0x3aacf0=_0x52e2d1[_0x93ae('0x19')][_0x52e2d1[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]];if(strategy[this[_0x93ae('0x19')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['queue']]['strategy']]===_0x93ae('0x123')){if(this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]&&this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0x125')]){this['preview']['run'](this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0x128')],this['actions'][_0x332145[_0x93ae('0x122')]][_0x93ae('0x125')])[_0x93ae('0xa9')](function(_0x2589db){logger[_0x93ae('0x92')](_0x93ae('0x12c'),util[_0x93ae('0x93')](_0x2589db,{'showHidden':![],'depth':null}));})[_0x93ae('0x12d')](function(){_0x52e2d1[_0x93ae('0xab')](_0x52e2d1[_0x93ae('0x19')][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]);_0x52e2d1[_0x93ae('0x1b')][_0x52e2d1[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0x125')]][_0x93ae('0x124')]=![];delete _0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]];unlockQueueStatus(_0x3aacf0);});}else{this[_0x93ae('0xab')](this[_0x93ae('0x19')][this['actions'][_0x332145['actionid']]['queue']]);this[_0x93ae('0xb9')]({'active':![],'ContactId':this['actions'][_0x332145[_0x93ae('0x122')]]['ContactId'],'ListId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['ListId'],'VoiceQueueId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xcf')]||undefined})['catch'](loggerCatch(_0x93ae('0x12e')));delete this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]];unlockQueueStatus(_0x3aacf0);}}else if((strategy[this['voiceQueues'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]||_0x93ae('0x14'))===_0x93ae('0x14')){var _0x4bbd5e;if(this['actions'][_0x332145[_0x93ae('0x122')]]&&!_[_0x93ae('0x74')](this['queueBooked'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]])){if(this[_0x93ae('0x25')][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]){this['queueBookedRR'][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]=this[_0x93ae('0x25')][this[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]]?this[_0x93ae('0x25')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]:this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]?this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]['_rr']||0x0:0x0;}this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]]['_rr']=this['queueBookedRR'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]];for(var _0x4d61e8=0x0;_0x4d61e8=0x0;})[_0x93ae('0xa9')](myreject(_0x2c11db)));}}else{_0x513dec['push'](ami[_0x93ae('0xa7')]({'action':_0x93ae('0x146'),'command':util['format'](_0x93ae('0x147'),_0x281ac1,!_[_0x93ae('0x80')](config['timezones'][_0xd6c655])?_0xd6c655:'')})['then'](function(_0x220cf4){return _0x220cf4[_0x93ae('0x149')]['indexOf'](_0x93ae('0x14b'))>=0x0;})['catch'](myreject(_0x2c11db)));}BPromise[_0x93ae('0x14c')](_0x513dec)[_0x93ae('0xb3')](function(_0x21001c){var _0x54e540=_[_0x93ae('0x14d')](_0x21001c);if(_0x54e540){return _0x1d6a19(_0x54e540);}else{_0x5d058b[_0x93ae('0x38')]=_0x3a0888?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x2c11db(msgResponse(_0x93ae('0x14e'),_0x93ae('0x141'),_0x93ae('0x14f')+_0x3a0888+'\x20'+_0x13d9c5+_0x93ae('0x150')+util[_0x93ae('0x93')](_0x281ac1,{'showHidden':![],'depth':null})+_0x93ae('0x151')+_0xd6c655));}})[_0x93ae('0xa9')](function(_0x29c525){return _0x2c11db(msgResponse(_0x93ae('0x140'),'Failure',JSON[_0x93ae('0x41')](_0x29c525)));});});};Dialer['prototype'][_0x93ae('0x152')]=function(_0x7efff0){var _0x4ec4e4=this;return function(){switch(_0x7efff0['dialMethod']){case _0x93ae('0x153'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,0x1);break;case _0x93ae('0x155'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,_0x7efff0[_0x93ae('0x156')]);break;case'predictive':_0x4ec4e4['predictive'](_0x7efff0);break;case _0x93ae('0x157'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,0x1);break;default:freeVariablesPredictive(_0x7efff0);logger[_0x93ae('0x92')](_0x93ae('0x158'),_0x7efff0[_0x93ae('0x37')],_0x93ae('0x159'));}};};Dialer[_0x93ae('0x15')]['launchHandleIvr']=function(_0x30e2da){var _0x5555e7=this;return function(){_0x5555e7[_0x93ae('0x15a')](_0x30e2da);};};Dialer['prototype']['syncQueueSummary']=function(_0x4c3ec5){var _0x2479b1=this;if(isNotPreview(_0x4c3ec5[_0x93ae('0x52')])){if(isVoiceQueueOutbound(_0x4c3ec5[_0x93ae('0x46')])&&isActive(_0x4c3ec5[_0x93ae('0x51')])){_0x4c3ec5[_0x93ae('0x9a')]=!![];BPromise[_0x93ae('0xaf')]()['then'](checkIsLoggedIn(_0x4c3ec5,_0x4c3ec5[_0x93ae('0x4a')]))['then'](checkIsActive(_0x4c3ec5,_0x4c3ec5[_0x93ae('0x51')]))['then'](checkInterval(_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1['checkIsTrunkReachable'](_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1[_0x93ae('0x13f')](_0x4c3ec5[_0x93ae('0x15b')],_0x4c3ec5[_0x93ae('0x15c')],_0x4c3ec5[_0x93ae('0x37')],_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1[_0x93ae('0x15d')](_0x4c3ec5[_0x93ae('0x3d')],_0x4c3ec5['dialTimezone'],_0x4c3ec5['name'],_0x4c3ec5))['then'](_0x2479b1['checkDialMethod'](_0x4c3ec5))[_0x93ae('0xa9')](loggerCatchQueueSummary(_0x93ae('0x15e'),_0x4c3ec5));}else{notSendMessagesQueue(_0x4c3ec5);}}else{freeVariablesPredictive(_0x4c3ec5);}};Dialer[_0x93ae('0x15')][_0x93ae('0x15f')]=function(){var _0x1a1691=this;var _0x4da4e5;for(var _0xb3c15f in this[_0x93ae('0x1a')]){if(typeof this['campaigns'][_0xb3c15f]!=='undefined'){_0x4da4e5=this[_0x93ae('0x1a')][_0xb3c15f];if(isCampaignIvr(_0x4da4e5['type'])&&isActive(_0x4da4e5[_0x93ae('0xd5')])){_0x4da4e5[_0x93ae('0x9a')]=!![];BPromise[_0x93ae('0xaf')]()['then'](checkIsActive(_0x4da4e5,_0x4da4e5[_0x93ae('0xd5')]))[_0x93ae('0xb3')](checkInterval(_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691[_0x93ae('0x13c')](_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691['checkIfTime'](_0x4da4e5['dialGlobalInterval'],_0x4da4e5[_0x93ae('0x15c')],_0x4da4e5[_0x93ae('0x37')],_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691[_0x93ae('0x15d')](_0x4da4e5[_0x93ae('0x3d')],_0x4da4e5[_0x93ae('0x15c')],_0x4da4e5[_0x93ae('0x37')],_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691['launchHandleIvr'](_0x4da4e5))[_0x93ae('0xa9')](loggerCatchQueueSummary('[syncCampaigns]',_0x4da4e5));}else{notSendMessagesCampaign(_0x4da4e5);}}}};function getCallerIdRandom(_0x5dbf40,_0x47e9af){var _0x45d1cc;var _0x26d028;var _0x218ccc;if(_0x47e9af<=0x0){_0x47e9af=0x1;}_0x45d1cc=new RegExp(_0x93ae('0x160')+_0x47e9af+'}$');_0x26d028=Math[_0x93ae('0x161')](0xa,_0x47e9af-0x1);_0x218ccc=Math[_0x93ae('0x161')](0xa,_0x47e9af)-0x1;return util[_0x93ae('0x71')]('%s',_['replace'](_0x5dbf40,_0x45d1cc,_[_0x93ae('0x162')](_0x26d028,_0x218ccc)));}function extractCalleridName(_0x41a4e4){var _0x533e5a=_0x41a4e4[_0x93ae('0x163')](/"(.*?)"/);return _0x533e5a?_0x533e5a[0x1]:_0x41a4e4;}function extractCalleridNumber(_0x123cff){var _0x598a68=_0x123cff[_0x93ae('0x163')](/<(.*?)>/);return _0x598a68?_0x598a68[0x1]:_0x123cff;}Dialer[_0x93ae('0x15')][_0x93ae('0x164')]=function(_0x5ca56f,_0x210284){var _0x1e02d6=this;var _0x29ea63=uuid['v4']();this[_0x93ae('0x1f')][_0x29ea63]=new Action(_0x5ca56f,_0x210284,_0x29ea63);return new BPromise(function(_0x4753a7,_0x2ca1f2){if(_[_0x93ae('0x80')](_0x5ca56f)&&typeof _0x5ca56f!==_0x93ae('0x165')){return _0x2ca1f2(msgResponse(_0x93ae('0x166'),'Failure',_0x93ae('0x167')));}if(_['isUndefined'](_0x210284[_0x93ae('0x168')][_0x93ae('0x169')])||_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]===null){return _0x2ca1f2(msgResponse(_0x93ae('0x166'),_0x93ae('0x141'),_0x93ae('0x16a')));}var _0x236bb0={'XMD-CALLERID':_0x1e02d6[_0x93ae('0x1f')][_0x29ea63]['getCaller'](),'XMD-AGI':_0x5ca56f['dialQueueProject']?util[_0x93ae('0x71')](_0x93ae('0x16b'),ipAgi,_0x5ca56f[_0x93ae('0x101')]):_0x93ae('0x16c'),'XMD-AGIAFTER':_0x5ca56f[_0x93ae('0x113')]?util[_0x93ae('0x71')](_0x93ae('0x16b'),ipAgi,_0x5ca56f[_0x93ae('0x113')]):_0x93ae('0x16c'),'XMD-QUEUE':_0x5ca56f['type']===_0x93ae('0x47')?util[_0x93ae('0x71')]('\x22%s,%s%s,,,%s\x22',_0x5ca56f[_0x93ae('0x37')],_0x5ca56f[_0x93ae('0x16d')]||'',_0x5ca56f[_0x93ae('0x16e')]?'c':'',_0x5ca56f['dialQueueTimeout']||0x3):_0x93ae('0x16c'),'XMD-CONTACTID':_0x210284[_0x93ae('0xcb')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x16f')](),'XMD-AMD':_0x5ca56f['dialAMDActive']?_0x93ae('0x170'):_0x93ae('0x16c'),'XMD-DESTINATION':_0x93ae('0xdb')};if(_0x5ca56f[_0x93ae('0xdc')]){_0x236bb0[_0x93ae('0x171')]=_0x5ca56f[_0x93ae('0x172')]||0x9c4;_0x236bb0[_0x93ae('0x173')]=_0x5ca56f['dialAMDGreeting']||0x5dc;_0x236bb0[_0x93ae('0x174')]=_0x5ca56f['dialAMDAfterGreetingSilence']||0x320;_0x236bb0['XMD-AMDTOTALANALYSISTIME']=_0x5ca56f[_0x93ae('0x175')]||0x1388;_0x236bb0[_0x93ae('0x176')]=_0x5ca56f['dialAMDMinWordLength']||0x64;_0x236bb0[_0x93ae('0x177')]=_0x5ca56f['dialAMDBetweenWordsSilence']||0x32;_0x236bb0[_0x93ae('0x178')]=_0x5ca56f[_0x93ae('0x179')]||0x3;_0x236bb0['XMD-AMDSILENCETHRESHOLD']=_0x5ca56f[_0x93ae('0x17a')]||0x100;_0x236bb0[_0x93ae('0x17b')]=_0x5ca56f[_0x93ae('0x17c')]||0x1388;}if(_0x5ca56f[_0x93ae('0x46')]===_0x93ae('0x47')){_0x236bb0['XMD-VOICEQUEUEID']=_0x210284[_0x93ae('0xce')];}else{_0x236bb0['XMD-CAMPAIGNID']=_0x210284[_0x93ae('0xcf')];}for(var _0x35ba4d in _0x210284['Contact']){if(typeof _0x210284[_0x93ae('0x168')][_0x35ba4d]!==_0x93ae('0x95')){if(isNotNull(_0x210284[_0x93ae('0x168')][_0x35ba4d])&&_0x35ba4d!=='id'&&_0x35ba4d!=='tags'&&_0x35ba4d!=='createdAt'&&_0x35ba4d!=='updatedAt'){_0x236bb0[util[_0x93ae('0x71')](_0x93ae('0x17d'),_0x93ae('0x17e'),_[_0x93ae('0x17f')](_0x35ba4d))]=_0x210284['Contact'][_0x35ba4d];}}}var _0x424516=_0x1e02d6[_0x93ae('0xd4')](_0x5ca56f[_0x93ae('0x6e')])?getCallerId(_0x5ca56f[_0x93ae('0x6e')][_0x93ae('0x6f')],_0x5ca56f[_0x93ae('0x53')],_0x5ca56f[_0x93ae('0x180')]>0x0?getCallerIdRandom(_0x5ca56f['dialOriginateCallerIdNumber'],_0x5ca56f[_0x93ae('0x180')]):_0x5ca56f['dialOriginateCallerIdNumber']):getCallerId(_[_0x93ae('0xa6')](_0x5ca56f[_0x93ae('0x13d')])?_0x5ca56f[_0x93ae('0x6e')][_0x93ae('0x6f')]:_0x5ca56f[_0x93ae('0x13d')]['callerid'],_0x5ca56f[_0x93ae('0x53')],_0x5ca56f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5ca56f[_0x93ae('0x54')],_0x5ca56f[_0x93ae('0x180')]):_0x5ca56f[_0x93ae('0x54')]);if(_0x424516){_0x236bb0['XMD-ORIGINATECALLERIDNAME']=_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x181')]=extractCalleridName(_0x424516);_0x236bb0[_0x93ae('0x182')]=_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x183')]=extractCalleridNumber(_0x424516);}return ami['Action']({'actionid':_0x29ea63,'action':_0x93ae('0x166'),'channel':_0x1e02d6[_0x93ae('0xd4')](_0x5ca56f[_0x93ae('0x6e')])?util[_0x93ae('0x71')](_0x93ae('0x184'),_0x5ca56f['Trunk'][_0x93ae('0x37')],isNotNull(_0x5ca56f['dialPrefix'])?_0x5ca56f['dialPrefix'][_0x93ae('0x185')]()||'':'',_0x5ca56f[_0x93ae('0x186')]>0x0?_0x210284[_0x93ae('0x168')][_0x93ae('0x169')][_0x93ae('0x187')](_0x5ca56f['dialCutDigit']):_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]):util['format'](_0x93ae('0x184'),_[_0x93ae('0xa6')](_0x5ca56f[_0x93ae('0x13d')])?_0x5ca56f[_0x93ae('0x6e')]['name']:_0x5ca56f[_0x93ae('0x13d')][_0x93ae('0x37')],isNotNull(_0x5ca56f['dialPrefix'])?_0x5ca56f[_0x93ae('0x56')]['trim']()||'':'',_0x5ca56f[_0x93ae('0x186')]>0x0?_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]['substring'](_0x5ca56f[_0x93ae('0x186')]):_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]),'callerid':_0x424516,'Exten':_0x93ae('0xdb'),'Context':_0x93ae('0x188'),'Priority':'1','variable':_0x236bb0,'timeout':(_0x5ca56f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x29ea63})[_0x93ae('0xb3')](function(_0x171eb0){return _0x4753a7(_0x171eb0);})['catch'](function(_0x40b3ce){_0x5ca56f['outboundOriginateFailureCallsDay']+=0x1;var _0x219e0e=new History(_0x1e02d6[_0x93ae('0x1f')][_0x29ea63]);logger[_0x93ae('0x92')](util[_0x93ae('0x71')]('[originateError]:\x20%s',JSON['stringify'](_0x40b3ce)));_0x219e0e[_0x93ae('0xa1')]=0xe;_0x219e0e[_0x93ae('0xe7')]=_0x93ae('0x189');_0x219e0e[_0x93ae('0x116')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));_0x219e0e[_0x93ae('0xa2')]=_0x219e0e[_0x93ae('0x116')];_0x1e02d6[_0x93ae('0xc3')](_0x219e0e)[_0x93ae('0xa9')](loggerCatch('[originate][error]'));_0x1e02d6[_0x93ae('0xc1')](_0x219e0e)['catch'](loggerCatch(_0x93ae('0x18a')))['finally'](function(){delete _0x1e02d6[_0x93ae('0x1f')][_0x29ea63];return _0x2ca1f2(msgResponse('originate','Error',_0x93ae('0x18b')));});});});};Dialer[_0x93ae('0x15')][_0x93ae('0x18c')]=function(_0x105639){var _0x5f1ae7=this[_0x93ae('0x1f')][_0x105639['actionid']];if(_0x5f1ae7){delete this['actions'][_0x105639[_0x93ae('0x122')]];_0x5f1ae7[_0x93ae('0x10e')]=moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss');var _0x52cae7=_0x5f1ae7[_0x93ae('0x46')]===_0x93ae('0x8e')?this[_0x93ae('0x1a')][_0x5f1ae7['queue']]:this[_0x93ae('0x19')][_0x5f1ae7[_0x93ae('0x18d')]()];if(!this[_0x93ae('0xd2')](_0x105639[_0x93ae('0x18e')])){this[_0x93ae('0xab')](_0x52cae7);return this[_0x93ae('0x18f')](_0x5f1ae7,_0x52cae7,_0x105639)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x190')));}this[_0x93ae('0x20')][_0x105639['uniqueid']]=_0x5f1ae7;}};Dialer[_0x93ae('0x15')][_0x93ae('0x191')]=function(_0x3e88a9,_0x196a1e,_0x274be1){var _0x51f75c=new History(_0x196a1e);if(_0x51f75c[_0x93ae('0xec')]+_0x51f75c[_0x93ae('0xed')]+_0x51f75c[_0x93ae('0xee')]+_0x51f75c['countnosuchnumberretry']+_0x51f75c['countdropretry']+_0x51f75c['countabandonedretry']+_0x51f75c[_0x93ae('0xf1')]+_0x51f75c[_0x93ae('0xf2')]>=_0x274be1[_0x93ae('0xf3')]-0x1){return!![];}switch(_0x3e88a9){case 0x3:if(_0x51f75c['countnoanswerretry']>=_0x274be1[_0x93ae('0x192')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countnoanswerretry':_0x51f75c['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x193')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x194')));break;case 0x5:if(_0x51f75c[_0x93ae('0xec')]>=_0x274be1[_0x93ae('0x195')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countbusyretry':_0x51f75c[_0x93ae('0xec')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x196')],_0x93ae('0xf9'))[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x51f75c[_0x93ae('0xed')]>=_0x274be1['dialCongestionMaxRetry']-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countcongestionretry':_0x51f75c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x197')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c['VoiceQueueId']||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x198')));break;case 0x0:if(_0x51f75c['countnosuchnumberretry']>=_0x274be1[_0x93ae('0x199')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x51f75c[_0x93ae('0xef')]+=0x1,'scheduledat':moment()['add'](_0x274be1['dialNoSuchNumberRetryFrequency'],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19a')));}break;case 0xa:if(_0x51f75c[_0x93ae('0xfd')]>=_0x274be1[_0x93ae('0x114')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countdropretry':_0x51f75c[_0x93ae('0xfd')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x115')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19b')));break;case 0xb:if(_0x51f75c['countabandonedretry']>=_0x274be1[_0x93ae('0x11c')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countabandonedretry':_0x51f75c[_0x93ae('0xf0')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x11d')],'minutes')[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x51f75c[_0x93ae('0xf1')]>=_0x274be1[_0x93ae('0xf6')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countmachineretry':_0x51f75c[_0x93ae('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x274be1[_0x93ae('0x19c')],'minutes')[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c['VoiceQueueId']||undefined,'CampaignId':_0x51f75c['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x51f75c[_0x93ae('0xf2')]>=_0x274be1[_0x93ae('0x19d')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countagentrejectretry':_0x51f75c[_0x93ae('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x274be1[_0x93ae('0x19e')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19f')));break;default:return!![];}};Dialer[_0x93ae('0x15')][_0x93ae('0x18f')]=function(_0x88c23c,_0x5495df,_0x56083b){var _0x2340a3=this;var _0x17ffe0=new History(_0x88c23c);return new BPromise(function(_0x2c4646,_0x4d9794){if(_[_0x93ae('0x80')](_0x5495df)&&typeof _0x5495df!=='object'){return _0x4d9794(msgResponse('[callProgressDetecting]',_0x93ae('0x141'),_0x93ae('0x1a0')));}if(_['isUndefined'](_0x56083b)&&typeof _0x56083b!==_0x93ae('0x165')){return _0x4d9794(msgResponse('[callProgressDetecting]','Failure',_0x93ae('0x1a1')));}switch(_0x56083b[_0x93ae('0x1a2')]){case'0':_0x5495df[_0x93ae('0x1a3')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x0;_0x17ffe0['statedesc']=_0x93ae('0x1a4');_0x17ffe0[_0x93ae('0xef')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1a5')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2340a3[_0x93ae('0x191')](0x0,_0x88c23c,_0x5495df)){if(_0x17ffe0['countnosuchnumberretry']>=_0x5495df[_0x93ae('0x199')]){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1a6'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1a6'));}}break;case'3':_0x5495df[_0x93ae('0x1a7')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x3;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1a8');_0x17ffe0[_0x93ae('0xee')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1a9'),ut['buildObj'](_0x88c23c,_0x93ae('0x1aa')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2340a3['checkRetriveMax'](0x3,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xee')]>=_0x5495df[_0x93ae('0x192')]){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ab'));}else{_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ab'));}}break;case'5':_0x5495df[_0x93ae('0x5a')]+=0x1;_0x17ffe0['state']=0x5;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1ac');_0x17ffe0[_0x93ae('0xec')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1ad'),ut['buildObj'](_0x88c23c,'busy'));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2340a3[_0x93ae('0x191')](0x5,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xec')]>=_0x5495df[_0x93ae('0x195')]){_0x2340a3[_0x93ae('0xf7')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ae'));}else{_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x205\x20busy');}}break;case'8':_0x5495df[_0x93ae('0x5b')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x8;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1af');_0x17ffe0['countcongestionretry']+=0x1;_0x17ffe0['countglobal']+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1b0'),ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1b1')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1b2')));if(_0x2340a3[_0x93ae('0x191')](0x8,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xed')]>=_0x5495df['dialCongestionMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x208\x20congestion');}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b3'));}}break;case'11':_0x5495df[_0x93ae('0x1b4')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0xb;_0x17ffe0['statedesc']=_0x93ae('0x11a');_0x17ffe0['countabandonedretry']+=0x1;_0x17ffe0['countglobal']+=0x1;_0x2340a3['createHistory'](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2340a3[_0x93ae('0x191')](0xb,_0x88c23c,_0x5495df)){if(_0x17ffe0['countabandonedretry']>=_0x5495df['dialAbandonedMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b5'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b5'));}}break;case'20':_0x5495df['outboundRejectCallsDay']+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x14;_0x17ffe0[_0x93ae('0xe7')]='AgentReject';_0x17ffe0[_0x93ae('0xf2')]+=0x1;_0x17ffe0['countglobal']+=0x1;ami[_0x93ae('0x45')]('custom:agentreject',ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1b6')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)['catch'](loggerCatch(_0x93ae('0x1b7')));if(_0x2340a3[_0x93ae('0x191')](0x14,_0x88c23c,_0x5495df)){if(_0x17ffe0['countagentrejectretry']>=_0x5495df['dialAgentRejectMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b8'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x2020\x20agentreject');}}break;default:_0x5495df[_0x93ae('0x61')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0xc;_0x17ffe0[_0x93ae('0xe7')]=_0x56083b[_0x93ae('0x1a2')];_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1b9')));if(_0x2340a3[_0x93ae('0x191')](_0x56083b[_0x93ae('0x1a2')],_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xec')]+_0x17ffe0[_0x93ae('0xed')]+_0x17ffe0[_0x93ae('0xee')]+_0x17ffe0['countnosuchnumberretry']+_0x17ffe0[_0x93ae('0xfd')]+_0x17ffe0[_0x93ae('0xf0')]+_0x17ffe0['countmachineretry']+_0x17ffe0['countagentrejectretry']>=_0x5495df[_0x93ae('0xf3')]){_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x56083b[_0x93ae('0x1a2')]);}else{_0x2340a3[_0x93ae('0xf7')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x56083b[_0x93ae('0x1a2')]);}}}});};Dialer[_0x93ae('0x15')][_0x93ae('0xf4')]=function(_0x55d964,_0x13391b,_0x2e624d,_0xdc83c2){var _0x42719a=new Final(_0x55d964);_0x42719a[_0x93ae('0xa1')]=0xf;_0x42719a[_0x93ae('0xe7')]=_0x93ae('0x1ba');this[_0x93ae('0xf7')](_0x42719a,_0x13391b,_0x2e624d,_0xdc83c2);};Dialer['prototype'][_0x93ae('0xf7')]=function(_0x5b4801,_0x373f60,_0x56b2ba,_0x4c6142){this['moveContactManagedDialer'](_0x5b4801)[_0x93ae('0xb3')](function(){return _0x373f60(msgResponse(_0x93ae('0x1bb'),_0x93ae('0xd3'),_0x4c6142));})[_0x93ae('0xa9')](function(){return _0x56b2ba(msgResponse(_0x93ae('0x1bc'),_0x93ae('0x141'),_0x93ae('0x1bd')));});};Dialer[_0x93ae('0x15')]['predictive']=function(_0x3a762d){var _0x4bc2f9=_0x3a762d[_0x93ae('0x1be')]/0x64;var _0x324e3a=_0x3a762d[_0x93ae('0x5d')]/(_0x3a762d[_0x93ae('0x5d')]+_0x3a762d[_0x93ae('0x58')]);var _0x44746a=Math[_0x93ae('0x1bf')](_0x3a762d['predictiveIntervalAvailable']*(_0x3a762d['predictiveIntervalMaxThreshold']/0x64));var _0x2619b6=Math[_0x93ae('0x1bf')](_0x3a762d[_0x93ae('0x1c0')]*(_0x3a762d[_0x93ae('0x1c1')]/0x64));var _0x36aaef=_0x3a762d['available']+_0x3a762d[_0x93ae('0x4c')];var _0x5cee7c=Math['floor'](_0x3a762d[_0x93ae('0x6b')]*_0x3a762d[_0x93ae('0x1c2')]*_0x3a762d['predictiveIntervalHitRate']*_0x3a762d['predictiveIntervalMultiplicativeFactor']);if(_[_0x93ae('0x80')](_0x3a762d[_0x93ae('0x22')])){if(!_[_0x93ae('0x80')](_0x3a762d[_0x93ae('0x6d')])){_0x3a762d[_0x93ae('0x6d')]=undefined;loggerPredictive[_0x93ae('0x92')](_0x93ae('0x1c3'),_0x93ae('0x1c4'));}if(!_['isUndefined'](_0x3a762d[_0x93ae('0x8c')])){loggerPredictive['error'](_0x93ae('0x1c3'),_0x93ae('0x1c5'));clearInterval(_0x3a762d[_0x93ae('0x8c')]);_0x3a762d[_0x93ae('0x8c')]=undefined;}_0x3a762d[_0x93ae('0x22')]=moment()['format'](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1c6'),_0x3a762d[_0x93ae('0x22')]);this[_0x93ae('0x154')](_0x3a762d,0x1);}else if(ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d[_0x93ae('0x22')])){this[_0x93ae('0x154')](_0x3a762d,0x1);loggerPredictiveCalls['info'](_0x93ae('0x1c8'),_0x3a762d['startProgressive'],_0x3a762d[_0x93ae('0x37')]);_0x3a762d[_0x93ae('0x6b')]=0x0;_0x3a762d[_0x93ae('0x67')]=0x0;}else if(_0x4bc2f9<_0x324e3a&&_0x3a762d[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x93ae('0x1cb'),_0x324e3a,'startProgressive',_0x3a762d[_0x93ae('0x37')]);}else if(_0x5cee7c<_0x3a762d['predictiveIntervalErlangCallsDroppedCalls']&&_0x3a762d[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x1cc'),_0x93ae('0x1cd'),_0x5cee7c,_0x93ae('0x1ce'),_0x3a762d[_0x93ae('0x67')],_0x93ae('0x22'),_0x3a762d[_0x93ae('0x37')]);}else if(!ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d[_0x93ae('0x22')])&&_['isUndefined'](_0x3a762d[_0x93ae('0x6d')])&&!_[_0x93ae('0x80')](_0x3a762d['startProgressive'])){_0x3a762d[_0x93ae('0x6d')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1cf'),_0x3a762d['startPredictive']);this['averageHandleTime'](_0x3a762d['dialPredictiveInterval'])[_0x93ae('0xb3')](this['getDataPredictive'](_0x3a762d))['then'](mergeDataErlangB(_0x3a762d))[_0x93ae('0xb3')](this['startMethodPredictive'](_0x3a762d))[_0x93ae('0xa9')](loggerCatchPredictive(_0x93ae('0x1d0'),_0x3a762d));}else if(!ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d['startPredictive'])){_0x3a762d[_0x93ae('0x67')]=0x0;_0x3a762d[_0x93ae('0x6d')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d['name'],_0x93ae('0x1d1'),_0x3a762d[_0x93ae('0x6d')]);clearInterval(_0x3a762d[_0x93ae('0x8c')]);_0x3a762d[_0x93ae('0x8c')]=undefined;this[_0x93ae('0xb7')](_0x3a762d['dialPredictiveInterval'])[_0x93ae('0xb3')](this['getDataPredictive'](_0x3a762d))[_0x93ae('0xb3')](mergeDataErlangB(_0x3a762d))[_0x93ae('0xb3')](this[_0x93ae('0x1d2')](_0x3a762d))[_0x93ae('0xa9')](loggerCatchPredictive(_0x93ae('0x1d3'),_0x3a762d));}else if(_0x3a762d[_0x93ae('0x1c0')]&&_0x36aaef<_0x3a762d[_0x93ae('0x1c0')]-_0x2619b6){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1d4'),_0x36aaef,_0x93ae('0x1d5'),_0x3a762d[_0x93ae('0x1c0')],'-',_0x2619b6,'=',_0x3a762d[_0x93ae('0x1c0')]-_0x2619b6,')');}else if(_0x3a762d[_0x93ae('0x1c0')]&&_0x36aaef>_0x3a762d[_0x93ae('0x1c0')]+_0x44746a){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1d4'),_0x36aaef,_0x93ae('0x1d6'),_0x3a762d[_0x93ae('0x1c0')],'+',_0x44746a,'=',_0x3a762d['predictiveIntervalAvailable']+_0x44746a,')');}};Dialer[_0x93ae('0x15')][_0x93ae('0x1d7')]=function(_0x5d89f8){var _0x64b639=this;return function(_0x309d03){return new BPromise(function(_0x197e5a,_0x59d863){_[_0x93ae('0x89')](_0x5d89f8,_0x309d03[0x0]);if(checkGetDataPredictive(_0x309d03[0x0])){var _0x5966c4=_0x5d89f8[_0x93ae('0x1c0')]=_0x5d89f8[_0x93ae('0x4c')]+_0x5d89f8['available'];var _0x3286b4=_0x5d89f8[_0x93ae('0x1c7')]*0x3c;var _0x398a0c=_0x309d03[0x0][_0x93ae('0x64')]+_0x309d03[0x0][_0x93ae('0x63')];var _0x20d02c=(_0x309d03[0x0][_0x93ae('0x62')]+_0x309d03[0x0][_0x93ae('0x7a')]+_0x309d03[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x309d03[0x0][_0x93ae('0x7f')];_0x5d89f8[_0x93ae('0x68')]=_0x20d02c>0x0?_0x20d02c:0x1;switch(_0x5d89f8[_0x93ae('0x1c9')]){case _0x93ae('0x1ca'):var _0x377fa0=_0x5d89f8['dialPredictiveOptimizationPercentage']/0x64;return _0x64b639[_0x93ae('0x1d8')](_0x5966c4,_0x3286b4,_0x398a0c,_0x20d02c,_0x377fa0)['then'](function(_0x24397d){return _0x197e5a(_0x24397d);});case _0x93ae('0x1d9'):var _0x2aec98=_0x5d89f8[_0x93ae('0x1be')]/0x64;return _0x64b639[_0x93ae('0x1da')](_0x5966c4,_0x3286b4,_0x398a0c,_0x20d02c,_0x2aec98)[_0x93ae('0xb3')](function(_0x184f8a){return _0x197e5a(_0x184f8a);});default:return _0x59d863(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),_0x93ae('0x1dc')));}}else{return _0x59d863(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),_0x93ae('0x1dd')));}});};};Dialer['prototype'][_0x93ae('0x1de')]=function(_0x36de24){var _0x414cea=this;return function(_0x35d52b){return new BPromise(function(_0x225a16,_0x5b2a33){_[_0x93ae('0x89')](_0x36de24,_0x35d52b[0x0]);if(checkGetDataPredictive(_0x35d52b[0x0])){loggerPredictive[_0x93ae('0x75')](JSON[_0x93ae('0x41')](_0x35d52b[0x0]));if(_0x36de24[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){return _0x414cea['getVoiceQueueRtPauses'](_0x36de24['id'])[_0x93ae('0xb3')](function(_0x5514c5){var _0x1fa9b7=_0x36de24['loggedIn']-_0x5514c5[0x0][_0x93ae('0x1df')];var _0x16340b=_0x36de24[_0x93ae('0x1c7')]*0x3c;var _0x1201f4=_0x35d52b[0x0][_0x93ae('0x64')]+_0x35d52b[0x0][_0x93ae('0x63')];var _0x2e3543=(_0x35d52b[0x0][_0x93ae('0x62')]+_0x35d52b[0x0][_0x93ae('0x7a')]+_0x35d52b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x35d52b[0x0][_0x93ae('0x7f')];var _0x101760=_0x36de24['dialPredictiveOptimizationPercentage']/0x64;_0x36de24[_0x93ae('0x6a')]=_0x5514c5[0x0]['outboundQueuePauses']||0x0;_0x36de24[_0x93ae('0x68')]=_0x2e3543>0x0?_0x2e3543:0x1;return _0x414cea[_0x93ae('0x1d8')](_0x1fa9b7,_0x16340b,_0x1201f4,_0x2e3543,_0x101760);})['then'](function(_0x46763b){return _0x225a16(_0x46763b);})[_0x93ae('0xa9')](function(_0x4f8200){return _0x5b2a33(msgResponse(_0x93ae('0x1e0'),'Failure',JSON[_0x93ae('0x41')](_0x4f8200)));});}if(_0x36de24[_0x93ae('0x1c9')]===_0x93ae('0x1d9')){return _0x414cea[_0x93ae('0xbf')](_0x36de24['id'])[_0x93ae('0xb3')](function(_0x15a2e4){var _0x49f837=_0x36de24['loggedIn']-_0x15a2e4[0x0][_0x93ae('0x1df')];var _0xe2a430=_0x36de24[_0x93ae('0x1c7')]*0x3c;var _0x4476c7=_0x35d52b[0x0][_0x93ae('0x64')]+_0x35d52b[0x0][_0x93ae('0x63')];var _0x5356db=(_0x35d52b[0x0][_0x93ae('0x62')]+_0x35d52b[0x0][_0x93ae('0x7a')]+_0x35d52b[0x0][_0x93ae('0x65')])/_0x35d52b[0x0][_0x93ae('0x7f')];var _0x554626=_0x36de24[_0x93ae('0x1be')]/0x64;_0x36de24['predictiveIntervalPauses']=_0x15a2e4[0x0][_0x93ae('0x1df')]||0x0;_0x36de24[_0x93ae('0x68')]=_0x5356db>0x0?_0x5356db:0x1;return _0x414cea['busyFactor'](_0x49f837,_0xe2a430,_0x4476c7,_0x5356db,_0x554626);})[_0x93ae('0xb3')](function(_0x165345){return _0x225a16(_0x165345);})[_0x93ae('0xa9')](function(_0x3d6df9){return _0x5b2a33(msgResponse(_0x93ae('0x1e0'),_0x93ae('0x141'),JSON[_0x93ae('0x41')](_0x3d6df9)));});}}else{return _0x5b2a33(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),'check\x20failure'));}});};};Dialer[_0x93ae('0x15')][_0x93ae('0x1d2')]=function(_0x4bba84){var _0x3a942f=this;return function(){var _0x19b41c=0x0;var _0x30854c=Math[_0x93ae('0x1e1')](_0x4bba84[_0x93ae('0x86')]*0x3e8);if(_0x30854c>0x0){_0x30854c=_0x30854c<0x64?0x64:_0x30854c;loggerPredictive[_0x93ae('0x75')](_0x4bba84[_0x93ae('0x37')],_0x93ae('0x1e2'),_0x30854c,'milliseconds');_0x4bba84[_0x93ae('0x8c')]=setInterval(function(){_0x3a942f[_0x93ae('0x8c')](_0x4bba84);loggerPredictiveCalls['info'](_0x93ae('0x1e3'),_0x19b41c+=0x1);},_0x30854c);}else{loggerPredictive['info'](_0x4bba84[_0x93ae('0x37')],_0x93ae('0x1e4'));}};};Dialer[_0x93ae('0x15')][_0x93ae('0x1e5')]=function(_0x59984f,_0x16f386){var _0x4c2885=this;return function(_0x1775c8){if(_['isEmpty'](_0x1775c8)){if(_[_0x93ae('0xa6')](_0x16f386[_0x93ae('0xcd')])||!_0x16f386[_0x93ae('0x1e6')]){if(_0x59984f[_0x93ae('0x52')]===_0x93ae('0x157')){_0x59984f['queueStatusComplete']=_[_0x93ae('0x80')](_0x59984f[_0x93ae('0x129')])?!![]:_0x59984f[_0x93ae('0x129')];var _0x35fc41=uuid['v4']();_0x4c2885[_0x93ae('0x1f')][_0x35fc41]=new Action(_0x59984f,_0x16f386,_0x35fc41);loggerBooked[_0x93ae('0x75')](_0x93ae('0x1e7'),_0x35fc41,_0x93ae('0x1e8'),JSON[_0x93ae('0x41')](_0x59984f[_0x93ae('0x129')]),'Queue:\x20',_0x59984f[_0x93ae('0x37')]);if(_0x59984f[_0x93ae('0x129')]){_0x59984f[_0x93ae('0x129')]=![];_0x4c2885[_0x93ae('0x24')][_0x4c2885['actions'][_0x35fc41]['queue']]=[];ami[_0x93ae('0xa7')]({'actionid':_0x35fc41,'action':_0x93ae('0x1e9'),'queue':_0x59984f[_0x93ae('0x37')]})[_0x93ae('0xa9')](function(){_0x4c2885[_0x93ae('0xab')](_0x59984f);_0x4c2885['rescheduleContact']({'active':![],'ContactId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcb')],'ListId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['ListId'],'VoiceQueueId':_0x4c2885['actions'][_0x35fc41][_0x93ae('0xce')]||undefined,'CampaignId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1ea')));delete _0x4c2885[_0x93ae('0x1f')][_0x35fc41];});}else{loggerBooked[_0x93ae('0x75')](_0x93ae('0x1eb'),JSON[_0x93ae('0x41')](_0x59984f['queueStatusComplete']),_0x93ae('0x1ec'),_0x59984f[_0x93ae('0x37')]);_0x4c2885[_0x93ae('0xab')](_0x59984f);_0x4c2885[_0x93ae('0xb9')]({'active':![],'ContactId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['ContactId'],'ListId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcc')],'VoiceQueueId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['VoiceQueueId']||undefined,'CampaignId':_0x4c2885['actions'][_0x35fc41][_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1ea')));delete _0x4c2885[_0x93ae('0x1f')][_0x35fc41];}}else{return _0x4c2885[_0x93ae('0x164')](_0x59984f,_0x16f386);}}else{if(getDiff(_0x16f386[_0x93ae('0x1ed')])<_0x59984f['dialRecallMeTimeout']*0x3c){if(_0x16f386[_0x93ae('0x1ee')]&&!_0x16f386[_0x93ae('0x1ee')]['voicePause']){_0x4c2885[_0x93ae('0x134')][_0x93ae('0x1ef')](_0x16f386['id'])[_0x93ae('0x12d')](function(){_0x4c2885['updateOriginated'](_0x59984f);});}else{_0x4c2885[_0x93ae('0x1f0')]({'active':![]},_0x16f386['id'],0x1)[_0x93ae('0x12d')](function(){_0x4c2885[_0x93ae('0xab')](_0x59984f);});}}else{_0x59984f['outboundReCallsDay']+=0x1;_0x4c2885['updateOriginated'](_0x59984f);if(_0x59984f[_0x93ae('0x1f1')]){_0x4c2885['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16f386[_0x93ae('0xcb')],'ListId':_0x16f386[_0x93ae('0xcc')],'VoiceQueueId':_0x16f386[_0x93ae('0xce')]||undefined,'CampaignId':_0x16f386[_0x93ae('0xcf')]||undefined})['catch'](loggerCatch(_0x93ae('0x1f2')));_0x4c2885[_0x93ae('0xc3')](createObjHistory(_0x59984f,_0x16f386,_0x93ae('0x1f3'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x93ae('0x1f4')));}else{_0x4c2885[_0x93ae('0xca')](createObjHistory(_0x59984f,_0x16f386,'RECALLFAILEDTIMEOUT',0x16,_0x93ae('0x1f5')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x59984f[_0x93ae('0x59')]+=0x1;_0x4c2885[_0x93ae('0xca')](createObjHistory(_0x59984f,_0x16f386,_0x93ae('0x1f6'),0xd,_0x93ae('0x1f7')),_0x93ae('0x1f8'),'[Originate][MoveBlacklist]');throw _0x93ae('0x1f9');}};};Dialer[_0x93ae('0x15')][_0x93ae('0x15a')]=function(_0x3b913c){var _0x13f136=this;var _0x567de0=_0x3b913c[_0x93ae('0x1fa')]-_0x3b913c[_0x93ae('0x96')]-_0x3b913c[_0x93ae('0xbb')];emitCampaignSummary(_0x3b913c);if(_0x567de0>0x0){if(_0x567de0>this[_0x93ae('0x1d')]){_0x567de0=this[_0x93ae('0x1d')];}_0x3b913c[_0x93ae('0xbb')]+=_0x567de0;this[_0x93ae('0xbd')](_0x3b913c['id'],_0x567de0,_0x3b913c[_0x93ae('0x1fb')],_0x3b913c)[_0x93ae('0xb3')](function(_0xb5029f){_0x3b913c['temp']-=_0x567de0;_0x3b913c[_0x93ae('0xbb')]=_0x3b913c['temp']>0x0?_0x3b913c[_0x93ae('0xbb')]:0x0;if(!checkContactEmpty(_0xb5029f)){_0x3b913c[_0x93ae('0x38')]=_0x93ae('0x1fc');logger[_0x93ae('0x75')](_0x93ae('0x1fd')+_0x3b913c[_0x93ae('0x37')]);}else{_0x3b913c[_0x93ae('0x96')]+=_0xb5029f[_0x93ae('0x94')];_0x3b913c[_0x93ae('0x38')]=_0x93ae('0x1fe');for(var _0x5e9acb=0x0;_0x5e9acb<_0xb5029f[_0x93ae('0x94')];_0x5e9acb+=0x1){_0x3b913c[_0x93ae('0x1ff')]+=0x1;if(_['isNil'](_0xb5029f[_0x5e9acb])||_[_0x93ae('0xa6')](_0xb5029f[_0x5e9acb][_0x93ae('0x168')])||_['isNil'](_0xb5029f[_0x5e9acb][_0x93ae('0x168')][_0x93ae('0x169')])){_0x13f136[_0x93ae('0xc8')](_0x93ae('0x200'),_0x3b913c,_0xb5029f[_0x5e9acb]);}else{_0x13f136[_0x93ae('0xb5')](_[_0x93ae('0x127')](_0xb5029f[_0x5e9acb],['CampaignId','Contact.phone']))[_0x93ae('0xb3')](_0x13f136[_0x93ae('0x1e5')](_0x3b913c,_0xb5029f[_0x5e9acb]))[_0x93ae('0xa9')](_0x13f136[_0x93ae('0xc7')]('[actionOriginateIvr]\x20',_0x3b913c));}}}})[_0x93ae('0xa9')](loggerGetContactDialer(_0x93ae('0x201'),_0x3b913c,_0x567de0));}};Dialer['prototype'][_0x93ae('0x154')]=function(_0x56b25b,_0x5d3a4f){var _0x542489=this;var _0x8a40=[];var _0xc48e12=_0x5d3a4f>=0x1?_0x5d3a4f:0x1;if(_0x56b25b[_0x93ae('0x52')]==='booked'){_0xc48e12=0x1;}var _0x1d60ca=Math[_0x93ae('0x1e1')](_0x56b25b[_0x93ae('0x202')]*_0xc48e12)-_0x56b25b[_0x93ae('0x96')]-_0x56b25b[_0x93ae('0xbb')];emitVoiceQueueSummary(_0x56b25b);if(_0x56b25b[_0x93ae('0x203')]>0x0){var _0x44a1dc=_0x56b25b['dialLimitQueue']-_0x56b25b[_0x93ae('0x96')]-_0x56b25b[_0x93ae('0x4c')]-_0x56b25b[_0x93ae('0xbb')]-_0x56b25b['pTalking'];if(_0x1d60ca>_0x44a1dc){_0x1d60ca=_0x44a1dc;}}if(_0x1d60ca>0x0){if(_0x56b25b[_0x93ae('0x52')]===_0x93ae('0x157')){_0x1d60ca=0x1;}if(_0x1d60ca>this['maxNumberOriginate']){_0x1d60ca=this[_0x93ae('0x1d')];}_0x56b25b['temp']+=_0x1d60ca;for(var _0x95a710 in this['agents']){if(typeof this[_0x93ae('0x1b')][_0x95a710]!==_0x93ae('0x95')){if(this[_0x93ae('0x1b')][_0x95a710][_0x93ae('0xa1')]===_0x93ae('0x204')&&this[_0x93ae('0x1b')][_0x95a710][_0x93ae('0xa8')]===_0x93ae('0xd7')){_0x8a40['push'](this[_0x93ae('0x1b')][_0x95a710]['id']);}}}this[_0x93ae('0xba')](_0x56b25b['id'],_0x8a40,_0x1d60ca,_0x56b25b[_0x93ae('0x1fb')],_0x56b25b)[_0x93ae('0xb3')](function(_0x189cb5){_0x56b25b[_0x93ae('0xbb')]-=_0x1d60ca;_0x56b25b[_0x93ae('0xbb')]=_0x56b25b['temp']>0x0?_0x56b25b[_0x93ae('0xbb')]:0x0;if(!checkContactEmpty(_0x189cb5)){_0x542489[_0x93ae('0xb0')](_0x56b25b)[_0x93ae('0xb3')](sendMessageReschedule(_0x56b25b))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));}else{_0x56b25b[_0x93ae('0x96')]+=_0x189cb5['length'];_0x56b25b['message']=_0x56b25b[_0x93ae('0x52')]===_0x93ae('0x157')?_0x93ae('0x170'):_0x93ae('0x1fe');for(var _0x512272=0x0;_0x512272<_0x189cb5['length'];_0x512272+=0x1){if(_['isNil'](_0x189cb5[_0x512272])||_[_0x93ae('0xa6')](_0x189cb5[_0x512272][_0x93ae('0x168')])||_[_0x93ae('0xa6')](_0x189cb5[_0x512272][_0x93ae('0x168')][_0x93ae('0x169')])){_0x542489[_0x93ae('0xc8')](_0x93ae('0x200'),_0x56b25b,_0x189cb5[_0x512272]);}else{_0x542489[_0x93ae('0xb2')](_[_0x93ae('0x127')](_0x189cb5[_0x512272],[_0x93ae('0xce'),_0x93ae('0x205')]))[_0x93ae('0xb3')](_0x542489['checkContactBlack'](_0x56b25b,_0x189cb5[_0x512272]))[_0x93ae('0xa9')](_0x542489[_0x93ae('0xc7')](_0x93ae('0x200'),_0x56b25b));}}}})[_0x93ae('0xa9')](loggerGetContactDialer('[getContactDialer2]',_0x56b25b,_0x1d60ca));}};Dialer[_0x93ae('0x15')][_0x93ae('0x8c')]=function(_0xdecc1c){if(_0xdecc1c[_0x93ae('0x203')]>0x0){var _0x47bf87=_0xdecc1c[_0x93ae('0x203')]-_0xdecc1c[_0x93ae('0x96')]-_0xdecc1c[_0x93ae('0x4c')];if(_0x47bf87>0x0){this[_0x93ae('0x206')](_0xdecc1c);}else{loggerPredictiveCalls[_0x93ae('0x75')]('[handlePredictive][limitChannel]');}}else{this[_0x93ae('0x206')](_0xdecc1c);}};Dialer[_0x93ae('0x15')][_0x93ae('0x206')]=function(_0x157df5){var _0x5ee573=this;var _0x5e3c06=[];_0x157df5['originated']+=0x1;for(var _0x5e11e4 in this[_0x93ae('0x1b')]){if(typeof this['agents'][_0x5e11e4]!==_0x93ae('0x95')){if(this[_0x93ae('0x1b')][_0x5e11e4]['state']===_0x93ae('0x204')&&this[_0x93ae('0x1b')][_0x5e11e4][_0x93ae('0xa8')]==='reachable'){_0x5e3c06[_0x93ae('0x126')](this[_0x93ae('0x1b')][_0x5e11e4]['id']);}}}this[_0x93ae('0xba')](_0x157df5['id'],_0x5e3c06,0x1,_0x157df5[_0x93ae('0x1fb')],_0x157df5)['then'](function(_0x57b5af){if(!checkContactEmpty(_0x57b5af)){checkContactLowerLimitOriginate(_0x157df5,0x1,0x0);_0x5ee573[_0x93ae('0xb0')](_0x157df5)[_0x93ae('0xb3')](sendMessageReschedule(_0x157df5))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));}else{_0x157df5[_0x93ae('0x38')]=_0x93ae('0x1fe');if(_['isNil'](_0x57b5af[0x0])||_['isNil'](_0x57b5af[0x0][_0x93ae('0x168')])||_[_0x93ae('0xa6')](_0x57b5af[0x0]['Contact']['phone'])){_0x5ee573[_0x93ae('0xc8')](_0x93ae('0x200'),_0x157df5,_0x57b5af[0x0]);}else{_0x5ee573['checkIsBlackList'](_['pick'](_0x57b5af[0x0],[_0x93ae('0xce'),'Contact.phone']))[_0x93ae('0xb3')](_0x5ee573['checkContactBlack'](_0x157df5,_0x57b5af[0x0]))[_0x93ae('0xa9')](_0x5ee573[_0x93ae('0xc7')](_0x93ae('0x207'),_0x157df5));}}})[_0x93ae('0xa9')](loggerGetContactDialer(_0x93ae('0x208'),_0x157df5,0x1));emitVoiceQueueSummary(_0x157df5);};Dialer[_0x93ae('0x15')][_0x93ae('0x1d8')]=function(_0x42dc0c,_0x4da04b,_0x406c06,_0xb8848f,_0x2dda87,_0x3b2b1b){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x209'));loggerPredictive[_0x93ae('0x75')]('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',_0x42dc0c);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20a'),_0x4da04b);loggerPredictive[_0x93ae('0x75')]('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',_0x406c06);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20b'),_0xb8848f);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20c'),_0x2dda87);loggerPredictive['info'](_0x93ae('0x7e'));return new BPromise(function(_0x635841,_0x1c8041){if(_0x42dc0c<=0x0||isNaN(_0x42dc0c)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x20e')+_0x42dc0c));}if(_0x406c06<=0x0||isNaN(_0x406c06)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x20f')+_0x406c06));}if(_0xb8848f<=0x0||isNaN(_0xb8848f)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x210')+_0xb8848f));}if(_0x4da04b<=0x0||isNaN(_0x4da04b)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),'Error','interval\x20=\x20'+_0x4da04b));}if(_0x2dda87<=0x0||isNaN(_0x2dda87)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),'Error',_0x93ae('0x211')+_0x2dda87));}_0x3b2b1b=_0x3b2b1b||0x0;var _0x355789=0x1/_0x406c06;var _0x48f59d=0x0;var _0x171e33=0x0;var _0x66b5e4=0x0;var _0x2eac6b=0x0;for(var _0x47d4c4=0x0;_0x66b5e4<_0x2dda87;_0x47d4c4+=0x1){_0x171e33=_0x47d4c4/_0x4da04b;_0x48f59d=(_0xb8848f*_0x171e33+_0x3b2b1b)/_0x355789;_0x66b5e4=erlangb(_0x48f59d,_0x42dc0c);_0x2eac6b=_0x48f59d/_0x42dc0c*(0x1-erlangb(_0x48f59d,_0x42dc0c));}return _0x635841({'erlangCalls':_0x47d4c4,'erlangCallToSecond':_0x4da04b/_0x47d4c4,'erlangAbandonmentRate':_0x66b5e4,'erlangBusyFactor':_0x2eac6b});});};Dialer[_0x93ae('0x15')]['busyFactor']=function(_0xe86224,_0x53eff3,_0x52fa58,_0x201d10,_0x5cfba2,_0x3fb84b){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x212'));loggerPredictive['info'](_0x93ae('0x213'),_0xe86224);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20a'),_0x53eff3);loggerPredictive['info'](_0x93ae('0x214'),_0x52fa58);loggerPredictive['info'](_0x93ae('0x20b'),_0x201d10);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x215'),_0x5cfba2);loggerPredictive['info'](_0x93ae('0x7e'));return new BPromise(function(_0x1659bc,_0x566de1){if(_0xe86224<=0x0||isNaN(_0xe86224)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x20e')+_0xe86224));}if(_0x52fa58<=0x0||isNaN(_0x52fa58)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x20f')+_0x52fa58));}if(_0x201d10<=0x0||isNaN(_0x201d10)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),'p\x20=\x20'+_0x201d10));}if(_0x53eff3<=0x0||isNaN(_0x53eff3)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x217')+_0x53eff3));}if(_0x5cfba2<=0x0||isNaN(_0x5cfba2)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),'Umin\x20=\x20'+_0x5cfba2));}_0x3fb84b=_0x3fb84b||0x0;var _0x1fe767=0x1/_0x52fa58;var _0x13eb9a=0x0;var _0x50752b=0x0;var _0x5d6167=0x0;var _0x53f8ab=0x0;for(var _0x272ebd=0x0;_0x53f8ab<_0x5cfba2;_0x272ebd+=0x1){_0x50752b=_0x272ebd/_0x53eff3;_0x13eb9a=(_0x201d10*_0x50752b+_0x3fb84b)/_0x1fe767;_0x5d6167=erlangb(_0x13eb9a,_0xe86224);_0x53f8ab=_0x13eb9a/_0xe86224*(0x1-erlangb(_0x13eb9a,_0xe86224));}return _0x1659bc({'erlangCalls':_0x272ebd,'erlangCallToSecond':_0x53eff3/_0x272ebd,'erlangAbandonmentRate':_0x5d6167,'erlangBusyFactor':_0x53f8ab});});};module[_0x93ae('0x218')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index fbb7f63..ce7b279 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd442=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x4c0bb0,_0x4d90e4){var _0x46856c=function(_0xf18e28){while(--_0xf18e28){_0x4c0bb0['push'](_0x4c0bb0['shift']());}};_0x46856c(++_0x4d90e4);}(_0xd442,0x1b5));var _0x2d44=function(_0x35b159,_0x1d13da){_0x35b159=_0x35b159-0x0;var _0x320236=_0xd442[_0x35b159];return _0x320236;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2d44('0x0'));function getSeconds(_0x4af95f,_0x481873){var _0x389c4f=moment(_0x4af95f)[_0x2d44('0x1')](0x0);var _0x3f07be=moment(_0x481873)[_0x2d44('0x1')](0x0);return _0x389c4f[_0x2d44('0x2')](_0x3f07be,_0x2d44('0x3'));}function QueueCallerAbandon(_0x68f8f8,_0x38bcc4){this[_0x2d44('0x4')]=_0x68f8f8[_0x2d44('0x4')];this['type']=_0x68f8f8[_0x2d44('0x5')];this[_0x2d44('0x6')]=_0x68f8f8[_0x2d44('0x5')]===_0x2d44('0x7')?_0x2d44('0x8'):_0x68f8f8[_0x2d44('0x5')];this[_0x2d44('0x9')]=_0x68f8f8['countbusyretry'];this[_0x2d44('0xa')]=_0x68f8f8[_0x2d44('0xa')];this[_0x2d44('0xb')]=_0x68f8f8['countnoanswerretry'];this[_0x2d44('0xc')]=_0x68f8f8[_0x2d44('0x9')]+_0x68f8f8[_0x2d44('0xa')]+_0x68f8f8[_0x2d44('0xb')]+_0x68f8f8['countnosuchnumberretry']+_0x68f8f8[_0x2d44('0xd')]+_0x68f8f8[_0x2d44('0xe')]+_0x68f8f8['countmachineretry']+_0x68f8f8[_0x2d44('0xf')];this[_0x2d44('0x10')]=_0x68f8f8[_0x2d44('0x10')];this[_0x2d44('0xd')]=_0x68f8f8[_0x2d44('0xd')];this[_0x2d44('0xe')]=_0x68f8f8['countabandonedretry'];this[_0x2d44('0x11')]=_0x68f8f8[_0x2d44('0x11')];this['countagentrejectretry']=_0x68f8f8['countagentrejectretry'];this[_0x2d44('0x12')]=_0x38bcc4[_0x2d44('0x12')];this[_0x2d44('0x13')]=_0x68f8f8[_0x2d44('0x14')];this[_0x2d44('0x15')]=_0x68f8f8[_0x2d44('0x16')];this[_0x2d44('0x17')]=_0x68f8f8['starttime'];this[_0x2d44('0x18')]=_0x68f8f8[_0x2d44('0x18')];this[_0x2d44('0x19')]=_0x68f8f8[_0x2d44('0x19')];this[_0x2d44('0x1a')]=this['droptime'];this[_0x2d44('0x1b')]=getSeconds(_0x68f8f8[_0x2d44('0x18')],_0x68f8f8[_0x2d44('0x17')]);this['holdtime']=getSeconds(this['droptime'],_0x68f8f8[_0x2d44('0x18')]);this[_0x2d44('0x1c')]=0x0;this['queue']=_0x38bcc4['queue'];this[_0x2d44('0x1d')]=_0x38bcc4['connectedlinename'];this[_0x2d44('0x1e')]=_0x38bcc4[_0x2d44('0x1e')];this[_0x2d44('0x1f')]=_0x68f8f8[_0x2d44('0x1f')];this['callbackuniqueid']=_0x68f8f8[_0x2d44('0x20')];this[_0x2d44('0x21')]=_0x68f8f8[_0x2d44('0x21')];this[_0x2d44('0x22')]=_0x68f8f8[_0x2d44('0x22')];this[_0x2d44('0x23')]=_0x68f8f8[_0x2d44('0x23')];this[_0x2d44('0x24')]=_0x68f8f8[_0x2d44('0x24')];this[_0x2d44('0x25')]=_0x68f8f8['UserId'];this['VoiceQueueId']=_0x68f8f8[_0x2d44('0x26')];this['CampaignId']=_0x68f8f8[_0x2d44('0x27')];this[_0x2d44('0x28')]=_0x68f8f8[_0x2d44('0x28')]||'';this[_0x2d44('0x29')]=_0x68f8f8[_0x2d44('0x29')]||'';}module[_0x2d44('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xf7f7=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x27fc6d,_0x138b22){var _0x1c7ece=function(_0x61d08){while(--_0x61d08){_0x27fc6d['push'](_0x27fc6d['shift']());}};_0x1c7ece(++_0x138b22);}(_0xf7f7,0xf6));var _0x7f7f=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xf7f7[_0x35d8af];return _0x1d08b0;};'use strict';var util=require(_0x7f7f('0x0'));var _=require(_0x7f7f('0x1'));var moment=require(_0x7f7f('0x2'));function getSeconds(_0x1e9816,_0x580cd2){var _0x22087a=moment(_0x1e9816)[_0x7f7f('0x3')](0x0);var _0x52e9ae=moment(_0x580cd2)[_0x7f7f('0x3')](0x0);return _0x22087a[_0x7f7f('0x4')](_0x52e9ae,_0x7f7f('0x5'));}function QueueCallerAbandon(_0x53161b,_0x1ebb4a){this[_0x7f7f('0x6')]=_0x53161b['scheduledat'];this[_0x7f7f('0x7')]=_0x53161b[_0x7f7f('0x7')];this['campaigntype']=_0x53161b[_0x7f7f('0x7')]===_0x7f7f('0x8')?_0x7f7f('0x9'):_0x53161b[_0x7f7f('0x7')];this[_0x7f7f('0xa')]=_0x53161b[_0x7f7f('0xa')];this[_0x7f7f('0xb')]=_0x53161b[_0x7f7f('0xb')];this[_0x7f7f('0xc')]=_0x53161b[_0x7f7f('0xc')];this['countglobal']=_0x53161b['countbusyretry']+_0x53161b[_0x7f7f('0xb')]+_0x53161b['countnoanswerretry']+_0x53161b[_0x7f7f('0xd')]+_0x53161b[_0x7f7f('0xe')]+_0x53161b['countabandonedretry']+_0x53161b[_0x7f7f('0xf')]+_0x53161b['countagentrejectretry'];this[_0x7f7f('0xd')]=_0x53161b[_0x7f7f('0xd')];this['countdropretry']=_0x53161b[_0x7f7f('0xe')];this[_0x7f7f('0x10')]=_0x53161b[_0x7f7f('0x10')];this[_0x7f7f('0xf')]=_0x53161b[_0x7f7f('0xf')];this['countagentrejectretry']=_0x53161b['countagentrejectretry'];this['uniqueid']=_0x1ebb4a[_0x7f7f('0x11')];this[_0x7f7f('0x12')]=_0x53161b[_0x7f7f('0x13')];this[_0x7f7f('0x14')]=_0x53161b[_0x7f7f('0x15')];this[_0x7f7f('0x16')]=_0x53161b[_0x7f7f('0x16')];this[_0x7f7f('0x17')]=_0x53161b[_0x7f7f('0x17')];this[_0x7f7f('0x18')]=_0x53161b[_0x7f7f('0x18')];this[_0x7f7f('0x19')]=this[_0x7f7f('0x18')];this['ringtime']=getSeconds(_0x53161b[_0x7f7f('0x17')],_0x53161b[_0x7f7f('0x16')]);this['holdtime']=getSeconds(this[_0x7f7f('0x18')],_0x53161b[_0x7f7f('0x17')]);this[_0x7f7f('0x1a')]=0x0;this[_0x7f7f('0x9')]=_0x1ebb4a[_0x7f7f('0x9')];this[_0x7f7f('0x1b')]=_0x1ebb4a[_0x7f7f('0x1c')];this[_0x7f7f('0x1d')]=_0x1ebb4a[_0x7f7f('0x1d')];this[_0x7f7f('0x1e')]=_0x53161b[_0x7f7f('0x1e')];this[_0x7f7f('0x1f')]=_0x53161b[_0x7f7f('0x1f')];this[_0x7f7f('0x20')]=_0x53161b[_0x7f7f('0x20')];this[_0x7f7f('0x21')]=_0x53161b[_0x7f7f('0x21')];this[_0x7f7f('0x22')]=_0x53161b[_0x7f7f('0x22')];this[_0x7f7f('0x23')]=_0x53161b[_0x7f7f('0x23')];this[_0x7f7f('0x24')]=_0x53161b[_0x7f7f('0x24')];this[_0x7f7f('0x25')]=_0x53161b[_0x7f7f('0x25')];this[_0x7f7f('0x26')]=_0x53161b[_0x7f7f('0x26')];this[_0x7f7f('0x27')]=_0x53161b[_0x7f7f('0x27')]||'';this[_0x7f7f('0x28')]=_0x53161b[_0x7f7f('0x28')]||'';}module[_0x7f7f('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 830f5c6..f19f99c 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(_0x1cf4dd,_0x1ebe37){var _0x2ace39=function(_0x4c158b){while(--_0x4c158b){_0x1cf4dd['push'](_0x1cf4dd['shift']());}};_0x2ace39(++_0x1ebe37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x31a303,_0x307f6b){var _0x3bc7a8=function(_0x3f374f){while(--_0x3f374f){_0x31a303['push'](_0x31a303['shift']());}};_0x3bc7a8(++_0x307f6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 962486e..170ffda 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 _0x130a=['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','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','uniqueid','name','\x20syncNewchannel\x20','channel','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','info','syncOriginateResponse','merge','reason','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend'];(function(_0x3b0310,_0x225075){var _0x3df645=function(_0x2c085e){while(--_0x2c085e){_0x3b0310['push'](_0x3b0310['shift']());}};_0x3df645(++_0x225075);}(_0x130a,0x93));var _0xa130=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x130a[_0x381589];return _0x2a075d;};'use strict';var util=require('util');var _=require(_0xa130('0x0'));var BPromise=require(_0xa130('0x1'));var uuid=require(_0xa130('0x2'));var moment=require('moment');var path=require(_0xa130('0x3'));var tiff2pdf=require(_0xa130('0x4'));var gs=require('./util/gs');var logger=require(_0xa130('0x5'))(_0xa130('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xa130('0x7'));var ut=require(_0xa130('0x8'));var Action=require(_0xa130('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xa130('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xb8254){this[_0xa130('0xb')]={};this[_0xa130('0xc')]=_0xb8254['faxAccounts'];this[_0xa130('0xd')]=_0xb8254[_0xa130('0xd')];this[_0xa130('0xe')]={};ami['on'](_0xa130('0xf'),this['syncNewchannel']['bind'](this));ami['on'](_0xa130('0x10'),this[_0xa130('0x11')][_0xa130('0x12')](this));ami['on'](_0xa130('0x13'),this[_0xa130('0x14')][_0xa130('0x12')](this));ami['on'](_0xa130('0x15'),this[_0xa130('0x16')][_0xa130('0x12')](this));ami['on'](_0xa130('0x17'),this[_0xa130('0x18')][_0xa130('0x12')](this));ami['on'](_0xa130('0x19'),this[_0xa130('0x1a')][_0xa130('0x12')](this));ami['on']('hangup',this[_0xa130('0x1b')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xa130('0x12')](this));}Fax[_0xa130('0x1c')]['syncNewchannel']=function(_0x217977){if(_0x217977[_0xa130('0x1d')]===_0xa130('0x1e')){for(var _0xd9aea5 in this['faxAccounts']){if(this[_0xa130('0xc')][_0xa130('0x1f')](_0xd9aea5)){if(_0x217977['exten']===this[_0xa130('0xc')][_0xd9aea5]['localstationid']){this['channels'][_0x217977[_0xa130('0x20')]]={};this[_0xa130('0xb')][_0x217977[_0xa130('0x20')]]['channel']=_0x217977['channel'];this['channels'][_0x217977[_0xa130('0x20')]]['id']=this[_0xa130('0xc')][_0xd9aea5]['id'];this['channels'][_0x217977[_0xa130('0x20')]]['name']=this[_0xa130('0xc')][_0xd9aea5][_0xa130('0x21')];logger['info'](_0x217977[_0xa130('0x20')],_0xa130('0x22'));}}}}if(this[_0xa130('0xe')][_0x217977[_0xa130('0x20')]]){this[_0xa130('0xb')][_0x217977['uniqueid']]={};this[_0xa130('0xb')][_0x217977['uniqueid']][_0xa130('0x23')]=_0x217977[_0xa130('0x23')];logger['info'](_0x217977[_0xa130('0x20')],_0xa130('0x22'));}};Fax[_0xa130('0x1c')][_0xa130('0x11')]=function(_0x1568e8){if(this[_0xa130('0xb')][_0x1568e8['uniqueid']]){for(var _0x26d1b8 in _0x1568e8[_0xa130('0x24')]){if(_0x1568e8[_0xa130('0x24')][_0xa130('0x1f')](_0x26d1b8)){this[_0xa130('0xb')][_0x1568e8[_0xa130('0x20')]][_0x26d1b8]=_0x1568e8[_0xa130('0x25')];}}}};Fax[_0xa130('0x1c')][_0xa130('0x14')]=function(_0x518ecc){if(this['channels'][_0x518ecc[_0xa130('0x20')]]){this['channels'][_0x518ecc['uniqueid']][_0xa130('0x26')]=_0x518ecc[_0xa130('0x26')];this[_0xa130('0xb')][_0x518ecc[_0xa130('0x20')]][_0xa130('0x27')]=_0x518ecc[_0xa130('0x27')];}};Fax[_0xa130('0x1c')][_0xa130('0x16')]=function(_0xa61384){if(this[_0xa130('0xb')][_0xa61384['uniqueid']]){for(var _0x3a5604 in _0xa61384[_0xa130('0x24')]){if(_0xa61384[_0xa130('0x24')][_0xa130('0x1f')](_0x3a5604)){this[_0xa130('0xb')][_0xa61384['uniqueid']][_0x3a5604]=_0xa61384[_0xa130('0x25')];}}}};Fax['prototype'][_0xa130('0x18')]=function(_0x466572){if(this[_0xa130('0xb')][_0x466572[_0xa130('0x20')]]){this[_0xa130('0xb')][_0x466572[_0xa130('0x20')]]['operation']=_0x466572[_0xa130('0x28')];this[_0xa130('0xb')][_0x466572['uniqueid']][_0xa130('0x29')]=_0x466572[_0xa130('0x29')];this[_0xa130('0xb')][_0x466572[_0xa130('0x20')]][_0xa130('0x2a')]=_0x466572[_0xa130('0x2a')];this[_0xa130('0xb')][_0x466572[_0xa130('0x20')]][_0xa130('0x2b')]=_0x466572['filename'];logger['info'](_0x466572[_0xa130('0x20')],_0xa130('0x2c'));}};Fax[_0xa130('0x1c')][_0xa130('0x1a')]=function(_0x5b6592){var _0x3154fb=this;if(this[_0xa130('0xb')][_0x5b6592['uniqueid']]){var _0x1ad17a=this[_0xa130('0xb')][_0x5b6592['uniqueid']]['id'];this[_0xa130('0xb')][_0x5b6592[_0xa130('0x20')]]['remotestationid']=_0x5b6592[_0xa130('0x2d')];this[_0xa130('0xb')][_0x5b6592[_0xa130('0x20')]][_0xa130('0x2e')]=_0x5b6592[_0xa130('0x2e')];this[_0xa130('0xb')][_0x5b6592[_0xa130('0x20')]][_0xa130('0x2a')]=_0x5b6592[_0xa130('0x2a')];this['channels'][_0x5b6592[_0xa130('0x20')]][_0xa130('0x2f')]=_0x5b6592['resolution'];this['channels'][_0x5b6592['uniqueid']][_0xa130('0x30')]=_0x5b6592[_0xa130('0x30')];this[_0xa130('0xb')][_0x5b6592[_0xa130('0x20')]][_0xa130('0x2b')]=_0x5b6592['filename'];this['channels'][_0x5b6592[_0xa130('0x20')]][_0xa130('0x31')]=_0x5b6592[_0xa130('0x31')];if(this[_0xa130('0xb')][_0x5b6592['uniqueid']][_0xa130('0x2e')]>0x0){tiff2pdf(_0x5b6592['filename'],_0xa130('0x32'),function(_0x41cf3c){logger['info'](_0x5b6592[_0xa130('0x20')],_0xa130('0x33'),_0x41cf3c[_0xa130('0x34')]);attachment[_0xa130('0x35')]({'name':path['parse'](_0x5b6592[_0xa130('0x2b')])[_0xa130('0x21')],'basename':path[_0xa130('0x36')](_0x5b6592[_0xa130('0x2b')])[_0xa130('0x21')]+_0xa130('0x37'),'type':_0xa130('0x38')})[_0xa130('0x39')](function(_0x44285e){faxAccount[_0xa130('0x3a')](_0x1ad17a,{'from':_0x5b6592[_0xa130('0x31')],'mapKey':_0xa130('0x6'),'body':path['parse'](_0x5b6592[_0xa130('0x2b')])[_0xa130('0x21')]+'.pdf','AttachmentId':_0x44285e['id']})[_0xa130('0x3b')](function(_0x2f66db){logger['error'](_0x5b6592[_0xa130('0x20')],_0xa130('0x3c'),JSON['stringify'](_0x2f66db));});})[_0xa130('0x3b')](function(_0x23790e){logger[_0xa130('0x3d')](_0x5b6592[_0xa130('0x20')],_0xa130('0x3e'),JSON[_0xa130('0x3f')](_0x23790e));});});}logger[_0xa130('0x40')](_0x5b6592['uniqueid'],_0xa130('0x3e'));}};Fax[_0xa130('0x1c')][_0xa130('0x41')]=function(_0x9daf1d){if(this[_0xa130('0xe')][_0x9daf1d[_0xa130('0x20')]]){_[_0xa130('0x42')](this['channels'][_0x9daf1d['uniqueid']],_['pick'](_0x9daf1d,['response',_0xa130('0x43')]));}};function updateStatus(_0xca46c0){if(_0xca46c0['AttachmentId']){faxMessage['update'](_0xca46c0['AttachmentId'],{'failMessage':_0xa130('0x44')})[_0xa130('0x39')](function(_0x391a44){ut[_0xa130('0x45')](_0xa130('0x46'),_0x391a44);})[_0xa130('0x3b')](function(_0x1dec33){ut[_0xa130('0x45')](_0xa130('0x47'),_0x1dec33);});}else{ut[_0xa130('0x45')](_0xa130('0x48'));}}Fax[_0xa130('0x1c')][_0xa130('0x49')]=function(_0x1fc740,_0xeef5ea,_0xbfcd95){var _0x14f630=this;var _0x1a3333={};if(_0xeef5ea){_0x1a3333={'read':_0xeef5ea};}else{_0x1a3333={'failMessage':_0xbfcd95};}if(this[_0xa130('0xe')][_0x1fc740]['AttachmentId']){faxMessage['update'](this[_0xa130('0xe')][_0x1fc740][_0xa130('0x4a')],_0x1a3333)['then'](function(_0x2724a5){ut[_0xa130('0x45')](_0xa130('0x4b'),_0x2724a5);})['catch'](function(_0x1f61b8){ut[_0xa130('0x45')](_0xa130('0x4c'),_0x1f61b8);})[_0xa130('0x4d')](function(){delete _0x14f630[_0xa130('0xb')][_0x1fc740];delete _0x14f630[_0xa130('0xe')][_0x1fc740];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xa130('0xb')][_0x1fc740];delete this['actions'][_0x1fc740];}};Fax[_0xa130('0x1c')]['syncHangup']=function(_0x382fbc){var _0x133357=this;if(this['channels'][_0x382fbc[_0xa130('0x20')]]){if(this[_0xa130('0xe')][_0x382fbc[_0xa130('0x20')]]){this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]]['id']=this[_0xa130('0xe')][_0x382fbc[_0xa130('0x20')]]['id'];this[_0xa130('0xb')][_0x382fbc['uniqueid']][_0xa130('0x21')]=this[_0xa130('0xe')][_0x382fbc[_0xa130('0x20')]]['name'];}logger[_0xa130('0x40')](_0x382fbc[_0xa130('0x20')],this[_0xa130('0xe')][_0x382fbc['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xa130('0x4e'),JSON[_0xa130('0x3f')](this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]]));if(this['actions'][_0x382fbc[_0xa130('0x20')]]){if(this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]][_0xa130('0x4f')]>0x0&&this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]][_0xa130('0x17')]===_0xa130('0x50')){this['updateStatus'](_0x382fbc[_0xa130('0x20')],!![]);}else{this[_0xa130('0x49')](_0x382fbc[_0xa130('0x20')],![],this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]][_0xa130('0x51')]?_0xa130('0x52')+this[_0xa130('0xb')][_0x382fbc[_0xa130('0x20')]][_0xa130('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0xa130('0x1c')]['send']=function(_0x2efbd7){var _0x5db24f=this;return new BPromise(function(_0x5df14c,_0x161311){_0x5db24f['execOriginate'](_0x2efbd7,_0x5db24f['faxAccounts'][_0x2efbd7[_0xa130('0x53')]])[_0xa130('0x39')](function(_0x132b9d){ut[_0xa130('0x45')](_0xa130('0x54'),_0x132b9d);_0x5df14c(ut[_0xa130('0x34')](_0xa130('0x55')));})[_0xa130('0x3b')](function(_0x3fbf65){ut[_0xa130('0x45')](_0xa130('0x56'),_0x3fbf65);updateStatus(_0x2efbd7);_0x161311(ut[_0xa130('0x34')](_0xa130('0x57')));});});};Fax[_0xa130('0x1c')][_0xa130('0x58')]=function(_0x339164){var _0x23d088=this;return new BPromise(function(_0x41373e,_0x44a73b){var _0x505116=_0x23d088[_0xa130('0x59')](_0x23d088[_0xa130('0xc')][_0x339164[_0xa130('0x53')]][_0xa130('0x5a')],_0x339164);if(_0x505116[_0xa130('0x5b')]){_0x41373e(ut[_0xa130('0x34')](_0xa130('0x5c')));}else{_0x44a73b(ut[_0xa130('0x34')](_0x505116[_0xa130('0x34')]));}});};function originate(_0x222ecc,_0x4181b5,_0x7fd694){return new BPromise(function(_0x5bfae4,_0x52aeef){if(_0x7fd694){var _0x599c7b=util[_0xa130('0x5d')](_0xa130('0x5e'),path['parse'](_0x222ecc[_0xa130('0x3')])[_0xa130('0x21')],_0x222ecc[_0xa130('0x3')]);gs[_0xa130('0x5f')](_0x599c7b)[_0xa130('0x39')](function(){_0x222ecc[_0xa130('0x3')]=util[_0xa130('0x5d')](_0xa130('0x60'),path[_0xa130('0x36')](_0x222ecc[_0xa130('0x3')])['dir'],path[_0xa130('0x36')](_0x222ecc['path'])['name']);_0x4181b5[_0xa130('0x61')]=_0x222ecc[_0xa130('0x3')];ut['logger'](_0xa130('0x62'),'');ami['Action'](ut[_0xa130('0x63')](_0x222ecc,_0x4181b5))[_0xa130('0x39')](function(_0x47f8bc){_0x5bfae4(_0x47f8bc);})[_0xa130('0x3b')](function(_0x9d1c64){_0x52aeef(_0x9d1c64);});})[_0xa130('0x3b')](function(_0x80da52){_0x52aeef(_0x80da52);});}else{ami[_0xa130('0x64')](ut[_0xa130('0x63')](_0x222ecc,_0x4181b5))[_0xa130('0x39')](function(_0x13831b){_0x5bfae4(_0x13831b);})['catch'](function(_0x4196cb){_0x52aeef(_0x4196cb);});}});}Fax[_0xa130('0x1c')][_0xa130('0x65')]=function(_0x34e0b2,_0x1baedc){var _0x48e4ea=this;return new BPromise(function(_0x343e7d,_0x266deb){var _0x45ae17=uuid['v4']();var _0x3588f5=ut[_0xa130('0x66')](_0x34e0b2,_0x1baedc);_0x48e4ea[_0xa130('0xe')][_0x45ae17]=new Action(_0x45ae17,_0x1baedc,_0x34e0b2);var _0x188c90=_0x48e4ea[_0xa130('0xe')][_0x45ae17];if(path[_0xa130('0x36')](_0x34e0b2[_0xa130('0x3')])['ext']===_0xa130('0x37')){originate(_0x188c90,_0x3588f5,!![])[_0xa130('0x39')](function(_0x219d98){_0x343e7d(_0x219d98);})['catch'](function(_0x498979){_0x266deb(_0x498979);});}else{originate(_0x188c90,_0x3588f5,![])[_0xa130('0x39')](function(_0x192fc6){_0x343e7d(_0x192fc6);})[_0xa130('0x3b')](function(_0x431927){_0x266deb(_0x431927);});}});};Fax[_0xa130('0x1c')][_0xa130('0x67')]=function(_0x25601d){return!_['isNil'](_0x25601d)&&!_[_0xa130('0x68')](_0x25601d[_0xa130('0x21')])&&!_[_0xa130('0x68')](_0x25601d[_0xa130('0x69')])&&_0x25601d['active']&&!_[_0xa130('0x68')](this['trunks'][util['format'](_0xa130('0x6a'),_0x25601d['name'])])&&!_[_0xa130('0x68')](this['trunks'][util[_0xa130('0x5d')](_0xa130('0x6a'),_0x25601d[_0xa130('0x21')])]['status'])&&(this[_0xa130('0xd')][util['format']('SIP/%s',_0x25601d[_0xa130('0x21')])][_0xa130('0x29')]===_0xa130('0x6b')||this[_0xa130('0xd')][util[_0xa130('0x5d')]('SIP/%s',_0x25601d[_0xa130('0x21')])][_0xa130('0x29')]===_0xa130('0x6c'));};Fax[_0xa130('0x1c')]['checkTrunk']=function(_0x261c87,_0x531291){if(!this['isTrunkReachable'](_0x261c87)){ut[_0xa130('0x45')](_0xa130('0x6d'),_[_0xa130('0x68')](_0x261c87)?'':_0x261c87[_0xa130('0x21')]+_0xa130('0x6e'));return{'isValid':![],'message':_0xa130('0x6f')};}if(_[_0xa130('0x68')](_0x531291[_0xa130('0x6')])){ut[_0xa130('0x45')](_0xa130('0x70'),JSON['stringify'](_0x531291));return{'isValid':![],'message':_0xa130('0x71')};}if(_[_0xa130('0x68')](_0x531291[_0xa130('0x3')])){ut['logger'](_0xa130('0x72'),JSON[_0xa130('0x3f')](_0x531291));return{'isValid':![],'message':_0xa130('0x73')};}return{'isValid':!![],'message':_0xa130('0x74')};};module[_0xa130('0x75')]=Fax; \ No newline at end of file +var _0x1563=['then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','format','status','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','.pdf','notify','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','update','AttachmentId'];(function(_0x52f22c,_0x3a72f5){var _0x12e45d=function(_0x1cf56f){while(--_0x1cf56f){_0x52f22c['push'](_0x52f22c['shift']());}};_0x12e45d(++_0x3a72f5);}(_0x1563,0x129));var _0x3156=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0x1563[_0x173dd9];return _0x5a0d5a;};'use strict';var util=require(_0x3156('0x0'));var _=require('lodash');var BPromise=require(_0x3156('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x3156('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3156('0x3'));var logger=require(_0x3156('0x4'))(_0x3156('0x5'));var ami=require(_0x3156('0x6'));var rpcDb=require(_0x3156('0x7'));var Channel=require(_0x3156('0x8'));var ut=require('./util/util');var Action=require(_0x3156('0x9'));var faxAccount=require(_0x3156('0xa'));var attachment=require(_0x3156('0xb'));var faxMessage=require(_0x3156('0xc'));function Fax(_0x517d0a){this['channels']={};this[_0x3156('0xd')]=_0x517d0a['faxAccounts'];this[_0x3156('0xe')]=_0x517d0a[_0x3156('0xe')];this[_0x3156('0xf')]={};ami['on'](_0x3156('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0x3156('0x11'),this[_0x3156('0x12')][_0x3156('0x13')](this));ami['on']('newstate',this['syncNewState'][_0x3156('0x13')](this));ami['on'](_0x3156('0x14'),this[_0x3156('0x15')][_0x3156('0x13')](this));ami['on'](_0x3156('0x16'),this[_0x3156('0x17')][_0x3156('0x13')](this));ami['on'](_0x3156('0x18'),this[_0x3156('0x19')][_0x3156('0x13')](this));ami['on'](_0x3156('0x1a'),this[_0x3156('0x1b')][_0x3156('0x13')](this));ami['on']('originateresponse',this[_0x3156('0x1c')][_0x3156('0x13')](this));}Fax[_0x3156('0x1d')][_0x3156('0x1e')]=function(_0x4b4f36){if(_0x4b4f36[_0x3156('0x1f')]===_0x3156('0x20')){for(var _0x3af1ac in this[_0x3156('0xd')]){if(this[_0x3156('0xd')][_0x3156('0x21')](_0x3af1ac)){if(_0x4b4f36[_0x3156('0x22')]===this['faxAccounts'][_0x3af1ac][_0x3156('0x23')]){this['channels'][_0x4b4f36['uniqueid']]={};this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]][_0x3156('0x26')]=_0x4b4f36[_0x3156('0x26')];this[_0x3156('0x24')][_0x4b4f36['uniqueid']]['id']=this[_0x3156('0xd')][_0x3af1ac]['id'];this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]][_0x3156('0x27')]=this[_0x3156('0xd')][_0x3af1ac][_0x3156('0x27')];logger[_0x3156('0x28')](_0x4b4f36[_0x3156('0x25')],_0x3156('0x29'));}}}}if(this['actions'][_0x4b4f36[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]]={};this[_0x3156('0x24')][_0x4b4f36['uniqueid']][_0x3156('0x26')]=_0x4b4f36[_0x3156('0x26')];logger[_0x3156('0x28')](_0x4b4f36[_0x3156('0x25')],'\x20syncNewchannel\x20');}};Fax[_0x3156('0x1d')]['syncVarSet']=function(_0x35ddaa){if(this[_0x3156('0x24')][_0x35ddaa[_0x3156('0x25')]]){for(var _0xc6e2a4 in _0x35ddaa['variable']){if(_0x35ddaa[_0x3156('0x2a')][_0x3156('0x21')](_0xc6e2a4)){this[_0x3156('0x24')][_0x35ddaa[_0x3156('0x25')]][_0xc6e2a4]=_0x35ddaa[_0x3156('0x2b')];}}}};Fax[_0x3156('0x1d')][_0x3156('0x2c')]=function(_0x5e5eb6){if(this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]][_0x3156('0x2d')]=_0x5e5eb6['channelstate'];this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]][_0x3156('0x2e')]=_0x5e5eb6[_0x3156('0x2e')];}};Fax[_0x3156('0x1d')][_0x3156('0x15')]=function(_0x3c524){if(this[_0x3156('0x24')][_0x3c524[_0x3156('0x25')]]){for(var _0x5e516c in _0x3c524[_0x3156('0x2a')]){if(_0x3c524[_0x3156('0x2a')]['hasOwnProperty'](_0x5e516c)){this[_0x3156('0x24')][_0x3c524[_0x3156('0x25')]][_0x5e516c]=_0x3c524[_0x3156('0x2b')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x5add54){if(this[_0x3156('0x24')][_0x5add54[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x5add54[_0x3156('0x25')]][_0x3156('0x2f')]=_0x5add54[_0x3156('0x2f')];this[_0x3156('0x24')][_0x5add54['uniqueid']]['status']=_0x5add54['status'];this['channels'][_0x5add54[_0x3156('0x25')]][_0x3156('0x23')]=_0x5add54[_0x3156('0x23')];this['channels'][_0x5add54[_0x3156('0x25')]][_0x3156('0x30')]=_0x5add54[_0x3156('0x30')];logger[_0x3156('0x28')](_0x5add54['uniqueid'],_0x3156('0x31'));}};Fax[_0x3156('0x1d')]['syncReceiveFax']=function(_0x2ea099){var _0x4082fb=this;if(this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]){var _0x5d7968=this[_0x3156('0x24')][_0x2ea099['uniqueid']]['id'];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x32')]=_0x2ea099[_0x3156('0x32')];this['channels'][_0x2ea099['uniqueid']][_0x3156('0x33')]=_0x2ea099[_0x3156('0x33')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]['localstationid']=_0x2ea099[_0x3156('0x23')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x34')]=_0x2ea099[_0x3156('0x34')];this[_0x3156('0x24')][_0x2ea099['uniqueid']]['transferrate']=_0x2ea099[_0x3156('0x35')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]['filename']=_0x2ea099[_0x3156('0x30')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x36')]=_0x2ea099[_0x3156('0x36')];if(this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x33')]>0x0){tiff2pdf(_0x2ea099[_0x3156('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x4d5615){logger['info'](_0x2ea099[_0x3156('0x25')],'\x20result\x20conversion\x20file\x20',_0x4d5615[_0x3156('0x37')]);attachment[_0x3156('0x38')]({'name':path['parse'](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')],'basename':path['parse'](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')]+_0x3156('0x39'),'type':'application/pdf'})['then'](function(_0x5522e2){faxAccount[_0x3156('0x3a')](_0x5d7968,{'from':_0x2ea099[_0x3156('0x36')],'mapKey':_0x3156('0x5'),'body':path[_0x3156('0x3b')](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')]+_0x3156('0x39'),'AttachmentId':_0x5522e2['id']})[_0x3156('0x3c')](function(_0x6786ec){logger[_0x3156('0x3d')](_0x2ea099[_0x3156('0x25')],_0x3156('0x3e'),JSON[_0x3156('0x3f')](_0x6786ec));});})[_0x3156('0x3c')](function(_0x3b93a3){logger['error'](_0x2ea099[_0x3156('0x25')],_0x3156('0x40'),JSON[_0x3156('0x3f')](_0x3b93a3));});});}logger['info'](_0x2ea099[_0x3156('0x25')],_0x3156('0x40'));}};Fax[_0x3156('0x1d')][_0x3156('0x1c')]=function(_0x491ccb){if(this[_0x3156('0xf')][_0x491ccb['uniqueid']]){_['merge'](this[_0x3156('0x24')][_0x491ccb[_0x3156('0x25')]],_['pick'](_0x491ccb,[_0x3156('0x41'),_0x3156('0x42')]));}};function updateStatus(_0x13d7bf){if(_0x13d7bf['AttachmentId']){faxMessage[_0x3156('0x43')](_0x13d7bf[_0x3156('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x3156('0x45')](function(_0x19e5eb){ut[_0x3156('0x46')]('[Fax][Message][Error][Updated]',_0x19e5eb);})[_0x3156('0x3c')](function(_0x2aa956){ut['logger'](_0x3156('0x47'),_0x2aa956);});}else{ut[_0x3156('0x46')](_0x3156('0x48'));}}Fax[_0x3156('0x1d')][_0x3156('0x49')]=function(_0x2fb630,_0x3b6fe7,_0x363fb2){var _0xc31f3a=this;var _0xda4878={};if(_0x3b6fe7){_0xda4878={'read':_0x3b6fe7};}else{_0xda4878={'failMessage':_0x363fb2};}if(this[_0x3156('0xf')][_0x2fb630][_0x3156('0x44')]){faxMessage[_0x3156('0x43')](this[_0x3156('0xf')][_0x2fb630][_0x3156('0x44')],_0xda4878)[_0x3156('0x45')](function(_0xddd658){ut[_0x3156('0x46')](_0x3156('0x4a'),_0xddd658);})[_0x3156('0x3c')](function(_0x4e08d7){ut['logger'](_0x3156('0x4b'),_0x4e08d7);})[_0x3156('0x4c')](function(){delete _0xc31f3a['channels'][_0x2fb630];delete _0xc31f3a[_0x3156('0xf')][_0x2fb630];});}else{ut[_0x3156('0x46')](_0x3156('0x4d'));delete this['channels'][_0x2fb630];delete this['actions'][_0x2fb630];}};Fax[_0x3156('0x1d')][_0x3156('0x1b')]=function(_0x9f58b8){var _0x5d2a1e=this;if(this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]){if(this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['id']=this[_0x3156('0xf')][_0x9f58b8['uniqueid']]['id'];this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['name']=this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x27')];}logger[_0x3156('0x28')](_0x9f58b8['uniqueid'],this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]]?_0x3156('0x4e'):_0x3156('0x4f'),JSON[_0x3156('0x3f')](this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]));if(this['actions'][_0x9f58b8[_0x3156('0x25')]]){if(this['channels'][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x50')]>0x0&&this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x16')]===_0x3156('0x51')){this[_0x3156('0x49')](_0x9f58b8[_0x3156('0x25')],!![]);}else{this[_0x3156('0x49')](_0x9f58b8[_0x3156('0x25')],![],this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['faxstatusstring']?_0x3156('0x52')+this['channels'][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x53')]:_0x3156('0x54'));}}}};Fax[_0x3156('0x1d')]['send']=function(_0xc0a51b){var _0x1e0b4a=this;return new BPromise(function(_0x2a3602,_0x18c789){_0x1e0b4a[_0x3156('0x55')](_0xc0a51b,_0x1e0b4a[_0x3156('0xd')][_0xc0a51b[_0x3156('0x56')]])[_0x3156('0x45')](function(_0x5774d3){ut[_0x3156('0x46')](_0x3156('0x57'),_0x5774d3);_0x2a3602(ut[_0x3156('0x37')]('Fax\x20received'));})[_0x3156('0x3c')](function(_0x4566a1){ut[_0x3156('0x46')](_0x3156('0x58'),_0x4566a1);updateStatus(_0xc0a51b);_0x18c789(ut[_0x3156('0x37')](_0x3156('0x59')));});});};Fax[_0x3156('0x1d')][_0x3156('0x5a')]=function(_0x8a04e){var _0x49d6dd=this;return new BPromise(function(_0x363c57,_0x3e4594){var _0x2b65ba=_0x49d6dd['checkTrunk'](_0x49d6dd[_0x3156('0xd')][_0x8a04e[_0x3156('0x56')]][_0x3156('0x5b')],_0x8a04e);if(_0x2b65ba[_0x3156('0x5c')]){_0x363c57(ut[_0x3156('0x37')](_0x3156('0x5d')));}else{_0x3e4594(ut[_0x3156('0x37')](_0x2b65ba[_0x3156('0x37')]));}});};function originate(_0x45ef56,_0x2b0d2c,_0x123e3c){return new BPromise(function(_0x1b0ad7,_0x1d20a5){if(_0x123e3c){var _0x43428c=util['format'](_0x3156('0x5e'),path['parse'](_0x45ef56['path'])[_0x3156('0x27')],_0x45ef56[_0x3156('0x2')]);gs[_0x3156('0x5f')](_0x43428c)['then'](function(){_0x45ef56[_0x3156('0x2')]=util['format'](_0x3156('0x60'),path[_0x3156('0x3b')](_0x45ef56[_0x3156('0x2')])[_0x3156('0x61')],path['parse'](_0x45ef56[_0x3156('0x2')])['name']);_0x2b0d2c[_0x3156('0x62')]=_0x45ef56[_0x3156('0x2')];ut['logger'](_0x3156('0x63'),'');ami[_0x3156('0x64')](ut[_0x3156('0x65')](_0x45ef56,_0x2b0d2c))[_0x3156('0x45')](function(_0x16d487){_0x1b0ad7(_0x16d487);})['catch'](function(_0x831b5a){_0x1d20a5(_0x831b5a);});})[_0x3156('0x3c')](function(_0x5bf83d){_0x1d20a5(_0x5bf83d);});}else{ami[_0x3156('0x64')](ut[_0x3156('0x65')](_0x45ef56,_0x2b0d2c))[_0x3156('0x45')](function(_0x11bc26){_0x1b0ad7(_0x11bc26);})[_0x3156('0x3c')](function(_0x360def){_0x1d20a5(_0x360def);});}});}Fax[_0x3156('0x1d')]['execOriginate']=function(_0x17c957,_0x3625da){var _0x218546=this;return new BPromise(function(_0xa17b38,_0x55ba55){var _0x11bdf4=uuid['v4']();var _0xd92b35=ut[_0x3156('0x66')](_0x17c957,_0x3625da);_0x218546[_0x3156('0xf')][_0x11bdf4]=new Action(_0x11bdf4,_0x3625da,_0x17c957);var _0xe30657=_0x218546[_0x3156('0xf')][_0x11bdf4];if(path['parse'](_0x17c957[_0x3156('0x2')])[_0x3156('0x67')]===_0x3156('0x39')){originate(_0xe30657,_0xd92b35,!![])['then'](function(_0x1151e5){_0xa17b38(_0x1151e5);})['catch'](function(_0x3a0049){_0x55ba55(_0x3a0049);});}else{originate(_0xe30657,_0xd92b35,![])[_0x3156('0x45')](function(_0x5edcfa){_0xa17b38(_0x5edcfa);})[_0x3156('0x3c')](function(_0x223f1c){_0x55ba55(_0x223f1c);});}});};Fax[_0x3156('0x1d')][_0x3156('0x68')]=function(_0x303dce){return!_['isNil'](_0x303dce)&&!_[_0x3156('0x69')](_0x303dce['name'])&&!_['isNil'](_0x303dce['active'])&&_0x303dce[_0x3156('0x6a')]&&!_['isNil'](this[_0x3156('0xe')][util['format'](_0x3156('0x6b'),_0x303dce[_0x3156('0x27')])])&&!_['isNil'](this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce['name'])][_0x3156('0x6d')])&&(this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce['name'])][_0x3156('0x6d')]===_0x3156('0x6e')||this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce[_0x3156('0x27')])]['status']===_0x3156('0x6f'));};Fax[_0x3156('0x1d')][_0x3156('0x70')]=function(_0x20d40d,_0x3d7d78){if(!this[_0x3156('0x68')](_0x20d40d)){ut['logger'](_0x3156('0x71'),_[_0x3156('0x69')](_0x20d40d)?'':_0x20d40d[_0x3156('0x27')]+_0x3156('0x72'));return{'isValid':![],'message':_0x3156('0x73')};}if(_['isNil'](_0x3d7d78['fax'])){ut[_0x3156('0x46')](_0x3156('0x74'),JSON['stringify'](_0x3d7d78));return{'isValid':![],'message':_0x3156('0x75')};}if(_['isNil'](_0x3d7d78['path'])){ut[_0x3156('0x46')](_0x3156('0x76'),JSON[_0x3156('0x3f')](_0x3d7d78));return{'isValid':![],'message':_0x3156('0x77')};}return{'isValid':!![],'message':_0x3156('0x78')};};module[_0x3156('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 7850e01..e520073 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 _0x2da5=['notify','catch','[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x2b4659,_0x4655d7){var _0x35badd=function(_0x29d3a5){while(--_0x29d3a5){_0x2b4659['push'](_0x2b4659['shift']());}};_0x35badd(++_0x4655d7);}(_0x2da5,0xae));var _0x52da=function(_0xb66ae7,_0x19c5b8){_0xb66ae7=_0xb66ae7-0x0;var _0x1911a5=_0x2da5[_0xb66ae7];return _0x1911a5;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x52da('0x0'))(_0x52da('0x1'));var _=require(_0x52da('0x2'));var faxAccount=require(_0x52da('0x3'));function loggerCatch(_0x53fdae){return function(_0x5d32b2){logger[_0x52da('0x4')](_0x53fdae,util[_0x52da('0x5')](_0x5d32b2,{'showHidden':![],'depth':null}));};}exports[_0x52da('0x6')]=function(_0x20e6dd,_0x4da017){return BPromise['resolve']()['then'](faxAccount[_0x52da('0x6')](_0x20e6dd,_0x4da017))[_0x52da('0x7')](loggerCatch(_0x52da('0x8')));}; \ No newline at end of file +var _0xadf0=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xadf0,0xc6));var _0x0adf=function(_0x1aef30,_0x3a46ef){_0x1aef30=_0x1aef30-0x0;var _0x5be9a9=_0xadf0[_0x1aef30];return _0x5be9a9;};'use strict';var util=require(_0x0adf('0x0'));var BPromise=require(_0x0adf('0x1'));var logger=require(_0x0adf('0x2'))(_0x0adf('0x3'));var _=require(_0x0adf('0x4'));var faxAccount=require(_0x0adf('0x5'));function loggerCatch(_0x4fea85){return function(_0x793365){logger[_0x0adf('0x6')](_0x4fea85,util[_0x0adf('0x7')](_0x793365,{'showHidden':![],'depth':null}));};}exports[_0x0adf('0x8')]=function(_0xf4663c,_0x1ed20a){return BPromise['resolve']()[_0x0adf('0x9')](faxAccount['notify'](_0xf4663c,_0x1ed20a))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index a0c5eca..fca066d 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 _0xf670=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect'];(function(_0x58c3ff,_0x124777){var _0x4e5a30=function(_0x4052ef){while(--_0x4052ef){_0x58c3ff['push'](_0x58c3ff['shift']());}};_0x4e5a30(++_0x124777);}(_0xf670,0x1e0));var _0x0f67=function(_0x1a268f,_0x2f4759){_0x1a268f=_0x1a268f-0x0;var _0x63fe77=_0xf670[_0x1a268f];return _0x63fe77;};'use strict';var util=require(_0x0f67('0x0'));var logger=require(_0x0f67('0x1'))(_0x0f67('0x2'));var BPromise=require(_0x0f67('0x3'));var exec=require(_0x0f67('0x4'))[_0x0f67('0x5')];exports[_0x0f67('0x6')]=function(_0x3af134){return new BPromise(function(_0x2f8f42,_0x474afe){exec(_0x3af134,function(_0x9c30ed,_0x3459e2,_0x27f817){logger[_0x0f67('0x7')]('Exec\x20gs',_0x3459e2);if(_0x9c30ed){logger['info'](_0x0f67('0x8'),'\x20Error\x20:',util[_0x0f67('0x9')](_0x9c30ed,{'showHidden':![],'depth':null}),_0x3459e2,_0x27f817);_0x474afe(_0x9c30ed);}_0x2f8f42(_0x3459e2);});});}; \ No newline at end of file +var _0xad20=['exec','execute','info','Exec\x20gs','util','../../../../config/logger','bluebird','child_process'];(function(_0x4e1fe7,_0x30004d){var _0x3d0874=function(_0x269d67){while(--_0x269d67){_0x4e1fe7['push'](_0x4e1fe7['shift']());}};_0x3d0874(++_0x30004d);}(_0xad20,0x94));var _0x0ad2=function(_0x399b6e,_0x3ef3fd){_0x399b6e=_0x399b6e-0x0;var _0x145cf3=_0xad20[_0x399b6e];return _0x145cf3;};'use strict';var util=require(_0x0ad2('0x0'));var logger=require(_0x0ad2('0x1'))('fax');var BPromise=require(_0x0ad2('0x2'));var exec=require(_0x0ad2('0x3'))[_0x0ad2('0x4')];exports[_0x0ad2('0x5')]=function(_0x1d66e0){return new BPromise(function(_0xc26489,_0x3db641){exec(_0x1d66e0,function(_0x16a764,_0x27abca,_0xca6add){logger[_0x0ad2('0x6')](_0x0ad2('0x7'),_0x27abca);if(_0x16a764){logger['info'](_0x0ad2('0x7'),'\x20Error\x20:',util['inspect'](_0x16a764,{'showHidden':![],'depth':null}),_0x27abca,_0xca6add);_0x3db641(_0x16a764);}_0xc26489(_0x27abca);});});}; \ 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 d5b595d..e17cfb9 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 _0xd865=['logger','inspect','addVariables','ecm','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','from-sip','headerinfo','uniqueid','util','lodash','fax'];(function(_0x1c8877,_0x524691){var _0x180eda=function(_0x1881e5){while(--_0x1881e5){_0x1c8877['push'](_0x1c8877['shift']());}};_0x180eda(++_0x524691);}(_0xd865,0xc3));var _0x5d86=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd865[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x5d86('0x0'));var _=require(_0x5d86('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x5d86('0x2'));exports['message']=function(_0x537342){return{'message':_0x537342};};exports[_0x5d86('0x3')]=function(_0x41db00,_0x4be137){logger['info'](_0x41db00,util[_0x5d86('0x4')](_0x4be137,{'showHidden':![],'depth':null}));};exports[_0x5d86('0x5')]=function(_0x132425,_0x302f8d){var _0x5ea17c={'XMF-ECM':_0x302f8d[_0x5d86('0x6')],'XMF-HEADERINFO':_0x302f8d['headerinfo'],'XMF-MINRATE':_0x302f8d[_0x5d86('0x7')],'XMF-MAXRATE':_0x302f8d[_0x5d86('0x8')],'XMF-MODEM':util[_0x5d86('0x9')]('\x22%s\x22',_0x302f8d[_0x5d86('0xa')]),'XMF-GATEWAY':_0x302f8d[_0x5d86('0xb')],'XMF-FAXDETECT':_0x302f8d[_0x5d86('0xc')],'XMF-T38TIMEOUT':_0x302f8d[_0x5d86('0xd')],'XMF-LOCALSTATIONID':_0x302f8d[_0x5d86('0xe')],'XMF-PATH':_0x132425[_0x5d86('0xf')]};return _0x5ea17c;};exports['variablesAction']=function(_0x3dd14c,_0x5293f1){return{'actionid':_0x3dd14c['uniqueid'],'action':_0x5d86('0x10'),'channel':_0x3dd14c[_0x5d86('0x11')],'Exten':_0x5d86('0x12'),'Context':_0x5d86('0x13'),'Priority':'1','callerid':util[_0x5d86('0x9')]('\x22%s\x22\x20<%s>',_0x3dd14c['headerinfo']?_0x3dd14c[_0x5d86('0x14')]:'',_0x3dd14c[_0x5d86('0xe')]),'variable':_0x5293f1,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3dd14c[_0x5d86('0x15')]};}; \ No newline at end of file +var _0x7f28=['format','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','maxrate','\x22%s\x22','gateway','t38timeout','path','variablesAction','uniqueid','channel','xcally-motion-fax'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7f28,0x1e7));var _0x87f2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7f28[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x87f2('0x0'));var _=require(_0x87f2('0x1'));var moment=require(_0x87f2('0x2'));var logger=require(_0x87f2('0x3'))(_0x87f2('0x4'));exports[_0x87f2('0x5')]=function(_0x3f9cf0){return{'message':_0x3f9cf0};};exports[_0x87f2('0x6')]=function(_0x54931a,_0x30a236){logger[_0x87f2('0x7')](_0x54931a,util['inspect'](_0x30a236,{'showHidden':![],'depth':null}));};exports[_0x87f2('0x8')]=function(_0x326820,_0x37de8c){var _0x5254be={'XMF-ECM':_0x37de8c['ecm'],'XMF-HEADERINFO':_0x37de8c[_0x87f2('0x9')],'XMF-MINRATE':_0x37de8c['minrate'],'XMF-MAXRATE':_0x37de8c[_0x87f2('0xa')],'XMF-MODEM':util['format'](_0x87f2('0xb'),_0x37de8c['modem']),'XMF-GATEWAY':_0x37de8c[_0x87f2('0xc')],'XMF-FAXDETECT':_0x37de8c['faxdetect'],'XMF-T38TIMEOUT':_0x37de8c[_0x87f2('0xd')],'XMF-LOCALSTATIONID':_0x37de8c['localstationid'],'XMF-PATH':_0x326820[_0x87f2('0xe')]};return _0x5254be;};exports[_0x87f2('0xf')]=function(_0x318949,_0x525712){return{'actionid':_0x318949[_0x87f2('0x10')],'action':'originate','channel':_0x318949[_0x87f2('0x11')],'Exten':_0x87f2('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x87f2('0x13')](_0x87f2('0x14'),_0x318949['headerinfo']?_0x318949[_0x87f2('0x9')]:'',_0x318949[_0x87f2('0x15')]),'variable':_0x525712,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x318949[_0x87f2('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e35b7b2..f31eaf7 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 _0x703b=['./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./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/freshsales'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x703b,0x67));var _0xb703=function(_0x4ac2ee,_0x524cf6){_0x4ac2ee=_0x4ac2ee-0x0;var _0x5d248a=_0x703b[_0x4ac2ee];return _0x5d248a;};'use strict';var BPromise=require(_0xb703('0x0'));var util=require('util');var moment=require(_0xb703('0x1'));var server=require(_0xb703('0x2'));var Realtime=require(_0xb703('0x3'));var Report=require(_0xb703('0x4'));var Acw=require(_0xb703('0x5'));var Trigger=require(_0xb703('0x6'));var Dialer=require(_0xb703('0x7'));var Preview=require(_0xb703('0x8'));var Fax=require(_0xb703('0x9'));var user=require('./rpc/user');var voiceQueue=require(_0xb703('0xa'));var voiceQueueReport=require(_0xb703('0xb'));var voiceCallReport=require(_0xb703('0xc'));var trunk=require(_0xb703('0xd'));var trigger=require('./rpc/trigger');var template=require(_0xb703('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xb703('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xb703('0x10'));var zendesk=require(_0xb703('0x11'));var salesforce=require(_0xb703('0x12'));var sugarcrm=require(_0xb703('0x13'));var freshdesk=require(_0xb703('0x14'));var desk=require(_0xb703('0x15'));var zoho=require(_0xb703('0x16'));var vtiger=require(_0xb703('0x17'));var freshsales=require(_0xb703('0x18'));var servicenow=require(_0xb703('0x19'));var dynamics365=require(_0xb703('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xb703('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xb703('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xb703('0x1c')]()['then'](user[_0xb703('0x1d')]())['then'](realtime[_0xb703('0x1e')]())[_0xb703('0x1f')](user[_0xb703('0x20')]())['then'](realtime[_0xb703('0x21')]())[_0xb703('0x1f')](trunk[_0xb703('0x22')]())[_0xb703('0x1f')](realtime[_0xb703('0x23')]())[_0xb703('0x1f')](voiceQueue['getVoiceQueues']())[_0xb703('0x1f')](realtime[_0xb703('0x24')]())[_0xb703('0x1f')](trigger[_0xb703('0x25')]())[_0xb703('0x1f')](realtime['initTriggers']())[_0xb703('0x1f')](template['getTemplates']())['then'](realtime['initTemplates']())[_0xb703('0x1f')](zendesk['getZendeskAccounts']())['then'](realtime[_0xb703('0x26')]())['then'](salesforce[_0xb703('0x27')]())[_0xb703('0x1f')](realtime[_0xb703('0x28')]())[_0xb703('0x1f')](sugarcrm[_0xb703('0x29')]())[_0xb703('0x1f')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xb703('0x2a')]())[_0xb703('0x1f')](realtime[_0xb703('0x2b')]())[_0xb703('0x1f')](desk['getDeskAccounts']())['then'](realtime[_0xb703('0x2c')]())[_0xb703('0x1f')](zoho[_0xb703('0x2d')]())['then'](realtime[_0xb703('0x2e')]())[_0xb703('0x1f')](vtiger['getVtigerAccounts']())[_0xb703('0x1f')](realtime[_0xb703('0x2f')]())[_0xb703('0x1f')](freshsales['getFreshsalesAccounts']())[_0xb703('0x1f')](realtime[_0xb703('0x30')]())[_0xb703('0x1f')](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())[_0xb703('0x1f')](dynamics365[_0xb703('0x31')]())[_0xb703('0x1f')](realtime[_0xb703('0x32')]())[_0xb703('0x1f')](campaign[_0xb703('0x33')]())[_0xb703('0x1f')](realtime[_0xb703('0x34')]())['then'](voiceExtension[_0xb703('0x35')]())[_0xb703('0x1f')](realtime[_0xb703('0x36')]())[_0xb703('0x1f')](faxAccount['getFaxAccounts']())['then'](realtime[_0xb703('0x37')]())[_0xb703('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0xb703('0x1c')]()[_0xb703('0x1f')](voiceQueueReport['getVoiceQueueReports']())[_0xb703('0x1f')](realtime[_0xb703('0x38')]())[_0xb703('0x1f')](cmHopperHistory[_0xb703('0x39')]())[_0xb703('0x1f')](realtime[_0xb703('0x3a')]())[_0xb703('0x1f')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xb703('0x3b')]())[_0xb703('0x1f')](voiceCallReport[_0xb703('0x3c')]())['then'](realtime[_0xb703('0x3d')]())['then'](function(_0x3ecdec){})[_0xb703('0x3e')](function(_0x5c6551){console[_0xb703('0x3f')](_0x5c6551);});}function main(){return server['listen'](realtime,preview,fax)[_0xb703('0x1f')](function(_0x5b70f0){return initRealtime();})['then'](function(){return initParams();})[_0xb703('0x1f')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xb703('0x3e')](function(_0xd54331){console[_0xb703('0x3f')](_0xd54331);});}main(); \ No newline at end of file +var _0x52c3=['getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','bluebird','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then'];(function(_0x4bc5d2,_0x32286c){var _0x322e78=function(_0x59975a){while(--_0x59975a){_0x4bc5d2['push'](_0x4bc5d2['shift']());}};_0x322e78(++_0x32286c);}(_0x52c3,0x11d));var _0x352c=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x52c3[_0x2543d6];return _0x55213c;};'use strict';var BPromise=require(_0x352c('0x0'));var util=require('util');var moment=require(_0x352c('0x1'));var server=require(_0x352c('0x2'));var Realtime=require(_0x352c('0x3'));var Report=require(_0x352c('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x352c('0x5'));var Preview=require(_0x352c('0x6'));var Fax=require(_0x352c('0x7'));var user=require(_0x352c('0x8'));var voiceQueue=require(_0x352c('0x9'));var voiceQueueReport=require(_0x352c('0xa'));var voiceCallReport=require(_0x352c('0xb'));var trunk=require(_0x352c('0xc'));var trigger=require(_0x352c('0xd'));var template=require(_0x352c('0xe'));var cmHopperHistory=require(_0x352c('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x352c('0x10'));var faxAccount=require(_0x352c('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x352c('0x12'));var sugarcrm=require(_0x352c('0x13'));var freshdesk=require(_0x352c('0x14'));var desk=require(_0x352c('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x352c('0x16'));var freshsales=require(_0x352c('0x17'));var servicenow=require(_0x352c('0x18'));var dynamics365=require(_0x352c('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x352c('0x1a')](_0x352c('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x352c('0x1a')](_0x352c('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x352c('0x1c')]()[_0x352c('0x1d')](user[_0x352c('0x1e')]())[_0x352c('0x1d')](realtime[_0x352c('0x1f')]())['then'](user['getTelephones']())[_0x352c('0x1d')](realtime['initTelephones']())['then'](trunk[_0x352c('0x20')]())[_0x352c('0x1d')](realtime[_0x352c('0x21')]())[_0x352c('0x1d')](voiceQueue[_0x352c('0x22')]())[_0x352c('0x1d')](realtime[_0x352c('0x23')]())[_0x352c('0x1d')](trigger[_0x352c('0x24')]())[_0x352c('0x1d')](realtime['initTriggers']())[_0x352c('0x1d')](template['getTemplates']())[_0x352c('0x1d')](realtime[_0x352c('0x25')]())['then'](zendesk[_0x352c('0x26')]())[_0x352c('0x1d')](realtime[_0x352c('0x27')]())[_0x352c('0x1d')](salesforce['getSalesforceAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x28')]())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x352c('0x29')]())[_0x352c('0x1d')](freshdesk[_0x352c('0x2a')]())[_0x352c('0x1d')](realtime[_0x352c('0x2b')]())['then'](desk[_0x352c('0x2c')]())[_0x352c('0x1d')](realtime[_0x352c('0x2d')]())[_0x352c('0x1d')](zoho['getZohoAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x2e')]())[_0x352c('0x1d')](vtiger[_0x352c('0x2f')]())[_0x352c('0x1d')](realtime['initVtigerAccounts']())[_0x352c('0x1d')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x352c('0x30')]())[_0x352c('0x1d')](servicenow['getServicenowAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x31')]())[_0x352c('0x1d')](dynamics365[_0x352c('0x32')]())[_0x352c('0x1d')](realtime['initDynamics365Accounts']())[_0x352c('0x1d')](campaign['getCampaigns']())['then'](realtime[_0x352c('0x33')]())[_0x352c('0x1d')](voiceExtension['getVoiceExtensions']())[_0x352c('0x1d')](realtime[_0x352c('0x34')]())[_0x352c('0x1d')](faxAccount['getFaxAccounts']())['then'](realtime[_0x352c('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x352c('0x1c')]()[_0x352c('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x352c('0x1d')](realtime[_0x352c('0x36')]())[_0x352c('0x1d')](cmHopperHistory[_0x352c('0x37')]())[_0x352c('0x1d')](realtime[_0x352c('0x38')]())[_0x352c('0x1d')](cmHopperHistory[_0x352c('0x39')]())['then'](realtime[_0x352c('0x3a')]())[_0x352c('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x352c('0x1d')](realtime[_0x352c('0x3b')]())[_0x352c('0x1d')](function(_0x2e5da1){})[_0x352c('0x3c')](function(_0x5ed9aa){console[_0x352c('0x3d')](_0x5ed9aa);});}function main(){return server[_0x352c('0x3e')](realtime,preview,fax)[_0x352c('0x1d')](function(_0x2e7a7f){return initRealtime();})[_0x352c('0x1d')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x2e7dc7){console[_0x352c('0x3d')](_0x2e7dc7);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index d969f3d..7d8fc0f 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x2ec8a4,_0x5a237f){var _0x4c3700=function(_0x5b2dc6){while(--_0x5b2dc6){_0x2ec8a4['push'](_0x2ec8a4['shift']());}};_0x4c3700(++_0x5a237f);}(_0x70e0,0x17b));var _0x070e=function(_0x282064,_0x326374){_0x282064=_0x282064-0x0;var _0x5e7780=_0x70e0[_0x282064];return _0x5e7780;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x51bfa7,_0x51c8e0){var _0x1cf7ae=function(_0x5e5625){while(--_0x5e5625){_0x51bfa7['push'](_0x51bfa7['shift']());}};_0x1cf7ae(++_0x51c8e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 09e9e41..836b6bf 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 _0xc1fa=['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','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x4a13db,_0x912364){var _0x3bdc9e=function(_0x2f3ed9){while(--_0x2f3ed9){_0x4a13db['push'](_0x4a13db['shift']());}};_0x3bdc9e(++_0x912364);}(_0xc1fa,0x106));var _0xac1f=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0xc1fa[_0x40ebff];return _0x40122a;};'use strict';function Campaign(_0x1513ef){this['id']=_0x1513ef['id']||0x0;this['name']=_0x1513ef[_0xac1f('0x0')]||'';this[_0xac1f('0x1')]=_0x1513ef[_0xac1f('0x1')]||_0xac1f('0x2');this[_0xac1f('0x3')]=0x0;this[_0xac1f('0x4')]=0x0;this[_0xac1f('0x5')]=0x0;this[_0xac1f('0x6')]=0x0;this[_0xac1f('0x7')]='';this[_0xac1f('0x8')]=!![];this[_0xac1f('0x9')]=_0x1513ef['active'];this[_0xac1f('0xa')]=_0x1513ef['limitCalls'];this[_0xac1f('0xb')]=_0x1513ef[_0xac1f('0xb')]||null;this['dialGlobalInterval']=_0x1513ef[_0xac1f('0xc')]?_0x1513ef[_0xac1f('0xc')]:null;this[_0xac1f('0xd')]=_0x1513ef[_0xac1f('0xd')];this['dialOriginateCallerIdNumber']=_0x1513ef[_0xac1f('0xe')];this['dialOriginateTimeout']=_0x1513ef[_0xac1f('0xf')]||0x1e;this[_0xac1f('0x10')]=_0x1513ef[_0xac1f('0x10')];this[_0xac1f('0x11')]=_0x1513ef[_0xac1f('0x11')];this['dialBusyMaxRetry']=_0x1513ef[_0xac1f('0x12')];this[_0xac1f('0x13')]=_0x1513ef[_0xac1f('0x13')];this[_0xac1f('0x14')]=_0x1513ef[_0xac1f('0x14')];this[_0xac1f('0x15')]=_0x1513ef[_0xac1f('0x15')];this[_0xac1f('0x16')]=_0x1513ef[_0xac1f('0x16')];this[_0xac1f('0x17')]=_0x1513ef[_0xac1f('0x17')]||0x3;this[_0xac1f('0x18')]=_0x1513ef[_0xac1f('0x18')]||0x96;this['dialDropMaxRetry']=_0x1513ef[_0xac1f('0x19')]||0x3;this['dialDropRetryFrequency']=_0x1513ef[_0xac1f('0x1a')]||0x96;this[_0xac1f('0x1b')]=_0x1513ef[_0xac1f('0x1b')]||0x3;this[_0xac1f('0x1c')]=_0x1513ef[_0xac1f('0x1c')]||0x96;this[_0xac1f('0x1d')]=_0x1513ef[_0xac1f('0x1d')]||0x3;this[_0xac1f('0x1e')]=_0x1513ef[_0xac1f('0x1e')]||0x96;this[_0xac1f('0x1f')]=_0x1513ef[_0xac1f('0x1f')]||0x3;this[_0xac1f('0x20')]=_0x1513ef[_0xac1f('0x20')]||0x96;this[_0xac1f('0x21')]=_0x1513ef['dialOrderByScheduledAt']||_0xac1f('0x22');this[_0xac1f('0x23')]=_0x1513ef[_0xac1f('0x23')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1513ef[_0xac1f('0x24')]||undefined;this[_0xac1f('0x25')]=_0x1513ef['dialCutDigit']||undefined;this[_0xac1f('0x26')]=_0x1513ef[_0xac1f('0x26')]?_0x1513ef[_0xac1f('0x26')]:undefined;this[_0xac1f('0x27')]=_0x1513ef[_0xac1f('0x27')]?_0x1513ef['Trunk']:undefined;this[_0xac1f('0x28')]=_0x1513ef[_0xac1f('0x28')]?_0x1513ef[_0xac1f('0x28')]:undefined;this['SquareProject']=_0x1513ef['SquareProject']?_0x1513ef[_0xac1f('0x29')]:undefined;this[_0xac1f('0x2a')]=_0x1513ef[_0xac1f('0x29')]?_0x1513ef[_0xac1f('0x29')][_0xac1f('0x0')]:undefined;this[_0xac1f('0x2b')]=_0x1513ef[_0xac1f('0x2b')]||![];this[_0xac1f('0x2c')]=_0x1513ef[_0xac1f('0x2c')];this[_0xac1f('0x2d')]=_0x1513ef[_0xac1f('0x2d')];this[_0xac1f('0x2e')]=_0x1513ef['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1513ef[_0xac1f('0x2f')];this[_0xac1f('0x30')]=_0x1513ef['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x1513ef[_0xac1f('0x31')];this[_0xac1f('0x32')]=_0x1513ef[_0xac1f('0x32')];this[_0xac1f('0x33')]=_0x1513ef[_0xac1f('0x33')];this[_0xac1f('0x34')]=_0x1513ef[_0xac1f('0x34')];}module[_0xac1f('0x35')]=Campaign; \ No newline at end of file +var _0xbd35=['type','campaign','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name'];(function(_0x3aac5d,_0x8af391){var _0x331a28=function(_0xbafd0f){while(--_0xbafd0f){_0x3aac5d['push'](_0x3aac5d['shift']());}};_0x331a28(++_0x8af391);}(_0xbd35,0x16f));var _0x5bd3=function(_0xe5a40b,_0x5a054b){_0xe5a40b=_0xe5a40b-0x0;var _0x55493f=_0xbd35[_0xe5a40b];return _0x55493f;};'use strict';function Campaign(_0x3c8ce2){this['id']=_0x3c8ce2['id']||0x0;this[_0x5bd3('0x0')]=_0x3c8ce2[_0x5bd3('0x0')]||'';this[_0x5bd3('0x1')]=_0x3c8ce2[_0x5bd3('0x1')]||_0x5bd3('0x2');this['originated']=0x0;this[_0x5bd3('0x3')]=0x0;this[_0x5bd3('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x5bd3('0x5')]='';this[_0x5bd3('0x6')]=!![];this[_0x5bd3('0x7')]=_0x3c8ce2[_0x5bd3('0x7')];this['limitCalls']=_0x3c8ce2[_0x5bd3('0x8')];this[_0x5bd3('0x9')]=_0x3c8ce2[_0x5bd3('0x9')]||null;this['dialGlobalInterval']=_0x3c8ce2['dialGlobalInterval']?_0x3c8ce2[_0x5bd3('0xa')]:null;this[_0x5bd3('0xb')]=_0x3c8ce2['dialOriginateCallerIdName'];this[_0x5bd3('0xc')]=_0x3c8ce2['dialOriginateCallerIdNumber'];this[_0x5bd3('0xd')]=_0x3c8ce2[_0x5bd3('0xd')]||0x1e;this[_0x5bd3('0xe')]=_0x3c8ce2[_0x5bd3('0xe')];this[_0x5bd3('0xf')]=_0x3c8ce2[_0x5bd3('0xf')];this[_0x5bd3('0x10')]=_0x3c8ce2[_0x5bd3('0x10')];this[_0x5bd3('0x11')]=_0x3c8ce2[_0x5bd3('0x11')];this['dialNoAnswerMaxRetry']=_0x3c8ce2['dialNoAnswerMaxRetry'];this[_0x5bd3('0x12')]=_0x3c8ce2[_0x5bd3('0x12')];this['dialGlobalMaxRetry']=_0x3c8ce2[_0x5bd3('0x13')];this['dialNoSuchNumberMaxRetry']=_0x3c8ce2['dialNoSuchNumberMaxRetry']||0x3;this[_0x5bd3('0x14')]=_0x3c8ce2[_0x5bd3('0x14')]||0x96;this['dialDropMaxRetry']=_0x3c8ce2[_0x5bd3('0x15')]||0x3;this['dialDropRetryFrequency']=_0x3c8ce2['dialDropRetryFrequency']||0x96;this[_0x5bd3('0x16')]=_0x3c8ce2[_0x5bd3('0x16')]||0x3;this[_0x5bd3('0x17')]=_0x3c8ce2['dialAbandonedRetryFrequency']||0x96;this[_0x5bd3('0x18')]=_0x3c8ce2[_0x5bd3('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x3c8ce2[_0x5bd3('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x3c8ce2[_0x5bd3('0x1a')]||0x3;this[_0x5bd3('0x1b')]=_0x3c8ce2['dialAgentRejectRetryFrequency']||0x96;this[_0x5bd3('0x1c')]=_0x3c8ce2[_0x5bd3('0x1c')]||'DESC';this[_0x5bd3('0x1d')]=_0x3c8ce2[_0x5bd3('0x1d')]||undefined;this[_0x5bd3('0x1e')]=_0x3c8ce2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5bd3('0x1f')]=_0x3c8ce2[_0x5bd3('0x1f')]||undefined;this['TrunkBackup']=_0x3c8ce2[_0x5bd3('0x20')]?_0x3c8ce2[_0x5bd3('0x20')]:undefined;this[_0x5bd3('0x21')]=_0x3c8ce2['Trunk']?_0x3c8ce2['Trunk']:undefined;this[_0x5bd3('0x22')]=_0x3c8ce2[_0x5bd3('0x22')]?_0x3c8ce2[_0x5bd3('0x22')]:undefined;this[_0x5bd3('0x23')]=_0x3c8ce2[_0x5bd3('0x23')]?_0x3c8ce2[_0x5bd3('0x23')]:undefined;this[_0x5bd3('0x24')]=_0x3c8ce2[_0x5bd3('0x23')]?_0x3c8ce2[_0x5bd3('0x23')]['name']:undefined;this[_0x5bd3('0x25')]=_0x3c8ce2['dialAMDActive']||![];this[_0x5bd3('0x26')]=_0x3c8ce2[_0x5bd3('0x26')];this['dialAMDGreeting']=_0x3c8ce2[_0x5bd3('0x27')];this[_0x5bd3('0x28')]=_0x3c8ce2['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3c8ce2['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x3c8ce2[_0x5bd3('0x29')];this[_0x5bd3('0x2a')]=_0x3c8ce2[_0x5bd3('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x3c8ce2[_0x5bd3('0x2b')];this[_0x5bd3('0x2c')]=_0x3c8ce2[_0x5bd3('0x2c')];this[_0x5bd3('0x2d')]=_0x3c8ce2[_0x5bd3('0x2d')];}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 a8d7e08..d0107c1 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 _0xd21b=['tag','disposition','queue','monitors','transfercalleridnum','transferType','exports','destinationchannel','calleridnum','calleridname','connectedlinename','uniqueid','exten','answered','endtime','unmanaged','lastapplication','lastdata','holdtime','type'];(function(_0x51ea61,_0x1c184d){var _0x3281b3=function(_0x4d1304){while(--_0x4d1304){_0x51ea61['push'](_0x51ea61['shift']());}};_0x3281b3(++_0x1c184d);}(_0xd21b,0xcf));var _0xbd21=function(_0xdc1176,_0x55c094){_0xdc1176=_0xdc1176-0x0;var _0x4d7c39=_0xd21b[_0xdc1176];return _0x4d7c39;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xbd21('0x0')]='';this[_0xbd21('0x1')]=0x0;this[_0xbd21('0x2')]='';this['connectedlinenum']=undefined;this[_0xbd21('0x3')]=undefined;this['accountcode']=0x0;this['context']='';this[_0xbd21('0x4')]=0x0;this['linkedid']=0x0;this[_0xbd21('0x5')]=0x0;this[_0xbd21('0x6')]=![];this['answertime']=null;this[_0xbd21('0x7')]=null;this[_0xbd21('0x8')]=![];this['abandoned']=![];this[_0xbd21('0x9')]='';this[_0xbd21('0xa')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xbd21('0xb')]=0x0;this[_0xbd21('0xc')]=null;this[_0xbd21('0xd')]=null;this[_0xbd21('0xe')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xbd21('0xf')]=null;this[_0xbd21('0x10')]=[];this[_0xbd21('0x11')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xbd21('0x12')]=undefined;this['mohtime']=0x0;}module[_0xbd21('0x13')]=Channel; \ No newline at end of file +var _0x53e6=['holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','billableseconds'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x53e6,0x178));var _0x653e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e6[_0x321bb2];return _0x9c12ed;};'use strict';function Channel(){this[_0x653e('0x0')]=null;this[_0x653e('0x1')]='';this[_0x653e('0x2')]='';this[_0x653e('0x3')]=0x0;this[_0x653e('0x4')]='';this['connectedlinenum']=undefined;this[_0x653e('0x5')]=undefined;this['accountcode']=0x0;this['context']='';this['uniqueid']=0x0;this[_0x653e('0x6')]=0x0;this[_0x653e('0x7')]=0x0;this[_0x653e('0x8')]=![];this[_0x653e('0x9')]=null;this[_0x653e('0xa')]=null;this['unmanaged']=![];this[_0x653e('0xb')]=![];this[_0x653e('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0x653e('0xd')]=0x0;this[_0x653e('0xe')]=0x0;this[_0x653e('0xf')]=null;this[_0x653e('0x10')]=null;this[_0x653e('0x11')]=null;this[_0x653e('0x12')]=![];this[_0x653e('0x13')]=null;this['queue']=null;this[_0x653e('0x14')]=[];this[_0x653e('0x15')]=undefined;this[_0x653e('0x16')]=undefined;this[_0x653e('0x17')]=undefined;this[_0x653e('0x18')]=0x0;}module[_0x653e('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a39bb6f..41d1be2 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 _0x6d4f=['type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x2727bd,_0x1e2cec){var _0x5aaaac=function(_0x11671d){while(--_0x11671d){_0x2727bd['push'](_0x2727bd['shift']());}};_0x5aaaac(++_0x1e2cec);}(_0x6d4f,0x19c));var _0xf6d4=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x6d4f[_0x575057];return _0x49dbc8;};'use strict';function DeskAccount(_0x8c89fb){this['id']=_0x8c89fb['id']||0x0;this['name']=_0x8c89fb['name']||'';this[_0xf6d4('0x0')]=_0x8c89fb[_0xf6d4('0x0')]||'';this[_0xf6d4('0x1')]=_0x8c89fb[_0xf6d4('0x1')]||'';this[_0xf6d4('0x2')]=_0x8c89fb[_0xf6d4('0x2')]||'';this[_0xf6d4('0x3')]=_0x8c89fb[_0xf6d4('0x3')]||'';this[_0xf6d4('0x4')]=_0x8c89fb[_0xf6d4('0x4')]||'';this['consumerSecret']=_0x8c89fb[_0xf6d4('0x5')]||'';this[_0xf6d4('0x6')]=_0x8c89fb[_0xf6d4('0x6')]||'';this['tokenSecret']=_0x8c89fb[_0xf6d4('0x7')]||'';this[_0xf6d4('0x8')]=_0x8c89fb[_0xf6d4('0x8')]||'';this[_0xf6d4('0x9')]=_0x8c89fb[_0xf6d4('0x9')]||'';this['Configurations']=_0x8c89fb[_0xf6d4('0xa')]||{};}module[_0xf6d4('0xb')]=DeskAccount; \ No newline at end of file +var _0xc7d4=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x5896c4,_0x1681d9){var _0x6f7f33=function(_0x53ded9){while(--_0x53ded9){_0x5896c4['push'](_0x5896c4['shift']());}};_0x6f7f33(++_0x1681d9);}(_0xc7d4,0x190));var _0x4c7d=function(_0x4fc877,_0x87d6de){_0x4fc877=_0x4fc877-0x0;var _0x26997a=_0xc7d4[_0x4fc877];return _0x26997a;};'use strict';function DeskAccount(_0x4156f1){this['id']=_0x4156f1['id']||0x0;this['name']=_0x4156f1[_0x4c7d('0x0')]||'';this[_0x4c7d('0x1')]=_0x4156f1['username']||'';this[_0x4c7d('0x2')]=_0x4156f1[_0x4c7d('0x2')]||'';this[_0x4c7d('0x3')]=_0x4156f1['authType']||'';this['password']=_0x4156f1[_0x4c7d('0x4')]||'';this[_0x4c7d('0x5')]=_0x4156f1[_0x4c7d('0x5')]||'';this[_0x4c7d('0x6')]=_0x4156f1['consumerSecret']||'';this[_0x4c7d('0x7')]=_0x4156f1[_0x4c7d('0x7')]||'';this[_0x4c7d('0x8')]=_0x4156f1[_0x4c7d('0x8')]||'';this[_0x4c7d('0x9')]=_0x4156f1['type']||'';this[_0x4c7d('0xa')]=_0x4156f1[_0x4c7d('0xa')]||'';this[_0x4c7d('0xb')]=_0x4156f1['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c443404..203c074 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 _0x1be1=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1be1,0x192));var _0x11be=function(_0x3f954d,_0x3f35f4){_0x3f954d=_0x3f954d-0x0;var _0xf72adf=_0x1be1[_0x3f954d];return _0xf72adf;};'use strict';function Dynamics365Account(_0x35110c){this['id']=_0x35110c['id']||0x0;this['name']=_0x35110c[_0x11be('0x0')]||'';this[_0x11be('0x1')]=_0x35110c['username']||'';this[_0x11be('0x2')]=_0x35110c[_0x11be('0x2')]||'';this[_0x11be('0x3')]=_0x35110c[_0x11be('0x3')]||'';this['tenantId']=_0x35110c[_0x11be('0x4')]||'';this[_0x11be('0x5')]=_0x35110c[_0x11be('0x5')]||'';this['clientSecret']=_0x35110c[_0x11be('0x6')]||{};this['serverUrl']=_0x35110c[_0x11be('0x7')]||'';this[_0x11be('0x8')]=_0x35110c[_0x11be('0x8')]||{};}module[_0x11be('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x9c00=['serverUrl','Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x2f1f08,_0x158f35){var _0x32f365=function(_0x2cc60e){while(--_0x2cc60e){_0x2f1f08['push'](_0x2f1f08['shift']());}};_0x32f365(++_0x158f35);}(_0x9c00,0x1a0));var _0x09c0=function(_0x18624e,_0x172c43){_0x18624e=_0x18624e-0x0;var _0x41ef95=_0x9c00[_0x18624e];return _0x41ef95;};'use strict';function Dynamics365Account(_0x1aed38){this['id']=_0x1aed38['id']||0x0;this[_0x09c0('0x0')]=_0x1aed38['name']||'';this['username']=_0x1aed38[_0x09c0('0x1')]||'';this[_0x09c0('0x2')]=_0x1aed38['password']||'';this[_0x09c0('0x3')]=_0x1aed38[_0x09c0('0x3')]||'';this[_0x09c0('0x4')]=_0x1aed38[_0x09c0('0x4')]||'';this[_0x09c0('0x5')]=_0x1aed38['clientId']||'';this['clientSecret']=_0x1aed38[_0x09c0('0x6')]||{};this[_0x09c0('0x7')]=_0x1aed38[_0x09c0('0x7')]||'';this[_0x09c0('0x8')]=_0x1aed38[_0x09c0('0x8')]||{};}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 2fbb144..cf09860 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 _0xa72a=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0x2aa163,_0x442fb1){var _0x1ef64a=function(_0x493c8c){while(--_0x493c8c){_0x2aa163['push'](_0x2aa163['shift']());}};_0x1ef64a(++_0x442fb1);}(_0xa72a,0x1ca));var _0xaa72=function(_0x3a351d,_0x5bb577){_0x3a351d=_0x3a351d-0x0;var _0x370d12=_0xa72a[_0x3a351d];return _0x370d12;};'use strict';function FaxAccount(_0x47a9a3){this['id']=_0x47a9a3['id']||0x0;this[_0xaa72('0x0')]=_0x47a9a3['name']||'';this['description']=_0x47a9a3[_0xaa72('0x1')];this['ecm']=_0x47a9a3[_0xaa72('0x2')];this[_0xaa72('0x3')]=_0x47a9a3['headerinfo'];this[_0xaa72('0x4')]=_0x47a9a3[_0xaa72('0x4')];this[_0xaa72('0x5')]=_0x47a9a3['minrate']||0x960;this[_0xaa72('0x6')]=_0x47a9a3['maxrate']||0x3840;this['modem']=_0x47a9a3[_0xaa72('0x7')]||_0xaa72('0x8');this['gateway']=_0x47a9a3[_0xaa72('0x9')]||'no';this[_0xaa72('0xa')]=_0x47a9a3[_0xaa72('0xa')]||'no';this['t38timeout']=_0x47a9a3[_0xaa72('0xb')]||0x1388;this[_0xaa72('0xc')]=_0x47a9a3[_0xaa72('0xc')]||'SIP';this['Trunk']=_0x47a9a3[_0xaa72('0xd')]?_0x47a9a3[_0xaa72('0xd')]:undefined;this['ListId']=_0x47a9a3[_0xaa72('0xe')];this[_0xaa72('0xf')]=_0x47a9a3[_0xaa72('0xf')];}module[_0xaa72('0x10')]=FaxAccount; \ No newline at end of file +var _0x1dca=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1dca,0x1ce));var _0xa1dc=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x1dca[_0x4b4f24];return _0x1c13d4;};'use strict';function FaxAccount(_0x96983d){this['id']=_0x96983d['id']||0x0;this[_0xa1dc('0x0')]=_0x96983d['name']||'';this[_0xa1dc('0x1')]=_0x96983d[_0xa1dc('0x1')];this[_0xa1dc('0x2')]=_0x96983d[_0xa1dc('0x2')];this['headerinfo']=_0x96983d[_0xa1dc('0x3')];this[_0xa1dc('0x4')]=_0x96983d['localstationid'];this['minrate']=_0x96983d[_0xa1dc('0x5')]||0x960;this[_0xa1dc('0x6')]=_0x96983d[_0xa1dc('0x6')]||0x3840;this[_0xa1dc('0x7')]=_0x96983d[_0xa1dc('0x7')]||_0xa1dc('0x8');this[_0xa1dc('0x9')]=_0x96983d[_0xa1dc('0x9')]||'no';this['faxdetect']=_0x96983d[_0xa1dc('0xa')]||'no';this['t38timeout']=_0x96983d[_0xa1dc('0xb')]||0x1388;this['tech']=_0x96983d[_0xa1dc('0xc')]||'SIP';this[_0xa1dc('0xd')]=_0x96983d[_0xa1dc('0xd')]?_0x96983d[_0xa1dc('0xd')]:undefined;this[_0xa1dc('0xe')]=_0x96983d['ListId'];this[_0xa1dc('0xf')]=_0x96983d[_0xa1dc('0xf')];}module[_0xa1dc('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 9b98230..10d27ce 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 _0x77b3=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x45ffe1,_0x192d8d){var _0x4d23a1=function(_0x2ff5fe){while(--_0x2ff5fe){_0x45ffe1['push'](_0x45ffe1['shift']());}};_0x4d23a1(++_0x192d8d);}(_0x77b3,0x10e));var _0x377b=function(_0x39c687,_0x2272db){_0x39c687=_0x39c687-0x0;var _0x37debf=_0x77b3[_0x39c687];return _0x37debf;};'use strict';function FreshdeskAccount(_0x24be7b){this['id']=_0x24be7b['id']||0x0;this['name']=_0x24be7b[_0x377b('0x0')]||'';this[_0x377b('0x1')]=_0x24be7b[_0x377b('0x1')]||'';this[_0x377b('0x2')]=_0x24be7b['token']||'';this[_0x377b('0x3')]=_0x24be7b[_0x377b('0x3')]||'';this[_0x377b('0x4')]=_0x24be7b['serverUrl']||'';this[_0x377b('0x5')]=_0x24be7b[_0x377b('0x5')]||{};}module[_0x377b('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x1209=['Configurations','name','token','remoteUri','serverUrl'];(function(_0x270a25,_0x345972){var _0x31db8e=function(_0x359ccc){while(--_0x359ccc){_0x270a25['push'](_0x270a25['shift']());}};_0x31db8e(++_0x345972);}(_0x1209,0x92));var _0x9120=function(_0x42503c,_0x3d2aa1){_0x42503c=_0x42503c-0x0;var _0x37ab06=_0x1209[_0x42503c];return _0x37ab06;};'use strict';function FreshdeskAccount(_0x4db253){this['id']=_0x4db253['id']||0x0;this[_0x9120('0x0')]=_0x4db253[_0x9120('0x0')]||'';this['username']=_0x4db253['username']||'';this['apiKey']=_0x4db253[_0x9120('0x1')]||'';this[_0x9120('0x2')]=_0x4db253[_0x9120('0x2')]||'';this[_0x9120('0x3')]=_0x4db253[_0x9120('0x3')]||'';this[_0x9120('0x4')]=_0x4db253['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 cbf565b..1cf20f0 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 _0x7579=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1aee9b,_0xd66160){var _0x2b8ae0=function(_0x5327f8){while(--_0x5327f8){_0x1aee9b['push'](_0x1aee9b['shift']());}};_0x2b8ae0(++_0xd66160);}(_0x7579,0x1e2));var _0x9757=function(_0x5014b1,_0x4d97a4){_0x5014b1=_0x5014b1-0x0;var _0x840e93=_0x7579[_0x5014b1];return _0x840e93;};'use strict';function FreshsalesAccount(_0x362458){this['id']=_0x362458['id']||0x0;this[_0x9757('0x0')]=_0x362458[_0x9757('0x0')]||'';this[_0x9757('0x1')]=_0x362458[_0x9757('0x1')]||'';this[_0x9757('0x2')]=_0x362458['token']||'';this[_0x9757('0x3')]=_0x362458[_0x9757('0x3')]||'';this[_0x9757('0x4')]=_0x362458[_0x9757('0x4')]||'';this['Configurations']=_0x362458[_0x9757('0x5')]||{};}module[_0x9757('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xda19=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x1ec912,_0x3cfc0c){_0x1ec912=_0x1ec912-0x0;var _0xd45fb9=_0xda19[_0x1ec912];return _0xd45fb9;};'use strict';function FreshsalesAccount(_0x26be9c){this['id']=_0x26be9c['id']||0x0;this[_0x9da1('0x0')]=_0x26be9c[_0x9da1('0x0')]||'';this['username']=_0x26be9c[_0x9da1('0x1')]||'';this['apiKey']=_0x26be9c[_0x9da1('0x2')]||'';this['remoteUri']=_0x26be9c[_0x9da1('0x3')]||'';this[_0x9da1('0x4')]=_0x26be9c[_0x9da1('0x4')]||'';this[_0x9da1('0x5')]=_0x26be9c[_0x9da1('0x5')]||{};}module[_0x9da1('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 322970d..492e376 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 _0x6de6=['queuecallercomplete','queuecallercompleteAt','originalposition','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position'];(function(_0x53bf0f,_0x2865c1){var _0x24f089=function(_0x4e9751){while(--_0x4e9751){_0x53bf0f['push'](_0x53bf0f['shift']());}};_0x24f089(++_0x2865c1);}(_0x6de6,0x7c));var _0x66de=function(_0x21dc0c,_0x64bb32){_0x21dc0c=_0x21dc0c-0x0;var _0x57d588=_0x6de6[_0x21dc0c];return _0x57d588;};'use strict';function QueueReport(){this[_0x66de('0x0')]=_0x66de('0x1');this[_0x66de('0x2')]='';this['calleridnum']='';this[_0x66de('0x3')]='';this[_0x66de('0x4')]='';this[_0x66de('0x5')]=null;this[_0x66de('0x6')]=null;this[_0x66de('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x66de('0x8')]=![];this[_0x66de('0x9')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x66de('0xa')]=0x1;this['channel']='';this[_0x66de('0xb')]='';this['connectedlinename']='';this[_0x66de('0xc')]='';this[_0x66de('0xd')]='';this[_0x66de('0xe')]='';this[_0x66de('0xf')]='';this[_0x66de('0x10')]=0x0;this[_0x66de('0x11')]=![];this[_0x66de('0x12')]='';this['motionChannel']='voice';this[_0x66de('0x13')]=0x0;this[_0x66de('0x14')]={};}module[_0x66de('0x15')]=QueueReport; \ No newline at end of file +var _0x2ae1=['exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2ae1,0x69));var _0x12ae=function(_0x29c947,_0x276ed4){_0x29c947=_0x29c947-0x0;var _0x5dae09=_0x2ae1[_0x29c947];return _0x5dae09;};'use strict';function QueueReport(){this[_0x12ae('0x0')]='inbound';this[_0x12ae('0x1')]='';this[_0x12ae('0x2')]='';this[_0x12ae('0x3')]='';this['queue']='';this[_0x12ae('0x4')]=null;this[_0x12ae('0x5')]=null;this[_0x12ae('0x6')]=0x1;this[_0x12ae('0x7')]=0x1;this[_0x12ae('0x8')]=![];this[_0x12ae('0x9')]=null;this[_0x12ae('0xa')]=![];this[_0x12ae('0xb')]=null;this['queuecallerexit']=![];this[_0x12ae('0xc')]=null;this[_0x12ae('0xd')]=0x1;this[_0x12ae('0xe')]='';this[_0x12ae('0xf')]='';this[_0x12ae('0x10')]='';this[_0x12ae('0x11')]='';this['context']='';this[_0x12ae('0x12')]='';this['priority']='';this[_0x12ae('0x13')]=0x0;this[_0x12ae('0x14')]=![];this[_0x12ae('0x15')]='';this[_0x12ae('0x16')]=_0x12ae('0x17');this['mohtime']=0x0;this[_0x12ae('0x18')]={};}module[_0x12ae('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 690a354..0bd045a 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 _0x3239=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x1d4dc5,_0x10c711){var _0x4dcdf1=function(_0x5bf936){while(--_0x5bf936){_0x1d4dc5['push'](_0x1d4dc5['shift']());}};_0x4dcdf1(++_0x10c711);}(_0x3239,0x81));var _0x9323=function(_0x47dc4a,_0xd00c41){_0x47dc4a=_0x47dc4a-0x0;var _0x1cd382=_0x3239[_0x47dc4a];return _0x1cd382;};'use strict';function SalesforceAccount(_0xfc45e){this['id']=_0xfc45e['id']||0x0;this[_0x9323('0x0')]=_0xfc45e[_0x9323('0x0')]||'';this[_0x9323('0x1')]=_0xfc45e['username']||'';this[_0x9323('0x2')]=_0xfc45e[_0x9323('0x2')]||'';this[_0x9323('0x3')]=_0xfc45e[_0x9323('0x3')]||'';this[_0x9323('0x4')]=_0xfc45e[_0x9323('0x4')]||'';this[_0x9323('0x5')]=_0xfc45e['clientSecret']||'';this[_0x9323('0x6')]=_0xfc45e[_0x9323('0x6')]||'';this[_0x9323('0x7')]=_0xfc45e[_0x9323('0x7')]||_0x9323('0x8');this[_0x9323('0x9')]=_0xfc45e[_0x9323('0x9')]||'';this['Configurations']=_0xfc45e[_0x9323('0xa')]||{};}module[_0x9323('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xe7c3=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x36e77f,_0x20835b){var _0xbf334f=function(_0x2f0075){while(--_0x2f0075){_0x36e77f['push'](_0x36e77f['shift']());}};_0xbf334f(++_0x20835b);}(_0xe7c3,0x173));var _0x3e7c=function(_0x59a18e,_0x546652){_0x59a18e=_0x59a18e-0x0;var _0x27ab29=_0xe7c3[_0x59a18e];return _0x27ab29;};'use strict';function SalesforceAccount(_0x38fb1a){this['id']=_0x38fb1a['id']||0x0;this['name']=_0x38fb1a[_0x3e7c('0x0')]||'';this[_0x3e7c('0x1')]=_0x38fb1a['username']||'';this[_0x3e7c('0x2')]=_0x38fb1a[_0x3e7c('0x2')]||'';this[_0x3e7c('0x3')]=_0x38fb1a['password']||'';this[_0x3e7c('0x4')]=_0x38fb1a[_0x3e7c('0x4')]||'';this[_0x3e7c('0x5')]=_0x38fb1a['clientSecret']||'';this[_0x3e7c('0x6')]=_0x38fb1a[_0x3e7c('0x6')]||'';this[_0x3e7c('0x7')]=_0x38fb1a[_0x3e7c('0x7')]||'integrationTab';this[_0x3e7c('0x8')]=_0x38fb1a[_0x3e7c('0x8')]||'';this[_0x3e7c('0x9')]=_0x38fb1a[_0x3e7c('0x9')]||{};}module[_0x3e7c('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 12dd283..3b2529c 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 _0x22f1=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3d0535,_0x253d07){var _0x5cb0e8=function(_0x24c7ba){while(--_0x24c7ba){_0x3d0535['push'](_0x3d0535['shift']());}};_0x5cb0e8(++_0x253d07);}(_0x22f1,0xb9));var _0x122f=function(_0xe76e80,_0x105542){_0xe76e80=_0xe76e80-0x0;var _0x4595ee=_0x22f1[_0xe76e80];return _0x4595ee;};'use strict';function ServicenowAccount(_0x225cbe){this['id']=_0x225cbe['id']||0x0;this[_0x122f('0x0')]=_0x225cbe[_0x122f('0x0')]||'';this[_0x122f('0x1')]=_0x225cbe[_0x122f('0x1')]||'';this[_0x122f('0x2')]=_0x225cbe[_0x122f('0x2')]||'';this[_0x122f('0x3')]=_0x225cbe[_0x122f('0x3')]||'';this[_0x122f('0x4')]=_0x225cbe['serverUrl']||'';this[_0x122f('0x5')]=_0x225cbe[_0x122f('0x5')]||{};}module[_0x122f('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x84d1=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x23a97d,_0x528dfc){var _0x2f8cd4=function(_0x2a5385){while(--_0x2a5385){_0x23a97d['push'](_0x23a97d['shift']());}};_0x2f8cd4(++_0x528dfc);}(_0x84d1,0xff));var _0x184d=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x84d1[_0x99ff94];return _0x1b5bc0;};'use strict';function ServicenowAccount(_0x183786){this['id']=_0x183786['id']||0x0;this[_0x184d('0x0')]=_0x183786[_0x184d('0x0')]||'';this['username']=_0x183786[_0x184d('0x1')]||'';this[_0x184d('0x2')]=_0x183786[_0x184d('0x2')]||'';this[_0x184d('0x3')]=_0x183786[_0x184d('0x3')]||'';this[_0x184d('0x4')]=_0x183786[_0x184d('0x4')]||'';this[_0x184d('0x5')]=_0x183786['Configurations']||{};}module[_0x184d('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e08963e..0af2de6 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 _0xa09e=['password','remoteUri','serverUrl','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa09e,0x1e8));var _0xea09=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0xa09e[_0x4ef734];return _0x33a7cb;};'use strict';function SugarcrmAccount(_0x135d18){this['id']=_0x135d18['id']||0x0;this[_0xea09('0x0')]=_0x135d18[_0xea09('0x0')]||'';this['username']=_0x135d18[_0xea09('0x1')]||'';this[_0xea09('0x2')]=_0x135d18['password']||'';this['remoteUri']=_0x135d18[_0xea09('0x3')]||'';this[_0xea09('0x4')]=_0x135d18[_0xea09('0x4')]||'';this['Configurations']=_0x135d18['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x1d87=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x5e43d3,_0x4ac566){var _0x374f2e=function(_0x706167){while(--_0x706167){_0x5e43d3['push'](_0x5e43d3['shift']());}};_0x374f2e(++_0x4ac566);}(_0x1d87,0x196));var _0x71d8=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x1d87[_0x3ef45e];return _0x69e7c;};'use strict';function SugarcrmAccount(_0x30a94d){this['id']=_0x30a94d['id']||0x0;this[_0x71d8('0x0')]=_0x30a94d['name']||'';this[_0x71d8('0x1')]=_0x30a94d[_0x71d8('0x1')]||'';this[_0x71d8('0x2')]=_0x30a94d['password']||'';this[_0x71d8('0x3')]=_0x30a94d[_0x71d8('0x3')]||'';this[_0x71d8('0x4')]=_0x30a94d[_0x71d8('0x4')]||'';this[_0x71d8('0x5')]=_0x30a94d['Configurations']||{};}module[_0x71d8('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 5875bce..333a0ac 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 _0xd3cc=['status','unknown','address','exports','name','accountcode','state','stateTime'];(function(_0x1dd669,_0x1f39a8){var _0x3271a8=function(_0x1f89d2){while(--_0x1f89d2){_0x1dd669['push'](_0x1dd669['shift']());}};_0x3271a8(++_0x1f39a8);}(_0xd3cc,0xd4));var _0xcd3c=function(_0x37e970,_0x7f85fc){_0x37e970=_0x37e970-0x0;var _0x55dda1=_0xd3cc[_0x37e970];return _0x55dda1;};'use strict';function Telephone(_0x1c67c4){this['id']=_0x1c67c4['id']||0x0;this[_0xcd3c('0x0')]=_0x1c67c4[_0xcd3c('0x0')]||'';this[_0xcd3c('0x1')]=_0x1c67c4[_0xcd3c('0x1')]||'';this[_0xcd3c('0x2')]='unknown';this[_0xcd3c('0x3')]=0x0;this[_0xcd3c('0x4')]=_0xcd3c('0x5');this[_0xcd3c('0x6')]='';}module[_0xcd3c('0x7')]=Telephone; \ No newline at end of file +var _0xbc87=['accountcode','state','unknown','status','address','exports','name'];(function(_0x4ab80f,_0x5ab227){var _0x4a5699=function(_0x2c6eba){while(--_0x2c6eba){_0x4ab80f['push'](_0x4ab80f['shift']());}};_0x4a5699(++_0x5ab227);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x228a9a,_0x18a708){_0x228a9a=_0x228a9a-0x0;var _0x1cc7da=_0xbc87[_0x228a9a];return _0x1cc7da;};'use strict';function Telephone(_0x19aeea){this['id']=_0x19aeea['id']||0x0;this[_0x7bc8('0x0')]=_0x19aeea['name']||'';this[_0x7bc8('0x1')]=_0x19aeea[_0x7bc8('0x1')]||'';this[_0x7bc8('0x2')]=_0x7bc8('0x3');this['stateTime']=0x0;this[_0x7bc8('0x4')]=_0x7bc8('0x3');this[_0x7bc8('0x5')]='';}module[_0x7bc8('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 8e4bfe3..bfaecf3 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4c7317,_0x148842){var _0x25d833=function(_0xe59276){while(--_0xe59276){_0x4c7317['push'](_0x4c7317['shift']());}};_0x25d833(++_0x148842);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x4d3e24,_0x13cba3){var _0x92dfbf=function(_0x3d17fc){while(--_0x3d17fc){_0x4d3e24['push'](_0x4d3e24['shift']());}};_0x92dfbf(++_0x13cba3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 36eea7f..eb90e96 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x1809b2,_0x12ed05){var _0x2c724e=function(_0xeb2a7){while(--_0xeb2a7){_0x1809b2['push'](_0x1809b2['shift']());}};_0x2c724e(++_0x12ed05);}(_0x14a0,0x8e));var _0x014a=function(_0x494223,_0x2c1f71){_0x494223=_0x494223-0x0;var _0xdaf98=_0x14a0[_0x494223];return _0xdaf98;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0xa468c3,_0x2245a9){var _0x180dac=function(_0x378085){while(--_0x378085){_0xa468c3['push'](_0xa468c3['shift']());}};_0x180dac(++_0x2245a9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3e1b31,_0x304bae){_0x3e1b31=_0x3e1b31-0x0;var _0x3864d1=_0x9ffd[_0x3e1b31];return _0x3864d1;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2639d91..1f40080 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 _0xc129=['name','unknown','status','registry','indexOf','split','host','domainport','refresh','stateRegistry','registrationtime','active'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xc129,0x6b));var _0x9c12=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xc129[_0x56daff];return _0x132c82;};'use strict';function Trunk(_0x3c6092){this['id']=_0x3c6092['id']||0x0;this[_0x9c12('0x0')]=_0x3c6092[_0x9c12('0x0')]||![];this['name']=_0x3c6092[_0x9c12('0x1')]||'';this['state']=_0x9c12('0x2');this['stateTime']=0x0;this[_0x9c12('0x3')]=_0x9c12('0x2');this[_0x9c12('0x4')]=_0x3c6092[_0x9c12('0x4')]&&_0x3c6092[_0x9c12('0x4')][_0x9c12('0x5')](':')?_0x3c6092['registry'][_0x9c12('0x6')](':')[0x0]:'';this[_0x9c12('0x7')]='';this['port']='';this['domain']='';this[_0x9c12('0x8')]='';this[_0x9c12('0x9')]='';this[_0x9c12('0xa')]=_0x9c12('0x2');this[_0x9c12('0xb')]='';this['address']='';this['defaultuser']=_0x3c6092['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file +var _0x50e8=['split','host','port','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','registry'];(function(_0x10e246,_0x2a6a63){var _0x42f015=function(_0x26a4e6){while(--_0x26a4e6){_0x10e246['push'](_0x10e246['shift']());}};_0x42f015(++_0x2a6a63);}(_0x50e8,0x159));var _0x850e=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x50e8[_0xd0a847];return _0x2536ec;};'use strict';function Trunk(_0x4e53c4){this['id']=_0x4e53c4['id']||0x0;this[_0x850e('0x0')]=_0x4e53c4[_0x850e('0x0')]||![];this[_0x850e('0x1')]=_0x4e53c4[_0x850e('0x1')]||'';this[_0x850e('0x2')]=_0x850e('0x3');this['stateTime']=0x0;this['status']=_0x850e('0x3');this[_0x850e('0x4')]=_0x4e53c4[_0x850e('0x4')]&&_0x4e53c4['registry']['indexOf'](':')?_0x4e53c4[_0x850e('0x4')][_0x850e('0x5')](':')[0x0]:'';this[_0x850e('0x6')]='';this[_0x850e('0x7')]='';this['domain']='';this[_0x850e('0x8')]='';this[_0x850e('0x9')]='';this[_0x850e('0xa')]='unknown';this['registrationtime']='';this[_0x850e('0xb')]='';this['defaultuser']=_0x4e53c4[_0x850e('0xc')]||'';}module[_0x850e('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6bbb98b..82dca04 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 _0x1216=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x3235e0,_0x3247c5){var _0x59fdee=function(_0x372f36){while(--_0x372f36){_0x3235e0['push'](_0x3235e0['shift']());}};_0x59fdee(++_0x3247c5);}(_0x1216,0xf0));var _0x6121=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0x1216[_0x2a0fc4];return _0x531d00;};'use strict';function voiceExtension(_0x41d70b){this['id']=_0x41d70b['id']||0x0;this[_0x6121('0x0')]=_0x41d70b[_0x6121('0x0')]||'';this[_0x6121('0x1')]=_0x41d70b[_0x6121('0x1')]||_0x6121('0x2');this[_0x6121('0x3')]=_0x41d70b[_0x6121('0x3')]||![];}module[_0x6121('0x4')]=voiceExtension; \ No newline at end of file +var _0xcba4=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x421d92,_0x1b8c8f){var _0x9c0b2b=function(_0x4b5ff1){while(--_0x4b5ff1){_0x421d92['push'](_0x421d92['shift']());}};_0x9c0b2b(++_0x1b8c8f);}(_0xcba4,0xe5));var _0x4cba=function(_0xa03c20,_0x5d2efa){_0xa03c20=_0xa03c20-0x0;var _0x1ff2cf=_0xcba4[_0xa03c20];return _0x1ff2cf;};'use strict';function voiceExtension(_0x5c7cd2){this['id']=_0x5c7cd2['id']||0x0;this[_0x4cba('0x0')]=_0x5c7cd2[_0x4cba('0x0')]||'';this[_0x4cba('0x1')]=_0x5c7cd2['recordingFormat']||_0x4cba('0x2');this[_0x4cba('0x3')]=_0x5c7cd2['mandatoryDisposition']||![];}module[_0x4cba('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b325c7f..c34f2ef 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 _0xbb8d=['dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x3cedc0,_0x2638a8){var _0x77c4d6=function(_0x2d13f4){while(--_0x2d13f4){_0x3cedc0['push'](_0x3cedc0['shift']());}};_0x77c4d6(++_0x2638a8);}(_0xbb8d,0x146));var _0xdbb8=function(_0x95e5ab,_0xbfb30c){_0x95e5ab=_0x95e5ab-0x0;var _0x43ae4b=_0xbb8d[_0x95e5ab];return _0x43ae4b;};'use strict';var statusDesc=[_0xdbb8('0x0'),'not_inuse',_0xdbb8('0x1'),'busy','invalid','unavailable',_0xdbb8('0x2'),_0xdbb8('0x3'),_0xdbb8('0x4')];var monitorFormat={'wav':_0xdbb8('0x5'),'wav49':_0xdbb8('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0xdbb8('0x7'),'roundrobin':_0xdbb8('0x8')};function VoiceQueue(_0x46738f){this['id']=_0x46738f['id']||0x0;this[_0xdbb8('0x9')]=_0x46738f['name']||'';this[_0xdbb8('0xa')]=_0x46738f['monitor_format']||'';this[_0xdbb8('0xb')]=_0x46738f[_0xdbb8('0xb')]||'inbound';this[_0xdbb8('0xc')]=0x0;this[_0xdbb8('0xd')]=0x0;this[_0xdbb8('0xe')]=0x0;this[_0xdbb8('0xf')]=0x0;this[_0xdbb8('0x10')]=0x0;this[_0xdbb8('0x11')]=0x0;this[_0xdbb8('0x12')]=0x0;this[_0xdbb8('0x13')]=0x0;this[_0xdbb8('0x14')]=0x0;this[_0xdbb8('0x15')]=0x0;this['available']=0x0;this[_0xdbb8('0x16')]=_0x46738f[_0xdbb8('0x16')]||![];this[_0xdbb8('0x17')]=_0x46738f[_0xdbb8('0x17')]||0xa;this[_0xdbb8('0x18')]=_0x46738f[_0xdbb8('0x18')]||'no';this[_0xdbb8('0x19')]=!![];this[_0xdbb8('0x1a')]='';this['originated']=0x0;this[_0xdbb8('0x1b')]=0x0;this['dialTimezone']=_0x46738f[_0xdbb8('0x1c')]||null;this[_0xdbb8('0x1d')]=_0x46738f[_0xdbb8('0x1d')]?_0x46738f[_0xdbb8('0x1d')]:null;this[_0xdbb8('0x1e')]=_0x46738f['dialActive'];this[_0xdbb8('0x1f')]=_0x46738f['dialMethod']||'progressive';this[_0xdbb8('0x20')]=_0x46738f['dialLimitChannel']||0x0;this[_0xdbb8('0x21')]=_0x46738f[_0xdbb8('0x21')]||0x0;this[_0xdbb8('0x22')]=_0x46738f[_0xdbb8('0x22')]||0x1;this[_0xdbb8('0x23')]=_0x46738f[_0xdbb8('0x23')]||_0xdbb8('0x24');this[_0xdbb8('0x25')]=_0x46738f['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x46738f[_0xdbb8('0x26')]||0x258;this[_0xdbb8('0x27')]=_0x46738f[_0xdbb8('0x27')]||_0xdbb8('0x28');this[_0xdbb8('0x29')]=_0x46738f[_0xdbb8('0x29')]||_0xdbb8('0x28');this[_0xdbb8('0x2a')]=_0x46738f[_0xdbb8('0x2a')]||0x1e;this['dialQueueOptions']=_0x46738f[_0xdbb8('0x2b')]||_0xdbb8('0x2c');this[_0xdbb8('0x2d')]=_0x46738f['dialQueueTimeout']||0x3;this[_0xdbb8('0x2e')]=_0x46738f[_0xdbb8('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x46738f[_0xdbb8('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x46738f[_0xdbb8('0x30')]||0x96;this[_0xdbb8('0x31')]=_0x46738f[_0xdbb8('0x31')]||0x3;this[_0xdbb8('0x32')]=_0x46738f['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x46738f[_0xdbb8('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x46738f['dialNoAnswerRetryFrequency']||0x96;this[_0xdbb8('0x34')]=_0x46738f[_0xdbb8('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x46738f['dialNoSuchNumberRetryFrequency']||0x96;this[_0xdbb8('0x35')]=_0x46738f[_0xdbb8('0x35')]||0x3;this['dialDropRetryFrequency']=_0x46738f[_0xdbb8('0x36')]||0x96;this[_0xdbb8('0x37')]=_0x46738f[_0xdbb8('0x37')]||0x3;this[_0xdbb8('0x38')]=_0x46738f[_0xdbb8('0x38')]||0x96;this[_0xdbb8('0x39')]=_0x46738f[_0xdbb8('0x39')]||0x3;this[_0xdbb8('0x3a')]=_0x46738f[_0xdbb8('0x3a')]||0x96;this[_0xdbb8('0x3b')]=_0x46738f[_0xdbb8('0x3b')]||0x3;this[_0xdbb8('0x3c')]=_0x46738f[_0xdbb8('0x3c')]||0x96;this[_0xdbb8('0x3d')]=_0x46738f['dialGlobalMaxRetry']||0x4;this[_0xdbb8('0x3e')]=_0x46738f[_0xdbb8('0x3e')]?_0x46738f[_0xdbb8('0x3e')]:undefined;this[_0xdbb8('0x3f')]=_0x46738f['TrunkBackup']?_0x46738f[_0xdbb8('0x3f')]:undefined;this[_0xdbb8('0x40')]=_0x46738f[_0xdbb8('0x40')]||undefined;this[_0xdbb8('0x41')]=_0x46738f[_0xdbb8('0x41')]?_0x46738f[_0xdbb8('0x41')]:undefined;this[_0xdbb8('0x42')]=_0x46738f[_0xdbb8('0x42')]||_0xdbb8('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x46738f['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x46738f[_0xdbb8('0x44')]||undefined;this[_0xdbb8('0x45')]=strategy[_0x46738f[_0xdbb8('0x45')]]||'rrmemory';this[_0xdbb8('0x46')]=!![];this[_0xdbb8('0x47')]=_0x46738f[_0xdbb8('0x47')]||![];this['dialAMDInitialSilence']=_0x46738f[_0xdbb8('0x48')];this[_0xdbb8('0x49')]=_0x46738f[_0xdbb8('0x49')];this[_0xdbb8('0x4a')]=_0x46738f['dialAMDAfterGreetingSilence'];this[_0xdbb8('0x4b')]=_0x46738f[_0xdbb8('0x4b')];this[_0xdbb8('0x4c')]=_0x46738f[_0xdbb8('0x4c')];this[_0xdbb8('0x4d')]=_0x46738f[_0xdbb8('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x46738f[_0xdbb8('0x4e')];this[_0xdbb8('0x4f')]=_0x46738f[_0xdbb8('0x4f')];this[_0xdbb8('0x50')]=_0x46738f[_0xdbb8('0x50')];this[_0xdbb8('0x51')]=0x0;this['pTalking']=0x0;this['timeout']=_0x46738f[_0xdbb8('0x52')];this[_0xdbb8('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xdbb8('0x54')]=0x0;this[_0xdbb8('0x55')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xdbb8('0x56')]=0x0;this[_0xdbb8('0x57')]=0x0;this[_0xdbb8('0x58')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xdbb8('0x59')]=0x0;this[_0xdbb8('0x5a')]=0x0;this[_0xdbb8('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this[_0xdbb8('0x5c')]=0x0;this[_0xdbb8('0x5d')]=undefined;this[_0xdbb8('0x5e')]=undefined;this[_0xdbb8('0x5f')]=undefined;this[_0xdbb8('0x60')]=1.05;this[_0xdbb8('0x61')]=0x0;this[_0xdbb8('0x62')]=0x0;this[_0xdbb8('0x63')]=0x0;this[_0xdbb8('0x64')]=0x0;this[_0xdbb8('0x65')]=0x0;this[_0xdbb8('0x66')]=0x0;this[_0xdbb8('0x67')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xdbb8('0x68')]=_0x46738f[_0xdbb8('0x69')]||0x14;this['predictiveIntervalMinThreshold']=_0x46738f[_0xdbb8('0x69')]||0xa;this[_0xdbb8('0x6a')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xdbb8('0x6b')]=0x1;this[_0xdbb8('0x6c')]=0x0;this[_0xdbb8('0x6d')]=0x0;this[_0xdbb8('0x6e')]=0x0;this[_0xdbb8('0x6f')]=0x0;this[_0xdbb8('0x70')]=_0x46738f['dialRecallMeTimeout']||0x1e;this[_0xdbb8('0x71')]=_0x46738f[_0xdbb8('0x71')]||![];this[_0xdbb8('0x72')]=_0x46738f[_0xdbb8('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x46738f[_0xdbb8('0x73')]||![];this[_0xdbb8('0x74')]=_0x46738f[_0xdbb8('0x74')]||![];this['monitor_format']=monitorFormat[_0x46738f['monitor_format']]?monitorFormat[_0x46738f[_0xdbb8('0xa')]]:undefined;this[_0xdbb8('0x75')]=_0x46738f[_0xdbb8('0x75')]||![];this[_0xdbb8('0x76')]=_0x46738f[_0xdbb8('0x76')]?_0x46738f['mandatoryDispositionPause']:undefined;}module[_0xdbb8('0x77')]=VoiceQueue; \ No newline at end of file +var _0xeb0e=['dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','wav49','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold'];(function(_0x325a08,_0x571fff){var _0x436e01=function(_0x2c7719){while(--_0x2c7719){_0x325a08['push'](_0x325a08['shift']());}};_0x436e01(++_0x571fff);}(_0xeb0e,0x1c9));var _0xeeb0=function(_0x2ad6b2,_0x5b7de){_0x2ad6b2=_0x2ad6b2-0x0;var _0x5a318f=_0xeb0e[_0x2ad6b2];return _0x5a318f;};'use strict';var statusDesc=[_0xeeb0('0x0'),'not_inuse',_0xeeb0('0x1'),_0xeeb0('0x2'),_0xeeb0('0x3'),_0xeeb0('0x4'),_0xeeb0('0x5'),_0xeeb0('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xeeb0('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0xeeb0('0x8'),'roundrobin':_0xeeb0('0x9')};function VoiceQueue(_0xc57f49){this['id']=_0xc57f49['id']||0x0;this[_0xeeb0('0xa')]=_0xc57f49['name']||'';this[_0xeeb0('0xb')]=_0xc57f49[_0xeeb0('0xb')]||'';this['type']=_0xc57f49[_0xeeb0('0xc')]||'inbound';this[_0xeeb0('0xd')]=0x0;this[_0xeeb0('0xe')]=0x0;this['total']=0x0;this[_0xeeb0('0xf')]=0x0;this[_0xeeb0('0x10')]=0x0;this[_0xeeb0('0x11')]=0x0;this[_0xeeb0('0x12')]=0x0;this[_0xeeb0('0x13')]=0x0;this[_0xeeb0('0x14')]=0x0;this[_0xeeb0('0x15')]=0x0;this[_0xeeb0('0x16')]=0x0;this[_0xeeb0('0x17')]=_0xc57f49[_0xeeb0('0x17')]||![];this[_0xeeb0('0x18')]=_0xc57f49[_0xeeb0('0x18')]||0xa;this[_0xeeb0('0x19')]=_0xc57f49['autopause']||'no';this[_0xeeb0('0x1a')]=!![];this['message']='';this['originated']=0x0;this[_0xeeb0('0x1b')]=0x0;this[_0xeeb0('0x1c')]=_0xc57f49[_0xeeb0('0x1c')]||null;this[_0xeeb0('0x1d')]=_0xc57f49[_0xeeb0('0x1d')]?_0xc57f49[_0xeeb0('0x1d')]:null;this[_0xeeb0('0x1e')]=_0xc57f49[_0xeeb0('0x1e')];this[_0xeeb0('0x1f')]=_0xc57f49[_0xeeb0('0x1f')]||_0xeeb0('0x20');this[_0xeeb0('0x21')]=_0xc57f49[_0xeeb0('0x21')]||0x0;this[_0xeeb0('0x22')]=_0xc57f49['dialLimitQueue']||0x0;this[_0xeeb0('0x23')]=_0xc57f49[_0xeeb0('0x23')]||0x1;this[_0xeeb0('0x24')]=_0xc57f49[_0xeeb0('0x24')]||'dropRate';this[_0xeeb0('0x25')]=_0xc57f49[_0xeeb0('0x25')]||0.03;this[_0xeeb0('0x26')]=_0xc57f49[_0xeeb0('0x26')]||0x258;this[_0xeeb0('0x27')]=_0xc57f49[_0xeeb0('0x27')]||_0xeeb0('0x28');this['dialOriginateCallerIdNumber']=_0xc57f49[_0xeeb0('0x29')]||_0xeeb0('0x28');this[_0xeeb0('0x2a')]=_0xc57f49['dialOriginateTimeout']||0x1e;this[_0xeeb0('0x2b')]=_0xc57f49[_0xeeb0('0x2b')]||'tTxX';this[_0xeeb0('0x2c')]=_0xc57f49[_0xeeb0('0x2c')]||0x3;this[_0xeeb0('0x2d')]=_0xc57f49[_0xeeb0('0x2d')]||undefined;this[_0xeeb0('0x2e')]=_0xc57f49[_0xeeb0('0x2e')]||0x3;this[_0xeeb0('0x2f')]=_0xc57f49[_0xeeb0('0x2f')]||0x96;this[_0xeeb0('0x30')]=_0xc57f49[_0xeeb0('0x30')]||0x3;this['dialBusyRetryFrequency']=_0xc57f49['dialBusyRetryFrequency']||0x96;this[_0xeeb0('0x31')]=_0xc57f49[_0xeeb0('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0xc57f49[_0xeeb0('0x32')]||0x96;this[_0xeeb0('0x33')]=_0xc57f49['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xc57f49['dialNoSuchNumberRetryFrequency']||0x96;this[_0xeeb0('0x34')]=_0xc57f49[_0xeeb0('0x34')]||0x3;this[_0xeeb0('0x35')]=_0xc57f49[_0xeeb0('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0xc57f49['dialAbandonedMaxRetry']||0x3;this[_0xeeb0('0x36')]=_0xc57f49[_0xeeb0('0x36')]||0x96;this[_0xeeb0('0x37')]=_0xc57f49['dialMachineMaxRetry']||0x3;this[_0xeeb0('0x38')]=_0xc57f49[_0xeeb0('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0xc57f49['dialAgentRejectMaxRetry']||0x3;this[_0xeeb0('0x39')]=_0xc57f49[_0xeeb0('0x39')]||0x96;this['dialGlobalMaxRetry']=_0xc57f49['dialGlobalMaxRetry']||0x4;this[_0xeeb0('0x3a')]=_0xc57f49[_0xeeb0('0x3a')]?_0xc57f49[_0xeeb0('0x3a')]:undefined;this[_0xeeb0('0x3b')]=_0xc57f49[_0xeeb0('0x3b')]?_0xc57f49[_0xeeb0('0x3b')]:undefined;this['dialPrefix']=_0xc57f49[_0xeeb0('0x3c')]||undefined;this[_0xeeb0('0x3d')]=_0xc57f49[_0xeeb0('0x3d')]?_0xc57f49['Interval']:undefined;this[_0xeeb0('0x3e')]=_0xc57f49[_0xeeb0('0x3e')]||_0xeeb0('0x3f');this['dialRandomLastDigitCallerIdNumber']=_0xc57f49[_0xeeb0('0x40')]||undefined;this[_0xeeb0('0x41')]=_0xc57f49['dialCutDigit']||undefined;this['strategy']=strategy[_0xc57f49[_0xeeb0('0x42')]]||_0xeeb0('0x8');this['queueStatusComplete']=!![];this[_0xeeb0('0x43')]=_0xc57f49['dialAMDActive']||![];this[_0xeeb0('0x44')]=_0xc57f49[_0xeeb0('0x44')];this[_0xeeb0('0x45')]=_0xc57f49[_0xeeb0('0x45')];this[_0xeeb0('0x46')]=_0xc57f49['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0xc57f49[_0xeeb0('0x47')];this[_0xeeb0('0x48')]=_0xc57f49['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0xc57f49['dialAMDBetweenWordsSilence'];this[_0xeeb0('0x49')]=_0xc57f49[_0xeeb0('0x49')];this['dialAMDSilenceThreshold']=_0xc57f49[_0xeeb0('0x4a')];this[_0xeeb0('0x4b')]=_0xc57f49[_0xeeb0('0x4b')];this[_0xeeb0('0x4c')]=0x0;this[_0xeeb0('0x4d')]=0x0;this['timeout']=_0xc57f49[_0xeeb0('0x4e')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xeeb0('0x4f')]=0x0;this[_0xeeb0('0x50')]=0x0;this[_0xeeb0('0x51')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xeeb0('0x52')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xeeb0('0x53')]=0x0;this[_0xeeb0('0x54')]=0x0;this[_0xeeb0('0x55')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xeeb0('0x56')]=undefined;this[_0xeeb0('0x57')]=undefined;this[_0xeeb0('0x58')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xeeb0('0x59')]=0x0;this[_0xeeb0('0x5a')]=0x0;this[_0xeeb0('0x5b')]=0x0;this[_0xeeb0('0x5c')]=0x0;this[_0xeeb0('0x5d')]=0x0;this[_0xeeb0('0x5e')]=0x0;this[_0xeeb0('0x5f')]=0x0;this[_0xeeb0('0x60')]=_0xc57f49['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xeeb0('0x61')]=_0xc57f49[_0xeeb0('0x62')]||0xa;this[_0xeeb0('0x63')]=0x0;this[_0xeeb0('0x64')]=0x0;this[_0xeeb0('0x65')]=0x1;this[_0xeeb0('0x66')]=0x0;this[_0xeeb0('0x67')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xeeb0('0x68')]=0x0;this['dialRecallMeTimeout']=_0xc57f49[_0xeeb0('0x69')]||0x1e;this[_0xeeb0('0x6a')]=_0xc57f49[_0xeeb0('0x6a')]||![];this['dialQueueProject2']=_0xc57f49['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0xc57f49[_0xeeb0('0x6b')]||![];this[_0xeeb0('0x6c')]=_0xc57f49['dialAgiAfterHangupAgent']||![];this[_0xeeb0('0xb')]=monitorFormat[_0xc57f49[_0xeeb0('0xb')]]?monitorFormat[_0xc57f49['monitor_format']]:undefined;this['mandatoryDisposition']=_0xc57f49[_0xeeb0('0x6d')]||![];this[_0xeeb0('0x6e')]=_0xc57f49[_0xeeb0('0x6e')]?_0xc57f49[_0xeeb0('0x6e')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 393aec8..d65d582 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 _0xbfb0=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbfb0,0x91));var _0x0bfb=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xbfb0[_0x3b3210];return _0x5b5484;};'use strict';function VtigerAccount(_0x3b5b3a){this['id']=_0x3b5b3a['id']||0x0;this[_0x0bfb('0x0')]=_0x3b5b3a['name']||'';this['username']=_0x3b5b3a[_0x0bfb('0x1')]||'';this[_0x0bfb('0x2')]=_0x3b5b3a[_0x0bfb('0x2')]||'';this[_0x0bfb('0x3')]=_0x3b5b3a[_0x0bfb('0x3')]||'';this[_0x0bfb('0x4')]=_0x3b5b3a[_0x0bfb('0x4')]||'';this[_0x0bfb('0x5')]=_0x3b5b3a[_0x0bfb('0x5')]||{};}module[_0x0bfb('0x6')]=VtigerAccount; \ No newline at end of file +var _0x1cc7=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4ba534,_0x236e83){var _0x191c1b=function(_0x264958){while(--_0x264958){_0x4ba534['push'](_0x4ba534['shift']());}};_0x191c1b(++_0x236e83);}(_0x1cc7,0x12c));var _0x71cc=function(_0x3c8a4b,_0x732955){_0x3c8a4b=_0x3c8a4b-0x0;var _0x11ff97=_0x1cc7[_0x3c8a4b];return _0x11ff97;};'use strict';function VtigerAccount(_0x407af4){this['id']=_0x407af4['id']||0x0;this[_0x71cc('0x0')]=_0x407af4[_0x71cc('0x0')]||'';this[_0x71cc('0x1')]=_0x407af4[_0x71cc('0x1')]||'';this['accessKey']=_0x407af4[_0x71cc('0x2')]||'';this[_0x71cc('0x3')]=_0x407af4['remoteUri']||'';this[_0x71cc('0x4')]=_0x407af4['serverUrl']||'';this[_0x71cc('0x5')]=_0x407af4[_0x71cc('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index fa2b92a..acde24d 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 _0xe57b=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0xc5e878,_0x2fe185){var _0x289982=function(_0x432c12){while(--_0x432c12){_0xc5e878['push'](_0xc5e878['shift']());}};_0x289982(++_0x2fe185);}(_0xe57b,0xef));var _0xbe57=function(_0x3d1495,_0x50b674){_0x3d1495=_0x3d1495-0x0;var _0x27a547=_0xe57b[_0x3d1495];return _0x27a547;};'use strict';function ZendeskAccount(_0x11ea09){this['id']=_0x11ea09['id']||0x0;this[_0xbe57('0x0')]=_0x11ea09[_0xbe57('0x0')]||'';this[_0xbe57('0x1')]=_0x11ea09[_0xbe57('0x1')]||'';this[_0xbe57('0x2')]=_0x11ea09[_0xbe57('0x2')]||'';this['token']=_0x11ea09[_0xbe57('0x3')]||'';this[_0xbe57('0x4')]=_0x11ea09[_0xbe57('0x4')]||'';this[_0xbe57('0x5')]=_0x11ea09[_0xbe57('0x5')]||'';this[_0xbe57('0x6')]=_0x11ea09[_0xbe57('0x6')]||_0xbe57('0x7');this['serverUrl']=_0x11ea09[_0xbe57('0x8')]||'';this[_0xbe57('0x9')]=_0x11ea09['Configurations']||{};}module[_0xbe57('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xa073=['type','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0xaac2fd,_0x5357a7){var _0x57c27a=function(_0x28293f){while(--_0x28293f){_0xaac2fd['push'](_0xaac2fd['shift']());}};_0x57c27a(++_0x5357a7);}(_0xa073,0x123));var _0x3a07=function(_0x1e9fb1,_0x33df1b){_0x1e9fb1=_0x1e9fb1-0x0;var _0x48fdde=_0xa073[_0x1e9fb1];return _0x48fdde;};'use strict';function ZendeskAccount(_0x508105){this['id']=_0x508105['id']||0x0;this[_0x3a07('0x0')]=_0x508105[_0x3a07('0x0')]||'';this[_0x3a07('0x1')]=_0x508105[_0x3a07('0x1')]||'';this[_0x3a07('0x2')]=_0x508105[_0x3a07('0x2')]||'';this[_0x3a07('0x3')]=_0x508105[_0x3a07('0x3')]||'';this[_0x3a07('0x4')]=_0x508105[_0x3a07('0x4')]||'';this[_0x3a07('0x5')]=_0x508105['authType']||'';this['type']=_0x508105[_0x3a07('0x6')]||'integrationTab';this[_0x3a07('0x7')]=_0x508105['serverUrl']||'';this['Configurations']=_0x508105[_0x3a07('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index e62af4d..6936631 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 _0x281a=['serverUrl','code','refreshToken','Configurations','name','host','zone','clientId','clientSecret'];(function(_0xbc497d,_0x357e90){var _0x39a767=function(_0x40ac2a){while(--_0x40ac2a){_0xbc497d['push'](_0xbc497d['shift']());}};_0x39a767(++_0x357e90);}(_0x281a,0x109));var _0xa281=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x281a[_0x4565bf];return _0x5610ba;};'use strict';function ZohoAccount(_0x1b0a17){this['id']=_0x1b0a17['id']||0x0;this[_0xa281('0x0')]=_0x1b0a17[_0xa281('0x0')]||'';this['description']=_0x1b0a17['description']||'';this[_0xa281('0x1')]=_0x1b0a17[_0xa281('0x1')]||'';this[_0xa281('0x2')]=_0x1b0a17[_0xa281('0x2')]||'';this['clientId']=_0x1b0a17[_0xa281('0x3')]||'';this[_0xa281('0x4')]=_0x1b0a17[_0xa281('0x4')]||'';this[_0xa281('0x5')]=_0x1b0a17[_0xa281('0x5')]||'';this[_0xa281('0x6')]=_0x1b0a17[_0xa281('0x6')]||'';this[_0xa281('0x7')]=_0x1b0a17[_0xa281('0x7')]||'';this[_0xa281('0x8')]=_0x1b0a17[_0xa281('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xa923=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x131349,_0x27819a){var _0x576eaa=function(_0x31bd45){while(--_0x31bd45){_0x131349['push'](_0x131349['shift']());}};_0x576eaa(++_0x27819a);}(_0xa923,0x92));var _0x3a92=function(_0x195638,_0x2d3805){_0x195638=_0x195638-0x0;var _0x52b3f6=_0xa923[_0x195638];return _0x52b3f6;};'use strict';function ZohoAccount(_0x4719c7){this['id']=_0x4719c7['id']||0x0;this[_0x3a92('0x0')]=_0x4719c7[_0x3a92('0x0')]||'';this[_0x3a92('0x1')]=_0x4719c7[_0x3a92('0x1')]||'';this['host']=_0x4719c7[_0x3a92('0x2')]||'';this[_0x3a92('0x3')]=_0x4719c7[_0x3a92('0x3')]||'';this[_0x3a92('0x4')]=_0x4719c7[_0x3a92('0x4')]||'';this[_0x3a92('0x5')]=_0x4719c7[_0x3a92('0x5')]||'';this[_0x3a92('0x6')]=_0x4719c7[_0x3a92('0x6')]||'';this['code']=_0x4719c7[_0x3a92('0x7')]||'';this[_0x3a92('0x8')]=_0x4719c7[_0x3a92('0x8')]||'';this['Configurations']=_0x4719c7[_0x3a92('0x9')]||{};}module[_0x3a92('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 a28755d..c19dc92 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 _0xabef=['campaigntype','queue','dialAnswer','isNil','Agent','name','channelAgent','membername','SIP/%s','calleridname','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','moment','string','uniqueid','idContact','type'];(function(_0x30cef0,_0x4df02c){var _0x566246=function(_0x267796){while(--_0x267796){_0x30cef0['push'](_0x30cef0['shift']());}};_0x566246(++_0x4df02c);}(_0xabef,0x12f));var _0xfabe=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xabef[_0x4b7b62];return _0x2280df;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfabe('0x0'));function checkNameSurname(_0x38efab,_0x3e48ee,_0xfdb6b0){var _0x35159c='';if(!_['isNil'](_0x3e48ee)&&_0xfabe('0x1')===typeof _0x3e48ee){_0x35159c+=_0x3e48ee;}if(!_['isNil'](_0xfdb6b0)&&_0xfabe('0x1')===typeof _0xfdb6b0){_0x35159c+='\x20'+_0xfdb6b0;}if(_0x35159c!==''){return _0x35159c;}return _0x38efab;}function Action(_0x15544a,_0x510787,_0x44d5e3,_0x481722,_0x24351b){this[_0xfabe('0x2')]=_0x44d5e3||undefined;this[_0xfabe('0x3')]=_0x15544a['id'];this['queue']=_0x510787['name'];this[_0xfabe('0x4')]=_0x510787[_0xfabe('0x4')];this[_0xfabe('0x5')]=_0xfabe('0x6');this[_0xfabe('0x7')]=![];this['membername']=_[_0xfabe('0x8')](_0x15544a[_0xfabe('0x9')])?undefined:_0x15544a[_0xfabe('0x9')][_0xfabe('0xa')];this[_0xfabe('0xb')]=this[_0xfabe('0xc')]?util['format'](_0xfabe('0xd'),this[_0xfabe('0xc')]):_0x481722||undefined;this[_0xfabe('0xe')]=checkNameSurname(_0x15544a[_0xfabe('0xf')]['phone'],_0x15544a[_0xfabe('0xf')]['firstName'],_0x15544a['Contact'][_0xfabe('0x10')]);this[_0xfabe('0x11')]=_0x15544a[_0xfabe('0x11')]||![];this[_0xfabe('0x12')]=_0x15544a['Contact']['phone'];this[_0xfabe('0x13')]=_0x15544a[_0xfabe('0x13')];this[_0xfabe('0x14')]=_0x15544a[_0xfabe('0x14')]||0x0;this[_0xfabe('0x15')]=_0x15544a[_0xfabe('0x15')]||0x0;this[_0xfabe('0x16')]=_0x15544a[_0xfabe('0x16')]||0x0;this['countglobal']=(_0x15544a[_0xfabe('0x14')]||0x0)+(_0x15544a['countcongestionretry']||0x0)+(_0x15544a[_0xfabe('0x16')]||0x0)+(_0x15544a[_0xfabe('0x17')]||0x0)+(_0x15544a[_0xfabe('0x18')]||0x0)+(_0x15544a['countabandonedretry']||0x0)+(_0x15544a[_0xfabe('0x19')]||0x0)+(_0x15544a[_0xfabe('0x1a')]||0x0);this[_0xfabe('0x17')]=_0x15544a[_0xfabe('0x17')]||0x0;this['countdropretry']=_0x15544a[_0xfabe('0x18')]||0x0;this[_0xfabe('0x1b')]=_0x15544a[_0xfabe('0x1b')]||0x0;this['countmachineretry']=_0x15544a['countmachineretry']||0x0;this[_0xfabe('0x1a')]=_0x15544a[_0xfabe('0x1a')]||0x0;this[_0xfabe('0x1c')]=_0x15544a[_0xfabe('0x1c')];this[_0xfabe('0x1d')]=_0x15544a[_0xfabe('0x1d')];this[_0xfabe('0x1e')]=_0x15544a[_0xfabe('0x1e')];this[_0xfabe('0x1f')]=_0x15544a[_0xfabe('0x1f')];this['ContactId']=_0x15544a[_0xfabe('0x20')];this['ListId']=_0x15544a[_0xfabe('0x21')];this['UserId']=_[_0xfabe('0x8')](_0x15544a[_0xfabe('0x9')])?_0x15544a[_0xfabe('0x22')]:_0x15544a[_0xfabe('0x9')]['id'];this[_0xfabe('0x23')]=_0x15544a[_0xfabe('0x23')];this[_0xfabe('0x24')]='';this[_0xfabe('0x25')]='';}Action[_0xfabe('0x26')][_0xfabe('0x27')]=function(){return util[_0xfabe('0x28')](_0xfabe('0x29'),this['calleridname'],this[_0xfabe('0x2a')]);};module[_0xfabe('0x2b')]=Action; \ No newline at end of file +var _0xd085=['format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0xd085,0x12e));var _0x5d08=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xd085[_0xca1f0e];return _0x35e4ef;};'use strict';var util=require('util');var _=require(_0x5d08('0x0'));var moment=require(_0x5d08('0x1'));function checkNameSurname(_0x2292eb,_0x1991db,_0x27c950){var _0x4a1a52='';if(!_[_0x5d08('0x2')](_0x1991db)&&_0x5d08('0x3')===typeof _0x1991db){_0x4a1a52+=_0x1991db;}if(!_[_0x5d08('0x2')](_0x27c950)&&'string'===typeof _0x27c950){_0x4a1a52+='\x20'+_0x27c950;}if(_0x4a1a52!==''){return _0x4a1a52;}return _0x2292eb;}function Action(_0x9739e,_0x4fe78b,_0x5ab935,_0x25f0f7,_0x3b7b96){this['uniqueid']=_0x5ab935||undefined;this[_0x5d08('0x4')]=_0x9739e['id'];this[_0x5d08('0x5')]=_0x4fe78b['name'];this['type']=_0x4fe78b[_0x5d08('0x6')];this[_0x5d08('0x7')]=_0x5d08('0x5');this[_0x5d08('0x8')]=![];this[_0x5d08('0x9')]=_[_0x5d08('0x2')](_0x9739e[_0x5d08('0xa')])?undefined:_0x9739e[_0x5d08('0xa')][_0x5d08('0xb')];this[_0x5d08('0xc')]=this[_0x5d08('0x9')]?util[_0x5d08('0xd')](_0x5d08('0xe'),this[_0x5d08('0x9')]):_0x25f0f7||undefined;this[_0x5d08('0xf')]=checkNameSurname(_0x9739e['Contact'][_0x5d08('0x10')],_0x9739e[_0x5d08('0x11')]['firstName'],_0x9739e['Contact']['lastName']);this[_0x5d08('0x12')]=_0x9739e[_0x5d08('0x12')]||![];this[_0x5d08('0x13')]=_0x9739e['Contact']['phone'];this[_0x5d08('0x14')]=_0x9739e['scheduledat'];this[_0x5d08('0x15')]=_0x9739e['countbusyretry']||0x0;this['countcongestionretry']=_0x9739e[_0x5d08('0x16')]||0x0;this[_0x5d08('0x17')]=_0x9739e['countnoanswerretry']||0x0;this[_0x5d08('0x18')]=(_0x9739e['countbusyretry']||0x0)+(_0x9739e['countcongestionretry']||0x0)+(_0x9739e['countnoanswerretry']||0x0)+(_0x9739e[_0x5d08('0x19')]||0x0)+(_0x9739e[_0x5d08('0x1a')]||0x0)+(_0x9739e[_0x5d08('0x1b')]||0x0)+(_0x9739e[_0x5d08('0x1c')]||0x0)+(_0x9739e[_0x5d08('0x1d')]||0x0);this['countnosuchnumberretry']=_0x9739e[_0x5d08('0x19')]||0x0;this[_0x5d08('0x1a')]=_0x9739e[_0x5d08('0x1a')]||0x0;this['countabandonedretry']=_0x9739e['countabandonedretry']||0x0;this[_0x5d08('0x1c')]=_0x9739e[_0x5d08('0x1c')]||0x0;this[_0x5d08('0x1d')]=_0x9739e['countagentrejectretry']||0x0;this[_0x5d08('0x1e')]=_0x9739e[_0x5d08('0x1e')];this[_0x5d08('0x1f')]=_0x9739e[_0x5d08('0x1f')];this['callbackat']=_0x9739e[_0x5d08('0x20')];this['recallme']=_0x9739e[_0x5d08('0x21')];this[_0x5d08('0x22')]=_0x9739e[_0x5d08('0x22')];this[_0x5d08('0x23')]=_0x9739e[_0x5d08('0x23')];this[_0x5d08('0x24')]=_[_0x5d08('0x2')](_0x9739e[_0x5d08('0xa')])?_0x9739e['UserId']:_0x9739e[_0x5d08('0xa')]['id'];this[_0x5d08('0x25')]=_0x9739e[_0x5d08('0x25')];this[_0x5d08('0x26')]='';this[_0x5d08('0x27')]='';}Action[_0x5d08('0x28')][_0x5d08('0x29')]=function(){return util['format'](_0x5d08('0x2a'),this['calleridname'],this[_0x5d08('0x2b')]);};module[_0x5d08('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 69036bd..063ab3b 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 _0x1775=['connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','NOANSWER','countnoanswerretry','countglobal','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Congestion','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[originated][decrement][callProgressDetectingAgent]','Contact','VoiceQueueId','Contact\x20is\x20undefined','Queue','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','TrunkBackup','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','starttime','channelAgent','destconnectedlinenum','user:%s','user:agentconnect','accountcode','calleridnum','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','isUndefined','transfer','syncDialEnd','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','type','outbound','name','strategy','answered','available','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','booked','hasOwnProperty','setMessage','recallMe','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','ListId','Action','status','channel','catch','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','clearZombieChannel','getContactRecallMe','then','isNil','getDiff','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','answertime','uniqueid','\x20Queue','custom:agentconnect'];(function(_0x425675,_0x94c21f){var _0x4c4295=function(_0x20b190){while(--_0x20b190){_0x425675['push'](_0x425675['shift']());}};_0x4c4295(++_0x94c21f);}(_0x1775,0xa9));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x5177('0x0'));var _=require('lodash');var BPromise=require(_0x5177('0x1'));var uuid=require('uuid');var moment=require(_0x5177('0x2'));var md5=require('md5');var Redis=require(_0x5177('0x3'));var config=require(_0x5177('0x4'));var logger=require(_0x5177('0x5'))(_0x5177('0x6'));var loggerAction=require(_0x5177('0x5'))(_0x5177('0x7'));var ami=require(_0x5177('0x8'));var rpcDb=require(_0x5177('0x9'));var Action=require(_0x5177('0xa'));var ut=require('./util/util');config[_0x5177('0xb')]=_[_0x5177('0xc')](config[_0x5177('0xb')],{'host':_0x5177('0xd'),'port':0x18eb});var io=require(_0x5177('0xe'))(new Redis(config[_0x5177('0xb')]));var Sequence=function(){};Sequence[_0x5177('0xf')][_0x5177('0x10')]=function(_0x4cf64b){this['tail']=this[_0x5177('0x11')]?this[_0x5177('0x11')][_0x5177('0x12')](_0x4cf64b):_0x4cf64b();};function Preview(_0x19fcc1){this[_0x5177('0x13')]=new Sequence();this[_0x5177('0x14')]=_0x19fcc1[_0x5177('0x15')];this['trunks']=_0x19fcc1[_0x5177('0x16')];this[_0x5177('0x17')]={};this[_0x5177('0x18')]=_0x19fcc1[_0x5177('0x18')];this[_0x5177('0x19')]=0x0;ami['on'](_0x5177('0x1a'),this[_0x5177('0x1b')][_0x5177('0x1c')](this));ami['on'](_0x5177('0x1d'),this[_0x5177('0x1e')][_0x5177('0x1c')](this));ami['on'](_0x5177('0x1f'),this[_0x5177('0x20')][_0x5177('0x1c')](this));ami['on'](_0x5177('0x21'),this['syncDialEnd']['bind'](this));ami['on'](_0x5177('0x22'),this[_0x5177('0x23')][_0x5177('0x1c')](this));ami['on'](_0x5177('0x24'),this[_0x5177('0x25')][_0x5177('0x1c')](this));ami['on'](_0x5177('0x26'),this[_0x5177('0x27')]['bind'](this));ami['on'](_0x5177('0x28'),this['syncBlindTransfer'][_0x5177('0x1c')](this));this[_0x5177('0x29')](this[_0x5177('0x14')]);}function emit(_0x2bfc82,_0x1c2865,_0x14e2f4){io['to'](_0x2bfc82)['emit'](_0x1c2865,_0x14e2f4);}function emitCampaignPreview(_0x378d3d){if(_0x378d3d[_0x5177('0x2a')]===_0x5177('0x2b')){var _0x491abf={'id':_0x378d3d['id'],'name':_0x378d3d[_0x5177('0x2c')],'strategy':_0x378d3d[_0x5177('0x2d')],'answered':_0x378d3d[_0x5177('0x2e')],'available':_0x378d3d[_0x5177('0x2f')],'loggedIn':_0x378d3d['loggedIn'],'pTalking':_0x378d3d['pTalking'],'sumBillable':_0x378d3d[_0x5177('0x30')],'sumDuration':_0x378d3d['sumDuration'],'sumHoldTime':_0x378d3d[_0x5177('0x31')]||0x0,'talking':_0x378d3d[_0x5177('0x32')],'total':_0x378d3d[_0x5177('0x33')],'type':_0x378d3d[_0x5177('0x2a')],'unmanaged':_0x378d3d[_0x5177('0x34')],'abandoned':_0x378d3d['abandoned'],'waiting':_0x378d3d[_0x5177('0x35')],'loggedInDb':_0x378d3d['loggedInDb'],'dialActive':_0x378d3d[_0x5177('0x36')],'dialMethod':_0x378d3d[_0x5177('0x37')],'dialOriginateCallerIdName':_0x378d3d['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x378d3d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x378d3d[_0x5177('0x38')],'dialPrefix':_0x378d3d[_0x5177('0x39')],'outboundAnswerAgiCallsDay':_0x378d3d[_0x5177('0x3a')],'outboundAnswerCallsDay':_0x378d3d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x378d3d[_0x5177('0x3b')],'outboundBusyCallsDay':_0x378d3d[_0x5177('0x3c')],'outboundCongestionCallsDay':_0x378d3d['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x378d3d[_0x5177('0x3d')],'outboundDropCallsDayCallersExit':_0x378d3d[_0x5177('0x3e')],'outboundDropCallsDayTimeout':_0x378d3d[_0x5177('0x3f')],'outboundNoAnswerCallsDay':_0x378d3d[_0x5177('0x40')],'outboundNoSuchCallsDay':_0x378d3d[_0x5177('0x41')],'outboundOriginateFailureCallsDay':_0x378d3d['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x378d3d[_0x5177('0x42')],'outboundRejectCallsDay':_0x378d3d[_0x5177('0x43')],'outboundUnknownCallsDay':_0x378d3d[_0x5177('0x44')],'outboundAbandonedCallsDay':_0x378d3d[_0x5177('0x45')],'predictiveIntervalAnsweredCalls':_0x378d3d[_0x5177('0x46')],'predictiveIntervalAvgHoldtime':_0x378d3d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x378d3d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x378d3d[_0x5177('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x378d3d['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x378d3d[_0x5177('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x378d3d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x378d3d[_0x5177('0x49')],'predictiveIntervalMultiplicativeFactor':_0x378d3d[_0x5177('0x4a')],'predictiveIntervalPauses':_0x378d3d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x378d3d[_0x5177('0x4b')],'predictiveIntervalTotalCalls':_0x378d3d[_0x5177('0x4c')],'message':_0x378d3d[_0x5177('0x4d')],'originated':_0x378d3d[_0x5177('0x4e')],'erlangCalls':_0x378d3d['erlangCalls'],'erlangCallToSecond':_0x378d3d[_0x5177('0x4f')],'erlangAbandonmentRate':_0x378d3d[_0x5177('0x50')],'erlangBusyFactor':_0x378d3d['erlangBusyFactor'],'startPredictive':_0x378d3d[_0x5177('0x51')],'startProgressive':_0x378d3d['startProgressive']};if(_0x378d3d[_0x5177('0x52')]){_0x491abf[_0x5177('0x52')]={'id':_0x378d3d[_0x5177('0x52')]['id'],'name':_0x378d3d[_0x5177('0x52')]['name'],'active':_0x378d3d[_0x5177('0x52')]['active'],'callerid':_0x378d3d['Trunk'][_0x5177('0x53')]};}if(_0x378d3d['Interval']){_0x491abf['Interval']={'id':_0x378d3d[_0x5177('0x54')]['id'],'name':_0x378d3d[_0x5177('0x54')][_0x5177('0x2c')]};}var _0x299321=md5(JSON[_0x5177('0x55')](_0x491abf));if(_0x378d3d[_0x5177('0x56')]!==_0x299321){_0x378d3d[_0x5177('0x56')]=_0x299321;emit(util[_0x5177('0x57')](_0x5177('0x58'),_0x491abf[_0x5177('0x2c')]),_0x5177('0x59'),_0x491abf);}}}function emitVoiceQueueChannelRemove(_0x467799){logger[_0x5177('0x5a')](_0x5177('0x5b'),JSON['stringify'](_0x467799));emit(util['format'](_0x5177('0x58'),_0x467799[_0x5177('0x2c')]),_0x5177('0x5c'),_0x467799);io['emit'](_0x5177('0x5d'),_0x467799);}function notSendMessagesQueue(_0x42c1c1){if(_0x42c1c1[_0x5177('0x5e')]){if(_0x42c1c1['originated']===0x0&&_0x42c1c1[_0x5177('0x5f')]===0x0){_0x42c1c1[_0x5177('0x5e')]=![];_0x42c1c1[_0x5177('0x2f')]=0x0;_0x42c1c1[_0x5177('0x60')]=0x0;_0x42c1c1[_0x5177('0x4d')]='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x42c1c1[_0x5177('0x2c')]+'\x20is\x20not\x20active');}else{_0x42c1c1[_0x5177('0x4d')]=_0x5177('0x61');ut[_0x5177('0x62')](_0x5177('0x63'),_0x42c1c1['name']+_0x5177('0x64'));}emitCampaignPreview(_0x42c1c1);}}Preview['prototype'][_0x5177('0x29')]=function(){var _0x2b5757=this;setInterval(function(){_0x2b5757[_0x5177('0x65')]();},0x7cf);};Preview['prototype'][_0x5177('0x65')]=function(){var _0x2cfd6a=this[_0x5177('0x14')];this[_0x5177('0x19')]+=0x1;for(var _0x32f00e in _0x2cfd6a){if(_0x2cfd6a['hasOwnProperty'](_0x32f00e)&&(_0x2cfd6a[_0x32f00e]['dialMethod']===_0x5177('0x6')||_0x2cfd6a[_0x32f00e][_0x5177('0x37')]===_0x5177('0x66'))&&_0x2cfd6a[_0x32f00e][_0x5177('0x2a')]==='outbound'){if(this[_0x5177('0x19')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x2cfd6a[_0x5177('0x67')](_0x32f00e)&&_0x2cfd6a[_0x32f00e][_0x5177('0x37')]==='preview'&&_0x2cfd6a[_0x32f00e][_0x5177('0x2a')]===_0x5177('0x2b')){if(_0x2cfd6a[_0x32f00e][_0x5177('0x36')]){this[_0x5177('0x68')](_0x2cfd6a[_0x32f00e]);this[_0x5177('0x69')](_0x2cfd6a[_0x32f00e]);}else{notSendMessagesQueue(_0x2cfd6a[_0x32f00e]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x38caf7){var _0x2429d3=this;this[_0x5177('0x13')]['enqueue'](function(){if(!_['isNil'](_0x2429d3['actions'][_0x38caf7])){loggerAction[_0x5177('0x5a')]('[clearZombieChannels][talking]',_0x38caf7,'Queue',_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')],_0x5177('0x6b'),JSON[_0x5177('0x55')](_0x2429d3['campaignsPreview'][_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')]][_0x5177('0x4e')]),_0x5177('0x6c'),JSON[_0x5177('0x55')](_0x2429d3[_0x5177('0x14')][_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')]][_0x5177('0x5f')]),JSON[_0x5177('0x55')](_0x2429d3['actions'][_0x38caf7]['dialAnswer']),JSON[_0x5177('0x55')](_[_0x5177('0x6d')](_0x2429d3[_0x5177('0x17')][_0x38caf7],[_0x5177('0x6e'),_0x5177('0x6f'),'VoiceQueueId',_0x5177('0x70')])));return ami[_0x5177('0x71')]({'action':_0x5177('0x72'),'channel':_0x2429d3['actions'][_0x38caf7][_0x5177('0x73')]})[_0x5177('0x74')](function(_0x47fcd4){if(_0x47fcd4[_0x5177('0x4d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2429d3[_0x5177('0x17')][_0x38caf7]){ut['updateOriginated'](_0x2429d3[_0x5177('0x14')][_0x2429d3[_0x5177('0x17')][_0x38caf7]['queue']],_0x5177('0x75'));if(_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x76')]===!![]){ut[_0x5177('0x77')](_0x2429d3[_0x5177('0x14')][_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')]],_0x5177('0x75'));ut[_0x5177('0x78')](_0x5177('0x79')+_0x38caf7,_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')]);}ut[_0x5177('0x78')]('[Dialer][checkChannel][Preview]'+_0x38caf7,_0x2429d3[_0x5177('0x17')][_0x38caf7][_0x5177('0x6a')]);delete _0x2429d3[_0x5177('0x17')][_0x38caf7];}},0x2328);}});}});};Preview[_0x5177('0xf')][_0x5177('0x7a')]=function(){var _0x358baa=this;loggerAction[_0x5177('0x5a')]('[action]',_['size'](this[_0x5177('0x17')]));for(var _0x53c29e in this[_0x5177('0x17')]){if(_0x358baa['actions'][_0x5177('0x67')](_0x53c29e)){_0x358baa[_0x5177('0x7b')](_0x53c29e);}}};Preview['prototype'][_0x5177('0x69')]=function(_0x53ba87){var _0x6edc31=this;rpcDb[_0x5177('0x7c')](_0x53ba87['id'],ut['agentReadyId'](this[_0x5177('0x18')]))[_0x5177('0x7d')](function(_0x29e73f){if(!_[_0x5177('0x7e')](_0x29e73f)){for(var _0x1fb53f=0x0;_0x1fb53f<_0x29e73f['length'];_0x1fb53f+=0x1){if(ut[_0x5177('0x7f')](_0x29e73f[_0x1fb53f]['scheduledat'])<_0x53ba87[_0x5177('0x80')]*0x3c){if(_0x29e73f[_0x1fb53f][_0x5177('0x81')]&&!_0x29e73f[_0x1fb53f][_0x5177('0x81')]['voicePause']){_0x6edc31[_0x5177('0x82')](_0x29e73f[_0x1fb53f]['id'])[_0x5177('0x7d')](ut[_0x5177('0x83')](_0x5177('0x84')))[_0x5177('0x74')](ut[_0x5177('0x83')](_0x5177('0x84')));}else{rpcDb[_0x5177('0x85')](_0x29e73f[_0x1fb53f]['id']);}}else{var _0x41e922=new Action(_0x29e73f[_0x1fb53f],_0x53ba87);_0x41e922['starttime']=moment()[_0x5177('0x57')](_0x5177('0x86'));_0x53ba87[_0x5177('0x42')]+=0x1;ut[_0x5177('0x87')](_0x41e922,0x17,'RecallInQueue');if(_0x53ba87[_0x5177('0x88')]){rpcDb[_0x5177('0x89')](ut['createBody'](_0x29e73f[_0x1fb53f]));rpcDb[_0x5177('0x8a')](_0x41e922,_0x5177('0x8b'));}else{ut[_0x5177('0x87')](_0x41e922,0x16,_0x5177('0x8c'));rpcDb[_0x5177('0x8a')](_0x41e922,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x41e922,_0x5177('0x8d'));}}}}})[_0x5177('0x74')](ut[_0x5177('0x83')](_0x5177('0x8e')));};Preview[_0x5177('0xf')][_0x5177('0x68')]=function(_0x60604f){_0x60604f[_0x5177('0x5e')]=!![];if(ut[_0x5177('0x8f')](_0x60604f['loggedIn'])){_0x60604f['message']=_0x5177('0x90');}else if(!ut['isActive'](_0x60604f[_0x5177('0x36')])){_0x60604f[_0x5177('0x4d')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x60604f[_0x5177('0x52')])){if(!this[_0x5177('0x91')](_0x60604f['TrunkBackup'])){_0x60604f[_0x5177('0x4d')]=_0x5177('0x92');}else{_0x60604f[_0x5177('0x4d')]='ACTIVE';}}else{_0x60604f[_0x5177('0x4d')]=_0x5177('0x93');}emitCampaignPreview(_0x60604f);};Preview[_0x5177('0xf')][_0x5177('0x94')]=function(_0x551c00,_0x4ba800,_0xfaee7d){var _0x400e18=this;var _0x54ee49=this[_0x5177('0x17')][_0x4ba800];var _0x4e3423=this[_0x5177('0x14')][_0x54ee49[_0x5177('0x6a')]];var _0x1b0170;if(_0x4e3423){switch(_0xfaee7d){case'1':_0x4e3423[_0x5177('0x41')]+=0x1;_0x54ee49[_0x5177('0x95')]+=0x1;_0x54ee49['countglobal']=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x0,_0x5177('0x97'));ami[_0x5177('0x98')](_0x5177('0x99'),ut[_0x5177('0x9a')](_0x54ee49,_0x5177('0x9b')));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0x9c'));if(ut['totalGlobal'](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb['createCustomerFinal'](_0x1b0170,_0x5177('0xa0'));}else{if(_0x54ee49['countnosuchnumberretry']>=_0x4e3423[_0x5177('0xa1')]){rpcDb[_0x5177('0xa2')](_0x54ee49,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x5177('0xa3')](ut['scheduledAt'](_0x54ee49,_0x5177('0x95'),_0x4e3423[_0x5177('0xa4')]),_0x54ee49[_0x5177('0xa5')],_0x54ee49[_0x5177('0xa6')]);}}delete this['actions'][_0x551c00[_0x5177('0xa7')]];break;case'ANSWER':var _0x496b71=moment()['format'](_0x5177('0x86'));_0x54ee49['responsetime']=_0x496b71;_0x54ee49[_0x5177('0xa8')]=_0x496b71;_0x54ee49[_0x5177('0x76')]=!![];_0x4e3423['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x54ee49[_0x5177('0xa9')],_0x5177('0xaa'),_0x4e3423[_0x5177('0x2c')],'pTalking:\x20',_0x4e3423[_0x5177('0x5f')]);ami[_0x5177('0x98')](_0x5177('0xab'),ut['buildObj'](_0x54ee49,_0x5177('0xac'),this[_0x5177('0x14')][_0x54ee49[_0x5177('0x6a')]]));if(_0x4e3423[_0x5177('0xad')]){ami[_0x5177('0x98')](_0x5177('0xae'),ut[_0x5177('0xaf')](_0x54ee49));}break;case'16':ami[_0x5177('0x98')](_0x5177('0xb0'),ut['buildObj'](_0x54ee49,_0x5177('0xb1'),this[_0x5177('0x14')][_0x54ee49[_0x5177('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0x5177('0x9a')](_0x54ee49,'complete'));_0x4e3423[_0x5177('0xb2')]+=0x1;_0x4e3423[_0x5177('0x33')]+=0x1;_0x4e3423[_0x5177('0x2e')]+=0x1;ut[_0x5177('0x77')](_0x4e3423,_0x5177('0xb3'));_0x54ee49['countglobal']=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x4,_0x5177('0xb4'));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xb5'));rpcDb[_0x5177('0xa2')](_0x54ee49,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x54ee49);_0x4e3423['sumDuration']+=_0x54ee49[_0x5177('0xb6')];_0x4e3423[_0x5177('0x30')]+=_0x54ee49[_0x5177('0xb6')];logger[_0x5177('0x5a')](_0x5177('0xb7'),_0x54ee49[_0x5177('0xa9')],_0x5177('0xaa'),_0x4e3423[_0x5177('0x2c')],_0x5177('0x6c'),_0x4e3423[_0x5177('0x5f')]);delete this['actions'][_0x551c00[_0x5177('0xa7')]];break;case'BUSY':_0x4e3423[_0x5177('0x3c')]+=0x1;_0x54ee49[_0x5177('0xb8')]+=0x1;_0x54ee49['countglobal']=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x5,_0x5177('0xb9'));ami[_0x5177('0x98')]('custom:agentbusy',ut[_0x5177('0x9a')](_0x54ee49,_0x5177('0xba')));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xbb'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb[_0x5177('0xa2')](_0x1b0170,_0x5177('0xbc'));}else{if(_0x54ee49[_0x5177('0xb8')]>=_0x4e3423['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x54ee49,_0x5177('0xbb'));}else{rpcDb['rescheduleContact'](ut[_0x5177('0xbd')](_0x54ee49,'countbusyretry',_0x4e3423['dialBusyRetryFrequency']),_0x54ee49['unlockAgent'],_0x54ee49[_0x5177('0xa6')]);}}break;case _0x5177('0xbe'):_0x4e3423[_0x5177('0x40')]+=0x1;_0x54ee49[_0x5177('0xbf')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x3,_0x5177('0xc1'));ami[_0x5177('0x98')]('custom:agentnoanswer',ut['buildObj'](_0x54ee49,'noanswer'));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xc2'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423['dialGlobalMaxRetry']){_0x1b0170=ut['cloneAction'](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb[_0x5177('0xa2')](_0x1b0170,_0x5177('0xc3'));}else{if(_0x54ee49[_0x5177('0xbf')]>=_0x4e3423['dialNoAnswerMaxRetry']){rpcDb[_0x5177('0xa2')](_0x54ee49,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x5177('0xa3')](ut[_0x5177('0xbd')](_0x54ee49,'countnoanswerretry',_0x4e3423[_0x5177('0xc4')]),_0x54ee49[_0x5177('0xa5')],_0x54ee49[_0x5177('0xa6')]);}}break;case _0x5177('0xc5'):_0x4e3423[_0x5177('0xc6')]+=0x1;_0x54ee49[_0x5177('0xc7')]+=0x1;_0x54ee49['countglobal']=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x8,'Congestion');ami['emit'](_0x5177('0xc8'),ut[_0x5177('0x9a')](_0x54ee49,_0x5177('0xc9')));rpcDb['createCustomerHistory'](_0x54ee49,_0x5177('0xca'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0xf,'Global');rpcDb[_0x5177('0xa2')](_0x1b0170,_0x5177('0xcb'));}else{if(_0x54ee49[_0x5177('0xc7')]>=_0x4e3423[_0x5177('0xcc')]){rpcDb[_0x5177('0xa2')](_0x54ee49,_0x5177('0xca'));}else{rpcDb[_0x5177('0xa3')](ut['scheduledAt'](_0x54ee49,'countcongestionretry',_0x4e3423[_0x5177('0xcd')]),_0x54ee49['unlockAgent'],_0x54ee49[_0x5177('0xa6')]);}}break;case _0x5177('0xce'):_0x4e3423['outboundRejectCallsDay']+=0x1;_0x54ee49[_0x5177('0xcf')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut['totalGlobal'](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x14,_0x5177('0xd0'));ami[_0x5177('0x98')](_0x5177('0xd1'),ut['buildObj'](_0x54ee49,_0x5177('0xd2')));rpcDb['createCustomerHistory'](_0x54ee49,_0x5177('0xd3'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423['dialGlobalMaxRetry']){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0x14,_0x5177('0xd0'));rpcDb['createCustomerFinal'](_0x1b0170,_0x5177('0xd4'));}else{if(_0x54ee49[_0x5177('0xcf')]>=_0x4e3423['dialAgentRejectMaxRetry']){rpcDb[_0x5177('0xa2')](_0x54ee49,_0x5177('0xd4'));}else{rpcDb[_0x5177('0xa3')](ut[_0x5177('0xbd')](_0x54ee49,_0x5177('0xcf'),_0x4e3423[_0x5177('0xd5')]),_0x54ee49['unlockAgent'],_0x54ee49['activeContact']);}}break;case _0x5177('0xd6'):_0x4e3423[_0x5177('0x45')]+=0x1;_0x54ee49[_0x5177('0xd7')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut['totalGlobal'](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0xb,_0x5177('0xd8'));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xd9'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut['cloneAction'](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb['createCustomerFinal'](_0x1b0170,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x54ee49[_0x5177('0xda')]>=_0x4e3423[_0x5177('0xdb')]){rpcDb[_0x5177('0xa2')](_0x54ee49,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x5177('0xa3')](ut['scheduledAt'](_0x54ee49,_0x5177('0xd7'),_0x4e3423[_0x5177('0xdc')]),_0x54ee49[_0x5177('0xa5')],_0x54ee49[_0x5177('0xa6')]);}}break;case'18':_0x4e3423['outboundUnknownCallsDay']+=0x1;_0x54ee49[_0x5177('0xdd')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x12,_0x551c00[_0x5177('0xde')]||_0x551c00[_0x5177('0xdf')]);ami[_0x5177('0x98')](_0x5177('0xe0'),ut[_0x5177('0x9a')](_0x54ee49,_0x5177('0xe1')));rpcDb[_0x5177('0x8a')](_0x54ee49,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb['createCustomerFinal'](_0x1b0170,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x5177('0xa2')](_0x54ee49,_0x5177('0xe2'));}delete this[_0x5177('0x17')][_0x551c00[_0x5177('0xa7')]];break;case'19':_0x4e3423[_0x5177('0x44')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0x13,_0x551c00[_0x5177('0xde')]||_0x551c00[_0x5177('0xdf')]);ami[_0x5177('0x98')](_0x5177('0xe0'),ut[_0x5177('0x9a')](_0x54ee49,_0x5177('0xe1')));rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xe3'));if(ut['totalGlobal'](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut['cloneAction'](_0x54ee49,0xf,'Global');rpcDb['createCustomerFinal'](_0x1b0170,_0x5177('0xe3'));}else{rpcDb[_0x5177('0xa2')](_0x54ee49,_0x5177('0xe3'));}delete this['actions'][_0x551c00[_0x5177('0xa7')]];break;default:if(_0x54ee49[_0x5177('0x76')]){ut[_0x5177('0x77')](_0x4e3423,_0x5177('0xe4'));ut[_0x5177('0x78')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4e3423[_0x5177('0x2c')],_0x551c00);}_0x4e3423[_0x5177('0x44')]+=0x1;_0x54ee49[_0x5177('0xc0')]=ut[_0x5177('0x96')](_0x54ee49);ut[_0x5177('0x87')](_0x54ee49,0xc,_0x551c00['cause-txt']||_0x551c00['dialstatus']);rpcDb[_0x5177('0x8a')](_0x54ee49,_0x5177('0xe5'));if(ut[_0x5177('0x96')](_0x54ee49)>=_0x4e3423[_0x5177('0x9d')]){_0x1b0170=ut[_0x5177('0x9e')](_0x54ee49,0xf,_0x5177('0x9f'));rpcDb[_0x5177('0xa2')](_0x1b0170,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x54ee49,_0x5177('0xe6'));}delete this[_0x5177('0x17')][_0x551c00[_0x5177('0xa7')]];}if(!(_0x54ee49['dialAnswer']&&_0xfaee7d==='16')){ut['updateOriginated'](_0x4e3423,'[callProgressDetectingCustomer]');logger[_0x5177('0x5a')](_0x5177('0xe7'),_0x54ee49['uniqueid'],'\x20Queue',_0x4e3423[_0x5177('0x2c')],_0x5177('0x6b'),_0x4e3423[_0x5177('0x4e')]);}if(_0xfaee7d!==_0x5177('0xe8')){delete this[_0x5177('0x17')][_0x551c00[_0x5177('0xa7')]];delete this[_0x5177('0x17')][_0x551c00[_0x5177('0xe9')]];}}};Preview[_0x5177('0xf')]['callProgressDetectingAgent']=function(_0x3e4ded,_0x1b951f,_0x4c2fb3){if(_['isUndefined'](_0x1b951f)&&_0x5177('0xea')!==typeof _0x1b951f){return;}if(_['isUndefined'](_0x4c2fb3)&&'object'!==typeof _0x4c2fb3){return;}switch(_0x4c2fb3[_0x5177('0xeb')]){case'0':ut['logAgent'](_0x3e4ded,0x0,_0x5177('0x97'));rpcDb['createAgentHistory'](_0x3e4ded,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x5177('0xec')](_0x3e4ded,0x3,_0x5177('0xc1'));rpcDb[_0x5177('0xed')](_0x3e4ded,_0x5177('0xee'));break;case'5':ut[_0x5177('0xec')](_0x3e4ded,0x5,_0x5177('0xb9'));rpcDb[_0x5177('0xed')](_0x3e4ded,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x3e4ded,0x8,_0x5177('0xef'));rpcDb['createAgentHistory'](_0x3e4ded,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x5177('0xec')](_0x3e4ded,0x16,'AnswerAGI');rpcDb[_0x5177('0xed')](_0x3e4ded,_0x5177('0xf0'));break;default:ut[_0x5177('0xec')](_0x3e4ded,0xc,_0x4c2fb3[_0x5177('0xeb')]);rpcDb[_0x5177('0xed')](_0x3e4ded,'[callProgressDetectingAgent][logCongestion]');}ut[_0x5177('0xf1')](_0x1b951f,'[callProgressDetectingAgent]');logger[_0x5177('0x5a')](_0x5177('0xf2'),_0x3e4ded[_0x5177('0xa9')],_0x5177('0xaa'),_0x1b951f[_0x5177('0x2c')],_0x5177('0x6b'),_0x1b951f[_0x5177('0x4e')]);delete this['actions'][_0x3e4ded[_0x5177('0xa9')]];};Preview['prototype']['checkInBlack']=function(_0x3da977,_0xbe6da3,_0x521d68,_0x1ed715,_0x44aeae){var _0x2e8635=this;return new BPromise(function(_0x1e6293,_0x7fe991){if(_[_0x5177('0x7e')](_0xbe6da3)||_[_0x5177('0x7e')](_0xbe6da3[_0x5177('0xf3')])||_[_0x5177('0x7e')](_0xbe6da3[_0x5177('0xf3')]['phone'])||_['isNil'](_0xbe6da3[_0x5177('0xf4')])){_0x7fe991(ut[_0x5177('0x4d')](_0x5177('0xf5'),_0x1ed715,_0x44aeae));return;}var _0x34dd68=uuid['v4']();var _0x17f23a=_0x2e8635[_0x5177('0x14')][_0xbe6da3[_0x5177('0xf6')][_0x5177('0x2c')]];var _0x3f31e7=_0x521d68?_0x2e8635['agents'][_0x521d68]['id']:undefined;_0x2e8635[_0x5177('0x17')][_0x34dd68]=new Action(_0xbe6da3,_0x17f23a,_0x34dd68,_0x521d68,_0x3f31e7);var _0x35ccbd=_0x2e8635[_0x5177('0x17')][_0x34dd68];_0x35ccbd[_0x5177('0xa5')]=_0x1ed715;_0x35ccbd[_0x5177('0xa6')]=_0x44aeae;_0x35ccbd['lookAgent']=_0x521d68;if(_[_0x5177('0xf7')](_0x3da977)){_0x2e8635[_0x5177('0xf8')](_0x35ccbd,_0x17f23a,_0xbe6da3,_0x521d68)[_0x5177('0x7d')](function(_0x436842){logger[_0x5177('0x5a')](_0x5177('0xf9'),_0x5177('0xfa')+_0x35ccbd[_0x5177('0x6a')]+_0x5177('0xfb')+_0x35ccbd[_0x5177('0xfc')],JSON[_0x5177('0x55')](_0x436842));ami['emit'](_0x5177('0xfd'),ut[_0x5177('0x9a')](_0x35ccbd,_0x5177('0xfe'),_0x2e8635[_0x5177('0x14')][_0x35ccbd[_0x5177('0x6a')]]));_0x1e6293(ut[_0x5177('0x4d')](_0x5177('0xff')));})[_0x5177('0x74')](function(_0x1a6ccc){ut['logger'](_0x5177('0x100'),_0x1a6ccc);_0x7fe991(ut['message'](_0x5177('0x101'),_0x1ed715,_0x44aeae));});}else{_0x17f23a[_0x5177('0x3b')]+=0x1;ut[_0x5177('0x102')](_0x35ccbd);rpcDb[_0x5177('0x103')](_0x35ccbd,'[Blacklist][error]');delete _0x2e8635[_0x5177('0x17')][_0x34dd68];_0x7fe991(ut[_0x5177('0x4d')](_0x5177('0x104'),_0x1ed715,_0x44aeae));}});};Preview[_0x5177('0xf')]['isTrunkReachable']=function(_0x3edce9){return!_[_0x5177('0x7e')](_0x3edce9)&&!_[_0x5177('0x7e')](_0x3edce9['name'])&&!_[_0x5177('0x7e')](_0x3edce9['active'])&&_0x3edce9[_0x5177('0x105')]&&!_[_0x5177('0x7e')](this[_0x5177('0x16')][util[_0x5177('0x57')](_0x5177('0x106'),_0x3edce9['name'])])&&!_[_0x5177('0x7e')](this['trunks'][util[_0x5177('0x57')](_0x5177('0x106'),_0x3edce9[_0x5177('0x2c')])][_0x5177('0x72')])&&(this[_0x5177('0x16')][util[_0x5177('0x57')](_0x5177('0x106'),_0x3edce9[_0x5177('0x2c')])][_0x5177('0x72')]===_0x5177('0x107')||this[_0x5177('0x16')][util[_0x5177('0x57')]('SIP/%s',_0x3edce9[_0x5177('0x2c')])]['status']===_0x5177('0x108'));};Preview[_0x5177('0xf')][_0x5177('0x82')]=function(_0x87fdfc,_0x33ce57){var _0x1ac721=this;return new BPromise(function(_0x3ea1c5,_0x1ac273){_0x1ac721[_0x5177('0x109')](_0x87fdfc,_0x33ce57)[_0x5177('0x7d')](function(_0x3559e4){_0x3ea1c5(_['pick'](_0x3559e4,[_0x5177('0x4d')]));})[_0x5177('0x74')](function(_0x36b49e){if(_0x36b49e[_0x5177('0x10a')]){rpcDb[_0x5177('0x10b')](_0x87fdfc);}if(_0x36b49e['active']){rpcDb['disableContact'](_0x87fdfc);}_0x1ac273(_[_0x5177('0x6d')](_0x36b49e,[_0x5177('0x4d')]));});});};Preview[_0x5177('0xf')][_0x5177('0x109')]=function(_0x123cf0,_0x3bf60a){var _0x32f11c=this;return new BPromise(function(_0x553fbd,_0x1e8299){var _0x5b9ad1,_0xd7e2f1;rpcDb[_0x5177('0x10c')](_0x123cf0)['then'](function(_0x32c162){if(!_[_0x5177('0x7e')](_0x32c162[0x0])){_0xd7e2f1=_0x32c162[0x0][_0x5177('0x10d')]?![]:!![];_0x5b9ad1=_0x32c162[0x0][_0x5177('0x10d')]?!![]:![];_0x5b9ad1=_0x3bf60a?!![]:_0x5b9ad1;}var _0x43e820=_0x32f11c[_0x5177('0x10e')](_0x32c162);if(_0x43e820[_0x5177('0x10f')]){rpcDb['checkIsBlackList'](_[_0x5177('0x6d')](_0x32c162[0x0],[_0x5177('0xf4'),_0x5177('0x110')]))[_0x5177('0x7d')](function(_0x15a142){_0x32f11c['checkInBlack'](_0x15a142,_0x32c162[0x0],_0x3bf60a,_0xd7e2f1,_0x5b9ad1)['then'](function(_0x46f307){_0x553fbd(_0x46f307);})[_0x5177('0x74')](function(_0xf4bf49){_0x1e8299(_0xf4bf49);});})[_0x5177('0x74')](function(_0x2389e7){ut['logger'](_0x5177('0x111'),_0x2389e7);_0x1e8299(ut[_0x5177('0x4d')](_0x5177('0x112'),_0xd7e2f1,_0x5b9ad1));});}else{_0x1e8299(ut[_0x5177('0x4d')](_0x43e820[_0x5177('0x4d')],_0xd7e2f1,_0x5b9ad1));}})[_0x5177('0x74')](function(_0x47ea23){ut[_0x5177('0x62')](_0x5177('0x113'),_0x47ea23);_0x1e8299(ut[_0x5177('0x4d')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x5177('0xf')][_0x5177('0x10e')]=function(_0x29ca3e){if(_[_0x5177('0x7e')](_0x29ca3e)||_[_0x5177('0xf7')](_0x29ca3e)||!_[_0x5177('0x7e')](_0x29ca3e[0x0]['Agent'])&&_[_0x5177('0x7e')](_0x29ca3e[0x0][_0x5177('0x81')][_0x5177('0x2c')])){ut[_0x5177('0x62')](_0x5177('0x114'),_0x29ca3e);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x113d55=this[_0x5177('0x14')][_0x29ca3e[0x0]['Queue'][_0x5177('0x2c')]];_0x113d55[_0x5177('0x4d')]='ACTIVE';if(_['isNil'](_0x113d55)){ut[_0x5177('0x62')](_0x5177('0x115'),_0x113d55);return{'isValid':![],'message':_0x5177('0x116')};}if(!this[_0x5177('0x91')](_0x113d55[_0x5177('0x52')])){ut[_0x5177('0x62')](_0x5177('0x117'),_0x5177('0x118')+_0x113d55['name']+_0x5177('0x119'));if(!this[_0x5177('0x91')](_0x113d55['TrunkBackup'])){ut['logger'](_0x5177('0x117'),_0x113d55[_0x5177('0x2c')]+_0x5177('0x11a'));return{'isValid':![],'message':_0x5177('0x11b')};}}if(!ut[_0x5177('0x11c')](_0x113d55[_0x5177('0x36')])){ut[_0x5177('0x62')]('[Preview][validateContact][Campaign\x20Active]',_0x113d55[_0x5177('0x2c')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x113d55[_0x5177('0x2c')]+_0x5177('0x11d')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x5177('0xf')][_0x5177('0xf8')]=function(_0xc42f81,_0x1003be,_0x18147a,_0x15b7fa){var _0x2d82cb=this;return new BPromise(function(_0x5a5c91,_0x1e47a6){var _0x5ef8a9=_0xc42f81['uniqueid'];var _0x55782e=_0x2d82cb[_0x5177('0x91')](_0x1003be[_0x5177('0x52')])?util[_0x5177('0x57')](_0x5177('0x11e'),_0x1003be[_0x5177('0x52')]['name'],_[_0x5177('0x7e')](_0x1003be[_0x5177('0x39')])?'':_0x1003be['dialPrefix'][_0x5177('0x11f')]()||'',_0x1003be[_0x5177('0x120')]>0x0?_0x18147a['Contact'][_0x5177('0x121')][_0x5177('0x122')](_0x1003be[_0x5177('0x120')]):_0x18147a[_0x5177('0xf3')][_0x5177('0x121')]):util[_0x5177('0x57')]('SIP/%s/%s%s',_['isNil'](_0x1003be[_0x5177('0x123')])?_0x1003be[_0x5177('0x52')]['name']:_0x1003be[_0x5177('0x123')][_0x5177('0x2c')],_[_0x5177('0x7e')](_0x1003be[_0x5177('0x39')])?'':_0x1003be[_0x5177('0x39')]['trim']()||'',_0x1003be[_0x5177('0x120')]>0x0?_0x18147a[_0x5177('0xf3')][_0x5177('0x121')][_0x5177('0x122')](_0x1003be['dialCutDigit']):_0x18147a[_0x5177('0xf3')][_0x5177('0x121')]);var _0x5c144e=_0x2d82cb[_0x5177('0x91')](_0x1003be[_0x5177('0x52')])?ut[_0x5177('0x124')](_0x1003be[_0x5177('0x52')]['callerid'],_0x1003be['dialOriginateCallerIdName'],_0x1003be[_0x5177('0x125')]>0x0?ut[_0x5177('0x126')](_0x1003be[_0x5177('0x127')],_0x1003be[_0x5177('0x125')]):_0x1003be['dialOriginateCallerIdNumber']):ut[_0x5177('0x124')](_['isNil'](_0x1003be[_0x5177('0x123')])?_0x1003be[_0x5177('0x52')]['callerid']:_0x1003be[_0x5177('0x123')][_0x5177('0x53')],_0x1003be['dialOriginateCallerIdName'],_0x1003be[_0x5177('0x125')]>0x0?ut[_0x5177('0x126')](_0x1003be[_0x5177('0x127')],_0x1003be[_0x5177('0x125')]):_0x1003be['dialOriginateCallerIdNumber']);if(_0x5c144e){_0xc42f81[_0x5177('0x128')]=ut[_0x5177('0x129')](_0x5c144e);_0xc42f81[_0x5177('0x12a')]=ut[_0x5177('0x12b')](_0x5c144e);}var _0x3c3a32=ut[_0x5177('0x12c')](_0x1003be,_0x18147a,_0x55782e,_0x5c144e,_0x5ef8a9,_0xc42f81);_[_0x5177('0x12d')](_0xc42f81,ut['toLowerVariables'](_0x3c3a32));_0xc42f81[_0x5177('0x12e')]=moment()[_0x5177('0x57')](_0x5177('0x86'));ami[_0x5177('0x71')](ut['variablesAction'](_0xc42f81,_0x1003be,_0x3c3a32,_0xc42f81[_0x5177('0xa6')],_0x15b7fa))['then'](function(_0x1a41bb){var _0x1edc89=_0xc42f81[_0x5177('0x12f')];if(!_[_0x5177('0x7e')](_0x1edc89)){if(!_[_0x5177('0x7e')](_0x2d82cb[_0x5177('0x18')][_0x1edc89])){_0x2d82cb[_0x5177('0x18')][_0x1edc89][_0x5177('0x130')]=_0xc42f81['calleridnum'];emit(util[_0x5177('0x57')](_0x5177('0x131'),_0x2d82cb[_0x5177('0x18')][_0x1edc89][_0x5177('0x2c')]),_0x5177('0x132'),{'destaccountcode':_0x2d82cb['agents'][_0x1edc89][_0x5177('0x133')],'destconnectedlinenum':_0xc42f81[_0x5177('0x134')]});}}_0x1003be['originated']+=0x1;logger[_0x5177('0x5a')]('[originated][increment]',_0x5ef8a9,_0x5177('0xaa'),_0x1003be[_0x5177('0x2c')],_0x5177('0x6b'),_0x1003be[_0x5177('0x4e')]);_0x5a5c91(_0x1a41bb);})[_0x5177('0x74')](function(_0x2fa5ac){ut[_0x5177('0xec')](_0xc42f81,0xe,_0x5177('0x135'));rpcDb[_0x5177('0xed')](_0xc42f81,_0x5177('0x136'));_0x1e47a6(_0x2fa5ac);});});};Preview['prototype'][_0x5177('0x23')]=function(_0x481057){if(this[_0x5177('0x17')][_0x481057[_0x5177('0xa7')]]){this[_0x5177('0x17')][_0x481057[_0x5177('0xa7')]][_0x5177('0x73')]=_0x481057[_0x5177('0x73')];}};Preview[_0x5177('0xf')][_0x5177('0x1b')]=function(_0x137959){var _0x4867b6=this;var _0x10eb6c=this[_0x5177('0x17')][_0x137959[_0x5177('0x137')]];if(_0x10eb6c){if(_0x10eb6c['lookAgent']&&this[_0x5177('0x18')][_0x10eb6c[_0x5177('0x138')]]){ut[_0x5177('0x139')](_0x10eb6c,this[_0x5177('0x18')][_0x10eb6c[_0x5177('0x138')]]['name'],this[_0x5177('0x18')][_0x10eb6c['lookAgent']]['id']);}var _0x457dd0=_['clone'](_0x10eb6c);_0x457dd0[_0x5177('0x13a')]=moment()['format'](_0x5177('0x86'));var _0x158003=_0x4867b6[_0x5177('0x14')][_0x10eb6c[_0x5177('0x6a')]];if(ut[_0x5177('0x13b')](_0x137959[_0x5177('0x13c')])){if(_0x10eb6c[_0x5177('0xa5')]){rpcDb['unlockContact'](_0x10eb6c[_0x5177('0xfc')]);}if(_0x10eb6c[_0x5177('0xa6')]){rpcDb[_0x5177('0x85')](_0x10eb6c[_0x5177('0xfc')]);}ami[_0x5177('0x98')](_0x5177('0x13d'),ut[_0x5177('0x9a')](_0x10eb6c,_0x5177('0x13e'),this[_0x5177('0x14')][_0x10eb6c[_0x5177('0x6a')]]));this['callProgressDetectingAgent'](_0x457dd0,_0x158003,_0x137959);}else{_0x10eb6c['starttime']=moment()[_0x5177('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x5177('0xec')](_0x457dd0,0x4,'Answer');rpcDb[_0x5177('0xed')](_0x457dd0,_0x5177('0x13f'));}}};Preview['prototype'][_0x5177('0x1e')]=function(_0xbdffec){var _0x49450e=this;var _0x47939f=this[_0x5177('0x17')][_0xbdffec[_0x5177('0xa7')]];var _0x207cc7;if(_0x47939f){_0x207cc7=this[_0x5177('0x14')][_0x47939f[_0x5177('0x6a')]];logger[_0x5177('0x5a')](_0x5177('0x140'),_0xbdffec[_0x5177('0xa7')],'\x20Queue',_0x207cc7[_0x5177('0x2c')],_0x5177('0x6c'),_0x207cc7[_0x5177('0x5f')]);}if(this[_0x5177('0x17')][_0xbdffec[_0x5177('0xa7')]]&&_0xbdffec[_0x5177('0xa7')]!==_0xbdffec[_0x5177('0xa9')]){if(_0xbdffec[_0x5177('0x141')]==='16'&&this[_0x5177('0x17')][_0xbdffec[_0x5177('0xa7')]][_0x5177('0x76')]){this[_0x5177('0x94')](_0xbdffec,_0xbdffec['linkedid'],_0xbdffec[_0x5177('0x141')]);}else if(this['actions'][_0xbdffec[_0x5177('0xa7')]][_0x5177('0x76')]){logger[_0x5177('0x5a')](_0x5177('0x142'),_0xbdffec['linkedid'],_0xbdffec[_0x5177('0x141')],_0x5177('0xaa'),_0x207cc7[_0x5177('0x2c')],'pTalking:\x20',_0x207cc7[_0x5177('0x5f')]);this[_0x5177('0x94')](_0xbdffec,_0xbdffec[_0x5177('0xa7')],_0xbdffec[_0x5177('0x141')]);}}else if(_0x47939f&&_[_0x5177('0x7e')](_0x47939f[_0x5177('0x143')])&&_0x207cc7[_0x5177('0x144')]&&_0xbdffec[_0x5177('0xa7')]===_0xbdffec[_0x5177('0xa9')]&&_[_0x5177('0x7e')](_0xbdffec['reason'])&&_0xbdffec[_0x5177('0x141')]==='16'&&_0xbdffec['channelstate']==='6'&&_[_0x5177('0x145')](_0x47939f[_0x5177('0x146')])){if(_0x47939f['unlockAgent']){rpcDb[_0x5177('0x10b')](_0x47939f[_0x5177('0xfc')]);}if(_0x47939f[_0x5177('0xa6')]){rpcDb['disableContact'](_0x47939f[_0x5177('0xfc')]);}_0xbdffec['reason']='22';this['callProgressDetectingAgent'](_0x47939f,_0x207cc7,_0xbdffec);}else if(_0x47939f&&_0x47939f[_0x5177('0x146')]){if(_0xbdffec['cause']==='16'&&this[_0x5177('0x17')][_0xbdffec['linkedid']][_0x5177('0x76')]){logger[_0x5177('0x5a')]('[syncHangup][talking][transfer]',_0xbdffec[_0x5177('0xa7')],_0xbdffec[_0x5177('0x141')],_0x5177('0xaa'),_0x207cc7['name'],_0x5177('0x6c'),_0x207cc7[_0x5177('0x5f')]);this[_0x5177('0x94')](_0xbdffec,_0xbdffec[_0x5177('0xa7')],_0xbdffec['cause']);}else if(this[_0x5177('0x17')][_0xbdffec[_0x5177('0xa7')]]['dialAnswer']){logger[_0x5177('0x5a')](_0x5177('0x142'),_0xbdffec[_0x5177('0xa7')],_0xbdffec[_0x5177('0x141')],_0x5177('0xaa'),_0x207cc7[_0x5177('0x2c')],_0x5177('0x6c'),_0x207cc7[_0x5177('0x5f')]);this[_0x5177('0x94')](_0xbdffec,_0xbdffec['linkedid'],_0xbdffec['cause']);}}};Preview[_0x5177('0xf')][_0x5177('0x147')]=function(_0x1feee4){if(this[_0x5177('0x17')][_0x1feee4[_0x5177('0xe9')]]&&_0x1feee4[_0x5177('0xe9')]!==_0x1feee4[_0x5177('0x148')]){this[_0x5177('0x94')](_0x1feee4,_0x1feee4['destlinkedid'],_0x1feee4[_0x5177('0xdf')]);}};Preview[_0x5177('0xf')][_0x5177('0x20')]=function(_0x5574e7){if(this[_0x5177('0x17')][_0x5574e7[_0x5177('0xa7')]]&&_0x5574e7[_0x5177('0xa7')]!==_0x5574e7[_0x5177('0xa9')]&&!this[_0x5177('0x17')][_0x5574e7[_0x5177('0xa7')]]['dialAnswer']){if(_0x5574e7[_0x5177('0x141')]==='1'){this[_0x5177('0x94')](_0x5574e7,_0x5574e7[_0x5177('0xa7')],_0x5574e7['cause']);}}};Preview[_0x5177('0xf')][_0x5177('0x149')]=function(_0x4eb2a7,_0x15b5da,_0x74ca72){if(this[_0x5177('0x17')][_0x4eb2a7]){if(_[_0x5177('0x7e')](this[_0x5177('0x17')][_0x4eb2a7]['variables'])){this[_0x5177('0x17')][_0x4eb2a7][_0x5177('0x14a')]={};}this[_0x5177('0x17')][_0x4eb2a7][_0x5177('0x14a')][_0x15b5da]=_0x74ca72;}};Preview[_0x5177('0xf')][_0x5177('0x25')]=function(_0x2e4811){try{if(!_[_0x5177('0x7e')](_0x2e4811)){if(ut[_0x5177('0x14b')](_[_0x5177('0x14c')](_0x2e4811[_0x5177('0x14d')])[0x0])){this[_0x5177('0x149')](_0x2e4811[_0x5177('0xa9')],_['keys'](_0x2e4811[_0x5177('0x14d')])[0x0],_0x2e4811[_0x5177('0x14e')]);}}}catch(_0x478b6d){logger['error'](_0x5177('0x14f'),util[_0x5177('0x150')](_0x478b6d,{'showHidden':![],'depth':null}));}};Preview[_0x5177('0xf')][_0x5177('0x27')]=function(_0x436fb8){if(_0x436fb8){if(this[_0x5177('0x17')][_0x436fb8[_0x5177('0x151')]]){this[_0x5177('0x17')][_0x436fb8['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x5177('0xf')][_0x5177('0x152')]=function(_0xbb5be6){if(_0xbb5be6){if(this[_0x5177('0x17')][_0xbb5be6['transfererlinkedid']]){this[_0x5177('0x17')][_0xbb5be6[_0x5177('0x153')]][_0x5177('0x146')]=!![];}}};module[_0x5177('0x154')]=Preview; \ No newline at end of file +var _0xd127=['countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','[Preview][execCall][success]','Queue:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','TrunkBackup','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','channelAgent','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','variables','filterKey','keys','variable','addVariable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./action','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','prototype','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','recallMe','isNil','Queue','actions','queue','stringify','pTalking:\x20','pick','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','createCustomerHistory','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL'];(function(_0x5641d9,_0x1de53b){var _0x1b1f89=function(_0x27b5b3){while(--_0x27b5b3){_0x5641d9['push'](_0x5641d9['shift']());}};_0x1b1f89(++_0x1de53b);}(_0xd127,0x79));var _0x7d12=function(_0x2e1ef2,_0xcc4033){_0x2e1ef2=_0x2e1ef2-0x0;var _0x1aa955=_0xd127[_0x2e1ef2];return _0x1aa955;};'use strict';var util=require(_0x7d12('0x0'));var _=require('lodash');var BPromise=require(_0x7d12('0x1'));var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require(_0x7d12('0x2'));var config=require(_0x7d12('0x3'));var logger=require('../../../config/logger')(_0x7d12('0x4'));var loggerAction=require(_0x7d12('0x5'))(_0x7d12('0x6'));var ami=require('../ami');var rpcDb=require(_0x7d12('0x7'));var Action=require(_0x7d12('0x8'));var ut=require('./util/util');config['redis']=_[_0x7d12('0x9')](config[_0x7d12('0xa')],{'host':_0x7d12('0xb'),'port':0x18eb});var io=require(_0x7d12('0xc'))(new Redis(config[_0x7d12('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x7d12('0xd')]=function(_0x448e4e){this[_0x7d12('0xe')]=this['tail']?this[_0x7d12('0xe')][_0x7d12('0xf')](_0x448e4e):_0x448e4e();};function Preview(_0x4102df){this[_0x7d12('0x10')]=new Sequence();this[_0x7d12('0x11')]=_0x4102df[_0x7d12('0x12')];this['trunks']=_0x4102df[_0x7d12('0x13')];this['actions']={};this[_0x7d12('0x14')]=_0x4102df[_0x7d12('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0x7d12('0x15'),this[_0x7d12('0x16')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x18'),this[_0x7d12('0x19')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x1a'),this['syncHangupRequest']['bind'](this));ami['on'](_0x7d12('0x1b'),this[_0x7d12('0x1c')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x1d'),this[_0x7d12('0x1e')]['bind'](this));ami['on'](_0x7d12('0x1f'),this[_0x7d12('0x20')]['bind'](this));ami['on'](_0x7d12('0x21'),this[_0x7d12('0x22')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x23'),this[_0x7d12('0x24')][_0x7d12('0x17')](this));this[_0x7d12('0x25')](this[_0x7d12('0x11')]);}function emit(_0x19e67e,_0x101b73,_0x11d6bb){io['to'](_0x19e67e)[_0x7d12('0x26')](_0x101b73,_0x11d6bb);}function emitCampaignPreview(_0x3dbbe6){if(_0x3dbbe6[_0x7d12('0x27')]===_0x7d12('0x28')){var _0x587f36={'id':_0x3dbbe6['id'],'name':_0x3dbbe6['name'],'strategy':_0x3dbbe6[_0x7d12('0x29')],'answered':_0x3dbbe6[_0x7d12('0x2a')],'available':_0x3dbbe6[_0x7d12('0x2b')],'loggedIn':_0x3dbbe6['loggedIn'],'pTalking':_0x3dbbe6[_0x7d12('0x2c')],'sumBillable':_0x3dbbe6[_0x7d12('0x2d')],'sumDuration':_0x3dbbe6[_0x7d12('0x2e')],'sumHoldTime':_0x3dbbe6[_0x7d12('0x2f')]||0x0,'talking':_0x3dbbe6['talking'],'total':_0x3dbbe6[_0x7d12('0x30')],'type':_0x3dbbe6['type'],'unmanaged':_0x3dbbe6[_0x7d12('0x31')],'abandoned':_0x3dbbe6[_0x7d12('0x32')],'waiting':_0x3dbbe6['waiting'],'loggedInDb':_0x3dbbe6['loggedInDb'],'dialActive':_0x3dbbe6[_0x7d12('0x33')],'dialMethod':_0x3dbbe6[_0x7d12('0x34')],'dialOriginateCallerIdName':_0x3dbbe6[_0x7d12('0x35')],'dialOriginateCallerIdNumber':_0x3dbbe6[_0x7d12('0x36')],'dialOriginateTimeout':_0x3dbbe6['dialOriginateTimeout'],'dialPrefix':_0x3dbbe6['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3dbbe6[_0x7d12('0x37')],'outboundAnswerCallsDay':_0x3dbbe6['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3dbbe6[_0x7d12('0x38')],'outboundBusyCallsDay':_0x3dbbe6[_0x7d12('0x39')],'outboundCongestionCallsDay':_0x3dbbe6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3dbbe6[_0x7d12('0x3a')],'outboundDropCallsDayCallersExit':_0x3dbbe6[_0x7d12('0x3b')],'outboundDropCallsDayTimeout':_0x3dbbe6[_0x7d12('0x3c')],'outboundNoAnswerCallsDay':_0x3dbbe6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3dbbe6[_0x7d12('0x3d')],'outboundOriginateFailureCallsDay':_0x3dbbe6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3dbbe6['outboundReCallsDay'],'outboundRejectCallsDay':_0x3dbbe6[_0x7d12('0x3e')],'outboundUnknownCallsDay':_0x3dbbe6[_0x7d12('0x3f')],'outboundAbandonedCallsDay':_0x3dbbe6[_0x7d12('0x40')],'predictiveIntervalAnsweredCalls':_0x3dbbe6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3dbbe6[_0x7d12('0x41')],'predictiveIntervalAvgTalktime':_0x3dbbe6[_0x7d12('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x3dbbe6[_0x7d12('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x3dbbe6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3dbbe6[_0x7d12('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x3dbbe6[_0x7d12('0x45')],'predictiveIntervalHitRate':_0x3dbbe6[_0x7d12('0x46')],'predictiveIntervalMultiplicativeFactor':_0x3dbbe6[_0x7d12('0x47')],'predictiveIntervalPauses':_0x3dbbe6[_0x7d12('0x48')],'predictiveIntervalAvailable':_0x3dbbe6[_0x7d12('0x49')],'predictiveIntervalTotalCalls':_0x3dbbe6['predictiveIntervalTotalCalls'],'message':_0x3dbbe6['message'],'originated':_0x3dbbe6[_0x7d12('0x4a')],'erlangCalls':_0x3dbbe6[_0x7d12('0x4b')],'erlangCallToSecond':_0x3dbbe6[_0x7d12('0x4c')],'erlangAbandonmentRate':_0x3dbbe6[_0x7d12('0x4d')],'erlangBusyFactor':_0x3dbbe6[_0x7d12('0x4e')],'startPredictive':_0x3dbbe6[_0x7d12('0x4f')],'startProgressive':_0x3dbbe6[_0x7d12('0x50')]};if(_0x3dbbe6[_0x7d12('0x51')]){_0x587f36['Trunk']={'id':_0x3dbbe6['Trunk']['id'],'name':_0x3dbbe6[_0x7d12('0x51')][_0x7d12('0x52')],'active':_0x3dbbe6[_0x7d12('0x51')][_0x7d12('0x53')],'callerid':_0x3dbbe6[_0x7d12('0x51')]['callerid']};}if(_0x3dbbe6[_0x7d12('0x54')]){_0x587f36[_0x7d12('0x54')]={'id':_0x3dbbe6['Interval']['id'],'name':_0x3dbbe6[_0x7d12('0x54')][_0x7d12('0x52')]};}var _0x3620da=md5(JSON['stringify'](_0x587f36));if(_0x3dbbe6['md5']!==_0x3620da){_0x3dbbe6[_0x7d12('0x55')]=_0x3620da;emit(util[_0x7d12('0x56')](_0x7d12('0x57'),_0x587f36['name']),_0x7d12('0x58'),_0x587f36);}}}function emitVoiceQueueChannelRemove(_0x1538ee){logger[_0x7d12('0x59')](_0x7d12('0x5a'),JSON['stringify'](_0x1538ee));emit(util[_0x7d12('0x56')](_0x7d12('0x57'),_0x1538ee[_0x7d12('0x52')]),_0x7d12('0x5b'),_0x1538ee);io['emit'](_0x7d12('0x5c'),_0x1538ee);}function notSendMessagesQueue(_0xd40b18){if(_0xd40b18[_0x7d12('0x5d')]){if(_0xd40b18[_0x7d12('0x4a')]===0x0&&_0xd40b18[_0x7d12('0x2c')]===0x0){_0xd40b18[_0x7d12('0x5d')]=![];_0xd40b18[_0x7d12('0x2b')]=0x0;_0xd40b18[_0x7d12('0x5e')]=0x0;_0xd40b18[_0x7d12('0x5f')]='NOT_ACTIVE';ut[_0x7d12('0x60')](_0x7d12('0x61'),_0xd40b18[_0x7d12('0x52')]+_0x7d12('0x62'));}else{_0xd40b18[_0x7d12('0x5f')]='IS_DISACTIVED';ut[_0x7d12('0x60')](_0x7d12('0x61'),_0xd40b18[_0x7d12('0x52')]+_0x7d12('0x63'));}emitCampaignPreview(_0xd40b18);}}Preview[_0x7d12('0x64')][_0x7d12('0x25')]=function(){var _0x57abb0=this;setInterval(function(){_0x57abb0['syncCampaigns']();},0x7cf);};Preview[_0x7d12('0x64')]['syncCampaigns']=function(){var _0x4f2493=this[_0x7d12('0x11')];this[_0x7d12('0x65')]+=0x1;for(var _0x2bd480 in _0x4f2493){if(_0x4f2493[_0x7d12('0x66')](_0x2bd480)&&(_0x4f2493[_0x2bd480]['dialMethod']===_0x7d12('0x4')||_0x4f2493[_0x2bd480][_0x7d12('0x34')]===_0x7d12('0x67'))&&_0x4f2493[_0x2bd480][_0x7d12('0x27')]==='outbound'){if(this[_0x7d12('0x65')]>0x7){this[_0x7d12('0x65')]=0x0;this[_0x7d12('0x68')]();}}if(_0x4f2493['hasOwnProperty'](_0x2bd480)&&_0x4f2493[_0x2bd480]['dialMethod']===_0x7d12('0x4')&&_0x4f2493[_0x2bd480][_0x7d12('0x27')]==='outbound'){if(_0x4f2493[_0x2bd480]['dialActive']){this['setMessage'](_0x4f2493[_0x2bd480]);this[_0x7d12('0x69')](_0x4f2493[_0x2bd480]);}else{notSendMessagesQueue(_0x4f2493[_0x2bd480]);}}}};Preview[_0x7d12('0x64')]['clearZombieChannel']=function(_0x20c800){var _0x23a9a0=this;this[_0x7d12('0x10')][_0x7d12('0xd')](function(){if(!_[_0x7d12('0x6a')](_0x23a9a0['actions'][_0x20c800])){loggerAction['info']('[clearZombieChannels][talking]',_0x20c800,_0x7d12('0x6b'),_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')],'originated:\x20',JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0['actions'][_0x20c800][_0x7d12('0x6d')]][_0x7d12('0x4a')]),_0x7d12('0x6f'),JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')]][_0x7d12('0x2c')]),JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x6c')][_0x20c800]['dialAnswer']),JSON[_0x7d12('0x6e')](_[_0x7d12('0x70')](_0x23a9a0[_0x7d12('0x6c')][_0x20c800],['contactId','UserId','VoiceQueueId',_0x7d12('0x71')])));return ami[_0x7d12('0x72')]({'action':_0x7d12('0x73'),'channel':_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x74')]})['catch'](function(_0x4a5c76){if(_0x4a5c76[_0x7d12('0x5f')]===_0x7d12('0x75')){setTimeout(function(){if(_0x23a9a0[_0x7d12('0x6c')][_0x20c800]){ut[_0x7d12('0x76')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0[_0x7d12('0x6c')][_0x20c800]['queue']],_0x7d12('0x77'));if(_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x78')]===!![]){ut[_0x7d12('0x79')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0['actions'][_0x20c800][_0x7d12('0x6d')]],_0x7d12('0x77'));ut[_0x7d12('0x7a')](_0x7d12('0x7b')+_0x20c800,_0x23a9a0['actions'][_0x20c800]['queue']);}ut[_0x7d12('0x7a')](_0x7d12('0x7c')+_0x20c800,_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')]);delete _0x23a9a0['actions'][_0x20c800];}},0x2328);}});}});};Preview[_0x7d12('0x64')]['clearZombieChannels']=function(){var _0x403802=this;loggerAction[_0x7d12('0x59')](_0x7d12('0x7d'),_[_0x7d12('0x7e')](this[_0x7d12('0x6c')]));for(var _0x15f39c in this[_0x7d12('0x6c')]){if(_0x403802['actions']['hasOwnProperty'](_0x15f39c)){_0x403802[_0x7d12('0x7f')](_0x15f39c);}}};Preview[_0x7d12('0x64')][_0x7d12('0x69')]=function(_0x259a02){var _0x307e09=this;rpcDb[_0x7d12('0x80')](_0x259a02['id'],ut[_0x7d12('0x81')](this[_0x7d12('0x14')]))[_0x7d12('0x82')](function(_0x24b7d3){if(!_['isNil'](_0x24b7d3)){for(var _0x4722fc=0x0;_0x4722fc<_0x24b7d3[_0x7d12('0x83')];_0x4722fc+=0x1){if(ut[_0x7d12('0x84')](_0x24b7d3[_0x4722fc]['scheduledat'])<_0x259a02['dialRecallMeTimeout']*0x3c){if(_0x24b7d3[_0x4722fc]['Agent']&&!_0x24b7d3[_0x4722fc][_0x7d12('0x85')][_0x7d12('0x86')]){_0x307e09['run'](_0x24b7d3[_0x4722fc]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut[_0x7d12('0x87')](_0x7d12('0x88')));}else{rpcDb[_0x7d12('0x89')](_0x24b7d3[_0x4722fc]['id']);}}else{var _0x155357=new Action(_0x24b7d3[_0x4722fc],_0x259a02);_0x155357[_0x7d12('0x8a')]=moment()['format'](_0x7d12('0x8b'));_0x259a02[_0x7d12('0x8c')]+=0x1;ut[_0x7d12('0x8d')](_0x155357,0x17,_0x7d12('0x8e'));if(_0x259a02[_0x7d12('0x8f')]){rpcDb[_0x7d12('0x90')](ut[_0x7d12('0x91')](_0x24b7d3[_0x4722fc]));rpcDb['createCustomerHistory'](_0x155357,_0x7d12('0x92'));}else{ut[_0x7d12('0x8d')](_0x155357,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x155357,_0x7d12('0x93'));rpcDb[_0x7d12('0x94')](_0x155357,_0x7d12('0x93'));}}}}})[_0x7d12('0x95')](ut[_0x7d12('0x87')]('[getContactRecallMe]'));};Preview[_0x7d12('0x64')][_0x7d12('0x96')]=function(_0x4a4f50){_0x4a4f50[_0x7d12('0x5d')]=!![];if(ut[_0x7d12('0x97')](_0x4a4f50[_0x7d12('0x98')])){_0x4a4f50[_0x7d12('0x5f')]=_0x7d12('0x99');}else if(!ut[_0x7d12('0x9a')](_0x4a4f50['dialActive'])){_0x4a4f50[_0x7d12('0x5f')]='NOT_ACTIVE';}else if(!this[_0x7d12('0x9b')](_0x4a4f50[_0x7d12('0x51')])){if(!this[_0x7d12('0x9b')](_0x4a4f50['TrunkBackup'])){_0x4a4f50['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x4a4f50['message']=_0x7d12('0x9c');}}else{_0x4a4f50[_0x7d12('0x5f')]='ACTIVE';}emitCampaignPreview(_0x4a4f50);};Preview['prototype'][_0x7d12('0x9d')]=function(_0xd99493,_0x1127a7,_0x19316c){var _0x5c7156=this;var _0x3dc7f8=this[_0x7d12('0x6c')][_0x1127a7];var _0x4459c4=this[_0x7d12('0x11')][_0x3dc7f8['queue']];var _0x34c339;if(_0x4459c4){switch(_0x19316c){case'1':_0x4459c4[_0x7d12('0x3d')]+=0x1;_0x3dc7f8[_0x7d12('0x9e')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x0,_0x7d12('0xa1'));ami[_0x7d12('0x26')](_0x7d12('0xa2'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xa4')));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xa5'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut['cloneAction'](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xa8'));}else{if(_0x3dc7f8[_0x7d12('0x9e')]>=_0x4459c4[_0x7d12('0xa9')]){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xa8'));}else{rpcDb[_0x7d12('0xaa')](ut['scheduledAt'](_0x3dc7f8,'countnosuchnumberretry',_0x4459c4[_0x7d12('0xab')]),_0x3dc7f8['unlockAgent'],_0x3dc7f8[_0x7d12('0xac')]);}}delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xad')]];break;case'ANSWER':var _0x2801ef=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));_0x3dc7f8[_0x7d12('0xae')]=_0x2801ef;_0x3dc7f8[_0x7d12('0xaf')]=_0x2801ef;_0x3dc7f8[_0x7d12('0x78')]=!![];_0x4459c4[_0x7d12('0x2c')]+=0x1;logger['info'](_0x7d12('0xb0'),_0x3dc7f8[_0x7d12('0xb1')],'\x20Queue',_0x4459c4[_0x7d12('0x52')],_0x7d12('0x6f'),_0x4459c4[_0x7d12('0x2c')]);ami[_0x7d12('0x26')](_0x7d12('0xb2'),ut['buildObj'](_0x3dc7f8,_0x7d12('0xb3'),this[_0x7d12('0x11')][_0x3dc7f8[_0x7d12('0x6d')]]));if(_0x4459c4[_0x7d12('0xb4')]){ami[_0x7d12('0x26')](_0x7d12('0xb5'),ut['buildAcw'](_0x3dc7f8));}break;case'16':ami[_0x7d12('0x26')](_0x7d12('0xb6'),ut[_0x7d12('0xa3')](_0x3dc7f8,'complete',this[_0x7d12('0x11')][_0x3dc7f8['queue']]));emitVoiceQueueChannelRemove(ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xb7')));_0x4459c4[_0x7d12('0xb8')]+=0x1;_0x4459c4[_0x7d12('0x30')]+=0x1;_0x4459c4[_0x7d12('0x2a')]+=0x1;ut[_0x7d12('0x79')](_0x4459c4,_0x7d12('0xb9'));_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x4,_0x7d12('0xba'));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xbc'));rpcDb['createCustomerFinal'](_0x3dc7f8,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x7d12('0xbd')](_0x3dc7f8);_0x4459c4['sumDuration']+=_0x3dc7f8[_0x7d12('0xbe')];_0x4459c4[_0x7d12('0x2d')]+=_0x3dc7f8[_0x7d12('0xbe')];logger[_0x7d12('0x59')](_0x7d12('0xbf'),_0x3dc7f8['uniqueid'],_0x7d12('0xc0'),_0x4459c4['name'],_0x7d12('0x6f'),_0x4459c4[_0x7d12('0x2c')]);delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xad')]];break;case _0x7d12('0xc1'):_0x4459c4[_0x7d12('0x39')]+=0x1;_0x3dc7f8[_0x7d12('0xc2')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x5,_0x7d12('0xc3'));ami['emit'](_0x7d12('0xc4'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xc5')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xc6'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4['dialGlobalMaxRetry']){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,'Global');rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xc8'));}else{if(_0x3dc7f8[_0x7d12('0xc2')]>=_0x4459c4['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x3dc7f8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xc2'),_0x4459c4['dialBusyRetryFrequency']),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8['activeContact']);}}break;case _0x7d12('0xcb'):_0x4459c4[_0x7d12('0xcc')]+=0x1;_0x3dc7f8[_0x7d12('0xcd')]+=0x1;_0x3dc7f8['countglobal']=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x3,_0x7d12('0xce'));ami[_0x7d12('0x26')](_0x7d12('0xcf'),ut[_0x7d12('0xa3')](_0x3dc7f8,'noanswer'));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xd0'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xd1'));}else{if(_0x3dc7f8[_0x7d12('0xcd')]>=_0x4459c4[_0x7d12('0xd2')]){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xd0'));}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xcd'),_0x4459c4[_0x7d12('0xd3')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case _0x7d12('0xd4'):_0x4459c4['outboundCongestionCallsDay']+=0x1;_0x3dc7f8[_0x7d12('0xd5')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x8,_0x7d12('0xd6'));ami[_0x7d12('0x26')](_0x7d12('0xd7'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xd8')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xd9'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,'Global');rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xda'));}else{if(_0x3dc7f8[_0x7d12('0xd5')]>=_0x4459c4['dialCongestionMaxRetry']){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xd9'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3dc7f8,'countcongestionretry',_0x4459c4[_0x7d12('0xdb')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case _0x7d12('0xdc'):_0x4459c4[_0x7d12('0x3e')]+=0x1;_0x3dc7f8[_0x7d12('0xdd')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x14,_0x7d12('0xde'));ami[_0x7d12('0x26')](_0x7d12('0xdf'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xe0')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xe1'));if(ut['totalGlobal'](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0x14,_0x7d12('0xde'));rpcDb[_0x7d12('0x94')](_0x34c339,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3dc7f8[_0x7d12('0xdd')]>=_0x4459c4['dialAgentRejectMaxRetry']){rpcDb[_0x7d12('0x94')](_0x3dc7f8,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xdd'),_0x4459c4[_0x7d12('0xe2')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case'ABANDONED':_0x4459c4[_0x7d12('0x40')]+=0x1;_0x3dc7f8[_0x7d12('0xe3')]+=0x1;_0x3dc7f8['countglobal']=ut['totalGlobal'](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0xb,_0x7d12('0xe4'));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xe5'));if(ut['totalGlobal'](_0x3dc7f8)>=_0x4459c4['dialGlobalMaxRetry']){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xe5'));}else{if(_0x3dc7f8['countabandonedetry']>=_0x4459c4[_0x7d12('0xe6')]){rpcDb['createCustomerFinal'](_0x3dc7f8,_0x7d12('0xe5'));}else{rpcDb[_0x7d12('0xaa')](ut['scheduledAt'](_0x3dc7f8,_0x7d12('0xe3'),_0x4459c4[_0x7d12('0xe7')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case'18':_0x4459c4['outboundUnknownCallsDay']+=0x1;_0x3dc7f8['countmachineretry']+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x12,_0xd99493[_0x7d12('0xe8')]||_0xd99493[_0x7d12('0xe9')]);ami[_0x7d12('0x26')](_0x7d12('0xea'),ut[_0x7d12('0xa3')](_0x3dc7f8,'amd'));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xeb'));}else{rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xeb'));}delete this[_0x7d12('0x6c')][_0xd99493['linkedid']];break;case'19':_0x4459c4[_0x7d12('0x3f')]+=0x1;_0x3dc7f8['countglobal']=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x13,_0xd99493[_0x7d12('0xe8')]||_0xd99493[_0x7d12('0xe9')]);ami['emit'](_0x7d12('0xea'),ut['buildObj'](_0x3dc7f8,_0x7d12('0xec')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xed'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xed'));}else{rpcDb['createCustomerFinal'](_0x3dc7f8,_0x7d12('0xed'));}delete this['actions'][_0xd99493[_0x7d12('0xad')]];break;default:if(_0x3dc7f8['dialAnswer']){ut[_0x7d12('0x79')](_0x4459c4,_0x7d12('0xee'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4459c4[_0x7d12('0x52')],_0xd99493);}_0x4459c4[_0x7d12('0x3f')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0xc,_0xd99493['cause-txt']||_0xd99493['dialstatus']);rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xef'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xf0'));}else{rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xf0'));}delete this['actions'][_0xd99493[_0x7d12('0xad')]];}if(!(_0x3dc7f8[_0x7d12('0x78')]&&_0x19316c==='16')){ut[_0x7d12('0x76')](_0x4459c4,_0x7d12('0xf1'));logger[_0x7d12('0x59')](_0x7d12('0xf2'),_0x3dc7f8[_0x7d12('0xb1')],_0x7d12('0xc0'),_0x4459c4[_0x7d12('0x52')],_0x7d12('0xf3'),_0x4459c4[_0x7d12('0x4a')]);}if(_0x19316c!=='ANSWER'){delete this['actions'][_0xd99493[_0x7d12('0xad')]];delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xf4')]];}}};Preview[_0x7d12('0x64')]['callProgressDetectingAgent']=function(_0x2a14cf,_0x21b993,_0x4f34b1){if(_[_0x7d12('0xf5')](_0x21b993)&&_0x7d12('0xf6')!==typeof _0x21b993){return;}if(_[_0x7d12('0xf5')](_0x4f34b1)&&_0x7d12('0xf6')!==typeof _0x4f34b1){return;}switch(_0x4f34b1[_0x7d12('0xf7')]){case'0':ut['logAgent'](_0x2a14cf,0x0,_0x7d12('0xa1'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xf9'));break;case'3':ut[_0x7d12('0xfa')](_0x2a14cf,0x3,_0x7d12('0xce'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfb'));break;case'5':ut[_0x7d12('0xfa')](_0x2a14cf,0x5,'Busy');rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfc'));break;case'8':ut[_0x7d12('0xfa')](_0x2a14cf,0x8,_0x7d12('0xd6'));rpcDb['createAgentHistory'](_0x2a14cf,_0x7d12('0xfd'));break;case'22':ut['logAgent'](_0x2a14cf,0x16,_0x7d12('0xfe'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xff'));break;default:ut[_0x7d12('0xfa')](_0x2a14cf,0xc,_0x4f34b1[_0x7d12('0xf7')]);rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfd'));}ut['updateOriginated'](_0x21b993,_0x7d12('0x100'));logger[_0x7d12('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x2a14cf[_0x7d12('0xb1')],_0x7d12('0xc0'),_0x21b993['name'],_0x7d12('0xf3'),_0x21b993['originated']);delete this[_0x7d12('0x6c')][_0x2a14cf[_0x7d12('0xb1')]];};Preview['prototype']['checkInBlack']=function(_0x22ebe4,_0x28970e,_0x1f94e6,_0x580201,_0x5990be){var _0x508778=this;return new BPromise(function(_0x4d02c3,_0x42a1a9){if(_['isNil'](_0x28970e)||_['isNil'](_0x28970e[_0x7d12('0x101')])||_['isNil'](_0x28970e[_0x7d12('0x101')][_0x7d12('0x102')])||_[_0x7d12('0x6a')](_0x28970e[_0x7d12('0x103')])){_0x42a1a9(ut[_0x7d12('0x5f')](_0x7d12('0x104'),_0x580201,_0x5990be));return;}var _0x4ea1a1=uuid['v4']();var _0x27505a=_0x508778[_0x7d12('0x11')][_0x28970e[_0x7d12('0x6b')][_0x7d12('0x52')]];var _0xba5bf9=_0x1f94e6?_0x508778[_0x7d12('0x14')][_0x1f94e6]['id']:undefined;_0x508778[_0x7d12('0x6c')][_0x4ea1a1]=new Action(_0x28970e,_0x27505a,_0x4ea1a1,_0x1f94e6,_0xba5bf9);var _0x4e72e0=_0x508778[_0x7d12('0x6c')][_0x4ea1a1];_0x4e72e0[_0x7d12('0xca')]=_0x580201;_0x4e72e0[_0x7d12('0xac')]=_0x5990be;_0x4e72e0['lookAgent']=_0x1f94e6;if(_['isEmpty'](_0x22ebe4)){_0x508778['execCall'](_0x4e72e0,_0x27505a,_0x28970e,_0x1f94e6)[_0x7d12('0x82')](function(_0x40b65f){logger['info'](_0x7d12('0x105'),_0x7d12('0x106')+_0x4e72e0[_0x7d12('0x6d')]+'\x20IdHopper:\x20'+_0x4e72e0[_0x7d12('0x107')],JSON[_0x7d12('0x6e')](_0x40b65f));ami[_0x7d12('0x26')]('custom:agentcalled',ut[_0x7d12('0xa3')](_0x4e72e0,_0x7d12('0x108'),_0x508778[_0x7d12('0x11')][_0x4e72e0[_0x7d12('0x6d')]]));_0x4d02c3(ut[_0x7d12('0x5f')](_0x7d12('0x109')));})[_0x7d12('0x95')](function(_0x592093){ut[_0x7d12('0x60')](_0x7d12('0x10a'),_0x592093);_0x42a1a9(ut['message'](_0x7d12('0x10b'),_0x580201,_0x5990be));});}else{_0x27505a[_0x7d12('0x38')]+=0x1;ut[_0x7d12('0x10c')](_0x4e72e0);rpcDb[_0x7d12('0x10d')](_0x4e72e0,_0x7d12('0x10e'));delete _0x508778[_0x7d12('0x6c')][_0x4ea1a1];_0x42a1a9(ut['message']('Contact\x20in\x20black\x20List',_0x580201,_0x5990be));}});};Preview[_0x7d12('0x64')][_0x7d12('0x9b')]=function(_0x58ca81){return!_['isNil'](_0x58ca81)&&!_['isNil'](_0x58ca81['name'])&&!_['isNil'](_0x58ca81[_0x7d12('0x53')])&&_0x58ca81[_0x7d12('0x53')]&&!_['isNil'](this[_0x7d12('0x13')][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81['name'])])&&!_[_0x7d12('0x6a')](this['trunks'][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81['name'])][_0x7d12('0x73')])&&(this['trunks'][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81[_0x7d12('0x52')])][_0x7d12('0x73')]===_0x7d12('0x110')||this[_0x7d12('0x13')][util[_0x7d12('0x56')]('SIP/%s',_0x58ca81[_0x7d12('0x52')])]['status']===_0x7d12('0x111'));};Preview[_0x7d12('0x64')][_0x7d12('0x112')]=function(_0x3c0bb1,_0x2e26e2){var _0x1057ad=this;return new BPromise(function(_0x294fb9,_0x1d0a4b){_0x1057ad[_0x7d12('0x113')](_0x3c0bb1,_0x2e26e2)[_0x7d12('0x82')](function(_0x2af1b5){_0x294fb9(_[_0x7d12('0x70')](_0x2af1b5,[_0x7d12('0x5f')]));})[_0x7d12('0x95')](function(_0x2fb7a9){if(_0x2fb7a9[_0x7d12('0x114')]){rpcDb[_0x7d12('0x115')](_0x3c0bb1);}if(_0x2fb7a9[_0x7d12('0x53')]){rpcDb[_0x7d12('0x89')](_0x3c0bb1);}_0x1d0a4b(_[_0x7d12('0x70')](_0x2fb7a9,[_0x7d12('0x5f')]));});});};Preview[_0x7d12('0x64')][_0x7d12('0x113')]=function(_0x143883,_0x243c25){var _0x5716df=this;return new BPromise(function(_0x399722,_0x3df8a4){var _0x5f2ce0,_0x3e31e4;rpcDb[_0x7d12('0x116')](_0x143883)[_0x7d12('0x82')](function(_0x330234){if(!_['isNil'](_0x330234[0x0])){_0x3e31e4=_0x330234[0x0][_0x7d12('0x117')]?![]:!![];_0x5f2ce0=_0x330234[0x0][_0x7d12('0x117')]?!![]:![];_0x5f2ce0=_0x243c25?!![]:_0x5f2ce0;}var _0x15e61d=_0x5716df[_0x7d12('0x118')](_0x330234);if(_0x15e61d['isValid']){rpcDb[_0x7d12('0x119')](_[_0x7d12('0x70')](_0x330234[0x0],[_0x7d12('0x103'),_0x7d12('0x11a')]))['then'](function(_0x125db3){_0x5716df[_0x7d12('0x11b')](_0x125db3,_0x330234[0x0],_0x243c25,_0x3e31e4,_0x5f2ce0)[_0x7d12('0x82')](function(_0x37ef02){_0x399722(_0x37ef02);})['catch'](function(_0x45d284){_0x3df8a4(_0x45d284);});})[_0x7d12('0x95')](function(_0x5022d1){ut[_0x7d12('0x60')](_0x7d12('0x11c'),_0x5022d1);_0x3df8a4(ut[_0x7d12('0x5f')](_0x7d12('0x11d'),_0x3e31e4,_0x5f2ce0));});}else{_0x3df8a4(ut[_0x7d12('0x5f')](_0x15e61d[_0x7d12('0x5f')],_0x3e31e4,_0x5f2ce0));}})[_0x7d12('0x95')](function(_0x36e577){ut[_0x7d12('0x60')](_0x7d12('0x11e'),_0x36e577);_0x3df8a4(ut[_0x7d12('0x5f')](_0x7d12('0x11d'),![],!![]));});});};Preview[_0x7d12('0x64')]['validateContact']=function(_0x29531c){if(_[_0x7d12('0x6a')](_0x29531c)||_[_0x7d12('0x11f')](_0x29531c)||!_['isNil'](_0x29531c[0x0][_0x7d12('0x85')])&&_[_0x7d12('0x6a')](_0x29531c[0x0]['Agent'][_0x7d12('0x52')])){ut[_0x7d12('0x60')](_0x7d12('0x120'),_0x29531c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x110cf1=this[_0x7d12('0x11')][_0x29531c[0x0]['Queue'][_0x7d12('0x52')]];_0x110cf1[_0x7d12('0x5f')]=_0x7d12('0x9c');if(_['isNil'](_0x110cf1)){ut[_0x7d12('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0x110cf1);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x7d12('0x9b')](_0x110cf1[_0x7d12('0x51')])){ut[_0x7d12('0x60')](_0x7d12('0x121'),_0x7d12('0x122')+_0x110cf1[_0x7d12('0x52')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x110cf1['TrunkBackup'])){ut[_0x7d12('0x60')](_0x7d12('0x121'),_0x110cf1[_0x7d12('0x52')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7d12('0x123')};}}if(!ut[_0x7d12('0x9a')](_0x110cf1[_0x7d12('0x33')])){ut[_0x7d12('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x110cf1[_0x7d12('0x52')]+_0x7d12('0x124'));return{'isValid':![],'message':_0x7d12('0x122')+_0x110cf1[_0x7d12('0x52')]+_0x7d12('0x124')};}return{'isValid':!![],'message':_0x7d12('0x125')};};Preview['prototype']['execCall']=function(_0x2a15c9,_0x3935d8,_0x45a3df,_0x169736){var _0x318dc3=this;return new BPromise(function(_0x51942d,_0x30b990){var _0x5c9726=_0x2a15c9[_0x7d12('0xb1')];var _0x3d50e2=_0x318dc3['isTrunkReachable'](_0x3935d8['Trunk'])?util[_0x7d12('0x56')]('SIP/%s/%s%s',_0x3935d8[_0x7d12('0x51')][_0x7d12('0x52')],_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x126')])?'':_0x3935d8['dialPrefix']['trim']()||'',_0x3935d8[_0x7d12('0x127')]>0x0?_0x45a3df[_0x7d12('0x101')][_0x7d12('0x102')][_0x7d12('0x128')](_0x3935d8[_0x7d12('0x127')]):_0x45a3df[_0x7d12('0x101')]['phone']):util[_0x7d12('0x56')](_0x7d12('0x129'),_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x12a')])?_0x3935d8[_0x7d12('0x51')][_0x7d12('0x52')]:_0x3935d8[_0x7d12('0x12a')][_0x7d12('0x52')],_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x126')])?'':_0x3935d8[_0x7d12('0x126')]['trim']()||'',_0x3935d8['dialCutDigit']>0x0?_0x45a3df[_0x7d12('0x101')][_0x7d12('0x102')][_0x7d12('0x128')](_0x3935d8[_0x7d12('0x127')]):_0x45a3df['Contact']['phone']);var _0x2cbf88=_0x318dc3[_0x7d12('0x9b')](_0x3935d8[_0x7d12('0x51')])?ut[_0x7d12('0x12b')](_0x3935d8[_0x7d12('0x51')][_0x7d12('0x12c')],_0x3935d8[_0x7d12('0x35')],_0x3935d8[_0x7d12('0x12d')]>0x0?ut[_0x7d12('0x12e')](_0x3935d8[_0x7d12('0x36')],_0x3935d8[_0x7d12('0x12d')]):_0x3935d8[_0x7d12('0x36')]):ut[_0x7d12('0x12b')](_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x12a')])?_0x3935d8[_0x7d12('0x51')][_0x7d12('0x12c')]:_0x3935d8[_0x7d12('0x12a')][_0x7d12('0x12c')],_0x3935d8['dialOriginateCallerIdName'],_0x3935d8[_0x7d12('0x12d')]>0x0?ut[_0x7d12('0x12e')](_0x3935d8[_0x7d12('0x36')],_0x3935d8['dialRandomLastDigitCallerIdNumber']):_0x3935d8[_0x7d12('0x36')]);if(_0x2cbf88){_0x2a15c9[_0x7d12('0x12f')]=ut[_0x7d12('0x130')](_0x2cbf88);_0x2a15c9['originatecalleridnum']=ut[_0x7d12('0x131')](_0x2cbf88);}var _0x22d58f=ut[_0x7d12('0x132')](_0x3935d8,_0x45a3df,_0x3d50e2,_0x2cbf88,_0x5c9726,_0x2a15c9);_[_0x7d12('0x133')](_0x2a15c9,ut[_0x7d12('0x134')](_0x22d58f));_0x2a15c9['starttime']=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));ami[_0x7d12('0x72')](ut['variablesAction'](_0x2a15c9,_0x3935d8,_0x22d58f,_0x2a15c9[_0x7d12('0xac')],_0x169736))[_0x7d12('0x82')](function(_0x6911c0){var _0x39d1f8=_0x2a15c9[_0x7d12('0x135')];if(!_[_0x7d12('0x6a')](_0x39d1f8)){if(!_['isNil'](_0x318dc3[_0x7d12('0x14')][_0x39d1f8])){_0x318dc3[_0x7d12('0x14')][_0x39d1f8]['destconnectedlinenum']=_0x2a15c9[_0x7d12('0x136')];emit(util[_0x7d12('0x56')](_0x7d12('0x137'),_0x318dc3['agents'][_0x39d1f8][_0x7d12('0x52')]),_0x7d12('0x138'),{'destaccountcode':_0x318dc3[_0x7d12('0x14')][_0x39d1f8][_0x7d12('0x139')],'destconnectedlinenum':_0x2a15c9[_0x7d12('0x136')]});}}_0x3935d8[_0x7d12('0x4a')]+=0x1;logger[_0x7d12('0x59')](_0x7d12('0x13a'),_0x5c9726,_0x7d12('0xc0'),_0x3935d8[_0x7d12('0x52')],_0x7d12('0xf3'),_0x3935d8[_0x7d12('0x4a')]);_0x51942d(_0x6911c0);})[_0x7d12('0x95')](function(_0x1ef593){ut[_0x7d12('0xfa')](_0x2a15c9,0xe,_0x7d12('0x13b'));rpcDb['createAgentHistory'](_0x2a15c9,_0x7d12('0x13c'));_0x30b990(_0x1ef593);});});};Preview['prototype'][_0x7d12('0x1e')]=function(_0x1db15b){if(this[_0x7d12('0x6c')][_0x1db15b[_0x7d12('0xad')]]){this['actions'][_0x1db15b[_0x7d12('0xad')]]['channel']=_0x1db15b[_0x7d12('0x74')];}};Preview[_0x7d12('0x64')][_0x7d12('0x16')]=function(_0x26273f){var _0x1f5e89=this;var _0x56b36c=this[_0x7d12('0x6c')][_0x26273f[_0x7d12('0x13d')]];if(_0x56b36c){if(_0x56b36c[_0x7d12('0x13e')]&&this['agents'][_0x56b36c[_0x7d12('0x13e')]]){ut['logLookAgent'](_0x56b36c,this['agents'][_0x56b36c['lookAgent']]['name'],this[_0x7d12('0x14')][_0x56b36c[_0x7d12('0x13e')]]['id']);}var _0x4fe95e=_[_0x7d12('0x13f')](_0x56b36c);_0x4fe95e[_0x7d12('0xae')]=moment()[_0x7d12('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x339e38=_0x1f5e89['campaignsPreview'][_0x56b36c[_0x7d12('0x6d')]];if(ut[_0x7d12('0x140')](_0x26273f['response'])){if(_0x56b36c[_0x7d12('0xca')]){rpcDb[_0x7d12('0x115')](_0x56b36c[_0x7d12('0x107')]);}if(_0x56b36c[_0x7d12('0xac')]){rpcDb[_0x7d12('0x89')](_0x56b36c[_0x7d12('0x107')]);}ami[_0x7d12('0x26')](_0x7d12('0x141'),ut[_0x7d12('0xa3')](_0x56b36c,_0x7d12('0x142'),this[_0x7d12('0x11')][_0x56b36c[_0x7d12('0x6d')]]));this['callProgressDetectingAgent'](_0x4fe95e,_0x339e38,_0x26273f);}else{_0x56b36c['starttime']=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));ut['logAgent'](_0x4fe95e,0x4,'Answer');rpcDb[_0x7d12('0xf8')](_0x4fe95e,_0x7d12('0x143'));}}};Preview[_0x7d12('0x64')][_0x7d12('0x19')]=function(_0x480e29){var _0x5f1e92=this;var _0x2dd2a5=this['actions'][_0x480e29[_0x7d12('0xad')]];var _0xaf2c13;if(_0x2dd2a5){_0xaf2c13=this[_0x7d12('0x11')][_0x2dd2a5['queue']];logger[_0x7d12('0x59')]('[syncHangup][talking]',_0x480e29[_0x7d12('0xad')],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],_0x7d12('0x6f'),_0xaf2c13[_0x7d12('0x2c')]);}if(this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]&&_0x480e29[_0x7d12('0xad')]!==_0x480e29[_0x7d12('0xb1')]){if(_0x480e29[_0x7d12('0x144')]==='16'&&this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]['dialAnswer']){this[_0x7d12('0x9d')](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')]);}else if(this['actions'][_0x480e29[_0x7d12('0xad')]][_0x7d12('0x78')]){logger['info'](_0x7d12('0x145'),_0x480e29[_0x7d12('0xad')],_0x480e29['cause'],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],'pTalking:\x20',_0xaf2c13[_0x7d12('0x2c')]);this[_0x7d12('0x9d')](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29['cause']);}}else if(_0x2dd2a5&&_[_0x7d12('0x6a')](_0x2dd2a5[_0x7d12('0x146')])&&_0xaf2c13[_0x7d12('0x147')]&&_0x480e29[_0x7d12('0xad')]===_0x480e29[_0x7d12('0xb1')]&&_['isNil'](_0x480e29[_0x7d12('0xf7')])&&_0x480e29[_0x7d12('0x144')]==='16'&&_0x480e29[_0x7d12('0x148')]==='6'&&_[_0x7d12('0xf5')](_0x2dd2a5[_0x7d12('0x149')])){if(_0x2dd2a5[_0x7d12('0xca')]){rpcDb[_0x7d12('0x115')](_0x2dd2a5[_0x7d12('0x107')]);}if(_0x2dd2a5[_0x7d12('0xac')]){rpcDb[_0x7d12('0x89')](_0x2dd2a5[_0x7d12('0x107')]);}_0x480e29[_0x7d12('0xf7')]='22';this['callProgressDetectingAgent'](_0x2dd2a5,_0xaf2c13,_0x480e29);}else if(_0x2dd2a5&&_0x2dd2a5[_0x7d12('0x149')]){if(_0x480e29[_0x7d12('0x144')]==='16'&&this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]][_0x7d12('0x78')]){logger[_0x7d12('0x59')](_0x7d12('0x14a'),_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],'pTalking:\x20',_0xaf2c13[_0x7d12('0x2c')]);this[_0x7d12('0x9d')](_0x480e29,_0x480e29['linkedid'],_0x480e29[_0x7d12('0x144')]);}else if(this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x480e29['linkedid'],_0x480e29[_0x7d12('0x144')],'\x20Queue',_0xaf2c13['name'],_0x7d12('0x6f'),_0xaf2c13[_0x7d12('0x2c')]);this['callProgressDetectingCustomer'](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')]);}}};Preview[_0x7d12('0x64')][_0x7d12('0x1c')]=function(_0x448d91){if(this[_0x7d12('0x6c')][_0x448d91[_0x7d12('0xf4')]]&&_0x448d91[_0x7d12('0xf4')]!==_0x448d91['destuniqueid']){this[_0x7d12('0x9d')](_0x448d91,_0x448d91[_0x7d12('0xf4')],_0x448d91[_0x7d12('0xe9')]);}};Preview[_0x7d12('0x64')]['syncHangupRequest']=function(_0x561694){if(this[_0x7d12('0x6c')][_0x561694[_0x7d12('0xad')]]&&_0x561694[_0x7d12('0xad')]!==_0x561694[_0x7d12('0xb1')]&&!this[_0x7d12('0x6c')][_0x561694['linkedid']][_0x7d12('0x78')]){if(_0x561694[_0x7d12('0x144')]==='1'){this[_0x7d12('0x9d')](_0x561694,_0x561694[_0x7d12('0xad')],_0x561694[_0x7d12('0x144')]);}}};Preview[_0x7d12('0x64')]['addVariable']=function(_0x3ee858,_0x2408ea,_0x408939){if(this[_0x7d12('0x6c')][_0x3ee858]){if(_[_0x7d12('0x6a')](this[_0x7d12('0x6c')][_0x3ee858][_0x7d12('0x14b')])){this[_0x7d12('0x6c')][_0x3ee858][_0x7d12('0x14b')]={};}this[_0x7d12('0x6c')][_0x3ee858]['variables'][_0x2408ea]=_0x408939;}};Preview[_0x7d12('0x64')][_0x7d12('0x20')]=function(_0x54483e){try{if(!_[_0x7d12('0x6a')](_0x54483e)){if(ut[_0x7d12('0x14c')](_[_0x7d12('0x14d')](_0x54483e[_0x7d12('0x14e')])[0x0])){this[_0x7d12('0x14f')](_0x54483e[_0x7d12('0xb1')],_[_0x7d12('0x14d')](_0x54483e['variable'])[0x0],_0x54483e[_0x7d12('0x150')]);}}}catch(_0x1e3a3d){logger['error'](_0x7d12('0x151'),util[_0x7d12('0x152')](_0x1e3a3d,{'showHidden':![],'depth':null}));}};Preview[_0x7d12('0x64')]['syncAttendedTransfer']=function(_0x57b7c4){if(_0x57b7c4){if(this[_0x7d12('0x6c')][_0x57b7c4[_0x7d12('0x153')]]){this['actions'][_0x57b7c4['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x7d12('0x64')][_0x7d12('0x24')]=function(_0x52a43b){if(_0x52a43b){if(this['actions'][_0x52a43b[_0x7d12('0x154')]]){this[_0x7d12('0x6c')][_0x52a43b[_0x7d12('0x154')]][_0x7d12('0x149')]=!![];}}};module[_0x7d12('0x155')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 0e578f1..5b87ccc 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 _0x2695=['[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer'];(function(_0x4b4844,_0x2f0dfb){var _0x575192=function(_0x13ee1b){while(--_0x13ee1b){_0x4b4844['push'](_0x4b4844['shift']());}};_0x575192(++_0x2f0dfb);}(_0x2695,0x10e));var _0x5269=function(_0x55a355,_0x4f1893){_0x55a355=_0x55a355-0x0;var _0x1c25c8=_0x2695[_0x55a355];return _0x1c25c8;};'use strict';var util=require(_0x5269('0x0'));var BPromise=require(_0x5269('0x1'));var logger=require(_0x5269('0x2'))('preview');var _=require(_0x5269('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5269('0x4'));var voiceQueueRt=require(_0x5269('0x5'));var agentReportPreview=require(_0x5269('0x6'));var voiceQueueReport=require(_0x5269('0x7'));function loggerCatch(_0x3ceaad){return function(_0x3e68b2){logger[_0x5269('0x8')](_0x3ceaad,util['inspect'](_0x3e68b2,{'showHidden':![],'depth':null}));};}function create(_0xab5592){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopperHistory[_0x5269('0xb')](_0xab5592))[_0x5269('0xc')](loggerCatch(_0x5269('0xd')));}function createAgent(_0x5ca300){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](agentReportPreview[_0x5269('0xb')](_0x5ca300))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5cd2b5){return BPromise['resolve']()[_0x5269('0xa')](cmHopper[_0x5269('0xe')](_0x5cd2b5,!![]))['catch'](loggerCatch(_0x5269('0xf')));}exports['checkIsBlackList']=function(_0x2942c5){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopperBlack[_0x5269('0x10')](_0x2942c5))[_0x5269('0xc')](loggerCatch(_0x5269('0x11')));};exports[_0x5269('0x12')]=function(_0x39a1a4){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopper[_0x5269('0x12')](_0x39a1a4))[_0x5269('0xc')](loggerCatch(_0x5269('0x13')));};exports[_0x5269('0xb')]=function(_0x37504d,_0x2490c9){create(_0x37504d)['catch'](loggerCatch(_0x2490c9));moveContact(_0x37504d)[_0x5269('0xc')](loggerCatch(_0x2490c9));};exports[_0x5269('0x14')]=function(_0xe0139a,_0x371b81){createAgent(_0xe0139a)['catch'](loggerCatch(_0x371b81));};exports[_0x5269('0x15')]=function(_0x1a14cc,_0x22e352){create(_0x1a14cc)[_0x5269('0xc')](loggerCatch(_0x22e352));};exports[_0x5269('0x16')]=function(_0x492deb,_0x27ffe5){moveContact(_0x492deb)[_0x5269('0xc')](loggerCatch(_0x27ffe5));};exports['rescheduleContact']=function(_0x2bd8b8,_0x518dac,_0x4a3607){if(_0x518dac){_0x2bd8b8[_0x5269('0x17')]=null;}if(_0x4a3607){_0x2bd8b8[_0x5269('0x18')]=![];}return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopper[_0x5269('0x19')](_0x2bd8b8))[_0x5269('0xc')](loggerCatch(_0x5269('0x1a')));};exports[_0x5269('0x1b')]=function(_0x54c4b0){return BPromise[_0x5269('0x9')]()['then'](cmHopper[_0x5269('0x1b')](_0x54c4b0))[_0x5269('0xc')](loggerCatch(_0x5269('0x1c')));};exports[_0x5269('0x1d')]=function(_0x1f4a67){return BPromise['resolve']()[_0x5269('0xa')](cmHopper['unlockContact']({'UserId':null},_0x1f4a67,0x1))[_0x5269('0xc')](loggerCatch(_0x5269('0x1e')));};exports[_0x5269('0x1f')]=function(_0x1ed922){return BPromise['resolve']()[_0x5269('0xa')](cmHopper[_0x5269('0x1d')]({'active':![]},_0x1ed922,0x1))[_0x5269('0xc')](loggerCatch(_0x5269('0x20')));};exports[_0x5269('0x21')]=function(_0x4b849c){var _0x59868d={};_0x59868d[_0x5269('0x22')]=_0x4b849c[_0x5269('0x22')];_0x59868d[_0x5269('0x23')]=_0x4b849c[_0x5269('0x23')];_0x59868d['calleridnum']=_0x4b849c['calleridnum'];_0x59868d['calleridname']=_0x4b849c[_0x5269('0x24')];_0x59868d[_0x5269('0x25')]=_0x4b849c[_0x5269('0x25')];_0x59868d['queuecallerjoinAt']=_0x4b849c[_0x5269('0x26')];_0x59868d[_0x5269('0x27')]=_0x4b849c[_0x5269('0x26')];_0x59868d[_0x5269('0x28')]=0x1;_0x59868d[_0x5269('0x29')]=_0x4b849c[_0x5269('0x2a')];_0x59868d['connectedlinename']=_0x4b849c[_0x5269('0x2b')];_0x59868d[_0x5269('0x2c')]=_0x5269('0x2d');_0x59868d[_0x5269('0x2e')]=_0x5269('0x2f');_0x59868d[_0x5269('0x30')]=0x0;_0x59868d[_0x5269('0x31')]=0x1;_0x59868d[_0x5269('0x32')]=_0x4b849c[_0x5269('0x2b')];_0x59868d[_0x5269('0x33')]=_0x5269('0x34');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x59868d))[_0x5269('0xc')](loggerCatch(_0x5269('0x35')));};exports['getContactRecallMe']=function(_0x570c2a,_0x1cd51a){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopper[_0x5269('0x36')](_0x570c2a,_0x1cd51a))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x5269('0x37')]=function(_0x273879){return BPromise[_0x5269('0x9')]()[_0x5269('0xa')](cmHopper[_0x5269('0x19')](_0x273879,!![],!![]))[_0x5269('0xc')](loggerCatch(_0x5269('0x38')));}; \ No newline at end of file +var _0x834a=['checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20'];(function(_0x3aabb4,_0x3d20d2){var _0x4281a6=function(_0x4cb805){while(--_0x4cb805){_0x3aabb4['push'](_0x3aabb4['shift']());}};_0x4281a6(++_0x3d20d2);}(_0x834a,0x9d));var _0xa834=function(_0x427189,_0x2b9b30){_0x427189=_0x427189-0x0;var _0x5e33ba=_0x834a[_0x427189];return _0x5e33ba;};'use strict';var util=require(_0xa834('0x0'));var BPromise=require(_0xa834('0x1'));var logger=require(_0xa834('0x2'))('preview');var _=require(_0xa834('0x3'));var cmHopper=require(_0xa834('0x4'));var cmHopperFinal=require(_0xa834('0x5'));var cmHopperHistory=require(_0xa834('0x6'));var cmHopperBlack=require(_0xa834('0x7'));var voiceQueueRt=require(_0xa834('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4ab96c){return function(_0x4bb722){logger[_0xa834('0x9')](_0x4ab96c,util[_0xa834('0xa')](_0x4bb722,{'showHidden':![],'depth':null}));};}function create(_0x2a68e2){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopperHistory[_0xa834('0xd')](_0x2a68e2))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4c9667){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](agentReportPreview['createHistory'](_0x4c9667))['catch'](loggerCatch(_0xa834('0xe')));}function moveContact(_0x2fe9fe){return BPromise[_0xa834('0xb')]()['then'](cmHopper['moveContactManagedDialer'](_0x2fe9fe,!![]))[_0xa834('0xf')](loggerCatch(_0xa834('0x10')));}exports[_0xa834('0x11')]=function(_0x1791fc){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopperBlack[_0xa834('0x11')](_0x1791fc))[_0xa834('0xf')](loggerCatch(_0xa834('0x12')));};exports[_0xa834('0x13')]=function(_0xa9723d){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x13')](_0xa9723d))[_0xa834('0xf')](loggerCatch(_0xa834('0x14')));};exports[_0xa834('0xd')]=function(_0x5bbcea,_0x51ed3e){create(_0x5bbcea)[_0xa834('0xf')](loggerCatch(_0x51ed3e));moveContact(_0x5bbcea)['catch'](loggerCatch(_0x51ed3e));};exports[_0xa834('0x15')]=function(_0x2c91b0,_0x50ab5e){createAgent(_0x2c91b0)[_0xa834('0xf')](loggerCatch(_0x50ab5e));};exports['createCustomerHistory']=function(_0x16e840,_0x3f9491){create(_0x16e840)['catch'](loggerCatch(_0x3f9491));};exports[_0xa834('0x16')]=function(_0x449987,_0x4406b2){moveContact(_0x449987)['catch'](loggerCatch(_0x4406b2));};exports[_0xa834('0x17')]=function(_0x3d0583,_0x1e04b4,_0x420d27){if(_0x1e04b4){_0x3d0583['UserId']=null;}if(_0x420d27){_0x3d0583['active']=![];}return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x17')](_0x3d0583))[_0xa834('0xf')](loggerCatch(_0xa834('0x18')));};exports[_0xa834('0x19')]=function(_0x317af3){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x317af3))['catch'](loggerCatch(_0xa834('0x1a')));};exports[_0xa834('0x1b')]=function(_0x55ca3e){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper['unlockContact']({'UserId':null},_0x55ca3e,0x1))[_0xa834('0xf')](loggerCatch(_0xa834('0x1c')));};exports['disableContact']=function(_0x3d628f){return BPromise[_0xa834('0xb')]()['then'](cmHopper['unlockContact']({'active':![]},_0x3d628f,0x1))['catch'](loggerCatch(_0xa834('0x1d')));};exports[_0xa834('0x1e')]=function(_0x1d2adf){var _0x1c03f7={};_0x1c03f7[_0xa834('0x1f')]=_0x1d2adf[_0xa834('0x1f')];_0x1c03f7[_0xa834('0x20')]=_0x1d2adf['uniqueid'];_0x1c03f7[_0xa834('0x21')]=_0x1d2adf[_0xa834('0x21')];_0x1c03f7[_0xa834('0x22')]=_0x1d2adf[_0xa834('0x22')];_0x1c03f7['queue']=_0x1d2adf[_0xa834('0x23')];_0x1c03f7[_0xa834('0x24')]=_0x1d2adf['answertime'];_0x1c03f7[_0xa834('0x25')]=_0x1d2adf[_0xa834('0x26')];_0x1c03f7[_0xa834('0x27')]=0x1;_0x1c03f7[_0xa834('0x28')]=_0x1d2adf['endtime'];_0x1c03f7[_0xa834('0x29')]=_0x1d2adf[_0xa834('0x2a')];_0x1c03f7[_0xa834('0x2b')]=_0xa834('0x2c');_0x1c03f7[_0xa834('0x2d')]=_0xa834('0x2e');_0x1c03f7[_0xa834('0x2f')]=0x0;_0x1c03f7[_0xa834('0x30')]=0x1;_0x1c03f7[_0xa834('0x31')]=_0x1d2adf[_0xa834('0x2a')];_0x1c03f7[_0xa834('0x32')]=_0xa834('0x33');return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](voiceQueueReport[_0xa834('0x34')](_0x1c03f7))[_0xa834('0xf')](loggerCatch(_0xa834('0x35')));};exports[_0xa834('0x36')]=function(_0x487e28,_0x206239){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x36')](_0x487e28,_0x206239))[_0xa834('0xf')](loggerCatch(_0xa834('0x37')));};exports[_0xa834('0x38')]=function(_0x5df7cc){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper['rescheduleContact'](_0x5df7cc,!![],!![]))[_0xa834('0xf')](loggerCatch(_0xa834('0x39')));}; \ 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 e29294e..80f9cdf 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 _0x33a2=['state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','logLookAgent','UserId','endtime','answertime','RECALL','BOOKED','uniqueid','originate','channelAgent','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','queue','not_inuse','status','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridNumber','match','util','lodash','preview','127.0.0.1','milliseconds','diff','seconds','error','inspect','info','logger2','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x23a7f5,_0x490f8a){var _0x1ac0d3=function(_0x2ef9a4){while(--_0x2ef9a4){_0x23a7f5['push'](_0x23a7f5['shift']());}};_0x1ac0d3(++_0x490f8a);}(_0x33a2,0x14c));var _0x233a=function(_0x37c82d,_0x51024c){_0x37c82d=_0x37c82d-0x0;var _0x3fc043=_0x33a2[_0x37c82d];return _0x3fc043;};'use strict';var util=require(_0x233a('0x0'));var _=require(_0x233a('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x233a('0x2'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x233a('0x3');function getSeconds(_0x37f561,_0x3d0a1c){var _0x58ddcf=moment(_0x37f561)[_0x233a('0x4')](0x0);var _0x56fea9=moment(_0x3d0a1c)[_0x233a('0x4')](0x0);return _0x58ddcf[_0x233a('0x5')](_0x56fea9,_0x233a('0x6'));}exports['loggerCatch']=function(_0x33cd8f){return function(_0x3c7abc){logger[_0x233a('0x7')](_0x33cd8f,util[_0x233a('0x8')](_0x3c7abc,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3de158,_0x219c06){logger[_0x233a('0x9')](_0x3de158,util['inspect'](_0x219c06,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x36dd76,_0x31da11){logger[_0x233a('0x7')](_0x36dd76,util[_0x233a('0x8')](_0x31da11,{'showHidden':![],'depth':null}));};exports[_0x233a('0xa')]=function(_0x178d7c){return function(_0x174900){logger['info'](_0x178d7c,util[_0x233a('0x8')](_0x174900,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5915be,_0x3a993e,_0xb31462){return{'message':_0x5915be,'unlock':_0x3a993e,'active':_0xb31462};};exports[_0x233a('0xb')]=function(_0x26f7f2,_0x5404e0,_0x46b7e4){if(!_[_0x233a('0xc')](_0x46b7e4)&&'string'===typeof _0x46b7e4&&!_[_0x233a('0xd')](_0x46b7e4)){if(!_['isUndefined'](_0x5404e0)&&'string'===typeof _0x5404e0&&!_['isEmpty'](_0x5404e0)){return util[_0x233a('0xe')](_0x233a('0xf'),_0x5404e0,_0x46b7e4);}return util[_0x233a('0xe')]('\x22%s\x22\x20<%s>',_0x46b7e4,_0x46b7e4);}if(!_[_0x233a('0xc')](_0x26f7f2)&&_0x233a('0x10')===typeof _0x26f7f2&&!_[_0x233a('0xd')](_0x26f7f2)){return _0x26f7f2;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x565a6b){if(_[_0x233a('0x11')](_0x565a6b)){return![];}return _0x565a6b;};exports[_0x233a('0x12')]=function(_0x45bf23,_0x238cf7,_0x5cb04a,_0x242451,_0x268e70,_0x540dbd){var _0x3b1a24={'XMD-QUEUE':_0x238cf7[_0x233a('0x13')]?_0x238cf7['Queue'][_0x233a('0x14')]:'','XMD-CALLERID':_0x242451,'XMD-CALLERID-PREVIEW':_0x540dbd?util[_0x233a('0xe')](_0x233a('0xf'),_0x540dbd[_0x233a('0x15')],_0x540dbd[_0x233a('0x16')]):_0x242451,'XMD-DIALID':_0x268e70,'XMD-CONTACTID':_0x238cf7[_0x233a('0x17')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x242451,'XMD-VOICEQUEUEID':_0x238cf7[_0x233a('0x18')],'XMD-DIALCHANNEL':_0x5cb04a,'XMD-DIALTIMEOUT':_0x45bf23[_0x233a('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x233a('0xe')](_0x233a('0x1a'),_0x45bf23['dialQueueProject2']?'g':'',_[_0x233a('0xd')](_0x45bf23['monitor_format'])?'':_0x233a('0x1b')),'XMD-DIALURL':_0x45bf23['dialPreviewUrl']||'','XMD-AGI':_0x45bf23[_0x233a('0x1c')]?util[_0x233a('0xe')](_0x233a('0x1d'),ipAgi,_0x45bf23[_0x233a('0x1c')]):_0x233a('0x1e'),'XMD-AGIAFTER':_0x45bf23[_0x233a('0x1f')]?util['format'](_0x233a('0x1d'),ipAgi,_0x45bf23[_0x233a('0x1f')]):_0x233a('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x540dbd?_0x540dbd['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x540dbd?_0x540dbd[_0x233a('0x20')]:'','XMD-DESTINATION':_0x233a('0x21')};if(!_[_0x233a('0xd')](_0x45bf23['monitor_format'])){_0x3b1a24[util[_0x233a('0xe')]('%s',_0x233a('0x22'))]=_0x45bf23[_0x233a('0x23')];_0x3b1a24[util[_0x233a('0xe')]('%s',_0x233a('0x24'))]=_0x268e70;}if(_0x238cf7&&_0x238cf7[_0x233a('0x25')]){for(var _0x4b4aa5 in _0x238cf7[_0x233a('0x25')]){if(_0x238cf7[_0x233a('0x25')][_0x233a('0x26')](_0x4b4aa5)){if(!_[_0x233a('0x11')](_0x238cf7[_0x233a('0x25')][_0x4b4aa5])&&_0x4b4aa5!=='id'&&_0x4b4aa5!=='tags'&&_0x4b4aa5!==_0x233a('0x27')&&_0x4b4aa5!==_0x233a('0x28')){_0x3b1a24[util[_0x233a('0xe')]('%s%s',_0x233a('0x29'),_[_0x233a('0x2a')](_0x4b4aa5))]=_0x238cf7[_0x233a('0x25')][_0x4b4aa5];}}}}return _0x3b1a24;};exports['toLowerVariables']=function(_0x2eddbb){var _0x36fcc6={};for(var _0x55d420 in _0x2eddbb){if(_0x2eddbb[_0x233a('0x26')](_0x55d420)){_0x36fcc6[util[_0x233a('0xe')]('%s',_[_0x233a('0x2b')](_0x55d420))]=_0x2eddbb[_0x55d420];}}return{'variables':_0x36fcc6};};exports['updateOriginated']=function(_0x38c32f,_0x565e4c){if(!_[_0x233a('0x11')](_0x38c32f)){if(_0x38c32f['hasOwnProperty'](_0x233a('0x2c'))){if(_0x38c32f['originated']>0x0){_0x38c32f[_0x233a('0x2c')]-=0x1;}else{logger[_0x233a('0x7')](_0x233a('0x2d'),_0x565e4c);}}}else{logger[_0x233a('0x7')](_0x233a('0x2e'),_0x565e4c);}};exports[_0x233a('0x2f')]=function(_0x3a3c0a){var _0x43232a=moment()[_0x233a('0xe')](_0x233a('0x30'));_0x3a3c0a[_0x233a('0x31')]=0xd;_0x3a3c0a['statedesc']=_0x233a('0x32');_0x3a3c0a[_0x233a('0x33')]=_0x43232a;_0x3a3c0a[_0x233a('0x34')]=_0x43232a;_0x3a3c0a['endtime']=_0x43232a;};exports[_0x233a('0x35')]=function(_0x2397fa,_0x3a3721,_0x3095af){var _0x4f5d01=moment()['format'](_0x233a('0x30'));_0x2397fa[_0x233a('0x31')]=_0x3a3721;_0x2397fa[_0x233a('0x36')]=_0x3095af;_0x2397fa['responsetime']=_0x4f5d01;_0x2397fa[_0x233a('0x37')]=getSeconds(_0x2397fa[_0x233a('0x34')],_0x2397fa[_0x233a('0x33')]);};exports[_0x233a('0x38')]=function(_0x36368a,_0x1a0252,_0x1ece74){_0x36368a['membername']=_0x1a0252;_0x36368a[_0x233a('0x39')]=_0x1ece74;};exports['logCustomer']=function(_0x35d47c,_0xd842d5,_0x14196f){var _0x3ad4b5=moment()[_0x233a('0xe')](_0x233a('0x30'));_0x35d47c[_0x233a('0x31')]=_0xd842d5;_0x35d47c['statedesc']=_0x14196f;_0x35d47c[_0x233a('0x34')]=_0x35d47c['responsetime']?_0x35d47c[_0x233a('0x34')]:_0x3ad4b5;_0x35d47c[_0x233a('0x3a')]=_0x35d47c[_0x233a('0x3a')]?_0x35d47c[_0x233a('0x3a')]:_0x3ad4b5;_0x35d47c['ringtime']=getSeconds(_0x35d47c[_0x233a('0x34')]||0x0,_0x35d47c[_0x233a('0x33')]||0x0);_0x35d47c['talktime']=_0x35d47c[_0x233a('0x3b')]?getSeconds(_0x35d47c[_0x233a('0x3a')],_0x35d47c[_0x233a('0x3b')]):0x0;};exports['isFailure']=function(_0x1bd50d){return _0x1bd50d==='Failure';};exports['variablesAction']=function(_0x2ff34c,_0x22295f,_0x245b25,_0x1d2105,_0x61a3ad){var _0x5bc10c=_0x1d2105?_0x233a('0x3c'):_0x2ff34c['calleridname'];_0x5bc10c=_0x61a3ad?_0x233a('0x3d'):_0x5bc10c;return{'actionid':_0x2ff34c[_0x233a('0x3e')],'action':_0x233a('0x3f'),'channel':_0x2ff34c[_0x233a('0x40')],'callerid':util[_0x233a('0xe')](_0x233a('0xf'),_0x5bc10c,_0x2ff34c['calleridnum']),'Exten':_0x233a('0x21'),'Context':'from-sip','Priority':'1','variable':_0x245b25,'timeout':(_0x22295f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2ff34c['uniqueid']};};exports[_0x233a('0x41')]=function(_0xd4ca3e){return _0xd4ca3e[_0x233a('0x42')]+_0xd4ca3e[_0x233a('0x43')]+_0xd4ca3e[_0x233a('0x44')]+_0xd4ca3e['countagentrejectretry']+_0xd4ca3e[_0x233a('0x45')];};exports[_0x233a('0x46')]=function(_0x263303){var _0x3bef06=_[_0x233a('0x47')](_0x263303);_0x3bef06['state']=0xf;_0x3bef06['statedesc']='Global';return _0x3bef06;};exports[_0x233a('0x48')]=function(_0x58db8c,_0x3e3b78,_0x824edd){var _0x173a15={};_0x173a15[_0x3e3b78]=_0x58db8c[_0x3e3b78];_0x173a15[_0x233a('0x49')]=![];_0x173a15[_0x233a('0x4a')]=moment()[_0x233a('0x4b')](_0x824edd,'minutes')[_0x233a('0xe')](_0x233a('0x30'));_0x173a15['ContactId']=_0x58db8c[_0x233a('0x17')];_0x173a15[_0x233a('0x4c')]=_0x58db8c['ListId'];_0x173a15[_0x233a('0x18')]=_0x58db8c[_0x233a('0x18')]||undefined;return _0x173a15;};exports[_0x233a('0x4d')]=function(_0x335e14,_0x2cb8f7){if(!_[_0x233a('0x11')](_0x335e14)){if(_0x335e14[_0x233a('0x4e')]>0x0){_0x335e14[_0x233a('0x4e')]-=0x1;}else{logger[_0x233a('0x7')](_0x2cb8f7,_0x233a('0x4f'));}}else{logger[_0x233a('0x7')](_0x2cb8f7,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x3c1d7d){if(_0x3c1d7d<=0x0){return!![];}return![];};exports[_0x233a('0x50')]=function(_0x4bd63d,_0x38ce45,_0x1448aa){_0x4bd63d[_0x233a('0x51')]=_0x38ce45;_0x4bd63d[_0x233a('0x14')]=_0x4bd63d['queue'];_0x4bd63d[_0x233a('0x52')]=_0x4bd63d['channelAgent'];_0x4bd63d[_0x233a('0x53')]=_0x233a('0x54');if(_0x1448aa){_0x4bd63d['mandatoryDisposition']=_0x1448aa[_0x233a('0x55')];}return _0x4bd63d;};exports['buildAcw']=function(_0x33876d){var _0x5602b2={};_0x5602b2['queue']=_0x33876d[_0x233a('0x56')];_0x5602b2[_0x233a('0x52')]=_0x33876d[_0x233a('0x40')];_0x5602b2[_0x233a('0x3e')]=_0x33876d['uniqueid'];return _0x5602b2;};exports['agentReadyId']=function(_0x9a4810){var _0x3d84c3=[];for(var _0x474f71 in _0x9a4810){if(_0x9a4810['hasOwnProperty'](_0x474f71)){if(!_[_0x233a('0x11')](_0x9a4810[_0x474f71])&&_0x9a4810[_0x474f71]['state']===_0x233a('0x57')&&_0x9a4810[_0x474f71][_0x233a('0x58')]==='reachable'){_0x3d84c3[_0x233a('0x59')](_0x9a4810[_0x474f71]['id']);}}}return _0x3d84c3;};exports[_0x233a('0x5a')]=function(_0x3ac5d9){var _0x27d071=moment()[_0x233a('0x4')](0x0);var _0x300401=moment(_0x3ac5d9)[_0x233a('0x4')](0x0);return _0x27d071['diff'](_0x300401,_0x233a('0x6'));};exports[_0x233a('0x5b')]=function(_0x557817){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x557817['ContactId'],'ListId':_0x557817[_0x233a('0x4c')],'VoiceQueueId':_0x557817[_0x233a('0x18')]||undefined,'CampaignId':_0x557817[_0x233a('0x5c')]||undefined};};exports[_0x233a('0x5d')]=function(_0x348050){if(_0x348050===_0x233a('0x3e')||_0x348050===_0x233a('0x5e')||_0x348050===_0x233a('0x56')||_0x348050===_0x233a('0x5f')||_0x348050===_0x233a('0x60')||_0x348050==='dialAnswer'||_0x348050===_0x233a('0x61')||_0x348050==='channelAgent'||_0x348050===_0x233a('0x15')||_0x348050===_0x233a('0x49')||_0x348050==='calleridnum'||_0x348050===_0x233a('0x4a')||_0x348050===_0x233a('0x42')||_0x348050===_0x233a('0x43')||_0x348050===_0x233a('0x44')||_0x348050==='countglobal'||_0x348050===_0x233a('0x62')||_0x348050===_0x233a('0x63')||_0x348050==='callbackat'||_0x348050===_0x233a('0x64')||_0x348050==='ContactId'||_0x348050===_0x233a('0x4c')||_0x348050==='UserId'||_0x348050==='VoiceQueueId'||_0x348050===_0x233a('0x65')||_0x348050===_0x233a('0x66')||_0x348050===_0x233a('0x67')||_0x348050==='xmd-phone'||_0x348050===_0x233a('0x68')||_0x348050===_0x233a('0x69')||_0x348050===_0x233a('0x6a')||_0x348050===_0x233a('0x6b')||_0x348050===_0x233a('0x6c')||_0x348050===_0x233a('0x6d')||_0x348050===_0x233a('0x6e')||_0x348050===_0x233a('0x6f')||_0x348050===_0x233a('0x70')||_0x348050==='xmd-agiafter'||_0x348050===_0x233a('0x71')||_0x348050===_0x233a('0x72')||_0x348050==='rtpaudioqosbridged'||_0x348050===_0x233a('0x73')||_0x348050==='rtpaudioqosjitterbridged'||_0x348050===_0x233a('0x74')||_0x348050===_0x233a('0x75')||_0x348050==='rtpaudioqosrtt'||_0x348050==='rtpaudioqosrttbridged'||_0x348050==='rtpaudioqos'||_0x348050==='rtpaudioqosbridged'||_0x348050===_0x233a('0x73')||_0x348050===_0x233a('0x76')||_0x348050===_0x233a('0x74')||_0x348050==='rtpaudioqoslossbridged'||_0x348050===_0x233a('0x77')||_0x348050==='rtpaudioqosrttbridged'||_0x348050===_0x233a('0x78')||_0x348050==='bridgepvtcallid'||_0x348050==='state'||_0x348050===_0x233a('0x36')){return![];}return!![];};exports[_0x233a('0x79')]=function(_0x5d9093,_0x1ec47a){var _0x7913db,_0x471aea,_0x183df6;if(_0x1ec47a<=0x0){_0x1ec47a=0x1;}_0x7913db=new RegExp(_0x233a('0x7a')+_0x1ec47a+'}$');_0x471aea=Math[_0x233a('0x7b')](0xa,_0x1ec47a-0x1);_0x183df6=Math[_0x233a('0x7b')](0xa,_0x1ec47a)-0x1;return util[_0x233a('0xe')]('%s',_['replace'](_0x5d9093,_0x7913db,_[_0x233a('0x7c')](_0x471aea,_0x183df6)));};exports['extractCalleridName']=function(_0x1f2a13){var _0x592892=_0x1f2a13['match'](/"(.*?)"/);return _0x592892?_0x592892[0x1]:_0x1f2a13;};exports[_0x233a('0x7d')]=function(_0x5272db){var _0x4468a3=_0x5272db[_0x233a('0x7e')](/<(.*?)>/);return _0x4468a3?_0x4468a3[0x1]:_0x5272db;}; \ No newline at end of file +var _0xdec8=['string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','responsetime','endtime','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdec8,0x10c));var _0x8dec=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xdec8[_0x3de8a4];return _0x4635cf;};'use strict';var util=require(_0x8dec('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x8dec('0x1'))(_0x8dec('0x2'));var ipAgi=process[_0x8dec('0x3')][_0x8dec('0x4')]||_0x8dec('0x5');function getSeconds(_0x2156ff,_0x2336cf){var _0x1bb590=moment(_0x2156ff)[_0x8dec('0x6')](0x0);var _0x55d909=moment(_0x2336cf)['milliseconds'](0x0);return _0x1bb590[_0x8dec('0x7')](_0x55d909,_0x8dec('0x8'));}exports[_0x8dec('0x9')]=function(_0x4507d8){return function(_0x273c6f){logger[_0x8dec('0xa')](_0x4507d8,util[_0x8dec('0xb')](_0x273c6f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3c77bf,_0x317d46){logger[_0x8dec('0xc')](_0x3c77bf,util['inspect'](_0x317d46,{'showHidden':![],'depth':null}));};exports[_0x8dec('0xd')]=function(_0x1b7f0c,_0x398407){logger[_0x8dec('0xa')](_0x1b7f0c,util[_0x8dec('0xb')](_0x398407,{'showHidden':![],'depth':null}));};exports[_0x8dec('0xe')]=function(_0x550f09){return function(_0x512f22){logger[_0x8dec('0xc')](_0x550f09,util[_0x8dec('0xb')](_0x512f22,{'showHidden':![],'depth':null}));};};exports[_0x8dec('0xf')]=function(_0x461c8d,_0x2fbf12,_0x4fd9a6){return{'message':_0x461c8d,'unlock':_0x2fbf12,'active':_0x4fd9a6};};exports[_0x8dec('0x10')]=function(_0x29f002,_0x17a809,_0x21425e){if(!_[_0x8dec('0x11')](_0x21425e)&&_0x8dec('0x12')===typeof _0x21425e&&!_[_0x8dec('0x13')](_0x21425e)){if(!_[_0x8dec('0x11')](_0x17a809)&&_0x8dec('0x12')===typeof _0x17a809&&!_[_0x8dec('0x13')](_0x17a809)){return util[_0x8dec('0x14')](_0x8dec('0x15'),_0x17a809,_0x21425e);}return util['format'](_0x8dec('0x15'),_0x21425e,_0x21425e);}if(!_['isUndefined'](_0x29f002)&&_0x8dec('0x12')===typeof _0x29f002&&!_[_0x8dec('0x13')](_0x29f002)){return _0x29f002;}return _0x8dec('0x16');};exports['isActive']=function(_0x462fe6){if(_[_0x8dec('0x17')](_0x462fe6)){return![];}return _0x462fe6;};exports[_0x8dec('0x18')]=function(_0x39d0a1,_0x2b14a5,_0x4424c0,_0x5395a4,_0x335d76,_0x13186d){var _0x3b30ce={'XMD-QUEUE':_0x2b14a5[_0x8dec('0x19')]?_0x2b14a5[_0x8dec('0x19')]['name']:'','XMD-CALLERID':_0x5395a4,'XMD-CALLERID-PREVIEW':_0x13186d?util[_0x8dec('0x14')](_0x8dec('0x15'),_0x13186d[_0x8dec('0x1a')],_0x13186d[_0x8dec('0x1b')]):_0x5395a4,'XMD-DIALID':_0x335d76,'XMD-CONTACTID':_0x2b14a5[_0x8dec('0x1c')],'XMD-CDRTYPE':_0x8dec('0x1d'),'CALLERID(all)':_0x5395a4,'XMD-VOICEQUEUEID':_0x2b14a5[_0x8dec('0x1e')],'XMD-DIALCHANNEL':_0x4424c0,'XMD-DIALTIMEOUT':_0x39d0a1[_0x8dec('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x8dec('0x14')]('\x22rtTxX%s%s\x22',_0x39d0a1[_0x8dec('0x20')]?'g':'',_[_0x8dec('0x13')](_0x39d0a1['monitor_format'])?'':_0x8dec('0x21')),'XMD-DIALURL':_0x39d0a1['dialPreviewUrl']||'','XMD-AGI':_0x39d0a1[_0x8dec('0x22')]?util[_0x8dec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x39d0a1['dialQueueProject']):_0x8dec('0x23'),'XMD-AGIAFTER':_0x39d0a1['dialQueueProject2']?util[_0x8dec('0x14')](_0x8dec('0x24'),ipAgi,_0x39d0a1['dialQueueProject2']):_0x8dec('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x13186d?_0x13186d[_0x8dec('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x13186d?_0x13186d[_0x8dec('0x26')]:'','XMD-DESTINATION':_0x8dec('0x27')};if(!_[_0x8dec('0x13')](_0x39d0a1[_0x8dec('0x28')])){_0x3b30ce[util[_0x8dec('0x14')]('%s',_0x8dec('0x29'))]=_0x39d0a1[_0x8dec('0x28')];_0x3b30ce[util[_0x8dec('0x14')]('%s',_0x8dec('0x2a'))]=_0x335d76;}if(_0x2b14a5&&_0x2b14a5[_0x8dec('0x2b')]){for(var _0x5a0e08 in _0x2b14a5['Contact']){if(_0x2b14a5[_0x8dec('0x2b')][_0x8dec('0x2c')](_0x5a0e08)){if(!_['isNil'](_0x2b14a5[_0x8dec('0x2b')][_0x5a0e08])&&_0x5a0e08!=='id'&&_0x5a0e08!==_0x8dec('0x2d')&&_0x5a0e08!=='createdAt'&&_0x5a0e08!==_0x8dec('0x2e')){_0x3b30ce[util[_0x8dec('0x14')](_0x8dec('0x2f'),_0x8dec('0x30'),_[_0x8dec('0x31')](_0x5a0e08))]=_0x2b14a5[_0x8dec('0x2b')][_0x5a0e08];}}}}return _0x3b30ce;};exports['toLowerVariables']=function(_0x4cea3a){var _0xe04fba={};for(var _0x4d2416 in _0x4cea3a){if(_0x4cea3a[_0x8dec('0x2c')](_0x4d2416)){_0xe04fba[util[_0x8dec('0x14')]('%s',_['toLower'](_0x4d2416))]=_0x4cea3a[_0x4d2416];}}return{'variables':_0xe04fba};};exports[_0x8dec('0x32')]=function(_0x1235c9,_0x32f784){if(!_[_0x8dec('0x17')](_0x1235c9)){if(_0x1235c9[_0x8dec('0x2c')](_0x8dec('0x33'))){if(_0x1235c9[_0x8dec('0x33')]>0x0){_0x1235c9[_0x8dec('0x33')]-=0x1;}else{logger['error'](_0x8dec('0x34'),_0x32f784);}}}else{logger[_0x8dec('0xa')](_0x8dec('0x35'),_0x32f784);}};exports[_0x8dec('0x36')]=function(_0x310e0e){var _0x582c6d=moment()[_0x8dec('0x14')](_0x8dec('0x37'));_0x310e0e[_0x8dec('0x38')]=0xd;_0x310e0e[_0x8dec('0x39')]=_0x8dec('0x3a');_0x310e0e[_0x8dec('0x3b')]=_0x582c6d;_0x310e0e['responsetime']=_0x582c6d;_0x310e0e['endtime']=_0x582c6d;};exports[_0x8dec('0x3c')]=function(_0x3c7297,_0x544fb8,_0x2d23ed){var _0x1cf200=moment()[_0x8dec('0x14')](_0x8dec('0x37'));_0x3c7297[_0x8dec('0x38')]=_0x544fb8;_0x3c7297[_0x8dec('0x39')]=_0x2d23ed;_0x3c7297['responsetime']=_0x1cf200;_0x3c7297[_0x8dec('0x3d')]=getSeconds(_0x3c7297['responsetime'],_0x3c7297[_0x8dec('0x3b')]);};exports[_0x8dec('0x3e')]=function(_0xbfea93,_0x2ef086,_0xcc6043){_0xbfea93[_0x8dec('0x3f')]=_0x2ef086;_0xbfea93[_0x8dec('0x40')]=_0xcc6043;};exports[_0x8dec('0x41')]=function(_0x458d10,_0x1dd825,_0x516c21){var _0x594543=moment()['format'](_0x8dec('0x37'));_0x458d10[_0x8dec('0x38')]=_0x1dd825;_0x458d10['statedesc']=_0x516c21;_0x458d10['responsetime']=_0x458d10[_0x8dec('0x42')]?_0x458d10[_0x8dec('0x42')]:_0x594543;_0x458d10[_0x8dec('0x43')]=_0x458d10[_0x8dec('0x43')]?_0x458d10['endtime']:_0x594543;_0x458d10['ringtime']=getSeconds(_0x458d10['responsetime']||0x0,_0x458d10[_0x8dec('0x3b')]||0x0);_0x458d10[_0x8dec('0x44')]=_0x458d10[_0x8dec('0x45')]?getSeconds(_0x458d10['endtime'],_0x458d10[_0x8dec('0x45')]):0x0;};exports[_0x8dec('0x46')]=function(_0x5b8f15){return _0x5b8f15==='Failure';};exports['variablesAction']=function(_0x2ce18d,_0xbb6ef7,_0x900465,_0x416b83,_0x419d26){var _0x269c0d=_0x416b83?_0x8dec('0x47'):_0x2ce18d[_0x8dec('0x1a')];_0x269c0d=_0x419d26?_0x8dec('0x48'):_0x269c0d;return{'actionid':_0x2ce18d[_0x8dec('0x49')],'action':_0x8dec('0x4a'),'channel':_0x2ce18d[_0x8dec('0x4b')],'callerid':util['format'](_0x8dec('0x15'),_0x269c0d,_0x2ce18d[_0x8dec('0x1b')]),'Exten':_0x8dec('0x27'),'Context':_0x8dec('0x4c'),'Priority':'1','variable':_0x900465,'timeout':(_0xbb6ef7[_0x8dec('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ce18d[_0x8dec('0x49')]};};exports[_0x8dec('0x4e')]=function(_0x365ce7){return _0x365ce7[_0x8dec('0x4f')]+_0x365ce7[_0x8dec('0x50')]+_0x365ce7[_0x8dec('0x51')]+_0x365ce7[_0x8dec('0x52')]+_0x365ce7[_0x8dec('0x53')];};exports[_0x8dec('0x54')]=function(_0x487a5a){var _0x52d4f4=_[_0x8dec('0x55')](_0x487a5a);_0x52d4f4[_0x8dec('0x38')]=0xf;_0x52d4f4['statedesc']='Global';return _0x52d4f4;};exports[_0x8dec('0x56')]=function(_0x4d9117,_0x34bae3,_0x22271a){var _0x9a1400={};_0x9a1400[_0x34bae3]=_0x4d9117[_0x34bae3];_0x9a1400[_0x8dec('0x57')]=![];_0x9a1400['scheduledat']=moment()[_0x8dec('0x58')](_0x22271a,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9a1400[_0x8dec('0x1c')]=_0x4d9117['ContactId'];_0x9a1400[_0x8dec('0x59')]=_0x4d9117[_0x8dec('0x59')];_0x9a1400[_0x8dec('0x1e')]=_0x4d9117[_0x8dec('0x1e')]||undefined;return _0x9a1400;};exports[_0x8dec('0x5a')]=function(_0x14a723,_0x521104){if(!_['isNil'](_0x14a723)){if(_0x14a723[_0x8dec('0x5b')]>0x0){_0x14a723[_0x8dec('0x5b')]-=0x1;}else{logger['error'](_0x521104,_0x8dec('0x5c'));}}else{logger[_0x8dec('0xa')](_0x521104,_0x8dec('0x5d'));}};exports[_0x8dec('0x5e')]=function(_0x40ac7c){if(_0x40ac7c<=0x0){return!![];}return![];};exports[_0x8dec('0x5f')]=function(_0x252202,_0xdbda5f,_0x202275){_0x252202[_0x8dec('0x60')]=_0xdbda5f;_0x252202['name']=_0x252202['queue'];_0x252202[_0x8dec('0x61')]=_0x252202['channelAgent'];_0x252202['motionChannel']=_0x8dec('0x62');if(_0x202275){_0x252202[_0x8dec('0x63')]=_0x202275[_0x8dec('0x63')];}return _0x252202;};exports[_0x8dec('0x64')]=function(_0xe29ea1){var _0x195de0={};_0x195de0[_0x8dec('0x65')]=_0xe29ea1[_0x8dec('0x65')];_0x195de0[_0x8dec('0x61')]=_0xe29ea1[_0x8dec('0x4b')];_0x195de0[_0x8dec('0x49')]=_0xe29ea1[_0x8dec('0x49')];return _0x195de0;};exports['agentReadyId']=function(_0x44570e){var _0x5975cf=[];for(var _0x29ef69 in _0x44570e){if(_0x44570e[_0x8dec('0x2c')](_0x29ef69)){if(!_[_0x8dec('0x17')](_0x44570e[_0x29ef69])&&_0x44570e[_0x29ef69]['state']===_0x8dec('0x66')&&_0x44570e[_0x29ef69][_0x8dec('0x67')]===_0x8dec('0x68')){_0x5975cf[_0x8dec('0x69')](_0x44570e[_0x29ef69]['id']);}}}return _0x5975cf;};exports[_0x8dec('0x6a')]=function(_0x4daa60){var _0x6c556a=moment()[_0x8dec('0x6')](0x0);var _0xd9a04d=moment(_0x4daa60)[_0x8dec('0x6')](0x0);return _0x6c556a[_0x8dec('0x7')](_0xd9a04d,'seconds');};exports[_0x8dec('0x6b')]=function(_0x38e300){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38e300['ContactId'],'ListId':_0x38e300[_0x8dec('0x59')],'VoiceQueueId':_0x38e300[_0x8dec('0x1e')]||undefined,'CampaignId':_0x38e300[_0x8dec('0x6c')]||undefined};};exports[_0x8dec('0x6d')]=function(_0x526d0d){if(_0x526d0d===_0x8dec('0x49')||_0x526d0d===_0x8dec('0x6e')||_0x526d0d===_0x8dec('0x65')||_0x526d0d==='type'||_0x526d0d===_0x8dec('0x6f')||_0x526d0d===_0x8dec('0x70')||_0x526d0d===_0x8dec('0x3f')||_0x526d0d===_0x8dec('0x4b')||_0x526d0d===_0x8dec('0x1a')||_0x526d0d==='active'||_0x526d0d===_0x8dec('0x1b')||_0x526d0d==='scheduledat'||_0x526d0d===_0x8dec('0x4f')||_0x526d0d==='countcongestionretry'||_0x526d0d===_0x8dec('0x51')||_0x526d0d===_0x8dec('0x71')||_0x526d0d===_0x8dec('0x72')||_0x526d0d===_0x8dec('0x73')||_0x526d0d===_0x8dec('0x74')||_0x526d0d==='recallme'||_0x526d0d===_0x8dec('0x1c')||_0x526d0d===_0x8dec('0x59')||_0x526d0d===_0x8dec('0x40')||_0x526d0d===_0x8dec('0x1e')||_0x526d0d==='sipcallid'||_0x526d0d===_0x8dec('0x75')||_0x526d0d===_0x8dec('0x76')||_0x526d0d===_0x8dec('0x77')||_0x526d0d===_0x8dec('0x78')||_0x526d0d===_0x8dec('0x79')||_0x526d0d==='xmd-dialtimeout'||_0x526d0d===_0x8dec('0x7a')||_0x526d0d===_0x8dec('0x7b')||_0x526d0d===_0x8dec('0x7c')||_0x526d0d==='xmd-contactid'||_0x526d0d===_0x8dec('0x7d')||_0x526d0d===_0x8dec('0x7e')||_0x526d0d==='xmd-agiafter'||_0x526d0d===_0x8dec('0x7f')||_0x526d0d===_0x8dec('0x80')||_0x526d0d==='rtpaudioqosbridged'||_0x526d0d===_0x8dec('0x81')||_0x526d0d===_0x8dec('0x82')||_0x526d0d==='rtpaudioqosloss'||_0x526d0d==='rtpaudioqoslossbridged'||_0x526d0d==='rtpaudioqosrtt'||_0x526d0d===_0x8dec('0x83')||_0x526d0d===_0x8dec('0x80')||_0x526d0d===_0x8dec('0x84')||_0x526d0d===_0x8dec('0x81')||_0x526d0d==='rtpaudioqosjitterbridged'||_0x526d0d===_0x8dec('0x85')||_0x526d0d===_0x8dec('0x86')||_0x526d0d==='rtpaudioqosrtt'||_0x526d0d===_0x8dec('0x83')||_0x526d0d===_0x8dec('0x87')||_0x526d0d===_0x8dec('0x88')||_0x526d0d===_0x8dec('0x38')||_0x526d0d===_0x8dec('0x39')){return![];}return!![];};exports[_0x8dec('0x89')]=function(_0x2fa8d6,_0x7259dd){var _0x2b4e56,_0x5a2e32,_0x101ae3;if(_0x7259dd<=0x0){_0x7259dd=0x1;}_0x2b4e56=new RegExp(_0x8dec('0x8a')+_0x7259dd+'}$');_0x5a2e32=Math[_0x8dec('0x8b')](0xa,_0x7259dd-0x1);_0x101ae3=Math[_0x8dec('0x8b')](0xa,_0x7259dd)-0x1;return util['format']('%s',_[_0x8dec('0x8c')](_0x2fa8d6,_0x2b4e56,_['random'](_0x5a2e32,_0x101ae3)));};exports['extractCalleridName']=function(_0x3911f1){var _0x13ffbe=_0x3911f1[_0x8dec('0x8d')](/"(.*?)"/);return _0x13ffbe?_0x13ffbe[0x1]:_0x3911f1;};exports[_0x8dec('0x8e')]=function(_0x4e5ea1){var _0x361fe2=_0x4e5ea1[_0x8dec('0x8d')](/<(.*?)>/);return _0x361fe2?_0x361fe2[0x1]:_0x4e5ea1;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 376e005..103085b 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 _0x2706=['queueremove','queuepause','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2706,0xa4));var _0x6270=function(_0x22fd98,_0x109b4c){_0x22fd98=_0x22fd98-0x0;var _0x25ff1e=_0x2706[_0x22fd98];return _0x25ff1e;};'use strict';exports[_0x6270('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6270('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x6270('0x2'),'required':![]},'paused':{'type':_0x6270('0x3'),'required':![]}};exports[_0x6270('0x4')]={'queue':{'type':_0x6270('0x1'),'required':!![]},'interface':{'type':_0x6270('0x1'),'required':!![]}};exports[_0x6270('0x5')]={'interface':{'type':_0x6270('0x1'),'required':!![]},'paused':{'type':_0x6270('0x3')},'reason':{'type':_0x6270('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6270('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x6270('0x1')},'mixmonitorid':{'type':_0x6270('0x1')}};exports[_0x6270('0x6')]={'uniqueid':{'type':_0x6270('0x1'),'required':!![]}};exports[_0x6270('0x7')]={'uniqueid':{'type':_0x6270('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6270('0x1')}}; \ No newline at end of file +var _0x36e3=['string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x19a4a1,_0x19bba6){var _0x3b6c2c=function(_0x552fc8){while(--_0x552fc8){_0x19a4a1['push'](_0x19a4a1['shift']());}};_0x3b6c2c(++_0x19bba6);}(_0x36e3,0x64));var _0x336e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x36e3[_0x5783f4];return _0x28e380;};'use strict';exports['queueadd']={'queue':{'type':_0x336e('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x336e('0x1'),'required':![]},'paused':{'type':_0x336e('0x2'),'required':![]}};exports[_0x336e('0x3')]={'queue':{'type':_0x336e('0x0'),'required':!![]},'interface':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x4')]={'interface':{'type':_0x336e('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x336e('0x0'),'required':![]}};exports[_0x336e('0x5')]={'module':{'type':_0x336e('0x0'),'required':![]}};exports[_0x336e('0x6')]={'uniqueid':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x336e('0x0')},'mixmonitorid':{'type':_0x336e('0x0')}};exports[_0x336e('0x8')]={'uniqueid':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x336e('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 1be82b0..06c6092 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 _0x6222=['interface','hasOwnProperty','total','answered','sumBillable','isEmpty','unmanaged','abandoned','sumHoldTime','sumDuration','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isNil','agents','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','lodash','moment','../model/voiceQueue','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','SIP/%s','name','format'];(function(_0x1a3550,_0x23a59a){var _0x2372d0=function(_0xccfe00){while(--_0xccfe00){_0x1a3550['push'](_0x1a3550['shift']());}};_0x2372d0(++_0x23a59a);}(_0x6222,0x10b));var _0x2622=function(_0x31d2a7,_0x5357e9){_0x31d2a7=_0x31d2a7-0x0;var _0x472b0f=_0x6222[_0x31d2a7];return _0x472b0f;};'use strict';var BPromise=require('bluebird');var util=require(_0x2622('0x0'));var _=require(_0x2622('0x1'));var moment=require(_0x2622('0x2'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x2622('0x3'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x2622('0x4'));var ZendeskAccount=require(_0x2622('0x5'));var SalesforceAccount=require(_0x2622('0x6'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x2622('0x7'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x2622('0x8'));var VtigerAccount=require(_0x2622('0x9'));var ServicenowAccount=require(_0x2622('0xa'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x2622('0xb'));var FaxAccount=require(_0x2622('0xc'));var Realtime=function(){this['agents']={};this[_0x2622('0xd')]={};this[_0x2622('0xe')]={};this[_0x2622('0xf')]={};this[_0x2622('0x10')]={};this['campaigns']={};this[_0x2622('0x11')]={};this[_0x2622('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2622('0x13')]={};this[_0x2622('0x14')]={};this[_0x2622('0x15')]={};this[_0x2622('0x16')]={};this[_0x2622('0x17')]={};this[_0x2622('0x18')]={};this['salesforceAccounts']={};this[_0x2622('0x19')]={};this['freshdeskAccounts']={};this[_0x2622('0x1a')]={};this[_0x2622('0x1b')]={};this[_0x2622('0x1c')]={};this[_0x2622('0x1d')]={};this[_0x2622('0x1e')]={};this[_0x2622('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x36f29c,_0x3fd79e,_0x2e738f){var _0xe9bfa3=_[_0x2622('0x20')](_0x36f29c,function(_0x380c2d,_0x20dc93){return _0x380c2d[_0x2e738f];});for(var _0x1a7768 in _0x3fd79e){if(_0x3fd79e['hasOwnProperty'](_0x1a7768)){if(!_0xe9bfa3[_0x1a7768]){delete _0x3fd79e[_0x1a7768];}}}}function freeIsNotKeySip(_0x2bb2c5,_0x3fb11d){var _0x4cb452=_[_0x2622('0x20')](_0x2bb2c5,function(_0x1b15e1,_0xfb6874){return util['format'](_0x2622('0x21'),_0x1b15e1[_0x2622('0x22')]);});for(var _0x2815ee in _0x3fb11d){if(_0x3fb11d['hasOwnProperty'](_0x2815ee)){if(!_0x4cb452[_0x2815ee]){delete _0x3fb11d[_0x2815ee];}}}}function freeIsNotKeyAgent(_0x161836,_0x1d2d5f){var _0x5160ee=_['mapKeys'](_0x161836,function(_0x283447,_0x638f06){var _0x477ba8=_['isNil'](_0x283447['interface'])?util[_0x2622('0x23')](_0x2622('0x21'),_0x283447['name']):_0x283447[_0x2622('0x24')];return _0x477ba8;});for(var _0x50122e in _0x1d2d5f){if(_0x1d2d5f[_0x2622('0x25')](_0x50122e)){if(!_0x5160ee[_0x50122e]){delete _0x1d2d5f[_0x50122e];}}}}function clearVoiceCallReports(_0xe563f3){_0xe563f3[_0x2622('0x26')]=0x0;_0xe563f3[_0x2622('0x27')]=0x0;_0xe563f3['sumHoldTime']=0x0;_0xe563f3['sumDuration']=0x0;_0xe563f3[_0x2622('0x28')]=0x0;}function clearCampaigns(_0x459b2b){if(!_[_0x2622('0x29')](_0x459b2b)){for(var _0x341d74 in _0x459b2b){if(_0x459b2b[_0x2622('0x25')](_0x341d74)){_0x459b2b[_0x341d74]['ivrTotalCallsDays']=0x0;_0x459b2b[_0x341d74]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1e052e){if(!_[_0x2622('0x29')](_0x1e052e)){for(var _0x201c2a in _0x1e052e){if(_0x1e052e[_0x2622('0x25')](_0x201c2a)){_0x1e052e[_0x201c2a][_0x2622('0x26')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x27')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2a')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2b')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2c')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2d')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x28')]=0x0;_0x1e052e[_0x201c2a]['outboundAnswerAgiCallsDay']=0x0;_0x1e052e[_0x201c2a]['outboundNoAnswerCallsDay']=0x0;_0x1e052e[_0x201c2a]['outboundBusyCallsDay']=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2e')]=0x0;_0x1e052e[_0x201c2a]['outboundNoSuchCallsDay']=0x0;_0x1e052e[_0x201c2a][_0x2622('0x2f')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x30')]=0x0;_0x1e052e[_0x201c2a]['outboundDropCallsDayCallersExit']=0x0;_0x1e052e[_0x201c2a]['outboundBlacklistCallsDay']=0x0;_0x1e052e[_0x201c2a][_0x2622('0x31')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x32')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x33')]=0x0;_0x1e052e[_0x201c2a]['outboundAnswerAgiCallsDay']=0x0;_0x1e052e[_0x201c2a][_0x2622('0x34')]=0x0;_0x1e052e[_0x201c2a][_0x2622('0x35')]=!![];}}}}Realtime[_0x2622('0x36')][_0x2622('0x37')]=function(_0x261912,_0x6c2c43){for(var _0x2f4a19 in _0x6c2c43){if(_0x261912['hasOwnProperty'](_0x2f4a19)){_0x261912[_0x2f4a19]=_0x6c2c43[_0x2f4a19];}}};Realtime[_0x2622('0x36')]['initAgents']=function(){var _0x946d64=this;return function(_0x324b0f){if(_0x324b0f){freeIsNotKeyAgent(_0x324b0f,_0x946d64['agents']);for(var _0x1e1997=0x0,_0xd021a6={},_0x477f9a={};_0x1e1997<_0x324b0f[_0x2622('0x38')];_0x1e1997+=0x1){_0xd021a6=_0x324b0f[_0x1e1997];var _0x4ce002=_[_0x2622('0x39')](_0xd021a6[_0x2622('0x24')])?util[_0x2622('0x23')](_0x2622('0x21'),_0xd021a6[_0x2622('0x22')]):_0xd021a6[_0x2622('0x24')];if(_['isUndefined'](_0x946d64[_0x2622('0x3a')][_0x4ce002])){_0x946d64['agents'][_0x4ce002]=new Agent(_0xd021a6);}else{_0x946d64['mergeFromDatabase'](_0x946d64[_0x2622('0x3a')][_0x4ce002],_0xd021a6);}}}return _0x946d64[_0x2622('0x3a')];};};Realtime[_0x2622('0x36')]['initTelephones']=function(){var _0x162eeb=this;return function(_0x4bbdff){if(_0x4bbdff){freeIsNotKeySip(_0x4bbdff,_0x162eeb['telephones']);for(var _0x580a93=0x0,_0x206ead={},_0x55c202={};_0x580a93<_0x4bbdff[_0x2622('0x38')];_0x580a93+=0x1){_0x206ead=_0x4bbdff[_0x580a93];if(_[_0x2622('0x3b')](_0x162eeb[_0x2622('0xd')][util[_0x2622('0x23')]('SIP/%s',_0x206ead[_0x2622('0x22')])])){_0x162eeb[_0x2622('0xd')][util['format']('SIP/%s',_0x206ead[_0x2622('0x22')])]=new Telephone(_0x206ead);}else{_0x162eeb['mergeFromDatabase'](_0x162eeb[_0x2622('0xd')][util[_0x2622('0x23')](_0x2622('0x21'),_0x206ead['name'])],_0x206ead);}}}return _0x162eeb[_0x2622('0xd')];};};Realtime['prototype'][_0x2622('0x3c')]=function(){var _0x1a9575=this;return function(_0x4193d9){if(_0x4193d9){freeIsNotKeySip(_0x4193d9,_0x1a9575[_0x2622('0xe')]);for(var _0x5a89d9=0x0,_0x5d8360={},_0x2ace7a={};_0x5a89d9<_0x4193d9[_0x2622('0x38')];_0x5a89d9+=0x1){_0x5d8360=_0x4193d9[_0x5a89d9];if(_['isUndefined'](_0x1a9575['trunks'][util['format'](_0x2622('0x21'),_0x5d8360[_0x2622('0x22')])])){_0x1a9575[_0x2622('0xe')][util[_0x2622('0x23')](_0x2622('0x21'),_0x5d8360['name'])]=new Trunk(_0x5d8360);}else{_0x1a9575[_0x2622('0x37')](_0x1a9575[_0x2622('0xe')][util[_0x2622('0x23')](_0x2622('0x21'),_0x5d8360[_0x2622('0x22')])],_0x5d8360);}}}return _0x1a9575['trunks'];};};Realtime[_0x2622('0x36')][_0x2622('0x3d')]=function(){var _0x1d4832=this;return function(_0x12cc5e){if(_0x12cc5e){freeIsNotKey(_0x12cc5e,_0x1d4832[_0x2622('0xf')],'name');for(var _0x2c5110=0x0,_0x45a100={},_0x533a2c={};_0x2c5110<_0x12cc5e['length'];_0x2c5110+=0x1){_0x45a100=_0x12cc5e[_0x2c5110];if(_[_0x2622('0x3b')](_0x1d4832[_0x2622('0xf')][_0x45a100[_0x2622('0x22')]])){_0x1d4832[_0x2622('0xf')][_0x45a100['name']]=new VoiceQueue(_0x45a100);}else{_0x1d4832[_0x2622('0x37')](_0x1d4832[_0x2622('0xf')][_0x45a100[_0x2622('0x22')]],_0x45a100);}}}return _0x1d4832[_0x2622('0xf')];};};Realtime[_0x2622('0x36')][_0x2622('0x3e')]=function(){var _0x1a182a=this;return function(_0x23cc4f){if(_0x23cc4f){freeIsNotKey(_0x23cc4f,_0x1a182a[_0x2622('0x10')],'id');for(var _0x4ba208=0x0,_0x403041={},_0x1de812={};_0x4ba208<_0x23cc4f[_0x2622('0x38')];_0x4ba208+=0x1){_0x403041=_0x23cc4f[_0x4ba208];if(_['isUndefined'](_0x1a182a[_0x2622('0x10')][_0x403041['id']])){_0x1a182a['triggers'][_0x403041['id']]=new Trigger(_0x403041);}else{_0x1a182a[_0x2622('0x37')](_0x1a182a['triggers'][_0x403041['id']],_0x403041);}}}return _0x1a182a[_0x2622('0x10')];};};Realtime[_0x2622('0x36')][_0x2622('0x3f')]=function(){var _0x223a98=this;return function(_0x167132){if(_0x167132){freeIsNotKey(_0x167132,_0x223a98[_0x2622('0x11')],'id');for(var _0xa83092=0x0,_0x2ab83c={},_0x1a0354={};_0xa83092<_0x167132['length'];_0xa83092+=0x1){_0x2ab83c=_0x167132[_0xa83092];if(_['isUndefined'](_0x223a98[_0x2622('0x11')][_0x2ab83c['id']])){_0x223a98[_0x2622('0x11')][_0x2ab83c['id']]=new Template(_0x2ab83c);}else{_0x223a98[_0x2622('0x37')](_0x223a98[_0x2622('0x11')][_0x2ab83c['id']],_0x2ab83c);}}}return _0x223a98[_0x2622('0x11')];};};Realtime['prototype'][_0x2622('0x40')]=function(){var _0x22137a=this;return function(_0x5480d8){if(_0x5480d8){freeIsNotKey(_0x5480d8,_0x22137a[_0x2622('0x18')],'id');for(var _0x293165=0x0,_0xf50890={},_0x23ae74={};_0x293165<_0x5480d8[_0x2622('0x38')];_0x293165+=0x1){_0xf50890=_0x5480d8[_0x293165];if(_[_0x2622('0x3b')](_0x22137a[_0x2622('0x18')][_0xf50890['id']])){_0x22137a[_0x2622('0x18')][_0xf50890['id']]=new ZendeskAccount(_0xf50890);}else{_0x22137a['mergeFromDatabase'](_0x22137a['zendeskAccounts'][_0xf50890['id']],_0xf50890);}}}return _0x22137a[_0x2622('0x18')];};};Realtime[_0x2622('0x36')][_0x2622('0x41')]=function(){var _0x5685cb=this;return function(_0x50cfc9){if(_0x50cfc9){freeIsNotKey(_0x50cfc9,_0x5685cb[_0x2622('0x42')],'id');for(var _0x2be92e=0x0,_0x26e865={},_0x5b531c={};_0x2be92e<_0x50cfc9['length'];_0x2be92e+=0x1){_0x26e865=_0x50cfc9[_0x2be92e];if(_[_0x2622('0x3b')](_0x5685cb['salesforceAccounts'][_0x26e865['id']])){_0x5685cb['salesforceAccounts'][_0x26e865['id']]=new SalesforceAccount(_0x26e865);}else{_0x5685cb[_0x2622('0x37')](_0x5685cb[_0x2622('0x42')][_0x26e865['id']],_0x26e865);}}}return _0x5685cb[_0x2622('0x42')];};};Realtime[_0x2622('0x36')]['initFreshdeskAccounts']=function(){var _0x1e1faf=this;return function(_0x39d488){if(_0x39d488){freeIsNotKey(_0x39d488,_0x1e1faf[_0x2622('0x43')],'id');for(var _0xd6f5cb=0x0,_0x5c191d={},_0x29b10c={};_0xd6f5cb<_0x39d488[_0x2622('0x38')];_0xd6f5cb+=0x1){_0x5c191d=_0x39d488[_0xd6f5cb];if(_[_0x2622('0x3b')](_0x1e1faf[_0x2622('0x43')][_0x5c191d['id']])){_0x1e1faf[_0x2622('0x43')][_0x5c191d['id']]=new FreshdeskAccount(_0x5c191d);}else{_0x1e1faf[_0x2622('0x37')](_0x1e1faf[_0x2622('0x43')][_0x5c191d['id']],_0x5c191d);}}}return _0x1e1faf[_0x2622('0x43')];};};Realtime[_0x2622('0x36')][_0x2622('0x44')]=function(){var _0x17e2e1=this;return function(_0x593a1e){if(_0x593a1e){freeIsNotKey(_0x593a1e,_0x17e2e1[_0x2622('0x1a')],'id');for(var _0x459da9=0x0,_0x951486={},_0x50f277={};_0x459da9<_0x593a1e[_0x2622('0x38')];_0x459da9+=0x1){_0x951486=_0x593a1e[_0x459da9];if(_[_0x2622('0x3b')](_0x17e2e1[_0x2622('0x1a')][_0x951486['id']])){_0x17e2e1[_0x2622('0x1a')][_0x951486['id']]=new ZohoAccount(_0x951486);}else{_0x17e2e1['mergeFromDatabase'](_0x17e2e1[_0x2622('0x1a')][_0x951486['id']],_0x951486);}}}return _0x17e2e1['zohoAccounts'];};};Realtime[_0x2622('0x36')][_0x2622('0x45')]=function(){var _0x261635=this;return function(_0x4418e0){if(_0x4418e0){freeIsNotKey(_0x4418e0,_0x261635[_0x2622('0x1b')],'id');for(var _0x181169=0x0,_0x19ffa4={},_0x46d636={};_0x181169<_0x4418e0[_0x2622('0x38')];_0x181169+=0x1){_0x19ffa4=_0x4418e0[_0x181169];if(_[_0x2622('0x3b')](_0x261635[_0x2622('0x1b')][_0x19ffa4['id']])){_0x261635[_0x2622('0x1b')][_0x19ffa4['id']]=new DeskAccount(_0x19ffa4);}else{_0x261635[_0x2622('0x37')](_0x261635['deskAccounts'][_0x19ffa4['id']],_0x19ffa4);}}}return _0x261635[_0x2622('0x1b')];};};Realtime['prototype'][_0x2622('0x46')]=function(){var _0x4d0315=this;return function(_0x4650cf){if(_0x4650cf){freeIsNotKey(_0x4650cf,_0x4d0315['sugarcrmAccounts'],'id');for(var _0x59be4a=0x0,_0x323b7f={},_0x23a4e3={};_0x59be4a<_0x4650cf['length'];_0x59be4a+=0x1){_0x323b7f=_0x4650cf[_0x59be4a];if(_['isUndefined'](_0x4d0315[_0x2622('0x19')][_0x323b7f['id']])){_0x4d0315[_0x2622('0x19')][_0x323b7f['id']]=new SugarcrmAccount(_0x323b7f);}else{_0x4d0315[_0x2622('0x37')](_0x4d0315[_0x2622('0x19')][_0x323b7f['id']],_0x323b7f);}}}return _0x4d0315[_0x2622('0x19')];};};Realtime[_0x2622('0x36')][_0x2622('0x47')]=function(){var _0x26aa55=this;return function(_0x26751f){if(_0x26751f){freeIsNotKey(_0x26751f,_0x26aa55[_0x2622('0x1c')],'id');for(var _0x223a94=0x0,_0x191738={},_0x36adb5={};_0x223a94<_0x26751f['length'];_0x223a94+=0x1){_0x191738=_0x26751f[_0x223a94];if(_[_0x2622('0x3b')](_0x26aa55[_0x2622('0x1c')][_0x191738['id']])){_0x26aa55[_0x2622('0x1c')][_0x191738['id']]=new VtigerAccount(_0x191738);}else{_0x26aa55[_0x2622('0x37')](_0x26aa55[_0x2622('0x1c')][_0x191738['id']],_0x191738);}}}return _0x26aa55[_0x2622('0x1c')];};};Realtime[_0x2622('0x36')]['initServicenowAccounts']=function(){var _0x2853a3=this;return function(_0x238d92){if(_0x238d92){freeIsNotKey(_0x238d92,_0x2853a3['servicenowAccounts'],'id');for(var _0x4d2818=0x0,_0x2b8207={},_0x13ed5c={};_0x4d2818<_0x238d92[_0x2622('0x38')];_0x4d2818+=0x1){_0x2b8207=_0x238d92[_0x4d2818];if(_[_0x2622('0x3b')](_0x2853a3[_0x2622('0x1d')][_0x2b8207['id']])){_0x2853a3[_0x2622('0x1d')][_0x2b8207['id']]=new ServicenowAccount(_0x2b8207);}else{_0x2853a3['mergeFromDatabase'](_0x2853a3[_0x2622('0x1d')][_0x2b8207['id']],_0x2b8207);}}}return _0x2853a3['servicenowAccounts'];};};Realtime[_0x2622('0x36')][_0x2622('0x48')]=function(){var _0x3dfdd2=this;return function(_0x542dd9){if(_0x542dd9){freeIsNotKey(_0x542dd9,_0x3dfdd2[_0x2622('0x1e')],'id');for(var _0x2528b5=0x0,_0x23dc21={},_0x3f808b={};_0x2528b5<_0x542dd9['length'];_0x2528b5+=0x1){_0x23dc21=_0x542dd9[_0x2528b5];if(_['isUndefined'](_0x3dfdd2[_0x2622('0x1e')][_0x23dc21['id']])){_0x3dfdd2['dynamics365Accounts'][_0x23dc21['id']]=new Dynamics365Account(_0x23dc21);}else{_0x3dfdd2[_0x2622('0x37')](_0x3dfdd2[_0x2622('0x1e')][_0x23dc21['id']],_0x23dc21);}}}return _0x3dfdd2['dynamics365Accounts'];};};Realtime[_0x2622('0x36')][_0x2622('0x49')]=function(){var _0x10cc58=this;return function(_0x10e5b4){if(_0x10e5b4){freeIsNotKey(_0x10e5b4,_0x10cc58['freshsalesAccounts'],'id');for(var _0x352084=0x0,_0x5cadbc={},_0x2e8806={};_0x352084<_0x10e5b4['length'];_0x352084+=0x1){_0x5cadbc=_0x10e5b4[_0x352084];if(_['isUndefined'](_0x10cc58['freshsalesAccounts'][_0x5cadbc['id']])){_0x10cc58[_0x2622('0x1f')][_0x5cadbc['id']]=new FreshsalesAccount(_0x5cadbc);}else{_0x10cc58['mergeFromDatabase'](_0x10cc58[_0x2622('0x1f')][_0x5cadbc['id']],_0x5cadbc);}}}return _0x10cc58[_0x2622('0x1f')];};};Realtime[_0x2622('0x36')][_0x2622('0x4a')]=function(){var _0x255601=this;return function(_0x1cffa4){for(var _0x5500b6=0x0;_0x5500b6<_0x1cffa4[_0x2622('0x38')];_0x5500b6+=0x1){_[_0x2622('0x4b')](_0x255601['voiceQueues'][_0x1cffa4[_0x5500b6][_0x2622('0x22')]],_0x1cffa4[_0x5500b6]);}return _0x255601[_0x2622('0xf')];};};Realtime[_0x2622('0x36')][_0x2622('0x4c')]=function(){var _0x1a1f41=this;return function(_0x5c8887){clearVoiceQueues(_0x1a1f41[_0x2622('0xf')]);if(_0x5c8887){_0x5c8887=_[_0x2622('0x4d')](_0x5c8887,_0x2622('0x4e'));for(var _0x21a9b2 in _0x5c8887){if(_0x5c8887[_0x2622('0x25')](_0x21a9b2)){var _0xea3205={};for(var _0x5cda59=0x0;_0x5cda59<_0x5c8887[_0x21a9b2]['length'];_0x5cda59+=0x1){var _0x3b9fcf=_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x4f')];if(_0x1a1f41['voiceQueues'][_0x3b9fcf]){if(_0x5c8887[_0x21a9b2][_0x5cda59]['queuecallerexit']){_0x1a1f41[_0x2622('0xf')][_0x3b9fcf][_0x2622('0x2a')]+=0x1;}if(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x50')]){_0x1a1f41[_0x2622('0xf')][_0x3b9fcf][_0x2622('0x2b')]+=0x1;}_0x1a1f41['voiceQueues'][_0x3b9fcf]['sumHoldTime']+=moment(_0x5c8887[_0x21a9b2][_0x5cda59]['queuecallerleaveAt'])[_0x2622('0x51')](moment(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x52')]),_0x2622('0x53'))||0x0;if(_0x5cda59===_0x5c8887[_0x21a9b2][_0x2622('0x38')]-0x1){_0x1a1f41[_0x2622('0xf')][_0x3b9fcf][_0x2622('0x2d')]+=moment(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x54')]||_0x5c8887[_0x21a9b2][_0x5cda59]['queuecallerabandonAt']||_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x55')])['diff'](moment(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x52')]),_0x2622('0x53'))||0x0;_0x1a1f41[_0x2622('0xf')][_0x3b9fcf][_0x2622('0x26')]+=0x1;if(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x56')]){_0x1a1f41['voiceQueues'][_0x3b9fcf]['answered']+=0x1;_0x1a1f41[_0x2622('0xf')][_0x3b9fcf][_0x2622('0x28')]+=moment(_0x5c8887[_0x21a9b2][_0x5cda59][_0x2622('0x54')])[_0x2622('0x51')](moment(_0x5c8887[_0x21a9b2][_0x5cda59]['queuecallerleaveAt']),_0x2622('0x53'))||0x0;}}else{_0x1a1f41['voiceQueues'][_0x3b9fcf][_0x2622('0x2d')]+=_0x1a1f41['voiceQueues'][_0x3b9fcf]['sumHoldTime']||0x0;}}}}}}return _0x1a1f41[_0x2622('0xf')];};};Realtime['prototype'][_0x2622('0x57')]=function(){var _0x142576=this;return function(_0x4b04e2){clearVoiceCallReports(_0x142576[_0x2622('0x12')]);if(_0x4b04e2){for(var _0x3fa884=0x0;_0x3fa884<_0x4b04e2[_0x2622('0x38')];_0x3fa884+=0x1){_0x142576[_0x2622('0x12')][_0x2622('0x26')]+=0x1;_0x142576['outbound']['sumDuration']+=_0x4b04e2[_0x3fa884][_0x2622('0x58')];if(_0x4b04e2[_0x3fa884]['disposition']===_0x2622('0x59')){_0x142576[_0x2622('0x12')][_0x2622('0x27')]+=0x1;_0x142576['outbound'][_0x2622('0x2c')]+=_0x4b04e2[_0x3fa884][_0x2622('0x58')]-_0x4b04e2[_0x3fa884][_0x2622('0x5a')]||0x0;_0x142576[_0x2622('0x12')]['sumBillable']+=_0x4b04e2[_0x3fa884][_0x2622('0x5a')];}}}return _0x142576[_0x2622('0x12')];};};Realtime[_0x2622('0x36')][_0x2622('0x5b')]=function(){var _0x157c8e=this;return function(_0x425f16){if(_0x425f16){freeIsNotKey(_0x425f16,_0x157c8e[_0x2622('0x5c')],'name');for(var _0x40e60e=0x0,_0xb007b6={};_0x40e60e<_0x425f16['length'];_0x40e60e+=0x1){_0xb007b6=_0x425f16[_0x40e60e];if(_['isUndefined'](_0x157c8e[_0x2622('0x5c')][_0xb007b6['name']])){_0x157c8e[_0x2622('0x5c')][_0xb007b6[_0x2622('0x22')]]=new Campaign(_0xb007b6);}else{_0x157c8e[_0x2622('0x37')](_0x157c8e[_0x2622('0x5c')][_0xb007b6[_0x2622('0x22')]],_0xb007b6);_0x157c8e[_0x2622('0x5c')][_0xb007b6[_0x2622('0x22')]][_0x2622('0x5d')]=_0xb007b6['SquareProject']?_0xb007b6[_0x2622('0x5e')][_0x2622('0x22')]:undefined;}}}return _0x157c8e[_0x2622('0x5c')];};};Realtime['prototype'][_0x2622('0x5f')]=function(){var _0x240def=this;return function(_0x27d355){if(_0x27d355){freeIsNotKey(_0x27d355,_0x240def[_0x2622('0x60')],'id');for(var _0x3ceb9e=0x0,_0x46872c={};_0x3ceb9e<_0x27d355[_0x2622('0x38')];_0x3ceb9e+=0x1){_0x46872c=_0x27d355[_0x3ceb9e];if(_[_0x2622('0x3b')](_0x240def[_0x2622('0x60')][_0x46872c['id']])){_0x240def['voiceExtensions'][_0x46872c['id']]=new VoiceExtension(_0x46872c);}else{_0x240def[_0x2622('0x37')](_0x240def['voiceExtensions'][_0x46872c['id']],_0x46872c);}}}return _0x240def[_0x2622('0x60')];};};Realtime[_0x2622('0x36')][_0x2622('0x61')]=function(){var _0x48fdfc=this;return function(_0x182e1a){clearCampaigns(_0x48fdfc[_0x2622('0x5c')]);for(var _0x4efdd4=0x0;_0x4efdd4<_0x182e1a[_0x2622('0x38')];_0x4efdd4+=0x1){_[_0x2622('0x4b')](_0x48fdfc[_0x2622('0x5c')][_0x182e1a[_0x4efdd4]['name']],_0x182e1a[_0x4efdd4]);}return _0x48fdfc[_0x2622('0x5c')];};};Realtime[_0x2622('0x36')][_0x2622('0x62')]=function(){var _0x2bd897=this;return function(_0x243194){if(_0x243194){freeIsNotKey(_0x243194,_0x2bd897['faxAccounts'],'id');for(var _0x3c036a=0x0,_0x24f7f9={},_0x17d05a={};_0x3c036a<_0x243194[_0x2622('0x38')];_0x3c036a+=0x1){_0x24f7f9=_0x243194[_0x3c036a];if(_[_0x2622('0x3b')](_0x2bd897[_0x2622('0x63')][_0x24f7f9['id']])){_0x2bd897['faxAccounts'][_0x24f7f9['id']]=new FaxAccount(_0x24f7f9);}else{_0x2bd897[_0x2622('0x37')](_0x2bd897[_0x2622('0x63')][_0x24f7f9['id']],_0x24f7f9);}}}return _0x2bd897[_0x2622('0x63')];};};module[_0x2622('0x64')]=Realtime; \ No newline at end of file +var _0xc35c=['queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid'];(function(_0x3f3519,_0xd53cae){var _0x23b6bf=function(_0x3b3e52){while(--_0x3b3e52){_0x3f3519['push'](_0x3f3519['shift']());}};_0x23b6bf(++_0xd53cae);}(_0xc35c,0x1c1));var _0xcc35=function(_0x100fa7,_0xcc26aa){_0x100fa7=_0x100fa7-0x0;var _0x2f4242=_0xc35c[_0x100fa7];return _0x2f4242;};'use strict';var BPromise=require(_0xcc35('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require(_0xcc35('0x1'));var Telephone=require(_0xcc35('0x2'));var Trunk=require(_0xcc35('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xcc35('0x4'));var Template=require(_0xcc35('0x5'));var Campaign=require(_0xcc35('0x6'));var VoiceExtension=require(_0xcc35('0x7'));var ZendeskAccount=require(_0xcc35('0x8'));var SalesforceAccount=require(_0xcc35('0x9'));var FreshdeskAccount=require(_0xcc35('0xa'));var SugarcrmAccount=require(_0xcc35('0xb'));var ZohoAccount=require(_0xcc35('0xc'));var DeskAccount=require(_0xcc35('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xcc35('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xcc35('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xcc35('0x10')]={};this[_0xcc35('0x11')]={};this[_0xcc35('0x12')]={};this[_0xcc35('0x13')]={};this[_0xcc35('0x14')]={};this[_0xcc35('0x15')]={};this[_0xcc35('0x16')]={};this[_0xcc35('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xcc35('0x18')]={};this[_0xcc35('0x19')]={};this['outboundChannels']={};this['timers']={};this[_0xcc35('0x1a')]={};this[_0xcc35('0x1b')]={};this[_0xcc35('0x1c')]={};this[_0xcc35('0x1d')]={};this[_0xcc35('0x1e')]={};this['zohoAccounts']={};this[_0xcc35('0x1f')]={};this['vtigerAccounts']={};this[_0xcc35('0x20')]={};this[_0xcc35('0x21')]={};this[_0xcc35('0x22')]={};this[_0xcc35('0x23')]={};};function freeIsNotKey(_0xa24e55,_0x283ac2,_0x1cec7e){var _0x336dd5=_[_0xcc35('0x24')](_0xa24e55,function(_0x2f229e,_0x25bcbf){return _0x2f229e[_0x1cec7e];});for(var _0x2fb3c7 in _0x283ac2){if(_0x283ac2['hasOwnProperty'](_0x2fb3c7)){if(!_0x336dd5[_0x2fb3c7]){delete _0x283ac2[_0x2fb3c7];}}}}function freeIsNotKeySip(_0x3cbb45,_0x4c4905){var _0x276add=_[_0xcc35('0x24')](_0x3cbb45,function(_0x5f3e4d,_0x1bff9d){return util[_0xcc35('0x25')](_0xcc35('0x26'),_0x5f3e4d[_0xcc35('0x27')]);});for(var _0x189326 in _0x4c4905){if(_0x4c4905[_0xcc35('0x28')](_0x189326)){if(!_0x276add[_0x189326]){delete _0x4c4905[_0x189326];}}}}function freeIsNotKeyAgent(_0x57fcc5,_0x319d58){var _0x3e6ab5=_[_0xcc35('0x24')](_0x57fcc5,function(_0x182dad,_0x106b16){var _0x1b03b4=_[_0xcc35('0x29')](_0x182dad[_0xcc35('0x2a')])?util[_0xcc35('0x25')]('SIP/%s',_0x182dad[_0xcc35('0x27')]):_0x182dad[_0xcc35('0x2a')];return _0x1b03b4;});for(var _0x112de6 in _0x319d58){if(_0x319d58[_0xcc35('0x28')](_0x112de6)){if(!_0x3e6ab5[_0x112de6]){delete _0x319d58[_0x112de6];}}}}function clearVoiceCallReports(_0x173a5b){_0x173a5b[_0xcc35('0x2b')]=0x0;_0x173a5b[_0xcc35('0x2c')]=0x0;_0x173a5b[_0xcc35('0x2d')]=0x0;_0x173a5b[_0xcc35('0x2e')]=0x0;_0x173a5b[_0xcc35('0x2f')]=0x0;}function clearCampaigns(_0xee7f14){if(!_[_0xcc35('0x30')](_0xee7f14)){for(var _0x48e4df in _0xee7f14){if(_0xee7f14[_0xcc35('0x28')](_0x48e4df)){_0xee7f14[_0x48e4df][_0xcc35('0x31')]=0x0;_0xee7f14[_0x48e4df][_0xcc35('0x32')]=0x0;}}}}function clearVoiceQueues(_0x1da4a9){if(!_['isEmpty'](_0x1da4a9)){for(var _0x2640b4 in _0x1da4a9){if(_0x1da4a9[_0xcc35('0x28')](_0x2640b4)){_0x1da4a9[_0x2640b4][_0xcc35('0x2b')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2c')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x33')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x34')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2d')]=0x0;_0x1da4a9[_0x2640b4]['sumDuration']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2f')]=0x0;_0x1da4a9[_0x2640b4]['outboundAnswerAgiCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x35')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x36')]=0x0;_0x1da4a9[_0x2640b4]['outboundCongestionCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x37')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x38')]=0x0;_0x1da4a9[_0x2640b4]['outboundDropCallsDayTimeout']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x39')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3a')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3b')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3c')]=0x0;_0x1da4a9[_0x2640b4]['outboundReCallsDay']=0x0;_0x1da4a9[_0x2640b4]['outboundAnswerAgiCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3d')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3e')]=!![];}}}}Realtime[_0xcc35('0x3f')][_0xcc35('0x40')]=function(_0x5259d0,_0x4373f2){for(var _0x464011 in _0x4373f2){if(_0x5259d0[_0xcc35('0x28')](_0x464011)){_0x5259d0[_0x464011]=_0x4373f2[_0x464011];}}};Realtime[_0xcc35('0x3f')][_0xcc35('0x41')]=function(){var _0x2de297=this;return function(_0x429659){if(_0x429659){freeIsNotKeyAgent(_0x429659,_0x2de297['agents']);for(var _0x485509=0x0,_0x46cdf7={},_0x5d323d={};_0x485509<_0x429659[_0xcc35('0x42')];_0x485509+=0x1){_0x46cdf7=_0x429659[_0x485509];var _0x414360=_[_0xcc35('0x29')](_0x46cdf7[_0xcc35('0x2a')])?util[_0xcc35('0x25')]('SIP/%s',_0x46cdf7['name']):_0x46cdf7[_0xcc35('0x2a')];if(_[_0xcc35('0x43')](_0x2de297[_0xcc35('0x10')][_0x414360])){_0x2de297[_0xcc35('0x10')][_0x414360]=new Agent(_0x46cdf7);}else{_0x2de297[_0xcc35('0x40')](_0x2de297[_0xcc35('0x10')][_0x414360],_0x46cdf7);}}}return _0x2de297[_0xcc35('0x10')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x44')]=function(){var _0x532cd4=this;return function(_0x12e0c5){if(_0x12e0c5){freeIsNotKeySip(_0x12e0c5,_0x532cd4[_0xcc35('0x11')]);for(var _0x6232ae=0x0,_0x27b863={},_0x4a7bb2={};_0x6232ae<_0x12e0c5['length'];_0x6232ae+=0x1){_0x27b863=_0x12e0c5[_0x6232ae];if(_[_0xcc35('0x43')](_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')](_0xcc35('0x26'),_0x27b863[_0xcc35('0x27')])])){_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')]('SIP/%s',_0x27b863['name'])]=new Telephone(_0x27b863);}else{_0x532cd4[_0xcc35('0x40')](_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')](_0xcc35('0x26'),_0x27b863[_0xcc35('0x27')])],_0x27b863);}}}return _0x532cd4['telephones'];};};Realtime[_0xcc35('0x3f')]['initTrunks']=function(){var _0x323392=this;return function(_0x3e18de){if(_0x3e18de){freeIsNotKeySip(_0x3e18de,_0x323392[_0xcc35('0x12')]);for(var _0x45898a=0x0,_0x3cd638={},_0x1251f8={};_0x45898a<_0x3e18de[_0xcc35('0x42')];_0x45898a+=0x1){_0x3cd638=_0x3e18de[_0x45898a];if(_['isUndefined'](_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])])){_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])]=new Trunk(_0x3cd638);}else{_0x323392[_0xcc35('0x40')](_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])],_0x3cd638);}}}return _0x323392[_0xcc35('0x12')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x45')]=function(){var _0x196248=this;return function(_0x3ce91e){if(_0x3ce91e){freeIsNotKey(_0x3ce91e,_0x196248[_0xcc35('0x13')],_0xcc35('0x27'));for(var _0x2b01cc=0x0,_0x2c2203={},_0xc6104={};_0x2b01cc<_0x3ce91e[_0xcc35('0x42')];_0x2b01cc+=0x1){_0x2c2203=_0x3ce91e[_0x2b01cc];if(_[_0xcc35('0x43')](_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]])){_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]]=new VoiceQueue(_0x2c2203);}else{_0x196248[_0xcc35('0x40')](_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]],_0x2c2203);}}}return _0x196248['voiceQueues'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x46')]=function(){var _0x33619d=this;return function(_0x3ff852){if(_0x3ff852){freeIsNotKey(_0x3ff852,_0x33619d['triggers'],'id');for(var _0x2a844a=0x0,_0x5f0927={},_0x49c3d0={};_0x2a844a<_0x3ff852['length'];_0x2a844a+=0x1){_0x5f0927=_0x3ff852[_0x2a844a];if(_[_0xcc35('0x43')](_0x33619d[_0xcc35('0x14')][_0x5f0927['id']])){_0x33619d[_0xcc35('0x14')][_0x5f0927['id']]=new Trigger(_0x5f0927);}else{_0x33619d[_0xcc35('0x40')](_0x33619d[_0xcc35('0x14')][_0x5f0927['id']],_0x5f0927);}}}return _0x33619d['triggers'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x47')]=function(){var _0x390734=this;return function(_0x24197b){if(_0x24197b){freeIsNotKey(_0x24197b,_0x390734[_0xcc35('0x16')],'id');for(var _0x238b01=0x0,_0x377942={},_0xd7010a={};_0x238b01<_0x24197b[_0xcc35('0x42')];_0x238b01+=0x1){_0x377942=_0x24197b[_0x238b01];if(_['isUndefined'](_0x390734[_0xcc35('0x16')][_0x377942['id']])){_0x390734[_0xcc35('0x16')][_0x377942['id']]=new Template(_0x377942);}else{_0x390734['mergeFromDatabase'](_0x390734[_0xcc35('0x16')][_0x377942['id']],_0x377942);}}}return _0x390734[_0xcc35('0x16')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x48')]=function(){var _0x4af885=this;return function(_0x52e2b4){if(_0x52e2b4){freeIsNotKey(_0x52e2b4,_0x4af885['zendeskAccounts'],'id');for(var _0x219887=0x0,_0x18981d={},_0x353557={};_0x219887<_0x52e2b4[_0xcc35('0x42')];_0x219887+=0x1){_0x18981d=_0x52e2b4[_0x219887];if(_['isUndefined'](_0x4af885[_0xcc35('0x1b')][_0x18981d['id']])){_0x4af885[_0xcc35('0x1b')][_0x18981d['id']]=new ZendeskAccount(_0x18981d);}else{_0x4af885[_0xcc35('0x40')](_0x4af885[_0xcc35('0x1b')][_0x18981d['id']],_0x18981d);}}}return _0x4af885['zendeskAccounts'];};};Realtime['prototype'][_0xcc35('0x49')]=function(){var _0x270f48=this;return function(_0x101051){if(_0x101051){freeIsNotKey(_0x101051,_0x270f48[_0xcc35('0x1c')],'id');for(var _0x39fa1b=0x0,_0x9b922e={},_0x59c7fc={};_0x39fa1b<_0x101051[_0xcc35('0x42')];_0x39fa1b+=0x1){_0x9b922e=_0x101051[_0x39fa1b];if(_['isUndefined'](_0x270f48[_0xcc35('0x1c')][_0x9b922e['id']])){_0x270f48['salesforceAccounts'][_0x9b922e['id']]=new SalesforceAccount(_0x9b922e);}else{_0x270f48[_0xcc35('0x40')](_0x270f48['salesforceAccounts'][_0x9b922e['id']],_0x9b922e);}}}return _0x270f48['salesforceAccounts'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4a')]=function(){var _0x5b7c5f=this;return function(_0x3d7287){if(_0x3d7287){freeIsNotKey(_0x3d7287,_0x5b7c5f[_0xcc35('0x1e')],'id');for(var _0x1cfe63=0x0,_0x323e99={},_0x20c9b4={};_0x1cfe63<_0x3d7287[_0xcc35('0x42')];_0x1cfe63+=0x1){_0x323e99=_0x3d7287[_0x1cfe63];if(_[_0xcc35('0x43')](_0x5b7c5f['freshdeskAccounts'][_0x323e99['id']])){_0x5b7c5f[_0xcc35('0x1e')][_0x323e99['id']]=new FreshdeskAccount(_0x323e99);}else{_0x5b7c5f[_0xcc35('0x40')](_0x5b7c5f['freshdeskAccounts'][_0x323e99['id']],_0x323e99);}}}return _0x5b7c5f[_0xcc35('0x1e')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4b')]=function(){var _0x1b315e=this;return function(_0x44a005){if(_0x44a005){freeIsNotKey(_0x44a005,_0x1b315e['zohoAccounts'],'id');for(var _0x5172ef=0x0,_0x273ab0={},_0x2f9901={};_0x5172ef<_0x44a005[_0xcc35('0x42')];_0x5172ef+=0x1){_0x273ab0=_0x44a005[_0x5172ef];if(_[_0xcc35('0x43')](_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']])){_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']]=new ZohoAccount(_0x273ab0);}else{_0x1b315e[_0xcc35('0x40')](_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']],_0x273ab0);}}}return _0x1b315e[_0xcc35('0x4c')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4d')]=function(){var _0x17a969=this;return function(_0x3de74a){if(_0x3de74a){freeIsNotKey(_0x3de74a,_0x17a969['deskAccounts'],'id');for(var _0x2f655f=0x0,_0x5a5ace={},_0x42df7a={};_0x2f655f<_0x3de74a[_0xcc35('0x42')];_0x2f655f+=0x1){_0x5a5ace=_0x3de74a[_0x2f655f];if(_[_0xcc35('0x43')](_0x17a969[_0xcc35('0x1f')][_0x5a5ace['id']])){_0x17a969[_0xcc35('0x1f')][_0x5a5ace['id']]=new DeskAccount(_0x5a5ace);}else{_0x17a969[_0xcc35('0x40')](_0x17a969['deskAccounts'][_0x5a5ace['id']],_0x5a5ace);}}}return _0x17a969['deskAccounts'];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x5d76c4=this;return function(_0x1e7c40){if(_0x1e7c40){freeIsNotKey(_0x1e7c40,_0x5d76c4[_0xcc35('0x1d')],'id');for(var _0x4f9f5b=0x0,_0x2af0fc={},_0xec291={};_0x4f9f5b<_0x1e7c40['length'];_0x4f9f5b+=0x1){_0x2af0fc=_0x1e7c40[_0x4f9f5b];if(_[_0xcc35('0x43')](_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']])){_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']]=new SugarcrmAccount(_0x2af0fc);}else{_0x5d76c4[_0xcc35('0x40')](_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']],_0x2af0fc);}}}return _0x5d76c4['sugarcrmAccounts'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4e')]=function(){var _0x42baf1=this;return function(_0x490754){if(_0x490754){freeIsNotKey(_0x490754,_0x42baf1[_0xcc35('0x4f')],'id');for(var _0x13fee2=0x0,_0x37b0f3={},_0xd0ff2a={};_0x13fee2<_0x490754[_0xcc35('0x42')];_0x13fee2+=0x1){_0x37b0f3=_0x490754[_0x13fee2];if(_[_0xcc35('0x43')](_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']])){_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']]=new VtigerAccount(_0x37b0f3);}else{_0x42baf1[_0xcc35('0x40')](_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']],_0x37b0f3);}}}return _0x42baf1[_0xcc35('0x4f')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x50')]=function(){var _0x4dc669=this;return function(_0x3b024f){if(_0x3b024f){freeIsNotKey(_0x3b024f,_0x4dc669[_0xcc35('0x20')],'id');for(var _0x1d7ed5=0x0,_0x460db6={},_0x1fc96e={};_0x1d7ed5<_0x3b024f[_0xcc35('0x42')];_0x1d7ed5+=0x1){_0x460db6=_0x3b024f[_0x1d7ed5];if(_['isUndefined'](_0x4dc669['servicenowAccounts'][_0x460db6['id']])){_0x4dc669[_0xcc35('0x20')][_0x460db6['id']]=new ServicenowAccount(_0x460db6);}else{_0x4dc669[_0xcc35('0x40')](_0x4dc669['servicenowAccounts'][_0x460db6['id']],_0x460db6);}}}return _0x4dc669[_0xcc35('0x20')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x51')]=function(){var _0x8abba1=this;return function(_0x2ef1aa){if(_0x2ef1aa){freeIsNotKey(_0x2ef1aa,_0x8abba1[_0xcc35('0x21')],'id');for(var _0x30bf9b=0x0,_0x128003={},_0x444117={};_0x30bf9b<_0x2ef1aa[_0xcc35('0x42')];_0x30bf9b+=0x1){_0x128003=_0x2ef1aa[_0x30bf9b];if(_[_0xcc35('0x43')](_0x8abba1[_0xcc35('0x21')][_0x128003['id']])){_0x8abba1['dynamics365Accounts'][_0x128003['id']]=new Dynamics365Account(_0x128003);}else{_0x8abba1[_0xcc35('0x40')](_0x8abba1[_0xcc35('0x21')][_0x128003['id']],_0x128003);}}}return _0x8abba1[_0xcc35('0x21')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x52')]=function(){var _0xf5984f=this;return function(_0x22bd30){if(_0x22bd30){freeIsNotKey(_0x22bd30,_0xf5984f['freshsalesAccounts'],'id');for(var _0xd9f354=0x0,_0x219c2a={},_0x2664ba={};_0xd9f354<_0x22bd30[_0xcc35('0x42')];_0xd9f354+=0x1){_0x219c2a=_0x22bd30[_0xd9f354];if(_[_0xcc35('0x43')](_0xf5984f[_0xcc35('0x22')][_0x219c2a['id']])){_0xf5984f['freshsalesAccounts'][_0x219c2a['id']]=new FreshsalesAccount(_0x219c2a);}else{_0xf5984f['mergeFromDatabase'](_0xf5984f['freshsalesAccounts'][_0x219c2a['id']],_0x219c2a);}}}return _0xf5984f[_0xcc35('0x22')];};};Realtime[_0xcc35('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x39d543=this;return function(_0xb82d5c){for(var _0x56f112=0x0;_0x56f112<_0xb82d5c[_0xcc35('0x42')];_0x56f112+=0x1){_['merge'](_0x39d543[_0xcc35('0x13')][_0xb82d5c[_0x56f112][_0xcc35('0x27')]],_0xb82d5c[_0x56f112]);}return _0x39d543['voiceQueues'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x53')]=function(){var _0x944436=this;return function(_0x209578){clearVoiceQueues(_0x944436['voiceQueues']);if(_0x209578){_0x209578=_[_0xcc35('0x54')](_0x209578,_0xcc35('0x55'));for(var _0x1ee82c in _0x209578){if(_0x209578[_0xcc35('0x28')](_0x1ee82c)){var _0x40bfdc={};for(var _0x1b66a4=0x0;_0x1b66a4<_0x209578[_0x1ee82c][_0xcc35('0x42')];_0x1b66a4+=0x1){var _0x8ecbf4=_0x209578[_0x1ee82c][_0x1b66a4]['queue'];if(_0x944436[_0xcc35('0x13')][_0x8ecbf4]){if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x56')]){_0x944436['voiceQueues'][_0x8ecbf4][_0xcc35('0x33')]+=0x1;}if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x57')]){_0x944436['voiceQueues'][_0x8ecbf4][_0xcc35('0x34')]+=0x1;}_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2d')]+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x58')])[_0xcc35('0x59')](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5a')]),_0xcc35('0x5b'))||0x0;if(_0x1b66a4===_0x209578[_0x1ee82c][_0xcc35('0x42')]-0x1){_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2e')]+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5c')]||_0x209578[_0x1ee82c][_0x1b66a4]['queuecallerabandonAt']||_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5d')])[_0xcc35('0x59')](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5a')]),_0xcc35('0x5b'))||0x0;_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2b')]+=0x1;if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5e')]){_0x944436[_0xcc35('0x13')][_0x8ecbf4]['answered']+=0x1;_0x944436[_0xcc35('0x13')][_0x8ecbf4]['sumBillable']+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5c')])['diff'](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x58')]),_0xcc35('0x5b'))||0x0;}}else{_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2e')]+=_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2d')]||0x0;}}}}}}return _0x944436[_0xcc35('0x13')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x5f')]=function(){var _0x2e6f7d=this;return function(_0x282c96){clearVoiceCallReports(_0x2e6f7d[_0xcc35('0x17')]);if(_0x282c96){for(var _0x45dfb6=0x0;_0x45dfb6<_0x282c96[_0xcc35('0x42')];_0x45dfb6+=0x1){_0x2e6f7d['outbound']['total']+=0x1;_0x2e6f7d['outbound'][_0xcc35('0x2e')]+=_0x282c96[_0x45dfb6]['duration'];if(_0x282c96[_0x45dfb6][_0xcc35('0x60')]===_0xcc35('0x61')){_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2c')]+=0x1;_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2d')]+=_0x282c96[_0x45dfb6][_0xcc35('0x62')]-_0x282c96[_0x45dfb6][_0xcc35('0x63')]||0x0;_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2f')]+=_0x282c96[_0x45dfb6][_0xcc35('0x63')];}}}return _0x2e6f7d[_0xcc35('0x17')];};};Realtime['prototype'][_0xcc35('0x64')]=function(){var _0x1ca06c=this;return function(_0x32956c){if(_0x32956c){freeIsNotKey(_0x32956c,_0x1ca06c[_0xcc35('0x15')],_0xcc35('0x27'));for(var _0x2ea0e9=0x0,_0x4ef50b={};_0x2ea0e9<_0x32956c['length'];_0x2ea0e9+=0x1){_0x4ef50b=_0x32956c[_0x2ea0e9];if(_[_0xcc35('0x43')](_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]])){_0x1ca06c['campaigns'][_0x4ef50b[_0xcc35('0x27')]]=new Campaign(_0x4ef50b);}else{_0x1ca06c[_0xcc35('0x40')](_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]],_0x4ef50b);_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]]['dialQueueProject']=_0x4ef50b[_0xcc35('0x65')]?_0x4ef50b[_0xcc35('0x65')][_0xcc35('0x27')]:undefined;}}}return _0x1ca06c[_0xcc35('0x15')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x66')]=function(){var _0x3044fe=this;return function(_0xc36124){if(_0xc36124){freeIsNotKey(_0xc36124,_0x3044fe['voiceExtensions'],'id');for(var _0x598ce7=0x0,_0x1fe2a7={};_0x598ce7<_0xc36124[_0xcc35('0x42')];_0x598ce7+=0x1){_0x1fe2a7=_0xc36124[_0x598ce7];if(_['isUndefined'](_0x3044fe[_0xcc35('0x67')][_0x1fe2a7['id']])){_0x3044fe[_0xcc35('0x67')][_0x1fe2a7['id']]=new VoiceExtension(_0x1fe2a7);}else{_0x3044fe[_0xcc35('0x40')](_0x3044fe['voiceExtensions'][_0x1fe2a7['id']],_0x1fe2a7);}}}return _0x3044fe[_0xcc35('0x67')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x68')]=function(){var _0x3b0d8a=this;return function(_0x526a20){clearCampaigns(_0x3b0d8a[_0xcc35('0x15')]);for(var _0x48e5ba=0x0;_0x48e5ba<_0x526a20[_0xcc35('0x42')];_0x48e5ba+=0x1){_[_0xcc35('0x69')](_0x3b0d8a[_0xcc35('0x15')][_0x526a20[_0x48e5ba]['name']],_0x526a20[_0x48e5ba]);}return _0x3b0d8a['campaigns'];};};Realtime[_0xcc35('0x3f')]['initFaxAccounts']=function(){var _0x2e4495=this;return function(_0x413c44){if(_0x413c44){freeIsNotKey(_0x413c44,_0x2e4495[_0xcc35('0x23')],'id');for(var _0x3048c7=0x0,_0x402565={},_0x55e56c={};_0x3048c7<_0x413c44[_0xcc35('0x42')];_0x3048c7+=0x1){_0x402565=_0x413c44[_0x3048c7];if(_[_0xcc35('0x43')](_0x2e4495[_0xcc35('0x23')][_0x402565['id']])){_0x2e4495[_0xcc35('0x23')][_0x402565['id']]=new FaxAccount(_0x402565);}else{_0x2e4495[_0xcc35('0x40')](_0x2e4495[_0xcc35('0x23')][_0x402565['id']],_0x402565);}}}return _0x2e4495[_0xcc35('0x23')];};};module[_0xcc35('0x6a')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 9155449..7ad0754 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 _0xffb0=['queue','lastdata','context','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','create','monitors','filename','createdAt','xcally-motion-dialer','isArray','startsWith','indexOf','mobile','phone','substring','lastIndexOf','membername','transfererlinkedid','attendedTransfer','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','findAgent','find','name','isNil','accountcode','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','destination','exten','type','dialer','lastapplication'];(function(_0x3a4a92,_0x514129){var _0x379732=function(_0x4e372a){while(--_0x4e372a){_0x3a4a92['push'](_0x3a4a92['shift']());}};_0x379732(++_0x514129);}(_0xffb0,0x11f));var _0x0ffb=function(_0x7f9015,_0x245013){_0x7f9015=_0x7f9015-0x0;var _0xdbb9d3=_0xffb0[_0x7f9015];return _0xdbb9d3;};'use strict';var _=require(_0x0ffb('0x0'));var moment=require(_0x0ffb('0x1'));var util=require(_0x0ffb('0x2'));var config=require('../../../config/environment');var ami=require(_0x0ffb('0x3'));var RpcVoiceAgentReport=require(_0x0ffb('0x4'));var RpcVoiceCallReport=require(_0x0ffb('0x5'));var RpcVoiceDialReport=require(_0x0ffb('0x6'));var RpcMemberReport=require(_0x0ffb('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x0ffb('0x8'));var RpcVoiceTransferReport=require(_0x0ffb('0x9'));var VoiceQueueReport=require(_0x0ffb('0xa'));var VoiceCallReport=require(_0x0ffb('0xb'));var VoiceAgentReport=require(_0x0ffb('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x0ffb('0xd'));function Report(_0x4596af){this[_0x0ffb('0xe')]=_0x4596af;this[_0x0ffb('0xf')]=_0x4596af['agents'];this[_0x0ffb('0x10')]=_0x4596af[_0x0ffb('0x10')];}Report[_0x0ffb('0x11')][_0x0ffb('0x12')]=function(_0x5effd8){var _0x254e49=new VoiceQueueReport(this[_0x0ffb('0xe')]);var _0x2a8a7c=new VoiceAgentReport(this[_0x0ffb('0xe')]);var _0x26e290=new VoiceDialReport(this['realtime']);var _0x2226b9=new VoiceCallReport(this[_0x0ffb('0xe')]);var _0x5d94b4=new UserReport(this[_0x0ffb('0xe')]);if(config[_0x0ffb('0x13')]&&config[_0x0ffb('0x13')][_0x0ffb('0x14')]){ami['on'](_0x0ffb('0x15'),this['voiceQueueReport']['bind'](this));ami['on'](_0x0ffb('0x16'),this[_0x0ffb('0x17')][_0x0ffb('0x18')](this));ami['on'](_0x0ffb('0x19'),this[_0x0ffb('0x1a')][_0x0ffb('0x18')](this));ami['on'](_0x0ffb('0x1b'),this[_0x0ffb('0x1c')][_0x0ffb('0x18')](this));ami['on'](_0x0ffb('0x1d'),this['blindTransfer'][_0x0ffb('0x18')](this));ami['on'](_0x0ffb('0x1e'),this['attendedTransfer'][_0x0ffb('0x18')](this));}};Report[_0x0ffb('0x11')][_0x0ffb('0x1f')]=function(_0x41c81b){var _0x5d11c7;_0x5d11c7=_[_0x0ffb('0x20')](this[_0x0ffb('0xf')],function(_0x42d342){return _0x42d342['accountcode']==_0x41c81b||_0x42d342[_0x0ffb('0x21')]==_0x41c81b;});if(_[_0x0ffb('0x22')](_0x5d11c7)){var _0x43d96f=_[_0x0ffb('0x20')](this['telephones'],function(_0x58aeb3){return _0x58aeb3[_0x0ffb('0x23')]==_0x41c81b||_0x58aeb3['name']==_0x41c81b;});if(_0x43d96f){_0x5d11c7=_[_0x0ffb('0x20')](this[_0x0ffb('0xf')],function(_0x2a5ff6){return _0x2a5ff6[_0x0ffb('0x24')]==util['format'](_0x0ffb('0x25'),_0x43d96f['name']);});}}return _0x5d11c7;};Report[_0x0ffb('0x11')][_0x0ffb('0x26')]=function(_0x5bb659){for(var _0x17a612=0x0;_0x17a612<_0x5bb659[_0x0ffb('0x27')];_0x17a612+=0x1){var _0x45639d=this[_0x0ffb('0x1f')](_0x5bb659[_0x17a612][_0x0ffb('0x28')]);if(_0x45639d){_0x5bb659[_0x17a612][_0x0ffb('0x23')]=_0x45639d[_0x0ffb('0x23')];_0x5bb659[_0x17a612][_0x0ffb('0x29')]=!![];_0x5bb659[_0x17a612]['lastAssignedTo']=_0x45639d[_0x0ffb('0x21')];_0x5bb659[_0x17a612][_0x0ffb('0x24')]=_['isNil'](_0x45639d[_0x0ffb('0x24')])?util[_0x0ffb('0x2a')](_0x0ffb('0x25'),_0x45639d[_0x0ffb('0x21')]):_0x45639d['interface'];if(_0x5bb659[_0x17a612][_0x0ffb('0x2b')]){_0x5bb659[_0x17a612][_0x0ffb('0x2c')]=moment()[_0x0ffb('0x2a')](_0x0ffb('0x2d'));}if(_0x5bb659[_0x17a612][_0x0ffb('0x2e')]){_0x5bb659[_0x17a612][_0x0ffb('0x2f')]=moment()[_0x0ffb('0x2a')](_0x0ffb('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x5bb659[_0x17a612]);}RpcVoiceQueueReport['create'](_0x5bb659[_0x17a612]);}};function extractCalleridNumber(_0x46ec1f){var _0x2a036d=_0x46ec1f['match'](/<(.*?)>/);return _0x2a036d?_0x2a036d[0x1]:_0x46ec1f;}Report[_0x0ffb('0x11')][_0x0ffb('0x17')]=function(_0x2f486f){_0x2f486f[_0x0ffb('0x30')]=_0x2f486f[_0x0ffb('0x30')]||_0x2f486f[_0x0ffb('0x31')];if(_0x2f486f[_0x0ffb('0x32')]==_0x0ffb('0x33')){_0x2f486f[_0x0ffb('0x34')]=_0x0ffb('0x35');_0x2f486f[_0x0ffb('0x36')]=_0x2f486f[_0x0ffb('0x35')];if(_0x2f486f[_0x0ffb('0x37')]=='from-voip-provider'){_0x2f486f[_0x0ffb('0x23')]='';_0x2f486f[_0x0ffb('0x30')]=extractCalleridNumber(_0x2f486f[_0x0ffb('0x38')]);}else if(_0x2f486f[_0x0ffb('0x37')]=='from-sip'){if(_0x2f486f[_0x0ffb('0x30')]==_0x0ffb('0x39')){_0x2f486f['destination']=extractCalleridNumber(_0x2f486f[_0x0ffb('0x3a')]);_0x2f486f[_0x0ffb('0x3b')]=_0x2f486f[_0x0ffb('0x3c')];_0x2f486f[_0x0ffb('0x3d')]=[_0x2f486f['channel'],_0x2f486f[_0x0ffb('0x3e')]=_0x2f486f[_0x0ffb('0x3d')]][0x0];_0x2f486f[_0x0ffb('0x38')]=_0x2f486f['calleridpreview'];}else{_0x2f486f['destination']=_0x2f486f[_0x0ffb('0x3b')];_0x2f486f[_0x0ffb('0x3b')]=_0x2f486f[_0x0ffb('0x3c')];if(_0x2f486f['disposition']==_0x0ffb('0x3f')){_0x2f486f['accountcode']=_0x2f486f[_0x0ffb('0x28')];}else{_0x2f486f[_0x0ffb('0x23')]='';}}}}else{_0x2f486f[_0x0ffb('0x38')]=util[_0x0ffb('0x2a')]('\x22%s\x22\x20<%s>',_0x2f486f[_0x0ffb('0x40')],_0x2f486f[_0x0ffb('0x3b')]);}if(RpcVoiceTransferReport[_0x0ffb('0x41')][_0x2f486f[_0x0ffb('0x42')]]){var _0x332eae=RpcVoiceTransferReport['transfers'][_0x2f486f[_0x0ffb('0x42')]];_0x332eae[_0x0ffb('0x43')]=_0x2f486f[_0x0ffb('0x44')];RpcVoiceTransferReport[_0x0ffb('0x45')](_0x332eae);delete RpcVoiceTransferReport[_0x0ffb('0x41')][_0x2f486f[_0x0ffb('0x42')]];}RpcVoiceCallReport[_0x0ffb('0x46')](_0x2f486f);if(_0x2f486f['monitor']){for(var _0x136de4=0x0;_0x136de4<_0x2f486f[_0x0ffb('0x47')][_0x0ffb('0x27')];_0x136de4+=0x1){_0x2f486f['monitorFilename']=_0x2f486f[_0x0ffb('0x47')][_0x136de4][_0x0ffb('0x48')];_0x2f486f[_0x0ffb('0x49')]=_0x2f486f['monitors'][_0x136de4]['createdAt'];if(_0x2f486f['exten']==_0x0ffb('0x39')){_0x2f486f[_0x0ffb('0x3b')]=_0x2f486f[_0x0ffb('0x28')];_0x2f486f[_0x0ffb('0x40')]=_0x2f486f['connectedlinename'];_0x2f486f[_0x0ffb('0x28')]=_0x2f486f[_0x0ffb('0x23')];_0x2f486f['connectedlinename']=_0x2f486f['membername'];_0x2f486f['exten']=_0x2f486f[_0x0ffb('0x3c')];}else if(_0x2f486f[_0x0ffb('0x31')]==_0x0ffb('0x4a')){_0x2f486f[_0x0ffb('0x3b')]=_0x2f486f[_0x0ffb('0x30')];_0x2f486f['exten']=_0x2f486f[_0x0ffb('0x3c')];}RpcVoiceRecording[_0x0ffb('0x46')](_0x2f486f);}}};Report[_0x0ffb('0x11')]['voiceAgentReport']=function(_0x579221){if(_[_0x0ffb('0x4b')](_0x579221)){_0x579221['forEach'](function(_0x2a8d33){RpcVoiceAgentReport['create'](_0x2a8d33);});}else{RpcVoiceAgentReport[_0x0ffb('0x46')](_0x579221);}};Report[_0x0ffb('0x11')]['voiceDialReport']=function(_0x251b8e){RpcVoiceDialReport[_0x0ffb('0x46')](_0x251b8e);var _0x9c5aed;var _0x2f2b65;var _0x11b336=_0x251b8e['channel'];if(_[_0x0ffb('0x4c')](_0x11b336,'Local')){_0x2f2b65=_0x11b336['substring'](_0x11b336['indexOf']('/')+0x1,_0x11b336[_0x0ffb('0x4d')]('@'));_0x9c5aed=_[_0x0ffb('0x20')](this[_0x0ffb('0xf')],function(_0x5b79f1){return _0x5b79f1[_0x0ffb('0x4e')]==_0x2f2b65||_0x5b79f1[_0x0ffb('0x4f')]==_0x2f2b65||_0x5b79f1[_0x0ffb('0x23')]==_0x2f2b65;});}else{_0x2f2b65=_0x11b336[_0x0ffb('0x50')](_0x11b336['indexOf']('/')+0x1,_0x11b336[_0x0ffb('0x51')]('-'));_0x9c5aed=this[_0x0ffb('0x1f')](_0x2f2b65);}if(_0x9c5aed){_0x251b8e['interface']=_[_0x0ffb('0x22')](_0x9c5aed[_0x0ffb('0x24')])?util[_0x0ffb('0x2a')](_0x0ffb('0x25'),_0x9c5aed[_0x0ffb('0x21')]):_0x9c5aed[_0x0ffb('0x24')];_0x251b8e[_0x0ffb('0x52')]=_0x9c5aed[_0x0ffb('0x21')];_0x251b8e[_0x0ffb('0x23')]=_0x9c5aed[_0x0ffb('0x23')];RpcMemberReport[_0x0ffb('0x1c')](_0x251b8e);}};Report[_0x0ffb('0x11')]['blindTransfer']=function(_0x5066c5){RpcVoiceTransferReport[_0x0ffb('0x41')][_0x5066c5[_0x0ffb('0x53')]]=_0x5066c5;};Report['prototype']['attendedTransfer']=function(_0x3ffe85){RpcVoiceTransferReport[_0x0ffb('0x54')](_0x3ffe85);};module['exports']=Report; \ No newline at end of file +var _0xac6f=['find','agents','accountcode','name','isNil','interface','format','length','assigned','lastAssignedTo','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','voiceCallReport','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','calleridpreview','originatecalleridnum','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','SIP/%s','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','findAgent'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xac6f,0x91));var _0xfac6=function(_0x3833f4,_0x5bfad2){_0x3833f4=_0x3833f4-0x0;var _0x4eadfb=_0xac6f[_0x3833f4];return _0x4eadfb;};'use strict';var _=require(_0xfac6('0x0'));var moment=require(_0xfac6('0x1'));var util=require(_0xfac6('0x2'));var config=require(_0xfac6('0x3'));var ami=require(_0xfac6('0x4'));var RpcVoiceAgentReport=require(_0xfac6('0x5'));var RpcVoiceCallReport=require(_0xfac6('0x6'));var RpcVoiceDialReport=require(_0xfac6('0x7'));var RpcMemberReport=require(_0xfac6('0x8'));var RpcVoiceQueueReport=require(_0xfac6('0x9'));var RpcVoiceRecording=require(_0xfac6('0xa'));var RpcVoiceTransferReport=require(_0xfac6('0xb'));var VoiceQueueReport=require(_0xfac6('0xc'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xfac6('0xd'));var VoiceDialReport=require(_0xfac6('0xe'));var UserReport=require('./userReport');function Report(_0xa3fb1b){this['realtime']=_0xa3fb1b;this['agents']=_0xa3fb1b['agents'];this[_0xfac6('0xf')]=_0xa3fb1b['telephones'];}Report[_0xfac6('0x10')][_0xfac6('0x11')]=function(_0x5d7ac2){var _0x21548b=new VoiceQueueReport(this[_0xfac6('0x12')]);var _0x11e787=new VoiceAgentReport(this[_0xfac6('0x12')]);var _0x1c044a=new VoiceDialReport(this['realtime']);var _0x23c429=new VoiceCallReport(this[_0xfac6('0x12')]);var _0x5ac912=new UserReport(this[_0xfac6('0x12')]);if(config[_0xfac6('0x13')]&&config['xdr'][_0xfac6('0x14')]){ami['on'](_0xfac6('0x15'),this[_0xfac6('0x16')]['bind'](this));ami['on'](_0xfac6('0x17'),this['voiceCallReport'][_0xfac6('0x18')](this));ami['on'](_0xfac6('0x19'),this[_0xfac6('0x1a')][_0xfac6('0x18')](this));ami['on']('custom:voiceDialReport',this[_0xfac6('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xfac6('0x1c')][_0xfac6('0x18')](this));ami['on']('attendedtransfer',this[_0xfac6('0x1d')][_0xfac6('0x18')](this));}};Report[_0xfac6('0x10')][_0xfac6('0x1e')]=function(_0x356fdd){var _0x1eee3b;_0x1eee3b=_[_0xfac6('0x1f')](this[_0xfac6('0x20')],function(_0x125dba){return _0x125dba[_0xfac6('0x21')]==_0x356fdd||_0x125dba[_0xfac6('0x22')]==_0x356fdd;});if(_[_0xfac6('0x23')](_0x1eee3b)){var _0x1325f6=_[_0xfac6('0x1f')](this['telephones'],function(_0x14ab69){return _0x14ab69[_0xfac6('0x21')]==_0x356fdd||_0x14ab69['name']==_0x356fdd;});if(_0x1325f6){_0x1eee3b=_[_0xfac6('0x1f')](this[_0xfac6('0x20')],function(_0xa7dbee){return _0xa7dbee[_0xfac6('0x24')]==util[_0xfac6('0x25')]('SIP/%s',_0x1325f6[_0xfac6('0x22')]);});}}return _0x1eee3b;};Report[_0xfac6('0x10')]['voiceQueueReport']=function(_0x4815d6){for(var _0x4b59cf=0x0;_0x4b59cf<_0x4815d6[_0xfac6('0x26')];_0x4b59cf+=0x1){var _0x5a36f6=this[_0xfac6('0x1e')](_0x4815d6[_0x4b59cf]['connectedlinenum']);if(_0x5a36f6){_0x4815d6[_0x4b59cf]['accountcode']=_0x5a36f6['accountcode'];_0x4815d6[_0x4b59cf][_0xfac6('0x27')]=!![];_0x4815d6[_0x4b59cf][_0xfac6('0x28')]=_0x5a36f6[_0xfac6('0x22')];_0x4815d6[_0x4b59cf]['interface']=_[_0xfac6('0x23')](_0x5a36f6[_0xfac6('0x24')])?util[_0xfac6('0x25')]('SIP/%s',_0x5a36f6[_0xfac6('0x22')]):_0x5a36f6['interface'];if(_0x4815d6[_0x4b59cf]['queuecallercomplete']){_0x4815d6[_0x4b59cf][_0xfac6('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4815d6[_0x4b59cf][_0xfac6('0x2a')]){_0x4815d6[_0x4b59cf][_0xfac6('0x2b')]=moment()[_0xfac6('0x25')](_0xfac6('0x2c'));}RpcMemberReport[_0xfac6('0x16')](_0x4815d6[_0x4b59cf]);}RpcVoiceQueueReport[_0xfac6('0x2d')](_0x4815d6[_0x4b59cf]);}};function extractCalleridNumber(_0x31bd8a){var _0x2fe707=_0x31bd8a[_0xfac6('0x2e')](/<(.*?)>/);return _0x2fe707?_0x2fe707[0x1]:_0x31bd8a;}Report[_0xfac6('0x10')][_0xfac6('0x2f')]=function(_0x237a77){_0x237a77[_0xfac6('0x30')]=_0x237a77[_0xfac6('0x30')]||_0x237a77[_0xfac6('0x31')];if(_0x237a77[_0xfac6('0x32')]=='dialer'){_0x237a77[_0xfac6('0x33')]=_0xfac6('0x34');_0x237a77[_0xfac6('0x35')]=_0x237a77['queue'];if(_0x237a77[_0xfac6('0x36')]==_0xfac6('0x37')){_0x237a77['accountcode']='';_0x237a77['destination']=extractCalleridNumber(_0x237a77[_0xfac6('0x38')]);}else if(_0x237a77[_0xfac6('0x36')]==_0xfac6('0x39')){if(_0x237a77[_0xfac6('0x30')]==_0xfac6('0x3a')){_0x237a77[_0xfac6('0x30')]=extractCalleridNumber(_0x237a77['calleridpreview']);_0x237a77[_0xfac6('0x3b')]=_0x237a77['originatecalleridnum'];_0x237a77[_0xfac6('0x3c')]=[_0x237a77[_0xfac6('0x3d')],_0x237a77[_0xfac6('0x3d')]=_0x237a77[_0xfac6('0x3c')]][0x0];_0x237a77['callerid']=_0x237a77[_0xfac6('0x3e')];}else{_0x237a77[_0xfac6('0x30')]=_0x237a77[_0xfac6('0x3b')];_0x237a77['calleridnum']=_0x237a77[_0xfac6('0x3f')];if(_0x237a77[_0xfac6('0x40')]==_0xfac6('0x41')){_0x237a77[_0xfac6('0x21')]=_0x237a77[_0xfac6('0x42')];}else{_0x237a77[_0xfac6('0x21')]='';}}}}else{_0x237a77[_0xfac6('0x38')]=util[_0xfac6('0x25')]('\x22%s\x22\x20<%s>',_0x237a77[_0xfac6('0x43')],_0x237a77[_0xfac6('0x3b')]);}if(RpcVoiceTransferReport[_0xfac6('0x44')][_0x237a77['linkedid']]){var _0x36015b=RpcVoiceTransferReport[_0xfac6('0x44')][_0x237a77[_0xfac6('0x45')]];_0x36015b[_0xfac6('0x46')]=_0x237a77[_0xfac6('0x47')];RpcVoiceTransferReport[_0xfac6('0x1c')](_0x36015b);delete RpcVoiceTransferReport['transfers'][_0x237a77[_0xfac6('0x45')]];}RpcVoiceCallReport['create'](_0x237a77);if(_0x237a77[_0xfac6('0x48')]){for(var _0x56be1d=0x0;_0x56be1d<_0x237a77[_0xfac6('0x49')][_0xfac6('0x26')];_0x56be1d+=0x1){_0x237a77[_0xfac6('0x4a')]=_0x237a77['monitors'][_0x56be1d]['filename'];_0x237a77[_0xfac6('0x4b')]=_0x237a77[_0xfac6('0x49')][_0x56be1d]['createdAt'];if(_0x237a77[_0xfac6('0x31')]=='xcally-motion-preview'){_0x237a77[_0xfac6('0x3b')]=_0x237a77['connectedlinenum'];_0x237a77['calleridname']=_0x237a77[_0xfac6('0x4c')];_0x237a77[_0xfac6('0x42')]=_0x237a77['accountcode'];_0x237a77[_0xfac6('0x4c')]=_0x237a77['membername'];_0x237a77[_0xfac6('0x31')]=_0x237a77['originatecalleridnum'];}else if(_0x237a77[_0xfac6('0x31')]==_0xfac6('0x4d')){_0x237a77[_0xfac6('0x3b')]=_0x237a77[_0xfac6('0x30')];_0x237a77[_0xfac6('0x31')]=_0x237a77[_0xfac6('0x3f')];}RpcVoiceRecording[_0xfac6('0x2d')](_0x237a77);}}};Report['prototype'][_0xfac6('0x1a')]=function(_0x163ade){if(_[_0xfac6('0x4e')](_0x163ade)){_0x163ade[_0xfac6('0x4f')](function(_0x159ec4){RpcVoiceAgentReport['create'](_0x159ec4);});}else{RpcVoiceAgentReport[_0xfac6('0x2d')](_0x163ade);}};Report[_0xfac6('0x10')][_0xfac6('0x1b')]=function(_0x52e365){RpcVoiceDialReport[_0xfac6('0x2d')](_0x52e365);var _0x3308f3;var _0x1f095b;var _0x1d3905=_0x52e365[_0xfac6('0x3d')];if(_['startsWith'](_0x1d3905,'Local')){_0x1f095b=_0x1d3905[_0xfac6('0x50')](_0x1d3905[_0xfac6('0x51')]('/')+0x1,_0x1d3905[_0xfac6('0x51')]('@'));_0x3308f3=_[_0xfac6('0x1f')](this['agents'],function(_0x311674){return _0x311674[_0xfac6('0x52')]==_0x1f095b||_0x311674[_0xfac6('0x53')]==_0x1f095b||_0x311674[_0xfac6('0x21')]==_0x1f095b;});}else{_0x1f095b=_0x1d3905[_0xfac6('0x50')](_0x1d3905[_0xfac6('0x51')]('/')+0x1,_0x1d3905[_0xfac6('0x54')]('-'));_0x3308f3=this[_0xfac6('0x1e')](_0x1f095b);}if(_0x3308f3){_0x52e365[_0xfac6('0x24')]=_[_0xfac6('0x23')](_0x3308f3[_0xfac6('0x24')])?util[_0xfac6('0x25')](_0xfac6('0x55'),_0x3308f3['name']):_0x3308f3[_0xfac6('0x24')];_0x52e365['membername']=_0x3308f3['name'];_0x52e365[_0xfac6('0x21')]=_0x3308f3['accountcode'];RpcMemberReport['voiceDialReport'](_0x52e365);}};Report['prototype']['blindTransfer']=function(_0x3b8541){RpcVoiceTransferReport[_0xfac6('0x44')][_0x3b8541[_0xfac6('0x56')]]=_0x3b8541;};Report[_0xfac6('0x10')][_0xfac6('0x1d')]=function(_0xc0d663){RpcVoiceTransferReport['attendedTransfer'](_0xc0d663);};module[_0xfac6('0x57')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 5e9c4e8..ef410d7 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f4f=['ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','catch','error','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','format','telephone:%s','telephone:save','Local','indexOf','mobile','updateStatusRealtime','[userReport][devicestatechange]','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f4f,0xdb));var _0xf4f4=function(_0x26bbd1,_0xb274f3){_0x26bbd1=_0x26bbd1-0x0;var _0x26b1eb=_0x4f4f[_0x26bbd1];return _0x26b1eb;};'use strict';var _=require(_0xf4f4('0x0'));var moment=require(_0xf4f4('0x1'));var util=require('util');var Redis=require(_0xf4f4('0x2'));var BPromise=require(_0xf4f4('0x3'));var config=require(_0xf4f4('0x4'));var logger=require(_0xf4f4('0x5'))(_0xf4f4('0x6'));var ami=require(_0xf4f4('0x7'));config[_0xf4f4('0x8')]=_[_0xf4f4('0x9')](config[_0xf4f4('0x8')],{'host':_0xf4f4('0xa'),'port':0x18eb});var io=require(_0xf4f4('0xb'))(new Redis(config['redis']));function UserReport(_0x5c8844){this[_0xf4f4('0xc')]=_0x5c8844[_0xf4f4('0xc')];this[_0xf4f4('0xd')]=_0x5c8844[_0xf4f4('0xd')];this[_0xf4f4('0xe')]=_0x5c8844[_0xf4f4('0xe')];ami['on'](_0xf4f4('0xf'),this[_0xf4f4('0x10')][_0xf4f4('0x11')](this));ami['on'](_0xf4f4('0x12'),this['syncRegistry'][_0xf4f4('0x11')](this));ami['on']('devicestatechange',this[_0xf4f4('0x13')][_0xf4f4('0x11')](this));ami['on'](_0xf4f4('0x14'),this[_0xf4f4('0x15')][_0xf4f4('0x11')](this));return this[_0xf4f4('0x16')]();}function showSipRegistrations(){Promise[_0xf4f4('0x17')]()['then'](ami[_0xf4f4('0x18')]())['catch'](function(_0x2adf44){logger['error'](_0xf4f4('0x19'),util[_0xf4f4('0x1a')](_0x2adf44,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf4f4('0x17')]()[_0xf4f4('0x1b')](ami[_0xf4f4('0x1c')]())[_0xf4f4('0x1d')](function(_0xbc5597){logger[_0xf4f4('0x1e')](_0xf4f4('0x1f'),util['inspect'](_0xbc5597,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf4f4('0x17')]()[_0xf4f4('0x1b')](ami[_0xf4f4('0x20')]())[_0xf4f4('0x1d')](function(_0x2615ee){logger[_0xf4f4('0x1e')]('[userReport][sippeerstatus]',util[_0xf4f4('0x1a')](_0x2615ee,{'showHidden':![],'depth':null}));});}UserReport[_0xf4f4('0x21')][_0xf4f4('0x16')]=function(){setInterval(function(){BPromise[_0xf4f4('0x17')]()['then'](showSipRegistrations())[_0xf4f4('0x1b')](listDeviceStates())[_0xf4f4('0x1b')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xf4f4('0x22')]=function(_0x3c6ba0){return _0x3c6ba0!==null&&!_[_0xf4f4('0x23')](_0x3c6ba0);};UserReport[_0xf4f4('0x21')][_0xf4f4('0x24')]=function(_0x3fb144,_0x57e027,_0x321e2b){io['to'](_0x3fb144)['emit'](_0x57e027,_0x321e2b);};UserReport[_0xf4f4('0x21')][_0xf4f4('0x10')]=function(_0xcf864b){try{if(this['isNotNull'](_0xcf864b)){logger[_0xf4f4('0x25')](_0xf4f4('0x26'),_0xcf864b['username'],_0xcf864b[_0xf4f4('0x27')]);logger[_0xf4f4('0x28')](_0xf4f4('0x29'),util[_0xf4f4('0x1a')](_0xcf864b,{'showHidden':![],'depth':null}));var _0x1ede8b=_[_0xf4f4('0x2a')](this[_0xf4f4('0xc')],{'defaultuser':_0xcf864b[_0xf4f4('0x2b')]});if(_0x1ede8b){_0xcf864b[_0xf4f4('0x2c')]=_0xcf864b[_0xf4f4('0x27')];_[_0xf4f4('0x2d')](_0x1ede8b,_[_0xf4f4('0x2e')](_0xcf864b,[_0xf4f4('0x2f'),'actionid',_0xf4f4('0x2b'),_0xf4f4('0x27')]));logger['debug'](_0xf4f4('0x30'),util[_0xf4f4('0x1a')](_0x1ede8b,{'showHidden':![],'depth':null}));this[_0xf4f4('0x24')](util['format'](_0xf4f4('0x31'),_0x1ede8b[_0xf4f4('0x32')]),_0xf4f4('0x33'),_0x1ede8b);}}}catch(_0x4e6e15){logger[_0xf4f4('0x1e')]('[userReport][registry]',util[_0xf4f4('0x1a')](_0x4e6e15,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xf4f4('0x13')]=function(_0x1fbf0b){try{if(this['isNotNull'](_0x1fbf0b)){logger[_0xf4f4('0x25')](_0xf4f4('0x34'),_0x1fbf0b['device'],_0x1fbf0b[_0xf4f4('0x27')]);logger[_0xf4f4('0x28')]('[userReport][devicestatechange]',util[_0xf4f4('0x1a')](_0x1fbf0b,{'showHidden':![],'depth':null}));if(this[_0xf4f4('0xd')][_0x1fbf0b['device']]){if(!this[_0xf4f4('0xd')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x36')]||_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]()==_0xf4f4('0x38')){this[_0xf4f4('0xd')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x36')]=![];if(this['agents'][_0x1fbf0b['device']][_0xf4f4('0x27')]!==_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]()){this[_0xf4f4('0xd')][_0x1fbf0b['device']][_0xf4f4('0x39')]=_['toNumber'](moment()['format']('x'));}this[_0xf4f4('0xd')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x27')]=_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]();this[_0xf4f4('0xd')][_0x1fbf0b[_0xf4f4('0x35')]]['updateStatusRealtime'](_0x1fbf0b);}}else if(this[_0xf4f4('0xe')][_0x1fbf0b['device']]){if(this[_0xf4f4('0xe')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x27')]!==_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]()){this[_0xf4f4('0xe')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x39')]=_[_0xf4f4('0x3a')](moment()[_0xf4f4('0x3b')]('x'));}this[_0xf4f4('0xe')][_0x1fbf0b['device']][_0xf4f4('0x27')]=_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]();logger[_0xf4f4('0x28')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xf4f4('0x1a')](this[_0xf4f4('0xe')][_0x1fbf0b[_0xf4f4('0x35')]],{'showHidden':![],'depth':null}));this[_0xf4f4('0x24')](util['format'](_0xf4f4('0x3c'),this['telephones'][_0x1fbf0b[_0xf4f4('0x35')]]['name']),_0xf4f4('0x3d'),this['telephones'][_0x1fbf0b['device']]);}else if(this[_0xf4f4('0xc')][_0x1fbf0b['device']]){if(this[_0xf4f4('0xc')][_0x1fbf0b[_0xf4f4('0x35')]]['state']!==_0x1fbf0b[_0xf4f4('0x27')]['toLowerCase']()){this['trunks'][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x39')]=_[_0xf4f4('0x3a')](moment()['format']('x'));}this['trunks'][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x27')]=_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]();logger[_0xf4f4('0x28')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xf4f4('0x1a')](this[_0xf4f4('0xc')][_0x1fbf0b['device']],{'showHidden':![],'depth':null}));this[_0xf4f4('0x24')](util[_0xf4f4('0x3b')]('trunk:%s',this[_0xf4f4('0xc')][_0x1fbf0b[_0xf4f4('0x35')]][_0xf4f4('0x32')]),_0xf4f4('0x33'),this[_0xf4f4('0xc')][_0x1fbf0b[_0xf4f4('0x35')]]);}else if(_['startsWith'](_0x1fbf0b['device'],_0xf4f4('0x3e'))){var _0x350001=_0x1fbf0b[_0xf4f4('0x35')];var _0xb34122=_0x350001['substring'](_0x350001[_0xf4f4('0x3f')]('/')+0x1,_0x350001[_0xf4f4('0x3f')]('@'));var _0x5076d8=_[_0xf4f4('0x2a')](this[_0xf4f4('0xd')],function(_0x420c78){return _0x420c78[_0xf4f4('0x40')]==_0xb34122||_0x420c78['phone']==_0xb34122||_0x420c78['accountcode']==_0xb34122;});if(_0x5076d8){if(_0x5076d8['state']!==_0x1fbf0b['state'][_0xf4f4('0x37')]()){_0x5076d8[_0xf4f4('0x39')]=_[_0xf4f4('0x3a')](moment()[_0xf4f4('0x3b')]('x'));}_0x5076d8['state']=_0x1fbf0b[_0xf4f4('0x27')][_0xf4f4('0x37')]();_0x5076d8['local']=!![];_0x5076d8[_0xf4f4('0x41')](_0x1fbf0b);}}}}catch(_0xa1bb28){logger[_0xf4f4('0x1e')](_0xf4f4('0x42'),util[_0xf4f4('0x1a')](_0xa1bb28,{'showHidden':![],'depth':null}));}};UserReport[_0xf4f4('0x21')][_0xf4f4('0x15')]=function(_0x39a9f1){try{if(this[_0xf4f4('0x22')](_0x39a9f1)&&this[_0xf4f4('0x22')](_0x39a9f1[_0xf4f4('0x14')])){logger[_0xf4f4('0x25')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x39a9f1[_0xf4f4('0x43')],_0x39a9f1[_0xf4f4('0x44')],_0x39a9f1['peerstatus']);logger['debug'](_0xf4f4('0x45'),util[_0xf4f4('0x1a')](_0x39a9f1,{'showHidden':![],'depth':null}));if(this['agents'][_0x39a9f1[_0xf4f4('0x43')]]){if(!this[_0xf4f4('0xd')][_0x39a9f1[_0xf4f4('0x43')]][_0xf4f4('0x36')]||_0x39a9f1[_0xf4f4('0x14')][_0xf4f4('0x37')]()==_0xf4f4('0x46')){this[_0xf4f4('0xd')][_0x39a9f1[_0xf4f4('0x43')]][_0xf4f4('0x36')]=![];this[_0xf4f4('0xd')][_0x39a9f1[_0xf4f4('0x43')]]['status']=_0x39a9f1[_0xf4f4('0x14')][_0xf4f4('0x37')]();this[_0xf4f4('0xd')][_0x39a9f1[_0xf4f4('0x43')]]['address']=_0x39a9f1[_0xf4f4('0x44')];this[_0xf4f4('0xd')][_0x39a9f1[_0xf4f4('0x43')]]['updateStatusRealtime'](_0x39a9f1);}}else if(this[_0xf4f4('0xe')][_0x39a9f1['peer']]){this[_0xf4f4('0xe')][_0x39a9f1['peer']][_0xf4f4('0x47')]=_0x39a9f1[_0xf4f4('0x14')][_0xf4f4('0x37')]();this[_0xf4f4('0xe')][_0x39a9f1['peer']][_0xf4f4('0x44')]=_0x39a9f1[_0xf4f4('0x44')];logger[_0xf4f4('0x28')](_0xf4f4('0x48'),util[_0xf4f4('0x1a')](this[_0xf4f4('0xe')][_0x39a9f1[_0xf4f4('0x43')]],{'showHidden':![],'depth':null}));this[_0xf4f4('0x24')](util[_0xf4f4('0x3b')](_0xf4f4('0x3c'),this['telephones'][_0x39a9f1[_0xf4f4('0x43')]][_0xf4f4('0x32')]),_0xf4f4('0x3d'),this[_0xf4f4('0xe')][_0x39a9f1[_0xf4f4('0x43')]]);}else if(this[_0xf4f4('0xc')][_0x39a9f1[_0xf4f4('0x43')]]){this[_0xf4f4('0xc')][_0x39a9f1[_0xf4f4('0x43')]][_0xf4f4('0x47')]=_0x39a9f1[_0xf4f4('0x14')][_0xf4f4('0x37')]();this[_0xf4f4('0xc')][_0x39a9f1['peer']][_0xf4f4('0x44')]=_0x39a9f1[_0xf4f4('0x44')];logger['debug'](_0xf4f4('0x49'),util[_0xf4f4('0x1a')](this[_0xf4f4('0xc')][_0x39a9f1[_0xf4f4('0x43')]],{'showHidden':![],'depth':null}));this[_0xf4f4('0x24')](util['format']('trunk:%s',this[_0xf4f4('0xc')][_0x39a9f1[_0xf4f4('0x43')]][_0xf4f4('0x32')]),_0xf4f4('0x33'),this[_0xf4f4('0xc')][_0x39a9f1[_0xf4f4('0x43')]]);}}}catch(_0x262973){logger['error']('[userReport][peerstatus]',util[_0xf4f4('0x1a')](_0x262973,{'showHidden':![],'depth':null}));}};module[_0xf4f4('0x4a')]=UserReport; \ No newline at end of file +var _0x5f18=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../ami','redis','localhost','socket.io-emitter','trunks','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','actionDeviceStateList','error','inspect','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','agents','local','toLowerCase','inuse','updateStatusRealtime','stateTime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status'];(function(_0xaa3341,_0x2edfde){var _0x376555=function(_0x38d2a6){while(--_0x38d2a6){_0xaa3341['push'](_0xaa3341['shift']());}};_0x376555(++_0x2edfde);}(_0x5f18,0x1f4));var _0x85f1=function(_0x4ab887,_0x222b28){_0x4ab887=_0x4ab887-0x0;var _0x2f2f71=_0x5f18[_0x4ab887];return _0x2f2f71;};'use strict';var _=require(_0x85f1('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x85f1('0x1'));var BPromise=require(_0x85f1('0x2'));var config=require(_0x85f1('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x85f1('0x4'));config[_0x85f1('0x5')]=_['defaults'](config[_0x85f1('0x5')],{'host':_0x85f1('0x6'),'port':0x18eb});var io=require(_0x85f1('0x7'))(new Redis(config[_0x85f1('0x5')]));function UserReport(_0x26a06a){this[_0x85f1('0x8')]=_0x26a06a[_0x85f1('0x8')];this['agents']=_0x26a06a['agents'];this[_0x85f1('0x9')]=_0x26a06a[_0x85f1('0x9')];ami['on'](_0x85f1('0xa'),this[_0x85f1('0xb')][_0x85f1('0xc')](this));ami['on'](_0x85f1('0xd'),this['syncRegistry'][_0x85f1('0xc')](this));ami['on'](_0x85f1('0xe'),this[_0x85f1('0xf')][_0x85f1('0xc')](this));ami['on'](_0x85f1('0x10'),this[_0x85f1('0x11')][_0x85f1('0xc')](this));return this[_0x85f1('0x12')]();}function showSipRegistrations(){Promise[_0x85f1('0x13')]()[_0x85f1('0x14')](ami[_0x85f1('0x15')]())[_0x85f1('0x16')](function(_0x3ebab9){logger['error']('[userReport][sipshowregistry]',util['inspect'](_0x3ebab9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x85f1('0x13')]()[_0x85f1('0x14')](ami[_0x85f1('0x17')]())[_0x85f1('0x16')](function(_0x15ac8f){logger[_0x85f1('0x18')]('[userReport][devicestatelist]',util[_0x85f1('0x19')](_0x15ac8f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x85f1('0x13')]()['then'](ami[_0x85f1('0x1a')]())[_0x85f1('0x16')](function(_0x418f65){logger[_0x85f1('0x18')]('[userReport][sippeerstatus]',util[_0x85f1('0x19')](_0x418f65,{'showHidden':![],'depth':null}));});}UserReport[_0x85f1('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x85f1('0x13')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x85f1('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x85f1('0x1b')][_0x85f1('0x1c')]=function(_0x57ea46){return _0x57ea46!==null&&!_[_0x85f1('0x1d')](_0x57ea46);};UserReport[_0x85f1('0x1b')][_0x85f1('0x1e')]=function(_0x1e4a38,_0x581194,_0x2211e1){io['to'](_0x1e4a38)[_0x85f1('0x1e')](_0x581194,_0x2211e1);};UserReport[_0x85f1('0x1b')]['syncRegistry']=function(_0xedbae8){try{if(this[_0x85f1('0x1c')](_0xedbae8)){logger[_0x85f1('0x1f')](_0x85f1('0x20'),_0xedbae8[_0x85f1('0x21')],_0xedbae8[_0x85f1('0x22')]);logger[_0x85f1('0x23')]('[userReport][registry]',util[_0x85f1('0x19')](_0xedbae8,{'showHidden':![],'depth':null}));var _0x5858bc=_['find'](this[_0x85f1('0x8')],{'defaultuser':_0xedbae8[_0x85f1('0x21')]});if(_0x5858bc){_0xedbae8['stateRegistry']=_0xedbae8['state'];_['merge'](_0x5858bc,_[_0x85f1('0x24')](_0xedbae8,[_0x85f1('0x25'),_0x85f1('0x26'),_0x85f1('0x21'),'state']));logger[_0x85f1('0x23')](_0x85f1('0x27'),util[_0x85f1('0x19')](_0x5858bc,{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util[_0x85f1('0x28')](_0x85f1('0x29'),_0x5858bc[_0x85f1('0x2a')]),_0x85f1('0x2b'),_0x5858bc);}}}catch(_0x210a44){logger[_0x85f1('0x18')](_0x85f1('0x2c'),util['inspect'](_0x210a44,{'showHidden':![],'depth':null}));}};UserReport[_0x85f1('0x1b')][_0x85f1('0xf')]=function(_0x60b871){try{if(this['isNotNull'](_0x60b871)){logger[_0x85f1('0x1f')](_0x85f1('0x2d'),_0x60b871[_0x85f1('0x2e')],_0x60b871['state']);logger[_0x85f1('0x23')](_0x85f1('0x2f'),util['inspect'](_0x60b871,{'showHidden':![],'depth':null}));if(this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]]){if(!this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x31')]||_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()==_0x85f1('0x33')){this[_0x85f1('0x30')][_0x60b871['device']][_0x85f1('0x31')]=![];if(this['agents'][_0x60b871['device']]['state']!==_0x60b871[_0x85f1('0x22')]['toLowerCase']()){this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]]['stateTime']=_['toNumber'](moment()[_0x85f1('0x28')]('x'));}this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871['state'][_0x85f1('0x32')]();this['agents'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x34')](_0x60b871);}}else if(this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]]){if(this['telephones'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}this['telephones'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871['state'][_0x85f1('0x32')]();logger[_0x85f1('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x85f1('0x19')](this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util['format'](_0x85f1('0x37'),this[_0x85f1('0x9')][_0x60b871['device']]['name']),_0x85f1('0x38'),this[_0x85f1('0x9')][_0x60b871['device']]);}else if(this[_0x85f1('0x8')][_0x60b871['device']]){if(this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]]['state']!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){this['trunks'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871[_0x85f1('0x22')]['toLowerCase']();logger['debug'](_0x85f1('0x39'),util[_0x85f1('0x19')](this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util[_0x85f1('0x28')]('trunk:%s',this['trunks'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x2a')]),_0x85f1('0x2b'),this['trunks'][_0x60b871[_0x85f1('0x2e')]]);}else if(_['startsWith'](_0x60b871[_0x85f1('0x2e')],'Local')){var _0x344b7b=_0x60b871[_0x85f1('0x2e')];var _0x2cd3fa=_0x344b7b['substring'](_0x344b7b[_0x85f1('0x3a')]('/')+0x1,_0x344b7b[_0x85f1('0x3a')]('@'));var _0x4af3db=_[_0x85f1('0x3b')](this['agents'],function(_0x163c49){return _0x163c49[_0x85f1('0x3c')]==_0x2cd3fa||_0x163c49[_0x85f1('0x3d')]==_0x2cd3fa||_0x163c49[_0x85f1('0x3e')]==_0x2cd3fa;});if(_0x4af3db){if(_0x4af3db['state']!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){_0x4af3db[_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}_0x4af3db[_0x85f1('0x22')]=_0x60b871[_0x85f1('0x22')]['toLowerCase']();_0x4af3db[_0x85f1('0x31')]=!![];_0x4af3db[_0x85f1('0x34')](_0x60b871);}}}}catch(_0x589997){logger[_0x85f1('0x18')](_0x85f1('0x2f'),util['inspect'](_0x589997,{'showHidden':![],'depth':null}));}};UserReport[_0x85f1('0x1b')][_0x85f1('0x11')]=function(_0x576a03){try{if(this[_0x85f1('0x1c')](_0x576a03)&&this['isNotNull'](_0x576a03[_0x85f1('0x10')])){logger['info'](_0x85f1('0x3f'),_0x576a03[_0x85f1('0x40')],_0x576a03[_0x85f1('0x41')],_0x576a03['peerstatus']);logger[_0x85f1('0x23')](_0x85f1('0x42'),util[_0x85f1('0x19')](_0x576a03,{'showHidden':![],'depth':null}));if(this['agents'][_0x576a03[_0x85f1('0x40')]]){if(!this[_0x85f1('0x30')][_0x576a03['peer']]['local']||_0x576a03[_0x85f1('0x10')]['toLowerCase']()=='registered'){this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x31')]=![];this['agents'][_0x576a03['peer']][_0x85f1('0x43')]=_0x576a03[_0x85f1('0x10')]['toLowerCase']();this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]]['address']=_0x576a03[_0x85f1('0x41')];this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x34')](_0x576a03);}}else if(this['telephones'][_0x576a03[_0x85f1('0x40')]]){this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x43')]=_0x576a03['peerstatus'][_0x85f1('0x32')]();this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x41')]=_0x576a03[_0x85f1('0x41')];logger[_0x85f1('0x23')](_0x85f1('0x44'),util[_0x85f1('0x19')](this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x85f1('0x9')][_0x576a03['peer']]['name']),_0x85f1('0x38'),this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]]);}else if(this['trunks'][_0x576a03['peer']]){this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x43')]=_0x576a03[_0x85f1('0x10')]['toLowerCase']();this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x41')]=_0x576a03[_0x85f1('0x41')];logger[_0x85f1('0x23')](_0x85f1('0x45'),util['inspect'](this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util['format'](_0x85f1('0x29'),this['trunks'][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x2a')]),_0x85f1('0x2b'),this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]]);}}}catch(_0x235704){logger[_0x85f1('0x18')](_0x85f1('0x42'),util[_0x85f1('0x19')](_0x235704,{'showHidden':![],'depth':null}));}};module[_0x85f1('0x46')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 667302d..89152d5 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x609b=['redis','defaults','localhost','channels','voiceChannels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','queue','mandatoryDisposition','type','inbound','voice','merge','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','routealias','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','talktime','acwtime','acwTimeout','agentacw','destconnectedlinenum','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variables','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','agentcompleteAt','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','util','ioredis','../../../config/environment','ami','../ami'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0x609b,0x1b7));var _0xb609=function(_0x1db972,_0x2d6466){_0x1db972=_0x1db972-0x0;var _0x113c43=_0x609b[_0x1db972];return _0x113c43;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xb609('0x0'));var Redis=require(_0xb609('0x1'));var config=require(_0xb609('0x2'));var logger=require('../../../config/logger')(_0xb609('0x3'));var ami=require(_0xb609('0x4'));config[_0xb609('0x5')]=_[_0xb609('0x6')](config[_0xb609('0x5')],{'host':_0xb609('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb609('0x5')]));function VoiceAgentReport(_0x4707f3){this[_0xb609('0x8')]={};this[_0xb609('0x9')]=_0x4707f3[_0xb609('0x8')];this[_0xb609('0xa')]=_0x4707f3[_0xb609('0xa')];this[_0xb609('0xb')]=_0x4707f3[_0xb609('0xb')];this['variables']={};ami['on'](_0xb609('0xc'),this[_0xb609('0xd')][_0xb609('0xe')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xb609('0xe')](this));ami['on'](_0xb609('0xf'),this['syncAgentRingNoAnswer'][_0xb609('0xe')](this));ami['on']('queuecallerabandon',this[_0xb609('0x10')][_0xb609('0xe')](this));ami['on']('agentcomplete',this[_0xb609('0x11')][_0xb609('0xe')](this));ami['on'](_0xb609('0x12'),this[_0xb609('0x13')][_0xb609('0xe')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xb609('0x14'),this[_0xb609('0x15')][_0xb609('0xe')](this));ami['on'](_0xb609('0x16'),this['syncMusicOnHoldStop'][_0xb609('0xe')](this));ami['on'](_0xb609('0x17'),this[_0xb609('0x18')]['bind'](this));ami['on']('blindtransfer',this[_0xb609('0x19')]['bind'](this));}VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x1b')]=function(_0x460f99,_0x1019c6,_0x406988){io['to'](_0x460f99)[_0xb609('0x1b')](_0x1019c6,_0x406988);};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x1c')]=function(_0x15fe79){return _0x15fe79!==null&&!_[_0xb609('0x1d')](_0x15fe79);};VoiceAgentReport[_0xb609('0x1a')]['syncAgentCalled']=function(_0x3940a3){try{if(this[_0xb609('0x1c')](_0x3940a3)){logger['info'](_0xb609('0x1e'),_0x3940a3[_0xb609('0x1f')],_0x3940a3[_0xb609('0x20')],_0x3940a3[_0xb609('0x21')]);logger[_0xb609('0x22')](_0xb609('0x23'),_0x3940a3[_0xb609('0x1f')],util[_0xb609('0x24')](_0x3940a3,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]])){this['channels'][_0x3940a3['uniqueid']]={};}if(_[_0xb609('0x1d')](this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3[_0xb609('0x21')]])){this[_0xb609('0x8')][_0x3940a3['uniqueid']][_0x3940a3[_0xb609('0x21')]]={'agentcalledAt':moment()[_0xb609('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':this[_0xb609('0xa')][_0x3940a3[_0xb609('0x26')]]?this[_0xb609('0xa')][_0x3940a3[_0xb609('0x26')]][_0xb609('0x27')]||![]:![],'type':this[_0xb609('0xa')][_0x3940a3['queue']]?this[_0xb609('0xa')][_0x3940a3[_0xb609('0x26')]][_0xb609('0x28')]||'inbound':_0xb609('0x29'),'variables':this['variables'][_0x3940a3[_0xb609('0x1f')]],'motionChannel':_0xb609('0x2a')};}_[_0xb609('0x2b')](this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3['destuniqueid']],_[_0xb609('0x2c')](_0x3940a3,['event',_0xb609('0x2d')]));logger[_0xb609('0x22')](_0xb609('0x2e'),_0x3940a3[_0xb609('0x1f')],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3[_0xb609('0x21')]],{'showHidden':![],'depth':null}));ami[_0xb609('0x1b')](_0xb609('0x2f'),this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3[_0xb609('0x21')]]);logger[_0xb609('0x22')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x3940a3[_0xb609('0x1f')],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3[_0xb609('0x21')]],{'showHidden':![],'depth':null}));this[_0xb609('0x1b')](util['format'](_0xb609('0x30'),_0x3940a3[_0xb609('0x20')]),_0xb609('0x31'),this[_0xb609('0x8')][_0x3940a3[_0xb609('0x1f')]][_0x3940a3['destuniqueid']]);}}catch(_0x1e46b0){logger['error'](_0xb609('0x32'),_0x3940a3[_0xb609('0x1f')],util[_0xb609('0x24')](_0x1e46b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb609('0x33')]=function(_0x505639){try{if(this[_0xb609('0x1c')](_0x505639)){if(this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]]){logger[_0xb609('0x22')](_0xb609('0x34'),_0x505639[_0xb609('0x1f')],util['inspect'](_0x505639,{'showHidden':![],'depth':null}));for(var _0x119d21 in this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]]){if(this[_0xb609('0x8')][_0x505639['uniqueid']][_0xb609('0x35')](_0x119d21)){if(_0x505639[_0xb609('0x21')]===_0x119d21){logger[_0xb609('0x36')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x505639[_0xb609('0x1f')],_0x505639[_0xb609('0x20')],_0x505639[_0xb609('0x21')]);this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x37')]=moment()['format'](_0xb609('0x38'));this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x39')]=_0x505639[_0xb609('0x39')];this['channels'][_0x505639[_0xb609('0x1f')]][_0x119d21]['connectedlinenum']=_0x505639[_0xb609('0x3a')];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x3b')]=_0x505639[_0xb609('0x3b')];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x3c')]=_0x505639[_0xb609('0x3c')];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x3d')]=_0x505639['holdtime'];this['channels'][_0x505639[_0xb609('0x1f')]][_0x119d21]['lastevent']='connect';if(this[_0xb609('0x9')][this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x1f')]]){var _0x5f2f46=this[_0xb609('0x9')][this['channels'][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x1f')]][_0xb609('0x3e')];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x3e')]=_0x5f2f46;_0x505639[_0xb609('0x3e')]=_0x5f2f46;}_[_0xb609('0x2b')](this[_0xb609('0xb')][_0x505639[_0xb609('0x3f')]],_[_0xb609('0x40')](_0x505639,[_0xb609('0x26'),'destconnectedlinenum',_0xb609('0x3e')]));logger['debug'](_0xb609('0x41'),_0x505639['uniqueid'],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x505639['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xb609('0x42'),this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x505639[_0xb609('0x21')]]);logger[_0xb609('0x22')](_0xb609('0x43'),_0x505639[_0xb609('0x1f')],util[_0xb609('0x24')](this['channels'][_0x505639[_0xb609('0x1f')]][_0x505639[_0xb609('0x21')]],{'showHidden':![],'depth':null}));this[_0xb609('0x1b')](util[_0xb609('0x25')](_0xb609('0x30'),_0x505639[_0xb609('0x20')]),_0xb609('0x44'),this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x505639[_0xb609('0x21')]]);}else if(!this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0xf')]&&!this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x45')]){logger[_0xb609('0x36')](_0xb609('0x46'),_0x505639[_0xb609('0x1f')],this[_0xb609('0x8')][_0x505639['uniqueid']][_0x119d21][_0xb609('0x20')],_0x119d21);this[_0xb609('0x8')][_0x505639['uniqueid']][_0x119d21][_0xb609('0xf')]=!![];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x47')]=moment()[_0xb609('0x25')](_0xb609('0x38'));this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x48')]=_0x505639['destuniqueid'];this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x49')]=_0x505639[_0xb609('0x20')];this['channels'][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x4a')]=_0xb609('0x4b');this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21][_0xb609('0x4c')]=_0xb609('0x4b');logger[_0xb609('0x22')](_0xb609('0x4d'),_0x505639['uniqueid'],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x505639[_0xb609('0x1f')]][_0x119d21],{'showHidden':![],'depth':null}));ami['emit'](_0xb609('0x4e'),this['channels'][_0x505639[_0xb609('0x1f')]][_0x119d21]);}}}}}}catch(_0x551842){logger[_0xb609('0x4f')]('[%s][voiceAgentReport][agentconnect]',_0x505639[_0xb609('0x1f')],util[_0xb609('0x24')](_0x551842,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')]['syncAgentRingNoAnswer']=function(_0x3430f8){try{if(this[_0xb609('0x1c')](_0x3430f8)){logger[_0xb609('0x22')](_0xb609('0x50'),_0x3430f8['uniqueid'],util[_0xb609('0x24')](_0x3430f8,{'showHidden':![],'depth':null}));if(this['channels'][_0x3430f8['uniqueid']]&&this[_0xb609('0x8')][_0x3430f8['uniqueid']][_0x3430f8['destuniqueid']]){logger[_0xb609('0x36')](_0xb609('0x51'),_0x3430f8[_0xb609('0x1f')],_0x3430f8[_0xb609('0x20')],_0x3430f8[_0xb609('0x21')]);this[_0xb609('0x8')][_0x3430f8[_0xb609('0x1f')]][_0x3430f8[_0xb609('0x21')]][_0xb609('0xf')]=!![];this['channels'][_0x3430f8[_0xb609('0x1f')]][_0x3430f8[_0xb609('0x21')]][_0xb609('0x47')]=moment()[_0xb609('0x25')](_0xb609('0x38'));this['channels'][_0x3430f8[_0xb609('0x1f')]][_0x3430f8[_0xb609('0x21')]][_0xb609('0x4a')]=_0xb609('0x52');this[_0xb609('0x8')][_0x3430f8[_0xb609('0x1f')]][_0x3430f8[_0xb609('0x21')]][_0xb609('0x4c')]=_0xb609('0x52');logger[_0xb609('0x22')](_0xb609('0x53'),_0x3430f8[_0xb609('0x1f')],util[_0xb609('0x24')](this['channels'][_0x3430f8['uniqueid']][_0x3430f8[_0xb609('0x21')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb609('0x54'),this[_0xb609('0x8')][_0x3430f8[_0xb609('0x1f')]][_0x3430f8[_0xb609('0x21')]]);}}}catch(_0x478916){logger[_0xb609('0x4f')](_0xb609('0x55'),_0x3430f8[_0xb609('0x1f')],util[_0xb609('0x24')](_0x478916,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x10')]=function(_0x121e06){try{if(this[_0xb609('0x1c')](_0x121e06)){logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x121e06[_0xb609('0x1f')],util[_0xb609('0x24')](_0x121e06,{'showHidden':![],'depth':null}));if(this['channels'][_0x121e06[_0xb609('0x1f')]]){for(var _0x48f03f in this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]]){if(this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0xb609('0x35')](_0x48f03f)&&!this[_0xb609('0x8')][_0x121e06['uniqueid']][_0x48f03f]['agentringnoanswer']&&!this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f][_0xb609('0x45')]){logger[_0xb609('0x36')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x121e06[_0xb609('0x1f')],this[_0xb609('0x8')][_0x121e06['uniqueid']][_0x48f03f][_0xb609('0x20')],_0x48f03f);this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f]['agentringnoanswer']=!![];this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f][_0xb609('0x47')]=moment()[_0xb609('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f][_0xb609('0x4a')]=_0xb609('0x56');this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f][_0xb609('0x4c')]=_0xb609('0x56');logger[_0xb609('0x22')](_0xb609('0x57'),_0x121e06['uniqueid'],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f],{'showHidden':![],'depth':null}));ami[_0xb609('0x1b')]('custom:agentqueuecallerabandon',this[_0xb609('0x8')][_0x121e06[_0xb609('0x1f')]][_0x48f03f]);}}}}}catch(_0xaf7d57){logger[_0xb609('0x4f')](_0xb609('0x58'),_0x121e06[_0xb609('0x1f')],util['inspect'](_0xaf7d57,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x11')]=function(_0x5bda29){try{if(this['isNotNull'](_0x5bda29)){logger['debug'](_0xb609('0x59'),_0x5bda29['uniqueid'],util[_0xb609('0x24')](_0x5bda29,{'showHidden':![],'depth':null}));if(this['channels'][_0x5bda29['uniqueid']]){for(var _0x451f35 in this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]]){if(this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0xb609('0x35')](_0x451f35)){if(this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x37')]&&!this['channels'][_0x5bda29['uniqueid']][_0x451f35]['agentcomplete']){logger['info'](_0xb609('0x5a'),_0x5bda29[_0xb609('0x1f')],this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x20')],_0x451f35);this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x45')]=!![];this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35]['agentcompleteAt']=moment()['format'](_0xb609('0x38'));this['channels'][_0x5bda29[_0xb609('0x1f')]][_0x451f35]['lastevent']=_0xb609('0x5b');this['channels'][_0x5bda29['uniqueid']][_0x451f35][_0xb609('0x4c')]=_0x5bda29[_0xb609('0x4c')]=='transfer'?'agent':_0x5bda29[_0xb609('0x4c')];this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x5c')]=_0x5bda29[_0xb609('0x5c')];if(this['voiceQueues'][_0x5bda29['queue']]&&this[_0xb609('0xa')][_0x5bda29[_0xb609('0x26')]]['acw']){this['channels'][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x5d')]=this[_0xb609('0xa')][_0x5bda29['queue']][_0xb609('0x5e')];this['channels'][_0x5bda29[_0xb609('0x1f')]][_0x451f35][_0xb609('0x5f')]=!![];}this[_0xb609('0xb')][_0x5bda29[_0xb609('0x3f')]]=_[_0xb609('0x2c')](this['agents'][_0x5bda29[_0xb609('0x3f')]],['queue',_0xb609('0x60')]);logger[_0xb609('0x22')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5bda29['uniqueid'],util[_0xb609('0x24')](this[_0xb609('0x8')][_0x5bda29['uniqueid']][_0x451f35],{'showHidden':![],'depth':null}));ami[_0xb609('0x1b')]('custom:agentcomplete',this[_0xb609('0x8')][_0x5bda29[_0xb609('0x1f')]][_0x451f35]);logger[_0xb609('0x22')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5bda29[_0xb609('0x1f')],util[_0xb609('0x24')](this['channels'][_0x5bda29['uniqueid']][_0x451f35],{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0x5bda29['membername']),_0xb609('0x61'),this[_0xb609('0x8')][_0x5bda29['uniqueid']][_0x451f35]);}}}}}}catch(_0x50d1e3){logger[_0xb609('0x4f')](_0xb609('0x62'),_0x5bda29['uniqueid'],util[_0xb609('0x24')](_0x50d1e3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x13')]=function(_0x17b64f){try{if(this['isNotNull'](_0x17b64f)){logger['debug'](_0xb609('0x63'),_0x17b64f[_0xb609('0x1f')],util['inspect'](_0x17b64f,{'showHidden':![],'depth':null}));this[_0xb609('0x64')](_0x17b64f[_0xb609('0x1f')],_[_0xb609('0x65')](_0x17b64f[_0xb609('0x66')])[0x0],_0x17b64f[_0xb609('0x67')]);if(this['channels'][_0x17b64f['uniqueid']]){for(var _0x1f560a in this[_0xb609('0x8')][_0x17b64f[_0xb609('0x1f')]]){if(this[_0xb609('0x8')][_0x17b64f['uniqueid']]['hasOwnProperty'](_0x1f560a)){logger[_0xb609('0x36')](_0xb609('0x68'),_0x17b64f[_0xb609('0x1f')],_0x1f560a,_[_0xb609('0x65')](_0x17b64f['variable'])[0x0],_0x17b64f[_0xb609('0x67')]);if(_[_0xb609('0x1d')](this[_0xb609('0x8')][_0x17b64f[_0xb609('0x1f')]][_0x1f560a][_0xb609('0x69')])){this[_0xb609('0x8')][_0x17b64f['uniqueid']][_0x1f560a][_0xb609('0x69')]={};}this['channels'][_0x17b64f[_0xb609('0x1f')]][_0x1f560a][_0xb609('0x69')]=this[_0xb609('0x69')][_0x17b64f[_0xb609('0x1f')]];}}}}}catch(_0x4f3c03){logger[_0xb609('0x4f')](_0xb609('0x6a'),_0x17b64f[_0xb609('0x1f')],util['inspect'](_0x4f3c03,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')]['addVariable']=function(_0x3bdba7,_0x551e4e,_0x293470){var _0x419fb3=[_0xb609('0x6b'),_0xb609('0x6c'),_0xb609('0x6d'),_0xb609('0x6e'),_0xb609('0x6f'),_0xb609('0x70'),_0xb609('0x71'),_0xb609('0x72'),'sipcallid',_0xb609('0x73'),'bridgepeer',_0xb609('0x74'),_0xb609('0x75'),'memberdynamic',_0xb609('0x76'),_0xb609('0x77'),_0xb609('0x20'),_0xb609('0x78'),_0xb609('0x79')];if(!_['isNil'](_0x551e4e)&&!_[_0xb609('0x7a')](_0x419fb3,_0x551e4e)){if(_[_0xb609('0x1d')](this[_0xb609('0x69')][_0x3bdba7])){this[_0xb609('0x69')][_0x3bdba7]={};}this[_0xb609('0x69')][_0x3bdba7][_0x551e4e]=_0x293470;}};VoiceAgentReport['prototype'][_0xb609('0x7b')]=function(_0x41bdaa){try{if(this[_0xb609('0x1c')](_0x41bdaa)){logger['debug'](_0xb609('0x7c'),_0x41bdaa['uniqueid'],util[_0xb609('0x24')](_0x41bdaa,{'showHidden':![],'depth':null}));if(this[_0xb609('0x8')][_0x41bdaa['uniqueid']]){for(var _0xe2020f in this['channels'][_0x41bdaa[_0xb609('0x1f')]]){if(this['channels'][_0x41bdaa[_0xb609('0x1f')]][_0xb609('0x35')](_0xe2020f)){if(this[_0xb609('0x8')][_0x41bdaa[_0xb609('0x1f')]][_0xe2020f][_0xb609('0x4c')]==_0xb609('0x7d')&&this['channels'][_0x41bdaa[_0xb609('0x1f')]][_0xe2020f][_0xb609('0x45')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x41bdaa[_0xb609('0x1f')],_0xe2020f);this[_0xb609('0x8')][_0x41bdaa[_0xb609('0x1f')]][_0xe2020f][_0xb609('0x7e')]=moment()[_0xb609('0x25')](_0xb609('0x38'));}}}logger[_0xb609('0x22')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x41bdaa[_0xb609('0x1f')],util[_0xb609('0x24')](_['values'](this['channels'][_0x41bdaa[_0xb609('0x1f')]]),{'showHidden':![],'depth':null}));ami['emit'](_0xb609('0x7f'),_[_0xb609('0x80')](this[_0xb609('0x8')][_0x41bdaa[_0xb609('0x1f')]]));delete this[_0xb609('0x8')][_0x41bdaa[_0xb609('0x1f')]];}if(this[_0xb609('0x69')][_0x41bdaa[_0xb609('0x1f')]]){delete this[_0xb609('0x69')][_0x41bdaa[_0xb609('0x1f')]];}}}catch(_0x5ebe58){logger['error'](_0xb609('0x81'),_0x41bdaa['uniqueid'],util['inspect'](_0x5ebe58,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x18')]=function(_0x4f4e64){try{if(this['isNotNull'](_0x4f4e64)){logger[_0xb609('0x22')](_0xb609('0x82'),_0x4f4e64[_0xb609('0x1f')],util[_0xb609('0x24')](_0x4f4e64,{'showHidden':![],'depth':null}));if(this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]]){for(var _0x52ebea in this[_0xb609('0x8')][_0x4f4e64['transfereeuniqueid']]){if(this['channels'][_0x4f4e64[_0xb609('0x83')]][_0xb609('0x35')](_0x52ebea)){if(_0x4f4e64['origtransfereruniqueid']===_0x52ebea){logger[_0xb609('0x36')](_0xb609('0x84'),_0x4f4e64[_0xb609('0x1f')],this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]][_0x52ebea][_0xb609('0x20')],_0x52ebea);var _0x5b315f=moment();this['channels'][_0x4f4e64['transfereeuniqueid']][_0x52ebea][_0xb609('0x45')]=!![];this[_0xb609('0x8')][_0x4f4e64['transfereeuniqueid']][_0x52ebea][_0xb609('0x7e')]=moment()[_0xb609('0x25')](_0xb609('0x38'));this['channels'][_0x4f4e64[_0xb609('0x83')]][_0x52ebea][_0xb609('0x4a')]=_0xb609('0x5b');this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]][_0x52ebea][_0xb609('0x4c')]=_0xb609('0x7d');this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]][_0x52ebea]['talktime']=_0x5b315f[_0xb609('0x85')](this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]][_0x52ebea][_0xb609('0x37')],_0xb609('0x86'));}}}}if(this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x87')]]){var _0x25b7f5=this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x87')]];this[_0xb609('0x8')][_0x4f4e64['secondtransfereruniqueid']]=this[_0xb609('0x8')][_0x4f4e64[_0xb609('0x83')]];this[_0xb609('0x8')][_0x4f4e64['transfereeuniqueid']]=_0x25b7f5;}}}catch(_0x163067){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x4f4e64['uniqueid'],util['inspect'](_0x163067,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x19')]=function(_0xe6040a){try{if(this[_0xb609('0x1c')](_0xe6040a)){logger[_0xb609('0x22')](_0xb609('0x88'),_0xe6040a['uniqueid'],util[_0xb609('0x24')](_0xe6040a,{'showHidden':![],'depth':null}));if(this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]]){for(var _0x54a4c8 in this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]]){if(this['channels'][_0xe6040a[_0xb609('0x83')]][_0xb609('0x35')](_0x54a4c8)){if(_0xe6040a[_0xb609('0x89')]===_0x54a4c8){logger[_0xb609('0x36')](_0xb609('0x8a'),_0xe6040a[_0xb609('0x1f')],this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8]['membername'],_0x54a4c8);var _0xc775c9=moment();this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8][_0xb609('0x45')]=!![];this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8][_0xb609('0x7e')]=_0xc775c9;this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8][_0xb609('0x4a')]=_0xb609('0x5b');this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8]['reason']=_0xb609('0x7d');this['channels'][_0xe6040a[_0xb609('0x83')]][_0x54a4c8]['talktime']=_0xc775c9[_0xb609('0x85')](this[_0xb609('0x8')][_0xe6040a[_0xb609('0x83')]][_0x54a4c8][_0xb609('0x37')],'seconds');}}}}}}catch(_0x1472be){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0xe6040a['uniqueid'],util['inspect'](_0x1472be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x15')]=function(_0x41a8cb){var _0x41308a='';try{if(this[_0xb609('0x1c')](_0x41a8cb)){logger[_0xb609('0x22')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x41a8cb[_0xb609('0x1f')],util['inspect'](_0x41a8cb,{'showHidden':![],'depth':null}));if(_0x41a8cb['channel']){_0x41308a=_0x41a8cb[_0xb609('0x8b')]['substring'](0x0,_0x41a8cb[_0xb609('0x8b')][_0xb609('0x8c')]('-'));if(this['agents'][_0x41308a]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x41a8cb[_0xb609('0x1f')],_0x41308a);this[_0xb609('0xb')][_0x41308a][_0xb609('0x8d')]=!![];}}}}catch(_0x4fafb7){logger[_0xb609('0x4f')](_0xb609('0x8e'),_0x41a8cb[_0xb609('0x1f')],util[_0xb609('0x24')](_0x4fafb7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb609('0x1a')][_0xb609('0x8f')]=function(_0x57e6d){var _0x43b1ff='';try{if(this[_0xb609('0x1c')](_0x57e6d)){logger[_0xb609('0x22')](_0xb609('0x90'),_0x57e6d[_0xb609('0x1f')],util['inspect'](_0x57e6d,{'showHidden':![],'depth':null}));if(_0x57e6d[_0xb609('0x8b')]){_0x43b1ff=_0x57e6d[_0xb609('0x8b')][_0xb609('0x91')](0x0,_0x57e6d[_0xb609('0x8b')][_0xb609('0x8c')]('-'));if(this[_0xb609('0xb')][_0x43b1ff]){logger[_0xb609('0x36')](_0xb609('0x92'),_0x57e6d[_0xb609('0x1f')],_0x43b1ff);this['agents'][_0x43b1ff]['onhold']=![];}}}}catch(_0x3d151d){logger['error'](_0xb609('0x93'),_0x57e6d['uniqueid'],util['inspect'](_0x3d151d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x3cdc=['[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variables','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','agents','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','format','called','voiceQueues','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','routealias','pick','custom:agentconnect'];(function(_0x399c0c,_0x44b8e2){var _0x491d0a=function(_0x2065d9){while(--_0x2065d9){_0x399c0c['push'](_0x399c0c['shift']());}};_0x491d0a(++_0x44b8e2);}(_0x3cdc,0x18b));var _0xc3cd=function(_0x3ea360,_0x4a3b9e){_0x3ea360=_0x3ea360-0x0;var _0x330457=_0x3cdc[_0x3ea360];return _0x330457;};'use strict';var _=require('lodash');var moment=require(_0xc3cd('0x0'));var util=require(_0xc3cd('0x1'));var Redis=require(_0xc3cd('0x2'));var config=require(_0xc3cd('0x3'));var logger=require(_0xc3cd('0x4'))(_0xc3cd('0x5'));var ami=require(_0xc3cd('0x6'));config[_0xc3cd('0x7')]=_[_0xc3cd('0x8')](config[_0xc3cd('0x7')],{'host':_0xc3cd('0x9'),'port':0x18eb});var io=require(_0xc3cd('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x55436c){this[_0xc3cd('0xb')]={};this[_0xc3cd('0xc')]=_0x55436c['channels'];this['voiceQueues']=_0x55436c['voiceQueues'];this['agents']=_0x55436c[_0xc3cd('0xd')];this['variables']={};ami['on'](_0xc3cd('0xe'),this[_0xc3cd('0xf')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x11'),this['syncAgentConnect'][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x12'),this[_0xc3cd('0x13')][_0xc3cd('0x10')](this));ami['on']('queuecallerabandon',this[_0xc3cd('0x14')]['bind'](this));ami['on'](_0xc3cd('0x15'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0xc3cd('0x16')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x17'),this[_0xc3cd('0x18')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x19'),this[_0xc3cd('0x1a')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x1b'),this[_0xc3cd('0x1c')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x1d'),this[_0xc3cd('0x1e')]['bind'](this));ami['on']('blindtransfer',this[_0xc3cd('0x1f')][_0xc3cd('0x10')](this));}VoiceAgentReport['prototype'][_0xc3cd('0x20')]=function(_0x52bf01,_0x219a6c,_0xb93ac8){io['to'](_0x52bf01)[_0xc3cd('0x20')](_0x219a6c,_0xb93ac8);};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x22')]=function(_0x46c6be){return _0x46c6be!==null&&!_[_0xc3cd('0x23')](_0x46c6be);};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentCalled']=function(_0x378ff7){try{if(this[_0xc3cd('0x22')](_0x378ff7)){logger[_0xc3cd('0x24')](_0xc3cd('0x25'),_0x378ff7[_0xc3cd('0x26')],_0x378ff7['membername'],_0x378ff7[_0xc3cd('0x27')]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x378ff7[_0xc3cd('0x26')],util['inspect'](_0x378ff7,{'showHidden':![],'depth':null}));if(_[_0xc3cd('0x23')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]])){this[_0xc3cd('0xb')][_0x378ff7['uniqueid']]={};}if(_[_0xc3cd('0x23')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7['destuniqueid']])){this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]={'agentcalledAt':moment()[_0xc3cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xc3cd('0x29'),'mandatoryDisposition':this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]]?this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]][_0xc3cd('0x2c')]||![]:![],'type':this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]]?this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]][_0xc3cd('0x2d')]||_0xc3cd('0x2e'):_0xc3cd('0x2e'),'variables':this['variables'][_0x378ff7[_0xc3cd('0x26')]],'motionChannel':_0xc3cd('0x2f')};}_[_0xc3cd('0x30')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]],_[_0xc3cd('0x31')](_0x378ff7,[_0xc3cd('0x32'),_0xc3cd('0x33')]));logger[_0xc3cd('0x34')](_0xc3cd('0x35'),_0x378ff7['uniqueid'],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x378ff7['uniqueid']][_0x378ff7['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')]('custom:agentcalled',this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]);logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x378ff7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this['channels'][_0x378ff7['uniqueid']][_0x378ff7[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));this[_0xc3cd('0x20')](util[_0xc3cd('0x28')](_0xc3cd('0x37'),_0x378ff7['membername']),_0xc3cd('0x38'),this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]);}}catch(_0xe3747f){logger[_0xc3cd('0x39')]('[%s][voiceAgentReport][agentcalled]',_0x378ff7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0xe3747f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentConnect']=function(_0x100789){try{if(this[_0xc3cd('0x22')](_0x100789)){if(this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]]){logger[_0xc3cd('0x34')](_0xc3cd('0x3a'),_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x100789,{'showHidden':![],'depth':null}));for(var _0x4c7de8 in this['channels'][_0x100789[_0xc3cd('0x26')]]){if(this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x4c7de8)){if(_0x100789['destuniqueid']===_0x4c7de8){logger[_0xc3cd('0x24')](_0xc3cd('0x3c'),_0x100789[_0xc3cd('0x26')],_0x100789[_0xc3cd('0x3d')],_0x100789[_0xc3cd('0x27')]);this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['agentconnectAt']=moment()[_0xc3cd('0x28')](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x3f')]=_0x100789[_0xc3cd('0x3f')];this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x40')]=_0x100789[_0xc3cd('0x40')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x41')]=_0x100789[_0xc3cd('0x41')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['destchannelstatedesc']=_0x100789[_0xc3cd('0x42')];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8]['holdtime']=_0x100789['holdtime'];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8]['lastevent']='connect';if(this[_0xc3cd('0xc')][this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x26')]]){var _0x1339ca=this[_0xc3cd('0xc')][this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8][_0xc3cd('0x26')]][_0xc3cd('0x43')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['routealias']=_0x1339ca;_0x100789[_0xc3cd('0x43')]=_0x1339ca;}_['merge'](this[_0xc3cd('0xd')][_0x100789['interface']],_[_0xc3cd('0x44')](_0x100789,[_0xc3cd('0x2b'),'destconnectedlinenum','routealias']));logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x45'),this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789['destuniqueid']]);logger[_0xc3cd('0x34')](_0xc3cd('0x46'),_0x100789[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc3cd('0x28')](_0xc3cd('0x37'),_0x100789[_0xc3cd('0x3d')]),_0xc3cd('0x47'),this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789[_0xc3cd('0x27')]]);}else if(!this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x12')]&&!this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x48'),_0x100789['uniqueid'],this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['membername'],_0x4c7de8);this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x12')]=!![];this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x49')]=moment()['format'](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4a')]=_0x100789[_0xc3cd('0x27')];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8][_0xc3cd('0x4b')]=_0x100789[_0xc3cd('0x3d')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4c')]='answered_elsewhere';this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4d')]=_0xc3cd('0x4e');logger[_0xc3cd('0x34')](_0xc3cd('0x4f'),_0x100789[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x50'),this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]);}}}}}}catch(_0x265b3c){logger[_0xc3cd('0x39')](_0xc3cd('0x51'),_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x265b3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentRingNoAnswer']=function(_0x4008ea){try{if(this[_0xc3cd('0x22')](_0x4008ea)){logger['debug'](_0xc3cd('0x52'),_0x4008ea[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4008ea,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]]&&this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea['destuniqueid']]){logger[_0xc3cd('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x4008ea[_0xc3cd('0x26')],_0x4008ea['membername'],_0x4008ea['destuniqueid']);this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]]['agentringnoanswer']=!![];this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea['destuniqueid']]['agentringnoanswerAt']=moment()[_0xc3cd('0x28')](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]][_0xc3cd('0x4c')]=_0xc3cd('0x53');this[_0xc3cd('0xb')][_0x4008ea['uniqueid']][_0x4008ea[_0xc3cd('0x27')]][_0xc3cd('0x4d')]=_0xc3cd('0x53');logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4008ea[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')](_0xc3cd('0x54'),this['channels'][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]]);}}}catch(_0x1279c2){logger[_0xc3cd('0x39')](_0xc3cd('0x55'),_0x4008ea['uniqueid'],util[_0xc3cd('0x36')](_0x1279c2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x14')]=function(_0x5013cf){try{if(this[_0xc3cd('0x22')](_0x5013cf)){logger['debug'](_0xc3cd('0x56'),_0x5013cf['uniqueid'],util[_0xc3cd('0x36')](_0x5013cf,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]]){for(var _0x1369bf in this['channels'][_0x5013cf[_0xc3cd('0x26')]]){if(this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x1369bf)&&!this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x12')]&&!this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x57'),_0x5013cf[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x3d')],_0x1369bf);this[_0xc3cd('0xb')][_0x5013cf['uniqueid']][_0x1369bf][_0xc3cd('0x12')]=!![];this[_0xc3cd('0xb')][_0x5013cf['uniqueid']][_0x1369bf][_0xc3cd('0x49')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x4c')]='abandoned';this['channels'][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x4d')]=_0xc3cd('0x58');logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5013cf[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')](_0xc3cd('0x59'),this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf]);}}}}}catch(_0x4d0a7c){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x5013cf[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4d0a7c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x5a')]=function(_0x4e04a7){try{if(this[_0xc3cd('0x22')](_0x4e04a7)){logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x4e04a7[_0xc3cd('0x26')],util['inspect'](_0x4e04a7,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e04a7['uniqueid']]){for(var _0x56f75d in this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]]){if(this['channels'][_0x4e04a7[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x56f75d)){if(this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x5b')]&&!this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x5c'),_0x4e04a7[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]['membername'],_0x56f75d);this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x15')]=!![];this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x5d')]=moment()[_0xc3cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]['lastevent']=_0xc3cd('0x5e');this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x4d')]=_0x4e04a7[_0xc3cd('0x4d')]=='transfer'?_0xc3cd('0x5f'):_0x4e04a7[_0xc3cd('0x4d')];this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d]['talktime']=_0x4e04a7[_0xc3cd('0x60')];if(this[_0xc3cd('0x2a')][_0x4e04a7[_0xc3cd('0x2b')]]&&this['voiceQueues'][_0x4e04a7[_0xc3cd('0x2b')]]['acw']){this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x61')]=this['voiceQueues'][_0x4e04a7[_0xc3cd('0x2b')]][_0xc3cd('0x62')];this['channels'][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x63')]=!![];}this[_0xc3cd('0xd')][_0x4e04a7['interface']]=_[_0xc3cd('0x31')](this[_0xc3cd('0xd')][_0x4e04a7[_0xc3cd('0x64')]],[_0xc3cd('0x2b'),'destconnectedlinenum']);logger[_0xc3cd('0x34')](_0xc3cd('0x65'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x66'),this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d]);logger[_0xc3cd('0x34')](_0xc3cd('0x67'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d],{'showHidden':![],'depth':null}));this[_0xc3cd('0x20')](util['format'](_0xc3cd('0x37'),_0x4e04a7[_0xc3cd('0x3d')]),'user:agentcomplete',this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]);}}}}}}catch(_0x4558cc){logger[_0xc3cd('0x39')](_0xc3cd('0x68'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4558cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x16')]=function(_0x5893bd){try{if(this[_0xc3cd('0x22')](_0x5893bd)){logger[_0xc3cd('0x34')](_0xc3cd('0x69'),_0x5893bd['uniqueid'],util[_0xc3cd('0x36')](_0x5893bd,{'showHidden':![],'depth':null}));this['addVariable'](_0x5893bd[_0xc3cd('0x26')],_[_0xc3cd('0x6a')](_0x5893bd[_0xc3cd('0x6b')])[0x0],_0x5893bd[_0xc3cd('0x6c')]);if(this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]]){for(var _0x271b98 in this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]]){if(this['channels'][_0x5893bd[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x271b98)){logger['info'](_0xc3cd('0x6d'),_0x5893bd['uniqueid'],_0x271b98,_[_0xc3cd('0x6a')](_0x5893bd[_0xc3cd('0x6b')])[0x0],_0x5893bd[_0xc3cd('0x6c')]);if(_[_0xc3cd('0x23')](this['channels'][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')])){this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')]={};}this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')]=this[_0xc3cd('0x6e')][_0x5893bd[_0xc3cd('0x26')]];}}}}}catch(_0x3385f7){logger[_0xc3cd('0x39')](_0xc3cd('0x6f'),_0x5893bd[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x3385f7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x1710aa,_0x383e0c,_0x270c5c){var _0x525060=[_0xc3cd('0x70'),_0xc3cd('0x71'),_0xc3cd('0x72'),_0xc3cd('0x73'),_0xc3cd('0x74'),'rtpaudioqoslossbridged',_0xc3cd('0x75'),_0xc3cd('0x76'),_0xc3cd('0x77'),_0xc3cd('0x78'),_0xc3cd('0x79'),_0xc3cd('0x7a'),'membercalls',_0xc3cd('0x7b'),'memberinterface',_0xc3cd('0x7c'),_0xc3cd('0x3d'),_0xc3cd('0x7d'),'memberrealtime'];if(!_[_0xc3cd('0x7e')](_0x383e0c)&&!_[_0xc3cd('0x7f')](_0x525060,_0x383e0c)){if(_[_0xc3cd('0x23')](this[_0xc3cd('0x6e')][_0x1710aa])){this[_0xc3cd('0x6e')][_0x1710aa]={};}this[_0xc3cd('0x6e')][_0x1710aa][_0x383e0c]=_0x270c5c;}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x18')]=function(_0x1616c7){try{if(this[_0xc3cd('0x22')](_0x1616c7)){logger[_0xc3cd('0x34')](_0xc3cd('0x80'),_0x1616c7['uniqueid'],util[_0xc3cd('0x36')](_0x1616c7,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]]){for(var _0x10b13b in this[_0xc3cd('0xb')][_0x1616c7['uniqueid']]){if(this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x10b13b)){if(this[_0xc3cd('0xb')][_0x1616c7['uniqueid']][_0x10b13b]['reason']==_0xc3cd('0x81')&&this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]][_0x10b13b][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x82'),_0x1616c7[_0xc3cd('0x26')],_0x10b13b);this['channels'][_0x1616c7[_0xc3cd('0x26')]][_0x10b13b][_0xc3cd('0x5d')]=moment()['format'](_0xc3cd('0x3e'));}}}logger[_0xc3cd('0x34')](_0xc3cd('0x83'),_0x1616c7[_0xc3cd('0x26')],util['inspect'](_[_0xc3cd('0x84')](this['channels'][_0x1616c7[_0xc3cd('0x26')]]),{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x85'),_[_0xc3cd('0x84')](this['channels'][_0x1616c7[_0xc3cd('0x26')]]));delete this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]];}if(this[_0xc3cd('0x6e')][_0x1616c7[_0xc3cd('0x26')]]){delete this[_0xc3cd('0x6e')][_0x1616c7[_0xc3cd('0x26')]];}}}catch(_0x553ce4){logger['error'](_0xc3cd('0x86'),_0x1616c7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x553ce4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc3cd('0x1e')]=function(_0x539a93){try{if(this[_0xc3cd('0x22')](_0x539a93)){logger['debug'](_0xc3cd('0x87'),_0x539a93['uniqueid'],util[_0xc3cd('0x36')](_0x539a93,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]]){for(var _0x583bc0 in this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']]){if(this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']]['hasOwnProperty'](_0x583bc0)){if(_0x539a93['origtransfereruniqueid']===_0x583bc0){logger[_0xc3cd('0x24')](_0xc3cd('0x89'),_0x539a93[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['membername'],_0x583bc0);var _0x3b78d7=moment();this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']][_0x583bc0][_0xc3cd('0x15')]=!![];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x539a93[_0xc3cd('0x88')]][_0x583bc0][_0xc3cd('0x4c')]=_0xc3cd('0x5e');this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0][_0xc3cd('0x4d')]=_0xc3cd('0x81');this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['talktime']=_0x3b78d7[_0xc3cd('0x8a')](this['channels'][_0x539a93['transfereeuniqueid']][_0x583bc0][_0xc3cd('0x5b')],_0xc3cd('0x8b'));}}}}if(this[_0xc3cd('0xb')][_0x539a93['secondtransfereruniqueid']]){var _0x36a975=this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x8c')]];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x8c')]]=this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]]=_0x36a975;}}}catch(_0x2dfe05){logger[_0xc3cd('0x39')](_0xc3cd('0x8d'),_0x539a93[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x2dfe05,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x1f')]=function(_0x3d3c29){try{if(this[_0xc3cd('0x22')](_0x3d3c29)){logger['debug'](_0xc3cd('0x8e'),_0x3d3c29['uniqueid'],util[_0xc3cd('0x36')](_0x3d3c29,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']]){for(var _0x5b5a69 in this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']]){if(this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0xc3cd('0x3b')](_0x5b5a69)){if(_0x3d3c29[_0xc3cd('0x8f')]===_0x5b5a69){logger[_0xc3cd('0x24')](_0xc3cd('0x90'),_0x3d3c29[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69][_0xc3cd('0x3d')],_0x5b5a69);var _0x36706d=moment();this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x15')]=!![];this['channels'][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x5d')]=_0x36706d;this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69]['lastevent']=_0xc3cd('0x5e');this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69][_0xc3cd('0x4d')]=_0xc3cd('0x81');this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x60')]=_0x36706d[_0xc3cd('0x8a')](this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69]['agentconnectAt'],_0xc3cd('0x8b'));}}}}}}catch(_0x11ec3c){logger[_0xc3cd('0x39')](_0xc3cd('0x91'),_0x3d3c29[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x11ec3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc3cd('0x1a')]=function(_0x4f7ee7){var _0x52ea8b='';try{if(this['isNotNull'](_0x4f7ee7)){logger[_0xc3cd('0x34')](_0xc3cd('0x92'),_0x4f7ee7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4f7ee7,{'showHidden':![],'depth':null}));if(_0x4f7ee7[_0xc3cd('0x93')]){_0x52ea8b=_0x4f7ee7[_0xc3cd('0x93')][_0xc3cd('0x94')](0x0,_0x4f7ee7[_0xc3cd('0x93')][_0xc3cd('0x95')]('-'));if(this[_0xc3cd('0xd')][_0x52ea8b]){logger[_0xc3cd('0x24')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x4f7ee7['uniqueid'],_0x52ea8b);this['agents'][_0x52ea8b][_0xc3cd('0x96')]=!![];}}}}catch(_0x434ee2){logger[_0xc3cd('0x39')](_0xc3cd('0x97'),_0x4f7ee7['uniqueid'],util['inspect'](_0x434ee2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncMusicOnHoldStop']=function(_0x4b716e){var _0x33e0e9='';try{if(this[_0xc3cd('0x22')](_0x4b716e)){logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4b716e[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4b716e,{'showHidden':![],'depth':null}));if(_0x4b716e['channel']){_0x33e0e9=_0x4b716e['channel']['substring'](0x0,_0x4b716e[_0xc3cd('0x93')][_0xc3cd('0x95')]('-'));if(this['agents'][_0x33e0e9]){logger[_0xc3cd('0x24')](_0xc3cd('0x98'),_0x4b716e[_0xc3cd('0x26')],_0x33e0e9);this[_0xc3cd('0xd')][_0x33e0e9][_0xc3cd('0x96')]=![];}}}}catch(_0x115e97){logger['error'](_0xc3cd('0x99'),_0x4b716e[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x115e97,{'showHidden':![],'depth':null}));}};module[_0xc3cd('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index f9e4ab3..78f037f 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07c9=['starttime','format','disposition','channelstate','keys','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','application','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','startsWith','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinenum','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','origtransfereruniqueid','transfertargetuniqueid','origtransfererlinkedid','some','routeid','ATTENDED','transferType','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','channels','agents','blindTransfers','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','syncNewCallerId','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','channel','exten','xcally-motion-preview','split','destconnectedlinenum','name','accountcode','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0xefbd1e,_0x42769d){var _0x4b99e7=function(_0x2bf410){while(--_0x2bf410){_0xefbd1e['push'](_0xefbd1e['shift']());}};_0x4b99e7(++_0x42769d);}(_0x07c9,0x14f));var _0x907c=function(_0x42a630,_0x3a5a37){_0x42a630=_0x42a630-0x0;var _0x340441=_0x07c9[_0x42a630];return _0x340441;};'use strict';var BPromise=require('bluebird');var _=require(_0x907c('0x0'));var moment=require(_0x907c('0x1'));var util=require(_0x907c('0x2'));var path=require(_0x907c('0x3'));var Redis=require(_0x907c('0x4'));var config=require(_0x907c('0x5'));var logger=require(_0x907c('0x6'))(_0x907c('0x7'));var ami=require('../ami');var Channel=require(_0x907c('0x8'));var RpcSetting=require(_0x907c('0x9'));var statusDesc=['unknown',_0x907c('0xa'),_0x907c('0xb'),_0x907c('0xc'),_0x907c('0xd'),_0x907c('0xe'),_0x907c('0xf'),_0x907c('0x10'),_0x907c('0x11')];var applications=[_0x907c('0x12'),_0x907c('0x13'),_0x907c('0x14'),_0x907c('0x15'),_0x907c('0x16'),'voicemail'];var dispositions=[_0x907c('0x17'),'FAILED',_0x907c('0x18'),'NO\x20ANSWER',_0x907c('0x17'),_0x907c('0x17'),_0x907c('0x19'),'BUSY',_0x907c('0x18'),_0x907c('0x18'),'FAILED'];var actions={};config['redis']=_[_0x907c('0x1a')](config[_0x907c('0x1b')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x907c('0x1b')]));function VoiceCallReport(_0x1e4ab4){this[_0x907c('0x1c')]=_0x1e4ab4[_0x907c('0x1c')];this[_0x907c('0x1d')]=_0x1e4ab4['agents'];this[_0x907c('0x1e')]={};ami['on'](_0x907c('0x1f'),this['syncNewExten'][_0x907c('0x20')](this));ami['on'](_0x907c('0x21'),this[_0x907c('0x22')][_0x907c('0x20')](this));ami['on'](_0x907c('0x23'),this[_0x907c('0x24')][_0x907c('0x20')](this));ami['on'](_0x907c('0x25'),this[_0x907c('0x26')][_0x907c('0x20')](this));ami['on'](_0x907c('0x27'),this['syncVarSet'][_0x907c('0x20')](this));ami['on'](_0x907c('0x28'),this['syncHangup'][_0x907c('0x20')](this));ami['on']('newcallerid',this[_0x907c('0x29')][_0x907c('0x20')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x907c('0x20')](this));ami['on'](_0x907c('0x2a'),this[_0x907c('0x2b')][_0x907c('0x20')](this));ami['on'](_0x907c('0x2c'),this[_0x907c('0x2d')][_0x907c('0x20')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x907c('0x20')](this));try{logger[_0x907c('0x2e')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x907c('0x2f')]();}catch(_0x2c4b7e){logger[_0x907c('0x30')](_0x907c('0x31'),util[_0x907c('0x32')](_0x2c4b7e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x907c('0x33')][_0x907c('0x34')]=function(_0x13d2dd){return _0x13d2dd!==null&&!_[_0x907c('0x35')](_0x13d2dd);};VoiceCallReport[_0x907c('0x33')]['emit']=function(_0x2a6701,_0x52f5aa,_0x38f4b5){io['to'](_0x2a6701)[_0x907c('0x36')](_0x52f5aa,_0x38f4b5);};VoiceCallReport['prototype'][_0x907c('0x29')]=function(_0x5815c1){try{if(this[_0x907c('0x34')](_0x5815c1)){logger[_0x907c('0x2e')](_0x907c('0x37'),_0x5815c1['uniqueid'],_0x5815c1[_0x907c('0x38')],_0x5815c1[_0x907c('0x39')]);logger[_0x907c('0x3a')](_0x907c('0x3b'),_0x5815c1[_0x907c('0x3c')],util[_0x907c('0x32')](_0x5815c1,{'showHidden':![],'depth':null}));if(_0x5815c1[_0x907c('0x3c')]===_0x5815c1[_0x907c('0x3d')]){if(!_[_0x907c('0x35')](this[_0x907c('0x1c')][_0x5815c1[_0x907c('0x3c')]])){_[_0x907c('0x3e')](this['channels'][_0x5815c1['uniqueid']],_[_0x907c('0x3f')](_0x5815c1,_['keys'](this['channels'][_0x5815c1[_0x907c('0x3c')]])));}}if(_0x5815c1['context']==='from-sip'){if(this[_0x907c('0x1d')][_0x5815c1[_0x907c('0x40')]['split']('-')[0x0]]){if(_0x5815c1[_0x907c('0x41')]==_0x907c('0x42')){this[_0x907c('0x1d')][_0x5815c1[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x44')]=_0x5815c1['connectedlinenum'];this[_0x907c('0x36')](util['format']('user:%s',this[_0x907c('0x1d')][_0x5815c1['channel'][_0x907c('0x43')]('-')[0x0]][_0x907c('0x45')]),'user:agentconnect',{'destaccountcode':this[_0x907c('0x1d')][_0x5815c1[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x46')],'destconnectedlinenum':_0x5815c1['connectedlinenum']});}}}}}catch(_0x5649b0){logger[_0x907c('0x30')](_0x907c('0x47'),_0x5815c1['uniqueid'],util[_0x907c('0x32')](_0x5649b0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x907c('0x24')]=function(_0x1f1481){try{if(this[_0x907c('0x34')](_0x1f1481)){logger[_0x907c('0x3a')]('[%s][voiceCallReport][newchannel]\x20event:',_0x1f1481[_0x907c('0x3c')],util[_0x907c('0x32')](_0x1f1481,{'showHidden':![],'depth':null}));if(_0x1f1481[_0x907c('0x3c')]===_0x1f1481[_0x907c('0x3d')]&&_0x1f1481['channel']!=_0x907c('0x48')){if(_['isUndefined'](this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]])){logger[_0x907c('0x2e')](_0x907c('0x49'),_0x1f1481['uniqueid'],_0x1f1481[_0x907c('0x4a')],_0x1f1481['exten']);this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]]=new Channel();this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]][_0x907c('0x4b')]=moment()[_0x907c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]][_0x907c('0x4d')]=dispositions[_['toNumber'](_0x1f1481[_0x907c('0x4e')])];_[_0x907c('0x3e')](this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]],_[_0x907c('0x3f')](_0x1f1481,_[_0x907c('0x4f')](this[_0x907c('0x1c')][_0x1f1481[_0x907c('0x3c')]])));if(_0x1f1481[_0x907c('0x4a')]===_0x907c('0x50')){if(this['agents'][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]){if(_[_0x907c('0x35')](this[_0x907c('0x1d')][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x44')])){this[_0x907c('0x1d')][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x44')]=_0x1f1481[_0x907c('0x41')];logger['debug'](_0x907c('0x51'),_0x1f1481[_0x907c('0x3c')],util[_0x907c('0x32')]({'destaccountcode':this['agents'][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x46')],'destconnectedlinenum':_0x1f1481['exten']},{'showHidden':![],'depth':null}));this[_0x907c('0x36')](util[_0x907c('0x4c')](_0x907c('0x52'),this[_0x907c('0x1d')][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x45')]),_0x907c('0x53'),{'destaccountcode':this[_0x907c('0x1d')][_0x1f1481[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x46')],'destconnectedlinenum':_0x1f1481[_0x907c('0x41')]});}}}}}}}catch(_0x253861){logger[_0x907c('0x30')]('[%s][voiceCallReport][newchannel]',_0x1f1481[_0x907c('0x3c')],util[_0x907c('0x32')](_0x253861,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')]['syncNewExten']=function(_0x27ce86){try{if(this[_0x907c('0x34')](_0x27ce86)){logger[_0x907c('0x3a')]('[%s][voiceCallReport][newexten]\x20event:',_0x27ce86['uniqueid'],util[_0x907c('0x32')](_0x27ce86,{'showHidden':![],'depth':null}));if(_0x27ce86[_0x907c('0x3c')]===_0x27ce86['linkedid']&&_0x27ce86['exten']!='h'&&_0x27ce86[_0x907c('0x40')]!=_0x907c('0x48')){_0x27ce86[_0x907c('0x54')]=_0x27ce86[_0x907c('0x54')]['toLowerCase']();_0x27ce86[_0x907c('0x55')]=_0x27ce86[_0x907c('0x56')]&&_0x27ce86['appdata']['startsWith']('CDR(routeAlias)')?_0x27ce86[_0x907c('0x56')]:(_0x27ce86[_0x907c('0x56')]||_0x27ce86[_0x907c('0x55')])[_0x907c('0x57')]();logger['info'](_0x907c('0x58'),_0x27ce86[_0x907c('0x3c')],_0x27ce86['application'],_0x27ce86[_0x907c('0x55')]);if(_[_0x907c('0x35')](this[_0x907c('0x1c')][_0x27ce86[_0x907c('0x3c')]])){this[_0x907c('0x1c')][_0x27ce86[_0x907c('0x3c')]]=new Channel();this[_0x907c('0x1c')][_0x27ce86['uniqueid']][_0x907c('0x4b')]=_0x27ce86[_0x907c('0x59')]?moment()[_0x907c('0x5a')](moment[_0x907c('0x59')](_0x27ce86[_0x907c('0x59')])[_0x907c('0x5b')](),'seconds')[_0x907c('0x4c')](_0x907c('0x5c')):moment()['format'](_0x907c('0x5c'));this['channels'][_0x27ce86['uniqueid']][_0x907c('0x4d')]=_0x907c('0x17');}_[_0x907c('0x3e')](this[_0x907c('0x1c')][_0x27ce86[_0x907c('0x3c')]],_[_0x907c('0x3f')](_0x27ce86,_[_0x907c('0x4f')](this['channels'][_0x27ce86[_0x907c('0x3c')]])));if(_[_0x907c('0x5d')](applications,_0x27ce86[_0x907c('0x54')])){this[_0x907c('0x1c')][_0x27ce86[_0x907c('0x3c')]][_0x907c('0x5e')]=_0x27ce86[_0x907c('0x54')];this['channels'][_0x27ce86[_0x907c('0x3c')]]['lastdata']=_0x27ce86[_0x907c('0x55')];if(_0x27ce86[_0x907c('0x54')]===_0x907c('0x12')&&_[_0x907c('0x5f')](_0x27ce86[_0x907c('0x55')][_0x907c('0x57')](),'cdr(')){var _0xb4e2f=_0x27ce86['applicationdata'][_0x907c('0x43')]('=');var _0x23d945=_0xb4e2f[0x0]['toLowerCase']()[_0x907c('0x60')](/cdr\((.*)\)/);if(_0x23d945){this[_0x907c('0x1c')][_0x27ce86['uniqueid']][_0x23d945[0x1]]=_0xb4e2f[0x1];}}else if(_0x27ce86['application']===_0x907c('0x13')){this[_0x907c('0x1c')][_0x27ce86[_0x907c('0x3c')]][_0x907c('0x13')]=_0x27ce86['applicationdata'][_0x907c('0x43')](',')[0x0];}}}}}catch(_0xd32954){logger[_0x907c('0x30')]('[%s][voiceCallReport][newexten]',_0x27ce86['uniqueid'],util[_0x907c('0x32')](_0xd32954,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0x26')]=function(_0x53aad3){try{if(this[_0x907c('0x34')](_0x53aad3)){logger[_0x907c('0x2e')](_0x907c('0x61'),_0x53aad3[_0x907c('0x3c')],_0x53aad3[_0x907c('0x3d')],_0x53aad3[_0x907c('0x38')],_0x53aad3['calleridnum']);logger[_0x907c('0x3a')](_0x907c('0x62'),_0x53aad3[_0x907c('0x3c')],util[_0x907c('0x32')](_0x53aad3,{'showHidden':![],'depth':null}));if(_0x53aad3[_0x907c('0x3c')]!==_0x53aad3['linkedid']){if(this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]]){if(_0x53aad3[_0x907c('0x4e')]==='6'){if(!this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x63')]){var _0xb45487=moment();this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x63')]=!![];this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x64')]=_0xb45487[_0x907c('0x4c')](_0x907c('0x5c'));if(this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]]['starttime']){this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x65')]=_0xb45487[_0x907c('0x66')](this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x4b')],_0x907c('0x5b'));}}this['channels'][_0x53aad3['linkedid']]['linkedid']=_0x53aad3[_0x907c('0x3c')];if(_0x53aad3[_0x907c('0x39')]!==_0x907c('0x42')){this['channels'][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x67')]=_0x53aad3[_0x907c('0x39')];}this[_0x907c('0x1c')][_0x53aad3['linkedid']][_0x907c('0x68')]=_0x53aad3[_0x907c('0x38')];this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x69')]=_0x53aad3[_0x907c('0x40')];this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x4d')]=dispositions[_[_0x907c('0x6a')](_0x53aad3['channelstate'])];if(this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]){this['channels'][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x6b')]=this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]['id'];this[_0x907c('0x1c')][_0x53aad3['linkedid']][_0x907c('0x6c')]=this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x45')];}}}}else{if(this[_0x907c('0x1c')][_0x53aad3['uniqueid']]){if(_0x53aad3['channelstate']==='6'){if(this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')]['split']('-')[0x0]]){this['channels'][_0x53aad3[_0x907c('0x3c')]][_0x907c('0x6b')]=this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]['id'];this['channels'][_0x53aad3[_0x907c('0x3c')]][_0x907c('0x6c')]=this[_0x907c('0x1d')][_0x53aad3['channel']['split']('-')[0x0]][_0x907c('0x45')];}}}}if(_0x53aad3['channelstate']==='6'&&_0x53aad3[_0x907c('0x4a')]===_0x907c('0x50')){if(this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]){this['agents'][_0x53aad3['channel'][_0x907c('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x53aad3['exten'];var _0x3a94ec;if(this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3c')]])_0x3a94ec=this['channels'][_0x53aad3['uniqueid']][_0x907c('0x6d')];else if(this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]])_0x3a94ec=this[_0x907c('0x1c')][_0x53aad3[_0x907c('0x3d')]][_0x907c('0x6d')];logger['debug'](_0x907c('0x6e'),_0x53aad3[_0x907c('0x3c')],util[_0x907c('0x32')]({'destaccountcode':this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x53aad3[_0x907c('0x41')],'routealias':_0x3a94ec},{'showHidden':![],'depth':null}));this[_0x907c('0x36')](util[_0x907c('0x4c')]('user:%s',this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x907c('0x1d')][_0x53aad3[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x46')],'destconnectedlinenum':_0x53aad3['exten'],'routealias':_0x3a94ec});}}}}catch(_0x57c727){logger['error']('[%s][voiceCallReport][newstate]',_0x53aad3['uniqueid'],util[_0x907c('0x32')](_0x57c727,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0x6f')]=function(_0x1d5577,_0x117847){try{if(this[_0x907c('0x1c')][_0x1d5577]){logger[_0x907c('0x2e')](_0x907c('0x70'),_0x1d5577,_0x117847);this[_0x907c('0x1c')][_0x1d5577][_0x907c('0x71')]=!![];if(_[_0x907c('0x72')](_0x117847,_0x907c('0x73'))){_0x117847=_0x117847['replace'](_0x907c('0x73'),_0x907c('0x74'));}this[_0x907c('0x1c')][_0x1d5577]['monitorFilename']=_0x117847;var _0xb5d8ea=_[_0x907c('0x75')](this[_0x907c('0x1c')][_0x1d5577]['monitors'],{'filename':_0x117847});if(_[_0x907c('0x76')](_0xb5d8ea)){this[_0x907c('0x1c')][_0x1d5577][_0x907c('0x77')][_0x907c('0x78')]({'filename':_0x117847,'createdAt':moment()[_0x907c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x37d139){logger['error'](_0x907c('0x79'),_0x1d5577,util['inspect'](_0x37d139,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0x7a')]=function(_0xb448e){try{if(this[_0x907c('0x34')](_0xb448e)){logger[_0x907c('0x3a')](_0x907c('0x7b'),_0xb448e['uniqueid'],util[_0x907c('0x32')](_0xb448e,{'showHidden':![],'depth':null}));if(this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]]&&_0xb448e[_0x907c('0x40')]!=_0x907c('0x48')){if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')])){if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x7d')])){logger['info'](_0x907c('0x7e'),_0xb448e[_0x907c('0x3c')],_0xb448e[_0x907c('0x7f')]);this['syncMixMonitorFilename'](_0xb448e[_0x907c('0x3c')],_0xb448e[_0x907c('0x7f')]);}else if(this['isNotNull'](_0xb448e[_0x907c('0x7c')][_0x907c('0x80')])){logger[_0x907c('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0xb448e[_0x907c('0x3c')],_0xb448e['value']);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x39')]=_0xb448e[_0x907c('0x7f')];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x81')])){logger['info'](_0x907c('0x82'),_0xb448e[_0x907c('0x3c')],_0xb448e[_0x907c('0x7f')]);this['channels'][_0xb448e['uniqueid']]['callerid']=_0xb448e[_0x907c('0x7f')];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')]['xmd-cdrtype'])){logger[_0x907c('0x2e')](_0x907c('0x83'),_0xb448e['uniqueid'],_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x84')]=_0xb448e[_0x907c('0x7f')];}else if(this['isNotNull'](_0xb448e['variable'][_0x907c('0x85')])){logger[_0x907c('0x2e')](_0x907c('0x86'),_0xb448e['uniqueid'],_0xb448e['value']['split'](',')[0x0]);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x13')]=_0xb448e[_0x907c('0x7f')][_0x907c('0x43')](',')[0x0];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')]['xmd-originatecalleridnum'])){logger[_0x907c('0x2e')](_0x907c('0x87'),_0xb448e['uniqueid'],_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x88')]=_0xb448e['value'];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')]['xmd-destination'])){logger['info'](_0x907c('0x89'),_0xb448e['uniqueid'],_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x8a')]=_0xb448e['value'];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x8b')])){logger[_0x907c('0x2e')](_0x907c('0x8c'),_0xb448e[_0x907c('0x3c')],_0xb448e['value']);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]][_0x907c('0x8d')]=_0xb448e[_0x907c('0x7f')];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x8e')])){logger[_0x907c('0x2e')](_0x907c('0x8f'),_0xb448e[_0x907c('0x3c')],_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x1c')][_0xb448e['uniqueid']]['queue']=_0xb448e['value'];}else if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x90')])){logger[_0x907c('0x2e')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0xb448e[_0x907c('0x3c')],_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3c')]]['sipcalluniqueid']=_0xb448e[_0x907c('0x7f')];}}}else if(this['isNotNull'](_0xb448e[_0x907c('0x7c')]['mixmonitor_filename'])){if(_0xb448e[_0x907c('0x7f')]){var _0x4805e4=path[_0x907c('0x91')](_0xb448e['value'])[_0x907c('0x45')];logger[_0x907c('0x2e')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x4805e4,_0xb448e[_0x907c('0x7f')]);this[_0x907c('0x6f')](_0x4805e4,_0xb448e[_0x907c('0x7f')]);}}else if(this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3d')]]){if(this[_0x907c('0x34')](_0xb448e['variable'])){if(this[_0x907c('0x34')](_0xb448e[_0x907c('0x7c')][_0x907c('0x90')])){logger[_0x907c('0x2e')](_0x907c('0x92'),_0xb448e[_0x907c('0x3d')],_0xb448e['value']);this[_0x907c('0x1c')][_0xb448e[_0x907c('0x3d')]][_0x907c('0x93')]=_0xb448e[_0x907c('0x7f')];}}}}}catch(_0x1e7edd){logger[_0x907c('0x30')](_0x907c('0x94'),_0xb448e[_0x907c('0x3c')],util[_0x907c('0x32')](_0x1e7edd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0x95')]=function(_0x38c06a){try{if(this[_0x907c('0x34')](_0x38c06a)){logger[_0x907c('0x3a')](_0x907c('0x96'),_0x38c06a[_0x907c('0x3c')],util[_0x907c('0x32')](_0x38c06a,{'showHidden':![],'depth':null}));if(this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]]){logger[_0x907c('0x2e')](_0x907c('0x97'),_0x38c06a['uniqueid'],_0x38c06a[_0x907c('0x98')]);var _0x408567=moment();this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x99')]=_0x408567[_0x907c('0x4c')](_0x907c('0x5c'));this['channels'][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x59')]=_0x408567[_0x907c('0x66')](this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x4b')],_0x907c('0x5b'));if(this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]]['answered']){this['channels'][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x9a')]=_0x408567['diff'](this[_0x907c('0x1c')][_0x38c06a['uniqueid']][_0x907c('0x64')],_0x907c('0x5b'));this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x65')]=this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x59')]-this[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x9a')];}if(_0x38c06a[_0x907c('0x4a')]===_0x907c('0x50')){if(this[_0x907c('0x1d')][_0x38c06a[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]){this['agents'][_0x38c06a[_0x907c('0x40')]['split']('-')[0x0]]=_[_0x907c('0x9b')](this[_0x907c('0x1d')][_0x38c06a['channel'][_0x907c('0x43')]('-')[0x0]],[_0x907c('0x44')]);logger[_0x907c('0x3a')](_0x907c('0x9c'),_0x38c06a[_0x907c('0x3c')],util[_0x907c('0x32')]({'id':this['agents'][_0x38c06a['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x907c('0x1d')][_0x38c06a[_0x907c('0x40')]['split']('-')[0x0]][_0x907c('0x46')]},{'showHidden':![],'depth':null}));this[_0x907c('0x36')](util[_0x907c('0x4c')]('user:%s',this[_0x907c('0x1d')][_0x38c06a['channel']['split']('-')[0x0]]['name']),_0x907c('0x9d'),{'id':this[_0x907c('0x1d')][_0x38c06a[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x38c06a[_0x907c('0x40')][_0x907c('0x43')]('-')[0x0]][_0x907c('0x46')]});}}var _0x25a362=this;Promise[_0x907c('0x9e')]()['then'](function(){var _0x2b556e=_0x25a362[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]];if(typeof _0x2b556e['transferType']===_0x907c('0x9f'))return;if(_[_0x907c('0xa0')](_0x2b556e[_0x907c('0x77')]))return;return RpcSetting[_0x907c('0xa1')]()[_0x907c('0xa2')](function(_0x15b357){if(!_0x15b357[_0x907c('0xa3')])return;return Promise['resolve']()['then'](function(){return ami[_0x907c('0xa4')]({'action':_0x907c('0xa5'),'channel':_0x2b556e['channel']})[_0x907c('0xa6')](function(){});})[_0x907c('0xa2')](function(){return ami['Action']({'action':_0x907c('0xa5'),'channel':_0x2b556e[_0x907c('0x69')]})['catch'](function(){})['finally'](function(){var _0x2d6c37=_0x25a362[_0x907c('0x1d')][_0x2b556e[_0x907c('0x69')]['split']('-')[0x0]];if(!_0x2d6c37)return;io[_0x907c('0x36')](_0x907c('0xa7'),{'agentId':_0x2d6c37['id'],'uniqueid':_0x2b556e['uniqueid']});});});});})[_0x907c('0xa2')](function(){if(_0x38c06a[_0x907c('0xa8')]===_0x907c('0xa9')){_0x25a362[_0x907c('0x1e')][_0x38c06a[_0x907c('0x3c')]]=_0x25a362['channels'][_0x38c06a['uniqueid']];}else{if(_0x25a362['channels'][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x84')]===_0x907c('0xaa')&&_0x25a362['blindTransfers'][_0x38c06a[_0x907c('0x3c')]]){_0x25a362['channels'][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x3c')]=[_0x25a362[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]]['linkedid'],_0x25a362['channels'][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x3d')]=_0x25a362[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]][_0x907c('0x3c')]][0x0];delete _0x25a362['blindTransfers'][_0x38c06a[_0x907c('0x3c')]];}}logger[_0x907c('0x3a')](_0x907c('0xab'),_0x38c06a['uniqueid'],util[_0x907c('0x32')](_0x25a362[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]],{'showHidden':![],'depth':null}));ami[_0x907c('0x36')](_0x907c('0xac'),_0x25a362[_0x907c('0x1c')][_0x38c06a['uniqueid']]);delete _0x25a362[_0x907c('0x1c')][_0x38c06a[_0x907c('0x3c')]];});}}}catch(_0x2b3fd3){logger[_0x907c('0x30')](_0x907c('0xad'),_0x38c06a[_0x907c('0x3c')],util[_0x907c('0x32')](_0x2b3fd3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0xae')]=function(_0x3ed851){try{if(this[_0x907c('0x34')](_0x3ed851)){logger[_0x907c('0x2e')](_0x907c('0xaf'),_0x3ed851[_0x907c('0x3c')],_0x3ed851[_0x907c('0xb0')],_0x3ed851[_0x907c('0xb1')]);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x3ed851['uniqueid'],util[_0x907c('0x32')](_0x3ed851,{'showHidden':![],'depth':null}));if(this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb2')]]){this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb2')]][_0x907c('0xb3')]=_0x3ed851[_0x907c('0xb0')];this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb2')]][_0x907c('0xb4')]=_0x3ed851[_0x907c('0xb1')];if(this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb5')]]){var _0x2a8f67=this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb5')]];this['channels'][_0x3ed851[_0x907c('0xb5')]]=this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb2')]];this['channels'][_0x3ed851[_0x907c('0xb2')]]=_0x2a8f67;}}else if(this['channels'][_0x3ed851['transfertargetuniqueid']]){this['channels'][_0x3ed851['transfertargetuniqueid']]['transfercalleridnum']=_0x3ed851[_0x907c('0xb0')];this[_0x907c('0x1c')][_0x3ed851['transfertargetuniqueid']][_0x907c('0xb4')]=_0x3ed851['transfertargetcalleridnum'];if(this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb6')]]){var _0x2a8f67=this[_0x907c('0x1c')][_0x3ed851['origtransfereruniqueid']];this['channels'][_0x3ed851['origtransfereruniqueid']]=this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb7')]];this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb7')]]=_0x2a8f67;}}if((this[_0x907c('0x1c')][_0x3ed851['origtransfereruniqueid']]||this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb8')]])&&this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb5')]]){var _0x1b99c0=_[_0x907c('0xb9')]([this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb6')]],this['channels'][_0x3ed851[_0x907c('0xb8')]],this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb5')]]],function(_0x5c37de){return _0x5c37de&&_0x5c37de[_0x907c('0x84')]===_0x907c('0xaa')&&_0x5c37de[_0x907c('0xba')];});if(_0x1b99c0){if(this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb6')]])this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb6')]]['transferType']=_0x907c('0xbb');if(this[_0x907c('0x1c')][_0x3ed851['origtransfererlinkedid']])this['channels'][_0x3ed851[_0x907c('0xb8')]][_0x907c('0xbc')]=_0x907c('0xbb');this[_0x907c('0x1c')][_0x3ed851[_0x907c('0xb5')]][_0x907c('0xbc')]='ATTENDED';}}}}catch(_0x27add3){logger['error'](_0x907c('0xbd'),_0x3ed851[_0x907c('0x3c')],util[_0x907c('0x32')](_0x27add3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x907c('0x2b')]=function(_0x9b89c7){try{if(this[_0x907c('0x34')](_0x9b89c7)){logger[_0x907c('0x2e')](_0x907c('0xbe'),_0x9b89c7['uniqueid'],_0x9b89c7[_0x907c('0xbf')],_0x9b89c7[_0x907c('0xc0')]);logger[_0x907c('0x3a')](_0x907c('0xc1'),_0x9b89c7[_0x907c('0x3c')],util[_0x907c('0x32')](_0x9b89c7,{'showHidden':![],'depth':null}));if(this[_0x907c('0x1c')][_0x9b89c7[_0x907c('0xb2')]]){this[_0x907c('0x1c')][_0x9b89c7[_0x907c('0xb2')]][_0x907c('0xb3')]=_0x9b89c7['transfereecalleridnum'];this[_0x907c('0x1c')][_0x9b89c7[_0x907c('0xb2')]][_0x907c('0xb4')]=_0x9b89c7[_0x907c('0xc0')];this[_0x907c('0x1c')][_0x9b89c7[_0x907c('0xb2')]]['transferType']=_0x907c('0xc2');this['syncHangup']({'event':_0x907c('0xa9'),'uniqueid':_0x9b89c7[_0x907c('0xb2')],'context':_0x9b89c7['context'],'channel':_0x9b89c7[_0x907c('0xc3')]});}else{this[_0x907c('0x1c')][_0x9b89c7[_0x907c('0xc4')]][_0x907c('0xbc')]=_0x907c('0xc2');}}}catch(_0x45764b){logger[_0x907c('0x30')]('[%s][voiceCallReport][blindtransfer]',_0x9b89c7[_0x907c('0x3c')],util[_0x907c('0x32')](_0x45764b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')][_0x907c('0x2d')]=function(_0x313b96){try{if(this[_0x907c('0x34')](_0x313b96)){logger[_0x907c('0x3a')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x313b96[_0x907c('0x3c')],util['inspect'](_0x313b96,{'showHidden':![],'depth':null}));if(this[_0x907c('0x1c')][_0x313b96[_0x907c('0x3c')]]){if(!_[_0x907c('0x76')](this[_0x907c('0x1c')][_0x313b96[_0x907c('0x3c')]]['answertime'])){this[_0x907c('0x1c')][_0x313b96[_0x907c('0x3c')]]['mohstarttime']=moment()[_0x907c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x907c('0xc5'),_0x313b96[_0x907c('0x3c')],this[_0x907c('0x1c')][_0x313b96[_0x907c('0x3c')]]['mohstarttime']);}}}}catch(_0x3822f4){logger[_0x907c('0x30')](_0x907c('0xc6'),_0x313b96[_0x907c('0x3c')],util['inspect'](_0x3822f4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x907c('0x33')]['syncMusicOnHoldStop']=function(_0x406320){try{if(this[_0x907c('0x34')](_0x406320)){logger[_0x907c('0x3a')](_0x907c('0xc7'),_0x406320[_0x907c('0x3c')],util[_0x907c('0x32')](_0x406320,{'showHidden':![],'depth':null}));if(this['channels'][_0x406320[_0x907c('0x3c')]]){if(!_[_0x907c('0x76')](this[_0x907c('0x1c')][_0x406320[_0x907c('0x3c')]][_0x907c('0xc8')])){this[_0x907c('0x1c')][_0x406320['uniqueid']]['mohtime']+=moment()[_0x907c('0xc9')](0x0)[_0x907c('0x66')](this[_0x907c('0x1c')][_0x406320['uniqueid']]['mohstarttime'],'seconds');logger['info'](_0x907c('0xca'),_0x406320[_0x907c('0x3c')],this[_0x907c('0x1c')][_0x406320['uniqueid']][_0x907c('0xcb')]);delete this[_0x907c('0x1c')][_0x406320[_0x907c('0x3c')]][_0x907c('0xc8')];}}}}catch(_0x52c00d){logger[_0x907c('0x30')]('[%s][voiceCallReport][musiconholdstop]',_0x406320[_0x907c('0x3c')],util[_0x907c('0x32')](_0x52c00d,{'showHidden':![],'depth':null}));}};module[_0x907c('0xcc')]=VoiceCallReport; \ No newline at end of file +var _0xfdc6=['xcally-motion-preview','channel','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','pick','debug','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','match','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','syncHangup','cause-txt','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','StopMixMonitor','catch','Action','event','BlindTransfer','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','routeid','origtransfererlinkedid','ATTENDED','secondtransfereruniqueid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','busy','invalid','unavailable','ringinuse','onhold','set','voicemail','NO\x20ANSWER','BUSY','FAILED','defaults','redis','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','newstate','syncVarSet','hangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','keys','context','from-sip','split','exten'];(function(_0x49253a,_0x4883d1){var _0x471008=function(_0x2c6210){while(--_0x2c6210){_0x49253a['push'](_0x49253a['shift']());}};_0x471008(++_0x4883d1);}(_0xfdc6,0x88));var _0x6fdc=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0xfdc6[_0x4d7241];return _0x59d9e2;};'use strict';var BPromise=require(_0x6fdc('0x0'));var _=require(_0x6fdc('0x1'));var moment=require('moment');var util=require(_0x6fdc('0x2'));var path=require(_0x6fdc('0x3'));var Redis=require(_0x6fdc('0x4'));var config=require(_0x6fdc('0x5'));var logger=require('../../../config/logger')(_0x6fdc('0x6'));var ami=require(_0x6fdc('0x7'));var Channel=require(_0x6fdc('0x8'));var RpcSetting=require(_0x6fdc('0x9'));var statusDesc=[_0x6fdc('0xa'),_0x6fdc('0xb'),'inuse',_0x6fdc('0xc'),_0x6fdc('0xd'),_0x6fdc('0xe'),'ringing',_0x6fdc('0xf'),_0x6fdc('0x10')];var applications=[_0x6fdc('0x11'),'queue','agi','dial','playback',_0x6fdc('0x12')];var dispositions=[_0x6fdc('0x13'),'FAILED','FAILED',_0x6fdc('0x13'),_0x6fdc('0x13'),_0x6fdc('0x13'),'ANSWERED',_0x6fdc('0x14'),'FAILED',_0x6fdc('0x15'),'FAILED'];var actions={};config['redis']=_[_0x6fdc('0x16')](config[_0x6fdc('0x17')],{'host':_0x6fdc('0x18'),'port':0x18eb});var io=require(_0x6fdc('0x19'))(new Redis(config[_0x6fdc('0x17')]));function VoiceCallReport(_0x319128){this[_0x6fdc('0x1a')]=_0x319128[_0x6fdc('0x1a')];this[_0x6fdc('0x1b')]=_0x319128[_0x6fdc('0x1b')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x6fdc('0x1c')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x1e'),this[_0x6fdc('0x1c')]['bind'](this));ami['on'](_0x6fdc('0x1f'),this['syncNewChannel'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x20'),this['syncNewState'][_0x6fdc('0x1d')](this));ami['on']('varset',this[_0x6fdc('0x21')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x22'),this['syncHangup'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x23'),this['syncNewCallerId'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x24'),this[_0x6fdc('0x25')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x26'),this['syncBlindTransfer'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x27'),this[_0x6fdc('0x28')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x29'),this[_0x6fdc('0x2a')]['bind'](this));try{logger[_0x6fdc('0x2b')](_0x6fdc('0x2c'));ami[_0x6fdc('0x2d')]();}catch(_0x56f60d){logger[_0x6fdc('0x2e')](_0x6fdc('0x2f'),util[_0x6fdc('0x30')](_0x56f60d,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x32')]=function(_0x39f222){return _0x39f222!==null&&!_[_0x6fdc('0x33')](_0x39f222);};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x34')]=function(_0x2ed5b5,_0x7c54b8,_0x5c8f68){io['to'](_0x2ed5b5)[_0x6fdc('0x34')](_0x7c54b8,_0x5c8f68);};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x35')]=function(_0x5a4da0){try{if(this[_0x6fdc('0x32')](_0x5a4da0)){logger['info'](_0x6fdc('0x36'),_0x5a4da0[_0x6fdc('0x37')],_0x5a4da0[_0x6fdc('0x38')],_0x5a4da0[_0x6fdc('0x39')]);logger['debug'](_0x6fdc('0x3a'),_0x5a4da0[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x5a4da0,{'showHidden':![],'depth':null}));if(_0x5a4da0[_0x6fdc('0x37')]===_0x5a4da0[_0x6fdc('0x3b')]){if(!_[_0x6fdc('0x33')](this[_0x6fdc('0x1a')][_0x5a4da0[_0x6fdc('0x37')]])){_['merge'](this['channels'][_0x5a4da0['uniqueid']],_['pick'](_0x5a4da0,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x5a4da0[_0x6fdc('0x37')]])));}}if(_0x5a4da0[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this[_0x6fdc('0x1b')][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]]){if(_0x5a4da0[_0x6fdc('0x40')]==_0x6fdc('0x41')){this[_0x6fdc('0x1b')][_0x5a4da0[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x43')]=_0x5a4da0['connectedlinenum'];this[_0x6fdc('0x34')](util['format'](_0x6fdc('0x44'),this['agents'][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),_0x6fdc('0x46'),{'destaccountcode':this[_0x6fdc('0x1b')][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')],'destconnectedlinenum':_0x5a4da0['connectedlinenum']});}}}}}catch(_0x28e3e9){logger[_0x6fdc('0x2e')](_0x6fdc('0x48'),_0x5a4da0[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x28e3e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x49')]=function(_0x1bf739){try{if(this[_0x6fdc('0x32')](_0x1bf739)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x1bf739,{'showHidden':![],'depth':null}));if(_0x1bf739[_0x6fdc('0x37')]===_0x1bf739[_0x6fdc('0x3b')]&&_0x1bf739[_0x6fdc('0x42')]!=_0x6fdc('0x4a')){if(_[_0x6fdc('0x33')](this['channels'][_0x1bf739['uniqueid']])){logger[_0x6fdc('0x2b')](_0x6fdc('0x4b'),_0x1bf739[_0x6fdc('0x37')],_0x1bf739[_0x6fdc('0x3d')],_0x1bf739[_0x6fdc('0x40')]);this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]]=new Channel();this['channels'][_0x1bf739[_0x6fdc('0x37')]]['starttime']=moment()[_0x6fdc('0x4c')](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]][_0x6fdc('0x4e')]=dispositions[_[_0x6fdc('0x4f')](_0x1bf739[_0x6fdc('0x50')])];_[_0x6fdc('0x51')](this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]],_[_0x6fdc('0x52')](_0x1bf739,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]])));if(_0x1bf739[_0x6fdc('0x3d')]==='from-sip'){if(this['agents'][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]]){if(_[_0x6fdc('0x33')](this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x43')])){this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x43')]=_0x1bf739[_0x6fdc('0x40')];logger[_0x6fdc('0x53')](_0x6fdc('0x54'),_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'destaccountcode':this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1bf739[_0x6fdc('0x40')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x6fdc('0x44'),this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['name']),_0x6fdc('0x46'),{'destaccountcode':this['agents'][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1bf739[_0x6fdc('0x40')]});}}}}}}}catch(_0x4b2986){logger[_0x6fdc('0x2e')](_0x6fdc('0x55'),_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x4b2986,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x1c')]=function(_0x48a065){try{if(this['isNotNull'](_0x48a065)){logger[_0x6fdc('0x53')](_0x6fdc('0x56'),_0x48a065[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x48a065,{'showHidden':![],'depth':null}));if(_0x48a065[_0x6fdc('0x37')]===_0x48a065[_0x6fdc('0x3b')]&&_0x48a065['exten']!='h'&&_0x48a065[_0x6fdc('0x42')]!=_0x6fdc('0x4a')){_0x48a065[_0x6fdc('0x57')]=_0x48a065[_0x6fdc('0x57')][_0x6fdc('0x58')]();_0x48a065['applicationdata']=_0x48a065[_0x6fdc('0x59')]&&_0x48a065['appdata']['startsWith'](_0x6fdc('0x5a'))?_0x48a065[_0x6fdc('0x59')]:(_0x48a065[_0x6fdc('0x59')]||_0x48a065[_0x6fdc('0x5b')])[_0x6fdc('0x58')]();logger[_0x6fdc('0x2b')](_0x6fdc('0x5c'),_0x48a065[_0x6fdc('0x37')],_0x48a065[_0x6fdc('0x57')],_0x48a065[_0x6fdc('0x5b')]);if(_[_0x6fdc('0x33')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]])){this[_0x6fdc('0x1a')][_0x48a065['uniqueid']]=new Channel();this['channels'][_0x48a065[_0x6fdc('0x37')]][_0x6fdc('0x5d')]=_0x48a065[_0x6fdc('0x5e')]?moment()[_0x6fdc('0x5f')](moment['duration'](_0x48a065[_0x6fdc('0x5e')])[_0x6fdc('0x60')](),_0x6fdc('0x60'))[_0x6fdc('0x4c')](_0x6fdc('0x4d')):moment()['format'](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]][_0x6fdc('0x4e')]=_0x6fdc('0x13');}_[_0x6fdc('0x51')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]],_[_0x6fdc('0x52')](_0x48a065,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]])));if(_[_0x6fdc('0x61')](applications,_0x48a065[_0x6fdc('0x57')])){this['channels'][_0x48a065['uniqueid']][_0x6fdc('0x62')]=_0x48a065[_0x6fdc('0x57')];this[_0x6fdc('0x1a')][_0x48a065['uniqueid']][_0x6fdc('0x63')]=_0x48a065[_0x6fdc('0x5b')];if(_0x48a065['application']===_0x6fdc('0x11')&&_[_0x6fdc('0x64')](_0x48a065[_0x6fdc('0x5b')][_0x6fdc('0x58')](),'cdr(')){var _0x1f7769=_0x48a065[_0x6fdc('0x5b')][_0x6fdc('0x3f')]('=');var _0x34a96f=_0x1f7769[0x0][_0x6fdc('0x58')]()[_0x6fdc('0x65')](/cdr\((.*)\)/);if(_0x34a96f){this['channels'][_0x48a065['uniqueid']][_0x34a96f[0x1]]=_0x1f7769[0x1];}}else if(_0x48a065[_0x6fdc('0x57')]===_0x6fdc('0x66')){this[_0x6fdc('0x1a')][_0x48a065['uniqueid']]['queue']=_0x48a065['applicationdata'][_0x6fdc('0x3f')](',')[0x0];}}}}}catch(_0x526318){logger[_0x6fdc('0x2e')](_0x6fdc('0x67'),_0x48a065[_0x6fdc('0x37')],util['inspect'](_0x526318,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x68')]=function(_0x4b4fb2){try{if(this[_0x6fdc('0x32')](_0x4b4fb2)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x4b4fb2['uniqueid'],_0x4b4fb2[_0x6fdc('0x3b')],_0x4b4fb2[_0x6fdc('0x38')],_0x4b4fb2[_0x6fdc('0x39')]);logger['debug'](_0x6fdc('0x69'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x4b4fb2,{'showHidden':![],'depth':null}));if(_0x4b4fb2[_0x6fdc('0x37')]!==_0x4b4fb2[_0x6fdc('0x3b')]){if(this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]]){if(_0x4b4fb2['channelstate']==='6'){if(!this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']]['answered']){var _0x4e1cd4=moment();this['channels'][_0x4b4fb2['linkedid']][_0x6fdc('0x6a')]=!![];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6b')]=_0x4e1cd4[_0x6fdc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']][_0x6fdc('0x5d')]){this['channels'][_0x4b4fb2[_0x6fdc('0x3b')]]['holdtime']=_0x4e1cd4[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x5d')],_0x6fdc('0x60'));}}this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x3b')]=_0x4b4fb2[_0x6fdc('0x37')];if(_0x4b4fb2['calleridnum']!==_0x6fdc('0x41')){this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]]['connectedlinenum']=_0x4b4fb2[_0x6fdc('0x39')];}this['channels'][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6d')]=_0x4b4fb2[_0x6fdc('0x38')];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6e')]=_0x4b4fb2['channel'];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x4e')]=dispositions[_[_0x6fdc('0x4f')](_0x4b4fb2[_0x6fdc('0x50')])];if(this[_0x6fdc('0x1b')][_0x4b4fb2['channel'][_0x6fdc('0x3f')]('-')[0x0]]){this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6f')]=this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'];this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']][_0x6fdc('0x70')]=this['agents'][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')];}}}}else{if(this['channels'][_0x4b4fb2[_0x6fdc('0x37')]]){if(_0x4b4fb2['channelstate']==='6'){if(this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]){this['channels'][_0x4b4fb2[_0x6fdc('0x37')]][_0x6fdc('0x6f')]=this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x37')]][_0x6fdc('0x70')]=this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x45')];}}}}if(_0x4b4fb2[_0x6fdc('0x50')]==='6'&&_0x4b4fb2[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]]){this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x43')]=_0x4b4fb2[_0x6fdc('0x40')];var _0x4e135f;if(this[_0x6fdc('0x1a')][_0x4b4fb2['uniqueid']])_0x4e135f=this['channels'][_0x4b4fb2[_0x6fdc('0x37')]]['routealias'];else if(this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]])_0x4e135f=this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x71')];logger[_0x6fdc('0x53')](_0x6fdc('0x72'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'destaccountcode':this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')],'destconnectedlinenum':_0x4b4fb2['exten'],'routealias':_0x4e135f},{'showHidden':![],'depth':null}));this[_0x6fdc('0x34')](util['format'](_0x6fdc('0x44'),this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),'user:agentconnect',{'destaccountcode':this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4b4fb2['exten'],'routealias':_0x4e135f});}}}}catch(_0x6e0108){logger[_0x6fdc('0x2e')](_0x6fdc('0x73'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x6e0108,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x74')]=function(_0x1e63a2,_0x492530){try{if(this[_0x6fdc('0x1a')][_0x1e63a2]){logger[_0x6fdc('0x2b')](_0x6fdc('0x75'),_0x1e63a2,_0x492530);this['channels'][_0x1e63a2][_0x6fdc('0x76')]=!![];if(_['endsWith'](_0x492530,_0x6fdc('0x77'))){_0x492530=_0x492530[_0x6fdc('0x78')]('.wav49','.WAV');}this[_0x6fdc('0x1a')][_0x1e63a2]['monitorFilename']=_0x492530;var _0x5337c9=_[_0x6fdc('0x79')](this[_0x6fdc('0x1a')][_0x1e63a2][_0x6fdc('0x7a')],{'filename':_0x492530});if(_['isNil'](_0x5337c9)){this[_0x6fdc('0x1a')][_0x1e63a2][_0x6fdc('0x7a')][_0x6fdc('0x7b')]({'filename':_0x492530,'createdAt':moment()[_0x6fdc('0x4c')](_0x6fdc('0x4d')),'mixmonitorid':'','status':'rec'});}}}catch(_0x3cef9f){logger[_0x6fdc('0x2e')](_0x6fdc('0x7c'),_0x1e63a2,util[_0x6fdc('0x30')](_0x3cef9f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x21')]=function(_0x16abef){try{if(this['isNotNull'](_0x16abef)){logger[_0x6fdc('0x53')](_0x6fdc('0x7d'),_0x16abef[_0x6fdc('0x37')],util['inspect'](_0x16abef,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]&&_0x16abef[_0x6fdc('0x42')]!='OutgoingSpoolFailed'){if(this[_0x6fdc('0x32')](_0x16abef['variable'])){if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x7f')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x80'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x74')](_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x82')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x83'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x39')]=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')]['xmd-callerid'])){logger['info'](_0x6fdc('0x84'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['callerid']=_0x16abef[_0x6fdc('0x81')];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x85')])){logger['info'](_0x6fdc('0x86'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x87')]=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef['variable']['xmd-queue'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x88'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')][_0x6fdc('0x3f')](',')[0x0]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x66')]=_0x16abef[_0x6fdc('0x81')][_0x6fdc('0x3f')](',')[0x0];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x89')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8a'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['originatecalleridnum']=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')]['xmd-destination'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8b'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x8c')]=_0x16abef['value'];}else if(this[_0x6fdc('0x32')](_0x16abef['variable'][_0x6fdc('0x8d')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8e'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x8f')]=_0x16abef[_0x6fdc('0x81')];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x90')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x91'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x66')]=_0x16abef['value'];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')]['sipcallid'])){logger['info'](_0x6fdc('0x92'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['sipcalluniqueid']=_0x16abef[_0x6fdc('0x81')];}}}else if(this[_0x6fdc('0x32')](_0x16abef['variable'][_0x6fdc('0x7f')])){if(_0x16abef[_0x6fdc('0x81')]){var _0x2c9885=path['parse'](_0x16abef[_0x6fdc('0x81')])[_0x6fdc('0x45')];logger[_0x6fdc('0x2b')](_0x6fdc('0x80'),_0x2c9885,_0x16abef[_0x6fdc('0x81')]);this['syncMixMonitorFilename'](_0x2c9885,_0x16abef[_0x6fdc('0x81')]);}}else if(this['channels'][_0x16abef[_0x6fdc('0x3b')]]){if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')])){if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')]['sipcallid'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x92'),_0x16abef[_0x6fdc('0x3b')],_0x16abef[_0x6fdc('0x81')]);this['channels'][_0x16abef[_0x6fdc('0x3b')]]['sipcalllinkedid']=_0x16abef[_0x6fdc('0x81')];}}}}}catch(_0x5dbd1f){logger[_0x6fdc('0x2e')]('[%s][voiceCallReport][varset]',_0x16abef[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x5dbd1f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x93')]=function(_0x325652){try{if(this[_0x6fdc('0x32')](_0x325652)){logger[_0x6fdc('0x53')]('[%s][voiceCallReport][hangup]\x20event:',_0x325652[_0x6fdc('0x37')],util['inspect'](_0x325652,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]){logger[_0x6fdc('0x2b')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x325652[_0x6fdc('0x37')],_0x325652[_0x6fdc('0x94')]);var _0x1d384d=moment();this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]['endtime']=_0x1d384d[_0x6fdc('0x4c')](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x5e')]=_0x1d384d[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x5d')],_0x6fdc('0x60'));if(this[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x6a')]){this['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x95')]=_0x1d384d[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]['answertime'],_0x6fdc('0x60'));this['channels'][_0x325652['uniqueid']][_0x6fdc('0x96')]=this['channels'][_0x325652[_0x6fdc('0x37')]]['duration']-this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x95')];}if(_0x325652[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]){this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]=_[_0x6fdc('0x97')](this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]],['destconnectedlinenum']);logger[_0x6fdc('0x53')](_0x6fdc('0x98'),_0x325652[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'id':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')]},{'showHidden':![],'depth':null}));this[_0x6fdc('0x34')](util[_0x6fdc('0x4c')]('user:%s',this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),_0x6fdc('0x99'),{'id':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')]});}}var _0x3727dc=this;Promise[_0x6fdc('0x9a')]()[_0x6fdc('0x9b')](function(){var _0x4c47da=_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];if(typeof _0x4c47da[_0x6fdc('0x9c')]===_0x6fdc('0x9d'))return;if(_[_0x6fdc('0x9e')](_0x4c47da[_0x6fdc('0x7a')]))return;return RpcSetting[_0x6fdc('0x9f')]()[_0x6fdc('0x9b')](function(_0x3af731){if(!_0x3af731['stopRecordingOnTransfer'])return;return Promise[_0x6fdc('0x9a')]()['then'](function(){return ami['Action']({'action':_0x6fdc('0xa0'),'channel':_0x4c47da[_0x6fdc('0x42')]})[_0x6fdc('0xa1')](function(){});})['then'](function(){return ami[_0x6fdc('0xa2')]({'action':_0x6fdc('0xa0'),'channel':_0x4c47da[_0x6fdc('0x6e')]})[_0x6fdc('0xa1')](function(){})['finally'](function(){var _0x14b9de=_0x3727dc[_0x6fdc('0x1b')][_0x4c47da['destinationchannel'][_0x6fdc('0x3f')]('-')[0x0]];if(!_0x14b9de)return;io[_0x6fdc('0x34')]('webbar:stopmonitors',{'agentId':_0x14b9de['id'],'uniqueid':_0x4c47da['uniqueid']});});});});})['then'](function(){if(_0x325652[_0x6fdc('0xa3')]===_0x6fdc('0xa4')){_0x3727dc[_0x6fdc('0xa5')][_0x325652['uniqueid']]=_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];}else{if(_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x87')]==='outbound'&&_0x3727dc[_0x6fdc('0xa5')][_0x325652[_0x6fdc('0x37')]]){_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]]['uniqueid']=[_0x3727dc['channels'][_0x325652['uniqueid']]['linkedid'],_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x3b')]=_0x3727dc[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x37')]][0x0];delete _0x3727dc['blindTransfers'][_0x325652[_0x6fdc('0x37')]];}}logger[_0x6fdc('0x53')](_0x6fdc('0xa6'),_0x325652[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6fdc('0xa7'),_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]);delete _0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];});}}}catch(_0x5dc64f){logger['error'](_0x6fdc('0xa8'),_0x325652[_0x6fdc('0x37')],util['inspect'](_0x5dc64f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x25')]=function(_0x4bee15){try{if(this[_0x6fdc('0x32')](_0x4bee15)){logger[_0x6fdc('0x2b')](_0x6fdc('0xa9'),_0x4bee15[_0x6fdc('0x37')],_0x4bee15[_0x6fdc('0xaa')],_0x4bee15[_0x6fdc('0xab')]);logger['debug'](_0x6fdc('0xac'),_0x4bee15[_0x6fdc('0x37')],util['inspect'](_0x4bee15,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]]){this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]][_0x6fdc('0xae')]=_0x4bee15[_0x6fdc('0xaa')];this[_0x6fdc('0x1a')][_0x4bee15['transfereeuniqueid']]['transferconnectedlinenum']=_0x4bee15[_0x6fdc('0xab')];if(this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]){var _0x36f713=this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']];this['channels'][_0x4bee15['secondtransfereruniqueid']]=this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]];this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]]=_0x36f713;}}else if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]]){this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]][_0x6fdc('0xae')]=_0x4bee15[_0x6fdc('0xaa')];this[_0x6fdc('0x1a')][_0x4bee15['transfertargetuniqueid']][_0x6fdc('0xb0')]=_0x4bee15[_0x6fdc('0xab')];if(this['channels'][_0x4bee15[_0x6fdc('0xb1')]]){var _0x36f713=this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb1')]];this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']]=this['channels'][_0x4bee15[_0x6fdc('0xaf')]];this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]]=_0x36f713;}}if((this['channels'][_0x4bee15['origtransfereruniqueid']]||this['channels'][_0x4bee15['origtransfererlinkedid']])&&this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]){var _0xa71676=_['some']([this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']],this[_0x6fdc('0x1a')][_0x4bee15['origtransfererlinkedid']],this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]],function(_0x21110c){return _0x21110c&&_0x21110c[_0x6fdc('0x87')]==='outbound'&&_0x21110c[_0x6fdc('0xb2')];});if(_0xa71676){if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb1')]])this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']][_0x6fdc('0x9c')]='ATTENDED';if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb3')]])this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb3')]][_0x6fdc('0x9c')]=_0x6fdc('0xb4');this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb5')]][_0x6fdc('0x9c')]=_0x6fdc('0xb4');}}}}catch(_0x2f643c){logger[_0x6fdc('0x2e')](_0x6fdc('0xb6'),_0x4bee15['uniqueid'],util['inspect'](_0x2f643c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0xb7')]=function(_0x444d66){try{if(this[_0x6fdc('0x32')](_0x444d66)){logger['info'](_0x6fdc('0xb8'),_0x444d66[_0x6fdc('0x37')],_0x444d66[_0x6fdc('0xb9')],_0x444d66[_0x6fdc('0xba')]);logger[_0x6fdc('0x53')](_0x6fdc('0xbb'),_0x444d66[_0x6fdc('0x37')],util['inspect'](_0x444d66,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]]){this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]][_0x6fdc('0xae')]=_0x444d66[_0x6fdc('0xb9')];this['channels'][_0x444d66[_0x6fdc('0xad')]][_0x6fdc('0xb0')]=_0x444d66[_0x6fdc('0xba')];this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]]['transferType']=_0x6fdc('0xbc');this[_0x6fdc('0x93')]({'event':'BlindTransfer','uniqueid':_0x444d66[_0x6fdc('0xad')],'context':_0x444d66[_0x6fdc('0x3d')],'channel':_0x444d66['transfererchannel']});}else{this['channels'][_0x444d66[_0x6fdc('0xbd')]][_0x6fdc('0x9c')]=_0x6fdc('0xbc');}}}catch(_0x2dfe9b){logger['error'](_0x6fdc('0xbe'),_0x444d66[_0x6fdc('0x37')],util['inspect'](_0x2dfe9b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x28')]=function(_0x16a2df){try{if(this[_0x6fdc('0x32')](_0x16a2df)){logger[_0x6fdc('0x53')](_0x6fdc('0xbf'),_0x16a2df[_0x6fdc('0x37')],util['inspect'](_0x16a2df,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]]){if(!_[_0x6fdc('0xc0')](this['channels'][_0x16a2df[_0x6fdc('0x37')]]['answertime'])){this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]][_0x6fdc('0xc1')]=moment()[_0x6fdc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6fdc('0x2b')](_0x6fdc('0xc2'),_0x16a2df[_0x6fdc('0x37')],this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]]['mohstarttime']);}}}}catch(_0x3461d4){logger[_0x6fdc('0x2e')](_0x6fdc('0xc3'),_0x16a2df[_0x6fdc('0x37')],util['inspect'](_0x3461d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x2a')]=function(_0xa2e07b){try{if(this['isNotNull'](_0xa2e07b)){logger[_0x6fdc('0x53')](_0x6fdc('0xc4'),_0xa2e07b[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0xa2e07b,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0xa2e07b['uniqueid']]){if(!_['isNil'](this['channels'][_0xa2e07b['uniqueid']]['mohstarttime'])){this[_0x6fdc('0x1a')][_0xa2e07b['uniqueid']][_0x6fdc('0xc5')]+=moment()['milliseconds'](0x0)[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0xa2e07b[_0x6fdc('0x37')]][_0x6fdc('0xc1')],_0x6fdc('0x60'));logger[_0x6fdc('0x2b')](_0x6fdc('0xc6'),_0xa2e07b['uniqueid'],this['channels'][_0xa2e07b[_0x6fdc('0x37')]][_0x6fdc('0xc5')]);delete this[_0x6fdc('0x1a')][_0xa2e07b[_0x6fdc('0x37')]]['mohstarttime'];}}}}catch(_0x22ba9e){logger['error'](_0x6fdc('0xc7'),_0xa2e07b[_0x6fdc('0x37')],util['inspect'](_0x22ba9e,{'showHidden':![],'depth':null}));}};module[_0x6fdc('0xc8')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 721abff..9ba009a 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84c6=['isNotNull','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','variables','voice','info','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','isUndefined','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','total','answertime','answered','holdtime','diff','starttime','billableseconds','seconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','channels','outboundChannels','outbound','applications','syncDialBegin','bind','dialend','syncVarSet','newexten','syncNewExten','prototype'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0x84c6,0x1d9));var _0x684c=function(_0x1ec350,_0x922adb){_0x1ec350=_0x1ec350-0x0;var _0x480348=_0x84c6[_0x1ec350];return _0x480348;};'use strict';var _=require('lodash');var moment=require(_0x684c('0x0'));var util=require(_0x684c('0x1'));var Redis=require(_0x684c('0x2'));var config=require(_0x684c('0x3'));var logger=require(_0x684c('0x4'))(_0x684c('0x5'));var ami=require(_0x684c('0x6'));config[_0x684c('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x684c('0x7')]));function VoiceDialReport(_0x33cbe5){this[_0x684c('0x8')]=_0x33cbe5[_0x684c('0x9')];this[_0x684c('0xa')]=_0x33cbe5['outbound'];this[_0x684c('0xb')]={};this['variables']={};ami['on']('dialbegin',this[_0x684c('0xc')][_0x684c('0xd')](this));ami['on'](_0x684c('0xe'),this['syncDialEnd'][_0x684c('0xd')](this));ami['on']('varset',this[_0x684c('0xf')][_0x684c('0xd')](this));ami['on'](_0x684c('0x10'),this[_0x684c('0x11')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));}VoiceDialReport[_0x684c('0x12')][_0x684c('0x13')]=function(_0x30f98f){return _0x30f98f!==null&&!_['isUndefined'](_0x30f98f);};VoiceDialReport[_0x684c('0x12')]['emit']=function(_0x5d7e2f,_0x10f8a3,_0xfb5904){io['to'](_0x5d7e2f)[_0x684c('0x14')](_0x10f8a3,_0xfb5904);};VoiceDialReport['prototype'][_0x684c('0xc')]=function(_0x13d8e7){try{if(this[_0x684c('0x13')](_0x13d8e7)){logger[_0x684c('0x15')](_0x684c('0x16'),_0x13d8e7['uniqueid'],util[_0x684c('0x17')](_0x13d8e7,{'showHidden':![],'depth':null}));if(this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]]){_[_0x684c('0x19')](this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]],{'starttime':moment()[_0x684c('0x1a')](_0x684c('0x1b')),'lastevent':'called','interface':_0x13d8e7[_0x684c('0x1c')][_0x684c('0x1d')](0x0,_0x13d8e7[_0x684c('0x1c')][_0x684c('0x1e')]('-')),'membername':_0x13d8e7[_0x684c('0x1c')][_0x684c('0x1d')](_0x13d8e7[_0x684c('0x1c')][_0x684c('0x1e')]('/')+0x1,_0x13d8e7[_0x684c('0x1c')][_0x684c('0x1e')]('-'))},_[_0x684c('0x1f')](_0x13d8e7,[_0x684c('0x20'),_0x684c('0x21')]));logger['info'](_0x684c('0x22'),_0x13d8e7[_0x684c('0x18')],this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]][_0x684c('0x23')],this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]][_0x684c('0x24')]);logger[_0x684c('0x15')](_0x684c('0x25'),_0x13d8e7[_0x684c('0x18')],util['inspect'](this[_0x684c('0x8')][_0x13d8e7['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x684c('0xb')][_0x13d8e7[_0x684c('0x18')]])_[_0x684c('0x19')](this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]],this[_0x684c('0xb')][_0x13d8e7[_0x684c('0x18')]]);this[_0x684c('0x14')](_0x684c('0x26'),_0x684c('0x27'),this[_0x684c('0x8')][_0x13d8e7[_0x684c('0x18')]]);logger[_0x684c('0x15')](_0x684c('0x28'),_0x13d8e7[_0x684c('0x18')],util['inspect'](this[_0x684c('0x8')][_0x13d8e7['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x684c('0x29'),this[_0x684c('0x8')][_0x13d8e7['uniqueid']]);}}}catch(_0x360134){logger[_0x684c('0x2a')](_0x684c('0x2b'),_0x13d8e7[_0x684c('0x18')],util[_0x684c('0x17')](_0x360134,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x684c('0x2c')]=function(_0x261dea){try{if(this[_0x684c('0x13')](_0x261dea)){logger[_0x684c('0x15')](_0x684c('0x2d'),_0x261dea[_0x684c('0x18')],util[_0x684c('0x17')](_0x261dea,{'showHidden':![],'depth':null}));if(this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]]){this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]][_0x684c('0x2e')]=_0x261dea[_0x684c('0x2e')];if(_0x261dea[_0x684c('0x2e')]==='ANSWER'){this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]][_0x684c('0x2f')]=_0x261dea[_0x684c('0x2f')];this['channels'][_0x261dea[_0x684c('0x18')]]['connectedlinename']=_0x261dea[_0x684c('0x30')];this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]]['answertime']=moment()[_0x684c('0x1a')](_0x684c('0x1b'));this['channels'][_0x261dea['uniqueid']][_0x684c('0x31')]='connect';logger['info'](_0x684c('0x32'),_0x261dea[_0x684c('0x18')],_0x261dea[_0x684c('0x1c')][_0x684c('0x1d')](_0x261dea[_0x684c('0x1c')][_0x684c('0x1e')]('/')+0x1,_0x261dea[_0x684c('0x1c')][_0x684c('0x1e')]('-')));logger[_0x684c('0x15')](_0x684c('0x33'),_0x261dea[_0x684c('0x18')],util[_0x684c('0x17')](this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]],{'showHidden':![],'depth':null}));ami[_0x684c('0x14')](_0x684c('0x34'),this['channels'][_0x261dea[_0x684c('0x18')]]);}logger[_0x684c('0x15')](_0x684c('0x35'),_0x261dea['uniqueid'],util[_0x684c('0x17')](this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]],{'showHidden':![],'depth':null}));this[_0x684c('0x14')](_0x684c('0x26'),_0x684c('0x27'),this[_0x684c('0x8')][_0x261dea[_0x684c('0x18')]]);}}}catch(_0x3f4edd){logger[_0x684c('0x2a')](_0x684c('0x36'),_0x261dea[_0x684c('0x18')],util[_0x684c('0x17')](_0x3f4edd,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x684c('0xf')]=function(_0x195b5c){try{if(this[_0x684c('0x13')](_0x195b5c)){logger[_0x684c('0x15')](_0x684c('0x37'),_0x195b5c[_0x684c('0x18')],util[_0x684c('0x17')](_0x195b5c,{'showHidden':![],'depth':null}));this[_0x684c('0x38')](_0x195b5c[_0x684c('0x18')],_[_0x684c('0x39')](_0x195b5c[_0x684c('0x3a')])[0x0],_0x195b5c['value']);if(this[_0x684c('0x13')](_0x195b5c[_0x684c('0x3a')])&&this[_0x684c('0x13')](_0x195b5c[_0x684c('0x3a')]['outboundrouteid'])){if(_['isUndefined'](this[_0x684c('0x8')][_0x195b5c['uniqueid']])){this[_0x684c('0x8')][_0x195b5c[_0x684c('0x18')]]={'routeId':_0x195b5c[_0x684c('0x3b')],'variables':this[_0x684c('0x3c')][_0x195b5c[_0x684c('0x18')]],'motionChannel':_0x684c('0x3d')};logger[_0x684c('0x3e')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x195b5c['uniqueid'],_0x195b5c['variable'][_0x684c('0x3f')],_[_0x684c('0x39')](_0x195b5c[_0x684c('0x3a')])[0x0],_0x195b5c[_0x684c('0x3b')]);logger['debug'](_0x684c('0x40'),_0x195b5c['uniqueid'],util[_0x684c('0x17')](this[_0x684c('0x8')][_0x195b5c[_0x684c('0x18')]],{'showHidden':![],'depth':null}));this[_0x684c('0x14')]('voice:outbound','voice_outbound_channel:save',this[_0x684c('0x8')][_0x195b5c[_0x684c('0x18')]]);}}}}catch(_0x137a3d){logger[_0x684c('0x2a')]('[%s][voiceDialReport][varset]',_0x195b5c['uniqueid'],util[_0x684c('0x17')](_0x137a3d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x684c('0x12')][_0x684c('0x38')]=function(_0x58fe8e,_0x56a727,_0x4c6783){var _0x4a29a0=['rtpaudioqos',_0x684c('0x41'),_0x684c('0x42'),_0x684c('0x43'),_0x684c('0x44'),_0x684c('0x45'),_0x684c('0x46'),'rtpaudioqosrttbridged',_0x684c('0x47'),'sipuri',_0x684c('0x48'),_0x684c('0x49'),_0x684c('0x4a'),_0x684c('0x4b'),_0x684c('0x4c'),_0x684c('0x4d'),_0x684c('0x23'),_0x684c('0x4e'),_0x684c('0x4f')];if(!_[_0x684c('0x50')](_0x56a727)&&!_[_0x684c('0x51')](_0x4a29a0,_0x56a727)){if(_[_0x684c('0x52')](this[_0x684c('0x3c')][_0x58fe8e])){this['variables'][_0x58fe8e]={};}this[_0x684c('0x3c')][_0x58fe8e][_0x56a727]=_0x4c6783;}};VoiceDialReport[_0x684c('0x12')][_0x684c('0x53')]=function(_0x389fac){try{if(this[_0x684c('0x13')](_0x389fac)){logger[_0x684c('0x15')](_0x684c('0x54'),_0x389fac['uniqueid'],util[_0x684c('0x17')](_0x389fac,{'showHidden':![],'depth':null}));if(this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]]){logger[_0x684c('0x3e')](_0x684c('0x55'),_0x389fac[_0x684c('0x18')],_0x389fac[_0x684c('0x56')]);this['channels'][_0x389fac[_0x684c('0x18')]][_0x684c('0x57')]=moment()['format'](_0x684c('0x1b'));this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x58')]=moment(this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x57')])['diff'](this['channels'][_0x389fac[_0x684c('0x18')]]['starttime'],'seconds');this[_0x684c('0x8')][_0x389fac['uniqueid']][_0x684c('0x31')]='complete';this[_0x684c('0xa')][_0x684c('0x59')]+=0x1;if(this[_0x684c('0x8')][_0x389fac['uniqueid']][_0x684c('0x5a')]){this[_0x684c('0xa')][_0x684c('0x5b')]+=0x1;this[_0x684c('0x8')][_0x389fac['uniqueid']][_0x684c('0x5c')]=moment(this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x5a')])[_0x684c('0x5d')](this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x5e')],'seconds');this['channels'][_0x389fac['uniqueid']][_0x684c('0x5f')]=moment(this['channels'][_0x389fac[_0x684c('0x18')]][_0x684c('0x57')])[_0x684c('0x5d')](this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x5a')],_0x684c('0x60'));this['outbound'][_0x684c('0x61')]+=this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x5c')]||0x0;this[_0x684c('0xa')][_0x684c('0x62')]+=this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]][_0x684c('0x5f')];}this[_0x684c('0xa')]['sumDuration']+=this['channels'][_0x389fac[_0x684c('0x18')]][_0x684c('0x58')];logger[_0x684c('0x15')](_0x684c('0x63'),_0x389fac[_0x684c('0x18')],util[_0x684c('0x17')](this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]],{'showHidden':![],'depth':null}));ami[_0x684c('0x14')](_0x684c('0x64'),this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]]);logger[_0x684c('0x15')](_0x684c('0x65'),_0x389fac[_0x684c('0x18')],util['inspect'](this['channels'][_0x389fac[_0x684c('0x18')]],{'showHidden':![],'depth':null}));ami[_0x684c('0x14')]('custom:dialend',this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]]);logger[_0x684c('0x15')](_0x684c('0x66'),_0x389fac[_0x684c('0x18')],util[_0x684c('0x17')](this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]],{'showHidden':![],'depth':null}));this[_0x684c('0x14')](_0x684c('0x26'),_0x684c('0x67'),this[_0x684c('0xa')]);logger[_0x684c('0x3e')](_0x684c('0x68'),JSON[_0x684c('0x69')](this[_0x684c('0x8')][_0x389fac['uniqueid']]));logger[_0x684c('0x15')](_0x684c('0x6a'),_0x389fac[_0x684c('0x18')],util['inspect'](this['channels'][_0x389fac['uniqueid']],{'showHidden':![],'depth':null}));this[_0x684c('0x14')](_0x684c('0x26'),_0x684c('0x6b'),this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]]);delete this[_0x684c('0x8')][_0x389fac[_0x684c('0x18')]];}else if(this[_0x684c('0x8')][_0x389fac[_0x684c('0x6c')]]){this['channels'][_0x389fac[_0x684c('0x6c')]]['uniqueid']=this['channels'][_0x389fac[_0x684c('0x6c')]][_0x684c('0x6d')];}if(this[_0x684c('0x3c')][_0x389fac[_0x684c('0x18')]]){delete this[_0x684c('0x3c')][_0x389fac[_0x684c('0x18')]];}}}catch(_0x48cd12){logger[_0x684c('0x2a')](_0x684c('0x6e'),_0x389fac['uniqueid'],util['inspect'](_0x48cd12,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x684c('0x12')][_0x684c('0x11')]=function(_0x44b060){try{if(this['isNotNull'](_0x44b060)){logger['debug'](_0x684c('0x6f'),_0x44b060[_0x684c('0x18')],util['inspect'](_0x44b060,{'showHidden':![],'depth':null}));if(_0x44b060[_0x684c('0x70')][_0x684c('0x71')]()===_0x684c('0x72')){_0x44b060[_0x684c('0x73')]=(_0x44b060[_0x684c('0x74')]||_0x44b060[_0x684c('0x73')])[_0x684c('0x71')]();if(_[_0x684c('0x75')](_0x44b060[_0x684c('0x73')],_0x684c('0x76'))){if(_[_0x684c('0x52')](this[_0x684c('0xb')][_0x44b060['uniqueid']]))this[_0x684c('0xb')][_0x44b060[_0x684c('0x18')]]={};logger[_0x684c('0x3e')](_0x684c('0x77'),_0x44b060['uniqueid'],_0x44b060[_0x684c('0x70')],_0x44b060['applicationdata']);var _0x3f24ef=_0x44b060[_0x684c('0x73')]['split']('=');var _0x975e45=_0x3f24ef[0x0][_0x684c('0x78')](/cdr\((.*)\)/);if(_0x975e45)this[_0x684c('0xb')][_0x44b060[_0x684c('0x18')]][_0x975e45[0x1]]=_0x3f24ef[0x1];}}}}catch(_0x12d328){logger[_0x684c('0x2a')](_0x684c('0x79'),_0x44b060[_0x684c('0x18')],util[_0x684c('0x17')](_0x12d328,{'showHidden':![],'depth':null}));}};module[_0x684c('0x7a')]=VoiceDialReport; \ No newline at end of file +var _0x4743=['privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','merge','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','variable','outboundrouteid','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','duration','diff','starttime','seconds','complete','answertime','answered','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','debug','uniqueid','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','event'];(function(_0x865937,_0x1d5b8a){var _0xc70696=function(_0x124f2b){while(--_0x124f2b){_0x865937['push'](_0x865937['shift']());}};_0xc70696(++_0x1d5b8a);}(_0x4743,0xc7));var _0x3474=function(_0xf32c6d,_0x372704){_0xf32c6d=_0xf32c6d-0x0;var _0x156c11=_0x4743[_0xf32c6d];return _0x156c11;};'use strict';var _=require(_0x3474('0x0'));var moment=require('moment');var util=require(_0x3474('0x1'));var Redis=require('ioredis');var config=require(_0x3474('0x2'));var logger=require(_0x3474('0x3'))(_0x3474('0x4'));var ami=require(_0x3474('0x5'));config[_0x3474('0x6')]=_[_0x3474('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3474('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x3be84c){this['channels']=_0x3be84c[_0x3474('0x9')];this[_0x3474('0xa')]=_0x3be84c['outbound'];this[_0x3474('0xb')]={};this[_0x3474('0xc')]={};ami['on']('dialbegin',this[_0x3474('0xd')][_0x3474('0xe')](this));ami['on'](_0x3474('0xf'),this[_0x3474('0x10')][_0x3474('0xe')](this));ami['on'](_0x3474('0x11'),this[_0x3474('0x12')][_0x3474('0xe')](this));ami['on']('newexten',this[_0x3474('0x13')][_0x3474('0xe')](this));ami['on'](_0x3474('0x14'),this[_0x3474('0x15')][_0x3474('0xe')](this));}VoiceDialReport[_0x3474('0x16')]['isNotNull']=function(_0x15b4bf){return _0x15b4bf!==null&&!_[_0x3474('0x17')](_0x15b4bf);};VoiceDialReport[_0x3474('0x16')]['emit']=function(_0x1414ec,_0x44124e,_0x1bf483){io['to'](_0x1414ec)[_0x3474('0x18')](_0x44124e,_0x1bf483);};VoiceDialReport[_0x3474('0x16')][_0x3474('0xd')]=function(_0x1a7447){try{if(this[_0x3474('0x19')](_0x1a7447)){logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x1a7447[_0x3474('0x1b')],util['inspect'](_0x1a7447,{'showHidden':![],'depth':null}));if(this['channels'][_0x1a7447[_0x3474('0x1b')]]){_['merge'](this[_0x3474('0x1c')][_0x1a7447['uniqueid']],{'starttime':moment()[_0x3474('0x1d')](_0x3474('0x1e')),'lastevent':_0x3474('0x1f'),'interface':_0x1a7447[_0x3474('0x20')]['substring'](0x0,_0x1a7447[_0x3474('0x20')]['lastIndexOf']('-')),'membername':_0x1a7447[_0x3474('0x20')]['substring'](_0x1a7447[_0x3474('0x20')][_0x3474('0x21')]('/')+0x1,_0x1a7447[_0x3474('0x20')]['lastIndexOf']('-'))},_['omit'](_0x1a7447,[_0x3474('0x22'),_0x3474('0x23')]));logger[_0x3474('0x24')](_0x3474('0x25'),_0x1a7447[_0x3474('0x1b')],this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]][_0x3474('0x26')],this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]][_0x3474('0x27')]);logger['debug'](_0x3474('0x28'),_0x1a7447[_0x3474('0x1b')],util[_0x3474('0x29')](this['channels'][_0x1a7447[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x3474('0xb')][_0x1a7447[_0x3474('0x1b')]])_[_0x3474('0x2a')](this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]],this[_0x3474('0xb')][_0x1a7447[_0x3474('0x1b')]]);this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]]);logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x1a7447[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x1a7447['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x2d'),this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]]);}}}catch(_0x16f410){logger[_0x3474('0x2e')](_0x3474('0x2f'),_0x1a7447['uniqueid'],util[_0x3474('0x29')](_0x16f410,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x3474('0x10')]=function(_0x49aa91){try{if(this[_0x3474('0x19')](_0x49aa91)){logger['debug'](_0x3474('0x30'),_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](_0x49aa91,{'showHidden':![],'depth':null}));if(this['channels'][_0x49aa91[_0x3474('0x1b')]]){this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['dialstatus']=_0x49aa91['dialstatus'];if(_0x49aa91[_0x3474('0x31')]===_0x3474('0x32')){this[_0x3474('0x1c')][_0x49aa91['uniqueid']][_0x3474('0x33')]=_0x49aa91['connectedlinenum'];this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['connectedlinename']=_0x49aa91[_0x3474('0x34')];this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3474('0x1c')][_0x49aa91['uniqueid']][_0x3474('0x35')]='connect';logger[_0x3474('0x24')](_0x3474('0x36'),_0x49aa91[_0x3474('0x1b')],_0x49aa91['channel'][_0x3474('0x37')](_0x49aa91[_0x3474('0x20')][_0x3474('0x21')]('/')+0x1,_0x49aa91[_0x3474('0x20')]['lastIndexOf']('-')));logger[_0x3474('0x1a')](_0x3474('0x38'),_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3474('0x39'),this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]);}logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x49aa91['uniqueid'],util[_0x3474('0x29')](this['channels'][_0x49aa91[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]);}}}catch(_0x11a9a8){logger[_0x3474('0x2e')]('[%s][voiceDialReport][dialend]',_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](_0x11a9a8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x12')]=function(_0x2fe9e2){try{if(this[_0x3474('0x19')](_0x2fe9e2)){logger[_0x3474('0x1a')](_0x3474('0x3a'),_0x2fe9e2[_0x3474('0x1b')],util[_0x3474('0x29')](_0x2fe9e2,{'showHidden':![],'depth':null}));this['addVariable'](_0x2fe9e2[_0x3474('0x1b')],_['keys'](_0x2fe9e2['variable'])[0x0],_0x2fe9e2['value']);if(this[_0x3474('0x19')](_0x2fe9e2[_0x3474('0x3b')])&&this[_0x3474('0x19')](_0x2fe9e2[_0x3474('0x3b')][_0x3474('0x3c')])){if(_['isUndefined'](this[_0x3474('0x1c')][_0x2fe9e2[_0x3474('0x1b')]])){this['channels'][_0x2fe9e2[_0x3474('0x1b')]]={'routeId':_0x2fe9e2[_0x3474('0x3d')],'variables':this['variables'][_0x2fe9e2['uniqueid']],'motionChannel':_0x3474('0x3e')};logger[_0x3474('0x24')](_0x3474('0x3f'),_0x2fe9e2[_0x3474('0x1b')],_0x2fe9e2[_0x3474('0x3b')]['outboundrouteid'],_[_0x3474('0x40')](_0x2fe9e2[_0x3474('0x3b')])[0x0],_0x2fe9e2['value']);logger[_0x3474('0x1a')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2fe9e2['uniqueid'],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x2fe9e2[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x2fe9e2['uniqueid']]);}}}}catch(_0x347c11){logger[_0x3474('0x2e')](_0x3474('0x41'),_0x2fe9e2[_0x3474('0x1b')],util[_0x3474('0x29')](_0x347c11,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x42')]=function(_0x2e4fcd,_0x4b692b,_0x1c583d){var _0x224c06=[_0x3474('0x43'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x3474('0x44'),_0x3474('0x45'),_0x3474('0x46'),_0x3474('0x47'),_0x3474('0x48'),_0x3474('0x49'),_0x3474('0x4a'),_0x3474('0x4b'),_0x3474('0x4c'),_0x3474('0x4d'),_0x3474('0x4e'),_0x3474('0x4f'),_0x3474('0x50'),_0x3474('0x26'),_0x3474('0x51'),_0x3474('0x52')];if(!_[_0x3474('0x53')](_0x4b692b)&&!_[_0x3474('0x54')](_0x224c06,_0x4b692b)){if(_[_0x3474('0x17')](this['variables'][_0x2e4fcd])){this[_0x3474('0xc')][_0x2e4fcd]={};}this[_0x3474('0xc')][_0x2e4fcd][_0x4b692b]=_0x1c583d;}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x15')]=function(_0x32d817){try{if(this[_0x3474('0x19')](_0x32d817)){logger[_0x3474('0x1a')](_0x3474('0x55'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](_0x32d817,{'showHidden':![],'depth':null}));if(this[_0x3474('0x1c')][_0x32d817['uniqueid']]){logger[_0x3474('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x32d817['uniqueid'],_0x32d817['cause-txt']);this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x56')]=moment()['format'](_0x3474('0x1e'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x57')]=moment(this[_0x3474('0x1c')][_0x32d817['uniqueid']]['endtime'])[_0x3474('0x58')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x59')],_0x3474('0x5a'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x35')]=_0x3474('0x5b');this[_0x3474('0xa')]['total']+=0x1;if(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5c')]){this[_0x3474('0xa')][_0x3474('0x5d')]+=0x1;this[_0x3474('0x1c')][_0x32d817['uniqueid']]['holdtime']=moment(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]['answertime'])[_0x3474('0x58')](this[_0x3474('0x1c')][_0x32d817['uniqueid']]['starttime'],_0x3474('0x5a'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5e')]=moment(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x56')])[_0x3474('0x58')](this['channels'][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5c')],_0x3474('0x5a'));this[_0x3474('0xa')][_0x3474('0x5f')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x60')]||0x0;this[_0x3474('0xa')][_0x3474('0x61')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]['billableseconds'];}this[_0x3474('0xa')][_0x3474('0x62')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x57')];logger['debug'](_0x3474('0x63'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x64'),this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);logger[_0x3474('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x65'),this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);logger['debug'](_0x3474('0x66'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this['channels'][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x67'),this[_0x3474('0xa')]);logger[_0x3474('0x24')](_0x3474('0x68'),JSON['stringify'](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]));logger[_0x3474('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x32d817[_0x3474('0x1b')],util['inspect'](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x3474('0x2b'),'voice_outbound_channel:remove',this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);delete this['channels'][_0x32d817[_0x3474('0x1b')]];}else if(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x69')]]){this[_0x3474('0x1c')][_0x32d817[_0x3474('0x69')]][_0x3474('0x1b')]=this['channels'][_0x32d817[_0x3474('0x69')]][_0x3474('0x6a')];}if(this[_0x3474('0xc')][_0x32d817['uniqueid']]){delete this[_0x3474('0xc')][_0x32d817[_0x3474('0x1b')]];}}}catch(_0x266060){logger['error'](_0x3474('0x6b'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](_0x266060,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x13')]=function(_0x6b6a7a){try{if(this[_0x3474('0x19')](_0x6b6a7a)){logger[_0x3474('0x1a')]('[%s][voiceDialReport][newexten]\x20event:',_0x6b6a7a['uniqueid'],util[_0x3474('0x29')](_0x6b6a7a,{'showHidden':![],'depth':null}));if(_0x6b6a7a['application']['toLowerCase']()===_0x3474('0x6c')){_0x6b6a7a[_0x3474('0x6d')]=(_0x6b6a7a[_0x3474('0x6e')]||_0x6b6a7a['applicationdata'])['toLowerCase']();if(_[_0x3474('0x6f')](_0x6b6a7a['applicationdata'],_0x3474('0x70'))){if(_['isUndefined'](this[_0x3474('0xb')][_0x6b6a7a[_0x3474('0x1b')]]))this['applications'][_0x6b6a7a[_0x3474('0x1b')]]={};logger[_0x3474('0x24')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x6b6a7a[_0x3474('0x1b')],_0x6b6a7a['application'],_0x6b6a7a[_0x3474('0x6d')]);var _0x5837e1=_0x6b6a7a['applicationdata'][_0x3474('0x71')]('=');var _0x5cbe65=_0x5837e1[0x0][_0x3474('0x72')](/cdr\((.*)\)/);if(_0x5cbe65)this['applications'][_0x6b6a7a[_0x3474('0x1b')]][_0x5cbe65[0x1]]=_0x5837e1[0x1];}}}}catch(_0x2af95a){logger[_0x3474('0x2e')](_0x3474('0x73'),_0x6b6a7a['uniqueid'],util[_0x3474('0x29')](_0x2af95a,{'showHidden':![],'depth':null}));}};module[_0x3474('0x74')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index bd4857e..7b87123 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc7=['[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice_queue_presence:remove','emitVoiceQueueSummary','type','answered','available','loggedIn','sumBillable','total','unmanaged','Trunk','active','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','loopQueueShow','queues','[voiceQueueReport][queues]','queuesummary','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','add','seconds','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','TIMEOUT','lastevent','timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','bridgepeer','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','abandoned','sumHoldTime','diff','sumDuration','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime'];(function(_0x29c641,_0x3f3197){var _0x4cb535=function(_0x31cee8){while(--_0x31cee8){_0x29c641['push'](_0x29c641['shift']());}};_0x4cb535(++_0x3f3197);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x5fc7[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require(_0x75fc('0x0'));var moment=require(_0x75fc('0x1'));var util=require(_0x75fc('0x2'));var md5=require(_0x75fc('0x3'));var Redis=require(_0x75fc('0x4'));var config=require(_0x75fc('0x5'));var logger=require(_0x75fc('0x6'))(_0x75fc('0x7'));var ami=require(_0x75fc('0x8'));var QueueReport=require(_0x75fc('0x9'));config[_0x75fc('0xa')]=_[_0x75fc('0xb')](config['redis'],{'host':_0x75fc('0xc'),'port':0x18eb});var io=require(_0x75fc('0xd'))(new Redis(config[_0x75fc('0xa')]));var Sequence=function(){};Sequence[_0x75fc('0xe')][_0x75fc('0xf')]=function(_0x15f3bc){this[_0x75fc('0x10')]=this[_0x75fc('0x10')]?this[_0x75fc('0x10')][_0x75fc('0x11')](_0x15f3bc):_0x15f3bc();};function VoiceQueueReport(_0x4d2810){this[_0x75fc('0x12')]=new Sequence();this[_0x75fc('0x13')]={};this[_0x75fc('0x14')]=_0x4d2810[_0x75fc('0x14')];this['channels']=_0x4d2810[_0x75fc('0x15')];this[_0x75fc('0x16')]=_0x4d2810[_0x75fc('0x16')];this[_0x75fc('0x17')]=!![];this[_0x75fc('0x18')]=_0x4d2810[_0x75fc('0x18')];this[_0x75fc('0x19')]={};ami['on']('queuesummary',this['syncQueueSummary']['bind'](this));ami['on'](_0x75fc('0x1a'),this[_0x75fc('0x1b')][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x1d'),this[_0x75fc('0x1e')][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x1f'),this[_0x75fc('0x20')]['bind'](this));ami['on'](_0x75fc('0x21'),this[_0x75fc('0x22')]['bind'](this));ami['on'](_0x75fc('0x23'),this[_0x75fc('0x24')]['bind'](this));ami['on']('agentconnect',this[_0x75fc('0x25')][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x26'),this[_0x75fc('0x27')][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x28'),this['syncHangup'][_0x75fc('0x1c')](this));ami['on']('fullybooted',this[_0x75fc('0x29')][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x2a'),this[_0x75fc('0x2b')]['bind'](this));ami['on'](_0x75fc('0x2c'),this[_0x75fc('0x2d')]['bind'](this));ami['on'](_0x75fc('0x2e'),this[_0x75fc('0x2f')]['bind'](this));ami['on'](_0x75fc('0x30'),this['syncAttendedTransfer'][_0x75fc('0x1c')](this));ami['on'](_0x75fc('0x31'),this['syncBlindTransfer'][_0x75fc('0x1c')](this));this[_0x75fc('0x32')]();this['loopQueueShow']();}function clearChannels(_0x3a44d1){if(!_[_0x75fc('0x33')](_0x3a44d1)){for(var _0x53fcd2 in _0x3a44d1){if(_0x3a44d1['hasOwnProperty'](_0x53fcd2)){delete _0x3a44d1[_0x53fcd2];}}}}function clearCampaigns(_0x10a59a){if(!_['isEmpty'](_0x10a59a)){for(var _0x19a59e in _0x10a59a){if(_0x10a59a[_0x75fc('0x34')](_0x19a59e)){_0x10a59a[_0x19a59e]['originated']=0x0;}}}}function clearVoiceQueues(_0x56a7a4){if(!_['isEmpty'](_0x56a7a4)){for(var _0x5530c9 in _0x56a7a4){if(_0x56a7a4[_0x75fc('0x34')](_0x5530c9)){_0x56a7a4[_0x5530c9][_0x75fc('0x35')]=0x0;_0x56a7a4[_0x5530c9][_0x75fc('0x36')]=0x0;_0x56a7a4[_0x5530c9][_0x75fc('0x37')]=0x0;_0x56a7a4[_0x5530c9][_0x75fc('0x38')]=0x0;_0x56a7a4[_0x5530c9][_0x75fc('0x39')]=!![];}}}}function clearAgentBooked(_0x54bcd5){if(!_[_0x75fc('0x33')](_0x54bcd5)){for(var _0x3e99d7 in _0x54bcd5){if(_0x54bcd5[_0x75fc('0x34')](_0x3e99d7)){_0x54bcd5[_0x3e99d7][_0x75fc('0x3a')]=!![];}}}}VoiceQueueReport['prototype'][_0x75fc('0x3b')]=function(){var _0x486e3f=this;for(var _0x12b8a1 in this[_0x75fc('0x3c')]){if(this[_0x75fc('0x3c')][_0x75fc('0x34')](_0x12b8a1)&&!this['channels'][_0x12b8a1][_0x75fc('0x3d')]){this['sequence'][_0x75fc('0xf')](function(){if(!_[_0x75fc('0x3e')](_0x486e3f['channels'][_0x12b8a1])){return ami[_0x75fc('0x3f')]({'action':_0x75fc('0x40'),'channel':_0x486e3f['channels'][_0x12b8a1][_0x75fc('0x41')]})[_0x75fc('0x42')](function(_0xb50e9f){if(_0xb50e9f[_0x75fc('0x43')]===_0x75fc('0x44')){setTimeout(function(){if(_0x486e3f[_0x75fc('0x3c')][_0x12b8a1]){delete _0x486e3f[_0x75fc('0x3c')][_0x12b8a1];logger[_0x75fc('0x45')]('[%s][voiceQueueReport][checkChannel]',_0x12b8a1,util[_0x75fc('0x46')](_0xb50e9f,{'showHidden':![],'depth':null}));}if(_0x486e3f[_0x75fc('0x13')][_0x12b8a1]){delete _0x486e3f[_0x75fc('0x13')][_0x12b8a1];logger[_0x75fc('0x45')](_0x75fc('0x47'),_0x12b8a1,util[_0x75fc('0x46')](_0xb50e9f,{'showHidden':![],'depth':null}));}if(_0x486e3f[_0x75fc('0x19')][_0x12b8a1]){delete _0x486e3f[_0x75fc('0x19')][_0x12b8a1];logger[_0x75fc('0x45')](_0x75fc('0x48'),_0x12b8a1,util[_0x75fc('0x46')](_0xb50e9f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x29')]=function(){logger['error'](_0x75fc('0x49'));clearChannels(this[_0x75fc('0x3c')]);this[_0x75fc('0x4a')](this[_0x75fc('0x13')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x75fc('0x16')]);clearCampaigns(this[_0x75fc('0x18')]);};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x4a')]=function(_0x22bf05){var _0x45000d=this;if(!_[_0x75fc('0x33')](_0x22bf05)){for(var _0x2e43a6 in _0x22bf05){if(_0x22bf05['hasOwnProperty'](_0x2e43a6)){_0x45000d[_0x75fc('0x4b')](_0x22bf05[_0x2e43a6],_0x75fc('0x4c'));delete _0x22bf05[_0x2e43a6];}}}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x4d')]=function(_0x2332a9,_0x443e1b,_0x4a8db7){io['to'](_0x2332a9)[_0x75fc('0x4d')](_0x443e1b,_0x4a8db7);};VoiceQueueReport[_0x75fc('0xe')]['emitVoiceQueueChannelSave']=function(_0x3df7ff,_0x365a45){logger[_0x75fc('0x4e')](_0x75fc('0x4f')+_0x365a45+_0x75fc('0x50'),_0x3df7ff['uniqueid'],util[_0x75fc('0x46')](_0x3df7ff,{'showHidden':![],'depth':null}));this['emit'](util[_0x75fc('0x51')](_0x75fc('0x52'),_0x3df7ff[_0x75fc('0x53')]),_0x75fc('0x54'),_0x3df7ff);io[_0x75fc('0x4d')](_0x75fc('0x55'),_0x3df7ff);};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x4b')]=function(_0x1541ef,_0x58c57d){logger[_0x75fc('0x4e')](_0x75fc('0x4f')+_0x58c57d+_0x75fc('0x56'),_0x1541ef[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x1541ef,{'showHidden':![],'depth':null}));this['emit'](util[_0x75fc('0x51')](_0x75fc('0x52'),_0x1541ef[_0x75fc('0x53')]),'voice_queue_channel:remove',_0x1541ef);io[_0x75fc('0x4d')](_0x75fc('0x58'),_0x1541ef);};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x59')]=function(_0x387f33,_0x2fcd4b){if(_0x387f33[_0x75fc('0x5a')]==='inbound'){var _0x15327b={'id':_0x387f33['id'],'name':_0x387f33[_0x75fc('0x53')],'strategy':_0x387f33['strategy'],'answered':_0x387f33[_0x75fc('0x5b')],'available':_0x387f33[_0x75fc('0x5c')],'loggedIn':_0x387f33[_0x75fc('0x5d')],'pTalking':_0x387f33['pTalking'],'sumBillable':_0x387f33[_0x75fc('0x5e')],'sumDuration':_0x387f33['sumDuration'],'sumHoldTime':_0x387f33['sumHoldTime']||0x0,'talking':_0x387f33['talking'],'total':_0x387f33[_0x75fc('0x5f')],'type':_0x387f33[_0x75fc('0x5a')],'unmanaged':_0x387f33[_0x75fc('0x60')],'abandoned':_0x387f33['abandoned'],'waiting':_0x387f33[_0x75fc('0x38')]};if(_0x387f33['Trunk']){_0x15327b[_0x75fc('0x61')]={'id':_0x387f33[_0x75fc('0x61')]['id'],'name':_0x387f33[_0x75fc('0x61')][_0x75fc('0x53')],'active':_0x387f33['Trunk'][_0x75fc('0x62')],'callerid':_0x387f33[_0x75fc('0x61')][_0x75fc('0x63')]};}if(_0x387f33[_0x75fc('0x64')]){_0x15327b[_0x75fc('0x64')]={'id':_0x387f33[_0x75fc('0x64')]['id'],'name':_0x387f33[_0x75fc('0x64')]['name']};}var _0x35a013=md5(JSON['stringify'](_0x15327b));if(_0x387f33[_0x75fc('0x3')]!==_0x35a013){_0x387f33[_0x75fc('0x3')]=_0x35a013;logger[_0x75fc('0x4e')](_0x75fc('0x65')+_0x2fcd4b+_0x75fc('0x66'),util[_0x75fc('0x46')](_0x15327b,{'showHidden':![],'depth':null}));this[_0x75fc('0x4d')](util[_0x75fc('0x51')](_0x75fc('0x52'),_0x15327b['name']),_0x75fc('0x67'),_0x15327b);}}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x68')]=function(_0xec2c6c){return _0xec2c6c!==null&&!_['isUndefined'](_0xec2c6c);};VoiceQueueReport['prototype'][_0x75fc('0x69')]=function(){var _0x491e7c=this;setInterval(function(){_0x491e7c[_0x75fc('0x3b')]();ami[_0x75fc('0x3f')]({'action':_0x75fc('0x6a')})[_0x75fc('0x42')](function(_0x2b0c59){logger[_0x75fc('0x45')](_0x75fc('0x6b'),util[_0x75fc('0x46')](_0x2b0c59,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x32')]=function(){var _0x4e9daf=this;setInterval(function(){if(_0x4e9daf[_0x75fc('0x17')]){return ami[_0x75fc('0x3f')]({'action':_0x75fc('0x6c')})['then'](function(_0x5d1819){_0x4e9daf[_0x75fc('0x17')]=![];})[_0x75fc('0x42')](function(_0x395656){logger[_0x75fc('0x45')]('[voiceQueueReport][queuesummary]',util[_0x75fc('0x46')](_0x395656,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x75fc('0xe')]['syncQueueSummary']=function(_0x1eabdf){try{if(this['isNotNull'](_0x1eabdf)&&this[_0x75fc('0x68')](_0x1eabdf[_0x75fc('0x6d')])){logger[_0x75fc('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x75fc('0x46')](_0x1eabdf,{'showHidden':![],'depth':null}));if(this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]]){logger[_0x75fc('0x6e')](_0x75fc('0x6f'),_0x1eabdf[_0x75fc('0x6d')]);var _0x8ee55a=_[_0x75fc('0x70')](this[_0x75fc('0x3c')],'queue')[_0x1eabdf['queue']]||0x0;var _0x40ce47=_0x8ee55a-_0x1eabdf['callers'];if(this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]]['waiting']!==_[_0x75fc('0x71')](_0x1eabdf[_0x75fc('0x72')])||this['voiceQueues'][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x5d')]!==_[_0x75fc('0x71')](_0x1eabdf['loggedin'])||this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x5c')]!==_[_0x75fc('0x71')](_0x1eabdf[_0x75fc('0x5c')])||this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]]['talking']!==_0x40ce47){this[_0x75fc('0x16')][_0x1eabdf['queue']]['waiting']=_['toNumber'](_0x1eabdf[_0x75fc('0x72')]);this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x5d')]=_['toNumber'](_0x1eabdf[_0x75fc('0x73')]);this[_0x75fc('0x16')][_0x1eabdf['queue']][_0x75fc('0x5c')]=_[_0x75fc('0x71')](_0x1eabdf['available']);this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x36')]=_0x40ce47>0x0?_0x40ce47:0x0;this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x36')]=this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x36')]>_[_0x75fc('0x71')](_0x1eabdf['loggedin'])?_[_0x75fc('0x71')](_0x1eabdf[_0x75fc('0x73')]):this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]][_0x75fc('0x36')];this['emitVoiceQueueSummary'](this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]],'queuesummary');}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x75fc('0x46')](this[_0x75fc('0x16')][_0x1eabdf[_0x75fc('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x75fc('0x4d')](_0x75fc('0x74'),this[_0x75fc('0x16')][_0x1eabdf['queue']]);}}}catch(_0x4eed0b){logger[_0x75fc('0x45')](_0x75fc('0x75'),util['inspect'](_0x4eed0b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x75fc('0x1b')]=function(_0x3091d7){logger[_0x75fc('0x4e')](_0x75fc('0x76'),util['inspect'](_0x3091d7,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x75fc('0xe')]['syncQueueCallerJoin']=function(_0x3ae3e9){try{if(this[_0x75fc('0x68')](_0x3ae3e9)){logger[_0x75fc('0x4e')](_0x75fc('0x77'),_0x3ae3e9[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x3ae3e9,{'showHidden':![],'depth':null}));if(_[_0x75fc('0x78')](this[_0x75fc('0x13')][_0x3ae3e9[_0x75fc('0x57')]]))this['queueReports'][_0x3ae3e9[_0x75fc('0x57')]]=[];if(_[_0x75fc('0x78')](this[_0x75fc('0x3c')][_0x3ae3e9[_0x75fc('0x57')]]))this[_0x75fc('0x3c')][_0x3ae3e9['uniqueid']]={};var _0x1e74e0=new QueueReport();_0x1e74e0['name']=_0x3ae3e9[_0x75fc('0x6d')];_0x1e74e0[_0x75fc('0x5a')]=this[_0x75fc('0x16')][_0x1e74e0[_0x75fc('0x53')]]&&this[_0x75fc('0x16')][_0x1e74e0['name']][_0x75fc('0x5a')]?this[_0x75fc('0x16')][_0x1e74e0[_0x75fc('0x53')]][_0x75fc('0x5a')]||_0x75fc('0x79'):'inbound';_0x1e74e0[_0x75fc('0x6d')]=_0x3ae3e9[_0x75fc('0x6d')];_0x1e74e0[_0x75fc('0x7a')]=moment()[_0x75fc('0x51')](_0x75fc('0x7b'));_0x1e74e0[_0x75fc('0x7c')]=_0x3ae3e9['position'];_0x1e74e0['count']=_0x3ae3e9[_0x75fc('0x7d')];_0x1e74e0[_0x75fc('0x57')]=_0x3ae3e9[_0x75fc('0x57')];_0x1e74e0[_0x75fc('0x7e')]=this[_0x75fc('0x3c')][_0x3ae3e9[_0x75fc('0x57')]][_0x75fc('0x7e')];logger[_0x75fc('0x6e')](_0x75fc('0x7f'),_0x1e74e0['name'],_0x1e74e0[_0x75fc('0x5a')]);_[_0x75fc('0x80')](_0x1e74e0,_[_0x75fc('0x81')](_0x3ae3e9,_['keys'](_0x1e74e0)));this['queueReports'][_0x3ae3e9[_0x75fc('0x57')]][_0x75fc('0x82')](_0x1e74e0);this[_0x75fc('0x3c')][_0x3ae3e9[_0x75fc('0x57')]]=_0x1e74e0;this[_0x75fc('0x83')](_0x1e74e0,_0x75fc('0x1d'));}}catch(_0x50dda7){logger[_0x75fc('0x45')](_0x75fc('0x77'),_0x3ae3e9[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x50dda7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x75fc('0x20')]=function(_0xb31044){try{if(this['isNotNull'](_0xb31044)){logger[_0x75fc('0x4e')](_0x75fc('0x84'),_0xb31044[_0x75fc('0x57')],util[_0x75fc('0x46')](_0xb31044,{'showHidden':![],'depth':null}));if(this[_0x75fc('0x13')][_0xb31044[_0x75fc('0x57')]]){var _0x30dd19=_['last'](this[_0x75fc('0x13')][_0xb31044['uniqueid']]);_0x30dd19['queuecallercomplete']=![];_0x30dd19[_0x75fc('0x85')]=null;_0x30dd19['holdtime']=_0xb31044[_0x75fc('0x86')];_0x30dd19[_0x75fc('0x87')]=_0xb31044['originalposition'];_0x30dd19[_0x75fc('0x1f')]=!![];_0x30dd19[_0x75fc('0x88')]=moment()[_0x75fc('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x30dd19[_0x75fc('0x89')]=_0x75fc('0x8a');_0x30dd19[_0x75fc('0x8b')]=null;logger[_0x75fc('0x6e')](_0x75fc('0x8c'),_0x30dd19['name'],_0x30dd19['type']);this[_0x75fc('0x3c')][_0xb31044['uniqueid']]=_0x30dd19;this[_0x75fc('0x4b')](_0x30dd19,'queuecallerabandon');}}}catch(_0xc67199){logger[_0x75fc('0x45')](_0x75fc('0x84'),_0xb31044['uniqueid'],util[_0x75fc('0x46')](_0xc67199,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x22')]=function(_0x3f32bf){try{if(this[_0x75fc('0x68')](_0x3f32bf)){logger[_0x75fc('0x4e')](_0x75fc('0x8d'),_0x3f32bf[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x3f32bf,{'showHidden':![],'depth':null}));if(this[_0x75fc('0x13')][_0x3f32bf[_0x75fc('0x57')]]){var _0x4449fa=_[_0x75fc('0x8e')](this[_0x75fc('0x13')][_0x3f32bf[_0x75fc('0x57')]]);_0x4449fa[_0x75fc('0x8f')]=moment()[_0x75fc('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4449fa[_0x75fc('0x90')]=_0x3f32bf[_0x75fc('0x90')];_0x4449fa['connectedlinename']=_0x3f32bf['connectedlinename'];logger[_0x75fc('0x6e')](_0x75fc('0x91'),_0x4449fa[_0x75fc('0x53')],_0x4449fa[_0x75fc('0x5a')],_0x3f32bf[_0x75fc('0x90')],_0x3f32bf[_0x75fc('0x92')]);this[_0x75fc('0x3c')][_0x3f32bf[_0x75fc('0x57')]]=_0x4449fa;this[_0x75fc('0x83')](_0x4449fa,_0x75fc('0x21'));}}}catch(_0x3ce96a){logger[_0x75fc('0x45')](_0x75fc('0x8d'),_0x3f32bf['uniqueid'],util[_0x75fc('0x46')](_0x3ce96a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x25')]=function(_0x6fcb6e){try{if(this[_0x75fc('0x68')](_0x6fcb6e)){logger['debug'](_0x75fc('0x93'),_0x6fcb6e[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x6fcb6e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x6fcb6e['uniqueid']]){var _0x5c4c05=_[_0x75fc('0x8e')](this[_0x75fc('0x13')][_0x6fcb6e['uniqueid']]);_0x5c4c05[_0x75fc('0x94')]=!![];_0x5c4c05[_0x75fc('0x89')]=_0x75fc('0x95');logger[_0x75fc('0x6e')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5c4c05['name'],_0x5c4c05[_0x75fc('0x5a')]);}}}catch(_0x26eac2){logger[_0x75fc('0x45')](_0x75fc('0x93'),_0x6fcb6e[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x26eac2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x24')]=function(_0x211526){try{if(this['isNotNull'](_0x211526)){logger['debug'](_0x75fc('0x96'),_0x211526[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x211526,{'showHidden':![],'depth':null}));if(this[_0x75fc('0x13')][_0x211526['uniqueid']]){var _0x20fb15=_[_0x75fc('0x8e')](this[_0x75fc('0x13')][_0x211526[_0x75fc('0x57')]]);_0x20fb15[_0x75fc('0x1f')]=![];_0x20fb15['queuecallerabandonAt']=null;_0x20fb15['assigned']=!![];_0x20fb15[_0x75fc('0x8b')]=_0x211526['membername'];_0x20fb15['holdtime']=_0x211526[_0x75fc('0x86')];_0x20fb15['queuecallercomplete']=!![];_0x20fb15[_0x75fc('0x97')]=![];_0x20fb15[_0x75fc('0x98')]=null;if(!_0x20fb15['transfer']){if(_0x211526['reason']==_0x75fc('0x99')){_0x20fb15[_0x75fc('0x89')]=_0x75fc('0x9a');logger[_0x75fc('0x6e')](_0x75fc('0x9b'),_0x20fb15[_0x75fc('0x53')],_0x20fb15[_0x75fc('0x5a')]);}else{if(_[_0x75fc('0x9c')](_0x211526[_0x75fc('0x41')]['toLowerCase'](),_0x75fc('0x9d'))){if(this[_0x75fc('0x13')][_0x211526[_0x75fc('0x9e')]]){var _0x2adde5=_['last'](this['queueReports'][_0x211526[_0x75fc('0x9e')]]);_0x2adde5[_0x75fc('0x94')]=![];_0x2adde5[_0x75fc('0x97')]=!![];_0x2adde5[_0x75fc('0x98')]=moment(_0x20fb15['queuecallerjoinAt'])[_0x75fc('0x9f')](_0x211526[_0x75fc('0x86')],_0x75fc('0xa0'))['format'](_0x75fc('0x7b'));_0x2adde5[_0x75fc('0x89')]='FORWARDTRANSFER';_0x2adde5[_0x75fc('0x99')]=!![];_0x2adde5[_0x75fc('0xa1')]='FORWARD';_0x2adde5[_0x75fc('0xa2')]=_0x211526[_0x75fc('0xa3')];_0x2adde5[_0x75fc('0xa4')]=_0x211526[_0x75fc('0x57')];logger['info'](_0x75fc('0xa5'),_0x2adde5[_0x75fc('0x53')],_0x2adde5[_0x75fc('0x5a')]);var _0x24c74b=this['queueReports'][_0x211526['linkedid']];this[_0x75fc('0x13')][_0x211526[_0x75fc('0x9e')]]=this['queueReports'][_0x211526[_0x75fc('0x57')]];this[_0x75fc('0x13')][_0x211526[_0x75fc('0x57')]]=_0x24c74b;}}else{_0x20fb15[_0x75fc('0x89')]=_0x75fc('0xa6')+_0x211526[_0x75fc('0xa7')]['toUpperCase']();logger[_0x75fc('0x6e')](_0x75fc('0xa8'),_0x20fb15[_0x75fc('0x53')],_0x20fb15[_0x75fc('0x5a')],_0x20fb15[_0x75fc('0x89')]);}}}this[_0x75fc('0x3c')][_0x211526[_0x75fc('0x57')]]=_0x20fb15;this[_0x75fc('0x4b')](_0x20fb15,'agentcomplete');}}}catch(_0x49b214){logger[_0x75fc('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x211526[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x49b214,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0x27')]=function(_0x3c4487){try{if(this[_0x75fc('0x68')](_0x3c4487)){logger[_0x75fc('0x4e')](_0x75fc('0xa9'),_0x3c4487[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x3c4487,{'showHidden':![],'depth':null}));this[_0x75fc('0xaa')](_0x3c4487[_0x75fc('0x57')],_[_0x75fc('0xab')](_0x3c4487[_0x75fc('0xac')])[0x0],_0x3c4487[_0x75fc('0xad')]);if(this[_0x75fc('0x13')][_0x3c4487[_0x75fc('0x57')]]){var _0x1012d1=_['last'](this[_0x75fc('0x13')][_0x3c4487[_0x75fc('0x57')]]);if(_0x1012d1){if(this['isNotNull'](_0x3c4487[_0x75fc('0xac')])&&this[_0x75fc('0x68')](_0x3c4487[_0x75fc('0xac')]['queuestatus'])){switch(_0x3c4487['value']){case'CONTINUE':_0x1012d1[_0x75fc('0x97')]=![];_0x1012d1['queuecallerexitAt']=null;break;case _0x75fc('0xae'):_0x1012d1[_0x75fc('0xaf')]=_0x75fc('0xb0');_0x1012d1[_0x75fc('0x97')]=!![];_0x1012d1['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1012d1[_0x75fc('0x8f')]=moment()[_0x75fc('0x51')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x75fc('0x4e')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3c4487[_0x75fc('0x57')],util[_0x75fc('0x46')](_0x1012d1,{'showHidden':![],'depth':null}));ami[_0x75fc('0x4d')]('custom:timeout',_0x1012d1);break;default:_0x1012d1[_0x75fc('0x97')]=!![];_0x1012d1[_0x75fc('0x98')]=moment()[_0x75fc('0x51')](_0x75fc('0x7b'));_0x1012d1['queuecallerleaveAt']=moment()[_0x75fc('0x51')](_0x75fc('0x7b'));}_0x1012d1[_0x75fc('0x1f')]=![];_0x1012d1[_0x75fc('0x88')]=null;_0x1012d1[_0x75fc('0x89')]=_0x3c4487[_0x75fc('0xad')];this['channels'][_0x3c4487[_0x75fc('0x57')]]=_0x1012d1;this['emitVoiceQueueChannelRemove'](_0x1012d1,_0x75fc('0x26'));}else if(this['isNotNull'](_0x3c4487[_0x75fc('0xac')])&&this[_0x75fc('0x68')](_0x3c4487[_0x75fc('0xac')][_0x75fc('0xb1')])){if(!_0x1012d1['queuecallerabandon']){_0x1012d1['queuecallerexit']=!![];_0x1012d1['queuecallerexitAt']=moment()[_0x75fc('0x51')](_0x75fc('0x7b'));_0x1012d1[_0x75fc('0x89')]=_0x75fc('0xb2');_0x1012d1[_0x75fc('0x8f')]=moment()[_0x75fc('0x51')](_0x75fc('0x7b'));this['channels'][_0x3c4487['uniqueid']]=_0x1012d1;}}logger['info'](_0x75fc('0xb3'),_0x3c4487['uniqueid'],_0x1012d1[_0x75fc('0x53')],_0x1012d1[_0x75fc('0x5a')],_[_0x75fc('0xab')](_0x3c4487['variable'])[0x0],_0x3c4487['value']);_0x1012d1['variables']=this[_0x75fc('0x19')][_0x3c4487[_0x75fc('0x57')]];}}}}catch(_0x4e88b5){logger[_0x75fc('0x45')](_0x75fc('0xa9'),_0x3c4487[_0x75fc('0x57')],util['inspect'](_0x4e88b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0xaa')]=function(_0x17f2c9,_0x1d0afc,_0x328558){var _0x4e1b2=[_0x75fc('0xb4'),_0x75fc('0xb5'),_0x75fc('0xb6'),_0x75fc('0xb7'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x75fc('0xb8'),'rtpaudioqosrttbridged',_0x75fc('0xb9'),'sipuri',_0x75fc('0xba'),'bridgepvtcallid','membercalls',_0x75fc('0xbb'),_0x75fc('0xbc'),_0x75fc('0xbd'),_0x75fc('0xbe'),_0x75fc('0xbf'),_0x75fc('0xc0')];if(!_[_0x75fc('0x3e')](_0x1d0afc)&&!_[_0x75fc('0xc1')](_0x4e1b2,_0x1d0afc)){if(_[_0x75fc('0x78')](this[_0x75fc('0x19')][_0x17f2c9])){this[_0x75fc('0x19')][_0x17f2c9]={};}this[_0x75fc('0x19')][_0x17f2c9][_0x1d0afc]=_0x328558;}};VoiceQueueReport[_0x75fc('0xe')][_0x75fc('0xc2')]=function(_0x285246){try{if(this['isNotNull'](_0x285246)){logger[_0x75fc('0x4e')](_0x75fc('0xc3'),_0x285246[_0x75fc('0x57')],util['inspect'](_0x285246,{'showHidden':![],'depth':null}));if(this[_0x75fc('0x13')][_0x285246[_0x75fc('0x57')]]){for(var _0x2fc33a=0x0,_0xa3d477={};_0x2fc33a0x0?_0x4b4f14:0x0;this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x6a')]=this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]['talking']>_[_0x6474('0x68')](_0x2a79d4['loggedin'])?_[_0x6474('0x68')](_0x2a79d4[_0x6474('0x6b')]):this[_0x6474('0x12')][_0x2a79d4['queue']]['talking'];this[_0x6474('0x4e')](this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]],'queuesummary');}logger[_0x6474('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x6474('0x3d')](this['voiceQueues'][_0x2a79d4['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x6474('0x6c'),this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]);}}}catch(_0x3fde0e){logger['error'](_0x6474('0x6d'),util['inspect'](_0x3fde0e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x18')]=function(_0x54e211){logger['debug'](_0x6474('0x6e'),util[_0x6474('0x3d')](_0x54e211,{'showHidden':![],'depth':null}));this[_0x6474('0x13')]=!![];};VoiceQueueReport[_0x6474('0xb')]['syncQueueCallerJoin']=function(_0x5786f1){try{if(this[_0x6474('0x5e')](_0x5786f1)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5786f1[_0x6474('0x47')],util[_0x6474('0x3d')](_0x5786f1,{'showHidden':![],'depth':null}));if(_[_0x6474('0x6f')](this[_0x6474('0xf')][_0x5786f1[_0x6474('0x47')]]))this['queueReports'][_0x5786f1['uniqueid']]=[];if(_[_0x6474('0x6f')](this[_0x6474('0x36')][_0x5786f1['uniqueid']]))this['channels'][_0x5786f1[_0x6474('0x47')]]={};var _0x55537a=new QueueReport();_0x55537a[_0x6474('0x4a')]=_0x5786f1[_0x6474('0x62')];_0x55537a[_0x6474('0x4f')]=this[_0x6474('0x12')][_0x55537a[_0x6474('0x4a')]]&&this[_0x6474('0x12')][_0x55537a['name']][_0x6474('0x4f')]?this[_0x6474('0x12')][_0x55537a[_0x6474('0x4a')]][_0x6474('0x4f')]||_0x6474('0x50'):_0x6474('0x50');_0x55537a[_0x6474('0x62')]=_0x5786f1[_0x6474('0x62')];_0x55537a[_0x6474('0x70')]=moment()['format'](_0x6474('0x71'));_0x55537a[_0x6474('0x72')]=_0x5786f1['position'];_0x55537a[_0x6474('0x73')]=_0x5786f1[_0x6474('0x73')];_0x55537a[_0x6474('0x47')]=_0x5786f1[_0x6474('0x47')];_0x55537a[_0x6474('0x74')]=this[_0x6474('0x36')][_0x5786f1[_0x6474('0x47')]][_0x6474('0x74')];logger[_0x6474('0x64')](_0x6474('0x75'),_0x55537a[_0x6474('0x4a')],_0x55537a[_0x6474('0x4f')]);_[_0x6474('0x76')](_0x55537a,_[_0x6474('0x77')](_0x5786f1,_[_0x6474('0x78')](_0x55537a)));this[_0x6474('0xf')][_0x5786f1[_0x6474('0x47')]][_0x6474('0x79')](_0x55537a);this[_0x6474('0x36')][_0x5786f1[_0x6474('0x47')]]=_0x55537a;this['emitVoiceQueueChannelSave'](_0x55537a,_0x6474('0x19'));}}catch(_0x3f049d){logger[_0x6474('0x3c')](_0x6474('0x7a'),_0x5786f1[_0x6474('0x47')],util[_0x6474('0x3d')](_0x3f049d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x3a7657){try{if(this[_0x6474('0x5e')](_0x3a7657)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3a7657[_0x6474('0x47')],util[_0x6474('0x3d')](_0x3a7657,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a7657['uniqueid']]){var _0xee5d6f=_['last'](this[_0x6474('0xf')][_0x3a7657[_0x6474('0x47')]]);_0xee5d6f[_0x6474('0x7b')]=![];_0xee5d6f[_0x6474('0x7c')]=null;_0xee5d6f['holdtime']=_0x3a7657['holdtime'];_0xee5d6f[_0x6474('0x7d')]=_0x3a7657[_0x6474('0x7d')];_0xee5d6f[_0x6474('0x7e')]=!![];_0xee5d6f[_0x6474('0x7f')]=moment()[_0x6474('0x48')](_0x6474('0x71'));_0xee5d6f[_0x6474('0x80')]=_0x6474('0x81');_0xee5d6f['lastAssignedTo']=null;logger['info'](_0x6474('0x82'),_0xee5d6f[_0x6474('0x4a')],_0xee5d6f[_0x6474('0x4f')]);this[_0x6474('0x36')][_0x3a7657[_0x6474('0x47')]]=_0xee5d6f;this['emitVoiceQueueChannelRemove'](_0xee5d6f,_0x6474('0x7e'));}}}catch(_0x49116c){logger['error'](_0x6474('0x83'),_0x3a7657[_0x6474('0x47')],util[_0x6474('0x3d')](_0x49116c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6474('0x1c')]=function(_0x1de164){try{if(this[_0x6474('0x5e')](_0x1de164)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1de164[_0x6474('0x47')],util[_0x6474('0x3d')](_0x1de164,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1de164[_0x6474('0x47')]]){var _0x4bce6b=_['last'](this['queueReports'][_0x1de164[_0x6474('0x47')]]);_0x4bce6b[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x4bce6b[_0x6474('0x85')]=_0x1de164[_0x6474('0x85')];_0x4bce6b[_0x6474('0x86')]=_0x1de164[_0x6474('0x86')];logger[_0x6474('0x64')](_0x6474('0x87'),_0x4bce6b[_0x6474('0x4a')],_0x4bce6b['type'],_0x1de164[_0x6474('0x85')],_0x1de164[_0x6474('0x86')]);this[_0x6474('0x36')][_0x1de164['uniqueid']]=_0x4bce6b;this[_0x6474('0x44')](_0x4bce6b,_0x6474('0x1b'));}}}catch(_0x160f09){logger['error'](_0x6474('0x88'),_0x1de164['uniqueid'],util[_0x6474('0x3d')](_0x160f09,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x20')]=function(_0x3e1e5e){try{if(this[_0x6474('0x5e')](_0x3e1e5e)){logger[_0x6474('0x45')](_0x6474('0x89'),_0x3e1e5e[_0x6474('0x47')],util['inspect'](_0x3e1e5e,{'showHidden':![],'depth':null}));if(this[_0x6474('0xf')][_0x3e1e5e[_0x6474('0x47')]]){var _0x1153d4=_['last'](this[_0x6474('0xf')][_0x3e1e5e[_0x6474('0x47')]]);_0x1153d4['queuecallercomplete']=!![];_0x1153d4[_0x6474('0x80')]=_0x6474('0x8a');logger[_0x6474('0x64')](_0x6474('0x8b'),_0x1153d4[_0x6474('0x4a')],_0x1153d4['type']);}}}catch(_0x1871b5){logger['error'](_0x6474('0x89'),_0x3e1e5e[_0x6474('0x47')],util[_0x6474('0x3d')](_0x1871b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6474('0x1e')]=function(_0x352e2a){try{if(this[_0x6474('0x5e')](_0x352e2a)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x352e2a[_0x6474('0x47')],util[_0x6474('0x3d')](_0x352e2a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x352e2a[_0x6474('0x47')]]){var _0x53911f=_[_0x6474('0x8c')](this[_0x6474('0xf')][_0x352e2a[_0x6474('0x47')]]);_0x53911f[_0x6474('0x7e')]=![];_0x53911f[_0x6474('0x7f')]=null;_0x53911f['assigned']=!![];_0x53911f[_0x6474('0x8d')]=_0x352e2a[_0x6474('0x8e')];_0x53911f[_0x6474('0x8f')]=_0x352e2a[_0x6474('0x8f')];_0x53911f[_0x6474('0x7b')]=!![];_0x53911f['queuecallerexit']=![];_0x53911f[_0x6474('0x90')]=null;if(!_0x53911f[_0x6474('0x91')]){if(_0x352e2a['reason']==_0x6474('0x91')){_0x53911f[_0x6474('0x80')]=_0x6474('0x92');logger['info'](_0x6474('0x93'),_0x53911f[_0x6474('0x4a')],_0x53911f[_0x6474('0x4f')]);}else{if(_[_0x6474('0x94')](_0x352e2a[_0x6474('0x95')][_0x6474('0x96')](),_0x6474('0x97'))){if(this[_0x6474('0xf')][_0x352e2a[_0x6474('0x98')]]){var _0x3d8cc0=_[_0x6474('0x8c')](this['queueReports'][_0x352e2a[_0x6474('0x98')]]);_0x3d8cc0[_0x6474('0x7b')]=![];_0x3d8cc0[_0x6474('0x99')]=!![];_0x3d8cc0[_0x6474('0x90')]=moment(_0x53911f[_0x6474('0x70')])['add'](_0x352e2a[_0x6474('0x8f')],_0x6474('0x9a'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d8cc0['queuecallerexitreason']=_0x6474('0x9b');_0x3d8cc0['transfer']=!![];_0x3d8cc0[_0x6474('0x9c')]='FORWARD';_0x3d8cc0[_0x6474('0x9d')]=_0x352e2a[_0x6474('0x9e')];_0x3d8cc0['transferuniqueid']=_0x352e2a[_0x6474('0x47')];logger[_0x6474('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3d8cc0[_0x6474('0x4a')],_0x3d8cc0['type']);var _0xdd8966=this[_0x6474('0xf')][_0x352e2a['linkedid']];this[_0x6474('0xf')][_0x352e2a[_0x6474('0x98')]]=this[_0x6474('0xf')][_0x352e2a['uniqueid']];this[_0x6474('0xf')][_0x352e2a[_0x6474('0x47')]]=_0xdd8966;}}else{_0x53911f['queuecallerexitreason']=_0x6474('0x9f')+_0x352e2a[_0x6474('0xa0')][_0x6474('0xa1')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x53911f[_0x6474('0x4a')],_0x53911f[_0x6474('0x4f')],_0x53911f['queuecallerexitreason']);}}}this[_0x6474('0x36')][_0x352e2a[_0x6474('0x47')]]=_0x53911f;this[_0x6474('0x42')](_0x53911f,'agentcomplete');}}}catch(_0x445b85){logger[_0x6474('0x3c')](_0x6474('0xa2'),_0x352e2a['uniqueid'],util[_0x6474('0x3d')](_0x445b85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')]['syncVarSet']=function(_0x528400){try{if(this[_0x6474('0x5e')](_0x528400)){logger[_0x6474('0x45')](_0x6474('0xa3'),_0x528400['uniqueid'],util[_0x6474('0x3d')](_0x528400,{'showHidden':![],'depth':null}));this['addVariable'](_0x528400[_0x6474('0x47')],_[_0x6474('0x78')](_0x528400['variable'])[0x0],_0x528400[_0x6474('0xa4')]);if(this['queueReports'][_0x528400[_0x6474('0x47')]]){var _0x530fcb=_['last'](this[_0x6474('0xf')][_0x528400[_0x6474('0x47')]]);if(_0x530fcb){if(this[_0x6474('0x5e')](_0x528400[_0x6474('0xa5')])&&this[_0x6474('0x5e')](_0x528400['variable']['queuestatus'])){switch(_0x528400[_0x6474('0xa4')]){case _0x6474('0xa6'):_0x530fcb[_0x6474('0x99')]=![];_0x530fcb[_0x6474('0x90')]=null;break;case _0x6474('0xa7'):_0x530fcb[_0x6474('0xa8')]=_0x6474('0xa9');_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb[_0x6474('0x90')]=moment()[_0x6474('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x530fcb[_0x6474('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6474('0x45')](_0x6474('0xaa'),_0x528400[_0x6474('0x47')],util[_0x6474('0x3d')](_0x530fcb,{'showHidden':![],'depth':null}));ami['emit'](_0x6474('0xab'),_0x530fcb);break;default:_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb['queuecallerexitAt']=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x530fcb[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));}_0x530fcb[_0x6474('0x7e')]=![];_0x530fcb[_0x6474('0x7f')]=null;_0x530fcb['queuecallerexitreason']=_0x528400[_0x6474('0xa4')];this[_0x6474('0x36')][_0x528400['uniqueid']]=_0x530fcb;this[_0x6474('0x42')](_0x530fcb,'varset');}else if(this['isNotNull'](_0x528400['variable'])&&this[_0x6474('0x5e')](_0x528400['variable'][_0x6474('0xac')])){if(!_0x530fcb[_0x6474('0x7e')]){_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb['queuecallerexitAt']=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x530fcb['queuecallerexitreason']=_0x6474('0xad');_0x530fcb[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));this['channels'][_0x528400[_0x6474('0x47')]]=_0x530fcb;}}logger[_0x6474('0x64')](_0x6474('0xae'),_0x528400[_0x6474('0x47')],_0x530fcb[_0x6474('0x4a')],_0x530fcb['type'],_['keys'](_0x528400[_0x6474('0xa5')])[0x0],_0x528400[_0x6474('0xa4')]);_0x530fcb[_0x6474('0x3f')]=this[_0x6474('0x3f')][_0x528400['uniqueid']];}}}}catch(_0xca8e47){logger[_0x6474('0x3c')](_0x6474('0xa3'),_0x528400[_0x6474('0x47')],util[_0x6474('0x3d')](_0xca8e47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0xaf')]=function(_0x2589f2,_0x20076c,_0x1d8cee){var _0x121389=[_0x6474('0xb0'),_0x6474('0xb1'),_0x6474('0xb2'),_0x6474('0xb3'),_0x6474('0xb4'),'rtpaudioqoslossbridged',_0x6474('0xb5'),_0x6474('0xb6'),_0x6474('0xb7'),_0x6474('0xb8'),_0x6474('0xb9'),_0x6474('0xba'),_0x6474('0xbb'),_0x6474('0xbc'),_0x6474('0xbd'),_0x6474('0xbe'),_0x6474('0x8e'),'memberpenalty',_0x6474('0xbf')];if(!_[_0x6474('0xc0')](_0x20076c)&&!_[_0x6474('0xc1')](_0x121389,_0x20076c)){if(_[_0x6474('0x6f')](this[_0x6474('0x3f')][_0x2589f2])){this[_0x6474('0x3f')][_0x2589f2]={};}this[_0x6474('0x3f')][_0x2589f2][_0x20076c]=_0x1d8cee;}};VoiceQueueReport[_0x6474('0xb')]['syncHangup']=function(_0x5df8db){try{if(this[_0x6474('0x5e')](_0x5df8db)){logger[_0x6474('0x45')](_0x6474('0xc2'),_0x5df8db['uniqueid'],util[_0x6474('0x3d')](_0x5df8db,{'showHidden':![],'depth':null}));if(this[_0x6474('0xf')][_0x5df8db[_0x6474('0x47')]]){for(var _0x20feb4=0x0,_0x13d308={};_0x20feb4=0x0?moment(_0x408c4d[_0x0f2e('0x18')])[_0x0f2e('0xc')](_0x408c4d[_0x0f2e('0x17')],_0x0f2e('0xe')):null,'data1':_0x0f2e('0x19'),'data2':_0x408c4d[_0x0f2e('0x12')],'data3':_0x408c4d['exten'],'data4':_0x408c4d[_0x0f2e('0x1a')]||null,'role':_0x0f2e('0x11'),'internal':_0x408c4d[_0x0f2e('0x12')]?_['toNumber'](_0x408c4d[_0x0f2e('0x12')]):undefined,'uniqueid':_0x408c4d[_0x0f2e('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x6292=['uniqueid','voiceDialReport','Request','starttime','endtime','seconds','outbound','util','queuecallercompleteAt','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','inbound','calleridnum','exten','queue','agent','accountcode','toNumber'];(function(_0x3ddecf,_0x59f9ae){var _0x2b3427=function(_0x3f1cda){while(--_0x3f1cda){_0x3ddecf['push'](_0x3ddecf['shift']());}};_0x2b3427(++_0x59f9ae);}(_0x6292,0xd7));var _0x2629=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x6292[_0x25248b];return _0x509939;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x2629('0x0'));var client=require('../client');exports['voiceQueueReport']=function(_0x4a223e){var _0x3ecb2e=_0x4a223e[_0x2629('0x1')]||_0x4a223e['queuecallerexitAt'];return client['Request'](_0x2629('0x2'),{'body':{'channel':_0x2629('0x3'),'membername':_0x4a223e['lastAssignedTo'],'interface':_[_0x2629('0x4')](_0x4a223e[_0x2629('0x5')])?util[_0x2629('0x6')](_0x2629('0x7'),_0x4a223e[_0x2629('0x8')]):_0x4a223e[_0x2629('0x5')],'type':_0x2629('0x9'),'enterAt':_0x4a223e['queuecallerleaveAt'],'exitAt':_0x3ecb2e,'duration':moment(_0x3ecb2e)[_0x2629('0xa')](_0x4a223e[_0x2629('0xb')],'seconds'),'data1':_0x2629('0xc'),'data2':_0x4a223e[_0x2629('0xd')],'data3':_0x4a223e[_0x2629('0xe')],'data4':null,'data5':_0x4a223e[_0x2629('0xf')],'role':_0x2629('0x10'),'internal':_0x4a223e[_0x2629('0x11')]?_[_0x2629('0x12')](_0x4a223e[_0x2629('0x11')]):undefined,'uniqueid':_0x4a223e[_0x2629('0x13')]},'log':_0x2629('0x2')});};exports[_0x2629('0x14')]=function(_0xafb7de){return client[_0x2629('0x15')](_0x2629('0x2'),{'body':{'channel':_0x2629('0x3'),'membername':_0xafb7de['membername'],'interface':_0xafb7de[_0x2629('0x5')],'type':'TALKING','enterAt':_0xafb7de[_0x2629('0x16')],'exitAt':_0xafb7de[_0x2629('0x17')],'duration':moment(_0xafb7de[_0x2629('0x17')])[_0x2629('0xa')](_0xafb7de[_0x2629('0x16')],_0x2629('0x18'))>=0x0?moment(_0xafb7de[_0x2629('0x17')])[_0x2629('0xa')](_0xafb7de[_0x2629('0x16')],_0x2629('0x18')):null,'data1':_0x2629('0x19'),'data2':_0xafb7de[_0x2629('0x11')],'data3':_0xafb7de['exten'],'data4':_0xafb7de['dialstring']||null,'role':_0x2629('0x10'),'internal':_0xafb7de[_0x2629('0x11')]?_[_0x2629('0x12')](_0xafb7de[_0x2629('0x11')]):undefined,'uniqueid':_0xafb7de[_0x2629('0x13')]},'log':_0x2629('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5f22b02..5fb9ffa 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 _0xcb91=['GetSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x517046,_0x3bb4f8){var _0x3d87ca=function(_0x5191fe){while(--_0x5191fe){_0x517046['push'](_0x517046['shift']());}};_0x3d87ca(++_0x3bb4f8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcb91[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1cb9('0x2')]},'log':_0x1cb9('0x3')});}; \ No newline at end of file +var _0x9802=['GetSettings','../client','ShowSetting'];(function(_0x376095,_0xb8eb66){var _0x5ecd37=function(_0x149d59){while(--_0x149d59){_0x376095['push'](_0x376095['shift']());}};_0x5ecd37(++_0xb8eb66);}(_0x9802,0x112));var _0x2980=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9802[_0x1caf6a];return _0x1bf493;};'use strict';var client=require(_0x2980('0x0'));exports['getSettings']=function(){return client['Request'](_0x2980('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x2980('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 8b1c52b..96557e8 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 _0xf99c=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x34b53b,_0x5cdf08){var _0x2ca5fd=function(_0x284e6c){while(--_0x284e6c){_0x34b53b['push'](_0x34b53b['shift']());}};_0x2ca5fd(++_0x5cdf08);}(_0xf99c,0x129));var _0xcf99=function(_0x57f16e,_0x2214bf){_0x57f16e=_0x57f16e-0x0;var _0x16edf1=_0xf99c[_0x57f16e];return _0x16edf1;};'use strict';var client=require(_0xcf99('0x0'));exports[_0xcf99('0x1')]=function(_0x395855){return function(_0x161114){return client[_0xcf99('0x2')](_0xcf99('0x3'),{'options':{'raw':!![],'attributes':['id',_0xcf99('0x4'),_0xcf99('0x5')]},'log':_0xcf99('0x3')});};}; \ No newline at end of file +var _0x4148=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x973433,_0x2ff98c){var _0x364851=function(_0x12569e){while(--_0x12569e){_0x973433['push'](_0x973433['shift']());}};_0x364851(++_0x2ff98c);}(_0x4148,0x75));var _0x8414=function(_0x57ebed,_0xfac0ac){_0x57ebed=_0x57ebed-0x0;var _0x3a0874=_0x4148[_0x57ebed];return _0x3a0874;};'use strict';var client=require(_0x8414('0x0'));exports[_0x8414('0x1')]=function(_0x4842f5){return function(_0x5473b1){return client[_0x8414('0x2')](_0x8414('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8414('0x4'),_0x8414('0x5')]},'log':_0x8414('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 6e17df4..7a1d82a 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 _0x051a=['GetTrigger','name','channel','status','Condition','field','value','AnyConditions','operator','Action','Actions','action','data1','data4','data5','data6','data7','getTriggers','Request'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x051a,0xbc));var _0xa051=function(_0xd87ab1,_0x36eccd){_0xd87ab1=_0xd87ab1-0x0;var _0x487e83=_0x051a[_0xd87ab1];return _0x487e83;};'use strict';var client=require('../client');exports[_0xa051('0x0')]=function(_0x441ab4){return function(_0x1a55d1){return client[_0xa051('0x1')](_0xa051('0x2'),{'options':{'raw':![],'attributes':['id',_0xa051('0x3'),_0xa051('0x4'),_0xa051('0x5')],'include':[{'model':_0xa051('0x6'),'as':'AllConditions','attributes':['id',_0xa051('0x7'),'operator',_0xa051('0x8')]},{'model':_0xa051('0x6'),'as':_0xa051('0x9'),'attributes':['id',_0xa051('0x7'),_0xa051('0xa'),_0xa051('0x8')]},{'model':_0xa051('0xb'),'as':_0xa051('0xc'),'attributes':['id',_0xa051('0xd'),_0xa051('0xe'),'data2','data3',_0xa051('0xf'),_0xa051('0x10'),_0xa051('0x11'),_0xa051('0x12')]}]},'log':_0xa051('0x2')});};}; \ No newline at end of file +var _0xf421=['name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data4','data5','data6','getTriggers','GetTrigger'];(function(_0x410010,_0x5af3d6){var _0x56d362=function(_0x549bc3){while(--_0x549bc3){_0x410010['push'](_0x410010['shift']());}};_0x56d362(++_0x5af3d6);}(_0xf421,0x185));var _0x1f42=function(_0x4acf20,_0x3f4636){_0x4acf20=_0x4acf20-0x0;var _0x50eabc=_0xf421[_0x4acf20];return _0x50eabc;};'use strict';var client=require('../client');exports[_0x1f42('0x0')]=function(_0x1d00ee){return function(_0x57d568){return client['Request'](_0x1f42('0x1'),{'options':{'raw':![],'attributes':['id',_0x1f42('0x2'),_0x1f42('0x3'),'status'],'include':[{'model':_0x1f42('0x4'),'as':_0x1f42('0x5'),'attributes':['id','field',_0x1f42('0x6'),_0x1f42('0x7')]},{'model':_0x1f42('0x4'),'as':_0x1f42('0x8'),'attributes':['id',_0x1f42('0x9'),_0x1f42('0x6'),_0x1f42('0x7')]},{'model':_0x1f42('0xa'),'as':_0x1f42('0xb'),'attributes':['id',_0x1f42('0xc'),_0x1f42('0xd'),'data2','data3',_0x1f42('0xe'),_0x1f42('0xf'),_0x1f42('0x10'),'data7']}]},'log':_0x1f42('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 61c5358..32d8e55 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 _0x66d9=['getTrunks','Request','registry','defaultuser','../client'];(function(_0x55d0c8,_0x4bedc2){var _0x24396c=function(_0x2664de){while(--_0x2664de){_0x55d0c8['push'](_0x55d0c8['shift']());}};_0x24396c(++_0x4bedc2);}(_0x66d9,0x1e9));var _0x966d=function(_0x59cb10,_0x4e06b8){_0x59cb10=_0x59cb10-0x0;var _0x1c8235=_0x66d9[_0x59cb10];return _0x1c8235;};'use strict';var client=require(_0x966d('0x0'));exports[_0x966d('0x1')]=function(_0xd2e41f){return function(_0x193b2a){return client[_0x966d('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x966d('0x3'),_0x966d('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x3663=['defaultuser','../client','getTrunks','Request','GetTrunk','registry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3663,0x1cf));var _0x3366=function(_0x4663cf,_0x4045b2){_0x4663cf=_0x4663cf-0x0;var _0x5e7f76=_0x3663[_0x4663cf];return _0x5e7f76;};'use strict';var client=require(_0x3366('0x0'));exports[_0x3366('0x1')]=function(_0x164564){return function(_0x54bb91){return client[_0x3366('0x2')](_0x3366('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x3366('0x4'),_0x3366('0x5')]},'log':_0x3366('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index fd5b941..b3c6164 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x31ec99,_0x23a6d0){var _0x586649=function(_0x4205be){while(--_0x4205be){_0x31ec99['push'](_0x31ec99['shift']());}};_0x586649(++_0x23a6d0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xcb91[_0x352e09];return _0x1b7094;};'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 +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x34c94e,_0x8e575b){var _0x14a7b3=function(_0x6e12ae){while(--_0x6e12ae){_0x34c94e['push'](_0x34c94e['shift']());}};_0x14a7b3(++_0x8e575b);}(_0xedd9,0xfc));var _0x9edd=function(_0x18bdce,_0x46effc){_0x18bdce=_0x18bdce-0x0;var _0x178198=_0xedd9[_0x18bdce];return _0x178198;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e29e1c3..48e5d59 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 _0xc78f=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x4326eb,_0x1801c5){var _0x2735a3=function(_0x4b1f8d){while(--_0x4b1f8d){_0x4326eb['push'](_0x4326eb['shift']());}};_0x2735a3(++_0x1801c5);}(_0xc78f,0x113));var _0xfc78=function(_0x209d5f,_0x4671dd){_0x209d5f=_0x209d5f-0x0;var _0x5cb4ed=_0xc78f[_0x209d5f];return _0x5cb4ed;};'use strict';var client=require(_0xfc78('0x0'));exports[_0xfc78('0x1')]=function(_0x569405){return client[_0xfc78('0x2')]('CreateVoiceAgentReport',{'body':_0x569405,'log':_0xfc78('0x3')});};exports[_0xfc78('0x4')]=function(_0x35bbd3,_0x3d3056,_0x4fe46d){return client[_0xfc78('0x2')](_0xfc78('0x5'),{'body':_0x35bbd3,'options':{'where':{'uniqueid':_0x3d3056,'interface':_0x4fe46d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x42aa=['update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x42aa,0xd4));var _0xa42a=function(_0x2d8a65,_0x1aa855){_0x2d8a65=_0x2d8a65-0x0;var _0x10ab06=_0x42aa[_0x2d8a65];return _0x10ab06;};'use strict';var client=require(_0xa42a('0x0'));exports[_0xa42a('0x1')]=function(_0x38b6dd){return client[_0xa42a('0x2')]('CreateVoiceAgentReport',{'body':_0x38b6dd,'log':'CreateVoiceAgentReport'});};exports[_0xa42a('0x3')]=function(_0xbbb3c1,_0x24c08a,_0x2f83b3){return client[_0xa42a('0x2')]('UpdateVoiceAgentReport',{'body':_0xbbb3c1,'options':{'where':{'uniqueid':_0x24c08a,'interface':_0x2f83b3,'agentcomplete':!![]}},'log':_0xa42a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index bb40770..9a4d549 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 _0x1892=['lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x163107,_0x20f3c7){var _0x29fe96=function(_0x4c2a72){while(--_0x4c2a72){_0x163107['push'](_0x163107['shift']());}};_0x29fe96(++_0x20f3c7);}(_0x1892,0x166));var _0x2189=function(_0x94cba4,_0x54885e){_0x94cba4=_0x94cba4-0x0;var _0x165c80=_0x1892[_0x94cba4];return _0x165c80;};'use strict';var moment=require(_0x2189('0x0'));var util=require(_0x2189('0x1'));var _=require(_0x2189('0x2'));var client=require('../client');exports['create']=function(_0x50c107){return client[_0x2189('0x3')](_0x2189('0x4'),{'body':_[_0x2189('0x5')](_0x50c107,{'source':_0x50c107[_0x2189('0x6')],'destinationcontext':_0x50c107[_0x2189('0x7')],'callerid':_0x50c107['callerid'],'amaflags':_0x2189('0x8')}),'log':_0x2189('0x4')});};exports[_0x2189('0x9')]=function(){return function(){return client['Request'](_0x2189('0xa'),{'options':{'where':{'type':[_0x2189('0xb')],'createdAt':{'$between':[moment()[_0x2189('0xc')]('day')[_0x2189('0xd')](_0x2189('0xe')),moment()['endOf']('day')['format'](_0x2189('0xe'))]}},'attributes':[_0x2189('0xf'),_0x2189('0x10'),_0x2189('0x11'),_0x2189('0x12')]},'log':_0x2189('0x13')});};}; \ No newline at end of file +var _0xadc3=['DOCUMENTATION','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context','callerid'];(function(_0x475835,_0x3dd122){var _0x496aed=function(_0x24ab63){while(--_0x24ab63){_0x475835['push'](_0x475835['shift']());}};_0x496aed(++_0x3dd122);}(_0xadc3,0x15f));var _0x3adc=function(_0x206bd1,_0x4d72cd){_0x206bd1=_0x206bd1-0x0;var _0x5ca7ec=_0xadc3[_0x206bd1];return _0x5ca7ec;};'use strict';var moment=require(_0x3adc('0x0'));var util=require(_0x3adc('0x1'));var _=require(_0x3adc('0x2'));var client=require(_0x3adc('0x3'));exports[_0x3adc('0x4')]=function(_0x22988f){return client[_0x3adc('0x5')](_0x3adc('0x6'),{'body':_['merge'](_0x22988f,{'source':_0x22988f['calleridnum'],'destinationcontext':_0x22988f[_0x3adc('0x7')],'callerid':_0x22988f[_0x3adc('0x8')],'amaflags':_0x3adc('0x9')}),'log':_0x3adc('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x3adc('0x5')](_0x3adc('0xa'),{'options':{'where':{'type':[_0x3adc('0xb')],'createdAt':{'$between':[moment()[_0x3adc('0xc')]('day')[_0x3adc('0xd')](_0x3adc('0xe')),moment()[_0x3adc('0xf')](_0x3adc('0x10'))[_0x3adc('0xd')](_0x3adc('0xe'))]}},'attributes':[_0x3adc('0x11'),'disposition',_0x3adc('0x12'),_0x3adc('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 0ba8917..69ed773 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 _0xefa5=['Request','CreateVoiceDialReport','../client'];(function(_0x4c742f,_0x2bd40a){var _0x2913ae=function(_0x4e2759){while(--_0x4e2759){_0x4c742f['push'](_0x4c742f['shift']());}};_0x2913ae(++_0x2bd40a);}(_0xefa5,0x98));var _0x5efa=function(_0x42e4e0,_0x57ab9c){_0x42e4e0=_0x42e4e0-0x0;var _0x5ea33c=_0xefa5[_0x42e4e0];return _0x5ea33c;};'use strict';var client=require(_0x5efa('0x0'));exports['create']=function(_0x116457){return client[_0x5efa('0x1')](_0x5efa('0x2'),{'body':_0x116457,'log':_0x5efa('0x2')});}; \ No newline at end of file +var _0xb930=['CreateVoiceDialReport','../client','create'];(function(_0x5229b6,_0xef9d44){var _0x2f6d75=function(_0x379580){while(--_0x379580){_0x5229b6['push'](_0x5229b6['shift']());}};_0x2f6d75(++_0xef9d44);}(_0xb930,0x1bd));var _0x0b93=function(_0x1358a6,_0x11dfed){_0x1358a6=_0x1358a6-0x0;var _0x41cf1d=_0xb930[_0x1358a6];return _0x41cf1d;};'use strict';var client=require(_0x0b93('0x0'));exports[_0x0b93('0x1')]=function(_0x3a9565){return client['Request'](_0x0b93('0x2'),{'body':_0x3a9565,'log':_0x0b93('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index cadb0df..732a321 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 _0x255f=['Request','GetVoiceExtension','exten','getVoiceExtensions','../client'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x255f,0x185));var _0xf255=function(_0x2713e9,_0x153f2c){_0x2713e9=_0x2713e9-0x0;var _0x1fb067=_0x255f[_0x2713e9];return _0x1fb067;};'use strict';var client=require(_0xf255('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xf255('0x1')](_0xf255('0x2'),{'options':{'raw':!![],'attributes':['id',_0xf255('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf255('0x4')});};}; \ No newline at end of file +var _0xd757=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x256e71,_0x9e30cc){var _0x112a23=function(_0x3fd5e3){while(--_0x3fd5e3){_0x256e71['push'](_0x256e71['shift']());}};_0x112a23(++_0x9e30cc);}(_0xd757,0x1e5));var _0x7d75=function(_0x252423,_0x1f8c71){_0x252423=_0x252423-0x0;var _0x30daea=_0xd757[_0x252423];return _0x30daea;};'use strict';var client=require(_0x7d75('0x0'));exports[_0x7d75('0x1')]=function(){return function(){return client[_0x7d75('0x2')](_0x7d75('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x7d75('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index fb28921..d86af04 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 _0xb999=['dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','active','Pause','Trunk','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','name','acw','acwTimeout','autopause','monitor_format','type'];(function(_0x1325b2,_0x489ce1){var _0x1470ef=function(_0x1651f6){while(--_0x1651f6){_0x1325b2['push'](_0x1325b2['shift']());}};_0x1470ef(++_0x489ce1);}(_0xb999,0x173));var _0x9b99=function(_0x3347ec,_0x5a7168){_0x3347ec=_0x3347ec-0x0;var _0x52f1e9=_0xb999[_0x3347ec];return _0x52f1e9;};'use strict';var client=require('../client');exports[_0x9b99('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x9b99('0x1'),_0x9b99('0x2'),_0x9b99('0x3'),_0x9b99('0x4'),_0x9b99('0x5'),_0x9b99('0x6'),_0x9b99('0x7'),_0x9b99('0x8'),_0x9b99('0x9'),'dialLimitQueue',_0x9b99('0xa'),'dialPredictiveOptimization',_0x9b99('0xb'),'dialPredictiveInterval',_0x9b99('0xc'),_0x9b99('0xd'),'dialOriginateTimeout',_0x9b99('0xe'),_0x9b99('0xf'),_0x9b99('0x10'),'dialCongestionMaxRetry',_0x9b99('0x11'),_0x9b99('0x12'),_0x9b99('0x13'),_0x9b99('0x14'),_0x9b99('0x15'),_0x9b99('0x16'),'dialTimezone',_0x9b99('0x17'),_0x9b99('0x18'),_0x9b99('0x19'),_0x9b99('0x1a'),_0x9b99('0x1b'),_0x9b99('0x1c'),'dialAMDAfterGreetingSilence',_0x9b99('0x1d'),_0x9b99('0x1e'),_0x9b99('0x1f'),_0x9b99('0x20'),_0x9b99('0x21'),_0x9b99('0x22'),_0x9b99('0x23'),_0x9b99('0x24'),_0x9b99('0x25'),_0x9b99('0x26'),_0x9b99('0x27'),_0x9b99('0x28'),'dialQueueProject2',_0x9b99('0x5'),_0x9b99('0x29'),_0x9b99('0x2a'),_0x9b99('0x2b'),_0x9b99('0x2c'),'dialNoSuchNumberRetryFrequency',_0x9b99('0x2d'),_0x9b99('0x2e'),_0x9b99('0x2f'),_0x9b99('0x30'),_0x9b99('0x31'),_0x9b99('0x32'),'dialAgentRejectMaxRetry',_0x9b99('0x33'),_0x9b99('0x34'),_0x9b99('0x35'),_0x9b99('0x36')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name',_0x9b99('0x37'),_0x9b99('0x38')]},{'model':_0x9b99('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x9b99('0x1')]},{'model':_0x9b99('0x3a'),'as':_0x9b99('0x3b'),'attributes':['id',_0x9b99('0x1'),'callerid',_0x9b99('0x38')]},{'model':'Interval','as':_0x9b99('0x3c'),'attributes':['id',_0x9b99('0x1')],'include':[{'model':_0x9b99('0x3c'),'as':_0x9b99('0x3d'),'attributes':['id','name',_0x9b99('0x3e')]}]}]},'log':_0x9b99('0x0')});};}; \ No newline at end of file +var _0x5638=['strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent'];(function(_0x400812,_0x2a8006){var _0x34b883=function(_0x498a83){while(--_0x498a83){_0x400812['push'](_0x400812['shift']());}};_0x34b883(++_0x2a8006);}(_0x5638,0x7e));var _0x8563=function(_0xdc4b10,_0x25ac09){_0xdc4b10=_0xdc4b10-0x0;var _0x58e361=_0x5638[_0xdc4b10];return _0x58e361;};'use strict';var client=require(_0x8563('0x0'));exports[_0x8563('0x1')]=function(){return function(){return client['Request'](_0x8563('0x2'),{'options':{'raw':![],'attributes':['id',_0x8563('0x3'),_0x8563('0x4'),'acwTimeout',_0x8563('0x5'),_0x8563('0x6'),_0x8563('0x7'),'dialActive',_0x8563('0x8'),_0x8563('0x9'),_0x8563('0xa'),_0x8563('0xb'),_0x8563('0xc'),_0x8563('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x8563('0xe'),'dialOriginateTimeout',_0x8563('0xf'),_0x8563('0x10'),_0x8563('0x11'),_0x8563('0x12'),'dialCongestionRetryFrequency',_0x8563('0x13'),_0x8563('0x14'),_0x8563('0x15'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x8563('0x16'),_0x8563('0x17'),_0x8563('0x18'),_0x8563('0x19'),_0x8563('0x1a'),_0x8563('0x1b'),_0x8563('0x1c'),_0x8563('0x1d'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x8563('0x1e'),_0x8563('0x1f'),_0x8563('0x20'),'dialRecallMeTimeout',_0x8563('0x21'),_0x8563('0x22'),_0x8563('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0x8563('0x6'),_0x8563('0x24'),_0x8563('0x25'),'dialCutDigit',_0x8563('0x26'),_0x8563('0x27'),_0x8563('0x28'),'dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x8563('0x29'),_0x8563('0x2a'),_0x8563('0x2b'),_0x8563('0x2c'),_0x8563('0x2d'),_0x8563('0x2e'),_0x8563('0x2f')],'include':[{'model':_0x8563('0x30'),'as':_0x8563('0x30'),'attributes':['id','name',_0x8563('0x31'),_0x8563('0x32')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x8563('0x3'),_0x8563('0x31'),'active']},{'model':_0x8563('0x33'),'as':_0x8563('0x33'),'attributes':['id',_0x8563('0x3')],'include':[{'model':_0x8563('0x33'),'as':_0x8563('0x34'),'attributes':['id',_0x8563('0x3'),_0x8563('0x35')]}]}]},'log':_0x8563('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 50077ba..9823258 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(_0x29685d,_0x26c463){var _0x49377d=function(_0x56f794){while(--_0x56f794){_0x29685d['push'](_0x29685d['shift']());}};_0x49377d(++_0x26c463);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x550f53,_0x4885d8){var _0x291e6a=function(_0x450524){while(--_0x450524){_0x550f53['push'](_0x550f53['shift']());}};_0x291e6a(++_0x4885d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 75942e9..66c4a8b 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 _0x83f6=['../client','getVoiceQueueRtPauses'];(function(_0x37f184,_0x13ed3c){var _0x26e39f=function(_0x41a821){while(--_0x41a821){_0x37f184['push'](_0x37f184['shift']());}};_0x26e39f(++_0x13ed3c);}(_0x83f6,0x6a));var _0x683f=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x83f6[_0x3042c5];return _0x7cd140;};'use strict';var client=require(_0x683f('0x0'));exports[_0x683f('0x1')]=function(_0x21d9f1){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x21d9f1,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x97c2=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x4e8178,_0x212652){var _0x1f69b3=function(_0x31560e){while(--_0x31560e){_0x4e8178['push'](_0x4e8178['shift']());}};_0x1f69b3(++_0x212652);}(_0x97c2,0x6d));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x297c('0x0')]=function(_0x49e9c7){return function(){return client[_0x297c('0x1')](_0x297c('0x2'),{'options':{'where':{'VoiceQueueId':_0x49e9c7,'paused':!![]},'raw':!![]},'log':_0x297c('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 9381e0d..01aaa04 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(_0x2189cd,_0xb48aeb){var _0x256cb9=function(_0x537816){while(--_0x537816){_0x2189cd['push'](_0x2189cd['shift']());}};_0x256cb9(++_0xb48aeb);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x436f61,_0x232837){var _0x1b355e=function(_0x1e387d){while(--_0x1e387d){_0x436f61['push'](_0x436f61['shift']());}};_0x1b355e(++_0x232837);}(_0x7a54,0x106));var _0x47a5=function(_0x40876e,_0x23924e){_0x40876e=_0x40876e-0x0;var _0x54d073=_0x7a54[_0x40876e];return _0x54d073;};'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 08728a0..497b2be 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 _0x48f4=['extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context'];(function(_0x56b886,_0x1ff474){var _0x164baf=function(_0x575d09){while(--_0x575d09){_0x56b886['push'](_0x56b886['shift']());}};_0x164baf(++_0x1ff474);}(_0x48f4,0xe3));var _0x448f=function(_0x3dc7d4,_0x4dc740){_0x3dc7d4=_0x3dc7d4-0x0;var _0x445bbb=_0x48f4[_0x3dc7d4];return _0x445bbb;};'use strict';var client=require(_0x448f('0x0'));exports[_0x448f('0x1')]={};exports['blindTransfer']=function(_0x1056b1){return client[_0x448f('0x2')](_0x448f('0x3'),{'body':{'result':_0x1056b1[_0x448f('0x4')],'transfererchannel':_0x1056b1[_0x448f('0x5')],'transferercalleridnum':_0x1056b1[_0x448f('0x6')],'transferercalleridname':_0x1056b1[_0x448f('0x7')],'transfererconnectedlinenum':_0x1056b1['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1056b1[_0x448f('0x8')],'transfereraccountcode':_0x1056b1[_0x448f('0x9')],'transferercontext':_0x1056b1['transferercontext'],'transfererexten':_0x1056b1[_0x448f('0xa')],'transfererlinkedid':_0x1056b1[_0x448f('0xb')],'transfereechannel':_0x1056b1[_0x448f('0xc')],'transfereecalleridnum':_0x1056b1[_0x448f('0xd')],'transfereecalleridname':_0x1056b1['transfereecalleridname'],'transfereeconnectedlinenum':_0x1056b1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1056b1['transfereeconnectedlinename'],'transfereeaccountcode':_0x1056b1[_0x448f('0xe')],'transfereecontext':_0x1056b1['transfereecontext'],'transfereeexten':_0x1056b1[_0x448f('0xf')],'transfereelinkedid':_0x1056b1[_0x448f('0x10')],'isexternal':_0x1056b1[_0x448f('0x11')],'context':_0x1056b1[_0x448f('0x12')],'extension':_0x1056b1[_0x448f('0x13')],'type':_0x448f('0x14')},'log':_0x448f('0x3')});};exports[_0x448f('0x15')]=function(_0x2a597a){return client[_0x448f('0x2')](_0x448f('0x3'),{'body':{'result':_0x2a597a[_0x448f('0x4')],'transfererchannel':_0x2a597a[_0x448f('0x16')],'transferercalleridnum':_0x2a597a[_0x448f('0x17')],'transferercalleridname':_0x2a597a['origtransferercalleridname'],'transfererconnectedlinenum':_0x2a597a[_0x448f('0x18')],'transfererconnectedlinename':_0x2a597a[_0x448f('0x19')],'transfereraccountcode':_0x2a597a[_0x448f('0x1a')],'transferercontext':_0x2a597a[_0x448f('0x1b')],'transfererexten':_0x2a597a[_0x448f('0x1c')],'transfererlinkedid':_0x2a597a[_0x448f('0x1d')],'transfereechannel':_0x2a597a[_0x448f('0x1e')],'transfereecalleridnum':_0x2a597a[_0x448f('0x1f')],'transfereecalleridname':_0x2a597a[_0x448f('0x20')],'transfereeconnectedlinenum':_0x2a597a[_0x448f('0x21')],'transfereeconnectedlinename':_0x2a597a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2a597a[_0x448f('0x22')],'transfereecontext':_0x2a597a[_0x448f('0x23')],'transfereeexten':_0x2a597a[_0x448f('0x24')],'transfereelinkedid':_0x2a597a[_0x448f('0x25')],'isexternal':_0x2a597a[_0x448f('0x11')],'context':_0x2a597a[_0x448f('0x26')],'extension':_0x2a597a[_0x448f('0x27')],'type':_0x448f('0x28')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xd789=['Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','extension','blind','attendedTransfer'];(function(_0x56a095,_0x2c7dd8){var _0x15beb4=function(_0x36079f){while(--_0x36079f){_0x56a095['push'](_0x56a095['shift']());}};_0x15beb4(++_0x2c7dd8);}(_0xd789,0x16f));var _0x9d78=function(_0x16c7d4,_0x1fd6a5){_0x16c7d4=_0x16c7d4-0x0;var _0x54c042=_0xd789[_0x16c7d4];return _0x54c042;};'use strict';var client=require(_0x9d78('0x0'));exports[_0x9d78('0x1')]={};exports[_0x9d78('0x2')]=function(_0x49ad16){return client['Request'](_0x9d78('0x3'),{'body':{'result':_0x49ad16[_0x9d78('0x4')],'transfererchannel':_0x49ad16['transfererchannel'],'transferercalleridnum':_0x49ad16['transferercalleridnum'],'transferercalleridname':_0x49ad16['transferercalleridname'],'transfererconnectedlinenum':_0x49ad16[_0x9d78('0x5')],'transfererconnectedlinename':_0x49ad16['transfererconnectedlinename'],'transfereraccountcode':_0x49ad16[_0x9d78('0x6')],'transferercontext':_0x49ad16['transferercontext'],'transfererexten':_0x49ad16[_0x9d78('0x7')],'transfererlinkedid':_0x49ad16[_0x9d78('0x8')],'transfereechannel':_0x49ad16[_0x9d78('0x9')],'transfereecalleridnum':_0x49ad16[_0x9d78('0xa')],'transfereecalleridname':_0x49ad16['transfereecalleridname'],'transfereeconnectedlinenum':_0x49ad16[_0x9d78('0xb')],'transfereeconnectedlinename':_0x49ad16[_0x9d78('0xc')],'transfereeaccountcode':_0x49ad16['transfereeaccountcode'],'transfereecontext':_0x49ad16[_0x9d78('0xd')],'transfereeexten':_0x49ad16['transfereeexten'],'transfereelinkedid':_0x49ad16[_0x9d78('0xe')],'isexternal':_0x49ad16['isexternal'],'context':_0x49ad16['context'],'extension':_0x49ad16[_0x9d78('0xf')],'type':_0x9d78('0x10')},'log':_0x9d78('0x3')});};exports[_0x9d78('0x11')]=function(_0x336181){return client[_0x9d78('0x12')]('CreateVoiceTransferReport',{'body':{'result':_0x336181[_0x9d78('0x4')],'transfererchannel':_0x336181[_0x9d78('0x13')],'transferercalleridnum':_0x336181['origtransferercalleridnum'],'transferercalleridname':_0x336181[_0x9d78('0x14')],'transfererconnectedlinenum':_0x336181[_0x9d78('0x15')],'transfererconnectedlinename':_0x336181[_0x9d78('0x16')],'transfereraccountcode':_0x336181[_0x9d78('0x17')],'transferercontext':_0x336181['secondtransferercontext'],'transfererexten':_0x336181[_0x9d78('0x18')],'transfererlinkedid':_0x336181[_0x9d78('0x19')],'transfereechannel':_0x336181[_0x9d78('0x1a')],'transfereecalleridnum':_0x336181['transfertargetcalleridnum'],'transfereecalleridname':_0x336181['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x336181[_0x9d78('0x1b')],'transfereeconnectedlinename':_0x336181['transfertargetconnectedlinename'],'transfereeaccountcode':_0x336181[_0x9d78('0x1c')],'transfereecontext':_0x336181[_0x9d78('0x1d')],'transfereeexten':_0x336181['transfertargetexten'],'transfereelinkedid':_0x336181[_0x9d78('0x1e')],'isexternal':_0x336181[_0x9d78('0x1f')],'context':_0x336181[_0x9d78('0x20')],'extension':_0x336181[_0x9d78('0x21')],'type':_0x9d78('0x22')},'log':_0x9d78('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 235c2cb..015fde3 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 _0xf0f4=['then','catch','isConnected','ami\x20disconnected','content','message','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumHoldTime','talking','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','omit','undefined','values','channels','length','validate','map','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','join','pick','keys','module','action','Action'];(function(_0x45db59,_0x4a240f){var _0x3c0308=function(_0x4de847){while(--_0x4de847){_0x45db59['push'](_0x45db59['shift']());}};_0x3c0308(++_0x4a240f);}(_0xf0f4,0x182));var _0x4f0f=function(_0x133275,_0x2d9c14){_0x133275=_0x133275-0x0;var _0x5f59ae=_0xf0f4[_0x133275];return _0x5f59ae;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var config=require('../../../config/environment');var properties=require(_0x4f0f('0x3'));var ami=require(_0x4f0f('0x4'));exports[_0x4f0f('0x5')]=function(_0x130ab2,_0x2e90dd,_0x15e6cd){return new BPromise(function(_0x3285cd,_0x47faf5){var _0x39ad76={'QueuePause':function(_0x1dd6bd){return new Promise(function(_0x95b1cf,_0x5da92f){var _0x2d04ab=util[_0x4f0f('0x6')](_0x4f0f('0x7'),_0x4f0f('0x8'),_0x1dd6bd[_0x4f0f('0x9')]);if(_0x130ab2[_0x4f0f('0xa')]&&_0x130ab2[_0x4f0f('0xa')][_0x2d04ab]&&_0x130ab2[_0x4f0f('0xa')][_0x2d04ab]['timer']){_0x130ab2[_0x4f0f('0xa')][_0x2d04ab][_0x4f0f('0xb')]();}if(_0x130ab2[_0x4f0f('0xc')][_0x2d04ab]){_0x130ab2[_0x4f0f('0xc')][_0x2d04ab][_0x4f0f('0xd')]({'statePause':_0x1dd6bd[_0x4f0f('0xe')]?!![]:![]});}_0x95b1cf({'code':0xc8,'message':_0x4f0f('0xf')});});},'Reload':function(_0x11749b){var _0x1cbb3b=this;return new Promise(function(_0x148343,_0x3fc985){if(ami['isConnected']()==![]){return _0x3fc985(_0x1cbb3b[_0x4f0f('0x10')](0x1f4,[config[_0x4f0f('0x11')]['ip'],config[_0x4f0f('0x11')][_0x4f0f('0x12')],'ami\x20disconnected'][_0x4f0f('0x13')]('\x20')));}_0x11749b=_[_0x4f0f('0x14')](_0x11749b,_[_0x4f0f('0x15')](properties[_0x4f0f('0x16')]));_0x11749b[_0x4f0f('0x17')]='Reload';return ami[_0x4f0f('0x18')](_0x11749b)[_0x4f0f('0x19')](function(_0x20423e){_0x148343({'code':0xc8,'message':_0x20423e['message']});})[_0x4f0f('0x1a')](function(_0x86186f){_0x3fc985(_0x1cbb3b[_0x4f0f('0x10')](0x1f5,_0x86186f['message']));});});},'Command':function(_0x3a37a9){var _0x2455f9=this;return new Promise(function(_0x34bba8,_0xe8bb33){if(ami[_0x4f0f('0x1b')]()==![]){return _0xe8bb33(_0x2455f9[_0x4f0f('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x4f0f('0x11')]['username'],_0x4f0f('0x1c')][_0x4f0f('0x13')]('\x20')));}_0x3a37a9=_['pick'](_0x3a37a9,'command');_0x3a37a9[_0x4f0f('0x17')]='Command';return ami[_0x4f0f('0x18')](_0x3a37a9)[_0x4f0f('0x19')](function(_0x18abde){_0x34bba8({'code':0xc8,'message':_0x18abde[_0x4f0f('0x1d')]});})[_0x4f0f('0x1a')](function(_0x17a9e9){_0xe8bb33(_0x2455f9['error'](0x1f5,_0x17a9e9[_0x4f0f('0x1e')]));});});},'VoiceQueues':function(_0xcdcd05){return new Promise(function(_0x37aefe,_0x3bc77d){var _0xe969c7=[];for(var _0x3e6b72 in _0x130ab2[_0x4f0f('0x1f')]){if(_0x130ab2[_0x4f0f('0x1f')][_0x4f0f('0x20')](_0x3e6b72)){var _0xb20be9=_0x130ab2[_0x4f0f('0x1f')][_0x3e6b72];var _0x394303={'id':_0xb20be9['id'],'name':_0xb20be9[_0x4f0f('0x9')],'strategy':_0xb20be9['strategy'],'answered':_0xb20be9[_0x4f0f('0x21')],'available':_0xb20be9[_0x4f0f('0x22')],'loggedIn':_0xb20be9[_0x4f0f('0x23')],'pTalking':_0xb20be9['pTalking'],'sumBillable':_0xb20be9[_0x4f0f('0x24')],'sumDuration':_0xb20be9['sumDuration'],'sumHoldTime':_0xb20be9[_0x4f0f('0x25')]||0x0,'talking':_0xb20be9[_0x4f0f('0x26')],'total':_0xb20be9['total'],'type':_0xb20be9['type'],'unmanaged':_0xb20be9[_0x4f0f('0x27')],'abandoned':_0xb20be9['abandoned'],'waiting':_0xb20be9[_0x4f0f('0x28')],'loggedInDb':_0xb20be9[_0x4f0f('0x29')]};if(_0xb20be9['type']===_0x4f0f('0x2a')){_0x394303[_0x4f0f('0x2b')]=_0xb20be9[_0x4f0f('0x2b')];_0x394303[_0x4f0f('0x2c')]=_0xb20be9['dialMethod'];_0x394303[_0x4f0f('0x2d')]=_0xb20be9[_0x4f0f('0x2d')];_0x394303[_0x4f0f('0x2e')]=_0xb20be9[_0x4f0f('0x2e')];_0x394303['dialOriginateTimeout']=_0xb20be9[_0x4f0f('0x2f')];_0x394303[_0x4f0f('0x30')]=_0xb20be9[_0x4f0f('0x30')];_0x394303['temp']=_0xb20be9[_0x4f0f('0x31')];_0x394303[_0x4f0f('0x32')]=_0xb20be9['outboundAnswerAgiCallsDay'];_0x394303[_0x4f0f('0x33')]=_0xb20be9[_0x4f0f('0x33')];_0x394303[_0x4f0f('0x34')]=_0xb20be9[_0x4f0f('0x34')];_0x394303['outboundBusyCallsDay']=_0xb20be9[_0x4f0f('0x35')];_0x394303[_0x4f0f('0x36')]=_0xb20be9[_0x4f0f('0x36')];_0x394303[_0x4f0f('0x37')]=_0xb20be9[_0x4f0f('0x37')];_0x394303[_0x4f0f('0x38')]=_0xb20be9[_0x4f0f('0x38')];_0x394303[_0x4f0f('0x39')]=_0xb20be9['outboundDropCallsDayTimeout'];_0x394303[_0x4f0f('0x3a')]=_0xb20be9[_0x4f0f('0x3a')];_0x394303[_0x4f0f('0x3b')]=_0xb20be9[_0x4f0f('0x3b')];_0x394303[_0x4f0f('0x3c')]=_0xb20be9[_0x4f0f('0x3c')];_0x394303[_0x4f0f('0x3d')]=_0xb20be9['outboundReCallsDay'];_0x394303[_0x4f0f('0x3e')]=_0xb20be9[_0x4f0f('0x3e')];_0x394303[_0x4f0f('0x3f')]=_0xb20be9['outboundUnknownCallsDay'];_0x394303[_0x4f0f('0x40')]=_0xb20be9['predictiveIntervalAnsweredCalls'];_0x394303[_0x4f0f('0x41')]=_0xb20be9['predictiveIntervalAvgHoldtime'];_0x394303[_0x4f0f('0x42')]=_0xb20be9[_0x4f0f('0x42')];_0x394303['predictiveIntervalDroppedCallsCallersExit']=_0xb20be9[_0x4f0f('0x43')];_0x394303[_0x4f0f('0x44')]=_0xb20be9[_0x4f0f('0x44')];_0x394303['predictiveIntervalErlangCalls']=_0xb20be9[_0x4f0f('0x45')];_0x394303[_0x4f0f('0x46')]=_0xb20be9[_0x4f0f('0x46')];_0x394303[_0x4f0f('0x47')]=_0xb20be9[_0x4f0f('0x47')];_0x394303[_0x4f0f('0x48')]=_0xb20be9[_0x4f0f('0x48')];_0x394303[_0x4f0f('0x49')]=_0xb20be9[_0x4f0f('0x49')];_0x394303[_0x4f0f('0x4a')]=_0xb20be9[_0x4f0f('0x4a')];_0x394303['predictiveIntervalTotalCalls']=_0xb20be9[_0x4f0f('0x4b')];_0x394303[_0x4f0f('0x1e')]=_0xb20be9[_0x4f0f('0x1e')];_0x394303[_0x4f0f('0x4c')]=_0xb20be9[_0x4f0f('0x4c')];_0x394303[_0x4f0f('0x4d')]=_0xb20be9[_0x4f0f('0x4d')];_0x394303['erlangCallToSecond']=_0xb20be9[_0x4f0f('0x4e')];_0x394303[_0x4f0f('0x4f')]=_0xb20be9[_0x4f0f('0x4f')];_0x394303[_0x4f0f('0x50')]=_0xb20be9[_0x4f0f('0x50')];_0x394303[_0x4f0f('0x51')]=_0xb20be9['startPredictive'];_0x394303[_0x4f0f('0x52')]=_0xb20be9[_0x4f0f('0x52')];}if(_0xb20be9['Trunk']){_0x394303['Trunk']={'id':_0xb20be9[_0x4f0f('0x53')]['id'],'name':_0xb20be9[_0x4f0f('0x53')][_0x4f0f('0x9')],'active':_0xb20be9['Trunk'][_0x4f0f('0x54')],'callerid':_0xb20be9['Trunk']['callerid']};}if(_0xb20be9[_0x4f0f('0x55')]){_0x394303[_0x4f0f('0x55')]={'id':_0xb20be9[_0x4f0f('0x55')]['id'],'name':_0xb20be9[_0x4f0f('0x55')][_0x4f0f('0x9')]};}_0xe969c7[_0x4f0f('0x56')](_0x394303);}}_0x37aefe({'count':_0xe969c7['length'],'rows':_0xe969c7});});},'UpdateVoiceQueue':function(_0x58d5a2){return new Promise(function(_0x112e09,_0x30cc45){var _0x2df090=_['find'](_0x130ab2[_0x4f0f('0x1f')],{'id':parseInt(_0x58d5a2['id'])});var _0x34d113=_[_0x4f0f('0x57')](_0x58d5a2,['id']);if(_0x2df090){for(var _0x4e9265 in _0x34d113){if(typeof _0x34d113[_0x4e9265]!==_0x4f0f('0x58')&&typeof _0x2df090[_0x4e9265]!=='undefined'){_0x2df090[_0x4e9265]=_0x34d113[_0x4e9265];}}_0x112e09(_0x2df090);}else{_0x30cc45();}});},'VoiceChannels':function(_0x148fb7){return new Promise(function(_0x5231e5,_0x20d237){var _0x3f2c6e=_[_0x4f0f('0x59')](_0x130ab2[_0x4f0f('0x5a')]);_0x5231e5({'count':_0x3f2c6e[_0x4f0f('0x5b')],'rows':_0x3f2c6e});});},'VoiceChannelMixMonitor':function(_0x4a78a6){var _0x5e7935=this;return new Promise(function(_0x420ced,_0x558283){if(ami[_0x4f0f('0x1b')]()==![]){return _0x558283(_0x5e7935[_0x4f0f('0x10')](0x1f4,[config[_0x4f0f('0x11')]['ip'],config[_0x4f0f('0x11')][_0x4f0f('0x12')],_0x4f0f('0x1c')][_0x4f0f('0x13')]('\x20')));}var _0x37c0d5=schema(properties['voicechannel'])[_0x4f0f('0x5c')](_0x4a78a6);if(_0x37c0d5[_0x4f0f('0x5b')]>0x0){return _0x558283(_0x5e7935[_0x4f0f('0x10')](0x1f4,_[_0x4f0f('0x5d')](_0x37c0d5,_0x4f0f('0x1e'))[_0x4f0f('0x13')](',\x20')));}var _0x23c9c3=_[_0x4f0f('0x5e')](_0x130ab2[_0x4f0f('0x5a')],{'uniqueid':_0x4a78a6[_0x4f0f('0x5f')]});if(_0x23c9c3&&_0x23c9c3['channel']){var _0x15f640=util['format'](_0x4f0f('0x60'),_0x4a78a6[_0x4f0f('0x61')]||_0x4a78a6['uniqueid'],_0x4a78a6[_0x4f0f('0x6')]||_0x4f0f('0x62'));return ami[_0x4f0f('0x18')]({'action':_0x4f0f('0x63'),'channel':_0x23c9c3[_0x4f0f('0x64')],'file':_0x15f640,'options':_0x4f0f('0x65')})[_0x4f0f('0x19')](function(_0x96ab16){var _0x360353=_['find'](_0x23c9c3[_0x4f0f('0x66')],{'filename':_0x4f0f('0x67')+_0x15f640[_0x4f0f('0x68')]()});if(_[_0x4f0f('0x69')](_0x360353)){_0x23c9c3[_0x4f0f('0x66')][_0x4f0f('0x56')]({'filename':_0x4f0f('0x67')+_0x15f640['toLowerCase'](),'createdAt':moment()['format'](_0x4f0f('0x6a')),'mixmonitorid':_0x96ab16[_0x4f0f('0x6b')],'status':_0x4f0f('0x6c')});}else{_0x360353[_0x4f0f('0x6b')]=_0x96ab16[_0x4f0f('0x6b')];_0x360353[_0x4f0f('0x6d')]=_0x4f0f('0x6c');}_0x420ced({'code':0xc8,'message':[_0x4a78a6[_0x4f0f('0x5f')],_0x4f0f('0x6e'),_0x96ab16[_0x4f0f('0x6b')]][_0x4f0f('0x13')]('\x20'),'mixmonitorid':_0x96ab16[_0x4f0f('0x6b')]});})['catch'](function(_0x26db3d){_0x558283(_0x5e7935['error'](0x1f5,[_0x4a78a6[_0x4f0f('0x5f')],_0x26db3d[_0x4f0f('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x558283(_0x5e7935['error'](0x1f5,_0x4f0f('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x1e8e82){var _0x7fe9d7=this;return new Promise(function(_0x54f9fb,_0x5df4e0){if(ami['isConnected']()==![]){return _0x5df4e0(_0x7fe9d7[_0x4f0f('0x10')](0x1f4,[config[_0x4f0f('0x11')]['ip'],config[_0x4f0f('0x11')][_0x4f0f('0x12')],_0x4f0f('0x1c')][_0x4f0f('0x13')]('\x20')));}var _0x25ec74=schema(properties['voicechannel'])['validate'](_0x1e8e82);if(_0x25ec74[_0x4f0f('0x5b')]>0x0){return _0x5df4e0(_0x7fe9d7[_0x4f0f('0x10')](0x1f4,_[_0x4f0f('0x5d')](_0x25ec74,'message')[_0x4f0f('0x13')](',\x20')));}var _0x57b3dd=_[_0x4f0f('0x5e')](_0x130ab2['channels'],{'uniqueid':_0x1e8e82[_0x4f0f('0x5f')]});if(_0x57b3dd){return BPromise['resolve']()[_0x4f0f('0x19')](function(){if(_0x57b3dd[_0x4f0f('0x64')]){return ami[_0x4f0f('0x18')]({'action':_0x4f0f('0x70'),'channel':_0x57b3dd[_0x4f0f('0x64')],'mixmonitorid':_0x1e8e82[_0x4f0f('0x6b')]})[_0x4f0f('0x1a')](function(_0x336b97){});}})['then'](function(){if(_0x57b3dd[_0x4f0f('0x71')]){return ami[_0x4f0f('0x18')]({'action':_0x4f0f('0x70'),'channel':_0x57b3dd[_0x4f0f('0x71')],'mixmonitorid':_0x1e8e82['mixmonitorid']})[_0x4f0f('0x1a')](function(_0x299fa3){});}})['then'](function(_0x4c1b09){var _0x29532b=_[_0x4f0f('0x5e')](_0x57b3dd[_0x4f0f('0x66')],{'mixmonitorid':_0x1e8e82[_0x4f0f('0x6b')]});if(_0x29532b){_0x29532b[_0x4f0f('0x6d')]='stop';}})[_0x4f0f('0x19')](function(){var _0x125b54=util[_0x4f0f('0x6')]('%s.%s',_0x1e8e82[_0x4f0f('0x61')]||_0x1e8e82[_0x4f0f('0x5f')],_0x1e8e82[_0x4f0f('0x6')]||'wav');var _0xad5d7=_[_0x4f0f('0x5e')](_0x57b3dd['monitors'],{'filename':_0x4f0f('0x67')+_0x125b54[_0x4f0f('0x68')]()});if(_0xad5d7){_0xad5d7[_0x4f0f('0x6d')]=_0x4f0f('0x72');}})[_0x4f0f('0x19')](function(){_0x54f9fb({'code':0xc8,'message':[_0x1e8e82[_0x4f0f('0x5f')],'StopMixMonitor\x20Success']['join']('\x20')});})['catch'](function(_0x4a0566){_0x5df4e0(_0x7fe9d7['error'](0x1f5,[_0x1e8e82[_0x4f0f('0x5f')],_0x4a0566[_0x4f0f('0x1e')][_0x4f0f('0x68')]()][_0x4f0f('0x13')]('\x20')));});}else{return _0x5df4e0(_0x7fe9d7[_0x4f0f('0x10')](0x1f5,_0x4f0f('0x6f')));}});},'VoiceQueuesChannels':function(_0x3c5002){return new Promise(function(_0x2c697d,_0x2d15a2){var _0x162da2=_[_0x4f0f('0x59')](_0x130ab2[_0x4f0f('0x73')]);_0x2c697d({'count':_0x162da2[_0x4f0f('0x5b')],'rows':_0x162da2});});},'VoiceQueuesChannel':function(_0x9cd96e){var _0xa068e3=this;return new Promise(function(_0x48c733,_0x29df99){var _0x30ee3a=schema(properties[_0x4f0f('0x74')])[_0x4f0f('0x5c')](_0x9cd96e);if(_0x30ee3a[_0x4f0f('0x5b')]>0x0){return _0x29df99(_0xa068e3[_0x4f0f('0x10')](0x1f4,_['map'](_0x30ee3a,_0x4f0f('0x1e'))['join'](',\x20')));}var _0x14dfea=_['find'](_0x130ab2[_0x4f0f('0x73')],{'uniqueid':_0x9cd96e[_0x4f0f('0x5f')]});if(_0x14dfea){_0x48c733(_0x14dfea);}else{return _0x29df99(_0xa068e3[_0x4f0f('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xe37fb){var _0x27839c=this;return new Promise(function(_0xd80346,_0x380f95){if(ami[_0x4f0f('0x1b')]()==![]){return _0x380f95(_0x27839c['error'](0x1f4,[config[_0x4f0f('0x11')]['ip'],config[_0x4f0f('0x11')][_0x4f0f('0x12')],_0x4f0f('0x1c')][_0x4f0f('0x13')]('\x20')));}var _0x300cdf=schema(properties[_0x4f0f('0x75')])[_0x4f0f('0x5c')](_0xe37fb);if(_0x300cdf['length']>0x0){return _0x380f95(_0x27839c[_0x4f0f('0x10')](0x1f4,_[_0x4f0f('0x5d')](_0x300cdf,'message')[_0x4f0f('0x13')](',\x20')));}var _0x33bc1e=_[_0x4f0f('0x5e')](_0x130ab2['queueChannels'],{'uniqueid':_0xe37fb[_0x4f0f('0x5f')]});if(_0x33bc1e&&_0x33bc1e['channel']){return ami[_0x4f0f('0x18')]({'action':_0x4f0f('0x76'),'channel':_0x33bc1e['channel']})[_0x4f0f('0x19')](function(_0xd553cb){_0xd80346({'code':0xc8,'message':[_0xe37fb[_0x4f0f('0x5f')],_0xd553cb['message'][_0x4f0f('0x68')]()][_0x4f0f('0x13')]('\x20')});})[_0x4f0f('0x1a')](function(_0x4a3efb){_0x380f95(_0x27839c[_0x4f0f('0x10')](0x1f5,[_0xe37fb[_0x4f0f('0x5f')],_0x4a3efb['message']['toLowerCase']()][_0x4f0f('0x13')]('\x20')));});}else{return _0x380f95(_0x27839c[_0x4f0f('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3ec559){var _0x465cdd=this;return new Promise(function(_0x229592,_0x340eb2){if(ami[_0x4f0f('0x1b')]()==![]){return _0x340eb2(_0x465cdd['error'](0x1f4,[config['asterisk']['ip'],config[_0x4f0f('0x11')]['username'],_0x4f0f('0x1c')][_0x4f0f('0x13')]('\x20')));}var _0x4331bb=schema(properties[_0x4f0f('0x77')])['validate'](_0x3ec559);if(_0x4331bb[_0x4f0f('0x5b')]>0x0){return _0x340eb2(_0x465cdd[_0x4f0f('0x10')](0x1f4,_['map'](_0x4331bb,_0x4f0f('0x1e'))[_0x4f0f('0x13')](',\x20')));}var _0x272fa6=_[_0x4f0f('0x5e')](_0x130ab2['queueChannels'],{'uniqueid':_0x3ec559['uniqueid']});if(_0x272fa6&&_0x272fa6[_0x4f0f('0x64')]){return ami[_0x4f0f('0x18')]({'action':_0x4f0f('0x78'),'channel':_0x272fa6['channel'],'exten':_0x3ec559[_0x4f0f('0x79')],'context':_0x3ec559['context']||_0x272fa6['context'],'priority':0x1})[_0x4f0f('0x19')](function(_0x40dc64){_0x229592({'code':0xc8,'message':[_0x3ec559[_0x4f0f('0x5f')],_0x40dc64[_0x4f0f('0x1e')]['toLowerCase']()][_0x4f0f('0x13')]('\x20')});})[_0x4f0f('0x1a')](function(_0x487d12){_0x340eb2(_0x465cdd['error'](0x1f5,[_0x3ec559['uniqueid'],_0x487d12[_0x4f0f('0x1e')][_0x4f0f('0x68')]()]['join']('\x20')));});}else{return _0x340eb2(_0x465cdd[_0x4f0f('0x10')](0x1f5,_0x4f0f('0x6f')));}});},'Agents':function(_0x5025e0){return new Promise(function(_0x43ee33,_0x1a6a1a){var _0x203d37=_['values'](_0x130ab2[_0x4f0f('0xc')]);_0x43ee33({'count':_0x203d37[_0x4f0f('0x5b')],'rows':_0x203d37});});},'Telephones':function(_0x1a4056){return new Promise(function(_0x18ba7d,_0x1ee736){var _0x3a486d=_[_0x4f0f('0x59')](_0x130ab2['telephones']);_0x18ba7d({'count':_0x3a486d[_0x4f0f('0x5b')],'rows':_0x3a486d});});},'Trunks':function(_0x5a2c5b){return new Promise(function(_0x517a7b,_0x5a049c){var _0x5d8361=_[_0x4f0f('0x59')](_0x130ab2[_0x4f0f('0x7a')]);_0x517a7b({'count':_0x5d8361[_0x4f0f('0x5b')],'rows':_0x5d8361});});},'OutboundChannels':function(_0x2230ea){return new Promise(function(_0x4eee2e,_0xdc77cf){var _0xebab63=_['values'](_0x130ab2['outboundChannels']);_0x4eee2e({'count':_0xebab63[_0x4f0f('0x5b')],'rows':_0xebab63});});},'Outbound':function(_0x45a2a9){return new Promise(function(_0x3109d4,_0x1c3ec2){_0x3109d4(_0x130ab2[_0x4f0f('0x2a')]);});},'Campaigns':function(_0x4d769a){return new Promise(function(_0x6f412c,_0x4b280d){var _0x2d7272=_[_0x4f0f('0x59')](_0x130ab2[_0x4f0f('0x7b')]);_0x6f412c({'count':_0x2d7272['length'],'rows':_0x2d7272});});},'VoiceQueuesPreview':function(_0x1b8929){var _0x4485e3=this;return new Promise(function(_0x5006cb,_0x12cf7f){_0x2e90dd[_0x4f0f('0x7c')](_0x1b8929['id'])[_0x4f0f('0x19')](function(_0x3be65c){_0x5006cb({'code':0xc8,'message':_0x3be65c[_0x4f0f('0x1e')]});})[_0x4f0f('0x1a')](function(_0x2002a4){_0x12cf7f(_0x4485e3[_0x4f0f('0x10')](0x1f4,_0x2002a4[_0x4f0f('0x1e')]));});});},'EventManager':function(_0x47cc3c){var _0x4501d8=this;return new Promise(function(_0x1c6830,_0x4a6f3a){if(!_0x47cc3c[_0x4f0f('0x7d')]){return _0x4a6f3a(_0x4501d8[_0x4f0f('0x10')](0x1f4,_0x4f0f('0x7e')));}ami[_0x4f0f('0x7f')](_0x4f0f('0x80')+_0x47cc3c['event'],_0x47cc3c[_0x4f0f('0x1e')]);_0x1c6830({'code':0xc8,'message':_0x47cc3c});});},'FaxAccounts':function(_0x4cb191){return new Promise(function(_0x563262,_0xc13feb){var _0x1d9382=_[_0x4f0f('0x59')](_0x130ab2[_0x4f0f('0x81')]);_0x563262({'count':_0x1d9382[_0x4f0f('0x5b')],'rows':_0x1d9382});});},'SendFax':function(_0x2ebe24){var _0x2fa3f8=this;return new Promise(function(_0x464483,_0x1dd46f){_0x15e6cd[_0x4f0f('0x82')](_0x2ebe24)[_0x4f0f('0x19')](function(_0x46effb){_0x464483({'code':0xc8,'message':_0x46effb[_0x4f0f('0x1e')]});})[_0x4f0f('0x1a')](function(_0x4ac29a){_0x1dd46f(_0x2fa3f8[_0x4f0f('0x10')](0x1f4,_0x4ac29a[_0x4f0f('0x1e')]));});});},'CheckAfterSend':function(_0x4cf08f){var _0x3610f8=this;return new Promise(function(_0x253310,_0x497af7){_0x15e6cd[_0x4f0f('0x83')](_0x4cf08f)['then'](function(_0x2e72c3){_0x253310({'code':0xc8,'message':_0x2e72c3[_0x4f0f('0x1e')]});})[_0x4f0f('0x1a')](function(_0x23672d){_0x497af7(_0x3610f8[_0x4f0f('0x10')](0x1f4,_0x23672d['message']));});});}};var _0x59beef=jayson['server'](_0x39ad76)[_0x4f0f('0x84')]();_0x59beef['on'](_0x4f0f('0x10'),function(_0x15df52){return _0x47faf5(_0x15df52);});_0x59beef[_0x4f0f('0x5')](0x232a,_0x4f0f('0x85'),function(){console[_0x4f0f('0x86')](_0x4f0f('0x87'),0x232a);return _0x3285cd(_0x4f0f('0x88')+0x232a);});});}; \ No newline at end of file +var _0x0af5=['predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','omit','undefined','voicechannel','map','channels','uniqueid','channel','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','exten','context','values','telephones','outboundChannels','outbound','campaigns','run','event','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','keys','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0af5,0x158));var _0x50af=function(_0x5378a9,_0xd87d76){_0x5378a9=_0x5378a9-0x0;var _0x4dfee1=_0x0af5[_0x5378a9];return _0x4dfee1;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var jayson=require(_0x50af('0x1'));var schema=require(_0x50af('0x2'));var BPromise=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var config=require(_0x50af('0x5'));var properties=require(_0x50af('0x6'));var ami=require(_0x50af('0x7'));exports[_0x50af('0x8')]=function(_0x1cfefa,_0x4c7210,_0xe37b1){return new BPromise(function(_0x5e94f8,_0x5a5c0a){var _0x3724ed={'QueuePause':function(_0x120038){return new Promise(function(_0x4dc2b9,_0x49814d){var _0x4770ec=util[_0x50af('0x9')]('%s/%s','SIP',_0x120038[_0x50af('0xa')]);if(_0x1cfefa[_0x50af('0xb')]&&_0x1cfefa['timers'][_0x4770ec]&&_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xc')]){_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xd')]();}if(_0x1cfefa['agents'][_0x4770ec]){_0x1cfefa[_0x50af('0xe')][_0x4770ec][_0x50af('0xf')]({'statePause':_0x120038[_0x50af('0x10')]?!![]:![]});}_0x4dc2b9({'code':0xc8,'message':_0x50af('0x11')});});},'Reload':function(_0x252a02){var _0x38bac0=this;return new Promise(function(_0x534589,_0x5eadd5){if(ami['isConnected']()==![]){return _0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x252a02=_[_0x50af('0x15')](_0x252a02,_[_0x50af('0x16')](properties['module']));_0x252a02['action']=_0x50af('0x17');return ami[_0x50af('0x18')](_0x252a02)[_0x50af('0x19')](function(_0x30e2ec){_0x534589({'code':0xc8,'message':_0x30e2ec[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0x23bad2){_0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f5,_0x23bad2[_0x50af('0x1a')]));});});},'Command':function(_0xaee5cf){var _0x5c6f8e=this;return new Promise(function(_0x3f1dbe,_0x2fbf20){if(ami[_0x50af('0x1c')]()==![]){return _0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}_0xaee5cf=_[_0x50af('0x15')](_0xaee5cf,_0x50af('0x1f'));_0xaee5cf[_0x50af('0x20')]=_0x50af('0x21');return ami[_0x50af('0x18')](_0xaee5cf)[_0x50af('0x19')](function(_0x53e362){_0x3f1dbe({'code':0xc8,'message':_0x53e362[_0x50af('0x22')]});})[_0x50af('0x1b')](function(_0x3c6388){_0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f5,_0x3c6388[_0x50af('0x1a')]));});});},'VoiceQueues':function(_0xb3c17c){return new Promise(function(_0x4db72d,_0xb3c15a){var _0x1550ee=[];for(var _0x5e096d in _0x1cfefa[_0x50af('0x23')]){if(_0x1cfefa[_0x50af('0x23')][_0x50af('0x24')](_0x5e096d)){var _0x5dc58a=_0x1cfefa['voiceQueues'][_0x5e096d];var _0x26dbae={'id':_0x5dc58a['id'],'name':_0x5dc58a[_0x50af('0xa')],'strategy':_0x5dc58a[_0x50af('0x25')],'answered':_0x5dc58a[_0x50af('0x26')],'available':_0x5dc58a[_0x50af('0x27')],'loggedIn':_0x5dc58a[_0x50af('0x28')],'pTalking':_0x5dc58a[_0x50af('0x29')],'sumBillable':_0x5dc58a[_0x50af('0x2a')],'sumDuration':_0x5dc58a['sumDuration'],'sumHoldTime':_0x5dc58a[_0x50af('0x2b')]||0x0,'talking':_0x5dc58a[_0x50af('0x2c')],'total':_0x5dc58a[_0x50af('0x2d')],'type':_0x5dc58a['type'],'unmanaged':_0x5dc58a[_0x50af('0x2e')],'abandoned':_0x5dc58a['abandoned'],'waiting':_0x5dc58a[_0x50af('0x2f')],'loggedInDb':_0x5dc58a['loggedInDb']};if(_0x5dc58a['type']==='outbound'){_0x26dbae[_0x50af('0x30')]=_0x5dc58a[_0x50af('0x30')];_0x26dbae[_0x50af('0x31')]=_0x5dc58a[_0x50af('0x31')];_0x26dbae[_0x50af('0x32')]=_0x5dc58a[_0x50af('0x32')];_0x26dbae[_0x50af('0x33')]=_0x5dc58a[_0x50af('0x33')];_0x26dbae[_0x50af('0x34')]=_0x5dc58a[_0x50af('0x34')];_0x26dbae['dialPrefix']=_0x5dc58a[_0x50af('0x35')];_0x26dbae[_0x50af('0x36')]=_0x5dc58a[_0x50af('0x36')];_0x26dbae[_0x50af('0x37')]=_0x5dc58a[_0x50af('0x37')];_0x26dbae['outboundAnswerCallsDay']=_0x5dc58a[_0x50af('0x38')];_0x26dbae['outboundBlacklistCallsDay']=_0x5dc58a['outboundBlacklistCallsDay'];_0x26dbae['outboundBusyCallsDay']=_0x5dc58a[_0x50af('0x39')];_0x26dbae[_0x50af('0x3a')]=_0x5dc58a[_0x50af('0x3a')];_0x26dbae[_0x50af('0x3b')]=_0x5dc58a[_0x50af('0x3b')];_0x26dbae['outboundDropCallsDayCallersExit']=_0x5dc58a['outboundDropCallsDayCallersExit'];_0x26dbae[_0x50af('0x3c')]=_0x5dc58a[_0x50af('0x3c')];_0x26dbae[_0x50af('0x3d')]=_0x5dc58a[_0x50af('0x3d')];_0x26dbae[_0x50af('0x3e')]=_0x5dc58a['outboundNoSuchCallsDay'];_0x26dbae[_0x50af('0x3f')]=_0x5dc58a[_0x50af('0x3f')];_0x26dbae[_0x50af('0x40')]=_0x5dc58a[_0x50af('0x40')];_0x26dbae['outboundRejectCallsDay']=_0x5dc58a[_0x50af('0x41')];_0x26dbae[_0x50af('0x42')]=_0x5dc58a[_0x50af('0x42')];_0x26dbae[_0x50af('0x43')]=_0x5dc58a[_0x50af('0x43')];_0x26dbae['predictiveIntervalAvgHoldtime']=_0x5dc58a['predictiveIntervalAvgHoldtime'];_0x26dbae['predictiveIntervalAvgTalktime']=_0x5dc58a[_0x50af('0x44')];_0x26dbae[_0x50af('0x45')]=_0x5dc58a[_0x50af('0x45')];_0x26dbae[_0x50af('0x46')]=_0x5dc58a[_0x50af('0x46')];_0x26dbae[_0x50af('0x47')]=_0x5dc58a[_0x50af('0x47')];_0x26dbae[_0x50af('0x48')]=_0x5dc58a[_0x50af('0x48')];_0x26dbae[_0x50af('0x49')]=_0x5dc58a[_0x50af('0x49')];_0x26dbae[_0x50af('0x4a')]=_0x5dc58a[_0x50af('0x4a')];_0x26dbae[_0x50af('0x4b')]=_0x5dc58a[_0x50af('0x4b')];_0x26dbae[_0x50af('0x4c')]=_0x5dc58a['predictiveIntervalAvailable'];_0x26dbae[_0x50af('0x4d')]=_0x5dc58a[_0x50af('0x4d')];_0x26dbae[_0x50af('0x1a')]=_0x5dc58a['message'];_0x26dbae['originated']=_0x5dc58a[_0x50af('0x4e')];_0x26dbae[_0x50af('0x4f')]=_0x5dc58a[_0x50af('0x4f')];_0x26dbae[_0x50af('0x50')]=_0x5dc58a[_0x50af('0x50')];_0x26dbae[_0x50af('0x51')]=_0x5dc58a[_0x50af('0x51')];_0x26dbae[_0x50af('0x52')]=_0x5dc58a['erlangBusyFactor'];_0x26dbae['startPredictive']=_0x5dc58a[_0x50af('0x53')];_0x26dbae[_0x50af('0x54')]=_0x5dc58a['startProgressive'];}if(_0x5dc58a['Trunk']){_0x26dbae[_0x50af('0x55')]={'id':_0x5dc58a[_0x50af('0x55')]['id'],'name':_0x5dc58a[_0x50af('0x55')]['name'],'active':_0x5dc58a[_0x50af('0x55')][_0x50af('0x56')],'callerid':_0x5dc58a[_0x50af('0x55')][_0x50af('0x57')]};}if(_0x5dc58a[_0x50af('0x58')]){_0x26dbae[_0x50af('0x58')]={'id':_0x5dc58a[_0x50af('0x58')]['id'],'name':_0x5dc58a[_0x50af('0x58')][_0x50af('0xa')]};}_0x1550ee['push'](_0x26dbae);}}_0x4db72d({'count':_0x1550ee[_0x50af('0x59')],'rows':_0x1550ee});});},'UpdateVoiceQueue':function(_0x460567){return new Promise(function(_0x36cda0,_0x304400){var _0x5c562c=_['find'](_0x1cfefa['voiceQueues'],{'id':parseInt(_0x460567['id'])});var _0xf9ed7=_[_0x50af('0x5a')](_0x460567,['id']);if(_0x5c562c){for(var _0x567c42 in _0xf9ed7){if(typeof _0xf9ed7[_0x567c42]!==_0x50af('0x5b')&&typeof _0x5c562c[_0x567c42]!==_0x50af('0x5b')){_0x5c562c[_0x567c42]=_0xf9ed7[_0x567c42];}}_0x36cda0(_0x5c562c);}else{_0x304400();}});},'VoiceChannels':function(_0x398dad){return new Promise(function(_0x3f1397,_0x41f029){var _0xb64bed=_['values'](_0x1cfefa['channels']);_0x3f1397({'count':_0xb64bed[_0x50af('0x59')],'rows':_0xb64bed});});},'VoiceChannelMixMonitor':function(_0x1afbb9){var _0x26c466=this;return new Promise(function(_0x32efe9,_0x3a2f8e){if(ami[_0x50af('0x1c')]()==![]){return _0x3a2f8e(_0x26c466['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],'ami\x20disconnected'][_0x50af('0x1e')]('\x20')));}var _0x1e4095=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x1afbb9);if(_0x1e4095[_0x50af('0x59')]>0x0){return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x1e4095,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x37ce38=_['find'](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x1afbb9[_0x50af('0x5f')]});if(_0x37ce38&&_0x37ce38[_0x50af('0x60')]){var _0x118031=util[_0x50af('0x9')]('%s.%s',_0x1afbb9['filename']||_0x1afbb9['uniqueid'],_0x1afbb9[_0x50af('0x9')]||'wav');return ami[_0x50af('0x18')]({'action':_0x50af('0x61'),'channel':_0x37ce38[_0x50af('0x60')],'file':_0x118031,'options':_0x50af('0x62')})[_0x50af('0x19')](function(_0x4fd3e8){var _0xf485ed=_[_0x50af('0x63')](_0x37ce38[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0x118031[_0x50af('0x66')]()});if(_[_0x50af('0x67')](_0xf485ed)){_0x37ce38[_0x50af('0x64')]['push']({'filename':_0x50af('0x65')+_0x118031['toLowerCase'](),'createdAt':moment()[_0x50af('0x9')](_0x50af('0x68')),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')],'status':_0x50af('0x6a')});}else{_0xf485ed['mixmonitorid']=_0x4fd3e8[_0x50af('0x69')];_0xf485ed[_0x50af('0x6b')]=_0x50af('0x6a');}_0x32efe9({'code':0xc8,'message':[_0x1afbb9[_0x50af('0x5f')],_0x50af('0x6c'),_0x4fd3e8[_0x50af('0x69')]]['join']('\x20'),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')]});})[_0x50af('0x1b')](function(_0x453867){_0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,[_0x1afbb9[_0x50af('0x5f')],_0x453867[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x4212cd){var _0x47ac0e=this;return new Promise(function(_0xba741a,_0x2a4d1e){if(ami[_0x50af('0x1c')]()==![]){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}var _0x241380=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x4212cd);if(_0x241380[_0x50af('0x59')]>0x0){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x241380,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xf1fc63=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x4212cd[_0x50af('0x5f')]});if(_0xf1fc63){return BPromise[_0x50af('0x6e')]()[_0x50af('0x19')](function(){if(_0xf1fc63['channel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x60')],'mixmonitorid':_0x4212cd[_0x50af('0x69')]})[_0x50af('0x1b')](function(_0x1d9153){});}})[_0x50af('0x19')](function(){if(_0xf1fc63['destinationchannel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x70')],'mixmonitorid':_0x4212cd['mixmonitorid']})[_0x50af('0x1b')](function(_0x13e742){});}})[_0x50af('0x19')](function(_0x641c96){var _0x5606a7=_[_0x50af('0x63')](_0xf1fc63[_0x50af('0x64')],{'mixmonitorid':_0x4212cd[_0x50af('0x69')]});if(_0x5606a7){_0x5606a7['status']=_0x50af('0x71');}})[_0x50af('0x19')](function(){var _0xe02b97=util[_0x50af('0x9')]('%s.%s',_0x4212cd[_0x50af('0x72')]||_0x4212cd[_0x50af('0x5f')],_0x4212cd[_0x50af('0x9')]||_0x50af('0x73'));var _0x1a7a10=_['find'](_0xf1fc63[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0xe02b97['toLowerCase']()});if(_0x1a7a10){_0x1a7a10[_0x50af('0x6b')]='stop';}})[_0x50af('0x19')](function(){_0xba741a({'code':0xc8,'message':[_0x4212cd[_0x50af('0x5f')],_0x50af('0x74')][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x446b42){_0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,[_0x4212cd[_0x50af('0x5f')],_0x446b42[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x205ccd){return new Promise(function(_0x110afa,_0x263dff){var _0x33bcfa=_['values'](_0x1cfefa[_0x50af('0x75')]);_0x110afa({'count':_0x33bcfa['length'],'rows':_0x33bcfa});});},'VoiceQueuesChannel':function(_0x28ce74){var _0x12d478=this;return new Promise(function(_0x2915b8,_0x58528a){var _0x56a577=schema(properties[_0x50af('0x76')])[_0x50af('0x2')](_0x28ce74);if(_0x56a577[_0x50af('0x59')]>0x0){return _0x58528a(_0x12d478['error'](0x1f4,_['map'](_0x56a577,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x3b71e0=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x28ce74[_0x50af('0x5f')]});if(_0x3b71e0){_0x2915b8(_0x3b71e0);}else{return _0x58528a(_0x12d478[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x3e1b2a){var _0x5aebe7=this;return new Promise(function(_0x6d1ec,_0xe685c8){if(ami['isConnected']()==![]){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')]['join']('\x20')));}var _0x3502e0=schema(properties[_0x50af('0x77')])['validate'](_0x3e1b2a);if(_0x3502e0['length']>0x0){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,_['map'](_0x3502e0,'message')[_0x50af('0x1e')](',\x20')));}var _0x5b4dcd=_[_0x50af('0x63')](_0x1cfefa['queueChannels'],{'uniqueid':_0x3e1b2a['uniqueid']});if(_0x5b4dcd&&_0x5b4dcd[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':'Hangup','channel':_0x5b4dcd[_0x50af('0x60')]})[_0x50af('0x19')](function(_0x122605){_0x6d1ec({'code':0xc8,'message':[_0x3e1b2a[_0x50af('0x5f')],_0x122605[_0x50af('0x1a')]['toLowerCase']()][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x57f096){_0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,[_0x3e1b2a[_0x50af('0x5f')],_0x57f096[_0x50af('0x1a')][_0x50af('0x66')]()]['join']('\x20')));});}else{return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x4bd0b1){var _0x2ad059=this;return new Promise(function(_0x47227c,_0x2eeeb3){if(ami[_0x50af('0x1c')]()==![]){return _0x2eeeb3(_0x2ad059['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],_0x50af('0x1d')]['join']('\x20')));}var _0x34cb1a=schema(properties['voicequeuechannelredirect'])[_0x50af('0x2')](_0x4bd0b1);if(_0x34cb1a[_0x50af('0x59')]>0x0){return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x34cb1a,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xe9f5ed=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x4bd0b1[_0x50af('0x5f')]});if(_0xe9f5ed&&_0xe9f5ed[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':_0x50af('0x78'),'channel':_0xe9f5ed['channel'],'exten':_0x4bd0b1[_0x50af('0x79')],'context':_0x4bd0b1[_0x50af('0x7a')]||_0xe9f5ed[_0x50af('0x7a')],'priority':0x1})[_0x50af('0x19')](function(_0x2b3d4b){_0x47227c({'code':0xc8,'message':[_0x4bd0b1[_0x50af('0x5f')],_0x2b3d4b['message']['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x2851ab){_0x2eeeb3(_0x2ad059['error'](0x1f5,[_0x4bd0b1[_0x50af('0x5f')],_0x2851ab[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'Agents':function(_0x3758ba){return new Promise(function(_0x4d2c1a,_0x47eb2b){var _0x5605c8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0xe')]);_0x4d2c1a({'count':_0x5605c8['length'],'rows':_0x5605c8});});},'Telephones':function(_0x1d5b0e){return new Promise(function(_0x1cfb8e,_0x39e945){var _0x61d448=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7c')]);_0x1cfb8e({'count':_0x61d448['length'],'rows':_0x61d448});});},'Trunks':function(_0x1b02da){return new Promise(function(_0xa4459a,_0x3d86d2){var _0x265acd=_[_0x50af('0x7b')](_0x1cfefa['trunks']);_0xa4459a({'count':_0x265acd[_0x50af('0x59')],'rows':_0x265acd});});},'OutboundChannels':function(_0x4a99c1){return new Promise(function(_0x199105,_0x43591d){var _0x3928d8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7d')]);_0x199105({'count':_0x3928d8[_0x50af('0x59')],'rows':_0x3928d8});});},'Outbound':function(_0x4e06a5){return new Promise(function(_0x56a41b,_0x2d88e2){_0x56a41b(_0x1cfefa[_0x50af('0x7e')]);});},'Campaigns':function(_0x4bd935){return new Promise(function(_0x3ca112,_0x18ce7c){var _0x2ee04b=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7f')]);_0x3ca112({'count':_0x2ee04b['length'],'rows':_0x2ee04b});});},'VoiceQueuesPreview':function(_0x4b7b41){var _0x1b0660=this;return new Promise(function(_0x2d3516,_0x56c177){_0x4c7210[_0x50af('0x80')](_0x4b7b41['id'])[_0x50af('0x19')](function(_0x207bf8){_0x2d3516({'code':0xc8,'message':_0x207bf8[_0x50af('0x1a')]});})['catch'](function(_0x225ff4){_0x56c177(_0x1b0660[_0x50af('0x12')](0x1f4,_0x225ff4[_0x50af('0x1a')]));});});},'EventManager':function(_0x3a52d1){var _0xa38bfe=this;return new Promise(function(_0x5ca675,_0x121a36){if(!_0x3a52d1[_0x50af('0x81')]){return _0x121a36(_0xa38bfe[_0x50af('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x50af('0x82')](_0x50af('0x83')+_0x3a52d1[_0x50af('0x81')],_0x3a52d1[_0x50af('0x1a')]);_0x5ca675({'code':0xc8,'message':_0x3a52d1});});},'FaxAccounts':function(_0x58212a){return new Promise(function(_0x2f283a,_0x48e889){var _0x42ba29=_['values'](_0x1cfefa['faxAccounts']);_0x2f283a({'count':_0x42ba29[_0x50af('0x59')],'rows':_0x42ba29});});},'SendFax':function(_0x382037){var _0x5fa2f8=this;return new Promise(function(_0x2f7b7a,_0x4ac687){_0xe37b1[_0x50af('0x84')](_0x382037)['then'](function(_0x2e4571){_0x2f7b7a({'code':0xc8,'message':_0x2e4571[_0x50af('0x1a')]});})['catch'](function(_0x398aef){_0x4ac687(_0x5fa2f8[_0x50af('0x12')](0x1f4,_0x398aef[_0x50af('0x1a')]));});});},'CheckAfterSend':function(_0x30106e){var _0x2675e2=this;return new Promise(function(_0xea8e86,_0x2fbe8a){_0xe37b1[_0x50af('0x85')](_0x30106e)[_0x50af('0x19')](function(_0x5ac0b7){_0xea8e86({'code':0xc8,'message':_0x5ac0b7[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0xc1c462){_0x2fbe8a(_0x2675e2['error'](0x1f4,_0xc1c462[_0x50af('0x1a')]));});});}};var _0x1fcc23=jayson[_0x50af('0x86')](_0x3724ed)[_0x50af('0x87')]();_0x1fcc23['on'](_0x50af('0x12'),function(_0x3ae264){return _0x5a5c0a(_0x3ae264);});_0x1fcc23[_0x50af('0x8')](0x232a,_0x50af('0x88'),function(){console['log'](_0x50af('0x89'),0x232a);return _0x5e94f8(_0x50af('0x8a')+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 e254b2a..cbd0ffd 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 _0x8c62=['map','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridnum','calleridname','Unknown','destcalleridname','','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','routeId','destcalleridnum','push','format','action','toLowerCase','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','info','[CM][%s][%s]','stringify','exec','data2','xmd-contactid','ListId','data3','split','phone','$or'];(function(_0x529cac,_0x596170){var _0x5304b3=function(_0x11dcc0){while(--_0x11dcc0){_0x529cac['push'](_0x529cac['shift']());}};_0x5304b3(++_0x596170);}(_0x8c62,0x15f));var _0x28c6=function(_0x23b1d6,_0x2e344b){_0x23b1d6=_0x23b1d6-0x0;var _0x4d7840=_0x8c62[_0x23b1d6];return _0x4d7840;};'use strict';var _=require('lodash');var BPromise=require(_0x28c6('0x0'));var Redis=require('ioredis');var util=require(_0x28c6('0x1'));var config=require(_0x28c6('0x2'));var logger=require('../../../../config/logger')(_0x28c6('0x3'));var cmContactRpc=require(_0x28c6('0x4'));config['redis']=_[_0x28c6('0x5')](config['redis'],{'host':_0x28c6('0x6'),'port':0x18eb});var io=require(_0x28c6('0x7'))(new Redis(config[_0x28c6('0x8')]));function emit(_0x5255d9,_0x18a3be,_0x53e083,_0x41ec28,_0x5bdd42){logger[_0x28c6('0x9')](_0x28c6('0xa'),_0x5255d9,_0x18a3be['id'],_0x53e083,_0x41ec28,JSON[_0x28c6('0xb')](_0x5bdd42));io['to'](_0x53e083)['emit'](_0x41ec28,_0x5bdd42);}exports[_0x28c6('0xc')]=function(_0x12a5e3,_0x432d40,_0x22bbac,_0x1443ca){var _0x1863c5,_0x40d017;var _0x5b85b9={};var _0x48b084=Number(_0x22bbac['data1']);var _0x591e02=_0x22bbac['data2']?Boolean(Number(_0x22bbac[_0x28c6('0xd')])):![];var _0x38be20;if(_0x1443ca[_0x28c6('0xe')]){_0x5b85b9['id']=_0x1443ca[_0x28c6('0xe')];}if(!_0x5b85b9['id']){_0x5b85b9[_0x28c6('0xf')]=_0x48b084;_0x38be20=_0x22bbac['data3']&&_0x22bbac[_0x28c6('0x10')]!=='0'?_0x22bbac[_0x28c6('0x10')][_0x28c6('0x11')](','):[_0x28c6('0x12')];_0x5b85b9[_0x28c6('0x13')]=_[_0x28c6('0x14')](_0x38be20,function(_0x1ccef1){var _0x2106dc={};_0x2106dc[_0x1ccef1]=_0x1443ca['routeId']?_0x1443ca['destcalleridnum']:_0x1443ca['calleridnum'];return _0x2106dc;});}var _0x575f96=['id',_0x28c6('0x15'),_0x28c6('0x16'),_0x28c6('0x12'),_0x28c6('0x17'),_0x28c6('0x18'),_0x28c6('0xf'),_0x28c6('0x19'),_0x28c6('0x1a'),_0x28c6('0x1b')];var _0x46f584=_['union'](_0x575f96,_0x38be20);BPromise[_0x28c6('0x1c')]()[_0x28c6('0x1d')](cmContactRpc[_0x28c6('0x1e')]({'attributes':_0x46f584,'where':_0x5b85b9}))['then'](function(_0x58d08d){_0x40d017=_0x58d08d;if(!_['isEmpty'](_0x40d017)){if(_0x40d017[_0x28c6('0x1f')]===0x1){_0x1863c5=_0x40d017[0x0];logger[_0x28c6('0x9')](_0x28c6('0x20'),_0x1443ca[_0x28c6('0x21')],_0x432d40['id'],_0x1863c5['id']);}else{logger['info'](_0x28c6('0x22'),_0x1443ca['uniqueid'],_0x432d40['id'],_[_0x28c6('0x14')](_0x40d017,'id')[_0x28c6('0x23')](','));}return;}else{logger[_0x28c6('0x9')](_0x28c6('0x24'),_0x1443ca[_0x28c6('0x21')],_0x432d40['id']);var _0x24b0f6={'ListId':_0x48b084};var _0xaa5438=_0x22bbac[_0x28c6('0x25')]&&_0x22bbac[_0x28c6('0x25')]!=='0'?_0x22bbac[_0x28c6('0x25')]:_0x28c6('0x12');if(_0x591e02){logger[_0x28c6('0x9')](_0x28c6('0x26'),_0x1443ca[_0x28c6('0x21')],_0x432d40['id']);_0x24b0f6[_0xaa5438]=_[_0x28c6('0x27')](_0x1443ca['routeId'])?_0x1443ca[_0x28c6('0x28')]:_0x1443ca['destcalleridnum'];if(_[_0x28c6('0x27')](_0x1443ca['routeId'])){_0x24b0f6[_0x28c6('0x15')]=_0x1443ca['calleridname']&&_0x1443ca[_0x28c6('0x29')]!==''?_0x1443ca[_0x28c6('0x29')]:_0x28c6('0x2a');}else{_0x24b0f6['firstName']=_0x1443ca[_0x28c6('0x2b')]&&_0x1443ca['destcalleridname']!==_0x28c6('0x2c')?_0x1443ca[_0x28c6('0x2b')]:'Unknown';}return BPromise[_0x28c6('0x1c')]()[_0x28c6('0x1d')](cmContactRpc['createContact'](_0x24b0f6))[_0x28c6('0x1d')](function(_0x1cb3fd){_0x1863c5=_0x1cb3fd;_0x40d017['push'](_0x1cb3fd);if(_0x1863c5){logger[_0x28c6('0x9')](_0x28c6('0x2d'),_0x1443ca['uniqueid'],_0x432d40['id'],_0x1863c5['id']);}return;});}else{logger['info'](_0x28c6('0x2e'),_0x1443ca[_0x28c6('0x21')],_0x432d40['id']);_0x24b0f6[_0xaa5438]=_[_0x28c6('0x27')](_0x1443ca[_0x28c6('0x2f')])?_0x1443ca[_0x28c6('0x28')]:_0x1443ca[_0x28c6('0x30')];if(_[_0x28c6('0x27')](_0x1443ca[_0x28c6('0x2f')])){_0x24b0f6[_0x28c6('0x15')]=_0x1443ca['calleridname']&&_0x1443ca['calleridname']!==_0x28c6('0x2c')?_0x1443ca[_0x28c6('0x29')]:'Unknown';}else{_0x24b0f6[_0x28c6('0x15')]=_0x1443ca['destcalleridname']&&_0x1443ca['destcalleridname']!==_0x28c6('0x2c')?_0x1443ca[_0x28c6('0x2b')]:_0x28c6('0x2a');}_0x1863c5=_0x24b0f6;_0x40d017[_0x28c6('0x31')](_0x24b0f6);return;}}})[_0x28c6('0x1d')](function(){if(_0x12a5e3){emit(_0x1443ca[_0x28c6('0x21')],_0x432d40,util[_0x28c6('0x32')]('user:%s',_0x12a5e3['name']),util['format']('trigger:%s',_0x22bbac[_0x28c6('0x33')][_0x28c6('0x34')]()),{'evt':_['merge'](_0x1443ca,{'autoCreate':_0x591e02}),'contact':_0x1863c5===undefined?{}:_0x1863c5,'contacts':_0x40d017[_0x28c6('0x1f')]===0x0?undefined:_0x40d017});}});}; \ No newline at end of file +var _0x75ec=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','stringify','emit','exec','data2','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','union','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join'];(function(_0x10a630,_0x4fce3d){var _0x2df530=function(_0x380b7c){while(--_0x380b7c){_0x10a630['push'](_0x10a630['shift']());}};_0x2df530(++_0x4fce3d);}(_0x75ec,0x1cb));var _0xc75e=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x75ec[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var BPromise=require(_0xc75e('0x0'));var Redis=require('ioredis');var util=require(_0xc75e('0x1'));var config=require(_0xc75e('0x2'));var logger=require(_0xc75e('0x3'))(_0xc75e('0x4'));var cmContactRpc=require(_0xc75e('0x5'));config[_0xc75e('0x6')]=_[_0xc75e('0x7')](config[_0xc75e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc75e('0x8'))(new Redis(config[_0xc75e('0x6')]));function emit(_0x12b922,_0x26f760,_0x90c672,_0x16f6fd,_0x59d6a6){logger['info']('[CM][%s][%s]',_0x12b922,_0x26f760['id'],_0x90c672,_0x16f6fd,JSON[_0xc75e('0x9')](_0x59d6a6));io['to'](_0x90c672)[_0xc75e('0xa')](_0x16f6fd,_0x59d6a6);}exports[_0xc75e('0xb')]=function(_0x37a75a,_0x45ea31,_0x48d1fb,_0xaaf538){var _0x28411a,_0x3b8c55;var _0x5fefcc={};var _0x130145=Number(_0x48d1fb['data1']);var _0x39f600=_0x48d1fb[_0xc75e('0xc')]?Boolean(Number(_0x48d1fb[_0xc75e('0xc')])):![];var _0x321207;if(_0xaaf538[_0xc75e('0xd')]){_0x5fefcc['id']=_0xaaf538['xmd-contactid'];}if(!_0x5fefcc['id']){_0x5fefcc[_0xc75e('0xe')]=_0x130145;_0x321207=_0x48d1fb[_0xc75e('0xf')]&&_0x48d1fb['data3']!=='0'?_0x48d1fb['data3']['split'](','):[_0xc75e('0x10')];_0x5fefcc[_0xc75e('0x11')]=_['map'](_0x321207,function(_0x4749b4){var _0x1d8597={};_0x1d8597[_0x4749b4]=_0xaaf538[_0xc75e('0x12')]?_0xaaf538[_0xc75e('0x13')]:_0xaaf538[_0xc75e('0x14')];return _0x1d8597;});}var _0x352778=['id',_0xc75e('0x15'),_0xc75e('0x16'),'phone',_0xc75e('0x17'),'fax',_0xc75e('0xe'),'createdAt',_0xc75e('0x18'),'updatedAt'];var _0x1b71de=_[_0xc75e('0x19')](_0x352778,_0x321207);BPromise[_0xc75e('0x1a')]()[_0xc75e('0x1b')](cmContactRpc[_0xc75e('0x1c')]({'attributes':_0x1b71de,'where':_0x5fefcc}))[_0xc75e('0x1b')](function(_0x35f975){_0x3b8c55=_0x35f975;if(!_['isEmpty'](_0x3b8c55)){if(_0x3b8c55[_0xc75e('0x1d')]===0x1){_0x28411a=_0x3b8c55[0x0];logger[_0xc75e('0x1e')](_0xc75e('0x1f'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id'],_0x28411a['id']);}else{logger[_0xc75e('0x1e')](_0xc75e('0x21'),_0xaaf538['uniqueid'],_0x45ea31['id'],_[_0xc75e('0x22')](_0x3b8c55,'id')[_0xc75e('0x23')](','));}return;}else{logger[_0xc75e('0x1e')](_0xc75e('0x24'),_0xaaf538['uniqueid'],_0x45ea31['id']);var _0x3e1eca={'ListId':_0x130145};var _0x39e513=_0x48d1fb[_0xc75e('0x25')]&&_0x48d1fb[_0xc75e('0x25')]!=='0'?_0x48d1fb[_0xc75e('0x25')]:_0xc75e('0x10');if(_0x39f600){logger[_0xc75e('0x1e')](_0xc75e('0x26'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id']);_0x3e1eca[_0x39e513]=_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])?_0xaaf538[_0xc75e('0x14')]:_0xaaf538[_0xc75e('0x13')];if(_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])){_0x3e1eca['firstName']=_0xaaf538[_0xc75e('0x28')]&&_0xaaf538[_0xc75e('0x28')]!==''?_0xaaf538[_0xc75e('0x28')]:_0xc75e('0x29');}else{_0x3e1eca[_0xc75e('0x15')]=_0xaaf538[_0xc75e('0x2a')]&&_0xaaf538[_0xc75e('0x2a')]!==_0xc75e('0x2b')?_0xaaf538[_0xc75e('0x2a')]:_0xc75e('0x29');}return BPromise[_0xc75e('0x1a')]()['then'](cmContactRpc[_0xc75e('0x2c')](_0x3e1eca))['then'](function(_0xfed2e){_0x28411a=_0xfed2e;_0x3b8c55[_0xc75e('0x2d')](_0xfed2e);if(_0x28411a){logger[_0xc75e('0x1e')](_0xc75e('0x2e'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id'],_0x28411a['id']);}return;});}else{logger['info'](_0xc75e('0x2f'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id']);_0x3e1eca[_0x39e513]=_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])?_0xaaf538[_0xc75e('0x14')]:_0xaaf538[_0xc75e('0x13')];if(_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])){_0x3e1eca['firstName']=_0xaaf538['calleridname']&&_0xaaf538['calleridname']!==_0xc75e('0x2b')?_0xaaf538['calleridname']:_0xc75e('0x29');}else{_0x3e1eca[_0xc75e('0x15')]=_0xaaf538[_0xc75e('0x2a')]&&_0xaaf538[_0xc75e('0x2a')]!==_0xc75e('0x2b')?_0xaaf538[_0xc75e('0x2a')]:_0xc75e('0x29');}_0x28411a=_0x3e1eca;_0x3b8c55[_0xc75e('0x2d')](_0x3e1eca);return;}}})[_0xc75e('0x1b')](function(){if(_0x37a75a){emit(_0xaaf538[_0xc75e('0x20')],_0x45ea31,util[_0xc75e('0x30')](_0xc75e('0x31'),_0x37a75a[_0xc75e('0x32')]),util[_0xc75e('0x30')](_0xc75e('0x33'),_0x48d1fb[_0xc75e('0x34')][_0xc75e('0x35')]()),{'evt':_[_0xc75e('0x36')](_0xaaf538,{'autoCreate':_0x39f600}),'contact':_0x28411a===undefined?{}:_0x28411a,'contacts':_0x3b8c55[_0xc75e('0x1d')]===0x0?undefined:_0x3b8c55});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 68c278f..7dbcf21 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 _0x7b0a=['AllConditions','checkConditions','some','field','account','value','AccountId','operator','upperFirst','interaction','message','event','agent','membername','lastevent','exports','util','lodash','url','ioredis','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','info','stringify','prototype','undefined','motionChannel','voice','checkTriggers','status','checkTrigger','merge','length','Actions','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','html','data2','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','winApplication','render','winArguments','format','user:%s','interface','name','data1','jscripty','trigger:%s','exec','integration','voiceQueues','queue','routeId','urlforward','parse','query','search','replace','channel','every'];(function(_0x31db4d,_0xacaec3){var _0x427db6=function(_0x21fc8a){while(--_0x21fc8a){_0x31db4d['push'](_0x31db4d['shift']());}};_0x427db6(++_0xacaec3);}(_0x7b0a,0x84));var _0xa7b0=function(_0x5374fd,_0x266ed1){_0x5374fd=_0x5374fd-0x0;var _0x804dcd=_0x7b0a[_0x5374fd];return _0x804dcd;};'use strict';var util=require(_0xa7b0('0x0'));var _=require(_0xa7b0('0x1'));var url=require(_0xa7b0('0x2'));var Mustache=require('mustache');var Redis=require(_0xa7b0('0x3'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xa7b0('0x4'));var config=require(_0xa7b0('0x5'));var logger=require(_0xa7b0('0x6'))(_0xa7b0('0x7'));var ami=require(_0xa7b0('0x8'));config[_0xa7b0('0x9')]=_['defaults'](config[_0xa7b0('0x9')],{'host':_0xa7b0('0xa'),'port':0x18eb});var io=require(_0xa7b0('0xb'))(new Redis(config[_0xa7b0('0x9')]));var operators={'equals':function(_0x3f5360,_0x39524d){return _0x3f5360==_0x39524d;},'not_equals':function(_0x394269,_0x819c5e){return _0x394269!=_0x819c5e;}};var barAndWebActions=['popup',_0xa7b0('0x2'),_0xa7b0('0xc')];function Trigger(_0x5711ef){this[_0xa7b0('0xd')]=_0x5711ef[_0xa7b0('0xd')];this[_0xa7b0('0xe')]=_0x5711ef[_0xa7b0('0xe')];this['voiceQueues']=_0x5711ef['voiceQueues'];this['templates']=_0x5711ef[_0xa7b0('0xf')];this['voiceExtensions']=_0x5711ef[_0xa7b0('0x10')];this[_0xa7b0('0x11')]=_0x5711ef['zendeskAccounts'];this[_0xa7b0('0x12')]=_0x5711ef[_0xa7b0('0x12')];this['salesforceAccounts']=_0x5711ef[_0xa7b0('0x13')];this[_0xa7b0('0x14')]=_0x5711ef[_0xa7b0('0x14')];this['zohoAccounts']=_0x5711ef['zohoAccounts'];this[_0xa7b0('0x15')]=_0x5711ef[_0xa7b0('0x15')];this[_0xa7b0('0x16')]=_0x5711ef[_0xa7b0('0x16')];this[_0xa7b0('0x17')]=_0x5711ef['servicenowAccounts'];this[_0xa7b0('0x18')]=_0x5711ef[_0xa7b0('0x18')];this[_0xa7b0('0x19')]=_0x5711ef[_0xa7b0('0x19')];this[_0xa7b0('0x1a')]={'zendesk':this[_0xa7b0('0x11')],'salesforce':this[_0xa7b0('0x13')],'freshdesk':this[_0xa7b0('0x12')],'sugarcrm':this[_0xa7b0('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0xa7b0('0x15')],'vtiger':this[_0xa7b0('0x16')],'dynamics365':this[_0xa7b0('0x18')],'freshsales':this[_0xa7b0('0x19')],'servicenow':this[_0xa7b0('0x17')]};ami['on'](_0xa7b0('0x1b'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x1e'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x1f'),this[_0xa7b0('0x1c')]['bind'](this));ami['on'](_0xa7b0('0x20'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x21'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on']('custom:agentnoanswer',this[_0xa7b0('0x1c')]['bind'](this));ami['on'](_0xa7b0('0x22'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x23'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x24'),this['syncCustomEvent'][_0xa7b0('0x1d')](this));ami['on']('custom:amd',this[_0xa7b0('0x1c')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xa7b0('0x1c')]['bind'](this));ami['on']('custom:timeout',this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x25'),this[_0xa7b0('0x26')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x27'),this['syncAgentDial'][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x28'),this['syncAgentDial'][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x29'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x2a'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x2b'),this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on']('custom:acceptmessage',this[_0xa7b0('0x1c')][_0xa7b0('0x1d')](this));ami['on'](_0xa7b0('0x2c'),this[_0xa7b0('0x1c')]['bind'](this));}Trigger['prototype'][_0xa7b0('0x2d')]=function(_0x48d1bd,_0x104a01,_0x48a9e5){logger[_0xa7b0('0x2e')](_0x48d1bd,_0x104a01,JSON[_0xa7b0('0x2f')](_0x48a9e5));io['to'](_0x48d1bd)['emit'](_0x104a01,_0x48a9e5);};Trigger[_0xa7b0('0x30')]['syncCustomEvent']=function(_0x210a70){var _0x16ad8a=_['clone'](_0x210a70);if(typeof _0x16ad8a['motionChannel']===_0xa7b0('0x31')){_0x16ad8a[_0xa7b0('0x32')]=_0xa7b0('0x33');}this[_0xa7b0('0x34')](_0x16ad8a);};Trigger[_0xa7b0('0x30')]['syncAgentDial']=function(_0x3a9a38){if(this[_0xa7b0('0xe')][_0x3a9a38['interface']]){this[_0xa7b0('0x1c')](_0x3a9a38);}};Trigger[_0xa7b0('0x30')][_0xa7b0('0x34')]=function(_0x1de347){var _0x217e0f;for(var _0x4dfd72 in this[_0xa7b0('0xd')]){if(this[_0xa7b0('0xd')]['hasOwnProperty'](_0x4dfd72)){if(this[_0xa7b0('0xd')][_0x4dfd72][_0xa7b0('0x35')]){_0x217e0f=this[_0xa7b0('0x36')](this[_0xa7b0('0xd')][_0x4dfd72],_0x1de347);if(_0x217e0f){_[_0xa7b0('0x37')](_0x1de347,_0x1de347['variables']);for(var _0xc7b5cd=0x0,_0x440389,_0x3ff8fd,_0x5d0e5f;_0xc7b5cd0x0){_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 +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5fc3,0xa8));var _0x35fc=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x5fc3[_0x36d25e];return _0x4b95b8;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index de9c083..c492775 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 _0x4af7=['userEmail','username','catch','toLowerCase','outbound','destcalleridnum','contacts','Bearer\x20','4.0','headers','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','nameField','customField','substring','indexOf','content','ticketType','incident','assign','Subjects','getString','Descriptions','/contacts(','/systemusers(','Fields','phonecalls','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','dynamics365','redis','socket.io-emitter','POST','remoteUri','clientSecret','access_token','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x3cc054,_0x478d6f){var _0x55d0a3=function(_0x38f23c){while(--_0x38f23c){_0x3cc054['push'](_0x3cc054['shift']());}};_0x55d0a3(++_0x478d6f);}(_0x4af7,0xfb));var _0x74af=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x4af7[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0x74af('0x0'));var BPromise=require(_0x74af('0x1'));var rp=require(_0x74af('0x2'));var util=require(_0x74af('0x3'));var intUtil=require(_0x74af('0x4'));var md5=require(_0x74af('0x5'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x74af('0x6'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x74af('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x74af('0x8'))(new Redis(config[_0x74af('0x7')]));function getAuthToken(_0x28ba33,_0x405489,_0x133259){var _0x6dccf9={'method':_0x74af('0x9'),'uri':_0x405489,'form':{'client_id':_0x28ba33['clientId'],'resource':_0x28ba33[_0x74af('0xa')],'username':_0x28ba33['username'],'password':_0x28ba33['password'],'grant_type':'password','client_secret':_0x28ba33[_0x74af('0xb')]},'json':!![]};return rp(_0x6dccf9)['then'](function(_0x265b02){return _0x265b02[_0x74af('0xc')];})['catch'](function(_0x1d8fe1){logger[_0x74af('0xd')]('['+[_0x133259['toUpperCase']()]+_0x74af('0xe'));return _0x1d8fe1[_0x74af('0xf')];});}function getUser(_0x3804b2,_0x461001,_0x1df833,_0x517473,_0x17a026,_0x4d292f){return new BPromise(function(_0x1c6298,_0x5433c8){return getAuthToken(_0x461001,_0x517473,_0x4d292f)[_0x74af('0x10')](function(_0xe8f3f5){var _0x1a51a4={'method':_0x74af('0x11'),'uri':_0x17a026+_0x74af('0x12'),'headers':{'Authorization':'Bearer\x20'+_0xe8f3f5,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a51a4);})[_0x74af('0x10')](function(_0x1a576e){var _0x45cec1=_0x1a576e[_0x74af('0x13')];var _0x351dd6=![];var _0x2272a7=null;if(!_[_0x74af('0x14')](_0x1df833)){if(intUtil[_0x74af('0x15')](_0x1df833['email'])){_0x3804b2['userEmail']=_0x1df833[_0x74af('0x16')];for(_0x2272a7=0x0;_0x2272a7<_0x45cec1[_0x74af('0x17')];_0x2272a7++){if(_0x45cec1[_0x2272a7][_0x74af('0x18')]===_0x1df833[_0x74af('0x16')]&&!_0x45cec1[_0x2272a7][_0x74af('0x19')]){_0x351dd6=!![];logger[_0x74af('0x1a')]('['+[_0x4d292f[_0x74af('0x1b')]()]+']\x20Agent\x20found\x20'+_0x45cec1[_0x2272a7]['systemuserid']+'!');_0x3804b2[_0x74af('0x1c')]=_0x45cec1[_0x2272a7][_0x74af('0x1d')];}}}}if(!_0x351dd6){logger[_0x74af('0x1a')]('['+[_0x4d292f[_0x74af('0x1b')]()]+_0x74af('0x1e'));_0x3804b2[_0x74af('0x1f')]=_0x461001[_0x74af('0x20')];for(_0x2272a7=0x0;_0x2272a7<_0x45cec1[_0x74af('0x17')];_0x2272a7++){if(_0x45cec1[_0x2272a7]['internalemailaddress']===_0x461001[_0x74af('0x20')]){_0x3804b2[_0x74af('0x1c')]=_0x45cec1[_0x2272a7][_0x74af('0x1d')];}}}_0x1c6298(_0x3804b2);})[_0x74af('0x21')](function(_0x2159de){_0x5433c8(_0x2159de['message']);});});}function createEndUser(_0x5ed0a4,_0x399f3d,_0x1b9a6f,_0x340f19,_0x1105ba,_0x21b7a5){return new BPromise(function(_0x74d1a2,_0x1f3108){return getAuthToken(_0x399f3d,_0x1b9a6f,_0x21b7a5)[_0x74af('0x10')](function(_0x596eac){var _0xcc804b=_0x21b7a5[_0x74af('0x22')]()===_0x74af('0x23')?_0x1105ba[_0x74af('0x24')]:_0x1105ba['calleridnum'];var _0x19d34e={'method':_0x74af('0x9'),'uri':_0x340f19+_0x74af('0x25'),'body':{'telephone1':_0xcc804b,'fullname':_0xcc804b,'firstname':_0xcc804b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5ed0a4[_0x74af('0x1c')]+')'},'headers':{'Authorization':_0x74af('0x26')+_0x596eac,'OData-Version':_0x74af('0x27')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x19d34e);})[_0x74af('0x10')](function(_0x523f77){var _0x7d786b=_0x523f77[_0x74af('0x28')]['odata-entityid'];var _0xb4a6c1=_0x7d786b['substring'](_0x7d786b[_0x74af('0x29')]('(')+0x1,_0x7d786b[_0x74af('0x29')](')'));_0x5ed0a4[_0x74af('0x2a')]=_0xb4a6c1;_0x74d1a2(_0x5ed0a4);})[_0x74af('0x21')](function(_0x4b88fe){_0x1f3108(_0x4b88fe['message']);});});}function getEndUser(_0x5101f6,_0x17fd12,_0x3592f6,_0x59ec3c,_0x17f0f6,_0x104ce1){return new BPromise(function(_0x5c673a,_0x3f659b){var _0x48532c=_0x104ce1[_0x74af('0x22')]()===_0x74af('0x23')?_0x17f0f6[_0x74af('0x24')]:_0x17f0f6[_0x74af('0x2b')];return getAuthToken(_0x17fd12,_0x3592f6,_0x104ce1)['then'](function(_0x48bb5c){var _0x28017d={'method':_0x74af('0x11'),'uri':_0x59ec3c+_0x74af('0x2c')+_0x48532c[_0x74af('0x2d')]('+','%2b')+'\x27','headers':{'Authorization':_0x74af('0x26')+_0x48bb5c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28017d);})[_0x74af('0x10')](function(_0x475d34){var _0x30170e=null;if(_0x475d34){var _0x56cca6=_0x475d34[_0x74af('0x13')];var _0x1a501b=![];for(_0x30170e=0x0;_0x30170e<_0x56cca6[_0x74af('0x17')];_0x30170e++){if(_0x56cca6[_0x30170e][_0x74af('0x2e')]===_0x48532c){_0x1a501b=!![];_0x5101f6[_0x74af('0x2a')]=_0x56cca6[_0x30170e][_0x74af('0x2f')];}}if(_0x1a501b){_0x5c673a(_0x5101f6);}else{return createEndUser(_0x5101f6,_0x17fd12,_0x3592f6,_0x59ec3c,_0x17f0f6,_0x104ce1)[_0x74af('0x10')](function(_0x29e84b){logger[_0x74af('0x1a')]('['+[_0x104ce1[_0x74af('0x1b')]()]+_0x74af('0x30'),_0x29e84b[_0x74af('0x2a')]);_0x5c673a(_0x29e84b);});}}else{return createEndUser(_0x5101f6,_0x17fd12,_0x3592f6,_0x59ec3c,_0x17f0f6,_0x104ce1)[_0x74af('0x10')](function(_0x57f110){logger[_0x74af('0x1a')]('['+[_0x104ce1[_0x74af('0x1b')]()]+_0x74af('0x31'),_0x57f110[_0x74af('0x2a')]);_0x5c673a(_0x57f110);});}});});}function getCustomFields(_0x38e503,_0x3d490b,_0x3dc1a0){var _0x219606={};if(_0x38e503[_0x74af('0x17')]>0x0){_[_0x74af('0x32')](_0x38e503,function(_0x58f98a){if(_[_0x74af('0x33')]([_0x74af('0x34'),'picklist'],_0x58f98a[_0x74af('0x35')])&&_0x58f98a[_0x74af('0x36')]&&!_0x58f98a[_0x74af('0x37')]){var _0x1170b6=_0x58f98a['idField'][_0x74af('0x22')]();var _0x220f37=_0x1170b6[_0x74af('0x38')](0x0,_0x1170b6[_0x74af('0x39')]('_'));var _0x1be9d3=_0x1170b6[_0x74af('0x38')](_0x1170b6[_0x74af('0x39')]('_')+0x1);if(_0x220f37===_0x3dc1a0){_0x219606[_0x1be9d3]=_0x58f98a[_0x74af('0x3a')];}}});}return _0x219606;}function getTicket(_0x2f364a,_0x25955b,_0x2467e4,_0x5d17f5,_0x2ce0c9,_0x1dce2e,_0x4f03c9){return new BPromise(function(_0x66bb1,_0x47e3eb){var _0x5e7a8a;return getAuthToken(_0x25955b,_0x2467e4,_0x4f03c9)[_0x74af('0x10')](function(_0x28a5a2){if(_0x1dce2e[_0x74af('0x3b')]===_0x74af('0x3c')){_0x5e7a8a={'method':_0x74af('0x9'),'uri':_0x5d17f5+'incidents','body':Object[_0x74af('0x3d')]({},{'title':intUtil['getString'](_0x1dce2e[_0x74af('0x3e')],_0x2ce0c9,'\x20'),'description':intUtil[_0x74af('0x3f')](_0x1dce2e[_0x74af('0x40')],_0x2ce0c9,'\x0a'),'customerid_contact@odata.bind':_0x74af('0x41')+_0x2f364a[_0x74af('0x2a')]+')','ownerid@odata.bind':_0x74af('0x42')+_0x2f364a['userId']+')','caseorigincode':'1'},getCustomFields(_0x1dce2e[_0x74af('0x43')],_0x2ce0c9,_0x1dce2e[_0x74af('0x3b')])),'headers':{'Authorization':_0x74af('0x26')+_0x28a5a2,'OData-Version':_0x74af('0x27')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1dce2e[_0x74af('0x3b')]==='phonecall'){_0x5e7a8a={'method':'POST','uri':_0x5d17f5+_0x74af('0x44'),'body':Object[_0x74af('0x3d')]({},{'subject':intUtil['getString'](_0x1dce2e[_0x74af('0x3e')],_0x2ce0c9,'\x20'),'phonenumber':String(_0x2ce0c9[_0x74af('0x2b')]),'description':intUtil[_0x74af('0x3f')](_0x1dce2e['Descriptions'],_0x2ce0c9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x74af('0x41')+_0x2f364a['enduserId']+')','ownerid@odata.bind':_0x74af('0x42')+_0x2f364a[_0x74af('0x1c')]+')','directioncode':_0x2f364a[_0x74af('0x45')]===_0x74af('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x74af('0x42')+_0x2f364a[_0x74af('0x1c')]+')','participationtypemask':_0x2f364a[_0x74af('0x45')]===_0x74af('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x74af('0x41')+_0x2f364a[_0x74af('0x2a')]+')','participationtypemask':_0x2f364a[_0x74af('0x45')]===_0x74af('0x46')?0x1:0x2}]},getCustomFields(_0x1dce2e[_0x74af('0x43')],_0x2ce0c9,_0x1dce2e['ticketType'])),'headers':{'Authorization':_0x74af('0x26')+_0x28a5a2,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5e7a8a);})[_0x74af('0x10')](function(_0x2f6240){var _0x1db8c7=_0x2f6240[_0x74af('0x28')][_0x74af('0x47')];var _0x47ba16=_0x1db8c7[_0x74af('0x38')](_0x1db8c7[_0x74af('0x29')]('(')+0x1,_0x1db8c7[_0x74af('0x29')](')'));_0x2f364a[_0x74af('0x48')]=_0x47ba16;_0x66bb1(_0x2f364a);})[_0x74af('0x21')](function(_0x26aec4){_0x47e3eb(_0x26aec4['message']);});});}function emit(_0x3239cc,_0x4ecbec,_0x275584,_0x47570b){var _0x2034b8={'uri':util[_0x74af('0x49')](_0x74af('0x4a'),_0x3239cc,_0x275584,_0x47570b)};io['to'](util[_0x74af('0x49')](_0x74af('0x4b'),_0x4ecbec))['emit']('trigger:browser:url',_0x2034b8);}exports['cs']=function(_0x5261aa,_0x7aa4f8,_0x3cbf28,_0x73081,_0x3a4f52,_0x32cce5,_0xaa6f46,_0xa93df7){var _0x3f346b={};_0x32cce5[_0x74af('0xa')]=intUtil[_0x74af('0x4c')](_0x32cce5[_0x74af('0xa')]);_0x32cce5[_0x74af('0x4d')]=intUtil[_0x74af('0x4c')](_0x32cce5['serverUrl']);_0x3f346b['callDirection']=_0xa93df7==='queue'||_0xa93df7===_0x74af('0x4e')?_0x74af('0x46'):_0x74af('0x23');var _0x362118=util[_0x74af('0x49')](_0x74af('0x4f'),_0x32cce5[_0x74af('0xa')]);var _0x334b42=util[_0x74af('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x32cce5[_0x74af('0x50')]);var _0x204964=util['format'](_0x74af('0x51'),_0x32cce5[_0x74af('0x4d')],_0x7aa4f8[_0x74af('0x52')],md5(_0x7aa4f8[_0x74af('0x52')]));if(_0x3a4f52&&_0x3a4f52[_0x74af('0x53')]){logger[_0x74af('0x1a')]('[QUEUE]',_0x74af('0x54'));_0x7aa4f8[_0x74af('0x55')]=_0x204964;}else if(_0xaa6f46&&_0xaa6f46['recordingFormat']&&_0xaa6f46[_0x74af('0x56')]!==_0x74af('0x57')){logger[_0x74af('0x1a')](_0x74af('0x58'),_0x74af('0x54'));_0x7aa4f8[_0x74af('0x55')]=_0x204964;}else{_0x7aa4f8[_0x74af('0x55')]='';}return getUser(_0x3f346b,_0x32cce5,_0x73081,_0x334b42,_0x362118,_0xa93df7)['then'](function(_0x2878fd){logger['info']('['+_0xa93df7[_0x74af('0x1b')]()+']\x20The\x20User\x20ID\x20is:',_0x2878fd[_0x74af('0x1c')]);logger['info']('['+_0xa93df7[_0x74af('0x1b')]()+']\x20The\x20User\x20email\x20is:',_0x2878fd[_0x74af('0x1f')]);return getEndUser(_0x2878fd,_0x32cce5,_0x334b42,_0x362118,_0x7aa4f8,_0xa93df7);})[_0x74af('0x10')](function(_0x43e569){logger[_0x74af('0x1a')]('['+_0xa93df7['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x43e569[_0x74af('0x2a')]);logger['info']('['+_0xa93df7[_0x74af('0x1b')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x7aa4f8[_0x74af('0x2b')]);return getTicket(_0x43e569,_0x32cce5,_0x334b42,_0x362118,_0x7aa4f8,_0x3cbf28,_0xa93df7);})[_0x74af('0x10')](function(_0x85c8f6){logger[_0x74af('0x1a')](util[_0x74af('0x49')]('['+_0xa93df7[_0x74af('0x1b')]()+_0x74af('0x59'),_0x3cbf28[_0x74af('0x3b')],_0x85c8f6[_0x74af('0x48')]));logger[_0x74af('0x1a')](util['format']('['+_0xa93df7[_0x74af('0x1b')]()+_0x74af('0x5a'),_0xa93df7));if(_0xa93df7!=='unmanaged'){logger[_0x74af('0x1a')]('['+_0xa93df7['toUpperCase']()+']',_0x74af('0x5b'));emit(_0x32cce5[_0x74af('0xa')],_0x73081['name'],_0x3cbf28['ticketType'],_0x85c8f6[_0x74af('0x48')]);}})[_0x74af('0x21')](function(_0x1b6a36){logger['error']('['+_0xa93df7['toUpperCase']()+_0x74af('0x5c'),util[_0x74af('0x5d')](_0x1b6a36,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe5f8=[']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Descriptions','/contacts(','phonecall','callDirection','queue','Fields','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId','error','inspect','lodash','bluebird','util','./util','md5','../../../../config/logger','dynamics365','defaults','redis','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xe5f8,0x165));var _0x8e5f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe5f8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8e5f('0x0'));var BPromise=require(_0x8e5f('0x1'));var rp=require('request-promise');var util=require(_0x8e5f('0x2'));var intUtil=require(_0x8e5f('0x3'));var md5=require(_0x8e5f('0x4'));var Redis=require('ioredis');var logger=require(_0x8e5f('0x5'))(_0x8e5f('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0x8e5f('0x7')](config[_0x8e5f('0x8')],{'host':_0x8e5f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x580569,_0xdcc93d,_0x3adf38){var _0x3e7c06={'method':_0x8e5f('0xa'),'uri':_0xdcc93d,'form':{'client_id':_0x580569[_0x8e5f('0xb')],'resource':_0x580569[_0x8e5f('0xc')],'username':_0x580569[_0x8e5f('0xd')],'password':_0x580569[_0x8e5f('0xe')],'grant_type':_0x8e5f('0xe'),'client_secret':_0x580569[_0x8e5f('0xf')]},'json':!![]};return rp(_0x3e7c06)[_0x8e5f('0x10')](function(_0xe22478){return _0xe22478[_0x8e5f('0x11')];})['catch'](function(_0x3145ce){logger['error']('['+[_0x3adf38[_0x8e5f('0x12')]()]+']\x20Wrong\x20credentials!');return _0x3145ce[_0x8e5f('0x13')];});}function getUser(_0x2e8662,_0x4986cc,_0x4d0b41,_0x174d77,_0x38f27c,_0x1cd67e){return new BPromise(function(_0x57ce37,_0x198062){return getAuthToken(_0x4986cc,_0x174d77,_0x1cd67e)['then'](function(_0x407e98){var _0x31f0dc={'method':_0x8e5f('0x14'),'uri':_0x38f27c+_0x8e5f('0x15'),'headers':{'Authorization':_0x8e5f('0x16')+_0x407e98,'OData-Version':_0x8e5f('0x17')},'json':!![]};return rp(_0x31f0dc);})['then'](function(_0x2ec2d2){var _0x13aebc=_0x2ec2d2['value'];var _0x11f295=![];var _0x2149ec=null;if(!_[_0x8e5f('0x18')](_0x4d0b41)){if(intUtil[_0x8e5f('0x19')](_0x4d0b41[_0x8e5f('0x1a')])){_0x2e8662[_0x8e5f('0x1b')]=_0x4d0b41[_0x8e5f('0x1a')];for(_0x2149ec=0x0;_0x2149ec<_0x13aebc[_0x8e5f('0x1c')];_0x2149ec++){if(_0x13aebc[_0x2149ec][_0x8e5f('0x1d')]===_0x4d0b41[_0x8e5f('0x1a')]&&!_0x13aebc[_0x2149ec][_0x8e5f('0x1e')]){_0x11f295=!![];logger[_0x8e5f('0x1f')]('['+[_0x1cd67e[_0x8e5f('0x12')]()]+_0x8e5f('0x20')+_0x13aebc[_0x2149ec][_0x8e5f('0x21')]+'!');_0x2e8662[_0x8e5f('0x22')]=_0x13aebc[_0x2149ec][_0x8e5f('0x21')];}}}}if(!_0x11f295){logger[_0x8e5f('0x1f')]('['+[_0x1cd67e[_0x8e5f('0x12')]()]+_0x8e5f('0x23'));_0x2e8662[_0x8e5f('0x1b')]=_0x4986cc[_0x8e5f('0xd')];for(_0x2149ec=0x0;_0x2149ec<_0x13aebc['length'];_0x2149ec++){if(_0x13aebc[_0x2149ec]['internalemailaddress']===_0x4986cc[_0x8e5f('0xd')]){_0x2e8662[_0x8e5f('0x22')]=_0x13aebc[_0x2149ec]['systemuserid'];}}}_0x57ce37(_0x2e8662);})[_0x8e5f('0x24')](function(_0x24a11e){_0x198062(_0x24a11e['message']);});});}function createEndUser(_0x564141,_0x5a2258,_0x4e702a,_0x260080,_0x1b0554,_0x3b3245){return new BPromise(function(_0x2521e6,_0xeda36a){return getAuthToken(_0x5a2258,_0x4e702a,_0x3b3245)[_0x8e5f('0x10')](function(_0x42eb41){var _0x9e2055=_0x3b3245['toLowerCase']()===_0x8e5f('0x25')?_0x1b0554[_0x8e5f('0x26')]:_0x1b0554[_0x8e5f('0x27')];var _0x2cf6fc={'method':_0x8e5f('0xa'),'uri':_0x260080+_0x8e5f('0x28'),'body':{'telephone1':_0x9e2055,'fullname':_0x9e2055,'firstname':_0x9e2055,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8e5f('0x29')+_0x564141['userId']+')'},'headers':{'Authorization':_0x8e5f('0x16')+_0x42eb41,'OData-Version':_0x8e5f('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2cf6fc);})['then'](function(_0x2d099b){var _0x348849=_0x2d099b[_0x8e5f('0x2a')][_0x8e5f('0x2b')];var _0x27b882=_0x348849[_0x8e5f('0x2c')](_0x348849['lastIndexOf']('(')+0x1,_0x348849[_0x8e5f('0x2d')](')'));_0x564141[_0x8e5f('0x2e')]=_0x27b882;_0x2521e6(_0x564141);})[_0x8e5f('0x24')](function(_0x597c6b){_0xeda36a(_0x597c6b[_0x8e5f('0x13')]);});});}function getEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc){return new BPromise(function(_0x5824de,_0x10d3fc){var _0x3b7f3f=_0x59e8bc['toLowerCase']()==='outbound'?_0x5dc474[_0x8e5f('0x26')]:_0x5dc474[_0x8e5f('0x27')];return getAuthToken(_0x4fa3c3,_0x81616e,_0x59e8bc)[_0x8e5f('0x10')](function(_0x379f74){var _0x5ccb9f={'method':'GET','uri':_0x52679f+_0x8e5f('0x2f')+_0x3b7f3f[_0x8e5f('0x30')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x379f74,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ccb9f);})['then'](function(_0x1a697f){var _0x299a05=null;if(_0x1a697f){var _0x309952=_0x1a697f[_0x8e5f('0x31')];var _0x594ec0=![];for(_0x299a05=0x0;_0x299a05<_0x309952[_0x8e5f('0x1c')];_0x299a05++){if(_0x309952[_0x299a05][_0x8e5f('0x32')]===_0x3b7f3f){_0x594ec0=!![];_0x5ab93f['enduserId']=_0x309952[_0x299a05]['contactid'];}}if(_0x594ec0){_0x5824de(_0x5ab93f);}else{return createEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc)[_0x8e5f('0x10')](function(_0x302e06){logger[_0x8e5f('0x1f')]('['+[_0x59e8bc[_0x8e5f('0x12')]()]+_0x8e5f('0x33'),_0x302e06[_0x8e5f('0x2e')]);_0x5824de(_0x302e06);});}}else{return createEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc)[_0x8e5f('0x10')](function(_0x25489a){logger['info']('['+[_0x59e8bc['toUpperCase']()]+_0x8e5f('0x34'),_0x25489a[_0x8e5f('0x2e')]);_0x5824de(_0x25489a);});}});});}function getCustomFields(_0x3275b7,_0x405114,_0x15098d){var _0x5f198c={};if(_0x3275b7[_0x8e5f('0x1c')]>0x0){_[_0x8e5f('0x35')](_0x3275b7,function(_0x415541){if(_['includes']([_0x8e5f('0x36'),_0x8e5f('0x37')],_0x415541['type'])&&_0x415541[_0x8e5f('0x38')]&&!_0x415541[_0x8e5f('0x39')]){var _0x544bf3=_0x415541[_0x8e5f('0x3a')]['toLowerCase']();var _0x2fe89a=_0x544bf3[_0x8e5f('0x2c')](0x0,_0x544bf3[_0x8e5f('0x3b')]('_'));var _0x919f4d=_0x544bf3['substring'](_0x544bf3[_0x8e5f('0x3b')]('_')+0x1);if(_0x2fe89a===_0x15098d){_0x5f198c[_0x919f4d]=_0x415541[_0x8e5f('0x3c')];}}});}return _0x5f198c;}function getTicket(_0x96ada7,_0x47b8a9,_0x104f9a,_0x4a04a5,_0x289404,_0x27ffdc,_0x3f9c0f){return new BPromise(function(_0x20afa3,_0x112fb3){var _0x26d6fc;return getAuthToken(_0x47b8a9,_0x104f9a,_0x3f9c0f)[_0x8e5f('0x10')](function(_0x3ac3ec){if(_0x27ffdc[_0x8e5f('0x3d')]==='incident'){_0x26d6fc={'method':_0x8e5f('0xa'),'uri':_0x4a04a5+_0x8e5f('0x3e'),'body':Object[_0x8e5f('0x3f')]({},{'title':intUtil[_0x8e5f('0x40')](_0x27ffdc['Subjects'],_0x289404,'\x20'),'description':intUtil[_0x8e5f('0x40')](_0x27ffdc[_0x8e5f('0x41')],_0x289404,'\x0a'),'customerid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','ownerid@odata.bind':_0x8e5f('0x29')+_0x96ada7['userId']+')','caseorigincode':'1'},getCustomFields(_0x27ffdc['Fields'],_0x289404,_0x27ffdc[_0x8e5f('0x3d')])),'headers':{'Authorization':_0x8e5f('0x16')+_0x3ac3ec,'OData-Version':_0x8e5f('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x27ffdc[_0x8e5f('0x3d')]===_0x8e5f('0x43')){_0x26d6fc={'method':_0x8e5f('0xa'),'uri':_0x4a04a5+'phonecalls','body':Object[_0x8e5f('0x3f')]({},{'subject':intUtil[_0x8e5f('0x40')](_0x27ffdc['Subjects'],_0x289404,'\x20'),'phonenumber':String(_0x289404['calleridnum']),'description':intUtil[_0x8e5f('0x40')](_0x27ffdc['Descriptions'],_0x289404,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0x96ada7['userId']+')','directioncode':_0x96ada7[_0x8e5f('0x44')]===_0x8e5f('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8e5f('0x29')+_0x96ada7[_0x8e5f('0x22')]+')','participationtypemask':_0x96ada7[_0x8e5f('0x44')]===_0x8e5f('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','participationtypemask':_0x96ada7['callDirection']===_0x8e5f('0x45')?0x1:0x2}]},getCustomFields(_0x27ffdc[_0x8e5f('0x46')],_0x289404,_0x27ffdc[_0x8e5f('0x3d')])),'headers':{'Authorization':_0x8e5f('0x16')+_0x3ac3ec,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x26d6fc);})[_0x8e5f('0x10')](function(_0x530c92){var _0x560f53=_0x530c92[_0x8e5f('0x2a')]['odata-entityid'];var _0x33e00d=_0x560f53[_0x8e5f('0x2c')](_0x560f53['lastIndexOf']('(')+0x1,_0x560f53[_0x8e5f('0x2d')](')'));_0x96ada7['ticketId']=_0x33e00d;_0x20afa3(_0x96ada7);})[_0x8e5f('0x24')](function(_0x392b22){_0x112fb3(_0x392b22[_0x8e5f('0x13')]);});});}function emit(_0x3e233f,_0x25d49f,_0x2c6143,_0x5ab7cc){var _0xfea86f={'uri':util[_0x8e5f('0x47')](_0x8e5f('0x48'),_0x3e233f,_0x2c6143,_0x5ab7cc)};io['to'](util['format'](_0x8e5f('0x49'),_0x25d49f))[_0x8e5f('0x4a')](_0x8e5f('0x4b'),_0xfea86f);}exports['cs']=function(_0x561902,_0x102ad8,_0x18db0a,_0x4ca516,_0x45d41c,_0x188d9e,_0x41d099,_0xaebd4f){var _0x13c857={};_0x188d9e[_0x8e5f('0xc')]=intUtil[_0x8e5f('0x4c')](_0x188d9e[_0x8e5f('0xc')]);_0x188d9e[_0x8e5f('0x4d')]=intUtil[_0x8e5f('0x4c')](_0x188d9e['serverUrl']);_0x13c857[_0x8e5f('0x44')]=_0xaebd4f==='queue'||_0xaebd4f==='unmanaged'?'queue':_0x8e5f('0x25');var _0x15cec9=util[_0x8e5f('0x47')]('%s/api/data/v9.0/',_0x188d9e[_0x8e5f('0xc')]);var _0x2355c6=util['format'](_0x8e5f('0x4e'),_0x188d9e[_0x8e5f('0x4f')]);var _0x31aafd=util[_0x8e5f('0x47')](_0x8e5f('0x50'),_0x188d9e[_0x8e5f('0x4d')],_0x102ad8['uniqueid'],md5(_0x102ad8[_0x8e5f('0x51')]));if(_0x45d41c&&_0x45d41c[_0x8e5f('0x52')]){logger[_0x8e5f('0x1f')]('[QUEUE]','Recording\x20is\x20enabled!');_0x102ad8[_0x8e5f('0x53')]=_0x31aafd;}else if(_0x41d099&&_0x41d099[_0x8e5f('0x54')]&&_0x41d099[_0x8e5f('0x54')]!=='none'){logger[_0x8e5f('0x1f')](_0x8e5f('0x55'),_0x8e5f('0x56'));_0x102ad8['recordingURL']=_0x31aafd;}else{_0x102ad8[_0x8e5f('0x53')]='';}return getUser(_0x13c857,_0x188d9e,_0x4ca516,_0x2355c6,_0x15cec9,_0xaebd4f)[_0x8e5f('0x10')](function(_0x10f9a0){logger['info']('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x57'),_0x10f9a0[_0x8e5f('0x22')]);logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x58'),_0x10f9a0[_0x8e5f('0x1b')]);return getEndUser(_0x10f9a0,_0x188d9e,_0x2355c6,_0x15cec9,_0x102ad8,_0xaebd4f);})['then'](function(_0x4dec3e){logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x59'),_0x4dec3e[_0x8e5f('0x2e')]);logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5a'),_0x102ad8['calleridnum']);return getTicket(_0x4dec3e,_0x188d9e,_0x2355c6,_0x15cec9,_0x102ad8,_0x18db0a,_0xaebd4f);})['then'](function(_0x5a33fb){logger[_0x8e5f('0x1f')](util['format']('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5b'),_0x18db0a[_0x8e5f('0x3d')],_0x5a33fb['ticketId']));logger[_0x8e5f('0x1f')](util[_0x8e5f('0x47')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5c'),_0xaebd4f));if(_0xaebd4f!==_0x8e5f('0x5d')){logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+']',_0x8e5f('0x5e'));emit(_0x188d9e[_0x8e5f('0xc')],_0x4ca516['name'],_0x18db0a[_0x8e5f('0x3d')],_0x5a33fb[_0x8e5f('0x5f')]);}})[_0x8e5f('0x24')](function(_0x1540a1){logger[_0x8e5f('0x60')]('['+_0xaebd4f['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x8e5f('0x61')](_0x1540a1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 95e1898..34a34d8 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 _0x8827=['[OUTBOUND]','unmanaged','toUpperCase','recordingURL','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','
','name','Fields','mapValues','keyBy','custom_fields','format','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','POST','Enduser\x20created.','debug','[HTTP]','stringify','map','forEach','type','nameField','toLowerCase','content','toString','includes','string','picklist','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','Recording\x20is\x20enabled!','email','The\x20User\x20ID\x20is:','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x1e0396,_0x318df8){var _0x2e0b9e=function(_0x4152b1){while(--_0x4152b1){_0x1e0396['push'](_0x1e0396['shift']());}};_0x2e0b9e(++_0x318df8);}(_0x8827,0xae));var _0x7882=function(_0xced69b,_0x202374){_0xced69b=_0xced69b-0x0;var _0x334ccf=_0x8827[_0xced69b];return _0x334ccf;};'use strict';var _=require(_0x7882('0x0'));var rp=require(_0x7882('0x1'));var md5=require(_0x7882('0x2'));var util=require(_0x7882('0x3'));var Redis=require(_0x7882('0x4'));var intUtil=require(_0x7882('0x5'));var config=require(_0x7882('0x6'));var logger=require('../../../../config/logger')(_0x7882('0x7'));config[_0x7882('0x8')]=_[_0x7882('0x9')](config[_0x7882('0x8')],{'host':_0x7882('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7882('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x7882('0xb')};function emit(_0x31625b,_0x35d4e7,_0xd6039b){io['to'](_0x31625b)[_0x7882('0xc')](_0x35d4e7,_0xd6039b);}function getTicket(_0x5bf54b,_0x10206d,_0x2558b7,_0x17680f,_0x1cabab){logger[_0x7882('0xd')](_0x7882('0xe'));var _0x4246d2=_[_0x7882('0xf')]({'responder_id':_0x10206d['id'],'requester_id':_0x2558b7['id'],'name':util['format'](_0x7882('0x10'),_0x1cabab[_0x7882('0x11')]),'phone':_0x1cabab['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7882('0x12')](_0x17680f[_0x7882('0x13')],_0x1cabab,'\x20'),'description':intUtil[_0x7882('0x12')](_0x17680f['Descriptions'],_0x1cabab,_0x7882('0x14')),'tags':getTags(_0x17680f['Tags'],_0x7882('0x15'))},getCustomFields(_0x17680f[_0x7882('0x16')],_0x1cabab));_0x4246d2['custom_fields']=_[_0x7882('0x17')](_[_0x7882('0x18')](_0x4246d2[_0x7882('0x19')],'id'),'value');return request({'uri':util[_0x7882('0x1a')](_0x7882('0x1b'),_0x5bf54b[_0x7882('0x1c')]),'method':'POST','body':_0x4246d2})[_0x7882('0x1d')](function(_0x5d4832){logger[_0x7882('0xd')](_0x7882('0x1e'));return _0x5d4832;});}function getUser(_0x2a7c0c,_0x20f36e){if(intUtil['validateEmail'](_0x20f36e)){return request({'uri':util[_0x7882('0x1a')]('%s/api/v2/agents',_0x2a7c0c[_0x7882('0x1c')]),'qs':{'email':_0x20f36e}})[_0x7882('0x1d')](function(_0x503478){if(_0x503478[_0x7882('0x1f')]){logger[_0x7882('0xd')](_0x7882('0x20'));return _[_0x7882('0x21')](_0x503478,function(_0xe1a4ef){return _0xe1a4ef['contact']['email']===_0x20f36e;});}else{logger[_0x7882('0xd')](_0x7882('0x22'));return request({'uri':util['format'](_0x7882('0x23'),_0x2a7c0c[_0x7882('0x1c')])})[_0x7882('0x1d')](function(_0x4b9f6c){logger[_0x7882('0xd')](_0x7882('0x24'));return _0x4b9f6c;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x2a7c0c['remoteUri'])})[_0x7882('0x1d')](function(_0x5cd944){logger[_0x7882('0xd')](_0x7882('0x24'));return _0x5cd944;});}}function getEndUser(_0x994d62,_0x1d5f2f,_0x3084ad){logger['info']('Searching\x20enduser\x20with\x20phone',_0x3084ad);return request({'uri':util[_0x7882('0x1a')](_0x7882('0x25'),_0x994d62['remoteUri']),'qs':{'phone':_0x3084ad}})['then'](function(_0x1dab72){if(_0x1dab72['length']){logger[_0x7882('0xd')]('Enduser\x20found!');return _[_0x7882('0x21')](_0x1dab72,{'phone':_0x3084ad});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7882('0x1a')](_0x7882('0x25'),_0x994d62[_0x7882('0x1c')]),'method':_0x7882('0x26'),'body':{'name':_0x1d5f2f,'phone':_0x3084ad}})['then'](function(_0x6daca7){logger[_0x7882('0xd')](_0x7882('0x27'));return _0x6daca7;});}});}function getAuth(_0x4577f8){return util[_0x7882('0x1a')]('Basic\x20%s',new Buffer(_0x4577f8['apiKey']+':X')['toString']('base64'));}function request(_0x2303ff){logger[_0x7882('0x28')](_0x7882('0x29'),JSON[_0x7882('0x2a')](_0x2303ff));return rp(_[_0x7882('0x9')](_0x2303ff,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x24c0f1,_0x54d963){var _0x436d0e=[];if(_0x24c0f1&&_0x24c0f1[_0x7882('0x1f')]>0x0){_0x436d0e=_[_0x7882('0x2b')](_0x24c0f1,_0x54d963);}return _0x436d0e;}function getCustomFields(_0x1ed136,_0x405742){var _0x21de8b=[];var _0x57f517={'custom_fields':[]};if(_0x1ed136[_0x7882('0x1f')]>0x0){_[_0x7882('0x2c')](_0x1ed136,function(_0x1f9aef){if(_['includes'](['string','picklist'],_0x1f9aef[_0x7882('0x2d')])&&_0x1f9aef[_0x7882('0x2e')]&&!_0x1f9aef['customField']){_0x57f517[_0x1f9aef[_0x7882('0x2e')][_0x7882('0x2f')]()]=_0x1f9aef[_0x7882('0x30')][_0x7882('0x31')]();}else if(_[_0x7882('0x32')]([_0x7882('0x33'),_0x7882('0x34')],_0x1f9aef[_0x7882('0x2d')])&&_0x1f9aef[_0x7882('0x35')]&&_0x1f9aef[_0x7882('0x36')]){_0x57f517[_0x7882('0x19')][_0x7882('0x37')]({'id':_0x1f9aef[_0x7882('0x35')],'value':_0x1f9aef[_0x7882('0x30')][_0x7882('0x31')]()});}else if(_0x1f9aef[_0x7882('0x2d')]===_0x7882('0x38')&&_0x1f9aef[_0x7882('0x39')]&&_0x1f9aef[_0x7882('0x35')]&&_0x1f9aef[_0x7882('0x36')]){_0x405742[_0x1f9aef[_0x7882('0x39')]]&&_0x57f517[_0x7882('0x19')][_0x7882('0x37')]({'id':_0x1f9aef['idField'],'value':_0x405742[_0x1f9aef[_0x7882('0x39')]][_0x7882('0x31')]()});}else if(_0x1f9aef[_0x7882('0x2d')]==='customVariable'&&_0x1f9aef['Variable']&&_0x1f9aef[_0x7882('0x3a')][_0x7882('0x15')]&&_0x1f9aef[_0x7882('0x35')]&&_0x1f9aef['customField']){_0x405742[_0x1f9aef['Variable']['name']['toLowerCase']()]&&_0x57f517['custom_fields'][_0x7882('0x37')]({'id':_0x1f9aef[_0x7882('0x35')],'value':_0x405742[_0x1f9aef['Variable'][_0x7882('0x15')][_0x7882('0x2f')]()]['toString']()});}});}return _0x57f517;}exports[_0x7882('0x3b')]=function(_0xd27f61,_0x5f4215,_0x27b5cd,_0x1d2ac9,_0x4494bf,_0x5e7af3){var _0xfc85dc,_0x506b82;_0x5e7af3[_0x7882('0x1c')]=intUtil[_0x7882('0x3c')](_0x5e7af3['remoteUri']);_0x5e7af3['serverUrl']=intUtil[_0x7882('0x3c')](_0x5e7af3[_0x7882('0x3d')]);if(_0x4494bf&&_0x4494bf[_0x7882('0x3e')]){logger[_0x7882('0xd')](_0x7882('0x3f'),'Recording\x20is\x20enabled!');_0x5f4215['recordingURL']=util[_0x7882('0x1a')](_0x7882('0x40'),_0x5e7af3[_0x7882('0x3d')],_0x5f4215[_0x7882('0x41')],md5(_0x5f4215['uniqueid']));}else{_0x5f4215['recordingURL']='';}headers[_0x7882('0x42')]=getAuth(_0x5e7af3);return getUser(_0x5e7af3,_0x1d2ac9['email'])[_0x7882('0x1d')](function(_0x552149){_0xfc85dc=_0x552149;logger[_0x7882('0xd')]('The\x20User\x20ID\x20is:',_0xfc85dc['id']);return getEndUser(_0x5e7af3,_0x5f4215[_0x7882('0x11')],_0x5f4215[_0x7882('0x43')]);})['then'](function(_0x3f397d){_0x506b82=_0x3f397d;logger[_0x7882('0xd')](_0x7882('0x44'),_0x506b82['id']);return getTicket(_0x5e7af3,_0xfc85dc,_0x506b82,_0x27b5cd,_0x5f4215);})[_0x7882('0x1d')](function(_0x9c0a62){if(_0x9c0a62&&_0x9c0a62['id']){logger[_0x7882('0xd')]('Ticket\x20created!');logger[_0x7882('0xd')](_0x7882('0x45'),_0x9c0a62['id']);logger[_0x7882('0xd')](_0x7882('0x3f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7882('0x1a')](_0x7882('0x46'),_0x1d2ac9[_0x7882('0x15')]),_0x7882('0x47'),{'uri':util['format'](_0x7882('0x48'),_0x5e7af3[_0x7882('0x1c')],_0x9c0a62['id'])});}})['catch'](function(_0x49a405){logger[_0x7882('0x49')](_0x7882('0x3f'),JSON['stringify'](_0x49a405));});};exports['outbound']=function(_0x499091,_0x520b49,_0x7ccd7a,_0x40cd3e,_0xe3424c,_0x2f4f9c,_0x2c8aec){var _0xcd3202,_0x547ef1;_0x2f4f9c['remoteUri']=intUtil[_0x7882('0x3c')](_0x2f4f9c[_0x7882('0x1c')]);_0x2f4f9c[_0x7882('0x3d')]=intUtil[_0x7882('0x3c')](_0x2f4f9c[_0x7882('0x3d')]);if(_0x2c8aec&&_0x2c8aec['recordingFormat']&&_0x2c8aec[_0x7882('0x4a')]!==_0x7882('0x4b')){logger[_0x7882('0xd')]('[OUTBOUND]',_0x7882('0x4c'));_0x520b49['recordingURL']=util[_0x7882('0x1a')](_0x7882('0x40'),_0x2f4f9c['serverUrl'],_0x520b49[_0x7882('0x41')],md5(_0x520b49[_0x7882('0x41')]));}headers['Authorization']=getAuth(_0x2f4f9c);return getUser(_0x2f4f9c,_0x40cd3e[_0x7882('0x4d')])[_0x7882('0x1d')](function(_0x331f7b){_0xcd3202=_0x331f7b;logger[_0x7882('0xd')](_0x7882('0x4e'),_0xcd3202['id']);return getEndUser(_0x2f4f9c,_0x520b49['destcalleridname'],_0x520b49[_0x7882('0x4f')]);})[_0x7882('0x1d')](function(_0x37fd4f){_0x547ef1=_0x37fd4f;logger[_0x7882('0xd')](_0x7882('0x44'),_0x547ef1['id']);return getTicket(_0x2f4f9c,_0xcd3202,_0x547ef1,_0x7ccd7a,_0x520b49);})[_0x7882('0x1d')](function(_0x506cf3){if(_0x506cf3&&_0x506cf3['id']){logger[_0x7882('0xd')](_0x7882('0x1e'));logger[_0x7882('0xd')]('The\x20Ticket\x20ID\x20is:',_0x506cf3['id']);logger[_0x7882('0xd')]('[OUTBOUND]',_0x7882('0x50'));emit(util[_0x7882('0x1a')](_0x7882('0x46'),_0x40cd3e['name']),_0x7882('0x47'),{'uri':util[_0x7882('0x1a')](_0x7882('0x48'),_0x2f4f9c[_0x7882('0x1c')],_0x506cf3['id'])});}})['catch'](function(_0x51db16){logger[_0x7882('0x49')](_0x7882('0x51'),JSON[_0x7882('0x2a')](_0x51db16));});};exports[_0x7882('0x52')]=function(_0x65614c,_0x14be0e,_0x340223,_0x13a1e1,_0x234243,_0x4f86f1){var _0x9d752c,_0x51565a;_0x4f86f1[_0x7882('0x1c')]=intUtil[_0x7882('0x3c')](_0x4f86f1['remoteUri']);_0x4f86f1[_0x7882('0x3d')]=intUtil[_0x7882('0x3c')](_0x4f86f1[_0x7882('0x3d')]);if(_0x234243&&_0x234243[_0x7882('0x3e')]){logger[_0x7882('0xd')]('['+_0x14be0e['lastevent'][_0x7882('0x53')]()+']','Recording\x20is\x20enabled!');_0x14be0e[_0x7882('0x54')]=util[_0x7882('0x1a')](_0x7882('0x40'),_0x4f86f1[_0x7882('0x3d')],_0x14be0e[_0x7882('0x41')],md5(_0x14be0e['uniqueid']));}else{_0x14be0e['recordingURL']='';}headers['Authorization']=getAuth(_0x4f86f1);return getUser(_0x4f86f1,'')['then'](function(_0x3df281){_0x9d752c=_0x3df281;logger[_0x7882('0xd')](_0x7882('0x4e'),_0x9d752c['id']);return getEndUser(_0x4f86f1,_0x14be0e[_0x7882('0x11')],_0x14be0e[_0x7882('0x43')]);})['then'](function(_0x29cb18){_0x51565a=_0x29cb18;logger[_0x7882('0xd')](_0x7882('0x44'),_0x51565a['id']);return getTicket(_0x4f86f1,_0x9d752c,_0x51565a,_0x340223,_0x14be0e);})[_0x7882('0x1d')](function(_0x1651c7){if(_0x1651c7){logger[_0x7882('0xd')](_0x7882('0x1e'));logger['info'](_0x7882('0x45'),_0x1651c7['id']);}})['catch'](function(_0x505d04){logger[_0x7882('0x49')]('['+_0x14be0e['lastevent'][_0x7882('0x53')]()+']',JSON[_0x7882('0x2a')](_0x505d04));});}; \ No newline at end of file +var _0x20c5=['The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','catch','lastevent','toUpperCase','error','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','localhost','socket.io-emitter','redis','application/json','emit','info','merge','format','calleridnum','getString','Subjects','
','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','push','variable','variableName','idField','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization'];(function(_0x5cd50b,_0x2949f7){var _0x3cd3ac=function(_0x317771){while(--_0x317771){_0x5cd50b['push'](_0x5cd50b['shift']());}};_0x3cd3ac(++_0x2949f7);}(_0x20c5,0x18b));var _0x520c=function(_0x46334d,_0x5b066e){_0x46334d=_0x46334d-0x0;var _0xb4e8fa=_0x20c5[_0x46334d];return _0xb4e8fa;};'use strict';var _=require(_0x520c('0x0'));var rp=require(_0x520c('0x1'));var md5=require(_0x520c('0x2'));var util=require(_0x520c('0x3'));var Redis=require(_0x520c('0x4'));var intUtil=require(_0x520c('0x5'));var config=require('../../../../config/environment');var logger=require(_0x520c('0x6'))(_0x520c('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0x520c('0x8'),'port':0x18eb});var io=require(_0x520c('0x9'))(new Redis(config[_0x520c('0xa')]));var headers={'Content-Type':_0x520c('0xb'),'Accept':_0x520c('0xb')};function emit(_0x5bff89,_0x58da8d,_0xff8bfe){io['to'](_0x5bff89)[_0x520c('0xc')](_0x58da8d,_0xff8bfe);}function getTicket(_0x2216c5,_0x5092ce,_0x2f8b28,_0x4fdf9e,_0x210c09){logger[_0x520c('0xd')]('Creating\x20new\x20ticket...');var _0x5ee158=_[_0x520c('0xe')]({'responder_id':_0x5092ce['id'],'requester_id':_0x2f8b28['id'],'name':util[_0x520c('0xf')]('Caller\x20-\x20%s',_0x210c09['calleridname']),'phone':_0x210c09[_0x520c('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x520c('0x11')](_0x4fdf9e[_0x520c('0x12')],_0x210c09,'\x20'),'description':intUtil['getString'](_0x4fdf9e['Descriptions'],_0x210c09,_0x520c('0x13')),'tags':getTags(_0x4fdf9e['Tags'],_0x520c('0x14'))},getCustomFields(_0x4fdf9e['Fields'],_0x210c09));_0x5ee158[_0x520c('0x15')]=_[_0x520c('0x16')](_[_0x520c('0x17')](_0x5ee158[_0x520c('0x15')],'id'),_0x520c('0x18'));return request({'uri':util[_0x520c('0xf')](_0x520c('0x19'),_0x2216c5['remoteUri']),'method':_0x520c('0x1a'),'body':_0x5ee158})[_0x520c('0x1b')](function(_0x37fd84){logger[_0x520c('0xd')]('Ticket\x20created!');return _0x37fd84;});}function getUser(_0x5dc8c2,_0x2b0646){if(intUtil[_0x520c('0x1c')](_0x2b0646)){return request({'uri':util[_0x520c('0xf')](_0x520c('0x1d'),_0x5dc8c2[_0x520c('0x1e')]),'qs':{'email':_0x2b0646}})[_0x520c('0x1b')](function(_0x26a296){if(_0x26a296[_0x520c('0x1f')]){logger['info'](_0x520c('0x20'));return _[_0x520c('0x21')](_0x26a296,function(_0x337f21){return _0x337f21[_0x520c('0x22')][_0x520c('0x23')]===_0x2b0646;});}else{logger['info'](_0x520c('0x24'));return request({'uri':util['format'](_0x520c('0x25'),_0x5dc8c2[_0x520c('0x1e')])})[_0x520c('0x1b')](function(_0x12ee20){logger[_0x520c('0xd')](_0x520c('0x26'));return _0x12ee20;});}});}else{logger['info'](_0x520c('0x27'));return request({'uri':util['format'](_0x520c('0x25'),_0x5dc8c2[_0x520c('0x1e')])})[_0x520c('0x1b')](function(_0x3e17f2){logger[_0x520c('0xd')](_0x520c('0x26'));return _0x3e17f2;});}}function getEndUser(_0x46622a,_0x3d0677,_0x1f61bb){logger['info'](_0x520c('0x28'),_0x1f61bb);return request({'uri':util[_0x520c('0xf')](_0x520c('0x29'),_0x46622a['remoteUri']),'qs':{'phone':_0x1f61bb}})['then'](function(_0xf5f28c){if(_0xf5f28c['length']){logger['info']('Enduser\x20found!');return _[_0x520c('0x21')](_0xf5f28c,{'phone':_0x1f61bb});}else{logger[_0x520c('0xd')](_0x520c('0x2a'));return request({'uri':util[_0x520c('0xf')](_0x520c('0x29'),_0x46622a[_0x520c('0x1e')]),'method':'POST','body':{'name':_0x3d0677,'phone':_0x1f61bb}})['then'](function(_0x27bfbe){logger[_0x520c('0xd')](_0x520c('0x2b'));return _0x27bfbe;});}});}function getAuth(_0x8d188f){return util[_0x520c('0xf')](_0x520c('0x2c'),new Buffer(_0x8d188f['apiKey']+':X')['toString'](_0x520c('0x2d')));}function request(_0x5a248a){logger[_0x520c('0x2e')](_0x520c('0x2f'),JSON[_0x520c('0x30')](_0x5a248a));return rp(_['defaults'](_0x5a248a,{'method':_0x520c('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x519049,_0x4a17f3){var _0x180fca=[];if(_0x519049&&_0x519049[_0x520c('0x1f')]>0x0){_0x180fca=_[_0x520c('0x32')](_0x519049,_0x4a17f3);}return _0x180fca;}function getCustomFields(_0x280d70,_0x3871a5){var _0x4d7ddb=[];var _0x59dc33={'custom_fields':[]};if(_0x280d70[_0x520c('0x1f')]>0x0){_[_0x520c('0x33')](_0x280d70,function(_0x4db5c9){if(_[_0x520c('0x34')](['string',_0x520c('0x35')],_0x4db5c9[_0x520c('0x36')])&&_0x4db5c9[_0x520c('0x37')]&&!_0x4db5c9[_0x520c('0x38')]){_0x59dc33[_0x4db5c9[_0x520c('0x37')][_0x520c('0x39')]()]=_0x4db5c9[_0x520c('0x3a')][_0x520c('0x3b')]();}else if(_[_0x520c('0x34')]([_0x520c('0x3c'),_0x520c('0x35')],_0x4db5c9[_0x520c('0x36')])&&_0x4db5c9['idField']&&_0x4db5c9[_0x520c('0x38')]){_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9['idField'],'value':_0x4db5c9[_0x520c('0x3a')][_0x520c('0x3b')]()});}else if(_0x4db5c9[_0x520c('0x36')]===_0x520c('0x3e')&&_0x4db5c9[_0x520c('0x3f')]&&_0x4db5c9[_0x520c('0x40')]&&_0x4db5c9['customField']){_0x3871a5[_0x4db5c9['variableName']]&&_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9['idField'],'value':_0x3871a5[_0x4db5c9[_0x520c('0x3f')]]['toString']()});}else if(_0x4db5c9[_0x520c('0x36')]===_0x520c('0x41')&&_0x4db5c9[_0x520c('0x42')]&&_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')]&&_0x4db5c9[_0x520c('0x40')]&&_0x4db5c9['customField']){_0x3871a5[_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')][_0x520c('0x39')]()]&&_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9[_0x520c('0x40')],'value':_0x3871a5[_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')][_0x520c('0x39')]()][_0x520c('0x3b')]()});}});}return _0x59dc33;}exports[_0x520c('0x43')]=function(_0x261308,_0x38214c,_0x13e2bb,_0x4e24b7,_0xe6752a,_0x516ce0){var _0x34ac9f,_0x4af261;_0x516ce0['remoteUri']=intUtil['stripTrailingSlash'](_0x516ce0[_0x520c('0x1e')]);_0x516ce0['serverUrl']=intUtil['stripTrailingSlash'](_0x516ce0[_0x520c('0x44')]);if(_0xe6752a&&_0xe6752a[_0x520c('0x45')]){logger[_0x520c('0xd')](_0x520c('0x46'),_0x520c('0x47'));_0x38214c[_0x520c('0x48')]=util[_0x520c('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x516ce0['serverUrl'],_0x38214c[_0x520c('0x49')],md5(_0x38214c[_0x520c('0x49')]));}else{_0x38214c[_0x520c('0x48')]='';}headers[_0x520c('0x4a')]=getAuth(_0x516ce0);return getUser(_0x516ce0,_0x4e24b7[_0x520c('0x23')])['then'](function(_0x3c0907){_0x34ac9f=_0x3c0907;logger[_0x520c('0xd')](_0x520c('0x4b'),_0x34ac9f['id']);return getEndUser(_0x516ce0,_0x38214c[_0x520c('0x4c')],_0x38214c[_0x520c('0x10')]);})[_0x520c('0x1b')](function(_0x5184ff){_0x4af261=_0x5184ff;logger[_0x520c('0xd')](_0x520c('0x4d'),_0x4af261['id']);return getTicket(_0x516ce0,_0x34ac9f,_0x4af261,_0x13e2bb,_0x38214c);})[_0x520c('0x1b')](function(_0x21916e){if(_0x21916e&&_0x21916e['id']){logger[_0x520c('0xd')](_0x520c('0x4e'));logger['info'](_0x520c('0x4f'),_0x21916e['id']);logger[_0x520c('0xd')](_0x520c('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x520c('0xf')](_0x520c('0x50'),_0x4e24b7[_0x520c('0x14')]),_0x520c('0x51'),{'uri':util[_0x520c('0xf')](_0x520c('0x52'),_0x516ce0[_0x520c('0x1e')],_0x21916e['id'])});}})['catch'](function(_0x241d79){logger['error'](_0x520c('0x46'),JSON[_0x520c('0x30')](_0x241d79));});};exports[_0x520c('0x53')]=function(_0x54193b,_0x54fcea,_0x7a87c9,_0x465f7e,_0x277ede,_0x2a3b77,_0x477c2f){var _0x3e9164,_0x11f182;_0x2a3b77[_0x520c('0x1e')]=intUtil[_0x520c('0x54')](_0x2a3b77[_0x520c('0x1e')]);_0x2a3b77['serverUrl']=intUtil[_0x520c('0x54')](_0x2a3b77[_0x520c('0x44')]);if(_0x477c2f&&_0x477c2f['recordingFormat']&&_0x477c2f[_0x520c('0x55')]!==_0x520c('0x56')){logger[_0x520c('0xd')](_0x520c('0x57'),_0x520c('0x47'));_0x54fcea[_0x520c('0x48')]=util[_0x520c('0xf')](_0x520c('0x58'),_0x2a3b77[_0x520c('0x44')],_0x54fcea[_0x520c('0x49')],md5(_0x54fcea[_0x520c('0x49')]));}headers[_0x520c('0x4a')]=getAuth(_0x2a3b77);return getUser(_0x2a3b77,_0x465f7e[_0x520c('0x23')])[_0x520c('0x1b')](function(_0x560195){_0x3e9164=_0x560195;logger[_0x520c('0xd')]('The\x20User\x20ID\x20is:',_0x3e9164['id']);return getEndUser(_0x2a3b77,_0x54fcea['destcalleridname'],_0x54fcea[_0x520c('0x59')]);})[_0x520c('0x1b')](function(_0xacb84c){_0x11f182=_0xacb84c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x11f182['id']);return getTicket(_0x2a3b77,_0x3e9164,_0x11f182,_0x7a87c9,_0x54fcea);})['then'](function(_0x8f258f){if(_0x8f258f&&_0x8f258f['id']){logger[_0x520c('0xd')](_0x520c('0x4e'));logger[_0x520c('0xd')](_0x520c('0x4f'),_0x8f258f['id']);logger[_0x520c('0xd')](_0x520c('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x520c('0xf')](_0x520c('0x50'),_0x465f7e[_0x520c('0x14')]),_0x520c('0x51'),{'uri':util[_0x520c('0xf')]('%s/helpdesk/tickets/%d',_0x2a3b77[_0x520c('0x1e')],_0x8f258f['id'])});}})[_0x520c('0x5a')](function(_0x19bfe6){logger['error'](_0x520c('0x57'),JSON[_0x520c('0x30')](_0x19bfe6));});};exports['unmanaged']=function(_0x3fe292,_0x545f2e,_0x5a6a77,_0x3385a7,_0xceea0a,_0x51a054){var _0x2e37d4,_0x4fa8a6;_0x51a054[_0x520c('0x1e')]=intUtil[_0x520c('0x54')](_0x51a054[_0x520c('0x1e')]);_0x51a054[_0x520c('0x44')]=intUtil[_0x520c('0x54')](_0x51a054[_0x520c('0x44')]);if(_0xceea0a&&_0xceea0a[_0x520c('0x45')]){logger[_0x520c('0xd')]('['+_0x545f2e[_0x520c('0x5b')][_0x520c('0x5c')]()+']',_0x520c('0x47'));_0x545f2e[_0x520c('0x48')]=util[_0x520c('0xf')](_0x520c('0x58'),_0x51a054['serverUrl'],_0x545f2e['uniqueid'],md5(_0x545f2e[_0x520c('0x49')]));}else{_0x545f2e['recordingURL']='';}headers[_0x520c('0x4a')]=getAuth(_0x51a054);return getUser(_0x51a054,'')['then'](function(_0x1ad560){_0x2e37d4=_0x1ad560;logger['info'](_0x520c('0x4b'),_0x2e37d4['id']);return getEndUser(_0x51a054,_0x545f2e[_0x520c('0x4c')],_0x545f2e[_0x520c('0x10')]);})[_0x520c('0x1b')](function(_0x36074a){_0x4fa8a6=_0x36074a;logger[_0x520c('0xd')](_0x520c('0x4d'),_0x4fa8a6['id']);return getTicket(_0x51a054,_0x2e37d4,_0x4fa8a6,_0x5a6a77,_0x545f2e);})[_0x520c('0x1b')](function(_0x194ade){if(_0x194ade){logger['info'](_0x520c('0x4e'));logger[_0x520c('0xd')](_0x520c('0x4f'),_0x194ade['id']);}})[_0x520c('0x5a')](function(_0x169f33){logger[_0x520c('0x5d')]('['+_0x545f2e[_0x520c('0x5b')][_0x520c('0x5c')]()+']',JSON[_0x520c('0x30')](_0x169f33));});}; \ 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 7b4447b..ec7e5fc 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 _0x7e13=['../../../../config/environment','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','headers','Getting\x20admin\x20information','then','users','length','email','info','adminId','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&f=','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','getString','Contact','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7e13,0x1a1));var _0x37e1=function(_0x345820,_0x11508b){_0x345820=_0x345820-0x0;var _0x2c1924=_0x7e13[_0x345820];return _0x2c1924;};'use strict';var _=require(_0x37e1('0x0'));var rp=require(_0x37e1('0x1'));var md5=require(_0x37e1('0x2'));var util=require(_0x37e1('0x3'));var moment=require(_0x37e1('0x4'));var Promise=require(_0x37e1('0x5'));var Redis=require(_0x37e1('0x6'));var intUtil=require(_0x37e1('0x7'));var config=require(_0x37e1('0x8'));var logger=require(_0x37e1('0x9'))(_0x37e1('0xa'));config[_0x37e1('0xb')]=_['defaults'](config[_0x37e1('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x37e1('0xc'))(new Redis(config['redis']));function getAdminId(_0x49cce0,_0x266fa8,_0x17d78c,_0x1591c7){return new Promise(function(_0x2740cd,_0x4f15bf){var _0x44b2b2=![];var _0x3d8d27={'method':_0x37e1('0xd'),'uri':_0x1591c7+'/api/selector/owners','json':!![]};_0x3d8d27[_0x37e1('0xe')]=_0x17d78c;logger['info'](_0x37e1('0xf'));return rp(_0x3d8d27)[_0x37e1('0x10')](function(_0x1beaa9){if(_0x1beaa9){var _0x2bb0a1=_0x1beaa9[_0x37e1('0x11')];var _0x295472=null;for(_0x295472=0x0;_0x295472<_0x2bb0a1[_0x37e1('0x12')];_0x295472++){if(_0x2bb0a1[_0x295472][_0x37e1('0x13')]===_0x49cce0['adminEmail']){_0x49cce0['adminId']=_0x2bb0a1[_0x295472]['id'];_0x44b2b2=!![];}}if(_0x44b2b2){logger[_0x37e1('0x14')]('Admin\x20found:',_0x49cce0[_0x37e1('0x15')]);_0x2740cd(_0x49cce0);}else{_0x4f15bf({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4f15bf({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x5ec21d){logger[_0x37e1('0x16')]('['+[_0x266fa8[_0x37e1('0x17')]()]+']',_0x5ec21d[_0x37e1('0x18')]);_0x4f15bf(_0x5ec21d);});});}function getUser(_0x3a6726,_0x302ad1,_0x26c2bd){return function(_0x32dfb8){return new Promise(function(_0x327c21,_0x2aa449){var _0x3aef54={'method':_0x37e1('0xd'),'uri':_0x26c2bd+'/api/selector/owners','json':!![]};_0x3aef54['headers']=_0x302ad1;logger['info'](_0x37e1('0x19'));return rp(_0x3aef54)[_0x37e1('0x10')](function(_0x1dd5d4){if(_0x1dd5d4){var _0x4185f6=_0x1dd5d4[_0x37e1('0x11')];var _0x22290e=![];var _0x2261a5=null;if(_0x32dfb8[_0x37e1('0x1a')]!==null){logger[_0x37e1('0x14')](_0x37e1('0x1b'),_0x32dfb8[_0x37e1('0x1a')]);_0x32dfb8[_0x37e1('0x1c')]=_0x32dfb8[_0x37e1('0x1a')];for(_0x2261a5=0x0;_0x2261a5<_0x4185f6[_0x37e1('0x12')];_0x2261a5++){if(_0x4185f6[_0x2261a5][_0x37e1('0x13')]===_0x32dfb8[_0x37e1('0x1a')]){_0x22290e=!![];_0x32dfb8[_0x37e1('0x1d')]=_0x4185f6[_0x2261a5]['id'];logger[_0x37e1('0x14')](_0x37e1('0x1e'),_0x32dfb8[_0x37e1('0x1d')]);}}}if(!_0x22290e){logger[_0x37e1('0x14')](_0x37e1('0x1f'));_0x32dfb8[_0x37e1('0x1c')]=_0x32dfb8[_0x37e1('0x20')];_0x32dfb8[_0x37e1('0x1d')]=_0x32dfb8['adminId'];_0x22290e=!![];}if(_0x22290e){_0x327c21(_0x32dfb8);}else{_0x2aa449({'statusCode':0x194,'message':_0x37e1('0x21')});}}else{_0x2aa449({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x11510b){logger['error']('['+[_0x3a6726[_0x37e1('0x17')]()]+']',_0x11510b[_0x37e1('0x18')]);_0x2aa449(_0x11510b);});});};}function searchContact(_0x57bcd0,_0x4a430c,_0xbca91e,_0x20d3b1){return new Promise(function(_0x6628bd,_0x3a0c45){var _0x5a987d={'method':_0x37e1('0xd'),'headers':_0x4a430c,'uri':_0x57bcd0+_0x37e1('0x22')+_0x20d3b1+_0x37e1('0x23')+_0xbca91e+'&entities=contact','json':!![]};rp(_0x5a987d)[_0x37e1('0x10')](function(_0x139952){var _0x15d94d=_[_0x37e1('0x24')](_0x139952['contacts'][_0x37e1('0x25')],[_0xbca91e,_0x20d3b1]);_0x6628bd(_0x15d94d);})[_0x37e1('0x26')](function(_0x5bcebc){_0x3a0c45(_0x5bcebc);});});}function getEndUser(_0x5d97c7,_0x5ed39d,_0x171d76){return function(_0xc84057){return new Promise(function(_0x54b777,_0x175a79){logger[_0x37e1('0x14')](util[_0x37e1('0x27')](_0x37e1('0x28'),_0xc84057[_0x37e1('0x29')]));searchContact(_0x171d76,_0x5ed39d,_0x37e1('0x2a'),_0xc84057[_0x37e1('0x29')])[_0x37e1('0x10')](function(_0x31e770){if(_0x31e770){_0xc84057['endUserId']=_0x31e770['id'];logger[_0x37e1('0x14')](_0x37e1('0x2b'),_0xc84057[_0x37e1('0x2c')]);return _0x54b777(_0xc84057);}searchContact(_0x171d76,_0x5ed39d,_0x37e1('0x2d'),_0xc84057[_0x37e1('0x29')])['then'](function(_0x3f7e5b){if(_0x3f7e5b){_0xc84057['endUserId']=_0x3f7e5b['id'];logger['info'](_0x37e1('0x2e'),_0xc84057['endUserId']);return _0x54b777(_0xc84057);}createEndUser(_0xc84057,_0x5d97c7,_0x5ed39d,_0x171d76)[_0x37e1('0x10')](function(_0x57ab3c){logger[_0x37e1('0x14')](_0x37e1('0x2f'),_0x57ab3c[_0x37e1('0x2c')]);return _0x54b777(_0x57ab3c);});});})['catch'](function(_0xb1e5d0){_0x175a79(_0xb1e5d0);});});};}function createEndUser(_0xcc0f66,_0x12f806,_0x945e96,_0xb99d92){return new Promise(function(_0x3df224,_0x2e95d5){var _0x42b439=moment();var _0x43262d={'method':'POST','uri':_0xb99d92+'/api/contacts','body':{'contact':{'last_name':_0xcc0f66['contactNumber'],'work_number':_0xcc0f66[_0x37e1('0x29')],'mobile_number':_0xcc0f66['contactNumber'],'owner_id':_0xcc0f66[_0x37e1('0x1d')],'created_at':_0x42b439[_0x37e1('0x27')](_0x37e1('0x30'))}},'json':!![]};_0x43262d[_0x37e1('0xe')]=_0x945e96;logger[_0x37e1('0x14')](_0x37e1('0x31'));return rp(_0x43262d)[_0x37e1('0x10')](function(_0x1263e3){_0xcc0f66[_0x37e1('0x2c')]=_0x1263e3[_0x37e1('0x32')]['id'];_0x3df224(_0xcc0f66);})[_0x37e1('0x26')](function(_0x33341a){logger['error']('['+[_0x12f806[_0x37e1('0x17')]()]+']',_0x33341a['message']);_0x2e95d5(_0x33341a[_0x37e1('0x18')]);});});}function getTicket(_0x30f430,_0x5e08d7,_0x1ec2f7,_0x5775e6,_0x5c5b37){return function(_0x428c77){logger[_0x37e1('0x14')]('Creating\x20new\x20task');return new Promise(function(_0x3d516d,_0x3ddb01){var _0x475b8a=moment();var _0x45c9e6={'method':_0x37e1('0x33'),'uri':_0x1ec2f7+_0x37e1('0x34'),'body':{'title':intUtil[_0x37e1('0x35')](_0x5775e6['Subjects'],_0x5c5b37,'\x20'),'description':intUtil['getString'](_0x5775e6['Descriptions'],_0x5c5b37,'\x0a'),'owner_id':_0x428c77[_0x37e1('0x1d')],'creater_id':_0x428c77[_0x37e1('0x15')],'targetable_id':_0x428c77['endUserId'],'targetable_type':_0x37e1('0x36'),'created_at':_0x475b8a[_0x37e1('0x27')](_0x37e1('0x30')),'due_date':_0x475b8a['add'](0x1e,'m')[_0x37e1('0x27')](_0x37e1('0x30'))},'json':!![]};_0x45c9e6[_0x37e1('0xe')]=_0x5e08d7;return rp(_0x45c9e6)[_0x37e1('0x10')](function(_0x16e7ed){_0x428c77[_0x37e1('0x37')]=_0x16e7ed[_0x37e1('0x38')]['id'];logger[_0x37e1('0x14')](_0x37e1('0x39'),_0x428c77[_0x37e1('0x37')]);_0x3d516d(_0x428c77);})[_0x37e1('0x26')](function(_0x5fa950){logger[_0x37e1('0x16')]('['+[_0x30f430[_0x37e1('0x17')]()]+']',_0x5fa950[_0x37e1('0x18')]);_0x3ddb01(_0x5fa950[_0x37e1('0x18')]);});});};}function emit(_0x4ab908,_0x28b842,_0x483d1c){var _0xa2a7da={'uri':_0x4ab908+_0x37e1('0x3a')+_0x483d1c};io['to'](util[_0x37e1('0x27')]('user:%s',_0x28b842))[_0x37e1('0x3b')](_0x37e1('0x3c'),_0xa2a7da);}exports['cs']=function(_0x3c7a28,_0x49544c,_0x3f4b30,_0x367f1c,_0x4e0168,_0x169a3e,_0x358cbe,_0x154cc0){var _0x2170ce={};var _0xd77e66={'Authorization':_0x37e1('0x3d')+_0x169a3e[_0x37e1('0x3e')]};_0x169a3e[_0x37e1('0x3f')]=intUtil[_0x37e1('0x40')](_0x169a3e['remoteUri']);_0x169a3e[_0x37e1('0x41')]=intUtil['stripTrailingSlash'](_0x169a3e[_0x37e1('0x41')]);var _0x442bdf=_0x169a3e[_0x37e1('0x3f')];_0x2170ce['adminEmail']=_0x169a3e[_0x37e1('0x42')];_0x2170ce[_0x37e1('0x29')]=_0x154cc0[_0x37e1('0x43')]()===_0x37e1('0x44')?_0x49544c[_0x37e1('0x45')]:_0x49544c[_0x37e1('0x46')];_0x2170ce[_0x37e1('0x47')]=_0x154cc0==='queue'||_0x154cc0===_0x37e1('0x48')?'queue':'outbound';if(_0x367f1c){_0x2170ce[_0x37e1('0x1a')]=_0x367f1c['email'];}var _0x2ab64c=util[_0x37e1('0x27')](_0x37e1('0x49'),_0x169a3e[_0x37e1('0x41')],_0x49544c[_0x37e1('0x4a')],md5(_0x49544c['uniqueid']));if(_0x4e0168&&_0x4e0168[_0x37e1('0x4b')]){logger['info']('[QUEUE]',_0x37e1('0x4c'));_0x49544c[_0x37e1('0x4d')]=_0x2ab64c;}else if(_0x358cbe&&_0x358cbe[_0x37e1('0x4e')]&&_0x358cbe['recordingFormat']!==_0x37e1('0x4f')){logger[_0x37e1('0x14')](_0x37e1('0x50'),_0x37e1('0x4c'));_0x49544c[_0x37e1('0x4d')]=_0x2ab64c;}else{_0x49544c[_0x37e1('0x4d')]='';}return getAdminId(_0x2170ce,_0x154cc0,_0xd77e66,_0x442bdf)[_0x37e1('0x10')](getUser(_0x154cc0,_0xd77e66,_0x442bdf))['then'](getEndUser(_0x154cc0,_0xd77e66,_0x442bdf))[_0x37e1('0x10')](getTicket(_0x154cc0,_0xd77e66,_0x442bdf,_0x3f4b30,_0x49544c))[_0x37e1('0x10')](function(_0xa1637d){logger['info'](util['format'](_0x37e1('0x51'),_0xa1637d[_0x37e1('0x37')]));if(_0x154cc0!==_0x37e1('0x48')){logger[_0x37e1('0x14')]('['+[_0x154cc0[_0x37e1('0x17')]()]+']',_0x37e1('0x52'));emit(_0x442bdf,_0x367f1c[_0x37e1('0x53')],_0xa1637d['endUserId']);}})['catch'](function(_0x4a072d){logger[_0x37e1('0x16')]('['+[_0x154cc0[_0x37e1('0x17')]()]+_0x37e1('0x54'),util['inspect'](_0x4a072d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9253=['GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Contact','add','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter'];(function(_0x13f0f2,_0x2b3566){var _0xe733ed=function(_0x2c64e4){while(--_0x2c64e4){_0x13f0f2['push'](_0x13f0f2['shift']());}};_0xe733ed(++_0x2b3566);}(_0x9253,0x91));var _0x3925=function(_0x5d9d1e,_0x287c37){_0x5d9d1e=_0x5d9d1e-0x0;var _0x2fc272=_0x9253[_0x5d9d1e];return _0x2fc272;};'use strict';var _=require(_0x3925('0x0'));var rp=require(_0x3925('0x1'));var md5=require('md5');var util=require(_0x3925('0x2'));var moment=require(_0x3925('0x3'));var Promise=require('bluebird');var Redis=require(_0x3925('0x4'));var intUtil=require('./util');var config=require(_0x3925('0x5'));var logger=require(_0x3925('0x6'))(_0x3925('0x7'));config[_0x3925('0x8')]=_['defaults'](config[_0x3925('0x8')],{'host':_0x3925('0x9'),'port':0x18eb});var io=require(_0x3925('0xa'))(new Redis(config[_0x3925('0x8')]));function getAdminId(_0x751397,_0x27231a,_0x40aaa5,_0x5abfc6){return new Promise(function(_0x3b579d,_0x3d4dae){var _0x236a33=![];var _0x3d3f8e={'method':_0x3925('0xb'),'uri':_0x5abfc6+_0x3925('0xc'),'json':!![]};_0x3d3f8e['headers']=_0x40aaa5;logger[_0x3925('0xd')](_0x3925('0xe'));return rp(_0x3d3f8e)[_0x3925('0xf')](function(_0x117285){if(_0x117285){var _0x13572d=_0x117285[_0x3925('0x10')];var _0x448c90=null;for(_0x448c90=0x0;_0x448c90<_0x13572d[_0x3925('0x11')];_0x448c90++){if(_0x13572d[_0x448c90][_0x3925('0x12')]===_0x751397['adminEmail']){_0x751397[_0x3925('0x13')]=_0x13572d[_0x448c90]['id'];_0x236a33=!![];}}if(_0x236a33){logger[_0x3925('0xd')](_0x3925('0x14'),_0x751397[_0x3925('0x13')]);_0x3b579d(_0x751397);}else{_0x3d4dae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3d4dae({'statusCode':0x194,'message':_0x3925('0x15')});}})[_0x3925('0x16')](function(_0x595c79){logger[_0x3925('0x17')]('['+[_0x27231a[_0x3925('0x18')]()]+']',_0x595c79[_0x3925('0x19')]);_0x3d4dae(_0x595c79);});});}function getUser(_0xca5ebd,_0x6be7dc,_0x4fa243){return function(_0x3b5762){return new Promise(function(_0x3cdc2d,_0x2c68a4){var _0x56bd39={'method':_0x3925('0xb'),'uri':_0x4fa243+_0x3925('0xc'),'json':!![]};_0x56bd39['headers']=_0x6be7dc;logger[_0x3925('0xd')](_0x3925('0x1a'));return rp(_0x56bd39)[_0x3925('0xf')](function(_0x490580){if(_0x490580){var _0x2e920f=_0x490580['users'];var _0x391876=![];var _0x34fc24=null;if(_0x3b5762[_0x3925('0x1b')]!==null){logger[_0x3925('0xd')](_0x3925('0x1c'),_0x3b5762[_0x3925('0x1b')]);_0x3b5762[_0x3925('0x1d')]=_0x3b5762[_0x3925('0x1b')];for(_0x34fc24=0x0;_0x34fc24<_0x2e920f[_0x3925('0x11')];_0x34fc24++){if(_0x2e920f[_0x34fc24][_0x3925('0x12')]===_0x3b5762['agentEmail']){_0x391876=!![];_0x3b5762[_0x3925('0x1e')]=_0x2e920f[_0x34fc24]['id'];logger[_0x3925('0xd')](_0x3925('0x1f'),_0x3b5762[_0x3925('0x1e')]);}}}if(!_0x391876){logger[_0x3925('0xd')](_0x3925('0x20'));_0x3b5762[_0x3925('0x1d')]=_0x3b5762['adminEmail'];_0x3b5762['userId']=_0x3b5762[_0x3925('0x13')];_0x391876=!![];}if(_0x391876){_0x3cdc2d(_0x3b5762);}else{_0x2c68a4({'statusCode':0x194,'message':_0x3925('0x15')});}}else{_0x2c68a4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4ba265){logger[_0x3925('0x17')]('['+[_0xca5ebd[_0x3925('0x18')]()]+']',_0x4ba265['message']);_0x2c68a4(_0x4ba265);});});};}function searchContact(_0x530ba9,_0x3d32f6,_0x65b876,_0x106764){return new Promise(function(_0xc23320,_0x1ecc92){var _0x47d5c7={'method':_0x3925('0xb'),'headers':_0x3d32f6,'uri':_0x530ba9+'/api/lookup?q='+_0x106764+_0x3925('0x21')+_0x65b876+_0x3925('0x22'),'json':!![]};rp(_0x47d5c7)[_0x3925('0xf')](function(_0x1d6e73){var _0x19e095=_[_0x3925('0x23')](_0x1d6e73[_0x3925('0x24')][_0x3925('0x24')],[_0x65b876,_0x106764]);_0xc23320(_0x19e095);})[_0x3925('0x16')](function(_0x29ffb7){_0x1ecc92(_0x29ffb7);});});}function getEndUser(_0xbbdba6,_0x43addb,_0x33202a){return function(_0x499ed1){return new Promise(function(_0x2d0295,_0x2d3f94){logger[_0x3925('0xd')](util[_0x3925('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x499ed1[_0x3925('0x26')]));searchContact(_0x33202a,_0x43addb,'mobile_number',_0x499ed1[_0x3925('0x26')])[_0x3925('0xf')](function(_0x423e78){if(_0x423e78){_0x499ed1[_0x3925('0x27')]=_0x423e78['id'];logger[_0x3925('0xd')](_0x3925('0x28'),_0x499ed1['endUserId']);return _0x2d0295(_0x499ed1);}searchContact(_0x33202a,_0x43addb,'work_number',_0x499ed1['contactNumber'])[_0x3925('0xf')](function(_0x4fe878){if(_0x4fe878){_0x499ed1['endUserId']=_0x4fe878['id'];logger['info']('Contact\x20found\x20work_number:',_0x499ed1[_0x3925('0x27')]);return _0x2d0295(_0x499ed1);}createEndUser(_0x499ed1,_0xbbdba6,_0x43addb,_0x33202a)[_0x3925('0xf')](function(_0x289b95){logger[_0x3925('0xd')]('Contact\x20created:',_0x289b95[_0x3925('0x27')]);return _0x2d0295(_0x289b95);});});})['catch'](function(_0x1d6b86){_0x2d3f94(_0x1d6b86);});});};}function createEndUser(_0x307301,_0x552740,_0x3d230e,_0x57d65b){return new Promise(function(_0x4b42a6,_0x513cd7){var _0x493597=moment();var _0x5c6fad={'method':'POST','uri':_0x57d65b+'/api/contacts','body':{'contact':{'last_name':_0x307301[_0x3925('0x26')],'work_number':_0x307301[_0x3925('0x26')],'mobile_number':_0x307301[_0x3925('0x26')],'owner_id':_0x307301['userId'],'created_at':_0x493597[_0x3925('0x25')](_0x3925('0x29'))}},'json':!![]};_0x5c6fad[_0x3925('0x2a')]=_0x3d230e;logger[_0x3925('0xd')](_0x3925('0x2b'));return rp(_0x5c6fad)['then'](function(_0x5cda92){_0x307301[_0x3925('0x27')]=_0x5cda92[_0x3925('0x2c')]['id'];_0x4b42a6(_0x307301);})[_0x3925('0x16')](function(_0x2db867){logger[_0x3925('0x17')]('['+[_0x552740[_0x3925('0x18')]()]+']',_0x2db867[_0x3925('0x19')]);_0x513cd7(_0x2db867[_0x3925('0x19')]);});});}function getTicket(_0x41d48b,_0x38fcd8,_0xc60bcf,_0x4df68d,_0x3a2b62){return function(_0x4f9283){logger['info'](_0x3925('0x2d'));return new Promise(function(_0x1d8dd6,_0x3064ce){var _0x52afdf=moment();var _0x5ad46c={'method':'POST','uri':_0xc60bcf+_0x3925('0x2e'),'body':{'title':intUtil[_0x3925('0x2f')](_0x4df68d['Subjects'],_0x3a2b62,'\x20'),'description':intUtil[_0x3925('0x2f')](_0x4df68d['Descriptions'],_0x3a2b62,'\x0a'),'owner_id':_0x4f9283[_0x3925('0x1e')],'creater_id':_0x4f9283[_0x3925('0x13')],'targetable_id':_0x4f9283['endUserId'],'targetable_type':_0x3925('0x30'),'created_at':_0x52afdf[_0x3925('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x52afdf[_0x3925('0x31')](0x1e,'m')[_0x3925('0x25')](_0x3925('0x29'))},'json':!![]};_0x5ad46c['headers']=_0x38fcd8;return rp(_0x5ad46c)['then'](function(_0x5b07d9){_0x4f9283['ticketId']=_0x5b07d9[_0x3925('0x32')]['id'];logger[_0x3925('0xd')](_0x3925('0x33'),_0x4f9283['ticketId']);_0x1d8dd6(_0x4f9283);})[_0x3925('0x16')](function(_0x35fef7){logger[_0x3925('0x17')]('['+[_0x41d48b['toUpperCase']()]+']',_0x35fef7[_0x3925('0x19')]);_0x3064ce(_0x35fef7[_0x3925('0x19')]);});});};}function emit(_0x73cfc3,_0x4f9683,_0x2dba00){var _0x1fa0a4={'uri':_0x73cfc3+_0x3925('0x34')+_0x2dba00};io['to'](util[_0x3925('0x25')](_0x3925('0x35'),_0x4f9683))['emit'](_0x3925('0x36'),_0x1fa0a4);}exports['cs']=function(_0x2103cd,_0x30274b,_0x48e26c,_0x3c96bb,_0x3e7c88,_0x196a46,_0x43aa7b,_0x1e7b0a){var _0x49d741={};var _0x142ab7={'Authorization':_0x3925('0x37')+_0x196a46[_0x3925('0x38')]};_0x196a46[_0x3925('0x39')]=intUtil[_0x3925('0x3a')](_0x196a46[_0x3925('0x39')]);_0x196a46[_0x3925('0x3b')]=intUtil[_0x3925('0x3a')](_0x196a46[_0x3925('0x3b')]);var _0x4fb576=_0x196a46[_0x3925('0x39')];_0x49d741[_0x3925('0x3c')]=_0x196a46[_0x3925('0x3d')];_0x49d741[_0x3925('0x26')]=_0x1e7b0a['toLowerCase']()===_0x3925('0x3e')?_0x30274b[_0x3925('0x3f')]:_0x30274b[_0x3925('0x40')];_0x49d741['callDirection']=_0x1e7b0a===_0x3925('0x41')||_0x1e7b0a===_0x3925('0x42')?'queue':_0x3925('0x3e');if(_0x3c96bb){_0x49d741[_0x3925('0x1b')]=_0x3c96bb['email'];}var _0x105bec=util['format'](_0x3925('0x43'),_0x196a46[_0x3925('0x3b')],_0x30274b[_0x3925('0x44')],md5(_0x30274b['uniqueid']));if(_0x3e7c88&&_0x3e7c88[_0x3925('0x45')]){logger[_0x3925('0xd')]('[QUEUE]',_0x3925('0x46'));_0x30274b[_0x3925('0x47')]=_0x105bec;}else if(_0x43aa7b&&_0x43aa7b[_0x3925('0x48')]&&_0x43aa7b[_0x3925('0x48')]!=='none'){logger[_0x3925('0xd')](_0x3925('0x49'),_0x3925('0x46'));_0x30274b[_0x3925('0x47')]=_0x105bec;}else{_0x30274b[_0x3925('0x47')]='';}return getAdminId(_0x49d741,_0x1e7b0a,_0x142ab7,_0x4fb576)['then'](getUser(_0x1e7b0a,_0x142ab7,_0x4fb576))[_0x3925('0xf')](getEndUser(_0x1e7b0a,_0x142ab7,_0x4fb576))['then'](getTicket(_0x1e7b0a,_0x142ab7,_0x4fb576,_0x48e26c,_0x30274b))[_0x3925('0xf')](function(_0x186765){logger[_0x3925('0xd')](util[_0x3925('0x25')](_0x3925('0x4a'),_0x186765[_0x3925('0x4b')]));if(_0x1e7b0a!==_0x3925('0x42')){logger[_0x3925('0xd')]('['+[_0x1e7b0a[_0x3925('0x18')]()]+']',_0x3925('0x4c'));emit(_0x4fb576,_0x3c96bb[_0x3925('0x4d')],_0x186765['endUserId']);}})[_0x3925('0x16')](function(_0x5ef6cd){logger[_0x3925('0x17')]('['+[_0x1e7b0a[_0x3925('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x5ef6cd,{'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 a00055f..28ca489 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 _0x5271=['toLowerCase','data2','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','sugarcrm','vtiger','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','servicenow','includes','data1'];(function(_0x179e5e,_0x130af9){var _0x2a4544=function(_0x2bb685){while(--_0x2bb685){_0x179e5e['push'](_0x179e5e['shift']());}};_0x2a4544(++_0x130af9);}(_0x5271,0xdb));var _0x1527=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x5271[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x1527('0x0'));var util=require(_0x1527('0x1'));var zendesk=require(_0x1527('0x2'));var salesforce=require(_0x1527('0x3'));var sugarcrm=require(_0x1527('0x4'));var freshdesk=require(_0x1527('0x5'));var zoho=require(_0x1527('0x6'));var desk=require(_0x1527('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x1527('0x8'));var dynamics365=require(_0x1527('0x9'));var freshsales=require(_0x1527('0xa'));var integrations=[_0x1527('0xb'),_0x1527('0xc'),'sugarcrm',_0x1527('0xd'),_0x1527('0xe'),'desk','vtiger',_0x1527('0xf'),'freshsales',_0x1527('0x10')];exports['exec']=function(_0x4fc217,_0x39bf25,_0x2899c0,_0x5a5669,_0x428615,_0x484cb2){if(_0x2899c0){if(_[_0x1527('0x11')](integrations,_0x4fc217[_0x1527('0x12')]['toLowerCase']())){try{var _0x174468=null;var _0x209424='';var _0x5679cd=_0x2899c0[_0x4fc217[_0x1527('0x12')][_0x1527('0x13')]()];if(_0x5679cd){var _0x3b76a2=_0x5679cd[_0x4fc217[_0x1527('0x14')]];if(_0x3b76a2){var _0x430f97=_['find'](_0x3b76a2[_0x1527('0x15')],{'id':parseInt(_0x4fc217[_0x1527('0x16')],0xa)});if(_0x430f97){if(_0x5a5669){if(_0x428615&&_0x39bf25[_0x1527('0x17')]){_0x209424=_0x1527('0x17');}else if(_0x39bf25['routeId']){_0x209424=_0x1527('0x18');}else{console[_0x1527('0x19')](_0x1527('0x1a'),_0x39bf25);}}else{_0x209424='unmanaged';}switch(_0x4fc217[_0x1527('0x12')]['toLowerCase']()){case'zendesk':zendesk[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case _0x1527('0xc'):salesforce[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case _0x1527('0x1b'):sugarcrm[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case _0x1527('0xd'):freshdesk[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case _0x1527('0xe'):zoho[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case'desk':desk[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case _0x1527('0x1c'):vtiger[_0x209424](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2);break;case'freshsales':freshsales['cs'](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2,_0x209424);break;case _0x1527('0x10'):servicenow['cs'](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2,_0x209424);break;case _0x1527('0xf'):dynamics365['cs'](_0x4fc217,_0x39bf25,_0x430f97,_0x5a5669,_0x428615,_0x3b76a2,_0x484cb2,_0x209424);break;default:console['log']('unknown\x20integration');}}else{_0x174468=require(_0x1527('0x1d'))(_0x4fc217[_0x1527('0x12')][_0x1527('0x13')]());_0x174468[_0x1527('0x1e')]('[EXEC]',util[_0x1527('0x1f')](_0x1527('0x20'),_0x4fc217[_0x1527('0x12')][_0x1527('0x13')](),_0x4fc217[_0x1527('0x16')]));}}else{_0x174468=require(_0x1527('0x1d'))(_0x4fc217[_0x1527('0x12')][_0x1527('0x13')]());_0x174468[_0x1527('0x1e')]('[EXEC]',util['format'](_0x1527('0x21'),_0x4fc217[_0x1527('0x12')][_0x1527('0x13')](),_0x4fc217[_0x1527('0x14')]));}}else{}}catch(_0xd98e05){console[_0x1527('0x1e')](_0xd98e05);}}}}; \ No newline at end of file +var _0xffc5=['toLowerCase','find','Configurations','data3','queue','outbound','log','sugarcrm','freshdesk','zoho','unknown\x20integration','[EXEC]','format','../../../../config/logger','error','%s\x20account\x20#%s\x20not\x20found','data2','lodash','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./freshsales','zendesk','desk','dynamics365','freshsales','servicenow','exec','data1'];(function(_0x1025a6,_0x246898){var _0x103306=function(_0x239807){while(--_0x239807){_0x1025a6['push'](_0x1025a6['shift']());}};_0x103306(++_0x246898);}(_0xffc5,0x151));var _0x5ffc=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xffc5[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x5ffc('0x0'));var util=require('util');var zendesk=require(_0x5ffc('0x1'));var salesforce=require(_0x5ffc('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x5ffc('0x3'));var zoho=require(_0x5ffc('0x4'));var desk=require(_0x5ffc('0x5'));var vtiger=require(_0x5ffc('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x5ffc('0x7'));var integrations=[_0x5ffc('0x8'),'salesforce','sugarcrm','freshdesk','zoho',_0x5ffc('0x9'),'vtiger',_0x5ffc('0xa'),_0x5ffc('0xb'),_0x5ffc('0xc')];exports[_0x5ffc('0xd')]=function(_0x31d0ba,_0x259405,_0x797dcc,_0x3d6428,_0x544c2e,_0x5f116e){if(_0x797dcc){if(_['includes'](integrations,_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]())){try{var _0x25a160=null;var _0x4e6d2e='';var _0x3aafc6=_0x797dcc[_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]()];if(_0x3aafc6){var _0x2af000=_0x3aafc6[_0x31d0ba['data2']];if(_0x2af000){var _0x49f3ed=_[_0x5ffc('0x10')](_0x2af000[_0x5ffc('0x11')],{'id':parseInt(_0x31d0ba[_0x5ffc('0x12')],0xa)});if(_0x49f3ed){if(_0x3d6428){if(_0x544c2e&&_0x259405[_0x5ffc('0x13')]){_0x4e6d2e=_0x5ffc('0x13');}else if(_0x259405['routeId']){_0x4e6d2e=_0x5ffc('0x14');}else{console[_0x5ffc('0x15')]('EVENT\x20UNKNOWN',_0x259405);}}else{_0x4e6d2e='unmanaged';}switch(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]()){case'zendesk':zendesk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case'salesforce':salesforce[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x16'):sugarcrm[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x17'):freshdesk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x18'):zoho[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x9'):desk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case'vtiger':vtiger[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0xb'):freshsales['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;case _0x5ffc('0xc'):servicenow['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;case _0x5ffc('0xa'):dynamics365['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;default:console['log'](_0x5ffc('0x19'));}}else{_0x25a160=require('../../../../config/logger')(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]());_0x25a160['error'](_0x5ffc('0x1a'),util[_0x5ffc('0x1b')]('%s\x20configuration\x20#%s\x20not\x20found',_0x31d0ba['data1'][_0x5ffc('0xf')](),_0x31d0ba['data3']));}}else{_0x25a160=require(_0x5ffc('0x1c'))(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]());_0x25a160[_0x5ffc('0x1d')]('[EXEC]',util[_0x5ffc('0x1b')](_0x5ffc('0x1e'),_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')](),_0x31d0ba[_0x5ffc('0x1f')]));}}else{}}catch(_0x232232){console[_0x5ffc('0x1d')](_0x232232);}}}}; \ 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 631082c..c7590fe 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 _0x4737=['Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','$or','sobject','Contact','execute','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','lead','first','Phone','type','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','Caller\x20-\x20%s','','Company','No\x20Company','format','upperFirst','includes','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','Recording\x20is\x20enabled!','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','contact','endUserType','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','User','then','length','find','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name'];(function(_0x14fa5d,_0x1d144a){var _0x501ab2=function(_0x550e7e){while(--_0x550e7e){_0x14fa5d['push'](_0x14fa5d['shift']());}};_0x501ab2(++_0x1d144a);}(_0x4737,0xcd));var _0x7473=function(_0x2d0a38,_0x3dd9bf){_0x2d0a38=_0x2d0a38-0x0;var _0x5b8ff9=_0x4737[_0x2d0a38];return _0x5b8ff9;};'use strict';var _=require(_0x7473('0x0'));var rp=require(_0x7473('0x1'));var moment=require('moment');var BPromise=require(_0x7473('0x2'));var md5=require('md5');var jsforce=require(_0x7473('0x3'));var util=require('util');var Redis=require(_0x7473('0x4'));var intUtil=require(_0x7473('0x5'));var config=require(_0x7473('0x6'));var logger=require(_0x7473('0x7'))(_0x7473('0x8'));config[_0x7473('0x9')]=_[_0x7473('0xa')](config[_0x7473('0x9')],{'host':_0x7473('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7473('0x9')]));function emit(_0x2d313f,_0x4cad27,_0x509fe0){io['to'](_0x2d313f)[_0x7473('0xc')](_0x4cad27,_0x509fe0);}function getTicket(_0x334215,_0xe630b6,_0x46ab51,_0xfb8fd5,_0x548917,_0x378ad2,_0x3e823c,_0x595c58){var _0x202cbc=Object[_0x7473('0xd')]({},{'OwnerId':_0xe630b6['id'],'Subject':intUtil[_0x7473('0xe')](_0xfb8fd5[_0x7473('0xf')],_0x548917,'\x20'),'Description':intUtil[_0x7473('0xe')](_0xfb8fd5[_0x7473('0x10')],_0x548917,'\x0a')},getCustomFields(_0x378ad2,_0x548917));if(_0x46ab51){if(_0xfb8fd5[_0x7473('0x11')]===_0x7473('0x12')){_0x202cbc[_0x7473('0x13')]=moment['utc']();_0x202cbc[_0x7473('0x14')]=![];_0x202cbc[_0x7473('0x15')]=![];if(_0x46ab51['endUserType']===_0x7473('0x16')||_0x46ab51[_0x7473('0x17')]==='lead'){_0x202cbc[_0x7473('0x18')]=_0x46ab51['id'];}else if(_0x46ab51[_0x7473('0x17')]===_0x7473('0x19')){_0x202cbc[_0x7473('0x1a')]=_0x46ab51['id'];}}else if(_0xfb8fd5[_0x7473('0x11')]==='Case'){if(_0x46ab51['endUserType']==='contact'){_0x202cbc[_0x7473('0x1b')]=_0x46ab51['id'];}else if(_0x46ab51[_0x7473('0x17')]===_0x7473('0x19')){_0x202cbc[_0x7473('0x1c')]=_0x46ab51['id'];}else if(_0x46ab51[_0x7473('0x17')]==='lead'&&_0xfb8fd5[_0x7473('0x1d')]){_0x202cbc[_0xfb8fd5[_0x7473('0x1d')]]=_0x46ab51['id'];}else{logger[_0x7473('0x1e')](_0x7473('0x1f'));}}}return _0x3e823c['sobject'](_0xfb8fd5[_0x7473('0x11')])[_0x7473('0x20')](_0x202cbc);}function getUser(_0x2cfd2b,_0x214a3d,_0x4d9601){if(!_[_0x7473('0x21')](_0x214a3d)&&intUtil['validateEmail'](_0x214a3d)){var _0x23b082={'Email':_0x214a3d};var _0x12063d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4d9601['sobject'](_0x7473('0x22'))['find'](_0x23b082,_0x12063d)['execute']()[_0x7473('0x23')](function(_0x13e498){if(_0x13e498[_0x7473('0x24')]){var _0x5990a0=_[_0x7473('0x25')](_0x13e498,function(_0x2d28a2){return _0x2d28a2['Email']===_0x214a3d;});if(_0x5990a0){logger[_0x7473('0x1e')](_0x7473('0x26'),_0x214a3d);return BPromise[_0x7473('0x27')]({'id':_0x5990a0['Id'],'name':_0x5990a0[_0x7473('0x28')]});}}else{logger[_0x7473('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x214a3d);return _0x4d9601['identity']()['then'](function(_0x59c92a){return BPromise[_0x7473('0x27')]({'id':_0x59c92a['user_id'],'name':_0x59c92a['display_name']});});}});}else{logger['info'](_0x7473('0x29'),_0x214a3d);return _0x4d9601[_0x7473('0x2a')]()[_0x7473('0x23')](function(_0x4bd0de){return BPromise[_0x7473('0x27')]({'id':_0x4bd0de[_0x7473('0x2b')],'name':_0x4bd0de[_0x7473('0x2c')]});});}}function getEndUser(_0x4de5db,_0x47e4a6,_0x1f78b4,_0x12cbbb,_0x270b25){var _0x2b4a97={'$or':{'Phone':_0x12cbbb}};var _0x23fa07={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x7473('0x23')](function(){logger[_0x7473('0x1e')](_0x7473('0x2d'),_0x12cbbb,_0x47e4a6['moduleSearch']);switch(_0x47e4a6[_0x7473('0x2e')]){case'contact_lead':var _0x4ac958=_['cloneDeep'](_0x2b4a97);if(_0x47e4a6[_0x7473('0x2f')]){var _0x1f376b={};_0x1f376b[_0x47e4a6['additionalSearchContact']]=_0x12cbbb;_[_0x7473('0x30')](_0x4ac958[_0x7473('0x31')],_0x1f376b);}return _0x270b25[_0x7473('0x32')](_0x7473('0x33'))[_0x7473('0x25')](_0x4ac958,_0x23fa07)[_0x7473('0x34')]()[_0x7473('0x23')](function(_0x479def){if(_0x479def&&_0x479def[_0x7473('0x24')]){return _0x479def;}else{var _0x3af7d8=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6['additionalSearchLead']){var _0x109778={};_0x109778[_0x47e4a6[_0x7473('0x36')]]=_0x12cbbb;_[_0x7473('0x30')](_0x3af7d8['$or'],_0x109778);}return _0x270b25[_0x7473('0x32')](_0x7473('0x37'))[_0x7473('0x25')](_0x3af7d8,_0x23fa07);}});case _0x7473('0x38'):var _0x26bbef=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6['additionalSearchAccount']){var _0x1f376b={};_0x1f376b[_0x47e4a6[_0x7473('0x39')]]=_0x12cbbb;_[_0x7473('0x30')](_0x26bbef[_0x7473('0x31')],_0x1f376b);}return _0x270b25[_0x7473('0x32')](_0x7473('0x3a'))['find'](_0x26bbef,_0x23fa07)[_0x7473('0x34')]()['then'](function(_0x38ca77){if(_0x38ca77&&_0x38ca77['length']){return _0x38ca77;}else{var _0x435388=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6[_0x7473('0x2f')]){var _0x3cda2b={};_0x3cda2b[_0x47e4a6[_0x7473('0x2f')]]=_0x12cbbb;_['merge'](_0x435388[_0x7473('0x31')],_0x3cda2b);}return _0x270b25['sobject'](_0x7473('0x33'))['find'](_0x435388,_0x23fa07)[_0x7473('0x23')](function(_0xc081da){if(_0xc081da&&_0xc081da[_0x7473('0x24')]){return _0xc081da;}else{var _0x1560de=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6['additionalSearchLead']){var _0xc2d9ed={};_0xc2d9ed[_0x47e4a6[_0x7473('0x36')]]=_0x12cbbb;_[_0x7473('0x30')](_0x1560de[_0x7473('0x31')],_0xc2d9ed);}return _0x270b25[_0x7473('0x32')](_0x7473('0x37'))[_0x7473('0x25')](_0x1560de,_0x23fa07);}});}});case _0x7473('0x16'):var _0x4ac958=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6[_0x7473('0x2f')]){var _0x1f376b={};_0x1f376b[_0x47e4a6[_0x7473('0x2f')]]=_0x12cbbb;_[_0x7473('0x30')](_0x4ac958[_0x7473('0x31')],_0x1f376b);}return _0x270b25[_0x7473('0x32')](_0x7473('0x33'))[_0x7473('0x25')](_0x4ac958,_0x23fa07)[_0x7473('0x34')]();case _0x7473('0x3b'):var _0x4d665f=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6[_0x7473('0x36')]){var _0x1f376b={};_0x1f376b[_0x47e4a6[_0x7473('0x36')]]=_0x12cbbb;_['merge'](_0x4d665f[_0x7473('0x31')],_0x1f376b);}return _0x270b25[_0x7473('0x32')](_0x7473('0x37'))[_0x7473('0x25')](_0x4d665f,_0x23fa07);case'account':var _0x26bbef=_[_0x7473('0x35')](_0x2b4a97);if(_0x47e4a6[_0x7473('0x39')]){var _0x1f376b={};_0x1f376b[_0x47e4a6[_0x7473('0x39')]]=_0x12cbbb;_['merge'](_0x26bbef[_0x7473('0x31')],_0x1f376b);}return _0x270b25[_0x7473('0x32')]('Account')[_0x7473('0x25')](_0x26bbef,_0x23fa07);default:return null;}})[_0x7473('0x23')](function(_0xca8e56){if(_0xca8e56&&_0xca8e56[_0x7473('0x24')]){var _0x2adc61=_[_0x7473('0x3c')](_0xca8e56);if(_0x2adc61){return BPromise[_0x7473('0x27')]({'id':_0x2adc61['Id'],'name':_0x2adc61['Name'],'phone':_0x2adc61[_0x7473('0x3d')],'endUserType':_0x2adc61['attributes'][_0x7473('0x3e')]['toLowerCase']()});}}})[_0x7473('0x23')](function(_0x593705){if(_0x593705){logger['info'](_0x7473('0x3f'),_0x593705[_0x7473('0x17')],_0x12cbbb);return BPromise[_0x7473('0x27')](_0x593705);}else{logger['info'](_0x7473('0x40'),_0x12cbbb);var _0x3e60e9={'Phone':_0x12cbbb};if(_0x47e4a6[_0x7473('0x41')]){if(_0x47e4a6[_0x7473('0x41')]==='contact'){logger[_0x7473('0x1e')](_0x7473('0x42'),_0x12cbbb,_0x47e4a6['moduleCreate']);_0x3e60e9[_0x7473('0x43')]=_0x1f78b4!==''?_0x1f78b4:util['format'](_0x7473('0x44'),_0x12cbbb);}else if(_0x47e4a6[_0x7473('0x41')]==='lead'){logger[_0x7473('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x12cbbb,_0x47e4a6[_0x7473('0x41')]);_0x3e60e9[_0x7473('0x43')]=_0x1f78b4!==_0x7473('0x45')?_0x1f78b4:util['format']('Caller\x20-\x20%s',_0x12cbbb);_0x3e60e9[_0x7473('0x46')]=_0x7473('0x47');}else if(_0x47e4a6[_0x7473('0x41')]===_0x7473('0x19')){logger['info'](_0x7473('0x42'),_0x12cbbb,_0x47e4a6[_0x7473('0x41')]);_0x3e60e9[_0x7473('0x28')]=_0x1f78b4!==''?_0x1f78b4:util[_0x7473('0x48')](_0x7473('0x44'),_0x12cbbb);}else{return null;}}return _0x270b25[_0x7473('0x32')](_[_0x7473('0x49')](_0x47e4a6[_0x7473('0x41')]))['create'](_0x3e60e9)['then'](function(_0x20b20e){return BPromise[_0x7473('0x27')]({'id':_0x20b20e['id'],'endUserType':_0x47e4a6[_0x7473('0x41')]});});}});}function getCustomFields(_0x27d59d,_0xb88feb){var _0x1a0cfd={};if(_0x27d59d[_0x7473('0x24')]>0x0){_['forEach'](_0x27d59d,function(_0x1bc19b){if(_[_0x7473('0x4a')]([_0x7473('0x4b'),_0x7473('0x4c')],_0x1bc19b[_0x7473('0x3e')])&&_0x1bc19b[_0x7473('0x4d')]){_0x1a0cfd[_0x1bc19b['idField']]=_0x1bc19b[_0x7473('0x4e')][_0x7473('0x4f')]();}else if(_0x1bc19b['type']==='variable'&&_0x1bc19b[_0x7473('0x50')]&&_0x1bc19b['idField']){_0xb88feb[_0x1bc19b[_0x7473('0x50')]]&&(_0x1a0cfd[_0x1bc19b['idField']]=_0xb88feb[_0x1bc19b['variableName']][_0x7473('0x4f')]());}else if(_0x1bc19b[_0x7473('0x3e')]===_0x7473('0x51')&&_0x1bc19b[_0x7473('0x52')]&&_0x1bc19b[_0x7473('0x52')]['name']&&_0x1bc19b[_0x7473('0x4d')]){_0xb88feb[_0x1bc19b[_0x7473('0x52')][_0x7473('0x53')][_0x7473('0x54')]()]&&(_0x1a0cfd[_0x1bc19b[_0x7473('0x4d')]]=_0xb88feb[_0x1bc19b[_0x7473('0x52')][_0x7473('0x53')][_0x7473('0x54')]()][_0x7473('0x4f')]());}});}return _0x1a0cfd;}function getConnection(_0x5c0b33){var _0x5c7e54=_0x5c0b33[_0x7473('0x55')][_0x7473('0x56')](_0x5c0b33['securityToken']);var _0x5f3c96=new jsforce[(_0x7473('0x57'))]({'oauth2':{'loginUrl':_0x5c0b33[_0x7473('0x58')]||'https://login.salesforce.com','clientId':_0x5c0b33['clientId'],'clientSecret':_0x5c0b33[_0x7473('0x59')]}});return _0x5f3c96[_0x7473('0x5a')](_0x5c0b33[_0x7473('0x5b')],_0x5c7e54)['then'](function(){logger[_0x7473('0x1e')](_0x7473('0x5c'));return _0x5f3c96;});}exports['queue']=function(_0x54f40c,_0x590c12,_0x336732,_0x10a20d,_0x2e75e5,_0x217785){var _0x8a649e,_0x979df,_0x4d5572,_0x38d72c;_0x217785[_0x7473('0x5d')]=intUtil[_0x7473('0x5e')](_0x217785[_0x7473('0x5d')]);_0x217785[_0x7473('0x58')]=intUtil[_0x7473('0x5e')](_0x217785[_0x7473('0x58')]);if(_0x2e75e5&&_0x2e75e5[_0x7473('0x5f')]){logger['info'](_0x7473('0x60'),'Recording\x20is\x20enabled!');_0x590c12['recordingURL']=util[_0x7473('0x48')](_0x7473('0x61'),_0x217785[_0x7473('0x5d')],_0x590c12[_0x7473('0x62')],md5(_0x590c12[_0x7473('0x62')]));}else{_0x590c12[_0x7473('0x63')]='';}return getConnection(_0x217785)[_0x7473('0x23')](function(_0x463fa0){_0x38d72c=_0x463fa0;return getUser(_0x217785,_0x10a20d[_0x7473('0x64')],_0x38d72c);})[_0x7473('0x23')](function(_0x124eb2){_0x8a649e=_0x124eb2;return getEndUser(_0x217785,_0x336732,_0x590c12[_0x7473('0x65')],_0x590c12[_0x7473('0x66')],_0x38d72c);})[_0x7473('0x23')](function(_0x10d4ed){_0x979df=_0x10d4ed;return getTicket(_0x217785,_0x8a649e,_0x979df,_0x336732,_0x590c12,_0x336732['Fields'],_0x38d72c,_0x7473('0x67'));})[_0x7473('0x23')](function(_0x2ec613){_0x4d5572=_0x2ec613;logger[_0x7473('0x1e')](_0x7473('0x68'),_0x4d5572['id']);logger[_0x7473('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4d5572['id'],_0x10a20d[_0x7473('0x53')],_0x217785['type']);switch(_0x217785[_0x7473('0x3e')]){case'integrationTab':emit(util[_0x7473('0x48')](_0x7473('0x69'),_0x10a20d[_0x7473('0x53')]),_0x7473('0x6a'),{'recordId':_0x4d5572['id']});break;case'newTab':emit(util[_0x7473('0x48')](_0x7473('0x69'),_0x10a20d[_0x7473('0x53')]),_0x7473('0x6b'),{'uri':util[_0x7473('0x48')](_0x7473('0x6c'),_0x38d72c['instanceUrl'],_0x4d5572['id'])});break;default:logger['error'](_0x7473('0x6d'));}})[_0x7473('0x6e')](function(_0x3ec6a3){logger[_0x7473('0x6f')](_0x7473('0x60'),_0x3ec6a3);});};exports['outbound']=function(_0x3b294f,_0xfe3c0c,_0x343911,_0x1fcdf1,_0x4a7b98,_0x54a209,_0x337744){var _0x1e4afd,_0x347153,_0x5df6ec,_0x524a8b;_0x54a209[_0x7473('0x5d')]=intUtil[_0x7473('0x5e')](_0x54a209['serverUrl']);_0x54a209[_0x7473('0x58')]=intUtil['stripTrailingSlash'](_0x54a209[_0x7473('0x58')]);if(_0x337744&&_0x337744[_0x7473('0x70')]&&_0x337744[_0x7473('0x70')]!=='none'){logger[_0x7473('0x1e')]('[OUTBOUND]',_0x7473('0x71'));_0xfe3c0c[_0x7473('0x63')]=util['format'](_0x7473('0x61'),_0x54a209['serverUrl'],_0xfe3c0c[_0x7473('0x62')],md5(_0xfe3c0c[_0x7473('0x62')]));}return getConnection(_0x54a209)[_0x7473('0x23')](function(_0xd502d1){_0x524a8b=_0xd502d1;return getUser(_0x54a209,_0x1fcdf1[_0x7473('0x64')],_0x524a8b);})[_0x7473('0x23')](function(_0xfce3f5){_0x1e4afd=_0xfce3f5;return getEndUser(_0x54a209,_0x343911,_0xfe3c0c['destcalleridname'],_0xfe3c0c[_0x7473('0x72')],_0x524a8b);})[_0x7473('0x23')](function(_0x4ca5cc){_0x347153=_0x4ca5cc;return getTicket(_0x54a209,_0x1e4afd,_0x347153,_0x343911,_0xfe3c0c,_0x343911['Fields'],_0x524a8b,'outbound');})[_0x7473('0x23')](function(_0x41fbc7){_0x5df6ec=_0x41fbc7;logger['info'](_0x7473('0x73'),_0x5df6ec['id']);logger[_0x7473('0x1e')](_0x7473('0x74'),_0x5df6ec['id'],_0x1fcdf1[_0x7473('0x53')],_0x54a209[_0x7473('0x3e')]);switch(_0x54a209[_0x7473('0x3e')]){case'integrationTab':emit(util[_0x7473('0x48')](_0x7473('0x69'),_0x1fcdf1[_0x7473('0x53')]),'trigger:salesforce:display',{'recordId':_0x5df6ec['id']});break;case'newTab':emit(util[_0x7473('0x48')](_0x7473('0x69'),_0x1fcdf1[_0x7473('0x53')]),_0x7473('0x6b'),{'uri':util[_0x7473('0x48')](_0x7473('0x6c'),_0x524a8b[_0x7473('0x75')],_0x5df6ec['id'])});break;default:logger[_0x7473('0x6f')](_0x7473('0x76'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7473('0x6e')](function(_0x56501f){logger['error'](_0x7473('0x76'),_0x56501f);});};exports[_0x7473('0x77')]=function(_0x5b1227,_0x52a5bd,_0x210950,_0x485ae4,_0x25d30c,_0x2968ee){var _0x513259,_0x337681,_0x11526e,_0x36b271;_0x2968ee[_0x7473('0x5d')]=intUtil['stripTrailingSlash'](_0x2968ee[_0x7473('0x5d')]);_0x2968ee['remoteUri']=intUtil[_0x7473('0x5e')](_0x2968ee['remoteUri']);if(_0x25d30c&&_0x25d30c[_0x7473('0x5f')]){logger[_0x7473('0x1e')]('['+_0x52a5bd[_0x7473('0x78')][_0x7473('0x79')]()+']',_0x7473('0x71'));_0x52a5bd[_0x7473('0x63')]=util[_0x7473('0x48')](_0x7473('0x61'),_0x2968ee[_0x7473('0x5d')],_0x52a5bd[_0x7473('0x62')],md5(_0x52a5bd[_0x7473('0x62')]));}else{_0x52a5bd[_0x7473('0x63')]='';}return getConnection(_0x2968ee)[_0x7473('0x23')](function(_0x3f480d){_0x36b271=_0x3f480d;if(!_[_0x7473('0x21')](_0x485ae4)){return getUser(_0x2968ee,_0x485ae4[_0x7473('0x53')],_0x36b271);}else{return getUser(_0x2968ee,null,_0x36b271);}})[_0x7473('0x23')](function(_0x80de5b){_0x513259=_0x80de5b;return getEndUser(_0x2968ee,_0x210950,_0x52a5bd[_0x7473('0x65')],_0x52a5bd[_0x7473('0x66')],_0x36b271);})[_0x7473('0x23')](function(_0x38f4cb){_0x337681=_0x38f4cb;return getTicket(_0x2968ee,_0x513259,_0x337681,_0x210950,_0x52a5bd,_0x210950[_0x7473('0x7a')],_0x36b271);})['then'](function(_0x18af1e){_0x11526e=_0x18af1e;logger[_0x7473('0x1e')]('['+_0x52a5bd[_0x7473('0x78')]['toUpperCase']()+_0x7473('0x7b'),_0x11526e['id']);logger[_0x7473('0x1e')]('['+_0x52a5bd[_0x7473('0x78')][_0x7473('0x79')]()+_0x7473('0x7c'),_0x2968ee[_0x7473('0x3e')]);})[_0x7473('0x6e')](function(_0x1bb3d6){logger[_0x7473('0x6f')]('['+_0x52a5bd['lastevent'][_0x7473('0x79')]()+']',_0x1bb3d6);});}; \ No newline at end of file +var _0x60fa=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','execute','then','find','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x60fa,0x10a));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa60f('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa60f('0x1'));var md5=require(_0xa60f('0x2'));var jsforce=require('jsforce');var util=require(_0xa60f('0x3'));var Redis=require(_0xa60f('0x4'));var intUtil=require(_0xa60f('0x5'));var config=require(_0xa60f('0x6'));var logger=require(_0xa60f('0x7'))(_0xa60f('0x8'));config[_0xa60f('0x9')]=_['defaults'](config[_0xa60f('0x9')],{'host':_0xa60f('0xa'),'port':0x18eb});var io=require(_0xa60f('0xb'))(new Redis(config[_0xa60f('0x9')]));function emit(_0x90b82d,_0x1eb593,_0x116611){io['to'](_0x90b82d)['emit'](_0x1eb593,_0x116611);}function getTicket(_0x221e3a,_0x2896eb,_0x15b508,_0x401cb9,_0x3614c4,_0x53b11f,_0x36879c,_0x90ef75){var _0x5ac8f8=Object[_0xa60f('0xc')]({},{'OwnerId':_0x2896eb['id'],'Subject':intUtil['getString'](_0x401cb9[_0xa60f('0xd')],_0x3614c4,'\x20'),'Description':intUtil[_0xa60f('0xe')](_0x401cb9[_0xa60f('0xf')],_0x3614c4,'\x0a')},getCustomFields(_0x53b11f,_0x3614c4));if(_0x15b508){if(_0x401cb9[_0xa60f('0x10')]===_0xa60f('0x11')){_0x5ac8f8[_0xa60f('0x12')]=moment[_0xa60f('0x13')]();_0x5ac8f8[_0xa60f('0x14')]=![];_0x5ac8f8[_0xa60f('0x15')]=![];if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x17')||_0x15b508[_0xa60f('0x16')]===_0xa60f('0x18')){_0x5ac8f8[_0xa60f('0x19')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]==='account'){_0x5ac8f8[_0xa60f('0x1a')]=_0x15b508['id'];}}else if(_0x401cb9[_0xa60f('0x10')]===_0xa60f('0x1b')){if(_0x15b508['endUserType']===_0xa60f('0x17')){_0x5ac8f8[_0xa60f('0x1c')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x1d')){_0x5ac8f8[_0xa60f('0x1e')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x18')&&_0x401cb9[_0xa60f('0x1f')]){_0x5ac8f8[_0x401cb9[_0xa60f('0x1f')]]=_0x15b508['id'];}else{logger['info'](_0xa60f('0x20'));}}}return _0x36879c['sobject'](_0x401cb9[_0xa60f('0x10')])[_0xa60f('0x21')](_0x5ac8f8);}function getUser(_0xd13853,_0x339b6e,_0x1255d8){if(!_[_0xa60f('0x22')](_0x339b6e)&&intUtil[_0xa60f('0x23')](_0x339b6e)){var _0x1c37f9={'Email':_0x339b6e};var _0x2d210e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1255d8[_0xa60f('0x24')]('User')['find'](_0x1c37f9,_0x2d210e)[_0xa60f('0x25')]()[_0xa60f('0x26')](function(_0x33a179){if(_0x33a179['length']){var _0x2c8261=_[_0xa60f('0x27')](_0x33a179,function(_0x49da7e){return _0x49da7e[_0xa60f('0x28')]===_0x339b6e;});if(_0x2c8261){logger[_0xa60f('0x29')]('Agent\x20%s\x20found.',_0x339b6e);return BPromise[_0xa60f('0x2a')]({'id':_0x2c8261['Id'],'name':_0x2c8261[_0xa60f('0x2b')]});}}else{logger[_0xa60f('0x29')](_0xa60f('0x2c'),_0x339b6e);return _0x1255d8['identity']()[_0xa60f('0x26')](function(_0x465d3e){return BPromise[_0xa60f('0x2a')]({'id':_0x465d3e[_0xa60f('0x2d')],'name':_0x465d3e[_0xa60f('0x2e')]});});}});}else{logger['info'](_0xa60f('0x2c'),_0x339b6e);return _0x1255d8[_0xa60f('0x2f')]()[_0xa60f('0x26')](function(_0x4e95f8){return BPromise[_0xa60f('0x2a')]({'id':_0x4e95f8['user_id'],'name':_0x4e95f8['display_name']});});}}function getEndUser(_0xa97ad,_0x245ce0,_0x40c443,_0x56b612,_0x269616){var _0x3f29f7={'$or':{'Phone':_0x56b612}};var _0x29cca6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa60f('0x2a')]()[_0xa60f('0x26')](function(){logger[_0xa60f('0x29')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x56b612,_0x245ce0[_0xa60f('0x30')]);switch(_0x245ce0[_0xa60f('0x30')]){case _0xa60f('0x31'):var _0x1f2fea=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x33')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x33')]]=_0x56b612;_[_0xa60f('0x34')](_0x1f2fea[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x36'))[_0xa60f('0x27')](_0x1f2fea,_0x29cca6)[_0xa60f('0x25')]()['then'](function(_0x21e655){if(_0x21e655&&_0x21e655[_0xa60f('0x37')]){return _0x21e655;}else{var _0xaa7af4=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x3199fa={};_0x3199fa[_0x245ce0[_0xa60f('0x38')]]=_0x56b612;_[_0xa60f('0x34')](_0xaa7af4[_0xa60f('0x35')],_0x3199fa);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x39'))[_0xa60f('0x27')](_0xaa7af4,_0x29cca6);}});case'account_contact_lead':var _0x4aeae8=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x3a')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x3a')]]=_0x56b612;_[_0xa60f('0x34')](_0x4aeae8[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x3b'))['find'](_0x4aeae8,_0x29cca6)[_0xa60f('0x25')]()[_0xa60f('0x26')](function(_0x34c975){if(_0x34c975&&_0x34c975['length']){return _0x34c975;}else{var _0x553ec8=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0['additionalSearchContact']){var _0x222351={};_0x222351[_0x245ce0[_0xa60f('0x33')]]=_0x56b612;_[_0xa60f('0x34')](_0x553ec8['$or'],_0x222351);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x36'))['find'](_0x553ec8,_0x29cca6)[_0xa60f('0x26')](function(_0x1866f5){if(_0x1866f5&&_0x1866f5[_0xa60f('0x37')]){return _0x1866f5;}else{var _0x4ca4d0=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x5def93={};_0x5def93[_0x245ce0['additionalSearchLead']]=_0x56b612;_[_0xa60f('0x34')](_0x4ca4d0[_0xa60f('0x35')],_0x5def93);}return _0x269616[_0xa60f('0x24')]('Lead')[_0xa60f('0x27')](_0x4ca4d0,_0x29cca6);}});}});case _0xa60f('0x17'):var _0x1f2fea=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x33')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0['additionalSearchContact']]=_0x56b612;_['merge'](_0x1f2fea[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616['sobject'](_0xa60f('0x36'))[_0xa60f('0x27')](_0x1f2fea,_0x29cca6)[_0xa60f('0x25')]();case _0xa60f('0x18'):var _0x21e4e9=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x38')]]=_0x56b612;_[_0xa60f('0x34')](_0x21e4e9[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x39'))['find'](_0x21e4e9,_0x29cca6);case'account':var _0x4aeae8=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x3a')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x3a')]]=_0x56b612;_[_0xa60f('0x34')](_0x4aeae8[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x3b'))['find'](_0x4aeae8,_0x29cca6);default:return null;}})[_0xa60f('0x26')](function(_0x57538d){if(_0x57538d&&_0x57538d[_0xa60f('0x37')]){var _0x581e32=_[_0xa60f('0x3c')](_0x57538d);if(_0x581e32){return BPromise['resolve']({'id':_0x581e32['Id'],'name':_0x581e32[_0xa60f('0x2b')],'phone':_0x581e32[_0xa60f('0x3d')],'endUserType':_0x581e32[_0xa60f('0x3e')][_0xa60f('0x3f')][_0xa60f('0x40')]()});}}})[_0xa60f('0x26')](function(_0x2bcc3b){if(_0x2bcc3b){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2bcc3b[_0xa60f('0x16')],_0x56b612);return BPromise['resolve'](_0x2bcc3b);}else{logger[_0xa60f('0x29')](_0xa60f('0x41'),_0x56b612);var _0x3c38d9={'Phone':_0x56b612};if(_0x245ce0[_0xa60f('0x42')]){if(_0x245ce0[_0xa60f('0x42')]==='contact'){logger[_0xa60f('0x29')](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9[_0xa60f('0x44')]=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')](_0xa60f('0x47'),_0x56b612);}else if(_0x245ce0[_0xa60f('0x42')]===_0xa60f('0x18')){logger['info'](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9['LastName']=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')]('Caller\x20-\x20%s',_0x56b612);_0x3c38d9[_0xa60f('0x48')]=_0xa60f('0x49');}else if(_0x245ce0['moduleCreate']===_0xa60f('0x1d')){logger['info'](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9[_0xa60f('0x2b')]=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')]('Caller\x20-\x20%s',_0x56b612);}else{return null;}}return _0x269616[_0xa60f('0x24')](_[_0xa60f('0x4a')](_0x245ce0[_0xa60f('0x42')]))['create'](_0x3c38d9)[_0xa60f('0x26')](function(_0xcdb655){return BPromise['resolve']({'id':_0xcdb655['id'],'endUserType':_0x245ce0[_0xa60f('0x42')]});});}});}function getCustomFields(_0x4127b7,_0x2be249){var _0x4caaef={};if(_0x4127b7[_0xa60f('0x37')]>0x0){_[_0xa60f('0x4b')](_0x4127b7,function(_0x3ac617){if(_[_0xa60f('0x4c')](['string',_0xa60f('0x4d')],_0x3ac617[_0xa60f('0x3f')])&&_0x3ac617[_0xa60f('0x4e')]){_0x4caaef[_0x3ac617['idField']]=_0x3ac617['content']['toString']();}else if(_0x3ac617[_0xa60f('0x3f')]===_0xa60f('0x4f')&&_0x3ac617[_0xa60f('0x50')]&&_0x3ac617[_0xa60f('0x4e')]){_0x2be249[_0x3ac617[_0xa60f('0x50')]]&&(_0x4caaef[_0x3ac617[_0xa60f('0x4e')]]=_0x2be249[_0x3ac617[_0xa60f('0x50')]][_0xa60f('0x51')]());}else if(_0x3ac617['type']===_0xa60f('0x52')&&_0x3ac617['Variable']&&_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')]&&_0x3ac617[_0xa60f('0x4e')]){_0x2be249[_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')][_0xa60f('0x40')]()]&&(_0x4caaef[_0x3ac617[_0xa60f('0x4e')]]=_0x2be249[_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')][_0xa60f('0x40')]()][_0xa60f('0x51')]());}});}return _0x4caaef;}function getConnection(_0x3fe1f9){var _0x58fb86=_0x3fe1f9[_0xa60f('0x55')][_0xa60f('0x56')](_0x3fe1f9['securityToken']);var _0x6ba37d=new jsforce[(_0xa60f('0x57'))]({'oauth2':{'loginUrl':_0x3fe1f9[_0xa60f('0x58')]||_0xa60f('0x59'),'clientId':_0x3fe1f9['clientId'],'clientSecret':_0x3fe1f9[_0xa60f('0x5a')]}});return _0x6ba37d['login'](_0x3fe1f9['username'],_0x58fb86)[_0xa60f('0x26')](function(){logger[_0xa60f('0x29')](_0xa60f('0x5b'));return _0x6ba37d;});}exports[_0xa60f('0x5c')]=function(_0x38bbe5,_0x37c6f4,_0x83dfdd,_0xa5f639,_0x83358,_0x1de63a){var _0x58f8cc,_0x38f8f7,_0x3686b9,_0x38bc3f;_0x1de63a[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x1de63a[_0xa60f('0x5d')]);_0x1de63a['remoteUri']=intUtil[_0xa60f('0x5e')](_0x1de63a[_0xa60f('0x58')]);if(_0x83358&&_0x83358['monitor_format']){logger[_0xa60f('0x29')](_0xa60f('0x5f'),_0xa60f('0x60'));_0x37c6f4[_0xa60f('0x61')]=util[_0xa60f('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1de63a[_0xa60f('0x5d')],_0x37c6f4[_0xa60f('0x62')],md5(_0x37c6f4['uniqueid']));}else{_0x37c6f4['recordingURL']='';}return getConnection(_0x1de63a)[_0xa60f('0x26')](function(_0x47884a){_0x38bc3f=_0x47884a;return getUser(_0x1de63a,_0xa5f639[_0xa60f('0x63')],_0x38bc3f);})[_0xa60f('0x26')](function(_0x22d040){_0x58f8cc=_0x22d040;return getEndUser(_0x1de63a,_0x83dfdd,_0x37c6f4[_0xa60f('0x64')],_0x37c6f4[_0xa60f('0x65')],_0x38bc3f);})['then'](function(_0x39df30){_0x38f8f7=_0x39df30;return getTicket(_0x1de63a,_0x58f8cc,_0x38f8f7,_0x83dfdd,_0x37c6f4,_0x83dfdd[_0xa60f('0x66')],_0x38bc3f,_0xa60f('0x5c'));})[_0xa60f('0x26')](function(_0x372019){_0x3686b9=_0x372019;logger[_0xa60f('0x29')](_0xa60f('0x67'),_0x3686b9['id']);logger[_0xa60f('0x29')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3686b9['id'],_0xa5f639[_0xa60f('0x54')],_0x1de63a[_0xa60f('0x3f')]);switch(_0x1de63a[_0xa60f('0x3f')]){case'integrationTab':emit(util['format'](_0xa60f('0x68'),_0xa5f639['name']),_0xa60f('0x69'),{'recordId':_0x3686b9['id']});break;case _0xa60f('0x6a'):emit(util['format']('user:%s',_0xa5f639['name']),'trigger:browser:url',{'uri':util[_0xa60f('0x46')](_0xa60f('0x6b'),_0x38bc3f[_0xa60f('0x6c')],_0x3686b9['id'])});break;default:logger[_0xa60f('0x6d')](_0xa60f('0x6e'));}})[_0xa60f('0x6f')](function(_0x492790){logger[_0xa60f('0x6d')](_0xa60f('0x5f'),_0x492790);});};exports[_0xa60f('0x70')]=function(_0x28f839,_0x4042b5,_0x5aab35,_0x23c69e,_0xb6e2d8,_0x4f9579,_0x35f032){var _0x5e69a7,_0x44d62c,_0x5b8fe4,_0x560eff;_0x4f9579[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x4f9579[_0xa60f('0x5d')]);_0x4f9579[_0xa60f('0x58')]=intUtil[_0xa60f('0x5e')](_0x4f9579[_0xa60f('0x58')]);if(_0x35f032&&_0x35f032[_0xa60f('0x71')]&&_0x35f032['recordingFormat']!==_0xa60f('0x72')){logger[_0xa60f('0x29')]('[OUTBOUND]',_0xa60f('0x60'));_0x4042b5[_0xa60f('0x61')]=util[_0xa60f('0x46')](_0xa60f('0x73'),_0x4f9579[_0xa60f('0x5d')],_0x4042b5[_0xa60f('0x62')],md5(_0x4042b5['uniqueid']));}return getConnection(_0x4f9579)[_0xa60f('0x26')](function(_0x43a775){_0x560eff=_0x43a775;return getUser(_0x4f9579,_0x23c69e['email'],_0x560eff);})['then'](function(_0x2986fa){_0x5e69a7=_0x2986fa;return getEndUser(_0x4f9579,_0x5aab35,_0x4042b5['destcalleridname'],_0x4042b5[_0xa60f('0x74')],_0x560eff);})[_0xa60f('0x26')](function(_0x49cc02){_0x44d62c=_0x49cc02;return getTicket(_0x4f9579,_0x5e69a7,_0x44d62c,_0x5aab35,_0x4042b5,_0x5aab35[_0xa60f('0x66')],_0x560eff,_0xa60f('0x70'));})['then'](function(_0x7b80ec){_0x5b8fe4=_0x7b80ec;logger[_0xa60f('0x29')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5b8fe4['id']);logger['info'](_0xa60f('0x75'),_0x5b8fe4['id'],_0x23c69e[_0xa60f('0x54')],_0x4f9579[_0xa60f('0x3f')]);switch(_0x4f9579[_0xa60f('0x3f')]){case _0xa60f('0x76'):emit(util[_0xa60f('0x46')](_0xa60f('0x68'),_0x23c69e[_0xa60f('0x54')]),'trigger:salesforce:display',{'recordId':_0x5b8fe4['id']});break;case'newTab':emit(util['format'](_0xa60f('0x68'),_0x23c69e[_0xa60f('0x54')]),_0xa60f('0x77'),{'uri':util[_0xa60f('0x46')](_0xa60f('0x6b'),_0x560eff[_0xa60f('0x6c')],_0x5b8fe4['id'])});break;default:logger['error']('[OUTBOUND]',_0xa60f('0x78'));}})['catch'](function(_0x4e6595){logger[_0xa60f('0x6d')](_0xa60f('0x79'),_0x4e6595);});};exports[_0xa60f('0x7a')]=function(_0x2eee12,_0x447cb2,_0x117025,_0x3fa38c,_0x2a99ac,_0x1eb724){var _0x22f848,_0x3f97a7,_0x3ccd02,_0x2d34a8;_0x1eb724[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x1eb724[_0xa60f('0x5d')]);_0x1eb724[_0xa60f('0x58')]=intUtil[_0xa60f('0x5e')](_0x1eb724[_0xa60f('0x58')]);if(_0x2a99ac&&_0x2a99ac[_0xa60f('0x7b')]){logger[_0xa60f('0x29')]('['+_0x447cb2['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x447cb2[_0xa60f('0x61')]=util[_0xa60f('0x46')](_0xa60f('0x73'),_0x1eb724['serverUrl'],_0x447cb2[_0xa60f('0x62')],md5(_0x447cb2[_0xa60f('0x62')]));}else{_0x447cb2[_0xa60f('0x61')]='';}return getConnection(_0x1eb724)['then'](function(_0x101581){_0x2d34a8=_0x101581;if(!_[_0xa60f('0x22')](_0x3fa38c)){return getUser(_0x1eb724,_0x3fa38c[_0xa60f('0x54')],_0x2d34a8);}else{return getUser(_0x1eb724,null,_0x2d34a8);}})[_0xa60f('0x26')](function(_0x484263){_0x22f848=_0x484263;return getEndUser(_0x1eb724,_0x117025,_0x447cb2[_0xa60f('0x64')],_0x447cb2[_0xa60f('0x65')],_0x2d34a8);})[_0xa60f('0x26')](function(_0x89422b){_0x3f97a7=_0x89422b;return getTicket(_0x1eb724,_0x22f848,_0x3f97a7,_0x117025,_0x447cb2,_0x117025['Fields'],_0x2d34a8);})[_0xa60f('0x26')](function(_0x21bbb6){_0x3ccd02=_0x21bbb6;logger[_0xa60f('0x29')]('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+_0xa60f('0x7e'),_0x3ccd02['id']);logger[_0xa60f('0x29')]('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1eb724[_0xa60f('0x3f')]);})['catch'](function(_0x294ed8){logger['error']('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+']',_0x294ed8);});}; \ 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 5d57c20..59516af 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 _0x6568=['monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','picklist','type','nameField','customField','toLowerCase','toString','includes','string','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x4811b1,_0x11606a){var _0xe6569b=function(_0x34fd3c){while(--_0x34fd3c){_0x4811b1['push'](_0x4811b1['shift']());}};_0xe6569b(++_0x11606a);}(_0x6568,0x74));var _0x8656=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6568[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x8656('0x0'));var util=require(_0x8656('0x1'));var md5=require(_0x8656('0x2'));var Redis=require(_0x8656('0x3'));var intUtil=require('./util');var config=require(_0x8656('0x4'));var logger=require(_0x8656('0x5'))('servicenow');config[_0x8656('0x6')]=_[_0x8656('0x7')](config[_0x8656('0x6')],{'host':_0x8656('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x301b12,_0x1c91f4,_0x2acf10,_0x387768,_0x40ee82,_0x47ea07){return new Promise(function(_0x352268,_0x7a2916){var _0x3daf06={'method':_0x8656('0x9'),'uri':_0x387768+_0x8656('0xa')+'&'+_0x40ee82+'&'+_0x47ea07,'auth':_0x1c91f4,'json':!![]};return rp(_0x3daf06)[_0x8656('0xb')](function(_0x34d69f){if(_0x34d69f[_0x8656('0xc')][_0x8656('0xd')]>0x0){_0x2acf10['adminId']=_0x34d69f[_0x8656('0xc')][0x0][_0x8656('0xe')];}logger[_0x8656('0xf')]('['+[_0x301b12[_0x8656('0x10')]()]+_0x8656('0x11'),_0x2acf10);_0x352268(_0x2acf10);})[_0x8656('0x12')](function(_0x4fa807){logger[_0x8656('0x13')]('['+[_0x301b12[_0x8656('0x10')]()]+']',_0x4fa807[_0x8656('0x14')]);_0x7a2916(_0x4fa807[_0x8656('0x14')]);});});}function getUser(_0x46680d,_0x31f8c5,_0x40023e,_0x4ec9d7,_0x4e7464){return function(_0x52f401){logger[_0x8656('0xf')]('['+[_0x46680d['toUpperCase']()]+_0x8656('0x15'),_0x52f401);return new Promise(function(_0x2e213a,_0x4d42f0){if(intUtil[_0x8656('0x16')](_0x52f401[_0x8656('0x17')])){var _0x12be98={'method':_0x8656('0x9'),'uri':_0x40023e+_0x8656('0x18')+_0x52f401[_0x8656('0x17')]+'&'+_0x4ec9d7+'&'+_0x4e7464,'auth':_0x31f8c5,'json':!![]};logger[_0x8656('0xf')]('['+[_0x46680d[_0x8656('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x12be98);return rp(_0x12be98)[_0x8656('0xb')](function(_0x1d1b67){logger[_0x8656('0xf')]('['+[_0x46680d[_0x8656('0x10')]()]+_0x8656('0x19'),_0x1d1b67);if(_0x1d1b67[_0x8656('0xc')][_0x8656('0xd')]>0x0&&String(_0x1d1b67[_0x8656('0xc')][0x0][_0x8656('0x1a')])===_0x8656('0x1b')){_0x52f401[_0x8656('0x1c')]=_0x1d1b67['result'][0x0][_0x8656('0xe')];}else{_0x52f401[_0x8656('0x1c')]=_0x52f401[_0x8656('0x1d')];_0x52f401[_0x8656('0x17')]=_0x52f401[_0x8656('0x1e')];}logger['info']('['+[_0x46680d[_0x8656('0x10')]()]+_0x8656('0x1f'),_0x52f401);_0x2e213a(_0x52f401);})[_0x8656('0x12')](function(_0x491128){logger[_0x8656('0x13')]('['+[_0x46680d[_0x8656('0x10')]()]+']',_0x491128[_0x8656('0x14')]);_0x4d42f0(_0x491128['message']);});}else{logger[_0x8656('0xf')]('['+[_0x46680d[_0x8656('0x10')]()]+_0x8656('0x20'));_0x52f401[_0x8656('0x1c')]=_0x52f401[_0x8656('0x1d')];_0x52f401[_0x8656('0x17')]=_0x52f401[_0x8656('0x1e')];_0x2e213a(_0x52f401);}});};}function createEndUser(_0x56623f,_0x109c38,_0x21c8bd,_0x548ac6,_0x3a4351){logger[_0x8656('0xf')]('['+[_0x56623f[_0x8656('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x21c8bd);return new Promise(function(_0x5a0c32,_0x2591d2){var _0x76b192={'method':_0x8656('0x21'),'uri':_0x548ac6+_0x8656('0x22')+_0x3a4351,'body':{'user_name':_0x21c8bd['endUserNumber'],'roles':_0x8656('0x23'),'first_name':_0x21c8bd[_0x8656('0x24')],'active':_0x8656('0x1b'),'date_format':'System','phone':_0x21c8bd[_0x8656('0x24')]},'auth':_0x109c38,'json':!![]};return rp(_0x76b192)[_0x8656('0xb')](function(_0x4c7b21){logger['info']('['+[_0x56623f[_0x8656('0x10')]()]+_0x8656('0x25'),_0x4c7b21[_0x8656('0xc')]);_0x21c8bd[_0x8656('0x26')]=_0x4c7b21[_0x8656('0xc')][_0x8656('0xe')];_0x5a0c32(_0x21c8bd);})[_0x8656('0x12')](function(_0x1a0ed2){logger['error']('['+[_0x56623f['toUpperCase']()]+']',_0x1a0ed2['message']);_0x2591d2(_0x1a0ed2[_0x8656('0x14')]);});});}function getEndUser(_0x4afd60,_0x405e54,_0x55b57d,_0x27ba64,_0x5de5e5){return function(_0x20ccbc){logger[_0x8656('0xf')]('['+[_0x4afd60[_0x8656('0x10')]()]+_0x8656('0x27'),_0x20ccbc);return new Promise(function(_0x5e4dfc,_0x123fe0){var _0x1da199={'method':'GET','uri':_0x55b57d+_0x8656('0x28')+_0x20ccbc[_0x8656('0x24')]+'&'+_0x27ba64+'&'+_0x5de5e5,'auth':_0x405e54,'json':!![]};return rp(_0x1da199)[_0x8656('0xb')](function(_0x4461f5){if(_0x4461f5['result'][_0x8656('0xd')]>0x0){_0x20ccbc[_0x8656('0x26')]=_0x4461f5['result'][0x0][_0x8656('0xe')];logger[_0x8656('0xf')]('['+[_0x4afd60[_0x8656('0x10')]()]+_0x8656('0x29'),_0x20ccbc);_0x5e4dfc(_0x20ccbc);}else{return createEndUser(_0x4afd60,_0x405e54,_0x20ccbc,_0x55b57d,_0x27ba64)[_0x8656('0xb')](function(_0x5a6227){logger[_0x8656('0xf')]('['+[_0x4afd60[_0x8656('0x10')]()]+'],\x20createEndUser\x20crm',_0x5a6227);_0x5e4dfc(_0x5a6227);});}})[_0x8656('0x12')](function(_0x331f74){logger['error']('['+[_0x4afd60['toUpperCase']()]+']',_0x331f74[_0x8656('0x14')]);_0x123fe0(_0x331f74[_0x8656('0x14')]);});});};}function getCustomFields(_0x30f7a4,_0x3db019){var _0x2ca280={};if(_0x30f7a4[_0x8656('0xd')]>0x0){_[_0x8656('0x2a')](_0x30f7a4,function(_0x23b582){if(_['includes'](['string',_0x8656('0x2b')],_0x23b582[_0x8656('0x2c')])&&_0x23b582[_0x8656('0x2d')]&&!_0x23b582[_0x8656('0x2e')]){_0x2ca280[_0x23b582['nameField'][_0x8656('0x2f')]()]=_0x23b582['content'][_0x8656('0x30')]();}else if(_[_0x8656('0x31')]([_0x8656('0x32'),_0x8656('0x2b')],_0x23b582['type'])&&_0x23b582[_0x8656('0x33')]&&_0x23b582[_0x8656('0x2e')]){_0x2ca280[_0x23b582['idField'][_0x8656('0x2f')]()]=_0x23b582['content'][_0x8656('0x30')]();}else if(_0x23b582[_0x8656('0x2c')]===_0x8656('0x34')&&_0x23b582['variableName']&&_0x23b582[_0x8656('0x33')]&&_0x23b582[_0x8656('0x2e')]){_0x2ca280[_0x23b582[_0x8656('0x33')][_0x8656('0x2f')]()]=_0x3db019[_0x23b582[_0x8656('0x35')]]['toString']();}else if(_0x23b582[_0x8656('0x2c')]==='customVariable'&&_0x23b582[_0x8656('0x36')]&&_0x23b582[_0x8656('0x36')][_0x8656('0x37')]&&_0x23b582[_0x8656('0x33')]&&_0x23b582[_0x8656('0x2e')]){_0x2ca280[_0x23b582['idField'][_0x8656('0x2f')]()]=_0x3db019[_0x23b582[_0x8656('0x36')][_0x8656('0x37')][_0x8656('0x2f')]()][_0x8656('0x30')]();}});}return _0x2ca280;}function getTicket(_0x4f5d03,_0x468b85,_0x51eb05,_0x59ccfe,_0x576cfc,_0x1aeb34){return function(_0x1a9da7){logger['info']('['+[_0x4f5d03[_0x8656('0x10')]()]+_0x8656('0x38'),_0x1a9da7);return new Promise(function(_0x5da2e1,_0x4dd7d7){var _0x380eb6=_0x4f5d03[_0x8656('0x2f')]()==='outbound'?_0x1a9da7['userId']:_0x1a9da7[_0x8656('0x26')];var _0x1c04c0={'method':_0x8656('0x21'),'uri':_0x51eb05+_0x8656('0x39')+'?'+_0x1aeb34,'body':Object[_0x8656('0x3a')]({},{'active':'true','caller_id':_0x380eb6,'assigned_to':_0x1a9da7['userId'],'short_description':intUtil[_0x8656('0x3b')](_0x59ccfe[_0x8656('0x3c')],_0x576cfc,'\x20'),'description':intUtil[_0x8656('0x3b')](_0x59ccfe[_0x8656('0x3d')],_0x576cfc,'\x0a')},getCustomFields(_0x59ccfe['Fields'],_0x576cfc)),'auth':_0x468b85,'json':!![]};return rp(_0x1c04c0)[_0x8656('0xb')](function(_0xf69470){logger[_0x8656('0xf')]('['+[_0x4f5d03[_0x8656('0x10')]()]+_0x8656('0x3e'),_0xf69470[_0x8656('0xc')]);_0x1a9da7[_0x8656('0x3f')]=_0xf69470['result'][_0x8656('0xe')];_0x1a9da7[_0x8656('0x40')]=_0xf69470[_0x8656('0xc')][_0x8656('0x41')];logger['info']('['+[_0x4f5d03['toUpperCase']()]+_0x8656('0x42'),_0x1a9da7);_0x5da2e1(_0x1a9da7);})[_0x8656('0x12')](function(_0x1655f1){logger['error']('['+[_0x4f5d03[_0x8656('0x10')]()]+']',_0x1655f1[_0x8656('0x14')]);_0x4dd7d7(_0x1655f1['message']);});});};}function createRemoteTag(_0x109d60,_0x132680,_0x34d90b,_0x2509e6){return new Promise(function(_0x117585,_0x27ce5c){var _0x23dee1={'method':'POST','uri':_0x34d90b+'label'+'?'+_0x2509e6,'body':{'short_description':_0x109d60,'global':!![],'active':!![],'name':_0x109d60},'auth':_0x132680,'json':!![]};return rp(_0x23dee1)[_0x8656('0xb')](function(_0x57ff13){var _0x55766f=_0x57ff13[_0x8656('0xc')]['sys_id'];_0x117585(_0x55766f);});});}function getRemoteTag(_0x3da579,_0x13a0ac,_0x233083,_0x5c427d,_0x3f8a55){return new Promise(function(_0x5a2e0b,_0x422e53){var _0x545fcb={'method':_0x8656('0x9'),'uri':_0x233083+_0x8656('0x43')+_0x8656('0x44')+_0x3da579+'&'+_0x5c427d,'auth':_0x13a0ac,'json':!![]};return rp(_0x545fcb)[_0x8656('0xb')](function(_0x2f20be){if(_0x2f20be[_0x8656('0xc')][_0x8656('0xd')]>0x0){var _0x61f728=_0x2f20be[_0x8656('0xc')][0x0][_0x8656('0xe')];_0x5a2e0b(_0x61f728);}else{return createRemoteTag(_0x3da579,_0x13a0ac,_0x233083,_0x5c427d)[_0x8656('0xb')](function(_0x1fbda1){_0x5a2e0b(_0x1fbda1);});}});});}function assignTagToIncident(_0x79cd2d,_0x546d84,_0x161532,_0x1e1242,_0x5c59d){return new Promise(function(_0x468dc3,_0x22135d){var _0x251fee={'method':_0x8656('0x21'),'uri':_0x161532+'label_entry'+'?'+_0x5c59d,'body':{'label':_0x79cd2d,'table':_0x8656('0x39'),'id_type':_0x8656('0x45'),'table_key':_0x1e1242[_0x8656('0x3f')],'title':'Incident\x20-\x20'+_0x1e1242[_0x8656('0x40')],'id_display':_0x1e1242[_0x8656('0x40')]},'auth':_0x546d84,'json':!![]};return rp(_0x251fee)[_0x8656('0xb')](function(_0x55190c){_0x468dc3();})[_0x8656('0x12')](function(){_0x468dc3();});});}function manageTags(_0x42cc56,_0xb9baf5,_0x66bb18,_0x1b8415,_0x1f05bf,_0x2aa870,_0x3ff56c){return new Promise(function(_0x1b1977,_0x3aa8dc){var _0x4a812a=[];_0xb9baf5['forEach'](function(_0x5af1bd){_0x4a812a[_0x8656('0x46')](getRemoteTag(_0x5af1bd,_0x66bb18,_0x1b8415,_0x2aa870,_0x3ff56c));});return Promise[_0x8656('0x47')](_0x4a812a)[_0x8656('0xb')](function(_0x2dab77){if(_0x2dab77['length']){logger[_0x8656('0xf')]('['+[_0x42cc56[_0x8656('0x10')]()]+_0x8656('0x48'),_0x2dab77);var _0x3bbe46=[];_0x2dab77[_0x8656('0x2a')](function(_0x275d2f){_0x3bbe46[_0x8656('0x46')](assignTagToIncident(_0x275d2f,_0x66bb18,_0x1b8415,_0x1f05bf,_0x2aa870));});return Promise[_0x8656('0x47')](_0x3bbe46)['then'](function(){_0x1b1977();})[_0x8656('0x12')](function(){_0x1b1977();});}else{_0x1b1977();}});});}function getTags(_0x45b651,_0x5b1887,_0x5aac69,_0x25e80a,_0x5408b3,_0x453d68){return function(_0x142ce8){return new Promise(function(_0x162987,_0x353d19){var _0x42af08=[];var _0x23419c=_0x25e80a[_0x8656('0x49')];if(_0x23419c&&_0x23419c[_0x8656('0xd')]>0x0){_0x42af08=_[_0x8656('0x4a')](_0x23419c,_0x8656('0x37'));}if(_0x42af08['length']>0x0){return manageTags(_0x45b651,_0x42af08,_0x5b1887,_0x5aac69,_0x142ce8,_0x5408b3,_0x453d68)[_0x8656('0xb')](function(){_0x162987(_0x142ce8);});}else{_0x162987(_0x142ce8);}});};}function emit(_0x4f6b30,_0x2d3c41,_0x36bd44){var _0x1d098e=_0x8656('0x4b')+_0x8656('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x518b8b={'uri':_0x4f6b30+_0x8656('0x4d')+_0x36bd44+_0x1d098e};io['to'](util['format'](_0x8656('0x4e'),_0x2d3c41))[_0x8656('0x4f')](_0x8656('0x50'),_0x518b8b);}exports['cs']=function(_0x5f217c,_0x108f8a,_0x3e1225,_0x182b0e,_0x7df3b6,_0x4aaf8b,_0x578602,_0x20f84f){var _0x5fd3da={};var _0x50366a={'user':_0x4aaf8b[_0x8656('0x51')],'pass':_0x4aaf8b[_0x8656('0x52')]};var _0x6e96a0=_0x8656('0x53');var _0x160e8c=_0x8656('0x54');_0x4aaf8b[_0x8656('0x55')]=intUtil[_0x8656('0x56')](_0x4aaf8b[_0x8656('0x55')]);_0x4aaf8b[_0x8656('0x57')]=intUtil['stripTrailingSlash'](_0x4aaf8b[_0x8656('0x57')]);var _0xd7c00a=util[_0x8656('0x58')](_0x8656('0x59'),_0x4aaf8b['remoteUri']);_0x5fd3da[_0x8656('0x17')]=!_[_0x8656('0x5a')](_0x182b0e)?_0x182b0e[_0x8656('0x5b')]:null;_0x5fd3da[_0x8656('0x1e')]=_0x4aaf8b[_0x8656('0x5b')];_0x5fd3da[_0x8656('0x24')]=_0x20f84f[_0x8656('0x2f')]()===_0x8656('0x5c')?_0x108f8a[_0x8656('0x5d')]:_0x108f8a['calleridnum'];_0x5fd3da['callDirection']=_0x20f84f===_0x8656('0x5e')||_0x20f84f===_0x8656('0x5f')?_0x8656('0x5e'):_0x8656('0x5c');var _0x3a48b1=util[_0x8656('0x58')](_0x8656('0x60'),_0x4aaf8b['serverUrl'],_0x108f8a[_0x8656('0x61')],md5(_0x108f8a[_0x8656('0x61')]));if(_0x7df3b6&&_0x7df3b6[_0x8656('0x62')]){logger[_0x8656('0xf')](_0x8656('0x63'),'Recording\x20is\x20enabled!');_0x108f8a[_0x8656('0x64')]=_0x3a48b1;}else if(_0x578602&&_0x578602['recordingFormat']&&_0x578602[_0x8656('0x65')]!==_0x8656('0x66')){logger[_0x8656('0xf')](_0x8656('0x67'),_0x8656('0x68'));_0x108f8a[_0x8656('0x64')]=_0x3a48b1;}else{_0x108f8a[_0x8656('0x64')]='';}return getAdminUser(_0x20f84f,_0x50366a,_0x5fd3da,_0xd7c00a,_0x160e8c,_0x6e96a0)[_0x8656('0xb')](getUser(_0x20f84f,_0x50366a,_0xd7c00a,_0x160e8c,_0x6e96a0))[_0x8656('0xb')](getEndUser(_0x20f84f,_0x50366a,_0xd7c00a,_0x160e8c,_0x6e96a0))[_0x8656('0xb')](getTicket(_0x20f84f,_0x50366a,_0xd7c00a,_0x3e1225,_0x108f8a,_0x160e8c))[_0x8656('0xb')](function(_0x4ef615){logger[_0x8656('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4ef615[_0x8656('0x3f')]));logger[_0x8656('0xf')](util[_0x8656('0x58')](_0x8656('0x69'),_0x20f84f));if(_0x20f84f!=='unmanaged'){logger['info']('['+[_0x20f84f[_0x8656('0x10')]()]+']',_0x8656('0x6a'));emit(_0x4aaf8b[_0x8656('0x55')],_0x182b0e[_0x8656('0x37')],_0x4ef615[_0x8656('0x3f')]);}})[_0x8656('0x12')](function(_0x509732){logger[_0x8656('0x13')]('['+[_0x20f84f[_0x8656('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x509732,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xffbf=['sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','picklist','idField','toString','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','%s/api/now/table/','isNil','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0xffbf,0x141));var _0xfffb=function(_0x55157d,_0x5e7e93){_0x55157d=_0x55157d-0x0;var _0x3e79af=_0xffbf[_0x55157d];return _0x3e79af;};'use strict';var _=require(_0xfffb('0x0'));var Promise=require(_0xfffb('0x1'));var rp=require(_0xfffb('0x2'));var util=require(_0xfffb('0x3'));var md5=require(_0xfffb('0x4'));var Redis=require(_0xfffb('0x5'));var intUtil=require(_0xfffb('0x6'));var config=require('../../../../config/environment');var logger=require(_0xfffb('0x7'))(_0xfffb('0x8'));config[_0xfffb('0x9')]=_[_0xfffb('0xa')](config[_0xfffb('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfffb('0x9')]));function getAdminUser(_0x12fb4f,_0x19b280,_0x5d8b7e,_0x5f4909,_0x31e9c1,_0x4a88a3){return new Promise(function(_0x2b2db7,_0x2c486d){var _0x104733={'method':_0xfffb('0xb'),'uri':_0x5f4909+_0xfffb('0xc')+'&'+_0x31e9c1+'&'+_0x4a88a3,'auth':_0x19b280,'json':!![]};return rp(_0x104733)['then'](function(_0x39a19d){if(_0x39a19d[_0xfffb('0xd')]['length']>0x0){_0x5d8b7e[_0xfffb('0xe')]=_0x39a19d[_0xfffb('0xd')][0x0][_0xfffb('0xf')];}logger['info']('['+[_0x12fb4f[_0xfffb('0x10')]()]+_0xfffb('0x11'),_0x5d8b7e);_0x2b2db7(_0x5d8b7e);})[_0xfffb('0x12')](function(_0x5beeb7){logger[_0xfffb('0x13')]('['+[_0x12fb4f[_0xfffb('0x10')]()]+']',_0x5beeb7[_0xfffb('0x14')]);_0x2c486d(_0x5beeb7['message']);});});}function getUser(_0x25ddde,_0x3ed2fc,_0x2b8002,_0x17760a,_0x32bbbd){return function(_0x3fd2ea){logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x16'),_0x3fd2ea);return new Promise(function(_0x482609,_0x171e62){if(intUtil[_0xfffb('0x17')](_0x3fd2ea['userEmail'])){var _0xc8213c={'method':_0xfffb('0xb'),'uri':_0x2b8002+_0xfffb('0x18')+_0x3fd2ea[_0xfffb('0x19')]+'&'+_0x17760a+'&'+_0x32bbbd,'auth':_0x3ed2fc,'json':!![]};logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x1a'),_0xc8213c);return rp(_0xc8213c)['then'](function(_0x56b840){logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x1b'),_0x56b840);if(_0x56b840[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0&&String(_0x56b840[_0xfffb('0xd')][0x0][_0xfffb('0x1d')])==='true'){_0x3fd2ea[_0xfffb('0x1e')]=_0x56b840[_0xfffb('0xd')][0x0][_0xfffb('0xf')];}else{_0x3fd2ea['userId']=_0x3fd2ea[_0xfffb('0xe')];_0x3fd2ea[_0xfffb('0x19')]=_0x3fd2ea[_0xfffb('0x1f')];}logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x20'),_0x3fd2ea);_0x482609(_0x3fd2ea);})[_0xfffb('0x12')](function(_0x9217f7){logger[_0xfffb('0x13')]('['+[_0x25ddde[_0xfffb('0x10')]()]+']',_0x9217f7[_0xfffb('0x14')]);_0x171e62(_0x9217f7[_0xfffb('0x14')]);});}else{logger[_0xfffb('0x15')]('['+[_0x25ddde['toUpperCase']()]+_0xfffb('0x21'));_0x3fd2ea[_0xfffb('0x1e')]=_0x3fd2ea['adminId'];_0x3fd2ea[_0xfffb('0x19')]=_0x3fd2ea[_0xfffb('0x1f')];_0x482609(_0x3fd2ea);}});};}function createEndUser(_0x40d319,_0x2ddc8f,_0x379d0f,_0x1c707c,_0x54819f){logger[_0xfffb('0x15')]('['+[_0x40d319[_0xfffb('0x10')]()]+_0xfffb('0x22'),_0x379d0f);return new Promise(function(_0x1c98f8,_0x1b1f49){var _0x36ef03={'method':_0xfffb('0x23'),'uri':_0x1c707c+_0xfffb('0x24')+_0x54819f,'body':{'user_name':_0x379d0f[_0xfffb('0x25')],'roles':_0xfffb('0x26'),'first_name':_0x379d0f[_0xfffb('0x25')],'active':_0xfffb('0x27'),'date_format':'System','phone':_0x379d0f[_0xfffb('0x25')]},'auth':_0x2ddc8f,'json':!![]};return rp(_0x36ef03)[_0xfffb('0x28')](function(_0x30cc41){logger[_0xfffb('0x15')]('['+[_0x40d319['toUpperCase']()]+_0xfffb('0x29'),_0x30cc41[_0xfffb('0xd')]);_0x379d0f[_0xfffb('0x2a')]=_0x30cc41[_0xfffb('0xd')][_0xfffb('0xf')];_0x1c98f8(_0x379d0f);})['catch'](function(_0x119dcf){logger[_0xfffb('0x13')]('['+[_0x40d319[_0xfffb('0x10')]()]+']',_0x119dcf[_0xfffb('0x14')]);_0x1b1f49(_0x119dcf[_0xfffb('0x14')]);});});}function getEndUser(_0x243ba9,_0x3ace5b,_0xc0735d,_0x4ebfdb,_0x11ea21){return function(_0x16d47e){logger[_0xfffb('0x15')]('['+[_0x243ba9['toUpperCase']()]+_0xfffb('0x2b'),_0x16d47e);return new Promise(function(_0x2b3795,_0x749bd0){var _0x5e4dc4={'method':_0xfffb('0xb'),'uri':_0xc0735d+'sys_user?sysparm_query=phone%3D'+_0x16d47e[_0xfffb('0x25')]+'&'+_0x4ebfdb+'&'+_0x11ea21,'auth':_0x3ace5b,'json':!![]};return rp(_0x5e4dc4)[_0xfffb('0x28')](function(_0x39fe27){if(_0x39fe27[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0){_0x16d47e[_0xfffb('0x2a')]=_0x39fe27[_0xfffb('0xd')][0x0][_0xfffb('0xf')];logger['info']('['+[_0x243ba9[_0xfffb('0x10')]()]+_0xfffb('0x2c'),_0x16d47e);_0x2b3795(_0x16d47e);}else{return createEndUser(_0x243ba9,_0x3ace5b,_0x16d47e,_0xc0735d,_0x4ebfdb)['then'](function(_0x45716d){logger['info']('['+[_0x243ba9[_0xfffb('0x10')]()]+_0xfffb('0x2d'),_0x45716d);_0x2b3795(_0x45716d);});}})[_0xfffb('0x12')](function(_0x5edb92){logger[_0xfffb('0x13')]('['+[_0x243ba9['toUpperCase']()]+']',_0x5edb92[_0xfffb('0x14')]);_0x749bd0(_0x5edb92[_0xfffb('0x14')]);});});};}function getCustomFields(_0x4a23be,_0x5da5d1){var _0x25c21f={};if(_0x4a23be[_0xfffb('0x1c')]>0x0){_[_0xfffb('0x2e')](_0x4a23be,function(_0x53b072){if(_[_0xfffb('0x2f')]([_0xfffb('0x30'),'picklist'],_0x53b072[_0xfffb('0x31')])&&_0x53b072[_0xfffb('0x32')]&&!_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x32')][_0xfffb('0x34')]()]=_0x53b072['content']['toString']();}else if(_['includes']([_0xfffb('0x30'),_0xfffb('0x35')],_0x53b072[_0xfffb('0x31')])&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x53b072['content'][_0xfffb('0x37')]();}else if(_0x53b072['type']===_0xfffb('0x38')&&_0x53b072[_0xfffb('0x39')]&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x5da5d1[_0x53b072[_0xfffb('0x39')]][_0xfffb('0x37')]();}else if(_0x53b072[_0xfffb('0x31')]===_0xfffb('0x3a')&&_0x53b072[_0xfffb('0x3b')]&&_0x53b072[_0xfffb('0x3b')]['name']&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x5da5d1[_0x53b072[_0xfffb('0x3b')]['name'][_0xfffb('0x34')]()][_0xfffb('0x37')]();}});}return _0x25c21f;}function getTicket(_0xdc876c,_0xc923a8,_0x1cd3dc,_0x220816,_0x17d55d,_0x20052e){return function(_0x5a5a50){logger[_0xfffb('0x15')]('['+[_0xdc876c['toUpperCase']()]+_0xfffb('0x3c'),_0x5a5a50);return new Promise(function(_0x142a43,_0x1f488d){var _0x3e8bc0=_0xdc876c[_0xfffb('0x34')]()===_0xfffb('0x3d')?_0x5a5a50[_0xfffb('0x1e')]:_0x5a5a50[_0xfffb('0x2a')];var _0x56222f={'method':'POST','uri':_0x1cd3dc+_0xfffb('0x3e')+'?'+_0x20052e,'body':Object[_0xfffb('0x3f')]({},{'active':_0xfffb('0x27'),'caller_id':_0x3e8bc0,'assigned_to':_0x5a5a50[_0xfffb('0x1e')],'short_description':intUtil[_0xfffb('0x40')](_0x220816[_0xfffb('0x41')],_0x17d55d,'\x20'),'description':intUtil[_0xfffb('0x40')](_0x220816[_0xfffb('0x42')],_0x17d55d,'\x0a')},getCustomFields(_0x220816['Fields'],_0x17d55d)),'auth':_0xc923a8,'json':!![]};return rp(_0x56222f)[_0xfffb('0x28')](function(_0x10991c){logger[_0xfffb('0x15')]('['+[_0xdc876c['toUpperCase']()]+_0xfffb('0x43'),_0x10991c[_0xfffb('0xd')]);_0x5a5a50[_0xfffb('0x44')]=_0x10991c[_0xfffb('0xd')][_0xfffb('0xf')];_0x5a5a50[_0xfffb('0x45')]=_0x10991c[_0xfffb('0xd')][_0xfffb('0x46')];logger[_0xfffb('0x15')]('['+[_0xdc876c[_0xfffb('0x10')]()]+']\x20getTicket\x20crm',_0x5a5a50);_0x142a43(_0x5a5a50);})['catch'](function(_0x1fc20d){logger[_0xfffb('0x13')]('['+[_0xdc876c[_0xfffb('0x10')]()]+']',_0x1fc20d[_0xfffb('0x14')]);_0x1f488d(_0x1fc20d['message']);});});};}function createRemoteTag(_0xcd1af2,_0x1382e8,_0x1cbb17,_0x9c80e0){return new Promise(function(_0x4b68f7,_0x327eab){var _0x453ef3={'method':_0xfffb('0x23'),'uri':_0x1cbb17+_0xfffb('0x47')+'?'+_0x9c80e0,'body':{'short_description':_0xcd1af2,'global':!![],'active':!![],'name':_0xcd1af2},'auth':_0x1382e8,'json':!![]};return rp(_0x453ef3)[_0xfffb('0x28')](function(_0x3228cc){var _0x4deb4e=_0x3228cc[_0xfffb('0xd')]['sys_id'];_0x4b68f7(_0x4deb4e);});});}function getRemoteTag(_0x2baeec,_0x55a592,_0x9a63db,_0x1fc846,_0x2b5ff7){return new Promise(function(_0x5e9440,_0x31f33d){var _0x28c36={'method':'GET','uri':_0x9a63db+_0xfffb('0x47')+_0xfffb('0x48')+_0x2baeec+'&'+_0x1fc846,'auth':_0x55a592,'json':!![]};return rp(_0x28c36)[_0xfffb('0x28')](function(_0x630129){if(_0x630129[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0){var _0x343781=_0x630129[_0xfffb('0xd')][0x0][_0xfffb('0xf')];_0x5e9440(_0x343781);}else{return createRemoteTag(_0x2baeec,_0x55a592,_0x9a63db,_0x1fc846)[_0xfffb('0x28')](function(_0xa3226e){_0x5e9440(_0xa3226e);});}});});}function assignTagToIncident(_0x41aa5d,_0x4c0c26,_0x39c59a,_0x2f61d3,_0x3d3502){return new Promise(function(_0x3e1042,_0x471ba2){var _0x54dca5={'method':_0xfffb('0x23'),'uri':_0x39c59a+_0xfffb('0x49')+'?'+_0x3d3502,'body':{'label':_0x41aa5d,'table':_0xfffb('0x3e'),'id_type':_0xfffb('0x4a'),'table_key':_0x2f61d3['ticketId'],'title':_0xfffb('0x4b')+_0x2f61d3['ticketNumber'],'id_display':_0x2f61d3[_0xfffb('0x45')]},'auth':_0x4c0c26,'json':!![]};return rp(_0x54dca5)['then'](function(_0x126f5c){_0x3e1042();})[_0xfffb('0x12')](function(){_0x3e1042();});});}function manageTags(_0xcd3763,_0x14557a,_0x499d57,_0x15d93f,_0xfe7f4a,_0x4759f2,_0x1404b4){return new Promise(function(_0x100e12,_0x20f484){var _0x235e1c=[];_0x14557a['forEach'](function(_0x32a683){_0x235e1c['push'](getRemoteTag(_0x32a683,_0x499d57,_0x15d93f,_0x4759f2,_0x1404b4));});return Promise[_0xfffb('0x4c')](_0x235e1c)['then'](function(_0x53bb85){if(_0x53bb85[_0xfffb('0x1c')]){logger[_0xfffb('0x15')]('['+[_0xcd3763[_0xfffb('0x10')]()]+_0xfffb('0x4d'),_0x53bb85);var _0x67834=[];_0x53bb85['forEach'](function(_0x129e31){_0x67834['push'](assignTagToIncident(_0x129e31,_0x499d57,_0x15d93f,_0xfe7f4a,_0x4759f2));});return Promise[_0xfffb('0x4c')](_0x67834)[_0xfffb('0x28')](function(){_0x100e12();})[_0xfffb('0x12')](function(){_0x100e12();});}else{_0x100e12();}});});}function getTags(_0x321cc1,_0x1cd507,_0x119238,_0x52ceff,_0x2be696,_0x3c0232){return function(_0x401538){return new Promise(function(_0x4b60a2,_0x11681b){var _0x2688f1=[];var _0x19e8ff=_0x52ceff[_0xfffb('0x4e')];if(_0x19e8ff&&_0x19e8ff[_0xfffb('0x1c')]>0x0){_0x2688f1=_[_0xfffb('0x4f')](_0x19e8ff,_0xfffb('0x50'));}if(_0x2688f1[_0xfffb('0x1c')]>0x0){return manageTags(_0x321cc1,_0x2688f1,_0x1cd507,_0x119238,_0x401538,_0x2be696,_0x3c0232)[_0xfffb('0x28')](function(){_0x4b60a2(_0x401538);});}else{_0x4b60a2(_0x401538);}});};}function emit(_0x4fd2d8,_0x508f91,_0x423ffc){var _0x346a29=_0xfffb('0x51')+_0xfffb('0x52')+_0xfffb('0x53')+_0xfffb('0x54');var _0xd0947c={'uri':_0x4fd2d8+_0xfffb('0x55')+_0x423ffc+_0x346a29};io['to'](util[_0xfffb('0x56')]('user:%s',_0x508f91))[_0xfffb('0x57')](_0xfffb('0x58'),_0xd0947c);}exports['cs']=function(_0x47e238,_0x11a89f,_0xde7a61,_0x7d2e95,_0x4c31df,_0x3a8e97,_0x3ccf85,_0x33913f){var _0x4757db={};var _0x8470e8={'user':_0x3a8e97[_0xfffb('0x59')],'pass':_0x3a8e97[_0xfffb('0x5a')]};var _0x2caac8=_0xfffb('0x5b');var _0xe9c2aa=_0xfffb('0x5c');_0x3a8e97['remoteUri']=intUtil[_0xfffb('0x5d')](_0x3a8e97[_0xfffb('0x5e')]);_0x3a8e97['serverUrl']=intUtil[_0xfffb('0x5d')](_0x3a8e97['serverUrl']);var _0x22cba7=util['format'](_0xfffb('0x5f'),_0x3a8e97[_0xfffb('0x5e')]);_0x4757db[_0xfffb('0x19')]=!_[_0xfffb('0x60')](_0x7d2e95)?_0x7d2e95['email']:null;_0x4757db[_0xfffb('0x1f')]=_0x3a8e97['email'];_0x4757db['endUserNumber']=_0x33913f['toLowerCase']()===_0xfffb('0x3d')?_0x11a89f[_0xfffb('0x61')]:_0x11a89f[_0xfffb('0x62')];_0x4757db['callDirection']=_0x33913f===_0xfffb('0x63')||_0x33913f==='unmanaged'?_0xfffb('0x63'):'outbound';var _0x22133c=util[_0xfffb('0x56')](_0xfffb('0x64'),_0x3a8e97[_0xfffb('0x65')],_0x11a89f[_0xfffb('0x66')],md5(_0x11a89f[_0xfffb('0x66')]));if(_0x4c31df&&_0x4c31df[_0xfffb('0x67')]){logger['info'](_0xfffb('0x68'),_0xfffb('0x69'));_0x11a89f[_0xfffb('0x6a')]=_0x22133c;}else if(_0x3ccf85&&_0x3ccf85[_0xfffb('0x6b')]&&_0x3ccf85[_0xfffb('0x6b')]!==_0xfffb('0x6c')){logger[_0xfffb('0x15')](_0xfffb('0x6d'),_0xfffb('0x69'));_0x11a89f[_0xfffb('0x6a')]=_0x22133c;}else{_0x11a89f[_0xfffb('0x6a')]='';}return getAdminUser(_0x33913f,_0x8470e8,_0x4757db,_0x22cba7,_0xe9c2aa,_0x2caac8)[_0xfffb('0x28')](getUser(_0x33913f,_0x8470e8,_0x22cba7,_0xe9c2aa,_0x2caac8))[_0xfffb('0x28')](getEndUser(_0x33913f,_0x8470e8,_0x22cba7,_0xe9c2aa,_0x2caac8))[_0xfffb('0x28')](getTicket(_0x33913f,_0x8470e8,_0x22cba7,_0xde7a61,_0x11a89f,_0xe9c2aa))[_0xfffb('0x28')](function(_0x47b1eb){logger['info'](util[_0xfffb('0x56')](_0xfffb('0x6e'),_0x47b1eb[_0xfffb('0x44')]));logger[_0xfffb('0x15')](util[_0xfffb('0x56')](_0xfffb('0x6f'),_0x33913f));if(_0x33913f!==_0xfffb('0x70')){logger[_0xfffb('0x15')]('['+[_0x33913f[_0xfffb('0x10')]()]+']',_0xfffb('0x71'));emit(_0x3a8e97[_0xfffb('0x5e')],_0x7d2e95[_0xfffb('0x50')],_0x47b1eb['ticketId']);}})['catch'](function(_0x1158ad){logger[_0xfffb('0x13')]('['+[_0x33913f[_0xfffb('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xfffb('0x72')](_0x1158ad,{'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 ae64112..26ab16b 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 _0x9366=['Agent\x20found!','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','unmanaged','toUpperCase','isNil','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','entry_list'];(function(_0x4a4cab,_0x180da5){var _0x247406=function(_0x19df22){while(--_0x19df22){_0x4a4cab['push'](_0x4a4cab['shift']());}};_0x247406(++_0x180da5);}(_0x9366,0xcf));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x6936('0x0'));var md5=require(_0x6936('0x1'));var util=require(_0x6936('0x2'));var Redis=require(_0x6936('0x3'));var intUtil=require(_0x6936('0x4'));var config=require(_0x6936('0x5'));var logger=require(_0x6936('0x6'))(_0x6936('0x7'));config[_0x6936('0x8')]=_[_0x6936('0x9')](config[_0x6936('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x6936('0xa'))(new Redis(config[_0x6936('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x349124,_0x26498c,_0x4bd39d){io['to'](_0x349124)[_0x6936('0xb')](_0x26498c,_0x4bd39d);}function getTicket(_0x29f6cc,_0x21bc70,_0xda3002,_0x5d30b1,_0xa0100f,_0x1da2dd,_0x4980be,_0x2e0a98){logger[_0x6936('0xc')](_0x6936('0xd'));var _0x3a8f33=new Date();var _0x330a65=[{'name':_0x6936('0xe'),'value':intUtil['getString'](_0x5d30b1[_0x6936('0xf')],_0xa0100f,'\x20')},{'name':_0x6936('0x10'),'value':_0x21bc70['id']},{'name':_0x6936('0x11'),'value':_0x21bc70['id']},{'name':_0x6936('0x12'),'value':intUtil['getString'](_0x5d30b1[_0x6936('0x13')],_0xa0100f,'\x0a')},{'name':_0x6936('0x14'),'value':_0x3a8f33['toISOString']()[_0x6936('0x15')](0x0,0x13)[_0x6936('0x16')]('T','\x20')},{'name':_0x6936('0x17'),'value':'0'},{'name':_0x6936('0x18'),'value':'15'},{'name':'parent_id','value':_0xda3002['id']},{'name':_0x6936('0x19'),'value':_0x6936('0x1a')},{'name':_0x6936('0x1b'),'value':_0xda3002[_0x6936('0xe')]},{'name':_0x6936('0x1c'),'value':_0x2e0a98}];if(_0x1da2dd[_0x6936('0x1d')]){_[_0x6936('0x1e')](_0x1da2dd,function(_0x3fa875){if(_0xa0100f[_0x3fa875['variableName']]){_0x330a65[_0x6936('0x1f')]({'name':_0x3fa875[_0x6936('0x20')],'value':_0xa0100f[_0x3fa875[_0x6936('0x21')]]});}});}return request({'form':{'method':_0x6936('0x22'),'input_type':_0x6936('0x23'),'response_type':'JSON','rest_data':JSON[_0x6936('0x24')]({'session':_0x4980be['id'],'module_name':_0x6936('0x25'),'name_value_list':_0x330a65})}});}function getAuth(_0x1032aa){return util[_0x6936('0x26')](_0x6936('0x27'),new Buffer(_0x1032aa[_0x6936('0x28')]+':X')[_0x6936('0x29')](_0x6936('0x2a')));}function getServerInfo(_0x476830){return request({'form':{'method':'get_server_info','input_type':_0x6936('0x23'),'response_type':_0x6936('0x23'),'rest_data':JSON['stringify']({'session':_0x476830['id']})}});}function getUser(_0x2f9c98,_0x3a6997,_0x304511){if(!_['isNil'](_0x3a6997)){logger[_0x6936('0xc')](_0x6936('0x2b'),_0x3a6997);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6936('0x24')]({'session':_0x304511['id'],'module_name':_0x6936('0x2c'),'query':util[_0x6936('0x26')](_0x6936('0x2d'),_0x3a6997),'order_by':'','offset':'0','select_fields':['id',_0x6936('0xe'),_0x6936('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x16699c){if(_0x16699c['entry_list'][_0x6936('0x1d')]){var _0x324134=_[_0x6936('0x2f')](_0x16699c[_0x6936('0x30')],function(_0x44dc65){return _0x44dc65['name_value_list'][_0x6936('0x2e')]['value']===_0x3a6997;});if(_0x324134){logger[_0x6936('0xc')](_0x6936('0x31'));return BPromise['resolve']({'id':_0x324134[_0x6936('0x32')]['id'][_0x6936('0x33')],'name':_0x324134['name_value_list'][_0x6936('0xe')][_0x6936('0x33')]});}}logger[_0x6936('0xc')](_0x6936('0x34'));return BPromise['resolve']({'id':_0x304511[_0x6936('0x32')][_0x6936('0x35')]['value'],'name':_0x304511[_0x6936('0x32')][_0x6936('0x2e')][_0x6936('0x33')]});});}else{logger[_0x6936('0xc')](_0x6936('0x36'));return BPromise[_0x6936('0x37')]({'id':_0x304511['name_value_list'][_0x6936('0x35')]['value'],'name':_0x304511[_0x6936('0x32')][_0x6936('0x2e')][_0x6936('0x33')]});}}function getEndUser(_0x2d2cab,_0x4c277d,_0x3f5fc8,_0x30f7b8){logger[_0x6936('0xc')](_0x6936('0x38'),_0x3f5fc8);return request({'form':{'method':_0x6936('0x39'),'input_type':_0x6936('0x23'),'response_type':_0x6936('0x23'),'rest_data':JSON['stringify']({'session':_0x30f7b8['id'],'module_name':_0x6936('0x1a'),'query':util[_0x6936('0x26')](_0x6936('0x3a'),_0x3f5fc8),'order_by':'','offset':'0','select_fields':['id',_0x6936('0xe'),_0x6936('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x29b5e8){if(_0x29b5e8[_0x6936('0x30')][_0x6936('0x1d')]){var _0x1cd33a=_[_0x6936('0x2f')](_0x29b5e8[_0x6936('0x30')],function(_0x5a0f5d){return _0x5a0f5d[_0x6936('0x32')][_0x6936('0x3b')][_0x6936('0x33')]===_0x3f5fc8;});if(_0x1cd33a){logger[_0x6936('0xc')](_0x6936('0x3c'));return BPromise['resolve']({'id':_0x1cd33a[_0x6936('0x32')]['id'][_0x6936('0x33')],'name':_0x1cd33a['name_value_list'][_0x6936('0xe')][_0x6936('0x33')],'phone':_0x1cd33a[_0x6936('0x32')][_0x6936('0x3b')][_0x6936('0x33')]});}}else{logger[_0x6936('0xc')](_0x6936('0x3d'));return request({'form':{'method':'set_entry','input_type':_0x6936('0x23'),'response_type':_0x6936('0x23'),'rest_data':JSON[_0x6936('0x24')]({'session':_0x30f7b8['id'],'module_name':_0x6936('0x1a'),'name_value_list':[{'name':_0x6936('0x3e'),'value':_0x4c277d!==_0x6936('0x3f')?_0x4c277d:util[_0x6936('0x26')](_0x6936('0x40'),_0x3f5fc8)},{'name':_0x6936('0x3b'),'value':_0x3f5fc8}]})}})[_0x6936('0x41')](function(_0x465053){logger[_0x6936('0xc')](_0x6936('0x42'));return BPromise[_0x6936('0x37')]({'id':_0x465053['id'],'name':_0x465053['entry_list'][_0x6936('0x3e')]['value'],'phone':_0x465053[_0x6936('0x30')][_0x6936('0x3b')][_0x6936('0x33')]});});}});}function request(_0x4423a8){logger[_0x6936('0x43')](_0x6936('0x44'),JSON[_0x6936('0x24')](_0x4423a8));return rp(_[_0x6936('0x45')](def,_0x4423a8));}function getTags(_0x5bdb08,_0x24bcb1){var _0xe7684a=[];if(_0x5bdb08&&_0x5bdb08[_0x6936('0x1d')]>0x0){_0xe7684a=_[_0x6936('0x46')](_0x5bdb08,_0x24bcb1);}return _0xe7684a;}function getCustomFields(_0x54631b,_0x160c7b){var _0x12c18e=[];var _0x276c97={'custom_fields':[]};if(_0x54631b[_0x6936('0x1d')]>0x0){_[_0x6936('0x1e')](_0x54631b,function(_0x4958fd){if(_0x4958fd[_0x6936('0x47')]===_0x6936('0x48')&&_0x4958fd[_0x6936('0x49')]&&!_0x4958fd[_0x6936('0x4a')]){_0x276c97[_0x4958fd[_0x6936('0x49')][_0x6936('0x4b')]()]=_0x4958fd[_0x6936('0x4c')][_0x6936('0x29')]();}else if(_0x4958fd[_0x6936('0x47')]===_0x6936('0x48')&&_0x4958fd[_0x6936('0x20')]&&_0x4958fd['customField']){_0x276c97[_0x6936('0x4d')][_0x6936('0x1f')]({'id':_0x4958fd[_0x6936('0x20')],'value':_0x4958fd[_0x6936('0x4c')][_0x6936('0x29')]()});}else if(_0x4958fd[_0x6936('0x47')]===_0x6936('0x4e')&&_0x4958fd[_0x6936('0x21')]&&_0x4958fd[_0x6936('0x20')]&&_0x4958fd[_0x6936('0x4a')]){_0x160c7b[_0x4958fd[_0x6936('0x21')]]&&_0x276c97[_0x6936('0x4d')][_0x6936('0x1f')]({'id':_0x4958fd[_0x6936('0x20')],'value':_0x160c7b[_0x4958fd['variableName']][_0x6936('0x29')]()});}else if(_0x4958fd['type']==='customVariable'&&_0x4958fd[_0x6936('0x4f')]&&_0x4958fd[_0x6936('0x4f')][_0x6936('0xe')]&&_0x4958fd[_0x6936('0x20')]&&_0x4958fd['customField']){_0x160c7b[_0x4958fd[_0x6936('0x4f')][_0x6936('0xe')]['toLowerCase']()]&&_0x276c97[_0x6936('0x4d')][_0x6936('0x1f')]({'id':_0x4958fd[_0x6936('0x20')],'value':_0x160c7b[_0x4958fd[_0x6936('0x4f')][_0x6936('0xe')][_0x6936('0x4b')]()][_0x6936('0x29')]()});}});}return _0x276c97;}function getConnection(_0x437b61){return request({'method':_0x6936('0x50'),'form':{'method':_0x6936('0x51'),'input_type':_0x6936('0x23'),'response_type':_0x6936('0x23'),'rest_data':JSON[_0x6936('0x24')]({'user_auth':{'user_name':_0x437b61[_0x6936('0x52')],'password':_0x437b61[_0x6936('0x53')],'encryption':'PLAIN'},'application':_0x6936('0x54')})}})[_0x6936('0x41')](function(_0x3bcb4f){var _0x54d168=_0x3bcb4f;if(_0x54d168['id']){def[_0x6936('0x55')]=_0x54d168['id'];return BPromise[_0x6936('0x37')](_0x54d168);}else{throw new Error(util['format'](_0x6936('0x56'),_0x437b61['id']));}});}function setRelationship(_0x167ae6,_0x113ad7,_0x8fd68a,_0x2ba39d){return request({'form':{'method':_0x6936('0x57'),'input_type':_0x6936('0x23'),'response_type':_0x6936('0x23'),'rest_data':JSON[_0x6936('0x24')]({'session':_0x167ae6['id'],'module_name':_0x6936('0x25'),'module_id':_0x8fd68a['id'],'link_field_name':_0x2ba39d,'related_ids':[_0x113ad7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6936('0x58')]=function(_0x26477a,_0x3c674d,_0x859216,_0x19c859,_0x577e9d,_0x57ded6){var _0x206643,_0x156f68,_0xe6c806,_0x44f866;_0x57ded6[_0x6936('0x59')]=intUtil[_0x6936('0x5a')](_0x57ded6[_0x6936('0x59')]);_0x57ded6[_0x6936('0x5b')]=intUtil['stripTrailingSlash'](_0x57ded6[_0x6936('0x5b')]);def[_0x6936('0x5c')]=util[_0x6936('0x26')](_0x6936('0x5d'),_0x57ded6['remoteUri']);if(_0x577e9d&&_0x577e9d[_0x6936('0x5e')]){logger[_0x6936('0xc')]('[QUEUE]',_0x6936('0x5f'));_0x3c674d[_0x6936('0x60')]=util[_0x6936('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x57ded6[_0x6936('0x5b')],_0x3c674d[_0x6936('0x61')],md5(_0x3c674d['uniqueid']));}else{_0x3c674d[_0x6936('0x60')]='';}return getConnection(_0x57ded6)[_0x6936('0x41')](function(_0x5efd0b){_0x44f866=_0x5efd0b;return getUser(_0x57ded6,_0x19c859[_0x6936('0xe')],_0x44f866);})[_0x6936('0x41')](function(_0x340429){_0x206643=_0x340429;logger[_0x6936('0xc')](_0x6936('0x62'),_0x206643['id']);return getEndUser(_0x57ded6,_0x3c674d[_0x6936('0x63')],_0x3c674d[_0x6936('0x64')],_0x44f866);})[_0x6936('0x41')](function(_0x4c6c33){_0x156f68=_0x4c6c33;logger['info'](_0x6936('0x65'),_0x156f68['id']);return getTicket(_0x57ded6,_0x206643,_0x156f68,_0x859216,_0x3c674d,_0x859216[_0x6936('0x66')],_0x44f866,_0x6936('0x67'));})[_0x6936('0x41')](function(_0x30c1a9){_0xe6c806=_0x30c1a9;logger[_0x6936('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0xe6c806['id']);return setRelationship(_0x44f866,_0x206643,_0xe6c806,_0x6936('0x68'));})[_0x6936('0x41')](function(){return setRelationship(_0x44f866,_0x156f68,_0xe6c806,_0x6936('0x69'));})[_0x6936('0x41')](function(){return getServerInfo(_0x44f866);})[_0x6936('0x41')](function(_0x8cd57){var _0x5a9f9d=parseInt(_0x8cd57['version']['charAt'](0x0));var _0x5d7fa4=util[_0x6936('0x26')](_0x6936('0x6a'),_0x57ded6[_0x6936('0x59')],_0xe6c806['id']);if(_0x5a9f9d>0x6){_0x5d7fa4=util[_0x6936('0x26')](_0x6936('0x6b'),_0x57ded6[_0x6936('0x59')],_0xe6c806['id']);}logger[_0x6936('0xc')]('[QUEUE]',_0x6936('0x6c'));emit(util['format'](_0x6936('0x6d'),_0x19c859[_0x6936('0xe')]),_0x6936('0x6e'),{'uri':_0x5d7fa4});})[_0x6936('0x6f')](function(_0x1f9a4a){logger[_0x6936('0x70')](_0x6936('0x71'),JSON[_0x6936('0x24')](_0x1f9a4a));});};exports[_0x6936('0x72')]=function(_0x561e72,_0xfbdd22,_0x3b33de,_0x2c96c7,_0x2edc64,_0x559654,_0x4dbf2f){var _0x512bf8,_0x214087,_0x2ca8f1,_0x572007;_0x559654['remoteUri']=intUtil['stripTrailingSlash'](_0x559654[_0x6936('0x59')]);_0x559654[_0x6936('0x5b')]=intUtil['stripTrailingSlash'](_0x559654[_0x6936('0x5b')]);def[_0x6936('0x5c')]=util[_0x6936('0x26')](_0x6936('0x5d'),_0x559654[_0x6936('0x59')]);if(_0x4dbf2f&&_0x4dbf2f['recordingFormat']&&_0x4dbf2f[_0x6936('0x73')]!=='none'){logger['info'](_0x6936('0x74'),_0x6936('0x5f'));_0xfbdd22[_0x6936('0x60')]=util[_0x6936('0x26')](_0x6936('0x75'),_0x559654[_0x6936('0x5b')],_0xfbdd22['uniqueid'],md5(_0xfbdd22['uniqueid']));}return getConnection(_0x559654)[_0x6936('0x41')](function(_0x1ae615){_0x572007=_0x1ae615;return getUser(_0x559654,_0x2c96c7[_0x6936('0xe')],_0x572007);})['then'](function(_0x56241e){_0x512bf8=_0x56241e;logger[_0x6936('0xc')]('The\x20User\x20ID\x20is:',_0x512bf8['id']);return getEndUser(_0x559654,_0xfbdd22[_0x6936('0x76')],_0xfbdd22[_0x6936('0x77')],_0x572007);})[_0x6936('0x41')](function(_0x1ddeb0){_0x214087=_0x1ddeb0;logger[_0x6936('0xc')]('The\x20Enduser\x20ID\x20is:',_0x214087['id']);return getTicket(_0x559654,_0x512bf8,_0x214087,_0x3b33de,_0xfbdd22,_0x3b33de[_0x6936('0x66')],_0x572007,_0x6936('0x78'));})['then'](function(_0x1341a0){_0x2ca8f1=_0x1341a0;logger['info'](_0x6936('0x79'));logger[_0x6936('0xc')](_0x6936('0x7a'),_0x2ca8f1['id']);return setRelationship(_0x572007,_0x512bf8,_0x2ca8f1,_0x6936('0x68'));})['then'](function(){return setRelationship(_0x572007,_0x214087,_0x2ca8f1,'contacts');})[_0x6936('0x41')](function(){return getServerInfo(_0x572007);})['then'](function(_0x4cb5c9){var _0x30a783=parseInt(_0x4cb5c9[_0x6936('0x7b')]['charAt'](0x0));var _0x334152=util[_0x6936('0x26')](_0x6936('0x6a'),_0x559654[_0x6936('0x59')],_0x2ca8f1['id']);if(_0x30a783>0x6){_0x334152=util[_0x6936('0x26')](_0x6936('0x6b'),_0x559654['remoteUri'],_0x2ca8f1['id']);}logger['info'](_0x6936('0x74'),_0x6936('0x6c'));emit(util[_0x6936('0x26')](_0x6936('0x6d'),_0x2c96c7[_0x6936('0xe')]),_0x6936('0x6e'),{'uri':_0x334152});})[_0x6936('0x6f')](function(_0x287618){logger[_0x6936('0x70')](_0x6936('0x74'),JSON['stringify'](_0x287618));});};exports[_0x6936('0x7c')]=function(_0x31ca22,_0x6ae5c9,_0x3dd3c1,_0x529a03,_0x9d4adf,_0x47ffd5){var _0x451a9f,_0x28290a,_0x53bd2a,_0x55a2c4;_0x47ffd5[_0x6936('0x59')]=intUtil[_0x6936('0x5a')](_0x47ffd5[_0x6936('0x59')]);_0x47ffd5[_0x6936('0x5b')]=intUtil['stripTrailingSlash'](_0x47ffd5['serverUrl']);def['uri']=util['format'](_0x6936('0x5d'),_0x47ffd5['remoteUri']);if(_0x9d4adf&&_0x9d4adf['monitor_format']){logger['info']('['+_0x6ae5c9['lastevent'][_0x6936('0x7d')]()+']',_0x6936('0x5f'));_0x6ae5c9[_0x6936('0x60')]=util[_0x6936('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47ffd5[_0x6936('0x5b')],_0x6ae5c9[_0x6936('0x61')],md5(_0x6ae5c9[_0x6936('0x61')]));}else{_0x6ae5c9[_0x6936('0x60')]='';}return getConnection(_0x47ffd5)[_0x6936('0x41')](function(_0x92f594){_0x55a2c4=_0x92f594;if(!_[_0x6936('0x7e')](_0x529a03)){return getUser(_0x47ffd5,_0x529a03[_0x6936('0xe')],_0x55a2c4);}else{return getUser(_0x47ffd5,null,_0x55a2c4);}})[_0x6936('0x41')](function(_0x56b4ea){_0x451a9f=_0x56b4ea;logger[_0x6936('0xc')]('The\x20User\x20ID\x20is:',_0x451a9f['id']);return getEndUser(_0x47ffd5,_0x6ae5c9['calleridname'],_0x6ae5c9[_0x6936('0x64')],_0x55a2c4);})['then'](function(_0x3d88cf){_0x28290a=_0x3d88cf;logger[_0x6936('0xc')]('The\x20Enduser\x20ID\x20is:',_0x28290a['id']);return getTicket(_0x47ffd5,_0x451a9f,_0x28290a,_0x3dd3c1,_0x6ae5c9,_0x3dd3c1[_0x6936('0x66')],_0x55a2c4,'Inbound');})[_0x6936('0x41')](function(_0x20042a){_0x53bd2a=_0x20042a;logger[_0x6936('0xc')](_0x6936('0x79'));logger[_0x6936('0xc')](_0x6936('0x7a'),_0x53bd2a['id']);return setRelationship(_0x55a2c4,_0x451a9f,_0x53bd2a,_0x6936('0x68'));})[_0x6936('0x41')](function(){return setRelationship(_0x55a2c4,_0x28290a,_0x53bd2a,_0x6936('0x69'));})[_0x6936('0x41')](function(){return getServerInfo(_0x55a2c4);})[_0x6936('0x6f')](function(_0x633cbe){logger[_0x6936('0x70')]('['+_0x6ae5c9[_0x6936('0x7f')][_0x6936('0x7d')]()+']',JSON['stringify'](_0x633cbe));});}; \ No newline at end of file +var _0x936a=['recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','charAt','catch','error','unmanaged','lastevent','toUpperCase','Inbound','Ticket\x20created!','lodash','md5','util','ioredis','./util','sugarcrm','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','format','apiKey','toString','base64','isNil','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','map','string','nameField','toLowerCase','type','customField','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0x936a,0xfb));var _0xa936=function(_0x27e836,_0x3370bd){_0x27e836=_0x27e836-0x0;var _0x385d7f=_0x936a[_0x27e836];return _0x385d7f;};'use strict';var _=require(_0xa936('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xa936('0x1'));var util=require(_0xa936('0x2'));var Redis=require(_0xa936('0x3'));var intUtil=require(_0xa936('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xa936('0x5'));config[_0xa936('0x6')]=_['defaults'](config[_0xa936('0x6')],{'host':_0xa936('0x7'),'port':0x18eb});var io=require(_0xa936('0x8'))(new Redis(config['redis']));var def={'method':_0xa936('0x9'),'json':!![]};function emit(_0x49b13e,_0x5c11e4,_0x56e56f){io['to'](_0x49b13e)['emit'](_0x5c11e4,_0x56e56f);}function getTicket(_0x3030e0,_0x11b6c0,_0x38911c,_0x44cb78,_0x35c362,_0x27900c,_0x5bca09,_0x4c0a70){logger[_0xa936('0xa')](_0xa936('0xb'));var _0x377d4d=new Date();var _0x53b70c=[{'name':'name','value':intUtil['getString'](_0x44cb78[_0xa936('0xc')],_0x35c362,'\x20')},{'name':_0xa936('0xd'),'value':_0x11b6c0['id']},{'name':_0xa936('0xe'),'value':_0x11b6c0['id']},{'name':_0xa936('0xf'),'value':intUtil[_0xa936('0x10')](_0x44cb78[_0xa936('0x11')],_0x35c362,'\x0a')},{'name':_0xa936('0x12'),'value':_0x377d4d[_0xa936('0x13')]()[_0xa936('0x14')](0x0,0x13)[_0xa936('0x15')]('T','\x20')},{'name':_0xa936('0x16'),'value':'0'},{'name':_0xa936('0x17'),'value':'15'},{'name':'parent_id','value':_0x38911c['id']},{'name':'parent_type','value':_0xa936('0x18')},{'name':_0xa936('0x19'),'value':_0x38911c[_0xa936('0x1a')]},{'name':_0xa936('0x1b'),'value':_0x4c0a70}];if(_0x27900c[_0xa936('0x1c')]){_[_0xa936('0x1d')](_0x27900c,function(_0x442688){if(_0x35c362[_0x442688['variableName']]){_0x53b70c[_0xa936('0x1e')]({'name':_0x442688[_0xa936('0x1f')],'value':_0x35c362[_0x442688[_0xa936('0x20')]]});}});}return request({'form':{'method':_0xa936('0x21'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x5bca09['id'],'module_name':'Calls','name_value_list':_0x53b70c})}});}function getAuth(_0x5d8923){return util[_0xa936('0x24')]('Basic\x20%s',new Buffer(_0x5d8923[_0xa936('0x25')]+':X')[_0xa936('0x26')](_0xa936('0x27')));}function getServerInfo(_0x1b99b4){return request({'form':{'method':'get_server_info','input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON['stringify']({'session':_0x1b99b4['id']})}});}function getUser(_0x25cf57,_0x1557a6,_0x2665a2){if(!_[_0xa936('0x28')](_0x1557a6)){logger[_0xa936('0xa')]('Getting\x20agent\x20with\x20name',_0x1557a6);return request({'form':{'method':_0xa936('0x29'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x2665a2['id'],'module_name':_0xa936('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1557a6),'order_by':'','offset':'0','select_fields':['id','name',_0xa936('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa936('0x2c')](function(_0x2ad622){if(_0x2ad622[_0xa936('0x2d')][_0xa936('0x1c')]){var _0xa393f7=_[_0xa936('0x2e')](_0x2ad622[_0xa936('0x2d')],function(_0x49a27a){return _0x49a27a[_0xa936('0x2f')][_0xa936('0x2b')][_0xa936('0x30')]===_0x1557a6;});if(_0xa393f7){logger['info']('Agent\x20found!');return BPromise[_0xa936('0x31')]({'id':_0xa393f7[_0xa936('0x2f')]['id'][_0xa936('0x30')],'name':_0xa393f7[_0xa936('0x2f')]['name'][_0xa936('0x30')]});}}logger['info'](_0xa936('0x32'));return BPromise[_0xa936('0x31')]({'id':_0x2665a2['name_value_list'][_0xa936('0x33')][_0xa936('0x30')],'name':_0x2665a2[_0xa936('0x2f')][_0xa936('0x2b')]['value']});});}else{logger[_0xa936('0xa')](_0xa936('0x34'));return BPromise['resolve']({'id':_0x2665a2[_0xa936('0x2f')][_0xa936('0x33')][_0xa936('0x30')],'name':_0x2665a2['name_value_list'][_0xa936('0x2b')]['value']});}}function getEndUser(_0xc605ec,_0x55b144,_0x37b032,_0x4fd0d1){logger[_0xa936('0xa')]('Searching\x20enduser\x20with\x20phone',_0x37b032);return request({'form':{'method':_0xa936('0x29'),'input_type':'JSON','response_type':_0xa936('0x22'),'rest_data':JSON['stringify']({'session':_0x4fd0d1['id'],'module_name':_0xa936('0x18'),'query':util[_0xa936('0x24')](_0xa936('0x35'),_0x37b032),'order_by':'','offset':'0','select_fields':['id',_0xa936('0x1a'),_0xa936('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa936('0x2c')](function(_0x4468e5){if(_0x4468e5[_0xa936('0x2d')]['length']){var _0xb1637e=_[_0xa936('0x2e')](_0x4468e5[_0xa936('0x2d')],function(_0xad92a1){return _0xad92a1[_0xa936('0x2f')][_0xa936('0x36')][_0xa936('0x30')]===_0x37b032;});if(_0xb1637e){logger['info'](_0xa936('0x37'));return BPromise[_0xa936('0x31')]({'id':_0xb1637e['name_value_list']['id'][_0xa936('0x30')],'name':_0xb1637e['name_value_list'][_0xa936('0x1a')][_0xa936('0x30')],'phone':_0xb1637e['name_value_list'][_0xa936('0x36')][_0xa936('0x30')]});}}else{logger[_0xa936('0xa')](_0xa936('0x38'));return request({'form':{'method':_0xa936('0x21'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x4fd0d1['id'],'module_name':_0xa936('0x18'),'name_value_list':[{'name':_0xa936('0x39'),'value':_0x55b144!==_0xa936('0x3a')?_0x55b144:util[_0xa936('0x24')](_0xa936('0x3b'),_0x37b032)},{'name':_0xa936('0x36'),'value':_0x37b032}]})}})['then'](function(_0x5b3958){logger['info'](_0xa936('0x3c'));return BPromise[_0xa936('0x31')]({'id':_0x5b3958['id'],'name':_0x5b3958[_0xa936('0x2d')][_0xa936('0x39')]['value'],'phone':_0x5b3958[_0xa936('0x2d')]['phone_home'][_0xa936('0x30')]});});}});}function request(_0x4cfdfc){logger['debug'](_0xa936('0x3d'),JSON[_0xa936('0x23')](_0x4cfdfc));return rp(_['merge'](def,_0x4cfdfc));}function getTags(_0x531d14,_0xe8c296){var _0x205668=[];if(_0x531d14&&_0x531d14[_0xa936('0x1c')]>0x0){_0x205668=_[_0xa936('0x3e')](_0x531d14,_0xe8c296);}return _0x205668;}function getCustomFields(_0x151ee2,_0x2a39ab){var _0x1683d0=[];var _0x1ef734={'custom_fields':[]};if(_0x151ee2['length']>0x0){_[_0xa936('0x1d')](_0x151ee2,function(_0x5e769c){if(_0x5e769c['type']===_0xa936('0x3f')&&_0x5e769c[_0xa936('0x40')]&&!_0x5e769c['customField']){_0x1ef734[_0x5e769c['nameField'][_0xa936('0x41')]()]=_0x5e769c['content']['toString']();}else if(_0x5e769c[_0xa936('0x42')]==='string'&&_0x5e769c[_0xa936('0x1f')]&&_0x5e769c[_0xa936('0x43')]){_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x5e769c['content'][_0xa936('0x26')]()});}else if(_0x5e769c[_0xa936('0x42')]===_0xa936('0x45')&&_0x5e769c['variableName']&&_0x5e769c[_0xa936('0x1f')]&&_0x5e769c['customField']){_0x2a39ab[_0x5e769c[_0xa936('0x20')]]&&_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x2a39ab[_0x5e769c[_0xa936('0x20')]][_0xa936('0x26')]()});}else if(_0x5e769c[_0xa936('0x42')]==='customVariable'&&_0x5e769c[_0xa936('0x46')]&&_0x5e769c['Variable'][_0xa936('0x1a')]&&_0x5e769c['idField']&&_0x5e769c[_0xa936('0x43')]){_0x2a39ab[_0x5e769c[_0xa936('0x46')][_0xa936('0x1a')][_0xa936('0x41')]()]&&_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x2a39ab[_0x5e769c[_0xa936('0x46')][_0xa936('0x1a')][_0xa936('0x41')]()]['toString']()});}});}return _0x1ef734;}function getConnection(_0x403f5e){return request({'method':_0xa936('0x9'),'form':{'method':_0xa936('0x47'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'user_auth':{'user_name':_0x403f5e[_0xa936('0x48')],'password':_0x403f5e[_0xa936('0x49')],'encryption':_0xa936('0x4a')},'application':_0xa936('0x4b')})}})[_0xa936('0x2c')](function(_0x18c85d){var _0x99565c=_0x18c85d;if(_0x99565c['id']){def[_0xa936('0x4c')]=_0x99565c['id'];return BPromise[_0xa936('0x31')](_0x99565c);}else{throw new Error(util[_0xa936('0x24')](_0xa936('0x4d'),_0x403f5e['id']));}});}function setRelationship(_0xa38f7a,_0x1b6593,_0x288a4f,_0x1812e5){return request({'form':{'method':_0xa936('0x4e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa936('0x23')]({'session':_0xa38f7a['id'],'module_name':_0xa936('0x4f'),'module_id':_0x288a4f['id'],'link_field_name':_0x1812e5,'related_ids':[_0x1b6593['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa936('0x50')]=function(_0x1def78,_0xf7e7c8,_0x4ef2e0,_0x546888,_0x32a6ca,_0x25cdd7){var _0x11ada7,_0x57644d,_0x5f15e9,_0x5ec74f;_0x25cdd7[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x25cdd7[_0xa936('0x51')]);_0x25cdd7[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x25cdd7[_0xa936('0x53')]);def[_0xa936('0x54')]=util['format'](_0xa936('0x55'),_0x25cdd7[_0xa936('0x51')]);if(_0x32a6ca&&_0x32a6ca[_0xa936('0x56')]){logger['info'](_0xa936('0x57'),_0xa936('0x58'));_0xf7e7c8[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x25cdd7['serverUrl'],_0xf7e7c8[_0xa936('0x5b')],md5(_0xf7e7c8[_0xa936('0x5b')]));}else{_0xf7e7c8[_0xa936('0x59')]='';}return getConnection(_0x25cdd7)[_0xa936('0x2c')](function(_0x4560da){_0x5ec74f=_0x4560da;return getUser(_0x25cdd7,_0x546888['name'],_0x5ec74f);})['then'](function(_0x548487){_0x11ada7=_0x548487;logger['info']('The\x20User\x20ID\x20is:',_0x11ada7['id']);return getEndUser(_0x25cdd7,_0xf7e7c8[_0xa936('0x5c')],_0xf7e7c8[_0xa936('0x5d')],_0x5ec74f);})[_0xa936('0x2c')](function(_0x110aba){_0x57644d=_0x110aba;logger['info'](_0xa936('0x5e'),_0x57644d['id']);return getTicket(_0x25cdd7,_0x11ada7,_0x57644d,_0x4ef2e0,_0xf7e7c8,_0x4ef2e0[_0xa936('0x5f')],_0x5ec74f,'Inbound');})[_0xa936('0x2c')](function(_0xfa5078){_0x5f15e9=_0xfa5078;logger['info']('Ticket\x20created!');logger['info'](_0xa936('0x60'),_0x5f15e9['id']);return setRelationship(_0x5ec74f,_0x11ada7,_0x5f15e9,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x5ec74f,_0x57644d,_0x5f15e9,_0xa936('0x62'));})[_0xa936('0x2c')](function(){return getServerInfo(_0x5ec74f);})[_0xa936('0x2c')](function(_0x3e4487){var _0x148fb2=parseInt(_0x3e4487[_0xa936('0x63')]['charAt'](0x0));var _0x3f8735=util[_0xa936('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x25cdd7['remoteUri'],_0x5f15e9['id']);if(_0x148fb2>0x6){_0x3f8735=util[_0xa936('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x25cdd7['remoteUri'],_0x5f15e9['id']);}logger['info'](_0xa936('0x57'),_0xa936('0x64'));emit(util['format']('user:%s',_0x546888[_0xa936('0x1a')]),_0xa936('0x65'),{'uri':_0x3f8735});})['catch'](function(_0x37fea1){logger['error'](_0xa936('0x57'),JSON[_0xa936('0x23')](_0x37fea1));});};exports[_0xa936('0x66')]=function(_0x570061,_0x14f60b,_0x3d0ce6,_0x43bbe2,_0x12804c,_0x1e2722,_0x2481f0){var _0xca57e9,_0x2e7d3b,_0x5e14b0,_0x5ac9e5;_0x1e2722[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x1e2722[_0xa936('0x51')]);_0x1e2722[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x1e2722[_0xa936('0x53')]);def[_0xa936('0x54')]=util[_0xa936('0x24')](_0xa936('0x55'),_0x1e2722[_0xa936('0x51')]);if(_0x2481f0&&_0x2481f0['recordingFormat']&&_0x2481f0[_0xa936('0x67')]!==_0xa936('0x68')){logger[_0xa936('0xa')](_0xa936('0x69'),_0xa936('0x58'));_0x14f60b[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x1e2722['serverUrl'],_0x14f60b[_0xa936('0x5b')],md5(_0x14f60b['uniqueid']));}return getConnection(_0x1e2722)[_0xa936('0x2c')](function(_0x337c64){_0x5ac9e5=_0x337c64;return getUser(_0x1e2722,_0x43bbe2['name'],_0x5ac9e5);})['then'](function(_0x79e743){_0xca57e9=_0x79e743;logger[_0xa936('0xa')](_0xa936('0x6a'),_0xca57e9['id']);return getEndUser(_0x1e2722,_0x14f60b[_0xa936('0x6b')],_0x14f60b[_0xa936('0x6c')],_0x5ac9e5);})[_0xa936('0x2c')](function(_0x297868){_0x2e7d3b=_0x297868;logger[_0xa936('0xa')](_0xa936('0x5e'),_0x2e7d3b['id']);return getTicket(_0x1e2722,_0xca57e9,_0x2e7d3b,_0x3d0ce6,_0x14f60b,_0x3d0ce6[_0xa936('0x5f')],_0x5ac9e5,_0xa936('0x6d'));})[_0xa936('0x2c')](function(_0x5c9626){_0x5e14b0=_0x5c9626;logger[_0xa936('0xa')]('Ticket\x20created!');logger[_0xa936('0xa')](_0xa936('0x60'),_0x5e14b0['id']);return setRelationship(_0x5ac9e5,_0xca57e9,_0x5e14b0,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x5ac9e5,_0x2e7d3b,_0x5e14b0,'contacts');})[_0xa936('0x2c')](function(){return getServerInfo(_0x5ac9e5);})[_0xa936('0x2c')](function(_0x4d6fd8){var _0x5c583f=parseInt(_0x4d6fd8[_0xa936('0x63')][_0xa936('0x6e')](0x0));var _0x4a076b=util[_0xa936('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1e2722[_0xa936('0x51')],_0x5e14b0['id']);if(_0x5c583f>0x6){_0x4a076b=util[_0xa936('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e2722['remoteUri'],_0x5e14b0['id']);}logger[_0xa936('0xa')]('[OUTBOUND]',_0xa936('0x64'));emit(util[_0xa936('0x24')]('user:%s',_0x43bbe2[_0xa936('0x1a')]),_0xa936('0x65'),{'uri':_0x4a076b});})[_0xa936('0x6f')](function(_0x4d229c){logger[_0xa936('0x70')](_0xa936('0x69'),JSON[_0xa936('0x23')](_0x4d229c));});};exports[_0xa936('0x71')]=function(_0x25f229,_0x138ee5,_0x46d79e,_0x2e0596,_0x11c1b0,_0x1aaa96){var _0x3ba871,_0x1ceb09,_0x509330,_0x592c9b;_0x1aaa96[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x1aaa96[_0xa936('0x51')]);_0x1aaa96[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x1aaa96[_0xa936('0x53')]);def[_0xa936('0x54')]=util[_0xa936('0x24')]('%s/service/v4_1/rest.php',_0x1aaa96[_0xa936('0x51')]);if(_0x11c1b0&&_0x11c1b0[_0xa936('0x56')]){logger[_0xa936('0xa')]('['+_0x138ee5[_0xa936('0x72')][_0xa936('0x73')]()+']',_0xa936('0x58'));_0x138ee5[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x1aaa96[_0xa936('0x53')],_0x138ee5['uniqueid'],md5(_0x138ee5[_0xa936('0x5b')]));}else{_0x138ee5['recordingURL']='';}return getConnection(_0x1aaa96)[_0xa936('0x2c')](function(_0x21aa29){_0x592c9b=_0x21aa29;if(!_[_0xa936('0x28')](_0x2e0596)){return getUser(_0x1aaa96,_0x2e0596['name'],_0x592c9b);}else{return getUser(_0x1aaa96,null,_0x592c9b);}})[_0xa936('0x2c')](function(_0x8a2227){_0x3ba871=_0x8a2227;logger['info']('The\x20User\x20ID\x20is:',_0x3ba871['id']);return getEndUser(_0x1aaa96,_0x138ee5['calleridname'],_0x138ee5[_0xa936('0x5d')],_0x592c9b);})[_0xa936('0x2c')](function(_0x1b6d77){_0x1ceb09=_0x1b6d77;logger[_0xa936('0xa')](_0xa936('0x5e'),_0x1ceb09['id']);return getTicket(_0x1aaa96,_0x3ba871,_0x1ceb09,_0x46d79e,_0x138ee5,_0x46d79e[_0xa936('0x5f')],_0x592c9b,_0xa936('0x74'));})[_0xa936('0x2c')](function(_0x5478c6){_0x509330=_0x5478c6;logger[_0xa936('0xa')](_0xa936('0x75'));logger['info'](_0xa936('0x60'),_0x509330['id']);return setRelationship(_0x592c9b,_0x3ba871,_0x509330,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x592c9b,_0x1ceb09,_0x509330,_0xa936('0x62'));})[_0xa936('0x2c')](function(){return getServerInfo(_0x592c9b);})['catch'](function(_0x10cc51){logger[_0xa936('0x70')]('['+_0x138ee5['lastevent'][_0xa936('0x73')]()+']',JSON['stringify'](_0x10cc51));});}; \ 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 6dbb805..a68fc99 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 _0x8280=['keyValue','keyType','key','%s:\x20%s','variable','format','customVariable','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','type','string','push','variableName','toString','Variable','name','toLowerCase'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x8280,0x112));var _0x0828=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x8280[_0x1460f6];return _0x46ce94;};'use strict';var _=require('lodash');var util=require(_0x0828('0x0'));exports[_0x0828('0x1')]=function(_0x3aedc7,_0xa68b63,_0x3062d5){var _0x121abf=[];if(_0x3aedc7[_0x0828('0x2')]>0x0){var _0x3482df=_[_0x0828('0x3')](_0x3aedc7,['id']);for(var _0x519e7b=0x0;_0x519e7b<_0x3482df[_0x0828('0x2')];_0x519e7b++){var _0x4d2dc8=_0x3482df[_0x519e7b];if(_0x4d2dc8[_0x0828('0x4')]===_0x0828('0x5')){_0x121abf[_0x0828('0x6')](_0x4d2dc8['content']);}else if(_0x4d2dc8[_0x0828('0x4')]==='variable'&&_0x4d2dc8[_0x0828('0x7')]){_0xa68b63[_0x4d2dc8[_0x0828('0x7')]]&&_0x121abf[_0x0828('0x6')](_0xa68b63[_0x4d2dc8[_0x0828('0x7')]][_0x0828('0x8')]());}else if(_0x4d2dc8[_0x0828('0x4')]==='customVariable'&&_0x4d2dc8[_0x0828('0x9')]&&_0x4d2dc8[_0x0828('0x9')][_0x0828('0xa')]){_0xa68b63[_0x4d2dc8[_0x0828('0x9')]['name'][_0x0828('0xb')]()]&&_0x121abf[_0x0828('0x6')](_0xa68b63[_0x4d2dc8['Variable'][_0x0828('0xa')][_0x0828('0xb')]()][_0x0828('0x8')]());}else if(_0x4d2dc8[_0x0828('0x4')]===_0x0828('0xc')){if(_0x4d2dc8[_0x0828('0xd')]===_0x0828('0x5')&&_0x4d2dc8[_0x0828('0xe')]){_0x121abf['push'](util['format'](_0x0828('0xf'),_0x4d2dc8[_0x0828('0xe')],_0x4d2dc8['keyContent']));}else if(_0x4d2dc8[_0x0828('0xd')]===_0x0828('0x10')&&_0x4d2dc8[_0x0828('0x7')]&&_0x4d2dc8[_0x0828('0xe')]){_0xa68b63[_0x4d2dc8[_0x0828('0x7')]]&&_0x121abf['push'](util[_0x0828('0x11')](_0x0828('0xf'),_0x4d2dc8[_0x0828('0xe')],_0xa68b63[_0x4d2dc8[_0x0828('0x7')]]));}else if(_0x4d2dc8[_0x0828('0xd')]===_0x0828('0x12')&&_0x4d2dc8[_0x0828('0x9')]&&_0x4d2dc8[_0x0828('0x9')][_0x0828('0xa')]&&_0x4d2dc8[_0x0828('0xe')]){_0xa68b63[_0x4d2dc8[_0x0828('0x9')][_0x0828('0xa')][_0x0828('0xb')]()]&&_0x121abf[_0x0828('0x6')](util[_0x0828('0x11')]('%s:\x20%s',_0x4d2dc8[_0x0828('0xe')],_0xa68b63[_0x4d2dc8[_0x0828('0x9')][_0x0828('0xa')][_0x0828('0xb')]()]));}}}}return _0x121abf['join'](_0x3062d5);};exports[_0x0828('0x13')]=function(_0x916c25){var _0x26e61e=_0x916c25[_0x0828('0x14')](-0x1);if(_0x26e61e==='/'){_0x916c25=_0x916c25[_0x0828('0x15')](0x0,_0x916c25[_0x0828('0x16')](_0x26e61e));}return _0x916c25;};exports[_0x0828('0x17')]=function(_0x132af2){if(!_[_0x0828('0x18')](_0x132af2)&&_0x132af2!==''){var _0x40f0fc=/^(([^<>()\[\]\\.,;:\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 _0x40f0fc[_0x0828('0x19')](String(_0x132af2)[_0x0828('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x9a59=['isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','name','Variable','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','customVariable','stripTrailingSlash','substring','lastIndexOf','validateEmail'];(function(_0x26e732,_0x4c70f7){var _0x477c09=function(_0x3ed9fd){while(--_0x3ed9fd){_0x26e732['push'](_0x26e732['shift']());}};_0x477c09(++_0x4c70f7);}(_0x9a59,0x9d));var _0x99a5=function(_0x3c6081,_0x41406e){_0x3c6081=_0x3c6081-0x0;var _0x52601d=_0x9a59[_0x3c6081];return _0x52601d;};'use strict';var _=require(_0x99a5('0x0'));var util=require(_0x99a5('0x1'));exports[_0x99a5('0x2')]=function(_0xa6197a,_0xb20c58,_0x4514b8){var _0x4fa9de=[];if(_0xa6197a[_0x99a5('0x3')]>0x0){var _0xe51ea7=_[_0x99a5('0x4')](_0xa6197a,['id']);for(var _0x53367d=0x0;_0x53367d<_0xe51ea7[_0x99a5('0x3')];_0x53367d++){var _0x566312=_0xe51ea7[_0x53367d];if(_0x566312[_0x99a5('0x5')]===_0x99a5('0x6')){_0x4fa9de[_0x99a5('0x7')](_0x566312[_0x99a5('0x8')]);}else if(_0x566312[_0x99a5('0x5')]===_0x99a5('0x9')&&_0x566312['variableName']){_0xb20c58[_0x566312[_0x99a5('0xa')]]&&_0x4fa9de['push'](_0xb20c58[_0x566312[_0x99a5('0xa')]][_0x99a5('0xb')]());}else if(_0x566312['type']==='customVariable'&&_0x566312['Variable']&&_0x566312['Variable'][_0x99a5('0xc')]){_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()]&&_0x4fa9de[_0x99a5('0x7')](_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()][_0x99a5('0xb')]());}else if(_0x566312[_0x99a5('0x5')]===_0x99a5('0xf')){if(_0x566312[_0x99a5('0x10')]===_0x99a5('0x6')&&_0x566312[_0x99a5('0x11')]){_0x4fa9de[_0x99a5('0x7')](util['format'](_0x99a5('0x12'),_0x566312[_0x99a5('0x11')],_0x566312[_0x99a5('0x13')]));}else if(_0x566312[_0x99a5('0x10')]===_0x99a5('0x9')&&_0x566312[_0x99a5('0xa')]&&_0x566312[_0x99a5('0x11')]){_0xb20c58[_0x566312[_0x99a5('0xa')]]&&_0x4fa9de[_0x99a5('0x7')](util['format'](_0x99a5('0x12'),_0x566312['key'],_0xb20c58[_0x566312[_0x99a5('0xa')]]));}else if(_0x566312['keyType']===_0x99a5('0x14')&&_0x566312['Variable']&&_0x566312[_0x99a5('0xd')][_0x99a5('0xc')]&&_0x566312[_0x99a5('0x11')]){_0xb20c58[_0x566312['Variable'][_0x99a5('0xc')][_0x99a5('0xe')]()]&&_0x4fa9de[_0x99a5('0x7')](util['format']('%s:\x20%s',_0x566312[_0x99a5('0x11')],_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()]));}}}}return _0x4fa9de['join'](_0x4514b8);};exports[_0x99a5('0x15')]=function(_0x50147f){var _0x3d0aa2=_0x50147f['slice'](-0x1);if(_0x3d0aa2==='/'){_0x50147f=_0x50147f[_0x99a5('0x16')](0x0,_0x50147f[_0x99a5('0x17')](_0x3d0aa2));}return _0x50147f;};exports[_0x99a5('0x18')]=function(_0x9125fd){if(!_[_0x99a5('0x19')](_0x9125fd)&&_0x9125fd!==''){var _0x274762=/^(([^<>()\[\]\\.,;:\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 _0x274762['test'](String(_0x9125fd)['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 3f349c5..35b4092 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(_0x4070f8,_0x599ee1){var _0x4f1fa6=function(_0x50d888){while(--_0x50d888){_0x4070f8['push'](_0x4070f8['shift']());}};_0x4f1fa6(++_0x599ee1);}(_0xe706,0xa3));var _0x6e70=function(_0x28e9b6,_0x11ba36){_0x28e9b6=_0x28e9b6-0x0;var _0x58008b=_0xe706[_0x28e9b6];return _0x58008b;};'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 _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(_0x39589b,_0x20f8a8){var _0x589229=function(_0x1d676a){while(--_0x1d676a){_0x39589b['push'](_0x39589b['shift']());}};_0x589229(++_0x20f8a8);}(_0xe706,0xa3));var _0x6e70=function(_0x5bf82d,_0x290676){_0x5bf82d=_0x5bf82d-0x0;var _0x35122d=_0xe706[_0x5bf82d];return _0x35122d;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 289d320..07a192f 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 _0x084c=['../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','password','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','Authorization','The\x20User\x20ID\x20is:','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x15eb0a,_0x49394d){var _0x35fe8b=function(_0x2feb82){while(--_0x2feb82){_0x15eb0a['push'](_0x15eb0a['shift']());}};_0x35fe8b(++_0x49394d);}(_0x084c,0x14d));var _0xc084=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x084c[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var rp=require(_0xc084('0x0'));var md5=require(_0xc084('0x1'));var util=require(_0xc084('0x2'));var Redis=require(_0xc084('0x3'));var intUtil=require(_0xc084('0x4'));var config=require(_0xc084('0x5'));var logger=require(_0xc084('0x6'))('zendesk');config['redis']=_[_0xc084('0x7')](config[_0xc084('0x8')],{'host':_0xc084('0x9'),'port':0x18eb});var io=require(_0xc084('0xa'))(new Redis(config[_0xc084('0x8')]));function emit(_0x1a55c6,_0x53a076,_0x111499){io['to'](_0x1a55c6)[_0xc084('0xb')](_0x53a076,_0x111499);}var headers={'Content-Type':_0xc084('0xc'),'Accept':_0xc084('0xc')};function getTicket(_0x1fa7e6,_0x4cb9fc,_0x3dfa0d,_0x669285,_0x33df35){logger[_0xc084('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xc084('0xe')](_0xc084('0xf'),_0x1fa7e6[_0xc084('0x10')]),'method':_0xc084('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x3dfa0d['id'],'submitter_id':_0x4cb9fc?_0x4cb9fc['id']:undefined,'assignee_id':_0x4cb9fc?_0x4cb9fc['id']:undefined,'tags':getTags(_0x669285[_0xc084('0x12')],_0xc084('0x13')),'subject':intUtil[_0xc084('0x14')](_0x669285[_0xc084('0x15')],_0x33df35,'\x20'),'description':intUtil[_0xc084('0x14')](_0x669285['Descriptions'],_0x33df35,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x669285[_0xc084('0x16')],_0x33df35,'\x0a')}},getCustomFields(_0x669285['Fields'],_0x33df35))}})['then'](function(_0x5389de){logger['info'](_0xc084('0x17'));return _0x5389de[_0xc084('0x18')];});}function getUser(_0x551cbd,_0x580003){if(intUtil[_0xc084('0x19')](_0x580003)){logger[_0xc084('0xd')](_0xc084('0x1a'),_0x580003);return request({'uri':util['format']('%s/search.json',_0x551cbd[_0xc084('0x10')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x580003)}})[_0xc084('0x1b')](function(_0x45d841){if(_0x45d841['count']){logger[_0xc084('0xd')](_0xc084('0x1c'));return _[_0xc084('0x1d')](_0x45d841['results'],{'email':_0x580003,'role':_0xc084('0x1e')});}else{logger[_0xc084('0xd')](_0xc084('0x1f'));return request({'uri':util[_0xc084('0xe')](_0xc084('0x20'),_0x551cbd[_0xc084('0x10')])})[_0xc084('0x1b')](function(_0x20765d){logger[_0xc084('0xd')](_0xc084('0x21'));return _0x20765d[_0xc084('0x22')];});}});}else{logger[_0xc084('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x551cbd[_0xc084('0x10')])})[_0xc084('0x1b')](function(_0x36ce9e){logger[_0xc084('0xd')](_0xc084('0x21'));return _0x36ce9e[_0xc084('0x22')];});}}function getEndUser(_0xd0f367,_0x31b478,_0x115d00){logger['info']('Searching\x20enduser\x20with\x20phone',_0x115d00);return request({'uri':util[_0xc084('0xe')](_0xc084('0x23'),_0xd0f367['remoteUri']),'qs':{'query':util['format'](_0xc084('0x24'),_0x115d00)}})[_0xc084('0x1b')](function(_0x2a4b70){var _0x4dc876;if(_0x2a4b70[_0xc084('0x25')][_0xc084('0x26')]){_0x2a4b70[_0xc084('0x25')]=_[_0xc084('0x27')](_0x2a4b70[_0xc084('0x25')],{'suspended':![],'role':_0xc084('0x28')});if(_0x2a4b70[_0xc084('0x25')][_0xc084('0x26')]){_0x4dc876=_[_0xc084('0x29')](_0x2a4b70[_0xc084('0x25')]);}}if(_0x4dc876){logger[_0xc084('0xd')](_0xc084('0x2a'));return _0x4dc876;}else{logger[_0xc084('0xd')](_0xc084('0x2b'));return request({'uri':util['format'](_0xc084('0x2c'),_0xd0f367[_0xc084('0x10')]),'method':_0xc084('0x11'),'body':{'user':{'role':_0xc084('0x28'),'name':util['format'](_0xc084('0x2d'),_0x31b478||_0x115d00),'phone':_0x115d00}}})['then'](function(_0x278430){logger[_0xc084('0xd')](_0xc084('0x2e'));return _0x278430[_0xc084('0x22')];});}});}function getAuth(_0x2d8ff9){var _0x3b439b;if(_0x2d8ff9[_0xc084('0x2f')]==='password'){_0x3b439b=util[_0xc084('0xe')]('%s:%s',_0x2d8ff9[_0xc084('0x30')],_0x2d8ff9[_0xc084('0x31')]);}else if(_0x2d8ff9[_0xc084('0x2f')]===_0xc084('0x32')){_0x3b439b=util[_0xc084('0xe')]('%s/token:%s',_0x2d8ff9[_0xc084('0x30')],_0x2d8ff9['token']);}return util['format'](_0xc084('0x33'),new Buffer(_0x3b439b)[_0xc084('0x34')](_0xc084('0x35')));}function request(_0x4c0627){logger[_0xc084('0x36')](_0xc084('0x37'),JSON[_0xc084('0x38')](_0x4c0627));return rp(_['defaults'](_0x4c0627,{'method':_0xc084('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x34fb58,_0xa4111d){var _0x37765e=[];if(_0x34fb58&&_0x34fb58[_0xc084('0x26')]>0x0){_0x37765e=_[_0xc084('0x3a')](_0x34fb58,_0xa4111d);}return _0x37765e;}function getCustomFields(_0x5b6ec6,_0x27c2c0){var _0x267805=[];var _0x59e95c={'custom_fields':[]};if(_0x5b6ec6[_0xc084('0x26')]>0x0){_[_0xc084('0x3b')](_0x5b6ec6,function(_0x33e3a5){if(_[_0xc084('0x3c')]([_0xc084('0x3d'),_0xc084('0x3e')],_0x33e3a5[_0xc084('0x3f')])&&_0x33e3a5[_0xc084('0x40')]&&!_0x33e3a5[_0xc084('0x41')]){_0x59e95c[_0x33e3a5[_0xc084('0x40')][_0xc084('0x42')]()]=_0x33e3a5[_0xc084('0x43')][_0xc084('0x34')]();}else if(_['includes'](['string',_0xc084('0x3e')],_0x33e3a5[_0xc084('0x3f')])&&_0x33e3a5[_0xc084('0x44')]&&_0x33e3a5[_0xc084('0x41')]){_0x59e95c[_0xc084('0x45')][_0xc084('0x46')]({'id':_0x33e3a5[_0xc084('0x44')],'value':_0x33e3a5[_0xc084('0x43')][_0xc084('0x34')]()});}else if(_0x33e3a5[_0xc084('0x3f')]===_0xc084('0x47')&&_0x33e3a5[_0xc084('0x48')]&&_0x33e3a5[_0xc084('0x44')]&&_0x33e3a5[_0xc084('0x41')]){_0x27c2c0[_0x33e3a5[_0xc084('0x48')]]&&_0x59e95c[_0xc084('0x45')]['push']({'id':_0x33e3a5[_0xc084('0x44')],'value':_0x27c2c0[_0x33e3a5['variableName']][_0xc084('0x34')]()});}else if(_0x33e3a5[_0xc084('0x3f')]==='customVariable'&&_0x33e3a5['Variable']&&_0x33e3a5[_0xc084('0x49')][_0xc084('0x13')]&&_0x33e3a5[_0xc084('0x44')]&&_0x33e3a5[_0xc084('0x41')]){_0x27c2c0[_0x33e3a5['Variable'][_0xc084('0x13')][_0xc084('0x42')]()]&&_0x59e95c[_0xc084('0x45')][_0xc084('0x46')]({'id':_0x33e3a5[_0xc084('0x44')],'value':_0x27c2c0[_0x33e3a5[_0xc084('0x49')][_0xc084('0x13')][_0xc084('0x42')]()][_0xc084('0x34')]()});}});}return _0x59e95c;}exports[_0xc084('0x4a')]=function(_0x1cfc74,_0x19e713,_0x287555,_0x4b271c,_0x16f671,_0x3938a7){var _0x4121fe,_0x3f2f67;_0x3938a7[_0xc084('0x10')]=intUtil['stripTrailingSlash'](_0x3938a7[_0xc084('0x10')]);_0x3938a7[_0xc084('0x4b')]=intUtil[_0xc084('0x4c')](_0x3938a7[_0xc084('0x4b')]);if(_0x16f671&&_0x16f671[_0xc084('0x4d')]){logger[_0xc084('0xd')](_0xc084('0x4e'),_0xc084('0x4f'));_0x19e713[_0xc084('0x50')]=util[_0xc084('0xe')](_0xc084('0x51'),_0x3938a7[_0xc084('0x4b')],_0x19e713[_0xc084('0x52')],md5(_0x19e713[_0xc084('0x52')]));}else{_0x19e713[_0xc084('0x50')]='';}headers['Authorization']=getAuth(_0x3938a7);return getUser(_0x3938a7,_0x4b271c[_0xc084('0x53')])[_0xc084('0x1b')](function(_0x547295){_0x4121fe=_0x547295;logger[_0xc084('0xd')]('The\x20User\x20ID\x20is:',_0x4121fe['id']);return getEndUser(_0x3938a7,_0x19e713[_0xc084('0x54')],_0x19e713[_0xc084('0x55')]);})[_0xc084('0x1b')](function(_0x4a287c){_0x3f2f67=_0x4a287c;logger[_0xc084('0xd')](_0xc084('0x56'),_0x3f2f67['id']);return getTicket(_0x3938a7,_0x4121fe,_0x3f2f67,_0x287555,_0x19e713);})['then'](function(_0x487c22){if(_0x487c22){logger[_0xc084('0xd')](_0xc084('0x57'),_0x487c22['id']);switch(_0x3938a7[_0xc084('0x3f')]){case _0xc084('0x58'):logger[_0xc084('0xd')]('[QUEUE]',_0xc084('0x59'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3938a7[_0xc084('0x10')],_0x4121fe['id'],_0x487c22['id']),'method':_0xc084('0x11')});case _0xc084('0x5a'):logger['info'](_0xc084('0x4e'),_0xc084('0x5b'));emit(util[_0xc084('0xe')](_0xc084('0x5c'),_0x4b271c[_0xc084('0x13')]),_0xc084('0x5d'),{'uri':util[_0xc084('0xe')](_0xc084('0x5e'),_0x3938a7[_0xc084('0x10')][_0xc084('0x5f')]('/api/v2',''),_0x487c22['id'])});break;default:logger[_0xc084('0x60')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc084('0x61')](function(_0x9f4c77){logger[_0xc084('0x60')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x9f4c77,{'showHidden':!![],'depth':null}));});};exports[_0xc084('0x62')]=function(_0x46e5bb,_0x54ab4e,_0x27b91d,_0x159ae4,_0x1a092f,_0x1533be,_0x12c2de){var _0x1f0cf7,_0x32015c;_0x1533be['remoteUri']=intUtil[_0xc084('0x4c')](_0x1533be[_0xc084('0x10')]);_0x1533be[_0xc084('0x4b')]=intUtil[_0xc084('0x4c')](_0x1533be[_0xc084('0x4b')]);if(_0x12c2de&&_0x12c2de[_0xc084('0x63')]&&_0x12c2de[_0xc084('0x63')]!==_0xc084('0x64')){logger[_0xc084('0xd')](_0xc084('0x65'),_0xc084('0x4f'));_0x54ab4e['recordingURL']=util[_0xc084('0xe')](_0xc084('0x51'),_0x1533be['serverUrl'],_0x54ab4e[_0xc084('0x52')],md5(_0x54ab4e[_0xc084('0x52')]));}headers['Authorization']=getAuth(_0x1533be);return getUser(_0x1533be,_0x159ae4[_0xc084('0x53')])[_0xc084('0x1b')](function(_0xeda01d){_0x1f0cf7=_0xeda01d;logger[_0xc084('0xd')]('The\x20User\x20ID\x20is:',_0x1f0cf7['id']);return getEndUser(_0x1533be,_0x54ab4e[_0xc084('0x66')],_0x54ab4e[_0xc084('0x67')]);})[_0xc084('0x1b')](function(_0x1b9573){_0x32015c=_0x1b9573;logger[_0xc084('0xd')](_0xc084('0x56'),_0x32015c['id']);return getTicket(_0x1533be,_0x1f0cf7,_0x32015c,_0x27b91d,_0x54ab4e);})[_0xc084('0x1b')](function(_0x186ba7){if(_0x186ba7){logger[_0xc084('0xd')](_0xc084('0x57'),_0x186ba7['id']);switch(_0x1533be[_0xc084('0x3f')]){case _0xc084('0x58'):logger[_0xc084('0xd')]('[OUTBOUND]',_0xc084('0x59'));return request({'uri':util['format'](_0xc084('0x68'),_0x1533be[_0xc084('0x10')],_0x1f0cf7['id'],_0x186ba7['id']),'method':'POST'});case _0xc084('0x5a'):logger[_0xc084('0xd')](_0xc084('0x65'),_0xc084('0x5b'));emit(util[_0xc084('0xe')]('user:%s',_0x159ae4['name']),_0xc084('0x5d'),{'uri':util[_0xc084('0xe')](_0xc084('0x5e'),_0x1533be[_0xc084('0x10')][_0xc084('0x5f')](_0xc084('0x69'),''),_0x186ba7['id'])});break;default:logger[_0xc084('0x60')](_0xc084('0x65'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc084('0x61')](function(_0x42be36){logger[_0xc084('0x60')](_0xc084('0x6a'),util[_0xc084('0x6b')](_0x42be36,{'showHidden':!![],'depth':null}));});};exports[_0xc084('0x6c')]=function(_0x137111,_0x22ad1c,_0x5b5b50,_0x4c5ae8,_0x5bce54,_0x2daf43){var _0x50b195,_0x5723f0;_0x2daf43[_0xc084('0x10')]=intUtil[_0xc084('0x4c')](_0x2daf43[_0xc084('0x10')]);_0x2daf43['serverUrl']=intUtil[_0xc084('0x4c')](_0x2daf43[_0xc084('0x4b')]);if(_0x5bce54&&_0x5bce54[_0xc084('0x4d')]){logger['info']('['+_0x22ad1c[_0xc084('0x6d')]['toUpperCase']()+']',_0xc084('0x4f'));_0x22ad1c[_0xc084('0x50')]=util[_0xc084('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2daf43[_0xc084('0x4b')],_0x22ad1c[_0xc084('0x52')],md5(_0x22ad1c['uniqueid']));}else{_0x22ad1c[_0xc084('0x50')]='';}headers[_0xc084('0x6e')]=getAuth(_0x2daf43);return getUser(_0x2daf43)[_0xc084('0x1b')](function(_0x124a4d){_0x50b195=_0x124a4d;logger[_0xc084('0xd')](_0xc084('0x6f'),_0x50b195['id']);return getEndUser(_0x2daf43,_0x22ad1c[_0xc084('0x54')],_0x22ad1c[_0xc084('0x55')]);})[_0xc084('0x1b')](function(_0x18babb){_0x5723f0=_0x18babb;logger[_0xc084('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5723f0['id']);return getTicket(_0x2daf43,_0x50b195,_0x5723f0,_0x5b5b50,_0x22ad1c);})['then'](function(_0xa3d908){if(_0xa3d908){logger[_0xc084('0xd')]('The\x20Ticket\x20ID\x20is:',_0xa3d908['id']);}})['catch'](function(_0x40e535){logger['error']('['+_0x22ad1c['lastevent'][_0xc084('0x70')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xc084('0x6b')](_0x40e535,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x64fc=['destcalleridname','destcalleridnum','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','md5','util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','authType','username','password','token','%s/token:%s','toString','base64','[HTTP]','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization'];(function(_0x4ee554,_0x1d50a0){var _0x13a073=function(_0x186a40){while(--_0x186a40){_0x4ee554['push'](_0x4ee554['shift']());}};_0x13a073(++_0x1d50a0);}(_0x64fc,0x75));var _0xc64f=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x64fc[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xc64f('0x0'));var util=require(_0xc64f('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xc64f('0x2'));var logger=require('../../../../config/logger')(_0xc64f('0x3'));config[_0xc64f('0x4')]=_['defaults'](config[_0xc64f('0x4')],{'host':_0xc64f('0x5'),'port':0x18eb});var io=require(_0xc64f('0x6'))(new Redis(config[_0xc64f('0x4')]));function emit(_0x1f1438,_0x1d4321,_0x257e96){io['to'](_0x1f1438)[_0xc64f('0x7')](_0x1d4321,_0x257e96);}var headers={'Content-Type':_0xc64f('0x8'),'Accept':_0xc64f('0x8')};function getTicket(_0x1cf934,_0x1c2f03,_0x5063f8,_0x1eed0a,_0xa4b906){logger[_0xc64f('0x9')](_0xc64f('0xa'));return request({'uri':util['format'](_0xc64f('0xb'),_0x1cf934[_0xc64f('0xc')]),'method':'POST','body':{'ticket':_[_0xc64f('0xd')]({'requester_id':_0x5063f8['id'],'submitter_id':_0x1c2f03?_0x1c2f03['id']:undefined,'assignee_id':_0x1c2f03?_0x1c2f03['id']:undefined,'tags':getTags(_0x1eed0a[_0xc64f('0xe')],_0xc64f('0xf')),'subject':intUtil[_0xc64f('0x10')](_0x1eed0a[_0xc64f('0x11')],_0xa4b906,'\x20'),'description':intUtil['getString'](_0x1eed0a[_0xc64f('0x12')],_0xa4b906,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc64f('0x10')](_0x1eed0a['Descriptions'],_0xa4b906,'\x0a')}},getCustomFields(_0x1eed0a[_0xc64f('0x13')],_0xa4b906))}})[_0xc64f('0x14')](function(_0x55371f){logger[_0xc64f('0x9')](_0xc64f('0x15'));return _0x55371f[_0xc64f('0x16')];});}function getUser(_0x46bf11,_0x2eba90){if(intUtil[_0xc64f('0x17')](_0x2eba90)){logger[_0xc64f('0x9')](_0xc64f('0x18'),_0x2eba90);return request({'uri':util['format'](_0xc64f('0x19'),_0x46bf11[_0xc64f('0xc')]),'qs':{'query':util[_0xc64f('0x1a')](_0xc64f('0x1b'),_0x2eba90)}})[_0xc64f('0x14')](function(_0xa7c996){if(_0xa7c996[_0xc64f('0x1c')]){logger[_0xc64f('0x9')]('Agent\x20found!');return _[_0xc64f('0x1d')](_0xa7c996[_0xc64f('0x1e')],{'email':_0x2eba90,'role':_0xc64f('0x1f')});}else{logger[_0xc64f('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc64f('0x20'),_0x46bf11['remoteUri'])})[_0xc64f('0x14')](function(_0x4ecc2a){logger[_0xc64f('0x9')](_0xc64f('0x21'));return _0x4ecc2a['user'];});}});}else{logger[_0xc64f('0x9')](_0xc64f('0x22'));return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x20'),_0x46bf11['remoteUri'])})[_0xc64f('0x14')](function(_0x1e5d03){logger[_0xc64f('0x9')](_0xc64f('0x21'));return _0x1e5d03[_0xc64f('0x23')];});}}function getEndUser(_0xab9fc5,_0x4357e1,_0x41fe2b){logger[_0xc64f('0x9')](_0xc64f('0x24'),_0x41fe2b);return request({'uri':util[_0xc64f('0x1a')]('%s/search.json',_0xab9fc5[_0xc64f('0xc')]),'qs':{'query':util[_0xc64f('0x1a')]('type:user\x20role:end-user\x20phone:%s',_0x41fe2b)}})[_0xc64f('0x14')](function(_0xb346c0){var _0x55f53e;if(_0xb346c0[_0xc64f('0x1e')][_0xc64f('0x25')]){_0xb346c0[_0xc64f('0x1e')]=_[_0xc64f('0x26')](_0xb346c0[_0xc64f('0x1e')],{'suspended':![],'role':_0xc64f('0x27')});if(_0xb346c0['results']['length']){_0x55f53e=_[_0xc64f('0x28')](_0xb346c0[_0xc64f('0x1e')]);}}if(_0x55f53e){logger[_0xc64f('0x9')](_0xc64f('0x29'));return _0x55f53e;}else{logger['info'](_0xc64f('0x2a'));return request({'uri':util[_0xc64f('0x1a')]('%s/users.json',_0xab9fc5['remoteUri']),'method':_0xc64f('0x2b'),'body':{'user':{'role':_0xc64f('0x27'),'name':util['format'](_0xc64f('0x2c'),_0x4357e1||_0x41fe2b),'phone':_0x41fe2b}}})[_0xc64f('0x14')](function(_0x189181){logger['info']('Enduser\x20created.');return _0x189181[_0xc64f('0x23')];});}});}function getAuth(_0xbd1ff1){var _0x2a6f6e;if(_0xbd1ff1[_0xc64f('0x2d')]==='password'){_0x2a6f6e=util[_0xc64f('0x1a')]('%s:%s',_0xbd1ff1[_0xc64f('0x2e')],_0xbd1ff1[_0xc64f('0x2f')]);}else if(_0xbd1ff1[_0xc64f('0x2d')]===_0xc64f('0x30')){_0x2a6f6e=util[_0xc64f('0x1a')](_0xc64f('0x31'),_0xbd1ff1[_0xc64f('0x2e')],_0xbd1ff1[_0xc64f('0x30')]);}return util[_0xc64f('0x1a')]('Basic\x20%s',new Buffer(_0x2a6f6e)[_0xc64f('0x32')](_0xc64f('0x33')));}function request(_0x1c4f3c){logger['debug'](_0xc64f('0x34'),JSON['stringify'](_0x1c4f3c));return rp(_['defaults'](_0x1c4f3c,{'method':_0xc64f('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3bc9f4,_0x357615){var _0x178d1c=[];if(_0x3bc9f4&&_0x3bc9f4['length']>0x0){_0x178d1c=_[_0xc64f('0x36')](_0x3bc9f4,_0x357615);}return _0x178d1c;}function getCustomFields(_0x14fcf5,_0x3d3244){var _0x3b5afb=[];var _0x4e0e96={'custom_fields':[]};if(_0x14fcf5['length']>0x0){_['forEach'](_0x14fcf5,function(_0x2cc9ef){if(_[_0xc64f('0x37')]([_0xc64f('0x38'),_0xc64f('0x39')],_0x2cc9ef[_0xc64f('0x3a')])&&_0x2cc9ef[_0xc64f('0x3b')]&&!_0x2cc9ef[_0xc64f('0x3c')]){_0x4e0e96[_0x2cc9ef[_0xc64f('0x3b')][_0xc64f('0x3d')]()]=_0x2cc9ef[_0xc64f('0x3e')]['toString']();}else if(_[_0xc64f('0x37')](['string',_0xc64f('0x39')],_0x2cc9ef[_0xc64f('0x3a')])&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef['customField']){_0x4e0e96[_0xc64f('0x40')][_0xc64f('0x41')]({'id':_0x2cc9ef[_0xc64f('0x3f')],'value':_0x2cc9ef[_0xc64f('0x3e')][_0xc64f('0x32')]()});}else if(_0x2cc9ef['type']===_0xc64f('0x42')&&_0x2cc9ef[_0xc64f('0x43')]&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef[_0xc64f('0x3c')]){_0x3d3244[_0x2cc9ef[_0xc64f('0x43')]]&&_0x4e0e96[_0xc64f('0x40')][_0xc64f('0x41')]({'id':_0x2cc9ef[_0xc64f('0x3f')],'value':_0x3d3244[_0x2cc9ef[_0xc64f('0x43')]]['toString']()});}else if(_0x2cc9ef[_0xc64f('0x3a')]===_0xc64f('0x44')&&_0x2cc9ef['Variable']&&_0x2cc9ef[_0xc64f('0x45')][_0xc64f('0xf')]&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef[_0xc64f('0x3c')]){_0x3d3244[_0x2cc9ef[_0xc64f('0x45')]['name'][_0xc64f('0x3d')]()]&&_0x4e0e96[_0xc64f('0x40')]['push']({'id':_0x2cc9ef['idField'],'value':_0x3d3244[_0x2cc9ef[_0xc64f('0x45')]['name'][_0xc64f('0x3d')]()][_0xc64f('0x32')]()});}});}return _0x4e0e96;}exports['queue']=function(_0x513def,_0x2fcecf,_0x222170,_0x507973,_0x21ac1f,_0xd52759){var _0x3fae08,_0x525c0b;_0xd52759[_0xc64f('0xc')]=intUtil['stripTrailingSlash'](_0xd52759[_0xc64f('0xc')]);_0xd52759[_0xc64f('0x46')]=intUtil[_0xc64f('0x47')](_0xd52759[_0xc64f('0x46')]);if(_0x21ac1f&&_0x21ac1f[_0xc64f('0x48')]){logger[_0xc64f('0x9')](_0xc64f('0x49'),'Recording\x20is\x20enabled!');_0x2fcecf[_0xc64f('0x4a')]=util['format'](_0xc64f('0x4b'),_0xd52759['serverUrl'],_0x2fcecf['uniqueid'],md5(_0x2fcecf[_0xc64f('0x4c')]));}else{_0x2fcecf[_0xc64f('0x4a')]='';}headers['Authorization']=getAuth(_0xd52759);return getUser(_0xd52759,_0x507973[_0xc64f('0x4d')])[_0xc64f('0x14')](function(_0x300499){_0x3fae08=_0x300499;logger[_0xc64f('0x9')](_0xc64f('0x4e'),_0x3fae08['id']);return getEndUser(_0xd52759,_0x2fcecf[_0xc64f('0x4f')],_0x2fcecf[_0xc64f('0x50')]);})['then'](function(_0x57fd6c){_0x525c0b=_0x57fd6c;logger['info'](_0xc64f('0x51'),_0x525c0b['id']);return getTicket(_0xd52759,_0x3fae08,_0x525c0b,_0x222170,_0x2fcecf);})['then'](function(_0x195472){if(_0x195472){logger['info'](_0xc64f('0x52'),_0x195472['id']);switch(_0xd52759['type']){case'integrationTab':logger[_0xc64f('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x53'),_0xd52759[_0xc64f('0xc')],_0x3fae08['id'],_0x195472['id']),'method':_0xc64f('0x2b')});case'newTab':logger[_0xc64f('0x9')](_0xc64f('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc64f('0x1a')]('user:%s',_0x507973[_0xc64f('0xf')]),_0xc64f('0x54'),{'uri':util[_0xc64f('0x1a')](_0xc64f('0x55'),_0xd52759[_0xc64f('0xc')][_0xc64f('0x56')](_0xc64f('0x57'),''),_0x195472['id'])});break;default:logger[_0xc64f('0x58')](_0xc64f('0x49'),_0xc64f('0x59'));}}})[_0xc64f('0x5a')](function(_0x3bbad6){logger[_0xc64f('0x58')](_0xc64f('0x5b'),util[_0xc64f('0x5c')](_0x3bbad6,{'showHidden':!![],'depth':null}));});};exports[_0xc64f('0x5d')]=function(_0x4a048a,_0xb303ff,_0xe6a316,_0x4a800f,_0x3e9d33,_0x3df5af,_0x1c0bb8){var _0x23b305,_0x2b0b4f;_0x3df5af['remoteUri']=intUtil[_0xc64f('0x47')](_0x3df5af[_0xc64f('0xc')]);_0x3df5af['serverUrl']=intUtil[_0xc64f('0x47')](_0x3df5af[_0xc64f('0x46')]);if(_0x1c0bb8&&_0x1c0bb8[_0xc64f('0x5e')]&&_0x1c0bb8[_0xc64f('0x5e')]!==_0xc64f('0x5f')){logger[_0xc64f('0x9')](_0xc64f('0x60'),_0xc64f('0x61'));_0xb303ff[_0xc64f('0x4a')]=util[_0xc64f('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3df5af[_0xc64f('0x46')],_0xb303ff[_0xc64f('0x4c')],md5(_0xb303ff[_0xc64f('0x4c')]));}headers[_0xc64f('0x62')]=getAuth(_0x3df5af);return getUser(_0x3df5af,_0x4a800f[_0xc64f('0x4d')])[_0xc64f('0x14')](function(_0x5c281b){_0x23b305=_0x5c281b;logger['info']('The\x20User\x20ID\x20is:',_0x23b305['id']);return getEndUser(_0x3df5af,_0xb303ff[_0xc64f('0x63')],_0xb303ff[_0xc64f('0x64')]);})[_0xc64f('0x14')](function(_0x52e4d4){_0x2b0b4f=_0x52e4d4;logger['info'](_0xc64f('0x51'),_0x2b0b4f['id']);return getTicket(_0x3df5af,_0x23b305,_0x2b0b4f,_0xe6a316,_0xb303ff);})['then'](function(_0x5bc31f){if(_0x5bc31f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x5bc31f['id']);switch(_0x3df5af['type']){case _0xc64f('0x65'):logger[_0xc64f('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x53'),_0x3df5af[_0xc64f('0xc')],_0x23b305['id'],_0x5bc31f['id']),'method':_0xc64f('0x2b')});case _0xc64f('0x66'):logger[_0xc64f('0x9')]('[OUTBOUND]',_0xc64f('0x67'));emit(util[_0xc64f('0x1a')](_0xc64f('0x68'),_0x4a800f['name']),_0xc64f('0x54'),{'uri':util['format'](_0xc64f('0x55'),_0x3df5af['remoteUri'][_0xc64f('0x56')]('/api/v2',''),_0x5bc31f['id'])});break;default:logger[_0xc64f('0x58')](_0xc64f('0x60'),_0xc64f('0x59'));}}})[_0xc64f('0x5a')](function(_0x4da17b){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xc64f('0x5c')](_0x4da17b,{'showHidden':!![],'depth':null}));});};exports[_0xc64f('0x69')]=function(_0x135e98,_0xe08f18,_0x1f57dc,_0x454a91,_0x1e4568,_0x231cba){var _0x5d4079,_0x105855;_0x231cba[_0xc64f('0xc')]=intUtil[_0xc64f('0x47')](_0x231cba[_0xc64f('0xc')]);_0x231cba[_0xc64f('0x46')]=intUtil[_0xc64f('0x47')](_0x231cba[_0xc64f('0x46')]);if(_0x1e4568&&_0x1e4568[_0xc64f('0x48')]){logger[_0xc64f('0x9')]('['+_0xe08f18['lastevent']['toUpperCase']()+']',_0xc64f('0x61'));_0xe08f18[_0xc64f('0x4a')]=util['format'](_0xc64f('0x4b'),_0x231cba[_0xc64f('0x46')],_0xe08f18['uniqueid'],md5(_0xe08f18[_0xc64f('0x4c')]));}else{_0xe08f18['recordingURL']='';}headers[_0xc64f('0x62')]=getAuth(_0x231cba);return getUser(_0x231cba)[_0xc64f('0x14')](function(_0x14aa3){_0x5d4079=_0x14aa3;logger[_0xc64f('0x9')]('The\x20User\x20ID\x20is:',_0x5d4079['id']);return getEndUser(_0x231cba,_0xe08f18['calleridname'],_0xe08f18[_0xc64f('0x50')]);})[_0xc64f('0x14')](function(_0x418797){_0x105855=_0x418797;logger['info'](_0xc64f('0x51'),_0x105855['id']);return getTicket(_0x231cba,_0x5d4079,_0x105855,_0x1f57dc,_0xe08f18);})['then'](function(_0x2c0870){if(_0x2c0870){logger[_0xc64f('0x9')](_0xc64f('0x52'),_0x2c0870['id']);}})[_0xc64f('0x5a')](function(_0x397394){logger[_0xc64f('0x58')]('['+_0xe08f18[_0xc64f('0x6a')][_0xc64f('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xc64f('0x5c')](_0x397394,{'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 9c56e73..b34df48 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 _0x5096=['Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','user','profile','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','moduleCreate','role','first_name','code','SUCCESS','details','startCase','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','last_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','$se_module','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Call_Result','Called','connect','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error'];(function(_0x42c381,_0x276f0d){var _0x2f52ee=function(_0x53a4d2){while(--_0x53a4d2){_0x42c381['push'](_0x42c381['shift']());}};_0x2f52ee(++_0x276f0d);}(_0x5096,0x6c));var _0x6509=function(_0x482d73,_0x58f50c){_0x482d73=_0x482d73-0x0;var _0x5725bd=_0x5096[_0x482d73];return _0x5725bd;};'use strict';var _=require(_0x6509('0x0'));var rp=require(_0x6509('0x1'));var md5=require(_0x6509('0x2'));var util=require(_0x6509('0x3'));var intUtil=require(_0x6509('0x4'));var moment=require('moment');var Redis=require(_0x6509('0x5'));var BPromise=require('bluebird');var config=require(_0x6509('0x6'));var logger=require(_0x6509('0x7'))(_0x6509('0x8'));config[_0x6509('0x9')]=_[_0x6509('0xa')](config[_0x6509('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x6509('0xb'))(new Redis(config[_0x6509('0x9')]));function emit(_0x4b67e8,_0x1d30be,_0xc614f1){io['to'](_0x4b67e8)[_0x6509('0xc')](_0x1d30be,_0xc614f1);}function request(_0x1ba1bd){logger[_0x6509('0xd')]('[HTTP]',JSON[_0x6509('0xe')](_0x1ba1bd));return rp(_0x1ba1bd);}function getCustomFields(_0x3e9667,_0x59620c){var _0x575c7e={};if(_0x3e9667[_0x6509('0xf')]>0x0){_[_0x6509('0x10')](_0x3e9667,function(_0x138db1){if(_[_0x6509('0x11')]([_0x6509('0x12'),_0x6509('0x13')],_0x138db1[_0x6509('0x14')])&&_0x138db1[_0x6509('0x15')]){_0x575c7e[_0x138db1[_0x6509('0x15')]]=_0x138db1[_0x6509('0x16')]['toString']();}else if(_0x138db1[_0x6509('0x14')]===_0x6509('0x17')&&_0x138db1[_0x6509('0x18')]&&_0x138db1['idField']&&_0x59620c[_0x138db1[_0x6509('0x18')]]){_0x575c7e[_0x138db1[_0x6509('0x15')]]=_0x59620c[_0x138db1[_0x6509('0x18')]][_0x6509('0x19')]();}else if(_0x138db1[_0x6509('0x14')]===_0x6509('0x1a')&&_0x138db1['Variable']&&_0x138db1[_0x6509('0x1b')][_0x6509('0x1c')]&&_0x138db1[_0x6509('0x15')]&&_0x59620c[_0x138db1['Variable']['name'][_0x6509('0x1d')]()]){_0x575c7e[_0x138db1[_0x6509('0x15')]]=_0x59620c[_0x138db1[_0x6509('0x1b')]['name'][_0x6509('0x1d')]()][_0x6509('0x19')]();}});}return _0x575c7e;}function getName(_0x506902){if(_0x506902[_0x6509('0x1e')]('\x20')>0x0){var _0x37398f=_0x506902[_0x6509('0x1f')](/ (.+)/);if(_0x37398f[0x1]){return _0x37398f;}}return[_0x506902,_0x506902];}var accountsTokens={};function getAccessToken(_0x5a582d){return new Promise(function(_0x6eb1e9,_0x476801){if(!_[_0x6509('0x20')](accountsTokens[_0x5a582d['id']])&&!_[_0x6509('0x20')](accountsTokens[_0x5a582d['id']][_0x6509('0x21')])){if(moment()[_0x6509('0x22')](accountsTokens[_0x5a582d['id']][_0x6509('0x23')])){_0x6eb1e9(accountsTokens[_0x5a582d['id']][_0x6509('0x21')]);}}var _0x5d373c;switch(_0x5a582d['zone']){case'US':_0x5d373c=_0x6509('0x24');break;case'AU':_0x5d373c=_0x6509('0x25');break;case'EU':_0x5d373c=_0x6509('0x26');break;case'IN':_0x5d373c=_0x6509('0x27');break;case'CN':_0x5d373c='https://accounts.zoho.com.cn';break;default:_0x5d373c=_0x6509('0x26');break;}var _0x32411e={'method':_0x6509('0x28'),'uri':_0x5d373c+_0x6509('0x29'),'qs':{'refresh_token':_0x5a582d[_0x6509('0x2a')],'client_id':_0x5a582d[_0x6509('0x2b')],'client_secret':_0x5a582d[_0x6509('0x2c')],'grant_type':_0x6509('0x2d')},'json':!![]};return rp(_0x32411e)['then'](function(_0x36294d){accountsTokens[_0x5a582d['id']]={'access_token':_0x36294d[_0x6509('0x21')],'expires_in':moment()[_0x6509('0x2e')](_0x36294d[_0x6509('0x23')],_0x6509('0x2f'))};_0x6eb1e9(_0x36294d[_0x6509('0x21')]);})[_0x6509('0x30')](function(_0x3977b3){logger[_0x6509('0x31')]('Failing\x20creating\x20the\x20access_token',_0x3977b3['stack']);_0x476801(_0x3977b3);});});}function getUser(_0x9f73bb,_0x2a7204,_0x492ed0,_0x4dce7d){logger['info'](_0x6509('0x32'));return request({'method':_0x6509('0x33'),'uri':util['format'](_0x6509('0x34'),_0x2a7204),'qs':{'type':_0x6509('0x35')},'headers':{'Authorization':_0x6509('0x36')+_0x9f73bb},'json':!![]})[_0x6509('0x37')](function(_0x287e79){if(_0x287e79[_0x6509('0x38')]){var _0x4256fc=-0x1;if(_[_0x6509('0x39')](_0x287e79['users'])){if(!_[_0x6509('0x20')](_0x4dce7d)){_0x4256fc=_[_0x6509('0x3a')](_0x287e79[_0x6509('0x38')],function(_0x3862da){return _0x3862da[_0x6509('0x3b')]===_0x4dce7d;});}if(_0x4256fc>=0x0){logger[_0x6509('0x3c')]('Agent\x20found!');}else{logger[_0x6509('0x3c')]('Using\x20the\x20admin\x20account!');_0x4256fc=_[_0x6509('0x3a')](_0x287e79[_0x6509('0x38')],function(_0xd30706){return _0xd30706['profile'][_0x6509('0x1c')]==='Administrator';});}return _0x287e79[_0x6509('0x38')][_0x4256fc];}else{if(_0x287e79[_0x6509('0x3d')][_0x6509('0x3e')]['name']===_0x6509('0x3f')){logger[_0x6509('0x3c')](_0x6509('0x40'));user=_0x287e79['user'];return user;}else{logger[_0x6509('0x31')](_0x6509('0x41'),JSON[_0x6509('0xe')](_0x287e79));throw new Error(_0x6509('0x42')+JSON[_0x6509('0xe')](_0x287e79));}}}else{logger[_0x6509('0x31')](_0x6509('0x41'),JSON[_0x6509('0xe')](_0x287e79));throw new Error(_0x6509('0x42')+JSON[_0x6509('0xe')](_0x287e79));}})[_0x6509('0x30')](function(_0x44e9c1){console[_0x6509('0x31')](_0x44e9c1);});}function getZohoUser(_0x5632a1,_0x326a58){return new BPromise(function(_0x30792e,_0x3abf35){request(_0x5632a1)[_0x6509('0x37')](function(_0x2060e7){var _0x4b672a=null;if(_0x2060e7){_0x4b672a=_0x2060e7[_0x6509('0x43')][0x0];_0x4b672a[_0x6509('0x44')]=_0x326a58;}_0x30792e(_0x4b672a);})[_0x6509('0x30')](function(_0x86f339){_0x3abf35(_0x86f339);});});}function createEndUser(_0x1c0f4c,_0x5f4dc,_0xcd56cb,_0x42777b,_0x3fff65,_0x35781b){var _0xcd56cb=getName(_0xcd56cb);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x5f4dc+'/crm/v2/'+_['startCase'](_0x35781b[_0x6509('0x45')])+'s','body':{'data':[{'Last_Name':_0xcd56cb[0x1],'First_Name':_0xcd56cb[0x0],'Phone':_0x42777b,'Owner':{'name':!_[_0x6509('0x20')](_0x3fff65[_0x6509('0x46')][_0x6509('0x1c')])?_0x3fff65[_0x6509('0x46')][_0x6509('0x1c')]:!_[_0x6509('0x20')](_0x3fff65[_0x6509('0x47')])?_0x3fff65['first_name']+'\x20'+_0x3fff65['last_name']:_0x3fff65['last_name'],'id':_0x3fff65['id']}}]},'headers':{'Authorization':_0x6509('0x36')+_0x1c0f4c},'json':!![]})[_0x6509('0x37')](function(_0x5ceff4){if(_0x5ceff4&&_0x5ceff4['data'][0x0][_0x6509('0x48')]===_0x6509('0x49')){var _0xe7ccdf=_0x5ceff4['data'][0x0][_0x6509('0x4a')];_0xe7ccdf[_0x6509('0x44')]=_[_0x6509('0x4b')](_0x35781b['moduleCreate'])+'s';return _0xe7ccdf;}logger[_0x6509('0x31')](_0x6509('0x41'),JSON[_0x6509('0xe')](data));throw new Error('Error:\x20'+JSON[_0x6509('0xe')](data));})[_0x6509('0x30')](function(_0x431859){console[_0x6509('0x4c')]('CREATE\x20ERROR',_0x431859);});}function getEndUser(_0x2df016,_0x150a89,_0x1ebc31,_0x35b876,_0x306a95,_0x170c70,_0x5e4ca8){var _0x157275={'method':_0x6509('0x33'),'uri':'','headers':{'Authorization':_0x6509('0x36')+_0x2df016},'json':!![]};switch(_0x5e4ca8[_0x6509('0x4d')]){case _0x6509('0x4e'):_0x157275[_0x6509('0x4f')]='https://www.zohoapis.'+_0x150a89+_0x6509('0x50')+_0x306a95+'))';return getZohoUser(_0x157275,_0x6509('0x51'))[_0x6509('0x37')](function(_0x49e9ae){if(_0x49e9ae)return _0x49e9ae;_0x157275[_0x6509('0x4f')]=_0x6509('0x52')+_0x150a89+_0x6509('0x53')+_0x306a95+'))';return getZohoUser(_0x157275,_0x6509('0x54'))[_0x6509('0x37')](function(_0x272d6c){if(_0x272d6c)return _0x272d6c;if(_0x5e4ca8[_0x6509('0x45')]!=_0x6509('0x55')){return createEndUser(_0x2df016,_0x150a89,_0x35b876,_0x306a95,_0x170c70,_0x5e4ca8);}else{return{};}});});break;case _0x6509('0x56'):_0x157275[_0x6509('0x4f')]=_0x6509('0x52')+_0x150a89+_0x6509('0x50')+_0x306a95+'))';return getZohoUser(_0x157275,_0x6509('0x51'))['then'](function(_0x18b9aa){if(_0x18b9aa)return _0x18b9aa;if(_0x5e4ca8[_0x6509('0x45')]!=_0x6509('0x55')){return createEndUser(_0x2df016,_0x150a89,_0x35b876,_0x306a95,_0x170c70,_0x5e4ca8);}else{return{};}});break;case _0x6509('0x57'):_0x157275[_0x6509('0x4f')]=_0x6509('0x52')+_0x150a89+_0x6509('0x53')+_0x306a95+'))';return getZohoUser(_0x157275,'Leads')[_0x6509('0x37')](function(_0x1cc12b){if(_0x1cc12b)return _0x1cc12b;if(_0x5e4ca8[_0x6509('0x45')]!='nothing'){return createEndUser(_0x2df016,_0x150a89,_0x35b876,_0x306a95,_0x170c70,_0x5e4ca8);}else{return{};}});break;}}function getCall(_0x578023,_0x127e30,_0x6ed684,_0x44f2c0,_0x24c6ee,_0x37dee4,_0x412a55,_0x1e8bb0){logger[_0x6509('0x3c')](_0x6509('0x58'));var _0x575fe8={};_0x575fe8[_0x6509('0x59')]={'name':!_[_0x6509('0x20')](_0x44f2c0[_0x6509('0x46')]['name'])&&!_[_0x6509('0x20')](_0x44f2c0[_0x6509('0x3e')][_0x6509('0x1c')])&&_0x44f2c0[_0x6509('0x3e')][_0x6509('0x1c')]===_0x6509('0x5a')?_0x44f2c0[_0x6509('0x46')][_0x6509('0x1c')]:!_['isNil'](_0x44f2c0[_0x6509('0x47')])?_0x44f2c0[_0x6509('0x47')]+'\x20'+_0x44f2c0[_0x6509('0x5b')]:_0x44f2c0[_0x6509('0x5b')],'id':_0x44f2c0['id']};_0x575fe8[_0x6509('0x5c')]=intUtil[_0x6509('0x5d')](_0x37dee4[_0x6509('0x5e')],_0x412a55,'\x20');_0x575fe8[_0x6509('0x5f')]=intUtil[_0x6509('0x5d')](_0x37dee4[_0x6509('0x60')],_0x412a55,'\x0a');if(_0x24c6ee[_0x6509('0x44')]==='Contacts'){_0x575fe8[_0x6509('0x61')]={'name':!_['isNil'](_0x24c6ee['Full_Name'])?_0x24c6ee['Full_Name']:!_[_0x6509('0x20')](_0x24c6ee[_0x6509('0x62')])?_0x24c6ee[_0x6509('0x62')]+'\x20'+_0x24c6ee[_0x6509('0x63')]:_0x24c6ee[_0x6509('0x63')],'id':_0x24c6ee['id']};}if(_0x24c6ee['enduserType']===_0x6509('0x54')){_0x575fe8[_0x6509('0x64')]={'name':!_['isNil'](_0x24c6ee['Full_Name'])?_0x24c6ee[_0x6509('0x65')]:!_[_0x6509('0x20')](_0x24c6ee[_0x6509('0x62')])?_0x24c6ee[_0x6509('0x62')]+'\x20'+_0x24c6ee[_0x6509('0x63')]:_0x24c6ee[_0x6509('0x63')],'id':_0x24c6ee['id']};_0x575fe8[_0x6509('0x66')]=_[_0x6509('0x4b')](_0x24c6ee[_0x6509('0x44')]);}if(_0x412a55['talktime']){_0x575fe8[_0x6509('0x67')]=moment[_0x6509('0x68')](parseInt(_0x412a55['talktime'])*0x3e8)[_0x6509('0x69')](_0x6509('0x6a'));}else if(_0x412a55[_0x6509('0x6b')]&&_0x412a55[_0x6509('0x6c')]){_0x575fe8[_0x6509('0x67')]=moment[_0x6509('0x68')](moment(_0x412a55[_0x6509('0x6c')],_0x6509('0x6d'))[_0x6509('0x6e')](moment(_0x412a55['starttime'],_0x6509('0x6d'))))[_0x6509('0x69')]('mm:ss');}switch(_0x412a55[_0x6509('0x6f')]){case'called':_0x575fe8[_0x6509('0x70')]=_0x6509('0x71');break;case'complete':case _0x6509('0x72'):_0x575fe8[_0x6509('0x70')]='Answered';break;case'rejected':_0x575fe8[_0x6509('0x70')]=_0x6509('0x73');break;case'abandoned':_0x575fe8[_0x6509('0x70')]=_0x6509('0x74');break;case _0x6509('0x75'):_0x575fe8[_0x6509('0x70')]=_0x6509('0x76');default:}_0x575fe8[_0x6509('0x77')]=(_0x1e8bb0===_0x6509('0x78')?moment(_0x412a55[_0x6509('0x79')])[_0x6509('0x69')](_0x6509('0x6d')):moment(_0x412a55[_0x6509('0x7a')])[_0x6509('0x69')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x6509('0x69')](_0x6509('0x6d'));_0x575fe8[_0x6509('0x7b')]=_0x1e8bb0||_0x6509('0x7c');_0x575fe8=_[_0x6509('0x7d')](_0x575fe8,getCustomFields(_0x37dee4['Fields'],_0x412a55));return request({'method':_0x6509('0x28'),'uri':_0x6509('0x52')+_0x127e30+_0x6509('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x578023},'body':{'data':[_0x575fe8]},'json':!![]})[_0x6509('0x37')](function(_0x5659ca){if(_0x5659ca&&_0x5659ca['data'][0x0]['code']===_0x6509('0x49')){logger[_0x6509('0x3c')](_0x6509('0x7f'));return{'id':_0x5659ca[_0x6509('0x43')][0x0]['details']['id']};}})['catch'](function(_0x430f76){logger[_0x6509('0x3c')](_0x6509('0x80'),_0x430f76[_0x6509('0x81')]);console[_0x6509('0x4c')]('err',_0x430f76);});}exports[_0x6509('0x82')]=function(_0x3c8e53,_0x2a10e1,_0x278b2c,_0x23effc,_0x1000d5,_0x4991ae){var _0x3e6d2d,_0x1a7bcc,_0xda3f29;_0x4991ae[_0x6509('0x83')]=intUtil[_0x6509('0x84')](_0x4991ae['host']);_0x4991ae[_0x6509('0x85')]=intUtil['stripTrailingSlash'](_0x4991ae[_0x6509('0x85')]);if(_0x1000d5&&_0x1000d5[_0x6509('0x86')]){logger['info'](_0x6509('0x87'),_0x6509('0x88'));_0x2a10e1[_0x6509('0x89')]=_0x4991ae[_0x6509('0x85')]+'/api/voice/recordings/'+_0x2a10e1[_0x6509('0x8a')]+_0x6509('0x8b')+md5(_0x2a10e1[_0x6509('0x8a')]);}else{_0x2a10e1['recordingURL']='';}var _0x3e348a=_0x4991ae[_0x6509('0x83')]===_0x6509('0x8c')?'eu':_0x6509('0x8d');return getAccessToken(_0x4991ae)['then'](function(_0x2c41c7){_0xda3f29=_0x2c41c7;return getUser(_0xda3f29,_0x3e348a,_0x4991ae,_0x23effc[_0x6509('0x3b')]);})['then'](function(_0x34ca08){_0x3e6d2d=_0x34ca08;logger[_0x6509('0x3c')](_0x6509('0x8e'),_0x3e6d2d['id']);return getEndUser(_0xda3f29,_0x3e348a,_0x4991ae,_0x2a10e1[_0x6509('0x8f')],_0x2a10e1[_0x6509('0x90')],_0x3e6d2d,_0x278b2c);})[_0x6509('0x37')](function(_0x3841f4){_0x1a7bcc=_0x3841f4;return getCall(_0xda3f29,_0x3e348a,_0x4991ae,_0x3e6d2d,_0x1a7bcc,_0x278b2c,_0x2a10e1,_0x6509('0x7c'));})['then'](function(_0x4c483a){if(_0x4c483a){logger[_0x6509('0x3c')]('The\x20Call\x20ID\x20is:',_0x4c483a['id']);logger[_0x6509('0x3c')](_0x6509('0x87'),_0x6509('0x91'));emit(util[_0x6509('0x69')]('user:%s',_0x23effc['name']),_0x6509('0x92'),{'uri':_0x6509('0x93')+_0x4991ae['host']+_0x6509('0x94')+_0x4c483a['id']});}})[_0x6509('0x30')](function(_0x5b9d44){logger[_0x6509('0x31')](_0x6509('0x87'),JSON[_0x6509('0xe')](_0x5b9d44));});};exports[_0x6509('0x78')]=function(_0x1819bb,_0x553f0f,_0x4fca10,_0x203f49,_0x2a7f10,_0x2a4fe2,_0x6c0314){var _0x28b1f9,_0x42fc45,_0x2fa808;_0x2a4fe2['host']=intUtil[_0x6509('0x84')](_0x2a4fe2[_0x6509('0x83')]);_0x2a4fe2[_0x6509('0x85')]=intUtil[_0x6509('0x84')](_0x2a4fe2[_0x6509('0x85')]);if(_0x6c0314&&_0x6c0314[_0x6509('0x95')]&&_0x6c0314[_0x6509('0x95')]!==_0x6509('0x96')){logger['info'](_0x6509('0x97'),'Recording\x20is\x20enabled!');_0x553f0f['recordingURL']=_0x2a4fe2[_0x6509('0x85')]+_0x6509('0x98')+_0x553f0f[_0x6509('0x8a')]+_0x6509('0x8b')+md5(_0x553f0f[_0x6509('0x8a')]);}var _0x7f0a1e=_0x2a4fe2[_0x6509('0x83')]===_0x6509('0x8c')?'eu':_0x6509('0x8d');return getAccessToken(_0x2a4fe2)[_0x6509('0x37')](function(_0x2fe253){_0x2fa808=_0x2fe253;return getUser(_0x2fa808,_0x7f0a1e,_0x2a4fe2,_0x203f49[_0x6509('0x3b')]);})[_0x6509('0x37')](function(_0x5bd3d8){_0x28b1f9=_0x5bd3d8;logger['info'](_0x6509('0x8e'),_0x28b1f9['id']);return getEndUser(_0x2fa808,_0x7f0a1e,_0x2a4fe2,_0x553f0f[_0x6509('0x99')],_0x553f0f['destcalleridnum'],_0x28b1f9,_0x4fca10);})[_0x6509('0x37')](function(_0x520e76){_0x42fc45=_0x520e76;return getCall(_0x2fa808,_0x7f0a1e,_0x2a4fe2,_0x28b1f9,_0x42fc45,_0x4fca10,_0x553f0f,_0x6509('0x9a'));})[_0x6509('0x37')](function(_0x58c850){if(_0x58c850){logger[_0x6509('0x3c')](_0x6509('0x9b'),_0x58c850['id']);logger[_0x6509('0x3c')]('[OUTBOUND]',_0x6509('0x91'));emit(util['format']('user:%s',_0x203f49[_0x6509('0x1c')]),_0x6509('0x92'),{'uri':_0x6509('0x93')+_0x2a4fe2[_0x6509('0x83')]+_0x6509('0x94')+_0x58c850['id']});}})[_0x6509('0x30')](function(_0x4adb10){logger['error'](_0x6509('0x97'),JSON['stringify'](_0x4adb10));});};exports[_0x6509('0x9c')]=function(_0x257d3c,_0x39061a,_0x90df83,_0x1c9d72,_0x5ebe0e,_0x8424de){var _0x3f0b4c,_0x280da7,_0x2addd2;_0x8424de['host']=intUtil[_0x6509('0x84')](_0x8424de['host']);_0x8424de['serverUrl']=intUtil[_0x6509('0x84')](_0x8424de[_0x6509('0x85')]);if(_0x5ebe0e&&_0x5ebe0e[_0x6509('0x86')]){logger['info']('['+_0x39061a[_0x6509('0x6f')]['toUpperCase']()+']',_0x6509('0x88'));_0x39061a[_0x6509('0x89')]=_0x8424de[_0x6509('0x85')]+_0x6509('0x98')+_0x39061a[_0x6509('0x8a')]+_0x6509('0x8b')+md5(_0x39061a[_0x6509('0x8a')]);}else{_0x39061a[_0x6509('0x89')]='';}var _0x5940f7=_0x8424de[_0x6509('0x83')]===_0x6509('0x8c')?'eu':_0x6509('0x8d');return getAccessToken(_0x8424de)[_0x6509('0x37')](function(_0x39d6b8){_0x2addd2=_0x39d6b8;return getUser(_0x2addd2,_0x5940f7,_0x8424de);})[_0x6509('0x37')](function(_0x3c8d87){_0x3f0b4c=_0x3c8d87;logger['info']('The\x20User\x20ID\x20is:',_0x3f0b4c['id']);return getEndUser(_0x2addd2,_0x5940f7,_0x8424de,_0x39061a[_0x6509('0x8f')],_0x39061a[_0x6509('0x90')],_0x3f0b4c,_0x90df83);})[_0x6509('0x37')](function(_0x5ceb9b){_0x280da7=_0x5ceb9b;return getCall(_0x2addd2,_0x5940f7,_0x8424de,_0x3f0b4c,_0x280da7,_0x90df83,_0x39061a,_0x6509('0x7c'));})[_0x6509('0x37')](function(_0x2cb5aa){if(_0x2cb5aa){logger[_0x6509('0x3c')](_0x6509('0x9b'),_0x2cb5aa['id']);}})[_0x6509('0x30')](function(_0x1d09fb){logger[_0x6509('0x31')]('['+_0x39061a['lastevent'][_0x6509('0x9d')]()+']',JSON[_0x6509('0xe')](_0x1d09fb));});}; \ No newline at end of file +var _0x84fe=['Who_Id','First_Name','Last_Name','Full_Name','$se_module','utc','talktime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','toUpperCase','lodash','request-promise','md5','util','./util','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','picklist','type','toString','variable','variableName','customVariable','Variable','name','toLowerCase','idField','indexOf','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientSecret','refresh_token','then','add','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description'];(function(_0x2a74a5,_0x25d5e5){var _0x7de9ae=function(_0x46091f){while(--_0x46091f){_0x2a74a5['push'](_0x2a74a5['shift']());}};_0x7de9ae(++_0x25d5e5);}(_0x84fe,0xdb));var _0xe84f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe84f('0x0'));var rp=require(_0xe84f('0x1'));var md5=require(_0xe84f('0x2'));var util=require(_0xe84f('0x3'));var intUtil=require(_0xe84f('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xe84f('0x5'));var config=require(_0xe84f('0x6'));var logger=require(_0xe84f('0x7'))('zoho');config[_0xe84f('0x8')]=_[_0xe84f('0x9')](config[_0xe84f('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe84f('0xa'))(new Redis(config[_0xe84f('0x8')]));function emit(_0x5f399c,_0x4053e4,_0x5b8e90){io['to'](_0x5f399c)['emit'](_0x4053e4,_0x5b8e90);}function request(_0x4c1a36){logger[_0xe84f('0xb')](_0xe84f('0xc'),JSON[_0xe84f('0xd')](_0x4c1a36));return rp(_0x4c1a36);}function getCustomFields(_0x4bb110,_0xc390e6){var _0x2fdc6d={};if(_0x4bb110[_0xe84f('0xe')]>0x0){_[_0xe84f('0xf')](_0x4bb110,function(_0x120a5c){if(_['includes']([_0xe84f('0x10'),_0xe84f('0x11')],_0x120a5c[_0xe84f('0x12')])&&_0x120a5c['idField']){_0x2fdc6d[_0x120a5c['idField']]=_0x120a5c['content'][_0xe84f('0x13')]();}else if(_0x120a5c[_0xe84f('0x12')]===_0xe84f('0x14')&&_0x120a5c[_0xe84f('0x15')]&&_0x120a5c['idField']&&_0xc390e6[_0x120a5c['variableName']]){_0x2fdc6d[_0x120a5c['idField']]=_0xc390e6[_0x120a5c[_0xe84f('0x15')]][_0xe84f('0x13')]();}else if(_0x120a5c[_0xe84f('0x12')]===_0xe84f('0x16')&&_0x120a5c[_0xe84f('0x17')]&&_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')]&&_0x120a5c['idField']&&_0xc390e6[_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')][_0xe84f('0x19')]()]){_0x2fdc6d[_0x120a5c[_0xe84f('0x1a')]]=_0xc390e6[_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')][_0xe84f('0x19')]()]['toString']();}});}return _0x2fdc6d;}function getName(_0x118a9f){if(_0x118a9f[_0xe84f('0x1b')]('\x20')>0x0){var _0x1e11b0=_0x118a9f[_0xe84f('0x1c')](/ (.+)/);if(_0x1e11b0[0x1]){return _0x1e11b0;}}return[_0x118a9f,_0x118a9f];}var accountsTokens={};function getAccessToken(_0x1d9520){return new Promise(function(_0x224a2e,_0x2dca20){if(!_[_0xe84f('0x1d')](accountsTokens[_0x1d9520['id']])&&!_[_0xe84f('0x1d')](accountsTokens[_0x1d9520['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x1d9520['id']][_0xe84f('0x1e')])){_0x224a2e(accountsTokens[_0x1d9520['id']][_0xe84f('0x1f')]);}}var _0x2c304d;switch(_0x1d9520[_0xe84f('0x20')]){case'US':_0x2c304d=_0xe84f('0x21');break;case'AU':_0x2c304d='https://accounts.zoho.com.au';break;case'EU':_0x2c304d=_0xe84f('0x22');break;case'IN':_0x2c304d=_0xe84f('0x23');break;case'CN':_0x2c304d='https://accounts.zoho.com.cn';break;default:_0x2c304d=_0xe84f('0x22');break;}var _0x1a9686={'method':_0xe84f('0x24'),'uri':_0x2c304d+_0xe84f('0x25'),'qs':{'refresh_token':_0x1d9520['refreshToken'],'client_id':_0x1d9520['clientId'],'client_secret':_0x1d9520[_0xe84f('0x26')],'grant_type':_0xe84f('0x27')},'json':!![]};return rp(_0x1a9686)[_0xe84f('0x28')](function(_0x230422){accountsTokens[_0x1d9520['id']]={'access_token':_0x230422[_0xe84f('0x1f')],'expires_in':moment()[_0xe84f('0x29')](_0x230422[_0xe84f('0x1e')],'seconds')};_0x224a2e(_0x230422[_0xe84f('0x1f')]);})[_0xe84f('0x2a')](function(_0x1ac540){logger[_0xe84f('0x2b')]('Failing\x20creating\x20the\x20access_token',_0x1ac540[_0xe84f('0x2c')]);_0x2dca20(_0x1ac540);});});}function getUser(_0x8119ce,_0x34998f,_0x4d0aaf,_0x4742bb){logger[_0xe84f('0x2d')](_0xe84f('0x2e'));return request({'method':_0xe84f('0x2f'),'uri':util[_0xe84f('0x30')](_0xe84f('0x31'),_0x34998f),'qs':{'type':_0xe84f('0x32')},'headers':{'Authorization':_0xe84f('0x33')+_0x8119ce},'json':!![]})[_0xe84f('0x28')](function(_0xc024bb){if(_0xc024bb[_0xe84f('0x34')]){var _0x5b56a6=-0x1;if(_['isArrayLikeObject'](_0xc024bb[_0xe84f('0x34')])){if(!_[_0xe84f('0x1d')](_0x4742bb)){_0x5b56a6=_[_0xe84f('0x35')](_0xc024bb['users'],function(_0x3047b7){return _0x3047b7['email']===_0x4742bb;});}if(_0x5b56a6>=0x0){logger[_0xe84f('0x2d')](_0xe84f('0x36'));}else{logger[_0xe84f('0x2d')](_0xe84f('0x37'));_0x5b56a6=_['findIndex'](_0xc024bb['users'],function(_0xdc92d){return _0xdc92d[_0xe84f('0x38')]['name']===_0xe84f('0x39');});}return _0xc024bb[_0xe84f('0x34')][_0x5b56a6];}else{if(_0xc024bb[_0xe84f('0x3a')]['profile'][_0xe84f('0x18')]===_0xe84f('0x39')){logger[_0xe84f('0x2d')](_0xe84f('0x37'));user=_0xc024bb[_0xe84f('0x3a')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xe84f('0xd')](_0xc024bb));throw new Error(_0xe84f('0x3b')+JSON['stringify'](_0xc024bb));}}}else{logger['error'](_0xe84f('0x3c'),JSON[_0xe84f('0xd')](_0xc024bb));throw new Error(_0xe84f('0x3b')+JSON[_0xe84f('0xd')](_0xc024bb));}})[_0xe84f('0x2a')](function(_0x208120){console[_0xe84f('0x2b')](_0x208120);});}function getZohoUser(_0x582764,_0x96f966){return new BPromise(function(_0x5c6c21,_0x1a755d){request(_0x582764)[_0xe84f('0x28')](function(_0x5b7fe0){var _0x3ed3e3=null;if(_0x5b7fe0){_0x3ed3e3=_0x5b7fe0['data'][0x0];_0x3ed3e3[_0xe84f('0x3d')]=_0x96f966;}_0x5c6c21(_0x3ed3e3);})[_0xe84f('0x2a')](function(_0x392b0c){_0x1a755d(_0x392b0c);});});}function createEndUser(_0x336f2b,_0x30a444,_0x2c5438,_0x1b59ec,_0x17c0f6,_0x147582){var _0x2c5438=getName(_0x2c5438);return request({'method':_0xe84f('0x24'),'uri':_0xe84f('0x3e')+_0x30a444+_0xe84f('0x3f')+_[_0xe84f('0x40')](_0x147582[_0xe84f('0x41')])+'s','body':{'data':[{'Last_Name':_0x2c5438[0x1],'First_Name':_0x2c5438[0x0],'Phone':_0x1b59ec,'Owner':{'name':!_[_0xe84f('0x1d')](_0x17c0f6[_0xe84f('0x42')]['name'])?_0x17c0f6[_0xe84f('0x42')][_0xe84f('0x18')]:!_['isNil'](_0x17c0f6[_0xe84f('0x43')])?_0x17c0f6[_0xe84f('0x43')]+'\x20'+_0x17c0f6[_0xe84f('0x44')]:_0x17c0f6['last_name'],'id':_0x17c0f6['id']}}]},'headers':{'Authorization':_0xe84f('0x33')+_0x336f2b},'json':!![]})[_0xe84f('0x28')](function(_0x19c03c){if(_0x19c03c&&_0x19c03c[_0xe84f('0x45')][0x0][_0xe84f('0x46')]===_0xe84f('0x47')){var _0x528346=_0x19c03c[_0xe84f('0x45')][0x0][_0xe84f('0x48')];_0x528346[_0xe84f('0x3d')]=_[_0xe84f('0x40')](_0x147582[_0xe84f('0x41')])+'s';return _0x528346;}logger['error'](_0xe84f('0x3c'),JSON[_0xe84f('0xd')](data));throw new Error(_0xe84f('0x49')+JSON['stringify'](data));})[_0xe84f('0x2a')](function(_0x4117e6){console['log'](_0xe84f('0x4a'),_0x4117e6);});}function getEndUser(_0x32e46c,_0x3d17c2,_0x21d0f3,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8){var _0x505cb6={'method':_0xe84f('0x2f'),'uri':'','headers':{'Authorization':_0xe84f('0x33')+_0x32e46c},'json':!![]};switch(_0x3820f8[_0xe84f('0x4b')]){case _0xe84f('0x4c'):_0x505cb6['uri']=_0xe84f('0x3e')+_0x3d17c2+_0xe84f('0x4d')+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x4e'))['then'](function(_0x1dcf50){if(_0x1dcf50)return _0x1dcf50;_0x505cb6[_0xe84f('0x4f')]=_0xe84f('0x3e')+_0x3d17c2+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x50'))['then'](function(_0x3b6369){if(_0x3b6369)return _0x3b6369;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});});break;case _0xe84f('0x52'):_0x505cb6[_0xe84f('0x4f')]='https://www.zohoapis.'+_0x3d17c2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4cc5+'))';return getZohoUser(_0x505cb6,'Contacts')[_0xe84f('0x28')](function(_0x31cf0c){if(_0x31cf0c)return _0x31cf0c;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});break;case _0xe84f('0x53'):_0x505cb6['uri']='https://www.zohoapis.'+_0x3d17c2+_0xe84f('0x54')+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x50'))[_0xe84f('0x28')](function(_0x48a28f){if(_0x48a28f)return _0x48a28f;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});break;}}function getCall(_0x4c8917,_0x23f332,_0x493509,_0x5b1eb9,_0x34d53e,_0x330aa4,_0x5a829e,_0x2297a5){logger[_0xe84f('0x2d')](_0xe84f('0x55'));var _0x3a421e={};_0x3a421e[_0xe84f('0x56')]={'name':!_[_0xe84f('0x1d')](_0x5b1eb9['role'][_0xe84f('0x18')])&&!_[_0xe84f('0x1d')](_0x5b1eb9[_0xe84f('0x38')][_0xe84f('0x18')])&&_0x5b1eb9[_0xe84f('0x38')]['name']===_0xe84f('0x57')?_0x5b1eb9[_0xe84f('0x42')]['name']:!_[_0xe84f('0x1d')](_0x5b1eb9[_0xe84f('0x43')])?_0x5b1eb9[_0xe84f('0x43')]+'\x20'+_0x5b1eb9['last_name']:_0x5b1eb9[_0xe84f('0x44')],'id':_0x5b1eb9['id']};_0x3a421e[_0xe84f('0x58')]=intUtil[_0xe84f('0x59')](_0x330aa4['Subjects'],_0x5a829e,'\x20');_0x3a421e[_0xe84f('0x5a')]=intUtil[_0xe84f('0x59')](_0x330aa4['Descriptions'],_0x5a829e,'\x0a');if(_0x34d53e['enduserType']===_0xe84f('0x4e')){_0x3a421e[_0xe84f('0x5b')]={'name':!_[_0xe84f('0x1d')](_0x34d53e['Full_Name'])?_0x34d53e['Full_Name']:!_['isNil'](_0x34d53e[_0xe84f('0x5c')])?_0x34d53e[_0xe84f('0x5c')]+'\x20'+_0x34d53e['Last_Name']:_0x34d53e[_0xe84f('0x5d')],'id':_0x34d53e['id']};}if(_0x34d53e[_0xe84f('0x3d')]===_0xe84f('0x50')){_0x3a421e['What_Id']={'name':!_['isNil'](_0x34d53e[_0xe84f('0x5e')])?_0x34d53e[_0xe84f('0x5e')]:!_[_0xe84f('0x1d')](_0x34d53e[_0xe84f('0x5c')])?_0x34d53e[_0xe84f('0x5c')]+'\x20'+_0x34d53e['Last_Name']:_0x34d53e[_0xe84f('0x5d')],'id':_0x34d53e['id']};_0x3a421e[_0xe84f('0x5f')]=_[_0xe84f('0x40')](_0x34d53e[_0xe84f('0x3d')]);}if(_0x5a829e['talktime']){_0x3a421e['Call_Duration']=moment[_0xe84f('0x60')](parseInt(_0x5a829e[_0xe84f('0x61')])*0x3e8)['format']('mm:ss');}else if(_0x5a829e['answertime']&&_0x5a829e[_0xe84f('0x62')]){_0x3a421e['Call_Duration']=moment[_0xe84f('0x60')](moment(_0x5a829e[_0xe84f('0x62')],_0xe84f('0x63'))[_0xe84f('0x64')](moment(_0x5a829e[_0xe84f('0x65')],_0xe84f('0x63'))))[_0xe84f('0x30')](_0xe84f('0x66'));}switch(_0x5a829e[_0xe84f('0x67')]){case _0xe84f('0x68'):_0x3a421e[_0xe84f('0x69')]=_0xe84f('0x6a');break;case _0xe84f('0x6b'):case _0xe84f('0x6c'):_0x3a421e['Call_Result']=_0xe84f('0x6d');break;case _0xe84f('0x6e'):_0x3a421e['Call_Result']='Rejected';break;case'abandoned':_0x3a421e['Call_Result']=_0xe84f('0x6f');break;case _0xe84f('0x70'):_0x3a421e[_0xe84f('0x69')]=_0xe84f('0x71');default:}_0x3a421e[_0xe84f('0x72')]=(_0x2297a5==='outbound'?moment(_0x5a829e[_0xe84f('0x65')])[_0xe84f('0x30')](_0xe84f('0x63')):moment(_0x5a829e[_0xe84f('0x73')])[_0xe84f('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xe84f('0x30')](_0xe84f('0x63'));_0x3a421e[_0xe84f('0x74')]=_0x2297a5||_0xe84f('0x75');_0x3a421e=_[_0xe84f('0x76')](_0x3a421e,getCustomFields(_0x330aa4[_0xe84f('0x77')],_0x5a829e));return request({'method':_0xe84f('0x24'),'uri':_0xe84f('0x3e')+_0x23f332+_0xe84f('0x78'),'headers':{'Authorization':_0xe84f('0x33')+_0x4c8917},'body':{'data':[_0x3a421e]},'json':!![]})[_0xe84f('0x28')](function(_0x8fabea){if(_0x8fabea&&_0x8fabea[_0xe84f('0x45')][0x0]['code']==='SUCCESS'){logger['info'](_0xe84f('0x79'));return{'id':_0x8fabea[_0xe84f('0x45')][0x0][_0xe84f('0x48')]['id']};}})['catch'](function(_0x2211ba){logger[_0xe84f('0x2d')](_0xe84f('0x7a'),_0x2211ba[_0xe84f('0x2c')]);console[_0xe84f('0x7b')](_0xe84f('0x7a'),_0x2211ba);});}exports[_0xe84f('0x7c')]=function(_0x2b5d1e,_0x41f0a7,_0x5e6d4a,_0x48d513,_0x715e9f,_0x2506ef){var _0x48579e,_0xe1f9a9,_0x5d8a5b;_0x2506ef[_0xe84f('0x7d')]=intUtil[_0xe84f('0x7e')](_0x2506ef[_0xe84f('0x7d')]);_0x2506ef[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x2506ef[_0xe84f('0x7f')]);if(_0x715e9f&&_0x715e9f[_0xe84f('0x80')]){logger['info'](_0xe84f('0x81'),_0xe84f('0x82'));_0x41f0a7[_0xe84f('0x83')]=_0x2506ef[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x41f0a7[_0xe84f('0x85')]+_0xe84f('0x86')+md5(_0x41f0a7['uniqueid']);}else{_0x41f0a7[_0xe84f('0x83')]='';}var _0x4eb27d=_0x2506ef[_0xe84f('0x7d')]===_0xe84f('0x87')?'eu':_0xe84f('0x88');return getAccessToken(_0x2506ef)[_0xe84f('0x28')](function(_0x268d06){_0x5d8a5b=_0x268d06;return getUser(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x48d513[_0xe84f('0x89')]);})[_0xe84f('0x28')](function(_0x2cd3ba){_0x48579e=_0x2cd3ba;logger['info'](_0xe84f('0x8a'),_0x48579e['id']);return getEndUser(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x41f0a7[_0xe84f('0x8b')],_0x41f0a7[_0xe84f('0x8c')],_0x48579e,_0x5e6d4a);})[_0xe84f('0x28')](function(_0x634b95){_0xe1f9a9=_0x634b95;return getCall(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x48579e,_0xe1f9a9,_0x5e6d4a,_0x41f0a7,_0xe84f('0x75'));})[_0xe84f('0x28')](function(_0x36021d){if(_0x36021d){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x36021d['id']);logger[_0xe84f('0x2d')](_0xe84f('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xe84f('0x8e'),_0x48d513['name']),_0xe84f('0x8f'),{'uri':'https://crm.'+_0x2506ef['host']+_0xe84f('0x90')+_0x36021d['id']});}})[_0xe84f('0x2a')](function(_0x49e46a){logger['error'](_0xe84f('0x81'),JSON['stringify'](_0x49e46a));});};exports[_0xe84f('0x91')]=function(_0x3a52c1,_0x1ba59a,_0x135dc2,_0x3782f8,_0x5efa69,_0x44b763,_0x134cd1){var _0x26ba46,_0x124105,_0x3c272c;_0x44b763[_0xe84f('0x7d')]=intUtil['stripTrailingSlash'](_0x44b763[_0xe84f('0x7d')]);_0x44b763[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x44b763[_0xe84f('0x7f')]);if(_0x134cd1&&_0x134cd1[_0xe84f('0x92')]&&_0x134cd1[_0xe84f('0x92')]!==_0xe84f('0x93')){logger['info'](_0xe84f('0x94'),'Recording\x20is\x20enabled!');_0x1ba59a['recordingURL']=_0x44b763[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x1ba59a[_0xe84f('0x85')]+_0xe84f('0x86')+md5(_0x1ba59a['uniqueid']);}var _0x1000a2=_0x44b763[_0xe84f('0x7d')]===_0xe84f('0x87')?'eu':_0xe84f('0x88');return getAccessToken(_0x44b763)[_0xe84f('0x28')](function(_0x4c6915){_0x3c272c=_0x4c6915;return getUser(_0x3c272c,_0x1000a2,_0x44b763,_0x3782f8['email']);})['then'](function(_0x3a7845){_0x26ba46=_0x3a7845;logger[_0xe84f('0x2d')]('The\x20User\x20ID\x20is:',_0x26ba46['id']);return getEndUser(_0x3c272c,_0x1000a2,_0x44b763,_0x1ba59a[_0xe84f('0x95')],_0x1ba59a[_0xe84f('0x96')],_0x26ba46,_0x135dc2);})[_0xe84f('0x28')](function(_0x1df1ea){_0x124105=_0x1df1ea;return getCall(_0x3c272c,_0x1000a2,_0x44b763,_0x26ba46,_0x124105,_0x135dc2,_0x1ba59a,_0xe84f('0x97'));})[_0xe84f('0x28')](function(_0x5842f5){if(_0x5842f5){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x5842f5['id']);logger['info'](_0xe84f('0x94'),_0xe84f('0x98'));emit(util[_0xe84f('0x30')]('user:%s',_0x3782f8[_0xe84f('0x18')]),_0xe84f('0x8f'),{'uri':_0xe84f('0x99')+_0x44b763[_0xe84f('0x7d')]+_0xe84f('0x90')+_0x5842f5['id']});}})[_0xe84f('0x2a')](function(_0x2e3b32){logger[_0xe84f('0x2b')]('[OUTBOUND]',JSON['stringify'](_0x2e3b32));});};exports['unmanaged']=function(_0x35ec8c,_0x59022b,_0x23045c,_0x11d63d,_0x2de7a5,_0x28ec7d){var _0x6052d0,_0x5edc0e,_0x2787ae;_0x28ec7d['host']=intUtil[_0xe84f('0x7e')](_0x28ec7d[_0xe84f('0x7d')]);_0x28ec7d[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x28ec7d[_0xe84f('0x7f')]);if(_0x2de7a5&&_0x2de7a5['monitor_format']){logger[_0xe84f('0x2d')]('['+_0x59022b[_0xe84f('0x67')][_0xe84f('0x9a')]()+']',_0xe84f('0x82'));_0x59022b[_0xe84f('0x83')]=_0x28ec7d[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x59022b['uniqueid']+_0xe84f('0x86')+md5(_0x59022b[_0xe84f('0x85')]);}else{_0x59022b[_0xe84f('0x83')]='';}var _0x730167=_0x28ec7d[_0xe84f('0x7d')]==='zoho.eu'?'eu':_0xe84f('0x88');return getAccessToken(_0x28ec7d)['then'](function(_0x4efc46){_0x2787ae=_0x4efc46;return getUser(_0x2787ae,_0x730167,_0x28ec7d);})[_0xe84f('0x28')](function(_0x2a3beb){_0x6052d0=_0x2a3beb;logger[_0xe84f('0x2d')]('The\x20User\x20ID\x20is:',_0x6052d0['id']);return getEndUser(_0x2787ae,_0x730167,_0x28ec7d,_0x59022b[_0xe84f('0x8b')],_0x59022b['calleridnum'],_0x6052d0,_0x23045c);})[_0xe84f('0x28')](function(_0x19a8a2){_0x5edc0e=_0x19a8a2;return getCall(_0x2787ae,_0x730167,_0x28ec7d,_0x6052d0,_0x5edc0e,_0x23045c,_0x59022b,_0xe84f('0x75'));})[_0xe84f('0x28')](function(_0x473739){if(_0x473739){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x473739['id']);}})[_0xe84f('0x2a')](function(_0x1db8a5){logger[_0xe84f('0x2b')]('['+_0x59022b['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x1db8a5));});}; \ 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 66dfda9..78c1b49 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 _0xafe1=['mustache','trigger','exec','data2','Script','data3','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x11e4ef,_0x4b125d){var _0xbbf3b3=function(_0x113768){while(--_0x113768){_0x11e4ef['push'](_0x11e4ef['shift']());}};_0xbbf3b3(++_0x4b125d);}(_0xafe1,0xc5));var _0x1afe=function(_0x486867,_0x52a530){_0x486867=_0x486867-0x0;var _0x3d3c99=_0xafe1[_0x486867];return _0x3d3c99;};'use strict';var util=require(_0x1afe('0x0'));var sh=require('shelljs');var Mustache=require(_0x1afe('0x1'));var logger=require('../../../../config/logger')(_0x1afe('0x2'));exports[_0x1afe('0x3')]=function(_0x5edba2,_0x6ef8ea){var _0x1b6d06=_0x5edba2[_0x1afe('0x4')]?_0x5edba2['data2']:_0x1afe('0x5');var _0x27496d=_0x5edba2[_0x1afe('0x6')]?Mustache['render'](_0x5edba2[_0x1afe('0x6')],_0x6ef8ea):_0x6ef8ea;sh[_0x1afe('0x3')](_0x27496d,function(_0xb18522,_0x39952a,_0x3161d8){if(_0xb18522!==0x0){logger[_0x1afe('0x7')](util[_0x1afe('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1b6d06,_0x27496d,_0xb18522,_0x3161d8));}else{logger[_0x1afe('0x9')](util['format'](_0x1afe('0xa'),_0x1b6d06,_0x27496d,_0x39952a));}});}; \ No newline at end of file +var _0x192b=['shelljs','mustache','trigger','exec','data2','Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x31ca0a,_0x2c3573){var _0x2de3db=function(_0xe707e4){while(--_0xe707e4){_0x31ca0a['push'](_0x31ca0a['shift']());}};_0x2de3db(++_0x2c3573);}(_0x192b,0x1a4));var _0xb192=function(_0x1ef901,_0x3e39e3){_0x1ef901=_0x1ef901-0x0;var _0x333d2b=_0x192b[_0x1ef901];return _0x333d2b;};'use strict';var util=require('util');var sh=require(_0xb192('0x0'));var Mustache=require(_0xb192('0x1'));var logger=require('../../../../config/logger')(_0xb192('0x2'));exports[_0xb192('0x3')]=function(_0x368f18,_0x167f3d){var _0x47b90e=_0x368f18[_0xb192('0x4')]?_0x368f18[_0xb192('0x4')]:_0xb192('0x5');var _0x2342ef=_0x368f18[_0xb192('0x6')]?Mustache['render'](_0x368f18[_0xb192('0x6')],_0x167f3d):_0x167f3d;sh['exec'](_0x2342ef,function(_0x29a5e9,_0x14ed34,_0x55fc74){if(_0x29a5e9!==0x0){logger[_0xb192('0x7')](util['format'](_0xb192('0x8'),_0x47b90e,_0x2342ef,_0x29a5e9,_0x55fc74));}else{logger[_0xb192('0x9')](util[_0xb192('0xa')](_0xb192('0xb'),_0x47b90e,_0x2342ef,_0x14ed34));}});}; \ 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 1392e98..471ae4e 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 _0x5c6d=['parse','error','stack','toUpperCase','GET','POST','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode','name','request-promise','util','lodash','trigger','exec','data1','render','data2','data5','number','headers'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x5c6d,0xfa));var _0xd5c6=function(_0x14f147,_0xcaee29){_0x14f147=_0x14f147-0x0;var _0x6b5368=_0x5c6d[_0x14f147];return _0x6b5368;};'use strict';var rp=require(_0xd5c6('0x0'));var util=require(_0xd5c6('0x1'));var _=require(_0xd5c6('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xd5c6('0x3'));exports[_0xd5c6('0x4')]=function(_0x2d6648,_0x4b53b1){var _0xfd40a9,_0x497f48;var _0x10d1b3={'method':_0x2d6648[_0xd5c6('0x5')]['toUpperCase'](),'uri':Mustache[_0xd5c6('0x6')](_0x2d6648[_0xd5c6('0x7')],_0x4b53b1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2d6648[_0xd5c6('0x8')])===_0xd5c6('0x9')&&parseInt(_0x2d6648['data5'])>=0x1&&parseInt(_0x2d6648[_0xd5c6('0x8')])<=0xa?parseInt(_0x2d6648['data5'])*0x3e8:0x5*0x3e8};try{_0x10d1b3[_0xd5c6('0xa')]=_0x2d6648['data6']?JSON[_0xd5c6('0xb')](Mustache['render'](_0x2d6648['data6'],_0x4b53b1)):{};}catch(_0x301f66){logger[_0xd5c6('0xc')](_0x301f66[_0xd5c6('0xd')]);}switch(_0x2d6648[_0xd5c6('0x5')][_0xd5c6('0xe')]()){case _0xd5c6('0xf'):case'DELETE':_0xfd40a9=null;_0x10d1b3['qs']=_0x4b53b1;break;case _0xd5c6('0x10'):case'PUT':if(_0x2d6648['data7']){try{_0xfd40a9=JSON['parse'](Mustache[_0xd5c6('0x6')](_0x2d6648['data7'],_0x4b53b1));_0x10d1b3[_0xd5c6('0x11')]=_0xfd40a9;}catch(_0x310233){logger[_0xd5c6('0xc')](_0x310233['stack']);logger[_0xd5c6('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0xfd40a9=_0x4b53b1;_0x10d1b3[_0xd5c6('0x11')]=_0xfd40a9;}break;}logger[_0xd5c6('0x12')](util[_0xd5c6('0x13')](_0xd5c6('0x14'),_0x2d6648[_0xd5c6('0x5')],_0x2d6648[_0xd5c6('0x7')],JSON[_0xd5c6('0x15')](_0x10d1b3)));rp(_0x10d1b3)[_0xd5c6('0x16')](function(_0x13f157){_0xfd40a9=!_[_0xd5c6('0x17')](_0xfd40a9)?',\x20request\x20body:\x20'+_0xfd40a9:'';_0x497f48=typeof _0x13f157['body']===_0xd5c6('0x18')?JSON[_0xd5c6('0x15')](_0x13f157[_0xd5c6('0x11')]):_0x13f157[_0xd5c6('0x11')];logger[_0xd5c6('0x12')](util[_0xd5c6('0x13')](_0xd5c6('0x19'),_0x2d6648[_0xd5c6('0x5')],_0x2d6648[_0xd5c6('0x7')],_0x13f157['statusCode'],_0x497f48));})[_0xd5c6('0x1a')](function(_0x3a3977){logger[_0xd5c6('0xc')](util[_0xd5c6('0x13')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2d6648[_0xd5c6('0x5')],_0x2d6648[_0xd5c6('0x7')],_0x3a3977[_0xd5c6('0x1b')],_0x3a3977[_0xd5c6('0x1c')],_0x3a3977['message']));});}; \ No newline at end of file +var _0xdc1b=['POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','number','data5','headers','data6','parse','error','stack'];(function(_0x389cda,_0x31155c){var _0x5889bc=function(_0x32f473){while(--_0x32f473){_0x389cda['push'](_0x389cda['shift']());}};_0x5889bc(++_0x31155c);}(_0xdc1b,0x1bd));var _0xbdc1=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xdc1b[_0x2fee96];return _0x2e6ad1;};'use strict';var rp=require(_0xbdc1('0x0'));var util=require(_0xbdc1('0x1'));var _=require(_0xbdc1('0x2'));var Mustache=require(_0xbdc1('0x3'));var logger=require(_0xbdc1('0x4'))(_0xbdc1('0x5'));exports[_0xbdc1('0x6')]=function(_0x250c10,_0x41757d){var _0x339fb0,_0x5ab847;var _0xad188f={'method':_0x250c10[_0xbdc1('0x7')]['toUpperCase'](),'uri':Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0x9')],_0x41757d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x250c10['data5'])===_0xbdc1('0xa')&&parseInt(_0x250c10[_0xbdc1('0xb')])>=0x1&&parseInt(_0x250c10['data5'])<=0xa?parseInt(_0x250c10['data5'])*0x3e8:0x5*0x3e8};try{_0xad188f[_0xbdc1('0xc')]=_0x250c10[_0xbdc1('0xd')]?JSON[_0xbdc1('0xe')](Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0xd')],_0x41757d)):{};}catch(_0x5bc1e4){logger[_0xbdc1('0xf')](_0x5bc1e4[_0xbdc1('0x10')]);}switch(_0x250c10[_0xbdc1('0x7')]['toUpperCase']()){case'GET':case'DELETE':_0x339fb0=null;_0xad188f['qs']=_0x41757d;break;case _0xbdc1('0x11'):case _0xbdc1('0x12'):if(_0x250c10[_0xbdc1('0x13')]){try{_0x339fb0=JSON['parse'](Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0x13')],_0x41757d));_0xad188f[_0xbdc1('0x14')]=_0x339fb0;}catch(_0x4407ec){logger[_0xbdc1('0xf')](_0x4407ec['stack']);logger[_0xbdc1('0xf')](_0xbdc1('0x15'));}}else{_0x339fb0=_0x41757d;_0xad188f['body']=_0x339fb0;}break;}logger[_0xbdc1('0x16')](util[_0xbdc1('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10[_0xbdc1('0x9')],JSON[_0xbdc1('0x18')](_0xad188f)));rp(_0xad188f)[_0xbdc1('0x19')](function(_0x1cec2c){_0x339fb0=!_[_0xbdc1('0x1a')](_0x339fb0)?_0xbdc1('0x1b')+_0x339fb0:'';_0x5ab847=typeof _0x1cec2c['body']===_0xbdc1('0x1c')?JSON[_0xbdc1('0x18')](_0x1cec2c[_0xbdc1('0x14')]):_0x1cec2c[_0xbdc1('0x14')];logger[_0xbdc1('0x16')](util[_0xbdc1('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10['data2'],_0x1cec2c[_0xbdc1('0x1d')],_0x5ab847));})[_0xbdc1('0x1e')](function(_0x10a369){logger[_0xbdc1('0xf')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10[_0xbdc1('0x9')],_0x10a369['statusCode'],_0x10a369[_0xbdc1('0x1f')],_0x10a369[_0xbdc1('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6a6aef8..619f47d 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 _0xd20d=['result','jayson/promise','../../config/logger','then','debug','rpc','routing','error','message'];(function(_0x27c55c,_0xcc1db9){var _0x57a54b=function(_0x34ee78){while(--_0x34ee78){_0x27c55c['push'](_0x27c55c['shift']());}};_0x57a54b(++_0xcc1db9);}(_0xd20d,0x1f0));var _0xdd20=function(_0x2ebf38,_0x478f09){_0x2ebf38=_0x2ebf38-0x0;var _0x515b0c=_0xd20d[_0x2ebf38];return _0x515b0c;};'use strict';var jayson=require(_0xdd20('0x0'));var BPromise=require('bluebird');var logger=require(_0xdd20('0x1'))('routing');var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x18a504,_0x406a66){return new BPromise(function(_0x1233f0,_0x58b20f){return client['request'](_0x18a504,_0x406a66)[_0xdd20('0x2')](function(_0x5c87c3){logger[_0xdd20('0x3')](_0xdd20('0x4'),_0xdd20('0x5'),_0x18a504,_0x406a66,_0x5c87c3);if(_0x5c87c3[_0xdd20('0x6')]){logger[_0xdd20('0x6')](_0xdd20('0x4'),'routing',_0x18a504,_0x5c87c3[_0xdd20('0x6')]['message'],_0x406a66);return _0x58b20f(_0x5c87c3['error'][_0xdd20('0x7')]);}else{return _0x1233f0(_0x5c87c3[_0xdd20('0x8')]);}})['catch'](function(_0x3f6d93){logger['error'](_0xdd20('0x4'),_0xdd20('0x5'),_0x18a504,_0x3f6d93,_0x406a66);return _0x58b20f(_0x3f6d93);});});};module['exports']=client; \ No newline at end of file +var _0x9d7b=['../../config/logger','http','request','then','rpc','error','routing','message','result','jayson/promise','bluebird'];(function(_0x1f5fb2,_0x4dee4b){var _0x536205=function(_0x3686a1){while(--_0x3686a1){_0x1f5fb2['push'](_0x1f5fb2['shift']());}};_0x536205(++_0x4dee4b);}(_0x9d7b,0xa3));var _0xb9d7=function(_0x428927,_0x1846dd){_0x428927=_0x428927-0x0;var _0x3edd01=_0x9d7b[_0x428927];return _0x3edd01;};'use strict';var jayson=require(_0xb9d7('0x0'));var BPromise=require(_0xb9d7('0x1'));var logger=require(_0xb9d7('0x2'))('routing');var client=jayson['client'][_0xb9d7('0x3')]({'port':0x2329});client['Request']=function(_0x1cfccb,_0x48c96c){return new BPromise(function(_0x5e00a4,_0x47d9e2){return client[_0xb9d7('0x4')](_0x1cfccb,_0x48c96c)[_0xb9d7('0x5')](function(_0x5a3a63){logger['debug'](_0xb9d7('0x6'),'routing',_0x1cfccb,_0x48c96c,_0x5a3a63);if(_0x5a3a63[_0xb9d7('0x7')]){logger['error']('rpc',_0xb9d7('0x8'),_0x1cfccb,_0x5a3a63['error'][_0xb9d7('0x9')],_0x48c96c);return _0x47d9e2(_0x5a3a63[_0xb9d7('0x7')]['message']);}else{return _0x5e00a4(_0x5a3a63[_0xb9d7('0xa')]);}})['catch'](function(_0x73fa7a){logger[_0xb9d7('0x7')](_0xb9d7('0x6'),'routing',_0x1cfccb,_0x73fa7a,_0x48c96c);return _0x47d9e2(_0x73fa7a);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 2b71a06..4ee249c 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 _0xcd68=['resolve','getMailAccounts','refresh','then','getSettings','log','bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x11c52d,_0x3456e4){var _0x4ca4fb=function(_0x26831b){while(--_0x26831b){_0x11c52d['push'](_0x11c52d['shift']());}};_0x4ca4fb(++_0x3456e4);}(_0xcd68,0x1ea));var _0x8cd6=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xcd68[_0x289e64];return _0x30246c;};'use strict';var BPromise=require(_0x8cd6('0x0'));var server=require(_0x8cd6('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x8cd6('0x2'));var mailAccount=require(_0x8cd6('0x3'));var setting=require(_0x8cd6('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x8cd6('0x5')]()['then'](mailAccount[_0x8cd6('0x6')]())['then'](realtime['initMailAccounts']())['then'](function(){email[_0x8cd6('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x8cd6('0x8')](function(){return setting[_0x8cd6('0x9')]();})[_0x8cd6('0x8')](function(_0x56002c){return setInterval(initRealtime,_0x56002c['loginMailFrequency']*0x3e8);})['catch'](function(_0x3ccd3d){console[_0x8cd6('0xa')](_0x3ccd3d);});}main(); \ No newline at end of file +var _0xf894=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server'];(function(_0x58281e,_0x33a14a){var _0x3cd045=function(_0x476217){while(--_0x476217){_0x58281e['push'](_0x58281e['shift']());}};_0x3cd045(++_0x33a14a);}(_0xf894,0xfd));var _0x4f89=function(_0xdbeee8,_0x28a2d7){_0xdbeee8=_0xdbeee8-0x0;var _0x4a6bfc=_0xf894[_0xdbeee8];return _0x4a6bfc;};'use strict';var BPromise=require(_0x4f89('0x0'));var server=require(_0x4f89('0x1'));var Realtime=require(_0x4f89('0x2'));var EmailChannel=require(_0x4f89('0x3'));var mailAccount=require(_0x4f89('0x4'));var setting=require(_0x4f89('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4f89('0x6')]()[_0x4f89('0x7')](mailAccount[_0x4f89('0x8')]())[_0x4f89('0x7')](realtime[_0x4f89('0x9')]())[_0x4f89('0x7')](function(){email[_0x4f89('0xa')](realtime[_0x4f89('0xb')]);return realtime;});}function main(){return server[_0x4f89('0xc')](realtime,email)[_0x4f89('0x7')](function(){return initRealtime();})[_0x4f89('0x7')](function(){return setting[_0x4f89('0xd')]();})['then'](function(_0x2f8cd8){return setInterval(initRealtime,_0x2f8cd8[_0x4f89('0xe')]*0x3e8);})[_0x4f89('0xf')](function(_0x3253fe){console[_0x4f89('0x10')](_0x3253fe);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index bf5b040..4792e98 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 _0xa67b=['from','notify','then','Mail\x20accepted\x20from\x20routing','catch','sendMail','send','verifySmtp','isNil','Smtp','lastSync','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','emit','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','prototype','hasOwnProperty','imapAccounts','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0x3bda20,_0x200fee){var _0x40ea2d=function(_0x3cd911){while(--_0x3cd911){_0x3bda20['push'](_0x3bda20['shift']());}};_0x40ea2d(++_0x200fee);}(_0xa67b,0x1c6));var _0xba67=function(_0x344949,_0x220866){_0x344949=_0x344949-0x0;var _0x437aec=_0xa67b[_0x344949];return _0x437aec;};'use strict';var _=require(_0xba67('0x0'));var moment=require('moment');var BPromise=require(_0xba67('0x1'));var md5=require(_0xba67('0x2'));var Redis=require(_0xba67('0x3'));var config=require(_0xba67('0x4'));var logger=require(_0xba67('0x5'))(_0xba67('0x6'));config[_0xba67('0x7')]=_[_0xba67('0x8')](config[_0xba67('0x7')],{'host':_0xba67('0x9'),'port':0x18eb});var io=require(_0xba67('0xa'))(new Redis(config['redis']));var EmailImap=require(_0xba67('0xb'));var EmailSmtp=require(_0xba67('0xc'));var mailAccount=require(_0xba67('0xd'));var md5Accounts={};function EmailChannel(_0x46116c){logger[_0xba67('0xe')](_0xba67('0xf'));this[_0xba67('0x10')]=_0x46116c['mailAccounts'];this['imapAccounts']={};this[_0xba67('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xba67('0x12')]=function(_0x358b36){var _0x30f572=this['mailAccounts'][_0x358b36];var _0x2e8055={'id':_0x30f572['id'],'name':_0x30f572[_0xba67('0x13')],'key':_0x30f572[_0xba67('0x14')],'active':_0x30f572[_0xba67('0x15')],'Imap':{'status':_0x30f572[_0xba67('0x16')][_0xba67('0x17')],'messageStatus':_0x30f572[_0xba67('0x16')][_0xba67('0x18')],'total':_0x30f572[_0xba67('0x16')][_0xba67('0x19')]}};if(_['isNil'](md5Accounts[_0x358b36])){md5Accounts[_0x358b36]={};}var _0x38b89e=md5(JSON[_0xba67('0x1a')](_0x2e8055));if(md5Accounts[_0x358b36]['md5']!==_0x38b89e){md5Accounts[_0x358b36]['md5']=_0x38b89e;io[_0xba67('0x12')](_0xba67('0x1b'),_0x2e8055);}};EmailChannel[_0xba67('0x1c')]['refresh']=function(_0x4a6943){for(var _0x426bf2 in _0x4a6943){if(_0x4a6943[_0xba67('0x1d')](_0x426bf2)){if(_0x4a6943[_0x426bf2][_0xba67('0x16')]&&_0x4a6943[_0x426bf2][_0xba67('0x15')]){var _0x5677be=_0x4a6943[_0x426bf2][_0xba67('0x16')];if(!this[_0xba67('0x1e')][_0xba67('0x1d')](_0x5677be['id'])){this[_0xba67('0x1e')][_0x5677be['id']]=new EmailImap(_0x5677be,_0x4a6943[_0x426bf2][_0xba67('0x6')]);this[_0xba67('0x1e')][_0x5677be['id']]['on']('box',this[_0xba67('0x1f')][_0xba67('0x20')](this,_0x426bf2));this[_0xba67('0x1e')][_0x5677be['id']]['on'](_0xba67('0x6'),this['handleImapEmail'][_0xba67('0x20')](this,_0x426bf2));this['imapAccounts'][_0x5677be['id']]['on'](_0xba67('0x21'),this[_0xba67('0x22')][_0xba67('0x20')](this,_0x426bf2));this[_0xba67('0x1e')][_0x5677be['id']]['on'](_0xba67('0x23'),this[_0xba67('0x24')][_0xba67('0x20')](this,_0x426bf2));}}else{if(_['isNil'](this['mailAccounts'][_0x426bf2][_0xba67('0x16')])){this[_0xba67('0x10')][_0x426bf2][_0xba67('0x16')]={};}this['mailAccounts'][_0x426bf2][_0xba67('0x16')]['status']=_0xba67('0x25');this[_0xba67('0x10')][_0x426bf2][_0xba67('0x16')]['messageStatus']='';this['emit'](_0x426bf2);}}}};EmailChannel[_0xba67('0x1c')]['handleImapBox']=function(_0x48c420,_0x31adb8){if(this[_0xba67('0x10')][_0x48c420]){this[_0xba67('0x10')][_0x48c420][_0xba67('0x16')][_0xba67('0x17')]=_0xba67('0x26');this[_0xba67('0x10')][_0x48c420][_0xba67('0x16')][_0xba67('0x18')]=_0x31adb8[_0xba67('0x13')];if(_0x31adb8[_0xba67('0x27')]){this[_0xba67('0x10')][_0x48c420][_0xba67('0x16')][_0xba67('0x19')]=_0x31adb8[_0xba67('0x27')][_0xba67('0x19')];}return this['emit'](_0x48c420);}};EmailChannel[_0xba67('0x1c')]['handleImapEmail']=function(_0x5487c3,_0x2360de){logger['info'](_0xba67('0x28'),_0x2360de['firstName'],_0x2360de['lastName'],_0x2360de[_0xba67('0x29')],_0x5487c3);if(this[_0xba67('0x10')][_0x5487c3]){return mailAccount[_0xba67('0x2a')](_0x5487c3,_0x2360de)[_0xba67('0x2b')](function(_0x1e08bc){if(_0x1e08bc){logger['info'](_0xba67('0x2c'));}})[_0xba67('0x2d')](function(_0x5f1e42){logger[_0xba67('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x5f1e42));});}};EmailChannel[_0xba67('0x1c')][_0xba67('0x22')]=function(_0x1d4244){if(this['mailAccounts'][_0x1d4244]&&this['mailAccounts'][_0x1d4244][_0xba67('0x16')]){if(this[_0xba67('0x1e')][this[_0xba67('0x10')][_0x1d4244][_0xba67('0x16')]['id']]){delete this[_0xba67('0x1e')][this['mailAccounts'][_0x1d4244][_0xba67('0x16')]['id']];}this[_0xba67('0x10')][_0x1d4244][_0xba67('0x16')]['lastSync']=moment();this[_0xba67('0x12')](_0x1d4244);}};EmailChannel[_0xba67('0x1c')]['handleImapError']=function(_0x5ed968,_0x48e043){if(this[_0xba67('0x10')][_0x5ed968]){this['mailAccounts'][_0x5ed968][_0xba67('0x16')]['status']=_0xba67('0x23');this[_0xba67('0x10')][_0x5ed968][_0xba67('0x16')][_0xba67('0x18')]=_0x48e043;return this[_0xba67('0x12')](_0x5ed968);}};EmailChannel['prototype'][_0xba67('0x2e')]=function(_0x3a5a51,_0x3a9de2){return this[_0xba67('0x11')][_0xba67('0x2f')](_0x3a5a51,_0x3a9de2);};EmailChannel['prototype'][_0xba67('0x30')]=function(_0x3b9d56){var _0xa60ae7=this;if(this[_0xba67('0x10')][_0x3b9d56['id']]){if(_[_0xba67('0x31')](this[_0xba67('0x10')][_0x3b9d56['id']][_0xba67('0x32')])){this[_0xba67('0x10')][_0x3b9d56['id']]['Smtp']={};}this[_0xba67('0x10')][_0x3b9d56['id']]['Smtp'][_0xba67('0x33')]=moment();return new BPromise(function(_0x4c7c83,_0x53d437){return _0xa60ae7[_0xba67('0x11')][_0xba67('0x34')](_0x3b9d56)[_0xba67('0x2b')](function(_0xce94ec){_0xa60ae7[_0xba67('0x10')][_0x3b9d56['id']][_0xba67('0x32')][_0xba67('0x17')]=_0xba67('0x35');_0xa60ae7[_0xba67('0x10')][_0x3b9d56['id']]['Smtp']['messageStatus']='';_0xa60ae7['emit'](_0x3b9d56['id']);_0x4c7c83(_0xce94ec);})[_0xba67('0x2d')](function(_0x59cfb0){_0xa60ae7[_0xba67('0x10')][_0x3b9d56['id']][_0xba67('0x32')][_0xba67('0x17')]=_0xba67('0x23');_0xa60ae7['mailAccounts'][_0x3b9d56['id']]['Smtp'][_0xba67('0x18')]=_0x59cfb0;_0xa60ae7[_0xba67('0x12')](_0x3b9d56['id']);_0x53d437(_0x59cfb0);});});}return this[_0xba67('0x11')][_0xba67('0x34')](_0x3b9d56);};module[_0xba67('0x36')]=EmailChannel; \ No newline at end of file +var _0xc61a=['connected','messageStatus','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','active','Imap','status','total','isNil','stringify','prototype','refresh','hasOwnProperty','email','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','disabled'];(function(_0x43190a,_0x358045){var _0x24b0d8=function(_0x1b2934){while(--_0x1b2934){_0x43190a['push'](_0x43190a['shift']());}};_0x24b0d8(++_0x358045);}(_0xc61a,0xe5));var _0xac61=function(_0x4896cd,_0x5d5055){_0x4896cd=_0x4896cd-0x0;var _0x339b5c=_0xc61a[_0x4896cd];return _0x339b5c;};'use strict';var _=require(_0xac61('0x0'));var moment=require(_0xac61('0x1'));var BPromise=require(_0xac61('0x2'));var md5=require(_0xac61('0x3'));var Redis=require(_0xac61('0x4'));var config=require(_0xac61('0x5'));var logger=require(_0xac61('0x6'))('email');config[_0xac61('0x7')]=_[_0xac61('0x8')](config[_0xac61('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xac61('0x9'))(new Redis(config[_0xac61('0x7')]));var EmailImap=require(_0xac61('0xa'));var EmailSmtp=require(_0xac61('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x133c0a){logger[_0xac61('0xc')](_0xac61('0xd'));this[_0xac61('0xe')]=_0x133c0a['mailAccounts'];this[_0xac61('0xf')]={};this[_0xac61('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xac61('0x11')]=function(_0x303fa7){var _0x13bf43=this[_0xac61('0xe')][_0x303fa7];var _0x5484ff={'id':_0x13bf43['id'],'name':_0x13bf43['name'],'key':_0x13bf43['key'],'active':_0x13bf43[_0xac61('0x12')],'Imap':{'status':_0x13bf43[_0xac61('0x13')][_0xac61('0x14')],'messageStatus':_0x13bf43[_0xac61('0x13')]['messageStatus'],'total':_0x13bf43[_0xac61('0x13')][_0xac61('0x15')]}};if(_[_0xac61('0x16')](md5Accounts[_0x303fa7])){md5Accounts[_0x303fa7]={};}var _0x137435=md5(JSON[_0xac61('0x17')](_0x5484ff));if(md5Accounts[_0x303fa7]['md5']!==_0x137435){md5Accounts[_0x303fa7][_0xac61('0x3')]=_0x137435;io[_0xac61('0x11')]('mailAccount:update',_0x5484ff);}};EmailChannel[_0xac61('0x18')][_0xac61('0x19')]=function(_0x29936e){for(var _0x1604d7 in _0x29936e){if(_0x29936e[_0xac61('0x1a')](_0x1604d7)){if(_0x29936e[_0x1604d7]['Imap']&&_0x29936e[_0x1604d7][_0xac61('0x12')]){var _0x1baf24=_0x29936e[_0x1604d7][_0xac61('0x13')];if(!this[_0xac61('0xf')][_0xac61('0x1a')](_0x1baf24['id'])){this[_0xac61('0xf')][_0x1baf24['id']]=new EmailImap(_0x1baf24,_0x29936e[_0x1604d7][_0xac61('0x1b')]);this[_0xac61('0xf')][_0x1baf24['id']]['on'](_0xac61('0x1c'),this[_0xac61('0x1d')]['bind'](this,_0x1604d7));this[_0xac61('0xf')][_0x1baf24['id']]['on']('email',this[_0xac61('0x1e')][_0xac61('0x1f')](this,_0x1604d7));this[_0xac61('0xf')][_0x1baf24['id']]['on']('end',this[_0xac61('0x20')][_0xac61('0x1f')](this,_0x1604d7));this['imapAccounts'][_0x1baf24['id']]['on'](_0xac61('0x21'),this[_0xac61('0x22')]['bind'](this,_0x1604d7));}}else{if(_[_0xac61('0x16')](this[_0xac61('0xe')][_0x1604d7]['Imap'])){this[_0xac61('0xe')][_0x1604d7][_0xac61('0x13')]={};}this[_0xac61('0xe')][_0x1604d7]['Imap'][_0xac61('0x14')]=_0xac61('0x23');this[_0xac61('0xe')][_0x1604d7]['Imap']['messageStatus']='';this[_0xac61('0x11')](_0x1604d7);}}}};EmailChannel[_0xac61('0x18')][_0xac61('0x1d')]=function(_0x2e2500,_0x1cd649){if(this[_0xac61('0xe')][_0x2e2500]){this['mailAccounts'][_0x2e2500][_0xac61('0x13')]['status']=_0xac61('0x24');this[_0xac61('0xe')][_0x2e2500]['Imap'][_0xac61('0x25')]=_0x1cd649['name'];if(_0x1cd649['messages']){this[_0xac61('0xe')][_0x2e2500][_0xac61('0x13')][_0xac61('0x15')]=_0x1cd649['messages']['total'];}return this[_0xac61('0x11')](_0x2e2500);}};EmailChannel[_0xac61('0x18')][_0xac61('0x1e')]=function(_0x230505,_0x49bea7){logger[_0xac61('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x49bea7[_0xac61('0x26')],_0x49bea7[_0xac61('0x27')],_0x49bea7[_0xac61('0x28')],_0x230505);if(this['mailAccounts'][_0x230505]){return mailAccount[_0xac61('0x29')](_0x230505,_0x49bea7)['then'](function(_0x43a20d){if(_0x43a20d){logger['info'](_0xac61('0x2a'));}})[_0xac61('0x2b')](function(_0x4aa61f){logger[_0xac61('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xac61('0x17')](_0x4aa61f));});}};EmailChannel[_0xac61('0x18')]['handleImapEnd']=function(_0x518e1e){if(this[_0xac61('0xe')][_0x518e1e]&&this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]){if(this[_0xac61('0xf')][this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]['id']]){delete this[_0xac61('0xf')][this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]['id']];}this[_0xac61('0xe')][_0x518e1e]['Imap'][_0xac61('0x2c')]=moment();this[_0xac61('0x11')](_0x518e1e);}};EmailChannel[_0xac61('0x18')][_0xac61('0x22')]=function(_0x10b79c,_0x1b4b65){if(this['mailAccounts'][_0x10b79c]){this['mailAccounts'][_0x10b79c][_0xac61('0x13')][_0xac61('0x14')]=_0xac61('0x21');this[_0xac61('0xe')][_0x10b79c][_0xac61('0x13')][_0xac61('0x25')]=_0x1b4b65;return this[_0xac61('0x11')](_0x10b79c);}};EmailChannel['prototype'][_0xac61('0x2d')]=function(_0x26251a,_0xfc8ea4){return this[_0xac61('0x10')][_0xac61('0x2e')](_0x26251a,_0xfc8ea4);};EmailChannel[_0xac61('0x18')][_0xac61('0x2f')]=function(_0x2d5417){var _0x9eb4d0=this;if(this[_0xac61('0xe')][_0x2d5417['id']]){if(_['isNil'](this['mailAccounts'][_0x2d5417['id']][_0xac61('0x30')])){this[_0xac61('0xe')][_0x2d5417['id']][_0xac61('0x30')]={};}this[_0xac61('0xe')][_0x2d5417['id']][_0xac61('0x30')][_0xac61('0x2c')]=moment();return new BPromise(function(_0x332766,_0x24240f){return _0x9eb4d0[_0xac61('0x10')]['verify'](_0x2d5417)[_0xac61('0x31')](function(_0x4a655b){_0x9eb4d0[_0xac61('0xe')][_0x2d5417['id']]['Smtp']['status']=_0xac61('0x32');_0x9eb4d0['mailAccounts'][_0x2d5417['id']]['Smtp'][_0xac61('0x25')]='';_0x9eb4d0[_0xac61('0x11')](_0x2d5417['id']);_0x332766(_0x4a655b);})[_0xac61('0x2b')](function(_0x36b894){_0x9eb4d0['mailAccounts'][_0x2d5417['id']]['Smtp'][_0xac61('0x14')]=_0xac61('0x21');_0x9eb4d0[_0xac61('0xe')][_0x2d5417['id']]['Smtp']['messageStatus']=_0x36b894;_0x9eb4d0[_0xac61('0x11')](_0x2d5417['id']);_0x24240f(_0x36b894);});});}return this[_0xac61('0x10')][_0xac61('0x33')](_0x2d5417);};module[_0xac61('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5eda4dd..486b94f 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 _0xdafe=['email','mailbox','getAccount','account','once','end','bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','closeBox','handleEnd','stringify','textCode','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils'];(function(_0x57c168,_0x5eb6d4){var _0x16f0dd=function(_0xb759cf){while(--_0xb759cf){_0x57c168['push'](_0x57c168['shift']());}};_0x16f0dd(++_0x5eb6d4);}(_0xdafe,0x6a));var _0xedaf=function(_0x25602f,_0x47661c){_0x25602f=_0x25602f-0x0;var _0x150f8b=_0xdafe[_0x25602f];return _0x150f8b;};'use strict';var fs=require('fs');var path=require(_0xedaf('0x0'));var util=require(_0xedaf('0x1'));var Imap=require(_0xedaf('0x2'));var _=require(_0xedaf('0x3'));var rs=require(_0xedaf('0x4'));var simpleParser=require(_0xedaf('0x5'))[_0xedaf('0x6')];var Iconv=require(_0xedaf('0x7'))[_0xedaf('0x8')];var EventEmitter=require(_0xedaf('0x9'))[_0xedaf('0xa')];var utils=require(_0xedaf('0xb'));var logger=require('../../../config/logger')(_0xedaf('0xc'));function EmailImap(_0x4ed160,_0x15ed9d){this[_0xedaf('0xd')]='INBOX';this['account']=this[_0xedaf('0xe')](_0x4ed160,_0x15ed9d);this[_0xedaf('0x2')]=new Imap(this[_0xedaf('0xf')]);this[_0xedaf('0x2')]['once']('ready',this['handleReady']['bind'](this));this[_0xedaf('0x2')][_0xedaf('0x10')](_0xedaf('0x11'),this['handleEnd'][_0xedaf('0x12')](this));this[_0xedaf('0x2')]['on'](_0xedaf('0x13'),this[_0xedaf('0x14')]['bind'](this));this[_0xedaf('0x2')][_0xedaf('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xedaf('0x16')][_0xedaf('0xe')]=function(_0x252562,_0x13e7a8){var _0x1b32ab={'connTimeout':_0x252562[_0xedaf('0x17')]?_0x252562[_0xedaf('0x17')]*0x3e8:0x2710,'authTimeout':_0x252562[_0xedaf('0x18')]?_0x252562['authTimeout']*0x3e8:0x1388};if(_[_0xedaf('0x19')](_0x252562[_0xedaf('0x1a')])){if(_0x252562['authentication']){_0x1b32ab[_0xedaf('0x1b')]=_0x252562[_0xedaf('0x1b')];_0x1b32ab['password']=_0x252562[_0xedaf('0x1c')];}_0x1b32ab[_0xedaf('0x1d')]=_0x252562[_0xedaf('0x1d')];_0x1b32ab[_0xedaf('0x1e')]=_0x252562[_0xedaf('0x1e')]||0x3e1;if(_0x252562['tls']){_0x1b32ab[_0xedaf('0x1f')]=!![];}else{_0x1b32ab[_0xedaf('0x1f')]=![];_0x1b32ab[_0xedaf('0x20')]=_0xedaf('0x21');}}else{_0x1b32ab[_0xedaf('0x1b')]=_0x252562[_0xedaf('0x1b')];_0x1b32ab['password']=_0x252562[_0xedaf('0x1c')];_0x1b32ab['host']=utils[_0xedaf('0x22')](_0x252562['service']);_0x1b32ab[_0xedaf('0x1e')]=0x3e1;_0x1b32ab['tls']=!![];}_0x1b32ab['email']=_0x13e7a8||_0x252562[_0xedaf('0x1b')]||_0xedaf('0x23');return _0x1b32ab;};EmailImap[_0xedaf('0x16')][_0xedaf('0x24')]=function(){this['imap']['openBox'](this['mailbox'],![],this[_0xedaf('0x25')][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')][_0xedaf('0x25')]=function(_0x3b2e07,_0x5a8d11){if(_0x3b2e07){this[_0xedaf('0x14')](_0x3b2e07,!![]);}else{this[_0xedaf('0x26')]('box',_0x5a8d11);this[_0xedaf('0x27')]();}};EmailImap['prototype'][_0xedaf('0x28')]=function(_0x141326){if(_0x141326){this[_0xedaf('0x14')](_0x141326,!![]);}else{this[_0xedaf('0x2')][_0xedaf('0x11')]();}};EmailImap[_0xedaf('0x16')][_0xedaf('0x27')]=function(){this[_0xedaf('0x2')][_0xedaf('0x29')]([_0xedaf('0x2a')],this['handleReadUnseen'][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')][_0xedaf('0x2b')]=function(_0x2f074e,_0x95250d){if(_0x2f074e){this[_0xedaf('0x14')](_0x2f074e,!![]);}else{if(_0x95250d[_0xedaf('0x2c')]){try{var _0x1a319c=this[_0xedaf('0x2')][_0xedaf('0x2d')](_0x95250d,{'bodies':'','markSeen':!![]});_0x1a319c['on'](_0xedaf('0x2e'),this[_0xedaf('0x2f')]['bind'](this));_0x1a319c[_0xedaf('0x10')](_0xedaf('0x13'),this[_0xedaf('0x30')]['bind'](this));_0x1a319c[_0xedaf('0x10')](_0xedaf('0x11'),this['handleFetchEnd'][_0xedaf('0x12')](this));}catch(_0x5e9274){logger[_0xedaf('0x13')](_0x5e9274);}}else{this[_0xedaf('0x2')]['closeBox'](!![],this['handleCloseBox'][_0xedaf('0x12')](this));}}};EmailImap[_0xedaf('0x16')][_0xedaf('0x2f')]=function(_0xac3684,_0x425b2e){_0xac3684['on'](_0xedaf('0x31'),this[_0xedaf('0x32')]['bind'](this));_0xac3684[_0xedaf('0x10')](_0xedaf('0x33'),this[_0xedaf('0x34')][_0xedaf('0x12')](this));_0xac3684[_0xedaf('0x10')](_0xedaf('0x11'),this['handleMessageEnd'][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')][_0xedaf('0x32')]=function(_0x309e6c,_0x20a731){simpleParser(_0x309e6c,{'Iconv':Iconv},this['handleSimpleParser'][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')]['handleMessageAttributes']=function(_0x2e8f2a){};EmailImap[_0xedaf('0x16')][_0xedaf('0x35')]=function(){};EmailImap[_0xedaf('0x16')]['handleSimpleParser']=function(_0x1eea75,_0x29e65c){if(_0x1eea75){logger[_0xedaf('0x13')](_0x1eea75);}else{var _0x3adcac=this;utils[_0xedaf('0x36')](this[_0xedaf('0xf')],_0x29e65c,function(_0x64024){_0x3adcac[_0xedaf('0x26')](_0xedaf('0xc'),_0x64024);});}};EmailImap[_0xedaf('0x16')]['handleFetchEnd']=function(){this['imap'][_0xedaf('0x37')](!![],this[_0xedaf('0x28')][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')][_0xedaf('0x30')]=function(_0x1a253e){this[_0xedaf('0x14')](_0x1a253e);this[_0xedaf('0x2')][_0xedaf('0x37')](!![],this[_0xedaf('0x28')][_0xedaf('0x12')](this));};EmailImap[_0xedaf('0x16')][_0xedaf('0x38')]=function(){this['emit'](_0xedaf('0x11'));};EmailImap[_0xedaf('0x16')][_0xedaf('0x14')]=function(_0x2257fd,_0xfed928){logger[_0xedaf('0x13')](_0xedaf('0x14'),this[_0xedaf('0xf')]['email'],JSON[_0xedaf('0x39')](_0x2257fd));var _0x9c963f='';if(_0x2257fd){if(_0x2257fd[_0xedaf('0x3a')]){_0x9c963f=_0x2257fd['textCode'];}else{for(var _0xa14bfc in _0x2257fd){if(_0x2257fd['hasOwnProperty'](_0xa14bfc)){_0x9c963f+=_['upperFirst'](_0xa14bfc)+':\x20'+_0x2257fd[_0xa14bfc]+'\x0a';}}}}if(_0xfed928){this[_0xedaf('0x2')][_0xedaf('0x11')]();}else{this[_0xedaf('0x26')](_0xedaf('0x13'),_0x9c963f);this[_0xedaf('0x26')](_0xedaf('0x11'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x9e6f=['iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','bind','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','handleReady','openBox','handleOpenBox','box','readUnseen','prototype','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','handleFetchError','stringify','textCode','upperFirst','path','imap','lodash','simpleParser'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x9e6f,0x76));var _0xf9e6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9e6f[_0x18ab2a];return _0x16dcee;};'use strict';var fs=require('fs');var path=require(_0xf9e6('0x0'));var util=require('util');var Imap=require(_0xf9e6('0x1'));var _=require(_0xf9e6('0x2'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0xf9e6('0x3')];var Iconv=require(_0xf9e6('0x4'))[_0xf9e6('0x5')];var EventEmitter=require(_0xf9e6('0x6'))[_0xf9e6('0x7')];var utils=require(_0xf9e6('0x8'));var logger=require(_0xf9e6('0x9'))(_0xf9e6('0xa'));function EmailImap(_0x594f5e,_0x357128){this[_0xf9e6('0xb')]=_0xf9e6('0xc');this[_0xf9e6('0xd')]=this[_0xf9e6('0xe')](_0x594f5e,_0x357128);this[_0xf9e6('0x1')]=new Imap(this[_0xf9e6('0xd')]);this['imap'][_0xf9e6('0xf')]('ready',this['handleReady'][_0xf9e6('0x10')](this));this[_0xf9e6('0x1')][_0xf9e6('0xf')](_0xf9e6('0x11'),this[_0xf9e6('0x12')][_0xf9e6('0x10')](this));this[_0xf9e6('0x1')]['on'](_0xf9e6('0x13'),this[_0xf9e6('0x14')][_0xf9e6('0x10')](this));this['imap'][_0xf9e6('0x15')]();}util[_0xf9e6('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf9e6('0xe')]=function(_0xc375cf,_0x551068){var _0x2f63a4={'connTimeout':_0xc375cf['connTimeout']?_0xc375cf[_0xf9e6('0x17')]*0x3e8:0x2710,'authTimeout':_0xc375cf['authTimeout']?_0xc375cf[_0xf9e6('0x18')]*0x3e8:0x1388};if(_[_0xf9e6('0x19')](_0xc375cf[_0xf9e6('0x1a')])){if(_0xc375cf[_0xf9e6('0x1b')]){_0x2f63a4['user']=_0xc375cf[_0xf9e6('0x1c')];_0x2f63a4[_0xf9e6('0x1d')]=_0xc375cf[_0xf9e6('0x1d')];}_0x2f63a4[_0xf9e6('0x1e')]=_0xc375cf[_0xf9e6('0x1e')];_0x2f63a4[_0xf9e6('0x1f')]=_0xc375cf['port']||0x3e1;if(_0xc375cf[_0xf9e6('0x20')]){_0x2f63a4['tls']=!![];}else{_0x2f63a4[_0xf9e6('0x20')]=![];_0x2f63a4[_0xf9e6('0x21')]='required';}}else{_0x2f63a4['user']=_0xc375cf[_0xf9e6('0x1c')];_0x2f63a4[_0xf9e6('0x1d')]=_0xc375cf[_0xf9e6('0x1d')];_0x2f63a4[_0xf9e6('0x1e')]=utils[_0xf9e6('0x22')](_0xc375cf[_0xf9e6('0x1a')]);_0x2f63a4[_0xf9e6('0x1f')]=0x3e1;_0x2f63a4[_0xf9e6('0x20')]=!![];}_0x2f63a4[_0xf9e6('0xa')]=_0x551068||_0xc375cf[_0xf9e6('0x1c')]||'anonymous@xcally.com';return _0x2f63a4;};EmailImap['prototype'][_0xf9e6('0x23')]=function(){this[_0xf9e6('0x1')][_0xf9e6('0x24')](this[_0xf9e6('0xb')],![],this[_0xf9e6('0x25')][_0xf9e6('0x10')](this));};EmailImap['prototype'][_0xf9e6('0x25')]=function(_0x2f02f8,_0x144575){if(_0x2f02f8){this['handleError'](_0x2f02f8,!![]);}else{this['emit'](_0xf9e6('0x26'),_0x144575);this[_0xf9e6('0x27')]();}};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x29')]=function(_0x181a60){if(_0x181a60){this['handleError'](_0x181a60,!![]);}else{this['imap'][_0xf9e6('0x11')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0xf9e6('0x1')][_0xf9e6('0x2a')]([_0xf9e6('0x2b')],this[_0xf9e6('0x2c')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x2c')]=function(_0xf96f32,_0x3432e7){if(_0xf96f32){this[_0xf9e6('0x14')](_0xf96f32,!![]);}else{if(_0x3432e7['length']){try{var _0x160add=this[_0xf9e6('0x1')][_0xf9e6('0x2d')](_0x3432e7,{'bodies':'','markSeen':!![]});_0x160add['on'](_0xf9e6('0x2e'),this[_0xf9e6('0x2f')]['bind'](this));_0x160add[_0xf9e6('0xf')](_0xf9e6('0x13'),this['handleFetchError'][_0xf9e6('0x10')](this));_0x160add[_0xf9e6('0xf')](_0xf9e6('0x11'),this[_0xf9e6('0x30')][_0xf9e6('0x10')](this));}catch(_0x8e6432){logger[_0xf9e6('0x13')](_0x8e6432);}}else{this[_0xf9e6('0x1')][_0xf9e6('0x31')](!![],this['handleCloseBox'][_0xf9e6('0x10')](this));}}};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x2f')]=function(_0x12a226,_0x4e4165){_0x12a226['on'](_0xf9e6('0x32'),this[_0xf9e6('0x33')][_0xf9e6('0x10')](this));_0x12a226['once'](_0xf9e6('0x34'),this['handleMessageAttributes'][_0xf9e6('0x10')](this));_0x12a226[_0xf9e6('0xf')]('end',this['handleMessageEnd'][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x33')]=function(_0x18f35f,_0x589124){simpleParser(_0x18f35f,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x35')]=function(_0x470f84){};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x36')]=function(){};EmailImap[_0xf9e6('0x28')]['handleSimpleParser']=function(_0x326e2b,_0x59c19c){if(_0x326e2b){logger[_0xf9e6('0x13')](_0x326e2b);}else{var _0x387e8b=this;utils[_0xf9e6('0x37')](this[_0xf9e6('0xd')],_0x59c19c,function(_0x325d8e){_0x387e8b[_0xf9e6('0x38')](_0xf9e6('0xa'),_0x325d8e);});}};EmailImap['prototype'][_0xf9e6('0x30')]=function(){this[_0xf9e6('0x1')][_0xf9e6('0x31')](!![],this[_0xf9e6('0x29')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x39')]=function(_0x343344){this[_0xf9e6('0x14')](_0x343344);this[_0xf9e6('0x1')]['closeBox'](!![],this[_0xf9e6('0x29')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')]['handleEnd']=function(){this[_0xf9e6('0x38')](_0xf9e6('0x11'));};EmailImap[_0xf9e6('0x28')]['handleError']=function(_0x52d049,_0x3ee6ca){logger[_0xf9e6('0x13')]('handleError',this[_0xf9e6('0xd')][_0xf9e6('0xa')],JSON[_0xf9e6('0x3a')](_0x52d049));var _0x21635e='';if(_0x52d049){if(_0x52d049['textCode']){_0x21635e=_0x52d049[_0xf9e6('0x3b')];}else{for(var _0xc262a3 in _0x52d049){if(_0x52d049['hasOwnProperty'](_0xc262a3)){_0x21635e+=_[_0xf9e6('0x3c')](_0xc262a3)+':\x20'+_0x52d049[_0xc262a3]+'\x0a';}}}}if(_0x3ee6ca){this[_0xf9e6('0x1')][_0xf9e6('0x11')]();}else{this['emit'](_0xf9e6('0x13'),_0x21635e);this[_0xf9e6('0x38')](_0xf9e6('0x11'));}};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 b3e698f..bf811c6 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 _0x0e53=['createTransport','use','toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','send'];(function(_0x5b3b8c,_0x5d0b05){var _0x476a4b=function(_0x556e7e){while(--_0x556e7e){_0x5b3b8c['push'](_0x5b3b8c['shift']());}};_0x476a4b(++_0x5d0b05);}(_0x0e53,0x18d));var _0x30e5=function(_0x361c52,_0x3d19bf){_0x361c52=_0x361c52-0x0;var _0x20f544=_0x0e53[_0x361c52];return _0x20f544;};'use strict';var nodemailer=require(_0x30e5('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x30e5('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x30e5('0x2')]=function(_0x174363,_0x16497b){return new BPromise(function(_0x1114f6,_0x655ba2){var _0x3707f3=nodemailer[_0x30e5('0x3')](_0x174363);_0x3707f3[_0x30e5('0x4')]('compile',inlineBase64());_0x3707f3['sendMail'](_0x16497b,function(_0x5034d3,_0x266a27){if(_0x5034d3){_0x655ba2(_0x5034d3[_0x30e5('0x5')]());}else{_0x1114f6(_0x266a27);}});});};EmailSmtp['prototype']['verify']=function(_0x5e3135){return new BPromise(function(_0x1f5459,_0x50aa23){var _0x4c174a=nodemailer[_0x30e5('0x3')](_0x5e3135);_0x4c174a[_0x30e5('0x6')](function(_0x5ddb54,_0x1e7b9c){if(_0x5ddb54){_0x50aa23(_0x5ddb54[_0x30e5('0x5')]());}else{if(_0x1e7b9c){_0x1f5459(_0x1e7b9c);}else{_0x50aa23(_0x30e5('0x7'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x3192=['exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','compile','toString','verify','Not\x20verifired'];(function(_0x1e5413,_0x51f9ae){var _0x4bc406=function(_0x1682fc){while(--_0x1682fc){_0x1e5413['push'](_0x1e5413['shift']());}};_0x4bc406(++_0x51f9ae);}(_0x3192,0x191));var _0x2319=function(_0x225fd6,_0x4b0503){_0x225fd6=_0x225fd6-0x0;var _0x3f007e=_0x3192[_0x225fd6];return _0x3f007e;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x2319('0x0'));var inlineBase64=require(_0x2319('0x1'));function EmailSmtp(){}EmailSmtp[_0x2319('0x2')][_0x2319('0x3')]=function(_0x11b85c,_0x825067){return new BPromise(function(_0x4c2f40,_0x1b865d){var _0x1b2cc4=nodemailer['createTransport'](_0x11b85c);_0x1b2cc4[_0x2319('0x4')](_0x2319('0x5'),inlineBase64());_0x1b2cc4['sendMail'](_0x825067,function(_0x2407e9,_0x5f2127){if(_0x2407e9){_0x1b865d(_0x2407e9[_0x2319('0x6')]());}else{_0x4c2f40(_0x5f2127);}});});};EmailSmtp[_0x2319('0x2')][_0x2319('0x7')]=function(_0x307018){return new BPromise(function(_0xa4dcd2,_0x501cf5){var _0x4bd4c9=nodemailer['createTransport'](_0x307018);_0x4bd4c9[_0x2319('0x7')](function(_0x28597f,_0x41c1e0){if(_0x28597f){_0x501cf5(_0x28597f[_0x2319('0x6')]());}else{if(_0x41c1e0){_0xa4dcd2(_0x41c1e0);}else{_0x501cf5(_0x2319('0x8'));}}});});};module[_0x2319('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e927aa6..8a1a4c2 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 _0x89fb=['subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','address','anonymous','@xcally.com','value','name','indexOf','split','length','join','Anonymous','pop','isEmpty','generate','test','html','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x36b3f8['slice'](0x0,-0x1)[_0xb89f('0x10')]('\x20'):_0x300c7c[_0xb89f('0xc')];}return _0xb89f('0x11');}function getLastName(_0x2c236b){var _0x1175f3=_[_0xb89f('0x7')](_0x2c236b['value']);if(_0x1175f3&&_0x1175f3[_0xb89f('0xc')]){var _0x349122=_0x1175f3[_0xb89f('0xc')][_0xb89f('0xe')](/\s+/);return _0x349122[_0xb89f('0xf')]>0x1?_0x349122[_0xb89f('0x12')]():'';}return'';}function getMails(_0xb33497,_0x4d7a92){var _0x243388='';for(var _0xfc48d=0x0;_0xfc48d<_0x4d7a92[_0xb89f('0xb')][_0xb89f('0xf')];_0xfc48d+=0x1){if(_0x4d7a92['value'][_0xfc48d]['address']!==_0xb33497){if(!_[_0xb89f('0x13')](_0x243388)){_0x243388+=',';}_0x243388+=_0x4d7a92[_0xb89f('0xb')][_0xfc48d][_0xb89f('0xc')]||_0x4d7a92['value'][_0xfc48d]['address']||'';_0x243388+='\x20<';_0x243388+=_0x4d7a92[_0xb89f('0xb')][_0xfc48d][_0xb89f('0x8')]?_0x4d7a92[_0xb89f('0xb')][_0xfc48d][_0xb89f('0x8')]:_0xb89f('0x9')+random[_0xb89f('0x14')](0x6)+_0xb89f('0xa');_0x243388+='>';}}return _0x243388;}function parseEmail(_0x5b82a7,_0x59e898,_0x4b795e){if(_0x59e898['html']){var _0x5ee95f=/)<[^<]*)*<\/script>/gi;while(_0x5ee95f[_0xb89f('0x15')](_0x59e898['html'])){_0x59e898[_0xb89f('0x16')]=_0x59e898[_0xb89f('0x16')][_0xb89f('0x17')](_0x5ee95f,'');}if(_0x59e898[_0xb89f('0x16')][_0xb89f('0x18')](_0xb89f('0x19'))){var _0x49ec5c=[];_0x59e898[_0xb89f('0x1a')][_0xb89f('0x1b')](_0xe71e63=>{_0x49ec5c[_0xb89f('0x1c')](_0xe71e63[_0xb89f('0x1d')]);});var _0x2a22b6=/]+>/g;var _0x1934e8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x177db8=_0x59e898['html'][_0xb89f('0x17')](_0x1934e8,_0xb89f('0x1e'));var _0x723479=_0x177db8[_0xb89f('0x17')](_0x2a22b6,_0xb89f('0x1f'));for(let _0x22195c=0x0;_0x22195c<_0x49ec5c['length'];_0x22195c++){var _0x447dd1=_0x723479[_0xb89f('0x17')](_0xb89f('0x1f'),_0xb89f('0x20')+_0x49ec5c[_0x22195c]+'\x20]');_0x723479=_0x447dd1;}_0x59e898['html']=_0x723479;}_0x4b795e['body']=_0x59e898[_0xb89f('0x16')];}else{_0x4b795e[_0xb89f('0x21')]=_0x59e898[_0xb89f('0x22')];}if(_0x4b795e[_0xb89f('0x21')]){_0x4b795e[_0xb89f('0x21')]=_0x4b795e[_0xb89f('0x21')][_0xb89f('0x17')](/0x0){var _0x35c6a1=[_0xb89f('0x33'),_0xb89f('0x34'),'Precedence:\x20auto_reply'];for(var _0x43c478=0x0;_0x43c478<_0x59e898[_0xb89f('0x32')][_0xb89f('0xf')];_0x43c478++){var _0x5570b1=_[_0xb89f('0xd')](_0x35c6a1,_0x59e898[_0xb89f('0x32')][_0x43c478]['line']);if(_0x5570b1>=0x0){_0x4b795e['isAutoreply']=!![];}}}return _0x4b795e;}exports['parser']=function(_0x5eb555,_0x8cf572,_0x546e7d){var _0x19ce4a={'from':getAddress(_0x8cf572[_0xb89f('0x35')]),'firstName':getFirstName(_0x8cf572[_0xb89f('0x35')]),'lastName':getLastName(_0x8cf572[_0xb89f('0x35')]),'mapKey':'email','message':{'from':getMails(_0x5eb555[_0xb89f('0x5')],_0x8cf572[_0xb89f('0x35')]),'to':_0x5eb555[_0xb89f('0x5')],'cc':'','subject':_0x8cf572[_0xb89f('0x36')]||'','messageId':_0x8cf572[_0xb89f('0x37')],'inReplyTo':_0x8cf572[_0xb89f('0x38')],'sentAt':moment(_0x8cf572[_0xb89f('0x39')])[_0xb89f('0x2b')](_0xb89f('0x3a')),'attach':![],'attachments':[]}};if(!_0x8cf572[_0xb89f('0x16')]&&!_0x8cf572[_0xb89f('0x22')]){var _0x14d6ff=_[_0xb89f('0x3b')](_0x8cf572['attachments'],{'contentType':_0xb89f('0x3c')});if(_0x14d6ff[_0xb89f('0xf')]){logger[_0xb89f('0x3d')](util[_0xb89f('0x2b')](_0xb89f('0x3e'),_0x8cf572[_0xb89f('0x37')]));tnef[_0xb89f('0x3f')](_['first'](_0x14d6ff)[_0xb89f('0x30')],function(_0x56aaf1,_0x2477c7){if(_0x2477c7){_0x8cf572['html']=_0x2477c7[_0xb89f('0x40')]||_0xb89f('0x41');if(_0x2477c7[_0xb89f('0x42')]){for(var _0x59d194=0x0;_0x59d194<_0x2477c7[_0xb89f('0x42')][_0xb89f('0xf')];_0x59d194++){var _0x32b7e1=_0x2477c7[_0xb89f('0x42')][_0x59d194];_0x19ce4a[_0xb89f('0x24')]['attachments'][_0xb89f('0x1c')]({'filename':_0x32b7e1[_0xb89f('0x43')],'content':Buffer['from'](_0x32b7e1[_0xb89f('0x44')])});}}}_0x546e7d(parseEmail(_0x5eb555,_0x8cf572,_0x19ce4a));});}else{_0x8cf572[_0xb89f('0x16')]=_0xb89f('0x41');_0x546e7d(parseEmail(_0x5eb555,_0x8cf572,_0x19ce4a));}}else{_0x546e7d(parseEmail(_0x5eb555,_0x8cf572,_0x19ce4a));}};exports[_0xb89f('0x45')]=function(_0x4ec5e){switch(_0x4ec5e){case _0xb89f('0x46'):return _0xb89f('0x47');case _0xb89f('0x48'):return _0xb89f('0x49');case _0xb89f('0x4a'):return'imap-mail.outlook.com';case'outlook365':return _0xb89f('0x4b');}return _0xb89f('0x4c');}; \ No newline at end of file +var _0x32b6=['Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','lodash','moment','path','util','email','../../../config/environment','head','value','address','anonymous','generate','name','indexOf','split','length','slice','join','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b6,0x1d1));var _0x632b=function(_0x2bb36d,_0x34f88d){_0x2bb36d=_0x2bb36d-0x0;var _0x283da3=_0x32b6[_0x2bb36d];return _0x283da3;};'use strict';var _=require(_0x632b('0x0'));var moment=require(_0x632b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x632b('0x2'));var util=require(_0x632b('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x632b('0x4'));var config=require(_0x632b('0x5'));function getAddress(_0x3ba3a7){var _0x3a0e0e=_[_0x632b('0x6')](_0x3ba3a7[_0x632b('0x7')]);return _0x3a0e0e&&_0x3a0e0e[_0x632b('0x8')]?_0x3a0e0e[_0x632b('0x8')]:_0x632b('0x9')+random[_0x632b('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x33d711){var _0x173270=_[_0x632b('0x6')](_0x33d711[_0x632b('0x7')]);if(_0x173270&&_0x173270['name']){if(_0x173270['name']==_0x173270['address']){return _0x173270[_0x632b('0xb')]['substring'](0x0,_0x173270[_0x632b('0xb')][_0x632b('0xc')]('@'));}var _0x2eca51=_0x173270[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x2eca51[_0x632b('0xe')]>0x1?_0x2eca51[_0x632b('0xf')](0x0,-0x1)[_0x632b('0x10')]('\x20'):_0x173270[_0x632b('0xb')];}return'Anonymous';}function getLastName(_0xb5416c){var _0x286f75=_[_0x632b('0x6')](_0xb5416c['value']);if(_0x286f75&&_0x286f75[_0x632b('0xb')]){var _0x1a3a60=_0x286f75[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x1a3a60[_0x632b('0xe')]>0x1?_0x1a3a60[_0x632b('0x11')]():'';}return'';}function getMails(_0x4efe39,_0x17ddc5){var _0x52f353='';for(var _0x4fdef2=0x0;_0x4fdef2<_0x17ddc5[_0x632b('0x7')]['length'];_0x4fdef2+=0x1){if(_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]!==_0x4efe39){if(!_[_0x632b('0x12')](_0x52f353)){_0x52f353+=',';}_0x52f353+=_0x17ddc5['value'][_0x4fdef2][_0x632b('0xb')]||_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]||'';_0x52f353+='\x20<';_0x52f353+=_0x17ddc5[_0x632b('0x7')][_0x4fdef2]['address']?_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]:'anonymous'+random[_0x632b('0xa')](0x6)+'@xcally.com';_0x52f353+='>';}}return _0x52f353;}function parseEmail(_0x4b5618,_0x1b1092,_0x5ce3fa){if(_0x1b1092[_0x632b('0x13')]){var _0x1c4530=/)<[^<]*)*<\/script>/gi;while(_0x1c4530[_0x632b('0x14')](_0x1b1092['html'])){_0x1b1092[_0x632b('0x13')]=_0x1b1092[_0x632b('0x13')]['replace'](_0x1c4530,'');}if(_0x1b1092[_0x632b('0x13')][_0x632b('0x15')](_0x632b('0x16'))){var _0x1e448c=[];_0x1b1092[_0x632b('0x17')][_0x632b('0x18')](_0x5ec5ea=>{_0x1e448c['push'](_0x5ec5ea[_0x632b('0x19')]);});var _0x4d3a70=/]+>/g;var _0x4ebd26=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x954fa0=_0x1b1092['html'][_0x632b('0x1a')](_0x4ebd26,_0x632b('0x1b'));var _0x29d9aa=_0x954fa0[_0x632b('0x1a')](_0x4d3a70,_0x632b('0x1c'));for(let _0x515d74=0x0;_0x515d74<_0x1e448c[_0x632b('0xe')];_0x515d74++){var _0x1975ac=_0x29d9aa[_0x632b('0x1a')]('_IMG',_0x632b('0x1d')+_0x1e448c[_0x515d74]+_0x632b('0x1e'));_0x29d9aa=_0x1975ac;}_0x1b1092[_0x632b('0x13')]=_0x29d9aa;}_0x5ce3fa[_0x632b('0x1f')]=_0x1b1092[_0x632b('0x13')];}else{_0x5ce3fa[_0x632b('0x1f')]=_0x1b1092[_0x632b('0x20')];}if(_0x5ce3fa[_0x632b('0x1f')]){_0x5ce3fa[_0x632b('0x1f')]=_0x5ce3fa[_0x632b('0x1f')][_0x632b('0x1a')](/0x0){var _0x57f099=[_0x632b('0x31'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x55b5f6=0x0;_0x55b5f6<_0x1b1092[_0x632b('0x32')][_0x632b('0xe')];_0x55b5f6++){var _0x417a30=_[_0x632b('0xc')](_0x57f099,_0x1b1092['headerLines'][_0x55b5f6][_0x632b('0x33')]);if(_0x417a30>=0x0){_0x5ce3fa[_0x632b('0x34')]=!![];}}}return _0x5ce3fa;}exports[_0x632b('0x35')]=function(_0x4dbe4b,_0x15bb30,_0x32fcc8){var _0x1225a4={'from':getAddress(_0x15bb30[_0x632b('0x36')]),'firstName':getFirstName(_0x15bb30[_0x632b('0x36')]),'lastName':getLastName(_0x15bb30[_0x632b('0x36')]),'mapKey':'email','message':{'from':getMails(_0x4dbe4b[_0x632b('0x4')],_0x15bb30[_0x632b('0x36')]),'to':_0x4dbe4b[_0x632b('0x4')],'cc':'','subject':_0x15bb30[_0x632b('0x37')]||'','messageId':_0x15bb30['messageId'],'inReplyTo':_0x15bb30['inReplyTo'],'sentAt':moment(_0x15bb30[_0x632b('0x38')])[_0x632b('0x29')](_0x632b('0x39')),'attach':![],'attachments':[]}};if(!_0x15bb30[_0x632b('0x13')]&&!_0x15bb30[_0x632b('0x20')]){var _0x1ec1c0=_['filter'](_0x15bb30[_0x632b('0x17')],{'contentType':_0x632b('0x3a')});if(_0x1ec1c0[_0x632b('0xe')]){logger[_0x632b('0x3b')](util[_0x632b('0x29')](_0x632b('0x3c'),_0x15bb30[_0x632b('0x3d')]));tnef[_0x632b('0x3e')](_['first'](_0x1ec1c0)[_0x632b('0x2f')],function(_0x56f254,_0x2a1f09){if(_0x2a1f09){_0x15bb30['html']=_0x2a1f09[_0x632b('0x3f')]||_0x632b('0x40');if(_0x2a1f09[_0x632b('0x41')]){for(var _0x2c4561=0x0;_0x2c4561<_0x2a1f09[_0x632b('0x41')]['length'];_0x2c4561++){var _0x3e582e=_0x2a1f09[_0x632b('0x41')][_0x2c4561];_0x1225a4[_0x632b('0x22')]['attachments'][_0x632b('0x30')]({'filename':_0x3e582e[_0x632b('0x42')],'content':Buffer[_0x632b('0x36')](_0x3e582e[_0x632b('0x43')])});}}}_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));});}else{_0x15bb30[_0x632b('0x13')]='

Empty\x20message

';_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));}}else{_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));}};exports[_0x632b('0x44')]=function(_0x50adc4){switch(_0x50adc4){case _0x632b('0x45'):return _0x632b('0x46');case _0x632b('0x47'):return _0x632b('0x48');case _0x632b('0x49'):return'imap-mail.outlook.com';case'outlook365':return _0x632b('0x4a');}return _0x632b('0x4b');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index ba84378..1b849bb 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 _0x8103=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x1e065d,_0x1f7377){var _0x1a675f=function(_0x20f685){while(--_0x20f685){_0x1e065d['push'](_0x1e065d['shift']());}};_0x1a675f(++_0x1f7377);}(_0x8103,0x15e));var _0x3810=function(_0x1a82a2,_0x408c78){_0x1a82a2=_0x1a82a2-0x0;var _0x4b4509=_0x8103[_0x1a82a2];return _0x4b4509;};'use strict';var _=require('lodash');function MailAccount(_0xd73f31){this['id']=_0xd73f31['id']||0x0;this[_0x3810('0x0')]=_0xd73f31[_0x3810('0x0')]||_0x3810('0x1');this['key']=_0xd73f31[_0x3810('0x2')]||_0x3810('0x3');this[_0x3810('0x4')]=_0xd73f31[_0x3810('0x4')]||![];this['Imap']=_0xd73f31[_0x3810('0x5')]||[];this[_0x3810('0x6')]=_0xd73f31[_0x3810('0x6')]||[];}module[_0x3810('0x7')]=MailAccount; \ No newline at end of file +var _0xf7af=['Smtp','name','Service','key','SERV','active','Imap'];(function(_0x117d83,_0x19c6c3){var _0xf26cf3=function(_0x30a17b){while(--_0x30a17b){_0x117d83['push'](_0x117d83['shift']());}};_0xf26cf3(++_0x19c6c3);}(_0xf7af,0x1e4));var _0xff7a=function(_0x5958a6,_0x34a283){_0x5958a6=_0x5958a6-0x0;var _0x33513f=_0xf7af[_0x5958a6];return _0x33513f;};'use strict';var _=require('lodash');function MailAccount(_0x3a7767){this['id']=_0x3a7767['id']||0x0;this[_0xff7a('0x0')]=_0x3a7767['name']||_0xff7a('0x1');this[_0xff7a('0x2')]=_0x3a7767[_0xff7a('0x2')]||_0xff7a('0x3');this['active']=_0x3a7767[_0xff7a('0x4')]||![];this[_0xff7a('0x5')]=_0x3a7767[_0xff7a('0x5')]||[];this['Smtp']=_0x3a7767[_0xff7a('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 8eadbca..9f95e7d 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 _0x5367=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','mailAccounts','mapKeys'];(function(_0x2ca6f9,_0x4eccba){var _0x4db8ad=function(_0x124fb6){while(--_0x124fb6){_0x2ca6f9['push'](_0x2ca6f9['shift']());}};_0x4db8ad(++_0x4eccba);}(_0x5367,0x127));var _0x7536=function(_0x8d3d6b,_0xabdcf2){_0x8d3d6b=_0x8d3d6b-0x0;var _0x8ff863=_0x5367[_0x8d3d6b];return _0x8ff863;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x7536('0x0')]={};};function freeIsNotKey(_0x35a39a,_0xa25785,_0x5535d7){var _0xc2fd3b=_[_0x7536('0x1')](_0x35a39a,function(_0x4ecbe9,_0x7d3386){return _0x4ecbe9[_0x5535d7];});for(var _0x28853d in _0xa25785){if(_0xa25785[_0x7536('0x2')](_0x28853d)){if(!_0xc2fd3b[_0x28853d]){delete _0xa25785[_0x28853d];}}}}Realtime[_0x7536('0x3')][_0x7536('0x4')]=function(_0x3b2ad0,_0x2ebee0){for(var _0x573d21 in _0x2ebee0){if(_0x3b2ad0['hasOwnProperty'](_0x573d21)){_0x3b2ad0[_0x573d21]=_0x2ebee0[_0x573d21];}}};Realtime[_0x7536('0x3')][_0x7536('0x5')]=function(){var _0x2b7e6d=this;return function(_0xac4c35){if(_0xac4c35){freeIsNotKey(_0xac4c35,_0x2b7e6d[_0x7536('0x0')],'id');for(var _0x384ce7=0x0,_0xa7d42d={},_0x292e90={};_0x384ce7<_0xac4c35[_0x7536('0x6')];_0x384ce7+=0x1){_0xa7d42d=_0xac4c35[_0x384ce7];if(_[_0x7536('0x7')](_0x2b7e6d['mailAccounts'][_0xa7d42d['id']])){_0x2b7e6d[_0x7536('0x0')][_0xa7d42d['id']]=new MailAccount(_0xa7d42d);}else{_[_0x7536('0x8')](_0x2b7e6d[_0x7536('0x0')][_0xa7d42d['id']],_0xa7d42d);}}}return _0x2b7e6d['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x359d=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts','hasOwnProperty'];(function(_0x4b4568,_0x17ed10){var _0x4ba97a=function(_0x1567cb){while(--_0x1567cb){_0x4b4568['push'](_0x4b4568['shift']());}};_0x4ba97a(++_0x17ed10);}(_0x359d,0x6b));var _0xd359=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x359d[_0x29e2af];return _0x1ea06a;};'use strict';var _=require(_0xd359('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xd359('0x1')]={};};function freeIsNotKey(_0x635f28,_0x27db60,_0x4eb9ab){var _0x35dbc6=_['mapKeys'](_0x635f28,function(_0x5a71a3,_0x4c1d3c){return _0x5a71a3[_0x4eb9ab];});for(var _0x183785 in _0x27db60){if(_0x27db60[_0xd359('0x2')](_0x183785)){if(!_0x35dbc6[_0x183785]){delete _0x27db60[_0x183785];}}}}Realtime[_0xd359('0x3')][_0xd359('0x4')]=function(_0x352578,_0x417c50){for(var _0x43ed01 in _0x417c50){if(_0x352578[_0xd359('0x2')](_0x43ed01)){_0x352578[_0x43ed01]=_0x417c50[_0x43ed01];}}};Realtime[_0xd359('0x3')][_0xd359('0x5')]=function(){var _0x27f9c5=this;return function(_0x3fe6f2){if(_0x3fe6f2){freeIsNotKey(_0x3fe6f2,_0x27f9c5[_0xd359('0x1')],'id');for(var _0x24b7c7=0x0,_0x22fa2d={},_0x465623={};_0x24b7c7<_0x3fe6f2[_0xd359('0x6')];_0x24b7c7+=0x1){_0x22fa2d=_0x3fe6f2[_0x24b7c7];if(_[_0xd359('0x7')](_0x27f9c5[_0xd359('0x1')][_0x22fa2d['id']])){_0x27f9c5['mailAccounts'][_0x22fa2d['id']]=new MailAccount(_0x22fa2d);}else{_[_0xd359('0x8')](_0x27f9c5['mailAccounts'][_0x22fa2d['id']],_0x22fa2d);}}}return _0x27f9c5[_0xd359('0x1')];};};module[_0xd359('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b785854..be0b3f3 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 _0xc967=['../client','getMailAccounts','Request','GetMailAccount','name','service','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','NotifyMailAccount'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0xc967,0x1b3));var _0x7c96=function(_0xe68363,_0x34d168){_0xe68363=_0xe68363-0x0;var _0x5c856c=_0xc967[_0xe68363];return _0x5c856c;};'use strict';var client=require(_0x7c96('0x0'));exports[_0x7c96('0x1')]=function(){return function(){return client[_0x7c96('0x2')](_0x7c96('0x3'),{'options':{'attributes':['id',_0x7c96('0x4'),_0x7c96('0x5'),'email','active',_0x7c96('0x6'),_0x7c96('0x7'),_0x7c96('0x8')],'raw':![],'include':[{'model':_0x7c96('0x9'),'as':_0x7c96('0xa')},{'model':_0x7c96('0xb'),'as':_0x7c96('0xc')}]},'log':_0x7c96('0xd')});};};exports['notify']=function(_0x44c3d7,_0x5697d0){return client[_0x7c96('0x2')](_0x7c96('0xe'),{'account':{'id':_0x44c3d7},'body':_0x5697d0,'log':_0x7c96('0xe')});}; \ No newline at end of file +var _0x867e=['getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp'];(function(_0x8a97a1,_0xaf1fdf){var _0x3daafa=function(_0x520cf5){while(--_0x520cf5){_0x8a97a1['push'](_0x8a97a1['shift']());}};_0x3daafa(++_0xaf1fdf);}(_0x867e,0x1c5));var _0xe867=function(_0xd945e8,_0x293e8f){_0xd945e8=_0xd945e8-0x0;var _0x385200=_0x867e[_0xd945e8];return _0x385200;};'use strict';var client=require(_0xe867('0x0'));exports[_0xe867('0x1')]=function(){return function(){return client[_0xe867('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xe867('0x3'),'service',_0xe867('0x4'),'active',_0xe867('0x5'),_0xe867('0x6'),_0xe867('0x7')],'raw':![],'include':[{'model':_0xe867('0x8'),'as':_0xe867('0x9')},{'model':_0xe867('0xa'),'as':_0xe867('0xb')}]},'log':_0xe867('0xc')});};};exports[_0xe867('0xd')]=function(_0x4f52f,_0x2a3cef){return client[_0xe867('0x2')](_0xe867('0xe'),{'account':{'id':_0x4f52f},'body':_0x2a3cef,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2084fb6..42202d0 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 _0x19ba=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x2408fd,_0x1c6064){var _0x12680a=function(_0x656c66){while(--_0x656c66){_0x2408fd['push'](_0x2408fd['shift']());}};_0x12680a(++_0x1c6064);}(_0x19ba,0x64));var _0xa19b=function(_0x2ef548,_0x3f534f){_0x2ef548=_0x2ef548-0x0;var _0x3b1cb9=_0x19ba[_0x2ef548];return _0x3b1cb9;};'use strict';var client=require(_0xa19b('0x0'));exports[_0xa19b('0x1')]=function(){return client[_0xa19b('0x2')](_0xa19b('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa19b('0x4')]},'log':_0xa19b('0x5')});}; \ No newline at end of file +var _0xf5c7=['../client','Request','loginMailFrequency','GetSettings'];(function(_0x4a5f6d,_0x1a6c58){var _0x1ee8c4=function(_0x2bd83b){while(--_0x2bd83b){_0x4a5f6d['push'](_0x4a5f6d['shift']());}};_0x1ee8c4(++_0x1a6c58);}(_0xf5c7,0x1ac));var _0x7f5c=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xf5c7[_0x3a13cf];return _0x4817c;};'use strict';var client=require(_0x7f5c('0x0'));exports['getSettings']=function(){return client[_0x7f5c('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7f5c('0x2')]},'log':_0x7f5c('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 47ac31b..bff0c1b 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(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 7b29671..c3adac9 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 _0x31cc=['express','ioredis','../../config/environment','createServer','listen','port','socket.io','polling','redis','defaults','adapter','socket.io-redis','default','../../config/express','listening','exports','lodash','http'];(function(_0x2e0d2a,_0x8d568){var _0x4014f0=function(_0x3dd59d){while(--_0x3dd59d){_0x2e0d2a['push'](_0x2e0d2a['shift']());}};_0x4014f0(++_0x8d568);}(_0x31cc,0x154));var _0xc31c=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x31cc[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xc31c('0x0'));var http=require(_0xc31c('0x1'));var express=require(_0xc31c('0x2'));var sticky=require('sticky-session');var Redis=require(_0xc31c('0x3'));var config=require(_0xc31c('0x4'));var app=express();var server=http[_0xc31c('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0xc31c('0x6')](server,config[_0xc31c('0x7')])){var socketio=require(_0xc31c('0x8'))(server,{'transports':['websocket',_0xc31c('0x9')]});config[_0xc31c('0xa')]=_[_0xc31c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0xc31c('0xc')](require(_0xc31c('0xd'))({'pubClient':new Redis(config[_0xc31c('0xa')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xc31c('0xe')]();require('../../config/socketio')[_0xc31c('0xe')](socketio);require(_0xc31c('0xf'))['default'](app);require('../../routes')[_0xc31c('0xe')](app);}else{server['once'](_0xc31c('0x10'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xc31c('0x7')]);});}exports=module[_0xc31c('0x11')]=app; \ No newline at end of file +var _0xe319=['../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','createServer','timeout','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xbdf091,_0x35a06c){var _0x129fd5=function(_0x529abd){while(--_0x529abd){_0xbdf091['push'](_0xbdf091['shift']());}};_0x129fd5(++_0x35a06c);}(_0xe319,0xaf));var _0x9e31=function(_0x4c7238,_0x5af00b){_0x4c7238=_0x4c7238-0x0;var _0x168e6b=_0xe319[_0x4c7238];return _0x168e6b;};'use strict';var _=require(_0x9e31('0x0'));var http=require(_0x9e31('0x1'));var express=require(_0x9e31('0x2'));var sticky=require(_0x9e31('0x3'));var Redis=require(_0x9e31('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0x9e31('0x5')](app);server[_0x9e31('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x9e31('0x7')])){var socketio=require(_0x9e31('0x8'))(server,{'transports':[_0x9e31('0x9'),'polling']});config[_0x9e31('0xa')]=_[_0x9e31('0xb')](config[_0x9e31('0xa')],{'host':_0x9e31('0xc'),'port':0x18eb});socketio[_0x9e31('0xd')](require(_0x9e31('0xe'))({'pubClient':new Redis(config[_0x9e31('0xa')]),'subClient':new Redis(config[_0x9e31('0xa')])}));require(_0x9e31('0xf'))[_0x9e31('0x10')]();require(_0x9e31('0x11'))[_0x9e31('0x10')](socketio);require(_0x9e31('0x12'))['default'](app);require(_0x9e31('0x13'))[_0x9e31('0x10')](app);}else{server[_0x9e31('0x14')](_0x9e31('0x15'),function(){console[_0x9e31('0x16')](_0x9e31('0x17'),config[_0x9e31('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index ba55bcf..33aa4fa 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 _0xd8b5=['exports','jayson/promise','../../config/logger','routing','client','then','error','message','result','catch'];(function(_0x3a0614,_0x4b6627){var _0x12bba7=function(_0x5ad138){while(--_0x5ad138){_0x3a0614['push'](_0x3a0614['shift']());}};_0x12bba7(++_0x4b6627);}(_0xd8b5,0x141));var _0x5d8b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd8b5[_0x14add3];return _0x4a174f;};'use strict';var jayson=require(_0x5d8b('0x0'));var BPromise=require('bluebird');var logger=require(_0x5d8b('0x1'))(_0x5d8b('0x2'));var client=jayson[_0x5d8b('0x3')]['http']({'port':0x2329});client['Request']=function(_0x29d782,_0xc3a97d){return new BPromise(function(_0x119ceb,_0x1de3a6){return client['request'](_0x29d782,_0xc3a97d)[_0x5d8b('0x4')](function(_0x4ab0f4){logger['debug']('rpc',_0x5d8b('0x2'),_0x29d782,_0xc3a97d,_0x4ab0f4);if(_0x4ab0f4[_0x5d8b('0x5')]){logger[_0x5d8b('0x5')]('rpc','routing',_0x29d782,_0x4ab0f4['error'][_0x5d8b('0x6')],_0xc3a97d);return _0x1de3a6(_0x4ab0f4[_0x5d8b('0x5')][_0x5d8b('0x6')]);}else{return _0x119ceb(_0x4ab0f4[_0x5d8b('0x7')]);}})[_0x5d8b('0x8')](function(_0x1ad584){logger['error']('rpc','routing',_0x29d782,_0x1ad584,_0xc3a97d);return _0x1de3a6(_0x1ad584);});});};module[_0x5d8b('0x9')]=client; \ No newline at end of file +var _0x94a5=['result','rpc','exports','jayson/promise','../../config/logger','client','http','Request','routing','error'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x94a5,0x139));var _0x594a=function(_0x30e8b7,_0x5d8b02){_0x30e8b7=_0x30e8b7-0x0;var _0x47e83c=_0x94a5[_0x30e8b7];return _0x47e83c;};'use strict';var jayson=require(_0x594a('0x0'));var BPromise=require('bluebird');var logger=require(_0x594a('0x1'))('routing');var client=jayson[_0x594a('0x2')][_0x594a('0x3')]({'port':0x2329});client[_0x594a('0x4')]=function(_0x34c507,_0x45e833){return new BPromise(function(_0x1bb1d3,_0x2369c0){return client['request'](_0x34c507,_0x45e833)['then'](function(_0x111bf7){logger['debug']('rpc',_0x594a('0x5'),_0x34c507,_0x45e833,_0x111bf7);if(_0x111bf7[_0x594a('0x6')]){logger[_0x594a('0x6')]('rpc','routing',_0x34c507,_0x111bf7[_0x594a('0x6')]['message'],_0x45e833);return _0x2369c0(_0x111bf7['error']['message']);}else{return _0x1bb1d3(_0x111bf7[_0x594a('0x7')]);}})['catch'](function(_0x4e9cc6){logger[_0x594a('0x6')](_0x594a('0x8'),_0x594a('0x5'),_0x34c507,_0x4e9cc6,_0x45e833);return _0x2369c0(_0x4e9cc6);});});};module[_0x594a('0x9')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index af9c7f0..6391fc4 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 _0x301b=['./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','resolve','then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x301b,0x86));var _0xb301=function(_0x507d56,_0x53e41a){_0x507d56=_0x507d56-0x0;var _0x54fa03=_0x301b[_0x507d56];return _0x54fa03;};'use strict';var BPromise=require(_0xb301('0x0'));var server=require(_0xb301('0x1'));var Realtime=require(_0xb301('0x2'));var user=require(_0xb301('0x3'));var interval=require(_0xb301('0x4'));var openchannelQueue=require(_0xb301('0x5'));var chatQueue=require(_0xb301('0x6'));var smsQueue=require(_0xb301('0x7'));var mailQueue=require(_0xb301('0x8'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xb301('0x9')]()[_0xb301('0xa')](user['getAgents']())[_0xb301('0xa')](realtime['initAgents']())[_0xb301('0xa')](interval['getIntervals']())[_0xb301('0xa')](realtime[_0xb301('0xb')]())[_0xb301('0xa')](openchannelQueue[_0xb301('0xc')]())['then'](realtime[_0xb301('0xd')]())[_0xb301('0xa')](chatQueue['getChatQueues']())[_0xb301('0xa')](realtime[_0xb301('0xe')]())['then'](smsQueue[_0xb301('0xf')]())['then'](realtime[_0xb301('0x10')]())[_0xb301('0xa')](mailQueue['getMailQueues']())[_0xb301('0xa')](realtime[_0xb301('0x11')]())['then'](faxQueue[_0xb301('0x12')]())['then'](realtime[_0xb301('0x13')]())['then'](whatsappQueue[_0xb301('0x14')]())[_0xb301('0xa')](realtime['initWhatsappQueues']())[_0xb301('0xa')](function(){return realtime;});}function main(){return server[_0xb301('0x15')](realtime)[_0xb301('0xa')](function(_0x2cffeb){return initRealtime();})[_0xb301('0xa')](function(_0x531d8e){return setInterval(initRealtime,0x1388);})['catch'](function(_0x408b9a){console[_0xb301('0x16')](_0x408b9a);});}main(); \ No newline at end of file +var _0x8da7=['getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','listen','catch','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x6b985a,_0x42ef29){var _0x4be8c4=function(_0x331bf4){while(--_0x331bf4){_0x6b985a['push'](_0x6b985a['shift']());}};_0x4be8c4(++_0x42ef29);}(_0x8da7,0xfa));var _0x78da=function(_0x368ba4,_0x403dab){_0x368ba4=_0x368ba4-0x0;var _0x271d63=_0x8da7[_0x368ba4];return _0x271d63;};'use strict';var BPromise=require('bluebird');var server=require(_0x78da('0x0'));var Realtime=require(_0x78da('0x1'));var user=require('./rpc/user');var interval=require(_0x78da('0x2'));var openchannelQueue=require(_0x78da('0x3'));var chatQueue=require(_0x78da('0x4'));var smsQueue=require(_0x78da('0x5'));var mailQueue=require(_0x78da('0x6'));var faxQueue=require(_0x78da('0x7'));var whatsappQueue=require(_0x78da('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x78da('0x9')]()['then'](user[_0x78da('0xa')]())[_0x78da('0xb')](realtime[_0x78da('0xc')]())[_0x78da('0xb')](interval[_0x78da('0xd')]())[_0x78da('0xb')](realtime[_0x78da('0xe')]())[_0x78da('0xb')](openchannelQueue[_0x78da('0xf')]())[_0x78da('0xb')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x78da('0x10')]())[_0x78da('0xb')](realtime[_0x78da('0x11')]())[_0x78da('0xb')](smsQueue[_0x78da('0x12')]())[_0x78da('0xb')](realtime[_0x78da('0x13')]())[_0x78da('0xb')](mailQueue[_0x78da('0x14')]())[_0x78da('0xb')](realtime[_0x78da('0x15')]())[_0x78da('0xb')](faxQueue[_0x78da('0x16')]())['then'](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x78da('0x17')](realtime)[_0x78da('0xb')](function(_0x105b76){return initRealtime();})[_0x78da('0xb')](function(_0xa77ff){return setInterval(initRealtime,0x1388);})[_0x78da('0x18')](function(_0x1d5a0f){console[_0x78da('0x19')](_0x1d5a0f);});}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 8c0147b..d9d08c9 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 _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(_0x2ed457,_0x34ac50){var _0x55f0dc=function(_0x1f9567){while(--_0x1f9567){_0x2ed457['push'](_0x2ed457['shift']());}};_0x55f0dc(++_0x34ac50);}(_0x7a54,0x106));var _0x47a5=function(_0x559eb8,_0x51a6ce){_0x559eb8=_0x559eb8-0x0;var _0x28c736=_0x7a54[_0x559eb8];return _0x28c736;};'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 +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(_0x33fdc8,_0x11dfc9){var _0x4479fe=function(_0x2cbccd){while(--_0x2cbccd){_0x33fdc8['push'](_0x33fdc8['shift']());}};_0x4479fe(++_0x11dfc9);}(_0xe14b,0x93));var _0xbe14=function(_0x24f1c1,_0x4b1296){_0x24f1c1=_0x24f1c1-0x0;var _0x55e0c2=_0xe14b[_0x24f1c1];return _0x55e0c2;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 386fd0f..571d8cd 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 _0x96d1=['jayson/promise','http','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x261197,_0x57efcb){var _0x5297dc=function(_0x3c28a9){while(--_0x3c28a9){_0x261197['push'](_0x261197['shift']());}};_0x5297dc(++_0x57efcb);}(_0x96d1,0x187));var _0x196d=function(_0x388f10,_0x43c4c0){_0x388f10=_0x388f10-0x0;var _0x2564f7=_0x96d1[_0x388f10];return _0x2564f7;};'use strict';var BPromise=require(_0x196d('0x0'));var jayson=require(_0x196d('0x1'));var client=jayson['client'][_0x196d('0x2')]({'port':0x232b});function request(_0x571cc4,_0x261436){return new BPromise(function(_0x2678db,_0x41b90e){return client['request'](_0x571cc4,_0x261436)['then'](function(_0x8b2ec1){if(_0x8b2ec1['error']){return _0x41b90e(_0x8b2ec1[_0x196d('0x3')]['message']);}else{return _0x2678db(_0x8b2ec1[_0x196d('0x4')]);}})[_0x196d('0x5')](function(_0x52374d){return _0x41b90e(_0x52374d);});});}exports[_0x196d('0x6')]=function(_0x2910ae,_0x82eab1){return request(_0x196d('0x7'),{'account':_0x2910ae,'message':_0x82eab1});}; \ No newline at end of file +var _0x7120=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x556509,_0x125907){var _0x1e2ad5=function(_0xe00439){while(--_0xe00439){_0x556509['push'](_0x556509['shift']());}};_0x1e2ad5(++_0x125907);}(_0x7120,0x14a));var _0x0712=function(_0x4495d6,_0x28b28c){_0x4495d6=_0x4495d6-0x0;var _0x14428e=_0x7120[_0x4495d6];return _0x14428e;};'use strict';var BPromise=require(_0x0712('0x0'));var jayson=require(_0x0712('0x1'));var client=jayson[_0x0712('0x2')][_0x0712('0x3')]({'port':0x232b});function request(_0x2c83ad,_0x2525ac){return new BPromise(function(_0x21f4e9,_0x44a32d){return client[_0x0712('0x4')](_0x2c83ad,_0x2525ac)[_0x0712('0x5')](function(_0x18491d){if(_0x18491d['error']){return _0x44a32d(_0x18491d[_0x0712('0x6')][_0x0712('0x7')]);}else{return _0x21f4e9(_0x18491d[_0x0712('0x8')]);}})[_0x0712('0x9')](function(_0x25d6ba){return _0x44a32d(_0x25d6ba);});});}exports[_0x0712('0xa')]=function(_0x237824,_0x36176e){return request(_0x0712('0xb'),{'account':_0x237824,'message':_0x36176e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a962fb8..5008683 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 _0x2926=['sms','whatsapp','length','Status','StatusTime','smsCurrentCapacity','whatsappCapacity','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','openchannel','fax'];(function(_0x2670ac,_0x416f90){var _0x75b69e=function(_0x307fd2){while(--_0x307fd2){_0x2670ac['push'](_0x2670ac['shift']());}};_0x75b69e(++_0x416f90);}(_0x2926,0x1af));var _0x6292=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0x2926[_0x360739];return _0x3e23a1;};'use strict';var _=require(_0x6292('0x0'));var moment=require(_0x6292('0x1'));var md5=require('md5');var Redis=require(_0x6292('0x2'));var config=require(_0x6292('0x3'));config[_0x6292('0x4')]=_[_0x6292('0x5')](config[_0x6292('0x4')],{'host':_0x6292('0x6'),'port':0x18eb});var io=require(_0x6292('0x7'))(new Redis(config['redis']));function Agent(_0x3a04ca){this['id']=_0x3a04ca['id']||0x0;this[_0x6292('0x8')]=_0x3a04ca[_0x6292('0x8')]||'';this[_0x6292('0x9')]=_0x3a04ca[_0x6292('0x9')]||!![];this[_0x6292('0xa')]=_0x3a04ca[_0x6292('0xa')]||![];this[_0x6292('0xb')]=_0x3a04ca[_0x6292('0xb')]||![];this[_0x6292('0xc')]=_0x3a04ca['mailPause']||![];this[_0x6292('0xd')]=_0x3a04ca[_0x6292('0xd')]||![];this[_0x6292('0xe')]=_0x3a04ca[_0x6292('0xe')]||![];this[_0x6292('0xf')]=_0x3a04ca[_0x6292('0xf')]||![];this[_0x6292('0x10')]='unknown';this[_0x6292('0x11')]=0x0;this[_0x6292('0x12')]=_0x3a04ca[_0x6292('0x12')]||0x0;this[_0x6292('0x13')]=0x0;this[_0x6292('0x14')]=_0x6292('0x15');this[_0x6292('0x16')]=0x0;this[_0x6292('0x17')]=_0x3a04ca['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x6292('0x18')]='unknown';this[_0x6292('0x19')]=0x0;this[_0x6292('0x1a')]=_0x3a04ca[_0x6292('0x1a')]||0x0;this[_0x6292('0x1b')]=0x0;this[_0x6292('0x1c')]='unknown';this[_0x6292('0x1d')]=0x0;this['smsCapacity']=_0x3a04ca[_0x6292('0x1e')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x6292('0x1f')]=_0x6292('0x15');this[_0x6292('0x20')]=0x0;this['whatsappCapacity']=_0x3a04ca['whatsappCapacity']||0x0;this[_0x6292('0x21')]=0x0;this[_0x6292('0x22')]=_0x6292('0x15');this[_0x6292('0x23')]=0x0;this[_0x6292('0x24')]=_0x3a04ca['openchannelCapacity']||0x0;this[_0x6292('0x25')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6292('0x26')]='';this[_0x6292('0x27')]();}Agent[_0x6292('0x28')][_0x6292('0x29')]=function(_0x3cd993){if(this[_0x3cd993+_0x6292('0x2a')]>0x0){if(this[_0x3cd993+_0x6292('0x2b')]>0x0&&this[_0x3cd993+'CurrentCapacity']>=this[_0x3cd993+_0x6292('0x2b')]){return'maxcapacity';}else{return _0x6292('0x2c');}}else{return'idle';}};Agent[_0x6292('0x28')]['updateRealtime']=function(){var _0x174a4e=[_0x6292('0x2d'),_0x6292('0x2e'),_0x6292('0x2f'),_0x6292('0x30'),_0x6292('0x31'),_0x6292('0x32')];for(var _0x28ccde=0x0;_0x28ccde<_0x174a4e[_0x6292('0x33')];_0x28ccde+=0x1){var _0x3959e8=this[_0x6292('0x29')](_0x174a4e[_0x28ccde]);if(this[_0x174a4e[_0x28ccde]+_0x6292('0x34')]!==_0x3959e8){this[_0x174a4e[_0x28ccde]+_0x6292('0x35')]=_['toNumber'](moment()['format']('x'));}this[_0x174a4e[_0x28ccde]+_0x6292('0x34')]=_0x3959e8;}var _0x2172ad={'id':this['id'],'name':this[_0x6292('0x8')],'online':this[_0x6292('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x6292('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0x6292('0xe')],'faxPause':this[_0x6292('0xd')],'openchannelPause':this[_0x6292('0xf')],'chatStatus':this[_0x6292('0x10')],'chatStatusTime':this[_0x6292('0x11')],'chatCapacity':this[_0x6292('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x6292('0x14')],'mailStatusTime':this[_0x6292('0x16')],'mailCapacity':this[_0x6292('0x17')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6292('0x18')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x6292('0x1a')],'faxCurrentCapacity':this[_0x6292('0x1b')],'smsStatus':this[_0x6292('0x1c')],'smsStatusTime':this[_0x6292('0x1d')],'smsCapacity':this[_0x6292('0x1e')],'smsCurrentCapacity':this[_0x6292('0x36')],'whatsappStatus':this[_0x6292('0x1f')],'whatsappStatusTime':this[_0x6292('0x20')],'whatsappCapacity':this[_0x6292('0x37')],'whatsappCurrentCapacity':this[_0x6292('0x21')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6292('0x24')],'openchannelCurrentCapacity':this[_0x6292('0x25')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x4d2d50=md5(JSON[_0x6292('0x38')](_0x2172ad));if(this[_0x6292('0x26')]!==_0x4d2d50){this[_0x6292('0x26')]=_0x4d2d50;io[_0x6292('0x39')](_0x6292('0x3a'),_0x2172ad);}};module[_0x6292('0x3b')]=Agent; \ No newline at end of file +var _0x7996=['openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','faxStatus','smsStatus','whatsappCurrentCapacity','busyQueue','stringify','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus'];(function(_0x358f2e,_0x847fd7){var _0x8707ad=function(_0x1b5f99){while(--_0x1b5f99){_0x358f2e['push'](_0x358f2e['shift']());}};_0x8707ad(++_0x847fd7);}(_0x7996,0x14d));var _0x6799=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x7996[_0x27a3cb];return _0x54ff38;};'use strict';var _=require('lodash');var moment=require(_0x6799('0x0'));var md5=require(_0x6799('0x1'));var Redis=require(_0x6799('0x2'));var config=require(_0x6799('0x3'));config[_0x6799('0x4')]=_[_0x6799('0x5')](config[_0x6799('0x4')],{'host':_0x6799('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6799('0x4')]));function Agent(_0x5b1fe6){this['id']=_0x5b1fe6['id']||0x0;this[_0x6799('0x7')]=_0x5b1fe6['name']||'';this[_0x6799('0x8')]=_0x5b1fe6['online']||!![];this[_0x6799('0x9')]=_0x5b1fe6[_0x6799('0x9')]||![];this[_0x6799('0xa')]=_0x5b1fe6[_0x6799('0xa')]||![];this[_0x6799('0xb')]=_0x5b1fe6[_0x6799('0xb')]||![];this[_0x6799('0xc')]=_0x5b1fe6['faxPause']||![];this[_0x6799('0xd')]=_0x5b1fe6['smsPause']||![];this[_0x6799('0xe')]=_0x5b1fe6['openchannelPause']||![];this[_0x6799('0xf')]=_0x6799('0x10');this[_0x6799('0x11')]=0x0;this[_0x6799('0x12')]=_0x5b1fe6[_0x6799('0x12')]||0x0;this[_0x6799('0x13')]=0x0;this[_0x6799('0x14')]=_0x6799('0x10');this[_0x6799('0x15')]=0x0;this[_0x6799('0x16')]=_0x5b1fe6[_0x6799('0x16')]||0x0;this[_0x6799('0x17')]=0x0;this['faxStatus']=_0x6799('0x10');this[_0x6799('0x18')]=0x0;this[_0x6799('0x19')]=_0x5b1fe6[_0x6799('0x19')]||0x0;this[_0x6799('0x1a')]=0x0;this['smsStatus']=_0x6799('0x10');this[_0x6799('0x1b')]=0x0;this[_0x6799('0x1c')]=_0x5b1fe6[_0x6799('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x6799('0x1d')]=_0x6799('0x10');this[_0x6799('0x1e')]=0x0;this[_0x6799('0x1f')]=_0x5b1fe6['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x6799('0x20')]=_0x6799('0x10');this[_0x6799('0x21')]=0x0;this['openchannelCapacity']=_0x5b1fe6[_0x6799('0x22')]||0x0;this[_0x6799('0x23')]=0x0;this[_0x6799('0x24')]=![];this['busyQueue']=undefined;this[_0x6799('0x1')]='';this[_0x6799('0x25')]();}Agent['prototype'][_0x6799('0x26')]=function(_0x3f2e71){if(this[_0x3f2e71+_0x6799('0x27')]>0x0){if(this[_0x3f2e71+_0x6799('0x28')]>0x0&&this[_0x3f2e71+_0x6799('0x27')]>=this[_0x3f2e71+_0x6799('0x28')]){return _0x6799('0x29');}else{return _0x6799('0x2a');}}else{return'idle';}};Agent[_0x6799('0x2b')]['updateRealtime']=function(){var _0x219fae=[_0x6799('0x2c'),_0x6799('0x2d'),_0x6799('0x2e'),_0x6799('0x2f'),_0x6799('0x30'),_0x6799('0x31')];for(var _0x44bdb0=0x0;_0x44bdb0<_0x219fae[_0x6799('0x32')];_0x44bdb0+=0x1){var _0x166dd2=this['getChannelStatus'](_0x219fae[_0x44bdb0]);if(this[_0x219fae[_0x44bdb0]+_0x6799('0x33')]!==_0x166dd2){this[_0x219fae[_0x44bdb0]+_0x6799('0x34')]=_['toNumber'](moment()[_0x6799('0x35')]('x'));}this[_0x219fae[_0x44bdb0]+_0x6799('0x33')]=_0x166dd2;}var _0xa03314={'id':this['id'],'name':this[_0x6799('0x7')],'online':this[_0x6799('0x8')],'voicePause':this[_0x6799('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x6799('0xb')],'smsPause':this[_0x6799('0xd')],'faxPause':this[_0x6799('0xc')],'openchannelPause':this[_0x6799('0xe')],'chatStatus':this[_0x6799('0xf')],'chatStatusTime':this[_0x6799('0x11')],'chatCapacity':this[_0x6799('0x12')],'chatCurrentCapacity':this[_0x6799('0x13')],'mailStatus':this[_0x6799('0x14')],'mailStatusTime':this[_0x6799('0x15')],'mailCapacity':this[_0x6799('0x16')],'mailCurrentCapacity':this[_0x6799('0x17')],'faxStatus':this[_0x6799('0x36')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x6799('0x1a')],'smsStatus':this[_0x6799('0x37')],'smsStatusTime':this[_0x6799('0x1b')],'smsCapacity':this[_0x6799('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x6799('0x1d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x6799('0x1f')],'whatsappCurrentCapacity':this[_0x6799('0x38')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6799('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x6799('0x23')],'busy':this[_0x6799('0x24')],'busyQueue':this[_0x6799('0x39')]};var _0xe80ca7=md5(JSON[_0x6799('0x3a')](_0xa03314));if(this[_0x6799('0x1')]!==_0xe80ca7){this[_0x6799('0x1')]=_0xe80ca7;io[_0x6799('0x3b')](_0x6799('0x3c'),_0xa03314);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 756d94e..bc7fbfd 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 _0x9256=['md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','loggedIn','paused','online','chatPause','available','stringify','emit','chat_queue:save','exports','lodash'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0x9256,0x1d3));var _0x6925=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9256[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6925('0x0'));var md5=require(_0x6925('0x1'));var util=require(_0x6925('0x2'));var Redis=require(_0x6925('0x3'));var config=require('../../../config/environment');config[_0x6925('0x4')]=_[_0x6925('0x5')](config['redis'],{'host':_0x6925('0x6'),'port':0x18eb});var io=require(_0x6925('0x7'))(new Redis(config[_0x6925('0x4')]));function ChatQueue(_0x2ea024){this['id']=_0x2ea024['id']||0x0;this['name']=_0x2ea024[_0x6925('0x8')]||'';this[_0x6925('0x9')]=_0x2ea024[_0x6925('0x9')]||0xa;this['strategy']=_0x2ea024[_0x6925('0xa')]||'beepall';this[_0x6925('0xb')]=_0x2ea024[_0x6925('0xb')];this[_0x6925('0xc')]={};this[_0x6925('0xd')]=0x0;this[_0x6925('0x1')]='';this[_0x6925('0xe')]();this[_0x6925('0xf')]();}ChatQueue[_0x6925('0x10')][_0x6925('0xe')]=function(){var _0x2d0777=this[_0x6925('0xc')]['_rr'];this[_0x6925('0xc')]=_['map'](this[_0x6925('0xb')],'id');this[_0x6925('0xc')]['_rr']=_0x2d0777;};ChatQueue['prototype'][_0x6925('0xf')]=function(){this[_0x6925('0x11')]=0x0;this[_0x6925('0x12')]=0x0;for(var _0x32030e=0x0;_0x32030e=0x0?this[_0x6925('0x15')]:0x0;var _0x14234a={'id':this['id'],'available':this[_0x6925('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x6925('0x8')],'paused':this[_0x6925('0x12')],'waiting':this[_0x6925('0xd')]};var _0x14ac56=md5(JSON[_0x6925('0x16')](_0x14234a));if(this['md5']!==_0x14ac56){this[_0x6925('0x1')]=_0x14ac56;io['to'](util['format']('chat:queue:%s',_0x14234a[_0x6925('0x8')]))[_0x6925('0x17')](_0x6925('0x18'),_0x14234a);}};module[_0x6925('0x19')]=ChatQueue; \ No newline at end of file +var _0xd81c=['_rr','map','prototype','paused','length','online','loggedIn','chatPause','available','stringify','format','emit','chat_queue:save','exports','md5','ioredis','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xe10c3e,_0x336f40){var _0x5608e1=function(_0x3e8e27){while(--_0x3e8e27){_0xe10c3e['push'](_0xe10c3e['shift']());}};_0x5608e1(++_0x336f40);}(_0xd81c,0xaa));var _0xcd81=function(_0x1d3973,_0x42fa0c){_0x1d3973=_0x1d3973-0x0;var _0xd30a7a=_0xd81c[_0x1d3973];return _0xd30a7a;};'use strict';var _=require('lodash');var md5=require(_0xcd81('0x0'));var util=require('util');var Redis=require(_0xcd81('0x1'));var config=require('../../../config/environment');config[_0xcd81('0x2')]=_['defaults'](config['redis'],{'host':_0xcd81('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd81('0x2')]));function ChatQueue(_0x4a498b){this['id']=_0x4a498b['id']||0x0;this[_0xcd81('0x4')]=_0x4a498b[_0xcd81('0x4')]||'';this[_0xcd81('0x5')]=_0x4a498b[_0xcd81('0x5')]||0xa;this['strategy']=_0x4a498b['strategy']||_0xcd81('0x6');this[_0xcd81('0x7')]=_0x4a498b[_0xcd81('0x7')];this[_0xcd81('0x8')]={};this[_0xcd81('0x9')]=0x0;this['md5']='';this[_0xcd81('0xa')]();this[_0xcd81('0xb')]();}ChatQueue['prototype'][_0xcd81('0xa')]=function(){var _0x1fff0c=this[_0xcd81('0x8')][_0xcd81('0xc')];this[_0xcd81('0x8')]=_[_0xcd81('0xd')](this[_0xcd81('0x7')],'id');this[_0xcd81('0x8')][_0xcd81('0xc')]=_0x1fff0c;};ChatQueue[_0xcd81('0xe')][_0xcd81('0xb')]=function(){this['loggedIn']=0x0;this[_0xcd81('0xf')]=0x0;for(var _0x8dd410=0x0;_0x8dd410=0x0?this[_0xcd81('0x14')]:0x0;var _0x2ae069={'id':this['id'],'available':this[_0xcd81('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xcd81('0x4')],'paused':this[_0xcd81('0xf')],'waiting':this[_0xcd81('0x9')]};var _0x384df4=md5(JSON[_0xcd81('0x15')](_0x2ae069));if(this[_0xcd81('0x0')]!==_0x384df4){this[_0xcd81('0x0')]=_0x384df4;io['to'](util[_0xcd81('0x16')]('chat:queue:%s',_0x2ae069[_0xcd81('0x4')]))[_0xcd81('0x17')](_0xcd81('0x18'),_0x2ae069);}};module[_0xcd81('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 327ffa3..296adcf 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 _0xca8d=['strategy','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','Agents','loggedIn','paused','length','online','available','stringify','format','emit','exports','redis','defaults','localhost','name','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca8d,0x1c3));var _0xdca8=function(_0x1faf34,_0x5a96e7){_0x1faf34=_0x1faf34-0x0;var _0x294624=_0xca8d[_0x1faf34];return _0x294624;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xdca8('0x0')]=_[_0xdca8('0x1')](config[_0xdca8('0x0')],{'host':_0xdca8('0x2'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdca8('0x0')]));function FaxQueue(_0xd88d3d){this['id']=_0xd88d3d['id']||0x0;this[_0xdca8('0x3')]=_0xd88d3d[_0xdca8('0x3')]||'';this[_0xdca8('0x4')]=_0xd88d3d['timeout']||0xa;this[_0xdca8('0x5')]=_0xd88d3d['strategy']||'beepall';this['Agents']=_0xd88d3d['Agents'];this['mapAgentsId']={};this[_0xdca8('0x6')]=0x0;this[_0xdca8('0x7')]='';this[_0xdca8('0x8')]();this[_0xdca8('0x9')]();}FaxQueue[_0xdca8('0xa')]['updateRouting']=function(){var _0x335946=this[_0xdca8('0xb')][_0xdca8('0xc')];this[_0xdca8('0xb')]=_[_0xdca8('0xd')](this[_0xdca8('0xe')],'id');this[_0xdca8('0xb')][_0xdca8('0xc')]=_0x335946;};FaxQueue[_0xdca8('0xa')][_0xdca8('0x9')]=function(){this[_0xdca8('0xf')]=0x0;this[_0xdca8('0x10')]=0x0;for(var _0x4a6f0b=0x0;_0x4a6f0b=0x0?this[_0xdca8('0x13')]:0x0;var _0x5e2093={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xdca8('0x10')],'waiting':this[_0xdca8('0x6')]};var _0x31f051=md5(JSON[_0xdca8('0x14')](_0x5e2093));if(this[_0xdca8('0x7')]!==_0x31f051){this[_0xdca8('0x7')]=_0x31f051;io['to'](util[_0xdca8('0x15')]('fax:queue:%s',_0x5e2093[_0xdca8('0x3')]))[_0xdca8('0x16')]('fax_queue:save',_0x5e2093);}};module[_0xdca8('0x17')]=FaxQueue; \ No newline at end of file +var _0xaab9=['map','loggedIn','faxPause','paused','available','stringify','format','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x4ecef4,_0x3a4db0){var _0x11f0a8=function(_0x5fed0e){while(--_0x5fed0e){_0x4ecef4['push'](_0x4ecef4['shift']());}};_0x11f0a8(++_0x3a4db0);}(_0xaab9,0xf3));var _0x9aab=function(_0x2bc642,_0x14ebe4){_0x2bc642=_0x2bc642-0x0;var _0x403c20=_0xaab9[_0x2bc642];return _0x403c20;};'use strict';var _=require(_0x9aab('0x0'));var md5=require(_0x9aab('0x1'));var util=require(_0x9aab('0x2'));var Redis=require(_0x9aab('0x3'));var config=require(_0x9aab('0x4'));config[_0x9aab('0x5')]=_[_0x9aab('0x6')](config[_0x9aab('0x5')],{'host':_0x9aab('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9aab('0x5')]));function FaxQueue(_0x5e2ad4){this['id']=_0x5e2ad4['id']||0x0;this[_0x9aab('0x8')]=_0x5e2ad4['name']||'';this[_0x9aab('0x9')]=_0x5e2ad4['timeout']||0xa;this[_0x9aab('0xa')]=_0x5e2ad4[_0x9aab('0xa')]||'beepall';this[_0x9aab('0xb')]=_0x5e2ad4[_0x9aab('0xb')];this[_0x9aab('0xc')]={};this[_0x9aab('0xd')]=0x0;this['md5']='';this[_0x9aab('0xe')]();this[_0x9aab('0xf')]();}FaxQueue[_0x9aab('0x10')]['updateRouting']=function(){var _0x4c4e54=this[_0x9aab('0xc')]['_rr'];this[_0x9aab('0xc')]=_[_0x9aab('0x11')](this[_0x9aab('0xb')],'id');this['mapAgentsId']['_rr']=_0x4c4e54;};FaxQueue[_0x9aab('0x10')][_0x9aab('0xf')]=function(){this[_0x9aab('0x12')]=0x0;this['paused']=0x0;for(var _0x4cb23b=0x0;_0x4cb23b=0x0?this[_0x9aab('0x15')]:0x0;var _0x394161={'id':this['id'],'available':this[_0x9aab('0x15')],'loggedIn':this[_0x9aab('0x12')],'name':this[_0x9aab('0x8')],'paused':this[_0x9aab('0x14')],'waiting':this['waiting']};var _0x4342f3=md5(JSON[_0x9aab('0x16')](_0x394161));if(this['md5']!==_0x4342f3){this[_0x9aab('0x1')]=_0x4342f3;io['to'](util[_0x9aab('0x17')]('fax:queue:%s',_0x394161[_0x9aab('0x8')]))[_0x9aab('0x18')](_0x9aab('0x19'),_0x394161);}};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 bd63f5d..d21c920 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 _0xf50d=['name','Intervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf50d,0x132));var _0xdf50=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xf50d[_0x40220a];return _0x3903cc;};'use strict';function Interval(_0x495344){this['id']=_0x495344['id']||0x0;this[_0xdf50('0x0')]=_0x495344['name']||'';this[_0xdf50('0x1')]=_0x495344[_0xdf50('0x1')]||{};}module[_0xdf50('0x2')]=Interval; \ No newline at end of file +var _0x68c7=['name','Intervals','exports'];(function(_0x45e6cd,_0x29242a){var _0x36c489=function(_0x41a8e4){while(--_0x41a8e4){_0x45e6cd['push'](_0x45e6cd['shift']());}};_0x36c489(++_0x29242a);}(_0x68c7,0x1a7));var _0x768c=function(_0x31675b,_0x3b8236){_0x31675b=_0x31675b-0x0;var _0x33c84f=_0x68c7[_0x31675b];return _0x33c84f;};'use strict';function Interval(_0x2a404d){this['id']=_0x2a404d['id']||0x0;this[_0x768c('0x0')]=_0x2a404d[_0x768c('0x0')]||'';this['Intervals']=_0x2a404d[_0x768c('0x1')]||{};}module[_0x768c('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 aa2aa8d..23f9229 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 _0xc2b6=['available','stringify','mail:queue:%s','emit','exports','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0xc2b6,0x18d));var _0x6c2b=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xc2b6[_0x484c03];return _0x294127;};'use strict';var _=require(_0x6c2b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x6c2b('0x1'));var config=require('../../../config/environment');config[_0x6c2b('0x2')]=_[_0x6c2b('0x3')](config[_0x6c2b('0x2')],{'host':_0x6c2b('0x4'),'port':0x18eb});var io=require(_0x6c2b('0x5'))(new Redis(config[_0x6c2b('0x2')]));function MailQueue(_0x21349b){this['id']=_0x21349b['id']||0x0;this['name']=_0x21349b[_0x6c2b('0x6')]||'';this[_0x6c2b('0x7')]=_0x21349b['timeout']||0xa;this['strategy']=_0x21349b['strategy']||_0x6c2b('0x8');this[_0x6c2b('0x9')]=_0x21349b[_0x6c2b('0x9')];this[_0x6c2b('0xa')]={};this[_0x6c2b('0xb')]=0x0;this[_0x6c2b('0xc')]='';this[_0x6c2b('0xd')]();this['updateRealtime']();}MailQueue[_0x6c2b('0xe')][_0x6c2b('0xd')]=function(){var _0x332154=this[_0x6c2b('0xa')][_0x6c2b('0xf')];this[_0x6c2b('0xa')]=_[_0x6c2b('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x332154;};MailQueue[_0x6c2b('0xe')][_0x6c2b('0x11')]=function(){this[_0x6c2b('0x12')]=0x0;this[_0x6c2b('0x13')]=0x0;for(var _0x1d6244=0x0;_0x1d6244=0x0?this[_0x6c2b('0x17')]:0x0;var _0x585754={'id':this['id'],'available':this[_0x6c2b('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x6c2b('0x6')],'paused':this['paused'],'waiting':this[_0x6c2b('0xb')]};var _0x5c67c5=md5(JSON[_0x6c2b('0x18')](_0x585754));if(this[_0x6c2b('0xc')]!==_0x5c67c5){this['md5']=_0x5c67c5;io['to'](util['format'](_0x6c2b('0x19'),_0x585754[_0x6c2b('0x6')]))[_0x6c2b('0x1a')]('mail_queue:save',_0x585754);}};module[_0x6c2b('0x1b')]=MailQueue; \ No newline at end of file +var _0x5f4f=['mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','available','stringify','format','mail:queue:%s','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5f4f,0x157));var _0xf5f4=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x5f4f[_0x22cc16];return _0x399b70;};'use strict';var _=require(_0xf5f4('0x0'));var md5=require('md5');var util=require(_0xf5f4('0x1'));var Redis=require(_0xf5f4('0x2'));var config=require(_0xf5f4('0x3'));config[_0xf5f4('0x4')]=_[_0xf5f4('0x5')](config[_0xf5f4('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf5f4('0x6'))(new Redis(config['redis']));function MailQueue(_0x5383f8){this['id']=_0x5383f8['id']||0x0;this['name']=_0x5383f8[_0xf5f4('0x7')]||'';this[_0xf5f4('0x8')]=_0x5383f8['timeout']||0xa;this[_0xf5f4('0x9')]=_0x5383f8[_0xf5f4('0x9')]||_0xf5f4('0xa');this[_0xf5f4('0xb')]=_0x5383f8[_0xf5f4('0xb')];this[_0xf5f4('0xc')]={};this[_0xf5f4('0xd')]=0x0;this[_0xf5f4('0xe')]='';this[_0xf5f4('0xf')]();this['updateRealtime']();}MailQueue[_0xf5f4('0x10')][_0xf5f4('0xf')]=function(){var _0x5cc9c6=this[_0xf5f4('0xc')][_0xf5f4('0x11')];this['mapAgentsId']=_[_0xf5f4('0x12')](this[_0xf5f4('0xb')],'id');this[_0xf5f4('0xc')][_0xf5f4('0x11')]=_0x5cc9c6;};MailQueue[_0xf5f4('0x10')][_0xf5f4('0x13')]=function(){this['loggedIn']=0x0;this[_0xf5f4('0x14')]=0x0;for(var _0x826bd2=0x0;_0x826bd2=0x0?this['available']:0x0;var _0x235057={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf5f4('0x7')],'paused':this[_0xf5f4('0x14')],'waiting':this[_0xf5f4('0xd')]};var _0x1d8c9f=md5(JSON[_0xf5f4('0x19')](_0x235057));if(this[_0xf5f4('0xe')]!==_0x1d8c9f){this['md5']=_0x1d8c9f;io['to'](util[_0xf5f4('0x1a')](_0xf5f4('0x1b'),_0x235057[_0xf5f4('0x7')]))[_0xf5f4('0x1c')](_0xf5f4('0x1d'),_0x235057);}};module[_0xf5f4('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 1ac9d30..8214f6d 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x2ef3,0xba));var _0x32ef=function(_0x169166,_0xade80e){_0x169166=_0x169166-0x0;var _0x1646c5=_0x2ef3[_0x169166];return _0x1646c5;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x4fc756,_0x5969c9){var _0x6b1861=function(_0x1d76e7){while(--_0x1d76e7){_0x4fc756['push'](_0x4fc756['shift']());}};_0x6b1861(++_0x5969c9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x5fc3[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 3796400..26ab46d 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 _0xa631=['sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x516e50,_0x44e23b){var _0x22e860=function(_0x2abff2){while(--_0x2abff2){_0x516e50['push'](_0x516e50['shift']());}};_0x22e860(++_0x44e23b);}(_0xa631,0xe4));var _0x1a63=function(_0x1e98da,_0x236c3b){_0x1e98da=_0x1e98da-0x0;var _0x23e301=_0xa631[_0x1e98da];return _0x23e301;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function SmsQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}SmsQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};SmsQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=SmsQueue; \ No newline at end of file +var _0xb0b9=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','map','updateRealtime','length','online','loggedIn','smsPause','paused','available','format','emit','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3a96c5,_0xf7eee3){_0x3a96c5=_0x3a96c5-0x0;var _0x42da29=_0xb0b9[_0x3a96c5];return _0x42da29;};'use strict';var _=require(_0x9b0b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9b0b('0x1'));var config=require(_0x9b0b('0x2'));config[_0x9b0b('0x3')]=_[_0x9b0b('0x4')](config[_0x9b0b('0x3')],{'host':_0x9b0b('0x5'),'port':0x18eb});var io=require(_0x9b0b('0x6'))(new Redis(config[_0x9b0b('0x3')]));function SmsQueue(_0x2b89dc){this['id']=_0x2b89dc['id']||0x0;this[_0x9b0b('0x7')]=_0x2b89dc[_0x9b0b('0x7')]||'';this[_0x9b0b('0x8')]=_0x2b89dc[_0x9b0b('0x8')]||0xa;this[_0x9b0b('0x9')]=_0x2b89dc['strategy']||'beepall';this[_0x9b0b('0xa')]=_0x2b89dc[_0x9b0b('0xa')];this[_0x9b0b('0xb')]={};this[_0x9b0b('0xc')]=0x0;this[_0x9b0b('0xd')]='';this[_0x9b0b('0xe')]();this['updateRealtime']();}SmsQueue[_0x9b0b('0xf')][_0x9b0b('0xe')]=function(){var _0x2ae7a2=this[_0x9b0b('0xb')]['_rr'];this['mapAgentsId']=_[_0x9b0b('0x10')](this['Agents'],'id');this[_0x9b0b('0xb')]['_rr']=_0x2ae7a2;};SmsQueue[_0x9b0b('0xf')][_0x9b0b('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5f0555=0x0;_0x5f0555=0x0?this[_0x9b0b('0x17')]:0x0;var _0x3f2733={'id':this['id'],'available':this[_0x9b0b('0x17')],'loggedIn':this[_0x9b0b('0x14')],'name':this['name'],'paused':this[_0x9b0b('0x16')],'waiting':this[_0x9b0b('0xc')]};var _0x7cf37c=md5(JSON['stringify'](_0x3f2733));if(this[_0x9b0b('0xd')]!==_0x7cf37c){this[_0x9b0b('0xd')]=_0x7cf37c;io['to'](util[_0x9b0b('0x18')]('sms:queue:%s',_0x3f2733[_0x9b0b('0x7')]))[_0x9b0b('0x19')](_0x9b0b('0x1a'),_0x3f2733);}};module[_0x9b0b('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 197d14a..4abf0c9 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 _0x546e=['redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','loggedIn','online','paused','available','stringify','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x5f3378,_0x55b77a){var _0x2d8566=function(_0x5766b5){while(--_0x5766b5){_0x5f3378['push'](_0x5f3378['shift']());}};_0x2d8566(++_0x55b77a);}(_0x546e,0x1cf));var _0xe546=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x546e[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xe546('0x0'));var md5=require(_0xe546('0x1'));var util=require(_0xe546('0x2'));var Redis=require(_0xe546('0x3'));var config=require(_0xe546('0x4'));config[_0xe546('0x5')]=_[_0xe546('0x6')](config[_0xe546('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe546('0x7'))(new Redis(config[_0xe546('0x5')]));function WhatsappQueue(_0x3434c1){this['id']=_0x3434c1['id']||0x0;this[_0xe546('0x8')]=_0x3434c1[_0xe546('0x8')]||'';this[_0xe546('0x9')]=_0x3434c1[_0xe546('0x9')]||0xa;this[_0xe546('0xa')]=_0x3434c1[_0xe546('0xa')]||_0xe546('0xb');this[_0xe546('0xc')]=_0x3434c1[_0xe546('0xc')];this['mapAgentsId']={};this[_0xe546('0xd')]=0x0;this['md5']='';this[_0xe546('0xe')]();this[_0xe546('0xf')]();}WhatsappQueue['prototype'][_0xe546('0xe')]=function(){var _0x1e1129=this[_0xe546('0x10')]['_rr'];this[_0xe546('0x10')]=_['map'](this[_0xe546('0xc')],'id');this['mapAgentsId'][_0xe546('0x11')]=_0x1e1129;};WhatsappQueue['prototype'][_0xe546('0xf')]=function(){this[_0xe546('0x12')]=0x0;this['paused']=0x0;for(var _0xccea21=0x0;_0xccea21=0x0?this[_0xe546('0x15')]:0x0;var _0x73b613={'id':this['id'],'available':this[_0xe546('0x15')],'loggedIn':this[_0xe546('0x12')],'name':this[_0xe546('0x8')],'paused':this[_0xe546('0x14')],'waiting':this[_0xe546('0xd')]};var _0x3d47a8=md5(JSON[_0xe546('0x16')](_0x73b613));if(this[_0xe546('0x1')]!==_0x3d47a8){this[_0xe546('0x1')]=_0x3d47a8;io['to'](util[_0xe546('0x17')]('whatsapp:queue:%s',_0x73b613[_0xe546('0x8')]))[_0xe546('0x18')](_0xe546('0x19'),_0x73b613);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xe1f4=['mapAgentsId','map','paused','length','online','loggedIn','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','_rr'];(function(_0x895e19,_0xe7f8c3){var _0x3c7a5e=function(_0x11acd4){while(--_0x11acd4){_0x895e19['push'](_0x895e19['shift']());}};_0x3c7a5e(++_0xe7f8c3);}(_0xe1f4,0x180));var _0x4e1f=function(_0x541f6e,_0x4d0c81){_0x541f6e=_0x541f6e-0x0;var _0x3ee0db=_0xe1f4[_0x541f6e];return _0x3ee0db;};'use strict';var _=require(_0x4e1f('0x0'));var md5=require('md5');var util=require(_0x4e1f('0x1'));var Redis=require(_0x4e1f('0x2'));var config=require(_0x4e1f('0x3'));config[_0x4e1f('0x4')]=_[_0x4e1f('0x5')](config[_0x4e1f('0x4')],{'host':_0x4e1f('0x6'),'port':0x18eb});var io=require(_0x4e1f('0x7'))(new Redis(config[_0x4e1f('0x4')]));function WhatsappQueue(_0x1b8bd8){this['id']=_0x1b8bd8['id']||0x0;this['name']=_0x1b8bd8[_0x4e1f('0x8')]||'';this[_0x4e1f('0x9')]=_0x1b8bd8[_0x4e1f('0x9')]||0xa;this[_0x4e1f('0xa')]=_0x1b8bd8[_0x4e1f('0xa')]||_0x4e1f('0xb');this[_0x4e1f('0xc')]=_0x1b8bd8[_0x4e1f('0xc')];this['mapAgentsId']={};this[_0x4e1f('0xd')]=0x0;this[_0x4e1f('0xe')]='';this[_0x4e1f('0xf')]();this[_0x4e1f('0x10')]();}WhatsappQueue[_0x4e1f('0x11')][_0x4e1f('0xf')]=function(){var _0x2840c7=this['mapAgentsId'][_0x4e1f('0x12')];this[_0x4e1f('0x13')]=_[_0x4e1f('0x14')](this[_0x4e1f('0xc')],'id');this['mapAgentsId'][_0x4e1f('0x12')]=_0x2840c7;};WhatsappQueue['prototype'][_0x4e1f('0x10')]=function(){this['loggedIn']=0x0;this[_0x4e1f('0x15')]=0x0;for(var _0x533c13=0x0;_0x533c13=0x0?this[_0x4e1f('0x19')]:0x0;var _0x3219bc={'id':this['id'],'available':this[_0x4e1f('0x19')],'loggedIn':this[_0x4e1f('0x18')],'name':this['name'],'paused':this[_0x4e1f('0x15')],'waiting':this[_0x4e1f('0xd')]};var _0x2e5413=md5(JSON[_0x4e1f('0x1a')](_0x3219bc));if(this[_0x4e1f('0xe')]!==_0x2e5413){this[_0x4e1f('0xe')]=_0x2e5413;io['to'](util[_0x4e1f('0x1b')](_0x4e1f('0x1c'),_0x3219bc['name']))[_0x4e1f('0x1d')](_0x4e1f('0x1e'),_0x3219bc);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ca30a2e..9909bd9 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(_0x470d64,_0x48eec8){var _0x445f70=function(_0x29af33){while(--_0x29af33){_0x470d64['push'](_0x470d64['shift']());}};_0x445f70(++_0x48eec8);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e24d7,_0x11218f){_0x5e24d7=_0x5e24d7-0x0;var _0x10063d=_0xb10b[_0x5e24d7];return _0x10063d;};'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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 5e0bfec..9e5b91d 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 _0x4b20=['updateChatInteraction','addTags','AddTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x4b20,0x1bf));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x04b2('0x0')]=function(_0x35e7b5,_0x10e4aa){return client[_0x04b2('0x1')](_0x04b2('0x2'),{'body':_0x10e4aa,'options':{'where':{'id':_0x35e7b5}},'log':_0x04b2('0x3')});};exports[_0x04b2('0x4')]=function(_0x215b8a,_0x48c1fb){return client['Request'](_0x04b2('0x5'),{'body':_0x48c1fb,'options':{'where':{'id':_0x215b8a}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xe742=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x36d28d,_0x5a9e25){var _0x361848=function(_0x569326){while(--_0x569326){_0x36d28d['push'](_0x36d28d['shift']());}};_0x361848(++_0x5a9e25);}(_0xe742,0x1c9));var _0x2e74=function(_0x4bddff,_0x51d2c6){_0x4bddff=_0x4bddff-0x0;var _0x22415f=_0xe742[_0x4bddff];return _0x22415f;};'use strict';var client=require(_0x2e74('0x0'));exports[_0x2e74('0x1')]=function(_0x3876e4,_0x8a8570){return client[_0x2e74('0x2')](_0x2e74('0x3'),{'body':_0x8a8570,'options':{'where':{'id':_0x3876e4}},'log':_0x2e74('0x4')});};exports[_0x2e74('0x5')]=function(_0x244baa,_0x50715c){return client['Request'](_0x2e74('0x6'),{'body':_0x50715c,'options':{'where':{'id':_0x244baa}},'log':_0x2e74('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2b19eab..0283f8d 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 _0x800c=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x26645b,_0x2c2d9b){var _0x224520=function(_0x3ab38e){while(--_0x3ab38e){_0x26645b['push'](_0x26645b['shift']());}};_0x224520(++_0x2c2d9b);}(_0x800c,0x79));var _0xc800=function(_0x2e782b,_0x353bb8){_0x2e782b=_0x2e782b-0x0;var _0x15af22=_0x800c[_0x2e782b];return _0x15af22;};'use strict';var client=require(_0xc800('0x0'));exports['create']=function(_0x7a55e2){return client[_0xc800('0x1')](_0xc800('0x2'),{'body':_0x7a55e2,'log':_0xc800('0x3')});}; \ No newline at end of file +var _0x05c5=['CreateChatMessage','Request'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_0x05c5,0x183));var _0x505c=function(_0x171bef,_0x4cba08){_0x171bef=_0x171bef-0x0;var _0x28828a=_0x05c5[_0x171bef];return _0x28828a;};'use strict';var client=require('../client');exports['create']=function(_0x258fec){return client[_0x505c('0x0')](_0x505c('0x1'),{'body':_0x258fec,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 6e3ea17..bec5c04 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 _0x2eb2=['Request','GetChatQueue','name','timeout','strategy','Agents','chatPause','getChatQueues'];(function(_0x432b07,_0x9de483){var _0x40bc0f=function(_0x166a61){while(--_0x166a61){_0x432b07['push'](_0x432b07['shift']());}};_0x40bc0f(++_0x9de483);}(_0x2eb2,0x19f));var _0x22eb=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2eb2[_0x42245d];return _0x4b211a;};'use strict';var client=require('../client');exports[_0x22eb('0x0')]=function(){return function(){return client[_0x22eb('0x1')](_0x22eb('0x2'),{'options':{'raw':![],'attributes':['id',_0x22eb('0x3'),_0x22eb('0x4'),_0x22eb('0x5')],'include':[{'model':'User','as':_0x22eb('0x6'),'attributes':['id','name','online',_0x22eb('0x7')]}]},'log':_0x22eb('0x0')});};}; \ No newline at end of file +var _0xe8f7=['getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','User','Agents','chatPause'];(function(_0x28ec22,_0x426685){var _0xabd1bf=function(_0x563e83){while(--_0x563e83){_0x28ec22['push'](_0x28ec22['shift']());}};_0xabd1bf(++_0x426685);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7e8f('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x7e8f('0x1')](_0x7e8f('0x2'),{'options':{'raw':![],'attributes':['id',_0x7e8f('0x3'),_0x7e8f('0x4'),_0x7e8f('0x5')],'include':[{'model':_0x7e8f('0x6'),'as':_0x7e8f('0x7'),'attributes':['id','name','online',_0x7e8f('0x8')]}]},'log':_0x7e8f('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0ad7fac..9c5888a 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 _0x6c4b=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x38b676,_0xec2253){var _0xdc78cf=function(_0x56c0f7){while(--_0x56c0f7){_0x38b676['push'](_0x38b676['shift']());}};_0xdc78cf(++_0xec2253);}(_0x6c4b,0x93));var _0xb6c4=function(_0x1b3a69,_0x5d481e){_0x1b3a69=_0x1b3a69-0x0;var _0x4df5b2=_0x6c4b[_0x1b3a69];return _0x4df5b2;};'use strict';var client=require(_0xb6c4('0x0'));exports[_0xb6c4('0x1')]=function(_0x18a0e2){return client['Request'](_0xb6c4('0x2'),{'body':_0x18a0e2,'log':_0xb6c4('0x2')});};exports[_0xb6c4('0x3')]=function(_0x794568,_0x459ef7){return client[_0xb6c4('0x4')]('UpdateChatQueueReport',{'body':_0x459ef7,'options':{'where':{'uniqueid':_0x794568},'order':[['id','DESC']],'limit':0x1},'log':_0xb6c4('0x5')});}; \ No newline at end of file +var _0xcb81=['../client','create','Request','UpdateChatQueueReport','DESC'];(function(_0x14cf75,_0x1e6552){var _0x64ec6a=function(_0x35968a){while(--_0x35968a){_0x14cf75['push'](_0x14cf75['shift']());}};_0x64ec6a(++_0x1e6552);}(_0xcb81,0x154));var _0x1cb8=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0xcb81[_0x493a51];return _0xc85756;};'use strict';var client=require(_0x1cb8('0x0'));exports[_0x1cb8('0x1')]=function(_0x5081c6){return client[_0x1cb8('0x2')]('CreateChatQueueReport',{'body':_0x5081c6,'log':'CreateChatQueueReport'});};exports['update']=function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x2')](_0x1cb8('0x3'),{'body':_0x33a8f2,'options':{'where':{'uniqueid':_0x38c3ea},'order':[['id',_0x1cb8('0x4')]],'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 9eb98ba..eeadc67 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3b6333,_0x23779d){var _0x16f19c=function(_0x57e938){while(--_0x57e938){_0x3b6333['push'](_0x3b6333['shift']());}};_0x16f19c(++_0x23779d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x7a54,0x106));var _0x47a5=function(_0x40d140,_0x530c1f){_0x40d140=_0x40d140-0x0;var _0x26f33d=_0x7a54[_0x40d140];return _0x26f33d;};'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 111d52b..8746ea5 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 _0x10fa=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x4ecebf,_0x1a3126){var _0x1f5865=function(_0x1bec50){while(--_0x1bec50){_0x4ecebf['push'](_0x4ecebf['shift']());}};_0x1f5865(++_0x1a3126);}(_0x10fa,0xc8));var _0xa10f=function(_0x129289,_0x392b3d){_0x129289=_0x129289-0x0;var _0x5426ef=_0x10fa[_0x129289];return _0x5426ef;};'use strict';var client=require(_0xa10f('0x0'));exports[_0xa10f('0x1')]=function(_0x9c1b88){return client[_0xa10f('0x2')](_0xa10f('0x3'),{'body':_0x9c1b88,'log':_0xa10f('0x4')});}; \ No newline at end of file +var _0x6468=['Request','CreateFaxMessage'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x6468,0x19c));var _0x8646=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6468[_0x5447fd];return _0x15b28a;};'use strict';var client=require('../client');exports['create']=function(_0x6d748b){return client[_0x8646('0x0')](_0x8646('0x1'),{'body':_0x6d748b,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c328094..440c150 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 _0x1a57=['GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues'];(function(_0x37591b,_0x57a95d){var _0x5bfea2=function(_0x31d16f){while(--_0x31d16f){_0x37591b['push'](_0x37591b['shift']());}};_0x5bfea2(++_0x57a95d);}(_0x1a57,0x80));var _0x71a5=function(_0x5bcdba,_0x2cf1d8){_0x5bcdba=_0x5bcdba-0x0;var _0x40f17c=_0x1a57[_0x5bcdba];return _0x40f17c;};'use strict';var client=require(_0x71a5('0x0'));exports[_0x71a5('0x1')]=function(){return function(){return client['Request'](_0x71a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x71a5('0x3'),_0x71a5('0x4'),_0x71a5('0x5')],'include':[{'model':_0x71a5('0x6'),'as':_0x71a5('0x7'),'attributes':['id',_0x71a5('0x3'),_0x71a5('0x8'),_0x71a5('0x9')]}]},'log':_0x71a5('0x1')});};}; \ No newline at end of file +var _0x8eda=['getFaxQueues','Request','name','strategy','User','Agents','online','../client'];(function(_0x25b8ed,_0x334953){var _0x7924ae=function(_0x331eb2){while(--_0x331eb2){_0x25b8ed['push'](_0x25b8ed['shift']());}};_0x7924ae(++_0x334953);}(_0x8eda,0x107));var _0xa8ed=function(_0x12116e,_0x1fe29e){_0x12116e=_0x12116e-0x0;var _0x2f8c21=_0x8eda[_0x12116e];return _0x2f8c21;};'use strict';var client=require(_0xa8ed('0x0'));exports[_0xa8ed('0x1')]=function(){return function(){return client[_0xa8ed('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xa8ed('0x3'),'timeout',_0xa8ed('0x4')],'include':[{'model':_0xa8ed('0x5'),'as':_0xa8ed('0x6'),'attributes':['id',_0xa8ed('0x3'),_0xa8ed('0x7'),'faxPause']}]},'log':_0xa8ed('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d641df3..4e4424c 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 _0x0df7=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','create','Request'];(function(_0x2fcc1f,_0x491de1){var _0x5a06ef=function(_0x28e32a){while(--_0x28e32a){_0x2fcc1f['push'](_0x2fcc1f['shift']());}};_0x5a06ef(++_0x491de1);}(_0x0df7,0x87));var _0x70df=function(_0xf1dca6,_0x5a9572){_0xf1dca6=_0xf1dca6-0x0;var _0xb272c3=_0x0df7[_0xf1dca6];return _0xb272c3;};'use strict';var client=require(_0x70df('0x0'));exports[_0x70df('0x1')]=function(_0x1441f4){return client[_0x70df('0x2')](_0x70df('0x3'),{'body':_0x1441f4,'log':'CreateFaxQueueReport'});};exports[_0x70df('0x4')]=function(_0x2523a9,_0x4761db){return client['Request'](_0x70df('0x5'),{'body':_0x4761db,'options':{'where':{'uniqueid':_0x2523a9},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x19fb=['../client','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x50c4c2,_0x4df4bc){var _0x43d441=function(_0xe82920){while(--_0xe82920){_0x50c4c2['push'](_0x50c4c2['shift']());}};_0x43d441(++_0x4df4bc);}(_0x19fb,0x180));var _0xb19f=function(_0x409b58,_0x4904f3){_0x409b58=_0x409b58-0x0;var _0x15102d=_0x19fb[_0x409b58];return _0x15102d;};'use strict';var client=require(_0xb19f('0x0'));exports['create']=function(_0x29a7c8){return client['Request'](_0xb19f('0x1'),{'body':_0x29a7c8,'log':_0xb19f('0x1')});};exports[_0xb19f('0x2')]=function(_0x3d0638,_0x5bce6f){return client[_0xb19f('0x3')](_0xb19f('0x4'),{'body':_0x5bce6f,'options':{'where':{'uniqueid':_0x3d0638},'order':[['id',_0xb19f('0x5')]],'limit':0x1},'log':_0xb19f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 89b6b89..154dd0d 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 _0x5203=['name','Interval','Intervals','interval','getIntervals','Request','GetInterval'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5203,0x14d));var _0x3520=function(_0x3587e6,_0x1b2552){_0x3587e6=_0x3587e6-0x0;var _0x35e6ee=_0x5203[_0x3587e6];return _0x35e6ee;};'use strict';var client=require('../client');exports[_0x3520('0x0')]=function(){return function(){return client[_0x3520('0x1')](_0x3520('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3520('0x3')],'include':[{'model':_0x3520('0x4'),'as':_0x3520('0x5'),'attributes':['id','name',_0x3520('0x6')]}]},'log':_0x3520('0x0')});};}; \ No newline at end of file +var _0xfaaa=['getIntervals','Request','name','Interval','../client'];(function(_0x2dd4e7,_0x35a133){var _0x13d76c=function(_0x22762d){while(--_0x22762d){_0x2dd4e7['push'](_0x2dd4e7['shift']());}};_0x13d76c(++_0x35a133);}(_0xfaaa,0x68));var _0xafaa=function(_0x4e3a83,_0x4b0d7e){_0x4e3a83=_0x4e3a83-0x0;var _0x372628=_0xfaaa[_0x4e3a83];return _0x372628;};'use strict';var client=require(_0xafaa('0x0'));exports[_0xafaa('0x1')]=function(){return function(){return client[_0xafaa('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xafaa('0x3')],'include':[{'model':_0xafaa('0x4'),'as':'Intervals','attributes':['id',_0xafaa('0x3'),'interval']}]},'log':_0xafaa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c62203c..5c13309 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 _0x66fa=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x2f1f89,_0x19bb27){var _0x4443ef=function(_0x3e1ddc){while(--_0x3e1ddc){_0x2f1f89['push'](_0x2f1f89['shift']());}};_0x4443ef(++_0x19bb27);}(_0x66fa,0x117));var _0xa66f=function(_0x3c731e,_0x34c868){_0x3c731e=_0x3c731e-0x0;var _0x490a7e=_0x66fa[_0x3c731e];return _0x490a7e;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(_0x52947a,_0x1fc161){return client[_0xa66f('0x2')](_0xa66f('0x3'),{'body':_0x1fc161,'options':{'where':{'id':_0x52947a}},'log':_0xa66f('0x4')});};exports[_0xa66f('0x5')]=function(_0x2a2abf,_0x3f4904){return client['Request']('AddTagsToMailInteraction',{'body':_0x3f4904,'options':{'where':{'id':_0x2a2abf}},'log':_0xa66f('0x6')});}; \ No newline at end of file +var _0x627e=['../client','update','Request','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0xd1cf76,_0x1e667d){var _0x580cbf=function(_0x51dc24){while(--_0x51dc24){_0xd1cf76['push'](_0xd1cf76['shift']());}};_0x580cbf(++_0x1e667d);}(_0x627e,0x14a));var _0xe627=function(_0x2ec6a6,_0x23eb27){_0x2ec6a6=_0x2ec6a6-0x0;var _0x8e05eb=_0x627e[_0x2ec6a6];return _0x8e05eb;};'use strict';var client=require(_0xe627('0x0'));exports[_0xe627('0x1')]=function(_0x2cc4b4,_0x18dba3){return client[_0xe627('0x2')]('UpdateMailInteraction',{'body':_0x18dba3,'options':{'where':{'id':_0x2cc4b4}},'log':_0xe627('0x3')});};exports[_0xe627('0x4')]=function(_0x2abdc7,_0x59a2c8){return client['Request']('AddTagsToMailInteraction',{'body':_0x59a2c8,'options':{'where':{'id':_0x2abdc7}},'log':_0xe627('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a3ffd3a..1b8debc 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 _0x406a=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x911aa,_0x5cb8b5){var _0x327202=function(_0x52308e){while(--_0x52308e){_0x911aa['push'](_0x911aa['shift']());}};_0x327202(++_0x5cb8b5);}(_0x406a,0xb0));var _0xa406=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x406a[_0x4b91c4];return _0x25cb80;};'use strict';var client=require(_0xa406('0x0'));exports[_0xa406('0x1')]=function(_0x217dcd){return client[_0xa406('0x2')](_0xa406('0x3'),{'body':_0x217dcd,'log':_0xa406('0x4')});}; \ No newline at end of file +var _0x20b2=['../client','create','Request','CreateMailMessage'];(function(_0x1868b1,_0x74fb6e){var _0x58f512=function(_0x5c135e){while(--_0x5c135e){_0x1868b1['push'](_0x1868b1['shift']());}};_0x58f512(++_0x74fb6e);}(_0x20b2,0x148));var _0x220b=function(_0x117a7d,_0x41ccd4){_0x117a7d=_0x117a7d-0x0;var _0x13fcea=_0x20b2[_0x117a7d];return _0x13fcea;};'use strict';var client=require(_0x220b('0x0'));exports[_0x220b('0x1')]=function(_0x258fff){return client[_0x220b('0x2')](_0x220b('0x3'),{'body':_0x258fff,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index a0b9d57..9b622ba 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 _0xb9f1=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x5879cc,_0x57520a){var _0x1474fd=function(_0x5f1a00){while(--_0x5f1a00){_0x5879cc['push'](_0x5879cc['shift']());}};_0x1474fd(++_0x57520a);}(_0xb9f1,0xfc));var _0x1b9f=function(_0x3d7adf,_0x2558f9){_0x3d7adf=_0x3d7adf-0x0;var _0x2c885d=_0xb9f1[_0x3d7adf];return _0x2c885d;};'use strict';var client=require(_0x1b9f('0x0'));exports[_0x1b9f('0x1')]=function(){return function(){return client[_0x1b9f('0x2')](_0x1b9f('0x3'),{'options':{'raw':![],'attributes':['id',_0x1b9f('0x4'),_0x1b9f('0x5'),_0x1b9f('0x6')],'include':[{'model':_0x1b9f('0x7'),'as':_0x1b9f('0x8'),'attributes':['id',_0x1b9f('0x4'),_0x1b9f('0x9'),_0x1b9f('0xa')]}]},'log':_0x1b9f('0x1')});};}; \ No newline at end of file +var _0xaf73=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x26175f,_0x22b55c){var _0x2dd509=function(_0xa69659){while(--_0xa69659){_0x26175f['push'](_0x26175f['shift']());}};_0x2dd509(++_0x22b55c);}(_0xaf73,0x149));var _0x3af7=function(_0x35de22,_0x218217){_0x35de22=_0x35de22-0x0;var _0x11ae4b=_0xaf73[_0x35de22];return _0x11ae4b;};'use strict';var client=require(_0x3af7('0x0'));exports[_0x3af7('0x1')]=function(){return function(){return client[_0x3af7('0x2')](_0x3af7('0x3'),{'options':{'raw':![],'attributes':['id',_0x3af7('0x4'),_0x3af7('0x5'),_0x3af7('0x6')],'include':[{'model':_0x3af7('0x7'),'as':_0x3af7('0x8'),'attributes':['id',_0x3af7('0x4'),_0x3af7('0x9'),_0x3af7('0xa')]}]},'log':_0x3af7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1fe1193..a841f9b 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 _0x5676=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x409251,_0x40f525){var _0x216f47=function(_0x517895){while(--_0x517895){_0x409251['push'](_0x409251['shift']());}};_0x216f47(++_0x40f525);}(_0x5676,0xe0));var _0x6567=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5676[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6567('0x0'));exports[_0x6567('0x1')]=function(_0x53a251){return client[_0x6567('0x2')](_0x6567('0x3'),{'body':_0x53a251,'log':_0x6567('0x3')});};exports['update']=function(_0x412dbd,_0x5531be){return client[_0x6567('0x2')](_0x6567('0x4'),{'body':_0x5531be,'options':{'where':{'uniqueid':_0x412dbd},'order':[['id',_0x6567('0x5')]],'limit':0x1},'log':_0x6567('0x4')});}; \ No newline at end of file +var _0xf138=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x2b12f7,_0x4033ac){var _0x8cb277=function(_0x713b37){while(--_0x713b37){_0x2b12f7['push'](_0x2b12f7['shift']());}};_0x8cb277(++_0x4033ac);}(_0xf138,0x15b));var _0x8f13=function(_0x327c2c,_0x591f08){_0x327c2c=_0x327c2c-0x0;var _0x1bbe00=_0xf138[_0x327c2c];return _0x1bbe00;};'use strict';var client=require(_0x8f13('0x0'));exports[_0x8f13('0x1')]=function(_0x3fd7ec){return client[_0x8f13('0x2')](_0x8f13('0x3'),{'body':_0x3fd7ec,'log':'CreateMailQueueReport'});};exports[_0x8f13('0x4')]=function(_0x2e3ae8,_0x4e57e2){return client['Request'](_0x8f13('0x5'),{'body':_0x4e57e2,'options':{'where':{'uniqueid':_0x2e3ae8},'order':[['id','DESC']],'limit':0x1},'log':_0x8f13('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a152112..f208596 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 _0x9d50=['AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction','addTags'];(function(_0x87dfc6,_0x160f05){var _0x52711d=function(_0xbce9fd){while(--_0xbce9fd){_0x87dfc6['push'](_0x87dfc6['shift']());}};_0x52711d(++_0x160f05);}(_0x9d50,0xd3));var _0x09d5=function(_0x31bef3,_0x2553c8){_0x31bef3=_0x31bef3-0x0;var _0x4ab043=_0x9d50[_0x31bef3];return _0x4ab043;};'use strict';var client=require(_0x09d5('0x0'));exports[_0x09d5('0x1')]=function(_0x11bf83,_0x1a6f79){return client[_0x09d5('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1a6f79,'options':{'where':{'id':_0x11bf83}},'log':_0x09d5('0x3')});};exports[_0x09d5('0x4')]=function(_0x405957,_0x589679){return client[_0x09d5('0x2')](_0x09d5('0x5'),{'body':_0x589679,'options':{'where':{'id':_0x405957}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xb99b=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x33e566,_0x3e90f4){var _0x828b80=function(_0x2b67d2){while(--_0x2b67d2){_0x33e566['push'](_0x33e566['shift']());}};_0x828b80(++_0x3e90f4);}(_0xb99b,0x199));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xbb99('0x0')]=function(_0x113149,_0x123b47){return client[_0xbb99('0x1')](_0xbb99('0x2'),{'body':_0x123b47,'options':{'where':{'id':_0x113149}},'log':_0xbb99('0x3')});};exports[_0xbb99('0x4')]=function(_0x41590c,_0x31f213){return client[_0xbb99('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x31f213,'options':{'where':{'id':_0x41590c}},'log':_0xbb99('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b2ea4df..7aad66d 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 _0xdfd6=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x3c2a87,_0x301e33){var _0x3a4efd=function(_0x2c5e19){while(--_0x2c5e19){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x3a4efd(++_0x301e33);}(_0xdfd6,0x1c7));var _0x6dfd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdfd6[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x6dfd('0x0'));exports[_0x6dfd('0x1')]=function(_0x3d9c43){return client[_0x6dfd('0x2')](_0x6dfd('0x3'),{'body':_0x3d9c43,'log':_0x6dfd('0x4')});}; \ No newline at end of file +var _0x0488=['create','Request','createOpenchannelMessage'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x0488,0x1dd));var _0x8048=function(_0x203748,_0x210a2d){_0x203748=_0x203748-0x0;var _0x54839c=_0x0488[_0x203748];return _0x54839c;};'use strict';var client=require('../client');exports[_0x8048('0x0')]=function(_0x194676){return client[_0x8048('0x1')]('CreateOpenchannelMessage',{'body':_0x194676,'log':_0x8048('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 57bbe3e..ea940e3 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 _0x1c99=['openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name','strategy','User','Agents','online'];(function(_0x3e8b7b,_0x521464){var _0xa5f85c=function(_0x9b8974){while(--_0x9b8974){_0x3e8b7b['push'](_0x3e8b7b['shift']());}};_0xa5f85c(++_0x521464);}(_0x1c99,0xf4));var _0x91c9=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x1c99[_0x334651];return _0x29657c;};'use strict';var client=require(_0x91c9('0x0'));exports[_0x91c9('0x1')]=function(){return function(){return client['Request'](_0x91c9('0x2'),{'options':{'raw':![],'attributes':['id',_0x91c9('0x3'),'timeout',_0x91c9('0x4')],'include':[{'model':_0x91c9('0x5'),'as':_0x91c9('0x6'),'attributes':['id',_0x91c9('0x3'),_0x91c9('0x7'),_0x91c9('0x8')]}]},'log':_0x91c9('0x1')});};}; \ No newline at end of file +var _0x2567=['openchannelPause','GetOpenchannelQueue','name','online'];(function(_0x129e27,_0x4f87d3){var _0x802f6b=function(_0x1f257f){while(--_0x1f257f){_0x129e27['push'](_0x129e27['shift']());}};_0x802f6b(++_0x4f87d3);}(_0x2567,0xdd));var _0x7256=function(_0x3d2f63,_0x590356){_0x3d2f63=_0x3d2f63-0x0;var _0x35979c=_0x2567[_0x3d2f63];return _0x35979c;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x7256('0x0'),{'options':{'raw':![],'attributes':['id',_0x7256('0x1'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7256('0x1'),_0x7256('0x2'),_0x7256('0x3')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 69e463b..46771a4 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 _0x09a5=['DESC','../client','create','Request','update','UpdateOpenchannelQueueReport'];(function(_0x5ea3b8,_0x4ea341){var _0x523a25=function(_0x1cf901){while(--_0x1cf901){_0x5ea3b8['push'](_0x5ea3b8['shift']());}};_0x523a25(++_0x4ea341);}(_0x09a5,0x8b));var _0x509a=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x09a5[_0x5d80de];return _0x1c7556;};'use strict';var client=require(_0x509a('0x0'));exports[_0x509a('0x1')]=function(_0x4b2db5){return client[_0x509a('0x2')]('CreateOpenchannelQueueReport',{'body':_0x4b2db5,'log':'CreateOpenchannelQueueReport'});};exports[_0x509a('0x3')]=function(_0x3c4c87,_0x4a69a9){return client[_0x509a('0x2')](_0x509a('0x4'),{'body':_0x4a69a9,'options':{'where':{'uniqueid':_0x3c4c87},'order':[['id',_0x509a('0x5')]],'limit':0x1},'log':_0x509a('0x4')});}; \ No newline at end of file +var _0x2953=['../client','Request','update','UpdateOpenchannelQueueReport'];(function(_0x54cab8,_0x342a7e){var _0x435855=function(_0x3f7993){while(--_0x3f7993){_0x54cab8['push'](_0x54cab8['shift']());}};_0x435855(++_0x342a7e);}(_0x2953,0x1cc));var _0x3295=function(_0x225d09,_0x527675){_0x225d09=_0x225d09-0x0;var _0x5b5c09=_0x2953[_0x225d09];return _0x5b5c09;};'use strict';var client=require(_0x3295('0x0'));exports['create']=function(_0x3e50a1){return client[_0x3295('0x1')]('CreateOpenchannelQueueReport',{'body':_0x3e50a1,'log':'CreateOpenchannelQueueReport'});};exports[_0x3295('0x2')]=function(_0x37469c,_0x33502b){return client[_0x3295('0x1')](_0x3295('0x3'),{'body':_0x33502b,'options':{'where':{'uniqueid':_0x37469c},'order':[['id','DESC']],'limit':0x1},'log':_0x3295('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d314d80..02b14aa 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 _0x7250=['addTags','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x7250,0x1b1));var _0x0725=function(_0x468925,_0x52bd86){_0x468925=_0x468925-0x0;var _0x1eeb97=_0x7250[_0x468925];return _0x1eeb97;};'use strict';var client=require(_0x0725('0x0'));exports[_0x0725('0x1')]=function(_0x56da03,_0x3ecf7f){return client[_0x0725('0x2')](_0x0725('0x3'),{'body':_0x3ecf7f,'options':{'where':{'id':_0x56da03}},'log':_0x0725('0x4')});};exports[_0x0725('0x5')]=function(_0x4724ef,_0x53cc59){return client[_0x0725('0x2')]('AddTagsToSmsInteraction',{'body':_0x53cc59,'options':{'where':{'id':_0x4724ef}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xe292=['updateSmsInteraction','addTags','Request'];(function(_0x56c1b5,_0x13328f){var _0x11e97b=function(_0x110dad){while(--_0x110dad){_0x56c1b5['push'](_0x56c1b5['shift']());}};_0x11e97b(++_0x13328f);}(_0xe292,0x19e));var _0x2e29=function(_0x1cfa09,_0x68311b){_0x1cfa09=_0x1cfa09-0x0;var _0x467061=_0xe292[_0x1cfa09];return _0x467061;};'use strict';var client=require('../client');exports['update']=function(_0x325ad7,_0x2f1736){return client['Request']('UpdateSmsInteraction',{'body':_0x2f1736,'options':{'where':{'id':_0x325ad7}},'log':_0x2e29('0x0')});};exports[_0x2e29('0x1')]=function(_0x4fec69,_0x59d723){return client[_0x2e29('0x2')]('AddTagsToSmsInteraction',{'body':_0x59d723,'options':{'where':{'id':_0x4fec69}},'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 70c6902..e6bf775 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 _0xccf1=['CreateSmsMessage','create'];(function(_0x169e4c,_0x3ea606){var _0x485da1=function(_0xf6a3b7){while(--_0xf6a3b7){_0x169e4c['push'](_0x169e4c['shift']());}};_0x485da1(++_0x3ea606);}(_0xccf1,0x153));var _0x1ccf=function(_0x407549,_0x5a82f7){_0x407549=_0x407549-0x0;var _0x3a5f19=_0xccf1[_0x407549];return _0x3a5f19;};'use strict';var client=require('../client');exports[_0x1ccf('0x0')]=function(_0xaf66d7){return client['Request'](_0x1ccf('0x1'),{'body':_0xaf66d7,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x2825=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x3c6a9a,_0x4efaed){var _0x23f1a6=function(_0xa7905f){while(--_0xa7905f){_0x3c6a9a['push'](_0x3c6a9a['shift']());}};_0x23f1a6(++_0x4efaed);}(_0x2825,0xa2));var _0x5282=function(_0x550ac2,_0x3dbbab){_0x550ac2=_0x550ac2-0x0;var _0x95d7e=_0x2825[_0x550ac2];return _0x95d7e;};'use strict';var client=require('../client');exports[_0x5282('0x0')]=function(_0x455871){return client[_0x5282('0x1')](_0x5282('0x2'),{'body':_0x455871,'log':_0x5282('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 70cada7..bf90bd0 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x5aae0b,_0x4fa82e){var _0x828f9e=function(_0x53e2a3){while(--_0x53e2a3){_0x5aae0b['push'](_0x5aae0b['shift']());}};_0x828f9e(++_0x4fa82e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x15215a,_0x513ba9){var _0x404125=function(_0x5e4d05){while(--_0x5e4d05){_0x15215a['push'](_0x15215a['shift']());}};_0x404125(++_0x513ba9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 6cfe8fd..e657731 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2e5069,_0x3a1115){var _0x2f00ad=function(_0x3cba4f){while(--_0x3cba4f){_0x2e5069['push'](_0x2e5069['shift']());}};_0x2f00ad(++_0x3a1115);}(_0x008c,0x188));var _0xc008=function(_0x1c80bd,_0x356976){_0x1c80bd=_0x1c80bd-0x0;var _0x15b7fc=_0x008c[_0x1c80bd];return _0x15b7fc;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5080af,_0x3cbca9){var _0x368f2c=function(_0x59c498){while(--_0x59c498){_0x5080af['push'](_0x5080af['shift']());}};_0x368f2c(++_0x3cbca9);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 444ff49..96bea8b 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(_0x3da9e6,_0x11ee45){var _0x53f8be=function(_0x43d1f1){while(--_0x43d1f1){_0x3da9e6['push'](_0x3da9e6['shift']());}};_0x53f8be(++_0x11ee45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x318554,_0x22a74a){var _0x4e5233=function(_0x4d82cd){while(--_0x4d82cd){_0x318554['push'](_0x318554['shift']());}};_0x4e5233(++_0x22a74a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 1aad89c..5cdf9d8 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 _0x3f96=['update','Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client'];(function(_0x2aeffd,_0x5e0ce5){var _0x5ae8bb=function(_0x1b7648){while(--_0x1b7648){_0x2aeffd['push'](_0x2aeffd['shift']());}};_0x5ae8bb(++_0x5e0ce5);}(_0x3f96,0x1d3));var _0x63f9=function(_0x11771c,_0x54168f){_0x11771c=_0x11771c-0x0;var _0x411722=_0x3f96[_0x11771c];return _0x411722;};'use strict';var client=require(_0x63f9('0x0'));exports[_0x63f9('0x1')]=function(_0x3c7b05,_0x1feae5){return client[_0x63f9('0x2')]('UpdateWhatsappInteraction',{'body':_0x1feae5,'options':{'where':{'id':_0x3c7b05}},'log':_0x63f9('0x3')});};exports[_0x63f9('0x4')]=function(_0x859291,_0x26ff58){return client[_0x63f9('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x26ff58,'options':{'where':{'id':_0x859291}},'log':_0x63f9('0x5')});}; \ No newline at end of file +var _0xa93e=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','UpdateWhatsappInteraction'];(function(_0x36a217,_0x4a7a90){var _0x186433=function(_0x2d6151){while(--_0x2d6151){_0x36a217['push'](_0x36a217['shift']());}};_0x186433(++_0x4a7a90);}(_0xa93e,0x1df));var _0xea93=function(_0x1fea51,_0x217ccd){_0x1fea51=_0x1fea51-0x0;var _0x235184=_0xa93e[_0x1fea51];return _0x235184;};'use strict';var client=require('../client');exports['update']=function(_0x25877f,_0x302cc5){return client['Request'](_0xea93('0x0'),{'body':_0x302cc5,'options':{'where':{'id':_0x25877f}},'log':'updateWhatsappInteraction'});};exports[_0xea93('0x1')]=function(_0x5b5341,_0x5398ba){return client[_0xea93('0x2')](_0xea93('0x3'),{'body':_0x5398ba,'options':{'where':{'id':_0x5b5341}},'log':_0xea93('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index db4f682..c48c6d9 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 _0x0ae3=['../client','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x27ded7,_0x426336){var _0x1a81ee=function(_0x310ecd){while(--_0x310ecd){_0x27ded7['push'](_0x27ded7['shift']());}};_0x1a81ee(++_0x426336);}(_0x0ae3,0x10e));var _0x30ae=function(_0x484c48,_0x365b04){_0x484c48=_0x484c48-0x0;var _0x3919cf=_0x0ae3[_0x484c48];return _0x3919cf;};'use strict';var client=require(_0x30ae('0x0'));exports['create']=function(_0x642eca){return client['Request'](_0x30ae('0x1'),{'body':_0x642eca,'log':_0x30ae('0x2')});}; \ No newline at end of file +var _0xc5f2=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x348681,_0x486a1d){var _0x30d4b7=function(_0x4b6cb1){while(--_0x4b6cb1){_0x348681['push'](_0x348681['shift']());}};_0x30d4b7(++_0x486a1d);}(_0xc5f2,0x198));var _0x2c5f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc5f2[_0x42cae2];return _0x5f256f;};'use strict';var client=require('../client');exports['create']=function(_0x41ba97){return client[_0x2c5f('0x0')](_0x2c5f('0x1'),{'body':_0x41ba97,'log':_0x2c5f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b91ad8f..3c2f5b6 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 _0x98da=['Request','User','Agents','name','online','../client','getWhatsappQueues'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x98da,0x1da));var _0xa98d=function(_0x364c25,_0x5c6f52){_0x364c25=_0x364c25-0x0;var _0xc9bd11=_0x98da[_0x364c25];return _0xc9bd11;};'use strict';var client=require(_0xa98d('0x0'));exports[_0xa98d('0x1')]=function(){return function(){return client[_0xa98d('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xa98d('0x3'),'as':_0xa98d('0x4'),'attributes':['id',_0xa98d('0x5'),_0xa98d('0x6'),'whatsappPause']}]},'log':_0xa98d('0x1')});};}; \ No newline at end of file +var _0x398b=['name','timeout','strategy','User','Agents','getWhatsappQueues','Request'];(function(_0x247423,_0x512406){var _0x28ee60=function(_0x19fea2){while(--_0x19fea2){_0x247423['push'](_0x247423['shift']());}};_0x28ee60(++_0x512406);}(_0x398b,0x1c6));var _0xb398=function(_0x5eb24d,_0xa71a6f){_0x5eb24d=_0x5eb24d-0x0;var _0x4d4507=_0x398b[_0x5eb24d];return _0x4d4507;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xb398('0x0')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb398('0x1'),_0xb398('0x2'),_0xb398('0x3')],'include':[{'model':_0xb398('0x4'),'as':_0xb398('0x5'),'attributes':['id',_0xb398('0x1'),'online','whatsappPause']}]},'log':_0xb398('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5ec0954..a060899 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 _0x3bdc=['update','UpdateWhatsappQueueReport','create','Request','CreateWhatsappQueueReport'];(function(_0x54719a,_0x18502a){var _0x11838a=function(_0xa5cafc){while(--_0xa5cafc){_0x54719a['push'](_0x54719a['shift']());}};_0x11838a(++_0x18502a);}(_0x3bdc,0x1c9));var _0xc3bd=function(_0x22e9cf,_0x3c4f7d){_0x22e9cf=_0x22e9cf-0x0;var _0xd53874=_0x3bdc[_0x22e9cf];return _0xd53874;};'use strict';var client=require('../client');exports[_0xc3bd('0x0')]=function(_0x37b489){return client[_0xc3bd('0x1')](_0xc3bd('0x2'),{'body':_0x37b489,'log':_0xc3bd('0x2')});};exports[_0xc3bd('0x3')]=function(_0x4e99c1,_0x4fc313){return client['Request'](_0xc3bd('0x4'),{'body':_0x4fc313,'options':{'where':{'uniqueid':_0x4e99c1},'order':[['id','DESC']],'limit':0x1},'log':_0xc3bd('0x4')});}; \ No newline at end of file +var _0x5879=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x6bb511,_0x1196aa){var _0x573820=function(_0x3c8258){while(--_0x3c8258){_0x6bb511['push'](_0x6bb511['shift']());}};_0x573820(++_0x1196aa);}(_0x5879,0x1da));var _0x9587=function(_0xe0185f,_0x1ce304){_0xe0185f=_0xe0185f-0x0;var _0x294204=_0x5879[_0xe0185f];return _0x294204;};'use strict';var client=require(_0x9587('0x0'));exports[_0x9587('0x1')]=function(_0x20c408){return client[_0x9587('0x2')]('CreateWhatsappQueueReport',{'body':_0x20c408,'log':_0x9587('0x3')});};exports[_0x9587('0x4')]=function(_0x4aafa4,_0x401312){return client[_0x9587('0x2')](_0x9587('0x5'),{'body':_0x401312,'options':{'where':{'uniqueid':_0x4aafa4},'order':[['id',_0x9587('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 649dc37..c5c5745 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 _0x350d=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','map','join','find','timeout','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','complete','next'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x350d,0x12e));var _0xd350=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x350d[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xd350('0x0'));var _=require(_0xd350('0x1'));var util=require('util');var seqqueue=require(_0xd350('0x2'));var logger=require(_0xd350('0x3'))(_0xd350('0x4'));var strategy=require(_0xd350('0x5'));var queue=schema({'name':{'type':_0xd350('0x6'),'required':!![],'message':_0xd350('0x7')},'timeout':{'type':'number','message':_0xd350('0x8')}});function writeLog(_0x822f47,_0x454146,_0x284974){return logger[_0xd350('0x9')](util['format'](_0xd350('0xa'),_0x822f47,_0x454146[_0xd350('0xb')],_0x284974));}function handleFindAgent(_0x44bc7f){return function(_0x1eb40b){return _0x1eb40b['name']['toLowerCase']()===_0x44bc7f['toLowerCase']();};}exports[_0xd350('0xc')]=function(_0xc5ba74,_0x236956,_0x255f0b,_0x322a22){return function(_0x50c380){try{var _0x270610={'name':_0x236956[0x0],'timeout':_0x236956[0x1]};var _0x5ad3cd=queue[_0xd350('0x0')](_0x270610,{'typecast':!![]});if(_0x5ad3cd[_0xd350('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0xc5ba74,_[_0xd350('0xe')](_0x5ad3cd,'message')[_0xd350('0xf')](',\x20'));_0x50c380['stop']();}else{var _0x32cf6e=_[_0xd350('0x10')](_0x255f0b['agents'],handleFindAgent(_0x270610['name']));if(_0x32cf6e){var _0x19ecc8=(_0x270610[_0xd350('0x11')]||0xa)*0x3e8;var _0x336729,_0x4ef080;var _0x43f1c4=seqqueue[_0xd350('0x12')](_0x19ecc8);_0x43f1c4['id']=_0xc5ba74;_0x43f1c4[_0xd350('0x13')]=_0x19ecc8;_0x43f1c4[_0xd350('0x14')]=_0x322a22['channel'];writeLog(_0xc5ba74,_0x32cf6e,util['format'](_0xd350('0x15'),_0x19ecc8));_0x255f0b['rules'][_0xc5ba74]['on']('end',function(){logger[_0xd350('0x9')](_0xd350('0x16'),_0xc5ba74);clearTimeout(_0x4ef080);_0x4ef080=undefined;_0x43f1c4[_0xd350('0x17')]();if(_0x255f0b[_0xd350('0x18')][_0xc5ba74]){delete _0x255f0b[_0xd350('0x18')][_0xc5ba74];}_0x50c380[_0xd350('0x19')]();});_0x255f0b['rules'][_0xc5ba74]['on'](_0xd350('0x1a'),function(){if(_0x255f0b[_0xd350('0x18')][_0xc5ba74]){delete _0x255f0b['rules'][_0xc5ba74];}});_0x4ef080=setTimeout(function(){logger[_0xd350('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0xc5ba74);clearTimeout(_0x4ef080);_0x43f1c4['close']();_0x50c380[_0xd350('0x1b')]();},_0x19ecc8);strategy['agent'](_0x43f1c4,_0x32cf6e,_0x255f0b,_0x322a22);}else{logger['error'](_0xd350('0x1c'),_0xc5ba74,_0x270610[_0xd350('0xb')]);_0x50c380[_0xd350('0x19')]();}}}catch(_0x504d79){console[_0xd350('0x1d')](_0x504d79);logger[_0xd350('0x1e')](_0xd350('0x1f'),_0xc5ba74,_0x504d79[_0xd350('0x20')]);_0x50c380[_0xd350('0x19')]();}};}; \ No newline at end of file +var _0x0974=['timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','stop','createQueue','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x10c0c0,_0x40b99c){var _0x5c7850=function(_0x267d6f){while(--_0x267d6f){_0x10c0c0['push'](_0x10c0c0['shift']());}};_0x5c7850(++_0x40b99c);}(_0x0974,0xb0));var _0x4097=function(_0x1789b0,_0x289727){_0x1789b0=_0x1789b0-0x0;var _0x125916=_0x0974[_0x1789b0];return _0x125916;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x4097('0x0'));var logger=require(_0x4097('0x1'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x4097('0x2')},'timeout':{'type':_0x4097('0x3'),'message':_0x4097('0x4')}});function writeLog(_0x56a501,_0x446955,_0x14ff1e){return logger['info'](util[_0x4097('0x5')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x56a501,_0x446955['name'],_0x14ff1e));}function handleFindAgent(_0x5d63eb){return function(_0x48a341){return _0x48a341[_0x4097('0x6')][_0x4097('0x7')]()===_0x5d63eb[_0x4097('0x7')]();};}exports[_0x4097('0x8')]=function(_0x107328,_0xf4b2df,_0x390e09,_0x5cf9b7){return function(_0x3cd9ba){try{var _0x1629e2={'name':_0xf4b2df[0x0],'timeout':_0xf4b2df[0x1]};var _0x4dd1aa=queue[_0x4097('0x9')](_0x1629e2,{'typecast':!![]});if(_0x4dd1aa[_0x4097('0xa')]){logger[_0x4097('0xb')](_0x4097('0xc'),_0x107328,_[_0x4097('0xd')](_0x4dd1aa,_0x4097('0xe'))['join'](',\x20'));_0x3cd9ba[_0x4097('0xf')]();}else{var _0x57ad91=_['find'](_0x390e09['agents'],handleFindAgent(_0x1629e2[_0x4097('0x6')]));if(_0x57ad91){var _0x347137=(_0x1629e2['timeout']||0xa)*0x3e8;var _0x2596a7,_0x3e5af7;var _0x21d810=seqqueue[_0x4097('0x10')](_0x347137);_0x21d810['id']=_0x107328;_0x21d810[_0x4097('0x11')]=_0x347137;_0x21d810[_0x4097('0x12')]=_0x5cf9b7[_0x4097('0x12')];writeLog(_0x107328,_0x57ad91,util[_0x4097('0x5')](_0x4097('0x13'),_0x347137));_0x390e09[_0x4097('0x14')][_0x107328]['on'](_0x4097('0x15'),function(){logger[_0x4097('0x16')](_0x4097('0x17'),_0x107328);clearTimeout(_0x3e5af7);_0x3e5af7=undefined;_0x21d810[_0x4097('0x18')]();if(_0x390e09[_0x4097('0x14')][_0x107328]){delete _0x390e09[_0x4097('0x14')][_0x107328];}_0x3cd9ba[_0x4097('0xf')]();});_0x390e09[_0x4097('0x14')][_0x107328]['on']('complete',function(){if(_0x390e09[_0x4097('0x14')][_0x107328]){delete _0x390e09[_0x4097('0x14')][_0x107328];}});_0x3e5af7=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x107328);clearTimeout(_0x3e5af7);_0x21d810[_0x4097('0x18')]();_0x3cd9ba[_0x4097('0x19')]();},_0x347137);strategy[_0x4097('0x1a')](_0x21d810,_0x57ad91,_0x390e09,_0x5cf9b7);}else{logger[_0x4097('0xb')](_0x4097('0x1b'),_0x107328,_0x1629e2[_0x4097('0x6')]);_0x3cd9ba[_0x4097('0xf')]();}}}catch(_0x195b2a){console[_0x4097('0x1c')](_0x195b2a);logger[_0x4097('0xb')](_0x4097('0x1d'),_0x107328,_0x195b2a['stack']);_0x3cd9ba[_0x4097('0xf')]();}};}; \ 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 ffba509..70d77b7 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 _0x5805=['next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','interaction','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','info','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','channel','postText','message','providerName','amazonlex','providerResponse','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x5805,0x150));var _0x5580=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5805[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x5580('0x0'));var moment=require(_0x5580('0x1'));var AWS=require(_0x5580('0x2'));var utils=require(_0x5580('0x3'));var logger=require(_0x5580('0x4'))('routing');var rpc={'chatMessage':require(_0x5580('0x5')),'openchannelMessage':require(_0x5580('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5580('0x7')),'faxMessage':require(_0x5580('0x8')),'whatsappMessage':require(_0x5580('0x9'))};exports[_0x5580('0xa')]=function(_0x48540b,_0x1403f1){return function(_0x57024d){try{if(!_[_0x5580('0xb')](this['interaction'][_0x5580('0xc')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x48540b,_0x5580('0xd'));return _0x57024d[_0x5580('0xe')]();}var _0x1a71a0={'ContactId':this[_0x5580('0xf')]['id'],'sentAt':moment()['format'](_0x5580('0x10')),'direction':_0x5580('0x11')};if(this['channel']===_0x5580('0x12')||this['channel']===_0x5580('0x13')){_0x1a71a0['phone']=this[_0x5580('0x14')][_0x5580('0x15')];}var _0x542b26=this['channel'];if(_0x542b26==='chat'){_0x1a71a0[_0x5580('0x16')]=this[_0x5580('0x17')]['id'];}else{_0x1a71a0[_['upperFirst'](_0x542b26)+_0x5580('0x18')]=this[_0x5580('0x17')]['id'];}_0x1a71a0[_[_0x5580('0x19')](_0x542b26)+_0x5580('0x1a')]=this[_0x5580('0x14')]['id'];if(this['interaction']['created']){var _0x1bfed2=_0x1403f1[0x4];if(!_[_0x5580('0x1b')](_0x1bfed2)){_0x1a71a0[_0x5580('0x1c')]=utils[_0x5580('0x1d')](_0x1bfed2,this);return rpc[_0x542b26+_0x5580('0x1e')][_0x5580('0x1f')](_0x1a71a0)[_0x5580('0x20')](function(_0x2e8d0a){logger[_0x5580('0x21')](_0x5580('0x22'),_0x48540b,_0x1a71a0['body']);})['catch'](function(_0x8b9d8d){logger[_0x5580('0x23')](_0x5580('0x22'),_0x48540b,JSON[_0x5580('0x24')](_0x8b9d8d));})[_0x5580('0x25')](function(){logger['info'](_0x5580('0x26'),_0x48540b);_0x57024d[_0x5580('0x27')]();});}else{logger[_0x5580('0x21')](_0x5580('0x28'),_0x48540b);_0x57024d[_0x5580('0x27')]();}}else{var _0x46a6e6=this;var _0x4b5fdd=new AWS[(_0x5580('0x29'))]({'accessKeyId':_0x1403f1[0x0],'secretAccessKey':_0x1403f1[0x1],'region':_0x1403f1[0x2]});var _0xacfb6a={'botAlias':_0x5580('0x2a'),'botName':_0x1403f1[0x3],'inputText':this['message']['body'],'userId':this[_0x5580('0x2b')]+':'+this[_0x5580('0x14')]['id']['toString']()};_0x4b5fdd[_0x5580('0x2c')](_0xacfb6a,function(_0x2bca8e,_0x1573ae){if(_0x2bca8e){logger[_0x5580('0x23')](_0x5580('0x22'),_0x48540b,_0x2bca8e[_0x5580('0x2d')]);_0x57024d[_0x5580('0xe')]();}else if(_0x1573ae&&_0x1573ae['message']){_0x46a6e6['body']['amazonlex']=_0x1573ae;_0x1a71a0[_0x5580('0x1c')]=_0x1573ae['message'];_0x1a71a0[_0x5580('0x2e')]=_0x5580('0x2f');_0x1a71a0[_0x5580('0x30')]=JSON[_0x5580('0x24')](_0x1573ae);return rpc[_0x542b26+_0x5580('0x1e')][_0x5580('0x1f')](_0x1a71a0)[_0x5580('0x20')](function(_0x10e9bb){logger[_0x5580('0x21')]('[%s][AMAZONLEX]\x20%s',_0x48540b,_0x1a71a0['body']);if(_0x1573ae['dialogState']==_0x5580('0x31')){_0x57024d['next']();}else{_0x57024d[_0x5580('0x27')]();}})['catch'](function(_0x2161cf){logger[_0x5580('0x23')](_0x5580('0x22'),_0x48540b,JSON['stringify'](_0x2161cf));_0x57024d[_0x5580('0xe')]();});}else{_0x57024d[_0x5580('0xe')]();}});}}catch(_0x474f65){logger['error'](_0x5580('0x22'),_0x48540b,JSON[_0x5580('0x24')](_0x474f65));_0x57024d[_0x5580('0x27')]();}};}; \ No newline at end of file +var _0xe977=['UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','create','then','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString','message','next','amazonlex','providerResponse','stringify','Message','dialogState','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction'];(function(_0x2e9b83,_0x238187){var _0x569ce3=function(_0xbaf583){while(--_0xbaf583){_0x2e9b83['push'](_0x2e9b83['shift']());}};_0x569ce3(++_0x238187);}(_0xe977,0xd1));var _0x7e97=function(_0xfc98cb,_0x3aa3f5){_0xfc98cb=_0xfc98cb-0x0;var _0x256e19=_0xe977[_0xfc98cb];return _0x256e19;};'use strict';var _=require(_0x7e97('0x0'));var moment=require('moment');var AWS=require(_0x7e97('0x1'));var utils=require(_0x7e97('0x2'));var logger=require(_0x7e97('0x3'))(_0x7e97('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7e97('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7e97('0x6')),'faxMessage':require(_0x7e97('0x7')),'whatsappMessage':require(_0x7e97('0x8'))};exports[_0x7e97('0x9')]=function(_0x519cf2,_0x3ca53a){return function(_0x4168d2){try{if(!_['isNil'](this[_0x7e97('0xa')][_0x7e97('0xb')])){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x7e97('0xe'));return _0x4168d2['next']();}var _0x1b1a24={'ContactId':this[_0x7e97('0xf')]['id'],'sentAt':moment()['format'](_0x7e97('0x10')),'direction':'out'};if(this[_0x7e97('0x11')]===_0x7e97('0x12')||this[_0x7e97('0x11')]===_0x7e97('0x13')){_0x1b1a24[_0x7e97('0x14')]=this['interaction'][_0x7e97('0x14')];}var _0x315971=this[_0x7e97('0x11')];if(_0x315971===_0x7e97('0x15')){_0x1b1a24[_0x7e97('0x16')]=this[_0x7e97('0x17')]['id'];}else{_0x1b1a24[_[_0x7e97('0x18')](_0x315971)+'AccountId']=this[_0x7e97('0x17')]['id'];}_0x1b1a24[_[_0x7e97('0x18')](_0x315971)+_0x7e97('0x19')]=this['interaction']['id'];if(this[_0x7e97('0xa')][_0x7e97('0x1a')]){var _0x3c9971=_0x3ca53a[0x4];if(!_[_0x7e97('0x1b')](_0x3c9971)){_0x1b1a24[_0x7e97('0x1c')]=utils['getMustacheRender'](_0x3c9971,this);return rpc[_0x315971+'Message'][_0x7e97('0x1d')](_0x1b1a24)[_0x7e97('0x1e')](function(_0x49e8de){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x1b1a24[_0x7e97('0x1c')]);})[_0x7e97('0x1f')](function(_0xc739b0){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,JSON['stringify'](_0xc739b0));})[_0x7e97('0x21')](function(){logger[_0x7e97('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x519cf2);_0x4168d2[_0x7e97('0x22')]();});}else{logger[_0x7e97('0xc')](_0x7e97('0x23'),_0x519cf2);_0x4168d2['stop']();}}else{var _0x55c099=this;var _0xd7d207=new AWS['LexRuntime']({'accessKeyId':_0x3ca53a[0x0],'secretAccessKey':_0x3ca53a[0x1],'region':_0x3ca53a[0x2]});var _0x1d886d={'botAlias':'$LATEST','botName':_0x3ca53a[0x3],'inputText':this['message'][_0x7e97('0x1c')],'userId':this[_0x7e97('0x11')]+':'+this[_0x7e97('0xa')]['id'][_0x7e97('0x24')]()};_0xd7d207['postText'](_0x1d886d,function(_0x4587f9,_0x4cf8c8){if(_0x4587f9){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,_0x4587f9[_0x7e97('0x25')]);_0x4168d2[_0x7e97('0x26')]();}else if(_0x4cf8c8&&_0x4cf8c8['message']){_0x55c099[_0x7e97('0x1c')]['amazonlex']=_0x4cf8c8;_0x1b1a24['body']=_0x4cf8c8[_0x7e97('0x25')];_0x1b1a24['providerName']=_0x7e97('0x27');_0x1b1a24[_0x7e97('0x28')]=JSON[_0x7e97('0x29')](_0x4cf8c8);return rpc[_0x315971+_0x7e97('0x2a')]['create'](_0x1b1a24)[_0x7e97('0x1e')](function(_0x14c264){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x1b1a24[_0x7e97('0x1c')]);if(_0x4cf8c8[_0x7e97('0x2b')]=='Failed'){_0x4168d2[_0x7e97('0x26')]();}else{_0x4168d2['stop']();}})[_0x7e97('0x1f')](function(_0x5e0d60){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,JSON[_0x7e97('0x29')](_0x5e0d60));_0x4168d2[_0x7e97('0x26')]();});}else{_0x4168d2['next']();}});}}catch(_0x440d94){logger['error']('[%s][AMAZONLEX]\x20%s',_0x519cf2,JSON[_0x7e97('0x29')](_0x440d94));_0x4168d2[_0x7e97('0x22')]();}};}; \ 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 7aca74b..1ba74dd 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 _0x3c37=['auto-replied','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','error','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','next','format','out','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','','replace','','headers'];(function(_0x2e8c7e,_0x28648a){var _0x48fded=function(_0x55b9c5){while(--_0x55b9c5){_0x2e8c7e['push'](_0x2e8c7e['shift']());}};_0x48fded(++_0x28648a);}(_0x3c37,0x19b));var _0x73c3=function(_0x594de4,_0x298bf8){_0x594de4=_0x594de4-0x0;var _0x43af4d=_0x3c37[_0x594de4];return _0x43af4d;};'use strict';var _=require(_0x73c3('0x0'));var moment=require(_0x73c3('0x1'));var utils=require(_0x73c3('0x2'));var logger=require(_0x73c3('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x73c3('0x4')),'mailMessage':require(_0x73c3('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x73c3('0x6')),'whatsappMessage':require(_0x73c3('0x7')),'chatInteraction':require(_0x73c3('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x73c3('0x9')),'smsInteraction':require(_0x73c3('0xa')),'faxInteraction':require(_0x73c3('0xb')),'whatsappInteraction':require(_0x73c3('0xc'))};var mailRpc=require(_0x73c3('0xd'));exports[_0x73c3('0xe')]=function(_0x10f344,_0x10e593,_0x33ae13,_0x54fe2e){return function(_0x3a5582){try{var _0xa1d44f=this['channel'];if(_0xa1d44f===_0x73c3('0xf')&&_0x54fe2e[_0x73c3('0x10')][_0x73c3('0x11')]){logger[_0x73c3('0x12')](_0x73c3('0x13'),_0x10f344,_0x73c3('0x14'));return _0x3a5582['next']();}if(_0x10e593[0x0]==='1'&&(_[_0x73c3('0x15')](this[_0x73c3('0x16')][_0x73c3('0x17')])||!this[_0x73c3('0x16')][_0x73c3('0x17')])){logger[_0x73c3('0x12')](_0x73c3('0x13'),_0x10f344,_0x73c3('0x18'));return _0x3a5582['next']();}if(_0x10e593[0x0]==='2'&&this[_0x73c3('0x16')][_0x73c3('0x19')]){logger[_0x73c3('0x12')](_0x73c3('0x1a'),_0x10f344,'One\x20Time\x20already\x20sent');return _0x3a5582[_0x73c3('0x1b')]();}var _0x15c626={'ContactId':this['contact']['id'],'sentAt':moment()[_0x73c3('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x73c3('0x1d')};if(this['channel']===_0x73c3('0xf')){_0x15c626[_0x73c3('0x10')]=utils['getMustacheRender'](_0x10e593[0x2],this);}else{_0x15c626[_0x73c3('0x10')]=utils[_0x73c3('0x1e')](_0x10e593[0x1],this);}if(this['message']){_0x15c626['to']=this[_0x73c3('0x1f')][_0x73c3('0x20')]||'';if(this[_0x73c3('0x21')]===_0x73c3('0xf')&&_0x10e593[0x1]==='1'){_0x15c626['cc']=this['message']['cc']||'';}_0x15c626[_0x73c3('0x20')]=this[_0x73c3('0x1f')]['to']||'';_0x15c626[_0x73c3('0x22')]=this['message'][_0x73c3('0x22')]||'';_0x15c626[_0x73c3('0x23')]=!![];if(this[_0x73c3('0x1f')][_0x73c3('0x24')]){_0x15c626['subject']='';_0x15c626[_0x73c3('0x24')]+=_[_0x73c3('0x25')](this[_0x73c3('0x1f')][_0x73c3('0x24')],_0x73c3('0x26'))?'':_0x73c3('0x27');_0x15c626['subject']+=this[_0x73c3('0x1f')][_0x73c3('0x24')];}}if(this[_0x73c3('0x21')]===_0x73c3('0x28')){_0x15c626[_0x73c3('0x29')]=this[_0x73c3('0x2a')]['id'];}else{_0x15c626[_[_0x73c3('0x2b')](this[_0x73c3('0x21')])+_0x73c3('0x2c')]=this[_0x73c3('0x2a')]['id'];}_0x15c626[_[_0x73c3('0x2b')](this[_0x73c3('0x21')])+_0x73c3('0x2d')]=this[_0x73c3('0x16')]['id'];var _0x3f61be=this[_0x73c3('0x16')];if(rpc[this[_0x73c3('0x21')]+_0x73c3('0x2e')]){if(this[_0x73c3('0x21')]===_0x73c3('0xf')){var _0x54f5bb={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x73c3('0x2f')][_0x73c3('0x30')]){_0x54f5bb[_0x73c3('0x30')]=this[_0x73c3('0x2a')][_0x73c3('0x2f')][_0x73c3('0x30')];}else{_0x54f5bb[_0x73c3('0x31')]=this['account'][_0x73c3('0x2f')][_0x73c3('0x31')];_0x54f5bb[_0x73c3('0x32')]=this[_0x73c3('0x2a')][_0x73c3('0x2f')][_0x73c3('0x32')];_0x54f5bb[_0x73c3('0x33')]=this[_0x73c3('0x2a')][_0x73c3('0x2f')]['secure'];}if(this[_0x73c3('0x2a')][_0x73c3('0x2f')][_0x73c3('0x34')]){_0x54f5bb['auth']={'user':this[_0x73c3('0x2a')][_0x73c3('0x2f')][_0x73c3('0x35')],'pass':this[_0x73c3('0x2a')]['Smtp'][_0x73c3('0x36')]};}_0x15c626[_0x73c3('0x37')]=this[_0x73c3('0x1f')][_0x73c3('0x38')];_0x15c626['html']=_0x73c3('0x39')+_[_0x73c3('0x3a')](_0x15c626[_0x73c3('0x10')],_0x73c3('0x3b'),_0x73c3('0x3c'))+_0x73c3('0x3d');_0x15c626[_0x73c3('0x3e')]={'Auto-Submitted':_0x73c3('0x3f'),'X-Auto-Response-Suppress':'All','Precedence':_0x73c3('0x40')};return mailRpc[_0x73c3('0x41')](_0x54f5bb,_0x15c626)[_0x73c3('0x42')](function(_0x3cf2d2){logger['info'](_0x73c3('0x43'),_0x10f344);_0x15c626['messageId']=_0x3cf2d2[_0x73c3('0x1f')][_0x73c3('0x38')];return rpc[_0xa1d44f+'Message'][_0x73c3('0x44')](_0x15c626);})['then'](function(_0x44dba7){logger[_0x73c3('0x12')](_0x73c3('0x13'),_0x10f344,JSON[_0x73c3('0x45')](_0x44dba7));})[_0x73c3('0x46')](function(_0x3f7675){logger['error'](_0x73c3('0x47'),_0x10f344,JSON[_0x73c3('0x45')](_0x3f7675));})[_0x73c3('0x48')](function(){Promise['resolve']()[_0x73c3('0x42')](function(){if(_0x10e593[0x0]!=='2'||_0x3f61be[_0x73c3('0x19')])return;return rpc[_0xa1d44f+_0x73c3('0x49')][_0x73c3('0x4a')](_0x3f61be['id'],{'autoreplyExecuted':!![]})[_0x73c3('0x42')](function(_0x1beb1d){logger[_0x73c3('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x10f344,JSON[_0x73c3('0x45')](_0x1beb1d));})[_0x73c3('0x46')](function(_0x4e689a){logger[_0x73c3('0x4b')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x10f344,JSON[_0x73c3('0x45')](_0x4e689a));});})[_0x73c3('0x42')](function(){_0x3a5582[_0x73c3('0x1b')]();});});}else{return rpc[this[_0x73c3('0x21')]+_0x73c3('0x2e')]['create'](_0x15c626)[_0x73c3('0x42')](function(_0x116013){logger['info'](_0x73c3('0x13'),_0x10f344,_0x15c626[_0x73c3('0x10')]);})[_0x73c3('0x46')](function(_0x37e9c8){logger[_0x73c3('0x4b')](_0x73c3('0x13'),_0x10f344,JSON[_0x73c3('0x45')](_0x37e9c8));})[_0x73c3('0x48')](function(){Promise[_0x73c3('0x4c')]()['then'](function(){if(_0x10e593[0x0]!=='2'||_0x3f61be['autoreplyExecuted'])return;return rpc[_0xa1d44f+_0x73c3('0x49')][_0x73c3('0x4a')](_0x3f61be['id'],{'autoreplyExecuted':!![]})[_0x73c3('0x42')](function(_0x3bcb14){logger[_0x73c3('0x12')](_0x73c3('0x1a'),_0x10f344,JSON[_0x73c3('0x45')](_0x3bcb14));})[_0x73c3('0x46')](function(_0x1958e8){logger[_0x73c3('0x4b')](_0x73c3('0x4d'),_0x10f344,JSON[_0x73c3('0x45')](_0x1958e8));});})[_0x73c3('0x42')](function(){_0x3a5582[_0x73c3('0x1b')]();});});}}}catch(_0x481c23){logger['error'](_0x73c3('0x13'),_0x10f344,JSON[_0x73c3('0x45')](_0x481c23));_0x3a5582[_0x73c3('0x4e')]();}};}; \ No newline at end of file +var _0x7f3f=['../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','mail','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Smtp','service','port','secure','auth','user','pass','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','Message','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction'];(function(_0xd8b89f,_0x6312f4){var _0x3c6e90=function(_0x182d8a){while(--_0x182d8a){_0xd8b89f['push'](_0xd8b89f['shift']());}};_0x3c6e90(++_0x6312f4);}(_0x7f3f,0x169));var _0xf7f3=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x7f3f[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0xf7f3('0x0'));var moment=require('moment');var utils=require(_0xf7f3('0x1'));var logger=require(_0xf7f3('0x2'))('routing');var rpc={'chatMessage':require(_0xf7f3('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf7f3('0x4')),'smsMessage':require(_0xf7f3('0x5')),'faxMessage':require(_0xf7f3('0x6')),'whatsappMessage':require(_0xf7f3('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf7f3('0x8')),'smsInteraction':require(_0xf7f3('0x9')),'faxInteraction':require(_0xf7f3('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xf7f3('0xb')]=function(_0x879269,_0x27b8d2,_0x47445f,_0x1b6fb6){return function(_0x4a1292){try{var _0x28e352=this[_0xf7f3('0xc')];if(_0x28e352===_0xf7f3('0xd')&&_0x1b6fb6['body']['isAutoreply']){logger[_0xf7f3('0xe')]('[%s][AUTOREPLY]\x20%s',_0x879269,_0xf7f3('0xf'));return _0x4a1292[_0xf7f3('0x10')]();}if(_0x27b8d2[0x0]==='1'&&(_[_0xf7f3('0x11')](this[_0xf7f3('0x12')][_0xf7f3('0x13')])||!this['interaction'][_0xf7f3('0x13')])){logger[_0xf7f3('0xe')](_0xf7f3('0x14'),_0x879269,_0xf7f3('0x15'));return _0x4a1292[_0xf7f3('0x10')]();}if(_0x27b8d2[0x0]==='2'&&this[_0xf7f3('0x12')]['autoreplyExecuted']){logger[_0xf7f3('0xe')](_0xf7f3('0x16'),_0x879269,_0xf7f3('0x17'));return _0x4a1292['next']();}var _0x3870a8={'ContactId':this[_0xf7f3('0x18')]['id'],'sentAt':moment()[_0xf7f3('0x19')](_0xf7f3('0x1a')),'direction':_0xf7f3('0x1b')};if(this[_0xf7f3('0xc')]===_0xf7f3('0xd')){_0x3870a8[_0xf7f3('0x1c')]=utils[_0xf7f3('0x1d')](_0x27b8d2[0x2],this);}else{_0x3870a8[_0xf7f3('0x1c')]=utils[_0xf7f3('0x1d')](_0x27b8d2[0x1],this);}if(this[_0xf7f3('0x1e')]){_0x3870a8['to']=this[_0xf7f3('0x1e')][_0xf7f3('0x1f')]||'';if(this[_0xf7f3('0xc')]===_0xf7f3('0xd')&&_0x27b8d2[0x1]==='1'){_0x3870a8['cc']=this[_0xf7f3('0x1e')]['cc']||'';}_0x3870a8['from']=this['message']['to']||'';_0x3870a8[_0xf7f3('0x20')]=this['message']['phone']||'';_0x3870a8[_0xf7f3('0x21')]=!![];if(this['message'][_0xf7f3('0x22')]){_0x3870a8[_0xf7f3('0x22')]='';_0x3870a8[_0xf7f3('0x22')]+=_[_0xf7f3('0x23')](this[_0xf7f3('0x1e')]['subject'],_0xf7f3('0x24'))?'':'Re:\x20';_0x3870a8[_0xf7f3('0x22')]+=this[_0xf7f3('0x1e')][_0xf7f3('0x22')];}}if(this['channel']===_0xf7f3('0x25')){_0x3870a8['ChatWebsiteId']=this[_0xf7f3('0x26')]['id'];}else{_0x3870a8[_[_0xf7f3('0x27')](this[_0xf7f3('0xc')])+_0xf7f3('0x28')]=this[_0xf7f3('0x26')]['id'];}_0x3870a8[_[_0xf7f3('0x27')](this[_0xf7f3('0xc')])+_0xf7f3('0x29')]=this[_0xf7f3('0x12')]['id'];var _0x4532a6=this[_0xf7f3('0x12')];if(rpc[this[_0xf7f3('0xc')]+'Message']){if(this[_0xf7f3('0xc')]==='mail'){var _0x19a011={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xf7f3('0x2a')][_0xf7f3('0x2b')]){_0x19a011[_0xf7f3('0x2b')]=this['account']['Smtp'][_0xf7f3('0x2b')];}else{_0x19a011['host']=this['account']['Smtp']['host'];_0x19a011[_0xf7f3('0x2c')]=this[_0xf7f3('0x26')][_0xf7f3('0x2a')][_0xf7f3('0x2c')];_0x19a011[_0xf7f3('0x2d')]=this['account']['Smtp'][_0xf7f3('0x2d')];}if(this['account']['Smtp']['authentication']){_0x19a011[_0xf7f3('0x2e')]={'user':this['account'][_0xf7f3('0x2a')][_0xf7f3('0x2f')],'pass':this[_0xf7f3('0x26')][_0xf7f3('0x2a')][_0xf7f3('0x30')]};}_0x3870a8[_0xf7f3('0x31')]=this[_0xf7f3('0x1e')][_0xf7f3('0x32')];_0x3870a8['html']=_0xf7f3('0x33')+_[_0xf7f3('0x34')](_0x3870a8[_0xf7f3('0x1c')],']+(>|$)/g,''),'priorityTrue':_0x254c72[0x1],'priorityFalse':_0x254c72[0x2]};var _0x1572b4=gotoif['validate'](_0x105c4f,{'typecast':!![]});if(_0x1572b4['length']){logger['error'](_0x5dc6('0xf'),_0x3ad5db,_['map'](_0x1572b4,_0x5dc6('0x10'))[_0x5dc6('0x11')](',\x20'));_0x156688[_0x5dc6('0x12')]();}else{try{var _0x366867=eval('('+_0x105c4f['condition']+')');var _0x5a64de=_0x366867?_0x105c4f[_0x5dc6('0x13')]:_0x105c4f['priorityFalse'];logger[_0x5dc6('0x14')](_0x5dc6('0x15'),_0x3ad5db,_0x105c4f[_0x5dc6('0x16')],_0x366867,_0x5a64de||_0x5dc6('0x17'));if(_0x5a64de){var _0x47359d=_['findIndex'](_0x156688[_0x5dc6('0x18')](),{'p':_0x5a64de});if(_0x47359d>=0x0){logger[_0x5dc6('0x14')](_0x5dc6('0x19'),_0x3ad5db,_0x5a64de||'next',_0x47359d);_0x156688[_0x5dc6('0x17')](_0x47359d);}else{logger[_0x5dc6('0x14')](_0x5dc6('0x1a'),_0x3ad5db,_0x5a64de||'next');_0x156688[_0x5dc6('0x12')]();}}else{_0x156688[_0x5dc6('0x17')]();}}catch(_0x46dbe1){logger[_0x5dc6('0x1b')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3ad5db,_0x46dbe1[_0x5dc6('0x10')]);_0x156688[_0x5dc6('0x12')]();}}}catch(_0x13a9b6){logger['error']('[%s][GOTOIF]\x20%s',_0x3ad5db,JSON[_0x5dc6('0x1c')](_0x13a9b6));_0x156688['stop']();}};}; \ No newline at end of file +var _0xb604=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x3b534c,_0x2c614f){var _0x449ef9=function(_0x285279){while(--_0x285279){_0x3b534c['push'](_0x3b534c['shift']());}};_0x449ef9(++_0x2c614f);}(_0xb604,0x143));var _0x4b60=function(_0x3e29c4,_0x22e6e9){_0x3e29c4=_0x3e29c4-0x0;var _0x5adaee=_0xb604[_0x3e29c4];return _0x5adaee;};'use strict';var schema=require(_0x4b60('0x0'));var _=require(_0x4b60('0x1'));var htmlToText=require(_0x4b60('0x2'));var utils=require(_0x4b60('0x3'));var logger=require(_0x4b60('0x4'))(_0x4b60('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x4b60('0x6')},'priorityFalse':{'type':'number','message':_0x4b60('0x7')}});exports[_0x4b60('0x8')]=function(_0x19d607,_0x4a8a93){return function(_0x29ce06){try{var _0x507f08={'condition':htmlToText[_0x4b60('0x9')](utils[_0x4b60('0xa')](_0x4a8a93[0x0],this),{'wordwrap':![]})[_0x4b60('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4a8a93[0x1],'priorityFalse':_0x4a8a93[0x2]};var _0x57e6a4=gotoif['validate'](_0x507f08,{'typecast':!![]});if(_0x57e6a4[_0x4b60('0xc')]){logger[_0x4b60('0xd')](_0x4b60('0xe'),_0x19d607,_[_0x4b60('0xf')](_0x57e6a4,_0x4b60('0x10'))['join'](',\x20'));_0x29ce06[_0x4b60('0x11')]();}else{try{var _0x2fea2e=eval('('+_0x507f08[_0x4b60('0x12')]+')');var _0x4f9124=_0x2fea2e?_0x507f08[_0x4b60('0x13')]:_0x507f08[_0x4b60('0x14')];logger[_0x4b60('0x15')](_0x4b60('0x16'),_0x19d607,_0x507f08[_0x4b60('0x12')],_0x2fea2e,_0x4f9124||_0x4b60('0x17'));if(_0x4f9124){var _0x416180=_[_0x4b60('0x18')](_0x29ce06[_0x4b60('0x19')](),{'p':_0x4f9124});if(_0x416180>=0x0){logger[_0x4b60('0x15')](_0x4b60('0x1a'),_0x19d607,_0x4f9124||'next',_0x416180);_0x29ce06[_0x4b60('0x17')](_0x416180);}else{logger['info'](_0x4b60('0x1b'),_0x19d607,_0x4f9124||'next');_0x29ce06[_0x4b60('0x11')]();}}else{_0x29ce06['next']();}}catch(_0x54a1af){logger[_0x4b60('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x19d607,_0x54a1af[_0x4b60('0x10')]);_0x29ce06['stop']();}}}catch(_0x8b4bad){logger[_0x4b60('0xd')](_0x4b60('0xe'),_0x19d607,JSON[_0x4b60('0x1c')](_0x8b4bad));_0x29ce06[_0x4b60('0x11')]();}};}; \ 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 180b75b..1f92fdd 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 _0xf508=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','stop','info','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate'];(function(_0x167dac,_0x3c9716){var _0x44aef5=function(_0x3fee93){while(--_0x3fee93){_0x167dac['push'](_0x167dac['shift']());}};_0x44aef5(++_0x3c9716);}(_0xf508,0x6b));var _0x8f50=function(_0x447aa1,_0xc242fd){_0x447aa1=_0x447aa1-0x0;var _0x21d6ac=_0xf508[_0x447aa1];return _0x21d6ac;};'use strict';var schema=require(_0x8f50('0x0'));var _=require('lodash');var logger=require(_0x8f50('0x1'))(_0x8f50('0x2'));var gotop=schema({'priority':{'type':_0x8f50('0x3'),'required':!![],'message':_0x8f50('0x4')}});exports[_0x8f50('0x5')]=function(_0x20d3ee,_0x2dec17){return function(_0x176654){try{var _0x42d917={'priority':_0x2dec17[0x0]};var _0x2da22d=gotop[_0x8f50('0x0')](_0x42d917,{'typecast':!![]});if(_0x2da22d[_0x8f50('0x6')]){logger[_0x8f50('0x7')]('[%s][GOTOP]\x20%s',_0x20d3ee,_[_0x8f50('0x8')](_0x2da22d,_0x8f50('0x9'))[_0x8f50('0xa')](',\x20'));_0x176654[_0x8f50('0xb')]();}else{logger[_0x8f50('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x20d3ee,_0x42d917[_0x8f50('0xd')]);if(_0x42d917[_0x8f50('0xd')]){var _0x3c4312=_['findIndex'](_0x176654['rules'](),{'p':_0x42d917[_0x8f50('0xd')]});if(_0x3c4312>=0x0){logger['info'](_0x8f50('0xe'),_0x20d3ee,_0x42d917[_0x8f50('0xd')]||'next',_0x3c4312);_0x176654[_0x8f50('0xf')](_0x3c4312);}else{logger['info'](_0x8f50('0x10'),_0x20d3ee,_0x42d917[_0x8f50('0xd')]||'next');_0x176654[_0x8f50('0xb')]();}}else{_0x176654['next']();}}}catch(_0x59949b){logger[_0x8f50('0x7')]('[%s][GOTOP]\x20%s',_0x20d3ee,JSON[_0x8f50('0x11')](_0x59949b));_0x176654[_0x8f50('0xb')]();}};}; \ No newline at end of file +var _0xb91f=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','routing','number'];(function(_0x5dc4c1,_0x2756f2){var _0x3e3986=function(_0x2178fd){while(--_0x2178fd){_0x5dc4c1['push'](_0x5dc4c1['shift']());}};_0x3e3986(++_0x2756f2);}(_0xb91f,0xec));var _0xfb91=function(_0x2dd4f7,_0x47d7bb){_0x2dd4f7=_0x2dd4f7-0x0;var _0x5e6f11=_0xb91f[_0x2dd4f7];return _0x5e6f11;};'use strict';var schema=require(_0xfb91('0x0'));var _=require(_0xfb91('0x1'));var logger=require('../../../../config/logger')(_0xfb91('0x2'));var gotop=schema({'priority':{'type':_0xfb91('0x3'),'required':!![],'message':_0xfb91('0x4')}});exports[_0xfb91('0x5')]=function(_0x2041cc,_0x276a6f){return function(_0x24bbbb){try{var _0x5b65ff={'priority':_0x276a6f[0x0]};var _0x199790=gotop[_0xfb91('0x0')](_0x5b65ff,{'typecast':!![]});if(_0x199790[_0xfb91('0x6')]){logger[_0xfb91('0x7')]('[%s][GOTOP]\x20%s',_0x2041cc,_[_0xfb91('0x8')](_0x199790,'message')[_0xfb91('0x9')](',\x20'));_0x24bbbb[_0xfb91('0xa')]();}else{logger[_0xfb91('0xb')](_0xfb91('0xc'),_0x2041cc,_0x5b65ff['priority']);if(_0x5b65ff[_0xfb91('0xd')]){var _0x291d56=_['findIndex'](_0x24bbbb[_0xfb91('0xe')](),{'p':_0x5b65ff[_0xfb91('0xd')]});if(_0x291d56>=0x0){logger[_0xfb91('0xb')](_0xfb91('0xf'),_0x2041cc,_0x5b65ff[_0xfb91('0xd')]||_0xfb91('0x10'),_0x291d56);_0x24bbbb['next'](_0x291d56);}else{logger['info'](_0xfb91('0x11'),_0x2041cc,_0x5b65ff[_0xfb91('0xd')]||'next');_0x24bbbb[_0xfb91('0xa')]();}}else{_0x24bbbb[_0xfb91('0x10')]();}}}catch(_0x25d352){logger['error'](_0xfb91('0x12'),_0x2041cc,JSON[_0xfb91('0x13')](_0x25d352));_0x24bbbb[_0xfb91('0xa')]();}};}; \ 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 abcca08..589ed7b 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 _0xe517=['channel','AccountId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','chat','ChatWebsiteId','upperFirst'];(function(_0x242d56,_0x13d984){var _0x4980f8=function(_0x569758){while(--_0x569758){_0x242d56['push'](_0x242d56['shift']());}};_0x4980f8(++_0x13d984);}(_0xe517,0xe6));var _0x7e51=function(_0x10e5cf,_0x421fb2){_0x10e5cf=_0x10e5cf-0x0;var _0x26a5f2=_0xe517[_0x10e5cf];return _0x26a5f2;};'use strict';var _=require('lodash');var utils=require(_0x7e51('0x0'));var logger=require(_0x7e51('0x1'))(_0x7e51('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7e51('0x3')),'faxMessage':require(_0x7e51('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7e51('0x5')]=function(_0x216dc8,_0x304e76){return function(_0x1fc2c6){try{var _0x53654f={'body':utils[_0x7e51('0x6')](_0x304e76[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x7e51('0x7')){_0x53654f[_0x7e51('0x8')]=this['account']['id'];}else{_0x53654f[_[_0x7e51('0x9')](this[_0x7e51('0xa')])+_0x7e51('0xb')]=this[_0x7e51('0xc')]['id'];}_0x53654f[_[_0x7e51('0x9')](this[_0x7e51('0xa')])+_0x7e51('0xd')]=this[_0x7e51('0xe')]['id'];if(rpc[this[_0x7e51('0xa')]+_0x7e51('0xf')]){return rpc[this[_0x7e51('0xa')]+'Message'][_0x7e51('0x10')](_0x53654f)[_0x7e51('0x11')](function(_0x15cc6a){logger[_0x7e51('0x12')](_0x7e51('0x13'),_0x216dc8,_0x53654f[_0x7e51('0x14')]);_0x1fc2c6[_0x7e51('0x15')]();})['catch'](function(_0x5cac82){logger[_0x7e51('0x16')](_0x7e51('0x13'),_0x216dc8,JSON[_0x7e51('0x17')](_0x5cac82));_0x1fc2c6['stop']();});}}catch(_0x2f0bb9){logger[_0x7e51('0x16')](_0x7e51('0x13'),_0x216dc8,JSON[_0x7e51('0x17')](_0x2f0bb9));_0x1fc2c6['stop']();}};}; \ No newline at end of file +var _0x7e1a=['contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0x54096b,_0x335615){_0x54096b=_0x54096b-0x0;var _0x39dd37=_0x7e1a[_0x54096b];return _0x39dd37;};'use strict';var _=require(_0xa7e1('0x0'));var utils=require(_0xa7e1('0x1'));var logger=require(_0xa7e1('0x2'))(_0xa7e1('0x3'));var rpc={'chatMessage':require(_0xa7e1('0x4')),'openchannelMessage':require(_0xa7e1('0x5')),'mailMessage':require(_0xa7e1('0x6')),'smsMessage':require(_0xa7e1('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa7e1('0x8'))};exports[_0xa7e1('0x9')]=function(_0x2cc9c3,_0x170590){return function(_0x5f20e5){try{var _0x22d066={'body':utils[_0xa7e1('0xa')](_0x170590[0x0],this),'ContactId':this[_0xa7e1('0xb')]['id']};if(this[_0xa7e1('0xc')]===_0xa7e1('0xd')){_0x22d066[_0xa7e1('0xe')]=this[_0xa7e1('0xf')]['id'];}else{_0x22d066[_['upperFirst'](this[_0xa7e1('0xc')])+'AccountId']=this['account']['id'];}_0x22d066[_[_0xa7e1('0x10')](this[_0xa7e1('0xc')])+_0xa7e1('0x11')]=this[_0xa7e1('0x12')]['id'];if(rpc[this['channel']+_0xa7e1('0x13')]){return rpc[this[_0xa7e1('0xc')]+_0xa7e1('0x13')][_0xa7e1('0x14')](_0x22d066)[_0xa7e1('0x15')](function(_0x57e823){logger['info'](_0xa7e1('0x16'),_0x2cc9c3,_0x22d066[_0xa7e1('0x17')]);_0x5f20e5[_0xa7e1('0x18')]();})[_0xa7e1('0x19')](function(_0x23fc30){logger[_0xa7e1('0x1a')](_0xa7e1('0x16'),_0x2cc9c3,JSON[_0xa7e1('0x1b')](_0x23fc30));_0x5f20e5[_0xa7e1('0x1c')]();});}}catch(_0x495ace){logger[_0xa7e1('0x1a')](_0xa7e1('0x16'),_0x2cc9c3,JSON[_0xa7e1('0x1b')](_0x495ace));_0x5f20e5[_0xa7e1('0x1c')]();}};}; \ 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 13267c9..3fac56d 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 _0x7028=['routing','info','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7028,0xac));var _0x8702=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x7028[_0x25662e];return _0x59b7bc;};'use strict';var utils=require(_0x8702('0x0'));var logger=require(_0x8702('0x1'))(_0x8702('0x2'));exports['consequence']=function(_0x220c5b,_0x4e9ba6){return function(_0x3032aa){try{logger[_0x8702('0x3')](_0x8702('0x4'),_0x220c5b,utils['getMustacheRender'](_0x4e9ba6[0x0],this));_0x3032aa['next']();}catch(_0x109ca7){logger['error'](_0x8702('0x4'),_0x220c5b,JSON['stringify'](_0x109ca7));_0x3032aa[_0x8702('0x5')]();}};}; \ No newline at end of file +var _0x5fa7=['error','stop','./utils','../../../../config/logger','routing','info','getMustacheRender','next'];(function(_0x4fac58,_0x213b99){var _0x10e5d1=function(_0x5d276f){while(--_0x5d276f){_0x4fac58['push'](_0x4fac58['shift']());}};_0x10e5d1(++_0x213b99);}(_0x5fa7,0x1da));var _0x75fa=function(_0x1f281e,_0x9ab6ed){_0x1f281e=_0x1f281e-0x0;var _0x4efe14=_0x5fa7[_0x1f281e];return _0x4efe14;};'use strict';var utils=require(_0x75fa('0x0'));var logger=require(_0x75fa('0x1'))(_0x75fa('0x2'));exports['consequence']=function(_0x457349,_0x49e3bf){return function(_0x3e6c79){try{logger[_0x75fa('0x3')]('[%s][NOOP]\x20%s',_0x457349,utils[_0x75fa('0x4')](_0x49e3bf[0x0],this));_0x3e6c79[_0x75fa('0x5')]();}catch(_0x430e56){logger[_0x75fa('0x6')]('[%s][NOOP]\x20%s',_0x457349,JSON['stringify'](_0x430e56));_0x3e6c79[_0x75fa('0x7')]();}};}; \ 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 70a43c2..491e7a0 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 _0xf014=['../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','Queues','timeout','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','stop','stack','validate','lodash','util','seq-queue','moment','ioredis'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0xf014,0x126));var _0x4f01=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0xf014[_0x2401fc];return _0x23bb42;};'use strict';var schema=require(_0x4f01('0x0'));var _=require(_0x4f01('0x1'));var util=require(_0x4f01('0x2'));var seqqueue=require(_0x4f01('0x3'));var moment=require(_0x4f01('0x4'));var Redis=require(_0x4f01('0x5'));var config=require('../../../../config/environment');var logger=require(_0x4f01('0x6'))(_0x4f01('0x7'));var strategy=require(_0x4f01('0x8'));config[_0x4f01('0x9')]=_[_0x4f01('0xa')](config[_0x4f01('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4f01('0xb'))(new Redis(config[_0x4f01('0x9')]));var attributes=['id','queue_id',_0x4f01('0xc'),_0x4f01('0xd'),_0x4f01('0xe'),'joinAt'];function emit(_0x582fb0,_0xaf11d5,_0xc31cc7){io['to'](_0x582fb0)['emit'](_0xaf11d5,_0xc31cc7);}function emitChannelQueueInteraction(_0x1f370e,_0x1d1a01,_0x44a984,_0x100256,_0x4574fc,_0x9e2f83,_0x1d3379,_0x41cccd){var _0x253d33=_['clone'](_0x44a984);_0x253d33['queue_id']=_0x41cccd;_0x253d33[_0x4f01('0xd')]=_0x1d1a01;_0x253d33[_0x4f01('0xc')]=_0x100256;_0x253d33['id']=_0x4574fc;if(_0x9e2f83){_0x1d3379[util[_0x4f01('0xf')](_0x4f01('0x10'),_0x1f370e)][_0x4574fc]=_[_0x4f01('0x11')](_0x253d33,attributes);}else{delete _0x1d3379[util['format']('%sQueuesWaitingInteractions',_0x1f370e)][_0x4574fc];}emit(util[_0x4f01('0xf')]('%s:queue:%s',_0x1f370e,_0x1d1a01),util[_0x4f01('0xf')](_0x4f01('0x12'),_0x1f370e,_0x9e2f83?'save':_0x4f01('0x13')),_[_0x4f01('0x11')](_0x253d33,attributes));}var rpc={'openchannelQueueReport':require(_0x4f01('0x14')),'mailQueueReport':require(_0x4f01('0x15')),'chatQueueReport':require(_0x4f01('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x4f01('0x17')),'whatsappQueueReport':require(_0x4f01('0x18'))};var queue=schema({'name':{'type':_0x4f01('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x4f01('0x1a')}});function startRouting(_0x5c6121,_0x55b97a,_0x378963,_0x2cae64){if(_0x5c6121&&_0x55b97a&&_0x378963){_0x55b97a[_0x4f01('0x1b')]+=0x1;var _0x17df0f={'uniqueid':_0x5c6121,'from':_0x378963[_0x4f01('0x1c')]?_0x378963['body'][_0x4f01('0xe')]:'','joinAt':moment()[_0x4f01('0xf')](_0x4f01('0x1d')),'ContactId':_0x378963[_0x4f01('0x1e')]?_0x378963[_0x4f01('0x1e')]['id']:null,'ListId':_0x378963[_0x4f01('0x1f')]?_0x378963['list']['id']:null};_0x17df0f[_[_0x4f01('0x20')](_0x378963['channel'])+_0x4f01('0x21')]=_0x55b97a['id']||null;_0x17df0f[_[_0x4f01('0x20')](_0x378963[_0x4f01('0x22')])+_0x4f01('0x23')]=_0x378963['interaction']?_0x378963['interaction']['id']:null;_0x17df0f[_[_0x4f01('0x20')](_0x378963[_0x4f01('0x22')])+_0x4f01('0x24')]=_0x378963[_0x4f01('0x25')]?_0x378963['message']['id']:null;_0x17df0f[_[_0x4f01('0x20')](_0x378963[_0x4f01('0x22')])+(_0x378963['channel']!==_0x4f01('0x26')?'AccountId':_0x4f01('0x27'))]=_0x378963[_0x4f01('0xc')]?_0x378963[_0x4f01('0xc')]['id']:null;logger[_0x4f01('0x28')](util[_0x4f01('0xf')](_0x4f01('0x29'),_0x5c6121,_0x55b97a[_0x4f01('0x2a')]));emitChannelQueueInteraction(_0x378963['channel'],_0x55b97a[_0x4f01('0x2a')],_0x17df0f,_0x378963[_0x4f01('0xc')]['name'],_0x378963['message']['id'],!![],_0x2cae64,_0x55b97a['id']);if(rpc[_0x378963['channel']+_0x4f01('0x2b')]){return rpc[_0x378963['channel']+'QueueReport']['create'](_0x17df0f)['catch'](function(_0x59d42d){logger['error'](_0x4f01('0x2c'));});}}}function stopRouting(_0x109bfe,_0x435b1e,_0xca505c,_0x4c9d9b){if(_0x109bfe&&_0x435b1e){_0x435b1e[_0x4f01('0x1b')]-=0x1;var _0x3d9dcf={'leaveAt':moment()[_0x4f01('0xf')](_0x4f01('0x1d')),'acceptAt':moment()[_0x4f01('0xf')](_0x4f01('0x1d')),'reason':_0x4f01('0x2d')};logger[_0x4f01('0x28')](util[_0x4f01('0xf')](_0x4f01('0x2e'),_0x109bfe,_0x435b1e['name']));emitChannelQueueInteraction(_0xca505c[_0x4f01('0x22')],_0x435b1e[_0x4f01('0x2a')],_0xca505c[_0x4f01('0x1c')],_0xca505c[_0x4f01('0xc')][_0x4f01('0x2a')],_0xca505c[_0x4f01('0x25')]['id'],![],_0x4c9d9b,_0x435b1e['id']);if(rpc[_0xca505c['channel']+_0x4f01('0x2b')]){return rpc[_0xca505c[_0x4f01('0x22')]+_0x4f01('0x2b')][_0x4f01('0x2f')](_0x109bfe,_0x3d9dcf)[_0x4f01('0x30')](function(_0x564915){logger[_0x4f01('0x31')](_0x4f01('0x32'));});}}}function endRouting(_0x57c336,_0x316f0f,_0x44a239,_0xbf38d5){if(_0x57c336&&_0x316f0f){_0x316f0f[_0x4f01('0x1b')]-=0x1;var _0x2ae4e2={'leaveAt':moment()[_0x4f01('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x4f01('0x1d')),'reason':'timeout'};logger[_0x4f01('0x28')](util['format'](_0x4f01('0x33'),_0x57c336,_0x316f0f[_0x4f01('0x2a')]));emitChannelQueueInteraction(_0x44a239[_0x4f01('0x22')],_0x316f0f[_0x4f01('0x2a')],_0x44a239['body'],_0x44a239[_0x4f01('0xc')][_0x4f01('0x2a')],_0x44a239['message']['id'],![],_0xbf38d5);if(rpc[_0x44a239[_0x4f01('0x22')]+_0x4f01('0x2b')]){return rpc[_0x44a239[_0x4f01('0x22')]+_0x4f01('0x2b')][_0x4f01('0x2f')](_0x57c336,_0x2ae4e2)['catch'](function(_0x2d4242){logger[_0x4f01('0x31')](_0x4f01('0x32'));});}}}function handleFindQueue(_0x29f85a){return function(_0x284359){return _0x284359[_0x4f01('0x2a')][_0x4f01('0x34')]()===_0x29f85a[_0x4f01('0x34')]();};}exports[_0x4f01('0x35')]=function(_0x3c428b,_0x1548b1,_0x10fef4,_0x8b5953){return function(_0x3cda7a){try{var _0x5c1a5c={'name':_0x1548b1[0x0],'timeout':_0x1548b1[0x1]};var _0x4c3837=queue[_0x4f01('0x0')](_0x5c1a5c,{'typecast':!![]});if(_0x4c3837[_0x4f01('0x36')]){logger[_0x4f01('0x31')](_0x4f01('0x37'),_0x3c428b,_['map'](_0x4c3837,_0x4f01('0x25'))[_0x4f01('0x38')](',\x20'));_0x3cda7a['stop']();}else{var _0x558a44=_[_0x4f01('0x39')](_0x10fef4[_0x8b5953['channel']+_0x4f01('0x3a')],handleFindQueue(_0x5c1a5c[_0x4f01('0x2a')]));if(_0x558a44){startRouting(_0x3c428b,_0x558a44,_0x8b5953,_0x10fef4);var _0x490726=(_0x558a44['timeout']||0xa)*0x3e8;var _0x4c4d1a=(_0x5c1a5c[_0x4f01('0x3b')]||0x14)*0x3e8;var _0x2fb1a8,_0x52dd55;if(_0x490726>_0x4c4d1a){_0x4c4d1a=_0x490726;}var _0x2d5562=seqqueue[_0x4f01('0x3c')](_0x490726);_0x2d5562['id']=_0x3c428b;_0x2d5562[_0x4f01('0x3d')]=_0x490726;_0x2d5562[_0x4f01('0x3e')]=_0x4c4d1a;_0x2d5562[_0x4f01('0x22')]=_0x8b5953[_0x4f01('0x22')];_0x10fef4['rules'][_0x3c428b]['on'](_0x4f01('0x3f'),function(){logger[_0x4f01('0x28')](_0x4f01('0x40'),_0x3c428b);stopRouting(_0x3c428b,_0x558a44,_0x8b5953,_0x10fef4);clearTimeout(_0x2fb1a8);_0x2fb1a8=undefined;_0x2d5562[_0x4f01('0x41')](!![]);if(_0x10fef4[_0x4f01('0x42')][_0x3c428b]){delete _0x10fef4[_0x4f01('0x42')][_0x3c428b];}_0x3cda7a['stop']();});_0x10fef4['rules'][_0x3c428b]['on'](_0x4f01('0x43'),function(){if(_0x10fef4['rules'][_0x3c428b]){delete _0x10fef4[_0x4f01('0x42')][_0x3c428b];}});_0x2fb1a8=setTimeout(function(){logger['info'](_0x4f01('0x44'),_0x3c428b);endRouting(_0x3c428b,_0x558a44,_0x8b5953,_0x10fef4);clearTimeout(_0x2fb1a8);_0x2d5562[_0x4f01('0x41')](!![]);_0x3cda7a[_0x4f01('0x45')]();},_0x4c4d1a);switch(_0x558a44[_0x4f01('0x46')]){case'rrmemory':strategy[_0x4f01('0x47')](_0x2d5562,_0x558a44,_0x10fef4,_0x8b5953);break;default:strategy[_0x4f01('0x48')](_0x2d5562,_0x558a44,_0x10fef4,_0x8b5953);}}else{logger[_0x4f01('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3c428b,_0x5c1a5c['name']);_0x3cda7a[_0x4f01('0x49')]();}}}catch(_0x41d31d){console['log'](_0x41d31d);logger['error'](_0x4f01('0x37'),_0x3c428b,_0x41d31d[_0x4f01('0x4a')]);_0x3cda7a[_0x4f01('0x49')]();}};}; \ No newline at end of file +var _0x0563=['./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','from','clone','queue','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing'];(function(_0x38b789,_0x2d32f0){var _0x51143d=function(_0x434e67){while(--_0x434e67){_0x38b789['push'](_0x38b789['shift']());}};_0x51143d(++_0x2d32f0);}(_0x0563,0x1d2));var _0x3056=function(_0x13f054,_0xd90d91){_0x13f054=_0x13f054-0x0;var _0x253d46=_0x0563[_0x13f054];return _0x253d46;};'use strict';var schema=require(_0x3056('0x0'));var _=require(_0x3056('0x1'));var util=require(_0x3056('0x2'));var seqqueue=require(_0x3056('0x3'));var moment=require(_0x3056('0x4'));var Redis=require('ioredis');var config=require(_0x3056('0x5'));var logger=require(_0x3056('0x6'))(_0x3056('0x7'));var strategy=require(_0x3056('0x8'));config['redis']=_[_0x3056('0x9')](config[_0x3056('0xa')],{'host':_0x3056('0xb'),'port':0x18eb});var io=require(_0x3056('0xc'))(new Redis(config[_0x3056('0xa')]));var attributes=['id',_0x3056('0xd'),_0x3056('0xe'),'queue',_0x3056('0xf'),'joinAt'];function emit(_0x25b68d,_0x5845d9,_0x41f5d8){io['to'](_0x25b68d)['emit'](_0x5845d9,_0x41f5d8);}function emitChannelQueueInteraction(_0x312567,_0x1cd57d,_0x156f66,_0xec14e5,_0x2ada00,_0x29f441,_0x43e21e,_0x21c651){var _0xa2a49c=_[_0x3056('0x10')](_0x156f66);_0xa2a49c[_0x3056('0xd')]=_0x21c651;_0xa2a49c[_0x3056('0x11')]=_0x1cd57d;_0xa2a49c['account']=_0xec14e5;_0xa2a49c['id']=_0x2ada00;if(_0x29f441){_0x43e21e[util[_0x3056('0x12')]('%sQueuesWaitingInteractions',_0x312567)][_0x2ada00]=_[_0x3056('0x13')](_0xa2a49c,attributes);}else{delete _0x43e21e[util['format']('%sQueuesWaitingInteractions',_0x312567)][_0x2ada00];}emit(util[_0x3056('0x12')](_0x3056('0x14'),_0x312567,_0x1cd57d),util['format'](_0x3056('0x15'),_0x312567,_0x29f441?_0x3056('0x16'):_0x3056('0x17')),_['pick'](_0xa2a49c,attributes));}var rpc={'openchannelQueueReport':require(_0x3056('0x18')),'mailQueueReport':require(_0x3056('0x19')),'chatQueueReport':require(_0x3056('0x1a')),'smsQueueReport':require(_0x3056('0x1b')),'faxQueueReport':require(_0x3056('0x1c')),'whatsappQueueReport':require(_0x3056('0x1d'))};var queue=schema({'name':{'type':_0x3056('0x1e'),'required':!![],'message':_0x3056('0x1f')},'timeout':{'type':_0x3056('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2f98eb,_0x42371b,_0x1deb20,_0x4d0e36){if(_0x2f98eb&&_0x42371b&&_0x1deb20){_0x42371b[_0x3056('0x21')]+=0x1;var _0x48dbdd={'uniqueid':_0x2f98eb,'from':_0x1deb20['body']?_0x1deb20[_0x3056('0x22')][_0x3056('0xf')]:'','joinAt':moment()[_0x3056('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1deb20[_0x3056('0x23')]?_0x1deb20[_0x3056('0x23')]['id']:null,'ListId':_0x1deb20[_0x3056('0x24')]?_0x1deb20['list']['id']:null};_0x48dbdd[_['upperFirst'](_0x1deb20[_0x3056('0x25')])+_0x3056('0x26')]=_0x42371b['id']||null;_0x48dbdd[_[_0x3056('0x27')](_0x1deb20[_0x3056('0x25')])+_0x3056('0x28')]=_0x1deb20[_0x3056('0x29')]?_0x1deb20[_0x3056('0x29')]['id']:null;_0x48dbdd[_['upperFirst'](_0x1deb20[_0x3056('0x25')])+'MessageId']=_0x1deb20['message']?_0x1deb20[_0x3056('0x2a')]['id']:null;_0x48dbdd[_[_0x3056('0x27')](_0x1deb20[_0x3056('0x25')])+(_0x1deb20['channel']!==_0x3056('0x2b')?_0x3056('0x2c'):_0x3056('0x2d'))]=_0x1deb20[_0x3056('0xe')]?_0x1deb20[_0x3056('0xe')]['id']:null;logger[_0x3056('0x2e')](util[_0x3056('0x12')](_0x3056('0x2f'),_0x2f98eb,_0x42371b['name']));emitChannelQueueInteraction(_0x1deb20[_0x3056('0x25')],_0x42371b[_0x3056('0x30')],_0x48dbdd,_0x1deb20[_0x3056('0xe')][_0x3056('0x30')],_0x1deb20[_0x3056('0x2a')]['id'],!![],_0x4d0e36,_0x42371b['id']);if(rpc[_0x1deb20[_0x3056('0x25')]+_0x3056('0x31')]){return rpc[_0x1deb20[_0x3056('0x25')]+'QueueReport'][_0x3056('0x32')](_0x48dbdd)[_0x3056('0x33')](function(_0x3a9aad){logger['error'](_0x3056('0x34'));});}}}function stopRouting(_0x34793a,_0x5e5169,_0x1d425a,_0x1a29f4){if(_0x34793a&&_0x5e5169){_0x5e5169[_0x3056('0x21')]-=0x1;var _0x5eb4ea={'leaveAt':moment()[_0x3056('0x12')](_0x3056('0x35')),'acceptAt':moment()[_0x3056('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x3056('0x2e')](util['format'](_0x3056('0x36'),_0x34793a,_0x5e5169[_0x3056('0x30')]));emitChannelQueueInteraction(_0x1d425a[_0x3056('0x25')],_0x5e5169[_0x3056('0x30')],_0x1d425a[_0x3056('0x22')],_0x1d425a[_0x3056('0xe')][_0x3056('0x30')],_0x1d425a['message']['id'],![],_0x1a29f4,_0x5e5169['id']);if(rpc[_0x1d425a[_0x3056('0x25')]+'QueueReport']){return rpc[_0x1d425a[_0x3056('0x25')]+'QueueReport'][_0x3056('0x37')](_0x34793a,_0x5eb4ea)[_0x3056('0x33')](function(_0x1de566){logger[_0x3056('0x38')](_0x3056('0x39'));});}}}function endRouting(_0x573330,_0xea96be,_0xbcd7b9,_0x43e7b9){if(_0x573330&&_0xea96be){_0xea96be['waiting']-=0x1;var _0x4c91c4={'leaveAt':moment()[_0x3056('0x12')](_0x3056('0x35')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x3056('0x3a')};logger[_0x3056('0x2e')](util['format'](_0x3056('0x3b'),_0x573330,_0xea96be[_0x3056('0x30')]));emitChannelQueueInteraction(_0xbcd7b9[_0x3056('0x25')],_0xea96be['name'],_0xbcd7b9[_0x3056('0x22')],_0xbcd7b9['account'][_0x3056('0x30')],_0xbcd7b9[_0x3056('0x2a')]['id'],![],_0x43e7b9);if(rpc[_0xbcd7b9[_0x3056('0x25')]+_0x3056('0x31')]){return rpc[_0xbcd7b9[_0x3056('0x25')]+_0x3056('0x31')][_0x3056('0x37')](_0x573330,_0x4c91c4)[_0x3056('0x33')](function(_0x256ed5){logger[_0x3056('0x38')](_0x3056('0x39'));});}}}function handleFindQueue(_0x1e4578){return function(_0x43ba29){return _0x43ba29[_0x3056('0x30')]['toLowerCase']()===_0x1e4578[_0x3056('0x3c')]();};}exports[_0x3056('0x3d')]=function(_0x3b84d0,_0x57b226,_0x26b779,_0x1a574b){return function(_0x2530ee){try{var _0x2fbb45={'name':_0x57b226[0x0],'timeout':_0x57b226[0x1]};var _0xd29734=queue[_0x3056('0x0')](_0x2fbb45,{'typecast':!![]});if(_0xd29734['length']){logger[_0x3056('0x38')](_0x3056('0x3e'),_0x3b84d0,_['map'](_0xd29734,_0x3056('0x2a'))[_0x3056('0x3f')](',\x20'));_0x2530ee[_0x3056('0x40')]();}else{var _0x1dad2e=_[_0x3056('0x41')](_0x26b779[_0x1a574b[_0x3056('0x25')]+_0x3056('0x42')],handleFindQueue(_0x2fbb45[_0x3056('0x30')]));if(_0x1dad2e){startRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);var _0x12f386=(_0x1dad2e['timeout']||0xa)*0x3e8;var _0x56a909=(_0x2fbb45[_0x3056('0x3a')]||0x14)*0x3e8;var _0x550d25,_0x448382;if(_0x12f386>_0x56a909){_0x56a909=_0x12f386;}var _0xb9e0f9=seqqueue['createQueue'](_0x12f386);_0xb9e0f9['id']=_0x3b84d0;_0xb9e0f9[_0x3056('0x43')]=_0x12f386;_0xb9e0f9[_0x3056('0x44')]=_0x56a909;_0xb9e0f9[_0x3056('0x25')]=_0x1a574b[_0x3056('0x25')];_0x26b779[_0x3056('0x45')][_0x3b84d0]['on'](_0x3056('0x46'),function(){logger[_0x3056('0x2e')](_0x3056('0x47'),_0x3b84d0);stopRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);clearTimeout(_0x550d25);_0x550d25=undefined;_0xb9e0f9[_0x3056('0x48')](!![]);if(_0x26b779['rules'][_0x3b84d0]){delete _0x26b779[_0x3056('0x45')][_0x3b84d0];}_0x2530ee['stop']();});_0x26b779[_0x3056('0x45')][_0x3b84d0]['on']('complete',function(){if(_0x26b779['rules'][_0x3b84d0]){delete _0x26b779[_0x3056('0x45')][_0x3b84d0];}});_0x550d25=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x3b84d0);endRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);clearTimeout(_0x550d25);_0xb9e0f9[_0x3056('0x48')](!![]);_0x2530ee[_0x3056('0x49')]();},_0x56a909);switch(_0x1dad2e[_0x3056('0x4a')]){case _0x3056('0x4b'):strategy[_0x3056('0x4b')](_0xb9e0f9,_0x1dad2e,_0x26b779,_0x1a574b);break;default:strategy[_0x3056('0x4c')](_0xb9e0f9,_0x1dad2e,_0x26b779,_0x1a574b);}}else{logger[_0x3056('0x38')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3b84d0,_0x2fbb45[_0x3056('0x30')]);_0x2530ee['stop']();}}}catch(_0x512514){console[_0x3056('0x4d')](_0x512514);logger['error'](_0x3056('0x3e'),_0x3b84d0,_0x512514[_0x3056('0x4e')]);_0x2530ee[_0x3056('0x40')]();}};}; \ 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 e25c909..2f43468 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 _0xf0ab=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','routing','notificationId','realtime','squeue','push','handleTimeout','bind','timeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents'];(function(_0x594312,_0x4cfc1e){var _0x4cc833=function(_0x147ba2){while(--_0x147ba2){_0x594312['push'](_0x594312['shift']());}};_0x4cc833(++_0x4cfc1e);}(_0xf0ab,0xb9));var _0xbf0a=function(_0x489ec1,_0x2d9340){_0x489ec1=_0x489ec1-0x0;var _0x19f2dc=_0xf0ab[_0x489ec1];return _0x19f2dc;};'use strict';var _=require(_0xbf0a('0x0'));var uuid=require(_0xbf0a('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xbf0a('0x2'));var Agent=function(_0x2d05a2,_0x2fe705,_0x30f94b,_0x5de8ed){this[_0xbf0a('0x3')]=uuid['v4']();this['squeue']=_0x2d05a2;this['agent']=_0x2fe705;this[_0xbf0a('0x4')]=_0x30f94b;this[_0xbf0a('0x2')]=_0x5de8ed;this[_0xbf0a('0x5')][_0xbf0a('0x6')](this['handleRun']['bind'](this),this[_0xbf0a('0x7')][_0xbf0a('0x8')](this));this[_0xbf0a('0x5')]['on'](_0xbf0a('0x9'),this[_0xbf0a('0x7')][_0xbf0a('0x8')](this));this[_0xbf0a('0x5')]['on'](_0xbf0a('0xa'),this[_0xbf0a('0xb')][_0xbf0a('0x8')](this));};Agent['prototype']['push']=function(){this[_0xbf0a('0x5')][_0xbf0a('0x6')](this[_0xbf0a('0xc')]['bind'](this),this[_0xbf0a('0x7')][_0xbf0a('0x8')](this));};Agent[_0xbf0a('0xd')][_0xbf0a('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xbf0a('0xc')]=function(_0x530f75){logger[_0xbf0a('0xe')](_0xbf0a('0xf'),this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x10')]['id']);if(_[_0xbf0a('0x11')](this[_0xbf0a('0x4')][_0xbf0a('0x12')][this['agent']['id']])){logger['info'](_0xbf0a('0x13'),this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x10')]['id']);setTimeout(this[_0xbf0a('0x6')][_0xbf0a('0x8')](this),0x3e8);}else{if(this[_0xbf0a('0x2')][_0xbf0a('0x14')]||util[_0xbf0a('0x15')](this['squeue']['id'],this[_0xbf0a('0x4')][_0xbf0a('0x12')][this['agent']['id']],this[_0xbf0a('0x5')][_0xbf0a('0x16')],![])){this['realtime'][_0xbf0a('0x12')][this[_0xbf0a('0x10')]['id']][_0xbf0a('0x17')]=!![];this['realtime']['agents'][this[_0xbf0a('0x10')]['id']][_0xbf0a('0x18')]=undefined;util[_0xbf0a('0x19')](this[_0xbf0a('0x3')],this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x4')][_0xbf0a('0x12')][this[_0xbf0a('0x10')]['id']],null,this['routing']);util[_0xbf0a('0x1a')](this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x4')][_0xbf0a('0x12')][this[_0xbf0a('0x10')]['id']],_0xbf0a('0x1b')+(this[_0xbf0a('0x2')][_0xbf0a('0x14')]?_0xbf0a('0x1c'):''));}else{logger['info'](_0xbf0a('0x1d'),this['squeue']['id'],this[_0xbf0a('0x10')]['id']);setTimeout(this[_0xbf0a('0x6')][_0xbf0a('0x8')](this),0x3e8);}}};Agent[_0xbf0a('0xd')][_0xbf0a('0x7')]=function(_0x57b47e){if(_[_0xbf0a('0x11')](this[_0xbf0a('0x4')]['agents'][this[_0xbf0a('0x10')]['id']])){return logger['info'](_0xbf0a('0x13'),this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x10')]['id']);}else{logger[_0xbf0a('0xe')](_0xbf0a('0x1e'),this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x10')]['id']);util[_0xbf0a('0x1f')](this['notificationId'],this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x4')][_0xbf0a('0x12')][this[_0xbf0a('0x10')]['id']],null,this['routing']);this[_0xbf0a('0x4')][_0xbf0a('0x12')][this['agent']['id']][_0xbf0a('0x17')]=![];this[_0xbf0a('0x4')]['agents'][this[_0xbf0a('0x10')]['id']]['busyQueue']=undefined;util[_0xbf0a('0x1a')](this[_0xbf0a('0x5')]['id'],this[_0xbf0a('0x4')][_0xbf0a('0x12')][this['agent']['id']],_0x57b47e?'STOP':_0xbf0a('0x20'));}if(!_0x57b47e){setTimeout(this[_0xbf0a('0x6')]['bind'](this),0x3e8);}};function agent(_0x931736,_0x538325,_0x3bd5ed,_0x1f5043){return new Agent(_0x931736,_0x538325,_0x3bd5ed,_0x1f5043);}module[_0xbf0a('0x21')]=agent; \ No newline at end of file +var _0x3819=['lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','STOP','TIMEOUT'];(function(_0x47764f,_0x399708){var _0x53e5d6=function(_0x32b4f6){while(--_0x32b4f6){_0x47764f['push'](_0x47764f['shift']());}};_0x53e5d6(++_0x399708);}(_0x3819,0x1a0));var _0x9381=function(_0x5ef726,_0x3ccc9d){_0x5ef726=_0x5ef726-0x0;var _0xaf928f=_0x3819[_0x5ef726];return _0xaf928f;};'use strict';var _=require(_0x9381('0x0'));var uuid=require(_0x9381('0x1'));var util=require(_0x9381('0x2'));var logger=require(_0x9381('0x3'))(_0x9381('0x4'));var Agent=function(_0x4ac071,_0x12f7f1,_0xeede0e,_0x400e39){this[_0x9381('0x5')]=uuid['v4']();this[_0x9381('0x6')]=_0x4ac071;this[_0x9381('0x7')]=_0x12f7f1;this[_0x9381('0x8')]=_0xeede0e;this[_0x9381('0x4')]=_0x400e39;this[_0x9381('0x6')][_0x9381('0x9')](this['handleRun']['bind'](this),this['handleTimeout'][_0x9381('0xa')](this));this[_0x9381('0x6')]['on'](_0x9381('0xb'),this[_0x9381('0xc')]['bind'](this));this['squeue']['on']('drained',this[_0x9381('0xd')][_0x9381('0xa')](this));};Agent[_0x9381('0xe')][_0x9381('0x9')]=function(){this['squeue'][_0x9381('0x9')](this[_0x9381('0xf')][_0x9381('0xa')](this),this[_0x9381('0xc')]['bind'](this));};Agent[_0x9381('0xe')][_0x9381('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x9381('0xe')]['handleRun']=function(_0xb25a7){logger[_0x9381('0x10')](_0x9381('0x11'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);if(_['isNil'](this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']])){logger['info'](_0x9381('0x12'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}else{if(this['routing'][_0x9381('0x13')]||util['isAgentAvailable'](this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],this['squeue']['channel'],![])){this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']][_0x9381('0x15')]=!![];this['realtime'][_0x9381('0x14')][this[_0x9381('0x7')]['id']][_0x9381('0x16')]=undefined;util[_0x9381('0x17')](this[_0x9381('0x5')],this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],null,this[_0x9381('0x4')]);util[_0x9381('0x18')](this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],_0x9381('0x19')+(this[_0x9381('0x4')]['forcedOwnership']?_0x9381('0x1a'):''));}else{logger[_0x9381('0x10')](_0x9381('0x1b'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}}};Agent[_0x9381('0xe')][_0x9381('0xc')]=function(_0x4174a3){if(_[_0x9381('0x1c')](this['realtime'][_0x9381('0x14')][this[_0x9381('0x7')]['id']])){return logger['info'](_0x9381('0x12'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x9381('0x7')]['id']);util[_0x9381('0x1d')](this[_0x9381('0x5')],this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],null,this[_0x9381('0x4')]);this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']][_0x9381('0x15')]=![];this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']][_0x9381('0x16')]=undefined;util[_0x9381('0x18')](this[_0x9381('0x6')]['id'],this['realtime'][_0x9381('0x14')][this['agent']['id']],_0x4174a3?_0x9381('0x1e'):_0x9381('0x1f'));}if(!_0x4174a3){setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}};function agent(_0x4f02df,_0x5d86ae,_0x1b71fd,_0x40d6cc){return new Agent(_0x4f02df,_0x5d86ae,_0x1b71fd,_0x40d6cc);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index a6a0cb6..5ccdcf1 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 _0xb458=['push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','queue','Agents','length','realtime','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','RINGING','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','busyQueue','exports','lodash','uuid','./util','squeue','routing'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xb458,0x103));var _0x8b45=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0xb458[_0x219fa0];return _0xc603fb;};'use strict';var _=require(_0x8b45('0x0'));var uuid=require(_0x8b45('0x1'));var util=require(_0x8b45('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0xdf89d4,_0x93d9cd,_0x141a44,_0x13a8c6){this['notificationId']=uuid['v4']();this[_0x8b45('0x3')]=_0xdf89d4;this['queue']=_0x93d9cd;this['realtime']=_0x141a44;this[_0x8b45('0x4')]=_0x13a8c6;this[_0x8b45('0x3')][_0x8b45('0x5')](this[_0x8b45('0x6')][_0x8b45('0x7')](this),this['handleTimeout'][_0x8b45('0x7')](this));this[_0x8b45('0x3')]['on'](_0x8b45('0x8'),this[_0x8b45('0x9')][_0x8b45('0x7')](this));this['squeue']['on'](_0x8b45('0xa'),this[_0x8b45('0xb')]['bind'](this));};Beepall['prototype']['push']=function(){this['squeue'][_0x8b45('0x5')](this[_0x8b45('0x6')][_0x8b45('0x7')](this),this['handleTimeout'][_0x8b45('0x7')](this));};Beepall[_0x8b45('0xc')][_0x8b45('0xb')]=function(_0x2e5ec3){this[_0x8b45('0x9')](!![]);};Beepall[_0x8b45('0xc')]['handleRun']=function(_0x5a14c1){var _0x45881c=!![];if(!_[_0x8b45('0xd')](this[_0x8b45('0xe')])&&!_[_0x8b45('0xd')](this[_0x8b45('0xe')][_0x8b45('0xf')])&&this[_0x8b45('0xe')][_0x8b45('0xf')][_0x8b45('0x10')]>0x0){for(var _0x391d1e=0x0,_0x287a3b;_0x391d1e0x0){for(var _0x376f6d=0x0,_0x3ab698;_0x376f6d0x0&&_0x489fd4[_0x2a80c1+'CurrentCapacity']>=_0x489fd4[_0x2a80c1+_0xdfdb('0x25')]){writeLog(_0x334cdd,_0x489fd4,_0x2a80c1[_0xdfdb('0x27')]()+_0xdfdb('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x466932,_0x5df454,_0xd0cef0,_0x1aec66,_0x19c36f){return sendNotification(!![],_0x466932,_0x5df454,_0xd0cef0,_0x1aec66,_0x19c36f);};exports['hideNotification']=function(_0x5bc174,_0x1c8ca8,_0xc56435,_0xedbb91,_0x3a2ec3){return sendNotification(![],_0x5bc174,_0x1c8ca8,_0xc56435,_0xedbb91,_0x3a2ec3);};exports[_0xdfdb('0x29')]=writeLog; \ No newline at end of file +var _0x01d9=['user:%s','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','emit','format'];(function(_0x5580c4,_0x54ff4a){var _0x15b48e=function(_0x40201c){while(--_0x40201c){_0x5580c4['push'](_0x5580c4['shift']());}};_0x15b48e(++_0x54ff4a);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var utils=require(_0x901d('0x2'));var Mustache=require(_0x901d('0x3'));var Redis=require('ioredis');var config=require(_0x901d('0x4'));var logger=require(_0x901d('0x5'))(_0x901d('0x6'));config[_0x901d('0x7')]=_[_0x901d('0x8')](config[_0x901d('0x7')],{'host':_0x901d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x901d('0x7')]));function emit(_0x6c9ac8,_0x21e1d7,_0x12c39f){io['to'](_0x6c9ac8)[_0x901d('0xa')](_0x21e1d7,_0x12c39f);}function sendNotification(_0x39fc94,_0x202568,_0x2555e0,_0x15076e,_0xacff40,_0x440fb0){io['to'](util[_0x901d('0xb')](_0x901d('0xc'),_0x15076e['name']))[_0x901d('0xa')]('user:save',_0x15076e);var _0x220153=_0x440fb0||{};var _0x1fd1de=_0x2555e0[_0x901d('0xd')]('.');var _0x42ce79={'uniqueid':_0x202568,'channel':_0x1fd1de[0x0],'id':_0x1fd1de[0x1],'title':_0x1fd1de[0x0]+_0x901d('0xe'),'interactionId':_0x1fd1de[0x2],'queue':_0xacff40?_0xacff40['name']:null,'sound':_0x220153[_0x901d('0xf')][_0x901d('0x10')],'shake':_0x220153[_0x901d('0xf')][_0x901d('0x11')]};try{if(!_0x220153[_0x901d('0x12')]){_0x220153[_0x901d('0x12')]={};}if(_0xacff40){_0x220153['body'][_0x901d('0x13')]=_0xacff40;}else if(_0x220153[_0x901d('0x12')][_0x901d('0x13')]){delete _0x220153[_0x901d('0x12')][_0x901d('0x13')];}_0x42ce79[_0x901d('0x14')]=utils[_0x901d('0x15')](_0x220153[_0x901d('0xf')][_0x901d('0x16')],_0x220153);}catch(_0x3b62e5){_0x42ce79[_0x901d('0x14')]=_0x901d('0x17');logger[_0x901d('0x18')](util[_0x901d('0xb')](_0x901d('0x19'),_0x202568,_0x3b62e5[_0x901d('0x1a')]));}io['to'](util[_0x901d('0xb')](_0x901d('0xc'),_0x15076e['name']))[_0x901d('0xa')](util[_0x901d('0xb')]('notification:%s',_0x39fc94?'save':'remove'),_0x42ce79);}function writeLog(_0x53f8ae,_0x316a9f,_0x44ea6f){return logger['info'](util[_0x901d('0xb')](_0x901d('0x1b'),_0x53f8ae,_0x316a9f['name'],_0x44ea6f));}exports[_0x901d('0x1c')]=function(_0x53ee69,_0x2402de,_0x3f80b9,_0x1e7d36){if(_0x2402de[_0x901d('0x1d')]){writeLog(_0x53ee69,_0x2402de,_0x901d('0x1e'));return![];}if(!_0x2402de[_0x901d('0x1f')]){writeLog(_0x53ee69,_0x2402de,'OFFLINE');return![];}if(_0x2402de[_0x3f80b9+_0x901d('0x20')]){writeLog(_0x53ee69,_0x2402de,_0x901d('0x21'));return![];}if(_0x1e7d36&&_0x2402de[_0x901d('0x22')](_0x3f80b9+_0x901d('0x23'))&&_0x2402de['hasOwnProperty'](_0x3f80b9+_0x901d('0x24'))){if(_0x2402de[_0x3f80b9+_0x901d('0x23')]>0x0&&_0x2402de[_0x3f80b9+_0x901d('0x24')]>=_0x2402de[_0x3f80b9+_0x901d('0x23')]){writeLog(_0x53ee69,_0x2402de,_0x3f80b9[_0x901d('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x901d('0x26')]=function(_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9){return sendNotification(!![],_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9);};exports['hideNotification']=function(_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5){return sendNotification(![],_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5);};exports[_0x901d('0x27')]=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 09fb03c..4e5983f 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 _0xfaba=['replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','routing','consequence','length','[%s][SYSTEM]\x20%s','map','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x4950ec,_0xb31391){var _0x2c68b0=function(_0x37c8a7){while(--_0x37c8a7){_0x4950ec['push'](_0x4950ec['shift']());}};_0x2c68b0(++_0xb31391);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xafab('0x0'));var sh=require(_0xafab('0x1'));var _=require(_0xafab('0x2'));var utils=require(_0xafab('0x3'));var logger=require('../../../../config/logger')(_0xafab('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xafab('0x5')]=function(_0x590d22,_0xf38271){return function(_0x490fe1){try{var _0x180e83={'command':_0xf38271[0x0]};var _0x5154e0=system[_0xafab('0x0')](_0x180e83,{'typecast':!![]});if(_0x5154e0[_0xafab('0x6')]){logger['error'](_0xafab('0x7'),_0x590d22,_[_0xafab('0x8')](_0x5154e0,'message')[_0xafab('0x9')](',\x20'));logger[_0xafab('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x590d22);_0x490fe1['next']();}else{var _0x40273b=this;var _0x14294b=utils[_0xafab('0xb')](_0xf38271[0x0],this);logger['info'](_0xafab('0xc'),_0x590d22,_0x14294b);sh['exec'](_['trim'](_0x14294b),function(_0x7f2b3d,_0x2624b6){logger[_0xafab('0xa')](_0xafab('0xd'),_0x590d22,_0x7f2b3d);if(_0x7f2b3d==0x0){var _0x45aa37=_0x2624b6[_0xafab('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0xafab('0xf')](_0xf38271[0x1])||_['isEmpty'](_0xf38271[0x1])){logger[_0xafab('0xa')](_0xafab('0x10'),_0x590d22);_0x40273b['body'][_0xf38271[0x1]]=_0x45aa37;}else{logger[_0xafab('0xa')](_0xafab('0x11'),_0x590d22,_0xf38271[0x1],_0x45aa37);_0x40273b['body'][_0xf38271[0x1]]=_0x45aa37;}}_0x490fe1[_0xafab('0x12')]();});}}catch(_0x307c5e){logger['error']('[%s][SYSTEM]\x20%s',_0x590d22,_[_0xafab('0x13')](_0x307c5e)?JSON[_0xafab('0x14')](_0x307c5e):_0x307c5e);logger[_0xafab('0xa')](_0xafab('0x15'),_0x590d22);_0x490fe1['next']();}};}; \ No newline at end of file +var _0x6904=['message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map'];(function(_0x4181cd,_0x2f4500){var _0x52c494=function(_0x1b4c0a){while(--_0x1b4c0a){_0x4181cd['push'](_0x4181cd['shift']());}};_0x52c494(++_0x2f4500);}(_0x6904,0xd9));var _0x4690=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x6904[_0x1bbc08];return _0x5d825b;};'use strict';var schema=require(_0x4690('0x0'));var sh=require('shelljs');var _=require(_0x4690('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x4690('0x2'),'required':!![],'message':_0x4690('0x3')}});exports[_0x4690('0x4')]=function(_0x52bcc5,_0x28de92){return function(_0x35dd4){try{var _0x50f994={'command':_0x28de92[0x0]};var _0x3cae20=system[_0x4690('0x0')](_0x50f994,{'typecast':!![]});if(_0x3cae20['length']){logger[_0x4690('0x5')](_0x4690('0x6'),_0x52bcc5,_[_0x4690('0x7')](_0x3cae20,_0x4690('0x8'))[_0x4690('0x9')](',\x20'));logger[_0x4690('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x52bcc5);_0x35dd4[_0x4690('0xb')]();}else{var _0x3d7ad4=this;var _0x3f375d=utils[_0x4690('0xc')](_0x28de92[0x0],this);logger['info'](_0x4690('0xd'),_0x52bcc5,_0x3f375d);sh[_0x4690('0xe')](_[_0x4690('0xf')](_0x3f375d),function(_0x593a46,_0x15576b){logger[_0x4690('0xa')](_0x4690('0x10'),_0x52bcc5,_0x593a46);if(_0x593a46==0x0){var _0x1cb1ac=_0x15576b[_0x4690('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4690('0x12')](_0x28de92[0x1])||_[_0x4690('0x13')](_0x28de92[0x1])){logger['info'](_0x4690('0x14'),_0x52bcc5);_0x3d7ad4[_0x4690('0x15')][_0x28de92[0x1]]=_0x1cb1ac;}else{logger[_0x4690('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x52bcc5,_0x28de92[0x1],_0x1cb1ac);_0x3d7ad4[_0x4690('0x15')][_0x28de92[0x1]]=_0x1cb1ac;}}_0x35dd4['next']();});}}catch(_0x596bc5){logger['error'](_0x4690('0x6'),_0x52bcc5,_[_0x4690('0x16')](_0x596bc5)?JSON[_0x4690('0x17')](_0x596bc5):_0x596bc5);logger[_0x4690('0xa')](_0x4690('0x18'),_0x52bcc5);_0x35dd4['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 f8e3ca4..c6e3e60 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 _0x9b14=['[%s][TAG]\x20%s','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error'];(function(_0x174d2d,_0x186c6d){var _0x28788e=function(_0x4104fc){while(--_0x4104fc){_0x174d2d['push'](_0x174d2d['shift']());}};_0x28788e(++_0x186c6d);}(_0x9b14,0xdc));var _0x49b1=function(_0x1defb2,_0x429099){_0x1defb2=_0x1defb2-0x0;var _0xad8973=_0x9b14[_0x1defb2];return _0xad8973;};'use strict';var schema=require(_0x49b1('0x0'));var _=require(_0x49b1('0x1'));var rpc={'chatInteraction':require(_0x49b1('0x2')),'openchannelInteraction':require(_0x49b1('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x49b1('0x4')),'whatsappInteraction':require(_0x49b1('0x5'))};var logger=require(_0x49b1('0x6'))(_0x49b1('0x7'));var tag=schema({'tag':{'type':_0x49b1('0x8'),'required':!![],'message':_0x49b1('0x9')}});exports[_0x49b1('0xa')]=function(_0x3cc272,_0x59b866,_0x52c295,_0x45c57b){return function(_0x128fe6){try{var _0x1eb51c={'tag':_0x59b866[0x0]};var _0x488ddb=tag[_0x49b1('0x0')](_0x1eb51c,{'typecast':!![]});if(_0x488ddb[_0x49b1('0xb')]){logger['error']('[%s][TAG]\x20%s',_0x3cc272,_[_0x49b1('0xc')](_0x488ddb,'message')['join'](',\x20'));logger[_0x49b1('0xd')](_0x49b1('0xe'),_0x3cc272);_0x128fe6[_0x49b1('0xf')]();}else{var _0x29826b={'ids':[_0x59b866[0x0]]};if(rpc[_0x45c57b[_0x49b1('0x10')]+_0x49b1('0x11')]){rpc[_0x45c57b[_0x49b1('0x10')]+_0x49b1('0x11')][_0x49b1('0x12')](_0x45c57b['interaction']['id'],_0x29826b)[_0x49b1('0x13')](function(_0x91e409){logger[_0x49b1('0xd')](_0x49b1('0x14'),_0x3cc272,_0x59b866[0x1],_0x45c57b[_0x49b1('0x10')],_0x45c57b['interaction']['id']);})[_0x49b1('0x15')](function(_0x3721c8){logger[_0x49b1('0x16')](_0x49b1('0x17'),_0x3cc272,JSON[_0x49b1('0x18')](_0x3721c8));logger[_0x49b1('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3cc272);})[_0x49b1('0x19')](function(){_0x128fe6[_0x49b1('0xf')]();});}}}catch(_0x426a89){logger[_0x49b1('0x16')](_0x49b1('0x17'),_0x3cc272,_[_0x49b1('0x1a')](_0x426a89)?JSON['stringify'](_0x426a89):_0x426a89);logger[_0x49b1('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3cc272);_0x128fe6['next']();}};}; \ No newline at end of file +var _0x75ac=['stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','error'];(function(_0x2a9bb2,_0xccdbcb){var _0x58c695=function(_0x3ef90a){while(--_0x3ef90a){_0x2a9bb2['push'](_0x2a9bb2['shift']());}};_0x58c695(++_0xccdbcb);}(_0x75ac,0xdb));var _0xc75a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x75ac[_0x273c39];return _0x46d6b5;};'use strict';var schema=require(_0xc75a('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xc75a('0x1')),'openchannelInteraction':require(_0xc75a('0x2')),'smsInteraction':require(_0xc75a('0x3')),'mailInteraction':require(_0xc75a('0x4')),'faxInteraction':require(_0xc75a('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xc75a('0x6'))('routing');var tag=schema({'tag':{'type':_0xc75a('0x7'),'required':!![],'message':_0xc75a('0x8')}});exports[_0xc75a('0x9')]=function(_0x174923,_0x38b47d,_0x2c0b6d,_0x4b965e){return function(_0x896c9b){try{var _0x3fe1c7={'tag':_0x38b47d[0x0]};var _0x483eb5=tag[_0xc75a('0x0')](_0x3fe1c7,{'typecast':!![]});if(_0x483eb5[_0xc75a('0xa')]){logger['error'](_0xc75a('0xb'),_0x174923,_['map'](_0x483eb5,_0xc75a('0xc'))[_0xc75a('0xd')](',\x20'));logger[_0xc75a('0xe')](_0xc75a('0xf'),_0x174923);_0x896c9b[_0xc75a('0x10')]();}else{var _0x1246d8={'ids':[_0x38b47d[0x0]]};if(rpc[_0x4b965e[_0xc75a('0x11')]+'Interaction']){rpc[_0x4b965e[_0xc75a('0x11')]+_0xc75a('0x12')][_0xc75a('0x13')](_0x4b965e[_0xc75a('0x14')]['id'],_0x1246d8)[_0xc75a('0x15')](function(_0x7b93ed){logger[_0xc75a('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x174923,_0x38b47d[0x1],_0x4b965e[_0xc75a('0x11')],_0x4b965e['interaction']['id']);})[_0xc75a('0x16')](function(_0x42781a){logger[_0xc75a('0x17')](_0xc75a('0xb'),_0x174923,JSON[_0xc75a('0x18')](_0x42781a));logger[_0xc75a('0xe')](_0xc75a('0xf'),_0x174923);})[_0xc75a('0x19')](function(){_0x896c9b['next']();});}}}catch(_0x443c58){logger[_0xc75a('0x17')]('[%s][TAG]\x20%s',_0x174923,_[_0xc75a('0x1a')](_0x443c58)?JSON['stringify'](_0x443c58):_0x443c58);logger[_0xc75a('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x174923);_0x896c9b[_0xc75a('0x10')]();}};}; \ 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 3686a6b..2a42a2e 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(_0xe7ada9,_0x16cc90){var _0xcfe52d=function(_0x1acafb){while(--_0x1acafb){_0xe7ada9['push'](_0xe7ada9['shift']());}};_0xcfe52d(++_0x16cc90);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x41f1b6,_0x41dd2a){var _0x34c1ca=function(_0x4f4951){while(--_0x4f4951){_0x41f1b6['push'](_0x41f1b6['shift']());}};_0x34c1ca(++_0x41dd2a);}(_0xe706,0xa3));var _0x6e70=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0xe706[_0x2f1908];return _0x357795;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3fc1949..27864c8 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 _0x5b11=['mail','push','join','slice','dialogflow','appdata','dialogflowv2','amazonlex','format','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','message','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId','Intervals','map','isNil','interval','listen','rules','channel','interaction','isArray','applications','length','existsSync','.js','app','toLowerCase','autoreply','split'];(function(_0x2928cf,_0x1ff76a){var _0x37e976=function(_0x2f3408){while(--_0x2f3408){_0x2928cf['push'](_0x2928cf['shift']());}};_0x37e976(++_0x1ff76a);}(_0x5b11,0x155));var _0x15b1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5b11[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x15b1('0x0'));var util=require(_0x15b1('0x1'));var path=require(_0x15b1('0x2'));var fs=require('fs');var jayson=require(_0x15b1('0x3'));var BPromise=require(_0x15b1('0x4'));var uuid=require(_0x15b1('0x5'));var config=require('../../../config/environment');var logger=require(_0x15b1('0x6'))(_0x15b1('0x7'));var rpc={'openchannelQueueReport':require(_0x15b1('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x15b1('0x9')),'faxQueueReport':require(_0x15b1('0xa')),'whatsappQueueReport':require(_0x15b1('0xb'))};var RuleEngine=require(_0x15b1('0xc'));function getId(_0x22a84b,_0x5b1aae,_0x368a87){return util['format']('%s.%s.%s',_0x22a84b,_0x5b1aae||0x0,_0x368a87||0x0);}function getIntervals(_0x11ba0d,_0x317c8c){var _0x269838=[];if(!_['isNil'](_0x317c8c[_0x15b1('0xd')])&&!_['isNil'](_0x11ba0d[_0x317c8c[_0x15b1('0xd')]])&&!_['isNil'](_0x11ba0d[_0x317c8c['IntervalId']][_0x15b1('0xe')])){_0x269838=_[_0x15b1('0xf')](_0x11ba0d[_0x317c8c[_0x15b1('0xd')]][_0x15b1('0xe')],'interval');}else if(!_[_0x15b1('0x10')](_0x317c8c[_0x15b1('0x11')])){_0x269838=[_0x317c8c['interval']];}return _0x269838;}exports[_0x15b1('0x12')]=function(_0x252d8f){_0x252d8f[_0x15b1('0x13')]={};return new BPromise(function(_0x4faa16,_0x482616){var _0x5affe2={'Start':function(_0x540c04){var _0x1723aa=this;return new Promise(function(_0xc08a09,_0x418ac7){if(_0x540c04){try{var _0x265011=[];var _0x464604=getId(_0x540c04[_0x15b1('0x14')],_0x540c04['message']?_0x540c04['message']['id']:0x0,_0x540c04['interaction']?_0x540c04[_0x15b1('0x15')]['id']:0x0);if(_0x540c04['applications']&&_[_0x15b1('0x16')](_0x540c04[_0x15b1('0x17')])&&_0x540c04[_0x15b1('0x17')][_0x15b1('0x18')]){for(var _0x4428d0=0x0;_0x4428d0<_0x540c04[_0x15b1('0x17')][_0x15b1('0x18')];_0x4428d0+=0x1){var _0x4a44ac=_0x540c04[_0x15b1('0x17')][_0x4428d0];if(fs[_0x15b1('0x19')](path['join'](__dirname,_0x15b1('0x17'),_0x4a44ac['app']+_0x15b1('0x1a')))){var _0x8b280c=[];switch(_0x4a44ac[_0x15b1('0x1b')][_0x15b1('0x1c')]()){case _0x15b1('0x1d'):var _0x3f3219=_0x4a44ac['appdata'][_0x15b1('0x1e')](',');if(_0x540c04['channel']===_0x15b1('0x1f')){_0x8b280c[_0x15b1('0x20')](_0x3f3219[0x0]);_0x8b280c[_0x15b1('0x20')](_0x3f3219[0x1]);_0x8b280c[_0x15b1('0x20')](_0x3f3219['slice'](0x2,_0x3f3219[_0x15b1('0x18')])[_0x15b1('0x21')](','));}else{_0x8b280c[_0x15b1('0x20')](_0x3f3219[0x0]);_0x8b280c[_0x15b1('0x20')](_0x3f3219[_0x15b1('0x22')](0x1,_0x3f3219[_0x15b1('0x18')])[_0x15b1('0x21')](','));}break;case _0x15b1('0x23'):var _0x45d6d9=_0x4a44ac[_0x15b1('0x24')][_0x15b1('0x1e')](',');_0x8b280c[_0x15b1('0x20')](_0x45d6d9[0x0]);_0x8b280c[_0x15b1('0x20')](_0x45d6d9[0x1]);_0x8b280c['push'](_0x45d6d9[_0x15b1('0x22')](0x2,_0x45d6d9[_0x15b1('0x18')])['join'](','));break;case _0x15b1('0x25'):var _0x1d66af=_0x4a44ac[_0x15b1('0x24')][_0x15b1('0x1e')](',');_0x8b280c[_0x15b1('0x20')](_0x1d66af[0x0]);_0x8b280c[_0x15b1('0x20')](_0x1d66af[0x1]);_0x8b280c[_0x15b1('0x20')](_0x1d66af[0x2]);_0x8b280c['push'](_0x1d66af[0x3]);_0x8b280c[_0x15b1('0x20')](_0x1d66af[_0x15b1('0x22')](0x4,_0x1d66af[_0x15b1('0x18')])[_0x15b1('0x21')](','));break;case _0x15b1('0x26'):var _0x3f0f98=_0x4a44ac[_0x15b1('0x24')]['split'](',');_0x8b280c[_0x15b1('0x20')](_0x3f0f98[0x0]);_0x8b280c[_0x15b1('0x20')](_0x3f0f98[0x1]);_0x8b280c[_0x15b1('0x20')](_0x3f0f98[0x2]);_0x8b280c['push'](_0x3f0f98[0x3]);_0x8b280c[_0x15b1('0x20')](_0x3f0f98[_0x15b1('0x22')](0x4,_0x3f0f98[_0x15b1('0x18')])[_0x15b1('0x21')](','));break;case'message':_0x8b280c[_0x15b1('0x20')](_0x4a44ac[_0x15b1('0x24')]);break;case'tag':_0x8b280c['push'](_0x4a44ac['TagId']);_0x8b280c[_0x15b1('0x20')](_0x4a44ac['appdata']);break;default:_0x8b280c=_[_0x15b1('0x10')](_0x4a44ac[_0x15b1('0x24')])?[]:_0x4a44ac[_0x15b1('0x24')]['split'](',');}var _0x1bf6f1={'id':util[_0x15b1('0x27')](_0x15b1('0x28'),_0x464604,_0x4a44ac['id'],_0x4a44ac[_0x15b1('0x1b')]),'condition':require(_0x15b1('0x29'))['condition'](_0x464604,getIntervals(_0x252d8f[_0x15b1('0x2a')],_0x4a44ac),_0x252d8f),'consequence':require(_0x15b1('0x2b')+_0x4a44ac[_0x15b1('0x1b')])[_0x15b1('0x2c')](_0x464604,_0x8b280c,_0x252d8f,_0x540c04),'p':_0x4a44ac['priority']||0x0};logger[_0x15b1('0x2d')](_0x15b1('0x2e'),_0x1bf6f1['id'],_0x15b1('0x2f'),getIntervals(_0x252d8f[_0x15b1('0x2a')],_0x4a44ac)['join']('\x20|\x20'));_0x265011[_0x15b1('0x20')](_0x1bf6f1);}else{logger[_0x15b1('0x30')](_0x15b1('0x31'),path['join'](__dirname,_0x15b1('0x17'),_0x4a44ac[_0x15b1('0x1b')]+_0x15b1('0x1a')));}}_0x252d8f['rules'][_0x464604]=new RuleEngine(_0x265011);_0x252d8f[_0x15b1('0x13')][_0x464604][_0x15b1('0x32')](_0x540c04,function(_0x102be6){logger['info'](_0x15b1('0x33'),JSON[_0x15b1('0x34')](_0x102be6['matchPath']));if(_0x252d8f['rules'][_0x464604]){_0x252d8f[_0x15b1('0x13')][_0x464604][_0x15b1('0x35')]('complete');}});return _0xc08a09({'code':0xc8,'message':_0x540c04});}else{logger[_0x15b1('0x2d')](_0x15b1('0x36'));return _0xc08a09({'code':0xc8,'message':_0x540c04});}}catch(_0x323ba3){logger[_0x15b1('0x30')](_0x323ba3[_0x15b1('0x37')]);return _0x418ac7(_0x1723aa[_0x15b1('0x30')](0x1f4,_0x323ba3));}}return _0x418ac7(_0x15b1('0x38'));});},'AcceptMessage':function(_0x3be55a){var _0x469410=this;return new Promise(function(_0x4f5a23,_0xb1cd14){if(_0x3be55a['agent']&&_0x3be55a[_0x15b1('0x39')]['id']){if(_0x252d8f[_0x15b1('0x3a')][_0x3be55a[_0x15b1('0x39')]['id']]){_0x252d8f[_0x15b1('0x3a')][_0x3be55a[_0x15b1('0x39')]['id']]['busy']=![];_0x252d8f[_0x15b1('0x3a')][_0x3be55a['agent']['id']][_0x15b1('0x3b')]=undefined;}}if(_0x3be55a[_0x15b1('0x3c')]&&_0x3be55a[_0x15b1('0x3c')]['id']){try{var _0x44c9ce=getId(_0x3be55a[_0x15b1('0x14')],_0x3be55a[_0x15b1('0x3c')]?_0x3be55a['message']['id']:0x0,_0x3be55a[_0x15b1('0x15')]?_0x3be55a['interaction']['id']:0x0);if(_0x252d8f[_0x15b1('0x13')][_0x44c9ce]){_0x252d8f['rules'][_0x44c9ce][_0x15b1('0x35')]('end');if(rpc[_0x3be55a[_0x15b1('0x14')]+'QueueReport']){rpc[_0x3be55a[_0x15b1('0x14')]+_0x15b1('0x3d')]['update'](_0x44c9ce,{'UserId':_0x3be55a[_0x15b1('0x3c')][_0x15b1('0x3e')]})['catch'](function(_0x155f51){logger[_0x15b1('0x30')](_0x15b1('0x3f'));});}}return _0x4f5a23({'code':0xc8,'message':_0x3be55a});}catch(_0x3d9d37){logger['error'](_0x3d9d37[_0x15b1('0x37')]);return _0xb1cd14(_0x469410['error'](0x1f4,_0x3d9d37));}}logger[_0x15b1('0x30')]('message\x20is\x20empty');return _0xb1cd14(_0x469410['error'](0x1f4,_0x15b1('0x40')));});},'RejectMessage':function(_0x540ce6){var _0x494660=this;return new Promise(function(_0x2e9cbc,_0xbb663f){if(_0x540ce6['agent']&&_0x540ce6['agent']['id']){try{if(_0x252d8f[_0x15b1('0x3a')][_0x540ce6[_0x15b1('0x39')]['id']]){_0x252d8f[_0x15b1('0x3a')][_0x540ce6[_0x15b1('0x39')]['id']][_0x15b1('0x41')]=![];_0x252d8f[_0x15b1('0x3a')][_0x540ce6[_0x15b1('0x39')]['id']][_0x15b1('0x3b')]=undefined;}return _0x2e9cbc({'code':0xc8,'message':_0x540ce6});}catch(_0xa244ed){logger[_0x15b1('0x30')](_0xa244ed[_0x15b1('0x37')]);return _0xbb663f(_0x494660[_0x15b1('0x30')](0x1f4,_0xa244ed));}}logger['error'](_0x15b1('0x40'));return _0xbb663f(_0x494660[_0x15b1('0x30')](0x1f4,_0x15b1('0x40')));});},'AbandonInteraction':function(_0x1a3f87){var _0x3c083a=this;return new Promise(function(_0x512f23,_0x200c0a){if(_0x1a3f87[_0x15b1('0x14')]&&_0x1a3f87[_0x15b1('0x15')]&&_0x1a3f87[_0x15b1('0x15')]['id']){try{var _0x45e0b3=getId(_0x1a3f87[_0x15b1('0x14')],_0x1a3f87[_0x15b1('0x3c')]?_0x1a3f87[_0x15b1('0x3c')]['id']:0x0,_0x1a3f87[_0x15b1('0x15')]?_0x1a3f87[_0x15b1('0x15')]['id']:0x0);if(_0x252d8f['rules'][_0x45e0b3]){_0x252d8f[_0x15b1('0x13')][_0x45e0b3][_0x15b1('0x35')](_0x15b1('0x42'));}return _0x512f23({'code':0xc8,'message':_0x1a3f87});}catch(_0x411bb7){logger[_0x15b1('0x30')](_0x411bb7['stack']);return _0x200c0a(_0x3c083a[_0x15b1('0x30')](0x1f4,_0x411bb7));}}logger[_0x15b1('0x30')](_0x15b1('0x40'));return _0x200c0a(_0x3c083a[_0x15b1('0x30')](0x1f4,_0x15b1('0x40')));});},'AgentCapacity':function(_0x35e667){var _0x57e5f6=this;return new Promise(function(_0x50c358,_0x514d7f){if(_0x252d8f[_0x15b1('0x3a')][_0x15b1('0x43')](_0x35e667['id'])){for(var _0x1dccbe in _0x35e667[_0x15b1('0x44')]){if(_0x35e667['capacity'][_0x15b1('0x43')](_0x1dccbe)){if(_0x252d8f[_0x15b1('0x3a')][_0x35e667['id']][_0x15b1('0x43')](_0x1dccbe+_0x15b1('0x45'))){_0x252d8f[_0x15b1('0x3a')][_0x35e667['id']][_0x1dccbe+_0x15b1('0x45')]=parseInt(_0x35e667[_0x15b1('0x44')][_0x1dccbe],0xa);}}}_0x252d8f[_0x15b1('0x3a')][_0x35e667['id']][_0x15b1('0x46')]();return _0x50c358({'code':0xc8,'message':_0x252d8f[_0x15b1('0x3a')][_0x35e667['id']]});}else{return _0x514d7f(_0x57e5f6[_0x15b1('0x30')](0x1f4,_0x15b1('0x47')));}});},'Agents':function(_0x4ea317){return new Promise(function(_0x537916,_0x285847){var _0x4c8f76=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x3a')]);_0x537916({'count':_0x4c8f76[_0x15b1('0x18')],'rows':_0x4c8f76});});},'ChatQueues':function(_0x3517b7){return new Promise(function(_0xb0ae7,_0x3e966a){var _0x2257e8=[];for(var _0x3fbe01 in _0x252d8f[_0x15b1('0x49')]){if(_0x252d8f[_0x15b1('0x49')][_0x15b1('0x43')](_0x3fbe01)){var _0x902307=_0x252d8f[_0x15b1('0x49')][_0x3fbe01];var _0x30d0a3={'id':_0x902307['id'],'available':_0x902307[_0x15b1('0x4a')],'loggedIn':_0x902307['loggedIn'],'name':_0x902307[_0x15b1('0x4b')],'paused':_0x902307[_0x15b1('0x4c')],'waiting':_0x902307[_0x15b1('0x4d')]};_0x2257e8['push'](_0x30d0a3);}}_0xb0ae7({'count':_0x2257e8[_0x15b1('0x18')],'rows':_0x2257e8});});},'MailQueues':function(_0x27c210){return new Promise(function(_0x13526e,_0x2b57f2){var _0x4ae0c3=[];for(var _0x4e634a in _0x252d8f[_0x15b1('0x4e')]){if(_0x252d8f[_0x15b1('0x4e')][_0x15b1('0x43')](_0x4e634a)){var _0x4938e2=_0x252d8f['mailQueues'][_0x4e634a];var _0x1a9203={'id':_0x4938e2['id'],'available':_0x4938e2['available'],'loggedIn':_0x4938e2[_0x15b1('0x4f')],'name':_0x4938e2[_0x15b1('0x4b')],'paused':_0x4938e2['paused'],'waiting':_0x4938e2['waiting']};_0x4ae0c3['push'](_0x1a9203);}}_0x13526e({'count':_0x4ae0c3[_0x15b1('0x18')],'rows':_0x4ae0c3});});},'OpenchannelQueues':function(_0x4e8a36){return new Promise(function(_0x2a7a1c,_0x35ac8d){var _0x45a0ab=[];for(var _0x5815a5 in _0x252d8f[_0x15b1('0x50')]){if(_0x252d8f['openchannelQueues'][_0x15b1('0x43')](_0x5815a5)){var _0x7f008c=_0x252d8f[_0x15b1('0x50')][_0x5815a5];var _0x5835d4={'id':_0x7f008c['id'],'available':_0x7f008c['available'],'loggedIn':_0x7f008c[_0x15b1('0x4f')],'name':_0x7f008c[_0x15b1('0x4b')],'paused':_0x7f008c[_0x15b1('0x4c')],'waiting':_0x7f008c['waiting']};_0x45a0ab[_0x15b1('0x20')](_0x5835d4);}}_0x2a7a1c({'count':_0x45a0ab[_0x15b1('0x18')],'rows':_0x45a0ab});});},'SmsQueues':function(_0x39605c){return new Promise(function(_0x1e4a2a,_0x27ca0a){var _0x5543b0=[];for(var _0x3c34d5 in _0x252d8f['smsQueues']){if(_0x252d8f[_0x15b1('0x51')][_0x15b1('0x43')](_0x3c34d5)){var _0x5dd651=_0x252d8f[_0x15b1('0x51')][_0x3c34d5];var _0x3e085f={'id':_0x5dd651['id'],'available':_0x5dd651[_0x15b1('0x4a')],'loggedIn':_0x5dd651['loggedIn'],'name':_0x5dd651[_0x15b1('0x4b')],'paused':_0x5dd651['paused'],'waiting':_0x5dd651[_0x15b1('0x4d')]};_0x5543b0[_0x15b1('0x20')](_0x3e085f);}}_0x1e4a2a({'count':_0x5543b0[_0x15b1('0x18')],'rows':_0x5543b0});});},'FaxQueues':function(_0x41625c){return new Promise(function(_0x3898cf,_0x423898){var _0x23ee54=[];for(var _0x35ce61 in _0x252d8f['faxQueues']){if(_0x252d8f[_0x15b1('0x52')][_0x15b1('0x43')](_0x35ce61)){var _0xfb78f2=_0x252d8f[_0x15b1('0x52')][_0x35ce61];var _0xd5d490={'id':_0xfb78f2['id'],'available':_0xfb78f2[_0x15b1('0x4a')],'loggedIn':_0xfb78f2[_0x15b1('0x4f')],'name':_0xfb78f2[_0x15b1('0x4b')],'paused':_0xfb78f2[_0x15b1('0x4c')],'waiting':_0xfb78f2[_0x15b1('0x4d')]};_0x23ee54[_0x15b1('0x20')](_0xd5d490);}}_0x3898cf({'count':_0x23ee54[_0x15b1('0x18')],'rows':_0x23ee54});});},'WhatsappQueues':function(_0x378e61){return new Promise(function(_0x289001,_0x26a6e1){var _0x1ce041=[];for(var _0x175b3d in _0x252d8f[_0x15b1('0x53')]){if(_0x252d8f['whatsappQueues'][_0x15b1('0x43')](_0x175b3d)){var _0x56cd3d=_0x252d8f['whatsappQueues'][_0x175b3d];var _0xea487b={'id':_0x56cd3d['id'],'available':_0x56cd3d[_0x15b1('0x4a')],'loggedIn':_0x56cd3d[_0x15b1('0x4f')],'name':_0x56cd3d['name'],'paused':_0x56cd3d[_0x15b1('0x4c')],'waiting':_0x56cd3d[_0x15b1('0x4d')]};_0x1ce041['push'](_0xea487b);}}_0x289001({'count':_0x1ce041[_0x15b1('0x18')],'rows':_0x1ce041});});},'ChatQueuesWaitingInteractions':function(_0x98edb6){return new Promise(function(_0x301d7d,_0x32315a){var _0x5427d2=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x54')]);_0x301d7d({'count':_0x5427d2['length'],'rows':_0x5427d2});});},'MailQueuesWaitingInteractions':function(_0x1d1268){return new Promise(function(_0x2e7ff9,_0x23c324){var _0x164a67=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x55')]);_0x2e7ff9({'count':_0x164a67[_0x15b1('0x18')],'rows':_0x164a67});});},'OpenchannelQueuesWaitingInteractions':function(_0x59ba65){return new Promise(function(_0x17926d,_0xcefb23){var _0x1488d7=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x56')]);_0x17926d({'count':_0x1488d7[_0x15b1('0x18')],'rows':_0x1488d7});});},'SmsQueuesWaitingInteractions':function(_0x2d8e90){return new Promise(function(_0x44360b,_0x2746e5){var _0x2a9e99=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x57')]);_0x44360b({'count':_0x2a9e99[_0x15b1('0x18')],'rows':_0x2a9e99});});},'FaxQueuesWaitingInteractions':function(_0x3972c9){return new Promise(function(_0x17118d,_0x25f09a){var _0x2e481a=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x58')]);_0x17118d({'count':_0x2e481a[_0x15b1('0x18')],'rows':_0x2e481a});});},'WhatsappQueuesWaitingInteractions':function(_0xb3f57b){return new Promise(function(_0x33d9d0,_0x4387d5){var _0x2fb276=_[_0x15b1('0x48')](_0x252d8f[_0x15b1('0x59')]);_0x33d9d0({'count':_0x2fb276['length'],'rows':_0x2fb276});});}};var _0xeaf07f=jayson[_0x15b1('0x5a')](_0x5affe2)['http']();_0xeaf07f['on'](_0x15b1('0x30'),function(_0x106354){logger[_0x15b1('0x30')](JSON[_0x15b1('0x34')](_0x106354));return _0x482616(_0x106354);});_0xeaf07f['listen'](0x232c,_0x15b1('0x5b'),function(){console['log'](_0x15b1('0x5c'),0x232c);return _0x4faa16('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xd898=['Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','rules','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','busy','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info'];(function(_0xfe575e,_0x58ac73){var _0x31bcc2=function(_0xc2ed6e){while(--_0xc2ed6e){_0xfe575e['push'](_0xfe575e['shift']());}};_0x31bcc2(++_0x58ac73);}(_0xd898,0x91));var _0x8d89=function(_0x473d49,_0x3a4e16){_0x473d49=_0x473d49-0x0;var _0x424370=_0xd898[_0x473d49];return _0x424370;};'use strict';var _=require(_0x8d89('0x0'));var util=require('util');var path=require(_0x8d89('0x1'));var fs=require('fs');var jayson=require(_0x8d89('0x2'));var BPromise=require(_0x8d89('0x3'));var uuid=require(_0x8d89('0x4'));var config=require(_0x8d89('0x5'));var logger=require(_0x8d89('0x6'))(_0x8d89('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8d89('0x8')),'chatQueueReport':require(_0x8d89('0x9')),'smsQueueReport':require(_0x8d89('0xa')),'faxQueueReport':require(_0x8d89('0xb')),'whatsappQueueReport':require(_0x8d89('0xc'))};var RuleEngine=require(_0x8d89('0xd'));function getId(_0x17bc61,_0x149bd6,_0x2834da){return util['format']('%s.%s.%s',_0x17bc61,_0x149bd6||0x0,_0x2834da||0x0);}function getIntervals(_0x50cfcd,_0x43299c){var _0x2ae0ef=[];if(!_[_0x8d89('0xe')](_0x43299c[_0x8d89('0xf')])&&!_[_0x8d89('0xe')](_0x50cfcd[_0x43299c[_0x8d89('0xf')]])&&!_[_0x8d89('0xe')](_0x50cfcd[_0x43299c[_0x8d89('0xf')]][_0x8d89('0x10')])){_0x2ae0ef=_[_0x8d89('0x11')](_0x50cfcd[_0x43299c['IntervalId']][_0x8d89('0x10')],_0x8d89('0x12'));}else if(!_[_0x8d89('0xe')](_0x43299c[_0x8d89('0x12')])){_0x2ae0ef=[_0x43299c[_0x8d89('0x12')]];}return _0x2ae0ef;}exports[_0x8d89('0x13')]=function(_0xe1bf11){_0xe1bf11['rules']={};return new BPromise(function(_0x5275cb,_0x29ab4d){var _0x819c83={'Start':function(_0x2d4307){var _0x5c2d35=this;return new Promise(function(_0x18e1f4,_0x812e90){if(_0x2d4307){try{var _0x943316=[];var _0x1c56ae=getId(_0x2d4307[_0x8d89('0x14')],_0x2d4307[_0x8d89('0x15')]?_0x2d4307[_0x8d89('0x15')]['id']:0x0,_0x2d4307[_0x8d89('0x16')]?_0x2d4307['interaction']['id']:0x0);if(_0x2d4307[_0x8d89('0x17')]&&_[_0x8d89('0x18')](_0x2d4307[_0x8d89('0x17')])&&_0x2d4307[_0x8d89('0x17')]['length']){for(var _0x1ee701=0x0;_0x1ee701<_0x2d4307[_0x8d89('0x17')][_0x8d89('0x19')];_0x1ee701+=0x1){var _0x1c5787=_0x2d4307[_0x8d89('0x17')][_0x1ee701];if(fs[_0x8d89('0x1a')](path[_0x8d89('0x1b')](__dirname,_0x8d89('0x17'),_0x1c5787[_0x8d89('0x1c')]+_0x8d89('0x1d')))){var _0x1341b7=[];switch(_0x1c5787[_0x8d89('0x1c')][_0x8d89('0x1e')]()){case _0x8d89('0x1f'):var _0x1882e4=_0x1c5787['appdata'][_0x8d89('0x20')](',');if(_0x2d4307[_0x8d89('0x14')]===_0x8d89('0x21')){_0x1341b7['push'](_0x1882e4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x1882e4[0x1]);_0x1341b7[_0x8d89('0x22')](_0x1882e4['slice'](0x2,_0x1882e4[_0x8d89('0x19')])[_0x8d89('0x1b')](','));}else{_0x1341b7[_0x8d89('0x22')](_0x1882e4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x1882e4[_0x8d89('0x23')](0x1,_0x1882e4['length'])[_0x8d89('0x1b')](','));}break;case _0x8d89('0x24'):var _0x273764=_0x1c5787[_0x8d89('0x25')][_0x8d89('0x20')](',');_0x1341b7[_0x8d89('0x22')](_0x273764[0x0]);_0x1341b7[_0x8d89('0x22')](_0x273764[0x1]);_0x1341b7[_0x8d89('0x22')](_0x273764[_0x8d89('0x23')](0x2,_0x273764[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case _0x8d89('0x26'):var _0x3a8300=_0x1c5787[_0x8d89('0x25')][_0x8d89('0x20')](',');_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x0]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x1]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x2]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x3]);_0x1341b7['push'](_0x3a8300[_0x8d89('0x23')](0x4,_0x3a8300[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case'amazonlex':var _0x196ca4=_0x1c5787[_0x8d89('0x25')]['split'](',');_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x1]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x2]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x3]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[_0x8d89('0x23')](0x4,_0x196ca4[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case _0x8d89('0x15'):_0x1341b7[_0x8d89('0x22')](_0x1c5787[_0x8d89('0x25')]);break;case _0x8d89('0x27'):_0x1341b7['push'](_0x1c5787[_0x8d89('0x28')]);_0x1341b7[_0x8d89('0x22')](_0x1c5787[_0x8d89('0x25')]);break;default:_0x1341b7=_['isNil'](_0x1c5787[_0x8d89('0x25')])?[]:_0x1c5787[_0x8d89('0x25')]['split'](',');}var _0x326747={'id':util[_0x8d89('0x29')](_0x8d89('0x2a'),_0x1c56ae,_0x1c5787['id'],_0x1c5787[_0x8d89('0x1c')]),'condition':require(_0x8d89('0x2b'))[_0x8d89('0x2c')](_0x1c56ae,getIntervals(_0xe1bf11[_0x8d89('0x2d')],_0x1c5787),_0xe1bf11),'consequence':require(_0x8d89('0x2e')+_0x1c5787[_0x8d89('0x1c')])['consequence'](_0x1c56ae,_0x1341b7,_0xe1bf11,_0x2d4307),'p':_0x1c5787[_0x8d89('0x2f')]||0x0};logger[_0x8d89('0x30')](_0x8d89('0x31'),_0x326747['id'],'on\x20interval',getIntervals(_0xe1bf11[_0x8d89('0x2d')],_0x1c5787)[_0x8d89('0x1b')](_0x8d89('0x32')));_0x943316[_0x8d89('0x22')](_0x326747);}else{logger[_0x8d89('0x33')](_0x8d89('0x34'),path[_0x8d89('0x1b')](__dirname,_0x8d89('0x17'),_0x1c5787['app']+'.js'));}}_0xe1bf11['rules'][_0x1c56ae]=new RuleEngine(_0x943316);_0xe1bf11['rules'][_0x1c56ae]['execute'](_0x2d4307,function(_0x4a49ca){logger['info'](_0x8d89('0x35'),JSON[_0x8d89('0x36')](_0x4a49ca['matchPath']));if(_0xe1bf11[_0x8d89('0x37')][_0x1c56ae]){_0xe1bf11[_0x8d89('0x37')][_0x1c56ae][_0x8d89('0x38')](_0x8d89('0x39'));}});return _0x18e1f4({'code':0xc8,'message':_0x2d4307});}else{logger['info'](_0x8d89('0x3a'));return _0x18e1f4({'code':0xc8,'message':_0x2d4307});}}catch(_0x3f76a5){logger[_0x8d89('0x33')](_0x3f76a5[_0x8d89('0x3b')]);return _0x812e90(_0x5c2d35['error'](0x1f4,_0x3f76a5));}}return _0x812e90(_0x8d89('0x3c'));});},'AcceptMessage':function(_0x12819b){var _0x4a6069=this;return new Promise(function(_0x3239f2,_0x40d30a){if(_0x12819b[_0x8d89('0x3d')]&&_0x12819b[_0x8d89('0x3d')]['id']){if(_0xe1bf11['agents'][_0x12819b[_0x8d89('0x3d')]['id']]){_0xe1bf11[_0x8d89('0x3e')][_0x12819b[_0x8d89('0x3d')]['id']]['busy']=![];_0xe1bf11[_0x8d89('0x3e')][_0x12819b[_0x8d89('0x3d')]['id']][_0x8d89('0x3f')]=undefined;}}if(_0x12819b[_0x8d89('0x15')]&&_0x12819b[_0x8d89('0x15')]['id']){try{var _0x42e0f4=getId(_0x12819b[_0x8d89('0x14')],_0x12819b[_0x8d89('0x15')]?_0x12819b[_0x8d89('0x15')]['id']:0x0,_0x12819b[_0x8d89('0x16')]?_0x12819b[_0x8d89('0x16')]['id']:0x0);if(_0xe1bf11['rules'][_0x42e0f4]){_0xe1bf11[_0x8d89('0x37')][_0x42e0f4]['emit'](_0x8d89('0x40'));if(rpc[_0x12819b['channel']+_0x8d89('0x41')]){rpc[_0x12819b[_0x8d89('0x14')]+'QueueReport'][_0x8d89('0x42')](_0x42e0f4,{'UserId':_0x12819b[_0x8d89('0x15')][_0x8d89('0x43')]})[_0x8d89('0x44')](function(_0x22c39c){logger['error'](_0x8d89('0x45'));});}}return _0x3239f2({'code':0xc8,'message':_0x12819b});}catch(_0x3f5f06){logger['error'](_0x3f5f06[_0x8d89('0x3b')]);return _0x40d30a(_0x4a6069[_0x8d89('0x33')](0x1f4,_0x3f5f06));}}logger[_0x8d89('0x33')]('message\x20is\x20empty');return _0x40d30a(_0x4a6069['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x592bb3){var _0x2ef3ea=this;return new Promise(function(_0x4fbc14,_0x1b6f71){if(_0x592bb3[_0x8d89('0x3d')]&&_0x592bb3['agent']['id']){try{if(_0xe1bf11[_0x8d89('0x3e')][_0x592bb3[_0x8d89('0x3d')]['id']]){_0xe1bf11[_0x8d89('0x3e')][_0x592bb3['agent']['id']][_0x8d89('0x46')]=![];_0xe1bf11[_0x8d89('0x3e')][_0x592bb3[_0x8d89('0x3d')]['id']][_0x8d89('0x3f')]=undefined;}return _0x4fbc14({'code':0xc8,'message':_0x592bb3});}catch(_0x54d853){logger['error'](_0x54d853['stack']);return _0x1b6f71(_0x2ef3ea[_0x8d89('0x33')](0x1f4,_0x54d853));}}logger['error'](_0x8d89('0x47'));return _0x1b6f71(_0x2ef3ea[_0x8d89('0x33')](0x1f4,_0x8d89('0x47')));});},'AbandonInteraction':function(_0x51bc84){var _0x356cd9=this;return new Promise(function(_0x4cb030,_0xbe8801){if(_0x51bc84[_0x8d89('0x14')]&&_0x51bc84['interaction']&&_0x51bc84[_0x8d89('0x16')]['id']){try{var _0x4492c1=getId(_0x51bc84[_0x8d89('0x14')],_0x51bc84['message']?_0x51bc84[_0x8d89('0x15')]['id']:0x0,_0x51bc84['interaction']?_0x51bc84[_0x8d89('0x16')]['id']:0x0);if(_0xe1bf11['rules'][_0x4492c1]){_0xe1bf11[_0x8d89('0x37')][_0x4492c1][_0x8d89('0x38')](_0x8d89('0x40'));}return _0x4cb030({'code':0xc8,'message':_0x51bc84});}catch(_0x28c4d5){logger[_0x8d89('0x33')](_0x28c4d5['stack']);return _0xbe8801(_0x356cd9[_0x8d89('0x33')](0x1f4,_0x28c4d5));}}logger[_0x8d89('0x33')](_0x8d89('0x47'));return _0xbe8801(_0x356cd9[_0x8d89('0x33')](0x1f4,_0x8d89('0x47')));});},'AgentCapacity':function(_0x5e6d86){var _0x7ae6c=this;return new Promise(function(_0x10777c,_0x10c511){if(_0xe1bf11['agents']['hasOwnProperty'](_0x5e6d86['id'])){for(var _0x5dc634 in _0x5e6d86[_0x8d89('0x48')]){if(_0x5e6d86[_0x8d89('0x48')][_0x8d89('0x49')](_0x5dc634)){if(_0xe1bf11['agents'][_0x5e6d86['id']][_0x8d89('0x49')](_0x5dc634+'CurrentCapacity')){_0xe1bf11[_0x8d89('0x3e')][_0x5e6d86['id']][_0x5dc634+_0x8d89('0x4a')]=parseInt(_0x5e6d86[_0x8d89('0x48')][_0x5dc634],0xa);}}}_0xe1bf11['agents'][_0x5e6d86['id']][_0x8d89('0x4b')]();return _0x10777c({'code':0xc8,'message':_0xe1bf11[_0x8d89('0x3e')][_0x5e6d86['id']]});}else{return _0x10c511(_0x7ae6c[_0x8d89('0x33')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x48d0a3){return new Promise(function(_0x32c9c9,_0xf4ab6e){var _0x2f6981=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x3e')]);_0x32c9c9({'count':_0x2f6981[_0x8d89('0x19')],'rows':_0x2f6981});});},'ChatQueues':function(_0x225e7c){return new Promise(function(_0x51f834,_0x3a6db2){var _0x310f76=[];for(var _0x242c73 in _0xe1bf11[_0x8d89('0x4d')]){if(_0xe1bf11[_0x8d89('0x4d')][_0x8d89('0x49')](_0x242c73)){var _0x56e6b3=_0xe1bf11[_0x8d89('0x4d')][_0x242c73];var _0x3e58f7={'id':_0x56e6b3['id'],'available':_0x56e6b3[_0x8d89('0x4e')],'loggedIn':_0x56e6b3[_0x8d89('0x4f')],'name':_0x56e6b3['name'],'paused':_0x56e6b3[_0x8d89('0x50')],'waiting':_0x56e6b3[_0x8d89('0x51')]};_0x310f76[_0x8d89('0x22')](_0x3e58f7);}}_0x51f834({'count':_0x310f76['length'],'rows':_0x310f76});});},'MailQueues':function(_0x5aba3e){return new Promise(function(_0x1ca544,_0x3dd52d){var _0x2cb2ba=[];for(var _0x4b302b in _0xe1bf11[_0x8d89('0x52')]){if(_0xe1bf11[_0x8d89('0x52')][_0x8d89('0x49')](_0x4b302b)){var _0x428ba0=_0xe1bf11['mailQueues'][_0x4b302b];var _0x111ec7={'id':_0x428ba0['id'],'available':_0x428ba0[_0x8d89('0x4e')],'loggedIn':_0x428ba0[_0x8d89('0x4f')],'name':_0x428ba0[_0x8d89('0x53')],'paused':_0x428ba0['paused'],'waiting':_0x428ba0['waiting']};_0x2cb2ba[_0x8d89('0x22')](_0x111ec7);}}_0x1ca544({'count':_0x2cb2ba[_0x8d89('0x19')],'rows':_0x2cb2ba});});},'OpenchannelQueues':function(_0x54c8e3){return new Promise(function(_0x5a9e33,_0x32c0ac){var _0x55f23e=[];for(var _0x2ca38e in _0xe1bf11[_0x8d89('0x54')]){if(_0xe1bf11[_0x8d89('0x54')][_0x8d89('0x49')](_0x2ca38e)){var _0x804b50=_0xe1bf11[_0x8d89('0x54')][_0x2ca38e];var _0x4a3f90={'id':_0x804b50['id'],'available':_0x804b50[_0x8d89('0x4e')],'loggedIn':_0x804b50['loggedIn'],'name':_0x804b50[_0x8d89('0x53')],'paused':_0x804b50[_0x8d89('0x50')],'waiting':_0x804b50[_0x8d89('0x51')]};_0x55f23e[_0x8d89('0x22')](_0x4a3f90);}}_0x5a9e33({'count':_0x55f23e[_0x8d89('0x19')],'rows':_0x55f23e});});},'SmsQueues':function(_0x424fb3){return new Promise(function(_0x1cc7af,_0x3e18e4){var _0x5be9f1=[];for(var _0x3c0da3 in _0xe1bf11[_0x8d89('0x55')]){if(_0xe1bf11[_0x8d89('0x55')][_0x8d89('0x49')](_0x3c0da3)){var _0x129ea4=_0xe1bf11[_0x8d89('0x55')][_0x3c0da3];var _0x4ca716={'id':_0x129ea4['id'],'available':_0x129ea4['available'],'loggedIn':_0x129ea4[_0x8d89('0x4f')],'name':_0x129ea4[_0x8d89('0x53')],'paused':_0x129ea4[_0x8d89('0x50')],'waiting':_0x129ea4['waiting']};_0x5be9f1[_0x8d89('0x22')](_0x4ca716);}}_0x1cc7af({'count':_0x5be9f1[_0x8d89('0x19')],'rows':_0x5be9f1});});},'FaxQueues':function(_0x287b8d){return new Promise(function(_0x2bfb8e,_0x431375){var _0x19b4e9=[];for(var _0x2aa387 in _0xe1bf11[_0x8d89('0x56')]){if(_0xe1bf11[_0x8d89('0x56')][_0x8d89('0x49')](_0x2aa387)){var _0xed2c4e=_0xe1bf11['faxQueues'][_0x2aa387];var _0xeec0ec={'id':_0xed2c4e['id'],'available':_0xed2c4e[_0x8d89('0x4e')],'loggedIn':_0xed2c4e['loggedIn'],'name':_0xed2c4e[_0x8d89('0x53')],'paused':_0xed2c4e[_0x8d89('0x50')],'waiting':_0xed2c4e[_0x8d89('0x51')]};_0x19b4e9[_0x8d89('0x22')](_0xeec0ec);}}_0x2bfb8e({'count':_0x19b4e9[_0x8d89('0x19')],'rows':_0x19b4e9});});},'WhatsappQueues':function(_0x59bdc7){return new Promise(function(_0x41ffa5,_0x18287d){var _0x5af840=[];for(var _0x63bbfa in _0xe1bf11[_0x8d89('0x57')]){if(_0xe1bf11['whatsappQueues']['hasOwnProperty'](_0x63bbfa)){var _0x4e65ab=_0xe1bf11[_0x8d89('0x57')][_0x63bbfa];var _0x2447a1={'id':_0x4e65ab['id'],'available':_0x4e65ab[_0x8d89('0x4e')],'loggedIn':_0x4e65ab[_0x8d89('0x4f')],'name':_0x4e65ab[_0x8d89('0x53')],'paused':_0x4e65ab[_0x8d89('0x50')],'waiting':_0x4e65ab[_0x8d89('0x51')]};_0x5af840[_0x8d89('0x22')](_0x2447a1);}}_0x41ffa5({'count':_0x5af840[_0x8d89('0x19')],'rows':_0x5af840});});},'ChatQueuesWaitingInteractions':function(_0x178589){return new Promise(function(_0x4b12b2,_0x454baa){var _0x34329e=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x58')]);_0x4b12b2({'count':_0x34329e[_0x8d89('0x19')],'rows':_0x34329e});});},'MailQueuesWaitingInteractions':function(_0x4e884a){return new Promise(function(_0x439468,_0x16c5e8){var _0x4a5a97=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x59')]);_0x439468({'count':_0x4a5a97['length'],'rows':_0x4a5a97});});},'OpenchannelQueuesWaitingInteractions':function(_0x2992f6){return new Promise(function(_0x335556,_0x514cba){var _0x31000d=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5a')]);_0x335556({'count':_0x31000d[_0x8d89('0x19')],'rows':_0x31000d});});},'SmsQueuesWaitingInteractions':function(_0x35daa7){return new Promise(function(_0x38c4f9,_0x37c5ff){var _0x14e3bc=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5b')]);_0x38c4f9({'count':_0x14e3bc[_0x8d89('0x19')],'rows':_0x14e3bc});});},'FaxQueuesWaitingInteractions':function(_0xea1508){return new Promise(function(_0x4d92e4,_0x5d5f4c){var _0x3ae434=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5c')]);_0x4d92e4({'count':_0x3ae434[_0x8d89('0x19')],'rows':_0x3ae434});});},'WhatsappQueuesWaitingInteractions':function(_0x4fbefe){return new Promise(function(_0xfefefb,_0x1635ba){var _0xf0104b=_[_0x8d89('0x4c')](_0xe1bf11['whatsappQueuesWaitingInteractions']);_0xfefefb({'count':_0xf0104b['length'],'rows':_0xf0104b});});}};var _0x57e4ee=jayson[_0x8d89('0x5d')](_0x819c83)[_0x8d89('0x5e')]();_0x57e4ee['on'](_0x8d89('0x33'),function(_0x2ded67){logger[_0x8d89('0x33')](JSON['stringify'](_0x2ded67));return _0x29ab4d(_0x2ded67);});_0x57e4ee[_0x8d89('0x13')](0x232c,'127.0.0.1',function(){console[_0x8d89('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5275cb(_0x8d89('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 72b69ad..49da330 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 _0x3460=['iftime\x20%s','message','indexOf','[%s][INTERVAL]\x20%s','all','some','info','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','join','stack','util','bluebird','jayson/promise','http','request','then','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format'];(function(_0x49d57,_0x434969){var _0x1f4785=function(_0x2b5918){while(--_0x2b5918){_0x49d57['push'](_0x49d57['shift']());}};_0x1f4785(++_0x434969);}(_0x3460,0x185));var _0x0346=function(_0x3e0499,_0x48d104){_0x3e0499=_0x3e0499-0x0;var _0x305a4a=_0x3460[_0x3e0499];return _0x305a4a;};'use strict';var util=require(_0x0346('0x0'));var BPromise=require(_0x0346('0x1'));var jayson=require(_0x0346('0x2'));var _=require('lodash');var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0x0346('0x3')]({'port':0x232a});function request(_0x1eff85,_0x52da80){return new BPromise(function(_0x56bf51,_0x5bd0e3){return client[_0x0346('0x4')](_0x1eff85,_0x52da80)[_0x0346('0x5')](function(_0x176860){if(_0x176860[_0x0346('0x6')]){return _0x5bd0e3(_0x176860[_0x0346('0x6')]['message']);}else{return _0x56bf51(_0x176860[_0x0346('0x7')]);}})[_0x0346('0x8')](function(_0x24086c){return _0x5bd0e3(_0x24086c);});});}exports[_0x0346('0x9')]=function(_0x5e1995,_0x604d42,_0xe7c1e9){return function(_0x3b1318){if(_0xe7c1e9['rules']&&!_0xe7c1e9[_0x0346('0xa')][_0x5e1995]){logger['info'](_0x0346('0xb'),_0x5e1995);return _0x3b1318[_0x0346('0xc')]();}var _0x44280a=[];for(var _0x4eaf70=0x0;_0x4eaf70<_0x604d42[_0x0346('0xd')];_0x4eaf70+=0x1){_0x44280a[_0x0346('0xe')](request(_0x0346('0xf'),{'command':util[_0x0346('0x10')](_0x0346('0x11'),_0x604d42[_0x4eaf70])})['then'](function(_0x2f1905){return _0x2f1905&&_0x2f1905[_0x0346('0x12')]&&_0x2f1905[_0x0346('0x12')][_0x0346('0x13')]('true')>=0x0?!![]:![];})[_0x0346('0x8')](function(_0x3f4666){logger[_0x0346('0x6')](_0x0346('0x14'),_0x5e1995,_0x604d42[_0x4eaf70]);}));}BPromise[_0x0346('0x15')](_0x44280a)[_0x0346('0x5')](function(_0x42537a){var _0x5327a0=_[_0x0346('0x16')](_0x42537a);logger[_0x0346('0x17')]('[%s][INTERVAL]\x20%s\x20%s',_0x5e1995,_0x604d42['join'](_0x0346('0x18')),_0x5327a0);_0x3b1318['when'](_0x5327a0);})[_0x0346('0x8')](function(_0x18e9cb){console[_0x0346('0x19')](_0x18e9cb);logger['error'](_0x0346('0x1a'),_0x5e1995,_0x604d42[_0x0346('0x1b')](_0x0346('0x18')),_0x18e9cb[_0x0346('0x1c')]);_0x3b1318[_0x0346('0xc')]();});};}; \ No newline at end of file +var _0x7a99=['result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','catch','all','some','join','\x20|\x20','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','../../../config/logger','http','request','then','error','message'];(function(_0x21fab4,_0x3659f8){var _0x18d7aa=function(_0x4efdbc){while(--_0x4efdbc){_0x21fab4['push'](_0x21fab4['shift']());}};_0x18d7aa(++_0x3659f8);}(_0x7a99,0x84));var _0x97a9=function(_0x14d3f8,_0x141863){_0x14d3f8=_0x14d3f8-0x0;var _0x109397=_0x7a99[_0x14d3f8];return _0x109397;};'use strict';var util=require(_0x97a9('0x0'));var BPromise=require(_0x97a9('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x97a9('0x2'))('routing');var client=jayson['client'][_0x97a9('0x3')]({'port':0x232a});function request(_0xa7bdcf,_0x5cc954){return new BPromise(function(_0x4ded73,_0x4ae491){return client[_0x97a9('0x4')](_0xa7bdcf,_0x5cc954)[_0x97a9('0x5')](function(_0x5b2a68){if(_0x5b2a68[_0x97a9('0x6')]){return _0x4ae491(_0x5b2a68[_0x97a9('0x6')][_0x97a9('0x7')]);}else{return _0x4ded73(_0x5b2a68[_0x97a9('0x8')]);}})['catch'](function(_0x1d80a7){return _0x4ae491(_0x1d80a7);});});}exports[_0x97a9('0x9')]=function(_0x7596ef,_0x27f13f,_0x59639e){return function(_0x174a61){if(_0x59639e[_0x97a9('0xa')]&&!_0x59639e[_0x97a9('0xa')][_0x7596ef]){logger[_0x97a9('0xb')](_0x97a9('0xc'),_0x7596ef);return _0x174a61[_0x97a9('0xd')]();}var _0x11a8c5=[];for(var _0x383aff=0x0;_0x383aff<_0x27f13f[_0x97a9('0xe')];_0x383aff+=0x1){_0x11a8c5[_0x97a9('0xf')](request(_0x97a9('0x10'),{'command':util[_0x97a9('0x11')](_0x97a9('0x12'),_0x27f13f[_0x383aff])})[_0x97a9('0x5')](function(_0x24eb27){return _0x24eb27&&_0x24eb27[_0x97a9('0x7')]&&_0x24eb27['message'][_0x97a9('0x13')](_0x97a9('0x14'))>=0x0?!![]:![];})[_0x97a9('0x15')](function(_0x5b3567){logger[_0x97a9('0x6')]('[%s][INTERVAL]\x20%s',_0x7596ef,_0x27f13f[_0x383aff]);}));}BPromise[_0x97a9('0x16')](_0x11a8c5)[_0x97a9('0x5')](function(_0x8c6f63){var _0x479172=_[_0x97a9('0x17')](_0x8c6f63);logger[_0x97a9('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x7596ef,_0x27f13f[_0x97a9('0x18')](_0x97a9('0x19')),_0x479172);_0x174a61['when'](_0x479172);})[_0x97a9('0x15')](function(_0x44c76e){console['log'](_0x44c76e);logger[_0x97a9('0x6')](_0x97a9('0x1a'),_0x7596ef,_0x27f13f[_0x97a9('0x18')](_0x97a9('0x19')),_0x44c76e[_0x97a9('0x1b')]);_0x174a61[_0x97a9('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2969e48..d745612 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 _0xe706=['then','type','agentacw','agentcomplete','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','now','called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','agentcalledAt','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName'];(function(_0x74b583,_0x2f9149){var _0x3b9c90=function(_0x499025){while(--_0x499025){_0x74b583['push'](_0x74b583['shift']());}};_0x3b9c90(++_0x2f9149);}(_0xe706,0xa3));var _0x6e70=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xe706[_0xfedc72];return _0x2c7c78;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var utils=require(_0x6e70('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e8446,_0x2cae77){utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x5'),_0x5e8446[_0x6e70('0x6')],_0x5e8446[_0x6e70('0x7')],_0x5e8446[_0x6e70('0x8')],_0x5e8446[_0x6e70('0x9')],_0x5e8446[_0x6e70('0xa')],_0x5e8446[_0x6e70('0xb')],_0x5e8446[_0x6e70('0xc')],_0x5e8446[_0x6e70('0xd')]));if(_0x5e8446[_0x6e70('0x8')]){utils[_0x6e70('0xe')](_0x5e8446[_0x6e70('0x8')])[_0x6e70('0xf')](function(_0x954545){if(_0x954545){_0x5e8446[_0x6e70('0x10')]=_0x954545[_0x6e70('0x10')];_0x5e8446[_0x6e70('0x11')]=_0x5e8446[_0x6e70('0x12')]?_0x954545[_0x6e70('0x13')]:![];_0x5e8446[_0x6e70('0x14')]=_0x5e8446[_0x6e70('0x11')]?_0x954545['acwTimeout']:0x0;}utils['request'](_0x6e70('0x15'),_0x5e8446);});}else{utils[_0x6e70('0x16')](_0x6e70('0x15'),_0x5e8446);}if(_0x2cae77){delete transfers[_0x5e8446[_0x6e70('0x6')]];}else{delete agents[_0x5e8446[_0x6e70('0x17')]];}}exports[_0x6e70('0x18')]=function(_0xa1eb74){try{utils[_0x6e70('0x19')](util['format']('[%s][agents][agentcalled]',_0xa1eb74['uniqueid']),_0xa1eb74);agents[_0xa1eb74[_0x6e70('0x17')]]=_0xa1eb74;agents[_0xa1eb74['destuniqueid']]['agentcalledAt']=utils[_0x6e70('0x1a')]();agents[_0xa1eb74[_0x6e70('0x17')]]['lastevent']=_0x6e70('0x1b');agents[_0xa1eb74['destuniqueid']][_0x6e70('0xc')]=null;agents[_0xa1eb74[_0x6e70('0x17')]]['connectedlinename']=null;utils['info'](util[_0x6e70('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xa1eb74[_0x6e70('0x6')],agents[_0xa1eb74[_0x6e70('0x17')]]['membername'],_0xa1eb74['destuniqueid']));}catch(_0xc238ba){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x1d'),_0xa1eb74[_0x6e70('0x6')]),_0xc238ba);}};exports[_0x6e70('0x1e')]=function(_0x1b2453){try{if(!_[_0x6e70('0x1f')](agents[_0x1b2453[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x1b2453);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x21'),_0x1b2453[_0x6e70('0x6')],agents[_0x1b2453[_0x6e70('0x17')]]['membername'],_0x1b2453[_0x6e70('0x17')]));agents[_0x1b2453['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1b2453['destuniqueid']][_0x6e70('0x22')]=utils[_0x6e70('0x1a')]();agents[_0x1b2453['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x23');agents[_0x1b2453['destuniqueid']][_0x6e70('0x24')]=_0x6e70('0x23');agents[_0x1b2453[_0x6e70('0x17')]]['holdtime']=_0x1b2453['ringtime']?parseInt(_0x1b2453[_0x6e70('0x25')])/0x3e8:0x0;agents[_0x1b2453[_0x6e70('0x17')]][_0x6e70('0x26')]=0x0;unanswered[_0x6e70('0x27')](_0x1b2453[_0x6e70('0x17')]);}}catch(_0x5d772a){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x5d772a);}};exports[_0x6e70('0x28')]=function(_0x20a225){try{_[_0x6e70('0x29')](agents,function(_0x24114a,_0x3a0821){if(_0x24114a[_0x6e70('0x6')]==_0x20a225['uniqueid']&&!_[_0x6e70('0x2a')](unanswered,_0x24114a['destuniqueid'])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x2b'),_0x20a225[_0x6e70('0x6')]),_0x20a225);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x2c'),_0x20a225[_0x6e70('0x6')],_0x24114a['membername'],_0x24114a[_0x6e70('0x17')]));_0x24114a[_0x6e70('0x1e')]=!![];_0x24114a['agentringnoanswerAt']=utils[_0x6e70('0x1a')]();_0x24114a[_0x6e70('0xd')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x24')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x2e')]=_0x20a225[_0x6e70('0x2e')];_0x24114a[_0x6e70('0x26')]=0x0;writeDB(_0x24114a);}});}catch(_0xf146fd){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x2b'),_0x20a225['uniqueid']),_0xf146fd);}};exports[_0x6e70('0x2f')]=function(_0x3222a2){try{if(agents[_0x3222a2[_0x6e70('0x17')]]){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x30'),_0x3222a2[_0x6e70('0x6')]),_0x3222a2);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x31'),_0x3222a2[_0x6e70('0x6')],agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x9')],_0x3222a2['destuniqueid']));agents[_0x3222a2['destuniqueid']]['agentconnectAt']=utils[_0x6e70('0x1a')]();agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xc')]=_0x3222a2[_0x6e70('0xc')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x32')]=_0x3222a2['connectedlinename'];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xd')]=_0x6e70('0x33');_[_0x6e70('0x29')](agents,function(_0x16fc7d,_0x5be100){if(_0x16fc7d[_0x6e70('0x17')]!=_0x3222a2[_0x6e70('0x17')]&&_0x16fc7d[_0x6e70('0x6')]==_0x3222a2[_0x6e70('0x6')]){_0x16fc7d[_0x6e70('0x26')]=0x0;_0x16fc7d[_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];_0x16fc7d['agentringnoanswer']=!![];_0x16fc7d['agentringnoanswerAt']=utils['now']();_0x16fc7d[_0x6e70('0xd')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x24')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x35')]=_0x3222a2['destuniqueid'];_0x16fc7d[_0x6e70('0x36')]=_0x3222a2[_0x6e70('0x9')];writeDB(_0x16fc7d);}});}}catch(_0x2a2aca){utils['error'](util['format']('[%s][agents][agentconnect]',_0x3222a2[_0x6e70('0x6')]),_0x2a2aca);}};exports['agentcomplete']=function(_0x42f49a){try{if(!_[_0x6e70('0x1f')](agents[_0x42f49a[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x42f49a);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x38'),_0x42f49a[_0x6e70('0x6')],agents[_0x42f49a['destuniqueid']][_0x6e70('0x9')],_0x42f49a[_0x6e70('0x17')]));agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x12')]=!![];agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')]=utils[_0x6e70('0x1a')]();agents[_0x42f49a['destuniqueid']][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')],agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x3b')]);agents[_0x42f49a[_0x6e70('0x17')]]['reason']=_0x42f49a[_0x6e70('0x24')];agents[_0x42f49a['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x3c');writeDB(agents[_0x42f49a['destuniqueid']]);}}catch(_0x53efc3){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x53efc3);}};exports['blindtransfer']=function(_0x238ebb){try{if(!_[_0x6e70('0x1f')](agents[_0x238ebb[_0x6e70('0x3d')]])){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb['uniqueid']),_0x238ebb);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x3f'),_0x238ebb[_0x6e70('0x6')],agents[_0x238ebb[_0x6e70('0x3d')]]['membername'],agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')]));agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x40')]=!![];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x41')]='blind';agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x42')]=_0x238ebb[_0x6e70('0x43')];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x44')]=agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')];}}catch(_0x1dd242){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb[_0x6e70('0x6')]),_0x1dd242);}};exports['attendedtransfer']=function(_0x40e7c6){try{utils[_0x6e70('0x19')](util['format'](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x40e7c6);if(_0x40e7c6['origtransfereruniqueid']==_0x40e7c6[_0x6e70('0x47')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x48')]])){utils[_0x6e70('0x3')](util[_0x6e70('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x9')]));agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x40')]=!![];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x41')]=_0x6e70('0x49');agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x42')]=_0x40e7c6[_0x6e70('0x4a')];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x46')];}if(_0x40e7c6[_0x6e70('0x4b')]&&agents[_0x40e7c6[_0x6e70('0x4b')]]){agents[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x4b')]]=_[_0x6e70('0x4d')](agents[_0x40e7c6['transfereeuniqueid']]);transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0xb')];transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4e')]=agents[_0x40e7c6['secondtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x4b')]]['agentcalledAt']=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x3b')]=utils['now']();transfers[_0x40e7c6['transfereeuniqueid']][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x2;}}else if(_0x40e7c6[_0x6e70('0x48')]==_0x40e7c6[_0x6e70('0x4f')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x46')]])){utils['info'](util['format'](_0x6e70('0x50'),_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x9')]));agents[_0x40e7c6['origtransfereruniqueid']]['transfer']=!![];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x41')]='ATTENDED';agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x42')]=_0x40e7c6['secondtransfererexten'];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x48')];}if(_0x40e7c6[_0x6e70('0x51')]&&agents[_0x40e7c6[_0x6e70('0x51')]]){agents[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x51')]]=_['clone'](agents[_0x40e7c6[_0x6e70('0x51')]]);transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0xb')];transfers[_0x40e7c6['transfertargetuniqueid']]['calleridname']=agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x52')]=utils['now']();transfers[_0x40e7c6['transfertargetuniqueid']][_0x6e70('0x3b')]=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x2;}}}catch(_0x5eb6f0){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x5eb6f0);}};exports['hangup']=function(_0xce964b){try{utils['debug'](util['format'](_0x6e70('0x53'),_0xce964b[_0x6e70('0x6')]),_0xce964b);if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]===_0x6e70('0x23')){if(_0xce964b['cause']==='21'){agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x54');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x54');}utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')],agents[_0xce964b['uniqueid']]['lastevent']));writeDB(agents[_0xce964b[_0x6e70('0x6')]]);var _0x18ecf0=unanswered[_0x6e70('0x56')](_0xce964b[_0x6e70('0x6')]);if(_0x18ecf0>-0x1){unanswered[_0x6e70('0x57')](_0x18ecf0,0x1);}}if(transfers[_0xce964b['uniqueid']]){transfers[_0xce964b['uniqueid']][_0x6e70('0x12')]=!![];transfers[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x3b')]);transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x58');transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils['info'](util['format'](_0x6e70('0x55'),_0xce964b['uniqueid'],transfers[_0xce964b[_0x6e70('0x6')]]['membername'],transfers[_0xce964b['uniqueid']][_0x6e70('0x24')],transfers[_0xce964b['uniqueid']]['lastevent']));writeDB(transfers[_0xce964b[_0x6e70('0x6')]],!![]);}if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']){agents[_0xce964b['uniqueid']]['agentcomplete']=!![];agents[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']);agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=agents[_0xce964b[_0x6e70('0x6')]]['transfer']?_0x6e70('0x40'):_0x6e70('0x58');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]]['reason'],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]));writeDB(agents[_0xce964b['uniqueid']]);}}catch(_0x596d71){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x53'),_0xce964b['uniqueid']),_0x596d71);}}; \ No newline at end of file +var _0x5c00=['queuecallerabandon','forIn','includes','agentringnoanswer','now','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','info','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push'];(function(_0x4ca922,_0x11f8d6){var _0x3feb75=function(_0x4e8db2){while(--_0x4e8db2){_0x4ca922['push'](_0x4ca922['shift']());}};_0x3feb75(++_0x11f8d6);}(_0x5c00,0x17e));var _0x05c0=function(_0x39b51c,_0x40010d){_0x39b51c=_0x39b51c-0x0;var _0x146312=_0x5c00[_0x39b51c];return _0x146312;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var utils=require(_0x05c0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4e54ec,_0x1e76da){utils['info'](util[_0x05c0('0x3')](_0x05c0('0x4'),_0x4e54ec[_0x05c0('0x5')],_0x4e54ec[_0x05c0('0x6')],_0x4e54ec['queue'],_0x4e54ec[_0x05c0('0x7')],_0x4e54ec[_0x05c0('0x8')],_0x4e54ec[_0x05c0('0x9')],_0x4e54ec[_0x05c0('0xa')],_0x4e54ec['lastevent']));if(_0x4e54ec[_0x05c0('0xb')]){utils[_0x05c0('0xc')](_0x4e54ec[_0x05c0('0xb')])['then'](function(_0x32a795){if(_0x32a795){_0x4e54ec[_0x05c0('0xd')]=_0x32a795[_0x05c0('0xd')];_0x4e54ec[_0x05c0('0xe')]=_0x4e54ec[_0x05c0('0xf')]?_0x32a795[_0x05c0('0x10')]:![];_0x4e54ec['acwtime']=_0x4e54ec['agentacw']?_0x32a795[_0x05c0('0x11')]:0x0;}utils['request'](_0x05c0('0x12'),_0x4e54ec);});}else{utils[_0x05c0('0x13')](_0x05c0('0x12'),_0x4e54ec);}if(_0x1e76da){delete transfers[_0x4e54ec['uniqueid']];}else{delete agents[_0x4e54ec[_0x05c0('0x14')]];}}exports['agentcalled']=function(_0x16a290){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x16a290);agents[_0x16a290[_0x05c0('0x14')]]=_0x16a290;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x17')]=utils['now']();agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x18')]=_0x05c0('0x19');agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0xa')]=null;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x1a')]=null;utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x16a290[_0x05c0('0x5')],agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x7')],_0x16a290['destuniqueid']));}catch(_0x40d905){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x40d905);}};exports['agentringnoanswer']=function(_0x407c1f){try{if(!_[_0x05c0('0x1d')](agents[_0x407c1f['destuniqueid']])){utils['debug'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x407c1f);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x1f'),_0x407c1f[_0x05c0('0x5')],agents[_0x407c1f[_0x05c0('0x14')]]['membername'],_0x407c1f[_0x05c0('0x14')]));agents[_0x407c1f[_0x05c0('0x14')]]['agentringnoanswer']=!![];agents[_0x407c1f['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x407c1f['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x20');agents[_0x407c1f['destuniqueid']][_0x05c0('0x21')]=_0x05c0('0x20');agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x407c1f['ringtime']?parseInt(_0x407c1f[_0x05c0('0x23')])/0x3e8:0x0;agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x24')]=0x0;unanswered[_0x05c0('0x25')](_0x407c1f[_0x05c0('0x14')]);}}catch(_0x5d12e0){utils['error'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x5d12e0);}};exports[_0x05c0('0x26')]=function(_0xd6574e){try{_[_0x05c0('0x27')](agents,function(_0x1e00c5,_0x1c4c8f){if(_0x1e00c5[_0x05c0('0x5')]==_0xd6574e[_0x05c0('0x5')]&&!_[_0x05c0('0x28')](unanswered,_0x1e00c5[_0x05c0('0x14')])){utils[_0x05c0('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0xd6574e[_0x05c0('0x5')]),_0xd6574e);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd6574e[_0x05c0('0x5')],_0x1e00c5[_0x05c0('0x7')],_0x1e00c5['destuniqueid']));_0x1e00c5[_0x05c0('0x29')]=!![];_0x1e00c5['agentringnoanswerAt']=utils[_0x05c0('0x2a')]();_0x1e00c5[_0x05c0('0x18')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x21')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x22')]=_0xd6574e[_0x05c0('0x22')];_0x1e00c5[_0x05c0('0x24')]=0x0;writeDB(_0x1e00c5);}});}catch(_0x3d8d76){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x2c'),_0xd6574e[_0x05c0('0x5')]),_0x3d8d76);}};exports[_0x05c0('0x2d')]=function(_0x185d05){try{if(agents[_0x185d05[_0x05c0('0x14')]]){utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x2e'),_0x185d05[_0x05c0('0x5')]),_0x185d05);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x2f'),_0x185d05[_0x05c0('0x5')],agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x7')],_0x185d05[_0x05c0('0x14')]));agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x30')]=utils[_0x05c0('0x2a')]();agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0xa')]=_0x185d05[_0x05c0('0xa')];agents[_0x185d05['destuniqueid']][_0x05c0('0x1a')]=_0x185d05[_0x05c0('0x1a')];agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x185d05['ringtime'];agents[_0x185d05['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x31');_[_0x05c0('0x27')](agents,function(_0x4ced8e,_0x29dc87){if(_0x4ced8e[_0x05c0('0x14')]!=_0x185d05[_0x05c0('0x14')]&&_0x4ced8e[_0x05c0('0x5')]==_0x185d05['uniqueid']){_0x4ced8e[_0x05c0('0x24')]=0x0;_0x4ced8e[_0x05c0('0x22')]=_0x185d05['ringtime'];_0x4ced8e[_0x05c0('0x29')]=!![];_0x4ced8e[_0x05c0('0x32')]=utils[_0x05c0('0x2a')]();_0x4ced8e[_0x05c0('0x18')]=_0x05c0('0x33');_0x4ced8e[_0x05c0('0x21')]=_0x05c0('0x33');_0x4ced8e['answeredelsewheredestinationuniqueid']=_0x185d05['destuniqueid'];_0x4ced8e[_0x05c0('0x34')]=_0x185d05[_0x05c0('0x7')];writeDB(_0x4ced8e);}});}}catch(_0xaa5d53){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')]('[%s][agents][agentconnect]',_0x185d05[_0x05c0('0x5')]),_0xaa5d53);}};exports[_0x05c0('0xf')]=function(_0x2fdfe8){try{if(!_[_0x05c0('0x1d')](agents[_0x2fdfe8[_0x05c0('0x14')]])){utils[_0x05c0('0x15')](util[_0x05c0('0x3')]('[%s][agents][agentcomplete]',_0x2fdfe8[_0x05c0('0x5')]),_0x2fdfe8);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x35'),_0x2fdfe8[_0x05c0('0x5')],agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x7')],_0x2fdfe8[_0x05c0('0x14')]));agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0xf')]=!![];agents[_0x2fdfe8[_0x05c0('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x37')],agents[_0x2fdfe8[_0x05c0('0x14')]]['agentconnectAt']);agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x21')]=_0x2fdfe8[_0x05c0('0x21')];agents[_0x2fdfe8[_0x05c0('0x14')]]['lastevent']=_0x05c0('0x38');writeDB(agents[_0x2fdfe8[_0x05c0('0x14')]]);}}catch(_0x3ec0bf){utils[_0x05c0('0x1c')](util['format'](_0x05c0('0x39'),_0x2fdfe8[_0x05c0('0x5')]),_0x3ec0bf);}};exports[_0x05c0('0x3a')]=function(_0x9b521b){try{if(!_['isNil'](agents[_0x9b521b[_0x05c0('0x3b')]])){utils[_0x05c0('0x15')](util['format'](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x9b521b);utils['info'](util[_0x05c0('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x9b521b[_0x05c0('0x5')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x7')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x5')]));agents[_0x9b521b[_0x05c0('0x3b')]]['transfer']=!![];agents[_0x9b521b[_0x05c0('0x3b')]]['transfertype']=_0x05c0('0x3d');agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x3e')]=_0x9b521b[_0x05c0('0x3f')];agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x40')]=agents[_0x9b521b[_0x05c0('0x3b')]]['uniqueid'];}}catch(_0x5215b4){utils['error'](util[_0x05c0('0x3')](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x5215b4);}};exports['attendedtransfer']=function(_0xbfb9cb){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x41'),_0xbfb9cb[_0x05c0('0x42')]),_0xbfb9cb);if(_0xbfb9cb[_0x05c0('0x42')]==_0xbfb9cb[_0x05c0('0x43')]){if(!_['isNil'](agents[_0xbfb9cb[_0x05c0('0x44')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb['origtransfereruniqueid'],agents[_0xbfb9cb[_0x05c0('0x44')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb['secondtransfereruniqueid']][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x3e')]=_0xbfb9cb[_0x05c0('0x48')];agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x42')];}if(_0xbfb9cb['transfereeuniqueid']&&agents[_0xbfb9cb[_0x05c0('0x49')]]){agents[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x1;transfers[_0xbfb9cb[_0x05c0('0x49')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x49')]]);transfers[_0xbfb9cb['transfereeuniqueid']][_0x05c0('0x9')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x9')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4c')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x4c')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x17')]=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x2;}}else if(_0xbfb9cb[_0x05c0('0x44')]==_0xbfb9cb['secondtransfererlinkedid']){if(!_[_0x05c0('0x1d')](agents[_0xbfb9cb[_0x05c0('0x42')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb[_0x05c0('0x42')],agents[_0xbfb9cb[_0x05c0('0x42')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb['origtransfereruniqueid']]['transferexten']=_0xbfb9cb[_0x05c0('0x4d')];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x44')];}if(_0xbfb9cb[_0x05c0('0x4e')]&&agents[_0xbfb9cb[_0x05c0('0x4e')]]){agents[_0xbfb9cb[_0x05c0('0x4e')]]['agententerreason']=0x1;transfers[_0xbfb9cb[_0x05c0('0x4e')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x4e')]]);transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x9')]=agents[_0xbfb9cb['origtransfereruniqueid']]['calleridnum'];transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4c')]=agents[_0xbfb9cb['origtransfereruniqueid']][_0x05c0('0x4c')];transfers[_0xbfb9cb['transfertargetuniqueid']]['agentcalledAt']=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfertargetuniqueid']][_0x05c0('0x22')]=0x0;transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4a')]=0x2;}}}catch(_0x5b39cb){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0xbfb9cb['origtransfereruniqueid']),_0x5b39cb);}};exports[_0x05c0('0x4f')]=function(_0x4f43ae){try{utils['debug'](util['format'](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x4f43ae);if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae['uniqueid']][_0x05c0('0x21')]===_0x05c0('0x20')){if(_0x4f43ae['cause']==='21'){agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x21')]=_0x05c0('0x51');agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']=_0x05c0('0x51');}utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae['uniqueid']]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(agents[_0x4f43ae['uniqueid']]);var _0x3135bd=unanswered['indexOf'](_0x4f43ae['uniqueid']);if(_0x3135bd>-0x1){unanswered['splice'](_0x3135bd,0x1);}}if(transfers[_0x4f43ae['uniqueid']]){transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0xf')]=!![];transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')]=utils['now']();transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],transfers[_0x4f43ae['uniqueid']][_0x05c0('0x30')]);transfers[_0x4f43ae['uniqueid']]['reason']=_0x05c0('0x53');transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4f43ae['uniqueid'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x7')],transfers[_0x4f43ae[_0x05c0('0x5')]]['reason'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(transfers[_0x4f43ae[_0x05c0('0x5')]],!![]);}if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]){agents[_0x4f43ae['uniqueid']][_0x05c0('0xf')]=!![];agents[_0x4f43ae[_0x05c0('0x5')]]['agentcompleteAt']=utils[_0x05c0('0x2a')]();agents[_0x4f43ae[_0x05c0('0x5')]]['talktime']=utils[_0x05c0('0x36')](agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]);agents[_0x4f43ae[_0x05c0('0x5')]]['reason']=agents[_0x4f43ae[_0x05c0('0x5')]]['transfer']?_0x05c0('0x46'):_0x05c0('0x53');agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae[_0x05c0('0x5')]]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']));writeDB(agents[_0x4f43ae[_0x05c0('0x5')]]);}}catch(_0x36f82a){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x36f82a);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 450b4f0..3049fc5 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 _0x0094=['channel','membername','interface','calleridnum','lastevent','accountcode','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','lastIndexOf','includes','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s'];(function(_0x491ec2,_0x540c00){var _0x1748db=function(_0x5a6258){while(--_0x5a6258){_0x491ec2['push'](_0x491ec2['shift']());}};_0x1748db(++_0x540c00);}(_0x0094,0xc9));var _0x4009=function(_0x46e263,_0x5d7828){_0x46e263=_0x46e263-0x0;var _0x130509=_0x0094[_0x46e263];return _0x130509;};'use strict';var _=require(_0x4009('0x0'));var util=require(_0x4009('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0x4009('0x2'),_0x4009('0x3'),_0x4009('0x3'),_0x4009('0x2'),_0x4009('0x2'),_0x4009('0x2'),_0x4009('0x4'),_0x4009('0x5'),_0x4009('0x3'),_0x4009('0x3'),'FAILED'];var channels={};function writeDB(_0x4a8ff2){var _0x3eb971;if(transfers[_0x4009('0x6')][_0x4a8ff2[_0x4009('0x7')]]){_0x3eb971=_0x4a8ff2[_0x4009('0x7')];_0x4a8ff2[_0x4009('0x7')]=transfers[_0x4009('0x6')][_0x4a8ff2[_0x4009('0x7')]]['transfereeuniqueid'];}utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0xa'),_0x4a8ff2[_0x4009('0x7')],_0x4a8ff2[_0x4009('0xb')],_0x4a8ff2['queue'],_0x4a8ff2[_0x4009('0xc')],_0x4a8ff2[_0x4009('0xd')],_0x4a8ff2[_0x4009('0xe')],_0x4a8ff2['connectedlinenum'],_0x4a8ff2[_0x4009('0xf')]));if(_0x4a8ff2['accountcode']){utils['getUserByInternal'](_0x4a8ff2[_0x4009('0x10')])['then'](function(_0x132a94){if(_0x132a94){_0x4a8ff2[_0x4009('0x11')]=_0x132a94['id'];}utils['request'](_0x4009('0x12'),_0x4a8ff2);});}else{utils[_0x4009('0x13')](_0x4009('0x12'),_0x4a8ff2);}if(channels[_0x4a8ff2[_0x4009('0x7')]]){delete channels[_0x4a8ff2['uniqueid']];}else if(_0x3eb971&&channels[_0x3eb971]){delete transfers['blinds'][_0x3eb971];delete channels[_0x3eb971];}}exports['newchannel']=function(_0xd5beb5){try{utils['debug'](util['format'](_0x4009('0x14'),_0xd5beb5[_0x4009('0x7')]),_0xd5beb5);if(_0xd5beb5['uniqueid']==_0xd5beb5[_0x4009('0x15')]&&_0xd5beb5['channel']!=_0x4009('0x16')){utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0x17'),_0xd5beb5[_0x4009('0x7')],_0xd5beb5['context'],_0xd5beb5[_0x4009('0x18')]));channels[_0xd5beb5['uniqueid']]={'uniqueid':_0xd5beb5[_0x4009('0x7')],'accountcode':_0xd5beb5[_0x4009('0x10')],'source':_0xd5beb5['calleridnum'],'destination':_0xd5beb5['exten'],'destinationcontext':_0xd5beb5[_0x4009('0x19')],'channel':_0xd5beb5[_0x4009('0xb')],'starttime':utils[_0x4009('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x4009('0x1b')};}}catch(_0x9a256a){utils['error'](util[_0x4009('0x9')](_0x4009('0x14'),_0xd5beb5['uniqueid']),_0x9a256a);}};exports[_0x4009('0x1c')]=function(_0xc515e4){try{utils[_0x4009('0x1d')](util[_0x4009('0x9')](_0x4009('0x1e'),_0xc515e4[_0x4009('0x7')]),_0xc515e4);if(!_[_0x4009('0x1f')](channels[_0xc515e4[_0x4009('0x7')]])&&_0xc515e4[_0x4009('0x20')]==0x6){utils['info'](util[_0x4009('0x9')](_0x4009('0x21'),_0xc515e4[_0x4009('0x7')],_0xc515e4['context'],_0xc515e4[_0x4009('0xb')]));if(_[_0x4009('0x1f')](channels[_0xc515e4['uniqueid']][_0x4009('0x22')])){channels[_0xc515e4[_0x4009('0x7')]][_0x4009('0x22')]=utils[_0x4009('0x1a')]();}}else if(!_[_0x4009('0x1f')](channels[_0xc515e4[_0x4009('0x15')]])&&_0xc515e4[_0x4009('0x20')]==0x6&&_0xc515e4['context']!='transfer'){utils['info'](util[_0x4009('0x9')](_0x4009('0x23'),_0xc515e4[_0x4009('0x7')],_0xc515e4[_0x4009('0x15')],_0xc515e4[_0x4009('0x19')],_0xc515e4[_0x4009('0xb')]));channels[_0xc515e4[_0x4009('0x15')]]['accountcode']=_0xc515e4[_0x4009('0x10')];channels[_0xc515e4[_0x4009('0x15')]][_0x4009('0x24')]=_0xc515e4[_0x4009('0xb')];if(_['isNil'](channels[_0xc515e4['linkedid']][_0x4009('0x25')])){channels[_0xc515e4['linkedid']][_0x4009('0x25')]=utils[_0x4009('0x1a')]();}channels[_0xc515e4[_0x4009('0x15')]][_0x4009('0x26')]=dispositions[_['toNumber'](_0xc515e4[_0x4009('0x20')])]||_0x4009('0x4');}}catch(_0x5e777f){utils['error'](util[_0x4009('0x9')](_0x4009('0x1e'),_0xc515e4['uniqueid']),_0x5e777f);}};exports[_0x4009('0x27')]=function(_0x45993f){try{if(!_[_0x4009('0x1f')](channels[_0x45993f[_0x4009('0x7')]])){utils['debug'](util[_0x4009('0x9')](_0x4009('0x28'),_0x45993f[_0x4009('0x7')]),_0x45993f);if(_['isNil'](channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x29')])){channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x29')]=_0x45993f[_0x4009('0x2a')]+'\x20<'+_0x45993f[_0x4009('0xe')]+'>';}utils[_0x4009('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x45993f[_0x4009('0x7')],channels[_0x45993f['uniqueid']][_0x4009('0x29')],_0x45993f[_0x4009('0x2b')]));channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x2c')]=utils[_0x4009('0x1a')]();channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x2d')]=utils[_0x4009('0x2e')](channels[_0x45993f['uniqueid']][_0x4009('0x2c')],channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x2f')]);channels[_0x45993f['uniqueid']][_0x4009('0x30')]=channels[_0x45993f[_0x4009('0x7')]][_0x4009('0x25')]?utils[_0x4009('0x2e')](channels[_0x45993f['uniqueid']][_0x4009('0x2c')],channels[_0x45993f[_0x4009('0x7')]]['answertime']):0x0;writeDB(channels[_0x45993f[_0x4009('0x7')]]);}}catch(_0x7d9942){utils[_0x4009('0x31')](util['format'](_0x4009('0x28'),_0x45993f[_0x4009('0x7')]),_0x7d9942);}};exports['attendedtransfer']=function(_0x251f21){try{if(!_[_0x4009('0x1f')](channels[_0x251f21[_0x4009('0x32')]])){utils['debug'](util[_0x4009('0x9')](_0x4009('0x33'),_0x251f21['origtransfereruniqueid']),_0x251f21);if(channels[_0x251f21[_0x4009('0x32')]][_0x4009('0xb')]==_0x251f21[_0x4009('0x34')]){utils[_0x4009('0x8')](util[_0x4009('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x251f21[_0x4009('0x35')],_0x251f21[_0x4009('0x32')],_0x251f21['secondtransfererchannel']));channels[_0x251f21['localtwolinkedid']][_0x4009('0x24')]=_0x251f21[_0x4009('0x36')];channels[_0x251f21[_0x4009('0x32')]][_0x4009('0x37')]=_0x4009('0x38');}else if(channels[_0x251f21[_0x4009('0x32')]][_0x4009('0xb')]=_0x251f21[_0x4009('0x39')]){utils['info'](util[_0x4009('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x251f21[_0x4009('0x35')],_0x251f21[_0x4009('0x32')],_0x251f21[_0x4009('0x3a')]));channels[_0x251f21['localtwolinkedid']][_0x4009('0x24')]=_0x251f21[_0x4009('0x3a')];channels[_0x251f21[_0x4009('0x32')]]['userfield']=_0x4009('0x38');}}}catch(_0x3f2397){utils[_0x4009('0x31')](util['format'](_0x4009('0x33'),_0x251f21['origtransfereruniqueid']),_0x3f2397);}};exports[_0x4009('0x3b')]=function(_0x5d3e52){try{if(!_[_0x4009('0x1f')](channels[_0x5d3e52['uniqueid']])){utils[_0x4009('0x1d')](util[_0x4009('0x9')](_0x4009('0x3c'),_0x5d3e52[_0x4009('0x7')]),_0x5d3e52);channels[_0x5d3e52[_0x4009('0x7')]][_0x4009('0x3d')]=utils[_0x4009('0x1a')]();utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0x3e'),_0x5d3e52[_0x4009('0x7')],channels[_0x5d3e52['uniqueid']][_0x4009('0x3d')]));}}catch(_0x5c201c){utils['error'](util[_0x4009('0x9')](_0x4009('0x3c'),_0x5d3e52[_0x4009('0x7')]),_0x5c201c);}};exports[_0x4009('0x3f')]=function(_0x2ef547){try{if(!_[_0x4009('0x1f')](channels[_0x2ef547[_0x4009('0x7')]])){utils[_0x4009('0x1d')](util[_0x4009('0x9')](_0x4009('0x40'),_0x2ef547['uniqueid']),_0x2ef547);if(!_[_0x4009('0x1f')](channels[_0x2ef547['uniqueid']]['musiconholdstartAt'])){channels[_0x2ef547['uniqueid']]['mohtime']+=utils[_0x4009('0x2e')](utils[_0x4009('0x1a')](),channels[_0x2ef547[_0x4009('0x7')]]['musiconholdstartAt']);utils[_0x4009('0x8')](util['format'](_0x4009('0x41'),_0x2ef547[_0x4009('0x7')],channels[_0x2ef547[_0x4009('0x7')]][_0x4009('0x42')]));delete channels[_0x2ef547[_0x4009('0x7')]][_0x4009('0x3d')];}}}catch(_0x4d3ddf){utils['error'](util[_0x4009('0x9')](_0x4009('0x40'),_0x2ef547[_0x4009('0x7')]),_0x4d3ddf);}};exports[_0x4009('0x43')]=function(_0x160561){try{if(!_[_0x4009('0x1f')](channels[_0x160561['uniqueid']])){utils[_0x4009('0x1d')](util[_0x4009('0x9')](_0x4009('0x44'),_0x160561[_0x4009('0x7')]),_0x160561);if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x46')])){utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0x47'),_0x160561[_0x4009('0x7')],_0x160561[_0x4009('0x48')]));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x49')]=_0x160561[_0x4009('0x48')];}if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x4a')])){utils['info'](util[_0x4009('0x9')](_0x4009('0x4b'),_0x160561[_0x4009('0x7')],_0x160561['value']));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x4c')]=_0x160561['value'];channels[_0x160561[_0x4009('0x7')]][_0x4009('0x29')]='\x22'+_0x160561[_0x4009('0x48')]+_0x4009('0x4d')+_0x160561[_0x4009('0x48')]+'>';}if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x4e')])||!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x4f')])){utils['info'](util['format'](_0x4009('0x50'),_0x160561['uniqueid'],!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0x4009('0x4f'),_0x160561[_0x4009('0x48')]));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x29')]=_0x160561['value'];}if(!_[_0x4009('0x1f')](_0x160561['variable'][_0x4009('0x51')])||!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')]['xmcs-queue'])){utils['info'](util[_0x4009('0x9')](_0x4009('0x50'),_0x160561[_0x4009('0x7')],!_['isNil'](_0x160561[_0x4009('0x45')][_0x4009('0x51')])?_0x4009('0x51'):_0x4009('0x52'),_0x160561[_0x4009('0x48')]));channels[_0x160561['uniqueid']][_0x4009('0x53')]=_0x4009('0x54');channels[_0x160561[_0x4009('0x7')]][_0x4009('0x55')]=_0x160561['value'];channels[_0x160561[_0x4009('0x7')]]['queue']=!![];}if(!_[_0x4009('0x1f')](_0x160561['variable'][_0x4009('0x56')])){utils[_0x4009('0x8')](util[_0x4009('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x160561[_0x4009('0x7')],_0x160561[_0x4009('0x48')]));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x57')]=_0x160561[_0x4009('0x48')];}if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x58')])){utils[_0x4009('0x8')](util[_0x4009('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x160561[_0x4009('0x7')],_0x160561[_0x4009('0x48')]));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x59')]=_0x160561[_0x4009('0x48')];}if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x5a')])){utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0x5b'),_0x160561[_0x4009('0x7')],_0x160561[_0x4009('0x48')]));channels[_0x160561[_0x4009('0x7')]][_0x4009('0x5c')]=_0x160561[_0x4009('0x48')];}if(!_[_0x4009('0x1f')](_0x160561[_0x4009('0x45')][_0x4009('0x5d')])){utils[_0x4009('0x8')](util['format'](_0x4009('0x5e'),_0x160561[_0x4009('0x7')],_0x160561[_0x4009('0x48')]));channels[_0x160561['uniqueid']]['sipcallid']=_0x160561[_0x4009('0x48')];}}}catch(_0x1f4f4f){utils[_0x4009('0x31')](util[_0x4009('0x9')](_0x4009('0x44'),_0x160561[_0x4009('0x7')]),_0x1f4f4f);}};exports[_0x4009('0x5f')]=function(_0x4dd5e9){try{if(!_[_0x4009('0x1f')](channels[_0x4dd5e9[_0x4009('0x7')]])){utils[_0x4009('0x1d')](util['format'](_0x4009('0x60'),_0x4dd5e9[_0x4009('0x7')]),_0x4dd5e9);utils[_0x4009('0x8')](util[_0x4009('0x9')](_0x4009('0x61'),_0x4dd5e9['uniqueid'],_0x4dd5e9[_0x4009('0x62')],_0x4dd5e9[_0x4009('0x63')]));if(_0x4dd5e9[_0x4009('0x62')][_0x4009('0x64')]()==_0x4009('0x65')&&_[_0x4009('0x66')](_0x4dd5e9[_0x4009('0x63')][_0x4009('0x64')](),'cdr')){var _0x147823=_0x4dd5e9[_0x4009('0x63')][_0x4009('0x67')]('=');var _0x34b5fc=_0x147823[0x0]['substring'](_0x147823[0x0][_0x4009('0x68')]('(')+0x1,_0x147823[0x0]['lastIndexOf'](')'));var _0x2fbeab=_0x147823[0x1];channels[_0x4dd5e9[_0x4009('0x7')]][_0x34b5fc]=_0x2fbeab;}if(!_[_0x4009('0x69')]([_0x4009('0x27'),'noop','execif','set','gotoif'],_0x4dd5e9[_0x4009('0x62')][_0x4009('0x64')]())){channels[_0x4dd5e9[_0x4009('0x7')]][_0x4009('0x53')]=_0x4dd5e9[_0x4009('0x62')];channels[_0x4dd5e9['uniqueid']][_0x4009('0x55')]=_0x4dd5e9[_0x4009('0x63')];}}}catch(_0x5e5eb7){utils['error'](util[_0x4009('0x9')](_0x4009('0x60'),_0x4dd5e9[_0x4009('0x7')]),_0x5e5eb7);}}; \ No newline at end of file +var _0xbf3d=['cdr','split','substring','includes','noop','execif','set','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','DOCUMENTATION','error','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','endtime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','xmd-phone','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastdata','xmd-contactid','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase'];(function(_0x214f8f,_0x26ccef){var _0x34fefa=function(_0x26451){while(--_0x26451){_0x214f8f['push'](_0x214f8f['shift']());}};_0x34fefa(++_0x26ccef);}(_0xbf3d,0xe2));var _0xdbf3=function(_0x47d47e,_0x516bfc){_0x47d47e=_0x47d47e-0x0;var _0x244840=_0xbf3d[_0x47d47e];return _0x244840;};'use strict';var _=require(_0xdbf3('0x0'));var util=require(_0xdbf3('0x1'));var utils=require(_0xdbf3('0x2'));var transfers=require(_0xdbf3('0x3'));var dispositions=[_0xdbf3('0x4'),_0xdbf3('0x5'),_0xdbf3('0x5'),_0xdbf3('0x4'),_0xdbf3('0x4'),_0xdbf3('0x4'),_0xdbf3('0x6'),_0xdbf3('0x7'),_0xdbf3('0x5'),_0xdbf3('0x5'),'FAILED'];var channels={};function writeDB(_0x2a9dfb){var _0x56514e;if(transfers['blinds'][_0x2a9dfb[_0xdbf3('0x8')]]){_0x56514e=_0x2a9dfb[_0xdbf3('0x8')];_0x2a9dfb[_0xdbf3('0x8')]=transfers[_0xdbf3('0x9')][_0x2a9dfb['uniqueid']]['transfereeuniqueid'];}utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0xb'),_0x2a9dfb[_0xdbf3('0x8')],_0x2a9dfb['channel'],_0x2a9dfb[_0xdbf3('0xc')],_0x2a9dfb['membername'],_0x2a9dfb[_0xdbf3('0xd')],_0x2a9dfb['calleridnum'],_0x2a9dfb[_0xdbf3('0xe')],_0x2a9dfb[_0xdbf3('0xf')]));if(_0x2a9dfb[_0xdbf3('0x10')]){utils[_0xdbf3('0x11')](_0x2a9dfb[_0xdbf3('0x10')])[_0xdbf3('0x12')](function(_0x2d4caa){if(_0x2d4caa){_0x2a9dfb[_0xdbf3('0x13')]=_0x2d4caa['id'];}utils['request'](_0xdbf3('0x14'),_0x2a9dfb);});}else{utils[_0xdbf3('0x15')](_0xdbf3('0x14'),_0x2a9dfb);}if(channels[_0x2a9dfb[_0xdbf3('0x8')]]){delete channels[_0x2a9dfb[_0xdbf3('0x8')]];}else if(_0x56514e&&channels[_0x56514e]){delete transfers[_0xdbf3('0x9')][_0x56514e];delete channels[_0x56514e];}}exports[_0xdbf3('0x16')]=function(_0x4998ad){try{utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x19'),_0x4998ad[_0xdbf3('0x8')]),_0x4998ad);if(_0x4998ad[_0xdbf3('0x8')]==_0x4998ad[_0xdbf3('0x1a')]&&_0x4998ad[_0xdbf3('0x1b')]!=_0xdbf3('0x1c')){utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x1d'),_0x4998ad[_0xdbf3('0x8')],_0x4998ad[_0xdbf3('0x1e')],_0x4998ad['exten']));channels[_0x4998ad[_0xdbf3('0x8')]]={'uniqueid':_0x4998ad[_0xdbf3('0x8')],'accountcode':_0x4998ad[_0xdbf3('0x10')],'source':_0x4998ad[_0xdbf3('0x1f')],'destination':_0x4998ad[_0xdbf3('0x20')],'destinationcontext':_0x4998ad[_0xdbf3('0x1e')],'channel':_0x4998ad[_0xdbf3('0x1b')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdbf3('0x4'),'amaflags':_0xdbf3('0x21')};}}catch(_0x140fe3){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x19'),_0x4998ad[_0xdbf3('0x8')]),_0x140fe3);}};exports['newstate']=function(_0x473964){try{utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x23'),_0x473964['uniqueid']),_0x473964);if(!_['isNil'](channels[_0x473964[_0xdbf3('0x8')]])&&_0x473964['channelstate']==0x6){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x24'),_0x473964[_0xdbf3('0x8')],_0x473964[_0xdbf3('0x1e')],_0x473964[_0xdbf3('0x1b')]));if(_[_0xdbf3('0x25')](channels[_0x473964[_0xdbf3('0x8')]][_0xdbf3('0x26')])){channels[_0x473964['uniqueid']][_0xdbf3('0x26')]=utils[_0xdbf3('0x27')]();}}else if(!_['isNil'](channels[_0x473964[_0xdbf3('0x1a')]])&&_0x473964[_0xdbf3('0x28')]==0x6&&_0x473964[_0xdbf3('0x1e')]!='transfer'){utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x29'),_0x473964[_0xdbf3('0x8')],_0x473964['linkedid'],_0x473964[_0xdbf3('0x1e')],_0x473964[_0xdbf3('0x1b')]));channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x10')]=_0x473964['accountcode'];channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2a')]=_0x473964[_0xdbf3('0x1b')];if(_[_0xdbf3('0x25')](channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2b')])){channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2b')]=utils['now']();}channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2c')]=dispositions[_[_0xdbf3('0x2d')](_0x473964[_0xdbf3('0x28')])]||_0xdbf3('0x6');}}catch(_0x13e95c){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x23'),_0x473964[_0xdbf3('0x8')]),_0x13e95c);}};exports[_0xdbf3('0x2e')]=function(_0x4c1a4e){try{if(!_['isNil'](channels[_0x4c1a4e[_0xdbf3('0x8')]])){utils['debug'](util[_0xdbf3('0x18')](_0xdbf3('0x2f'),_0x4c1a4e[_0xdbf3('0x8')]),_0x4c1a4e);if(_['isNil'](channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')])){channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')]=_0x4c1a4e[_0xdbf3('0x31')]+'\x20<'+_0x4c1a4e[_0xdbf3('0x1f')]+'>';}utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x32'),_0x4c1a4e[_0xdbf3('0x8')],channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')],_0x4c1a4e['cause-txt']));channels[_0x4c1a4e['uniqueid']]['endtime']=utils[_0xdbf3('0x27')]();channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x33')]=utils[_0xdbf3('0x34')](channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x35')],channels[_0x4c1a4e[_0xdbf3('0x8')]]['starttime']);channels[_0x4c1a4e[_0xdbf3('0x8')]]['billableseconds']=channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x2b')]?utils[_0xdbf3('0x34')](channels[_0x4c1a4e['uniqueid']][_0xdbf3('0x35')],channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x2b')]):0x0;writeDB(channels[_0x4c1a4e['uniqueid']]);}}catch(_0x3a7ddf){utils['error'](util[_0xdbf3('0x18')]('[%s][calls][hangup]',_0x4c1a4e['uniqueid']),_0x3a7ddf);}};exports[_0xdbf3('0x36')]=function(_0x24862e){try{if(!_[_0xdbf3('0x25')](channels[_0x24862e['localtwolinkedid']])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')]('[%s][calls][attendedtransfer]',_0x24862e['origtransfereruniqueid']),_0x24862e);if(channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x1b')]==_0x24862e[_0xdbf3('0x38')]){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x39'),_0x24862e['origtransfereruniqueid'],_0x24862e[_0xdbf3('0x37')],_0x24862e[_0xdbf3('0x3a')]));channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x2a')]=_0x24862e['secondtransfererchannel'];channels[_0x24862e[_0xdbf3('0x37')]]['userfield']=_0xdbf3('0x3b');}else if(channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x1b')]=_0x24862e[_0xdbf3('0x3c')]){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x39'),_0x24862e[_0xdbf3('0x3d')],_0x24862e['localtwolinkedid'],_0x24862e[_0xdbf3('0x3e')]));channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x2a')]=_0x24862e[_0xdbf3('0x3e')];channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x3f')]=_0xdbf3('0x3b');}}}catch(_0x3aec89){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x40'),_0x24862e[_0xdbf3('0x3d')]),_0x3aec89);}};exports[_0xdbf3('0x41')]=function(_0x493a69){try{if(!_[_0xdbf3('0x25')](channels[_0x493a69[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')]('[%s][calls][musiconholdstart]',_0x493a69[_0xdbf3('0x8')]),_0x493a69);channels[_0x493a69['uniqueid']]['musiconholdstartAt']=utils[_0xdbf3('0x27')]();utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x42'),_0x493a69[_0xdbf3('0x8')],channels[_0x493a69[_0xdbf3('0x8')]][_0xdbf3('0x43')]));}}catch(_0x53c203){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x44'),_0x493a69[_0xdbf3('0x8')]),_0x53c203);}};exports[_0xdbf3('0x45')]=function(_0xbed6e1){try{if(!_['isNil'](channels[_0xbed6e1[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x46'),_0xbed6e1[_0xdbf3('0x8')]),_0xbed6e1);if(!_[_0xdbf3('0x25')](channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x43')])){channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x47')]+=utils[_0xdbf3('0x34')](utils[_0xdbf3('0x27')](),channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x43')]);utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x48'),_0xbed6e1[_0xdbf3('0x8')],channels[_0xbed6e1['uniqueid']][_0xdbf3('0x47')]));delete channels[_0xbed6e1['uniqueid']][_0xdbf3('0x43')];}}}catch(_0x494eac){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')]('[%s][calls][musiconholdstop]',_0xbed6e1[_0xdbf3('0x8')]),_0x494eac);}};exports['varset']=function(_0x48be97){try{if(!_[_0xdbf3('0x25')](channels[_0x48be97[_0xdbf3('0x8')]])){utils['debug'](util[_0xdbf3('0x18')](_0xdbf3('0x49'),_0x48be97[_0xdbf3('0x8')]),_0x48be97);if(!_[_0xdbf3('0x25')](_0x48be97['variable'][_0xdbf3('0x4a')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x4b'),_0x48be97['uniqueid'],_0x48be97['value']));channels[_0x48be97['uniqueid']][_0xdbf3('0x4c')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x4f')])){utils[_0xdbf3('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x48be97[_0xdbf3('0x8')],_0x48be97['value']));channels[_0x48be97[_0xdbf3('0x8')]]['destination']=_0x48be97['value'];channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x30')]='\x22'+_0x48be97[_0xdbf3('0x4d')]+'\x22\x20<'+_0x48be97[_0xdbf3('0x4d')]+'>';}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')]['xmd-callerid-preview'])||!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x50')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x51'),_0x48be97[_0xdbf3('0x8')],!_[_0xdbf3('0x25')](_0x48be97['variable'][_0xdbf3('0x52')])?'xmd-callerid-preview':_0xdbf3('0x50'),_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x30')]=_0x48be97['value'];}if(!_['isNil'](_0x48be97['variable'][_0xdbf3('0x53')])||!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x54')])){utils['info'](util[_0xdbf3('0x18')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x48be97[_0xdbf3('0x8')],!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x53')])?_0xdbf3('0x53'):'xmcs-queue',_0x48be97['value']));channels[_0x48be97[_0xdbf3('0x8')]]['lastapplication']='Queue';channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x55')]=_0x48be97[_0xdbf3('0x4d')];channels[_0x48be97['uniqueid']]['queue']=!![];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x56')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x57')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97['variable']['xmd-cdrtype'])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x58'),_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x59')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x5a')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x5b'),_0x48be97[_0xdbf3('0x8')],_0x48be97['value']));channels[_0x48be97['uniqueid']]['routeid']=_0x48be97['value'];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')]['sipcallid'])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x5c'),_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x5d')]=_0x48be97[_0xdbf3('0x4d')];}}}catch(_0x2e444f){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x49'),_0x48be97[_0xdbf3('0x8')]),_0x2e444f);}};exports[_0xdbf3('0x5e')]=function(_0x59d137){try{if(!_[_0xdbf3('0x25')](channels[_0x59d137[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x5f'),_0x59d137[_0xdbf3('0x8')]),_0x59d137);utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x60'),_0x59d137[_0xdbf3('0x8')],_0x59d137[_0xdbf3('0x61')],_0x59d137[_0xdbf3('0x62')]));if(_0x59d137['application']['toLowerCase']()=='set'&&_[_0xdbf3('0x63')](_0x59d137[_0xdbf3('0x62')][_0xdbf3('0x64')](),_0xdbf3('0x65'))){var _0x1b95b0=_0x59d137['appdata'][_0xdbf3('0x66')]('=');var _0x2e5671=_0x1b95b0[0x0][_0xdbf3('0x67')](_0x1b95b0[0x0]['lastIndexOf']('(')+0x1,_0x1b95b0[0x0]['lastIndexOf'](')'));var _0x35e166=_0x1b95b0[0x1];channels[_0x59d137[_0xdbf3('0x8')]][_0x2e5671]=_0x35e166;}if(!_[_0xdbf3('0x68')]([_0xdbf3('0x2e'),_0xdbf3('0x69'),_0xdbf3('0x6a'),_0xdbf3('0x6b'),'gotoif'],_0x59d137[_0xdbf3('0x61')][_0xdbf3('0x64')]())){channels[_0x59d137['uniqueid']][_0xdbf3('0x6c')]=_0x59d137[_0xdbf3('0x61')];channels[_0x59d137['uniqueid']][_0xdbf3('0x55')]=_0x59d137[_0xdbf3('0x62')];}}}catch(_0x12e1e0){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x5f'),_0x59d137[_0xdbf3('0x8')]),_0x12e1e0);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c82f567..51f06fc 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 _0xabce=['fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x2c5198,_0x4e0e85){var _0x25dfab=function(_0x522765){while(--_0x522765){_0x2c5198['push'](_0x2c5198['shift']());}};_0x25dfab(++_0x4e0e85);}(_0xabce,0x103));var _0xeabc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xabce[_0x397cfb];return _0x15fed9;};'use strict';var utils=require(_0xeabc('0x0'));exports[_0xeabc('0x1')]=function(){utils[_0xeabc('0x2')](_0xeabc('0x3'));};exports[_0xeabc('0x4')]=function(){utils['info']('[core]\x20shutdown');};exports[_0xeabc('0x5')]=function(){utils[_0xeabc('0x2')](_0xeabc('0x6'));};exports['error']=function(_0x54e4a8){utils[_0xeabc('0x7')]('[core]\x20error',_0x54e4a8);};exports[_0xeabc('0x8')]=function(){utils['info'](_0xeabc('0x9'));};exports[_0xeabc('0xa')]=function(_0x8434c5){}; \ No newline at end of file +var _0x7d55=['error','[core]\x20error','close','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0x13b593,_0x85a736){var _0x1d2958=function(_0x371387){while(--_0x371387){_0x13b593['push'](_0x13b593['shift']());}};_0x1d2958(++_0x85a736);}(_0x7d55,0x1bc));var _0x57d5=function(_0x11f427,_0x15b6e5){_0x11f427=_0x11f427-0x0;var _0x147811=_0x7d55[_0x11f427];return _0x147811;};'use strict';var utils=require(_0x57d5('0x0'));exports[_0x57d5('0x1')]=function(){utils[_0x57d5('0x2')](_0x57d5('0x3'));};exports['shutdown']=function(){utils['info'](_0x57d5('0x4'));};exports[_0x57d5('0x5')]=function(){utils[_0x57d5('0x2')]('[core]\x20fullybooted');};exports[_0x57d5('0x6')]=function(_0x2d9ad2){utils[_0x57d5('0x6')](_0x57d5('0x7'),_0x2d9ad2);};exports[_0x57d5('0x8')]=function(){utils[_0x57d5('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x59e164){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 00652eb..87b9192 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 _0xb365=['request','CreateVoiceDialReport','newexten','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','cdr(routeid)','appdata','split','[%s][dials][newexten]','varset','debug','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xb365,0xd1));var _0x5b36=function(_0x1e05c2,_0x13efbc){_0x1e05c2=_0x1e05c2-0x0;var _0x47283=_0xb365[_0x1e05c2];return _0x47283;};'use strict';var _=require(_0x5b36('0x0'));var util=require(_0x5b36('0x1'));var utils=require(_0x5b36('0x2'));var dials={};function writeDB(_0x1afb3b){utils[_0x5b36('0x3')](util['format'](_0x5b36('0x4'),_0x1afb3b[_0x5b36('0x5')],_0x1afb3b[_0x5b36('0x6')],_0x1afb3b[_0x5b36('0x7')],_0x1afb3b[_0x5b36('0x8')],_0x1afb3b[_0x5b36('0x9')],_0x1afb3b[_0x5b36('0xa')]));utils[_0x5b36('0xb')](_0x5b36('0xc'),_0x1afb3b);delete dials[_0x1afb3b[_0x5b36('0x5')]];}exports[_0x5b36('0xd')]=function(_0x213cae){try{utils['debug'](util[_0x5b36('0xe')]('[%s][dials][newexten]',_0x213cae[_0x5b36('0x5')]),_0x213cae);utils['info'](util[_0x5b36('0xe')](_0x5b36('0xf'),_0x213cae[_0x5b36('0x5')],_0x213cae[_0x5b36('0x10')],_0x213cae['appdata']));if(_0x213cae[_0x5b36('0x10')][_0x5b36('0x11')]()==_0x5b36('0x12')&&_['startsWith'](_0x213cae['appdata'][_0x5b36('0x11')](),_0x5b36('0x13'))){var _0x54c323=_0x213cae[_0x5b36('0x14')][_0x5b36('0x15')]('=');dials[_0x213cae[_0x5b36('0x5')]]={'routeId':_0x54c323[0x1]};}}catch(_0x69cb8){utils['error'](util['format'](_0x5b36('0x16'),_0x213cae[_0x5b36('0x5')]),_0x69cb8);}};exports[_0x5b36('0x17')]=function(_0x253c2b){try{utils[_0x5b36('0x18')](util['format']('[%s][dials][varset]',_0x253c2b[_0x5b36('0x5')]),_0x253c2b);if(!_[_0x5b36('0x19')](_0x253c2b[_0x5b36('0x1a')]['outboundrouteid'])){utils[_0x5b36('0x3')](util['format'](_0x5b36('0x1b'),_0x253c2b[_0x5b36('0x5')],_0x253c2b[_0x5b36('0x1c')]));dials[_0x253c2b['uniqueid']]={'routeId':_0x253c2b['value']};}}catch(_0x107598){utils[_0x5b36('0x1d')](util['format'](_0x5b36('0x1e'),_0x253c2b[_0x5b36('0x5')]),_0x107598);}};exports[_0x5b36('0x1f')]=function(_0x5c5f7e){try{if(!_[_0x5b36('0x19')](dials[_0x5c5f7e['uniqueid']])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x5c5f7e[_0x5b36('0x5')]),_0x5c5f7e);dials[_0x5c5f7e[_0x5b36('0x5')]]=_[_0x5b36('0x20')](dials[_0x5c5f7e['uniqueid']],_0x5c5f7e);dials[_0x5c5f7e[_0x5b36('0x5')]][_0x5b36('0x21')]=utils[_0x5b36('0x22')]();dials[_0x5c5f7e['uniqueid']][_0x5b36('0x23')]='called';utils[_0x5b36('0x3')](util[_0x5b36('0xe')](_0x5b36('0x24'),_0x5c5f7e['uniqueid'],dials[_0x5c5f7e[_0x5b36('0x5')]][_0x5b36('0x21')]));}}catch(_0x15a58c){utils[_0x5b36('0x1d')](util['format'](_0x5b36('0x25'),_0x5c5f7e['uniqueid']),_0x15a58c);}};exports[_0x5b36('0x26')]=function(_0x5e6d07){try{if(!_[_0x5b36('0x19')](dials[_0x5e6d07[_0x5b36('0x5')]])){utils[_0x5b36('0x18')](util['format'](_0x5b36('0x27'),_0x5e6d07['uniqueid']),_0x5e6d07);dials[_0x5e6d07['uniqueid']][_0x5b36('0xa')]=_0x5e6d07['dialstatus'];if(_0x5e6d07[_0x5b36('0xa')]==_0x5b36('0x28')){dials[_0x5e6d07['uniqueid']]=_['assign'](dials[_0x5e6d07[_0x5b36('0x5')]],_0x5e6d07);dials[_0x5e6d07[_0x5b36('0x5')]][_0x5b36('0x29')]=utils['now']();dials[_0x5e6d07[_0x5b36('0x5')]][_0x5b36('0x23')]=_0x5b36('0x2a');utils[_0x5b36('0x3')](util['format'](_0x5b36('0x2b'),_0x5e6d07[_0x5b36('0x5')],_0x5e6d07['dialstatus'],dials[_0x5e6d07[_0x5b36('0x5')]][_0x5b36('0x29')]));}else{utils['info'](util[_0x5b36('0xe')]('[%s][dials][dialend]\x20dialstatus:%s',_0x5e6d07[_0x5b36('0x5')],_0x5e6d07[_0x5b36('0xa')]));}}}catch(_0xc29e8d){utils['error'](util[_0x5b36('0xe')](_0x5b36('0x27'),_0x5e6d07[_0x5b36('0x5')]),_0xc29e8d);}};exports[_0x5b36('0x2c')]=function(_0x114a9f){try{if(!_[_0x5b36('0x19')](dials[_0x114a9f[_0x5b36('0x5')]])){utils['debug'](util[_0x5b36('0xe')](_0x5b36('0x2d'),_0x114a9f[_0x5b36('0x5')]),_0x114a9f);utils[_0x5b36('0x3')](util[_0x5b36('0xe')](_0x5b36('0x2e'),_0x114a9f[_0x5b36('0x5')],_0x114a9f['calleridnum'],_0x114a9f[_0x5b36('0x2f')],_0x114a9f[_0x5b36('0x30')]));dials[_0x114a9f[_0x5b36('0x5')]]=_[_0x5b36('0x20')](dials[_0x114a9f['uniqueid']],{'endtime':utils[_0x5b36('0x22')](),'lastevent':_0x5b36('0x31')});dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x32')]=utils[_0x5b36('0x33')](dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x34')],dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x21')]);dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x35')]=utils[_0x5b36('0x33')](dials[_0x114a9f['uniqueid']][_0x5b36('0x29')]||dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x34')],dials[_0x114a9f[_0x5b36('0x5')]]['starttime']);dials[_0x114a9f[_0x5b36('0x5')]][_0x5b36('0x36')]=dials[_0x114a9f[_0x5b36('0x5')]]['answertime']?utils['diffTime'](dials[_0x114a9f[_0x5b36('0x5')]]['endtime'],dials[_0x114a9f[_0x5b36('0x5')]]['answertime']):0x0;writeDB(dials[_0x114a9f['uniqueid']]);}}catch(_0xd4be2b){utils['error'](util['format'](_0x5b36('0x2d'),_0x114a9f[_0x5b36('0x5')]),_0xd4be2b);}}; \ No newline at end of file +var _0x7d54=['hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','holdtime','diffTime','endtime','billableseconds','answertime','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','uniqueid','info','appdata','application','toLowerCase','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','value','dialbegin','debug','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialstatus','assign','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x2eea36,_0x4e796c){var _0x25e063=function(_0x55e0eb){while(--_0x55e0eb){_0x2eea36['push'](_0x2eea36['shift']());}};_0x25e063(++_0x4e796c);}(_0x7d54,0x125));var _0x47d5=function(_0x12f036,_0x27e401){_0x12f036=_0x12f036-0x0;var _0xf0be1b=_0x7d54[_0x12f036];return _0xf0be1b;};'use strict';var _=require(_0x47d5('0x0'));var util=require('util');var utils=require(_0x47d5('0x1'));var dials={};function writeDB(_0x3f0f03){utils['info'](util[_0x47d5('0x2')](_0x47d5('0x3'),_0x3f0f03['uniqueid'],_0x3f0f03[_0x47d5('0x4')],_0x3f0f03[_0x47d5('0x5')],_0x3f0f03[_0x47d5('0x6')],_0x3f0f03[_0x47d5('0x7')],_0x3f0f03['dialstatus']));utils['request'](_0x47d5('0x8'),_0x3f0f03);delete dials[_0x3f0f03[_0x47d5('0x9')]];}exports['newexten']=function(_0x51bf5a){try{utils['debug'](util[_0x47d5('0x2')]('[%s][dials][newexten]',_0x51bf5a[_0x47d5('0x9')]),_0x51bf5a);utils[_0x47d5('0xa')](util[_0x47d5('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x51bf5a['uniqueid'],_0x51bf5a['application'],_0x51bf5a[_0x47d5('0xb')]));if(_0x51bf5a[_0x47d5('0xc')][_0x47d5('0xd')]()=='set'&&_['startsWith'](_0x51bf5a[_0x47d5('0xb')][_0x47d5('0xd')](),'cdr(routeid)')){var _0x235729=_0x51bf5a[_0x47d5('0xb')][_0x47d5('0xe')]('=');dials[_0x51bf5a['uniqueid']]={'routeId':_0x235729[0x1]};}}catch(_0x4da628){utils[_0x47d5('0xf')](util['format'](_0x47d5('0x10'),_0x51bf5a[_0x47d5('0x9')]),_0x4da628);}};exports[_0x47d5('0x11')]=function(_0x63a093){try{utils['debug'](util[_0x47d5('0x2')](_0x47d5('0x12'),_0x63a093[_0x47d5('0x9')]),_0x63a093);if(!_[_0x47d5('0x13')](_0x63a093['variable'][_0x47d5('0x14')])){utils[_0x47d5('0xa')](util[_0x47d5('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x63a093['uniqueid'],_0x63a093[_0x47d5('0x15')]));dials[_0x63a093[_0x47d5('0x9')]]={'routeId':_0x63a093['value']};}}catch(_0x4444c3){utils['error'](util[_0x47d5('0x2')](_0x47d5('0x12'),_0x63a093[_0x47d5('0x9')]),_0x4444c3);}};exports[_0x47d5('0x16')]=function(_0x35b56b){try{if(!_['isNil'](dials[_0x35b56b['uniqueid']])){utils[_0x47d5('0x17')](util[_0x47d5('0x2')]('[%s][dials][dialbegin]',_0x35b56b[_0x47d5('0x9')]),_0x35b56b);dials[_0x35b56b[_0x47d5('0x9')]]=_['assign'](dials[_0x35b56b[_0x47d5('0x9')]],_0x35b56b);dials[_0x35b56b[_0x47d5('0x9')]][_0x47d5('0x18')]=utils[_0x47d5('0x19')]();dials[_0x35b56b[_0x47d5('0x9')]]['lastevent']=_0x47d5('0x1a');utils[_0x47d5('0xa')](util['format'](_0x47d5('0x1b'),_0x35b56b[_0x47d5('0x9')],dials[_0x35b56b[_0x47d5('0x9')]][_0x47d5('0x18')]));}}catch(_0x57f5ed){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x1c'),_0x35b56b[_0x47d5('0x9')]),_0x57f5ed);}};exports['dialend']=function(_0x3dc7a0){try{if(!_[_0x47d5('0x13')](dials[_0x3dc7a0['uniqueid']])){utils[_0x47d5('0x17')](util['format']('[%s][dials][dialend]',_0x3dc7a0[_0x47d5('0x9')]),_0x3dc7a0);dials[_0x3dc7a0[_0x47d5('0x9')]][_0x47d5('0x1d')]=_0x3dc7a0[_0x47d5('0x1d')];if(_0x3dc7a0['dialstatus']=='ANSWER'){dials[_0x3dc7a0['uniqueid']]=_[_0x47d5('0x1e')](dials[_0x3dc7a0[_0x47d5('0x9')]],_0x3dc7a0);dials[_0x3dc7a0['uniqueid']]['answertime']=utils['now']();dials[_0x3dc7a0[_0x47d5('0x9')]][_0x47d5('0x1f')]=_0x47d5('0x20');utils[_0x47d5('0xa')](util['format'](_0x47d5('0x21'),_0x3dc7a0[_0x47d5('0x9')],_0x3dc7a0[_0x47d5('0x1d')],dials[_0x3dc7a0[_0x47d5('0x9')]]['answertime']));}else{utils[_0x47d5('0xa')](util[_0x47d5('0x2')](_0x47d5('0x22'),_0x3dc7a0[_0x47d5('0x9')],_0x3dc7a0[_0x47d5('0x1d')]));}}}catch(_0x1f0829){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x23'),_0x3dc7a0['uniqueid']),_0x1f0829);}};exports[_0x47d5('0x24')]=function(_0x34ed88){try{if(!_[_0x47d5('0x13')](dials[_0x34ed88['uniqueid']])){utils[_0x47d5('0x17')](util['format'](_0x47d5('0x25'),_0x34ed88[_0x47d5('0x9')]),_0x34ed88);utils[_0x47d5('0xa')](util[_0x47d5('0x2')](_0x47d5('0x26'),_0x34ed88['uniqueid'],_0x34ed88[_0x47d5('0x6')],_0x34ed88[_0x47d5('0x27')],_0x34ed88['cause-txt']));dials[_0x34ed88[_0x47d5('0x9')]]=_[_0x47d5('0x1e')](dials[_0x34ed88[_0x47d5('0x9')]],{'endtime':utils['now'](),'lastevent':_0x47d5('0x28')});dials[_0x34ed88['uniqueid']][_0x47d5('0x29')]=utils['diffTime'](dials[_0x34ed88[_0x47d5('0x9')]]['endtime'],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x18')]);dials[_0x34ed88['uniqueid']][_0x47d5('0x2a')]=utils[_0x47d5('0x2b')](dials[_0x34ed88[_0x47d5('0x9')]]['answertime']||dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2c')],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x18')]);dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2d')]=dials[_0x34ed88['uniqueid']][_0x47d5('0x2e')]?utils[_0x47d5('0x2b')](dials[_0x34ed88[_0x47d5('0x9')]]['endtime'],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2e')]):0x0;writeDB(dials[_0x34ed88[_0x47d5('0x9')]]);}}catch(_0x1f9096){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x25'),_0x34ed88[_0x47d5('0x9')]),_0x1f9096);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1de3f6a..084990f 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 _0x3271=['[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','xdr','disabled','info','./agents.controller','./calls.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x3271,0xd3));var _0x1327=function(_0x449380,_0x25f786){_0x449380=_0x449380-0x0;var _0x3beb87=_0x3271[_0x449380];return _0x3beb87;};var AsteriskManager=require(_0x1327('0x0'));var config=require(_0x1327('0x1'));var utils=require(_0x1327('0x2'));var util=require(_0x1327('0x3'));var ami=new AsteriskManager(config[_0x1327('0x4')][_0x1327('0x5')],config[_0x1327('0x4')]['ip'],config[_0x1327('0x4')][_0x1327('0x6')],config[_0x1327('0x4')][_0x1327('0x7')],!![]);ami['keepConnected']();if(config[_0x1327('0x8')]&&config[_0x1327('0x8')][_0x1327('0x9')]){utils[_0x1327('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0x1327('0xb'));var calls=require(_0x1327('0xc'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x1327('0xd'));var dials=require('./dials.controller');var transfers=require(_0x1327('0xe'));var core=require(_0x1327('0xf'));ami['on']('connect',core[_0x1327('0x10')]);ami['on'](_0x1327('0x11'),core[_0x1327('0x11')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x1327('0x12'),core[_0x1327('0x12')]);ami['on'](_0x1327('0x13'),core[_0x1327('0x13')]);ami['on'](_0x1327('0x14'),core[_0x1327('0x14')]);ami['on'](_0x1327('0x15'),function(_0x460021){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x18'),_0x460021[_0x1327('0x19')]),_0x460021);members[_0x1327('0x15')](_0x460021);}catch(_0x7b9000){utils[_0x1327('0x12')](util['format'](_0x1327('0x18'),_0x460021[_0x1327('0x19')]),_0x7b9000);}});ami['on'](_0x1327('0x1a'),function(_0x5b3783){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x1b'),_0x5b3783[_0x1327('0x1c')]),_0x5b3783);agents[_0x1327('0x1a')](_0x5b3783);}catch(_0x677f9f){utils[_0x1327('0x12')](util['format'](_0x1327('0x1b'),_0x5b3783[_0x1327('0x1c')]),_0x677f9f);}});ami['on']('agentringnoanswer',function(_0x54ccd4){try{utils[_0x1327('0x16')](util['format']('[%s][index][agentringnoanswer]',_0x54ccd4[_0x1327('0x1c')]),_0x54ccd4);agents[_0x1327('0x1d')](_0x54ccd4);}catch(_0x595688){utils[_0x1327('0x12')](util[_0x1327('0x17')]('[%s][index][agentringnoanswer]',_0x54ccd4['uniqueid']),_0x595688);}});ami['on'](_0x1327('0x1e'),function(_0x257919){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x1f'),_0x257919[_0x1327('0x1c')]),_0x257919);agents['agentconnect'](_0x257919);queues[_0x1327('0x1e')](_0x257919);}catch(_0x2b01ee){utils[_0x1327('0x12')](util[_0x1327('0x17')](_0x1327('0x1f'),_0x257919[_0x1327('0x1c')]),_0x2b01ee);}});ami['on'](_0x1327('0x20'),function(_0x956aed){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x21'),_0x956aed[_0x1327('0x1c')]),_0x956aed);agents[_0x1327('0x20')](_0x956aed);queues[_0x1327('0x20')](_0x956aed);members['agentcomplete'](_0x956aed);}catch(_0x19da4d){utils[_0x1327('0x12')](util['format'](_0x1327('0x21'),_0x956aed['uniqueid']),_0x19da4d);}});ami['on'](_0x1327('0x22'),function(_0x25f1d1){try{utils['debug'](util['format'](_0x1327('0x23'),_0x25f1d1[_0x1327('0x1c')]),_0x25f1d1);agents['queuecallerabandon'](_0x25f1d1);queues['queuecallerabandon'](_0x25f1d1);}catch(_0x10e801){utils['error'](util[_0x1327('0x17')](_0x1327('0x23'),_0x25f1d1[_0x1327('0x1c')]),_0x10e801);}});ami['on'](_0x1327('0x24'),function(_0x32b79f){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x25'),_0x32b79f[_0x1327('0x1c')]),_0x32b79f);queues[_0x1327('0x24')](_0x32b79f);recordings[_0x1327('0x24')](_0x32b79f);}catch(_0xec0c24){utils[_0x1327('0x12')](util[_0x1327('0x17')]('[%s][index][queuecallerjoin]',_0x32b79f[_0x1327('0x1c')]),_0xec0c24);}});ami['on'](_0x1327('0x26'),function(_0x2b5c1e){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x27'),_0x2b5c1e['uniqueid']),_0x2b5c1e);queues['queuecallerleave'](_0x2b5c1e);}catch(_0x34fa40){utils[_0x1327('0x12')](util[_0x1327('0x17')](_0x1327('0x27'),_0x2b5c1e[_0x1327('0x1c')]),_0x34fa40);}});ami['on'](_0x1327('0x28'),function(_0x155069){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x29'),_0x155069[_0x1327('0x1c')]),_0x155069);queues[_0x1327('0x28')](_0x155069);calls[_0x1327('0x28')](_0x155069);}catch(_0x404e42){utils['error'](util[_0x1327('0x17')](_0x1327('0x29'),_0x155069[_0x1327('0x1c')]),_0x404e42);}});ami['on'](_0x1327('0x2a'),function(_0x2f8a68){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x2b'),_0x2f8a68[_0x1327('0x1c')]),_0x2f8a68);queues[_0x1327('0x2a')](_0x2f8a68);calls['musiconholdstop'](_0x2f8a68);}catch(_0x161dde){utils['error'](util[_0x1327('0x17')]('[%s][index][musiconholdstop]',_0x2f8a68[_0x1327('0x1c')]),_0x161dde);}});ami['on'](_0x1327('0x2c'),function(_0xf5008a){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x2d'),_0xf5008a[_0x1327('0x1c')]),_0xf5008a);calls[_0x1327('0x2c')](_0xf5008a);recordings['newstate'](_0xf5008a);}catch(_0x558bad){utils[_0x1327('0x12')](util['format'](_0x1327('0x2d'),_0xf5008a['uniqueid']),_0x558bad);}});ami['on'](_0x1327('0x2e'),function(_0x2874ab){try{utils[_0x1327('0x16')](util[_0x1327('0x17')](_0x1327('0x2f'),_0x2874ab[_0x1327('0x1c')]),_0x2874ab);calls['hangup'](_0x2874ab);recordings[_0x1327('0x2e')](_0x2874ab);dials[_0x1327('0x2e')](_0x2874ab);agents[_0x1327('0x2e')](_0x2874ab);queues[_0x1327('0x2e')](_0x2874ab);}catch(_0x19e0d0){utils[_0x1327('0x12')](util[_0x1327('0x17')]('[%s][index][hangup]',_0x2874ab['uniqueid']),_0x19e0d0);}});ami['on'](_0x1327('0x30'),function(_0x561659){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x31'),_0x561659[_0x1327('0x1c')]),_0x561659);members[_0x1327('0x30')](_0x561659);}catch(_0x452774){utils['error'](util['format'](_0x1327('0x31'),_0x561659[_0x1327('0x1c')]),_0x452774);}});ami['on'](_0x1327('0x32'),function(_0x39c18f){try{utils['debug'](util['format'](_0x1327('0x33'),_0x39c18f[_0x1327('0x1c')]),_0x39c18f);queues[_0x1327('0x32')](_0x39c18f);agents[_0x1327('0x32')](_0x39c18f);transfers[_0x1327('0x32')](_0x39c18f);}catch(_0x1eedd5){utils[_0x1327('0x12')](util[_0x1327('0x17')](_0x1327('0x33'),_0x39c18f[_0x1327('0x1c')]),_0x1eedd5);}});ami['on'](_0x1327('0x34'),function(_0x210e46){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x35'),_0x210e46[_0x1327('0x36')]),_0x210e46);queues[_0x1327('0x34')](_0x210e46);transfers[_0x1327('0x34')](_0x210e46);agents[_0x1327('0x34')](_0x210e46);calls[_0x1327('0x34')](_0x210e46);}catch(_0x461c18){utils['error'](util[_0x1327('0x17')](_0x1327('0x35'),_0x210e46['origtransfereruniqueid']),_0x461c18);}});ami['on'](_0x1327('0x37'),function(_0x855392){try{utils['debug'](util[_0x1327('0x17')](_0x1327('0x38'),_0x855392['uniqueid']),_0x855392);queues['varset'](_0x855392);recordings[_0x1327('0x37')](_0x855392);calls['varset'](_0x855392);dials['varset'](_0x855392);}catch(_0x382b09){utils[_0x1327('0x12')](util['format'](_0x1327('0x38'),_0x855392[_0x1327('0x1c')]),_0x382b09);}});ami['on'](_0x1327('0x39'),function(_0x501aa2){try{utils[_0x1327('0x16')](util[_0x1327('0x17')]('[%s][index][newexten]',_0x501aa2[_0x1327('0x1c')]),_0x501aa2);calls[_0x1327('0x39')](_0x501aa2);recordings[_0x1327('0x39')](_0x501aa2);dials[_0x1327('0x39')](_0x501aa2);}catch(_0x3dbc8e){utils[_0x1327('0x12')](util[_0x1327('0x17')](_0x1327('0x3a'),_0x501aa2['uniqueid']),_0x3dbc8e);}});ami['on']('newchannel',function(_0x2f8786){try{utils['debug'](util['format'](_0x1327('0x3b'),_0x2f8786[_0x1327('0x1c')]),_0x2f8786);calls['newchannel'](_0x2f8786);recordings[_0x1327('0x3c')](_0x2f8786);}catch(_0x396564){utils[_0x1327('0x12')](util[_0x1327('0x17')](_0x1327('0x3b'),_0x2f8786[_0x1327('0x1c')]),_0x396564);}});ami['on'](_0x1327('0x3d'),function(_0x5bdbcf){try{utils[_0x1327('0x16')](util['format']('[%s][index][dialbegin]',_0x5bdbcf[_0x1327('0x1c')]),_0x5bdbcf);dials[_0x1327('0x3d')](_0x5bdbcf);}catch(_0x4dbfb9){utils[_0x1327('0x12')](util[_0x1327('0x17')]('[%s]dialbegin',_0x5bdbcf[_0x1327('0x1c')]),_0x4dbfb9);}});ami['on'](_0x1327('0x3e'),function(_0x391c1c){try{utils['debug'](util['format'](_0x1327('0x3f'),_0x391c1c[_0x1327('0x1c')]),_0x391c1c);dials[_0x1327('0x3e')](_0x391c1c);}catch(_0x913b97){utils['error'](util[_0x1327('0x17')]('[%s][index][dialend]',_0x391c1c[_0x1327('0x1c')]),_0x913b97);}});} \ No newline at end of file +var _0xf34b=['./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x26165a,_0x468cfe){var _0x1e9a2f=function(_0x2a58bb){while(--_0x2a58bb){_0x26165a['push'](_0x26165a['shift']());}};_0x1e9a2f(++_0x468cfe);}(_0xf34b,0x17d));var _0xbf34=function(_0xf47070,_0xb31c1e){_0xf47070=_0xf47070-0x0;var _0x336c4b=_0xf34b[_0xf47070];return _0x336c4b;};var AsteriskManager=require(_0xbf34('0x0'));var config=require(_0xbf34('0x1'));var utils=require(_0xbf34('0x2'));var util=require(_0xbf34('0x3'));var ami=new AsteriskManager(config['asterisk'][_0xbf34('0x4')],config['asterisk']['ip'],config[_0xbf34('0x5')]['username'],config[_0xbf34('0x5')][_0xbf34('0x6')],!![]);ami[_0xbf34('0x7')]();if(config[_0xbf34('0x8')]&&config[_0xbf34('0x8')][_0xbf34('0x9')]){utils['info'](_0xbf34('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xbf34('0xb'));var queues=require(_0xbf34('0xc'));var recordings=require(_0xbf34('0xd'));var members=require(_0xbf34('0xe'));var dials=require('./dials.controller');var transfers=require(_0xbf34('0xf'));var core=require(_0xbf34('0x10'));ami['on'](_0xbf34('0x11'),core[_0xbf34('0x11')]);ami['on'](_0xbf34('0x12'),core['shutdown']);ami['on'](_0xbf34('0x13'),core['fullybooted']);ami['on'](_0xbf34('0x14'),core[_0xbf34('0x14')]);ami['on'](_0xbf34('0x15'),core[_0xbf34('0x15')]);ami['on'](_0xbf34('0x16'),core[_0xbf34('0x16')]);ami['on'](_0xbf34('0x17'),function(_0x51e8b8){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x1a'),_0x51e8b8['device']),_0x51e8b8);members[_0xbf34('0x17')](_0x51e8b8);}catch(_0x2c6e82){utils['error'](util['format'](_0xbf34('0x1a'),_0x51e8b8[_0xbf34('0x1b')]),_0x2c6e82);}});ami['on'](_0xbf34('0x1c'),function(_0x15c435){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][agentcalled]',_0x15c435[_0xbf34('0x1d')]),_0x15c435);agents[_0xbf34('0x1c')](_0x15c435);}catch(_0x4e371c){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][agentcalled]',_0x15c435['uniqueid']),_0x4e371c);}});ami['on']('agentringnoanswer',function(_0x4364f7){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][agentringnoanswer]',_0x4364f7[_0xbf34('0x1d')]),_0x4364f7);agents['agentringnoanswer'](_0x4364f7);}catch(_0x348eaa){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x1e'),_0x4364f7[_0xbf34('0x1d')]),_0x348eaa);}});ami['on'](_0xbf34('0x1f'),function(_0x31ad4d){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x20'),_0x31ad4d['uniqueid']),_0x31ad4d);agents[_0xbf34('0x1f')](_0x31ad4d);queues[_0xbf34('0x1f')](_0x31ad4d);}catch(_0x151d5a){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x20'),_0x31ad4d[_0xbf34('0x1d')]),_0x151d5a);}});ami['on'](_0xbf34('0x21'),function(_0x38e50a){try{utils['debug'](util['format']('[%s][index][agentcomplete]',_0x38e50a[_0xbf34('0x1d')]),_0x38e50a);agents[_0xbf34('0x21')](_0x38e50a);queues[_0xbf34('0x21')](_0x38e50a);members['agentcomplete'](_0x38e50a);}catch(_0x4a77b5){utils['error'](util['format'](_0xbf34('0x22'),_0x38e50a[_0xbf34('0x1d')]),_0x4a77b5);}});ami['on'](_0xbf34('0x23'),function(_0x412f94){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x24'),_0x412f94[_0xbf34('0x1d')]),_0x412f94);agents[_0xbf34('0x23')](_0x412f94);queues[_0xbf34('0x23')](_0x412f94);}catch(_0x456041){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x412f94['uniqueid']),_0x456041);}});ami['on']('queuecallerjoin',function(_0x1e1513){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][queuecallerjoin]',_0x1e1513[_0xbf34('0x1d')]),_0x1e1513);queues['queuecallerjoin'](_0x1e1513);recordings[_0xbf34('0x25')](_0x1e1513);}catch(_0x39fb46){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][queuecallerjoin]',_0x1e1513['uniqueid']),_0x39fb46);}});ami['on'](_0xbf34('0x26'),function(_0xdfd904){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x27'),_0xdfd904[_0xbf34('0x1d')]),_0xdfd904);queues['queuecallerleave'](_0xdfd904);}catch(_0x28dbde){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x27'),_0xdfd904['uniqueid']),_0x28dbde);}});ami['on']('musiconholdstart',function(_0x4f0c8d){try{utils['debug'](util[_0xbf34('0x19')]('[%s][index][musiconholdstart]',_0x4f0c8d['uniqueid']),_0x4f0c8d);queues[_0xbf34('0x28')](_0x4f0c8d);calls[_0xbf34('0x28')](_0x4f0c8d);}catch(_0xa8bed9){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x29'),_0x4f0c8d[_0xbf34('0x1d')]),_0xa8bed9);}});ami['on'](_0xbf34('0x2a'),function(_0x37777f){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x2b'),_0x37777f[_0xbf34('0x1d')]),_0x37777f);queues[_0xbf34('0x2a')](_0x37777f);calls[_0xbf34('0x2a')](_0x37777f);}catch(_0x8d4d49){utils['error'](util[_0xbf34('0x19')]('[%s][index][musiconholdstop]',_0x37777f[_0xbf34('0x1d')]),_0x8d4d49);}});ami['on']('newstate',function(_0x57d152){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][newstate]',_0x57d152[_0xbf34('0x1d')]),_0x57d152);calls[_0xbf34('0x2c')](_0x57d152);recordings['newstate'](_0x57d152);}catch(_0x4089fd){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x2d'),_0x57d152[_0xbf34('0x1d')]),_0x4089fd);}});ami['on']('hangup',function(_0x4cb3b6){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x2e'),_0x4cb3b6['uniqueid']),_0x4cb3b6);calls[_0xbf34('0x2f')](_0x4cb3b6);recordings[_0xbf34('0x2f')](_0x4cb3b6);dials[_0xbf34('0x2f')](_0x4cb3b6);agents[_0xbf34('0x2f')](_0x4cb3b6);queues[_0xbf34('0x2f')](_0x4cb3b6);}catch(_0x8d4b0b){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][hangup]',_0x4cb3b6[_0xbf34('0x1d')]),_0x8d4b0b);}});ami['on'](_0xbf34('0x30'),function(_0x22e446){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x31'),_0x22e446[_0xbf34('0x1d')]),_0x22e446);members['cdr'](_0x22e446);}catch(_0xa03fcc){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x31'),_0x22e446[_0xbf34('0x1d')]),_0xa03fcc);}});ami['on']('blindtransfer',function(_0x5dde73){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x32'),_0x5dde73['uniqueid']),_0x5dde73);queues['blindtransfer'](_0x5dde73);agents[_0xbf34('0x33')](_0x5dde73);transfers[_0xbf34('0x33')](_0x5dde73);}catch(_0x419351){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x32'),_0x5dde73[_0xbf34('0x1d')]),_0x419351);}});ami['on'](_0xbf34('0x34'),function(_0x4e287e){try{utils[_0xbf34('0x18')](util['format'](_0xbf34('0x35'),_0x4e287e['origtransfereruniqueid']),_0x4e287e);queues[_0xbf34('0x34')](_0x4e287e);transfers[_0xbf34('0x34')](_0x4e287e);agents[_0xbf34('0x34')](_0x4e287e);calls['attendedtransfer'](_0x4e287e);}catch(_0xb5052){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x35'),_0x4e287e[_0xbf34('0x36')]),_0xb5052);}});ami['on'](_0xbf34('0x37'),function(_0x8ca9a5){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x38'),_0x8ca9a5[_0xbf34('0x1d')]),_0x8ca9a5);queues['varset'](_0x8ca9a5);recordings[_0xbf34('0x37')](_0x8ca9a5);calls[_0xbf34('0x37')](_0x8ca9a5);dials['varset'](_0x8ca9a5);}catch(_0x5d349b){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x38'),_0x8ca9a5['uniqueid']),_0x5d349b);}});ami['on'](_0xbf34('0x39'),function(_0x4e99f4){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x3a'),_0x4e99f4[_0xbf34('0x1d')]),_0x4e99f4);calls[_0xbf34('0x39')](_0x4e99f4);recordings['newexten'](_0x4e99f4);dials[_0xbf34('0x39')](_0x4e99f4);}catch(_0x3da431){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x3a'),_0x4e99f4[_0xbf34('0x1d')]),_0x3da431);}});ami['on'](_0xbf34('0x3b'),function(_0x505acb){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x3c'),_0x505acb['uniqueid']),_0x505acb);calls['newchannel'](_0x505acb);recordings['newchannel'](_0x505acb);}catch(_0x295bf8){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x3c'),_0x505acb[_0xbf34('0x1d')]),_0x295bf8);}});ami['on']('dialbegin',function(_0x1d8d5b){try{utils['debug'](util['format'](_0xbf34('0x3d'),_0x1d8d5b[_0xbf34('0x1d')]),_0x1d8d5b);dials[_0xbf34('0x3e')](_0x1d8d5b);}catch(_0xdf97a1){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x3f'),_0x1d8d5b['uniqueid']),_0xdf97a1);}});ami['on'](_0xbf34('0x40'),function(_0xd33437){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x41'),_0xd33437['uniqueid']),_0xd33437);dials[_0xbf34('0x40')](_0xd33437);}catch(_0xa8d4c0){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x41'),_0xd33437['uniqueid']),_0xa8d4c0);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index f355730..253ba03 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 _0xc910=['data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','channel','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xc910,0x109));var _0x0c91=function(_0x4a2d85,_0x23755e){_0x4a2d85=_0x4a2d85-0x0;var _0x58a402=_0xc910[_0x4a2d85];return _0x58a402;};'use strict';var _=require(_0x0c91('0x0'));var util=require(_0x0c91('0x1'));var utils=require(_0x0c91('0x2'));var members={};var exclude=[_0x0c91('0x3'),_0x0c91('0x4')];function writeDB(_0xa2ef36){utils[_0x0c91('0x5')](util[_0x0c91('0x6')](_0x0c91('0x7'),_0xa2ef36[_0x0c91('0x8')],_0xa2ef36[_0x0c91('0x9')],_0xa2ef36['channel'],_0xa2ef36[_0x0c91('0xa')],_0xa2ef36[_0x0c91('0xb')],_0xa2ef36[_0x0c91('0xc')]));if(_0xa2ef36[_0x0c91('0x9')]){utils[_0x0c91('0xd')](_0xa2ef36['interface'])[_0x0c91('0xe')](function(_0x441e01){if(_0x441e01){_0xa2ef36[_0x0c91('0xb')]=_0x441e01[_0x0c91('0xf')];_0xa2ef36[_0x0c91('0x10')]=_0x441e01[_0x0c91('0x10')];utils[_0x0c91('0x11')](_0x0c91('0x12'),_0xa2ef36);}else{utils[_0x0c91('0x13')](_0xa2ef36['interface'][_0x0c91('0x14')]('/')[0x1])['then'](function(_0x4a91aa){if(_0x4a91aa){_0xa2ef36['membername']=_0x4a91aa[_0x0c91('0xf')];_0xa2ef36[_0x0c91('0x10')]=_0x4a91aa[_0x0c91('0x10')];utils['request']('CreateMemberReport',_0xa2ef36);}});}})[_0x0c91('0x15')](function(_0x1a56ee){utils[_0x0c91('0x16')](util[_0x0c91('0x6')](_0x0c91('0x17'),_0xa2ef36[_0x0c91('0x8')]),_0x1a56ee);});}delete members[_0xa2ef36[_0x0c91('0x9')]];}function startsWith(_0xcbff7b,_0x491aa6){return _[_0x0c91('0x18')](_0xcbff7b,function(_0x3184fc){return _['startsWith'](_0x491aa6,_0x3184fc);});}exports[_0x0c91('0x19')]=function(_0x4178d3){try{utils[_0x0c91('0x1a')](util[_0x0c91('0x6')](_0x0c91('0x1b'),members[_0x4178d3[_0x0c91('0x1c')]]?members[_0x4178d3['device']]['uniqueid']:_0x4178d3['device']),_0x4178d3);utils[_0x0c91('0x5')](util[_0x0c91('0x6')](_0x0c91('0x1d'),members[_0x4178d3[_0x0c91('0x1c')]]?members[_0x4178d3[_0x0c91('0x1c')]]['uniqueid']:_0x4178d3['device'],_0x4178d3[_0x0c91('0x1e')],_0x4178d3['device']));switch(_0x4178d3[_0x0c91('0x1e')]){case _0x0c91('0x1f'):case _0x0c91('0x20'):if(!startsWith(exclude,_0x4178d3[_0x0c91('0x1c')])){members[_0x4178d3[_0x0c91('0x1c')]]={'channel':_0x0c91('0x21'),'interface':_0x4178d3[_0x0c91('0x1c')],'type':_0x0c91('0x22'),'enterAt':utils[_0x0c91('0x23')](),'role':_0x0c91('0x24')};}break;case _0x0c91('0x25'):if(!_[_0x0c91('0x26')](members[_0x4178d3['device']])){members[_0x4178d3[_0x0c91('0x1c')]][_0x0c91('0x27')]=utils[_0x0c91('0x23')]();members[_0x4178d3[_0x0c91('0x1c')]][_0x0c91('0x28')]=utils[_0x0c91('0x29')](members[_0x4178d3[_0x0c91('0x1c')]][_0x0c91('0x27')],members[_0x4178d3[_0x0c91('0x1c')]][_0x0c91('0x2a')]);if(members[_0x4178d3[_0x0c91('0x1c')]]['uniqueid']){writeDB(members[_0x4178d3['device']]);}}break;default:break;}}catch(_0x48645b){utils[_0x0c91('0x16')](util[_0x0c91('0x6')](_0x0c91('0x1b'),members[_0x4178d3[_0x0c91('0x1c')]]?members[_0x4178d3[_0x0c91('0x1c')]][_0x0c91('0x8')]:_0x4178d3['device']),_0x48645b);}};exports[_0x0c91('0x2b')]=function(_0x11dbba){try{if(!_['isNil'](members[_0x11dbba[_0x0c91('0x9')]])){utils[_0x0c91('0x1a')](util[_0x0c91('0x6')]('[%s][members][agentcomplete]',_0x11dbba['uniqueid']),_0x11dbba);utils[_0x0c91('0x5')](util[_0x0c91('0x6')](_0x0c91('0x2c'),_0x11dbba[_0x0c91('0x8')],_0x11dbba[_0x0c91('0x9')],_0x11dbba[_0x0c91('0x2d')]));members[_0x11dbba[_0x0c91('0x9')]]=_[_0x0c91('0x2e')](members[_0x11dbba[_0x0c91('0x9')]],{'data4':_0x11dbba[_0x0c91('0x2d')],'uniqueid':_0x11dbba['uniqueid']});}}catch(_0x2aaac9){utils[_0x0c91('0x16')](util[_0x0c91('0x6')](_0x0c91('0x2f'),_0x11dbba['uniqueid']),_0x2aaac9);}};exports['cdr']=function(_0x4ae2bd){try{utils[_0x0c91('0x1a')](util[_0x0c91('0x6')]('[%s][members][cdr]',_0x4ae2bd[_0x0c91('0x8')]),_0x4ae2bd);if(_0x4ae2bd[_0x0c91('0x30')]){var _0x156186=_0x4ae2bd['channel'][_0x0c91('0x14')]('-')[0x0];if(!_[_0x0c91('0x26')](members[_0x156186])){members[_0x156186]=_[_0x0c91('0x2e')](members[_0x156186],{'data1':members[_0x156186][_0x0c91('0x31')]||_0x4ae2bd[_0x0c91('0xc')],'data2':members[_0x156186]['data2']||_0x4ae2bd['source'],'data3':members[_0x156186][_0x0c91('0x32')]||_0x4ae2bd[_0x0c91('0x33')],'uniqueid':members[_0x156186][_0x0c91('0x8')]||_0x4ae2bd[_0x0c91('0x8')]});utils['info'](util[_0x0c91('0x6')](_0x0c91('0x34'),_0x4ae2bd[_0x0c91('0x8')],members[_0x156186][_0x0c91('0x31')],members[_0x156186][_0x0c91('0xa')],members[_0x156186][_0x0c91('0x32')]));if(members[_0x156186][_0x0c91('0x27')]){writeDB(members[_0x156186]);}}}if(_0x4ae2bd[_0x0c91('0x35')]){var _0x21fb0f=_0x4ae2bd[_0x0c91('0x35')][_0x0c91('0x14')]('-')[0x0];if(!_[_0x0c91('0x26')](members[_0x21fb0f])){members[_0x21fb0f]=_[_0x0c91('0x2e')](members[_0x21fb0f],{'data1':members[_0x21fb0f]['data1']||_0x4ae2bd[_0x0c91('0xc')],'data2':members[_0x21fb0f]['data2']||_0x4ae2bd[_0x0c91('0x36')],'data3':members[_0x21fb0f]['data3']||_0x4ae2bd[_0x0c91('0x33')],'uniqueid':members[_0x21fb0f][_0x0c91('0x8')]||_0x4ae2bd[_0x0c91('0x8')]});utils['info'](util[_0x0c91('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4ae2bd[_0x0c91('0x8')],members[_0x21fb0f][_0x0c91('0x31')],members[_0x21fb0f][_0x0c91('0xa')],members[_0x21fb0f][_0x0c91('0x32')]));if(members[_0x21fb0f][_0x0c91('0x27')]){writeDB(members[_0x21fb0f]);}}}}catch(_0x460813){utils[_0x0c91('0x16')](util[_0x0c91('0x6')]('[%s][members][cdr]',_0x4ae2bd[_0x0c91('0x8')]),_0x460813);}}; \ No newline at end of file +var _0x435a=['state','INUSE','BUSY','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','channel','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','then','name','internal','request','CreateMemberReport','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','info'];(function(_0x55fac4,_0x25d6d9){var _0x5e13a9=function(_0x1d9cc5){while(--_0x1d9cc5){_0x55fac4['push'](_0x55fac4['shift']());}};_0x5e13a9(++_0x25d6d9);}(_0x435a,0x181));var _0xa435=function(_0xb51ff2,_0x1b6283){_0xb51ff2=_0xb51ff2-0x0;var _0x565ad7=_0x435a[_0xb51ff2];return _0x565ad7;};'use strict';var _=require(_0xa435('0x0'));var util=require(_0xa435('0x1'));var utils=require(_0xa435('0x2'));var members={};var exclude=[_0xa435('0x3'),'Queue:'];function writeDB(_0x5c211b){utils['info'](util[_0xa435('0x4')](_0xa435('0x5'),_0x5c211b[_0xa435('0x6')],_0x5c211b[_0xa435('0x7')],_0x5c211b['channel'],_0x5c211b['data2'],_0x5c211b[_0xa435('0x8')],_0x5c211b[_0xa435('0x9')]));if(_0x5c211b[_0xa435('0x7')]){utils['getUserByInterface'](_0x5c211b[_0xa435('0x7')])[_0xa435('0xa')](function(_0x1d881d){if(_0x1d881d){_0x5c211b[_0xa435('0x8')]=_0x1d881d[_0xa435('0xb')];_0x5c211b[_0xa435('0xc')]=_0x1d881d[_0xa435('0xc')];utils[_0xa435('0xd')](_0xa435('0xe'),_0x5c211b);}else{utils['getUserByName'](_0x5c211b[_0xa435('0x7')][_0xa435('0xf')]('/')[0x1])[_0xa435('0xa')](function(_0x37bf82){if(_0x37bf82){_0x5c211b[_0xa435('0x8')]=_0x37bf82[_0xa435('0xb')];_0x5c211b[_0xa435('0xc')]=_0x37bf82[_0xa435('0xc')];utils[_0xa435('0xd')](_0xa435('0xe'),_0x5c211b);}});}})['catch'](function(_0x33639d){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x11'),_0x5c211b['uniqueid']),_0x33639d);});}delete members[_0x5c211b[_0xa435('0x7')]];}function startsWith(_0x1b75f5,_0x437b6f){return _[_0xa435('0x12')](_0x1b75f5,function(_0x56c2df){return _[_0xa435('0x13')](_0x437b6f,_0x56c2df);});}exports[_0xa435('0x14')]=function(_0x4f2743){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743[_0xa435('0x15')]][_0xa435('0x6')]:_0x4f2743['device']),_0x4f2743);utils[_0xa435('0x16')](util[_0xa435('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743['device']][_0xa435('0x6')]:_0x4f2743[_0xa435('0x15')],_0x4f2743[_0xa435('0x17')],_0x4f2743[_0xa435('0x15')]));switch(_0x4f2743[_0xa435('0x17')]){case _0xa435('0x18'):case _0xa435('0x19'):if(!startsWith(exclude,_0x4f2743['device'])){members[_0x4f2743[_0xa435('0x15')]]={'channel':'voice','interface':_0x4f2743[_0xa435('0x15')],'type':'TALKING','enterAt':utils[_0xa435('0x1a')](),'role':_0xa435('0x1b')};}break;case _0xa435('0x1c'):if(!_[_0xa435('0x1d')](members[_0x4f2743[_0xa435('0x15')]])){members[_0x4f2743[_0xa435('0x15')]][_0xa435('0x1e')]=utils[_0xa435('0x1a')]();members[_0x4f2743['device']][_0xa435('0x1f')]=utils[_0xa435('0x20')](members[_0x4f2743['device']][_0xa435('0x1e')],members[_0x4f2743['device']][_0xa435('0x21')]);if(members[_0x4f2743['device']][_0xa435('0x6')]){writeDB(members[_0x4f2743[_0xa435('0x15')]]);}}break;default:break;}}catch(_0x11a50f){utils[_0xa435('0x10')](util['format'](_0xa435('0x22'),members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743['device']][_0xa435('0x6')]:_0x4f2743[_0xa435('0x15')]),_0x11a50f);}};exports[_0xa435('0x23')]=function(_0x3255de){try{if(!_[_0xa435('0x1d')](members[_0x3255de[_0xa435('0x7')]])){utils[_0xa435('0x24')](util['format'](_0xa435('0x25'),_0x3255de[_0xa435('0x6')]),_0x3255de);utils[_0xa435('0x16')](util[_0xa435('0x4')](_0xa435('0x26'),_0x3255de[_0xa435('0x6')],_0x3255de[_0xa435('0x7')],_0x3255de[_0xa435('0x27')]));members[_0x3255de[_0xa435('0x7')]]=_['assign'](members[_0x3255de[_0xa435('0x7')]],{'data4':_0x3255de[_0xa435('0x27')],'uniqueid':_0x3255de[_0xa435('0x6')]});}}catch(_0x547aaf){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x25'),_0x3255de['uniqueid']),_0x547aaf);}};exports[_0xa435('0x28')]=function(_0x47eea5){try{utils[_0xa435('0x24')](util[_0xa435('0x4')]('[%s][members][cdr]',_0x47eea5[_0xa435('0x6')]),_0x47eea5);if(_0x47eea5[_0xa435('0x29')]){var _0x5c8334=_0x47eea5['channel'][_0xa435('0xf')]('-')[0x0];if(!_[_0xa435('0x1d')](members[_0x5c8334])){members[_0x5c8334]=_['assign'](members[_0x5c8334],{'data1':members[_0x5c8334][_0xa435('0x2a')]||_0x47eea5[_0xa435('0x9')],'data2':members[_0x5c8334][_0xa435('0x2b')]||_0x47eea5[_0xa435('0x2c')],'data3':members[_0x5c8334][_0xa435('0x2d')]||_0x47eea5[_0xa435('0x2e')],'uniqueid':members[_0x5c8334][_0xa435('0x6')]||_0x47eea5['uniqueid']});utils[_0xa435('0x16')](util['format'](_0xa435('0x2f'),_0x47eea5[_0xa435('0x6')],members[_0x5c8334]['data1'],members[_0x5c8334][_0xa435('0x2b')],members[_0x5c8334]['data3']));if(members[_0x5c8334]['exitAt']){writeDB(members[_0x5c8334]);}}}if(_0x47eea5[_0xa435('0x30')]){var _0x57e25a=_0x47eea5[_0xa435('0x30')][_0xa435('0xf')]('-')[0x0];if(!_[_0xa435('0x1d')](members[_0x57e25a])){members[_0x57e25a]=_[_0xa435('0x31')](members[_0x57e25a],{'data1':members[_0x57e25a][_0xa435('0x2a')]||_0x47eea5['type'],'data2':members[_0x57e25a]['data2']||_0x47eea5[_0xa435('0x2c')],'data3':members[_0x57e25a]['data3']||_0x47eea5[_0xa435('0x2e')],'uniqueid':members[_0x57e25a]['uniqueid']||_0x47eea5[_0xa435('0x6')]});utils[_0xa435('0x16')](util[_0xa435('0x4')](_0xa435('0x2f'),_0x47eea5[_0xa435('0x6')],members[_0x57e25a]['data1'],members[_0x57e25a][_0xa435('0x2b')],members[_0x57e25a][_0xa435('0x2d')]));if(members[_0x57e25a][_0xa435('0x1e')]){writeDB(members[_0x57e25a]);}}}}catch(_0x281413){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x32'),_0x47eea5[_0xa435('0x6')]),_0x281413);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 30e6374..32dc8f7 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 _0xdf6f=['COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','info','format','uniqueid','channel','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','transfer'];(function(_0x26f8d5,_0x4688e0){var _0x2afdae=function(_0x28fd8c){while(--_0x28fd8c){_0x26f8d5['push'](_0x26f8d5['shift']());}};_0x2afdae(++_0x4688e0);}(_0xdf6f,0xf2));var _0xfdf6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdf6f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfdf6('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x380872){utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x380872[_0xfdf6('0x3')],_0x380872[_0xfdf6('0x4')],_0x380872[_0xfdf6('0x5')],_0x380872['lastAssignedTo'],_0x380872['calleridnum'],_0x380872[_0xfdf6('0x6')],_0x380872[_0xfdf6('0x7')]));if(_0x380872[_0xfdf6('0x5')]){utils[_0xfdf6('0x8')](_0x380872[_0xfdf6('0x5')])[_0xfdf6('0x9')](function(_0x50c359){if(_0x50c359){_0x380872['type']=_0x50c359[_0xfdf6('0xa')];}utils[_0xfdf6('0xb')]('CreateVoiceQueueReport',_0x380872);});}else{utils[_0xfdf6('0xb')](_0xfdf6('0xc'),_0x380872);}if(_0x380872[_0xfdf6('0xd')]){delete queues[_0x380872[_0xfdf6('0xd')]];}else{delete queues[_0x380872[_0xfdf6('0x3')]];}}exports['queuecallerjoin']=function(_0x331734){try{utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')]('[%s][queues][queuecallerjoin]',_0x331734[_0xfdf6('0x3')]),_0x331734);utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0xf'),_0x331734['uniqueid'],_0x331734['queue'],_0x331734[_0xfdf6('0x10')]));queues[_0x331734['uniqueid']]=_['assign'](_0x331734,{'originalposition':_0x331734[_0xfdf6('0x10')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x474af9){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')](_0xfdf6('0x12'),_0x331734['uniqueid']),_0x474af9);}};exports[_0xfdf6('0x13')]=function(_0x32bd00){try{if(!_['isNil'](queues[_0x32bd00[_0xfdf6('0x3')]])){utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')](_0xfdf6('0x14'),_0x32bd00['uniqueid']),_0x32bd00);if(queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0x15')]){if(!queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0x16')]&&!queues[_0x32bd00[_0xfdf6('0x3')]]['queuecallerexit']){queues[_0x32bd00['uniqueid']][_0xfdf6('0x17')]=!![];queues[_0x32bd00['uniqueid']][_0xfdf6('0x18')]=utils[_0xfdf6('0x19')]();queues[_0x32bd00[_0xfdf6('0x3')]]['queuecallerexitreason']=_0xfdf6('0x1a');}utils['info'](util[_0xfdf6('0x2')](_0xfdf6('0x1b'),_0x32bd00[_0xfdf6('0x3')],queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0x1c')],queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0x7')]));writeDB(queues[_0x32bd00[_0xfdf6('0x3')]]);}else if(queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0xd')]){utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x32bd00[_0xfdf6('0x3')],queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0x1c')],queues[_0x32bd00['uniqueid']][_0xfdf6('0xd')]));queues[queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0xd')]]=queues[_0x32bd00[_0xfdf6('0x3')]];queues[queues[_0x32bd00[_0xfdf6('0x3')]][_0xfdf6('0xd')]][_0xfdf6('0x1d')]=0x2;delete queues[_0x32bd00[_0xfdf6('0x3')]];}}}catch(_0x544d6a){utils['error'](util[_0xfdf6('0x2')](_0xfdf6('0x14'),_0x32bd00[_0xfdf6('0x3')]),_0x544d6a);}};exports[_0xfdf6('0x1e')]=function(_0x46b8e4){try{utils['debug'](util[_0xfdf6('0x2')](_0xfdf6('0x1f'),_0x46b8e4[_0xfdf6('0x3')]),_0x46b8e4);if(!_[_0xfdf6('0x20')](_0x46b8e4[_0xfdf6('0x21')][_0xfdf6('0x22')])&&_0x46b8e4[_0xfdf6('0x23')][_0xfdf6('0x24')]()!==_0xfdf6('0x25')){if(!_[_0xfdf6('0x20')](queues[_0x46b8e4['uniqueid']])){queues[_0x46b8e4[_0xfdf6('0x3')]]['queuecallerabandon']=![];queues[_0x46b8e4[_0xfdf6('0x3')]]['queuecallerabandonAt']=null;queues[_0x46b8e4['uniqueid']]['queuecallerexit']=!![];queues[_0x46b8e4[_0xfdf6('0x3')]]['queuecallerexitAt']=utils['now']();queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x7')]=_0x46b8e4['value'][_0xfdf6('0x24')]();utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x26'),_0x46b8e4[_0xfdf6('0x3')],queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x1c')],_0x46b8e4[_0xfdf6('0x23')],queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x7')]));writeDB(queues[_0x46b8e4[_0xfdf6('0x3')]]);}}else if(!_['isNil'](_0x46b8e4['variable'][_0xfdf6('0x27')])){if(!_[_0xfdf6('0x20')](queues[_0x46b8e4[_0xfdf6('0x3')]])&&!queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x16')]){queues[_0x46b8e4['uniqueid']][_0xfdf6('0x16')]=![];queues[_0x46b8e4['uniqueid']][_0xfdf6('0x28')]=null;queues[_0x46b8e4['uniqueid']][_0xfdf6('0x29')]=!![];queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x2a')]=utils[_0xfdf6('0x19')]();queues[_0x46b8e4['uniqueid']][_0xfdf6('0x7')]=_0xfdf6('0x2b');utils[_0xfdf6('0x1')](util['format'](_0xfdf6('0x2c'),_0x46b8e4[_0xfdf6('0x3')],queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x1c')],_0x46b8e4['value'],queues[_0x46b8e4[_0xfdf6('0x3')]][_0xfdf6('0x7')]));}}}catch(_0x500c44){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')]('[%s][queues][varset]',_0x46b8e4[_0xfdf6('0x3')]),_0x500c44);}};exports[_0xfdf6('0x16')]=function(_0x87556c){try{if(!_[_0xfdf6('0x20')](queues[_0x87556c['uniqueid']])){utils['debug'](util[_0xfdf6('0x2')](_0xfdf6('0x2d'),_0x87556c[_0xfdf6('0x3')]),_0x87556c);queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x29')]=![];queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x2a')]=null;queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x16')]=!![];queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x28')]=utils[_0xfdf6('0x19')]();queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x7')]='ABANDONED';utils[_0xfdf6('0x1')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x87556c[_0xfdf6('0x3')],queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x1c')],queues[_0x87556c[_0xfdf6('0x3')]][_0xfdf6('0x7')]));}}catch(_0x1a278e){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')](_0xfdf6('0x2d'),_0x87556c['uniqueid']),_0x1a278e);}};exports[_0xfdf6('0x2e')]=function(_0x46f367){try{if(!_[_0xfdf6('0x20')](queues[_0x46f367[_0xfdf6('0x3')]])){utils[_0xfdf6('0xe')](util['format'](_0xfdf6('0x2f'),_0x46f367['uniqueid']),_0x46f367);utils['info'](util[_0xfdf6('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x46f367[_0xfdf6('0x3')],queues[_0x46f367[_0xfdf6('0x3')]]['name'],_0x46f367['connectedlinenum'],_0x46f367[_0xfdf6('0x30')]));queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x2e')]=!![];queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x15')]=utils['now']();queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x31')]=utils[_0xfdf6('0x32')](queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x15')],queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x33')]);queues[_0x46f367[_0xfdf6('0x3')]]['position']=_0x46f367[_0xfdf6('0x10')];queues[_0x46f367['uniqueid']][_0xfdf6('0x34')]=_0x46f367['count'];queues[_0x46f367[_0xfdf6('0x3')]]['connectedlinenum']=_0x46f367['connectedlinenum'];queues[_0x46f367[_0xfdf6('0x3')]][_0xfdf6('0x30')]=_0x46f367[_0xfdf6('0x30')];}}catch(_0x1f75a5){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')]('[%s][queues][queuecallerleave]',_0x46f367[_0xfdf6('0x3')]),_0x1f75a5);}};exports[_0xfdf6('0x35')]=function(_0x3ce45f){try{if(!_[_0xfdf6('0x20')](queues[_0x3ce45f[_0xfdf6('0x3')]])){utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')](_0xfdf6('0x36'),_0x3ce45f[_0xfdf6('0x3')]),_0x3ce45f);utils[_0xfdf6('0x1')](util['format'](_0xfdf6('0x37'),_0x3ce45f['uniqueid'],queues[_0x3ce45f[_0xfdf6('0x3')]]['name'],_0x3ce45f[_0xfdf6('0x38')],_0x3ce45f[_0xfdf6('0x39')]));queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x16')]=![];queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x16')]=![];queues[_0x3ce45f['uniqueid']][_0xfdf6('0x28')]=null;queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x29')]=![];queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x7')]=null;queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x2a')]=null;queues[_0x3ce45f['uniqueid']][_0xfdf6('0x3a')]=!![];queues[_0x3ce45f[_0xfdf6('0x3')]][_0xfdf6('0x6')]=_0x3ce45f[_0xfdf6('0x39')];queues[_0x3ce45f['uniqueid']][_0xfdf6('0x3b')]=_0x3ce45f[_0xfdf6('0x38')];}}catch(_0x8581f0){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')](_0xfdf6('0x36'),_0x3ce45f[_0xfdf6('0x3')]),_0x8581f0);}};exports['agentcomplete']=function(_0x414be2){try{if(!_['isNil'](queues[_0x414be2[_0xfdf6('0x3')]])){if(queues[_0x414be2['uniqueid']][_0xfdf6('0x15')]){utils['debug'](util[_0xfdf6('0x2')]('[%s][queues][agentcomplete]',_0x414be2[_0xfdf6('0x3')]),_0x414be2);queues[_0x414be2[_0xfdf6('0x3')]]['queuecallerabandon']=![];queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x16')]=![];queues[_0x414be2[_0xfdf6('0x3')]]['queuecallerabandonAt']=null;queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x29')]=![];queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x2a')]=null;queues[_0x414be2['uniqueid']][_0xfdf6('0x3a')]=!![];queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x3b')]=_0x414be2['membername'];queues[_0x414be2[_0xfdf6('0x3')]]['queuecallercomplete']=!![];queues[_0x414be2[_0xfdf6('0x3')]]['queuecallercompleteAt']=utils[_0xfdf6('0x19')]();if(_0x414be2['reason']==_0xfdf6('0x3c')){if(!queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x3c')]){queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x7')]='TRANSFER';}}else{queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x7')]=_0xfdf6('0x3d')+_0x414be2[_0xfdf6('0x3e')]['toUpperCase']();}utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x3f'),_0x414be2[_0xfdf6('0x3')],queues[_0x414be2['uniqueid']]['name'],_0x414be2['membername'],queues[_0x414be2[_0xfdf6('0x3')]][_0xfdf6('0x7')]));writeDB(queues[_0x414be2[_0xfdf6('0x3')]]);}}}catch(_0x2e0b95){utils[_0xfdf6('0x11')](util['format'](_0xfdf6('0x40'),_0x414be2['uniqueid']),_0x2e0b95);}};exports['blindtransfer']=function(_0x225e66){try{if(!_[_0xfdf6('0x20')](queues[_0x225e66[_0xfdf6('0x41')]])){utils['debug'](util['format'](_0xfdf6('0x42'),_0x225e66[_0xfdf6('0x3')]),_0x225e66);queues[_0x225e66['transfereeuniqueid']][_0xfdf6('0x3c')]=!![];queues[_0x225e66[_0xfdf6('0x41')]]['transfertype']=_0xfdf6('0x43');queues[_0x225e66[_0xfdf6('0x41')]][_0xfdf6('0x44')]=_0x225e66[_0xfdf6('0x45')];queues[_0x225e66['transfereeuniqueid']][_0xfdf6('0x46')]=_0x225e66[_0xfdf6('0x41')];queues[_0x225e66[_0xfdf6('0x41')]][_0xfdf6('0x7')]=_0xfdf6('0x47');utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x48'),_0x225e66[_0xfdf6('0x3')],queues[_0x225e66[_0xfdf6('0x41')]]['name'],_0x225e66[_0xfdf6('0x41')],_0x225e66[_0xfdf6('0x45')]));}}catch(_0x4298ac){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')](_0xfdf6('0x42'),_0x225e66[_0xfdf6('0x3')]),_0x4298ac);}};exports['attendedtransfer']=function(_0x4b833d){try{utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')](_0xfdf6('0x49'),_0x4b833d[_0xfdf6('0x4a')]),_0x4b833d);if(_0x4b833d[_0xfdf6('0x4a')]==_0x4b833d[_0xfdf6('0x4b')]){if(!_[_0xfdf6('0x20')](queues[_0x4b833d[_0xfdf6('0x4c')]])){utils['info'](util['format'](_0xfdf6('0x4d'),_0x4b833d['origtransfereruniqueid'],queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x1c')],_0x4b833d[_0xfdf6('0x4e')]));queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x3c')]=!![];queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x4f')]=_0xfdf6('0x50');queues[_0x4b833d[_0xfdf6('0x4c')]]['transferexten']=_0x4b833d[_0xfdf6('0x4e')];queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x46')]=_0x4b833d[_0xfdf6('0x4a')];queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x7')]=_0xfdf6('0x51');}if(!_[_0xfdf6('0x20')](queues[_0x4b833d['origtransfererlinkedid']])){if(_0x4b833d['transfereelinkedid']&&queues[_0x4b833d[_0xfdf6('0x52')]]){queues[_0x4b833d[_0xfdf6('0x52')]][_0xfdf6('0x1d')]=0x1;queues[_0x4b833d[_0xfdf6('0x41')]]=_[_0xfdf6('0x53')](queues[_0x4b833d[_0xfdf6('0x52')]]);queues[_0x4b833d['transfereeuniqueid']]['transfereduniqueid']=_0x4b833d['transfertargetuniqueid'];queues[_0x4b833d['transfereeuniqueid']][_0xfdf6('0x1d')]=0x2;queues[_0x4b833d[_0xfdf6('0x41')]][_0xfdf6('0x54')]=queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x54')];queues[_0x4b833d[_0xfdf6('0x41')]][_0xfdf6('0x55')]=queues[_0x4b833d[_0xfdf6('0x4c')]][_0xfdf6('0x55')];queues[_0x4b833d['transfereeuniqueid']][_0xfdf6('0x33')]=utils[_0xfdf6('0x19')]();queues[_0x4b833d[_0xfdf6('0x41')]]['queuecallerleaveAt']=utils[_0xfdf6('0x19')]();queues[_0x4b833d['transfereeuniqueid']][_0xfdf6('0x31')]=0x0;queues[_0x4b833d[_0xfdf6('0x41')]][_0xfdf6('0x56')]=0x0;utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x57'),_0x4b833d['origtransfereruniqueid'],queues[_0x4b833d[_0xfdf6('0x41')]][_0xfdf6('0x1c')],queues[_0x4b833d['transfereeuniqueid']][_0xfdf6('0x54')],queues[_0x4b833d[_0xfdf6('0x41')]][_0xfdf6('0x55')]));}else{utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x58'),_0x4b833d[_0xfdf6('0x4a')],queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x1c')],_0x4b833d[_0xfdf6('0x4c')]));queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0xd')]=_0x4b833d[_0xfdf6('0x4c')];}}}else if(_0x4b833d['secondtransfereruniqueid']==_0x4b833d['secondtransfererlinkedid']){if(!_[_0xfdf6('0x20')](queues[_0x4b833d[_0xfdf6('0x4b')]])){utils[_0xfdf6('0x1')](util['format'](_0xfdf6('0x59'),_0x4b833d[_0xfdf6('0x4a')],queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x1c')],_0x4b833d[_0xfdf6('0x5a')],_0x4b833d[_0xfdf6('0x5b')]));queues[_0x4b833d['origtransfererlinkedid']]['transfer']=!![];queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x4f')]=_0xfdf6('0x50');queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x44')]=_0x4b833d['secondtransfererexten'];queues[_0x4b833d['origtransfererlinkedid']][_0xfdf6('0x46')]=_0x4b833d[_0xfdf6('0x5a')];queues[_0x4b833d[_0xfdf6('0x4b')]]['queuecallerexitreason']=_0xfdf6('0x51');}if(!_[_0xfdf6('0x20')](queues[_0x4b833d[_0xfdf6('0x4c')]])){if(_0x4b833d['transfertargetlinkedid']&&queues[_0x4b833d[_0xfdf6('0x5c')]]){queues[_0x4b833d[_0xfdf6('0x5c')]][_0xfdf6('0x1d')]=0x1;queues[_0x4b833d['transfertargetuniqueid']]=_[_0xfdf6('0x53')](queues[_0x4b833d[_0xfdf6('0x5c')]]);queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0xd')]=_0x4b833d[_0xfdf6('0x5d')];queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0x1d')]=0x2;queues[_0x4b833d[_0xfdf6('0x5d')]]['calleridnum']=queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x54')];queues[_0x4b833d[_0xfdf6('0x5d')]]['calleridname']=queues[_0x4b833d[_0xfdf6('0x4b')]][_0xfdf6('0x55')];queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0x33')]=utils[_0xfdf6('0x19')]();queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0x15')]=utils[_0xfdf6('0x19')]();queues[_0x4b833d[_0xfdf6('0x5d')]]['holdtime']=0x0;queues[_0x4b833d['transfertargetuniqueid']]['mohtime']=0x0;utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x5e'),_0x4b833d['origtransfereruniqueid'],queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0x1c')],queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0xd')],queues[_0x4b833d[_0xfdf6('0x5d')]][_0xfdf6('0x54')],queues[_0x4b833d['transfertargetuniqueid']][_0xfdf6('0x55')]));}else{utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x58'),_0x4b833d['origtransfereruniqueid'],queues[_0x4b833d[_0xfdf6('0x4c')]]['name'],_0x4b833d[_0xfdf6('0x4b')]));queues[_0x4b833d['secondtransfererlinkedid']][_0xfdf6('0xd')]=_0x4b833d[_0xfdf6('0x4b')];}}}}catch(_0x21973d){utils[_0xfdf6('0x11')](util[_0xfdf6('0x2')](_0xfdf6('0x49'),_0x4b833d[_0xfdf6('0x4a')]),_0x21973d);}};exports['musiconholdstart']=function(_0x115808){try{if(!_['isNil'](queues[_0x115808[_0xfdf6('0x3')]])){utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')]('[%s][queues][musiconholdstart]',_0x115808[_0xfdf6('0x3')]),_0x115808);queues[_0x115808[_0xfdf6('0x3')]][_0xfdf6('0x5f')]=utils[_0xfdf6('0x19')]();utils[_0xfdf6('0x1')](util['format'](_0xfdf6('0x60'),_0x115808[_0xfdf6('0x3')],queues[_0x115808[_0xfdf6('0x3')]][_0xfdf6('0x1c')],queues[_0x115808[_0xfdf6('0x3')]]['musiconholdstartAt']));}}catch(_0x8d3875){utils[_0xfdf6('0x11')](util['format'](_0xfdf6('0x61'),_0x115808[_0xfdf6('0x3')]),_0x8d3875);}};exports[_0xfdf6('0x62')]=function(_0x5004fd){try{if(!_[_0xfdf6('0x20')](queues[_0x5004fd[_0xfdf6('0x3')]])){if(!_[_0xfdf6('0x20')](queues[_0x5004fd[_0xfdf6('0x3')]][_0xfdf6('0x5f')])){utils[_0xfdf6('0xe')](util[_0xfdf6('0x2')](_0xfdf6('0x63'),_0x5004fd[_0xfdf6('0x3')]),_0x5004fd);queues[_0x5004fd[_0xfdf6('0x3')]][_0xfdf6('0x56')]+=utils[_0xfdf6('0x32')](utils[_0xfdf6('0x19')](),queues[_0x5004fd[_0xfdf6('0x3')]][_0xfdf6('0x5f')]);utils[_0xfdf6('0x1')](util[_0xfdf6('0x2')](_0xfdf6('0x64'),_0x5004fd['uniqueid'],queues[_0x5004fd[_0xfdf6('0x3')]][_0xfdf6('0x1c')],queues[_0x5004fd['uniqueid']][_0xfdf6('0x56')]));delete queues[_0x5004fd['uniqueid']]['musiconholdstartAt'];}}}catch(_0x25f990){utils[_0xfdf6('0x11')](util['format'](_0xfdf6('0x63'),_0x5004fd[_0xfdf6('0x3')]),_0x25f990);}}; \ No newline at end of file +var _0x7a78=['[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%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]','util','./utils','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x7a78,0x1da));var _0x87a7=function(_0x45016e,_0x9517fb){_0x45016e=_0x45016e-0x0;var _0x260948=_0x7a78[_0x45016e];return _0x260948;};'use strict';var _=require('lodash');var util=require(_0x87a7('0x0'));var utils=require(_0x87a7('0x1'));var queues={};function writeDB(_0x4fa3d7){utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4fa3d7[_0x87a7('0x4')],_0x4fa3d7['channel'],_0x4fa3d7['queue'],_0x4fa3d7[_0x87a7('0x5')],_0x4fa3d7[_0x87a7('0x6')],_0x4fa3d7[_0x87a7('0x7')],_0x4fa3d7[_0x87a7('0x8')]));if(_0x4fa3d7['queue']){utils[_0x87a7('0x9')](_0x4fa3d7[_0x87a7('0xa')])[_0x87a7('0xb')](function(_0x3a243a){if(_0x3a243a){_0x4fa3d7[_0x87a7('0xc')]=_0x3a243a[_0x87a7('0xc')];}utils[_0x87a7('0xd')](_0x87a7('0xe'),_0x4fa3d7);});}else{utils[_0x87a7('0xd')]('CreateVoiceQueueReport',_0x4fa3d7);}if(_0x4fa3d7[_0x87a7('0xf')]){delete queues[_0x4fa3d7['transfereduniqueid']];}else{delete queues[_0x4fa3d7[_0x87a7('0x4')]];}}exports['queuecallerjoin']=function(_0x2246a8){try{utils[_0x87a7('0x10')](util[_0x87a7('0x3')]('[%s][queues][queuecallerjoin]',_0x2246a8['uniqueid']),_0x2246a8);utils[_0x87a7('0x2')](util['format'](_0x87a7('0x11'),_0x2246a8[_0x87a7('0x4')],_0x2246a8[_0x87a7('0xa')],_0x2246a8['position']));queues[_0x2246a8['uniqueid']]=_[_0x87a7('0x12')](_0x2246a8,{'originalposition':_0x2246a8[_0x87a7('0x13')],'queuecallerjoinAt':utils[_0x87a7('0x14')](),'mohtime':0x0});}catch(_0x503b08){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x16'),_0x2246a8[_0x87a7('0x4')]),_0x503b08);}};exports[_0x87a7('0x17')]=function(_0x4f6205){try{if(!_[_0x87a7('0x18')](queues[_0x4f6205[_0x87a7('0x4')]])){utils['debug'](util[_0x87a7('0x3')](_0x87a7('0x19'),_0x4f6205[_0x87a7('0x4')]),_0x4f6205);if(queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x1a')]){if(!queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x1b')]&&!queues[_0x4f6205['uniqueid']][_0x87a7('0x1c')]){queues[_0x4f6205['uniqueid']][_0x87a7('0x1d')]=!![];queues[_0x4f6205['uniqueid']]['queuecallercompleteAt']=utils[_0x87a7('0x14')]();queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x87a7('0x1e');}utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x1f'),_0x4f6205[_0x87a7('0x4')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x4f6205[_0x87a7('0x4')]]);}else if(queues[_0x4f6205['uniqueid']][_0x87a7('0xf')]){utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x21'),_0x4f6205[_0x87a7('0x4')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0xf')]));queues[queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0xf')]]=queues[_0x4f6205[_0x87a7('0x4')]];queues[queues[_0x4f6205[_0x87a7('0x4')]]['transfereduniqueid']][_0x87a7('0x22')]=0x2;delete queues[_0x4f6205[_0x87a7('0x4')]];}}}catch(_0x214946){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][hangup]',_0x4f6205[_0x87a7('0x4')]),_0x214946);}};exports[_0x87a7('0x23')]=function(_0x4d01d1){try{utils[_0x87a7('0x10')](util['format'](_0x87a7('0x24'),_0x4d01d1['uniqueid']),_0x4d01d1);if(!_[_0x87a7('0x18')](_0x4d01d1[_0x87a7('0x25')][_0x87a7('0x26')])&&_0x4d01d1[_0x87a7('0x27')]['toUpperCase']()!==_0x87a7('0x28')){if(!_[_0x87a7('0x18')](queues[_0x4d01d1[_0x87a7('0x4')]])){queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x4d01d1['uniqueid']][_0x87a7('0x29')]=null;queues[_0x4d01d1['uniqueid']][_0x87a7('0x1c')]=!![];queues[_0x4d01d1['uniqueid']][_0x87a7('0x2a')]=utils[_0x87a7('0x14')]();queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x4d01d1[_0x87a7('0x27')][_0x87a7('0x2b')]();utils['info'](util[_0x87a7('0x3')](_0x87a7('0x2c'),_0x4d01d1[_0x87a7('0x4')],queues[_0x4d01d1[_0x87a7('0x4')]]['name'],_0x4d01d1[_0x87a7('0x27')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x4d01d1[_0x87a7('0x4')]]);}}else if(!_[_0x87a7('0x18')](_0x4d01d1[_0x87a7('0x25')][_0x87a7('0x2d')])){if(!_['isNil'](queues[_0x4d01d1['uniqueid']])&&!queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]){queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1c')]=!![];queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x2a')]=utils[_0x87a7('0x14')]();queues[_0x4d01d1[_0x87a7('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x87a7('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4d01d1[_0x87a7('0x4')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x20')],_0x4d01d1[_0x87a7('0x27')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]));}}}catch(_0x59276e){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x24'),_0x4d01d1['uniqueid']),_0x59276e);}};exports['queuecallerabandon']=function(_0x2b7a90){try{if(!_[_0x87a7('0x18')](queues[_0x2b7a90['uniqueid']])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x2e'),_0x2b7a90[_0x87a7('0x4')]),_0x2b7a90);queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x1c')]=![];queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x2a')]=null;queues[_0x2b7a90['uniqueid']][_0x87a7('0x1b')]=!![];queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x29')]=utils[_0x87a7('0x14')]();queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x87a7('0x2f');utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2b7a90[_0x87a7('0x4')],queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x8')]));}}catch(_0x480102){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x2e'),_0x2b7a90['uniqueid']),_0x480102);}};exports[_0x87a7('0x30')]=function(_0x5e8687){try{if(!_[_0x87a7('0x18')](queues[_0x5e8687[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x31'),_0x5e8687['uniqueid']),_0x5e8687);utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x32'),_0x5e8687[_0x87a7('0x4')],queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x20')],_0x5e8687[_0x87a7('0x33')],_0x5e8687['connectedlinename']));queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x30')]=!![];queues[_0x5e8687['uniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x34')]=utils[_0x87a7('0x35')](queues[_0x5e8687[_0x87a7('0x4')]]['queuecallerleaveAt'],queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x36')]);queues[_0x5e8687['uniqueid']][_0x87a7('0x13')]=_0x5e8687['position'];queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x37')]=_0x5e8687['count'];queues[_0x5e8687['uniqueid']][_0x87a7('0x33')]=_0x5e8687['connectedlinenum'];queues[_0x5e8687['uniqueid']]['connectedlinename']=_0x5e8687[_0x87a7('0x38')];}}catch(_0x8a15d){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x31'),_0x5e8687[_0x87a7('0x4')]),_0x8a15d);}};exports[_0x87a7('0x39')]=function(_0x35a646){try{if(!_[_0x87a7('0x18')](queues[_0x35a646[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x3a'),_0x35a646['uniqueid']),_0x35a646);utils['info'](util[_0x87a7('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x35a646['uniqueid'],queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x20')],_0x35a646[_0x87a7('0x3b')],_0x35a646[_0x87a7('0x3c')]));queues[_0x35a646[_0x87a7('0x4')]]['queuecallerabandon']=![];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x1c')]=![];queues[_0x35a646['uniqueid']][_0x87a7('0x8')]=null;queues[_0x35a646['uniqueid']][_0x87a7('0x2a')]=null;queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x3d')]=!![];queues[_0x35a646[_0x87a7('0x4')]]['accountcode']=_0x35a646[_0x87a7('0x3c')];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x5')]=_0x35a646[_0x87a7('0x3b')];}}catch(_0x589d3b){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][agentconnect]',_0x35a646[_0x87a7('0x4')]),_0x589d3b);}};exports[_0x87a7('0x3e')]=function(_0x372908){try{if(!_['isNil'](queues[_0x372908[_0x87a7('0x4')]])){if(queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1a')]){utils['debug'](util[_0x87a7('0x3')](_0x87a7('0x3f'),_0x372908[_0x87a7('0x4')]),_0x372908);queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x372908['uniqueid']]['queuecallerexit']=![];queues[_0x372908[_0x87a7('0x4')]]['queuecallerexitAt']=null;queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x3d')]=!![];queues[_0x372908['uniqueid']][_0x87a7('0x5')]=_0x372908[_0x87a7('0x3b')];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1d')]=!![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x40')]=utils['now']();if(_0x372908[_0x87a7('0x41')]=='transfer'){if(!queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x42')]){queues[_0x372908['uniqueid']]['queuecallerexitreason']=_0x87a7('0x43');}}else{queues[_0x372908['uniqueid']][_0x87a7('0x8')]=_0x87a7('0x44')+_0x372908[_0x87a7('0x41')][_0x87a7('0x2b')]();}utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x372908[_0x87a7('0x4')],queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x20')],_0x372908[_0x87a7('0x3b')],queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x372908[_0x87a7('0x4')]]);}}}catch(_0x3cfb3d){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x3f'),_0x372908[_0x87a7('0x4')]),_0x3cfb3d);}};exports[_0x87a7('0x45')]=function(_0xcac62d){try{if(!_[_0x87a7('0x18')](queues[_0xcac62d[_0x87a7('0x46')]])){utils[_0x87a7('0x10')](util['format']('[%s][queues][blindtransfer]',_0xcac62d[_0x87a7('0x4')]),_0xcac62d);queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x42')]=!![];queues[_0xcac62d[_0x87a7('0x46')]]['transfertype']=_0x87a7('0x47');queues[_0xcac62d['transfereeuniqueid']][_0x87a7('0x48')]=_0xcac62d[_0x87a7('0x49')];queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x4a')]=_0xcac62d[_0x87a7('0x46')];queues[_0xcac62d[_0x87a7('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0x87a7('0x3')](_0x87a7('0x4b'),_0xcac62d[_0x87a7('0x4')],queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x20')],_0xcac62d['transfereeuniqueid'],_0xcac62d['extension']));}}catch(_0x38900a){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x4c'),_0xcac62d[_0x87a7('0x4')]),_0x38900a);}};exports[_0x87a7('0x4d')]=function(_0x5aa0e4){try{utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x4e'),_0x5aa0e4[_0x87a7('0x4f')]),_0x5aa0e4);if(_0x5aa0e4['origtransfereruniqueid']==_0x5aa0e4[_0x87a7('0x50')]){if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x51')]])){utils['info'](util[_0x87a7('0x3')](_0x87a7('0x52'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x53')]));queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x42')]=!![];queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x54')]='ATTENDED';queues[_0x5aa0e4[_0x87a7('0x51')]]['transferexten']=_0x5aa0e4['origtransfererexten'];queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x4a')]=_0x5aa0e4[_0x87a7('0x4f')];queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x50')]])){if(_0x5aa0e4[_0x87a7('0x55')]&&queues[_0x5aa0e4[_0x87a7('0x55')]]){queues[_0x5aa0e4[_0x87a7('0x55')]][_0x87a7('0x22')]=0x1;queues[_0x5aa0e4['transfereeuniqueid']]=_['clone'](queues[_0x5aa0e4[_0x87a7('0x55')]]);queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0xf')]=_0x5aa0e4[_0x87a7('0x56')];queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x22')]=0x2;queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x6')]=queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x6')];queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x57')]=queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x57')];queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x36')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x1a')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x46')]]['holdtime']=0x0;queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x58')]=0x0;utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x20')],queues[_0x5aa0e4['transfereeuniqueid']]['calleridnum'],queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x57')]));}else{utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x59'),_0x5aa0e4['origtransfereruniqueid'],queues[_0x5aa0e4[_0x87a7('0x50')]]['name'],_0x5aa0e4[_0x87a7('0x51')]));queues[_0x5aa0e4['origtransfererlinkedid']]['transfereduniqueid']=_0x5aa0e4[_0x87a7('0x51')];}}}else if(_0x5aa0e4['secondtransfereruniqueid']==_0x5aa0e4[_0x87a7('0x51')]){if(!_['isNil'](queues[_0x5aa0e4[_0x87a7('0x50')]])){utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x5a')],_0x5aa0e4[_0x87a7('0x5b')]));queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x42')]=!![];queues[_0x5aa0e4['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x48')]=_0x5aa0e4[_0x87a7('0x5b')];queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x4a')]=_0x5aa0e4['secondtransfereruniqueid'];queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x8')]=_0x87a7('0x5c');}if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x51')]])){if(_0x5aa0e4[_0x87a7('0x5d')]&&queues[_0x5aa0e4[_0x87a7('0x5d')]]){queues[_0x5aa0e4[_0x87a7('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x5aa0e4[_0x87a7('0x56')]]=_[_0x87a7('0x5e')](queues[_0x5aa0e4[_0x87a7('0x5d')]]);queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0xf')]=_0x5aa0e4[_0x87a7('0x56')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x22')]=0x2;queues[_0x5aa0e4['transfertargetuniqueid']][_0x87a7('0x6')]=queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x6')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x57')]=queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x57')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x36')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x1a')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x34')]=0x0;queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x58')]=0x0;utils[_0x87a7('0x2')](util['format'](_0x87a7('0x5f'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x20')],queues[_0x5aa0e4['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x6')],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x57')]));}else{utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x59'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x50')]));queues[_0x5aa0e4['secondtransfererlinkedid']]['transfereduniqueid']=_0x5aa0e4[_0x87a7('0x50')];}}}}catch(_0x56a8cd){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x4e'),_0x5aa0e4['origtransfereruniqueid']),_0x56a8cd);}};exports[_0x87a7('0x60')]=function(_0x469bb0){try{if(!_[_0x87a7('0x18')](queues[_0x469bb0[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x61'),_0x469bb0[_0x87a7('0x4')]),_0x469bb0);queues[_0x469bb0[_0x87a7('0x4')]][_0x87a7('0x62')]=utils[_0x87a7('0x14')]();utils['info'](util[_0x87a7('0x3')](_0x87a7('0x63'),_0x469bb0[_0x87a7('0x4')],queues[_0x469bb0[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x469bb0['uniqueid']][_0x87a7('0x62')]));}}catch(_0x4233b9){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][musiconholdstart]',_0x469bb0[_0x87a7('0x4')]),_0x4233b9);}};exports[_0x87a7('0x64')]=function(_0x49b5f3){try{if(!_['isNil'](queues[_0x49b5f3[_0x87a7('0x4')]])){if(!_[_0x87a7('0x18')](queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')])){utils[_0x87a7('0x10')](util['format'](_0x87a7('0x65'),_0x49b5f3[_0x87a7('0x4')]),_0x49b5f3);queues[_0x49b5f3[_0x87a7('0x4')]]['mohtime']+=utils[_0x87a7('0x35')](utils['now'](),queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')]);utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x49b5f3[_0x87a7('0x4')],queues[_0x49b5f3[_0x87a7('0x4')]]['name'],queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x58')]));delete queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')];}}}catch(_0x9d527c){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x65'),_0x49b5f3[_0x87a7('0x4')]),_0x9d527c);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 94a7031..b806231 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 _0x053d=['[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','queue','info'];(function(_0x18e4ec,_0x57679a){var _0x41a94e=function(_0x3655ab){while(--_0x3655ab){_0x18e4ec['push'](_0x18e4ec['shift']());}};_0x41a94e(++_0x57679a);}(_0x053d,0xeb));var _0xd053=function(_0xbb67b0,_0x1dc227){_0xbb67b0=_0xbb67b0-0x0;var _0x46c17a=_0x053d[_0xbb67b0];return _0x46c17a;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x5ded83){utils[_0xd053('0x0')](util['format'](_0xd053('0x1'),_0x5ded83[_0xd053('0x2')]));if(_0x5ded83[_0xd053('0x3')]){utils[_0xd053('0x4')](_0x5ded83[_0xd053('0x3')])[_0xd053('0x5')](function(_0x36a83b){if(_0x36a83b){_0x5ded83['membername']=_0x36a83b[_0xd053('0x6')];_0x5ded83['UserId']=_0x36a83b['id'];}utils['request']('CreateVoiceRecording',_0x5ded83);});}else{utils[_0xd053('0x7')](_0xd053('0x8'),_0x5ded83);}}exports[_0xd053('0x9')]=function(_0x356333){try{utils['debug'](util[_0xd053('0xa')](_0xd053('0xb'),_0x356333[_0xd053('0x2')]),_0x356333);if(_0x356333[_0xd053('0x2')]==_0x356333[_0xd053('0xc')]){utils['info'](util['format'](_0xd053('0xd'),_0x356333[_0xd053('0x2')],_0x356333[_0xd053('0xe')],_0x356333[_0xd053('0xf')]));recordings[_0x356333[_0xd053('0x2')]]={'uniqueid':_0x356333[_0xd053('0x2')],'accountcode':_0x356333['accountcode'],'exten':_0x356333[_0xd053('0xf')],'context':_0x356333[_0xd053('0xe')],'channel':_0x356333[_0xd053('0x10')],'monitors':[]};}}catch(_0x32eeb4){utils['error'](util[_0xd053('0xa')](_0xd053('0xb'),_0x356333[_0xd053('0x2')]),_0x32eeb4);}};exports['newstate']=function(_0x1bd900){try{utils[_0xd053('0x11')](util[_0xd053('0xa')](_0xd053('0x12'),_0x1bd900['uniqueid']),_0x1bd900);if(!_[_0xd053('0x13')](recordings[_0x1bd900[_0xd053('0x2')]])&&_0x1bd900['channelstate']==0x6){utils['info'](util[_0xd053('0xa')](_0xd053('0x14'),_0x1bd900['uniqueid'],_0x1bd900['context'],_0x1bd900[_0xd053('0x10')]));}else if(!_[_0xd053('0x13')](recordings[_0x1bd900['linkedid']])&&_0x1bd900[_0xd053('0x15')]==0x6&&_0x1bd900[_0xd053('0xe')]!=_0xd053('0x16')){utils[_0xd053('0x0')](util[_0xd053('0xa')](_0xd053('0x17'),_0x1bd900[_0xd053('0x2')],_0x1bd900['linkedid'],_0x1bd900[_0xd053('0xe')],_0x1bd900['channel']));recordings[_0x1bd900['linkedid']]['accountcode']=_0x1bd900[_0xd053('0x3')];}}catch(_0x3d3508){utils[_0xd053('0x18')](util[_0xd053('0xa')]('[%s][recordings][newstate]',_0x1bd900[_0xd053('0x2')]),_0x3d3508);}};exports['varset']=function(_0x3b3121){try{if(!_[_0xd053('0x13')](_0x3b3121['variable'])&&!_['isNil'](_0x3b3121[_0xd053('0x19')][_0xd053('0x1a')])){utils[_0xd053('0x11')](util[_0xd053('0xa')](_0xd053('0x1b'),_0x3b3121[_0xd053('0x2')]),_0x3b3121);utils[_0xd053('0x0')](util[_0xd053('0xa')](_0xd053('0x1c'),_0x3b3121[_0xd053('0x2')],_0x3b3121[_0xd053('0x19')],_0x3b3121[_0xd053('0x1d')]));if(_[_0xd053('0x1e')](_0x3b3121[_0xd053('0x1d')],_0xd053('0x1f'))){_0x3b3121[_0xd053('0x1d')]=_0x3b3121[_0xd053('0x1d')]['replace']('.wav49',_0xd053('0x20'));}if(recordings[_0x3b3121[_0xd053('0xc')]]){var _0x334d3b=_[_0xd053('0x21')](recordings[_0x3b3121[_0xd053('0xc')]]['monitors'],{'value':_0x3b3121[_0xd053('0x1d')]});if(_[_0xd053('0x13')](_0x334d3b)){recordings[_0x3b3121[_0xd053('0xc')]][_0xd053('0x22')][_0xd053('0x23')]({'value':_0x3b3121[_0xd053('0x1d')]});}}}}catch(_0x2f1d07){utils['error'](util['format']('[%s][recordings][varset]',_0x3b3121[_0xd053('0x2')]),_0x2f1d07);}};exports[_0xd053('0x24')]=function(_0x27a948){try{if(!_[_0xd053('0x13')](recordings[_0x27a948[_0xd053('0x2')]])){utils[_0xd053('0x11')](util[_0xd053('0xa')](_0xd053('0x25'),_0x27a948[_0xd053('0x2')]),_0x27a948);utils[_0xd053('0x0')](util[_0xd053('0xa')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x27a948[_0xd053('0x2')],_0x27a948[_0xd053('0x26')],_0x27a948['calleridname'],_0x27a948[_0xd053('0x27')]));recordings[_0x27a948[_0xd053('0x2')]]['calleridnum']=_0x27a948[_0xd053('0x26')];recordings[_0x27a948[_0xd053('0x2')]][_0xd053('0x28')]=_0x27a948[_0xd053('0x28')];recordings[_0x27a948['uniqueid']][_0xd053('0x29')]=_0x27a948[_0xd053('0x29')];recordings[_0x27a948['uniqueid']][_0xd053('0x2a')]=_0x27a948[_0xd053('0x2a')];if(recordings[_0x27a948[_0xd053('0x2')]][_0xd053('0x2b')]==_0xd053('0x2c')&&recordings[_0x27a948['uniqueid']][_0xd053('0x3')]){recordings[_0x27a948[_0xd053('0x2')]][_0xd053('0x29')]=recordings[_0x27a948[_0xd053('0x2')]][_0xd053('0x3')];recordings[_0x27a948[_0xd053('0x2')]]['connectedlinename']='';}recordings[_0x27a948[_0xd053('0x2')]][_0xd053('0x22')]['forEach'](function(_0xa96058){var _0x44274f=_[_0xd053('0x2d')](recordings[_0x27a948[_0xd053('0x2')]]);_0x44274f[_0xd053('0x1d')]=_0xa96058[_0xd053('0x1d')];writeDB(_0x44274f);});delete recordings[_0x27a948['uniqueid']];}}catch(_0x3b1f2f){utils[_0xd053('0x18')](util[_0xd053('0xa')](_0xd053('0x25'),_0x27a948[_0xd053('0x2')]),_0x3b1f2f);}};exports[_0xd053('0x2e')]=function(_0x53bbe0){try{if(!_['isNil'](recordings[_0x53bbe0['uniqueid']])){utils[_0xd053('0x11')](util[_0xd053('0xa')]('[%s][recordings][newexten]',_0x53bbe0['uniqueid']),_0x53bbe0);utils['info'](util['format'](_0xd053('0x2f'),_0x53bbe0['uniqueid'],_0x53bbe0[_0xd053('0x30')],_0x53bbe0[_0xd053('0x31')]));if(_0x53bbe0[_0xd053('0x30')][_0xd053('0x32')]()==_0xd053('0x33')&&_[_0xd053('0x34')](_0x53bbe0['appdata']['toLowerCase'](),'cdr')){var _0x268bc2=_0x53bbe0['appdata'][_0xd053('0x35')]('=');var _0x4c3d9e=_0x268bc2[0x0][_0xd053('0x36')](_0x268bc2[0x0]['lastIndexOf']('(')+0x1,_0x268bc2[0x0][_0xd053('0x37')](')'));var _0x8725d0=_0x268bc2[0x1];recordings[_0x53bbe0[_0xd053('0x2')]][_0x4c3d9e]=_0x8725d0;}}}catch(_0x56c158){utils['error'](util[_0xd053('0xa')](_0xd053('0x38'),_0x53bbe0['uniqueid']),_0x56c158);}};exports['queuecallerjoin']=function(_0x242ebf){try{if(!_[_0xd053('0x13')](recordings[_0x242ebf[_0xd053('0x2')]])){utils[_0xd053('0x11')](util['format'](_0xd053('0x39'),_0x242ebf['uniqueid']),_0x242ebf);utils['info'](util[_0xd053('0xa')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x242ebf[_0xd053('0x2')],_0x242ebf['queue']));recordings[_0x242ebf[_0xd053('0x2')]][_0xd053('0x3a')]=_0x242ebf['queue'];}}catch(_0x14768b){utils[_0xd053('0x18')](util['format']('[%s][recordings][queuecallerjoin]',_0x242ebf[_0xd053('0x2')]),_0x14768b);}}; \ No newline at end of file +var _0xcb9c=['[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','monitors','hangup','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','substring','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','debug'];(function(_0x2e0378,_0x2154bd){var _0x232451=function(_0x372e02){while(--_0x372e02){_0x2e0378['push'](_0x2e0378['shift']());}};_0x232451(++_0x2154bd);}(_0xcb9c,0x154));var _0xccb9=function(_0x3da018,_0x417d66){_0x3da018=_0x3da018-0x0;var _0x348d57=_0xcb9c[_0x3da018];return _0x348d57;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0xa140e2){utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x4'),_0xa140e2['uniqueid']));if(_0xa140e2[_0xccb9('0x5')]){utils[_0xccb9('0x6')](_0xa140e2[_0xccb9('0x5')])[_0xccb9('0x7')](function(_0x5957ae){if(_0x5957ae){_0xa140e2[_0xccb9('0x8')]=_0x5957ae[_0xccb9('0x9')];_0xa140e2[_0xccb9('0xa')]=_0x5957ae['id'];}utils['request'](_0xccb9('0xb'),_0xa140e2);});}else{utils[_0xccb9('0xc')](_0xccb9('0xb'),_0xa140e2);}}exports['newchannel']=function(_0x123751){try{utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0xe'),_0x123751[_0xccb9('0xf')]),_0x123751);if(_0x123751[_0xccb9('0xf')]==_0x123751[_0xccb9('0x10')]){utils[_0xccb9('0x2')](util['format'](_0xccb9('0x11'),_0x123751[_0xccb9('0xf')],_0x123751[_0xccb9('0x12')],_0x123751['exten']));recordings[_0x123751[_0xccb9('0xf')]]={'uniqueid':_0x123751[_0xccb9('0xf')],'accountcode':_0x123751[_0xccb9('0x5')],'exten':_0x123751[_0xccb9('0x13')],'context':_0x123751[_0xccb9('0x12')],'channel':_0x123751[_0xccb9('0x14')],'monitors':[]};}}catch(_0x289da2){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0xe'),_0x123751[_0xccb9('0xf')]),_0x289da2);}};exports[_0xccb9('0x16')]=function(_0x4629ae){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x4629ae[_0xccb9('0xf')]),_0x4629ae);if(!_[_0xccb9('0x17')](recordings[_0x4629ae['uniqueid']])&&_0x4629ae[_0xccb9('0x18')]==0x6){utils['info'](util['format'](_0xccb9('0x19'),_0x4629ae['uniqueid'],_0x4629ae[_0xccb9('0x12')],_0x4629ae['channel']));}else if(!_[_0xccb9('0x17')](recordings[_0x4629ae[_0xccb9('0x10')]])&&_0x4629ae[_0xccb9('0x18')]==0x6&&_0x4629ae[_0xccb9('0x12')]!=_0xccb9('0x1a')){utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x1b'),_0x4629ae[_0xccb9('0xf')],_0x4629ae[_0xccb9('0x10')],_0x4629ae[_0xccb9('0x12')],_0x4629ae[_0xccb9('0x14')]));recordings[_0x4629ae[_0xccb9('0x10')]][_0xccb9('0x5')]=_0x4629ae[_0xccb9('0x5')];}}catch(_0x1a8579){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0x1c'),_0x4629ae['uniqueid']),_0x1a8579);}};exports[_0xccb9('0x1d')]=function(_0x1ea63d){try{if(!_['isNil'](_0x1ea63d[_0xccb9('0x1e')])&&!_[_0xccb9('0x17')](_0x1ea63d[_0xccb9('0x1e')]['mixmonitor_filename'])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x1f'),_0x1ea63d['uniqueid']),_0x1ea63d);utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x20'),_0x1ea63d[_0xccb9('0xf')],_0x1ea63d[_0xccb9('0x1e')],_0x1ea63d['value']));if(_[_0xccb9('0x21')](_0x1ea63d[_0xccb9('0x22')],_0xccb9('0x23'))){_0x1ea63d[_0xccb9('0x22')]=_0x1ea63d['value'][_0xccb9('0x24')](_0xccb9('0x23'),'.WAV');}if(recordings[_0x1ea63d['linkedid']]){var _0x50fddd=_[_0xccb9('0x25')](recordings[_0x1ea63d[_0xccb9('0x10')]][_0xccb9('0x26')],{'value':_0x1ea63d['value']});if(_[_0xccb9('0x17')](_0x50fddd)){recordings[_0x1ea63d[_0xccb9('0x10')]][_0xccb9('0x26')]['push']({'value':_0x1ea63d['value']});}}}}catch(_0x1de6e2){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0x1f'),_0x1ea63d[_0xccb9('0xf')]),_0x1de6e2);}};exports[_0xccb9('0x27')]=function(_0x54a649){try{if(!_['isNil'](recordings[_0x54a649[_0xccb9('0xf')]])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x28'),_0x54a649[_0xccb9('0xf')]),_0x54a649);utils[_0xccb9('0x2')](util[_0xccb9('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x54a649[_0xccb9('0xf')],_0x54a649['calleridnum'],_0x54a649[_0xccb9('0x29')],_0x54a649['cause-txt']));recordings[_0x54a649['uniqueid']][_0xccb9('0x2a')]=_0x54a649[_0xccb9('0x2a')];recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x29')]=_0x54a649['calleridname'];recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x2b')]=_0x54a649[_0xccb9('0x2b')];recordings[_0x54a649[_0xccb9('0xf')]]['connectedlinename']=_0x54a649[_0xccb9('0x2c')];if(recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x2d')]==_0xccb9('0x2e')&&recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x5')]){recordings[_0x54a649[_0xccb9('0xf')]]['connectedlinenum']=recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x5')];recordings[_0x54a649['uniqueid']][_0xccb9('0x2c')]='';}recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x26')]['forEach'](function(_0x21b890){var _0x3013e4=_[_0xccb9('0x2f')](recordings[_0x54a649[_0xccb9('0xf')]]);_0x3013e4[_0xccb9('0x22')]=_0x21b890[_0xccb9('0x22')];writeDB(_0x3013e4);});delete recordings[_0x54a649['uniqueid']];}}catch(_0x196862){utils[_0xccb9('0x15')](util['format'](_0xccb9('0x28'),_0x54a649[_0xccb9('0xf')]),_0x196862);}};exports[_0xccb9('0x30')]=function(_0x5b215c){try{if(!_[_0xccb9('0x17')](recordings[_0x5b215c[_0xccb9('0xf')]])){utils['debug'](util[_0xccb9('0x3')](_0xccb9('0x31'),_0x5b215c[_0xccb9('0xf')]),_0x5b215c);utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x32'),_0x5b215c[_0xccb9('0xf')],_0x5b215c[_0xccb9('0x33')],_0x5b215c[_0xccb9('0x34')]));if(_0x5b215c[_0xccb9('0x33')]['toLowerCase']()==_0xccb9('0x35')&&_['startsWith'](_0x5b215c[_0xccb9('0x34')][_0xccb9('0x36')](),'cdr')){var _0x5cbf8f=_0x5b215c[_0xccb9('0x34')][_0xccb9('0x37')]('=');var _0x305678=_0x5cbf8f[0x0][_0xccb9('0x38')](_0x5cbf8f[0x0]['lastIndexOf']('(')+0x1,_0x5cbf8f[0x0]['lastIndexOf'](')'));var _0x52094f=_0x5cbf8f[0x1];recordings[_0x5b215c[_0xccb9('0xf')]][_0x305678]=_0x52094f;}}}catch(_0x64e9ac){utils['error'](util[_0xccb9('0x3')](_0xccb9('0x31'),_0x5b215c[_0xccb9('0xf')]),_0x64e9ac);}};exports['queuecallerjoin']=function(_0x11c1b2){try{if(!_[_0xccb9('0x17')](recordings[_0x11c1b2[_0xccb9('0xf')]])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x39'),_0x11c1b2['uniqueid']),_0x11c1b2);utils[_0xccb9('0x2')](util[_0xccb9('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x11c1b2[_0xccb9('0xf')],_0x11c1b2['queue']));recordings[_0x11c1b2[_0xccb9('0xf')]]['queue']=_0x11c1b2[_0xccb9('0x3a')];}}catch(_0x5e8eb0){utils[_0xccb9('0x15')](util['format'](_0xccb9('0x39'),_0x11c1b2['uniqueid']),_0x5e8eb0);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 384819e..027926b 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 _0xef72=['debug','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer'];(function(_0x215ac7,_0x4c1c19){var _0x15fcbd=function(_0x384537){while(--_0x384537){_0x215ac7['push'](_0x215ac7['shift']());}};_0x15fcbd(++_0x4c1c19);}(_0xef72,0x137));var _0x2ef7=function(_0x3f8bd7,_0x40c1a1){_0x3f8bd7=_0x3f8bd7-0x0;var _0x4c7193=_0xef72[_0x3f8bd7];return _0x4c7193;};'use strict';var _=require(_0x2ef7('0x0'));var util=require(_0x2ef7('0x1'));var utils=require(_0x2ef7('0x2'));function writeDB(_0x300f5c){utils[_0x2ef7('0x3')](util[_0x2ef7('0x4')](_0x2ef7('0x5'),_0x300f5c[_0x2ef7('0x6')]==='attended'?_0x300f5c[_0x2ef7('0x7')]:_0x300f5c['uniqueid'],_0x300f5c['type']));utils[_0x2ef7('0x8')]('CreateVoiceTransferReport',_0x300f5c);}exports[_0x2ef7('0x9')]={};exports[_0x2ef7('0xa')]=function(_0x3fdefc){try{utils[_0x2ef7('0xb')](util['format']('[%s][transfers][blindtransfer]',_0x3fdefc['uniqueid']),_0x3fdefc);utils[_0x2ef7('0x3')](util[_0x2ef7('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3fdefc[_0x2ef7('0xc')],_0x3fdefc[_0x2ef7('0xd')],_0x3fdefc[_0x2ef7('0xe')],_0x3fdefc[_0x2ef7('0xf')],_0x3fdefc[_0x2ef7('0x10')]));_0x3fdefc['type']=_0x2ef7('0x11');exports['blinds'][_0x3fdefc[_0x2ef7('0x12')]]=_0x3fdefc;writeDB(_0x3fdefc);}catch(_0x213e65){utils['error'](util['format'](_0x2ef7('0x13'),_0x3fdefc['uniqueid']),_0x213e65);}};exports[_0x2ef7('0x14')]=function(_0x1a74d2){try{utils[_0x2ef7('0xb')](util['format'](_0x2ef7('0x15'),_0x1a74d2[_0x2ef7('0x7')]),_0x1a74d2);utils[_0x2ef7('0x3')](util[_0x2ef7('0x4')](_0x2ef7('0x16'),_0x1a74d2['origtransfereruniqueid'],_0x1a74d2[_0x2ef7('0x17')],_0x1a74d2[_0x2ef7('0x18')],_0x1a74d2[_0x2ef7('0x19')],_0x1a74d2[_0x2ef7('0x1a')]));_0x1a74d2=_[_0x2ef7('0x1b')](_0x1a74d2,{'transfererchannel':_0x1a74d2[_0x2ef7('0x1c')],'transferercalleridnum':_0x1a74d2[_0x2ef7('0x17')],'transferercalleridname':_0x1a74d2[_0x2ef7('0x18')],'transfererconnectedlinenum':_0x1a74d2[_0x2ef7('0x1d')],'transfererconnectedlinename':_0x1a74d2[_0x2ef7('0x1e')],'transfereraccountcode':_0x1a74d2[_0x2ef7('0x1f')],'transferercontext':_0x1a74d2[_0x2ef7('0x20')],'transfererexten':_0x1a74d2[_0x2ef7('0x21')],'transfererlinkedid':_0x1a74d2[_0x2ef7('0x22')],'context':_0x1a74d2[_0x2ef7('0x23')],'extension':_0x1a74d2[_0x2ef7('0x24')],'type':_0x2ef7('0x25')});if(_[_0x2ef7('0x26')](_0x1a74d2[_0x2ef7('0x27')])){_0x1a74d2=_[_0x2ef7('0x1b')](_0x1a74d2,{'transfereechannel':_0x1a74d2['transfertargetchannel'],'transfereecalleridnum':_0x1a74d2['transfertargetcalleridnum'],'transfereecalleridname':_0x1a74d2[_0x2ef7('0x1a')],'transfereeconnectedlinenum':_0x1a74d2[_0x2ef7('0x28')],'transfereeconnectedlinename':_0x1a74d2[_0x2ef7('0x29')],'transfereeaccountcode':_0x1a74d2[_0x2ef7('0x2a')],'transfereecontext':_0x1a74d2['transfertargetcontext'],'transfereeexten':_0x1a74d2[_0x2ef7('0x2b')],'transfereelinkedid':_0x1a74d2[_0x2ef7('0x2c')]});}writeDB(_0x1a74d2);}catch(_0x1d47c2){utils[_0x2ef7('0x2d')](util['format'](_0x2ef7('0x15'),_0x1a74d2[_0x2ef7('0x7')]),_0x1d47c2);}}; \ No newline at end of file +var _0x9fe0=['type','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','attended','origtransfereruniqueid','uniqueid'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x9fe0,0x110));var _0x09fe=function(_0xc51d6d,_0x4eeadc){_0xc51d6d=_0xc51d6d-0x0;var _0x386ef3=_0x9fe0[_0xc51d6d];return _0x386ef3;};'use strict';var _=require(_0x09fe('0x0'));var util=require(_0x09fe('0x1'));var utils=require(_0x09fe('0x2'));function writeDB(_0x3b40b7){utils[_0x09fe('0x3')](util[_0x09fe('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x3b40b7['type']===_0x09fe('0x5')?_0x3b40b7[_0x09fe('0x6')]:_0x3b40b7[_0x09fe('0x7')],_0x3b40b7[_0x09fe('0x8')]));utils['request'](_0x09fe('0x9'),_0x3b40b7);}exports[_0x09fe('0xa')]={};exports['blindtransfer']=function(_0x3c2823){try{utils[_0x09fe('0xb')](util[_0x09fe('0x4')](_0x09fe('0xc'),_0x3c2823[_0x09fe('0x7')]),_0x3c2823);utils[_0x09fe('0x3')](util[_0x09fe('0x4')](_0x09fe('0xd'),_0x3c2823[_0x09fe('0x7')],_0x3c2823['transferercalleridnum'],_0x3c2823[_0x09fe('0xe')],_0x3c2823[_0x09fe('0xf')],_0x3c2823['transfereecalleridname']));_0x3c2823['type']=_0x09fe('0x10');exports[_0x09fe('0xa')][_0x3c2823[_0x09fe('0x11')]]=_0x3c2823;writeDB(_0x3c2823);}catch(_0x399936){utils['error'](util[_0x09fe('0x4')](_0x09fe('0xc'),_0x3c2823[_0x09fe('0x7')]),_0x399936);}};exports[_0x09fe('0x12')]=function(_0x2cacb7){try{utils[_0x09fe('0xb')](util[_0x09fe('0x4')]('[%s][transfers][attendedtransfer]',_0x2cacb7[_0x09fe('0x6')]),_0x2cacb7);utils[_0x09fe('0x3')](util[_0x09fe('0x4')](_0x09fe('0x13'),_0x2cacb7['origtransfereruniqueid'],_0x2cacb7[_0x09fe('0x14')],_0x2cacb7[_0x09fe('0x15')],_0x2cacb7[_0x09fe('0x16')],_0x2cacb7['transfertargetcalleridname']));_0x2cacb7=_['assign'](_0x2cacb7,{'transfererchannel':_0x2cacb7[_0x09fe('0x17')],'transferercalleridnum':_0x2cacb7[_0x09fe('0x14')],'transferercalleridname':_0x2cacb7[_0x09fe('0x15')],'transfererconnectedlinenum':_0x2cacb7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2cacb7[_0x09fe('0x18')],'transfereraccountcode':_0x2cacb7[_0x09fe('0x19')],'transferercontext':_0x2cacb7['secondtransferercontext'],'transfererexten':_0x2cacb7[_0x09fe('0x1a')],'transfererlinkedid':_0x2cacb7['origtransfererlinkedid'],'context':_0x2cacb7[_0x09fe('0x1b')],'extension':_0x2cacb7['origtransfererexten'],'type':_0x09fe('0x5')});if(_[_0x09fe('0x1c')](_0x2cacb7[_0x09fe('0x1d')])){_0x2cacb7=_[_0x09fe('0x1e')](_0x2cacb7,{'transfereechannel':_0x2cacb7[_0x09fe('0x1f')],'transfereecalleridnum':_0x2cacb7[_0x09fe('0x16')],'transfereecalleridname':_0x2cacb7[_0x09fe('0x20')],'transfereeconnectedlinenum':_0x2cacb7[_0x09fe('0x21')],'transfereeconnectedlinename':_0x2cacb7[_0x09fe('0x22')],'transfereeaccountcode':_0x2cacb7[_0x09fe('0x23')],'transfereecontext':_0x2cacb7[_0x09fe('0x24')],'transfereeexten':_0x2cacb7['transfertargetexten'],'transfereelinkedid':_0x2cacb7[_0x09fe('0x25')]});}writeDB(_0x2cacb7);}catch(_0x5de837){utils[_0x09fe('0x26')](util[_0x09fe('0x4')](_0x09fe('0x27'),_0x2cacb7[_0x09fe('0x6')]),_0x5de837);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d9f6531..dfedc97 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 _0x276d=['inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','result','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','subtract','diffTime','diff','sumTime','now','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info'];(function(_0x44c029,_0x14cc23){var _0x238ae3=function(_0x539d3c){while(--_0x539d3c){_0x44c029['push'](_0x44c029['shift']());}};_0x238ae3(++_0x14cc23);}(_0x276d,0xe3));var _0xd276=function(_0x20401b,_0xabfc49){_0x20401b=_0x20401b-0x0;var _0x34d458=_0x276d[_0x20401b];return _0x34d458;};'use strict';var BPromise=require(_0xd276('0x0'));var jayson=require(_0xd276('0x1'));var moment=require('moment');var util=require(_0xd276('0x2'));var client=jayson[_0xd276('0x3')][_0xd276('0x4')]({'port':0x2329});var logger=require(_0xd276('0x5'))(_0xd276('0x6'));exports[_0xd276('0x7')]=function(_0x509403,_0x2f5400){logger[_0xd276('0x7')](_0x509403,_0x2f5400?util[_0xd276('0x8')](_0x2f5400,{'showHidden':![],'depth':null}):'');};exports[_0xd276('0x9')]=function(_0x442420,_0x131b62){logger[_0xd276('0x9')](_0x442420,_0x131b62?util[_0xd276('0x8')](_0x131b62,{'showHidden':![],'depth':null}):'');};exports[_0xd276('0xa')]=function(_0x2df541,_0x3b7129){logger[_0xd276('0xa')](_0x2df541,_0x3b7129?util[_0xd276('0x8')](_0x3b7129,{'showHidden':![],'depth':null}):'');};exports[_0xd276('0xb')]=function(_0x15f92c,_0x23d828){return client[_0xd276('0xb')](_0x15f92c,{'body':_0x23d828})['then'](function(_0x2b09cd){logger[_0xd276('0x9')](_0xd276('0xc'),_0x15f92c,_0x2b09cd?util['inspect'](_0x2b09cd,{'showHidden':![],'depth':null}):'');})[_0xd276('0xd')](function(_0x4ad28a){logger[_0xd276('0xa')](_0xd276('0xc'),_0x15f92c,_0x4ad28a?util[_0xd276('0x8')](_0x4ad28a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2ae0f3){return client[_0xd276('0xb')](_0xd276('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xd276('0xf'),_0xd276('0x10')],'where':_0x2ae0f3,'limit':0x1}})['then'](function(_0x1b804f){logger['debug'](_0xd276('0x11'),JSON['stringify'](_0x2ae0f3),_0x1b804f?util[_0xd276('0x8')](_0x1b804f,{'showHidden':![],'depth':null}):'');return _0x1b804f['result']['length']?_0x1b804f[_0xd276('0x12')][0x0]:null;});}exports[_0xd276('0x13')]=function(_0x82460){return new BPromise(function(_0xfc0991,_0x3773af){if(_0x82460){return getUser({'internal':_0x82460})[_0xd276('0x14')](function(_0x191d46){logger[_0xd276('0x7')](_0xd276('0x15'),_0x82460,_0x191d46?_0xd276('0x16'):_0xd276('0x17'));return _0xfc0991(_0x191d46);})[_0xd276('0xd')](function(_0x14c5dc){logger[_0xd276('0xa')](_0xd276('0x18'),_0x14c5dc?util['inspect'](_0x14c5dc,{'showHidden':![],'depth':null}):'');return _0xfc0991(null);});}return _0xfc0991(null);});};exports[_0xd276('0x19')]=function(_0x525e35){return new BPromise(function(_0x422282,_0x360efd){if(_0x525e35){return getUser({'interface':_0x525e35})[_0xd276('0x14')](function(_0x374e9b){logger[_0xd276('0x7')](_0xd276('0x1a'),_0x525e35,_0x374e9b?_0xd276('0x16'):_0xd276('0x17'));return _0x422282(_0x374e9b);})[_0xd276('0xd')](function(_0x350742){logger['error']('[utils][getUserByInterface]',_0x350742?util[_0xd276('0x8')](_0x350742,{'showHidden':![],'depth':null}):'');return _0x422282(null);});}return _0x422282(null);});};exports[_0xd276('0x1b')]=function(_0x1fdfd4){return new BPromise(function(_0x57512e,_0x521f26){if(_0x1fdfd4){return getUser({'name':_0x1fdfd4})[_0xd276('0x14')](function(_0x14e3a9){logger[_0xd276('0x7')](_0xd276('0x1c'),_0x1fdfd4,_0x14e3a9?_0xd276('0x16'):_0xd276('0x17'));return _0x57512e(_0x14e3a9);})[_0xd276('0xd')](function(_0x1feace){logger[_0xd276('0xa')]('[utils][getUserByName]',_0x1feace?util[_0xd276('0x8')](_0x1feace,{'showHidden':![],'depth':null}):'');return _0x57512e(null);});}return _0x57512e(null);});};exports[_0xd276('0x1d')]=function(_0x929d9a){return new BPromise(function(_0x6d9cd5,_0x252acc){if(_0x929d9a){return client['request'](_0xd276('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xd276('0xf'),'type','acw',_0xd276('0x1f')],'where':{'name':_0x929d9a},'limit':0x1}})[_0xd276('0x14')](function(_0x13e4cc){logger[_0xd276('0x9')](_0xd276('0x20'),_0x929d9a,_0x13e4cc?util[_0xd276('0x8')](_0x13e4cc,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x929d9a,_0x13e4cc?'found':_0xd276('0x17'));return _0x6d9cd5(_0x13e4cc['result'][_0xd276('0x21')]?_0x13e4cc[_0xd276('0x12')][0x0]:null);})[_0xd276('0xd')](function(_0x85d5f2){logger[_0xd276('0xa')](_0xd276('0x22'),_0x85d5f2?util['inspect'](_0x85d5f2,{'showHidden':![],'depth':null}):'');return _0x6d9cd5(null);});}return _0x6d9cd5(null);});};exports[_0xd276('0x23')]=function(_0x141aa2,_0x4752b8){return moment(_0x141aa2)['add'](_0x4752b8,_0xd276('0x24'))[_0xd276('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd276('0x26')]=function(_0x19a048,_0xede458){return moment(_0x19a048)[_0xd276('0x27')](_0xede458,_0xd276('0x24'))[_0xd276('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd276('0x28')]=function(_0x13336d,_0x5d7180){return moment(_0x13336d)[_0xd276('0x29')](moment(_0x5d7180),_0xd276('0x24'));};exports[_0xd276('0x2a')]=function(_0xea2fb4,_0x3a7832){return parseInt(_0xea2fb4,0xa)+parseInt(_0x3a7832,0xa);};exports[_0xd276('0x2b')]=function(){return moment()[_0xd276('0x25')](_0xd276('0x2c'));};exports[_0xd276('0x2d')]=function(_0x246ff7,_0x21b4df){if(_0x21b4df){return moment(_0x246ff7)[_0xd276('0x2d')](_0x21b4df);}return!![];};exports[_0xd276('0x2e')]=function(_0x5bfaf6,_0x395afa){if(_0x395afa){return moment(_0x5bfaf6)[_0xd276('0x2e')](_0x395afa);}else if(_0x5bfaf6){return!![];}return![];}; \ No newline at end of file +var _0x8c7a=['util','client','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x3e9790,_0xdb8c53){var _0x463864=function(_0x248684){while(--_0x248684){_0x3e9790['push'](_0x3e9790['shift']());}};_0x463864(++_0xdb8c53);}(_0x8c7a,0x197));var _0xa8c7=function(_0x21bb91,_0x58d317){_0x21bb91=_0x21bb91-0x0;var _0x126672=_0x8c7a[_0x21bb91];return _0x126672;};'use strict';var BPromise=require(_0xa8c7('0x0'));var jayson=require(_0xa8c7('0x1'));var moment=require(_0xa8c7('0x2'));var util=require(_0xa8c7('0x3'));var client=jayson[_0xa8c7('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xa8c7('0x5')]=function(_0x44d295,_0x40d483){logger[_0xa8c7('0x5')](_0x44d295,_0x40d483?util['inspect'](_0x40d483,{'showHidden':![],'depth':null}):'');};exports[_0xa8c7('0x6')]=function(_0x373404,_0x1ecf2d){logger[_0xa8c7('0x6')](_0x373404,_0x1ecf2d?util[_0xa8c7('0x7')](_0x1ecf2d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xa2cd18,_0x46ed47){logger[_0xa8c7('0x8')](_0xa2cd18,_0x46ed47?util[_0xa8c7('0x7')](_0x46ed47,{'showHidden':![],'depth':null}):'');};exports[_0xa8c7('0x9')]=function(_0x12a837,_0x45efd3){return client[_0xa8c7('0x9')](_0x12a837,{'body':_0x45efd3})[_0xa8c7('0xa')](function(_0x16079e){logger[_0xa8c7('0x6')](_0xa8c7('0xb'),_0x12a837,_0x16079e?util['inspect'](_0x16079e,{'showHidden':![],'depth':null}):'');})[_0xa8c7('0xc')](function(_0x4bf0b9){logger[_0xa8c7('0x8')]('[utils][request]\x20name:%s',_0x12a837,_0x4bf0b9?util[_0xa8c7('0x7')](_0x4bf0b9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4eef96){return client[_0xa8c7('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0x4eef96,'limit':0x1}})[_0xa8c7('0xa')](function(_0x4bb8e6){logger[_0xa8c7('0x6')](_0xa8c7('0xd'),JSON[_0xa8c7('0xe')](_0x4eef96),_0x4bb8e6?util['inspect'](_0x4bb8e6,{'showHidden':![],'depth':null}):'');return _0x4bb8e6[_0xa8c7('0xf')]['length']?_0x4bb8e6['result'][0x0]:null;});}exports[_0xa8c7('0x10')]=function(_0x55bfa6){return new BPromise(function(_0x34ba74,_0x4a6db0){if(_0x55bfa6){return getUser({'internal':_0x55bfa6})[_0xa8c7('0xa')](function(_0x42ef56){logger[_0xa8c7('0x5')](_0xa8c7('0x11'),_0x55bfa6,_0x42ef56?_0xa8c7('0x12'):_0xa8c7('0x13'));return _0x34ba74(_0x42ef56);})[_0xa8c7('0xc')](function(_0x4bf821){logger['error']('[utils][getUserByInternal]',_0x4bf821?util[_0xa8c7('0x7')](_0x4bf821,{'showHidden':![],'depth':null}):'');return _0x34ba74(null);});}return _0x34ba74(null);});};exports[_0xa8c7('0x14')]=function(_0x38ca4e){return new BPromise(function(_0x4b0b7e,_0x4c71b4){if(_0x38ca4e){return getUser({'interface':_0x38ca4e})[_0xa8c7('0xa')](function(_0x5badb2){logger[_0xa8c7('0x5')](_0xa8c7('0x15'),_0x38ca4e,_0x5badb2?'found':'notfound');return _0x4b0b7e(_0x5badb2);})[_0xa8c7('0xc')](function(_0x530b84){logger[_0xa8c7('0x8')](_0xa8c7('0x16'),_0x530b84?util[_0xa8c7('0x7')](_0x530b84,{'showHidden':![],'depth':null}):'');return _0x4b0b7e(null);});}return _0x4b0b7e(null);});};exports[_0xa8c7('0x17')]=function(_0x53aabb){return new BPromise(function(_0x384a8d,_0x1ee770){if(_0x53aabb){return getUser({'name':_0x53aabb})[_0xa8c7('0xa')](function(_0x26c23d){logger[_0xa8c7('0x5')](_0xa8c7('0x18'),_0x53aabb,_0x26c23d?_0xa8c7('0x12'):'notfound');return _0x384a8d(_0x26c23d);})[_0xa8c7('0xc')](function(_0x2cb8b2){logger[_0xa8c7('0x8')](_0xa8c7('0x19'),_0x2cb8b2?util[_0xa8c7('0x7')](_0x2cb8b2,{'showHidden':![],'depth':null}):'');return _0x384a8d(null);});}return _0x384a8d(null);});};exports['getVoiceQueueByName']=function(_0x1161d7){return new BPromise(function(_0x5d2c4b,_0x3bc365){if(_0x1161d7){return client[_0xa8c7('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa8c7('0x1a'),'type',_0xa8c7('0x1b'),_0xa8c7('0x1c')],'where':{'name':_0x1161d7},'limit':0x1}})['then'](function(_0x344e96){logger[_0xa8c7('0x6')](_0xa8c7('0x1d'),_0x1161d7,_0x344e96?util['inspect'](_0x344e96,{'showHidden':![],'depth':null}):'');logger[_0xa8c7('0x5')](_0xa8c7('0x1e'),_0x1161d7,_0x344e96?'found':_0xa8c7('0x13'));return _0x5d2c4b(_0x344e96['result'][_0xa8c7('0x1f')]?_0x344e96[_0xa8c7('0xf')][0x0]:null);})[_0xa8c7('0xc')](function(_0x1e8154){logger[_0xa8c7('0x8')](_0xa8c7('0x20'),_0x1e8154?util[_0xa8c7('0x7')](_0x1e8154,{'showHidden':![],'depth':null}):'');return _0x5d2c4b(null);});}return _0x5d2c4b(null);});};exports['addTime']=function(_0x1a6e4e,_0x258c3a){return moment(_0x1a6e4e)[_0xa8c7('0x21')](_0x258c3a,_0xa8c7('0x22'))[_0xa8c7('0x23')](_0xa8c7('0x24'));};exports['subtractTime']=function(_0x2250e7,_0x474a05){return moment(_0x2250e7)[_0xa8c7('0x25')](_0x474a05,_0xa8c7('0x22'))[_0xa8c7('0x23')](_0xa8c7('0x24'));};exports['diffTime']=function(_0x14833c,_0x423a28){return moment(_0x14833c)[_0xa8c7('0x26')](moment(_0x423a28),'seconds');};exports['sumTime']=function(_0x3ec927,_0xc5d163){return parseInt(_0x3ec927,0xa)+parseInt(_0xc5d163,0xa);};exports['now']=function(){return moment()[_0xa8c7('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa8c7('0x27')]=function(_0x345618,_0x2f6d59){if(_0x2f6d59){return moment(_0x345618)[_0xa8c7('0x27')](_0x2f6d59);}return!![];};exports[_0xa8c7('0x28')]=function(_0x56e252,_0x7b0db8){if(_0x7b0db8){return moment(_0x56e252)['isBefore'](_0x7b0db8);}else if(_0x56e252){return!![];}return![];}; \ No newline at end of file